@promptbook/remote-server 0.43.0 → 0.44.0-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/esm/index.es.js +1 -1
- package/esm/typings/_packages/utils.index.d.ts +19 -1
- package/esm/typings/utils/normalization/DIACRITIC_VARIANTS_LETTERS.d.ts +10 -0
- package/esm/typings/utils/normalization/IKeywords.d.ts +18 -0
- package/esm/typings/utils/normalization/capitalize.d.ts +5 -0
- package/esm/typings/utils/normalization/capitalize.test.d.ts +1 -0
- package/esm/typings/utils/normalization/decapitalize.d.ts +5 -0
- package/esm/typings/utils/normalization/decapitalize.test.d.ts +1 -0
- package/esm/typings/utils/normalization/isValidKeyword.d.ts +8 -0
- package/esm/typings/utils/normalization/isValidKeyword.test.d.ts +1 -0
- package/esm/typings/utils/normalization/nameToUriPart.d.ts +1 -0
- package/esm/typings/utils/normalization/nameToUriPart.test.d.ts +1 -0
- package/esm/typings/utils/normalization/nameToUriParts.d.ts +1 -0
- package/esm/typings/utils/normalization/nameToUriParts.test.d.ts +1 -0
- package/esm/typings/utils/normalization/normalize-to-kebab-case.d.ts +1 -0
- package/esm/typings/utils/normalization/normalize-to-kebab-case.test.d.ts +1 -0
- package/esm/typings/utils/normalization/normalizeTo_PascalCase.d.ts +1 -0
- package/esm/typings/utils/normalization/normalizeTo_PascalCase.test.d.ts +1 -0
- package/esm/typings/utils/normalization/normalizeTo_SCREAMING_CASE.d.ts +4 -0
- package/esm/typings/utils/normalization/normalizeTo_SCREAMING_CASE.test.d.ts +1 -0
- package/esm/typings/utils/normalization/normalizeTo_camelCase.d.ts +4 -0
- package/esm/typings/utils/normalization/normalizeTo_camelCase.test.d.ts +1 -0
- package/esm/typings/utils/normalization/normalizeTo_snake_case.d.ts +1 -0
- package/esm/typings/utils/normalization/normalizeTo_snake_case.test.d.ts +1 -0
- package/esm/typings/utils/normalization/normalizeWhitespaces.d.ts +4 -0
- package/esm/typings/utils/normalization/normalizeWhitespaces.test.d.ts +1 -0
- package/esm/typings/utils/normalization/parseKeywords.d.ts +14 -0
- package/esm/typings/utils/normalization/parseKeywords.test.d.ts +1 -0
- package/esm/typings/utils/normalization/parseKeywordsFromString.d.ts +8 -0
- package/esm/typings/utils/normalization/parseKeywordsFromString.test.d.ts +1 -0
- package/esm/typings/utils/normalization/removeDiacritics.d.ts +4 -0
- package/esm/typings/utils/normalization/removeDiacritics.test.d.ts +1 -0
- package/esm/typings/utils/normalization/searchKeywords.d.ts +5 -0
- package/esm/typings/utils/normalization/searchKeywords.test.d.ts +1 -0
- package/package.json +2 -2
- package/umd/index.umd.js +1 -1
- package/umd/typings/_packages/utils.index.d.ts +19 -1
- package/umd/typings/utils/normalization/DIACRITIC_VARIANTS_LETTERS.d.ts +10 -0
- package/umd/typings/utils/normalization/IKeywords.d.ts +18 -0
- package/umd/typings/utils/normalization/capitalize.d.ts +5 -0
- package/umd/typings/utils/normalization/capitalize.test.d.ts +1 -0
- package/umd/typings/utils/normalization/decapitalize.d.ts +5 -0
- package/umd/typings/utils/normalization/decapitalize.test.d.ts +1 -0
- package/umd/typings/utils/normalization/isValidKeyword.d.ts +8 -0
- package/umd/typings/utils/normalization/isValidKeyword.test.d.ts +1 -0
- package/umd/typings/utils/normalization/nameToUriPart.d.ts +1 -0
- package/umd/typings/utils/normalization/nameToUriPart.test.d.ts +1 -0
- package/umd/typings/utils/normalization/nameToUriParts.d.ts +1 -0
- package/umd/typings/utils/normalization/nameToUriParts.test.d.ts +1 -0
- package/umd/typings/utils/normalization/normalize-to-kebab-case.d.ts +1 -0
- package/umd/typings/utils/normalization/normalize-to-kebab-case.test.d.ts +1 -0
- package/umd/typings/utils/normalization/normalizeTo_PascalCase.d.ts +1 -0
- package/umd/typings/utils/normalization/normalizeTo_PascalCase.test.d.ts +1 -0
- package/umd/typings/utils/normalization/normalizeTo_SCREAMING_CASE.d.ts +4 -0
- package/umd/typings/utils/normalization/normalizeTo_SCREAMING_CASE.test.d.ts +1 -0
- package/umd/typings/utils/normalization/normalizeTo_camelCase.d.ts +4 -0
- package/umd/typings/utils/normalization/normalizeTo_camelCase.test.d.ts +1 -0
- package/umd/typings/utils/normalization/normalizeTo_snake_case.d.ts +1 -0
- package/umd/typings/utils/normalization/normalizeTo_snake_case.test.d.ts +1 -0
- package/umd/typings/utils/normalization/normalizeWhitespaces.d.ts +4 -0
- package/umd/typings/utils/normalization/normalizeWhitespaces.test.d.ts +1 -0
- package/umd/typings/utils/normalization/parseKeywords.d.ts +14 -0
- package/umd/typings/utils/normalization/parseKeywords.test.d.ts +1 -0
- package/umd/typings/utils/normalization/parseKeywordsFromString.d.ts +8 -0
- package/umd/typings/utils/normalization/parseKeywordsFromString.test.d.ts +1 -0
- package/umd/typings/utils/normalization/removeDiacritics.d.ts +4 -0
- package/umd/typings/utils/normalization/removeDiacritics.test.d.ts +1 -0
- package/umd/typings/utils/normalization/searchKeywords.d.ts +5 -0
- package/umd/typings/utils/normalization/searchKeywords.test.d.ts +1 -0
package/esm/index.es.js
CHANGED
|
@@ -89,7 +89,7 @@ var PromptbookExecutionError = /** @class */ (function (_super) {
|
|
|
89
89
|
/**
|
|
90
90
|
* The version of the Promptbook library
|
|
91
91
|
*/
|
|
92
|
-
var PROMPTBOOK_VERSION = '0.
|
|
92
|
+
var PROMPTBOOK_VERSION = '0.43.0';
|
|
93
93
|
|
|
94
94
|
/**
|
|
95
95
|
* Remote server is a proxy server that uses its execution tools internally and exposes the executor interface externally.
|
|
@@ -2,8 +2,8 @@ import { prettifyPromptbookString } from '../conversion/prettify/prettifyPromptb
|
|
|
2
2
|
import { parseNumber } from '../conversion/utils/parseNumber';
|
|
3
3
|
import { assertsExecutionSuccessful } from '../execution/assertsExecutionSuccessful';
|
|
4
4
|
import { replaceParameters } from '../execution/utils/replaceParameters';
|
|
5
|
-
import { ExecutionReportStringOptions, ExecutionReportStringOptionsDefaults } from '../types/execution-report/ExecutionReportStringOptions';
|
|
6
5
|
import { executionReportJsonToString } from '../types/execution-report/executionReportJsonToString';
|
|
6
|
+
import { ExecutionReportStringOptions, ExecutionReportStringOptionsDefaults } from '../types/execution-report/ExecutionReportStringOptions';
|
|
7
7
|
import { CountUtils } from '../utils/expectation-counters';
|
|
8
8
|
import { countCharacters } from '../utils/expectation-counters/countCharacters';
|
|
9
9
|
import { countLines } from '../utils/expectation-counters/countLines';
|
|
@@ -27,6 +27,24 @@ export { assertsExecutionSuccessful, countCharacters, countLines, countPages, co
|
|
|
27
27
|
extractAllListItemsFromMarkdown, extractBlock, // <- [🌻]
|
|
28
28
|
extractOneBlockFromMarkdown, isValidJsonString, parseNumber, // <- [🌻]
|
|
29
29
|
prettifyPromptbookString, removeContentComments, removeEmojis, removeMarkdownFormatting, removeQuotes, replaceParameters, trimCodeBlock, trimEndOfCodeBlock, unwrapResult, };
|
|
30
|
+
import { capitalize } from '../utils/normalization/capitalize';
|
|
31
|
+
import { decapitalize } from '../utils/normalization/decapitalize';
|
|
32
|
+
import { DIACRITIC_VARIANTS_LETTERS } from '../utils/normalization/DIACRITIC_VARIANTS_LETTERS';
|
|
33
|
+
import { IKeywords, string_keyword } from '../utils/normalization/IKeywords';
|
|
34
|
+
import { isValidKeyword } from '../utils/normalization/isValidKeyword';
|
|
35
|
+
import { nameToUriPart } from '../utils/normalization/nameToUriPart';
|
|
36
|
+
import { nameToUriParts } from '../utils/normalization/nameToUriParts';
|
|
37
|
+
import { normalizeToKebabCase } from '../utils/normalization/normalize-to-kebab-case';
|
|
38
|
+
import { normalizeTo_camelCase } from '../utils/normalization/normalizeTo_camelCase';
|
|
39
|
+
import { normalizeTo_PascalCase } from '../utils/normalization/normalizeTo_PascalCase';
|
|
40
|
+
import { normalizeTo_SCREAMING_CASE } from '../utils/normalization/normalizeTo_SCREAMING_CASE';
|
|
41
|
+
import { normalizeTo_snake_case } from '../utils/normalization/normalizeTo_snake_case';
|
|
42
|
+
import { normalizeWhitespaces } from '../utils/normalization/normalizeWhitespaces';
|
|
43
|
+
import { parseKeywords } from '../utils/normalization/parseKeywords';
|
|
44
|
+
import { parseKeywordsFromString } from '../utils/normalization/parseKeywordsFromString';
|
|
45
|
+
import { removeDiacritics } from '../utils/normalization/removeDiacritics';
|
|
46
|
+
import { searchKeywords } from '../utils/normalization/searchKeywords';
|
|
47
|
+
export { capitalize, decapitalize, DIACRITIC_VARIANTS_LETTERS, IKeywords, isValidKeyword, nameToUriPart, nameToUriParts, normalizeTo_camelCase, normalizeTo_PascalCase, normalizeTo_SCREAMING_CASE, normalizeTo_snake_case, normalizeToKebabCase, normalizeWhitespaces, parseKeywords, parseKeywordsFromString, removeDiacritics, searchKeywords, string_keyword, };
|
|
30
48
|
/**
|
|
31
49
|
* TODO: [🧠] Maybe create some indipendent package like `markdown-tools` from both here exported and @private utilities
|
|
32
50
|
*/
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Map of letters from diacritic variant to diacritless variant
|
|
3
|
+
* Contains lowercase and uppercase separatelly
|
|
4
|
+
*
|
|
5
|
+
* > "á" => "a"
|
|
6
|
+
* > "ě" => "e"
|
|
7
|
+
* > "Ă" => "A"
|
|
8
|
+
* > ...
|
|
9
|
+
*/
|
|
10
|
+
export declare const DIACRITIC_VARIANTS_LETTERS: Record<string, string>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Semantic helper
|
|
3
|
+
*
|
|
4
|
+
* Keyword is string without diacritics in lowercase [a-z1-9]
|
|
5
|
+
* Words are splitted between multiple keywords @see IKeywords
|
|
6
|
+
*
|
|
7
|
+
* For example `"keyword"`
|
|
8
|
+
*/
|
|
9
|
+
export type string_keyword = string;
|
|
10
|
+
/**
|
|
11
|
+
* Semantic helper
|
|
12
|
+
* Set of keywords @see string_keyword
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
export type IKeywords = Set<string_keyword>;
|
|
16
|
+
/**
|
|
17
|
+
* TODO: [🌮] Keywords with weight
|
|
18
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function nameToUriPart(name: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function nameToUriParts(name: string): string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function normalizeToKebabCase(sentence: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function normalizeTo_PascalCase(sentence: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function normalizeTo_snake_case(sentence: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IKeywords } from './IKeywords';
|
|
2
|
+
/**
|
|
3
|
+
* Parses keywords from any object and recursively walks through
|
|
4
|
+
*
|
|
5
|
+
* Tip: If you want to parse multiple inputs, just wrap them in an array
|
|
6
|
+
*
|
|
7
|
+
* @param input of any kind
|
|
8
|
+
* @returns {Set} of keywords without diacritics in lowercase
|
|
9
|
+
*/
|
|
10
|
+
export declare function parseKeywords(input: unknown): IKeywords;
|
|
11
|
+
/**
|
|
12
|
+
* Note: Not using spread in input param because of keeping second parameter for options
|
|
13
|
+
* TODO: [🌺] Use some intermediate util splitWords
|
|
14
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/remote-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.44.0-0",
|
|
4
4
|
"description": "Library to supercharge your use of large language models",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"spacetrim": "0.11.2"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"@promptbook/core": "0.
|
|
42
|
+
"@promptbook/core": "0.44.0-0"
|
|
43
43
|
},
|
|
44
44
|
"main": "./umd/index.umd.js",
|
|
45
45
|
"module": "./esm/index.es.js",
|
package/umd/index.umd.js
CHANGED
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
/**
|
|
97
97
|
* The version of the Promptbook library
|
|
98
98
|
*/
|
|
99
|
-
var PROMPTBOOK_VERSION = '0.
|
|
99
|
+
var PROMPTBOOK_VERSION = '0.43.0';
|
|
100
100
|
|
|
101
101
|
/**
|
|
102
102
|
* Remote server is a proxy server that uses its execution tools internally and exposes the executor interface externally.
|
|
@@ -2,8 +2,8 @@ import { prettifyPromptbookString } from '../conversion/prettify/prettifyPromptb
|
|
|
2
2
|
import { parseNumber } from '../conversion/utils/parseNumber';
|
|
3
3
|
import { assertsExecutionSuccessful } from '../execution/assertsExecutionSuccessful';
|
|
4
4
|
import { replaceParameters } from '../execution/utils/replaceParameters';
|
|
5
|
-
import { ExecutionReportStringOptions, ExecutionReportStringOptionsDefaults } from '../types/execution-report/ExecutionReportStringOptions';
|
|
6
5
|
import { executionReportJsonToString } from '../types/execution-report/executionReportJsonToString';
|
|
6
|
+
import { ExecutionReportStringOptions, ExecutionReportStringOptionsDefaults } from '../types/execution-report/ExecutionReportStringOptions';
|
|
7
7
|
import { CountUtils } from '../utils/expectation-counters';
|
|
8
8
|
import { countCharacters } from '../utils/expectation-counters/countCharacters';
|
|
9
9
|
import { countLines } from '../utils/expectation-counters/countLines';
|
|
@@ -27,6 +27,24 @@ export { assertsExecutionSuccessful, countCharacters, countLines, countPages, co
|
|
|
27
27
|
extractAllListItemsFromMarkdown, extractBlock, // <- [🌻]
|
|
28
28
|
extractOneBlockFromMarkdown, isValidJsonString, parseNumber, // <- [🌻]
|
|
29
29
|
prettifyPromptbookString, removeContentComments, removeEmojis, removeMarkdownFormatting, removeQuotes, replaceParameters, trimCodeBlock, trimEndOfCodeBlock, unwrapResult, };
|
|
30
|
+
import { capitalize } from '../utils/normalization/capitalize';
|
|
31
|
+
import { decapitalize } from '../utils/normalization/decapitalize';
|
|
32
|
+
import { DIACRITIC_VARIANTS_LETTERS } from '../utils/normalization/DIACRITIC_VARIANTS_LETTERS';
|
|
33
|
+
import { IKeywords, string_keyword } from '../utils/normalization/IKeywords';
|
|
34
|
+
import { isValidKeyword } from '../utils/normalization/isValidKeyword';
|
|
35
|
+
import { nameToUriPart } from '../utils/normalization/nameToUriPart';
|
|
36
|
+
import { nameToUriParts } from '../utils/normalization/nameToUriParts';
|
|
37
|
+
import { normalizeToKebabCase } from '../utils/normalization/normalize-to-kebab-case';
|
|
38
|
+
import { normalizeTo_camelCase } from '../utils/normalization/normalizeTo_camelCase';
|
|
39
|
+
import { normalizeTo_PascalCase } from '../utils/normalization/normalizeTo_PascalCase';
|
|
40
|
+
import { normalizeTo_SCREAMING_CASE } from '../utils/normalization/normalizeTo_SCREAMING_CASE';
|
|
41
|
+
import { normalizeTo_snake_case } from '../utils/normalization/normalizeTo_snake_case';
|
|
42
|
+
import { normalizeWhitespaces } from '../utils/normalization/normalizeWhitespaces';
|
|
43
|
+
import { parseKeywords } from '../utils/normalization/parseKeywords';
|
|
44
|
+
import { parseKeywordsFromString } from '../utils/normalization/parseKeywordsFromString';
|
|
45
|
+
import { removeDiacritics } from '../utils/normalization/removeDiacritics';
|
|
46
|
+
import { searchKeywords } from '../utils/normalization/searchKeywords';
|
|
47
|
+
export { capitalize, decapitalize, DIACRITIC_VARIANTS_LETTERS, IKeywords, isValidKeyword, nameToUriPart, nameToUriParts, normalizeTo_camelCase, normalizeTo_PascalCase, normalizeTo_SCREAMING_CASE, normalizeTo_snake_case, normalizeToKebabCase, normalizeWhitespaces, parseKeywords, parseKeywordsFromString, removeDiacritics, searchKeywords, string_keyword, };
|
|
30
48
|
/**
|
|
31
49
|
* TODO: [🧠] Maybe create some indipendent package like `markdown-tools` from both here exported and @private utilities
|
|
32
50
|
*/
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Map of letters from diacritic variant to diacritless variant
|
|
3
|
+
* Contains lowercase and uppercase separatelly
|
|
4
|
+
*
|
|
5
|
+
* > "á" => "a"
|
|
6
|
+
* > "ě" => "e"
|
|
7
|
+
* > "Ă" => "A"
|
|
8
|
+
* > ...
|
|
9
|
+
*/
|
|
10
|
+
export declare const DIACRITIC_VARIANTS_LETTERS: Record<string, string>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Semantic helper
|
|
3
|
+
*
|
|
4
|
+
* Keyword is string without diacritics in lowercase [a-z1-9]
|
|
5
|
+
* Words are splitted between multiple keywords @see IKeywords
|
|
6
|
+
*
|
|
7
|
+
* For example `"keyword"`
|
|
8
|
+
*/
|
|
9
|
+
export type string_keyword = string;
|
|
10
|
+
/**
|
|
11
|
+
* Semantic helper
|
|
12
|
+
* Set of keywords @see string_keyword
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
export type IKeywords = Set<string_keyword>;
|
|
16
|
+
/**
|
|
17
|
+
* TODO: [🌮] Keywords with weight
|
|
18
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function nameToUriPart(name: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function nameToUriParts(name: string): string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function normalizeToKebabCase(sentence: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function normalizeTo_PascalCase(sentence: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function normalizeTo_snake_case(sentence: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IKeywords } from './IKeywords';
|
|
2
|
+
/**
|
|
3
|
+
* Parses keywords from any object and recursively walks through
|
|
4
|
+
*
|
|
5
|
+
* Tip: If you want to parse multiple inputs, just wrap them in an array
|
|
6
|
+
*
|
|
7
|
+
* @param input of any kind
|
|
8
|
+
* @returns {Set} of keywords without diacritics in lowercase
|
|
9
|
+
*/
|
|
10
|
+
export declare function parseKeywords(input: unknown): IKeywords;
|
|
11
|
+
/**
|
|
12
|
+
* Note: Not using spread in input param because of keeping second parameter for options
|
|
13
|
+
* TODO: [🌺] Use some intermediate util splitWords
|
|
14
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|