@opencxh/domain 1.235.0 → 1.238.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.
- package/dist/entities/company/types.d.ts +2 -0
- package/dist/entities/contact/types.d.ts +8 -0
- package/dist/entities/document-template/index.d.ts +3 -0
- package/dist/entities/document-template/locale.d.ts +38 -0
- package/dist/entities/document-template/tokens.d.ts +39 -0
- package/dist/entities/document-template/tokens.test.d.ts +1 -0
- package/dist/entities/document-template/types.d.ts +87 -0
- package/dist/entities/kb/locales.d.ts +6 -32
- package/dist/entities/kb/types.d.ts +9 -0
- package/dist/entities/organization/types.d.ts +8 -0
- package/dist/index.cjs +21 -14
- package/dist/index.d.ts +4 -0
- package/dist/index.js +1626 -1392
- package/dist/platform/document-parse.d.ts +2 -0
- package/dist/platform/document-text.d.ts +14 -0
- package/dist/platform/document-text.test.d.ts +1 -0
- package/dist/platform/locales.d.ts +38 -0
- package/dist/platform/locales.test.d.ts +1 -0
- package/package.json +1 -1
- /package/dist/entities/{kb/locales.test.d.ts → document-template/locale.test.d.ts} +0 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DocumentBlock } from './document-blocks';
|
|
2
|
+
/**
|
|
3
|
+
* The document as plain text: what an embedding and a keyword search should see.
|
|
4
|
+
*
|
|
5
|
+
* Markdown and plain text are not the same job. `**Yealink**` embeds as three tokens where two of
|
|
6
|
+
* them are punctuation, a table's pipes are noise in a cosine, and a search for "reset" should
|
|
7
|
+
* match `## Reset` without the reader having typed a hash. So this strips the markers markdown put
|
|
8
|
+
* there and keeps the words they wrapped.
|
|
9
|
+
*
|
|
10
|
+
* Built on top of {@link documentToMarkdown} rather than beside it: one place decides what a block
|
|
11
|
+
* says and in which order, and a second walk over the union would drift from it on the first new
|
|
12
|
+
* block type.
|
|
13
|
+
*/
|
|
14
|
+
export declare function documentToText(blocks: DocumentBlock[], title?: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { KbLocale } from '../entities/kb/types';
|
|
2
|
+
/**
|
|
3
|
+
* Languages this platform can write in.
|
|
4
|
+
*
|
|
5
|
+
* Deliberately **not** the shell's UI locale list. That one is a hardcoded
|
|
6
|
+
* `['nl','en']` in `LocalizationManager`, and a customer publishing a German
|
|
7
|
+
* help centre has nothing to do with which language our own buttons are in.
|
|
8
|
+
*
|
|
9
|
+
* The labels are endonyms — a language names itself the same way whoever reads
|
|
10
|
+
* the picker. So this is a fixed map on purpose, and not the "never freeze
|
|
11
|
+
* labels at module load" case the design system warns about.
|
|
12
|
+
*
|
|
13
|
+
* In domain rather than in an app because several ends need the same answer: the language picker
|
|
14
|
+
* in the article editor, the writing assistant's system prompt, and — since documents grew a
|
|
15
|
+
* recipient language — the contact and company forms in `apps/crm`. Two copies would drift, and
|
|
16
|
+
* the way you would find out is a letter coming back in the wrong language.
|
|
17
|
+
*
|
|
18
|
+
* It lived in `entities/kb/` while the knowledge base was the only caller. The old names still
|
|
19
|
+
* work: `entities/kb/locales.ts` re-exports them.
|
|
20
|
+
*/
|
|
21
|
+
export interface LocaleOption {
|
|
22
|
+
code: KbLocale;
|
|
23
|
+
/** The language's own name, for a picker. */
|
|
24
|
+
label: string;
|
|
25
|
+
/** Its English name, for telling a model which language to write in. */
|
|
26
|
+
english: string;
|
|
27
|
+
}
|
|
28
|
+
export declare const LOCALES: LocaleOption[];
|
|
29
|
+
/** The language's own name, or the bare code for one we do not list. */
|
|
30
|
+
export declare function localeName(code: string): string;
|
|
31
|
+
/**
|
|
32
|
+
* How to name this language to a model.
|
|
33
|
+
*
|
|
34
|
+
* A bare BCP-47 tag is a weak instruction — `"nl"` inside an otherwise English
|
|
35
|
+
* prompt is not enough to stop a model answering in English. Both names plus
|
|
36
|
+
* the tag leaves nothing to infer.
|
|
37
|
+
*/
|
|
38
|
+
export declare function localeInstruction(code: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
File without changes
|