@epam/ai-dial-chat-hooks 1.2.0-dev.21 → 1.2.0-dev.213
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 +5 -4
- package/attachment/useAttachmentValidation/useAttachmentValidation.js +26 -19
- package/attachments.d.ts +10 -4
- package/catalog/catalog-derivations.js +1 -1
- package/catalog/deployment-id.js +8 -2
- 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 +7 -0
- package/catalog/map-skill-to-catalog-item.js +30 -27
- package/catalog/publish.js +6 -5
- package/catalog/useApplicationCredentials/useApplicationCredentials.js +39 -0
- package/catalog/useSkillDetailsPanelData/useSkillDetailsPanelData.js +39 -39
- package/catalog/useSkillItemDetails.js +17 -13
- package/catalog.d.ts +116 -20
- package/catalog.js +23 -22
- package/conversation/conversation-transfer/export-conversation.js +24 -16
- package/conversation/conversation-transfer/import-conversation.js +80 -31
- package/conversation/conversation-transfer/queue.js +8 -5
- package/conversation/create-chat-stream-api.js +85 -49
- package/conversation/message-utils.js +44 -2
- package/conversation/stage.js +23 -0
- package/conversation/useConversationExport/useConversationExport.js +9 -9
- package/conversation/useConversationHandlers/useConversationHandlers.js +16 -5
- package/conversation/useConversationImport/useConversationImport.js +123 -121
- package/conversation/useConversationPanelItems/useConversationPanelItems.js +2 -3
- package/conversation/useConversationScroll/useConversationScroll.js +68 -64
- package/conversation/useConversationStream/apply-chunk.js +1 -1
- package/conversation/useConversationStream/generation-resume.js +104 -63
- package/conversation/useConversationStream/useConversationStream.js +181 -110
- package/conversation/useMessageSelectionReply/useMessageSelectionReply.js +189 -0
- package/conversation-overlay.d.ts +7 -0
- package/conversation-overlay.js +2 -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 +241 -13
- package/conversation.js +32 -30
- package/file-manager-canvas.d.ts +398 -0
- package/file-manager-canvas.js +2 -0
- package/file-manager.d.ts +153 -350
- package/file-manager.js +25 -24
- package/files/attachment-canvas.js +40 -1
- package/files/attachment-types.js +14 -13
- package/files/dial-file-manager-mapping.util.js +2 -1
- package/files/dial-file-manager-path.util.js +23 -1
- package/files/dial-file-manager.model.js +23 -19
- package/files/dial-file-manager.types.js +3 -3
- package/files/useDialFileListing/useDialFileListing.js +157 -145
- package/files/useDialFileManager/useDialFileManager.js +132 -128
- package/files/useDialFileManagerSections/useDialFileManagerSections.js +155 -0
- package/files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.js +20 -19
- package/files/useDialFileMutations/useDialFileMutations.js +33 -32
- package/files/useDialFileUploadBatch/useDialFileUploadBatch.js +117 -110
- package/files/useFileAttachmentPicker/useFileAttachmentPicker.js +43 -0
- package/index.d.ts +1068 -81
- package/index.js +136 -122
- package/mcp-apps/useMcpAppHostAdapter/useMcpAppHostAdapter.js +7 -5
- package/mcp-apps/useMcpAppHostContext/useMcpAppHostContext.js +1 -1
- package/mcp-apps/useMcpAppTools/useMcpAppTools.js +1 -1
- package/mcp-apps/useOpenMcpAppCanvas/useOpenMcpAppCanvas.js +25 -23
- package/mcp-apps.d.ts +8 -6
- package/oauth/toolset-id.js +5 -3
- package/oauth/useToolsetLogin/useToolsetLogin.js +8 -8
- package/oauth.d.ts +32 -0
- package/oauth.js +9 -9
- package/package.json +36 -21
- package/scheduled-task/scheduled-task-description.js +77 -0
- package/scheduled-task/scheduled-task-preparation.js +24 -0
- package/scheduled-task/scheduled-task-trigger.js +7 -2
- package/scheduled-task/scheduled-tasks-api-client.js +19 -0
- package/scheduled-task/use-scheduled-task-runs.js +194 -0
- package/scheduled-task/use-scheduled-tasks.js +93 -0
- package/scheduled-tasks.d.ts +195 -3
- package/scheduled-tasks.js +7 -2
- package/skill/skill-archive.js +19 -0
- package/skill/skill-types.js +8 -7
- package/skill/skill.js +42 -27
- package/skill/useSkillArchiveImport/useSkillArchiveImport.js +79 -0
- package/skill/useSkillEditorLoad.js +29 -28
- package/skill/useSkillEditorSubmit.js +108 -84
- package/skill/useSkillFileActions.js +70 -58
- package/skill-editor.d.ts +133 -3
- package/skill-editor.js +9 -8
- package/usage/map-usage-data-to-dashboard.js +66 -0
- package/usage/map-user-usage-to-model-limits.js +202 -0
- package/usage.d.ts +125 -0
- package/usage.js +3 -0
- package/usePageFileDrag/usePageFileDrag.js +3 -3
- 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,
|
|
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
|
|
7
|
-
let
|
|
8
|
-
...
|
|
9
|
-
...
|
|
10
|
-
...
|
|
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
|
-
]),
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
y,
|
|
30
|
+
f,
|
|
31
|
+
m
|
|
32
|
+
]), [x, S] = o(null), [C, w] = o(!1), T = a(0);
|
|
33
33
|
return r(() => {
|
|
34
|
-
if (
|
|
35
|
-
|
|
36
|
-
let e = !1;
|
|
37
|
-
return
|
|
38
|
-
e || (
|
|
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
|
-
}, [
|
|
42
|
+
}, [b?.id]), {
|
|
43
43
|
detailsPanelItem: i(() => {
|
|
44
|
-
if (
|
|
45
|
-
if (
|
|
46
|
-
let { credentials: e, ...t } =
|
|
44
|
+
if (b == null) return null;
|
|
45
|
+
if (x == null) return b;
|
|
46
|
+
let { credentials: e, ...t } = x;
|
|
47
47
|
return {
|
|
48
|
-
...
|
|
48
|
+
...b,
|
|
49
49
|
details: t,
|
|
50
|
-
credentials: e ??
|
|
50
|
+
credentials: e ?? b.credentials
|
|
51
51
|
};
|
|
52
|
-
}, [
|
|
53
|
-
isDetailsLoading:
|
|
54
|
-
isStarred:
|
|
55
|
-
onLoadSkillDetailsFile:
|
|
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 {
|
|
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([
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
...
|
|
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
|
|
400
|
-
export declare const mapDeploymentLimitsToInput: (dto: DeploymentLimitsResponseDto | 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
|
-
/**
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
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
|
-
/**
|
|
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
|
-
|
|
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,
|
|
1221
|
-
* loads. `useCatalogItemDetails` delegates
|
|
1222
|
-
* only surface skill details consume this
|
|
1223
|
-
* deployment and prompt ports the full catalog
|
|
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 {
|
|
4
|
-
import { AuthenticationType as
|
|
5
|
-
import { mapDeploymentLimitsDtoToCatalogLimits as
|
|
6
|
-
import { mapDeploymentLimitsToInput as
|
|
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 {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
|
|
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:
|
|
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 };
|