# boocode — AI Context Map

> **Stack:** fastify, go-net-http | none | react | typescript
> **Microservices:** @boocode/contracts, @boocode/ion, @boocode/booterm, @boocode/coder, @boocode/server, @boocode/web, codecontext, @boocode/conductor

> 131 routes (9 inferred) + 9 ws | 18 models | 69 components | 247 lib files | 39 env vars | 16 middleware
> **Token savings:** this file is ~0 tokens. Without it, AI exploration would cost ~0 tokens. **Saves ~0 tokens per conversation.**
> **Last scanned:** 2026-06-07 21:09 — re-run after significant changes

---

# Routes

## CRUD Resources

- **`/api/battles`** GET | POST | GET/:id → Battle
- **`/api/runs`** GET | POST | GET/:id → Run
- **`/api/tasks`** GET | POST | GET/:id → Task
- **`/api/chats/:id/messages`** GET | POST | GET/:id | DELETE/:id → Message
- **`/api/projects`** GET | POST | GET/:id | PATCH/:id | DELETE/:id → Project
- **`/api/sessions`** GET/:id | PATCH/:id | DELETE/:id → Session

## Other Routes

### fastify

- `GET` `/api/term/health` params()
- `POST` `/api/term/sessions/:sid/panes/:pid/start` params(sid, pid) [auth]
- `POST` `/api/term/sessions/:sid/panes/:pid/kill` params(sid, pid) [auth]
- `GET` `/ws/term/sessions/:sid/panes/:pid` params(sid, pid) [auth]
- `GET` `/api/health` params() [auth, db, queue, ai]
- `GET` `/api/sessions/:sessionId/agent-sessions` params(sessionId) [auth, db]
- `POST` `/api/battles/generate-prompt` params() [auth, db]
- `POST` `/api/battles/:id/stop` params(id) [auth, db]
- `GET` `/api/battles/:id/analysis` params(id) [auth, db]
- `POST` `/api/battles/:id/analyze` params(id) [auth, db]
- `PATCH` `/api/battles/:id/winner` params(id) [auth, db]
- `GET` `/api/battles/:id/contestants/:cid/diff` params(id, cid) [auth, db]
- `POST` `/api/battles/:id/cross-examine` params(id) [auth, db]
- `GET` `/api/sessions/:sessionId/checkpoints` params(sessionId) [auth, db]
- `POST` `/api/sessions/:sessionId/checkpoints/:checkpointId/restore` params(sessionId, checkpointId) [auth, db]
- `GET` `/api/inbox` params() [auth, db]
- `POST` `/api/inbox/:id/retry` params(id) [auth, db]
- `POST` `/api/chats/:chatId/close` params(chatId) [auth, db]
- `POST` `/api/sessions/:sessionId/close` params(sessionId) [auth, db]
- `GET` `/api/sessions/:sessionId/messages` params(sessionId) [auth, db, queue]
- `POST` `/api/sessions/:sessionId/messages` params(sessionId) [auth, db, queue]
- `POST` `/api/chats/:id/answer_user_input` params(id) [auth, db, queue]
- `POST` `/api/sessions/:sessionId/stop` params(sessionId) [auth, db, queue]
- `GET` `/api/sessions/:sessionId/pending` params(sessionId) [auth, db, queue]
- `POST` `/api/sessions/:sessionId/pending/create` params(sessionId) [auth, db, queue]
- `POST` `/api/sessions/:sessionId/pending/apply` params(sessionId) [auth, db, queue]
- `POST` `/api/pending/:id/apply` params(id) [auth, db, queue]
- `POST` `/api/pending/:id/reject` params(id) [auth, db, queue]
- `POST` `/api/pending/:id/rewind` params(id) [auth, db, queue]
- `GET` `/api/providers/snapshot` params() [db, cache]
- `GET` `/api/providers/config` params() [db, cache]
- `PATCH` `/api/providers/config` params() [db, cache]
- `POST` `/api/providers/refresh` params() [db, cache]
- `GET` `/api/providers/:id/diagnostic` params(id) [db, cache]
- `POST` `/api/runs/:id/cancel` params(id) [auth, db]
- `POST` `/api/sessions/:sessionId/skill_invoke` params(sessionId) [auth, db, queue]
- `GET` `/api/stats/costs` params() [auth, db]
- `POST` `/api/tasks/:id/cancel` params(id) [auth, db, cache, ai]
- `GET` `/api/tasks/:id/permission` params(id) [auth, db, cache, ai]
- `POST` `/api/tasks/:id/permission` params(id) [auth, db, cache, ai]
- `GET` `/api/tasks/:id/commands` params(id) [auth, db, cache, ai]
- `GET` `/api/sessions/:sessionId/worktree-risk` params(sessionId) [auth, db]
- `POST` `/api/sessions/:sessionId/worktree-stash` params(sessionId) [auth, db]
- `GET` `/api/ws/sessions/:sessionId` params(sessionId) [auth, db]
- `GET` `/api/ws/user` params() [auth, db]
- `GET` `/api/projects/:id/agents` params(id) [db, cache]
- `POST` `/api/chats/:id/messages/:msg_id/artifacts/download` params(id, msg_id) [auth, db]
- `GET` `/api/chats/:id/messages/:msg_id/html_artifact` params(id, msg_id) [auth, db]
- `GET` `/api/projects/:project_id/artifacts/:filename` params(project_id, filename) [auth, db]
- `GET` `/api/sessions/:id/chats` params(id) [auth, db]
- `POST` `/api/sessions/:id/chats` params(id) [auth, db]
- `PATCH` `/api/chats/:id` params(id) [auth, db]
- `POST` `/api/sessions/:id/chats/archive-all` params(id) [auth, db]
- `GET` `/api/sessions/:id/chats/open-count` params(id) [auth, db]
- `POST` `/api/chats/:id/archive` params(id) [auth, db]
- `POST` `/api/chats/:id/unarchive` params(id) [auth, db]
- `DELETE` `/api/chats/:id` params(id) [auth, db]
- `POST` `/api/chats/:id/fork` params(id) [auth, db]
- `POST` `/api/chats/:id/discard_stale` params(id) [auth, db]
- `GET` `/api/coder/ws/sessions/:sessionId` params(sessionId) [auth]
- `ALL` `/api/coder/*` params() [auth]
- `GET` `/api/settings/inference` params() [cache]
- `PATCH` `/api/settings/inference` params() [cache]
- `GET` `/api/sessions/:id/messages` params(id) [auth, db, queue]
- `POST` `/api/chats/:id/messages/:message_id/regenerate` params(id, message_id) [auth, db, queue]
- `POST` `/api/chats/:id/compact` params(id) [auth, db, queue]
- `POST` `/api/chats/:id/stop` params(id) [auth, db, queue]
- `POST` `/api/chats/:id/continue` params(id) [auth, db, queue]
- `POST` `/api/chats/:id/force_send` params(id) [auth, db, queue]
- `POST` `/api/chats/:id/grant_read_access` params(id) [auth, db, queue]
- `GET` `/api/models` params()
- `POST` `/api/projects/create` params() [auth, db]
- `POST` `/api/projects/:id/archive` params(id) [auth, db]
- `POST` `/api/projects/:id/unarchive` params(id) [auth, db]
- `GET` `/api/projects/available` params() [auth, db]
- `GET` `/api/projects/:id/list_dir` params(id) [auth, db]
- `GET` `/api/projects/:id/view_file` params(id) [auth, db]
- `GET` `/api/projects/:id/git` params(id) [auth, db]
- `GET` `/api/projects/:id/git/diff` params(id) [auth, db]
- `POST` `/api/projects/:id/git/stage` params(id) [auth, db]
- `POST` `/api/projects/:id/git/unstage` params(id) [auth, db]
- `POST` `/api/projects/:id/git/commit` params(id) [auth, db]
- `POST` `/api/projects/:id/git/discard` params(id) [auth, db]
- `POST` `/api/projects/:id/write_file` params(id) [auth, db]
- `GET` `/api/projects/:id/files` params(id) [auth, db]
- `GET` `/api/projects/:id/sessions` params(id) [auth, db]
- `POST` `/api/projects/:id/sessions` params(id) [auth, db]
- `PATCH` `/api/sessions/:id/workspace` params(id) [auth, db]
- `POST` `/api/projects/:id/sessions/archive-all` params(id) [auth, db]
- `GET` `/api/projects/:id/sessions/open-count` params(id) [auth, db]
- `POST` `/api/sessions/:id/archive` params(id) [auth, db]
- `POST` `/api/sessions/:id/unarchive` params(id) [auth, db]
- `GET` `/api/settings` params() [db]
- `PATCH` `/api/settings` params() [db]
- `GET` `/api/sidebar` params() [auth, db]
- `GET` `/api/skills` params() [auth, db, queue]
- `POST` `/api/chats/:id/skill_invoke` params(id) [auth, db, queue]
- `GET` `/api/tools/cost_stats` params() [auth, db]
- `GET` `/api/ws/sessions/:id` params(id) [auth, db]

### go-net-http

- `GET` `/health` params() [queue]
- `POST` `/v1/get_codebase_overview` params() [queue]
- `POST` `/v1/get_file_analysis` params() [queue]
- `POST` `/v1/get_symbol_info` params() [queue]
- `POST` `/v1/search_symbols` params() [queue]
- `POST` `/v1/get_dependencies` params() [queue]
- `POST` `/v1/watch_changes` params() [queue]
- `POST` `/v1/get_semantic_neighborhoods` params() [queue]
- `POST` `/v1/get_framework_analysis` params() [queue]
- `POST` `/v1/get_symbol_details` params() [queue]
- `POST` `/v1/get_call_graph` params() [queue]
- `POST` `/v1/get_blast_radius` params() [queue]

## WebSocket Events

- `WS` `message` — `apps/booterm/src/ws/attach.ts`
- `WS` `close` — `apps/booterm/src/ws/attach.ts`
- `WS` `message` — `apps/coder/src/cli.ts`
- `WS` `error` — `apps/coder/src/cli.ts`
- `WS` `close` — `apps/coder/src/cli.ts`
- `WS` `close` — `apps/coder/src/routes/ws.ts`
- `WS` `error` — `apps/coder/src/routes/ws.ts`
- `WS` `close` — `apps/server/src/routes/ws.ts`
- `WS` `error` — `apps/server/src/routes/ws.ts`

---

# Schema

### pending_changes
- id: uuid (pk)
- session_id: uuid (required, fk)
- task_id: uuid (fk)
- file_path: text (required)
- operation: text (required)
- diff: text (required)
- status: text (required)

### tasks
- id: uuid (pk)
- project_id: uuid (required, fk)
- parent_task_id: uuid (fk)
- state: text (required)
- input: text (required)
- output_summary: text
- agent: text
- model: text
- execution_path: text
- cost_tokens: integer
- started_at: timestamp(tz)
- ended_at: timestamp(tz)

### available_agents
- name: text (pk)
- install_path: text
- version: text
- supports_acp: boolean (required)
- last_probed_at: timestamp(tz)

### agent_sessions
- session_id: uuid (required, fk)
- agent: text (required)
- backend: text (required)
- agent_session_id: text (fk)
- server_port: integer
- status: text (required)
- last_active_at: timestamp(tz)

