@epam/ai-dial-chat-hooks 1.2.0-dev.28 → 1.2.0-dev.282

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 (94) hide show
  1. package/api-error/api-error.js +7 -4
  2. package/attachment/useAttachmentValidation/useAttachmentValidation.js +26 -19
  3. package/attachments.d.ts +10 -4
  4. package/catalog/catalog-derivations.js +1 -1
  5. package/catalog/deployment-id.js +8 -2
  6. package/catalog/map-deployment-limits-to-catalog.js +16 -24
  7. package/catalog/map-deployment-limits-to-input.js +81 -9
  8. package/catalog/map-deployment-to-catalog-item.js +34 -34
  9. package/catalog/map-entity-details-to-catalog.js +7 -0
  10. package/catalog/map-skill-to-catalog-item.js +55 -48
  11. package/catalog/publish.js +6 -5
  12. package/catalog/useApplicationCredentials/useApplicationCredentials.js +39 -0
  13. package/catalog/useCatalogEditNavigation/useCatalogEditNavigation.js +122 -101
  14. package/catalog/usePublishFolders/usePublishFolders.js +1 -1
  15. package/catalog/useSkillDetailsPanelData/useSkillDetailsPanelData.js +39 -39
  16. package/catalog/useSkillItemDetails.js +17 -13
  17. package/catalog.d.ts +139 -34
  18. package/catalog.js +23 -22
  19. package/conversation/conversation-transfer/export-conversation.js +24 -16
  20. package/conversation/conversation-transfer/import-conversation.js +80 -31
  21. package/conversation/conversation-transfer/queue.js +8 -5
  22. package/conversation/create-chat-stream-api.js +85 -49
  23. package/conversation/message-utils.js +44 -2
  24. package/conversation/stage.js +27 -0
  25. package/conversation/useActiveConversationSync/useActiveConversationSync.js +7 -8
  26. package/conversation/useConversationExport/useConversationExport.js +9 -9
  27. package/conversation/useConversationHandlers/useConversationHandlers.js +73 -57
  28. package/conversation/useConversationImport/useConversationImport.js +123 -121
  29. package/conversation/useConversationPanelItems/useConversationPanelItems.js +50 -32
  30. package/conversation/useConversationScroll/useConversationScroll.js +68 -64
  31. package/conversation/useConversationStream/apply-chunk.js +1 -1
  32. package/conversation/useConversationStream/frame-scheduler.js +39 -0
  33. package/conversation/useConversationStream/generation-resume.js +122 -64
  34. package/conversation/useConversationStream/useConversationStream.js +265 -116
  35. package/conversation/useMessageSelectionReply/useMessageSelectionReply.js +189 -0
  36. package/conversation-sources/useConversationSources/useConversationSources.js +31 -24
  37. package/conversation-sources.d.ts +1 -1
  38. package/conversation-transfer.d.ts +2 -1
  39. package/conversation.d.ts +295 -17
  40. package/conversation.js +32 -29
  41. package/file-manager-canvas.d.ts +53 -5
  42. package/file-manager.d.ts +156 -26
  43. package/file-manager.js +25 -23
  44. package/files/attachment-canvas.js +74 -40
  45. package/files/attachment-types.js +14 -13
  46. package/files/dial-file-manager-mapping.util.js +2 -1
  47. package/files/dial-file-manager-path.util.js +23 -1
  48. package/files/dial-file-manager.model.js +23 -19
  49. package/files/dial-file-manager.types.js +3 -3
  50. package/files/useDialFileListing/useDialFileListing.js +139 -127
  51. package/files/useDialFileManager/useDialFileManager.js +132 -128
  52. package/files/useDialFileManagerSections/useDialFileManagerSections.js +155 -0
  53. package/files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.js +20 -19
  54. package/files/useDialFileMutations/useDialFileMutations.js +33 -32
  55. package/files/useDialFileUploadBatch/useDialFileUploadBatch.js +117 -110
  56. package/files/useFileAttachmentPicker/useFileAttachmentPicker.js +49 -0
  57. package/index.d.ts +1178 -112
  58. package/index.js +136 -122
  59. package/mcp-apps/useMcpAppHostAdapter/useMcpAppHostAdapter.js +7 -5
  60. package/mcp-apps/useMcpAppHostContext/useMcpAppHostContext.js +1 -1
  61. package/mcp-apps/useMcpAppTools/useMcpAppTools.js +1 -1
  62. package/mcp-apps/useOpenMcpAppCanvas/useOpenMcpAppCanvas.js +25 -23
  63. package/mcp-apps.d.ts +8 -6
  64. package/oauth/toolset-id.js +5 -3
  65. package/oauth/useToolsetLogin/useToolsetLogin.js +8 -8
  66. package/oauth.d.ts +32 -0
  67. package/oauth.js +9 -9
  68. package/package.json +26 -21
  69. package/scheduled-task/scheduled-task-description.js +81 -0
  70. package/scheduled-task/scheduled-task-preparation.js +24 -0
  71. package/scheduled-task/scheduled-task-trigger.js +74 -71
  72. package/scheduled-task/scheduled-tasks-api-client.js +19 -0
  73. package/scheduled-task/use-scheduled-task-runs.js +194 -0
  74. package/scheduled-task/use-scheduled-tasks.js +93 -0
  75. package/scheduled-tasks.d.ts +197 -3
  76. package/scheduled-tasks.js +7 -2
  77. package/shared/application-schema.js +5 -2
  78. package/shared/cron-day-of-month.js +13 -0
  79. package/skill/skill-archive.js +19 -0
  80. package/skill/skill-types.js +8 -7
  81. package/skill/skill.js +53 -27
  82. package/skill/useSkillArchiveImport/useSkillArchiveImport.js +79 -0
  83. package/skill/useSkillEditorLoad.js +65 -59
  84. package/skill/useSkillEditorSubmit.js +108 -84
  85. package/skill/useSkillFileActions.js +70 -58
  86. package/skill-editor.d.ts +160 -8
  87. package/skill-editor.js +9 -8
  88. package/usage/map-usage-data-to-dashboard.js +66 -0
  89. package/usage/map-user-usage-to-model-limits.js +202 -0
  90. package/usage.d.ts +125 -0
  91. package/usage.js +3 -0
  92. package/usePageFileDrag/usePageFileDrag.js +3 -3
  93. package/utils.d.ts +26 -6
  94. package/utils.js +10 -10
