@promptbook/remote-server 0.100.0-44 → 0.100.0-46

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 (34) hide show
  1. package/esm/index.es.js +119 -121
  2. package/esm/index.es.js.map +1 -1
  3. package/esm/typings/src/_packages/components.index.d.ts +14 -0
  4. package/esm/typings/src/_packages/core.index.d.ts +4 -0
  5. package/esm/typings/src/_packages/types.index.d.ts +8 -0
  6. package/esm/typings/src/book-2.0/commitments/_misc/AgentModelRequirements.d.ts +1 -1
  7. package/esm/typings/src/book-components/AvatarProfile/AvatarProfile/AvatarProfile.d.ts +26 -0
  8. package/esm/typings/src/book-components/AvatarProfile/AvatarProfile/AvatarProfileFromSource.d.ts +19 -0
  9. package/esm/typings/src/book-components/BookEditor/BookEditorInner.d.ts +15 -0
  10. package/esm/typings/src/book-components/Chat/Chat/Chat.d.ts +128 -0
  11. package/esm/typings/src/book-components/Chat/interfaces/ChatMessage.d.ts +16 -0
  12. package/esm/typings/src/book-components/Chat/interfaces/ChatParticipant.d.ts +12 -0
  13. package/esm/typings/src/book-components/Chat/utils/ExportFormat.d.ts +4 -0
  14. package/esm/typings/src/book-components/Chat/utils/addUtmParamsToUrl.d.ts +7 -0
  15. package/esm/typings/src/book-components/Chat/utils/createShortLinkForChat.d.ts +7 -0
  16. package/esm/typings/src/book-components/Chat/utils/downloadFile.d.ts +6 -0
  17. package/esm/typings/src/book-components/Chat/utils/exportChatHistory.d.ts +11 -0
  18. package/esm/typings/src/book-components/Chat/utils/generatePdfContent.d.ts +10 -0
  19. package/esm/typings/src/book-components/Chat/utils/generateQrDataUrl.d.ts +7 -0
  20. package/esm/typings/src/book-components/Chat/utils/getPromptbookBranding.d.ts +6 -0
  21. package/esm/typings/src/book-components/Chat/utils/messagesToHtml.d.ts +10 -0
  22. package/esm/typings/src/book-components/Chat/utils/messagesToJson.d.ts +7 -0
  23. package/esm/typings/src/book-components/Chat/utils/messagesToMarkdown.d.ts +10 -0
  24. package/esm/typings/src/book-components/Chat/utils/messagesToText.d.ts +10 -0
  25. package/esm/typings/src/config.d.ts +13 -0
  26. package/esm/typings/src/execution/ExecutionTask.d.ts +12 -13
  27. package/esm/typings/src/llm-providers/openai/OpenAiCompatibleExecutionTools.d.ts +8 -0
  28. package/esm/typings/src/playground/permanent/error-handling-playground.d.ts +5 -0
  29. package/esm/typings/src/utils/organization/preserve.d.ts +21 -0
  30. package/esm/typings/src/version.d.ts +1 -1
  31. package/package.json +2 -3
  32. package/umd/index.umd.js +123 -125
  33. package/umd/index.umd.js.map +1 -1
  34. package/esm/typings/src/scripting/javascript/utils/preserve.d.ts +0 -14
