enigma-memory 0.1.0

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.
Files changed (105) hide show
  1. package/LICENSE +55 -0
  2. package/README.md +379 -0
  3. package/apps/cli/bin/enigma.mjs +1117 -0
  4. package/apps/desktop/src/app.js +1327 -0
  5. package/apps/desktop/src/index.html +1373 -0
  6. package/apps/desktop/src/styles.css +386 -0
  7. package/apps/gateway/bin/enigma-gateway.mjs +52 -0
  8. package/apps/gateway/src/server.mjs +1403 -0
  9. package/apps/native-host/README.md +265 -0
  10. package/apps/native-host/bin/enigma-native-host.mjs +499 -0
  11. package/apps/native-host/manifests/com.enigma.native_host.chrome.json +9 -0
  12. package/apps/native-host/manifests/com.enigma.native_host.edge.json +9 -0
  13. package/apps/native-host/manifests/com.enigma.native_host.firefox.json +9 -0
  14. package/apps/relay/bin/enigma-relay.mjs +52 -0
  15. package/apps/relay/src/server.mjs +1571 -0
  16. package/apps/verifier/bin/enigma-verify.mjs +240 -0
  17. package/deploy/docker-compose.production.example.yml +150 -0
  18. package/deploy/kubernetes/enigma-backend.example.yaml +580 -0
  19. package/package.json +196 -0
  20. package/packages/adapters/PACKAGE_CONTRACT.md +47 -0
  21. package/packages/adapters/src/index.js +183 -0
  22. package/packages/boundary/src/index.js +468 -0
  23. package/packages/connectors/src/index.js +533 -0
  24. package/packages/core/src/index.js +766 -0
  25. package/packages/enterprise/src/index.js +505 -0
  26. package/packages/importers/src/index.js +1083 -0
  27. package/packages/mcp-server/bin/enigma-mcp.mjs +19 -0
  28. package/packages/mcp-server/src/index.js +1185 -0
  29. package/packages/mesh/src/index.js +531 -0
  30. package/packages/metering/PACKAGE_CONTRACT.md +20 -0
  31. package/packages/metering/src/index.js +246 -0
  32. package/packages/optimizer/src/index.js +707 -0
  33. package/packages/passport/src/index.js +651 -0
  34. package/packages/settlement/PACKAGE_CONTRACT.md +28 -0
  35. package/packages/settlement/src/index.js +369 -0
  36. package/packages/storage/PACKAGE_CONTRACT.md +23 -0
  37. package/packages/storage/src/index.js +392 -0
  38. package/packages/vault/src/index.js +904 -0
  39. package/scripts/build-ai-orchestration-plan.mjs +248 -0
  40. package/scripts/build-cloudflare-pages-release-packet.mjs +287 -0
  41. package/scripts/build-cloudflare-token-policy.mjs +239 -0
  42. package/scripts/build-cloudflare-token-request.mjs +314 -0
  43. package/scripts/build-demo-assets.mjs +263 -0
  44. package/scripts/build-edge-backend-workers.mjs +353 -0
  45. package/scripts/build-goal-completion-audit.mjs +398 -0
  46. package/scripts/build-hosted-probe-worker.mjs +191 -0
  47. package/scripts/build-operator-acceptance-packet.mjs +254 -0
  48. package/scripts/build-operator-evidence-starter.mjs +525 -0
  49. package/scripts/build-production-backend-env-kit.mjs +384 -0
  50. package/scripts/build-production-dependency-report.mjs +369 -0
  51. package/scripts/build-production-handoff-packet.mjs +475 -0
  52. package/scripts/build-production-readiness-manifest.mjs +209 -0
  53. package/scripts/build-production-status-board.mjs +297 -0
  54. package/scripts/build-production-storage-migration.mjs +86 -0
  55. package/scripts/build-production-workplan.mjs +371 -0
  56. package/scripts/build-review-packet.mjs +594 -0
  57. package/scripts/check.mjs +419 -0
  58. package/scripts/cloudflare-ops.mjs +1672 -0
  59. package/scripts/cloudflare-secret-env.mjs +128 -0
  60. package/scripts/collect-hosted-backend-live-evidence.mjs +263 -0
  61. package/scripts/infrastructure-readiness.mjs +944 -0
  62. package/scripts/install-enigma-local.mjs +270 -0
  63. package/scripts/memory-optimization-benchmark.mjs +242 -0
  64. package/scripts/monitor-live-endpoints.mjs +358 -0
  65. package/scripts/release-audit.mjs +5588 -0
  66. package/scripts/release-provenance.mjs +250 -0
  67. package/scripts/run-backend-readiness-smoke.mjs +220 -0
  68. package/scripts/validate-backup-restore-drill.mjs +166 -0
  69. package/scripts/validate-cloudflare-credentials.mjs +112 -0
  70. package/scripts/validate-cloudflare-worker-inspect.mjs +179 -0
  71. package/scripts/validate-domain-tls.mjs +248 -0
  72. package/scripts/validate-hosted-backend-live.mjs +319 -0
  73. package/scripts/validate-incident-drill.mjs +221 -0
  74. package/scripts/validate-kms-custody.mjs +235 -0
  75. package/scripts/validate-legal-compliance-approval.mjs +274 -0
  76. package/scripts/validate-monitoring-alerting.mjs +263 -0
  77. package/scripts/validate-network-access-policy.mjs +285 -0
  78. package/scripts/validate-operator-acceptance.mjs +298 -0
  79. package/scripts/validate-production-manifests.mjs +325 -0
  80. package/scripts/validate-public-site-security.mjs +252 -0
  81. package/scripts/validate-security-threat-model.mjs +285 -0
  82. package/scripts/validate-service-settlement.mjs +256 -0
  83. package/scripts/validate-support-sla.mjs +190 -0
  84. package/scripts/validate-tenant-policy-approval.mjs +228 -0
  85. package/scripts/validate-usage-metering.mjs +224 -0
  86. package/scripts/validate-whitepaper-claims.mjs +166 -0
  87. package/specs/boundary-manifest-v1.schema.json +35 -0
  88. package/specs/capsule-v1.schema.json +55 -0
  89. package/specs/claim-boundary-manifest-v1.schema.json +22 -0
  90. package/specs/connector-profile-v1.schema.json +62 -0
  91. package/specs/deletion-tombstone-v1.schema.json +26 -0
  92. package/specs/enterprise-policy-v1.schema.json +59 -0
  93. package/specs/gateway-request-v1.schema.json +32 -0
  94. package/specs/goal-completion-audit-v1.schema.json +70 -0
  95. package/specs/hosted-backend-live-evidence-v1.schema.json +147 -0
  96. package/specs/import-report-v1.schema.json +214 -0
  97. package/specs/infrastructure-readiness-manifest-v1.schema.json +130 -0
  98. package/specs/memory-event-v1.schema.json +42 -0
  99. package/specs/mesh-node-v1.schema.json +126 -0
  100. package/specs/passport-v1.schema.json +50 -0
  101. package/specs/production-handoff-packet-v1.schema.json +149 -0
  102. package/specs/receipt-v1.schema.json +61 -0
  103. package/specs/relay-record-v1.schema.json +43 -0
  104. package/specs/state-checkpoint-v1.schema.json +37 -0
  105. package/specs/trust-bundle-v1.schema.json +56 -0
