@promptbook/templates 0.85.0-9 → 0.85.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 CHANGED
@@ -24,10 +24,6 @@
24
24
 
25
25
 
26
26
 
27
- <blockquote style="color: #ff8811">
28
- <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>.
29
- </blockquote>
30
-
31
27
  ## 📦 Package `@promptbook/templates`
32
28
 
33
29
  - Promptbooks are [divided into several](#-packages) packages, all are published from [single monorepo](https://github.com/webgptorg/promptbook).
package/esm/index.es.js CHANGED
@@ -16,7 +16,7 @@ var BOOK_LANGUAGE_VERSION = '1.0.0';
16
16
  * @generated
17
17
  * @see https://github.com/webgptorg/promptbook
18
18
  */
19
- var PROMPTBOOK_ENGINE_VERSION = '0.85.0-8';
19
+ var PROMPTBOOK_ENGINE_VERSION = '0.85.0-16';
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
@@ -955,57 +955,6 @@ function isValidPromptbookVersion(version) {
955
955
  return true;
956
956
  }
957
957
 
958
- /**
959
- * Checks if an URL is reserved for private networks or localhost.
960
- *
961
- * Note: There are two simmilar functions:
962
- * - `isUrlOnPrivateNetwork` which tests full URL
963
- * - `isHostnameOnPrivateNetwork` *(this one)* which tests just hostname
964
- *
965
- * @public exported from `@promptbook/utils`
966
- */
967
- function isHostnameOnPrivateNetwork(hostname) {
968
- if (hostname === 'example.com' ||
969
- hostname === 'localhost' ||
970
- hostname.endsWith('.localhost') ||
971
- hostname.endsWith('.local') ||
972
- hostname.endsWith('.test') ||
973
- hostname === '127.0.0.1' ||
974
- hostname === '::1') {
975
- return true;
976
- }
977
- if (hostname.includes(':')) {
978
- // IPv6
979
- var ipParts = hostname.split(':');
980
- return ipParts[0] === 'fc00' || ipParts[0] === 'fd00' || ipParts[0] === 'fe80';
981
- }
982
- else {
983
- // IPv4
984
- var ipParts = hostname.split('.').map(function (part) { return Number.parseInt(part, 10); });
985
- return (ipParts[0] === 10 ||
986
- (ipParts[0] === 172 && ipParts[1] >= 16 && ipParts[1] <= 31) ||
987
- (ipParts[0] === 192 && ipParts[1] === 168));
988
- }
989
- }
990
-
991
- /**
992
- * Checks if an IP address or hostname is reserved for private networks or localhost.
993
- *
994
- * Note: There are two simmilar functions:
995
- * - `isUrlOnPrivateNetwork` *(this one)* which tests full URL
996
- * - `isHostnameOnPrivateNetwork` which tests just hostname
997
- *
998
- * @param {string} ipAddress - The IP address to check.
999
- * @returns {boolean} Returns true if the IP address is reserved for private networks or localhost, otherwise false.
1000
- * @public exported from `@promptbook/utils`
1001
- */
1002
- function isUrlOnPrivateNetwork(url) {
1003
- if (typeof url === 'string') {
1004
- url = new URL(url);
1005
- }
1006
- return isHostnameOnPrivateNetwork(url.hostname);
1007
- }
1008
-
1009
958
  /**
1010
959
  * Tests if given string is valid pipeline URL URL.
1011
960
  *
@@ -1019,16 +968,19 @@ function isValidPipelineUrl(url) {
1019
968
  if (!isValidUrl(url)) {
1020
969
  return false;
1021
970
  }
1022
- if (!url.startsWith('https://')) {
971
+ if (!url.startsWith('https://') && !url.startsWith('http://') /* <- Note: [👣] */) {
1023
972
  return false;
1024
973
  }
1025
974
  if (url.includes('#')) {
1026
975
  // TODO: [🐠]
1027
976
  return false;
1028
977
  }
978
+ /*
979
+ Note: [👣][🧠] Is it secure to allow pipeline URLs on private and unsecured networks?
1029
980
  if (isUrlOnPrivateNetwork(url)) {
1030
981
  return false;
1031
982
  }
983
+ */
1032
984
  return true;
1033
985
  }
