@promptbook/node 0.71.0-20 → 0.71.0-21

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.
@@ -1,9 +1,9 @@
1
1
  import { PROMPTBOOK_VERSION } from '../version';
2
2
  import { createCollectionFromDirectory } from '../collection/constructors/createCollectionFromDirectory';
3
+ import { $provideExecutablesForNode } from '../executables/$provideExecutablesForNode';
3
4
  import { $provideExecutionToolsForNode } from '../execution/utils/$provideExecutionToolsForNode';
4
5
  import { $provideLlmToolsConfigurationFromEnv } from '../llm-providers/_common/register/$provideLlmToolsConfigurationFromEnv';
5
6
  import { $provideLlmToolsFromEnv } from '../llm-providers/_common/register/$provideLlmToolsFromEnv';
6
- import { $provideExecutablesForNode } from '../scrapers/_common/register/$provideExecutablesForNode';
7
7
  import { $provideFilesystemForNode } from '../scrapers/_common/register/$provideFilesystemForNode';
8
8
  import { $provideScrapersForNode } from '../scrapers/_common/register/$provideScrapersForNode';
9
9
  import { FileCacheStorage } from '../storage/file-cache-storage/FileCacheStorage';
@@ -11,10 +11,10 @@ import { $execCommand } from '../utils/execCommand/$execCommand';
11
11
  import { $execCommands } from '../utils/execCommand/$execCommands';
12
12
  export { PROMPTBOOK_VERSION };
13
13
  export { createCollectionFromDirectory };
14
+ export { $provideExecutablesForNode };
14
15
  export { $provideExecutionToolsForNode };
15
16
  export { $provideLlmToolsConfigurationFromEnv };
16
17
  export { $provideLlmToolsFromEnv };
17
- export { $provideExecutablesForNode };
18
18
  export { $provideFilesystemForNode };
19
19
  export { $provideScrapersForNode };
20
20
  export { FileCacheStorage };
@@ -14,6 +14,7 @@ import type { PrettifyOptions } from '../conversion/prettify/PrettifyOptions';
14
14
  import type { renderPipelineMermaidOptions } from '../conversion/prettify/renderPipelineMermaidOptions';
15
15
  import type { CallbackInterfaceToolsOptions } from '../dialogs/callback/CallbackInterfaceToolsOptions';
16
16
  import type { ErrorJson } from '../errors/utils/ErrorJson';
17
+ import type { LocateAppOptions } from '../executables/locateApp';
17
18
  import type { AvailableModel } from '../execution/AvailableModel';
18
19
  import type { CommonToolsOptions } from '../execution/CommonToolsOptions';
19
20
  import type { CreatePipelineExecutorOptions } from '../execution/createPipelineExecutor/00-CreatePipelineExecutorOptions';
@@ -254,6 +255,7 @@ export type { PrettifyOptions };
254
255
  export type { renderPipelineMermaidOptions };
255
256
  export type { CallbackInterfaceToolsOptions };
256
257
  export type { ErrorJson };
258
+ export type { LocateAppOptions };
257
259
  export type { AvailableModel };
258
260
  export type { CommonToolsOptions };
259
261
  export type { CreatePipelineExecutorOptions };
@@ -1,5 +1,5 @@
1
- import type { Executables } from '../../../execution/Executables';
2
- import type { PrepareAndScrapeOptions } from '../../../prepare/PrepareAndScrapeOptions';
1
+ import type { Executables } from '../execution/Executables';
2
+ import type { PrepareAndScrapeOptions } from '../prepare/PrepareAndScrapeOptions';
3
3
  /**
4
4
  * @@@
5
5
  *
@@ -7,6 +7,6 @@ import type { PrepareAndScrapeOptions } from '../../../prepare/PrepareAndScrapeO
7
7
  */
8
8
  export declare function $provideExecutablesForNode(options?: PrepareAndScrapeOptions): Promise<Executables>;
