@promptbook/templates 0.86.22 → 0.86.31
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 +9 -9
- package/esm/typings/src/_packages/execute-javascript.index.d.ts +2 -0
- package/esm/typings/src/_packages/utils.index.d.ts +0 -2
- package/esm/typings/src/scripting/javascript/utils/extractVariablesFromJavascript.d.ts +14 -0
- package/esm/typings/src/scripting/javascript/utils/extractVariablesFromScript.test.d.ts +1 -0
- package/package.json +2 -2
- package/umd/index.umd.js +9 -9
- package/esm/typings/src/conversion/utils/extractVariablesFromScript.d.ts +0 -14
- /package/esm/typings/src/{conversion/utils/extractVariablesFromScript.test.d.ts → scripting/javascript/utils/extractVariablesFromJavascript.test.d.ts} +0 -0
package/esm/index.es.js
CHANGED
|
@@ -16,7 +16,7 @@ const BOOK_LANGUAGE_VERSION = '1.0.0';
|
|
|
16
16
|
* @generated
|
|
17
17
|
* @see https://github.com/webgptorg/promptbook
|
|
18
18
|
*/
|
|
19
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.86.
|
|
19
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.86.31';
|
|
20
20
|
/**
|
|
21
21
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
22
22
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -1494,7 +1494,7 @@ function getTemplatesPipelineCollection() {
|
|
|
1494
1494
|
"preparations": [
|
|
1495
1495
|
{
|
|
1496
1496
|
"id": 1,
|
|
1497
|
-
"promptbookVersion": "0.86.
|
|
1497
|
+
"promptbookVersion": "0.86.30",
|
|
1498
1498
|
"usage": {
|
|
1499
1499
|
"price": {
|
|
1500
1500
|
"value": 0.005718
|
|
@@ -2116,7 +2116,7 @@ function getTemplatesPipelineCollection() {
|
|
|
2116
2116
|
"preparations": [
|
|
2117
2117
|
{
|
|
2118
2118
|
"id": 1,
|
|
2119
|
-
"promptbookVersion": "0.86.
|
|
2119
|
+
"promptbookVersion": "0.86.30",
|
|
2120
2120
|
"usage": {
|
|
2121
2121
|
"price": {
|
|
2122
2122
|
"value": 0.005718
|
|
@@ -2894,7 +2894,7 @@ function getTemplatesPipelineCollection() {
|
|
|
2894
2894
|
"preparations": [
|
|
2895
2895
|
{
|
|
2896
2896
|
"id": 1,
|
|
2897
|
-
"promptbookVersion": "0.86.
|
|
2897
|
+
"promptbookVersion": "0.86.30",
|
|
2898
2898
|
"usage": {
|
|
2899
2899
|
"price": {
|
|
2900
2900
|
"value": 0.00588
|
|
@@ -3016,7 +3016,7 @@ function getTemplatesPipelineCollection() {
|
|
|
3016
3016
|
"preparations": [
|
|
3017
3017
|
{
|
|
3018
3018
|
"id": 1,
|
|
3019
|
-
"promptbookVersion": "0.86.
|
|
3019
|
+
"promptbookVersion": "0.86.30",
|
|
3020
3020
|
"usage": {
|
|
3021
3021
|
"price": {
|
|
3022
3022
|
"value": 0.005865
|
|
@@ -3112,7 +3112,7 @@ function getTemplatesPipelineCollection() {
|
|
|
3112
3112
|
"preparations": [
|
|
3113
3113
|
{
|
|
3114
3114
|
"id": 1,
|
|
3115
|
-
"promptbookVersion": "0.86.
|
|
3115
|
+
"promptbookVersion": "0.86.30",
|
|
3116
3116
|
"usage": {
|
|
3117
3117
|
"price": {
|
|
3118
3118
|
"value": 0
|
|
@@ -3229,7 +3229,7 @@ function getTemplatesPipelineCollection() {
|
|
|
3229
3229
|
"preparations": [
|
|
3230
3230
|
{
|
|
3231
3231
|
"id": 1,
|
|
3232
|
-
"promptbookVersion": "0.86.
|
|
3232
|
+
"promptbookVersion": "0.86.30",
|
|
3233
3233
|
"usage": {
|
|
3234
3234
|
"price": {
|
|
3235
3235
|
"value": 0.005412
|
|
@@ -3359,7 +3359,7 @@ function getTemplatesPipelineCollection() {
|
|
|
3359
3359
|
"preparations": [
|
|
3360
3360
|
{
|
|
3361
3361
|
"id": 1,
|
|
3362
|
-
"promptbookVersion": "0.86.
|
|
3362
|
+
"promptbookVersion": "0.86.30",
|
|
3363
3363
|
"usage": {
|
|
3364
3364
|
"price": {
|
|
3365
3365
|
"value": 0.005442000000000001
|
|
@@ -3669,7 +3669,7 @@ function getTemplatesPipelineCollection() {
|
|
|
3669
3669
|
"preparations": [
|
|
3670
3670
|
{
|
|
3671
3671
|
"id": 1,
|
|
3672
|
-
"promptbookVersion": "0.86.
|
|
3672
|
+
"promptbookVersion": "0.86.30",
|
|
3673
3673
|
"usage": {
|
|
3674
3674
|
"price": {
|
|
3675
3675
|
"value": 0.005895
|
|
@@ -2,7 +2,9 @@ import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
|
|
|
2
2
|
import { JavascriptEvalExecutionTools } from '../scripting/javascript/JavascriptEvalExecutionTools';
|
|
3
3
|
import { JavascriptExecutionTools } from '../scripting/javascript/JavascriptExecutionTools';
|
|
4
4
|
import { POSTPROCESSING_FUNCTIONS } from '../scripting/javascript/postprocessing-functions';
|
|
5
|
+
import { extractVariablesFromJavascript } from '../scripting/javascript/utils/extractVariablesFromJavascript';
|
|
5
6
|
export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
|
|
6
7
|
export { JavascriptEvalExecutionTools };
|
|
7
8
|
export { JavascriptExecutionTools };
|
|
8
9
|
export { POSTPROCESSING_FUNCTIONS };
|
|
10
|
+
export { extractVariablesFromJavascript };
|
|
@@ -2,7 +2,6 @@ import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
|
|
|
2
2
|
import { VALUE_STRINGS } from '../config';
|
|
3
3
|
import { SMALL_NUMBER } from '../config';
|
|
4
4
|
import { renderPromptbookMermaid } from '../conversion/prettify/renderPipelineMermaidOptions';
|
|
5
|
-
import { extractVariablesFromScript } from '../conversion/utils/extractVariablesFromScript';
|
|
6
5
|
import { deserializeError } from '../errors/utils/deserializeError';
|
|
7
6
|
import { serializeError } from '../errors/utils/serializeError';
|
|
8
7
|
import { forEachAsync } from '../execution/utils/forEachAsync';
|
|
@@ -84,7 +83,6 @@ export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
|
|
|
84
83
|
export { VALUE_STRINGS };
|
|
85
84
|
export { SMALL_NUMBER };
|
|
86
85
|
export { renderPromptbookMermaid };
|
|
87
|
-
export { extractVariablesFromScript };
|
|
88
86
|
export { deserializeError };
|
|
89
87
|
export { serializeError };
|
|
90
88
|
export { forEachAsync };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { string_javascript } from '../../../types/typeAliases';
|
|
2
|
+
import type { string_javascript_name } from '../../../types/typeAliases';
|
|
3
|
+
/**
|
|
4
|
+
* Parses the given script and returns the list of all used variables that are not defined in the script
|
|
5
|
+
*
|
|
6
|
+
* @param script from which to extract the variables
|
|
7
|
+
* @returns the list of variable names
|
|
8
|
+
* @throws {ParseError} if the script is invalid
|
|
9
|
+
* @public exported from `@promptbook/execute-javascript`
|
|
10
|
+
*/
|
|
11
|
+
export declare function extractVariablesFromJavascript(script: string_javascript): Set<string_javascript_name>;
|
|
12
|
+
/**
|
|
13
|
+
* TODO: [🔣] Support for multiple languages - python, java,...
|
|
14
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/templates",
|
|
3
|
-
"version": "0.86.
|
|
3
|
+
"version": "0.86.31",
|
|
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/templates.index.d.ts",
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@promptbook/core": "0.86.
|
|
50
|
+
"@promptbook/core": "0.86.31"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"prettier": "2.8.1",
|
package/umd/index.umd.js
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
* @generated
|
|
24
24
|
* @see https://github.com/webgptorg/promptbook
|
|
25
25
|
*/
|
|
26
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.86.
|
|
26
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.86.31';
|
|
27
27
|
/**
|
|
28
28
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
29
29
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -1501,7 +1501,7 @@
|
|
|
1501
1501
|
"preparations": [
|
|
1502
1502
|
{
|
|
1503
1503
|
"id": 1,
|
|
1504
|
-
"promptbookVersion": "0.86.
|
|
1504
|
+
"promptbookVersion": "0.86.30",
|
|
1505
1505
|
"usage": {
|
|
1506
1506
|
"price": {
|
|
1507
1507
|
"value": 0.005718
|
|
@@ -2123,7 +2123,7 @@
|
|
|
2123
2123
|
"preparations": [
|
|
2124
2124
|
{
|
|
2125
2125
|
"id": 1,
|
|
2126
|
-
"promptbookVersion": "0.86.
|
|
2126
|
+
"promptbookVersion": "0.86.30",
|
|
2127
2127
|
"usage": {
|
|
2128
2128
|
"price": {
|
|
2129
2129
|
"value": 0.005718
|
|
@@ -2901,7 +2901,7 @@
|
|
|
2901
2901
|
"preparations": [
|
|
2902
2902
|
{
|
|
2903
2903
|
"id": 1,
|
|
2904
|
-
"promptbookVersion": "0.86.
|
|
2904
|
+
"promptbookVersion": "0.86.30",
|
|
2905
2905
|
"usage": {
|
|
2906
2906
|
"price": {
|
|
2907
2907
|
"value": 0.00588
|
|
@@ -3023,7 +3023,7 @@
|
|
|
3023
3023
|
"preparations": [
|
|
3024
3024
|
{
|
|
3025
3025
|
"id": 1,
|
|
3026
|
-
"promptbookVersion": "0.86.
|
|
3026
|
+
"promptbookVersion": "0.86.30",
|
|
3027
3027
|
"usage": {
|
|
3028
3028
|
"price": {
|
|
3029
3029
|
"value": 0.005865
|
|
@@ -3119,7 +3119,7 @@
|
|
|
3119
3119
|
"preparations": [
|
|
3120
3120
|
{
|
|
3121
3121
|
"id": 1,
|
|
3122
|
-
"promptbookVersion": "0.86.
|
|
3122
|
+
"promptbookVersion": "0.86.30",
|
|
3123
3123
|
"usage": {
|
|
3124
3124
|
"price": {
|
|
3125
3125
|
"value": 0
|
|
@@ -3236,7 +3236,7 @@
|
|
|
3236
3236
|
"preparations": [
|
|
3237
3237
|
{
|
|
3238
3238
|
"id": 1,
|
|
3239
|
-
"promptbookVersion": "0.86.
|
|
3239
|
+
"promptbookVersion": "0.86.30",
|
|
3240
3240
|
"usage": {
|
|
3241
3241
|
"price": {
|
|
3242
3242
|
"value": 0.005412
|
|
@@ -3366,7 +3366,7 @@
|
|
|
3366
3366
|
"preparations": [
|
|
3367
3367
|
{
|
|
3368
3368
|
"id": 1,
|
|
3369
|
-
"promptbookVersion": "0.86.
|
|
3369
|
+
"promptbookVersion": "0.86.30",
|
|
3370
3370
|
"usage": {
|
|
3371
3371
|
"price": {
|
|
3372
3372
|
"value": 0.005442000000000001
|
|
@@ -3676,7 +3676,7 @@
|
|
|
3676
3676
|
"preparations": [
|
|
3677
3677
|
{
|
|
3678
3678
|
"id": 1,
|
|
3679
|
-
"promptbookVersion": "0.86.
|
|
3679
|
+
"promptbookVersion": "0.86.30",
|
|
3680
3680
|
"usage": {
|
|
3681
3681
|
"price": {
|
|
3682
3682
|
"value": 0.005895
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { string_javascript } from '../../types/typeAliases';
|
|
2
|
-
import type { string_typescript } from '../../types/typeAliases';
|
|
3
|
-
/**
|
|
4
|
-
* Extract all used variable names from ginen JavaScript/TypeScript script
|
|
5
|
-
*
|
|
6
|
-
* @param script JavaScript/TypeScript script
|
|
7
|
-
* @returns Set of variable names
|
|
8
|
-
* @throws {ParseError} if the script is invalid
|
|
9
|
-
* @public exported from `@promptbook/utils` <- Note: [👖] This is usable elsewhere than in Promptbook, so keeping in utils
|
|
10
|
-
*/
|
|
11
|
-
export declare function extractVariablesFromScript(script: string_javascript | string_typescript): Set<string>;
|
|
12
|
-
/**
|
|
13
|
-
* TODO: [🔣] Support for multiple languages - python, java,...
|
|
14
|
-
*/
|