import type { PubSub } from '@mastra/core/events'; import { Harness } from '@mastra/core/harness'; import type { HeartbeatHandler, HarnessConfig, HarnessMode, HarnessSubagent } from '@mastra/core/harness'; import type { RequestContext } from '@mastra/core/request-context'; import { resolveModel } from './agents/model.js'; import { AuthStorage } from './auth/storage.js'; import { HookManager } from './hooks/index.js'; import type { McpServerConfig } from './mcp/index.js'; import type { MastraCodeState } from './schema.js'; import type { StorageConfig } from './utils/project.js'; export interface MastraCodeConfig { /** Working directory for project detection. Default: process.cwd() */ cwd?: string; /** Override modes (model IDs, colors, which modes exist). Default: build/plan/fast */ modes?: HarnessMode[]; /** Override or extend subagent definitions. Default: explore/plan/execute */ subagents?: HarnessSubagent[]; /** Extra tools merged into the dynamic tool set. Can be a static record or a function that receives requestContext. */ extraTools?: Record Promise | unknown; [key: string]: unknown; }> | ((ctx: { requestContext: RequestContext; }) => Record Promise | unknown; [key: string]: unknown; }>); /** Tools removed from the dynamic tool set before exposure to the model */ disabledTools?: string[]; /** Custom storage config instead of auto-detected default */ storage?: StorageConfig; /** Observational memory scope. Default: auto-detected from env/config files, falls back to 'thread' */ omScope?: 'thread' | 'resource'; /** Path to a custom settings.json file. Default: global settings */ settingsPath?: string; /** Initial state overrides (yolo, thinkingLevel, etc.) */ initialState?: Partial; /** Override heartbeat handlers. Default: gateway-sync */ heartbeatHandlers?: HeartbeatHandler[]; /** Override the workspace. Default: local filesystem + local sandbox based on detected project */ workspace?: HarnessConfig['workspace']; /** Override the config directory name. Default: '.mastracode'. Replaces '.mastracode' in all project-level and global config paths (MCP, hooks, commands, database, skills, agent instructions). */ configDir?: string; /** Programmatic MCP server configurations, merged with (and overriding) file-based configs. */ mcpServers?: Record; /** Disable MCP server discovery. Default: false */ disableMcp?: boolean; /** Disable hooks. Default: false */ disableHooks?: boolean; /** * Override the memory instance (or dynamic factory) passed to the Harness. * When provided, this replaces the default `getDynamicMemory(storage, vectorStore)` which * uses mastracode's built-in model resolution (Anthropic OAuth, OpenAI Codex, * models.dev gateway). * * Use this when your models are served by a custom provider (e.g. Augment) * that mastracode's `resolveModel` cannot resolve. */ memory?: HarnessConfig['memory']; /** Browser provider for browser automation tools. When set, the agent gains access to browser tools. */ browser?: HarnessConfig['browser']; /** PubSub for signal routing. When crossProcessPubSub is true, thread locks are disabled. */ pubsub?: PubSub; /** Use Mastra Code's built-in Unix socket PubSub for local cross-process signal routing. */ unixSocketPubSub?: boolean; /** Marks the configured PubSub as cross-process-safe, allowing Mastra Code to skip file thread locks. */ crossProcessPubSub?: boolean; } export declare function createAuthStorage(): AuthStorage; export declare function createMastraCode(config?: MastraCodeConfig): Promise<{ harness: Harness; mcpManager: import("./mcp/manager.js").McpManager | undefined; hookManager: HookManager | undefined; signalsPubSub: PubSub | undefined; authStorage: AuthStorage; resolveModel: typeof resolveModel; storageWarning: string | undefined; observabilityWarning: string | undefined; builtinPacks: import("./onboarding/packs.js").ModePack[]; builtinOmPacks: import("./onboarding/packs.js").OMPack[]; effectiveDefaults: Record; }>; //# sourceMappingURL=index.d.ts.map