@promptbook/types 0.40.0-0 → 0.40.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.
Files changed (61) hide show
  1. package/esm/index.es.js +0 -59
  2. package/esm/index.es.js.map +1 -1
  3. package/esm/typings/_packages/core.index.d.ts +1 -1
  4. package/esm/typings/_packages/types.index.d.ts +1 -4
  5. package/esm/typings/_packages/utils.index.d.ts +5 -2
  6. package/esm/typings/config.d.ts +4 -0
  7. package/esm/typings/conversion/{_importPromptbook.d.ts → test/_importPromptbook.d.ts} +2 -2
  8. package/{umd/typings/conversion → esm/typings/conversion/test}/validatePromptbookJson.d.ts +1 -1
  9. package/{umd/typings → esm/typings/conversion}/utils/extractVariables.d.ts +2 -2
  10. package/esm/typings/conversion/utils/parseCommand.d.ts +8 -0
  11. package/{umd/typings → esm/typings/conversion}/utils/parseNumber.d.ts +2 -0
  12. package/esm/typings/errors/ExpectError.d.ts +2 -0
  13. package/esm/typings/errors/NotFoundError.d.ts +1 -1
  14. package/esm/typings/errors/PromptbookExecutionError.d.ts +7 -0
  15. package/esm/typings/errors/PromptbookLogicError.d.ts +7 -0
  16. package/esm/typings/errors/PromptbookSyntaxError.d.ts +7 -0
  17. package/esm/typings/errors/UnexpectedError.d.ts +7 -0
  18. package/esm/typings/execution/UserInterfaceTools.d.ts +1 -1
  19. package/{umd/typings → esm/typings/execution}/utils/replaceParameters.d.ts +3 -3
  20. package/esm/typings/library/SimplePromptbookLibrary.d.ts +1 -1
  21. package/esm/typings/utils/markdown/extractOneBlockFromMarkdown.d.ts +3 -0
  22. package/package.json +2 -2
  23. package/umd/index.umd.js +4 -67
  24. package/umd/index.umd.js.map +1 -1
  25. package/umd/typings/_packages/core.index.d.ts +1 -1
  26. package/umd/typings/_packages/types.index.d.ts +1 -4
  27. package/umd/typings/_packages/utils.index.d.ts +5 -2
  28. package/umd/typings/config.d.ts +4 -0
  29. package/umd/typings/conversion/{_importPromptbook.d.ts → test/_importPromptbook.d.ts} +2 -2
  30. package/{esm/typings/conversion → umd/typings/conversion/test}/validatePromptbookJson.d.ts +1 -1
  31. package/{esm/typings → umd/typings/conversion}/utils/extractVariables.d.ts +2 -2
  32. package/umd/typings/conversion/utils/parseCommand.d.ts +8 -0
  33. package/{esm/typings → umd/typings/conversion}/utils/parseNumber.d.ts +2 -0
  34. package/umd/typings/errors/ExpectError.d.ts +2 -0
  35. package/umd/typings/errors/NotFoundError.d.ts +1 -1
  36. package/umd/typings/errors/PromptbookExecutionError.d.ts +7 -0
  37. package/umd/typings/errors/PromptbookLogicError.d.ts +7 -0
  38. package/umd/typings/errors/PromptbookSyntaxError.d.ts +7 -0
  39. package/umd/typings/errors/UnexpectedError.d.ts +7 -0
  40. package/umd/typings/execution/UserInterfaceTools.d.ts +1 -1
  41. package/{esm/typings → umd/typings/execution}/utils/replaceParameters.d.ts +3 -3
  42. package/umd/typings/library/SimplePromptbookLibrary.d.ts +1 -1
  43. package/umd/typings/utils/markdown/extractOneBlockFromMarkdown.d.ts +3 -0
  44. package/esm/typings/conversion/parseCommand.d.ts +0 -6
  45. package/umd/typings/conversion/parseCommand.d.ts +0 -6
  46. /package/esm/typings/conversion/{promptbookStringToJson-syntaxErrors.test.d.ts → test/promptbookStringToJson-syntaxErrors.test.d.ts} +0 -0
  47. /package/esm/typings/conversion/{promptbookStringToJson.test.d.ts → test/promptbookStringToJson.test.d.ts} +0 -0
  48. /package/esm/typings/conversion/{validatePromptbookJson-logicErrors.test.d.ts → test/validatePromptbookJson-logicErrors.test.d.ts} +0 -0
  49. /package/esm/typings/conversion/{validatePromptbookJson.test.d.ts → test/validatePromptbookJson.test.d.ts} +0 -0
  50. /package/esm/typings/{utils → conversion/utils}/extractVariables.test.d.ts +0 -0
  51. /package/esm/typings/conversion/{parseCommand.test.d.ts → utils/parseCommand.test.d.ts} +0 -0
  52. /package/esm/typings/{utils → conversion/utils}/parseNumber.test.d.ts +0 -0
  53. /package/esm/typings/{utils → execution/utils}/replaceParameters.test.d.ts +0 -0
  54. /package/umd/typings/conversion/{promptbookStringToJson-syntaxErrors.test.d.ts → test/promptbookStringToJson-syntaxErrors.test.d.ts} +0 -0
  55. /package/umd/typings/conversion/{promptbookStringToJson.test.d.ts → test/promptbookStringToJson.test.d.ts} +0 -0
  56. /package/umd/typings/conversion/{validatePromptbookJson-logicErrors.test.d.ts → test/validatePromptbookJson-logicErrors.test.d.ts} +0 -0
  57. /package/umd/typings/conversion/{validatePromptbookJson.test.d.ts → test/validatePromptbookJson.test.d.ts} +0 -0
  58. /package/umd/typings/{utils → conversion/utils}/extractVariables.test.d.ts +0 -0
  59. /package/umd/typings/conversion/{parseCommand.test.d.ts → utils/parseCommand.test.d.ts} +0 -0
  60. /package/umd/typings/{utils → conversion/utils}/parseNumber.test.d.ts +0 -0
  61. /package/umd/typings/{utils → execution/utils}/replaceParameters.test.d.ts +0 -0
