@tpsdev-ai/flair 0.52.0 → 0.54.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 (99) hide show
  1. package/README.md +4 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli.js +1914 -15328
  4. package/dist/commands/agent.js +453 -0
  5. package/dist/commands/attention.js +121 -0
  6. package/dist/commands/backup.js +115 -0
  7. package/dist/commands/bootstrap.js +91 -0
  8. package/dist/commands/bridge.js +608 -0
  9. package/dist/commands/deploy.js +180 -0
  10. package/dist/commands/doctor.js +1654 -0
  11. package/dist/commands/export.js +110 -0
  12. package/dist/commands/federation.js +1575 -0
  13. package/dist/commands/fleet.js +73 -0
  14. package/dist/commands/grant.js +109 -0
  15. package/dist/commands/hook.js +193 -0
  16. package/dist/commands/idp.js +193 -0
  17. package/dist/commands/import.js +134 -0
  18. package/dist/commands/init.js +1203 -0
  19. package/dist/commands/inspect.js +45 -0
  20. package/dist/commands/keys.js +187 -0
  21. package/dist/commands/mcp.js +707 -0
  22. package/dist/commands/memory.js +501 -0
  23. package/dist/commands/migrate-harness-memory.js +270 -0
  24. package/dist/commands/orgevent.js +138 -0
  25. package/dist/commands/presence.js +76 -0
  26. package/dist/commands/principal.js +338 -0
  27. package/dist/commands/quality.js +1164 -0
  28. package/dist/commands/reembed.js +296 -0
  29. package/dist/commands/relationship.js +76 -0
  30. package/dist/commands/rem.js +1048 -0
  31. package/dist/commands/restore.js +130 -0
  32. package/dist/commands/search.js +244 -0
  33. package/dist/commands/service.js +315 -0
  34. package/dist/commands/session.js +184 -0
  35. package/dist/commands/soul.js +155 -0
  36. package/dist/commands/status.js +914 -0
  37. package/dist/commands/test.js +93 -0
  38. package/dist/commands/uninstall.js +143 -0
  39. package/dist/commands/upgrade.js +1592 -0
  40. package/dist/commands/workspace.js +114 -0
  41. package/dist/deploy.js +24 -0
  42. package/dist/fabric-npm-install.js +87 -0
  43. package/dist/federation-verify.js +498 -0
  44. package/dist/fleet-verify.js +144 -21
  45. package/dist/install/clients.js +167 -0
  46. package/dist/lib/auth-resolve.js +76 -1
  47. package/dist/lib/daemon-liveness.js +131 -2
  48. package/dist/lib/doctor-config-path.js +61 -0
  49. package/dist/lib/doctor-federation-driver.js +189 -0
  50. package/dist/lib/doctor-run.js +40 -0
  51. package/dist/lib/entity-vocab-cli.js +3 -3
  52. package/dist/lib/federation-pair-identity.js +47 -0
  53. package/dist/lib/launchd-repair.js +199 -0
  54. package/dist/lib/ops-api-bind.js +115 -0
  55. package/dist/lib/owned-pins.js +219 -0
  56. package/dist/lib/stabilize-mqtt-network.js +123 -0
  57. package/dist/lib/uninstall-purge.js +218 -0
  58. package/dist/rem/restore.js +8 -10
  59. package/dist/resources/AgentReadPosition.js +74 -0
  60. package/dist/resources/Federation.js +8 -2
  61. package/dist/resources/Memory.js +4 -3
  62. package/dist/resources/MemoryBootstrap.js +41 -25
  63. package/dist/resources/MemoryCandidate.js +5 -6
  64. package/dist/resources/OrgEventCatchup.js +126 -47
  65. package/dist/resources/agent-read-position-lib.js +83 -0
  66. package/dist/resources/agent-read-position.js +120 -0
  67. package/dist/resources/embeddings-boot.js +32 -0
  68. package/dist/resources/federation-peer-liveness.js +73 -0
  69. package/dist/resources/health.js +68 -19
  70. package/dist/resources/mcp-tools.js +43 -279
  71. package/dist/resources/memory-visibility.js +3 -3
  72. package/dist/resources/migration-boot.js +59 -18
  73. package/dist/resources/migrations/embedding-stamp.js +20 -1
  74. package/dist/resources/migrations/recheck.js +43 -0
  75. package/dist/resources/migrations/runner.js +6 -1
  76. package/dist/resources/migrations/stamp-outstanding.js +171 -0
  77. package/dist/resources/migrations/visibility-backfill.js +2 -2
  78. package/dist/resources/org-event-catchup-lib.js +47 -0
  79. package/dist/resources/record-owner-guard.js +1 -0
  80. package/dist/stamp-migration-verify.js +163 -0
  81. package/dist/stamp-outstanding.js +144 -0
  82. package/docs/api-reference.md +4 -2
  83. package/docs/deploying-on-fabric.md +11 -10
  84. package/docs/deployment.md +3 -1
  85. package/docs/federation.md +19 -0
  86. package/docs/hosted-on-fabric.md +3 -3
  87. package/docs/quickstart.md +2 -1
  88. package/docs/releasing.md +15 -7
  89. package/docs/spoke-bringup.md +10 -5
  90. package/docs/standalone-local.md +3 -1
  91. package/docs/upgrade.md +25 -6
  92. package/node_modules/@tpsdev-ai/flair-tool-descriptors/LICENSE +19 -0
  93. package/node_modules/@tpsdev-ai/flair-tool-descriptors/README.md +22 -0
  94. package/node_modules/@tpsdev-ai/flair-tool-descriptors/dist/index.d.ts +70 -0
  95. package/node_modules/@tpsdev-ai/flair-tool-descriptors/dist/index.js +665 -0
  96. package/node_modules/@tpsdev-ai/flair-tool-descriptors/package.json +46 -0
  97. package/package.json +9 -4
  98. package/schemas/agent.graphql +15 -0
  99. package/templates/launchd/start-flair-with-admin-pass.sh +73 -0
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "@tpsdev-ai/flair-tool-descriptors",
3
+ "version": "0.54.1",
4
+ "description": "Transport-agnostic MCP tool descriptors for Flair — name, description, inputSchema, output shape. No Harper, no FlairClient.",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist/",
16
+ "LICENSE",
17
+ "README.md"
18
+ ],
19
+ "scripts": {
20
+ "build": "tsc --noCheck",
21
+ "test": "bun test",
22
+ "prepublishOnly": "npm run build"
23
+ },
24
+ "publishConfig": {
25
+ "access": "public"
26
+ },
27
+ "engines": {
28
+ "node": ">=18"
29
+ },
30
+ "license": "Apache-2.0",
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "git+https://github.com/tpsdev-ai/flair.git",
34
+ "directory": "packages/flair-tool-descriptors"
35
+ },
36
+ "homepage": "https://tps.dev/#flair",
37
+ "keywords": [
38
+ "flair",
39
+ "mcp",
40
+ "tools",
41
+ "descriptors"
42
+ ],
43
+ "devDependencies": {
44
+ "typescript": "5.9.3"
45
+ }
46
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tpsdev-ai/flair",
3
- "version": "0.52.0",
3
+ "version": "0.54.1",
4
4
  "packageManager": "bun@1.3.10",
