@tpsdev-ai/flair 0.51.2 → 0.53.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 (74) hide show
  1. package/README.md +10 -5
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli.js +1037 -566
  4. package/dist/doctor-client.js +35 -0
  5. package/dist/hook-install.js +74 -0
  6. package/dist/install/global-bin-path.js +14 -0
  7. package/dist/lib/auth-resolve.js +15 -0
  8. package/dist/lib/doctor-run.js +28 -15
  9. package/dist/lib/launchd-repair.js +198 -0
  10. package/dist/lib/stabilize-mqtt-network.js +123 -0
  11. package/dist/lib/upgrade-exec-path.js +257 -0
  12. package/dist/lib/upgrade-plain-tree.js +558 -0
  13. package/dist/rem/promote-policy.js +204 -0
  14. package/dist/rem/restore.js +55 -15
  15. package/dist/rem/runner.js +203 -20
  16. package/dist/resources/AdminMemory.js +2 -1
  17. package/dist/resources/AgentSeed.js +26 -10
  18. package/dist/resources/Asset.js +203 -0
  19. package/dist/resources/AutoPromoteCandidates.js +2 -4
  20. package/dist/resources/Credential.js +14 -0
  21. package/dist/resources/Federation.js +80 -0
  22. package/dist/resources/Integration.js +12 -0
  23. package/dist/resources/Memory.js +158 -60
  24. package/dist/resources/MemoryBootstrap.js +63 -20
  25. package/dist/resources/MemoryCandidate.js +12 -0
  26. package/dist/resources/MemoryConsolidate.js +2 -1
  27. package/dist/resources/MemoryDedupStats.js +17 -2
  28. package/dist/resources/MemoryFeed.js +30 -0
  29. package/dist/resources/MemoryGrant.js +14 -0
  30. package/dist/resources/MemoryReflect.js +75 -17
  31. package/dist/resources/Message.js +190 -0
  32. package/dist/resources/OrgEvent.js +12 -0
  33. package/dist/resources/PromoteMemoryCandidate.js +76 -0
  34. package/dist/resources/RecordUsage.js +1 -1
  35. package/dist/resources/Relationship.js +12 -0
  36. package/dist/resources/SemanticSearch.js +45 -13
  37. package/dist/resources/Soul.js +54 -18
  38. package/dist/resources/WorkspaceState.js +12 -0
  39. package/dist/resources/auth-middleware.js +17 -44
  40. package/dist/resources/authority-field-guard.js +37 -0
  41. package/dist/resources/bm25-index-service.js +1 -1
  42. package/dist/resources/bm25-index.js +50 -11
  43. package/dist/resources/embedding-space-guard.js +238 -0
  44. package/dist/resources/embeddings-provider.js +32 -5
  45. package/dist/resources/federation-classify.js +23 -1
  46. package/dist/resources/health.js +11 -2
  47. package/dist/resources/hit-tracking.js +244 -0
  48. package/dist/resources/mcp-tools.js +272 -7
  49. package/dist/resources/memory-reflect-lib.js +111 -0
  50. package/dist/resources/migrations/embedding-stamp.js +22 -4
  51. package/dist/resources/owner-field-guard.js +62 -0
  52. package/dist/resources/promotion-stamp.js +29 -0
  53. package/dist/resources/record-owner-guard.js +71 -5
  54. package/dist/resources/record-types.js +30 -7
  55. package/dist/resources/relay-lib.js +205 -0
  56. package/dist/resources/relay-ops.js +294 -0
  57. package/dist/resources/skill-write.js +120 -0
  58. package/dist/resources/soul-adk-guard.js +68 -0
  59. package/dist/resources/soul-write-policy.js +63 -0
  60. package/dist/resources/table-helpers.js +2 -0
  61. package/dist/resources/usage-recording.js +3 -3
  62. package/dist/src/rem/promote-policy.js +204 -0
  63. package/docs/api-reference.md +374 -0
  64. package/docs/auth.md +52 -0
  65. package/docs/federation.md +4 -0
  66. package/docs/integrations.md +6 -6
  67. package/docs/mcp-clients.md +16 -1
  68. package/docs/releasing.md +11 -8
  69. package/docs/rem.md +20 -2
  70. package/docs/upgrade.md +47 -2
  71. package/package.json +6 -5
  72. package/schemas/memory.graphql +51 -2
  73. package/schemas/message.graphql +74 -0
  74. package/templates/launchd/start-flair-with-admin-pass.sh +73 -0
package/README.md CHANGED
@@ -44,7 +44,10 @@ Step 5 finds the memory you never keyword-matched:
44
44
  ( 2026-07-28 · standard · 100% )
