@promptbook/node 0.85.0-3 → 0.85.0-4
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Observable } from 'rxjs';
|
|
2
2
|
import { PartialDeep } from 'type-fest';
|
|
3
|
-
import type { string_SCREAMING_CASE } from '../utils/normalization/normalizeTo_SCREAMING_CASE';
|
|
4
3
|
import type { task_id } from '../types/typeAliases';
|
|
4
|
+
import type { string_SCREAMING_CASE } from '../utils/normalization/normalizeTo_SCREAMING_CASE';
|
|
5
5
|
import type { AbstractTaskResult } from './AbstractTaskResult';
|
|
6
6
|
import type { PipelineExecutorResult } from './PipelineExecutorResult';
|
|
7
7
|
/**
|
|
@@ -30,7 +30,7 @@ export declare function createTask<TTaskResult extends AbstractTaskResult>(optio
|
|
|
30
30
|
*/
|
|
31
31
|
export type ExecutionTask = AbstractTask<PipelineExecutorResult> & {
|
|
32
32
|
readonly taskType: 'EXECUTION';
|
|
33
|
-
readonly taskId: `
|
|
33
|
+
readonly taskId: `exec-${task_id}`;
|
|
34
34
|
};
|
|
35
35
|
/**
|
|
36
36
|
* Represents a task that prepares a pipeline
|
|
@@ -38,7 +38,7 @@ export type ExecutionTask = AbstractTask<PipelineExecutorResult> & {
|
|
|
38
38
|
*/
|
|
39
39
|
export type PreparationTask = AbstractTask<PipelineExecutorResult> & {
|
|
40
40
|
readonly taskType: 'PREPARATION';
|
|
41
|
-
readonly taskId: `
|
|
41
|
+
readonly taskId: `prep-${task_id}`;
|
|
42
42
|
};
|
|
43
43
|
/**
|
|
44
44
|
* Base interface for all task types
|
|
@@ -62,6 +62,10 @@ export type AbstractTask<TTaskResult extends AbstractTaskResult> = {
|
|
|
62
62
|
* Gets an observable stream of partial task results
|
|
63
63
|
*/
|
|
64
64
|
asObservable(): Observable<PartialDeep<TTaskResult>>;
|
|
65
|
+
/**
|
|
66
|
+
* Gets just the current value which is mutated during the task processing
|
|
67
|
+
*/
|
|
68
|
+
currentValue: PartialDeep<TTaskResult>;
|
|
65
69
|
};
|
|
66
70
|
export type Task = ExecutionTask | PreparationTask;
|
|
67
71
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/node",
|
|
3
|
-
"version": "0.85.0-
|
|
3
|
+
"version": "0.85.0-4",
|
|
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.85.0-
|
|
50
|
+
"@promptbook/core": "0.85.0-4"
|
|
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.85.0-
|
|
48
|
+
var PROMPTBOOK_ENGINE_VERSION = '0.85.0-3';
|
|
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
|
|
@@ -2060,7 +2060,7 @@
|
|
|
2060
2060
|
*/
|
|
2061
2061
|
function createTask(options) {
|
|
2062
2062
|
var taskType = options.taskType, taskProcessCallback = options.taskProcessCallback;
|
|
2063
|
-
var taskId = "".concat(taskType.toLowerCase(), "-").concat($randomToken(
|
|
2063
|
+
var taskId = "".concat(taskType.toLowerCase().substring(0, 4), "-").concat($randomToken(8 /* <- TODO: !!! To global config + Use Base58 to avoid simmilar char conflicts */));
|
|
2064
2064
|
var partialResultSubject = new rxjs.BehaviorSubject({});
|
|
2065
2065
|
var finalResultPromise = /* not await */ taskProcessCallback(function (newOngoingResult) {
|
|
2066
2066
|
partialResultSubject.next(newOngoingResult);
|
|
@@ -2092,6 +2092,9 @@
|
|
|
2092
2092
|
isCrashedOnError: true,
|
|
2093
2093
|
})));
|
|
2094
2094
|
},
|
|
2095
|
+
get currentValue() {
|
|
2096
|
+
return partialResultSubject.value;
|
|
2097
|
+
},
|
|
2095
2098
|
};
|
|
2096
2099
|
}
|
|
2097
2100
|
/**
|