enigma-memory 0.1.1 → 0.1.3

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.
@@ -0,0 +1,76 @@
1
+ # Installers and desktop boundary
2
+
3
+ Enigma Memory currently has one production install tier and several source-asset tiers. This page is intentionally conservative: it documents what can be used now, what can be generated from source, and what is blocked before native installer distribution.
4
+
5
+ ## Tier 1: npm package now
6
+
7
+ Use the published package path when you want the current supported local install:
8
+
9
+ ```sh
10
+ npm install -g enigma-memory
11
+ enigma quickstart --bundle ./.enigma/bundle.json --overwrite
12
+ enigma doctor
13
+ ```
14
+
15
+ The package exposes the CLI bins `enigma`, `enigma-verify`, `enigma-mcp`, `enigma-relay`, `enigma-gateway`, and `enigma-native-host`. Node.js `>=24` is required. The local quickstart writes Enigma-controlled local artifacts only; it does not prove provider deletion, model forgetting, hosted availability, compliance certification, savings, or provider-native memory removal.
16
+
17
+ ## Tier 2: generated source installer assets
18
+
19
+ The source checkout includes `scripts/build-installer-assets.mjs`, a dependency-free generator for reviewable installer source assets. Dry-run is the default:
20
+
21
+ ```sh
22
+ node scripts/build-installer-assets.mjs --out-dir dist/installer-assets
23
+ ```
24
+
25
+ Write mode is explicit:
26
+
27
+ ```sh
28
+ node scripts/build-installer-assets.mjs --out-dir dist/installer-assets --write
29
+ ```
30
+
31
+ Generated asset paths are listed in deterministic code-point lexical order:
32
+
33
+ - `homebrew/enigma-memory.rb` — Homebrew formula draft. It is not submitted to a tap by the generator; release engineering must replace the source archive URL and SHA before any tap workflow.
34
+ - `install-linux.sh` — POSIX shell source installer. It previews by default and only mutates global npm/local quickstart files when called with `--execute`.
35
+ - `install-windows.ps1` — PowerShell source installer. It previews by default and only runs `npm install -g enigma-memory`, `enigma quickstart`, and `enigma doctor` when called with `-Execute`.
36
+ - `installer-assets-manifest.json` — deterministic public manifest with checksums for the generated source assets.
37
+ - `macos-pkgbuild/README.md` — macOS package source plan and blockers, not a signed package.
38
+ - `macos-pkgbuild/manifest.json` — macOS package source metadata and blockers, not a signed package.
39
+
40
+ The generator intentionally redacts the requested output directory in its public manifest as `<requested-output-dir>`. The generated content must not embed tokens, local absolute paths, account identifiers, raw memory, provider transcripts, signing identities, or hosted credentials.
41
+
42
+ ## Native `.exe` and `.pkg` blockers
43
+
44
+ No signed Windows `.exe` or signed/notarized macOS `.pkg` exists from this generator.
45
+
46
+ Windows `.exe` distribution is blocked on:
47
+
48
+ - A selected native installer builder and reproducible input tree.
49
+ - A Windows code-signing certificate and signing workflow.
50
+ - Release review that installer logs and metadata do not expose local paths, credentials, account data, raw memory, or provider transcripts.
51
+
52
+ macOS `.pkg` distribution is blocked on:
53
+
54
+ - macOS release runner access with `pkgbuild` and `productbuild`.
55
+ - A staged package layout for npm-installed command shims and package resources.
56
+ - Developer ID Installer certificate selection, signing, and notarization.
57
+ - Release review of package scripts and evidence output.
58
+
59
+ Until those blockers are cleared, use npm or generated source scripts only.
60
+
61
+ ## Homebrew path
62
+
63
+ The formula generated under `homebrew/enigma-memory.rb` is a draft for a future tap workflow. It records the intended package name, license, Node dependency, command shims, and test shape. Before publication, release engineering must replace the placeholder tarball URL and SHA with a real release archive and confirm the formula installs only the intended package files.
64
+
65
+ ## Desktop tray model boundary
66
+
67
+ `apps/desktop/src/tray.js` is a pure tray model module. It exposes deterministic state/menu/action helpers for:
68
+
69
+ - status
70
+ - quickstart
71
+ - connect clients
72
+ - open docs
73
+ - run diagnostics
74
+ - quit
75
+
76
+ It does not start a native tray process, create OS menu items, run shell commands, launch browsers, configure MCP clients, or quit a process. Host applications such as Electron, Tauri, WebView, or native wrappers must translate its action intents into real side effects and own their own OS integration, evidence capture, and shutdown behavior.
@@ -0,0 +1,82 @@
1
+ # Memory benchmarks
2
+
3
+ Enigma includes a local, dependency-free memory benchmark harness for package-readiness evidence:
4
+
5
+ ```sh
6
+ cd enigma
7
+ node scripts/run-memory-benchmarks.mjs
8
+ node scripts/run-memory-benchmarks.mjs --out ./.enigma/memory-benchmark.json
9
+ ```
10
+
11
+ The report schema is `enigma.memory_benchmark_suite.v1`. It is public-safe by design: aggregate metrics, commitments, citations, boundaries, and cross-provider profile labels are emitted, but raw fixture memory, question text, and answer text are not included.
12
+
13
+ ## External standards and boundaries
14
+
15
+ - LoCoMo is the relevant long-term conversational-memory standard for multi-session QA, event summarization, and multimodal generation over long conversations. See https://snap-research.github.io/locomo/.
16
+ - LongMemEval is the relevant standard for information extraction, multi-session reasoning, temporal reasoning, knowledge updates, and abstention. See https://arxiv.org/abs/2410.10813.
17
+ - Letta's benchmark discussion is a useful boundary reminder: measured memory quality depends on the agent/framework/tool loop as well as memory-store mechanics. See https://www.letta.com/blog/benchmarking-ai-agent-memory/.
18
+
19
+ This repository harness does not download or run LoCoMo, LongMemEval, provider APIs, or third-party agents. It mirrors their task categories with a deterministic local fixture so Enigma can make narrow package claims about local vault operations, context-pack generation, optimizer token estimates, export/import, verification, deduplication, abstention behavior, and latency.
20
+
21
+ ## What the harness measures
22
+
23
+ The fixture creates multiple sessions with facts, a knowledge update, temporal questions, an abstention question, duplicate memory candidates, and provider profile labels for `chatgpt`, `claude`, `kimi`, `cursor`, and `local-llm`.
24
+
25
+ The harness measures local Enigma operations only:
26
+
27
+ - vault remember/update operations;
28
+ - vault export and import;
29
+ - context-pack retrieval through the passport package;
30
+ - optimizer plan token estimates and duplicate removal;
31
+ - bundle and context-pack verification;
32
+ - local baseline comparisons over the same deterministic fixture questions;
33
+ - p50/p95 latency with `performance.now`.
34
+
35
+ Reported metrics include exact-answer recall, abstention correctness, estimated prompt tokens, duplicate candidates removed where applicable, operation latency summaries, verification status, and same-boundary cross-provider profile rows.
36
+
37
+ ## Local baseline comparison
38
+
39
+ `metrics.local_baseline_comparisons` compares Enigma against deterministic local baselines only. Every row scores the same private fixture questions and keeps raw memory, question text, and answer text out of the report.
40
+
41
+ | Row | Boundary | Reported fields |
42
+ | --- | --- | --- |
43
+ | `full_context` | Supplies every active fixture memory without optimization or deduplication. | Recall, abstention correctness, estimated prompt tokens, selected memory count, p50/p95 local latency. |
44
+ | `recency_last_n` | Supplies the three most recently updated active fixture memories. | Same fields; duplicate removal is marked not applicable. |
45
+ | `keyword_filter` | Supplies active fixture memories whose content or tags match deterministic query terms. | Same fields; duplicate removal is marked not applicable. |
46
+ | `enigma_context_pack` | Uses the Enigma passport context-pack compiler and optimizer boundary. | Same fields plus duplicate-removal counts from the Enigma optimizer plan. |
47
+
48
+ These rows are local package evidence only. They do not compare hosted providers, do not use provider APIs, and do not support invoice savings, ROI, compliance, model-forgetting, or benchmark-leadership claims.
49
+
50
+ ## External competitor adapter requirements
51
+
52
+ `external_competitor_adapters` is a requirements matrix, not a score table. Each row has `status: "not_run_requires_credentials_or_runtime"`, `can_run_in_this_harness: false`, `required_artifacts`, `official_doc`, an exact `boundary_reason`, and `scores_included: false`.
53
+
54
+ | Adapter | Official source | Required artifacts before scoring | Boundary reason |
55
+ | --- | --- | --- | --- |
56
+ | Letta / MemGPT | https://docs.letta.com/concepts/memgpt/ | Letta API key or self-hosted runtime; pinned SDK such as `@letta-ai/letta-client` or `letta-client`; fixed agent/tools/model/memory config; operator-supplied dataset mapping. | This harness has no Letta credentials, SDK installation, runtime, fixed agent loop, or approved external dataset. |
57
+ | LangGraph memory | https://docs.langchain.com/oss/python/langgraph/memory | Pinned LangGraph runtime; short-term checkpointer config; namespaced long-term store config; fixed graph/model/tools/dataset mapping. | This Node local package harness does not execute a LangGraph runtime, checkpointer, store, graph, model, or adapter. |
58
+ | Zep | https://help.getzep.com/ | Zep credentials or endpoint; pinned client; temporal Context Graph or Context Lake config; ingestion and retrieval mapping. | This harness has no Zep credentials, client package, Context Graph/Context Lake runtime, ingestion job, or retrieval dataset. |
59
+ | Mem0 | https://docs.mem0.ai/ | Mem0 platform credentials or open-source runtime; pinned SDK/package versions; extraction/update/retrieval/model/tool config; dataset mapping. | This harness has no Mem0 credentials, runtime, configured memory loop, model/tool environment, or external dataset adapter. |
60
+ | OpenAI ChatGPT native memory | https://help.openai.com/en/articles/8590148-memory-faq | ChatGPT account/runtime with native memory enabled; account-safe evaluation protocol; dataset prompts; evidence capture that excludes personal data and credentials. | ChatGPT native memory is a consumer-app feature rather than a public API surface available to this local package harness. |
61
+ | Claude memory tool | https://support.anthropic.com/en/articles/11145838-using-claude-memory | Claude/provider runtime with the memory tool available; client-side tool configuration; fixed model/tool-use policy/prompts/dataset mapping; safe evidence capture. | The memory tool is provider/client-side and requires a Claude runtime plus tool environment that this benchmark does not control. |
62
+
63
+ No external adapter row contains recall, abstention, token, latency, or ranking scores. Third-party claims stay blocked until the required credentials, runtimes, and datasets are supplied and reviewed.
64
+
65
+ ## Claim limits
66
+
67
+ The benchmark report is evidence for this local deterministic fixture only. It is not provider deletion proof, model forgetting proof, compliance certification, ROI evidence, provider invoice savings evidence, benchmark leadership proof, hosted cloud readiness, or a substitute for external LoCoMo/LongMemEval evaluation.
68
+
69
+ Cross-provider rows are profile labels using the same Enigma context-pack boundary. External competitor rows are adapter requirements only; they do not call, score, or rank live provider models.
70
+
71
+ `public_claims_allowed` is intentionally narrow: deterministic local fixture execution, local recall/abstention metrics, local baseline comparison, local token estimates, duplicate removal where applicable, p50/p95 local latency, Enigma bundle/context-pack verification, and explicit withholding of third-party scores until the required external artifacts exist.
72
+
73
+ ## Extending with external datasets later
74
+
75
+ To extend this harness with real external benchmark datasets without weakening claim boundaries:
76
+
77
+ 1. Add an explicit dataset loader that reads a local file supplied by the operator; do not add network downloads to the benchmark command.
78
+ 2. Preserve source license, version, split, and checksum metadata in the report.
79
+ 3. Keep raw conversations, private memory, questions, and answers out of public reports unless the dataset license and review process explicitly allow publication.
80
+ 4. Route every candidate through the same Enigma vault, context-pack, optimizer, export, and verify operations measured here.
81
+ 5. Add separate agent/model evaluation only when the evaluated agent loop is fixed and documented; do not attribute agent/tool behavior solely to the memory store.
82
+ 6. Keep release notes bounded to the observed command, dataset, timestamp, and review approval.
@@ -0,0 +1,181 @@
1
+ # SDK and API guide
2
+
3
+ This guide covers the public package imports for `enigma-memory@0.1.3`. 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
+
5
+ ## Install and import style
6
+
7
+ ```sh
8
+ npm install enigma-memory
9
+ ```
10
+
11
+ Use ESM imports and explicit subpaths when you know the surface you need:
12
+
13
+ ```js
14
+ import { createVault, remember } from 'enigma-memory/vault';
15
+ import { createPassport, compileContextPack } from 'enigma-memory/passport';
16
+ ```
17
+
18
+ ## Package exports
19
+
20
+ ### `enigma-memory`
21
+
22
+ The package root exports the core proof helpers. Use it for canonical JSON, hashes, signatures, receipt creation, receipt-chain verification, checkpoints, Merkle sets, and deterministic memory addresses.
23
+
24
+ ```js
25
+ import { verifyReceiptChain, receiptHash, MerkleSet } from 'enigma-memory';
26
+ ```
27
+
28
+ ### `enigma-memory/vault`
29
+
30
+ The vault module creates local encrypted vault state and proof-carrying exports. Memory text is local input. Full `exportBundle` output can include a local import keyring, so publish only reviewed public summaries, receipt reports, roots, commitments, or keyring-stripped artifacts; do not use vault exports to claim provider-side deletion or model forgetting.
31
+
32
+ ```js
33
+ import { createVault, remember, exportBundle, importBundle } from 'enigma-memory/vault';
34
+
35
+ const vault = createVault({ subject_id: 'demo-subject' });
36
+ const remembered = remember({ vault, text: 'Demo project prefers local proof bundles.' });
37
+ const bundle = exportBundle({ vault });
38
+ ```
39
+
40
+ ### `enigma-memory/passport`
41
+
42
+ The passport module describes vault ownership/scope and compiles receipt-backed context packs for authorized local retrieval.
43
+
44
+ ```js
45
+ import { createPassport, compileContextPack, verifyContextPack } from 'enigma-memory/passport';
46
+
47
+ const passport = createPassport({ vault, display_name: 'Demo Developer' });
48
+ const pack = compileContextPack({ vault, passport, query: 'project preference', limit: 1 });
49
+ const checked = verifyContextPack({ contextPack: pack, passport, vault, publicKey: bundle.keyring.publicKey });
50
+ ```
51
+
52
+ ### `enigma-memory/optimizer`
53
+
54
+ The optimizer module builds deterministic, local memory-selection plans and plaintext-minimized access receipts. Token and cost helpers estimate from explicit inputs only; they do not prove ROI or provider invoice savings.
55
+
56
+ ```js
57
+ import { createMemoryOptimizationPlan, createMemoryAccessReceipt, estimateTextTokens } from 'enigma-memory/optimizer';
58
+
59
+ const plan = createMemoryOptimizationPlan({
60
+ candidates: [{ address: remembered.memory_addr, content: 'Demo project prefers local proof bundles.' }],
61
+ prompt_tokens: estimateTextTokens('Current local app context'),
62
+ });
63
+ const receipt = createMemoryAccessReceipt({ item: plan.items[0], plan });
64
+ ```
65
+
66
+ ### `enigma-memory/connectors`
67
+
68
+ The connectors module renders and manages local MCP client config for supported clients. It uses the `enigma-mcp` command and an `ENIGMA_BUNDLE` environment variable.
69
+
70
+ ```js
71
+ import { supportedClients, renderMcpConfig, doctorConnectors } from 'enigma-memory/connectors';
72
+
73
+ const config = renderMcpConfig({ env: { ENIGMA_BUNDLE: './enigma-bundle.json' } });
74
+ const report = await doctorConnectors({ clientId: 'generic-mcp' });
75
+ ```
76
+
77
+ ### `enigma-memory/mcp-server`
78
+
79
+ The MCP server module exposes descriptors, handlers, JSON-RPC handling, and a stdio server for local MCP clients.
80
+
81
+ ```js
82
+ import { toolDescriptors, handlers, handleJsonRpcRequest, startStdioServer } from 'enigma-memory/mcp-server';
83
+
84
+ const initTool = toolDescriptors.find((tool) => tool.name === 'enigma_init');
85
+ const reply = await handleJsonRpcRequest({ jsonrpc: '2.0', id: 1, method: 'tools/list' });
86
+ ```
87
+
88
+ ### `enigma-memory/relay`
89
+
90
+ The relay module exposes a local relay witness service API and demo state helpers. Local relay state is useful for development and review, but it is not hosted-cloud durability evidence.
91
+
92
+ ```js
93
+ import { createRelayState, createRelayServer, runRelayDemo } from 'enigma-memory/relay';
94
+
95
+ const state = createRelayState({ role: 'relay_witness' });
96
+ const server = createRelayServer({ state });
97
+ ```
98
+
99
+ ### `enigma-memory/gateway`
100
+
101
+ The gateway module exposes a local policy gateway service API and demo state helpers. Local gateway decisions are package/source evidence unless deployed and operated with production storage, monitoring, secrets, and incident-response controls.
102
+
103
+ ```js
104
+ import { createGatewayState, handleGatewayRequest, runGatewayDemo } from 'enigma-memory/gateway';
105
+
106
+ const state = createGatewayState({ gateway_id: 'local-gateway' });
107
+ const demo = runGatewayDemo();
108
+ ```
109
+
110
+ ### `enigma-memory/storage`
111
+
112
+ The storage module emits PostgreSQL migration and operation contracts for production storage. It is a contract/builder surface; applying migrations requires your own reviewed database environment.
113
+
114
+ ```js
115
+ import { productionStorageContract, buildPostgresMigration, buildRelayRecordUpsert } from 'enigma-memory/storage';
116
+
117
+ const contract = productionStorageContract({ schema: 'enigma' });
118
+ const migration = buildPostgresMigration({ schema: 'enigma' });
119
+ ```
120
+
121
+ ### `enigma-memory/metering`
122
+
123
+ The metering module creates content-minimized usage events and deterministic aggregates. Inputs are explicit counts and metadata; outputs do not prove provider discounts or ROI.
124
+
125
+ ```js
126
+ import { createUsageEvent, aggregateUsageEvents } from 'enigma-memory/metering';
127
+
128
+ const event = createUsageEvent({
129
+ tenant_id: 'demo-tenant',
130
+ provider: 'local',
131
+ model: 'demo-model',
132
+ prompt_tokens: 800,
133
+ completion_tokens: 120,
134
+ memory_baseline_tokens: 1200,
135
+ memory_optimized_tokens: 800,
136
+ });
137
+ const aggregate = aggregateUsageEvents({ events: [event] });
138
+ ```
139
+
140
+ ### `enigma-memory/settlement`
141
+
142
+ The settlement module creates hash-only memory jobs, capacity profiles, quotes, service receipts, receipt verification, and batches for permissionless access/accountability boundaries. It does not decentralize raw memory storage or inference.
143
+
144
+ ```js
145
+ import { createPermissionlessMemoryJob, createOperatorServiceQuote, createServiceSettlementReceipt, verifyServiceSettlementReceipt } from 'enigma-memory/settlement';
146
+
147
+ const job = createPermissionlessMemoryJob({
148
+ tenant_id: 'demo-tenant',
149
+ job_type: 'context.pack',
150
+ memory_commitment_root: 'sha256:0000000000000000000000000000000000000000000000000000000000000000',
151
+ policy_hash: 'sha256:1111111111111111111111111111111111111111111111111111111111111111',
152
+ usage_event_hash: 'sha256:2222222222222222222222222222222222222222222222222222222222222222',
153
+ requested_at: '2026-01-01T00:00:00.000Z',
154
+ expires_at: '2026-01-02T00:00:00.000Z',
155
+ max_price_amount: 10,
156
+ payment_asset: 'CREDITS',
157
+ });
158
+ ```
159
+
160
+ ## Verifying exported proof
161
+
162
+ Package consumers should verify exported bundles through the CLI or MCP verifier rather than importing source-only verifier internals. Treat full bundles as private unless you have reviewed and removed local import key material before sharing:
163
+
164
+ ```sh
165
+ enigma verify --bundle enigma-export.json
166
+ enigma-verify enigma-export.json
167
+ ```
168
+
169
+ For in-process SDK checks, use exported public keys with core receipt verification:
170
+
171
+ ```js
172
+ import { verifyReceiptChain } from 'enigma-memory';
173
+
174
+ const report = verifyReceiptChain({
175
+ receipts: bundle.receipts,
176
+ publicKey: bundle.keyring.publicKey,
177
+ expectedReceiptLogRoot: bundle.vault.receipt_log_root,
178
+ expectedActiveSetRoot: bundle.vault.active_set_root,
179
+ verifyEmbeddedReceiptLogRoot: true,
180
+ });
181
+ ```
@@ -0,0 +1,91 @@
1
+ name: Enigma Memory smoke
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ pull_request:
6
+ push:
7
+ branches:
8
+ - main
9
+
10
+ jobs:
11
+ enigma-memory-smoke:
12
+ runs-on: ubuntu-latest
13
+ permissions:
14
+ contents: read
15
+ steps:
16
+ - name: Set up Node 24
17
+ uses: actions/setup-node@v4
18
+ with:
19
+ node-version: '24'
20
+
21
+ - name: Create disposable npm project
22
+ run: npm init -y
23
+
24
+ - name: Install Enigma Memory
25
+ run: npm install enigma-memory@0.1.3
26
+
27
+ - name: Expose local benchmark script
28
+ run: |
29
+ node --input-type=module <<'JS'
30
+ import { readFile, writeFile } from 'node:fs/promises';
31
+
32
+ const pkg = JSON.parse(await readFile('package.json', 'utf8'));
33
+ pkg.scripts ??= {};
34
+ pkg.scripts['benchmark:memory-suite'] = 'node ./node_modules/enigma-memory/scripts/run-memory-benchmarks.mjs';
35
+ await writeFile('package.json', `${JSON.stringify(pkg, null, 2)}\n`, 'utf8');
36
+ JS
37
+
38
+ - name: Run Enigma quickstart
39
+ run: npx enigma quickstart --overwrite
40
+
41
+ - name: Run Enigma doctor
42
+ run: npx enigma doctor
43
+
44
+ - name: Run local memory benchmark
45
+ run: |
46
+ npm run benchmark:memory-suite -- --out benchmark-report.json
47
+ mkdir -p artifacts
48
+ cp benchmark-report.json artifacts/benchmark-report.json
49
+ echo "Saved public-safe benchmark report placeholder at artifacts/benchmark-report.json"
50
+
51
+ # Optional artifact upload placeholder:
52
+ # If your repository already permits actions/upload-artifact, uncomment a
53
+ # reviewed upload step like this. The example keeps the report saved in the
54
+ # workspace without requiring that action.
55
+ # - name: Upload benchmark report
56
+ # uses: actions/upload-artifact@v4
57
+ # with:
58
+ # name: enigma-memory-benchmark-report
59
+ # path: artifacts/benchmark-report.json
60
+
61
+ - name: Smoke test package imports
62
+ run: |
63
+ node --input-type=module <<'JS'
64
+ import { createVault, remember, exportBundle } from 'enigma-memory/vault';
65
+ import { createPassport, compileContextPack } from 'enigma-memory/passport';
66
+ import { verifyReceiptChain } from 'enigma-memory';
67
+
68
+ const vault = createVault({ subject_id: 'ci-demo-subject' });
69
+ const passport = createPassport({ vault, display_name: 'CI Demo' });
70
+ const remembered = remember({
71
+ vault,
72
+ text: 'CI smoke uses a generic non-private Enigma Memory fact.',
73
+ purpose_tags: ['ci-smoke'],
74
+ });
75
+ const pack = compileContextPack({
76
+ vault,
77
+ passport,
78
+ memory_addresses: [remembered.memory_addr],
79
+ limit: 1,
80
+ });
81
+ const bundle = exportBundle({ vault, includePlaintext: false });
82
+ const report = verifyReceiptChain({
83
+ receipts: bundle.receipts,
84
+ publicKey: bundle.keyring.publicKey,
85
+ expectedReceiptLogRoot: bundle.vault.receipt_log_root,
86
+ expectedActiveSetRoot: bundle.vault.active_set_root,
87
+ verifyEmbeddedReceiptLogRoot: true,
88
+ });
89
+ if (!report.valid) throw new Error(`receipt verification failed: ${report.errors.join('; ')}`);
90
+ console.log(JSON.stringify({ ok: true, memory_count: pack.memory_addresses.length, receipt_count: bundle.receipts.length }));
91
+ JS
@@ -0,0 +1,84 @@
1
+ import { createVault, remember, exportBundle } from 'enigma-memory/vault';
2
+ import { createPassport, compileContextPack, verifyContextPack } from 'enigma-memory/passport';
3
+ import { verifyReceiptChain } from 'enigma-memory';
4
+
5
+ const now = '2026-01-01T00:00:00.000Z';
6
+
7
+ const vault = createVault({
8
+ tenant_id: 'demo-tenant',
9
+ subject_id: 'demo-subject',
10
+ actor_id: 'demo-app',
11
+ policy_id: 'demo-local-policy',
12
+ now,
13
+ });
14
+
15
+ const remembered = remember({
16
+ vault,
17
+ text: 'Demo project prefers short context packs and local receipt verification.',
18
+ kind: 'preference',
19
+ sensitivity: 'normal',
20
+ purpose_tags: ['demo', 'local-proof'],
21
+ metadata: { demo_id: 'node-basic-memory' },
22
+ now: '2026-01-01T00:00:01.000Z',
23
+ });
24
+
25
+ const passport = createPassport({
26
+ vault,
27
+ display_name: 'Demo Developer',
28
+ now: '2026-01-01T00:00:01.500Z',
29
+ });
30
+
31
+ const contextPack = compileContextPack({
32
+ vault,
33
+ passport,
34
+ query: 'How should this demo handle memory context?',
35
+ purpose: 'demo_context',
36
+ provider: 'local',
37
+ model: 'local-demo',
38
+ memory_addresses: [remembered.memory_addr],
39
+ limit: 1,
40
+ now: '2026-01-01T00:00:02.000Z',
41
+ });
42
+
43
+ const proofBundle = exportBundle({
44
+ vault,
45
+ includePlaintext: false,
46
+ now: '2026-01-01T00:00:03.000Z',
47
+ });
48
+
49
+ const publicKey = proofBundle.keyring.publicKey;
50
+
51
+ const contextVerification = verifyContextPack({
52
+ contextPack,
53
+ passport,
54
+ vault,
55
+ publicKey,
56
+ });
57
+
58
+ const receiptVerification = verifyReceiptChain({
59
+ receipts: proofBundle.receipts,
60
+ publicKey,
61
+ expectedReceiptLogRoot: proofBundle.vault.receipt_log_root,
62
+ expectedActiveSetRoot: proofBundle.vault.active_set_root,
63
+ verifyEmbeddedReceiptLogRoot: true,
64
+ });
65
+
66
+ const summary = {
67
+ ok: contextVerification.valid === true && receiptVerification.valid === true,
68
+ vault_id: proofBundle.vault.vault_id,
69
+ passport_id: passport.passport_id,
70
+ context_pack_id: contextPack.context_pack_id,
71
+ active_memory_count: proofBundle.active_memory_addresses.length,
72
+ receipt_count: proofBundle.receipts.length,
73
+ active_set_root: proofBundle.vault.active_set_root,
74
+ receipt_log_root: proofBundle.vault.receipt_log_root,
75
+ remembered_memory_addr: remembered.memory_addr,
76
+ context_pack_memory_count: contextPack.memory_addresses.length,
77
+ verification: {
78
+ context_pack_valid: contextVerification.valid,
79
+ receipt_chain_valid: receiptVerification.valid,
80
+ receipt_errors: receiptVerification.errors,
81
+ },
82
+ };
83
+
84
+ console.log(JSON.stringify(summary, null, 2));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "enigma-memory",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "type": "module",
5
5
  "description": "Provider-agnostic AI memory passport and offline-verifiable proof layer.",
