enigma-memory 0.1.7 → 0.1.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.
@@ -1296,13 +1296,34 @@ export async function loadRelayStateFromFile(path, options = {}) {
1296
1296
  }
1297
1297
  }
1298
1298
 
1299
+ function retryableRelayRenameError(error) {
1300
+ return error?.code === 'EBUSY' || error?.code === 'EPERM' || error?.code === 'EACCES';
1301
+ }
1302
+
1303
+ async function delayRelayRenameRetry(ms) {
1304
+ await new Promise((resolve) => setTimeout(resolve, ms));
1305
+ }
1306
+
1307
+ async function renameRelayStateAtomically(tempPath, filePath) {
1308
+ const delays = [10, 25, 50, 100, 200];
1309
+ for (let attempt = 0; attempt <= delays.length; attempt += 1) {
1310
+ try {
1311
+ await rename(tempPath, filePath);
1312
+ return;
1313
+ } catch (error) {
1314
+ if (attempt === delays.length || !retryableRelayRenameError(error)) throw error;
1315
+ await delayRelayRenameRetry(delays[attempt]);
1316
+ }
1317
+ }
1318
+ }
1319
+
1299
1320
  export async function saveRelayStateToFile(state, path) {
1300
1321
  const filePath = assertString(path, 'relay state file path');
1301
1322
  const snapshot = serializeRelayState(state);
1302
1323
  const tempPath = join(dirname(filePath), `.${basename(filePath)}.${randomBytes(6).toString('hex')}.tmp`);
1303
1324
  try {
1304
1325
  await writeFile(tempPath, `${JSON.stringify(snapshot, null, 2)}\n`, 'utf8');
1305
- await rename(tempPath, filePath);
1326
+ await renameRelayStateAtomically(tempPath, filePath);
1306
1327
  } catch (error) {
1307
1328
  await unlink(tempPath).catch(() => undefined);
1308
1329
  throw error;
@@ -60,7 +60,7 @@ The example app prints ids, counts, roots, and verification status only. It does
60
60
 
61
61
  ## CLI and CI loop
62
62
 
63
- The CI example installs Node 24, installs the published `enigma-memory@0.1.7` package, runs:
63
+ The CI example installs Node 24, installs the published `enigma-memory@0.1.8` package, runs:
64
64
 
65
65
  ```sh
66
66
  npx --yes --package enigma-memory enigma setup --overwrite
package/docs/sdk-api.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # SDK and API guide
2
2
 
3
- This guide covers the public package imports for `enigma-memory@0.1.7`. The SDK runs locally by default: vaults, passports, context packs, receipts, relay/gateway demo state, storage contracts, metering artifacts, and settlement artifacts are package-level developer surfaces. They are not evidence of hosted Enigma cloud, provider-side deletion, provider model forgetting, token ROI, invoice savings, compliance certification, or benchmark leadership.
3
+ This guide covers the public package imports for `enigma-memory@0.1.8`. The SDK runs locally by default: vaults, passports, context packs, receipts, relay/gateway demo state, storage contracts, metering artifacts, and settlement artifacts are package-level developer surfaces. They are not evidence of hosted Enigma cloud, provider-side deletion, provider model forgetting, token ROI, invoice savings, compliance certification, or benchmark leadership.
4
4
 
5
5
  ## Install and import style
6
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "enigma-memory",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "type": "module",
5
5
  "description": "Provider-agnostic AI memory passport and offline-verifiable proof layer.",
6
6
  "license": "Apache-2.0",
@@ -17,7 +17,7 @@ import {
17
17
  const DEFAULT_BUNDLE = '.enigma/bundle.json';
18
18
  const JSONRPC_VERSION = '2.0';
19
19
  const MCP_PROTOCOL_VERSION = '2024-11-05';
20
- const SERVER_INFO = Object.freeze({ name: 'enigma-mcp-server', version: '0.1.7' });
20
+ const SERVER_INFO = Object.freeze({ name: 'enigma-mcp-server', version: '0.1.8' });
21
21
  const JSON_RPC_ID_PATTERN = /^[A-Za-z0-9._:-]{1,128}$/;
22
22
  const JSON_RPC_ERROR = Object.freeze({
23
23
  INVALID_REQUEST: -32600,
@@ -6,7 +6,7 @@ import { fileURLToPath } from 'node:url';
6
6
 
7
7
  export const INSTALLER_ASSET_SCHEMA = 'enigma.installer_assets.v1';
8
8
  export const INSTALLER_ASSET_PACKAGE = 'enigma-memory';
9
- export const INSTALLER_ASSET_VERSION = '0.1.7';
9
+ export const INSTALLER_ASSET_VERSION = '0.1.8';
10
10
  export const INSTALLER_ASSET_GENERATED_AT = '1970-01-01T00:00:00.000Z';
11
11
 
12
12
  const SCRIPT_PATH = fileURLToPath(import.meta.url);
@@ -995,7 +995,7 @@ function buildSuiteReport(datasetRows, topK, options) {
995
995
  generated_at: options.generated_at ?? new Date().toISOString(),
996
996
  package: {
997
997
  name: 'enigma-memory',
998
- version: '0.1.7',
998
+ version: '0.1.8',
999
999
  },
1000
1000
  public_safe: true,
1001
1001
  top_k: topK,