@epam/ai-dial-skills 1.2.0-dev.99 → 1.2.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/components/ChatSkill/ChatSkill.d.ts +3 -2
  2. package/components/ChatSkill/ChatSkill.d.ts.map +1 -1
  3. package/components/FavoriteSkillsPanel/FavoriteSkillsPanel.d.ts.map +1 -1
  4. package/components/SkillArchiveUploadDialog/SkillArchiveUploadDialog.d.ts.map +1 -1
  5. package/components/SkillContentFileTree/SkillContentFileTree.d.ts +11 -0
  6. package/components/SkillContentFileTree/SkillContentFileTree.d.ts.map +1 -0
  7. package/components/SkillDetailsSidePanel/SkillDetailsSidePanel.d.ts +2 -1
  8. package/components/SkillDetailsSidePanel/SkillDetailsSidePanel.d.ts.map +1 -1
  9. package/components/SkillInfoTooltipContent/SkillInfoTooltipContent.d.ts +1 -1
  10. package/components/SkillInfoTooltipContent/SkillInfoTooltipContent.d.ts.map +1 -1
  11. package/components/SkillSelectorField/SkillSelectorField.d.ts +5 -0
  12. package/components/SkillSelectorField/SkillSelectorField.d.ts.map +1 -0
  13. package/constants/public-class-names.d.ts +6 -5
  14. package/constants/public-class-names.d.ts.map +1 -1
  15. package/hooks/useSkillMentions/useSkillMentions.d.ts +52 -0
  16. package/hooks/useSkillMentions/useSkillMentions.d.ts.map +1 -0
  17. package/hooks/useSkillSelectorOverlay/useSkillSelectorOverlay.d.ts +5 -4
  18. package/hooks/useSkillSelectorOverlay/useSkillSelectorOverlay.d.ts.map +1 -1
  19. package/index.css +2 -2
  20. package/index.d.ts +13 -1
  21. package/index.d.ts.map +1 -1
  22. package/index.js +630 -270
  23. package/models/chat-skill-props.d.ts +30 -1
  24. package/models/chat-skill-props.d.ts.map +1 -1
  25. package/models/favorite-skill-item.d.ts +1 -1
  26. package/models/favorite-skill-item.d.ts.map +1 -1
  27. package/models/favorite-skills-panel-props.d.ts +32 -5
  28. package/models/favorite-skills-panel-props.d.ts.map +1 -1
  29. package/models/skill-archive-upload-dialog-props.d.ts +5 -1
  30. package/models/skill-archive-upload-dialog-props.d.ts.map +1 -1
  31. package/models/skill-info-tooltip-content-props.d.ts +19 -0
  32. package/models/skill-info-tooltip-content-props.d.ts.map +1 -1
  33. package/models/skill-mention-anchor.d.ts +12 -0
  34. package/models/skill-mention-anchor.d.ts.map +1 -0
  35. package/models/skill-selector-field-props.d.ts +72 -0
  36. package/models/skill-selector-field-props.d.ts.map +1 -0
  37. package/models/skill-selector-overlay.d.ts +144 -55
  38. package/models/skill-selector-overlay.d.ts.map +1 -1
  39. package/package.json +6 -5
  40. package/test-setup.d.ts +1 -0
  41. package/types/skill-unresolved-reason.d.ts +8 -0
  42. package/types/skill-unresolved-reason.d.ts.map +1 -0
  43. package/utils/catalog-content-dial-files.d.ts +10 -0
  44. package/utils/catalog-content-dial-files.d.ts.map +1 -0
  45. package/utils/skill-mention-matching.d.ts +25 -0
  46. package/utils/skill-mention-matching.d.ts.map +1 -0
  47. package/utils/skill-mention-tracking.d.ts +51 -0
  48. package/utils/skill-mention-tracking.d.ts.map +1 -0
  49. package/utils/skill-url.d.ts +1 -0
  50. package/utils/skill-url.d.ts.map +1 -1
package/test-setup.d.ts CHANGED
@@ -1 +1,2 @@
1
+ export {};
1
2
  //# sourceMappingURL=test-setup.d.ts.map