9
9
  /**
10
- * TODO: [🧠] THis should be maybe in different folder
10
+ * TODO: [🧠] Allow to override the executables without need to call `locatePandoc` / `locateLibreoffice` in case of provided
11
11
  * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
12
12
  */
@@ -0,0 +1,11 @@
1
+ import type { string_executable_path } from '../../types/typeAliases';
2
+ /**
3
+ * @@@
4
+ *
5
+ * @private within the repository
6
+ */
7
+ export declare function locateLibreoffice(): Promise<string_executable_path>;
8
+ /**
9
+ * TODO: [🧠][♿] Maybe export through `@promptbook/node` OR `@promptbook/legacy-documents`
10
+ * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
11
+ */
@@ -0,0 +1,11 @@
1
+ import type { string_executable_path } from '../../types/typeAliases';
2
+ /**
3
+ * @@@
4
+ *
5
+ * @private within the repository
6
+ */
7
+ export declare function locatePandoc(): Promise<string_executable_path>;
8
+ /**
9
+ * TODO: [🧠][♿] Maybe export through `@promptbook/node` OR `@promptbook/documents`
10
+ * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
11
+ */
@@ -0,0 +1,33 @@
1
+ import type { RequireAtLeastOne } from 'type-fest';
2
+ import type { string_executable_path } from '../types/typeAliases';
3
+ /**
4
+ * Options for locating any application
5
+ */
6
+ export interface LocateAppOptions {
7
+ /**
8
+ * Name of the application
9
+ */
10
+ appName: string;
11
+ /**
12
+ * Name of the executable on Linux
13
+ */
14
+ linuxWhich?: string;
15
+ /**
16
+ * Path suffix on Windows
17
+ */
18
+ windowsSuffix?: string;
19
+ /**
20
+ * Name of the application on macOS
21
+ */
22
+ macOsName?: string;
23
+ }
24
+ /**
25
+ * Locates an application on the system
26
+ *
27
+ * @private within the repository
28
+ */
29
+ export declare function locateApp(options: RequireAtLeastOne<LocateAppOptions, 'linuxWhich' | 'windowsSuffix' | 'macOsName'>): Promise<string_executable_path>;
30
+ /**
31
+ * TODO: [🧠][♿] Maybe export through `@promptbook/node`
32
+ * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
33
+ */
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,12 @@
1
+ import type { LocateAppOptions } from '../locateApp';
2
+ import type { string_executable_path } from '../../types/typeAliases';
3
+ /**
4
+ * @@@
5
+ *
6
+ * @private within the repository
7
+ */
8
+ export declare function locateAppOnLinux({ appName, linuxWhich, }: Pick<Required<LocateAppOptions>, 'appName' | 'linuxWhich'>): Promise<string_executable_path>;
9
+ /**
10
+ * TODO: [🧠][♿] Maybe export through `@promptbook/node`
11
+ * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
12
+ */
@@ -0,0 +1,12 @@
1
+ import type { string_executable_path } from '../../types/typeAliases';
2
+ import type { LocateAppOptions } from '../locateApp';
3
+ /**
4
+ * @@@
5
+ *
6
+ * @private within the repository
7
+ */
8
+ export declare function locateAppOnMacOs({ appName, macOsName, }: Pick<Required<LocateAppOptions>, 'appName' | 'macOsName'>): Promise<string_executable_path>;
9
+ /**
10
+ * TODO: [🧠][♿] Maybe export through `@promptbook/node`
11
+ * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
12
+ */
@@ -0,0 +1,12 @@
1
+ import type { string_executable_path } from '../../types/typeAliases';
2
+ import type { LocateAppOptions } from '../locateApp';
3
+ /**
4
+ * @@@
5
+ *
6
+ * @private within the repository
7
+ */
8
+ export declare function locateAppOnWindows({ appName, windowsSuffix, }: Pick<Required<LocateAppOptions>, 'appName' | 'windowsSuffix'>): Promise<string_executable_path>;
9
+ /**
10
+ * TODO: [🧠][♿] Maybe export through `@promptbook/node`
11
+ * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
12
+ */
@@ -0,0 +1,11 @@
1
+ import type { FilesystemTools } from '../../execution/FilesystemTools';
2
+ /**
3
+ * Checks if the file is executable
4
+ *
5
+ * @private within the repository
6
+ */
7
+ export declare function isExecutable(path: string, fs: FilesystemTools): Promise<boolean>;
8
+ /**
9
+ * Note: Not [~🟢~] because it is not directly dependent on `fs
10
+ * TODO: [🖇] What about symlinks?
11
+ */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/node",
3
- "version": "0.71.0-20",
3
+ "version": "0.71.0-21",
4
4
  "description": "Supercharge your use of large language models",
