/** * Agent discovery and configuration. * Adapted from the pi subagent extension so taskflow shares the same agent * pool (~/.pi/agent/agents/*.md, .pi/agents/*.md) and settings overrides. */ export type AgentScope = "user" | "project" | "both"; export type PiChildResourceProfile = "isolated" | "allowlist" | "inherit"; /** Trusted host configuration for Pi children. This is deliberately not part * of the flow DSL or RunOptions: a flow may consume authority, never mint it. */ export interface PiChildSettings { resourceProfile: PiChildResourceProfile; extensions: string[]; terminalGraceMs: number; } export declare const DEFAULT_PI_CHILD_SETTINGS: PiChildSettings; export interface TaskflowSettings { /** Whether taskflow's package-local built-in agents are available to flows. */ builtInAgents: boolean; /** Whether package-local built-ins are copied into the current project's .pi/agents/. */ syncBuiltinAgentsToProject: boolean; /** Maximum inactive runs to keep. Running runs are never pruned. 0 disables cleanup. */ maxKeptRuns: number; /** Maximum age (days) for inactive runs. Running runs are never pruned. 0 disables age cleanup. */ maxRunAgeDays: number; /** Library (reusable-flow asset layer) settings. RFC: docs/rfc-library-reuse.md */ library: LibrarySettings; /** Optional embedding backend for semantic search (Phase 2). Undefined = structural/keyword fallback. */ embedder?: EmbedderConfig; /** Host-only Pi child isolation/completion policy. */ piChild: PiChildSettings; } import { type LibrarySettings } from "./library/types.ts"; export declare const DEFAULT_TASKFLOW_SETTINGS: TaskflowSettings; export declare function normalizePiChildSettings(raw: unknown): PiChildSettings; export declare function normalizeTaskflowSettings(raw: unknown): TaskflowSettings; /** RFC §4.2 config shapes: { kind: "http", url, model, apiKey?, dimensions? } or * { kind: "command", command: string[], timeoutMs? }. */ export type EmbedderConfig = { kind: "http"; url: string; model: string; apiKey?: string; dimensions?: number; } | { kind: "command"; command: string[]; timeoutMs?: number; }; export declare function normalizeLibrarySettings(raw: unknown): LibrarySettings; export declare function normalizeEmbedderConfig(raw: unknown): EmbedderConfig | undefined; export declare function shouldLoadBuiltinAgents(settings?: TaskflowSettings): boolean; export declare function shouldSyncBuiltinAgentsToProject(settings?: TaskflowSettings): boolean; export interface AgentConfig { name: string; description: string; tools?: string[]; model?: string; /** 0.2.4 role used only when the current semantic role is not configured. */ legacyModelRole?: string; thinking?: string; systemPrompt: string; source: "user" | "project" | "built-in"; filePath: string; } /** @internal */ export interface AgentDiscoveryResult { agents: AgentConfig[]; projectAgentsDir: string | null; } export declare function discoverAgents(cwd: string, scope: AgentScope, modelRoles?: Record, taskflowSettings?: TaskflowSettings): AgentDiscoveryResult; export interface SubagentSettings { globalThinking?: string; modelRoles?: Record; taskflow: TaskflowSettings; } /** Read subagent overrides from ~/.pi/agent/settings.json (shared with the subagent extension). */ export declare function readSubagentSettings(): SubagentSettings; /** * Copy the 18 built-in agents from extensions/agents/*.md into the project's * .pi/agents/ directory so Pi's native subagent tool (and any other extension) * can discover them. taskflow's own discoverAgents() already reads from this * directory with lower priority than built-in, so the copy is a no-op for * taskflow phases — it only matters for Pi's native agent discovery. * * Idempotent: only copies agents whose built-in source is newer than the * project copy (or that don't exist yet). */ export declare function syncBuiltinAgentsToProject(cwd: string): void; //# sourceMappingURL=agents.d.ts.map