package/esm/index.es.js CHANGED
@@ -1,61 +1,2 @@
1
- /*! *****************************************************************************
2
- Copyright (c) Microsoft Corporation.
3
-
4
- Permission to use, copy, modify, and/or distribute this software for any
5
- purpose with or without fee is hereby granted.
6
-
7
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
- PERFORMANCE OF THIS SOFTWARE.
14
- ***************************************************************************** */
15
- /* global Reflect, Promise */
16
-
17
- var extendStatics = function(d, b) {
18
- extendStatics = Object.setPrototypeOf ||
19
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
20
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
21
- return extendStatics(d, b);
22
- };
23
-
24
- function __extends(d, b) {
25
- if (typeof b !== "function" && b !== null)
26
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
27
- extendStatics(d, b);
28
- function __() { this.constructor = d; }
29
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
30
- }
31
1
 
32
- /**
33
- * This error occurs when some expectation is not met in the execution of the pipeline
34
- */
35
- var ExpectError = /** @class */ (function (_super) {
36
- __extends(ExpectError, _super);
37
- function ExpectError(message) {
38
- var _this = _super.call(this, message) || this;
39
- _this.name = 'ExpectError';
40
- Object.setPrototypeOf(_this, ExpectError.prototype);
41
- return _this;
42
- }
43
- return ExpectError;
44
- }(Error));
45
-
46
- /**
47
- * This error !!!
48
- */
49
- var NotFoundError = /** @class */ (function (_super) {
50
- __extends(NotFoundError, _super);
51
- function NotFoundError(message) {
52
- var _this = _super.call(this, message) || this;
53
- _this.name = 'NotFoundError';
54
- Object.setPrototypeOf(_this, NotFoundError.prototype);
55
- return _this;
56
- }
57
- return NotFoundError;
58
- }(Error));
59
-
60
- export { ExpectError, NotFoundError };
61
2
  //# sourceMappingURL=index.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es.js","sources":["../../../node_modules/tslib/tslib.es6.js","../../../src/errors/ExpectError.ts","../../../src/errors/NotFoundError.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n",null,null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,aAAa,GAAG,SAAS,CAAC,EAAE,CAAC,EAAE;AACnC,IAAI,aAAa,GAAG,MAAM,CAAC,cAAc;AACzC,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC;AACpF,QAAQ,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC1G,IAAI,OAAO,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC/B,CAAC,CAAC;AACF;AACO,SAAS,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE;AAChC,IAAI,IAAI,OAAO,CAAC,KAAK,UAAU,IAAI,CAAC,KAAK,IAAI;AAC7C,QAAQ,MAAM,IAAI,SAAS,CAAC,sBAAsB,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,+BAA+B,CAAC,CAAC;AAClG,IAAI,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACxB,IAAI,SAAS,EAAE,GAAG,EAAE,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,EAAE;AAC3C,IAAI,CAAC,CAAC,SAAS,GAAG,CAAC,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,SAAS,GAAG,CAAC,CAAC,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;AACzF;;AC7BA;;;;IAGiC,+BAAK;IAElC,qBAAmB,OAAe;QAAlC,YACI,kBAAM,OAAO,CAAC,SAEjB;QAJe,UAAI,GAAG,aAAa,CAAC;QAGjC,MAAM,CAAC,cAAc,CAAC,KAAI,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;;KACtD;IACL,kBAAC;AAAD,CANA,CAAiC,KAAK;;ACHtC;;;;IAGmC,iCAAK;IAEpC,uBAAmB,OAAe;QAAlC,YACI,kBAAM,OAAO,CAAC,SAEjB;QAJe,UAAI,GAAG,eAAe,CAAC;QAGnC,MAAM,CAAC,cAAc,CAAC,KAAI,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;;KACxD;IACL,oBAAC;AAAD,CANA,CAAmC,KAAK;;;;"}
