import { type FabricJevConfig } from "./jev/config.js"; export type { FabricJevConfig } from "./jev/config.js"; import { type FabricActionApprovalMode } from "./core/approval-overrides.js"; import { type FabricForegroundConfig } from "./core/foreground-tools.js"; import { type FabricModelAliases } from "./core/model-aliases.js"; import type { FabricComponentEntry } from "./components/types.js"; import type { MeshDurability } from "./mesh/store.js"; import type { FabricRisk } from "./protocol.js"; import type { FabricKernel } from "./runtime/kernel.js"; import { type FabricThinking, type FabricThinkingBounds } from "./thinking.js"; import { type CodePreviewSettings } from "./ui/code-preview.js"; type FabricApprovalMode = "allow" | "ask" | "auto" | "deny"; export type FabricAgentTransport = "auto" | "process" | "tmux" | "screen" | "localterm" | "herdr" | "herdr-core"; /** Built-in runner ids, or a runner registered through pi-fabric/runners. */ export type FabricAgentRunner = "pi-durable" | "pi" | "claude" | "veda" | (string & {}); /** How a child run's reported model is checked against the requested key. * Strict fails the run on a mismatch. Permissive records the reported * attribution instead, so virtual provider keys can resolve to a concrete * backend at stream time. */ export type FabricModelAdmission = "strict" | "permissive"; export type FabricUiWidgetMode = "auto" | "always" | "hidden"; type FabricToolDisplayMode = "full" | "compact"; export type FabricResultFormat = "auto" | "yaml" | "json" | "text"; export type FabricPrewalkMode = "in-place" | "trajectory"; export type FabricExecutorRuntime = "quickjs" | "node-process" | "bun-process"; export type FabricConfigScope = "global" | "project"; type FabricCompactionEngine = "pi" | "fabric"; type FabricActorScope = "project" | "session"; export type FabricPythonRuntime = "cpython" | "monty"; interface FabricExecutorConfig { kernel: FabricKernel; pythonRuntime: FabricPythonRuntime; cpython: { binary: string; }; /** Optional jev-fabric backend for durable tasks and sessions (macOS/Linux). * `binary` empty or "auto" picks the user's compatible install outside the * workspace, then the bundled package; an explicit path never falls back. * `home` empty means JEV_FABRIC_HOME, else `/.jev-fabric-native`, the * same store other harnesses share. `timeoutMs` is the default job lifetime. */ jevFabric: { binary: string; home: string; timeoutMs: number; }; /** TypeScript backend only; ignored by the Python kernel. */ runtime: FabricExecutorRuntime; /** Add native tool aliases, or opt into Pi's script-level naming/result ergonomics. */ codemodeProfile: "additive" | "native"; timeoutMs: number; /** Policy maximum for any executor deadline, including per-invocation * requests and per-ref floors. Values above this are visibly normalized. */ maxTimeoutMs: number; /** Maximum uninterrupted guest CPU slice in ms; 0 disables the limit (Infinity). */ maxCpuSliceMs: number; /** Exact-ref deadline floors (ms) for known long-running host calls, e.g. * "extensions.subagent". Keys are exact refs; no wildcard matching. */ hostCallTimeouts: Record; /** Exact host-call refs that wait for a person, e.g. "extensions.ask" or * "decisions.wait". * While such a call is in flight the program deadline is paused, so a * foreground question can wait indefinitely. Cancellation still applies. */ humanWaitRefs: string[]; /** Wait budget for nested pi.bash / pi.powershell (default 2m, max 10m). * 0 disables auto-spill. After this, the await settles successfully with a * live output path while the process keeps running. `background: true` * detaches immediately. Explicit shell timeout remains a hard cap. */ shellHangMs: number; memoryLimitBytes: number; maxOutputChars: number; maxNestedResultChars: number; resultFormat: FabricResultFormat; } export interface FabricApprovalConfig { read: FabricApprovalMode; write: FabricApprovalMode; execute: FabricApprovalMode; network: FabricApprovalMode; agent: FabricApprovalMode; model?: string; /** Exact `provider.action` or `provider.*` → allow | ask | deny; exact beats wildcard beats risk mode. */ actions?: Record; /** No-UI approvals: "deny" (absent, fail closed) or "decision" (await a durable user decision). */ headless?: "deny" | "decision"; /** Headless approval decision deadline; absent means 5 minutes. */ headlessTimeoutMs?: number; /** Consult extension action policy hooks at the approve stage; absent means off. */ policyHooks?: boolean; } /** Session-start background revalidation scope for the MCP descriptor cache: * "changed" lists only added/reconfigured servers, "all" re-lists every known * server, "off" never spawns servers in the background. */ type FabricMcpRevalidatePolicy = "changed" | "all" | "off"; interface FabricMcpCacheConfig { /** Serve MCP tool metadata from the on-disk descriptor cache instead of * connecting to every configured server on first discovery each session. */ enabled: boolean; revalidate: FabricMcpRevalidatePolicy; /** Wall-clock budget for one session-start background revalidation pass. */ revalidateBudgetMs: number; } export interface FabricMcpJevConfig { /** Opt-in Jev ranking for tools.search({ searchMode: "semantic" }). */ semanticSearch: boolean; /** MCP servers whose tool metadata must not be sent to Jev. Empty allows every server, including ones not yet cached. */ blockedServers: string[]; semanticCandidateLimit: number; semanticMinProbability: number; } export interface FabricMcpConfig { enabled: boolean; /** Opt-in exact server names owned by Pi, never mcporter fallback targets. */ nativeServers?: string[]; configPath?: string; disableOAuth: boolean; allowDynamicServers: boolean; callTimeoutMs: number; cache: FabricMcpCacheConfig; jev: FabricMcpJevConfig; } interface FabricClaudeRunnerConfig { binary: string; model?: string; } /** Veda CLI options for the `veda` agent runner. The Veda CLI wraps external * backends (agy, codex, claude-code, droid, pi, and any backend registered by * the installed Veda build); the backend is selected here and the persona * controls read-only vs write-capable behavior. */ interface FabricVedaRunnerConfig { binary: string; /** Veda backend to drive. Defaults to the Antigravity CLI (agy). */ backend: string; /** Optional backend-specific model or Veda model alias. */ model?: string; /** Veda persona: navigator-plan, navigator-chat, reviewer, or worker. */ persona: string; } interface FabricPrewalkConfig { enabled?: boolean; mode: FabricPrewalkMode; model?: string; alwaysRearm: boolean; compactOnReturn: boolean; requirePlan: boolean; detectShellWrites: boolean; thinking?: FabricThinking; } export interface FabricAgentConfig { enabled: boolean; runner: FabricAgentRunner; transport: FabricAgentTransport; model?: string; claude: FabricClaudeRunnerConfig; veda: FabricVedaRunnerConfig; thinking: FabricThinking; maxConcurrent: number; maxPerExecution: number; maxDepth: number; timeoutMs: number; extensions: boolean; defaultTools: string[]; retainRuns: boolean; /** * Opt-in: a resident host re-attaches its unfinished built-in pi-durable * worker runs after a restart, or relaunches them on their journal. */ durableWorkerRecovery?: boolean; /** * Opt-in: a pi-durable worker keeps a private Pi session file in its run * directory, with a worker-role entry, so a relaunch keeps extension state. */ durableWorkerSession?: boolean; notifyOnComplete: boolean; budgetUsd: number; maxTokensPerChild: number; /** Write usage-only pi-format session files per agent run for external trackers. */ sessionExport: boolean; /** Export store root override; PI_FABRIC_AGENT_DIR wins. Empty = ~/.pi-fabric/agent. */ sessionExportDir: string; /** Admission policy for the model a child process actually reports. */ modelAdmission: FabricModelAdmission; /** Shell command run in each new agent worktree before the child starts. */ worktree?: { setup?: string; }; /** Child UI dialogs: "cancel" (absent) or "route" to the parent UI or a decision. */ childQuestions?: "cancel" | "route"; /** Routed child question deadline; absent means 10 minutes. */ childQuestionTimeoutMs?: number; /** Tools a routed Pi child gets for asking questions; absent means ["ask"], [] grants none. */ childQuestionTools?: string[]; } export interface FabricToolCaptureConfig { enabled: boolean; hideFromModel: boolean; keepVisible: string[]; defaultRisk: FabricRisk; risks: Record; } export type FabricSchemaMode = "off" | "audit" | "enforce"; export interface FabricSchemaTrustedCommand { command: string; args: string[]; shell: boolean; timeoutMs: number; } export interface FabricSchemaConfig { mode: FabricSchemaMode; certificateTtlMs: number; maxFiles: number; maxBytes: number; trustedCommands: Record; } interface FabricUiConfig { enabled: boolean; widget: FabricUiWidgetMode; maxRows: number; refreshMs: number; eventHistory: number; haltOnEscape: boolean; /** Tell Herdr about running agents in an interactive root session. */ herdrStatus: boolean; showAgentToolPreview: boolean; toolDisplay: FabricToolDisplayMode; /** Lend the window title to the latest nested call while fabric_exec runs. */ terminalTitle: boolean; updateDebounceMs: number; /** Offer decisions shown at this terminal to registered question renderers; absent means off. */ questionRenderers?: boolean; /** * Raw `ui.sessionLabel`, passed through unchecked: sessionLabelSettings() in * topology/session-label-settings.ts checks it at first use, which keeps the * check out of the startup graph. */ sessionLabel?: unknown; } export interface FabricCompactionPressureBands { warn: number; urgent: number; } interface FabricCompactionConfig { engine: FabricCompactionEngine; targetContextRatio: number; thresholds: Record; tokenThresholds: Record; /** Occupancy fractions reported by `compact.pressure()`; 0 < warn < urgent < 1. */ pressureBands: FabricCompactionPressureBands; /** Compact at a settled boundary when window headroom drops below this; 0 disables. */ outputReserveTokens: number; /** Drop orphaned tool results and fill missing ones in outgoing context. */ repairOrphans: boolean; } export declare const MIN_COMPACTION_TOKEN_THRESHOLD = 1000; export declare const MAX_COMPACTION_TOKEN_THRESHOLD = 100000000; export declare const MIN_COMPACTION_RATIO_THRESHOLD = 0.25; export declare const MAX_COMPACTION_RATIO_THRESHOLD = 0.95; export declare const clampCompactionTokenThreshold: (value: number) => number; export declare const clampCompactionRatioThreshold: (value: number) => number; export interface FabricRetentionConfig { orphanedTempRunMs: number; oneShotRunMs: number; actorRunArchiveMs: number; } export interface FabricMeshConfig { enabled: boolean; root?: string; actorScope: FabricActorScope; maxEventBytes: number; maxReadEvents: number; actorPollMs: number; actorQueueLimit: number; eventContextChars: number; actorContextEntries: number; /** Tell a root session's model when other root sessions join or leave the project. */ peerNotices: boolean; /** Most stopped-session tombstones kept for agents.departed(); 0 writes none but still reads others'. */ departedLimit: number; /** Age after which stopped and lost sessions leave agents.departed(). */ departedRetentionMs: number; /** `"fsync"` flushes every committed mesh write to stable storage before the call returns. */ durability: MeshDurability; } interface FabricRepairsConfig { enabled: boolean; } interface FabricEntropyConfig { compile: boolean; } interface FabricTraceConfig { /** Persist the opt-in FabricAssessmentTraceV1 (timings, usage) beside the execution trace. */ assessment: boolean; } /** One configured portable memory source (see docs/memory-recall.md). */ export interface FabricMemorySourceConfig { /** Registry id used as `args.source` in source-qualified memory calls. */ id: string; /** Adapter kind; `"fs"` walks a local directory of session JSONL files. */ kind: "fs"; /** Absolute directory the `fs` adapter enumerates recursively. */ root: string; } export interface FabricExtractiveConfig { enabled: boolean; provider: string; model: string; maxViewBytes: number; maxCandidates: number; maxSourceChars: number; /** Zero selects deterministic-only operation. V1 issues at most one batch. */ maxEvaluationsPerTurn: number; timeoutMs: number; } export declare const DEFAULT_EXTRACTIVE_CONFIG: FabricExtractiveConfig; export interface FabricMemoryConfig { extractive?: FabricExtractiveConfig; enabled: boolean; indexDir?: string; maxSessions: number; maxEntryChars: number; indexThinking: boolean; indexToolOutput: boolean; hotSessions?: number; digestTerms?: number; maxColdVocabularyBytes?: number; maxColdCacheBytes?: number; maxSyncSessions?: number; maxSyncSourceBytes?: number; maxCacheCleanupFiles?: number; regexMaxPatternBytes?: number; regexMaxHaystackTerms?: number; regexMaxHaystackBytes?: number; regexTimeoutMs?: number; /** Configured portable sources; present enables source-qualified calls. */ sources?: FabricMemorySourceConfig[]; } export interface FabricSpeculationConfig { /** Master switch for speculative programmatic tool calling during streaming. */ enabled: boolean; /** Maximum simultaneously in-flight speculative calls; excess candidates are dropped. */ maxConcurrent: number; /** Maximum retained unserved speculation entries per turn. */ maxEntries: number; /** Per-stream cap on buffered partial tool-call arguments while extracting the `code` field. */ maxBufferBytes: number; /** Unserved speculation entries older than this are aborted and discarded. */ entryTtlMs: number; /** * Tier B: MCP tools that may be speculated despite risk "network". Entries * are `server.tool` or `server.*` and match the ref after the `mcp.` prefix. * Only enable for tools the operator knows are read-only; cached MCP * annotations with destructiveHint=true always refuse. */ mcpAllowlist: string[]; } export interface FabricModelsConfig { /** Alias name → ordered provider/model fallback chain plus an optional default thinking level. */ aliases: FabricModelAliases; } export interface FabricThinkingConfig { /** Inclusive host/child thinking bounds; empty means the model's levels. */ bounds: FabricThinkingBounds; } export interface FabricConfig { fullCodeMode: boolean; executor: FabricExecutorConfig; approvals: FabricApprovalConfig; mcp: FabricMcpConfig; prewalk: FabricPrewalkConfig; agents: FabricAgentConfig; models: FabricModelsConfig; components: FabricComponentEntry[]; capture: FabricToolCaptureConfig; /** Registered tools full code mode keeps declared beside fabric_exec. */ foreground: FabricForegroundConfig; ui: FabricUiConfig; compaction: FabricCompactionConfig; retention: FabricRetentionConfig; mesh: FabricMeshConfig; memory: FabricMemoryConfig; jev: FabricJevConfig; entropy: FabricEntropyConfig; repairs: FabricRepairsConfig; trace: FabricTraceConfig; schema: FabricSchemaConfig; speculation: FabricSpeculationConfig; thinking: FabricThinkingConfig; codePreview: CodePreviewSettings; } /** Hard implementation maximum for any executor deadline. Policy ceilings * (executor.maxTimeoutMs) may be raised up to this value by administrators. */ export declare const MAX_EXECUTOR_TIMEOUT_MS: number; export declare const MIN_AGENT_TIMEOUT_MS = 1000; export declare const MAX_AGENT_TIMEOUT_MS: number; export declare const QUICKJS_MAX_MEMORY_LIMIT_BYTES = 4294967295; export declare const MAX_EXECUTOR_MEMORY_LIMIT_BYTES: number; export declare const maxExecutorMemoryLimitBytes: (runtime: FabricExecutorRuntime, kernel?: FabricKernel) => number; export declare const DEFAULT_FABRIC_CONFIG: FabricConfig; export declare const normalizeFabricConfig: (input: Record) => FabricConfig; export declare const effectiveToolCaptureConfig: (config: Pick & Partial>) => FabricToolCaptureConfig; export declare const ineffectiveKeepVisible: (config: Pick & Partial>, resolvedForeground: readonly string[]) => string[]; export declare const writeJsonAtomic: (filePath: string, document: Record, expectedSource: string | null) => void; export declare const loadFabricConfigForScope: (options: { cwd: string; agentDir: string; projectTrusted: boolean; }, scope: FabricConfigScope) => FabricConfig; export declare const loadFabricConfig: (options: { cwd: string; agentDir: string; projectTrusted: boolean; }) => FabricConfig; export declare const saveFabricConfig: (options: { cwd: string; agentDir: string; projectTrusted: boolean; scope?: FabricConfigScope; }, partial: Record) => { scope: FabricConfigScope; path: string; }; //# sourceMappingURL=config.d.ts.map