# 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>