@@ -0,0 +1,8 @@
1
+ /** Why a skill's url resolved to no loaded listing entry. */
2
+ export declare enum SkillUnresolvedReason {
3
+ /** The url's bucket is the viewer's own bucket. The viewer's own skill no longer exists. */
4
+ Deleted = "deleted",
5
+ /** The url's bucket belongs to someone else. A personal skill never shared with the viewer (or since unshared/deleted). */
6
+ NotShared = "not-shared"
7
+ }
8
+ //# sourceMappingURL=skill-unresolved-reason.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skill-unresolved-reason.d.ts","sourceRoot":"","sources":["../../src/types/skill-unresolved-reason.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,oBAAY,qBAAqB;IAC/B,4FAA4F;IAC5F,OAAO,YAAY;IACnB,2HAA2H;IAC3H,SAAS,eAAe;CACzB"}
@@ -0,0 +1,10 @@
1
+ import { CatalogContentTreeNode } from '@epam/ai-dial-catalog';
2
+ import { DialFile } from '@epam/ai-dial-react-file-manager';
3
+ /**
4
+ * Maps the details panel's `CatalogContentTreeNode[]` onto the nested
5
+ * `DialFile[]` `DialFoldersTree` renders. A node's opaque `id` becomes the
6
+ * file's `path`, so the tree's `selectedPath` / `expandedPaths` /
7
+ * `onItemClick` speak the panel's ids unchanged — nothing is parsed.
8
+ */
9
+ export declare const mapCatalogContentTreeToDialFiles: (nodes: CatalogContentTreeNode[], parentPath?: string | null) => DialFile[];
10
+ //# sourceMappingURL=catalog-content-dial-files.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog-content-dial-files.d.ts","sourceRoot":"","sources":["../../src/utils/catalog-content-dial-files.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAEpE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAEjE;;;;;GAKG;AACH,eAAO,MAAM,gCAAgC,GAC3C,OAAO,sBAAsB,EAAE,EAC/B,aAAY,MAAM,GAAG,IAAW,KAC/B,QAAQ,EAkBR,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { RequestSkill } from '@epam/ai-dial-chat-shared';
2
+ /** One resolved mention location, or omitted for a skill whose text mention could not be found. */
3
+ export interface ResolvedSkillMention {
4
+ /** Index into the input `skills` array this location resolves. */
5
+ skillIndex: number;
6
+ /** Character offset of the leading `/` in `text`. */
7
+ start: number;
8
+ /** Length of the matched `/{name}` run. */
9
+ length: number;
10
+ }
11
+ /**
12
+ * Matches each entry of `skills` (in array order) to the next available
13
+ * `/{name}` occurrence in `text`, where `name` is that entry's display name
14
+ * resolved via `resolveName(url)` — the current listing name, falling back to
15
+ * the url's last path segment (`getSkillFallbackName`). Scans left to right,
16
+ * consuming text as it goes, so two skills with the same resolved name are
17
+ * still matched to distinct, successive occurrences in the text. A skill
18
+ * whose exact `/{name}` cannot be found at or after the current scan position
19
+ * (e.g. the user's later edit broke the mention) is omitted from the result —
20
+ * it still counts as a real `custom_content.skills` entry for sending, it
21
+ * simply renders nowhere in particular, and later entries still get their own
22
+ * independent forward search from the same unmoved cursor.
23
+ */
24
+ export declare const matchSkillMentions: (text: string, skills: RequestSkill[], resolveName: (url: string) => string) => ResolvedSkillMention[];
25
+ //# sourceMappingURL=skill-mention-matching.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skill-mention-matching.d.ts","sourceRoot":"","sources":["../../src/utils/skill-mention-matching.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D,mGAAmG;AACnG,MAAM,WAAW,oBAAoB;IACnC,kEAAkE;IAClE,UAAU,EAAE,MAAM,CAAC;IACnB,qDAAqD;IACrD,KAAK,EAAE,MAAM,CAAC;IACd,2CAA2C;IAC3C,MAAM,EAAE,MAAM,CAAC;CAChB;AAKD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,kBAAkB,GAC7B,MAAM,MAAM,EACZ,QAAQ,YAAY,EAAE,EACtB,aAAa,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,KACnC,oBAAoB,EA0BtB,CAAC"}
@@ -0,0 +1,51 @@
1
+ import { SkillMentionAnchor } from '../models/skill-mention-anchor';
2
+ /** A single-region text edit, expressed as the replaced range in the previous string. */
3
+ export interface TextChange {
4
+ /** Character offset where the previous and next strings first diverge. */
5
+ start: number;
6
+ /** Number of characters removed from the previous string at `start`. */
7
+ deletedLength: number;
8
+ /** Number of characters inserted at `start` in the next string. */
9
+ insertedLength: number;
10
+ }
11
+ /**
12
+ * Diffs two strings produced by a single-cursor edit (typing, deleting,
13
+ * pasting, cutting, undo/redo) via their common prefix and common suffix —
14
+ * cheap (O(n)) and exact for that class of edit, which is everything a
15
+ * textarea actually produces.
16
+ */
17
+ export declare const diffTextChange: (previous: string, next: string) => TextChange;
18
+ /**
19
+ * Applies a text change to a set of tracked mention anchors: an anchor
20
+ * entirely before the edited region is untouched, one entirely after is
21
+ * shifted by the edit's length delta, and one that overlaps the edited region
22
+ * is dropped — the user edited into the middle of a mention, so it reverts to
23
+ * plain text and no longer contributes a `custom_content.skills` entry.
24
+ */
25
+ export declare const reconcileAnchors: (anchors: SkillMentionAnchor[], change: TextChange) => SkillMentionAnchor[];
26
+ /**
27
+ * Inserts a new mention anchor at `atIndex` and shifts every anchor at or
28
+ * after that index by the inserted `/{name}` run's length — plus one more
29
+ * when `hasTrailingSpace` — keeping the result ordered by `start`
30
+ * (left-to-right reading order).
31
+ */
32
+ export declare const insertAnchor: (anchors: SkillMentionAnchor[], atIndex: number, url: string, name: string, hasTrailingSpace: boolean) => SkillMentionAnchor[];
33
+ /**
34
+ * Finds the anchor whose mention run ends exactly at `caretPosition` — the
35
+ * caret sitting immediately after that mention — or `undefined` if none does.
36
+ * Used to detect the whole-mention Backspace gesture.
37
+ */
38
+ export declare const findMentionAtCaret: (anchors: SkillMentionAnchor[], caretPosition: number) => SkillMentionAnchor | undefined;
39
+ /**
40
+ * The contiguous non-whitespace run touching `caretPosition` in `text`, when
41
+ * it is shaped like an as-yet-unselected slash query: starts with `prefix`
42
+ * and contains no second occurrence of it. `undefined` when the run at the
43
+ * caret isn't shaped that way. Mirrors the word shape the slash command menu
44
+ * opens for, so the Add-menu's own selection path can detect and consume the
45
+ * same typed `/query` text.
46
+ */
47
+ export declare const findSlashQueryAtCaret: (text: string, caretPosition: number, prefix: string) => {
48
+ start: number;
49
+ end: number;
50
+ } | undefined;
51
+ //# sourceMappingURL=skill-mention-tracking.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skill-mention-tracking.d.ts","sourceRoot":"","sources":["../../src/utils/skill-mention-tracking.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEzE,yFAAyF;AACzF,MAAM,WAAW,UAAU;IACzB,0EAA0E;IAC1E,KAAK,EAAE,MAAM,CAAC;IACd,wEAAwE;IACxE,aAAa,EAAE,MAAM,CAAC;IACtB,mEAAmE;IACnE,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,UAAU,MAAM,EAAE,MAAM,MAAM,KAAG,UAyB/D,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,GAC3B,SAAS,kBAAkB,EAAE,EAC7B,QAAQ,UAAU,KACjB,kBAAkB,EAmBpB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,YAAY,GACvB,SAAS,kBAAkB,EAAE,EAC7B,SAAS,MAAM,EACf,KAAK,MAAM,EACX,MAAM,MAAM,EACZ,kBAAkB,OAAO,KACxB,kBAAkB,EAkBpB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAC7B,SAAS,kBAAkB,EAAE,EAC7B,eAAe,MAAM,KACpB,kBAAkB,GAAG,SACkD,CAAC;AAE3E;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,GAChC,MAAM,MAAM,EACZ,eAAe,MAAM,EACrB,QAAQ,MAAM,KACb;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG,SAgBnC,CAAC"}
@@ -1,2 +1,3 @@
1
1
  export declare const getSkillFallbackName: (url: string) => string;
2
+ export declare const getSkillUrlBucket: (url: string) => string | null;
2
3
  //# sourceMappingURL=skill-url.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"skill-url.d.ts","sourceRoot":"","sources":["../../src/utils/skill-url.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,oBAAoB,GAAI,KAAK,MAAM,KAAG,MAGlD,CAAC"}
1
+ {"version":3,"file":"skill-url.d.ts","sourceRoot":"","sources":["../../src/utils/skill-url.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,oBAAoB,GAAI,KAAK,MAAM,KAAG,MAGlD,CAAC;AAUF,eAAO,MAAM,iBAAiB,GAAI,KAAK,MAAM,KAAG,MAAM,GAAG,IAIxD,CAAC"}