### worktrees
- id: uuid (pk)
- session_id: uuid (fk)
- project_id: uuid (fk)
- path: text (required)
- branch: text
- base_commit: text
- slug: text
- status: text (required)

### checkpoints
- id: uuid (pk)
- chat_id: uuid (required, fk)
- session_id: uuid (fk)
- worktree_id: uuid (fk)
- message_id: uuid (fk)

### claude_session_entries
- id: bigint(auto) (pk)
- project_key: text (required)
- session_id: text (required, fk)
- subpath: text (required)

### flow_runs
- id: uuid (pk)
- project_id: uuid (required, fk)
- flow_name: text (required)
- band: text (required)
- model: text (required)
- status: text (required)
- input: jsonb (required)
- report: text
- error: text

### flow_steps
- id: uuid (pk)
- run_id: uuid (required, fk)
- step_id: text (required, fk)
- kind: text (required)
- agent: text
- status: text (required)
- task_id: uuid (fk)
- chat_id: uuid (fk)
- input: text
- output: text
- error: text

### battles
- id: uuid (pk)
- project_id: uuid (required, fk)
- battle_type: text (required)
- prompt: text (required)
- status: text (required)
- winner_contestant_id: uuid (fk)
- results_path: text
- error: text

### contestants
- id: uuid (pk)
- battle_id: uuid (required, fk)
- identity: text (required)
- model: text (required)
- lane: text (required)
- task_id: uuid (fk)
- worktree_id: uuid (fk)
- status: text (required)
- duration_ms: integer
- tokens_per_sec: float8
- cost_tokens: integer
- result_path: text
- error: text

### cross_examinations
- id: uuid (pk)
- battle_id: uuid (required, fk)
- identity: text (required)
- model: text (required)
- verdict: text

### projects
- id: uuid (pk)
- name: text (required)
- path: text (required)
- added_at: timestamp(tz) (required)
- last_session_id: uuid (fk)

### sessions
- id: uuid (pk)
- project_id: uuid (required, fk)
- name: text (required)
- model: text (required)
- system_prompt: text (required)

### messages
- id: uuid (pk)
- session_id: uuid (required, fk)
- role: text (required)
- content: text (required)
- status: text (required)
- last_seq: integer (required)

### message_parts
- id: uuid (pk)
- message_id: uuid (required, fk)
- sequence: integer (required)
- kind: text (required)
- payload: jsonb (required)

### settings
- value: jsonb (required)

### chats
- id: uuid (pk)
- session_id: uuid (required, fk)
- name: text
- status: text (required)

---

# Components

- **App** — `apps/web/src/App.tsx`
- **AddProjectModal** — props: open, onOpenChange, onAdded — `apps/web/src/components/AddProjectModal.tsx`
- **AgentComposerBar** — props: projectPath, value, onChange, onProviderCommandsChange, connected, agentStatus — `apps/web/src/components/AgentComposerBar.tsx`
- **AgentPicker** — props: projectId, value, onChange — `apps/web/src/components/AgentPicker.tsx`
- **ArenaLauncherDialog** — `apps/web/src/components/ArenaLauncherDialog.tsx`
- **ArtifactPaneHeader** — props: title, defaultTitle, onDownload, downloadDisabled, onClose, onCopy, justCopied, copyDisabled — `apps/web/src/components/ArtifactPaneHeader.tsx`
- **AskUserInputCard** — props: toolCall, toolResult, chatId, apiPrefix — `apps/web/src/components/AskUserInputCard.tsx`
- **AttachmentChip** — props: attachment, onRemove, onPreview — `apps/web/src/components/AttachmentChip.tsx`
- **AttachmentPreviewModal** — props: attachment, onClose — `apps/web/src/components/AttachmentPreviewModal.tsx`
- **BottomSheet** — props: open, onClose, title — `apps/web/src/components/BottomSheet.tsx`
- **CapHitSentinel** — props: message, capHitPosition, isLatest — `apps/web/src/components/CapHitSentinel.tsx`
- **ChatInput** — props: disabled, projectId, agentId, onAgentChange, sessionId, webSearchEnabled, onSend, onForceSend, generating, onStop — `apps/web/src/components/ChatInput.tsx`
- **ChatTabBar** — props: pane, tabs, tabNumbers, onSwitchTab, onRemoveTab, onCloseOthers, onCloseToRight, onCloseAll, onNewTab, onSplitPane — `apps/web/src/components/ChatTabBar.tsx`
- **ChatThroughput** — props: chatId, className — `apps/web/src/components/ChatThroughput.tsx`
- **CodeBlock** — props: code, lang — `apps/web/src/components/CodeBlock.tsx`
- **ContextMeter** — props: messages, modelContextLimit, sessionCostUsd — `apps/web/src/components/ContextMeter.tsx`
- **CreateProjectModal** — props: open, onOpenChange — `apps/web/src/components/CreateProjectModal.tsx`
- **DoomLoopSentinel** — props: message — `apps/web/src/components/DoomLoopSentinel.tsx`
- **DropOverlay** — props: visible — `apps/web/src/components/DropOverlay.tsx`
- **FileMentionPopover** — props: query, files, anchorRect, onSelect, onClose — `apps/web/src/components/FileMentionPopover.tsx`
- **FileViewerOverlay** — props: path, content, lang, onClose — `apps/web/src/components/FileViewerOverlay.tsx`
- **FlowLauncherDialog** — `apps/web/src/components/FlowLauncherDialog.tsx`
- **GitDiffView** — props: result, loading, error, mode, onSelectMode, onRefresh, mutating, mutateError, onStage, onUnstage — `apps/web/src/components/GitDiffView.tsx`
- **HtmlArtifactPane** — props: chatId, state, onClose — `apps/web/src/components/HtmlArtifactPane.tsx`
- **InferenceSettings** — `apps/web/src/components/InferenceSettings.tsx`
- **MarkdownArtifactPane** — props: chatId, state, onClose — `apps/web/src/components/MarkdownArtifactPane.tsx`
- **MarkdownRenderer** — props: content — `apps/web/src/components/MarkdownRenderer.tsx`
- **MessageBubble** — props: message, sessionChats, capHitInfo, actions, hideActions, hasCheckpoint, restoreDisabled — `apps/web/src/components/MessageBubble.tsx`
- **MessageList** — props: messages, sessionChats — `apps/web/src/components/MessageList.tsx`
- **MobileTabSwitcher** — props: panes, activePaneIdx, chats, onSwitchPane, onRemovePane, onRenameChat — `apps/web/src/components/MobileTabSwitcher.tsx`
- **ModelPicker** — props: value, onChange — `apps/web/src/components/ModelPicker.tsx`
- **NewPaneMenu** — props: onAddPane, disabled, projectId — `apps/web/src/components/NewPaneMenu.tsx`
- **PaneHeaderActions** — props: onNewTab, onSplitPane, onNewOrchestrator, onNewArena, onReopenPane, onShowHistory, onRemovePane, historyActive, className — `apps/web/src/components/PaneHeaderActions.tsx`
- **PermissionCard** — props: prompt, onRespond, busy — `apps/web/src/components/PermissionCard.tsx`
- **ProjectSidebar** — `apps/web/src/components/ProjectSidebar.tsx`
- **RequestReadAccessCard** — props: toolCall, toolResult, chatId — `apps/web/src/components/RequestReadAccessCard.tsx`
- **RightRail** — props: projectId, sessionId — `apps/web/src/components/RightRail.tsx`
- **SessionLandingPage** — props: projectId, sessionId, agentId, onAgentChange, onSend, onSkillInvoke, createChat, chats, onOpenChat, onUnarchiveChat — `apps/web/src/components/SessionLandingPage.tsx`
- **SlashCommandPicker** — props: query, items, groups, inputRef, onSelect, onClose, emptyLabel — `apps/web/src/components/SlashCommandPicker.tsx`
- **StaleStreamBanner** — props: onRetry, onDiscard — `apps/web/src/components/StaleStreamBanner.tsx`
- **StatusDot** — props: chatId, className — `apps/web/src/components/StatusDot.tsx`
- **ThemePicker** — `apps/web/src/components/ThemePicker.tsx`
- **ToolCallGroup** — props: runs — `apps/web/src/components/ToolCallGroup.tsx`
- **ToolCallLine** — props: run, insideGroup — `apps/web/src/components/ToolCallLine.tsx`
- **Workspace** — props: sessionId, projectId, agentId, onAgentChange, panesHook, chatsHook, session, project, onAddPane — `apps/web/src/components/Workspace.tsx`
- **AddProviderModal** — props: open, onOpenChange, onAdded — `apps/web/src/components/coder/AddProviderModal.tsx`
- **ProvidersSettings** — `apps/web/src/components/coder/ProvidersSettings.tsx`
- **MatrixRain** — props: enabled, density, speed, opacity — `apps/web/src/components/fx/MatrixRain.tsx`
- **NeonField** — props: enabled, opacity, speed — `apps/web/src/components/fx/NeonField.tsx`
- **ThemeFx** — `apps/web/src/components/fx/ThemeFx.tsx`
- **ClaudeIcon** — props: size, className — `apps/web/src/components/icons/ProviderIcons.tsx`
- **OpenCodeIcon** — props: size, className — `apps/web/src/components/icons/ProviderIcons.tsx`
- **ArenaPane** — props: state, onClose — `apps/web/src/components/panes/ArenaPane.tsx`
- **ChatPane** — props: sessionId, chatId, projectId, agentId, onAgentChange, sessionChats, webSearchEnabled — `apps/web/src/components/panes/ChatPane.tsx`
- **CoderMessageList** — props: messages, chatId, footer, actions, checkpointMessageIds, restoreDisabled — `apps/web/src/components/panes/CoderMessageList.tsx`
- **CoderPane** — props: sessionId, paneId, chatId, chatPending, projectPath, onConnectedChange, onAgentLabelChange — `apps/web/src/components/panes/CoderPane.tsx`
- **OrchestratorPane** — props: state, onClose — `apps/web/src/components/panes/OrchestratorPane.tsx`
- **SettingsPane** — props: session, project, maximized, onToggleMaximize, onClose, isMobile — `apps/web/src/components/panes/SettingsPane.tsx`
- **TerminalPane** — props: sessionId, paneId, label, active — `apps/web/src/components/panes/TerminalPane.tsx`
- **FloatingMenu** — props: x, y, hasSelection, chatInputs, onCopy, onPaste, onSelectAll, onSearch, onSendToChat, onDismiss — `apps/web/src/components/panes/terminal/FloatingMenu.tsx`
- **SearchBar** — props: searchRef, theme, onClose — `apps/web/src/components/panes/terminal/SearchBar.tsx`
- **TerminalHotkeyBar** — props: ctrlArmed, onSendBytes, onArmCtrl, onFit — `apps/web/src/components/panes/terminal/TerminalHotkeyBar.tsx`
- **RightRailDrawerProvider** — `apps/web/src/hooks/useRightRailDrawer.tsx`
- **SidebarDrawerProvider** — `apps/web/src/hooks/useSidebarDrawer.tsx`
- **PATH_REGEX** — `apps/web/src/lib/linkify-paths.tsx`
- **Home** — `apps/web/src/pages/Home.tsx`
- **Project** — `apps/web/src/pages/Project.tsx`
- **Session** — `apps/web/src/pages/Session.tsx`
- **Settings** — `apps/web/src/pages/Settings.tsx`