package/LICENSE ADDED
@@ -0,0 +1,55 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
10
+
11
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
12
+
13
+ "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
14
+
15
+ "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
16
+
17
+ "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
18
+
19
+ "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
20
+
21
+ "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work.
22
+
23
+ "Derivative Works" shall mean any work, whether in Source or Object form, that is based on or derived from the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link or bind by name to the interfaces of, the Work and Derivative Works thereof.
24
+
25
+ "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
26
+
27
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
28
+
29
+ 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
30
+
31
+ 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution alone or by combination of their Contribution with the Work to which such Contribution was submitted. If You institute patent litigation against any entity alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
32
+
33
+ 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
34
+
35
+ (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
36
+
37
+ (b) You must cause any modified files to carry prominent notices stating that You changed the files; and
38
+
39
+ (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
40
+
41
+ (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within that NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
42
+
43
+ You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
44
+
45
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
46
+
47
+ 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
48
+
49
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
50
+
51
+ 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
52
+
53
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
54
+
55
+ END OF TERMS AND CONDITIONS
package/README.md ADDED
@@ -0,0 +1,379 @@
1
+ # Enigma
2
+
3
+ Enigma is a provider-agnostic AI memory custody and proof layer. It gives a user or enterprise a local canonical memory vault, emits offline-verifiable receipts for Enigma-controlled lifecycle events, and connects that vault to assistants through CLI, MCP, browser, desktop, relay, gateway, and enterprise policy surfaces.
4
+
5
+ Current status:
6
+
7
+ - Local production foundation: CLI, verifier, vault, passport, boundary, MCP server, connector, importer, relay, gateway, enterprise, mesh, browser-extension, and desktop scaffold code exist in this repository.
8
+ - Installable package scaffolding: package bins and module entry points are present. Until `enigma-memory` is published from the authorized npm account, use the repository path install below.
9
+ - Source-only artifacts: `docs/`, `Dockerfile`, and `docker-compose.yml` live in the source checkout. The package README and CLI help are the package-included install guides; the full runbooks require the repository or hosted docs.
10
+ - Hosted cloud is not included by default. Hosted relay/gateway/cloud operation requires deployment credentials, a domain, TLS, production durable storage, KMS/secrets, monitoring, backups, operator policy, and a completed operator acceptance packet. Local relay/gateway `--state-file` demo state does not satisfy those hosted/BYOC requirements.
11
+ - Cloudflare API/domain/hosting automation is documented but safe-by-default: [`docs/cloudflare-token-and-domain-runbook.md`](docs/cloudflare-token-and-domain-runbook.md) gives the token recipe, Registrar prerequisites, local token storage rule, search/check flow, explicit domain+price purchase gate, Pages deploy gate, custom-domain steps, and post-setup token rotation.
12
+ - Overnight execution plan: [`docs/overnight-build-master-plan.md`](docs/overnight-build-master-plan.md) defines the GPT-5.5/Kimi overnight build cadence, acceptance gates, exact non-claims, and hosted/BYOC blockers.
13
+ - Security and production review artifacts: [`SECURITY.md`](SECURITY.md) defines reporting, safe harbor, disclosure, incident, secret-handling, plaintext-minimization, and proof-boundary policy; [`docs/security-threat-model.md`](docs/security-threat-model.md) maps assets, trust boundaries, controls, residual risks, and verification evidence; [`docs/operator-acceptance-packet.md`](docs/operator-acceptance-packet.md) is required before hosted/BYOC can be called live.
14
+ - Public API reference: [`docs/public-api-reference.md`](docs/public-api-reference.md) lists package exports, CLI bins, MCP tools/resources/prompts, relay/gateway endpoints, importer/capsule APIs, connector profiles, verifier outputs, schemas, and local-vs-hosted boundaries.
15
+ - Local release provenance/SBOM: [`docs/release-provenance-and-sbom.md`](docs/release-provenance-and-sbom.md) documents `npm run provenance:local -- --out ./.enigma/release-provenance.json` as unsigned local package-surface inventory and SHA-256 evidence only, not signed attestation, registry provenance, source-control proof, SLSA/compliance, Docker image, or hosted/cloud deployment evidence.
16
+ - Reviewer packet: [`docs/reviewer-packet.md`](docs/reviewer-packet.md) documents `npm run review:packet -- --out ./.enigma-review-packet --public-site <path-to-_public_site>` as a local hand-review bundle for package, release-audit, provenance, and optional generated public-site evidence; it is not npm publication, live Cloudflare deployment, Docker runtime proof, hosted/BYOC readiness, legal approval, signed provenance, or compliance evidence.
17
+
18
+ Enigma does not claim that a closed provider deleted internal data, that model weights forgot, or that provider-native memory disappeared. It proves facts about Enigma-controlled vault state, receipts, checkpoints, and declared boundary operations.
19
+
20
+ ## Install and run locally
21
+
22
+ Prerequisites:
23
+
24
+ - Node.js `>=24`
25
+ - Git for the source-checkout path
26
+ - No database, package registry account, provider credential, or cloud credential for the local no-network path
27
+
28
+ Fastest path from GitHub:
29
+
30
+ ```sh
31
+ git clone https://github.com/Enigma-Memory/enigma-memory.git
32
+ cd enigma-memory
33
+ npm run install:local -- --execute --init-vault --bundle ./.enigma/bundle.json
34
+ enigma doctor
35
+ enigma-relay demo
36
+ enigma-gateway demo
37
+ ```
38
+
39
+ `install:local` is dry-run unless `--execute` is present. The command above installs the checked-out package globally, creates a local vault bundle, and never needs Cloudflare, OpenAI, Anthropic, npm publish credentials, a database, or hosted infrastructure.
40
+
41
+ If the repository is already checked out:
42
+
43
+ ```sh
44
+ npm install -g .
45
+ enigma --help
46
+ enigma-verify --help
47
+ enigma-relay demo
48
+ enigma-gateway demo
49
+ ```
50
+
51
+ Repeat the local package/demo release evidence from a source checkout:
52
+
53
+ ```sh
54
+ npm run release:audit
55
+ ```
56
+
57
+ The audit prints an `enigma.release_audit.v1` JSON summary and supports `-- --out <file>` for handoff/goal-audit ingestion. It fails nonzero if any required local gate fails. It runs `npm run check`, `npm test`, `npm pack --dry-run`, direct-bin help/demo smokes, and an MCP stdio `initialize`/`tools`/`resources`/`prompts` smoke. It does not require Docker, cloud credentials, npm publish credentials, or a live website.
58
+
59
+ Generate local provenance/SBOM checksum evidence from the source checkout:
60
+
61
+ ```sh
62
+ npm run provenance:local -- --out ./.enigma/release-provenance.json
63
+ ```
64
+
65
+ The provenance/SBOM command writes package-surface file inventory and SHA-256 values for reviewer comparison, then prints `{ ok, path, file_count, root_hash }`; without `--out`, it prints the full `enigma.release_provenance.v1` JSON to stdout. It complements `npm pack --dry-run` by giving checksums for inventoried local package-surface files; it does not sign the release, publish to a registry, prove a git commit, claim SLSA/compliance status, prove a Docker image digest, or prove hosted/cloud deployment.
66
+
67
+ When the public package is available:
68
+
69
+ ```sh
70
+ npm install -g enigma-memory
71
+ npx --yes --package enigma-memory enigma --help
72
+ npx --yes --package enigma-memory enigma doctor
73
+ ```
74
+
75
+ Create a no-network local vault, write one local memory from a file, compile a context pack, export a proof bundle, and verify it. Use a tenant-approved smoke file; do not expand private memory into shell argv.
76
+
77
+ POSIX shell:
78
+
79
+ ```sh
80
+ mkdir -p .enigma
81
+ ENIGMA_DEMO_MEMORY_FILE=/absolute/path/to/tenant-approved-smoke-memory.txt
82
+ test -f "$ENIGMA_DEMO_MEMORY_FILE"
83
+ enigma init --bundle ./.enigma/bundle.json --subject local-user --display-name "Local user"
84
+ enigma remember --bundle ./.enigma/bundle.json --text-file "$ENIGMA_DEMO_MEMORY_FILE" --purpose user_memory --tags local
85
+ enigma context --bundle ./.enigma/bundle.json --query "local context" --purpose local_answer --out ./.enigma/context-pack.json
86
+ enigma export --bundle ./.enigma/bundle.json --out ./.enigma/export.json
87
+ enigma verify --bundle ./.enigma/export.json
88
+ ```
89
+
90
+ Windows PowerShell:
91
+
92
+ ```powershell
93
+ New-Item -ItemType Directory -Force .enigma | Out-Null
94
+ $env:ENIGMA_DEMO_MEMORY_FILE = "C:\path\to\tenant-approved-smoke-memory.txt"
95
+ if (-not (Test-Path -LiteralPath $env:ENIGMA_DEMO_MEMORY_FILE)) { throw "Missing ENIGMA_DEMO_MEMORY_FILE" }
96
+ enigma init --bundle .\.enigma\bundle.json --subject local-user --display-name "Local user"
97
+ enigma remember --bundle .\.enigma\bundle.json --text-file $env:ENIGMA_DEMO_MEMORY_FILE --purpose user_memory --tags local
98
+ enigma context --bundle .\.enigma\bundle.json --query "local context" --purpose local_answer --out .\.enigma\context-pack.json
99
+ enigma export --bundle .\.enigma\bundle.json --out .\.enigma\export.json
100
+ enigma verify --bundle .\.enigma\export.json
101
+ ```
102
+
103
+ The bundle is local. Exported proof artifacts contain encrypted/committed vault state and receipt metadata; do not paste raw memory plaintext into relay records, witness checkpoints, SIEM events, public proof artifacts, or shell command lines.
104
+
105
+ ## MCP setup
106
+
107
+ Run the Enigma MCP server over stdio:
108
+
109
+ POSIX shell:
110
+
111
+ ```sh
112
+ ENIGMA_BUNDLE="$HOME/.enigma/bundle.json" enigma-mcp
113
+ ```
114
+
115
+ Windows PowerShell:
116
+
117
+ ```powershell
118
+ $env:ENIGMA_BUNDLE = "$HOME\.enigma\bundle.json"
119
+ enigma-mcp.cmd
120
+ ```
121
+
122
+ Or through the CLI:
123
+
124
+ ```sh
125
+ ENIGMA_BUNDLE="$HOME/.enigma/bundle.json" enigma mcp serve
126
+ ```
127
+
128
+ Windows PowerShell CLI form:
129
+
130
+ ```powershell
131
+ $env:ENIGMA_BUNDLE = "$HOME\.enigma\bundle.json"
132
+ enigma.cmd mcp serve
133
+ ```
134
+
135
+ Generic MCP client entry:
136
+
137
+ ```json
138
+ {
139
+ "mcpServers": {
140
+ "enigma": {
141
+ "command": "enigma-mcp",
142
+ "args": [],
143
+ "env": {
144
+ "ENIGMA_BUNDLE": "/absolute/path/to/.enigma/bundle.json"
145
+ }
146
+ }
147
+ }
148
+ }
149
+ ```
150
+
151
+ The MCP server exposes `enigma_init`, `enigma_remember`, `enigma_search`, `enigma_context_pack`, `enigma_delete`, and `enigma_verify_receipts`, plus an Enigma passport summary resource and a memory-use prompt. Provider-native memory should be treated as cache only; Enigma vault state remains canonical.
152
+
153
+ ## Connect clients
154
+
155
+ Supported connector profiles are:
156
+
157
+ - `claude-desktop`
158
+ - `cursor`
159
+ - `kimi-code`
160
+ - `vscode-cline`
161
+ - `roo`
162
+ - `opencode`
163
+ - `generic-mcp`
164
+
165
+ Use the config in `docs/client-connectors.md` from a source checkout for Claude Desktop, Cursor, Kimi Code, VS Code/Cline, Roo Code, OpenCode, or any MCP-compatible client. The generated entry defaults to command `enigma-mcp` and sets `ENIGMA_BUNDLE` to the local vault bundle.
166
+
167
+ CLI connector commands:
168
+
169
+ ```sh
170
+ enigma doctor
171
+ enigma install --bundle "$HOME/.enigma/bundle.json"
172
+ enigma connect claude-desktop --bundle "$HOME/.enigma/bundle.json"
173
+ enigma connect kimi-code --bundle "$HOME/.enigma/bundle.json" --mcp-command "/absolute/path/to/enigma-mcp"
174
+ enigma disconnect claude-desktop
175
+ ```
176
+
177
+ Use `--mcp-command` (alias `--command`) when a GUI app cannot find shell-installed binaries or needs a `.cmd` path on Windows.
178
+
179
+ ## Browser extension and native host
180
+
181
+ The browser extension is an unpacked Manifest V3 scaffold in:
182
+
183
+ ```text
184
+ apps/browser-extension
185
+ ```
186
+
187
+ The local native messaging host install assets are in:
188
+
189
+ ```text
190
+ apps/native-host
191
+ ```
192
+
193
+ Register host name `com.enigma.native_host` by generating a browser-specific manifest:
194
+
195
+ ```sh
196
+ enigma native-host manifest --browser chrome --host-path "/absolute/path/to/enigma-native-host" --extension-id "REPLACE_WITH_EXTENSION_ID" --out ./com.enigma.native_host.json
197
+ ```
198
+
199
+ Use `--browser edge` or `--browser firefox` for those browsers. Find unpacked Chrome IDs at `chrome://extensions` > Developer mode > Enigma > Details, Edge IDs at `edge://extensions` > Developer mode > Enigma > Details, and Firefox IDs at `about:debugging#/runtime/this-firefox` or from a stable `browser_specific_settings.gecko.id`/signed add-on ID. The host path must be absolute and point to `enigma-native-host` or a wrapper that sets `ENIGMA_BUNDLE` before launching it. Without `--out`, the generator prints manifest JSON to stdout; with `--out`, it writes the file and reports `{ ok, path }`. Copy the resulting `com.enigma.native_host.json` into the browser/OS native-host location, or create the documented Windows registry key yourself. Manual templates remain in `apps/native-host/manifests/`. Exact copy and registry commands are in [`apps/native-host/README.md`](apps/native-host/README.md).
200
+
201
+ The native host is inside the local trust boundary: protect the manifest, wrapper, executable, and `ENIGMA_BUNDLE` path from local modification. The extension does not use browser sync storage (`chrome.storage.sync`) at all and requires an explicit user click before inserting Enigma context into ChatGPT, Claude, Kimi, Perplexity, or another supported provider page. Provider-native memory remains cache only; Enigma receipts do not prove provider deletion or model forgetting. See [`apps/browser-extension/README.md`](apps/browser-extension/README.md), [`apps/native-host/README.md`](apps/native-host/README.md), and [`docs/install-anywhere.md`](docs/install-anywhere.md) in the source checkout.
202
+
203
+ ## Desktop scaffold
204
+
205
+ The desktop surface is a static local scaffold in:
206
+
207
+ ```text
208
+ apps/desktop/src/index.html
209
+ ```
210
+
211
+ Open it directly in a browser or package it inside a desktop shell. It models vault, MCP, clients, import/export, verifier, deletion, mesh, and enterprise screens. Desktop UI state is operational evidence only; cryptographic proof still comes from Enigma receipts and verifier output.
212
+
213
+ ## Relay, gateway, Docker, and enterprise modes
214
+
215
+ Local relay and gateway servers are Node HTTP modules:
216
+
217
+ - `apps/relay/src/server.mjs` stores opaque encrypted relay records, signs witness checkpoints, and handles pairing. It rejects plaintext-looking memory fields.
218
+ - `apps/gateway/src/server.mjs` evaluates enterprise policy, emits signed decisions, and exports plaintext-minimized SIEM events. It does not call model providers.
219
+
220
+ Direct bins are available after a source or package install. Add `--state-file <path>` when a local demo should survive a restart:
221
+
222
+ ```sh
223
+ mkdir -p .enigma/state
224
+ enigma-relay demo
225
+ enigma-relay serve --host 127.0.0.1 --port 8787 --state-file ./.enigma/state/relay-state.json
226
+ enigma-gateway demo
227
+ enigma-gateway serve --host 127.0.0.1 --port 8797 --state-file ./.enigma/state/gateway-state.json
228
+ ```
229
+
230
+ The same behavior is also available through the main CLI:
231
+
232
+ ```sh
233
+ enigma relay demo
234
+ enigma relay serve --host 127.0.0.1 --port 8787 --state-file ./.enigma/state/relay-state.json
235
+ enigma gateway demo
236
+ enigma gateway serve --host 127.0.0.1 --port 8797 --state-file ./.enigma/state/gateway-state.json
237
+ ```
238
+
239
+ `--state-file` is local demo durability, not a production database. Relay state files may contain relay node/trust metadata, local demo signing material, hash-only or opaque relay records, witness checkpoints, completed pairings, and authorization mode; they must not contain raw memory plaintext, prompts, transcripts, decrypted capsule contents, raw request bodies, or pending challenges. Gateway state business data is limited to active policy/minimized policy metadata, policy hash, and plaintext-minimized SIEM/decision evidence, but the snapshot may also include local demo identity and Ed25519 signing key material needed to verify decisions; it must not contain raw memory, prompts, completions, transcripts, provider responses, embeddings, tenant secrets, KMS material, or provider hidden-state claims. Unknown, malformed, or plaintext-looking state fails closed instead of silently resetting.
240
+
241
+ Keep state files outside source control with owner-only file permissions. Backups are useful for local demo restore only; hosted and BYOC deployments still need real durable storage, KMS/secrets, monitored backups, restore rehearsal, and an accepted operator packet.
242
+
243
+ For source-checkout Docker demos:
244
+
245
+ ```sh
246
+ cd enigma
247
+ docker compose up --build relay gateway
248
+ ```
249
+
250
+ See `docs/install-anywhere.md` and `docs/deployment-runbook.md` in the source checkout for concrete local server, Docker, hosted, and BYOC steps.
251
+
252
+ Enterprise modes:
253
+
254
+ - Hosted: Enigma operator runs relay/gateway for a tenant. Requires deployment credentials, TLS, production durable storage, KMS/secrets, monitoring, backups, incident response, and tenant policy.
255
+ - BYOC: customer runs relay/gateway in its own cloud or network. Customer controls KMS, network policy, logs, data residency, backups, and deployment credentials.
256
+
257
+ Both modes keep provider-native memory as cache only. Enigma can prove its own committed state and policy decisions; it cannot prove that a third-party provider erased hidden state or changed model weights.
258
+
259
+ ## Import and migration
260
+
261
+ Importer APIs normalize exported memory/context from ChatGPT, Claude, Mem0, Letta, LangGraph, Zep/Graphiti, and Enigma capsules into candidates with source references, limitations, confidence, and completeness flags. Imports preserve source caveats. A source export becomes canonical only after the candidate is written through an Enigma vault and receives Enigma receipts.
262
+
263
+ Migration CLI examples:
264
+
265
+ ```sh
266
+ enigma import chatgpt --file ./chatgpt-export.json --out ./enigma-import-report.json
267
+ enigma capsule export --file ./enigma-import-report.json --out ./enigma-capsule.json
268
+ enigma capsule import --file ./enigma-capsule.json --bundle "$HOME/.enigma/bundle.json"
269
+ ```
270
+
271
+ ## Verification commands
272
+
273
+ Repeatable package/demo audit:
274
+
275
+ ```sh
276
+ npm run release:audit
277
+ ```
278
+
279
+ This is the one-command local release evidence path; add `-- --out <file>` when another Enigma production command needs to consume the audit JSON. Docker runtime, hosted cloud, npm publication, and live website review remain external/operator-gated checks rather than prerequisites for `release:audit`.
280
+
281
+ Local provenance/SBOM checksum evidence:
282
+
283
+ ```sh
284
+ npm run provenance:local -- --out ./.enigma/release-provenance.json
285
+ ```
286
+
287
+ Use [`docs/release-provenance-and-sbom.md`](docs/release-provenance-and-sbom.md) to interpret the generated JSON. Reviewers can compare recorded `(path, sha256)` entries with freshly computed SHA-256 values or with another provenance file. Run `npm pack --dry-run` separately when reviewing package tarball contents, and build the public site artifact before rerunning provenance when the optional `public_site_manifest` checksum is in scope. The provenance file is local unsigned checksum evidence only.
288
+
289
+ Hand-review packet:
290
+
291
+ ```sh
292
+ python scripts/build_public_site.py
293
+ npm run review:packet -- --out ./.enigma-review-packet --public-site ./_public_site
294
+ ```
295
+
296
+ Use [`docs/reviewer-packet.md`](docs/reviewer-packet.md) to inspect `REVIEW_PACKET_MANIFEST.json`, `evidence/release-audit.json`, `evidence/local-provenance.json`, `package/npm-pack-dry-run.json`, copied `docs/`, optional `site/`, and the recorded SHA-256 values. Pass `--public-site` only for an already-built generated public-site artifact such as `./_public_site`; the packet copies local evidence for review and does not prove npm publication, live Cloudflare deployment, Docker image/runtime behavior, hosted/BYOC readiness, legal approval, signed provenance, or compliance status.
297
+
298
+ Local smoke path:
299
+
300
+ ```sh
301
+ ENIGMA_DEMO_MEMORY_FILE=/absolute/path/to/tenant-approved-smoke-memory.txt
302
+ test -f "$ENIGMA_DEMO_MEMORY_FILE"
303
+ enigma init --bundle ./.enigma/bundle.json
304
+ enigma remember --bundle ./.enigma/bundle.json --text-file "$ENIGMA_DEMO_MEMORY_FILE" --purpose local_test
305
+ enigma export --bundle ./.enigma/bundle.json --out ./.enigma/export.json
306
+ enigma verify --bundle ./.enigma/export.json
307
+ enigma boundary run --scenario committed_crossing
308
+ ```
309
+
310
+ MCP JSON-RPC handshake:
311
+
312
+ ```sh
313
+ printf '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"manual","version":"0"}}}\n{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}\n' | ENIGMA_BUNDLE="$PWD/.enigma/bundle.json" enigma-mcp
314
+ ```
315
+
316
+ Connector demo:
317
+
318
+ ```sh
319
+ node --input-type=module -e "import { runConnectorDemo } from './packages/connectors/src/index.js'; console.log(JSON.stringify(runConnectorDemo({ clientId: 'generic-mcp' }), null, 2));"
320
+ ```
321
+
322
+ Importer demo:
323
+
324
+ ```sh
325
+ node --input-type=module -e "import { runImporterDemo } from './packages/importers/src/index.js'; console.log(JSON.stringify(runImporterDemo(), null, 2));"
326
+ ```
327
+
328
+ Relay and gateway demos:
329
+
330
+ ```sh
331
+ enigma-relay demo
332
+ enigma-gateway demo
333
+ ```
334
+
335
+ Relay and gateway servers:
336
+
337
+ ```sh
338
+ enigma-relay serve --host 127.0.0.1 --port 8787
339
+ enigma-gateway serve --host 127.0.0.1 --port 8797
340
+ ```
341
+
342
+ ## Claim boundary
343
+
344
+ Enigma can honestly claim:
345
+
346
+ - A local Enigma vault contains or no longer serves a committed memory address.
347
+ - A memory create, retrieval, context-pack, update, or tombstone event produced a receipt that verifies offline.
348
+ - A boundary harness classified an observed boundary event as committed, blocked, out-of-scope, or failed.
349
+ - A relay stored an opaque encrypted record or signed a witness checkpoint without raw memory plaintext.
350
+ - A gateway decision followed a specific Enigma enterprise policy at a specific policy hash.
351
+
352
+ Enigma cannot honestly claim:
353
+
354
+ - A closed provider physically deleted all internal copies.
355
+ - A model forgot training, fine-tuning, cache, telemetry, or hidden personalization state.
356
+ - Enigma caused semantic forgetting across model outputs, hidden personalization, embeddings, summaries, caches, or third-party systems outside Enigma state.
357
+ - Imported provider memories are complete unless the source export explicitly proves completeness.
358
+ - A signed memory statement is true in the real world; receipts prove custody and lifecycle, not factual correctness.
359
+ - Token ROI, profit, equity, revenue share, investment return, or token price expectation.
360
+ - Tamper-proof hardware or raw compute superiority.
361
+ - Benchmark leadership without measured repository evidence.
362
+ - Hosted cloud or customer BYOC deployment is live without the required credentials, domain/TLS, production durable storage, KMS/secrets, monitoring, backups, incident ownership, and SIEM/log routing; local `--state-file` demo state is not hosted/BYOC readiness.
363
+ - That a local review packet or local provenance/SBOM output is signed provenance, registry attestation, git/source-control evidence, SLSA level, compliance certification, Docker image digest/runtime evidence, npm publication, hosted/BYOC readiness, or hosted/cloud deployment proof.
364
+
365
+ Read next:
366
+
367
+ - [`docs/overnight-build-master-plan.md`](docs/overnight-build-master-plan.md)
368
+ - [`docs/release-evidence-2026-06-23.md`](docs/release-evidence-2026-06-23.md)
369
+ - [`docs/release-provenance-and-sbom.md`](docs/release-provenance-and-sbom.md)
370
+ - [`docs/reviewer-packet.md`](docs/reviewer-packet.md)
371
+ - [`SECURITY.md`](SECURITY.md)
372
+ - [`docs/security-threat-model.md`](docs/security-threat-model.md)
373
+ - [`docs/operator-acceptance-packet.md`](docs/operator-acceptance-packet.md)
374
+ - [`docs/cloudflare-token-and-domain-runbook.md`](docs/cloudflare-token-and-domain-runbook.md)
375
+ - [`docs/public-api-reference.md`](docs/public-api-reference.md)
376
+ - `docs/install-anywhere.md`
377
+ - `docs/client-connectors.md`
378
+ - `docs/deployment-runbook.md`
379
+ - `docs/production-release-checklist.md`