45
45
  ```
46
46
 
47
- That trailing figure is a rank score, normalized so the top hit is always near 100% — ordering, not confidence.
47
+ By default, that percentage displays semantic similarity with a small keyword-match
48
+ boost. Hybrid search combines semantic and lexical ranks to order results, so the
49
+ first result need not have the highest percentage or be near 100%. The percentage
50
+ is not a probability that the memory answers your question correctly.
48
51
 
49
52
  `flair init` installs and starts Harper, creates the agent's Ed25519 keypair, verifies semantic search actually works, wires every MCP client it detects (Claude Code, Cursor, Codex CLI, Gemini CLI), and runs a smoke test. Restart your MCP client afterwards, then ask the agent *"what do you remember about me?"*
50
53
 
@@ -104,6 +107,8 @@ flair upgrade --check # show the plan across flair, flair-mcp and the openclaw
104
107
  flair upgrade # apply it; the instance restarts automatically
105
108
  ```
106
109
 
110
+ A plain extracted tree (`npm pack` + systemd, not `npm install -g`)? `flair upgrade` detects it, or pass `--tree <dir>`. See [docs/upgrade.md](docs/upgrade.md#plain-tree--npm-pack-install).
111
+
107
112
  Deployed to a Harper Fabric cluster instead of running locally? Use `flair upgrade --target <fabric-url>`.
108
113
 
109
114
  ## What it looks like
@@ -166,7 +171,7 @@ See **[DESIGN.md](DESIGN.md)** for the invariants behind the three primitives
166
171
  | Feature | What it does |
167
172
  |---|---|
168
173
  | **Semantic memory** | Auto-embedded on write. Search by meaning, not keywords. |
169
- | **Tiered durability** | `permanent` (delete rejected) / `persistent` / `standard` (default) / `ephemeral` (24h TTL). |
174
+ | **Tiered durability** | `permanent` (retained until explicitly deleted by its owner or an admin) / `persistent` / `standard` (default) / `ephemeral` (24h TTL). |
170
175
  | **Temporal validity** | `validFrom` / `validTo` bounds. Expired memories drop out of search and bootstrap automatically. |
171
176
  | **Trust-graded recall** | Opt-in per-result evidence: provenance, usage signal, freshness, supersession. Confidence bands (`strong`/`moderate`/`breadcrumb`) and first-class **abstention** when nothing clears the floor. |
172
177
  | **Relationship graph** | Entity-to-entity triples with temporal bounds, queryable alongside semantic memory. |
@@ -253,7 +258,7 @@ Any agent that can run a shell command can use Flair directly.
253
258
  ```bash
254
259
  flair memory add --agent mybot "learned something important"
255
260
  flair search --agent mybot "that important thing"
256
- flair soul set --agent mybot --key role --value "Security reviewer"
261
+ flair soul set --agent mybot --key role --value "Security reviewer" --admin-pass-file ~/.flair/admin-pass
257
262
  flair bootstrap --agent mybot --max-tokens 4000 # cold-start: soul + relevant memories
258
263
  flair backup --admin-pass-file ~/.flair/admin-pass # logical JSON export
259
264
  flair restore ./backup.json --admin-pass-file ~/.flair/admin-pass
@@ -279,7 +284,7 @@ const flair = new FlairClient({
279
284
  await flair.memory.write('Harper v5 sandbox blocks bare imports')
280
285
  const results = await flair.memory.search('native module loading')
281
286
  const ctx = await flair.bootstrap({ maxTokens: 4000 })
282
- await flair.soul.set('role', 'Security reviewer')
287
+ await flair.soul.get('role')
283
288
  ```
284
289
 
285
290
  No Harper, no embeddings — just HTTP and auth. Full API in the [client README](packages/flair-client/README.md).
@@ -298,7 +303,7 @@ curl -H "Authorization: TPS-Ed25519 mybot:$TS:$NONCE:$SIG" \
298
303
  -d '{"id": "mybot-123", "agentId": "mybot", "content": "...", "durability": "standard"}'
299
304
  ```
300
305
 
301
- Sign `agentId:timestamp:nonce:METHOD:/path` with the agent's private key. Protocol in [SECURITY.md](SECURITY.md).
306
+ Sign `agentId:timestamp:nonce:METHOD:/path` with the agent's private key. Protocol in [SECURITY.md](SECURITY.md). Consolidated endpoint, auth-per-resource, and schema catalog: **[docs/api-reference.md](docs/api-reference.md)**.
302
307
 
303
308
  ### Embedded in a Harper app (in-process)
304
309
 
@@ -1,6 +1,6 @@
1
1
  {
2
- "version": "0.51.2",
3
- "commit": "b796f758ddbeaee6e203bb5c0ad576338f872642",
4
- "builtAt": "2026-09-03T01:00:42.325Z",
2
+ "version": "0.53.0",
3
+ "commit": "3a238b4a3ce3fce8cf64fcb83bd3203096ebae3a",
4
+ "builtAt": "2026-09-10T17:58:16.549Z",
5
5
  "builder": "tsc"
6
6
  }