---

# Libraries

- `apps/booterm/src/auth.ts` — function getUser: (req) => string
- `apps/booterm/src/config.ts` — function loadConfig: () => Config
- `apps/booterm/src/db.ts`
  - function getPool: (databaseUrl) => pg.Pool
  - function getSessionInfo: (sessionId) => Promise<SessionInfo | null>
  - function pingDb: () => Promise<boolean>
  - function closeDb: () => Promise<void>
- `apps/booterm/src/pty/manager.ts`
  - function sanitizeId: (raw) => string | null
  - function tmuxSessionName: (paneId) => string
  - function hasSession: (tmuxConfPath, sessionName) => Promise<boolean>
  - function ensureSession: (tmuxConfPath, sessionName, projectRoot, log, cols?, rows?) => Promise<void>
  - function killSession: (tmuxConfPath, sessionName) => Promise<boolean>
  - function capturePane: (tmuxConfPath, sessionName, lines) => Promise<string>
- `apps/booterm/src/pty/pty.ts` — function attachPty: (opts) => IPty
- `apps/booterm/src/ws/attach.ts` — function registerWsAttachRoute: (app, tmuxConfPath) => void
- `apps/coder/src/conductor/contracts.ts`
  - function produceContract: (contracts) => string
  - function reviewContract: (contracts) => string
  - type Contract
  - const EVIDENCE_PRODUCE
  - const EVIDENCE_REVIEW
  - const YAGNI_PRODUCE
  - _...1 more_
- `apps/coder/src/conductor/flows/_util.ts` — function q, function repoLine
- `apps/coder/src/conductor/flows/index.ts`
  - function describeFlows: () => string
  - function getFlow: (name) => Flow | undefined
  - const FLOWS: Record<string, Flow>
  - const FLOW_NAMES: string[]
- `apps/coder/src/conductor/persona-loader.ts` — function loadPersona: (agent) => Promise<string>, const AGENTS_DIR
- `apps/coder/src/conductor/render.ts` — function slugify: (s) => string
- `apps/coder/src/conductor/spine.ts`
  - function readBand: (input) => Band
  - function fastNote: (ctx) => string
  - function buildSpineFlow: (spine) => Flow
- `apps/coder/src/config.ts` — function loadConfig: () => Config, type Config
- `apps/coder/src/db.ts`
  - function getSql: (config) => Sql
  - function applySchema: (sql) => Promise<void>
  - function pingDb: (sql) => Promise<boolean>
  - function closeDb: () => Promise<void>
  - type Sql
- `apps/coder/src/plugins/host.ts`
  - function registerHook: (name, fn) => void
  - function emitHook: (name, ctx) => Promise<any>
  - function clearHooks: () => void
  - interface ToolHookContext
  - interface ToolResultContext
  - type HookName
  - _...1 more_
- `apps/coder/src/services/acp-client-fs.ts` — function readWorktreeTextFile: (worktreePath, filePath, line?, limit?) => Promise<string>, function writeWorktreeTextFile: (worktreePath, filePath, content) => Promise<void>
- `apps/coder/src/services/acp-client.ts` — function buildAcpClient: (worktreePath, resolveTurn) => void, interface AcpTurnContext
- `apps/coder/src/services/acp-derive.ts`
  - function deriveModesFromACP: (fallbackModes, modeState?, configOptions?) => void
  - function deriveModelDefinitionsFromACP: (models, configOptions?) => ProviderModel[]
  - function findThoughtLevelConfigId: (configOptions) => string | null
- `apps/coder/src/services/acp-dispatch.ts`
  - function dispatchViaAcp: (opts) => Promise<AcpDispatchResult>
  - interface AcpDispatchResult
  - interface AcpDispatchOpts
- `apps/coder/src/services/acp-event-map.ts` — function mapSessionUpdate: (params, priorSnapshots, AcpToolSnapshot>) => void
- `apps/coder/src/services/acp-probe.ts` — function probeAcpProvider: (agent, installPath, cwd) => Promise<AcpProbeResult>, interface AcpProbeResult
- `apps/coder/src/services/acp-spawn.ts`
  - function resolveAcpSpawnArgs: (agent) => string[] | null
  - function resolveLaunchSpec: (resolved, installPath) => void
  - function resolveAcpProbeBinaries: (agent) => string[]
- `apps/coder/src/services/acp-stream.ts` — function createAcpNdJsonStream: (child) => void
- `apps/coder/src/services/acp-tool-snapshot.ts`
  - function mergeToolSnapshot: (toolCallId, update, previous?) => AcpToolSnapshot
  - function mapToolLifecycleStatus: (status, rawOutput?) => AcpToolLifecycleStatus
  - function snapshotToWireToolCall: (snapshot) => void
  - function snapshotToPartPayload: (snapshot) => void
  - function synthesizeCanceledSnapshots: (snapshots) => AcpToolSnapshot[]
  - interface AcpToolSnapshot
  - _...2 more_
- `apps/coder/src/services/agent-commands-cache.ts`
  - function setTaskCommands: (taskId, commands) => void
  - function mergeTaskCommands: (taskId, commands) => void
  - function getTaskCommands: (taskId) => AgentCommand[] | null
  - function clearTaskCommands: (taskId) => void
- `apps/coder/src/services/agent-pool.ts`
  - class AgentPool
  - interface AgentPoolOpts
  - const OPENCODE_POOL_KEY
  - const agentPool
- `apps/coder/src/services/agent-probe.ts` — function probeAgents: (sql, log) => Promise<void>
- `apps/coder/src/services/agent-status-publish.ts` — function publishAgentStatus: (publishFrame, sessionId, chatId, agent, status, reason?, at) => void
- `apps/coder/src/services/agent-turn-persist.ts` — function persistExternalAgentTurn: (sql, assistantMessageId, snapshots, reasoningText) => Promise<void>
- `apps/coder/src/services/arena-analyzer-helpers.ts`
  - function buildDigestPrompt: (input) => void
  - function buildJudgePrompt: (originalPrompt, digests) => void
  - function shouldNameWinner: (succeededCount) => boolean
  - function extractWinner: (judgeOutput) => void
  - function buildCrossExamPrompt: (opts) => void
  - interface ContestantDigestInput
  - _...1 more_
- `apps/coder/src/services/arena-analyzer.ts` — function createAnalyzer: (deps) => Analyzer, interface Analyzer
- `apps/coder/src/services/arena-decisions.ts`
  - function classifyLane: (battleType, _identity, model, localModels) => ContestantLane
  - function nextLocalContestant: (contestants) => string | null
  - function isBattleComplete: (contestants) => boolean
  - function computeBenchmark: (startedAt, endedAt, costTokens, lane) => Benchmark
  - function sanitizeSlug: (s) => string
  - function buildBattleSlug: (battleId, battleType, createdAt) => string
  - _...7 more_
- `apps/coder/src/services/arena-model-call.ts` — function arenaModelCall: (opts, 'LLAMA_SWAP_URL'>;
  model) => Promise<string>
- `apps/coder/src/services/arena-runner.ts`
  - function createBattleRunner: (deps) => BattleRunner
  - interface ContestantSpec
  - interface BattleStartOpts
  - interface BattleRunner
  - type DispatchContestantFn
  - type OnBattleComplete
  - _...1 more_
- `apps/coder/src/services/audit-session.ts`
  - function generateSessionId: () => string
  - function getCurrentSession: (basePath?) => Promise<string | null>
  - function getSessionJson: (sessionId, basePath?) => Promise<SessionJson | null>
  - function getIndex: (basePath?) => Promise<IndexJson | null>
  - function startSession: (task, basePath?) => Promise<StartSessionResult>
  - function endSession: (basePath?) => Promise<EndSessionResult | null>
  - _...18 more_
- `apps/coder/src/services/backends/claude-sdk-map.ts`
  - function createClaudeSdkMapState: () => ClaudeSdkMapState
  - function mapSdkMessage: (msg, state) => AgentEvent[]
  - interface ClaudeSdkMapState
- `apps/coder/src/services/backends/claude-sdk-routing.ts` — function claudeSdkBackendEnabled: (env) => boolean, function shouldUseClaudeSdk: (task, env) => boolean
- `apps/coder/src/services/backends/claude-sdk.ts` — class ClaudeSdkBackend, interface ClaudeSdkBackendDeps
- `apps/coder/src/services/backends/claude-session-store.ts` — class PostgresSessionStore
- `apps/coder/src/services/backends/lifecycle-decisions.ts`
  - function selectIdleEvictionTargets: (entries, now, ttlMs) => string[]
  - function selectLruEvictionTargets: (entries, cap) => string[]
  - function decideRestart: (input) => RestartDecision
  - function selectOrphanWorktreeTargets: (onDisk, liveWorktreePaths, now, graceMs) => string[]
  - interface PoolEntrySnapshot
  - interface RestartDecisionInput
  - _...7 more_
- `apps/coder/src/services/backends/opencode-event-map.ts`
  - function stripDcpTags: (s) => string
  - function eventSessionId: (ev) => string | null
  - function resolvePartDedupeKey: (part, type) => string | null
  - function mapToolStatus: (s) => ToolCallStatus | null
  - function toolPartToSnapshot: (part) => AcpToolSnapshot
  - function toolCalledSnapshot: (p) => AcpToolSnapshot
  - _...7 more_
- `apps/coder/src/services/backends/opencode-server-process.ts`
  - function shouldStartServer: (s) => boolean
  - class OpenCodeServerSupervisor
  - interface ServerDownInfo
  - interface SupervisorHooks
  - interface OpenCodeServerSupervisorDeps
- `apps/coder/src/services/backends/opencode-server.ts` — class OpenCodeServerBackend, interface OpenCodeServerBackendDeps
- `apps/coder/src/services/backends/opencode-sse.ts`
  - function reconnectDecision: (failures, policy) => ReconnectDecision
  - function startSessionEventLoop: (state, deps) => void
  - function runSessionEventLoop: (state, abort, deps) => Promise<void>
  - interface TurnState
  - interface SessionState
  - interface ReconnectPolicy
  - _...4 more_
- `apps/coder/src/services/backends/opencode-usage.ts`
  - function stepEndedToUsage: (props) => StepUsage
  - interface StepEndedProps
  - interface StepUsage
- `apps/coder/src/services/backends/pushable-iterable.ts` — function createPushable: () => Pushable<T>, interface Pushable
- `apps/coder/src/services/backends/turn-guard.ts`
  - function armAbortGuard: (g) => void
  - function noteTurnActivity: (g) => void
  - function consumeTerminal: (g) => 'swallow' | 'settle'
  - interface AbortTerminalGuard
- `apps/coder/src/services/backends/warm-acp-routing.ts` — function shouldUseWarmBackend: (task) => boolean, function isTurnOkForStopReason: (stopReason) => boolean
- `apps/coder/src/services/backends/warm-acp.ts` — class WarmAcpBackend, interface WarmAcpBackendDeps
- `apps/coder/src/services/cancel-registry.ts` — function createCancelRegistry: () => CancelRegistry, interface CancelRegistry
- `apps/coder/src/services/checkpoints.ts`
  - function buildShadowCommitCommand: (worktreePath, id) => string
  - function createCheckpoint: (sql, args, opts?) => Promise<
  - function restoreCheckpoint: (sql, checkpointId, opts?) => Promise<RestoreCheckpointResult>
  - class CheckpointNotFoundError
  - interface CreateCheckpointArgs
  - interface RestoreCheckpointResult
  - _...1 more_
