/** * Agent Source Registry * Pluggable agent discovery and loading */ import type { StorageProvider } from '../storage/index.js'; import type { SquadState } from '../state/squad-state.js'; export interface AgentSource { readonly name: string; readonly type: 'local' | 'github' | 'marketplace'; listAgents(): Promise; getAgent(name: string): Promise; getCharter(name: string): Promise; } export interface AgentManifest { name: string; role: string; version?: string; source: string; } export interface AgentDefinition extends AgentManifest { charter: string; model?: string; tools?: string[]; skills?: string[]; history?: string; } /** * Parse charter.md content to extract agent metadata. */ export declare function parseCharterMetadata(content: string): { name?: string; role?: string; model?: string; skills?: string[]; tools?: string[]; }; export declare class LocalAgentSource implements AgentSource { private basePath; private storage; private state?; /** * Explicit agents directory — skips the `/.squad/agents` * probing. Needed for externalized state, where agents live at * `/agents` with no `.squad` nesting (#1399). */ private agentsDir?; readonly name = "local"; readonly type: "local"; constructor(basePath: string, storage?: StorageProvider, state?: SquadState | undefined, /** * Explicit agents directory — skips the `/.squad/agents` * probing. Needed for externalized state, where agents live at * `/agents` with no `.squad` nesting (#1399). */ agentsDir?: string | undefined); /** * Resolve the agents directory, preferring .squad/agents over .ai-team/agents. * An explicit `agentsDir` from the constructor wins over probing. */ private resolveAgentsDir; listAgents(): Promise; getAgent(name: string): Promise; getCharter(name: string): Promise; } /** * Pluggable fetcher interface for GitHub API calls (enables testing). */ export interface GitHubFetcher { /** List directory entries at a path in a repo. */ listDirectory(owner: string, repo: string, path: string, ref?: string): Promise>; /** Fetch file content (UTF-8 string) at a path in a repo. */ getFileContent(owner: string, repo: string, path: string, ref?: string): Promise; } export declare class GitHubAgentSource implements AgentSource { readonly name = "github"; readonly type: "github"; private owner; private repoName; private branch?; private pathPrefix; private fetcher; constructor(repo: string, options?: { ref?: string; pathPrefix?: string; fetcher?: GitHubFetcher; }); listAgents(): Promise; getAgent(name: string): Promise; getCharter(name: string): Promise; } export declare class MarketplaceAgentSource implements AgentSource { private apiEndpoint; readonly name = "marketplace"; readonly type: "marketplace"; constructor(apiEndpoint: string); listAgents(): Promise; getAgent(name: string): Promise; getCharter(name: string): Promise; } export declare class AgentRegistry { private sources; register(source: AgentSource): void; unregister(name: string): boolean; getSource(name: string): AgentSource | undefined; listAllAgents(): Promise; findAgent(name: string): Promise; getCharter(name: string): Promise; } //# sourceMappingURL=agent-source.d.ts.map