@promptbook/node 0.77.1 → 0.78.0-0
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 +4 -0
- package/esm/index.es.js +6 -5
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/core.index.d.ts +6 -0
- package/esm/typings/src/_packages/types.index.d.ts +4 -0
- package/esm/typings/src/_packages/utils.index.d.ts +4 -8
- package/esm/typings/src/commands/_common/types/CommandType.d.ts +17 -0
- package/esm/typings/src/conversion/utils/extractParameterNamesFromTask.d.ts +1 -1
- package/esm/typings/src/conversion/utils/{extractVariables.d.ts → extractVariablesFromScript.d.ts} +2 -2
- package/esm/typings/src/conversion/utils/removePipelineCommand.d.ts +22 -0
- package/esm/typings/src/conversion/utils/{renameParameter.d.ts → renamePipelineParameter.d.ts} +3 -3
- package/esm/typings/src/utils/normalization/titleToName.test.d.ts +1 -0
- package/package.json +2 -2
- package/umd/index.umd.js +6 -5
- package/umd/index.umd.js.map +1 -1
- /package/esm/typings/src/conversion/utils/{extractVariables.test.d.ts → extractVariablesFromScript.test.d.ts} +0 -0
- /package/esm/typings/src/conversion/utils/{renameParameter.test.d.ts → removePipelineCommand.test.d.ts} +0 -0
- /package/esm/typings/src/conversion/utils/{titleToName.test.d.ts → renamePipelineParameter.test.d.ts} +0 -0
- /package/esm/typings/src/{conversion/utils → utils/normalization}/titleToName.d.ts +0 -0
package/README.md
CHANGED
|
@@ -23,6 +23,10 @@
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
|
+
<blockquote style="color: #ff8811">
|
|
27
|
+
<b>⚠ Warning:</b> This is a pre-release version of the library. It is not yet ready for production use. Please look at <a href="https://www.npmjs.com/package/@promptbook/core?activeTab=versions">latest stable release</a>.
|
|
28
|
+
</blockquote>
|
|
29
|
+
|
|
26
30
|
## 📦 Package `@promptbook/node`
|
|
27
31
|
|
|
28
32
|
- Promptbooks are [divided into several](#-packages) packages, all are published from [single monorepo](https://github.com/webgptorg/promptbook).
|
package/esm/index.es.js
CHANGED
|
@@ -26,7 +26,7 @@ var BOOK_LANGUAGE_VERSION = '1.0.0';
|
|
|
26
26
|
*
|
|
27
27
|
* @see https://github.com/webgptorg/promptbook
|
|
28
28
|
*/
|
|
29
|
-
var PROMPTBOOK_ENGINE_VERSION = '0.77.
|
|
29
|
+
var PROMPTBOOK_ENGINE_VERSION = '0.77.1';
|
|
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
|
|
@@ -2320,9 +2320,9 @@ function serializeError(error) {
|
|
|
2320
2320
|
* @param script from which to extract the variables
|
|
2321
2321
|
* @returns the list of variable names
|
|
2322
2322
|
* @throws {ParseError} if the script is invalid
|
|
2323
|
-
* @public exported from `@promptbook/utils`
|
|
2323
|
+
* @public exported from `@promptbook/utils` <- Note: [👖] This is usable elsewhere than in Promptbook, so keeping in utils
|
|
2324
2324
|
*/
|
|
2325
|
-
function
|
|
2325
|
+
function extractVariablesFromScript(script) {
|
|
2326
2326
|
var variables = new Set();
|
|
2327
2327
|
script = "(()=>{".concat(script, "})()");
|
|
2328
2328
|
try {
|
|
@@ -2369,7 +2369,7 @@ function extractVariables(script) {
|
|
|
2369
2369
|
* @param task the task with used parameters
|
|
2370
2370
|
* @returns the set of parameter names
|
|
2371
2371
|
* @throws {ParseError} if the script is invalid
|
|
2372
|
-
* @public exported from `@promptbook/
|
|
2372
|
+
* @public exported from `@promptbook/core` <- Note: [👖] This utility is so tightly interconnected with the Promptbook that it is not exported as util but in core
|
|
2373
2373
|
*/
|
|
2374
2374
|
function extractParameterNamesFromTask(task) {
|
|
2375
2375
|
var e_1, _a, e_2, _b, e_3, _c, e_4, _d;
|
|
@@ -2390,7 +2390,7 @@ function extractParameterNamesFromTask(task) {
|
|
|
2390
2390
|
}
|
|
2391
2391
|
if (taskType === 'SCRIPT_TASK') {
|
|
2392
2392
|
try {
|
|
2393
|
-
for (var _g = __values(
|
|
2393
|
+
for (var _g = __values(extractVariablesFromScript(content)), _h = _g.next(); !_h.done; _h = _g.next()) {
|
|
2394
2394
|
var parameterName = _h.value;
|
|
2395
2395
|
parameterNames.add(parameterName);
|
|
2396
2396
|
}
|
|
@@ -8018,6 +8018,7 @@ function splitMarkdownIntoSections(markdown) {
|
|
|
8018
8018
|
var e_1, _a;
|
|
8019
8019
|
var lines = markdown.split('\n');
|
|
8020
8020
|
var sections = [];
|
|
8021
|
+
// TODO: [🧽] DRY
|
|
8021
8022
|
var currentType = 'MARKDOWN';
|
|
8022
8023
|
var buffer = [];
|
|
8023
8024
|
var finishSection = function () {
|