import { ProviderId } from '../providers'; export interface AutodevSettings { provider: ProviderId; /** Full WS URL with token+endpoint encoded: wss://host/ws?token=xxx&endpoint=slug */ wsUrl: string; /** Derived from wsUrl (or set directly for backward compat). */ serverBaseUrl: string; serverApiKey: string; webhookSlug: string; discordToken: string; discordChannelId: string; discordOwners: string; loopInterval: number; taskTimeoutMinutes: number; taskCheckInMinutes: number; retryOnTimeout: boolean; autoResetPendingTasks: boolean; profilePath: string; todoPath: string; resumeSession: boolean; vncEnabled: boolean; vncHost: string; vncPort: number; vncPassword: string; rdpEnabled: boolean; rdpHost: string; rdpPort: number; rdpUsername: string; rdpPassword: string; rdpDomain: string; /** Public WSS URL for guacamole-lite (e.g. wss://myhost.com/guac-ws). If empty, falls back to ws://:4567 */ rdpGuacWsUrl: string; enableFileBrowser: boolean; gitEnabled: boolean; /** * Opt-in: honor `mcp_update` frames pushed over the WS channel. When false * (default), inbound mcp_update frames are ignored. Writing remote-supplied * MCP server config spawns stdio child processes on restart, so this is a * code-execution surface and must be explicitly enabled (mirrors * enableFileBrowser / gitEnabled). Even when enabled, entries are validated. */ mcpUpdateEnabled: boolean; /** * Opt-in: honor `skill_update` frames pushed over the WS channel. When false * (default), inbound skill_update frames are ignored. Writing remote-supplied * skills drops instruction files into `.claude/skills/` that a running Claude * agent live-reads, so it is an instruction-injection surface and must be * explicitly enabled (mirrors mcpUpdateEnabled). Even when enabled, each skill * is validated (slug shape, size caps, workspace path containment). */ skillUpdateEnabled: boolean; hooksEnabled: boolean; hooksScope: 'project' | 'global'; openCodeHooksEnabled: boolean; /** * If true, the VS Code extension auto-starts the task loop on activation * (when a wsUrl is set). Useful for `autodev --setup-url=… --ide=vscode` * where the user expects the agent to come online immediately on launch. * Default false — opt in via .autodev/settings.json (the CLI sets it true). */ autoStartLoop: boolean; /** * Optional model override for Copilot CLI. When set, passes `--model=` * to the `copilot` command. Leave empty to use the CLI default model. * Example values: `claude-sonnet-4.6`, `gpt-5.4`, `gemini-2.5-pro`. */ copilotModel: string; /** * Optional model override for Claude CLI. When set, passes `--model ` * to the `claude` command. Leave empty to use the CLI default. * Example values: `best`, `sonnet`, `opus`, `haiku`. */ claudeModel: string; /** * Optional model override for OpenCode CLI. When set, passes `--model=` * to the `opencode` command. Leave empty to use the CLI default. * Example values: `anthropic/claude-sonnet-4-5`, `openai/gpt-4o`. */ opencodeModel: string; /** * Optional human-readable session display NAME (not the session id). When set * it is shown in pixel-office for this agent and passed to providers that * support a native session title: opencode `--title`, copilot `--name`. */ sessionName: string; /** * Optional model override for Grok TUI. When set, passes `-m ` to * the `grok` command. Leave empty (the default) to force NO model, so grok * uses the account's own default. Run `grok models` to list valid models. */ grokModel: string; /** * When true, writes `setCacheKey: true` into the provider options of the * project-level `opencode.json`, enabling prompt/model caching. */ opencodeCacheEnabled: boolean; /** * Per-project MCP server definitions managed by autodev. Stored in the * standard `mcpServers` shape (`{ : { command, args, env } }`) so * users can paste server snippets verbatim from MCP docs (e.g. * mcp-atlassian for Jira). On save, the extension fans these out to every * provider's project-local config (.mcp.json, .claude/settings.local.json, * opencode.json, .vscode/mcp.json) alongside the autodev defaults. */ mcpServers: Record; enabled?: boolean; type?: 'stdio' | 'http' | 'sse'; url?: string; headers?: Record; }>; /** * Names of built-in MCP servers (from DEFAULT_MCP_SERVERS) that the user * has explicitly disabled. Built-ins default to enabled when not listed. */ disabledBuiltinMcp: string[]; /** * MCP-only agent (no autodev loop). When true, the auto-attached office * built-in is wired to the OPERATOR MCP (`autodev mcp-operate` → * `…/api/office-mcp`) instead of the A2A-only remote (`…/api/mcp/a2a`). * * Why it matters: the A2A endpoint carries messaging only — no presence * write, no task/report tools — which is fine for a loop agent (it has its * own WebSocket presence + task loop) but leaves a pure-MCP client offline * with no way to pull work. The operator bridge registers presence (its own * socket + office-mcp polling) and exposes the full agent toolkit (tasks, * report, status, whoami) plus A2A, so an MCP-only client — opencode/Kimi, * Claude Code, any MCP client — becomes a first-class office agent. * * Loop agents leave this false (the default) and keep the A2A remote. */ mcpOnly: boolean; /** Fallback provider to use when the main provider hits a rate limit. Empty string = disabled. */ fallbackProvider: ProviderId; /** Whether to automatically switch to fallbackProvider on rate limit instead of pausing. */ fallbackProviderEnabled: boolean; /** * Ordered list of profile section IDs to include when assembling AGENT_PROFILE.md. * Each ID corresponds to a file in `media/profile/`. An empty array means all * sections are included (the default). Use the ProfileBuilder sidebar tab to manage. */ enabledProfileSections: string[]; /** * Additional `@path` references appended to AGENT_PROFILE.md after the section index. * Each entry is a workspace-relative (or absolute) path. The `@` prefix is added * automatically if missing. One path per entry. */ customProfileRefs: string[]; /** * When true, the task loop automatically runs /compact every * `autoCompactInterval` completed tasks to keep the context window lean. */ autoCompact: boolean; /** How many completed tasks to wait between automatic /compact runs. Default 5. */ autoCompactInterval: number; /** * OpenCode provider-level HTTP timeout in milliseconds. * Written to opencode.json under provider.*.options.timeout. * 0 = use OpenCode default (300000 / 5 min). */ opencodeTimeout: number; /** * OpenCode provider-level chunk timeout in milliseconds (max gap between * streaming chunks before the request is considered stalled). * Written to opencode.json under provider.*.options.chunkTimeout. * 0 = use OpenCode default. */ opencodeChunkTimeout: number; /** * Reset the agent session every N completed tasks (0 = disabled). * Only active when resumeSession is true. * When triggered, the agent is asked to summarise to SUMMARY.md before the * session ID is cleared so the next task starts a fresh session. */ resetSessionEveryNTurns: number; /** * How many times the loop will dispatch the same task before giving up and * force-marking it done. Prevents a single stuck task from blocking the queue * indefinitely. Default: 3. Set to 0 to disable (never force-done). */ maxTaskAttempts: number; /** * Move completed [x] tasks from TODO.md into DONE.md every N * completed tasks (0 = disabled). Keeps the active TODO file short. */ pruneTodoEveryNTasks: number; /** * Trigger the auto-learn / journal review cycle every N completed tasks * (0 = disabled). The agent reads JOURNAL.md, extracts patterns, updates * LESSONS.md, and optionally creates skill files. Default: 0. */ journalLearnEveryNTasks: number; /** * Run /compact on the active session every N completed tasks (0 = disabled). * Complements the existing autoCompact/autoCompactInterval toggle — use one * or the other; both can be active simultaneously. */ compactEveryNTasks: number; /** * Prompt the agent to create/update a SKILLS.md file every N completed tasks. * 0 = disabled. The agent is asked to record reusable patterns, commands, * and learnings it has discovered into SKILLS.md before continuing. */ skillEveryNTasks: number; /** * Prompt the agent to update SUMMARY.md every N completed tasks. * 0 = disabled. The agent is asked to merge new findings into SUMMARY.md * and update LESSONS.md with any corrections or repeat failures. */ memoryEveryNTasks: number; /** * Prompt the agent to write a full project state summary to SUMMARY.md * every N completed tasks (more comprehensive than the memory update). * 0 = disabled. */ summaryEveryNTasks: number; /** * Re-send the full agent profile (includeProfile=true) every N completed tasks. * 0 = only send on the first task of each loop start. * Useful to keep long-running agents on protocol even in resumed sessions. */ profileEveryNTasks: number; /** * GitHub personal access token used by the Copilot TUI (SDK) provider. * Overrides the GITHUB_TOKEN / GH_TOKEN env vars and keytar lookup. * Required on Linux/headless machines where `copilot auth login` credentials * are not available in the system keyring. * The token needs the `copilot` scope (or a classic token with `read:user` + `copilot`). */ copilotGithubToken: string; /** Upload an agent backup zip to pixel-office when the export_request WS message is received. */ exportEnabled: boolean; /** Automatically upload a backup once per day (only active when exportEnabled is true). */ exportDailyBackup: boolean; /** Agent database ID (set automatically when export_config is received from pixel-office). */ agentId: string; } export declare const SETTINGS_DEFAULTS: AutodevSettings; /** * Parse a full WS URL (wss://host/ws?token=xxx&endpoint=slug) into the three * legacy fields. Returns null if the URL is empty or not a WS scheme. */ export declare function parseWsUrl(wsUrl: string): { serverBaseUrl: string; serverApiKey: string; webhookSlug: string; } | null; export declare const NEW_SETTINGS_REL_PATH = ".autodev/settings.json"; export declare const LEGACY_SETTINGS_REL_PATH = ".vscode/autodev.json"; /** Path that should be used for writes (always the new canonical location). */ export declare function settingsWritePath(root: string): string; /** * True when `key` is EXPLICITLY present in the workspace's raw settings file — * i.e. the user (or a spawn flow) actually wrote it, as opposed to it falling * back to SETTINGS_DEFAULTS after the `{...defaults, ...raw}` merge. Lets callers * tell an explicit `false` apart from a defaulted `false` (e.g. resumeSession). */ export declare function hasExplicitSetting(root: string, key: keyof AutodevSettings): boolean; /** Path that should be used for reads — canonical if present, else legacy. */ export declare function settingsReadPath(root: string): string; /** Load settings, preferring `.autodev/settings.json` and falling back to the legacy `.vscode/autodev.json`. */ export declare function loadSettingsForRoot(root: string): AutodevSettings;