@epam/ai-dial-chat-shared 1.1.0-dev.178 → 1.1.0-dev.179
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/components/MarkdownWithPlaceholders/MarkdownWithPlaceholders.d.ts +15 -0
- package/components/MarkdownWithPlaceholders/MarkdownWithPlaceholders.d.ts.map +1 -0
- package/index.d.ts +2 -0
- package/index.d.ts.map +1 -1
- package/index.js +2934 -2885
- package/package.json +1 -1
- package/utils/prompt-variables.d.ts +38 -0
- package/utils/prompt-variables.d.ts.map +1 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epam/ai-dial-chat-shared",
|
|
3
3
|
"description": "Shared domain models, utilities, and UI components for AI DIAL Chat libraries",
|
|
4
|
-
"version": "1.1.0-dev.
|
|
4
|
+
"version": "1.1.0-dev.179",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Matches a `{{name}}` placeholder. The inner run excludes braces so a stray
|
|
3
|
+
* `{{` cannot swallow the rest of the document, and it must be non-empty so a
|
|
4
|
+
* literal `{{}}` stays plain text.
|
|
5
|
+
*/
|
|
6
|
+
export declare const PROMPT_PARAM_PATTERN: RegExp;
|
|
7
|
+
/** Class applied to each highlighted placeholder. The host owns its styling. */
|
|
8
|
+
export declare const PROMPT_VARIABLE_CLASS_NAME = "cat-prompt-variable";
|
|
9
|
+
/** Minimal hast shapes this plugin reads and writes. */
|
|
10
|
+
interface HastNode {
|
|
11
|
+
type: string;
|
|
12
|
+
tagName?: string;
|
|
13
|
+
value?: string;
|
|
14
|
+
properties?: Record<string, unknown>;
|
|
15
|
+
children?: HastNode[];
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Rehype plugin that wraps every `{{name}}` placeholder in a span so it can be
|
|
19
|
+
* styled apart from the surrounding prose. Placeholders inside code are left
|
|
20
|
+
* alone.
|
|
21
|
+
*
|
|
22
|
+
* The spans are built as hast nodes rather than injected as raw HTML, so a
|
|
23
|
+
* placeholder that contains markup cannot escape into the document.
|
|
24
|
+
*/
|
|
25
|
+
export declare const rehypePromptVariables: () => (tree: HastNode) => void;
|
|
26
|
+
/**
|
|
27
|
+
* Returns the distinct `{{param}}` names found in `content`, in first-occurrence
|
|
28
|
+
* order. Single-brace sequences (e.g. `{name}`) are not parameters.
|
|
29
|
+
*/
|
|
30
|
+
export declare const extractPromptParams: (content: string) => string[];
|
|
31
|
+
/**
|
|
32
|
+
* Replaces every `{{param}}` occurrence in `content` with the matching entry
|
|
33
|
+
* in `values` (keyed by parameter name). A token whose name is missing from
|
|
34
|
+
* `values` is left unchanged.
|
|
35
|
+
*/
|
|
36
|
+
export declare const resolvePromptParams: (content: string, values: Record<string, string>) => string;
|
|
37
|
+
export {};
|
|
38
|
+
//# sourceMappingURL=prompt-variables.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-variables.d.ts","sourceRoot":"","sources":["../../src/utils/prompt-variables.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,QAAsB,CAAC;AAExD,gFAAgF;AAChF,eAAO,MAAM,0BAA0B,wBAAwB,CAAC;AAEhE,wDAAwD;AACxD,UAAU,QAAQ;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC;CACvB;AAoDD;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,SAAU,MAAM,QAAQ,SAEzD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,GAAI,SAAS,MAAM,KAAG,MAAM,EAW3D,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAC9B,SAAS,MAAM,EACf,QAAQ,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAC7B,MAC4E,CAAC"}
|