@promptbook/markdown-utils 0.85.0-0 → 0.85.0-10
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 +25 -8
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/utils.index.d.ts +2 -0
- package/esm/typings/src/cli/cli-commands/about.d.ts +0 -1
- package/esm/typings/src/execution/ExecutionTask.d.ts +7 -3
- package/esm/typings/src/remote-server/startRemoteServer.d.ts +1 -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 +1 -1
- package/umd/index.umd.js +24 -7
- package/umd/index.umd.js.map +1 -1
package/esm/index.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import spaceTrim, { spaceTrim as spaceTrim$1 } from 'spacetrim';
|
|
2
2
|
import { format } from 'prettier';
|
|
3
3
|
import parserHtml from 'prettier/parser-html';
|
|
4
|
-
import { BehaviorSubject
|
|
4
|
+
import { BehaviorSubject } from 'rxjs';
|
|
5
5
|
import { randomBytes } from 'crypto';
|
|
6
6
|
import { forTime } from 'waitasecond';
|
|
7
7
|
import hexEncoder from 'crypto-js/enc-hex';
|
|
@@ -25,7 +25,7 @@ var BOOK_LANGUAGE_VERSION = '1.0.0';
|
|
|
25
25
|
* @generated
|
|
26
26
|
* @see https://github.com/webgptorg/promptbook
|
|
27
27
|
*/
|
|
28
|
-
var PROMPTBOOK_ENGINE_VERSION = '0.
|
|
28
|
+
var PROMPTBOOK_ENGINE_VERSION = '0.85.0-9';
|
|
29
29
|
/**
|
|
30
30
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
31
31
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -2190,10 +2190,26 @@ function assertsTaskSuccessful(executionResult) {
|
|
|
2190
2190
|
*/
|
|
2191
2191
|
function createTask(options) {
|
|
2192
2192
|
var taskType = options.taskType, taskProcessCallback = options.taskProcessCallback;
|
|
2193
|
-
var taskId = "".concat(taskType.toLowerCase(), "-").concat($randomToken(
|
|
2194
|
-
var
|
|
2193
|
+
var taskId = "".concat(taskType.toLowerCase().substring(0, 4), "-").concat($randomToken(8 /* <- TODO: To global config + Use Base58 to avoid simmilar char conflicts */));
|
|
2194
|
+
var partialResultSubject = new BehaviorSubject({});
|
|
2195
2195
|
var finalResultPromise = /* not await */ taskProcessCallback(function (newOngoingResult) {
|
|
2196
|
-
|
|
2196
|
+
partialResultSubject.next(newOngoingResult);
|
|
2197
|
+
});
|
|
2198
|
+
finalResultPromise
|
|
2199
|
+
.catch(function (error) {
|
|
2200
|
+
partialResultSubject.error(error);
|
|
2201
|
+
})
|
|
2202
|
+
.then(function (value) {
|
|
2203
|
+
if (value) {
|
|
2204
|
+
try {
|
|
2205
|
+
assertsTaskSuccessful(value);
|
|
2206
|
+
partialResultSubject.next(value);
|
|
2207
|
+
}
|
|
2208
|
+
catch (error) {
|
|
2209
|
+
partialResultSubject.error(error);
|
|
2210
|
+
}
|
|
2211
|
+
}
|
|
2212
|
+
partialResultSubject.complete();
|
|
2197
2213
|
});
|
|
2198
2214
|
function asPromise(options) {
|
|
2199
2215
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -2218,9 +2234,10 @@ function createTask(options) {
|
|
|
2218
2234
|
taskId: taskId,
|
|
2219
2235
|
asPromise: asPromise,
|
|
2220
2236
|
asObservable: function () {
|
|
2221
|
-
return
|
|
2222
|
-
|
|
2223
|
-
|
|
2237
|
+
return partialResultSubject.asObservable();
|
|
2238
|
+
},
|
|
2239
|
+
get currentValue() {
|
|
2240
|
+
return partialResultSubject.value;
|
|
2224
2241
|
},
|
|
2225
2242
|
};
|
|
2226
2243
|
}
|