@epam/ai-dial-chat-hooks 1.2.0-dev.20 → 1.2.0-dev.207

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 (89) hide show
  1. package/api-error/api-error.js +5 -4
  2. package/attachment/useAttachmentValidation/useAttachmentValidation.js +26 -19
  3. package/attachments.d.ts +10 -4
  4. package/catalog/catalog-derivations.js +1 -1
  5. package/catalog/deployment-id.js +8 -2
  6. package/catalog/map-deployment-limits-to-input.js +81 -9
  7. package/catalog/map-deployment-to-catalog-item.js +34 -34
  8. package/catalog/map-entity-details-to-catalog.js +7 -0
  9. package/catalog/map-skill-to-catalog-item.js +30 -27
  10. package/catalog/publish.js +6 -5
  11. package/catalog/useApplicationCredentials/useApplicationCredentials.js +39 -0
  12. package/catalog/useSkillDetailsPanelData/useSkillDetailsPanelData.js +39 -39
  13. package/catalog/useSkillItemDetails.js +17 -13
  14. package/catalog.d.ts +116 -20
  15. package/catalog.js +23 -22
  16. package/conversation/conversation-transfer/export-conversation.js +24 -16
  17. package/conversation/conversation-transfer/import-conversation.js +80 -31
  18. package/conversation/conversation-transfer/queue.js +8 -5
  19. package/conversation/create-chat-stream-api.js +85 -49
  20. package/conversation/message-utils.js +44 -2
  21. package/conversation/stage.js +23 -0
  22. package/conversation/useConversationExport/useConversationExport.js +9 -9
  23. package/conversation/useConversationHandlers/useConversationHandlers.js +16 -5
  24. package/conversation/useConversationImport/useConversationImport.js +123 -121
  25. package/conversation/useConversationPanelItems/useConversationPanelItems.js +2 -3
  26. package/conversation/useConversationScroll/useConversationScroll.js +68 -64
  27. package/conversation/useConversationStream/apply-chunk.js +1 -1
  28. package/conversation/useConversationStream/generation-resume.js +104 -63
  29. package/conversation/useConversationStream/useConversationStream.js +183 -108
  30. package/conversation/useMessageSelectionReply/useMessageSelectionReply.js +189 -0
  31. package/conversation-overlay.d.ts +7 -0
  32. package/conversation-overlay.js +2 -0
  33. package/conversation-sources/useConversationSources/useConversationSources.js +31 -24
  34. package/conversation-sources.d.ts +1 -1
  35. package/conversation-transfer.d.ts +2 -1
  36. package/conversation.d.ts +241 -13
  37. package/conversation.js +32 -30
  38. package/file-manager-canvas.d.ts +398 -0
  39. package/file-manager-canvas.js +2 -0
  40. package/file-manager.d.ts +153 -350
  41. package/file-manager.js +25 -24
  42. package/files/attachment-canvas.js +40 -1
  43. package/files/attachment-types.js +14 -13
  44. package/files/dial-file-manager-mapping.util.js +2 -1
  45. package/files/dial-file-manager-path.util.js +23 -1
  46. package/files/dial-file-manager.model.js +23 -19
  47. package/files/dial-file-manager.types.js +3 -3
  48. package/files/useDialFileListing/useDialFileListing.js +157 -145
  49. package/files/useDialFileManager/useDialFileManager.js +132 -128
  50. package/files/useDialFileManagerSections/useDialFileManagerSections.js +155 -0
  51. package/files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.js +20 -19
  52. package/files/useDialFileMutations/useDialFileMutations.js +33 -32
  53. package/files/useDialFileUploadBatch/useDialFileUploadBatch.js +117 -110
  54. package/files/useFileAttachmentPicker/useFileAttachmentPicker.js +43 -0
  55. package/index.d.ts +1068 -81
  56. package/index.js +136 -122
  57. package/mcp-apps/useMcpAppHostAdapter/useMcpAppHostAdapter.js +7 -5
  58. package/mcp-apps/useMcpAppHostContext/useMcpAppHostContext.js +1 -1
  59. package/mcp-apps/useMcpAppTools/useMcpAppTools.js +1 -1
  60. package/mcp-apps/useOpenMcpAppCanvas/useOpenMcpAppCanvas.js +25 -23
  61. package/mcp-apps.d.ts +8 -6
  62. package/oauth/toolset-id.js +5 -3
  63. package/oauth/useToolsetLogin/useToolsetLogin.js +8 -8
  64. package/oauth.d.ts +32 -0
  65. package/oauth.js +9 -9
  66. package/package.json +36 -21
  67. package/scheduled-task/scheduled-task-description.js +77 -0
  68. package/scheduled-task/scheduled-task-preparation.js +24 -0
  69. package/scheduled-task/scheduled-task-trigger.js +7 -2
  70. package/scheduled-task/scheduled-tasks-api-client.js +19 -0
  71. package/scheduled-task/use-scheduled-task-runs.js +194 -0
  72. package/scheduled-task/use-scheduled-tasks.js +93 -0
  73. package/scheduled-tasks.d.ts +195 -3
  74. package/scheduled-tasks.js +7 -2
  75. package/skill/skill-archive.js +19 -0
  76. package/skill/skill-types.js +8 -7
  77. package/skill/skill.js +42 -27
  78. package/skill/useSkillArchiveImport/useSkillArchiveImport.js +79 -0
  79. package/skill/useSkillEditorLoad.js +29 -28
  80. package/skill/useSkillEditorSubmit.js +108 -84
  81. package/skill/useSkillFileActions.js +70 -58
  82. package/skill-editor.d.ts +133 -3
  83. package/skill-editor.js +9 -8
  84. package/usage/map-usage-data-to-dashboard.js +66 -0
  85. package/usage/map-user-usage-to-model-limits.js +202 -0
  86. package/usage.d.ts +125 -0
  87. package/usage.js +3 -0
  88. package/usePageFileDrag/usePageFileDrag.js +3 -3
  89. package/utils.d.ts +8 -6