- `apps/coder/src/services/claude-command-discovery.ts` — function discoverClaudeCommands: () => AgentCommand[]
- `apps/coder/src/services/command-availability.ts` — function isCommandAvailable: (binary) => Promise<boolean>
- `apps/coder/src/services/correction-service.ts`
  - function recordCorrection: (originalClaim, correction, principleExtracted, persistedTo, basePath?) => Promise<UserCorrectionRecord>
  - function scanForCorrections: (auditPath) => Promise<UserCorrectionRecord[]>
  - function checkContradiction: (action, corrections) => void
  - function markPersisted: (correctionId, filePath, basePath?) => Promise<UserCorrectionRecord | null>
  - function listCorrections: (basePath?) => Promise<UserCorrectionRecord[]>
  - function appendCorrectionToTrail: (trailPath, correction) => Promise<void>
  - _...2 more_
- `apps/coder/src/services/dcp-strip.ts`
  - function stripDcpTags: (s) => string
  - function makeDcpStreamStripper: () => DcpStreamStripper
  - interface DcpStreamStripper
- `apps/coder/src/services/dispatcher.ts` — function createDispatcher: (deps) => void
- `apps/coder/src/services/edit-guards-imports.ts` — function checkDroppedImports: (original, updated, filePath) => ImportCheckResult, interface ImportCheckResult
- `apps/coder/src/services/edit-guards.ts`
  - function validateEditResult: (original, updated, filePath) => GuardResult
  - function formatGuardError: (guard, filePath) => string
  - interface GuardResult
- `apps/coder/src/services/finalize-message.ts`
  - function classifyTerminalStatus: (opts) => TerminalMessageStatus
  - function finalizeStreamingMessage: (sql, publishFrame, frame) => void
  - type TerminalMessageStatus
- `apps/coder/src/services/flow-artifacts.ts` — function getArtifactPath: (flowRunId, stepId) => string, function writeFlowArtifact: (flowRunId, stepId, content) => Promise<string>
- `apps/coder/src/services/flow-runner-decisions.ts`
  - function manifestSteps: (flow, launchCtx) => Step[]
  - function readySteps: (flow, state) => Step[]
  - function partitionReady: (ready, ctx) => void
  - function isRunComplete: (flow, state) => boolean
  - function isStuck: (flow, state) => boolean
  - function reconcileResumeStep: (status, taskId, taskState) => ResumeAction
  - _...5 more_
- `apps/coder/src/services/flow-runner.ts`
  - function createFlowRunner: (deps) => FlowRunner
  - interface LaunchOpts
  - interface FlowRunner
- `apps/coder/src/services/frame-emitter.ts`
  - function makeFrameEmitter: (opts) => FrameEmitter
  - interface FrameEmitterOpts
  - interface FrameEmitter
- `apps/coder/src/services/fuzzy-match.ts`
  - function locateMatch: (content, needle) => MatchResult
  - type MatchResult
  - const SIMILARITY_THRESHOLD
  - const AMBIGUITY_EPSILON
- `apps/coder/src/services/guideline-service.ts`
  - function createGuideline: (params, basePath?) => Promise<Guideline>
  - function listGuidelines: (filter?, basePath?) => Promise<Guideline[]>
  - function readGuideline: (id, basePath?) => Promise<Guideline | null>
  - function updateGuideline: (id, params, basePath?) => Promise<Guideline | null>
  - function deleteGuideline: (id, basePath?) => Promise<boolean>
  - function findGuideline: (content, basePath?) => Promise<Guideline | null>
  - _...14 more_
- `apps/coder/src/services/host-exec.ts` — function hostExec: (command, opts?) => Promise<HostExecResult>, interface HostExecResult
- `apps/coder/src/services/lsp/client.ts` — class LspClient
- `apps/coder/src/services/lsp/config.ts` — function getServerConfig: (filePath) => LspServerConfig | null, interface LspServerConfig
- `apps/coder/src/services/lsp/operations.ts`
  - function openDocument: (client, filePath, content, version) => Promise<void>
  - function closeDocument: (client, filePath) => Promise<void>
  - function getDiagnostics: (client, filePath, content) => Promise<Diagnostic[]>
  - function gotoDefinition: (client, filePath, content, line, character) => Promise<Location | null>
  - function findReferences: (client, filePath, content, line, character) => Promise<Location[]>
- `apps/coder/src/services/lsp/server-manager.ts` — class LspServerManager, const lspManager
- `apps/coder/src/services/mcp-server.ts` — function startMcpServer: (sql) => Promise<void>
- `apps/coder/src/services/net/port-utils.ts`
  - function reclaimPort: (port) => void
  - function waitForPortRelease: (port, timeoutMs) => Promise<boolean>
  - function freePort: () => Promise<number>
- `apps/coder/src/services/orphan-worktree-reaper.ts`
  - function reapOrphanWorktrees: (sql, log, graceMs, now) => void
  - function createOrphanWorktreeReaper: (deps) => void
  - interface OrphanWorktreeReaperDeps
  - interface OrphanReaperResult