package/catalog.d.ts CHANGED
@@ -1,4 +1,7 @@
1
+ import { ApplicationExternalServiceDto } from '@epam/ai-dial-chat-api-client';
2
+ import { ApplicationSchemaSummaryDto } from '@epam/ai-dial-chat-api-client';
1
3
  import { CatalogContentTreeNode } from '@epam/ai-dial-catalog';
4
+ import { CatalogCreateSearch } from '@epam/ai-dial-catalog';
2
5
  import { CatalogEntityType } from '@epam/ai-dial-chat-shared';
3
6
  import { CatalogItem } from '@epam/ai-dial-catalog';
4
7
  import { CatalogItemApiDetails } from '@epam/ai-dial-catalog';
@@ -14,8 +17,11 @@ import { DeploymentLimitsResponseDto } from '@epam/ai-dial-chat-api-client';
14
17
  import { DialToolsetAuthSettingsDto } from '@epam/ai-dial-chat-api-client';
15
18
  import { DialToolsetDto } from '@epam/ai-dial-chat-api-client';
16
19
  import { DropdownItem } from '@epam/ai-dial-ui-kit';
20
+ import { ExternalServicesApi } from '@epam/ai-dial-chat-api-client';
21
+ import { LimitStatsDto } from '@epam/ai-dial-chat-api-client';
17
22
  import { ListFilesResponseDto } from '@epam/ai-dial-chat-api-client';
18
23
  import { NotificationVariant } from '@epam/ai-dial-ui-kit';
24
+ import { OfflineCredentialsApi } from '@epam/ai-dial-chat-api-client';
19
25
  import { PromptResponseDto } from '@epam/ai-dial-chat-api-client';
20
26
  import { PublicationRule } from '@epam/ai-dial-publish-panel';
21
27
  import { PublishApi } from '@epam/ai-dial-chat-api-client';
@@ -32,6 +38,7 @@ import { ToolsetLoginBodyDto } from '@epam/ai-dial-chat-api-client';
32
38
  import { ToolsetLogoutBodyDto } from '@epam/ai-dial-chat-api-client';
33
39
  import { UnpublishCatalogEntityDto } from '@epam/ai-dial-chat-api-client';
34
40
  import { UnpublishResultDto } from '@epam/ai-dial-chat-api-client';
41
+ import { UsageLimitProgressRow } from '@epam/ai-dial-catalog';
35
42
 
36
43
  /** Feature-support flags for an agent (application) deployment. */
