@promptbook/markdown-utils 0.75.1 → 0.75.3

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.
@@ -20,7 +20,3 @@ export type PipelineInterface = {
20
20
  */
21
21
  readonly outputParameters: ReadonlyArray<OutputParameterJson>;
22
22
  };
23
- /**
24
- * TODO: [🧠][🤓] How to pass optional parameters - for example summary in FORMFACTOR Translator
25
- * TODO: [🧠] Better name than `PipelineInterface` to avoid confusion with typescript `interface`
26
- */
@@ -3,11 +3,9 @@ import type { PipelineInterface } from './PipelineInterface';
3
3
  /**
4
4
  * @@@
5
5
  *
6
+ * @deprecated https://github.com/webgptorg/promptbook/pull/186
6
7
  * @see https://github.com/webgptorg/promptbook/discussions/171
7
8
  *
8
9
  * @public exported from `@promptbook/core`
9
10
  */
10
11
  export declare function getPipelineInterface(pipeline: PipelineJson): PipelineInterface;
11
- /**
12
- * TODO: !!!!!! Write unit test
13
- */
@@ -18,12 +18,9 @@ export type IsPipelineImplementingInterfaceOptions = {
18
18
  /**
19
19
  * @@@
20
20
  *
21
+ * @deprecated https://github.com/webgptorg/promptbook/pull/186
21
22
  * @see https://github.com/webgptorg/promptbook/discussions/171
22
23
  *
23
24
  * @public exported from `@promptbook/core`
24
25
  */
25
26
  export declare function isPipelineImplementingInterface(options: IsPipelineImplementingInterfaceOptions): boolean;
26
- /**
27
- * TODO: !!!!!! Test real implementing NOT equality
28
- * TODO: !!!!!! Write unit test
29
- */
@@ -2,12 +2,9 @@ import type { PipelineInterface } from './PipelineInterface';
2
2
  /**
3
3
  * @@@
4
4
  *
5
+ * @deprecated https://github.com/webgptorg/promptbook/pull/186
5
6
  * @see https://github.com/webgptorg/promptbook/discussions/171
6
7
  *
7
8
  * @public exported from `@promptbook/core`
8
9
  */
9
10
  export declare function isPipelineInterfacesEqual(pipelineInterface1: PipelineInterface, pipelineInterface2: PipelineInterface): boolean;
10
- /**
11
- * TODO: [🧠] !!! Return more states than true/false - 'IDENTICAL' |'IDENTICAL_UNPREPARED' | 'IDENTICAL_INTERFACE' | 'DIFFERENT'
12
- * TODO: !!! Write unit test
13
- */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/markdown-utils",
3
- "version": "0.75.1",
3
+ "version": "0.75.3",
4
4
  "description": "It's time for a paradigm shift. The future of software in plain English, French or Latin",
5
5
  "--note-0": " <- [🐊]",
6
6
  "private": false,
package/umd/index.umd.js CHANGED
@@ -22,7 +22,7 @@
22
22
  *
23
23
  * @see https://github.com/webgptorg/promptbook
24
24
  */
25
- var PROMPTBOOK_ENGINE_VERSION = '0.75.0';
25
+ var PROMPTBOOK_ENGINE_VERSION = '0.75.2';
26
26
  /**
27
27
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
28
28
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -1331,7 +1331,6 @@
1331
1331
  while (unresovedTasks.length > 0) {
1332
1332
  _loop_3();
1333
1333
  }
1334
- // TODO: !!!!!! Test that pipeline interface implements declared formfactor interface
1335
1334
  }
1336
1335
  /**
1337
1336
  * TODO: !! [🧞‍♀️] Do not allow joker + foreach
@@ -3051,16 +3050,16 @@
3051
3050
  * Mixes registered scrapers from $scrapersMetadataRegister and $scrapersRegister
3052
3051
  */
3053
3052
  var all = [];
3054
- var _loop_1 = function (packageName, className) {
3053
+ var _loop_1 = function (packageName, className, mimeTypes, documentationUrl, isAvilableInBrowser) {
3055
3054
  if (all.some(function (item) { return item.packageName === packageName && item.className === className; })) {
3056
3055
  return "continue";
3057
3056
  }
3058
- all.push({ packageName: packageName, className: className });
3057
+ all.push({ packageName: packageName, className: className, mimeTypes: mimeTypes, documentationUrl: documentationUrl, isAvilableInBrowser: isAvilableInBrowser });
3059
3058
  };
3060
3059
  try {
3061
3060
  for (var _c = __values($scrapersMetadataRegister.list()), _d = _c.next(); !_d.done; _d = _c.next()) {
3062
- var _e = _d.value, packageName = _e.packageName, className = _e.className;
3063
- _loop_1(packageName, className);
3061
+ var _e = _d.value, packageName = _e.packageName, className = _e.className, mimeTypes = _e.mimeTypes, documentationUrl = _e.documentationUrl, isAvilableInBrowser = _e.isAvilableInBrowser;
3062
+ _loop_1(packageName, className, mimeTypes, documentationUrl, isAvilableInBrowser);
3064
3063
  }
3065
3064
  }
3066
3065
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
@@ -3070,16 +3069,16 @@
3070
3069
  }
3071
3070
  finally { if (e_1) throw e_1.error; }
3072
3071
  }
