@promptbook/node 0.86.6 → 0.86.8

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
@@ -29,7 +29,7 @@ var BOOK_LANGUAGE_VERSION = '1.0.0';
29
29
  * @generated
30
30
  * @see https://github.com/webgptorg/promptbook
31
31
  */
32
- var PROMPTBOOK_ENGINE_VERSION = '0.86.6';
32
+ var PROMPTBOOK_ENGINE_VERSION = '0.86.8';
33
33
  /**
34
34
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
35
35
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -11501,9 +11501,11 @@ var FileCacheStorage = /** @class */ (function () {
11501
11501
  FileCacheStorage.prototype.getFilenameForKey = function (key) {
11502
11502
  // TODO: [👬] DRY
11503
11503
  var name = titleToName(key);
11504
+ var nameStart = name.split('-', 2)[0] || 'unnamed';
11504
11505
  var hash = sha256(hexEncoder.parse(name)).toString( /* hex */);
11505
11506
  // <- TODO: [🥬] Encapsulate sha256 to some private utility function
11506
- return join.apply(void 0, __spreadArray(__spreadArray([this.options.rootFolderPath], __read(nameToSubfolderPath(hash /* <- TODO: [🎎] Maybe add some SHA256 prefix */)), false), ["".concat(name.substring(0, MAX_FILENAME_LENGTH), ".json")], false));
11507
+ return join.apply(void 0, __spreadArray(__spreadArray([this.options.rootFolderPath,
11508
+ nameStart], __read(nameToSubfolderPath(hash /* <- TODO: [🎎] Maybe add some SHA256 prefix */)), false), ["".concat(name.substring(0, MAX_FILENAME_LENGTH), ".json")], false));
11507
11509
  };
11508
11510
  /**
11509
11511
  * @@@ Returns the current value associated with the given key, or null if the given key does not exist in the list associated with the object.