37
44
  export declare interface AgentCapabilities {
@@ -47,6 +54,7 @@ export declare interface AgentCapabilities {
47
54
  hasConfiguration?: boolean;
48
55
  hasChatCompletion?: boolean;
49
56
  hasResponsesApi?: boolean;
57
+ hasSkills?: boolean;
50
58
  }
51
59
 
52
60
  /** Input-attachment configuration for an agent (application) deployment. */
@@ -105,6 +113,8 @@ export declare const buildDeploymentConnectApi: (baseUrl: string, id: string, {
105
113
  */
106
114
  export declare const buildPromptOverview: (prompt: PromptResponseDto, labels: PromptOverviewLabels) => CatalogItemOverview;
107
115
 
116
+ export declare const buildResetFields: (stats: LimitStatsDto, formatResetTime: FormatResetTime | undefined) => Pick<UsageLimitProgressRow, "resetLabel" | "resetIsoValue" | "resetAriaLabel">;
117
+
108
118
  /** Builds the Responses API endpoint URL for a deployment. */
109
119
  export declare const buildResponsesUrl: (baseUrl: string) => string;
110
120
 
@@ -119,7 +129,9 @@ export declare const buildResponsesUrl: (baseUrl: string) => string;
119
129
  * itself) contributes no node. Every folder entry is attached under its own
120
130
  * stripped path so an empty grouping folder still appears; every file entry
121
131
  * attaches under the folder chain its stripped path implies, synthesizing
122
- * any intermediate folder the listing never enumerated on its own. A file
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
123
135
  * node's `id` is the listing entry's own (unstripped) path, so it round-trips
124
136
  * back to `downloadSkillFile` without being re-derived; a folder node's `id`
125
137
  * is the stripped path and only keys client-side expand/collapse state.
@@ -132,6 +144,13 @@ export declare const buildSkillContentTree: (files: SkillMetadataItemDto[], skil
132
144
  * authored it, when it last changed, and its file inventory. Grouping folders
133
145
  * in the file listing are excluded from both the count and the rows. Sizes are
134
146
  * not shown — the skill metadata carries no content-length field.
147
+ *
148
+ * `skill` is the authoritative `getSkillMetadata` response when that request
149
+ * fulfilled; the caller falls back to the catalog listing entry only when it
150
+ * rejected (`useSkillItemDetails`'s `onFetchSkillDetails`). Either way, this
151
+ * function never fills a gap in one source from the other — an absent
152
+ * `author` omits the row and an absent `updatedAt` leaves the updated row's
153
+ * value empty, exactly as `skill` carries it.
135
154
  */
136
155
  export declare const buildSkillOverview: (skill: SkillMetadataItemDto | undefined, files: SkillMetadataItemDto[], about: SkillAboutDetails | undefined, labels: SkillOverviewLabels) => CatalogItemOverview;
137
156
 
@@ -152,7 +171,6 @@ export declare interface CatalogDetailsApi extends SkillDetailsApi {
152
171
 
153
172
  /** Localized copy `useCatalogEditNavigation` needs for the Create menu and delete errors. */
154
173
  export declare interface CatalogEditNavigationLabels {
155
- createQuickApp: string;
156
174
  createToolset: string;
157
175
  createCustomApp: string;
158
176
  createSkill: string;
@@ -190,9 +208,9 @@ export declare interface CatalogEditNavigationUrls {
190
208
  buildCustomAppEditUrl(appId: string): string;
191
209
  /** URL to create a new custom (schema-less) app. */
192
210
  buildCustomAppCreateUrl(): string;
193
- /** 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. */
194
212
  buildQuickAppEditUrl(schemaId: string, appId: string): string;
195
- /** 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. */
196
214
  buildQuickAppCreateUrl(schemaId: string): string;
197
215
  }
198
216
 
@@ -237,6 +255,28 @@ export declare enum CatalogPrimaryActionType {
237
255
  */
238
256
  export declare type CatalogPublishEntityType = 'model' | 'toolset' | 'application' | 'prompt' | 'skill';
239
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
+
240
280
  /**
241
281
  * Wraps the generated `PublishApi` in the positional-argument surface the
242
282
  * catalog and conversation publish flows call, so each host app re-exports one
@@ -245,6 +285,15 @@ export declare type CatalogPublishEntityType = 'model' | 'toolset' | 'applicatio
245
285
  */
246
286
  export declare const createPublishApiClient: (publishApi: PublishApi) => PublishApiClient;
247
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
+
248
297
  /** Translated folder-path labels for the Personal/Shared/Public deployment groupings. */
249
298
  export declare interface DeploymentFolderLabels {
250
299
  personal: string;
@@ -262,16 +311,14 @@ export declare interface DeploymentGenerationApiSupport {
262
311
  export declare interface DeploymentLimitsLabels {
263
312
  /** Heading of the group every token stat row is listed under. */
264
313
  tokenGroup: string;
265
- /** Label for the tokens-per-day stat row. */
314
+ /** Label for the current-UTC-day token row, e.g. "Today". */
266
315
  tokensPerDay: string;
267
- /** Label for the tokens-per-week stat row. */
316
+ /** Label for the current-UTC-week token row, e.g. "This week". */
268
317
  tokensPerWeek: string;
269
- /** Label for the tokens-per-month stat row. */
318
+ /** Label for the current-UTC-month token row, e.g. "This month". */
270
319
  tokensPerMonth: string;
271
320
  /** Note shown instead of a total on a row whose limit follows the cost limit. */
272
321
  followsCostLimit: string;
273
- /** Formats the "$X spent" caption under a row's label. */
274
- formatSpentCaption: (amount: string) => string;
275
322
  /** Formats the combined used/total display value for a capped row. */
276
323
  formatValueLabel: (used: string, total: string) => string;
277
324
  /** Formats the ARIA label for a capped progress row. */
@@ -285,6 +332,8 @@ export declare interface DeploymentLimitsLabels {
285
332
  label: string;
286
333
  used: string;
287
334
  }) => string;
335
+ /** Formats each period's `resetsAt` into the row's reset line. Omit it to render rows without one. */
336
+ formatResetTime?: FormatResetTime;
288
337
  }
289
338
 
290
339
  /**
@@ -294,7 +343,7 @@ export declare interface DeploymentLimitsLabels {
294
343
  export declare const deriveAvailableTabIds: <T extends CatalogEntityType>(items: readonly CatalogItem[], tabOrder: readonly T[]) => T[];
295
344
 
296
345
  /**
297
- * Returns items marked as a user favorite, in original order.
346
+ * Returns items marked as a user favorite that are not hidden, in original order.
298
347
  */
299
348
  export declare const deriveFavoriteItems: (items: readonly CatalogItem[]) => CatalogItem[];
300
349
 
@@ -359,6 +408,9 @@ export declare const filterHiddenOwnedItems: (items: readonly CatalogItem[], hid
359
408
  */
360
409
  export declare const findDeploymentByIdOrReference: (deployments: DeploymentItemDto[], idOrReference: string | null | undefined) => DeploymentItemDto | undefined;
361
410
 
411
+ /** Formats a raw `resetsAt` into display strings, or returns `undefined` when it cannot be formatted. */
412
+ declare type FormatResetTime = (resetsAt: string | undefined) => ResetTimeDisplay | undefined;
413
+
362
414
  /**
363
415
  * The publish folder a public catalog entity id sits in: the segments between
364
416
  * the `public` bucket and the entity name, decoded to the plain text the
@@ -396,8 +448,8 @@ export declare const mapDeploymentDetailsDtoToEntityDetails: (dto: DeploymentDet
396
448
  /** Maps a deployment limits DTO to display-ready catalog limits, or `undefined` when no qualifying stats exist. */
397
449
  export declare const mapDeploymentLimitsDtoToCatalogLimits: (dto: DeploymentLimitsResponseDto | undefined, labels: DeploymentLimitsLabels) => CatalogItemLimits | undefined;
398
450
 
399
- /** Maps the monthly deployment token limit to a display-ready value. */
400
- export declare const mapDeploymentLimitsToInput: (dto: DeploymentLimitsResponseDto | undefined) => MonthlyUsageLimit | undefined;
451
+ /** 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. */
452
+ export declare const mapDeploymentLimitsToInput: (dto: DeploymentLimitsResponseDto | undefined, labels: ConversationInputLimitsLabels, formatResetTime?: FormatResetTime) => CatalogItemLimits | undefined;
401
453
 
402
454
  /** Maps a deployment listing row into the catalog UI's `CatalogItem` shape. */
403
455
  export declare const mapDeploymentToCatalogItem: (deployment: DeploymentItemDto, { favoriteIds, entityDetails, folderLabels, editableSchemaIds, isCustomAppsEditable, activeLocale, primaryLocale, resolveIconUrl, }: MapDeploymentToCatalogItemOptions) => CatalogItem;
@@ -540,6 +592,7 @@ export declare interface ModelCapabilities {
540
592
  hasResume?: boolean;
541
593
  hasChatCompletion?: boolean;
542
594
  hasResponsesApi?: boolean;
595
+ hasSkills?: boolean;
543
596
  reasoningEfforts?: string[];
544
597
  }
545
598
 
@@ -579,17 +632,19 @@ export declare interface ModelSpecification {
579
632
  createdAt?: number;
580
633
  }
581
634
 
582
- /** Normalized monthly token usage consumed by the conversation input control. */
583
- export declare interface MonthlyUsageLimit {
584
- /** Normalized used-token count. */
585
- used: number;
586
- /** Configured monthly token limit. */
587
- total: number;
588
- /** Remaining monthly tokens, clamped to zero. */
589
- remaining: number;
590
- /** Monthly utilization percentage, clamped to 0–100. */
591
- usedPercent: number;
592
- }
635
+ /**
636
+ * Encodes a deployment/application id to its single-encoded form regardless
637
+ * of whether the value it received was already percent-encoded or the raw,
638
+ * human-readable form — decoding first then re-encoding once is idempotent
639
+ * either way, since `decodeDeploymentId` on a raw (unencoded) id is a no-op.
640
+ * Use this instead of `encodeDeploymentId` at a boundary that cannot
641
+ * guarantee which form it receives, such as a `postMessage` payload from the
642
+ * settings iframe: calling `encodeDeploymentId` directly on a value the
643
+ * sender already encoded escapes the existing `%` characters a second time
644
+ * (`%20` becomes `%2520`), which the backend only ever undoes once and so
645
+ * 404s on.
646
+ */
647
+ export declare const normalizeDeploymentId: (id: string) => string;
593
648
 
594
649
  /** A skill resource URL split into the bucket and the path within it. */
595
650
  export declare interface ParsedSkillResourceUrl {
@@ -623,7 +678,11 @@ declare enum PromptSource {
623
678
  Public = "public"
624
679
  }
625
680
 
626
- /** DIAL Core bucket holding organisation-wide skills. */
681
+ /**
682
+ * DIAL Core bucket holding organisation-wide skills.
683
+ *
684
+ * @deprecated Use `PUBLIC_BUCKET` from `@epam/ai-dial-chat-shared`.
685
+ */
627
686
  export declare const PUBLIC_SKILL_BUCKET = "public";
628
687
 
629
688
  /** The DIAL publish API surface produced by {@link createPublishApiClient}. */
@@ -683,6 +742,23 @@ export declare const readSkillManifest: (response: Response) => Promise<string |
683
742
  */
684
743
  export declare const reconcileFilterTopics: (persistedTopics: ReadonlySet<string>, items: readonly CatalogItem[]) => Set<string>;
685
744
 
745
+ /**
746
+ * One reset time, already parsed and formatted by the host. Declared
747
+ * structurally here so this library never imports an application type; the
748
+ * host passes a value that satisfies this shape (e.g. `apps/chat`'s own
749
+ * `ResetTimeDisplay`).
750
+ */
751
+ declare interface ResetTimeDisplay {
752
+ /** Exclusive end of the period as an epoch ms value, for the host's boundary scheduling. */
753
+ resetsAtMs: number;
754
+ /** Machine-readable instant for a `<time dateTime>` attribute. */
755
+ isoValue: string;
756
+ /** Visible reset line. */
757
+ label: string;
758
+ /** Accessible expansion of the reset line. */
759
+ ariaLabel: string;
760
+ }
761
+
686
762
  /**
687
763
  * Resolves the primary action for a catalog item.
688
764
  *
@@ -757,6 +833,12 @@ export declare interface SkillDetailsApi {
757
833
  limit?: number;
758
834
  recursive?: boolean;
759
835
  }, signal?: AbortSignal): Promise<SkillFileListResponseDto>;
836
+ /**
837
+ * Fetches a single skill's own authoritative metadata (`author`,
838
+ * `updatedAt`, and the rest of `SkillMetadataItemDto`) — not the catalog
839
+ * listing entry, which may be sparse for a shared skill.
840
+ */
841
+ getSkillMetadata(bucket: string, path: string, signal?: AbortSignal): Promise<SkillMetadataItemDto>;
760
842
  }
761
843
 
762
844
  /** A skill's parsed manifest details. */
@@ -899,13 +981,32 @@ export declare const toPublishEntityType: (type: CatalogEntityType) => CatalogPu
899
981
  */
900
982
  export declare const toPublishRuleDto: (rule: PublicationRule) => PublishRuleDto;
901
983
 
984
+ /** Loads fresh service statuses without coupling proactive credentials to a live completion. */
985
+ export declare const useApplicationCredentials: ({ appId, externalServicesClient, offlineCredentialsClient, }: UseApplicationCredentialsParams) => {
986
+ services: ApplicationExternalServiceDto[];
987
+ isOfflineConnected: boolean;
988
+ isLoading: boolean;
989
+ hasError: boolean;
990
+ refresh: () => Promise<void>;
991
+ };
992
+
993
+ /** Configured operations for loading application credential metadata. */
994
+ export declare interface UseApplicationCredentialsParams {
995
+ /** Application identifier passed through to the configured client. */
996
+ appId: string;
997
+ /** Host-configured external-services API. */
998
+ externalServicesClient: Pick<ExternalServicesApi, 'listExternalServices'>;
999
+ /** Host-configured offline-credentials API. */
1000
+ offlineCredentialsClient: Pick<OfflineCredentialsApi, 'getOfflineCredentials'>;
1001
+ }
1002
+
902
1003
  /**
903
1004
  * Owns the catalog's edit/delete/create-menu navigation: routing the details
904
1005
  * panel's Edit action to the right editor URL for each item type, deleting an
905
1006
  * item through the endpoint its type owns and refetching/notifying on
906
1007
  * completion, and building the Create dropdown's options.
907
1008
  */
908
- export declare const useCatalogEditNavigation: ({ deployments, isCustomAppsEnabled, isSchemaAppsEnabled, isHideCustomAppCreationEnabled, isToolsetsEnabled, isPromptsEnabled, quickAppSchemaId, urls, onNavigate, deletePrompt, deleteToolset, deleteSkill, deleteApplication, refetchPrompts, refetchToolsets, refetchSkills, refetchDeployments, onDeleteSuccess, labels, onNotify, onSkillUploadClick, }: UseCatalogEditNavigationParams) => UseCatalogEditNavigationResult;
1009
+ 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;
909
1010
 
910
1011
  /** Parameters accepted by {@link useCatalogEditNavigation}. */
911
1012
  export declare interface UseCatalogEditNavigationParams {
@@ -915,8 +1016,8 @@ export declare interface UseCatalogEditNavigationParams {
915
1016
  isHideCustomAppCreationEnabled: boolean;
916
1017
  isToolsetsEnabled: boolean;
917
1018
  isPromptsEnabled: boolean;
918
- /** The quick-app schema id resolved by `useCatalogItems`, or `undefined` when no quick-app schema exists. */
919
- quickAppSchemaId: string | undefined;
1019
+ /** Application type schemas (runners) loaded at startup; each one except the custom-app schema gets its own Create option. */
1020
+ schemas: ApplicationSchemaSummaryDto[];
920
1021
  /** Already-configured editor-route URL builders. */
921
1022
  urls: CatalogEditNavigationUrls;
922
1023
  /** Navigates the host to a URL built by `urls`. */
@@ -947,7 +1048,10 @@ export declare interface UseCatalogEditNavigationParams {
947
1048
  export declare interface UseCatalogEditNavigationResult {
948
1049
  handleEdit: (item: CatalogItem) => void;
949
1050
  handleDelete: (item: CatalogItem) => Promise<void>;
1051
+ /** The Create dropdown's items: runners and static options sorted together by label, all filtered by `createSearch.value`. */
950
1052
  createOptions: DropdownItem[];
1053
+ /** The Create menu's search field state, or `undefined` when no runner option is offered. */
1054
+ createSearch: CatalogCreateSearch | undefined;
951
1055
  }
952
1056
 
953
1057
  /**
@@ -1125,9 +1229,9 @@ export declare interface UsePublishFoldersResult {
1125
1229
  */
1126
1230
  onCreatePublishFolder: (parentPath: string[], name: string) => Promise<void>;
1127
1231
  /**
1128
- * Records `folderPath` as a publish destination the user has actually used,
1129
- * so it keeps appearing in the tree on later publishes. Call it after a
1130
- * successful publish.
1232
+ * Records `folderPath` as the most recent publish destination (moving it to
1233
+ * the front if already remembered), so it keeps appearing in the tree on
1234
+ * later publishes. Call it after a successful publish.
1131
1235
  */
1132
1236
  rememberPublishFolder: (folderPath: string[]) => void;
1133
1237
  /** Heuristic write-access check for a folder path (see the TODO above). */
@@ -1218,10 +1322,11 @@ export declare interface UseSkillFilePreviewResult {
1218
1322
 
1219
1323
  /**
1220
1324
  * Headless hook that encapsulates skill detail fetching: manifest download and
1221
- * parse, package file listing, overview construction, and in-package file
1222
- * loads. `useCatalogItemDetails` delegates its skill branch here; hosts that
1223
- * only surface skill details consume this hook directly, without the
1224
- * deployment and prompt ports the full catalog pipeline requires.
1325
+ * parse, package file listing, authoritative metadata fetching, overview
1326
+ * construction, and in-package file loads. `useCatalogItemDetails` delegates
1327
+ * its skill branch here; hosts that only surface skill details consume this
1328
+ * hook directly, without the deployment and prompt ports the full catalog
1329
+ * pipeline requires.
1225
1330
  */
1226
1331
  export declare const useSkillItemDetails: ({ api, skills, skillOverviewLabels, }: UseSkillItemDetailsOptions) => UseSkillItemDetailsResult;
1227
1332
 
package/catalog.js CHANGED
@@ -1,24 +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 { encodeDeploymentId as a, findDeploymentByIdOrReference as o } from "./catalog/deployment-id.js";
4
- import { AuthenticationType as s } from "./catalog/entity-details.js";
5
- import { mapDeploymentLimitsDtoToCatalogLimits as c } from "./catalog/map-deployment-limits-to-catalog.js";
6
- import { mapDeploymentLimitsToInput as l } from "./catalog/map-deployment-limits-to-input.js";
7
- import { mapDeploymentDetailsDtoToEntityDetails as u, mapEntityDetailsToCatalogDetails as d, mapToolsetCredentials as f } from "./catalog/map-entity-details-to-catalog.js";
8
- import { mapDeploymentToCatalogItem as p, mapDeploymentToolsetCredentials as m, mapToolsetToCatalogItem as h, resolveDeploymentFolder as g } from "./catalog/map-deployment-to-catalog-item.js";
9
- import { buildPromptOverview as _, isOrganisationPromptItem as v, mapPromptToCatalogItem as y } from "./catalog/map-prompt-to-catalog-item.js";
10
- import { PUBLIC_SKILL_BUCKET as b, SKILL_LISTING_MAX_PAGES as x, SKILL_LISTING_PAGE_SIZE as S, SKILL_MANIFEST_MAX_BYTES as C, SkillSource as w, parseSkillResourceUrl as T } from "./skill/skill-types.js";
11
- import { buildSkillContentTree as E, buildSkillOverview as D, mapSkillToCatalogItem as O, readSkillFileBytes as k, readSkillFilePreviewBytes as A, readSkillManifest as j, resolveSkillFileDownloadPath as M, resolveSkillManifestFileId as N } from "./catalog/map-skill-to-catalog-item.js";
12
- import { McpResourceKind as P, buildApplicationMcpUrl as F, buildConnectApi as I, buildToolsetMcpUrl as L, resolveMcpResourceKind as R } from "./catalog/mcp-endpoint-url.js";
13
- import { getPublicCatalogEntityFolderPath as z, isPublicCatalogEntityId as B, mapPublishConversationResultDto as V, mapPublishHistoryEntryDto as H, toPublishEntityType as U } from "./catalog/publish.js";
14
- import { deriveAvailableTabIds as W, deriveFavoriteItems as G, filterCatalogItemsBySelector as K, filterHiddenOwnedItems as q, reconcileFilterTopics as J } from "./catalog/catalog-derivations.js";
15
- import { CatalogPrimaryActionType as Y, resolveCatalogPrimaryAction as X } from "./catalog/catalog-primary-action.js";
16
- import { useCatalogEditNavigation as Z } from "./catalog/useCatalogEditNavigation/useCatalogEditNavigation.js";
17
- import { useSkillItemDetails as Q } from "./catalog/useSkillItemDetails.js";
18
- import { useCatalogItemDetails as $ } from "./catalog/useCatalogItemDetails.js";
19
- import { useCatalogToolsetCredentials as ee } from "./catalog/useCatalogToolsetCredentials/useCatalogToolsetCredentials.js";
20
- import { useSkillDetailsPanelData as te } from "./catalog/useSkillDetailsPanelData/useSkillDetailsPanelData.js";
21
- import { FavoriteEntityType as ne, useFavoriteEntitiesState as re } from "./catalog/useFavoriteEntitiesState/useFavoriteEntitiesState.js";
22
- import { usePublishFolders as ie } from "./catalog/usePublishFolders/usePublishFolders.js";
23
- import { SkillPreviewErrorKind as ae, useSkillFilePreview as oe } from "./skill/useSkillFilePreview.js";
24
- export { s as AuthenticationType, Y as CatalogPrimaryActionType, ne as FavoriteEntityType, P as McpResourceKind, b as PUBLIC_SKILL_BUCKET, x as SKILL_LISTING_MAX_PAGES, S as SKILL_LISTING_PAGE_SIZE, C as SKILL_MANIFEST_MAX_BYTES, ae as SkillPreviewErrorKind, w as SkillSource, F as buildApplicationMcpUrl, n as buildChatCompletionsUrl, I as buildConnectApi, r as buildDeploymentConnectApi, _ as buildPromptOverview, i as buildResponsesUrl, E as buildSkillContentTree, D as buildSkillOverview, L as buildToolsetMcpUrl, e as createPublishApiClient, W as deriveAvailableTabIds, G as deriveFavoriteItems, a as encodeDeploymentId, K as filterCatalogItemsBySelector, q as filterHiddenOwnedItems, o as findDeploymentByIdOrReference, z as getPublicCatalogEntityFolderPath, v as isOrganisationPromptItem, B as isPublicCatalogEntityId, u as mapDeploymentDetailsDtoToEntityDetails, c as mapDeploymentLimitsDtoToCatalogLimits, l as mapDeploymentLimitsToInput, p as mapDeploymentToCatalogItem, m as mapDeploymentToolsetCredentials, d as mapEntityDetailsToCatalogDetails, y as mapPromptToCatalogItem, V as mapPublishConversationResultDto, H as mapPublishHistoryEntryDto, O as mapSkillToCatalogItem, f as mapToolsetCredentials, h as mapToolsetToCatalogItem, T as parseSkillResourceUrl, k as readSkillFileBytes, A as readSkillFilePreviewBytes, j as readSkillManifest, J as reconcileFilterTopics, X as resolveCatalogPrimaryAction, g as resolveDeploymentFolder, R as resolveMcpResourceKind, M as resolveSkillFileDownloadPath, N as resolveSkillManifestFileId, U as toPublishEntityType, t as toPublishRuleDto, Z as useCatalogEditNavigation, $ as useCatalogItemDetails, ee as useCatalogToolsetCredentials, re as useFavoriteEntitiesState, ie as usePublishFolders, te as useSkillDetailsPanelData, oe as useSkillFilePreview, Q as useSkillItemDetails };
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 { mapDeploymentDetailsDtoToEntityDetails as p, mapEntityDetailsToCatalogDetails as m, mapToolsetCredentials as h } from "./catalog/map-entity-details-to-catalog.js";
8
+ import { mapDeploymentToCatalogItem as g, mapDeploymentToolsetCredentials as _, mapToolsetToCatalogItem as v, resolveDeploymentFolder as y } from "./catalog/map-deployment-to-catalog-item.js";
9
+ import { buildPromptOverview as b, isOrganisationPromptItem as x, mapPromptToCatalogItem as S } from "./catalog/map-prompt-to-catalog-item.js";
10
+ import { PUBLIC_SKILL_BUCKET as C, SKILL_LISTING_MAX_PAGES as w, SKILL_LISTING_PAGE_SIZE as T, SKILL_MANIFEST_MAX_BYTES as E, SkillSource as D, parseSkillResourceUrl as O } from "./skill/skill-types.js";
11
+ import { buildSkillContentTree as k, buildSkillOverview as A, mapSkillToCatalogItem as j, readSkillFileBytes as M, readSkillFilePreviewBytes as N, readSkillManifest as P, resolveSkillFileDownloadPath as F, resolveSkillManifestFileId as I } from "./catalog/map-skill-to-catalog-item.js";
12
+ import { McpResourceKind as L, buildApplicationMcpUrl as R, buildConnectApi as z, buildToolsetMcpUrl as B, resolveMcpResourceKind as V } from "./catalog/mcp-endpoint-url.js";
13
+ import { getPublicCatalogEntityFolderPath as H, isPublicCatalogEntityId as U, mapPublishConversationResultDto as W, mapPublishHistoryEntryDto as G, toPublishEntityType as K } from "./catalog/publish.js";
14
+ import { deriveAvailableTabIds as q, deriveFavoriteItems as J, filterCatalogItemsBySelector as Y, filterHiddenOwnedItems as X, reconcileFilterTopics as Z } from "./catalog/catalog-derivations.js";
15
+ import { CatalogPrimaryActionType as Q, resolveCatalogPrimaryAction as $ } from "./catalog/catalog-primary-action.js";
16
+ import { useCatalogEditNavigation as ee } from "./catalog/useCatalogEditNavigation/useCatalogEditNavigation.js";
17
+ import { useSkillItemDetails as te } from "./catalog/useSkillItemDetails.js";
18
+ import { useCatalogItemDetails as ne } from "./catalog/useCatalogItemDetails.js";
19
+ import { useCatalogToolsetCredentials as re } from "./catalog/useCatalogToolsetCredentials/useCatalogToolsetCredentials.js";
20
+ import { useApplicationCredentials as ie } from "./catalog/useApplicationCredentials/useApplicationCredentials.js";
21
+ import { useSkillDetailsPanelData as ae } from "./catalog/useSkillDetailsPanelData/useSkillDetailsPanelData.js";
22
+ import { FavoriteEntityType as oe, useFavoriteEntitiesState as se } from "./catalog/useFavoriteEntitiesState/useFavoriteEntitiesState.js";
23
+ import { usePublishFolders as ce } from "./catalog/usePublishFolders/usePublishFolders.js";
24
+ import { SkillPreviewErrorKind as le, useSkillFilePreview as ue } from "./skill/useSkillFilePreview.js";
25
+ export { l as AuthenticationType, Q as CatalogPrimaryActionType, oe as FavoriteEntityType, L as McpResourceKind, C as PUBLIC_SKILL_BUCKET, w as SKILL_LISTING_MAX_PAGES, T as SKILL_LISTING_PAGE_SIZE, E as SKILL_MANIFEST_MAX_BYTES, le as SkillPreviewErrorKind, D as SkillSource, R as buildApplicationMcpUrl, n as buildChatCompletionsUrl, z as buildConnectApi, r as buildDeploymentConnectApi, b as buildPromptOverview, u as buildResetFields, i as buildResponsesUrl, k as buildSkillContentTree, A as buildSkillOverview, B as buildToolsetMcpUrl, e as createPublishApiClient, a as decodeDeploymentId, q as deriveAvailableTabIds, J as deriveFavoriteItems, o as encodeDeploymentId, Y as filterCatalogItemsBySelector, X as filterHiddenOwnedItems, s as findDeploymentByIdOrReference, H as getPublicCatalogEntityFolderPath, x as isOrganisationPromptItem, U as isPublicCatalogEntityId, p as mapDeploymentDetailsDtoToEntityDetails, f as mapDeploymentLimitsDtoToCatalogLimits, d as mapDeploymentLimitsToInput, g as mapDeploymentToCatalogItem, _ as mapDeploymentToolsetCredentials, m as mapEntityDetailsToCatalogDetails, S as mapPromptToCatalogItem, W as mapPublishConversationResultDto, G as mapPublishHistoryEntryDto, j as mapSkillToCatalogItem, h as mapToolsetCredentials, v as mapToolsetToCatalogItem, c as normalizeDeploymentId, O as parseSkillResourceUrl, M as readSkillFileBytes, N as readSkillFilePreviewBytes, P as readSkillManifest, Z as reconcileFilterTopics, $ as resolveCatalogPrimaryAction, y as resolveDeploymentFolder, V as resolveMcpResourceKind, F as resolveSkillFileDownloadPath, I as resolveSkillManifestFileId, K as toPublishEntityType, t as toPublishRuleDto, ie as useApplicationCredentials, ee as useCatalogEditNavigation, ne as useCatalogItemDetails, re as useCatalogToolsetCredentials, se as useFavoriteEntitiesState, ce as usePublishFolders, ae as useSkillDetailsPanelData, ue as useSkillFilePreview, te 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: i, ...a } = t;
8
- if (n == null && i == null) return e;
9
- let o = {
10
- ...a,
11
- ...i ? { stages: r(i) } : {}
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(o).length > 0) return {
21
+ if (Object.keys(c).length > 0) return {
14
22
  ...e,
15
- custom_content: o
23
+ custom_content: c
16
24
  };
17
- let { custom_content: s, ...c } = e;
18
- return c;
19
- }, a = (e) => ({
25
+ let { custom_content: l, ...u } = e;
26
+ return u;
27
+ }, o = (e) => ({
20
28
  ...e,
21
- messages: e.messages.map(i)
22
- }), o = (e, t = []) => ({
29
+ messages: e.messages.map(a)
30
+ }), s = (e, t = []) => ({
23
31
  version: 5,
24
32
  history: e,
25
33
  folders: t
26
- }), s = (e) => new Blob([JSON.stringify(e, null, 2)], { type: "application/json" }), c = {
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
- }, l = (t, n, r = /* @__PURE__ */ new Date()) => `${e(r)}_${n}_${t}.${c[t]}`;
38
+ }, u = (t, n, r = /* @__PURE__ */ new Date()) => `${e(r)}_${n}_${t}.${l[t]}`;
31
39
  //#endregion
32
- export { n as EXPORT_APP_NAME, o as buildExportEnvelope, l as buildExportFileName, s as serializeExportEnvelope, a as stripConversationAttachments };
40
+ export { n as EXPORT_APP_NAME, s as buildExportEnvelope, u as buildExportFileName, c as serializeExportEnvelope, o as stripConversationAttachments };