5
5
  "description": "Identity, memory, and soul for AI agents. Cryptographic identity (Ed25519), semantic memory with local embeddings, and persistent personality — all in a single process.",
6
6
  "type": "module",
@@ -46,9 +46,10 @@
46
46
  ],
47
47
  "scripts": {
48
48
  "clean": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\"",
49
- "prebuild": "npm run clean",
49
+ "prebuild": "npm run clean && cd packages/flair-tool-descriptors && npm run build",
50
50
  "build": "tsc -p tsconfig.json --noCheck && node scripts/write-build-info.mjs",
51
51
  "build:cli": "tsc -p tsconfig.cli.json --noCheck && node scripts/write-build-info.mjs",
52
+ "prepack": "node scripts/materialize-bundled-descriptors.mjs",
52
53
  "prepublishOnly": "npm run build && npm run build:cli",
53
54
  "test": "bun run test:unit",
54
55
  "test:unit": "bun scripts/test-unit.ts",
@@ -71,8 +72,12 @@
71
72
  "jose": "6.2.2",
72
73
  "js-yaml": "^4.3.2",
73
74
  "tar": "^7.5.22",
74
- "tweetnacl": "1.0.3"
75
+ "tweetnacl": "1.0.3",
76
+ "@tpsdev-ai/flair-tool-descriptors": "0.54.1"
75
77
  },