1
+ {"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,5 +1,5 @@
1
1
  import { promptbookStringToJson } from '../conversion/promptbookStringToJson';
2
- import { validatePromptbookJson } from '../conversion/validatePromptbookJson';
2
+ import { validatePromptbookJson } from '../conversion/test/validatePromptbookJson';
3
3
  import { createPromptbookExecutor } from '../execution/createPromptbookExecutor';
4
4
  import { MockedEchoNaturalExecutionTools } from '../execution/plugins/natural-execution-tools/mocked/MockedEchoNaturalExecutionTools';
5
5
  import { CallbackInterfaceTools } from '../execution/plugins/user-interface-execution-tools/callback/CallbackInterfaceTools';
@@ -1,5 +1,3 @@
1
- import { ExpectError } from '../errors/ExpectError';
2
- import { NotFoundError } from '../errors/NotFoundError';
3
1
  import type { CommonExecutionToolsOptions } from '../execution/CommonExecutionToolsOptions';
4
2
  import type { ExecutionTools } from '../execution/ExecutionTools';
5
3
  import type { NaturalExecutionTools } from '../execution/NaturalExecutionTools';
@@ -23,8 +21,7 @@ import type { string_char_emoji } from '../types/typeAliasEmoji';
23
21
  import type { client_id, string_char, string_chat_prompt, string_completion_prompt, string_data_url, string_domain, string_email, string_file_absolute_path, string_file_extension, string_file_path, string_file_relative_path, string_filename, string_folder_absolute_path, string_folder_path, string_folder_relative_path, string_host, string_hostname, string_href, string_html, string_javascript, string_javascript_name, string_license, string_markdown, string_markdown_text, string_mime_type, string_mime_type_with_wildcard, string_model_name, string_name, string_person_fullname, string_prompt, string_promptbook_url, string_promptbook_url_with_hashtemplate, string_script, string_sha256, string_tdl, string_template, string_text_prompt, string_title, string_token, string_translate_language, string_uri, string_uri_part, string_url, string_url_image, string_version } from '../types/typeAliases';
24
22
  import { FromtoItems } from '../utils/FromtoItems';
25
23
  export { CommonExecutionToolsOptions, EXPECTATION_UNITS, ExecutionReportJson, ExecutionTools, ExecutionType, ExpectationAmount, ExpectationUnit, FromtoItems, ModelRequirements, ModelVariant, NaturalExecutionTools, Parameters, Prompt, PromptChatResult, PromptCommonResult, PromptCompletionResult, PromptResult, PromptTemplateJson, PromptTemplateParameterJson, PromptbookExecutor, PromptbookJson, PromptbookLibrary, PromptbookString, ScriptExecutionTools, ScriptExecutionToolsExecuteOptions, ScriptLanguage, TaskProgress, UserInterfaceTools, UserInterfaceToolsPromptDialogOptions, client_id, string_char, string_char_emoji, string_chat_prompt, string_completion_prompt, string_data_url, string_domain, string_email, string_file_absolute_path, string_file_extension, string_file_path, string_file_relative_path, string_filename, string_folder_absolute_path, string_folder_path, string_folder_relative_path, string_host, string_hostname, string_href, string_html, string_javascript, string_javascript_name, string_license, string_markdown, string_markdown_text, string_mime_type, string_mime_type_with_wildcard, string_model_name, string_name, string_person_fullname, string_prompt, string_promptbook_url, string_promptbook_url_with_hashtemplate, string_script, string_sha256, string_tdl, string_template, string_text_prompt, string_title, string_token, string_translate_language, string_uri, string_uri_part, string_url, string_url_image, string_version, };
26
- export { ExpectError, NotFoundError };
27
24
  /**
28
- * TODO: [🧠] Is this the best package to export custom errors from?
25
+ * TODO: [🧠][🆔] Is this the best package to export custom errors from?
29
26
  * TODO: Delete type aliases (from ../types/typeAliases) that are not exported here
30
27
  */
@@ -1,3 +1,4 @@
1
+ import { parseNumber } from '../conversion/utils/parseNumber';
1
2
  import { assertsExecutionSuccessful } from '../execution/assertsExecutionSuccessful';
2
3
  import { ExecutionReportStringOptions, ExecutionReportStringOptionsDefaults } from '../types/execution-report/ExecutionReportStringOptions';
3
4
  import { executionReportJsonToString } from '../types/execution-report/executionReportJsonToString';
@@ -14,13 +15,15 @@ import { extractAllListItemsFromMarkdown } from '../utils/markdown/extractAllLis
14
15
  import { extractOneBlockFromMarkdown } from '../utils/markdown/extractOneBlockFromMarkdown';
15
16
  import { removeContentComments } from '../utils/markdown/removeContentComments';
16
17
  import { removeMarkdownFormatting } from '../utils/markdown/removeMarkdownFormatting';
17
- import { parseNumber } from '../utils/parseNumber';
18
18
  import { removeEmojis } from '../utils/removeEmojis';
19
19
  import { removeQuotes } from '../utils/removeQuotes';
20
20
  import { trimCodeBlock } from '../utils/trimCodeBlock';
21
21
  import { trimEndOfCodeBlock } from '../utils/trimEndOfCodeBlock';
22
22
  import { unwrapResult } from '../utils/unwrapResult';
23
- export { CountUtils, ExecutionReportStringOptions, ExecutionReportStringOptionsDefaults, assertsExecutionSuccessful, countCharacters, countLines, countPages, countParagraphs, countSentences, countWords, executionReportJsonToString, extractAllBlocksFromMarkdown, extractAllListItemsFromMarkdown, extractOneBlockFromMarkdown, isValidJsonString, parseNumber, removeContentComments, removeEmojis, removeMarkdownFormatting, removeQuotes, trimCodeBlock, trimEndOfCodeBlock, unwrapResult, };
23
+ export { CountUtils, ExecutionReportStringOptions, ExecutionReportStringOptionsDefaults, assertsExecutionSuccessful, countCharacters, countLines, countPages, countParagraphs, countSentences, countWords, executionReportJsonToString, extractAllBlocksFromMarkdown, // <- [🌻]
24
+ extractAllListItemsFromMarkdown, // <- [🌻]
25
+ extractOneBlockFromMarkdown, // <- [🌻]
26
+ isValidJsonString, parseNumber, removeContentComments, removeEmojis, removeMarkdownFormatting, removeQuotes, trimCodeBlock, trimEndOfCodeBlock, unwrapResult, };
24
27
  /**
25
28
  * TODO: [🧠] Maybe create some indipendent package like `markdown-tools` from both here exported and @private utilities
26
29
  */
@@ -0,0 +1,4 @@
1
+ /**
2
+ * The maximum number of iterations for a loops
3
+ */
4
+ export declare const LOOP_LIMIT = 1000;
@@ -1,5 +1,5 @@
1
- import { PromptbookJson } from '../types/PromptbookJson/PromptbookJson';
2
- import { PromptbookString } from '../types/PromptbookString';
1
+ import { PromptbookJson } from '../../types/PromptbookJson/PromptbookJson';
2
+ import { PromptbookString } from '../../types/PromptbookString';
3
3
  /**
4
4
  * Import the text file
5
5
  *
@@ -1,4 +1,4 @@
1
- import type { PromptbookJson } from '../types/PromptbookJson/PromptbookJson';
1
+ import type { PromptbookJson } from '../../types/PromptbookJson/PromptbookJson';
2
2
  /**
3
3
  * Validates PromptbookJson if it is logically valid.
4
4
  *
@@ -1,10 +1,10 @@
1
- import { string_javascript, string_javascript_name } from '../types/typeAliases';
1
+ import { string_javascript, string_javascript_name } from '../../types/typeAliases';
2
2
  /**
3
3
  * Parses the given script and returns the list of all used variables that are not defined in the script
4
4
  *
5
5
  * @param script from which to extract the variables
6
6
  * @returns the list of variable names
7
7
  *
8
- * @private within the library
8
+ * @private within the promptbookStringToJson
9
9
  */
10
10
  export declare function extractVariables(script: string_javascript): Array<string_javascript_name>;
@@ -0,0 +1,8 @@
1
+ import type { Command } from '../../types/Command';
2
+ import type { string_markdown_text } from '../../types/typeAliases';
3
+ /**
4
+ * Parses one line of ul/ol to command
5
+ *
6
+ * @private within the promptbookStringToJson
7
+ */
8
+ export declare function parseCommand(listItem: string_markdown_text): Command;
@@ -3,6 +3,8 @@
3
3
  *
4
4
  * Unlike Number.parseInt, Number.parseFloat it will never ever result in NaN
5
5
  * Note: it also works only with decimal numbers
6
+ *
7
+ * @private within the parseCommand
6
8
  */
7
9
  export declare function parseNumber(value: string | number): number;
8
10
  /**
@@ -1,5 +1,7 @@
1
1
  /**
2
2
  * This error occurs when some expectation is not met in the execution of the pipeline
3
+ *
4
+ * Note: This is a kindof subtype of PromptbookExecutionError
3
5
  */
4
6
  export declare class ExpectError extends Error {
5
7
  readonly name = "ExpectError";
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This error !!!
2
+ * This error indicates that the requested resource (for example promptbook in the library ) was not found
3
3
  */
4
4
  export declare class NotFoundError extends Error {
5
5
  readonly name = "NotFoundError";
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This error indicates errors during the execution of the promptbook
3
+ */
4
+ export declare class PromptbookExecutionError extends Error {
5
+ readonly name = "PromptbookExecutionError";
6
+ constructor(message: string);
7
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This error indicates that the promptbook object has valid syntax but contains logical errors (like circular dependencies)
3
+ */
4
+ export declare class PromptbookLogicError extends Error {
5
+ readonly name = "PromptbookLogicError";
6
+ constructor(message: string);
7
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This error indicates that the promptbook in a markdown format cannot be parsed into a valid promptbook object
3
+ */
4
+ export declare class PromptbookSyntaxError extends Error {
5
+ readonly name = "PromptbookSyntaxError";
6
+ constructor(message: string);
7
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This error type indicates that the error should not happen and its last check before crashing with some other error
3
+ */
4
+ export declare class UnexpectedError extends Error {
5
+ readonly name = "UnexpectedError";
6
+ constructor(message: string);
7
+ }
@@ -6,7 +6,7 @@ import { number_integer, number_positive } from '../types/typeAliases';
6
6
  */
7
7
  export type UserInterfaceTools = {
8
8
  /**
9
- * Asks the user to answer a free-text (multiline) question
9
+ * Asks the user to answer a free-text (multi-line) question
10
10
  *
11
11
  * @param options the question to ask
12
12
  * @returns the answer from the user
@@ -1,5 +1,5 @@
1
- import { string_template } from '.././types/typeAliases';
2
- import { Parameters } from '../types/Parameters';
1
+ import { Parameters } from '../../types/Parameters';
2
+ import { string_template } from '../../types/typeAliases';
3
3
  /**
4
4
  * Replaces parameters in template with values from parameters object
5
5
  *
@@ -7,6 +7,6 @@ import { Parameters } from '../types/Parameters';
7
7
  * @param parameters the object with parameters
8
8
  * @returns the template with replaced parameters
9
9
  *
10
- * @private within the library
10
+ * @private within the createPromptbookExecutor
11
11
  */
12
12
  export declare function replaceParameters(template: string_template, parameters: Parameters): string;
@@ -22,7 +22,7 @@ export declare class SimplePromptbookLibrary implements PromptbookLibrary {
22
22
  * @param settings settings for creating executor functions
23
23
  * @returns PromptbookLibrary
24
24
  */
25
- static fromSources(promptbookSources: Record<string_promptbook_url, PromptbookJson | PromptbookString>, settings?: Partial<CreatePromptbookExecutorSettings>): SimplePromptbookLibrary;
25
+ static fromSources(promptbookSources: Array<PromptbookJson | PromptbookString>, settings?: Partial<CreatePromptbookExecutorSettings>): SimplePromptbookLibrary;
26
26
  private constructor();
27
27
  /**
28
28
  * Gets all promptbooks in the library
@@ -12,3 +12,6 @@ export declare function extractOneBlockFromMarkdown(markdown: string_markdown):
12
12
  language: string | null;
13
13
  content: string;
14
14
  };
15
+ /***
16
+ * TODO: [🌻] !!! Decide of this is internal util, external util OR validator/postprocessor
17
+ */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/types",
3
- "version": "0.40.0-0",
3
+ "version": "0.40.0-2",
4
4
  "description": "Library to supercharge your use of large language models",
5
5
  "private": false,
6
6
  "sideEffects": false,
@@ -35,7 +35,7 @@
35
35
  "homepage": "https://www.npmjs.com/package/@promptbook/core",
36
36
  "dependencies": {},
37
37
  "peerDependencies": {
38
- "@promptbook/core": "0.40.0-0"
38
+ "@promptbook/core": "0.40.0-2"
39
39
  },
40
40
  "main": "./umd/index.umd.js",
41
41
  "module": "./esm/index.es.js",
package/umd/index.umd.js CHANGED
@@ -1,72 +1,9 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
3
- typeof define === 'function' && define.amd ? define(['exports'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["promptbook-types"] = {}));
5
- })(this, (function (exports) { 'use strict';
1
+ (function (factory) {
2
+ typeof define === 'function' && define.amd ? define(factory) :
3
+ factory();
4
+ })((function () { 'use strict';
6
5
 
7
- /*! *****************************************************************************
8
- Copyright (c) Microsoft Corporation.
9
-
10
- Permission to use, copy, modify, and/or distribute this software for any
11
- purpose with or without fee is hereby granted.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
14
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
16
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
17
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
18
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19
- PERFORMANCE OF THIS SOFTWARE.
20
- ***************************************************************************** */
21
- /* global Reflect, Promise */
22
-
23
- var extendStatics = function(d, b) {
24
- extendStatics = Object.setPrototypeOf ||
25
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
26
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
27
- return extendStatics(d, b);
28
- };
29
-
30
- function __extends(d, b) {
31
- if (typeof b !== "function" && b !== null)
32
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
33
- extendStatics(d, b);
34
- function __() { this.constructor = d; }
35
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
36
- }
37
6
 
38
- /**
39
- * This error occurs when some expectation is not met in the execution of the pipeline
40
- */
41
- var ExpectError = /** @class */ (function (_super) {
42
- __extends(ExpectError, _super);
43
- function ExpectError(message) {
44
- var _this = _super.call(this, message) || this;
45
- _this.name = 'ExpectError';
46
- Object.setPrototypeOf(_this, ExpectError.prototype);
47
- return _this;
48
- }
49
- return ExpectError;
50
- }(Error));
51
-
52
- /**
53
- * This error !!!
54
- */
55
- var NotFoundError = /** @class */ (function (_super) {
56
- __extends(NotFoundError, _super);
57
- function NotFoundError(message) {
58
- var _this = _super.call(this, message) || this;
59
- _this.name = 'NotFoundError';
60
- Object.setPrototypeOf(_this, NotFoundError.prototype);
61
- return _this;
62
- }
63
- return NotFoundError;
64
- }(Error));
65
-
66
- exports.ExpectError = ExpectError;
67
- exports.NotFoundError = NotFoundError;
68
-
69
- Object.defineProperty(exports, '__esModule', { value: true });
70
7
 
71
8
  }));
72
9
  //# sourceMappingURL=index.umd.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.umd.js","sources":["../../../node_modules/tslib/tslib.es6.js","../../../src/errors/ExpectError.ts","../../../src/errors/NotFoundError.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n",null,null],"names":[],"mappings":";;;;;;IAAA;IACA;AACA;IACA;IACA;AACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;AACA;IACA,IAAI,aAAa,GAAG,SAAS,CAAC,EAAE,CAAC,EAAE;IACnC,IAAI,aAAa,GAAG,MAAM,CAAC,cAAc;IACzC,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC;IACpF,QAAQ,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1G,IAAI,OAAO,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC/B,CAAC,CAAC;AACF;IACO,SAAS,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE;IAChC,IAAI,IAAI,OAAO,CAAC,KAAK,UAAU,IAAI,CAAC,KAAK,IAAI;IAC7C,QAAQ,MAAM,IAAI,SAAS,CAAC,sBAAsB,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,+BAA+B,CAAC,CAAC;IAClG,IAAI,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACxB,IAAI,SAAS,EAAE,GAAG,EAAE,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,EAAE;IAC3C,IAAI,CAAC,CAAC,SAAS,GAAG,CAAC,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,SAAS,GAAG,CAAC,CAAC,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;IACzF;;IC7BA;;;;QAGiC,+BAAK;QAElC,qBAAmB,OAAe;YAAlC,YACI,kBAAM,OAAO,CAAC,SAEjB;YAJe,UAAI,GAAG,aAAa,CAAC;YAGjC,MAAM,CAAC,cAAc,CAAC,KAAI,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;;SACtD;QACL,kBAAC;IAAD,CANA,CAAiC,KAAK;;ICHtC;;;;QAGmC,iCAAK;QAEpC,uBAAmB,OAAe;YAAlC,YACI,kBAAM,OAAO,CAAC,SAEjB;YAJe,UAAI,GAAG,eAAe,CAAC;YAGnC,MAAM,CAAC,cAAc,CAAC,KAAI,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;;SACxD;QACL,oBAAC;IAAD,CANA,CAAmC,KAAK;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.umd.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { promptbookStringToJson } from '../conversion/promptbookStringToJson';
2
- import { validatePromptbookJson } from '../conversion/validatePromptbookJson';
2
+ import { validatePromptbookJson } from '../conversion/test/validatePromptbookJson';
3
3
  import { createPromptbookExecutor } from '../execution/createPromptbookExecutor';
4
4
  import { MockedEchoNaturalExecutionTools } from '../execution/plugins/natural-execution-tools/mocked/MockedEchoNaturalExecutionTools';
5
5
  import { CallbackInterfaceTools } from '../execution/plugins/user-interface-execution-tools/callback/CallbackInterfaceTools';
@@ -1,5 +1,3 @@
1
- import { ExpectError } from '../errors/ExpectError';
2
- import { NotFoundError } from '../errors/NotFoundError';
3
1
  import type { CommonExecutionToolsOptions } from '../execution/CommonExecutionToolsOptions';
4
2
  import type { ExecutionTools } from '../execution/ExecutionTools';
5
3
  import type { NaturalExecutionTools } from '../execution/NaturalExecutionTools';
@@ -23,8 +21,7 @@ import type { string_char_emoji } from '../types/typeAliasEmoji';
23
21
  import type { client_id, string_char, string_chat_prompt, string_completion_prompt, string_data_url, string_domain, string_email, string_file_absolute_path, string_file_extension, string_file_path, string_file_relative_path, string_filename, string_folder_absolute_path, string_folder_path, string_folder_relative_path, string_host, string_hostname, string_href, string_html, string_javascript, string_javascript_name, string_license, string_markdown, string_markdown_text, string_mime_type, string_mime_type_with_wildcard, string_model_name, string_name, string_person_fullname, string_prompt, string_promptbook_url, string_promptbook_url_with_hashtemplate, string_script, string_sha256, string_tdl, string_template, string_text_prompt, string_title, string_token, string_translate_language, string_uri, string_uri_part, string_url, string_url_image, string_version } from '../types/typeAliases';
24
22
  import { FromtoItems } from '../utils/FromtoItems';
25
23
  export { CommonExecutionToolsOptions, EXPECTATION_UNITS, ExecutionReportJson, ExecutionTools, ExecutionType, ExpectationAmount, ExpectationUnit, FromtoItems, ModelRequirements, ModelVariant, NaturalExecutionTools, Parameters, Prompt, PromptChatResult, PromptCommonResult, PromptCompletionResult, PromptResult, PromptTemplateJson, PromptTemplateParameterJson, PromptbookExecutor, PromptbookJson, PromptbookLibrary, PromptbookString, ScriptExecutionTools, ScriptExecutionToolsExecuteOptions, ScriptLanguage, TaskProgress, UserInterfaceTools, UserInterfaceToolsPromptDialogOptions, client_id, string_char, string_char_emoji, string_chat_prompt, string_completion_prompt, string_data_url, string_domain, string_email, string_file_absolute_path, string_file_extension, string_file_path, string_file_relative_path, string_filename, string_folder_absolute_path, string_folder_path, string_folder_relative_path, string_host, string_hostname, string_href, string_html, string_javascript, string_javascript_name, string_license, string_markdown, string_markdown_text, string_mime_type, string_mime_type_with_wildcard, string_model_name, string_name, string_person_fullname, string_prompt, string_promptbook_url, string_promptbook_url_with_hashtemplate, string_script, string_sha256, string_tdl, string_template, string_text_prompt, string_title, string_token, string_translate_language, string_uri, string_uri_part, string_url, string_url_image, string_version, };
26
- export { ExpectError, NotFoundError };
27
24
  /**
28
- * TODO: [🧠] Is this the best package to export custom errors from?
25
+ * TODO: [🧠][🆔] Is this the best package to export custom errors from?
29
26
  * TODO: Delete type aliases (from ../types/typeAliases) that are not exported here
30
27
  */
@@ -1,3 +1,4 @@
1
+ import { parseNumber } from '../conversion/utils/parseNumber';
1
2
  import { assertsExecutionSuccessful } from '../execution/assertsExecutionSuccessful';
2
3
  import { ExecutionReportStringOptions, ExecutionReportStringOptionsDefaults } from '../types/execution-report/ExecutionReportStringOptions';
3
4
  import { executionReportJsonToString } from '../types/execution-report/executionReportJsonToString';
@@ -14,13 +15,15 @@ import { extractAllListItemsFromMarkdown } from '../utils/markdown/extractAllLis
14
15
  import { extractOneBlockFromMarkdown } from '../utils/markdown/extractOneBlockFromMarkdown';
15
16
  import { removeContentComments } from '../utils/markdown/removeContentComments';
16
17
  import { removeMarkdownFormatting } from '../utils/markdown/removeMarkdownFormatting';
17
- import { parseNumber } from '../utils/parseNumber';
18
18
  import { removeEmojis } from '../utils/removeEmojis';
19
19
  import { removeQuotes } from '../utils/removeQuotes';
20
20
  import { trimCodeBlock } from '../utils/trimCodeBlock';
21
21
  import { trimEndOfCodeBlock } from '../utils/trimEndOfCodeBlock';
22
22
  import { unwrapResult } from '../utils/unwrapResult';
23
- export { CountUtils, ExecutionReportStringOptions, ExecutionReportStringOptionsDefaults, assertsExecutionSuccessful, countCharacters, countLines, countPages, countParagraphs, countSentences, countWords, executionReportJsonToString, extractAllBlocksFromMarkdown, extractAllListItemsFromMarkdown, extractOneBlockFromMarkdown, isValidJsonString, parseNumber, removeContentComments, removeEmojis, removeMarkdownFormatting, removeQuotes, trimCodeBlock, trimEndOfCodeBlock, unwrapResult, };
23
+ export { CountUtils, ExecutionReportStringOptions, ExecutionReportStringOptionsDefaults, assertsExecutionSuccessful, countCharacters, countLines, countPages, countParagraphs, countSentences, countWords, executionReportJsonToString, extractAllBlocksFromMarkdown, // <- [🌻]
24
+ extractAllListItemsFromMarkdown, // <- [🌻]
25
+ extractOneBlockFromMarkdown, // <- [🌻]
26
+ isValidJsonString, parseNumber, removeContentComments, removeEmojis, removeMarkdownFormatting, removeQuotes, trimCodeBlock, trimEndOfCodeBlock, unwrapResult, };
24
27
  /**
25
28
  * TODO: [🧠] Maybe create some indipendent package like `markdown-tools` from both here exported and @private utilities
26
29
  */
@@ -0,0 +1,4 @@
1
+ /**
2
+ * The maximum number of iterations for a loops
3
+ */
4
+ export declare const LOOP_LIMIT = 1000;
@@ -1,5 +1,5 @@
1
- import { PromptbookJson } from '../types/PromptbookJson/PromptbookJson';
2
- import { PromptbookString } from '../types/PromptbookString';
1
+ import { PromptbookJson } from '../../types/PromptbookJson/PromptbookJson';
2
+ import { PromptbookString } from '../../types/PromptbookString';
3
3
  /**
4
4
  * Import the text file
5
5
  *
@@ -1,4 +1,4 @@
1
- import type { PromptbookJson } from '../types/PromptbookJson/PromptbookJson';
1
+ import type { PromptbookJson } from '../../types/PromptbookJson/PromptbookJson';
2
2
  /**
3
3
  * Validates PromptbookJson if it is logically valid.
4
4
  *
@@ -1,10 +1,10 @@
1
- import { string_javascript, string_javascript_name } from '../types/typeAliases';
1
+ import { string_javascript, string_javascript_name } from '../../types/typeAliases';
2
2
  /**
3
3
  * Parses the given script and returns the list of all used variables that are not defined in the script
4
4
  *
5
5
  * @param script from which to extract the variables
6
6
  * @returns the list of variable names
7
7
  *
8
- * @private within the library
8
+ * @private within the promptbookStringToJson
9
9
  */
10
10
  export declare function extractVariables(script: string_javascript): Array<string_javascript_name>;
@@ -0,0 +1,8 @@
1
+ import type { Command } from '../../types/Command';
2
+ import type { string_markdown_text } from '../../types/typeAliases';
3
+ /**
4
+ * Parses one line of ul/ol to command
5
+ *
6
+ * @private within the promptbookStringToJson
7
+ */
8
+ export declare function parseCommand(listItem: string_markdown_text): Command;
@@ -3,6 +3,8 @@
3
3
  *
4
4
  * Unlike Number.parseInt, Number.parseFloat it will never ever result in NaN
5
5
  * Note: it also works only with decimal numbers
6
+ *
7
+ * @private within the parseCommand
6
8
  */
7
9
  export declare function parseNumber(value: string | number): number;
8
10
  /**
@@ -1,5 +1,7 @@
1
1
  /**
2
2
  * This error occurs when some expectation is not met in the execution of the pipeline
3
+ *
4
+ * Note: This is a kindof subtype of PromptbookExecutionError
3
5
  */
4
6
  export declare class ExpectError extends Error {
5
7
  readonly name = "ExpectError";
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This error !!!
2
+ * This error indicates that the requested resource (for example promptbook in the library ) was not found
3
3
  */
4
4
  export declare class NotFoundError extends Error {
5
5
  readonly name = "NotFoundError";
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This error indicates errors during the execution of the promptbook
3
+ */
4
+ export declare class PromptbookExecutionError extends Error {
5
+ readonly name = "PromptbookExecutionError";
6
+ constructor(message: string);
7
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This error indicates that the promptbook object has valid syntax but contains logical errors (like circular dependencies)
3
+ */
4
+ export declare class PromptbookLogicError extends Error {
5
+ readonly name = "PromptbookLogicError";
6
+ constructor(message: string);
7
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This error indicates that the promptbook in a markdown format cannot be parsed into a valid promptbook object
3
+ */
4
+ export declare class PromptbookSyntaxError extends Error {
5
+ readonly name = "PromptbookSyntaxError";
6
+ constructor(message: string);
7
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This error type indicates that the error should not happen and its last check before crashing with some other error
3
+ */
4
+ export declare class UnexpectedError extends Error {
5
+ readonly name = "UnexpectedError";
6
+ constructor(message: string);
7
+ }
@@ -6,7 +6,7 @@ import { number_integer, number_positive } from '../types/typeAliases';
6
6
  */
7
7
  export type UserInterfaceTools = {
8
8
  /**
9
- * Asks the user to answer a free-text (multiline) question
9
+ * Asks the user to answer a free-text (multi-line) question
10
10
  *
11
11
  * @param options the question to ask
12
12
  * @returns the answer from the user
@@ -1,5 +1,5 @@
1
- import { string_template } from '.././types/typeAliases';
2
- import { Parameters } from '../types/Parameters';
1
+ import { Parameters } from '../../types/Parameters';
2
+ import { string_template } from '../../types/typeAliases';
3
3
  /**
4
4
  * Replaces parameters in template with values from parameters object
5
5
  *
@@ -7,6 +7,6 @@ import { Parameters } from '../types/Parameters';
7
7
  * @param parameters the object with parameters
8
8
  * @returns the template with replaced parameters
9
9
  *
10
- * @private within the library
10
+ * @private within the createPromptbookExecutor
11
11
  */
12
12
  export declare function replaceParameters(template: string_template, parameters: Parameters): string;
@@ -22,7 +22,7 @@ export declare class SimplePromptbookLibrary implements PromptbookLibrary {
22
22
  * @param settings settings for creating executor functions
23
23
  * @returns PromptbookLibrary
24
24
  */
25
- static fromSources(promptbookSources: Record<string_promptbook_url, PromptbookJson | PromptbookString>, settings?: Partial<CreatePromptbookExecutorSettings>): SimplePromptbookLibrary;
25
+ static fromSources(promptbookSources: Array<PromptbookJson | PromptbookString>, settings?: Partial<CreatePromptbookExecutorSettings>): SimplePromptbookLibrary;
26
26
  private constructor();
27
27
  /**
28
28
  * Gets all promptbooks in the library
@@ -12,3 +12,6 @@ export declare function extractOneBlockFromMarkdown(markdown: string_markdown):
12
12
  language: string | null;
13
13
  content: string;
14
14
  };
15
+ /***
16
+ * TODO: [🌻] !!! Decide of this is internal util, external util OR validator/postprocessor
17
+ */
@@ -1,6 +0,0 @@
1
- import type { string_markdown_text } from '.././types/typeAliases';
2
- import type { Command } from '../types/Command';
3
- /**
4
- * Parses one line of ul/ol to command
5
- */
6
- export declare function parseCommand(listItem: string_markdown_text): Command;
@@ -1,6 +0,0 @@
1
- import type { string_markdown_text } from '.././types/typeAliases';
2
- import type { Command } from '../types/Command';
3
- /**
4
- * Parses one line of ul/ol to command
5
- */
6
- export declare function parseCommand(listItem: string_markdown_text): Command;