package/umd/index.umd.js CHANGED
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('colors'), require('express'), require('express-openapi-validator'), require('http'), require('socket.io'), require('spacetrim'), require('swagger-ui-express'), require('waitasecond'), require('crypto'), require('child_process'), require('fs/promises'), require('path'), require('rxjs'), require('prettier'), require('prettier/parser-html'), require('crypto-js/enc-hex'), require('crypto-js/sha256'), require('crypto-js'), require('mime-types'), require('papaparse')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'colors', 'express', 'express-openapi-validator', 'http', 'socket.io', 'spacetrim', 'swagger-ui-express', 'waitasecond', 'crypto', 'child_process', 'fs/promises', 'path', 'rxjs', 'prettier', 'prettier/parser-html', 'crypto-js/enc-hex', 'crypto-js/sha256', 'crypto-js', 'mime-types', 'papaparse'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["promptbook-remote-server"] = {}, global.colors, global.express, global.OpenApiValidator, global.http, global.socket_io, global.spaceTrim, global.swaggerUi, global.waitasecond, global.crypto, global.child_process, global.promises, global.path, global.rxjs, global.prettier, global.parserHtml, global.hexEncoder, global.sha256, global.cryptoJs, global.mimeTypes, global.papaparse));
5
- })(this, (function (exports, colors, express, OpenApiValidator, http, socket_io, spaceTrim, swaggerUi, waitasecond, crypto, child_process, promises, path, rxjs, prettier, parserHtml, hexEncoder, sha256, cryptoJs, mimeTypes, papaparse) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('colors'), require('express'), require('express-openapi-validator'), require('http'), require('socket.io'), require('spacetrim'), require('swagger-ui-express'), require('waitasecond'), require('crypto'), require('child_process'), require('fs/promises'), require('path'), require('rxjs'), require('prettier/parser-html'), require('prettier/parser-markdown'), require('prettier/standalone'), require('crypto-js/enc-hex'), require('crypto-js/sha256'), require('crypto-js'), require('mime-types'), require('papaparse')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'colors', 'express', 'express-openapi-validator', 'http', 'socket.io', 'spacetrim', 'swagger-ui-express', 'waitasecond', 'crypto', 'child_process', 'fs/promises', 'path', 'rxjs', 'prettier/parser-html', 'prettier/parser-markdown', 'prettier/standalone', 'crypto-js/enc-hex', 'crypto-js/sha256', 'crypto-js', 'mime-types', 'papaparse'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["promptbook-remote-server"] = {}, global.colors, global.express, global.OpenApiValidator, global.http, global.socket_io, global.spaceTrim, global.swaggerUi, global.waitasecond, global.crypto, global.child_process, global.promises, global.path, global.rxjs, global.parserHtml, global.parserMarkdown, global.standalone, global.hexEncoder, global.sha256, global.cryptoJs, global.mimeTypes, global.papaparse));
5
+ })(this, (function (exports, colors, express, OpenApiValidator, http, socket_io, spaceTrim, swaggerUi, waitasecond, crypto, child_process, promises, path, rxjs, parserHtml, parserMarkdown, standalone, hexEncoder, sha256, cryptoJs, mimeTypes, papaparse) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -31,6 +31,7 @@
31
31
  var spaceTrim__default = /*#__PURE__*/_interopDefaultLegacy(spaceTrim);
32
32
  var swaggerUi__default = /*#__PURE__*/_interopDefaultLegacy(swaggerUi);
33
33
  var parserHtml__default = /*#__PURE__*/_interopDefaultLegacy(parserHtml);
34
+ var parserMarkdown__default = /*#__PURE__*/_interopDefaultLegacy(parserMarkdown);
34
35
  var hexEncoder__default = /*#__PURE__*/_interopDefaultLegacy(hexEncoder);
35
36
  var sha256__default = /*#__PURE__*/_interopDefaultLegacy(sha256);
36
37
 
@@ -48,7 +49,7 @@
48
49
  * @generated
49
50
  * @see https://github.com/webgptorg/promptbook
50
51
  */
51
- const PROMPTBOOK_ENGINE_VERSION = '0.100.0-44';
52
+ const PROMPTBOOK_ENGINE_VERSION = '0.100.0-46';
52
53
  /**
53
54
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
54
55
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -237,6 +238,13 @@
237
238
  * @public exported from `@promptbook/core`
238
239
  */
239
240
  const DEFAULT_TASK_SIMULATED_DURATION_MS = 5 * 60 * 1000; // 5 minutes
241
+ /**
242
+ * API request timeout in milliseconds
243
+ * Can be overridden via API_REQUEST_TIMEOUT environment variable
244
+ *
245
+ * @public exported from `@promptbook/core`
246
+ */
247
+ parseInt(process.env.API_REQUEST_TIMEOUT || '90000');
240
248
  /**
241
249
  * Indicates whether pipeline logic validation is enabled. When true, the pipeline logic is checked for consistency.
242
250
  *
@@ -2021,7 +2029,7 @@
2021
2029
  * @private internal helper function
2022
2030
  */
2023
2031
  function createTask(options) {
2024
- const { taskType, taskProcessCallback, tldrProvider } = options;
2032
+ const { taskType, taskProcessCallback } = options;
2025
2033
  let { title } = options;
2026
2034
  // TODO: [🐙] DRY
2027
2035
  const taskId = `${taskType.toLowerCase().substring(0, 4)}-${$randomToken(8 /* <- TODO: To global config + Use Base58 to avoid similar char conflicts */)}`;
@@ -2031,6 +2039,7 @@
2031
2039
  const errors = [];
2032
2040
  const warnings = [];
2033
2041
  let currentValue = {};
2042
+ let customTldr = null;
2034
2043
  const partialResultSubject = new rxjs.Subject();
2035
2044
  // <- Note: Not using `BehaviorSubject` because on error we can't access the last value
2036
2045
  const finalResultPromise = /* not await */ taskProcessCallback((newOngoingResult) => {
@@ -2041,6 +2050,9 @@
2041
2050
  Object.assign(currentValue, newOngoingResult);
2042
2051
  // <- TODO: assign deep
2043
2052
  partialResultSubject.next(newOngoingResult);
2053
+ }, (tldrInfo) => {
2054
+ customTldr = tldrInfo;
2055
+ updatedAt = new Date();
2044
2056
  });
2045
2057
  finalResultPromise
2046
2058
  .catch((error) => {
@@ -2096,9 +2108,9 @@
2096
2108
  },
2097
2109
  get tldr() {
2098
2110
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
2099
- // Use custom tldr provider if available
2100
- if (tldrProvider) {
2101
- return tldrProvider(createdAt, status, currentValue, errors, warnings);
2111
+ // Use custom tldr if available
2112
+ if (customTldr) {
2113
+ return customTldr;
2102
2114
  }
2103
2115
  // Fallback to default implementation
2104
2116
  const cv = currentValue;
@@ -2369,9 +2381,9 @@
2369
2381
  */
2370
2382
  function prettifyMarkdown(content) {
2371
2383
  try {
2372
- return prettier.format(content, {
2384
+ return standalone.format(content, {
2373
2385
  parser: 'markdown',
2374
- plugins: [parserHtml__default["default"]],
2386
+ plugins: [parserMarkdown__default["default"], parserHtml__default["default"]],
2375
2387
  // TODO: DRY - make some import or auto-copy of .prettierrc
2376
2388
  endOfLine: 'lf',
2377
2389
  tabWidth: 4,
@@ -3113,7 +3125,7 @@
3113
3125
  const result = await preparePersonaExecutor({
3114
3126
  availableModels /* <- Note: Passing as JSON */,
3115
3127
  personaDescription,
3116
- }).asPromise();
3128
+ }).asPromise({ isCrashedOnError: true });
3117
3129
  const { outputParameters } = result;
3118
3130
  const { modelsRequirements: modelsRequirementsJson } = outputParameters;
3119
3131
  let modelsRequirementsUnchecked = jsonParse(modelsRequirementsJson);
@@ -4264,7 +4276,7 @@
4264
4276
  });
4265
4277
  const result = await prepareTitleExecutor({
4266
4278
  book: sources.map(({ content }) => content).join('\n\n'),
4267
- }).asPromise();
4279
+ }).asPromise({ isCrashedOnError: true });
4268
4280
  const { outputParameters } = result;
4269
4281
  const { title: titleRaw } = outputParameters;
4270
4282
  if (isVerbose) {
@@ -6496,80 +6508,74 @@
6496
6508
  });
6497
6509
  });
6498
6510
  };
6499
- const pipelineExecutor = (inputParameters) => createTask({
6500
- taskType: 'EXECUTION',
6501
- title: pipeline.title,
6502
- taskProcessCallback(updateOngoingResult) {
6503
- return pipelineExecutorWithCallback(inputParameters, async (newOngoingResult) => {
6504
- updateOngoingResult(newOngoingResult);
6505
- });
6506
- },
6507
- tldrProvider(createdAt, status, currentValue, errors) {
6508
- var _a;
6509
- // Better progress estimation based on pipeline structure
6510
- const cv = currentValue;
6511
- // Handle finished/error states
6512
- if (status === 'FINISHED') {
6513
- return {
6514
- percent: 1,
6515
- message: 'Finished',
6516
- };
6517
- }
6518
- if (status === 'ERROR') {
6519
- const errorMessage = errors.length > 0 ? errors[errors.length - 1].message : 'Error';
6520
- return {
6521
- percent: 0,
6522
- message: errorMessage,
6523
- };
6524
- }
6525
- // Calculate progress based on pipeline tasks
6526
- const totalTasks = pipeline.tasks.length;
6527
- let completedTasks = 0;
6528
- let currentTaskName = '';
6529
- // Check execution report for completed tasks
6530
- if ((_a = cv === null || cv === void 0 ? void 0 : cv.executionReport) === null || _a === void 0 ? void 0 : _a.promptExecutions) {
6531
- const executedTaskTitles = new Set(cv.executionReport.promptExecutions.map((execution) => execution.prompt.title));
6532
- // Count completed tasks by matching titles
6533
- const completedTasksByTitle = pipeline.tasks.filter(task => executedTaskTitles.has(task.title));
6534
- completedTasks = completedTasksByTitle.length;
6535
- // Find current task being executed (first task not yet completed)
6536
- const remainingTasks = pipeline.tasks.filter(task => !executedTaskTitles.has(task.title));
6537
- if (remainingTasks.length > 0) {
6538
- currentTaskName = remainingTasks[0].name;
6539
- }
6540
- }
6541
- // Calculate progress percentage
6542
- let percent = totalTasks > 0 ? completedTasks / totalTasks : 0;
6543
- // Add time-based progress for current task (assuming 5 minutes total)
6544
- if (completedTasks < totalTasks) {
6545
- const elapsedMs = new Date().getTime() - createdAt.getTime();
6546
- const totalMs = 5 * 60 * 1000; // 5 minutes
6547
- const timeProgress = Math.min(elapsedMs / totalMs, 1);
6548
- // Add partial progress for current task
6549
- percent += (1 / totalTasks) * timeProgress;
6550
- }
6551
- // Clamp to [0,1]
6552
- percent = Math.min(Math.max(percent, 0), 1);
6553
- // Generate message
6554
- let message = '';
6555
- if (currentTaskName) {
6556
- // Find the task to get its title
6557
- const currentTask = pipeline.tasks.find(task => task.name === currentTaskName);
6558
- const taskTitle = (currentTask === null || currentTask === void 0 ? void 0 : currentTask.title) || currentTaskName;
6559
- message = `Working on task ${taskTitle}`;
6560
- }
6561
- else if (completedTasks === 0) {
6562
- message = 'Starting pipeline execution';
6563
- }
6564
- else {
6565
- message = `Processing pipeline (${completedTasks}/${totalTasks} tasks completed)`;
6566
- }
6567
- return {
6568
- percent,
6569
- message,
6570
- };
6571
- },
6572
- });
6511
+ const pipelineExecutor = (inputParameters) => {
6512
+ const startTime = new Date().getTime();
6513
+ return createTask({
6514
+ taskType: 'EXECUTION',
6515
+ title: pipeline.title,
6516
+ taskProcessCallback(updateOngoingResult, updateTldr) {
6517
+ return pipelineExecutorWithCallback(inputParameters, async (newOngoingResult) => {
6518
+ var _a, _b;
6519
+ updateOngoingResult(newOngoingResult);
6520
+ // Calculate and update tldr based on pipeline progress
6521
+ const cv = newOngoingResult;
6522
+ // Calculate progress based on parameters resolved vs total parameters
6523
+ const totalParameters = pipeline.parameters.filter(p => !p.isInput).length;
6524
+ let resolvedParameters = 0;
6525
+ let currentTaskTitle = '';
6526
+ // Get the resolved parameters from output parameters
6527
+ if (cv === null || cv === void 0 ? void 0 : cv.outputParameters) {
6528
+ // Count how many output parameters have non-empty values
6529
+ resolvedParameters = Object.values(cv.outputParameters).filter(value => value !== undefined && value !== null && String(value).trim() !== '').length;
6530
+ }
6531
+ // Try to determine current task from execution report
6532
+ if (((_a = cv === null || cv === void 0 ? void 0 : cv.executionReport) === null || _a === void 0 ? void 0 : _a.promptExecutions) && cv.executionReport.promptExecutions.length > 0) {
6533
+ const lastExecution = cv.executionReport.promptExecutions[cv.executionReport.promptExecutions.length - 1];
6534
+ if ((_b = lastExecution === null || lastExecution === void 0 ? void 0 : lastExecution.prompt) === null || _b === void 0 ? void 0 : _b.title) {
6535
+ currentTaskTitle = lastExecution.prompt.title;
6536
+ }
6537
+ }
6538
+ // Calculate base progress percentage
6539
+ let percent = totalParameters > 0 ? resolvedParameters / totalParameters : 0;
6540
+ // Add time-based progress for current task if we haven't completed all parameters
6541
+ if (resolvedParameters < totalParameters) {
6542
+ const elapsedMs = new Date().getTime() - startTime;
6543
+ const estimatedTotalMs = totalParameters * 30 * 1000; // Estimate 30 seconds per parameter
6544
+ const timeProgress = Math.min(elapsedMs / estimatedTotalMs, 0.9); // Cap at 90% for time-based progress
6545
+ // If we have time progress but no parameter progress, show time progress
6546
+ if (percent === 0 && timeProgress > 0) {
6547
+ percent = Math.min(timeProgress, 0.1); // Show some progress but not more than 10%
6548
+ }
6549
+ else if (percent < 1) {
6550
+ // Add partial progress for current task
6551
+ const taskProgress = totalParameters > 0 ? (1 / totalParameters) * 0.5 : 0; // 50% of task progress
6552
+ percent = Math.min(percent + taskProgress, 0.95); // Cap at 95% until fully complete
6553
+ }
6554
+ }
6555
+ // Clamp to [0,1]
6556
+ percent = Math.min(Math.max(percent, 0), 1);
6557
+ // Generate message
6558
+ let message = '';
6559
+ if (currentTaskTitle) {
6560
+ message = `Executing: ${currentTaskTitle}`;
6561
+ }
6562
+ else if (resolvedParameters === 0) {
6563
+ message = 'Starting pipeline execution';
6564
+ }
6565
+ else if (resolvedParameters < totalParameters) {
6566
+ message = `Processing pipeline (${resolvedParameters}/${totalParameters} parameters resolved)`;
6567
+ }
6568
+ else {
6569
+ message = 'Completing pipeline execution';
6570
+ }
6571
+ updateTldr({
6572
+ percent: percent,
6573
+ message,
6574
+ });
6575
+ });
6576
+ },
6577
+ });
6578
+ };
6573
6579
  // <- TODO: Make types such as there is no need to do `as` for `createTask`
6574
6580
  return pipelineExecutor;
6575
6581
  }
@@ -7176,31 +7182,23 @@
7176
7182
  return content;
7177
7183
  }