- `apps/coder/src/services/pending_changes.ts`
  - function planEdit: (content, oldStr, newStr) => EditPlan
  - function queueEdit: (sql, sessionId, taskId, filePath, oldString, newString, projectRoot, // v2.6 Phase 1-UX) => void
  - function queueCreate: (sql, sessionId, taskId, filePath, content, projectRoot, // See queueEdit) => Promise<PendingChange>
  - function queueDelete: (sql, sessionId, taskId, filePath, projectRoot, // See queueEdit) => Promise<PendingChange>
  - function applyOne: (sql, changeId, projectRoot) => Promise<ApplyResult>
  - function applyAll: (sql, sessionId, projectRoot) => Promise<ApplyResult[]>
  - _...6 more_
- `apps/coder/src/services/permission-waiter.ts`
  - function setPermissionHooks: (next) => void
  - function waitForPermissionResponse: (taskId, sessionId, provider, modeId, params, timeoutMs) => Promise<RequestPermissionResponse>
  - function respondToPermission: (taskId, optionId, updatedInput?, unknown>) => boolean
  - function getPendingPermission: (taskId) => PermissionPrompt | null
  - function waitForElicitationResponse: (taskId, sessionId, provider, modeId, params, timeoutMs) => Promise<CreateElicitationResponse>
  - function cancelPendingPermission: (taskId) => void
  - _...3 more_
- `apps/coder/src/services/provider-commands.ts`
  - function getManifestCommands: (provider) => AgentCommand[]
  - function mergeCommands: (...lists) => AgentCommand[]
  - const PROVIDER_COMMANDS: Record<string, AgentCommand[]>
- `apps/coder/src/services/provider-config-registry.ts`
  - function buildResolvedRegistry: (builtins, config) => Map<string, ResolvedProviderDef>
  - function loadProviderConfig: (path) => Map<string, ResolvedProviderDef>
  - function reloadProviderConfig: () => Map<string, ResolvedProviderDef>
  - function getResolvedRegistry: () => Map<string, ResolvedProviderDef>
  - interface ResolvedProviderDef
- `apps/coder/src/services/provider-config.ts`
  - function mergeProviderConfigPatch: (current, patch) => CoderProvidersFile
  - function load: (path) => CoderProvidersFile
  - function save: (path, config) => void
- `apps/coder/src/services/provider-diagnostic.ts` — function getProviderDiagnostic: (resolved, agentRow, opts) => Promise<string>, interface DiagnosticAgentRow
- `apps/coder/src/services/provider-manifest.ts`
  - function getManifestModes: (provider) => ProviderMode[]
  - function getManifestDefaultModeId: (provider) => string | null
  - function isUnattendedMode: (provider, modeId) => boolean
  - interface ProviderManifestEntry
  - const PROVIDER_MANIFEST: Record<string, ProviderManifestEntry>
- `apps/coder/src/services/provider-snapshot.ts`
  - function fetchLlamaSwapModels: (config) => Promise<ProviderModel[]>
  - function prefixLlamaSwapModels: (models) => ProviderModel[]
  - function mergeModels: (...lists) => ProviderModel[]
  - function getProviderSnapshot: (sql, config, cwd?, force) => Promise<ProviderSnapshotEntry[]>
  - function clearProviderSnapshotCache: () => void
  - function peekSnapshotEntry: (name, cwd?) => ProviderSnapshotEntry | undefined
  - _...1 more_
- `apps/coder/src/services/pty-dispatch.ts`
  - function dispatchViaPty: (opts) => Promise<DispatchResult>
  - interface DispatchResult
  - interface PtyDispatchOpts
- `apps/coder/src/services/qwen-settings.ts` — function readQwenSettingsModels: () => Promise<ProviderModel[]>
- `apps/coder/src/services/stream-json-parser.ts`
  - function makeStreamJsonState: () => StreamJsonState
  - function parseStreamJsonLine: (line, state) => AgentEvent[]
  - function makeStreamJsonParser: () => StreamJsonParser
  - interface StreamJsonUsage
  - interface StreamJsonState
  - interface StreamJsonParser
  - _...1 more_
- `apps/coder/src/services/token-analysis/analyzer.ts` — function analyzeMessages: (parts) => TokenBreakdown, interface TokenBreakdown
- `apps/coder/src/services/token-analysis/persist.ts`
  - function persistTaskBreakdown: (sql, taskId, breakdown) => Promise<void>
  - function getTaskBreakdown: (sql, taskId) => Promise<TokenBreakdown | null>
  - function analyzeAndPersistTaskBreakdown: (sql, taskId, parts) => Promise<TokenBreakdown>
- `apps/coder/src/services/tools/adapter.ts` — function adaptWriteTool: (tool) => ServerToolDef<any>
- `apps/coder/src/services/tools/inference_context.ts`
  - function runWithInferenceContext: (ctx, fn) => void
  - function getInferenceContext: () => InferenceContext
  - interface InferenceContext
- `apps/coder/src/services/tools/types.ts`
  - function asPermissionMode: (id) => PermissionMode | undefined
  - interface ToolJsonSchema
  - interface ToolContext
  - interface ToolDef
  - type PermissionMode
- `apps/coder/src/services/tools/write-gate.ts` — function denyReadOnly: (operation) => unknown, function finalizeWrite: (context, projectRoot, change, queuedHint) => Promise<unknown>
- `apps/coder/src/services/worktree-risk.ts` — function checkWorktreeWorkAtRisk: (worktreePath, opts?) => Promise<WorktreeRiskReport>, function stashWorktree: (worktreePath, opts?) => Promise<
- `apps/coder/src/services/worktrees.ts`
  - function createWorktree: (projectPath, taskId, opts?) => Promise<string>
  - function diffWorktree: (worktreePath, projectPath, opts?) => Promise<string>
  - function cleanupWorktree: (projectPath, taskId) => Promise<void>
  - function ensureSessionWorktree: (sql, projectPath, sessionId, opts?) => Promise<SessionWorktree>
  - function removeSessionWorktree: (sql, projectPath, worktree, opts?) => Promise<void>
  - function closeChatBackendState: (sql, chatId, opts?) => Promise<ChatCloseResult>
  - _...4 more_
- `apps/coder/src/services/write_guard.ts`
  - function isSecretPath: (filePath) => boolean
  - function resolveWritePath: (projectRoot, filePath) => string
  - class WriteGuardError
- `apps/server/src/config.ts` — function loadConfig: () => Config, type Config
- `apps/server/src/db.ts`
  - function getSql: (config) => Sql
  - function applySchema: (sql) => Promise<void>
  - function pingDb: (sql) => Promise<boolean>
  - function closeDb: () => Promise<void>
  - type Sql
- `apps/server/src/services/agents.ts`
  - function refreshToolNames: () => void
  - function matchToolGlob: (toolName, patterns) => boolean
  - function slugify: (name) => string
  - function parseAgentsMd: (content) => ParseResult
  - function isAgentRegistryMarkdown: (content) => boolean
  - function getAgentsMtimes: (projectPath) => void
  - _...2 more_
- `apps/server/src/services/artifacts.ts`
  - function deriveMarkdownSlug: (messageContent) => string
  - function deriveHtmlSlug: (payload) => string
  - function deriveHtmlTitle: (html) => string | null
  - function detectHtmlArtifact: (text) => string | null
  - function decideHtmlArtifactWrite: (htmlContent) => HtmlArtifactDecision
  - function writeMarkdownArtifact: (message, 'content'>, ctx) => Promise<ArtifactWriteResult>
  - _...6 more_
- `apps/server/src/services/audit/corrections.ts`
  - function createCorrection: (params) => UserCorrectionRecord
  - function findCorrections: (records, unknown>[]) => UserCorrectionRecord[]
  - function checkCorrectionConflict: (proposedAction, corrections) => UserCorrectionRecord | null
  - interface UserCorrectionRecord
- `apps/server/src/services/audit/guideline-store.ts`
  - class GuidelineDocumentStore
  - interface GuidelineContent
  - interface Guideline
  - interface GuidelineDocument
  - interface GuidelineUpdateParams
  - type GuidelineId
  - _...3 more_
- `apps/server/src/services/audit/journey-projection.ts`
  - function projectJourneyToGuidelines: (journey, nodes, edges) => ProjectedGuideline[]
  - function detectJourneyBacktrack: (journey, nodes, edges, currentNodeId, previousNodeId) => BacktrackCheck
  - interface ProjectedGuideline
  - interface BacktrackCheck
- `apps/server/src/services/audit/journey-store.ts`
  - class JourneyStore
  - interface JourneyNode
  - interface JourneyEdge
  - interface Journey
  - type JourneyId
  - type JourneyNodeId
  - _...1 more_
- `apps/server/src/services/audit/runs-dir.ts`
  - function findRunsDir: (projectRoot?) => string
  - function ensureRunsDir: (projectRoot?) => string
  - function readCurrentSession: (projectRoot?) => string | null
  - function writeCurrentSession: (sessionId, projectRoot?) => void
  - function clearCurrentSession: (projectRoot?) => void
  - function readIndex: (projectRoot?) => IndexFile
  - _...7 more_
- `apps/server/src/services/audit/session-manager.ts`
  - function generateSessionId: () => string
  - function isoNow: () => string
  - function createSession: (task, sessionId?, projectRoot?) => string
  - function getSessionDir: (sessionId, projectRoot?) => string
  - function getActiveSession: (projectRoot?) => SessionJson | null
  - function readSession: (sessionId, projectRoot?) => SessionJson | null
  - _...9 more_
- `apps/server/src/services/auto_name.ts` — function maybeAutoNameChat: (ctx, chatId, sessionId) => Promise<void>
- `apps/server/src/services/broker.ts`
  - function createBroker: (log?) => Broker
  - interface Broker
  - type Frame
  - type Listener
- `apps/server/src/services/codecontext_client.ts`
  - function callCodecontext: (req, fetcher) => Promise<CodecontextResponse>
  - interface CodecontextRequest
  - interface CodecontextResponse
- `apps/server/src/services/coder-notify.ts` — function notifyCoderClose: (kind, id, log?, 'debug'>, fetcher) => Promise<boolean>, type CoderCloseKind
- `apps/server/src/services/compaction.ts`
  - function usable: (contextLimit) => number
  - function isOverflow: (usage, contextLimit) => boolean
  - function estimate: (messages) => number
  - function turns: (messages) => Turn[]
  - function select: (messages, contextLimit, tailTurns) => SelectResult
  - function deriveFilesRead: (head) => string[]
  - _...8 more_
- `apps/server/src/services/file_index.ts` — function getProjectFiles: (projectId, projectRoot) => Promise<string[]>
- `apps/server/src/services/file_ops.ts`
  - function listDir: (projectRoot, relPath, opts?) => Promise<ListDirResult>
  - function viewFile: (projectRoot, relPath, opts?) => Promise<ViewFileResult>
  - function grep: (projectRoot, pattern, opts?) => Promise<GrepResult>
  - function findFiles: (projectRoot, pattern?, opts?) => Promise<FindFilesResult>
  - interface FileEntry
  - interface ListDirResult
  - _...4 more_
- `apps/server/src/services/git_diff.ts`
  - function parseNameStatus: (output) => void
  - function parseNumStatLine: (line) => void
  - function splitDiffByFile: (diffText) => Map<string, string>
  - function classifyDiffBody: (body, cap) => 'diff' | 'binary' | 'too_large'
  - function autoSelectMode: (isDirty) => GitDiffMode
  - function canCommit: (files) => boolean
  - _...17 more_
- `apps/server/src/services/git_meta.ts` — function getGitMeta: (rootPath) => Promise<GitMeta | null>, interface GitMeta
- `apps/server/src/services/gitea.ts`
  - function createGiteaRepo: (cfg, name, options) => Promise<GiteaRepo>
  - class GiteaRepoExistsError
  - interface GiteaConfig
  - interface GiteaRepo
- `apps/server/src/services/grant_resolver.ts` — function resolveGrantRoot: (sql, requestedPath, projectRoot, whitelistRoot) => Promise<GrantResolution>, type GrantResolution
- `apps/server/src/services/inference/budget.ts` — function resolveToolBudget: (agent) => number
- `apps/server/src/services/inference/content-flusher.ts` — function createContentFlusher: (sql, messageId, getContent) => void, interface ContentFlusher
- `apps/server/src/services/inference/dcp/messages.ts`
  - function toDcpMessages: (parts) => DcpMessage[]
  - function fromDcpMessages: (msgs) => any[]
  - interface DcpMessage
- `apps/server/src/services/inference/dcp/state.ts`
  - function getDcpState: (chatId) => ChatDcpState | undefined
  - function setDcpState: (chatId, messageCount) => void
  - function clearDcpState: (chatId) => void
  - function shouldTransform: (chatId, messageCount) => boolean
- `apps/server/src/services/inference/dcp/strategies/deduplication.ts` — function deduplicate: (messages) => void
- `apps/server/src/services/inference/dcp/strategies/purge-errors.ts` — function purgeErrors: (messages, windowSize) => void
- `apps/server/src/services/inference/dcp/transform.ts`
  - function transformMessages: (chatId, messages) => TransformResult
  - interface TransformStats
  - interface TransformResult
- `apps/server/src/services/inference/error-handler.ts`
  - function handleAbortOrError: (ctx, args, accumulated, err) => Promise<void>
  - function finalizeStreamedRow: (ctx, opts) => void
  - function finalizeEmpty: (ctx, args) => Promise<void>
  - function finalizeCompletion: (ctx, args, result, startedAt, session) => Promise<void>
- `apps/server/src/services/inference/llama-args-validator.ts`
  - function validateExtraArgs: (args?) => string[]
  - function isManagedFlag: (flag) => boolean
  - function stripShadowingFlags: (args, opts?) => string[]
  - interface StripOptions
- `apps/server/src/services/inference/loop-detectors.ts`
  - function detectContentRepeat: (messages) => LoopDetectionResult
  - function detectToolLoop: (toolNames) => LoopDetectionResult
  - function detectDoomLoop: (messages, toolNames) => LoopDetectionResult
  - interface LoopDetectionResult
- `apps/server/src/services/inference/mistake-tracker.ts`
  - function freshMistakeState: () => MistakeState
  - function recordStep: (state, outcome) => void
  - function detectMistakePattern: (state) => 'nudge' | 'escalate' | null
  - interface MistakeState
  - type FailureKind
  - const MISTAKE_THRESHOLD
  - _...1 more_
- `apps/server/src/services/inference/parts.ts`
  - function insertParts: (sql, parts) => Promise<void>
  - function partsFromAssistantMessage: (args) => void
  - function partsFromToolMessage: (args) => Omit<PartInsert, 'message_id'>[]
  - interface PartInsert
  - type PartKind
- `apps/server/src/services/inference/payload.ts`
  - function buildMessagesPayload: (session, project, history, agent, log?) => Promise<OpenAiMessage[]>
  - function loadContext: (sql, sessionId, chatId) => Promise<
  - function maybeFlagForCompaction: (ctx, chatId, updated) => Promise<void>
  - interface OpenAiMessage
- `apps/server/src/services/inference/provider.ts`
  - function resolveRoute: (agent, config?) => RoutingInfo
  - function upstreamModel: (config, modelId, agent?) => LanguageModel
  - interface RoutingInfo
  - type InferenceRoute
- `apps/server/src/services/inference/prune.ts`
  - function selectPruneTargets: (partsNewestFirst, tailStartCreatedAt) => void
  - function prune: (args) => Promise<PruneResult>
  - interface PruneResult
  - interface PartForPrune
  - const PROTECTED_TOKENS
  - const PRUNE_TRIGGER_TOKENS
- `apps/server/src/services/inference/sentinel-summaries.ts`
  - function runCapHitSummary: (ctx, args, session, project, history, agent, budget) => Promise<void>
  - function runDoomLoopSummary: (ctx, args, session, project, history, agent, loop, unknown> }) => Promise<void>
  - function runStepCapSummary: (ctx, args, session, project, history, agent, steps, cap) => Promise<void>
  - function insertMistakeRecoverySentinel: (ctx, sessionId, chatId, opts) => Promise<void>
- `apps/server/src/services/inference/sentinels.ts`
  - function detectDoomLoop: (recentToolCalls) => void
  - function isCapHitSentinel: (m) => boolean
  - function isDoomLoopSentinel: (m) => boolean
  - function isMistakeRecoverySentinel: (m) => boolean
  - function isAnySentinel: (m) => boolean
  - const DOOM_LOOP_THRESHOLD
  - _...1 more_
- `apps/server/src/services/inference/step-decision.ts`
  - function decideStep: (input) => PreStepDecision
  - function decidePostToolAction: (action, mistakeTracker) => PostToolDecision
  - type PreStepDecision
  - type PostToolDecision
- `apps/server/src/services/inference/stream-error-classifier.ts` — function classifyStreamError: (err) => StreamErrorKind, type StreamErrorKind
- `apps/server/src/services/inference/stream-phase-adapter.ts`
  - function samplerOptsFromAgent: (agent) => SamplerOpts
  - function streamCompletion: (ctx, model, messages, opts, onDelta) => void
  - interface StreamAdapterContext
  - interface StreamOptions
  - type SamplerOpts
  - const STALL_TIMEOUT_MS
- `apps/server/src/services/inference/stream-phase.ts` — function executeStreamPhase: (ctx, args, session, messages, state, agent, // v1.11.8, web_search and web_fetch are stripped from the
  // tool list sent to the LLM, so the model can't even attempt them.
  webToolsEnabled) => Promise<StreamResult>
- `apps/server/src/services/inference/tool-call-parser.ts`
  - function stripToolMarkup: (text, opts?) => string
  - function extractToolCallBlocks: (buffer, log?) => ToolCallExtraction
  - interface ParsedCall
  - interface ToolCallExtraction
- `apps/server/src/services/inference/tool-phase.ts` — function executeToolPhase: (ctx, args, result, startedAt, session, projectRoot, agent?) => Promise<ToolPhaseResult>, interface ToolPhaseResult
- `apps/server/src/services/inference/tool-shim.ts`
  - function extractToolCalls: (text) => ParsedToolCall[]
  - function hasToolCallMarkup: (text) => boolean
  - interface ParsedToolCall
- `apps/server/src/services/inference/tool-suggestions.ts`
  - function levenshtein: (a, b) => number
  - function suggestToolName: (name, available) => string | null
  - function formatUnknownToolError: (name, available) => string
- `apps/server/src/services/inference/turn-config.ts`
  - function resolveTurnConfig: (agent) => TurnConfig
  - interface TurnConfig
  - const MAX_STEPS
- `apps/server/src/services/inference/turn.ts`
  - function runAssistantTurn: (ctx, args) => Promise<void>
  - function runInference: (ctx, sessionId, chatId, assistantMessageId, signal?) => Promise<void>
  - function createInferenceRunner: (ctx, 'publishUser'>, publishUserFn, frame) => void
- `apps/server/src/services/mcp-client.ts`
  - function initialize: (entries, logger) => Promise<void>
  - function callTool: (prefixedName, args, unknown>) => Promise<unknown>
  - function getTools: () => ToolDef<Record<string, unknown>>[]
  - function getMcpServers: () => Array<
  - function shutdown: () => Promise<void>
  - function wrapMcpTool: (serverName, mcpTool) => ToolDef<Record<string, unknown>>
  - _...2 more_
- `apps/server/src/services/mcp-config.ts`
  - function substituteEnvVars: (value, log, unsetVars?) => unknown
  - function loadMcpConfig: (configPath, log) => McpServerEntry[]
  - interface McpServerEntry
  - type McpServerConfig
- `apps/server/src/services/memory/entries.ts` — function parseMemoryEntries: (fileName, markdown) => MemoryEntry[], interface MemoryEntry
- `apps/server/src/services/memory/paths.ts`
  - function getMemoryRoot: (projectRoot) => string
  - function getTopicDir: (root, topic) => string
  - function ensureMemoryScaffold: (root) => Promise<void>
  - type MemoryTopic
- `apps/server/src/services/memory/prompt.ts` — function formatMemoryBlock: (entries) => string
- `apps/server/src/services/memory/recall.ts` — function rankByRelevance: (query, entries) => MemoryEntry[], function loadMemoryForSession: (projectRoot, _sessionId?, query?) => Promise<string[]>
- `apps/server/src/services/memory/scan.ts`
  - function scanMemoryScopes: (scope) => Promise<MemoryEntry[]>
  - function scanProjectMemory: (projectRoot) => Promise<MemoryEntry[]>
  - interface MemoryScope
- `apps/server/src/services/memory/store.ts` — function readTopicFiles: (root, topic) => Promise<Map<string, string>>, function writeEntry: (root, topic, title, content, tags) => Promise<void>
- `apps/server/src/services/model-context.ts`
  - function configureModelContext: (opts) => void
  - function getModelContext: (model) => Promise<ModelContext | null>
  - function invalidateModelContext: (model?) => void
  - interface ModelContext
- `apps/server/src/services/path_guard.ts`
  - function resolveProjectRoot: (projectPath) => Promise<string>
  - function pathGuard: (projectRoot, requested, extraRoots) => Promise<string>
  - class PathScopeError
- `apps/server/src/services/project_bootstrap.ts`
  - function sanitizeFolderName: (raw) => string
  - function bootstrapProject: (config, log, options) => Promise<BootstrapResult>
  - class BootstrapNameError
  - class BootstrapCollisionError
  - class BootstrapPathError
  - interface BootstrapResult
- `apps/server/src/services/read_tab_by_number.ts`
  - function executeReadTabByNumber: (input, sql, sessionId) => Promise<string>
  - type ReadTabByNumberInputT
  - const readTabByNumber: ToolDef<ReadTabByNumberInputT>
- `apps/server/src/services/secret_guard.ts`
  - function isSecretPath: (relPath) => boolean
  - function filterSecretEntries: (entries, pathOf) => void
  - class SecretBlockedError
  - const DEFAULT_SECURITY_IGNORE_FILETYPES: ReadonlyArray<string>
- `apps/server/src/services/skill-invoke.ts`
  - function runSkillInvokeTransaction: (sql, args) => Promise<
  - function buildSkillInvokeSyntheticFrames: (chatId, result, toolCall, skillBody) => SkillInvokeSessionFrame[]
  - function buildSkillInvokeUserFrames: (chatId, userMessageId, userText) => SkillInvokeSessionFrame[]
  - interface SkillInvokeTransactionResult
  - interface SkillInvokeToolCall
  - type SkillInvokeSessionFrame
  - _...1 more_
- `apps/server/src/services/skills.ts`
  - function listSkills: () => Promise<Skill[]>
  - function findSkills: (query) => Promise<SkillSummary[]>
  - function getSkillBody: (name) => Promise<string | null>
  - function getSkillResource: (name, relativePath) => Promise<SkillResourceResult>
  - interface Skill
  - interface SkillSummary
  - _...2 more_
- `apps/server/src/services/synthesisPipeline.ts`
  - function runSynthesisPass: (p) => Promise<boolean>
  - interface SynthesisParams
  - const SYNTHESIS_TOOLS: ReadonlySet<string>
- `apps/server/src/services/system-prompt.ts`
  - function loadContainerGuidance: () => Promise<string | null>
  - function getContainerGuidance: () => Promise<string | null>
  - function _resetContainerGuidanceCacheForTests: () => void
  - function _resetPrefixObserverForTests: () => void
  - function buildSystemPromptWithFingerprint: (project, session, agent) => Promise<
  - function buildSystemPrompt: (project, session, agent) => Promise<string>
  - _...2 more_
- `apps/server/src/services/task-model.ts` — function taskModelCompletion: (opts) => Promise<string>
- `apps/server/src/services/task-search-rewrite.ts` — function rewriteSearchQuery: (userMessage) => Promise<string>
- `apps/server/src/services/tools/codecontext/factory.ts` — function makeCodecontextTool: (opts, unknown>;
  mapArgs) => void
- `apps/server/src/services/tools/registry.ts` — function appendMcpTools: (mcpTools) => void, function toolJsonSchemas: () => ToolJsonSchema[]
- `apps/server/src/services/tools/tiers.ts`
  - function resolveToolTier: (tier) => readonly string[]
  - const CORE_TOOL_NAMES
  - const STANDARD_TOOL_NAMES
- `apps/server/src/services/truncate.ts`
  - function storeTruncation: (fullContent) => Promise<string>
  - function readTruncation: (id) => Promise<string | null>
  - function truncateIfNeeded: (args) => Promise<
  - function cleanupTruncations: (args, msg) => void
  - const TRUNCATION_DIR
  - const TRUNCATION_TTL_MS
  - _...1 more_
- `apps/server/src/services/url_guard.ts` — function isPublicUrl: (input) => UrlGuardResult, interface UrlGuardResult
- `apps/server/src/services/web/html-to-md.ts` — function htmlToMarkdown: (sourceHtml) => string
- `apps/server/src/services/web_fetch.ts`
  - function executeWebFetch: (input, fetcher) => Promise<WebFetchOutput>
  - type WebFetchInputT
  - type WebFetchOutput
  - const webFetch: ToolDef<WebFetchInputT>
- `apps/server/src/services/web_search.ts`
  - function executeWebSearch: (input, searxngUrl, fetcher) => Promise<WebSearchOutput>
  - interface WebSearchOutput
  - type WebSearchInputT
  - const webSearch: ToolDef<WebSearchInputT>
- `apps/server/src/utils/string-utils.ts` — function stripQuotes: (s) => string
- `apps/web/src/api/client.ts`
  - class ApiError
  - interface AgentSessionInfo
  - interface CoderCheckpoint
  - interface CoderRestoreResult
  - const api
- `apps/web/src/data/acp-provider-catalog.ts`
  - function buildAcpProviderConfigPatch: (entry) => ProviderConfigPatch
  - interface AcpCatalogEntry
  - const ACP_PROVIDER_CATALOG: AcpCatalogEntry[]
- `apps/web/src/hooks/terminal/useTerminalFit.ts`
  - function cellSize: (term, container) => void
  - function useTerminalFit: ({...}, containerRef, sessionId, paneId }) => TerminalFit
  - interface TerminalFit
- `apps/web/src/hooks/terminal/useTerminalSelection.ts`
  - function useTerminalSelection: ({...}, containerRef, sessionId, paneId, label, send, }) => TerminalSelection
  - interface TerminalSelectionActions
  - interface TerminalSelection