3073
- var _loop_2 = function (packageName, className) {
3072
+ var _loop_2 = function (packageName, className, mimeTypes, documentationUrl, isAvilableInBrowser) {
3074
3073
  if (all.some(function (item) { return item.packageName === packageName && item.className === className; })) {
3075
3074
  return "continue";
3076
3075
  }
3077
- all.push({ packageName: packageName, className: className });
3076
+ all.push({ packageName: packageName, className: className, mimeTypes: mimeTypes, documentationUrl: documentationUrl, isAvilableInBrowser: isAvilableInBrowser });
3078
3077
  };
3079
3078
  try {
3080
3079
  for (var _f = __values($scrapersRegister.list()), _g = _f.next(); !_g.done; _g = _f.next()) {
3081
- var _h = _g.value, packageName = _h.packageName, className = _h.className;
3082
- _loop_2(packageName, className);
3080
+ var _h = _g.value, packageName = _h.packageName, className = _h.className, mimeTypes = _h.mimeTypes, documentationUrl = _h.documentationUrl, isAvilableInBrowser = _h.isAvilableInBrowser;
3081
+ _loop_2(packageName, className, mimeTypes, documentationUrl, isAvilableInBrowser);
3083
3082
  }
3084
3083
  }
3085
3084
  catch (e_2_1) { e_2 = { error: e_2_1 }; }
@@ -3109,29 +3108,33 @@
3109
3108
  }
3110
3109
  return spaceTrim__default["default"](function (block) { return "\n Available scrapers are:\n ".concat(block(metadata
3111
3110
  .map(function (_a, i) {
3112
- var packageName = _a.packageName, className = _a.className, isMetadataAviailable = _a.isMetadataAviailable, isInstalled = _a.isInstalled;
3111
+ var packageName = _a.packageName, className = _a.className, isMetadataAviailable = _a.isMetadataAviailable, isInstalled = _a.isInstalled, mimeTypes = _a.mimeTypes, isAvilableInBrowser = _a.isAvilableInBrowser;
3113
3112
  var more;
3113
+ // TODO: Use documentationUrl
3114
3114
  if (just(false)) {
3115
3115
  more = '';
3116
3116
  }
3117
3117
  else if (!isMetadataAviailable && !isInstalled) {
3118
3118
  // TODO: [�][�] Maybe do allow to do auto-install if package not registered and not found
3119
- more = "(not installed and no metadata, looks like a unexpected behavior)";
3119
+ more = "*(not installed and no metadata, looks like a unexpected behavior)*";
3120
3120
  }
3121
3121
  else if (isMetadataAviailable && !isInstalled) {
3122
3122
  // TODO: [�][�]
3123
- more = "(not installed)";
3123
+ more = "*(not installed)*";
3124
3124
  }
3125
3125
  else if (!isMetadataAviailable && isInstalled) {
3126
- more = "(no metadata, looks like a unexpected behavior)";
3126
+ more = "*(no metadata, looks like a unexpected behavior)*";
3127
3127
  }
3128
3128
  else if (isMetadataAviailable && isInstalled) {
3129
3129
  more = "(installed)";
3130
3130
  }
3131
3131
  else {
3132
- more = "(unknown state, looks like a unexpected behavior)";
3132
+ more = "*(unknown state, looks like a unexpected behavior)*";
3133
3133
  }
3134
- return "".concat(i + 1, ") `").concat(className, "` from `").concat(packageName, "` ").concat(more);
3134
+ if (!isAvilableInBrowser) {
3135
+ more += " *(not available in browser)*";
3136
+ }
3137
+ return "".concat(i + 1, ") `").concat(className, "` from `").concat(packageName, "` compatible to scrape ").concat(mimeTypes.join(', '), " ").concat(more);
3135
3138
  })
3136
3139
  .join('\n')), "\n "); });
3137
3140
  }
@@ -3428,7 +3431,10 @@
3428
3431
  return [7 /*endfinally*/];
3429
3432
  case 9:
3430
3433
  if (partialPieces === null) {
3431
- throw new KnowledgeScrapeError(spaceTrim__default["default"](function (block) { return "\n Cannot scrape knowledge from source: ".concat(knowledgeSource.sourceContent, "\n\n No scraper found for the mime type \"").concat(sourceHandler.mimeType, "\"\n\n ").concat(block($registeredScrapersMessage()), "\n\n\n "); }));
3434
+ throw new KnowledgeScrapeError(spaceTrim__default["default"](function (block) { return "\n Cannot scrape knowledge from source:\n \n > ".concat(block(knowledgeSource.sourceContent
3435
+ .split('\n')
3436
+ .map(function (line) { return "> ".concat(line); })
3437
+ .join('\n')), "\n\n No scraper found for the mime type \"").concat(sourceHandler.mimeType, "\"\n\n ").concat(block($registeredScrapersMessage()), "\n\n\n "); }));
3432
3438
  }
3433
3439
  pieces = partialPieces.map(function (partialPiece) { return (__assign(__assign({}, partialPiece), { sources: [
3434
3440
  {