@promptbook/cli 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/cli",
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
@@ -49,7 +49,7 @@
49
49
  *
50
50
  * @see https://github.com/webgptorg/promptbook
51
51
  */
52
- var PROMPTBOOK_ENGINE_VERSION = '0.75.0';
52
+ var PROMPTBOOK_ENGINE_VERSION = '0.75.2';
53
53
  /**
54
54
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
55
55
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -2014,7 +2014,6 @@
2014
2014
  while (unresovedTasks.length > 0) {
2015
2015
  _loop_3();
2016
2016
  }
2017
- // TODO: !!!!!! Test that pipeline interface implements declared formfactor interface
2018
2017
  }
2019
2018
  /**
2020
2019
  * TODO: !! [🧞‍♀️] Do not allow joker + foreach
@@ -4974,16 +4973,16 @@
4974
4973
  * Mixes registered scrapers from $scrapersMetadataRegister and $scrapersRegister
4975
4974
  */
4976
4975
  var all = [];
4977
- var _loop_1 = function (packageName, className) {
4976
+ var _loop_1 = function (packageName, className, mimeTypes, documentationUrl, isAvilableInBrowser) {
4978
4977
  if (all.some(function (item) { return item.packageName === packageName && item.className === className; })) {
4979
4978
  return "continue";
4980
4979
  }
4981
- all.push({ packageName: packageName, className: className });
4980
+ all.push({ packageName: packageName, className: className, mimeTypes: mimeTypes, documentationUrl: documentationUrl, isAvilableInBrowser: isAvilableInBrowser });
4982
4981
  };
4983
4982
  try {
4984
4983
  for (var _c = __values($scrapersMetadataRegister.list()), _d = _c.next(); !_d.done; _d = _c.next()) {
4985
- var _e = _d.value, packageName = _e.packageName, className = _e.className;
4986
- _loop_1(packageName, className);
4984
+ var _e = _d.value, packageName = _e.packageName, className = _e.className, mimeTypes = _e.mimeTypes, documentationUrl = _e.documentationUrl, isAvilableInBrowser = _e.isAvilableInBrowser;
4985
+ _loop_1(packageName, className, mimeTypes, documentationUrl, isAvilableInBrowser);
4987
4986
  }
4988
4987
  }
4989
4988
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
@@ -4993,16 +4992,16 @@
4993
4992
  }
4994
4993
  finally { if (e_1) throw e_1.error; }
4995
4994
  }
4996
- var _loop_2 = function (packageName, className) {
4995
+ var _loop_2 = function (packageName, className, mimeTypes, documentationUrl, isAvilableInBrowser) {
4997
4996
  if (all.some(function (item) { return item.packageName === packageName && item.className === className; })) {
4998
4997
  return "continue";
4999
4998
  }
5000
- all.push({ packageName: packageName, className: className });
4999
+ all.push({ packageName: packageName, className: className, mimeTypes: mimeTypes, documentationUrl: documentationUrl, isAvilableInBrowser: isAvilableInBrowser });
5001
5000
  };
5002
5001
  try {
5003
5002
  for (var _f = __values($scrapersRegister.list()), _g = _f.next(); !_g.done; _g = _f.next()) {
5004
- var _h = _g.value, packageName = _h.packageName, className = _h.className;
5005
- _loop_2(packageName, className);
5003
+ var _h = _g.value, packageName = _h.packageName, className = _h.className, mimeTypes = _h.mimeTypes, documentationUrl = _h.documentationUrl, isAvilableInBrowser = _h.isAvilableInBrowser;
5004
+ _loop_2(packageName, className, mimeTypes, documentationUrl, isAvilableInBrowser);
5006
5005
  }
5007
5006
  }
5008
5007
  catch (e_2_1) { e_2 = { error: e_2_1 }; }
@@ -5032,29 +5031,33 @@
5032
5031
  }
5033
5032
  return spaceTrim__default["default"](function (block) { return "\n Available scrapers are:\n ".concat(block(metadata
5034
5033
  .map(function (_a, i) {
5035
- var packageName = _a.packageName, className = _a.className, isMetadataAviailable = _a.isMetadataAviailable, isInstalled = _a.isInstalled;
5034
+ var packageName = _a.packageName, className = _a.className, isMetadataAviailable = _a.isMetadataAviailable, isInstalled = _a.isInstalled, mimeTypes = _a.mimeTypes, isAvilableInBrowser = _a.isAvilableInBrowser;
5036
5035
  var more;
5036
+ // TODO: Use documentationUrl
5037
5037
  if (just(false)) {
5038
5038
  more = '';
5039
5039
  }
5040
5040
  else if (!isMetadataAviailable && !isInstalled) {
5041
5041
  // TODO: [�][�] Maybe do allow to do auto-install if package not registered and not found
5042
- more = "(not installed and no metadata, looks like a unexpected behavior)";
5042
+ more = "*(not installed and no metadata, looks like a unexpected behavior)*";
5043
5043
  }
5044
5044
  else if (isMetadataAviailable && !isInstalled) {
5045
5045
  // TODO: [�][�]
5046
- more = "(not installed)";
5046
+ more = "*(not installed)*";
5047
5047
  }
5048
5048
  else if (!isMetadataAviailable && isInstalled) {
5049
- more = "(no metadata, looks like a unexpected behavior)";
5049
+ more = "*(no metadata, looks like a unexpected behavior)*";
5050
5050
  }
5051
5051
  else if (isMetadataAviailable && isInstalled) {
5052
5052
  more = "(installed)";
5053
5053
  }
5054
5054
  else {
5055
- more = "(unknown state, looks like a unexpected behavior)";
5055
+ more = "*(unknown state, looks like a unexpected behavior)*";
5056
5056
  }
5057
- return "".concat(i + 1, ") `").concat(className, "` from `").concat(packageName, "` ").concat(more);
5057
+ if (!isAvilableInBrowser) {
5058
+ more += " *(not available in browser)*";
5059
+ }
5060
+ return "".concat(i + 1, ") `").concat(className, "` from `").concat(packageName, "` compatible to scrape ").concat(mimeTypes.join(', '), " ").concat(more);
5058
5061
  })
5059
5062
  .join('\n')), "\n "); });
5060
5063
  }
@@ -5439,7 +5442,10 @@
5439
5442
  return [7 /*endfinally*/];
5440
5443
  case 9:
5441
5444
  if (partialPieces === null) {
5442
- 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 "); }));
5445
+ throw new KnowledgeScrapeError(spaceTrim__default["default"](function (block) { return "\n Cannot scrape knowledge from source:\n \n > ".concat(block(knowledgeSource.sourceContent
5446
+ .split('\n')
5447
+ .map(function (line) { return "> ".concat(line); })
5448
+ .join('\n')), "\n\n No scraper found for the mime type \"").concat(sourceHandler.mimeType, "\"\n\n ").concat(block($registeredScrapersMessage()), "\n\n\n "); }));
5443
5449
  }
5444
5450
  pieces = partialPieces.map(function (partialPiece) { return (__assign(__assign({}, partialPiece), { sources: [
5445
5451
  {