- `apps/web/src/hooks/terminal/useTerminalSocket.ts`
  - function useTerminalSocket: ({...}, sessionId, paneId, fit, getSize, setSize, }) => TerminalSocket
  - interface TerminalSocket
  - type ConnState
- `apps/web/src/hooks/useActivePane.ts`
  - function setActivePaneInfo: (next) => void
  - function clearActivePane: () => void
  - function useActivePane: () => ActivePaneSnapshot
  - interface ActivePaneSnapshot
- `apps/web/src/hooks/useAgentSessions.ts` — function refreshAgentSessions: (sessionId) => Promise<AgentSessionInfo[]>, function useAgentSessions: (sessionId) => void
- `apps/web/src/hooks/useAgentStatus.ts`
  - function useAgentStatus: () => void
  - interface AgentStatusEntry
  - type AgentStatus
- `apps/web/src/hooks/useArtifactDownload.ts` — function useArtifactDownload: (chatId, messageId, format) => void
- `apps/web/src/hooks/useChatStatus.ts`
  - function useChatStatus: (chatId) => DerivedStatus
  - type RawStatus
  - type DerivedStatus
- `apps/web/src/hooks/useChatThroughput.ts`
  - function recordUsage: (chatId, data) => void
  - function useChatThroughput: (chatId) => ThroughputSample | null
  - interface ThroughputSample
