/** * Pi Extension for Flair Memory Access * * Adds Flair memory tools to pi sessions: * - memory_search(query, limit?) — semantic search * - memory_store(content, durability?, tags?) — save memories * - bootstrap(maxTokens?) — cold-start context * * Configuration (environment variables read by getConfig): * - FLAIR_AGENT_ID (required) * - FLAIR_URL (default: http://127.0.0.1:19926) * - FLAIR_KEY_PATH * - FLAIR_MAX_RECALL_RESULTS (default: 5) * - FLAIR_MAX_BOOTSTRAP_TOKENS (default: 4000) * - FLAIR_AUTO_CAPTURE (default: false) — "true" attempts to store a qualifying assistant entry at turn end * - FLAIR_AUTO_RECALL (default: false) — "true" auto-loads 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. After installing the extension, configure its required identity in the * environment that launches Pi: * 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