6
6
  "license": "Apache-2.0",
@@ -28,6 +28,8 @@
28
28
  "apps/native-host/README.md",
29
29
  "apps/native-host/manifests/",
30
30
  "apps/desktop/src/",
31
+ "apps/browser-extension/manifest.json",
32
+ "apps/browser-extension/src/",
31
33
  "apps/gateway/bin/",
32
34
  "apps/gateway/src/",
33
35
  "apps/relay/src/",
@@ -39,6 +41,7 @@
39
41
  "packages/connectors/src/",
40
42
  "packages/core/src/",
41
43
  "packages/enterprise/src/",
44
+ "packages/hosted-cloud/src/",
42
45
  "packages/importers/src/",
43
46
  "packages/optimizer/src/",
44
47
  "packages/mcp-server/bin/",
@@ -57,6 +60,9 @@
57
60
  "scripts/check.mjs",
58
61
  "scripts/install-enigma-local.mjs",
59
62
  "scripts/verify-registry-install.mjs",
63
+ "scripts/run-memory-benchmarks.mjs",
64
+ "scripts/build-installer-assets.mjs",
65
+ "scripts/package-browser-extension.mjs",
60
66
  "scripts/build-production-readiness-manifest.mjs",
61
67
  "scripts/build-production-backend-env-kit.mjs",
