@tpsdev-ai/flair 0.15.0 → 0.16.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.
package/README.md CHANGED
@@ -178,31 +178,82 @@ Pluggable import/export to foreign memory systems. Every agent-memory format (ag
178
178
  ## Quick Start
179
179
 
180
180
  ### Prerequisites
181
- - [Node.js 22+](https://nodejs.org/)
181
+
182
+ **1. Node.js 22+.** On a fresh box, install a current Node — the version in some distro repos is too old.
183
+
184
+ ```bash
185
+ # Linux (Debian/Ubuntu) — NodeSource:
186
+ curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash - && sudo apt-get install -y nodejs
187
+
188
+ # macOS / Linux — nvm (no root, recommended):
189
+ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
190
+ # restart your shell, then:
191
+ nvm install 22
192
+
193
+ # Verify:
194
+ node --version # → v22.x or newer
195
+ ```
196
+
197
+ **2. A user-writable npm global prefix (avoid `sudo`).** Installing globally with `sudo` makes the package root-owned. Flair's in-process embeddings component downloads/symlinks a model file under the package at runtime; when Harper later runs as **you** (not root) it gets `EACCES` and **semantic search silently degrades to keyword-only**. Point npm's global prefix at your home dir instead:
198
+
199
+ ```bash
200
+ mkdir -p ~/.npm-global
201
+ npm config set prefix ~/.npm-global
202
+ # add to your shell rc (~/.bashrc, ~/.zshrc) so it persists:
203
+ export PATH="$HOME/.npm-global/bin:$PATH"
204
+ ```
205
+
206
+ > ⚠️ **Do not `sudo npm install -g @tpsdev-ai/flair`.** A root-owned install breaks the embeddings component (the package dir isn't writable by the user Harper runs as), and you'll get the loud `Semantic search DEGRADED` warning from `flair init` / `flair doctor`. Use the user-writable prefix above instead. `nvm` installs already give you a user-owned prefix, so no `sudo` is needed there.
182
207
 
183
208
  ### Install & Run
184
209
 
210
+ `flair init` is the front door. The mental model is git's: install the CLI globally, then `init`. One command does everything: installs and starts Harper, creates your agent's Ed25519 identity, verifies semantic search actually works, detects and wires your MCP clients (Claude Code / Cursor / Codex / Gemini) to the zero-install `npx -y @tpsdev-ai/flair-mcp` server, and runs a smoke test.
211
+
185
212
  ```bash
186
- # Install
213
+ # Install the CLI (no sudo — see prereqs above)
187
214
  npm install -g @tpsdev-ai/flair
188
215
 
189
- # Bootstrap a Flair instance (installs Harper, creates database, starts service)
216
+ # One command: instance + agent + semantic-search check + MCP wiring + smoke test
190
217
  flair init
218
+ ```
191
219
 
192
- # Register your first agent
193
- flair agent add mybot --name "My Bot" --role assistant
220
+ That's it. Your agent now has identity and memory, and any detected MCP client is wired up. Restart your MCP client (e.g. Claude Code) to pick up the new config, then ask the agent "what do you remember about me?"
194
221
 
195
- # Check everything is working
196
- flair status
222
+ Useful flags:
223
+
224
+ ```bash
225
+ flair init --agent mybot # name the agent (--agent-id also works)
226
+ flair init --client claude-code # wire one specific client (claude-code, codex, gemini, cursor, all, none)
227
+ flair init --no-mcp # instance + agent only, skip MCP wiring
228
+ flair init --skip-smoke # skip the MCP smoke test
229
+ ```
197
230
 
198
- # Lifecycle management
231
+ Lifecycle management:
232
+
233
+ ```bash
234
+ flair status # Check everything is working
199
235
  flair stop # Stop the Flair instance
200
236
  flair restart # Restart the Flair instance
201
237
  flair uninstall # Remove the service (keeps data)
202
238
  flair uninstall --purge # Remove everything including data and keys
203
239
  ```
204
240
 
205
- That's it. Your agent now has identity and memory.
241
+ ### Advanced / manual setup
242
+
243
+ Prefer to drive each step yourself, or scripting an unattended setup? Run `flair init --no-mcp` to bootstrap the instance + agent without wiring any MCP clients, then drive each step on its own:
244
+
245
+ ```bash
246
+ # Bootstrap a Flair instance without registering an agent or wiring MCP
247
+ flair init --no-mcp
248
+
249
+ # Register your first agent (generates an Ed25519 keypair, registers it)
250
+ flair agent add mybot --name "My Bot"
251
+
252
+ # Check everything is working
253
+ flair status
254
+ ```
255
+
256
+ `flair init --agent mybot --no-mcp` bootstraps the instance and registers an agent in one step without touching any MCP client config. To wire clients later, re-run `flair init --agent mybot --client <name>`, or wire them manually using the snippets in **[docs/mcp-clients.md](docs/mcp-clients.md)** — all of them use the `npx -y @tpsdev-ai/flair-mcp` zero-install form.
206
257
 
207
258
  ## Integration
208
259
 
@@ -331,6 +382,12 @@ curl -H "Authorization: TPS-Ed25519 mybot:$TS:$NONCE:$SIG" \
331
382
 
332
383
  Auth is Ed25519 — sign `agentId:timestamp:nonce:METHOD:/path` with your private key. See [SECURITY.md](SECURITY.md) for the full protocol.
333
384
 
385
+ ### Auth across surfaces
386
+
387
+ The default, secure path everywhere is **Ed25519 per-agent**: each agent holds its own key (`~/.flair/keys/<agent>.key`), signs every request, and the server refuses cross-agent reads. The CLI, the `flair-mcp` server, and the OpenClaw / pi / Hermes plugins all use it.
388
+
389
+ One exception: the **`n8n-nodes-flair`** community node authenticates with the Harper **admin password** (Basic auth), which grants **whole-instance read/write** access — not per-agent isolation. That's acceptable only on a single-tenant, operator-controlled n8n with trusted workflow inputs; otherwise prefer the CLI/SDK Ed25519 path. Full breakdown in **[docs/auth.md](docs/auth.md#auth-across-surfaces-read-this-first)**.
390
+
334
391
  ## Architecture
335
392
 
336
393
  ```