@promptbook/remote-client 0.112.0-65 → 0.112.0-66

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.
package/esm/index.es.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { spaceTrim as spaceTrim$1 } from 'spacetrim';
2
2
  import { randomBytes } from 'crypto';
3
+ import { posix, basename } from 'path';
3
4
  import { io } from 'socket.io-client';
4
5
  import { SHA256 } from 'crypto-js';
5
6
  import hexEncoder from 'crypto-js/enc-hex';
6
7
  import { parse, unparse } from 'papaparse';
7
- import { basename } from 'path';
8
8
 
9
9
  // ⚠️ WARNING: This code has been generated so that any manual changes will be overwritten
10
10
  /**
@@ -20,7 +20,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
20
20
  * @generated
21
21
  * @see https://github.com/webgptorg/promptbook
22
22
  */
23
- const PROMPTBOOK_ENGINE_VERSION = '0.112.0-65';
23
+ const PROMPTBOOK_ENGINE_VERSION = '0.112.0-66';
24
24
  /**
25
25
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
26
26
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -1231,6 +1231,29 @@ function saturate(amount) {
1231
1231
  }
1232
1232
  // TODO: Maybe implement by mix+hsl
1233
1233
 
1234
+ /**
1235
+ * Relative directory name without the `./` prefix for Git ignore rules and glob patterns.
1236
+ *
1237
+ * @private internal utility for Promptbook-owned temp files
1238
+ */
1239
+ const PROMPTBOOK_TEMP_DIRECTORY_NAME = '.promptbook';
1240
+ /**
1241
+ * Builds one project-relative path inside the shared Promptbook working directory.
1242
+ *
1243
+ * @private internal utility for Promptbook-owned temp files
1244
+ */
1245
+ function getPromptbookTempPath(...pathSegments) {
1246
+ return `./${getPromptbookTempPosixPath(...pathSegments)}`;
1247
+ }
1248
+ /**
1249
+ * Builds one POSIX path fragment inside the shared Promptbook working directory for globs and generated text files.
1250
+ *
1251
+ * @private internal utility for Promptbook-owned temp files
1252
+ */
1253
+ function getPromptbookTempPosixPath(...pathSegments) {
1254
+ return posix.join(PROMPTBOOK_TEMP_DIRECTORY_NAME, ...pathSegments);
1255
+ }
1256
+
1234
1257
  /**
1235
1258
  * Returns the same value that is passed as argument.
1236
1259
  * No side effects.
@@ -1357,6 +1380,31 @@ const CONNECTION_TIMEOUT_MS = 7 * 1000;
1357
1380
  * @private within the repository - too low-level in comparison with other `MAX_...`
1358
1381
  */
1359
1382
  const CONNECTION_RETRIES_LIMIT = 5;
1383
+ // <- TODO: [🕝] Make also `AGENTS_DIRNAME_ALTERNATIVES`
1384
+ /**
1385
+ * Where to store the temporary downloads
1386
+ *
1387
+ * Note: When the folder does not exist, it is created recursively
1388
+ *
1389
+ * @public exported from `@promptbook/core`
1390
+ */
1391
+ getPromptbookTempPath('download-cache');
1392
+ /**
1393
+ * Where to store the cache of executions for promptbook CLI
1394
+ *
1395
+ * Note: When the folder does not exist, it is created recursively
1396
+ *
1397
+ * @public exported from `@promptbook/core`
1398
+ */
1399
+ getPromptbookTempPath('execution-cache');
1400
+ /**
1401
+ * Where to store the scrape cache
1402
+ *
1403
+ * Note: When the folder does not exist, it is created recursively
1404
+ *
1405
+ * @public exported from `@promptbook/core`
1406
+ */
1407
+ getPromptbookTempPath('scrape-cache');
1360
1408
  // <- TODO: [🧜‍♂️]
1361
1409
  /**
1362
1410
  * Default settings for parsing and generating CSV files in Promptbook.