/** * ServiceContainer - Dependency injection container for Bash services. * * Replaces the singleton pattern used in v2.x with explicit instance * ownership. Each Bash instance creates its own ServiceContainer, * ensuring full isolation between shell instances. * * v5.0.0: Lazy initialization for all services except astCache and sharedBus. * Services are only instantiated on first access, reducing startup cost. * * v6.0.0: Descriptor-registry model. Each lazy service is described by a * {@link ServiceDescriptor} carrying metadata (bus-aware, disposable). The * registry centralizes bus wiring and ensures dispose() iterates EVERY * instantiated disposable instead of a hardcoded subset. AgentMemory is * hydrated from / persisted to the VFS via an optional fs accessor. */ import { Orchestrator } from "../agentic/Orchestrator.js"; import { LSPManager } from "../lsp/LSPManager.js"; import { ASTCache } from "../parser/ASTCache.js"; import { TreeSitterParser } from "../parser/tree-sitter-parser.js"; import { AgentManager } from "./AgentManager.js"; import { AgentMemory } from "./AgentMemory.js"; import { type SyncFs } from "./AgentMemorySync.js"; import { CronScheduler } from "./CronScheduler.js"; import { GitTracker } from "./GitTracker.js"; import { McpClient } from "./McpClient.js"; import { SessionManager } from "./SessionManager.js"; import { SharedStateBus } from "./SharedStateBus.js"; import { TaskManager } from "./TaskManager.js"; import { TeamManager } from "./TeamManager.js"; import { WorktreeManager } from "./WorktreeManager.js"; export interface ServiceContainer { astCache: ASTCache; sharedBus: SharedStateBus; sessionManager: SessionManager; agentManager: AgentManager; mcpClient: McpClient; orchestrator: Orchestrator; lspManager: LSPManager; taskManager: TaskManager; teamManager: TeamManager; agentMemory: AgentMemory; gitTracker: GitTracker; cronScheduler: CronScheduler; worktreeManager: WorktreeManager; parser: typeof TreeSitterParser; /** * Guarantee the AgentMemory instance has finished hydrating from the VFS. * Synchronous `agentMemory` access returns an instance immediately and * kicks off hydration in the background; callers that need a * guaranteed-loaded store should await this. Resolves immediately (no-op) * when no fs accessor was supplied or hydration already completed. */ ensureAgentMemoryHydrated(): Promise; dispose(): Promise; } export declare function createDefaultServices(overrides?: Partial, fsAccessor?: () => SyncFs): ServiceContainer;