@promptbook/editable 0.85.0-9 → 0.86.0-2
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 +9 -25
- package/esm/index.es.js +12 -60
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/cli/promptbookCli.d.ts +1 -1
- package/esm/typings/src/collection/collectionToJson.test.d.ts +1 -1
- package/esm/typings/src/collection/constructors/createCollectionFromDirectory.d.ts +3 -3
- package/esm/typings/src/commands/FOREACH/foreachCommandParser.d.ts +1 -1
- package/esm/typings/src/commands/FORMFACTOR/formfactorCommandParser.d.ts +1 -1
- package/esm/typings/src/commands/_BOILERPLATE/boilerplateCommandParser.d.ts +1 -1
- package/esm/typings/src/conversion/validation/_importPipeline.d.ts +2 -2
- package/esm/typings/src/pipeline/PipelineJson/PipelineJson.d.ts +2 -2
- package/esm/typings/src/types/Prompt.d.ts +1 -1
- package/esm/typings/src/types/typeAliases.d.ts +2 -2
- package/esm/typings/src/utils/editable/utils/stringifyPipelineJson.d.ts +1 -1
- package/esm/typings/src/wizzard/wizzard.d.ts +6 -6
- package/package.json +3 -3
- package/umd/index.umd.js +12 -60
- package/umd/index.umd.js.map +1 -1
package/README.md
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
## 🌟 New Features
|
|
18
18
|
|
|
19
|
+
- 📂 We have plugin for [VSCode](https://github.com/webgptorg/book-extension) to support `.book` file extension
|
|
19
20
|
- 💫 Support of [`o3-mini` model by OpenAI](https://openai.com/index/openai-o3-mini/)
|
|
20
21
|
- 🐋 **Support of [DeepSeek models](https://www.npmjs.com/package/@promptbook/deepseek)**
|
|
21
22
|
- 💙 Working [the **Book** language v1.0.0](https://github.com/webgptorg/book)
|
|
@@ -61,7 +62,7 @@ Rest of the documentation is common for **entire promptbook ecosystem**:
|
|
|
61
62
|
|
|
62
63
|
During the computer revolution, we have seen [multiple generations of computer languages](https://github.com/webgptorg/promptbook/discussions/180), from the physical rewiring of the vacuum tubes through low-level machine code to the high-level languages like Python or JavaScript. And now, we're on the edge of the **next revolution**!
|
|
63
64
|
|
|
64
|
-
It's a revolution of writing software in plain human language that is understandable and executable by both humans and machines – and it's going to change everything!
|
|
65
|
+
It's a revolution of writing software in **plain human language** that is understandable and executable by both humans and machines – and it's going to change everything!
|
|
65
66
|
|
|
66
67
|
The incredible growth in power of microprocessors and the Moore's Law have been the driving force behind the ever-more powerful languages, and it's been an amazing journey! Similarly, the large language models (like GPT or Claude) are the next big thing in language technology, and they're set to transform the way we interact with computers.
|
|
67
68
|
|
|
@@ -90,41 +91,24 @@ Promptbook project is ecosystem of multiple projects and tools, following is a l
|
|
|
90
91
|
<thead>
|
|
91
92
|
<tr>
|
|
92
93
|
<th>Project</th>
|
|
93
|
-
<th>
|
|
94
|
-
<th>Link</th>
|
|
94
|
+
<th>About</th>
|
|
95
95
|
</tr>
|
|
96
96
|
</thead>
|
|
97
97
|
<tbody>
|
|
98
98
|
<tr>
|
|
99
|
-
<td>
|
|
100
|
-
<td>Promptbook Core is a description and documentation of the basic concepts, ideas and inner workings of how Promptbook should be implemented, and defines what features must be describable by book language.</td>
|
|
101
|
-
<td rowspan=2>https://github.com/webgptorg/book</td>
|
|
102
|
-
</tr>
|
|
103
|
-
<tr>
|
|
104
|
-
<td>Book language</td>
|
|
99
|
+
<td><a href="https://github.com/webgptorg/book">Book language</a></td>
|
|
105
100
|
<td>
|
|
106
|
-
Book is a markdown-like language to define core entities like
|
|
101
|
+
Book is a markdown-like language to define core entities like personas, knowledge, tasks,.... It is designed to be understandable by non-programmers and non-technical people<hr>
|
|
102
|
+
There is also <a href="https://github.com/webgptorg/book-extension">a plugin for VSCode</a> to support <code>.book</code> file extension
|
|
107
103
|
</td>
|
|
108
104
|
</tr>
|
|
109
105
|
<tr>
|
|
110
|
-
<td>Promptbook
|
|
111
|
-
<td>Promptbook implementation in TypeScript released as multiple NPM packages</td>
|
|
112
|
-
<td>https://github.com/webgptorg/promptbook + <a href="https://www.npmjs.com/package/@promptbook/core#-packages-for-developers">Multiple packages published on NPM</a></td>
|
|
106
|
+
<td><a href="https://github.com/webgptorg/promptbook">Promptbook Engine</a></td>
|
|
107
|
+
<td>Promptbook implementation in TypeScript released as <a href="https://www.npmjs.com/package/@promptbook/core#-packages-for-developers">multiple NPM packages</a> and <a href="https://hub.docker.com/r/hejny/promptbook">Docker HUB</a></td>
|
|
113
108
|
</tr>
|
|
114
109
|
<tr>
|
|
115
|
-
<td>Promptbook
|
|
110
|
+
<td><a href="https://promptbook.studio">Promptbook Studio</a></td>
|
|
116
111
|
<td>Studio to write Books and instantly publish them as miniapps</td>
|
|
117
|
-
<td>
|
|
118
|
-
https://promptbook.studio<br/>
|
|
119
|
-
https://github.com/hejny/promptbook-studio</td>
|
|
120
|
-
</tr><tr>
|
|
121
|
-
<td>Hello World</td>
|
|
122
|
-
<td>Simple starter kit with Books integrated into the sample applications</td>
|
|
123
|
-
<td>
|
|
124
|
-
https://github.com/webgptorg/hello-world<br/>
|
|
125
|
-
https://github.com/webgptorg/hello-world-node-js<br/>
|
|
126
|
-
https://github.com/webgptorg/hello-world-next-js
|
|
127
|
-
</td>
|
|
128
112
|
</tr>
|
|
129
113
|
</tbody>
|
|
130
114
|
</table>
|
package/esm/index.es.js
CHANGED
|
@@ -17,7 +17,7 @@ var BOOK_LANGUAGE_VERSION = '1.0.0';
|
|
|
17
17
|
* @generated
|
|
18
18
|
* @see https://github.com/webgptorg/promptbook
|
|
19
19
|
*/
|
|
20
|
-
var PROMPTBOOK_ENGINE_VERSION = '0.
|
|
20
|
+
var PROMPTBOOK_ENGINE_VERSION = '0.86.0-1';
|
|
21
21
|
/**
|
|
22
22
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
23
23
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -274,7 +274,7 @@ var ParseError = /** @class */ (function (_super) {
|
|
|
274
274
|
/**
|
|
275
275
|
* Parses the boilerplate command
|
|
276
276
|
*
|
|
277
|
-
* Note: @@@ This command is used as boilerplate for new commands - it should NOT be used in any `.book
|
|
277
|
+
* Note: @@@ This command is used as boilerplate for new commands - it should NOT be used in any `.book` file
|
|
278
278
|
*
|
|
279
279
|
* @see `documentationUrl` for more details
|
|
280
280
|
* @private within the commands folder
|
|
@@ -1802,7 +1802,7 @@ function validateParameterName(parameterName) {
|
|
|
1802
1802
|
/**
|
|
1803
1803
|
* Parses the foreach command
|
|
1804
1804
|
*
|
|
1805
|
-
* Note: @@@ This command is used as foreach for new commands - it should NOT be used in any `.book
|
|
1805
|
+
* Note: @@@ This command is used as foreach for new commands - it should NOT be used in any `.book` file
|
|
1806
1806
|
*
|
|
1807
1807
|
* @see `documentationUrl` for more details
|
|
1808
1808
|
* @public exported from `@promptbook/editable`
|
|
@@ -2253,7 +2253,7 @@ var FORMFACTOR_DEFINITIONS = [
|
|
|
2253
2253
|
/**
|
|
2254
2254
|
* Parses the formfactor command
|
|
2255
2255
|
*
|
|
2256
|
-
* Note: @@@ This command is used as formfactor for new commands - it should NOT be used in any `.book
|
|
2256
|
+
* Note: @@@ This command is used as formfactor for new commands - it should NOT be used in any `.book` file
|
|
2257
2257
|
*
|
|
2258
2258
|
* @see `documentationUrl` for more details
|
|
2259
2259
|
* @public exported from `@promptbook/editable`
|
|
@@ -3353,57 +3353,6 @@ var sectionCommandParser = {
|
|
|
3353
3353
|
* ```
|
|
3354
3354
|
*/
|
|
3355
3355
|
|
|
3356
|
-
/**
|
|
3357
|
-
* Checks if an URL is reserved for private networks or localhost.
|
|
3358
|
-
*
|
|
3359
|
-
* Note: There are two simmilar functions:
|
|
3360
|
-
* - `isUrlOnPrivateNetwork` which tests full URL
|
|
3361
|
-
* - `isHostnameOnPrivateNetwork` *(this one)* which tests just hostname
|
|
3362
|
-
*
|
|
3363
|
-
* @public exported from `@promptbook/utils`
|
|
3364
|
-
*/
|
|
3365
|
-
function isHostnameOnPrivateNetwork(hostname) {
|
|
3366
|
-
if (hostname === 'example.com' ||
|
|
3367
|
-
hostname === 'localhost' ||
|
|
3368
|
-
hostname.endsWith('.localhost') ||
|
|
3369
|
-
hostname.endsWith('.local') ||
|
|
3370
|
-
hostname.endsWith('.test') ||
|
|
3371
|
-
hostname === '127.0.0.1' ||
|
|
3372
|
-
hostname === '::1') {
|
|
3373
|
-
return true;
|
|
3374
|
-
}
|
|
3375
|
-
if (hostname.includes(':')) {
|
|
3376
|
-
// IPv6
|
|
3377
|
-
var ipParts = hostname.split(':');
|
|
3378
|
-
return ipParts[0] === 'fc00' || ipParts[0] === 'fd00' || ipParts[0] === 'fe80';
|
|
3379
|
-
}
|
|
3380
|
-
else {
|
|
3381
|
-
// IPv4
|
|
3382
|
-
var ipParts = hostname.split('.').map(function (part) { return Number.parseInt(part, 10); });
|
|
3383
|
-
return (ipParts[0] === 10 ||
|
|
3384
|
-
(ipParts[0] === 172 && ipParts[1] >= 16 && ipParts[1] <= 31) ||
|
|
3385
|
-
(ipParts[0] === 192 && ipParts[1] === 168));
|
|
3386
|
-
}
|
|
3387
|
-
}
|
|
3388
|
-
|
|
3389
|
-
/**
|
|
3390
|
-
* Checks if an IP address or hostname is reserved for private networks or localhost.
|
|
3391
|
-
*
|
|
3392
|
-
* Note: There are two simmilar functions:
|
|
3393
|
-
* - `isUrlOnPrivateNetwork` *(this one)* which tests full URL
|
|
3394
|
-
* - `isHostnameOnPrivateNetwork` which tests just hostname
|
|
3395
|
-
*
|
|
3396
|
-
* @param {string} ipAddress - The IP address to check.
|
|
3397
|
-
* @returns {boolean} Returns true if the IP address is reserved for private networks or localhost, otherwise false.
|
|
3398
|
-
* @public exported from `@promptbook/utils`
|
|
3399
|
-
*/
|
|
3400
|
-
function isUrlOnPrivateNetwork(url) {
|
|
3401
|
-
if (typeof url === 'string') {
|
|
3402
|
-
url = new URL(url);
|
|
3403
|
-
}
|
|
3404
|
-
return isHostnameOnPrivateNetwork(url.hostname);
|
|
3405
|
-
}
|
|
3406
|
-
|
|
3407
3356
|
/**
|
|
3408
3357
|
* Tests if given string is valid pipeline URL URL.
|
|
3409
3358
|
*
|
|
@@ -3417,16 +3366,19 @@ function isValidPipelineUrl(url) {
|
|
|
3417
3366
|
if (!isValidUrl(url)) {
|
|
3418
3367
|
return false;
|
|
3419
3368
|
}
|
|
3420
|
-
if (!url.startsWith('https://')) {
|
|
3369
|
+
if (!url.startsWith('https://') && !url.startsWith('http://') /* <- Note: [👣] */) {
|
|
3421
3370
|
return false;
|
|
3422
3371
|
}
|
|
3423
3372
|
if (url.includes('#')) {
|
|
3424
3373
|
// TODO: [🐠]
|
|
3425
3374
|
return false;
|
|
3426
3375
|
}
|
|
3376
|
+
/*
|
|
3377
|
+
Note: [👣][🧠] Is it secure to allow pipeline URLs on private and unsecured networks?
|
|
3427
3378
|
if (isUrlOnPrivateNetwork(url)) {
|
|
3428
3379
|
return false;
|
|
3429
3380
|
}
|
|
3381
|
+
*/
|
|
3430
3382
|
return true;
|
|
3431
3383
|
}
|
|
3432
3384
|
/**
|
|
@@ -3466,9 +3418,9 @@ var urlCommandParser = {
|
|
|
3466
3418
|
* Example usages of the URL command
|
|
3467
3419
|
*/
|
|
3468
3420
|
examples: [
|
|
3469
|
-
'PIPELINE URL https://promptbook.studio/library/write-cv.book
|
|
3470
|
-
'URL https://promptbook.studio/library/write-cv.book
|
|
3471
|
-
'https://promptbook.studio/library/write-cv.book
|
|
3421
|
+
'PIPELINE URL https://promptbook.studio/library/write-cv.book',
|
|
3422
|
+
'URL https://promptbook.studio/library/write-cv.book',
|
|
3423
|
+
'https://promptbook.studio/library/write-cv.book',
|
|
3472
3424
|
],
|
|
3473
3425
|
/**
|
|
3474
3426
|
* Parses the URL command
|
|
@@ -4240,7 +4192,7 @@ function stringifyPipelineJson(pipeline) {
|
|
|
4240
4192
|
return pipelineJsonStringified;
|
|
4241
4193
|
}
|
|
4242
4194
|
/**
|
|
4243
|
-
* TODO: [🐝] Not Working propperly @see https://promptbook.studio/examples/mixed-knowledge.book
|
|
4195
|
+
* TODO: [🐝] Not Working propperly @see https://promptbook.studio/examples/mixed-knowledge.book
|
|
4244
4196
|
* TODO: [🧠][0] Maybe rename to `stringifyPipelineJson`, `stringifyIndexedJson`,...
|
|
4245
4197
|
* TODO: [🧠] Maybe more elegant solution than replacing via regex
|
|
4246
4198
|
* TODO: [🍙] Make some standard order of json properties
|