78
+ "bundleDependencies": [
79
+ "@tpsdev-ai/flair-tool-descriptors"
80
+ ],
76
81
  "overrides": {
77
82
  "react-native-fs": "npm:empty-npm-package@1.0.0",
78
83
  "brace-expansion": "^5.0.9",
@@ -80,7 +85,7 @@
80
85
  "fast-uri": "^4.1.3",
81
86
  "hono": "^4.13.5",
82
87
  "js-yaml": "^4.3.2",
83
- "adm-zip": "^0.6.0",
88
+ "adm-zip": "^0.6.1",
84
89
  "@opentelemetry/core": "^2.8.0",
85
90
  "uuid": "^11.1.1",
86
91
  "tar": "^7.5.22",
@@ -76,3 +76,18 @@ type Integration @table(database: "flair") @export {
76
76
  createdAt: String!
77
77
  updatedAt: String
78
78
  }
79
+
80
+ # Per-agent read-position (watermark) — durable catch-up cursor (flair#931).
81
+ # A monotonic position per (agent, stream), not a wall-clock `since`. Reused
82
+ # by OrgEventCatchup today and the light-comms board later (#1583); the stream
83
+ # name is the only table-specific part. Not @export: agents use
84
+ # /AgentReadPosition and /OrgEventCatchup, never raw-table REST. Owner-scoped
85
+ # (each agent reads/advances only its own). Advance-on-ack, never silently
86
+ # truncated. See resources/agent-read-position-lib.ts.
87
+ type AgentReadPosition @table(database: "flair") {
88
+ id: ID @primaryKey # `${agentId}:${stream}`
89
+ agentId: String! @indexed
90
+ stream: String! @indexed # e.g. "org-event"
91
+ position: String! # opaque total-order watermark; lexicographic compare
92
+ updatedAt: String!
93
+ }
@@ -0,0 +1,73 @@
1
+ #!/bin/sh
2
+ # start-flair-with-admin-pass.sh — product-owned launchd launcher (flair#1573).
3
+ #
4
+ # Reads the Flair admin password from a 0600 file and execs Harper
5
+ # NON-INTERACTIVELY. The secret never appears in the launchd plist: it enters
6
+ # the process environment here, from the file, at start time. This is the
7
+ # product shape of the no-inline-secret pattern — the plist's ProgramArguments
8
+ # point at this launcher instead of embedding HDB_ADMIN_PASSWORD.
9
+ #
10
+ # Usage: start-flair-with-admin-pass.sh <admin-pass-file> <node> <harper-bin>
11
+ #
12
+ # admin-pass-file path to the 0600 file holding the admin password
13
+ # node the node binary to exec
14
+ # harper-bin Harper's entrypoint (harper.js)
15
+ #
16
+ # HDB_ADMIN_USERNAME is already in the launchd environment (it is not a
17
+ # secret); only the password is read from the file here. HOME, PATH and the
18
+ # Harper config (HARPER_SET_CONFIG / ROOTPATH / FLAIR_MODELS_DIR) are also
19
+ # supplied by the plist's EnvironmentVariables, so Harper boots without ever
20
+ # hitting its interactive readline prompt under launchd's minimal env.
21
+
22
+ set -eu
23
+
24
+ ADMIN_PASS_FILE="$1"
25
+ NODE="$2"
26
+ HARPER_BIN="$3"
27
+
28
+ if [ ! -f "$ADMIN_PASS_FILE" ]; then
29
+ echo "start-flair-with-admin-pass: admin-pass file not found: $ADMIN_PASS_FILE" >&2
30
+ exit 1
31
+ fi
32
+
33
+ if [ ! -r "$ADMIN_PASS_FILE" ]; then
34
+ echo "start-flair-with-admin-pass: admin-pass file not readable: $ADMIN_PASS_FILE" >&2
35
+ exit 1
36
+ fi
37
+
38
+ # Re-verify owner-only (0600) at READ time, not just at `flair init` write
39
+ # time. A file that drifted to 0644 after init (umask change, backup tool,
40
+ # tar restore) would leak the secret to any reader on the host. Mirrors
41
+ # readSecretFileSecure (src/lib/auth-resolve.ts), which refuses any group/other
42
+ # permission bit. `stat -f %Lp` is macOS (the launchd host); `stat -c %a` is
43
+ # Linux (the unit-test host). The two syntaxes are mutually exclusive, so
44
+ # branch on the OS rather than chaining with `||` — on Linux `stat -f %Lp`
45
+ # prints filesystem info to stdout *and* exits non-zero, which would pollute
46
+ # the captured mode. Fail CLOSED: an unreadable mode (empty) refuses rather
47
+ # than proceeding on a guess.
48
+ case "$(uname -s)" in
49
+ Darwin) MODE="$(stat -f %Lp "$ADMIN_PASS_FILE" 2>/dev/null)" ;;
50
+ *) MODE="$(stat -c %a "$ADMIN_PASS_FILE" 2>/dev/null)" ;;
51
+ esac
52
+ case "$MODE" in
53
+ *00) : ;;
54
+ *)
55
+ echo "start-flair-with-admin-pass: admin-pass file permissions '${MODE:-unknown}' are too open (expected 600): $ADMIN_PASS_FILE" >&2
56
+ exit 1
57
+ ;;
58
+ esac
59
+
60
+ # Read the secret. Command substitution strips a trailing newline, which is
61
+ # what `flair init` writes (base64url + "\n"); the value itself is preserved
62
+ # verbatim by the double quotes.
63
+ ADMIN_PASS="$(cat "$ADMIN_PASS_FILE")"
64
+ if [ -z "$ADMIN_PASS" ]; then
65
+ echo "start-flair-with-admin-pass: admin-pass file is empty: $ADMIN_PASS_FILE" >&2
66
+ exit 1
67
+ fi
68
+
69
+ export HDB_ADMIN_PASSWORD="$ADMIN_PASS"
70
+
71
+ # exec (not spawn) so launchd tracks Harper itself — the job's PID is Harper's
72
+ # PID, and KeepAlive restarts the real service rather than a dead launcher.
73
+ exec "$NODE" "$HARPER_BIN" run .