62
68
  "scripts/cloudflare-secret-env.mjs",
@@ -103,6 +109,15 @@
103
109
  "scripts/release-provenance.mjs",
104
110
  "scripts/build-review-packet.mjs",
105
111
  "scripts/build-demo-assets.mjs",
112
+ "docs/sdk-api.md",
113
+ "docs/developer-ecosystem.md",
114
+ "docs/memory-benchmarks.md",
115
+ "docs/benchmark-reproducibility.md",
116
+ "docs/installers-and-desktop.md",
117
+ "docs/browser-extension-install.md",
118
+ "docs/hosted-cloud-product.md",
119
+ "examples/",
120
+ "templates/",
106
121
  "specs/"
107
122
  ],
108
123
  "bin": {
@@ -129,6 +144,9 @@
129
144
  "cloudflare:token-request": "node scripts/build-cloudflare-token-request.mjs",
130
145
  "infrastructure:readiness": "node scripts/infrastructure-readiness.mjs",
131
146
  "memory:benchmark": "node scripts/memory-optimization-benchmark.mjs",
147
+ "benchmark:memory-suite": "node scripts/run-memory-benchmarks.mjs",
148
+ "installer:assets": "node scripts/build-installer-assets.mjs",
149
+ "browser:extension:package": "node scripts/package-browser-extension.mjs",
132
150
  "production:manifest": "node scripts/build-production-readiness-manifest.mjs",
133
151
  "production:backend-env": "node scripts/build-production-backend-env-kit.mjs",
134
152
  "production:storage": "node scripts/build-production-storage-migration.mjs",
@@ -181,7 +199,9 @@
181
199
  "./connectors": "./packages/connectors/src/index.js",
182
200
  "./core": "./packages/core/src/index.js",
183
201
  "./desktop": "./apps/desktop/src/app.js",
202
+ "./desktop/tray": "./apps/desktop/src/tray.js",
184
203
  "./enterprise": "./packages/enterprise/src/index.js",
204
+ "./hosted-cloud": "./packages/hosted-cloud/src/index.js",
185
205
  "./gateway": "./apps/gateway/src/server.mjs",
186
206
  "./importers": "./packages/importers/src/index.js",
187
207
  "./mcp-server": "./packages/mcp-server/src/index.js",