@tpsdev-ai/flair 0.59.0 → 0.63.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 +10 -10
- package/SECURITY.md +49 -5
- package/config.yaml +23 -12
- package/dist/bridges/builtins/mem0.js +63 -28
- package/dist/bridges/runtime/execute.js +1 -0
- package/dist/bridges/runtime/import-runner.js +12 -0
- package/dist/bridges/runtime/load-plugin.js +42 -13
- package/dist/bridges/runtime/yaml-loader.js +4 -2
- package/dist/bridges/types.js +1 -0
- package/dist/build-info.json +3 -3
- package/dist/cli.js +1054 -367
- package/dist/commands/agent.js +233 -90
- package/dist/commands/attention.js +4 -3
- package/dist/commands/backup-approval.js +218 -0
- package/dist/commands/backup.js +211 -39
- package/dist/commands/bootstrap.js +3 -1
- package/dist/commands/bridge.js +172 -119
- package/dist/commands/deploy.js +71 -8
- package/dist/commands/doctor.js +711 -146
- package/dist/commands/export.js +57 -23
- package/dist/commands/federation.js +787 -82
- package/dist/commands/grant.js +5 -6
- package/dist/commands/help.js +25 -0
- package/dist/commands/hook.js +155 -2
- package/dist/commands/idp.js +27 -19
- package/dist/commands/import.js +136 -20
- package/dist/commands/init.js +469 -200
- package/dist/commands/integrity.js +387 -0
- package/dist/commands/keys.js +247 -58
- package/dist/commands/mcp.js +108 -52
- package/dist/commands/memory.js +203 -35
- package/dist/commands/migrate-harness-memory.js +3 -2
- package/dist/commands/orgevent.js +51 -47
- package/dist/commands/presence.js +4 -3
- package/dist/commands/principal.js +428 -62
- package/dist/commands/quality.js +13 -1
- package/dist/commands/reembed.js +141 -17
- package/dist/commands/relationship.js +2 -1
- package/dist/commands/rem.js +537 -80
- package/dist/commands/restore.js +413 -65
- package/dist/commands/search.js +6 -4
- package/dist/commands/service.js +235 -40
- package/dist/commands/soul.js +4 -9
- package/dist/commands/status.js +94 -38
- package/dist/commands/test.js +7 -3
- package/dist/commands/upgrade.js +77 -23
- package/dist/commands/workspace.js +13 -11
- package/dist/component-env.js +31 -41
- package/dist/deploy.js +136 -4
- package/dist/doctor-client.js +534 -92
- package/dist/engine-version-contract.js +1 -0
- package/dist/engine-version.js +23 -3
- package/dist/fabric-upgrade.js +12 -2
- package/dist/federation/presence-send.js +139 -0
- package/dist/federation-verify.js +273 -180
- package/dist/hook-install.js +670 -6
- package/dist/install/clients.js +171 -35
- package/dist/keystore.js +72 -0
- package/dist/lib/action-recall-runtime.js +328 -0
- package/dist/lib/agent-home-fields.js +132 -0
- package/dist/lib/agent-home.js +427 -0
- package/dist/lib/agent-id-rule.js +88 -0
- package/dist/lib/agent-roster.js +33 -0
- package/dist/lib/atomic-write.js +1 -1
- package/dist/lib/auth-resolve.js +1069 -60
- package/dist/lib/backup-approval-store.js +612 -0
- package/dist/lib/backup-artifact.js +343 -0
- package/dist/lib/capture-runtime.js +124 -0
- package/dist/lib/config-critical-section.js +212 -25
- package/dist/lib/connect-phase.js +33 -0
- package/dist/lib/credential-status-rule.js +78 -0
- package/dist/lib/daemon-liveness.js +43 -11
- package/dist/lib/doctor-run.js +75 -37
- package/dist/lib/durability-copy.js +10 -0
- package/dist/lib/embedding-space-doctor.js +75 -0
- package/dist/lib/federation-pair-access.js +4 -0
- package/dist/lib/federation-retry-queue.js +283 -0
- package/dist/lib/federation-retry-row.js +101 -0
- package/dist/lib/flair-agent-role.js +4 -0
- package/dist/lib/hub-url.js +12 -0
- package/dist/lib/init-admin-pass.js +88 -12
- package/dist/lib/init-listener-environ.js +1 -2
- package/dist/lib/init-occupied-listener.js +15 -111
- package/dist/lib/init-spawn-attribution.js +73 -0
- package/dist/lib/init-tcp-probe.js +33 -0
- package/dist/lib/instance-identity-row.js +20 -0
- package/dist/lib/instruction-event-contract.js +17 -0
- package/dist/lib/instruction-event-doctor.js +102 -0
- package/dist/lib/launchd-management.js +38 -3
- package/dist/lib/listener-table.js +268 -0
- package/dist/lib/local-delete-instance.js +27 -0
- package/dist/lib/local-instance-pair.js +256 -0
- package/dist/lib/mcp-enable.js +1182 -341
- package/dist/lib/mcp-oauth-env-core.js +133 -0
- package/dist/lib/mcp-oauth-env.js +125 -0
- package/dist/lib/mcp-spec.js +17 -1
- package/dist/lib/memory-attributes.js +4 -0
- package/dist/lib/memory-id-policy.js +46 -0
- package/dist/lib/memory-integrity.js +309 -0
- package/dist/lib/memory-provider-timeout.js +33 -0
- package/dist/lib/memory-purge-response.js +20 -0
- package/dist/lib/mqtt-config.js +132 -0
- package/dist/lib/mqtt-listener-doctor.js +104 -0
- package/dist/lib/open-live-row.js +20 -0
- package/dist/lib/ops-table-count.js +25 -0
- package/dist/lib/ops-url.js +52 -0
- package/dist/lib/owned-pins.js +67 -10
- package/dist/lib/peer-status.js +27 -0
- package/dist/lib/principal-status.js +29 -0
- package/dist/lib/process-start-time.js +76 -12
- package/dist/lib/promotion-content-hash.js +20 -0
- package/dist/lib/proto-safe-record.js +42 -0
- package/dist/lib/record-id-path.js +25 -0
- package/dist/lib/reembed-server-support.js +66 -0
- package/dist/lib/restore-archive.js +760 -0
- package/dist/lib/restore-verify.js +104 -0
- package/dist/lib/scheduler-platform.js +10 -6
- package/dist/lib/secret-keys.js +25 -0
- package/dist/lib/secrets-push.js +50 -22
- package/dist/lib/skill-assignment-preflight.js +159 -0
- package/dist/lib/skill-seed-pending.js +24 -0
- package/dist/lib/skill-seed.js +448 -0
- package/dist/lib/skill-tombstone-doctor.js +133 -0
- package/dist/lib/soul-scope-fields.js +26 -0
- package/dist/lib/stop-start-recovery.js +54 -0
- package/dist/lib/uninstall-purge.js +266 -11
- package/dist/lib/upgrade-prior-liveness.js +2 -1
- package/dist/lib/using-flair-skill.js +87 -0
- package/dist/mcp-client-assertion.js +114 -14
- package/dist/memory-id-checkpoint.js +347 -0
- package/dist/memory-node-compare.js +207 -0
- package/dist/mqtt-off-deploy.js +550 -0
- package/dist/packages/flair-mcp/src/secret-redaction.js +113 -0
- package/dist/rem/promote-policy.js +3 -3
- package/dist/rem/restore.js +303 -26
- package/dist/rem/runner.js +317 -96
- package/dist/rem/scheduler.js +21 -4
- package/dist/resources/A2AAdapter.js +131 -178
- package/dist/resources/AdminMemory.js +2 -0
- package/dist/resources/AdminMemoryCandidates.js +116 -0
- package/dist/resources/Agent.js +463 -33
- package/dist/resources/AgentCard.js +4 -0
- package/dist/resources/AgentKeyRegister.js +248 -0
- package/dist/resources/AgentKeyRegistration.js +28 -0
- package/dist/resources/AgentReadPosition.js +7 -0
- package/dist/resources/AgentSeed.js +238 -107
- package/dist/resources/AutoPromoteCandidates.js +413 -78
- package/dist/resources/Credential.js +183 -10
- package/dist/resources/Federation.js +915 -145
- package/dist/resources/FederationRetry.js +140 -0
- package/dist/resources/InstructionVersion.js +220 -0
- package/dist/resources/Integration.js +300 -25
- package/dist/resources/MCPClientMetadata.js +6 -3
- package/dist/resources/Memory.js +3300 -758
- package/dist/resources/MemoryArchive.js +171 -53
- package/dist/resources/MemoryBootstrap.js +122 -61
- package/dist/resources/MemoryCandidate.js +37 -3
- package/dist/resources/MemoryConsolidate.js +2 -2
- package/dist/resources/MemoryDedupStats.js +30 -1
- package/dist/resources/MemoryFeed.js +545 -50
- package/dist/resources/MemoryGrant.js +21 -1
- package/dist/resources/MemoryMaintenance.js +368 -46
- package/dist/resources/MemoryPurge.js +348 -0
- package/dist/resources/MemoryReflect.js +71 -12
- package/dist/resources/MemoryReindex.js +111 -17
- package/dist/resources/Message.js +16 -5
- package/dist/resources/OAuth.js +342 -48
- package/dist/resources/OAuthClient.js +1 -1
- package/dist/resources/OrgEvent.js +405 -19
- package/dist/resources/OrgEventCatchup.js +7 -0
- package/dist/resources/OrgEventMaintenance.js +48 -10
- package/dist/resources/PairingToken.js +1 -1
- package/dist/resources/Presence.js +166 -51
- package/dist/resources/PromoteMemoryCandidate.js +24 -7
- package/dist/resources/RecordUsage.js +2 -4
- package/dist/resources/Relationship.js +23 -0
- package/dist/resources/SemanticSearch.js +63 -32
- package/dist/resources/Soul.js +191 -76
- package/dist/resources/SoulFeed.js +2 -1
- package/dist/resources/TeamDirectory.js +35 -0
- package/dist/resources/WorkspaceLatest.js +4 -0
- package/dist/resources/WorkspaceState.js +21 -1
- package/dist/resources/XAA.js +207 -63
- package/dist/resources/a2a-stream.js +313 -0
- package/dist/resources/a2a-url.js +4 -5
- package/dist/resources/agent-admin.js +10 -1
- package/dist/resources/agent-auth.js +138 -83
- package/dist/resources/agent-read-position-lib.js +4 -1
- package/dist/resources/agent-status-guard.js +9 -7
- package/dist/resources/auth-middleware.js +534 -171
- package/dist/resources/authority-field-guard.js +9 -11
- package/dist/resources/auto-promote-lib.js +8 -5
- package/dist/resources/basic-auth-header.js +21 -0
- package/dist/resources/bm25-index-service.js +4 -5
- package/dist/resources/dedup-cluster.js +6 -1
- package/dist/resources/ed25519-auth.js +1 -1
- package/dist/resources/embedding-space-guard.js +366 -72
- package/dist/resources/embeddings-provider.js +25 -0
- package/dist/resources/engine-version-stamp-boot.js +53 -0
- package/dist/resources/federation-classify.js +161 -0
- package/dist/resources/federation-crypto.js +5 -5
- package/dist/resources/federation-retry-lib.js +60 -0
- package/dist/resources/grant-visibility.js +135 -0
- package/dist/resources/harper-routing.js +83 -0
- package/dist/resources/health.js +163 -22
- package/dist/resources/host-pointer/registry.js +29 -0
- package/dist/resources/host-pointer-adapter.js +1 -0
- package/dist/resources/host-source-citation.js +49 -0
- package/dist/resources/host-source-visibility.js +7 -6
- package/dist/resources/in-process.js +24 -22
- package/dist/resources/instance-create-lock.js +17 -0
- package/dist/resources/instance-identity.js +23 -0
- package/dist/resources/instruction-version-record.js +587 -0
- package/dist/resources/internal-authority.js +13 -0
- package/dist/resources/key-lock.js +3 -3
- package/dist/resources/mcp-handler.js +141 -19
- package/dist/resources/mcp-oauth-env-guard.js +36 -0
- package/dist/resources/mcp-oauth-flag.js +12 -14
- package/dist/resources/mcp-oauth.js +450 -56
- package/dist/resources/mcp-tool-arguments.js +4 -6
- package/dist/resources/mcp-tools.js +187 -40
- package/dist/resources/memory-bootstrap-lib.js +5 -15
- package/dist/resources/memory-declared-attributes.js +4 -1
- package/dist/resources/memory-deletion-history.js +55 -0
- package/dist/resources/memory-durability.js +54 -0
- package/dist/resources/memory-embed-hash.js +144 -0
- package/dist/resources/memory-embedding-value.js +8 -0
- package/dist/resources/memory-host-source.js +32 -7
- package/dist/resources/memory-id-guard.js +75 -0
- package/dist/resources/memory-redaction.js +236 -0
- package/dist/resources/memory-reflect-lib.js +1 -1
- package/dist/resources/memory-supplied-vector.js +72 -0
- package/dist/resources/memory-write-lock.js +489 -0
- package/dist/resources/memory-write-response.js +139 -0
- package/dist/resources/memory-write-transaction.js +243 -0
- package/dist/resources/migration-boot.js +17 -12
- package/dist/resources/migrations/boot-progress.js +25 -0
- package/dist/resources/migrations/data-dir.js +90 -19
- package/dist/resources/migrations/dir-safety.js +61 -3
- package/dist/resources/migrations/embedding-stamp.js +462 -82
- package/dist/resources/migrations/export.js +1 -0
- package/dist/resources/migrations/graph-heal.js +27 -27
- package/dist/resources/migrations/ledger.js +5 -2
- package/dist/resources/migrations/lock.js +870 -77
- package/dist/resources/migrations/progress.js +71 -10
- package/dist/resources/migrations/runner.js +212 -18
- package/dist/resources/migrations/snapshot.js +1 -0
- package/dist/resources/migrations/source-fields.js +5 -5
- package/dist/resources/migrations/state.js +36 -1
- package/dist/resources/migrations/status.js +2 -13
- package/dist/resources/migrations/synthetic-test-migration.js +81 -12
- package/dist/resources/migrations/types.js +26 -1
- package/dist/resources/migrations/visibility-backfill.js +113 -72
- package/dist/resources/oauth-discovery.js +0 -5
- package/dist/resources/object-body-guard.js +40 -0
- package/dist/resources/org-event-created-at.js +133 -0
- package/dist/resources/org-event-reserved.js +92 -0
- package/dist/resources/org-event-write-fault.js +19 -0
- package/dist/resources/originator-instance.js +39 -7
- package/dist/resources/owner-delete-recheck.js +78 -0
- package/dist/resources/owner-field-guard.js +39 -5
- package/dist/resources/owner-scoped-write-policy.js +256 -0
- package/dist/resources/owner-scoped-writes.js +89 -0
- package/dist/resources/path-id-rewrite.js +76 -0
- package/dist/resources/presence-internal.js +5 -5
- package/dist/resources/presence-receipt.js +236 -0
- package/dist/resources/promotion-binding.js +43 -0
- package/dist/resources/promotion-stamp.js +143 -17
- package/dist/resources/protocol-context.js +189 -0
- package/dist/resources/record-owner-guard.js +74 -26
- package/dist/resources/record-type-kit.js +2 -4
- package/dist/resources/record-types.js +1 -1
- package/dist/resources/relay-ops.js +78 -6
- package/dist/resources/replay-store.js +96 -19
- package/dist/resources/request-target.js +163 -0
- package/dist/resources/request-transaction.js +46 -1
- package/dist/resources/search-readiness.js +4 -1
- package/dist/resources/seed-ids.js +9 -0
- package/dist/resources/seed-reservation.js +116 -0
- package/dist/resources/semantic-retrieval-core.js +27 -15
- package/dist/resources/server-row-validation.js +71 -0
- package/dist/resources/skill-manifest.js +24 -14
- package/dist/resources/skill-subject.js +53 -0
- package/dist/resources/skill-version-write.js +789 -0
- package/dist/resources/skill-write-fault.js +20 -0
- package/dist/resources/skill-write-policy.js +68 -0
- package/dist/resources/skill-write.js +67 -7
- package/dist/resources/soul-write-policy.js +26 -7
- package/dist/resources/table-helpers.js +10 -7
- package/dist/resources/table-subscription-policy.js +518 -85
- package/dist/resources/table-subscriptions.js +20 -7
- package/dist/resources/team-directory.js +248 -0
- package/dist/resources/tool-descriptors/index.js +69 -8
- package/dist/resources/txn-pause-point.js +235 -0
- package/dist/resources/usage-recording.js +186 -70
- package/dist/resources/write-back.js +383 -0
- package/dist/resources/write-journal-context.js +5 -0
- package/dist/resources/write-journal.js +289 -0
- package/dist/src/engine-version-contract.js +1 -0
- package/dist/src/keystore.js +72 -0
- package/dist/src/lib/agent-home-fields.js +132 -0
- package/dist/src/lib/agent-id-rule.js +88 -0
- package/dist/src/lib/agent-key-register.js +80 -0
- package/dist/src/lib/atomic-write.js +256 -0
- package/dist/src/lib/credential-status-rule.js +78 -0
- package/dist/src/lib/expired-by-agent.js +37 -0
- package/dist/src/lib/federation-retry-row.js +101 -0
- package/dist/src/lib/flair-agent-role.js +4 -0
- package/dist/src/lib/idp-mapping-rule.js +81 -0
- package/dist/src/lib/instance-identity-row.js +20 -0
- package/dist/src/lib/instruction-event-contract.js +17 -0
- package/dist/src/lib/mcp-oauth-env-core.js +133 -0
- package/dist/src/lib/memory-attributes.js +4 -0
- package/dist/src/lib/memory-id-policy.js +46 -0
- package/dist/src/lib/open-live-row.js +20 -0
- package/dist/src/lib/principal-status.js +29 -0
- package/dist/src/lib/proto-safe-record.js +42 -0
- package/dist/src/lib/reembed-server-support.js +66 -0
- package/dist/src/lib/scheduler-platform.js +10 -6
- package/dist/src/lib/soul-scope-fields.js +26 -0
- package/dist/src/lib/systemd-agent-id.js +38 -0
- package/dist/src/rem/promote-policy.js +3 -3
- package/dist/src/rem/scheduler.js +21 -4
- package/docs/access-control.md +164 -54
- package/docs/api-reference.md +165 -32
- package/docs/auth.md +46 -30
- package/docs/bridges.md +11 -0
- package/docs/claude-code.md +37 -7
- package/docs/deploying-on-fabric.md +178 -0
- package/docs/deployment.md +19 -0
- package/docs/embedding-in-a-harper-app.md +17 -15
- package/docs/entity-vocabulary.md +3 -6
- package/docs/federation.md +61 -3
- package/docs/hosted-on-fabric.md +43 -36
- package/docs/integrations.md +14 -14
- package/docs/mcp-clients.md +12 -7
- package/docs/n8n.md +17 -11
- package/docs/notes/mcp-agent-auth-consumer.md +16 -13
- package/docs/notes/mcp-oauth-model2.md +40 -11
- package/docs/openclaw.md +1 -1
- package/docs/quickstart-fabric.md +4 -4
- package/docs/quickstart.md +12 -4
- package/docs/releasing.md +25 -19
- package/docs/rem.md +32 -3
- package/docs/secrets-and-keys.md +21 -4
- package/docs/standalone-local.md +30 -2
- package/docs/supply-chain-policy.md +34 -16
- package/docs/the-team.md +2 -2
- package/docs/upgrade.md +46 -6
- package/package.json +24 -12
- package/schemas/agent-key-registration.graphql +22 -0
- package/schemas/agent.graphql +6 -3
- package/schemas/federation.graphql +41 -1
- package/schemas/memory.graphql +91 -7
- package/schemas/oauth.graphql +19 -0
- package/schemas/schema.graphql +2 -0
- package/templates/bin/flair-rem-nightly.sh.tmpl +7 -1
- package/templates/launchd/start-flair-with-admin-pass.sh +188 -10
- package/dist/resources/soul-adk-guard.js +0 -68
package/docs/hosted-on-fabric.md
CHANGED
|
@@ -41,11 +41,11 @@ flair init --target https://<cluster>.<org>.harperfabric.com \
|
|
|
41
41
|
- `--remote` marks it a federation **hub** and creates the `flair_pair_initiator` role; without it, pairing later fails role-not-found.
|
|
42
42
|
- Generated admin password lands in `~/.tps/secrets/flair-fabric-hdb` (mode `0600`); `--flair-admin-pass` to choose your own.
|
|
43
43
|
|
|
44
|
-
###
|
|
44
|
+
### Operations endpoint
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
Portless HTTPS targets derive the ops endpoint at `:9925`. <!-- docs-freshness-allow: Fabric ops API port (FABRIC_OPS_PORT), not legacy data port -->
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
Set `FLAIR_OPS_TARGET` to override the derived endpoint, including for `flair backup`.
|
|
49
49
|
|
|
50
50
|
---
|
|
51
51
|
|
|
@@ -59,56 +59,63 @@ On Fabric, configuration goes through the component's environment, not a local `
|
|
|
59
59
|
| `HDB_ADMIN_PASSWORD` | Bootstrap password for the embedded Harper. | Set at install time. |
|
|
60
60
|
| `FLAIR_KEY_PASSPHRASE` | Passphrase for federation key encryption. | Set for production federation deployments. |
|
|
61
61
|
|
|
62
|
-
On Fabric / managed deploys,
|
|
62
|
+
On Fabric / managed deploys, Harper's secrets mechanism can provision environment variables (encrypted at rest with `enc:v1:` storage format). `flair mcp enable` uses a staged-file fallback when the push is unavailable or fails.
|
|
63
63
|
|
|
64
64
|
### How `flair mcp enable` delivers its secrets
|
|
65
65
|
|
|
66
|
-
`flair mcp enable`
|
|
66
|
+
`flair mcp enable` provisions five variables for the target's process, including `FLAIR_MCP_OAUTH`, which is read from `process.env` only, so `set_configuration` cannot deliver it.
|
|
67
|
+
|
|
68
|
+
Use `--fabric` for a non-loopback custom-domain Fabric target.
|
|
67
69
|
|
|
68
70
|
It asks the target what it can do, rather than assuming from the hostname or the version:
|
|
69
71
|
|
|
70
72
|
| The target… | What happens |
|
|
71
73
|
|-------------|--------------|
|
|
72
|
-
|
|
|
73
|
-
|
|
|
74
|
+
| returns a usable env-secrets public key | `enable` attempts a sealed push over the ops API. If the push fails, it reports a staged-file fallback. After confirmation, an already active surface can pass without a restart or re-run; restart if this run changed a secret value. If the surface is inactive, restart the Fabric target after a successful push, or apply the staged values and restart, then re-run with `--confirm-secrets-applied`. |
|
|
75
|
+
| reports no env-secrets public-key operation | the vars are staged to a `0600` file and you apply them yourself, then re-run with `--confirm-secrets-applied` |
|
|
74
76
|
| is unreachable, refuses the probe, or answers unusably | same staged-file fallback, and the output says **which** of those happened |
|
|
75
77
|
|
|
76
|
-
|
|
78
|
+
For an automated push, values are encrypted **before leaving your machine** — AES-256-GCM on the value, RSA-OAEP(SHA-256) wrapping the key, addressed to a public key fetched from the target. Plaintext does not appear in the push request body, and the command's output names variables without showing their values.
|
|
77
79
|
|
|
78
|
-
|
|
80
|
+
At secrets provisioning, `enable` stages the file before any probe or push; dry runs stop earlier. A successful push leaves it unused.
|
|
79
81
|
|
|
80
|
-
> **What the probe does not promise.**
|
|
82
|
+
> **What the probe does not promise.** When successful, it returns a public key for a possible push; it does not prove the push succeeds or that the target process loads the values. `enable` checks the target's MCP token endpoint and public metadata before reporting success. Flair also serves OAuth metadata when the MCP flag is off: the target check distinguishes Flair's `/OAuthToken` from the MCP `/oauth/mcp/token`. An already active surface can pass these checks before newly pushed values are loaded; restart if this run changed a secret value.
|
|
81
83
|
|
|
82
84
|
`--secrets-mechanism <fabric-env-secrets|env-file>` remains an explicit override and skips the probe entirely.
|
|
83
85
|
|
|
84
86
|
### The `mcp.enabled` operator step (Fabric)
|
|
85
87
|
|
|
86
|
-
MCP is **off by default**. The shipped component `config.yaml` contains
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
88
|
+
MCP is **off by default**. The shipped component `config.yaml` contains the `@harperfast/oauth` block
|
|
89
|
+
uncommented with `mcp.enabled: ${FLAIR_MCP_OAUTH}`, a whole-token environment reference
|
|
90
|
+
([flair#1152](https://github.com/tpsdev-ai/flair/issues/1152)), so the on/off choice lives in the
|
|
91
|
+
instance's environment and a re-packed deploy cannot revert it. There is no `config.yaml` edit and no
|
|
92
|
+
re-deploy to make.
|
|
93
|
+
|
|
94
|
+
For **`*.harperfabric.com` targets** or non-loopback custom-domain targets selected with `--fabric`, `flair mcp enable` does not restart the instance. It provisions the secrets, then checks the MCP
|
|
95
|
+
surface in this order:
|
|
96
|
+
|
|
97
|
+
1. **Target/issuer binding.** The target's *own* metadata at
|
|
98
|
+
`<instance-url>/.well-known/oauth-authorization-server` must name the verified issuer and advertise
|
|
99
|
+
the MCP token endpoint `/oauth/mcp/token`. A mismatch refuses the run.
|
|
100
|
+
2. **Public-origin self-verify.** Metadata at the same path is fetched from the public issuer. The check
|
|
101
|
+
requires a matching issuer, the issuer's `/oauth/mcp/token` endpoint, and advertised
|
|
102
|
+
CIMD support. `flair mcp status`
|
|
103
|
+
uses this check.
|
|
104
|
+
|
|
105
|
+
Then one of:
|
|
106
|
+
|
|
107
|
+
- **Self-verify passes.** The run prints the paste block. If this run changed a secret value, restart the
|
|
108
|
+
instance so its process picks the new value up.
|
|
109
|
+
- **It answers but does not pass** (HTTP 404, flair's own authorization server, or CIMD not advertised).
|
|
110
|
+
The step fails, reports the metadata problem, and gives generic apply-or-restart advice. Re-run
|
|
111
|
+
`flair mcp enable` with the same options plus `--confirm-secrets-applied`.
|
|
112
|
+
- **The request fails** (DNS, connection, TLS, timeout). The step fails and says the public issuer could
|
|
113
|
+
not be reached, quoting the URL and the error. It gives no activation instruction; it asks you to check
|
|
114
|
+
that the host resolves, that this machine can reach it over HTTPS, and that the instance is running in
|
|
115
|
+
Fabric — then re-run with `--confirm-secrets-applied`.
|
|
116
|
+
|
|
117
|
+
After applying the secrets and restarting, re-run with `--confirm-secrets-applied`. The run passes only if
|
|
118
|
+
the target's issuer and MCP token endpoint match, and the public metadata and CIMD checks pass.
|
|
112
119
|
|
|
113
120
|
---
|
|
114
121
|
|
package/docs/integrations.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Flair integrations
|
|
2
2
|
|
|
3
|
-
Where Flair already runs. Each integration can reach one shared Flair memory store; signed requests identify an agent
|
|
3
|
+
Where Flair already runs. Each integration can reach one shared Flair memory store; signed requests identify an agent. Reads follow each resource's policy: Memory uses owner/visibility scope with an additional current-authority check for retained closed skills, while Credential records are owner-only for non-admin callers.
|
|
4
4
|
|
|
5
|
-
> **The point.** Memory can follow an agent across orchestrators. Integrations using an ordinary Ed25519 agent key can write under that identity
|
|
5
|
+
> **The point.** Memory can follow an agent across orchestrators. Integrations using an ordinary Ed25519 agent key can write under that identity. Reads follow each resource's policy: Memory uses owner/visibility scope with an additional current-authority check for retained closed skills, while Credential records are owner-only for non-admin callers. Administrator agent roles have broader authority. n8n signs with Agent Private Key selected; its deprecated Admin Password path uses administrator Basic only with an empty key. stdio MCP, Pi, LangGraph, and the wake runner can use administrator Basic auth when no signing key resolves. Administrator Basic auth can read private records and write under any agent ID. Choose an integration with its authentication and recall behavior in mind.
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -20,11 +20,11 @@ Where Flair already runs. Each integration can reach one shared Flair memory sto
|
|
|
20
20
|
| **DeepSeek Harness** (`dsh`) | [`flair-mcp`](deepseek-harness.md) | Cordis overlay | First-party MCP bridge; tools-only, reactive recall — [dedicated page](deepseek-harness.md) |
|
|
21
21
|
| **LangGraph (TS)** | [`langgraph-flair`](#langgraph-typescript) | FlairClient | FlairStore provides get, put, delete, search, and batch (limitations apply) |
|
|
22
22
|
| **OpenClaw** | [`openclaw-flair`](#openclaw) | Ed25519 | Native plugin (context-engine slot left intact) |
|
|
23
|
-
| **n8n** | [`n8n-nodes-flair`](#n8n) |
|
|
23
|
+
| **n8n** | [`n8n-nodes-flair`](#n8n) | Ed25519 with Agent Private Key selected; deprecated administrator Basic | Three nodes (chat memory, search, store) |
|
|
24
24
|
| **Hermes Agent** | [`hermes-flair`](#hermes-agent) | Ed25519 | Python `MemoryProvider` |
|
|
25
|
-
| **Pi agent** | [`pi-flair`](#pi-agent) | Ed25519 | Native pi extension
|
|
26
|
-
| **Google ADK** (Python) | [`adk-flair`](
|
|
27
|
-
| **Google ADK** (JS/TS) | [`@tpsdev-ai/adk-flair`](
|
|
25
|
+
| **Pi agent** | [`pi-flair`](#pi-agent) | Ed25519 | Native pi extension; with `--agent <id>` and wiring enabled, `flair init` attempts Pi wiring for `--client pi`, for detected Pi under `--client all`, or for detected Pi when `--client` is omitted; `--client none` and `--no-mcp` skip it. |
|
|
26
|
+
| **Google ADK** (Python) | [`adk-flair`](https://github.com/tpsdev-ai/flair/blob/main/packages/adk-flair/README.md) | Ed25519 | `BaseMemoryService`; see [hosted auth](#hosted-flair-auth--your-agent-got-a-404) if you just got a 404 |
|
|
27
|
+
| **Google ADK** (JS/TS) | [`@tpsdev-ai/adk-flair`](https://github.com/tpsdev-ai/flair/blob/main/packages/adk-flair-js/README.md) | Ed25519 | Same identity model as the Python package |
|
|
28
28
|
|
|
29
29
|
Don't see your harness? If it speaks **MCP** — Flair already works with `flair-mcp`. For a custom memory protocol such as LangGraph's `BaseStore` or CrewAI's `RAGStorage`, an adapter must translate that protocol's operations to Flair; [open an issue](https://github.com/tpsdev-ai/flair/issues) or [send a PR](https://github.com/tpsdev-ai/flair).
|
|
30
30
|
|
|
@@ -76,14 +76,14 @@ A verified agent that is not allowed the row gets 404, never 403. Anonymous by-i
|
|
|
76
76
|
|
|
77
77
|
| Adapter | URL | Agent id | Keyfile | Hosted extras |
|
|
78
78
|
|---|---|---|---|---|
|
|
79
|
-
| **adk-flair** (Python) | `FLAIR_URL` | `FLAIR_AGENT_ID` | `FLAIR_KEYFILE` | `FLAIR_ALLOW_REMOTE_URL=1`, `FLAIR_HTTP_TIMEOUT` — [adk-flair README](
|
|
80
|
-
| **adk-flair-js** (JS/TS) | `FLAIR_URL` | `FLAIR_AGENT_ID` | `FLAIR_KEYFILE` | For a non-localhost URL, set `FLAIR_ALLOW_REMOTE_URL=1`; request timeout comes from constructor `timeoutMs` (default 2000 ms), not `FLAIR_HTTP_TIMEOUT` — [adk-flair-js README](
|
|
79
|
+
| **adk-flair** (Python) | `FLAIR_URL` | `FLAIR_AGENT_ID` | `FLAIR_KEYFILE` | `FLAIR_ALLOW_REMOTE_URL=1`, `FLAIR_HTTP_TIMEOUT` — [adk-flair README](https://github.com/tpsdev-ai/flair/blob/main/packages/adk-flair/README.md#hosted-flair) |
|
|
80
|
+
| **adk-flair-js** (JS/TS) | `FLAIR_URL` | `FLAIR_AGENT_ID` | `FLAIR_KEYFILE` | For a non-localhost URL, set `FLAIR_ALLOW_REMOTE_URL=1`; request timeout comes from constructor `timeoutMs` (default 2000 ms), not `FLAIR_HTTP_TIMEOUT` — [adk-flair-js README](https://github.com/tpsdev-ai/flair/blob/main/packages/adk-flair-js/README.md) |
|
|
81
81
|
| **flair-mcp** / Cursor plugin | `FLAIR_URL` | `FLAIR_AGENT_ID` | `FLAIR_KEY_PATH` (optional; auto-resolved) | Key must be on the **npx host** |
|
|
82
82
|
| **Hermes** | `FLAIR_URL` | `FLAIR_AGENT_ID` | `FLAIR_KEY_PATH` or Hermes `key_path` | Same Ed25519 model |
|
|
83
83
|
| **Pi** | `FLAIR_URL` | `FLAIR_AGENT_ID` | `FLAIR_KEY_PATH` or Pi client `keyPath` | Same Ed25519 model |
|
|
84
84
|
| **LangGraph** | `FLAIR_URL` | `config.agentId` (required) | Signed requests use `config.privateKey`, `config.keyPath`, or automatic key candidates (`FLAIR_KEY_DIR`, then standard paths); it does not read `FLAIR_KEY_PATH`. | Admin credentials provide a Basic-auth fallback when no key is available. |
|
|
85
85
|
|
|
86
|
-
n8n
|
|
86
|
+
n8n signs as its credential's Agent ID with Agent Private Key selected. See [n8n.md](n8n.md#3-create-the-credential).
|
|
87
87
|
|
|
88
88
|
---
|
|
89
89
|
|
|
@@ -173,7 +173,7 @@ const store = new FlairStore({ agentId: "my-langgraph-agent" });
|
|
|
173
173
|
const agent = createReactAgent({ llm, tools, store });
|
|
174
174
|
```
|
|
175
175
|
|
|
176
|
-
Maps LangGraph namespaces to Flair tags, keys to ids, values to JSON content. Non-empty search queries call Flair's `/SemanticSearch` endpoint. The server selects hybrid (BM25 plus vector), vector-only, or BM25-only retrieval; embedding availability affects whether the vector leg can run. Filter operators applied client-side. Full mapping table: [`packages/langgraph-flair/README.md`](
|
|
176
|
+
Maps LangGraph namespaces to Flair tags, keys to ids, values to JSON content. Non-empty search queries call Flair's `/SemanticSearch` endpoint. The server selects hybrid (BM25 plus vector), vector-only, or BM25-only retrieval; embedding availability affects whether the vector leg can run. Filter operators applied client-side. Full mapping table: [`packages/langgraph-flair/README.md`](https://github.com/tpsdev-ai/flair/blob/main/packages/langgraph-flair/README.md).
|
|
177
177
|
|
|
178
178
|
This package contains the TypeScript adapter; it does not include a Python implementation.
|
|
179
179
|
|
|
@@ -187,7 +187,7 @@ This package contains the TypeScript adapter; it does not include a Python imple
|
|
|
187
187
|
openclaw plugins install @tpsdev-ai/openclaw-flair
|
|
188
188
|
```
|
|
189
189
|
|
|
190
|
-
Configuration via OpenClaw's standard plugin surface. See [`docs/openclaw.md`](openclaw.md) for the per-agent install pattern. The host's own workspace files load each agent's `SOUL.md` / `AGENTS.md`; Flair does not manage or anchor these.
|
|
190
|
+
Configuration via OpenClaw's standard plugin surface. See [`docs/openclaw.md`](openclaw.md) for the per-agent install pattern. The host's own workspace files load each agent's `SOUL.md` / `AGENTS.md`; Flair does not manage or anchor these. <!-- docs-freshness-allow: names files in the host's workspace -->
|
|
191
191
|
|
|
192
192
|
---
|
|
193
193
|
|
|
@@ -201,7 +201,7 @@ Configuration via OpenClaw's standard plugin surface. See [`docs/openclaw.md`](o
|
|
|
201
201
|
|
|
202
202
|
The FlairApi credential provides authentication.
|
|
203
203
|
|
|
204
|
-
**FlairApi credential** —
|
|
204
|
+
**FlairApi credential** — with Agent Private Key selected, requests sign as Agent ID. Ordinary agents read their own and other agents' non-private memories. The deprecated Admin Password path uses Harper administrator Basic authentication only with an empty Agent Private Key, and warns on each node execution.
|
|
205
205
|
|
|
206
206
|
Install via the standard n8n community-node UI (Settings → Community nodes → `@tpsdev-ai/n8n-nodes-flair`) or:
|
|
207
207
|
|
|
@@ -227,7 +227,7 @@ Auth: TPS-Ed25519 (the same model the rest of Flair uses) — writes are isolate
|
|
|
227
227
|
|
|
228
228
|
## Pi agent
|
|
229
229
|
|
|
230
|
-
[`@tpsdev-ai/pi-flair`](https://www.npmjs.com/package/@tpsdev-ai/pi-flair) is the **native pi extension** for the [Pi coding agent](https://github.com/mariozechner/pi-coding-agent)
|
|
230
|
+
[`@tpsdev-ai/pi-flair`](https://www.npmjs.com/package/@tpsdev-ai/pi-flair) is the **native pi extension** for the [Pi coding agent](https://github.com/mariozechner/pi-coding-agent). Memory + identity (`memory_search`, `memory_store`, `bootstrap`) for the pi runtime.
|
|
231
231
|
|
|
232
232
|
To provision an agent and wire Pi, use the init command below; if the agent is already provisioned, install the extension with Pi's installer.
|
|
233
233
|
|
|
@@ -256,7 +256,7 @@ export FLAIR_AGENT_ID=my-agent # per host/purpose
|
|
|
256
256
|
pi
|
|
257
257
|
```
|
|
258
258
|
|
|
259
|
-
Full details (tools, env reference, auto-recall/auto-capture flags, security notes): [`packages/pi-flair/README.md`](
|
|
259
|
+
Full details (tools, env reference, auto-recall/auto-capture flags, security notes): [`packages/pi-flair/README.md`](https://github.com/tpsdev-ai/flair/blob/main/packages/pi-flair/README.md).
|
|
260
260
|
|
|
261
261
|
---
|
|
262
262
|
|
package/docs/mcp-clients.md
CHANGED
|
@@ -33,7 +33,7 @@ The snippets below are the **local** path. Flair also has a native `/mcp` endpoi
|
|
|
33
33
|
| MCP client on this machine (Claude Code, Cursor, Codex, Gemini, and the snippets below) | `npx -y @tpsdev-ai/flair-mcp@<version>` stdio adapter | Ed25519 over HTTP to the instance |
|
|
34
34
|
| Remote MCP client that must dial a public HTTPS origin | Native `/mcp` on the instance | OAuth bearer. Unmounted until `FLAIR_MCP_OAUTH=true` and a public issuer are set (otherwise the path 404s). |
|
|
35
35
|
|
|
36
|
-
Native `/mcp` is remote-only by design. The OAuth authorization server fetches client metadata over HTTPS and refuses private, loopback, and link-local hosts. `flair mcp enable`
|
|
36
|
+
Native `/mcp` is remote-only by design. The OAuth authorization server fetches client metadata over HTTPS and refuses private, loopback, and link-local hosts. `flair mcp enable` accepts loopback or unspecified targets for the local restart but refuses local issuers. Set `FLAIR_MCP_OAUTH=true` — that is the one value that enables both Flair's `/mcp` route and the OAuth component. A loopback Flair cannot be the origin those clients dial. The stdio adapter is the local path because it speaks the instance's Ed25519 HTTP API and does not need that public origin.
|
|
37
37
|
|
|
38
38
|
`flair init --agent <id>` attempts to wire detected local clients unless MCP wiring is disabled; bare `flair init` only initializes the instance. Turning on native `/mcp` is a separate operator step for a publicly reachable instance, documented from the API side in [api-reference.md](api-reference.md#mcp-tools). Who can connect through native `/mcp`, and how to revoke access, is in [access-control.md](access-control.md).
|
|
39
39
|
|
|
@@ -261,7 +261,7 @@ reports that pending-approval state as configured but delivery not verified.
|
|
|
261
261
|
Some clients have no session-start hook Flair can write. Wiring the MCP
|
|
262
262
|
server is necessary but not sufficient — the model still has to choose to
|
|
263
263
|
call `bootstrap`. Add a short instruction block to the file that client
|
|
264
|
-
already loads (`AGENTS.md`, `GEMINI.md`, or the equivalent):
|
|
264
|
+
already loads (`AGENTS.md`, `GEMINI.md`, or the equivalent): <!-- docs-freshness-allow: names files in the reader's project -->
|
|
265
265
|
|
|
266
266
|
```markdown
|
|
267
267
|
## Flair memory
|
|
@@ -291,7 +291,7 @@ If you see (a) the agent calling the `bootstrap` tool returning soul + recent me
|
|
|
291
291
|
|
|
292
292
|
## What the MCP server exposes
|
|
293
293
|
|
|
294
|
-
Clients on this page talk to the stdio server `@tpsdev-ai/flair-mcp`. Its `tools/list` advertises these
|
|
294
|
+
Clients on this page talk to the stdio server `@tpsdev-ai/flair-mcp`. Its `tools/list` advertises these seventeen tools, in this order. The embedded HTTP `/mcp` handler is a different set: it also advertises `memory_basement`, `memory_restore`, and `attention`, and it does not advertise `relationship_store` or `flair_catchup`.
|
|
295
295
|
|
|
296
296
|
| Tool | What it does |
|
|
297
297
|
|---|---|
|
|
@@ -299,7 +299,7 @@ Clients on this page talk to the stdio server `@tpsdev-ai/flair-mcp`. Its `tools
|
|
|
299
299
|
| `memory_store` | Save a memory (type, durability, tags, visibility), under the configured agent ID, subject to server authorization. Optional `usedMemoryIds` cites memories that informed the write |
|
|
300
300
|
| `skill_store` | Write a skill-tagged memory. `trigger` is the recall text; `content` is the procedure. Durability is forced to persistent, and SkillScan rejects a dangerous payload before embed |
|
|
301
301
|
| `skill_search` | Rank skills by their trigger against a task. Returns a catalog (id, name, trigger, description, tags, agentId), not the procedure |
|
|
302
|
-
| `skill_get` | Fetch one skill's full procedure by id. Non-admin callers
|
|
302
|
+
| `skill_get` | Fetch one skill's full procedure by id. Non-admin callers use Memory's owner/visibility scope and, for retained closed skills, its current-authority check; administrators are not subject to those restrictions |
|
|
303
303
|
| `memory_update` | Update a memory by id. Overwrites in place, or pass `preserveHistory` to write a superseding version. Optional `usedMemoryIds` |
|
|
304
304
|
| `memory_get` | Fetch a specific memory by ID |
|
|
305
305
|
| `memory_delete` | Delete a memory by ID. Non-admin callers can delete only their own memories; administrators can also delete other agents' memories |
|
|
@@ -310,9 +310,12 @@ Clients on this page talk to the stdio server `@tpsdev-ai/flair-mcp`. Its `tools
|
|
|
310
310
|
| `flair_workspace_set` | Set this agent's workspace state (ref, label, provider, task, phase, summary) in the Office Space |
|
|
311
311
|
| `flair_orgevent` | Publish an org-wide coordination event (claim, release, or status), attributed to the caller |
|
|
312
312
|
| `flair_catchup` | Drain this agent's own org-event catch-up feed. Page with `after`; advance the watermark with `ack` |
|
|
313
|
+
| `team_directory` | List active agents with published tps-mail contacts. Filter by `id` or `name`; page with `cursor`/`limit` |
|
|
313
314
|
| `record_usage` | Report that recalled memories were actually used (`memoryId` or `memoryIds`, plus optional `attribution`). Drives `usageCount` / `usageBoost` |
|
|
314
315
|
|
|
315
|
-
|
|
316
|
+
On the embedded `/mcp` handler, `soul_set` is listed only for a caller the soul write policy's source-authorization step admits (`Soul.post` applies its content guards after that step). That route authenticates callers with OAuth bearer tokens: a token subject mapped to an Agent acts as an agent principal, and the policy refuses an agent principal, so an agent's `tools/list` does not include `soul_set`. Listing resolves the caller the way a call does, except that it never JIT-provisions. An agent's soul is changed by the operator, on the agent's behalf (`flair soul set`).
|
|
317
|
+
|
|
318
|
+
For ordinary signed agents, Flair enforces write ownership server-side: they can write only under their authenticated agent ID. Administrator credentials and administrator agent roles have broader authority. Reads are more open by design: reads use the open-within-org base scope without a grant, with an additional current-authority check for non-admin by-id and collection reads of retained closed skills (see [SECURITY.md](../SECURITY.md)).
|
|
316
319
|
|
|
317
320
|
Which memories are non-private is decided at write time, and the default is not "shared". `memory_store` defaults `durability` to `standard`, and the server derives visibility from durability — `permanent`/`persistent` → `shared`, `standard`/`ephemeral` → `private` — so **a bare `memory_store` call creates a private memory: ordinary agents other than its owner cannot read it; administrators retain access.** Pass `visibility: "shared"` (or `"private"`, to be explicit) to say what you mean; the tool reports the visibility the write actually landed on so an agent can confirm it rather than assume.
|
|
318
321
|
|
|
@@ -322,6 +325,8 @@ The following structured-payload details describe the HTTP bootstrap response an
|
|
|
322
325
|
|
|
323
326
|
`bootstrap` returns the canonical structured containers — `soul`, `memories`, `predicted`, `teammateFindings`, `events` — plus counts and a `tokenEstimate`. The containers are **always present** (empty `[]`/`{}` when there's nothing), so an empty container is distinguishable from an unsupported one.
|
|
324
327
|
|
|
328
|
+
**The structured containers carry no host-source pointer (flair#2448).** A `memories` or `predicted` entry omits `hostSource`. A visible, bound pointer appears in the bootstrap PROSE only when `includeContext` is true, for an authenticated non-admin caller; the admin bootstrap prose is uncited. A non-admin structured consumer that needs the pointer reads the memory back through the gated Memory read — `memory_get` by id — which renders the pointer that caller may see. An admin `memory_get` takes no pointer join, so it does not render the pointer either.
|
|
329
|
+
|
|
325
330
|
**Skill assignments are reported in `skills` and `skillDiagnostics` (flair#2141).** A `skills` entry is `{ name, skillId, scope, priority, source }` for an assigned skill that won priority resolution; a `skillDiagnostics` entry is a refused, superseded, unresolved or ambiguous assignment with its `decision` and `reason`. Both arrays are present whatever `includeSoul` and `includeContext` say, and hold the entries admitted within the remaining token budget; `skillsTruncated` and `skillDiagnosticsTruncated` count the entries that did not fit. An entry names the skill and does not carry its procedure: fetch that with `skill_get` and the `skillId`, or over REST with a signed `GET /Memory/<skillId>`, which applies the same by-id read gate as `skill_get`. A name-only assignment that wins priority resolution resolves when the agent has exactly one live skill row of its own with that name (not archived, past `validTo` or past `expiresAt`); with none it is `unresolved`, with more than one `ambiguous`. An `OrgSkillAssignment` row is also a candidate when the target's Agent record has `kind` agent and `status` active (absent counts as agent and active); humans, deactivated principals and targets with no Agent record get no org candidates. A Soul `skill-assignment` row with `metadata.optOut: true` removes the org candidates with that name for that agent before priority resolution, when this instance's id can be read and the row's `originatorInstanceId` equals it. An org `skills` entry has `scope: "org"` and its `skillId` is the row's `skillRef`; an org assignment that wins priority resolution with a `skillRef` that is not a live skill row the agent can read is `unresolved`. The `name` and `source` strings come from Soul `skill-assignment` rows, and an org entry's `name` from its `OrgSkillAssignment` row; they reach the agent without SkillScan; that is safe only because no agent key can write those rows (admin agent keys included); only operator credentials and Flair's own internal paths can, so widening who may write them changes what reaches the agent's context.
|
|
326
331
|
|
|
327
332
|
**The token ledger reconciles `tokenEstimate` from the payload alone (flair#1270).** Every token-charged content class carries a counter — `soulTokens`, `memoryTokens`, `trustTokens`, `eventsTokens`, `skillsTokens`, `skillDiagnosticsTokens` — plus a measured `scaffoldTokens` for the fixed JSON frame, and `tokenEstimate ≈ scaffoldTokens + soulTokens + memoryTokens + trustTokens + eventsTokens + skillsTokens + skillDiagnosticsTokens`. At the `/mcp` default (`includeContext: false`) the remaining ≈ gap is the bounded per-item difference between the prose lines the memory counters measure and the heavier structured objects the containers ship; with `includeContext: true` the prose `context` mirror widens it and no upper bound applies. A payload whose estimate an agent can't decompose from the reported figures is a bug, not an accounting convention.
|
|
@@ -346,7 +351,7 @@ The MCP server has no client-side flags beyond these env vars; everything else (
|
|
|
346
351
|
|
|
347
352
|
## What about pi?
|
|
348
353
|
|
|
349
|
-
|
|
354
|
+
Flair ships a **native pi extension**: [`@tpsdev-ai/pi-flair`](https://github.com/tpsdev-ai/flair/blob/main/packages/pi-flair/README.md). Same backend. With an ordinary signed identity, writes are owned by that agent. Reads follow each resource's policy: Memory uses owner/visibility scope with an additional current-authority check for retained closed skills, while Credential records are owner-only for non-admin callers. Zero MCP in the path.
|
|
350
355
|
|
|
351
356
|
Wiring is a `packages` entry in pi's own settings (`~/.pi/agent/settings.json`), not an `mcpServers` block:
|
|
352
357
|
|
|
@@ -364,7 +369,7 @@ One difference from the MCP clients above: pi settings carry no per-package `env
|
|
|
364
369
|
|
|
365
370
|
## What about Hermes (Nous Research)?
|
|
366
371
|
|
|
367
|
-
Hermes uses its own Python-native `MemoryProvider` ABC instead of MCP. It has its own Flair integration in [`packages/hermes-flair/`](../packages/hermes-flair). Same backend. With an ordinary signed identity, writes are owned by that agent
|
|
372
|
+
Hermes uses its own Python-native `MemoryProvider` ABC instead of MCP. It has its own Flair integration in [`packages/hermes-flair/`](../packages/hermes-flair). Same backend. With an ordinary signed identity, writes are owned by that agent. Reads follow each resource's policy: Memory uses owner/visibility scope with an additional current-authority check for retained closed skills, while Credential records are owner-only for non-admin callers. Different plug shape.
|
|
368
373
|
|
|
369
374
|
Future MCP-capable agent CLIs (and there are more landing every month) will work out of the box with the MCP server above — no per-framework adapter required from us.
|
|
370
375
|
|
package/docs/n8n.md
CHANGED
|
@@ -13,7 +13,7 @@ Flair is the right pick when you want:
|
|
|
13
13
|
| **Shape** | Tagged + typed memories with semantic search, plus chat-buffer compatibility | Conversation-buffer only (LangChain `BaseMessage` records) |
|
|
14
14
|
| **Cross-orchestrator** | Same memory readable from Claude Code, OpenClaw, n8n | n8n-internal schema; nothing else reads it |
|
|
15
15
|
| **Cross-instance** | Hub-spoke federation built-in (local ↔ Fabric, etc.) | Single-instance unless you self-build replication |
|
|
16
|
-
| **Identity** | Ed25519
|
|
16
|
+
| **Identity** | Ed25519 with Agent Private Key selected; the v1 admin password is still accepted, deprecated | n8n credential per workflow |
|
|
17
17
|
|
|
18
18
|
If your AI Agent only needs to remember the last N turns of a single chat in a single n8n instance, Postgres-as-memory is fine. If you want the same memory to inform a Claude Code conversation tomorrow, or to persist across n8n redeploys via federated Flair, this package is the path.
|
|
19
19
|
|
|
@@ -39,10 +39,20 @@ In n8n: **Credentials → New → Flair API**. Fill in:
|
|
|
39
39
|
| Field | Value |
|
|
40
40
|
|---|---|
|
|
41
41
|
| **Base URL** | `http://localhost:19926` (or your team's Flair URL) |
|
|
42
|
-
| **Agent ID** |
|
|
43
|
-
| **
|
|
42
|
+
| **Agent ID** | The memory owner and, with Agent Private Key selected, signing identity, e.g. `n8n-support`. Workflows that share an Agent ID share memory ownership. |
|
|
43
|
+
| **Agent Private Key** | That agent's Ed25519 private key. |
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
Register a new agent with `flair agent add n8n-support`, or use an existing agent's matching key:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
base64 < ~/.flair/keys/n8n-support.key
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Paste the base64 output into **Agent Private Key**.
|
|
52
|
+
|
|
53
|
+
Click **Test** — it reads `/Memory` using the selected auth mode and reports that mode on success.
|
|
54
|
+
|
|
55
|
+
**Admin Password (deprecated)** — used only with Agent Private Key empty. Requests use Harper administrator Basic authentication, including access to other agents' private memories, and each node execution warns.
|
|
46
56
|
|
|
47
57
|
### 4. Wire the nodes
|
|
48
58
|
|
|
@@ -81,15 +91,11 @@ Patterns:
|
|
|
81
91
|
|
|
82
92
|
## Security
|
|
83
93
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
For production deployments where untrusted workflow inputs reach Flair, wait for **Ed25519 per-agent authentication** (planned). v1 (admin password) is appropriate when:
|
|
94
|
+
With Agent Private Key selected, requests sign as the credential's Agent ID. Ordinary agents write their own memories and read their own plus other agents' non-private memories; administrator-role agents have broader authority.
|
|
87
95
|
|
|
88
|
-
|
|
89
|
-
- Workflow inputs are trusted (your own CRM, your own webhook source)
|
|
90
|
-
- Memory leakage between agents is acceptable for the use case
|
|
96
|
+
The deprecated **Admin Password** path uses Harper administrator Basic authentication, with access to other agents' private memories. It is used only while Agent Private Key is empty, and every execution that uses it logs a warning. To migrate, set Agent Private Key (step 3).
|
|
91
97
|
|
|
92
|
-
|
|
98
|
+
Treat the key as a secret.
|
|
93
99
|
|
|
94
100
|
## Get By Tag
|
|
95
101
|
|
|
@@ -37,11 +37,19 @@ header `{alg: "EdDSA", typ: "JWT"}`; claims `iss = sub = client_id`, `aud =
|
|
|
37
37
|
token endpoint`, `exp - iat ≤ 60s` (hard-capped, not just defaulted), `iat`,
|
|
38
38
|
random `jti`. Signed with `node:crypto` alone (no new dependency, matching
|
|
39
39
|
the plugin's own approach and this repo's existing `flair-client.mjs` /
|
|
40
|
-
`buildEd25519Auth` signing style). The claim shape is pinned to what PR #165
|
|
40
|
+
`buildEd25519Auth` signing style). The default claim shape is pinned to what PR #165
|
|
41
41
|
(`src/lib/mcp/clientAssertion.ts`) verifies, and
|
|
42
|
-
`test/unit/mcp-client-credentials-live-package.test.ts` proves
|
|
43
|
-
this module signs pass the plugin's **real**
|
|
44
|
-
|
|
42
|
+
`test/unit/mcp-client-credentials-live-package.test.ts` proves default-form
|
|
43
|
+
assertions this module signs pass the pinned plugin's **real**
|
|
44
|
+
`verifyClientAssertion`; it also checks refusals for the issuer form, wrong
|
|
45
|
+
signing keys, and tampered payloads.
|
|
46
|
+
|
|
47
|
+
The audience form is a transition switch (`FLAIR_MCP_CLIENT_ASSERTION_AUDIENCE`,
|
|
48
|
+
or `flair mcp token --assertion-audience`): the default is the shape above, and
|
|
49
|
+
`issuer` signs `aud` = the authorization server metadata document's `issuer`
|
|
50
|
+
with `typ: "client-authentication+jwt"` — the RFC 7523bis form, for the
|
|
51
|
+
verifier release that accepts it (HarperFast/oauth #245, merged upstream but
|
|
52
|
+
not released).
|
|
45
53
|
|
|
46
54
|
Key loading (`resolveAgentKeyPath` / `loadEd25519PrivateKeyFromFile`) mirrors
|
|
47
55
|
`src/cli.ts`'s existing `resolveKeyPath` / `buildEd25519Auth` (used by the
|
|
@@ -76,8 +84,7 @@ cache (e.g. after an unexpected 401).
|
|
|
76
84
|
CLI: `flair mcp token --agent-id <id>` now performs the real mint by
|
|
77
85
|
default; `--dry-run` restores the old sign-and-print behavior.
|
|
78
86
|
`--client-id`/`--token-endpoint`/`--resource` default to this instance's own
|
|
79
|
-
oauth surface (derived from `FLAIR_MCP_ISSUER` / `FLAIR_PUBLIC_URL
|
|
80
|
-
matching `resources/mcp-oauth-flag.ts`) but are fully overridable — an
|
|
87
|
+
oauth surface (derived from `FLAIR_MCP_ISSUER` / `FLAIR_PUBLIC_URL`) but are fully overridable — an
|
|
81
88
|
agent can authenticate to a **different** Harper MCP server; identity is
|
|
82
89
|
portable.
|
|
83
90
|
|
|
@@ -85,9 +92,7 @@ portable.
|
|
|
85
92
|
|
|
86
93
|
`buildTokenRequestForm` carries an optional `resource` field, pass-through
|
|
87
94
|
only (it never invents a value). The CLI supplies the default:
|
|
88
|
-
`${FLAIR_MCP_ISSUER}/mcp
|
|
89
|
-
`resources/mcp-oauth-flag.ts`'s `mcpResource()` uses for this instance's own
|
|
90
|
-
`/mcp` audience binding — exact-match, fail-closed on the AS side. The
|
|
95
|
+
`${FLAIR_MCP_ISSUER}/mcp` (falling back to `FLAIR_PUBLIC_URL`). The
|
|
91
96
|
`resource` is part of the token-cache key: a token minted for one resource
|
|
92
97
|
never serves another.
|
|
93
98
|
|
|
@@ -96,7 +101,7 @@ never serves another.
|
|
|
96
101
|
Each agent's Client ID Metadata Document is **served**, not just generated:
|
|
97
102
|
`GET /MCPClientMetadata/{agentId}` (public, unauthenticated — mirrors
|
|
98
103
|
`AgentCard.ts`'s A2A-card posture). `client_id` = that URL itself (derived
|
|
99
|
-
from `
|
|
104
|
+
from `FLAIR_MCP_ISSUER` / `FLAIR_PUBLIC_URL`); `jwks` = the agent's existing
|
|
100
105
|
`Agent.publicKey` re-expressed as a JWK OKP.
|
|
101
106
|
|
|
102
107
|
Why served rather than exported for external hosting: Flair already
|
|
@@ -208,9 +213,7 @@ in-process proof, not measured; everything else above is measured.
|
|
|
208
213
|
Whoever owns the AS-side `@harperfast/oauth` config for a given Harper
|
|
209
214
|
instance MUST add this Flair instance's `MCPClientMetadata` host to
|
|
210
215
|
`clientIdMetadataDocuments.allowedHosts`. That host is derived from
|
|
211
|
-
`FLAIR_MCP_ISSUER` (or `FLAIR_PUBLIC_URL` as fallback)
|
|
212
|
-
`mcpIssuer()` in `resources/mcp-oauth-flag.ts` and `defaultMcpClientId()` in
|
|
213
|
-
`src/mcp-client-assertion.ts` both read. If the allowlist isn't updated,
|
|
216
|
+
`FLAIR_MCP_ISSUER` (or `FLAIR_PUBLIC_URL` as fallback). If the allowlist isn't updated,
|
|
214
217
|
`/mcp` client_credentials auth for this agent fails closed (by design; the
|
|
215
218
|
e2e proves the "Unknown client" rejection live). This is an operational
|
|
216
219
|
step, not a code change; flag it explicitly when coordinating a rollout.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
> Do NOT enable in production until Sherlock signs off on live enablement.
|
|
7
7
|
|
|
8
8
|
This is the **Model 2** native-MCP path: a custom in-process `/mcp` JSON-RPC
|
|
9
|
-
handler guarded by `@harperfast/oauth`'s `withMCPAuth`, serving the
|
|
9
|
+
handler guarded by `@harperfast/oauth`'s `withMCPAuth`, serving the 18 tools in `resources/mcp-tools.ts`
|
|
10
10
|
with a per-agent OAuth identity. It is distinct from the
|
|
11
11
|
native-application-MCP surface (design A / `FLAIR_MCP_ENABLED`); Model 2 does not
|
|
12
12
|
use Harper's native MCP transport, so it is not blocked by the Harper native-MCP
|
|
@@ -18,10 +18,9 @@ gating gaps.
|
|
|
18
18
|
Streamable HTTP: `initialize` / `tools/list` / `tools/call` / `ping`. On
|
|
19
19
|
`tools/call` it resolves the verified token `sub` → a flair `Agent`, then
|
|
20
20
|
dispatches to the curated tool.
|
|
21
|
-
- `resources/mcp-tools.ts` — the
|
|
21
|
+
- `resources/mcp-tools.ts` — the 18 tools in `resources/mcp-tools.ts`, delegating to resource handlers or the team-directory resolver
|
|
22
22
|
(Memory / SemanticSearch / BootstrapMemories / Soul / WorkspaceState /
|
|
23
|
-
OrgEvent / AttentionQuery / RecordUsage
|
|
24
|
-
is one of the 17 tools in `resources/mcp-tools.ts`. Curated **by construction**.
|
|
23
|
+
OrgEvent / AttentionQuery / RecordUsage / the team-directory resolver).
|
|
25
24
|
- `resources/mcp-oauth.ts` — registers `server.http(withMCPAuth(mcpHandler),
|
|
26
25
|
{ urlPath: '/mcp' })` **only when `FLAIR_MCP_OAUTH` is on.** `/mcp` runs on its
|
|
27
26
|
own dispatch chain; flair's default auth-middleware does not run for it.
|
|
@@ -130,6 +129,7 @@ registered identities.
|
|
|
130
129
|
github:
|
|
131
130
|
clientId: ${OAUTH_GITHUB_CLIENT_ID}
|
|
132
131
|
clientSecret: ${OAUTH_GITHUB_CLIENT_SECRET}
|
|
132
|
+
redirectUri: ${OAUTH_GITHUB_REDIRECT_URI} # this instance's public origin + /oauth; the plugin appends '/github/callback'. Since @harperfast/oauth 2.7.0 a CONFIGURED provider needs it (2.8.1 skips an unconfigured one first — HarperFast/oauth#259)
|
|
133
133
|
mcp:
|
|
134
134
|
enabled: ${FLAIR_MCP_OAUTH} # whole-token env reference (flair#1152) — the choice lives in the ENVIRONMENT, so a re-packed deploy can't revert it
|
|
135
135
|
issuer: ${FLAIR_MCP_ISSUER} # pin to your public origin — REQUIRED
|
|
@@ -144,7 +144,8 @@ registered identities.
|
|
|
144
144
|
allowedHosts: # CIMD is the only supported client-registration path
|
|
145
145
|
- claude.ai
|
|
146
146
|
- claude.com
|
|
147
|
-
signingKeyPem: ${FLAIR_MCP_SIGNING_KEY_PEM}
|
|
147
|
+
# signingKeyPem: ${FLAIR_MCP_SIGNING_KEY_PEM} # Optional pin; add this line and stage the variable.
|
|
148
|
+
# Without a pin, minting reuses a persisted key or generates and persists one if the key table is empty.
|
|
148
149
|
```
|
|
149
150
|
|
|
150
151
|
**DCR is not supported; clients connect via CIMD (Client ID Metadata
|
|
@@ -156,17 +157,45 @@ registered identities.
|
|
|
156
157
|
credentials.
|
|
157
158
|
|
|
158
159
|
2. **Set the env:**
|
|
159
|
-
- `FLAIR_MCP_OAUTH=true` —
|
|
160
|
-
component
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
- `FLAIR_MCP_ISSUER=https://your-public-origin` (
|
|
160
|
+
- `FLAIR_MCP_OAUTH=true` — the recommended value, which both readers accept
|
|
161
|
+
(the component trims it and ignores case, but `1`, `yes` and `on` leave it
|
|
162
|
+
disabled); the authorization
|
|
163
|
+
server also needs the issuer and provider credentials. An instance enabled
|
|
164
|
+
before 0.46 may still have `FLAIR_MCP_OAUTH=1`.
|
|
165
|
+
- `FLAIR_MCP_ISSUER=https://your-public-origin` — a bare HTTP(S) origin.
|
|
166
|
+
- `OAUTH_GITHUB_CLIENT_ID`, `OAUTH_GITHUB_CLIENT_SECRET` and
|
|
167
|
+
`OAUTH_GITHUB_REDIRECT_URI=https://your-public-origin/oauth` — staged by
|
|
168
|
+
`flair mcp enable` using `--issuer` (default: `--instance`).
|
|
165
169
|
- `FLAIR_MCP_JIT_PROVISION=1` — ONLY if you want unknown subjects
|
|
166
170
|
auto-provisioned (default OFF; pre-provision Agent+Credential otherwise).
|
|
167
171
|
|
|
168
172
|
3. **Restart flair.** `/mcp` mounts, OAuth-guarded.
|
|
169
173
|
|
|
174
|
+
4. **Upgrading an instance that still holds the old staged value.** When the
|
|
175
|
+
component loads `FLAIR_MCP_OAUTH=1`, its MCP AS is disabled. Correct the value without re-running IdP intake
|
|
176
|
+
or changing the identity mapping:
|
|
177
|
+
|
|
178
|
+
`--admin-pass <target-admin-password>` is required.
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
flair mcp enable --instance https://your-public-origin --refresh-flag --admin-pass <target-admin-password>
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
It ATTEMPTS an encrypted
|
|
185
|
+
`FLAIR_MCP_OAUTH=true` push: it probes for a usable public key, attempts the update,
|
|
186
|
+
and checks the secret row's `processEnv` marker before restart and discovery
|
|
187
|
+
checks: the target's own discovery document must advertise that issuer with
|
|
188
|
+
the MCP token endpoint, and
|
|
189
|
+
the public document read at that issuer must match the same normalized issuer and its token
|
|
190
|
+
endpoint. When the update could not be pushed or confirmed — a failed capability
|
|
191
|
+
probe, a local encryption failure, a refused or unconfirmed push, or
|
|
192
|
+
a push whose read-back could not confirm storage with `processEnv=true` — it attempts a 0600
|
|
193
|
+
one-var fallback file. Refresh uses a separate default filename; an explicit
|
|
194
|
+
`--secrets-path` can select `mcp enable`'s path. An occupied explicit path
|
|
195
|
+
is refused before probing; an occupied default path is refused when the fallback is
|
|
196
|
+
needed — in both cases by name rather than truncated (the writer opens
|
|
197
|
+
exclusively). These fallback outcomes exit non-zero.
|
|
198
|
+
|
|
170
199
|
## Sherlock's 4 requirements — how they are met
|
|
171
200
|
|
|
172
201
|
1. **Token lifetime.** `mcp.accessTokenTtl: 900` (5–15 min) in the AS config +
|
package/docs/openclaw.md
CHANGED
|
@@ -83,7 +83,7 @@ Without `hooks.allowPromptInjection` the plugin contributes no context and logs
|
|
|
83
83
|
|
|
84
84
|
## Multi-Agent
|
|
85
85
|
|
|
86
|
-
Each OpenClaw agent writes with its `agentId` as a field (tags are optional); reads use owner plus visibility.
|
|
86
|
+
Each OpenClaw agent writes with its `agentId` as a field (tags are optional); reads use owner plus visibility. The base memory scope includes the reader's own records and other agents' non-private records; non-admin by-id and collection reads additionally check current authority for retained closed skills, and grants do not expand the read scope.
|
|
87
87
|
|
|
88
88
|
```bash
|
|
89
89
|
flair agent add research-agent
|
|
@@ -56,7 +56,7 @@ Then set an admin password in Fabric Studio (Cluster Settings → Admin). `flair
|
|
|
56
56
|
|
|
57
57
|
`flair agent add` takes a positional id and `--target`. There is no `--remote` flag on this command (`--remote` belongs to `flair init`).
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
For portless HTTPS, the CLI derives the ops endpoint at `:9925`; `--ops-target` overrides it. <!-- docs-freshness-allow: Fabric ops API port -->
|
|
60
60
|
|
|
61
61
|
```bash
|
|
62
62
|
export FLAIR_URL=https://<cluster>.<org>.harperfabric.com
|
|
@@ -64,7 +64,7 @@ export FLAIR_URL=https://<cluster>.<org>.harperfabric.com
|
|
|
64
64
|
# Keep the Fabric admin password in an owner-only file; the CLI reads it in-process.
|
|
65
65
|
printf '%s\n' '<fabric-admin-password>' > ~/.flair/fabric-admin-pass && chmod 600 ~/.flair/fabric-admin-pass
|
|
66
66
|
|
|
67
|
-
#
|
|
67
|
+
# Operations endpoint override. docs-freshness-allow: Fabric ops API
|
|
68
68
|
flair agent add mybot --target "$FLAIR_URL" --ops-target https://<cluster>.<org>.harperfabric.com:9925 --admin-pass-file ~/.flair/fabric-admin-pass
|
|
69
69
|
```
|
|
70
70
|
|
|
@@ -89,7 +89,7 @@ In Cursor: **Plugins → Configure**
|
|
|
89
89
|
| `FLAIR_URL` | `https://<cluster>.<org>.harperfabric.com` |
|
|
90
90
|
| `FLAIR_AGENT_ID` | `mybot` (the id you just added) |
|
|
91
91
|
|
|
92
|
-
Those are the two plugin schema fields. Local Cursor's `npx` can use the key from step 3 at `~/.flair/keys/mybot.key`. A cloud agent's `npx` runs on a different machine — that VM needs the key (or host-env admin credentials). See [`packages/cursor-flair/README.md`](
|
|
92
|
+
Those are the two plugin schema fields. Local Cursor's `npx` can use the key from step 3 at `~/.flair/keys/mybot.key`. A cloud agent's `npx` runs on a different machine — that VM needs the key (or host-env admin credentials). See [`packages/cursor-flair/README.md`](https://github.com/tpsdev-ai/flair/blob/main/packages/cursor-flair/README.md).
|
|
93
93
|
|
|
94
94
|
## 5. Wire a Grok Bot agent
|
|
95
95
|
|
|
@@ -121,7 +121,7 @@ Same connector, different panel. This is the field-verified sequence — includi
|
|
|
121
121
|
|
|
122
122
|
5. The next tool call picks up the key — a miss is not cached. A 401 names the agent and the paths that were looked in. If those are not where `flair agent add` wrote the file, the MCP process's home differs from the shell; set `FLAIR_KEY_PATH` to the absolute path of the `.key` file.
|
|
123
123
|
|
|
124
|
-
6. Verify: ask the agent to "load my Flair bootstrap". You should get soul + memories **including shared org context** — findings written by teammate agents. A shared-visibility write from this agent
|
|
124
|
+
6. Verify: ask the agent to "load my Flair bootstrap". You should get soul + memories **including shared org context** — findings written by teammate agents. A shared-visibility write from this agent passes every org agent's base visibility check; non-admin Memory by-id and collection reads of retained closed skills also apply the current-authority check.
|
|
125
125
|
|
|
126
126
|
**Account-wide connectors are shared.** A connector added at the Grok Bot account level is one identity used by every agent on that account. For per-agent identity, give each agent its own MCP entry with its own `FLAIR_AGENT_ID` — and register each id (steps 2–5).
|
|
127
127
|
|