@epam/ai-dial-chat-hooks 1.1.0-dev.277 → 1.1.0-dev.279
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.d.ts +18 -0
- package/api-error/api-error.d.ts.map +1 -0
- package/api-transport/create-csrf-middleware.d.ts +15 -0
- package/api-transport/create-csrf-middleware.d.ts.map +1 -0
- package/api-transport/create-unauthorized-middleware.d.ts +40 -0
- package/api-transport/create-unauthorized-middleware.d.ts.map +1 -0
- package/attachment/useAttachmentAction/useAttachmentAction.d.ts +0 -2
- package/attachment/useAttachmentAction/useAttachmentAction.d.ts.map +1 -1
- package/attachment/useAttachmentValidation/useAttachmentValidation.d.ts.map +1 -1
- package/catalog/deployment-endpoint-url.d.ts +19 -0
- package/catalog/deployment-endpoint-url.d.ts.map +1 -0
- package/catalog/deployment-id.d.ts +21 -0
- package/catalog/deployment-id.d.ts.map +1 -0
- package/catalog/entity-details.d.ts +132 -0
- package/catalog/entity-details.d.ts.map +1 -0
- package/catalog/map-deployment-limits-to-input.d.ts +15 -0
- package/catalog/map-deployment-limits-to-input.d.ts.map +1 -0
- package/catalog/map-deployment-to-catalog-item.d.ts +60 -0
- package/catalog/map-deployment-to-catalog-item.d.ts.map +1 -0
- package/catalog/map-entity-details-to-catalog.d.ts +23 -0
- package/catalog/map-entity-details-to-catalog.d.ts.map +1 -0
- package/catalog/map-prompt-to-catalog-item.d.ts +45 -0
- package/catalog/map-prompt-to-catalog-item.d.ts.map +1 -0
- package/catalog/map-skill-to-catalog-item.d.ts +87 -0
- package/catalog/map-skill-to-catalog-item.d.ts.map +1 -0
- package/catalog/mcp-endpoint-url.d.ts +18 -0
- package/catalog/mcp-endpoint-url.d.ts.map +1 -0
- package/catalog/publish.d.ts +17 -0
- package/catalog/publish.d.ts.map +1 -0
- package/conversation/announcement-message.d.ts +28 -0
- package/conversation/announcement-message.d.ts.map +1 -0
- package/conversation/create-chat-stream-api.d.ts +38 -0
- package/conversation/create-chat-stream-api.d.ts.map +1 -0
- package/conversation/display-name-watch.d.ts +4 -0
- package/conversation/display-name-watch.d.ts.map +1 -0
- package/conversation/footer-message.d.ts +10 -0
- package/conversation/footer-message.d.ts.map +1 -0
- package/conversation/get-model-id-from-conversation-id.d.ts +27 -0
- package/conversation/get-model-id-from-conversation-id.d.ts.map +1 -0
- package/conversation/greeting.d.ts +18 -0
- package/conversation/greeting.d.ts.map +1 -0
- package/conversation/message-factory.d.ts +7 -0
- package/conversation/message-factory.d.ts.map +1 -0
- package/conversation/message-utils.d.ts +27 -0
- package/conversation/message-utils.d.ts.map +1 -0
- package/conversation/overlay-messages.d.ts +5 -0
- package/conversation/overlay-messages.d.ts.map +1 -0
- package/conversation/quick-app-conversation-starters.d.ts +10 -0
- package/conversation/quick-app-conversation-starters.d.ts.map +1 -0
- package/conversation/starter-option.d.ts +21 -0
- package/conversation/starter-option.d.ts.map +1 -0
- package/conversation/useConversationHandlers/starter-option.d.ts.map +1 -1
- package/conversation/useConversationStream/conversation-path.d.ts +0 -2
- package/conversation/useConversationStream/conversation-path.d.ts.map +1 -1
- package/conversation/useConversationStream/useConversationStream.d.ts.map +1 -1
- package/files/annotation.d.ts +10 -0
- package/files/annotation.d.ts.map +1 -0
- package/files/attachment-canvas.d.ts +90 -0
- package/files/attachment-canvas.d.ts.map +1 -0
- package/files/attachment-dto-to-display.d.ts +10 -0
- package/files/attachment-dto-to-display.d.ts.map +1 -0
- package/files/attachment-types.d.ts +14 -0
- package/files/attachment-types.d.ts.map +1 -0
- package/files/create-files-api.d.ts +52 -0
- package/files/create-files-api.d.ts.map +1 -0
- package/files/create-upload-file-with-progress.d.ts +24 -0
- package/files/create-upload-file-with-progress.d.ts.map +1 -0
- package/files/dial-file-manager-mapping.util.d.ts.map +1 -1
- package/files/dial-file-manager-path.util.d.ts.map +1 -1
- package/files/dial-file-to-attachment.d.ts +26 -0
- package/files/dial-file-to-attachment.d.ts.map +1 -0
- package/files/dial-file.d.ts +17 -0
- package/files/dial-file.d.ts.map +1 -0
- package/files/file-path.d.ts +3 -0
- package/files/file-path.d.ts.map +1 -0
- package/files/prepare-download-destination.d.ts +8 -0
- package/files/prepare-download-destination.d.ts.map +1 -0
- package/files/useDialFileListing/useDialFileListing.d.ts.map +1 -1
- package/index.d.ts +54 -1
- package/index.d.ts.map +1 -1
- package/index.js +15717 -1054
- package/package.json +20 -8
- package/prompt/export-prompt.d.ts +31 -0
- package/prompt/export-prompt.d.ts.map +1 -0
- package/prompt/prompt-resource.d.ts +31 -0
- package/prompt/prompt-resource.d.ts.map +1 -0
- package/prompt/prompt.d.ts +34 -0
- package/prompt/prompt.d.ts.map +1 -0
- package/scheduled-task/scheduled-task-mapping.d.ts +19 -0
- package/scheduled-task/scheduled-task-mapping.d.ts.map +1 -0
- package/scheduled-task/scheduled-task-trigger.d.ts +27 -0
- package/scheduled-task/scheduled-task-trigger.d.ts.map +1 -0
- package/shared/application-schema.d.ts +10 -0
- package/shared/application-schema.d.ts.map +1 -0
- package/shared/browser-timezone.d.ts +7 -0
- package/shared/browser-timezone.d.ts.map +1 -0
- package/shared/cron-weekday.d.ts +5 -0
- package/shared/cron-weekday.d.ts.map +1 -0
- package/shared/custom-apps.d.ts +7 -0
- package/shared/custom-apps.d.ts.map +1 -0
- package/shared/external-services.d.ts +16 -0
- package/shared/external-services.d.ts.map +1 -0
- package/shared/formatting.d.ts +5 -0
- package/shared/formatting.d.ts.map +1 -0
- package/shared/locale.d.ts +45 -0
- package/shared/locale.d.ts.map +1 -0
- package/shared/string-utils.d.ts +17 -0
- package/shared/string-utils.d.ts.map +1 -0
- package/shared/toolset-login-events.d.ts +15 -0
- package/shared/toolset-login-events.d.ts.map +1 -0
- package/skill/skill-file-preview.d.ts +25 -0
- package/skill/skill-file-preview.d.ts.map +1 -0
- package/skill/skill-manifest.d.ts +28 -0
- package/skill/skill-manifest.d.ts.map +1 -0
- package/skill/skill-types.d.ts +42 -0
- package/skill/skill-types.d.ts.map +1 -0
- package/skill/skill.d.ts +88 -0
- package/skill/skill.d.ts.map +1 -0
- package/files/string-utils.d.ts +0 -3
- package/files/string-utils.d.ts.map +0 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Normalized shape returned by {@link getApiErrorDetails}. */
|
|
2
|
+
export interface ApiErrorDetails {
|
|
3
|
+
/** HTTP status code carried by the error, when available. */
|
|
4
|
+
status?: number;
|
|
5
|
+
/** Resolved human-readable error message, or `null` when none could be resolved. */
|
|
6
|
+
message: string | null;
|
|
7
|
+
/** Extracted W3C trace ID, when the error's response carries a valid `traceparent`. */
|
|
8
|
+
traceId?: string;
|
|
9
|
+
}
|
|
10
|
+
/** True when the API indicates the conversation resource no longer exists at the path. */
|
|
11
|
+
export declare const isConversationNotFoundError: (error: unknown) => boolean;
|
|
12
|
+
/** HTTP status code carried by a thrown API error, or `undefined` if none is attached. */
|
|
13
|
+
export declare const getApiErrorStatus: (error: unknown) => number | undefined;
|
|
14
|
+
/** Resolves a human-readable message from an API error's response body, or falls back to `Error.message`. */
|
|
15
|
+
export declare const getApiErrorMessage: (error: unknown) => Promise<string | null>;
|
|
16
|
+
/** Normalizes any API error into a `{ status?, message, traceId? }` shape. */
|
|
17
|
+
export declare const getApiErrorDetails: (error: unknown) => Promise<ApiErrorDetails>;
|
|
18
|
+
//# sourceMappingURL=api-error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-error.d.ts","sourceRoot":"","sources":["../../src/api-error/api-error.ts"],"names":[],"mappings":"AAMA,+DAA+D;AAC/D,MAAM,WAAW,eAAe;IAC9B,6DAA6D;IAC7D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oFAAoF;IACpF,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,uFAAuF;IACvF,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAqED,0FAA0F;AAC1F,eAAO,MAAM,2BAA2B,GAAI,OAAO,OAAO,KAAG,OAI5D,CAAC;AAEF,0FAA0F;AAC1F,eAAO,MAAM,iBAAiB,GAAI,OAAO,OAAO,KAAG,MAAM,GAAG,SAC3B,CAAC;AAElC,6GAA6G;AAC7G,eAAO,MAAM,kBAAkB,GAC7B,OAAO,OAAO,KACb,OAAO,CAAC,MAAM,GAAG,IAAI,CAevB,CAAC;AAEF,8EAA8E;AAc9E,eAAO,MAAM,kBAAkB,GAC7B,OAAO,OAAO,KACb,OAAO,CAAC,eAAe,CAwCzB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Middleware } from '@epam/ai-dial-chat-api-client';
|
|
2
|
+
/** Host capabilities {@link createCsrfMiddleware} needs to attach and capture a CSRF token. */
|
|
3
|
+
export interface CreateCsrfMiddlewareDeps {
|
|
4
|
+
/** Returns the currently held CSRF token, or `null` when none is set. */
|
|
5
|
+
getCsrfToken: () => string | null;
|
|
6
|
+
/** Stores a CSRF token captured from a response header, or `null` to clear it. */
|
|
7
|
+
setCsrfToken: (token: string | null) => void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Builds a generated-client `Middleware` that attaches `X-CSRF-Token` on every
|
|
11
|
+
* non-GET request when a token is set, and captures a rotated token from the
|
|
12
|
+
* `x-csrf-token` response header.
|
|
13
|
+
*/
|
|
14
|
+
export declare const createCsrfMiddleware: (deps: CreateCsrfMiddlewareDeps) => Middleware;
|
|
15
|
+
//# sourceMappingURL=create-csrf-middleware.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-csrf-middleware.d.ts","sourceRoot":"","sources":["../../src/api-transport/create-csrf-middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAEhE,+FAA+F;AAC/F,MAAM,WAAW,wBAAwB;IACvC,yEAAyE;IACzE,YAAY,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IAClC,kFAAkF;IAClF,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CAC9C;AAED;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAC/B,MAAM,wBAAwB,KAC7B,UAqBD,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Middleware } from '@epam/ai-dial-chat-api-client';
|
|
2
|
+
/** Outcome of a CSRF-token refresh attempt, reported back to {@link createUnauthorizedMiddleware}. */
|
|
3
|
+
export type CsrfRefreshOutcome = {
|
|
4
|
+
status: 'ok';
|
|
5
|
+
token: string;
|
|
6
|
+
} | {
|
|
7
|
+
status: 'unauthorized' | 'failed';
|
|
8
|
+
};
|
|
9
|
+
/** An error thrown to indicate the caller is unauthenticated. */
|
|
10
|
+
export interface UnauthorizedErrorLike extends Error {
|
|
11
|
+
readonly status: 401;
|
|
12
|
+
readonly url: string;
|
|
13
|
+
}
|
|
14
|
+
/** Host capabilities {@link createUnauthorizedMiddleware} needs to handle 401s and invalid-CSRF retries. */
|
|
15
|
+
export interface CreateUnauthorizedMiddlewareDeps {
|
|
16
|
+
/** Notifies the host that a request was unauthorized (also expected to clear any held CSRF token). */
|
|
17
|
+
notifyUnauthorized: (url: string) => void;
|
|
18
|
+
/** Attempts to refresh the CSRF token, de-duplicating concurrent calls. */
|
|
19
|
+
refreshCsrfToken: () => Promise<CsrfRefreshOutcome>;
|
|
20
|
+
/** Classifies a response body as an invalid-CSRF error. */
|
|
21
|
+
isInvalidCsrfErrorBody: (body: string) => boolean;
|
|
22
|
+
/** Returns the currently held CSRF token, or `null` when none is set. */
|
|
23
|
+
getCsrfToken: () => string | null;
|
|
24
|
+
/**
|
|
25
|
+
* Stores a CSRF token captured from a response header. Needed here (in
|
|
26
|
+
* addition to the CSRF middleware's own `post` hook) because the
|
|
27
|
+
* invalid-CSRF retry issues its own `fetch` outside the generated-client
|
|
28
|
+
* middleware pipeline, so its response header is never seen by that hook.
|
|
29
|
+
*/
|
|
30
|
+
setCsrfToken: (token: string | null) => void;
|
|
31
|
+
/** Constructs the error thrown to signal an unauthorized request. */
|
|
32
|
+
createUnauthorizedError: (url: string) => UnauthorizedErrorLike;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Builds a generated-client `Middleware` that throws on 401, and on a
|
|
36
|
+
* classified invalid-CSRF 403 refreshes the token and retries the original
|
|
37
|
+
* request exactly once.
|
|
38
|
+
*/
|
|
39
|
+
export declare const createUnauthorizedMiddleware: (deps: CreateUnauthorizedMiddlewareDeps) => Middleware;
|
|
40
|
+
//# sourceMappingURL=create-unauthorized-middleware.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-unauthorized-middleware.d.ts","sourceRoot":"","sources":["../../src/api-transport/create-unauthorized-middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAIhE,sGAAsG;AACtG,MAAM,MAAM,kBAAkB,GAC1B;IAAE,MAAM,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC/B;IAAE,MAAM,EAAE,cAAc,GAAG,QAAQ,CAAA;CAAE,CAAC;AAE1C,iEAAiE;AACjE,MAAM,WAAW,qBAAsB,SAAQ,KAAK;IAClD,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED,4GAA4G;AAC5G,MAAM,WAAW,gCAAgC;IAC/C,sGAAsG;IACtG,kBAAkB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,2EAA2E;IAC3E,gBAAgB,EAAE,MAAM,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACpD,2DAA2D;IAC3D,sBAAsB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IAClD,yEAAyE;IACzE,YAAY,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IAClC;;;;;OAKG;IACH,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC7C,qEAAqE;IACrE,uBAAuB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,qBAAqB,CAAC;CACjE;AAgCD;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,GACvC,MAAM,gCAAgC,KACrC,UAoEF,CAAC"}
|
|
@@ -11,8 +11,6 @@ export interface UseAttachmentActionResult {
|
|
|
11
11
|
/** Default click handler for an attachment tile: download, canvas-preview, or open-in-browser. */
|
|
12
12
|
handleAttachmentClick: (attachment: DisplayAttachment) => void;
|
|
13
13
|
}
|
|
14
|
-
/** Returns true when a value looks like a DIAL Core file id (`files/{bucket}/{path}`). */
|
|
15
|
-
export declare const isDialFileId: (url: string) => boolean;
|
|
16
14
|
/** Returns true when `downloadAttachment` can trigger a download for `attachment`. */
|
|
17
15
|
export declare const isDownloadableAttachment: (attachment: DisplayAttachment) => boolean;
|
|
18
16
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAttachmentAction.d.ts","sourceRoot":"","sources":["../../../src/attachment/useAttachmentAction/useAttachmentAction.ts"],"names":[],"mappings":"AAKA,OAAO,EAML,KAAK,iBAAiB,EACvB,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"useAttachmentAction.d.ts","sourceRoot":"","sources":["../../../src/attachment/useAttachmentAction/useAttachmentAction.ts"],"names":[],"mappings":"AAKA,OAAO,EAML,KAAK,iBAAiB,EACvB,MAAM,2BAA2B,CAAC;AAKnC,qHAAqH;AACrH,MAAM,MAAM,kBAAkB,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;AAExE,kDAAkD;AAClD,MAAM,WAAW,yBAAyB;IACxC,0DAA0D;IAC1D,kBAAkB,EAAE,kBAAkB,CAAC;CACxC;AAED,mDAAmD;AACnD,MAAM,WAAW,yBAAyB;IACxC,kGAAkG;IAClG,qBAAqB,EAAE,CAAC,UAAU,EAAE,iBAAiB,KAAK,IAAI,CAAC;CAChE;AAED,sFAAsF;AACtF,eAAO,MAAM,wBAAwB,GACnC,YAAY,iBAAiB,KAC5B,OAEsB,CAAC;AAE1B;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,GAC7B,YAAY,iBAAiB,EAC7B,oBAAoB,kBAAkB,KACrC,OAuBF,CAAC;AAqDF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,GAAI,yBAEjC,yBAAyB,KAAG,yBAmC9B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAttachmentValidation.d.ts","sourceRoot":"","sources":["../../../src/attachment/useAttachmentValidation/useAttachmentValidation.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,qBAAqB,EACrB,KAAK,UAAU,EAChB,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"useAttachmentValidation.d.ts","sourceRoot":"","sources":["../../../src/attachment/useAttachmentValidation/useAttachmentValidation.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,qBAAqB,EACrB,KAAK,UAAU,EAChB,MAAM,2BAA2B,CAAC;AAMnC,sDAAsD;AACtD,oBAAY,+BAA+B;IACzC,4EAA4E;IAC5E,cAAc,mBAAmB;IACjC,yEAAyE;IACzE,eAAe,oBAAoB;CACpC;AAED,8GAA8G;AAC9G,MAAM,WAAW,8BAA8B;IAC7C,2CAA2C;IAC3C,MAAM,EAAE,+BAA+B,CAAC;IACxC,4EAA4E;IAC5E,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,6HAA6H;IAC7H,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,sDAAsD;AACtD,MAAM,WAAW,6BAA6B;IAC5C,6DAA6D;IAC7D,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,+GAA+G;IAC/G,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,8BAA8B,KAAK,IAAI,CAAC;IACpE,wGAAwG;IACxG,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,uDAAuD;AACvD,MAAM,WAAW,6BAA6B;IAC5C,uGAAuG;IACvG,oBAAoB,EAAE,MAAM,EAAE,CAAC;IAC/B,2DAA2D;IAC3D,oBAAoB,EAAE,OAAO,CAAC;IAC9B,+FAA+F;IAC/F,kBAAkB,EAAE,CAClB,UAAU,EAAE,UAAU,KACnB,qBAAqB,GAAG,SAAS,CAAC;IACvC,gHAAgH;IAChH,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC;AAED;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,GAAI,sDAIrC,6BAA6B,KAAG,6BAqDlC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CatalogItemApiDetails } from '@epam/ai-dial-catalog';
|
|
2
|
+
/** Builds the OpenAI-compatible Chat Completions endpoint URL for a deployment. */
|
|
3
|
+
export declare const buildChatCompletionsUrl: (baseUrl: string, id: string) => string;
|
|
4
|
+
/** Builds the Responses API endpoint URL for a deployment. */
|
|
5
|
+
export declare const buildResponsesUrl: (baseUrl: string) => string;
|
|
6
|
+
/** Which generation APIs a deployment reports supporting. */
|
|
7
|
+
export interface DeploymentGenerationApiSupport {
|
|
8
|
+
hasChatCompletion?: boolean;
|
|
9
|
+
hasResponsesApi?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Builds the "Connect" tab's endpoint list for a model or application
|
|
13
|
+
* deployment: the OpenAI-compatible Chat Completions endpoint and/or the
|
|
14
|
+
* Responses API endpoint, each included only when the deployment reports
|
|
15
|
+
* supporting it. DIAL Core routes both APIs the same way for models and
|
|
16
|
+
* custom applications, keyed by the deployment id.
|
|
17
|
+
*/
|
|
18
|
+
export declare const buildDeploymentConnectApi: (baseUrl: string, id: string, { hasChatCompletion, hasResponsesApi }: DeploymentGenerationApiSupport) => CatalogItemApiDetails | undefined;
|
|
19
|
+
//# sourceMappingURL=deployment-endpoint-url.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deployment-endpoint-url.d.ts","sourceRoot":"","sources":["../../src/catalog/deployment-endpoint-url.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EAEtB,MAAM,uBAAuB,CAAC;AAuB/B,mFAAmF;AACnF,eAAO,MAAM,uBAAuB,GAAI,SAAS,MAAM,EAAE,IAAI,MAAM,KAAG,MAC2B,CAAC;AAElG,8DAA8D;AAC9D,eAAO,MAAM,iBAAiB,GAAI,SAAS,MAAM,KAAG,MACC,CAAC;AAEtD,6DAA6D;AAC7D,MAAM,WAAW,8BAA8B;IAC7C,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,GACpC,SAAS,MAAM,EACf,IAAI,MAAM,EACV,wCAAwC,8BAA8B,KACrE,qBAAqB,GAAG,SAqC1B,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { DeploymentItemDto } from '@epam/ai-dial-chat-api-client';
|
|
2
|
+
/**
|
|
3
|
+
* Percent-encodes each `/`-separated segment of a deployment/application id
|
|
4
|
+
* so it satisfies the backend's `DEPLOYMENT_ID_PATTERN` (spaces and other
|
|
5
|
+
* reserved characters must be percent-encoded; `/` stays a literal path
|
|
6
|
+
* separator). Applications created via `POST /api/v1/applications` return an
|
|
7
|
+
* id built from the raw, human-readable name (e.g. `applications/<bucket>/My
|
|
8
|
+
* App__1.0`), which is only ever consumed by the settings iframe's postMessage
|
|
9
|
+
* protocol elsewhere — anywhere that id is used as a chat `deploymentId`, it
|
|
10
|
+
* must be encoded first.
|
|
11
|
+
*/
|
|
12
|
+
export declare const encodeDeploymentId: (id: string) => string;
|
|
13
|
+
/**
|
|
14
|
+
* Finds a deployment matching `idOrReference` by `id` first, falling back to
|
|
15
|
+
* `reference` when no `id` matches. DIAL Core sometimes addresses a
|
|
16
|
+
* deployment by `reference` in places that store a deployment id (e.g. a
|
|
17
|
+
* conversation's or message's `model.id`), so lookups against the fetched
|
|
18
|
+
* deployments list must accept either value.
|
|
19
|
+
*/
|
|
20
|
+
export declare const findDeploymentByIdOrReference: (deployments: DeploymentItemDto[], idOrReference: string | null | undefined) => DeploymentItemDto | undefined;
|
|
21
|
+
//# sourceMappingURL=deployment-id.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deployment-id.d.ts","sourceRoot":"","sources":["../../src/catalog/deployment-id.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAEvE;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB,GAAI,IAAI,MAAM,KAAG,MAIlC,CAAC;AAEf;;;;;;GAMG;AACH,eAAO,MAAM,6BAA6B,GACxC,aAAa,iBAAiB,EAAE,EAChC,eAAe,MAAM,GAAG,IAAI,GAAG,SAAS,KACvC,iBAAiB,GAAG,SAMtB,CAAC"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/** Toolset authentication mechanism as reported by DIAL Core. */
|
|
2
|
+
export declare enum AuthenticationType {
|
|
3
|
+
None = "NONE",
|
|
4
|
+
ApiKey = "API_KEY",
|
|
5
|
+
OAuth = "OAUTH"
|
|
6
|
+
}
|
|
7
|
+
/** Feature-support flags for a model deployment. */
|
|
8
|
+
export interface ModelCapabilities {
|
|
9
|
+
hasTools?: boolean;
|
|
10
|
+
hasMcp?: boolean;
|
|
11
|
+
hasCaching?: boolean;
|
|
12
|
+
hasParallelToolCalls?: boolean;
|
|
13
|
+
hasUrlAttachments?: boolean;
|
|
14
|
+
hasFolderAttachments?: boolean;
|
|
15
|
+
hasSeed?: boolean;
|
|
16
|
+
hasSystemPrompt?: boolean;
|
|
17
|
+
hasResume?: boolean;
|
|
18
|
+
hasChatCompletion?: boolean;
|
|
19
|
+
hasResponsesApi?: boolean;
|
|
20
|
+
reasoningEfforts?: string[];
|
|
21
|
+
}
|
|
22
|
+
/** Catalog-facing specification fields for a model deployment. */
|
|
23
|
+
export interface ModelSpecification {
|
|
24
|
+
provider?: string;
|
|
25
|
+
vendor?: string;
|
|
26
|
+
license?: string;
|
|
27
|
+
knowledgeCutoffDate?: string;
|
|
28
|
+
parameters?: string;
|
|
29
|
+
contextWindowTokens?: number;
|
|
30
|
+
maxOutputTokens?: number;
|
|
31
|
+
inputTypes?: string[];
|
|
32
|
+
hostedBy?: string;
|
|
33
|
+
createdAt?: number;
|
|
34
|
+
}
|
|
35
|
+
/** One priced unit for a model deployment. */
|
|
36
|
+
export interface ModelPriceRow {
|
|
37
|
+
/** DIAL Core pricing key, e.g. `prompt`, `completion`, `cache_read`. */
|
|
38
|
+
key: string;
|
|
39
|
+
/** Per-unit price formatted for display, e.g. `$3/M tokens`. */
|
|
40
|
+
price: string;
|
|
41
|
+
}
|
|
42
|
+
/** A model deployment's full price list. */
|
|
43
|
+
export interface ModelPricing {
|
|
44
|
+
/** Every price DIAL Core reports for the deployment, `unit` excluded. */
|
|
45
|
+
prices?: ModelPriceRow[];
|
|
46
|
+
}
|
|
47
|
+
/** API-resource identifiers for a model deployment. */
|
|
48
|
+
export interface ModelApiDetails {
|
|
49
|
+
modelId?: string;
|
|
50
|
+
}
|
|
51
|
+
/** Full details payload for a model-type deployment. */
|
|
52
|
+
export interface ModelEntityDetails {
|
|
53
|
+
capabilities?: ModelCapabilities;
|
|
54
|
+
specification?: ModelSpecification;
|
|
55
|
+
pricing?: ModelPricing;
|
|
56
|
+
api?: ModelApiDetails;
|
|
57
|
+
}
|
|
58
|
+
/** Catalog-facing specification fields for an agent (application) deployment. */
|
|
59
|
+
export interface AgentSpecification {
|
|
60
|
+
hostedBy?: string;
|
|
61
|
+
createdAt?: number;
|
|
62
|
+
routes?: string[];
|
|
63
|
+
}
|
|
64
|
+
/** Feature-support flags for an agent (application) deployment. */
|
|
65
|
+
export interface AgentCapabilities {
|
|
66
|
+
hasTools?: boolean;
|
|
67
|
+
hasMcp?: boolean;
|
|
68
|
+
hasCaching?: boolean;
|
|
69
|
+
hasParallelToolCalls?: boolean;
|
|
70
|
+
hasUrlAttachments?: boolean;
|
|
71
|
+
hasFolderAttachments?: boolean;
|
|
72
|
+
hasSeed?: boolean;
|
|
73
|
+
hasSystemPrompt?: boolean;
|
|
74
|
+
hasResume?: boolean;
|
|
75
|
+
hasConfiguration?: boolean;
|
|
76
|
+
hasChatCompletion?: boolean;
|
|
77
|
+
hasResponsesApi?: boolean;
|
|
78
|
+
}
|
|
79
|
+
/** Input-attachment configuration for an agent (application) deployment. */
|
|
80
|
+
export interface AgentConfiguration {
|
|
81
|
+
inputAttachmentTypes?: string[];
|
|
82
|
+
}
|
|
83
|
+
/** Full details payload for an agent (application)-type deployment. */
|
|
84
|
+
export interface AgentEntityDetails {
|
|
85
|
+
specification?: AgentSpecification;
|
|
86
|
+
configuration?: AgentConfiguration;
|
|
87
|
+
capabilities?: AgentCapabilities;
|
|
88
|
+
}
|
|
89
|
+
/** Sign-in status at both the personal and org-wide (global) level for a toolset. */
|
|
90
|
+
export interface ToolsetAuthStatus {
|
|
91
|
+
global?: string;
|
|
92
|
+
appLevel?: string;
|
|
93
|
+
userLevel?: string;
|
|
94
|
+
scopesSupported?: string[];
|
|
95
|
+
authorizationEndpoint?: string;
|
|
96
|
+
tokenEndpoint?: string;
|
|
97
|
+
apiKeyHeader?: string;
|
|
98
|
+
}
|
|
99
|
+
/** Catalog-facing specification fields for a toolset. */
|
|
100
|
+
export interface ToolsetSpecification {
|
|
101
|
+
authentication?: AuthenticationType;
|
|
102
|
+
permissions?: string[];
|
|
103
|
+
hostedBy?: string;
|
|
104
|
+
authStatus?: ToolsetAuthStatus;
|
|
105
|
+
createdAt?: number;
|
|
106
|
+
/** Names of all tools the underlying MCP server supports, not just the allow-listed subset in `permissions`. */
|
|
107
|
+
allTools?: string[];
|
|
108
|
+
}
|
|
109
|
+
/** Feature-support flags for a toolset. */
|
|
110
|
+
export interface ToolsetCapabilities {
|
|
111
|
+
hasMcp?: boolean;
|
|
112
|
+
hasCaching?: boolean;
|
|
113
|
+
hasSystemPrompt?: boolean;
|
|
114
|
+
hasResume?: boolean;
|
|
115
|
+
}
|
|
116
|
+
/** Full details payload for a toolset-type deployment. */
|
|
117
|
+
export interface ToolsetEntityDetails {
|
|
118
|
+
specification?: ToolsetSpecification;
|
|
119
|
+
capabilities?: ToolsetCapabilities;
|
|
120
|
+
}
|
|
121
|
+
/** Discriminated-union entity details for a deployment, keyed by catalog entity type. */
|
|
122
|
+
export type EntitySpecificDetails = {
|
|
123
|
+
type: 'MODEL';
|
|
124
|
+
data: ModelEntityDetails;
|
|
125
|
+
} | {
|
|
126
|
+
type: 'AGENT';
|
|
127
|
+
data: AgentEntityDetails;
|
|
128
|
+
} | {
|
|
129
|
+
type: 'TOOLSET';
|
|
130
|
+
data: ToolsetEntityDetails;
|
|
131
|
+
};
|
|
132
|
+
//# sourceMappingURL=entity-details.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-details.d.ts","sourceRoot":"","sources":["../../src/catalog/entity-details.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,oBAAY,kBAAkB;IAC5B,IAAI,SAAS;IACb,MAAM,YAAY;IAClB,KAAK,UAAU;CAChB;AAUD,oDAAoD;AACpD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,iBAAiB,CA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AAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gHAAgH;IAChH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAOD,2CAA2C;AAC3C,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,0DAA0D;AAC1D,MAAM,WAAW,oBAAoB;IACnC,aAAa,CAAC,EAAE,oBAAoB,CAAC;IACrC,YAAY,CAAC,EAAE,mBAAmB,CAAC;CACpC;AASD,yFAAyF;AACzF,MAAM,MAAM,qBAAqB,GAC7B;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,kBAAkB,CAAA;CAAE,GAC3C;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,kBAAkB,CAAA;CAAE,GAC3C;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,oBAAoB,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DeploymentLimitsResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
2
|
+
/** Normalized monthly token usage consumed by the conversation input control. */
|
|
3
|
+
export interface MonthlyUsageLimit {
|
|
4
|
+
/** Normalized used-token count. */
|
|
5
|
+
used: number;
|
|
6
|
+
/** Configured monthly token limit. */
|
|
7
|
+
total: number;
|
|
8
|
+
/** Remaining monthly tokens, clamped to zero. */
|
|
9
|
+
remaining: number;
|
|
10
|
+
/** Monthly utilization percentage, clamped to 0–100. */
|
|
11
|
+
usedPercent: number;
|
|
12
|
+
}
|
|
13
|
+
/** Maps the monthly deployment token limit to a display-ready value. */
|
|
14
|
+
export declare const mapDeploymentLimitsToInput: (dto: DeploymentLimitsResponseDto | undefined) => MonthlyUsageLimit | undefined;
|
|
15
|
+
//# sourceMappingURL=map-deployment-limits-to-input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"map-deployment-limits-to-input.d.ts","sourceRoot":"","sources":["../../src/catalog/map-deployment-limits-to-input.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAEjF,iFAAiF;AACjF,MAAM,WAAW,iBAAiB;IAChC,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,sCAAsC;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,iDAAiD;IACjD,SAAS,EAAE,MAAM,CAAC;IAClB,wDAAwD;IACxD,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,wEAAwE;AACxE,eAAO,MAAM,0BAA0B,GACrC,KAAK,2BAA2B,GAAG,SAAS,KAC3C,iBAAiB,GAAG,SAqBtB,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { CatalogItem, CatalogItemCredentials } from '@epam/ai-dial-catalog';
|
|
2
|
+
import { DeploymentItemDto, DialToolsetAuthSettingsDto, DialToolsetDto } from '@epam/ai-dial-chat-api-client';
|
|
3
|
+
import { EntitySpecificDetails } from './entity-details';
|
|
4
|
+
/**
|
|
5
|
+
* Maps a toolset's auth settings (from a deployment listing row) into the
|
|
6
|
+
* lib's credential-status shape, including both `USER` and `GLOBAL` sign-in
|
|
7
|
+
* status, whether the toolset is public, and whether the current user (if an
|
|
8
|
+
* admin) may manage both levels. Named apart from
|
|
9
|
+
* `map-entity-details-to-catalog.ts`'s `mapToolsetCredentials` (a different
|
|
10
|
+
* input shape, `ToolsetEntityDetails`) to avoid an ambiguous `export *`
|
|
11
|
+
* collision between the two modules.
|
|
12
|
+
*
|
|
13
|
+
* For a non-admin on a public toolset that already has `GLOBAL` credentials
|
|
14
|
+
* signed in, the lib's own `LoginWithMyCreds` CTA fires unconditionally off
|
|
15
|
+
* `isPublic` alone, regardless of whether org-wide credentials already cover
|
|
16
|
+
* everyone (`node_modules/@epam/ai-dial-catalog/dist/index.js`, the `ct`
|
|
17
|
+
* helper). Global auth is sufficient to use the toolset — a personal login
|
|
18
|
+
* is optional, not required — so this suppresses that CTA by reporting
|
|
19
|
+
* `authenticationType: None`, which is the lib's own documented signal to
|
|
20
|
+
* hide the credentials control entirely.
|
|
21
|
+
*/
|
|
22
|
+
export declare const mapDeploymentToolsetCredentials: (toolsetId: string, authSettings: DialToolsetAuthSettingsDto | undefined, isAdmin: boolean) => CatalogItemCredentials | undefined;
|
|
23
|
+
/** Translated folder-path labels for the Personal/Shared/Public deployment groupings. */
|
|
24
|
+
export interface DeploymentFolderLabels {
|
|
25
|
+
personal: string;
|
|
26
|
+
shared: string;
|
|
27
|
+
public: string;
|
|
28
|
+
}
|
|
29
|
+
export declare const resolveDeploymentFolder: (deployment: Pick<DeploymentItemDto, "isMy" | "sharedWithMe" | "applicationFolder">, labels: DeploymentFolderLabels) => string[];
|
|
30
|
+
/** Parameters for {@link mapDeploymentToCatalogItem}. */
|
|
31
|
+
export interface MapDeploymentToCatalogItemOptions {
|
|
32
|
+
favoriteIds?: ReadonlySet<string>;
|
|
33
|
+
entityDetails?: EntitySpecificDetails;
|
|
34
|
+
folderLabels: DeploymentFolderLabels;
|
|
35
|
+
editableSchemaIds?: string[];
|
|
36
|
+
isCustomAppsEditable?: boolean;
|
|
37
|
+
/** The viewer's active display locale, used to resolve `displayName`/`description`. */
|
|
38
|
+
activeLocale: string;
|
|
39
|
+
/** The fixed content language `displayName`/`description` fall back to when `activeLocale` has no entry. */
|
|
40
|
+
primaryLocale: string;
|
|
41
|
+
/** Resolves a deployment's raw `iconUrl` to a displayable URL. Host-owned. */
|
|
42
|
+
resolveIconUrl: (iconUrl: string | undefined) => string | undefined;
|
|
43
|
+
}
|
|
44
|
+
/** Maps a deployment listing row into the catalog UI's `CatalogItem` shape. */
|
|
45
|
+
export declare const mapDeploymentToCatalogItem: (deployment: DeploymentItemDto, { favoriteIds, entityDetails, folderLabels, editableSchemaIds, isCustomAppsEditable, activeLocale, primaryLocale, resolveIconUrl, }: MapDeploymentToCatalogItemOptions) => CatalogItem;
|
|
46
|
+
/** Parameters for {@link mapToolsetToCatalogItem}. */
|
|
47
|
+
export interface MapToolsetToCatalogItemOptions {
|
|
48
|
+
favoriteIds?: ReadonlySet<string>;
|
|
49
|
+
isAdmin?: boolean;
|
|
50
|
+
folderLabels?: DeploymentFolderLabels;
|
|
51
|
+
/** The viewer's active display locale, used to resolve `displayName`/`description`. */
|
|
52
|
+
activeLocale: string;
|
|
53
|
+
/** The fixed content language `displayName`/`description` fall back to when `activeLocale` has no entry. */
|
|
54
|
+
primaryLocale: string;
|
|
55
|
+
/** Resolves a toolset's raw `iconUrl` to a displayable URL. Host-owned. */
|
|
56
|
+
resolveIconUrl: (iconUrl: string | undefined) => string | undefined;
|
|
57
|
+
}
|
|
58
|
+
/** Maps a toolset listing row into the catalog UI's `CatalogItem` shape. */
|
|
59
|
+
export declare const mapToolsetToCatalogItem: (toolset: DialToolsetDto, { favoriteIds, isAdmin, folderLabels, activeLocale, primaryLocale, resolveIconUrl, }: MapToolsetToCatalogItemOptions) => CatalogItem;
|
|
60
|
+
//# sourceMappingURL=map-deployment-to-catalog-item.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"map-deployment-to-catalog-item.d.ts","sourceRoot":"","sources":["../../src/catalog/map-deployment-to-catalog-item.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAC5B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EACV,iBAAiB,EACjB,0BAA0B,EAC1B,cAAc,EACf,MAAM,+BAA+B,CAAC;AAIvC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAkC9D;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,+BAA+B,GAC1C,WAAW,MAAM,EACjB,cAAc,0BAA0B,GAAG,S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MAAM,GAAG,SAAS,CAAC;CACrE;AAED,4EAA4E;AAC5E,eAAO,MAAM,uBAAuB,GAClC,SAAS,cAAc,EACvB,sFAOG,8BAA8B,KAChC,WA6CF,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { CatalogItemCredentials, CatalogItemTabData } from '@epam/ai-dial-catalog';
|
|
2
|
+
import { DeploymentDetailsDto } from '@epam/ai-dial-chat-api-client';
|
|
3
|
+
import { EntitySpecificDetails, ToolsetEntityDetails } from './entity-details';
|
|
4
|
+
/**
|
|
5
|
+
* Maps a toolset's specification into the lib's credential-status shape,
|
|
6
|
+
* for refreshing the details panel after login/logout. Includes both
|
|
7
|
+
* `USER` and `GLOBAL` status, whether the toolset is public, and whether
|
|
8
|
+
* the current user (if an admin) may manage both levels.
|
|
9
|
+
*/
|
|
10
|
+
export declare const mapToolsetCredentials: (toolsetId: string, data: ToolsetEntityDetails, isAdmin: boolean) => CatalogItemCredentials | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Converts a strongly-typed entity domain model into the lib's `CatalogItemTabData` shape.
|
|
13
|
+
* Every label is a fixed English string — the app's i18n keys for these labels are dropped
|
|
14
|
+
* on the move, since the lib cannot import the app's translation-key enum.
|
|
15
|
+
*/
|
|
16
|
+
export declare const mapEntityDetailsToCatalogDetails: (details: EntitySpecificDetails) => CatalogItemTabData;
|
|
17
|
+
/**
|
|
18
|
+
* Converts the backend `DeploymentDetailsDto` (model/application/toolset,
|
|
19
|
+
* fetched by id) into the strongly-typed `EntitySpecificDetails` domain model
|
|
20
|
+
* consumed by `mapEntityDetailsToCatalogDetails`.
|
|
21
|
+
*/
|
|
22
|
+
export declare const mapDeploymentDetailsDtoToEntityDetails: (dto: DeploymentDetailsDto) => EntitySpecificDetails;
|
|
23
|
+
//# sourceMappingURL=map-entity-details-to-catalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"map-entity-details-to-catalog.d.ts","sourceRoot":"","sources":["../../src/catalog/map-entity-details-to-catalog.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,sBAAsB,EAEtB,kBAAkB,EAGnB,MAAM,uBAAuB,CAAC;AAK/B,OAAO,KAAK,EACV,oBAAoB,EAErB,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EAGL,KAAK,qBAAqB,EAI1B,KAAK,oBAAoB,EAE1B,MAAM,kBAAkB,CAAC;AA4P1B;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,GAChC,WAAW,MAAM,EACjB,MAAM,oBAAoB,EAC1B,SAAS,OAAO,KACf,sBAAsB,GAAG,SAoB3B,CAAC;AAgEF;;;;GAIG;AACH,eAAO,MAAM,gCAAgC,GAC3C,SAAS,qBAAqB,KAC7B,kBASF,CAAC;AA0NF;;;;GAIG;AACH,eAAO,MAAM,sCAAsC,GACjD,KAAK,oBAAoB,KACxB,qBASF,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { CatalogItemOverview, CatalogItem } from '@epam/ai-dial-catalog';
|
|
2
|
+
import { PromptResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
3
|
+
import { PromptSource } from '../prompt/prompt-resource';
|
|
4
|
+
import { DeploymentFolderLabels } from './map-deployment-to-catalog-item';
|
|
5
|
+
/** Translated labels for the Overview tab's author/updated rows and section title. */
|
|
6
|
+
export interface PromptOverviewLabels {
|
|
7
|
+
authorLabel: string;
|
|
8
|
+
updatedLabel: string;
|
|
9
|
+
sectionTitle: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Builds the Overview tab data for a prompt: who authored it and when it last
|
|
13
|
+
* changed. The description is not repeated here — the Details tab already
|
|
14
|
+
* shows it above the body.
|
|
15
|
+
*/
|
|
16
|
+
export declare const buildPromptOverview: (prompt: PromptResponseDto, labels: PromptOverviewLabels) => CatalogItemOverview;
|
|
17
|
+
/**
|
|
18
|
+
* Whether a prompt item came from the organisation namespace, which the public
|
|
19
|
+
* prompt endpoints serve. Personal prompts resolve through the caller's own
|
|
20
|
+
* bucket, while shared prompts carry their owner's bucket in the resource URL.
|
|
21
|
+
*/
|
|
22
|
+
export declare const isOrganisationPromptItem: (item: CatalogItem) => boolean;
|
|
23
|
+
/** Parameters for {@link mapPromptToCatalogItem}. */
|
|
24
|
+
export interface MapPromptToCatalogItemOptions {
|
|
25
|
+
/** Personal/Shared/Public folder labels; i18n stays at the app edge. */
|
|
26
|
+
folderLabels: DeploymentFolderLabels;
|
|
27
|
+
/** Author/updated/section-title labels for the Overview tab; i18n stays at the app edge. */
|
|
28
|
+
overviewLabels: PromptOverviewLabels;
|
|
29
|
+
/** Namespace the prompt came from; drives ownership flags and the folder prefix. */
|
|
30
|
+
source: PromptSource;
|
|
31
|
+
/** Favorited resource ids from the user config, keyed by prompt path. */
|
|
32
|
+
favoriteIds: ReadonlySet<string>;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Maps a prompt DTO into a catalog item.
|
|
36
|
+
*
|
|
37
|
+
* A personal or organisation prompt uses its DIAL path verbatim as
|
|
38
|
+
* `CatalogItem.id` — its bucket is implied by the endpoint that serves it. A
|
|
39
|
+
* shared-with-me prompt cannot: its path is relative to the *owner's* bucket,
|
|
40
|
+
* so a bare path both collides with a same-named personal prompt and resolves
|
|
41
|
+
* against the caller's own bucket when read back. Those items carry the
|
|
42
|
+
* qualified `prompts/{ownerBucket}/{path}` url instead.
|
|
43
|
+
*/
|
|
44
|
+
export declare const mapPromptToCatalogItem: (prompt: PromptResponseDto, { folderLabels, overviewLabels, source, favoriteIds, }: MapPromptToCatalogItemOptions) => CatalogItem;
|
|
45
|
+
//# sourceMappingURL=map-prompt-to-catalog-item.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"map-prompt-to-catalog-item.d.ts","sourceRoot":"","sources":["../../src/catalog/map-prompt-to-catalog-item.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAEjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAEvE,OAAO,EAEL,YAAY,EACb,MAAM,2BAA2B,CAAC;AAGnC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAkB/E,sFAAsF;AACtF,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAC9B,QAAQ,iBAAiB,EACzB,QAAQ,oBAAoB,KAC3B,mBAaF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,GAAI,MAAM,WAAW,KAAG,OACxB,CAAC;AAEtC,qDAAqD;AACrD,MAAM,WAAW,6BAA6B;IAC5C,wEAAwE;IACxE,YAAY,EAAE,sBAAsB,CAAC;IACrC,4FAA4F;IAC5F,cAAc,EAAE,oBAAoB,CAAC;IACrC,oFAAoF;IACpF,MAAM,EAAE,YAAY,CAAC;IACrB,yEAAyE;IACzE,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAClC;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,sBAAsB,GACjC,QAAQ,iBAAiB,EACzB,wDAKG,6BAA6B,KAC/B,WAyCF,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { CatalogContentTreeNode, CatalogItem, CatalogItemOverview } from '@epam/ai-dial-catalog';
|
|
2
|
+
import { SkillMetadataItemDto } from '@epam/ai-dial-chat-api-client';
|
|
3
|
+
import { SkillAboutDetails } from '../skill/skill-manifest';
|
|
4
|
+
import { SkillSource } from '../skill/skill-types';
|
|
5
|
+
import { DeploymentFolderLabels } from './map-deployment-to-catalog-item';
|
|
6
|
+
/** Parameters for {@link mapSkillToCatalogItem}. */
|
|
7
|
+
export interface MapSkillToCatalogItemOptions {
|
|
8
|
+
/** Personal/Shared/Public folder labels; i18n stays at the app edge. */
|
|
9
|
+
folderLabels: DeploymentFolderLabels;
|
|
10
|
+
/** Namespace the skill came from; drives ownership flags and the folder prefix. */
|
|
11
|
+
source: SkillSource;
|
|
12
|
+
/** Favorited resource ids from the user config, keyed by skill resource URL. */
|
|
13
|
+
favoriteIds: ReadonlySet<string>;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Maps a skill's DIAL Core metadata into a catalog item. The full
|
|
17
|
+
* `skills/{bucket}/{path}` resource URL is used as `CatalogItem.id` rather
|
|
18
|
+
* than the bucket-relative path: the catalog lists two buckets, and the same
|
|
19
|
+
* relative path can exist in both.
|
|
20
|
+
*/
|
|
21
|
+
export declare const mapSkillToCatalogItem: (skill: SkillMetadataItemDto, { folderLabels, source, favoriteIds }: MapSkillToCatalogItemOptions) => CatalogItem;
|
|
22
|
+
/** Translated labels for the skill Overview tab's Specification/Details sections. */
|
|
23
|
+
export interface SkillOverviewLabels {
|
|
24
|
+
whenToUseLabel: string;
|
|
25
|
+
allowedToolsLabel: string;
|
|
26
|
+
bundledResourcesLabel: string;
|
|
27
|
+
specificationSectionTitle: string;
|
|
28
|
+
authorLabel: string;
|
|
29
|
+
updatedLabel: string;
|
|
30
|
+
fileCountLabel: string;
|
|
31
|
+
detailsSectionTitle: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Resolves the manifest file's opaque listing id across DIAL Core versions.
|
|
35
|
+
* Some return file-relative paths (`SKILL.md`), while others prefix the
|
|
36
|
+
* skill's path and its internal `files` directory. The returned id is kept
|
|
37
|
+
* verbatim so it matches the corresponding tree node exactly.
|
|
38
|
+
*/
|
|
39
|
+
export declare const resolveSkillManifestFileId: (files: SkillMetadataItemDto[], skillPath: string) => string;
|
|
40
|
+
/**
|
|
41
|
+
* Converts an opaque file-listing id into the path expected by the single-file
|
|
42
|
+
* download endpoint. Core may prefix listing paths with the skill path and its
|
|
43
|
+
* internal `files` directory, while the endpoint accepts a path relative to
|
|
44
|
+
* that directory. File-relative ids are returned unchanged.
|
|
45
|
+
*/
|
|
46
|
+
export declare const resolveSkillFileDownloadPath: (fileId: string, skillPath: string) => string | null;
|
|
47
|
+
/**
|
|
48
|
+
* Builds the Overview tab data for a skill: a Specification section from its
|
|
49
|
+
* parsed manifest frontmatter, followed by a Details section covering who
|
|
50
|
+
* authored it, when it last changed, and its file inventory. Grouping folders
|
|
51
|
+
* in the file listing are excluded from both the count and the rows. Sizes are
|
|
52
|
+
* not shown — the skill metadata carries no content-length field.
|
|
53
|
+
*/
|
|
54
|
+
export declare const buildSkillOverview: (skill: SkillMetadataItemDto | undefined, files: SkillMetadataItemDto[], about: SkillAboutDetails | undefined, labels: SkillOverviewLabels) => CatalogItemOverview;
|
|
55
|
+
/**
|
|
56
|
+
* Builds the Content tab's hierarchical file tree for a skill from
|
|
57
|
+
* `listSkillFiles({ recursive: true })`'s flat listing. Every entry's path is
|
|
58
|
+
* first stripped of the skill's own path prefix and its internal `files`
|
|
59
|
+
* storage directory (see `stripSkillPathPrefix`) — the skill's own root
|
|
60
|
+
* folder and that `files` directory are Core storage implementation details,
|
|
61
|
+
* not authored structure, so neither appears as a wrapping node. An entry
|
|
62
|
+
* that strips to nothing (the skill root, or the bare `files` directory
|
|
63
|
+
* itself) contributes no node. Every folder entry is attached under its own
|
|
64
|
+
* stripped path so an empty grouping folder still appears; every file entry
|
|
65
|
+
* attaches under the folder chain its stripped path implies, synthesizing
|
|
66
|
+
* any intermediate folder the listing never enumerated on its own. A file
|
|
67
|
+
* node's `id` is the listing entry's own (unstripped) path, so it round-trips
|
|
68
|
+
* back to `downloadSkillFile` without being re-derived; a folder node's `id`
|
|
69
|
+
* is the stripped path and only keys client-side expand/collapse state.
|
|
70
|
+
*/
|
|
71
|
+
export declare const buildSkillContentTree: (files: SkillMetadataItemDto[], skillPath: string) => CatalogContentTreeNode[];
|
|
72
|
+
/**
|
|
73
|
+
* Reads a skill file response as raw bytes, or `null` when the body is
|
|
74
|
+
* larger than `SKILL_MANIFEST_MAX_BYTES`. The declared `content-length` is
|
|
75
|
+
* checked first so an oversized body is never read into memory at all; the
|
|
76
|
+
* actual byte length is checked again after reading, for a response with no
|
|
77
|
+
* (or an inaccurate) declared length. Applies identically to every skill
|
|
78
|
+
* file, text or binary — not only `SKILL.md`.
|
|
79
|
+
*/
|
|
80
|
+
export declare const readSkillFileBytes: (response: Response) => Promise<Uint8Array | null>;
|
|
81
|
+
/**
|
|
82
|
+
* Reads a skill manifest response as text, or `null` when the body is larger
|
|
83
|
+
* than `SKILL_MANIFEST_MAX_BYTES`. The size is checked before decoding, so an
|
|
84
|
+
* oversized manifest is never turned into a string.
|
|
85
|
+
*/
|
|
86
|
+
export declare const readSkillManifest: (response: Response) => Promise<string | null>;
|
|
87
|
+
//# sourceMappingURL=map-skill-to-catalog-item.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"map-skill-to-catalog-item.d.ts","sourceRoot":"","sources":["../../src/catalog/map-skill-to-catalog-item.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,sBAAsB,EAC3B,KAAK,WAAW,EAChB,KAAK,mBAAmB,EAGzB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,+BAA+B,CAAC;AAQvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAA4B,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAiB/E,oDAAoD;AACpD,MAAM,WAAW,4BAA4B;IAC3C,wEAAwE;IACxE,YAAY,EAAE,sBAAsB,CAAC;IACrC,mFAAmF;IACnF,MAAM,EAAE,WAAW,CAAC;IACpB,gFAAgF;IAChF,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAClC;AAED;;;;;GA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
|
+
import { CatalogEntityType } from '@epam/ai-dial-chat-shared';
|
|
3
|
+
/** Resource families that DIAL Core exposes an MCP endpoint for. */
|
|
4
|
+
export declare enum McpResourceKind {
|
|
5
|
+
/** Toolsets, served under `/v1/toolset/{id}/mcp`. */
|
|
6
|
+
Toolset = "toolset",
|
|
7
|
+
/** Application deployments, served under `/v1/deployments/{id}/mcp`. */
|
|
8
|
+
Application = "application"
|
|
9
|
+
}
|
|
10
|
+
/** Builds the MCP endpoint URL for a toolset resource. */
|
|
11
|
+
export declare const buildToolsetMcpUrl: (baseUrl: string, id: string) => string;
|
|
12
|
+
/** Builds the MCP endpoint URL for an application-deployment resource. */
|
|
13
|
+
export declare const buildApplicationMcpUrl: (baseUrl: string, id: string) => string;
|
|
14
|
+
/** Returns the MCP resource kind a catalog item's Connect endpoint belongs to, or `null` when the item exposes no MCP endpoint. */
|
|
15
|
+
export declare const resolveMcpResourceKind: (type: CatalogEntityType, supportsMcp?: boolean) => McpResourceKind | null;
|
|
16
|
+
/** Builds the "Connect" tab's resource/endpoint/snippet data for the MCP endpoint of the given resource kind. */
|
|
17
|
+
export declare const buildConnectApi: (baseUrl: string, id: string, kind: McpResourceKind) => CatalogItemApiDetails;
|
|
18
|
+
//# sourceMappingURL=mcp-endpoint-url.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-endpoint-url.d.ts","sourceRoot":"","sources":["../../src/catalog/mcp-endpoint-url.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAEnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9D,oEAAoE;AACpE,oBAAY,eAAe;IACzB,qDAAqD;IACrD,OAAO,YAAY;IACnB,wEAAwE;IACxE,WAAW,gBAAgB;CAC5B;AAmBD,0DAA0D;AAC1D,eAAO,MAAM,kBAAkB,GAAI,SAAS,MAAM,EAAE,IAAI,MAAM,KAAG,MACY,CAAC;AAE9E,0EAA0E;AAC1E,eAAO,MAAM,sBAAsB,GAAI,SAAS,MAAM,EAAE,IAAI,MAAM,KAAG,MACY,CAAC;AAUlF,mIAAmI;AACnI,eAAO,MAAM,sBAAsB,GACjC,MAAM,iBAAiB,EACvB,cAAc,OAAO,KACpB,eAAe,GAAG,IAMpB,CAAC;AAEF,iHAAiH;AACjH,eAAO,MAAM,eAAe,GAC1B,SAAS,MAAM,EACf,IAAI,MAAM,EACV,MAAM,eAAe,KACpB,qBAWF,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PublishConversationResultDto, PublishHistoryEntryDto } from '@epam/ai-dial-chat-api-client';
|
|
2
|
+
import { CatalogEntityType } from '@epam/ai-dial-chat-shared';
|
|
3
|
+
import { PublishHistoryEntry } from '@epam/ai-dial-publish-panel';
|
|
4
|
+
/**
|
|
5
|
+
* The publish API's entity-type path param values. Re-declared as a plain
|
|
6
|
+
* string-literal union rather than importing the generated
|
|
7
|
+
* `PublishCatalogEntityEntityTypeEnum`, so this module has no dependency on
|
|
8
|
+
* the app's own `server-api` layer.
|
|
9
|
+
*/
|
|
10
|
+
export type CatalogPublishEntityType = 'model' | 'toolset' | 'application' | 'prompt' | 'skill';
|
|
11
|
+
/** Maps a catalog item's entity type to the publish API's entity-type path param, or `undefined` if that type is not publishable. */
|
|
12
|
+
export declare const toPublishEntityType: (type: CatalogEntityType) => CatalogPublishEntityType | undefined;
|
|
13
|
+
/** Maps a publish-history API response entry to the catalog lib's `PublishHistoryEntry` model. */
|
|
14
|
+
export declare const mapPublishHistoryEntryDto: (dto: PublishHistoryEntryDto) => PublishHistoryEntry;
|
|
15
|
+
/** Maps a conversation publish-history API response entry to the publish panel's `PublishHistoryEntry` model. */
|
|
16
|
+
export declare const mapPublishConversationResultDto: (dto: PublishConversationResultDto) => PublishHistoryEntry;
|
|
17
|
+
//# sourceMappingURL=publish.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../src/catalog/publish.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,4BAA4B,EAC5B,sBAAsB,EACvB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAEvE;;;;;GAKG;AACH,MAAM,MAAM,wBAAwB,GAChC,OAAO,GACP,SAAS,GACT,aAAa,GACb,QAAQ,GACR,OAAO,CAAC;AAYZ,qIAAqI;AACrI,eAAO,MAAM,mBAAmB,GAC9B,MAAM,iBAAiB,KACtB,wBAAwB,GAAG,SAA2C,CAAC;AAE1E,kGAAkG;AAClG,eAAO,MAAM,yBAAyB,GACpC,KAAK,sBAAsB,KAC1B,mBAID,CAAC;AAEH,iHAAiH;AACjH,eAAO,MAAM,+BAA+B,GAC1C,KAAK,4BAA4B,KAChC,mBAKD,CAAC"}
|