@tpsdev-ai/flair 0.3.0 → 0.3.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.
Files changed (2) hide show
  1. package/dist/cli.js +13 -1
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -42,7 +42,19 @@ function b64url(bytes) {
42
42
  return Buffer.from(bytes).toString("base64url");
43
43
  }
44
44
  async function api(method, path, body) {
45
- const base = process.env.FLAIR_URL || "http://127.0.0.1:9926";
45
+ // Resolve port: FLAIR_URL env > ~/.flair/config.yaml > default 9926
46
+ let defaultUrl = "http://127.0.0.1:9926";
47
+ try {
48
+ const configPath = join(homedir(), ".flair", "config.yaml");
49
+ if (existsSync(configPath)) {
50
+ const yaml = readFileSync(configPath, "utf-8");
51
+ const portMatch = yaml.match(/port:\s*(\d+)/);
52
+ if (portMatch)
53
+ defaultUrl = `http://127.0.0.1:${portMatch[1]}`;
54
+ }
55
+ }
56
+ catch { /* ignore config read errors */ }
57
+ const base = process.env.FLAIR_URL || defaultUrl;
46
58
  const token = process.env.FLAIR_TOKEN;
47
59
  const res = await fetch(`${base}${path}`, {
48
60
  method,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tpsdev-ai/flair",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Identity, memory, and soul for AI agents. Cryptographic identity (Ed25519), semantic memory with local embeddings, and persistent personality \u2014 all in a single process.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",