1034
986
  /**
@@ -1649,7 +1601,7 @@ function getTemplatesPipelineCollection() {
1649
1601
  "preparations": [
1650
1602
  {
1651
1603
  "id": 1,
1652
- "promptbookVersion": "0.85.0-8",
1604
+ "promptbookVersion": "0.85.0-16",
1653
1605
  "usage": {
1654
1606
  "price": {
1655
1607
  "value": 0.005748
@@ -2039,7 +1991,7 @@ function getTemplatesPipelineCollection() {
2039
1991
  "preparations": [
2040
1992
  {
2041
1993
  "id": 1,
2042
- "promptbookVersion": "0.85.0-8",
1994
+ "promptbookVersion": "0.85.0-16",
2043
1995
  "usage": {
2044
1996
  "price": {
2045
1997
  "value": 0.005748
@@ -2561,7 +2513,7 @@ function getTemplatesPipelineCollection() {
2561
2513
  "preparations": [
2562
2514
  {
2563
2515
  "id": 1,
2564
- "promptbookVersion": "0.85.0-8",
2516
+ "promptbookVersion": "0.85.0-16",
2565
2517
  "usage": {
2566
2518
  "price": {
2567
2519
  "value": 0.005745
@@ -2627,7 +2579,7 @@ function getTemplatesPipelineCollection() {
2627
2579
  "sourceFile": "./book/books/templates/corrector.book.md"
2628
2580
  }, {
2629
2581
  "title": "💌 Generate a letter",
2630
- "pipelineUrl": "https://github.com/webgptorg/book/blob/main/books/templates//book/books/templates/generator.book.md",
2582
+ "pipelineUrl": "https://github.com/webgptorg/book/blob/main/books/templates//templates/generator.book.md",
2631
2583
  "formfactorName": "GENERATOR",
2632
2584
  "parameters": [
2633
2585
  {
@@ -2683,7 +2635,7 @@ function getTemplatesPipelineCollection() {
2683
2635
  "preparations": [
2684
2636
  {
2685
2637
  "id": 1,
2686
- "promptbookVersion": "0.85.0-8",
2638
+ "promptbookVersion": "0.85.0-16",
2687
2639
  "usage": {
2688
2640
  "price": {
2689
2641
  "value": 0.005595
@@ -2749,7 +2701,7 @@ function getTemplatesPipelineCollection() {
2749
2701
  "sourceFile": "./book/books/templates/generator.book.md"
2750
2702
  }, {
2751
2703
  "title": "😂 Joke Generator",
2752
- "pipelineUrl": "https://github.com/webgptorg/book/blob/main/books/templates//book/books/templates/generic.book.md",
2704
+ "pipelineUrl": "https://github.com/webgptorg/book/blob/main/books/templates//templates/generic.book.md",
2753
2705
  "formfactorName": "GENERIC",
2754
2706
  "parameters": [
2755
2707
  {
@@ -2779,7 +2731,7 @@ function getTemplatesPipelineCollection() {
2779
2731
  "preparations": [
2780
2732
  {
2781
2733
  "id": 1,
2782
- "promptbookVersion": "0.85.0-8",
2734
+ "promptbookVersion": "0.85.0-16",
2783
2735
  "usage": {
2784
2736
  "price": {
2785
2737
  "value": 0
@@ -2896,7 +2848,7 @@ function getTemplatesPipelineCollection() {
2896
2848
  "preparations": [
2897
2849
  {
2898
2850
  "id": 1,
2899
- "promptbookVersion": "0.85.0-8",
2851
+ "promptbookVersion": "0.85.0-16",
2900
2852
  "usage": {
2901
2853
  "price": {
2902
2854
  "value": 0.005172
@@ -3026,7 +2978,7 @@ function getTemplatesPipelineCollection() {
3026
2978
  "preparations": [
3027
2979
  {
3028
2980
  "id": 1,
3029
- "promptbookVersion": "0.85.0-8",
2981
+ "promptbookVersion": "0.85.0-16",
3030
2982
  "usage": {
3031
2983
  "price": {
3032
2984
  "value": 0.005247
@@ -3302,7 +3254,7 @@ function getTemplatesPipelineCollection() {
3302
3254
  "preparations": [
3303
3255
  {
3304
3256
  "id": 1,
3305
- "promptbookVersion": "0.85.0-8",
3257
+ "promptbookVersion": "0.85.0-16",
3306
3258
  "usage": {
3307
3259
  "price": {
3308
3260
  "value": 0.00585