@tpsdev-ai/flair 0.56.0 → 0.57.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 (63) hide show
  1. package/README.md +16 -17
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli.js +115 -14
  4. package/dist/commands/agent.js +22 -15
  5. package/dist/commands/bridge.js +40 -3
  6. package/dist/commands/doctor.js +52 -0
  7. package/dist/commands/federation.js +263 -37
  8. package/dist/commands/init.js +29 -4
  9. package/dist/lib/auth-resolve.js +46 -0
  10. package/dist/lib/instance-identity-row.js +580 -0
  11. package/dist/lib/redact-token-id.js +197 -0
  12. package/dist/resources/AgentSeed.js +4 -1
  13. package/dist/resources/Asset.js +3 -11
  14. package/dist/resources/Credential.js +4 -10
  15. package/dist/resources/Federation.js +232 -78
  16. package/dist/resources/Integration.js +8 -32
  17. package/dist/resources/Memory.js +58 -16
  18. package/dist/resources/MemoryBootstrap.js +19 -12
  19. package/dist/resources/MemoryCandidate.js +3 -11
  20. package/dist/resources/MemoryDedupStats.js +1 -1
  21. package/dist/resources/MemoryFeed.js +10 -2
  22. package/dist/resources/MemoryGrant.js +19 -40
  23. package/dist/resources/MemoryUsage.js +7 -20
  24. package/dist/resources/Relationship.js +3 -11
  25. package/dist/resources/SemanticSearch.js +25 -13
  26. package/dist/resources/auth-middleware.js +32 -5
  27. package/dist/resources/bm25.js +13 -14
  28. package/dist/resources/federation-cleanup.js +289 -51
  29. package/dist/resources/health.js +48 -8
  30. package/dist/resources/in-process-api.js +2 -1
  31. package/dist/resources/instance-create-lock.js +363 -0
  32. package/dist/resources/instance-identity-rows.js +43 -0
  33. package/dist/resources/instance-identity.js +94 -10
  34. package/dist/resources/mcp-handler.js +9 -1
  35. package/dist/resources/mcp-tool-arguments.js +83 -0
  36. package/dist/resources/mcp-tools.js +4 -5
  37. package/dist/resources/memory-visibility.js +10 -7
  38. package/dist/resources/rate-limit.js +6 -4
  39. package/dist/resources/record-type-kit.js +47 -23
  40. package/dist/resources/search-readiness.js +7 -1
  41. package/dist/resources/semantic-retrieval-core.js +98 -3
  42. package/dist/resources/table-helpers.js +33 -0
  43. package/dist/resources/tool-descriptors/index.js +2 -2
  44. package/dist/src/lib/instance-identity-row.js +580 -0
  45. package/dist/src/lib/redact-token-id.js +197 -0
  46. package/docs/api-reference.md +1 -1
  47. package/docs/auth.md +5 -5
  48. package/docs/claude-code.md +5 -6
  49. package/docs/deploying-on-fabric.md +6 -3
  50. package/docs/embedding-in-a-harper-app.md +3 -3
  51. package/docs/federation.md +16 -9
  52. package/docs/hosted-on-fabric.md +4 -3
  53. package/docs/integrations.md +24 -15
  54. package/docs/mcp-clients.md +16 -12
  55. package/docs/n8n.md +8 -8
  56. package/docs/notes/mcp-oauth-model2.md +12 -17
  57. package/docs/openclaw.md +29 -28
  58. package/docs/spoke-bringup.md +14 -11
  59. package/docs/standalone-local.md +2 -2
  60. package/docs/supply-chain-policy.md +21 -8
  61. package/docs/system-requirements.md +1 -1
  62. package/docs/upgrade.md +2 -2
  63. package/package.json +1 -1
@@ -24,7 +24,7 @@ flair init
24
24
  # Provision an agent identity. Pick a name — typically per-project, per-purpose,
25
25
  # or "me" if you want one durable identity across everything.
26
26
  flair agent add my-project
27
- # → writes ~/.flair/keys/my-project.key (Ed25519 PKCS8) and registers the agent
27
+ # → writes ~/.flair/keys/my-project.key (a raw 32-byte Ed25519 seed) and registers the agent
28
28
 
29
29
  # Sanity check
30
30
  flair status
@@ -45,7 +45,7 @@ The snippets below are the **local** path. Flair also has a native `/mcp` endpoi
45
45
 
46
46
  Native `/mcp` is remote-only by design. The OAuth authorization server fetches client metadata over HTTPS and refuses private, loopback, and link-local hosts. `flair mcp enable` refuses localhost, loopback, RFC1918, IPv4 link-local, and `.local`. Set `FLAIR_MCP_OAUTH=true` — that is the one value that enables both Flair's `/mcp` route and the OAuth component. A loopback Flair cannot be the origin those clients dial. The stdio adapter is the local path because it speaks the instance's Ed25519 HTTP API and does not need that public origin.
47
47
 
