@promptbook/cli 0.78.2 → 0.78.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.
- package/README.md +2 -2
- package/esm/index.es.js +19 -7
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/types.index.d.ts +0 -2
- package/esm/typings/src/commands/_common/types/CommandType.d.ts +1 -1
- package/package.json +1 -1
- package/umd/index.umd.js +19 -7
- package/umd/index.umd.js.map +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<!-- ⚠️ WARNING: This code has been generated so that any manual changes will be overwritten -->
|
|
2
2
|
|
|
3
|
-
#
|
|
3
|
+
# ❄ Promptbook
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
##
|
|
17
|
+
## ❄ New Features
|
|
18
18
|
|
|
19
19
|
- 💙 Working [the **Book** language v1.0.0](https://github.com/webgptorg/book)
|
|
20
20
|
- 🖤 Run books from CLI - `npx ptbk run path/to/your/book`
|
package/esm/index.es.js
CHANGED
|
@@ -37,7 +37,7 @@ var BOOK_LANGUAGE_VERSION = '1.0.0';
|
|
|
37
37
|
*
|
|
38
38
|
* @see https://github.com/webgptorg/promptbook
|
|
39
39
|
*/
|
|
40
|
-
var PROMPTBOOK_ENGINE_VERSION = '0.78.
|
|
40
|
+
var PROMPTBOOK_ENGINE_VERSION = '0.78.3';
|
|
41
41
|
/**
|
|
42
42
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
43
43
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -3828,20 +3828,32 @@ function extractVariablesFromScript(script) {
|
|
|
3828
3828
|
if (!(error instanceof ReferenceError)) {
|
|
3829
3829
|
throw error;
|
|
3830
3830
|
}
|
|
3831
|
-
var undefinedName = error.message.split(' ')[0];
|
|
3832
3831
|
/*
|
|
3833
3832
|
Note: Parsing the error
|
|
3833
|
+
🌟 Most devices:
|
|
3834
3834
|
[PipelineUrlError: thing is not defined]
|
|
3835
|
+
|
|
3836
|
+
🍏 iPhone`s Safari:
|
|
3837
|
+
[PipelineUrlError: Can't find variable: thing]
|
|
3835
3838
|
*/
|
|
3836
|
-
|
|
3839
|
+
var variableName = undefined;
|
|
3840
|
+
if (error.message.startsWith("Can't")) {
|
|
3841
|
+
// 🍏 Case
|
|
3842
|
+
variableName = error.message.split(' ').pop();
|
|
3843
|
+
}
|
|
3844
|
+
else {
|
|
3845
|
+
// 🌟 Case
|
|
3846
|
+
variableName = error.message.split(' ').shift();
|
|
3847
|
+
}
|
|
3848
|
+
if (variableName === undefined) {
|
|
3837
3849
|
throw error;
|
|
3838
3850
|
}
|
|
3839
|
-
if (script.includes(
|
|
3840
|
-
script = "const ".concat(
|
|
3851
|
+
if (script.includes(variableName + '(')) {
|
|
3852
|
+
script = "const ".concat(variableName, " = ()=>'';") + script;
|
|
3841
3853
|
}
|
|
3842
3854
|
else {
|
|
3843
|
-
variables.add(
|
|
3844
|
-
script = "const ".concat(
|
|
3855
|
+
variables.add(variableName);
|
|
3856
|
+
script = "const ".concat(variableName, " = '';") + script;
|
|
3845
3857
|
}
|
|
3846
3858
|
}
|
|
3847
3859
|
}
|