/** * Pi Extension for Flair Memory Access * * Adds Flair memory tools to pi sessions: * - memory_search(agentId, query, limit) — semantic search * - memory_store(agentId, content, durability) — save memories * - bootstrap(agentId, maxTokens) — cold-start context * * Configuration: * - flair_url (default: http://127.0.0.1:19926) * - agentId (required, via FLAIR_AGENT_ID env var) * - max_recall_results (default: 5) * - max_bootstrap_tokens (default: 4000) * - auto_capture (default: false) — auto-save session context to memory * - auto_recall (default: false) — auto-load bootstrap on session start * * Usage: * 1. Install: pi install npm:@tpsdev-ai/pi-flair * (writes "npm:@tpsdev-ai/pi-flair" into the "packages" settings key; pi * discovers the extension via the "pi" manifest in package.json — #1346) * 2. Or configure manually in ~/.pi/agent/settings.json or .pi/settings.json: * { * "packages": ["npm:@tpsdev-ai/pi-flair"] * } * 3. Or use environment variables: * export FLAIR_AGENT_ID=my-agent * export FLAIR_URL=http://127.0.0.1:19926 * 4. Restart pi */ import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; import { type FlairClientConfig } from "@tpsdev-ai/flair-client"; interface PluginConfig extends FlairClientConfig { max_recall_results?: number; max_bootstrap_tokens?: number; auto_capture?: boolean; auto_recall?: boolean; } /** * Default Flair base URL when FLAIR_URL is unset. * * 19926 is Flair's stock local HTTP port — `flair init` on a new instance * serves REST there (DEFAULT_PORT in src/cli.ts), and the README documents * exactly this value. 9926 is the ORIGINAL default that only long-running * early installs still use. This constant shipped as 9926 for a while * (flair#1347), so a default install got connection_error on every memory * call; the code now matches the docs, not the other way around. */ export declare const DEFAULT_FLAIR_URL = "http://127.0.0.1:19926"; /** * Classify an error into a user-friendly message. * @param err - The error to classify * @param flairUrl - The Flair server URL for connection error messages */ export declare function classifyError(err: unknown, flairUrl: string): string; export default function (pi: ExtensionAPI): void; export declare function manualBootstrap(config: PluginConfig, maxTokens?: number): Promise; export {}; //# sourceMappingURL=index.d.ts.map