@@ -1,59 +1,59 @@
1
1
  import { SkillSource as e } from "../../skill/skill-types.js";
2
2
  import { mapSkillToCatalogItem as t } from "../map-skill-to-catalog-item.js";
3
3
  import { useSkillItemDetails as n } from "../useSkillItemDetails.js";
4
- import { useEffect as r, useMemo as i, useState as a } from "react";
4
+ import { useEffect as r, useMemo as i, useRef as a, useState as o } from "react";
5
5
  //#region src/catalog/useSkillDetailsPanelData/useSkillDetailsPanelData.ts
6
- var o = ({ api: o, skills: s, sharedWithMe: c, publicSkills: l, skillId: u, folderLabels: d, skillOverviewLabels: f, favoriteIds: p }) => {
7
- let m = i(() => [
8
- ...s,
9
- ...c ?? [],
10
- ...l ?? []
6
+ var s = ({ api: s, skills: c, sharedWithMe: l, publicSkills: u, skillId: d, folderLabels: f, skillOverviewLabels: p, favoriteIds: m }) => {
7
+ let h = i(() => [
8
+ ...c,
9
+ ...l ?? [],
10
+ ...u ?? []
11
11
  ], [
12
- s,
13
- c,
14
- l
15
- ]), { onFetchSkillDetails: h, onLoadSkillDetailsFile: g } = n({
16
- api: o,
17
- skills: m,
18
- skillOverviewLabels: f
19
- }), _ = i(() => m.find((e) => e.url === u) ?? null, [m, u]), v = i(() => s.some((e) => e.url === u) ? e.Personal : c?.some((e) => e.url === u) ? e.SharedWithMe : e.Public, [
20
- s,
21
12
  c,
13
+ l,
22
14
  u
23
- ]), y = i(() => _ == null ? null : t(_, {
24
- folderLabels: d,
25
- source: v,
26
- favoriteIds: p
15
+ ]), { onFetchSkillDetails: g, onLoadSkillDetailsFile: _ } = n({
16
+ api: s,
17
+ skills: h,
18
+ skillOverviewLabels: p
19
+ }), v = i(() => h.find((e) => e.url === d) ?? null, [h, d]), y = i(() => c.some((e) => e.url === d) ? e.Personal : l?.some((e) => e.url === d) ? e.SharedWithMe : e.Public, [
20
+ c,
21
+ l,
22
+ d
23
+ ]), b = i(() => v == null ? null : t(v, {
24
+ folderLabels: f,
25
+ source: y,
26
+ favoriteIds: m
27
27
  }), [
28
- _,
29
28
  v,
30
- d,
31
- p
32
- ]), [b, x] = a(null), [S, C] = a(!1);
29
+ y,
30
+ f,
31
+ m
32
+ ]), [x, S] = o(null), [C, w] = o(!1), T = a(0);
33
33
  return r(() => {
34
- if (y == null) return;
35
- C(!0), x(null);
36
- let e = !1;
37
- return h(y).then((t) => {
38
- e || (x(t ?? null), C(!1));
34
+ if (b == null) return;
35
+ w(!0), S(null);
36
+ let e = !1, t = ++T.current;
37
+ return g(b).then((n) => {
38
+ e || T.current !== t || (S(n ?? null), w(!1));
39
39
  }), () => {
40
40
  e = !0;
41
41
  };
42
- }, [y?.id]), {
42
+ }, [b?.id]), {
43
43
  detailsPanelItem: i(() => {
44
- if (y == null) return null;
45
- if (b == null) return y;
46
- let { credentials: e, ...t } = b;
44
+ if (b == null) return null;
45
+ if (x == null) return b;
46
+ let { credentials: e, ...t } = x;
47
47
  return {
48
- ...y,
48
+ ...b,
49
49
  details: t,
50
- credentials: e ?? y.credentials
50
+ credentials: e ?? b.credentials
51
51
  };
52
- }, [y, b]),
53
- isDetailsLoading: S,
54
- isStarred: y != null && p.has(y.id),
55
- onLoadSkillDetailsFile: g
52
+ }, [b, x]),
53
+ isDetailsLoading: C,
54
+ isStarred: b != null && m.has(b.id),
55
+ onLoadSkillDetailsFile: _
56
56
  };
57
57
  };
58
58
  //#endregion
59
- export { o as useSkillDetailsPanelData };
59
+ export { s as useSkillDetailsPanelData };
@@ -12,20 +12,24 @@ var d = ({ api: d, skills: f, skillOverviewLabels: p }) => {
12
12
  if (o == null) return;
13
13
  let { bucket: l, path: u } = o;
14
14
  m.current = o;
15
- let [h, g] = await Promise.allSettled([d.downloadSkillFile(l, u, e).then(a), d.listSkillFiles({
16
- bucket: l,
17
- path: u,
18
- filePath: "",
19
- recursive: !0
20
- })]), _ = h.status === "fulfilled" && h.value != null ? c(h.value) : void 0, v = f.find((e) => e.url === i.id), y = g.status === "fulfilled" ? r(v, g.value.items, _?.about, p) : void 0, b = g.status === "fulfilled" ? n(g.value.items, u) : [], x = g.status === "fulfilled" ? s(g.value.items, u) : e;
21
- if (!(_ == null && y == null)) return {
22
- ..._ == null ? {} : { promptContent: {
23
- content: _.body,
24
- ..._.description == null ? {} : { description: _.description },
25
- files: b,
26
- selectedFileId: x
15
+ let [h, g, _] = await Promise.allSettled([
16
+ d.downloadSkillFile(l, u, e).then(a),
17
+ d.listSkillFiles({
18
+ bucket: l,
19
+ path: u,
20
+ filePath: "",
21
+ recursive: !0
22
+ }),
23
+ d.getSkillMetadata(l, u)
24
+ ]), v = h.status === "fulfilled" && h.value != null ? c(h.value) : void 0, y = _.status === "fulfilled" ? _.value : f.find((e) => e.url === i.id), b = g.status === "fulfilled" ? r(y, g.value.items, v?.about, p) : void 0, x = g.status === "fulfilled" ? n(g.value.items, u) : [], S = g.status === "fulfilled" ? s(g.value.items, u) : e;
25
+ if (!(v == null && b == null)) return {
26
+ ...v == null ? {} : { promptContent: {
27
+ content: v.body,
28
+ ...v.description == null ? {} : { description: v.description },
29
+ files: x,
30
+ selectedFileId: S
27
31
  } },
28
- ...y == null ? {} : { overview: y }
32
+ ...b == null ? {} : { overview: b }
29
33
  };
30
34
  }, [
31
35
  d,
package/catalog.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { ApplicationExternalServiceDto } from '@epam/ai-dial-chat-api-client';
1
2
  import { CatalogContentTreeNode } from '@epam/ai-dial-catalog';
2
3
  import { CatalogEntityType } from '@epam/ai-dial-chat-shared';
3
4
  import { CatalogItem } from '@epam/ai-dial-catalog';
@@ -14,8 +15,10 @@ import { DeploymentLimitsResponseDto } from '@epam/ai-dial-chat-api-client';
14
15
  import { DialToolsetAuthSettingsDto } from '@epam/ai-dial-chat-api-client';
15
16
  import { DialToolsetDto } from '@epam/ai-dial-chat-api-client';
16
17
  import { DropdownItem } from '@epam/ai-dial-ui-kit';
18
+ import { ExternalServicesApi } from '@epam/ai-dial-chat-api-client';
17
19
  import { ListFilesResponseDto } from '@epam/ai-dial-chat-api-client';
18
20
  import { NotificationVariant } from '@epam/ai-dial-ui-kit';
21
+ import { OfflineCredentialsApi } from '@epam/ai-dial-chat-api-client';
19
22
  import { PromptResponseDto } from '@epam/ai-dial-chat-api-client';
20
23
  import { PublicationRule } from '@epam/ai-dial-publish-panel';
21
24
  import { PublishApi } from '@epam/ai-dial-chat-api-client';
@@ -47,6 +50,7 @@ export declare interface AgentCapabilities {
47
50
  hasConfiguration?: boolean;
48
51
  hasChatCompletion?: boolean;
49
52
  hasResponsesApi?: boolean;
53
+ hasSkills?: boolean;
50
54
  }
51
55
 
52
56
  /** Input-attachment configuration for an agent (application) deployment. */
@@ -132,6 +136,13 @@ export declare const buildSkillContentTree: (files: SkillMetadataItemDto[], skil
132
136
  * authored it, when it last changed, and its file inventory. Grouping folders
133
137
  * in the file listing are excluded from both the count and the rows. Sizes are
134
138
  * not shown — the skill metadata carries no content-length field.
139
+ *
140
+ * `skill` is the authoritative `getSkillMetadata` response when that request
141
+ * fulfilled; the caller falls back to the catalog listing entry only when it
142
+ * rejected (`useSkillItemDetails`'s `onFetchSkillDetails`). Either way, this
143
+ * function never fills a gap in one source from the other — an absent
144
+ * `author` omits the row and an absent `updatedAt` leaves the updated row's
145
+ * value empty, exactly as `skill` carries it.
135
146
  */
136
147
  export declare const buildSkillOverview: (skill: SkillMetadataItemDto | undefined, files: SkillMetadataItemDto[], about: SkillAboutDetails | undefined, labels: SkillOverviewLabels) => CatalogItemOverview;
137
148
 
@@ -237,6 +248,28 @@ export declare enum CatalogPrimaryActionType {
237
248
  */
238
249
  export declare type CatalogPublishEntityType = 'model' | 'toolset' | 'application' | 'prompt' | 'skill';
239
250
 
251
+ /** Labels and formatter callbacks for the conversation-input limits mapping utility. */
252
+ export declare interface ConversationInputLimitsLabels {
253
+ /** Heading of the group listing the selected deployment's token limits. */
254
+ tokenGroup: string;
255
+ /** Heading of the group listing the caller's cost budget and spend against it. */
256
+ costGroup: string;
257
+ /** Label for the current-UTC-day row, used by both groups. */
258
+ periodDay: string;
259
+ /** Label for the current-UTC-week row, used by both groups. */
260
+ periodWeek: string;
261
+ /** Label for the current-UTC-month row, used by both groups. */
262
+ periodMonth: string;
263
+ /** Formats the combined used/total display value for a capped row. */
264
+ formatValueLabel: (used: string, total: string) => string;
265
+ /** Formats the ARIA label for a capped progress row. */
266
+ formatProgressAriaLabel: (params: {
267
+ label: string;
268
+ used: string;
269
+ total: string;
270
+ }) => string;
271
+ }
272
+
240
273
  /**
241
274
  * Wraps the generated `PublishApi` in the positional-argument surface the
242
275
  * catalog and conversation publish flows call, so each host app re-exports one
@@ -245,6 +278,15 @@ export declare type CatalogPublishEntityType = 'model' | 'toolset' | 'applicatio
245
278
  */
246
279
  export declare const createPublishApiClient: (publishApi: PublishApi) => PublishApiClient;
247
280
 
281
+ /**
282
+ * Inverse of `encodeDeploymentId` — decodes each `/`-separated segment back
283
+ * to its raw, human-readable form. A segment that isn't valid
284
+ * percent-encoding is passed through unchanged rather than throwing, since
285
+ * this decodes externally-sourced ids (the settings iframe's postMessage
286
+ * protocol).
287
+ */
288
+ export declare const decodeDeploymentId: (id: string) => string;
289
+
248
290
  /** Translated folder-path labels for the Personal/Shared/Public deployment groupings. */
249
291
  export declare interface DeploymentFolderLabels {
250
292
  personal: string;
@@ -294,7 +336,7 @@ export declare interface DeploymentLimitsLabels {
294
336
  export declare const deriveAvailableTabIds: <T extends CatalogEntityType>(items: readonly CatalogItem[], tabOrder: readonly T[]) => T[];
295
337
 
296
338
  /**
297
- * Returns items marked as a user favorite, in original order.
339
+ * Returns items marked as a user favorite that are not hidden, in original order.
298
340
  */
299
341
  export declare const deriveFavoriteItems: (items: readonly CatalogItem[]) => CatalogItem[];
300
342
 
@@ -359,6 +401,9 @@ export declare const filterHiddenOwnedItems: (items: readonly CatalogItem[], hid
359
401
  */
360
402
  export declare const findDeploymentByIdOrReference: (deployments: DeploymentItemDto[], idOrReference: string | null | undefined) => DeploymentItemDto | undefined;
361
403
 
404
+ /** Formats a raw `resetsAt` into display strings, or returns `undefined` when it cannot be formatted. */
405
+ declare type FormatResetTime = (resetsAt: string | undefined) => ResetTimeDisplay | undefined;
406
+
362
407
  /**
363
408
  * The publish folder a public catalog entity id sits in: the segments between
364
409
  * the `public` bucket and the entity name, decoded to the plain text the
@@ -396,8 +441,8 @@ export declare const mapDeploymentDetailsDtoToEntityDetails: (dto: DeploymentDet
396
441
  /** Maps a deployment limits DTO to display-ready catalog limits, or `undefined` when no qualifying stats exist. */
397
442
  export declare const mapDeploymentLimitsDtoToCatalogLimits: (dto: DeploymentLimitsResponseDto | undefined, labels: DeploymentLimitsLabels) => CatalogItemLimits | undefined;
398
443
 
399
- /** Maps the monthly deployment token limit to a display-ready value. */
400
- export declare const mapDeploymentLimitsToInput: (dto: DeploymentLimitsResponseDto | undefined) => MonthlyUsageLimit | undefined;
444
+ /** 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. */
445
+ export declare const mapDeploymentLimitsToInput: (dto: DeploymentLimitsResponseDto | undefined, labels: ConversationInputLimitsLabels, formatResetTime?: FormatResetTime) => CatalogItemLimits | undefined;
401
446
 
402
447
  /** Maps a deployment listing row into the catalog UI's `CatalogItem` shape. */
403
448
  export declare const mapDeploymentToCatalogItem: (deployment: DeploymentItemDto, { favoriteIds, entityDetails, folderLabels, editableSchemaIds, isCustomAppsEditable, activeLocale, primaryLocale, resolveIconUrl, }: MapDeploymentToCatalogItemOptions) => CatalogItem;
@@ -540,6 +585,7 @@ export declare interface ModelCapabilities {
540
585
  hasResume?: boolean;
541
586
  hasChatCompletion?: boolean;
542
587
  hasResponsesApi?: boolean;
588
+ hasSkills?: boolean;
543
589
  reasoningEfforts?: string[];
544
590
  }
545
591
 
@@ -579,17 +625,19 @@ export declare interface ModelSpecification {
579
625
  createdAt?: number;
580
626
  }
581
627
 
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
- }
628
+ /**
629
+ * Encodes a deployment/application id to its single-encoded form regardless
630
+ * of whether the value it received was already percent-encoded or the raw,
631
+ * human-readable form — decoding first then re-encoding once is idempotent
632
+ * either way, since `decodeDeploymentId` on a raw (unencoded) id is a no-op.
633
+ * Use this instead of `encodeDeploymentId` at a boundary that cannot
634
+ * guarantee which form it receives, such as a `postMessage` payload from the
635
+ * settings iframe: calling `encodeDeploymentId` directly on a value the
636
+ * sender already encoded escapes the existing `%` characters a second time
637
+ * (`%20` becomes `%2520`), which the backend only ever undoes once and so
638
+ * 404s on.
639
+ */
640
+ export declare const normalizeDeploymentId: (id: string) => string;
593
641
 
594
642
  /** A skill resource URL split into the bucket and the path within it. */
595
643
  export declare interface ParsedSkillResourceUrl {
@@ -623,7 +671,11 @@ declare enum PromptSource {
623
671
  Public = "public"
624
672
  }
625
673
 
626
- /** DIAL Core bucket holding organisation-wide skills. */
674
+ /**
675
+ * DIAL Core bucket holding organisation-wide skills.
676
+ *
677
+ * @deprecated Use `PUBLIC_BUCKET` from `@epam/ai-dial-chat-shared`.
678
+ */
627
679
  export declare const PUBLIC_SKILL_BUCKET = "public";
628
680
 
629
681
  /** The DIAL publish API surface produced by {@link createPublishApiClient}. */
@@ -683,6 +735,23 @@ export declare const readSkillManifest: (response: Response) => Promise<string |
683
735
  */
684
736
  export declare const reconcileFilterTopics: (persistedTopics: ReadonlySet<string>, items: readonly CatalogItem[]) => Set<string>;
685
737
 
738
+ /**
739
+ * One reset time, already parsed and formatted by the host. Declared
740
+ * structurally here so this library never imports an application type; the
741
+ * host passes a value that satisfies this shape (e.g. `apps/chat`'s own
742
+ * `ResetTimeDisplay`).
743
+ */
744
+ declare interface ResetTimeDisplay {
745
+ /** Exclusive end of the period as an epoch ms value, for the host's boundary scheduling. */
746
+ resetsAtMs: number;
747
+ /** Machine-readable instant for a `<time dateTime>` attribute. */
748
+ isoValue: string;
749
+ /** Visible reset line. */
750
+ label: string;
751
+ /** Accessible expansion of the reset line. */
752
+ ariaLabel: string;
753
+ }
754
+
686
755
  /**
687
756
  * Resolves the primary action for a catalog item.
688
757
  *
@@ -699,7 +768,8 @@ export declare const reconcileFilterTopics: (persistedTopics: ReadonlySet<string
699
768
  */
700
769
  export declare const resolveCatalogPrimaryAction: (item: CatalogItem, fetchPrompt: (item: CatalogItem) => Promise<PromptResponseDto>) => Promise<CatalogPrimaryActionResult>;
701
770
 
702
- export declare const resolveDeploymentFolder: (deployment: Pick<DeploymentItemDto, "isMy" | "sharedWithMe" | "applicationFolder">, labels: DeploymentFolderLabels) => string[];
771
+ /** Resolves a deployment's display folder, including organization applications without a folder path. */
772
+ export declare const resolveDeploymentFolder: (deployment: Pick<DeploymentItemDto, "isMy" | "sharedWithMe" | "applicationFolder"> & Partial<Pick<DeploymentItemDto, "type">>, labels: DeploymentFolderLabels) => string[];
703
773
 
704
774
  /** Returns the MCP resource kind a catalog item's Connect endpoint belongs to, or `null` when the item exposes no MCP endpoint. */
705
775
  export declare const resolveMcpResourceKind: (type: CatalogEntityType, supportsMcp?: boolean) => McpResourceKind | null;
@@ -756,6 +826,12 @@ export declare interface SkillDetailsApi {
756
826
  limit?: number;
757
827
  recursive?: boolean;
758
828
  }, signal?: AbortSignal): Promise<SkillFileListResponseDto>;
829
+ /**
830
+ * Fetches a single skill's own authoritative metadata (`author`,
831
+ * `updatedAt`, and the rest of `SkillMetadataItemDto`) — not the catalog
832
+ * listing entry, which may be sparse for a shared skill.
833
+ */
834
+ getSkillMetadata(bucket: string, path: string, signal?: AbortSignal): Promise<SkillMetadataItemDto>;
759
835
  }
760
836
 
761
837
  /** A skill's parsed manifest details. */
@@ -898,6 +974,25 @@ export declare const toPublishEntityType: (type: CatalogEntityType) => CatalogPu
898
974
  */
899
975
  export declare const toPublishRuleDto: (rule: PublicationRule) => PublishRuleDto;
900
976
 
977
+ /** Loads fresh service statuses without coupling proactive credentials to a live completion. */
978
+ export declare const useApplicationCredentials: ({ appId, externalServicesClient, offlineCredentialsClient, }: UseApplicationCredentialsParams) => {
979
+ services: ApplicationExternalServiceDto[];
980
+ isOfflineConnected: boolean;
981
+ isLoading: boolean;
982
+ hasError: boolean;
983
+ refresh: () => Promise<void>;
984
+ };
985
+
986
+ /** Configured operations for loading application credential metadata. */
987
+ export declare interface UseApplicationCredentialsParams {
988
+ /** Application identifier passed through to the configured client. */
989
+ appId: string;
990
+ /** Host-configured external-services API. */
991
+ externalServicesClient: Pick<ExternalServicesApi, 'listExternalServices'>;
992
+ /** Host-configured offline-credentials API. */
993
+ offlineCredentialsClient: Pick<OfflineCredentialsApi, 'getOfflineCredentials'>;
994
+ }
995
+
901
996
  /**
902
997
  * Owns the catalog's edit/delete/create-menu navigation: routing the details
903
998
  * panel's Edit action to the right editor URL for each item type, deleting an
@@ -1217,10 +1312,11 @@ export declare interface UseSkillFilePreviewResult {
1217
1312
 
1218
1313
  /**
1219
1314
  * Headless hook that encapsulates skill detail fetching: manifest download and
1220
- * parse, package file listing, overview construction, and in-package file
1221
- * loads. `useCatalogItemDetails` delegates its skill branch here; hosts that
1222
- * only surface skill details consume this hook directly, without the
1223
- * deployment and prompt ports the full catalog pipeline requires.
1315
+ * parse, package file listing, authoritative metadata fetching, overview
1316
+ * construction, and in-package file loads. `useCatalogItemDetails` delegates
1317
+ * its skill branch here; hosts that only surface skill details consume this
1318
+ * hook directly, without the deployment and prompt ports the full catalog
1319
+ * pipeline requires.
1224
1320
  */
1225
1321
  export declare const useSkillItemDetails: ({ api, skills, skillOverviewLabels, }: UseSkillItemDetailsOptions) => UseSkillItemDetailsResult;
1226
1322
 
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 { mapDeploymentLimitsDtoToCatalogLimits as u } from "./catalog/map-deployment-limits-to-catalog.js";
6
+ import { mapDeploymentLimitsToInput as d } from "./catalog/map-deployment-limits-to-input.js";
7
+ import { mapDeploymentDetailsDtoToEntityDetails as f, mapEntityDetailsToCatalogDetails as p, mapToolsetCredentials as m } from "./catalog/map-entity-details-to-catalog.js";
8
+ import { mapDeploymentToCatalogItem as h, mapDeploymentToolsetCredentials as g, mapToolsetToCatalogItem as _, resolveDeploymentFolder as v } from "./catalog/map-deployment-to-catalog-item.js";
9
+ import { buildPromptOverview as y, isOrganisationPromptItem as b, mapPromptToCatalogItem as x } from "./catalog/map-prompt-to-catalog-item.js";
10
+ import { PUBLIC_SKILL_BUCKET as S, SKILL_LISTING_MAX_PAGES as C, SKILL_LISTING_PAGE_SIZE as w, SKILL_MANIFEST_MAX_BYTES as T, SkillSource as E, parseSkillResourceUrl as D } from "./skill/skill-types.js";
11
+ import { buildSkillContentTree as O, buildSkillOverview as k, mapSkillToCatalogItem as A, readSkillFileBytes as j, readSkillFilePreviewBytes as M, readSkillManifest as N, resolveSkillFileDownloadPath as P, resolveSkillManifestFileId as F } from "./catalog/map-skill-to-catalog-item.js";
12
+ import { McpResourceKind as I, buildApplicationMcpUrl as L, buildConnectApi as R, buildToolsetMcpUrl as z, resolveMcpResourceKind as B } from "./catalog/mcp-endpoint-url.js";
13
+ import { getPublicCatalogEntityFolderPath as V, isPublicCatalogEntityId as H, mapPublishConversationResultDto as U, mapPublishHistoryEntryDto as W, toPublishEntityType as G } from "./catalog/publish.js";
14
+ import { deriveAvailableTabIds as K, deriveFavoriteItems as q, filterCatalogItemsBySelector as J, filterHiddenOwnedItems as Y, reconcileFilterTopics as X } from "./catalog/catalog-derivations.js";
15
+ import { CatalogPrimaryActionType as Z, resolveCatalogPrimaryAction as Q } from "./catalog/catalog-primary-action.js";
16
+ import { useCatalogEditNavigation as $ } from "./catalog/useCatalogEditNavigation/useCatalogEditNavigation.js";
17
+ import { useSkillItemDetails as ee } from "./catalog/useSkillItemDetails.js";
18
+ import { useCatalogItemDetails as te } from "./catalog/useCatalogItemDetails.js";
19
+ import { useCatalogToolsetCredentials as ne } from "./catalog/useCatalogToolsetCredentials/useCatalogToolsetCredentials.js";
20
+ import { useApplicationCredentials as re } from "./catalog/useApplicationCredentials/useApplicationCredentials.js";
21
+ import { useSkillDetailsPanelData as ie } from "./catalog/useSkillDetailsPanelData/useSkillDetailsPanelData.js";
22
+ import { FavoriteEntityType as ae, useFavoriteEntitiesState as oe } from "./catalog/useFavoriteEntitiesState/useFavoriteEntitiesState.js";
23
+ import { usePublishFolders as se } from "./catalog/usePublishFolders/usePublishFolders.js";
24
+ import { SkillPreviewErrorKind as ce, useSkillFilePreview as le } from "./skill/useSkillFilePreview.js";
25
+ export { l as AuthenticationType, Z as CatalogPrimaryActionType, ae as FavoriteEntityType, I as McpResourceKind, S as PUBLIC_SKILL_BUCKET, C as SKILL_LISTING_MAX_PAGES, w as SKILL_LISTING_PAGE_SIZE, T as SKILL_MANIFEST_MAX_BYTES, ce as SkillPreviewErrorKind, E as SkillSource, L as buildApplicationMcpUrl, n as buildChatCompletionsUrl, R as buildConnectApi, r as buildDeploymentConnectApi, y as buildPromptOverview, i as buildResponsesUrl, O as buildSkillContentTree, k as buildSkillOverview, z as buildToolsetMcpUrl, e as createPublishApiClient, a as decodeDeploymentId, K as deriveAvailableTabIds, q as deriveFavoriteItems, o as encodeDeploymentId, J as filterCatalogItemsBySelector, Y as filterHiddenOwnedItems, s as findDeploymentByIdOrReference, V as getPublicCatalogEntityFolderPath, b as isOrganisationPromptItem, H as isPublicCatalogEntityId, f as mapDeploymentDetailsDtoToEntityDetails, u as mapDeploymentLimitsDtoToCatalogLimits, d as mapDeploymentLimitsToInput, h as mapDeploymentToCatalogItem, g as mapDeploymentToolsetCredentials, p as mapEntityDetailsToCatalogDetails, x as mapPromptToCatalogItem, U as mapPublishConversationResultDto, W as mapPublishHistoryEntryDto, A as mapSkillToCatalogItem, m as mapToolsetCredentials, _ as mapToolsetToCatalogItem, c as normalizeDeploymentId, D as parseSkillResourceUrl, j as readSkillFileBytes, M as readSkillFilePreviewBytes, N as readSkillManifest, X as reconcileFilterTopics, Q as resolveCatalogPrimaryAction, v as resolveDeploymentFolder, B as resolveMcpResourceKind, P as resolveSkillFileDownloadPath, F as resolveSkillManifestFileId, G as toPublishEntityType, t as toPublishRuleDto, re as useApplicationCredentials, $ as useCatalogEditNavigation, te as useCatalogItemDetails, ne as useCatalogToolsetCredentials, oe as useFavoriteEntitiesState, se as usePublishFolders, ie as useSkillDetailsPanelData, le as useSkillFilePreview, ee 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 };