@promptbook/markitdown 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 +2 -2
- package/umd/index.umd.js +24 -7
- package/umd/index.umd.js.map +1 -1
package/esm/index.es.js
CHANGED
|
@@ -5,7 +5,7 @@ import hexEncoder from 'crypto-js/enc-hex';
|
|
|
5
5
|
import { basename, join, dirname } from 'path';
|
|
6
6
|
import { format } from 'prettier';
|
|
7
7
|
import parserHtml from 'prettier/parser-html';
|
|
8
|
-
import { BehaviorSubject
|
|
8
|
+
import { BehaviorSubject } from 'rxjs';
|
|
9
9
|
import { randomBytes } from 'crypto';
|
|
10
10
|
import { forTime } from 'waitasecond';
|
|
11
11
|
import sha256 from 'crypto-js/sha256';
|
|
@@ -26,7 +26,7 @@ var BOOK_LANGUAGE_VERSION = '1.0.0';
|
|
|
26
26
|
* @generated
|
|
27
27
|
* @see https://github.com/webgptorg/promptbook
|
|
28
28
|
*/
|
|
29
|
-
var PROMPTBOOK_ENGINE_VERSION = '0.
|
|
29
|
+
var PROMPTBOOK_ENGINE_VERSION = '0.85.0-9';
|
|
30
30
|
/**
|
|
31
31
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
32
32
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -2514,10 +2514,26 @@ function assertsTaskSuccessful(executionResult) {
|
|
|
2514
2514
|
*/
|
|
2515
2515
|
function createTask(options) {
|
|
2516
2516
|
var taskType = options.taskType, taskProcessCallback = options.taskProcessCallback;
|
|
2517
|
-
var taskId = "".concat(taskType.toLowerCase(), "-").concat($randomToken(
|
|
2518
|
-
var
|
|
2517
|
+
var taskId = "".concat(taskType.toLowerCase().substring(0, 4), "-").concat($randomToken(8 /* <- TODO: To global config + Use Base58 to avoid simmilar char conflicts */));
|
|
2518
|
+
var partialResultSubject = new BehaviorSubject({});
|
|
2519
2519
|
var finalResultPromise = /* not await */ taskProcessCallback(function (newOngoingResult) {
|
|
2520
|
-
|
|
2520
|
+
partialResultSubject.next(newOngoingResult);
|
|
2521
|
+
});
|
|
2522
|
+
finalResultPromise
|
|
2523
|
+
.catch(function (error) {
|
|
2524
|
+
partialResultSubject.error(error);
|
|
2525
|
+
})
|
|
2526
|
+
.then(function (value) {
|
|
2527
|
+
if (value) {
|
|
2528
|
+
try {
|
|
2529
|
+
assertsTaskSuccessful(value);
|
|
2530
|
+
partialResultSubject.next(value);
|
|
2531
|
+
}
|
|
2532
|
+
catch (error) {
|
|
2533
|
+
partialResultSubject.error(error);
|
|
2534
|
+
}
|
|
2535
|
+
}
|
|
2536
|
+
partialResultSubject.complete();
|
|
2521
2537
|
});
|
|
2522
2538
|
function asPromise(options) {
|
|
2523
2539
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -2542,9 +2558,10 @@ function createTask(options) {
|
|
|
2542
2558
|
taskId: taskId,
|
|
2543
2559
|
asPromise: asPromise,
|
|
2544
2560
|
asObservable: function () {
|
|
2545
|
-
return
|
|
2546
|
-
|
|
2547
|
-
|
|
2561
|
+
return partialResultSubject.asObservable();
|
|
2562
|
+
},
|
|
2563
|
+
get currentValue() {
|
|
2564
|
+
return partialResultSubject.value;
|
|
2548
2565
|
},
|
|
2549
2566
|
};
|
|
2550
2567
|
}
|