5
5
  "private": false,
6
6
  "sideEffects": false,
@@ -52,7 +52,7 @@
52
52
  "module": "./esm/index.es.js",
53
53
  "typings": "./esm/typings/src/_packages/node.index.d.ts",
54
54
  "peerDependencies": {
55
- "@promptbook/core": "0.71.0-20"
55
+ "@promptbook/core": "0.71.0-21"
56
56
  },
57
57
  "dependencies": {
58
58
  "colors": "1.4.0",
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('fs/promises'), require('path'), require('spacetrim'), require('prettier'), require('prettier/parser-html'), require('waitasecond'), require('papaparse'), require('crypto-js'), require('crypto-js/enc-hex'), require('mime-types'), require('dotenv'), require('crypto-js/sha256'), require('child_process')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'colors', 'fs/promises', 'path', 'spacetrim', 'prettier', 'prettier/parser-html', 'waitasecond', 'papaparse', 'crypto-js', 'crypto-js/enc-hex', 'mime-types', 'dotenv', 'crypto-js/sha256', 'child_process'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["promptbook-node"] = {}, global.colors, global.promises, global.path, global.spaceTrim, global.prettier, global.parserHtml, global.waitasecond, global.papaparse, global.cryptoJs, global.hexEncoder, global.mimeTypes, global.dotenv, global.sha256, global.child_process));
5
- })(this, (function (exports, colors, promises, path, spaceTrim, prettier, parserHtml, waitasecond, papaparse, cryptoJs, hexEncoder, mimeTypes, dotenv, sha256, child_process) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('colors'), require('fs/promises'), require('path'), require('spacetrim'), require('prettier'), require('prettier/parser-html'), require('waitasecond'), require('papaparse'), require('crypto-js'), require('crypto-js/enc-hex'), require('mime-types'), require('child_process'), require('util'), require('dotenv'), require('crypto-js/sha256')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'colors', 'fs/promises', 'path', 'spacetrim', 'prettier', 'prettier/parser-html', 'waitasecond', 'papaparse', 'crypto-js', 'crypto-js/enc-hex', 'mime-types', 'child_process', 'util', 'dotenv', 'crypto-js/sha256'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["promptbook-node"] = {}, global.colors, global.promises, global.path, global.spaceTrim, global.prettier, global.parserHtml, global.waitasecond, global.papaparse, global.cryptoJs, global.hexEncoder, global.mimeTypes, global.child_process, global.util, global.dotenv, global.sha256));
5
+ })(this, (function (exports, colors, promises, path, spaceTrim, prettier, parserHtml, waitasecond, papaparse, cryptoJs, hexEncoder, mimeTypes, child_process, util, dotenv, sha256) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -35,7 +35,7 @@
35
35
  /**
36
36
  * The version of the Promptbook library
37
37
  */
38
- var PROMPTBOOK_VERSION = '0.71.0-19';
38
+ var PROMPTBOOK_VERSION = '0.71.0-20';
39
39
  // TODO: [main] !!!! List here all the versions and annotate + put into script
40
40
 
41
41
  /*! *****************************************************************************
@@ -4747,7 +4747,6 @@
4747
4747
  * TODO: [®] DRY Register logic
4748
4748
  */
4749
4749
 
4750
- // TODO: !!!!!!last - Maybe delete this function
4751
4750
  /**
4752
4751
  * Creates a message with all registered scrapers
4753
4752
  *
@@ -8201,6 +8200,301 @@
8201
8200
  */
8202
8201
  var $isRunningInNode = new Function("\n try {\n return this === global;\n } catch (e) {\n return false;\n }\n");
8203
8202
 
8203
+ // Note: We want to use the `exec` as async function
8204
+ var exec$1 = util.promisify(child_process.exec);
8205
+ /**
8206
+ * @@@
8207
+ *
8208
+ * @private within the repository
8209
+ */
8210
+ function locateAppOnLinux(_a) {
8211
+ var appName = _a.appName, linuxWhich = _a.linuxWhich;
8212
+ return __awaiter(this, void 0, void 0, function () {
8213
+ var _b, stderr, stdout;
8214
+ return __generator(this, function (_c) {
8215
+ switch (_c.label) {
8216
+ case 0: return [4 /*yield*/, exec$1("which ".concat(linuxWhich))];
8217
+ case 1:
8218
+ _b = _c.sent(), stderr = _b.stderr, stdout = _b.stdout;
8219
+ if (!stderr && stdout) {
8220
+ return [2 /*return*/, stdout.trim()];
8221
+ }
8222
+ throw new Error("Can not locate app ".concat(appName, " on Linux.\n ").concat(stderr));
8223
+ }
8224
+ });
8225
+ });
8226
+ }
8227
+ /**
8228
+ * TODO: [🧠][♿] Maybe export through `@promptbook/node`
8229
+ * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
8230
+ */
8231
+
8232
+ /**
8233
+ * @@@
8234
+ *
8235
+ * @public exported from `@promptbook/node`
8236
+ */
8237
+ function $provideFilesystemForNode(options) {
8238
+ if (!$isRunningInNode()) {
8239
+ throw new EnvironmentMismatchError('Function `$provideFilesystemForNode` works only in Node.js environment');
8240
+ }
8241
+ var _a = (options || {}).isVerbose, isVerbose = _a === void 0 ? DEFAULT_IS_VERBOSE : _a;
8242
+ TODO_USE(isVerbose);
8243
+ return {
8244
+ stat: promises.stat,
8245
+ access: promises.access,
8246
+ constants: promises.constants,
8247
+ readFile: promises.readFile,
8248
+ readdir: promises.readdir,
8249
+ };
8250
+ }
8251
+ /**
8252
+ * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
8253
+ */
8254
+
8255
+ /**
8256
+ * Checks if the file is executable
8257
+ *
8258
+ * @private within the repository
8259
+ */
8260
+ function isExecutable(path, fs) {
8261
+ return __awaiter(this, void 0, void 0, function () {
8262
+ return __generator(this, function (_a) {
8263
+ switch (_a.label) {
8264
+ case 0:
8265
+ _a.trys.push([0, 2, , 3]);
8266
+ return [4 /*yield*/, fs.access(path, fs.constants.X_OK)];
8267
+ case 1:
8268
+ _a.sent();
8269
+ return [2 /*return*/, true];
8270
+ case 2:
8271
+ _a.sent();
8272
+ return [2 /*return*/, false];
8273
+ case 3: return [2 /*return*/];
8274
+ }
8275
+ });
8276
+ });
8277
+ }
8278
+ /**
8279
+ * Note: Not [~🟢~] because it is not directly dependent on `fs
8280
+ * TODO: [🖇] What about symlinks?
8281
+ */
8282
+
8283
+ // Note: Module `userhome` has no types available, so it is imported using `require`
8284
+ // @see https://stackoverflow.com/questions/37000981/how-to-import-node-module-in-typescript-without-type-definitions
8285
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
8286
+ var userhome = require('userhome');
8287
+ // Note: We want to use the `exec` as async function
8288
+ var exec = util.promisify(child_process.exec);
8289
+ /**
8290
+ * @@@
8291
+ *
8292
+ * @private within the repository
8293
+ */
8294
+ function locateAppOnMacOs(_a) {
8295
+ var appName = _a.appName, macOsName = _a.macOsName;
8296
+ return __awaiter(this, void 0, void 0, function () {
8297
+ var toExec, regPath, altPath, _b, stderr, stdout;
8298
+ return __generator(this, function (_c) {
8299
+ switch (_c.label) {
8300
+ case 0:
8301
+ toExec = "/Contents/MacOS/".concat(macOsName);
8302
+ regPath = "/Applications/".concat(macOsName, ".app") + toExec;
8303
+ altPath = userhome(regPath.slice(1));
8304
+ return [4 /*yield*/, isExecutable(regPath, $provideFilesystemForNode())];
8305
+ case 1:
8306
+ if (!_c.sent()) return [3 /*break*/, 2];
8307
+ return [2 /*return*/, regPath];
8308
+ case 2: return [4 /*yield*/, isExecutable(altPath, $provideFilesystemForNode())];
8309
+ case 3:
8310
+ if (_c.sent()) {
8311
+ return [2 /*return*/, altPath];
8312
+ }
8313
+ _c.label = 4;
8314
+ case 4: return [4 /*yield*/, exec("mdfind 'kMDItemDisplayName == \"".concat(macOsName, "\" && kMDItemKind == Application'"))];
8315
+ case 5:
8316
+ _b = _c.sent(), stderr = _b.stderr, stdout = _b.stdout;
8317
+ if (!stderr && stdout) {
8318
+ return [2 /*return*/, stdout.trim() + toExec];
8319
+ }
8320
+ throw new Error("Can not locate app ".concat(appName, " on macOS.\n ").concat(stderr));
8321
+ }
8322
+ });
8323
+ });
8324
+ }
8325
+ /**
8326
+ * TODO: [🧠][♿] Maybe export through `@promptbook/node`
8327
+ * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
8328
+ */
8329
+
8330
+ /**
8331
+ * @@@
8332
+ *
8333
+ * @private within the repository
8334
+ */
8335
+ function locateAppOnWindows(_a) {
8336
+ var appName = _a.appName, windowsSuffix = _a.windowsSuffix;
8337
+ return __awaiter(this, void 0, void 0, function () {
8338
+ var prefixes, prefixes_1, prefixes_1_1, prefix, path$1, e_1_1;
8339
+ var e_1, _b;
8340
+ return __generator(this, function (_c) {
8341
+ switch (_c.label) {
8342
+ case 0:
8343
+ prefixes = [
8344
+ process.env.LOCALAPPDATA,
8345
+ path.join(process.env.LOCALAPPDATA || '', 'Programs'),
8346
+ process.env.PROGRAMFILES,
8347
+ process.env['PROGRAMFILES(X86)'],
8348
+ ];
8349
+ _c.label = 1;
8350
+ case 1:
8351
+ _c.trys.push([1, 6, 7, 8]);
8352
+ prefixes_1 = __values(prefixes), prefixes_1_1 = prefixes_1.next();
8353
+ _c.label = 2;
8354
+ case 2:
8355
+ if (!!prefixes_1_1.done) return [3 /*break*/, 5];
8356
+ prefix = prefixes_1_1.value;
8357
+ path$1 = prefix + windowsSuffix;
8358
+ return [4 /*yield*/, isExecutable(path$1, $provideFilesystemForNode())];
8359
+ case 3:
8360
+ if (_c.sent()) {
8361
+ return [2 /*return*/, path$1];
8362
+ }
8363
+ _c.label = 4;
8364
+ case 4:
8365
+ prefixes_1_1 = prefixes_1.next();
8366
+ return [3 /*break*/, 2];
8367
+ case 5: return [3 /*break*/, 8];
8368
+ case 6:
8369
+ e_1_1 = _c.sent();
8370
+ e_1 = { error: e_1_1 };
8371
+ return [3 /*break*/, 8];
8372
+ case 7:
8373
+ try {
8374
+ if (prefixes_1_1 && !prefixes_1_1.done && (_b = prefixes_1.return)) _b.call(prefixes_1);
8375
+ }
8376
+ finally { if (e_1) throw e_1.error; }
8377
+ return [7 /*endfinally*/];
8378
+ case 8: throw new Error("Can not locate app ".concat(appName, " on Windows."));
8379
+ }
8380
+ });
8381
+ });
8382
+ }
8383
+ /**
8384
+ * TODO: [🧠][♿] Maybe export through `@promptbook/node`
8385
+ * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
8386
+ */
8387
+
8388
+ /**
8389
+ * Locates an application on the system
8390
+ *
8391
+ * @private within the repository
8392
+ */
8393
+ function locateApp(options) {
8394
+ if (!$isRunningInNode()) {
8395
+ throw new EnvironmentMismatchError('Locating apps works only in Node.js environment');
8396
+ }
8397
+ var appName = options.appName, linuxWhich = options.linuxWhich, windowsSuffix = options.windowsSuffix, macOsName = options.macOsName;
8398
+ if (process.platform === 'win32') {
8399
+ if (windowsSuffix) {
8400
+ return locateAppOnWindows({ appName: appName, windowsSuffix: windowsSuffix });
8401
+ }
8402
+ else {
8403
+ throw new Error("".concat(appName, " is not available on Windows."));
8404
+ }
8405
+ }
8406
+ else if (process.platform === 'darwin') {
8407
+ if (macOsName) {
8408
+ return locateAppOnMacOs({ appName: appName, macOsName: macOsName });
8409
+ }
8410
+ else {
8411
+ throw new Error("".concat(appName, " is not available on macOS."));
8412
+ }
8413
+ }
8414
+ else {
8415
+ if (linuxWhich) {
8416
+ return locateAppOnLinux({ appName: appName, linuxWhich: linuxWhich });
8417
+ }
8418
+ else {
8419
+ throw new Error("".concat(appName, " is not available on Linux."));
8420
+ }
8421
+ }
8422
+ }
8423
+ /**
8424
+ * TODO: [🧠][♿] Maybe export through `@promptbook/node`
8425
+ * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
8426
+ */
8427
+
8428
+ /**
8429
+ * @@@
8430
+ *
8431
+ * @private within the repository
8432
+ */
8433
+ function locateLibreoffice() {
8434
+ return locateApp({
8435
+ appName: 'Libreoffice',
8436
+ linuxWhich: 'libreoffice',
8437
+ windowsSuffix: '\\LibreOffice\\program\\soffice.exe',
8438
+ macOsName: 'LibreOffice',
8439
+ });
8440
+ }
8441
+ /**
8442
+ * TODO: [🧠][♿] Maybe export through `@promptbook/node` OR `@promptbook/legacy-documents`
8443
+ * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
8444
+ */
8445
+
8446
+ /**
8447
+ * @@@
8448
+ *
8449
+ * @private within the repository
8450
+ */
8451
+ function locatePandoc() {
8452
+ return locateApp({
8453
+ appName: 'Pandoc',
8454
+ linuxWhich: 'pandoc',
8455
+ windowsSuffix: '\\Pandoc\\pandoc.exe',
8456
+ macOsName: 'Pandoc',
8457
+ });
8458
+ }
8459
+ /**
8460
+ * TODO: [🧠][♿] Maybe export through `@promptbook/node` OR `@promptbook/documents`
8461
+ * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
8462
+ */
8463
+
8464
+ /**
8465
+ * @@@
8466
+ *
8467
+ * @public exported from `@promptbook/node`
8468
+ */
8469
+ function $provideExecutablesForNode(options) {
8470
+ return __awaiter(this, void 0, void 0, function () {
8471
+ var _a, _b, isAutoInstalled, _c, isVerbose;
8472
+ var _d;
8473
+ return __generator(this, function (_e) {
8474
+ switch (_e.label) {
8475
+ case 0:
8476
+ if (!$isRunningInNode()) {
8477
+ throw new EnvironmentMismatchError('Function `$getScrapersForNode` works only in Node.js environment');
8478
+ }
8479
+ _a = options || {}, _b = _a.isAutoInstalled, isAutoInstalled = _b === void 0 ? DEFAULT_IS_AUTO_INSTALLED : _b, _c = _a.isVerbose, isVerbose = _c === void 0 ? DEFAULT_IS_VERBOSE : _c;
8480
+ TODO_USE(isAutoInstalled); // <- TODO: [🔱][🧠] Auto-install the executables
8481
+ TODO_USE(isVerbose);
8482
+ _d = {};
8483
+ return [4 /*yield*/, locatePandoc()];
8484
+ case 1:
8485
+ _d.pandocPath = _e.sent();
8486
+ return [4 /*yield*/, locateLibreoffice()];
8487
+ case 2: return [2 /*return*/, (_d.libreOfficePath = _e.sent(),
8488
+ _d)];
8489
+ }
8490
+ });
8491
+ });
8492
+ }
8493
+ /**
8494
+ * TODO: [🧠] Allow to override the executables without need to call `locatePandoc` / `locateLibreoffice` in case of provided
8495
+ * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
8496
+ */
8497
+
8204
8498
  /**
8205
8499
  * @@@
8206
8500
  *
@@ -8431,57 +8725,6 @@
8431
8725
  * TODO: [®] DRY Register logic
8432
8726
  */
8433
8727
 
8434
- /**
8435
- * @@@
8436
- *
8437
- * @public exported from `@promptbook/node`
8438
- */
8439
- function $provideExecutablesForNode(options) {
8440
- return __awaiter(this, void 0, void 0, function () {
8441
- var _a, _b, isAutoInstalled, _c, isVerbose;
8442
- return __generator(this, function (_d) {
8443
- if (!$isRunningInNode()) {
8444
- throw new EnvironmentMismatchError('Function `$getScrapersForNode` works only in Node.js environment');
8445
- }
8446
- _a = options || {}, _b = _a.isAutoInstalled, isAutoInstalled = _b === void 0 ? DEFAULT_IS_AUTO_INSTALLED : _b, _c = _a.isVerbose, isVerbose = _c === void 0 ? DEFAULT_IS_VERBOSE : _c;
8447
- TODO_USE(isAutoInstalled);
8448
- TODO_USE(isVerbose);
8449
- return [2 /*return*/, {
8450
- // TODO: !!!!!! use `locate-app` library here
8451
- pandocPath: 'C:/Users/me/AppData/Local/Pandoc/pandoc.exe',
8452
- libreOfficePath: 'C:/Program Files/LibreOffice/program/swriter.exe',
8453
- }];
8454
- });
8455
- });
8456
- }
8457
- /**
8458
- * TODO: [🧠] THis should be maybe in different folder
8459
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
8460
- */
8461
-
8462
- /**
8463
- * @@@
8464
- *
8465
- * @public exported from `@promptbook/node`
8466
- */
8467
- function $provideFilesystemForNode(options) {
8468
- if (!$isRunningInNode()) {
8469
- throw new EnvironmentMismatchError('Function `$provideFilesystemForNode` works only in Node.js environment');
8470
- }
8471
- var _a = (options || {}).isVerbose, isVerbose = _a === void 0 ? DEFAULT_IS_VERBOSE : _a;
8472
- TODO_USE(isVerbose);
8473
- return {
8474
- stat: promises.stat,
8475
- access: promises.access,
8476
- constants: promises.constants,
8477
- readFile: promises.readFile,
8478
- readdir: promises.readdir,
8479
- };
8480
- }
8481
- /**
8482
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
8483
- */
8484
-
8485
8728
  /**
8486
8729
  * @@@
8487
8730
  *