- `apps/web/src/hooks/useCoderUserEvents.ts` — function useCoderUserEvents: () => void
- `apps/web/src/hooks/useDiffPreferences.ts` — function useDiffPreferences: () => void, interface DiffPreferences
- `apps/web/src/hooks/useGitDiff.ts` — function useGitDiff: (projectId) => void
- `apps/web/src/hooks/useLongPress.ts` — function useLongPress: (callback) => void
- `apps/web/src/hooks/useProjectGit.ts` — function useProjectGit: (projectId) => GitMeta | null
- `apps/web/src/hooks/useProviderSnapshot.ts` — function refreshProviderSnapshot: (cwd?) => Promise<ProviderSnapshotEntry[]>, function useProviderSnapshot: (cwd?) => ProviderSnapshotEntry[] | null
- `apps/web/src/hooks/usePullToRefresh.ts` — function usePullToRefresh: (onRefresh) => void
- `apps/web/src/hooks/useSessionChats.ts`
  - function useSessionChats: (sessionId, opts) => UseSessionChatsResult
  - interface UseSessionChatsOpts
  - interface UseSessionChatsResult
- `apps/web/src/hooks/useSessionStream.ts` — function useSessionStream: (sessionId) => void
- `apps/web/src/hooks/useSessions.ts` — function useSessions: (projectId) => void
- `apps/web/src/hooks/useSidebar.ts` — function useSidebar: () => void
- `apps/web/src/hooks/useSkills.ts` — function useSkills: () => void
- `apps/web/src/hooks/useUserEvents.ts` — function useUserEvents: () => void
- `apps/web/src/hooks/useViewport.ts` — function useViewport: () => ViewportSnapshot, interface ViewportSnapshot
- `apps/web/src/hooks/useWorkspacePanes.ts`
  - function activePaneChatId: (pane) => string | undefined
  - function useWorkspacePanes: (sessionId) => UseWorkspacePanesResult
  - interface UseWorkspacePanesResult
  - const MAX_PANES
- `apps/web/src/hooks/wsReconnectToast.ts` — function createWsReconnectToast: (opts) => WsReconnectToast, interface WsReconnectToast
- `apps/web/src/lib/anim.ts`
  - function getAnimBg: () => boolean
  - function setAnimBg: (on) => void
  - function setAnimDensity: (v) => void
  - function setAnimSpeed: (v) => void
  - function setAnimOpacity: (v) => void
  - function useAnimBg: () => boolean
  - _...3 more_
- `apps/web/src/lib/attachments.ts`
  - function looksBinary: (content) => boolean
  - function inferLanguage: (filename) => string | null
  - function flattenToMessage: (attachments, text) => string
  - type Attachment
  - const MAX_FILE_SIZE_BYTES
  - const PASTE_INLINE_MAX_LINES
  - _...1 more_
- `apps/web/src/lib/coder-session.ts` — function isCoderSessionName: (name) => boolean
- `apps/web/src/lib/coder-tools.ts`
  - function wireToolCallToRun: (wire) => ToolRun
  - function mergeWireToolCall: (existing, incoming, unknown> }) => CoderToolCallWire[]
  - interface AcpWireMeta
  - interface CoderToolCallWire
- `apps/web/src/lib/format.ts`
  - function relTime: (iso) => string
  - function formatRelative: (iso) => string
  - function formatAgo: (iso) => string
- `apps/web/src/lib/model-label.ts` — function formatModelLabel: (raw) => string
- `apps/web/src/lib/modelName.ts` — function shortenModelName: (model) => string | null
- `apps/web/src/lib/permission-mode.ts`
  - function nativeModeForPermission: (mode, modes, defaultModeId) => string | null
  - function permissionForModeId: (modeId, modes) => PermissionMode
  - function availablePermissionModes: (modes) => Array<
  - type PermissionMode
  - const PERMISSION_LABELS: Record<PermissionMode, string>
- `apps/web/src/lib/projectUrls.ts` — function giteaUrlFor: (project) => string
- `apps/web/src/lib/slash-command.ts`
  - function isSlashCommandToken: (value) => boolean
  - function slashQuery: (value) => string
  - function parseSlashInput: (text) => void
  - function mergeCommandsByName: (...lists) => T[]
  - interface SlashCommandItem
- `apps/web/src/lib/terminal-protocol.ts`
  - function encodeInput: (text) => Uint8Array
  - function encodeResize: (cols, rows) => string
  - function parseServerFrame: (data) => ServerControlFrame | null
  - type ServerControlFrame
- `apps/web/src/lib/theme.ts`
  - function isThemeId: (s) => s is ThemeId
  - function applyTheme: (id, mode) => void
  - function setTheme: (id, mode) => Promise<void>
  - function useTheme: () => ThemeState
  - interface ThemeMeta
  - type ThemeId
  - _...5 more_
- `apps/web/src/lib/utils.ts` — function cn: (...inputs) => void
- `apps/web/src/utils/diff-layout.ts`
  - function parseDiff: (diffBody) => ParsedDiffFile[]
  - function buildSplitRows: (file) => SplitRow[]
  - function reconstructNewContent: (hunks) => string
  - interface DiffLine
  - interface DiffHunk
  - interface ParsedDiffFile
  - _...3 more_
- `conductor/src/contracts.ts`
  - function produceContract: (contracts) => string
  - function reviewContract: (contracts) => string
  - type Contract
  - const EVIDENCE_PRODUCE
  - const EVIDENCE_REVIEW
  - const YAGNI_PRODUCE
  - _...1 more_
- `conductor/src/dispatch.ts`
  - function loadPersona: (agent) => Promise<string>
  - function dispatchAgent: (agent, task, opts) => Promise<string>
  - function cleanOutput: (raw) => string
- `conductor/src/flow.ts` — function runFlow: (flow, input, opts) => Promise<RunResult>, interface RunOptions
- `conductor/src/flows/_util.ts` — function q, function repoLine
- `conductor/src/flows/index.ts`
  - function describeFlows: () => string
  - function getFlow: (name) => Flow | undefined
  - const FLOWS: Record<string, Flow>
  - const FLOW_NAMES: string[]
- `conductor/src/render.ts` — function slugify: (s) => string
- `conductor/src/spine.ts`
  - function readBand: (input) => Band
  - function fastNote: (ctx) => string
  - function buildSpineFlow: (spine) => Flow
- `data/skills/superpowers/systematic-debugging/condition-based-waiting-example.ts`
  - function waitForEvent: (threadManager, threadId, eventType, timeoutMs) => Promise<LaceEvent>
  - function waitForEventCount: (threadManager, threadId, eventType, count, timeoutMs) => Promise<LaceEvent[]>
  - function waitForEventMatch: (threadManager, threadId, predicate) => void
- `packages/ion/src/cli/commands/abandon.ts` — function abandonCommand: (args, options) => Promise<void>
- `packages/ion/src/cli/commands/approve.ts` — function approveCommand: (args, options) => Promise<void>
- `packages/ion/src/cli/commands/cleanup.ts` — function cleanupCommand: (args, options) => Promise<void>
- `packages/ion/src/cli/commands/convert.ts` — function convertCommand: (args, options) => Promise<void>
- `packages/ion/src/cli/commands/list.ts` — function listCommand: (_args, options) => Promise<void>
- `packages/ion/src/cli/commands/reject.ts` — function rejectCommand: (args, options) => Promise<void>
- `packages/ion/src/cli/commands/resume.ts` — function resumeCommand: (args, options) => Promise<void>
- `packages/ion/src/cli/commands/run.ts` — function runCommand: (args, options) => Promise<void>
- `packages/ion/src/cli/commands/runs.ts` — function runsCommand: (args, options) => Promise<void>
- `packages/ion/src/cli/commands/status.ts` — function statusCommand: (_args, options) => Promise<void>
- `packages/ion/src/cli/commands/validate.ts` — function validateCommand: (args, options) => Promise<void>
- `packages/ion/src/cli/index.ts` — function main: (argv) => void
- `packages/ion/src/cli/utils.ts`
  - function formatDuration: (ms) => string
  - function formatTimestamp: (date) => string
  - function truncate: (str, max) => string
  - function printTable: (rows, unknown>[], columns) => void
  - function printJson: (data) => void
  - function parseArgs: (argv) => void
  - _...3 more_
- `packages/ion/src/engine/command-validation.ts` — function isValidCommandName: (name) => boolean
- `packages/ion/src/engine/condition-evaluator.ts` — function evaluateCondition: (expression, nodeOutputs, Record<string, unknown>>) => boolean, class ConditionError
- `packages/ion/src/engine/dag-executor.ts`
  - function buildTopologicalLayers: (nodes) => DagNode[][]
  - function checkTriggerRule: (node, nodeOutputs, NodeOutput>) => 'run' | 'skip'
  - function executeNodeInternal: (node, deps, platform, conversationId, cwd, config, nodeOutputs, NodeOutput>, workflowVariables, unknown>) => Promise<NodeExecutionResult>
  - function executeScriptNode: (node, cwd, envVars, string>, artifactsDir) => Promise<NodeExecutionResult>
  - function handleApprovalNode: (node, deps, platform, conversationId, workflowRunId, nodeOutputs, NodeOutput>, workflowVariables, unknown>) => Promise<NodeExecutionResult>
  - function handleLoopNode: (node, deps, platform, conversationId, cwd, config, nodeOutputs, NodeOutput>, workflowVariables, unknown>) => Promise<NodeExecutionResult>
  - _...2 more_
- `packages/ion/src/engine/event-emitter.ts`
  - function getWorkflowEventEmitter: () => WorkflowEventEmitter
  - class WorkflowEventEmitter
  - interface WorkflowEventBase
  - interface WorkflowStartedEvent
  - interface WorkflowCompletedEvent
  - interface WorkflowFailedEvent
  - _...11 more_
- `packages/ion/src/engine/executor-shared.ts`
  - function substituteWorkflowVariables: (template, context) => string
  - function buildPromptWithContext: (template, context, issueContext?) => string
  - function classifyError: (error) => ErrorClassification
  - function safeSendMessage: (platform, conversationId, message, metadata?, unknown>) => Promise<boolean>
  - function detectCompletionSignal: (output, until) => boolean
  - function stripCompletionTags: (output, until) => string
  - _...5 more_
- `packages/ion/src/engine/executor.ts`
  - function executeWorkflow: (deps, platform, conversationId, cwd, workflow, userMessage, opts) => Promise<WorkflowExecutionResult>
  - function hydrateResumableRun: (deps, candidate) => Promise<HydratedResumableRun>
  - function resolveProjectPaths: (_deps, cwd, workflowRunId, codebaseId?) => ProjectPaths
  - interface WorkflowExecutionOptions
  - interface WorkflowExecutionResult
  - interface HydratedResumableRun
  - _...1 more_
- `packages/ion/src/engine/model-validation.ts`
  - function isLiteralSpec: (spec) => spec is LiteralModelSpec
  - function buildAiProfile: (opts) => AiProfile
  - function resolveModelSpec: (profile, modelRef) => LiteralModelSpec
  - interface LiteralModelSpec
  - interface ModelAliasPreset
  - interface AiProfileTiers
  - _...2 more_
- `packages/ion/src/engine/output-ref.ts`
  - function declaredFieldsFromSchema: (outputFormat, unknown> | string | undefined) => Set<string>
  - function resolveNodeOutputField: (nodeOutput, unknown>, nodeId, field, declaredFields?) => OutputRefResult
  - class OutputRefError
  - interface OutputRefResult
  - type OutputRefKind
