# @compilr-dev/agents ## Enumerations ### MCPErrorCode Defined in: [mcp/errors.ts:10](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/errors.ts#L10) Error codes for MCP operations #### Enumeration Members | Enumeration Member | Value | Description | Defined in | | ------ | ------ | ------ | ------ | | `CONNECTION_FAILED` | `"CONNECTION_FAILED"` | Failed to connect to MCP server | [mcp/errors.ts:14](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/errors.ts#L14) | | `INVALID_CONFIG` | `"INVALID_CONFIG"` | Invalid server configuration | [mcp/errors.ts:26](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/errors.ts#L26) | | `SDK_NOT_INSTALLED` | `"SDK_NOT_INSTALLED"` | MCP SDK is not installed | [mcp/errors.ts:12](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/errors.ts#L12) | | `SERVER_EXISTS` | `"SERVER_EXISTS"` | Server already exists | [mcp/errors.ts:28](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/errors.ts#L28) | | `SERVER_NOT_FOUND` | `"SERVER_NOT_FOUND"` | Server not found in manager | [mcp/errors.ts:16](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/errors.ts#L16) | | `TIMEOUT` | `"TIMEOUT"` | Connection or operation timeout | [mcp/errors.ts:24](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/errors.ts#L24) | | `TOOL_EXECUTION_FAILED` | `"TOOL_EXECUTION_FAILED"` | Tool execution failed | [mcp/errors.ts:20](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/errors.ts#L20) | | `TOOL_NOT_FOUND` | `"TOOL_NOT_FOUND"` | Tool not found on server | [mcp/errors.ts:18](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/errors.ts#L18) | | `TRANSPORT_ERROR` | `"TRANSPORT_ERROR"` | Transport error (stdio/http) | [mcp/errors.ts:22](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/errors.ts#L22) | *** ### StateErrorCode Defined in: [state/errors.ts:10](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/errors.ts#L10) Error codes for state management operations. #### Enumeration Members | Enumeration Member | Value | Description | Defined in | | ------ | ------ | ------ | ------ | | `DESERIALIZATION_FAILED` | `"DESERIALIZATION_FAILED"` | Failed to deserialize string to state | [state/errors.ts:15](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/errors.ts#L15) | | `INVALID_SESSION_ID` | `"INVALID_SESSION_ID"` | Session ID format is invalid | [state/errors.ts:30](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/errors.ts#L30) | | `INVALID_STATE` | `"INVALID_STATE"` | Invalid state structure | [state/errors.ts:27](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/errors.ts#L27) | | `SERIALIZATION_FAILED` | `"SERIALIZATION_FAILED"` | Failed to serialize state to string | [state/errors.ts:12](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/errors.ts#L12) | | `SESSION_NOT_FOUND` | `"SESSION_NOT_FOUND"` | Session not found in storage | [state/errors.ts:18](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/errors.ts#L18) | | `STORAGE_ERROR` | `"STORAGE_ERROR"` | Storage operation failed (I/O, permissions, etc.) | [state/errors.ts:21](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/errors.ts#L21) | | `VERSION_MISMATCH` | `"VERSION_MISMATCH"` | State version mismatch (needs migration) | [state/errors.ts:24](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/errors.ts#L24) | ## Classes ### AbortError Defined in: [errors.ts:235](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L235) Error thrown when a request is aborted via AbortSignal. #### Extends - [`AgentError`](#agenterror) #### Constructors ##### Constructor ```ts new AbortError(message?): AbortError; ``` Defined in: [errors.ts:236](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L236) ###### Parameters | Parameter | Type | Default value | | ------ | ------ | ------ | | `message` | `string` | `'Request was aborted'` | ###### Returns [`AbortError`](#aborterror) ###### Overrides [`AgentError`](#agenterror).[`constructor`](#constructor-2) #### Properties ##### cause? ```ts readonly optional cause?: Error; ``` Defined in: [errors.ts:17](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L17) ###### Inherited from [`AgentError`](#agenterror).[`cause`](#cause-1) *** ### Agent Defined in: [agent.ts:982](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L982) Agent class - orchestrates LLM interactions with tool use #### Example ```typescript const agent = new Agent({ provider: new ClaudeProvider({ apiKey: 'sk-...' }), systemPrompt: 'You are a helpful assistant.', }); agent.registerTool(readFileTool); agent.registerTool(writeFileTool); const result = await agent.run('Read the contents of package.json'); console.log(result.response); ``` #### Constructors ##### Constructor ```ts new Agent(config): Agent; ``` Defined in: [agent.ts:1088](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1088) ###### Parameters | Parameter | Type | | ------ | ------ | | `config` | [`AgentConfig`](#agentconfig) | ###### Returns [`Agent`](#agent) #### Accessors ##### sessionId ###### Get Signature ```ts get sessionId(): string; ``` Defined in: [agent.ts:1328](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1328) Get the session ID for this agent instance ###### Returns `string` #### Methods ##### ~~addAnchor()~~ ```ts addAnchor(input): Anchor | undefined; ``` Defined in: [agent.ts:1593](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1593) ###### Parameters | Parameter | Type | | ------ | ------ | | `input` | [`AnchorInput`](#anchorinput) | ###### Returns [`Anchor`](#anchor) \| `undefined` ###### Deprecated Use addPin() instead ##### addGuardrail() ```ts addGuardrail(input): Guardrail | undefined; ``` Defined in: [agent.ts:1648](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1648) Add a custom guardrail ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `input` | [`GuardrailInput`](#guardrailinput) | Guardrail definition | ###### Returns [`Guardrail`](#guardrail) \| `undefined` The created guardrail, or undefined if guardrails are not enabled ###### Example ```typescript agent.addGuardrail({ id: 'no-delete-important', name: 'Important Files Protection', description: 'Prevent deletion of important files', patterns: [/rm.*important/i, /delete.*important/i], action: 'block', message: 'Cannot delete files marked as important', scope: ['bash'], }); ``` ##### addPermission() ```ts addPermission(rule): this; ``` Defined in: [agent.ts:1727](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1727) Add a permission rule for a tool ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `rule` | [`ToolPermission`](#toolpermission) | Permission rule to add | ###### Returns `this` this for chaining ###### Example ```typescript agent.addPermission({ toolName: 'bash', level: 'once', description: 'Execute shell commands', }); ``` ##### addPin() ```ts addPin(input): Anchor | undefined; ``` Defined in: [agent.ts:1478](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1478) Add a pin (critical information that survives context compaction). Pins are injected into every LLM call and never get compacted. Use them for information that must not be forgotten. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `input` | [`AnchorInput`](#anchorinput) | Pin input (uses AnchorInput type) | ###### Returns [`Anchor`](#anchor) \| `undefined` The created pin, or undefined if pins are not enabled ###### Example ```typescript agent.addPin({ content: 'Team roster: $default, $arch', priority: 'info', scope: 'session', }); ``` ##### checkpoint() ```ts checkpoint(metadata?): Promise; ``` Defined in: [agent.ts:2279](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L2279) Save the current state using the configured checkpointer. Throws if no checkpointer is configured. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `metadata?` | `Partial`\<[`SessionMetadata`](#sessionmetadata)\> | Optional metadata overrides | ###### Returns `Promise`\<`string`\> The session ID ###### Example ```typescript const agent = new Agent({ provider, checkpointer: new FileCheckpointer('~/.myapp/sessions/'), }); await agent.run('Hello!'); const sessionId = await agent.checkpoint(); console.log(`Saved as: ${sessionId}`); ``` ##### ~~clearAnchors()~~ ```ts clearAnchors(options?): number; ``` Defined in: [agent.ts:1613](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1613) ###### Parameters | Parameter | Type | | ------ | ------ | | `options?` | [`AnchorClearOptions`](#anchorclearoptions) | ###### Returns `number` ###### Deprecated Use clearPins() instead ##### clearHistory() ```ts clearHistory(): this; ``` Defined in: [agent.ts:1875](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1875) Clear conversation history to start fresh ###### Returns `this` ##### clearPins() ```ts clearPins(options?): number; ``` Defined in: [agent.ts:1528](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1528) Clear pins based on criteria ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `options?` | [`AnchorClearOptions`](#anchorclearoptions) | Clear options for filtering which pins to remove | ###### Returns `number` Number of pins removed ##### clearSessionPermissions() ```ts clearSessionPermissions(): this; ``` Defined in: [agent.ts:1790](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1790) Clear all session-level permissions ###### Returns `this` ##### compact() ```ts compact(options?): Promise<{ categoryStats?: Record; filesCreated?: string[]; messagesPreserved: number; originalTokens: number; restorationHintsInjected: boolean; rounds: number; success: boolean; summary: string; summaryTokens: number; toolResultsRepaired: number; }>; ``` Defined in: [agent.ts:2049](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L2049) Compact the conversation context to reduce token usage. This is the recommended way to trigger context compaction externally. It handles: 1. Summarizing older messages 2. Repairing tool use/result pairing (prevents API errors) 3. Injecting context restoration hints (if file tracking is enabled) 4. Updating the conversation history ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `options?` | \{ `emergency?`: `boolean`; `injectRestorationHints?`: `boolean`; `targetUtilization?`: `number`; `useSmartCompaction?`: `boolean`; \} | Compaction options | | `options.emergency?` | `boolean` | Use emergency mode (more aggressive summarization). Default: auto-detect based on context utilization | | `options.injectRestorationHints?` | `boolean` | Inject file restoration hints after compaction. Only applies if file tracking is enabled. Default: true (if file tracking is enabled) | | `options.targetUtilization?` | `number` | Target utilization after compaction (0-1). Default: from context manager config (typically 0.5) | | `options.useSmartCompaction?` | `boolean` | Use smart category-aware compaction instead of simple summarization. Smart compaction: - Preserves system and recent messages completely - Saves large tool results to files - Summarizes history with LLM Default: true | ###### Returns `Promise`\<\{ `categoryStats?`: `Record`\<[`ContextCategory`](#contextcategory), \{ `action`: `"preserved"` \| `"compacted"` \| `"summarized"`; `tokensAfter`: `number`; `tokensBefore`: `number`; \}\>; `filesCreated?`: `string`[]; `messagesPreserved`: `number`; `originalTokens`: `number`; `restorationHintsInjected`: `boolean`; `rounds`: `number`; `success`: `boolean`; `summary`: `string`; `summaryTokens`: `number`; `toolResultsRepaired`: `number`; \}\> Compaction result with statistics ###### Example ```typescript // Basic compaction const result = await agent.compact(); console.log(`Reduced from ${result.originalTokens} to ${result.summaryTokens} tokens`); // Compaction without restoration hints await agent.compact({ injectRestorationHints: false }); // Emergency compaction (more aggressive) await agent.compact({ emergency: true }); ``` ##### createSubAgent() ```ts createSubAgent(config): this; ``` Defined in: [agent.ts:2463](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L2463) Create and register a sub-agent with isolated context. Sub-agents are specialized agents that handle discrete tasks independently. They have their own context window and can have different tools/permissions. ###### Parameters | Parameter | Type | | ------ | ------ | | `config` | [`SubAgentConfig`](#subagentconfig) | ###### Returns `this` ###### Example ```typescript agent.createSubAgent({ name: 'code-reviewer', description: 'Reviews code for security and quality issues', systemPrompt: 'You are a code review specialist...', tools: [readFileTool], // Restricted tools contextMode: 'isolated', }); const result = await agent.runSubAgent('code-reviewer', 'Review src/auth.ts'); ``` ##### createWithMemory() ```ts static createWithMemory( config, memoryOptions?, memoryDir?): Promise; ``` Defined in: [agent.ts:1307](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1307) Create an agent with project memory loaded from files. This factory method automatically discovers and loads project-specific instructions from files like CLAUDE.md, GEMINI.md, PROJECT.md, etc. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `config` | `Omit`\<[`AgentConfig`](#agentconfig), `"projectMemory"`\> | Agent configuration | | `memoryOptions?` | [`ProjectMemoryOptions`](#projectmemoryoptions) | Project memory loading options | | `memoryDir?` | `string` | Directory to search for memory files (defaults to cwd) | ###### Returns `Promise`\<[`Agent`](#agent)\> Agent instance with loaded project memory ###### Example ```typescript // Load Claude-specific instructions const agent = await Agent.createWithMemory( { provider, systemPrompt: 'You are a helpful assistant.', }, { providers: 'claude' }, '/path/to/project' ); // Load instructions for multiple providers const agent = await Agent.createWithMemory( { provider }, { providers: ['claude', 'gemini'], includeGeneric: true } ); // Access loaded memory const memory = agent.getProjectMemory(); console.log(`Loaded ${memory?.files.length} memory files`); ``` ##### disableGuardrail() ```ts disableGuardrail(id): boolean; ``` Defined in: [agent.ts:1690](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1690) Disable a guardrail by ID ###### Parameters | Parameter | Type | | ------ | ------ | | `id` | `string` | ###### Returns `boolean` ##### disposeAllSubAgents() ```ts disposeAllSubAgents(): void; ``` Defined in: [agent.ts:2739](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L2739) Dispose all sub-agents and release their resources. Useful for cleanup when the parent agent is done or to free memory during long-running sessions. ###### Returns `void` ##### disposeSubAgent() ```ts disposeSubAgent(name): boolean; ``` Defined in: [agent.ts:2714](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L2714) Dispose a sub-agent and release its resources. This clears the sub-agent's: - Conversation history - Context manager state - Tool registry After disposal, the sub-agent must be re-created to use again. ###### Parameters | Parameter | Type | | ------ | ------ | | `name` | `string` | ###### Returns `boolean` ##### emitCustomEvent() ```ts emitCustomEvent(config): void; ``` Defined in: [agent.ts:1840](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1840) Emit a custom event that will be streamed to event handlers. This allows tools, middleware, and user code to emit custom events that are streamed alongside built-in agent events. Inspired by LangGraph's get_stream_writer() pattern. Addresses issues like LangGraph #6330 (preserve event metadata). ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `config` | [`CustomEventConfig`](#customeventconfig) | Custom event configuration | ###### Returns `void` ###### Example ```typescript agent.emitCustomEvent({ name: 'progress', data: { step: 1, total: 5, message: 'Processing...' }, metadata: { toolName: 'myTool' }, }); ``` ##### enableGuardrail() ```ts enableGuardrail(id): boolean; ``` Defined in: [agent.ts:1683](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1683) Enable a guardrail by ID ###### Parameters | Parameter | Type | | ------ | ------ | | `id` | `string` | ###### Returns `boolean` ##### formatRestorationHints() ```ts formatRestorationHints(): string; ``` Defined in: [agent.ts:1978](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1978) Format context restoration hints based on tracked file accesses. Returns empty string if no files have been accessed or file tracking is disabled. ###### Returns `string` ##### fromState() ```ts static fromState(state, options): Agent; ``` Defined in: [agent.ts:2387](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L2387) Create an agent from a serialized AgentState object. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `state` | [`AgentState`](#agentstate) | The serialized agent state | | `options` | \{ `checkpointer?`: [`Checkpointer`](#checkpointer-1); `onEvent?`: [`AgentEventHandler`](#agenteventhandler); `provider`: [`LLMProvider`](#llmprovider); `systemPrompt?`: `string`; `tools?`: [`Tool`](#tool)\<`object`\>[]; \} | Options for the new agent | | `options.checkpointer?` | [`Checkpointer`](#checkpointer-1) | - | | `options.onEvent?` | [`AgentEventHandler`](#agenteventhandler) | - | | `options.provider` | [`LLMProvider`](#llmprovider) | - | | `options.systemPrompt?` | `string` | - | | `options.tools?` | [`Tool`](#tool)\<`object`\>[] | - | ###### Returns [`Agent`](#agent) ###### Example ```typescript // Load state from somewhere const json = await fs.readFile('session.json', 'utf-8'); const state = JSON.parse(json); // Create agent from state const agent = Agent.fromState(state, { provider }); await agent.run('Continue...'); ``` ##### ~~getAnchor()~~ ```ts getAnchor(id): Anchor | undefined; ``` Defined in: [agent.ts:1597](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1597) ###### Parameters | Parameter | Type | | ------ | ------ | | `id` | `string` | ###### Returns [`Anchor`](#anchor) \| `undefined` ###### Deprecated Use getPin() instead ##### ~~getAnchorManager()~~ ```ts getAnchorManager(): AnchorManager | undefined; ``` Defined in: [agent.ts:1617](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1617) ###### Returns [`AnchorManager`](#anchormanager) \| `undefined` ###### Deprecated Use getPinManager() instead ##### ~~getAnchors()~~ ```ts getAnchors(options?): Anchor[]; ``` Defined in: [agent.ts:1601](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1601) ###### Parameters | Parameter | Type | | ------ | ------ | | `options?` | [`AnchorQueryOptions`](#anchorqueryoptions) | ###### Returns [`Anchor`](#anchor)[] ###### Deprecated Use getPins() instead ##### getBudgetStatus() ```ts getBudgetStatus(): BudgetStatus | undefined; ``` Defined in: [agent.ts:1415](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1415) Get budget status. ###### Returns [`BudgetStatus`](#budgetstatus) \| `undefined` ##### getContextManager() ```ts getContextManager(): ContextManager | undefined; ``` Defined in: [agent.ts:1923](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1923) Get the context manager (if configured) ###### Returns [`ContextManager`](#contextmanager) \| `undefined` ##### getContextStats() ```ts getContextStats(): ContextStats | undefined; ``` Defined in: [agent.ts:1938](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1938) Get context statistics ###### Returns [`ContextStats`](#contextstats-1) \| `undefined` ##### getDeadMessagePruneStats() ```ts getDeadMessagePruneStats(): | { errorsPruned: number; permissionsPruned: number; prunedCount: number; tokensSaved: number; } | undefined; ``` Defined in: [agent.ts:1954](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1954) Get dead message pruning statistics (errors pruned, permissions pruned, tokens saved). ###### Returns \| \{ `errorsPruned`: `number`; `permissionsPruned`: `number`; `prunedCount`: `number`; `tokensSaved`: `number`; \} \| `undefined` ##### getFileTracker() ```ts getFileTracker(): FileAccessTracker | undefined; ``` Defined in: [agent.ts:1970](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1970) Get the file access tracker (if file tracking is enabled) ###### Returns [`FileAccessTracker`](#fileaccesstracker) \| `undefined` ##### getGuardrail() ```ts getGuardrail(id): Guardrail | undefined; ``` Defined in: [agent.ts:1655](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1655) Get a guardrail by ID ###### Parameters | Parameter | Type | | ------ | ------ | | `id` | `string` | ###### Returns [`Guardrail`](#guardrail) \| `undefined` ##### getGuardrailManager() ```ts getGuardrailManager(): GuardrailManager | undefined; ``` Defined in: [agent.ts:1697](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1697) Get the guardrail manager (if configured) ###### Returns [`GuardrailManager`](#guardrailmanager) \| `undefined` ##### getGuardrails() ```ts getGuardrails(): Guardrail[]; ``` Defined in: [agent.ts:1662](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1662) Get all guardrails ###### Returns [`Guardrail`](#guardrail)[] ##### getHistory() ```ts getHistory(): Message[]; ``` Defined in: [agent.ts:1886](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1886) Get the current conversation history ###### Returns [`Message`](#message-4)[] ##### getModel() ```ts getModel(): string; ``` Defined in: [agent.ts:1553](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1553) Get the current model ID for this agent. ###### Returns `string` The model ID string (e.g., 'claude-sonnet-4-20250514') ##### getObservationMaskStats() ```ts getObservationMaskStats(): | { activeStamps: number; inputsCompacted: number; maskedCount: number; tokensSaved: number; } | undefined; ``` Defined in: [agent.ts:1945](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1945) Get observation masking statistics (tokens saved, observations masked, inputs compacted). ###### Returns \| \{ `activeStamps`: `number`; `inputsCompacted`: `number`; `maskedCount`: `number`; `tokensSaved`: `number`; \} \| `undefined` ##### getPermission() ```ts getPermission(toolName): ToolPermission | undefined; ``` Defined in: [agent.ts:1742](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1742) Get a permission rule by tool name ###### Parameters | Parameter | Type | | ------ | ------ | | `toolName` | `string` | ###### Returns [`ToolPermission`](#toolpermission) \| `undefined` ##### getPermissionLevel() ```ts getPermissionLevel(toolName): PermissionLevel; ``` Defined in: [agent.ts:1768](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1768) Get the effective permission level for a tool ###### Parameters | Parameter | Type | | ------ | ------ | | `toolName` | `string` | ###### Returns [`PermissionLevel`](#permissionlevel) ##### getPermissionManager() ```ts getPermissionManager(): PermissionManager | undefined; ``` Defined in: [agent.ts:1805](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1805) Get the permission manager (if configured) ###### Returns [`PermissionManager`](#permissionmanager) \| `undefined` ##### getPermissions() ```ts getPermissions(): ToolPermission[]; ``` Defined in: [agent.ts:1749](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1749) Get all permission rules ###### Returns [`ToolPermission`](#toolpermission)[] ##### getPin() ```ts getPin(id): Anchor | undefined; ``` Defined in: [agent.ts:1489](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1489) Get a pin by ID ###### Parameters | Parameter | Type | | ------ | ------ | | `id` | `string` | ###### Returns [`Anchor`](#anchor) \| `undefined` ##### getPinManager() ```ts getPinManager(): AnchorManager | undefined; ``` Defined in: [agent.ts:1535](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1535) Get the pin manager (if configured) ###### Returns [`AnchorManager`](#anchormanager) \| `undefined` ##### getPins() ```ts getPins(options?): Anchor[]; ``` Defined in: [agent.ts:1496](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1496) Get all pins, optionally filtered ###### Parameters | Parameter | Type | | ------ | ------ | | `options?` | [`AnchorQueryOptions`](#anchorqueryoptions) | ###### Returns [`Anchor`](#anchor)[] ##### getProjectMemory() ```ts getProjectMemory(): ProjectMemory | undefined; ``` Defined in: [agent.ts:1356](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1356) Get the loaded project memory (if any). Project memory contains instructions loaded from files like CLAUDE.md, GEMINI.md, PROJECT.md, etc. ###### Returns [`ProjectMemory`](#projectmemory-1) \| `undefined` The loaded project memory, or undefined if none was loaded ###### Example ```typescript const memory = agent.getProjectMemory(); if (memory) { console.log(`Loaded ${memory.files.length} instruction files`); console.log(`Total tokens: ~${memory.estimatedTokens}`); for (const file of memory.files) { console.log(` - ${file.relativePath}`); } } ``` ##### getSessionPermissions() ```ts getSessionPermissions(): string[]; ``` Defined in: [agent.ts:1798](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1798) Get all tools with session-level permission ###### Returns `string`[] ##### getStreamWriter() ```ts getStreamWriter(eventName?): StreamWriter; ``` Defined in: [agent.ts:1866](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1866) Get a stream writer function for emitting custom events. This returns a simple function that can be passed to tools or middleware for streaming progress updates. ###### Parameters | Parameter | Type | Default value | Description | | ------ | ------ | ------ | ------ | | `eventName` | `string` | `'stream'` | Name for all events emitted by this writer | ###### Returns [`StreamWriter`](#streamwriter) A stream writer function ###### Example ```typescript const writer = agent.getStreamWriter('myTool'); writer('Starting...', { phase: 'init' }); writer('Processing...', { phase: 'work', progress: 50 }); writer('Done!', { phase: 'complete' }); ``` ##### getSubAgent() ```ts getSubAgent(name): Agent | undefined; ``` Defined in: [agent.ts:2686](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L2686) Get a registered sub-agent by name ###### Parameters | Parameter | Type | | ------ | ------ | | `name` | `string` | ###### Returns [`Agent`](#agent) \| `undefined` ##### getSubAgentNames() ```ts getSubAgentNames(): string[]; ``` Defined in: [agent.ts:2693](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L2693) Get all registered sub-agent names ###### Returns `string`[] ##### getToolDefinitions() ```ts getToolDefinitions(): ToolDefinition[]; ``` Defined in: [agent.ts:2829](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L2829) Get all registered tool definitions ###### Returns `ToolDefinition`[] ##### getToolRegistry() ```ts getToolRegistry(): ToolRegistry; ``` Defined in: [agent.ts:1931](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1931) Get the tool registry instance. Useful for setting up fallback handlers or inspecting registered tools. ###### Returns [`ToolRegistry`](#toolregistry-1) ##### getTotalInputTokens() ```ts getTotalInputTokens(): number; ``` Defined in: [agent.ts:1401](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1401) Get total input tokens used across all LLM calls. ###### Returns `number` ##### getTotalOutputTokens() ```ts getTotalOutputTokens(): number; ``` Defined in: [agent.ts:1408](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1408) Get total output tokens used across all LLM calls. ###### Returns `number` ##### getTotalTokens() ```ts getTotalTokens(): number; ``` Defined in: [agent.ts:1394](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1394) Get total tokens used across all LLM calls. ###### Returns `number` ##### getUsageStats() ```ts getUsageStats(): UsageStats | undefined; ``` Defined in: [agent.ts:1387](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1387) Get usage tracking statistics. ###### Returns [`UsageStats`](#usagestats) \| `undefined` Usage statistics or undefined if usage tracking is not enabled ###### Example ```typescript const stats = agent.getUsageStats(); if (stats) { console.log(`Total calls: ${stats.totalCalls}`); console.log(`Total tokens: ${stats.totalTokens}`); console.log(`Input tokens: ${stats.totalInputTokens}`); console.log(`Output tokens: ${stats.totalOutputTokens}`); } ``` ##### getUsageSummary() ```ts getUsageSummary(): string | undefined; ``` Defined in: [agent.ts:1429](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1429) Get a human-readable usage summary. ###### Returns `string` \| `undefined` ##### getVerbosityLevel() ```ts getVerbosityLevel(): VerbosityLevel; ``` Defined in: [agent.ts:1963](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1963) Get current verbosity level based on context pressure ###### Returns [`VerbosityLevel`](#verbositylevel-1) ##### grantSessionPermission() ```ts grantSessionPermission(toolName): this; ``` Defined in: [agent.ts:1775](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1775) Grant session-level permission for a tool ###### Parameters | Parameter | Type | | ------ | ------ | | `toolName` | `string` | ###### Returns `this` ##### ~~hasAnchor()~~ ```ts hasAnchor(id): boolean; ``` Defined in: [agent.ts:1605](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1605) ###### Parameters | Parameter | Type | | ------ | ------ | | `id` | `string` | ###### Returns `boolean` ###### Deprecated Use hasPin() instead ##### ~~hasAnchors()~~ ```ts hasAnchors(): boolean; ``` Defined in: [agent.ts:1621](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1621) ###### Returns `boolean` ###### Deprecated Use hasPins() instead ##### hasCheckpointer() ```ts hasCheckpointer(): boolean; ``` Defined in: [agent.ts:2292](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L2292) Check if a checkpointer is configured ###### Returns `boolean` ##### hasGuardrail() ```ts hasGuardrail(id): boolean; ``` Defined in: [agent.ts:1669](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1669) Check if a guardrail exists ###### Parameters | Parameter | Type | | ------ | ------ | | `id` | `string` | ###### Returns `boolean` ##### hasGuardrails() ```ts hasGuardrails(): boolean; ``` Defined in: [agent.ts:1704](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1704) Check if guardrails are enabled ###### Returns `boolean` ##### hasPermissions() ```ts hasPermissions(): boolean; ``` Defined in: [agent.ts:1812](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1812) Check if permissions are enabled ###### Returns `boolean` ##### hasPin() ```ts hasPin(id): boolean; ``` Defined in: [agent.ts:1503](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1503) Check if a pin exists ###### Parameters | Parameter | Type | | ------ | ------ | | `id` | `string` | ###### Returns `boolean` ##### hasPins() ```ts hasPins(): boolean; ``` Defined in: [agent.ts:1542](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1542) Check if pins are enabled ###### Returns `boolean` ##### hasProjectMemory() ```ts hasProjectMemory(): boolean; ``` Defined in: [agent.ts:1363](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1363) Check if project memory was loaded ###### Returns `boolean` ##### hasUsageTracking() ```ts hasUsageTracking(): boolean; ``` Defined in: [agent.ts:1443](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1443) Check if usage tracking is enabled. ###### Returns `boolean` ##### isBudgetExceeded() ```ts isBudgetExceeded(): boolean; ``` Defined in: [agent.ts:1422](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1422) Check if budget is exceeded. ###### Returns `boolean` ##### isToolSilent() ```ts isToolSilent(name): boolean; ``` Defined in: [agent.ts:2836](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L2836) Check if a tool is marked as silent (no spinner or result output) ###### Parameters | Parameter | Type | | ------ | ------ | | `name` | `string` | ###### Returns `boolean` ##### registerTool() ```ts registerTool(tool): this; ``` Defined in: [agent.ts:2808](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L2808) Register a tool that the agent can call during conversations. Tools are functions the LLM can invoke to perform actions like reading files, running commands, or querying APIs. The LLM sees the tool's name, description, and parameter schema, then decides when to call it. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `tool` | [`Tool`](#tool) | Tool definition created with `defineTool()` | ###### Returns `this` The agent instance (for chaining) ###### Example ```typescript agent.registerTool(defineTool({ name: 'get_weather', description: 'Get current weather for a city', parameters: { type: 'object', properties: { city: { type: 'string' } }, required: ['city'], }, execute: async ({ city }) => { const data = await fetchWeather(city); return { content: JSON.stringify(data) }; }, })); ``` ##### registerTools() ```ts registerTools(tools): this; ``` Defined in: [agent.ts:2819](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L2819) Register multiple tools at once. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `tools` | [`Tool`](#tool)\<`object`\>[] | Array of tool definitions | ###### Returns `this` The agent instance (for chaining) ##### ~~removeAnchor()~~ ```ts removeAnchor(id): boolean; ``` Defined in: [agent.ts:1609](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1609) ###### Parameters | Parameter | Type | | ------ | ------ | | `id` | `string` | ###### Returns `boolean` ###### Deprecated Use removePin() instead ##### removeGuardrail() ```ts removeGuardrail(id): boolean; ``` Defined in: [agent.ts:1676](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1676) Remove a guardrail by ID ###### Parameters | Parameter | Type | | ------ | ------ | | `id` | `string` | ###### Returns `boolean` ##### removePermission() ```ts removePermission(toolName): boolean; ``` Defined in: [agent.ts:1735](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1735) Remove a permission rule by tool name ###### Parameters | Parameter | Type | | ------ | ------ | | `toolName` | `string` | ###### Returns `boolean` ##### removePin() ```ts removePin(id): boolean; ``` Defined in: [agent.ts:1512](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1512) Remove a pin by ID ###### Parameters | Parameter | Type | | ------ | ------ | | `id` | `string` | ###### Returns `boolean` true if pin was removed, false if not found ##### removeSubAgent() ```ts removeSubAgent(name): boolean; ``` Defined in: [agent.ts:2700](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L2700) Remove a registered sub-agent (alias for disposeSubAgent) ###### Parameters | Parameter | Type | | ------ | ------ | | `name` | `string` | ###### Returns `boolean` ##### resetUsageTracking() ```ts resetUsageTracking(): void; ``` Defined in: [agent.ts:1436](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1436) Reset usage tracking data. ###### Returns `void` ##### resume() ```ts static resume(sessionId, options): Promise; ``` Defined in: [agent.ts:2345](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L2345) Resume an agent from a saved session. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `sessionId` | `string` | Session ID to resume | | `options` | \{ `checkpointer`: [`Checkpointer`](#checkpointer-1); `onEvent?`: [`AgentEventHandler`](#agenteventhandler); `provider`: [`LLMProvider`](#llmprovider); `systemPrompt?`: `string`; `tools?`: [`Tool`](#tool)\<`object`\>[]; \} | Resume options (provider and checkpointer required) | | `options.checkpointer` | [`Checkpointer`](#checkpointer-1) | - | | `options.onEvent?` | [`AgentEventHandler`](#agenteventhandler) | - | | `options.provider` | [`LLMProvider`](#llmprovider) | - | | `options.systemPrompt?` | `string` | - | | `options.tools?` | [`Tool`](#tool)\<`object`\>[] | - | ###### Returns `Promise`\<[`Agent`](#agent)\> ###### Example ```typescript const checkpointer = new FileCheckpointer('~/.myapp/sessions/'); // Resume a previous session const agent = await Agent.resume('session_abc123', { provider: new ClaudeProvider({ apiKey: '...' }), checkpointer, }); // Continue the conversation await agent.run('Continue where we left off...'); ``` ##### revokeSessionPermission() ```ts revokeSessionPermission(toolName): boolean; ``` Defined in: [agent.ts:1783](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1783) Revoke session-level permission for a tool ###### Parameters | Parameter | Type | | ------ | ------ | | `toolName` | `string` | ###### Returns `boolean` ##### run() ```ts run(userMessage, options?): Promise; ``` Defined in: [agent.ts:2874](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L2874) Run the agent with a user message and return the result. This is the main entry point for agent interaction. The agent will: 1. Add the user message to conversation history 2. Send the conversation to the LLM 3. Execute any tool calls the LLM requests 4. Repeat steps 2-3 until the LLM responds with text (no tool calls) 5. Return the final text response and metadata Events are emitted throughout the process via the `onEvent` callback configured at construction time. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `userMessage` | `string` \| [`ContentBlock`](#contentblock)[] | The user's message (string or content blocks for images) | | `options?` | [`RunOptions`](#runoptions) | Optional run configuration (max iterations, abort signal, etc.) | ###### Returns `Promise`\<[`AgentRunResult`](#agentrunresult)\> The agent's response, tool call history, and context stats ###### Examples ```typescript const result = await agent.run('What files are in this directory?'); console.log(result.response); console.log(`Used ${result.toolCalls.length} tool calls`); ``` ```typescript // With abort signal const controller = new AbortController(); const result = await agent.run('Refactor this file', { signal: controller.signal, }); ``` ##### runParallelSubAgents() ```ts runParallelSubAgents(tasks, options?): Promise; ``` Defined in: [agent.ts:2644](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L2644) Run multiple sub-agents in parallel with proper state isolation. This method ensures that parallel sub-agents don't share mutable state, preventing race conditions and state leakage between concurrent runs. Inspired by LangGraph issue #6446: Parallel subgraphs with shared state keys cause InvalidUpdateError. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `tasks` | \{ `name`: `string`; `task`: `string`; \}[] | Array of {name, task} objects to run in parallel | | `options?` | [`RunOptions`](#runoptions) | Optional run options applied to all sub-agents | ###### Returns `Promise`\<[`SubAgentResult`](#subagentresult)[]\> Array of results in the same order as tasks ###### Example ```typescript // Run code review and security scan in parallel const results = await agent.runParallelSubAgents([ { name: 'code-reviewer', task: 'Review src/auth.ts' }, { name: 'security-scanner', task: 'Scan src/auth.ts for vulnerabilities' }, ]); ``` ##### runSubAgent() ```ts runSubAgent( name, task, options?): Promise; ``` Defined in: [agent.ts:2533](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L2533) Run a sub-agent with a specific task. The sub-agent executes independently with its own context and returns the result to the parent agent. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `name` | `string` | Name of the registered sub-agent | | `task` | `string` | Task description for the sub-agent | | `options?` | [`RunOptions`](#runoptions) | Optional run options | ###### Returns `Promise`\<[`SubAgentResult`](#subagentresult)\> ##### serialize() ```ts serialize(): AgentState; ``` Defined in: [agent.ts:2245](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L2245) Serialize the current agent state to an AgentState object. This can be used for manual persistence or transferring state. ###### Returns [`AgentState`](#agentstate) ###### Example ```typescript const state = agent.serialize(); const json = JSON.stringify(state); // Store json somewhere... ``` ##### setHistory() ```ts setHistory(messages, options?): Promise; ``` Defined in: [agent.ts:1898](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1898) Set the conversation history (for manual compaction/restoration) Also updates the context manager's token count if configured. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `messages` | [`Message`](#message-4)[] | The message history to restore | | `options?` | \{ `turnCount?`: `number`; \} | Optional restore options | | `options.turnCount?` | `number` | The turn count to restore (important for compaction) | ###### Returns `Promise`\<[`Agent`](#agent)\> ##### setModel() ```ts setModel(modelId): void; ``` Defined in: [agent.ts:1581](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1581) Change the model for subsequent LLM calls (same provider only). Takes effect on the next `run()` or `stream()` call — never interrupts a running turn. Conversation history is preserved (it's provider-agnostic). Emits a `model_changed` event. Use this to switch between models within the same provider, e.g., Claude Sonnet → Claude Opus for a harder task, then back. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `modelId` | `string` | The new model ID (e.g., 'claude-opus-4-20250514') | ###### Returns `void` ###### Throws If modelId is empty or not a string ###### Example ```typescript console.log(agent.getModel()); // 'claude-sonnet-4-20250514' agent.setModel('claude-opus-4-20250514'); // Next run() uses Opus const result = await agent.run('Solve this complex problem'); agent.setModel('claude-sonnet-4-20250514'); // Switch back ``` ###### Since 0.5.8 ##### setPermissionLevel() ```ts setPermissionLevel( toolName, level, description?): this; ``` Defined in: [agent.ts:1760](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L1760) Set the permission level for a tool ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `toolName` | `string` | Tool name or pattern | | `level` | [`PermissionLevel`](#permissionlevel) | Permission level | | `description?` | `string` | Optional description | ###### Returns `this` ##### stream() ```ts stream(userMessage, options?): AsyncIterable; ``` Defined in: [agent.ts:3970](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L3970) Stream the agent's response as events. Yields `AgentEvent` objects in real time as the agent thinks, calls tools, and generates text. Use this for building interactive UIs that show progress as it happens. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `userMessage` | `string` | The user's message | | `options?` | [`RunOptions`](#runoptions) | Optional run configuration | ###### Returns `AsyncIterable`\<[`AgentEvent`](#agentevent)\> An async iterable of agent events ###### Example ```typescript for await (const event of agent.stream('Explain this code')) { if (event.type === 'llm_chunk') { process.stdout.write(event.chunk.text ?? ''); } else if (event.type === 'tool_start') { console.log(`\nCalling tool: ${event.name}`); } else if (event.type === 'done') { console.log('\n\nDone!'); } } ``` *** ### AgentError Defined in: [errors.ts:14](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L14) Base error class for all agent-related errors. #### Extends - `Error` #### Extended by - [`ProviderError`](#providererror) - [`ToolError`](#toolerror) - [`ToolLoopError`](#toollooperror) - [`ValidationError`](#validationerror) - [`MaxIterationsError`](#maxiterationserror) - [`AbortError`](#aborterror) - [`ContextOverflowError`](#contextoverflowerror) - [`MCPError`](#mcperror) #### Constructors ##### Constructor ```ts new AgentError(message, cause?): AgentError; ``` Defined in: [errors.ts:15](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L15) ###### Parameters | Parameter | Type | | ------ | ------ | | `message` | `string` | | `cause?` | `Error` | ###### Returns [`AgentError`](#agenterror) ###### Overrides ```ts Error.constructor ``` #### Properties ##### cause? ```ts readonly optional cause?: Error; ``` Defined in: [errors.ts:17](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L17) ###### Inherited from ```ts Error.cause ``` *** ### AnchorManager Defined in: [anchors/manager.ts:58](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/manager.ts#L58) AnchorManager - Manages critical information that survives context compaction #### Example ```typescript const manager = new AnchorManager({ maxAnchors: 20, maxTokens: 2000, persistPath: '~/.myapp/anchors.json', }); // Add a session anchor manager.add({ content: 'This session we implemented: edit tool, grep tool', priority: 'critical', scope: 'session', }); // Get formatted anchors for injection into LLM messages const formatted = manager.format(); ``` #### Constructors ##### Constructor ```ts new AnchorManager(options?): AnchorManager; ``` Defined in: [anchors/manager.ts:68](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/manager.ts#L68) ###### Parameters | Parameter | Type | | ------ | ------ | | `options` | [`AnchorManagerOptions`](#anchormanageroptions) | ###### Returns [`AnchorManager`](#anchormanager) #### Accessors ##### size ###### Get Signature ```ts get size(): number; ``` Defined in: [anchors/manager.ts:382](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/manager.ts#L382) Get the current number of anchors ###### Returns `number` #### Methods ##### add() ```ts add(input): Anchor; ``` Defined in: [anchors/manager.ts:118](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/manager.ts#L118) Add a new anchor ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `input` | [`AnchorInput`](#anchorinput) | Anchor input (id and createdAt auto-generated if not provided) | ###### Returns [`Anchor`](#anchor) The created anchor ##### clear() ```ts clear(options?): number; ``` Defined in: [anchors/manager.ts:249](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/manager.ts#L249) Clear anchors based on criteria ###### Parameters | Parameter | Type | | ------ | ------ | | `options?` | [`AnchorClearOptions`](#anchorclearoptions) | ###### Returns `number` ##### clearByProject() ```ts clearByProject(projectId): number; ``` Defined in: [anchors/manager.ts:330](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/manager.ts#L330) Clear all anchors for a specific project ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `projectId` | `string` | The project ID | ###### Returns `number` Number of anchors removed ##### format() ```ts format(): string; ``` Defined in: [anchors/manager.ts:411](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/manager.ts#L411) Format anchors for injection into LLM messages Groups anchors by priority and formats them for the system message. ###### Returns `string` ##### get() ```ts get(id): Anchor | undefined; ``` Defined in: [anchors/manager.ts:164](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/manager.ts#L164) Get an anchor by ID ###### Parameters | Parameter | Type | | ------ | ------ | | `id` | `string` | ###### Returns [`Anchor`](#anchor) \| `undefined` ##### getAll() ```ts getAll(options?): Anchor[]; ``` Defined in: [anchors/manager.ts:176](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/manager.ts#L176) Get all anchors, optionally filtered ###### Parameters | Parameter | Type | | ------ | ------ | | `options?` | [`AnchorQueryOptions`](#anchorqueryoptions) | ###### Returns [`Anchor`](#anchor)[] ##### getByProject() ```ts getByProject(projectId, options?): Anchor[]; ``` Defined in: [anchors/manager.ts:308](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/manager.ts#L308) Get all anchors for a specific project ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `projectId` | `string` | The project ID to filter by | | `options?` | `Omit`\<[`AnchorQueryOptions`](#anchorqueryoptions), `"projectId"` \| `"globalOnly"`\> | Additional query options (priority, scope, tags) | ###### Returns [`Anchor`](#anchor)[] ##### getGlobal() ```ts getGlobal(options?): Anchor[]; ``` Defined in: [anchors/manager.ts:320](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/manager.ts#L320) Get all global anchors (those without a projectId) ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `options?` | `Omit`\<[`AnchorQueryOptions`](#anchorqueryoptions), `"projectId"` \| `"globalOnly"`\> | Additional query options (priority, scope, tags) | ###### Returns [`Anchor`](#anchor)[] ##### getProjectIds() ```ts getProjectIds(): string[]; ``` Defined in: [anchors/manager.ts:337](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/manager.ts#L337) Get list of unique project IDs that have anchors ###### Returns `string`[] ##### getProjectStats() ```ts getProjectStats(): Map; ``` Defined in: [anchors/manager.ts:364](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/manager.ts#L364) Get anchor counts grouped by project ###### Returns `Map`\<`string` \| `null`, `number`\> Map where keys are project IDs (null for global) and values are counts ##### getTotalTokens() ```ts getTotalTokens(): number; ``` Defined in: [anchors/manager.ts:389](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/manager.ts#L389) Get total tokens used by all anchors ###### Returns `number` ##### getUtilization() ```ts getUtilization(): number; ``` Defined in: [anchors/manager.ts:402](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/manager.ts#L402) Get token budget utilization (0-1) ###### Returns `number` ##### has() ```ts has(id): boolean; ``` Defined in: [anchors/manager.ts:222](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/manager.ts#L222) Check if an anchor exists ###### Parameters | Parameter | Type | | ------ | ------ | | `id` | `string` | ###### Returns `boolean` ##### hasProjectAnchors() ```ts hasProjectAnchors(projectId): boolean; ``` Defined in: [anchors/manager.ts:350](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/manager.ts#L350) Check if a project has any anchors ###### Parameters | Parameter | Type | | ------ | ------ | | `projectId` | `string` | ###### Returns `boolean` ##### onEvent() ```ts onEvent(handler): void; ``` Defined in: [anchors/manager.ts:91](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/manager.ts#L91) Set the event handler for anchor events ###### Parameters | Parameter | Type | | ------ | ------ | | `handler` | [`AnchorEventHandler`](#anchoreventhandler) | ###### Returns `void` ##### remove() ```ts remove(id): boolean; ``` Defined in: [anchors/manager.ts:231](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/manager.ts#L231) Remove an anchor by ID ###### Parameters | Parameter | Type | | ------ | ------ | | `id` | `string` | ###### Returns `boolean` true if anchor was removed, false if not found *** ### ClaudeProvider Defined in: [providers/claude.ts:186](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/claude.ts#L186) LLM provider for Anthropic's Claude models (Opus, Sonnet, Haiku). Supports streaming, tool use, prompt caching, extended context (1M tokens), and token-efficient tool schemas. #### Examples ```typescript const provider = new ClaudeProvider({ apiKey: process.env.ANTHROPIC_API_KEY, model: 'claude-sonnet-4-20250514', }); const agent = new Agent({ provider, systemPrompt: 'You are a helpful assistant.', }); ``` ```typescript // Using the factory function const provider = createClaudeProvider({ apiKey: 'sk-ant-...', enableExtendedContext: true, // 1M token context }); ``` #### Implements - [`LLMProvider`](#llmprovider) #### Constructors ##### Constructor ```ts new ClaudeProvider(config): ClaudeProvider; ``` Defined in: [providers/claude.ts:197](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/claude.ts#L197) ###### Parameters | Parameter | Type | | ------ | ------ | | `config` | [`ClaudeProviderConfig`](#claudeproviderconfig) | ###### Returns [`ClaudeProvider`](#claudeprovider) #### Properties ##### name ```ts readonly name: "claude" = 'claude'; ``` Defined in: [providers/claude.ts:187](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/claude.ts#L187) Provider identifier (e.g., 'claude', 'openai', 'gemini') ###### Implementation of [`LLMProvider`](#llmprovider).[`name`](#name-21) #### Methods ##### chat() ```ts chat(messages, options?): AsyncIterable; ``` Defined in: [providers/claude.ts:222](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/claude.ts#L222) Send messages and stream the response ###### Parameters | Parameter | Type | | ------ | ------ | | `messages` | [`Message`](#message-4)[] | | `options?` | [`ChatOptions`](#chatoptions-1) | ###### Returns `AsyncIterable`\<[`StreamChunk`](#streamchunk)\> ###### Implementation of [`LLMProvider`](#llmprovider).[`chat`](#chat-13) ##### countTokens() ```ts countTokens(messages): Promise; ``` Defined in: [providers/claude.ts:341](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/claude.ts#L341) Count tokens in messages using tiktoken (cl100k_base encoding) ###### Parameters | Parameter | Type | | ------ | ------ | | `messages` | [`Message`](#message-4)[] | ###### Returns `Promise`\<`number`\> ###### Implementation of [`LLMProvider`](#llmprovider).[`countTokens`](#counttokens-14) ##### getModel() ```ts getModel(): string; ``` Defined in: [providers/claude.ts:211](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/claude.ts#L211) Get the current default model ID. ###### Returns `string` ###### Implementation of [`LLMProvider`](#llmprovider).[`getModel`](#getmodel-14) ##### setModel() ```ts setModel(modelId): void; ``` Defined in: [providers/claude.ts:215](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/claude.ts#L215) Change the default model for subsequent calls. Same provider only. Takes effect on the next chat() call, not mid-stream. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `modelId` | `string` | The new model ID (e.g., 'claude-opus-4-20250514') | ###### Returns `void` ###### Implementation of [`LLMProvider`](#llmprovider).[`setModel`](#setmodel-14) *** ### CompactJsonSerializer Defined in: [state/serializer.ts:139](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/serializer.ts#L139) Compact JSON serializer (no pretty printing). Useful for storage-constrained environments. #### Implements - [`StateSerializer`](#stateserializer) #### Constructors ##### Constructor ```ts new CompactJsonSerializer(): CompactJsonSerializer; ``` ###### Returns [`CompactJsonSerializer`](#compactjsonserializer) #### Properties ##### version ```ts readonly version: "1.0" = '1.0'; ``` Defined in: [state/serializer.ts:140](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/serializer.ts#L140) Version identifier for migration support ###### Implementation of [`StateSerializer`](#stateserializer).[`version`](#version-4) #### Methods ##### deserialize() ```ts deserialize(data): AgentState; ``` Defined in: [state/serializer.ts:153](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/serializer.ts#L153) Deserialize string back to agent state ###### Parameters | Parameter | Type | | ------ | ------ | | `data` | `string` | ###### Returns [`AgentState`](#agentstate) ###### Throws StateError if data is invalid ###### Implementation of [`StateSerializer`](#stateserializer).[`deserialize`](#deserialize-2) ##### serialize() ```ts serialize(state): string; ``` Defined in: [state/serializer.ts:142](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/serializer.ts#L142) Serialize agent state to string ###### Parameters | Parameter | Type | | ------ | ------ | | `state` | [`AgentState`](#agentstate) | ###### Returns `string` ###### Implementation of [`StateSerializer`](#stateserializer).[`serialize`](#serialize-3) ##### validate() ```ts validate(state): void; ``` Defined in: [state/serializer.ts:181](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/serializer.ts#L181) Validate state before serialization (public interface method). This is called by checkpointers before saving to prevent corrupted checkpoints. ###### Parameters | Parameter | Type | | ------ | ------ | | `state` | [`AgentState`](#agentstate) | ###### Returns `void` ###### Throws StateError if state is invalid ###### Implementation of [`StateSerializer`](#stateserializer).[`validate`](#validate-2) *** ### ContextManager Defined in: [context/manager.ts:143](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/manager.ts#L143) Manages the agent's context window — tracks token usage, triggers compaction when the conversation grows too large, and ensures the agent never exceeds the model's context limit. The context window is divided into budgets: - **System prompt** (~15%) — always present, never compacted - **Anchors/pins** (~10%) — critical info that survives compaction - **Conversation history** (~75%) — compacted when budget exceeded When conversation history exceeds its budget, the manager triggers smart windowing (3-zone compaction): recent messages preserved, middle messages summarized, old messages dropped. #### Example ```typescript const agent = new Agent({ provider, contextManager: new ContextManager({ maxTokens: 100000, budgets: { system: 0.15, anchors: 0.10, conversation: 0.75 }, }), }); ``` #### Constructors ##### Constructor ```ts new ContextManager(options): ContextManager; ``` Defined in: [context/manager.ts:163](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/manager.ts#L163) ###### Parameters | Parameter | Type | | ------ | ------ | | `options` | [`ContextManagerOptions`](#contextmanageroptions) | ###### Returns [`ContextManager`](#contextmanager) #### Methods ##### addToCategory() ```ts addToCategory(category, tokens): void; ``` Defined in: [context/manager.ts:410](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/manager.ts#L410) Add tokens to a category ###### Parameters | Parameter | Type | | ------ | ------ | | `category` | [`ContextCategory`](#contextcategory) | | `tokens` | `number` | ###### Returns `void` ##### canAddContent() ```ts canAddContent(estimatedTokens, category): PreflightResult; ``` Defined in: [context/manager.ts:873](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/manager.ts#L873) Check if content can be added to a category Returns a pre-flight result with recommendations for action. ###### Parameters | Parameter | Type | | ------ | ------ | | `estimatedTokens` | `number` | | `category` | [`ContextCategory`](#contextcategory) | ###### Returns [`PreflightResult`](#preflightresult) ##### categorizeMessages() ```ts categorizeMessages(messages, preserveRecentTurns?): Promise; ``` Defined in: [context/manager.ts:549](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/manager.ts#L549) Categorize all messages by type for smart compaction This method: 1. Identifies system messages 2. Separates recent messages (last N turns) that should never be compacted 3. Identifies tool results in older messages 4. Classifies remaining older messages as history ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `messages` | [`Message`](#message-4)[] | All messages to categorize | | `preserveRecentTurns?` | `number` | Number of recent turns to preserve (default: config value) | ###### Returns `Promise`\<`CategorizedMessages`\> ##### categoryNeedsCompaction() ```ts categoryNeedsCompaction(category): boolean; ``` Defined in: [context/manager.ts:418](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/manager.ts#L418) Check if a specific category needs compaction ###### Parameters | Parameter | Type | | ------ | ------ | | `category` | [`ContextCategory`](#contextcategory) | ###### Returns `boolean` ##### checkAndWarn() ```ts checkAndWarn(): void; ``` Defined in: [context/manager.ts:1302](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/manager.ts#L1302) Check context and emit warning if needed ###### Returns `void` ##### compact() ```ts compact(messages, saveToFile): Promise<{ messages: Message[]; result: CompactionResult; }>; ``` Defined in: [context/manager.ts:1054](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/manager.ts#L1054) Compact old messages by replacing large content with file references This is a placeholder - actual implementation requires file system access which will be provided by the Agent or CLI layer. ###### Parameters | Parameter | Type | | ------ | ------ | | `messages` | [`Message`](#message-4)[] | | `saveToFile` | (`content`, `index`) => `Promise`\<`string`\> | ###### Returns `Promise`\<\{ `messages`: [`Message`](#message-4)[]; `result`: [`CompactionResult`](#compactionresult); \}\> ##### compactCategory() ```ts compactCategory( messages, category, saveToFile): Promise<{ messages: Message[]; result: CompactionResult; }>; ``` Defined in: [context/manager.ts:429](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/manager.ts#L429) Compact only a specific category This is more targeted than full compaction - only affects messages in the specified category, leaving others untouched. ###### Parameters | Parameter | Type | | ------ | ------ | | `messages` | [`Message`](#message-4)[] | | `category` | [`ContextCategory`](#contextcategory) | | `saveToFile` | (`content`, `index`) => `Promise`\<`string`\> | ###### Returns `Promise`\<\{ `messages`: [`Message`](#message-4)[]; `result`: [`CompactionResult`](#compactionresult); \}\> ##### countTokens() ```ts countTokens(messages): Promise; ``` Defined in: [context/manager.ts:205](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/manager.ts#L205) Count tokens in messages using the provider ###### Parameters | Parameter | Type | | ------ | ------ | | `messages` | [`Message`](#message-4)[] | ###### Returns `Promise`\<`number`\> ##### createRestorationHintMessage() ```ts createRestorationHintMessage(): Message | undefined; ``` Defined in: [context/manager.ts:351](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/manager.ts#L351) Create a system message with context restoration hints. Returns undefined if no hints are available. The caller (Agent) is responsible for injecting this message after compaction or summarization. ###### Returns [`Message`](#message-4) \| `undefined` ##### estimateTokens() ```ts estimateTokens(content): number; ``` Defined in: [context/manager.ts:864](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/manager.ts#L864) Estimate tokens for a string content ###### Parameters | Parameter | Type | | ------ | ------ | | `content` | `string` | ###### Returns `number` ##### filterContent() ```ts filterContent(content, type): { content: string; filtered: boolean; originalLength: number; }; ``` Defined in: [context/manager.ts:987](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/manager.ts#L987) Filter large content before adding to context Returns the filtered content and metadata about what was done. The caller is responsible for saving to file if needed. ###### Parameters | Parameter | Type | | ------ | ------ | | `content` | `string` | | `type` | `"tool_result"` \| `"error"` \| `"file"` | ###### Returns ```ts { content: string; filtered: boolean; originalLength: number; } ``` | Name | Type | Defined in | | ------ | ------ | ------ | | `content` | `string` | [context/manager.ts:991](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/manager.ts#L991) | | `filtered` | `boolean` | [context/manager.ts:992](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/manager.ts#L992) | | `originalLength` | `number` | [context/manager.ts:993](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/manager.ts#L993) | ##### findOverBudgetCategories() ```ts findOverBudgetCategories(categorized): ContextCategory[]; ``` Defined in: [context/manager.ts:623](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/manager.ts#L623) Find which categories are over their budget allocation ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `categorized` | `CategorizedMessages` | Categorized messages from categorizeMessages() | ###### Returns [`ContextCategory`](#contextcategory)[] Array of categories that exceed their budget, sorted by how much they exceed ##### formatRestorationHints() ```ts formatRestorationHints(): string; ``` Defined in: [context/manager.ts:334](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/manager.ts#L334) Format context restoration hints based on current verbosity level. Returns empty string if no file tracker is configured or no files have been accessed. ###### Returns `string` ##### getAllBudgets() ```ts getAllBudgets(): Record; ``` Defined in: [context/manager.ts:389](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/manager.ts#L389) Get budget information for all categories ###### Returns `Record`\<[`ContextCategory`](#contextcategory), [`CategoryBudgetInfo`](#categorybudgetinfo)\> ##### getCategoryBudget() ```ts getCategoryBudget(category): CategoryBudgetInfo; ``` Defined in: [context/manager.ts:370](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/manager.ts#L370) Get budget information for a specific category ###### Parameters | Parameter | Type | | ------ | ------ | | `category` | [`ContextCategory`](#contextcategory) | ###### Returns [`CategoryBudgetInfo`](#categorybudgetinfo) ##### getConfig() ```ts getConfig(): ContextConfig; ``` Defined in: [context/manager.ts:319](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/manager.ts#L319) Get the current configuration ###### Returns [`ContextConfig`](#contextconfig) ##### getFileTracker() ```ts getFileTracker(): FileAccessTracker | undefined; ``` Defined in: [context/manager.ts:326](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/manager.ts#L326) Get the file access tracker (if configured) ###### Returns [`FileAccessTracker`](#fileaccesstracker) \| `undefined` ##### getMaxTokens() ```ts getMaxTokens(): number; ``` Defined in: [context/manager.ts:239](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/manager.ts#L239) Get maximum context tokens ###### Returns `number` ##### getStats() ```ts getStats(messageCount): ContextStats; ``` Defined in: [context/manager.ts:304](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/manager.ts#L304) Get context statistics ###### Parameters | Parameter | Type | | ------ | ------ | | `messageCount` | `number` | ###### Returns [`ContextStats`](#contextstats-1) ##### getTokenCount() ```ts getTokenCount(): number; ``` Defined in: [context/manager.ts:225](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/manager.ts#L225) Get current token count (cached) ###### Returns `number` ##### getTurnCount() ```ts getTurnCount(): number; ``` Defined in: [context/manager.ts:253](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/manager.ts#L253) Get the current turn count ###### Returns `number` ##### getUtilization() ```ts getUtilization(): number; ``` Defined in: [context/manager.ts:232](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/manager.ts#L232) Get context utilization (0.0 - 1.0) ###### Returns `number` ##### getVerbosityLevel() ```ts getVerbosityLevel(): VerbosityLevel; ``` Defined in: [context/manager.ts:948](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/manager.ts#L948) Get current verbosity level based on context utilization Tools should adapt their output based on this level. ###### Returns [`VerbosityLevel`](#verbositylevel-1) ##### incrementTurn() ```ts incrementTurn(): void; ``` Defined in: [context/manager.ts:246](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/manager.ts#L246) Increment turn count (call after each assistant response) ###### Returns `void` ##### isMinimalMode() ```ts isMinimalMode(): boolean; ``` Defined in: [context/manager.ts:966](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/manager.ts#L966) Check if we're in minimal mode (critical context pressure) ###### Returns `boolean` ##### needsCompaction() ```ts needsCompaction(): boolean; ``` Defined in: [context/manager.ts:272](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/manager.ts#L272) Check if compaction is needed ###### Returns `boolean` ##### needsEmergencySummarization() ```ts needsEmergencySummarization(): boolean; ``` Defined in: [context/manager.ts:973](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/manager.ts#L973) Check if emergency summarization is needed ###### Returns `boolean` ##### needsSummarization() ```ts needsSummarization(): boolean; ``` Defined in: [context/manager.ts:290](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/manager.ts#L290) Check if summarization is needed (more aggressive than compaction) ###### Returns `boolean` ##### reset() ```ts reset(): void; ``` Defined in: [context/manager.ts:1323](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/manager.ts#L1323) Reset context manager state (for new conversations) ###### Returns `void` ##### setTurnCount() ```ts setTurnCount(count): void; ``` Defined in: [context/manager.ts:260](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/manager.ts#L260) Set the turn count (for restoring from saved state) ###### Parameters | Parameter | Type | | ------ | ------ | | `count` | `number` | ###### Returns `void` ##### shouldFilter() ```ts shouldFilter(tokenCount): boolean; ``` Defined in: [context/manager.ts:297](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/manager.ts#L297) Check if content should be filtered before adding ###### Parameters | Parameter | Type | | ------ | ------ | | `tokenCount` | `number` | ###### Returns `boolean` ##### smartCompact() ```ts smartCompact(messages, options): Promise<{ messages: Message[]; result: SmartCompactionResult; }>; ``` Defined in: [context/manager.ts:657](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/manager.ts#L657) Smart compaction that respects category budgets Strategy: 1. System messages: Never compacted (critical for agent behavior) 2. Recent messages: Never compacted (needed for conversation continuity) 3. Tool results: Save large results to files, replace with references 4. History: Summarize with LLM The method compacts categories in order of how much they exceed their budget. ###### Parameters | Parameter | Type | | ------ | ------ | | `messages` | [`Message`](#message-4)[] | | `options` | `SmartCompactOptions` | ###### Returns `Promise`\<\{ `messages`: [`Message`](#message-4)[]; `result`: `SmartCompactionResult`; \}\> ##### summarize() ```ts summarize(messages, generateSummary): Promise<{ messages: Message[]; result: SummarizationResult; }>; ``` Defined in: [context/manager.ts:1136](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/manager.ts#L1136) Summarize conversation history This is a placeholder - actual implementation requires LLM call which will be orchestrated by the Agent layer. ###### Parameters | Parameter | Type | | ------ | ------ | | `messages` | [`Message`](#message-4)[] | | `generateSummary` | (`messages`) => `Promise`\<`string`\> | ###### Returns `Promise`\<\{ `messages`: [`Message`](#message-4)[]; `result`: [`SummarizationResult`](#summarizationresult); \}\> ##### summarizeWithRetry() ```ts summarizeWithRetry( messages, generateSummary, options?): Promise<{ messages: Message[]; result: SummarizationResult; }>; ``` Defined in: [context/manager.ts:1201](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/manager.ts#L1201) Summarize with support for multiple rounds and emergency mode Will perform multiple summarization rounds if needed to reach target utilization. Throws ContextOverflowError if unable to reduce context sufficiently. ###### Parameters | Parameter | Type | | ------ | ------ | | `messages` | [`Message`](#message-4)[] | | `generateSummary` | (`messages`) => `Promise`\<`string`\> | | `options?` | \{ `emergency?`: `boolean`; `maxRounds?`: `number`; `targetUtilization?`: `number`; \} | | `options.emergency?` | `boolean` | | `options.maxRounds?` | `number` | | `options.targetUtilization?` | `number` | ###### Returns `Promise`\<\{ `messages`: [`Message`](#message-4)[]; `result`: [`SummarizationResult`](#summarizationresult); \}\> ##### updateCategoryUsage() ```ts updateCategoryUsage(category, tokens): void; ``` Defined in: [context/manager.ts:401](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/manager.ts#L401) Update token usage for a category ###### Parameters | Parameter | Type | | ------ | ------ | | `category` | [`ContextCategory`](#contextcategory) | | `tokens` | `number` | ###### Returns `void` ##### updateTokenCount() ```ts updateTokenCount(messages): Promise; ``` Defined in: [context/manager.ts:217](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/manager.ts#L217) Update token count for messages ###### Parameters | Parameter | Type | | ------ | ------ | | `messages` | [`Message`](#message-4)[] | ###### Returns `Promise`\<`number`\> *** ### ContextOverflowError Defined in: [errors.ts:258](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L258) Error thrown when context window cannot be reduced sufficiently. This occurs when: - Multiple summarization rounds fail to reduce context below target - Content is too large even after aggressive filtering #### Example ```typescript throw new ContextOverflowError( 'Unable to reduce context below 90% after 3 summarization rounds', 0.95, // current utilization 3 // rounds attempted ); ``` #### Extends - [`AgentError`](#agenterror) #### Constructors ##### Constructor ```ts new ContextOverflowError( message, utilization, roundsAttempted?): ContextOverflowError; ``` Defined in: [errors.ts:259](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L259) ###### Parameters | Parameter | Type | | ------ | ------ | | `message` | `string` | | `utilization` | `number` | | `roundsAttempted?` | `number` | ###### Returns [`ContextOverflowError`](#contextoverflowerror) ###### Overrides [`AgentError`](#agenterror).[`constructor`](#constructor-2) #### Properties ##### cause? ```ts readonly optional cause?: Error; ``` Defined in: [errors.ts:17](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L17) ###### Inherited from [`AgentError`](#agenterror).[`cause`](#cause-1) ##### roundsAttempted? ```ts readonly optional roundsAttempted?: number; ``` Defined in: [errors.ts:262](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L262) ##### utilization ```ts readonly utilization: number; ``` Defined in: [errors.ts:261](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L261) *** ### DeadMessagePruner Defined in: [context/dead-message-pruner.ts:83](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/dead-message-pruner.ts#L83) #### Constructors ##### Constructor ```ts new DeadMessagePruner(config?): DeadMessagePruner; ``` Defined in: [context/dead-message-pruner.ts:93](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/dead-message-pruner.ts#L93) ###### Parameters | Parameter | Type | | ------ | ------ | | `config?` | `Partial`\<[`PruneConfig`](#pruneconfig)\> | ###### Returns [`DeadMessagePruner`](#deadmessagepruner) #### Methods ##### getConfig() ```ts getConfig(): PruneConfig; ``` Defined in: [context/dead-message-pruner.ts:209](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/dead-message-pruner.ts#L209) Get current configuration (for testing/inspection). ###### Returns [`PruneConfig`](#pruneconfig) ##### getStats() ```ts getStats(): PruneStats; ``` Defined in: [context/dead-message-pruner.ts:194](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/dead-message-pruner.ts#L194) ###### Returns [`PruneStats`](#prunestats) ##### prune() ```ts prune(messages, currentTurn): PruneResult; ``` Defined in: [context/dead-message-pruner.ts:128](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/dead-message-pruner.ts#L128) Prune dead messages in-place. Replaces content of dead tool_result blocks with short placeholders and clears corresponding tool_use input. ###### Parameters | Parameter | Type | | ------ | ------ | | `messages` | [`Message`](#message-4)[] | | `currentTurn` | `number` | ###### Returns [`PruneResult`](#pruneresult) ##### reset() ```ts reset(): void; ``` Defined in: [context/dead-message-pruner.ts:201](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/dead-message-pruner.ts#L201) Reset all state (stamps and stats). Used when clearing history. ###### Returns `void` ##### stamp() ```ts stamp( toolUseId, toolName, input, isError, turn): void; ``` Defined in: [context/dead-message-pruner.ts:105](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/dead-message-pruner.ts#L105) Register a tool result for pruning analysis. Called at the same point as ObservationMasker.stamp(). ###### Parameters | Parameter | Type | | ------ | ------ | | `toolUseId` | `string` | | `toolName` | `string` | | `input` | `Record`\<`string`, `unknown`\> | | `isError` | `boolean` | | `turn` | `number` | ###### Returns `void` *** ### DefaultToolRegistry Defined in: [tools/registry.ts:48](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/registry.ts#L48) Default implementation of ToolRegistry #### Implements - [`ToolRegistry`](#toolregistry-1) #### Constructors ##### Constructor ```ts new DefaultToolRegistry(options?): DefaultToolRegistry; ``` Defined in: [tools/registry.ts:54](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/registry.ts#L54) ###### Parameters | Parameter | Type | | ------ | ------ | | `options?` | [`ToolRegistryOptions`](#toolregistryoptions) | ###### Returns [`DefaultToolRegistry`](#defaulttoolregistry) #### Accessors ##### size ###### Get Signature ```ts get size(): number; ``` Defined in: [tools/registry.ts:125](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/registry.ts#L125) Get the number of registered tools ###### Returns `number` #### Methods ##### clear() ```ts clear(): void; ``` Defined in: [tools/registry.ts:232](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/registry.ts#L232) Clear all registered tools ###### Returns `void` ##### execute() ```ts execute( name, input, contextOrTimeout?, timeoutMs?): Promise; ``` Defined in: [tools/registry.ts:137](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/registry.ts#L137) Execute a tool by name with given input ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `name` | `string` | Tool name | | `input` | `Record`\<`string`, `unknown`\> | Tool input parameters | | `contextOrTimeout?` | `number` \| `ToolExecutionContext` | Optional execution context or timeout override | | `timeoutMs?` | `number` | Optional timeout override (uses default if not provided) | ###### Returns `Promise`\<[`ToolExecutionResult`](#toolexecutionresult)\> ###### Implementation of [`ToolRegistry`](#toolregistry-1).[`execute`](#execute-3) ##### get() ```ts get(name): Tool | undefined; ``` Defined in: [tools/registry.ts:97](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/registry.ts#L97) Get a tool by name ###### Parameters | Parameter | Type | | ------ | ------ | | `name` | `string` | ###### Returns [`Tool`](#tool)\<`object`\> \| `undefined` ###### Implementation of [`ToolRegistry`](#toolregistry-1).[`get`](#get-6) ##### getDefinitions() ```ts getDefinitions(): ToolDefinition[]; ``` Defined in: [tools/registry.ts:118](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/registry.ts#L118) Get all tool definitions (for sending to LLM) ###### Returns `ToolDefinition`[] ###### Implementation of [`ToolRegistry`](#toolregistry-1).[`getDefinitions`](#getdefinitions-1) ##### getNames() ```ts getNames(): string[]; ``` Defined in: [tools/registry.ts:111](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/registry.ts#L111) Get all registered tool names ###### Returns `string`[] ##### getOptions() ```ts getOptions(): ToolRegistryOptions; ``` Defined in: [tools/registry.ts:239](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/registry.ts#L239) Get the registry options (for inheritance by sub-agents) ###### Returns [`ToolRegistryOptions`](#toolregistryoptions) ##### has() ```ts has(name): boolean; ``` Defined in: [tools/registry.ts:104](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/registry.ts#L104) Check if a tool is registered ###### Parameters | Parameter | Type | | ------ | ------ | | `name` | `string` | ###### Returns `boolean` ##### register() ```ts register(tool): void; ``` Defined in: [tools/registry.ts:71](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/registry.ts#L71) Register a tool ###### Parameters | Parameter | Type | | ------ | ------ | | `tool` | [`Tool`](#tool) | ###### Returns `void` ###### Implementation of [`ToolRegistry`](#toolregistry-1).[`register`](#register-2) ##### registerAll() ```ts registerAll(tools): void; ``` Defined in: [tools/registry.ts:81](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/registry.ts#L81) Register multiple tools at once ###### Parameters | Parameter | Type | | ------ | ------ | | `tools` | [`Tool`](#tool)\<`object`\>[] | ###### Returns `void` ##### setFallbackHandler() ```ts setFallbackHandler(handler): void; ``` Defined in: [tools/registry.ts:64](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/registry.ts#L64) Set a fallback handler for tools not found in the primary registry. Enables transparent routing to secondary registries (e.g., meta-tools). ###### Parameters | Parameter | Type | | ------ | ------ | | `handler` | [`ToolFallbackHandler`](#toolfallbackhandler) \| `null` | ###### Returns `void` ###### Implementation of [`ToolRegistry`](#toolregistry-1).[`setFallbackHandler`](#setfallbackhandler-1) ##### unregister() ```ts unregister(name): boolean; ``` Defined in: [tools/registry.ts:90](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/registry.ts#L90) Unregister a tool by name ###### Parameters | Parameter | Type | | ------ | ------ | | `name` | `string` | ###### Returns `boolean` *** ### DelegatedResultStore Defined in: [context/delegated-result-store.ts:34](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/delegated-result-store.ts#L34) In-memory store for delegated results with TTL expiration and LRU eviction. #### Constructors ##### Constructor ```ts new DelegatedResultStore(options?): DelegatedResultStore; ``` Defined in: [context/delegated-result-store.ts:43](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/delegated-result-store.ts#L43) ###### Parameters | Parameter | Type | | ------ | ------ | | `options?` | \{ `defaultTTL?`: `number`; `maxSize?`: `number`; \} | | `options.defaultTTL?` | `number` | | `options.maxSize?` | `number` | ###### Returns [`DelegatedResultStore`](#delegatedresultstore) #### Methods ##### add() ```ts add(result): void; ``` Defined in: [context/delegated-result-store.ts:58](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/delegated-result-store.ts#L58) Store a delegated result. Evicts oldest entries if at capacity. ###### Parameters | Parameter | Type | | ------ | ------ | | `result` | [`StoredResult`](#storedresult) | ###### Returns `void` ##### cleanup() ```ts cleanup(): void; ``` Defined in: [context/delegated-result-store.ts:97](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/delegated-result-store.ts#L97) Remove all expired entries. ###### Returns `void` ##### clear() ```ts clear(): void; ``` Defined in: [context/delegated-result-store.ts:110](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/delegated-result-store.ts#L110) Clear all stored results. ###### Returns `void` ##### generateId() ```ts generateId(): string; ``` Defined in: [context/delegated-result-store.ts:51](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/delegated-result-store.ts#L51) Generate a unique delegation ID. ###### Returns `string` ##### get() ```ts get(id): StoredResult | undefined; ``` Defined in: [context/delegated-result-store.ts:76](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/delegated-result-store.ts#L76) Get a stored result by ID. Returns undefined if not found or expired. ###### Parameters | Parameter | Type | | ------ | ------ | | `id` | `string` | ###### Returns [`StoredResult`](#storedresult) \| `undefined` ##### getDefaultTTL() ```ts getDefaultTTL(): number; ``` Defined in: [context/delegated-result-store.ts:117](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/delegated-result-store.ts#L117) Get the default TTL for this store. ###### Returns `number` ##### getStats() ```ts getStats(): DelegatedResultStoreStats; ``` Defined in: [context/delegated-result-store.ts:124](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/delegated-result-store.ts#L124) Get store statistics. ###### Returns [`DelegatedResultStoreStats`](#delegatedresultstorestats) *** ### FileAccessTracker Defined in: [context/file-tracker.ts:157](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/file-tracker.ts#L157) Tracks file accesses during agent sessions for context restoration hints. #### Example ```typescript const tracker = new FileAccessTracker(); // Track file accesses tracker.trackRead('/path/to/file.ts', 597); tracker.trackReference('/path/to/other.ts'); tracker.trackModification('/path/to/file.ts', 'Added function'); // Get restoration hints after compaction const hints = tracker.formatRestorationHints(); console.log(hints); ``` #### Constructors ##### Constructor ```ts new FileAccessTracker(options?): FileAccessTracker; ``` Defined in: [context/file-tracker.ts:164](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/file-tracker.ts#L164) ###### Parameters | Parameter | Type | | ------ | ------ | | `options` | [`FileAccessTrackerOptions`](#fileaccesstrackeroptions) | ###### Returns [`FileAccessTracker`](#fileaccesstracker) #### Accessors ##### size ###### Get Signature ```ts get size(): number; ``` Defined in: [context/file-tracker.ts:447](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/file-tracker.ts#L447) Get the number of tracked files ###### Returns `number` #### Methods ##### clear() ```ts clear(): void; ``` Defined in: [context/file-tracker.ts:440](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/file-tracker.ts#L440) Clear all tracked accesses ###### Returns `void` ##### formatRestorationHints() ```ts formatRestorationHints(options?): string; ``` Defined in: [context/file-tracker.ts:317](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/file-tracker.ts#L317) Format restoration hints for injection after compaction ###### Parameters | Parameter | Type | | ------ | ------ | | `options` | [`FormatHintsOptions`](#formathintsoptions) | ###### Returns `string` ##### formatRestorationHintsWithContent() ```ts formatRestorationHintsWithContent(options?): RestorationHintMessage[]; ``` Defined in: [context/file-tracker.ts:375](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/file-tracker.ts#L375) Format restoration hints with inline file content (Claude Code style). Small files with stored content are inlined up to a token budget. Large files or files exceeding the budget get reference-only hints. Each file produces a separate hint message for individual injection. Priority order for inlining: 1. Modified files (most critical context) 2. Read files, most recent first 3. Once budget exhausted → remaining become reference-only 4. Referenced-only files → always reference-only ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `options?` | \{ `maxInlineTokens?`: `number`; \} | - | | `options.maxInlineTokens?` | `number` | Total token budget for all inline content (default: 4000) | ###### Returns [`RestorationHintMessage`](#restorationhintmessage)[] ##### getAccess() ```ts getAccess(filePath): FileAccess | undefined; ``` Defined in: [context/file-tracker.ts:292](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/file-tracker.ts#L292) Get access record for a specific file ###### Parameters | Parameter | Type | | ------ | ------ | | `filePath` | `string` | ###### Returns [`FileAccess`](#fileaccess) \| `undefined` ##### getAccesses() ```ts getAccesses(options?): FileAccess[]; ``` Defined in: [context/file-tracker.ts:259](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/file-tracker.ts#L259) Get all file accesses, optionally filtered ###### Parameters | Parameter | Type | | ------ | ------ | | `options?` | \{ `since?`: `number`; `type?`: [`FileAccessType`](#fileaccesstype-1); \} | | `options.since?` | `number` | | `options.type?` | [`FileAccessType`](#fileaccesstype-1) | ###### Returns [`FileAccess`](#fileaccess)[] ##### getRecentAccesses() ```ts getRecentAccesses(limit?): FileAccess[]; ``` Defined in: [context/file-tracker.ts:278](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/file-tracker.ts#L278) Get most recent file accesses ###### Parameters | Parameter | Type | Default value | | ------ | ------ | ------ | | `limit` | `number` | `10` | ###### Returns [`FileAccess`](#fileaccess)[] ##### getStats() ```ts getStats(): FileAccessStats; ``` Defined in: [context/file-tracker.ts:299](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/file-tracker.ts#L299) Get statistics about file accesses ###### Returns [`FileAccessStats`](#fileaccessstats) ##### hasAccessed() ```ts hasAccessed(filePath): boolean; ``` Defined in: [context/file-tracker.ts:285](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/file-tracker.ts#L285) Check if a file has been accessed ###### Parameters | Parameter | Type | | ------ | ------ | | `filePath` | `string` | ###### Returns `boolean` ##### trackModification() ```ts trackModification(filePath, summary?): void; ``` Defined in: [context/file-tracker.ts:239](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/file-tracker.ts#L239) Track a file that was modified (written or edited) ###### Parameters | Parameter | Type | | ------ | ------ | | `filePath` | `string` | | `summary?` | `string` | ###### Returns `void` ##### trackRead() ```ts trackRead( filePath, lineCount, summary?, content?): void; ``` Defined in: [context/file-tracker.ts:178](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/file-tracker.ts#L178) Track a file that was fully read ###### Parameters | Parameter | Type | | ------ | ------ | | `filePath` | `string` | | `lineCount` | `number` | | `summary?` | `string` | | `content?` | `string` | ###### Returns `void` ##### trackReference() ```ts trackReference(filePath): void; ``` Defined in: [context/file-tracker.ts:211](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/file-tracker.ts#L211) Track a file that was referenced (e.g., appeared in grep/glob results) ###### Parameters | Parameter | Type | | ------ | ------ | | `filePath` | `string` | ###### Returns `void` *** ### FileCheckpointer Defined in: [state/checkpointer.ts:243](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/checkpointer.ts#L243) File-based checkpointer for simple persistence. Stores each session as a separate JSON file. #### Implements - [`Checkpointer`](#checkpointer-1) #### Constructors ##### Constructor ```ts new FileCheckpointer(baseDir, options?): FileCheckpointer; ``` Defined in: [state/checkpointer.ts:248](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/checkpointer.ts#L248) ###### Parameters | Parameter | Type | | ------ | ------ | | `baseDir` | `string` | | `options?` | [`FileCheckpointerOptions`](#filecheckpointeroptions) | ###### Returns [`FileCheckpointer`](#filecheckpointer) #### Methods ##### delete() ```ts delete(sessionId): Promise; ``` Defined in: [state/checkpointer.ts:397](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/checkpointer.ts#L397) Delete a session ###### Parameters | Parameter | Type | | ------ | ------ | | `sessionId` | `string` | ###### Returns `Promise`\<`boolean`\> ###### Implementation of [`Checkpointer`](#checkpointer-1).[`delete`](#delete-2) ##### exists() ```ts exists(sessionId): Promise; ``` Defined in: [state/checkpointer.ts:432](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/checkpointer.ts#L432) Check if session exists ###### Parameters | Parameter | Type | | ------ | ------ | | `sessionId` | `string` | ###### Returns `Promise`\<`boolean`\> ###### Implementation of [`Checkpointer`](#checkpointer-1).[`exists`](#exists-2) ##### getMetadata() ```ts getMetadata(sessionId): Promise; ``` Defined in: [state/checkpointer.ts:446](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/checkpointer.ts#L446) Get session metadata ###### Parameters | Parameter | Type | | ------ | ------ | | `sessionId` | `string` | ###### Returns `Promise`\<[`SessionMetadata`](#sessionmetadata) \| `null`\> ###### Implementation of [`Checkpointer`](#checkpointer-1).[`getMetadata`](#getmetadata-2) ##### list() ```ts list(options?): Promise; ``` Defined in: [state/checkpointer.ts:343](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/checkpointer.ts#L343) List all sessions ###### Parameters | Parameter | Type | | ------ | ------ | | `options?` | [`ListSessionsOptions`](#listsessionsoptions) | ###### Returns `Promise`\<[`SessionInfo`](#sessioninfo)[]\> ###### Implementation of [`Checkpointer`](#checkpointer-1).[`list`](#list-3) ##### load() ```ts load(sessionId): Promise; ``` Defined in: [state/checkpointer.ts:323](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/checkpointer.ts#L323) Load state from file ###### Parameters | Parameter | Type | | ------ | ------ | | `sessionId` | `string` | ###### Returns `Promise`\<[`AgentState`](#agentstate) \| `null`\> ###### Implementation of [`Checkpointer`](#checkpointer-1).[`load`](#load-3) ##### save() ```ts save( sessionId, state, metadataOverrides?): Promise; ``` Defined in: [state/checkpointer.ts:288](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/checkpointer.ts#L288) Save state to file Pre-validates state before saving to prevent corrupted checkpoints. This catches issues like invalid data types that would fail on reload. ###### Parameters | Parameter | Type | | ------ | ------ | | `sessionId` | `string` | | `state` | [`AgentState`](#agentstate) | | `metadataOverrides?` | `Partial`\<[`SessionMetadata`](#sessionmetadata)\> | ###### Returns `Promise`\<`void`\> ###### Implementation of [`Checkpointer`](#checkpointer-1).[`save`](#save-2) *** ### FileRehearsalAnalyzer Defined in: [rehearsal/file-analyzer.ts:311](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/file-analyzer.ts#L311) File Rehearsal Analyzer #### Implements - [`RehearsalAnalyzer`](#rehearsalanalyzer) #### Constructors ##### Constructor ```ts new FileRehearsalAnalyzer(): FileRehearsalAnalyzer; ``` ###### Returns [`FileRehearsalAnalyzer`](#filerehearsalanalyzer) #### Properties ##### category ```ts readonly category: "file"; ``` Defined in: [rehearsal/file-analyzer.ts:314](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/file-analyzer.ts#L314) Category of operations this analyzer handles ###### Implementation of [`RehearsalAnalyzer`](#rehearsalanalyzer).[`category`](#category-5) ##### id ```ts readonly id: "file-analyzer" = 'file-analyzer'; ``` Defined in: [rehearsal/file-analyzer.ts:312](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/file-analyzer.ts#L312) Unique identifier for this analyzer ###### Implementation of [`RehearsalAnalyzer`](#rehearsalanalyzer).[`id`](#id-10) ##### name ```ts readonly name: "File Operations Analyzer" = 'File Operations Analyzer'; ``` Defined in: [rehearsal/file-analyzer.ts:313](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/file-analyzer.ts#L313) Human-readable name ###### Implementation of [`RehearsalAnalyzer`](#rehearsalanalyzer).[`name`](#name-28) ##### patterns ```ts readonly patterns: RegExp[] = FILE_DESTRUCTIVE_PATTERNS; ``` Defined in: [rehearsal/file-analyzer.ts:315](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/file-analyzer.ts#L315) Patterns that this analyzer can handle ###### Implementation of [`RehearsalAnalyzer`](#rehearsalanalyzer).[`patterns`](#patterns-6) #### Methods ##### analyze() ```ts analyze(operation, context): Promise; ``` Defined in: [rehearsal/file-analyzer.ts:321](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/file-analyzer.ts#L321) Analyze the operation and return impact assessment ###### Parameters | Parameter | Type | | ------ | ------ | | `operation` | `string` | | `context` | [`RehearsalContext`](#rehearsalcontext) | ###### Returns `Promise`\<[`RehearsalResult`](#rehearsalresult)\> ###### Implementation of [`RehearsalAnalyzer`](#rehearsalanalyzer).[`analyze`](#analyze-2) ##### canAnalyze() ```ts canAnalyze(operation): boolean; ``` Defined in: [rehearsal/file-analyzer.ts:317](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/file-analyzer.ts#L317) Check if this analyzer can handle the given operation ###### Parameters | Parameter | Type | | ------ | ------ | | `operation` | `string` | ###### Returns `boolean` ###### Implementation of [`RehearsalAnalyzer`](#rehearsalanalyzer).[`canAnalyze`](#cananalyze-2) *** ### FireworksProvider Defined in: [providers/fireworks.ts:53](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/fireworks.ts#L53) Fireworks AI LLM Provider Provides streaming chat completion using Fireworks AI. Supports Llama, Mixtral, and custom fine-tuned models. #### Extends - [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider) #### Constructors ##### Constructor ```ts new FireworksProvider(config?): FireworksProvider; ``` Defined in: [providers/fireworks.ts:58](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/fireworks.ts#L58) ###### Parameters | Parameter | Type | | ------ | ------ | | `config` | [`FireworksProviderConfig`](#fireworksproviderconfig) | ###### Returns [`FireworksProvider`](#fireworksprovider) ###### Overrides [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider).[`constructor`](#constructor-30) #### Properties ##### name ```ts readonly name: "fireworks" = 'fireworks'; ``` Defined in: [providers/fireworks.ts:54](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/fireworks.ts#L54) Provider name (e.g., 'openai', 'ollama', 'gemini') ###### Overrides [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider).[`name`](#name-10) #### Methods ##### chat() ```ts chat(messages, options?): AsyncIterable; ``` Defined in: [providers/openai-compatible.ts:222](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai-compatible.ts#L222) Stream chat completion from the provider ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `messages` | [`Message`](#message-4)[] | Conversation messages | | `options?` | [`ChatOptions`](#chatoptions-1) | Chat options (thinking is ignored for non-Claude providers) | ###### Returns `AsyncIterable`\<[`StreamChunk`](#streamchunk)\> ###### Inherited from [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider).[`chat`](#chat-7) ##### countTokens() ```ts countTokens(messages): Promise; ``` Defined in: [providers/openai-compatible.ts:631](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai-compatible.ts#L631) Count tokens in messages using tiktoken (cl100k_base encoding) ###### Parameters | Parameter | Type | | ------ | ------ | | `messages` | [`Message`](#message-4)[] | ###### Returns `Promise`\<`number`\> ###### Inherited from [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider).[`countTokens`](#counttokens-8) ##### getModel() ```ts getModel(): string; ``` Defined in: [providers/openai-compatible.ts:158](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai-compatible.ts#L158) Get the current default model ID. ###### Returns `string` ###### Inherited from [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider).[`getModel`](#getmodel-8) ##### setModel() ```ts setModel(modelId): void; ``` Defined in: [providers/openai-compatible.ts:162](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai-compatible.ts#L162) Change the default model for subsequent calls. Same provider only. Takes effect on the next chat() call, not mid-stream. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `modelId` | `string` | The new model ID (e.g., 'claude-opus-4-20250514') | ###### Returns `void` ###### Inherited from [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider).[`setModel`](#setmodel-8) *** ### GeminiLegacyProvider Defined in: [providers/gemini.ts:53](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/gemini.ts#L53) Google Gemini LLM Provider Provides streaming chat completion using Google's Gemini models via the OpenAI-compatible API endpoint. Supports gemini-2.0-flash, gemini-1.5-flash, gemini-1.5-pro, and others. #### Extends - [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider) #### Constructors ##### Constructor ```ts new GeminiLegacyProvider(config?): GeminiLegacyProvider; ``` Defined in: [providers/gemini.ts:58](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/gemini.ts#L58) ###### Parameters | Parameter | Type | | ------ | ------ | | `config` | [`GeminiLegacyProviderConfig`](#geminilegacyproviderconfig) | ###### Returns [`GeminiLegacyProvider`](#geminilegacyprovider) ###### Overrides [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider).[`constructor`](#constructor-30) #### Properties ##### name ```ts readonly name: "gemini" = 'gemini'; ``` Defined in: [providers/gemini.ts:54](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/gemini.ts#L54) Provider name (e.g., 'openai', 'ollama', 'gemini') ###### Overrides [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider).[`name`](#name-10) #### Methods ##### chat() ```ts chat(messages, options?): AsyncIterable; ``` Defined in: [providers/openai-compatible.ts:222](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai-compatible.ts#L222) Stream chat completion from the provider ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `messages` | [`Message`](#message-4)[] | Conversation messages | | `options?` | [`ChatOptions`](#chatoptions-1) | Chat options (thinking is ignored for non-Claude providers) | ###### Returns `AsyncIterable`\<[`StreamChunk`](#streamchunk)\> ###### Inherited from [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider).[`chat`](#chat-7) ##### countTokens() ```ts countTokens(messages): Promise; ``` Defined in: [providers/openai-compatible.ts:631](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai-compatible.ts#L631) Count tokens in messages using tiktoken (cl100k_base encoding) ###### Parameters | Parameter | Type | | ------ | ------ | | `messages` | [`Message`](#message-4)[] | ###### Returns `Promise`\<`number`\> ###### Inherited from [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider).[`countTokens`](#counttokens-8) ##### getModel() ```ts getModel(): string; ``` Defined in: [providers/openai-compatible.ts:158](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai-compatible.ts#L158) Get the current default model ID. ###### Returns `string` ###### Inherited from [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider).[`getModel`](#getmodel-8) ##### setModel() ```ts setModel(modelId): void; ``` Defined in: [providers/openai-compatible.ts:162](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai-compatible.ts#L162) Change the default model for subsequent calls. Same provider only. Takes effect on the next chat() call, not mid-stream. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `modelId` | `string` | The new model ID (e.g., 'claude-opus-4-20250514') | ###### Returns `void` ###### Inherited from [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider).[`setModel`](#setmodel-8) *** ### GeminiProvider Defined in: [providers/gemini-native.ts:83](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/gemini-native.ts#L83) GeminiNativeProvider implements LLMProvider using the native Google Gen AI SDK Benefits over OpenAI-compatible endpoint: - Automatic thought signature handling for Gemini 3 - Native streaming support - Full access to Gemini-specific features #### Implements - [`LLMProvider`](#llmprovider) #### Constructors ##### Constructor ```ts new GeminiProvider(config): GeminiProvider; ``` Defined in: [providers/gemini-native.ts:91](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/gemini-native.ts#L91) ###### Parameters | Parameter | Type | | ------ | ------ | | `config` | [`GeminiProviderConfig`](#geminiproviderconfig) | ###### Returns [`GeminiProvider`](#geminiprovider) #### Properties ##### name ```ts readonly name: "gemini" = 'gemini'; ``` Defined in: [providers/gemini-native.ts:84](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/gemini-native.ts#L84) Provider identifier (e.g., 'claude', 'openai', 'gemini') ###### Implementation of [`LLMProvider`](#llmprovider).[`name`](#name-21) #### Methods ##### chat() ```ts chat(messages, options?): AsyncIterable; ``` Defined in: [providers/gemini-native.ts:110](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/gemini-native.ts#L110) Send messages and stream the response ###### Parameters | Parameter | Type | | ------ | ------ | | `messages` | [`Message`](#message-4)[] | | `options?` | [`ChatOptions`](#chatoptions-1) | ###### Returns `AsyncIterable`\<[`StreamChunk`](#streamchunk)\> ###### Implementation of [`LLMProvider`](#llmprovider).[`chat`](#chat-13) ##### countTokens() ```ts countTokens(messages): Promise; ``` Defined in: [providers/gemini-native.ts:233](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/gemini-native.ts#L233) Count tokens in messages using tiktoken (cl100k_base encoding) ###### Parameters | Parameter | Type | | ------ | ------ | | `messages` | [`Message`](#message-4)[] | ###### Returns `Promise`\<`number`\> ###### Implementation of [`LLMProvider`](#llmprovider).[`countTokens`](#counttokens-14) ##### getModel() ```ts getModel(): string; ``` Defined in: [providers/gemini-native.ts:99](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/gemini-native.ts#L99) Get the current default model ID. ###### Returns `string` ###### Implementation of [`LLMProvider`](#llmprovider).[`getModel`](#getmodel-14) ##### setModel() ```ts setModel(modelId): void; ``` Defined in: [providers/gemini-native.ts:103](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/gemini-native.ts#L103) Change the default model for subsequent calls. Same provider only. Takes effect on the next chat() call, not mid-stream. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `modelId` | `string` | The new model ID (e.g., 'claude-opus-4-20250514') | ###### Returns `void` ###### Implementation of [`LLMProvider`](#llmprovider).[`setModel`](#setmodel-14) *** ### GitRehearsalAnalyzer Defined in: [rehearsal/git-analyzer.ts:477](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/git-analyzer.ts#L477) Git Rehearsal Analyzer #### Implements - [`RehearsalAnalyzer`](#rehearsalanalyzer) #### Constructors ##### Constructor ```ts new GitRehearsalAnalyzer(): GitRehearsalAnalyzer; ``` ###### Returns [`GitRehearsalAnalyzer`](#gitrehearsalanalyzer) #### Properties ##### category ```ts readonly category: "git"; ``` Defined in: [rehearsal/git-analyzer.ts:480](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/git-analyzer.ts#L480) Category of operations this analyzer handles ###### Implementation of [`RehearsalAnalyzer`](#rehearsalanalyzer).[`category`](#category-5) ##### id ```ts readonly id: "git-analyzer" = 'git-analyzer'; ``` Defined in: [rehearsal/git-analyzer.ts:478](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/git-analyzer.ts#L478) Unique identifier for this analyzer ###### Implementation of [`RehearsalAnalyzer`](#rehearsalanalyzer).[`id`](#id-10) ##### name ```ts readonly name: "Git Operations Analyzer" = 'Git Operations Analyzer'; ``` Defined in: [rehearsal/git-analyzer.ts:479](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/git-analyzer.ts#L479) Human-readable name ###### Implementation of [`RehearsalAnalyzer`](#rehearsalanalyzer).[`name`](#name-28) ##### patterns ```ts readonly patterns: RegExp[] = GIT_DESTRUCTIVE_PATTERNS; ``` Defined in: [rehearsal/git-analyzer.ts:481](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/git-analyzer.ts#L481) Patterns that this analyzer can handle ###### Implementation of [`RehearsalAnalyzer`](#rehearsalanalyzer).[`patterns`](#patterns-6) #### Methods ##### analyze() ```ts analyze(operation, context): Promise; ``` Defined in: [rehearsal/git-analyzer.ts:487](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/git-analyzer.ts#L487) Analyze the operation and return impact assessment ###### Parameters | Parameter | Type | | ------ | ------ | | `operation` | `string` | | `context` | [`RehearsalContext`](#rehearsalcontext) | ###### Returns `Promise`\<[`RehearsalResult`](#rehearsalresult)\> ###### Implementation of [`RehearsalAnalyzer`](#rehearsalanalyzer).[`analyze`](#analyze-2) ##### canAnalyze() ```ts canAnalyze(operation): boolean; ``` Defined in: [rehearsal/git-analyzer.ts:483](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/git-analyzer.ts#L483) Check if this analyzer can handle the given operation ###### Parameters | Parameter | Type | | ------ | ------ | | `operation` | `string` | ###### Returns `boolean` ###### Implementation of [`RehearsalAnalyzer`](#rehearsalanalyzer).[`canAnalyze`](#cananalyze-2) *** ### GroqProvider Defined in: [providers/groq.ts:53](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/groq.ts#L53) Groq LLM Provider Provides streaming chat completion using Groq's ultra-fast inference. Supports Llama, Mixtral, and other models optimized for speed. #### Extends - [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider) #### Constructors ##### Constructor ```ts new GroqProvider(config?): GroqProvider; ``` Defined in: [providers/groq.ts:58](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/groq.ts#L58) ###### Parameters | Parameter | Type | | ------ | ------ | | `config` | [`GroqProviderConfig`](#groqproviderconfig) | ###### Returns [`GroqProvider`](#groqprovider) ###### Overrides [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider).[`constructor`](#constructor-30) #### Properties ##### name ```ts readonly name: "groq" = 'groq'; ``` Defined in: [providers/groq.ts:54](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/groq.ts#L54) Provider name (e.g., 'openai', 'ollama', 'gemini') ###### Overrides [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider).[`name`](#name-10) #### Methods ##### chat() ```ts chat(messages, options?): AsyncIterable; ``` Defined in: [providers/openai-compatible.ts:222](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai-compatible.ts#L222) Stream chat completion from the provider ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `messages` | [`Message`](#message-4)[] | Conversation messages | | `options?` | [`ChatOptions`](#chatoptions-1) | Chat options (thinking is ignored for non-Claude providers) | ###### Returns `AsyncIterable`\<[`StreamChunk`](#streamchunk)\> ###### Inherited from [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider).[`chat`](#chat-7) ##### countTokens() ```ts countTokens(messages): Promise; ``` Defined in: [providers/openai-compatible.ts:631](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai-compatible.ts#L631) Count tokens in messages using tiktoken (cl100k_base encoding) ###### Parameters | Parameter | Type | | ------ | ------ | | `messages` | [`Message`](#message-4)[] | ###### Returns `Promise`\<`number`\> ###### Inherited from [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider).[`countTokens`](#counttokens-8) ##### getModel() ```ts getModel(): string; ``` Defined in: [providers/openai-compatible.ts:158](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai-compatible.ts#L158) Get the current default model ID. ###### Returns `string` ###### Inherited from [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider).[`getModel`](#getmodel-8) ##### setModel() ```ts setModel(modelId): void; ``` Defined in: [providers/openai-compatible.ts:162](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai-compatible.ts#L162) Change the default model for subsequent calls. Same provider only. Takes effect on the next chat() call, not mid-stream. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `modelId` | `string` | The new model ID (e.g., 'claude-opus-4-20250514') | ###### Returns `void` ###### Inherited from [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider).[`setModel`](#setmodel-8) *** ### GuardrailManager Defined in: [guardrails/manager.ts:58](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/manager.ts#L58) GuardrailManager - Manages pattern-based safety checks for tool execution #### Example ```typescript const manager = new GuardrailManager({ enabled: true, includeDefaults: true, custom: [ { id: 'no-prod-db', name: 'Production Database Protection', description: 'Prevent operations on production database', patterns: [/prod.*db/i, /production.*database/i], action: 'block', message: 'Operations on production database are blocked', } ], onTriggered: async (result, context) => { if (result.action === 'confirm') { return await askUserConfirmation(result.guardrail.message); } return result.action !== 'block'; } }); // Check before tool execution const result = manager.check('bash', { command: 'rm -rf /' }); if (result.triggered && result.action === 'block') { throw new Error(result.guardrail.message); } ``` #### Constructors ##### Constructor ```ts new GuardrailManager(options?): GuardrailManager; ``` Defined in: [guardrails/manager.ts:65](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/manager.ts#L65) ###### Parameters | Parameter | Type | | ------ | ------ | | `options` | [`GuardrailManagerOptions`](#guardrailmanageroptions) | ###### Returns [`GuardrailManager`](#guardrailmanager) #### Accessors ##### enabled ###### Get Signature ```ts get enabled(): boolean; ``` Defined in: [guardrails/manager.ts:176](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/manager.ts#L176) Check if guardrails are enabled ###### Returns `boolean` ##### size ###### Get Signature ```ts get size(): number; ``` Defined in: [guardrails/manager.ts:169](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/manager.ts#L169) Get the number of guardrails ###### Returns `number` #### Methods ##### add() ```ts add(input): Guardrail; ``` Defined in: [guardrails/manager.ts:96](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/manager.ts#L96) Add a custom guardrail ###### Parameters | Parameter | Type | | ------ | ------ | | `input` | [`GuardrailInput`](#guardrailinput) | ###### Returns [`Guardrail`](#guardrail) ##### check() ```ts check(toolName, input): GuardrailResult; ``` Defined in: [guardrails/manager.ts:197](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/manager.ts#L197) Check tool input against all applicable guardrails For inputs with a `command` field (e.g. bash tool), automatically parses compound commands and checks each subcommand independently. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `toolName` | `string` | Name of the tool being called | | `input` | `unknown` | Tool input to check | ###### Returns [`GuardrailResult`](#guardrailresult) GuardrailResult indicating if any guardrail was triggered ##### checkAndHandle() ```ts checkAndHandle(toolName, input): Promise<{ proceed: boolean; result: GuardrailResult; }>; ``` Defined in: [guardrails/manager.ts:310](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/manager.ts#L310) Check and handle guardrail triggering This method checks the input and calls the onTriggered handler if configured. Returns true if execution should proceed, false if blocked. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `toolName` | `string` | Name of the tool being called | | `input` | `unknown` | Tool input to check | ###### Returns `Promise`\<\{ `proceed`: `boolean`; `result`: [`GuardrailResult`](#guardrailresult); \}\> Promise<{ proceed: boolean; result: GuardrailResult }> ##### checkCommand() ```ts checkCommand( toolName, command, originalInput?): GuardrailResult; ``` Defined in: [guardrails/manager.ts:229](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/manager.ts#L229) Check a compound shell command against guardrails. Parses the command into subcommands (splitting on |, &&, ||, ;) and validates each independently. Also checks the full command string to catch cross-subcommand patterns (e.g. `curl ... | bash`). Returns the highest-severity match with subcommand context. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `toolName` | `string` | Name of the tool being called | | `command` | `string` | The shell command string | | `originalInput?` | `unknown` | The original tool input (for result metadata) | ###### Returns [`GuardrailResult`](#guardrailresult) GuardrailResult indicating if any guardrail was triggered ##### disable() ```ts disable(id): boolean; ``` Defined in: [guardrails/manager.ts:159](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/manager.ts#L159) Disable a guardrail ###### Parameters | Parameter | Type | | ------ | ------ | | `id` | `string` | ###### Returns `boolean` ##### enable() ```ts enable(id): boolean; ``` Defined in: [guardrails/manager.ts:149](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/manager.ts#L149) Enable a guardrail ###### Parameters | Parameter | Type | | ------ | ------ | | `id` | `string` | ###### Returns `boolean` ##### get() ```ts get(id): Guardrail | undefined; ``` Defined in: [guardrails/manager.ts:109](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/manager.ts#L109) Get a guardrail by ID ###### Parameters | Parameter | Type | | ------ | ------ | | `id` | `string` | ###### Returns [`Guardrail`](#guardrail) \| `undefined` ##### getAll() ```ts getAll(): Guardrail[]; ``` Defined in: [guardrails/manager.ts:116](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/manager.ts#L116) Get all guardrails ###### Returns [`Guardrail`](#guardrail)[] ##### getForTool() ```ts getForTool(toolName): Guardrail[]; ``` Defined in: [guardrails/manager.ts:123](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/manager.ts#L123) Get guardrails that apply to a specific tool ###### Parameters | Parameter | Type | | ------ | ------ | | `toolName` | `string` | ###### Returns [`Guardrail`](#guardrail)[] ##### has() ```ts has(id): boolean; ``` Defined in: [guardrails/manager.ts:135](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/manager.ts#L135) Check if a guardrail exists ###### Parameters | Parameter | Type | | ------ | ------ | | `id` | `string` | ###### Returns `boolean` ##### onEvent() ```ts onEvent(handler): void; ``` Defined in: [guardrails/manager.ts:89](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/manager.ts#L89) Set the event handler for guardrail events ###### Parameters | Parameter | Type | | ------ | ------ | | `handler` | [`GuardrailEventHandler`](#guardraileventhandler) | ###### Returns `void` ##### remove() ```ts remove(id): boolean; ``` Defined in: [guardrails/manager.ts:142](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/manager.ts#L142) Remove a guardrail by ID ###### Parameters | Parameter | Type | | ------ | ------ | | `id` | `string` | ###### Returns `boolean` ##### setEnabled() ```ts setEnabled(enabled): void; ``` Defined in: [guardrails/manager.ts:183](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/manager.ts#L183) Enable or disable all guardrails ###### Parameters | Parameter | Type | | ------ | ------ | | `enabled` | `boolean` | ###### Returns `void` *** ### HooksManager Defined in: [hooks/manager.ts:53](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/manager.ts#L53) Manages lifecycle hooks for agent customization #### Constructors ##### Constructor ```ts new HooksManager(options?): HooksManager; ``` Defined in: [hooks/manager.ts:65](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/manager.ts#L65) ###### Parameters | Parameter | Type | | ------ | ------ | | `options` | [`HooksManagerOptions`](#hooksmanageroptions) | ###### Returns [`HooksManager`](#hooksmanager) #### Methods ##### clear() ```ts clear(): void; ``` Defined in: [hooks/manager.ts:295](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/manager.ts#L295) Clear all hooks ###### Returns `void` ##### getHookCounts() ```ts getHookCounts(): Record; ``` Defined in: [hooks/manager.ts:664](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/manager.ts#L664) Get hook counts by type ###### Returns `Record`\ ##### getHookIds() ```ts getHookIds(): string[]; ``` Defined in: [hooks/manager.ts:679](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/manager.ts#L679) Get all registered hook IDs ###### Returns `string`[] ##### hasHooks() ```ts hasHooks(): boolean; ``` Defined in: [hooks/manager.ts:649](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/manager.ts#L649) Check if any hooks are registered ###### Returns `boolean` ##### registerAfterIteration() ```ts registerAfterIteration(hook, options?): string; ``` Defined in: [hooks/manager.ts:143](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/manager.ts#L143) Register an after:iteration hook ###### Parameters | Parameter | Type | | ------ | ------ | | `hook` | [`AfterIterationHook`](#afteriterationhook) | | `options?` | [`HookRegistrationOptions`](#hookregistrationoptions) | ###### Returns `string` ##### registerAfterLLM() ```ts registerAfterLLM(hook, options?): string; ``` Defined in: [hooks/manager.ts:185](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/manager.ts#L185) Register an after:llm hook ###### Parameters | Parameter | Type | | ------ | ------ | | `hook` | [`AfterLLMHook`](#afterllmhook) | | `options?` | [`HookRegistrationOptions`](#hookregistrationoptions) | ###### Returns `string` ##### registerAfterTool() ```ts registerAfterTool(hook, options?): string; ``` Defined in: [hooks/manager.ts:227](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/manager.ts#L227) Register an after:tool hook ###### Parameters | Parameter | Type | | ------ | ------ | | `hook` | [`AfterToolHook`](#aftertoolhook) | | `options?` | [`HookRegistrationOptions`](#hookregistrationoptions) | ###### Returns `string` ##### registerBeforeIteration() ```ts registerBeforeIteration(hook, options?): string; ``` Defined in: [hooks/manager.ts:122](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/manager.ts#L122) Register a before:iteration hook ###### Parameters | Parameter | Type | | ------ | ------ | | `hook` | [`BeforeIterationHook`](#beforeiterationhook) | | `options?` | [`HookRegistrationOptions`](#hookregistrationoptions) | ###### Returns `string` ##### registerBeforeLLM() ```ts registerBeforeLLM(hook, options?): string; ``` Defined in: [hooks/manager.ts:164](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/manager.ts#L164) Register a before:llm hook ###### Parameters | Parameter | Type | | ------ | ------ | | `hook` | [`BeforeLLMHook`](#beforellmhook) | | `options?` | [`HookRegistrationOptions`](#hookregistrationoptions) | ###### Returns `string` ##### registerBeforeTool() ```ts registerBeforeTool(hook, options?): string; ``` Defined in: [hooks/manager.ts:206](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/manager.ts#L206) Register a before:tool hook ###### Parameters | Parameter | Type | | ------ | ------ | | `hook` | [`BeforeToolHook`](#beforetoolhook) | | `options?` | [`HookRegistrationOptions`](#hookregistrationoptions) | ###### Returns `string` ##### registerFromConfig() ```ts registerFromConfig(config): void; ``` Defined in: [hooks/manager.ts:81](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/manager.ts#L81) Register hooks from a configuration object ###### Parameters | Parameter | Type | | ------ | ------ | | `config` | [`HooksConfig`](#hooksconfig) | ###### Returns `void` ##### registerOnError() ```ts registerOnError(hook, options?): string; ``` Defined in: [hooks/manager.ts:248](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/manager.ts#L248) Register an onError hook ###### Parameters | Parameter | Type | | ------ | ------ | | `hook` | [`OnErrorHook`](#onerrorhook) | | `options?` | [`HookRegistrationOptions`](#hookregistrationoptions) | ###### Returns `string` ##### runAfterIteration() ```ts runAfterIteration(context): Promise; ``` Defined in: [hooks/manager.ts:355](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/manager.ts#L355) Run after:iteration hooks ###### Parameters | Parameter | Type | | ------ | ------ | | `context` | [`IterationHookContext`](#iterationhookcontext) & \{ `completedWithText`: `boolean`; `toolCalls`: \{ `input`: `Record`\<`string`, `unknown`\>; `name`: `string`; `result`: [`ToolExecutionResult`](#toolexecutionresult); \}[]; \} | ###### Returns `Promise`\<`void`\> ##### runAfterLLM() ```ts runAfterLLM(context): Promise; ``` Defined in: [hooks/manager.ts:451](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/manager.ts#L451) Run after:llm hooks ###### Parameters | Parameter | Type | | ------ | ------ | | `context` | [`AfterLLMHookContext`](#afterllmhookcontext) | ###### Returns `Promise`\<`void`\> ##### runAfterTool() ```ts runAfterTool(context): Promise; ``` Defined in: [hooks/manager.ts:545](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/manager.ts#L545) Run after:tool hooks ###### Parameters | Parameter | Type | | ------ | ------ | | `context` | [`AfterToolHookContext`](#aftertoolhookcontext) | ###### Returns `Promise`\<[`ToolExecutionResult`](#toolexecutionresult)\> potentially modified result ##### runBeforeIteration() ```ts runBeforeIteration(context): Promise; ``` Defined in: [hooks/manager.ts:314](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/manager.ts#L314) Run before:iteration hooks ###### Parameters | Parameter | Type | | ------ | ------ | | `context` | [`IterationHookContext`](#iterationhookcontext) | ###### Returns `Promise`\<`boolean`\> true to continue, false to skip iteration ##### runBeforeLLM() ```ts runBeforeLLM(context): Promise<{ messages: Message[]; systemPrompt: string; tools: ToolDefinition[]; }>; ``` Defined in: [hooks/manager.ts:401](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/manager.ts#L401) Run before:llm hooks ###### Parameters | Parameter | Type | | ------ | ------ | | `context` | [`LLMHookContext`](#llmhookcontext) | ###### Returns `Promise`\<\{ `messages`: [`Message`](#message-4)[]; `systemPrompt`: `string`; `tools`: `ToolDefinition`[]; \}\> potentially modified messages and tools ##### runBeforeTool() ```ts runBeforeTool(context): Promise<{ input: Record; proceed: boolean; skipResult?: ToolExecutionResult; }>; ``` Defined in: [hooks/manager.ts:488](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/manager.ts#L488) Run before:tool hooks ###### Parameters | Parameter | Type | | ------ | ------ | | `context` | [`ToolHookContext`](#toolhookcontext) | ###### Returns `Promise`\<\{ `input`: `Record`\<`string`, `unknown`\>; `proceed`: `boolean`; `skipResult?`: [`ToolExecutionResult`](#toolexecutionresult); \}\> whether to proceed and potentially modified input or skip result ##### runOnError() ```ts runOnError(context): Promise; ``` Defined in: [hooks/manager.ts:591](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/manager.ts#L591) Run onError hooks ###### Parameters | Parameter | Type | | ------ | ------ | | `context` | [`ErrorHookContext`](#errorhookcontext) | ###### Returns `Promise`\<[`ErrorHookResult`](#errorhookresult)\> error handling result ##### unregister() ```ts unregister(hookId): boolean; ``` Defined in: [hooks/manager.ts:269](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/manager.ts#L269) Unregister a hook by ID ###### Parameters | Parameter | Type | | ------ | ------ | | `hookId` | `string` | ###### Returns `boolean` *** ### JsonSerializer Defined in: [state/serializer.ts:15](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/serializer.ts#L15) JSON-based state serializer. Handles standard JSON serialization with validation. #### Implements - [`StateSerializer`](#stateserializer) #### Constructors ##### Constructor ```ts new JsonSerializer(): JsonSerializer; ``` ###### Returns [`JsonSerializer`](#jsonserializer) #### Properties ##### version ```ts readonly version: "1.0" = '1.0'; ``` Defined in: [state/serializer.ts:16](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/serializer.ts#L16) Version identifier for migration support ###### Implementation of [`StateSerializer`](#stateserializer).[`version`](#version-4) #### Methods ##### deserialize() ```ts deserialize(data): AgentState; ``` Defined in: [state/serializer.ts:35](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/serializer.ts#L35) Deserialize JSON string to agent state ###### Parameters | Parameter | Type | | ------ | ------ | | `data` | `string` | ###### Returns [`AgentState`](#agentstate) ###### Implementation of [`StateSerializer`](#stateserializer).[`deserialize`](#deserialize-2) ##### migrate() ```ts migrate(data, fromVersion): string; ``` Defined in: [state/serializer.ts:122](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/serializer.ts#L122) Migrate from older versions (currently no-op for v1) ###### Parameters | Parameter | Type | | ------ | ------ | | `data` | `string` | | `fromVersion` | `string` | ###### Returns `string` ###### Implementation of [`StateSerializer`](#stateserializer).[`migrate`](#migrate-1) ##### serialize() ```ts serialize(state): string; ``` Defined in: [state/serializer.ts:21](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/serializer.ts#L21) Serialize agent state to JSON string ###### Parameters | Parameter | Type | | ------ | ------ | | `state` | [`AgentState`](#agentstate) | ###### Returns `string` ###### Implementation of [`StateSerializer`](#stateserializer).[`serialize`](#serialize-3) ##### validate() ```ts validate(state): void; ``` Defined in: [state/serializer.ts:63](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/serializer.ts#L63) Validate state before serialization (public interface method). This is called by checkpointers before saving to prevent corrupted checkpoints. ###### Parameters | Parameter | Type | | ------ | ------ | | `state` | [`AgentState`](#agentstate) | ###### Returns `void` ###### Throws StateError if state is invalid ###### Implementation of [`StateSerializer`](#stateserializer).[`validate`](#validate-2) *** ### MaxIterationsError Defined in: [errors.ts:199](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L199) Error thrown when the agentic loop exceeds max iterations. #### Example ```typescript throw new MaxIterationsError(10); ``` #### Extends - [`AgentError`](#agenterror) #### Constructors ##### Constructor ```ts new MaxIterationsError(maxIterations): MaxIterationsError; ``` Defined in: [errors.ts:200](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L200) ###### Parameters | Parameter | Type | | ------ | ------ | | `maxIterations` | `number` | ###### Returns [`MaxIterationsError`](#maxiterationserror) ###### Overrides [`AgentError`](#agenterror).[`constructor`](#constructor-2) #### Properties ##### cause? ```ts readonly optional cause?: Error; ``` Defined in: [errors.ts:17](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L17) ###### Inherited from [`AgentError`](#agenterror).[`cause`](#cause-1) ##### maxIterations ```ts readonly maxIterations: number; ``` Defined in: [errors.ts:200](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L200) *** ### MCPClient Defined in: [mcp/client.ts:110](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/client.ts#L110) MCP Client for connecting to a single MCP server #### Example ```typescript const client = new MCPClient({ name: 'filesystem', transport: 'stdio', stdio: { command: 'npx', args: ['-y', '@modelcontextprotocol/server-filesystem', '/tmp'], }, }); await client.connect(); const tools = await client.listTools(); const result = await client.callTool('read_file', { path: '/tmp/test.txt' }); await client.disconnect(); ``` #### Constructors ##### Constructor ```ts new MCPClient(config): MCPClient; ``` Defined in: [mcp/client.ts:119](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/client.ts#L119) ###### Parameters | Parameter | Type | | ------ | ------ | | `config` | [`MCPClientConfig`](#mcpclientconfig) | ###### Returns [`MCPClient`](#mcpclient) #### Properties ##### name ```ts readonly name: string; ``` Defined in: [mcp/client.ts:111](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/client.ts#L111) #### Accessors ##### isConnected ###### Get Signature ```ts get isConnected(): boolean; ``` Defined in: [mcp/client.ts:150](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/client.ts#L150) Whether the client is connected ###### Returns `boolean` ##### status ###### Get Signature ```ts get status(): MCPConnectionStatus; ``` Defined in: [mcp/client.ts:143](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/client.ts#L143) Current connection status ###### Returns [`MCPConnectionStatus`](#mcpconnectionstatus) #### Methods ##### callTool() ```ts callTool(toolName, args?): Promise; ``` Defined in: [mcp/client.ts:288](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/client.ts#L288) Call a tool on the server ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `toolName` | `string` | Name of the tool to call | | `args?` | `Record`\<`string`, `unknown`\> | Arguments to pass to the tool | ###### Returns `Promise`\<[`MCPToolResult`](#mcptoolresult)\> ###### Throws MCPError if not connected, tool not found, or execution fails ##### connect() ```ts connect(): Promise; ``` Defined in: [mcp/client.ts:158](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/client.ts#L158) Connect to the MCP server ###### Returns `Promise`\<`void`\> ###### Throws MCPError if connection fails ##### disconnect() ```ts disconnect(): Promise; ``` Defined in: [mcp/client.ts:236](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/client.ts#L236) Disconnect from the MCP server ###### Returns `Promise`\<`void`\> ##### listTools() ```ts listTools(): Promise; ``` Defined in: [mcp/client.ts:260](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/client.ts#L260) List available tools from the server ###### Returns `Promise`\<[`MCPToolDefinition`](#mcptooldefinition)[]\> ###### Throws MCPError if not connected or listing fails ##### onDisconnect() ```ts onDisconnect(callback): () => void; ``` Defined in: [mcp/client.ts:358](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/client.ts#L358) Convenience method to listen for disconnect ###### Parameters | Parameter | Type | | ------ | ------ | | `callback` | () => `void` | ###### Returns () => `void` ##### onError() ```ts onError(callback): () => void; ``` Defined in: [mcp/client.ts:347](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/client.ts#L347) Convenience method to listen for errors ###### Parameters | Parameter | Type | | ------ | ------ | | `callback` | (`error`) => `void` | ###### Returns () => `void` ##### onEvent() ```ts onEvent(handler): () => void; ``` Defined in: [mcp/client.ts:323](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/client.ts#L323) Register an event handler ###### Parameters | Parameter | Type | | ------ | ------ | | `handler` | [`MCPClientEventHandler`](#mcpclienteventhandler) | ###### Returns () => `void` ##### onToolsChanged() ```ts onToolsChanged(callback): () => void; ``` Defined in: [mcp/client.ts:331](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/client.ts#L331) Convenience method to listen for tools changed events ###### Parameters | Parameter | Type | | ------ | ------ | | `callback` | (`tools`) => `void` | ###### Returns () => `void` *** ### MCPError Defined in: [mcp/errors.ts:43](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/errors.ts#L43) Error thrown for MCP-related failures #### Example ```typescript throw new MCPError( 'Failed to connect to server', 'filesystem', MCPErrorCode.CONNECTION_FAILED ); ``` #### Extends - [`AgentError`](#agenterror) #### Constructors ##### Constructor ```ts new MCPError( message, serverName, code, cause?): MCPError; ``` Defined in: [mcp/errors.ts:44](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/errors.ts#L44) ###### Parameters | Parameter | Type | | ------ | ------ | | `message` | `string` | | `serverName` | `string` | | `code` | [`MCPErrorCode`](#mcperrorcode) | | `cause?` | `Error` | ###### Returns [`MCPError`](#mcperror) ###### Overrides [`AgentError`](#agenterror).[`constructor`](#constructor-2) #### Properties ##### cause? ```ts readonly optional cause?: Error; ``` Defined in: [errors.ts:17](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L17) ###### Inherited from [`AgentError`](#agenterror).[`cause`](#cause-1) ##### code ```ts readonly code: MCPErrorCode; ``` Defined in: [mcp/errors.ts:47](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/errors.ts#L47) ##### serverName ```ts readonly serverName: string; ``` Defined in: [mcp/errors.ts:46](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/errors.ts#L46) #### Methods ##### isRetryable() ```ts isRetryable(): boolean; ``` Defined in: [mcp/errors.ts:64](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/errors.ts#L64) Check if the error is retryable (connection/timeout issues) ###### Returns `boolean` ##### isSDKNotInstalled() ```ts isSDKNotInstalled(): boolean; ``` Defined in: [mcp/errors.ts:57](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/errors.ts#L57) Check if the error is due to missing SDK ###### Returns `boolean` *** ### MCPManager Defined in: [mcp/manager.ts:53](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/manager.ts#L53) MCP Manager for managing multiple MCP server connections #### Example ```typescript const manager = new MCPManager(); // Add servers await manager.addServer({ name: 'filesystem', transport: 'stdio', command: 'npx', args: ['-y', '@modelcontextprotocol/server-filesystem', '/tmp'], }); // Discover and get tools const tools = await manager.discoverTools(); // Use with agent const agent = new Agent({ provider: claude, tools: [...builtinTools, ...tools], }); // Cleanup await manager.disconnectAll(); ``` #### Constructors ##### Constructor ```ts new MCPManager(options?): MCPManager; ``` Defined in: [mcp/manager.ts:60](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/manager.ts#L60) ###### Parameters | Parameter | Type | | ------ | ------ | | `options` | [`MCPManagerOptions`](#mcpmanageroptions) | ###### Returns [`MCPManager`](#mcpmanager) #### Methods ##### addServer() ```ts addServer(config): Promise; ``` Defined in: [mcp/manager.ts:83](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/manager.ts#L83) Add an MCP server ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `config` | [`MCPServerConfig`](#mcpserverconfig) | Server configuration | ###### Returns `Promise`\<[`MCPClient`](#mcpclient)\> The created MCPClient ###### Throws MCPError if server with same name already exists ##### connectAll() ```ts connectAll(): Promise; ``` Defined in: [mcp/manager.ts:283](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/manager.ts#L283) Connect all servers ###### Returns `Promise`\<`void`\> ##### disconnectAll() ```ts disconnectAll(): Promise; ``` Defined in: [mcp/manager.ts:304](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/manager.ts#L304) Disconnect all servers ###### Returns `Promise`\<`void`\> ##### discoverTools() ```ts discoverTools(): Promise[]>; ``` Defined in: [mcp/manager.ts:183](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/manager.ts#L183) Discover tools from all connected servers ###### Returns `Promise`\<[`Tool`](#tool)\<`object`\>[]\> Array of converted tools ready for registration ##### discoverToolsFrom() ```ts discoverToolsFrom(serverName): Promise[]>; ``` Defined in: [mcp/manager.ts:209](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/manager.ts#L209) Discover tools from a specific server ###### Parameters | Parameter | Type | | ------ | ------ | | `serverName` | `string` | ###### Returns `Promise`\<[`Tool`](#tool)\<`object`\>[]\> ##### getServer() ```ts getServer(name): MCPClient | undefined; ``` Defined in: [mcp/manager.ts:153](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/manager.ts#L153) Get an MCP client by name ###### Parameters | Parameter | Type | | ------ | ------ | | `name` | `string` | ###### Returns [`MCPClient`](#mcpclient) \| `undefined` ##### getServerNames() ```ts getServerNames(): string[]; ``` Defined in: [mcp/manager.ts:167](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/manager.ts#L167) Get all server names ###### Returns `string`[] ##### getServers() ```ts getServers(): MCPClient[]; ``` Defined in: [mcp/manager.ts:160](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/manager.ts#L160) Get all MCP clients ###### Returns [`MCPClient`](#mcpclient)[] ##### hasServer() ```ts hasServer(name): boolean; ``` Defined in: [mcp/manager.ts:174](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/manager.ts#L174) Check if a server exists ###### Parameters | Parameter | Type | | ------ | ------ | | `name` | `string` | ###### Returns `boolean` ##### onEvent() ```ts onEvent(handler): () => void; ``` Defined in: [mcp/manager.ts:312](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/manager.ts#L312) Register an event handler ###### Parameters | Parameter | Type | | ------ | ------ | | `handler` | [`MCPClientEventHandler`](#mcpclienteventhandler) | ###### Returns () => `void` ##### refreshTools() ```ts refreshTools(serverName?): Promise; ``` Defined in: [mcp/manager.ts:236](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/manager.ts#L236) Refresh tools from servers and update the tool registry ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `serverName?` | `string` | Optional server name to refresh. If not provided, refreshes all. | ###### Returns `Promise`\<`void`\> ##### removeServer() ```ts removeServer(name): Promise; ``` Defined in: [mcp/manager.ts:125](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/manager.ts#L125) Remove an MCP server ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `name` | `string` | Server name | ###### Returns `Promise`\<`void`\> ###### Throws MCPError if server not found ##### setToolRegistry() ```ts setToolRegistry(registry): void; ``` Defined in: [mcp/manager.ts:72](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/manager.ts#L72) Set a tool registry for automatic tool registration When set, tools from MCP servers will be automatically registered ###### Parameters | Parameter | Type | | ------ | ------ | | `registry` | [`DefaultToolRegistry`](#defaulttoolregistry) | ###### Returns `void` *** ### MemoryCheckpointer Defined in: [state/checkpointer.ts:116](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/checkpointer.ts#L116) In-memory checkpointer for development and testing. State is lost when the process exits. #### Implements - [`Checkpointer`](#checkpointer-1) #### Constructors ##### Constructor ```ts new MemoryCheckpointer(): MemoryCheckpointer; ``` ###### Returns [`MemoryCheckpointer`](#memorycheckpointer) #### Accessors ##### size ###### Get Signature ```ts get size(): number; ``` Defined in: [state/checkpointer.ts:215](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/checkpointer.ts#L215) Get current session count ###### Returns `number` #### Methods ##### clear() ```ts clear(): void; ``` Defined in: [state/checkpointer.ts:208](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/checkpointer.ts#L208) Clear all sessions (useful for testing) ###### Returns `void` ##### delete() ```ts delete(sessionId): Promise; ``` Defined in: [state/checkpointer.ts:182](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/checkpointer.ts#L182) Delete a session ###### Parameters | Parameter | Type | | ------ | ------ | | `sessionId` | `string` | ###### Returns `Promise`\<`boolean`\> ###### Implementation of [`Checkpointer`](#checkpointer-1).[`delete`](#delete-2) ##### exists() ```ts exists(sessionId): Promise; ``` Defined in: [state/checkpointer.ts:190](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/checkpointer.ts#L190) Check if session exists ###### Parameters | Parameter | Type | | ------ | ------ | | `sessionId` | `string` | ###### Returns `Promise`\<`boolean`\> ###### Implementation of [`Checkpointer`](#checkpointer-1).[`exists`](#exists-2) ##### getMetadata() ```ts getMetadata(sessionId): Promise; ``` Defined in: [state/checkpointer.ts:198](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/checkpointer.ts#L198) Get session metadata ###### Parameters | Parameter | Type | | ------ | ------ | | `sessionId` | `string` | ###### Returns `Promise`\<[`SessionMetadata`](#sessionmetadata) \| `null`\> ###### Implementation of [`Checkpointer`](#checkpointer-1).[`getMetadata`](#getmetadata-2) ##### list() ```ts list(options?): Promise; ``` Defined in: [state/checkpointer.ts:155](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/checkpointer.ts#L155) List all sessions ###### Parameters | Parameter | Type | | ------ | ------ | | `options?` | [`ListSessionsOptions`](#listsessionsoptions) | ###### Returns `Promise`\<[`SessionInfo`](#sessioninfo)[]\> ###### Implementation of [`Checkpointer`](#checkpointer-1).[`list`](#list-3) ##### load() ```ts load(sessionId): Promise; ``` Defined in: [state/checkpointer.ts:145](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/checkpointer.ts#L145) Load state from memory ###### Parameters | Parameter | Type | | ------ | ------ | | `sessionId` | `string` | ###### Returns `Promise`\<[`AgentState`](#agentstate) \| `null`\> ###### Implementation of [`Checkpointer`](#checkpointer-1).[`load`](#load-3) ##### save() ```ts save( sessionId, state, metadataOverrides?): Promise; ``` Defined in: [state/checkpointer.ts:125](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/checkpointer.ts#L125) Save state to memory Pre-validates state before saving to prevent corrupted checkpoints. This catches issues like invalid data types that would fail on reload. ###### Parameters | Parameter | Type | | ------ | ------ | | `sessionId` | `string` | | `state` | [`AgentState`](#agentstate) | | `metadataOverrides?` | `Partial`\<[`SessionMetadata`](#sessionmetadata)\> | ###### Returns `Promise`\<`void`\> ###### Implementation of [`Checkpointer`](#checkpointer-1).[`save`](#save-2) *** ### MockProvider Defined in: [providers/mock.ts:82](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/mock.ts#L82) MockProvider for testing agents without API calls. Responses are consumed in order (FIFO queue). #### Implements - [`LLMProvider`](#llmprovider) #### Constructors ##### Constructor ```ts new MockProvider(config?): MockProvider; ``` Defined in: [providers/mock.ts:93](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/mock.ts#L93) ###### Parameters | Parameter | Type | | ------ | ------ | | `config` | [`MockProviderConfig`](#mockproviderconfig) | ###### Returns [`MockProvider`](#mockprovider) #### Properties ##### name ```ts readonly name: "mock" = 'mock'; ``` Defined in: [providers/mock.ts:83](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/mock.ts#L83) Provider identifier (e.g., 'claude', 'openai', 'gemini') ###### Implementation of [`LLMProvider`](#llmprovider).[`name`](#name-21) #### Methods ##### addError() ```ts addError(error): this; ``` Defined in: [providers/mock.ts:131](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/mock.ts#L131) Queue an error to be thrown on the next call ###### Parameters | Parameter | Type | | ------ | ------ | | `error` | `Error` | ###### Returns `this` ##### addResponse() ```ts addResponse(response): this; ``` Defined in: [providers/mock.ts:109](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/mock.ts#L109) Add a response (text string or structured response with tool calls) ###### Parameters | Parameter | Type | | ------ | ------ | | `response` | `string` \| [`MockResponse`](#mockresponse) | ###### Returns `this` ##### addResponses() ```ts addResponses(responses): this; ``` Defined in: [providers/mock.ts:121](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/mock.ts#L121) Add multiple responses at once ###### Parameters | Parameter | Type | | ------ | ------ | | `responses` | (`string` \| [`MockResponse`](#mockresponse))[] | ###### Returns `this` ##### chat() ```ts chat(messages, options?): AsyncIterable; ``` Defined in: [providers/mock.ts:177](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/mock.ts#L177) Stream chat response ###### Parameters | Parameter | Type | | ------ | ------ | | `messages` | [`Message`](#message-4)[] | | `options?` | [`ChatOptions`](#chatoptions-1) | ###### Returns `AsyncIterable`\<[`StreamChunk`](#streamchunk)\> ###### Implementation of [`LLMProvider`](#llmprovider).[`chat`](#chat-13) ##### countTokens() ```ts countTokens(messages): Promise; ``` Defined in: [providers/mock.ts:256](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/mock.ts#L256) Count tokens using tiktoken (cl100k_base encoding) ###### Parameters | Parameter | Type | | ------ | ------ | | `messages` | [`Message`](#message-4)[] | ###### Returns `Promise`\<`number`\> ###### Implementation of [`LLMProvider`](#llmprovider).[`countTokens`](#counttokens-14) ##### getCallCount() ```ts getCallCount(): number; ``` Defined in: [providers/mock.ts:139](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/mock.ts#L139) Get number of times chat() was called ###### Returns `number` ##### getCallHistory() ```ts getCallHistory(): readonly { messages: Message[]; options?: ChatOptions; }[]; ``` Defined in: [providers/mock.ts:146](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/mock.ts#L146) Get the history of all calls made ###### Returns readonly \{ `messages`: [`Message`](#message-4)[]; `options?`: [`ChatOptions`](#chatoptions-1); \}[] ##### getLastCall() ```ts getLastCall(): | { messages: Message[]; options?: ChatOptions; } | undefined; ``` Defined in: [providers/mock.ts:153](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/mock.ts#L153) Get the last call made ###### Returns \| \{ `messages`: [`Message`](#message-4)[]; `options?`: [`ChatOptions`](#chatoptions-1); \} \| `undefined` ##### getModel() ```ts getModel(): string; ``` Defined in: [providers/mock.ts:98](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/mock.ts#L98) Get the current default model ID. ###### Returns `string` ###### Implementation of [`LLMProvider`](#llmprovider).[`getModel`](#getmodel-14) ##### hasResponses() ```ts hasResponses(): boolean; ``` Defined in: [providers/mock.ts:170](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/mock.ts#L170) Check if there are any queued responses ###### Returns `boolean` ##### reset() ```ts reset(): this; ``` Defined in: [providers/mock.ts:160](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/mock.ts#L160) Clear all queued responses and call history ###### Returns `this` ##### setModel() ```ts setModel(modelId): void; ``` Defined in: [providers/mock.ts:102](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/mock.ts#L102) Change the default model for subsequent calls. Same provider only. Takes effect on the next chat() call, not mid-stream. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `modelId` | `string` | The new model ID (e.g., 'claude-opus-4-20250514') | ###### Returns `void` ###### Implementation of [`LLMProvider`](#llmprovider).[`setModel`](#setmodel-14) *** ### ObservationMasker Defined in: [context/observation-masker.ts:99](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/observation-masker.ts#L99) #### Constructors ##### Constructor ```ts new ObservationMasker(config?): ObservationMasker; ``` Defined in: [context/observation-masker.ts:106](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/observation-masker.ts#L106) ###### Parameters | Parameter | Type | | ------ | ------ | | `config?` | `Partial`\<[`ObservationMaskConfig`](#observationmaskconfig)\> | ###### Returns [`ObservationMasker`](#observationmasker) #### Methods ##### getConfig() ```ts getConfig(): ObservationMaskConfig; ``` Defined in: [context/observation-masker.ts:281](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/observation-masker.ts#L281) Get current configuration (for testing/inspection). ###### Returns [`ObservationMaskConfig`](#observationmaskconfig) ##### getStats() ```ts getStats(): ObservationMaskStats; ``` Defined in: [context/observation-masker.ts:263](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/observation-masker.ts#L263) ###### Returns [`ObservationMaskStats`](#observationmaskstats) ##### maskHistory() ```ts maskHistory(messages, currentTurn): MaskResult; ``` Defined in: [context/observation-masker.ts:166](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/observation-masker.ts#L166) Mask old tool results, images, and compact old tool_use inputs in-place. - tool_result: replaces content with compact mask text (Phase 1) - image: replaces with text placeholder after maskAfterTurns (Phase 2) - tool_use input: strips large fields, keeping only identifying fields (Phase 1b) ###### Parameters | Parameter | Type | | ------ | ------ | | `messages` | [`Message`](#message-4)[] | | `currentTurn` | `number` | ###### Returns [`MaskResult`](#maskresult) ##### reset() ```ts reset(): void; ``` Defined in: [context/observation-masker.ts:273](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/observation-masker.ts#L273) Reset all state (stamps and stats). Used when clearing history. ###### Returns `void` ##### stamp() ```ts stamp( toolUseId, toolName, input, contentLength, turn): void; ``` Defined in: [context/observation-masker.ts:118](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/observation-masker.ts#L118) Register a tool result with its turn number and input context. Called immediately after a tool result is added to the messages array. ###### Parameters | Parameter | Type | | ------ | ------ | | `toolUseId` | `string` | | `toolName` | `string` | | `input` | `Record`\<`string`, `unknown`\> | | `contentLength` | `number` | | `turn` | `number` | ###### Returns `void` ##### stampImages() ```ts stampImages(messages, turn): void; ``` Defined in: [context/observation-masker.ts:141](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/observation-masker.ts#L141) Stamp all image blocks in a message array with the current turn. Call this after adding user messages that may contain images. ###### Parameters | Parameter | Type | | ------ | ------ | | `messages` | [`Message`](#message-4)[] | | `turn` | `number` | ###### Returns `void` *** ### OllamaProvider Defined in: [providers/ollama.ts:53](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/ollama.ts#L53) Ollama LLM Provider Provides streaming chat completion using local Ollama models. Supports tool calling with compatible models (llama3.1, mistral, etc.) #### Extends - [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider) #### Constructors ##### Constructor ```ts new OllamaProvider(config?): OllamaProvider; ``` Defined in: [providers/ollama.ts:58](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/ollama.ts#L58) ###### Parameters | Parameter | Type | | ------ | ------ | | `config` | [`OllamaProviderConfig`](#ollamaproviderconfig) | ###### Returns [`OllamaProvider`](#ollamaprovider) ###### Overrides [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider).[`constructor`](#constructor-30) #### Properties ##### name ```ts readonly name: "ollama" = 'ollama'; ``` Defined in: [providers/ollama.ts:54](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/ollama.ts#L54) Provider name (e.g., 'openai', 'ollama', 'gemini') ###### Overrides [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider).[`name`](#name-10) #### Methods ##### chat() ```ts chat(messages, options?): AsyncIterable; ``` Defined in: [providers/openai-compatible.ts:222](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai-compatible.ts#L222) Stream chat completion from the provider ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `messages` | [`Message`](#message-4)[] | Conversation messages | | `options?` | [`ChatOptions`](#chatoptions-1) | Chat options (thinking is ignored for non-Claude providers) | ###### Returns `AsyncIterable`\<[`StreamChunk`](#streamchunk)\> ###### Inherited from [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider).[`chat`](#chat-7) ##### countTokens() ```ts countTokens(messages): Promise; ``` Defined in: [providers/openai-compatible.ts:631](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai-compatible.ts#L631) Count tokens in messages using tiktoken (cl100k_base encoding) ###### Parameters | Parameter | Type | | ------ | ------ | | `messages` | [`Message`](#message-4)[] | ###### Returns `Promise`\<`number`\> ###### Inherited from [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider).[`countTokens`](#counttokens-8) ##### getModel() ```ts getModel(): string; ``` Defined in: [providers/openai-compatible.ts:158](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai-compatible.ts#L158) Get the current default model ID. ###### Returns `string` ###### Inherited from [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider).[`getModel`](#getmodel-8) ##### setModel() ```ts setModel(modelId): void; ``` Defined in: [providers/openai-compatible.ts:162](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai-compatible.ts#L162) Change the default model for subsequent calls. Same provider only. Takes effect on the next chat() call, not mid-stream. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `modelId` | `string` | The new model ID (e.g., 'claude-opus-4-20250514') | ###### Returns `void` ###### Inherited from [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider).[`setModel`](#setmodel-8) *** ### `abstract` OpenAICompatibleProvider Defined in: [providers/openai-compatible.ts:137](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai-compatible.ts#L137) Abstract base class for OpenAI-compatible LLM providers Provides shared implementation for providers that use the OpenAI chat completions API format (OpenAI, Ollama, Azure OpenAI, Gemini). #### Extended by - [`OllamaProvider`](#ollamaprovider) - [`OpenAIProvider`](#openaiprovider) - [`GeminiLegacyProvider`](#geminilegacyprovider) - [`TogetherProvider`](#togetherprovider) - [`GroqProvider`](#groqprovider) - [`FireworksProvider`](#fireworksprovider) - [`PerplexityProvider`](#perplexityprovider) - [`OpenRouterProvider`](#openrouterprovider) #### Implements - [`LLMProvider`](#llmprovider) #### Constructors ##### Constructor ```ts new OpenAICompatibleProvider(config): OpenAICompatibleProvider; ``` Defined in: [providers/openai-compatible.ts:149](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai-compatible.ts#L149) ###### Parameters | Parameter | Type | | ------ | ------ | | `config` | [`OpenAICompatibleConfig`](#openaicompatibleconfig) | ###### Returns [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider) #### Properties ##### name ```ts abstract readonly name: string; ``` Defined in: [providers/openai-compatible.ts:141](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai-compatible.ts#L141) Provider name (e.g., 'openai', 'ollama', 'gemini') ###### Implementation of [`LLMProvider`](#llmprovider).[`name`](#name-21) #### Methods ##### chat() ```ts chat(messages, options?): AsyncIterable; ``` Defined in: [providers/openai-compatible.ts:222](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai-compatible.ts#L222) Stream chat completion from the provider ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `messages` | [`Message`](#message-4)[] | Conversation messages | | `options?` | [`ChatOptions`](#chatoptions-1) | Chat options (thinking is ignored for non-Claude providers) | ###### Returns `AsyncIterable`\<[`StreamChunk`](#streamchunk)\> ###### Implementation of [`LLMProvider`](#llmprovider).[`chat`](#chat-13) ##### countTokens() ```ts countTokens(messages): Promise; ``` Defined in: [providers/openai-compatible.ts:631](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai-compatible.ts#L631) Count tokens in messages using tiktoken (cl100k_base encoding) ###### Parameters | Parameter | Type | | ------ | ------ | | `messages` | [`Message`](#message-4)[] | ###### Returns `Promise`\<`number`\> ###### Implementation of [`LLMProvider`](#llmprovider).[`countTokens`](#counttokens-14) ##### getModel() ```ts getModel(): string; ``` Defined in: [providers/openai-compatible.ts:158](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai-compatible.ts#L158) Get the current default model ID. ###### Returns `string` ###### Implementation of [`LLMProvider`](#llmprovider).[`getModel`](#getmodel-14) ##### setModel() ```ts setModel(modelId): void; ``` Defined in: [providers/openai-compatible.ts:162](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai-compatible.ts#L162) Change the default model for subsequent calls. Same provider only. Takes effect on the next chat() call, not mid-stream. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `modelId` | `string` | The new model ID (e.g., 'claude-opus-4-20250514') | ###### Returns `void` ###### Implementation of [`LLMProvider`](#llmprovider).[`setModel`](#setmodel-14) *** ### OpenAIProvider Defined in: [providers/openai.ts:55](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai.ts#L55) OpenAI LLM Provider Provides streaming chat completion using OpenAI models. Supports GPT-4o, GPT-4o-mini, and other compatible models. #### Extends - [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider) #### Constructors ##### Constructor ```ts new OpenAIProvider(config?): OpenAIProvider; ``` Defined in: [providers/openai.ts:61](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai.ts#L61) ###### Parameters | Parameter | Type | | ------ | ------ | | `config` | [`OpenAIProviderConfig`](#openaiproviderconfig) | ###### Returns [`OpenAIProvider`](#openaiprovider) ###### Overrides [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider).[`constructor`](#constructor-30) #### Properties ##### name ```ts readonly name: "openai" = 'openai'; ``` Defined in: [providers/openai.ts:56](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai.ts#L56) Provider name (e.g., 'openai', 'ollama', 'gemini') ###### Overrides [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider).[`name`](#name-10) #### Methods ##### chat() ```ts chat(messages, options?): AsyncIterable; ``` Defined in: [providers/openai-compatible.ts:222](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai-compatible.ts#L222) Stream chat completion from the provider ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `messages` | [`Message`](#message-4)[] | Conversation messages | | `options?` | [`ChatOptions`](#chatoptions-1) | Chat options (thinking is ignored for non-Claude providers) | ###### Returns `AsyncIterable`\<[`StreamChunk`](#streamchunk)\> ###### Inherited from [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider).[`chat`](#chat-7) ##### countTokens() ```ts countTokens(messages): Promise; ``` Defined in: [providers/openai-compatible.ts:631](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai-compatible.ts#L631) Count tokens in messages using tiktoken (cl100k_base encoding) ###### Parameters | Parameter | Type | | ------ | ------ | | `messages` | [`Message`](#message-4)[] | ###### Returns `Promise`\<`number`\> ###### Inherited from [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider).[`countTokens`](#counttokens-8) ##### getModel() ```ts getModel(): string; ``` Defined in: [providers/openai-compatible.ts:158](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai-compatible.ts#L158) Get the current default model ID. ###### Returns `string` ###### Inherited from [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider).[`getModel`](#getmodel-8) ##### setModel() ```ts setModel(modelId): void; ``` Defined in: [providers/openai-compatible.ts:162](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai-compatible.ts#L162) Change the default model for subsequent calls. Same provider only. Takes effect on the next chat() call, not mid-stream. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `modelId` | `string` | The new model ID (e.g., 'claude-opus-4-20250514') | ###### Returns `void` ###### Inherited from [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider).[`setModel`](#setmodel-8) *** ### OpenRouterProvider Defined in: [providers/openrouter.ts:58](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openrouter.ts#L58) OpenRouter LLM Provider Provides streaming chat completion via OpenRouter's unified API. Access 100+ models from Claude, GPT, Llama, Mistral, and more. #### Extends - [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider) #### Constructors ##### Constructor ```ts new OpenRouterProvider(config?): OpenRouterProvider; ``` Defined in: [providers/openrouter.ts:65](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openrouter.ts#L65) ###### Parameters | Parameter | Type | | ------ | ------ | | `config` | [`OpenRouterProviderConfig`](#openrouterproviderconfig) | ###### Returns [`OpenRouterProvider`](#openrouterprovider) ###### Overrides [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider).[`constructor`](#constructor-30) #### Properties ##### name ```ts readonly name: "openrouter" = 'openrouter'; ``` Defined in: [providers/openrouter.ts:59](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openrouter.ts#L59) Provider name (e.g., 'openai', 'ollama', 'gemini') ###### Overrides [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider).[`name`](#name-10) #### Methods ##### chat() ```ts chat(messages, options?): AsyncIterable; ``` Defined in: [providers/openai-compatible.ts:222](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai-compatible.ts#L222) Stream chat completion from the provider ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `messages` | [`Message`](#message-4)[] | Conversation messages | | `options?` | [`ChatOptions`](#chatoptions-1) | Chat options (thinking is ignored for non-Claude providers) | ###### Returns `AsyncIterable`\<[`StreamChunk`](#streamchunk)\> ###### Inherited from [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider).[`chat`](#chat-7) ##### countTokens() ```ts countTokens(messages): Promise; ``` Defined in: [providers/openai-compatible.ts:631](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai-compatible.ts#L631) Count tokens in messages using tiktoken (cl100k_base encoding) ###### Parameters | Parameter | Type | | ------ | ------ | | `messages` | [`Message`](#message-4)[] | ###### Returns `Promise`\<`number`\> ###### Inherited from [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider).[`countTokens`](#counttokens-8) ##### getModel() ```ts getModel(): string; ``` Defined in: [providers/openai-compatible.ts:158](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai-compatible.ts#L158) Get the current default model ID. ###### Returns `string` ###### Inherited from [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider).[`getModel`](#getmodel-8) ##### setModel() ```ts setModel(modelId): void; ``` Defined in: [providers/openai-compatible.ts:162](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai-compatible.ts#L162) Change the default model for subsequent calls. Same provider only. Takes effect on the next chat() call, not mid-stream. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `modelId` | `string` | The new model ID (e.g., 'claude-opus-4-20250514') | ###### Returns `void` ###### Inherited from [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider).[`setModel`](#setmodel-8) *** ### OTelNotInstalledError Defined in: [tracing/otel.ts:22](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/otel.ts#L22) Error thrown when OpenTelemetry SDK is not installed #### Extends - `Error` #### Constructors ##### Constructor ```ts new OTelNotInstalledError(): OTelNotInstalledError; ``` Defined in: [tracing/otel.ts:23](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/otel.ts#L23) ###### Returns [`OTelNotInstalledError`](#otelnotinstallederror) ###### Overrides ```ts Error.constructor ``` *** ### PermissionManager Defined in: [permissions/manager.ts:130](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/manager.ts#L130) PermissionManager handles tool-level permission checks #### Constructors ##### Constructor ```ts new PermissionManager(options?): PermissionManager; ``` Defined in: [permissions/manager.ts:144](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/manager.ts#L144) ###### Parameters | Parameter | Type | | ------ | ------ | | `options` | [`PermissionManagerOptions`](#permissionmanageroptions) | ###### Returns [`PermissionManager`](#permissionmanager) #### Accessors ##### isEnabled ###### Get Signature ```ts get isEnabled(): boolean; ``` Defined in: [permissions/manager.ts:447](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/manager.ts#L447) Check if permissions are enabled ###### Returns `boolean` ##### size ###### Get Signature ```ts get size(): number; ``` Defined in: [permissions/manager.ts:440](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/manager.ts#L440) Get the number of rules ###### Returns `number` #### Methods ##### addRule() ```ts addRule(rule): this; ``` Defined in: [permissions/manager.ts:168](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/manager.ts#L168) Add a permission rule ###### Parameters | Parameter | Type | | ------ | ------ | | `rule` | [`ToolPermission`](#toolpermission) | ###### Returns `this` ##### check() ```ts check(toolName, input): Promise; ``` Defined in: [permissions/manager.ts:231](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/manager.ts#L231) Check if a tool has permission to execute ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `toolName` | `string` | Name of the tool | | `input` | `Record`\<`string`, `unknown`\> | Tool input arguments | ###### Returns `Promise`\<[`PermissionCheckResult`](#permissioncheckresult)\> Permission check result ##### checkAndProceed() ```ts checkAndProceed(toolName, input): Promise<{ proceed: boolean; result: PermissionCheckResult; }>; ``` Defined in: [permissions/manager.ts:311](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/manager.ts#L311) Check and handle permission, returning whether to proceed Convenience method that combines check() with handling ###### Parameters | Parameter | Type | | ------ | ------ | | `toolName` | `string` | | `input` | `Record`\<`string`, `unknown`\> | ###### Returns `Promise`\<\{ `proceed`: `boolean`; `result`: [`PermissionCheckResult`](#permissioncheckresult); \}\> ##### clearSessionGrants() ```ts clearSessionGrants(): void; ``` Defined in: [permissions/manager.ts:374](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/manager.ts#L374) Clear all session-level permissions ###### Returns `void` ##### getAllRules() ```ts getAllRules(): ToolPermission[]; ``` Defined in: [permissions/manager.ts:218](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/manager.ts#L218) Get all permission rules ###### Returns [`ToolPermission`](#toolpermission)[] ##### getLevel() ```ts getLevel(toolName): PermissionLevel; ``` Defined in: [permissions/manager.ts:411](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/manager.ts#L411) Get the effective permission level for a tool ###### Parameters | Parameter | Type | | ------ | ------ | | `toolName` | `string` | ###### Returns [`PermissionLevel`](#permissionlevel) ##### getRule() ```ts getRule(toolName): ToolPermission | undefined; ``` Defined in: [permissions/manager.ts:200](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/manager.ts#L200) Get a permission rule by tool name ###### Parameters | Parameter | Type | | ------ | ------ | | `toolName` | `string` | ###### Returns [`ToolPermission`](#toolpermission) \| `undefined` ##### getSessionGrants() ```ts getSessionGrants(): string[]; ``` Defined in: [permissions/manager.ts:381](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/manager.ts#L381) Get all tools with session-level permission ###### Returns `string`[] ##### grantSession() ```ts grantSession(toolName): void; ``` Defined in: [permissions/manager.ts:360](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/manager.ts#L360) Grant session-level permission for a tool This allows the tool to execute for the remainder of the session without asking again. ###### Parameters | Parameter | Type | | ------ | ------ | | `toolName` | `string` | ###### Returns `void` ##### hasSessionGrant() ```ts hasSessionGrant(toolName): boolean; ``` Defined in: [permissions/manager.ts:388](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/manager.ts#L388) Check if a tool has session-level permission ###### Parameters | Parameter | Type | | ------ | ------ | | `toolName` | `string` | ###### Returns `boolean` ##### onEvent() ```ts onEvent(handler): () => void; ``` Defined in: [permissions/manager.ts:419](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/manager.ts#L419) Register an event handler ###### Parameters | Parameter | Type | | ------ | ------ | | `handler` | [`PermissionEventHandler`](#permissioneventhandler) | ###### Returns () => `void` ##### removeRule() ```ts removeRule(toolName): boolean; ``` Defined in: [permissions/manager.ts:185](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/manager.ts#L185) Remove a permission rule by tool name ###### Parameters | Parameter | Type | | ------ | ------ | | `toolName` | `string` | ###### Returns `boolean` ##### revokeSession() ```ts revokeSession(toolName): boolean; ``` Defined in: [permissions/manager.ts:367](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/manager.ts#L367) Revoke session-level permission for a tool ###### Parameters | Parameter | Type | | ------ | ------ | | `toolName` | `string` | ###### Returns `boolean` ##### setLevel() ```ts setLevel( toolName, level, description?): this; ``` Defined in: [permissions/manager.ts:397](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/manager.ts#L397) Set the permission level for a tool Convenience method for adding/updating a rule ###### Parameters | Parameter | Type | | ------ | ------ | | `toolName` | `string` | | `level` | [`PermissionLevel`](#permissionlevel) | | `description?` | `string` | ###### Returns `this` *** ### PerplexityProvider Defined in: [providers/perplexity.ts:53](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/perplexity.ts#L53) Perplexity LLM Provider Provides streaming chat completion using Perplexity's API. Sonar models include real-time web search capabilities. #### Extends - [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider) #### Constructors ##### Constructor ```ts new PerplexityProvider(config?): PerplexityProvider; ``` Defined in: [providers/perplexity.ts:58](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/perplexity.ts#L58) ###### Parameters | Parameter | Type | | ------ | ------ | | `config` | [`PerplexityProviderConfig`](#perplexityproviderconfig) | ###### Returns [`PerplexityProvider`](#perplexityprovider) ###### Overrides [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider).[`constructor`](#constructor-30) #### Properties ##### name ```ts readonly name: "perplexity" = 'perplexity'; ``` Defined in: [providers/perplexity.ts:54](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/perplexity.ts#L54) Provider name (e.g., 'openai', 'ollama', 'gemini') ###### Overrides [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider).[`name`](#name-10) #### Methods ##### chat() ```ts chat(messages, options?): AsyncIterable; ``` Defined in: [providers/openai-compatible.ts:222](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai-compatible.ts#L222) Stream chat completion from the provider ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `messages` | [`Message`](#message-4)[] | Conversation messages | | `options?` | [`ChatOptions`](#chatoptions-1) | Chat options (thinking is ignored for non-Claude providers) | ###### Returns `AsyncIterable`\<[`StreamChunk`](#streamchunk)\> ###### Inherited from [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider).[`chat`](#chat-7) ##### countTokens() ```ts countTokens(messages): Promise; ``` Defined in: [providers/openai-compatible.ts:631](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai-compatible.ts#L631) Count tokens in messages using tiktoken (cl100k_base encoding) ###### Parameters | Parameter | Type | | ------ | ------ | | `messages` | [`Message`](#message-4)[] | ###### Returns `Promise`\<`number`\> ###### Inherited from [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider).[`countTokens`](#counttokens-8) ##### getModel() ```ts getModel(): string; ``` Defined in: [providers/openai-compatible.ts:158](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai-compatible.ts#L158) Get the current default model ID. ###### Returns `string` ###### Inherited from [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider).[`getModel`](#getmodel-8) ##### setModel() ```ts setModel(modelId): void; ``` Defined in: [providers/openai-compatible.ts:162](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai-compatible.ts#L162) Change the default model for subsequent calls. Same provider only. Takes effect on the next chat() call, not mid-stream. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `modelId` | `string` | The new model ID (e.g., 'claude-opus-4-20250514') | ###### Returns `void` ###### Inherited from [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider).[`setModel`](#setmodel-8) *** ### ProjectMemoryLoader Defined in: [memory/loader.ts:171](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/loader.ts#L171) ProjectMemoryLoader discovers and loads project-specific instructions #### Constructors ##### Constructor ```ts new ProjectMemoryLoader(options?): ProjectMemoryLoader; ``` Defined in: [memory/loader.ts:176](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/loader.ts#L176) ###### Parameters | Parameter | Type | | ------ | ------ | | `options` | [`ProjectMemoryOptions`](#projectmemoryoptions) | ###### Returns [`ProjectMemoryLoader`](#projectmemoryloader) #### Methods ##### discover() ```ts discover(rootDir): Promise; ``` Defined in: [memory/loader.ts:331](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/loader.ts#L331) Discover memory files without loading content ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `rootDir` | `string` | Starting directory for search | ###### Returns `Promise`\<[`MemoryDiscoveryResult`](#memorydiscoveryresult)\> Discovery result with paths ##### getOptions() ```ts getOptions(): Required; ``` Defined in: [memory/loader.ts:486](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/loader.ts#L486) Get the configured options ###### Returns `Required`\<[`ProjectMemoryOptions`](#projectmemoryoptions)\> ##### getPatterns() ```ts getPatterns(): FilePattern[]; ``` Defined in: [memory/loader.ts:479](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/loader.ts#L479) Get the patterns being used ###### Returns [`FilePattern`](#filepattern)[] ##### load() ```ts load(rootDir): Promise; ``` Defined in: [memory/loader.ts:236](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/loader.ts#L236) Load project memory from a directory ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `rootDir` | `string` | Starting directory for search | ###### Returns `Promise`\<[`ProjectMemory`](#projectmemory-1)\> Loaded project memory ##### onEvent() ```ts onEvent(handler): () => void; ``` Defined in: [memory/loader.ts:458](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/loader.ts#L458) Register an event handler ###### Parameters | Parameter | Type | | ------ | ------ | | `handler` | [`ProjectMemoryEventHandler`](#projectmemoryeventhandler) | ###### Returns () => `void` *** ### ProviderError Defined in: [errors.ts:41](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L41) Error thrown when an LLM provider API call fails. #### Example ```typescript throw new ProviderError( 'Rate limit exceeded. Retry after 60s', 'claude', 429 ); ``` #### Extends - [`AgentError`](#agenterror) #### Constructors ##### Constructor ```ts new ProviderError( message, provider, statusCode?, cause?): ProviderError; ``` Defined in: [errors.ts:42](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L42) ###### Parameters | Parameter | Type | | ------ | ------ | | `message` | `string` | | `provider` | `string` | | `statusCode?` | `number` | | `cause?` | `Error` | ###### Returns [`ProviderError`](#providererror) ###### Overrides [`AgentError`](#agenterror).[`constructor`](#constructor-2) #### Properties ##### cause? ```ts readonly optional cause?: Error; ``` Defined in: [errors.ts:17](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L17) ###### Inherited from [`AgentError`](#agenterror).[`cause`](#cause-1) ##### provider ```ts readonly provider: string; ``` Defined in: [errors.ts:44](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L44) ##### statusCode? ```ts readonly optional statusCode?: number; ``` Defined in: [errors.ts:45](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L45) #### Methods ##### isAuthError() ```ts isAuthError(): boolean; ``` Defined in: [errors.ts:62](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L62) Check if this is an authentication error (HTTP 401/403) ###### Returns `boolean` ##### isConnectionError() ```ts isConnectionError(): boolean; ``` Defined in: [errors.ts:77](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L77) Check if this is a connection/network error. These errors typically have no status code but are retryable. ###### Returns `boolean` ##### isOverloadedError() ```ts isOverloadedError(): boolean; ``` Defined in: [errors.ts:97](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L97) Check if this is an Anthropic overloaded error (529) ###### Returns `boolean` ##### isRateLimitError() ```ts isRateLimitError(): boolean; ``` Defined in: [errors.ts:55](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L55) Check if this is a rate limit error (HTTP 429) ###### Returns `boolean` ##### isRetryable() ```ts isRetryable(): boolean; ``` Defined in: [errors.ts:114](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L114) Check if this error is retryable. Retryable errors include: - Rate limit (429) - Server errors (5xx) - Connection/network errors - Anthropic overloaded (529) Non-retryable errors include: - Authentication errors (401, 403) - Bad request (400) - Not found (404) ###### Returns `boolean` ##### isServerError() ```ts isServerError(): boolean; ``` Defined in: [errors.ts:69](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L69) Check if this is a server error (HTTP 5xx) ###### Returns `boolean` *** ### RateLimitedProvider Defined in: [rate-limit/provider-wrapper.ts:34](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/provider-wrapper.ts#L34) Wrapper that adds rate limiting and retry to any LLMProvider #### Example ```typescript const provider = new ClaudeProvider({ apiKey: 'xxx' }); const wrapped = new RateLimitedProvider(provider, { rateLimit: { requestsPerMinute: 60, tokensPerMinute: 100000, }, retry: { maxRetries: 3, baseDelayMs: 1000, }, }); // Use wrapped provider like normal const agent = new Agent({ provider: wrapped }); ``` #### Implements - [`LLMProvider`](#llmprovider) #### Constructors ##### Constructor ```ts new RateLimitedProvider(provider, config?): RateLimitedProvider; ``` Defined in: [rate-limit/provider-wrapper.ts:41](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/provider-wrapper.ts#L41) ###### Parameters | Parameter | Type | | ------ | ------ | | `provider` | [`LLMProvider`](#llmprovider) | | `config` | [`RateLimitRetryConfig`](#ratelimitretryconfig) | ###### Returns [`RateLimitedProvider`](#ratelimitedprovider) #### Properties ##### name ```ts readonly name: string; ``` Defined in: [rate-limit/provider-wrapper.ts:35](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/provider-wrapper.ts#L35) Provider identifier (e.g., 'claude', 'openai', 'gemini') ###### Implementation of [`LLMProvider`](#llmprovider).[`name`](#name-21) #### Methods ##### chat() ```ts chat(messages, options?): AsyncIterable; ``` Defined in: [rate-limit/provider-wrapper.ts:66](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/provider-wrapper.ts#L66) Send messages with rate limiting and retry ###### Parameters | Parameter | Type | | ------ | ------ | | `messages` | [`Message`](#message-4)[] | | `options?` | [`ChatOptions`](#chatoptions-1) | ###### Returns `AsyncIterable`\<[`StreamChunk`](#streamchunk)\> ###### Implementation of [`LLMProvider`](#llmprovider).[`chat`](#chat-13) ##### countTokens() ```ts countTokens(messages): Promise; ``` Defined in: [rate-limit/provider-wrapper.ts:128](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/provider-wrapper.ts#L128) Count tokens with rate limiting ###### Parameters | Parameter | Type | | ------ | ------ | | `messages` | [`Message`](#message-4)[] | ###### Returns `Promise`\<`number`\> ###### Implementation of [`LLMProvider`](#llmprovider).[`countTokens`](#counttokens-14) ##### getModel() ```ts getModel(): string; ``` Defined in: [rate-limit/provider-wrapper.ts:48](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/provider-wrapper.ts#L48) Get the current default model ID. ###### Returns `string` ###### Implementation of [`LLMProvider`](#llmprovider).[`getModel`](#getmodel-14) ##### getRateLimiter() ```ts getRateLimiter(): RateLimiter; ``` Defined in: [rate-limit/provider-wrapper.ts:59](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/provider-wrapper.ts#L59) Get the rate limiter instance for statistics ###### Returns [`RateLimiter`](#ratelimiter) ##### setModel() ```ts setModel(modelId): void; ``` Defined in: [rate-limit/provider-wrapper.ts:52](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/provider-wrapper.ts#L52) Change the default model for subsequent calls. Same provider only. Takes effect on the next chat() call, not mid-stream. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `modelId` | `string` | The new model ID (e.g., 'claude-opus-4-20250514') | ###### Returns `void` ###### Implementation of [`LLMProvider`](#llmprovider).[`setModel`](#setmodel-14) *** ### RateLimitExceededError Defined in: [rate-limit/types.ts:204](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/types.ts#L204) Error thrown when rate limit is exceeded and throwOnLimit is true #### Extends - `Error` #### Constructors ##### Constructor ```ts new RateLimitExceededError(message, estimatedWaitMs): RateLimitExceededError; ``` Defined in: [rate-limit/types.ts:205](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/types.ts#L205) ###### Parameters | Parameter | Type | | ------ | ------ | | `message` | `string` | | `estimatedWaitMs` | `number` | ###### Returns [`RateLimitExceededError`](#ratelimitexceedederror) ###### Overrides ```ts Error.constructor ``` #### Properties ##### estimatedWaitMs ```ts readonly estimatedWaitMs: number; ``` Defined in: [rate-limit/types.ts:207](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/types.ts#L207) *** ### RehearsalManager Defined in: [rehearsal/manager.ts:59](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/manager.ts#L59) RehearsalManager - Coordinates impact analysis for destructive operations #### Example ```typescript const manager = new RehearsalManager({ workingDirectory: '/path/to/project', }); // Analyze before executing const result = await manager.rehearse('rm -rf node_modules'); if (result.recommendation === 'abort') { console.log('Operation too dangerous:', result.warnings); } else if (result.recommendation === 'confirm') { const confirmed = await askUser(result.impact.summary); if (confirmed) { // Execute the operation } } ``` #### Constructors ##### Constructor ```ts new RehearsalManager(options?): RehearsalManager; ``` Defined in: [rehearsal/manager.ts:68](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/manager.ts#L68) ###### Parameters | Parameter | Type | | ------ | ------ | | `options` | [`RehearsalManagerOptions`](#rehearsalmanageroptions) | ###### Returns [`RehearsalManager`](#rehearsalmanager) #### Methods ##### findAnalyzer() ```ts findAnalyzer(operation): RehearsalAnalyzer | undefined; ``` Defined in: [rehearsal/manager.ts:168](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/manager.ts#L168) Find the appropriate analyzer for an operation ###### Parameters | Parameter | Type | | ------ | ------ | | `operation` | `string` | ###### Returns [`RehearsalAnalyzer`](#rehearsalanalyzer) \| `undefined` ##### formatResult() ```ts formatResult(result): string; ``` Defined in: [rehearsal/manager.ts:270](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/manager.ts#L270) Get a formatted summary of a rehearsal result ###### Parameters | Parameter | Type | | ------ | ------ | | `result` | [`RehearsalResult`](#rehearsalresult) | ###### Returns `string` ##### getAnalyzers() ```ts getAnalyzers(): RehearsalAnalyzer[]; ``` Defined in: [rehearsal/manager.ts:116](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/manager.ts#L116) Get all registered analyzers ###### Returns [`RehearsalAnalyzer`](#rehearsalanalyzer)[] ##### getSessionModifiedFiles() ```ts getSessionModifiedFiles(): string[]; ``` Defined in: [rehearsal/manager.ts:149](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/manager.ts#L149) Get files modified in this session ###### Returns `string`[] ##### isDestructive() ```ts isDestructive(operation): boolean; ``` Defined in: [rehearsal/manager.ts:156](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/manager.ts#L156) Check if an operation is potentially destructive ###### Parameters | Parameter | Type | | ------ | ------ | | `operation` | `string` | ###### Returns `boolean` ##### onEvent() ```ts onEvent(handler): this; ``` Defined in: [rehearsal/manager.ts:123](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/manager.ts#L123) Set event handler ###### Parameters | Parameter | Type | | ------ | ------ | | `handler` | [`RehearsalEventHandler`](#rehearsaleventhandler) | ###### Returns `this` ##### registerAnalyzer() ```ts registerAnalyzer(analyzer): this; ``` Defined in: [rehearsal/manager.ts:101](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/manager.ts#L101) Register an analyzer ###### Parameters | Parameter | Type | | ------ | ------ | | `analyzer` | [`RehearsalAnalyzer`](#rehearsalanalyzer) | ###### Returns `this` ##### rehearse() ```ts rehearse(operation): Promise; ``` Defined in: [rehearsal/manager.ts:183](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/manager.ts#L183) Rehearse an operation - analyze its impact before execution ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `operation` | `string` | The command or operation to analyze | ###### Returns `Promise`\<[`RehearsalResult`](#rehearsalresult)\> Impact analysis result ##### rehearseAll() ```ts rehearseAll(operations): Promise; ``` Defined in: [rehearsal/manager.ts:246](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/manager.ts#L246) Rehearse multiple operations ###### Parameters | Parameter | Type | | ------ | ------ | | `operations` | `string`[] | ###### Returns `Promise`\<[`RehearsalResult`](#rehearsalresult)[]\> ##### shouldProceed() ```ts shouldProceed(operation): Promise; ``` Defined in: [rehearsal/manager.ts:262](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/manager.ts#L262) Check if an operation should proceed based on rehearsal ###### Parameters | Parameter | Type | | ------ | ------ | | `operation` | `string` | ###### Returns `Promise`\<`boolean`\> true if safe to proceed, false if should abort ##### trackFileModification() ```ts trackFileModification(filePath): void; ``` Defined in: [rehearsal/manager.ts:140](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/manager.ts#L140) Track a file as modified in this session ###### Parameters | Parameter | Type | | ------ | ------ | | `filePath` | `string` | ###### Returns `void` ##### unregisterAnalyzer() ```ts unregisterAnalyzer(id): boolean; ``` Defined in: [rehearsal/manager.ts:109](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/manager.ts#L109) Unregister an analyzer ###### Parameters | Parameter | Type | | ------ | ------ | | `id` | `string` | ###### Returns `boolean` *** ### RetryStats Defined in: [rate-limit/retry.ts:271](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/retry.ts#L271) Retry statistics collector #### Constructors ##### Constructor ```ts new RetryStats(): RetryStats; ``` ###### Returns [`RetryStats`](#retrystats) #### Methods ##### createConfig() ```ts createConfig(baseConfig?): RetryConfig; ``` Defined in: [rate-limit/retry.ts:282](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/retry.ts#L282) Create retry config that tracks statistics ###### Parameters | Parameter | Type | | ------ | ------ | | `baseConfig` | [`RetryConfig`](#retryconfig) | ###### Returns [`RetryConfig`](#retryconfig) ##### getStats() ```ts getStats(): { attempts: number; averageRetries: number; failures: number; lastError?: string; retries: number; successes: number; successRate: number; totalDelayMs: number; }; ``` Defined in: [rate-limit/retry.ts:313](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/retry.ts#L313) Get statistics ###### Returns ```ts { attempts: number; averageRetries: number; failures: number; lastError?: string; retries: number; successes: number; successRate: number; totalDelayMs: number; } ``` | Name | Type | Defined in | | ------ | ------ | ------ | | `attempts` | `number` | [rate-limit/retry.ts:314](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/retry.ts#L314) | | `averageRetries` | `number` | [rate-limit/retry.ts:320](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/retry.ts#L320) | | `failures` | `number` | [rate-limit/retry.ts:316](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/retry.ts#L316) | | `lastError?` | `string` | [rate-limit/retry.ts:321](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/retry.ts#L321) | | `retries` | `number` | [rate-limit/retry.ts:317](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/retry.ts#L317) | | `successes` | `number` | [rate-limit/retry.ts:315](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/retry.ts#L315) | | `successRate` | `number` | [rate-limit/retry.ts:319](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/retry.ts#L319) | | `totalDelayMs` | `number` | [rate-limit/retry.ts:318](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/retry.ts#L318) | ##### recordAttempt() ```ts recordAttempt(success): void; ``` Defined in: [rate-limit/retry.ts:301](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/retry.ts#L301) Record an attempt outcome ###### Parameters | Parameter | Type | | ------ | ------ | | `success` | `boolean` | ###### Returns `void` ##### reset() ```ts reset(): void; ``` Defined in: [rate-limit/retry.ts:338](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/retry.ts#L338) Reset statistics ###### Returns `void` *** ### ShellManager Defined in: [tools/builtin/shell-manager.ts:138](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/shell-manager.ts#L138) Manages background shell processes #### Constructors ##### Constructor ```ts new ShellManager(options?): ShellManager; ``` Defined in: [tools/builtin/shell-manager.ts:146](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/shell-manager.ts#L146) ###### Parameters | Parameter | Type | | ------ | ------ | | `options?` | `ShellManagerOptions` | ###### Returns [`ShellManager`](#shellmanager) #### Methods ##### adoptProcess() ```ts adoptProcess(process, options): string; ``` Defined in: [tools/builtin/shell-manager.ts:455](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/shell-manager.ts#L455) Adopt an existing running process into the shell manager. Used when moving a foreground bash command to background (Ctrl+B). ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `process` | `ChildProcess` | The ChildProcess to adopt | | `options` | \{ `command`: `string`; `cwd?`: `string`; `initialStderr?`: `string`; `initialStdout?`: `string`; \} | Options including command and initial buffers | | `options.command` | `string` | - | | `options.cwd?` | `string` | - | | `options.initialStderr?` | `string` | - | | `options.initialStdout?` | `string` | - | ###### Returns `string` The shell ID for tracking ##### clearCompleted() ```ts clearCompleted(): number; ``` Defined in: [tools/builtin/shell-manager.ts:422](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/shell-manager.ts#L422) Clear all completed/failed/killed shells ###### Returns `number` ##### dispose() ```ts dispose(): void; ``` Defined in: [tools/builtin/shell-manager.ts:516](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/shell-manager.ts#L516) Cleanup - kill all shells and clear state ###### Returns `void` ##### get() ```ts get(id): BackgroundShell | null; ``` Defined in: [tools/builtin/shell-manager.ts:395](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/shell-manager.ts#L395) Get shell info ###### Parameters | Parameter | Type | | ------ | ------ | | `id` | `string` | ###### Returns `BackgroundShell` \| `null` ##### getAllOutput() ```ts getAllOutput(id): ShellOutput | null; ``` Defined in: [tools/builtin/shell-manager.ts:273](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/shell-manager.ts#L273) Get all output from a shell (including previously read) ###### Parameters | Parameter | Type | | ------ | ------ | | `id` | `string` | ###### Returns `ShellOutput` \| `null` ##### getOutput() ```ts getOutput(id, filter?): ShellOutput | null; ``` Defined in: [tools/builtin/shell-manager.ts:231](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/shell-manager.ts#L231) Get output from a shell (only new output since last read) ###### Parameters | Parameter | Type | | ------ | ------ | | `id` | `string` | | `filter?` | `RegExp` | ###### Returns `ShellOutput` \| `null` ##### kill() ```ts kill(id): boolean; ``` Defined in: [tools/builtin/shell-manager.ts:292](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/shell-manager.ts#L292) Kill a background shell ###### Parameters | Parameter | Type | | ------ | ------ | | `id` | `string` | ###### Returns `boolean` ##### killAll() ```ts killAll(): number; ``` Defined in: [tools/builtin/shell-manager.ts:436](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/shell-manager.ts#L436) Kill all running shells ###### Returns `number` ##### list() ```ts list(): BackgroundShell[]; ``` Defined in: [tools/builtin/shell-manager.ts:381](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/shell-manager.ts#L381) List all shells ###### Returns `BackgroundShell`[] ##### listRunning() ```ts listRunning(): BackgroundShell[]; ``` Defined in: [tools/builtin/shell-manager.ts:388](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/shell-manager.ts#L388) List running shells only ###### Returns `BackgroundShell`[] ##### remove() ```ts remove(id): boolean; ``` Defined in: [tools/builtin/shell-manager.ts:403](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/shell-manager.ts#L403) Remove a shell from tracking (only if not running) ###### Parameters | Parameter | Type | | ------ | ------ | | `id` | `string` | ###### Returns `boolean` ##### spawn() ```ts spawn(command, options?): string; ``` Defined in: [tools/builtin/shell-manager.ts:156](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/shell-manager.ts#L156) Spawn a new background shell ###### Parameters | Parameter | Type | | ------ | ------ | | `command` | `string` | | `options?` | \{ `cwd?`: `string`; `env?`: `Record`\<`string`, `string`\>; \} | | `options.cwd?` | `string` | | `options.env?` | `Record`\<`string`, `string`\> | ###### Returns `string` ##### verifyAllStatus() ```ts verifyAllStatus(): number; ``` Defined in: [tools/builtin/shell-manager.ts:365](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/shell-manager.ts#L365) Verify all shells and sync their status. Returns number of shells whose status was corrected. ###### Returns `number` ##### verifyStatus() ```ts verifyStatus(id): ShellStatus | null; ``` Defined in: [tools/builtin/shell-manager.ts:338](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/shell-manager.ts#L338) Verify and sync shell status with actual process state. Call this to ensure status reflects reality after potential race conditions. ###### Parameters | Parameter | Type | | ------ | ------ | | `id` | `string` | ###### Returns `ShellStatus` \| `null` *** ### SkillRegistry Defined in: [skills/index.ts:88](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/skills/index.ts#L88) Skill Registry - Manages skill registration and invocation #### Constructors ##### Constructor ```ts new SkillRegistry(): SkillRegistry; ``` ###### Returns [`SkillRegistry`](#skillregistry) #### Accessors ##### size ###### Get Signature ```ts get size(): number; ``` Defined in: [skills/index.ts:240](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/skills/index.ts#L240) Get skill count ###### Returns `number` #### Methods ##### clear() ```ts clear(): void; ``` Defined in: [skills/index.ts:168](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/skills/index.ts#L168) Clear all skills ###### Returns `void` ##### disable() ```ts disable(name): boolean; ``` Defined in: [skills/index.ts:185](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/skills/index.ts#L185) Disable a skill ###### Parameters | Parameter | Type | | ------ | ------ | | `name` | `string` | ###### Returns `boolean` ##### enable() ```ts enable(name): boolean; ``` Defined in: [skills/index.ts:175](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/skills/index.ts#L175) Enable a skill ###### Parameters | Parameter | Type | | ------ | ------ | | `name` | `string` | ###### Returns `boolean` ##### get() ```ts get(name): Skill | undefined; ``` Defined in: [skills/index.ts:119](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/skills/index.ts#L119) Get a skill by name ###### Parameters | Parameter | Type | | ------ | ------ | | `name` | `string` | ###### Returns [`Skill`](#skill) \| `undefined` ##### getAll() ```ts getAll(): Skill[]; ``` Defined in: [skills/index.ts:133](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/skills/index.ts#L133) Get all registered skills ###### Returns [`Skill`](#skill)[] ##### getByTag() ```ts getByTag(tag): Skill[]; ``` Defined in: [skills/index.ts:147](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/skills/index.ts#L147) Get skills by tag ###### Parameters | Parameter | Type | | ------ | ------ | | `tag` | `string` | ###### Returns [`Skill`](#skill)[] ##### getEnabled() ```ts getEnabled(): Skill[]; ``` Defined in: [skills/index.ts:140](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/skills/index.ts#L140) Get all enabled skills ###### Returns [`Skill`](#skill)[] ##### getNames() ```ts getNames(): string[]; ``` Defined in: [skills/index.ts:154](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/skills/index.ts#L154) Get skill names ###### Returns `string`[] ##### has() ```ts has(name): boolean; ``` Defined in: [skills/index.ts:126](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/skills/index.ts#L126) Check if a skill exists ###### Parameters | Parameter | Type | | ------ | ------ | | `name` | `string` | ###### Returns `boolean` ##### invoke() ```ts invoke(name, options?): SkillInvocationResult; ``` Defined in: [skills/index.ts:195](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/skills/index.ts#L195) Invoke a skill by name ###### Parameters | Parameter | Type | | ------ | ------ | | `name` | `string` | | `options?` | [`SkillInvokeOptions`](#skillinvokeoptions) | ###### Returns [`SkillInvocationResult`](#skillinvocationresult) ##### register() ```ts register(skill): void; ``` Defined in: [skills/index.ts:94](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/skills/index.ts#L94) Register a new skill ###### Parameters | Parameter | Type | | ------ | ------ | | `skill` | [`Skill`](#skill) | ###### Returns `void` ##### registerAll() ```ts registerAll(skills): void; ``` Defined in: [skills/index.ts:110](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/skills/index.ts#L110) Register multiple skills at once ###### Parameters | Parameter | Type | | ------ | ------ | | `skills` | [`Skill`](#skill)[] | ###### Returns `void` ##### remove() ```ts remove(name): boolean; ``` Defined in: [skills/index.ts:161](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/skills/index.ts#L161) Remove a skill ###### Parameters | Parameter | Type | | ------ | ------ | | `name` | `string` | ###### Returns `boolean` *** ### StateError Defined in: [state/errors.ts:36](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/errors.ts#L36) Base error class for state management operations. #### Extends - `Error` #### Constructors ##### Constructor ```ts new StateError( message, code, cause?): StateError; ``` Defined in: [state/errors.ts:47](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/errors.ts#L47) ###### Parameters | Parameter | Type | | ------ | ------ | | `message` | `string` | | `code` | [`StateErrorCode`](#stateerrorcode) | | `cause?` | `Error` | ###### Returns [`StateError`](#stateerror) ###### Overrides ```ts Error.constructor ``` #### Properties ##### cause? ```ts readonly optional cause?: Error; ``` Defined in: [state/errors.ts:45](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/errors.ts#L45) Original error that caused this error (if any) ###### Overrides ```ts Error.cause ``` ##### code ```ts readonly code: StateErrorCode; ``` Defined in: [state/errors.ts:40](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/errors.ts#L40) Error code for programmatic handling #### Methods ##### deserialization() ```ts static deserialization(message, cause?): StateError; ``` Defined in: [state/errors.ts:71](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/errors.ts#L71) Create a deserialization error ###### Parameters | Parameter | Type | | ------ | ------ | | `message` | `string` | | `cause?` | `Error` | ###### Returns [`StateError`](#stateerror) ##### invalidSessionId() ```ts static invalidSessionId(sessionId): StateError; ``` Defined in: [state/errors.ts:113](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/errors.ts#L113) Create an invalid session ID error ###### Parameters | Parameter | Type | | ------ | ------ | | `sessionId` | `string` | ###### Returns [`StateError`](#stateerror) ##### invalidState() ```ts static invalidState(message): StateError; ``` Defined in: [state/errors.ts:106](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/errors.ts#L106) Create an invalid state error ###### Parameters | Parameter | Type | | ------ | ------ | | `message` | `string` | ###### Returns [`StateError`](#stateerror) ##### serialization() ```ts static serialization(message, cause?): StateError; ``` Defined in: [state/errors.ts:60](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/errors.ts#L60) Create a serialization error ###### Parameters | Parameter | Type | | ------ | ------ | | `message` | `string` | | `cause?` | `Error` | ###### Returns [`StateError`](#stateerror) ##### sessionNotFound() ```ts static sessionNotFound(sessionId): StateError; ``` Defined in: [state/errors.ts:82](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/errors.ts#L82) Create a session not found error ###### Parameters | Parameter | Type | | ------ | ------ | | `sessionId` | `string` | ###### Returns [`StateError`](#stateerror) ##### storage() ```ts static storage(message, cause?): StateError; ``` Defined in: [state/errors.ts:89](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/errors.ts#L89) Create a storage error ###### Parameters | Parameter | Type | | ------ | ------ | | `message` | `string` | | `cause?` | `Error` | ###### Returns [`StateError`](#stateerror) ##### versionMismatch() ```ts static versionMismatch(expected, actual): StateError; ``` Defined in: [state/errors.ts:96](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/errors.ts#L96) Create a version mismatch error ###### Parameters | Parameter | Type | | ------ | ------ | | `expected` | `number` | | `actual` | `number` | ###### Returns [`StateError`](#stateerror) *** ### TodoStore Defined in: [tools/builtin/todo.ts:111](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/todo.ts#L111) TodoStore manages the in-memory task list #### Constructors ##### Constructor ```ts new TodoStore(): TodoStore; ``` ###### Returns [`TodoStore`](#todostore) #### Methods ##### add() ```ts add(todo): TodoItem; ``` Defined in: [tools/builtin/todo.ts:190](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/todo.ts#L190) Add a single todo ###### Parameters | Parameter | Type | | ------ | ------ | | `todo` | \{ `activeForm?`: `string`; `blockedBy?`: `number`[]; `content`: `string`; `owner?`: `string`; `priority?`: `number`; `status`: [`TodoStatus`](#todostatus); \} | | `todo.activeForm?` | `string` | | `todo.blockedBy?` | `number`[] | | `todo.content` | `string` | | `todo.owner?` | `string` | | `todo.priority?` | `number` | | `todo.status` | [`TodoStatus`](#todostatus) | ###### Returns [`TodoItem`](#todoitem) ##### clear() ```ts clear(): void; ``` Defined in: [tools/builtin/todo.ts:241](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/todo.ts#L241) Clear all todos ###### Returns `void` ##### getAll() ```ts getAll(): TodoItem[]; ``` Defined in: [tools/builtin/todo.ts:118](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/todo.ts#L118) Get all todos ###### Returns [`TodoItem`](#todoitem)[] ##### getByOwner() ```ts getByOwner(owner): TodoItem[]; ``` Defined in: [tools/builtin/todo.ts:149](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/todo.ts#L149) Get todos filtered by owner ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `owner` | `string` | Agent ID, or 'unassigned' for tasks without owner | ###### Returns [`TodoItem`](#todoitem)[] ##### getByStatus() ```ts getByStatus(status): TodoItem[]; ``` Defined in: [tools/builtin/todo.ts:141](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/todo.ts#L141) Get todos filtered by status ###### Parameters | Parameter | Type | | ------ | ------ | | `status` | [`TodoStatus`](#todostatus) | ###### Returns [`TodoItem`](#todoitem)[] ##### getCounts() ```ts getCounts(): Record; ``` Defined in: [tools/builtin/todo.ts:248](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/todo.ts#L248) Get count by status ###### Returns `Record`\<[`TodoStatus`](#todostatus), `number`\> ##### getCountsByOwner() ```ts getCountsByOwner(): Record; ``` Defined in: [tools/builtin/todo.ts:265](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/todo.ts#L265) Get counts by owner Returns a map of owner ID to count 'unassigned' key contains count of todos without owner ###### Returns `Record`\<`string`, `number`\> ##### remove() ```ts remove(id): boolean; ``` Defined in: [tools/builtin/todo.ts:234](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/todo.ts#L234) Remove a todo by ID ###### Parameters | Parameter | Type | | ------ | ------ | | `id` | `string` | ###### Returns `boolean` ##### setAll() ```ts setAll(todos): void; ``` Defined in: [tools/builtin/todo.ts:159](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/todo.ts#L159) Replace all todos with a new list ###### Parameters | Parameter | Type | | ------ | ------ | | `todos` | \{ `activeForm?`: `string`; `blockedBy?`: `number`[]; `content`: `string`; `owner?`: `string`; `priority?`: `number`; `status`: [`TodoStatus`](#todostatus); \}[] | ###### Returns `void` ##### update() ```ts update(id, updates): TodoItem | null; ``` Defined in: [tools/builtin/todo.ts:218](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/todo.ts#L218) Update a todo by ID ###### Parameters | Parameter | Type | | ------ | ------ | | `id` | `string` | | `updates` | `Partial`\<`Omit`\<[`TodoItem`](#todoitem), `"id"` \| `"createdAt"`\>\> | ###### Returns [`TodoItem`](#todoitem) \| `null` *** ### TogetherProvider Defined in: [providers/together.ts:53](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/together.ts#L53) Together AI LLM Provider Provides streaming chat completion using Together AI models. Supports Llama, Mistral, Qwen, and other open-source models. #### Extends - [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider) #### Constructors ##### Constructor ```ts new TogetherProvider(config?): TogetherProvider; ``` Defined in: [providers/together.ts:58](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/together.ts#L58) ###### Parameters | Parameter | Type | | ------ | ------ | | `config` | [`TogetherProviderConfig`](#togetherproviderconfig) | ###### Returns [`TogetherProvider`](#togetherprovider) ###### Overrides [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider).[`constructor`](#constructor-30) #### Properties ##### name ```ts readonly name: "together" = 'together'; ``` Defined in: [providers/together.ts:54](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/together.ts#L54) Provider name (e.g., 'openai', 'ollama', 'gemini') ###### Overrides [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider).[`name`](#name-10) #### Methods ##### chat() ```ts chat(messages, options?): AsyncIterable; ``` Defined in: [providers/openai-compatible.ts:222](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai-compatible.ts#L222) Stream chat completion from the provider ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `messages` | [`Message`](#message-4)[] | Conversation messages | | `options?` | [`ChatOptions`](#chatoptions-1) | Chat options (thinking is ignored for non-Claude providers) | ###### Returns `AsyncIterable`\<[`StreamChunk`](#streamchunk)\> ###### Inherited from [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider).[`chat`](#chat-7) ##### countTokens() ```ts countTokens(messages): Promise; ``` Defined in: [providers/openai-compatible.ts:631](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai-compatible.ts#L631) Count tokens in messages using tiktoken (cl100k_base encoding) ###### Parameters | Parameter | Type | | ------ | ------ | | `messages` | [`Message`](#message-4)[] | ###### Returns `Promise`\<`number`\> ###### Inherited from [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider).[`countTokens`](#counttokens-8) ##### getModel() ```ts getModel(): string; ``` Defined in: [providers/openai-compatible.ts:158](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai-compatible.ts#L158) Get the current default model ID. ###### Returns `string` ###### Inherited from [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider).[`getModel`](#getmodel-8) ##### setModel() ```ts setModel(modelId): void; ``` Defined in: [providers/openai-compatible.ts:162](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai-compatible.ts#L162) Change the default model for subsequent calls. Same provider only. Takes effect on the next chat() call, not mid-stream. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `modelId` | `string` | The new model ID (e.g., 'claude-opus-4-20250514') | ###### Returns `void` ###### Inherited from [`OpenAICompatibleProvider`](#abstract-openaicompatibleprovider).[`setModel`](#setmodel-8) *** ### TokenBucketRateLimiter Defined in: [rate-limit/limiter.ts:48](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/limiter.ts#L48) Token bucket rate limiter implementation Uses the token bucket algorithm: - Tokens are added at a constant rate (refill rate) - Each request consumes tokens - If insufficient tokens, request waits or fails #### Example ```typescript const limiter = new TokenBucketRateLimiter({ requestsPerMinute: 60, tokensPerMinute: 100000, maxConcurrent: 5, }); // Before making a request await limiter.acquire(1000); // estimated tokens try { const result = await makeRequest(); limiter.reportUsage(actualTokens); } finally { limiter.release(); } ``` #### Implements - [`RateLimiter`](#ratelimiter) #### Constructors ##### Constructor ```ts new TokenBucketRateLimiter(config?): TokenBucketRateLimiter; ``` Defined in: [rate-limit/limiter.ts:75](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/limiter.ts#L75) ###### Parameters | Parameter | Type | | ------ | ------ | | `config` | [`RateLimiterConfig`](#ratelimiterconfig) | ###### Returns [`TokenBucketRateLimiter`](#tokenbucketratelimiter) #### Methods ##### acquire() ```ts acquire(estimatedTokens?): Promise; ``` Defined in: [rate-limit/limiter.ts:93](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/limiter.ts#L93) Acquire permission to make a request ###### Parameters | Parameter | Type | Default value | | ------ | ------ | ------ | | `estimatedTokens` | `number` | `0` | ###### Returns `Promise`\<[`AcquireResult`](#acquireresult)\> ###### Implementation of [`RateLimiter`](#ratelimiter).[`acquire`](#acquire-1) ##### canAcquire() ```ts canAcquire(estimatedTokens?): boolean; ``` Defined in: [rate-limit/limiter.ts:190](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/limiter.ts#L190) Check if a request can be made immediately ###### Parameters | Parameter | Type | Default value | | ------ | ------ | ------ | | `estimatedTokens` | `number` | `0` | ###### Returns `boolean` ###### Implementation of [`RateLimiter`](#ratelimiter).[`canAcquire`](#canacquire-1) ##### getStats() ```ts getStats(): RateLimiterStats; ``` Defined in: [rate-limit/limiter.ts:149](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/limiter.ts#L149) Get current statistics ###### Returns [`RateLimiterStats`](#ratelimiterstats) ###### Implementation of [`RateLimiter`](#ratelimiter).[`getStats`](#getstats-9) ##### release() ```ts release(): void; ``` Defined in: [rate-limit/limiter.ts:123](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/limiter.ts#L123) Release a concurrent request slot ###### Returns `void` ###### Implementation of [`RateLimiter`](#ratelimiter).[`release`](#release-1) ##### reportUsage() ```ts reportUsage(tokens): void; ``` Defined in: [rate-limit/limiter.ts:135](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/limiter.ts#L135) Report actual token usage ###### Parameters | Parameter | Type | | ------ | ------ | | `tokens` | `number` | ###### Returns `void` ###### Implementation of [`RateLimiter`](#ratelimiter).[`reportUsage`](#reportusage-1) ##### reset() ```ts reset(): void; ``` Defined in: [rate-limit/limiter.ts:165](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/limiter.ts#L165) Reset the rate limiter ###### Returns `void` ###### Implementation of [`RateLimiter`](#ratelimiter).[`reset`](#reset-7) *** ### ToolError Defined in: [errors.ts:141](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L141) Error thrown when a tool execution fails. #### Example ```typescript throw new ToolError( 'File not found: /path/to/file.txt', 'read_file', originalError ); ``` #### Extends - [`AgentError`](#agenterror) #### Extended by - [`ToolTimeoutError`](#tooltimeouterror) #### Constructors ##### Constructor ```ts new ToolError( message, toolName, cause?): ToolError; ``` Defined in: [errors.ts:142](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L142) ###### Parameters | Parameter | Type | | ------ | ------ | | `message` | `string` | | `toolName` | `string` | | `cause?` | `Error` | ###### Returns [`ToolError`](#toolerror) ###### Overrides [`AgentError`](#agenterror).[`constructor`](#constructor-2) #### Properties ##### cause? ```ts readonly optional cause?: Error; ``` Defined in: [errors.ts:17](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L17) ###### Inherited from [`AgentError`](#agenterror).[`cause`](#cause-1) ##### toolName ```ts readonly toolName: string; ``` Defined in: [errors.ts:144](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L144) *** ### ToolLoopError Defined in: [errors.ts:218](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L218) Error thrown when the agent is stuck in a tool call loop. This occurs when the same tool is called with identical input multiple times consecutively, indicating the agent is not processing the tool results properly. #### Example ```typescript throw new ToolLoopError('read_file', 3); ``` #### Extends - [`AgentError`](#agenterror) #### Constructors ##### Constructor ```ts new ToolLoopError( toolName, consecutiveCalls, input?): ToolLoopError; ``` Defined in: [errors.ts:219](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L219) ###### Parameters | Parameter | Type | | ------ | ------ | | `toolName` | `string` | | `consecutiveCalls` | `number` | | `input?` | `Record`\<`string`, `unknown`\> | ###### Returns [`ToolLoopError`](#toollooperror) ###### Overrides [`AgentError`](#agenterror).[`constructor`](#constructor-2) #### Properties ##### cause? ```ts readonly optional cause?: Error; ``` Defined in: [errors.ts:17](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L17) ###### Inherited from [`AgentError`](#agenterror).[`cause`](#cause-1) ##### consecutiveCalls ```ts readonly consecutiveCalls: number; ``` Defined in: [errors.ts:221](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L221) ##### input? ```ts readonly optional input?: Record; ``` Defined in: [errors.ts:222](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L222) ##### toolName ```ts readonly toolName: string; ``` Defined in: [errors.ts:220](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L220) *** ### ToolResultDelegator Defined in: [context/tool-result-delegator.ts:46](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/tool-result-delegator.ts#L46) Core class that creates an AfterToolHook for auto-delegating large tool results. #### Constructors ##### Constructor ```ts new ToolResultDelegator(options): ToolResultDelegator; ``` Defined in: [context/tool-result-delegator.ts:52](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/tool-result-delegator.ts#L52) ###### Parameters | Parameter | Type | | ------ | ------ | | `options` | [`ToolResultDelegatorOptions`](#toolresultdelegatoroptions) | ###### Returns [`ToolResultDelegator`](#toolresultdelegator) #### Methods ##### createHook() ```ts createHook(): AfterToolHook; ``` Defined in: [context/tool-result-delegator.ts:65](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/tool-result-delegator.ts#L65) Returns an AfterToolHook to register with HooksManager. ###### Returns [`AfterToolHook`](#aftertoolhook) ##### getStore() ```ts getStore(): DelegatedResultStore; ``` Defined in: [context/tool-result-delegator.ts:208](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/tool-result-delegator.ts#L208) Access the store (needed by recall_full_result tool). ###### Returns [`DelegatedResultStore`](#delegatedresultstore) *** ### ToolTimeoutError Defined in: [errors.ts:160](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L160) Error thrown when a tool execution times out. #### Example ```typescript throw new ToolTimeoutError('read_file', 30000); ``` #### Extends - [`ToolError`](#toolerror) #### Constructors ##### Constructor ```ts new ToolTimeoutError(toolName, timeoutMs): ToolTimeoutError; ``` Defined in: [errors.ts:161](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L161) ###### Parameters | Parameter | Type | | ------ | ------ | | `toolName` | `string` | | `timeoutMs` | `number` | ###### Returns [`ToolTimeoutError`](#tooltimeouterror) ###### Overrides [`ToolError`](#toolerror).[`constructor`](#constructor-48) #### Properties ##### cause? ```ts readonly optional cause?: Error; ``` Defined in: [errors.ts:17](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L17) ###### Inherited from [`ToolError`](#toolerror).[`cause`](#cause-7) ##### timeoutMs ```ts readonly timeoutMs: number; ``` Defined in: [errors.ts:163](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L163) ##### toolName ```ts readonly toolName: string; ``` Defined in: [errors.ts:162](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L162) ###### Inherited from [`ToolError`](#toolerror).[`toolName`](#toolname) *** ### TracingManager Defined in: [tracing/manager.ts:55](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/manager.ts#L55) Manages distributed tracing for agent operations #### Example ```typescript const tracing = new TracingManager({ serviceName: 'my-agent', defaultAttributes: { environment: 'production' }, }); // Start a trace const traceId = tracing.startTrace(); // Create spans const span = tracing.startSpan({ name: 'process-request' }); span.attributes['request.id'] = '123'; // End span and trace tracing.endSpan(span.spanId, { status: 'ok' }); const trace = tracing.endTrace(traceId); ``` #### Implements - [`TracingManagerInterface`](#tracingmanagerinterface) #### Constructors ##### Constructor ```ts new TracingManager(options?): TracingManager; ``` Defined in: [tracing/manager.ts:77](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/manager.ts#L77) ###### Parameters | Parameter | Type | | ------ | ------ | | `options` | [`TracingManagerOptions`](#tracingmanageroptions) | ###### Returns [`TracingManager`](#tracingmanager) #### Methods ##### addSpanEvent() ```ts addSpanEvent( spanId, name, attributes?): void; ``` Defined in: [tracing/manager.ts:358](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/manager.ts#L358) Add an event to a span ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `spanId` | `string` | Span ID | | `name` | `string` | Event name | | `attributes?` | [`SpanAttributes`](#spanattributes-1) | Event attributes | ###### Returns `void` ###### Implementation of [`TracingManagerInterface`](#tracingmanagerinterface).[`addSpanEvent`](#addspanevent-1) ##### clear() ```ts clear(): void; ``` Defined in: [tracing/manager.ts:539](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/manager.ts#L539) Clear all traces and spans ###### Returns `void` ##### clearTrace() ```ts clearTrace(traceId): boolean; ``` Defined in: [tracing/manager.ts:178](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/manager.ts#L178) Clear a trace from memory ###### Parameters | Parameter | Type | | ------ | ------ | | `traceId` | `string` | ###### Returns `boolean` ##### endSpan() ```ts endSpan(spanId, options?): Span | undefined; ``` Defined in: [tracing/manager.ts:283](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/manager.ts#L283) End a span ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `spanId` | `string` | Span ID to end | | `options?` | [`EndSpanOptions`](#endspanoptions) | End options | ###### Returns [`Span`](#span) \| `undefined` Ended span or undefined if not found ###### Implementation of [`TracingManagerInterface`](#tracingmanagerinterface).[`endSpan`](#endspan-1) ##### endTrace() ```ts endTrace(traceId): Trace | undefined; ``` Defined in: [tracing/manager.ts:131](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/manager.ts#L131) End a trace and optionally export it ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `traceId` | `string` | Trace ID to end | ###### Returns [`Trace`](#trace) \| `undefined` Completed trace or undefined if not found ###### Implementation of [`TracingManagerInterface`](#tracingmanagerinterface).[`endTrace`](#endtrace-1) ##### export() ```ts export(traceId): Promise; ``` Defined in: [tracing/manager.ts:490](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/manager.ts#L490) Manually export a trace ###### Parameters | Parameter | Type | | ------ | ------ | | `traceId` | `string` | ###### Returns `Promise`\<`void`\> ##### getActiveTraces() ```ts getActiveTraces(): Trace[]; ``` Defined in: [tracing/manager.ts:171](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/manager.ts#L171) Get all active traces ###### Returns [`Trace`](#trace)[] ##### getCurrentContext() ```ts getCurrentContext(): SpanContext | undefined; ``` Defined in: [tracing/manager.ts:337](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/manager.ts#L337) Get current span context for propagation ###### Returns [`SpanContext`](#spancontext) \| `undefined` ##### getCurrentSpan() ```ts getCurrentSpan(): Span | undefined; ``` Defined in: [tracing/manager.ts:328](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/manager.ts#L328) Get the current active span ###### Returns [`Span`](#span) \| `undefined` ###### Implementation of [`TracingManagerInterface`](#tracingmanagerinterface).[`getCurrentSpan`](#getcurrentspan-1) ##### getSpan() ```ts getSpan(spanId): Span | undefined; ``` Defined in: [tracing/manager.ts:321](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/manager.ts#L321) Get a span by ID ###### Parameters | Parameter | Type | | ------ | ------ | | `spanId` | `string` | ###### Returns [`Span`](#span) \| `undefined` ##### getStats() ```ts getStats(): { activeSpans: number; activeTraces: number; totalSpans: number; }; ``` Defined in: [tracing/manager.ts:524](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/manager.ts#L524) Get tracing statistics ###### Returns ```ts { activeSpans: number; activeTraces: number; totalSpans: number; } ``` | Name | Type | Defined in | | ------ | ------ | ------ | | `activeSpans` | `number` | [tracing/manager.ts:527](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/manager.ts#L527) | | `activeTraces` | `number` | [tracing/manager.ts:525](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/manager.ts#L525) | | `totalSpans` | `number` | [tracing/manager.ts:526](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/manager.ts#L526) | ##### getTrace() ```ts getTrace(traceId): Trace | undefined; ``` Defined in: [tracing/manager.ts:164](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/manager.ts#L164) Get a trace by ID ###### Parameters | Parameter | Type | | ------ | ------ | | `traceId` | `string` | ###### Returns [`Trace`](#trace) \| `undefined` ###### Implementation of [`TracingManagerInterface`](#tracingmanagerinterface).[`getTrace`](#gettrace-1) ##### onEvent() ```ts onEvent(handler): () => void; ``` Defined in: [tracing/manager.ts:445](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/manager.ts#L445) Subscribe to tracing events ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `handler` | [`TracingEventHandler`](#tracingeventhandler) | Event handler | ###### Returns Unsubscribe function () => `void` ##### recordError() ```ts recordError(spanId, error): void; ``` Defined in: [tracing/manager.ts:414](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/manager.ts#L414) Record an error on a span ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `spanId` | `string` | Span ID | | `error` | `Error` | Error to record | ###### Returns `void` ##### setSpanAttributes() ```ts setSpanAttributes(spanId, attributes): void; ``` Defined in: [tracing/manager.ts:384](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/manager.ts#L384) Set attributes on a span ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `spanId` | `string` | Span ID | | `attributes` | [`SpanAttributes`](#spanattributes-1) | Attributes to set | ###### Returns `void` ###### Implementation of [`TracingManagerInterface`](#tracingmanagerinterface).[`setSpanAttributes`](#setspanattributes-1) ##### setSpanStatus() ```ts setSpanStatus( spanId, status, message?): void; ``` Defined in: [tracing/manager.ts:398](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/manager.ts#L398) Set span status ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `spanId` | `string` | Span ID | | `status` | [`SpanStatus`](#spanstatus-1) | Status | | `message?` | `string` | Optional status message | ###### Returns `void` ###### Implementation of [`TracingManagerInterface`](#tracingmanagerinterface).[`setSpanStatus`](#setspanstatus-1) ##### startSpan() ```ts startSpan(options): Span; ``` Defined in: [tracing/manager.ts:201](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/manager.ts#L201) Start a new span ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `options` | [`StartSpanOptions`](#startspanoptions) | Span options | ###### Returns [`Span`](#span) Created span ###### Implementation of [`TracingManagerInterface`](#tracingmanagerinterface).[`startSpan`](#startspan-1) ##### startTrace() ```ts startTrace(attributes?): string; ``` Defined in: [tracing/manager.ts:104](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/manager.ts#L104) Start a new trace ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `attributes?` | [`SpanAttributes`](#spanattributes-1) | Additional trace-level attributes | ###### Returns `string` Trace ID ###### Implementation of [`TracingManagerInterface`](#tracingmanagerinterface).[`startTrace`](#starttrace-1) *** ### UsageTracker Defined in: [costs/tracker.ts:47](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/tracker.ts#L47) UsageTracker tracks token usage across LLM calls #### Constructors ##### Constructor ```ts new UsageTracker(options?): UsageTracker; ``` Defined in: [costs/tracker.ts:59](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/tracker.ts#L59) ###### Parameters | Parameter | Type | | ------ | ------ | | `options` | [`UsageTrackerOptions`](#usagetrackeroptions) | ###### Returns [`UsageTracker`](#usagetracker) #### Accessors ##### isEnabled ###### Get Signature ```ts get isEnabled(): boolean; ``` Defined in: [costs/tracker.ts:338](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/tracker.ts#L338) Check if tracking is enabled ###### Returns `boolean` ##### size ###### Get Signature ```ts get size(): number; ``` Defined in: [costs/tracker.ts:345](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/tracker.ts#L345) Get the number of records ###### Returns `number` #### Methods ##### formatTokens() ```ts formatTokens(tokens): string; ``` Defined in: [costs/tracker.ts:276](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/tracker.ts#L276) Format tokens with commas for display ###### Parameters | Parameter | Type | | ------ | ------ | | `tokens` | `number` | ###### Returns `string` ##### getBudgetStatus() ```ts getBudgetStatus(): BudgetStatus; ``` Defined in: [costs/tracker.ts:193](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/tracker.ts#L193) Get budget status ###### Returns [`BudgetStatus`](#budgetstatus) ##### getRecords() ```ts getRecords(): readonly UsageRecord[]; ``` Defined in: [costs/tracker.ts:262](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/tracker.ts#L262) Get all records ###### Returns readonly [`UsageRecord`](#usagerecord)[] ##### getSessionRecords() ```ts getSessionRecords(sessionId): UsageRecord[]; ``` Defined in: [costs/tracker.ts:269](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/tracker.ts#L269) Get records for a specific session ###### Parameters | Parameter | Type | | ------ | ------ | | `sessionId` | `string` | ###### Returns [`UsageRecord`](#usagerecord)[] ##### getSessionStats() ```ts getSessionStats(sessionId): UsageStats; ``` Defined in: [costs/tracker.ts:160](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/tracker.ts#L160) Get stats for a specific session ###### Parameters | Parameter | Type | | ------ | ------ | | `sessionId` | `string` | ###### Returns [`UsageStats`](#usagestats) ##### getStats() ```ts getStats(): UsageStats; ``` Defined in: [costs/tracker.ts:96](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/tracker.ts#L96) Get aggregated usage statistics ###### Returns [`UsageStats`](#usagestats) ##### getSummary() ```ts getSummary(): string; ``` Defined in: [costs/tracker.ts:283](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/tracker.ts#L283) Get a human-readable summary ###### Returns `string` ##### getTotalInputTokens() ```ts getTotalInputTokens(): number; ``` Defined in: [costs/tracker.ts:179](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/tracker.ts#L179) Get total input tokens ###### Returns `number` ##### getTotalOutputTokens() ```ts getTotalOutputTokens(): number; ``` Defined in: [costs/tracker.ts:186](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/tracker.ts#L186) Get total output tokens ###### Returns `number` ##### getTotalTokens() ```ts getTotalTokens(): number; ``` Defined in: [costs/tracker.ts:172](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/tracker.ts#L172) Get total tokens used ###### Returns `number` ##### isBudgetExceeded() ```ts isBudgetExceeded(): boolean; ``` Defined in: [costs/tracker.ts:224](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/tracker.ts#L224) Check if budget is exceeded ###### Returns `boolean` ##### onEvent() ```ts onEvent(handler): () => void; ``` Defined in: [costs/tracker.ts:317](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/tracker.ts#L317) Register an event handler ###### Parameters | Parameter | Type | | ------ | ------ | | `handler` | [`UsageEventHandler`](#usageeventhandler) | ###### Returns () => `void` ##### record() ```ts record(input): UsageRecord | undefined; ``` Defined in: [costs/tracker.ts:68](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/tracker.ts#L68) Record token usage from an LLM call ###### Parameters | Parameter | Type | | ------ | ------ | | `input` | [`RecordUsageInput`](#recordusageinput) | ###### Returns [`UsageRecord`](#usagerecord) \| `undefined` ##### reset() ```ts reset(): void; ``` Defined in: [costs/tracker.ts:252](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/tracker.ts#L252) Reset all tracking data ###### Returns `void` *** ### ValidationError Defined in: [errors.ts:181](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L181) Error thrown when input validation fails. #### Example ```typescript throw new ValidationError( 'maxTokens must be a positive number', 'maxTokens' ); ``` #### Extends - [`AgentError`](#agenterror) #### Constructors ##### Constructor ```ts new ValidationError(message, field): ValidationError; ``` Defined in: [errors.ts:182](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L182) ###### Parameters | Parameter | Type | | ------ | ------ | | `message` | `string` | | `field` | `string` | ###### Returns [`ValidationError`](#validationerror) ###### Overrides [`AgentError`](#agenterror).[`constructor`](#constructor-2) #### Properties ##### cause? ```ts readonly optional cause?: Error; ``` Defined in: [errors.ts:17](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L17) ###### Inherited from [`AgentError`](#agenterror).[`cause`](#cause-1) ##### field ```ts readonly field: string; ``` Defined in: [errors.ts:184](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L184) ## Interfaces ### AcquireResult Defined in: [rate-limit/types.ts:142](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/types.ts#L142) Result of acquiring a rate limit token #### Properties ##### acquired ```ts acquired: boolean; ``` Defined in: [rate-limit/types.ts:146](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/types.ts#L146) Whether the acquisition was successful ##### estimatedWaitMs? ```ts optional estimatedWaitMs?: number; ``` Defined in: [rate-limit/types.ts:156](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/types.ts#L156) If not acquired, the estimated wait time (ms) ##### waitedMs ```ts waitedMs: number; ``` Defined in: [rate-limit/types.ts:151](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/types.ts#L151) Time waited to acquire the token (ms) *** ### AffectedFile Defined in: [rehearsal/types.ts:29](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L29) Information about a file that would be affected #### Properties ##### changeType ```ts changeType: "reset" | "delete" | "overwrite" | "modify"; ``` Defined in: [rehearsal/types.ts:38](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L38) Type of change that would occur ##### hasUncommittedChanges? ```ts optional hasUncommittedChanges?: boolean; ``` Defined in: [rehearsal/types.ts:58](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L58) Whether this file has uncommitted changes (for git operations) ##### lastModified? ```ts optional lastModified?: Date; ``` Defined in: [rehearsal/types.ts:48](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L48) When the file was last modified ##### linesAffected? ```ts optional linesAffected?: number; ``` Defined in: [rehearsal/types.ts:43](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L43) Number of lines that would be affected (if applicable) ##### path ```ts path: string; ``` Defined in: [rehearsal/types.ts:33](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L33) Path to the file ##### size? ```ts optional size?: number; ``` Defined in: [rehearsal/types.ts:53](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L53) Size of the file in bytes *** ### AfterLLMHookContext Defined in: [hooks/types.ts:164](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L164) Context for after:llm hook #### Extends - [`LLMHookContext`](#llmhookcontext) #### Properties ##### durationMs ```ts durationMs: number; ``` Defined in: [hooks/types.ts:195](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L195) Duration of the LLM call in milliseconds ##### iteration ```ts iteration: number; ``` Defined in: [hooks/types.ts:28](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L28) Current iteration number (1-indexed) ###### Inherited from [`LLMHookContext`](#llmhookcontext).[`iteration`](#iteration-5) ##### messages ```ts messages: Message[]; ``` Defined in: [hooks/types.ts:111](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L111) Messages to be sent to LLM ###### Inherited from [`LLMHookContext`](#llmhookcontext).[`messages`](#messages-5) ##### metadata ```ts metadata: Record; ``` Defined in: [hooks/types.ts:38](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L38) Custom metadata that can be passed between hooks ###### Inherited from [`LLMHookContext`](#llmhookcontext).[`metadata`](#metadata-8) ##### model? ```ts optional model?: string; ``` Defined in: [hooks/types.ts:190](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L190) Model that was used ##### sessionId ```ts sessionId: string; ``` Defined in: [hooks/types.ts:23](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L23) Current session ID ###### Inherited from [`LLMHookContext`](#llmhookcontext).[`sessionId`](#sessionid-8) ##### signal? ```ts optional signal?: AbortSignal; ``` Defined in: [hooks/types.ts:33](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L33) Abort signal for cancellation ###### Inherited from [`LLMHookContext`](#llmhookcontext).[`signal`](#signal-6) ##### systemPrompt ```ts systemPrompt: string; ``` Defined in: [hooks/types.ts:122](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L122) Current system prompt (fully assembled, including anchors). Hooks can read this and return a modified version in BeforeLLMHookResult. ###### Inherited from [`LLMHookContext`](#llmhookcontext).[`systemPrompt`](#systemprompt-5) ##### text ```ts text: string; ``` Defined in: [hooks/types.ts:168](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L168) Text response from LLM ##### tools ```ts tools: ToolDefinition[]; ``` Defined in: [hooks/types.ts:116](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L116) Tool definitions available to LLM ###### Inherited from [`LLMHookContext`](#llmhookcontext).[`tools`](#tools-5) ##### toolUses ```ts toolUses: { id: string; input: Record; name: string; }[]; ``` Defined in: [hooks/types.ts:173](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L173) Tool uses requested by LLM ###### id ```ts id: string; ``` ###### input ```ts input: Record; ``` ###### name ```ts name: string; ``` ##### usage? ```ts optional usage?: { inputTokens: number; outputTokens: number; }; ``` Defined in: [hooks/types.ts:182](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L182) Token usage from the call ###### inputTokens ```ts inputTokens: number; ``` ###### outputTokens ```ts outputTokens: number; ``` *** ### AfterToolHookContext Defined in: [hooks/types.ts:266](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L266) Context for after:tool hook #### Extends - [`ToolHookContext`](#toolhookcontext) #### Properties ##### durationMs ```ts durationMs: number; ``` Defined in: [hooks/types.ts:275](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L275) Duration of tool execution in milliseconds ##### input ```ts input: Record; ``` Defined in: [hooks/types.ts:225](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L225) Input arguments for the tool ###### Inherited from [`ToolHookContext`](#toolhookcontext).[`input`](#input-8) ##### iteration ```ts iteration: number; ``` Defined in: [hooks/types.ts:28](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L28) Current iteration number (1-indexed) ###### Inherited from [`ToolHookContext`](#toolhookcontext).[`iteration`](#iteration-6) ##### metadata ```ts metadata: Record; ``` Defined in: [hooks/types.ts:38](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L38) Custom metadata that can be passed between hooks ###### Inherited from [`ToolHookContext`](#toolhookcontext).[`metadata`](#metadata-11) ##### result ```ts result: ToolExecutionResult; ``` Defined in: [hooks/types.ts:270](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L270) Result from tool execution ##### sessionId ```ts sessionId: string; ``` Defined in: [hooks/types.ts:23](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L23) Current session ID ###### Inherited from [`ToolHookContext`](#toolhookcontext).[`sessionId`](#sessionid-13) ##### signal? ```ts optional signal?: AbortSignal; ``` Defined in: [hooks/types.ts:33](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L33) Abort signal for cancellation ###### Inherited from [`ToolHookContext`](#toolhookcontext).[`signal`](#signal-8) ##### toolName ```ts toolName: string; ``` Defined in: [hooks/types.ts:220](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L220) Name of the tool being executed ###### Inherited from [`ToolHookContext`](#toolhookcontext).[`toolName`](#toolname-11) *** ### AfterToolHookResult Defined in: [hooks/types.ts:281](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L281) Result from after:tool hook that can modify the result #### Properties ##### result? ```ts optional result?: ToolExecutionResult; ``` Defined in: [hooks/types.ts:285](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L285) Modified result (optional, original used if not provided) *** ### AgentConfig Defined in: [agent.ts:182](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L182) Agent configuration options #### Properties ##### ~~anchors?~~ ```ts optional anchors?: AnchorManagerOptions; ``` Defined in: [agent.ts:425](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L425) ###### Deprecated Use `pins` instead ##### autoCheckpoint? ```ts optional autoCheckpoint?: boolean; ``` Defined in: [agent.ts:385](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L385) Automatically save state after each run() call. Requires checkpointer to be set. Default: false. ##### autoContextManagement? ```ts optional autoContextManagement?: boolean; ``` Defined in: [agent.ts:303](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L303) Enable automatic context management (compaction, summarization). Requires contextManager to be set. Default: true when contextManager is provided. ##### chatOptions? ```ts optional chatOptions?: ChatOptions; ``` Defined in: [agent.ts:279](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L279) Chat options (model, temperature, etc.) ##### checkpointer? ```ts optional checkpointer?: Checkpointer; ``` Defined in: [agent.ts:373](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L373) Checkpointer for persisting agent state. If provided, enables checkpoint() and resume() functionality. ##### checkpointOnAbort? ```ts optional checkpointOnAbort?: boolean; ``` Defined in: [agent.ts:395](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L395) Save a partial checkpoint when run is aborted or encounters an error. This allows recovery from interrupted runs. Requires checkpointer to be set. Default: false. Inspired by LangGraph issue #5672: Cancellation causes loss of streamed state not yet persisted as checkpoint. ##### compactToolResults? ```ts optional compactToolResults?: boolean; ``` Defined in: [agent.ts:324](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L324) Use compact text format for tool results in LLM messages. Strips JSON wrappers and metadata, reducing token usage. Enabled by default when contextManager is provided. Set to `false` to disable. ##### contextManager? ```ts optional contextManager?: ContextManager; ``` Defined in: [agent.ts:297](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L297) Context manager for tracking and managing context window usage. If not provided, context management is disabled. ##### deadMessagePruning? ```ts optional deadMessagePruning?: false | Partial; ``` Defined in: [agent.ts:330](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L330) Dead message pruning configuration. Prunes superseded errors and permission exchanges. Enabled by default when contextManager is provided. Set to `false` to disable. ##### delegation? ```ts optional delegation?: DelegationConfig; ``` Defined in: [agent.ts:656](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L656) Tool result delegation config. When set and enabled, large tool results are automatically summarized to conserve context tokens. Full results are stored in-memory for optional recall via `recall_full_result`. ###### Example ```typescript const agent = new Agent({ provider, delegation: { enabled: true, delegationThreshold: 8000, // tokens above which to delegate strategy: 'auto', // try LLM, fall back to extractive toolOverrides: { bash: { threshold: 12000 }, grep: { threshold: 4000 }, }, }, }); ``` ##### enableFileTracking? ```ts optional enableFileTracking?: boolean; ``` Defined in: [agent.ts:686](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L686) Enable file access tracking for context restoration hints. When enabled, the agent tracks which files were read, referenced (grep/glob), and modified during execution. After context compaction, these hints are injected to help the LLM understand what files it previously accessed. Requires contextManager to be set (hints are injected after compaction). ###### Default ```ts false ``` ###### Example ```typescript const agent = new Agent({ provider, contextManager: new ContextManager({ provider }), enableFileTracking: true, // Automatically track file accesses }); // After compaction, the agent will inject hints like: // [Context compacted. Previously accessed files:] // Read (3 files): file1.ts (100 lines), file2.ts (50 lines)... ``` ##### fileRestoration? ```ts optional fileRestoration?: { maxInlineTokens?: number; }; ``` Defined in: [agent.ts:697](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L697) Options for file context restoration after compaction. Controls how file contents are re-injected into the context after compaction. Small files get their content inlined; large files get reference-only hints. Only applies when `enableFileTracking` is true. ###### maxInlineTokens? ```ts optional maxInlineTokens?: number; ``` Max total tokens for inline file content after compaction (default: 4000) ##### guardrails? ```ts optional guardrails?: GuardrailManagerOptions; ``` Defined in: [agent.ts:464](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L464) Guardrail options for pattern-based safety checks. Guardrails scan tool inputs before execution and can: - warn: Log a warning but proceed - confirm: Require confirmation (via onTriggered handler) - block: Prevent execution entirely ###### Example ```typescript const agent = new Agent({ provider, guardrails: { enabled: true, includeDefaults: true, // Include built-in guardrails custom: [ { id: 'no-prod', name: 'Production Protection', description: 'Block operations on production', patterns: [/prod/i], action: 'block', message: 'Production operations are blocked', } ], onTriggered: async (result, context) => { // Return true to proceed, false to block return await askUser(result.guardrail.message); } } }); ``` ##### hooks? ```ts optional hooks?: HooksConfig; ``` Defined in: [agent.ts:629](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L629) Hooks for customizing agent behavior at various lifecycle points. Hooks provide extension points without subclassing for: - Logging and tracing - Input/output transformation - Custom validation - Metrics collection - Integration with external systems ###### Example ```typescript const agent = new Agent({ provider, hooks: { beforeTool: [ async (ctx) => { console.log(`Tool ${ctx.toolName} starting...`); } ], afterTool: [ async (ctx) => { console.log(`Tool ${ctx.toolName} completed in ${ctx.durationMs}ms`); // Optionally modify result return { result: ctx.result }; } ], beforeLLM: [ async (ctx) => { // Optionally inject or transform messages return { messages: ctx.messages }; } ], onError: [ async (ctx) => { console.error(`Error in ${ctx.phase}:`, ctx.error); } ] } }); ``` ##### iterationLimitBehavior? ```ts optional iterationLimitBehavior?: "summarize" | "error" | "continue"; ``` Defined in: [agent.ts:225](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L225) Behavior when max iterations is reached (default: 'error'). - 'error': Throw MaxIterationsError immediately - 'summarize': Generate a final summary response before throwing - 'continue': Return partial result without throwing (response will be empty) Note: If onIterationLimitReached callback is provided, it takes precedence. ##### logger? ```ts optional logger?: Logger; ``` Defined in: [agent.ts:717](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L717) Logger instance for structured diagnostic logging. When omitted, no logging is performed. ###### Example ```typescript import { createLogger } from '@compilr-dev/logger'; const log = createLogger({ package: 'my-app' }); const agent = new Agent({ provider, logger: log }); ``` ##### maxConsecutiveToolCalls? ```ts optional maxConsecutiveToolCalls?: number; ``` Defined in: [agent.ts:206](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L206) Maximum consecutive identical tool calls (same name + input + result) before the loop detector trips (default: 5). Set to 0 to disable loop detection. Detection is result-aware: a repeated call only counts when its result is also identical to the previous one, so legitimate polling that returns changing output (e.g. `bash_output` while a build runs) does not trip. ##### maxIterations? ```ts optional maxIterations?: number; ``` Defined in: [agent.ts:196](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L196) Maximum iterations for tool use loops (default: 10) ##### maxToolLoopNudges? ```ts optional maxToolLoopNudges?: number; ``` Defined in: [agent.ts:215](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L215) On a loop trip, how many times to inject a corrective "self-heal" message and let the agent continue before throwing ToolLoopError (default: 1). Set to 0 to throw immediately on the first trip (no self-heal). Ignored when `onToolLoopDetected` is provided (that callback takes over). ##### observationMask? ```ts optional observationMask?: false | Partial; ``` Defined in: [agent.ts:309](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L309) Observation masking configuration. Masks old tool results in history to reduce tokens. Enabled by default when contextManager is provided. Set to `false` to disable. ##### onEvent? ```ts optional onEvent?: AgentEventHandler; ``` Defined in: [agent.ts:335](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L335) Event handler for monitoring agent execution ##### onIterationLimitReached? ```ts optional onIterationLimitReached?: (context) => Promise; ``` Defined in: [agent.ts:248](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L248) Callback invoked when the agent reaches its iteration limit. Allows the caller to decide whether to continue or stop. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `context` | \{ `iteration`: `number`; `maxIterations`: `number`; `toolCallCount`: `number`; \} | Information about the current state | | `context.iteration` | `number` | - | | `context.maxIterations` | `number` | - | | `context.toolCallCount` | `number` | - | ###### Returns `Promise`\<`number` \| `false`\> Promise resolving to: - `false` to stop the agent gracefully - A positive number to continue with that many additional iterations If this callback is provided and returns a number, the agent will continue running with the extended iteration limit. This takes precedence over iterationLimitBehavior. ###### Example ```typescript onIterationLimitReached: async ({ iteration, toolCallCount }) => { const answer = await askUser(`Agent used ${iteration} iterations. Continue?`); return answer === 'yes' ? 50 : false; // Add 50 more or stop } ``` ##### onToolLoopDetected? ```ts optional onToolLoopDetected?: (context) => Promise; ``` Defined in: [agent.ts:270](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L270) Callback when tool loop is detected (same tool called N times with identical input). When provided, the agent asks the user instead of throwing ToolLoopError. Return `true` to continue (reset the counter), `false` to stop. When not provided, ToolLoopError is thrown (backwards compatible). ###### Parameters | Parameter | Type | | ------ | ------ | | `context` | \{ `consecutiveCalls`: `number`; `input`: `Record`\<`string`, `unknown`\>; `toolName`: `string`; \} | | `context.consecutiveCalls` | `number` | | `context.input` | `Record`\<`string`, `unknown`\> | | `context.toolName` | `string` | ###### Returns `Promise`\<`boolean`\> ###### Example ```typescript onToolLoopDetected: async ({ toolName, consecutiveCalls }) => { const answer = await askUser(`${toolName} called ${consecutiveCalls} times. Continue?`); return answer === 'yes'; } ``` ##### permissionManager? ```ts optional permissionManager?: PermissionManager; ``` Defined in: [agent.ts:508](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L508) Pre-existing PermissionManager instance. Use this to share a PermissionManager between agents (e.g., parent and sub-agents). When provided, takes precedence over `permissions` options. This is primarily used internally for sub-agent permission inheritance. ##### permissions? ```ts optional permissions?: PermissionManagerOptions; ``` Defined in: [agent.ts:498](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L498) Permission options for tool-level access control. Permissions allow fine-grained control over which tools can execute and when user approval is required. ###### Example ```typescript const agent = new Agent({ provider, permissions: { defaultLevel: 'always', // Default: allow all tools rules: [ { toolName: 'bash', level: 'once', description: 'Shell commands' }, { toolName: 'write_file', level: 'session', description: 'File writes' }, { toolName: 'delete_*', level: 'deny' }, // Wildcard: block all delete tools ], onPermissionRequest: async (request) => { // Return true to allow, false to deny return await showConfirmDialog( `Allow ${request.toolName}?`, request.preview ); } } }); ``` ##### pins? ```ts optional pins?: AnchorManagerOptions; ``` Defined in: [agent.ts:422](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L422) Pin manager options for critical information that survives context compaction. Pins are pieces of information that: - Never get compacted - Survive all context management - Always re-injected - Present in every LLM call - Scoped - Session, persistent, or temporary ###### Example ```typescript const agent = new Agent({ provider, pins: { maxAnchors: 20, maxTokens: 2000, persistPath: '~/.myapp/anchors.json', includeDefaults: true, // Include built-in safety anchors } }); ``` ##### projectMemory? ```ts optional projectMemory?: ProjectMemory; ``` Defined in: [agent.ts:544](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L544) Pre-loaded project memory to prepend to system prompt. Use `Agent.createWithMemory()` to automatically load from files, or pass a pre-loaded ProjectMemory object. ###### Example ```typescript // Option 1: Use the factory method (recommended) const agent = await Agent.createWithMemory({ provider, systemPrompt: 'You are a helpful assistant.', projectMemoryOptions: { providers: ['claude', 'gemini'], includeGeneric: true, }, projectMemoryDir: '/path/to/project', }); // Option 2: Pre-load memory manually const loader = new ProjectMemoryLoader({ providers: 'claude' }); const memory = await loader.load('/path/to/project'); const agent = new Agent({ provider, systemPrompt: 'You are a helpful assistant.', projectMemory: memory, // Pre-loaded memory }); ``` ##### provider ```ts provider: LLMProvider; ``` Defined in: [agent.ts:186](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L186) The LLM provider to use ##### retry? ```ts optional retry?: LLMRetryConfig; ``` Defined in: [agent.ts:363](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L363) Configuration for automatic retry on transient LLM errors. Enabled by default with sensible defaults (10 attempts, exponential backoff). Retryable errors include: - Rate limit (429) - Server errors (5xx) - Connection/network errors - Anthropic overloaded (529) ###### Example ```typescript const agent = new Agent({ provider, retry: { maxAttempts: 5, // Max 5 retries baseDelayMs: 2000, // Start with 2s delay maxDelayMs: 60000, // Cap at 60s } }); ``` ##### sessionId? ```ts optional sessionId?: string; ``` Defined in: [agent.ts:379](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L379) Session ID for this agent instance. If not provided, a new session ID is generated automatically. ##### systemPrompt? ```ts optional systemPrompt?: string; ``` Defined in: [agent.ts:191](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L191) System prompt for the agent ##### toolRegistry? ```ts optional toolRegistry?: ToolRegistry; ``` Defined in: [agent.ts:284](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L284) Custom tool registry (optional, creates new one if not provided) ##### toolTimeoutMs? ```ts optional toolTimeoutMs?: number; ``` Defined in: [agent.ts:291](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L291) Default timeout for tool execution in milliseconds (default: 30000 = 30s). Set to 0 to disable timeout. Only used when toolRegistry is not provided. Sub-agents inherit this timeout from the parent agent. ##### usage? ```ts optional usage?: UsageTrackerOptions; ``` Defined in: [agent.ts:581](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L581) Usage tracking options for monitoring token usage. Note: We track tokens only, not dollar costs. Pricing changes frequently and providing potentially inaccurate cost information would be misleading. ###### Example ```typescript const agent = new Agent({ provider, usage: { enabled: true, budget: { maxTotalTokens: 100000, // 100k token limit warningThreshold: 0.8, // Warn at 80% }, }, }); // After runs, check usage console.log(agent.getUsageStats()); console.log(agent.getTotalTokens()); // Listen for budget events agent.onEvent((event) => { if (event.type === 'usage_budget_warning') { console.log('Budget warning!', event.status); } }); ``` ##### windowing? ```ts optional windowing?: false | Partial; ``` Defined in: [agent.ts:317](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L317) Smart windowing configuration. Programmatically compacts old messages when history exceeds a token budget. Three zones: recent (intact), middle (truncated), old (event log). Zero LLM calls. Enabled by default when contextManager is provided. Set to `false` to disable. *** ### AgentRunResult Defined in: [agent.ts:791](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L791) Agent run result #### Properties ##### aborted ```ts aborted: boolean; ``` Defined in: [agent.ts:819](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L819) Whether the run was aborted ##### contextStats? ```ts optional contextStats?: ContextStats; ``` Defined in: [agent.ts:824](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L824) Context statistics (if context manager is enabled) ##### iterations ```ts iterations: number; ``` Defined in: [agent.ts:805](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L805) Number of iterations (tool use loops) executed ##### messages ```ts messages: Message[]; ``` Defined in: [agent.ts:800](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L800) All messages in the conversation ##### response ```ts response: string; ``` Defined in: [agent.ts:795](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L795) Final text response from the agent ##### toolCalls ```ts toolCalls: { input: Record; name: string; result: ToolExecutionResult; }[]; ``` Defined in: [agent.ts:810](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L810) Tool calls made during execution ###### input ```ts input: Record; ``` ###### name ```ts name: string; ``` ###### result ```ts result: ToolExecutionResult; ``` *** ### AgentState Defined in: [state/types.ts:19](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L19) Serializable snapshot of an agent's current state. Contains everything needed to resume a conversation. #### Properties ##### createdAt ```ts createdAt: string; ``` Defined in: [state/types.ts:64](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L64) When the session was created (ISO 8601) ##### currentIteration ```ts currentIteration: number; ``` Defined in: [state/types.ts:48](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L48) Current iteration count ##### messages ```ts messages: Message[]; ``` Defined in: [state/types.ts:28](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L28) Conversation messages ##### model? ```ts optional model?: string; ``` Defined in: [state/types.ts:38](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L38) Model identifier (optional, for resume) ##### sessionId ```ts sessionId: string; ``` Defined in: [state/types.ts:23](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L23) Unique session identifier ##### systemPrompt ```ts systemPrompt: string; ``` Defined in: [state/types.ts:33](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L33) System prompt (needed for resume) ##### todos ```ts todos: TodoItem[]; ``` Defined in: [state/types.ts:43](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L43) Todo items state ##### totalTokensUsed ```ts totalTokensUsed: number; ``` Defined in: [state/types.ts:59](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L59) Total tokens used in the session ##### turnCount ```ts turnCount: number; ``` Defined in: [state/types.ts:54](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L54) Number of conversation turns (user + assistant exchanges) Used by context manager to track recent vs old messages for compaction. ##### updatedAt ```ts updatedAt: string; ``` Defined in: [state/types.ts:69](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L69) When the session was last updated (ISO 8601) ##### version ```ts version: number; ``` Defined in: [state/types.ts:74](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L74) Schema version for migration support *** ### AgentTypeConfig Defined in: [tools/builtin/task.ts:101](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/task.ts#L101) Configuration for a pre-defined agent type #### Properties ##### allowedTools? ```ts optional allowedTools?: string[]; ``` Defined in: [tools/builtin/task.ts:153](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/task.ts#L153) Tool names to allow (whitelist) when toolInheritance is 'filter' ##### contextMode? ```ts optional contextMode?: ContextMode; ``` Defined in: [tools/builtin/task.ts:135](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/task.ts#L135) Default context inheritance mode ##### defaultModel? ```ts optional defaultModel?: string; ``` Defined in: [tools/builtin/task.ts:130](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/task.ts#L130) Default model for this agent type ##### deniedTools? ```ts optional deniedTools?: string[]; ``` Defined in: [tools/builtin/task.ts:158](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/task.ts#L158) Tool names to deny (blacklist) when toolInheritance is 'filter' ##### description ```ts description: string; ``` Defined in: [tools/builtin/task.ts:105](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/task.ts#L105) Description of what this agent type does ##### maxIterations? ```ts optional maxIterations?: number; ``` Defined in: [tools/builtin/task.ts:125](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/task.ts#L125) Maximum iterations for this agent type ##### skills? ```ts optional skills?: string[]; ``` Defined in: [tools/builtin/task.ts:120](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/task.ts#L120) Skills available to this agent type ##### supportsThoroughness? ```ts optional supportsThoroughness?: boolean; ``` Defined in: [tools/builtin/task.ts:140](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/task.ts#L140) Whether this agent type supports thoroughness levels ##### systemPrompt? ```ts optional systemPrompt?: string; ``` Defined in: [tools/builtin/task.ts:110](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/task.ts#L110) System prompt for this agent type ##### toolInheritance? ```ts optional toolInheritance?: "filter" | "none" | "all"; ``` Defined in: [tools/builtin/task.ts:148](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/task.ts#L148) Tool inheritance mode: - 'none': Only use tools specified in this config - 'all': Inherit all parent tools plus config tools - 'filter': Inherit parent tools filtered by allowedTools/deniedTools ##### tools? ```ts optional tools?: (string | Tool)[]; ``` Defined in: [tools/builtin/task.ts:115](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/task.ts#L115) Tools available to this agent type (tool names or Tool instances) *** ### Anchor Defined in: [anchors/types.ts:30](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L30) An anchor - critical information that survives context compaction #### Properties ##### content ```ts content: string; ``` Defined in: [anchors/types.ts:39](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L39) The content to remember (injected into every LLM call) ##### createdAt ```ts createdAt: Date; ``` Defined in: [anchors/types.ts:54](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L54) When this anchor was created ##### expiresAt? ```ts optional expiresAt?: Date; ``` Defined in: [anchors/types.ts:59](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L59) When this anchor expires (for temporary anchors) ##### id ```ts id: string; ``` Defined in: [anchors/types.ts:34](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L34) Unique identifier for this anchor ##### metadata? ```ts optional metadata?: Record; ``` Defined in: [anchors/types.ts:69](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L69) Optional metadata for custom use ##### priority ```ts priority: AnchorPriority; ``` Defined in: [anchors/types.ts:44](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L44) Priority level determines display order and emphasis ##### projectId? ```ts optional projectId?: string; ``` Defined in: [anchors/types.ts:75](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L75) Optional project association for project-scoped anchors If not provided, the anchor is considered "global" ##### scope ```ts scope: AnchorScope; ``` Defined in: [anchors/types.ts:49](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L49) Scope determines lifetime and persistence behavior ##### tags? ```ts optional tags?: string[]; ``` Defined in: [anchors/types.ts:64](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L64) Optional tags for filtering and grouping *** ### AnchorClearOptions Defined in: [anchors/types.ts:135](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L135) Options for clearing anchors #### Properties ##### expiredOnly? ```ts optional expiredOnly?: boolean; ``` Defined in: [anchors/types.ts:149](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L149) Clear only expired anchors ##### globalOnly? ```ts optional globalOnly?: boolean; ``` Defined in: [anchors/types.ts:160](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L160) If true, only clear global anchors (those without a projectId) Cannot be used together with projectId ##### projectId? ```ts optional projectId?: string; ``` Defined in: [anchors/types.ts:154](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L154) Clear only anchors associated with this project ##### scope? ```ts optional scope?: AnchorScope; ``` Defined in: [anchors/types.ts:139](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L139) Clear only anchors with this scope ##### tags? ```ts optional tags?: string[]; ``` Defined in: [anchors/types.ts:144](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L144) Clear only anchors with these tags *** ### AnchorEvent Defined in: [anchors/types.ts:225](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L225) Anchor event payload #### Properties ##### anchor? ```ts optional anchor?: Anchor; ``` Defined in: [anchors/types.ts:227](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L227) ##### anchors? ```ts optional anchors?: Anchor[]; ``` Defined in: [anchors/types.ts:228](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L228) ##### message? ```ts optional message?: string; ``` Defined in: [anchors/types.ts:229](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L229) ##### type ```ts type: AnchorEventType; ``` Defined in: [anchors/types.ts:226](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L226) *** ### AnchorInput Defined in: [anchors/types.ts:81](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L81) Input for adding a new anchor (id and createdAt are auto-generated if not provided) #### Properties ##### content ```ts content: string; ``` Defined in: [anchors/types.ts:83](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L83) ##### expiresAt? ```ts optional expiresAt?: Date; ``` Defined in: [anchors/types.ts:86](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L86) ##### id? ```ts optional id?: string; ``` Defined in: [anchors/types.ts:82](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L82) ##### metadata? ```ts optional metadata?: Record; ``` Defined in: [anchors/types.ts:88](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L88) ##### priority ```ts priority: AnchorPriority; ``` Defined in: [anchors/types.ts:84](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L84) ##### projectId? ```ts optional projectId?: string; ``` Defined in: [anchors/types.ts:92](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L92) Optional project association for project-scoped anchors ##### scope ```ts scope: AnchorScope; ``` Defined in: [anchors/types.ts:85](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L85) ##### tags? ```ts optional tags?: string[]; ``` Defined in: [anchors/types.ts:87](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L87) *** ### AnchorManagerOptions Defined in: [anchors/types.ts:166](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L166) Configuration for the AnchorManager #### Properties ##### estimateTokens? ```ts optional estimateTokens?: (content) => number; ``` Defined in: [anchors/types.ts:193](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L193) Token estimator function (default: rough estimate based on chars) ###### Parameters | Parameter | Type | | ------ | ------ | | `content` | `string` | ###### Returns `number` ##### includeDefaults? ```ts optional includeDefaults?: boolean; ``` Defined in: [anchors/types.ts:188](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L188) Include built-in default safety anchors (default: true) ##### maxAnchors? ```ts optional maxAnchors?: number; ``` Defined in: [anchors/types.ts:171](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L171) Maximum number of anchors to keep (default: 20) When exceeded, oldest low-priority anchors are removed first ##### maxTokens? ```ts optional maxTokens?: number; ``` Defined in: [anchors/types.ts:177](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L177) Maximum tokens budget for anchors (default: 2000) Anchors exceeding this budget are truncated or removed ##### persistPath? ```ts optional persistPath?: string; ``` Defined in: [anchors/types.ts:183](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L183) Path for persisting anchors (for scope: 'persistent') If not provided, persistent anchors work like session anchors *** ### AnchorQueryOptions Defined in: [anchors/types.ts:98](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L98) Options for querying anchors #### Properties ##### globalOnly? ```ts optional globalOnly?: boolean; ``` Defined in: [anchors/types.ts:129](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L129) If true, only return global anchors (those without a projectId) Cannot be used together with projectId ##### includeExpired? ```ts optional includeExpired?: boolean; ``` Defined in: [anchors/types.ts:117](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L117) Include expired temporary anchors (default: false) ##### priority? ```ts optional priority?: AnchorPriority; ``` Defined in: [anchors/types.ts:102](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L102) Filter by priority level ##### projectId? ```ts optional projectId?: string; ``` Defined in: [anchors/types.ts:123](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L123) Filter by project ID Only returns anchors associated with this project ##### scope? ```ts optional scope?: AnchorScope; ``` Defined in: [anchors/types.ts:107](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L107) Filter by scope ##### tags? ```ts optional tags?: string[]; ``` Defined in: [anchors/types.ts:112](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L112) Filter by tags (anchors must have ALL specified tags) *** ### BashInput Defined in: [tools/builtin/bash.ts:16](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/bash.ts#L16) Input parameters for bash tool #### Properties ##### command ```ts command: string; ``` Defined in: [tools/builtin/bash.ts:20](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/bash.ts#L20) Command to execute ##### cwd? ```ts optional cwd?: string; ``` Defined in: [tools/builtin/bash.ts:25](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/bash.ts#L25) Working directory for the command ##### description? ```ts optional description?: string; ``` Defined in: [tools/builtin/bash.ts:47](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/bash.ts#L47) Description of what this command does (for display purposes) ##### env? ```ts optional env?: Record; ``` Defined in: [tools/builtin/bash.ts:36](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/bash.ts#L36) Environment variables to set ##### run\_in\_background? ```ts optional run_in_background?: boolean; ``` Defined in: [tools/builtin/bash.ts:42](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/bash.ts#L42) Run command in background and return immediately with a shell ID. Use bash_output tool to retrieve output later. ##### timeout? ```ts optional timeout?: number; ``` Defined in: [tools/builtin/bash.ts:31](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/bash.ts#L31) Timeout in milliseconds (default: 60000 = 1 minute) Ignored when run_in_background is true *** ### BashResult Defined in: [tools/builtin/bash.ts:53](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/bash.ts#L53) Result of bash command execution #### Properties ##### exitCode ```ts exitCode: number; ``` Defined in: [tools/builtin/bash.ts:67](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/bash.ts#L67) Exit code (0 = success) ##### stderr ```ts stderr: string; ``` Defined in: [tools/builtin/bash.ts:62](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/bash.ts#L62) Standard error ##### stdout ```ts stdout: string; ``` Defined in: [tools/builtin/bash.ts:57](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/bash.ts#L57) Standard output *** ### BeforeLLMHookResult Defined in: [hooks/types.ts:128](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L128) Result from before:llm hook that modifies messages or tools #### Properties ##### messages? ```ts optional messages?: Message[]; ``` Defined in: [hooks/types.ts:132](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L132) Modified messages (optional, original used if not provided) ##### systemPrompt? ```ts optional systemPrompt?: string; ``` Defined in: [hooks/types.ts:143](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L143) Modified system prompt (optional, original used if not provided). When returned, messages[0] (system message) is updated automatically. ##### tools? ```ts optional tools?: ToolDefinition[]; ``` Defined in: [hooks/types.ts:137](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L137) Modified tools (optional, original used if not provided) *** ### BeforeToolHookResult Defined in: [hooks/types.ts:231](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L231) Result from before:tool hook that can skip or modify execution #### Properties ##### input? ```ts optional input?: Record; ``` Defined in: [hooks/types.ts:245](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L245) Modified input (when not skipping) ##### result? ```ts optional result?: ToolExecutionResult; ``` Defined in: [hooks/types.ts:240](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L240) Custom result to return (when skip is true) ##### skip? ```ts optional skip?: boolean; ``` Defined in: [hooks/types.ts:235](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L235) Skip tool execution and use this result instead *** ### BudgetAllocation Defined in: [context/types.ts:26](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L26) Budget allocation percentages for each category Must sum to 1.0 (100%) #### Properties ##### history ```ts history: number; ``` Defined in: [context/types.ts:49](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L49) Older conversation history allocation ###### Default ```ts 0.30 (30%) ``` ##### recentMessages ```ts recentMessages: number; ``` Defined in: [context/types.ts:37](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L37) Recent messages (last N turns) allocation ###### Default ```ts 0.40 (40%) ``` ##### system ```ts system: number; ``` Defined in: [context/types.ts:31](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L31) System prompt allocation ###### Default ```ts 0.05 (5%) ``` ##### toolResults ```ts toolResults: number; ``` Defined in: [context/types.ts:43](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L43) Tool results allocation ###### Default ```ts 0.25 (25%) ``` *** ### BudgetStatus Defined in: [costs/types.ts:98](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L98) Budget status #### Properties ##### currentInputTokens ```ts currentInputTokens: number; ``` Defined in: [costs/types.ts:102](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L102) Current input tokens ##### currentOutputTokens ```ts currentOutputTokens: number; ``` Defined in: [costs/types.ts:104](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L104) Current output tokens ##### currentTokens ```ts currentTokens: number; ``` Defined in: [costs/types.ts:100](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L100) Current total tokens ##### exceeded ```ts exceeded: boolean; ``` Defined in: [costs/types.ts:110](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L110) Whether budget is exceeded ##### tokenLimit? ```ts optional tokenLimit?: number; ``` Defined in: [costs/types.ts:106](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L106) Token limit (if set) ##### tokenUtilization? ```ts optional tokenUtilization?: number; ``` Defined in: [costs/types.ts:108](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L108) Token utilization (0-1) ##### warning ```ts warning: boolean; ``` Defined in: [costs/types.ts:112](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L112) Whether warning threshold is reached *** ### CategoryBudgetInfo Defined in: [context/types.ts:55](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L55) Budget information for a single category #### Properties ##### allocated ```ts allocated: number; ``` Defined in: [context/types.ts:59](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L59) Allocation fraction (0.0 - 1.0) ##### allocatedTokens ```ts allocatedTokens: number; ``` Defined in: [context/types.ts:64](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L64) Allocated tokens based on maxContextTokens ##### remaining ```ts remaining: number; ``` Defined in: [context/types.ts:74](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L74) Remaining tokens available ##### used ```ts used: number; ``` Defined in: [context/types.ts:69](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L69) Currently used tokens in this category ##### utilization ```ts utilization: number; ``` Defined in: [context/types.ts:79](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L79) Utilization of this category (0.0 - 1.0) *** ### ChatOptions Defined in: [providers/types.ts:193](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L193) Options for chat requests #### Properties ##### enablePromptCaching? ```ts optional enablePromptCaching?: boolean; ``` Defined in: [providers/types.ts:230](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L230) Enable prompt caching for system prompt and tools (Claude-specific) When enabled, the system prompt and tool definitions are cached server-side, reducing token costs by up to 90% on subsequent requests. - Cache write: 1.25x base input cost (first request) - Cache read: 0.1x base input cost (subsequent requests within 5 min) ###### Default ```ts Provider-level setting (typically true) ``` ##### maxTokens? ```ts optional maxTokens?: number; ``` Defined in: [providers/types.ts:195](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L195) ##### model? ```ts optional model?: string; ``` Defined in: [providers/types.ts:194](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L194) ##### signal? ```ts optional signal?: AbortSignal; ``` Defined in: [providers/types.ts:217](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L217) AbortSignal for cancelling the LLM request. When aborted, the provider should stop streaming and throw/return immediately. ##### stopSequences? ```ts optional stopSequences?: string[]; ``` Defined in: [providers/types.ts:197](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L197) ##### temperature? ```ts optional temperature?: number; ``` Defined in: [providers/types.ts:196](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L196) ##### thinking? ```ts optional thinking?: ThinkingConfig; ``` Defined in: [providers/types.ts:211](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L211) Extended thinking configuration (Claude-specific) When enabled, Claude will show its reasoning process before providing the final response. Requires budget_tokens >= 1024. ###### Example ```typescript thinking: { type: 'enabled', budgetTokens: 10000 } ``` ##### tools? ```ts optional tools?: ToolDefinition[]; ``` Defined in: [providers/types.ts:198](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L198) *** ### Checkpointer Defined in: [state/types.ts:236](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L236) Core persistence interface. Implementations handle actual storage. #### Extended by - [`CheckpointerWithPending`](#checkpointerwithpending) #### Methods ##### delete() ```ts delete(sessionId): Promise; ``` Defined in: [state/types.ts:264](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L264) Delete a saved session ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `sessionId` | `string` | Session to delete | ###### Returns `Promise`\<`boolean`\> true if deleted, false if not found ##### exists() ```ts exists(sessionId): Promise; ``` Defined in: [state/types.ts:270](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L270) Check if a session exists ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `sessionId` | `string` | Session to check | ###### Returns `Promise`\<`boolean`\> ##### getMetadata() ```ts getMetadata(sessionId): Promise; ``` Defined in: [state/types.ts:276](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L276) Get session metadata without loading full state ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `sessionId` | `string` | Session to query | ###### Returns `Promise`\<[`SessionMetadata`](#sessionmetadata) \| `null`\> ##### list() ```ts list(options?): Promise; ``` Defined in: [state/types.ts:257](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L257) List all saved sessions ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `options?` | [`ListSessionsOptions`](#listsessionsoptions) | Optional filtering/sorting options | ###### Returns `Promise`\<[`SessionInfo`](#sessioninfo)[]\> Array of session info (without full state) ##### load() ```ts load(sessionId): Promise; ``` Defined in: [state/types.ts:250](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L250) Load agent state from storage ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `sessionId` | `string` | Session to load | ###### Returns `Promise`\<[`AgentState`](#agentstate) \| `null`\> AgentState if found, null if not exists ##### save() ```ts save( sessionId, state, metadata?): Promise; ``` Defined in: [state/types.ts:243](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L243) Save agent state to storage ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `sessionId` | `string` | Unique session identifier | | `state` | [`AgentState`](#agentstate) | Complete agent state to save | | `metadata?` | `Partial`\<[`SessionMetadata`](#sessionmetadata)\> | Optional metadata overrides | ###### Returns `Promise`\<`void`\> *** ### CheckpointerWithPending Defined in: [state/types.ts:317](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L317) Extended checkpointer with fault tolerance support. Tracks pending writes for recovery from mid-step failures. #### Extends - [`Checkpointer`](#checkpointer-1) #### Methods ##### clearPending() ```ts clearPending(sessionId): Promise; ``` Defined in: [state/types.ts:331](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L331) Clear pending writes (called after step completion) ###### Parameters | Parameter | Type | | ------ | ------ | | `sessionId` | `string` | ###### Returns `Promise`\<`void`\> ##### delete() ```ts delete(sessionId): Promise; ``` Defined in: [state/types.ts:264](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L264) Delete a saved session ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `sessionId` | `string` | Session to delete | ###### Returns `Promise`\<`boolean`\> true if deleted, false if not found ###### Inherited from [`Checkpointer`](#checkpointer-1).[`delete`](#delete-2) ##### exists() ```ts exists(sessionId): Promise; ``` Defined in: [state/types.ts:270](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L270) Check if a session exists ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `sessionId` | `string` | Session to check | ###### Returns `Promise`\<`boolean`\> ###### Inherited from [`Checkpointer`](#checkpointer-1).[`exists`](#exists-2) ##### getMetadata() ```ts getMetadata(sessionId): Promise; ``` Defined in: [state/types.ts:276](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L276) Get session metadata without loading full state ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `sessionId` | `string` | Session to query | ###### Returns `Promise`\<[`SessionMetadata`](#sessionmetadata) \| `null`\> ###### Inherited from [`Checkpointer`](#checkpointer-1).[`getMetadata`](#getmetadata-2) ##### list() ```ts list(options?): Promise; ``` Defined in: [state/types.ts:257](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L257) List all saved sessions ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `options?` | [`ListSessionsOptions`](#listsessionsoptions) | Optional filtering/sorting options | ###### Returns `Promise`\<[`SessionInfo`](#sessioninfo)[]\> Array of session info (without full state) ###### Inherited from [`Checkpointer`](#checkpointer-1).[`list`](#list-3) ##### load() ```ts load(sessionId): Promise; ``` Defined in: [state/types.ts:250](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L250) Load agent state from storage ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `sessionId` | `string` | Session to load | ###### Returns `Promise`\<[`AgentState`](#agentstate) \| `null`\> AgentState if found, null if not exists ###### Inherited from [`Checkpointer`](#checkpointer-1).[`load`](#load-3) ##### loadPending() ```ts loadPending(sessionId): Promise; ``` Defined in: [state/types.ts:326](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L326) Load pending writes for a session ###### Parameters | Parameter | Type | | ------ | ------ | | `sessionId` | `string` | ###### Returns `Promise`\<[`PendingWrite`](#pendingwrite)[]\> ##### save() ```ts save( sessionId, state, metadata?): Promise; ``` Defined in: [state/types.ts:243](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L243) Save agent state to storage ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `sessionId` | `string` | Unique session identifier | | `state` | [`AgentState`](#agentstate) | Complete agent state to save | | `metadata?` | `Partial`\<[`SessionMetadata`](#sessionmetadata)\> | Optional metadata overrides | ###### Returns `Promise`\<`void`\> ###### Inherited from [`Checkpointer`](#checkpointer-1).[`save`](#save-2) ##### savePending() ```ts savePending(sessionId, writes): Promise; ``` Defined in: [state/types.ts:321](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L321) Save pending writes (incomplete tool executions) ###### Parameters | Parameter | Type | | ------ | ------ | | `sessionId` | `string` | | `writes` | [`PendingWrite`](#pendingwrite)[] | ###### Returns `Promise`\<`void`\> *** ### ClaudeProviderConfig Defined in: [providers/claude.ts:88](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/claude.ts#L88) Configuration for ClaudeProvider #### Properties ##### apiKey ```ts apiKey: string; ``` Defined in: [providers/claude.ts:92](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/claude.ts#L92) Anthropic API key ##### baseURL? ```ts optional baseURL?: string; ``` Defined in: [providers/claude.ts:103](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/claude.ts#L103) Base URL for API (useful for proxies) ##### enableExtendedContext? ```ts optional enableExtendedContext?: boolean; ``` Defined in: [providers/claude.ts:145](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/claude.ts#L145) Enable extended context window (1M tokens for supported Claude models). Sends `context-1m-2025-08-07` beta header. Long-context pricing applies above 200K tokens per request. ###### Default ```ts false ``` ##### enablePromptCaching? ```ts optional enablePromptCaching?: boolean; ``` Defined in: [providers/claude.ts:122](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/claude.ts#L122) Enable prompt caching for system prompt and tools. When enabled, the system prompt and tool definitions are cached server-side, reducing token costs by up to 90% on subsequent requests. - Cache write: 1.25x base input cost (first request) - Cache read: 0.1x base input cost (subsequent requests within 5 min) ###### Default ```ts true ``` ##### enableTokenEfficientTools? ```ts optional enableTokenEfficientTools?: boolean; ``` Defined in: [providers/claude.ts:130](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/claude.ts#L130) Enable token-efficient tool use (Anthropic beta). Sends compact tool representation, reducing input tokens. No-op for Claude 4+ (already default). ###### Default ```ts true ``` ##### estimateTokens? ```ts optional estimateTokens?: (text) => number; ``` Defined in: [providers/claude.ts:137](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/claude.ts#L137) Optional token estimator function (e.g., tiktoken). When provided, debug payload reports token counts instead of char-based estimates. Fallback: Math.ceil(text.length / 4) ###### Parameters | Parameter | Type | | ------ | ------ | | `text` | `string` | ###### Returns `number` ##### maxTokens? ```ts optional maxTokens?: number; ``` Defined in: [providers/claude.ts:109](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/claude.ts#L109) Default max tokens ###### Default ```ts 4096 ``` ##### model? ```ts optional model?: string; ``` Defined in: [providers/claude.ts:98](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/claude.ts#L98) Default model to use ###### Default ```ts 'claude-sonnet-4-6' ``` *** ### CompactionConfig Defined in: [context/types.ts:233](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L233) Compaction configuration - replaces old content with file references #### Properties ##### minTokensToCompact ```ts minTokensToCompact: number; ``` Defined in: [context/types.ts:256](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L256) Minimum tokens in a message to consider for compaction ###### Default ```ts 1000 ``` ##### preserveRecentTurns ```ts preserveRecentTurns: number; ``` Defined in: [context/types.ts:250](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L250) Number of recent turns to preserve (not compact) ###### Default ```ts 10 ``` ##### triggerInterval ```ts triggerInterval: number; ``` Defined in: [context/types.ts:238](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L238) Trigger compaction every N turns ###### Default ```ts 20 ``` ##### triggerThreshold ```ts triggerThreshold: number; ``` Defined in: [context/types.ts:244](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L244) Trigger compaction when context utilization exceeds this threshold ###### Default ```ts 0.5 (50%) ``` *** ### CompactionResult Defined in: [context/types.ts:315](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L315) Result of a compaction operation #### Properties ##### filesCreated ```ts filesCreated: string[]; ``` Defined in: [context/types.ts:339](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L339) Files created during compaction (for reversibility) ##### messagesAfter ```ts messagesAfter: number; ``` Defined in: [context/types.ts:324](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L324) Number of messages after compaction ##### messagesBefore ```ts messagesBefore: number; ``` Defined in: [context/types.ts:319](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L319) Number of messages before compaction ##### tokensAfter ```ts tokensAfter: number; ``` Defined in: [context/types.ts:334](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L334) Total tokens after compaction ##### tokensBefore ```ts tokensBefore: number; ``` Defined in: [context/types.ts:329](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L329) Total tokens before compaction *** ### ContextConfig Defined in: [context/types.ts:171](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L171) Context management configuration #### Properties ##### budget ```ts budget: BudgetAllocation; ``` Defined in: [context/types.ts:182](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L182) Budget allocation for each category Enables category-specific compaction ##### compaction ```ts compaction: CompactionConfig; ``` Defined in: [context/types.ts:198](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L198) Compaction configuration ##### filtering ```ts filtering: FilteringConfig; ``` Defined in: [context/types.ts:193](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L193) Filtering configuration ##### maxContextTokens ```ts maxContextTokens: number; ``` Defined in: [context/types.ts:176](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L176) Maximum tokens for the context window ###### Default ```ts 200000 (Claude's limit) ``` ##### summarization ```ts summarization: SummarizationConfig; ``` Defined in: [context/types.ts:203](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L203) Summarization configuration ##### verbosity ```ts verbosity: VerbosityConfig; ``` Defined in: [context/types.ts:188](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L188) Verbosity level thresholds Controls graceful degradation *** ### ContextManagerOptions Defined in: [context/manager.ts:94](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/manager.ts#L94) Options for creating a ContextManager #### Properties ##### config? ```ts optional config?: Partial; ``` Defined in: [context/manager.ts:103](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/manager.ts#L103) Configuration overrides ##### fileTracker? ```ts optional fileTracker?: FileAccessTracker; ``` Defined in: [context/manager.ts:115](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/manager.ts#L115) File access tracker for context restoration hints. When provided, compaction/summarization will inject hints about previously accessed files. ##### onEvent? ```ts optional onEvent?: ContextEventHandler; ``` Defined in: [context/manager.ts:108](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/manager.ts#L108) Event handler for context events ##### provider ```ts provider: LLMProvider; ``` Defined in: [context/manager.ts:98](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/manager.ts#L98) LLM provider (for token counting) *** ### ContextStats Defined in: [context/types.ts:538](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L538) Context statistics #### Properties ##### compactionCount ```ts compactionCount: number; ``` Defined in: [context/types.ts:567](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L567) Number of compactions performed ##### currentTokens ```ts currentTokens: number; ``` Defined in: [context/types.ts:542](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L542) Current token count ##### maxTokens ```ts maxTokens: number; ``` Defined in: [context/types.ts:547](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L547) Maximum tokens allowed ##### messageCount ```ts messageCount: number; ``` Defined in: [context/types.ts:557](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L557) Number of messages in history ##### summarizationCount ```ts summarizationCount: number; ``` Defined in: [context/types.ts:572](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L572) Number of summarizations performed ##### turnCount ```ts turnCount: number; ``` Defined in: [context/types.ts:562](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L562) Number of turns (user message + assistant response pairs) ##### utilization ```ts utilization: number; ``` Defined in: [context/types.ts:552](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L552) Current utilization (0.0 - 1.0) *** ### CustomEventConfig Defined in: [agent.ts:162](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L162) Custom event configuration #### Properties ##### data ```ts data: unknown; ``` Defined in: [agent.ts:171](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L171) Event data payload ##### metadata? ```ts optional metadata?: Record; ``` Defined in: [agent.ts:176](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L176) Optional metadata (preserved through the event pipeline) ##### name ```ts name: string; ``` Defined in: [agent.ts:166](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L166) Event name (used for filtering/routing) *** ### DefineToolOptions Defined in: [tools/define.ts:10](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/define.ts#L10) Options for defining a tool #### Type Parameters | Type Parameter | | ------ | | `T` *extends* `object` | #### Properties ##### description ```ts description: string; ``` Defined in: [tools/define.ts:19](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/define.ts#L19) Description of what the tool does (shown to LLM) ##### execute ```ts execute: (input) => Promise; ``` Defined in: [tools/define.ts:29](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/define.ts#L29) Function that executes the tool ###### Parameters | Parameter | Type | | ------ | ------ | | `input` | `T` | ###### Returns `Promise`\<[`ToolExecutionResult`](#toolexecutionresult)\> ##### inputSchema ```ts inputSchema: ToolInputSchema; ``` Defined in: [tools/define.ts:24](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/define.ts#L24) JSON Schema for the tool's input parameters ##### name ```ts name: string; ``` Defined in: [tools/define.ts:14](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/define.ts#L14) Unique name for the tool ##### parallel? ```ts optional parallel?: boolean; ``` Defined in: [tools/define.ts:37](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/define.ts#L37) If true, multiple calls to this tool can execute in parallel. When the LLM requests multiple parallel-safe tools in one response, they will be executed concurrently using Promise.all. Default: false (sequential execution) ##### readonly? ```ts optional readonly?: boolean; ``` Defined in: [tools/define.ts:52](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/define.ts#L52) If true, this tool performs no side effects (only reads data). Read-only tools are automatically batched for parallel execution even in a mixed batch with write tools. Default: false ##### repeatable? ```ts optional repeatable?: boolean; ``` Defined in: [tools/define.ts:57](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/define.ts#L57) If true, this tool is exempt from tool-loop detection (repeated identical calls are always legitimate). Default: false. ##### silent? ```ts optional silent?: boolean; ``` Defined in: [tools/define.ts:44](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/define.ts#L44) If true, this tool runs silently without spinner updates or result output. Used for internal housekeeping tools like todo_read, suggest, etc. Default: false (normal visibility) *** ### DelegatedResultStoreStats Defined in: [context/delegated-result-store.ts:14](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/delegated-result-store.ts#L14) Statistics about the delegation store. #### Properties ##### maxSize ```ts maxSize: number; ``` Defined in: [context/delegated-result-store.ts:19](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/delegated-result-store.ts#L19) Maximum capacity (LRU limit) ##### size ```ts size: number; ``` Defined in: [context/delegated-result-store.ts:16](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/delegated-result-store.ts#L16) Number of currently stored results ##### totalEvicted ```ts totalEvicted: number; ``` Defined in: [context/delegated-result-store.ts:25](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/delegated-result-store.ts#L25) Total results evicted (TTL or LRU) ##### totalRecalled ```ts totalRecalled: number; ``` Defined in: [context/delegated-result-store.ts:28](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/delegated-result-store.ts#L28) Total results successfully recalled ##### totalStored ```ts totalStored: number; ``` Defined in: [context/delegated-result-store.ts:22](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/delegated-result-store.ts#L22) Total results stored since creation *** ### DelegationConfig Defined in: [context/delegation-types.ts:13](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/delegation-types.ts#L13) Configuration for tool result delegation. Controls when and how large tool results are summarized. #### Properties ##### delegationThreshold ```ts delegationThreshold: number; ``` Defined in: [context/delegation-types.ts:18](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/delegation-types.ts#L18) Token count above which results are delegated. Default: 8000 ##### enabled ```ts enabled: boolean; ``` Defined in: [context/delegation-types.ts:15](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/delegation-types.ts#L15) Whether delegation is enabled. Default: false (opt-in) ##### maxStoredResults ```ts maxStoredResults: number; ``` Defined in: [context/delegation-types.ts:27](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/delegation-types.ts#L27) Maximum number of stored results (LRU eviction). Default: 50 ##### resultTTL ```ts resultTTL: number; ``` Defined in: [context/delegation-types.ts:24](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/delegation-types.ts#L24) Milliseconds before stored results expire. Default: 600_000 (10 min) ##### strategy ```ts strategy: "llm" | "extractive" | "auto"; ``` Defined in: [context/delegation-types.ts:30](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/delegation-types.ts#L30) Summarization strategy. Default: 'auto' ##### summaryMaxTokens ```ts summaryMaxTokens: number; ``` Defined in: [context/delegation-types.ts:21](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/delegation-types.ts#L21) Maximum tokens for the summary. Default: 800 ##### toolOverrides? ```ts optional toolOverrides?: Record; ``` Defined in: [context/delegation-types.ts:33](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/delegation-types.ts#L33) Per-tool threshold/strategy overrides *** ### EditInput Defined in: [tools/builtin/edit.ts:14](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/edit.ts#L14) Input parameters for edit tool #### Properties ##### createIfMissing? ```ts optional createIfMissing?: boolean; ``` Defined in: [tools/builtin/edit.ts:38](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/edit.ts#L38) Create the file if it doesn't exist (default: false) ##### filePath ```ts filePath: string; ``` Defined in: [tools/builtin/edit.ts:18](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/edit.ts#L18) Path to the file to edit ##### newString ```ts newString: string; ``` Defined in: [tools/builtin/edit.ts:28](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/edit.ts#L28) The replacement text ##### oldString ```ts oldString: string; ``` Defined in: [tools/builtin/edit.ts:23](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/edit.ts#L23) The text to search for (must be unique in the file) ##### replaceAll? ```ts optional replaceAll?: boolean; ``` Defined in: [tools/builtin/edit.ts:33](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/edit.ts#L33) Replace all occurrences (default: false, requires unique match) *** ### EffortSignals Defined in: [episodes/types.ts:82](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L82) Raw signals used to estimate effort. These are collected from tool calls and timing data. #### Properties ##### complexityIndicators ```ts complexityIndicators: { configChanges?: boolean; multiLanguage?: boolean; newFiles?: boolean; tests?: boolean; }; ``` Defined in: [episodes/types.ts:99](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L99) Complexity indicators detected ###### configChanges? ```ts optional configChanges?: boolean; ``` Config files were modified ###### multiLanguage? ```ts optional multiLanguage?: boolean; ``` Multiple languages involved ###### newFiles? ```ts optional newFiles?: boolean; ``` New files were created (not just edited) ###### tests? ```ts optional tests?: boolean; ``` Test files were created or modified ##### durationMs ```ts durationMs: number; ``` Defined in: [episodes/types.ts:93](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L93) Duration in milliseconds ##### fileCount ```ts fileCount: number; ``` Defined in: [episodes/types.ts:84](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L84) Number of unique files touched ##### iterationCount ```ts iterationCount: number; ``` Defined in: [episodes/types.ts:96](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L96) Number of edit/write iterations on same files ##### linesChanged ```ts linesChanged: number; ``` Defined in: [episodes/types.ts:87](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L87) Total lines changed (added + removed) ##### toolCallCount ```ts toolCallCount: number; ``` Defined in: [episodes/types.ts:90](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L90) Total number of tool calls *** ### EffortSummary Defined in: [episodes/types.ts:136](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L136) Summary of effort across multiple episodes. #### Properties ##### agents ```ts agents: string[]; ``` Defined in: [episodes/types.ts:147](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L147) Unique agent IDs involved ##### description ```ts description: string; ``` Defined in: [episodes/types.ts:150](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L150) Human-readable description ##### episodeCount ```ts episodeCount: number; ``` Defined in: [episodes/types.ts:138](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L138) Number of episodes included ##### timeSpentMs ```ts timeSpentMs: number; ``` Defined in: [episodes/types.ts:144](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L144) Total time spent in milliseconds ##### totalEffort ```ts totalEffort: Effort; ``` Defined in: [episodes/types.ts:141](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L141) Maximum effort level across episodes *** ### EffortWeights Defined in: [episodes/types.ts:115](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L115) Tunable weights for effort estimation. All weights are multipliers or divisors applied to raw signals. #### Properties ##### fileCountMultiplier ```ts fileCountMultiplier: number; ``` Defined in: [episodes/types.ts:117](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L117) Points per file (default: 2) ##### linesPerPoint ```ts linesPerPoint: number; ``` Defined in: [episodes/types.ts:120](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L120) Lines per point (default: 50) — higher means lines matter less ##### minutesPerPoint ```ts minutesPerPoint: number; ``` Defined in: [episodes/types.ts:123](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L123) Minutes per point (default: 1) ##### toolCallWeight ```ts toolCallWeight: number; ``` Defined in: [episodes/types.ts:126](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L126) Points per tool call (default: 1) *** ### EndSpanOptions Defined in: [tracing/types.ts:193](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L193) Options for ending a span #### Properties ##### attributes? ```ts optional attributes?: SpanAttributes; ``` Defined in: [tracing/types.ts:201](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L201) Additional attributes to add ##### endTime? ```ts optional endTime?: number; ``` Defined in: [tracing/types.ts:195](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L195) End time override (default: now) ##### status? ```ts optional status?: SpanStatus; ``` Defined in: [tracing/types.ts:197](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L197) Final status ##### statusMessage? ```ts optional statusMessage?: string; ``` Defined in: [tracing/types.ts:199](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L199) Status message *** ### EpisodeStore Defined in: [episodes/types.ts:215](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L215) Persistence interface for work episodes. Write methods may be async (for file I/O), read methods are synchronous (read from in-memory cache). #### Methods ##### cleanup() ```ts cleanup(maxAgeMs): number | Promise; ``` Defined in: [episodes/types.ts:247](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L247) Remove episodes older than maxAge milliseconds. Returns count removed. ###### Parameters | Parameter | Type | | ------ | ------ | | `maxAgeMs` | `number` | ###### Returns `number` \| `Promise`\<`number`\> ##### getAll() ```ts getAll(): WorkEpisode[]; ``` Defined in: [episodes/types.ts:223](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L223) Get all episodes ###### Returns [`WorkEpisode`](#workepisode)[] ##### getByAgent() ```ts getByAgent(agentId): WorkEpisode[]; ``` Defined in: [episodes/types.ts:229](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L229) Get episodes by agent ID ###### Parameters | Parameter | Type | | ------ | ------ | | `agentId` | `string` | ###### Returns [`WorkEpisode`](#workepisode)[] ##### getByFiles() ```ts getByFiles(files): WorkEpisode[]; ``` Defined in: [episodes/types.ts:226](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L226) Get episodes for specific files ###### Parameters | Parameter | Type | | ------ | ------ | | `files` | `string`[] | ###### Returns [`WorkEpisode`](#workepisode)[] ##### getBySession() ```ts getBySession(sessionId): WorkEpisode[]; ``` Defined in: [episodes/types.ts:232](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L232) Get episodes by session ID ###### Parameters | Parameter | Type | | ------ | ------ | | `sessionId` | `string` | ###### Returns [`WorkEpisode`](#workepisode)[] ##### getByTimeRange() ```ts getByTimeRange(start, end): WorkEpisode[]; ``` Defined in: [episodes/types.ts:235](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L235) Get episodes within a time range (ISO timestamps) ###### Parameters | Parameter | Type | | ------ | ------ | | `start` | `string` | | `end` | `string` | ###### Returns [`WorkEpisode`](#workepisode)[] ##### getRecent() ```ts getRecent(count): WorkEpisode[]; ``` Defined in: [episodes/types.ts:238](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L238) Get the N most recent episodes ###### Parameters | Parameter | Type | | ------ | ------ | | `count` | `number` | ###### Returns [`WorkEpisode`](#workepisode)[] ##### getTotalEffort() ```ts getTotalEffort(episodes?): Effort; ``` Defined in: [episodes/types.ts:244](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L244) Get the maximum effort level across all episodes (or a subset) ###### Parameters | Parameter | Type | | ------ | ------ | | `episodes?` | [`WorkEpisode`](#workepisode)[] | ###### Returns [`Effort`](#effort-1) ##### getWorkSummary() ```ts getWorkSummary(): ProjectWorkSummary; ``` Defined in: [episodes/types.ts:241](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L241) Get project work summary ###### Returns [`ProjectWorkSummary`](#projectworksummary) ##### save() ```ts save(episode): void | Promise; ``` Defined in: [episodes/types.ts:217](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L217) Save a single episode ###### Parameters | Parameter | Type | | ------ | ------ | | `episode` | [`WorkEpisode`](#workepisode) | ###### Returns `void` \| `Promise`\<`void`\> ##### saveBatch() ```ts saveBatch(episodes): void | Promise; ``` Defined in: [episodes/types.ts:220](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L220) Save multiple episodes at once ###### Parameters | Parameter | Type | | ------ | ------ | | `episodes` | [`WorkEpisode`](#workepisode)[] | ###### Returns `void` \| `Promise`\<`void`\> *** ### ErrorHookContext Defined in: [hooks/types.ts:308](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L308) Context for error hooks #### Extends - [`HookContext`](#hookcontext) #### Properties ##### error ```ts error: Error; ``` Defined in: [hooks/types.ts:312](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L312) The error that occurred ##### iteration ```ts iteration: number; ``` Defined in: [hooks/types.ts:28](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L28) Current iteration number (1-indexed) ###### Inherited from [`HookContext`](#hookcontext).[`iteration`](#iteration-3) ##### metadata ```ts metadata: Record; ``` Defined in: [hooks/types.ts:38](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L38) Custom metadata that can be passed between hooks ###### Inherited from [`HookContext`](#hookcontext).[`metadata`](#metadata-6) ##### phase ```ts phase: "llm" | "tool" | "iteration"; ``` Defined in: [hooks/types.ts:317](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L317) Phase where the error occurred ##### sessionId ```ts sessionId: string; ``` Defined in: [hooks/types.ts:23](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L23) Current session ID ###### Inherited from [`HookContext`](#hookcontext).[`sessionId`](#sessionid-6) ##### signal? ```ts optional signal?: AbortSignal; ``` Defined in: [hooks/types.ts:33](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L33) Abort signal for cancellation ###### Inherited from [`HookContext`](#hookcontext).[`signal`](#signal-4) ##### toolName? ```ts optional toolName?: string; ``` Defined in: [hooks/types.ts:322](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L322) Tool name (if error occurred during tool execution) *** ### ErrorHookResult Defined in: [hooks/types.ts:328](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L328) Result from error hook that can recover or transform the error #### Properties ##### error? ```ts optional error?: Error; ``` Defined in: [hooks/types.ts:337](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L337) Transformed error to throw instead ##### handled? ```ts optional handled?: boolean; ``` Defined in: [hooks/types.ts:332](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L332) Whether to suppress the error and continue ##### recovery? ```ts optional recovery?: ToolExecutionResult; ``` Defined in: [hooks/types.ts:342](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L342) Recovery result (for tool errors, replaces failed result) *** ### FifoDetectionResult Defined in: [tools/builtin/bash.ts:104](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/bash.ts#L104) FIFO detection result #### Properties ##### detected ```ts detected: boolean; ``` Defined in: [tools/builtin/bash.ts:108](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/bash.ts#L108) Whether potential FIFO/pipe usage was detected ##### patterns ```ts patterns: string[]; ``` Defined in: [tools/builtin/bash.ts:113](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/bash.ts#L113) Patterns that matched ##### warning? ```ts optional warning?: string; ``` Defined in: [tools/builtin/bash.ts:118](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/bash.ts#L118) Warning message to display *** ### FileAccess Defined in: [context/file-tracker.ts:32](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/file-tracker.ts#L32) Record of a file access #### Properties ##### content? ```ts optional content?: string; ``` Defined in: [context/file-tracker.ts:49](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/file-tracker.ts#L49) Stored file content (only for small reads, used for post-compaction restoration) ##### lineCount? ```ts optional lineCount?: number; ``` Defined in: [context/file-tracker.ts:43](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/file-tracker.ts#L43) Number of lines (for 'read' type) ##### path ```ts path: string; ``` Defined in: [context/file-tracker.ts:34](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/file-tracker.ts#L34) Absolute file path ##### summary? ```ts optional summary?: string; ``` Defined in: [context/file-tracker.ts:46](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/file-tracker.ts#L46) Optional summary of what was found/changed ##### timestamp ```ts timestamp: number; ``` Defined in: [context/file-tracker.ts:40](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/file-tracker.ts#L40) When accessed (timestamp) ##### tokenCount? ```ts optional tokenCount?: number; ``` Defined in: [context/file-tracker.ts:52](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/file-tracker.ts#L52) Token count of stored content ##### type ```ts type: FileAccessType; ``` Defined in: [context/file-tracker.ts:37](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/file-tracker.ts#L37) Type of access *** ### FileAccessStats Defined in: [context/file-tracker.ts:129](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/file-tracker.ts#L129) Statistics about file accesses #### Properties ##### modified ```ts modified: number; ``` Defined in: [context/file-tracker.ts:132](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/file-tracker.ts#L132) ##### read ```ts read: number; ``` Defined in: [context/file-tracker.ts:130](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/file-tracker.ts#L130) ##### referenced ```ts referenced: number; ``` Defined in: [context/file-tracker.ts:131](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/file-tracker.ts#L131) ##### total ```ts total: number; ``` Defined in: [context/file-tracker.ts:133](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/file-tracker.ts#L133) *** ### FileAccessTrackerOptions Defined in: [context/file-tracker.ts:58](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/file-tracker.ts#L58) Options for FileAccessTracker constructor #### Properties ##### deduplicateReferences? ```ts optional deduplicateReferences?: boolean; ``` Defined in: [context/file-tracker.ts:69](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/file-tracker.ts#L69) Deduplicate references (don't track same file twice as 'referenced') ###### Default ```ts true ``` ##### inlineThreshold? ```ts optional inlineThreshold?: number; ``` Defined in: [context/file-tracker.ts:76](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/file-tracker.ts#L76) Maximum line count for a file to have its content stored inline. Files with more lines than this threshold will only store path/lineCount. ###### Default ```ts 200 ``` ##### maxContentEntries? ```ts optional maxContentEntries?: number; ``` Defined in: [context/file-tracker.ts:83](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/file-tracker.ts#L83) Maximum number of files that can have stored content at once. When exceeded, oldest content entries are evicted (path still tracked). ###### Default ```ts 10 ``` ##### maxEntries? ```ts optional maxEntries?: number; ``` Defined in: [context/file-tracker.ts:63](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/file-tracker.ts#L63) Maximum number of entries to track ###### Default ```ts 100 ``` *** ### FileCheckpointerOptions Defined in: [state/checkpointer.ts:227](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/checkpointer.ts#L227) Options for FileCheckpointer #### Properties ##### extension? ```ts optional extension?: string; ``` Defined in: [state/checkpointer.ts:236](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/checkpointer.ts#L236) File extension (defaults to '.json') ##### serializer? ```ts optional serializer?: StateSerializer; ``` Defined in: [state/checkpointer.ts:231](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/checkpointer.ts#L231) Custom serializer (defaults to JsonSerializer) *** ### FilePattern Defined in: [memory/types.ts:54](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/types.ts#L54) File pattern configuration for discovery #### Properties ##### description? ```ts optional description?: string; ``` Defined in: [memory/types.ts:60](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/types.ts#L60) Description of what this pattern matches ##### pattern ```ts pattern: string; ``` Defined in: [memory/types.ts:56](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/types.ts#L56) Glob pattern or exact filename ##### priority ```ts priority: number; ``` Defined in: [memory/types.ts:58](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/types.ts#L58) Priority (lower = higher priority, loaded first) *** ### FilteringConfig Defined in: [context/types.ts:209](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L209) Filtering configuration - applied before adding to context #### Properties ##### maxErrorLines ```ts maxErrorLines: number; ``` Defined in: [context/types.ts:227](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L227) Maximum lines for error traces ###### Default ```ts 50 ``` ##### maxFileLines ```ts maxFileLines: number; ``` Defined in: [context/types.ts:221](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L221) Maximum lines for file content ###### Default ```ts 500 ``` ##### maxToolResultTokens ```ts maxToolResultTokens: number; ``` Defined in: [context/types.ts:215](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L215) Maximum tokens for a single tool result Results larger than this will be truncated ###### Default ```ts 80000 ``` *** ### FilteringResult Defined in: [context/types.ts:380](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L380) Result of a filtering operation #### Properties ##### filtered ```ts filtered: boolean; ``` Defined in: [context/types.ts:384](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L384) Whether the content was filtered ##### filteredTokens ```ts filteredTokens: number; ``` Defined in: [context/types.ts:394](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L394) Token count after filtering ##### originalTokens ```ts originalTokens: number; ``` Defined in: [context/types.ts:389](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L389) Original token count ##### savedToFile? ```ts optional savedToFile?: string; ``` Defined in: [context/types.ts:399](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L399) Path to file where full content was saved (if filtered) *** ### FireworksProviderConfig Defined in: [providers/fireworks.ts:32](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/fireworks.ts#L32) Configuration for FireworksProvider #### Properties ##### apiKey? ```ts optional apiKey?: string; ``` Defined in: [providers/fireworks.ts:34](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/fireworks.ts#L34) Fireworks AI API key (falls back to FIREWORKS_API_KEY env var) ##### baseUrl? ```ts optional baseUrl?: string; ``` Defined in: [providers/fireworks.ts:36](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/fireworks.ts#L36) Base URL for Fireworks API (default: https://api.fireworks.ai/inference) ##### estimateTokens? ```ts optional estimateTokens?: (text) => number; ``` Defined in: [providers/fireworks.ts:44](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/fireworks.ts#L44) Optional token estimator (e.g., tiktoken) for debug payload ###### Parameters | Parameter | Type | | ------ | ------ | | `text` | `string` | ###### Returns `number` ##### maxTokens? ```ts optional maxTokens?: number; ``` Defined in: [providers/fireworks.ts:40](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/fireworks.ts#L40) Default max tokens (default: 4096) ##### model? ```ts optional model?: string; ``` Defined in: [providers/fireworks.ts:38](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/fireworks.ts#L38) Default model to use (default: accounts/fireworks/models/llama-v3p1-8b-instruct) ##### timeout? ```ts optional timeout?: number; ``` Defined in: [providers/fireworks.ts:42](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/fireworks.ts#L42) Request timeout in milliseconds (default: 120000) *** ### FormatHintsOptions Defined in: [context/file-tracker.ts:89](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/file-tracker.ts#L89) Options for formatting restoration hints #### Properties ##### groupByType? ```ts optional groupByType?: boolean; ``` Defined in: [context/file-tracker.ts:100](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/file-tracker.ts#L100) Group by access type ###### Default ```ts true ``` ##### includeLineCount? ```ts optional includeLineCount?: boolean; ``` Defined in: [context/file-tracker.ts:91](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/file-tracker.ts#L91) Include line counts for read files ###### Default ```ts true ``` ##### includeSummary? ```ts optional includeSummary?: boolean; ``` Defined in: [context/file-tracker.ts:94](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/file-tracker.ts#L94) Include summaries ###### Default ```ts false ``` ##### includeTimestamp? ```ts optional includeTimestamp?: boolean; ``` Defined in: [context/file-tracker.ts:97](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/file-tracker.ts#L97) Include timestamps ###### Default ```ts false ``` ##### maxFiles? ```ts optional maxFiles?: number; ``` Defined in: [context/file-tracker.ts:103](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/file-tracker.ts#L103) Maximum files to include ###### Default ```ts 20 ``` ##### verbosityLevel? ```ts optional verbosityLevel?: VerbosityLevel; ``` Defined in: [context/file-tracker.ts:106](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/file-tracker.ts#L106) Verbosity level (adjusts format automatically) *** ### FromStateOptions Defined in: [state/types.ts:371](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L371) Options for creating agent from exported state. #### Properties ##### checkpointer? ```ts optional checkpointer?: Checkpointer; ``` Defined in: [state/types.ts:380](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L380) Optional checkpointer for subsequent saves ##### onEvent? ```ts optional onEvent?: (event) => void; ``` Defined in: [state/types.ts:390](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L390) Event handler ###### Parameters | Parameter | Type | | ------ | ------ | | `event` | `unknown` | ###### Returns `void` ##### provider ```ts provider: unknown; ``` Defined in: [state/types.ts:375](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L375) LLM provider to use ##### tools? ```ts optional tools?: unknown[]; ``` Defined in: [state/types.ts:385](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L385) Override saved tools *** ### GeminiLegacyProviderConfig Defined in: [providers/gemini.ts:33](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/gemini.ts#L33) Configuration for GeminiProvider #### Properties ##### apiKey? ```ts optional apiKey?: string; ``` Defined in: [providers/gemini.ts:35](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/gemini.ts#L35) Google AI API key (falls back to GOOGLE_AI_API_KEY or GEMINI_API_KEY env var) ##### baseUrl? ```ts optional baseUrl?: string; ``` Defined in: [providers/gemini.ts:37](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/gemini.ts#L37) Base URL for Gemini API (default: https://generativelanguage.googleapis.com/v1beta/openai) ##### maxTokens? ```ts optional maxTokens?: number; ``` Defined in: [providers/gemini.ts:41](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/gemini.ts#L41) Default max tokens (default: 4096) ##### model? ```ts optional model?: string; ``` Defined in: [providers/gemini.ts:39](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/gemini.ts#L39) Default model to use (default: gemini-2.0-flash) ##### timeout? ```ts optional timeout?: number; ``` Defined in: [providers/gemini.ts:43](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/gemini.ts#L43) Request timeout in milliseconds (default: 120000) *** ### GeminiProviderConfig Defined in: [providers/gemini-native.ts:39](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/gemini-native.ts#L39) Configuration for GeminiNativeProvider #### Properties ##### apiKey ```ts apiKey: string; ``` Defined in: [providers/gemini-native.ts:43](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/gemini-native.ts#L43) Google AI API key ##### estimateTokens? ```ts optional estimateTokens?: (text) => number; ``` Defined in: [providers/gemini-native.ts:62](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/gemini-native.ts#L62) Optional token estimator function (e.g., tiktoken). When provided, debug payload reports token counts instead of char-based estimates. Fallback: Math.ceil(text.length / 4) ###### Parameters | Parameter | Type | | ------ | ------ | | `text` | `string` | ###### Returns `number` ##### maxTokens? ```ts optional maxTokens?: number; ``` Defined in: [providers/gemini-native.ts:55](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/gemini-native.ts#L55) Default max tokens ###### Default ```ts 4096 ``` ##### model? ```ts optional model?: string; ``` Defined in: [providers/gemini-native.ts:49](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/gemini-native.ts#L49) Default model to use ###### Default ```ts 'gemini-2.5-flash' ``` *** ### GlobInput Defined in: [tools/builtin/glob.ts:38](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/glob.ts#L38) Input parameters for glob tool #### Properties ##### absolute? ```ts optional absolute?: boolean; ``` Defined in: [tools/builtin/glob.ts:77](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/glob.ts#L77) Return absolute paths instead of relative (default: false) ##### excludeDirs? ```ts optional excludeDirs?: string[]; ``` Defined in: [tools/builtin/glob.ts:84](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/glob.ts#L84) Directory names to exclude from search. Default excludes: node_modules, .git, dist, build, etc. Set to empty array [] to include all directories. ##### includeHidden? ```ts optional includeHidden?: boolean; ``` Defined in: [tools/builtin/glob.ts:52](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/glob.ts#L52) Include hidden files and directories (default: false) ##### maxDepth? ```ts optional maxDepth?: number; ``` Defined in: [tools/builtin/glob.ts:67](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/glob.ts#L67) Maximum depth to traverse (default: unlimited) ##### maxResults? ```ts optional maxResults?: number; ``` Defined in: [tools/builtin/glob.ts:72](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/glob.ts#L72) Maximum number of results (default: 1000) ##### onlyDirectories? ```ts optional onlyDirectories?: boolean; ``` Defined in: [tools/builtin/glob.ts:57](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/glob.ts#L57) Only match directories (default: false) ##### onlyFiles? ```ts optional onlyFiles?: boolean; ``` Defined in: [tools/builtin/glob.ts:62](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/glob.ts#L62) Only match files (default: true) ##### path? ```ts optional path?: string; ``` Defined in: [tools/builtin/glob.ts:47](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/glob.ts#L47) Base directory to search in (default: current directory) ##### pattern ```ts pattern: string; ``` Defined in: [tools/builtin/glob.ts:42](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/glob.ts#L42) Glob pattern to match files against (e.g., "**/*.ts", "src/*.js") *** ### GrepInput Defined in: [tools/builtin/grep.ts:39](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/grep.ts#L39) Input parameters for grep tool #### Properties ##### after? ```ts optional after?: number; ``` Defined in: [tools/builtin/grep.ts:68](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/grep.ts#L68) Number of context lines after match (default: 0) ##### before? ```ts optional before?: number; ``` Defined in: [tools/builtin/grep.ts:63](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/grep.ts#L63) Number of context lines before match (default: 0) ##### excludeDirs? ```ts optional excludeDirs?: string[]; ``` Defined in: [tools/builtin/grep.ts:100](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/grep.ts#L100) Directory names to exclude from search. Default excludes: node_modules, .git, dist, build, etc. Set to empty array [] to include all directories. ##### extensions? ```ts optional extensions?: string[]; ``` Defined in: [tools/builtin/grep.ts:83](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/grep.ts#L83) File extensions to include (e.g., ['.ts', '.js']) ##### filesOnly? ```ts optional filesOnly?: boolean; ``` Defined in: [tools/builtin/grep.ts:73](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/grep.ts#L73) Only return filenames with matches (default: false) ##### ignoreCase? ```ts optional ignoreCase?: boolean; ``` Defined in: [tools/builtin/grep.ts:53](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/grep.ts#L53) Case insensitive search (default: false) ##### includeHidden? ```ts optional includeHidden?: boolean; ``` Defined in: [tools/builtin/grep.ts:78](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/grep.ts#L78) Include hidden files/directories (default: false) ##### lineNumbers? ```ts optional lineNumbers?: boolean; ``` Defined in: [tools/builtin/grep.ts:58](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/grep.ts#L58) Include line numbers in output (default: true) ##### maxMatches? ```ts optional maxMatches?: number; ``` Defined in: [tools/builtin/grep.ts:88](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/grep.ts#L88) Maximum number of matches to return (default: 100) ##### path ```ts path: string; ``` Defined in: [tools/builtin/grep.ts:48](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/grep.ts#L48) Path to file or directory to search in ##### pattern ```ts pattern: string; ``` Defined in: [tools/builtin/grep.ts:43](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/grep.ts#L43) Regular expression pattern to search for ##### recursive? ```ts optional recursive?: boolean; ``` Defined in: [tools/builtin/grep.ts:93](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/grep.ts#L93) Search recursively in directories (default: true) *** ### GroqProviderConfig Defined in: [providers/groq.ts:32](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/groq.ts#L32) Configuration for GroqProvider #### Properties ##### apiKey? ```ts optional apiKey?: string; ``` Defined in: [providers/groq.ts:34](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/groq.ts#L34) Groq API key (falls back to GROQ_API_KEY env var) ##### baseUrl? ```ts optional baseUrl?: string; ``` Defined in: [providers/groq.ts:36](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/groq.ts#L36) Base URL for Groq API (default: https://api.groq.com/openai) ##### estimateTokens? ```ts optional estimateTokens?: (text) => number; ``` Defined in: [providers/groq.ts:44](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/groq.ts#L44) Optional token estimator (e.g., tiktoken) for debug payload ###### Parameters | Parameter | Type | | ------ | ------ | | `text` | `string` | ###### Returns `number` ##### maxTokens? ```ts optional maxTokens?: number; ``` Defined in: [providers/groq.ts:40](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/groq.ts#L40) Default max tokens (default: 4096) ##### model? ```ts optional model?: string; ``` Defined in: [providers/groq.ts:38](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/groq.ts#L38) Default model to use (default: llama-3.2-8b-preview) ##### timeout? ```ts optional timeout?: number; ``` Defined in: [providers/groq.ts:42](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/groq.ts#L42) Request timeout in milliseconds (default: 120000) *** ### Guardrail Defined in: [guardrails/types.ts:19](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/types.ts#L19) A guardrail definition #### Properties ##### action ```ts action: GuardrailAction; ``` Defined in: [guardrails/types.ts:43](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/types.ts#L43) Action to take when triggered ##### description ```ts description: string; ``` Defined in: [guardrails/types.ts:33](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/types.ts#L33) Description of what this guardrail protects against ##### enabled? ```ts optional enabled?: boolean; ``` Defined in: [guardrails/types.ts:58](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/types.ts#L58) Whether this guardrail is enabled (default: true) ##### id ```ts id: string; ``` Defined in: [guardrails/types.ts:23](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/types.ts#L23) Unique identifier for this guardrail ##### message ```ts message: string; ``` Defined in: [guardrails/types.ts:48](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/types.ts#L48) Message to display when triggered ##### name ```ts name: string; ``` Defined in: [guardrails/types.ts:28](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/types.ts#L28) Human-readable name ##### patterns ```ts patterns: RegExp[]; ``` Defined in: [guardrails/types.ts:38](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/types.ts#L38) Patterns to match against tool inputs ##### scope? ```ts optional scope?: string[]; ``` Defined in: [guardrails/types.ts:53](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/types.ts#L53) Which tools this guardrail applies to (empty = all tools) ##### tags? ```ts optional tags?: string[]; ``` Defined in: [guardrails/types.ts:63](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/types.ts#L63) Tags for grouping/filtering guardrails *** ### GuardrailContext Defined in: [guardrails/types.ts:129](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/types.ts#L129) Context passed to guardrail handlers #### Properties ##### input ```ts input: unknown; ``` Defined in: [guardrails/types.ts:138](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/types.ts#L138) The tool input ##### inputString ```ts inputString: string; ``` Defined in: [guardrails/types.ts:143](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/types.ts#L143) The stringified input used for pattern matching ##### toolName ```ts toolName: string; ``` Defined in: [guardrails/types.ts:133](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/types.ts#L133) The tool being called *** ### GuardrailEvent Defined in: [guardrails/types.ts:196](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/types.ts#L196) Guardrail event payload #### Properties ##### context ```ts context: GuardrailContext; ``` Defined in: [guardrails/types.ts:199](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/types.ts#L199) ##### result ```ts result: GuardrailResult; ``` Defined in: [guardrails/types.ts:198](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/types.ts#L198) ##### type ```ts type: GuardrailEventType; ``` Defined in: [guardrails/types.ts:197](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/types.ts#L197) *** ### GuardrailInput Defined in: [guardrails/types.ts:69](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/types.ts#L69) Input for adding a custom guardrail #### Properties ##### action ```ts action: GuardrailAction; ``` Defined in: [guardrails/types.ts:74](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/types.ts#L74) ##### description ```ts description: string; ``` Defined in: [guardrails/types.ts:72](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/types.ts#L72) ##### enabled? ```ts optional enabled?: boolean; ``` Defined in: [guardrails/types.ts:77](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/types.ts#L77) ##### id ```ts id: string; ``` Defined in: [guardrails/types.ts:70](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/types.ts#L70) ##### message ```ts message: string; ``` Defined in: [guardrails/types.ts:75](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/types.ts#L75) ##### name ```ts name: string; ``` Defined in: [guardrails/types.ts:71](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/types.ts#L71) ##### patterns ```ts patterns: RegExp[]; ``` Defined in: [guardrails/types.ts:73](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/types.ts#L73) ##### scope? ```ts optional scope?: string[]; ``` Defined in: [guardrails/types.ts:76](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/types.ts#L76) ##### tags? ```ts optional tags?: string[]; ``` Defined in: [guardrails/types.ts:78](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/types.ts#L78) *** ### GuardrailManagerOptions Defined in: [guardrails/types.ts:161](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/types.ts#L161) Configuration for the GuardrailManager #### Properties ##### custom? ```ts optional custom?: GuardrailInput[]; ``` Defined in: [guardrails/types.ts:170](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/types.ts#L170) Custom guardrails to add ##### enabled? ```ts optional enabled?: boolean; ``` Defined in: [guardrails/types.ts:165](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/types.ts#L165) Enable guardrails (default: true) ##### includeDefaults? ```ts optional includeDefaults?: boolean; ``` Defined in: [guardrails/types.ts:175](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/types.ts#L175) Include built-in guardrails (default: true) ##### onTriggered? ```ts optional onTriggered?: GuardrailTriggeredHandler; ``` Defined in: [guardrails/types.ts:180](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/types.ts#L180) Handler called when a guardrail is triggered *** ### GuardrailResult Defined in: [guardrails/types.ts:84](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/types.ts#L84) Result of checking a guardrail #### Properties ##### action? ```ts optional action?: GuardrailAction; ``` Defined in: [guardrails/types.ts:103](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/types.ts#L103) The action to take ##### guardrail? ```ts optional guardrail?: Guardrail; ``` Defined in: [guardrails/types.ts:93](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/types.ts#L93) The guardrail that was triggered (if any) ##### input? ```ts optional input?: unknown; ``` Defined in: [guardrails/types.ts:113](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/types.ts#L113) The input that triggered the guardrail ##### match? ```ts optional match?: string; ``` Defined in: [guardrails/types.ts:98](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/types.ts#L98) The matched pattern (if any) ##### subcommand? ```ts optional subcommand?: string; ``` Defined in: [guardrails/types.ts:118](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/types.ts#L118) The specific subcommand that triggered (compound commands only) ##### subcommandIndex? ```ts optional subcommandIndex?: number; ``` Defined in: [guardrails/types.ts:123](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/types.ts#L123) 0-based index of the subcommand in the compound command ##### toolName? ```ts optional toolName?: string; ``` Defined in: [guardrails/types.ts:108](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/types.ts#L108) The tool that triggered the guardrail ##### triggered ```ts triggered: boolean; ``` Defined in: [guardrails/types.ts:88](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/types.ts#L88) Whether any guardrail was triggered *** ### HookContext Defined in: [hooks/types.ts:19](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L19) Context available in all hook calls #### Extended by - [`IterationHookContext`](#iterationhookcontext) - [`LLMHookContext`](#llmhookcontext) - [`ToolHookContext`](#toolhookcontext) - [`ErrorHookContext`](#errorhookcontext) #### Properties ##### iteration ```ts iteration: number; ``` Defined in: [hooks/types.ts:28](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L28) Current iteration number (1-indexed) ##### metadata ```ts metadata: Record; ``` Defined in: [hooks/types.ts:38](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L38) Custom metadata that can be passed between hooks ##### sessionId ```ts sessionId: string; ``` Defined in: [hooks/types.ts:23](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L23) Current session ID ##### signal? ```ts optional signal?: AbortSignal; ``` Defined in: [hooks/types.ts:33](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L33) Abort signal for cancellation *** ### HookEvent Defined in: [hooks/types.ts:455](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L455) Hook execution event payload #### Properties ##### durationMs? ```ts optional durationMs?: number; ``` Defined in: [hooks/types.ts:460](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L460) ##### error? ```ts optional error?: Error; ``` Defined in: [hooks/types.ts:461](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L461) ##### hookId? ```ts optional hookId?: string; ``` Defined in: [hooks/types.ts:458](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L458) ##### hookName? ```ts optional hookName?: string; ``` Defined in: [hooks/types.ts:459](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L459) ##### hookType ```ts hookType: keyof HooksConfig; ``` Defined in: [hooks/types.ts:457](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L457) ##### type ```ts type: HookEventType; ``` Defined in: [hooks/types.ts:456](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L456) *** ### HookRegistrationOptions Defined in: [hooks/types.ts:430](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L430) Options for hook registration #### Properties ##### name? ```ts optional name?: string; ``` Defined in: [hooks/types.ts:434](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L434) Name for debugging/logging ##### priority? ```ts optional priority?: number; ``` Defined in: [hooks/types.ts:439](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L439) Priority (lower = runs first, default: 0) *** ### HooksConfig Defined in: [hooks/types.ts:365](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L365) Configuration for the hooks system #### Properties ##### afterIteration? ```ts optional afterIteration?: AfterIterationHook[]; ``` Defined in: [hooks/types.ts:374](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L374) Hooks called after each iteration ##### afterLLM? ```ts optional afterLLM?: AfterLLMHook[]; ``` Defined in: [hooks/types.ts:384](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L384) Hooks called after LLM responses ##### afterTool? ```ts optional afterTool?: AfterToolHook[]; ``` Defined in: [hooks/types.ts:394](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L394) Hooks called after tool execution ##### beforeIteration? ```ts optional beforeIteration?: BeforeIterationHook[]; ``` Defined in: [hooks/types.ts:369](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L369) Hooks called before each iteration ##### beforeLLM? ```ts optional beforeLLM?: BeforeLLMHook[]; ``` Defined in: [hooks/types.ts:379](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L379) Hooks called before LLM calls ##### beforeTool? ```ts optional beforeTool?: BeforeToolHook[]; ``` Defined in: [hooks/types.ts:389](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L389) Hooks called before tool execution ##### onError? ```ts optional onError?: OnErrorHook[]; ``` Defined in: [hooks/types.ts:399](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L399) Hooks called when errors occur *** ### HooksManagerOptions Defined in: [hooks/manager.ts:38](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/manager.ts#L38) Options for creating a HooksManager #### Properties ##### hooks? ```ts optional hooks?: HooksConfig; ``` Defined in: [hooks/manager.ts:42](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/manager.ts#L42) Initial hooks configuration ##### onEvent? ```ts optional onEvent?: HookEventHandler; ``` Defined in: [hooks/manager.ts:47](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/manager.ts#L47) Event handler for hook lifecycle events *** ### InjectionDetectionResult Defined in: [guardrails/injection-detection.ts:166](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/injection-detection.ts#L166) Result of scanning content for injection #### Properties ##### detected ```ts detected: boolean; ``` Defined in: [guardrails/injection-detection.ts:168](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/injection-detection.ts#L168) Whether any injection was detected ##### matches ```ts matches: InjectionMatch[]; ``` Defined in: [guardrails/injection-detection.ts:170](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/injection-detection.ts#L170) All matches found ##### maxSeverity ```ts maxSeverity: "low" | "medium" | "high" | "none"; ``` Defined in: [guardrails/injection-detection.ts:172](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/injection-detection.ts#L172) Highest severity found ##### summary ```ts summary: string; ``` Defined in: [guardrails/injection-detection.ts:174](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/injection-detection.ts#L174) Summary message for the user/agent *** ### InjectionHookOptions Defined in: [guardrails/injection-hook.ts:33](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/injection-hook.ts#L33) #### Properties ##### additionalTools? ```ts optional additionalTools?: string[]; ``` Defined in: [guardrails/injection-hook.ts:37](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/injection-hook.ts#L37) Additional tool names to scan ##### minSeverity? ```ts optional minSeverity?: "low" | "medium" | "high"; ``` Defined in: [guardrails/injection-hook.ts:35](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/injection-hook.ts#L35) Minimum severity to trigger a warning (default: 'medium') ##### onDetected? ```ts optional onDetected?: (result, toolName) => void; ``` Defined in: [guardrails/injection-hook.ts:39](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/injection-hook.ts#L39) Called when injection is detected (for logging/telemetry) ###### Parameters | Parameter | Type | | ------ | ------ | | `result` | [`InjectionDetectionResult`](#injectiondetectionresult) | | `toolName` | `string` | ###### Returns `void` *** ### InjectionMatch Defined in: [guardrails/injection-detection.ts:178](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/injection-detection.ts#L178) A single injection match #### Properties ##### category ```ts category: string; ``` Defined in: [guardrails/injection-detection.ts:182](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/injection-detection.ts#L182) ##### description ```ts description: string; ``` Defined in: [guardrails/injection-detection.ts:180](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/injection-detection.ts#L180) ##### matchedText ```ts matchedText: string; ``` Defined in: [guardrails/injection-detection.ts:184](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/injection-detection.ts#L184) The text that matched ##### patternId ```ts patternId: string; ``` Defined in: [guardrails/injection-detection.ts:179](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/injection-detection.ts#L179) ##### severity ```ts severity: "low" | "medium" | "high"; ``` Defined in: [guardrails/injection-detection.ts:181](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/injection-detection.ts#L181) ##### source? ```ts optional source?: string; ``` Defined in: [guardrails/injection-detection.ts:186](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/injection-detection.ts#L186) Where the content came from (if known) *** ### InjectionPattern Defined in: [guardrails/injection-detection.ts:19](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/injection-detection.ts#L19) Prompt Injection Detection — Scans input content for manipulation attempts. Detects patterns in user messages, file contents, web fetches, and knowledge base documents that try to override the agent's instructions. Two attack categories: - Direct: user explicitly tries to override ("ignore previous instructions") - Indirect: embedded in external content (files, web pages) that the agent reads Detection is pattern-based (fast, no LLM call). Not exhaustive, but catches the obvious attacks with low false-positive rates. #### Properties ##### category ```ts category: | "instruction-override" | "role-hijack" | "system-prompt-leak" | "data-exfiltration"; ``` Defined in: [guardrails/injection-detection.ts:29](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/injection-detection.ts#L29) Category of attack ##### description ```ts description: string; ``` Defined in: [guardrails/injection-detection.ts:23](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/injection-detection.ts#L23) Human-readable description ##### id ```ts id: string; ``` Defined in: [guardrails/injection-detection.ts:21](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/injection-detection.ts#L21) Unique identifier ##### pattern ```ts pattern: RegExp; ``` Defined in: [guardrails/injection-detection.ts:25](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/injection-detection.ts#L25) Regex pattern (case-insensitive) ##### severity ```ts severity: "low" | "medium" | "high"; ``` Defined in: [guardrails/injection-detection.ts:27](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/injection-detection.ts#L27) Severity: low (suspicious), medium (likely), high (definite) *** ### InputCompactionRule Defined in: [context/observation-masker.ts:22](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/observation-masker.ts#L22) Defines which input fields to keep when compacting a tool_use input. All other fields are removed. #### Properties ##### keepFields ```ts keepFields: string[]; ``` Defined in: [context/observation-masker.ts:24](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/observation-masker.ts#L24) Fields to preserve in the compacted input *** ### IterationHookContext Defined in: [hooks/types.ts:48](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L48) Context for iteration hooks #### Extends - [`HookContext`](#hookcontext) #### Properties ##### iteration ```ts iteration: number; ``` Defined in: [hooks/types.ts:28](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L28) Current iteration number (1-indexed) ###### Inherited from [`HookContext`](#hookcontext).[`iteration`](#iteration-3) ##### maxIterations ```ts maxIterations: number; ``` Defined in: [hooks/types.ts:52](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L52) Maximum iterations allowed ##### messages ```ts messages: Message[]; ``` Defined in: [hooks/types.ts:57](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L57) Current message history ##### metadata ```ts metadata: Record; ``` Defined in: [hooks/types.ts:38](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L38) Custom metadata that can be passed between hooks ###### Inherited from [`HookContext`](#hookcontext).[`metadata`](#metadata-6) ##### sessionId ```ts sessionId: string; ``` Defined in: [hooks/types.ts:23](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L23) Current session ID ###### Inherited from [`HookContext`](#hookcontext).[`sessionId`](#sessionid-6) ##### signal? ```ts optional signal?: AbortSignal; ``` Defined in: [hooks/types.ts:33](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L33) Abort signal for cancellation ###### Inherited from [`HookContext`](#hookcontext).[`signal`](#signal-4) *** ### ListSessionsOptions Defined in: [state/types.ts:206](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L206) Options for listing sessions. #### Properties ##### limit? ```ts optional limit?: number; ``` Defined in: [state/types.ts:210](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L210) Maximum number of sessions to return ##### offset? ```ts optional offset?: number; ``` Defined in: [state/types.ts:215](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L215) Number of sessions to skip (for pagination) ##### order? ```ts optional order?: "asc" | "desc"; ``` Defined in: [state/types.ts:225](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L225) Sort direction ##### orderBy? ```ts optional orderBy?: "createdAt" | "updatedAt"; ``` Defined in: [state/types.ts:220](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L220) Field to sort by ##### tags? ```ts optional tags?: string[]; ``` Defined in: [state/types.ts:230](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L230) Filter by tags (sessions must have all specified tags) *** ### LLMHookContext Defined in: [hooks/types.ts:107](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L107) Context for LLM hooks #### Extends - [`HookContext`](#hookcontext) #### Extended by - [`AfterLLMHookContext`](#afterllmhookcontext) #### Properties ##### iteration ```ts iteration: number; ``` Defined in: [hooks/types.ts:28](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L28) Current iteration number (1-indexed) ###### Inherited from [`HookContext`](#hookcontext).[`iteration`](#iteration-3) ##### messages ```ts messages: Message[]; ``` Defined in: [hooks/types.ts:111](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L111) Messages to be sent to LLM ##### metadata ```ts metadata: Record; ``` Defined in: [hooks/types.ts:38](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L38) Custom metadata that can be passed between hooks ###### Inherited from [`HookContext`](#hookcontext).[`metadata`](#metadata-6) ##### sessionId ```ts sessionId: string; ``` Defined in: [hooks/types.ts:23](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L23) Current session ID ###### Inherited from [`HookContext`](#hookcontext).[`sessionId`](#sessionid-6) ##### signal? ```ts optional signal?: AbortSignal; ``` Defined in: [hooks/types.ts:33](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L33) Abort signal for cancellation ###### Inherited from [`HookContext`](#hookcontext).[`signal`](#signal-4) ##### systemPrompt ```ts systemPrompt: string; ``` Defined in: [hooks/types.ts:122](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L122) Current system prompt (fully assembled, including anchors). Hooks can read this and return a modified version in BeforeLLMHookResult. ##### tools ```ts tools: ToolDefinition[]; ``` Defined in: [hooks/types.ts:116](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L116) Tool definitions available to LLM *** ### LLMProvider Defined in: [providers/types.ts:268](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L268) Interface for LLM providers. Implement this to add support for a new AI model. Built-in providers: `ClaudeProvider`, `OpenAIProvider`, `GeminiProvider`, `OllamaProvider`, `TogetherProvider`, `GroqProvider`, `FireworksProvider`, `PerplexityProvider`, `OpenRouterProvider`. For OpenAI-compatible APIs, extend `OpenAICompatibleProvider` instead of implementing this interface directly. #### Properties ##### name ```ts readonly name: string; ``` Defined in: [providers/types.ts:272](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L272) Provider identifier (e.g., 'claude', 'openai', 'gemini') #### Methods ##### chat() ```ts chat(messages, options?): AsyncIterable; ``` Defined in: [providers/types.ts:280](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L280) Send messages to the LLM and stream the response. Yields `StreamChunk` objects containing text fragments, tool calls, usage stats, and other provider-specific data. ###### Parameters | Parameter | Type | | ------ | ------ | | `messages` | [`Message`](#message-4)[] | | `options?` | [`ChatOptions`](#chatoptions-1) | ###### Returns `AsyncIterable`\<[`StreamChunk`](#streamchunk)\> ##### countTokens()? ```ts optional countTokens(messages): Promise; ``` Defined in: [providers/types.ts:285](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L285) Count tokens in messages (optional, provider-specific) ###### Parameters | Parameter | Type | | ------ | ------ | | `messages` | [`Message`](#message-4)[] | ###### Returns `Promise`\<`number`\> ##### getModel() ```ts getModel(): string; ``` Defined in: [providers/types.ts:290](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L290) Get the current default model ID. ###### Returns `string` ##### setModel() ```ts setModel(modelId): void; ``` Defined in: [providers/types.ts:298](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L298) Change the default model for subsequent calls. Same provider only. Takes effect on the next chat() call, not mid-stream. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `modelId` | `string` | The new model ID (e.g., 'claude-opus-4-20250514') | ###### Returns `void` *** ### LLMRetryConfig Defined in: [utils/index.ts:52](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/utils/index.ts#L52) Configuration for LLM retry behavior #### Properties ##### baseDelayMs? ```ts optional baseDelayMs?: number; ``` Defined in: [utils/index.ts:71](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/utils/index.ts#L71) Base delay in milliseconds for exponential backoff. Actual delay = min(baseDelayMs * 2^attempt, maxDelayMs) + jitter ###### Default ```ts 1000 ``` ##### enabled? ```ts optional enabled?: boolean; ``` Defined in: [utils/index.ts:57](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/utils/index.ts#L57) Enable/disable automatic retry. ###### Default ```ts true ``` ##### maxAttempts? ```ts optional maxAttempts?: number; ``` Defined in: [utils/index.ts:64](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/utils/index.ts#L64) Maximum number of retry attempts (not including initial attempt). Total attempts = maxAttempts + 1 ###### Default ```ts 10 ``` ##### maxDelayMs? ```ts optional maxDelayMs?: number; ``` Defined in: [utils/index.ts:77](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/utils/index.ts#L77) Maximum delay in milliseconds (cap for exponential growth). ###### Default ```ts 30000 ``` *** ### LLMUsage Defined in: [providers/types.ts:94](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L94) Token usage from an LLM response (returned on 'done' chunks) #### Properties ##### cacheCreationTokens? ```ts optional cacheCreationTokens?: number; ``` Defined in: [providers/types.ts:98](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L98) ##### cacheReadTokens? ```ts optional cacheReadTokens?: number; ``` Defined in: [providers/types.ts:97](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L97) ##### debugPayload? ```ts optional debugPayload?: { contentsTokens: number; systemTokens: number; toolsTokens: number; }; ``` Defined in: [providers/types.ts:102](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L102) Debug payload info - estimated token counts before sending to provider ###### contentsTokens ```ts contentsTokens: number; ``` ###### systemTokens ```ts systemTokens: number; ``` ###### toolsTokens ```ts toolsTokens: number; ``` ##### inputTokens ```ts inputTokens: number; ``` Defined in: [providers/types.ts:95](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L95) ##### outputTokens ```ts outputTokens: number; ``` Defined in: [providers/types.ts:96](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L96) ##### thinkingTokens? ```ts optional thinkingTokens?: number; ``` Defined in: [providers/types.ts:100](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L100) Thinking tokens (Gemini 2.5+ models with thinking) *** ### LogEntry Defined in: [tracing/types.ts:276](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L276) Structured log entry #### Properties ##### data? ```ts optional data?: Record; ``` Defined in: [tracing/types.ts:290](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L290) Additional structured data ##### error? ```ts optional error?: { message: string; name: string; stack?: string; }; ``` Defined in: [tracing/types.ts:292](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L292) Error information ###### message ```ts message: string; ``` ###### name ```ts name: string; ``` ###### stack? ```ts optional stack?: string; ``` ##### level ```ts level: LogLevel; ``` Defined in: [tracing/types.ts:278](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L278) Log level ##### message ```ts message: string; ``` Defined in: [tracing/types.ts:280](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L280) Log message ##### sessionId? ```ts optional sessionId?: string; ``` Defined in: [tracing/types.ts:288](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L288) Session ID ##### spanId? ```ts optional spanId?: string; ``` Defined in: [tracing/types.ts:286](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L286) Span ID for correlation ##### timestamp ```ts timestamp: string; ``` Defined in: [tracing/types.ts:282](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L282) Timestamp in ISO format ##### traceId? ```ts optional traceId?: string; ``` Defined in: [tracing/types.ts:284](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L284) Trace ID for correlation *** ### MaskResult Defined in: [context/observation-masker.ts:75](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/observation-masker.ts#L75) #### Properties ##### maskedCount ```ts maskedCount: number; ``` Defined in: [context/observation-masker.ts:76](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/observation-masker.ts#L76) ##### tokensSaved ```ts tokensSaved: number; ``` Defined in: [context/observation-masker.ts:77](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/observation-masker.ts#L77) *** ### MCPClientConfig Defined in: [mcp/types.ts:47](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L47) Configuration for an MCP client #### Properties ##### clientName? ```ts optional clientName?: string; ``` Defined in: [mcp/types.ts:59](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L59) Client name reported to server (default: '@compilr-dev/agents') ##### clientVersion? ```ts optional clientVersion?: string; ``` Defined in: [mcp/types.ts:61](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L61) Client version reported to server (default: '1.0.0') ##### http? ```ts optional http?: MCPHttpOptions; ``` Defined in: [mcp/types.ts:55](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L55) HTTP transport options (required if transport is 'http') ##### name ```ts name: string; ``` Defined in: [mcp/types.ts:49](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L49) Unique name/identifier for this server connection ##### stdio? ```ts optional stdio?: MCPStdioOptions; ``` Defined in: [mcp/types.ts:53](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L53) Stdio transport options (required if transport is 'stdio') ##### timeout? ```ts optional timeout?: number; ``` Defined in: [mcp/types.ts:57](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L57) Connection timeout in milliseconds (default: 30000) ##### transport ```ts transport: MCPTransport; ``` Defined in: [mcp/types.ts:51](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L51) Transport type *** ### MCPClientEvent Defined in: [mcp/types.ts:142](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L142) Event emitted by MCPClient #### Properties ##### error? ```ts optional error?: Error; ``` Defined in: [mcp/types.ts:145](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L145) ##### serverName ```ts serverName: string; ``` Defined in: [mcp/types.ts:144](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L144) ##### tools? ```ts optional tools?: MCPToolDefinition[]; ``` Defined in: [mcp/types.ts:146](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L146) ##### type ```ts type: MCPClientEventType; ``` Defined in: [mcp/types.ts:143](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L143) *** ### MCPContentBlock Defined in: [mcp/types.ts:116](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L116) Content block in MCP tool result #### Properties ##### data? ```ts optional data?: string; ``` Defined in: [mcp/types.ts:119](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L119) ##### mimeType? ```ts optional mimeType?: string; ``` Defined in: [mcp/types.ts:120](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L120) ##### text? ```ts optional text?: string; ``` Defined in: [mcp/types.ts:118](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L118) ##### type ```ts type: "text" | "image" | "resource" | "audio"; ``` Defined in: [mcp/types.ts:117](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L117) ##### uri? ```ts optional uri?: string; ``` Defined in: [mcp/types.ts:121](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L121) *** ### MCPHttpOptions Defined in: [mcp/types.ts:37](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L37) Options for connecting to an MCP server via HTTP transport #### Properties ##### headers? ```ts optional headers?: Record; ``` Defined in: [mcp/types.ts:41](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L41) Custom headers for HTTP requests ##### url ```ts url: string; ``` Defined in: [mcp/types.ts:39](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L39) Server URL (e.g., 'http://localhost:3000/mcp') *** ### MCPManagerOptions Defined in: [mcp/types.ts:157](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L157) Options for MCPManager #### Properties ##### autoConnect? ```ts optional autoConnect?: boolean; ``` Defined in: [mcp/types.ts:161](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L161) Whether to auto-connect servers when added (default: true) ##### onEvent? ```ts optional onEvent?: MCPClientEventHandler; ``` Defined in: [mcp/types.ts:163](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L163) Event handler for manager events ##### toolPrefix? ```ts optional toolPrefix?: string; ``` Defined in: [mcp/types.ts:159](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L159) Prefix for tool names (default: 'mcp') *** ### MCPServerConfig Defined in: [mcp/types.ts:68](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L68) Simplified configuration for quick server setup Allows shorthand notation for common configurations #### Properties ##### args? ```ts optional args?: string[]; ``` Defined in: [mcp/types.ts:78](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L78) Command arguments ##### command? ```ts optional command?: string; ``` Defined in: [mcp/types.ts:76](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L76) Command to spawn ##### cwd? ```ts optional cwd?: string; ``` Defined in: [mcp/types.ts:82](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L82) Working directory ##### env? ```ts optional env?: Record; ``` Defined in: [mcp/types.ts:80](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L80) Environment variables ##### headers? ```ts optional headers?: Record; ``` Defined in: [mcp/types.ts:88](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L88) Custom headers ##### name ```ts name: string; ``` Defined in: [mcp/types.ts:70](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L70) Unique name/identifier for this server ##### timeout? ```ts optional timeout?: number; ``` Defined in: [mcp/types.ts:91](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L91) Connection timeout in milliseconds ##### transport ```ts transport: MCPTransport; ``` Defined in: [mcp/types.ts:72](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L72) Transport type ##### url? ```ts optional url?: string; ``` Defined in: [mcp/types.ts:86](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L86) Server URL *** ### MCPStdioOptions Defined in: [mcp/types.ts:23](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L23) Options for connecting to an MCP server via stdio transport #### Properties ##### args? ```ts optional args?: string[]; ``` Defined in: [mcp/types.ts:27](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L27) Arguments to pass to the command ##### command ```ts command: string; ``` Defined in: [mcp/types.ts:25](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L25) Command to spawn (e.g., 'npx', 'node', 'python') ##### cwd? ```ts optional cwd?: string; ``` Defined in: [mcp/types.ts:31](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L31) Working directory for the spawned process ##### env? ```ts optional env?: Record; ``` Defined in: [mcp/types.ts:29](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L29) Environment variables for the spawned process *** ### MCPToolConversionOptions Defined in: [mcp/tools.ts:15](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/tools.ts#L15) Options for converting MCP tools #### Properties ##### includeServerName? ```ts optional includeServerName?: boolean; ``` Defined in: [mcp/tools.ts:19](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/tools.ts#L19) Whether to include server name in tool name (default: true) ##### prefix? ```ts optional prefix?: string; ``` Defined in: [mcp/tools.ts:17](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/tools.ts#L17) Prefix for tool names (default: 'mcp') *** ### MCPToolDefinition Defined in: [mcp/types.ts:98](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L98) MCP tool definition from the server Based on MCP specification's Tool type #### Properties ##### description? ```ts optional description?: string; ``` Defined in: [mcp/types.ts:102](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L102) Human-readable description ##### inputSchema ```ts inputSchema: { [key: string]: unknown; additionalProperties?: boolean; properties?: Record; required?: string[]; type: "object"; }; ``` Defined in: [mcp/types.ts:104](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L104) JSON Schema for tool input ###### Index Signature ```ts [key: string]: unknown ``` ###### additionalProperties? ```ts optional additionalProperties?: boolean; ``` ###### properties? ```ts optional properties?: Record; ``` ###### required? ```ts optional required?: string[]; ``` ###### type ```ts type: "object"; ``` ##### name ```ts name: string; ``` Defined in: [mcp/types.ts:100](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L100) Tool name (unique identifier) *** ### MCPToolResult Defined in: [mcp/types.ts:127](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L127) Result from calling an MCP tool #### Properties ##### content ```ts content: MCPContentBlock[]; ``` Defined in: [mcp/types.ts:129](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L129) Content blocks (text, images, resources) ##### isError? ```ts optional isError?: boolean; ``` Defined in: [mcp/types.ts:131](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L131) Whether the tool execution resulted in an error *** ### MemoryDiscoveryResult Defined in: [memory/types.ts:180](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/types.ts#L180) Result of checking for memory files without loading content #### Properties ##### found ```ts found: boolean; ``` Defined in: [memory/types.ts:184](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/types.ts#L184) Whether any memory files were found ##### matchedPatterns ```ts matchedPatterns: string[]; ``` Defined in: [memory/types.ts:186](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/types.ts#L186) The patterns that matched ##### paths ```ts paths: string[]; ``` Defined in: [memory/types.ts:182](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/types.ts#L182) Paths to discovered memory files *** ### MemoryFile Defined in: [memory/types.ts:22](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/types.ts#L22) A loaded memory file with its content and metadata #### Properties ##### content ```ts content: string; ``` Defined in: [memory/types.ts:26](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/types.ts#L26) File content ##### matchedPattern ```ts matchedPattern: string; ``` Defined in: [memory/types.ts:30](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/types.ts#L30) The pattern that matched this file ##### modifiedAt ```ts modifiedAt: Date; ``` Defined in: [memory/types.ts:34](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/types.ts#L34) Last modified timestamp ##### path ```ts path: string; ``` Defined in: [memory/types.ts:24](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/types.ts#L24) Absolute path to the file ##### relativePath ```ts relativePath: string; ``` Defined in: [memory/types.ts:28](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/types.ts#L28) Relative path from the search root ##### size ```ts size: number; ``` Defined in: [memory/types.ts:32](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/types.ts#L32) File size in bytes *** ### Message Defined in: [providers/types.ts:86](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L86) A message in a conversation #### Properties ##### content ```ts content: string | ContentBlock[]; ``` Defined in: [providers/types.ts:88](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L88) ##### role ```ts role: MessageRole; ``` Defined in: [providers/types.ts:87](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L87) *** ### MockProviderConfig Defined in: [providers/mock.ts:70](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/mock.ts#L70) Configuration for MockProvider #### Properties ##### defaultDelay? ```ts optional defaultDelay?: number; ``` Defined in: [providers/mock.ts:72](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/mock.ts#L72) Default delay for all responses (ms) ##### throwOnEmpty? ```ts optional throwOnEmpty?: boolean; ``` Defined in: [providers/mock.ts:74](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/mock.ts#L74) Throw if no responses are queued *** ### MockResponse Defined in: [providers/mock.ts:54](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/mock.ts#L54) A mock response definition #### Properties ##### delay? ```ts optional delay?: number; ``` Defined in: [providers/mock.ts:64](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/mock.ts#L64) Delay in ms before responding (simulates network latency) ##### error? ```ts optional error?: Error; ``` Defined in: [providers/mock.ts:62](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/mock.ts#L62) If set, throw this error instead of responding ##### text? ```ts optional text?: string; ``` Defined in: [providers/mock.ts:56](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/mock.ts#L56) Text content of the response ##### thinking? ```ts optional thinking?: MockThinking; ``` Defined in: [providers/mock.ts:60](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/mock.ts#L60) Extended thinking content (Claude-specific) ##### toolCalls? ```ts optional toolCalls?: MockToolCall[]; ``` Defined in: [providers/mock.ts:58](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/mock.ts#L58) Tool calls to include in the response *** ### MockToolCall Defined in: [providers/mock.ts:35](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/mock.ts#L35) A tool call in a mock response #### Properties ##### id ```ts id: string; ``` Defined in: [providers/mock.ts:36](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/mock.ts#L36) ##### input ```ts input: Record; ``` Defined in: [providers/mock.ts:38](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/mock.ts#L38) ##### name ```ts name: string; ``` Defined in: [providers/mock.ts:37](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/mock.ts#L37) *** ### ObservationMaskConfig Defined in: [context/observation-masker.ts:27](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/observation-masker.ts#L27) #### Properties ##### alwaysMaskEarly ```ts alwaysMaskEarly: string[]; ``` Defined in: [context/observation-masker.ts:35](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/observation-masker.ts#L35) Tool names to mask after just 1 turn (large reads, bash output) ##### inputCompaction ```ts inputCompaction: | false | Map; ``` Defined in: [context/observation-masker.ts:42](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/observation-masker.ts#L42) Tool input compaction rules (Phase 1b). Keys are tool names. After the turn threshold, large input fields are removed, keeping only the fields listed. Set to false to disable input compaction entirely. Default: compact edit (keep filePath) and write_file (keep path, mode). ##### maskAfterTurns ```ts maskAfterTurns: number; ``` Defined in: [context/observation-masker.ts:29](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/observation-masker.ts#L29) Turns after which tool results are masked (default: 6) ##### minCharsToMask ```ts minCharsToMask: number; ``` Defined in: [context/observation-masker.ts:31](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/observation-masker.ts#L31) Minimum content length (chars) to mask — skip tiny results (default: 400 ≈ 100 tokens) ##### neverMask ```ts neverMask: string[]; ``` Defined in: [context/observation-masker.ts:33](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/observation-masker.ts#L33) Tool names to NEVER mask (e.g., recall tools, state queries) *** ### ObservationMaskStats Defined in: [context/observation-masker.ts:84](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/observation-masker.ts#L84) #### Properties ##### activeStamps ```ts activeStamps: number; ``` Defined in: [context/observation-masker.ts:90](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/observation-masker.ts#L90) Active stamps (pending masking) ##### inputsCompacted ```ts inputsCompacted: number; ``` Defined in: [context/observation-masker.ts:92](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/observation-masker.ts#L92) Total tool_use inputs compacted this session (Phase 1b) ##### maskedCount ```ts maskedCount: number; ``` Defined in: [context/observation-masker.ts:86](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/observation-masker.ts#L86) Total observations masked this session ##### tokensSaved ```ts tokensSaved: number; ``` Defined in: [context/observation-masker.ts:88](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/observation-masker.ts#L88) Estimated tokens saved this session *** ### OllamaProviderConfig Defined in: [providers/ollama.ts:32](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/ollama.ts#L32) Configuration for OllamaProvider #### Properties ##### baseUrl? ```ts optional baseUrl?: string; ``` Defined in: [providers/ollama.ts:34](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/ollama.ts#L34) Base URL for Ollama server (default: http://localhost:11434) ##### estimateTokens? ```ts optional estimateTokens?: (text) => number; ``` Defined in: [providers/ollama.ts:44](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/ollama.ts#L44) Optional token estimator (e.g., tiktoken) for debug payload ###### Parameters | Parameter | Type | | ------ | ------ | | `text` | `string` | ###### Returns `number` ##### keepAlive? ```ts optional keepAlive?: string; ``` Defined in: [providers/ollama.ts:42](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/ollama.ts#L42) Keep alive duration for model in memory (default: '5m') ##### maxTokens? ```ts optional maxTokens?: number; ``` Defined in: [providers/ollama.ts:38](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/ollama.ts#L38) Default max tokens (default: 4096) ##### model? ```ts optional model?: string; ``` Defined in: [providers/ollama.ts:36](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/ollama.ts#L36) Default model to use (default: llama3.1) ##### timeout? ```ts optional timeout?: number; ``` Defined in: [providers/ollama.ts:40](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/ollama.ts#L40) Request timeout in milliseconds (default: 120000) *** ### OpenAICompatibleConfig Defined in: [providers/openai-compatible.ts:114](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai-compatible.ts#L114) Base configuration for OpenAI-compatible providers #### Properties ##### baseUrl ```ts baseUrl: string; ``` Defined in: [providers/openai-compatible.ts:116](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai-compatible.ts#L116) Base URL for the API ##### estimateTokens? ```ts optional estimateTokens?: (text) => number; ``` Defined in: [providers/openai-compatible.ts:128](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai-compatible.ts#L128) Optional token estimator function (e.g., tiktoken). When provided, debug payload reports token counts instead of char-based estimates. Fallback: Math.ceil(text.length / 4) ###### Parameters | Parameter | Type | | ------ | ------ | | `text` | `string` | ###### Returns `number` ##### maxTokens? ```ts optional maxTokens?: number; ``` Defined in: [providers/openai-compatible.ts:120](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai-compatible.ts#L120) Default max tokens (default: 4096) ##### model ```ts model: string; ``` Defined in: [providers/openai-compatible.ts:118](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai-compatible.ts#L118) Default model to use ##### timeout? ```ts optional timeout?: number; ``` Defined in: [providers/openai-compatible.ts:122](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai-compatible.ts#L122) Request timeout in milliseconds (default: 120000) *** ### OpenAIProviderConfig Defined in: [providers/openai.ts:32](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai.ts#L32) Configuration for OpenAIProvider #### Properties ##### apiKey? ```ts optional apiKey?: string; ``` Defined in: [providers/openai.ts:34](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai.ts#L34) OpenAI API key (falls back to OPENAI_API_KEY env var) ##### baseUrl? ```ts optional baseUrl?: string; ``` Defined in: [providers/openai.ts:36](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai.ts#L36) Base URL for OpenAI API (default: https://api.openai.com) ##### estimateTokens? ```ts optional estimateTokens?: (text) => number; ``` Defined in: [providers/openai.ts:46](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai.ts#L46) Optional token estimator (e.g., tiktoken) for debug payload ###### Parameters | Parameter | Type | | ------ | ------ | | `text` | `string` | ###### Returns `number` ##### maxTokens? ```ts optional maxTokens?: number; ``` Defined in: [providers/openai.ts:40](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai.ts#L40) Default max tokens (default: 4096) ##### model? ```ts optional model?: string; ``` Defined in: [providers/openai.ts:38](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai.ts#L38) Default model to use (default: gpt-4o) ##### organization? ```ts optional organization?: string; ``` Defined in: [providers/openai.ts:44](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai.ts#L44) OpenAI organization ID (optional) ##### timeout? ```ts optional timeout?: number; ``` Defined in: [providers/openai.ts:42](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai.ts#L42) Request timeout in milliseconds (default: 120000) *** ### OpenRouterProviderConfig Defined in: [providers/openrouter.ts:33](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openrouter.ts#L33) Configuration for OpenRouterProvider #### Properties ##### apiKey? ```ts optional apiKey?: string; ``` Defined in: [providers/openrouter.ts:35](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openrouter.ts#L35) OpenRouter API key (falls back to OPENROUTER_API_KEY env var) ##### baseUrl? ```ts optional baseUrl?: string; ``` Defined in: [providers/openrouter.ts:37](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openrouter.ts#L37) Base URL for OpenRouter API (default: https://openrouter.ai/api) ##### estimateTokens? ```ts optional estimateTokens?: (text) => number; ``` Defined in: [providers/openrouter.ts:49](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openrouter.ts#L49) Optional token estimator (e.g., tiktoken) for debug payload ###### Parameters | Parameter | Type | | ------ | ------ | | `text` | `string` | ###### Returns `number` ##### maxTokens? ```ts optional maxTokens?: number; ``` Defined in: [providers/openrouter.ts:41](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openrouter.ts#L41) Default max tokens (default: 4096) ##### model? ```ts optional model?: string; ``` Defined in: [providers/openrouter.ts:39](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openrouter.ts#L39) Default model to use (default: meta-llama/llama-3.1-8b-instruct) ##### siteName? ```ts optional siteName?: string; ``` Defined in: [providers/openrouter.ts:47](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openrouter.ts#L47) Site name for OpenRouter rankings (optional) ##### siteUrl? ```ts optional siteUrl?: string; ``` Defined in: [providers/openrouter.ts:45](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openrouter.ts#L45) Site URL for OpenRouter rankings (optional) ##### timeout? ```ts optional timeout?: number; ``` Defined in: [providers/openrouter.ts:43](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openrouter.ts#L43) Request timeout in milliseconds (default: 120000) *** ### OTelExporter Defined in: [tracing/types.ts:234](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L234) OpenTelemetry exporter interface (simplified) Allows integration with any OTel-compatible backend #### Properties ##### name ```ts name: string; ``` Defined in: [tracing/types.ts:236](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L236) Exporter name for logging #### Methods ##### export() ```ts export(spans): Promise; ``` Defined in: [tracing/types.ts:238](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L238) Export spans ###### Parameters | Parameter | Type | | ------ | ------ | | `spans` | [`Span`](#span)[] | ###### Returns `Promise`\<`void`\> ##### shutdown()? ```ts optional shutdown(): Promise; ``` Defined in: [tracing/types.ts:240](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L240) Shutdown the exporter ###### Returns `Promise`\<`void`\> *** ### OTelHooksConfig Defined in: [tracing/otel-hooks.ts:40](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/otel-hooks.ts#L40) Configuration for OTel hooks #### Properties ##### includeIO? ```ts optional includeIO?: boolean; ``` Defined in: [tracing/otel-hooks.ts:54](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/otel-hooks.ts#L54) Include input/output content in span attributes (default: false) ##### providerName? ```ts optional providerName?: string; ``` Defined in: [tracing/otel-hooks.ts:46](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/otel-hooks.ts#L46) Provider name for gen_ai.system mapping (e.g. 'claude', 'openai') ##### traceIterations? ```ts optional traceIterations?: boolean; ``` Defined in: [tracing/otel-hooks.ts:48](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/otel-hooks.ts#L48) Trace iteration spans (default: true) ##### traceLLM? ```ts optional traceLLM?: boolean; ``` Defined in: [tracing/otel-hooks.ts:50](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/otel-hooks.ts#L50) Trace LLM call spans (default: true) ##### tracerName? ```ts optional tracerName?: string; ``` Defined in: [tracing/otel-hooks.ts:42](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/otel-hooks.ts#L42) Tracer name (default: '@compilr-dev/agents') ##### tracerVersion? ```ts optional tracerVersion?: string; ``` Defined in: [tracing/otel-hooks.ts:44](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/otel-hooks.ts#L44) Tracer version ##### traceTools? ```ts optional traceTools?: boolean; ``` Defined in: [tracing/otel-hooks.ts:52](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/otel-hooks.ts#L52) Trace tool execution spans (default: true) ##### truncateAt? ```ts optional truncateAt?: number; ``` Defined in: [tracing/otel-hooks.ts:56](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/otel-hooks.ts#L56) Truncate attribute values at this length (default: 1000) *** ### PendingWrite Defined in: [state/types.ts:287](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L287) Pending write from incomplete tool execution. Used for fault-tolerant checkpointing. #### Properties ##### completedAt ```ts completedAt: string; ``` Defined in: [state/types.ts:310](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L310) When the write was completed (ISO 8601) ##### result ```ts result: { error?: string; result?: unknown; success: boolean; }; ``` Defined in: [state/types.ts:301](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L301) Tool execution result ###### error? ```ts optional error?: string; ``` ###### result? ```ts optional result?: unknown; ``` ###### success ```ts success: boolean; ``` ##### toolCallId ```ts toolCallId: string; ``` Defined in: [state/types.ts:291](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L291) Tool call ID ##### toolName ```ts toolName: string; ``` Defined in: [state/types.ts:296](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L296) Tool name *** ### PermissionCheckResult Defined in: [permissions/types.ts:76](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/types.ts#L76) Result of a permission check #### Properties ##### allowed ```ts allowed: boolean; ``` Defined in: [permissions/types.ts:80](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/types.ts#L80) Whether execution is allowed ##### askedUser ```ts askedUser: boolean; ``` Defined in: [permissions/types.ts:90](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/types.ts#L90) Whether user confirmation was required ##### level ```ts level: PermissionLevel; ``` Defined in: [permissions/types.ts:85](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/types.ts#L85) The permission level that applied ##### reason? ```ts optional reason?: string; ``` Defined in: [permissions/types.ts:100](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/types.ts#L100) Reason for denial (if not allowed) ##### rule? ```ts optional rule?: ToolPermission; ``` Defined in: [permissions/types.ts:95](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/types.ts#L95) The tool permission rule that matched (if any) *** ### PermissionEvent Defined in: [permissions/types.ts:211](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/types.ts#L211) Permission event payload #### Properties ##### input? ```ts optional input?: Record; ``` Defined in: [permissions/types.ts:215](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/types.ts#L215) ##### level ```ts level: PermissionLevel; ``` Defined in: [permissions/types.ts:214](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/types.ts#L214) ##### rule? ```ts optional rule?: ToolPermission; ``` Defined in: [permissions/types.ts:216](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/types.ts#L216) ##### toolName ```ts toolName: string; ``` Defined in: [permissions/types.ts:213](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/types.ts#L213) ##### type ```ts type: PermissionEventType; ``` Defined in: [permissions/types.ts:212](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/types.ts#L212) *** ### PermissionManagerOptions Defined in: [permissions/types.ts:165](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/types.ts#L165) Configuration for the PermissionManager #### Properties ##### defaultLevel? ```ts optional defaultLevel?: PermissionLevel; ``` Defined in: [permissions/types.ts:175](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/types.ts#L175) Default permission level for tools not explicitly configured ###### Default ```ts 'always' ``` ##### enabled? ```ts optional enabled?: boolean; ``` Defined in: [permissions/types.ts:169](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/types.ts#L169) Enable permission checking (default: true) ##### includeDefaults? ```ts optional includeDefaults?: boolean; ``` Defined in: [permissions/types.ts:196](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/types.ts#L196) Whether to include default permission rules for dangerous tools ###### Default ```ts false ``` ##### onPermissionRequest? ```ts optional onPermissionRequest?: PermissionHandler; ``` Defined in: [permissions/types.ts:180](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/types.ts#L180) Handler called when permission is needed (for 'session' and 'once' levels) ##### previewGenerator? ```ts optional previewGenerator?: PreviewGenerator; ``` Defined in: [permissions/types.ts:190](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/types.ts#L190) Custom preview generator for permission requests ##### rules? ```ts optional rules?: ToolPermission[]; ``` Defined in: [permissions/types.ts:185](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/types.ts#L185) Tool-specific permission rules *** ### PermissionRequest Defined in: [permissions/types.ts:46](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/types.ts#L46) Permission request passed to the handler #### Properties ##### description? ```ts optional description?: string; ``` Defined in: [permissions/types.ts:65](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/types.ts#L65) Description of why permission is needed ##### input ```ts input: Record; ``` Defined in: [permissions/types.ts:55](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/types.ts#L55) Input arguments for the tool ##### level ```ts level: PermissionLevel; ``` Defined in: [permissions/types.ts:60](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/types.ts#L60) Permission level that triggered the request ##### preview? ```ts optional preview?: string; ``` Defined in: [permissions/types.ts:70](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/types.ts#L70) Formatted preview of what the tool will do ##### toolName ```ts toolName: string; ``` Defined in: [permissions/types.ts:50](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/types.ts#L50) Name of the tool requesting permission *** ### PerplexityProviderConfig Defined in: [providers/perplexity.ts:32](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/perplexity.ts#L32) Configuration for PerplexityProvider #### Properties ##### apiKey? ```ts optional apiKey?: string; ``` Defined in: [providers/perplexity.ts:34](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/perplexity.ts#L34) Perplexity API key (falls back to PERPLEXITY_API_KEY env var) ##### baseUrl? ```ts optional baseUrl?: string; ``` Defined in: [providers/perplexity.ts:36](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/perplexity.ts#L36) Base URL for Perplexity API (default: https://api.perplexity.ai) ##### estimateTokens? ```ts optional estimateTokens?: (text) => number; ``` Defined in: [providers/perplexity.ts:44](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/perplexity.ts#L44) Optional token estimator (e.g., tiktoken) for debug payload ###### Parameters | Parameter | Type | | ------ | ------ | | `text` | `string` | ###### Returns `number` ##### maxTokens? ```ts optional maxTokens?: number; ``` Defined in: [providers/perplexity.ts:40](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/perplexity.ts#L40) Default max tokens (default: 4096) ##### model? ```ts optional model?: string; ``` Defined in: [providers/perplexity.ts:38](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/perplexity.ts#L38) Default model to use (default: llama-3.1-sonar-small-128k-online) ##### timeout? ```ts optional timeout?: number; ``` Defined in: [providers/perplexity.ts:42](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/perplexity.ts#L42) Request timeout in milliseconds (default: 120000) *** ### PreflightResult Defined in: [context/types.ts:91](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L91) Result of a pre-flight context check Call canAddContent() before adding content to check if action is needed. #### Properties ##### action? ```ts optional action?: "compact" | "summarize" | "reject"; ``` Defined in: [context/types.ts:105](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L105) Recommended action to take ##### allowed ```ts allowed: boolean; ``` Defined in: [context/types.ts:95](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L95) Whether the content can be added without issues ##### budgetRemaining ```ts budgetRemaining: number; ``` Defined in: [context/types.ts:120](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L120) Tokens remaining in the target category budget ##### category? ```ts optional category?: ContextCategory; ``` Defined in: [context/types.ts:110](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L110) Which category needs action (for compact) ##### estimatedTokens ```ts estimatedTokens: number; ``` Defined in: [context/types.ts:115](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L115) Estimated tokens for the content to add ##### recommendation? ```ts optional recommendation?: string; ``` Defined in: [context/types.ts:125](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L125) Human-readable recommendation ##### requiresAction ```ts requiresAction: boolean; ``` Defined in: [context/types.ts:100](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L100) Whether an action is required before adding *** ### ProjectMemory Defined in: [memory/types.ts:40](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/types.ts#L40) Result of loading project memory #### Properties ##### content ```ts content: string; ``` Defined in: [memory/types.ts:44](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/types.ts#L44) Combined content from all files ##### estimatedTokens ```ts estimatedTokens: number; ``` Defined in: [memory/types.ts:48](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/types.ts#L48) Total token estimate (tiktoken cl100k_base) ##### files ```ts files: MemoryFile[]; ``` Defined in: [memory/types.ts:42](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/types.ts#L42) All loaded memory files ##### rootDir ```ts rootDir: string; ``` Defined in: [memory/types.ts:46](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/types.ts#L46) The root directory where search started *** ### ProjectMemoryOptions Defined in: [memory/types.ts:74](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/types.ts#L74) Options for ProjectMemoryLoader #### Properties ##### combineStrategy? ```ts optional combineStrategy?: CombineStrategy; ``` Defined in: [memory/types.ts:116](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/types.ts#L116) Strategy for combining multiple memory files ###### Default ```ts 'concat' ``` ##### customPatterns? ```ts optional customPatterns?: FilePattern[]; ``` Defined in: [memory/types.ts:92](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/types.ts#L92) Additional custom file patterns to search for ##### encoding? ```ts optional encoding?: BufferEncoding; ``` Defined in: [memory/types.ts:147](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/types.ts#L147) File encoding ###### Default ```ts 'utf-8' ``` ##### headerFormat? ```ts optional headerFormat?: string; ``` Defined in: [memory/types.ts:141](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/types.ts#L141) Header format template. Use {path} for file path, {relativePath} for relative path ###### Default ```ts '# From: {relativePath}\n\n' ``` ##### includeGeneric? ```ts optional includeGeneric?: boolean; ``` Defined in: [memory/types.ts:87](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/types.ts#L87) Whether to include generic memory files (PROJECT.md, INSTRUCTIONS.md, AI.md) ###### Default ```ts true ``` ##### includeHeaders? ```ts optional includeHeaders?: boolean; ``` Defined in: [memory/types.ts:135](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/types.ts#L135) Whether to include file path headers in combined content ###### Default ```ts true ``` ##### maxContentSize? ```ts optional maxContentSize?: number; ``` Defined in: [memory/types.ts:129](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/types.ts#L129) Maximum total content size in characters Files are loaded in priority order until limit is reached ###### Default ```ts 100000 (100KB) ``` ##### maxParentDepth? ```ts optional maxParentDepth?: number; ``` Defined in: [memory/types.ts:104](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/types.ts#L104) Maximum number of parent directories to traverse ###### Default ```ts 10 ``` ##### providers? ```ts optional providers?: string | string[]; ``` Defined in: [memory/types.ts:81](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/types.ts#L81) LLM provider name(s) to search for E.g., 'claude' will search for CLAUDE.md, .claude.md, .claude/instructions.md Can be a single provider or array for multi-provider support ###### Default ```ts 'claude' ``` ##### searchParents? ```ts optional searchParents?: boolean; ``` Defined in: [memory/types.ts:98](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/types.ts#L98) Whether to search parent directories up to the root ###### Default ```ts true ``` ##### separator? ```ts optional separator?: string; ``` Defined in: [memory/types.ts:122](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/types.ts#L122) Separator to use between files when combining ###### Default ```ts '\n\n---\n\n' ``` ##### stopAtGitRoot? ```ts optional stopAtGitRoot?: boolean; ``` Defined in: [memory/types.ts:110](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/types.ts#L110) Stop searching parents when finding a git root (.git directory) ###### Default ```ts true ``` *** ### ProjectWorkSummary Defined in: [episodes/types.ts:156](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L156) Project-level work summary with breakdown. #### Properties ##### agentBreakdown ```ts agentBreakdown: { agentId: string; episodeCount: number; maxEffort: Effort; timeSpentMs: number; }[]; ``` Defined in: [episodes/types.ts:167](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L167) Effort breakdown by agent ###### agentId ```ts agentId: string; ``` ###### episodeCount ```ts episodeCount: number; ``` ###### maxEffort ```ts maxEffort: Effort; ``` ###### timeSpentMs ```ts timeSpentMs: number; ``` ##### episodeCount ```ts episodeCount: number; ``` Defined in: [episodes/types.ts:158](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L158) Total number of episodes ##### timeSpentMs ```ts timeSpentMs: number; ``` Defined in: [episodes/types.ts:164](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L164) Total time spent in milliseconds ##### topFiles ```ts topFiles: { path: string; touchCount: number; }[]; ``` Defined in: [episodes/types.ts:175](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L175) Most frequently touched files ###### path ```ts path: string; ``` ###### touchCount ```ts touchCount: number; ``` ##### totalEffort ```ts totalEffort: Effort; ``` Defined in: [episodes/types.ts:161](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L161) Maximum effort level ##### uncommittedWork ```ts uncommittedWork: WorkEpisode[]; ``` Defined in: [episodes/types.ts:181](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L181) Episodes since the last git commit *** ### ProviderPatterns Defined in: [memory/types.ts:192](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/types.ts#L192) Built-in provider patterns #### Properties ##### patterns ```ts patterns: FilePattern[]; ``` Defined in: [memory/types.ts:196](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/types.ts#L196) File patterns for this provider (ordered by priority) ##### provider ```ts provider: string; ``` Defined in: [memory/types.ts:194](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/types.ts#L194) Provider name *** ### PruneConfig Defined in: [context/dead-message-pruner.ts:20](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/dead-message-pruner.ts#L20) #### Properties ##### permissionExchanges ```ts permissionExchanges: boolean; ``` Defined in: [context/dead-message-pruner.ts:24](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/dead-message-pruner.ts#L24) Enable permission exchange pruning (default: true) ##### permissionTools ```ts permissionTools: string[]; ``` Defined in: [context/dead-message-pruner.ts:26](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/dead-message-pruner.ts#L26) Tool names considered permission exchanges ##### protectedTurns ```ts protectedTurns: number; ``` Defined in: [context/dead-message-pruner.ts:28](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/dead-message-pruner.ts#L28) Never prune messages newer than this many turns (default: 4) ##### supersededErrors ```ts supersededErrors: boolean; ``` Defined in: [context/dead-message-pruner.ts:22](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/dead-message-pruner.ts#L22) Enable superseded error pruning (default: true) *** ### PruneResult Defined in: [context/dead-message-pruner.ts:53](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/dead-message-pruner.ts#L53) #### Properties ##### prunedCount ```ts prunedCount: number; ``` Defined in: [context/dead-message-pruner.ts:54](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/dead-message-pruner.ts#L54) ##### tokensSaved ```ts tokensSaved: number; ``` Defined in: [context/dead-message-pruner.ts:55](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/dead-message-pruner.ts#L55) *** ### PruneStats Defined in: [context/dead-message-pruner.ts:58](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/dead-message-pruner.ts#L58) #### Properties ##### errorsPruned ```ts errorsPruned: number; ``` Defined in: [context/dead-message-pruner.ts:61](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/dead-message-pruner.ts#L61) ##### permissionsPruned ```ts permissionsPruned: number; ``` Defined in: [context/dead-message-pruner.ts:62](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/dead-message-pruner.ts#L62) ##### prunedCount ```ts prunedCount: number; ``` Defined in: [context/dead-message-pruner.ts:59](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/dead-message-pruner.ts#L59) ##### tokensSaved ```ts tokensSaved: number; ``` Defined in: [context/dead-message-pruner.ts:60](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/dead-message-pruner.ts#L60) *** ### RateLimiter Defined in: [rate-limit/types.ts:162](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/types.ts#L162) Rate limiter interface #### Methods ##### acquire() ```ts acquire(estimatedTokens?): Promise; ``` Defined in: [rate-limit/types.ts:170](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/types.ts#L170) Acquire permission to make a request Waits if necessary (unless throwOnLimit is true) ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `estimatedTokens?` | `number` | Estimated tokens for the request (optional) | ###### Returns `Promise`\<[`AcquireResult`](#acquireresult)\> Acquire result ##### canAcquire() ```ts canAcquire(estimatedTokens?): boolean; ``` Defined in: [rate-limit/types.ts:198](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/types.ts#L198) Check if a request can be made immediately ###### Parameters | Parameter | Type | | ------ | ------ | | `estimatedTokens?` | `number` | ###### Returns `boolean` ##### getStats() ```ts getStats(): RateLimiterStats; ``` Defined in: [rate-limit/types.ts:188](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/types.ts#L188) Get current rate limiter statistics ###### Returns [`RateLimiterStats`](#ratelimiterstats) ##### release() ```ts release(): void; ``` Defined in: [rate-limit/types.ts:175](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/types.ts#L175) Release a concurrent request slot ###### Returns `void` ##### reportUsage() ```ts reportUsage(tokens): void; ``` Defined in: [rate-limit/types.ts:183](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/types.ts#L183) Report actual token usage after request completes Used to update token bucket ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `tokens` | `number` | Actual tokens used | ###### Returns `void` ##### reset() ```ts reset(): void; ``` Defined in: [rate-limit/types.ts:193](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/types.ts#L193) Reset the rate limiter ###### Returns `void` *** ### RateLimiterConfig Defined in: [rate-limit/types.ts:10](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/types.ts#L10) Configuration for rate limiter #### Properties ##### maxConcurrent? ```ts optional maxConcurrent?: number; ``` Defined in: [rate-limit/types.ts:29](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/types.ts#L29) Maximum concurrent requests Set to 0 for unlimited ###### Default ```ts 0 ``` ##### requestsPerMinute? ```ts optional requestsPerMinute?: number; ``` Defined in: [rate-limit/types.ts:15](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/types.ts#L15) Maximum requests per minute ###### Default ```ts 60 ``` ##### throwOnLimit? ```ts optional throwOnLimit?: boolean; ``` Defined in: [rate-limit/types.ts:35](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/types.ts#L35) Whether to throw immediately when rate limited instead of waiting ###### Default ```ts false ``` ##### tokensPerMinute? ```ts optional tokensPerMinute?: number; ``` Defined in: [rate-limit/types.ts:22](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/types.ts#L22) Maximum tokens per minute (for token-based limiting) Set to 0 to disable token-based limiting ###### Default ```ts 0 ``` *** ### RateLimiterStats Defined in: [rate-limit/types.ts:41](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/types.ts#L41) Rate limiter statistics #### Properties ##### availableRequests ```ts availableRequests: number; ``` Defined in: [rate-limit/types.ts:45](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/types.ts#L45) Current number of available request tokens ##### availableTokens ```ts availableTokens: number; ``` Defined in: [rate-limit/types.ts:50](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/types.ts#L50) Current number of available LLM tokens ##### currentConcurrent ```ts currentConcurrent: number; ``` Defined in: [rate-limit/types.ts:55](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/types.ts#L55) Current number of concurrent requests ##### rateLimitHits ```ts rateLimitHits: number; ``` Defined in: [rate-limit/types.ts:70](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/types.ts#L70) Number of times rate limit was hit ##### totalRequests ```ts totalRequests: number; ``` Defined in: [rate-limit/types.ts:60](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/types.ts#L60) Total requests made ##### totalTokens ```ts totalTokens: number; ``` Defined in: [rate-limit/types.ts:65](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/types.ts#L65) Total tokens consumed ##### totalWaitTimeMs ```ts totalWaitTimeMs: number; ``` Defined in: [rate-limit/types.ts:75](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/types.ts#L75) Total time spent waiting due to rate limits (ms) *** ### RateLimitRetryConfig Defined in: [rate-limit/types.ts:127](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/types.ts#L127) Combined rate limit and retry configuration #### Properties ##### rateLimit? ```ts optional rateLimit?: RateLimiterConfig; ``` Defined in: [rate-limit/types.ts:131](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/types.ts#L131) Rate limiter configuration ##### retry? ```ts optional retry?: RetryConfig; ``` Defined in: [rate-limit/types.ts:136](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/types.ts#L136) Retry configuration *** ### ReadFileInput Defined in: [tools/builtin/read-file.ts:24](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/read-file.ts#L24) Input parameters for read_file tool #### Properties ##### encoding? ```ts optional encoding?: BufferEncoding; ``` Defined in: [tools/builtin/read-file.ts:33](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/read-file.ts#L33) Encoding to use (default: utf-8) ##### maxLines? ```ts optional maxLines?: number; ``` Defined in: [tools/builtin/read-file.ts:38](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/read-file.ts#L38) Maximum number of lines to read (default: all) ##### path ```ts path: string; ``` Defined in: [tools/builtin/read-file.ts:28](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/read-file.ts#L28) Path to the file to read ##### startLine? ```ts optional startLine?: number; ``` Defined in: [tools/builtin/read-file.ts:43](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/read-file.ts#L43) Line offset to start reading from (1-indexed, default: 1) *** ### RecallResultInput Defined in: [tools/builtin/recall-result.ts:16](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/recall-result.ts#L16) Input for the recall_full_result tool. #### Properties ##### id ```ts id: string; ``` Defined in: [tools/builtin/recall-result.ts:18](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/recall-result.ts#L18) Delegation ID from a previously delegated result (e.g., "dr_1707900000_0") *** ### RecallResultToolOptions Defined in: [tools/builtin/recall-result.ts:24](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/recall-result.ts#L24) Options for creating the recall_full_result tool. #### Properties ##### onEvent? ```ts optional onEvent?: (event) => void; ``` Defined in: [tools/builtin/recall-result.ts:29](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/recall-result.ts#L29) Optional event callback for recall events ###### Parameters | Parameter | Type | | ------ | ------ | | `event` | [`DelegationEvent`](#delegationevent) | ###### Returns `void` ##### store ```ts store: DelegatedResultStore; ``` Defined in: [tools/builtin/recall-result.ts:26](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/recall-result.ts#L26) The delegation store to retrieve results from *** ### RecordUsageInput Defined in: [costs/types.ts:153](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L153) Input for recording usage #### Properties ##### metadata? ```ts optional metadata?: Record; ``` Defined in: [costs/types.ts:163](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L163) Additional metadata ##### model ```ts model: string; ``` Defined in: [costs/types.ts:155](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L155) Model used ##### provider ```ts provider: string; ``` Defined in: [costs/types.ts:157](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L157) Provider name ##### sessionId? ```ts optional sessionId?: string; ``` Defined in: [costs/types.ts:161](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L161) Session ID override ##### tokens ```ts tokens: TokenUsage; ``` Defined in: [costs/types.ts:159](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L159) Token usage *** ### RegisteredHook Defined in: [hooks/types.ts:405](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L405) Internal representation of a registered hook #### Type Parameters | Type Parameter | | ------ | | `T` | #### Properties ##### hook ```ts hook: T; ``` Defined in: [hooks/types.ts:414](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L414) The hook function ##### id ```ts id: string; ``` Defined in: [hooks/types.ts:409](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L409) Unique ID for this hook registration ##### name? ```ts optional name?: string; ``` Defined in: [hooks/types.ts:419](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L419) Optional name for debugging ##### priority? ```ts optional priority?: number; ``` Defined in: [hooks/types.ts:424](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L424) Priority (lower = runs first, default: 0) *** ### RehearsalAnalyzer Defined in: [rehearsal/types.ts:200](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L200) Interface for operation-specific analyzers #### Properties ##### category ```ts readonly category: OperationCategory; ``` Defined in: [rehearsal/types.ts:214](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L214) Category of operations this analyzer handles ##### id ```ts readonly id: string; ``` Defined in: [rehearsal/types.ts:204](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L204) Unique identifier for this analyzer ##### name ```ts readonly name: string; ``` Defined in: [rehearsal/types.ts:209](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L209) Human-readable name ##### patterns ```ts readonly patterns: RegExp[]; ``` Defined in: [rehearsal/types.ts:219](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L219) Patterns that this analyzer can handle #### Methods ##### analyze() ```ts analyze(operation, context): Promise; ``` Defined in: [rehearsal/types.ts:229](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L229) Analyze the operation and return impact assessment ###### Parameters | Parameter | Type | | ------ | ------ | | `operation` | `string` | | `context` | [`RehearsalContext`](#rehearsalcontext) | ###### Returns `Promise`\<[`RehearsalResult`](#rehearsalresult)\> ##### canAnalyze() ```ts canAnalyze(operation): boolean; ``` Defined in: [rehearsal/types.ts:224](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L224) Check if this analyzer can handle the given operation ###### Parameters | Parameter | Type | | ------ | ------ | | `operation` | `string` | ###### Returns `boolean` *** ### RehearsalContext Defined in: [rehearsal/types.ts:165](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L165) Context provided to analyzers for better impact assessment #### Properties ##### agentContext? ```ts optional agentContext?: Record; ``` Defined in: [rehearsal/types.ts:194](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L194) Additional context from the agent ##### currentBranch? ```ts optional currentBranch?: string; ``` Defined in: [rehearsal/types.ts:179](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L179) Current git branch (if in a git repo) ##### isGitRepo? ```ts optional isGitRepo?: boolean; ``` Defined in: [rehearsal/types.ts:174](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L174) Whether we're in a git repository ##### sessionModifiedFiles? ```ts optional sessionModifiedFiles?: string[]; ``` Defined in: [rehearsal/types.ts:184](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L184) Files that have been modified in this session ##### sessionStartTime? ```ts optional sessionStartTime?: Date; ``` Defined in: [rehearsal/types.ts:189](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L189) Start time of the current session (for time investment calculation) ##### workingDirectory ```ts workingDirectory: string; ``` Defined in: [rehearsal/types.ts:169](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L169) Working directory for the operation *** ### RehearsalEvent Defined in: [rehearsal/types.ts:280](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L280) Events emitted during rehearsal #### Properties ##### operation ```ts operation: string; ``` Defined in: [rehearsal/types.ts:282](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L282) ##### result? ```ts optional result?: RehearsalResult; ``` Defined in: [rehearsal/types.ts:283](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L283) ##### timestamp ```ts timestamp: Date; ``` Defined in: [rehearsal/types.ts:284](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L284) ##### type ```ts type: RehearsalEventType; ``` Defined in: [rehearsal/types.ts:281](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L281) *** ### RehearsalImpact Defined in: [rehearsal/types.ts:64](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L64) Detailed impact analysis of a destructive operation #### Properties ##### affectedFiles ```ts affectedFiles: AffectedFile[]; ``` Defined in: [rehearsal/types.ts:78](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L78) List of affected files with details ##### dataSize? ```ts optional dataSize?: number; ``` Defined in: [rehearsal/types.ts:94](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L94) Size of data that would be affected (in bytes) ##### estimatedWorkHours? ```ts optional estimatedWorkHours?: number; ``` Defined in: [rehearsal/types.ts:89](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L89) Estimated hours of work that could be lost ##### filesAffected ```ts filesAffected: number; ``` Defined in: [rehearsal/types.ts:68](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L68) Total number of files that would be affected ##### linesAffected ```ts linesAffected: number; ``` Defined in: [rehearsal/types.ts:73](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L73) Total lines of code that would be changed/lost ##### summary ```ts summary: string; ``` Defined in: [rehearsal/types.ts:99](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L99) Human-readable summary of the impact ##### timeInvestment? ```ts optional timeInvestment?: string; ``` Defined in: [rehearsal/types.ts:84](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L84) Human-readable time investment summary e.g., "Files modified in the last 2 hours" *** ### RehearsalManagerOptions Defined in: [rehearsal/types.ts:235](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L235) Options for the RehearsalManager #### Properties ##### analyzers? ```ts optional analyzers?: RehearsalAnalyzer[]; ``` Defined in: [rehearsal/types.ts:244](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L244) Custom analyzers to add ##### includeBuiltinAnalyzers? ```ts optional includeBuiltinAnalyzers?: boolean; ``` Defined in: [rehearsal/types.ts:249](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L249) Whether to include built-in analyzers (default: true) ##### onRehearsal? ```ts optional onRehearsal?: (result) => void; ``` Defined in: [rehearsal/types.ts:259](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L259) Callback when a rehearsal is performed ###### Parameters | Parameter | Type | | ------ | ------ | | `result` | [`RehearsalResult`](#rehearsalresult) | ###### Returns `void` ##### sessionStartTime? ```ts optional sessionStartTime?: Date; ``` Defined in: [rehearsal/types.ts:264](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L264) Session start time for time investment calculations ##### trackSessionFiles? ```ts optional trackSessionFiles?: boolean; ``` Defined in: [rehearsal/types.ts:269](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L269) Track files modified during session ##### warningThreshold? ```ts optional warningThreshold?: ImpactSeverity; ``` Defined in: [rehearsal/types.ts:254](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L254) Minimum severity to trigger warnings (default: 'medium') ##### workingDirectory? ```ts optional workingDirectory?: string; ``` Defined in: [rehearsal/types.ts:239](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L239) Working directory (defaults to process.cwd()) *** ### RehearsalResult Defined in: [rehearsal/types.ts:105](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L105) Result of rehearsing a destructive operation #### Properties ##### alternatives? ```ts optional alternatives?: string[]; ``` Defined in: [rehearsal/types.ts:149](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L149) Suggested safer alternatives (if any) ##### analysisTimeMs ```ts analysisTimeMs: number; ``` Defined in: [rehearsal/types.ts:159](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L159) Time taken to perform the analysis (ms) ##### category ```ts category: OperationCategory; ``` Defined in: [rehearsal/types.ts:114](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L114) Category of the operation ##### impact ```ts impact: RehearsalImpact; ``` Defined in: [rehearsal/types.ts:129](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L129) Detailed impact analysis ##### isDestructive ```ts isDestructive: boolean; ``` Defined in: [rehearsal/types.ts:119](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L119) Whether this operation is considered destructive ##### isReversible ```ts isReversible: boolean; ``` Defined in: [rehearsal/types.ts:124](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L124) Whether the operation can be reversed/undone ##### operation ```ts operation: string; ``` Defined in: [rehearsal/types.ts:109](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L109) The original operation/command being rehearsed ##### recommendation ```ts recommendation: RehearsalRecommendation; ``` Defined in: [rehearsal/types.ts:144](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L144) Recommendation on how to proceed ##### severity ```ts severity: ImpactSeverity; ``` Defined in: [rehearsal/types.ts:134](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L134) Severity of the potential impact ##### warnings ```ts warnings: string[]; ``` Defined in: [rehearsal/types.ts:139](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L139) Warning messages about potential issues ##### workAtRisk? ```ts optional workAtRisk?: WorkAtRisk; ``` Defined in: [rehearsal/types.ts:154](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L154) Work episodes at risk from this operation (populated by episodic memory) *** ### RestorationHintMessage Defined in: [context/file-tracker.ts:112](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/file-tracker.ts#L112) A single restoration hint message for post-compaction context injection #### Properties ##### path ```ts path: string; ``` Defined in: [context/file-tracker.ts:114](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/file-tracker.ts#L114) File path ##### text ```ts text: string; ``` Defined in: [context/file-tracker.ts:120](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/file-tracker.ts#L120) The formatted hint text ##### tokens ```ts tokens: number; ``` Defined in: [context/file-tracker.ts:123](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/file-tracker.ts#L123) Estimated token count of this hint ##### type ```ts type: "inline" | "reference"; ``` Defined in: [context/file-tracker.ts:117](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/file-tracker.ts#L117) Whether content is inlined or just referenced *** ### ResumeOptions Defined in: [state/types.ts:341](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L341) Options for resuming an agent from a checkpoint. #### Properties ##### checkpointer ```ts checkpointer: Checkpointer; ``` Defined in: [state/types.ts:350](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L350) Checkpointer to load from ##### onEvent? ```ts optional onEvent?: (event) => void; ``` Defined in: [state/types.ts:365](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L365) Event handler ###### Parameters | Parameter | Type | | ------ | ------ | | `event` | `unknown` | ###### Returns `void` ##### provider ```ts provider: unknown; ``` Defined in: [state/types.ts:345](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L345) LLM provider to use ##### systemPrompt? ```ts optional systemPrompt?: string; ``` Defined in: [state/types.ts:355](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L355) Override saved system prompt ##### tools? ```ts optional tools?: unknown[]; ``` Defined in: [state/types.ts:360](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L360) Override saved tools *** ### RetryConfig Defined in: [rate-limit/types.ts:81](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/types.ts#L81) Configuration for automatic retry #### Properties ##### backoffMultiplier? ```ts optional backoffMultiplier?: number; ``` Defined in: [rate-limit/types.ts:104](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/types.ts#L104) Multiplier for exponential backoff ###### Default ```ts 2 ``` ##### baseDelayMs? ```ts optional baseDelayMs?: number; ``` Defined in: [rate-limit/types.ts:92](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/types.ts#L92) Base delay between retries in milliseconds ###### Default ```ts 1000 ``` ##### isRetryable? ```ts optional isRetryable?: (error) => boolean; ``` Defined in: [rate-limit/types.ts:116](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/types.ts#L116) Custom function to determine if an error is retryable If not provided, uses default logic (429, 5xx, connection errors) ###### Parameters | Parameter | Type | | ------ | ------ | | `error` | `Error` | ###### Returns `boolean` ##### jitter? ```ts optional jitter?: boolean; ``` Defined in: [rate-limit/types.ts:110](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/types.ts#L110) Whether to add random jitter to delays ###### Default ```ts true ``` ##### maxDelayMs? ```ts optional maxDelayMs?: number; ``` Defined in: [rate-limit/types.ts:98](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/types.ts#L98) Maximum delay between retries in milliseconds ###### Default ```ts 60000 ``` ##### maxRetries? ```ts optional maxRetries?: number; ``` Defined in: [rate-limit/types.ts:86](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/types.ts#L86) Maximum number of retry attempts ###### Default ```ts 3 ``` ##### onRetry? ```ts optional onRetry?: (attempt, error, delayMs) => void; ``` Defined in: [rate-limit/types.ts:121](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/types.ts#L121) Callback invoked before each retry attempt ###### Parameters | Parameter | Type | | ------ | ------ | | `attempt` | `number` | | `error` | `Error` | | `delayMs` | `number` | ###### Returns `void` *** ### RunOptions Defined in: [agent.ts:723](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L723) Options for a single run #### Properties ##### chatOptions? ```ts optional chatOptions?: ChatOptions; ``` Defined in: [agent.ts:737](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L737) Override chat options for this run ##### getToolContext? ```ts optional getToolContext?: (toolName, toolUseId) => Partial>; ``` Defined in: [agent.ts:782](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L782) Callback to provide additional tool execution context. Called before each tool execution, allowing the caller to inject abort signals or other context-specific options. ###### Parameters | Parameter | Type | | ------ | ------ | | `toolName` | `string` | | `toolUseId` | `string` | ###### Returns `Partial`\<`Omit`\<`ToolExecutionContext`, `"toolUseId"` \| `"onOutput"`\>\> ###### Example ```typescript // Provide abort signal for bash commands (for Ctrl+B backgrounding) const bashAbortController = new AbortController(); await agent.stream(message, { getToolContext: (toolName, toolUseId) => { if (toolName === 'bash') { return { abortSignal: bashAbortController.signal, onBackground: (shellId, output) => { ... }, }; } return {}; }, }); ``` ##### maxIterations? ```ts optional maxIterations?: number; ``` Defined in: [agent.ts:732](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L732) Override max iterations for this run ##### onEvent? ```ts optional onEvent?: AgentEventHandler; ``` Defined in: [agent.ts:742](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L742) Event handler for this run (in addition to config handler) ##### signal? ```ts optional signal?: AbortSignal; ``` Defined in: [agent.ts:727](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L727) AbortSignal for cancellation ##### toolFilter? ```ts optional toolFilter?: string[]; ``` Defined in: [agent.ts:758](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L758) Filter tools for this run. - If provided, only these tool names will be available - Reduces token usage by not sending unused tool definitions - Tools must be registered with the agent ###### Example ```typescript // Only allow file and search tools for this request await agent.run(message, { toolFilter: ['read_file', 'write_file', 'grep', 'glob'], }); ``` *** ### SerializedAnchor Defined in: [anchors/types.ts:199](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L199) Serialized anchor for persistence #### Properties ##### content ```ts content: string; ``` Defined in: [anchors/types.ts:201](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L201) ##### createdAt ```ts createdAt: string; ``` Defined in: [anchors/types.ts:204](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L204) ##### expiresAt? ```ts optional expiresAt?: string; ``` Defined in: [anchors/types.ts:205](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L205) ##### id ```ts id: string; ``` Defined in: [anchors/types.ts:200](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L200) ##### metadata? ```ts optional metadata?: Record; ``` Defined in: [anchors/types.ts:207](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L207) ##### priority ```ts priority: AnchorPriority; ``` Defined in: [anchors/types.ts:202](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L202) ##### projectId? ```ts optional projectId?: string; ``` Defined in: [anchors/types.ts:208](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L208) ##### scope ```ts scope: AnchorScope; ``` Defined in: [anchors/types.ts:203](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L203) ##### tags? ```ts optional tags?: string[]; ``` Defined in: [anchors/types.ts:206](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L206) *** ### SessionInfo Defined in: [state/types.ts:125](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L125) Lightweight session info for listing (without full state). #### Properties ##### createdAt ```ts createdAt: string; ``` Defined in: [state/types.ts:139](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L139) Creation timestamp (ISO 8601) ##### messageCount ```ts messageCount: number; ``` Defined in: [state/types.ts:149](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L149) Number of messages ##### name? ```ts optional name?: string; ``` Defined in: [state/types.ts:134](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L134) User-friendly session name ##### preview? ```ts optional preview?: string; ``` Defined in: [state/types.ts:154](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L154) Preview text (last message truncated) ##### sessionId ```ts sessionId: string; ``` Defined in: [state/types.ts:129](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L129) Session identifier ##### tags? ```ts optional tags?: string[]; ``` Defined in: [state/types.ts:159](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L159) Tags for organization ##### updatedAt ```ts updatedAt: string; ``` Defined in: [state/types.ts:144](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L144) Last update timestamp (ISO 8601) *** ### SessionMetadata Defined in: [state/types.ts:80](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L80) Metadata stored alongside state for listing/filtering. #### Properties ##### createdAt ```ts createdAt: string; ``` Defined in: [state/types.ts:94](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L94) Creation timestamp (ISO 8601) ##### lastAssistantMessage? ```ts optional lastAssistantMessage?: string; ``` Defined in: [state/types.ts:114](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L114) Truncated preview of last assistant message ##### lastUserMessage? ```ts optional lastUserMessage?: string; ``` Defined in: [state/types.ts:109](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L109) Truncated preview of last user message ##### messageCount ```ts messageCount: number; ``` Defined in: [state/types.ts:104](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L104) Number of messages in the conversation ##### name? ```ts optional name?: string; ``` Defined in: [state/types.ts:89](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L89) User-friendly session name ##### sessionId ```ts sessionId: string; ``` Defined in: [state/types.ts:84](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L84) Session identifier ##### tags? ```ts optional tags?: string[]; ``` Defined in: [state/types.ts:119](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L119) Tags for organization ##### updatedAt ```ts updatedAt: string; ``` Defined in: [state/types.ts:99](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L99) Last update timestamp (ISO 8601) *** ### Skill Defined in: [skills/index.ts:12](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/skills/index.ts#L12) Skill definition #### Properties ##### description ```ts description: string; ``` Defined in: [skills/index.ts:21](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/skills/index.ts#L21) Human-readable description of what the skill does ##### enabled? ```ts optional enabled?: boolean; ``` Defined in: [skills/index.ts:41](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/skills/index.ts#L41) Whether this skill is enabled (default: true) ##### name ```ts name: string; ``` Defined in: [skills/index.ts:16](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/skills/index.ts#L16) Unique identifier for the skill ##### prompt ```ts prompt: string; ``` Defined in: [skills/index.ts:26](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/skills/index.ts#L26) The prompt content that will be expanded when the skill is invoked ##### tags? ```ts optional tags?: string[]; ``` Defined in: [skills/index.ts:31](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/skills/index.ts#L31) Optional tags for categorization ##### version? ```ts optional version?: string; ``` Defined in: [skills/index.ts:36](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/skills/index.ts#L36) Optional version string *** ### SkillInvocationResult Defined in: [skills/index.ts:47](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/skills/index.ts#L47) Result of invoking a skill #### Properties ##### error? ```ts optional error?: string; ``` Defined in: [skills/index.ts:66](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/skills/index.ts#L66) Error message if invocation failed ##### prompt ```ts prompt: string; ``` Defined in: [skills/index.ts:56](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/skills/index.ts#L56) The expanded prompt content ##### skill ```ts skill: Skill; ``` Defined in: [skills/index.ts:51](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/skills/index.ts#L51) The skill that was invoked ##### success ```ts success: boolean; ``` Defined in: [skills/index.ts:61](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/skills/index.ts#L61) Whether the invocation was successful *** ### SkillInvokeOptions Defined in: [skills/index.ts:72](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/skills/index.ts#L72) Options for skill invocation #### Properties ##### context? ```ts optional context?: string; ``` Defined in: [skills/index.ts:82](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/skills/index.ts#L82) Additional context to prepend to the prompt ##### variables? ```ts optional variables?: Record; ``` Defined in: [skills/index.ts:77](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/skills/index.ts#L77) Variables to interpolate into the skill prompt Use {{variable}} syntax in the prompt template *** ### Span Defined in: [tracing/types.ts:38](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L38) A trace span representing a unit of work #### Properties ##### attributes ```ts attributes: SpanAttributes; ``` Defined in: [tracing/types.ts:60](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L60) Span attributes ##### durationMs? ```ts optional durationMs?: number; ``` Defined in: [tracing/types.ts:54](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L54) Duration in milliseconds (undefined if still active) ##### endTime? ```ts optional endTime?: number; ``` Defined in: [tracing/types.ts:52](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L52) End time in milliseconds since epoch (undefined if still active) ##### events ```ts events: SpanEvent[]; ``` Defined in: [tracing/types.ts:62](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L62) Span events (timestamped annotations) ##### kind ```ts kind: SpanKind; ``` Defined in: [tracing/types.ts:48](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L48) Span kind ##### name ```ts name: string; ``` Defined in: [tracing/types.ts:46](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L46) Human-readable span name ##### parentSpanId? ```ts optional parentSpanId?: string; ``` Defined in: [tracing/types.ts:44](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L44) Parent span ID (undefined for root spans) ##### spanId ```ts spanId: string; ``` Defined in: [tracing/types.ts:40](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L40) Unique span identifier ##### startTime ```ts startTime: number; ``` Defined in: [tracing/types.ts:50](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L50) Start time in milliseconds since epoch ##### status ```ts status: SpanStatus; ``` Defined in: [tracing/types.ts:56](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L56) Span status ##### statusMessage? ```ts optional statusMessage?: string; ``` Defined in: [tracing/types.ts:58](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L58) Status message (typically for errors) ##### traceId ```ts traceId: string; ``` Defined in: [tracing/types.ts:42](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L42) Trace ID this span belongs to *** ### SpanContext Defined in: [tracing/types.ts:80](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L80) Context for creating a new span #### Properties ##### parentSpanId? ```ts optional parentSpanId?: string; ``` Defined in: [tracing/types.ts:84](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L84) Parent span ID ##### traceId ```ts traceId: string; ``` Defined in: [tracing/types.ts:82](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L82) Trace ID *** ### SpanEvent Defined in: [tracing/types.ts:68](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L68) Event within a span (timestamped annotation) #### Properties ##### attributes? ```ts optional attributes?: SpanAttributes; ``` Defined in: [tracing/types.ts:74](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L74) Event attributes ##### name ```ts name: string; ``` Defined in: [tracing/types.ts:70](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L70) Event name ##### timestamp ```ts timestamp: number; ``` Defined in: [tracing/types.ts:72](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L72) Timestamp in milliseconds since epoch *** ### StartSpanOptions Defined in: [tracing/types.ts:177](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L177) Options for starting a span #### Properties ##### attributes? ```ts optional attributes?: SpanAttributes; ``` Defined in: [tracing/types.ts:185](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L185) Initial attributes ##### kind? ```ts optional kind?: SpanKind; ``` Defined in: [tracing/types.ts:181](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L181) Span kind (default: internal) ##### name ```ts name: string; ``` Defined in: [tracing/types.ts:179](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L179) Span name ##### parentContext? ```ts optional parentContext?: SpanContext; ``` Defined in: [tracing/types.ts:183](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L183) Parent span context (if not provided, uses current context) ##### startTime? ```ts optional startTime?: number; ``` Defined in: [tracing/types.ts:187](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L187) Start time override (default: now) *** ### StateSerializer Defined in: [state/types.ts:169](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L169) Handles conversion between AgentState and string representation. #### Properties ##### version ```ts readonly version: string; ``` Defined in: [state/types.ts:191](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L191) Version identifier for migration support #### Methods ##### deserialize() ```ts deserialize(data): AgentState; ``` Defined in: [state/types.ts:179](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L179) Deserialize string back to agent state ###### Parameters | Parameter | Type | | ------ | ------ | | `data` | `string` | ###### Returns [`AgentState`](#agentstate) ###### Throws StateError if data is invalid ##### migrate()? ```ts optional migrate(data, fromVersion): string; ``` Defined in: [state/types.ts:196](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L196) Optional migration from older versions ###### Parameters | Parameter | Type | | ------ | ------ | | `data` | `string` | | `fromVersion` | `string` | ###### Returns `string` ##### serialize() ```ts serialize(state): string; ``` Defined in: [state/types.ts:173](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L173) Serialize agent state to string ###### Parameters | Parameter | Type | | ------ | ------ | | `state` | [`AgentState`](#agentstate) | ###### Returns `string` ##### validate() ```ts validate(state): void; ``` Defined in: [state/types.ts:186](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L186) Validate state before serialization. Called by checkpointers before saving to prevent corrupted checkpoints. ###### Parameters | Parameter | Type | | ------ | ------ | | `state` | [`AgentState`](#agentstate) | ###### Returns `void` ###### Throws StateError if state is invalid *** ### StoredResult Defined in: [context/delegation-types.ts:46](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/delegation-types.ts#L46) A stored full result that was replaced by a summary. #### Properties ##### expiresAt ```ts expiresAt: number; ``` Defined in: [context/delegation-types.ts:72](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/delegation-types.ts#L72) Timestamp when this result expires ##### fullContent ```ts fullContent: string; ``` Defined in: [context/delegation-types.ts:57](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/delegation-types.ts#L57) The full serialized result content ##### fullTokens ```ts fullTokens: number; ``` Defined in: [context/delegation-types.ts:60](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/delegation-types.ts#L60) Token count of the full content ##### id ```ts id: string; ``` Defined in: [context/delegation-types.ts:48](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/delegation-types.ts#L48) Unique delegation ID, e.g., 'dr_1707900000_0' ##### storedAt ```ts storedAt: number; ``` Defined in: [context/delegation-types.ts:69](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/delegation-types.ts#L69) Timestamp when stored ##### summary ```ts summary: string; ``` Defined in: [context/delegation-types.ts:63](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/delegation-types.ts#L63) The generated summary ##### summaryTokens ```ts summaryTokens: number; ``` Defined in: [context/delegation-types.ts:66](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/delegation-types.ts#L66) Token count of the summary ##### toolInput ```ts toolInput: Record; ``` Defined in: [context/delegation-types.ts:54](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/delegation-types.ts#L54) Input parameters passed to the tool ##### toolName ```ts toolName: string; ``` Defined in: [context/delegation-types.ts:51](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/delegation-types.ts#L51) Name of the tool that produced the result *** ### StreamChunk Defined in: [providers/types.ts:112](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L112) Streaming chunk types #### Properties ##### model? ```ts optional model?: string; ``` Defined in: [providers/types.ts:147](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L147) Model that generated this response (only present on 'done' chunks) ##### stopReason? ```ts optional stopReason?: string; ``` Defined in: [providers/types.ts:156](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L156) Stop reason (only present on 'done' chunks). - 'end_turn': Normal completion - 'max_tokens': Hit max_tokens limit - 'refusal': Model refused the request (Claude 4.5+) - 'context_window_exceeded': Hit context window limit (Claude 4.5+) - 'tool_use': Model wants to call a tool ##### text? ```ts optional text?: string; ``` Defined in: [providers/types.ts:122](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L122) ##### thinking? ```ts optional thinking?: { signature?: string; thinking?: string; }; ``` Defined in: [providers/types.ts:136](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L136) Thinking block data (for thinking_start/thinking_end) ###### signature? ```ts optional signature?: string; ``` ###### thinking? ```ts optional thinking?: string; ``` ##### toolUse? ```ts optional toolUse?: { id: string; input?: Record; name: string; signature?: string; }; ``` Defined in: [providers/types.ts:123](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L123) ###### id ```ts id: string; ``` ###### input? ```ts optional input?: Record; ``` ###### name ```ts name: string; ``` ###### signature? ```ts optional signature?: string; ``` Thought signature for Gemini 3 function calls. Only present on first function call in each step. ##### type ```ts type: | "text" | "tool_use_start" | "tool_use_delta" | "tool_use_end" | "thinking_start" | "thinking_delta" | "thinking_end" | "done"; ``` Defined in: [providers/types.ts:113](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L113) ##### usage? ```ts optional usage?: LLMUsage; ``` Defined in: [providers/types.ts:143](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L143) Token usage (only present on 'done' chunks) *** ### StructuredLogger Defined in: [tracing/types.ts:302](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L302) Logger interface for structured logging #### Methods ##### child() ```ts child(context): StructuredLogger; ``` Defined in: [tracing/types.ts:308](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L308) Create a child logger with additional context ###### Parameters | Parameter | Type | | ------ | ------ | | `context` | `Record`\<`string`, `unknown`\> | ###### Returns [`StructuredLogger`](#structuredlogger) ##### debug() ```ts debug(message, data?): void; ``` Defined in: [tracing/types.ts:303](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L303) ###### Parameters | Parameter | Type | | ------ | ------ | | `message` | `string` | | `data?` | `Record`\<`string`, `unknown`\> | ###### Returns `void` ##### error() ```ts error( message, error?, data?): void; ``` Defined in: [tracing/types.ts:306](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L306) ###### Parameters | Parameter | Type | | ------ | ------ | | `message` | `string` | | `error?` | `Error` | | `data?` | `Record`\<`string`, `unknown`\> | ###### Returns `void` ##### info() ```ts info(message, data?): void; ``` Defined in: [tracing/types.ts:304](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L304) ###### Parameters | Parameter | Type | | ------ | ------ | | `message` | `string` | | `data?` | `Record`\<`string`, `unknown`\> | ###### Returns `void` ##### setCorrelation() ```ts setCorrelation( traceId?, spanId?, sessionId?): void; ``` Defined in: [tracing/types.ts:310](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L310) Set correlation IDs ###### Parameters | Parameter | Type | | ------ | ------ | | `traceId?` | `string` | | `spanId?` | `string` | | `sessionId?` | `string` | ###### Returns `void` ##### warn() ```ts warn(message, data?): void; ``` Defined in: [tracing/types.ts:305](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L305) ###### Parameters | Parameter | Type | | ------ | ------ | | `message` | `string` | | `data?` | `Record`\<`string`, `unknown`\> | ###### Returns `void` *** ### StructuredLoggerOptions Defined in: [tracing/types.ts:316](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L316) Options for creating a structured logger #### Properties ##### context? ```ts optional context?: Record; ``` Defined in: [tracing/types.ts:326](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L326) Initial context ##### level? ```ts optional level?: LogLevel; ``` Defined in: [tracing/types.ts:318](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L318) Minimum log level ##### output? ```ts optional output?: (entry) => void; ``` Defined in: [tracing/types.ts:324](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L324) Output function (default: console.log) ###### Parameters | Parameter | Type | | ------ | ------ | | `entry` | [`LogEntry`](#logentry) | ###### Returns `void` ##### prettyPrint? ```ts optional prettyPrint?: boolean; ``` Defined in: [tracing/types.ts:322](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L322) Pretty print JSON (default: false for production) ##### serviceName? ```ts optional serviceName?: string; ``` Defined in: [tracing/types.ts:320](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L320) Service name *** ### SubAgentConfig Defined in: [agent.ts:830](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L830) Configuration for creating a sub-agent #### Properties ##### autoDispose? ```ts optional autoDispose?: boolean; ``` Defined in: [agent.ts:884](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L884) Automatically dispose the sub-agent after each execution. This releases memory but requires re-creation for subsequent runs. Default: false (sub-agent persists for reuse) ##### chatOptions? ```ts optional chatOptions?: ChatOptions; ``` Defined in: [agent.ts:871](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L871) Chat options override for this sub-agent ##### contextBudget? ```ts optional contextBudget?: number; ``` Defined in: [agent.ts:877](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L877) Maximum tokens for this sub-agent's context budget. Default: 25% of parent's context budget. ##### contextMode? ```ts optional contextMode?: "isolated" | "inherited" | "shared"; ``` Defined in: [agent.ts:854](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L854) Context mode for this sub-agent. - 'isolated': Fresh context, no parent history (default) - 'inherited': Receives a summary of parent context - 'shared': Full access to parent context (not recommended for large contexts) ##### description? ```ts optional description?: string; ``` Defined in: [agent.ts:840](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L840) Description of what this sub-agent specializes in. Used for automatic delegation decisions. ##### inheritPermissions? ```ts optional inheritPermissions?: boolean; ``` Defined in: [agent.ts:922](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L922) Inherit parent's permission manager. When true (default), the sub-agent uses the parent's PermissionManager, sharing session grants and permission rules. This ensures: - Sub-agents follow the same permission rules as parent - Session grants from parent are available to sub-agents - User sees permission prompts for sub-agent tool usage Set to false to allow sub-agents to bypass permissions (use with caution). Default: true ##### maxIterations? ```ts optional maxIterations?: number; ``` Defined in: [agent.ts:866](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L866) Maximum iterations for this sub-agent (default: 5) ##### maxToolResultSize? ```ts optional maxToolResultSize?: number; ``` Defined in: [agent.ts:891](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L891) Maximum size (in bytes) for tool result data returned in SubAgentResult. Larger results are truncated to prevent memory bloat. Default: 50KB ##### name ```ts name: string; ``` Defined in: [agent.ts:834](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L834) Unique name for this sub-agent ##### stateIsolation? ```ts optional stateIsolation?: boolean; ``` Defined in: [agent.ts:907](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L907) Enable state isolation for this sub-agent. When true, the sub-agent uses an isolated todo store instead of the shared default store. This prevents state leakage between parallel sub-agent executions. Automatically enabled when using runParallelSubAgents(). Inspired by LangGraph issue #6446: Parallel subgraphs with shared state keys cause InvalidUpdateError. Default: false (uses shared store) ##### systemPrompt? ```ts optional systemPrompt?: string; ``` Defined in: [agent.ts:846](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L846) System prompt for this sub-agent. If not provided, inherits from parent. ##### tools? ```ts optional tools?: Tool[]; ``` Defined in: [agent.ts:861](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L861) Tools available to this sub-agent. - If not specified, inherits parent's tools - Can be a subset of parent's tools for safety *** ### SubAgentEventInfo Defined in: [tools/builtin/task.ts:164](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/task.ts#L164) Sub-agent event with source information #### Properties ##### agentName ```ts agentName: string; ``` Defined in: [tools/builtin/task.ts:168](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/task.ts#L168) Name of the sub-agent that emitted this event ##### agentType ```ts agentType: string; ``` Defined in: [tools/builtin/task.ts:173](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/task.ts#L173) Type of the sub-agent ##### event ```ts event: AgentEvent; ``` Defined in: [tools/builtin/task.ts:183](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/task.ts#L183) The original event from the sub-agent ##### toolUseId? ```ts optional toolUseId?: string; ``` Defined in: [tools/builtin/task.ts:178](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/task.ts#L178) Tool use ID for correlation with parent tool call *** ### SubAgentResult Defined in: [agent.ts:928](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L928) Result from a sub-agent execution #### Properties ##### contextStats? ```ts optional contextStats?: ContextStats; ``` Defined in: [agent.ts:962](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L962) Context stats for the sub-agent's execution ##### error? ```ts optional error?: string; ``` Defined in: [agent.ts:947](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L947) Error message if execution failed ##### iterations ```ts iterations: number; ``` Defined in: [agent.ts:952](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L952) Number of iterations used ##### name ```ts name: string; ``` Defined in: [agent.ts:932](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L932) Name of the sub-agent that executed ##### response ```ts response: string; ``` Defined in: [agent.ts:937](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L937) Final response from the sub-agent ##### success ```ts success: boolean; ``` Defined in: [agent.ts:942](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L942) Whether the execution was successful ##### toolCalls ```ts toolCalls: { input: Record; name: string; result: ToolExecutionResult; }[]; ``` Defined in: [agent.ts:957](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L957) Tool calls made by the sub-agent ###### input ```ts input: Record; ``` ###### name ```ts name: string; ``` ###### result ```ts result: ToolExecutionResult; ``` *** ### SuggestInput Defined in: [tools/builtin/suggest.ts:20](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/suggest.ts#L20) Input parameters for suggest tool #### Properties ##### action ```ts action: string; ``` Defined in: [tools/builtin/suggest.ts:24](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/suggest.ts#L24) The suggested action or command for the user to take next ##### reason? ```ts optional reason?: string; ``` Defined in: [tools/builtin/suggest.ts:29](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/suggest.ts#L29) Brief explanation of why this action is suggested (optional) *** ### SuggestToolOptions Defined in: [tools/builtin/suggest.ts:35](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/suggest.ts#L35) Options for creating the suggest tool #### Properties ##### onSuggest? ```ts optional onSuggest?: (event) => void; ``` Defined in: [tools/builtin/suggest.ts:40](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/suggest.ts#L40) Callback to emit suggest event The CLI captures this to display the suggestion ###### Parameters | Parameter | Type | | ------ | ------ | | `event` | \{ `action`: `string`; `reason?`: `string`; `type`: `"suggest"`; \} | | `event.action` | `string` | | `event.reason?` | `string` | | `event.type` | `"suggest"` | ###### Returns `void` *** ### SummarizationConfig Defined in: [context/types.ts:262](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L262) Summarization configuration - compresses entire history #### Properties ##### emergencyPreserveMessages ```ts emergencyPreserveMessages: number; ``` Defined in: [context/types.ts:291](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L291) Number of recent messages to preserve in emergency mode ###### Default ```ts 4 ``` ##### emergencyThreshold ```ts emergencyThreshold: number; ``` Defined in: [context/types.ts:279](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L279) Trigger emergency summarization (fewer preserved messages) ###### Default ```ts 0.95 (95%) ``` ##### maxRounds ```ts maxRounds: number; ``` Defined in: [context/types.ts:303](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L303) Maximum summarization rounds before throwing error ###### Default ```ts 3 ``` ##### preserveRecentMessages ```ts preserveRecentMessages: number; ``` Defined in: [context/types.ts:285](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L285) Number of recent messages to preserve in normal mode ###### Default ```ts 6 ``` ##### summaryMaxTokens ```ts summaryMaxTokens: number; ``` Defined in: [context/types.ts:297](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L297) Maximum tokens for the summary ###### Default ```ts 2000 ``` ##### targetUtilization ```ts targetUtilization: number; ``` Defined in: [context/types.ts:309](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L309) Target utilization after summarization ###### Default ```ts 0.70 (70%) ``` ##### triggerThreshold ```ts triggerThreshold: number; ``` Defined in: [context/types.ts:273](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L273) Trigger normal summarization when context utilization exceeds this threshold ###### Default ```ts 0.90 (90%) ``` ##### warningThreshold ```ts warningThreshold: number; ``` Defined in: [context/types.ts:267](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L267) Emit warning when context utilization exceeds this threshold ###### Default ```ts 0.80 (80%) ``` *** ### SummarizationResult Defined in: [context/types.ts:345](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L345) Result of a summarization operation #### Properties ##### emergency ```ts emergency: boolean; ``` Defined in: [context/types.ts:374](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L374) Whether emergency mode was used ##### messagesPreserved ```ts messagesPreserved: number; ``` Defined in: [context/types.ts:359](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L359) Number of messages preserved (not summarized) ##### originalTokens ```ts originalTokens: number; ``` Defined in: [context/types.ts:349](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L349) Tokens in original conversation ##### rounds ```ts rounds: number; ``` Defined in: [context/types.ts:369](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L369) Number of summarization rounds performed ##### summary ```ts summary: string; ``` Defined in: [context/types.ts:364](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L364) The generated summary text ##### summaryTokens ```ts summaryTokens: number; ``` Defined in: [context/types.ts:354](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L354) Tokens in summary *** ### TaskInput Defined in: [tools/builtin/task.ts:35](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/task.ts#L35) Input parameters for task tool #### Properties ##### context\_mode? ```ts optional context_mode?: ContextMode; ``` Defined in: [tools/builtin/task.ts:62](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/task.ts#L62) Context inheritance mode (default: from agent type config) - 'isolated': Fresh context, no parent history - 'inherit': Receives parent's full message history - 'inherit-summary': Receives summarized parent context ##### description ```ts description: string; ``` Defined in: [tools/builtin/task.ts:39](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/task.ts#L39) A short (3-5 word) description of the task ##### model? ```ts optional model?: string; ``` Defined in: [tools/builtin/task.ts:54](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/task.ts#L54) Optional model to use for this agent (e.g., 'sonnet', 'opus', 'haiku') ##### prompt ```ts prompt: string; ``` Defined in: [tools/builtin/task.ts:44](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/task.ts#L44) Detailed task prompt for the sub-agent to perform ##### subagent\_type ```ts subagent_type: string; ``` Defined in: [tools/builtin/task.ts:49](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/task.ts#L49) The type of specialized agent to use (e.g., 'explore', 'code-review', 'general') ##### thoroughness? ```ts optional thoroughness?: ThoroughnessLevel; ``` Defined in: [tools/builtin/task.ts:70](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/task.ts#L70) Thoroughness level for exploration agents (default: 'medium') - 'quick': Fast searches, basic analysis - 'medium': Balanced depth and speed - 'thorough': Comprehensive analysis, multiple passes *** ### TaskResult Defined in: [tools/builtin/task.ts:76](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/task.ts#L76) Result of task tool execution #### Properties ##### agentType ```ts agentType: string; ``` Defined in: [tools/builtin/task.ts:85](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/task.ts#L85) The agent type that was used ##### iterations ```ts iterations: number; ``` Defined in: [tools/builtin/task.ts:90](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/task.ts#L90) Number of iterations the sub-agent took ##### response ```ts response: string; ``` Defined in: [tools/builtin/task.ts:80](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/task.ts#L80) The sub-agent's response ##### toolCalls ```ts toolCalls: number; ``` Defined in: [tools/builtin/task.ts:95](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/task.ts#L95) Tool calls made by the sub-agent *** ### TaskToolOptions Defined in: [tools/builtin/task.ts:189](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/task.ts#L189) Options for creating a task tool #### Properties ##### agentTypes ```ts agentTypes: Record; ``` Defined in: [tools/builtin/task.ts:198](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/task.ts#L198) Available agent types and their configurations ##### defaultTimeout? ```ts optional defaultTimeout?: number; ``` Defined in: [tools/builtin/task.ts:214](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/task.ts#L214) Default timeout for sub-agent execution in ms (default: 300000 = 5 min) ##### enableEventStreaming? ```ts optional enableEventStreaming?: boolean; ``` Defined in: [tools/builtin/task.ts:242](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/task.ts#L242) Enable event streaming from sub-agents (default: false) When enabled, sub-agent events are forwarded to onSubAgentEvent ##### maxConcurrent? ```ts optional maxConcurrent?: number; ``` Defined in: [tools/builtin/task.ts:209](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/task.ts#L209) Maximum concurrent sub-agents (default: 3) ##### onComplete? ```ts optional onComplete?: (agentType, result, toolUseId?) => void; ``` Defined in: [tools/builtin/task.ts:230](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/task.ts#L230) Called when a sub-agent completes. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `agentType` | `string` | The type of agent that completed | | `result` | [`TaskResult`](#taskresult) | The task result | | `toolUseId?` | `string` | Tool use ID for correlation (enables parallel tracking) | ###### Returns `void` ##### onSpawn? ```ts optional onSpawn?: (agentType, description, toolUseId?) => void; ``` Defined in: [tools/builtin/task.ts:222](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/task.ts#L222) Called when a sub-agent is spawned. ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `agentType` | `string` | The type of agent being spawned | | `description` | `string` | Description of the task | | `toolUseId?` | `string` | Tool use ID for correlation (enables parallel tracking) | ###### Returns `void` ##### onSubAgentEvent? ```ts optional onSubAgentEvent?: (eventInfo) => void; ``` Defined in: [tools/builtin/task.ts:236](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/task.ts#L236) Called when a sub-agent emits an event (for real-time streaming) Only called if enableEventStreaming is true ###### Parameters | Parameter | Type | | ------ | ------ | | `eventInfo` | [`SubAgentEventInfo`](#subagenteventinfo) | ###### Returns `void` ##### parentAgent ```ts parentAgent: Agent; ``` Defined in: [tools/builtin/task.ts:193](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/task.ts#L193) The parent agent that will spawn sub-agents ##### providerFactory? ```ts optional providerFactory?: (model) => LLMProvider; ``` Defined in: [tools/builtin/task.ts:204](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/task.ts#L204) Provider factory for creating sub-agent providers Called with model name, returns LLM provider ###### Parameters | Parameter | Type | | ------ | ------ | | `model` | `string` | ###### Returns [`LLMProvider`](#llmprovider) *** ### TextBlock Defined in: [providers/types.ts:18](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L18) Text content block #### Properties ##### text ```ts text: string; ``` Defined in: [providers/types.ts:20](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L20) ##### type ```ts type: "text"; ``` Defined in: [providers/types.ts:19](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L19) *** ### TodoContextCleanupOptions Defined in: [tools/builtin/todo.ts:740](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/todo.ts#L740) Context cleanup options for todo tool calls #### Properties ##### cleanReads? ```ts optional cleanReads?: boolean; ``` Defined in: [tools/builtin/todo.ts:749](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/todo.ts#L749) Also clean up todo_read calls (default: false) ##### keepLastN? ```ts optional keepLastN?: number; ``` Defined in: [tools/builtin/todo.ts:744](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/todo.ts#L744) Keep only the last N todo_write calls (default: 1) *** ### TodoItem Defined in: [tools/builtin/todo.ts:19](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/todo.ts#L19) A single todo item #### Properties ##### activeForm? ```ts optional activeForm?: string; ``` Defined in: [tools/builtin/todo.ts:38](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/todo.ts#L38) Active form of the task (present continuous, e.g., "Implementing feature") ##### blockedBy? ```ts optional blockedBy?: number[]; ``` Defined in: [tools/builtin/todo.ts:55](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/todo.ts#L55) 1-based task numbers this task is blocked by. References positions in the todo array. ##### content ```ts content: string; ``` Defined in: [tools/builtin/todo.ts:28](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/todo.ts#L28) Task content/description (imperative form) ##### createdAt ```ts createdAt: Date; ``` Defined in: [tools/builtin/todo.ts:60](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/todo.ts#L60) Creation timestamp ##### id ```ts id: string; ``` Defined in: [tools/builtin/todo.ts:23](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/todo.ts#L23) Unique identifier for the todo ##### owner? ```ts optional owner?: string; ``` Defined in: [tools/builtin/todo.ts:49](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/todo.ts#L49) Owner agent ID (e.g., 'pm', 'arch', 'dev') If undefined/null, the task is unassigned ##### priority? ```ts optional priority?: number; ``` Defined in: [tools/builtin/todo.ts:43](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/todo.ts#L43) Optional priority (higher = more important) ##### status ```ts status: TodoStatus; ``` Defined in: [tools/builtin/todo.ts:33](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/todo.ts#L33) Current status of the task ##### updatedAt ```ts updatedAt: Date; ``` Defined in: [tools/builtin/todo.ts:65](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/todo.ts#L65) Last update timestamp *** ### TodoReadInput Defined in: [tools/builtin/todo.ts:88](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/todo.ts#L88) Input for TodoRead tool #### Properties ##### includeCompleted? ```ts optional includeCompleted?: boolean; ``` Defined in: [tools/builtin/todo.ts:97](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/todo.ts#L97) Include completed tasks (default: true) ##### owner? ```ts optional owner?: string; ``` Defined in: [tools/builtin/todo.ts:105](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/todo.ts#L105) Filter by owner (optional) - Specific agent ID: Return only tasks owned by that agent - 'unassigned': Return only tasks without an owner - undefined: Return all tasks (no filter) ##### status? ```ts optional status?: TodoStatus; ``` Defined in: [tools/builtin/todo.ts:92](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/todo.ts#L92) Filter by status (optional) *** ### TodoWriteInput Defined in: [tools/builtin/todo.ts:71](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/todo.ts#L71) Input for TodoWrite tool #### Properties ##### todos ```ts todos: { activeForm?: string; blockedBy?: number[]; content: string; owner?: string; priority?: number; status: TodoStatus; }[]; ``` Defined in: [tools/builtin/todo.ts:75](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/todo.ts#L75) The complete list of todos (replaces existing list) ###### activeForm? ```ts optional activeForm?: string; ``` ###### blockedBy? ```ts optional blockedBy?: number[]; ``` ###### content ```ts content: string; ``` ###### owner? ```ts optional owner?: string; ``` ###### priority? ```ts optional priority?: number; ``` ###### status ```ts status: TodoStatus; ``` *** ### TogetherProviderConfig Defined in: [providers/together.ts:32](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/together.ts#L32) Configuration for TogetherProvider #### Properties ##### apiKey? ```ts optional apiKey?: string; ``` Defined in: [providers/together.ts:34](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/together.ts#L34) Together AI API key (falls back to TOGETHER_API_KEY env var) ##### baseUrl? ```ts optional baseUrl?: string; ``` Defined in: [providers/together.ts:36](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/together.ts#L36) Base URL for Together API (default: https://api.together.xyz) ##### estimateTokens? ```ts optional estimateTokens?: (text) => number; ``` Defined in: [providers/together.ts:44](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/together.ts#L44) Optional token estimator (e.g., tiktoken) for debug payload ###### Parameters | Parameter | Type | | ------ | ------ | | `text` | `string` | ###### Returns `number` ##### maxTokens? ```ts optional maxTokens?: number; ``` Defined in: [providers/together.ts:40](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/together.ts#L40) Default max tokens (default: 4096) ##### model? ```ts optional model?: string; ``` Defined in: [providers/together.ts:38](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/together.ts#L38) Default model to use (default: meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo) ##### timeout? ```ts optional timeout?: number; ``` Defined in: [providers/together.ts:42](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/together.ts#L42) Request timeout in milliseconds (default: 120000) *** ### TokenBudgetConfig Defined in: [costs/types.ts:82](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L82) Token budget configuration #### Properties ##### maxInputTokens? ```ts optional maxInputTokens?: number; ``` Defined in: [costs/types.ts:86](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L86) Maximum input tokens allowed ##### maxOutputTokens? ```ts optional maxOutputTokens?: number; ``` Defined in: [costs/types.ts:88](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L88) Maximum output tokens allowed ##### maxTokensPerSession? ```ts optional maxTokensPerSession?: number; ``` Defined in: [costs/types.ts:90](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L90) Maximum tokens per session ##### maxTotalTokens? ```ts optional maxTotalTokens?: number; ``` Defined in: [costs/types.ts:84](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L84) Maximum total tokens allowed ##### warningThreshold? ```ts optional warningThreshold?: number; ``` Defined in: [costs/types.ts:92](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L92) Warning threshold (0-1, triggers warning event when utilization reaches this) *** ### TokenUsage Defined in: [costs/types.ts:12](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L12) Token usage for a single LLM call #### Properties ##### cacheCreationTokens? ```ts optional cacheCreationTokens?: number; ``` Defined in: [costs/types.ts:22](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L22) Cache creation tokens (if applicable) ##### cacheReadTokens? ```ts optional cacheReadTokens?: number; ``` Defined in: [costs/types.ts:20](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L20) Cache read tokens (if applicable) ##### inputTokens ```ts inputTokens: number; ``` Defined in: [costs/types.ts:14](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L14) Input/prompt tokens ##### outputTokens ```ts outputTokens: number; ``` Defined in: [costs/types.ts:16](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L16) Output/completion tokens ##### totalTokens ```ts totalTokens: number; ``` Defined in: [costs/types.ts:18](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L18) Total tokens (input + output) *** ### Tool Defined in: [tools/types.ts:119](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/types.ts#L119) A tool that the agent can call during conversations. Tools are the primary way agents interact with the outside world — reading files, running commands, querying APIs, etc. Each tool has a definition (name, description, parameters) that the LLM sees, and an execute function that runs when the LLM decides to call it. Use `defineTool()` to create tools with type-safe parameters. #### Example ```typescript const readFileTool: Tool<{ path: string }> = { definition: { name: 'read_file', description: 'Read the contents of a file', parameters: { type: 'object', properties: { path: { type: 'string', description: 'File path' } }, required: ['path'], }, }, execute: async ({ path }) => { const content = await fs.readFile(path, 'utf-8'); return { content }; }, readonly: true, // Safe for parallel execution }; ``` #### Type Parameters | Type Parameter | Default type | Description | | ------ | ------ | ------ | | `T` | `object` | The type of the tool's input parameters | #### Properties ##### definition ```ts definition: ToolDefinition; ``` Defined in: [tools/types.ts:120](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/types.ts#L120) ##### execute ```ts execute: ToolHandler; ``` Defined in: [tools/types.ts:121](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/types.ts#L121) ##### parallel? ```ts optional parallel?: boolean; ``` Defined in: [tools/types.ts:128](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/types.ts#L128) If true, multiple calls to this tool can execute in parallel. When the LLM requests multiple parallel-safe tools in one response, they will be executed concurrently using Promise.all. Default: false (sequential execution) ##### readonly? ```ts optional readonly?: boolean; ``` Defined in: [tools/types.ts:141](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/types.ts#L141) If true, this tool performs no side effects (only reads data). Read-only tools are automatically batched for parallel execution even in a mixed batch with write tools. Default: false ##### repeatable? ```ts optional repeatable?: boolean; ``` Defined in: [tools/types.ts:148](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/types.ts#L148) If true, this tool is exempt from tool-loop detection — repeated identical calls are always legitimate (e.g. genuinely idempotent pollers). Most polling tools do NOT need this: loop detection is result-aware, so calls that return changing output don't trip. Default: false. ##### silent? ```ts optional silent?: boolean; ``` Defined in: [tools/types.ts:134](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/types.ts#L134) If true, this tool runs silently without spinner updates or result output. Used for internal housekeeping tools like todo_read, suggest, etc. Default: false (normal visibility) *** ### ToolDefinition Defined in: [providers/types.ts:236](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L236) Tool definition for the LLM #### Properties ##### description ```ts description: string; ``` Defined in: [providers/types.ts:238](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L238) ##### inputSchema ```ts inputSchema: { properties: Record; required?: string[]; type: "object"; }; ``` Defined in: [providers/types.ts:239](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L239) ###### properties ```ts properties: Record; ``` ###### required? ```ts optional required?: string[]; ``` ###### type ```ts type: "object"; ``` ##### name ```ts name: string; ``` Defined in: [providers/types.ts:237](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L237) *** ### ToolExecutionResult Defined in: [tools/types.ts:26](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/types.ts#L26) Result of executing a tool #### Properties ##### error? ```ts optional error?: string; ``` Defined in: [tools/types.ts:29](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/types.ts#L29) ##### imageBlocks? ```ts optional imageBlocks?: { data: string; filename?: string; height?: number; mediaType: string; width?: number; }[]; ``` Defined in: [tools/types.ts:36](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/types.ts#L36) Optional image blocks to inject alongside the tool result. When present, these are added as sibling content blocks in the tool result message, enabling vision-capable LLMs to see images. Used by tools like view_image that return visual content. ###### data ```ts data: string; ``` ###### filename? ```ts optional filename?: string; ``` ###### height? ```ts optional height?: number; ``` ###### mediaType ```ts mediaType: string; ``` ###### width? ```ts optional width?: number; ``` ##### result? ```ts optional result?: unknown; ``` Defined in: [tools/types.ts:28](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/types.ts#L28) ##### success ```ts success: boolean; ``` Defined in: [tools/types.ts:27](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/types.ts#L27) *** ### ToolHookContext Defined in: [hooks/types.ts:216](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L216) Context for tool hooks #### Extends - [`HookContext`](#hookcontext) #### Extended by - [`AfterToolHookContext`](#aftertoolhookcontext) #### Properties ##### input ```ts input: Record; ``` Defined in: [hooks/types.ts:225](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L225) Input arguments for the tool ##### iteration ```ts iteration: number; ``` Defined in: [hooks/types.ts:28](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L28) Current iteration number (1-indexed) ###### Inherited from [`HookContext`](#hookcontext).[`iteration`](#iteration-3) ##### metadata ```ts metadata: Record; ``` Defined in: [hooks/types.ts:38](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L38) Custom metadata that can be passed between hooks ###### Inherited from [`HookContext`](#hookcontext).[`metadata`](#metadata-6) ##### sessionId ```ts sessionId: string; ``` Defined in: [hooks/types.ts:23](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L23) Current session ID ###### Inherited from [`HookContext`](#hookcontext).[`sessionId`](#sessionid-6) ##### signal? ```ts optional signal?: AbortSignal; ``` Defined in: [hooks/types.ts:33](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L33) Abort signal for cancellation ###### Inherited from [`HookContext`](#hookcontext).[`signal`](#signal-4) ##### toolName ```ts toolName: string; ``` Defined in: [hooks/types.ts:220](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L220) Name of the tool being executed *** ### ToolInputSchema Defined in: [tools/types.ts:8](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/types.ts#L8) JSON Schema for tool input parameters #### Properties ##### properties ```ts properties: Record; ``` Defined in: [tools/types.ts:10](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/types.ts#L10) ##### required? ```ts optional required?: string[]; ``` Defined in: [tools/types.ts:11](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/types.ts#L11) ##### type ```ts type: "object"; ``` Defined in: [tools/types.ts:9](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/types.ts#L9) *** ### ToolPairingValidation Defined in: [messages/index.ts:106](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/messages/index.ts#L106) Validation result for tool use/result pairing #### Properties ##### errors ```ts errors: string[]; ``` Defined in: [messages/index.ts:108](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/messages/index.ts#L108) ##### missingResults ```ts missingResults: string[]; ``` Defined in: [messages/index.ts:110](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/messages/index.ts#L110) ##### orphanedResults ```ts orphanedResults: string[]; ``` Defined in: [messages/index.ts:109](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/messages/index.ts#L109) ##### valid ```ts valid: boolean; ``` Defined in: [messages/index.ts:107](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/messages/index.ts#L107) *** ### ToolPermission Defined in: [permissions/types.ts:21](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/types.ts#L21) Permission rule for a specific tool #### Properties ##### description? ```ts optional description?: string; ``` Defined in: [permissions/types.ts:35](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/types.ts#L35) Human-readable description of why permission is needed ##### level ```ts level: PermissionLevel; ``` Defined in: [permissions/types.ts:30](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/types.ts#L30) Permission level for this tool ##### tags? ```ts optional tags?: string[]; ``` Defined in: [permissions/types.ts:40](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/types.ts#L40) Tags for grouping permissions ##### toolName ```ts toolName: string; ``` Defined in: [permissions/types.ts:25](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/types.ts#L25) Tool name or pattern (supports wildcards like 'bash*', '*_file') *** ### ToolRegistry Defined in: [tools/types.ts:169](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/types.ts#L169) Tool registry for managing available tools #### Methods ##### execute() ```ts execute( name, input, context?): Promise; ``` Defined in: [tools/types.ts:191](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/types.ts#L191) Execute a tool by name with given input ###### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `name` | `string` | Tool name | | `input` | `Record`\<`string`, `unknown`\> | Tool input parameters | | `context?` | `ToolExecutionContext` | Optional execution context for streaming | ###### Returns `Promise`\<[`ToolExecutionResult`](#toolexecutionresult)\> ##### get() ```ts get(name): Tool | undefined; ``` Defined in: [tools/types.ts:178](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/types.ts#L178) Get a tool by name ###### Parameters | Parameter | Type | | ------ | ------ | | `name` | `string` | ###### Returns [`Tool`](#tool)\<`object`\> \| `undefined` ##### getDefinitions() ```ts getDefinitions(): ToolDefinition[]; ``` Defined in: [tools/types.ts:183](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/types.ts#L183) Get all tool definitions (for sending to LLM) ###### Returns `ToolDefinition`[] ##### register() ```ts register(tool): void; ``` Defined in: [tools/types.ts:173](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/types.ts#L173) Register a tool ###### Parameters | Parameter | Type | | ------ | ------ | | `tool` | [`Tool`](#tool) | ###### Returns `void` ##### setFallbackHandler() ```ts setFallbackHandler(handler): void; ``` Defined in: [tools/types.ts:201](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/types.ts#L201) Set a fallback handler for tools not found in the primary registry. Enables transparent routing to secondary registries (e.g., meta-tools). ###### Parameters | Parameter | Type | | ------ | ------ | | `handler` | [`ToolFallbackHandler`](#toolfallbackhandler) \| `null` | ###### Returns `void` *** ### ToolRegistryOptions Defined in: [tools/registry.ts:26](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/registry.ts#L26) Options for creating a DefaultToolRegistry #### Properties ##### defaultTimeoutMs? ```ts optional defaultTimeoutMs?: number; ``` Defined in: [tools/registry.ts:31](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/registry.ts#L31) Default timeout for tool execution in milliseconds. Default: 30000 (30 seconds). Set to 0 to disable timeout. ##### fallbackHandler? ```ts optional fallbackHandler?: ToolFallbackHandler; ``` Defined in: [tools/registry.ts:42](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/registry.ts#L42) Fallback handler for tools not found in the primary registry. Enables transparent routing to secondary registries (e.g., meta-tools). ##### toolTimeouts? ```ts optional toolTimeouts?: Record; ``` Defined in: [tools/registry.ts:36](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/registry.ts#L36) Per-tool timeout overrides (tool name -> timeout in ms) *** ### ToolResult Defined in: [providers/types.ts:249](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L249) Result of a tool execution #### Properties ##### isError? ```ts optional isError?: boolean; ``` Defined in: [providers/types.ts:252](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L252) ##### result ```ts result: unknown; ``` Defined in: [providers/types.ts:251](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L251) ##### toolUseId ```ts toolUseId: string; ``` Defined in: [providers/types.ts:250](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L250) *** ### ToolResultBlock Defined in: [providers/types.ts:42](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L42) Tool result content block (result of a tool call) #### Properties ##### content ```ts content: string; ``` Defined in: [providers/types.ts:45](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L45) ##### isError? ```ts optional isError?: boolean; ``` Defined in: [providers/types.ts:46](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L46) ##### toolUseId ```ts toolUseId: string; ``` Defined in: [providers/types.ts:44](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L44) ##### type ```ts type: "tool_result"; ``` Defined in: [providers/types.ts:43](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L43) *** ### ToolResultDelegatorOptions Defined in: [context/tool-result-delegator.ts:19](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/tool-result-delegator.ts#L19) Options for creating a ToolResultDelegator. #### Properties ##### config? ```ts optional config?: Partial; ``` Defined in: [context/tool-result-delegator.ts:24](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/tool-result-delegator.ts#L24) Delegation configuration (merged with defaults) ##### onEvent? ```ts optional onEvent?: (event) => void; ``` Defined in: [context/tool-result-delegator.ts:27](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/tool-result-delegator.ts#L27) Event callback for delegation lifecycle events ###### Parameters | Parameter | Type | | ------ | ------ | | `event` | [`DelegationEvent`](#delegationevent) | ###### Returns `void` ##### provider ```ts provider: LLMProvider; ``` Defined in: [context/tool-result-delegator.ts:21](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/tool-result-delegator.ts#L21) LLM provider for summarization (small/medium tier preferred) *** ### ToolUseBlock Defined in: [providers/types.ts:26](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L26) Tool use content block (AI wants to call a tool) #### Properties ##### id ```ts id: string; ``` Defined in: [providers/types.ts:28](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L28) ##### input ```ts input: Record; ``` Defined in: [providers/types.ts:30](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L30) ##### name ```ts name: string; ``` Defined in: [providers/types.ts:29](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L29) ##### signature? ```ts optional signature?: string; ``` Defined in: [providers/types.ts:36](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L36) Thought signature for Gemini 3 function calls. Required for Gemini 3 to maintain reasoning context. ###### See https://ai.google.dev/gemini-api/docs/thought-signatures ##### type ```ts type: "tool_use"; ``` Defined in: [providers/types.ts:27](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L27) *** ### Trace Defined in: [tracing/types.ts:94](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L94) A complete trace containing multiple spans #### Properties ##### attributes ```ts attributes: SpanAttributes; ``` Defined in: [tracing/types.ts:108](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L108) Trace-level attributes ##### durationMs? ```ts optional durationMs?: number; ``` Defined in: [tracing/types.ts:106](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L106) Total duration in milliseconds ##### endTime? ```ts optional endTime?: number; ``` Defined in: [tracing/types.ts:104](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L104) Trace end time (undefined if still active) ##### rootSpanId ```ts rootSpanId: string; ``` Defined in: [tracing/types.ts:98](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L98) Root span ID ##### spans ```ts spans: Span[]; ``` Defined in: [tracing/types.ts:100](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L100) All spans in this trace ##### startTime ```ts startTime: number; ``` Defined in: [tracing/types.ts:102](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L102) Trace start time ##### traceId ```ts traceId: string; ``` Defined in: [tracing/types.ts:96](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L96) Unique trace identifier *** ### TracingHookContext Defined in: [tracing/types.ts:357](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L357) Context passed to tracing hooks #### Properties ##### manager ```ts manager: TracingManagerInterface; ``` Defined in: [tracing/types.ts:359](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L359) Tracing manager instance ##### sessionId ```ts sessionId: string; ``` Defined in: [tracing/types.ts:365](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L365) Session ID ##### spanContext? ```ts optional spanContext?: SpanContext; ``` Defined in: [tracing/types.ts:363](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L363) Current span context ##### traceId ```ts traceId: string; ``` Defined in: [tracing/types.ts:361](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L361) Current trace ID *** ### TracingHooksConfig Defined in: [tracing/types.ts:336](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L336) Configuration for built-in tracing hooks #### Properties ##### attributeMapper? ```ts optional attributeMapper?: (phase, data) => SpanAttributes; ``` Defined in: [tracing/types.ts:348](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L348) Custom attribute mapper ###### Parameters | Parameter | Type | | ------ | ------ | | `phase` | `"llm"` \| `"tool"` \| `"iteration"` | | `data` | `Record`\<`string`, `unknown`\> | ###### Returns [`SpanAttributes`](#spanattributes-1) ##### includeIO? ```ts optional includeIO?: boolean; ``` Defined in: [tracing/types.ts:344](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L344) Include input/output in attributes (may be verbose) ##### traceIterations? ```ts optional traceIterations?: boolean; ``` Defined in: [tracing/types.ts:342](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L342) Trace iterations ##### traceLLM? ```ts optional traceLLM?: boolean; ``` Defined in: [tracing/types.ts:338](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L338) Trace LLM calls ##### traceTools? ```ts optional traceTools?: boolean; ``` Defined in: [tracing/types.ts:340](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L340) Trace tool executions ##### truncateAt? ```ts optional truncateAt?: number; ``` Defined in: [tracing/types.ts:346](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L346) Truncate long values at this length *** ### TracingManagerInterface Defined in: [tracing/types.ts:371](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L371) Interface for TracingManager (for type references without circular deps) #### Methods ##### addSpanEvent() ```ts addSpanEvent( spanId, name, attributes?): void; ``` Defined in: [tracing/types.ts:376](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L376) ###### Parameters | Parameter | Type | | ------ | ------ | | `spanId` | `string` | | `name` | `string` | | `attributes?` | [`SpanAttributes`](#spanattributes-1) | ###### Returns `void` ##### endSpan() ```ts endSpan(spanId, options?): Span | undefined; ``` Defined in: [tracing/types.ts:375](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L375) ###### Parameters | Parameter | Type | | ------ | ------ | | `spanId` | `string` | | `options?` | [`EndSpanOptions`](#endspanoptions) | ###### Returns [`Span`](#span) \| `undefined` ##### endTrace() ```ts endTrace(traceId): Trace | undefined; ``` Defined in: [tracing/types.ts:373](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L373) ###### Parameters | Parameter | Type | | ------ | ------ | | `traceId` | `string` | ###### Returns [`Trace`](#trace) \| `undefined` ##### getCurrentSpan() ```ts getCurrentSpan(): Span | undefined; ``` Defined in: [tracing/types.ts:379](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L379) ###### Returns [`Span`](#span) \| `undefined` ##### getTrace() ```ts getTrace(traceId): Trace | undefined; ``` Defined in: [tracing/types.ts:380](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L380) ###### Parameters | Parameter | Type | | ------ | ------ | | `traceId` | `string` | ###### Returns [`Trace`](#trace) \| `undefined` ##### setSpanAttributes() ```ts setSpanAttributes(spanId, attributes): void; ``` Defined in: [tracing/types.ts:377](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L377) ###### Parameters | Parameter | Type | | ------ | ------ | | `spanId` | `string` | | `attributes` | [`SpanAttributes`](#spanattributes-1) | ###### Returns `void` ##### setSpanStatus() ```ts setSpanStatus( spanId, status, message?): void; ``` Defined in: [tracing/types.ts:378](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L378) ###### Parameters | Parameter | Type | | ------ | ------ | | `spanId` | `string` | | `status` | [`SpanStatus`](#spanstatus-1) | | `message?` | `string` | ###### Returns `void` ##### startSpan() ```ts startSpan(options): Span; ``` Defined in: [tracing/types.ts:374](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L374) ###### Parameters | Parameter | Type | | ------ | ------ | | `options` | [`StartSpanOptions`](#startspanoptions) | ###### Returns [`Span`](#span) ##### startTrace() ```ts startTrace(attributes?): string; ``` Defined in: [tracing/types.ts:372](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L372) ###### Parameters | Parameter | Type | | ------ | ------ | | `attributes?` | [`SpanAttributes`](#spanattributes-1) | ###### Returns `string` *** ### TracingManagerOptions Defined in: [tracing/types.ts:157](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L157) Options for creating a TracingManager #### Properties ##### autoGenerateTraceId? ```ts optional autoGenerateTraceId?: boolean; ``` Defined in: [tracing/types.ts:167](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L167) Whether to auto-generate trace IDs ##### defaultAttributes? ```ts optional defaultAttributes?: SpanAttributes; ``` Defined in: [tracing/types.ts:163](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L163) Default attributes added to all spans ##### maxSpansPerTrace? ```ts optional maxSpansPerTrace?: number; ``` Defined in: [tracing/types.ts:165](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L165) Maximum spans per trace (prevents memory issues) ##### onEvent? ```ts optional onEvent?: TracingEventHandler; ``` Defined in: [tracing/types.ts:169](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L169) Event handler for tracing events ##### otelExporter? ```ts optional otelExporter?: OTelExporter; ``` Defined in: [tracing/types.ts:171](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L171) Optional OpenTelemetry exporter ##### serviceName? ```ts optional serviceName?: string; ``` Defined in: [tracing/types.ts:159](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L159) Service name for traces ##### serviceVersion? ```ts optional serviceVersion?: string; ``` Defined in: [tracing/types.ts:161](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L161) Service version *** ### UsageRecord Defined in: [costs/types.ts:28](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L28) A single usage record #### Properties ##### id ```ts id: string; ``` Defined in: [costs/types.ts:30](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L30) Unique ID for this record ##### metadata? ```ts optional metadata?: Record; ``` Defined in: [costs/types.ts:42](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L42) Additional metadata ##### model ```ts model: string; ``` Defined in: [costs/types.ts:34](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L34) Model used ##### provider ```ts provider: string; ``` Defined in: [costs/types.ts:36](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L36) Provider name ##### sessionId? ```ts optional sessionId?: string; ``` Defined in: [costs/types.ts:40](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L40) Session ID (if tracking by session) ##### timestamp ```ts timestamp: Date; ``` Defined in: [costs/types.ts:32](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L32) Timestamp of the call ##### tokens ```ts tokens: TokenUsage; ``` Defined in: [costs/types.ts:38](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L38) Token usage *** ### UsageStats Defined in: [costs/types.ts:48](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L48) Aggregated usage statistics #### Properties ##### averageTokensPerCall ```ts averageTokensPerCall: number; ``` Defined in: [costs/types.ts:62](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L62) Average tokens per call ##### byModel ```ts byModel: Record; ``` Defined in: [costs/types.ts:68](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L68) Usage by model ##### firstCall? ```ts optional firstCall?: Date; ``` Defined in: [costs/types.ts:64](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L64) First call timestamp ##### lastCall? ```ts optional lastCall?: Date; ``` Defined in: [costs/types.ts:66](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L66) Last call timestamp ##### totalCacheCreationTokens ```ts totalCacheCreationTokens: number; ``` Defined in: [costs/types.ts:60](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L60) Total cache creation tokens ##### totalCacheReadTokens ```ts totalCacheReadTokens: number; ``` Defined in: [costs/types.ts:58](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L58) Total cache read tokens ##### totalCalls ```ts totalCalls: number; ``` Defined in: [costs/types.ts:50](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L50) Total number of LLM calls ##### totalInputTokens ```ts totalInputTokens: number; ``` Defined in: [costs/types.ts:52](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L52) Total input tokens ##### totalOutputTokens ```ts totalOutputTokens: number; ``` Defined in: [costs/types.ts:54](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L54) Total output tokens ##### totalTokens ```ts totalTokens: number; ``` Defined in: [costs/types.ts:56](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L56) Total tokens *** ### UsageTrackerOptions Defined in: [costs/types.ts:141](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L141) Options for UsageTracker #### Properties ##### budget? ```ts optional budget?: TokenBudgetConfig; ``` Defined in: [costs/types.ts:145](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L145) Token budget configuration ##### enabled? ```ts optional enabled?: boolean; ``` Defined in: [costs/types.ts:143](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L143) Whether tracking is enabled (default: true) ##### sessionId? ```ts optional sessionId?: string; ``` Defined in: [costs/types.ts:147](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L147) Session ID for grouping *** ### VerbosityConfig Defined in: [context/types.ts:142](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L142) Verbosity threshold configuration #### Properties ##### abbreviatedThreshold ```ts abbreviatedThreshold: number; ``` Defined in: [context/types.ts:159](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L159) Utilization threshold for 'abbreviated' verbosity (below this) ###### Default ```ts 0.95 (95%) ``` ##### fullThreshold ```ts fullThreshold: number; ``` Defined in: [context/types.ts:147](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L147) Utilization threshold for 'full' verbosity (below this) ###### Default ```ts 0.50 (50%) ``` ##### normalThreshold ```ts normalThreshold: number; ``` Defined in: [context/types.ts:153](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L153) Utilization threshold for 'normal' verbosity (below this) ###### Default ```ts 0.80 (80%) ``` *** ### WindowingConfig Defined in: [context/windowing.ts:23](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/windowing.ts#L23) #### Properties ##### enabled ```ts enabled: boolean; ``` Defined in: [context/windowing.ts:29](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/windowing.ts#L29) Whether windowing is enabled. Default: true ##### recentWindowTokens ```ts recentWindowTokens: number; ``` Defined in: [context/windowing.ts:27](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/windowing.ts#L27) Tokens reserved for recent window (never compacted). Default: 15000 ##### targetHistoryTokens ```ts targetHistoryTokens: number; ``` Defined in: [context/windowing.ts:25](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/windowing.ts#L25) Target maximum tokens for conversation history. Default: 60000 *** ### WindowingResult Defined in: [context/windowing.ts:65](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/windowing.ts#L65) #### Properties ##### applied ```ts applied: boolean; ``` Defined in: [context/windowing.ts:67](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/windowing.ts#L67) Whether windowing was applied ##### importanceCounts ```ts importanceCounts: Record; ``` Defined in: [context/windowing.ts:81](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/windowing.ts#L81) Importance distribution ##### messages ```ts messages: Message[]; ``` Defined in: [context/windowing.ts:69](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/windowing.ts#L69) Messages after windowing ##### tokensAfter ```ts tokensAfter: number; ``` Defined in: [context/windowing.ts:73](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/windowing.ts#L73) Tokens after windowing ##### tokensBefore ```ts tokensBefore: number; ``` Defined in: [context/windowing.ts:71](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/windowing.ts#L71) Tokens before windowing ##### zones ```ts zones: { middle: number; old: number; recent: number; }; ``` Defined in: [context/windowing.ts:75](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/windowing.ts#L75) Zone sizes ###### middle ```ts middle: number; ``` ###### old ```ts old: number; ``` ###### recent ```ts recent: number; ``` *** ### WithRetryOptions Defined in: [utils/index.ts:93](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/utils/index.ts#L93) Options for the withRetry function #### Type Parameters | Type Parameter | | ------ | | `E` *extends* `Error` | #### Properties ##### baseDelayMs? ```ts optional baseDelayMs?: number; ``` Defined in: [utils/index.ts:102](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/utils/index.ts#L102) Base delay in milliseconds (default: 1000) ##### isRetryable? ```ts optional isRetryable?: (error) => boolean; ``` Defined in: [utils/index.ts:112](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/utils/index.ts#L112) Function to determine if an error is retryable ###### Parameters | Parameter | Type | | ------ | ------ | | `error` | `E` | ###### Returns `boolean` ##### maxAttempts? ```ts optional maxAttempts?: number; ``` Defined in: [utils/index.ts:97](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/utils/index.ts#L97) Maximum retry attempts (default: 10) ##### maxDelayMs? ```ts optional maxDelayMs?: number; ``` Defined in: [utils/index.ts:107](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/utils/index.ts#L107) Maximum delay cap in milliseconds (default: 30000) ##### onExhausted? ```ts optional onExhausted?: (attempts, error) => void; ``` Defined in: [utils/index.ts:122](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/utils/index.ts#L122) Callback invoked when all retries are exhausted ###### Parameters | Parameter | Type | | ------ | ------ | | `attempts` | `number` | | `error` | `E` | ###### Returns `void` ##### onRetry? ```ts optional onRetry?: (attempt, maxAttempts, error, delayMs) => void; ``` Defined in: [utils/index.ts:117](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/utils/index.ts#L117) Callback invoked before each retry attempt ###### Parameters | Parameter | Type | | ------ | ------ | | `attempt` | `number` | | `maxAttempts` | `number` | | `error` | `E` | | `delayMs` | `number` | ###### Returns `void` ##### signal? ```ts optional signal?: AbortSignal; ``` Defined in: [utils/index.ts:127](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/utils/index.ts#L127) AbortSignal to cancel retries *** ### WorkAtRisk Defined in: [episodes/types.ts:192](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L192) Summary of work that would be at risk from a destructive operation. Used by guardrails and rehearsal to warn agents before they destroy work. #### Properties ##### agentAttribution ```ts agentAttribution: string[]; ``` Defined in: [episodes/types.ts:200](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L200) Agents who did the work (e.g., ['default (abc123)', 'backend (xyz999)']) ##### episodes ```ts episodes: WorkEpisode[]; ``` Defined in: [episodes/types.ts:194](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L194) Episodes involving the affected files ##### totalEffort ```ts totalEffort: Effort; ``` Defined in: [episodes/types.ts:197](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L197) Maximum effort across at-risk episodes ##### warningMessage ```ts warningMessage: string; ``` Defined in: [episodes/types.ts:203](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L203) Human-readable warning message *** ### WorkEpisode Defined in: [episodes/types.ts:27](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L27) A single unit of tracked work. Represents something an agent did — e.g., editing files, running tests, committing. #### Properties ##### action ```ts action: string; ``` Defined in: [episodes/types.ts:38](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L38) High-level action label (e.g., 'edit', 'test', 'commit', 'refactor') ##### agentId ```ts agentId: string; ``` Defined in: [episodes/types.ts:32](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L32) Agent ID that performed this work (e.g., 'default', 'backend', 'tester') ##### durationMs? ```ts optional durationMs?: number; ``` Defined in: [episodes/types.ts:59](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L59) Duration in milliseconds, if tracked ##### effort ```ts effort: Effort; ``` Defined in: [episodes/types.ts:56](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L56) Estimated effort level ##### files ```ts files: string[]; ``` Defined in: [episodes/types.ts:44](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L44) Files affected by this episode ##### id ```ts id: string; ``` Defined in: [episodes/types.ts:29](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L29) Unique episode ID (UUID) ##### linesChanged? ```ts optional linesChanged?: number; ``` Defined in: [episodes/types.ts:47](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L47) Total lines changed (added + removed), if known ##### parentEpisode? ```ts optional parentEpisode?: string; ``` Defined in: [episodes/types.ts:71](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L71) Parent episode ID (for sub-tasks) ##### relatedCommits? ```ts optional relatedCommits?: string[]; ``` Defined in: [episodes/types.ts:68](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L68) Related git commit hashes ##### sessionId ```ts sessionId: string; ``` Defined in: [episodes/types.ts:53](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L53) Session ID for grouping episodes within a session ##### summary ```ts summary: string; ``` Defined in: [episodes/types.ts:41](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L41) Human-readable summary of what was done ##### terminalPrefix ```ts terminalPrefix: string; ``` Defined in: [episodes/types.ts:35](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L35) Terminal session prefix (first 8 chars of session ID) ##### timestamp ```ts timestamp: string; ``` Defined in: [episodes/types.ts:50](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L50) ISO timestamp when the episode was recorded ##### toolCalls? ```ts optional toolCalls?: number; ``` Defined in: [episodes/types.ts:62](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L62) Number of tool calls in this episode ##### workItemId? ```ts optional workItemId?: string; ``` Defined in: [episodes/types.ts:65](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L65) Related work item ID (from workitem system) *** ### WriteFileInput Defined in: [tools/builtin/write-file.ts:14](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/write-file.ts#L14) Input parameters for write_file tool #### Properties ##### append? ```ts optional append?: boolean; ``` Defined in: [tools/builtin/write-file.ts:38](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/write-file.ts#L38) Append to file instead of overwriting (default: false) ##### content ```ts content: string; ``` Defined in: [tools/builtin/write-file.ts:23](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/write-file.ts#L23) Content to write to the file ##### createDirs? ```ts optional createDirs?: boolean; ``` Defined in: [tools/builtin/write-file.ts:33](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/write-file.ts#L33) Create parent directories if they don't exist (default: true) ##### encoding? ```ts optional encoding?: BufferEncoding; ``` Defined in: [tools/builtin/write-file.ts:28](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/write-file.ts#L28) Encoding to use (default: utf-8) ##### path ```ts path: string; ``` Defined in: [tools/builtin/write-file.ts:18](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/write-file.ts#L18) Path to the file to write ## Type Aliases ### AfterIterationHook ```ts type AfterIterationHook = (context) => undefined | Promise; ``` Defined in: [hooks/types.ts:82](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L82) Hook called after each iteration completes. Can be used for: - Logging iteration results - Metrics collection - State snapshots #### Parameters | Parameter | Type | | ------ | ------ | | `context` | [`IterationHookContext`](#iterationhookcontext) & \{ `completedWithText`: `boolean`; `toolCalls`: \{ `input`: `Record`\<`string`, `unknown`\>; `name`: `string`; `result`: [`ToolExecutionResult`](#toolexecutionresult); \}[]; \} | #### Returns `undefined` \| `Promise`\<`undefined`\> *** ### AfterLLMHook ```ts type AfterLLMHook = (context) => undefined | Promise; ``` Defined in: [hooks/types.ts:207](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L207) Hook called after LLM response is received. Can be used for: - Response logging - Token tracking - Response validation - Metrics collection #### Parameters | Parameter | Type | | ------ | ------ | | `context` | [`AfterLLMHookContext`](#afterllmhookcontext) | #### Returns `undefined` \| `Promise`\<`undefined`\> *** ### AfterToolHook ```ts type AfterToolHook = (context) => | undefined | Promise | AfterToolHookResult | Promise; ``` Defined in: [hooks/types.ts:297](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L297) Hook called after tool execution. Can be used for: - Result transformation - Logging and metrics - Result validation - Error enrichment #### Parameters | Parameter | Type | | ------ | ------ | | `context` | [`AfterToolHookContext`](#aftertoolhookcontext) | #### Returns \| `undefined` \| `Promise`\<`undefined`\> \| [`AfterToolHookResult`](#aftertoolhookresult) \| `Promise`\<[`AfterToolHookResult`](#aftertoolhookresult)\> *** ### AgentEvent ```ts type AgentEvent = | { iteration: number; type: "iteration_start"; } | { type: "llm_start"; } | { chunk: StreamChunk; type: "llm_chunk"; } | { hasToolUses: boolean; text: string; type: "llm_end"; } | { input: Record; name: string; toolUseId: string; type: "tool_start"; } | { output: string; stream?: "stdout" | "stderr"; toolName: string; toolUseId: string; type: "tool_output"; } | { name: string; result: ToolExecutionResult; toolUseId: string; type: "tool_end"; } | { iteration: number; type: "iteration_end"; } | { response: string; type: "done"; } | { threshold: number; type: "context_warning"; utilization: number; } | { tokensAfter: number; tokensBefore: number; type: "context_compacted"; } | { rounds: number; tokensAfter: number; tokensBefore: number; type: "context_summarized"; } | { type: "context_overflow"; utilization: number; } | { name: string; task: string; type: "subagent_start"; } | { name: string; result: SubAgentResult; type: "subagent_end"; } | { consecutiveCalls: number; toolName: string; type: "tool_loop_warning"; } | { consecutiveCalls: number; nudgeCount: number; toolName: string; type: "tool_loop_nudge"; } | { reason: "aborted" | "error"; sessionId: string; type: "abort_checkpoint_saved"; } | { error: string; type: "abort_checkpoint_failed"; } | { data: unknown; metadata?: Record; name: string; type: "custom"; } | { anchor: Anchor; type: "anchor_added"; } | { anchorId: string; type: "anchor_removed"; } | { result: GuardrailResult; type: "guardrail_triggered"; } | { message: string; result: GuardrailResult; type: "guardrail_blocked"; } | { message: string; result: GuardrailResult; type: "guardrail_warning"; } | { level: PermissionLevel; toolName: string; type: "permission_granted"; } | { level: PermissionLevel; reason?: string; toolName: string; type: "permission_denied"; } | { level: PermissionLevel; toolName: string; type: "permission_asked"; } | { model: string; tokens: TokenUsage; type: "usage_recorded"; } | { status: BudgetStatus; threshold: number; type: "usage_budget_warning"; } | { status: BudgetStatus; type: "usage_budget_exceeded"; } | { action: string; reason?: string; type: "suggest"; } | { iteration: number; maxIterations: number; type: "iteration_limit_reached"; } | { addedIterations: number; newMaxIterations: number; type: "iteration_limit_extended"; } | { newModel: string; previousModel: string; type: "model_changed"; } | { attempt: number; delayMs: number; error: string; maxAttempts: number; provider: string; type: "llm_retry"; } | { attempts: number; error: string; provider: string; type: "llm_retry_exhausted"; }; ``` Defined in: [agent.ts:72](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L72) Event types emitted during agent execution *** ### AgentEventHandler ```ts type AgentEventHandler = (event) => void; ``` Defined in: [agent.ts:140](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L140) Event handler function type #### Parameters | Parameter | Type | | ------ | ------ | | `event` | [`AgentEvent`](#agentevent) | #### Returns `void` *** ### AnchorEventHandler ```ts type AnchorEventHandler = (event) => void; ``` Defined in: [anchors/types.ts:235](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L235) Event handler for anchor events #### Parameters | Parameter | Type | | ------ | ------ | | `event` | [`AnchorEvent`](#anchorevent) | #### Returns `void` *** ### AnchorEventType ```ts type AnchorEventType = | "anchor:added" | "anchor:removed" | "anchor:expired" | "anchor:budget_exceeded" | "anchor:persisted" | "anchor:loaded"; ``` Defined in: [anchors/types.ts:214](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L214) Event types for anchor operations *** ### AnchorPriority ```ts type AnchorPriority = "critical" | "safety" | "info"; ``` Defined in: [anchors/types.ts:17](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L17) Priority levels for anchors - critical: Must remember, highest priority (e.g., "we just implemented X") - safety: Check before acting (e.g., "verify before git reset") - info: Useful context (e.g., "modified files this session") *** ### AnchorScope ```ts type AnchorScope = "session" | "persistent" | "temporary"; ``` Defined in: [anchors/types.ts:25](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/types.ts#L25) Scope determines anchor lifetime - session: Lives for the current session only - persistent: Saved to disk, survives across sessions - temporary: Auto-expires after a duration or event *** ### AttributeValue ```ts type AttributeValue = string | number | boolean | string[] | number[] | boolean[]; ``` Defined in: [tracing/types.ts:28](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L28) Attribute value types (compatible with OpenTelemetry) *** ### BeforeIterationHook ```ts type BeforeIterationHook = (context) => | undefined | Promise | { skip: true; } | Promise<{ skip: true; }>; ``` Defined in: [hooks/types.ts:70](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L70) Hook called before each iteration starts. Can be used for: - Logging iteration boundaries - Custom iteration budget tracking - Early termination checks #### Parameters | Parameter | Type | | ------ | ------ | | `context` | [`IterationHookContext`](#iterationhookcontext) | #### Returns \| `undefined` \| `Promise`\<`undefined`\> \| \{ `skip`: `true`; \} \| `Promise`\<\{ `skip`: `true`; \}\> void, or { skip: true } to skip this iteration *** ### BeforeLLMHook ```ts type BeforeLLMHook = (context) => | undefined | Promise | BeforeLLMHookResult | Promise; ``` Defined in: [hooks/types.ts:157](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L157) Hook called before LLM call. Can be used for: - Prompt transformation/injection - Tool filtering - Request logging - Caching checks #### Parameters | Parameter | Type | | ------ | ------ | | `context` | [`LLMHookContext`](#llmhookcontext) | #### Returns \| `undefined` \| `Promise`\<`undefined`\> \| [`BeforeLLMHookResult`](#beforellmhookresult) \| `Promise`\<[`BeforeLLMHookResult`](#beforellmhookresult)\> void to proceed unchanged, or modified messages/tools *** ### BeforeToolHook ```ts type BeforeToolHook = (context) => | undefined | Promise | BeforeToolHookResult | Promise; ``` Defined in: [hooks/types.ts:259](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L259) Hook called before tool execution (after permissions and guardrails). Can be used for: - Custom validation - Input transformation - Execution mocking for tests - Rate limiting #### Parameters | Parameter | Type | | ------ | ------ | | `context` | [`ToolHookContext`](#toolhookcontext) | #### Returns \| `undefined` \| `Promise`\<`undefined`\> \| [`BeforeToolHookResult`](#beforetoolhookresult) \| `Promise`\<[`BeforeToolHookResult`](#beforetoolhookresult)\> void to proceed, or skip/modify options *** ### CombineStrategy ```ts type CombineStrategy = "concat" | "priority" | "dedupe"; ``` Defined in: [memory/types.ts:66](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/types.ts#L66) Strategy for combining multiple memory files *** ### ContentBlock ```ts type ContentBlock = | TextBlock | ToolUseBlock | ToolResultBlock | ThinkingBlock | ImageBlock; ``` Defined in: [providers/types.ts:81](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L81) Union of all content block types *** ### ContentBlockType ```ts type ContentBlockType = "text" | "tool_use" | "tool_result" | "thinking"; ``` Defined in: [providers/types.ts:13](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L13) Content block types *** ### ContextCategory ```ts type ContextCategory = "system" | "recentMessages" | "toolResults" | "history"; ``` Defined in: [context/types.ts:20](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L20) Context categories for budget allocation Each category has its own budget, preventing one type of content from consuming space meant for another. *** ### ContextEvent ```ts type ContextEvent = | { threshold: number; type: "context_warning"; utilization: number; } | { result: CompactionResult; type: "context_compacted"; } | { result: SummarizationResult; type: "context_summarized"; } | { result: FilteringResult; type: "content_filtered"; }; ``` Defined in: [context/types.ts:405](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L405) Context-related events *** ### ContextEventHandler ```ts type ContextEventHandler = (event) => void; ``` Defined in: [context/types.ts:414](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L414) Context event handler #### Parameters | Parameter | Type | | ------ | ------ | | `event` | [`ContextEvent`](#contextevent) | #### Returns `void` *** ### ContextMode ```ts type ContextMode = "isolated" | "inherit" | "inherit-summary"; ``` Defined in: [tools/builtin/task.ts:25](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/task.ts#L25) Context inheritance mode for sub-agents *** ### DelegationEvent ```ts type DelegationEvent = | { delegationId: string; originalTokens: number; toolName: string; type: "delegation:started"; } | { delegationId: string; originalTokens: number; strategy: "llm" | "extractive"; summaryTokens: number; toolName: string; type: "delegation:completed"; } | { error: string; toolName: string; type: "delegation:failed"; } | { delegationId: string; found: boolean; type: "delegation:recall"; }; ``` Defined in: [context/delegation-types.ts:78](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/delegation-types.ts#L78) Events emitted during the delegation lifecycle. *** ### Effort ```ts type Effort = "trivial" | "low" | "medium" | "high" | "significant"; ``` Defined in: [episodes/types.ts:17](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/types.ts#L17) Effort level for a work episode. Ordered from least to most significant. *** ### FileAccessType ```ts type FileAccessType = "read" | "referenced" | "modified"; ``` Defined in: [context/file-tracker.ts:27](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/file-tracker.ts#L27) Type of file access *** ### GuardrailAction ```ts type GuardrailAction = "warn" | "confirm" | "block"; ``` Defined in: [guardrails/types.ts:14](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/types.ts#L14) Action to take when a guardrail is triggered - warn: Log warning but proceed with execution - confirm: Require confirmation before proceeding - block: Prevent execution entirely *** ### GuardrailEventHandler ```ts type GuardrailEventHandler = (event) => void; ``` Defined in: [guardrails/types.ts:205](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/types.ts#L205) Event handler for guardrail events #### Parameters | Parameter | Type | | ------ | ------ | | `event` | [`GuardrailEvent`](#guardrailevent) | #### Returns `void` *** ### GuardrailEventType ```ts type GuardrailEventType = | "guardrail:triggered" | "guardrail:warning" | "guardrail:blocked" | "guardrail:confirmed" | "guardrail:cancelled"; ``` Defined in: [guardrails/types.ts:186](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/types.ts#L186) Event types for guardrail operations *** ### GuardrailTriggeredHandler ```ts type GuardrailTriggeredHandler = (result, context) => boolean | Promise; ``` Defined in: [guardrails/types.ts:153](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/types.ts#L153) Handler called when a guardrail is triggered #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `result` | [`GuardrailResult`](#guardrailresult) | The guardrail check result | | `context` | [`GuardrailContext`](#guardrailcontext) | Context about the tool call | #### Returns `boolean` \| `Promise`\<`boolean`\> true to proceed with execution, false to block *** ### HookEventHandler ```ts type HookEventHandler = (event) => void; ``` Defined in: [hooks/types.ts:467](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L467) Event handler for hook events #### Parameters | Parameter | Type | | ------ | ------ | | `event` | [`HookEvent`](#hookevent) | #### Returns `void` *** ### HookEventType ```ts type HookEventType = | "hook:registered" | "hook:unregistered" | "hook:started" | "hook:completed" | "hook:error"; ``` Defined in: [hooks/types.ts:445](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L445) Event types for hook operations *** ### ImpactSeverity ```ts type ImpactSeverity = "low" | "medium" | "high" | "critical"; ``` Defined in: [rehearsal/types.ts:14](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L14) Severity level of the operation's potential impact *** ### ImportanceLevel ```ts type ImportanceLevel = "high" | "medium" | "low"; ``` Defined in: [context/windowing.ts:42](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/windowing.ts#L42) *** ### LLMProviderName ```ts type LLMProviderName = string; ``` Defined in: [memory/types.ts:17](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/types.ts#L17) LLM provider name for memory file discovery. Common values: 'claude', 'gemini', 'openai', 'gpt', 'copilot', 'cursor', 'codeium', 'anthropic' Can be any string to support custom providers - patterns will be generated automatically (e.g., 'myai' -> MYAI.md, .myai.md, .myai/instructions.md) *** ### LogLevel ```ts type LogLevel = "debug" | "info" | "warn" | "error"; ``` Defined in: [tracing/types.ts:271](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L271) Log levels *** ### MCPClientEventHandler ```ts type MCPClientEventHandler = (event) => void; ``` Defined in: [mcp/types.ts:152](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L152) Handler for MCP client events #### Parameters | Parameter | Type | | ------ | ------ | | `event` | [`MCPClientEvent`](#mcpclientevent) | #### Returns `void` *** ### MCPClientEventType ```ts type MCPClientEventType = "tools_changed" | "error" | "disconnected" | "connected"; ``` Defined in: [mcp/types.ts:137](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L137) Event types emitted by MCPClient *** ### MCPConnectionStatus ```ts type MCPConnectionStatus = "disconnected" | "connecting" | "connected" | "error"; ``` Defined in: [mcp/types.ts:18](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L18) Connection status of an MCP client *** ### MCPTransport ```ts type MCPTransport = "stdio" | "http"; ``` Defined in: [mcp/types.ts:13](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L13) Transport type for MCP server connection *** ### MessageRole ```ts type MessageRole = "user" | "assistant" | "system"; ``` Defined in: [providers/types.ts:8](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/types.ts#L8) Message roles in a conversation *** ### OnErrorHook ```ts type OnErrorHook = (context) => | undefined | Promise | ErrorHookResult | Promise; ``` Defined in: [hooks/types.ts:354](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/hooks/types.ts#L354) Hook called when an error occurs. Can be used for: - Error logging - Error transformation - Recovery strategies - Alerting #### Parameters | Parameter | Type | | ------ | ------ | | `context` | [`ErrorHookContext`](#errorhookcontext) | #### Returns \| `undefined` \| `Promise`\<`undefined`\> \| [`ErrorHookResult`](#errorhookresult) \| `Promise`\<[`ErrorHookResult`](#errorhookresult)\> *** ### OperationCategory ```ts type OperationCategory = "git" | "file" | "database" | "network" | "system" | "unknown"; ``` Defined in: [rehearsal/types.ts:24](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L24) Category of destructive operation *** ### OTelSDK ```ts type OTelSDK = { trace: { getTracer: OTelTracer; }; }; ``` Defined in: [tracing/types.ts:246](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L246) OpenTelemetry SDK types (defined here to avoid importing optional dependency) #### Properties ##### trace ```ts trace: { getTracer: OTelTracer; }; ``` Defined in: [tracing/types.ts:247](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L247) ###### getTracer() ```ts getTracer(name, version?): OTelTracer; ``` ###### Parameters | Parameter | Type | | ------ | ------ | | `name` | `string` | | `version?` | `string` | ###### Returns [`OTelTracer`](#oteltracer) *** ### OTelSpan ```ts type OTelSpan = { addEvent: void; end: void; setAttribute: void; setStatus: void; spanContext: { spanId: string; traceId: string; }; }; ``` Defined in: [tracing/types.ts:256](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L256) #### Methods ##### addEvent() ```ts addEvent(name, attributes?): void; ``` Defined in: [tracing/types.ts:259](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L259) ###### Parameters | Parameter | Type | | ------ | ------ | | `name` | `string` | | `attributes?` | `Record`\<`string`, `unknown`\> | ###### Returns `void` ##### end() ```ts end(endTime?): void; ``` Defined in: [tracing/types.ts:260](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L260) ###### Parameters | Parameter | Type | | ------ | ------ | | `endTime?` | `number` | ###### Returns `void` ##### setAttribute() ```ts setAttribute(key, value): void; ``` Defined in: [tracing/types.ts:257](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L257) ###### Parameters | Parameter | Type | | ------ | ------ | | `key` | `string` | | `value` | [`AttributeValue`](#attributevalue) | ###### Returns `void` ##### setStatus() ```ts setStatus(status): void; ``` Defined in: [tracing/types.ts:258](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L258) ###### Parameters | Parameter | Type | | ------ | ------ | | `status` | \{ `code`: `number`; `message?`: `string`; \} | | `status.code` | `number` | | `status.message?` | `string` | ###### Returns `void` ##### spanContext() ```ts spanContext(): { spanId: string; traceId: string; }; ``` Defined in: [tracing/types.ts:261](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L261) ###### Returns ```ts { spanId: string; traceId: string; } ``` | Name | Type | Defined in | | ------ | ------ | ------ | | `spanId` | `string` | [tracing/types.ts:261](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L261) | | `traceId` | `string` | [tracing/types.ts:261](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L261) | *** ### OTelTracer ```ts type OTelTracer = { startSpan: OTelSpan; }; ``` Defined in: [tracing/types.ts:252](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L252) #### Methods ##### startSpan() ```ts startSpan(name, options?): OTelSpan; ``` Defined in: [tracing/types.ts:253](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L253) ###### Parameters | Parameter | Type | | ------ | ------ | | `name` | `string` | | `options?` | `unknown` | ###### Returns [`OTelSpan`](#otelspan) *** ### PermissionEventHandler ```ts type PermissionEventHandler = (event) => void; ``` Defined in: [permissions/types.ts:222](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/types.ts#L222) Event handler for permission events #### Parameters | Parameter | Type | | ------ | ------ | | `event` | [`PermissionEvent`](#permissionevent) | #### Returns `void` *** ### PermissionEventType ```ts type PermissionEventType = | "permission:granted" | "permission:denied" | "permission:asked" | "permission:session_granted"; ``` Defined in: [permissions/types.ts:202](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/types.ts#L202) Event types for permission operations *** ### PermissionHandler ```ts type PermissionHandler = (request) => | PermissionHandlerResponse | Promise; ``` Defined in: [permissions/types.ts:146](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/types.ts#L146) Handler called when permission is needed #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `request` | [`PermissionRequest`](#permissionrequest) | Information about the permission request | #### Returns \| [`PermissionHandlerResponse`](#permissionhandlerresponse) \| `Promise`\<[`PermissionHandlerResponse`](#permissionhandlerresponse)\> true to allow / false to deny — or { allowed, reason? } to carry context (especially useful when denying with a message) #### Example ```typescript const handler: PermissionHandler = async (request) => { // Show UI prompt to user const result = await showConfirmDialog( `Allow ${request.toolName}?`, request.description ); if (!result.allowed && result.message) { return { allowed: false, reason: result.message }; } return result.allowed; }; ``` *** ### PermissionHandlerResponse ```ts type PermissionHandlerResponse = | boolean | { allowed: boolean; reason?: string; }; ``` Defined in: [permissions/types.ts:122](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/types.ts#L122) Response shape from a permission handler. Either a plain boolean (legacy — backward compatible) OR a structured object that can carry an optional reason. The reason is delivered to the agent inline with the tool's permission-denied error so the agent sees the user's context immediately, in the same turn. #### Example ```typescript // Legacy (still supported): return true; return false; // With reason: return { allowed: false, reason: 'Use project_document_add instead' }; return { allowed: true }; ``` *** ### PermissionLevel ```ts type PermissionLevel = "always" | "session" | "once" | "deny"; ``` Defined in: [permissions/types.ts:16](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/types.ts#L16) Permission levels for tool execution - 'always': Tool can execute without asking (trusted tools) - 'session': Ask once per session, then allow for remainder - 'once': Ask every time the tool is invoked - 'deny': Never allow execution (blocked tools) *** ### PreviewGenerator ```ts type PreviewGenerator = (toolName, input) => string | undefined; ``` Defined in: [permissions/types.ts:157](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/permissions/types.ts#L157) Preview generator for permission requests #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `toolName` | `string` | Name of the tool | | `input` | `Record`\<`string`, `unknown`\> | Tool input arguments | #### Returns `string` \| `undefined` Human-readable preview of the operation *** ### ProjectMemoryEvent ```ts type ProjectMemoryEvent = | { patterns: string[]; rootDir: string; type: "memory:search_start"; } | { path: string; pattern: string; type: "memory:file_found"; } | { file: MemoryFile; type: "memory:file_loaded"; } | { path: string; reason: string; type: "memory:file_skipped"; } | { memory: ProjectMemory; type: "memory:search_complete"; } | { error: Error; path?: string; type: "memory:error"; }; ``` Defined in: [memory/types.ts:164](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/types.ts#L164) Events emitted during memory loading *** ### ProjectMemoryEventHandler ```ts type ProjectMemoryEventHandler = (event) => void; ``` Defined in: [memory/types.ts:175](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/types.ts#L175) Event handler for project memory events #### Parameters | Parameter | Type | | ------ | ------ | | `event` | [`ProjectMemoryEvent`](#projectmemoryevent) | #### Returns `void` *** ### ProjectMemoryEventType ```ts type ProjectMemoryEventType = | "memory:search_start" | "memory:file_found" | "memory:file_loaded" | "memory:file_skipped" | "memory:search_complete" | "memory:error"; ``` Defined in: [memory/types.ts:153](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/types.ts#L153) Event types for ProjectMemoryLoader *** ### RehearsalEventHandler ```ts type RehearsalEventHandler = (event) => void; ``` Defined in: [rehearsal/types.ts:290](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L290) Handler for rehearsal events #### Parameters | Parameter | Type | | ------ | ------ | | `event` | [`RehearsalEvent`](#rehearsalevent) | #### Returns `void` *** ### RehearsalEventType ```ts type RehearsalEventType = "rehearsal_start" | "rehearsal_complete" | "warning_triggered"; ``` Defined in: [rehearsal/types.ts:275](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L275) Event types emitted by RehearsalManager *** ### RehearsalRecommendation ```ts type RehearsalRecommendation = "proceed" | "caution" | "confirm" | "abort"; ``` Defined in: [rehearsal/types.ts:19](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/types.ts#L19) Recommendation based on impact analysis *** ### SpanAttributes ```ts type SpanAttributes = Record; ``` Defined in: [tracing/types.ts:33](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L33) Span attributes map *** ### SpanKind ```ts type SpanKind = "internal" | "client" | "server" | "producer" | "consumer"; ``` Defined in: [tracing/types.ts:23](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L23) Span kind indicating the type of operation *** ### SpanStatus ```ts type SpanStatus = "unset" | "ok" | "error"; ``` Defined in: [tracing/types.ts:18](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L18) Span status indicating success, error, or unset *** ### StreamWriter ```ts type StreamWriter = (data, metadata?) => void; ``` Defined in: [agent.ts:157](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/agent.ts#L157) Stream writer for emitting custom events during execution. Tools and middleware can use this to stream custom events to the client. Inspired by LangGraph's get_stream_writer() pattern. #### Parameters | Parameter | Type | | ------ | ------ | | `data` | `unknown` | | `metadata?` | `Record`\<`string`, `unknown`\> | #### Returns `void` #### Example ```typescript // In a tool executor: const writer = agent.getStreamWriter(); writer('Processing step 1...', { step: 1 }); // ... do work ... writer('Processing step 2...', { step: 2 }); ``` *** ### ThoroughnessLevel ```ts type ThoroughnessLevel = "quick" | "medium" | "thorough"; ``` Defined in: [tools/builtin/task.ts:30](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/task.ts#L30) Thoroughness level for exploration agents *** ### TodoStatus ```ts type TodoStatus = "pending" | "in_progress" | "completed"; ``` Defined in: [tools/builtin/todo.ts:14](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/todo.ts#L14) Task status *** ### ToolFallbackHandler ```ts type ToolFallbackHandler = (name, input, context?) => Promise; ``` Defined in: [tools/types.ts:160](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/types.ts#L160) Fallback handler for tools not found in the primary registry. Used by meta-tools to transparently route calls to a secondary registry. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `name` | `string` | Tool name that was not found | | `input` | `Record`\<`string`, `unknown`\> | Tool input parameters | | `context?` | `ToolExecutionContext` | Optional execution context | #### Returns `Promise`\<[`ToolExecutionResult`](#toolexecutionresult) \| `null`\> Result if handled, or null to return the default "not found" error *** ### ToolHandler ```ts type ToolHandler = (input, context?) => Promise; ``` Defined in: [tools/types.ts:82](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/types.ts#L82) Tool handler function type #### Type Parameters | Type Parameter | Default type | | ------ | ------ | | `T` | `object` | #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `input` | `T` | The tool input parameters | | `context?` | `ToolExecutionContext` | Optional execution context for streaming | #### Returns `Promise`\<[`ToolExecutionResult`](#toolexecutionresult)\> *** ### TracingEvent ```ts type TracingEvent = | { timestamp: number; traceId: string; type: "trace:started"; } | { durationMs: number; spanCount: number; traceId: string; type: "trace:ended"; } | { name: string; parentSpanId?: string; spanId: string; traceId: string; type: "span:started"; } | { durationMs: number; spanId: string; status: SpanStatus; traceId: string; type: "span:ended"; } | { eventName: string; spanId: string; traceId: string; type: "span:event"; } | { error: Error; spanId: string; traceId: string; type: "span:error"; } | { exporter: string; traceId: string; type: "export:success"; } | { error: Error; exporter: string; traceId: string; type: "export:error"; }; ``` Defined in: [tracing/types.ts:211](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L211) Events emitted by TracingManager *** ### TracingEventHandler ```ts type TracingEventHandler = (event) => void; ``` Defined in: [tracing/types.ts:224](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L224) Handler for tracing events #### Parameters | Parameter | Type | | ------ | ------ | | `event` | [`TracingEvent`](#tracingevent) | #### Returns `void` *** ### UsageEvent ```ts type UsageEvent = | { record: UsageRecord; stats: UsageStats; type: "usage:recorded"; } | { status: BudgetStatus; threshold: number; type: "usage:budget_warning"; } | { status: BudgetStatus; type: "usage:budget_exceeded"; } | { previousStats: UsageStats; type: "usage:reset"; }; ``` Defined in: [costs/types.ts:127](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L127) Usage tracker events *** ### UsageEventHandler ```ts type UsageEventHandler = (event) => void; ``` Defined in: [costs/types.ts:136](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L136) Event handler for usage events #### Parameters | Parameter | Type | | ------ | ------ | | `event` | [`UsageEvent`](#usageevent) | #### Returns `void` *** ### UsageEventType ```ts type UsageEventType = | "usage:recorded" | "usage:budget_warning" | "usage:budget_exceeded" | "usage:reset"; ``` Defined in: [costs/types.ts:118](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/types.ts#L118) Usage tracker event types *** ### VerbosityLevel ```ts type VerbosityLevel = "full" | "normal" | "abbreviated" | "minimal"; ``` Defined in: [context/types.ts:137](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/types.ts#L137) Verbosity levels for graceful degradation Tools should adapt their output based on context pressure. ## Variables ### AgentAttributes ```ts const AgentAttributes: { COMPLETED_WITH_TEXT: "agent.completed_with_text"; ITERATION_MAX: "agent.iteration.max"; ITERATION_NUMBER: "agent.iteration.number"; MESSAGE_COUNT: "agent.message_count"; SESSION_ID: "agent.session_id"; TOOL_CALL_COUNT: "agent.tool_call_count"; TOOL_DURATION_MS: "agent.tool.duration_ms"; TOOL_NAME: "agent.tool.name"; TOOL_SUCCESS: "agent.tool.success"; }; ``` Defined in: [tracing/otel-attributes.ts:37](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/otel-attributes.ts#L37) Agent-specific attributes for iteration and tool tracking #### Type Declaration | Name | Type | Default value | Description | Defined in | | ------ | ------ | ------ | ------ | ------ | | `COMPLETED_WITH_TEXT` | `"agent.completed_with_text"` | `'agent.completed_with_text'` | Whether the iteration completed with text (no tool calls) | [tracing/otel-attributes.ts:55](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/otel-attributes.ts#L55) | | `ITERATION_MAX` | `"agent.iteration.max"` | `'agent.iteration.max'` | Maximum allowed iterations | [tracing/otel-attributes.ts:43](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/otel-attributes.ts#L43) | | `ITERATION_NUMBER` | `"agent.iteration.number"` | `'agent.iteration.number'` | Current iteration number (1-indexed) | [tracing/otel-attributes.ts:41](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/otel-attributes.ts#L41) | | `MESSAGE_COUNT` | `"agent.message_count"` | `'agent.message_count'` | Number of messages in the conversation | [tracing/otel-attributes.ts:53](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/otel-attributes.ts#L53) | | `SESSION_ID` | `"agent.session_id"` | `'agent.session_id'` | Session ID for the agent run | [tracing/otel-attributes.ts:39](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/otel-attributes.ts#L39) | | `TOOL_CALL_COUNT` | `"agent.tool_call_count"` | `'agent.tool_call_count'` | Number of tool calls in the iteration | [tracing/otel-attributes.ts:51](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/otel-attributes.ts#L51) | | `TOOL_DURATION_MS` | `"agent.tool.duration_ms"` | `'agent.tool.duration_ms'` | Tool execution duration in milliseconds | [tracing/otel-attributes.ts:49](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/otel-attributes.ts#L49) | | `TOOL_NAME` | `"agent.tool.name"` | `'agent.tool.name'` | Tool name being executed | [tracing/otel-attributes.ts:45](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/otel-attributes.ts#L45) | | `TOOL_SUCCESS` | `"agent.tool.success"` | `'agent.tool.success'` | Whether the tool executed successfully | [tracing/otel-attributes.ts:47](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/otel-attributes.ts#L47) | *** ### allBuiltinTools ```ts const allBuiltinTools: readonly [Tool, Tool, Tool, Tool, Tool, Tool, Tool, Tool, Tool, Tool, Tool, Tool, Tool, Tool, Tool, Tool]; ``` Defined in: [tools/builtin/index.ts:167](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/index.ts#L167) Array of all built-in tools *** ### bashOutputTool ```ts const bashOutputTool: Tool; ``` Defined in: [tools/builtin/bash-output.ts:63](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/bash-output.ts#L63) BashOutput tool definition *** ### bashTool ```ts const bashTool: Tool; ``` Defined in: [tools/builtin/bash.ts:172](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/bash.ts#L172) Bash tool definition *** ### BUILTIN\_GUARDRAILS ```ts const BUILTIN_GUARDRAILS: Guardrail[]; ``` Defined in: [guardrails/builtin.ts:13](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/builtin.ts#L13) Built-in guardrails for dangerous operations *** ### builtinSkills ```ts const builtinSkills: Skill[]; ``` Defined in: [skills/index.ts:276](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/skills/index.ts#L276) Built-in skills that are commonly useful *** ### builtinTools ```ts const builtinTools: { askUser: Tool; askUserSimple: Tool; backlogRead: Tool; backlogWrite: Tool; bash: Tool; bashOutput: Tool; edit: Tool; glob: Tool; grep: Tool; killShell: Tool; readFile: Tool; suggest: Tool; todoRead: Tool; todoWrite: Tool; webFetch: Tool; writeFile: Tool; }; ``` Defined in: [tools/builtin/index.ts:145](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/index.ts#L145) #### Type Declaration | Name | Type | Default value | Defined in | | ------ | ------ | ------ | ------ | | `askUser` | [`Tool`](#tool)\<`AskUserInput`\> | `askUserTool` | [tools/builtin/index.ts:158](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/index.ts#L158) | | `askUserSimple` | [`Tool`](#tool)\<`AskUserSimpleInput`\> | `askUserSimpleTool` | [tools/builtin/index.ts:159](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/index.ts#L159) | | `backlogRead` | [`Tool`](#tool)\<`BacklogReadInput`\> | `backlogReadTool` | [tools/builtin/index.ts:160](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/index.ts#L160) | | `backlogWrite` | [`Tool`](#tool)\<`BacklogWriteInput`\> | `backlogWriteTool` | [tools/builtin/index.ts:161](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/index.ts#L161) | | `bash` | [`Tool`](#tool)\<[`BashInput`](#bashinput)\> | `bashTool` | [tools/builtin/index.ts:148](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/index.ts#L148) | | `bashOutput` | [`Tool`](#tool)\<`BashOutputInput`\> | `bashOutputTool` | [tools/builtin/index.ts:149](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/index.ts#L149) | | `edit` | [`Tool`](#tool)\<[`EditInput`](#editinput)\> | `editTool` | [tools/builtin/index.ts:153](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/index.ts#L153) | | `glob` | [`Tool`](#tool)\<[`GlobInput`](#globinput)\> | `globTool` | [tools/builtin/index.ts:152](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/index.ts#L152) | | `grep` | [`Tool`](#tool)\<[`GrepInput`](#grepinput)\> | `grepTool` | [tools/builtin/index.ts:151](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/index.ts#L151) | | `killShell` | [`Tool`](#tool)\<`KillShellInput`\> | `killShellTool` | [tools/builtin/index.ts:150](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/index.ts#L150) | | `readFile` | [`Tool`](#tool)\<[`ReadFileInput`](#readfileinput)\> | `readFileTool` | [tools/builtin/index.ts:146](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/index.ts#L146) | | `suggest` | [`Tool`](#tool)\<[`SuggestInput`](#suggestinput)\> | `suggestTool` | [tools/builtin/index.ts:157](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/index.ts#L157) | | `todoRead` | [`Tool`](#tool)\<[`TodoReadInput`](#todoreadinput)\> | `todoReadTool` | [tools/builtin/index.ts:155](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/index.ts#L155) | | `todoWrite` | [`Tool`](#tool)\<[`TodoWriteInput`](#todowriteinput)\> | `todoWriteTool` | [tools/builtin/index.ts:154](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/index.ts#L154) | | `webFetch` | [`Tool`](#tool)\<`WebFetchInput`\> | `webFetchTool` | [tools/builtin/index.ts:156](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/index.ts#L156) | | `writeFile` | [`Tool`](#tool)\<[`WriteFileInput`](#writefileinput)\> | `writeFileTool` | [tools/builtin/index.ts:147](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/index.ts#L147) | *** ### CURRENT\_STATE\_VERSION ```ts const CURRENT_STATE_VERSION: 1 = 1; ``` Defined in: [state/types.ts:401](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/types.ts#L401) Current schema version for AgentState. Increment when making breaking changes to the schema. *** ### DEFAULT\_CONTEXT\_CONFIG ```ts const DEFAULT_CONTEXT_CONFIG: ContextConfig; ``` Defined in: [context/manager.ts:55](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/manager.ts#L55) Default context configuration *** ### DEFAULT\_DELEGATION\_CONFIG ```ts const DEFAULT_DELEGATION_CONFIG: DelegationConfig; ``` Defined in: [context/delegation-types.ts:107](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/delegation-types.ts#L107) Default delegation configuration values. *** ### DEFAULT\_INPUT\_COMPACTION ```ts const DEFAULT_INPUT_COMPACTION: Map; ``` Defined in: [context/observation-masker.ts:45](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/observation-masker.ts#L45) *** ### DEFAULT\_MASK\_CONFIG ```ts const DEFAULT_MASK_CONFIG: ObservationMaskConfig; ``` Defined in: [context/observation-masker.ts:50](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/observation-masker.ts#L50) *** ### DEFAULT\_PRUNE\_CONFIG ```ts const DEFAULT_PRUNE_CONFIG: PruneConfig; ``` Defined in: [context/dead-message-pruner.ts:31](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/dead-message-pruner.ts#L31) *** ### DEFAULT\_RETRY\_CONFIG ```ts const DEFAULT_RETRY_CONFIG: Required; ``` Defined in: [utils/index.ts:83](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/utils/index.ts#L83) Default retry configuration *** ### DEFAULT\_SAFETY\_ANCHORS ```ts const DEFAULT_SAFETY_ANCHORS: Anchor[]; ``` Defined in: [anchors/builtin.ts:13](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/builtin.ts#L13) Default safety anchors shipped with the library *** ### DEFAULT\_WEIGHTS ```ts const DEFAULT_WEIGHTS: EffortWeights; ``` Defined in: [episodes/effort.ts:17](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/effort.ts#L17) Default weights for effort estimation. *** ### defaultAgentTypes ```ts const defaultAgentTypes: Record; ``` Defined in: [tools/builtin/task.ts:504](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/task.ts#L504) Default agent type configurations *** ### defaultSerializer ```ts const defaultSerializer: JsonSerializer; ``` Defined in: [state/serializer.ts:238](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/state/serializer.ts#L238) Default serializer instance *** ### DELEGATION\_SYSTEM\_PROMPT ```ts const DELEGATION_SYSTEM_PROMPT: string; ``` Defined in: [context/tool-result-delegator.ts:369](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/tool-result-delegator.ts#L369) System prompt addition when delegation is enabled. Append to the agent's system prompt. *** ### editTool ```ts const editTool: Tool; ``` Defined in: [tools/builtin/edit.ts:44](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/edit.ts#L44) Edit tool definition *** ### EFFORT\_ORDER ```ts const EFFORT_ORDER: readonly Effort[]; ``` Defined in: [episodes/effort.ts:28](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/effort.ts#L28) Ordered effort levels for ordinal comparison. Index 0 = lowest, index 4 = highest. *** ### GenAIAttributes ```ts const GenAIAttributes: { OPERATION_NAME: "gen_ai.operation.name"; REQUEST_MAX_TOKENS: "gen_ai.request.max_tokens"; REQUEST_MODEL: "gen_ai.request.model"; REQUEST_TEMPERATURE: "gen_ai.request.temperature"; RESPONSE_FINISH_REASON: "gen_ai.response.finish_reasons"; RESPONSE_MODEL: "gen_ai.response.model"; SYSTEM: "gen_ai.system"; USAGE_INPUT_TOKENS: "gen_ai.usage.input_tokens"; USAGE_OUTPUT_TOKENS: "gen_ai.usage.output_tokens"; }; ``` Defined in: [tracing/otel-attributes.ts:13](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/otel-attributes.ts#L13) gen_ai.* semantic convention attributes for LLM operations #### Type Declaration | Name | Type | Default value | Description | Defined in | | ------ | ------ | ------ | ------ | ------ | | `OPERATION_NAME` | `"gen_ai.operation.name"` | `'gen_ai.operation.name'` | The operation name (e.g. 'chat') | [tracing/otel-attributes.ts:17](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/otel-attributes.ts#L17) | | `REQUEST_MAX_TOKENS` | `"gen_ai.request.max_tokens"` | `'gen_ai.request.max_tokens'` | Max tokens requested | [tracing/otel-attributes.ts:21](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/otel-attributes.ts#L21) | | `REQUEST_MODEL` | `"gen_ai.request.model"` | `'gen_ai.request.model'` | The model requested | [tracing/otel-attributes.ts:19](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/otel-attributes.ts#L19) | | `REQUEST_TEMPERATURE` | `"gen_ai.request.temperature"` | `'gen_ai.request.temperature'` | Temperature requested | [tracing/otel-attributes.ts:23](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/otel-attributes.ts#L23) | | `RESPONSE_FINISH_REASON` | `"gen_ai.response.finish_reasons"` | `'gen_ai.response.finish_reasons'` | Finish reasons (e.g. ['stop'], ['tool_calls']) | [tracing/otel-attributes.ts:27](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/otel-attributes.ts#L27) | | `RESPONSE_MODEL` | `"gen_ai.response.model"` | `'gen_ai.response.model'` | The model actually used in the response | [tracing/otel-attributes.ts:25](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/otel-attributes.ts#L25) | | `SYSTEM` | `"gen_ai.system"` | `'gen_ai.system'` | The AI system (e.g. 'anthropic', 'openai', 'google') | [tracing/otel-attributes.ts:15](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/otel-attributes.ts#L15) | | `USAGE_INPUT_TOKENS` | `"gen_ai.usage.input_tokens"` | `'gen_ai.usage.input_tokens'` | Input token count | [tracing/otel-attributes.ts:29](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/otel-attributes.ts#L29) | | `USAGE_OUTPUT_TOKENS` | `"gen_ai.usage.output_tokens"` | `'gen_ai.usage.output_tokens'` | Output token count | [tracing/otel-attributes.ts:31](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/otel-attributes.ts#L31) | *** ### GENERIC\_PATTERNS ```ts const GENERIC_PATTERNS: FilePattern[]; ``` Defined in: [memory/loader.ts:141](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/loader.ts#L141) Generic patterns that apply to any LLM *** ### globTool ```ts const globTool: Tool; ``` Defined in: [tools/builtin/glob.ts:90](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/glob.ts#L90) Glob tool definition *** ### grepTool ```ts const grepTool: Tool; ``` Defined in: [tools/builtin/grep.ts:119](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/grep.ts#L119) Grep tool definition *** ### INJECTION\_PATTERNS ```ts const INJECTION_PATTERNS: InjectionPattern[]; ``` Defined in: [guardrails/injection-detection.ts:36](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/injection-detection.ts#L36) Built-in prompt injection patterns. Ordered by severity (high first). *** ### killShellTool ```ts const killShellTool: Tool; ``` Defined in: [tools/builtin/kill-shell.ts:42](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/kill-shell.ts#L42) KillShell tool definition *** ### PROVIDER\_PATTERNS ```ts const PROVIDER_PATTERNS: ProviderPatterns[]; ``` Defined in: [memory/loader.ts:45](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/loader.ts#L45) Built-in patterns for various LLM providers *** ### PROVIDER\_TO\_SYSTEM ```ts const PROVIDER_TO_SYSTEM: Record; ``` Defined in: [tracing/otel-attributes.ts:62](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/otel-attributes.ts#L62) Maps provider names (as used in the agents library) to gen_ai.system values following OpenTelemetry semantic conventions. *** ### ProviderRateLimits ```ts const ProviderRateLimits: { claude: { tier1: { requestsPerMinute: 50; tokensPerMinute: 40000; }; tier2: { requestsPerMinute: 1000; tokensPerMinute: 80000; }; tier3: { requestsPerMinute: 2000; tokensPerMinute: 160000; }; tier4: { requestsPerMinute: 4000; tokensPerMinute: 400000; }; }; openai: { gpt35Turbo: { requestsPerMinute: 3500; tokensPerMinute: 90000; }; gpt4: { requestsPerMinute: 500; tokensPerMinute: 10000; }; gpt4Turbo: { requestsPerMinute: 500; tokensPerMinute: 30000; }; }; }; ``` Defined in: [rate-limit/provider-wrapper.ts:172](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/provider-wrapper.ts#L172) Default rate limits for known providers #### Type Declaration | Name | Type | Default value | Description | Defined in | | ------ | ------ | ------ | ------ | ------ | | `claude` | \{ `tier1`: \{ `requestsPerMinute`: `50`; `tokensPerMinute`: `40000`; \}; `tier2`: \{ `requestsPerMinute`: `1000`; `tokensPerMinute`: `80000`; \}; `tier3`: \{ `requestsPerMinute`: `2000`; `tokensPerMinute`: `160000`; \}; `tier4`: \{ `requestsPerMinute`: `4000`; `tokensPerMinute`: `400000`; \}; \} | - | Anthropic Claude API limits (Tier 1) **See** https://docs.anthropic.com/en/api/rate-limits | [rate-limit/provider-wrapper.ts:177](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/provider-wrapper.ts#L177) | | `claude.tier1` | \{ `requestsPerMinute`: `50`; `tokensPerMinute`: `40000`; \} | - | - | [rate-limit/provider-wrapper.ts:178](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/provider-wrapper.ts#L178) | | `claude.tier1.requestsPerMinute` | `50` | `50` | - | [rate-limit/provider-wrapper.ts:179](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/provider-wrapper.ts#L179) | | `claude.tier1.tokensPerMinute` | `40000` | `40000` | - | [rate-limit/provider-wrapper.ts:180](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/provider-wrapper.ts#L180) | | `claude.tier2` | \{ `requestsPerMinute`: `1000`; `tokensPerMinute`: `80000`; \} | - | - | [rate-limit/provider-wrapper.ts:182](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/provider-wrapper.ts#L182) | | `claude.tier2.requestsPerMinute` | `1000` | `1000` | - | [rate-limit/provider-wrapper.ts:183](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/provider-wrapper.ts#L183) | | `claude.tier2.tokensPerMinute` | `80000` | `80000` | - | [rate-limit/provider-wrapper.ts:184](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/provider-wrapper.ts#L184) | | `claude.tier3` | \{ `requestsPerMinute`: `2000`; `tokensPerMinute`: `160000`; \} | - | - | [rate-limit/provider-wrapper.ts:186](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/provider-wrapper.ts#L186) | | `claude.tier3.requestsPerMinute` | `2000` | `2000` | - | [rate-limit/provider-wrapper.ts:187](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/provider-wrapper.ts#L187) | | `claude.tier3.tokensPerMinute` | `160000` | `160000` | - | [rate-limit/provider-wrapper.ts:188](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/provider-wrapper.ts#L188) | | `claude.tier4` | \{ `requestsPerMinute`: `4000`; `tokensPerMinute`: `400000`; \} | - | - | [rate-limit/provider-wrapper.ts:190](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/provider-wrapper.ts#L190) | | `claude.tier4.requestsPerMinute` | `4000` | `4000` | - | [rate-limit/provider-wrapper.ts:191](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/provider-wrapper.ts#L191) | | `claude.tier4.tokensPerMinute` | `400000` | `400000` | - | [rate-limit/provider-wrapper.ts:192](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/provider-wrapper.ts#L192) | | `openai` | \{ `gpt35Turbo`: \{ `requestsPerMinute`: `3500`; `tokensPerMinute`: `90000`; \}; `gpt4`: \{ `requestsPerMinute`: `500`; `tokensPerMinute`: `10000`; \}; `gpt4Turbo`: \{ `requestsPerMinute`: `500`; `tokensPerMinute`: `30000`; \}; \} | - | OpenAI GPT-4 API limits (approximate) | [rate-limit/provider-wrapper.ts:199](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/provider-wrapper.ts#L199) | | `openai.gpt35Turbo` | \{ `requestsPerMinute`: `3500`; `tokensPerMinute`: `90000`; \} | - | - | [rate-limit/provider-wrapper.ts:208](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/provider-wrapper.ts#L208) | | `openai.gpt35Turbo.requestsPerMinute` | `3500` | `3500` | - | [rate-limit/provider-wrapper.ts:209](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/provider-wrapper.ts#L209) | | `openai.gpt35Turbo.tokensPerMinute` | `90000` | `90000` | - | [rate-limit/provider-wrapper.ts:210](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/provider-wrapper.ts#L210) | | `openai.gpt4` | \{ `requestsPerMinute`: `500`; `tokensPerMinute`: `10000`; \} | - | - | [rate-limit/provider-wrapper.ts:200](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/provider-wrapper.ts#L200) | | `openai.gpt4.requestsPerMinute` | `500` | `500` | - | [rate-limit/provider-wrapper.ts:201](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/provider-wrapper.ts#L201) | | `openai.gpt4.tokensPerMinute` | `10000` | `10000` | - | [rate-limit/provider-wrapper.ts:202](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/provider-wrapper.ts#L202) | | `openai.gpt4Turbo` | \{ `requestsPerMinute`: `500`; `tokensPerMinute`: `30000`; \} | - | - | [rate-limit/provider-wrapper.ts:204](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/provider-wrapper.ts#L204) | | `openai.gpt4Turbo.requestsPerMinute` | `500` | `500` | - | [rate-limit/provider-wrapper.ts:205](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/provider-wrapper.ts#L205) | | `openai.gpt4Turbo.tokensPerMinute` | `30000` | `30000` | - | [rate-limit/provider-wrapper.ts:206](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/provider-wrapper.ts#L206) | *** ### readFileTool ```ts const readFileTool: Tool; ``` Defined in: [tools/builtin/read-file.ts:49](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/read-file.ts#L49) Read file tool definition *** ### RetryPresets ```ts const RetryPresets: { aggressive: () => RetryConfig; conservative: () => RetryConfig; none: () => RetryConfig; respectful: () => RetryConfig; }; ``` Defined in: [rate-limit/retry.ts:226](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/retry.ts#L226) Retry configuration builder for common scenarios #### Type Declaration | Name | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `aggressive()` | () => [`RetryConfig`](#retryconfig) | Aggressive retry: more retries, shorter delays | [rate-limit/retry.ts:241](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/retry.ts#L241) | | `conservative()` | () => [`RetryConfig`](#retryconfig) | Conservative retry: few retries, long delays | [rate-limit/retry.ts:230](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/retry.ts#L230) | | `none()` | () => [`RetryConfig`](#retryconfig) | No retry: fail immediately | [rate-limit/retry.ts:252](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/retry.ts#L252) | | `respectful()` | () => [`RetryConfig`](#retryconfig) | Respect API limits: use Retry-After headers when available | [rate-limit/retry.ts:259](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/retry.ts#L259) | *** ### SemanticAttributes ```ts const SemanticAttributes: { AGENT_ITERATION: "agent.iteration"; AGENT_MAX_ITERATIONS: "agent.max_iterations"; AGENT_SESSION_ID: "agent.session_id"; ERROR_MESSAGE: "error.message"; ERROR_STACK: "error.stack"; ERROR_TYPE: "error.type"; LLM_CACHE_CREATION_TOKENS: "llm.cache_creation_tokens"; LLM_CACHE_READ_TOKENS: "llm.cache_read_tokens"; LLM_INPUT_TOKENS: "llm.input_tokens"; LLM_MODEL: "llm.model"; LLM_OUTPUT_TOKENS: "llm.output_tokens"; LLM_PROVIDER: "llm.provider"; LLM_TOTAL_TOKENS: "llm.total_tokens"; MESSAGE_COUNT: "message.count"; MESSAGE_ROLE: "message.role"; TOOL_ERROR: "tool.error"; TOOL_INPUT: "tool.input"; TOOL_NAME: "tool.name"; TOOL_RESULT: "tool.result"; TOOL_SUCCESS: "tool.success"; }; ``` Defined in: [tracing/types.ts:118](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L118) Standard attribute names following OpenTelemetry semantic conventions #### Type Declaration | Name | Type | Default value | Defined in | | ------ | ------ | ------ | ------ | | `AGENT_ITERATION` | `"agent.iteration"` | `'agent.iteration'` | [tracing/types.ts:121](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L121) | | `AGENT_MAX_ITERATIONS` | `"agent.max_iterations"` | `'agent.max_iterations'` | [tracing/types.ts:122](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L122) | | `AGENT_SESSION_ID` | `"agent.session_id"` | `'agent.session_id'` | [tracing/types.ts:120](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L120) | | `ERROR_MESSAGE` | `"error.message"` | `'error.message'` | [tracing/types.ts:146](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L146) | | `ERROR_STACK` | `"error.stack"` | `'error.stack'` | [tracing/types.ts:147](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L147) | | `ERROR_TYPE` | `"error.type"` | `'error.type'` | [tracing/types.ts:145](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L145) | | `LLM_CACHE_CREATION_TOKENS` | `"llm.cache_creation_tokens"` | `'llm.cache_creation_tokens'` | [tracing/types.ts:131](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L131) | | `LLM_CACHE_READ_TOKENS` | `"llm.cache_read_tokens"` | `'llm.cache_read_tokens'` | [tracing/types.ts:130](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L130) | | `LLM_INPUT_TOKENS` | `"llm.input_tokens"` | `'llm.input_tokens'` | [tracing/types.ts:127](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L127) | | `LLM_MODEL` | `"llm.model"` | `'llm.model'` | [tracing/types.ts:126](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L126) | | `LLM_OUTPUT_TOKENS` | `"llm.output_tokens"` | `'llm.output_tokens'` | [tracing/types.ts:128](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L128) | | `LLM_PROVIDER` | `"llm.provider"` | `'llm.provider'` | [tracing/types.ts:125](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L125) | | `LLM_TOTAL_TOKENS` | `"llm.total_tokens"` | `'llm.total_tokens'` | [tracing/types.ts:129](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L129) | | `MESSAGE_COUNT` | `"message.count"` | `'message.count'` | [tracing/types.ts:142](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L142) | | `MESSAGE_ROLE` | `"message.role"` | `'message.role'` | [tracing/types.ts:141](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L141) | | `TOOL_ERROR` | `"tool.error"` | `'tool.error'` | [tracing/types.ts:137](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L137) | | `TOOL_INPUT` | `"tool.input"` | `'tool.input'` | [tracing/types.ts:135](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L135) | | `TOOL_NAME` | `"tool.name"` | `'tool.name'` | [tracing/types.ts:134](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L134) | | `TOOL_RESULT` | `"tool.result"` | `'tool.result'` | [tracing/types.ts:138](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L138) | | `TOOL_SUCCESS` | `"tool.success"` | `'tool.success'` | [tracing/types.ts:136](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/types.ts#L136) | *** ### suggestTool ```ts const suggestTool: Tool; ``` Defined in: [tools/builtin/suggest.ts:46](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/suggest.ts#L46) Default suggest tool (no-op, for testing or when suggestions are disabled) *** ### todoReadTool ```ts const todoReadTool: Tool; ``` Defined in: [tools/builtin/todo.ts:362](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/todo.ts#L362) TodoRead tool - Get the current task list *** ### todoWriteTool ```ts const todoWriteTool: Tool; ``` Defined in: [tools/builtin/todo.ts:286](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/todo.ts#L286) TodoWrite tool - Update the task list *** ### TOOL\_NAMES ```ts const TOOL_NAMES: { BASH: "bash"; BASH_OUTPUT: "bash_output"; EDIT: "edit"; GLOB: "glob"; GREP: "grep"; KILL_SHELL: "kill_shell"; READ_FILE: "read_file"; SUGGEST: "suggest"; TASK: "task"; TODO_READ: "todo_read"; TODO_WRITE: "todo_write"; WEB_FETCH: "web_fetch"; WRITE_FILE: "write_file"; }; ``` Defined in: [tools/builtin/tool-names.ts:11](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/tool-names.ts#L11) Built-in tool names as constants #### Type Declaration | Name | Type | Default value | Defined in | | ------ | ------ | ------ | ------ | | `BASH` | `"bash"` | `'bash'` | [tools/builtin/tool-names.ts:14](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/tool-names.ts#L14) | | `BASH_OUTPUT` | `"bash_output"` | `'bash_output'` | [tools/builtin/tool-names.ts:15](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/tool-names.ts#L15) | | `EDIT` | `"edit"` | `'edit'` | [tools/builtin/tool-names.ts:19](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/tool-names.ts#L19) | | `GLOB` | `"glob"` | `'glob'` | [tools/builtin/tool-names.ts:18](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/tool-names.ts#L18) | | `GREP` | `"grep"` | `'grep'` | [tools/builtin/tool-names.ts:17](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/tool-names.ts#L17) | | `KILL_SHELL` | `"kill_shell"` | `'kill_shell'` | [tools/builtin/tool-names.ts:16](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/tool-names.ts#L16) | | `READ_FILE` | `"read_file"` | `'read_file'` | [tools/builtin/tool-names.ts:12](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/tool-names.ts#L12) | | `SUGGEST` | `"suggest"` | `'suggest'` | [tools/builtin/tool-names.ts:24](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/tool-names.ts#L24) | | `TASK` | `"task"` | `'task'` | [tools/builtin/tool-names.ts:23](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/tool-names.ts#L23) | | `TODO_READ` | `"todo_read"` | `'todo_read'` | [tools/builtin/tool-names.ts:21](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/tool-names.ts#L21) | | `TODO_WRITE` | `"todo_write"` | `'todo_write'` | [tools/builtin/tool-names.ts:20](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/tool-names.ts#L20) | | `WEB_FETCH` | `"web_fetch"` | `'web_fetch'` | [tools/builtin/tool-names.ts:22](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/tool-names.ts#L22) | | `WRITE_FILE` | `"write_file"` | `'write_file'` | [tools/builtin/tool-names.ts:13](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/tool-names.ts#L13) | *** ### TOOL\_SETS ```ts const TOOL_SETS: { READ_ONLY: readonly ["glob", "grep", "read_file"]; READ_ONLY_WITH_BASH: readonly ["bash", "glob", "grep", "read_file"]; READ_ONLY_WITH_WEB: readonly ["web_fetch", "glob", "grep", "read_file"]; REFACTOR: readonly ["glob", "grep", "read_file", "edit", "write_file"]; SECURITY_AUDIT: readonly ["glob", "grep", "read_file", "bash"]; }; ``` Defined in: [tools/builtin/tool-names.ts:36](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/tool-names.ts#L36) Common tool sets for agent types Use these instead of hardcoding tool arrays #### Type Declaration | Name | Type | Description | Defined in | | ------ | ------ | ------ | ------ | | `READ_ONLY` | readonly \[`"glob"`, `"grep"`, `"read_file"`\] | Read-only tools for exploration and code review | [tools/builtin/tool-names.ts:38](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/tool-names.ts#L38) | | `READ_ONLY_WITH_BASH` | readonly \[`"bash"`, `"glob"`, `"grep"`, `"read_file"`\] | Read-only tools plus bash for running commands | [tools/builtin/tool-names.ts:41](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/tool-names.ts#L41) | | `READ_ONLY_WITH_WEB` | readonly \[`"web_fetch"`, `"glob"`, `"grep"`, `"read_file"`\] | Read-only tools plus web fetch for documentation lookup | [tools/builtin/tool-names.ts:44](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/tool-names.ts#L44) | | `REFACTOR` | readonly \[`"glob"`, `"grep"`, `"read_file"`, `"edit"`, `"write_file"`\] | Tools for refactoring (read + edit + write, no bash) | [tools/builtin/tool-names.ts:52](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/tool-names.ts#L52) | | `SECURITY_AUDIT` | readonly \[`"glob"`, `"grep"`, `"read_file"`, `"bash"`\] | Tools for security auditing (read + bash for dependency checks) | [tools/builtin/tool-names.ts:61](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/tool-names.ts#L61) | *** ### TRACKED\_TOOLS ```ts const TRACKED_TOOLS: readonly ["read_file", "write_file", "edit", "grep", "glob"]; ``` Defined in: [context/file-tracking-hook.ts:171](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/file-tracking-hook.ts#L171) Tool names that this hook tracks *** ### webFetchTool ```ts const webFetchTool: Tool; ``` Defined in: [tools/builtin/web-fetch.ts:85](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/web-fetch.ts#L85) WebFetch tool definition *** ### writeFileTool ```ts const writeFileTool: Tool; ``` Defined in: [tools/builtin/write-file.ts:44](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/write-file.ts#L44) Write file tool definition ## Functions ### assistantMessage() ```ts function assistantMessage(content): Message; ``` Defined in: [messages/index.ts:23](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/messages/index.ts#L23) Create an assistant message #### Parameters | Parameter | Type | | ------ | ------ | | `content` | `string` \| [`ContentBlock`](#contentblock)[] | #### Returns [`Message`](#message-4) *** ### buildMaskText() ```ts function buildMaskText(stamp): string; ``` Defined in: [context/observation-masker.ts:388](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/observation-masker.ts#L388) Build the compact mask text that replaces the original content. #### Parameters | Parameter | Type | | ------ | ------ | | `stamp` | `TurnStamp` | #### Returns `string` *** ### calculateBackoffDelay() ```ts function calculateBackoffDelay( attempt, baseDelayMs?, maxDelayMs?): number; ``` Defined in: [utils/index.ts:138](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/utils/index.ts#L138) Calculate delay with exponential backoff and jitter #### Parameters | Parameter | Type | Default value | Description | | ------ | ------ | ------ | ------ | | `attempt` | `number` | `undefined` | Current attempt number (0-indexed) | | `baseDelayMs` | `number` | `DEFAULT_RETRY_CONFIG.baseDelayMs` | Base delay in milliseconds | | `maxDelayMs` | `number` | `DEFAULT_RETRY_CONFIG.maxDelayMs` | Maximum delay cap in milliseconds | #### Returns `number` Delay in milliseconds *** ### cleanupTodoContextMessages() ```ts function cleanupTodoContextMessages(messages, options?): T[]; ``` Defined in: [tools/builtin/todo.ts:763](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/todo.ts#L763) Filter messages to remove redundant todo tool calls. This helps prevent context bloat from repeated todo_write calls. The function keeps only the last N todo_write calls (default: 1), removing earlier ones to reduce context size. #### Type Parameters | Type Parameter | | ------ | | `T` *extends* \{ `content`: `unknown`; `role`: `string`; \} | #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `messages` | `T`[] | Array of messages to filter | | `options?` | [`TodoContextCleanupOptions`](#todocontextcleanupoptions) | Cleanup options | #### Returns `T`[] Filtered messages with redundant todo calls removed *** ### compactToolResult() ```ts function compactToolResult( toolName, result, input?): string; ``` Defined in: [context/result-compactor.ts:34](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/result-compactor.ts#L34) Format a tool result as compact text for LLM context. Falls back to JSON.stringify for unknown tools or non-object results. #### Parameters | Parameter | Type | | ------ | ------ | | `toolName` | `string` | | `result` | `unknown` | | `input?` | `Record`\<`string`, `unknown`\> | #### Returns `string` *** ### contentBlocksToString() ```ts function contentBlocksToString(blocks): string; ``` Defined in: [mcp/tools.ts:25](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/tools.ts#L25) Convert MCP content blocks to a string result #### Parameters | Parameter | Type | | ------ | ------ | | `blocks` | [`MCPContentBlock`](#mcpcontentblock)[] | #### Returns `string` *** ### convertMCPResult() ```ts function convertMCPResult(result): ToolExecutionResult; ``` Defined in: [mcp/tools.ts:45](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/tools.ts#L45) Convert an MCP tool result to our ToolExecutionResult format #### Parameters | Parameter | Type | | ------ | ------ | | `result` | [`MCPToolResult`](#mcptoolresult) | #### Returns [`ToolExecutionResult`](#toolexecutionresult) *** ### countMessageTokens() ```ts function countMessageTokens(messages): number; ``` Defined in: [utils/tokenizer.ts:75](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/utils/tokenizer.ts#L75) Count tokens across an array of messages Extracts all text content from messages (text blocks, tool inputs/results, thinking blocks) and counts tokens using tiktoken. #### Parameters | Parameter | Type | | ------ | ------ | | `messages` | [`Message`](#message-4)[] | #### Returns `number` *** ### countTokens() ```ts function countTokens(text): number; ``` Defined in: [utils/tokenizer.ts:57](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/utils/tokenizer.ts#L57) Count tokens in a text string using tiktoken. Falls back to chars/4 heuristic for very large or pathologically repetitive strings. #### Parameters | Parameter | Type | | ------ | ------ | | `text` | `string` | #### Returns `number` *** ### createBashOutputTool() ```ts function createBashOutputTool(options?): Tool; ``` Defined in: [tools/builtin/bash-output.ts:127](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/bash-output.ts#L127) Factory function to create a bashOutput tool with custom shell manager #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `options?` | \{ `shellManager?`: [`ShellManager`](#shellmanager); \} | - | | `options.shellManager?` | [`ShellManager`](#shellmanager) | Custom shell manager to use | #### Returns [`Tool`](#tool)\<`BashOutputInput`\> *** ### createBashTool() ```ts function createBashTool(options?): Tool; ``` Defined in: [tools/builtin/bash.ts:671](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/bash.ts#L671) Factory function to create a bash tool with custom options SECURITY NOTE: The blockedCommands and allowedCommands options provide ADVISORY filtering only. They are NOT a security boundary. Shell commands can be obfuscated in many ways (quotes, escape sequences, command substitution, environment variables, etc.) that bypass simple string matching. For actual security isolation, use: - Container/sandbox environments - seccomp/AppArmor profiles - Dedicated restricted shells (rbash) - User namespace isolation #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `options?` | \{ `allowedCommands?`: `string`[]; `blockedCommands?`: `string`[]; `cwd?`: `string`; `fifoMode?`: `"warn"` \| `"block"` \| `"allow"`; `maxOutputSize?`: `number`; `restrictToAllowed?`: `boolean`; `shell?`: `string`; `shellManager?`: [`ShellManager`](#shellmanager); `timeout?`: `number`; \} | - | | `options.allowedCommands?` | `string`[] | List of allowed commands - must match exactly (only used if restrictToAllowed is true) | | `options.blockedCommands?` | `string`[] | Commands or patterns that are not allowed (ADVISORY ONLY - see security note) | | `options.cwd?` | `string` | Default working directory | | `options.fifoMode?` | `"warn"` \| `"block"` \| `"allow"` | How to handle FIFO/named pipe usage detection - 'warn': Add warning to result (default) - 'block': Return error if FIFO usage detected - 'allow': Ignore FIFO detection | | `options.maxOutputSize?` | `number` | Maximum output size returned to agent (default: 50KB). Larger outputs are truncated to prevent memory bloat. | | `options.restrictToAllowed?` | `boolean` | If true, only allow commands in allowedCommands list (ADVISORY ONLY) | | `options.shell?` | `string` | Shell to use (default: /bin/bash) | | `options.shellManager?` | [`ShellManager`](#shellmanager) | Custom shell manager for background processes | | `options.timeout?` | `number` | Default timeout in milliseconds | #### Returns [`Tool`](#tool)\<[`BashInput`](#bashinput)\> *** ### createBatchExporter() ```ts function createBatchExporter(innerExporter, options?): OTelExporter; ``` Defined in: [tracing/otel.ts:217](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/otel.ts#L217) Create a batch exporter that buffers spans and exports in batches #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `innerExporter` | [`OTelExporter`](#otelexporter) | The actual exporter to use | | `options` | \{ `flushIntervalMs?`: `number`; `maxBatchSize?`: `number`; \} | Batch options | | `options.flushIntervalMs?` | `number` | - | | `options.maxBatchSize?` | `number` | - | #### Returns [`OTelExporter`](#otelexporter) OTelExporter instance #### Example ```typescript const otelExporter = await createOTelExporter(); const batchExporter = createBatchExporter(otelExporter, { maxBatchSize: 100, flushIntervalMs: 5000, }); ``` *** ### createBufferedLogger() ```ts function createBufferedLogger(): StructuredLogger & { clear: () => void; entries: LogEntry[]; }; ``` Defined in: [tracing/logging.ts:242](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/logging.ts#L242) Create a logger that buffers entries (useful for testing) #### Returns [`StructuredLogger`](#structuredlogger) & \{ `clear`: () => `void`; `entries`: [`LogEntry`](#logentry)[]; \} *** ### createClaudeProvider() ```ts function createClaudeProvider(config?): ClaudeProvider; ``` Defined in: [providers/claude.ts:746](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/claude.ts#L746) Create a ClaudeProvider with API key from environment #### Parameters | Parameter | Type | | ------ | ------ | | `config?` | `Partial`\<[`ClaudeProviderConfig`](#claudeproviderconfig)\> | #### Returns [`ClaudeProvider`](#claudeprovider) *** ### createConsoleExporter() ```ts function createConsoleExporter(options?): OTelExporter; ``` Defined in: [tracing/otel.ts:163](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/otel.ts#L163) Create a console exporter for debugging This exporter simply logs spans to the console in a readable format. Useful for development and debugging. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `options` | \{ `output?`: (`message`) => `void`; `prettyPrint?`: `boolean`; \} | Console exporter options | | `options.output?` | (`message`) => `void` | - | | `options.prettyPrint?` | `boolean` | - | #### Returns [`OTelExporter`](#otelexporter) OTelExporter instance #### Example ```typescript const exporter = createConsoleExporter({ prettyPrint: true }); const tracingManager = new TracingManager({ serviceName: 'my-agent', otelExporter: exporter, }); ``` *** ### createEditTool() ```ts function createEditTool(options?): Tool; ``` Defined in: [tools/builtin/edit.ts:209](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/edit.ts#L209) Factory function to create an edit tool with custom options #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `options?` | \{ `allowedExtensions?`: `string`[]; `baseDir?`: `string`; `disallowedPaths?`: `string`[]; \} | - | | `options.allowedExtensions?` | `string`[] | Allowed file extensions (if specified, only these can be edited) | | `options.baseDir?` | `string` | Base directory to resolve relative paths against | | `options.disallowedPaths?` | `string`[] | Disallowed paths (files that cannot be edited) | #### Returns [`Tool`](#tool)\<[`EditInput`](#editinput)\> *** ### createErrorResult() ```ts function createErrorResult(error): ToolExecutionResult; ``` Defined in: [tools/define.ts:109](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/define.ts#L109) Create an error result for a tool #### Parameters | Parameter | Type | | ------ | ------ | | `error` | `string` \| `Error` | #### Returns [`ToolExecutionResult`](#toolexecutionresult) *** ### createFileAnalyzer() ```ts function createFileAnalyzer(): FileRehearsalAnalyzer; ``` Defined in: [rehearsal/file-analyzer.ts:411](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/file-analyzer.ts#L411) Create a File rehearsal analyzer #### Returns [`FileRehearsalAnalyzer`](#filerehearsalanalyzer) *** ### createFileTrackingHook() ```ts function createFileTrackingHook(tracker): AfterToolHook; ``` Defined in: [context/file-tracking-hook.ts:79](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/file-tracking-hook.ts#L79) Create an afterTool hook that tracks file accesses #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `tracker` | [`FileAccessTracker`](#fileaccesstracker) | FileAccessTracker instance to record accesses | #### Returns [`AfterToolHook`](#aftertoolhook) An afterTool hook function *** ### createFireworksProvider() ```ts function createFireworksProvider(config?): FireworksProvider; ``` Defined in: [providers/fireworks.ts:196](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/fireworks.ts#L196) Create a Fireworks AI provider instance #### Parameters | Parameter | Type | | ------ | ------ | | `config` | [`FireworksProviderConfig`](#fireworksproviderconfig) | #### Returns [`FireworksProvider`](#fireworksprovider) #### Example ```typescript // Using environment variable (FIREWORKS_API_KEY) const provider = createFireworksProvider(); // With explicit API key const provider = createFireworksProvider({ apiKey: 'fw_...' }); // With custom model const provider = createFireworksProvider({ model: 'accounts/fireworks/models/llama-v3p1-70b-instruct' }); ``` *** ### createGeminiLegacyProvider() ```ts function createGeminiLegacyProvider(config?): GeminiLegacyProvider; ``` Defined in: [providers/gemini.ts:192](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/gemini.ts#L192) Create a Gemini provider instance #### Parameters | Parameter | Type | | ------ | ------ | | `config` | [`GeminiLegacyProviderConfig`](#geminilegacyproviderconfig) | #### Returns [`GeminiLegacyProvider`](#geminilegacyprovider) #### Example ```typescript // Using environment variable (GOOGLE_AI_API_KEY or GEMINI_API_KEY) const provider = createGeminiProvider(); // With explicit API key const provider = createGeminiProvider({ apiKey: 'AI...' }); // With custom model const provider = createGeminiProvider({ model: 'gemini-1.5-pro' }); // Available models: // - gemini-2.0-flash (default, fast) // - gemini-1.5-flash (faster, cheaper) // - gemini-1.5-pro (more capable) ``` *** ### createGeminiProvider() ```ts function createGeminiProvider(config?): GeminiProvider; ``` Defined in: [providers/gemini-native.ts:502](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/gemini-native.ts#L502) Create a GeminiNativeProvider with API key from environment #### Parameters | Parameter | Type | | ------ | ------ | | `config?` | `Partial`\<[`GeminiProviderConfig`](#geminiproviderconfig)\> | #### Returns [`GeminiProvider`](#geminiprovider) *** ### createGitAnalyzer() ```ts function createGitAnalyzer(): GitRehearsalAnalyzer; ``` Defined in: [rehearsal/git-analyzer.ts:570](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/git-analyzer.ts#L570) Create a Git rehearsal analyzer #### Returns [`GitRehearsalAnalyzer`](#gitrehearsalanalyzer) *** ### createGlobTool() ```ts function createGlobTool(options?): Tool; ``` Defined in: [tools/builtin/glob.ts:333](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/glob.ts#L333) Factory function to create a glob tool with custom options #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `options?` | \{ `alwaysInclude?`: `string`[]; `baseDir?`: `string`; `excludeDirs?`: `string`[]; `ignorePatterns?`: `string`[]; \} | - | | `options.alwaysInclude?` | `string`[] | Always include these patterns regardless of ignore | | `options.baseDir?` | `string` | Base directory to resolve relative paths against | | `options.excludeDirs?` | `string`[] | Override default excluded directories. Defaults to: node_modules, .git, dist, build, etc. | | `options.ignorePatterns?` | `string`[] | Default patterns to ignore | #### Returns [`Tool`](#tool)\<[`GlobInput`](#globinput)\> *** ### createGrepTool() ```ts function createGrepTool(options?): Tool; ``` Defined in: [tools/builtin/grep.ts:473](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/grep.ts#L473) Factory function to create a grep tool with custom options TODO: Future enhancements could include: - maxFileSize: Skip files larger than specified size #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `options?` | \{ `baseDir?`: `string`; `defaultExtensions?`: `string`[]; `excludeDirs?`: `string`[]; \} | - | | `options.baseDir?` | `string` | Base directory to resolve relative paths against | | `options.defaultExtensions?` | `string`[] | Default file extensions to search | | `options.excludeDirs?` | `string`[] | Override default excluded directories. Defaults to: node_modules, .git, dist, build, etc. | #### Returns [`Tool`](#tool)\<[`GrepInput`](#grepinput)\> *** ### createGroqProvider() ```ts function createGroqProvider(config?): GroqProvider; ``` Defined in: [providers/groq.ts:180](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/groq.ts#L180) Create a Groq provider instance #### Parameters | Parameter | Type | | ------ | ------ | | `config` | [`GroqProviderConfig`](#groqproviderconfig) | #### Returns [`GroqProvider`](#groqprovider) #### Example ```typescript // Using environment variable (GROQ_API_KEY) const provider = createGroqProvider(); // With explicit API key const provider = createGroqProvider({ apiKey: 'gsk_...' }); // With custom model const provider = createGroqProvider({ model: 'llama-3.2-90b-vision-preview' }); ``` *** ### createInjectionDetectionHook() ```ts function createInjectionDetectionHook(options?): AfterToolHook; ``` Defined in: [guardrails/injection-hook.ts:88](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/injection-hook.ts#L88) Create an afterTool hook that scans content-reading tool results for prompt injection. #### Parameters | Parameter | Type | | ------ | ------ | | `options?` | [`InjectionHookOptions`](#injectionhookoptions) | #### Returns [`AfterToolHook`](#aftertoolhook) *** ### createIsolatedTodoStore() ```ts function createIsolatedTodoStore(): TodoStore; ``` Defined in: [tools/builtin/todo.ts:733](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/todo.ts#L733) Create a new isolated TodoStore instance. Use this when you need state isolation between parallel operations, such as concurrent sub-agent executions. This prevents state leakage between parallel runs. Inspired by LangGraph issue #6446: Parallel subgraphs with shared state keys cause InvalidUpdateError. #### Returns [`TodoStore`](#todostore) #### Example ```typescript // For parallel sub-agents, create isolated stores const store1 = createIsolatedTodoStore(); const store2 = createIsolatedTodoStore(); // Each sub-agent uses its own store await Promise.all([ runWithStore(store1, task1), runWithStore(store2, task2), ]); ``` *** ### createKillShellTool() ```ts function createKillShellTool(options?): Tool; ``` Defined in: [tools/builtin/kill-shell.ts:102](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/kill-shell.ts#L102) Factory function to create a killShell tool with custom shell manager #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `options?` | \{ `shellManager?`: [`ShellManager`](#shellmanager); \} | - | | `options.shellManager?` | [`ShellManager`](#shellmanager) | Custom shell manager to use | #### Returns [`Tool`](#tool)\<`KillShellInput`\> *** ### createLoggingHooks() ```ts function createLoggingHooks(logger?): HooksConfig; ``` Defined in: [tracing/hooks.ts:332](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/hooks.ts#L332) Create a simple logging hook that logs all agent events #### Parameters | Parameter | Type | Default value | Description | | ------ | ------ | ------ | ------ | | `logger` | (`message`, `data?`) => `void` | `console.log` | Logger function (default: console.log) | #### Returns [`HooksConfig`](#hooksconfig) HooksConfig with logging hooks #### Example ```typescript const loggingHooks = createLoggingHooks((msg) => myLogger.info(msg)); const agent = new Agent({ provider, hooks: loggingHooks }); ``` *** ### createMockProvider() ```ts function createMockProvider(responses?, config?): MockProvider; ``` Defined in: [providers/mock.ts:268](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/mock.ts#L268) Create a MockProvider with initial responses #### Parameters | Parameter | Type | Default value | | ------ | ------ | ------ | | `responses` | (`string` \| [`MockResponse`](#mockresponse))[] | `[]` | | `config?` | [`MockProviderConfig`](#mockproviderconfig) | `undefined` | #### Returns [`MockProvider`](#mockprovider) *** ### createMultiExporter() ```ts function createMultiExporter(exporters): OTelExporter; ``` Defined in: [tracing/otel.ts:287](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/otel.ts#L287) Create a multi-exporter that sends to multiple backends #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `exporters` | [`OTelExporter`](#otelexporter)[] | List of exporters to use | #### Returns [`OTelExporter`](#otelexporter) OTelExporter instance #### Example ```typescript const multiExporter = createMultiExporter([ createConsoleExporter(), await createOTelExporter(), ]); ``` *** ### createNoopLogger() ```ts function createNoopLogger(): StructuredLogger; ``` Defined in: [tracing/logging.ts:227](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/logging.ts#L227) Create a no-op logger (useful for testing or disabling logs) #### Returns [`StructuredLogger`](#structuredlogger) *** ### createNoopRateLimiter() ```ts function createNoopRateLimiter(): RateLimiter; ``` Defined in: [rate-limit/limiter.ts:375](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/limiter.ts#L375) Create a no-op rate limiter (for testing or unlimited access) #### Returns [`RateLimiter`](#ratelimiter) *** ### createOllamaProvider() ```ts function createOllamaProvider(config?): OllamaProvider; ``` Defined in: [providers/ollama.ts:174](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/ollama.ts#L174) Create an Ollama provider instance #### Parameters | Parameter | Type | | ------ | ------ | | `config` | [`OllamaProviderConfig`](#ollamaproviderconfig) | #### Returns [`OllamaProvider`](#ollamaprovider) #### Example ```typescript // Default configuration (llama3.1 on localhost:11434) const provider = createOllamaProvider(); // Custom model const provider = createOllamaProvider({ model: 'mistral' }); // Custom server const provider = createOllamaProvider({ baseUrl: 'http://192.168.1.100:11434', model: 'llama3.1:70b' }); ``` *** ### createOpenAIProvider() ```ts function createOpenAIProvider(config?): OpenAIProvider; ``` Defined in: [providers/openai.ts:194](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openai.ts#L194) Create an OpenAI provider instance #### Parameters | Parameter | Type | | ------ | ------ | | `config` | [`OpenAIProviderConfig`](#openaiproviderconfig) | #### Returns [`OpenAIProvider`](#openaiprovider) #### Example ```typescript // Using environment variable (OPENAI_API_KEY) const provider = createOpenAIProvider(); // With explicit API key const provider = createOpenAIProvider({ apiKey: 'sk-...' }); // With custom model const provider = createOpenAIProvider({ model: 'gpt-4o-mini' }); // With organization const provider = createOpenAIProvider({ apiKey: 'sk-...', organization: 'org-...' }); ``` *** ### createOpenRouterProvider() ```ts function createOpenRouterProvider(config?): OpenRouterProvider; ``` Defined in: [providers/openrouter.ts:201](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/openrouter.ts#L201) Create an OpenRouter provider instance #### Parameters | Parameter | Type | | ------ | ------ | | `config` | [`OpenRouterProviderConfig`](#openrouterproviderconfig) | #### Returns [`OpenRouterProvider`](#openrouterprovider) #### Example ```typescript // Using environment variable (OPENROUTER_API_KEY) const provider = createOpenRouterProvider(); // With explicit API key const provider = createOpenRouterProvider({ apiKey: 'sk-or-...' }); // With custom model and site attribution const provider = createOpenRouterProvider({ model: 'anthropic/claude-sonnet-4-6', siteUrl: 'https://myapp.com', siteName: 'My App' }); ``` *** ### createOTelExporter() ```ts function createOTelExporter(tracerName?, tracerVersion?): Promise; ``` Defined in: [tracing/otel.ts:98](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/otel.ts#L98) Create an OpenTelemetry exporter that wraps OTel spans This exporter converts our internal Span format to OpenTelemetry spans and uses the configured OTel tracer to export them. #### Parameters | Parameter | Type | Default value | Description | | ------ | ------ | ------ | ------ | | `tracerName` | `string` | `'agent-tracing'` | Name for the OTel tracer | | `tracerVersion` | `string` | `'1.0.0'` | Version for the OTel tracer | #### Returns `Promise`\<[`OTelExporter`](#otelexporter)\> OTelExporter instance #### Example ```typescript // First, set up OpenTelemetry in your application: // import { NodeTracerProvider } from '@opentelemetry/sdk-trace-node'; // const provider = new NodeTracerProvider(); // provider.register(); // Then use with TracingManager: const exporter = await createOTelExporter('my-agent', '1.0.0'); const tracingManager = new TracingManager({ serviceName: 'my-agent', otelExporter: exporter, }); ``` *** ### createOTelHooks() ```ts function createOTelHooks(config?): HooksConfig; ``` Defined in: [tracing/otel-hooks.ts:95](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/otel-hooks.ts#L95) Create native OpenTelemetry hooks for agent instrumentation. These hooks create real OTel spans during execution, as opposed to the post-hoc `createOTelExporter()` which recreates spans after the fact. Span hierarchy: ``` agent.iteration [INTERNAL] ├── gen_ai.chat [CLIENT] (gen_ai.system, tokens, model) ├── agent.tool.read_file [INTERNAL] (tool.name, success, duration) └── agent.tool.bash [INTERNAL] ``` #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `config` | [`OTelHooksConfig`](#otelhooksconfig) | Optional configuration | #### Returns [`HooksConfig`](#hooksconfig) HooksConfig ready to pass to Agent constructor *** ### createPerplexityProvider() ```ts function createPerplexityProvider(config?): PerplexityProvider; ``` Defined in: [providers/perplexity.ts:180](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/perplexity.ts#L180) Create a Perplexity provider instance #### Parameters | Parameter | Type | | ------ | ------ | | `config` | [`PerplexityProviderConfig`](#perplexityproviderconfig) | #### Returns [`PerplexityProvider`](#perplexityprovider) #### Example ```typescript // Using environment variable (PERPLEXITY_API_KEY) const provider = createPerplexityProvider(); // With explicit API key const provider = createPerplexityProvider({ apiKey: 'pplx-...' }); // With custom model (sonar models have web search) const provider = createPerplexityProvider({ model: 'llama-3.1-sonar-large-128k-online' }); ``` *** ### createProjectMemoryLoader() ```ts function createProjectMemoryLoader(options?): ProjectMemoryLoader; ``` Defined in: [memory/loader.ts:494](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/loader.ts#L494) Create a ProjectMemoryLoader with default options #### Parameters | Parameter | Type | | ------ | ------ | | `options?` | [`ProjectMemoryOptions`](#projectmemoryoptions) | #### Returns [`ProjectMemoryLoader`](#projectmemoryloader) *** ### createRateLimiter() ```ts function createRateLimiter(config?): RateLimiter; ``` Defined in: [rate-limit/limiter.ts:368](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/limiter.ts#L368) Create a rate limiter with the given configuration #### Parameters | Parameter | Type | | ------ | ------ | | `config?` | [`RateLimiterConfig`](#ratelimiterconfig) | #### Returns [`RateLimiter`](#ratelimiter) *** ### createReadFileTool() ```ts function createReadFileTool(options?): Tool; ``` Defined in: [tools/builtin/read-file.ts:193](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/read-file.ts#L193) Factory function to create a read_file tool with custom options #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `options?` | \{ `allowedExtensions?`: `string`[]; `baseDir?`: `string`; `maxContentSize?`: `number`; `maxFileSize?`: `number`; `truncateIfLarge?`: `boolean`; \} | - | | `options.allowedExtensions?` | `string`[] | List of allowed file extensions (e.g., ['.ts', '.js', '.json']) | | `options.baseDir?` | `string` | Base directory to resolve relative paths against | | `options.maxContentSize?` | `number` | Maximum content size returned to agent in bytes (default: 100KB). Content larger than this is truncated. | | `options.maxFileSize?` | `number` | Maximum file size to read in bytes (default: 10MB). Files larger than this are rejected entirely. | | `options.truncateIfLarge?` | `boolean` | Whether to truncate large content (true) or reject (false). Default: true | #### Returns [`Tool`](#tool)\<[`ReadFileInput`](#readfileinput)\> *** ### createRecallResultTool() ```ts function createRecallResultTool(options): Tool; ``` Defined in: [tools/builtin/recall-result.ts:35](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/recall-result.ts#L35) Create a recall_full_result tool that retrieves delegated results from the store. #### Parameters | Parameter | Type | | ------ | ------ | | `options` | [`RecallResultToolOptions`](#recallresulttooloptions) | #### Returns [`Tool`](#tool)\<[`RecallResultInput`](#recallresultinput)\> *** ### createRehearsalManager() ```ts function createRehearsalManager(options?): RehearsalManager; ``` Defined in: [rehearsal/manager.ts:333](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rehearsal/manager.ts#L333) Create a RehearsalManager with default configuration #### Parameters | Parameter | Type | | ------ | ------ | | `options?` | [`RehearsalManagerOptions`](#rehearsalmanageroptions) | #### Returns [`RehearsalManager`](#rehearsalmanager) *** ### createRetryWithRateLimit() ```ts function createRetryWithRateLimit(rateLimiter, config?): (fn, estimatedTokens?) => Promise; ``` Defined in: [rate-limit/retry.ts:199](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/retry.ts#L199) Create a retry wrapper that also integrates with rate limiting #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `rateLimiter` | [`RateLimiter`](#ratelimiter) | Rate limiter instance | | `config` | [`RetryConfig`](#retryconfig) | Retry configuration | #### Returns Function wrapper with retry and rate limiting \<`T`\>(`fn`, `estimatedTokens?`) => `Promise`\<`T`\> #### Example ```typescript const limiter = createRateLimiter({ requestsPerMinute: 60 }); const retryWithLimit = createRetryWithRateLimit(limiter, { maxRetries: 3 }); const result = await retryWithLimit( () => provider.chat(messages, options), 1000 // estimated tokens ); ``` *** ### createSDKNotInstalledError() ```ts function createSDKNotInstalledError(): MCPError; ``` Defined in: [mcp/errors.ts:83](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/errors.ts#L83) Create an SDK not installed error with helpful message #### Returns [`MCPError`](#mcperror) *** ### createSkillRegistry() ```ts function createSkillRegistry(): SkillRegistry; ``` Defined in: [skills/index.ts:269](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/skills/index.ts#L269) Create a new skill registry #### Returns [`SkillRegistry`](#skillregistry) *** ### createStructuredLogger() ```ts function createStructuredLogger(options?): StructuredLogger; ``` Defined in: [tracing/logging.ts:45](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/logging.ts#L45) Create a structured logger #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `options` | [`StructuredLoggerOptions`](#structuredloggeroptions) | Logger options | #### Returns [`StructuredLogger`](#structuredlogger) StructuredLogger instance #### Example ```typescript const logger = createStructuredLogger({ level: 'info', serviceName: 'my-agent', prettyPrint: process.env.NODE_ENV !== 'production', }); logger.info('Agent started', { version: '1.0.0' }); logger.error('Tool failed', new Error('timeout'), { toolName: 'bash' }); // Create child logger with context const sessionLogger = logger.child({ sessionId: 'abc123' }); sessionLogger.info('Processing request'); // includes sessionId ``` *** ### createSuccessResult() ```ts function createSuccessResult(result): ToolExecutionResult; ``` Defined in: [tools/define.ts:102](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/define.ts#L102) Create a simple tool that returns success with a result #### Parameters | Parameter | Type | | ------ | ------ | | `result` | `unknown` | #### Returns [`ToolExecutionResult`](#toolexecutionresult) *** ### createSuggestTool() ```ts function createSuggestTool(options?): Tool; ``` Defined in: [tools/builtin/suggest.ts:91](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/suggest.ts#L91) Create a suggest tool with event emission #### Parameters | Parameter | Type | | ------ | ------ | | `options` | [`SuggestToolOptions`](#suggesttooloptions) | #### Returns [`Tool`](#tool)\<[`SuggestInput`](#suggestinput)\> #### Example ```typescript const suggestTool = createSuggestTool({ onSuggest: (event) => { // Handle the suggestion (e.g., pass to CLI input prompt) console.log('Suggested action:', event.action); } }); agent.registerTool(suggestTool); ``` *** ### createTaskTool() ```ts function createTaskTool(options): Tool; ``` Defined in: [tools/builtin/task.ts:296](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/task.ts#L296) Create a task tool for LLM-controlled sub-agent spawning #### Parameters | Parameter | Type | | ------ | ------ | | `options` | [`TaskToolOptions`](#tasktooloptions) | #### Returns [`Tool`](#tool)\<[`TaskInput`](#taskinput)\> *** ### createTodoTools() ```ts function createTodoTools(store?): { store: TodoStore; todoClaim: Tool; todoHandoff: Tool; todoRead: Tool; todoWrite: Tool; }; ``` Defined in: [tools/builtin/todo.ts:466](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/todo.ts#L466) Factory to create todo tools with a custom store #### Parameters | Parameter | Type | | ------ | ------ | | `store?` | [`TodoStore`](#todostore) | #### Returns ```ts { store: TodoStore; todoClaim: Tool; todoHandoff: Tool; todoRead: Tool; todoWrite: Tool; } ``` | Name | Type | Defined in | | ------ | ------ | ------ | | `store` | [`TodoStore`](#todostore) | [tools/builtin/todo.ts:471](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/todo.ts#L471) | | `todoClaim` | [`Tool`](#tool)\<`TodoClaimInput`\> | [tools/builtin/todo.ts:469](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/todo.ts#L469) | | `todoHandoff` | [`Tool`](#tool)\<`TodoHandoffInput`\> | [tools/builtin/todo.ts:470](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/todo.ts#L470) | | `todoRead` | [`Tool`](#tool)\<[`TodoReadInput`](#todoreadinput)\> | [tools/builtin/todo.ts:468](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/todo.ts#L468) | | `todoWrite` | [`Tool`](#tool)\<[`TodoWriteInput`](#todowriteinput)\> | [tools/builtin/todo.ts:467](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/todo.ts#L467) | *** ### createTogetherProvider() ```ts function createTogetherProvider(config?): TogetherProvider; ``` Defined in: [providers/together.ts:180](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/providers/together.ts#L180) Create a Together AI provider instance #### Parameters | Parameter | Type | | ------ | ------ | | `config` | [`TogetherProviderConfig`](#togetherproviderconfig) | #### Returns [`TogetherProvider`](#togetherprovider) #### Example ```typescript // Using environment variable (TOGETHER_API_KEY) const provider = createTogetherProvider(); // With explicit API key const provider = createTogetherProvider({ apiKey: 'xxx-...' }); // With custom model const provider = createTogetherProvider({ model: 'meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo' }); ``` *** ### createToolRegistry() ```ts function createToolRegistry(tools?, options?): DefaultToolRegistry; ``` Defined in: [tools/registry.ts:250](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/registry.ts#L250) Create a new ToolRegistry with optional initial tools and options #### Parameters | Parameter | Type | | ------ | ------ | | `tools?` | [`Tool`](#tool)\<`object`\>[] | | `options?` | [`ToolRegistryOptions`](#toolregistryoptions) | #### Returns [`DefaultToolRegistry`](#defaulttoolregistry) *** ### createTracingHooks() ```ts function createTracingHooks(manager, config?): HooksConfig; ``` Defined in: [tracing/hooks.ts:62](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/hooks.ts#L62) Create tracing hooks that automatically instrument agent execution #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `manager` | [`TracingManager`](#tracingmanager) | TracingManager instance | | `config` | [`TracingHooksConfig`](#tracinghooksconfig) | Tracing hooks configuration | #### Returns [`HooksConfig`](#hooksconfig) HooksConfig with tracing hooks #### Example ```typescript const tracingManager = new TracingManager({ serviceName: 'my-agent' }); const tracingHooks = createTracingHooks(tracingManager, { traceLLM: true, traceTools: true, traceIterations: true, }); const agent = new Agent({ provider, hooks: tracingHooks, }); ``` *** ### createTracingLogger() ```ts function createTracingLogger(tracingManager, options?): StructuredLogger; ``` Defined in: [tracing/logging.ts:324](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/logging.ts#L324) Create a logger that integrates with TracingManager #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `tracingManager` | \{ `getCurrentSpan`: () => \| \{ `spanId`: `string`; `traceId`: `string`; \} \| `undefined`; \} | TracingManager instance | | `tracingManager.getCurrentSpan` | () => \| \{ `spanId`: `string`; `traceId`: `string`; \} \| `undefined` | - | | `options` | [`StructuredLoggerOptions`](#structuredloggeroptions) | Logger options | #### Returns [`StructuredLogger`](#structuredlogger) StructuredLogger that auto-correlates with traces #### Example ```typescript const tracingManager = new TracingManager({ serviceName: 'my-agent' }); const logger = createTracingLogger(tracingManager); // Logger automatically includes current trace/span IDs logger.info('Processing request'); ``` *** ### createUsageTracker() ```ts function createUsageTracker(options?): UsageTracker; ``` Defined in: [costs/tracker.ts:353](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/costs/tracker.ts#L353) Create a UsageTracker instance #### Parameters | Parameter | Type | | ------ | ------ | | `options?` | [`UsageTrackerOptions`](#usagetrackeroptions) | #### Returns [`UsageTracker`](#usagetracker) *** ### createWebFetchTool() ```ts function createWebFetchTool(options?): Tool; ``` Defined in: [tools/builtin/web-fetch.ts:298](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/web-fetch.ts#L298) Factory function to create a webFetch tool with custom options #### Parameters | Parameter | Type | | ------ | ------ | | `options?` | `WebFetchOptions` | #### Returns [`Tool`](#tool)\<`WebFetchInput`\> *** ### createWriteFileTool() ```ts function createWriteFileTool(options?): Tool; ``` Defined in: [tools/builtin/write-file.ts:126](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/write-file.ts#L126) Factory function to create a write_file tool with custom options #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `options?` | \{ `allowedExtensions?`: `string`[]; `baseDir?`: `string`; `blockedPaths?`: `string`[]; `maxContentSize?`: `number`; \} | - | | `options.allowedExtensions?` | `string`[] | List of allowed file extensions (e.g., ['.ts', '.js', '.json']) | | `options.baseDir?` | `string` | Base directory to resolve relative paths against | | `options.blockedPaths?` | `string`[] | Directories that cannot be written to | | `options.maxContentSize?` | `number` | Maximum content size in bytes (default: 10MB) | #### Returns [`Tool`](#tool)\<[`WriteFileInput`](#writefileinput)\> *** ### defineSkill() ```ts function defineSkill(options): Skill; ``` Defined in: [skills/index.ts:248](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/skills/index.ts#L248) Helper function to define a skill #### Parameters | Parameter | Type | | ------ | ------ | | `options` | \{ `description`: `string`; `enabled?`: `boolean`; `name`: `string`; `prompt`: `string`; `tags?`: `string`[]; `version?`: `string`; \} | | `options.description` | `string` | | `options.enabled?` | `boolean` | | `options.name` | `string` | | `options.prompt` | `string` | | `options.tags?` | `string`[] | | `options.version?` | `string` | #### Returns [`Skill`](#skill) *** ### defineTool() ```ts function defineTool(options): Tool; ``` Defined in: [tools/define.ts:82](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/define.ts#L82) Define a tool with type-safe input handling #### Type Parameters | Type Parameter | | ------ | | `T` *extends* `object` | #### Parameters | Parameter | Type | | ------ | ------ | | `options` | [`DefineToolOptions`](#definetooloptions)\<`T`\> | #### Returns [`Tool`](#tool)\<`T`\> #### Example ```typescript const readFile = defineTool({ name: 'read_file', description: 'Read the contents of a file', inputSchema: { type: 'object', properties: { path: { type: 'string', description: 'File path to read' }, }, required: ['path'], }, execute: async ({ path }) => { const content = await fs.readFile(path, 'utf-8'); return { success: true, result: content }; }, }); ``` *** ### detectFifoUsage() ```ts function detectFifoUsage(command): FifoDetectionResult; ``` Defined in: [tools/builtin/bash.ts:125](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/bash.ts#L125) Detect potential FIFO/named pipe usage in a command Commands that read from FIFOs can hang indefinitely if no writer is available #### Parameters | Parameter | Type | | ------ | ------ | | `command` | `string` | #### Returns [`FifoDetectionResult`](#fifodetectionresult) *** ### detectInjection() ```ts function detectInjection( content, source?, patterns?): InjectionDetectionResult; ``` Defined in: [guardrails/injection-detection.ts:199](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/injection-detection.ts#L199) Scan text content for prompt injection patterns. #### Parameters | Parameter | Type | Default value | Description | | ------ | ------ | ------ | ------ | | `content` | `string` | `undefined` | Text to scan | | `source?` | `string` | `undefined` | Optional label for where the content came from (e.g., "file: README.md") | | `patterns?` | [`InjectionPattern`](#injectionpattern)[] | `INJECTION_PATTERNS` | Optional custom patterns (defaults to INJECTION_PATTERNS) | #### Returns [`InjectionDetectionResult`](#injectiondetectionresult) Detection result with all matches *** ### detectInjectionMultiple() ```ts function detectInjectionMultiple(sources): InjectionDetectionResult; ``` Defined in: [guardrails/injection-detection.ts:243](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/injection-detection.ts#L243) Scan multiple content sources and aggregate results. #### Parameters | Parameter | Type | | ------ | ------ | | `sources` | \{ `content`: `string`; `label`: `string`; \}[] | #### Returns [`InjectionDetectionResult`](#injectiondetectionresult) *** ### ensureMessageContent() ```ts function ensureMessageContent(message): Message; ``` Defined in: [messages/index.ts:180](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/messages/index.ts#L180) Ensure a message has content field (even if empty). Some APIs (like xAI) require content to be present even when tool_calls exist. This function handles messages from external sources that might not strictly conform to our Message type (e.g., API responses with missing content). #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `message` | \| [`Message`](#message-4) \| \{ `content?`: `string` \| [`ContentBlock`](#contentblock)[] \| `null`; `role`: `string`; \} | Message to normalize (may have missing content from external APIs) | #### Returns [`Message`](#message-4) Message with guaranteed content field *** ### estimateEffort() ```ts function estimateEffort(signals, weights?): Effort; ``` Defined in: [episodes/effort.ts:68](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/episodes/effort.ts#L68) Estimate effort level from raw signals. Score formula: fileCount * fileCountMultiplier + min(linesChanged / linesPerPoint, 10) + toolCallCount * toolCallWeight + (durationMs / 60000) / minutesPerPoint + complexity bonuses: newFiles(+5), multiLang(+3), tests(+5), config(+2) Thresholds: < 5 = trivial, < 15 = low, < 40 = medium, < 100 = high, else = significant #### Parameters | Parameter | Type | | ------ | ------ | | `signals` | [`EffortSignals`](#effortsignals) | | `weights?` | `Partial`\<[`EffortWeights`](#effortweights)\> | #### Returns [`Effort`](#effort-1) *** ### execStream() ```ts function execStream(command, options?): { promise: Promise; stderr: AsyncIterable; stdout: AsyncIterable; }; ``` Defined in: [tools/builtin/bash.ts:857](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/bash.ts#L857) Execute a command with streaming output (for long-running commands) Note: This is a lower-level function for cases where you need to stream output as it arrives. #### Parameters | Parameter | Type | | ------ | ------ | | `command` | `string` | | `options?` | \{ `cwd?`: `string`; `env?`: `Record`\<`string`, `string`\>; `shell?`: `string`; \} | | `options.cwd?` | `string` | | `options.env?` | `Record`\<`string`, `string`\> | | `options.shell?` | `string` | #### Returns ```ts { promise: Promise; stderr: AsyncIterable; stdout: AsyncIterable; } ``` | Name | Type | Defined in | | ------ | ------ | ------ | | `promise` | `Promise`\<`number`\> | [tools/builtin/bash.ts:867](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/bash.ts#L867) | | `stderr` | `AsyncIterable`\<`string`\> | [tools/builtin/bash.ts:866](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/bash.ts#L866) | | `stdout` | `AsyncIterable`\<`string`\> | [tools/builtin/bash.ts:865](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/bash.ts#L865) | *** ### extractInputSummary() ```ts function extractInputSummary(toolName, input): string; ``` Defined in: [context/observation-masker.ts:341](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/observation-masker.ts#L341) Extract a short summary from tool input for the mask text. #### Parameters | Parameter | Type | | ------ | ------ | | `toolName` | `string` | | `input` | `Record`\<`string`, `unknown`\> | #### Returns `string` *** ### formatBytes() ```ts function formatBytes(bytes): string; ``` Defined in: [tracing/logging.ts:276](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/logging.ts#L276) Format bytes in human-readable format #### Parameters | Parameter | Type | | ------ | ------ | | `bytes` | `number` | #### Returns `string` *** ### formatDuration() ```ts function formatDuration(ms): string; ``` Defined in: [tracing/logging.ts:265](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/logging.ts#L265) Format duration in human-readable format #### Parameters | Parameter | Type | | ------ | ------ | | `ms` | `number` | #### Returns `string` *** ### generateId() ```ts function generateId(): string; ``` Defined in: [utils/index.ts:11](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/utils/index.ts#L11) Generate a unique ID for tool uses #### Returns `string` *** ### generateToolName() ```ts function generateToolName( serverName, toolName, options?): string; ``` Defined in: [mcp/tools.ts:71](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/tools.ts#L71) Generate a unique tool name for an MCP tool #### Parameters | Parameter | Type | | ------ | ------ | | `serverName` | `string` | | `toolName` | `string` | | `options` | [`MCPToolConversionOptions`](#mcptoolconversionoptions) | #### Returns `string` *** ### getBuiltinAnchorIds() ```ts function getBuiltinAnchorIds(): string[]; ``` Defined in: [anchors/builtin.ts:68](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/builtin.ts#L68) Get built-in anchor IDs #### Returns `string`[] *** ### getBuiltinGuardrailIds() ```ts function getBuiltinGuardrailIds(): string[]; ``` Defined in: [guardrails/builtin.ts:226](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/builtin.ts#L226) Get built-in guardrail IDs #### Returns `string`[] *** ### getBuiltinGuardrails() ```ts function getBuiltinGuardrails(): Guardrail[]; ``` Defined in: [guardrails/builtin.ts:207](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/builtin.ts#L207) Get a copy of the built-in guardrails #### Returns [`Guardrail`](#guardrail)[] *** ### getDefaultAnchors() ```ts function getDefaultAnchors(): Anchor[]; ``` Defined in: [anchors/builtin.ts:50](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/builtin.ts#L50) Get a copy of the default safety anchors Clones the anchors to prevent mutation #### Returns [`Anchor`](#anchor)[] *** ### getDefaultShellManager() ```ts function getDefaultShellManager(): ShellManager; ``` Defined in: [tools/builtin/shell-manager.ts:566](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/shell-manager.ts#L566) Get or create the default shell manager #### Returns [`ShellManager`](#shellmanager) *** ### getDefaultSkillRegistry() ```ts function getDefaultSkillRegistry(): SkillRegistry; ``` Defined in: [skills/index.ts:1325](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/skills/index.ts#L1325) Get the default skill registry #### Returns [`SkillRegistry`](#skillregistry) *** ### getDefaultTodoStore() ```ts function getDefaultTodoStore(): TodoStore; ``` Defined in: [tools/builtin/todo.ts:706](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/todo.ts#L706) Get the default store (useful for testing or direct access) #### Returns [`TodoStore`](#todostore) *** ### getGenericPatterns() ```ts function getGenericPatterns(): FilePattern[]; ``` Defined in: [memory/loader.ts:539](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/loader.ts#L539) Get generic patterns #### Returns [`FilePattern`](#filepattern)[] *** ### getGuardrailsByTag() ```ts function getGuardrailsByTag(tag): Guardrail[]; ``` Defined in: [guardrails/builtin.ts:233](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/builtin.ts#L233) Get guardrails by tag #### Parameters | Parameter | Type | | ------ | ------ | | `tag` | `string` | #### Returns [`Guardrail`](#guardrail)[] *** ### getProviderPatterns() ```ts function getProviderPatterns(provider): FilePattern[]; ``` Defined in: [memory/loader.ts:524](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/loader.ts#L524) Get built-in patterns for a provider #### Parameters | Parameter | Type | | ------ | ------ | | `provider` | `string` | #### Returns [`FilePattern`](#filepattern)[] *** ### getSupportedProviders() ```ts function getSupportedProviders(): string[]; ``` Defined in: [memory/loader.ts:532](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/loader.ts#L532) Get all supported provider names #### Returns `string`[] *** ### getTextContent() ```ts function getTextContent(message): string; ``` Defined in: [messages/index.ts:66](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/messages/index.ts#L66) Extract text content from a message #### Parameters | Parameter | Type | | ------ | ------ | | `message` | [`Message`](#message-4) | #### Returns `string` *** ### getTodoContextStats() ```ts function getTodoContextStats(messages): { estimatedTokensSaved: number; todoReadCalls: number; todoWriteCalls: number; }; ``` Defined in: [tools/builtin/todo.ts:841](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/todo.ts#L841) Get statistics about todo tool usage in messages #### Parameters | Parameter | Type | | ------ | ------ | | `messages` | \{ `content`: `unknown`; `role`: `string`; \}[] | #### Returns ```ts { estimatedTokensSaved: number; todoReadCalls: number; todoWriteCalls: number; } ``` | Name | Type | Defined in | | ------ | ------ | ------ | | `estimatedTokensSaved` | `number` | [tools/builtin/todo.ts:844](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/todo.ts#L844) | | `todoReadCalls` | `number` | [tools/builtin/todo.ts:843](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/todo.ts#L843) | | `todoWriteCalls` | `number` | [tools/builtin/todo.ts:842](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/todo.ts#L842) | *** ### getToolResults() ```ts function getToolResults(message): ToolResultBlock[]; ``` Defined in: [messages/index.ts:96](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/messages/index.ts#L96) Extract tool results from a message #### Parameters | Parameter | Type | | ------ | ------ | | `message` | [`Message`](#message-4) | #### Returns [`ToolResultBlock`](#toolresultblock)[] *** ### getToolUses() ```ts function getToolUses(message): ToolUseBlock[]; ``` Defined in: [messages/index.ts:79](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/messages/index.ts#L79) Extract tool uses from a message #### Parameters | Parameter | Type | | ------ | ------ | | `message` | [`Message`](#message-4) | #### Returns [`ToolUseBlock`](#tooluseblock)[] *** ### hasProjectMemory() ```ts function hasProjectMemory(rootDir, options?): Promise; ``` Defined in: [memory/loader.ts:512](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/loader.ts#L512) Quick utility to check if a directory has project memory files #### Parameters | Parameter | Type | | ------ | ------ | | `rootDir` | `string` | | `options?` | [`ProjectMemoryOptions`](#projectmemoryoptions) | #### Returns `Promise`\<`boolean`\> *** ### hasToolUses() ```ts function hasToolUses(message): boolean; ``` Defined in: [messages/index.ts:89](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/messages/index.ts#L89) Check if a message contains tool uses #### Parameters | Parameter | Type | | ------ | ------ | | `message` | [`Message`](#message-4) | #### Returns `boolean` *** ### isAgentError() ```ts function isAgentError(error): error is AgentError; ``` Defined in: [errors.ts:279](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L279) Type guard to check if an error is an AgentError #### Parameters | Parameter | Type | | ------ | ------ | | `error` | `unknown` | #### Returns `error is AgentError` *** ### isBuiltinAnchor() ```ts function isBuiltinAnchor(anchor): boolean; ``` Defined in: [anchors/builtin.ts:61](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/anchors/builtin.ts#L61) Check if an anchor is a built-in default #### Parameters | Parameter | Type | | ------ | ------ | | `anchor` | [`Anchor`](#anchor) | #### Returns `boolean` *** ### isBuiltinGuardrail() ```ts function isBuiltinGuardrail(guardrail): boolean; ``` Defined in: [guardrails/builtin.ts:219](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/guardrails/builtin.ts#L219) Check if a guardrail is a built-in default #### Parameters | Parameter | Type | | ------ | ------ | | `guardrail` | [`Guardrail`](#guardrail) | #### Returns `boolean` *** ### isContextOverflowError() ```ts function isContextOverflowError(error): error is ContextOverflowError; ``` Defined in: [errors.ts:272](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L272) Type guard to check if an error is a ContextOverflowError #### Parameters | Parameter | Type | | ------ | ------ | | `error` | `unknown` | #### Returns `error is ContextOverflowError` *** ### isMasked() ```ts function isMasked(content): boolean; ``` Defined in: [context/observation-masker.ts:420](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/observation-masker.ts#L420) Check if a tool result content string is already masked. #### Parameters | Parameter | Type | | ------ | ------ | | `content` | `string` | #### Returns `boolean` *** ### isMCPError() ```ts function isMCPError(error): error is MCPError; ``` Defined in: [mcp/errors.ts:76](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/errors.ts#L76) Type guard to check if an error is an MCPError #### Parameters | Parameter | Type | | ------ | ------ | | `error` | `unknown` | #### Returns `error is MCPError` *** ### isOTelNotInstalledError() ```ts function isOTelNotInstalledError(error): error is OTelNotInstalledError; ``` Defined in: [tracing/otel.ts:35](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/otel.ts#L35) Check if a value is an OTelNotInstalledError #### Parameters | Parameter | Type | | ------ | ------ | | `error` | `unknown` | #### Returns `error is OTelNotInstalledError` *** ### isProviderError() ```ts function isProviderError(error): error is ProviderError; ``` Defined in: [errors.ts:286](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L286) Type guard to check if an error is a ProviderError #### Parameters | Parameter | Type | | ------ | ------ | | `error` | `unknown` | #### Returns `error is ProviderError` *** ### isPruned() ```ts function isPruned(content): boolean; ``` Defined in: [context/dead-message-pruner.ts:75](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/dead-message-pruner.ts#L75) Check if a tool result content string has been pruned. #### Parameters | Parameter | Type | | ------ | ------ | | `content` | `string` | #### Returns `boolean` *** ### isRateLimitExceededError() ```ts function isRateLimitExceededError(error): error is RateLimitExceededError; ``` Defined in: [rate-limit/types.ts:217](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/types.ts#L217) Check if an error is a RateLimitExceededError #### Parameters | Parameter | Type | | ------ | ------ | | `error` | `unknown` | #### Returns `error is RateLimitExceededError` *** ### isToolError() ```ts function isToolError(error): error is ToolError; ``` Defined in: [errors.ts:293](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L293) Type guard to check if an error is a ToolError #### Parameters | Parameter | Type | | ------ | ------ | | `error` | `unknown` | #### Returns `error is ToolError` *** ### isToolLoopError() ```ts function isToolLoopError(error): error is ToolLoopError; ``` Defined in: [errors.ts:300](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L300) Type guard to check if an error is a ToolLoopError #### Parameters | Parameter | Type | | ------ | ------ | | `error` | `unknown` | #### Returns `error is ToolLoopError` *** ### isToolTimeoutError() ```ts function isToolTimeoutError(error): error is ToolTimeoutError; ``` Defined in: [errors.ts:307](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L307) Type guard to check if an error is a ToolTimeoutError #### Parameters | Parameter | Type | | ------ | ------ | | `error` | `unknown` | #### Returns `error is ToolTimeoutError` *** ### loadProjectMemory() ```ts function loadProjectMemory(rootDir, options?): Promise; ``` Defined in: [memory/loader.ts:501](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/memory/loader.ts#L501) Quick utility to load project memory #### Parameters | Parameter | Type | | ------ | ------ | | `rootDir` | `string` | | `options?` | [`ProjectMemoryOptions`](#projectmemoryoptions) | #### Returns `Promise`\<[`ProjectMemory`](#projectmemory-1)\> *** ### maskImageBlock() ```ts function maskImageBlock(block, turn): TextBlock; ``` Defined in: [context/observation-masker.ts:428](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/context/observation-masker.ts#L428) Replace an image content block with a text placeholder. Preserves filename and dimensions for context. #### Parameters | Parameter | Type | | ------ | ------ | | `block` | `ImageBlock` | | `turn` | `number` | #### Returns [`TextBlock`](#textblock) *** ### mcpToolsToTools() ```ts function mcpToolsToTools( mcpTools, client, options?): Tool[]; ``` Defined in: [mcp/tools.ts:129](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/tools.ts#L129) Convert multiple MCP tools to our Tool format #### Parameters | Parameter | Type | | ------ | ------ | | `mcpTools` | [`MCPToolDefinition`](#mcptooldefinition)[] | | `client` | [`MCPClient`](#mcpclient) | | `options` | [`MCPToolConversionOptions`](#mcptoolconversionoptions) | #### Returns [`Tool`](#tool)\<`object`\>[] *** ### mcpToolToTool() ```ts function mcpToolToTool( mcpTool, client, options?): Tool; ``` Defined in: [mcp/tools.ts:100](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/tools.ts#L100) Convert a single MCP tool to our Tool format #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `mcpTool` | [`MCPToolDefinition`](#mcptooldefinition) | The MCP tool definition from the server | | `client` | [`MCPClient`](#mcpclient) | The MCP client to use for calling the tool | | `options` | [`MCPToolConversionOptions`](#mcptoolconversionoptions) | Conversion options | #### Returns [`Tool`](#tool) A Tool that can be registered with the agent #### Example ```typescript const tools = await client.listTools(); const convertedTools = tools.map(t => mcpToolToTool(t, client)); agent.toolRegistry.registerTools(convertedTools); ``` *** ### mergeHooks() ```ts function mergeHooks(...configs): HooksConfig; ``` Defined in: [tracing/hooks.ts:430](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/hooks.ts#L430) Merge multiple HooksConfig objects #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | ...`configs` | [`HooksConfig`](#hooksconfig)[] | HooksConfig objects to merge | #### Returns [`HooksConfig`](#hooksconfig) Merged HooksConfig #### Example ```typescript const hooks = mergeHooks(tracingHooks, loggingHooks, customHooks); const agent = new Agent({ provider, hooks }); ``` *** ### normalizeMessages() ```ts function normalizeMessages(messages): Message[]; ``` Defined in: [messages/index.ts:197](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/messages/index.ts#L197) Normalize all messages to ensure content fields are present. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `messages` | [`Message`](#message-4)[] | Array of messages to normalize | #### Returns [`Message`](#message-4)[] Normalized messages *** ### normalizeServerConfig() ```ts function normalizeServerConfig(config): MCPClientConfig; ``` Defined in: [mcp/types.ts:169](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/mcp/types.ts#L169) Convert shorthand MCPServerConfig to full MCPClientConfig #### Parameters | Parameter | Type | | ------ | ------ | | `config` | [`MCPServerConfig`](#mcpserverconfig) | #### Returns [`MCPClientConfig`](#mcpclientconfig) *** ### redactSensitive() ```ts function redactSensitive(data, sensitiveKeys?): Record; ``` Defined in: [tracing/logging.ts:286](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tracing/logging.ts#L286) Redact sensitive data from an object #### Parameters | Parameter | Type | | ------ | ------ | | `data` | `Record`\<`string`, `unknown`\> | | `sensitiveKeys` | `string`[] | #### Returns `Record`\<`string`, `unknown`\> *** ### repairToolPairing() ```ts function repairToolPairing(messages): Message[]; ``` Defined in: [messages/index.ts:220](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/messages/index.ts#L220) Repair tool use/result pairing issues in a message array. This function handles BOTH types of orphans with POSITIONAL requirements: 1. Orphaned tool_result blocks (those without a matching tool_use BEFORE them) - Causes: "function_response.name: Name cannot be empty" in Gemini 2. Orphaned tool_use blocks (those without tool_result in IMMEDIATELY NEXT message) - Causes: "tool_use ids were found without tool_result blocks" in Claude CRITICAL: Claude API requires tool_result to be in the IMMEDIATELY NEXT message after the assistant message containing tool_use. This function validates that positional requirement, not just existence anywhere in the array. This is particularly useful after context compaction/summarization, which may remove messages and break tool_use/tool_result pairing. #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `messages` | [`Message`](#message-4)[] | Array of messages to repair | #### Returns [`Message`](#message-4)[] New array with orphaned tool_use and tool_result blocks removed *** ### resetDefaultSkillRegistry() ```ts function resetDefaultSkillRegistry(): void; ``` Defined in: [skills/index.ts:1332](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/skills/index.ts#L1332) Reset the default registry to built-in skills only #### Returns `void` *** ### resetDefaultTodoStore() ```ts function resetDefaultTodoStore(): void; ``` Defined in: [tools/builtin/todo.ts:699](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/todo.ts#L699) Reset the default store (useful for testing) #### Returns `void` *** ### ~~retry()~~ ```ts function retry(fn, options?): Promise; ``` Defined in: [utils/index.ts:307](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/utils/index.ts#L307) #### Type Parameters | Type Parameter | | ------ | | `T` | #### Parameters | Parameter | Type | | ------ | ------ | | `fn` | () => `Promise`\<`T`\> | | `options` | \{ `baseDelay?`: `number`; `maxDelay?`: `number`; `maxRetries?`: `number`; \} | | `options.baseDelay?` | `number` | | `options.maxDelay?` | `number` | | `options.maxRetries?` | `number` | #### Returns `Promise`\<`T`\> #### Deprecated Use withRetry instead. This function is kept for backward compatibility. *** ### setDefaultShellManager() ```ts function setDefaultShellManager(manager): void; ``` Defined in: [tools/builtin/shell-manager.ts:576](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/builtin/shell-manager.ts#L576) Set a custom default shell manager #### Parameters | Parameter | Type | | ------ | ------ | | `manager` | [`ShellManager`](#shellmanager) | #### Returns `void` *** ### sleep() ```ts function sleep(ms, signal?): Promise; ``` Defined in: [utils/index.ts:22](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/utils/index.ts#L22) Sleep for a specified duration, respecting AbortSignal #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `ms` | `number` | Duration in milliseconds | | `signal?` | `AbortSignal` | Optional AbortSignal to cancel sleep | #### Returns `Promise`\<`void`\> #### Throws Error if signal is aborted *** ### systemMessage() ```ts function systemMessage(content): Message; ``` Defined in: [messages/index.ts:30](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/messages/index.ts#L30) Create a system message #### Parameters | Parameter | Type | | ------ | ------ | | `content` | `string` | #### Returns [`Message`](#message-4) *** ### textBlock() ```ts function textBlock(text): TextBlock; ``` Defined in: [messages/index.ts:37](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/messages/index.ts#L37) Create a text content block #### Parameters | Parameter | Type | | ------ | ------ | | `text` | `string` | #### Returns [`TextBlock`](#textblock) *** ### toolResultBlock() ```ts function toolResultBlock( toolUseId, content, isError?): ToolResultBlock; ``` Defined in: [messages/index.ts:55](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/messages/index.ts#L55) Create a tool result content block #### Parameters | Parameter | Type | Default value | | ------ | ------ | ------ | | `toolUseId` | `string` | `undefined` | | `content` | `string` | `undefined` | | `isError` | `boolean` | `false` | #### Returns [`ToolResultBlock`](#toolresultblock) *** ### toolUseBlock() ```ts function toolUseBlock( id, name, input): ToolUseBlock; ``` Defined in: [messages/index.ts:44](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/messages/index.ts#L44) Create a tool use content block #### Parameters | Parameter | Type | | ------ | ------ | | `id` | `string` | | `name` | `string` | | `input` | `Record`\<`string`, `unknown`\> | #### Returns [`ToolUseBlock`](#tooluseblock) *** ### truncate() ```ts function truncate( str, maxLength, suffix?): string; ``` Defined in: [utils/index.ts:326](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/utils/index.ts#L326) Truncate a string to a maximum length #### Parameters | Parameter | Type | Default value | | ------ | ------ | ------ | | `str` | `string` | `undefined` | | `maxLength` | `number` | `undefined` | | `suffix` | `string` | `'...'` | #### Returns `string` *** ### userMessage() ```ts function userMessage(content): Message; ``` Defined in: [messages/index.ts:16](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/messages/index.ts#L16) Create a user message #### Parameters | Parameter | Type | | ------ | ------ | | `content` | `string` | #### Returns [`Message`](#message-4) *** ### validateToolUseResultPairing() ```ts function validateToolUseResultPairing(messages): ToolPairingValidation; ``` Defined in: [messages/index.ts:120](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/messages/index.ts#L120) Validate that tool_result blocks have matching tool_use blocks. This prevents API errors like "Tool result block missing corresponding tool_use block" #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `messages` | [`Message`](#message-4)[] | Array of messages to validate | #### Returns [`ToolPairingValidation`](#toolpairingvalidation) Validation result with details about any mismatches *** ### withRetry() ```ts function withRetry(fn, config?): Promise; ``` Defined in: [rate-limit/retry.ts:140](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/retry.ts#L140) Retry a function with exponential backoff #### Type Parameters | Type Parameter | | ------ | | `T` | #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `fn` | () => `Promise`\<`T`\> | Function to retry | | `config` | [`RetryConfig`](#retryconfig) | Retry configuration | #### Returns `Promise`\<`T`\> Result of the function #### Example ```typescript const result = await withRetry( () => provider.chat(messages, options), { maxRetries: 3, baseDelayMs: 1000, onRetry: (attempt, error, delay) => { console.log(`Retry ${attempt} after ${delay}ms: ${error.message}`); }, } ); ``` *** ### withRetryGenerator() ```ts function withRetryGenerator(fn, options?): AsyncGenerator; ``` Defined in: [utils/index.ts:245](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/utils/index.ts#L245) Create a retryable async generator for streaming responses This is specifically designed for streaming LLM responses where we need to retry the entire stream if it fails partway through. #### Type Parameters | Type Parameter | Default type | | ------ | ------ | | `T` | - | | `E` *extends* `Error` | `Error` | #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `fn` | () => `AsyncIterable`\<`T`\> | Function that returns an async iterable | | `options` | [`WithRetryOptions`](#withretryoptions)\<`E`\> | Retry options | #### Returns `AsyncGenerator`\<`T`, `void`, `undefined`\> Async generator that retries on failure *** ### wrapError() ```ts function wrapError(error, message?): AgentError; ``` Defined in: [errors.ts:314](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/errors.ts#L314) Wrap an unknown error into an AgentError #### Parameters | Parameter | Type | | ------ | ------ | | `error` | `unknown` | | `message?` | `string` | #### Returns [`AgentError`](#agenterror) *** ### wrapToolExecute() ```ts function wrapToolExecute(fn): (input) => Promise; ``` Defined in: [tools/define.ts:119](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/tools/define.ts#L119) Wrap an async function to catch errors and return ToolExecutionResult #### Type Parameters | Type Parameter | | ------ | | `T` *extends* `object` | #### Parameters | Parameter | Type | | ------ | ------ | | `fn` | (`input`) => `Promise`\<`unknown`\> | #### Returns (`input`) => `Promise`\<[`ToolExecutionResult`](#toolexecutionresult)\> *** ### wrapWithRateLimit() ```ts function wrapWithRateLimit(provider, config?): RateLimitedProvider; ``` Defined in: [rate-limit/provider-wrapper.ts:162](https://github.com/scozzola/compilr-dev-agents/blob/1165e943e9e778673268c207af819ac0755d3ce1/src/rate-limit/provider-wrapper.ts#L162) Create a rate-limited provider wrapper #### Parameters | Parameter | Type | Description | | ------ | ------ | ------ | | `provider` | [`LLMProvider`](#llmprovider) | The base LLM provider | | `config?` | [`RateLimitRetryConfig`](#ratelimitretryconfig) | Rate limit and retry configuration | #### Returns [`RateLimitedProvider`](#ratelimitedprovider) Wrapped provider with rate limiting and retry #### Example ```typescript const provider = createClaudeProvider(); const rateLimited = wrapWithRateLimit(provider, { rateLimit: { requestsPerMinute: 60 }, retry: { maxRetries: 3 }, }); ``` ## References ### createGeminiNativeProvider Renames and re-exports [createGeminiProvider](#creategeminiprovider) *** ### GeminiNativeProvider Renames and re-exports [GeminiProvider](#geminiprovider) *** ### GeminiNativeProviderConfig Renames and re-exports [GeminiProviderConfig](#geminiproviderconfig)