@promptbook/node 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/node",
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,
@@ -54,7 +54,7 @@
54
54
  "module": "./esm/index.es.js",
55
55
  "typings": "./esm/typings/src/_packages/node.index.d.ts",
56
56
  "peerDependencies": {
57
- "@promptbook/core": "0.75.1"
57
+ "@promptbook/core": "0.75.3"
58
58
  },
59
59
  "dependencies": {
60
60
  "colors": "1.4.0",
package/umd/index.umd.js CHANGED
@@ -43,7 +43,7 @@
43
43
  *
44
44
  * @see https://github.com/webgptorg/promptbook
45
45
  */
46
- var PROMPTBOOK_ENGINE_VERSION = '0.75.0';
46
+ var PROMPTBOOK_ENGINE_VERSION = '0.75.2';
47
47
  /**
48
48
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
49
49
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -1813,7 +1813,6 @@
1813
1813
  while (unresovedTasks.length > 0) {
1814
1814
  _loop_3();
1815
1815
  }
1816
- // TODO: !!!!!! Test that pipeline interface implements declared formfactor interface
1817
1816
  }
1818
1817
  /**
1819
1818
  * TODO: !! [🧞‍♀️] Do not allow joker + foreach
@@ -4776,16 +4775,16 @@
4776
4775
  * Mixes registered scrapers from $scrapersMetadataRegister and $scrapersRegister
4777
4776
  */
4778
4777
  var all = [];
4779
- var _loop_1 = function (packageName, className) {
4778
+ var _loop_1 = function (packageName, className, mimeTypes, documentationUrl, isAvilableInBrowser) {
4780
4779
  if (all.some(function (item) { return item.packageName === packageName && item.className === className; })) {
4781
4780
  return "continue";
4782
4781
  }
4783
- all.push({ packageName: packageName, className: className });
4782
+ all.push({ packageName: packageName, className: className, mimeTypes: mimeTypes, documentationUrl: documentationUrl, isAvilableInBrowser: isAvilableInBrowser });
4784
4783
  };
4785
4784
  try {
4786
4785
  for (var _c = __values($scrapersMetadataRegister.list()), _d = _c.next(); !_d.done; _d = _c.next()) {
4787
- var _e = _d.value, packageName = _e.packageName, className = _e.className;
4788
- _loop_1(packageName, className);
4786
+ var _e = _d.value, packageName = _e.packageName, className = _e.className, mimeTypes = _e.mimeTypes, documentationUrl = _e.documentationUrl, isAvilableInBrowser = _e.isAvilableInBrowser;
4787
+ _loop_1(packageName, className, mimeTypes, documentationUrl, isAvilableInBrowser);
4789
4788
  }
4790
4789
  }
4791
4790
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
@@ -4795,16 +4794,16 @@
4795
4794
  }
4796
4795
  finally { if (e_1) throw e_1.error; }
4797
4796
  }
4798
- var _loop_2 = function (packageName, className) {
4797
+ var _loop_2 = function (packageName, className, mimeTypes, documentationUrl, isAvilableInBrowser) {
4799
4798
  if (all.some(function (item) { return item.packageName === packageName && item.className === className; })) {
4800
4799
  return "continue";
4801
4800
  }
4802
- all.push({ packageName: packageName, className: className });
4801
+ all.push({ packageName: packageName, className: className, mimeTypes: mimeTypes, documentationUrl: documentationUrl, isAvilableInBrowser: isAvilableInBrowser });
4803
4802
  };
4804
4803
  try {
4805
4804
  for (var _f = __values($scrapersRegister.list()), _g = _f.next(); !_g.done; _g = _f.next()) {
4806
- var _h = _g.value, packageName = _h.packageName, className = _h.className;
4807
- _loop_2(packageName, className);
4805
+ var _h = _g.value, packageName = _h.packageName, className = _h.className, mimeTypes = _h.mimeTypes, documentationUrl = _h.documentationUrl, isAvilableInBrowser = _h.isAvilableInBrowser;
4806
+ _loop_2(packageName, className, mimeTypes, documentationUrl, isAvilableInBrowser);
4808
4807
  }
4809
4808
  }
4810
4809
  catch (e_2_1) { e_2 = { error: e_2_1 }; }
@@ -4834,29 +4833,33 @@
4834
4833
  }
4835
4834
  return spaceTrim__default["default"](function (block) { return "\n Available scrapers are:\n ".concat(block(metadata
4836
4835
  .map(function (_a, i) {
4837
- var packageName = _a.packageName, className = _a.className, isMetadataAviailable = _a.isMetadataAviailable, isInstalled = _a.isInstalled;
4836
+ var packageName = _a.packageName, className = _a.className, isMetadataAviailable = _a.isMetadataAviailable, isInstalled = _a.isInstalled, mimeTypes = _a.mimeTypes, isAvilableInBrowser = _a.isAvilableInBrowser;
4838
4837
  var more;
4838
+ // TODO: Use documentationUrl
4839
4839
  if (just(false)) {
4840
4840
  more = '';
4841
4841
  }
4842
4842
  else if (!isMetadataAviailable && !isInstalled) {
4843
4843
  // TODO: [�][�] Maybe do allow to do auto-install if package not registered and not found
4844
- more = "(not installed and no metadata, looks like a unexpected behavior)";
4844
+ more = "*(not installed and no metadata, looks like a unexpected behavior)*";
4845
4845
  }
4846
4846
  else if (isMetadataAviailable && !isInstalled) {
4847
4847
  // TODO: [�][�]
4848
- more = "(not installed)";
4848
+ more = "*(not installed)*";
4849
4849
  }
4850
4850
  else if (!isMetadataAviailable && isInstalled) {
4851
- more = "(no metadata, looks like a unexpected behavior)";
4851
+ more = "*(no metadata, looks like a unexpected behavior)*";
4852
4852
  }
4853
4853
  else if (isMetadataAviailable && isInstalled) {
4854
4854
  more = "(installed)";
4855
4855
  }
4856
4856
  else {
4857
- more = "(unknown state, looks like a unexpected behavior)";
4857
+ more = "*(unknown state, looks like a unexpected behavior)*";
4858
4858
  }
4859
- return "".concat(i + 1, ") `").concat(className, "` from `").concat(packageName, "` ").concat(more);
4859
+ if (!isAvilableInBrowser) {
4860
+ more += " *(not available in browser)*";
4861
+ }
4862
+ return "".concat(i + 1, ") `").concat(className, "` from `").concat(packageName, "` compatible to scrape ").concat(mimeTypes.join(', '), " ").concat(more);
4860
4863
  })
4861
4864
  .join('\n')), "\n "); });
4862
4865
  }
@@ -5241,7 +5244,10 @@
5241
5244
  return [7 /*endfinally*/];
5242
5245
  case 9:
5243
5246
  if (partialPieces === null) {
5244
- 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 "); }));
5247
+ throw new KnowledgeScrapeError(spaceTrim__default["default"](function (block) { return "\n Cannot scrape knowledge from source:\n \n > ".concat(block(knowledgeSource.sourceContent
5248
+ .split('\n')
5249
+ .map(function (line) { return "> ".concat(line); })
5250
+ .join('\n')), "\n\n No scraper found for the mime type \"").concat(sourceHandler.mimeType, "\"\n\n ").concat(block($registeredScrapersMessage()), "\n\n\n "); }));
5245
5251
  }
5246
5252
  pieces = partialPieces.map(function (partialPiece) { return (__assign(__assign({}, partialPiece), { sources: [
5247
5253
  {