- `packages/ion/src/engine/utils.ts`
  - function substituteWorkflowVariables: (template, variables, unknown>) => string
  - function substituteNodeOutputRefs: (prompt, nodeOutputs, NodeOutput>, escapedForBash) => string
  - function resolveNodeOutputField: (output, field) => string
  - function buildPromptWithContext: (prompt, variables, unknown>, nodeOutputs, NodeOutput>, escapedForBash) => string
  - function evaluateCondition: (condition, variables, unknown>) => boolean
  - function classifyError: (error) => ErrorCategory
  - _...10 more_
- `packages/ion/src/format/sop-discovery.ts` — function discoverSopFiles: (cwd, globFn) => Promise<string[]>, type GlobFn
- `packages/ion/src/format/sop-parser.ts`
  - function parseSopContent: (markdown) => SopDocument
  - interface SopParameter
  - interface SopStep
  - interface SopDocument
- `packages/ion/src/format/sop-to-yaml.ts` — function convertSopToWorkflowYaml: (sop) => string
- `packages/ion/src/schema/dag-node.ts`
  - function isBashNode: (node) => node is BashNode
  - function isScriptNode: (node) => node is ScriptNode
  - function isLoopNode: (node) => node is LoopNode
  - function isApprovalNode: (node) => node is ApprovalNode
  - function isCancelNode: (node) => node is CancelNode
  - function isPromptNode: (node) => node is PromptNode
  - _...27 more_
- `packages/ion/src/store/fs-store.ts` — function createFsStore: (basePath) => IWorkflowStore
- `packages/ion/src/store/pg-store.ts` — function createPostgresStore: (connectionString) => Promise<IWorkflowStore>
- `packages/ion/src/store/sqlite-store.ts` — function createSqliteStore: (dbPath) => Promise<IWorkflowStore>

---

# Config

## Environment Variables

- `AUDIT_DOT_DIR` **required** — apps/server/src/services/audit/runs-dir.ts
- `BOOCODE_DATA_DIR` **required** — apps/server/src/routes/inference-settings.ts
- `BOOCODE_TOOLS` **required** — apps/server/src/services/agents.ts
- `BOOCODE_TRUNCATION_DIR` **required** — apps/server/src/services/__tests__/truncate.test.ts
- `BOOCODER_DEV_URL` **required** — apps/web/vite.config.ts
- `BOOCODER_URL` **required** — apps/coder/src/cli.ts
- `BOOTERM_DEV_URL` **required** — apps/web/vite.config.ts
- `BOOTERM_SSH_HOST` **required** — apps/booterm/src/pty/manager.ts
- `BOOTERM_SSH_USER` **required** — apps/booterm/src/pty/manager.ts
- `BOOTSTRAP_ROOT` (has default) — .env.example
- `BRAINSTORM_DIR` **required** — data/skills/superpowers/brainstorming/scripts/server.cjs
- `BRAINSTORM_HOST` **required** — data/skills/superpowers/brainstorming/scripts/server.cjs
- `BRAINSTORM_OWNER_PID` **required** — data/skills/superpowers/brainstorming/scripts/server.cjs
- `BRAINSTORM_PORT` **required** — data/skills/superpowers/brainstorming/scripts/server.cjs
- `BRAINSTORM_URL_HOST` **required** — data/skills/superpowers/brainstorming/scripts/server.cjs
- `CODECONTEXT_CHILD` **required** — codecontext/shim.go
- `CODECONTEXT_URL` **required** — apps/server/src/services/codecontext_client.ts
- `CONDUCTOR_MODEL` **required** — conductor/src/dispatch.ts
- `CONDUCTOR_OPENCODE_BIN` **required** — conductor/src/dispatch.ts
- `CONDUCTOR_TIMEOUT_MS` **required** — conductor/src/dispatch.ts
- `CONTAINER_GUIDANCE_FILE` **required** — apps/server/src/services/__tests__/system-prompt.test.ts
- `CONTEXT7_API_KEY` (has default) — .env
- `DATABASE_URL` (has default) — .env.example
- `DEFAULT_MODEL` (has default) — .env.example
- `DEV_REMOTE_USER` **required** — apps/web/vite.config.ts
- `GITEA_BASE_URL` (has default) — .env
- `GITEA_SSH_HOST` (has default) — .env
- `GITEA_TOKEN` (has default) — .env
- `GITEA_USER` (has default) — .env
- `LLAMA_SWAP_URL` (has default) — .env.example
- `MCP_TEST_MISSING` **required** — apps/server/src/services/__tests__/mcp-config.test.ts
- `MCP_TEST_SECRET` **required** — apps/server/src/services/__tests__/mcp-config.test.ts
- `NODE_ENV` (has default) — .env.example
- `PORT` (has default) — .env.example
- `POSTGRES_PASSWORD` (has default) — .env.example
- `PROJECT_ROOT_WHITELIST` (has default) — .env.example
- `SEARXNG_URL` (has default) — .env.example
- `SKILLS_ROOT` **required** — apps/server/src/services/skills.ts
- `WEB_DIST_PATH` **required** — apps/server/src/index.ts

## Config Files

- `.env.example`
- `Dockerfile`
- `apps/web/vite.config.ts`
- `docker-compose.yml`

---

# Middleware

## auth
- auth — `apps/booterm/src/auth.ts`
- authoring — `apps/coder/src/conductor/flows/authoring.ts`
- turn-guard.test — `apps/coder/src/services/backends/__tests__/turn-guard.test.ts`
- turn-guard — `apps/coder/src/services/backends/turn-guard.ts`
- get_middleware — `apps/server/src/services/tools/codecontext/get_middleware.ts`
- authoring — `conductor/src/flows/authoring.ts`

## custom
- write_guard.test — `apps/coder/src/services/__tests__/write_guard.test.ts`
- write_guard_fuzz.test — `apps/coder/src/services/__tests__/write_guard_fuzz.test.ts`
- edit-guards-imports — `apps/coder/src/services/edit-guards-imports.ts`
- write_guard — `apps/coder/src/services/write_guard.ts`
- secret_guard.test — `apps/server/src/services/__tests__/secret_guard.test.ts`
- path_guard — `apps/server/src/services/path_guard.ts`
- secret_guard — `apps/server/src/services/secret_guard.ts`
- url_guard — `apps/server/src/services/url_guard.ts`

## validation
- edit-guards — `apps/coder/src/services/edit-guards.ts`
- path_guard.test — `apps/server/src/services/__tests__/path_guard.test.ts`

---

# Dependency Graph

## Most Imported Files (change these carefully)

- `apps/coder/src/db.ts` — imported by **40** files
- `apps/server/src/types/api.ts` — imported by **28** files
- `apps/server/src/db.ts` — imported by **25** files
- `packages/ion/src/cli/utils.ts` — imported by **24** files
- `apps/coder/src/services/tools/types.ts` — imported by **18** files
- `apps/coder/src/conductor/types.ts` — imported by **14** files
- `apps/coder/src/services/agent-backend.ts` — imported by **14** files
- `apps/coder/src/services/acp-tool-snapshot.ts` — imported by **14** files
- `apps/server/src/services/tools/codecontext/factory.ts` — imported by **14** files
- `apps/server/src/services/tools.ts` — imported by **13** files
- `conductor/src/types.ts` — imported by **13** files
- `apps/coder/src/services/provider-config-registry.ts` — imported by **12** files
- `apps/server/src/config.ts` — imported by **12** files
- `apps/coder/src/config.ts` — imported by **11** files
- `apps/coder/src/services/provider-types.ts` — imported by **11** files
- `apps/server/src/services/agents.ts` — imported by **10** files
- `apps/coder/src/services/pending_changes.ts` — imported by **9** files
- `apps/server/src/services/broker.ts` — imported by **9** files
- `apps/server/src/services/path_guard.ts` — imported by **9** files
- `apps/server/src/services/inference/payload.ts` — imported by **9** files

## Import Map (who imports what)

- `apps/coder/src/db.ts` ← `apps/coder/src/index.ts`, `apps/coder/src/routes/__tests__/agent-sessions.routes.test.ts`, `apps/coder/src/routes/__tests__/chat-resolve.test.ts`, `apps/coder/src/routes/__tests__/providers.routes.test.ts`, `apps/coder/src/routes/agent-sessions.ts` +35 more
- `apps/server/src/types/api.ts` ← `apps/server/src/routes/chats.ts`, `apps/server/src/routes/messages.ts`, `apps/server/src/routes/models.ts`, `apps/server/src/routes/projects.ts`, `apps/server/src/routes/sessions.ts` +23 more
- `apps/server/src/db.ts` ← `apps/server/src/index.ts`, `apps/server/src/routes/agents.ts`, `apps/server/src/routes/artifacts.ts`, `apps/server/src/routes/chats.ts`, `apps/server/src/routes/messages.ts` +20 more
- `packages/ion/src/cli/utils.ts` ← `packages/ion/src/cli/commands/abandon.ts`, `packages/ion/src/cli/commands/abandon.ts`, `packages/ion/src/cli/commands/approve.ts`, `packages/ion/src/cli/commands/approve.ts`, `packages/ion/src/cli/commands/cleanup.ts` +19 more
- `apps/coder/src/services/tools/types.ts` ← `apps/coder/src/routes/messages.ts`, `apps/coder/src/services/dispatcher.ts`, `apps/coder/src/services/tools/adapter.ts`, `apps/coder/src/services/tools/apply_pending.ts`, `apps/coder/src/services/tools/check_task_status.ts` +13 more
- `apps/coder/src/conductor/types.ts` ← `apps/coder/src/conductor/flows/_util.ts`, `apps/coder/src/conductor/flows/architectural-analysis.ts`, `apps/coder/src/conductor/flows/authoring.ts`, `apps/coder/src/conductor/flows/code-review.ts`, `apps/coder/src/conductor/flows/discovery.ts` +9 more
- `apps/coder/src/services/agent-backend.ts` ← `apps/coder/src/routes/lifecycle.ts`, `apps/coder/src/services/__tests__/stream-json-parser.test.ts`, `apps/coder/src/services/acp-event-map.ts`, `apps/coder/src/services/agent-pool.ts`, `apps/coder/src/services/backends/__tests__/claude-sdk-map.test.ts` +9 more
- `apps/coder/src/services/acp-tool-snapshot.ts` ← `apps/coder/src/services/__tests__/acp-event-map.test.ts`, `apps/coder/src/services/__tests__/frame-emitter.test.ts`, `apps/coder/src/services/__tests__/stream-json-parser.test.ts`, `apps/coder/src/services/acp-dispatch.ts`, `apps/coder/src/services/acp-event-map.ts` +9 more
- `apps/server/src/services/tools/codecontext/factory.ts` ← `apps/server/src/services/tools/codecontext/get_blast_radius.ts`, `apps/server/src/services/tools/codecontext/get_call_graph.ts`, `apps/server/src/services/tools/codecontext/get_codebase_overview.ts`, `apps/server/src/services/tools/codecontext/get_dependencies.ts`, `apps/server/src/services/tools/codecontext/get_file_analysis.ts` +9 more
- `apps/server/src/services/tools.ts` ← `apps/server/src/index.ts`, `apps/server/src/services/__tests__/agent-allowlist.test.ts`, `apps/server/src/services/agents.ts`, `apps/server/src/services/inference/stream-phase-adapter.ts`, `apps/server/src/services/inference/stream-phase.ts` +8 more

---

_Generated by [codesight](https://github.com/Houseofmvps/codesight) — see your codebase clearly_