/** * openlore Pi extension — src/pi/extension.ts * * Compiled to dist/pi/extension.js and declared in package.json "pi" field so * `pi install npm:openlore` drops it into the Pi extension registry automatically. * * Two halves: * C — context injection (before_agent_start): model starts grounded with the * architecture digest + spec index + task-grounded orient call, so weak * tool-callers benefit even without calling a tool. * B — native tools (registerTool): navigation surface for on-demand structural * queries, each round-tripping to the warm daemon via fetch. * * Uses ctx.mode (0.78.1+): full injection in tui/rpc (interactive), none in * json/print (one-shot). rpc = headless interactive over stdin/stdout (IDE, * custom UI) — same injection needs as tui. * * Config onboarding: runs on first session when .openlore/config.json is absent; * also available anytime via the openlore_configure tool. */ import type { ExtensionAPI } from '@earendil-works/pi-coding-agent'; interface OpenLoreConfig { version: string; projectType: string; openspecPath: string; analysis: { maxFiles: number; includePatterns: string[]; excludePatterns: string[]; }; generation: { provider?: string; model?: string; openaiCompatBaseUrl?: string; skipSslVerify?: boolean; }; embedding?: { baseUrl: string; model: string; apiKey?: string; skipSslVerify?: boolean; }; createdAt: string; lastRun: string | null; } /** Treat a config as absent unless it has the minimum viable fields. */ export declare function isUsableConfig(raw: unknown): raw is OpenLoreConfig; export declare function readConfig(cwd: string): Promise; /** * Build the `/v1/models` URL for a provider base URL, tolerating a trailing * slash and an already-present `/v1` segment (e.g. https://api.mistral.ai/v1/). */ export declare function modelsUrl(baseUrl: string): string; /** Strip the trailing " *" current-value marker added to select-list entries. */ export declare function stripMarker(label: string): string; /** * One-line summary of a tool call's arguments for renderCall — the descriptive * arg, quoted (e.g. orient "add rate limiting"). Pathfinding reads as `a → b`. * Returns '' when there's no descriptive arg (e.g. get_health_map) so the caller * shows the bare tool title. */ export declare function formatCallArgs(args: Record): string; /** * Turn a structured tool result into readable text. Strings pass through; * `{ error }` becomes a warning line; objects render as labelled sections with * arrays shown as bounded bullet lists. `toolName` selects per-tool skips so an * ambient tool (orient) can hide enrichment a deliberate one (analyze_impact) * keeps. Resilient to schema drift — unknown shapes degrade to key/value lines. */ export declare function formatToolResult(result: unknown, toolName?: string): string; export default function openlore(pi: ExtensionAPI): void; export declare const installPaths: { project: (cwd: string) => string; global: () => string; }; export {}; //# sourceMappingURL=extension.d.ts.map