@tpsdev-ai/flair 0.3.19 → 0.4.1
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 +19 -6
- package/config.yaml +4 -2
- package/dist/cli.js +567 -60
- 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 -2
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.
|
|
@@ -163,7 +169,7 @@ npm install @tpsdev-ai/flair-client
|
|
|
163
169
|
import { FlairClient } from '@tpsdev-ai/flair-client'
|
|
164
170
|
|
|
165
171
|
const flair = new FlairClient({
|
|
166
|
-
url: 'http://localhost:
|
|
172
|
+
url: 'http://localhost:19926', // or remote: https://flair.example.com
|
|
167
173
|
agentId: 'mybot',
|
|
168
174
|
// key auto-resolved from ~/.flair/keys/mybot.key
|
|
169
175
|
})
|
|
@@ -190,17 +196,17 @@ Flair is a pure HTTP API. Use it from Python, Go, Rust, shell scripts — anythi
|
|
|
190
196
|
```bash
|
|
191
197
|
# Search memories
|
|
192
198
|
curl -H "Authorization: TPS-Ed25519 mybot:$TS:$NONCE:$SIG" \
|
|
193
|
-
-X POST http://localhost:
|
|
199
|
+
-X POST http://localhost:19926/SemanticSearch \
|
|
194
200
|
-d '{"agentId": "mybot", "q": "deployment procedure", "limit": 5}'
|
|
195
201
|
|
|
196
202
|
# Write a memory
|
|
197
203
|
curl -H "Authorization: TPS-Ed25519 mybot:$TS:$NONCE:$SIG" \
|
|
198
|
-
-X PUT http://localhost:
|
|
204
|
+
-X PUT http://localhost:19926/Memory/mybot-123 \
|
|
199
205
|
-d '{"id": "mybot-123", "agentId": "mybot", "content": "...", "durability": "standard"}'
|
|
200
206
|
|
|
201
207
|
# Bootstrap (soul + recent memories)
|
|
202
208
|
curl -H "Authorization: TPS-Ed25519 mybot:$TS:$NONCE:$SIG" \
|
|
203
|
-
-X POST http://localhost:
|
|
209
|
+
-X POST http://localhost:19926/BootstrapMemories \
|
|
204
210
|
-d '{"agentId": "mybot", "maxTokens": 4000}'
|
|
205
211
|
```
|
|
206
212
|
|
|
@@ -245,15 +251,22 @@ flair init
|
|
|
245
251
|
|
|
246
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.
|
|
247
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
|
+
|
|
248
261
|
### Remote Server
|
|
249
262
|
|
|
250
263
|
Run Flair on a VPS or cloud instance. Agents connect over HTTPS:
|
|
251
264
|
|
|
252
265
|
```bash
|
|
253
266
|
# On the server
|
|
254
|
-
flair init --port
|
|
267
|
+
flair init --port 19926
|
|
255
268
|
# Agents connect with:
|
|
256
|
-
FLAIR_URL=https://your-server:
|
|
269
|
+
FLAIR_URL=https://your-server:19926 flair agent add mybot
|
|
257
270
|
```
|
|
258
271
|
|
|
259
272
|
Good for teams with multiple machines or always-on agents.
|
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
|