@promptbook/remote-server 0.92.0-23 → 0.92.0-24
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 -6
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/collection/PipelineCollection.d.ts +0 -2
- package/esm/typings/src/collection/SimplePipelineCollection.d.ts +1 -1
- package/esm/typings/src/commands/FORMFACTOR/formfactorCommandParser.d.ts +1 -1
- package/esm/typings/src/config.d.ts +8 -4
- package/esm/typings/src/formats/_common/FormatSubvalueParser.d.ts +10 -10
- package/esm/typings/src/formfactors/_boilerplate/BoilerplateFormfactorDefinition.d.ts +3 -2
- package/esm/typings/src/formfactors/_common/string_formfactor_name.d.ts +2 -1
- package/esm/typings/src/formfactors/index.d.ts +1 -1
- package/esm/typings/src/formfactors/sheets/SheetsFormfactorDefinition.d.ts +3 -2
- package/esm/typings/src/llm-providers/_common/utils/cache/cacheLlmTools.d.ts +3 -3
- package/esm/typings/src/utils/environment/$getGlobalScope.d.ts +2 -1
- package/package.json +2 -2
- package/umd/index.umd.js +25 -6
- package/umd/index.umd.js.map +1 -1
|
@@ -4,8 +4,6 @@ import type { Prompt } from '../types/Prompt';
|
|
|
4
4
|
import type { string_pipeline_url } from '../types/typeAliases';
|
|
5
5
|
/**
|
|
6
6
|
* Collection that groups together pipelines, knowledge, personas, tools and actions
|
|
7
|
-
*
|
|
8
|
-
* @see @@@ https://github.com/webgptorg/pipeline#pipeline-collection
|
|
9
7
|
*/
|
|
10
8
|
export type PipelineCollection = {
|
|
11
9
|
/**
|
|
@@ -14,7 +14,7 @@ export declare class SimplePipelineCollection implements PipelineCollection {
|
|
|
14
14
|
/**
|
|
15
15
|
* Constructs a pipeline collection from pipelines
|
|
16
16
|
*
|
|
17
|
-
* @param pipelines
|
|
17
|
+
* @param pipelines Array of pipeline JSON objects to include in the collection
|
|
18
18
|
*
|
|
19
19
|
* Note: During the construction logic of all pipelines are validated
|
|
20
20
|
* Note: It is not recommended to use this constructor directly, use `createCollectionFromJson` *(or other variant)* instead
|
|
@@ -3,7 +3,7 @@ import type { FormfactorCommand } from './FormfactorCommand';
|
|
|
3
3
|
/**
|
|
4
4
|
* Parses the formfactor command
|
|
5
5
|
*
|
|
6
|
-
* Note:
|
|
6
|
+
* Note: This command is used as a formfactor for new commands and defines the app type format - it should NOT be used in any `.book` file
|
|
7
7
|
*
|
|
8
8
|
* @see `documentationUrl` for more details
|
|
9
9
|
* @public exported from `@promptbook/editable`
|
|
@@ -69,19 +69,23 @@ export declare const DEFAULT_BOOK_OUTPUT_PARAMETER_NAME = "result";
|
|
|
69
69
|
*/
|
|
70
70
|
export declare const DEFAULT_MAX_FILE_SIZE: number;
|
|
71
71
|
/**
|
|
72
|
-
*
|
|
72
|
+
* Threshold value that determines when a dataset is considered "big"
|
|
73
|
+
* and may require special handling or optimizations
|
|
74
|
+
*
|
|
75
|
+
* For example, when error occurs in one item of the big dataset, it will not fail the whole pipeline
|
|
73
76
|
*
|
|
74
77
|
* @public exported from `@promptbook/core`
|
|
75
78
|
*/
|
|
76
79
|
export declare const BIG_DATASET_TRESHOLD = 50;
|
|
77
80
|
/**
|
|
78
|
-
*
|
|
81
|
+
* Placeholder text used to represent a placeholder value of failed operation
|
|
79
82
|
*
|
|
80
83
|
* @public exported from `@promptbook/core`
|
|
81
84
|
*/
|
|
82
|
-
export declare const FAILED_VALUE_PLACEHOLDER = "
|
|
85
|
+
export declare const FAILED_VALUE_PLACEHOLDER = "!?";
|
|
83
86
|
/**
|
|
84
|
-
*
|
|
87
|
+
* Placeholder text used to represent operations or values that are still in progress
|
|
88
|
+
* or awaiting completion in UI displays and logging
|
|
85
89
|
*
|
|
86
90
|
* @public exported from `@promptbook/core`
|
|
87
91
|
*/
|
|
@@ -32,32 +32,32 @@ export type FormatSubvalueParser<TValue extends string, TSettings extends empty_
|
|
|
32
32
|
*/
|
|
33
33
|
export type FormatSubvalueParserMapValuesOptions<TValue extends string, TSettings extends empty_object> = {
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
35
|
+
* The input string value to parse for subvalues
|
|
36
36
|
*/
|
|
37
37
|
readonly value: TValue;
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
39
|
+
* The name of the output parameter where the processed value will be stored
|
|
40
40
|
*/
|
|
41
41
|
readonly outputParameterName: string_parameter_name;
|
|
42
42
|
/**
|
|
43
|
-
*
|
|
43
|
+
* Format-specific settings that control how subvalues are parsed or processed
|
|
44
44
|
*/
|
|
45
45
|
readonly settings: TSettings;
|
|
46
46
|
/**
|
|
47
|
-
*
|
|
47
|
+
* Callback function that processes each subvalue and returns the transformed value
|
|
48
48
|
*
|
|
49
|
-
* @param subvalues
|
|
49
|
+
* @param subvalues Object containing the extracted subvalues
|
|
50
50
|
* @param index Current index of the subvalue which is being mapped
|
|
51
51
|
* @param length Full length of the subvalues
|
|
52
|
-
* @param number
|
|
53
|
-
* @returns
|
|
52
|
+
* @param number Total number of subvalues to process
|
|
53
|
+
* @returns Transformed value after processing
|
|
54
54
|
*/
|
|
55
55
|
mapCallback(subvalues: Parameters, index: number, length: number): Promisable<TValue>;
|
|
56
56
|
/**
|
|
57
|
-
*
|
|
57
|
+
* Progress callback that receives partial results during processing
|
|
58
58
|
*
|
|
59
|
-
* @param partialResultString
|
|
60
|
-
* @returns
|
|
59
|
+
* @param partialResultString The current partial result as processing progresses
|
|
60
|
+
* @returns Promise or void to continue execution
|
|
61
61
|
*/
|
|
62
62
|
onProgress(partialResultString: TValue): Promisable<void>;
|
|
63
63
|
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Boilerplate is form of app that
|
|
2
|
+
* Boilerplate is form of app that serves as a template structure for creating other formfactors
|
|
3
|
+
* and should not be used directly in production.
|
|
3
4
|
*
|
|
4
5
|
* @public exported from `@promptbook/core`
|
|
5
6
|
*/
|
|
6
7
|
export declare const BoilerplateFormfactorDefinition: {
|
|
7
8
|
readonly name: "BOILERPLATE";
|
|
8
|
-
readonly description: "
|
|
9
|
+
readonly description: "A template structure for creating new formfactors, providing the base architecture and interfaces that should be implemented.";
|
|
9
10
|
readonly documentationUrl: "https://github.com/webgptorg/promptbook/discussions/@@";
|
|
10
11
|
readonly pipelineInterface: {
|
|
11
12
|
readonly inputParameters: readonly [];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { FormfactorDefinition } from './FormfactorDefinition';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* A type alias representing the name of a formfactor, used for type checking and validation
|
|
4
|
+
* in the formfactor registry and selection processes
|
|
4
5
|
*/
|
|
5
6
|
export type string_formfactor_name = FormfactorDefinition['name'];
|
|
@@ -71,7 +71,7 @@ export declare const FORMFACTOR_DEFINITIONS: readonly [{
|
|
|
71
71
|
}, {
|
|
72
72
|
readonly name: "SHEETS";
|
|
73
73
|
readonly aliasNames: readonly ["SHEETS", "SHEET"];
|
|
74
|
-
readonly description: "
|
|
74
|
+
readonly description: "A formfactor for processing spreadsheet-like data in CSV format, enabling AI transformations on tabular data";
|
|
75
75
|
readonly documentationUrl: "https://github.com/webgptorg/promptbook/discussions/176";
|
|
76
76
|
readonly pipelineInterface: {
|
|
77
77
|
readonly inputParameters: readonly [{
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Sheets is form of app that
|
|
2
|
+
* Sheets is form of app that processes tabular data in CSV format, allowing transformation
|
|
3
|
+
* and analysis of structured data through AI-powered operations
|
|
3
4
|
*
|
|
4
5
|
* @public exported from `@promptbook/core`
|
|
5
6
|
*/
|
|
6
7
|
export declare const SheetsFormfactorDefinition: {
|
|
7
8
|
readonly name: "SHEETS";
|
|
8
9
|
readonly aliasNames: readonly ["SHEETS", "SHEET"];
|
|
9
|
-
readonly description: "
|
|
10
|
+
readonly description: "A formfactor for processing spreadsheet-like data in CSV format, enabling AI transformations on tabular data";
|
|
10
11
|
readonly documentationUrl: "https://github.com/webgptorg/promptbook/discussions/176";
|
|
11
12
|
readonly pipelineInterface: {
|
|
12
13
|
readonly inputParameters: readonly [{
|
|
@@ -13,7 +13,7 @@ export declare function cacheLlmTools<TLlmTools extends LlmExecutionTools>(llmTo
|
|
|
13
13
|
/**
|
|
14
14
|
* TODO: [🧠][💸] Maybe make some common abstraction `interceptLlmTools` and use here (or use javascript Proxy?)
|
|
15
15
|
* TODO: [🧠] Is there some meaningfull way how to test this util
|
|
16
|
-
* TODO: [👷♂️]
|
|
17
|
-
*
|
|
18
|
-
*
|
|
16
|
+
* TODO: [👷♂️] Comprehensive manual about construction of llmTools
|
|
17
|
+
* Detailed explanation about caching strategies and appropriate storage selection for different use cases
|
|
18
|
+
* Examples of how to combine multiple interceptors for advanced caching, logging, and usage tracking
|
|
19
19
|
*/
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { really_any } from '../organization/really_any';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Safely retrieves the global scope object (window in browser, global in Node.js)
|
|
4
|
+
* regardless of the JavaScript environment in which the code is running
|
|
4
5
|
*
|
|
5
6
|
* Note: `$` is used to indicate that this function is not a pure function - it access global scope
|
|
6
7
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/remote-server",
|
|
3
|
-
"version": "0.92.0-
|
|
3
|
+
"version": "0.92.0-24",
|
|
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,
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"module": "./esm/index.es.js",
|
|
52
52
|
"typings": "./esm/typings/src/_packages/remote-server.index.d.ts",
|
|
53
53
|
"peerDependencies": {
|
|
54
|
-
"@promptbook/core": "0.92.0-
|
|
54
|
+
"@promptbook/core": "0.92.0-24"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"colors": "1.4.0",
|
package/umd/index.umd.js
CHANGED
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
* @generated
|
|
49
49
|
* @see https://github.com/webgptorg/promptbook
|
|
50
50
|
*/
|
|
51
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.92.0-
|
|
51
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.92.0-24';
|
|
52
52
|
/**
|
|
53
53
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
54
54
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -116,11 +116,20 @@
|
|
|
116
116
|
*/
|
|
117
117
|
const DEFAULT_MAX_FILE_SIZE = 100 * 1024 * 1024; // 100MB
|
|
118
118
|
/**
|
|
119
|
-
*
|
|
119
|
+
* Threshold value that determines when a dataset is considered "big"
|
|
120
|
+
* and may require special handling or optimizations
|
|
121
|
+
*
|
|
122
|
+
* For example, when error occurs in one item of the big dataset, it will not fail the whole pipeline
|
|
120
123
|
*
|
|
121
124
|
* @public exported from `@promptbook/core`
|
|
122
125
|
*/
|
|
123
126
|
const BIG_DATASET_TRESHOLD = 50;
|
|
127
|
+
/**
|
|
128
|
+
* Placeholder text used to represent a placeholder value of failed operation
|
|
129
|
+
*
|
|
130
|
+
* @public exported from `@promptbook/core`
|
|
131
|
+
*/
|
|
132
|
+
const FAILED_VALUE_PLACEHOLDER = '!?';
|
|
124
133
|
// <- TODO: [🧠] Better system for generator warnings - not always "code" and "by `@promptbook/cli`"
|
|
125
134
|
/**
|
|
126
135
|
* The maximum number of iterations for a loops
|
|
@@ -2507,7 +2516,7 @@
|
|
|
2507
2516
|
/**
|
|
2508
2517
|
* Constructs a pipeline collection from pipelines
|
|
2509
2518
|
*
|
|
2510
|
-
* @param pipelines
|
|
2519
|
+
* @param pipelines Array of pipeline JSON objects to include in the collection
|
|
2511
2520
|
*
|
|
2512
2521
|
* Note: During the construction logic of all pipelines are validated
|
|
2513
2522
|
* Note: It is not recommended to use this constructor directly, use `createCollectionFromJson` *(or other variant)* instead
|
|
@@ -3038,7 +3047,8 @@
|
|
|
3038
3047
|
*/
|
|
3039
3048
|
|
|
3040
3049
|
/**
|
|
3041
|
-
*
|
|
3050
|
+
* Safely retrieves the global scope object (window in browser, global in Node.js)
|
|
3051
|
+
* regardless of the JavaScript environment in which the code is running
|
|
3042
3052
|
*
|
|
3043
3053
|
* Note: `$` is used to indicate that this function is not a pure function - it access global scope
|
|
3044
3054
|
*
|
|
@@ -4525,6 +4535,15 @@
|
|
|
4525
4535
|
mappedData.push(mappedRow);
|
|
4526
4536
|
if (onProgress) {
|
|
4527
4537
|
// Note: Report the CSV with all rows mapped so far
|
|
4538
|
+
/*
|
|
4539
|
+
!!!!
|
|
4540
|
+
// Report progress with updated value
|
|
4541
|
+
const progressData = mappedData.map((row, i) =>
|
|
4542
|
+
i > index ? { ...row, [outputParameterName]: PENDING_VALUE_PLACEHOLDER } : row,
|
|
4543
|
+
);
|
|
4544
|
+
|
|
4545
|
+
|
|
4546
|
+
*/
|
|
4528
4547
|
await onProgress(papaparse.unparse(mappedData, { ...settings, ...MANDATORY_CSV_SETTINGS }));
|
|
4529
4548
|
}
|
|
4530
4549
|
}
|
|
@@ -5550,7 +5569,7 @@
|
|
|
5550
5569
|
`));
|
|
5551
5570
|
if (length > BIG_DATASET_TRESHOLD) {
|
|
5552
5571
|
console.error(highLevelError);
|
|
5553
|
-
return
|
|
5572
|
+
return FAILED_VALUE_PLACEHOLDER;
|
|
5554
5573
|
}
|
|
5555
5574
|
throw highLevelError;
|
|
5556
5575
|
}
|
|
@@ -5581,7 +5600,7 @@
|
|
|
5581
5600
|
${block(pipelineIdentification)}
|
|
5582
5601
|
Subparameter index: ${index}
|
|
5583
5602
|
`));
|
|
5584
|
-
return
|
|
5603
|
+
return FAILED_VALUE_PLACEHOLDER;
|
|
5585
5604
|
}
|
|
5586
5605
|
throw error;
|
|
5587
5606
|
}
|