7178
7184
 
7185
+ /**
7186
+ * @private internal for `preserve`
7187
+ */
7188
+ const _preserved = [];
7179
7189
  /**
7180
7190
  * Does nothing, but preserves the function in the bundle
7181
7191
  * Compiler is tricked into thinking the function is used
7182
7192
  *
7183
7193
  * @param value any function to preserve
7184
7194
  * @returns nothing
7185
- * @private internal function of `JavascriptExecutionTools` and `JavascriptEvalExecutionTools`
7186
- */
7187
- function preserve(func) {
7188
- // Note: NOT calling the function
7189
- (async () => {
7190
- // TODO: [💩] Change to `await forEver` or `forTime(Infinity)`
7191
- await waitasecond.forTime(100000000);
7192
- // [1]
7193
- try {
7194
- await func();
7195
- }
7196
- finally {
7197
- // do nothing
7198
- }
7199
- })();
7195
+ * @private within the repository
7196
+ */
7197
+ function $preserve(...value) {
7198
+ _preserved.push(...value);
7200
7199
  }
7201
7200
  /**
7202
- * TODO: Probably remove in favour of `keepImported`
7203
- * TODO: [1] This maybe does memory leak
7201
+ * Note: [💞] Ignore a discrepancy between file name and entity name
7204
7202
  */
7205
7203
 
7206
7204
  // Note: [💎]
@@ -7228,25 +7226,25 @@
7228
7226
  // Note: [💎]
7229
7227
  // Note: Using direct eval, following variables are in same scope as eval call so they are accessible from inside the evaluated script:
7230
7228
  const spaceTrim = (_) => spaceTrim__default["default"](_);
7231
- preserve(spaceTrim);
7229
+ $preserve(spaceTrim);
7232
7230
  const removeQuotes$1 = removeQuotes;
7233
- preserve(removeQuotes$1);
7231
+ $preserve(removeQuotes$1);
7234
7232
  const unwrapResult$1 = unwrapResult;
7235
- preserve(unwrapResult$1);
7233
+ $preserve(unwrapResult$1);
7236
7234
  const trimEndOfCodeBlock$1 = trimEndOfCodeBlock;
7237
- preserve(trimEndOfCodeBlock$1);
7235
+ $preserve(trimEndOfCodeBlock$1);
7238
7236
  const trimCodeBlock$1 = trimCodeBlock;
7239
- preserve(trimCodeBlock$1);
7237
+ $preserve(trimCodeBlock$1);
7240
7238
  // TODO: DRY [🍯]
7241
7239
  const trim = (str) => str.trim();
7242
- preserve(trim);
7240
+ $preserve(trim);
7243
7241
  // TODO: DRY [🍯]
7244
7242
  const reverse = (str) => str.split('').reverse().join('');
7245
- preserve(reverse);
7243
+ $preserve(reverse);
7246
7244
  const removeEmojis$1 = removeEmojis;
7247
- preserve(removeEmojis$1);
7245
+ $preserve(removeEmojis$1);
7248
7246
  const prettifyMarkdown$1 = prettifyMarkdown;
7249
- preserve(prettifyMarkdown$1);
7247
+ $preserve(prettifyMarkdown$1);
7250
7248
  //-------[n12:]---
7251
7249
  const capitalize$1 = capitalize;
7252
7250
  const decapitalize$1 = decapitalize;
@@ -7262,18 +7260,18 @@
7262
7260
  // TODO: DRY [🍯]
7263
7261
  Array.from(parseKeywordsFromString(input)).join(', '); /* <- TODO: [🧠] What is the best format comma list, bullet list,...? */
7264
7262
  const normalizeTo_SCREAMING_CASE$1 = normalizeTo_SCREAMING_CASE;
7265
- preserve(capitalize$1);
7266
- preserve(decapitalize$1);
7267
- preserve(nameToUriPart$1);
7268
- preserve(nameToUriParts$1);
7269
- preserve(removeDiacritics$1);
7270
- preserve(normalizeWhitespaces$1);
7271
- preserve(normalizeToKebabCase$1);
7272
- preserve(normalizeTo_camelCase$1);
7273
- preserve(normalizeTo_snake_case$1);
7274
- preserve(normalizeTo_PascalCase$1);
7275
- preserve(parseKeywords);
7276
- preserve(normalizeTo_SCREAMING_CASE$1);
7263
+ $preserve(capitalize$1);
7264
+ $preserve(decapitalize$1);
7265
+ $preserve(nameToUriPart$1);
7266
+ $preserve(nameToUriParts$1);
7267
+ $preserve(removeDiacritics$1);
7268
+ $preserve(normalizeWhitespaces$1);
7269
+ $preserve(normalizeToKebabCase$1);
7270
+ $preserve(normalizeTo_camelCase$1);
7271
+ $preserve(normalizeTo_snake_case$1);
7272
+ $preserve(normalizeTo_PascalCase$1);
7273
+ $preserve(parseKeywords);
7274
+ $preserve(normalizeTo_SCREAMING_CASE$1);
7277
7275
  //-------[/n12]---
7278
7276
  if (!script.includes('return')) {
7279
7277
  script = `return ${script}`;