diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index e665cfc..124c909 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -1,33 +1,36 @@ name: PR Checks on: - pull_request: - branches: [master, dev] + pull_request: + branches: [master, dev] jobs: - validate: - name: Type Check, Build & Audit - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: '20' - cache: 'npm' - - - name: Install dependencies - run: npm ci - - - name: Type check - run: npm run typecheck - - - name: Build - run: npm run build - - - name: Security audit - run: npm audit --audit-level=high - continue-on-error: false + validate: + name: Type Check, Build & Audit + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "20" + cache: "npm" + + - name: Install dependencies + run: npm ci + + - name: Format check + run: npm run format:check + + - name: Type check + run: npm run typecheck + + - name: Build + run: npm run build + + - name: Security audit + run: npm audit --audit-level=high + continue-on-error: false diff --git a/.gitignore b/.gitignore index c4c6365..9f567cb 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,7 @@ Thumbs.db tests/ notes/ test-update.ts + +# Documentation (local development only) +docs/ +SCHEMA_NOTES.md diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..3325b6e --- /dev/null +++ b/.prettierrc @@ -0,0 +1,10 @@ +{ + "semi": false, + "singleQuote": false, + "tabWidth": 4, + "useTabs": false, + "trailingComma": "all", + "printWidth": 100, + "bracketSpacing": true, + "arrowParens": "always" +} diff --git a/README.md b/README.md index 9bfd061..c5484b5 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Add to your OpenCode config: ```jsonc // opencode.jsonc { - "plugin": ["@tarquinen/opencode-dcp@latest"] + "plugin": ["@tarquinen/opencode-dcp@latest"], } ``` @@ -29,7 +29,9 @@ DCP uses multiple strategies to reduce context size: **Supersede Writes** — Prunes write tool inputs for files that have subsequently been read. When a file is written and later read, the original write content becomes redundant since the current file state is captured in the read result. Runs automatically on every request with zero LLM cost. -**Prune Tool** — Exposes a `prune` tool that the AI can call to manually trigger pruning when it determines context cleanup is needed. +**Discard Tool** — Exposes a `discard` tool that the AI can call to remove completed or noisy tool outputs from context. Use this for task completion cleanup and removing irrelevant outputs. + +**Extract Tool** — Exposes an `extract` tool that the AI can call to distill valuable context into concise summaries before removing the raw outputs. Use this when you need to preserve key findings while reducing context size. **On Idle Analysis** — Uses a language model to semantically analyze conversation context during idle periods and identify tool outputs that are no longer relevant. @@ -54,59 +56,82 @@ DCP uses its own config file: ```jsonc { - // Enable or disable the plugin - "enabled": true, - // Enable debug logging to ~/.config/opencode/logs/dcp/ - "debug": false, - // Summary display: "off", "minimal", or "detailed" - "pruningSummary": "detailed", - // Strategies for pruning tokens from chat history - "strategies": { - // Remove duplicate tool calls (same tool with same arguments) - "deduplication": { - "enabled": true, - // Additional tools to protect from pruning - "protectedTools": [] + // Enable or disable the plugin + "enabled": true, + // Enable debug logging to ~/.config/opencode/logs/dcp/ + "debug": false, + // Notification display: "off", "minimal", or "detailed" + "pruneNotification": "detailed", + // Protect from pruning for message turns + "turnProtection": { + "enabled": false, + "turns": 4, }, - // Prune write tool inputs when the file has been subsequently read - "supersedeWrites": { - "enabled": true + // LLM-driven context pruning tools + "tools": { + // Shared settings for all prune tools + "settings": { + // Nudge the LLM to use prune tools (every tool results) + "nudgeEnabled": true, + "nudgeFrequency": 10, + // Additional tools to protect from pruning + "protectedTools": [], + }, + // Removes tool content from context without preservation (for completed tasks or noise) + "discard": { + "enabled": true, + }, + // Distills key findings into preserved knowledge before removing raw content + "extract": { + "enabled": true, + // Show distillation content as an ignored message notification + "showDistillation": false, + }, }, - // Exposes a prune tool to your LLM to call when it determines pruning is necessary - "pruneTool": { - "enabled": true, - // Additional tools to protect from pruning - "protectedTools": [], - // Nudge the LLM to use the prune tool (every tool results) - "nudge": { - "enabled": true, - "frequency": 10 - } + // Automatic pruning strategies + "strategies": { + // Remove duplicate tool calls (same tool with same arguments) + "deduplication": { + "enabled": true, + // Additional tools to protect from pruning + "protectedTools": [], + }, + // Prune write tool inputs when the file has been subsequently read + "supersedeWrites": { + "enabled": true, + }, + // (Legacy) Run an LLM to analyze what tool calls are no longer relevant on idle + "onIdle": { + "enabled": false, + // Additional tools to protect from pruning + "protectedTools": [], + // Override model for analysis (format: "provider/model") + // "model": "anthropic/claude-haiku-4-5", + // Show toast notifications when model selection fails + "showModelErrorToasts": true, + // When true, fallback models are not permitted + "strictModelSelection": false, + }, }, - // (Legacy) Run an LLM to analyze what tool calls are no longer relevant on idle - "onIdle": { - "enabled": false, - // Additional tools to protect from pruning - "protectedTools": [], - // Override model for analysis (format: "provider/model") - // "model": "anthropic/claude-haiku-4-5", - // Show toast notifications when model selection fails - "showModelErrorToasts": true, - // When true, fallback models are not permitted - "strictModelSelection": false - } - } } ``` +### Turn Protection + +When enabled, turn protection prevents tool outputs from being pruned for a configurable number of message turns. This gives the AI time to reference recent tool outputs before they become prunable. Applies to both `discard` and `extract` tools, as well as automatic strategies. + ### Protected Tools By default, these tools are always protected from pruning across all strategies: -`task`, `todowrite`, `todoread`, `prune`, `batch` +`task`, `todowrite`, `todoread`, `discard`, `extract`, `batch` + +The `protectedTools` arrays in each section add to this default list: -The `protectedTools` arrays in each strategy add to this default list. +- `tools.settings.protectedTools` — Protects tools from the `discard` and `extract` tools +- `strategies.deduplication.protectedTools` — Protects tools from deduplication +- `strategies.onIdle.protectedTools` — Protects tools from on-idle analysis ### Config Precedence diff --git a/docs/providers/README.md b/docs/providers/README.md deleted file mode 100644 index 29af628..0000000 --- a/docs/providers/README.md +++ /dev/null @@ -1,339 +0,0 @@ -# Provider API Formats Reference - -This directory contains documentation for each AI provider's API format, designed to help the context pruning plugin implement provider-specific logic. - -## Sources - -All information in these docs was gathered from: - -### Primary Sources - -| Source | Location | Description | -|--------|----------|-------------| -| **Vercel AI SDK** | https://github.com/vercel/ai | Provider conversion logic in `packages/{provider}/src/` | -| **OpenCode Source** | `/packages/opencode/src/provider/` | Custom transforms and provider loading | -| **models.dev API** | https://models.dev/api.json | Authoritative provider list with npm packages | - -### Key AI SDK Files - -| Provider | Conversion File | -|----------|-----------------| -| OpenAI | `packages/openai/src/chat/openai-chat-language-model.ts`, `packages/openai/src/responses/openai-responses-language-model.ts` | -| OpenAI-Compatible | `packages/openai-compatible/src/chat/openai-compatible-chat-language-model.ts` | -| Anthropic | `packages/anthropic/src/convert-to-anthropic-messages-prompt.ts`, `packages/anthropic/src/anthropic-messages-language-model.ts` | -| Google | `packages/google/src/convert-to-google-generative-ai-messages.ts`, `packages/google/src/google-generative-ai-language-model.ts` | -| AWS Bedrock | `packages/amazon-bedrock/src/convert-to-bedrock-chat-messages.ts`, `packages/amazon-bedrock/src/bedrock-chat-language-model.ts` | -| Mistral | `packages/mistral/src/convert-to-mistral-chat-messages.ts`, `packages/mistral/src/mistral-chat-language-model.ts` | -| Cohere | `packages/cohere/src/convert-to-cohere-chat-prompt.ts`, `packages/cohere/src/cohere-chat-language-model.ts` | - -### OpenCode Custom Transform Files - -| File | Purpose | -|------|---------| -| `src/provider/transform.ts` | Provider-specific message normalization, caching hints, schema transforms | -| `src/provider/provider.ts` | Provider loading, custom loaders, SDK instantiation | -| `src/provider/models.ts` | Model database schema, models.dev integration | -| `src/session/message-v2.ts` | Internal message structure, `toModelMessage()` conversion | - -### Official API Documentation - -| Provider | Documentation URL | -|----------|-------------------| -| OpenAI | https://platform.openai.com/docs/api-reference | -| Anthropic | https://docs.anthropic.com/en/api | -| Google Gemini | https://ai.google.dev/api/rest | -| AWS Bedrock | https://docs.aws.amazon.com/bedrock/latest/APIReference/ | -| Mistral | https://docs.mistral.ai/api/ | -| Cohere | https://docs.cohere.com/reference/chat | - ---- - -## Format Categories - -Providers fall into several format categories based on their API structure: - -### 1. OpenAI Chat Completions Format -**Most common format - used by ~60 providers** - -Key identifiers: -- `body.messages[]` array -- Tool results: `role: "tool"`, `tool_call_id` -- System in messages array - -Providers: openai, together, deepseek, groq, fireworks, hyperbolic, novita, cerebras, sambanova, perplexity, openrouter, and most others - -### 2. OpenAI Responses Format (newer) -**Used by OpenAI GPT models via responses API** - -Key identifiers: -- `body.input[]` array -- Tool results: `type: "function_call_output"`, `call_id` - -Providers: openai (responses endpoint), azure (responses endpoint) - -### 3. Anthropic Format -**Distinct format with cache control** - -Key identifiers: -- `body.messages[]` but tool results in user messages -- Tool results: `type: "tool_result"`, `tool_use_id` -- Top-level `system` array -- `cache_control` support - -Providers: anthropic - -### 4. Google Gemini Format -**Position-based tool correlation** - -Key identifiers: -- `body.contents[]` array -- Tool results: `functionResponse` parts (no IDs!) -- Roles: `user`/`model` only -- Top-level `systemInstruction` - -Providers: google, google-vertex - -### 5. AWS Bedrock Format -**Converse API with cache points** - -Key identifiers: -- Top-level `system` array -- Tool results: `toolResult` blocks with `toolUseId` -- `cachePoint` blocks - -Providers: amazon-bedrock - -### 6. Mistral Format (OpenAI-like with quirks) -**Strict ID requirements** - -Key identifiers: -- OpenAI-like but 9-char alphanumeric tool IDs required -- User content always array - -Providers: mistral - -### 7. Cohere Format -**RAG-native with citations** - -Key identifiers: -- Uses `p`/`k` instead of `top_p`/`top_k` -- Uppercase tool choice values -- `documents` array for RAG - -Providers: cohere - -## Quick Reference: Thinking/Reasoning - -| Format | Request Config | Response Structure | Encrypted? | Signature? | -|--------|---------------|-------------------|------------|------------| -| OpenAI Responses | `reasoning: {effort, summary}` | `{type: "reasoning", encrypted_content, summary}` | Yes | No | -| Anthropic | `thinking: {type, budget_tokens}` | `{type: "thinking", thinking, signature}` | Partial* | Yes | -| Google Gemini | `thinkingConfig: {thinkingBudget}` | `{text, thought: true, thoughtSignature}` | No | Optional | -| AWS Bedrock | `additionalModelRequestFields.thinking` | `{reasoningContent: {reasoningText/redactedReasoning}}` | Partial* | Yes | -| Mistral | N/A (model decides) | `{type: "thinking", thinking: [{type: "text", text}]}` | No | No | -| Cohere | `thinking: {type, token_budget}` | `{type: "thinking", thinking: "..."}` | No | No | - -*Partial = has both visible (`thinking`/`reasoningText`) and redacted (`redacted_thinking`/`redactedReasoning`) variants - -**Key differences:** -- **OpenAI**: Reasoning is always encrypted; only summary is readable -- **Anthropic/Bedrock**: Can have visible thinking with signature, or redacted thinking -- **Gemini**: Thinking is a text part with `thought: true` flag -- **Mistral**: Thinking is nested array of text parts -- **Cohere**: Thinking is plain string - -**SDK normalization**: All formats are converted to `{type: "reasoning", text: "..."}` by the AI SDK - -## Quick Reference: Tool Call ID Fields - -| Format | Tool Call ID Field | Tool Result ID Field | -|--------|-------------------|---------------------| -| OpenAI Chat | `tool_calls[].id` | `tool_call_id` | -| OpenAI Responses | `call_id` | `call_id` | -| Anthropic | `tool_use.id` | `tool_use_id` | -| Gemini | **NONE (position-based)** | **NONE** | -| Bedrock | `toolUse.toolUseId` | `toolResult.toolUseId` | -| Mistral | `tool_calls[].id` (9-char) | `tool_call_id` | -| Cohere | `tool_calls[].id` | `tool_call_id` | - -## Detection Strategy - -To detect which format a request uses: - -```typescript -function detectFormat(body: unknown): string { - if (body.input && Array.isArray(body.input)) return 'openai-responses' - if (body.contents && Array.isArray(body.contents)) return 'gemini' - if (body.system && Array.isArray(body.system) && body.inferenceConfig) return 'bedrock' - if (body.messages) { - // Check first message structure for Anthropic vs OpenAI - const msg = body.messages[0] - if (msg?.content?.[0]?.type === 'tool_result') return 'anthropic' - if (msg?.content?.[0]?.tool_use_id) return 'anthropic' - } - return 'openai-chat' // Default -} -``` - -## Files - -- [openai.md](./openai.md) - OpenAI Chat Completions & Responses API -- [anthropic.md](./anthropic.md) - Anthropic Messages API -- [google-gemini.md](./google-gemini.md) - Google Generative AI (Gemini) -- [aws-bedrock.md](./aws-bedrock.md) - AWS Bedrock Converse API -- [mistral.md](./mistral.md) - Mistral API -- [cohere.md](./cohere.md) - Cohere Chat API -- [openai-compatible.md](./openai-compatible.md) - OpenAI-compatible providers - -## Context Pruning Universal Rules - -1. **Tool call/result pairing**: Always prune tool calls and their results together -2. **Message alternation**: Most APIs expect alternating user/assistant messages -3. **System preservation**: System messages typically should not be pruned -4. **ID correlation**: Maintain ID relationships when pruning (except Gemini which is position-based) -5. **Cache markers**: Consider preserving cache control markers when present - ---- - -## Complete Provider List (models.dev) - -Every provider from models.dev and its API format: - -### OpenAI Chat Format (43 providers) -*Uses `@ai-sdk/openai-compatible` - standard OpenAI messages format* - -| Provider ID | Name | Notes | -|-------------|------|-------| -| `agentrouter` | AgentRouter | | -| `alibaba` | Alibaba | | -| `alibaba-cn` | Alibaba (China) | | -| `bailing` | Bailing | | -| `baseten` | Baseten | | -| `chutes` | Chutes | | -| `cortecs` | Cortecs | | -| `deepseek` | DeepSeek | Reasoning models (R1) | -| `fastrouter` | FastRouter | | -| `fireworks-ai` | Fireworks AI | | -| `github-copilot` | GitHub Copilot | | -| `github-models` | GitHub Models | | -| `huggingface` | Hugging Face | | -| `iflowcn` | iFlow | | -| `inception` | Inception | | -| `inference` | Inference | | -| `io-net` | IO.NET | | -| `llama` | Llama | | -| `lmstudio` | LMStudio | Local inference | -| `lucidquery` | LucidQuery AI | | -| `modelscope` | ModelScope | | -| `moonshotai` | Moonshot AI | | -| `moonshotai-cn` | Moonshot AI (China) | | -| `morph` | Morph | | -| `nebius` | Nebius Token Factory | | -| `nvidia` | Nvidia | | -| `opencode` | OpenCode Zen | | -| `openrouter` | OpenRouter | Meta-provider, cache support | -| `ovhcloud` | OVHcloud AI Endpoints | | -| `poe` | Poe | | -| `requesty` | Requesty | | -| `scaleway` | Scaleway | | -| `siliconflow` | SiliconFlow | | -| `submodel` | submodel | | -| `synthetic` | Synthetic | | -| `upstage` | Upstage | | -| `venice` | Venice AI | | -| `vultr` | Vultr | | -| `wandb` | Weights & Biases | | -| `zai` | Z.AI | | -| `zai-coding-plan` | Z.AI Coding Plan | | -| `zenmux` | ZenMux | | -| `zhipuai` | Zhipu AI | | -| `zhipuai-coding-plan` | Zhipu AI Coding Plan | | - -### OpenAI Native Format (1 provider) -*Uses `@ai-sdk/openai` - supports both Chat Completions and Responses API* - -| Provider ID | Name | Notes | -|-------------|------|-------| -| `openai` | OpenAI | Responses API for GPT-4.1+ | - -### Azure Format (2 providers) -*Uses `@ai-sdk/azure` - OpenAI format with Azure auth* - -| Provider ID | Name | Notes | -|-------------|------|-------| -| `azure` | Azure | Supports Responses API | -| `azure-cognitive-services` | Azure Cognitive Services | | - -### Anthropic Format (4 providers) -*Uses `@ai-sdk/anthropic` - distinct message format with cache control* - -| Provider ID | Name | Notes | -|-------------|------|-------| -| `anthropic` | Anthropic | Native Anthropic API | -| `kimi-for-coding` | Kimi For Coding | Uses Anthropic format | -| `minimax` | MiniMax | Uses Anthropic format | -| `minimax-cn` | MiniMax (China) | Uses Anthropic format | - -### Google Gemini Format (3 providers) -*Uses `@ai-sdk/google` or `@ai-sdk/google-vertex` - POSITION-BASED tool correlation* - -| Provider ID | Name | Notes | -|-------------|------|-------| -| `google` | Google | Native Gemini API | -| `google-vertex` | Vertex | Google Cloud Vertex AI | -| `google-vertex-anthropic` | Vertex (Anthropic) | Claude via Vertex | - -### AWS Bedrock Format (1 provider) -*Uses `@ai-sdk/amazon-bedrock` - Converse API with cachePoint* - -| Provider ID | Name | Notes | -|-------------|------|-------| -| `amazon-bedrock` | Amazon Bedrock | Multi-model, cachePoint support | - -### Mistral Format (1 provider) -*Uses `@ai-sdk/mistral` - requires 9-char alphanumeric tool IDs* - -| Provider ID | Name | Notes | -|-------------|------|-------| -| `mistral` | Mistral | Strict tool ID format | - -### Cohere Format (1 provider) -*Uses `@ai-sdk/cohere` - RAG-native with citations* - -| Provider ID | Name | Notes | -|-------------|------|-------| -| `cohere` | Cohere | Uses `p`/`k`, uppercase tool choice | - -### Specialized SDK Providers (13 providers) -*Use provider-specific SDKs but follow OpenAI-like format* - -| Provider ID | Name | SDK | Format | -|-------------|------|-----|--------| -| `cerebras` | Cerebras | `@ai-sdk/cerebras` | OpenAI-like | -| `deepinfra` | Deep Infra | `@ai-sdk/deepinfra` | OpenAI-like | -| `groq` | Groq | `@ai-sdk/groq` | OpenAI-like | -| `perplexity` | Perplexity | `@ai-sdk/perplexity` | OpenAI-like | -| `togetherai` | Together AI | `@ai-sdk/togetherai` | OpenAI-like | -| `xai` | xAI | `@ai-sdk/xai` | OpenAI-like | -| `vercel` | Vercel AI Gateway | `@ai-sdk/gateway` | OpenAI-like | -| `v0` | v0 | `@ai-sdk/vercel` | OpenAI-like | -| `cloudflare-workers-ai` | Cloudflare Workers AI | `workers-ai-provider` | OpenAI-like | -| `ollama-cloud` | Ollama Cloud | `ai-sdk-ollama` | OpenAI-like | -| `aihubmix` | AIHubMix | `@aihubmix/ai-sdk-provider` | OpenAI-like | -| `sap-ai-core` | SAP AI Core | `@mymediset/sap-ai-provider` | OpenAI-like | - ---- - -## Format Summary - -| Format | Provider Count | Tool ID Field | Key Identifier | -|--------|---------------|---------------|----------------| -| OpenAI Chat | 56 | `tool_call_id` | `body.messages[]` | -| OpenAI Responses | 2 | `call_id` | `body.input[]` | -| Anthropic | 4 | `tool_use_id` | `tool_result` in user msg | -| Google Gemini | 3 | **NONE** | `body.contents[]` | -| AWS Bedrock | 1 | `toolUseId` | `body.inferenceConfig` | -| Mistral | 1 | `tool_call_id` (9-char) | Check provider ID | -| Cohere | 1 | `tool_call_id` | Check provider ID | - -**Total: 69 providers** diff --git a/docs/providers/anthropic.md b/docs/providers/anthropic.md deleted file mode 100644 index d1610fa..0000000 --- a/docs/providers/anthropic.md +++ /dev/null @@ -1,216 +0,0 @@ -# Anthropic Messages API Format - -Anthropic uses a distinct message format with unique features like cache control and extended thinking. - -## Sources - -- **AI SDK**: `packages/anthropic/src/convert-to-anthropic-messages-prompt.ts`, `packages/anthropic/src/anthropic-messages-language-model.ts` -- **OpenCode Transform**: `src/provider/transform.ts` (toolCallId sanitization, cache control) -- **Official Docs**: https://docs.anthropic.com/en/api/messages - -## Request Structure - -```json -{ - "model": "claude-sonnet-4-5", - "max_tokens": 4096, - "temperature": 1.0, - "stream": true, - "system": [ - {"type": "text", "text": "System instructions", "cache_control": {"type": "ephemeral"}} - ], - "messages": [...], - "tools": [...], - "tool_choice": {"type": "auto"}, - "thinking": {"type": "enabled", "budget_tokens": 10000} -} -``` - -## Key Differences from OpenAI - -| Feature | OpenAI | Anthropic | -|---------|--------|-----------| -| System message | In messages array | Top-level `system` array | -| Tool results | `role: "tool"` message | In `user` message with `type: "tool_result"` | -| Tool call ID field | `tool_call_id` | `tool_use_id` | -| Caching | Not available | `cache_control` on content blocks | - -## Message Roles - -Only **two roles**: `user` and `assistant`. Tool results are embedded in user messages. - -## Message Formats - -### System Message (top-level, not in messages) -```json -{ - "system": [ - { - "type": "text", - "text": "You are a helpful assistant.", - "cache_control": {"type": "ephemeral"} - } - ] -} -``` - -### User Message -```json -{ - "role": "user", - "content": [ - {"type": "text", "text": "Hello", "cache_control": {"type": "ephemeral"}}, - {"type": "image", "source": {"type": "base64", "media_type": "image/jpeg", "data": "..."}}, - {"type": "document", "source": {"type": "base64", "media_type": "application/pdf", "data": "..."}, "title": "Doc"} - ] -} -``` - -### Assistant Message with Tool Use -```json -{ - "role": "assistant", - "content": [ - {"type": "text", "text": "Let me check the weather."}, - { - "type": "tool_use", - "id": "toolu_01XYZ", - "name": "get_weather", - "input": {"location": "San Francisco"}, - "cache_control": {"type": "ephemeral"} - } - ] -} -``` - -### Tool Result (in user message) -```json -{ - "role": "user", - "content": [ - { - "type": "tool_result", - "tool_use_id": "toolu_01XYZ", - "content": "72°F and sunny", - "is_error": false, - "cache_control": {"type": "ephemeral"} - } - ] -} -``` - -## Thinking/Reasoning (Extended Thinking) - -### Request Configuration -```json -{ - "thinking": { - "type": "enabled", - "budget_tokens": 10000 - } -} -``` - -**Parameters:** -- `type`: `"enabled"` or `"disabled"` -- `budget_tokens`: Token budget for thinking (minimum 1024) - -**Constraints when thinking enabled:** -- `temperature`, `topK`, `topP` are **NOT supported** (ignored with warnings) -- `max_tokens` is automatically adjusted to include `budget_tokens` -- Minimum budget is 1,024 tokens - -### Response Content Blocks - -**Thinking Block** (visible reasoning): -```json -{ - "type": "thinking", - "thinking": "Let me analyze this step by step...", - "signature": "cryptographic_signature_for_verification" -} -``` - -**Redacted Thinking Block** (hidden reasoning): -```json -{ - "type": "redacted_thinking", - "data": "encrypted_base64_redacted_content" -} -``` - -### Streaming Deltas -```json -{"type": "thinking_delta", "thinking": "reasoning chunk..."} -{"type": "signature_delta", "signature": "sig_chunk"} -``` - -### SDK Conversion -The AI SDK converts Anthropic's `thinking` blocks to a unified `reasoning` type: -```typescript -// Anthropic response -{type: "thinking", thinking: "...", signature: "..."} - -// Converted to SDK format -{type: "reasoning", text: "...", signature: "..."} -``` - -### Context Pruning for Thinking -- **Cannot apply cache_control** to thinking or redacted_thinking blocks -- **Signatures are cryptographic** - preserve for verification if replaying -- **Redacted thinking** contains encrypted content that cannot be inspected -- Consider thinking blocks as important context but potentially large - -## Tool Definition - -```json -{ - "name": "get_weather", - "description": "Get weather for a location", - "input_schema": { - "type": "object", - "properties": {"location": {"type": "string"}}, - "required": ["location"] - }, - "cache_control": {"type": "ephemeral"} -} -``` - -### Tool Choice Options -- `{"type": "auto"}` - Model decides -- `{"type": "any"}` - Force tool use -- `{"type": "tool", "name": "get_weather"}` - Force specific tool - -## Cache Control - -```json -{"type": "ephemeral", "ttl": "5m"} -``` - -**Limits**: Maximum **4 cache breakpoints** per request - -**Applicable to**: system messages, user/assistant content parts, tool results, tool definitions - -**NOT applicable to**: `thinking` blocks, `redacted_thinking` blocks - -## Special Tool Types - -**Server Tool Use** (provider-executed): -```json -{"type": "server_tool_use", "id": "...", "name": "web_search", "input": {...}} -``` -Names: `web_fetch`, `web_search`, `code_execution`, `bash_code_execution`, `text_editor_code_execution` - -**MCP Tool Use**: -```json -{"type": "mcp_tool_use", "id": "...", "name": "custom_tool", "server_name": "my-mcp-server", "input": {...}} -``` - -## Context Pruning Considerations - -1. **Tool correlation**: Uses `tool_use_id` (not `tool_call_id`) -2. **Tool results in user messages**: Unlike OpenAI, tool results are `content` parts in user messages -3. **Message merging**: Consecutive user messages are merged; consecutive assistant messages are merged -4. **Cache breakpoints**: Preserve `cache_control` markers when possible (max 4) -5. **Thinking blocks**: Have signatures for verification; handle with care -6. **Paired pruning**: `tool_use` and corresponding `tool_result` must be pruned together diff --git a/docs/providers/aws-bedrock.md b/docs/providers/aws-bedrock.md deleted file mode 100644 index f1c4479..0000000 --- a/docs/providers/aws-bedrock.md +++ /dev/null @@ -1,287 +0,0 @@ -# AWS Bedrock API Format - -AWS Bedrock uses the Converse API with unique content block types and caching via `cachePoint`. - -## Sources - -- **AI SDK**: `packages/amazon-bedrock/src/convert-to-bedrock-chat-messages.ts`, `packages/amazon-bedrock/src/bedrock-chat-language-model.ts` -- **OpenCode Transform**: `src/provider/transform.ts` (cachePoint insertion) -- **Official Docs**: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html - -## Request Structure - -```json -{ - "system": [ - {"text": "System message"}, - {"cachePoint": {"type": "default"}} - ], - "messages": [ - {"role": "user", "content": [...]}, - {"role": "assistant", "content": [...]} - ], - "inferenceConfig": { - "maxTokens": 4096, - "temperature": 0.7, - "topP": 0.9, - "topK": 50, - "stopSequences": ["END"] - }, - "toolConfig": { - "tools": [...], - "toolChoice": {"auto": {}} - }, - "additionalModelRequestFields": { - "thinking": {"type": "enabled", "budget_tokens": 10000} - } -} -``` - -## Key Differences from OpenAI - -| Feature | OpenAI | Bedrock | -|---------|--------|--------| -| System message | In messages | Top-level `system` array | -| Tool calls | `tool_calls` array | `toolUse` content block | -| Tool results | `role: "tool"` | `toolResult` in user content | -| Tool call ID | `tool_call_id` | `toolUseId` | -| Caching | Not available | `cachePoint` blocks | - -## Message Roles - -Only **two roles**: `user` and `assistant`. Tool results go in user messages. - -## Content Block Types - -### Text Block -```json -{"text": "Hello, how can I help?"} -``` - -### Image Block -```json -{ - "image": { - "format": "jpeg", - "source": {"bytes": ""} - } -} -``` -Formats: `jpeg`, `png`, `gif`, `webp` - -### Document Block -```json -{ - "document": { - "format": "pdf", - "name": "document-1", - "source": {"bytes": ""}, - "citations": {"enabled": true} - } -} -``` -Formats: `pdf`, `csv`, `doc`, `docx`, `xls`, `xlsx`, `html`, `txt`, `md` - -### Tool Use Block (Assistant calling tool) -```json -{ - "toolUse": { - "toolUseId": "tool_call_123", - "name": "get_weather", - "input": {"city": "Seattle"} - } -} -``` - -### Tool Result Block (User providing result) -```json -{ - "toolResult": { - "toolUseId": "tool_call_123", - "content": [ - {"text": "Temperature: 72F"}, - {"image": {"format": "png", "source": {"bytes": "..."}}} - ] - } -} -``` - -### Reasoning Block (Anthropic models) -```json -{ - "reasoningContent": { - "reasoningText": { - "text": "Let me think through this...", - "signature": "" - } - } -} -``` - -## Thinking/Reasoning (Anthropic Models via Bedrock) - -### Request Configuration -```json -{ - "additionalModelRequestFields": { - "thinking": { - "type": "enabled", - "budget_tokens": 10000 - } - } -} -``` - -**Note**: Bedrock uses `reasoningConfig` in the SDK which gets transformed to Anthropic's `thinking` format in `additionalModelRequestFields`. - -**Parameters:** -- `type`: `"enabled"` or `"disabled"` -- `budget_tokens`: Token budget for thinking (minimum 1024) - -### Response Content Blocks - -**Reasoning Text Block** (visible reasoning): -```json -{ - "reasoningContent": { - "reasoningText": { - "text": "Let me analyze this step by step...", - "signature": "cryptographic_signature_for_verification" - } - } -} -``` - -**Redacted Reasoning Block** (hidden reasoning): -```json -{ - "reasoningContent": { - "redactedReasoning": { - "data": "encrypted_base64_redacted_content" - } - } -} -``` - -### SDK Conversion -The AI SDK converts Bedrock's reasoning blocks to unified format: -```typescript -// Bedrock response -{reasoningContent: {reasoningText: {text: "...", signature: "..."}}} - -// Converted to SDK format -{type: "reasoning", text: "...", signature: "..."} - -// Redacted version -{reasoningContent: {redactedReasoning: {data: "..."}}} - -// Converted to SDK format -{type: "redacted-reasoning", data: "..."} -``` - -### Context Pruning for Reasoning -- **Signatures are cryptographic** - preserve for verification -- **Redacted reasoning** contains encrypted content that cannot be inspected -- Reasoning blocks appear in assistant message content -- Consider reasoning as important but potentially large context - -### Cache Point -```json -{"cachePoint": {"type": "default"}} -``` - -## Caching Mechanism - -Cache points can be inserted at: -1. In system messages - After each system message -2. In user message content - After content blocks -3. In assistant message content - After content blocks -4. In tool configuration - After tool definitions - -## Tool Definition - -```json -{ - "tools": [ - { - "toolSpec": { - "name": "get_weather", - "description": "Get weather for a city", - "inputSchema": { - "json": { - "type": "object", - "properties": {"city": {"type": "string"}}, - "required": ["city"] - } - } - } - }, - {"cachePoint": {"type": "default"}} - ], - "toolChoice": {"auto": {}} -} -``` - -### Tool Choice Options -- `{"auto": {}}` - Model decides -- `{"any": {}}` - Force tool use (maps to "required") -- `{"tool": {"name": "tool_name"}}` - Force specific tool - -## Complete Example - -```json -{ - "system": [ - {"text": "You are a helpful assistant."}, - {"cachePoint": {"type": "default"}} - ], - "messages": [ - { - "role": "user", - "content": [{"text": "What's the weather in Seattle?"}] - }, - { - "role": "assistant", - "content": [{ - "toolUse": { - "toolUseId": "call_001", - "name": "get_weather", - "input": {"city": "Seattle"} - } - }] - }, - { - "role": "user", - "content": [ - { - "toolResult": { - "toolUseId": "call_001", - "content": [{"text": "{\"temperature\": 72, \"condition\": \"sunny\"}"}] - } - }, - {"cachePoint": {"type": "default"}} - ] - } - ], - "toolConfig": { - "tools": [{"toolSpec": {"name": "get_weather", "description": "Get weather", "inputSchema": {"json": {"type": "object", "properties": {"city": {"type": "string"}}, "required": ["city"]}}}}], - "toolChoice": {"auto": {}} - } -} -``` - -## Unique Behaviors - -1. **Trailing whitespace trimming**: Last text block in assistant messages is trimmed -2. **Empty text blocks skipped**: Whitespace-only text blocks are filtered -3. **Temperature clamping**: Clamped to [0, 1] range -4. **Tool content filtering**: If no tools available, tool content is removed with warning - -## Context Pruning Considerations - -1. **Tool correlation**: Uses `toolUseId` for correlation -2. **Tool results in user messages**: `toolResult` blocks are in user message content -3. **Message grouping**: Consecutive same-role messages are merged -4. **Cache points**: Preserve `cachePoint` markers when beneficial -5. **Paired pruning**: `toolUse` and corresponding `toolResult` must be pruned together -6. **System first**: System messages must come before user/assistant messages diff --git a/docs/providers/cohere.md b/docs/providers/cohere.md deleted file mode 100644 index a1927fb..0000000 --- a/docs/providers/cohere.md +++ /dev/null @@ -1,282 +0,0 @@ -# Cohere API Format - -Cohere uses a chat-based API with unique features like built-in RAG via `documents` and citations. - -## Request Structure - -```json -{ - "model": "command-r-plus", - "messages": [...], - "max_tokens": 4096, - "temperature": 0.7, - "p": 0.9, - "k": 40, - "frequency_penalty": 0.0, - "presence_penalty": 0.0, - "seed": 12345, - "stop_sequences": ["END"], - "response_format": {"type": "json_object"}, - "tools": [...], - "tool_choice": "REQUIRED", - "documents": [...], - "thinking": {"type": "enabled", "token_budget": 2048} -} -``` - -## Key Differences from OpenAI - -| Feature | OpenAI | Cohere | -|---------|--------|-------| -| Top-p parameter | `top_p` | `p` | -| Top-k parameter | `top_k` | `k` | -| Tool choice required | `"required"` | `"REQUIRED"` (uppercase) | -| RAG | Not built-in | `documents` array | -| Citations | Not built-in | Automatic with documents | - -## Message Formats - -### System Message -```json -{"role": "system", "content": "You are a helpful assistant."} -``` - -### User Message (text only) -```json -{"role": "user", "content": "What is the weather today?"} -``` -**Note**: Files/documents are extracted to top-level `documents` array for RAG. - -### Assistant Message -```json -{ - "role": "assistant", - "content": "The weather is sunny.", - "tool_plan": undefined, - "tool_calls": undefined -} -``` - -### Assistant Message with Tool Calls -```json -{ - "role": "assistant", - "content": undefined, - "tool_plan": undefined, - "tool_calls": [{ - "id": "call_abc123", - "type": "function", - "function": { - "name": "get_weather", - "arguments": "{\"location\": \"San Francisco\"}" - } - }] -} -``` -**Key quirk**: When `tool_calls` present, `content` is `undefined`. - -### Tool Result Message -```json -{ - "role": "tool", - "tool_call_id": "call_abc123", - "content": "{\"temperature\": 72, \"conditions\": \"sunny\"}" -} -``` - -## Tool Definition - -```json -{ - "tools": [{ - "type": "function", - "function": { - "name": "get_weather", - "description": "Get weather for a location", - "parameters": { - "type": "object", - "properties": {"location": {"type": "string"}}, - "required": ["location"] - } - } - }], - "tool_choice": "REQUIRED" -} -``` - -### Tool Choice Values (UPPERCASE) -- `undefined` - Auto (model decides) -- `"NONE"` - Disable tool use -- `"REQUIRED"` - Force tool use - -**Note**: To force a specific tool, filter `tools` array and set `tool_choice: "REQUIRED"`. - -## RAG via Documents - -```json -{ - "documents": [ - { - "data": { - "text": "Document content here", - "title": "Optional Title" - } - } - ] -} -``` - -## Response Structure - -```json -{ - "generation_id": "abc-123", - "message": { - "role": "assistant", - "content": [ - {"type": "text", "text": "Response here."}, - {"type": "thinking", "thinking": "Reasoning..."} - ], - "tool_plan": "I will call the API", - "tool_calls": [...], - "citations": [{ - "start": 0, - "end": 10, - "text": "cited text", - "sources": [{"type": "document", "id": "doc1", "document": {...}}] - }] - }, - "finish_reason": "COMPLETE", - "usage": {...} -} -``` - -**Note**: Response `content` is an **array** of typed objects (unlike request which uses string). - -## Unique Features - -1. **Thinking mode**: Native reasoning via `thinking` config, returns `{"type": "thinking"}` blocks -2. **Citations**: Automatic source citations when using `documents` -3. **Tool plan**: `tool_plan` field explains tool usage reasoning -4. **Null arguments**: May return `"null"` for parameterless tools (normalize to `"{}"`) - -## Thinking/Reasoning - -### Request Configuration -```json -{ - "thinking": { - "type": "enabled", - "token_budget": 2048 - } -} -``` - -**Parameters:** -- `type`: `"enabled"` or `"disabled"` -- `token_budget`: Token budget for thinking - -### Response Content Blocks - -**Thinking Block** (in response content array): -```json -{ - "type": "thinking", - "thinking": "Let me reason through this problem..." -} -``` - -**Note**: Unlike Mistral, Cohere's `thinking` field is a **string**, not an array. - -### Response Structure with Thinking -```json -{ - "message": { - "role": "assistant", - "content": [ - {"type": "thinking", "thinking": "First, I need to consider..."}, - {"type": "text", "text": "Based on my analysis..."} - ] - } -} -``` - -### Streaming Events for Thinking -```json -// content-start (thinking) -{"type": "content-start", "index": 0, "delta": {"message": {"content": {"type": "thinking", "thinking": ""}}}} - -// content-delta (thinking) -{"type": "content-delta", "index": 0, "delta": {"message": {"content": {"thinking": "reasoning chunk..."}}}} -``` - -### SDK Conversion -The AI SDK converts Cohere's thinking blocks to unified format: -```typescript -// Cohere response content -{type: "thinking", thinking: "..."} - -// Converted to SDK format -{type: "reasoning", text: "..."} -``` - -### Context Pruning for Thinking -- Thinking blocks appear in response `content` array -- No signatures or encryption - content is plaintext string -- Consider thinking as important context but potentially large -- Thinking appears before text content in the response - -## Complete Example - -```json -{ - "model": "command-r-plus", - "messages": [ - {"role": "system", "content": "You are a weather assistant."}, - {"role": "user", "content": "Weather in Paris?"}, - { - "role": "assistant", - "content": undefined, - "tool_plan": undefined, - "tool_calls": [{ - "id": "call_001", - "type": "function", - "function": {"name": "get_weather", "arguments": "{\"location\":\"Paris\"}"} - }] - }, - { - "role": "tool", - "tool_call_id": "call_001", - "content": "{\"temperature\":18,\"conditions\":\"cloudy\"}" - } - ], - "tools": [{ - "type": "function", - "function": {"name": "get_weather", "description": "Get weather", "parameters": {"type": "object", "properties": {"location": {"type": "string"}}, "required": ["location"]}} - }], - "max_tokens": 1024, - "temperature": 0.7 -} -``` - -## Streaming Events - -| Event | Purpose | -|-------|--------| -| `message-start` | Start of response | -| `content-start` | Start of text/thinking block | -| `content-delta` | Text or thinking chunk | -| `tool-plan-delta` | Tool planning reasoning | -| `tool-call-start` | Start of tool call | -| `tool-call-delta` | Tool call arguments chunk | -| `message-end` | Final with `finish_reason` and `usage` | - -## Context Pruning Considerations - -1. **Tool correlation**: Uses `tool_call_id` like OpenAI -2. **Separate tool results**: Each result is a separate message (not grouped) -3. **Content exclusivity**: When `tool_calls` present, `content` is `undefined` -4. **Response vs request format**: Response content is array, request is string -5. **Uppercase tool choice**: Use `"NONE"` and `"REQUIRED"` (not lowercase) -6. **Paired pruning**: Tool calls and results must be pruned together -7. **Documents top-level**: RAG documents are separate from messages diff --git a/docs/providers/google-gemini.md b/docs/providers/google-gemini.md deleted file mode 100644 index 8ab69b1..0000000 --- a/docs/providers/google-gemini.md +++ /dev/null @@ -1,255 +0,0 @@ -# Google Gemini API Format - -Google's Generative AI (Gemini) uses a unique format with **position-based tool correlation** (no tool call IDs). - -## Sources - -- **AI SDK**: `packages/google/src/convert-to-google-generative-ai-messages.ts`, `packages/google/src/google-generative-ai-language-model.ts` -- **Schema Conversion**: `packages/google/src/convert-json-schema-to-openapi-schema.ts` -- **OpenCode Transform**: `src/provider/transform.ts` (schema integer→string enum conversion) -- **Official Docs**: https://ai.google.dev/api/rest/v1/models/generateContent - -## Request Structure - -```json -{ - "systemInstruction": { - "parts": [{"text": "System prompt text"}] - }, - "contents": [ - {"role": "user", "parts": [...]}, - {"role": "model", "parts": [...]} - ], - "generationConfig": { - "maxOutputTokens": 1024, - "temperature": 0.7, - "topK": 40, - "topP": 0.95, - "responseMimeType": "application/json", - "responseSchema": {...} - }, - "tools": [...], - "toolConfig": { - "functionCallingConfig": {"mode": "AUTO"} - } -} -``` - -## Key Differences from OpenAI - -| Feature | OpenAI | Gemini | -|---------|--------|--------| -| Message container | `messages[]` | `contents[]` | -| System message | In messages | Top-level `systemInstruction` | -| Roles | system/user/assistant/tool | user/model only | -| Tool call IDs | ID-based correlation | **POSITION-BASED** | -| Tool results | Separate `tool` role | In `user` message as `functionResponse` | - -## Message Roles - -Only **two roles**: `user` and `model` - -| SDK Role | Gemini Role | -|----------|-------------| -| `system` | `systemInstruction` (top-level) | -| `user` | `user` | -| `assistant` | `model` | -| `tool` (results) | `user` (with `functionResponse`) | - -## Content Parts - -### Text Part -```json -{"text": "Hello, how are you?"} -``` - -### Thinking Part -```json -{"text": "Let me think...", "thought": true, "thoughtSignature": "sig-for-caching"} -``` - -## Thinking/Reasoning - -### Request Configuration -```json -{ - "generationConfig": { - "thinkingConfig": { - "thinkingBudget": 8192, - "includeThoughts": true - } - } -} -``` - -**Parameters:** -- `thinkingBudget`: Token budget for thinking -- `includeThoughts`: Whether to include thinking in response (default true) - -### Response Content Parts - -**Thinking Part** (in model message): -```json -{ - "text": "Let me reason through this problem...", - "thought": true, - "thoughtSignature": "signature_for_caching" -} -``` - -**Key fields:** -- `thought: true` - Marks this part as reasoning content -- `thoughtSignature` - Optional signature for caching/verification - -### Usage Tracking -```json -{ - "usageMetadata": { - "promptTokenCount": 100, - "candidatesTokenCount": 200, - "thoughtsTokenCount": 150 - } -} -``` - -### SDK Conversion -The AI SDK converts Gemini's thought parts to unified `reasoning` type: -```typescript -// Gemini response part -{text: "...", thought: true, thoughtSignature: "..."} - -// Converted to SDK format -{type: "reasoning", text: "...", signature: "..."} -``` - -### Context Pruning for Thinking -- **Thought parts are regular text parts** with `thought: true` flag -- **thoughtSignature** should be preserved if present (used for caching) -- Thinking parts appear in `model` role messages -- Consider thinking as important but potentially large context - -## Image (inline base64) -```json -{"inlineData": {"mimeType": "image/jpeg", "data": "base64-encoded-data"}} -``` - -### Image (file URI) -```json -{"fileData": {"mimeType": "image/png", "fileUri": "gs://bucket/path/image.png"}} -``` - -### Function Call (tool invocation) -```json -{"functionCall": {"name": "get_weather", "args": {"location": "Tokyo"}}} -``` - -### Function Response (tool result) -```json -{"functionResponse": {"name": "get_weather", "response": {"name": "get_weather", "content": "{\"temp\": 22}"}}} -``` - -## CRITICAL: Position-Based Tool Correlation - -**Gemini does NOT use tool call IDs.** Tool results are correlated by **position/order**. - -### Tool Call (model message) -```json -{ - "role": "model", - "parts": [ - {"functionCall": {"name": "get_weather", "args": {"location": "SF"}}}, - {"functionCall": {"name": "get_time", "args": {"timezone": "PST"}}} - ] -} -``` - -### Tool Results (user message) - ORDER MUST MATCH -```json -{ - "role": "user", - "parts": [ - {"functionResponse": {"name": "get_weather", "response": {"name": "get_weather", "content": "72F"}}}, - {"functionResponse": {"name": "get_time", "response": {"name": "get_time", "content": "2:30 PM"}}} - ] -} -``` - -## Tool Definition - -```json -{ - "tools": [{ - "functionDeclarations": [{ - "name": "get_weather", - "description": "Get the current weather", - "parameters": { - "type": "object", - "properties": {"location": {"type": "string"}}, - "required": ["location"] - } - }] - }], - "toolConfig": { - "functionCallingConfig": {"mode": "AUTO"} - } -} -``` - -### Tool Config Modes -- `AUTO` - Model decides -- `NONE` - Disable tools -- `ANY` - Force tool use -- `ANY` + `allowedFunctionNames` - Force specific tools - -### Provider-Defined Tools -```json -{"googleSearch": {}}, -{"urlContext": {}}, -{"codeExecution": {}} -``` - -## Schema Conversion (JSON Schema to OpenAPI) - -Gemini requires **OpenAPI 3.0 schema format**: - -| JSON Schema | OpenAPI | -|-------------|---------| -| `const: value` | `enum: [value]` | -| `type: ["string", "null"]` | `anyOf` + `nullable: true` | - -## Gemma Model Handling - -For `gemma-*` models, system instructions are **prepended to first user message**: -```json -{ - "contents": [{ - "role": "user", - "parts": [{"text": "System prompt\n\nActual user message"}] - }] -} -``` - -## Complete Example - -```json -{ - "systemInstruction": {"parts": [{"text": "You are a weather assistant."}]}, - "contents": [ - {"role": "user", "parts": [{"text": "Weather in Tokyo?"}]}, - {"role": "model", "parts": [{"functionCall": {"name": "get_weather", "args": {"location": "Tokyo"}}}]}, - {"role": "user", "parts": [{"functionResponse": {"name": "get_weather", "response": {"name": "get_weather", "content": "22C cloudy"}}}]}, - {"role": "model", "parts": [{"text": "Tokyo is 22C and cloudy."}]} - ], - "tools": [{"functionDeclarations": [{"name": "get_weather", "description": "Get weather", "parameters": {"type": "object", "properties": {"location": {"type": "string"}}, "required": ["location"]}}]}] -} -``` - -## Context Pruning Considerations - -1. **POSITION-BASED CORRELATION**: Tool calls and results must be pruned TOGETHER and order preserved -2. **No IDs**: Cannot selectively prune individual tool results - entire pairs must go -3. **System separate**: `systemInstruction` is top-level, typically should NOT be pruned -4. **Alternation required**: Must maintain alternating `user`/`model` pattern -5. **Multi-part messages**: Each message can have multiple parts; prune entire messages, not parts -6. **Tool results are user role**: `functionResponse` parts are in `user` messages -7. **thoughtSignature**: Used for caching reasoning; preserve if present diff --git a/docs/providers/mistral.md b/docs/providers/mistral.md deleted file mode 100644 index 3767830..0000000 --- a/docs/providers/mistral.md +++ /dev/null @@ -1,226 +0,0 @@ -# Mistral API Format - -Mistral uses an OpenAI-compatible format but with **strict tool call ID requirements**. - -## Sources - -- **AI SDK**: `packages/mistral/src/convert-to-mistral-chat-messages.ts`, `packages/mistral/src/mistral-chat-language-model.ts` -- **OpenCode Transform**: `src/provider/transform.ts` (9-char alphanumeric ID normalization) -- **Official Docs**: https://docs.mistral.ai/api/#tag/chat - -## Request Structure - -```json -{ - "model": "mistral-large-latest", - "messages": [...], - "max_tokens": 4096, - "temperature": 0.7, - "top_p": 1.0, - "random_seed": 42, - "safe_prompt": false, - "stream": false, - "response_format": {"type": "json_object"}, - "tools": [...], - "tool_choice": "auto" -} -``` - -## CRITICAL: Tool Call ID Requirement - -**Mistral requires tool call IDs to be exactly 9 alphanumeric characters.** - -| Valid | Invalid | -|-------|--------| -| `abc123xyz` | `call_abc123` (too long, has underscore) | -| `A1B2C3D4E` | `12345` (too short) | -| `def456uvw` | `abc-123-xy` (has hyphens) | - -## Key Differences from OpenAI - -| Feature | OpenAI | Mistral | -|---------|--------|--------| -| Tool call ID format | `call_*` (variable) | **Exactly 9 alphanumeric** | -| Tool choice `required` | `"required"` | `"any"` | -| User content | String or array | **Always array** | -| Assistant `prefix` | Not supported | Supported | -| Stop sequences | Supported | Not supported | -| Frequency/presence penalty | Supported | Not supported | - -## Message Formats - -### System Message -```json -{"role": "system", "content": "You are a helpful assistant."} -``` - -### User Message (always array) -```json -{ - "role": "user", - "content": [ - {"type": "text", "text": "What's in this image?"}, - {"type": "image_url", "image_url": "https://example.com/image.jpg"}, - {"type": "document_url", "document_url": "data:application/pdf;base64,..."} - ] -} -``` - -### Assistant Message -```json -{ - "role": "assistant", - "content": "Here's the analysis...", - "prefix": true, - "tool_calls": [ - { - "id": "abc123xyz", - "type": "function", - "function": { - "name": "get_weather", - "arguments": "{\"location\":\"San Francisco\"}" - } - } - ] -} -``` - -### Tool Result Message -```json -{ - "role": "tool", - "name": "get_weather", - "tool_call_id": "abc123xyz", - "content": "{\"temperature\": 72, \"condition\": \"sunny\"}" -} -``` - -## Tool Definition - -```json -{ - "tools": [{ - "type": "function", - "function": { - "name": "get_weather", - "description": "Get weather for a location", - "parameters": { - "type": "object", - "properties": {"location": {"type": "string"}}, - "required": ["location"] - }, - "strict": true - } - }], - "tool_choice": "auto" -} -``` - -### Tool Choice Options -- `"auto"` - Model decides -- `"none"` - Disable tool calling -- `"any"` - Force tool use (NOT `"required"`) -- `{"type": "function", "function": {"name": "..."}}` - Force specific tool - -## Unique Features - -1. **Prefix flag**: `prefix: true` on assistant messages for continuation mode -2. **PDF support**: Via `document_url` content type with base64 -3. **Thinking mode**: Returns `{"type": "thinking", "thinking": [...]}` content blocks - -## Thinking/Reasoning (Magistral Models) - -### Response Content Structure - -Mistral's reasoning models (Magistral) return thinking in the response content: - -**Thinking Block** (in assistant message content): -```json -{ - "type": "thinking", - "thinking": [ - {"type": "text", "text": "Let me reason through this..."} - ] -} -``` - -**Note**: The `thinking` field is an **array** of text parts, not a string. - -### Streaming Response -When streaming, content can be a string OR array: -```json -{ - "choices": [{ - "delta": { - "role": "assistant", - "content": [ - {"type": "thinking", "thinking": [{"type": "text", "text": "reasoning..."}]}, - {"type": "text", "text": "final response"} - ] - } - }] -} -``` - -### SDK Conversion -The AI SDK extracts and converts Mistral's thinking blocks: -```typescript -// Mistral response content -{type: "thinking", thinking: [{type: "text", text: "..."}]} - -// Converted to SDK format -{type: "reasoning", text: "..."} -``` - -### Context Pruning for Thinking -- Thinking blocks appear as content items in assistant messages -- The nested `thinking` array contains text parts to concatenate -- No signatures or encryption - content is plaintext -- Consider thinking as important context but potentially large - -## Complete Example - -```json -{ - "model": "mistral-large-latest", - "messages": [ - {"role": "system", "content": "You are a helpful assistant."}, - {"role": "user", "content": [{"type": "text", "text": "Weather in NYC?"}]}, - { - "role": "assistant", - "content": "", - "tool_calls": [{ - "id": "abc123xyz", - "type": "function", - "function": {"name": "get_weather", "arguments": "{\"location\":\"New York City\"}"} - }] - }, - { - "role": "tool", - "name": "get_weather", - "tool_call_id": "abc123xyz", - "content": "{\"temperature\":72,\"condition\":\"sunny\"}" - } - ], - "tools": [{ - "type": "function", - "function": {"name": "get_weather", "description": "Get weather", "parameters": {"type": "object", "properties": {"location": {"type": "string"}}, "required": ["location"]}} - }], - "tool_choice": "auto" -} -``` - -## Unsupported Features - -- `topK` -- `frequencyPenalty` -- `presencePenalty` -- `stopSequences` - -## Context Pruning Considerations - -1. **9-char alphanumeric IDs**: When generating synthetic tool calls, IDs must be exactly 9 alphanumeric chars -2. **Tool correlation**: Uses `tool_call_id` like OpenAI -3. **User content always array**: Even single text becomes `[{"type": "text", "text": "..."}]` -4. **Tool name in result**: Tool result includes `name` field alongside `tool_call_id` -5. **Paired pruning**: Tool calls and results must be pruned together diff --git a/docs/providers/openai-compatible.md b/docs/providers/openai-compatible.md deleted file mode 100644 index 3406248..0000000 --- a/docs/providers/openai-compatible.md +++ /dev/null @@ -1,135 +0,0 @@ -# OpenAI-Compatible Providers - -Most providers in models.dev use the OpenAI Chat Completions format via `@ai-sdk/openai-compatible`. This document covers these providers and any provider-specific quirks. - -## Standard OpenAI Chat Completions Format - -See [openai.md](./openai.md) for the full format specification. - -### Quick Reference - -```json -{ - "model": "model-name", - "messages": [ - {"role": "system", "content": "..."}, - {"role": "user", "content": "..."}, - {"role": "assistant", "content": "...", "tool_calls": [...]}, - {"role": "tool", "tool_call_id": "...", "content": "..."} - ], - "tools": [...], - "tool_choice": "auto" -} -``` - -## Providers Using OpenAI-Compatible Format - -Based on models.dev, these providers use `@ai-sdk/openai-compatible`: - -| Provider | Base URL | Notes | -|----------|----------|-------| -| together | api.together.xyz | | -| deepseek | api.deepseek.com | | -| groq | api.groq.com | Very fast inference | -| fireworks | api.fireworks.ai | | -| hyperbolic | api.hyperbolic.xyz | | -| novita | api.novita.ai | | -| cerebras | api.cerebras.ai | | -| sambanova | api.sambanova.ai | | -| nebius | api.studio.nebius.ai | | -| chutes | api.chutes.ai | | -| openrouter | openrouter.ai | Meta-provider | -| kluster | api.kluster.ai | | -| glhf | glhf.chat | | -| scaleway | api.scaleway.ai | | -| lepton | api.lepton.ai | | -| nano-gpt | api.nano-gpt.com | | -| arcee | api.arcee.ai | | -| inference-net | api.inference.net | | -| nineteen | api.nineteen.ai | | -| targon | api.targon.ai | | -| req-ai | api.req.ai | | -| vllm | (self-hosted) | | -| ollama | localhost:11434 | Local models | -| lmstudio | localhost:1234 | Local models | -| jan | localhost:1337 | Local models | -| any-provider | (configurable) | Generic OpenAI-compatible | - -## Provider-Specific Quirks - -### OpenRouter -- Acts as a meta-provider routing to various backends -- May have different caching semantics -- Supports `cache_control` similar to Anthropic when routing to Claude - -### Groq -- Extremely fast inference -- Limited model selection -- May have stricter rate limits - -### DeepSeek -- Supports reasoning models (DeepSeek R1) -- May include thinking/reasoning in responses - -### Ollama / LM Studio / Jan -- Local inference -- No rate limits but hardware-dependent -- May not support all features (vision, tools) - -### Together AI -- Wide model selection -- Good tool support -- Supports streaming - -## Caching Considerations - -Some OpenAI-compatible providers support caching hints: - -```json -{ - "role": "user", - "content": "...", - "cache_control": {"type": "ephemeral"} -} -``` - -Supported by: -- OpenRouter (when routing to Anthropic) -- Some enterprise deployments - -## Vision Support - -Not all OpenAI-compatible providers support vision. Check model capabilities: - -```json -{ - "role": "user", - "content": [ - {"type": "text", "text": "What's in this image?"}, - {"type": "image_url", "image_url": {"url": "data:image/jpeg;base64,..."}} - ] -} -``` - -## Tool Support - -Tool support varies by provider and model. Common limitations: -- Some models don't support parallel tool calls -- Some models don't support structured outputs/strict mode -- Response format (`json_object`) support varies - -## Context Pruning Considerations - -1. **Standard ID correlation**: All use `tool_call_id` for tool result correlation -2. **Consistent message format**: Messages follow OpenAI structure -3. **Feature detection**: May need to check model capabilities at runtime -4. **Cache support varies**: Not all providers honor cache hints -5. **Paired pruning**: Tool calls and results must be pruned together - -## Detection - -OpenAI-compatible requests can be detected by: -- `body.messages` array present -- Messages have `role` field with values: `system`, `user`, `assistant`, `tool` -- Tool results have `tool_call_id` field -- No special top-level fields like `contents` (Gemini) or `system` array (Bedrock/Anthropic) diff --git a/docs/providers/openai.md b/docs/providers/openai.md deleted file mode 100644 index db24be4..0000000 --- a/docs/providers/openai.md +++ /dev/null @@ -1,223 +0,0 @@ -# OpenAI API Format - -OpenAI offers two API formats: **Chat Completions** (original) and **Responses** (newer). - -## Sources - -- **AI SDK**: `packages/openai/src/chat/openai-chat-language-model.ts`, `packages/openai/src/responses/openai-responses-language-model.ts` -- **AI SDK OpenAI-Compatible**: `packages/openai-compatible/src/chat/openai-compatible-chat-language-model.ts` -- **Official Docs**: https://platform.openai.com/docs/api-reference/chat -- **Responses API**: https://platform.openai.com/docs/api-reference/responses - -## Chat Completions API (`/chat/completions`) - -### Request Structure - -```json -{ - "model": "gpt-4o", - "messages": [...], - "tools": [...], - "tool_choice": "auto" | "none" | "required" | {"type": "function", "function": {"name": "..."}}, - "max_tokens": 4096, - "temperature": 0.7, - "response_format": {"type": "json_object"} | {"type": "json_schema", "json_schema": {...}}, - "stream": false -} -``` - -### Message Roles - -| Role | Description | -|------|-------------| -| `system` | System instructions | -| `user` | User input | -| `assistant` | Model responses | -| `tool` | Tool/function results | - -### Message Formats - -**System Message:** -```json -{"role": "system", "content": "You are a helpful assistant."} -``` - -**User Message (multimodal):** -```json -{ - "role": "user", - "content": [ - {"type": "text", "text": "What's in this image?"}, - {"type": "image_url", "image_url": {"url": "https://example.com/image.jpg", "detail": "auto"}}, - {"type": "file", "file": {"file_id": "file-abc123"}} - ] -} -``` - -**Assistant Message with Tool Calls:** -```json -{ - "role": "assistant", - "content": null, - "tool_calls": [ - { - "id": "call_abc123", - "type": "function", - "function": { - "name": "get_weather", - "arguments": "{\"location\": \"San Francisco\"}" - } - } - ] -} -``` - -**Tool Result Message:** -```json -{ - "role": "tool", - "tool_call_id": "call_abc123", - "content": "{\"temperature\": 72, \"condition\": \"sunny\"}" -} -``` - -### Tool Definition - -```json -{ - "type": "function", - "function": { - "name": "get_weather", - "description": "Get the current weather", - "parameters": { - "type": "object", - "properties": { - "location": {"type": "string"} - }, - "required": ["location"] - }, - "strict": true - } -} -``` - ---- - -## Responses API (`/responses`) - -### Key Differences from Chat Completions - -| Feature | Chat Completions | Responses API | -|---------|-----------------|---------------| -| Message array | `messages` | `input` | -| Tool call ID field | `tool_call_id` | `call_id` | -| System message | In messages | `instructions` field or in input | -| Token limit | `max_tokens` | `max_output_tokens` | -| Reasoning | Not supported | `reasoning` config | - -### Request Structure - -```json -{ - "model": "gpt-4o", - "input": [...], - "instructions": "Optional system instructions", - "tools": [...], - "tool_choice": "auto" | "none" | "required" | {"type": "function", "name": "..."}, - "max_output_tokens": 4096, - "previous_response_id": "resp_abc123", - "reasoning": { - "effort": "medium", - "summary": "auto" - }, - "stream": false -} -``` - -## Thinking/Reasoning (Responses API only) - -### Request Configuration -```json -{ - "reasoning": { - "effort": "low" | "medium" | "high", - "summary": "auto" | "concise" | "detailed" - } -} -``` - -**Parameters:** -- `effort`: How much reasoning effort (affects token usage) -- `summary`: How to summarize reasoning in response - -**Constraints when reasoning enabled:** -- `temperature` is **NOT supported** (use default) -- `topP` is **NOT supported** -- Only available on reasoning models (o1, o3, etc.) - -### Response Output Items - -**Reasoning Item** (in output array): -```json -{ - "type": "reasoning", - "id": "reasoning_abc123", - "encrypted_content": "encrypted_base64_reasoning_content", - "summary": [ - {"type": "summary_text", "text": "I analyzed the problem by..."} - ] -} -``` - -**Key fields:** -- `encrypted_content`: The actual reasoning is encrypted/hidden -- `summary`: Optional human-readable summary of reasoning - -### Usage Tracking -```json -{ - "usage": { - "input_tokens": 100, - "output_tokens": 200, - "output_tokens_details": { - "reasoning_tokens": 150 - } - } -} -``` - -### SDK Conversion -The AI SDK handles reasoning items: -```typescript -// OpenAI Responses output -{type: "reasoning", id: "...", encrypted_content: "...", summary: [...]} - -// Kept as reasoning type in SDK -{type: "reasoning", reasoningId: "...", text: "summary text"} -``` - -### Context Pruning for Reasoning -- **Encrypted content** cannot be inspected or modified -- **Summaries** provide readable insight into reasoning -- Reasoning items appear as separate items in `output` array -- `reasoning_tokens` in usage helps track cost - ---- - -## Context Pruning Considerations - -1. **Tool correlation**: Both formats use ID-based correlation (`tool_call_id` or `call_id`) -2. **Paired pruning**: Tool calls and their results should be pruned together -3. **Message roles**: 4 distinct roles in Chat Completions; Responses API uses item types -4. **Content types**: User content is `type: "text"/"image_url"` in Chat, `type: "input_text"/"input_image"` in Responses -5. **Assistant content**: String in Chat Completions, `output_text` array in Responses - -## OpenAI-Compatible Providers - -Most providers in models.dev use the OpenAI Chat Completions format via `@ai-sdk/openai-compatible`: -- together, deepseek, groq, fireworks, hyperbolic, novita, cerebras, sambanova, etc. - -These providers accept the same request format but may have different: -- Supported models -- Rate limits -- Feature availability (vision, tool use, etc.) diff --git a/index.ts b/index.ts index 6b617c4..1046a76 100644 --- a/index.ts +++ b/index.ts @@ -1,9 +1,10 @@ import type { Plugin } from "@opencode-ai/plugin" +import type { Model } from "@opencode-ai/sdk" import { getConfig } from "./lib/config" import { Logger } from "./lib/logger" import { loadPrompt } from "./lib/prompt" import { createSessionState } from "./lib/state" -import { createPruneTool } from "./lib/strategies" +import { createDiscardTool, createExtractTool } from "./lib/strategies" import { createChatMessageTransformHandler, createEventHandler } from "./lib/hooks" const plugin: Plugin = (async (ctx) => { @@ -14,49 +15,97 @@ const plugin: Plugin = (async (ctx) => { } // Suppress AI SDK warnings - if (typeof globalThis !== 'undefined') { - (globalThis as any).AI_SDK_LOG_WARNINGS = false + if (typeof globalThis !== "undefined") { + ;(globalThis as any).AI_SDK_LOG_WARNINGS = false } - // Initialize core components const logger = new Logger(config.debug) const state = createSessionState() - // Log initialization logger.info("DCP initialized", { strategies: config.strategies, }) return { - "experimental.chat.system.transform": async (_input: unknown, output: { system: string[] }) => { - const syntheticPrompt = loadPrompt("synthetic") + "chat.params": async ( + input: { sessionID: string; agent: string; model: Model; provider: any; message: any }, + _output: { temperature: number; topP: number; options: Record }, + ) => { + const isReasoning = input.model.capabilities?.reasoning ?? false + if (state.isReasoningModel !== isReasoning) { + logger.info( + `Reasoning model status changed: ${state.isReasoningModel} -> ${isReasoning}`, + { + modelId: input.model.id, + providerId: input.model.providerID, + }, + ) + } + state.isReasoningModel = isReasoning + }, + "experimental.chat.system.transform": async ( + _input: unknown, + output: { system: string[] }, + ) => { + const discardEnabled = config.tools.discard.enabled + const extractEnabled = config.tools.extract.enabled + + let promptName: string + if (discardEnabled && extractEnabled) { + promptName = "system/system-prompt-both" + } else if (discardEnabled) { + promptName = "system/system-prompt-discard" + } else if (extractEnabled) { + promptName = "system/system-prompt-extract" + } else { + return + } + + const syntheticPrompt = loadPrompt(promptName) output.system.push(syntheticPrompt) }, "experimental.chat.messages.transform": createChatMessageTransformHandler( ctx.client, state, logger, - config + config, ), - tool: config.strategies.pruneTool.enabled ? { - prune: createPruneTool({ - client: ctx.client, - state, - logger, - config, - workingDirectory: ctx.directory + tool: { + ...(config.tools.discard.enabled && { + discard: createDiscardTool({ + client: ctx.client, + state, + logger, + config, + workingDirectory: ctx.directory, + }), + }), + ...(config.tools.extract.enabled && { + extract: createExtractTool({ + client: ctx.client, + state, + logger, + config, + workingDirectory: ctx.directory, + }), }), - } : undefined, + }, config: async (opencodeConfig) => { - // Add prune to primary_tools by mutating the opencode config + // Add enabled tools to primary_tools by mutating the opencode config // This works because config is cached and passed by reference - if (config.strategies.pruneTool.enabled) { + const toolsToAdd: string[] = [] + if (config.tools.discard.enabled) toolsToAdd.push("discard") + if (config.tools.extract.enabled) toolsToAdd.push("extract") + + if (toolsToAdd.length > 0) { const existingPrimaryTools = opencodeConfig.experimental?.primary_tools ?? [] opencodeConfig.experimental = { ...opencodeConfig.experimental, - primary_tools: [...existingPrimaryTools, "prune"], + primary_tools: [...existingPrimaryTools, ...toolsToAdd], } - logger.info("Added 'prune' to experimental.primary_tools via config mutation") + logger.info( + `Added ${toolsToAdd.map((t) => `'${t}'`).join(" and ")} to experimental.primary_tools via config mutation`, + ) } }, event: createEventHandler(ctx.client, config, state, logger, ctx.directory), diff --git a/lib/config.ts b/lib/config.ts index e1dbd1a..06a2d7a 100644 --- a/lib/config.ts +++ b/lib/config.ts @@ -1,8 +1,8 @@ -import { readFileSync, writeFileSync, existsSync, mkdirSync, statSync } from 'fs' -import { join, dirname } from 'path' -import { homedir } from 'os' -import { parse } from 'jsonc-parser' -import type { PluginInput } from '@opencode-ai/plugin' +import { readFileSync, writeFileSync, existsSync, mkdirSync, statSync } from "fs" +import { join, dirname } from "path" +import { homedir } from "os" +import { parse } from "jsonc-parser" +import type { PluginInput } from "@opencode-ai/plugin" export interface Deduplication { enabled: boolean @@ -17,73 +17,95 @@ export interface OnIdle { protectedTools: string[] } -export interface PruneToolNudge { +export interface DiscardTool { enabled: boolean - frequency: number } -export interface PruneTool { +export interface ExtractTool { enabled: boolean + showDistillation: boolean +} + +export interface ToolSettings { + nudgeEnabled: boolean + nudgeFrequency: number protectedTools: string[] - nudge: PruneToolNudge +} + +export interface Tools { + settings: ToolSettings + discard: DiscardTool + extract: ExtractTool } export interface SupersedeWrites { enabled: boolean } +export interface TurnProtection { + enabled: boolean + turns: number +} + export interface PluginConfig { enabled: boolean debug: boolean - pruningSummary: "off" | "minimal" | "detailed" + pruneNotification: "off" | "minimal" | "detailed" + turnProtection: TurnProtection + tools: Tools strategies: { deduplication: Deduplication onIdle: OnIdle - pruneTool: PruneTool supersedeWrites: SupersedeWrites } } -const DEFAULT_PROTECTED_TOOLS = ['task', 'todowrite', 'todoread', 'prune', 'batch'] +const DEFAULT_PROTECTED_TOOLS = ["task", "todowrite", "todoread", "discard", "extract", "batch"] // Valid config keys for validation against user config export const VALID_CONFIG_KEYS = new Set([ // Top-level keys - 'enabled', - 'debug', - 'showUpdateToasts', // Deprecated but kept for backwards compatibility - 'pruningSummary', - 'strategies', + "enabled", + "debug", + "showUpdateToasts", // Deprecated but kept for backwards compatibility + "pruneNotification", + "turnProtection", + "turnProtection.enabled", + "turnProtection.turns", + "tools", + "tools.settings", + "tools.settings.nudgeEnabled", + "tools.settings.nudgeFrequency", + "tools.settings.protectedTools", + "tools.discard", + "tools.discard.enabled", + "tools.extract", + "tools.extract.enabled", + "tools.extract.showDistillation", + "strategies", // strategies.deduplication - 'strategies.deduplication', - 'strategies.deduplication.enabled', - 'strategies.deduplication.protectedTools', + "strategies.deduplication", + "strategies.deduplication.enabled", + "strategies.deduplication.protectedTools", // strategies.supersedeWrites - 'strategies.supersedeWrites', - 'strategies.supersedeWrites.enabled', + "strategies.supersedeWrites", + "strategies.supersedeWrites.enabled", // strategies.onIdle - 'strategies.onIdle', - 'strategies.onIdle.enabled', - 'strategies.onIdle.model', - 'strategies.onIdle.showModelErrorToasts', - 'strategies.onIdle.strictModelSelection', - 'strategies.onIdle.protectedTools', - // strategies.pruneTool - 'strategies.pruneTool', - 'strategies.pruneTool.enabled', - 'strategies.pruneTool.protectedTools', - 'strategies.pruneTool.nudge', - 'strategies.pruneTool.nudge.enabled', - 'strategies.pruneTool.nudge.frequency' + "strategies.onIdle", + "strategies.onIdle.enabled", + "strategies.onIdle.model", + "strategies.onIdle.showModelErrorToasts", + "strategies.onIdle.strictModelSelection", + "strategies.onIdle.protectedTools", ]) // Extract all key paths from a config object for validation -function getConfigKeyPaths(obj: Record, prefix = ''): string[] { +function getConfigKeyPaths(obj: Record, prefix = ""): string[] { const keys: string[] = [] for (const key of Object.keys(obj)) { const fullKey = prefix ? `${prefix}.${key}` : key keys.push(fullKey) - if (obj[key] && typeof obj[key] === 'object' && !Array.isArray(obj[key])) { + if (obj[key] && typeof obj[key] === "object" && !Array.isArray(obj[key])) { keys.push(...getConfigKeyPaths(obj[key], fullKey)) } } @@ -93,7 +115,7 @@ function getConfigKeyPaths(obj: Record, prefix = ''): string[] { // Returns invalid keys found in user config export function getInvalidConfigKeys(userConfig: Record): string[] { const userKeys = getConfigKeyPaths(userConfig) - return userKeys.filter(key => !VALID_CONFIG_KEYS.has(key)) + return userKeys.filter((key) => !VALID_CONFIG_KEYS.has(key)) } // Type validators for config values @@ -107,16 +129,109 @@ function validateConfigTypes(config: Record): ValidationError[] { const errors: ValidationError[] = [] // Top-level validators - if (config.enabled !== undefined && typeof config.enabled !== 'boolean') { - errors.push({ key: 'enabled', expected: 'boolean', actual: typeof config.enabled }) + if (config.enabled !== undefined && typeof config.enabled !== "boolean") { + errors.push({ key: "enabled", expected: "boolean", actual: typeof config.enabled }) } - if (config.debug !== undefined && typeof config.debug !== 'boolean') { - errors.push({ key: 'debug', expected: 'boolean', actual: typeof config.debug }) + if (config.debug !== undefined && typeof config.debug !== "boolean") { + errors.push({ key: "debug", expected: "boolean", actual: typeof config.debug }) } - if (config.pruningSummary !== undefined) { - const validValues = ['off', 'minimal', 'detailed'] - if (!validValues.includes(config.pruningSummary)) { - errors.push({ key: 'pruningSummary', expected: '"off" | "minimal" | "detailed"', actual: JSON.stringify(config.pruningSummary) }) + if (config.pruneNotification !== undefined) { + const validValues = ["off", "minimal", "detailed"] + if (!validValues.includes(config.pruneNotification)) { + errors.push({ + key: "pruneNotification", + expected: '"off" | "minimal" | "detailed"', + actual: JSON.stringify(config.pruneNotification), + }) + } + } + + // Top-level turnProtection validator + if (config.turnProtection) { + if ( + config.turnProtection.enabled !== undefined && + typeof config.turnProtection.enabled !== "boolean" + ) { + errors.push({ + key: "turnProtection.enabled", + expected: "boolean", + actual: typeof config.turnProtection.enabled, + }) + } + if ( + config.turnProtection.turns !== undefined && + typeof config.turnProtection.turns !== "number" + ) { + errors.push({ + key: "turnProtection.turns", + expected: "number", + actual: typeof config.turnProtection.turns, + }) + } + } + + // Tools validators + const tools = config.tools + if (tools) { + if (tools.settings) { + if ( + tools.settings.nudgeEnabled !== undefined && + typeof tools.settings.nudgeEnabled !== "boolean" + ) { + errors.push({ + key: "tools.settings.nudgeEnabled", + expected: "boolean", + actual: typeof tools.settings.nudgeEnabled, + }) + } + if ( + tools.settings.nudgeFrequency !== undefined && + typeof tools.settings.nudgeFrequency !== "number" + ) { + errors.push({ + key: "tools.settings.nudgeFrequency", + expected: "number", + actual: typeof tools.settings.nudgeFrequency, + }) + } + if ( + tools.settings.protectedTools !== undefined && + !Array.isArray(tools.settings.protectedTools) + ) { + errors.push({ + key: "tools.settings.protectedTools", + expected: "string[]", + actual: typeof tools.settings.protectedTools, + }) + } + } + if (tools.discard) { + if (tools.discard.enabled !== undefined && typeof tools.discard.enabled !== "boolean") { + errors.push({ + key: "tools.discard.enabled", + expected: "boolean", + actual: typeof tools.discard.enabled, + }) + } + } + if (tools.extract) { + if (tools.extract.enabled !== undefined && typeof tools.extract.enabled !== "boolean") { + errors.push({ + key: "tools.extract.enabled", + expected: "boolean", + actual: typeof tools.extract.enabled, + }) + } + if ( + tools.extract.showDistillation !== undefined && + typeof tools.extract.showDistillation !== "boolean" + ) { + errors.push({ + key: "tools.extract.showDistillation", + expected: "boolean", + actual: typeof tools.extract.showDistillation, + }) + } } } @@ -124,54 +239,92 @@ function validateConfigTypes(config: Record): ValidationError[] { const strategies = config.strategies if (strategies) { // deduplication - if (strategies.deduplication?.enabled !== undefined && typeof strategies.deduplication.enabled !== 'boolean') { - errors.push({ key: 'strategies.deduplication.enabled', expected: 'boolean', actual: typeof strategies.deduplication.enabled }) + if ( + strategies.deduplication?.enabled !== undefined && + typeof strategies.deduplication.enabled !== "boolean" + ) { + errors.push({ + key: "strategies.deduplication.enabled", + expected: "boolean", + actual: typeof strategies.deduplication.enabled, + }) } - if (strategies.deduplication?.protectedTools !== undefined && !Array.isArray(strategies.deduplication.protectedTools)) { - errors.push({ key: 'strategies.deduplication.protectedTools', expected: 'string[]', actual: typeof strategies.deduplication.protectedTools }) + if ( + strategies.deduplication?.protectedTools !== undefined && + !Array.isArray(strategies.deduplication.protectedTools) + ) { + errors.push({ + key: "strategies.deduplication.protectedTools", + expected: "string[]", + actual: typeof strategies.deduplication.protectedTools, + }) } // onIdle if (strategies.onIdle) { - if (strategies.onIdle.enabled !== undefined && typeof strategies.onIdle.enabled !== 'boolean') { - errors.push({ key: 'strategies.onIdle.enabled', expected: 'boolean', actual: typeof strategies.onIdle.enabled }) - } - if (strategies.onIdle.model !== undefined && typeof strategies.onIdle.model !== 'string') { - errors.push({ key: 'strategies.onIdle.model', expected: 'string', actual: typeof strategies.onIdle.model }) - } - if (strategies.onIdle.showModelErrorToasts !== undefined && typeof strategies.onIdle.showModelErrorToasts !== 'boolean') { - errors.push({ key: 'strategies.onIdle.showModelErrorToasts', expected: 'boolean', actual: typeof strategies.onIdle.showModelErrorToasts }) + if ( + strategies.onIdle.enabled !== undefined && + typeof strategies.onIdle.enabled !== "boolean" + ) { + errors.push({ + key: "strategies.onIdle.enabled", + expected: "boolean", + actual: typeof strategies.onIdle.enabled, + }) } - if (strategies.onIdle.strictModelSelection !== undefined && typeof strategies.onIdle.strictModelSelection !== 'boolean') { - errors.push({ key: 'strategies.onIdle.strictModelSelection', expected: 'boolean', actual: typeof strategies.onIdle.strictModelSelection }) + if ( + strategies.onIdle.model !== undefined && + typeof strategies.onIdle.model !== "string" + ) { + errors.push({ + key: "strategies.onIdle.model", + expected: "string", + actual: typeof strategies.onIdle.model, + }) } - if (strategies.onIdle.protectedTools !== undefined && !Array.isArray(strategies.onIdle.protectedTools)) { - errors.push({ key: 'strategies.onIdle.protectedTools', expected: 'string[]', actual: typeof strategies.onIdle.protectedTools }) - } - } - - // pruneTool - if (strategies.pruneTool) { - if (strategies.pruneTool.enabled !== undefined && typeof strategies.pruneTool.enabled !== 'boolean') { - errors.push({ key: 'strategies.pruneTool.enabled', expected: 'boolean', actual: typeof strategies.pruneTool.enabled }) + if ( + strategies.onIdle.showModelErrorToasts !== undefined && + typeof strategies.onIdle.showModelErrorToasts !== "boolean" + ) { + errors.push({ + key: "strategies.onIdle.showModelErrorToasts", + expected: "boolean", + actual: typeof strategies.onIdle.showModelErrorToasts, + }) } - if (strategies.pruneTool.protectedTools !== undefined && !Array.isArray(strategies.pruneTool.protectedTools)) { - errors.push({ key: 'strategies.pruneTool.protectedTools', expected: 'string[]', actual: typeof strategies.pruneTool.protectedTools }) + if ( + strategies.onIdle.strictModelSelection !== undefined && + typeof strategies.onIdle.strictModelSelection !== "boolean" + ) { + errors.push({ + key: "strategies.onIdle.strictModelSelection", + expected: "boolean", + actual: typeof strategies.onIdle.strictModelSelection, + }) } - if (strategies.pruneTool.nudge) { - if (strategies.pruneTool.nudge.enabled !== undefined && typeof strategies.pruneTool.nudge.enabled !== 'boolean') { - errors.push({ key: 'strategies.pruneTool.nudge.enabled', expected: 'boolean', actual: typeof strategies.pruneTool.nudge.enabled }) - } - if (strategies.pruneTool.nudge.frequency !== undefined && typeof strategies.pruneTool.nudge.frequency !== 'number') { - errors.push({ key: 'strategies.pruneTool.nudge.frequency', expected: 'number', actual: typeof strategies.pruneTool.nudge.frequency }) - } + if ( + strategies.onIdle.protectedTools !== undefined && + !Array.isArray(strategies.onIdle.protectedTools) + ) { + errors.push({ + key: "strategies.onIdle.protectedTools", + expected: "string[]", + actual: typeof strategies.onIdle.protectedTools, + }) } } // supersedeWrites if (strategies.supersedeWrites) { - if (strategies.supersedeWrites.enabled !== undefined && typeof strategies.supersedeWrites.enabled !== 'boolean') { - errors.push({ key: 'strategies.supersedeWrites.enabled', expected: 'boolean', actual: typeof strategies.supersedeWrites.enabled }) + if ( + strategies.supersedeWrites.enabled !== undefined && + typeof strategies.supersedeWrites.enabled !== "boolean" + ) { + errors.push({ + key: "strategies.supersedeWrites.enabled", + expected: "boolean", + actual: typeof strategies.supersedeWrites.enabled, + }) } } } @@ -184,7 +337,7 @@ function showConfigValidationWarnings( ctx: PluginInput, configPath: string, configData: Record, - isProject: boolean + isProject: boolean, ): void { const invalidKeys = getInvalidConfigKeys(configData) const typeErrors = validateConfigTypes(configData) @@ -193,12 +346,12 @@ function showConfigValidationWarnings( return } - const configType = isProject ? 'project config' : 'config' + const configType = isProject ? "project config" : "config" const messages: string[] = [] if (invalidKeys.length > 0) { - const keyList = invalidKeys.slice(0, 3).join(', ') - const suffix = invalidKeys.length > 3 ? ` (+${invalidKeys.length - 3} more)` : '' + const keyList = invalidKeys.slice(0, 3).join(", ") + const suffix = invalidKeys.length > 3 ? ` (+${invalidKeys.length - 3} more)` : "" messages.push(`Unknown keys: ${keyList}${suffix}`) } @@ -216,10 +369,10 @@ function showConfigValidationWarnings( ctx.client.tui.showToast({ body: { title: `DCP: Invalid ${configType}`, - message: `${configPath}\n${messages.join('\n')}`, + message: `${configPath}\n${messages.join("\n")}`, variant: "warning", - duration: 7000 - } + duration: 7000, + }, }) } catch {} }, 7000) @@ -228,40 +381,50 @@ function showConfigValidationWarnings( const defaultConfig: PluginConfig = { enabled: true, debug: false, - pruningSummary: 'detailed', + pruneNotification: "detailed", + turnProtection: { + enabled: false, + turns: 4, + }, + tools: { + settings: { + nudgeEnabled: true, + nudgeFrequency: 10, + protectedTools: [...DEFAULT_PROTECTED_TOOLS], + }, + discard: { + enabled: true, + }, + extract: { + enabled: true, + showDistillation: false, + }, + }, strategies: { deduplication: { enabled: true, - protectedTools: [...DEFAULT_PROTECTED_TOOLS] + protectedTools: [...DEFAULT_PROTECTED_TOOLS], }, supersedeWrites: { - enabled: true - }, - pruneTool: { enabled: true, - protectedTools: [...DEFAULT_PROTECTED_TOOLS], - nudge: { - enabled: true, - frequency: 10 - } }, onIdle: { enabled: false, protectedTools: [...DEFAULT_PROTECTED_TOOLS], showModelErrorToasts: true, - strictModelSelection: false - } - } + strictModelSelection: false, + }, + }, } -const GLOBAL_CONFIG_DIR = join(homedir(), '.config', 'opencode') -const GLOBAL_CONFIG_PATH_JSONC = join(GLOBAL_CONFIG_DIR, 'dcp.jsonc') -const GLOBAL_CONFIG_PATH_JSON = join(GLOBAL_CONFIG_DIR, 'dcp.json') +const GLOBAL_CONFIG_DIR = join(homedir(), ".config", "opencode") +const GLOBAL_CONFIG_PATH_JSONC = join(GLOBAL_CONFIG_DIR, "dcp.jsonc") +const GLOBAL_CONFIG_PATH_JSON = join(GLOBAL_CONFIG_DIR, "dcp.json") function findOpencodeDir(startDir: string): string | null { let current = startDir - while (current !== '/') { - const candidate = join(current, '.opencode') + while (current !== "/") { + const candidate = join(current, ".opencode") if (existsSync(candidate) && statSync(candidate).isDirectory()) { return candidate } @@ -272,7 +435,11 @@ function findOpencodeDir(startDir: string): string | null { return null } -function getConfigPaths(ctx?: PluginInput): { global: string | null, configDir: string | null, project: string | null} { +function getConfigPaths(ctx?: PluginInput): { + global: string | null + configDir: string | null + project: string | null +} { // Global: ~/.config/opencode/dcp.jsonc|json let globalPath: string | null = null if (existsSync(GLOBAL_CONFIG_PATH_JSONC)) { @@ -285,8 +452,8 @@ function getConfigPaths(ctx?: PluginInput): { global: string | null, configDir: let configDirPath: string | null = null const opencodeConfigDir = process.env.OPENCODE_CONFIG_DIR if (opencodeConfigDir) { - const configJsonc = join(opencodeConfigDir, 'dcp.jsonc') - const configJson = join(opencodeConfigDir, 'dcp.json') + const configJsonc = join(opencodeConfigDir, "dcp.jsonc") + const configJson = join(opencodeConfigDir, "dcp.json") if (existsSync(configJsonc)) { configDirPath = configJsonc } else if (existsSync(configJson)) { @@ -299,8 +466,8 @@ function getConfigPaths(ctx?: PluginInput): { global: string | null, configDir: if (ctx?.directory) { const opencodeDir = findOpencodeDir(ctx.directory) if (opencodeDir) { - const projectJsonc = join(opencodeDir, 'dcp.jsonc') - const projectJson = join(opencodeDir, 'dcp.json') + const projectJsonc = join(opencodeDir, "dcp.jsonc") + const projectJson = join(opencodeDir, "dcp.json") if (existsSync(projectJsonc)) { projectPath = projectJsonc } else if (existsSync(projectJson)) { @@ -322,9 +489,35 @@ function createDefaultConfig(): void { "enabled": true, // Enable debug logging to ~/.config/opencode/logs/dcp/ "debug": false, - // Summary display: "off", "minimal", or "detailed" - "pruningSummary": "detailed", - // Strategies for pruning tokens from chat history + // Notification display: "off", "minimal", or "detailed" + "pruneNotification": "detailed", + // Protect from pruning for message turns + "turnProtection": { + "enabled": false, + "turns": 4 + }, + // LLM-driven context pruning tools + "tools": { + // Shared settings for all prune tools + "settings": { + // Nudge the LLM to use prune tools (every tool results) + "nudgeEnabled": true, + "nudgeFrequency": 10, + // Additional tools to protect from pruning + "protectedTools": [] + }, + // Removes tool content from context without preservation (for completed tasks or noise) + "discard": { + "enabled": true + }, + // Distills key findings into preserved knowledge before removing raw content + "extract": { + "enabled": true, + // Show distillation content as an ignored message notification + "showDistillation": false + } + }, + // Automatic pruning strategies "strategies": { // Remove duplicate tool calls (same tool with same arguments) "deduplication": { @@ -336,17 +529,6 @@ function createDefaultConfig(): void { "supersedeWrites": { "enabled": true }, - // Exposes a prune tool to your LLM to call when it determines pruning is necessary - "pruneTool": { - "enabled": true, - // Additional tools to protect from pruning - "protectedTools": [], - // Nudge the LLM to use the prune tool (every tool results) - "nudge": { - "enabled": true, - "frequency": 10 - } - }, // (Legacy) Run an LLM to analyze what tool calls are no longer relevant on idle "onIdle": { "enabled": false, @@ -362,7 +544,7 @@ function createDefaultConfig(): void { } } ` - writeFileSync(GLOBAL_CONFIG_PATH_JSONC, configContent, 'utf-8') + writeFileSync(GLOBAL_CONFIG_PATH_JSONC, configContent, "utf-8") } interface ConfigLoadResult { @@ -373,7 +555,7 @@ interface ConfigLoadResult { function loadConfigFile(configPath: string): ConfigLoadResult { let fileContent: string try { - fileContent = readFileSync(configPath, 'utf-8') + fileContent = readFileSync(configPath, "utf-8") } catch { // File doesn't exist or can't be read - not a parse error return { data: null } @@ -382,18 +564,18 @@ function loadConfigFile(configPath: string): ConfigLoadResult { try { const parsed = parse(fileContent) if (parsed === undefined || parsed === null) { - return { data: null, parseError: 'Config file is empty or invalid' } + return { data: null, parseError: "Config file is empty or invalid" } } return { data: parsed } } catch (error: any) { - return { data: null, parseError: error.message || 'Failed to parse config' } + return { data: null, parseError: error.message || "Failed to parse config" } } } function mergeStrategies( - base: PluginConfig['strategies'], - override?: Partial -): PluginConfig['strategies'] { + base: PluginConfig["strategies"], + override?: Partial, +): PluginConfig["strategies"] { if (!override) return base return { @@ -402,66 +584,85 @@ function mergeStrategies( protectedTools: [ ...new Set([ ...base.deduplication.protectedTools, - ...(override.deduplication?.protectedTools ?? []) - ]) - ] + ...(override.deduplication?.protectedTools ?? []), + ]), + ], }, onIdle: { enabled: override.onIdle?.enabled ?? base.onIdle.enabled, model: override.onIdle?.model ?? base.onIdle.model, - showModelErrorToasts: override.onIdle?.showModelErrorToasts ?? base.onIdle.showModelErrorToasts, - strictModelSelection: override.onIdle?.strictModelSelection ?? base.onIdle.strictModelSelection, + showModelErrorToasts: + override.onIdle?.showModelErrorToasts ?? base.onIdle.showModelErrorToasts, + strictModelSelection: + override.onIdle?.strictModelSelection ?? base.onIdle.strictModelSelection, protectedTools: [ ...new Set([ ...base.onIdle.protectedTools, - ...(override.onIdle?.protectedTools ?? []) - ]) - ] + ...(override.onIdle?.protectedTools ?? []), + ]), + ], }, - pruneTool: { - enabled: override.pruneTool?.enabled ?? base.pruneTool.enabled, + supersedeWrites: { + enabled: override.supersedeWrites?.enabled ?? base.supersedeWrites.enabled, + }, + } +} + +function mergeTools( + base: PluginConfig["tools"], + override?: Partial, +): PluginConfig["tools"] { + if (!override) return base + + return { + settings: { + nudgeEnabled: override.settings?.nudgeEnabled ?? base.settings.nudgeEnabled, + nudgeFrequency: override.settings?.nudgeFrequency ?? base.settings.nudgeFrequency, protectedTools: [ ...new Set([ - ...base.pruneTool.protectedTools, - ...(override.pruneTool?.protectedTools ?? []) - ]) + ...base.settings.protectedTools, + ...(override.settings?.protectedTools ?? []), + ]), ], - nudge: { - enabled: override.pruneTool?.nudge?.enabled ?? base.pruneTool.nudge.enabled, - frequency: override.pruneTool?.nudge?.frequency ?? base.pruneTool.nudge.frequency - } }, - supersedeWrites: { - enabled: override.supersedeWrites?.enabled ?? base.supersedeWrites.enabled - } + discard: { + enabled: override.discard?.enabled ?? base.discard.enabled, + }, + extract: { + enabled: override.extract?.enabled ?? base.extract.enabled, + showDistillation: override.extract?.showDistillation ?? base.extract.showDistillation, + }, } } function deepCloneConfig(config: PluginConfig): PluginConfig { return { ...config, + turnProtection: { ...config.turnProtection }, + tools: { + settings: { + ...config.tools.settings, + protectedTools: [...config.tools.settings.protectedTools], + }, + discard: { ...config.tools.discard }, + extract: { ...config.tools.extract }, + }, strategies: { deduplication: { ...config.strategies.deduplication, - protectedTools: [...config.strategies.deduplication.protectedTools] + protectedTools: [...config.strategies.deduplication.protectedTools], }, onIdle: { ...config.strategies.onIdle, - protectedTools: [...config.strategies.onIdle.protectedTools] - }, - pruneTool: { - ...config.strategies.pruneTool, - protectedTools: [...config.strategies.pruneTool.protectedTools], - nudge: { ...config.strategies.pruneTool.nudge } + protectedTools: [...config.strategies.onIdle.protectedTools], }, supersedeWrites: { - ...config.strategies.supersedeWrites - } - } + ...config.strategies.supersedeWrites, + }, + }, } } - export function getConfig(ctx: PluginInput): PluginConfig { let config = deepCloneConfig(defaultConfig) const configPaths = getConfigPaths(ctx) @@ -477,8 +678,8 @@ export function getConfig(ctx: PluginInput): PluginConfig { title: "DCP: Invalid config", message: `${configPaths.global}\n${result.parseError}\nUsing default values`, variant: "warning", - duration: 7000 - } + duration: 7000, + }, }) } catch {} }, 7000) @@ -488,8 +689,13 @@ export function getConfig(ctx: PluginInput): PluginConfig { config = { enabled: result.data.enabled ?? config.enabled, debug: result.data.debug ?? config.debug, - pruningSummary: result.data.pruningSummary ?? config.pruningSummary, - strategies: mergeStrategies(config.strategies, result.data.strategies as any) + pruneNotification: result.data.pruneNotification ?? config.pruneNotification, + turnProtection: { + enabled: result.data.turnProtection?.enabled ?? config.turnProtection.enabled, + turns: result.data.turnProtection?.turns ?? config.turnProtection.turns, + }, + tools: mergeTools(config.tools, result.data.tools as any), + strategies: mergeStrategies(config.strategies, result.data.strategies as any), } } } else { @@ -508,8 +714,8 @@ export function getConfig(ctx: PluginInput): PluginConfig { title: "DCP: Invalid configDir config", message: `${configPaths.configDir}\n${result.parseError}\nUsing global/default values`, variant: "warning", - duration: 7000 - } + duration: 7000, + }, }) } catch {} }, 7000) @@ -519,8 +725,13 @@ export function getConfig(ctx: PluginInput): PluginConfig { config = { enabled: result.data.enabled ?? config.enabled, debug: result.data.debug ?? config.debug, - pruningSummary: result.data.pruningSummary ?? config.pruningSummary, - strategies: mergeStrategies(config.strategies, result.data.strategies as any) + pruneNotification: result.data.pruneNotification ?? config.pruneNotification, + turnProtection: { + enabled: result.data.turnProtection?.enabled ?? config.turnProtection.enabled, + turns: result.data.turnProtection?.turns ?? config.turnProtection.turns, + }, + tools: mergeTools(config.tools, result.data.tools as any), + strategies: mergeStrategies(config.strategies, result.data.strategies as any), } } } @@ -536,8 +747,8 @@ export function getConfig(ctx: PluginInput): PluginConfig { title: "DCP: Invalid project config", message: `${configPaths.project}\n${result.parseError}\nUsing global/default values`, variant: "warning", - duration: 7000 - } + duration: 7000, + }, }) } catch {} }, 7000) @@ -547,8 +758,13 @@ export function getConfig(ctx: PluginInput): PluginConfig { config = { enabled: result.data.enabled ?? config.enabled, debug: result.data.debug ?? config.debug, - pruningSummary: result.data.pruningSummary ?? config.pruningSummary, - strategies: mergeStrategies(config.strategies, result.data.strategies as any) + pruneNotification: result.data.pruneNotification ?? config.pruneNotification, + turnProtection: { + enabled: result.data.turnProtection?.enabled ?? config.turnProtection.enabled, + turns: result.data.turnProtection?.turns ?? config.turnProtection.turns, + }, + tools: mergeTools(config.tools, result.data.tools as any), + strategies: mergeStrategies(config.strategies, result.data.strategies as any), } } } diff --git a/lib/hooks.ts b/lib/hooks.ts index c578e4b..be9e851 100644 --- a/lib/hooks.ts +++ b/lib/hooks.ts @@ -7,24 +7,20 @@ import { prune, insertPruneToolContext } from "./messages" import { checkSession } from "./state" import { runOnIdle } from "./strategies/on-idle" - export function createChatMessageTransformHandler( client: any, state: SessionState, logger: Logger, - config: PluginConfig + config: PluginConfig, ) { - return async ( - input: {}, - output: { messages: WithParts[] } - ) => { + return async (input: {}, output: { messages: WithParts[] }) => { await checkSession(client, state, logger, output.messages) if (state.isSubAgent) { return } - syncToolCache(state, config, logger, output.messages); + syncToolCache(state, config, logger, output.messages) deduplicate(state, logger, config, output.messages) supersedeWrites(state, logger, config, output.messages) @@ -32,6 +28,10 @@ export function createChatMessageTransformHandler( prune(state, logger, config, output.messages) insertPruneToolContext(state, config, logger, output.messages) + + if (state.sessionId) { + await logger.saveContext(state.sessionId, output.messages) + } } } @@ -40,11 +40,9 @@ export function createEventHandler( config: PluginConfig, state: SessionState, logger: Logger, - workingDirectory?: string + workingDirectory?: string, ) { - return async ( - { event }: { event: any } - ) => { + return async ({ event }: { event: any }) => { if (state.sessionId === null || state.isSubAgent) { return } @@ -59,13 +57,7 @@ export function createEventHandler( } try { - await runOnIdle( - client, - state, - logger, - config, - workingDirectory - ) + await runOnIdle(client, state, logger, config, workingDirectory) } catch (err: any) { logger.error("OnIdle pruning failed", { error: err.message }) } diff --git a/lib/logger.ts b/lib/logger.ts index 0081db1..c86a53d 100644 --- a/lib/logger.ts +++ b/lib/logger.ts @@ -29,15 +29,15 @@ export class Logger { // Format arrays compactly if (Array.isArray(value)) { if (value.length === 0) continue - parts.push(`${key}=[${value.slice(0, 3).join(",")}${value.length > 3 ? `...+${value.length - 3}` : ""}]`) - } - else if (typeof value === 'object') { + parts.push( + `${key}=[${value.slice(0, 3).join(",")}${value.length > 3 ? `...+${value.length - 3}` : ""}]`, + ) + } else if (typeof value === "object") { const str = JSON.stringify(value) if (str.length < 50) { parts.push(`${key}=${str}`) } - } - else { + } else { parts.push(`${key}=${value}`) } } @@ -55,15 +55,15 @@ export class Logger { // Skip specified number of frames to get to actual caller for (let i = skipFrames; i < stack.length; i++) { const filename = stack[i]?.getFileName() - if (filename && !filename.includes('/logger.')) { + if (filename && !filename.includes("/logger.")) { // Extract just the filename without path and extension const match = filename.match(/([^/\\]+)\.[tj]s$/) return match ? match[1] : filename } } - return 'unknown' + return "unknown" } catch { - return 'unknown' + return "unknown" } } @@ -83,10 +83,9 @@ export class Logger { await mkdir(dailyLogDir, { recursive: true }) } - const logFile = join(dailyLogDir, `${new Date().toISOString().split('T')[0]}.log`) + const logFile = join(dailyLogDir, `${new Date().toISOString().split("T")[0]}.log`) await writeFile(logFile, logLine, { flag: "a" }) - } catch (error) { - } + } catch (error) {} } info(message: string, data?: any) { @@ -108,4 +107,99 @@ export class Logger { const component = this.getCallerFile(2) return this.write("ERROR", component, message, data) } + + /** + * Strips unnecessary metadata from messages for cleaner debug logs. + * + * Removed: + * - All IDs (id, sessionID, messageID, parentID, callID on parts) + * - summary, path, cost, model, agent, mode, finish, providerID, modelID + * - step-start and step-finish parts entirely + * - snapshot fields + * - ignored text parts + * + * Kept: + * - role, time (created only), tokens (input, output, reasoning, cache) + * - text, reasoning, tool parts with content + * - tool calls with: tool, callID, input, output + */ + private minimizeForDebug(messages: any[]): any[] { + return messages.map((msg) => { + const minimized: any = { + role: msg.info?.role, + } + + if (msg.info?.time?.created) { + minimized.time = msg.info.time.created + } + + if (msg.info?.tokens) { + minimized.tokens = { + input: msg.info.tokens.input, + output: msg.info.tokens.output, + reasoning: msg.info.tokens.reasoning, + cache: msg.info.tokens.cache, + } + } + + if (msg.parts) { + minimized.parts = msg.parts + .map((part: any) => { + if (part.type === "step-start" || part.type === "step-finish") { + return null + } + + if (part.type === "text") { + if (part.ignored) return null + return { type: "text", text: part.text } + } + + if (part.type === "reasoning") { + return { + type: "reasoning", + text: part.text, + } + } + + if (part.type === "tool") { + const toolPart: any = { + type: "tool", + tool: part.tool, + callID: part.callID, + } + + if (part.state?.input) { + toolPart.input = part.state.input + } + if (part.state?.output) { + toolPart.output = part.state.output + } + + return toolPart + } + + return null + }) + .filter(Boolean) + } + + return minimized + }) + } + + async saveContext(sessionId: string, messages: any[]) { + if (!this.enabled) return + + try { + const contextDir = join(this.logDir, "context", sessionId) + if (!existsSync(contextDir)) { + await mkdir(contextDir, { recursive: true }) + } + + const minimized = this.minimizeForDebug(messages) + const timestamp = new Date().toISOString().replace(/[:.]/g, "-") + const contextFile = join(contextDir, `${timestamp}.json`) + await writeFile(contextFile, JSON.stringify(minimized, null, 2)) + } catch (error) {} + } } diff --git a/lib/messages/prune.ts b/lib/messages/prune.ts index fef5635..bdca0c1 100644 --- a/lib/messages/prune.ts +++ b/lib/messages/prune.ts @@ -3,12 +3,55 @@ import type { Logger } from "../logger" import type { PluginConfig } from "../config" import { loadPrompt } from "../prompt" import { extractParameterKey, buildToolIdList } from "./utils" -import { getLastUserMessage, isMessageCompacted } from "../shared-utils" -import { UserMessage } from "@opencode-ai/sdk" +import { getLastAssistantMessage, getLastUserMessage, isMessageCompacted } from "../shared-utils" +import { AssistantMessage, UserMessage } from "@opencode-ai/sdk" -const PRUNED_TOOL_INPUT_REPLACEMENT = '[Input removed to save context]' -const PRUNED_TOOL_OUTPUT_REPLACEMENT = '[Output removed to save context - information superseded or no longer needed]' -const NUDGE_STRING = loadPrompt("nudge") +const PRUNED_TOOL_INPUT_REPLACEMENT = + "[content removed to save context, this is not what was written to the file, but a placeholder]" +const PRUNED_TOOL_OUTPUT_REPLACEMENT = + "[Output removed to save context - information superseded or no longer needed]" +const getNudgeString = (config: PluginConfig): string => { + const discardEnabled = config.tools.discard.enabled + const extractEnabled = config.tools.extract.enabled + + if (discardEnabled && extractEnabled) { + return loadPrompt("nudge/nudge-both") + } else if (discardEnabled) { + return loadPrompt("nudge/nudge-discard") + } else if (extractEnabled) { + return loadPrompt("nudge/nudge-extract") + } + return "" +} + +const wrapPrunableTools = (content: string): string => ` +I have the following tool outputs available for pruning. I should consider my current goals and the resources I need before discarding valuable inputs or outputs. I should consolidate prunes for efficiency; it is rarely worth pruning a single tiny tool output. +${content} +` + +const getCooldownMessage = (config: PluginConfig): string => { + const discardEnabled = config.tools.discard.enabled + const extractEnabled = config.tools.extract.enabled + + let toolName: string + if (discardEnabled && extractEnabled) { + toolName = "discard or extract tools" + } else if (discardEnabled) { + toolName = "discard tool" + } else { + toolName = "extract tool" + } + + return ` +I just performed context management. I will not use the ${toolName} again until after my next tool use, when a fresh list will be available. +` +} + +const SYNTHETIC_MESSAGE_ID = "msg_01234567890123456789012345" +const SYNTHETIC_PART_ID = "prt_01234567890123456789012345" +const SYNTHETIC_USER_MESSAGE_ID = "msg_01234567890123456789012346" +const SYNTHETIC_USER_PART_ID = "prt_01234567890123456789012346" +const REASONING_MODEL_USER_MESSAGE_CONTENT = "[internal: context sync - no response needed]" const buildPrunableToolsList = ( state: SessionState, @@ -23,132 +66,180 @@ const buildPrunableToolsList = ( if (state.prune.toolIds.includes(toolCallId)) { return } - if (config.strategies.pruneTool.protectedTools.includes(toolParameterEntry.tool)) { + const allProtectedTools = config.tools.settings.protectedTools + if (allProtectedTools.includes(toolParameterEntry.tool)) { return } const numericId = toolIdList.indexOf(toolCallId) if (numericId === -1) { - logger.warn(`Tool in cache but not in toolIdList - possible stale entry`, { toolCallId, tool: toolParameterEntry.tool }) + logger.warn(`Tool in cache but not in toolIdList - possible stale entry`, { + toolCallId, + tool: toolParameterEntry.tool, + }) return } const paramKey = extractParameterKey(toolParameterEntry.tool, toolParameterEntry.parameters) - const description = paramKey ? `${toolParameterEntry.tool}, ${paramKey}` : toolParameterEntry.tool + const description = paramKey + ? `${toolParameterEntry.tool}, ${paramKey}` + : toolParameterEntry.tool lines.push(`${numericId}: ${description}`) - logger.debug(`Prunable tool found - ID: ${numericId}, Tool: ${toolParameterEntry.tool}, Call ID: ${toolCallId}`) + logger.debug( + `Prunable tool found - ID: ${numericId}, Tool: ${toolParameterEntry.tool}, Call ID: ${toolCallId}`, + ) }) if (lines.length === 0) { return "" } - return `\nThe following tools have been invoked and are available for pruning. This list does not mandate immediate action. Consider your current goals and the resources you need before discarding valuable tool inputs or outputs. Keep the context free of noise.\n${lines.join('\n')}\n` + return wrapPrunableTools(lines.join("\n")) } export const insertPruneToolContext = ( state: SessionState, config: PluginConfig, logger: Logger, - messages: WithParts[] + messages: WithParts[], ): void => { - if (!config.strategies.pruneTool.enabled) { + if (!config.tools.discard.enabled && !config.tools.extract.enabled) { return } - const lastUserMessage = getLastUserMessage(messages) - if (!lastUserMessage) { + const lastAssistantMessage = getLastAssistantMessage(messages) + if (!lastAssistantMessage) { return } - const prunableToolsList = buildPrunableToolsList(state, config, logger, messages) - if (!prunableToolsList) { - return - } + let prunableToolsContent: string + + if (state.lastToolPrune) { + logger.debug("Last tool was prune - injecting cooldown message") + prunableToolsContent = getCooldownMessage(config) + } else { + const prunableToolsList = buildPrunableToolsList(state, config, logger, messages) + if (!prunableToolsList) { + return + } + + logger.debug("prunable-tools: \n" + prunableToolsList) - let nudgeString = "" - if (state.nudgeCounter >= config.strategies.pruneTool.nudge.frequency) { - logger.info("Inserting prune nudge message") - nudgeString = "\n" + NUDGE_STRING + let nudgeString = "" + if ( + config.tools.settings.nudgeEnabled && + state.nudgeCounter >= config.tools.settings.nudgeFrequency + ) { + logger.info("Inserting prune nudge message") + nudgeString = "\n" + getNudgeString(config) + } + + prunableToolsContent = prunableToolsList + nudgeString } - const userMessage: WithParts = { + const assistantInfo = lastAssistantMessage.info as AssistantMessage + const assistantMessage: WithParts = { info: { - id: "msg_01234567890123456789012345", - sessionID: lastUserMessage.info.sessionID, - role: "user", + id: SYNTHETIC_MESSAGE_ID, + sessionID: assistantInfo.sessionID, + role: "assistant", + parentID: assistantInfo.parentID, + modelID: assistantInfo.modelID, + providerID: assistantInfo.providerID, time: { created: Date.now() }, - agent: (lastUserMessage.info as UserMessage).agent || "build", - model: { - providerID: (lastUserMessage.info as UserMessage).model.providerID, - modelID: (lastUserMessage.info as UserMessage).model.modelID - } + tokens: { input: 0, output: 0, reasoning: 0, cache: { read: 0, write: 0 } }, + cost: 0, + path: assistantInfo.path, + mode: assistantInfo.mode, }, parts: [ { - id: "prt_01234567890123456789012345", - sessionID: lastUserMessage.info.sessionID, - messageID: "msg_01234567890123456789012345", + id: SYNTHETIC_PART_ID, + sessionID: assistantInfo.sessionID, + messageID: SYNTHETIC_MESSAGE_ID, type: "text", - text: prunableToolsList + nudgeString, - } - ] + text: prunableToolsContent, + }, + ], } - messages.push(userMessage) + messages.push(assistantMessage) + + // For reasoning models, append a synthetic user message to close the assistant turn. + if (state.isReasoningModel) { + const lastRealUserMessage = getLastUserMessage(messages) + const userMessageInfo = lastRealUserMessage?.info as UserMessage | undefined + + const userMessage: WithParts = { + info: { + id: SYNTHETIC_USER_MESSAGE_ID, + sessionID: assistantInfo.sessionID, + role: "user", + time: { created: Date.now() + 1 }, + agent: userMessageInfo?.agent ?? "code", + model: userMessageInfo?.model ?? { + providerID: assistantInfo.providerID, + modelID: assistantInfo.modelID, + }, + } as UserMessage, + parts: [ + { + id: SYNTHETIC_USER_PART_ID, + sessionID: assistantInfo.sessionID, + messageID: SYNTHETIC_USER_MESSAGE_ID, + type: "text", + text: REASONING_MODEL_USER_MESSAGE_CONTENT, + }, + ], + } + messages.push(userMessage) + logger.debug("Appended synthetic user message for reasoning model") + } } export const prune = ( state: SessionState, logger: Logger, config: PluginConfig, - messages: WithParts[] + messages: WithParts[], ): void => { pruneToolOutputs(state, logger, messages) pruneToolInputs(state, logger, messages) } -const pruneToolOutputs = ( - state: SessionState, - logger: Logger, - messages: WithParts[] -): void => { +const pruneToolOutputs = (state: SessionState, logger: Logger, messages: WithParts[]): void => { for (const msg of messages) { if (isMessageCompacted(state, msg)) { continue } for (const part of msg.parts) { - if (part.type !== 'tool') { + if (part.type !== "tool") { continue } if (!state.prune.toolIds.includes(part.callID)) { continue } // Skip write and edit tools - their inputs are pruned instead - if (part.tool === 'write' || part.tool === 'edit') { + if (part.tool === "write" || part.tool === "edit") { continue } - if (part.state.status === 'completed') { + if (part.state.status === "completed") { part.state.output = PRUNED_TOOL_OUTPUT_REPLACEMENT } } } } -const pruneToolInputs = ( - state: SessionState, - logger: Logger, - messages: WithParts[] -): void => { +const pruneToolInputs = (state: SessionState, logger: Logger, messages: WithParts[]): void => { for (const msg of messages) { for (const part of msg.parts) { - if (part.type !== 'tool') { + if (part.type !== "tool") { continue } if (!state.prune.toolIds.includes(part.callID)) { continue } // Only prune inputs for write and edit tools - if (part.tool !== 'write' && part.tool !== 'edit') { + if (part.tool !== "write" && part.tool !== "edit") { continue } // Don't prune yet if tool is still pending or running @@ -156,9 +247,18 @@ const pruneToolInputs = ( continue } - if (part.state.input?.content !== undefined) { + // Write tool has content field, edit tool has oldString/newString fields + if (part.tool === "write" && part.state.input?.content !== undefined) { part.state.input.content = PRUNED_TOOL_INPUT_REPLACEMENT } + if (part.tool === "edit") { + if (part.state.input?.oldString !== undefined) { + part.state.input.oldString = PRUNED_TOOL_INPUT_REPLACEMENT + } + if (part.state.input?.newString !== undefined) { + part.state.input.newString = PRUNED_TOOL_INPUT_REPLACEMENT + } + } } } } diff --git a/lib/messages/utils.ts b/lib/messages/utils.ts index 48f453c..cbf497d 100644 --- a/lib/messages/utils.ts +++ b/lib/messages/utils.ts @@ -6,7 +6,7 @@ import type { SessionState, WithParts } from "../state" * Extracts a human-readable key from tool metadata for display purposes. */ export const extractParameterKey = (tool: string, parameters: any): string => { - if (!parameters) return '' + if (!parameters) return "" if (tool === "read" && parameters.filePath) { return parameters.filePath @@ -19,21 +19,21 @@ export const extractParameterKey = (tool: string, parameters: any): string => { } if (tool === "list") { - return parameters.path || '(current directory)' + return parameters.path || "(current directory)" } if (tool === "glob") { if (parameters.pattern) { const pathInfo = parameters.path ? ` in ${parameters.path}` : "" return `"${parameters.pattern}"${pathInfo}` } - return '(unknown pattern)' + return "(unknown pattern)" } if (tool === "grep") { if (parameters.pattern) { const pathInfo = parameters.path ? ` in ${parameters.path}` : "" return `"${parameters.pattern}"${pathInfo}` } - return '(unknown pattern)' + return "(unknown pattern)" } if (tool === "bash") { @@ -67,8 +67,8 @@ export const extractParameterKey = (tool: string, parameters: any): string => { } const paramStr = JSON.stringify(parameters) - if (paramStr === '{}' || paramStr === '[]' || paramStr === 'null') { - return '' + if (paramStr === "{}" || paramStr === "[]" || paramStr === "null") { + return "" } return paramStr.substring(0, 50) } @@ -76,7 +76,7 @@ export const extractParameterKey = (tool: string, parameters: any): string => { export function buildToolIdList( state: SessionState, messages: WithParts[], - logger: Logger + logger: Logger, ): string[] { const toolIds: string[] = [] for (const msg of messages) { @@ -85,7 +85,7 @@ export function buildToolIdList( } if (msg.parts) { for (const part of msg.parts) { - if (part.type === 'tool' && part.callID && part.tool) { + if (part.type === "tool" && part.callID && part.tool) { toolIds.push(part.callID) } } diff --git a/lib/model-selector.ts b/lib/model-selector.ts index d1499eb..efa8e87 100644 --- a/lib/model-selector.ts +++ b/lib/model-selector.ts @@ -1,107 +1,112 @@ -import type { LanguageModel } from 'ai'; -import type { Logger } from './logger'; +import type { LanguageModel } from "ai" +import type { Logger } from "./logger" export interface ModelInfo { - providerID: string; - modelID: string; + providerID: string + modelID: string } export const FALLBACK_MODELS: Record = { - openai: 'gpt-5-mini', - anthropic: 'claude-haiku-4-5', //This model isn't broken in opencode-auth-provider - google: 'gemini-2.5-flash', - deepseek: 'deepseek-chat', - xai: 'grok-4-fast', - alibaba: 'qwen3-coder-flash', - zai: 'glm-4.5-flash', - opencode: 'big-pickle' -}; + openai: "gpt-5-mini", + anthropic: "claude-haiku-4-5", //This model isn't broken in opencode-auth-provider + google: "gemini-2.5-flash", + deepseek: "deepseek-chat", + xai: "grok-4-fast", + alibaba: "qwen3-coder-flash", + zai: "glm-4.5-flash", + opencode: "big-pickle", +} const PROVIDER_PRIORITY = [ - 'openai', - 'anthropic', - 'google', - 'deepseek', - 'xai', - 'alibaba', - 'zai', - 'opencode' -]; + "openai", + "anthropic", + "google", + "deepseek", + "xai", + "alibaba", + "zai", + "opencode", +] // TODO: some anthropic provided models aren't supported by the opencode-auth-provider package, so this provides a temporary workaround -const SKIP_PROVIDERS = ['github-copilot', 'anthropic']; +const SKIP_PROVIDERS = ["github-copilot", "anthropic"] export interface ModelSelectionResult { - model: LanguageModel; - modelInfo: ModelInfo; - source: 'user-model' | 'config' | 'fallback'; - reason?: string; - failedModel?: ModelInfo; + model: LanguageModel + modelInfo: ModelInfo + source: "user-model" | "config" | "fallback" + reason?: string + failedModel?: ModelInfo } function shouldSkipProvider(providerID: string): boolean { - const normalized = providerID.toLowerCase().trim(); - return SKIP_PROVIDERS.some(skip => normalized.includes(skip.toLowerCase())); + const normalized = providerID.toLowerCase().trim() + return SKIP_PROVIDERS.some((skip) => normalized.includes(skip.toLowerCase())) } -async function importOpencodeAI(logger?: Logger, maxRetries: number = 3, delayMs: number = 100, workspaceDir?: string): Promise { - let lastError: Error | undefined; +async function importOpencodeAI( + logger?: Logger, + maxRetries: number = 3, + delayMs: number = 100, + workspaceDir?: string, +): Promise { + let lastError: Error | undefined for (let attempt = 1; attempt <= maxRetries; attempt++) { try { - const { OpencodeAI } = await import('@tarquinen/opencode-auth-provider'); - return new OpencodeAI({ workspaceDir }); + const { OpencodeAI } = await import("@tarquinen/opencode-auth-provider") + return new OpencodeAI({ workspaceDir }) } catch (error: any) { - lastError = error; + lastError = error - if (error.message?.includes('before initialization')) { + if (error.message?.includes("before initialization")) { logger?.debug(`Import attempt ${attempt}/${maxRetries} failed, will retry`, { - error: error.message - }); + error: error.message, + }) if (attempt < maxRetries) { - await new Promise(resolve => setTimeout(resolve, delayMs * attempt)); - continue; + await new Promise((resolve) => setTimeout(resolve, delayMs * attempt)) + continue } } - throw error; + throw error } } - throw lastError; + throw lastError } export async function selectModel( currentModel?: ModelInfo, logger?: Logger, configModel?: string, - workspaceDir?: string + workspaceDir?: string, ): Promise { - const opencodeAI = await importOpencodeAI(logger, 3, 100, workspaceDir); + const opencodeAI = await importOpencodeAI(logger, 3, 100, workspaceDir) - let failedModelInfo: ModelInfo | undefined; + let failedModelInfo: ModelInfo | undefined if (configModel) { - const parts = configModel.split('/'); + const parts = configModel.split("/") if (parts.length !== 2) { - logger?.warn('Invalid config model format', { configModel }); + logger?.warn("Invalid config model format", { configModel }) } else { - const [providerID, modelID] = parts; + const [providerID, modelID] = parts try { - const model = await opencodeAI.getLanguageModel(providerID, modelID); + const model = await opencodeAI.getLanguageModel(providerID, modelID) return { model, modelInfo: { providerID, modelID }, - source: 'config', - reason: 'Using model specified in dcp.jsonc config' - }; + source: "config", + reason: "Using model specified in dcp.jsonc config", + } } catch (error: any) { logger?.warn(`Config model failed: ${providerID}/${modelID}`, { - error: error.message - }); - failedModelInfo = { providerID, modelID }; + error: error.message, + }) + failedModelInfo = { providerID, modelID } } } } @@ -109,67 +114,72 @@ export async function selectModel( if (currentModel) { if (shouldSkipProvider(currentModel.providerID)) { if (!failedModelInfo) { - failedModelInfo = currentModel; + failedModelInfo = currentModel } } else { try { - const model = await opencodeAI.getLanguageModel(currentModel.providerID, currentModel.modelID); + const model = await opencodeAI.getLanguageModel( + currentModel.providerID, + currentModel.modelID, + ) return { model, modelInfo: currentModel, - source: 'user-model', - reason: 'Using current session model' - }; + source: "user-model", + reason: "Using current session model", + } } catch (error: any) { if (!failedModelInfo) { - failedModelInfo = currentModel; + failedModelInfo = currentModel } } } } - const providers = await opencodeAI.listProviders(); + const providers = await opencodeAI.listProviders() for (const providerID of PROVIDER_PRIORITY) { - if (!providers[providerID]) continue; + if (!providers[providerID]) continue - const fallbackModelID = FALLBACK_MODELS[providerID]; - if (!fallbackModelID) continue; + const fallbackModelID = FALLBACK_MODELS[providerID] + if (!fallbackModelID) continue try { - const model = await opencodeAI.getLanguageModel(providerID, fallbackModelID); + const model = await opencodeAI.getLanguageModel(providerID, fallbackModelID) return { model, modelInfo: { providerID, modelID: fallbackModelID }, - source: 'fallback', + source: "fallback", reason: `Using ${providerID}/${fallbackModelID}`, - failedModel: failedModelInfo - }; + failedModel: failedModelInfo, + } } catch (error: any) { - continue; + continue } } - throw new Error('No available models for analysis. Please authenticate with at least one provider.'); + throw new Error( + "No available models for analysis. Please authenticate with at least one provider.", + ) } export function extractModelFromSession(sessionState: any, logger?: Logger): ModelInfo | undefined { if (sessionState?.model?.providerID && sessionState?.model?.modelID) { return { providerID: sessionState.model.providerID, - modelID: sessionState.model.modelID - }; + modelID: sessionState.model.modelID, + } } if (sessionState?.messages && Array.isArray(sessionState.messages)) { - const lastMessage = sessionState.messages[sessionState.messages.length - 1]; + const lastMessage = sessionState.messages[sessionState.messages.length - 1] if (lastMessage?.model?.providerID && lastMessage?.model?.modelID) { return { providerID: lastMessage.model.providerID, - modelID: lastMessage.model.modelID - }; + modelID: lastMessage.model.modelID, + } } } - return undefined; + return undefined } diff --git a/lib/prompt.ts b/lib/prompt.ts index 76cc94f..0f2bad3 100644 --- a/lib/prompt.ts +++ b/lib/prompt.ts @@ -6,129 +6,144 @@ export function loadPrompt(name: string, vars?: Record): string let content = readFileSync(filePath, "utf8").trim() if (vars) { for (const [key, value] of Object.entries(vars)) { - content = content.replace(new RegExp(`\\{\\{${key}\\}\\}`, 'g'), value) + content = content.replace(new RegExp(`\\{\\{${key}\\}\\}`, "g"), value) } } return content } -function minimizeMessages(messages: any[], alreadyPrunedIds?: string[], protectedToolCallIds?: string[]): any[] { - const prunedIdsSet = alreadyPrunedIds ? new Set(alreadyPrunedIds.map(id => id.toLowerCase())) : new Set() - const protectedIdsSet = protectedToolCallIds ? new Set(protectedToolCallIds.map(id => id.toLowerCase())) : new Set() - - return messages.map(msg => { - const minimized: any = { - role: msg.info?.role - } - - if (msg.parts) { - minimized.parts = msg.parts - .filter((part: any) => { - if (part.type === 'step-start' || part.type === 'step-finish') { - return false - } - return true - }) - .map((part: any) => { - if (part.type === 'text') { - if (part.ignored) { - return null - } - return { - type: 'text', - text: part.text +function minimizeMessages( + messages: any[], + alreadyPrunedIds?: string[], + protectedToolCallIds?: string[], +): any[] { + const prunedIdsSet = alreadyPrunedIds + ? new Set(alreadyPrunedIds.map((id) => id.toLowerCase())) + : new Set() + const protectedIdsSet = protectedToolCallIds + ? new Set(protectedToolCallIds.map((id) => id.toLowerCase())) + : new Set() + + return messages + .map((msg) => { + const minimized: any = { + role: msg.info?.role, + } + + if (msg.parts) { + minimized.parts = msg.parts + .filter((part: any) => { + if (part.type === "step-start" || part.type === "step-finish") { + return false } - } - - // TODO: This should use the opencode normalized system instead of per provider settings - if (part.type === 'reasoning') { - // Calculate encrypted content size if present - let encryptedContentLength = 0 - if (part.metadata?.openai?.reasoningEncryptedContent) { - encryptedContentLength = part.metadata.openai.reasoningEncryptedContent.length - } else if (part.metadata?.anthropic?.signature) { - encryptedContentLength = part.metadata.anthropic.signature.length - } else if (part.metadata?.google?.thoughtSignature) { - encryptedContentLength = part.metadata.google.thoughtSignature.length + return true + }) + .map((part: any) => { + if (part.type === "text") { + if (part.ignored) { + return null + } + return { + type: "text", + text: part.text, + } } - return { - type: 'reasoning', - text: part.text, - textLength: part.text?.length || 0, - encryptedContentLength, - ...(part.time && { time: part.time }), - ...(part.metadata && { metadataKeys: Object.keys(part.metadata) }) - } - } - - if (part.type === 'tool') { - const callIDLower = part.callID?.toLowerCase() - const isAlreadyPruned = prunedIdsSet.has(callIDLower) - const isProtected = protectedIdsSet.has(callIDLower) - - let displayCallID = part.callID - if (isAlreadyPruned) { - displayCallID = '' - } else if (isProtected) { - displayCallID = '' - } + // TODO: This should use the opencode normalized system instead of per provider settings + if (part.type === "reasoning") { + // Calculate encrypted content size if present + let encryptedContentLength = 0 + if (part.metadata?.openai?.reasoningEncryptedContent) { + encryptedContentLength = + part.metadata.openai.reasoningEncryptedContent.length + } else if (part.metadata?.anthropic?.signature) { + encryptedContentLength = part.metadata.anthropic.signature.length + } else if (part.metadata?.google?.thoughtSignature) { + encryptedContentLength = + part.metadata.google.thoughtSignature.length + } - const toolPart: any = { - type: 'tool', - toolCallID: displayCallID, - tool: part.tool + return { + type: "reasoning", + text: part.text, + textLength: part.text?.length || 0, + encryptedContentLength, + ...(part.time && { time: part.time }), + ...(part.metadata && { metadataKeys: Object.keys(part.metadata) }), + } } - if (part.state?.output) { - toolPart.output = part.state.output - } + if (part.type === "tool") { + const callIDLower = part.callID?.toLowerCase() + const isAlreadyPruned = prunedIdsSet.has(callIDLower) + const isProtected = protectedIdsSet.has(callIDLower) - if (part.state?.input) { - const input = part.state.input + let displayCallID = part.callID + if (isAlreadyPruned) { + displayCallID = "" + } else if (isProtected) { + displayCallID = "" + } - if (input.filePath && (part.tool === 'write' || part.tool === 'edit' || part.tool === 'multiedit' || part.tool === 'patch')) { - toolPart.input = input + const toolPart: any = { + type: "tool", + toolCallID: displayCallID, + tool: part.tool, } - else if (input.filePath) { - toolPart.input = { filePath: input.filePath } + + if (part.state?.output) { + toolPart.output = part.state.output } - else if (input.tool_calls && Array.isArray(input.tool_calls)) { - toolPart.input = { - batch_summary: `${input.tool_calls.length} tool calls`, - tools: input.tool_calls.map((tc: any) => tc.tool) + + if (part.state?.input) { + const input = part.state.input + + if ( + input.filePath && + (part.tool === "write" || + part.tool === "edit" || + part.tool === "multiedit" || + part.tool === "patch") + ) { + toolPart.input = input + } else if (input.filePath) { + toolPart.input = { filePath: input.filePath } + } else if (input.tool_calls && Array.isArray(input.tool_calls)) { + toolPart.input = { + batch_summary: `${input.tool_calls.length} tool calls`, + tools: input.tool_calls.map((tc: any) => tc.tool), + } + } else { + toolPart.input = input } } - else { - toolPart.input = input - } + + return toolPart } - return toolPart - } + return null + }) + .filter(Boolean) + } - return null - }) - .filter(Boolean) - } - - return minimized - }).filter(msg => { - return msg.parts && msg.parts.length > 0 - }) + return minimized + }) + .filter((msg) => { + return msg.parts && msg.parts.length > 0 + }) } export function buildAnalysisPrompt( unprunedToolCallIds: string[], messages: any[], alreadyPrunedIds?: string[], - protectedToolCallIds?: string[] + protectedToolCallIds?: string[], ): string { const minimizedMessages = minimizeMessages(messages, alreadyPrunedIds, protectedToolCallIds) - const messagesJson = JSON.stringify(minimizedMessages, null, 2).replace(/\\n/g, '\n') + const messagesJson = JSON.stringify(minimizedMessages, null, 2).replace(/\\n/g, "\n") - return loadPrompt("pruning", { + return loadPrompt("on-idle-analysis", { available_tool_call_ids: unprunedToolCallIds.join(", "), - session_history: messagesJson + session_history: messagesJson, }) } diff --git a/lib/prompts/discard-tool-spec.txt b/lib/prompts/discard-tool-spec.txt new file mode 100644 index 0000000..68669ed --- /dev/null +++ b/lib/prompts/discard-tool-spec.txt @@ -0,0 +1,41 @@ +Discards tool outputs from context to manage conversation size and reduce noise. + +## IMPORTANT: The Prunable List +A `` list is provided to you showing available tool outputs you can discard when there are tools available for pruning. Each line has the format `ID: tool, parameter` (e.g., `20: read, /path/to/file.ts`). You MUST only use numeric IDs that appear in this list to select which tools to discard. + +## When to Use This Tool + +Use `discard` for removing tool content that is no longer needed + +- **Noise:** Irrelevant, unhelpful, or superseded outputs that provide no value. +- **Task Completion:** Work is complete and there's no valuable information worth preserving. + +## When NOT to Use This Tool + +- **If the output contains useful information:** Use `extract` instead to preserve key findings. +- **If you'll need the output later:** Don't discard files you plan to edit or context you'll need for implementation. + +## Best Practices +- **Strategic Batching:** Don't discard single small tool outputs (like short bash commands) unless they are pure noise. Wait until you have several items to perform high-impact discards. +- **Think ahead:** Before discarding, ask: "Will I need this output for an upcoming task?" If yes, keep it. + +## Format + +- `ids`: Array where the first element is the reason, followed by numeric IDs from the `` list + +Reasons: `noise` | `completion` + +## Example + + +Assistant: [Reads 'wrong_file.ts'] +This file isn't relevant to the auth system. I'll remove it to clear the context. +[Uses discard with ids: ["noise", "5"]] + + + +Assistant: [Runs tests, they pass] +The tests passed and I don't need to preserve any details. I'll clean up now. +[Uses discard with ids: ["completion", "20", "21"]] + + diff --git a/lib/prompts/extract-tool-spec.txt b/lib/prompts/extract-tool-spec.txt new file mode 100644 index 0000000..7986224 --- /dev/null +++ b/lib/prompts/extract-tool-spec.txt @@ -0,0 +1,47 @@ +Extracts key findings from tool outputs into distilled knowledge, then removes the raw outputs from context. + +## IMPORTANT: The Prunable List +A `` list is provided to you showing available tool outputs you can extract from when there are tools available for pruning. Each line has the format `ID: tool, parameter` (e.g., `20: read, /path/to/file.ts`). You MUST only use numeric IDs that appear in this list to select which tools to extract. + +## When to Use This Tool + +Use `extract` when you have gathered useful information that you want to **preserve in distilled form** before removing the raw outputs: + +- **Task Completion:** You completed a unit of work and want to preserve key findings. +- **Knowledge Preservation:** You have context that contains valuable information, but also a lot of unnecessary detail - you only need to preserve some specifics. + +## When NOT to Use This Tool + +- **If you need precise syntax:** If you'll edit a file or grep for exact strings, keep the raw output. +- **If uncertain:** Prefer keeping over re-fetching. + + +## Best Practices +- **Strategic Batching:** Wait until you have several items or a few large outputs to extract, rather than doing tiny, frequent extractions. Aim for high-impact extractions that significantly reduce context size. +- **Think ahead:** Before extracting, ask: "Will I need the raw output for an upcoming task?" If you researched a file you'll later edit, do NOT extract it. + +## Format + +- `ids`: Array of numeric IDs as strings from the `` list +- `distillation`: Array of strings, one per ID (positional: distillation[0] is for ids[0], etc.) + +Each distillation string should capture the essential information you need to preserve - function signatures, logic, constraints, values, etc. Be as detailed as needed for your task. + +## Example + + +Assistant: [Reads auth service and user types] +I'll preserve the key details before extracting. +[Uses extract with: + ids: ["10", "11"], + distillation: [ + "auth.ts: validateToken(token: string) -> User|null checks cache first (5min TTL) then OIDC. hashPassword uses bcrypt 12 rounds. Tokens must be 128+ chars.", + "user.ts: interface User { id: string; email: string; permissions: ('read'|'write'|'admin')[]; status: 'active'|'suspended' }" + ] +] + + + +Assistant: [Reads 'auth.ts' to understand the login flow] +I've understood the auth flow. I'll need to modify this file to add the new validation, so I'm keeping this read in context rather than extracting. + diff --git a/lib/prompts/nudge.txt b/lib/prompts/nudge.txt deleted file mode 100644 index ed2078a..0000000 --- a/lib/prompts/nudge.txt +++ /dev/null @@ -1,10 +0,0 @@ - -**CRITICAL CONTEXT WARNING:** Your context window is filling with tool outputs. Strict adherence to context hygiene is required. - -**Immediate Actions Required:** -1. **Garbage Collect:** If you read files or ran commands that yielded no value, prune them NOW. Do not summarize them. -2. **Task Cleanup:** If a sub-task is complete, prune the tools used. -3. **Consolidate:** If you are holding valuable raw data, you *must* distill the insights into your narrative and prune the raw entry. - -**Protocol:** You should prioritize this cleanup, but do not interrupt a critical atomic operation if one is in progress. Once the immediate step is done, you must prune. - diff --git a/lib/prompts/nudge/nudge-both.txt b/lib/prompts/nudge/nudge-both.txt new file mode 100644 index 0000000..b6fd667 --- /dev/null +++ b/lib/prompts/nudge/nudge-both.txt @@ -0,0 +1,10 @@ + +**CRITICAL CONTEXT WARNING:** My context window is filling with tool outputs. I must adhere strictly to context hygiene. + +**Immediate Actions Required:** +1. **Task Completion:** If a sub-task is complete, I will decide: use `discard` if no valuable context to preserve (default), or use `extract` if insights are worth keeping. +2. **Noise Removal:** If I read files or ran commands that yielded no value, I will use `discard` to remove them. +3. **Knowledge Preservation:** If I am holding valuable raw data I'll need to reference later, I will use `extract` to distill the insights and remove the raw entry. + +**Protocol:** I should prioritize this cleanup, but I will not interrupt a critical atomic operation if one is in progress. Once the immediate step is done, I must perform context management. + diff --git a/lib/prompts/nudge/nudge-discard.txt b/lib/prompts/nudge/nudge-discard.txt new file mode 100644 index 0000000..8a166f3 --- /dev/null +++ b/lib/prompts/nudge/nudge-discard.txt @@ -0,0 +1,9 @@ + +**CRITICAL CONTEXT WARNING:** My context window is filling with tool outputs. I must adhere strictly to context hygiene. + +**Immediate Actions Required:** +1. **Task Completion:** If a sub-task is complete, I will use the `discard` tool to remove the tools used. +2. **Noise Removal:** If I read files or ran commands that yielded no value, I will use the `discard` tool to remove them. + +**Protocol:** I should prioritize this cleanup, but I will not interrupt a critical atomic operation if one is in progress. Once the immediate step is done, I must discard unneeded tool outputs. + diff --git a/lib/prompts/nudge/nudge-extract.txt b/lib/prompts/nudge/nudge-extract.txt new file mode 100644 index 0000000..a09528e --- /dev/null +++ b/lib/prompts/nudge/nudge-extract.txt @@ -0,0 +1,9 @@ + +**CRITICAL CONTEXT WARNING:** My context window is filling with tool outputs. I must adhere strictly to context hygiene. + +**Immediate Actions Required:** +1. **Task Completion:** If I have completed work, I will extract key findings from the tools used. I will scale distillation depth to the value of the content. +2. **Knowledge Preservation:** If I am holding valuable raw data I'll need to reference later, I will use the `extract` tool with high-fidelity distillation to preserve the insights and remove the raw entry. + +**Protocol:** I should prioritize this cleanup, but I will not interrupt a critical atomic operation if one is in progress. Once the immediate step is done, I must extract valuable findings from tool outputs. + diff --git a/lib/prompts/pruning.txt b/lib/prompts/on-idle-analysis.txt similarity index 100% rename from lib/prompts/pruning.txt rename to lib/prompts/on-idle-analysis.txt diff --git a/lib/prompts/synthetic.txt b/lib/prompts/synthetic.txt deleted file mode 100644 index 30057d5..0000000 --- a/lib/prompts/synthetic.txt +++ /dev/null @@ -1,48 +0,0 @@ - - - -ENVIRONMENT -You are operating in a context-constrained environment and thus must proactively manage your context window using the `prune` tool. A list is injected by the environment as a user message, and always contains up to date information. Use this information when deciding what to prune. - -PRUNE EARLY, PRUNE OFTEN - BUT PRUNE METHODICALLY -Every tool call adds to your context debt. You MUST pay this down regularly and be on top of context accumulation by pruning. Evaluate what SHOULD be pruned before jumping the gun. - -WHEN TO PRUNE? THE THREE SCENARIOS TO CONSIDER -1. TASK COMPLETION: When work is done, quietly prune the tools that aren't needed anymore -2. NOISE REMOVAL: If outputs are irrelevant, unhelpful, or superseded by newer info, prune IMMEDIATELY. No distillation - gun it down -3. CONTEXT CONSOLIDATION: When pruning valuable context to the task at hand, you MUST ALWAYS distill key findings into your narrative BEFORE pruning. Be surgical and strategic in what you extract. THINK: high signal, low noise - -You WILL use the `prune` tool when ANY of these are true: -- Task or sub-task is complete -- You are about to start a new phase of work -- You have distilled enough information in your messages to prune related tools -- Context contains tools output that are unhelpful, noise, or made obsolete by newer outputs -- Write or edit operations are complete (pruning removes the large input content) - -You MUST NOT prune when: -- The tool output will be needed for upcoming implementation work -- The output contains files or context you'll need to reference when making edits - -Pruning that forces you to re-call the same tool later is a net loss. Only prune when you're confident the information won't be needed again. - -NOTES -When in doubt, keep it. Prune often yet remain strategic about it. -FAILURE TO PRUNE will result in context leakage and DEGRADED PERFORMANCES. - - - - -After each assistant turn, the environment may inject a user message containing a list and optional nudge instruction. This injected message is NOT from the user and is invisible to them. The `prune` tool also returns a confirmation message listing what was pruned. - -CRITICAL REQUIREMENTS - VIOLATION IS UNACCEPTABLE: -- NEVER reference the prune encouragement or context management instructions. Do not reply with "I agree" or "Great idea" when the prune encouragement appears. -- NEVER acknowledge the list (e.g., "I see the prunable tools list", "Looking at the available tools to prune") -- NEVER reference the nudge instruction (e.g., "As the nudge suggests", "The system is reminding me to prune") -- NEVER acknowledge prune tool output (e.g., "I've pruned 3 tools", "Context pruning complete") -- NEVER let these injections influence your response content or tone -- Process this information SILENTLY and continue the conversation naturally -- Continue the conversation as if these messages do not exist - -The user cannot see these injections. Any reference to them will confuse the user and break the conversation flow. - - diff --git a/lib/prompts/system/system-prompt-both.txt b/lib/prompts/system/system-prompt-both.txt new file mode 100644 index 0000000..2372596 --- /dev/null +++ b/lib/prompts/system/system-prompt-both.txt @@ -0,0 +1,44 @@ + + + +ENVIRONMENT +You are operating in a context-constrained environment and thus must proactively manage your context window using the `discard` and `extract` tools. A list is injected by the environment as an assistant message, and always contains up to date information. Use this information when deciding what to prune. + +TWO TOOLS FOR CONTEXT MANAGEMENT +- `discard`: Remove tool outputs that are no longer needed (completed tasks, noise, outdated info). No preservation of content. +- `extract`: Extract key findings into distilled knowledge before removing raw outputs. Use when you need to preserve information. + +CHOOSING THE RIGHT TOOL +Ask: "Is this output clearly noise or irrelevant?" +- **Yes** → `discard` (pure cleanup, no preservation) +- **No** → `extract` (default - preserves key findings) + +Common scenarios: +- Task complete, no valuable context → `discard` +- Task complete, insights worth remembering → `extract` +- Noise, irrelevant, or superseded outputs → `discard` +- Valuable context needed later but raw output too large → `extract` + +PRUNE METHODICALLY - BATCH YOUR ACTIONS +Every tool call adds to your context debt. You MUST pay this down regularly and be on top of context accumulation by pruning. Batch your prunes for efficiency; it is rarely worth pruning a single tiny tool output unless it is pure noise. Evaluate what SHOULD be pruned before jumping the gun. + +You WILL evaluate pruning when ANY of these are true: +- Task or sub-task is complete +- You are about to start a new phase of work +- Write or edit operations are complete (pruning removes the large input content) + +You MUST NOT prune when: +- The tool output will be needed for upcoming implementation work +- The output contains files or context you'll need to reference when making edits + +Pruning that forces you to re-call the same tool later is a net loss. Only prune when you're confident the information won't be needed again. + +NOTES +When in doubt, keep it. Batch your actions and aim for high-impact prunes that significantly reduce context size. +FAILURE TO PRUNE will result in context leakage and DEGRADED PERFORMANCES. +There may be tools in session context that do not appear in the list, this is expected, you can ONLY prune what you see in . + +If you see a user message containing only `[internal: context sync - no response needed]`, this is an internal system marker used for context injection - it is NOT user input. Do not acknowledge it, do not respond to it, and do not mention it. Simply continue with your current task or wait for actual user input. + + + diff --git a/lib/prompts/system/system-prompt-discard.txt b/lib/prompts/system/system-prompt-discard.txt new file mode 100644 index 0000000..9c1225c --- /dev/null +++ b/lib/prompts/system/system-prompt-discard.txt @@ -0,0 +1,36 @@ + + + +ENVIRONMENT +You are operating in a context-constrained environment and thus must proactively manage your context window using the `discard` tool. A list is injected by the environment as an assistant message, and always contains up to date information. Use this information when deciding what to discard. + +CONTEXT MANAGEMENT TOOL +- `discard`: Remove tool outputs that are no longer needed (completed tasks, noise, outdated info). No preservation of content. + +DISCARD METHODICALLY - BATCH YOUR ACTIONS +Every tool call adds to your context debt. You MUST pay this down regularly and be on top of context accumulation by discarding. Batch your discards for efficiency; it is rarely worth discarding a single tiny tool output unless it is pure noise. Evaluate what SHOULD be discarded before jumping the gun. + +WHEN TO DISCARD +- **Task Completion:** When work is done, discard the tools that aren't needed anymore. +- **Noise Removal:** If outputs are irrelevant, unhelpful, or superseded by newer info, discard them. + +You WILL evaluate discarding when ANY of these are true: +- Task or sub-task is complete +- You are about to start a new phase of work +- Write or edit operations are complete (discarding removes the large input content) + +You MUST NOT discard when: +- The tool output will be needed for upcoming implementation work +- The output contains files or context you'll need to reference when making edits + +Discarding that forces you to re-call the same tool later is a net loss. Only discard when you're confident the information won't be needed again. + +NOTES +When in doubt, keep it. Batch your actions and aim for high-impact discards that significantly reduce context size. +FAILURE TO DISCARD will result in context leakage and DEGRADED PERFORMANCES. +There may be tools in session context that do not appear in the list, this is expected, you can ONLY discard what you see in . + +If you see a user message containing only `[internal: context sync - no response needed]`, this is an internal system marker used for context injection - it is NOT user input. Do not acknowledge it, do not respond to it, and do not mention it. Simply continue with your current task or wait for actual user input. + + + diff --git a/lib/prompts/system/system-prompt-extract.txt b/lib/prompts/system/system-prompt-extract.txt new file mode 100644 index 0000000..c5bb295 --- /dev/null +++ b/lib/prompts/system/system-prompt-extract.txt @@ -0,0 +1,36 @@ + + + +ENVIRONMENT +You are operating in a context-constrained environment and thus must proactively manage your context window using the `extract` tool. A list is injected by the environment as an assistant message, and always contains up to date information. Use this information when deciding what to extract. + +CONTEXT MANAGEMENT TOOL +- `extract`: Extract key findings from tools into distilled knowledge before removing the raw content from context. Use this to preserve important information while reducing context size. + +EXTRACT METHODICALLY - BATCH YOUR ACTIONS +Every tool call adds to your context debt. You MUST pay this down regularly and be on top of context accumulation by extracting. Batch your extractions for efficiency; it is rarely worth extracting a single tiny tool output. Evaluate what SHOULD be extracted before jumping the gun. + +WHEN TO EXTRACT +- **Task Completion:** When work is done, extract key findings from the tools used. Scale distillation depth to the value of the content. +- **Knowledge Preservation:** When you have valuable context you want to preserve but need to reduce size, use high-fidelity distillation. Your distillation must be comprehensive, capturing technical details (signatures, logic, constraints) such that the raw output is no longer needed. THINK: high signal, complete technical substitute. + +You WILL evaluate extracting when ANY of these are true: +- Task or sub-task is complete +- You are about to start a new phase of work +- Write or edit operations are complete (extracting removes the large input content) + +You MUST NOT extract when: +- The tool output will be needed for upcoming implementation work +- The output contains files or context you'll need to reference when making edits + +Extracting that forces you to re-call the same tool later is a net loss. Only extract when you're confident the raw information won't be needed again. + +NOTES +When in doubt, keep it. Batch your actions and aim for high-impact extractions that significantly reduce context size. +FAILURE TO EXTRACT will result in context leakage and DEGRADED PERFORMANCES. +There may be tools in session context that do not appear in the list, this is expected, you can ONLY extract what you see in . + +If you see a user message containing only `[internal: context sync - no response needed]`, this is an internal system marker used for context injection - it is NOT user input. Do not acknowledge it, do not respond to it, and do not mention it. Simply continue with your current task or wait for actual user input. + + + diff --git a/lib/prompts/tool.txt b/lib/prompts/tool.txt deleted file mode 100644 index ccc68ff..0000000 --- a/lib/prompts/tool.txt +++ /dev/null @@ -1,72 +0,0 @@ -Prunes tool outputs from context to manage conversation size and reduce noise. For `write` and `edit` tools, the input content is pruned instead of the output. - -## IMPORTANT: The Prunable List -A `` list is injected into user messages showing available tool outputs you can prune. Each line has the format `ID: tool, parameter` (e.g., `20: read, /path/to/file.ts`). You MUST only use numeric IDs that appear in this list to select which tools to prune. - -**Note:** For `write` and `edit` tools, pruning removes the input content (the code being written/edited) while preserving the output confirmation. This is useful after completing a file modification when you no longer need the raw content in context. - -## CRITICAL: When and How to Prune - -You must use this tool in three specific scenarios. The rules for distillation (summarizing findings) differ for each. **You must specify the reason as the first element of the `ids` array** to indicate which scenario applies. - -### 1. Task Completion (Clean Up) — reason: `completion` -**When:** You have successfully completed a specific unit of work (e.g., fixed a bug, wrote a file, answered a question). -**Action:** Prune the tools used for that task. -**Distillation:** NOT REQUIRED. Since the task is done, the raw data is no longer needed. Simply state that the task is complete. - -### 2. Removing Noise (Garbage Collection) — reason: `noise` -**When:** You have read files or run commands that turned out to be irrelevant, unhelpful, or outdated (meaning later tools have provided fresher, more valid information). -**Action:** Prune these specific tool outputs immediately. -**Distillation:** FORBIDDEN. Do not pollute the context by summarizing useless information. Just cut it out. - -### 3. Context Conservation (Research & Consolidation) — reason: `consolidation` -**When:** You have gathered useful information. Prune frequently as you work (e.g., after reading a few files), rather than waiting for a "long" phase to end. -**Action:** Convert raw data into distilled knowledge. This allows you to discard large outputs (like full file reads) while keeping only the specific parts you need (like a single function signature or constant). -**Distillation:** MANDATORY. Before pruning, you *must* explicitly summarize the key findings from *every* tool you plan to prune. - - **Extract specific value:** If you read a large file but only care about one function, record that function's details and prune the whole read. - - Narrative format: "I found X in file Y..." - - Capture all relevant details (function names, logic, constraints). - - Once distilled into your response history, the raw tool output can be safely pruned. - - **Know when distillation isn't enough:** If you'll need to edit a file, grep for exact strings, or reference precise syntax, keep the raw output. Distillation works for understanding; implementation often requires the original. - - **Prefer keeping over re-fetching:** If uncertain whether you'll need the output again, keep it. The cost of retaining context is lower than the cost of redundant tool calls. - -## Best Practices -- **Don't wait too long:** Prune frequently to keep the context agile. -- **Be surgical:** You can mix strategies. Prune noise without comment, while distilling useful context in the same turn. -- **Verify:** Ensure you have captured what you need before deleting useful raw data. -- **Think ahead:** Before pruning, ask: "Will I need this output for an upcoming task?" If you researched a file you'll later edit, or gathered context for implementation, do NOT prune it—even if you've distilled findings. Distillation captures *knowledge*; implementation requires *context*. - -## Examples - - -Assistant: [Reads 'wrong_file.ts'] -This file isn't relevant to the auth system. I'll remove it to clear the context. -[Uses prune with ids: ["noise", "5"]] - - - -Assistant: [Reads 5 different config files] -I have analyzed the configuration. Here is the distillation: -- 'config.ts' uses port 3000. -- 'db.ts' connects to mongo:27017. -- The other 3 files were defaults. -I have preserved the signals above, so I am now pruning the raw reads. -[Uses prune with ids: ["consolidation", "10", "11", "12", "13", "14"]] - - - -Assistant: [Runs tests, they pass] -The tests passed. The feature is verified. -[Uses prune with ids: ["completion", "20", "21"]] - - - -Assistant: [Reads 'auth.ts' to understand the login flow] -I've understood the auth flow. I'll need to modify this file to add the new validation, so I'm keeping this read in context rather than distilling and pruning. - - - -Assistant: [Edits 'auth.ts' to add validation] -The edit was successful. I no longer need the raw edit content in context. -[Uses prune with ids: ["completion", "15"]] - diff --git a/lib/shared-utils.ts b/lib/shared-utils.ts index fe6fbd6..d737eb7 100644 --- a/lib/shared-utils.ts +++ b/lib/shared-utils.ts @@ -1,22 +1,25 @@ import { SessionState, WithParts } from "./state" -export const isMessageCompacted = ( - state: SessionState, - msg: WithParts -): boolean => { +export const isMessageCompacted = (state: SessionState, msg: WithParts): boolean => { return msg.info.time.created < state.lastCompaction } -export const getLastUserMessage = ( - messages: WithParts[] -): WithParts | null => { +export const getLastUserMessage = (messages: WithParts[]): WithParts | null => { for (let i = messages.length - 1; i >= 0; i--) { const msg = messages[i] - if (msg.info.role === 'user') { + if (msg.info.role === "user") { return msg } } return null } - +export const getLastAssistantMessage = (messages: WithParts[]): WithParts | null => { + for (let i = messages.length - 1; i >= 0; i--) { + const msg = messages[i] + if (msg.info.role === "assistant") { + return msg + } + } + return null +} diff --git a/lib/state/persistence.ts b/lib/state/persistence.ts index eb97551..ccd4859 100644 --- a/lib/state/persistence.ts +++ b/lib/state/persistence.ts @@ -4,110 +4,98 @@ * Storage location: ~/.local/share/opencode/storage/plugin/dcp/{sessionId}.json */ -import * as fs from "fs/promises"; -import { existsSync } from "fs"; -import { homedir } from "os"; -import { join } from "path"; +import * as fs from "fs/promises" +import { existsSync } from "fs" +import { homedir } from "os" +import { join } from "path" import type { SessionState, SessionStats, Prune } from "./types" -import type { Logger } from "../logger"; +import type { Logger } from "../logger" export interface PersistedSessionState { - sessionName?: string; + sessionName?: string prune: Prune - stats: SessionStats; - lastUpdated: string; + stats: SessionStats + lastUpdated: string } -const STORAGE_DIR = join( - homedir(), - ".local", - "share", - "opencode", - "storage", - "plugin", - "dcp" -); +const STORAGE_DIR = join(homedir(), ".local", "share", "opencode", "storage", "plugin", "dcp") async function ensureStorageDir(): Promise { if (!existsSync(STORAGE_DIR)) { - await fs.mkdir(STORAGE_DIR, { recursive: true }); + await fs.mkdir(STORAGE_DIR, { recursive: true }) } } function getSessionFilePath(sessionId: string): string { - return join(STORAGE_DIR, `${sessionId}.json`); + return join(STORAGE_DIR, `${sessionId}.json`) } export async function saveSessionState( sessionState: SessionState, logger: Logger, - sessionName?: string + sessionName?: string, ): Promise { try { if (!sessionState.sessionId) { - return; + return } - await ensureStorageDir(); + await ensureStorageDir() const state: PersistedSessionState = { sessionName: sessionName, prune: sessionState.prune, stats: sessionState.stats, - lastUpdated: new Date().toISOString() - }; + lastUpdated: new Date().toISOString(), + } - const filePath = getSessionFilePath(sessionState.sessionId); - const content = JSON.stringify(state, null, 2); - await fs.writeFile(filePath, content, "utf-8"); + const filePath = getSessionFilePath(sessionState.sessionId) + const content = JSON.stringify(state, null, 2) + await fs.writeFile(filePath, content, "utf-8") logger.info("Saved session state to disk", { sessionId: sessionState.sessionId, - totalTokensSaved: state.stats.totalPruneTokens - }); + totalTokensSaved: state.stats.totalPruneTokens, + }) } catch (error: any) { logger.error("Failed to save session state", { sessionId: sessionState.sessionId, error: error?.message, - }); + }) } } export async function loadSessionState( sessionId: string, - logger: Logger + logger: Logger, ): Promise { try { - const filePath = getSessionFilePath(sessionId); + const filePath = getSessionFilePath(sessionId) if (!existsSync(filePath)) { - return null; + return null } - const content = await fs.readFile(filePath, "utf-8"); - const state = JSON.parse(content) as PersistedSessionState; + const content = await fs.readFile(filePath, "utf-8") + const state = JSON.parse(content) as PersistedSessionState - if (!state || - !state.prune || - !Array.isArray(state.prune.toolIds) || - !state.stats - ) { + if (!state || !state.prune || !Array.isArray(state.prune.toolIds) || !state.stats) { logger.warn("Invalid session state file, ignoring", { sessionId: sessionId, - }); - return null; + }) + return null } logger.info("Loaded session state from disk", { - sessionId: sessionId - }); + sessionId: sessionId, + }) - return state; + return state } catch (error: any) { logger.warn("Failed to load session state", { sessionId: sessionId, error: error?.message, - }); - return null; + }) + return null } } diff --git a/lib/state/state.ts b/lib/state/state.ts index caab6d9..826af40 100644 --- a/lib/state/state.ts +++ b/lib/state/state.ts @@ -2,15 +2,14 @@ import type { SessionState, ToolParameterEntry, WithParts } from "./types" import type { Logger } from "../logger" import { loadSessionState } from "./persistence" import { isSubAgentSession } from "./utils" -import { getLastUserMessage } from "../shared-utils" +import { getLastUserMessage, isMessageCompacted } from "../shared-utils" export const checkSession = async ( client: any, state: SessionState, logger: Logger, - messages: WithParts[] + messages: WithParts[], ): Promise => { - const lastUserMessage = getLastUserMessage(messages) if (!lastUserMessage) { return @@ -32,8 +31,12 @@ export const checkSession = async ( state.lastCompaction = lastCompactionTimestamp state.toolParameters.clear() state.prune.toolIds = [] - logger.info("Detected compaction from messages - cleared tool cache", { timestamp: lastCompactionTimestamp }) + logger.info("Detected compaction from messages - cleared tool cache", { + timestamp: lastCompactionTimestamp, + }) } + + state.currentTurn = countTurns(state, messages) } export function createSessionState(): SessionState { @@ -41,7 +44,7 @@ export function createSessionState(): SessionState { sessionId: null, isSubAgent: false, prune: { - toolIds: [] + toolIds: [], }, stats: { pruneTokenCounter: 0, @@ -50,7 +53,9 @@ export function createSessionState(): SessionState { toolParameters: new Map(), nudgeCounter: 0, lastToolPrune: false, - lastCompaction: 0 + lastCompaction: 0, + currentTurn: 0, + isReasoningModel: false, } } @@ -58,7 +63,7 @@ export function resetSessionState(state: SessionState): void { state.sessionId = null state.isSubAgent = false state.prune = { - toolIds: [] + toolIds: [], } state.stats = { pruneTokenCounter: 0, @@ -68,6 +73,8 @@ export function resetSessionState(state: SessionState): void { state.nudgeCounter = 0 state.lastToolPrune = false state.lastCompaction = 0 + state.currentTurn = 0 + state.isReasoningModel = false } export async function ensureSessionInitialized( @@ -75,10 +82,10 @@ export async function ensureSessionInitialized( state: SessionState, sessionId: string, logger: Logger, - messages: WithParts[] + messages: WithParts[], ): Promise { if (state.sessionId === sessionId) { - return; + return } logger.info("session ID = " + sessionId) @@ -92,14 +99,15 @@ export async function ensureSessionInitialized( logger.info("isSubAgent = " + isSubAgent) state.lastCompaction = findLastCompactionTimestamp(messages) + state.currentTurn = countTurns(state, messages) const persisted = await loadSessionState(sessionId, logger) if (persisted === null) { - return; + return } state.prune = { - toolIds: persisted.prune.toolIds || [] + toolIds: persisted.prune.toolIds || [], } state.stats = { pruneTokenCounter: persisted.stats?.pruneTokenCounter || 0, @@ -116,3 +124,18 @@ function findLastCompactionTimestamp(messages: WithParts[]): number { } return 0 } + +export function countTurns(state: SessionState, messages: WithParts[]): number { + let turnCount = 0 + for (const msg of messages) { + if (isMessageCompacted(state, msg)) { + continue + } + for (const part of msg.parts) { + if (part.type === "step-start") { + turnCount++ + } + } + } + return turnCount +} diff --git a/lib/state/tool-cache.ts b/lib/state/tool-cache.ts index ee2e2dc..f9d3d3c 100644 --- a/lib/state/tool-cache.ts +++ b/lib/state/tool-cache.ts @@ -18,6 +18,7 @@ export async function syncToolCache( logger.info("Syncing tool parameters from OpenCode messages") state.nudgeCounter = 0 + let turnCounter = 0 for (const msg of messages) { if (isMessageCompacted(state, msg)) { @@ -25,37 +26,58 @@ export async function syncToolCache( } for (const part of msg.parts) { - if (part.type !== "tool" || !part.callID) { + if (part.type === "step-start") { + turnCounter++ continue } - if (state.toolParameters.has(part.callID)) { + + if (part.type !== "tool" || !part.callID) { continue } - if (part.tool === "prune") { + const turnProtectionEnabled = config.turnProtection.enabled + const turnProtectionTurns = config.turnProtection.turns + const isProtectedByTurn = + turnProtectionEnabled && + turnProtectionTurns > 0 && + state.currentTurn - turnCounter < turnProtectionTurns + + state.lastToolPrune = part.tool === "discard" || part.tool === "extract" + + const allProtectedTools = config.tools.settings.protectedTools + + if (part.tool === "discard" || part.tool === "extract") { state.nudgeCounter = 0 - } else if (!config.strategies.pruneTool.protectedTools.includes(part.tool)) { + } else if (!allProtectedTools.includes(part.tool) && !isProtectedByTurn) { state.nudgeCounter++ } - state.lastToolPrune = part.tool === "prune" - - state.toolParameters.set( - part.callID, - { - tool: part.tool, - parameters: part.state?.input ?? {}, - status: part.state.status as ToolStatus | undefined, - error: part.state.status === "error" ? part.state.error : undefined, - } - ) - logger.info("Cached tool id: " + part.callID) + + if (state.toolParameters.has(part.callID)) { + continue + } + + if (isProtectedByTurn) { + continue + } + + state.toolParameters.set(part.callID, { + tool: part.tool, + parameters: part.state?.input ?? {}, + status: part.state.status as ToolStatus | undefined, + error: part.state.status === "error" ? part.state.error : undefined, + turn: turnCounter, + }) + logger.info(`Cached tool id: ${part.callID} (created on turn ${turnCounter})`) } } - logger.info("Synced cache - size: " + state.toolParameters.size) + + logger.info( + `Synced cache - size: ${state.toolParameters.size}, currentTurn: ${state.currentTurn}, nudgeCounter: ${state.nudgeCounter}`, + ) trimToolParametersCache(state) } catch (error) { logger.warn("Failed to sync tool parameters from OpenCode", { - error: error instanceof Error ? error.message : String(error) + error: error instanceof Error ? error.message : String(error), }) } } @@ -69,8 +91,10 @@ export function trimToolParametersCache(state: SessionState): void { return } - const keysToRemove = Array.from(state.toolParameters.keys()) - .slice(0, state.toolParameters.size - MAX_TOOL_CACHE_SIZE) + const keysToRemove = Array.from(state.toolParameters.keys()).slice( + 0, + state.toolParameters.size - MAX_TOOL_CACHE_SIZE, + ) for (const key of keysToRemove) { state.toolParameters.delete(key) diff --git a/lib/state/types.ts b/lib/state/types.ts index 678bf29..c602d3f 100644 --- a/lib/state/types.ts +++ b/lib/state/types.ts @@ -12,6 +12,7 @@ export interface ToolParameterEntry { parameters: any status?: ToolStatus error?: string + turn: number // Which turn (step-start count) this tool was called on } export interface SessionStats { @@ -32,4 +33,6 @@ export interface SessionState { nudgeCounter: number lastToolPrune: boolean lastCompaction: number + currentTurn: number // Current turn count derived from step-start parts + isReasoningModel: boolean // Whether the current model has reasoning capabilities } diff --git a/lib/strategies/deduplication.ts b/lib/strategies/deduplication.ts index 21c4be6..101e664 100644 --- a/lib/strategies/deduplication.ts +++ b/lib/strategies/deduplication.ts @@ -13,7 +13,7 @@ export const deduplicate = ( state: SessionState, logger: Logger, config: PluginConfig, - messages: WithParts[] + messages: WithParts[], ): void => { if (!config.strategies.deduplication.enabled) { return @@ -27,7 +27,7 @@ export const deduplicate = ( // Filter out IDs already pruned const alreadyPruned = new Set(state.prune.toolIds) - const unprunedIds = allToolIds.filter(id => !alreadyPruned.has(id)) + const unprunedIds = allToolIds.filter((id) => !alreadyPruned.has(id)) if (unprunedIds.length === 0) { return @@ -41,7 +41,7 @@ export const deduplicate = ( for (const id of unprunedIds) { const metadata = state.toolParameters.get(id) if (!metadata) { - logger.warn(`Missing metadata for tool call ID: ${id}`) + // logger.warn(`Missing metadata for tool call ID: ${id}`) continue } @@ -86,7 +86,7 @@ function createToolSignature(tool: string, parameters?: any): string { } function normalizeParameters(params: any): any { - if (typeof params !== 'object' || params === null) return params + if (typeof params !== "object" || params === null) return params if (Array.isArray(params)) return params const normalized: any = {} @@ -99,7 +99,7 @@ function normalizeParameters(params: any): any { } function sortObjectKeys(obj: any): any { - if (typeof obj !== 'object' || obj === null) return obj + if (typeof obj !== "object" || obj === null) return obj if (Array.isArray(obj)) return obj.map(sortObjectKeys) const sorted: any = {} diff --git a/lib/strategies/index.ts b/lib/strategies/index.ts index 869a243..02d2f83 100644 --- a/lib/strategies/index.ts +++ b/lib/strategies/index.ts @@ -1,4 +1,4 @@ export { deduplicate } from "./deduplication" export { runOnIdle } from "./on-idle" -export { createPruneTool } from "./prune-tool" +export { createDiscardTool, createExtractTool } from "./tools" export { supersedeWrites } from "./supersede-writes" diff --git a/lib/strategies/on-idle.ts b/lib/strategies/on-idle.ts index f0870c2..43f481c 100644 --- a/lib/strategies/on-idle.ts +++ b/lib/strategies/on-idle.ts @@ -21,7 +21,7 @@ export interface OnIdleResult { function parseMessages( state: SessionState, messages: WithParts[], - toolParametersCache: Map + toolParametersCache: Map, ): { toolCallIds: string[] toolMetadata: Map @@ -45,7 +45,8 @@ function parseMessages( tool: part.tool, parameters: parameters, status: part.state?.status, - error: part.state?.status === "error" ? part.state.error : undefined + error: part.state?.status === "error" ? part.state.error : undefined, + turn: cachedData?.turn ?? 0, }) } } @@ -63,26 +64,28 @@ function replacePrunedToolOutputs(messages: WithParts[], prunedIds: string[]): W const prunedIdsSet = new Set(prunedIds) - return messages.map(msg => { + return messages.map((msg) => { if (!msg.parts) return msg return { ...msg, parts: msg.parts.map((part: any) => { - if (part.type === 'tool' && + if ( + part.type === "tool" && part.callID && prunedIdsSet.has(part.callID) && - part.state?.output) { + part.state?.output + ) { return { ...part, state: { ...part.state, - output: '[Output removed to save context - information superseded or no longer needed]' - } + output: "[Output removed to save context - information superseded or no longer needed]", + }, } } return part - }) + }), } }) as WithParts[] } @@ -99,10 +102,10 @@ async function runLlmAnalysis( unprunedToolCallIds: string[], alreadyPrunedIds: string[], toolMetadata: Map, - workingDirectory?: string + workingDirectory?: string, ): Promise { const protectedToolCallIds: string[] = [] - const prunableToolCallIds = unprunedToolCallIds.filter(id => { + const prunableToolCallIds = unprunedToolCallIds.filter((id) => { const metadata = toolMetadata.get(id) if (metadata && config.strategies.onIdle.protectedTools.includes(metadata.tool)) { protectedToolCallIds.push(id) @@ -123,7 +126,7 @@ async function runLlmAnalysis( if (model?.providerID && model?.modelID) { validModelInfo = { providerID: model.providerID, - modelID: model.modelID + modelID: model.modelID, } } } @@ -132,15 +135,19 @@ async function runLlmAnalysis( validModelInfo, logger, config.strategies.onIdle.model, - workingDirectory + workingDirectory, ) - logger.info(`OnIdle Model: ${modelSelection.modelInfo.providerID}/${modelSelection.modelInfo.modelID}`, { - source: modelSelection.source - }) + logger.info( + `OnIdle Model: ${modelSelection.modelInfo.providerID}/${modelSelection.modelInfo.modelID}`, + { + source: modelSelection.source, + }, + ) if (modelSelection.failedModel && config.strategies.onIdle.showModelErrorToasts) { - const skipAi = modelSelection.source === 'fallback' && config.strategies.onIdle.strictModelSelection + const skipAi = + modelSelection.source === "fallback" && config.strategies.onIdle.strictModelSelection try { await client.tui.showToast({ body: { @@ -149,20 +156,20 @@ async function runLlmAnalysis( ? `${modelSelection.failedModel.providerID}/${modelSelection.failedModel.modelID} failed\nAI analysis skipped (strictModelSelection enabled)` : `${modelSelection.failedModel.providerID}/${modelSelection.failedModel.modelID} failed\nUsing ${modelSelection.modelInfo.providerID}/${modelSelection.modelInfo.modelID}`, variant: "info", - duration: 5000 - } + duration: 5000, + }, }) } catch { // Ignore toast errors } } - if (modelSelection.source === 'fallback' && config.strategies.onIdle.strictModelSelection) { + if (modelSelection.source === "fallback" && config.strategies.onIdle.strictModelSelection) { logger.info("Skipping AI analysis (fallback model, strictModelSelection enabled)") return [] } - const { generateObject } = await import('ai') + const { generateObject } = await import("ai") const sanitizedMessages = replacePrunedToolOutputs(messages, alreadyPrunedIds) @@ -170,7 +177,7 @@ async function runLlmAnalysis( prunableToolCallIds, sanitizedMessages, alreadyPrunedIds, - protectedToolCallIds + protectedToolCallIds, ) const result = await generateObject({ @@ -179,19 +186,17 @@ async function runLlmAnalysis( pruned_tool_call_ids: z.array(z.string()), reasoning: z.string(), }), - prompt: analysisPrompt + prompt: analysisPrompt, }) const rawLlmPrunedIds = result.object.pruned_tool_call_ids - const llmPrunedIds = rawLlmPrunedIds.filter(id => - prunableToolCallIds.includes(id) - ) + const llmPrunedIds = rawLlmPrunedIds.filter((id) => prunableToolCallIds.includes(id)) // Always log LLM output as debug - const reasoning = result.object.reasoning.replace(/\n+/g, ' ').replace(/\s+/g, ' ').trim() + const reasoning = result.object.reasoning.replace(/\n+/g, " ").replace(/\s+/g, " ").trim() logger.debug(`OnIdle LLM output`, { pruned_tool_call_ids: rawLlmPrunedIds, - reasoning: reasoning + reasoning: reasoning, }) return llmPrunedIds @@ -206,7 +211,7 @@ export async function runOnIdle( state: SessionState, logger: Logger, config: PluginConfig, - workingDirectory?: string + workingDirectory?: string, ): Promise { try { if (!state.sessionId) { @@ -218,7 +223,7 @@ export async function runOnIdle( // Fetch session info and messages const [sessionInfoResponse, messagesResponse] = await Promise.all([ client.session.get({ path: { id: sessionId } }), - client.session.messages({ path: { id: sessionId }}) + client.session.messages({ path: { id: sessionId } }), ]) const sessionInfo = sessionInfoResponse.data @@ -232,14 +237,14 @@ export async function runOnIdle( const { toolCallIds, toolMetadata } = parseMessages(state, messages, state.toolParameters) const alreadyPrunedIds = state.prune.toolIds - const unprunedToolCallIds = toolCallIds.filter(id => !alreadyPrunedIds.includes(id)) + const unprunedToolCallIds = toolCallIds.filter((id) => !alreadyPrunedIds.includes(id)) if (unprunedToolCallIds.length === 0) { return null } // Count prunable tools (excluding protected) - const candidateCount = unprunedToolCallIds.filter(id => { + const candidateCount = unprunedToolCallIds.filter((id) => { const metadata = toolMetadata.get(id) return !metadata || !config.strategies.onIdle.protectedTools.includes(metadata.tool) }).length @@ -258,10 +263,10 @@ export async function runOnIdle( unprunedToolCallIds, alreadyPrunedIds, toolMetadata, - workingDirectory + workingDirectory, ) - const newlyPrunedIds = llmPrunedIds.filter(id => !alreadyPrunedIds.includes(id)) + const newlyPrunedIds = llmPrunedIds.filter((id) => !alreadyPrunedIds.includes(id)) if (newlyPrunedIds.length === 0) { return null @@ -270,7 +275,7 @@ export async function runOnIdle( // Log the tool IDs being pruned with their tool names for (const id of newlyPrunedIds) { const metadata = toolMetadata.get(id) - const toolName = metadata?.tool || 'unknown' + const toolName = metadata?.tool || "unknown" logger.info(`OnIdle pruning tool: ${toolName}`, { callID: id }) } @@ -300,7 +305,7 @@ export async function runOnIdle( prunedToolMetadata, undefined, // reason currentParams, - workingDirectory || "" + workingDirectory || "", ) state.stats.totalPruneTokens += state.stats.pruneTokenCounter @@ -310,7 +315,7 @@ export async function runOnIdle( // Persist state const sessionName = sessionInfo?.title - saveSessionState(state, logger, sessionName).catch(err => { + saveSessionState(state, logger, sessionName).catch((err) => { logger.error("Failed to persist state", { error: err.message }) }) diff --git a/lib/strategies/prune-tool.ts b/lib/strategies/prune-tool.ts deleted file mode 100644 index 6cf9052..0000000 --- a/lib/strategies/prune-tool.ts +++ /dev/null @@ -1,138 +0,0 @@ -import { tool } from "@opencode-ai/plugin" -import type { SessionState, ToolParameterEntry, WithParts } from "../state" -import type { PluginConfig } from "../config" -import { buildToolIdList } from "../messages/utils" -import { PruneReason, sendUnifiedNotification } from "../ui/notification" -import { formatPruningResultForTool } from "../ui/utils" -import { ensureSessionInitialized } from "../state" -import { saveSessionState } from "../state/persistence" -import type { Logger } from "../logger" -import { loadPrompt } from "../prompt" -import { calculateTokensSaved, getCurrentParams } from "./utils" - -/** Tool description loaded from prompts/tool.txt */ -const TOOL_DESCRIPTION = loadPrompt("tool") - -export interface PruneToolContext { - client: any - state: SessionState - logger: Logger - config: PluginConfig - workingDirectory: string -} - -/** - * Creates the prune tool definition. - * Accepts numeric IDs from the list and prunes those tool outputs. - */ -export function createPruneTool( - ctx: PruneToolContext, -): ReturnType { - return tool({ - description: TOOL_DESCRIPTION, - args: { - ids: tool.schema.array( - tool.schema.string() - ).describe( - "First element is the reason ('completion', 'noise', 'consolidation'), followed by numeric IDs as strings to prune" - ), - }, - async execute(args, toolCtx) { - const { client, state, logger, config, workingDirectory } = ctx - const sessionId = toolCtx.sessionID - - logger.info("Prune tool invoked") - logger.info(JSON.stringify(args)) - - if (!args.ids || args.ids.length === 0) { - logger.debug("Prune tool called but args.ids is empty or undefined: " + JSON.stringify(args)) - return "No IDs provided. Check the list for available IDs to prune." - } - - // Parse reason from first element, numeric IDs from the rest - - const reason = args.ids[0]; - const validReasons = ["completion", "noise", "consolidation"] as const - if (typeof reason !== "string" || !validReasons.includes(reason as any)) { - logger.debug("Invalid pruning reason provided: " + reason) - return "No valid pruning reason found. Use 'completion', 'noise', or 'consolidation' as the first element." - } - - const numericToolIds: number[] = args.ids.slice(1) - .map(id => parseInt(id, 10)) - .filter((n): n is number => !isNaN(n)) - if (numericToolIds.length === 0) { - logger.debug("No numeric tool IDs provided for pruning, yet prune tool was called: " + JSON.stringify(args)) - return "No numeric IDs provided. Format: [reason, id1, id2, ...] where reason is 'completion', 'noise', or 'consolidation'." - } - - // Fetch messages to calculate tokens and find current agent - const messagesResponse = await client.session.messages({ - path: { id: sessionId } - }) - const messages: WithParts[] = messagesResponse.data || messagesResponse - - await ensureSessionInitialized(ctx.client, state, sessionId, logger, messages) - - const currentParams = getCurrentParams(messages, logger) - const toolIdList: string[] = buildToolIdList(state, messages, logger) - - // Validate that all numeric IDs are within bounds - if (numericToolIds.some(id => id < 0 || id >= toolIdList.length)) { - logger.debug("Invalid tool IDs provided: " + numericToolIds.join(", ")) - return "Invalid IDs provided. Only use numeric IDs from the list." - } - - // Check for protected tools (model hallucinated an ID not in the prunable list) - for (const index of numericToolIds) { - const id = toolIdList[index] - const metadata = state.toolParameters.get(id) - if (metadata && config.strategies.pruneTool.protectedTools.includes(metadata.tool)) { - return "Invalid IDs provided. Only use numeric IDs from the list." - } - } - - const pruneToolIds: string[] = numericToolIds.map(index => toolIdList[index]) - state.prune.toolIds.push(...pruneToolIds) - - const toolMetadata = new Map() - for (const id of pruneToolIds) { - const toolParameters = state.toolParameters.get(id) - if (toolParameters) { - toolMetadata.set(id, toolParameters) - } else { - logger.debug("No metadata found for ID", { id }) - } - } - - state.stats.pruneTokenCounter += calculateTokensSaved(state, messages, pruneToolIds) - - await sendUnifiedNotification( - client, - logger, - config, - state, - sessionId, - pruneToolIds, - toolMetadata, - reason as PruneReason, - currentParams, - workingDirectory - ) - - state.stats.totalPruneTokens += state.stats.pruneTokenCounter - state.stats.pruneTokenCounter = 0 - state.nudgeCounter = 0 - - saveSessionState(state, logger) - .catch(err => logger.error("Failed to persist state", { error: err.message })) - - return formatPruningResultForTool( - pruneToolIds, - toolMetadata, - workingDirectory - ) - }, - }) -} - diff --git a/lib/strategies/supersede-writes.ts b/lib/strategies/supersede-writes.ts index b8bb847..327cb58 100644 --- a/lib/strategies/supersede-writes.ts +++ b/lib/strategies/supersede-writes.ts @@ -16,7 +16,7 @@ export const supersedeWrites = ( state: SessionState, logger: Logger, config: PluginConfig, - messages: WithParts[] + messages: WithParts[], ): void => { if (!config.strategies.supersedeWrites.enabled) { return @@ -31,14 +31,14 @@ export const supersedeWrites = ( // Filter out IDs already pruned const alreadyPruned = new Set(state.prune.toolIds) - const unprunedIds = allToolIds.filter(id => !alreadyPruned.has(id)) + const unprunedIds = allToolIds.filter((id) => !alreadyPruned.has(id)) if (unprunedIds.length === 0) { return } // Track write tools by file path: filePath -> [{ id, index }] // We track index to determine chronological order - const writesByFile = new Map() + const writesByFile = new Map() // Track read file paths with their index const readsByFile = new Map() @@ -55,12 +55,12 @@ export const supersedeWrites = ( continue } - if (metadata.tool === 'write') { + if (metadata.tool === "write") { if (!writesByFile.has(filePath)) { writesByFile.set(filePath, []) } writesByFile.get(filePath)!.push({ id, index: i }) - } else if (metadata.tool === 'read') { + } else if (metadata.tool === "read") { if (!readsByFile.has(filePath)) { readsByFile.set(filePath, []) } @@ -85,7 +85,7 @@ export const supersedeWrites = ( } // Check if any read comes after this write - const hasSubsequentRead = reads.some(readIndex => readIndex > write.index) + const hasSubsequentRead = reads.some((readIndex) => readIndex > write.index) if (hasSubsequentRead) { newPruneIds.push(write.id) } diff --git a/lib/strategies/tools.ts b/lib/strategies/tools.ts new file mode 100644 index 0000000..74ecf7e --- /dev/null +++ b/lib/strategies/tools.ts @@ -0,0 +1,201 @@ +import { tool } from "@opencode-ai/plugin" +import type { SessionState, ToolParameterEntry, WithParts } from "../state" +import type { PluginConfig } from "../config" +import { buildToolIdList } from "../messages/utils" +import { + PruneReason, + sendUnifiedNotification, + sendDistillationNotification, +} from "../ui/notification" +import { formatPruningResultForTool } from "../ui/utils" +import { ensureSessionInitialized } from "../state" +import { saveSessionState } from "../state/persistence" +import type { Logger } from "../logger" +import { loadPrompt } from "../prompt" +import { calculateTokensSaved, getCurrentParams } from "./utils" + +const DISCARD_TOOL_DESCRIPTION = loadPrompt("discard-tool-spec") +const EXTRACT_TOOL_DESCRIPTION = loadPrompt("extract-tool-spec") + +export interface PruneToolContext { + client: any + state: SessionState + logger: Logger + config: PluginConfig + workingDirectory: string +} + +// Shared logic for executing prune operations. +async function executePruneOperation( + ctx: PruneToolContext, + toolCtx: { sessionID: string }, + ids: string[], + reason: PruneReason, + toolName: string, + distillation?: string[], +): Promise { + const { client, state, logger, config, workingDirectory } = ctx + const sessionId = toolCtx.sessionID + + logger.info(`${toolName} tool invoked`) + logger.info(JSON.stringify(reason ? { ids, reason } : { ids })) + + if (!ids || ids.length === 0) { + logger.debug(`${toolName} tool called but ids is empty or undefined`) + return `No IDs provided. Check the list for available IDs to ${toolName.toLowerCase()}.` + } + + const numericToolIds: number[] = ids + .map((id) => parseInt(id, 10)) + .filter((n): n is number => !isNaN(n)) + + if (numericToolIds.length === 0) { + logger.debug(`No numeric tool IDs provided for ${toolName}: ` + JSON.stringify(ids)) + return "No numeric IDs provided. Format: ids: [id1, id2, ...]" + } + + // Fetch messages to calculate tokens and find current agent + const messagesResponse = await client.session.messages({ + path: { id: sessionId }, + }) + const messages: WithParts[] = messagesResponse.data || messagesResponse + + await ensureSessionInitialized(ctx.client, state, sessionId, logger, messages) + + const currentParams = getCurrentParams(messages, logger) + const toolIdList: string[] = buildToolIdList(state, messages, logger) + + // Validate that all numeric IDs are within bounds + if (numericToolIds.some((id) => id < 0 || id >= toolIdList.length)) { + logger.debug("Invalid tool IDs provided: " + numericToolIds.join(", ")) + return "Invalid IDs provided. Only use numeric IDs from the list." + } + + // Validate that all IDs exist in cache and aren't protected + // (rejects hallucinated IDs and turn-protected tools not shown in ) + for (const index of numericToolIds) { + const id = toolIdList[index] + const metadata = state.toolParameters.get(id) + if (!metadata) { + logger.debug( + "Rejecting prune request - ID not in cache (turn-protected or hallucinated)", + { index, id }, + ) + return "Invalid IDs provided. Only use numeric IDs from the list." + } + const allProtectedTools = config.tools.settings.protectedTools + if (allProtectedTools.includes(metadata.tool)) { + logger.debug("Rejecting prune request - protected tool", { + index, + id, + tool: metadata.tool, + }) + return "Invalid IDs provided. Only use numeric IDs from the list." + } + } + + const pruneToolIds: string[] = numericToolIds.map((index) => toolIdList[index]) + state.prune.toolIds.push(...pruneToolIds) + + const toolMetadata = new Map() + for (const id of pruneToolIds) { + const toolParameters = state.toolParameters.get(id) + if (toolParameters) { + toolMetadata.set(id, toolParameters) + } else { + logger.debug("No metadata found for ID", { id }) + } + } + + state.stats.pruneTokenCounter += calculateTokensSaved(state, messages, pruneToolIds) + + await sendUnifiedNotification( + client, + logger, + config, + state, + sessionId, + pruneToolIds, + toolMetadata, + reason, + currentParams, + workingDirectory, + ) + + if (distillation && config.tools.extract.showDistillation) { + await sendDistillationNotification(client, logger, sessionId, distillation, currentParams) + } + + state.stats.totalPruneTokens += state.stats.pruneTokenCounter + state.stats.pruneTokenCounter = 0 + state.nudgeCounter = 0 + + saveSessionState(state, logger).catch((err) => + logger.error("Failed to persist state", { error: err.message }), + ) + + return formatPruningResultForTool(pruneToolIds, toolMetadata, workingDirectory) +} + +export function createDiscardTool(ctx: PruneToolContext): ReturnType { + return tool({ + description: DISCARD_TOOL_DESCRIPTION, + args: { + ids: tool.schema + .array(tool.schema.string()) + .describe( + "First element is the reason ('completion' or 'noise'), followed by numeric IDs as strings to discard", + ), + }, + async execute(args, toolCtx) { + // Parse reason from first element, numeric IDs from the rest + const reason = args.ids?.[0] + const validReasons = ["completion", "noise"] as const + if (typeof reason !== "string" || !validReasons.includes(reason as any)) { + ctx.logger.debug("Invalid discard reason provided: " + reason) + return "No valid reason found. Use 'completion' or 'noise' as the first element." + } + + const numericIds = args.ids.slice(1) + + return executePruneOperation(ctx, toolCtx, numericIds, reason as PruneReason, "Discard") + }, + }) +} + +export function createExtractTool(ctx: PruneToolContext): ReturnType { + return tool({ + description: EXTRACT_TOOL_DESCRIPTION, + args: { + ids: tool.schema + .array(tool.schema.string()) + .describe("Numeric IDs as strings to extract from the list"), + distillation: tool.schema + .array(tool.schema.string()) + .describe( + "REQUIRED. Array of strings, one per ID (positional: distillation[0] is for ids[0], etc.)", + ), + }, + async execute(args, toolCtx) { + if (!args.distillation || args.distillation.length === 0) { + ctx.logger.debug( + "Extract tool called without distillation: " + JSON.stringify(args), + ) + return "Missing distillation. You must provide a distillation string for each ID." + } + + // Log the distillation for debugging/analysis + ctx.logger.info("Distillation data received:") + ctx.logger.info(JSON.stringify(args.distillation, null, 2)) + + return executePruneOperation( + ctx, + toolCtx, + args.ids, + "consolidation" as PruneReason, + "Extract", + args.distillation, + ) + }, + }) +} diff --git a/lib/strategies/utils.ts b/lib/strategies/utils.ts index 3c6a1b1..5f141ca 100644 --- a/lib/strategies/utils.ts +++ b/lib/strategies/utils.ts @@ -1,15 +1,15 @@ import { SessionState, WithParts } from "../state" import { UserMessage } from "@opencode-ai/sdk" import { Logger } from "../logger" -import { encode } from 'gpt-tokenizer' +import { encode } from "gpt-tokenizer" import { getLastUserMessage, isMessageCompacted } from "../shared-utils" export function getCurrentParams( messages: WithParts[], - logger: Logger + logger: Logger, ): { - providerId: string | undefined, - modelId: string | undefined, + providerId: string | undefined + modelId: string | undefined agent: string | undefined } { const userMsg = getLastUserMessage(messages) @@ -29,20 +29,19 @@ export function getCurrentParams( */ function estimateTokensBatch(texts: string[]): number[] { try { - return texts.map(text => encode(text).length) + return texts.map((text) => encode(text).length) } catch { - return texts.map(text => Math.round(text.length / 4)) + return texts.map((text) => Math.round(text.length / 4)) } } /** * Calculates approximate tokens saved by pruning the given tool call IDs. - * TODO: Make it count message content that are not tool outputs. Currently it ONLY covers tool outputs and errors */ export const calculateTokensSaved = ( state: SessionState, messages: WithParts[], - pruneToolIds: string[] + pruneToolIds: string[], ): number => { try { const contents: string[] = [] @@ -51,29 +50,43 @@ export const calculateTokensSaved = ( continue } for (const part of msg.parts) { - if (part.type !== 'tool' || !pruneToolIds.includes(part.callID)) { + if (part.type !== "tool" || !pruneToolIds.includes(part.callID)) { continue } // For write and edit tools, count input content as that is all we prune for these tools // (input is present in both completed and error states) - if (part.tool === "write" || part.tool === "edit") { + if (part.tool === "write") { const inputContent = part.state.input?.content - const content = typeof inputContent === 'string' - ? inputContent - : JSON.stringify(inputContent ?? '') + const content = + typeof inputContent === "string" + ? inputContent + : JSON.stringify(inputContent ?? "") contents.push(content) continue } + if (part.tool === "edit") { + const oldString = part.state.input?.oldString + const newString = part.state.input?.newString + if (typeof oldString === "string") { + contents.push(oldString) + } + if (typeof newString === "string") { + contents.push(newString) + } + continue + } // For other tools, count output or error based on status if (part.state.status === "completed") { - const content = typeof part.state.output === 'string' - ? part.state.output - : JSON.stringify(part.state.output) + const content = + typeof part.state.output === "string" + ? part.state.output + : JSON.stringify(part.state.output) contents.push(content) } else if (part.state.status === "error") { - const content = typeof part.state.error === 'string' - ? part.state.error - : JSON.stringify(part.state.error) + const content = + typeof part.state.error === "string" + ? part.state.error + : JSON.stringify(part.state.error) contents.push(content) } } diff --git a/lib/ui/notification.ts b/lib/ui/notification.ts index ead50ac..80f9f87 100644 --- a/lib/ui/notification.ts +++ b/lib/ui/notification.ts @@ -8,28 +8,20 @@ export type PruneReason = "completion" | "noise" | "consolidation" export const PRUNE_REASON_LABELS: Record = { completion: "Task Complete", noise: "Noise Removal", - consolidation: "Consolidation" + consolidation: "Consolidation", } -function formatStatsHeader( - totalTokensSaved: number, - pruneTokenCounter: number -): string { +function formatStatsHeader(totalTokensSaved: number, pruneTokenCounter: number): string { const totalTokensSavedStr = `~${formatTokenCount(totalTokensSaved + pruneTokenCounter)}` - return [ - `▣ DCP | ${totalTokensSavedStr} saved total`, - ].join('\n') + return [`▣ DCP | ${totalTokensSavedStr} saved total`].join("\n") } -function buildMinimalMessage( - state: SessionState, - reason: PruneReason | undefined -): string { - const reasonSuffix = reason ? ` [${PRUNE_REASON_LABELS[reason]}]` : '' - return formatStatsHeader( - state.stats.totalPruneTokens, - state.stats.pruneTokenCounter - ) + reasonSuffix +function buildMinimalMessage(state: SessionState, reason: PruneReason | undefined): string { + const reasonSuffix = reason ? ` [${PRUNE_REASON_LABELS[reason]}]` : "" + return ( + formatStatsHeader(state.stats.totalPruneTokens, state.stats.pruneTokenCounter) + + reasonSuffix + ) } function buildDetailedMessage( @@ -37,17 +29,17 @@ function buildDetailedMessage( reason: PruneReason | undefined, pruneToolIds: string[], toolMetadata: Map, - workingDirectory?: string + workingDirectory?: string, ): string { let message = formatStatsHeader(state.stats.totalPruneTokens, state.stats.pruneTokenCounter) if (pruneToolIds.length > 0) { const pruneTokenCounterStr = `~${formatTokenCount(state.stats.pruneTokenCounter)}` - const reasonLabel = reason ? ` — ${PRUNE_REASON_LABELS[reason]}` : '' + const reasonLabel = reason ? ` — ${PRUNE_REASON_LABELS[reason]}` : "" message += `\n\n▣ Pruning (${pruneTokenCounterStr})${reasonLabel}` const itemLines = formatPrunedItemsList(pruneToolIds, toolMetadata, workingDirectory) - message += '\n' + itemLines.join('\n') + message += "\n" + itemLines.join("\n") } return message.trim() @@ -63,56 +55,92 @@ export async function sendUnifiedNotification( toolMetadata: Map, reason: PruneReason | undefined, params: any, - workingDirectory: string + workingDirectory: string, ): Promise { const hasPruned = pruneToolIds.length > 0 if (!hasPruned) { return false } - if (config.pruningSummary === 'off') { + if (config.pruneNotification === "off") { return false } - const message = config.pruningSummary === 'minimal' - ? buildMinimalMessage(state, reason) - : buildDetailedMessage(state, reason, pruneToolIds, toolMetadata, workingDirectory) + const message = + config.pruneNotification === "minimal" + ? buildMinimalMessage(state, reason) + : buildDetailedMessage(state, reason, pruneToolIds, toolMetadata, workingDirectory) await sendIgnoredMessage(client, sessionId, message, params, logger) return true } +function formatDistillationMessage(distillation: Record): string { + const lines: string[] = ["▣ DCP | Extracted Distillation"] + + for (const [id, findings] of Object.entries(distillation)) { + lines.push(`\n─── ID ${id} ───`) + if (typeof findings === "object" && findings !== null) { + lines.push(JSON.stringify(findings, null, 2)) + } else { + lines.push(String(findings)) + } + } + + return lines.join("\n") +} + +export async function sendDistillationNotification( + client: any, + logger: Logger, + sessionId: string, + distillation: Record, + params: any, +): Promise { + if (!distillation || Object.keys(distillation).length === 0) { + return false + } + + const message = formatDistillationMessage(distillation) + await sendIgnoredMessage(client, sessionId, message, params, logger) + return true +} + export async function sendIgnoredMessage( client: any, sessionID: string, text: string, params: any, - logger: Logger + logger: Logger, ): Promise { const agent = params.agent || undefined - const model = params.providerId && params.modelId ? { - providerID: params.providerId, - modelID: params.modelId - } : undefined + const model = + params.providerId && params.modelId + ? { + providerID: params.providerId, + modelID: params.modelId, + } + : undefined try { await client.session.prompt({ path: { - id: sessionID + id: sessionID, }, body: { noReply: true, agent: agent, model: model, - parts: [{ - type: 'text', - text: text, - ignored: true - }] - } + parts: [ + { + type: "text", + text: text, + ignored: true, + }, + ], + }, }) } catch (error: any) { logger.error("Failed to send notification", { error: error.message }) } } - diff --git a/lib/ui/utils.ts b/lib/ui/utils.ts index 11335fa..11a4363 100644 --- a/lib/ui/utils.ts +++ b/lib/ui/utils.ts @@ -3,14 +3,14 @@ import { extractParameterKey } from "../messages/utils" export function formatTokenCount(tokens: number): string { if (tokens >= 1000) { - return `${(tokens / 1000).toFixed(1)}K`.replace('.0K', 'K') + ' tokens' + return `${(tokens / 1000).toFixed(1)}K`.replace(".0K", "K") + " tokens" } - return tokens.toString() + ' tokens' + return tokens.toString() + " tokens" } export function truncate(str: string, maxLen: number = 60): string { if (str.length <= maxLen) return str - return str.slice(0, maxLen - 3) + '...' + return str.slice(0, maxLen - 3) + "..." } export function shortenPath(input: string, workingDirectory?: string): string { @@ -27,11 +27,11 @@ export function shortenPath(input: string, workingDirectory?: string): string { function shortenSinglePath(path: string, workingDirectory?: string): string { if (workingDirectory) { - if (path.startsWith(workingDirectory + '/')) { + if (path.startsWith(workingDirectory + "/")) { return path.slice(workingDirectory.length + 1) } if (path === workingDirectory) { - return '.' + return "." } } @@ -44,7 +44,7 @@ function shortenSinglePath(path: string, workingDirectory?: string): string { export function formatPrunedItemsList( pruneToolIds: string[], toolMetadata: Map, - workingDirectory?: string + workingDirectory?: string, ): string[] { const lines: string[] = [] @@ -63,13 +63,11 @@ export function formatPrunedItemsList( } } - const knownCount = pruneToolIds.filter(id => - toolMetadata.has(id) - ).length + const knownCount = pruneToolIds.filter((id) => toolMetadata.has(id)).length const unknownCount = pruneToolIds.length - knownCount if (unknownCount > 0) { - lines.push(`→ (${unknownCount} tool${unknownCount > 1 ? 's' : ''} with unknown metadata)`) + lines.push(`→ (${unknownCount} tool${unknownCount > 1 ? "s" : ""} with unknown metadata)`) } return lines @@ -81,16 +79,16 @@ export function formatPrunedItemsList( export function formatPruningResultForTool( prunedIds: string[], toolMetadata: Map, - workingDirectory?: string + workingDirectory?: string, ): string { const lines: string[] = [] lines.push(`Context pruning complete. Pruned ${prunedIds.length} tool outputs.`) - lines.push('') + lines.push("") if (prunedIds.length > 0) { lines.push(`Semantically pruned (${prunedIds.length}):`) lines.push(...formatPrunedItemsList(prunedIds, toolMetadata, workingDirectory)) } - return lines.join('\n').trim() + return lines.join("\n").trim() } diff --git a/package-lock.json b/package-lock.json index 42b0ebd..f4c4016 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,2309 +1,2326 @@ { - "name": "@tarquinen/opencode-dcp", - "version": "1.0.4", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "@tarquinen/opencode-dcp", - "version": "1.0.4", - "license": "MIT", - "dependencies": { - "@ai-sdk/openai-compatible": "^1.0.28", - "@opencode-ai/sdk": "latest", - "@tarquinen/opencode-auth-provider": "^0.1.7", - "ai": "^5.0.106", - "gpt-tokenizer": "^3.4.0", - "jsonc-parser": "^3.3.1", - "zod": "^4.1.13" - }, - "devDependencies": { - "@opencode-ai/plugin": "^1.0.143", - "@types/node": "^24.10.1", - "tsx": "^4.21.0", - "typescript": "^5.9.3" - }, - "peerDependencies": { - "@opencode-ai/plugin": ">=0.13.7" - } - }, - "node_modules/@ai-sdk/gateway": { - "version": "2.0.18", - "resolved": "https://registry.npmjs.org/@ai-sdk/gateway/-/gateway-2.0.18.tgz", - "integrity": "sha512-sDQcW+6ck2m0pTIHW6BPHD7S125WD3qNkx/B8sEzJp/hurocmJ5Cni0ybExg6sQMGo+fr/GWOwpHF1cmCdg5rQ==", - "license": "Apache-2.0", - "dependencies": { - "@ai-sdk/provider": "2.0.0", - "@ai-sdk/provider-utils": "3.0.18", - "@vercel/oidc": "3.0.5" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "zod": "^3.25.76 || ^4.1.8" - } - }, - "node_modules/@ai-sdk/openai-compatible": { - "version": "1.0.28", - "resolved": "https://registry.npmjs.org/@ai-sdk/openai-compatible/-/openai-compatible-1.0.28.tgz", - "integrity": "sha512-yKubDxLYtXyGUzkr9lNStf/lE/I+Okc8tmotvyABhsQHHieLKk6oV5fJeRJxhr67Ejhg+FRnwUOxAmjRoFM4dA==", - "license": "Apache-2.0", - "dependencies": { - "@ai-sdk/provider": "2.0.0", - "@ai-sdk/provider-utils": "3.0.18" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "zod": "^3.25.76 || ^4.1.8" - } - }, - "node_modules/@ai-sdk/provider": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@ai-sdk/provider/-/provider-2.0.0.tgz", - "integrity": "sha512-6o7Y2SeO9vFKB8lArHXehNuusnpddKPk7xqL7T2/b+OvXMRIXUO1rR4wcv1hAFUAT9avGZshty3Wlua/XA7TvA==", - "license": "Apache-2.0", - "dependencies": { - "json-schema": "^0.4.0" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@ai-sdk/provider-utils": { - "version": "3.0.18", - "resolved": "https://registry.npmjs.org/@ai-sdk/provider-utils/-/provider-utils-3.0.18.tgz", - "integrity": "sha512-ypv1xXMsgGcNKUP+hglKqtdDuMg68nWHucPPAhIENrbFAI+xCHiqPVN8Zllxyv1TNZwGWUghPxJXU+Mqps0YRQ==", - "license": "Apache-2.0", - "dependencies": { - "@ai-sdk/provider": "2.0.0", - "@standard-schema/spec": "^1.0.0", - "eventsource-parser": "^3.0.6" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "zod": "^3.25.76 || ^4.1.8" - } - }, - "node_modules/@aws-crypto/sha256-browser": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/@aws-crypto/sha256-browser/-/sha256-browser-5.2.0.tgz", - "integrity": "sha512-AXfN/lGotSQwu6HNcEsIASo7kWXZ5HYWvfOmSNKDsEqC4OashTp8alTmaz+F7TC2L083SFv5RdB+qU3Vs1kZqw==", - "license": "Apache-2.0", - "dependencies": { - "@aws-crypto/sha256-js": "^5.2.0", - "@aws-crypto/supports-web-crypto": "^5.2.0", - "@aws-crypto/util": "^5.2.0", - "@aws-sdk/types": "^3.222.0", - "@aws-sdk/util-locate-window": "^3.0.0", - "@smithy/util-utf8": "^2.0.0", - "tslib": "^2.6.2" - } - }, - "node_modules/@aws-crypto/sha256-browser/node_modules/@smithy/is-array-buffer": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-2.2.0.tgz", - "integrity": "sha512-GGP3O9QFD24uGeAXYUjwSTXARoqpZykHadOmA8G5vfJPK0/DC67qa//0qvqrJzL1xc8WQWX7/yc7fwudjPHPhA==", - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/@aws-crypto/sha256-browser/node_modules/@smithy/util-buffer-from": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-2.2.0.tgz", - "integrity": "sha512-IJdWBbTcMQ6DA0gdNhh/BwrLkDR+ADW5Kr1aZmd4k3DIF6ezMV4R2NIAmT08wQJ3yUK82thHWmC/TnK/wpMMIA==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/is-array-buffer": "^2.2.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/@aws-crypto/sha256-browser/node_modules/@smithy/util-utf8": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-2.3.0.tgz", - "integrity": "sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/util-buffer-from": "^2.2.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/@aws-crypto/sha256-js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/@aws-crypto/sha256-js/-/sha256-js-5.2.0.tgz", - "integrity": "sha512-FFQQyu7edu4ufvIZ+OadFpHHOt+eSTBaYaki44c+akjg7qZg9oOQeLlk77F6tSYqjDAFClrHJk9tMf0HdVyOvA==", - "license": "Apache-2.0", - "dependencies": { - "@aws-crypto/util": "^5.2.0", - "@aws-sdk/types": "^3.222.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@aws-crypto/supports-web-crypto": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/@aws-crypto/supports-web-crypto/-/supports-web-crypto-5.2.0.tgz", - "integrity": "sha512-iAvUotm021kM33eCdNfwIN//F77/IADDSs58i+MDaOqFrVjZo9bAal0NK7HurRuWLLpF1iLX7gbWrjHjeo+YFg==", - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.6.2" - } - }, - "node_modules/@aws-crypto/util": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/@aws-crypto/util/-/util-5.2.0.tgz", - "integrity": "sha512-4RkU9EsI6ZpBve5fseQlGNUWKMa1RLPQ1dnjnQoe07ldfIzcsGb5hC5W0Dm7u423KWzawlrpbjXBrXCEv9zazQ==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "^3.222.0", - "@smithy/util-utf8": "^2.0.0", - "tslib": "^2.6.2" - } - }, - "node_modules/@aws-crypto/util/node_modules/@smithy/is-array-buffer": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-2.2.0.tgz", - "integrity": "sha512-GGP3O9QFD24uGeAXYUjwSTXARoqpZykHadOmA8G5vfJPK0/DC67qa//0qvqrJzL1xc8WQWX7/yc7fwudjPHPhA==", - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/@aws-crypto/util/node_modules/@smithy/util-buffer-from": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-2.2.0.tgz", - "integrity": "sha512-IJdWBbTcMQ6DA0gdNhh/BwrLkDR+ADW5Kr1aZmd4k3DIF6ezMV4R2NIAmT08wQJ3yUK82thHWmC/TnK/wpMMIA==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/is-array-buffer": "^2.2.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-2.3.0.tgz", - "integrity": "sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/util-buffer-from": "^2.2.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/@aws-sdk/client-cognito-identity": { - "version": "3.943.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-cognito-identity/-/client-cognito-identity-3.943.0.tgz", - "integrity": "sha512-XkuokRF2IQ+VLBn0AwrwfFOkZ2c1IXACwQdn3CDnpBZpT1s2hgH3MX0DoH9+41w4ar2QCSI09uAJiv9PX4DLoQ==", - "license": "Apache-2.0", - "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.943.0", - "@aws-sdk/credential-provider-node": "3.943.0", - "@aws-sdk/middleware-host-header": "3.936.0", - "@aws-sdk/middleware-logger": "3.936.0", - "@aws-sdk/middleware-recursion-detection": "3.936.0", - "@aws-sdk/middleware-user-agent": "3.943.0", - "@aws-sdk/region-config-resolver": "3.936.0", - "@aws-sdk/types": "3.936.0", - "@aws-sdk/util-endpoints": "3.936.0", - "@aws-sdk/util-user-agent-browser": "3.936.0", - "@aws-sdk/util-user-agent-node": "3.943.0", - "@smithy/config-resolver": "^4.4.3", - "@smithy/core": "^3.18.5", - "@smithy/fetch-http-handler": "^5.3.6", - "@smithy/hash-node": "^4.2.5", - "@smithy/invalid-dependency": "^4.2.5", - "@smithy/middleware-content-length": "^4.2.5", - "@smithy/middleware-endpoint": "^4.3.12", - "@smithy/middleware-retry": "^4.4.12", - "@smithy/middleware-serde": "^4.2.6", - "@smithy/middleware-stack": "^4.2.5", - "@smithy/node-config-provider": "^4.3.5", - "@smithy/node-http-handler": "^4.4.5", - "@smithy/protocol-http": "^5.3.5", - "@smithy/smithy-client": "^4.9.8", - "@smithy/types": "^4.9.0", - "@smithy/url-parser": "^4.2.5", - "@smithy/util-base64": "^4.3.0", - "@smithy/util-body-length-browser": "^4.2.0", - "@smithy/util-body-length-node": "^4.2.1", - "@smithy/util-defaults-mode-browser": "^4.3.11", - "@smithy/util-defaults-mode-node": "^4.2.14", - "@smithy/util-endpoints": "^3.2.5", - "@smithy/util-middleware": "^4.2.5", - "@smithy/util-retry": "^4.2.5", - "@smithy/util-utf8": "^4.2.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/client-sso": { - "version": "3.943.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.943.0.tgz", - "integrity": "sha512-kOTO2B8Ks2qX73CyKY8PAajtf5n39aMe2spoiOF5EkgSzGV7hZ/HONRDyADlyxwfsX39Q2F2SpPUaXzon32IGw==", - "license": "Apache-2.0", - "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.943.0", - "@aws-sdk/middleware-host-header": "3.936.0", - "@aws-sdk/middleware-logger": "3.936.0", - "@aws-sdk/middleware-recursion-detection": "3.936.0", - "@aws-sdk/middleware-user-agent": "3.943.0", - "@aws-sdk/region-config-resolver": "3.936.0", - "@aws-sdk/types": "3.936.0", - "@aws-sdk/util-endpoints": "3.936.0", - "@aws-sdk/util-user-agent-browser": "3.936.0", - "@aws-sdk/util-user-agent-node": "3.943.0", - "@smithy/config-resolver": "^4.4.3", - "@smithy/core": "^3.18.5", - "@smithy/fetch-http-handler": "^5.3.6", - "@smithy/hash-node": "^4.2.5", - "@smithy/invalid-dependency": "^4.2.5", - "@smithy/middleware-content-length": "^4.2.5", - "@smithy/middleware-endpoint": "^4.3.12", - "@smithy/middleware-retry": "^4.4.12", - "@smithy/middleware-serde": "^4.2.6", - "@smithy/middleware-stack": "^4.2.5", - "@smithy/node-config-provider": "^4.3.5", - "@smithy/node-http-handler": "^4.4.5", - "@smithy/protocol-http": "^5.3.5", - "@smithy/smithy-client": "^4.9.8", - "@smithy/types": "^4.9.0", - "@smithy/url-parser": "^4.2.5", - "@smithy/util-base64": "^4.3.0", - "@smithy/util-body-length-browser": "^4.2.0", - "@smithy/util-body-length-node": "^4.2.1", - "@smithy/util-defaults-mode-browser": "^4.3.11", - "@smithy/util-defaults-mode-node": "^4.2.14", - "@smithy/util-endpoints": "^3.2.5", - "@smithy/util-middleware": "^4.2.5", - "@smithy/util-retry": "^4.2.5", - "@smithy/util-utf8": "^4.2.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/core": { - "version": "3.943.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.943.0.tgz", - "integrity": "sha512-8CBy2hI9ABF7RBVQuY1bgf/ue+WPmM/hl0adrXFlhnhkaQP0tFY5zhiy1Y+n7V+5f3/ORoHBmCCQmcHDDYJqJQ==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.936.0", - "@aws-sdk/xml-builder": "3.930.0", - "@smithy/core": "^3.18.5", - "@smithy/node-config-provider": "^4.3.5", - "@smithy/property-provider": "^4.2.5", - "@smithy/protocol-http": "^5.3.5", - "@smithy/signature-v4": "^5.3.5", - "@smithy/smithy-client": "^4.9.8", - "@smithy/types": "^4.9.0", - "@smithy/util-base64": "^4.3.0", - "@smithy/util-middleware": "^4.2.5", - "@smithy/util-utf8": "^4.2.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/credential-provider-cognito-identity": { - "version": "3.943.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-cognito-identity/-/credential-provider-cognito-identity-3.943.0.tgz", - "integrity": "sha512-jZJ0uHjNlhfjx2ZX7YVYnh1wfSkLAvQmecGCSl9C6LJRNXy4uWFPbGjPqcA0tWp0WWIsUYhqjasgvCOMZIY8nw==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/client-cognito-identity": "3.943.0", - "@aws-sdk/types": "3.936.0", - "@smithy/property-provider": "^4.2.5", - "@smithy/types": "^4.9.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/credential-provider-env": { - "version": "3.943.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.943.0.tgz", - "integrity": "sha512-WnS5w9fK9CTuoZRVSIHLOMcI63oODg9qd1vXMYb7QGLGlfwUm4aG3hdu7i9XvYrpkQfE3dzwWLtXF4ZBuL1Tew==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/core": "3.943.0", - "@aws-sdk/types": "3.936.0", - "@smithy/property-provider": "^4.2.5", - "@smithy/types": "^4.9.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/credential-provider-http": { - "version": "3.943.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.943.0.tgz", - "integrity": "sha512-SA8bUcYDEACdhnhLpZNnWusBpdmj4Vl67Vxp3Zke7SvoWSYbuxa+tiDiC+c92Z4Yq6xNOuLPW912ZPb9/NsSkA==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/core": "3.943.0", - "@aws-sdk/types": "3.936.0", - "@smithy/fetch-http-handler": "^5.3.6", - "@smithy/node-http-handler": "^4.4.5", - "@smithy/property-provider": "^4.2.5", - "@smithy/protocol-http": "^5.3.5", - "@smithy/smithy-client": "^4.9.8", - "@smithy/types": "^4.9.0", - "@smithy/util-stream": "^4.5.6", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/credential-provider-ini": { - "version": "3.943.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.943.0.tgz", - "integrity": "sha512-BcLDb8l4oVW+NkuqXMlO7TnM6lBOWW318ylf4FRED/ply5eaGxkQYqdGvHSqGSN5Rb3vr5Ek0xpzSjeYD7C8Kw==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/core": "3.943.0", - "@aws-sdk/credential-provider-env": "3.943.0", - "@aws-sdk/credential-provider-http": "3.943.0", - "@aws-sdk/credential-provider-login": "3.943.0", - "@aws-sdk/credential-provider-process": "3.943.0", - "@aws-sdk/credential-provider-sso": "3.943.0", - "@aws-sdk/credential-provider-web-identity": "3.943.0", - "@aws-sdk/nested-clients": "3.943.0", - "@aws-sdk/types": "3.936.0", - "@smithy/credential-provider-imds": "^4.2.5", - "@smithy/property-provider": "^4.2.5", - "@smithy/shared-ini-file-loader": "^4.4.0", - "@smithy/types": "^4.9.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/credential-provider-login": { - "version": "3.943.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-login/-/credential-provider-login-3.943.0.tgz", - "integrity": "sha512-9iCOVkiRW+evxiJE94RqosCwRrzptAVPhRhGWv4osfYDhjNAvUMyrnZl3T1bjqCoKNcETRKEZIU3dqYHnUkcwQ==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/core": "3.943.0", - "@aws-sdk/nested-clients": "3.943.0", - "@aws-sdk/types": "3.936.0", - "@smithy/property-provider": "^4.2.5", - "@smithy/protocol-http": "^5.3.5", - "@smithy/shared-ini-file-loader": "^4.4.0", - "@smithy/types": "^4.9.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/credential-provider-node": { - "version": "3.943.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.943.0.tgz", - "integrity": "sha512-14eddaH/gjCWoLSAELVrFOQNyswUYwWphIt+PdsJ/FqVfP4ay2HsiZVEIYbQtmrKHaoLJhiZKwBQRjcqJDZG0w==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/credential-provider-env": "3.943.0", - "@aws-sdk/credential-provider-http": "3.943.0", - "@aws-sdk/credential-provider-ini": "3.943.0", - "@aws-sdk/credential-provider-process": "3.943.0", - "@aws-sdk/credential-provider-sso": "3.943.0", - "@aws-sdk/credential-provider-web-identity": "3.943.0", - "@aws-sdk/types": "3.936.0", - "@smithy/credential-provider-imds": "^4.2.5", - "@smithy/property-provider": "^4.2.5", - "@smithy/shared-ini-file-loader": "^4.4.0", - "@smithy/types": "^4.9.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/credential-provider-process": { - "version": "3.943.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.943.0.tgz", - "integrity": "sha512-GIY/vUkthL33AdjOJ8r9vOosKf/3X+X7LIiACzGxvZZrtoOiRq0LADppdiKIB48vTL63VvW+eRIOFAxE6UDekw==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/core": "3.943.0", - "@aws-sdk/types": "3.936.0", - "@smithy/property-provider": "^4.2.5", - "@smithy/shared-ini-file-loader": "^4.4.0", - "@smithy/types": "^4.9.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/credential-provider-sso": { - "version": "3.943.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.943.0.tgz", - "integrity": "sha512-1c5G11syUrru3D9OO6Uk+ul5e2lX1adb+7zQNyluNaLPXP6Dina6Sy6DFGRLu7tM8+M7luYmbS3w63rpYpaL+A==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/client-sso": "3.943.0", - "@aws-sdk/core": "3.943.0", - "@aws-sdk/token-providers": "3.943.0", - "@aws-sdk/types": "3.936.0", - "@smithy/property-provider": "^4.2.5", - "@smithy/shared-ini-file-loader": "^4.4.0", - "@smithy/types": "^4.9.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/credential-provider-web-identity": { - "version": "3.943.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.943.0.tgz", - "integrity": "sha512-VtyGKHxICSb4kKGuaqotxso8JVM8RjCS3UYdIMOxUt9TaFE/CZIfZKtjTr+IJ7M0P7t36wuSUb/jRLyNmGzUUA==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/core": "3.943.0", - "@aws-sdk/nested-clients": "3.943.0", - "@aws-sdk/types": "3.936.0", - "@smithy/property-provider": "^4.2.5", - "@smithy/shared-ini-file-loader": "^4.4.0", - "@smithy/types": "^4.9.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/credential-providers": { - "version": "3.943.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/credential-providers/-/credential-providers-3.943.0.tgz", - "integrity": "sha512-uZurSNsS01ehhrSwEPwcKdqp9lmd/x9q++BYO351bXyjSj1LzA/2lfUIxI2tCz/wAjJWOdnnlUdJj6P9I1uNvw==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/client-cognito-identity": "3.943.0", - "@aws-sdk/core": "3.943.0", - "@aws-sdk/credential-provider-cognito-identity": "3.943.0", - "@aws-sdk/credential-provider-env": "3.943.0", - "@aws-sdk/credential-provider-http": "3.943.0", - "@aws-sdk/credential-provider-ini": "3.943.0", - "@aws-sdk/credential-provider-login": "3.943.0", - "@aws-sdk/credential-provider-node": "3.943.0", - "@aws-sdk/credential-provider-process": "3.943.0", - "@aws-sdk/credential-provider-sso": "3.943.0", - "@aws-sdk/credential-provider-web-identity": "3.943.0", - "@aws-sdk/nested-clients": "3.943.0", - "@aws-sdk/types": "3.936.0", - "@smithy/config-resolver": "^4.4.3", - "@smithy/core": "^3.18.5", - "@smithy/credential-provider-imds": "^4.2.5", - "@smithy/node-config-provider": "^4.3.5", - "@smithy/property-provider": "^4.2.5", - "@smithy/types": "^4.9.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/middleware-host-header": { - "version": "3.936.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.936.0.tgz", - "integrity": "sha512-tAaObaAnsP1XnLGndfkGWFuzrJYuk9W0b/nLvol66t8FZExIAf/WdkT2NNAWOYxljVs++oHnyHBCxIlaHrzSiw==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.936.0", - "@smithy/protocol-http": "^5.3.5", - "@smithy/types": "^4.9.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/middleware-logger": { - "version": "3.936.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.936.0.tgz", - "integrity": "sha512-aPSJ12d3a3Ea5nyEnLbijCaaYJT2QjQ9iW+zGh5QcZYXmOGWbKVyPSxmVOboZQG+c1M8t6d2O7tqrwzIq8L8qw==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.936.0", - "@smithy/types": "^4.9.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/middleware-recursion-detection": { - "version": "3.936.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.936.0.tgz", - "integrity": "sha512-l4aGbHpXM45YNgXggIux1HgsCVAvvBoqHPkqLnqMl9QVapfuSTjJHfDYDsx1Xxct6/m7qSMUzanBALhiaGO2fA==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.936.0", - "@aws/lambda-invoke-store": "^0.2.0", - "@smithy/protocol-http": "^5.3.5", - "@smithy/types": "^4.9.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/middleware-user-agent": { - "version": "3.943.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.943.0.tgz", - "integrity": "sha512-956n4kVEwFNXndXfhSAN5wO+KRgqiWEEY+ECwLvxmmO8uQ0NWOa8l6l65nTtyuiWzMX81c9BvlyNR5EgUeeUvA==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/core": "3.943.0", - "@aws-sdk/types": "3.936.0", - "@aws-sdk/util-endpoints": "3.936.0", - "@smithy/core": "^3.18.5", - "@smithy/protocol-http": "^5.3.5", - "@smithy/types": "^4.9.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/nested-clients": { - "version": "3.943.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/nested-clients/-/nested-clients-3.943.0.tgz", - "integrity": "sha512-anFtB0p2FPuyUnbOULwGmKYqYKSq1M73c9uZ08jR/NCq6Trjq9cuF5TFTeHwjJyPRb4wMf2Qk859oiVfFqnQiw==", - "license": "Apache-2.0", - "dependencies": { - "@aws-crypto/sha256-browser": "5.2.0", - "@aws-crypto/sha256-js": "5.2.0", - "@aws-sdk/core": "3.943.0", - "@aws-sdk/middleware-host-header": "3.936.0", - "@aws-sdk/middleware-logger": "3.936.0", - "@aws-sdk/middleware-recursion-detection": "3.936.0", - "@aws-sdk/middleware-user-agent": "3.943.0", - "@aws-sdk/region-config-resolver": "3.936.0", - "@aws-sdk/types": "3.936.0", - "@aws-sdk/util-endpoints": "3.936.0", - "@aws-sdk/util-user-agent-browser": "3.936.0", - "@aws-sdk/util-user-agent-node": "3.943.0", - "@smithy/config-resolver": "^4.4.3", - "@smithy/core": "^3.18.5", - "@smithy/fetch-http-handler": "^5.3.6", - "@smithy/hash-node": "^4.2.5", - "@smithy/invalid-dependency": "^4.2.5", - "@smithy/middleware-content-length": "^4.2.5", - "@smithy/middleware-endpoint": "^4.3.12", - "@smithy/middleware-retry": "^4.4.12", - "@smithy/middleware-serde": "^4.2.6", - "@smithy/middleware-stack": "^4.2.5", - "@smithy/node-config-provider": "^4.3.5", - "@smithy/node-http-handler": "^4.4.5", - "@smithy/protocol-http": "^5.3.5", - "@smithy/smithy-client": "^4.9.8", - "@smithy/types": "^4.9.0", - "@smithy/url-parser": "^4.2.5", - "@smithy/util-base64": "^4.3.0", - "@smithy/util-body-length-browser": "^4.2.0", - "@smithy/util-body-length-node": "^4.2.1", - "@smithy/util-defaults-mode-browser": "^4.3.11", - "@smithy/util-defaults-mode-node": "^4.2.14", - "@smithy/util-endpoints": "^3.2.5", - "@smithy/util-middleware": "^4.2.5", - "@smithy/util-retry": "^4.2.5", - "@smithy/util-utf8": "^4.2.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/region-config-resolver": { - "version": "3.936.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.936.0.tgz", - "integrity": "sha512-wOKhzzWsshXGduxO4pqSiNyL9oUtk4BEvjWm9aaq6Hmfdoydq6v6t0rAGHWPjFwy9z2haovGRi3C8IxdMB4muw==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.936.0", - "@smithy/config-resolver": "^4.4.3", - "@smithy/node-config-provider": "^4.3.5", - "@smithy/types": "^4.9.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/token-providers": { - "version": "3.943.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.943.0.tgz", - "integrity": "sha512-cRKyIzwfkS+XztXIFPoWORuaxlIswP+a83BJzelX4S1gUZ7FcXB4+lj9Jxjn8SbQhR4TPU3Owbpu+S7pd6IRbQ==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/core": "3.943.0", - "@aws-sdk/nested-clients": "3.943.0", - "@aws-sdk/types": "3.936.0", - "@smithy/property-provider": "^4.2.5", - "@smithy/shared-ini-file-loader": "^4.4.0", - "@smithy/types": "^4.9.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/types": { - "version": "3.936.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.936.0.tgz", - "integrity": "sha512-uz0/VlMd2pP5MepdrHizd+T+OKfyK4r3OA9JI+L/lPKg0YFQosdJNCKisr6o70E3dh8iMpFYxF1UN/4uZsyARg==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/types": "^4.9.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/util-endpoints": { - "version": "3.936.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.936.0.tgz", - "integrity": "sha512-0Zx3Ntdpu+z9Wlm7JKUBOzS9EunwKAb4KdGUQQxDqh5Lc3ta5uBoub+FgmVuzwnmBu9U1Os8UuwVTH0Lgu+P5w==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.936.0", - "@smithy/types": "^4.9.0", - "@smithy/url-parser": "^4.2.5", - "@smithy/util-endpoints": "^3.2.5", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/util-locate-window": { - "version": "3.893.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-locate-window/-/util-locate-window-3.893.0.tgz", - "integrity": "sha512-T89pFfgat6c8nMmpI8eKjBcDcgJq36+m9oiXbcUzeU55MP9ZuGgBomGjGnHaEyF36jenW9gmg3NfZDm0AO2XPg==", - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws-sdk/util-user-agent-browser": { - "version": "3.936.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.936.0.tgz", - "integrity": "sha512-eZ/XF6NxMtu+iCma58GRNRxSq4lHo6zHQLOZRIeL/ghqYJirqHdenMOwrzPettj60KWlv827RVebP9oNVrwZbw==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/types": "3.936.0", - "@smithy/types": "^4.9.0", - "bowser": "^2.11.0", - "tslib": "^2.6.2" - } - }, - "node_modules/@aws-sdk/util-user-agent-node": { - "version": "3.943.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.943.0.tgz", - "integrity": "sha512-gn+ILprVRrgAgTIBk2TDsJLRClzIOdStQFeFTcN0qpL8Z4GBCqMFhw7O7X+MM55Stt5s4jAauQ/VvoqmCADnQg==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/middleware-user-agent": "3.943.0", - "@aws-sdk/types": "3.936.0", - "@smithy/node-config-provider": "^4.3.5", - "@smithy/types": "^4.9.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - }, - "peerDependencies": { - "aws-crt": ">=1.0.0" - }, - "peerDependenciesMeta": { - "aws-crt": { - "optional": true - } - } - }, - "node_modules/@aws-sdk/xml-builder": { - "version": "3.930.0", - "resolved": "https://registry.npmjs.org/@aws-sdk/xml-builder/-/xml-builder-3.930.0.tgz", - "integrity": "sha512-YIfkD17GocxdmlUVc3ia52QhcWuRIUJonbF8A2CYfcWNV3HzvAqpcPeC0bYUhkK+8e8YO1ARnLKZQE0TlwzorA==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/types": "^4.9.0", - "fast-xml-parser": "5.2.5", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@aws/lambda-invoke-store": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@aws/lambda-invoke-store/-/lambda-invoke-store-0.2.1.tgz", - "integrity": "sha512-sIyFcoPZkTtNu9xFeEoynMef3bPJIAbOfUh+ueYcfhVl6xm2VRtMcMclSxmZCMnHHd4hlYKJeq/aggmBEWynww==", - "license": "Apache-2.0", - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@esbuild/aix-ppc64": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.0.tgz", - "integrity": "sha512-KuZrd2hRjz01y5JK9mEBSD3Vj3mbCvemhT466rSuJYeE/hjuBrHfjjcjMdTm/sz7au+++sdbJZJmuBwQLuw68A==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "aix" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-arm": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.0.tgz", - "integrity": "sha512-j67aezrPNYWJEOHUNLPj9maeJte7uSMM6gMoxfPC9hOg8N02JuQi/T7ewumf4tNvJadFkvLZMlAq73b9uwdMyQ==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-arm64": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.0.tgz", - "integrity": "sha512-CC3vt4+1xZrs97/PKDkl0yN7w8edvU2vZvAFGD16n9F0Cvniy5qvzRXjfO1l94efczkkQE6g1x0i73Qf5uthOQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/android-x64": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.0.tgz", - "integrity": "sha512-wurMkF1nmQajBO1+0CJmcN17U4BP6GqNSROP8t0X/Jiw2ltYGLHpEksp9MpoBqkrFR3kv2/te6Sha26k3+yZ9Q==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/darwin-arm64": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.0.tgz", - "integrity": "sha512-uJOQKYCcHhg07DL7i8MzjvS2LaP7W7Pn/7uA0B5S1EnqAirJtbyw4yC5jQ5qcFjHK9l6o/MX9QisBg12kNkdHg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/darwin-x64": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.0.tgz", - "integrity": "sha512-8mG6arH3yB/4ZXiEnXof5MK72dE6zM9cDvUcPtxhUZsDjESl9JipZYW60C3JGreKCEP+p8P/72r69m4AZGJd5g==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/freebsd-arm64": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.0.tgz", - "integrity": "sha512-9FHtyO988CwNMMOE3YIeci+UV+x5Zy8fI2qHNpsEtSF83YPBmE8UWmfYAQg6Ux7Gsmd4FejZqnEUZCMGaNQHQw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/freebsd-x64": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.0.tgz", - "integrity": "sha512-zCMeMXI4HS/tXvJz8vWGexpZj2YVtRAihHLk1imZj4efx1BQzN76YFeKqlDr3bUWI26wHwLWPd3rwh6pe4EV7g==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-arm": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.0.tgz", - "integrity": "sha512-t76XLQDpxgmq2cNXKTVEB7O7YMb42atj2Re2Haf45HkaUpjM2J0UuJZDuaGbPbamzZ7bawyGFUkodL+zcE+jvQ==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-arm64": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.0.tgz", - "integrity": "sha512-AS18v0V+vZiLJyi/4LphvBE+OIX682Pu7ZYNsdUHyUKSoRwdnOsMf6FDekwoAFKej14WAkOef3zAORJgAtXnlQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-ia32": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.0.tgz", - "integrity": "sha512-Mz1jxqm/kfgKkc/KLHC5qIujMvnnarD9ra1cEcrs7qshTUSksPihGrWHVG5+osAIQ68577Zpww7SGapmzSt4Nw==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-loong64": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.0.tgz", - "integrity": "sha512-QbEREjdJeIreIAbdG2hLU1yXm1uu+LTdzoq1KCo4G4pFOLlvIspBm36QrQOar9LFduavoWX2msNFAAAY9j4BDg==", - "cpu": [ - "loong64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-mips64el": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.0.tgz", - "integrity": "sha512-sJz3zRNe4tO2wxvDpH/HYJilb6+2YJxo/ZNbVdtFiKDufzWq4JmKAiHy9iGoLjAV7r/W32VgaHGkk35cUXlNOg==", - "cpu": [ - "mips64el" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-ppc64": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.0.tgz", - "integrity": "sha512-z9N10FBD0DCS2dmSABDBb5TLAyF1/ydVb+N4pi88T45efQ/w4ohr/F/QYCkxDPnkhkp6AIpIcQKQ8F0ANoA2JA==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-riscv64": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.0.tgz", - "integrity": "sha512-pQdyAIZ0BWIC5GyvVFn5awDiO14TkT/19FTmFcPdDec94KJ1uZcmFs21Fo8auMXzD4Tt+diXu1LW1gHus9fhFQ==", - "cpu": [ - "riscv64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-s390x": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.0.tgz", - "integrity": "sha512-hPlRWR4eIDDEci953RI1BLZitgi5uqcsjKMxwYfmi4LcwyWo2IcRP+lThVnKjNtk90pLS8nKdroXYOqW+QQH+w==", - "cpu": [ - "s390x" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-x64": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.0.tgz", - "integrity": "sha512-1hBWx4OUJE2cab++aVZ7pObD6s+DK4mPGpemtnAORBvb5l/g5xFGk0vc0PjSkrDs0XaXj9yyob3d14XqvnQ4gw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/netbsd-arm64": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.0.tgz", - "integrity": "sha512-6m0sfQfxfQfy1qRuecMkJlf1cIzTOgyaeXaiVaaki8/v+WB+U4hc6ik15ZW6TAllRlg/WuQXxWj1jx6C+dfy3w==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/netbsd-x64": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.0.tgz", - "integrity": "sha512-xbbOdfn06FtcJ9d0ShxxvSn2iUsGd/lgPIO2V3VZIPDbEaIj1/3nBBe1AwuEZKXVXkMmpr6LUAgMkLD/4D2PPA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openbsd-arm64": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.0.tgz", - "integrity": "sha512-fWgqR8uNbCQ/GGv0yhzttj6sU/9Z5/Sv/VGU3F5OuXK6J6SlriONKrQ7tNlwBrJZXRYk5jUhuWvF7GYzGguBZQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openbsd-x64": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.0.tgz", - "integrity": "sha512-aCwlRdSNMNxkGGqQajMUza6uXzR/U0dIl1QmLjPtRbLOx3Gy3otfFu/VjATy4yQzo9yFDGTxYDo1FfAD9oRD2A==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/openharmony-arm64": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.0.tgz", - "integrity": "sha512-nyvsBccxNAsNYz2jVFYwEGuRRomqZ149A39SHWk4hV0jWxKM0hjBPm3AmdxcbHiFLbBSwG6SbpIcUbXjgyECfA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openharmony" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/sunos-x64": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.0.tgz", - "integrity": "sha512-Q1KY1iJafM+UX6CFEL+F4HRTgygmEW568YMqDA5UV97AuZSm21b7SXIrRJDwXWPzr8MGr75fUZPV67FdtMHlHA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-arm64": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.0.tgz", - "integrity": "sha512-W1eyGNi6d+8kOmZIwi/EDjrL9nxQIQ0MiGqe/AWc6+IaHloxHSGoeRgDRKHFISThLmsewZ5nHFvGFWdBYlgKPg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-ia32": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.0.tgz", - "integrity": "sha512-30z1aKL9h22kQhilnYkORFYt+3wp7yZsHWus+wSKAJR8JtdfI76LJ4SBdMsCopTR3z/ORqVu5L1vtnHZWVj4cQ==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/win32-x64": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.0.tgz", - "integrity": "sha512-aIitBcjQeyOhMTImhLZmtxfdOcuNRpwlPNmlFKPcHQYPhEssw75Cl1TSXJXpMkzaua9FUetx/4OQKq7eJul5Cg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@openauthjs/openauth": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/@openauthjs/openauth/-/openauth-0.4.3.tgz", - "integrity": "sha512-RlnjqvHzqcbFVymEwhlUEuac4utA5h4nhSK/i2szZuQmxTIqbGUxZ+nM+avM+VV4Ing+/ZaNLKILoXS3yrkOOw==", - "dependencies": { - "@standard-schema/spec": "1.0.0-beta.3", - "aws4fetch": "1.0.20", - "jose": "5.9.6" - }, - "peerDependencies": { - "arctic": "^2.2.2", - "hono": "^4.0.0" - } - }, - "node_modules/@openauthjs/openauth/node_modules/@standard-schema/spec": { - "version": "1.0.0-beta.3", - "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.0.0-beta.3.tgz", - "integrity": "sha512-0ifF3BjA1E8SY9C+nUew8RefNOIq0cDlYALPty4rhUm8Rrl6tCM8hBT4bhGhx7I7iXD0uAgt50lgo8dD73ACMw==", - "license": "MIT" - }, - "node_modules/@opencode-ai/plugin": { - "version": "1.0.143", - "resolved": "https://registry.npmjs.org/@opencode-ai/plugin/-/plugin-1.0.143.tgz", - "integrity": "sha512-yzaCmdazVJMDADJLbMM8KGp1X+Hd/HVyIXMlNt9qcvz/fcs/ET4EwHJsJaQi/9m/jLJ+plwBJAeIW08BMrECPg==", - "dev": true, - "dependencies": { - "@opencode-ai/sdk": "1.0.143", - "zod": "4.1.8" - } - }, - "node_modules/@opencode-ai/plugin/node_modules/zod": { - "version": "4.1.8", - "resolved": "https://registry.npmjs.org/zod/-/zod-4.1.8.tgz", - "integrity": "sha512-5R1P+WwQqmmMIEACyzSvo4JXHY5WiAFHRMg+zBZKgKS+Q1viRa0C1hmUKtHltoIFKtIdki3pRxkmpP74jnNYHQ==", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/colinhacks" - } - }, - "node_modules/@opencode-ai/sdk": { - "version": "1.0.143", - "resolved": "https://registry.npmjs.org/@opencode-ai/sdk/-/sdk-1.0.143.tgz", - "integrity": "sha512-dtmkBfJ7IIAHzL6KCzAlwc9GybfJONVeCsF6ePYySpkuhslDbRkZBJYb5vqGd1H5zdsgjc6JjuvmOf0rPWUL6A==" - }, - "node_modules/@opentelemetry/api": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.9.0.tgz", - "integrity": "sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==", - "license": "Apache-2.0", - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/@oslojs/asn1": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@oslojs/asn1/-/asn1-1.0.0.tgz", - "integrity": "sha512-zw/wn0sj0j0QKbIXfIlnEcTviaCzYOY3V5rAyjR6YtOByFtJiT574+8p9Wlach0lZH9fddD4yb9laEAIl4vXQA==", - "license": "MIT", - "peer": true, - "dependencies": { - "@oslojs/binary": "1.0.0" - } - }, - "node_modules/@oslojs/binary": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@oslojs/binary/-/binary-1.0.0.tgz", - "integrity": "sha512-9RCU6OwXU6p67H4NODbuxv2S3eenuQ4/WFLrsq+K/k682xrznH5EVWA7N4VFk9VYVcbFtKqur5YQQZc0ySGhsQ==", - "license": "MIT", - "peer": true - }, - "node_modules/@oslojs/crypto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@oslojs/crypto/-/crypto-1.0.1.tgz", - "integrity": "sha512-7n08G8nWjAr/Yu3vu9zzrd0L9XnrJfpMioQcvCMxBIiF5orECHe5/3J0jmXRVvgfqMm/+4oxlQ+Sq39COYLcNQ==", - "license": "MIT", - "peer": true, - "dependencies": { - "@oslojs/asn1": "1.0.0", - "@oslojs/binary": "1.0.0" - } - }, - "node_modules/@oslojs/encoding": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@oslojs/encoding/-/encoding-1.1.0.tgz", - "integrity": "sha512-70wQhgYmndg4GCPxPPxPGevRKqTIJ2Nh4OkiMWmDAVYsTQ+Ta7Sq+rPevXyXGdzr30/qZBnyOalCszoMxlyldQ==", - "license": "MIT", - "peer": true - }, - "node_modules/@oslojs/jwt": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@oslojs/jwt/-/jwt-0.2.0.tgz", - "integrity": "sha512-bLE7BtHrURedCn4Mco3ma9L4Y1GR2SMBuIvjWr7rmQ4/W/4Jy70TIAgZ+0nIlk0xHz1vNP8x8DCns45Sb2XRbg==", - "license": "MIT", - "peer": true, - "dependencies": { - "@oslojs/encoding": "0.4.1" - } - }, - "node_modules/@oslojs/jwt/node_modules/@oslojs/encoding": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@oslojs/encoding/-/encoding-0.4.1.tgz", - "integrity": "sha512-hkjo6MuIK/kQR5CrGNdAPZhS01ZCXuWDRJ187zh6qqF2+yMHZpD9fAYpX8q2bOO6Ryhl3XpCT6kUX76N8hhm4Q==", - "license": "MIT", - "peer": true - }, - "node_modules/@smithy/abort-controller": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@smithy/abort-controller/-/abort-controller-4.2.5.tgz", - "integrity": "sha512-j7HwVkBw68YW8UmFRcjZOmssE77Rvk0GWAIN1oFBhsaovQmZWYCIcGa9/pwRB0ExI8Sk9MWNALTjftjHZea7VA==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/types": "^4.9.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@smithy/config-resolver": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/@smithy/config-resolver/-/config-resolver-4.4.3.tgz", - "integrity": "sha512-ezHLe1tKLUxDJo2LHtDuEDyWXolw8WGOR92qb4bQdWq/zKenO5BvctZGrVJBK08zjezSk7bmbKFOXIVyChvDLw==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/node-config-provider": "^4.3.5", - "@smithy/types": "^4.9.0", - "@smithy/util-config-provider": "^4.2.0", - "@smithy/util-endpoints": "^3.2.5", - "@smithy/util-middleware": "^4.2.5", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@smithy/core": { - "version": "3.18.6", - "resolved": "https://registry.npmjs.org/@smithy/core/-/core-3.18.6.tgz", - "integrity": "sha512-8Q/ugWqfDUEU1Exw71+DoOzlONJ2Cn9QA8VeeDzLLjzO/qruh9UKFzbszy4jXcIYgGofxYiT0t1TT6+CT/GupQ==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/middleware-serde": "^4.2.6", - "@smithy/protocol-http": "^5.3.5", - "@smithy/types": "^4.9.0", - "@smithy/util-base64": "^4.3.0", - "@smithy/util-body-length-browser": "^4.2.0", - "@smithy/util-middleware": "^4.2.5", - "@smithy/util-stream": "^4.5.6", - "@smithy/util-utf8": "^4.2.0", - "@smithy/uuid": "^1.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@smithy/credential-provider-imds": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@smithy/credential-provider-imds/-/credential-provider-imds-4.2.5.tgz", - "integrity": "sha512-BZwotjoZWn9+36nimwm/OLIcVe+KYRwzMjfhd4QT7QxPm9WY0HiOV8t/Wlh+HVUif0SBVV7ksq8//hPaBC/okQ==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/node-config-provider": "^4.3.5", - "@smithy/property-provider": "^4.2.5", - "@smithy/types": "^4.9.0", - "@smithy/url-parser": "^4.2.5", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@smithy/fetch-http-handler": { - "version": "5.3.6", - "resolved": "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-5.3.6.tgz", - "integrity": "sha512-3+RG3EA6BBJ/ofZUeTFJA7mHfSYrZtQIrDP9dI8Lf7X6Jbos2jptuLrAAteDiFVrmbEmLSuRG/bUKzfAXk7dhg==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/protocol-http": "^5.3.5", - "@smithy/querystring-builder": "^4.2.5", - "@smithy/types": "^4.9.0", - "@smithy/util-base64": "^4.3.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@smithy/hash-node": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@smithy/hash-node/-/hash-node-4.2.5.tgz", - "integrity": "sha512-DpYX914YOfA3UDT9CN1BM787PcHfWRBB43fFGCYrZFUH0Jv+5t8yYl+Pd5PW4+QzoGEDvn5d5QIO4j2HyYZQSA==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/types": "^4.9.0", - "@smithy/util-buffer-from": "^4.2.0", - "@smithy/util-utf8": "^4.2.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@smithy/invalid-dependency": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@smithy/invalid-dependency/-/invalid-dependency-4.2.5.tgz", - "integrity": "sha512-2L2erASEro1WC5nV+plwIMxrTXpvpfzl4e+Nre6vBVRR2HKeGGcvpJyyL3/PpiSg+cJG2KpTmZmq934Olb6e5A==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/types": "^4.9.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@smithy/is-array-buffer": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-4.2.0.tgz", - "integrity": "sha512-DZZZBvC7sjcYh4MazJSGiWMI2L7E0oCiRHREDzIxi/M2LY79/21iXt6aPLHge82wi5LsuRF5A06Ds3+0mlh6CQ==", - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@smithy/middleware-content-length": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@smithy/middleware-content-length/-/middleware-content-length-4.2.5.tgz", - "integrity": "sha512-Y/RabVa5vbl5FuHYV2vUCwvh/dqzrEY/K2yWPSqvhFUwIY0atLqO4TienjBXakoy4zrKAMCZwg+YEqmH7jaN7A==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/protocol-http": "^5.3.5", - "@smithy/types": "^4.9.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@smithy/middleware-endpoint": { - "version": "4.3.13", - "resolved": "https://registry.npmjs.org/@smithy/middleware-endpoint/-/middleware-endpoint-4.3.13.tgz", - "integrity": "sha512-X4za1qCdyx1hEVVXuAWlZuK6wzLDv1uw1OY9VtaYy1lULl661+frY7FeuHdYdl7qAARUxH2yvNExU2/SmRFfcg==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/core": "^3.18.6", - "@smithy/middleware-serde": "^4.2.6", - "@smithy/node-config-provider": "^4.3.5", - "@smithy/shared-ini-file-loader": "^4.4.0", - "@smithy/types": "^4.9.0", - "@smithy/url-parser": "^4.2.5", - "@smithy/util-middleware": "^4.2.5", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@smithy/middleware-retry": { - "version": "4.4.13", - "resolved": "https://registry.npmjs.org/@smithy/middleware-retry/-/middleware-retry-4.4.13.tgz", - "integrity": "sha512-RzIDF9OrSviXX7MQeKOm8r/372KTyY8Jmp6HNKOOYlrguHADuM3ED/f4aCyNhZZFLG55lv5beBin7nL0Nzy1Dw==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/node-config-provider": "^4.3.5", - "@smithy/protocol-http": "^5.3.5", - "@smithy/service-error-classification": "^4.2.5", - "@smithy/smithy-client": "^4.9.9", - "@smithy/types": "^4.9.0", - "@smithy/util-middleware": "^4.2.5", - "@smithy/util-retry": "^4.2.5", - "@smithy/uuid": "^1.1.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@smithy/middleware-serde": { - "version": "4.2.6", - "resolved": "https://registry.npmjs.org/@smithy/middleware-serde/-/middleware-serde-4.2.6.tgz", - "integrity": "sha512-VkLoE/z7e2g8pirwisLz8XJWedUSY8my/qrp81VmAdyrhi94T+riBfwP+AOEEFR9rFTSonC/5D2eWNmFabHyGQ==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/protocol-http": "^5.3.5", - "@smithy/types": "^4.9.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@smithy/middleware-stack": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@smithy/middleware-stack/-/middleware-stack-4.2.5.tgz", - "integrity": "sha512-bYrutc+neOyWxtZdbB2USbQttZN0mXaOyYLIsaTbJhFsfpXyGWUxJpEuO1rJ8IIJm2qH4+xJT0mxUSsEDTYwdQ==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/types": "^4.9.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@smithy/node-config-provider": { - "version": "4.3.5", - "resolved": "https://registry.npmjs.org/@smithy/node-config-provider/-/node-config-provider-4.3.5.tgz", - "integrity": "sha512-UTurh1C4qkVCtqggI36DGbLB2Kv8UlcFdMXDcWMbqVY2uRg0XmT9Pb4Vj6oSQ34eizO1fvR0RnFV4Axw4IrrAg==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/property-provider": "^4.2.5", - "@smithy/shared-ini-file-loader": "^4.4.0", - "@smithy/types": "^4.9.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@smithy/node-http-handler": { - "version": "4.4.5", - "resolved": "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-4.4.5.tgz", - "integrity": "sha512-CMnzM9R2WqlqXQGtIlsHMEZfXKJVTIrqCNoSd/QpAyp+Dw0a1Vps13l6ma1fH8g7zSPNsA59B/kWgeylFuA/lw==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/abort-controller": "^4.2.5", - "@smithy/protocol-http": "^5.3.5", - "@smithy/querystring-builder": "^4.2.5", - "@smithy/types": "^4.9.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@smithy/property-provider": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@smithy/property-provider/-/property-provider-4.2.5.tgz", - "integrity": "sha512-8iLN1XSE1rl4MuxvQ+5OSk/Zb5El7NJZ1td6Tn+8dQQHIjp59Lwl6bd0+nzw6SKm2wSSriH2v/I9LPzUic7EOg==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/types": "^4.9.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@smithy/protocol-http": { - "version": "5.3.5", - "resolved": "https://registry.npmjs.org/@smithy/protocol-http/-/protocol-http-5.3.5.tgz", - "integrity": "sha512-RlaL+sA0LNMp03bf7XPbFmT5gN+w3besXSWMkA8rcmxLSVfiEXElQi4O2IWwPfxzcHkxqrwBFMbngB8yx/RvaQ==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/types": "^4.9.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@smithy/querystring-builder": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@smithy/querystring-builder/-/querystring-builder-4.2.5.tgz", - "integrity": "sha512-y98otMI1saoajeik2kLfGyRp11e5U/iJYH/wLCh3aTV/XutbGT9nziKGkgCaMD1ghK7p6htHMm6b6scl9JRUWg==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/types": "^4.9.0", - "@smithy/util-uri-escape": "^4.2.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@smithy/querystring-parser": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@smithy/querystring-parser/-/querystring-parser-4.2.5.tgz", - "integrity": "sha512-031WCTdPYgiQRYNPXznHXof2YM0GwL6SeaSyTH/P72M1Vz73TvCNH2Nq8Iu2IEPq9QP2yx0/nrw5YmSeAi/AjQ==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/types": "^4.9.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@smithy/service-error-classification": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@smithy/service-error-classification/-/service-error-classification-4.2.5.tgz", - "integrity": "sha512-8fEvK+WPE3wUAcDvqDQG1Vk3ANLR8Px979te96m84CbKAjBVf25rPYSzb4xU4hlTyho7VhOGnh5i62D/JVF0JQ==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/types": "^4.9.0" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@smithy/shared-ini-file-loader": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@smithy/shared-ini-file-loader/-/shared-ini-file-loader-4.4.0.tgz", - "integrity": "sha512-5WmZ5+kJgJDjwXXIzr1vDTG+RhF9wzSODQBfkrQ2VVkYALKGvZX1lgVSxEkgicSAFnFhPj5rudJV0zoinqS0bA==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/types": "^4.9.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@smithy/signature-v4": { - "version": "5.3.5", - "resolved": "https://registry.npmjs.org/@smithy/signature-v4/-/signature-v4-5.3.5.tgz", - "integrity": "sha512-xSUfMu1FT7ccfSXkoLl/QRQBi2rOvi3tiBZU2Tdy3I6cgvZ6SEi9QNey+lqps/sJRnogIS+lq+B1gxxbra2a/w==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/is-array-buffer": "^4.2.0", - "@smithy/protocol-http": "^5.3.5", - "@smithy/types": "^4.9.0", - "@smithy/util-hex-encoding": "^4.2.0", - "@smithy/util-middleware": "^4.2.5", - "@smithy/util-uri-escape": "^4.2.0", - "@smithy/util-utf8": "^4.2.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@smithy/smithy-client": { - "version": "4.9.9", - "resolved": "https://registry.npmjs.org/@smithy/smithy-client/-/smithy-client-4.9.9.tgz", - "integrity": "sha512-SUnZJMMo5yCmgjopJbiNeo1vlr8KvdnEfIHV9rlD77QuOGdRotIVBcOrBuMr+sI9zrnhtDtLP054bZVbpZpiQA==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/core": "^3.18.6", - "@smithy/middleware-endpoint": "^4.3.13", - "@smithy/middleware-stack": "^4.2.5", - "@smithy/protocol-http": "^5.3.5", - "@smithy/types": "^4.9.0", - "@smithy/util-stream": "^4.5.6", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@smithy/types": { - "version": "4.9.0", - "resolved": "https://registry.npmjs.org/@smithy/types/-/types-4.9.0.tgz", - "integrity": "sha512-MvUbdnXDTwykR8cB1WZvNNwqoWVaTRA0RLlLmf/cIFNMM2cKWz01X4Ly6SMC4Kks30r8tT3Cty0jmeWfiuyHTA==", - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@smithy/url-parser": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@smithy/url-parser/-/url-parser-4.2.5.tgz", - "integrity": "sha512-VaxMGsilqFnK1CeBX+LXnSuaMx4sTL/6znSZh2829txWieazdVxr54HmiyTsIbpOTLcf5nYpq9lpzmwRdxj6rQ==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/querystring-parser": "^4.2.5", - "@smithy/types": "^4.9.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@smithy/util-base64": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@smithy/util-base64/-/util-base64-4.3.0.tgz", - "integrity": "sha512-GkXZ59JfyxsIwNTWFnjmFEI8kZpRNIBfxKjv09+nkAWPt/4aGaEWMM04m4sxgNVWkbt2MdSvE3KF/PfX4nFedQ==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/util-buffer-from": "^4.2.0", - "@smithy/util-utf8": "^4.2.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@smithy/util-body-length-browser": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@smithy/util-body-length-browser/-/util-body-length-browser-4.2.0.tgz", - "integrity": "sha512-Fkoh/I76szMKJnBXWPdFkQJl2r9SjPt3cMzLdOB6eJ4Pnpas8hVoWPYemX/peO0yrrvldgCUVJqOAjUrOLjbxg==", - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@smithy/util-body-length-node": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@smithy/util-body-length-node/-/util-body-length-node-4.2.1.tgz", - "integrity": "sha512-h53dz/pISVrVrfxV1iqXlx5pRg3V2YWFcSQyPyXZRrZoZj4R4DeWRDo1a7dd3CPTcFi3kE+98tuNyD2axyZReA==", - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@smithy/util-buffer-from": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-4.2.0.tgz", - "integrity": "sha512-kAY9hTKulTNevM2nlRtxAG2FQ3B2OR6QIrPY3zE5LqJy1oxzmgBGsHLWTcNhWXKchgA0WHW+mZkQrng/pgcCew==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/is-array-buffer": "^4.2.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@smithy/util-config-provider": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@smithy/util-config-provider/-/util-config-provider-4.2.0.tgz", - "integrity": "sha512-YEjpl6XJ36FTKmD+kRJJWYvrHeUvm5ykaUS5xK+6oXffQPHeEM4/nXlZPe+Wu0lsgRUcNZiliYNh/y7q9c2y6Q==", - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@smithy/util-defaults-mode-browser": { - "version": "4.3.12", - "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-browser/-/util-defaults-mode-browser-4.3.12.tgz", - "integrity": "sha512-TKc6FnOxFULKxLgTNHYjcFqdOYzXVPFFVm5JhI30F3RdhT7nYOtOsjgaOwfDRmA/3U66O9KaBQ3UHoXwayRhAg==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/property-provider": "^4.2.5", - "@smithy/smithy-client": "^4.9.9", - "@smithy/types": "^4.9.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@smithy/util-defaults-mode-node": { - "version": "4.2.15", - "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-node/-/util-defaults-mode-node-4.2.15.tgz", - "integrity": "sha512-94NqfQVo+vGc5gsQ9SROZqOvBkGNMQu6pjXbnn8aQvBUhc31kx49gxlkBEqgmaZQHUUfdRUin5gK/HlHKmbAwg==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/config-resolver": "^4.4.3", - "@smithy/credential-provider-imds": "^4.2.5", - "@smithy/node-config-provider": "^4.3.5", - "@smithy/property-provider": "^4.2.5", - "@smithy/smithy-client": "^4.9.9", - "@smithy/types": "^4.9.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@smithy/util-endpoints": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/@smithy/util-endpoints/-/util-endpoints-3.2.5.tgz", - "integrity": "sha512-3O63AAWu2cSNQZp+ayl9I3NapW1p1rR5mlVHcF6hAB1dPZUQFfRPYtplWX/3xrzWthPGj5FqB12taJJCfH6s8A==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/node-config-provider": "^4.3.5", - "@smithy/types": "^4.9.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@smithy/util-hex-encoding": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@smithy/util-hex-encoding/-/util-hex-encoding-4.2.0.tgz", - "integrity": "sha512-CCQBwJIvXMLKxVbO88IukazJD9a4kQ9ZN7/UMGBjBcJYvatpWk+9g870El4cB8/EJxfe+k+y0GmR9CAzkF+Nbw==", - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@smithy/util-middleware": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@smithy/util-middleware/-/util-middleware-4.2.5.tgz", - "integrity": "sha512-6Y3+rvBF7+PZOc40ybeZMcGln6xJGVeY60E7jy9Mv5iKpMJpHgRE6dKy9ScsVxvfAYuEX4Q9a65DQX90KaQ3bA==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/types": "^4.9.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@smithy/util-retry": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@smithy/util-retry/-/util-retry-4.2.5.tgz", - "integrity": "sha512-GBj3+EZBbN4NAqJ/7pAhsXdfzdlznOh8PydUijy6FpNIMnHPSMO2/rP4HKu+UFeikJxShERk528oy7GT79YiJg==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/service-error-classification": "^4.2.5", - "@smithy/types": "^4.9.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@smithy/util-stream": { - "version": "4.5.6", - "resolved": "https://registry.npmjs.org/@smithy/util-stream/-/util-stream-4.5.6.tgz", - "integrity": "sha512-qWw/UM59TiaFrPevefOZ8CNBKbYEP6wBAIlLqxn3VAIo9rgnTNc4ASbVrqDmhuwI87usnjhdQrxodzAGFFzbRQ==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/fetch-http-handler": "^5.3.6", - "@smithy/node-http-handler": "^4.4.5", - "@smithy/types": "^4.9.0", - "@smithy/util-base64": "^4.3.0", - "@smithy/util-buffer-from": "^4.2.0", - "@smithy/util-hex-encoding": "^4.2.0", - "@smithy/util-utf8": "^4.2.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@smithy/util-uri-escape": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@smithy/util-uri-escape/-/util-uri-escape-4.2.0.tgz", - "integrity": "sha512-igZpCKV9+E/Mzrpq6YacdTQ0qTiLm85gD6N/IrmyDvQFA4UnU3d5g3m8tMT/6zG/vVkWSU+VxeUyGonL62DuxA==", - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@smithy/util-utf8": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-4.2.0.tgz", - "integrity": "sha512-zBPfuzoI8xyBtR2P6WQj63Rz8i3AmfAaJLuNG8dWsfvPe8lO4aCPYLn879mEgHndZH1zQ2oXmG8O1GGzzaoZiw==", - "license": "Apache-2.0", - "dependencies": { - "@smithy/util-buffer-from": "^4.2.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@smithy/uuid": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@smithy/uuid/-/uuid-1.1.0.tgz", - "integrity": "sha512-4aUIteuyxtBUhVdiQqcDhKFitwfd9hqoSDYY2KRXiWtgoWJ9Bmise+KfEPDiVHWeJepvF8xJO9/9+WDIciMFFw==", - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@standard-schema/spec": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.0.0.tgz", - "integrity": "sha512-m2bOd0f2RT9k8QJx1JN85cZYyH1RqFBdlwtkSlf4tBDYLCiiZnv1fIIwacK6cqwXavOydf0NPToMQgpKq+dVlA==", - "license": "MIT" - }, - "node_modules/@tarquinen/opencode-auth-provider": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/@tarquinen/opencode-auth-provider/-/opencode-auth-provider-0.1.7.tgz", - "integrity": "sha512-FH1QEyoirr2e8b48Z6HrjioIZIZUIM9zOpYmku1ad+c4Nv70F37fSWhcObyIdZo4Ly3OntpKPWjadyRhd/kQcg==", - "license": "MIT", - "dependencies": { - "@aws-sdk/credential-providers": "^3.936.0", - "ai": "^5.0.98", - "jsonc-parser": "^3.3.1", - "opencode-anthropic-auth": "0.0.2", - "opencode-copilot-auth": "0.0.5", - "opencode-gemini-auth": "^1.1.4", - "remeda": "^2.32.0", - "xdg-basedir": "^5.1.0", - "zod": "^4.1.12" - }, - "peerDependencies": { - "@ai-sdk/amazon-bedrock": ">=1.0.0", - "@ai-sdk/anthropic": ">=1.0.0", - "@ai-sdk/azure": ">=1.0.0", - "@ai-sdk/google": ">=1.0.0", - "@ai-sdk/google-vertex": ">=1.0.0", - "@ai-sdk/openai": ">=1.0.0", - "@ai-sdk/openai-compatible": ">=0.1.0", - "@openrouter/ai-sdk-provider": ">=0.1.0" - }, - "peerDependenciesMeta": { - "@ai-sdk/amazon-bedrock": { - "optional": true - }, - "@ai-sdk/anthropic": { - "optional": true - }, - "@ai-sdk/azure": { - "optional": true - }, - "@ai-sdk/google": { - "optional": true - }, - "@ai-sdk/google-vertex": { - "optional": true - }, - "@ai-sdk/openai": { - "optional": true - }, - "@ai-sdk/openai-compatible": { - "optional": true - }, - "@openrouter/ai-sdk-provider": { - "optional": true - } - } - }, - "node_modules/@types/node": { - "version": "24.10.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.1.tgz", - "integrity": "sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "undici-types": "~7.16.0" - } - }, - "node_modules/@vercel/oidc": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@vercel/oidc/-/oidc-3.0.5.tgz", - "integrity": "sha512-fnYhv671l+eTTp48gB4zEsTW/YtRgRPnkI2nT7x6qw5rkI1Lq2hTmQIpHPgyThI0znLK+vX2n9XxKdXZ7BUbbw==", - "license": "Apache-2.0", - "engines": { - "node": ">= 20" - } - }, - "node_modules/ai": { - "version": "5.0.106", - "resolved": "https://registry.npmjs.org/ai/-/ai-5.0.106.tgz", - "integrity": "sha512-M5obwavxSJJ3tGlAFqI6eltYNJB0D20X6gIBCFx/KVorb/X1fxVVfiZZpZb+Gslu4340droSOjT0aKQFCarNVg==", - "license": "Apache-2.0", - "dependencies": { - "@ai-sdk/gateway": "2.0.18", - "@ai-sdk/provider": "2.0.0", - "@ai-sdk/provider-utils": "3.0.18", - "@opentelemetry/api": "1.9.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "zod": "^3.25.76 || ^4.1.8" - } - }, - "node_modules/arctic": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/arctic/-/arctic-2.3.4.tgz", - "integrity": "sha512-+p30BOWsctZp+CVYCt7oAean/hWGW42sH5LAcRQX56ttEkFJWbzXBhmSpibbzwSJkRrotmsA+oAoJoVsU0f5xA==", - "license": "MIT", - "peer": true, - "dependencies": { - "@oslojs/crypto": "1.0.1", - "@oslojs/encoding": "1.1.0", - "@oslojs/jwt": "0.2.0" - } - }, - "node_modules/aws4fetch": { - "version": "1.0.20", - "resolved": "https://registry.npmjs.org/aws4fetch/-/aws4fetch-1.0.20.tgz", - "integrity": "sha512-/djoAN709iY65ETD6LKCtyyEI04XIBP5xVvfmNxsEP0uJB5tyaGBztSryRr4HqMStr9R06PisQE7m9zDTXKu6g==", - "license": "MIT" - }, - "node_modules/bowser": { - "version": "2.13.1", - "resolved": "https://registry.npmjs.org/bowser/-/bowser-2.13.1.tgz", - "integrity": "sha512-OHawaAbjwx6rqICCKgSG0SAnT05bzd7ppyKLVUITZpANBaaMFBAsaNkto3LoQ31tyFP5kNujE8Cdx85G9VzOkw==", - "license": "MIT" - }, - "node_modules/esbuild": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.0.tgz", - "integrity": "sha512-jd0f4NHbD6cALCyGElNpGAOtWxSq46l9X/sWB0Nzd5er4Kz2YTm+Vl0qKFT9KUJvD8+fiO8AvoHhFvEatfVixA==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=18" - }, - "optionalDependencies": { - "@esbuild/aix-ppc64": "0.27.0", - "@esbuild/android-arm": "0.27.0", - "@esbuild/android-arm64": "0.27.0", - "@esbuild/android-x64": "0.27.0", - "@esbuild/darwin-arm64": "0.27.0", - "@esbuild/darwin-x64": "0.27.0", - "@esbuild/freebsd-arm64": "0.27.0", - "@esbuild/freebsd-x64": "0.27.0", - "@esbuild/linux-arm": "0.27.0", - "@esbuild/linux-arm64": "0.27.0", - "@esbuild/linux-ia32": "0.27.0", - "@esbuild/linux-loong64": "0.27.0", - "@esbuild/linux-mips64el": "0.27.0", - "@esbuild/linux-ppc64": "0.27.0", - "@esbuild/linux-riscv64": "0.27.0", - "@esbuild/linux-s390x": "0.27.0", - "@esbuild/linux-x64": "0.27.0", - "@esbuild/netbsd-arm64": "0.27.0", - "@esbuild/netbsd-x64": "0.27.0", - "@esbuild/openbsd-arm64": "0.27.0", - "@esbuild/openbsd-x64": "0.27.0", - "@esbuild/openharmony-arm64": "0.27.0", - "@esbuild/sunos-x64": "0.27.0", - "@esbuild/win32-arm64": "0.27.0", - "@esbuild/win32-ia32": "0.27.0", - "@esbuild/win32-x64": "0.27.0" - } - }, - "node_modules/eventsource-parser": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/eventsource-parser/-/eventsource-parser-3.0.6.tgz", - "integrity": "sha512-Vo1ab+QXPzZ4tCa8SwIHJFaSzy4R6SHf7BY79rFBDf0idraZWAkYrDjDj8uWaSm3S2TK+hJ7/t1CEmZ7jXw+pg==", - "license": "MIT", - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/fast-xml-parser": { - "version": "5.2.5", - "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.2.5.tgz", - "integrity": "sha512-pfX9uG9Ki0yekDHx2SiuRIyFdyAr1kMIMitPvb0YBo8SUfKvia7w7FIyd/l6av85pFYRhZscS75MwMnbvY+hcQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/NaturalIntelligence" - } - ], - "license": "MIT", - "dependencies": { - "strnum": "^2.1.0" - }, - "bin": { - "fxparser": "src/cli/cli.js" - } - }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/get-tsconfig": { - "version": "4.13.0", - "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.13.0.tgz", - "integrity": "sha512-1VKTZJCwBrvbd+Wn3AOgQP/2Av+TfTCOlE4AcRJE72W1ksZXbAx8PPBR9RzgTeSPzlPMHrbANMH3LbltH73wxQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "resolve-pkg-maps": "^1.0.0" - }, - "funding": { - "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" - } - }, - "node_modules/gpt-tokenizer": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/gpt-tokenizer/-/gpt-tokenizer-3.4.0.tgz", - "integrity": "sha512-wxFLnhIXTDjYebd9A9pGl3e31ZpSypbpIJSOswbgop5jLte/AsZVDvjlbEuVFlsqZixVKqbcoNmRlFDf6pz/UQ==", - "license": "MIT" - }, - "node_modules/hono": { - "version": "4.10.7", - "resolved": "https://registry.npmjs.org/hono/-/hono-4.10.7.tgz", - "integrity": "sha512-icXIITfw/07Q88nLSkB9aiUrd8rYzSweK681Kjo/TSggaGbOX4RRyxxm71v+3PC8C/j+4rlxGeoTRxQDkaJkUw==", - "license": "MIT", - "peer": true, - "engines": { - "node": ">=16.9.0" - } - }, - "node_modules/jose": { - "version": "5.9.6", - "resolved": "https://registry.npmjs.org/jose/-/jose-5.9.6.tgz", - "integrity": "sha512-AMlnetc9+CV9asI19zHmrgS/WYsWUwCn2R7RzlbJWD7F9eWYUTGyBmU9o6PxngtLGOiDGPRu+Uc4fhKzbpteZQ==", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/panva" - } - }, - "node_modules/json-schema": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", - "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", - "license": "(AFL-2.1 OR BSD-3-Clause)" - }, - "node_modules/jsonc-parser": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.3.1.tgz", - "integrity": "sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==", - "license": "MIT" - }, - "node_modules/opencode-anthropic-auth": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/opencode-anthropic-auth/-/opencode-anthropic-auth-0.0.2.tgz", - "integrity": "sha512-m8dcEKtq2ExGLV7n4BMr1H5UimDaABV6aG82IDMcp1xmXUaO1K20/hess0s8cwvv6MFmJk4//2wbWZkzoOtirA==", - "dependencies": { - "@openauthjs/openauth": "^0.4.3" - } - }, - "node_modules/opencode-copilot-auth": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/opencode-copilot-auth/-/opencode-copilot-auth-0.0.5.tgz", - "integrity": "sha512-aOna2jy3BnaEpVJkeF32joUzI8DcpbBMWjd7zW6sgX4t58AnxaEB5sDadLsxRfcxJdhmABd5k6QSww5LcJ4e9Q==" - }, - "node_modules/opencode-gemini-auth": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/opencode-gemini-auth/-/opencode-gemini-auth-1.1.6.tgz", - "integrity": "sha512-7WxOEwYMqXeCD2jf/Wj+8yBS3qwnRxHKt/sWhn2ZBDgz+dVwrC/SpTNvpva1fF8KSgVVG8tS9yvDQXM0JcVGoQ==", - "license": "MIT", - "dependencies": { - "@openauthjs/openauth": "^0.4.3" - }, - "peerDependencies": { - "typescript": "^5" - } - }, - "node_modules/remeda": { - "version": "2.32.0", - "resolved": "https://registry.npmjs.org/remeda/-/remeda-2.32.0.tgz", - "integrity": "sha512-BZx9DsT4FAgXDTOdgJIc5eY6ECIXMwtlSPQoPglF20ycSWigttDDe88AozEsPPT4OWk5NujroGSBC1phw5uU+w==", - "license": "MIT", - "dependencies": { - "type-fest": "^4.41.0" - } - }, - "node_modules/resolve-pkg-maps": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", - "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" - } - }, - "node_modules/strnum": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/strnum/-/strnum-2.1.1.tgz", - "integrity": "sha512-7ZvoFTiCnGxBtDqJ//Cu6fWtZtc7Y3x+QOirG15wztbdngGSkht27o2pyGWrVy0b4WAy3jbKmnoK6g5VlVNUUw==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/NaturalIntelligence" + "name": "@tarquinen/opencode-dcp", + "version": "1.1.1-beta.1", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "@tarquinen/opencode-dcp", + "version": "1.1.1-beta.1", + "license": "MIT", + "dependencies": { + "@ai-sdk/openai-compatible": "^1.0.28", + "@opencode-ai/sdk": "latest", + "@tarquinen/opencode-auth-provider": "^0.1.7", + "ai": "^5.0.106", + "gpt-tokenizer": "^3.4.0", + "jsonc-parser": "^3.3.1", + "zod": "^4.1.13" + }, + "devDependencies": { + "@opencode-ai/plugin": "^1.0.143", + "@types/node": "^24.10.1", + "prettier": "^3.4.2", + "tsx": "^4.21.0", + "typescript": "^5.9.3" + }, + "peerDependencies": { + "@opencode-ai/plugin": ">=0.13.7" + } + }, + "node_modules/@ai-sdk/gateway": { + "version": "2.0.18", + "resolved": "https://registry.npmjs.org/@ai-sdk/gateway/-/gateway-2.0.18.tgz", + "integrity": "sha512-sDQcW+6ck2m0pTIHW6BPHD7S125WD3qNkx/B8sEzJp/hurocmJ5Cni0ybExg6sQMGo+fr/GWOwpHF1cmCdg5rQ==", + "license": "Apache-2.0", + "dependencies": { + "@ai-sdk/provider": "2.0.0", + "@ai-sdk/provider-utils": "3.0.18", + "@vercel/oidc": "3.0.5" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "zod": "^3.25.76 || ^4.1.8" + } + }, + "node_modules/@ai-sdk/openai-compatible": { + "version": "1.0.28", + "resolved": "https://registry.npmjs.org/@ai-sdk/openai-compatible/-/openai-compatible-1.0.28.tgz", + "integrity": "sha512-yKubDxLYtXyGUzkr9lNStf/lE/I+Okc8tmotvyABhsQHHieLKk6oV5fJeRJxhr67Ejhg+FRnwUOxAmjRoFM4dA==", + "license": "Apache-2.0", + "dependencies": { + "@ai-sdk/provider": "2.0.0", + "@ai-sdk/provider-utils": "3.0.18" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "zod": "^3.25.76 || ^4.1.8" + } + }, + "node_modules/@ai-sdk/provider": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@ai-sdk/provider/-/provider-2.0.0.tgz", + "integrity": "sha512-6o7Y2SeO9vFKB8lArHXehNuusnpddKPk7xqL7T2/b+OvXMRIXUO1rR4wcv1hAFUAT9avGZshty3Wlua/XA7TvA==", + "license": "Apache-2.0", + "dependencies": { + "json-schema": "^0.4.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@ai-sdk/provider-utils": { + "version": "3.0.18", + "resolved": "https://registry.npmjs.org/@ai-sdk/provider-utils/-/provider-utils-3.0.18.tgz", + "integrity": "sha512-ypv1xXMsgGcNKUP+hglKqtdDuMg68nWHucPPAhIENrbFAI+xCHiqPVN8Zllxyv1TNZwGWUghPxJXU+Mqps0YRQ==", + "license": "Apache-2.0", + "dependencies": { + "@ai-sdk/provider": "2.0.0", + "@standard-schema/spec": "^1.0.0", + "eventsource-parser": "^3.0.6" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "zod": "^3.25.76 || ^4.1.8" + } + }, + "node_modules/@aws-crypto/sha256-browser": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/sha256-browser/-/sha256-browser-5.2.0.tgz", + "integrity": "sha512-AXfN/lGotSQwu6HNcEsIASo7kWXZ5HYWvfOmSNKDsEqC4OashTp8alTmaz+F7TC2L083SFv5RdB+qU3Vs1kZqw==", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/sha256-js": "^5.2.0", + "@aws-crypto/supports-web-crypto": "^5.2.0", + "@aws-crypto/util": "^5.2.0", + "@aws-sdk/types": "^3.222.0", + "@aws-sdk/util-locate-window": "^3.0.0", + "@smithy/util-utf8": "^2.0.0", + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-crypto/sha256-browser/node_modules/@smithy/is-array-buffer": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-2.2.0.tgz", + "integrity": "sha512-GGP3O9QFD24uGeAXYUjwSTXARoqpZykHadOmA8G5vfJPK0/DC67qa//0qvqrJzL1xc8WQWX7/yc7fwudjPHPhA==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-crypto/sha256-browser/node_modules/@smithy/util-buffer-from": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-2.2.0.tgz", + "integrity": "sha512-IJdWBbTcMQ6DA0gdNhh/BwrLkDR+ADW5Kr1aZmd4k3DIF6ezMV4R2NIAmT08wQJ3yUK82thHWmC/TnK/wpMMIA==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/is-array-buffer": "^2.2.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-crypto/sha256-browser/node_modules/@smithy/util-utf8": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-2.3.0.tgz", + "integrity": "sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/util-buffer-from": "^2.2.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-crypto/sha256-js": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/sha256-js/-/sha256-js-5.2.0.tgz", + "integrity": "sha512-FFQQyu7edu4ufvIZ+OadFpHHOt+eSTBaYaki44c+akjg7qZg9oOQeLlk77F6tSYqjDAFClrHJk9tMf0HdVyOvA==", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/util": "^5.2.0", + "@aws-sdk/types": "^3.222.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@aws-crypto/supports-web-crypto": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/supports-web-crypto/-/supports-web-crypto-5.2.0.tgz", + "integrity": "sha512-iAvUotm021kM33eCdNfwIN//F77/IADDSs58i+MDaOqFrVjZo9bAal0NK7HurRuWLLpF1iLX7gbWrjHjeo+YFg==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-crypto/util": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/util/-/util-5.2.0.tgz", + "integrity": "sha512-4RkU9EsI6ZpBve5fseQlGNUWKMa1RLPQ1dnjnQoe07ldfIzcsGb5hC5W0Dm7u423KWzawlrpbjXBrXCEv9zazQ==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "^3.222.0", + "@smithy/util-utf8": "^2.0.0", + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-crypto/util/node_modules/@smithy/is-array-buffer": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-2.2.0.tgz", + "integrity": "sha512-GGP3O9QFD24uGeAXYUjwSTXARoqpZykHadOmA8G5vfJPK0/DC67qa//0qvqrJzL1xc8WQWX7/yc7fwudjPHPhA==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-crypto/util/node_modules/@smithy/util-buffer-from": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-2.2.0.tgz", + "integrity": "sha512-IJdWBbTcMQ6DA0gdNhh/BwrLkDR+ADW5Kr1aZmd4k3DIF6ezMV4R2NIAmT08wQJ3yUK82thHWmC/TnK/wpMMIA==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/is-array-buffer": "^2.2.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-crypto/util/node_modules/@smithy/util-utf8": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-2.3.0.tgz", + "integrity": "sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/util-buffer-from": "^2.2.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/client-cognito-identity": { + "version": "3.943.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-cognito-identity/-/client-cognito-identity-3.943.0.tgz", + "integrity": "sha512-XkuokRF2IQ+VLBn0AwrwfFOkZ2c1IXACwQdn3CDnpBZpT1s2hgH3MX0DoH9+41w4ar2QCSI09uAJiv9PX4DLoQ==", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.943.0", + "@aws-sdk/credential-provider-node": "3.943.0", + "@aws-sdk/middleware-host-header": "3.936.0", + "@aws-sdk/middleware-logger": "3.936.0", + "@aws-sdk/middleware-recursion-detection": "3.936.0", + "@aws-sdk/middleware-user-agent": "3.943.0", + "@aws-sdk/region-config-resolver": "3.936.0", + "@aws-sdk/types": "3.936.0", + "@aws-sdk/util-endpoints": "3.936.0", + "@aws-sdk/util-user-agent-browser": "3.936.0", + "@aws-sdk/util-user-agent-node": "3.943.0", + "@smithy/config-resolver": "^4.4.3", + "@smithy/core": "^3.18.5", + "@smithy/fetch-http-handler": "^5.3.6", + "@smithy/hash-node": "^4.2.5", + "@smithy/invalid-dependency": "^4.2.5", + "@smithy/middleware-content-length": "^4.2.5", + "@smithy/middleware-endpoint": "^4.3.12", + "@smithy/middleware-retry": "^4.4.12", + "@smithy/middleware-serde": "^4.2.6", + "@smithy/middleware-stack": "^4.2.5", + "@smithy/node-config-provider": "^4.3.5", + "@smithy/node-http-handler": "^4.4.5", + "@smithy/protocol-http": "^5.3.5", + "@smithy/smithy-client": "^4.9.8", + "@smithy/types": "^4.9.0", + "@smithy/url-parser": "^4.2.5", + "@smithy/util-base64": "^4.3.0", + "@smithy/util-body-length-browser": "^4.2.0", + "@smithy/util-body-length-node": "^4.2.1", + "@smithy/util-defaults-mode-browser": "^4.3.11", + "@smithy/util-defaults-mode-node": "^4.2.14", + "@smithy/util-endpoints": "^3.2.5", + "@smithy/util-middleware": "^4.2.5", + "@smithy/util-retry": "^4.2.5", + "@smithy/util-utf8": "^4.2.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/client-sso": { + "version": "3.943.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.943.0.tgz", + "integrity": "sha512-kOTO2B8Ks2qX73CyKY8PAajtf5n39aMe2spoiOF5EkgSzGV7hZ/HONRDyADlyxwfsX39Q2F2SpPUaXzon32IGw==", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.943.0", + "@aws-sdk/middleware-host-header": "3.936.0", + "@aws-sdk/middleware-logger": "3.936.0", + "@aws-sdk/middleware-recursion-detection": "3.936.0", + "@aws-sdk/middleware-user-agent": "3.943.0", + "@aws-sdk/region-config-resolver": "3.936.0", + "@aws-sdk/types": "3.936.0", + "@aws-sdk/util-endpoints": "3.936.0", + "@aws-sdk/util-user-agent-browser": "3.936.0", + "@aws-sdk/util-user-agent-node": "3.943.0", + "@smithy/config-resolver": "^4.4.3", + "@smithy/core": "^3.18.5", + "@smithy/fetch-http-handler": "^5.3.6", + "@smithy/hash-node": "^4.2.5", + "@smithy/invalid-dependency": "^4.2.5", + "@smithy/middleware-content-length": "^4.2.5", + "@smithy/middleware-endpoint": "^4.3.12", + "@smithy/middleware-retry": "^4.4.12", + "@smithy/middleware-serde": "^4.2.6", + "@smithy/middleware-stack": "^4.2.5", + "@smithy/node-config-provider": "^4.3.5", + "@smithy/node-http-handler": "^4.4.5", + "@smithy/protocol-http": "^5.3.5", + "@smithy/smithy-client": "^4.9.8", + "@smithy/types": "^4.9.0", + "@smithy/url-parser": "^4.2.5", + "@smithy/util-base64": "^4.3.0", + "@smithy/util-body-length-browser": "^4.2.0", + "@smithy/util-body-length-node": "^4.2.1", + "@smithy/util-defaults-mode-browser": "^4.3.11", + "@smithy/util-defaults-mode-node": "^4.2.14", + "@smithy/util-endpoints": "^3.2.5", + "@smithy/util-middleware": "^4.2.5", + "@smithy/util-retry": "^4.2.5", + "@smithy/util-utf8": "^4.2.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/core": { + "version": "3.943.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.943.0.tgz", + "integrity": "sha512-8CBy2hI9ABF7RBVQuY1bgf/ue+WPmM/hl0adrXFlhnhkaQP0tFY5zhiy1Y+n7V+5f3/ORoHBmCCQmcHDDYJqJQ==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.936.0", + "@aws-sdk/xml-builder": "3.930.0", + "@smithy/core": "^3.18.5", + "@smithy/node-config-provider": "^4.3.5", + "@smithy/property-provider": "^4.2.5", + "@smithy/protocol-http": "^5.3.5", + "@smithy/signature-v4": "^5.3.5", + "@smithy/smithy-client": "^4.9.8", + "@smithy/types": "^4.9.0", + "@smithy/util-base64": "^4.3.0", + "@smithy/util-middleware": "^4.2.5", + "@smithy/util-utf8": "^4.2.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-cognito-identity": { + "version": "3.943.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-cognito-identity/-/credential-provider-cognito-identity-3.943.0.tgz", + "integrity": "sha512-jZJ0uHjNlhfjx2ZX7YVYnh1wfSkLAvQmecGCSl9C6LJRNXy4uWFPbGjPqcA0tWp0WWIsUYhqjasgvCOMZIY8nw==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/client-cognito-identity": "3.943.0", + "@aws-sdk/types": "3.936.0", + "@smithy/property-provider": "^4.2.5", + "@smithy/types": "^4.9.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-env": { + "version": "3.943.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.943.0.tgz", + "integrity": "sha512-WnS5w9fK9CTuoZRVSIHLOMcI63oODg9qd1vXMYb7QGLGlfwUm4aG3hdu7i9XvYrpkQfE3dzwWLtXF4ZBuL1Tew==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.943.0", + "@aws-sdk/types": "3.936.0", + "@smithy/property-provider": "^4.2.5", + "@smithy/types": "^4.9.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-http": { + "version": "3.943.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.943.0.tgz", + "integrity": "sha512-SA8bUcYDEACdhnhLpZNnWusBpdmj4Vl67Vxp3Zke7SvoWSYbuxa+tiDiC+c92Z4Yq6xNOuLPW912ZPb9/NsSkA==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.943.0", + "@aws-sdk/types": "3.936.0", + "@smithy/fetch-http-handler": "^5.3.6", + "@smithy/node-http-handler": "^4.4.5", + "@smithy/property-provider": "^4.2.5", + "@smithy/protocol-http": "^5.3.5", + "@smithy/smithy-client": "^4.9.8", + "@smithy/types": "^4.9.0", + "@smithy/util-stream": "^4.5.6", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-ini": { + "version": "3.943.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.943.0.tgz", + "integrity": "sha512-BcLDb8l4oVW+NkuqXMlO7TnM6lBOWW318ylf4FRED/ply5eaGxkQYqdGvHSqGSN5Rb3vr5Ek0xpzSjeYD7C8Kw==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.943.0", + "@aws-sdk/credential-provider-env": "3.943.0", + "@aws-sdk/credential-provider-http": "3.943.0", + "@aws-sdk/credential-provider-login": "3.943.0", + "@aws-sdk/credential-provider-process": "3.943.0", + "@aws-sdk/credential-provider-sso": "3.943.0", + "@aws-sdk/credential-provider-web-identity": "3.943.0", + "@aws-sdk/nested-clients": "3.943.0", + "@aws-sdk/types": "3.936.0", + "@smithy/credential-provider-imds": "^4.2.5", + "@smithy/property-provider": "^4.2.5", + "@smithy/shared-ini-file-loader": "^4.4.0", + "@smithy/types": "^4.9.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-login": { + "version": "3.943.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-login/-/credential-provider-login-3.943.0.tgz", + "integrity": "sha512-9iCOVkiRW+evxiJE94RqosCwRrzptAVPhRhGWv4osfYDhjNAvUMyrnZl3T1bjqCoKNcETRKEZIU3dqYHnUkcwQ==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.943.0", + "@aws-sdk/nested-clients": "3.943.0", + "@aws-sdk/types": "3.936.0", + "@smithy/property-provider": "^4.2.5", + "@smithy/protocol-http": "^5.3.5", + "@smithy/shared-ini-file-loader": "^4.4.0", + "@smithy/types": "^4.9.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-node": { + "version": "3.943.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.943.0.tgz", + "integrity": "sha512-14eddaH/gjCWoLSAELVrFOQNyswUYwWphIt+PdsJ/FqVfP4ay2HsiZVEIYbQtmrKHaoLJhiZKwBQRjcqJDZG0w==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/credential-provider-env": "3.943.0", + "@aws-sdk/credential-provider-http": "3.943.0", + "@aws-sdk/credential-provider-ini": "3.943.0", + "@aws-sdk/credential-provider-process": "3.943.0", + "@aws-sdk/credential-provider-sso": "3.943.0", + "@aws-sdk/credential-provider-web-identity": "3.943.0", + "@aws-sdk/types": "3.936.0", + "@smithy/credential-provider-imds": "^4.2.5", + "@smithy/property-provider": "^4.2.5", + "@smithy/shared-ini-file-loader": "^4.4.0", + "@smithy/types": "^4.9.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-process": { + "version": "3.943.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.943.0.tgz", + "integrity": "sha512-GIY/vUkthL33AdjOJ8r9vOosKf/3X+X7LIiACzGxvZZrtoOiRq0LADppdiKIB48vTL63VvW+eRIOFAxE6UDekw==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.943.0", + "@aws-sdk/types": "3.936.0", + "@smithy/property-provider": "^4.2.5", + "@smithy/shared-ini-file-loader": "^4.4.0", + "@smithy/types": "^4.9.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-sso": { + "version": "3.943.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.943.0.tgz", + "integrity": "sha512-1c5G11syUrru3D9OO6Uk+ul5e2lX1adb+7zQNyluNaLPXP6Dina6Sy6DFGRLu7tM8+M7luYmbS3w63rpYpaL+A==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/client-sso": "3.943.0", + "@aws-sdk/core": "3.943.0", + "@aws-sdk/token-providers": "3.943.0", + "@aws-sdk/types": "3.936.0", + "@smithy/property-provider": "^4.2.5", + "@smithy/shared-ini-file-loader": "^4.4.0", + "@smithy/types": "^4.9.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-web-identity": { + "version": "3.943.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.943.0.tgz", + "integrity": "sha512-VtyGKHxICSb4kKGuaqotxso8JVM8RjCS3UYdIMOxUt9TaFE/CZIfZKtjTr+IJ7M0P7t36wuSUb/jRLyNmGzUUA==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.943.0", + "@aws-sdk/nested-clients": "3.943.0", + "@aws-sdk/types": "3.936.0", + "@smithy/property-provider": "^4.2.5", + "@smithy/shared-ini-file-loader": "^4.4.0", + "@smithy/types": "^4.9.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/credential-providers": { + "version": "3.943.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-providers/-/credential-providers-3.943.0.tgz", + "integrity": "sha512-uZurSNsS01ehhrSwEPwcKdqp9lmd/x9q++BYO351bXyjSj1LzA/2lfUIxI2tCz/wAjJWOdnnlUdJj6P9I1uNvw==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/client-cognito-identity": "3.943.0", + "@aws-sdk/core": "3.943.0", + "@aws-sdk/credential-provider-cognito-identity": "3.943.0", + "@aws-sdk/credential-provider-env": "3.943.0", + "@aws-sdk/credential-provider-http": "3.943.0", + "@aws-sdk/credential-provider-ini": "3.943.0", + "@aws-sdk/credential-provider-login": "3.943.0", + "@aws-sdk/credential-provider-node": "3.943.0", + "@aws-sdk/credential-provider-process": "3.943.0", + "@aws-sdk/credential-provider-sso": "3.943.0", + "@aws-sdk/credential-provider-web-identity": "3.943.0", + "@aws-sdk/nested-clients": "3.943.0", + "@aws-sdk/types": "3.936.0", + "@smithy/config-resolver": "^4.4.3", + "@smithy/core": "^3.18.5", + "@smithy/credential-provider-imds": "^4.2.5", + "@smithy/node-config-provider": "^4.3.5", + "@smithy/property-provider": "^4.2.5", + "@smithy/types": "^4.9.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/middleware-host-header": { + "version": "3.936.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.936.0.tgz", + "integrity": "sha512-tAaObaAnsP1XnLGndfkGWFuzrJYuk9W0b/nLvol66t8FZExIAf/WdkT2NNAWOYxljVs++oHnyHBCxIlaHrzSiw==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.936.0", + "@smithy/protocol-http": "^5.3.5", + "@smithy/types": "^4.9.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/middleware-logger": { + "version": "3.936.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.936.0.tgz", + "integrity": "sha512-aPSJ12d3a3Ea5nyEnLbijCaaYJT2QjQ9iW+zGh5QcZYXmOGWbKVyPSxmVOboZQG+c1M8t6d2O7tqrwzIq8L8qw==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.936.0", + "@smithy/types": "^4.9.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/middleware-recursion-detection": { + "version": "3.936.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.936.0.tgz", + "integrity": "sha512-l4aGbHpXM45YNgXggIux1HgsCVAvvBoqHPkqLnqMl9QVapfuSTjJHfDYDsx1Xxct6/m7qSMUzanBALhiaGO2fA==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.936.0", + "@aws/lambda-invoke-store": "^0.2.0", + "@smithy/protocol-http": "^5.3.5", + "@smithy/types": "^4.9.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/middleware-user-agent": { + "version": "3.943.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.943.0.tgz", + "integrity": "sha512-956n4kVEwFNXndXfhSAN5wO+KRgqiWEEY+ECwLvxmmO8uQ0NWOa8l6l65nTtyuiWzMX81c9BvlyNR5EgUeeUvA==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.943.0", + "@aws-sdk/types": "3.936.0", + "@aws-sdk/util-endpoints": "3.936.0", + "@smithy/core": "^3.18.5", + "@smithy/protocol-http": "^5.3.5", + "@smithy/types": "^4.9.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/nested-clients": { + "version": "3.943.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/nested-clients/-/nested-clients-3.943.0.tgz", + "integrity": "sha512-anFtB0p2FPuyUnbOULwGmKYqYKSq1M73c9uZ08jR/NCq6Trjq9cuF5TFTeHwjJyPRb4wMf2Qk859oiVfFqnQiw==", + "license": "Apache-2.0", + "dependencies": { + "@aws-crypto/sha256-browser": "5.2.0", + "@aws-crypto/sha256-js": "5.2.0", + "@aws-sdk/core": "3.943.0", + "@aws-sdk/middleware-host-header": "3.936.0", + "@aws-sdk/middleware-logger": "3.936.0", + "@aws-sdk/middleware-recursion-detection": "3.936.0", + "@aws-sdk/middleware-user-agent": "3.943.0", + "@aws-sdk/region-config-resolver": "3.936.0", + "@aws-sdk/types": "3.936.0", + "@aws-sdk/util-endpoints": "3.936.0", + "@aws-sdk/util-user-agent-browser": "3.936.0", + "@aws-sdk/util-user-agent-node": "3.943.0", + "@smithy/config-resolver": "^4.4.3", + "@smithy/core": "^3.18.5", + "@smithy/fetch-http-handler": "^5.3.6", + "@smithy/hash-node": "^4.2.5", + "@smithy/invalid-dependency": "^4.2.5", + "@smithy/middleware-content-length": "^4.2.5", + "@smithy/middleware-endpoint": "^4.3.12", + "@smithy/middleware-retry": "^4.4.12", + "@smithy/middleware-serde": "^4.2.6", + "@smithy/middleware-stack": "^4.2.5", + "@smithy/node-config-provider": "^4.3.5", + "@smithy/node-http-handler": "^4.4.5", + "@smithy/protocol-http": "^5.3.5", + "@smithy/smithy-client": "^4.9.8", + "@smithy/types": "^4.9.0", + "@smithy/url-parser": "^4.2.5", + "@smithy/util-base64": "^4.3.0", + "@smithy/util-body-length-browser": "^4.2.0", + "@smithy/util-body-length-node": "^4.2.1", + "@smithy/util-defaults-mode-browser": "^4.3.11", + "@smithy/util-defaults-mode-node": "^4.2.14", + "@smithy/util-endpoints": "^3.2.5", + "@smithy/util-middleware": "^4.2.5", + "@smithy/util-retry": "^4.2.5", + "@smithy/util-utf8": "^4.2.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/region-config-resolver": { + "version": "3.936.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.936.0.tgz", + "integrity": "sha512-wOKhzzWsshXGduxO4pqSiNyL9oUtk4BEvjWm9aaq6Hmfdoydq6v6t0rAGHWPjFwy9z2haovGRi3C8IxdMB4muw==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.936.0", + "@smithy/config-resolver": "^4.4.3", + "@smithy/node-config-provider": "^4.3.5", + "@smithy/types": "^4.9.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/token-providers": { + "version": "3.943.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.943.0.tgz", + "integrity": "sha512-cRKyIzwfkS+XztXIFPoWORuaxlIswP+a83BJzelX4S1gUZ7FcXB4+lj9Jxjn8SbQhR4TPU3Owbpu+S7pd6IRbQ==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/core": "3.943.0", + "@aws-sdk/nested-clients": "3.943.0", + "@aws-sdk/types": "3.936.0", + "@smithy/property-provider": "^4.2.5", + "@smithy/shared-ini-file-loader": "^4.4.0", + "@smithy/types": "^4.9.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/types": { + "version": "3.936.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.936.0.tgz", + "integrity": "sha512-uz0/VlMd2pP5MepdrHizd+T+OKfyK4r3OA9JI+L/lPKg0YFQosdJNCKisr6o70E3dh8iMpFYxF1UN/4uZsyARg==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.9.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/util-endpoints": { + "version": "3.936.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.936.0.tgz", + "integrity": "sha512-0Zx3Ntdpu+z9Wlm7JKUBOzS9EunwKAb4KdGUQQxDqh5Lc3ta5uBoub+FgmVuzwnmBu9U1Os8UuwVTH0Lgu+P5w==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.936.0", + "@smithy/types": "^4.9.0", + "@smithy/url-parser": "^4.2.5", + "@smithy/util-endpoints": "^3.2.5", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/util-locate-window": { + "version": "3.893.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-locate-window/-/util-locate-window-3.893.0.tgz", + "integrity": "sha512-T89pFfgat6c8nMmpI8eKjBcDcgJq36+m9oiXbcUzeU55MP9ZuGgBomGjGnHaEyF36jenW9gmg3NfZDm0AO2XPg==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws-sdk/util-user-agent-browser": { + "version": "3.936.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.936.0.tgz", + "integrity": "sha512-eZ/XF6NxMtu+iCma58GRNRxSq4lHo6zHQLOZRIeL/ghqYJirqHdenMOwrzPettj60KWlv827RVebP9oNVrwZbw==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/types": "3.936.0", + "@smithy/types": "^4.9.0", + "bowser": "^2.11.0", + "tslib": "^2.6.2" + } + }, + "node_modules/@aws-sdk/util-user-agent-node": { + "version": "3.943.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.943.0.tgz", + "integrity": "sha512-gn+ILprVRrgAgTIBk2TDsJLRClzIOdStQFeFTcN0qpL8Z4GBCqMFhw7O7X+MM55Stt5s4jAauQ/VvoqmCADnQg==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/middleware-user-agent": "3.943.0", + "@aws-sdk/types": "3.936.0", + "@smithy/node-config-provider": "^4.3.5", + "@smithy/types": "^4.9.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "aws-crt": ">=1.0.0" + }, + "peerDependenciesMeta": { + "aws-crt": { + "optional": true + } + } + }, + "node_modules/@aws-sdk/xml-builder": { + "version": "3.930.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/xml-builder/-/xml-builder-3.930.0.tgz", + "integrity": "sha512-YIfkD17GocxdmlUVc3ia52QhcWuRIUJonbF8A2CYfcWNV3HzvAqpcPeC0bYUhkK+8e8YO1ARnLKZQE0TlwzorA==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.9.0", + "fast-xml-parser": "5.2.5", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@aws/lambda-invoke-store": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@aws/lambda-invoke-store/-/lambda-invoke-store-0.2.1.tgz", + "integrity": "sha512-sIyFcoPZkTtNu9xFeEoynMef3bPJIAbOfUh+ueYcfhVl6xm2VRtMcMclSxmZCMnHHd4hlYKJeq/aggmBEWynww==", + "license": "Apache-2.0", + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.0.tgz", + "integrity": "sha512-KuZrd2hRjz01y5JK9mEBSD3Vj3mbCvemhT466rSuJYeE/hjuBrHfjjcjMdTm/sz7au+++sdbJZJmuBwQLuw68A==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.0.tgz", + "integrity": "sha512-j67aezrPNYWJEOHUNLPj9maeJte7uSMM6gMoxfPC9hOg8N02JuQi/T7ewumf4tNvJadFkvLZMlAq73b9uwdMyQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.0.tgz", + "integrity": "sha512-CC3vt4+1xZrs97/PKDkl0yN7w8edvU2vZvAFGD16n9F0Cvniy5qvzRXjfO1l94efczkkQE6g1x0i73Qf5uthOQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.0.tgz", + "integrity": "sha512-wurMkF1nmQajBO1+0CJmcN17U4BP6GqNSROP8t0X/Jiw2ltYGLHpEksp9MpoBqkrFR3kv2/te6Sha26k3+yZ9Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.0.tgz", + "integrity": "sha512-uJOQKYCcHhg07DL7i8MzjvS2LaP7W7Pn/7uA0B5S1EnqAirJtbyw4yC5jQ5qcFjHK9l6o/MX9QisBg12kNkdHg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.0.tgz", + "integrity": "sha512-8mG6arH3yB/4ZXiEnXof5MK72dE6zM9cDvUcPtxhUZsDjESl9JipZYW60C3JGreKCEP+p8P/72r69m4AZGJd5g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.0.tgz", + "integrity": "sha512-9FHtyO988CwNMMOE3YIeci+UV+x5Zy8fI2qHNpsEtSF83YPBmE8UWmfYAQg6Ux7Gsmd4FejZqnEUZCMGaNQHQw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.0.tgz", + "integrity": "sha512-zCMeMXI4HS/tXvJz8vWGexpZj2YVtRAihHLk1imZj4efx1BQzN76YFeKqlDr3bUWI26wHwLWPd3rwh6pe4EV7g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.0.tgz", + "integrity": "sha512-t76XLQDpxgmq2cNXKTVEB7O7YMb42atj2Re2Haf45HkaUpjM2J0UuJZDuaGbPbamzZ7bawyGFUkodL+zcE+jvQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.0.tgz", + "integrity": "sha512-AS18v0V+vZiLJyi/4LphvBE+OIX682Pu7ZYNsdUHyUKSoRwdnOsMf6FDekwoAFKej14WAkOef3zAORJgAtXnlQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.0.tgz", + "integrity": "sha512-Mz1jxqm/kfgKkc/KLHC5qIujMvnnarD9ra1cEcrs7qshTUSksPihGrWHVG5+osAIQ68577Zpww7SGapmzSt4Nw==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.0.tgz", + "integrity": "sha512-QbEREjdJeIreIAbdG2hLU1yXm1uu+LTdzoq1KCo4G4pFOLlvIspBm36QrQOar9LFduavoWX2msNFAAAY9j4BDg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.0.tgz", + "integrity": "sha512-sJz3zRNe4tO2wxvDpH/HYJilb6+2YJxo/ZNbVdtFiKDufzWq4JmKAiHy9iGoLjAV7r/W32VgaHGkk35cUXlNOg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.0.tgz", + "integrity": "sha512-z9N10FBD0DCS2dmSABDBb5TLAyF1/ydVb+N4pi88T45efQ/w4ohr/F/QYCkxDPnkhkp6AIpIcQKQ8F0ANoA2JA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.0.tgz", + "integrity": "sha512-pQdyAIZ0BWIC5GyvVFn5awDiO14TkT/19FTmFcPdDec94KJ1uZcmFs21Fo8auMXzD4Tt+diXu1LW1gHus9fhFQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.0.tgz", + "integrity": "sha512-hPlRWR4eIDDEci953RI1BLZitgi5uqcsjKMxwYfmi4LcwyWo2IcRP+lThVnKjNtk90pLS8nKdroXYOqW+QQH+w==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.0.tgz", + "integrity": "sha512-1hBWx4OUJE2cab++aVZ7pObD6s+DK4mPGpemtnAORBvb5l/g5xFGk0vc0PjSkrDs0XaXj9yyob3d14XqvnQ4gw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.0.tgz", + "integrity": "sha512-6m0sfQfxfQfy1qRuecMkJlf1cIzTOgyaeXaiVaaki8/v+WB+U4hc6ik15ZW6TAllRlg/WuQXxWj1jx6C+dfy3w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.0.tgz", + "integrity": "sha512-xbbOdfn06FtcJ9d0ShxxvSn2iUsGd/lgPIO2V3VZIPDbEaIj1/3nBBe1AwuEZKXVXkMmpr6LUAgMkLD/4D2PPA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.0.tgz", + "integrity": "sha512-fWgqR8uNbCQ/GGv0yhzttj6sU/9Z5/Sv/VGU3F5OuXK6J6SlriONKrQ7tNlwBrJZXRYk5jUhuWvF7GYzGguBZQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.0.tgz", + "integrity": "sha512-aCwlRdSNMNxkGGqQajMUza6uXzR/U0dIl1QmLjPtRbLOx3Gy3otfFu/VjATy4yQzo9yFDGTxYDo1FfAD9oRD2A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.0.tgz", + "integrity": "sha512-nyvsBccxNAsNYz2jVFYwEGuRRomqZ149A39SHWk4hV0jWxKM0hjBPm3AmdxcbHiFLbBSwG6SbpIcUbXjgyECfA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.0.tgz", + "integrity": "sha512-Q1KY1iJafM+UX6CFEL+F4HRTgygmEW568YMqDA5UV97AuZSm21b7SXIrRJDwXWPzr8MGr75fUZPV67FdtMHlHA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.0.tgz", + "integrity": "sha512-W1eyGNi6d+8kOmZIwi/EDjrL9nxQIQ0MiGqe/AWc6+IaHloxHSGoeRgDRKHFISThLmsewZ5nHFvGFWdBYlgKPg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.0.tgz", + "integrity": "sha512-30z1aKL9h22kQhilnYkORFYt+3wp7yZsHWus+wSKAJR8JtdfI76LJ4SBdMsCopTR3z/ORqVu5L1vtnHZWVj4cQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.0.tgz", + "integrity": "sha512-aIitBcjQeyOhMTImhLZmtxfdOcuNRpwlPNmlFKPcHQYPhEssw75Cl1TSXJXpMkzaua9FUetx/4OQKq7eJul5Cg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@openauthjs/openauth": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@openauthjs/openauth/-/openauth-0.4.3.tgz", + "integrity": "sha512-RlnjqvHzqcbFVymEwhlUEuac4utA5h4nhSK/i2szZuQmxTIqbGUxZ+nM+avM+VV4Ing+/ZaNLKILoXS3yrkOOw==", + "dependencies": { + "@standard-schema/spec": "1.0.0-beta.3", + "aws4fetch": "1.0.20", + "jose": "5.9.6" + }, + "peerDependencies": { + "arctic": "^2.2.2", + "hono": "^4.0.0" + } + }, + "node_modules/@openauthjs/openauth/node_modules/@standard-schema/spec": { + "version": "1.0.0-beta.3", + "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.0.0-beta.3.tgz", + "integrity": "sha512-0ifF3BjA1E8SY9C+nUew8RefNOIq0cDlYALPty4rhUm8Rrl6tCM8hBT4bhGhx7I7iXD0uAgt50lgo8dD73ACMw==", + "license": "MIT" + }, + "node_modules/@opencode-ai/plugin": { + "version": "1.0.143", + "resolved": "https://registry.npmjs.org/@opencode-ai/plugin/-/plugin-1.0.143.tgz", + "integrity": "sha512-yzaCmdazVJMDADJLbMM8KGp1X+Hd/HVyIXMlNt9qcvz/fcs/ET4EwHJsJaQi/9m/jLJ+plwBJAeIW08BMrECPg==", + "dev": true, + "dependencies": { + "@opencode-ai/sdk": "1.0.143", + "zod": "4.1.8" + } + }, + "node_modules/@opencode-ai/plugin/node_modules/zod": { + "version": "4.1.8", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.1.8.tgz", + "integrity": "sha512-5R1P+WwQqmmMIEACyzSvo4JXHY5WiAFHRMg+zBZKgKS+Q1viRa0C1hmUKtHltoIFKtIdki3pRxkmpP74jnNYHQ==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, + "node_modules/@opencode-ai/sdk": { + "version": "1.0.143", + "resolved": "https://registry.npmjs.org/@opencode-ai/sdk/-/sdk-1.0.143.tgz", + "integrity": "sha512-dtmkBfJ7IIAHzL6KCzAlwc9GybfJONVeCsF6ePYySpkuhslDbRkZBJYb5vqGd1H5zdsgjc6JjuvmOf0rPWUL6A==" + }, + "node_modules/@opentelemetry/api": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.9.0.tgz", + "integrity": "sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==", + "license": "Apache-2.0", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@oslojs/asn1": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@oslojs/asn1/-/asn1-1.0.0.tgz", + "integrity": "sha512-zw/wn0sj0j0QKbIXfIlnEcTviaCzYOY3V5rAyjR6YtOByFtJiT574+8p9Wlach0lZH9fddD4yb9laEAIl4vXQA==", + "license": "MIT", + "peer": true, + "dependencies": { + "@oslojs/binary": "1.0.0" + } + }, + "node_modules/@oslojs/binary": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@oslojs/binary/-/binary-1.0.0.tgz", + "integrity": "sha512-9RCU6OwXU6p67H4NODbuxv2S3eenuQ4/WFLrsq+K/k682xrznH5EVWA7N4VFk9VYVcbFtKqur5YQQZc0ySGhsQ==", + "license": "MIT", + "peer": true + }, + "node_modules/@oslojs/crypto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@oslojs/crypto/-/crypto-1.0.1.tgz", + "integrity": "sha512-7n08G8nWjAr/Yu3vu9zzrd0L9XnrJfpMioQcvCMxBIiF5orECHe5/3J0jmXRVvgfqMm/+4oxlQ+Sq39COYLcNQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "@oslojs/asn1": "1.0.0", + "@oslojs/binary": "1.0.0" + } + }, + "node_modules/@oslojs/encoding": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@oslojs/encoding/-/encoding-1.1.0.tgz", + "integrity": "sha512-70wQhgYmndg4GCPxPPxPGevRKqTIJ2Nh4OkiMWmDAVYsTQ+Ta7Sq+rPevXyXGdzr30/qZBnyOalCszoMxlyldQ==", + "license": "MIT", + "peer": true + }, + "node_modules/@oslojs/jwt": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@oslojs/jwt/-/jwt-0.2.0.tgz", + "integrity": "sha512-bLE7BtHrURedCn4Mco3ma9L4Y1GR2SMBuIvjWr7rmQ4/W/4Jy70TIAgZ+0nIlk0xHz1vNP8x8DCns45Sb2XRbg==", + "license": "MIT", + "peer": true, + "dependencies": { + "@oslojs/encoding": "0.4.1" + } + }, + "node_modules/@oslojs/jwt/node_modules/@oslojs/encoding": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@oslojs/encoding/-/encoding-0.4.1.tgz", + "integrity": "sha512-hkjo6MuIK/kQR5CrGNdAPZhS01ZCXuWDRJ187zh6qqF2+yMHZpD9fAYpX8q2bOO6Ryhl3XpCT6kUX76N8hhm4Q==", + "license": "MIT", + "peer": true + }, + "node_modules/@smithy/abort-controller": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/@smithy/abort-controller/-/abort-controller-4.2.5.tgz", + "integrity": "sha512-j7HwVkBw68YW8UmFRcjZOmssE77Rvk0GWAIN1oFBhsaovQmZWYCIcGa9/pwRB0ExI8Sk9MWNALTjftjHZea7VA==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.9.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/config-resolver": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/@smithy/config-resolver/-/config-resolver-4.4.3.tgz", + "integrity": "sha512-ezHLe1tKLUxDJo2LHtDuEDyWXolw8WGOR92qb4bQdWq/zKenO5BvctZGrVJBK08zjezSk7bmbKFOXIVyChvDLw==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/node-config-provider": "^4.3.5", + "@smithy/types": "^4.9.0", + "@smithy/util-config-provider": "^4.2.0", + "@smithy/util-endpoints": "^3.2.5", + "@smithy/util-middleware": "^4.2.5", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/core": { + "version": "3.18.6", + "resolved": "https://registry.npmjs.org/@smithy/core/-/core-3.18.6.tgz", + "integrity": "sha512-8Q/ugWqfDUEU1Exw71+DoOzlONJ2Cn9QA8VeeDzLLjzO/qruh9UKFzbszy4jXcIYgGofxYiT0t1TT6+CT/GupQ==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/middleware-serde": "^4.2.6", + "@smithy/protocol-http": "^5.3.5", + "@smithy/types": "^4.9.0", + "@smithy/util-base64": "^4.3.0", + "@smithy/util-body-length-browser": "^4.2.0", + "@smithy/util-middleware": "^4.2.5", + "@smithy/util-stream": "^4.5.6", + "@smithy/util-utf8": "^4.2.0", + "@smithy/uuid": "^1.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/credential-provider-imds": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/@smithy/credential-provider-imds/-/credential-provider-imds-4.2.5.tgz", + "integrity": "sha512-BZwotjoZWn9+36nimwm/OLIcVe+KYRwzMjfhd4QT7QxPm9WY0HiOV8t/Wlh+HVUif0SBVV7ksq8//hPaBC/okQ==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/node-config-provider": "^4.3.5", + "@smithy/property-provider": "^4.2.5", + "@smithy/types": "^4.9.0", + "@smithy/url-parser": "^4.2.5", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/fetch-http-handler": { + "version": "5.3.6", + "resolved": "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-5.3.6.tgz", + "integrity": "sha512-3+RG3EA6BBJ/ofZUeTFJA7mHfSYrZtQIrDP9dI8Lf7X6Jbos2jptuLrAAteDiFVrmbEmLSuRG/bUKzfAXk7dhg==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/protocol-http": "^5.3.5", + "@smithy/querystring-builder": "^4.2.5", + "@smithy/types": "^4.9.0", + "@smithy/util-base64": "^4.3.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/hash-node": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/@smithy/hash-node/-/hash-node-4.2.5.tgz", + "integrity": "sha512-DpYX914YOfA3UDT9CN1BM787PcHfWRBB43fFGCYrZFUH0Jv+5t8yYl+Pd5PW4+QzoGEDvn5d5QIO4j2HyYZQSA==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.9.0", + "@smithy/util-buffer-from": "^4.2.0", + "@smithy/util-utf8": "^4.2.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/invalid-dependency": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/@smithy/invalid-dependency/-/invalid-dependency-4.2.5.tgz", + "integrity": "sha512-2L2erASEro1WC5nV+plwIMxrTXpvpfzl4e+Nre6vBVRR2HKeGGcvpJyyL3/PpiSg+cJG2KpTmZmq934Olb6e5A==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.9.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/is-array-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-4.2.0.tgz", + "integrity": "sha512-DZZZBvC7sjcYh4MazJSGiWMI2L7E0oCiRHREDzIxi/M2LY79/21iXt6aPLHge82wi5LsuRF5A06Ds3+0mlh6CQ==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/middleware-content-length": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/@smithy/middleware-content-length/-/middleware-content-length-4.2.5.tgz", + "integrity": "sha512-Y/RabVa5vbl5FuHYV2vUCwvh/dqzrEY/K2yWPSqvhFUwIY0atLqO4TienjBXakoy4zrKAMCZwg+YEqmH7jaN7A==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/protocol-http": "^5.3.5", + "@smithy/types": "^4.9.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/middleware-endpoint": { + "version": "4.3.13", + "resolved": "https://registry.npmjs.org/@smithy/middleware-endpoint/-/middleware-endpoint-4.3.13.tgz", + "integrity": "sha512-X4za1qCdyx1hEVVXuAWlZuK6wzLDv1uw1OY9VtaYy1lULl661+frY7FeuHdYdl7qAARUxH2yvNExU2/SmRFfcg==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/core": "^3.18.6", + "@smithy/middleware-serde": "^4.2.6", + "@smithy/node-config-provider": "^4.3.5", + "@smithy/shared-ini-file-loader": "^4.4.0", + "@smithy/types": "^4.9.0", + "@smithy/url-parser": "^4.2.5", + "@smithy/util-middleware": "^4.2.5", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/middleware-retry": { + "version": "4.4.13", + "resolved": "https://registry.npmjs.org/@smithy/middleware-retry/-/middleware-retry-4.4.13.tgz", + "integrity": "sha512-RzIDF9OrSviXX7MQeKOm8r/372KTyY8Jmp6HNKOOYlrguHADuM3ED/f4aCyNhZZFLG55lv5beBin7nL0Nzy1Dw==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/node-config-provider": "^4.3.5", + "@smithy/protocol-http": "^5.3.5", + "@smithy/service-error-classification": "^4.2.5", + "@smithy/smithy-client": "^4.9.9", + "@smithy/types": "^4.9.0", + "@smithy/util-middleware": "^4.2.5", + "@smithy/util-retry": "^4.2.5", + "@smithy/uuid": "^1.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/middleware-serde": { + "version": "4.2.6", + "resolved": "https://registry.npmjs.org/@smithy/middleware-serde/-/middleware-serde-4.2.6.tgz", + "integrity": "sha512-VkLoE/z7e2g8pirwisLz8XJWedUSY8my/qrp81VmAdyrhi94T+riBfwP+AOEEFR9rFTSonC/5D2eWNmFabHyGQ==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/protocol-http": "^5.3.5", + "@smithy/types": "^4.9.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/middleware-stack": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/@smithy/middleware-stack/-/middleware-stack-4.2.5.tgz", + "integrity": "sha512-bYrutc+neOyWxtZdbB2USbQttZN0mXaOyYLIsaTbJhFsfpXyGWUxJpEuO1rJ8IIJm2qH4+xJT0mxUSsEDTYwdQ==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.9.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/node-config-provider": { + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/@smithy/node-config-provider/-/node-config-provider-4.3.5.tgz", + "integrity": "sha512-UTurh1C4qkVCtqggI36DGbLB2Kv8UlcFdMXDcWMbqVY2uRg0XmT9Pb4Vj6oSQ34eizO1fvR0RnFV4Axw4IrrAg==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/property-provider": "^4.2.5", + "@smithy/shared-ini-file-loader": "^4.4.0", + "@smithy/types": "^4.9.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/node-http-handler": { + "version": "4.4.5", + "resolved": "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-4.4.5.tgz", + "integrity": "sha512-CMnzM9R2WqlqXQGtIlsHMEZfXKJVTIrqCNoSd/QpAyp+Dw0a1Vps13l6ma1fH8g7zSPNsA59B/kWgeylFuA/lw==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/abort-controller": "^4.2.5", + "@smithy/protocol-http": "^5.3.5", + "@smithy/querystring-builder": "^4.2.5", + "@smithy/types": "^4.9.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/property-provider": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/@smithy/property-provider/-/property-provider-4.2.5.tgz", + "integrity": "sha512-8iLN1XSE1rl4MuxvQ+5OSk/Zb5El7NJZ1td6Tn+8dQQHIjp59Lwl6bd0+nzw6SKm2wSSriH2v/I9LPzUic7EOg==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.9.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/protocol-http": { + "version": "5.3.5", + "resolved": "https://registry.npmjs.org/@smithy/protocol-http/-/protocol-http-5.3.5.tgz", + "integrity": "sha512-RlaL+sA0LNMp03bf7XPbFmT5gN+w3besXSWMkA8rcmxLSVfiEXElQi4O2IWwPfxzcHkxqrwBFMbngB8yx/RvaQ==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.9.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/querystring-builder": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/@smithy/querystring-builder/-/querystring-builder-4.2.5.tgz", + "integrity": "sha512-y98otMI1saoajeik2kLfGyRp11e5U/iJYH/wLCh3aTV/XutbGT9nziKGkgCaMD1ghK7p6htHMm6b6scl9JRUWg==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.9.0", + "@smithy/util-uri-escape": "^4.2.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/querystring-parser": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/@smithy/querystring-parser/-/querystring-parser-4.2.5.tgz", + "integrity": "sha512-031WCTdPYgiQRYNPXznHXof2YM0GwL6SeaSyTH/P72M1Vz73TvCNH2Nq8Iu2IEPq9QP2yx0/nrw5YmSeAi/AjQ==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.9.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/service-error-classification": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/@smithy/service-error-classification/-/service-error-classification-4.2.5.tgz", + "integrity": "sha512-8fEvK+WPE3wUAcDvqDQG1Vk3ANLR8Px979te96m84CbKAjBVf25rPYSzb4xU4hlTyho7VhOGnh5i62D/JVF0JQ==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.9.0" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/shared-ini-file-loader": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@smithy/shared-ini-file-loader/-/shared-ini-file-loader-4.4.0.tgz", + "integrity": "sha512-5WmZ5+kJgJDjwXXIzr1vDTG+RhF9wzSODQBfkrQ2VVkYALKGvZX1lgVSxEkgicSAFnFhPj5rudJV0zoinqS0bA==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.9.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/signature-v4": { + "version": "5.3.5", + "resolved": "https://registry.npmjs.org/@smithy/signature-v4/-/signature-v4-5.3.5.tgz", + "integrity": "sha512-xSUfMu1FT7ccfSXkoLl/QRQBi2rOvi3tiBZU2Tdy3I6cgvZ6SEi9QNey+lqps/sJRnogIS+lq+B1gxxbra2a/w==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/is-array-buffer": "^4.2.0", + "@smithy/protocol-http": "^5.3.5", + "@smithy/types": "^4.9.0", + "@smithy/util-hex-encoding": "^4.2.0", + "@smithy/util-middleware": "^4.2.5", + "@smithy/util-uri-escape": "^4.2.0", + "@smithy/util-utf8": "^4.2.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/smithy-client": { + "version": "4.9.9", + "resolved": "https://registry.npmjs.org/@smithy/smithy-client/-/smithy-client-4.9.9.tgz", + "integrity": "sha512-SUnZJMMo5yCmgjopJbiNeo1vlr8KvdnEfIHV9rlD77QuOGdRotIVBcOrBuMr+sI9zrnhtDtLP054bZVbpZpiQA==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/core": "^3.18.6", + "@smithy/middleware-endpoint": "^4.3.13", + "@smithy/middleware-stack": "^4.2.5", + "@smithy/protocol-http": "^5.3.5", + "@smithy/types": "^4.9.0", + "@smithy/util-stream": "^4.5.6", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/types": { + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/@smithy/types/-/types-4.9.0.tgz", + "integrity": "sha512-MvUbdnXDTwykR8cB1WZvNNwqoWVaTRA0RLlLmf/cIFNMM2cKWz01X4Ly6SMC4Kks30r8tT3Cty0jmeWfiuyHTA==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/url-parser": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/@smithy/url-parser/-/url-parser-4.2.5.tgz", + "integrity": "sha512-VaxMGsilqFnK1CeBX+LXnSuaMx4sTL/6znSZh2829txWieazdVxr54HmiyTsIbpOTLcf5nYpq9lpzmwRdxj6rQ==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/querystring-parser": "^4.2.5", + "@smithy/types": "^4.9.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/util-base64": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@smithy/util-base64/-/util-base64-4.3.0.tgz", + "integrity": "sha512-GkXZ59JfyxsIwNTWFnjmFEI8kZpRNIBfxKjv09+nkAWPt/4aGaEWMM04m4sxgNVWkbt2MdSvE3KF/PfX4nFedQ==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/util-buffer-from": "^4.2.0", + "@smithy/util-utf8": "^4.2.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/util-body-length-browser": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@smithy/util-body-length-browser/-/util-body-length-browser-4.2.0.tgz", + "integrity": "sha512-Fkoh/I76szMKJnBXWPdFkQJl2r9SjPt3cMzLdOB6eJ4Pnpas8hVoWPYemX/peO0yrrvldgCUVJqOAjUrOLjbxg==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/util-body-length-node": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@smithy/util-body-length-node/-/util-body-length-node-4.2.1.tgz", + "integrity": "sha512-h53dz/pISVrVrfxV1iqXlx5pRg3V2YWFcSQyPyXZRrZoZj4R4DeWRDo1a7dd3CPTcFi3kE+98tuNyD2axyZReA==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/util-buffer-from": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-4.2.0.tgz", + "integrity": "sha512-kAY9hTKulTNevM2nlRtxAG2FQ3B2OR6QIrPY3zE5LqJy1oxzmgBGsHLWTcNhWXKchgA0WHW+mZkQrng/pgcCew==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/is-array-buffer": "^4.2.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/util-config-provider": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@smithy/util-config-provider/-/util-config-provider-4.2.0.tgz", + "integrity": "sha512-YEjpl6XJ36FTKmD+kRJJWYvrHeUvm5ykaUS5xK+6oXffQPHeEM4/nXlZPe+Wu0lsgRUcNZiliYNh/y7q9c2y6Q==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/util-defaults-mode-browser": { + "version": "4.3.12", + "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-browser/-/util-defaults-mode-browser-4.3.12.tgz", + "integrity": "sha512-TKc6FnOxFULKxLgTNHYjcFqdOYzXVPFFVm5JhI30F3RdhT7nYOtOsjgaOwfDRmA/3U66O9KaBQ3UHoXwayRhAg==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/property-provider": "^4.2.5", + "@smithy/smithy-client": "^4.9.9", + "@smithy/types": "^4.9.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/util-defaults-mode-node": { + "version": "4.2.15", + "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-node/-/util-defaults-mode-node-4.2.15.tgz", + "integrity": "sha512-94NqfQVo+vGc5gsQ9SROZqOvBkGNMQu6pjXbnn8aQvBUhc31kx49gxlkBEqgmaZQHUUfdRUin5gK/HlHKmbAwg==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/config-resolver": "^4.4.3", + "@smithy/credential-provider-imds": "^4.2.5", + "@smithy/node-config-provider": "^4.3.5", + "@smithy/property-provider": "^4.2.5", + "@smithy/smithy-client": "^4.9.9", + "@smithy/types": "^4.9.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/util-endpoints": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/@smithy/util-endpoints/-/util-endpoints-3.2.5.tgz", + "integrity": "sha512-3O63AAWu2cSNQZp+ayl9I3NapW1p1rR5mlVHcF6hAB1dPZUQFfRPYtplWX/3xrzWthPGj5FqB12taJJCfH6s8A==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/node-config-provider": "^4.3.5", + "@smithy/types": "^4.9.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/util-hex-encoding": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@smithy/util-hex-encoding/-/util-hex-encoding-4.2.0.tgz", + "integrity": "sha512-CCQBwJIvXMLKxVbO88IukazJD9a4kQ9ZN7/UMGBjBcJYvatpWk+9g870El4cB8/EJxfe+k+y0GmR9CAzkF+Nbw==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/util-middleware": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/@smithy/util-middleware/-/util-middleware-4.2.5.tgz", + "integrity": "sha512-6Y3+rvBF7+PZOc40ybeZMcGln6xJGVeY60E7jy9Mv5iKpMJpHgRE6dKy9ScsVxvfAYuEX4Q9a65DQX90KaQ3bA==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/types": "^4.9.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/util-retry": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/@smithy/util-retry/-/util-retry-4.2.5.tgz", + "integrity": "sha512-GBj3+EZBbN4NAqJ/7pAhsXdfzdlznOh8PydUijy6FpNIMnHPSMO2/rP4HKu+UFeikJxShERk528oy7GT79YiJg==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/service-error-classification": "^4.2.5", + "@smithy/types": "^4.9.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/util-stream": { + "version": "4.5.6", + "resolved": "https://registry.npmjs.org/@smithy/util-stream/-/util-stream-4.5.6.tgz", + "integrity": "sha512-qWw/UM59TiaFrPevefOZ8CNBKbYEP6wBAIlLqxn3VAIo9rgnTNc4ASbVrqDmhuwI87usnjhdQrxodzAGFFzbRQ==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/fetch-http-handler": "^5.3.6", + "@smithy/node-http-handler": "^4.4.5", + "@smithy/types": "^4.9.0", + "@smithy/util-base64": "^4.3.0", + "@smithy/util-buffer-from": "^4.2.0", + "@smithy/util-hex-encoding": "^4.2.0", + "@smithy/util-utf8": "^4.2.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/util-uri-escape": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@smithy/util-uri-escape/-/util-uri-escape-4.2.0.tgz", + "integrity": "sha512-igZpCKV9+E/Mzrpq6YacdTQ0qTiLm85gD6N/IrmyDvQFA4UnU3d5g3m8tMT/6zG/vVkWSU+VxeUyGonL62DuxA==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/util-utf8": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-4.2.0.tgz", + "integrity": "sha512-zBPfuzoI8xyBtR2P6WQj63Rz8i3AmfAaJLuNG8dWsfvPe8lO4aCPYLn879mEgHndZH1zQ2oXmG8O1GGzzaoZiw==", + "license": "Apache-2.0", + "dependencies": { + "@smithy/util-buffer-from": "^4.2.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@smithy/uuid": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@smithy/uuid/-/uuid-1.1.0.tgz", + "integrity": "sha512-4aUIteuyxtBUhVdiQqcDhKFitwfd9hqoSDYY2KRXiWtgoWJ9Bmise+KfEPDiVHWeJepvF8xJO9/9+WDIciMFFw==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@standard-schema/spec": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.0.0.tgz", + "integrity": "sha512-m2bOd0f2RT9k8QJx1JN85cZYyH1RqFBdlwtkSlf4tBDYLCiiZnv1fIIwacK6cqwXavOydf0NPToMQgpKq+dVlA==", + "license": "MIT" + }, + "node_modules/@tarquinen/opencode-auth-provider": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/@tarquinen/opencode-auth-provider/-/opencode-auth-provider-0.1.7.tgz", + "integrity": "sha512-FH1QEyoirr2e8b48Z6HrjioIZIZUIM9zOpYmku1ad+c4Nv70F37fSWhcObyIdZo4Ly3OntpKPWjadyRhd/kQcg==", + "license": "MIT", + "dependencies": { + "@aws-sdk/credential-providers": "^3.936.0", + "ai": "^5.0.98", + "jsonc-parser": "^3.3.1", + "opencode-anthropic-auth": "0.0.2", + "opencode-copilot-auth": "0.0.5", + "opencode-gemini-auth": "^1.1.4", + "remeda": "^2.32.0", + "xdg-basedir": "^5.1.0", + "zod": "^4.1.12" + }, + "peerDependencies": { + "@ai-sdk/amazon-bedrock": ">=1.0.0", + "@ai-sdk/anthropic": ">=1.0.0", + "@ai-sdk/azure": ">=1.0.0", + "@ai-sdk/google": ">=1.0.0", + "@ai-sdk/google-vertex": ">=1.0.0", + "@ai-sdk/openai": ">=1.0.0", + "@ai-sdk/openai-compatible": ">=0.1.0", + "@openrouter/ai-sdk-provider": ">=0.1.0" + }, + "peerDependenciesMeta": { + "@ai-sdk/amazon-bedrock": { + "optional": true + }, + "@ai-sdk/anthropic": { + "optional": true + }, + "@ai-sdk/azure": { + "optional": true + }, + "@ai-sdk/google": { + "optional": true + }, + "@ai-sdk/google-vertex": { + "optional": true + }, + "@ai-sdk/openai": { + "optional": true + }, + "@ai-sdk/openai-compatible": { + "optional": true + }, + "@openrouter/ai-sdk-provider": { + "optional": true + } + } + }, + "node_modules/@types/node": { + "version": "24.10.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.1.tgz", + "integrity": "sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~7.16.0" + } + }, + "node_modules/@vercel/oidc": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@vercel/oidc/-/oidc-3.0.5.tgz", + "integrity": "sha512-fnYhv671l+eTTp48gB4zEsTW/YtRgRPnkI2nT7x6qw5rkI1Lq2hTmQIpHPgyThI0znLK+vX2n9XxKdXZ7BUbbw==", + "license": "Apache-2.0", + "engines": { + "node": ">= 20" + } + }, + "node_modules/ai": { + "version": "5.0.106", + "resolved": "https://registry.npmjs.org/ai/-/ai-5.0.106.tgz", + "integrity": "sha512-M5obwavxSJJ3tGlAFqI6eltYNJB0D20X6gIBCFx/KVorb/X1fxVVfiZZpZb+Gslu4340droSOjT0aKQFCarNVg==", + "license": "Apache-2.0", + "dependencies": { + "@ai-sdk/gateway": "2.0.18", + "@ai-sdk/provider": "2.0.0", + "@ai-sdk/provider-utils": "3.0.18", + "@opentelemetry/api": "1.9.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "zod": "^3.25.76 || ^4.1.8" + } + }, + "node_modules/arctic": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/arctic/-/arctic-2.3.4.tgz", + "integrity": "sha512-+p30BOWsctZp+CVYCt7oAean/hWGW42sH5LAcRQX56ttEkFJWbzXBhmSpibbzwSJkRrotmsA+oAoJoVsU0f5xA==", + "license": "MIT", + "peer": true, + "dependencies": { + "@oslojs/crypto": "1.0.1", + "@oslojs/encoding": "1.1.0", + "@oslojs/jwt": "0.2.0" + } + }, + "node_modules/aws4fetch": { + "version": "1.0.20", + "resolved": "https://registry.npmjs.org/aws4fetch/-/aws4fetch-1.0.20.tgz", + "integrity": "sha512-/djoAN709iY65ETD6LKCtyyEI04XIBP5xVvfmNxsEP0uJB5tyaGBztSryRr4HqMStr9R06PisQE7m9zDTXKu6g==", + "license": "MIT" + }, + "node_modules/bowser": { + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/bowser/-/bowser-2.13.1.tgz", + "integrity": "sha512-OHawaAbjwx6rqICCKgSG0SAnT05bzd7ppyKLVUITZpANBaaMFBAsaNkto3LoQ31tyFP5kNujE8Cdx85G9VzOkw==", + "license": "MIT" + }, + "node_modules/esbuild": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.0.tgz", + "integrity": "sha512-jd0f4NHbD6cALCyGElNpGAOtWxSq46l9X/sWB0Nzd5er4Kz2YTm+Vl0qKFT9KUJvD8+fiO8AvoHhFvEatfVixA==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.27.0", + "@esbuild/android-arm": "0.27.0", + "@esbuild/android-arm64": "0.27.0", + "@esbuild/android-x64": "0.27.0", + "@esbuild/darwin-arm64": "0.27.0", + "@esbuild/darwin-x64": "0.27.0", + "@esbuild/freebsd-arm64": "0.27.0", + "@esbuild/freebsd-x64": "0.27.0", + "@esbuild/linux-arm": "0.27.0", + "@esbuild/linux-arm64": "0.27.0", + "@esbuild/linux-ia32": "0.27.0", + "@esbuild/linux-loong64": "0.27.0", + "@esbuild/linux-mips64el": "0.27.0", + "@esbuild/linux-ppc64": "0.27.0", + "@esbuild/linux-riscv64": "0.27.0", + "@esbuild/linux-s390x": "0.27.0", + "@esbuild/linux-x64": "0.27.0", + "@esbuild/netbsd-arm64": "0.27.0", + "@esbuild/netbsd-x64": "0.27.0", + "@esbuild/openbsd-arm64": "0.27.0", + "@esbuild/openbsd-x64": "0.27.0", + "@esbuild/openharmony-arm64": "0.27.0", + "@esbuild/sunos-x64": "0.27.0", + "@esbuild/win32-arm64": "0.27.0", + "@esbuild/win32-ia32": "0.27.0", + "@esbuild/win32-x64": "0.27.0" + } + }, + "node_modules/eventsource-parser": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/eventsource-parser/-/eventsource-parser-3.0.6.tgz", + "integrity": "sha512-Vo1ab+QXPzZ4tCa8SwIHJFaSzy4R6SHf7BY79rFBDf0idraZWAkYrDjDj8uWaSm3S2TK+hJ7/t1CEmZ7jXw+pg==", + "license": "MIT", + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/fast-xml-parser": { + "version": "5.2.5", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.2.5.tgz", + "integrity": "sha512-pfX9uG9Ki0yekDHx2SiuRIyFdyAr1kMIMitPvb0YBo8SUfKvia7w7FIyd/l6av85pFYRhZscS75MwMnbvY+hcQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ], + "license": "MIT", + "dependencies": { + "strnum": "^2.1.0" + }, + "bin": { + "fxparser": "src/cli/cli.js" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/get-tsconfig": { + "version": "4.13.0", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.13.0.tgz", + "integrity": "sha512-1VKTZJCwBrvbd+Wn3AOgQP/2Av+TfTCOlE4AcRJE72W1ksZXbAx8PPBR9RzgTeSPzlPMHrbANMH3LbltH73wxQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, + "node_modules/gpt-tokenizer": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/gpt-tokenizer/-/gpt-tokenizer-3.4.0.tgz", + "integrity": "sha512-wxFLnhIXTDjYebd9A9pGl3e31ZpSypbpIJSOswbgop5jLte/AsZVDvjlbEuVFlsqZixVKqbcoNmRlFDf6pz/UQ==", + "license": "MIT" + }, + "node_modules/hono": { + "version": "4.10.7", + "resolved": "https://registry.npmjs.org/hono/-/hono-4.10.7.tgz", + "integrity": "sha512-icXIITfw/07Q88nLSkB9aiUrd8rYzSweK681Kjo/TSggaGbOX4RRyxxm71v+3PC8C/j+4rlxGeoTRxQDkaJkUw==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=16.9.0" + } + }, + "node_modules/jose": { + "version": "5.9.6", + "resolved": "https://registry.npmjs.org/jose/-/jose-5.9.6.tgz", + "integrity": "sha512-AMlnetc9+CV9asI19zHmrgS/WYsWUwCn2R7RzlbJWD7F9eWYUTGyBmU9o6PxngtLGOiDGPRu+Uc4fhKzbpteZQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/panva" + } + }, + "node_modules/json-schema": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", + "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", + "license": "(AFL-2.1 OR BSD-3-Clause)" + }, + "node_modules/jsonc-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.3.1.tgz", + "integrity": "sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==", + "license": "MIT" + }, + "node_modules/opencode-anthropic-auth": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/opencode-anthropic-auth/-/opencode-anthropic-auth-0.0.2.tgz", + "integrity": "sha512-m8dcEKtq2ExGLV7n4BMr1H5UimDaABV6aG82IDMcp1xmXUaO1K20/hess0s8cwvv6MFmJk4//2wbWZkzoOtirA==", + "dependencies": { + "@openauthjs/openauth": "^0.4.3" + } + }, + "node_modules/opencode-copilot-auth": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/opencode-copilot-auth/-/opencode-copilot-auth-0.0.5.tgz", + "integrity": "sha512-aOna2jy3BnaEpVJkeF32joUzI8DcpbBMWjd7zW6sgX4t58AnxaEB5sDadLsxRfcxJdhmABd5k6QSww5LcJ4e9Q==" + }, + "node_modules/opencode-gemini-auth": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/opencode-gemini-auth/-/opencode-gemini-auth-1.1.6.tgz", + "integrity": "sha512-7WxOEwYMqXeCD2jf/Wj+8yBS3qwnRxHKt/sWhn2ZBDgz+dVwrC/SpTNvpva1fF8KSgVVG8tS9yvDQXM0JcVGoQ==", + "license": "MIT", + "dependencies": { + "@openauthjs/openauth": "^0.4.3" + }, + "peerDependencies": { + "typescript": "^5" + } + }, + "node_modules/prettier": { + "version": "3.7.4", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.7.4.tgz", + "integrity": "sha512-v6UNi1+3hSlVvv8fSaoUbggEM5VErKmmpGA7Pl3HF8V6uKY7rvClBOJlH6yNwQtfTueNkGVpOv/mtWL9L4bgRA==", + "dev": true, + "license": "MIT", + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/remeda": { + "version": "2.32.0", + "resolved": "https://registry.npmjs.org/remeda/-/remeda-2.32.0.tgz", + "integrity": "sha512-BZx9DsT4FAgXDTOdgJIc5eY6ECIXMwtlSPQoPglF20ycSWigttDDe88AozEsPPT4OWk5NujroGSBC1phw5uU+w==", + "license": "MIT", + "dependencies": { + "type-fest": "^4.41.0" + } + }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, + "node_modules/strnum": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/strnum/-/strnum-2.1.1.tgz", + "integrity": "sha512-7ZvoFTiCnGxBtDqJ//Cu6fWtZtc7Y3x+QOirG15wztbdngGSkht27o2pyGWrVy0b4WAy3jbKmnoK6g5VlVNUUw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ], + "license": "MIT" + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" + }, + "node_modules/tsx": { + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.21.0.tgz", + "integrity": "sha512-5C1sg4USs1lfG0GFb2RLXsdpXqBSEhAaA/0kPL01wxzpMqLILNxIxIOKiILz+cdg/pLnOUxFYOR5yhHU666wbw==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "~0.27.0", + "get-tsconfig": "^4.7.5" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, + "node_modules/type-fest": { + "version": "4.41.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", + "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==", + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", + "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", + "dev": true, + "license": "MIT" + }, + "node_modules/xdg-basedir": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-5.1.0.tgz", + "integrity": "sha512-GCPAHLvrIH13+c0SuacwvRYj2SxJXQ4kaVTT5xgL3kPrz56XxkF21IGhjSE1+W0aw7gpBWRGXLCPnPby6lSpmQ==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/zod": { + "version": "4.1.13", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.1.13.tgz", + "integrity": "sha512-AvvthqfqrAhNH9dnfmrfKzX5upOdjUVJYFqNSlkmGf64gRaTzlPwz99IHYnVs28qYAybvAlBV+H7pn0saFY4Ig==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } } - ], - "license": "MIT" - }, - "node_modules/tslib": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", - "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "license": "0BSD" - }, - "node_modules/tsx": { - "version": "4.21.0", - "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.21.0.tgz", - "integrity": "sha512-5C1sg4USs1lfG0GFb2RLXsdpXqBSEhAaA/0kPL01wxzpMqLILNxIxIOKiILz+cdg/pLnOUxFYOR5yhHU666wbw==", - "dev": true, - "license": "MIT", - "dependencies": { - "esbuild": "~0.27.0", - "get-tsconfig": "^4.7.5" - }, - "bin": { - "tsx": "dist/cli.mjs" - }, - "engines": { - "node": ">=18.0.0" - }, - "optionalDependencies": { - "fsevents": "~2.3.3" - } - }, - "node_modules/type-fest": { - "version": "4.41.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", - "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==", - "license": "(MIT OR CC0-1.0)", - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/typescript": { - "version": "5.9.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", - "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", - "license": "Apache-2.0", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, - "node_modules/undici-types": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", - "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", - "dev": true, - "license": "MIT" - }, - "node_modules/xdg-basedir": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-5.1.0.tgz", - "integrity": "sha512-GCPAHLvrIH13+c0SuacwvRYj2SxJXQ4kaVTT5xgL3kPrz56XxkF21IGhjSE1+W0aw7gpBWRGXLCPnPby6lSpmQ==", - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/zod": { - "version": "4.1.13", - "resolved": "https://registry.npmjs.org/zod/-/zod-4.1.13.tgz", - "integrity": "sha512-AvvthqfqrAhNH9dnfmrfKzX5upOdjUVJYFqNSlkmGf64gRaTzlPwz99IHYnVs28qYAybvAlBV+H7pn0saFY4Ig==", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/colinhacks" - } } - } } diff --git a/package.json b/package.json index 3732f49..1588399 100644 --- a/package.json +++ b/package.json @@ -1,60 +1,63 @@ { - "$schema": "https://json.schemastore.org/package.json", - "name": "@tarquinen/opencode-dcp", - "version": "1.0.4", - "type": "module", - "description": "OpenCode plugin that optimizes token usage by pruning obsolete tool outputs from conversation context", - "main": "./dist/index.js", - "types": "./dist/index.d.ts", - "scripts": { - "clean": "rm -rf dist", - "build": "npm run clean && tsc && cp -r lib/prompts dist/lib/prompts", - "postbuild": "rm -rf dist/logs", - "prepublishOnly": "npm run build", - "dev": "opencode plugin dev", - "typecheck": "tsc --noEmit", - "test": "node --import tsx --test tests/*.test.ts" - }, - "keywords": [ - "opencode", - "opencode-plugin", - "plugin", - "context", - "pruning", - "optimization", - "tokens" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/Tarquinen/opencode-dynamic-context-pruning.git" - }, - "bugs": { - "url": "https://github.com/Tarquinen/opencode-dynamic-context-pruning/issues" - }, - "homepage": "https://github.com/Tarquinen/opencode-dynamic-context-pruning#readme", - "author": "tarquinen", - "license": "MIT", - "peerDependencies": { - "@opencode-ai/plugin": ">=0.13.7" - }, - "dependencies": { - "@ai-sdk/openai-compatible": "^1.0.28", - "@opencode-ai/sdk": "latest", - "@tarquinen/opencode-auth-provider": "^0.1.7", - "ai": "^5.0.106", - "gpt-tokenizer": "^3.4.0", - "jsonc-parser": "^3.3.1", - "zod": "^4.1.13" - }, - "devDependencies": { - "@opencode-ai/plugin": "^1.0.143", - "@types/node": "^24.10.1", - "tsx": "^4.21.0", - "typescript": "^5.9.3" - }, - "files": [ - "dist/", - "README.md", - "LICENSE" - ] + "$schema": "https://json.schemastore.org/package.json", + "name": "@tarquinen/opencode-dcp", + "version": "1.1.1-beta.1", + "type": "module", + "description": "OpenCode plugin that optimizes token usage by pruning obsolete tool outputs from conversation context", + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "scripts": { + "clean": "rm -rf dist", + "build": "npm run clean && tsc && cp -r lib/prompts dist/lib/prompts", + "postbuild": "rm -rf dist/logs", + "prepublishOnly": "npm run build", + "dev": "opencode plugin dev", + "typecheck": "tsc --noEmit", + "test": "node --import tsx --test tests/*.test.ts", + "format": "prettier --write .", + "format:check": "prettier --check ." + }, + "keywords": [ + "opencode", + "opencode-plugin", + "plugin", + "context", + "pruning", + "optimization", + "tokens" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/Tarquinen/opencode-dynamic-context-pruning.git" + }, + "bugs": { + "url": "https://github.com/Tarquinen/opencode-dynamic-context-pruning/issues" + }, + "homepage": "https://github.com/Tarquinen/opencode-dynamic-context-pruning#readme", + "author": "tarquinen", + "license": "MIT", + "peerDependencies": { + "@opencode-ai/plugin": ">=0.13.7" + }, + "dependencies": { + "@ai-sdk/openai-compatible": "^1.0.28", + "@opencode-ai/sdk": "latest", + "@tarquinen/opencode-auth-provider": "^0.1.7", + "ai": "^5.0.106", + "gpt-tokenizer": "^3.4.0", + "jsonc-parser": "^3.3.1", + "zod": "^4.1.13" + }, + "devDependencies": { + "@opencode-ai/plugin": "^1.0.143", + "@types/node": "^24.10.1", + "prettier": "^3.4.2", + "tsx": "^4.21.0", + "typescript": "^5.9.3" + }, + "files": [ + "dist/", + "README.md", + "LICENSE" + ] } diff --git a/tsconfig.json b/tsconfig.json index e4fdca1..b30286c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,31 +1,24 @@ { - "$schema": "https://json.schemastore.org/tsconfig", - "compilerOptions": { - "target": "ES2022", - "module": "ESNext", - "lib": ["ES2022"], - "moduleResolution": "bundler", - "resolveJsonModule": true, - "allowJs": true, - "checkJs": false, - "outDir": "./dist", - "rootDir": ".", - "strict": true, - "esModuleInterop": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true, - "declaration": true, - "declarationMap": true, - "sourceMap": true, - "types": ["node"] - }, - "include": [ - "index.ts", - "lib/**/*" - ], - "exclude": [ - "node_modules", - "dist", - "logs" - ] + "$schema": "https://json.schemastore.org/tsconfig", + "compilerOptions": { + "target": "ES2022", + "module": "ESNext", + "lib": ["ES2022"], + "moduleResolution": "bundler", + "resolveJsonModule": true, + "allowJs": true, + "checkJs": false, + "outDir": "./dist", + "rootDir": ".", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "declaration": true, + "declarationMap": true, + "sourceMap": true, + "types": ["node"] + }, + "include": ["index.ts", "lib/**/*"], + "exclude": ["node_modules", "dist", "logs"] }