@promptbook/node 0.86.0-8 → 0.86.5
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/README.md +48 -58
- package/esm/index.es.js +11 -11
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/cli/test/ptbk2.d.ts +5 -0
- package/esm/typings/src/conversion/compilePipeline.d.ts +1 -1
- package/esm/typings/src/conversion/compilePipelineOnRemoteServer.d.ts +1 -1
- package/esm/typings/src/conversion/parsePipeline.d.ts +1 -1
- package/esm/typings/src/conversion/pipelineJsonToString.d.ts +1 -1
- package/esm/typings/src/conversion/validation/_importPipeline.d.ts +6 -6
- package/esm/typings/src/pipeline/PipelineJson/PreparationJson.d.ts +1 -1
- package/package.json +2 -2
- package/umd/index.umd.js +11 -11
- package/umd/index.umd.js.map +1 -1
|
@@ -13,7 +13,7 @@ import type { PrepareAndScrapeOptions } from '../prepare/PrepareAndScrapeOptions
|
|
|
13
13
|
* @param pipelineString {Promptbook} in string markdown format (.book.md)
|
|
14
14
|
* @param tools - Tools for the preparation and scraping - if not provided together with `llm`, the preparation will be skipped
|
|
15
15
|
* @param options - Options and tools for the compilation
|
|
16
|
-
* @returns {Promptbook} compiled in JSON format (.
|
|
16
|
+
* @returns {Promptbook} compiled in JSON format (.bookc)
|
|
17
17
|
* @throws {ParseError} if the promptbook string is not valid
|
|
18
18
|
* @public exported from `@promptbook/core`
|
|
19
19
|
*/
|
|
@@ -11,7 +11,7 @@ import type { RemoteClientOptions } from '../remote-server/types/RemoteClientOpt
|
|
|
11
11
|
*
|
|
12
12
|
* @param pipelineString {Promptbook} in string markdown format (.book.md)
|
|
13
13
|
* @param options - Configuration of the remote server
|
|
14
|
-
* @returns {Promptbook} compiled in JSON format (.
|
|
14
|
+
* @returns {Promptbook} compiled in JSON format (.bookc)
|
|
15
15
|
* @throws {ParseError} if the promptbook string is not valid
|
|
16
16
|
* @public exported from `@promptbook/remote-client`
|
|
17
17
|
*/
|
|
@@ -12,7 +12,7 @@ import type { PipelineString } from '../pipeline/PipelineString';
|
|
|
12
12
|
* Note: This function acts as compilation process
|
|
13
13
|
*
|
|
14
14
|
* @param pipelineString {Promptbook} in string markdown format (.book.md)
|
|
15
|
-
* @returns {Promptbook} compiled in JSON format (.
|
|
15
|
+
* @returns {Promptbook} compiled in JSON format (.bookc)
|
|
16
16
|
* @throws {ParseError} if the promptbook string is not valid
|
|
17
17
|
* @public exported from `@promptbook/core`
|
|
18
18
|
*/
|
|
@@ -4,7 +4,7 @@ import type { PipelineString } from '../pipeline/PipelineString';
|
|
|
4
4
|
* Converts promptbook in JSON format to string format
|
|
5
5
|
*
|
|
6
6
|
* @deprecated TODO: [🥍][🧠] Backup original files in `PipelineJson` same as in Promptbook.studio
|
|
7
|
-
* @param pipelineJson Promptbook in JSON format (.
|
|
7
|
+
* @param pipelineJson Promptbook in JSON format (.bookc)
|
|
8
8
|
* @returns Promptbook in string format (.book.md)
|
|
9
9
|
* @public exported from `@promptbook/core`
|
|
10
10
|
*/
|
|
@@ -2,7 +2,7 @@ import type { PipelineJson } from '../../pipeline/PipelineJson/PipelineJson';
|
|
|
2
2
|
import type { PipelineString } from '../../pipeline/PipelineString';
|
|
3
3
|
import type { string_json } from '../../types/typeAliases';
|
|
4
4
|
/**
|
|
5
|
-
* Import the pipeline.book or pipeline.
|
|
5
|
+
* Import the pipeline.book or pipeline.bookc file
|
|
6
6
|
*
|
|
7
7
|
* Note: Using here custom import to work in jest tests
|
|
8
8
|
* Note: Using sync version is 💩 in the production code, but it's ok here in tests
|
|
@@ -11,19 +11,19 @@ import type { string_json } from '../../types/typeAliases';
|
|
|
11
11
|
* @private internal function of tests
|
|
12
12
|
*/
|
|
13
13
|
export declare function importPipelineWithoutPreparation(path: `${string}.book`): PipelineString;
|
|
14
|
-
export declare function importPipelineWithoutPreparation(path: `${string}.
|
|
14
|
+
export declare function importPipelineWithoutPreparation(path: `${string}.bookc`): PipelineJson;
|
|
15
15
|
/**
|
|
16
|
-
* Import the pipeline.
|
|
16
|
+
* Import the pipeline.bookc file as parsed JSON
|
|
17
17
|
*
|
|
18
18
|
* @private internal function of tests
|
|
19
19
|
*/
|
|
20
|
-
export declare function importPipelineJson(path: `${string}.
|
|
20
|
+
export declare function importPipelineJson(path: `${string}.bookc`): PipelineJson;
|
|
21
21
|
/**
|
|
22
|
-
* Import the pipeline.
|
|
22
|
+
* Import the pipeline.bookc file as string
|
|
23
23
|
*
|
|
24
24
|
* @private internal function of tests
|
|
25
25
|
*/
|
|
26
|
-
export declare function importPipelineJsonAsString(path: `${string}.
|
|
26
|
+
export declare function importPipelineJsonAsString(path: `${string}.bookc`): string_json<PipelineJson>;
|
|
27
27
|
/**
|
|
28
28
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
29
29
|
* Note: [⚫] Code in this file should never be published in any package
|
|
@@ -18,5 +18,5 @@ export type PreparationJson = {
|
|
|
18
18
|
/**
|
|
19
19
|
* TODO: [🍙] Make some standard order of json properties
|
|
20
20
|
* TODO: Maybe put here used `modelName`
|
|
21
|
-
* TODO: [🍥] When using `date` it changes all examples .
|
|
21
|
+
* TODO: [🍥] When using `date` it changes all examples .bookc files each time so until some more elegant solution omit the time from prepared pipeline
|
|
22
22
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/node",
|
|
3
|
-
"version": "0.86.
|
|
3
|
+
"version": "0.86.5",
|
|
4
4
|
"description": "It's time for a paradigm shift. The future of software in plain English, French or Latin",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"module": "./esm/index.es.js",
|
|
48
48
|
"typings": "./esm/typings/src/_packages/node.index.d.ts",
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@promptbook/core": "0.86.
|
|
50
|
+
"@promptbook/core": "0.86.5"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"colors": "1.4.0",
|
package/umd/index.umd.js
CHANGED
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
* @generated
|
|
46
46
|
* @see https://github.com/webgptorg/promptbook
|
|
47
47
|
*/
|
|
48
|
-
var PROMPTBOOK_ENGINE_VERSION = '0.86.
|
|
48
|
+
var PROMPTBOOK_ENGINE_VERSION = '0.86.5';
|
|
49
49
|
/**
|
|
50
50
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
51
51
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -564,7 +564,7 @@
|
|
|
564
564
|
* Converts promptbook in JSON format to string format
|
|
565
565
|
*
|
|
566
566
|
* @deprecated TODO: [🥍][🧠] Backup original files in `PipelineJson` same as in Promptbook.studio
|
|
567
|
-
* @param pipelineJson Promptbook in JSON format (.
|
|
567
|
+
* @param pipelineJson Promptbook in JSON format (.bookc)
|
|
568
568
|
* @returns Promptbook in string format (.book.md)
|
|
569
569
|
* @public exported from `@promptbook/core`
|
|
570
570
|
*/
|
|
@@ -9086,7 +9086,7 @@
|
|
|
9086
9086
|
* Note: This function acts as compilation process
|
|
9087
9087
|
*
|
|
9088
9088
|
* @param pipelineString {Promptbook} in string markdown format (.book.md)
|
|
9089
|
-
* @returns {Promptbook} compiled in JSON format (.
|
|
9089
|
+
* @returns {Promptbook} compiled in JSON format (.bookc)
|
|
9090
9090
|
* @throws {ParseError} if the promptbook string is not valid
|
|
9091
9091
|
* @public exported from `@promptbook/core`
|
|
9092
9092
|
*/
|
|
@@ -9554,7 +9554,7 @@
|
|
|
9554
9554
|
* @param pipelineString {Promptbook} in string markdown format (.book.md)
|
|
9555
9555
|
* @param tools - Tools for the preparation and scraping - if not provided together with `llm`, the preparation will be skipped
|
|
9556
9556
|
* @param options - Options and tools for the compilation
|
|
9557
|
-
* @returns {Promptbook} compiled in JSON format (.
|
|
9557
|
+
* @returns {Promptbook} compiled in JSON format (.bookc)
|
|
9558
9558
|
* @throws {ParseError} if the promptbook string is not valid
|
|
9559
9559
|
* @public exported from `@promptbook/core`
|
|
9560
9560
|
*/
|
|
@@ -11282,7 +11282,7 @@
|
|
|
11282
11282
|
}
|
|
11283
11283
|
madeLibraryFilePath = path.join(rootPath, "".concat(DEFAULT_PIPELINE_COLLECTION_BASE_FILENAME
|
|
11284
11284
|
// <- TODO: [🦒] Allow to override (pass different value into the function)
|
|
11285
|
-
, ".
|
|
11285
|
+
, ".bookc"));
|
|
11286
11286
|
return [4 /*yield*/, isFileExisting(madeLibraryFilePath, tools.fs)];
|
|
11287
11287
|
case 3:
|
|
11288
11288
|
if (!(_f.sent())) ;
|
|
@@ -11304,13 +11304,13 @@
|
|
|
11304
11304
|
return [4 /*yield*/, listAllFiles(rootPath, isRecursive, tools.fs)];
|
|
11305
11305
|
case 1:
|
|
11306
11306
|
fileNames = _b.sent();
|
|
11307
|
-
// Note: First load
|
|
11308
|
-
// `.
|
|
11307
|
+
// Note: First load compiled `.bookc` files and then source `.book` files
|
|
11308
|
+
// `.bookc` are already compiled and can be used faster
|
|
11309
11309
|
fileNames.sort(function (a, b) {
|
|
11310
|
-
if (a.endsWith('.json') && (b.endsWith('.book') || b.endsWith('.book'))) {
|
|
11310
|
+
if ((a.endsWith('.bookc') || a.endsWith('.book.json')) && (b.endsWith('.book') || b.endsWith('.book.md'))) {
|
|
11311
11311
|
return -1;
|
|
11312
11312
|
}
|
|
11313
|
-
if ((a.endsWith('.book') || a.endsWith('.book')) && b.endsWith('.json')) {
|
|
11313
|
+
if ((a.endsWith('.book') || a.endsWith('.book.md')) && (b.endsWith('.bookc') || b.endsWith('.book.json'))) {
|
|
11314
11314
|
return 1;
|
|
11315
11315
|
}
|
|
11316
11316
|
return 0;
|
|
@@ -11327,7 +11327,7 @@
|
|
|
11327
11327
|
case 1:
|
|
11328
11328
|
_f.trys.push([1, 8, , 9]);
|
|
11329
11329
|
pipeline = null;
|
|
11330
|
-
if (!(fileName.endsWith('.book') || fileName.endsWith('.book'))) return [3 /*break*/, 4];
|
|
11330
|
+
if (!(fileName.endsWith('.book') || fileName.endsWith('.book.md'))) return [3 /*break*/, 4];
|
|
11331
11331
|
_c = validatePipelineString;
|
|
11332
11332
|
return [4 /*yield*/, promises.readFile(fileName, 'utf-8')];
|
|
11333
11333
|
case 2:
|
|
@@ -11340,7 +11340,7 @@
|
|
|
11340
11340
|
pipeline = __assign(__assign({}, pipeline), { sourceFile: sourceFile });
|
|
11341
11341
|
return [3 /*break*/, 7];
|
|
11342
11342
|
case 4:
|
|
11343
|
-
if (!fileName.endsWith('.book.json')) return [3 /*break*/, 6];
|
|
11343
|
+
if (!(fileName.endsWith('.bookc') || fileName.endsWith('.book.json'))) return [3 /*break*/, 6];
|
|
11344
11344
|
_e = (_d = JSON).parse;
|
|
11345
11345
|
return [4 /*yield*/, promises.readFile(fileName, 'utf-8')];
|
|
11346
11346
|
case 5:
|