@tpsdev-ai/flair 0.5.2 → 0.5.3
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/dist/cli.js +22 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -7,7 +7,28 @@ import { join, resolve as resolvePath } from "node:path";
|
|
|
7
7
|
import { spawn } from "node:child_process";
|
|
8
8
|
import { createPrivateKey, sign as nodeCryptoSign, randomUUID } from "node:crypto";
|
|
9
9
|
import { keystore } from "./keystore.js";
|
|
10
|
-
|
|
10
|
+
// Federation crypto helpers — inlined to avoid cross-boundary imports from
|
|
11
|
+
// src/ into resources/, which don't survive npm packaging (see also
|
|
12
|
+
// resources/federation-crypto.ts; the two must stay in sync).
|
|
13
|
+
function sortKeys(val) {
|
|
14
|
+
if (val === null || val === undefined || typeof val !== "object")
|
|
15
|
+
return val;
|
|
16
|
+
if (Array.isArray(val))
|
|
17
|
+
return val.map(sortKeys);
|
|
18
|
+
const sorted = {};
|
|
19
|
+
for (const key of Object.keys(val).sort()) {
|
|
20
|
+
sorted[key] = sortKeys(val[key]);
|
|
21
|
+
}
|
|
22
|
+
return sorted;
|
|
23
|
+
}
|
|
24
|
+
function canonicalize(obj) {
|
|
25
|
+
return JSON.stringify(sortKeys(obj));
|
|
26
|
+
}
|
|
27
|
+
function signBody(body, secretKey) {
|
|
28
|
+
const message = new TextEncoder().encode(canonicalize(body));
|
|
29
|
+
const sig = nacl.sign.detached(message, secretKey);
|
|
30
|
+
return Buffer.from(sig).toString("base64url");
|
|
31
|
+
}
|
|
11
32
|
// ─── Defaults ────────────────────────────────────────────────────────────────
|
|
12
33
|
const DEFAULT_PORT = 19926;
|
|
13
34
|
const DEFAULT_OPS_PORT = 19925;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tpsdev-ai/flair",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3",
|
|
4
4
|
"description": "Identity, memory, and soul for AI agents. Cryptographic identity (Ed25519), semantic memory with local embeddings, and persistent personality — all in a single process.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|