48
- `flair init` writes the stdio adapter. Turning on native `/mcp` is a separate operator step for a publicly reachable instance, documented from the API side in [api-reference.md](api-reference.md#mcp-tools).
48
+ `flair init --agent <id>` attempts to wire detected local clients unless MCP wiring is disabled; bare `flair init` only initializes the instance. Turning on native `/mcp` is a separate operator step for a publicly reachable instance, documented from the API side in [api-reference.md](api-reference.md#mcp-tools).
49
49
 
50
50
  ---
51
51
 
@@ -53,9 +53,9 @@ Native `/mcp` is remote-only by design. The OAuth authorization server fetches c
53
53
 
54
54
  Pick whichever you use. The MCP server is the same package; only the config syntax differs.
55
55
 
56
- > **Pin the version.** An unpinned `@tpsdev-ai/flair-mcp` re-resolves to whatever is currently published on *every* agent session, so any future publish reaches your machine silently, with no lockfile and no review step in the path. `flair init` wires clients to a **pinned** spec on purpose, and every MCP-server config snippet below is written the same way: `@tpsdev-ai/flair-mcp@<version>`.
56
+ > **Pin the version.** An unpinned `@tpsdev-ai/flair-mcp` re-resolves to whatever is currently published on *every* agent session, so any future publish reaches your machine silently, with no lockfile and no review step in the path. `flair init --agent <id>` attempts to wire detected clients when wiring is enabled; every MCP-server config snippet below is written the same way: `@tpsdev-ai/flair-mcp@<version>`.
57
57
  >
58
- > Replace `<version>` with the version you intend to run — the one you already have is `flair --version` — and bump it deliberately. Leaving the literal `<version>` in place fails loudly at `npx`, which is the intended failure: better than a config that looks pinned and isn't. `flair init` is the easier path and fills this in for you.
58
+ > Replace `<version>` with the version you intend to run — the one you already have is `flair --version` — and bump it deliberately. Leaving the literal `<version>` in place fails loudly at `npx`, which is the intended failure: better than a config that looks pinned and isn't. `flair init --agent <id>` can fill in the version for clients it wires; check its wiring summary for skipped or held configs.
59
59
  >
60
60
  > **Do not stay on a pin older than 0.18.0.** `@tpsdev-ai/flair-client` before 0.18.0 (and `@tpsdev-ai/flair-mcp` that shipped it) silently drops writes — including against another agent's shared memories — and a server upgrade does not fix that. `flair doctor` flags those pins; the remedy is `flair upgrade` (the adapter), not a newer Harper/Flair server alone. See [troubleshooting — silent write drop](troubleshooting.md#pre-0180-flair-client--flair-mcp-silently-drops-writes).
61
61
 
@@ -176,7 +176,7 @@ If you already have the older, unwrapped command, `flair doctor` reports it and
176
176
 
177
177
  The hook reads Claude Code's SessionStart
178
178
  payload on stdin, calls Flair's `bootstrap` (soul + relevant memories +
179
- predicted context, scoped to your project by the session's working directory),
179
+ predicted context; the hook sends a basename subject hint, and bootstrap selects a bounded set of the agent's own and recent memories under a token budget),
180
180
  and emits it as `hookSpecificOutput.additionalContext` — which Claude Code
181
181
  injects into the new session's context. The matcher is omitted, so it fires on
182
182
  every session start (`startup`, `resume`, `clear`, `compact`); add
@@ -188,8 +188,9 @@ It honors the same env as the MCP server (`FLAIR_AGENT_ID`, `FLAIR_URL`,
188
188
  `FLAIR_HOOK_HARNESS=codex` so bootstrap records the Codex channel; the
189
189
  stdout contract stays `hookSpecificOutput.additionalContext`.
190
190
 
191
- **It degrades to a no-op, always.** No `FLAIR_AGENT_ID`, Flair down, an auth
192
- error, or a hung daemon (past the timeout) → the hook prints `{}` and exits 0.
191
+ A failed bootstrap attempts a stderr diagnostic and can still return a continuity
192
+ resume hint; without either kind of context it returns `{}`, and the entry point
193
+ exits successfully.
193
194
  Claude Code treats that as "no context to add" and starts normally. The hook
194
195
  can never block or break session startup. The injected context is clamped to
195
196
  ≤10,000 characters to keep the session-start payload small. And if the command
@@ -257,7 +258,8 @@ flair hook uninstall --harness codex
257
258
 
258
259
  `flair doctor` reports this hook when Codex is detected. `flair hook install
259
260
  --harness codex` writes `FLAIR_HOOK_HARNESS=codex` and keeps hook stderr
260
- visible (auth failures must not be swallowed). After install, **re-approve**
261
+ visible; the session-start hook attempts one stderr diagnostic when bootstrap
262
+ fails (auth failures must not be swallowed). After install, **re-approve**
261
263
  the command in Codex with `/hooks` — a wiring change resets trust, and
262
264
  untrusted hooks are listed and skipped. `flair hook status --harness codex`
263
265
  reports that pending-approval state as configured but delivery not verified.
@@ -326,6 +328,8 @@ Which memories are non-private is decided at write time, and the default is not
326
328
 
327
329
  ### Reading the `bootstrap` payload
328
330
 
331
+ The following structured-payload details describe the HTTP bootstrap response and native `/mcp`; stdio `flair-mcp` returns the formatted context as an MCP text block.
332
+
329
333
  `bootstrap` returns the canonical structured containers — `soul`, `memories`, `predicted`, `teammateFindings`, `events` — plus counts and a `tokenEstimate`. The containers are **always present** (empty `[]`/`{}` when there's nothing), so an empty container is distinguishable from an unsupported one.
330
334
 
331
335
  **The token ledger reconciles `tokenEstimate` from the payload alone (flair#1270).** Every token-charged content class carries a counter — `soulTokens`, `memoryTokens`, `trustTokens`, `eventsTokens` — plus a measured `scaffoldTokens` for the fixed JSON frame, and `tokenEstimate ≈ scaffoldTokens + soulTokens + memoryTokens + trustTokens + eventsTokens`. The remaining ≈ gap is the bounded per-item difference between the prose lines the memory counters measure and the heavier structured objects the containers ship. A payload whose estimate an agent can't decompose from the reported figures is a bug, not an accounting convention.
@@ -342,7 +346,7 @@ Which memories are non-private is decided at write time, and the default is not
342
346
  |---|---|---|
343
347
  | `FLAIR_AGENT_ID` | (none — required) | Must match `flair agent add <id>` |
344
348
  | `FLAIR_URL` | `http://127.0.0.1:19926` | Override for remote Flair instances |
345
- | `FLAIR_KEY_PATH` | `~/.flair/keys/<agent>.key` | Ed25519 PKCS8 key — created by `flair agent add` |
349
+ | `FLAIR_KEY_PATH` | `~/.flair/keys/<agent>.key` | Path to the Ed25519 private key; `flair agent add` creates a raw 32-byte seed. |
346
350
 
347
351
  The MCP server has no client-side flags beyond these env vars; everything else (timeouts, dedup thresholds, error classification) is opinionated defaults from the underlying [`@tpsdev-ai/flair-client`](../packages/flair-client) package.
348
352
 
@@ -350,7 +354,7 @@ The MCP server has no client-side flags beyond these env vars; everything else (
350
354
 
351
355
  ## What about pi?
352
356
 
353
- pi has no MCP client support, so Flair ships a **native pi extension** instead: [`@tpsdev-ai/pi-flair`](../packages/pi-flair/README.md). Same backend, same agent isolation, zero MCP in the path.
357
+ pi has no MCP client support, so Flair ships a **native pi extension** instead: [`@tpsdev-ai/pi-flair`](../packages/pi-flair/README.md). Same backend. With an ordinary signed identity, writes are owned by that agent; reads admit its own records and other agents' non-private records. Zero MCP in the path.
354
358
 
355
359
  Wiring is a `packages` entry in pi's own settings (`~/.pi/agent/settings.json`), not an `mcpServers` block:
356
360
 
@@ -360,7 +364,7 @@ Wiring is a `packages` entry in pi's own settings (`~/.pi/agent/settings.json`),
360
364
  }
361
365
  ```
362
366
 
363
- `flair init --client pi` writes exactly that (pinned), or use pi's own installer: `pi install npm:@tpsdev-ai/pi-flair`. `flair doctor` detects pi and checks the wiring — including the one known trap: **an `npm:` spec under the `extensions` settings key is silently ignored by pi** (`extensions` takes local file paths only; package sources belong under `packages` — [#1346](https://github.com/tpsdev-ai/flair/issues/1346)). Doctor calls that misconfiguration out by name, and `flair doctor --fix` moves the entry.
367
+ `flair init --agent my-agent --client pi` writes exactly that (pinned), or use pi's own installer: `pi install npm:@tpsdev-ai/pi-flair`. `flair doctor` detects pi and checks the wiring — including the one known trap: **an `npm:` spec under the `extensions` settings key is silently ignored by pi** (`extensions` takes local file paths only; package sources belong under `packages` — [#1346](https://github.com/tpsdev-ai/flair/issues/1346)). Doctor calls that misconfiguration out by name, and `flair doctor --fix` moves the entry.
364
368
 
365
369
  One difference from the MCP clients above: pi settings carry no per-package `env` block, so `FLAIR_AGENT_ID` (and `FLAIR_URL` when non-default) must be exported in the environment that launches pi. Doctor reports what it sees in its own shell and says so — it cannot observe the environment of every pi launch.
366
370
 
@@ -368,7 +372,7 @@ One difference from the MCP clients above: pi settings carry no per-package `env
368
372
 
369
373
  ## What about Hermes (Nous Research)?
370
374
 
371
- Hermes uses its own Python-native `MemoryProvider` ABC instead of MCP. It has its own Flair integration in [`packages/hermes-flair/`](../packages/hermes-flair). Same backend, same agent isolation, different plug shape.
375
+ Hermes uses its own Python-native `MemoryProvider` ABC instead of MCP. It has its own Flair integration in [`packages/hermes-flair/`](../packages/hermes-flair). Same backend. With an ordinary signed identity, writes are owned by that agent; reads admit its own records and other agents' non-private records. Different plug shape.
372
376
 
373
377
  Future MCP-capable agent CLIs (and there are more landing every month) will work out of the box with the MCP server above — no per-framework adapter required from us.
374
378
 
package/docs/n8n.md CHANGED
@@ -39,7 +39,7 @@ In n8n: **Credentials → New → Flair API**. Fill in:
39
39
  | Field | Value |
40
40
  |---|---|
41
41
  | **Base URL** | `http://localhost:19926` (or your team's Flair URL) |
42
- | **Agent ID** | Logical identity that will own memories from this n8n workspace. Workflows that share an Agent ID share memory ownership. Use distinct IDs when isolation matters. |
42
+ | **Agent ID** | Logical identity that will own memories from this n8n workspace. Workflows that share an Agent ID share memory ownership. Use distinct Agent IDs to organize ownership; the shared admin credential can access the whole instance. |
43
43
  | **Admin Password** | Your Flair admin password (in `~/.flair/admin-pass` for local installs). **Sensitive** — see [Security](#security). |
44
44
 
45
45
  Click **Test** — if the test request to `/Memory` returns 200, the credential is good.
@@ -48,7 +48,7 @@ Click **Test** — if the test request to `/Memory` returns 200, the credential
48
48
 
49
49
  Three nodes ship in the package:
50
50
 
51
- - **Flair Chat Memory** — connects to an AI Agent's `Memory` socket. Stores chat history in Flair, scoped by Subject. Defaults to per-workflow memory; set the optional Session Sub-Key to `={{ $execution.id }}` for per-run isolation.
51
+ - **Flair Chat Memory** — connects to an AI Agent's `Memory` socket. Stores chat history in Flair, scoped by Subject. Defaults to per-workflow memory; set the optional Session Sub-Key to `={{ $execution.id }}` for per-run chat-history grouping by subject.
52
52
  - **Flair Search** — connects to an AI Agent's `Tool` socket. Two operations:
53
53
  - *Semantic Search* — agent calls `flair_search({ query })`, gets memories ranked by similarity.
54
54
  - *Get By Subject* — agent calls `flair_get_by_subject()`, gets memories under a config-time-bound subject.
@@ -70,14 +70,14 @@ The agent now answers using both its current chat history (from Flair Chat Memor
70
70
 
71
71
  n8n memory connectors expose a `sessionKey` parameter that scopes the chat history. Flair has a richer model:
72
72
 
73
- - **Subject** (required) — the entity / conversation / topic the memory is about. Indexed in Flair's schema; efficient to filter on. Default: `={{ $workflow.name }}`.
74
- - **Session Sub-Key** (optional) — appended to the subject as `<subject>:<sessionKey>`. Use the n8n execution id (`={{ $execution.id }}`) for per-run isolation, or a customer/user id for per-customer scoping, or leave blank to share across runs.
73
+ - **Subject** (required) — the entity / conversation / topic the memory is about. For Flair Search Get By Subject, the client compares subjects after retrieval and the node requests no ordering. Default: `={{ $workflow.name }}`.
74
+ - **Session Sub-Key** (optional) — appended to the subject as `<subject>:<sessionKey>`. Use the n8n execution id (`={{ $execution.id }}`) for per-run chat-history grouping by subject, or a customer/user id for per-customer scoping, or leave blank to share across runs.
75
75
 
76
76
  Patterns:
77
77
 
78
78
  - **"This assistant remembers"** — set Subject to a stable string (`customer-support`, `daily-standup`). Leave Session Sub-Key blank. All runs share memory.
79
- - **Per-conversation isolation** — set Subject to the conversation owner (`customer:1234`), leave Session Sub-Key blank. Each conversation is isolated by subject.
80
- - **Per-execution isolation** — set Session Sub-Key to `={{ $execution.id }}`. Each n8n run gets its own memory window. (This is most similar to n8n's default `sessionKey={{ $execution.id }}`.)
79
+ - **Per-conversation grouping** — set Subject to a unique conversation ID (for example, `conversation:abc123`) and leave Session Sub-Key blank. Runs using the same Agent ID and conversation ID select the same chat history; different conversation IDs select different histories.
80
+ - **Per-execution grouping** — set Session Sub-Key to `={{ $execution.id }}`. A distinct subject selects each conversation's or run's chat-history window; it does not restrict access to those memories. (This is most similar to n8n's default `sessionKey={{ $execution.id }}`.)
81
81
 
82
82
  ## Security
83
83
 
@@ -91,9 +91,9 @@ For production deployments where untrusted workflow inputs reach Flair, wait for
91
91
 
92
92
  If any of those don't hold, use Flair's CLI / SDK clients (which support per-agent Ed25519 today) and wait for the n8n credential update.
93
93
 
94
- ## Get By Tag — coming soon
94
+ ## Get By Tag
95
95
 
96
- The Flair Search node currently exposes Semantic Search and Get By Subject. **Get By Tag** is deferred until `flair-client.memory.list` exposes a `tags` filter. Workaround for now: use Semantic Search and let the model filter results by tags in the response.
96
+ The Flair Search node currently exposes Semantic Search and Get By Subject. **Get By Tag** is not yet exposed as an operation. The `memory.list` client does support the `tags` filter — use it directly via the SDK for agent-driven tag filtering.
97
97
 
98
98
  ## Worked examples
99
99
 
@@ -6,8 +6,8 @@
6
6
  > Do NOT enable in production until Sherlock signs off on live enablement.
7
7
 
8
8
  This is the **Model 2** native-MCP path: a custom in-process `/mcp` JSON-RPC
9
- handler guarded by `@harperfast/oauth`'s `withMCPAuth`, serving the 9 curated
10
- flair tools with a per-agent OAuth identity. It is distinct from the
9
+ handler guarded by `@harperfast/oauth`'s `withMCPAuth`, serving the 17 tools in `resources/mcp-tools.ts`
10
+ with a per-agent OAuth identity. It is distinct from the
11
11
  native-application-MCP surface (design A / `FLAIR_MCP_ENABLED`); Model 2 does not
12
12
  use Harper's native MCP transport, so it is not blocked by the Harper native-MCP
13
13
  gating gaps.
@@ -18,12 +18,10 @@ gating gaps.
18
18
  Streamable HTTP: `initialize` / `tools/list` / `tools/call` / `ping`. On
19
19
  `tools/call` it resolves the verified token `sub` → a flair `Agent`, then
20
20
  dispatches to the curated tool.
21
- - `resources/mcp-tools.ts` — the 9 curated tools (memory_search, memory_store,
22
- memory_get, memory_delete, bootstrap, soul_set, soul_get, flair_workspace_set,
23
- flair_orgevent), each a thin wrapper over the existing resource handler
21
+ - `resources/mcp-tools.ts` — the 17 tools in `resources/mcp-tools.ts`, each a thin wrapper over the existing resource handler
24
22
  (Memory / SemanticSearch / BootstrapMemories / Soul / WorkspaceState /
25
- OrgEvent). No raw CRUD surface — the only path to the datastore through `/mcp`
26
- is one of these 9 semantic tools. Curated **by construction**.
23
+ OrgEvent / AttentionQuery / RecordUsage). No raw CRUD surface — the only path to the datastore through `/mcp`
24
+ is one of the 17 tools in `resources/mcp-tools.ts`. Curated **by construction**.
27
25
  - `resources/mcp-oauth.ts` — registers `server.http(withMCPAuth(mcpHandler),
28
26
  { urlPath: '/mcp' })` **only when `FLAIR_MCP_OAUTH` is on.** `/mcp` runs on its
29
27
  own dispatch chain; flair's default auth-middleware does not run for it.
@@ -108,8 +106,8 @@ registered identities.
108
106
 
109
107
  ## Enabling (operator checklist)
110
108
 
111
- 1. **Install the AS plugin** — add `@harperfast/oauth` (already an exact-pinned
112
- dependency) and declare it in `config.yaml`:
109
+ 1. **Configure the AS plugin** — `@harperfast/oauth` is exact-pinned in `package.json`
110
+ and already declared in `config.yaml`; configure the existing block:
113
111
 
114
112
  ```yaml
115
113
  '@harperfast/oauth':
@@ -136,13 +134,12 @@ registered identities.
136
134
  ```
137
135
 
138
136
  **DCR is not supported; clients connect via CIMD (Client ID Metadata
139
- Documents).** `flair mcp enable` (flair#756) writes exactly this shape —
140
- see "Legacy clients" below.
137
+ Documents).** The shipped `config.yaml` contains this block; `flair mcp enable`
138
+ uses it instead of creating it. See "Legacy clients" below.
141
139
 
142
- The `config.yaml` block is intentionally NOT committed to the live config in
143
- this slice — adding it changes boot behavior, which would break the
144
- default-OFF / byte-identical contract. An operator adds it deliberately when
145
- turning the surface on.
140
+ The shipped `config.yaml` already declares `@harperfast/oauth`; enable its MCP
141
+ surface with `FLAIR_MCP_OAUTH=true` and configure the issuer and provider
142
+ credentials.
146
143
 
147
144
  2. **Set the env:**
148
145
  - `FLAIR_MCP_OAUTH=true` — turns on the `/mcp` route registration AND the
@@ -191,8 +188,6 @@ cannot connect to this surface.
191
188
 
192
189
  ## Deferred (not in this slice)
193
190
 
194
- - Live `config.yaml` wiring of the `@harperfast/oauth` plugin (kept out to
195
- preserve the byte-identical flag-OFF contract; documented above for operators).
196
191
  - Migrating the homegrown `OAuth.ts` / `XAA.ts` opaque-token AS to the plugin.
197
192
  Per Kern: deprecate-don't-delete — they stay for the Ed25519/signed-REST path.
198
193
  XAA's JIT-provisioning is kept; the Model-2 handler reuses the same
package/docs/openclaw.md CHANGED
@@ -29,22 +29,34 @@ In your OpenClaw agent config, add the Flair plugin:
29
29
 
30
30
  ```json
31
31
  {
32
- "plugins": {
33
- "@tpsdev-ai/openclaw-flair": {
34
- "agentId": "my-agent",
35
- "flairUrl": "http://localhost:19926"
32
+ "plugins": {
33
+ "allow": ["openclaw-flair"],
34
+ "slots": {
35
+ "memory": "openclaw-flair"
36
+ },
37
+ "entries": {
38
+ "openclaw-flair": {
39
+ "enabled": true,
40
+ "hooks": {
41
+ "allowPromptInjection": true
42
+ },
43
+ "config": {
44
+ "url": "http://127.0.0.1:19926",
45
+ "autoRecall": true,
46
+ "autoCapture": false,
47
+ "maxRecallResults": 5,
48
+ "maxBootstrapTokens": 4000,
49
+ "agentId": "my-agent"
50
+ }
51
+ }
52
+ }
36
53
  }
37
- }
38
54
  }
39
55
  ```
40
56
 
41
- Or set environment variables:
42
-
43
- ```bash
44
- export FLAIR_AGENT_ID=my-agent
45
- export FLAIR_URL=http://localhost:19926
46
- ```
57
+ `allowConversationAccess` is required to enable auto-capture (the plugin also reads it for a startup warning and status), so this example, with `autoCapture: false`, leaves it out.
47
58
 
59
+ An optional `agentId` in `config` is an **allow-list**: it restricts which agents may be served but never substitutes for the host's per-invocation identity, which comes from host context on every call.
48
60
  ### 5. Restart the gateway
49
61
 
50
62
  ```bash
@@ -58,21 +70,20 @@ The Flair plugin adds these tools to your OpenClaw agent:
58
70
  | Tool | Description |
59
71
  |------|-------------|
60
72
  | `memory_store` | Write a memory with optional type, durability, and tags |
61
- | `memory_recall` | Semantic search over stored memories |
73
+ | `memory_search` | Semantic search over stored memories |
62
74
  | `memory_get` | Retrieve a specific memory by ID |
63
75
 
64
76
  ### Automatic Bootstrap
65
77
 
66
- On each new conversation, the plugin injects relevant context from Flair:
78
+ With `autoRecall` on (the default) and the host's `hooks.allowPromptInjection` enabled, the plugin handles `before_prompt_build`: it requests bootstrap context from Flair, up to `maxBootstrapTokens` and without passing a conversation topic, and returns it as `prependContext` when the context is non-empty. The context can include:
67
79
  - Soul entries (persistent personality and project context)
68
- - Recent memories (last 24h)
69
- - Relevant memories (semantically matched to the conversation topic)
80
+ - Recent memories (an adaptive window: 48 hours, widening to 7 and then 30 days when fewer than three are found)
70
81
 
71
- This happens automatically — no agent configuration needed beyond the plugin setup.
82
+ Without `hooks.allowPromptInjection` the plugin contributes no context and logs `prompt context disabled: policy` at startup.
72
83
 
73
84
  ## Multi-Agent
74
85
 
75
- Each OpenClaw agent gets its own isolated memory space:
86
+ Each OpenClaw agent writes with its `agentId` as a field (tags are optional); reads use owner plus visibility. A verified agent can read all its own records (private included) and other agents' non-private records on the instance; grants do not expand that read scope.
76
87
 
77
88
  ```bash
78
89
  flair agent add research-agent
@@ -80,13 +91,6 @@ flair agent add coding-agent
80
91
  flair agent add review-agent
81
92
  ```
82
93
 
83
- Agents can share memories via grants:
84
-
85
- ```bash
86
- # Let review-agent read coding-agent's memories
87
- flair grant coding-agent review-agent --scope read
88
- ```
89
-
90
94
  ## Soul (Personality)
91
95
 
92
96
  Set persistent context that shapes how the agent behaves:
@@ -103,10 +107,7 @@ Soul entries are included in every bootstrap — they're the agent's persistent
103
107
 
104
108
  ## Key Resolution
105
109
 
106
- The plugin resolves Ed25519 keys in this order:
107
- 1. `FLAIR_KEY_PATH` environment variable
108
- 2. `~/.flair/keys/<agent-id>.key`
109
- 3. `~/.tps/secrets/flair/<agent-id>-priv.key` (legacy TPS path)
110
+ The plugin finds Ed25519 keys for the host-provided agent identity: `keyPath` from config is only valid with a sole allowed agent (`agentId` set); otherwise the client resolves via `FLAIR_KEY_DIR` env var, then `~/.flair/keys/<agent-id>.key`, then `~/.tps/secrets/flair/<agent-id>-priv.key`. For each resolved home, `.flair` then the legacy path are checked in order before the next home.
110
111
 
111
112
  ## Troubleshooting
112
113
 
@@ -115,7 +115,7 @@ The command prints one JSON object. Tokens expire after **60 minutes** by defaul
115
115
  On the **hub host**, an admin runs:
116
116
 
117
117
  ```bash
118
- (umask 077; set -C; FLAIR_ADMIN_PASS="$(cat ~/.flair/admin-pass)" flair federation token > pair-triple.json)
118
+ (umask 077; set -C; flair federation token --admin-pass-file ~/.flair/admin-pass > pair-triple.json)
119
119
  ```
120
120
 
121
121
  `umask 077` sets the mode of a file the redirect CREATES; an existing file keeps its mode, so `set -C` (noclobber) makes the redirect refuse to overwrite it. Remove an old `pair-triple.json` first (`rm pair-triple.json`).
@@ -125,13 +125,13 @@ On the **hub host**, an admin runs:
125
125
  A Fabric-deployed hub is a Harper component on a managed cluster. There is no host to shell into. Mint the triple from any machine that can reach the hub — for a personal spoke, that machine is the spoke — and name both the data URL and the ops URL:
126
126
 
127
127
  ```bash
128
- (umask 077; set -C; FLAIR_ADMIN_PASS="$(cat /path/to/hub-admin-pass)" flair federation token \
128
+ (umask 077; set -C; flair federation token --admin-pass-file /path/to/hub-admin-pass \
129
129
  --target https://<hub>.<org>.harperfabric.com \
130
130
  --ttl 60 \
131
131
  --ops-target https://<hub>.<org>.harperfabric.com:9925 > pair-triple.json) # docs-freshness-allow: Fabric ops API port, not legacy data port
132
132
  ```
133
133
 
134
- `/path/to/hub-admin-pass` is a 0600 file holding the **HUB** admin password on the minting machine, not the spoke's `~/.flair/admin-pass`, which authenticates only the spoke. A literal on the command line would land in shell history, so read it from the file (or a secret manager). `--ops-target` is the Harper operations API on the same hostname at port 9925. <!-- docs-freshness-allow: Fabric ops API port, not legacy data port --> A portless `https://` `--target` derives that same port. Pass `--ops-target` so the URL is the one you chose. An explicit port other than 443 still derives as REST port minus one, which is not this ops port. `federation token` reads the admin password from `FLAIR_ADMIN_PASS` (or from `--admin-pass`). `--admin-pass` is also accepted but puts the password in shell history and process listings; prefer the file form above (or a secret manager).
134
+ `/path/to/hub-admin-pass` is a 0600 file holding the **HUB** admin password on the minting machine, not the spoke's `~/.flair/admin-pass`, which authenticates only the spoke. `--admin-pass-file` reads it in-process (mode 0600 enforced), so it stays out of shell history and the process list; a literal on the command line would land in both. `--ops-target` is the Harper operations API on the same hostname at port 9925. <!-- docs-freshness-allow: Fabric ops API port, not legacy data port --> A portless `https://` `--target` derives that same port. Pass `--ops-target` so the URL is the one you chose. An explicit port other than 443 still derives as REST port minus one, which is not this ops port. `federation token` also accepts `--admin-pass` (kept for compatibility, but it lands in shell history and the process list) or `FLAIR_ADMIN_PASS` (suits CI).
135
135
 
136
136
  ### 5b. Transfer the triple to the spoke
137
137
 
@@ -146,11 +146,12 @@ When it was minted with `--target` against a Fabric hub, the file is already on
146
146
  ### 5c. Pair from the spoke
147
147
 
148
148
  ```bash
149
- FLAIR_ADMIN_PASS="$(cat ~/.flair/admin-pass)" flair federation pair https://<hub-url> \
149
+ flair federation pair https://<hub-url> \
150
+ --admin-pass-file ~/.flair/admin-pass \
150
151
  --token-from ./pair-triple.json
151
152
  ```
152
153
 
153
- The spoke admin credential (`FLAIR_ADMIN_PASS` as above, or `--admin-pass`) is required so the CLI can write the hub as a local `Peer` record. Without it, pairing succeeds on the hub side but the spoke never records its peer, and `flair federation sync` reports "No hub peer configured."
154
+ The spoke admin credential (`--admin-pass-file ~/.flair/admin-pass`, or `FLAIR_ADMIN_PASS`/`--admin-pass`) is required so the CLI can write the hub as a local `Peer` record. Without it, pairing succeeds on the hub side but the spoke never records its peer, and `flair federation sync` reports "No hub peer configured."
154
155
 
155
156
  ### 5d. What pairing does
156
157
 
@@ -164,7 +165,7 @@ The spoke admin credential (`FLAIR_ADMIN_PASS` as above, or `--admin-pass`) is r
164
165
  ## 6. Sync for the First Time
165
166
 
166
167
  ```bash
167
- flair federation sync --admin-pass "$FLAIR_ADMIN_PASS"
168
+ flair federation sync --admin-pass-file ~/.flair/admin-pass
168
169
  ```
169
170
 
170
171
  Expected:
@@ -178,7 +179,7 @@ Then verify the pairing. `federation verify` pushes the canary itself — you
178
179
  do not need the systemd timer from §7 first:
179
180
 
180
181
  ```bash
181
- flair federation verify --admin-pass "$FLAIR_ADMIN_PASS"
182
+ flair federation verify --admin-pass-file ~/.flair/admin-pass
182
183
  flair federation reachability
183
184
  ```
184
185
 
@@ -290,14 +291,16 @@ export FLAIR_URL=http://127.0.0.1:9926
290
291
  A managed Harper Fabric hub (`https://<hub>.<org>.harperfabric.com`, HTTPS on 443) serves the operations API on port 9925 of the same hostname. <!-- docs-freshness-allow: Fabric ops API port, not legacy data port --> Mint the pairing token with `--target` and `--ops-target` as in [§5a](#harper-fabric-hub-no-shell). Pairing from the spoke still uses the public hub URL:
291
292
 
292
293
  ```bash
293
- FLAIR_ADMIN_PASS="$(cat ~/.flair/admin-pass)" flair federation pair https://<hub>.<org>.harperfabric.com \
294
+ flair federation pair https://<hub>.<org>.harperfabric.com \
295
+ --admin-pass-file ~/.flair/admin-pass \
294
296
  --token-from ./pair-triple.json
295
297
  ```
296
298
 
297
299
  A self-hosted instance that publishes an explicit REST port still uses ops = REST − 1 (a fresh local install is 19926 → 19925). Pass that ops URL with `--ops-target` when you are not on the box:
298
300
 
299
301
  ```bash
300
- FLAIR_ADMIN_PASS="$(cat ~/.flair/admin-pass)" flair federation pair https://fabric-node.example.com:19926/<instance> \
302
+ flair federation pair https://fabric-node.example.com:19926/<instance> \
303
+ --admin-pass-file ~/.flair/admin-pass \
301
304
  --token-from triple.json \
302
305
  --ops-target https://fabric-node.example.com:19925
303
306
  ```
@@ -311,8 +314,8 @@ FLAIR_ADMIN_PASS="$(cat ~/.flair/admin-pass)" flair federation pair https://fabr
311
314
  | Install | `npm install -g @tpsdev-ai/flair` |
312
315
  | Init spoke | `flair init --agent-id <id> --data-dir /data/flair --skip-soul` |
313
316
  | Check status | `flair status` / `flair federation status` |
314
- | Hub: mint token | On the hub host: `(umask 077; set -C; FLAIR_ADMIN_PASS="$(cat ~/.flair/admin-pass)" flair federation token > triple.json)`. Harper Fabric hub (no shell): §5a `--target` + `--ops-target` |
315
- | Spoke: pair | `FLAIR_ADMIN_PASS="$(cat ~/.flair/admin-pass)" flair federation pair <hub-url> --token-from ./triple.json` |
317
+ | Hub: mint token | On the hub host: `(umask 077; set -C; flair federation token --admin-pass-file ~/.flair/admin-pass > triple.json)`. Harper Fabric hub (no shell): §5a `--target` + `--ops-target` |
318
+ | Spoke: pair | `flair federation pair <hub-url> --admin-pass-file ~/.flair/admin-pass --token-from ./triple.json` |
316
319
  | Spoke: sync | `FLAIR_ADMIN_PASS="$(cat ~/.flair/admin-pass)" flair federation sync` |
317
320
  | Spoke: verify | `FLAIR_ADMIN_PASS="$(cat ~/.flair/admin-pass)" flair federation verify` then `flair federation reachability` |
318
321
  | Watch loop | `flair federation watch --interval 30` |
@@ -221,10 +221,10 @@ Available. Pair a local instance as a hub or spoke with another Flair instance:
221
221
 
222
222
  ```bash
223
223
  # On the hub — generate a one-time pairing token triple
224
- (umask 077; set -C; FLAIR_ADMIN_PASS="$(cat ~/.flair/admin-pass)" flair federation token > triple.json)
224
+ (umask 077; set -C; flair federation token --admin-pass-file ~/.flair/admin-pass > triple.json)
225
225
 
226
226
  # On the spoke — its own admin password writes the local Peer row
227
- FLAIR_ADMIN_PASS="$(cat ~/.flair/admin-pass)" flair federation pair <hub-url> --token-from ./triple.json
227
+ flair federation pair <hub-url> --admin-pass-file ~/.flair/admin-pass --token-from ./triple.json
228
228
 
229
229
  # Sync (one-shot)
230
230
  flair federation sync --admin-pass-file ~/.flair/admin-pass
@@ -38,14 +38,14 @@ Override per-run via `FLAIR_DEP_KEEP_CURRENT="pkg1,pkg2,@scope/pkg3"` env (addit
38
38
 
39
39
  ### 2. Exact-version pinning for production deps
40
40
 
41
- Every `dependencies` entry in any `package.json` must be a single concrete version (`"5.0.9"`), not a range (`"^5.0"`, `"~5.0.9"`, `">=5"`). Range specifiers expose us to silent supply-chain swaps every install — exactly the surface attackers exploit.
41
+ Some `dependencies` entries are exact-pinned (`harper@5.2.8`, `commander@14.0.3`, `jose@6.2.2`, `tweetnacl@1.0.3`), but others are range-spec'd (`harper-fabric-embeddings@^0.5.0`, `js-yaml@^4.3.2`, `semver@^7.8.5`, `tar@^7.5.22`). Most overrides use ranges (`^`/`~`), with one exact alias (`npm:empty-npm-package@1.0.0` for `react-native-fs`). The age gate (`scripts/check-dep-ages.mjs`, line 130) checks npm publish age for external entries in the `dependencies` field whose declared version starts with a digit (`/^\d/.test(version)`), excluding workspace-internal dependencies and the keep-current list (`harper`, `harper-fabric-embeddings`, `@harperfast/oauth`); its default threshold is seven days.
42
42
 
43
- - `peerDependencies` may use ranges (host-provided; never installed by us). `devDependencies` are also exact-pinned for build reproducibility, though they don't ship in our published tarballs.
44
- - **Flair declares no optional peers today**, and no `optionalDependencies` at all. If either is ever proposed as an install-weight fix, the mechanism has now been measured twice (`@harperfast/oauth` flair#750, `node-llama-cpp` flair#887) and the result is counter-intuitive enough to be worth stating: **only `peerDependencies` + `peerDependenciesMeta.optional` is skipped by a default install** (npm and bun alike). A plain `optionalDependencies` entry *is* still installed by default — "optional" there means "a failed install is non-fatal", not "skipped" — so it buys no install-weight reduction whatsoever. Exact-pinning an optional peer (rather than ranging it) is also legitimate where the consuming code path is version-sensitive, so that an operator who installs a different version gets told the version they have is not the version that was tested.
43
+ - `peerDependencies` may use ranges: they state what the host project must provide, and they are never bundled into our published tarballs. They are still installed, because npm and Bun install non-optional peers by default: a consumer's install resolves them, and our own workspace install records the required peers of `langgraph-flair`, `n8n-nodes-flair` and `openclaw-flair` in `bun.lock` like any other dependency (the frozen-lockfile install does not check a recorded peer against its declared range; flair#1936). Most `devDependencies` are exact-pinned for build reproducibility; a few are ranged (`@types/semver@^7.8.0`). They don't ship in our published tarballs.
44
+ - **Flair declares no optional peers today**, and no `optionalDependencies` at the root; `packages/flair-bench/package.json` (line 38) declares some. If either is ever proposed as an install-weight fix, the mechanism has now been measured twice (`@harperfast/oauth` flair#750, `node-llama-cpp` flair#887) and the result is counter-intuitive enough to be worth stating: **only `peerDependencies` + `peerDependenciesMeta.optional` is skipped by a default install** (npm and bun alike). A plain `optionalDependencies` entry *is* still installed by default — "optional" there means "a failed install is non-fatal", not "skipped" — so it buys no install-weight reduction whatsoever. Exact-pinning an optional peer (rather than ranging it) is also legitimate where the consuming code path is version-sensitive, so that an operator who installs a different version gets told the version they have is not the version that was tested.
45
45
 
46
46
  Note the corollary, measured during flair#893: an optional peer that is simply *absent* installs silently — npm prints no warning at all — so it cannot be relied on to prompt anyone to install it. Anything a user must install for a feature to work needs to be documented, or detected and reported at runtime.
47
- - `bun.lock` is committed and frozen-lockfile installed in CI. Any unintended dep drift fails the workspace-deps consistency gate.
48
- - Pin updates happen via deliberate, test-gated PRs — never auto-merged. **Renovate is enabled** (`.github/renovate.json`) to *propose* these updates on a schedule, but it respects the bake-time cooldown (`minimumReleaseAge: "7 days"`, matching `FLAIR_DEP_MIN_AGE_DAYS`) and opens PRs only — `automerge` is off, so every bump flows through the full test suite + K&S review. Renovate uses `rangeStrategy: "pin"` so it proposes exact-version bumps (never re-widens to ranges) and shares the keep-current allow-list with `check-dep-ages.mjs`. Vulnerability alerts bypass the cooldown so security fixes aren't delayed.
47
+ - `bun.lock` is committed and `bun install --frozen-lockfile` is run in CI (`.github/workflows/test.yml`, ~121). That lockfile gate fails when package.json and bun.lock disagree; `scripts/check-workspace-deps.mjs` compares each recognized internal `@tpsdev-ai/*` dependency's literal declared version to the version the target package ships, and accepts `workspace:` declarations (e.g. `workspace:*` at `packages/cursor-wake-runner/package.json`, line 22; skip at `scripts/check-workspace-deps.mjs`, line 59).
48
+ - Pin updates happen via deliberate, test-gated PRs — never auto-merged. **Renovate is enabled** (the shared org preset at `.github/renovate-preset.json`, with `.github/renovate.json` holding only flair-specific exceptions) to *propose* these updates on a schedule, but it respects the bake-time cooldown (`minimumReleaseAge: "7 days"`, matching `FLAIR_DEP_MIN_AGE_DAYS`) and opens PRs only — `automerge` is off, so every bump flows through the full test suite + K&S review. Renovate uses `rangeStrategy: "pin"` so it proposes exact-version bumps (never re-widens to ranges) and shares the keep-current allow-list with `check-dep-ages.mjs`. Vulnerability alerts bypass the Renovate cooldown, so Renovate can propose an advisory fix immediately; the CI age gate can still hold a fresh pinned npm production dependency.
49
49
 
50
50
  ### 3. Internal dep version lockstep
51
51
 
@@ -109,9 +109,11 @@ Run it locally with `node scripts/audit-gate.mjs --explain`.
109
109
 
110
110
  ## Automation
111
111
 
112
- ### `.github/renovate.json` — deliberate, cooldown-gated update proposals
112
+ ### The shared org preset — `.github/renovate-preset.json` (`.github/renovate.json` holds only flair-specific exceptions)
113
113
 
114
- Renovate opens PRs to propose dependency updates so we don't drift behind upstream indefinitely — but on our terms, not the registry's. It is configured to never auto-merge (`automerge: false`), to pin (`rangeStrategy: "pin"`, consistent with §2), and to respect the bake-time cooldown (`minimumReleaseAge: "7 days"`, matching `FLAIR_DEP_MIN_AGE_DAYS` in `check-dep-ages.mjs`) so it only proposes versions that have already cleared the detection window. Non-major updates are grouped; majors land as isolated PRs. The keep-current allow-list (`harper`, `harper-fabric-embeddings`, `@harperfast/oauth`) mirrors the script's `DEFAULT_KEEP_CURRENT` — keep the two in lockstep when either changes. Vulnerability alerts bypass the cooldown. Every Renovate PR still runs the full CI suite (including the bake-time and workspace-deps gates) and is K&S-reviewed before merge.
114
+ Renovate opens PRs to propose dependency updates so we don't drift behind upstream indefinitely — but on our terms, not the registry's. The org preset (`.github/renovate-preset.json`) is common to all tpsdev-ai repos; `.github/renovate.json` holds only flair-specific overrides (workspace-internal dep exclusions, keep-current allow-list)
115
+
116
+ Renovate is configured to never auto-merge (`automerge: false`), to pin (`rangeStrategy: "pin"`, consistent with §2), and to respect the bake-time cooldown (`minimumReleaseAge: "7 days"` by default, matching `FLAIR_DEP_MIN_AGE_DAYS` in `check-dep-ages.mjs`), so by default it proposes only versions that have cleared the detection window — the two named exceptions are vulnerability fixes and the keep-current list below. Non-major updates are grouped per ecosystem (npm/Bun, Python, GitHub Actions, Docker); a manager outside those four gets no ecosystem-wide group from the four explicit rules (groups inherited from config:recommended may still apply); majors land as isolated PRs. The keep-current allow-list (`harper`, `harper-fabric-embeddings`, `@harperfast/oauth`) mirrors the script's `DEFAULT_KEEP_CURRENT` — keep the two in lockstep when either changes. Vulnerability alerts bypass the cooldown: Renovate can propose an advisory fix immediately. Flair's CI age gate (`check-dep-ages.mjs`) can still block a fresh pinned npm production dependency; other fresh versions follow the 7-day cooldown unless an explicit exception, such as the keep-current list, applies. The control for the fast-track is not the cooldown: it is `automerge: false` plus the full CI suite (including the bake-time and workspace-deps gates) and a K&S review on every Renovate PR. Docker image digests in Dockerfiles and compose files land in the docker group; images in workflow `container:`/`services:` are proposed by the github-actions manager and land in the github-actions group. The preset is in the CODEOWNERS trust root (`@heskew`): Renovate reads it from the default branch for every repo that extends it, so a change to it takes the same human as a change to the release tagger.
115
117
 
116
118
  ### `scripts/check-workspace-deps.mjs` (already shipped, PR #368)
117
119
 
@@ -119,7 +121,7 @@ Fails any PR where a workspace package declares an internal `@tpsdev-ai/*` dep a
119
121
 
120
122
  ### `scripts/check-dep-ages.mjs` (this PR)
121
123
 
122
- Fails any PR with an external pinned production dep version published less than `FLAIR_DEP_MIN_AGE_DAYS` ago (default 7). Queries the npm registry's `time` map. Workspace-internal deps exempt. Wired into the `test-unit` job.
124
+ Fails any PR with an external pinned production dep version published less than `FLAIR_DEP_MIN_AGE_DAYS` ago (default 7). Queries the npm registry's `time` map. Workspace-internal deps exempt. Wired into the `test-unit` job. Its limits, stated: it covers npm production dependencies only (not the Python, Docker or GitHub Actions updates the Renovate preset proposes), and it reads the same registry publish timestamp Renovate does, so it is a second line against the cooldown being removed from the config — not against a release whose publish date lies.
123
125
 
124
126
  Configurable:
125
127
 
@@ -173,6 +175,17 @@ chmod +x scripts/check-dep-ages.mjs
173
175
 
174
176
  The script has no external dependencies — node 18+ is enough.
175
177
 
178
+ To adopt the same Renovate preset in your repo, make your `.github/renovate.json`:
179
+
180
+ ```json
181
+ {
182
+ "$schema": "https://docs.renovatebot.com/renovate-schema.json",
183
+ "extends": ["github>tpsdev-ai/flair//.github/renovate-preset"]
184
+ }
185
+ ```
186
+
187
+ Add `packageRules` only for your own exceptions. The preset carries no `@tpsdev-ai/**` exclusion: a repo whose own release process bumps tpsdev-ai workspace packages adds the same `{ "matchPackageNames": ["@tpsdev-ai/**"], "enabled": false }` rule flair keeps in `.github/renovate.json`, otherwise their non-major updates join the non-major npm group (major updates stay isolated, like every other major).
188
+
176
189
  ---
177
190
 
178
191
  ## Exceptions and incident response
@@ -24,7 +24,7 @@ Flair runs Harper v5 (a Node.js HTTP+storage runtime) plus a small CLI/MCP layer
24
24
  - **Embedding cache.** First semantic search per cold daemon loads `nomic-embed-text-v1.5` into memory (~270 MB). Subsequent searches reuse it. If you disable embeddings (text-only search), strip ~270 MB.
25
25
  - **HNSW index.** In-memory vector index over the agent's memories. Grows linearly with memory count; expect ~1 KB per memory plus the 768-dim vector (~1.5 KB).
26
26
  - **Harper transaction log.** Bounded by retention window; grows during writes, compacts on idle.
27
- - **MCP clients.** Each `flair-mcp` subprocess holds ~40–50 MB. Long-lived MCP host (Claude Code) restarts spawn fresh ones; orphaned ones from the host crashing should be cleaned up by the parent-exit watcher (PR pending).
27
+ - **MCP clients.** Each `flair-mcp` subprocess holds ~40–50 MB. Long-lived MCP host (Claude Code) restarts spawn fresh ones; a lost subprocess exits on reparenting to PID 1 or stdin close/end.
28
28
 
29
29
  ## Scaling expectations
30
30
 
package/docs/upgrade.md CHANGED
@@ -45,8 +45,8 @@ for each already-wired client (`~/.claude.json`, `~/.claude/settings.json`,
45
45
  `~/.codex/config.toml`, `~/.codex/hooks.json`, and the other auto-wired clients).
46
46
  Pass `--all` to also see `flair-client` (normally hidden as a
47
47
  transitive dependency). **Other integrations upgrade in their own ecosystem, not via
48
- `flair upgrade`:** `pi-flair` (pi's plugin manager), `langgraph-flair` / `hermes-flair`
49
- (pip / your Python package manager), `n8n-nodes-flair` (n8n's Community Nodes UI).
48
+ `flair upgrade`:** `pi-flair` (pi's plugin manager), `langgraph-flair` (an npm module), `hermes-flair`
49
+ (reinstall the plugin from a flair checkout: `hermes plugins install path:<flair>/packages/hermes-flair`), `n8n-nodes-flair` (n8n's Community Nodes UI).
50
50
 
51
51
  If the running instance's exec path is a **plain extracted tree** (npm pack +
52
52
  `npm install --omit=dev`, typically under systemd — no git checkout, not the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tpsdev-ai/flair",
3
- "version": "0.56.0",
3
+ "version": "0.57.0",
4
4
  "packageManager": "bun@1.3.10",
5
5
  "description": "Identity, memory, and soul for AI agents. Cryptographic identity (Ed25519), semantic memory with local embeddings, and persistent personality — all in a single process.",
6
6
  "type": "module",