granite-mem 0.1.11 → 0.1.12

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/README.md CHANGED
@@ -19,6 +19,10 @@
19
19
  <b>Install it with your agent.</b> Or run it standalone as a local markdown knowledge graph.
20
20
  </p>
21
21
 
22
+ <p align="center">
23
+ <a href="#your-vault-in-the-cloud"><img src="https://img.shields.io/badge/☁️_Deploy_your_Granite-one_command,_sleeps_when_idle-111111?style=for-the-badge" alt="Deploy your Granite"></a>
24
+ </p>
25
+
22
26
  ---
23
27
 
24
28
  ## The wow moment
@@ -174,9 +178,84 @@ Your agent reads these before writing and sets them as it works. You inherit a f
174
178
  - Markdown files are the source of truth; the SQLite index in `~/.granite/index.db` is derived state and can be rebuilt at any time
175
179
  - no cloud, no telemetry, no account
176
180
  - `git init` your vault and you have versioning for free
177
- - `granite serve` gives you a local web UI — browse, search, explore the graph
181
+ - `granite serve` gives you a local web UI — browse, search, explore local and cloud graphs
178
182
  - `granite daemon start` runs MCP + web UI in one background process
179
183
 
184
+ ## Your vault in the cloud
185
+
186
+ One command deploys a personal serverless Granite on [Fly.io Sprites](https://sprites.dev): a real persistent filesystem, an MCP endpoint that **wakes on request** (100–500 ms warm) and **sleeps when idle**. Idle cost ≈ storage only — a markdown vault is a few MB, so cents per month.
187
+
188
+ ```bash
189
+ export SPRITES_TOKEN=… # from sprites.dev — your account, your sprite, your data
190
+ npx granite-mem deploy
191
+ ```
192
+
193
+ Or store the Sprites API token once in a user-scoped Granite credentials file:
194
+
195
+ ```bash
196
+ granite deploy login --token <sprites-token>
197
+ ```
198
+
199
+ That writes `~/.granite/config/sprites.json` (mode `0600` where supported). It works on macOS, Linux, and Windows via the user's home directory. Commands resolve credentials in this order: `--token`, `SPRITES_TOKEN`, then the stored file. Remove it with `granite deploy logout`.
200
+
201
+ That prints an MCP URL + bearer token ready to paste into Claude Code or Cursor:
202
+
203
+ ```bash
204
+ claude mcp add --transport http granite https://<your-sprite>.sprites.app/mcp \
205
+ --header "Authorization: Bearer <token>"
206
+ ```
207
+
208
+ There is no central admin, no Granite cloud account, no relay: `granite deploy` provisions a sprite **you** own and pay for directly.
209
+
210
+ Manage instances from any machine after `deploy login`, or with `SPRITES_TOKEN`:
211
+
212
+ ```bash
213
+ granite deploy login --token <sprites-token>
214
+ granite deploy work # a second instance (own vault, own token, own URL)
215
+ granite deploy list # all instances: version, health, MCP URL
216
+ granite deploy status --show-token
217
+ granite deploy # re-run = upgrade that instance to your CLI version
218
+ granite deploy --all # bulk remote update of every instance
219
+ granite deploy destroy work # permanent — asks for confirmation
220
+ ```
221
+
222
+ Browse local and deployed vaults from the same local UI:
223
+
224
+ ```bash
225
+ SPRITES_TOKEN=… granite serve
226
+ ```
227
+
228
+ `granite serve` discovers your managed Sprites using `SPRITES_TOKEN` or the stored `~/.granite/config/sprites.json` token. It keeps MCP bearer tokens on the local server and proxies read-only graph/search/note requests to the selected cloud instance. Use `granite serve --no-cloud` to browse only the local vault.
229
+
230
+ Notes:
231
+
232
+ - Document parsing (PDF/DOCX/XLSX/PPTX) is **disabled in cloud deployments** (`GRANITE_DISABLE_DOCUMENT_PARSING=1`). Extract and import documents on your local Granite.
233
+ - Cloud instances expose MCP plus an authenticated read-only web API for the local UI switcher; note creation in the web UI remains local-only.
234
+ - The Sprites API token is local user configuration at `~/.granite/config/sprites.json`; it is not written to the vault notes and is excluded from Granite sync manifests.
235
+ - The vault lives at `/home/sprite/.granite` on the sprite, on durable object-storage-backed disk. There is no export/backup command in v1 — treat the sprite as the single copy for now.
236
+
237
+ ### Advanced: run the HTTP MCP server yourself
238
+
239
+ Granite can expose the MCP server over HTTP anywhere you can run Node. When binding outside localhost, a bearer token is required:
240
+
241
+ ```bash
242
+ export GRANITE_MCP_TOKEN="$(openssl rand -hex 32)"
243
+ granite mcp --vault ~/.granite \
244
+ --transport http \
245
+ --host 0.0.0.0 \
246
+ --port 3321 \
247
+ --web-api
248
+ ```
249
+
250
+ Clients must send the token on every MCP request:
251
+
252
+ ```bash
253
+ claude mcp add --transport http granite https://granite.example.com/mcp \
254
+ --header "Authorization: Bearer $GRANITE_MCP_TOKEN"
255
+ ```
256
+
257
+ A generic `Dockerfile` is included for self-hosting on your own infra (build it yourself; no public image is published). The `/health` endpoint is unauthenticated for platform checks. Do not expose `granite serve` or the web UI port `4321` on the public internet; the web UI is local-only and has no authentication. If `--web-api` is enabled on the HTTP MCP server, `/api/*` and `/assets/*` are guarded by the same bearer token as `/mcp`.
258
+
180
259
  ## Direct sync
181
260
 
182
261
  Granite sync is direct machine-to-machine. Run it over LAN, Tailscale, or a private DNS name; there is no relay, hosted worker, billing tier, or cloud authority.