@promptbook/node 0.85.0-0 → 0.85.0-2
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 +7 -7
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/utils.index.d.ts +2 -0
- package/esm/typings/src/execution/FilesystemTools.d.ts +1 -1
- package/esm/typings/src/remote-server/startRemoteServer.d.ts +2 -0
- package/esm/typings/src/remote-server/types/RemoteServerOptions.d.ts +6 -4
- package/esm/typings/src/utils/normalization/suffixUrl.d.ts +7 -0
- package/esm/typings/src/utils/normalization/suffixUrl.test.d.ts +1 -0
- package/package.json +2 -2
- package/umd/index.umd.js +35 -35
- package/umd/index.umd.js.map +1 -1
package/esm/index.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import colors from 'colors';
|
|
2
|
-
import { stat, access, constants, readFile, writeFile, readdir, mkdir, unlink } from 'fs/promises';
|
|
3
|
-
import { basename, join, dirname } from 'path';
|
|
2
|
+
import { stat, access, constants, readFile, writeFile, readdir, mkdir, unlink } from 'node:fs/promises';
|
|
3
|
+
import { basename, join, dirname } from 'node:path';
|
|
4
4
|
import spaceTrim, { spaceTrim as spaceTrim$1 } from 'spacetrim';
|
|
5
5
|
import { format } from 'prettier';
|
|
6
6
|
import parserHtml from 'prettier/parser-html';
|
|
@@ -12,7 +12,7 @@ import hexEncoder from 'crypto-js/enc-hex';
|
|
|
12
12
|
import sha256 from 'crypto-js/sha256';
|
|
13
13
|
import { SHA256 } from 'crypto-js';
|
|
14
14
|
import { lookup, extension } from 'mime-types';
|
|
15
|
-
import { spawn } from 'child_process';
|
|
15
|
+
import { spawn } from 'node:child_process';
|
|
16
16
|
import * as dotenv from 'dotenv';
|
|
17
17
|
|
|
18
18
|
// ⚠️ WARNING: This code has been generated so that any manual changes will be overwritten
|
|
@@ -29,7 +29,7 @@ var BOOK_LANGUAGE_VERSION = '1.0.0';
|
|
|
29
29
|
* @generated
|
|
30
30
|
* @see https://github.com/webgptorg/promptbook
|
|
31
31
|
*/
|
|
32
|
-
var PROMPTBOOK_ENGINE_VERSION = '0.
|
|
32
|
+
var PROMPTBOOK_ENGINE_VERSION = '0.85.0-1';
|
|
33
33
|
/**
|
|
34
34
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
35
35
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -2045,9 +2045,9 @@ function assertsTaskSuccessful(executionResult) {
|
|
|
2045
2045
|
function createTask(options) {
|
|
2046
2046
|
var taskType = options.taskType, taskProcessCallback = options.taskProcessCallback;
|
|
2047
2047
|
var taskId = "".concat(taskType.toLowerCase(), "-").concat($randomToken(256 /* <- TODO: !!! To global config */));
|
|
2048
|
-
var
|
|
2048
|
+
var partialResultSubject = new BehaviorSubject({});
|
|
2049
2049
|
var finalResultPromise = /* not await */ taskProcessCallback(function (newOngoingResult) {
|
|
2050
|
-
|
|
2050
|
+
partialResultSubject.next(newOngoingResult);
|
|
2051
2051
|
});
|
|
2052
2052
|
function asPromise(options) {
|
|
2053
2053
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -2072,7 +2072,7 @@ function createTask(options) {
|
|
|
2072
2072
|
taskId: taskId,
|
|
2073
2073
|
asPromise: asPromise,
|
|
2074
2074
|
asObservable: function () {
|
|
2075
|
-
return concat(
|
|
2075
|
+
return concat(partialResultSubject.asObservable(), from(asPromise({
|
|
2076
2076
|
isCrashedOnError: true,
|
|
2077
2077
|
})));
|
|
2078
2078
|
},
|