@tpsdev-ai/flair 0.3.17 → 0.4.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 +49 -33
- package/config.yaml +4 -2
- package/dist/cli.js +455 -20
- package/dist/resources/Memory.js +52 -3
- package/dist/resources/MemoryBootstrap.js +7 -1
- package/dist/resources/SemanticSearch.js +129 -56
- package/dist/resources/auth-middleware.js +37 -10
- package/dist/resources/content-safety.js +62 -0
- package/dist/resources/embeddings-provider.js +86 -7
- package/dist/resources/rate-limiter.js +118 -0
- package/package.json +2 -3
- package/resources/A2AAdapter.ts +0 -510
- package/resources/Agent.ts +0 -10
- package/resources/AgentCard.ts +0 -65
- package/resources/AgentSeed.ts +0 -119
- package/resources/IngestEvents.ts +0 -189
- package/resources/Integration.ts +0 -14
- package/resources/IssueTokens.ts +0 -29
- package/resources/Memory.ts +0 -151
- package/resources/MemoryBootstrap.ts +0 -323
- package/resources/MemoryConsolidate.ts +0 -121
- package/resources/MemoryFeed.ts +0 -48
- package/resources/MemoryMaintenance.ts +0 -95
- package/resources/MemoryReflect.ts +0 -122
- package/resources/OrgEvent.ts +0 -63
- package/resources/OrgEventCatchup.ts +0 -89
- package/resources/OrgEventMaintenance.ts +0 -37
- package/resources/SemanticSearch.ts +0 -197
- package/resources/SkillScan.ts +0 -146
- package/resources/Soul.ts +0 -10
- package/resources/SoulFeed.ts +0 -15
- package/resources/WorkspaceLatest.ts +0 -66
- package/resources/WorkspaceState.ts +0 -102
- package/resources/auth-middleware.ts +0 -501
- package/resources/embeddings-provider.ts +0 -61
- package/resources/embeddings.ts +0 -28
- package/resources/health.ts +0 -7
- package/resources/memory-feed-lib.ts +0 -22
- package/resources/table-helpers.ts +0 -46
package/README.md
CHANGED
|
@@ -88,6 +88,12 @@ flair agent add mybot --name "My Bot" --role assistant
|
|
|
88
88
|
|
|
89
89
|
# Check everything is working
|
|
90
90
|
flair status
|
|
91
|
+
|
|
92
|
+
# Lifecycle management
|
|
93
|
+
flair stop # Stop the Flair instance
|
|
94
|
+
flair restart # Restart the Flair instance
|
|
95
|
+
flair uninstall # Remove the service (keeps data)
|
|
96
|
+
flair uninstall --purge # Remove everything including data and keys
|
|
91
97
|
```
|
|
92
98
|
|
|
93
99
|
That's it. Your agent now has identity and memory.
|
|
@@ -128,29 +134,28 @@ openclaw plugins install @tpsdev-ai/openclaw-flair
|
|
|
128
134
|
|
|
129
135
|
The plugin auto-detects your agent identity, provides `memory_store`/`memory_recall`/`memory_get` tools, and injects relevant memories at session start. See the [plugin README](plugins/openclaw-flair/README.md) for details.
|
|
130
136
|
|
|
131
|
-
### Claude Code / Codex / Cursor
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
+
### Claude Code / Codex / Cursor (MCP)
|
|
138
|
+
|
|
139
|
+
Install the MCP server for native tool integration:
|
|
140
|
+
|
|
141
|
+
```json
|
|
142
|
+
// .mcp.json in your project root
|
|
143
|
+
{
|
|
144
|
+
"mcpServers": {
|
|
145
|
+
"flair": {
|
|
146
|
+
"command": "npx",
|
|
147
|
+
"args": ["@tpsdev-ai/flair-mcp"],
|
|
148
|
+
"env": { "FLAIR_AGENT_ID": "mybot" }
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
```
|
|
137
153
|
|
|
138
|
-
|
|
154
|
+
Add to your `CLAUDE.md`:
|
|
139
155
|
|
|
140
|
-
|
|
141
|
-
Run: `flair bootstrap --agent mybot --max-tokens 4000`
|
|
142
|
-
This returns your soul + recent memories. Read it — that's your context.
|
|
156
|
+
At the start of every session, run mcp__flair__bootstrap before responding.
|
|
143
157
|
|
|
144
|
-
|
|
145
|
-
- Remember something: `flair memory add --agent mybot --content "what you learned"`
|
|
146
|
-
- Search memory: `flair memory search --agent mybot --q "your query"`
|
|
147
|
-
- Store a lesson: `flair memory add --agent mybot --content "lesson" --type lesson --durability persistent`
|
|
148
|
-
|
|
149
|
-
### Rules
|
|
150
|
-
- Bootstrap FIRST, before doing anything else
|
|
151
|
-
- Store lessons and decisions immediately — don't wait
|
|
152
|
-
- If you learn something that should survive restarts, write it to Flair
|
|
153
|
-
```
|
|
158
|
+
Claude Code gets native tools: `memory_store`, `memory_search`, `bootstrap`, `soul_set`, and more. See the [MCP README](packages/flair-mcp/README.md) and [Claude Code guide](docs/claude-code.md).
|
|
154
159
|
|
|
155
160
|
### JavaScript / TypeScript (Client Library)
|
|
156
161
|
|
|
@@ -164,7 +169,7 @@ npm install @tpsdev-ai/flair-client
|
|
|
164
169
|
import { FlairClient } from '@tpsdev-ai/flair-client'
|
|
165
170
|
|
|
166
171
|
const flair = new FlairClient({
|
|
167
|
-
url: 'http://localhost:
|
|
172
|
+
url: 'http://localhost:19926', // or remote: https://flair.example.com
|
|
168
173
|
agentId: 'mybot',
|
|
169
174
|
// key auto-resolved from ~/.flair/keys/mybot.key
|
|
170
175
|
})
|
|
@@ -191,17 +196,17 @@ Flair is a pure HTTP API. Use it from Python, Go, Rust, shell scripts — anythi
|
|
|
191
196
|
```bash
|
|
192
197
|
# Search memories
|
|
193
198
|
curl -H "Authorization: TPS-Ed25519 mybot:$TS:$NONCE:$SIG" \
|
|
194
|
-
-X POST http://localhost:
|
|
199
|
+
-X POST http://localhost:19926/SemanticSearch \
|
|
195
200
|
-d '{"agentId": "mybot", "q": "deployment procedure", "limit": 5}'
|
|
196
201
|
|
|
197
202
|
# Write a memory
|
|
198
203
|
curl -H "Authorization: TPS-Ed25519 mybot:$TS:$NONCE:$SIG" \
|
|
199
|
-
-X PUT http://localhost:
|
|
204
|
+
-X PUT http://localhost:19926/Memory/mybot-123 \
|
|
200
205
|
-d '{"id": "mybot-123", "agentId": "mybot", "content": "...", "durability": "standard"}'
|
|
201
206
|
|
|
202
207
|
# Bootstrap (soul + recent memories)
|
|
203
208
|
curl -H "Authorization: TPS-Ed25519 mybot:$TS:$NONCE:$SIG" \
|
|
204
|
-
-X POST http://localhost:
|
|
209
|
+
-X POST http://localhost:19926/BootstrapMemories \
|
|
205
210
|
-d '{"agentId": "mybot", "maxTokens": 4000}'
|
|
206
211
|
```
|
|
207
212
|
|
|
@@ -246,15 +251,22 @@ flair init
|
|
|
246
251
|
|
|
247
252
|
Your data stays on your machine. Best for personal agents, dev teams, and privacy-first setups. Flair runs as a single Harper process — no Docker, no cloud, no external services.
|
|
248
253
|
|
|
254
|
+
#### Custom Ports
|
|
255
|
+
If the default port (`19926`) is already in use, initialize with a custom port:
|
|
256
|
+
```bash
|
|
257
|
+
flair init --port 8000
|
|
258
|
+
```
|
|
259
|
+
Flair will automatically remember this port for future CLI commands by saving it to `~/.flair/config.yaml`.
|
|
260
|
+
|
|
249
261
|
### Remote Server
|
|
250
262
|
|
|
251
263
|
Run Flair on a VPS or cloud instance. Agents connect over HTTPS:
|
|
252
264
|
|
|
253
265
|
```bash
|
|
254
266
|
# On the server
|
|
255
|
-
flair init --port
|
|
267
|
+
flair init --port 19926
|
|
256
268
|
# Agents connect with:
|
|
257
|
-
FLAIR_URL=https://your-server:
|
|
269
|
+
FLAIR_URL=https://your-server:19926 flair agent add mybot
|
|
258
270
|
```
|
|
259
271
|
|
|
260
272
|
Good for teams with multiple machines or always-on agents.
|
|
@@ -292,21 +304,25 @@ Flair is in active development and daily use. We dogfood it — the agents that
|
|
|
292
304
|
|
|
293
305
|
**What works:**
|
|
294
306
|
- ✅ Ed25519 agent identity and auth
|
|
295
|
-
- ✅ CLI: init, agent add/remove/rotate-key, status, backup/restore, grant/revoke
|
|
296
|
-
- ✅ Memory CRUD with durability enforcement
|
|
297
|
-
- ✅ In-process semantic embeddings (768-dim nomic-embed-text
|
|
298
|
-
- ✅ Hybrid search (semantic + keyword)
|
|
307
|
+
- ✅ CLI: init, agent add/remove/rotate-key, status, backup/restore, export/import, grant/revoke
|
|
308
|
+
- ✅ Memory CRUD with durability enforcement and near-duplicate detection
|
|
309
|
+
- ✅ In-process semantic embeddings (768-dim nomic-embed-text via harper-fabric-embeddings)
|
|
310
|
+
- ✅ Hybrid search (semantic + keyword + temporal intent detection)
|
|
299
311
|
- ✅ Soul (permanent personality/values)
|
|
300
312
|
- ✅ Real-time feeds (WebSocket/SSE)
|
|
301
313
|
- ✅ Agent-scoped data isolation
|
|
302
|
-
- ✅ Cold start bootstrap
|
|
314
|
+
- ✅ Cold start bootstrap with adaptive time window
|
|
303
315
|
- ✅ OpenClaw memory plugin
|
|
316
|
+
- ✅ MCP server for Claude Code / Cursor / Windsurf
|
|
317
|
+
- ✅ Lightweight client library (`@tpsdev-ai/flair-client`)
|
|
318
|
+
- ✅ Portable agent identity (export/import between instances)
|
|
319
|
+
- ✅ `flair --version`, `flair upgrade`
|
|
304
320
|
|
|
305
321
|
**What's next:**
|
|
322
|
+
- [ ] First-run soul wizard (interactive personality setup)
|
|
323
|
+
- [ ] Git-backed memory sync
|
|
306
324
|
- [ ] Encryption at rest (opt-in AES-256-GCM per memory)
|
|
307
|
-
- [ ] Pluggable embedding backends (OpenAI, Cohere, local)
|
|
308
325
|
- [ ] Harper Fabric deployment (managed multi-office)
|
|
309
|
-
- [ ] Scheduled automatic backups
|
|
310
326
|
|
|
311
327
|
## License
|
|
312
328
|
|
package/config.yaml
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
name: flair
|
|
2
2
|
rest: true
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
## Port is configured via CLI (flair init --port) or HTTP_PORT env var.
|
|
5
|
+
## Omitted here to avoid conflicts with different deployment scenarios.
|
|
6
|
+
# http:
|
|
7
|
+
# port: 19926
|
|
6
8
|
|
|
7
9
|
graphqlSchema:
|
|
8
10
|
files: schemas/*.graphql
|