@epam/ai-dial-chat-hooks 1.0.0 → 1.0.1
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-catalog.d.ts +33 -0
- package/catalog/map-deployment-limits-to-catalog.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/catalog/useFavoriteEntitiesState/useFavoriteEntitiesState.d.ts +37 -0
- package/catalog/useFavoriteEntitiesState/useFavoriteEntitiesState.d.ts.map +1 -0
- package/conversation/announcement-message.d.ts +28 -0
- package/conversation/announcement-message.d.ts.map +1 -0
- package/conversation/conversation-transfer/import-conversation.d.ts.map +1 -1
- package/conversation/conversation-transfer/queue.d.ts +1 -1
- package/conversation/conversation-transfer/queue.d.ts.map +1 -1
- package/conversation/conversation-transfer/types.d.ts +0 -27
- package/conversation/conversation-transfer/types.d.ts.map +1 -1
- package/conversation/create-chat-stream-api.d.ts +38 -0
- package/conversation/create-chat-stream-api.d.ts.map +1 -0
- package/conversation/deriveConversationRowActionState/deriveConversationRowActionState.d.ts +39 -0
- package/conversation/deriveConversationRowActionState/deriveConversationRowActionState.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/useActiveConversationSync/useActiveConversationSync.d.ts +34 -0
- package/conversation/useActiveConversationSync/useActiveConversationSync.d.ts.map +1 -0
- package/conversation/useAsyncConfirmDialog/useAsyncConfirmDialog.d.ts +37 -0
- package/conversation/useAsyncConfirmDialog/useAsyncConfirmDialog.d.ts.map +1 -0
- package/conversation/useConversationExport/useConversationExport.d.ts +2 -1
- package/conversation/useConversationExport/useConversationExport.d.ts.map +1 -1
- package/conversation/useConversationHandlers/starter-option.d.ts.map +1 -1
- package/conversation/useConversationHandlers/useConversationHandlers.d.ts.map +1 -1
- package/conversation/useConversationImport/useConversationImport.d.ts +2 -1
- package/conversation/useConversationImport/useConversationImport.d.ts.map +1 -1
- package/conversation/useConversationLookupMaps/useConversationLookupMaps.d.ts +24 -0
- package/conversation/useConversationLookupMaps/useConversationLookupMaps.d.ts.map +1 -0
- package/conversation/useConversationPanelItems/useConversationPanelItems.d.ts +58 -0
- package/conversation/useConversationPanelItems/useConversationPanelItems.d.ts.map +1 -0
- 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/conversation/useImportFilePicker/useImportFilePicker.d.ts +32 -0
- package/conversation/useImportFilePicker/useImportFilePicker.d.ts.map +1 -0
- 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 +77 -1
- package/index.d.ts.map +1 -1
- package/index.js +17482 -1867
- package/oauth/authorize-url.d.ts +16 -0
- package/oauth/authorize-url.d.ts.map +1 -0
- package/oauth/handshake.d.ts +30 -0
- package/oauth/handshake.d.ts.map +1 -0
- package/oauth/models.d.ts +74 -0
- package/oauth/models.d.ts.map +1 -0
- package/oauth/popup.d.ts +30 -0
- package/oauth/popup.d.ts.map +1 -0
- package/oauth/toolset-id.d.ts +23 -0
- package/oauth/toolset-id.d.ts.map +1 -0
- package/oauth/types.d.ts +84 -0
- package/oauth/types.d.ts.map +1 -0
- package/oauth/useOAuthCallbackCompletion/useOAuthCallbackCompletion.d.ts +54 -0
- package/oauth/useOAuthCallbackCompletion/useOAuthCallbackCompletion.d.ts.map +1 -0
- package/oauth/useToolsetLogin/useToolsetLogin.d.ts +72 -0
- package/oauth/useToolsetLogin/useToolsetLogin.d.ts.map +1 -0
- 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/prompt/usePromptsState/usePromptsState.d.ts +34 -0
- package/prompt/usePromptsState/usePromptsState.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 +9 -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-batch-validation.d.ts +70 -0
- package/skill/skill-file-batch-validation.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 +114 -0
- package/skill/skill.d.ts.map +1 -0
- package/skill/useSkillEditorLoad.d.ts +74 -0
- package/skill/useSkillEditorLoad.d.ts.map +1 -0
- package/skill/useSkillEditorSubmit.d.ts +105 -0
- package/skill/useSkillEditorSubmit.d.ts.map +1 -0
- package/skill/useSkillFileActions.d.ts +53 -0
- package/skill/useSkillFileActions.d.ts.map +1 -0
- package/skill/useSkillsState/useSkillsState.d.ts +35 -0
- package/skill/useSkillsState/useSkillsState.d.ts.map +1 -0
- package/usage/useUsageData/useUsageData.d.ts +20 -0
- package/usage/useUsageData/useUsageData.d.ts.map +1 -0
- package/useToolsMenu/useToolsMenu.d.ts +7 -16
- package/useToolsMenu/useToolsMenu.d.ts.map +1 -1
- package/files/string-utils.d.ts +0 -3
- package/files/string-utils.d.ts.map +0 -1
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { SkillUploadResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
2
|
+
import { SkillEditorErrors, SkillEditorValues, SkillFileTreeNode } from '@epam/ai-dial-skill-editor';
|
|
3
|
+
import { NotificationVariant } from '@epam/ai-dial-ui-kit';
|
|
4
|
+
import { SkillFileContent } from './skill-file-preview';
|
|
5
|
+
type SubmitPhase = 'idle' | 'submitting' | 'success' | 'failure';
|
|
6
|
+
/** Already-configured DIAL Core write operations `useSkillEditorSubmit` needs. */
|
|
7
|
+
export interface SkillEditorSubmitClient {
|
|
8
|
+
/** Creates a new skill. */
|
|
9
|
+
createSkill: (bucket: string, path: string, skillManifest: string, filePaths: string[], files: Blob[]) => Promise<SkillUploadResponseDto>;
|
|
10
|
+
/** Updates an existing skill, sending `ifMatch` as the concurrency guard. */
|
|
11
|
+
updateSkill: (bucket: string, path: string, skillManifest: string, filePaths: string[], files: Blob[], ifMatch: string) => Promise<SkillUploadResponseDto>;
|
|
12
|
+
}
|
|
13
|
+
/** Localized messages `useSkillEditorSubmit` needs. */
|
|
14
|
+
export interface SkillEditorSubmitMessages {
|
|
15
|
+
/** Shown when a required field is empty. */
|
|
16
|
+
required: string;
|
|
17
|
+
/** Shown when the normalized skill name fails DIAL's naming rules. */
|
|
18
|
+
nameInvalid: string;
|
|
19
|
+
/** Shown when the skill name already exists (409), or defensively on an unreachable create-mode 412. */
|
|
20
|
+
nameConflict: string;
|
|
21
|
+
/** Shown when the submitted package exceeds the server's size limit (413). */
|
|
22
|
+
archiveTooLarge: string;
|
|
23
|
+
/** Shown when the backend is temporarily unavailable (503). */
|
|
24
|
+
serviceUnavailable: string;
|
|
25
|
+
/** Fallback shown for a 400 whose response body carries no message. */
|
|
26
|
+
pathInvalid: string;
|
|
27
|
+
/** Generic fallback shown for any other error status. */
|
|
28
|
+
saveError: string;
|
|
29
|
+
/** Notification title on a successful create. */
|
|
30
|
+
saveSuccessTitle: string;
|
|
31
|
+
/** Notification message on a successful create, given the created name. */
|
|
32
|
+
createSuccess: (name: string) => string;
|
|
33
|
+
/** Notification title on a successful update. */
|
|
34
|
+
updateSuccessTitle: string;
|
|
35
|
+
/** Notification message on a successful update, given the skill's name. */
|
|
36
|
+
updateSuccess: (name: string) => string;
|
|
37
|
+
/** Shown when a save hits a stale-ETag conflict (412) in edit mode. */
|
|
38
|
+
conflictMessage: string;
|
|
39
|
+
}
|
|
40
|
+
/** A host notification `useSkillEditorSubmit` asks to be shown. */
|
|
41
|
+
export interface SkillEditorSubmitNotification {
|
|
42
|
+
/** Notification style. */
|
|
43
|
+
variant: NotificationVariant;
|
|
44
|
+
/** Optional heading. */
|
|
45
|
+
title?: string;
|
|
46
|
+
/** Body text. */
|
|
47
|
+
message: string;
|
|
48
|
+
/** W3C trace ID, when the triggering error carried one. */
|
|
49
|
+
requestId?: string;
|
|
50
|
+
}
|
|
51
|
+
/** Parameters accepted by {@link useSkillEditorSubmit}. */
|
|
52
|
+
export interface UseSkillEditorSubmitParams {
|
|
53
|
+
/** DIAL Core bucket the skill is saved to. */
|
|
54
|
+
bucket: string | undefined;
|
|
55
|
+
/** Whether the form is editing an existing skill rather than creating a new one. */
|
|
56
|
+
isEditMode: boolean;
|
|
57
|
+
/** The editor's current supporting-file tree. */
|
|
58
|
+
files: SkillFileTreeNode[];
|
|
59
|
+
/** In-memory bytes for every supporting file, keyed by relative path. */
|
|
60
|
+
filesContentRef: React.MutableRefObject<Map<string, SkillFileContent>>;
|
|
61
|
+
/** The loaded (or imported) manifest's full parsed frontmatter. */
|
|
62
|
+
frontmatterRef: React.MutableRefObject<Record<string, unknown>>;
|
|
63
|
+
/** The path the currently loaded edit-mode state belongs to. */
|
|
64
|
+
loadedPathRef: React.MutableRefObject<string | undefined>;
|
|
65
|
+
/** The concurrency ETag from the load, sent back as `If-Match` on save. */
|
|
66
|
+
etagRef: React.MutableRefObject<string | undefined>;
|
|
67
|
+
/** Where to navigate on a successful save. */
|
|
68
|
+
returnUrl: string;
|
|
69
|
+
/** Refetches the host's skill listing after a successful save. */
|
|
70
|
+
refetchSkills: () => Promise<void>;
|
|
71
|
+
/** Already-configured create/update operations. */
|
|
72
|
+
client: SkillEditorSubmitClient;
|
|
73
|
+
/** Localized messages, resolved by the host. */
|
|
74
|
+
messages: SkillEditorSubmitMessages;
|
|
75
|
+
/** Called with `returnUrl` after a successful save. */
|
|
76
|
+
onNavigate: (url: string) => void;
|
|
77
|
+
/** Called to surface a host notification (success toast or unexpected-error toast). */
|
|
78
|
+
onNotify: (notification: SkillEditorSubmitNotification) => void;
|
|
79
|
+
}
|
|
80
|
+
/** Return value of {@link useSkillEditorSubmit}. */
|
|
81
|
+
export interface UseSkillEditorSubmitResult {
|
|
82
|
+
/** Current submit-phase. */
|
|
83
|
+
phase: SubmitPhase;
|
|
84
|
+
/** Inline field validation errors. */
|
|
85
|
+
errors: SkillEditorErrors;
|
|
86
|
+
/** General submit-time error, distinct from a stale-edit `conflict`. */
|
|
87
|
+
submitError: string | undefined;
|
|
88
|
+
/** Present when the last save hit a stale-ETag conflict. */
|
|
89
|
+
conflict: {
|
|
90
|
+
message: string;
|
|
91
|
+
} | undefined;
|
|
92
|
+
/** Clears `conflict`, e.g. once the host has reloaded the latest skill. */
|
|
93
|
+
clearConflict: () => void;
|
|
94
|
+
/** Validates and submits the given form values. */
|
|
95
|
+
handleSubmit: (values: SkillEditorValues) => Promise<void>;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Owns the Skill Editor's create/edit submission flow: field validation,
|
|
99
|
+
* building and (in edit mode) merging the `SKILL.md` manifest, calling
|
|
100
|
+
* `client.createSkill`/`client.updateSkill`, and mapping the resulting
|
|
101
|
+
* success/error/conflict outcomes to presentable state.
|
|
102
|
+
*/
|
|
103
|
+
export declare const useSkillEditorSubmit: ({ bucket, isEditMode, files, filesContentRef, frontmatterRef, loadedPathRef, etagRef, returnUrl, refetchSkills, client, messages, onNavigate, onNotify, }: UseSkillEditorSubmitParams) => UseSkillEditorSubmitResult;
|
|
104
|
+
export {};
|
|
105
|
+
//# sourceMappingURL=useSkillEditorSubmit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSkillEditorSubmit.d.ts","sourceRoot":"","sources":["../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mDAAmD;IACnD,MAAM,EAAE,uBAAuB,CAAC;IAChC,gDAAgD;IAChD,QAAQ,EAAE,yBAAyB,CAAC;IACpC,uDAAuD;IACvD,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,uFAAuF;IACvF,QAAQ,EAAE,CAAC,YAAY,EAAE,6BAA6B,KAAK,IAAI,CAAC;CACjE;AAED,oDAAoD;AACpD,MAAM,WAAW,0BAA0B;IACzC,4BAA4B;IAC5B,KAAK,EAAE,WAAW,CAAC;IACnB,sCAAsC;IACtC,MAAM,EAAE,iBAAiB,CAAC;IAC1B,wEAAwE;IACxE,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,4DAA4D;IAC5D,QAAQ,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC;IAC1C,2EAA2E;IAC3E,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,mDAAmD;IACnD,YAAY,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5D;AAED;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,GAAI,2JAclC,0BAA0B,KAAG,0BAoP/B,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { SkillEditorFileActions, SkillEditorValues, SkillFileTreeNode } from '@epam/ai-dial-skill-editor';
|
|
2
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
3
|
+
import { SkillFileBatchValidationMessages } from './skill-file-batch-validation';
|
|
4
|
+
import { SkillFileContent } from './skill-file-preview';
|
|
5
|
+
/** Localized messages `useSkillFileActions` needs beyond per-candidate batch validation. */
|
|
6
|
+
export interface SkillFileActionsMessages extends SkillFileBatchValidationMessages {
|
|
7
|
+
/** Returned as the commit error when an imported manifest's `name` doesn't match the skill being edited. */
|
|
8
|
+
manifestNameMismatch: string;
|
|
9
|
+
/** Returned as the commit error when the user declines the manifest-import confirmation. */
|
|
10
|
+
manifestImportDeclined: string;
|
|
11
|
+
/** Generic fallback commit error for a batch with invalid candidates but no specific batch error. */
|
|
12
|
+
saveError: string;
|
|
13
|
+
}
|
|
14
|
+
/** Parameters accepted by {@link useSkillFileActions}. */
|
|
15
|
+
export interface UseSkillFileActionsParams {
|
|
16
|
+
/** The editor's current supporting-file tree. */
|
|
17
|
+
files: SkillFileTreeNode[];
|
|
18
|
+
/** Updates `files`. */
|
|
19
|
+
setFiles: Dispatch<SetStateAction<SkillFileTreeNode[]>>;
|
|
20
|
+
/** In-memory bytes for every supporting file, keyed by relative path. */
|
|
21
|
+
filesContentRef: React.MutableRefObject<Map<string, SkillFileContent>>;
|
|
22
|
+
/** The loaded (or imported) manifest's full parsed frontmatter. */
|
|
23
|
+
frontmatterRef: React.MutableRefObject<Record<string, unknown>>;
|
|
24
|
+
/** The seeded baseline manifest values, used to approximate the projected total size. */
|
|
25
|
+
loadedValues: SkillEditorValues | undefined;
|
|
26
|
+
/** Updates `loadedValues` after a manifest import. */
|
|
27
|
+
setLoadedValues: Dispatch<SetStateAction<SkillEditorValues | undefined>>;
|
|
28
|
+
/** Whether the form is editing an existing skill rather than creating a new one. */
|
|
29
|
+
isEditMode: boolean;
|
|
30
|
+
/** Whether the form currently diverges from its seeded baseline. */
|
|
31
|
+
isDirty: boolean;
|
|
32
|
+
/** Updates the currently selected file-tree node path. */
|
|
33
|
+
setSelectedPath: Dispatch<SetStateAction<string>>;
|
|
34
|
+
/** Localized messages, resolved by the host. */
|
|
35
|
+
messages: SkillFileActionsMessages;
|
|
36
|
+
}
|
|
37
|
+
/** Return value of {@link useSkillFileActions}. */
|
|
38
|
+
export interface UseSkillFileActionsResult {
|
|
39
|
+
/** File-tree mutation operations, passed straight to `SkillEditor`'s `fileActions` prop. */
|
|
40
|
+
fileActions: SkillEditorFileActions;
|
|
41
|
+
/** Whether the "replace Skill metadata?" confirmation prompt should be shown. */
|
|
42
|
+
pendingManifestImport: boolean;
|
|
43
|
+
/** Resolves the in-flight manifest-import confirmation with the user's choice. */
|
|
44
|
+
resolveManifestImport: (accepted: boolean) => void;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Owns the Skill Editor's batch file upload workflow: validating a staged
|
|
48
|
+
* batch, committing it atomically (supporting files plus an optional
|
|
49
|
+
* `SKILL.md` manifest import, with a confirmation gate), and removing
|
|
50
|
+
* already-committed nodes.
|
|
51
|
+
*/
|
|
52
|
+
export declare const useSkillFileActions: ({ files, setFiles, filesContentRef, frontmatterRef, loadedValues, setLoadedValues, isEditMode, isDirty, setSelectedPath, messages, }: UseSkillFileActionsParams) => UseSkillFileActionsResult;
|
|
53
|
+
//# sourceMappingURL=useSkillFileActions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSkillFileActions.d.ts","sourceRoot":"","sources":["../../src/skill/useSkillFileActions.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EAEvB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAQtD,OAAO,EAEL,KAAK,gCAAgC,EACtC,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,4FAA4F;AAC5F,MAAM,WAAW,wBAAyB,SAAQ,gCAAgC;IAChF,4GAA4G;IAC5G,oBAAoB,EAAE,MAAM,CAAC;IAC7B,4FAA4F;IAC5F,sBAAsB,EAAE,MAAM,CAAC;IAC/B,qGAAqG;IACrG,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,0DAA0D;AAC1D,MAAM,WAAW,yBAAyB;IACxC,iDAAiD;IACjD,KAAK,EAAE,iBAAiB,EAAE,CAAC;IAC3B,uBAAuB;IACvB,QAAQ,EAAE,QAAQ,CAAC,cAAc,CAAC,iBAAiB,EAAE,CAAC,CAAC,CAAC;IACxD,yEAAyE;IACzE,eAAe,EAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAAC;IACvE,mEAAmE;IACnE,cAAc,EAAE,KAAK,CAAC,gBAAgB,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAChE,yFAAyF;IACzF,YAAY,EAAE,iBAAiB,GAAG,SAAS,CAAC;IAC5C,sDAAsD;IACtD,eAAe,EAAE,QAAQ,CAAC,cAAc,CAAC,iBAAiB,GAAG,SAAS,CAAC,CAAC,CAAC;IACzE,oFAAoF;IACpF,UAAU,EAAE,OAAO,CAAC;IACpB,oEAAoE;IACpE,OAAO,EAAE,OAAO,CAAC;IACjB,0DAA0D;IAC1D,eAAe,EAAE,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;IAClD,gDAAgD;IAChD,QAAQ,EAAE,wBAAwB,CAAC;CACpC;AAED,mDAAmD;AACnD,MAAM,WAAW,yBAAyB;IACxC,4FAA4F;IAC5F,WAAW,EAAE,sBAAsB,CAAC;IACpC,iFAAiF;IACjF,qBAAqB,EAAE,OAAO,CAAC;IAC/B,kFAAkF;IAClF,qBAAqB,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;CACpD;AAED;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAAI,sIAWjC,yBAAyB,KAAG,yBAsL9B,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { SkillCatalogListResponseDto, SkillMetadataItemDto } from '@epam/ai-dial-chat-api-client';
|
|
2
|
+
/** Parameters for {@link useSkillsState}. */
|
|
3
|
+
export interface UseSkillsStateParams {
|
|
4
|
+
/** Fetches the aggregate skill listing from the server. */
|
|
5
|
+
listSkills: () => Promise<SkillCatalogListResponseDto>;
|
|
6
|
+
/** Whether the Skills feature is enabled in the current overlay/tenant config. */
|
|
7
|
+
enabled: boolean;
|
|
8
|
+
/** Whether the user session is ready for API calls (auth has settled). */
|
|
9
|
+
ready: boolean;
|
|
10
|
+
}
|
|
11
|
+
/** Result returned by {@link useSkillsState}. */
|
|
12
|
+
export interface UseSkillsStateResult {
|
|
13
|
+
/** Skills in the caller's own bucket. */
|
|
14
|
+
skills: SkillMetadataItemDto[];
|
|
15
|
+
/** Skills in the organisation bucket. */
|
|
16
|
+
publicSkills: SkillMetadataItemDto[];
|
|
17
|
+
/** Skills other users shared with the caller. */
|
|
18
|
+
sharedWithMe: SkillMetadataItemDto[];
|
|
19
|
+
/** True until the aggregate listing has settled. */
|
|
20
|
+
isLoading: boolean;
|
|
21
|
+
/** Rejection reason of the most recent failed listing, or `null`. */
|
|
22
|
+
error: unknown;
|
|
23
|
+
/** Re-reads personal, shared, and organisation skills. */
|
|
24
|
+
refetch: () => Promise<void>;
|
|
25
|
+
/** Upserts a single skill into the shared-with-me list by URL identity. */
|
|
26
|
+
mergeSharedSkill: (item: SkillMetadataItemDto) => void;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Fetches all skill namespaces with a gated single request: clears state
|
|
30
|
+
* immediately when `enabled` is false, defers the fetch until `ready` is true,
|
|
31
|
+
* and exposes `refetch` / `mergeSharedSkill` for manual updates.
|
|
32
|
+
* Does not import any feature-flag hook, auth enum, or app context.
|
|
33
|
+
*/
|
|
34
|
+
export declare const useSkillsState: ({ listSkills, enabled, ready, }: UseSkillsStateParams) => UseSkillsStateResult;
|
|
35
|
+
//# sourceMappingURL=useSkillsState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSkillsState.d.ts","sourceRoot":"","sources":["../../../src/skill/useSkillsState/useSkillsState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,2BAA2B,EAC3B,oBAAoB,EACrB,MAAM,+BAA+B,CAAC;AAGvC,6CAA6C;AAC7C,MAAM,WAAW,oBAAoB;IACnC,2DAA2D;IAC3D,UAAU,EAAE,MAAM,OAAO,CAAC,2BAA2B,CAAC,CAAC;IACvD,kFAAkF;IAClF,OAAO,EAAE,OAAO,CAAC;IACjB,0EAA0E;IAC1E,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,iDAAiD;AACjD,MAAM,WAAW,oBAAoB;IACnC,yCAAyC;IACzC,MAAM,EAAE,oBAAoB,EAAE,CAAC;IAC/B,yCAAyC;IACzC,YAAY,EAAE,oBAAoB,EAAE,CAAC;IACrC,iDAAiD;IACjD,YAAY,EAAE,oBAAoB,EAAE,CAAC;IACrC,oDAAoD;IACpD,SAAS,EAAE,OAAO,CAAC;IACnB,qEAAqE;IACrE,KAAK,EAAE,OAAO,CAAC;IACf,0DAA0D;IAC1D,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,2EAA2E;IAC3E,gBAAgB,EAAE,CAAC,IAAI,EAAE,oBAAoB,KAAK,IAAI,CAAC;CACxD;AAED;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,iCAI5B,oBAAoB,KAAG,oBAqFzB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { UserLimitStatsResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
2
|
+
/** Return shape of {@link useUsageData}. */
|
|
3
|
+
export interface UseUsageDataResult {
|
|
4
|
+
/** Rolling usage and rate-limit stats for every deployment the caller has used in the trailing 30 days, plus the caller's global cost budget. */
|
|
5
|
+
usage: UserLimitStatsResponseDto | undefined;
|
|
6
|
+
/** `true` while the fetch is in flight. */
|
|
7
|
+
isLoading: boolean;
|
|
8
|
+
/** Set when the `getUserUsage` call rejects. */
|
|
9
|
+
usageError: Error | undefined;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Fetches usage stats via the provided `getUserUsage` function on mount.
|
|
13
|
+
*
|
|
14
|
+
* `enabled` (default `true`) lets callers behind a feature flag skip the fetch
|
|
15
|
+
* entirely. The hook accepts the fetch function as a parameter so the caller
|
|
16
|
+
* supplies an already-configured API client — the hook never constructs or
|
|
17
|
+
* imports one itself.
|
|
18
|
+
*/
|
|
19
|
+
export declare const useUsageData: (getUserUsage: () => Promise<UserLimitStatsResponseDto>, enabled?: boolean) => UseUsageDataResult;
|
|
20
|
+
//# sourceMappingURL=useUsageData.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUsageData.d.ts","sourceRoot":"","sources":["../../../src/usage/useUsageData/useUsageData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAG/E,4CAA4C;AAC5C,MAAM,WAAW,kBAAkB;IACjC,iJAAiJ;IACjJ,KAAK,EAAE,yBAAyB,GAAG,SAAS,CAAC;IAC7C,2CAA2C;IAC3C,SAAS,EAAE,OAAO,CAAC;IACnB,gDAAgD;IAChD,UAAU,EAAE,KAAK,GAAG,SAAS,CAAC;CAC/B;AAKD;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,GACvB,cAAc,MAAM,OAAO,CAAC,yBAAyB,CAAC,EACtD,iBAAc,KACb,kBAmCF,CAAC"}
|
|
@@ -1,26 +1,17 @@
|
|
|
1
1
|
import { DeploymentConfigurationSchema, ToolMenuItem } from '@epam/ai-dial-chat-shared';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
/** Translatable strings the tools menu surfaces. */
|
|
4
|
-
export interface ToolsMenuLabels {
|
|
5
|
-
/** Fallback label for the deep-research tool when the schema defines no `title`. */
|
|
6
|
-
deepResearchFallback: string;
|
|
7
|
-
}
|
|
8
3
|
/** Host-supplied inputs to {@link useToolsMenu}. */
|
|
9
4
|
export interface UseToolsMenuParams {
|
|
10
|
-
/** Operator-configured deep-research tool id, or `null` when none is configured. */
|
|
11
|
-
deepResearchToolId: string | null;
|
|
12
5
|
/** Id of the currently selected deployment, or `null` when none is selected. */
|
|
13
6
|
selectedItemId: string | null;
|
|
14
7
|
/** JSON-schema configuration for the selected deployment, or `null` when none. */
|
|
15
8
|
selectedDeploymentConfiguration: DeploymentConfigurationSchema | null;
|
|
16
|
-
/**
|
|
17
|
-
labels?: Partial<ToolsMenuLabels>;
|
|
18
|
-
/** Icon element rendered on the tool menu item. Defaults to `null`. */
|
|
9
|
+
/** Icon element rendered on every tool menu item. Defaults to `null`. */
|
|
19
10
|
toolIcon?: ReactNode;
|
|
20
11
|
}
|
|
21
12
|
/** Result returned by {@link useToolsMenu}. */
|
|
22
13
|
export type UseToolsMenuResult = {
|
|
23
|
-
/**
|
|
14
|
+
/** One item per boolean property of the deployment configuration schema, in schema order. */
|
|
24
15
|
toolsMenuItems: ToolMenuItem[];
|
|
25
16
|
/** Toggles the tool with the given id; ignores unknown ids. */
|
|
26
17
|
onToolToggle: (id: string) => void;
|
|
@@ -30,11 +21,11 @@ export type UseToolsMenuResult = {
|
|
|
30
21
|
restoreToolConfiguration: (configurationValue: Record<string, unknown> | undefined) => void;
|
|
31
22
|
};
|
|
32
23
|
/**
|
|
33
|
-
* Derives the tools submenu from the active deployment's configuration schema
|
|
34
|
-
*
|
|
35
|
-
* deployment change, and exposes a stable `toolConfigurationValue` record for
|
|
36
|
-
* inclusion in completion requests. Headless:
|
|
37
|
-
*
|
|
24
|
+
* Derives the tools submenu from the active deployment's configuration schema:
|
|
25
|
+
* every boolean property becomes a toggle. Manages toggle state locally, resets
|
|
26
|
+
* on deployment change, and exposes a stable `toolConfigurationValue` record for
|
|
27
|
+
* inclusion in completion requests. Headless: the tool icon is the host's
|
|
28
|
+
* responsibility, supplied via `toolIcon`.
|
|
38
29
|
*/
|
|
39
30
|
export declare const useToolsMenu: (params: UseToolsMenuParams) => UseToolsMenuResult;
|
|
40
31
|
//# sourceMappingURL=useToolsMenu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useToolsMenu.d.ts","sourceRoot":"","sources":["../../src/useToolsMenu/useToolsMenu.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,6BAA6B,
|
|
1
|
+
{"version":3,"file":"useToolsMenu.d.ts","sourceRoot":"","sources":["../../src/useToolsMenu/useToolsMenu.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,6BAA6B,EAE7B,YAAY,EACb,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AAEf,oDAAoD;AACpD,MAAM,WAAW,kBAAkB;IACjC,gFAAgF;IAChF,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,kFAAkF;IAClF,+BAA+B,EAAE,6BAA6B,GAAG,IAAI,CAAC;IACtE,yEAAyE;IACzE,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,+CAA+C;AAC/C,MAAM,MAAM,kBAAkB,GAAG;IAC/B,6FAA6F;IAC7F,cAAc,EAAE,YAAY,EAAE,CAAC;IAC/B,+DAA+D;IAC/D,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,wFAAwF;IACxF,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChD,wEAAwE;IACxE,wBAAwB,EAAE,CACxB,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,KACpD,IAAI,CAAC;CACX,CAAC;AAuCF;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,GACvB,QAAQ,kBAAkB,KACzB,kBAuFF,CAAC"}
|
package/files/string-utils.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"string-utils.d.ts","sourceRoot":"","sources":["../../src/files/string-utils.ts"],"names":[],"mappings":"AAOA,2FAA2F;AAC3F,eAAO,MAAM,aAAa,GAAI,MAAM,MAAM,KAAG,MAM5C,CAAC"}
|