chore: 初始提交

This commit is contained in:
2026-01-12 12:16:02 +08:00
commit 98dddd6de2
9 changed files with 273 additions and 0 deletions

4
.env.example Normal file
View File

@@ -0,0 +1,4 @@
CPA_API_KEY=
# if using Windows
OPENCODE_GIT_BASH_PATH=C:\Users\imbytecat\scoop\apps\git\current\bin\bash.exe

6
.gitignore vendored Normal file
View File

@@ -0,0 +1,6 @@
node_modules
package.json
bun.lock
.DS_Store
Thumbs.db

16
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,16 @@
{
"editor.codeActionsOnSave": {
"source.fixAll.biome": "explicit",
"source.organizeImports.biome": "explicit"
},
"editor.formatOnSave": true,
"[json]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[jsonc]": {
"editor.defaultFormatter": "biomejs.biome"
},
"files.associations": {
"**/opencode.json": "jsonc"
}
}

36
biome.json Normal file
View File

@@ -0,0 +1,36 @@
{
"$schema": "https://biomejs.dev/schemas/latest/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"files": {
"ignoreUnknown": false
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"javascript": {
"formatter": {
"quoteStyle": "single",
"semicolons": "asNeeded"
}
},
"assist": {
"enabled": true,
"actions": {
"source": {
"organizeImports": "on"
}
}
}
}

55
dcp.jsonc Normal file
View File

@@ -0,0 +1,55 @@
{
// 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 <turns> 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 <nudgeFrequency> 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": {
"enabled": true,
// Additional tools to protect from pruning
"protectedTools": []
},
// Prune write tool inputs when the file has been subsequently read
"supersedeWrites": {
"enabled": false
},
// Prune tool inputs for errored tools after X turns
"purgeErrors": {
"enabled": true,
// Number of turns before errored tool inputs are pruned
"turns": 4,
// Additional tools to protect from pruning
"protectedTools": []
}
}
}

77
opencode.json Normal file
View File

@@ -0,0 +1,77 @@
{
"$schema": "https://opencode.ai/config.json",
"autoupdate": "notify",
"theme": "tokyonight",
"model": "ai-gateway/claude-opus-4-5-thinking",
"small_model": "ai-gateway/gemini-3-flash-preview",
"plugin": [
"@tarquinen/opencode-dcp@latest",
"@franlol/opencode-md-table-formatter@latest"
],
"mcp": {
"websearch": {
"type": "remote",
"url": "https://mcp.exa.ai/mcp?tools=web_search_exa"
},
"context7": {
"type": "remote",
"url": "https://mcp.context7.com/mcp"
},
"grep_app": {
"type": "remote",
"url": "https://mcp.grep.app"
}
},
"permission": {
"websearch": "deny"
},
"provider": {
"ai-gateway": {
"name": "AI Gateway",
"npm": "@ai-sdk/anthropic",
"options": {
"baseURL": "http://10.0.1.1:8317/v1",
"apiKey": "{env:CPA_API_KEY}"
},
"models": {
"claude-opus-4-5-thinking": {
"name": "Claude Opus 4.5 (Thinking)"
},
"claude-sonnet-4-5-thinking": {
"name": "Claude Sonnet 4.5 (Thinking)"
},
"claude-sonnet-4-5": {
"name": "Claude Sonnet 4.5"
},
"claude-haiku-4-5": {
"name": "Claude Haiku 4.5"
},
"gemini-3-pro-preview": {
"name": "Gemini 3 Pro"
},
"gemini-3-flash-preview": {
"name": "Gemini 3 Flash"
},
"gpt-5.2-codex": {
"name": "GPT-5.2-Codex"
},
"gpt-5.2": {
"name": "GPT-5.2"
}
}
},
"GLM Coding": {
"name": "Z.AI",
"npm": "@ai-sdk/openai-compatible",
"options": {
"baseURL": "https://api.z.ai/api/coding/paas/v4",
"apiKey": "{env:ZAI_API_KEY}"
},
"models": {
"glm-4.7": {
"name": "GLM-4.7"
}
}
}
}
}

0
skill/.gitkeep Normal file
View File

21
snippet/mcp.jsonc Normal file
View File

@@ -0,0 +1,21 @@
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"context7": {
"type": "remote",
"url": "https://mcp.context7.com/mcp"
},
"deepwiki": {
"type": "remote",
"url": "https://mcp.deepwiki.com/mcp"
},
"sequential-thinking": {
"type": "local",
"command": ["bunx", "@modelcontextprotocol/server-sequential-thinking"]
},
"memory": {
"type": "local",
"command": ["bunx", "@modelcontextprotocol/server-memory"]
}
}
}

58
snippet/provider.jsonc Normal file
View File

@@ -0,0 +1,58 @@
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"cli-proxy-api": {
"name": "CLI Proxy API",
"npm": "@ai-sdk/anthropic",
"options": {
// "baseURL": "https://cpa.services.sh.cn:8443/v1",
"baseURL": "http://10.0.1.1:8317/v1",
"apiKey": "{env:CPA_API_KEY}"
},
"models": {
// Claude
"claude-opus-4-5-thinking": {
"name": "Claude Opus 4.5 (Thinking)"
},
"claude-sonnet-4-5-thinking": {
"name": "Claude Sonnet 4.5 (Thinking)"
},
"claude-sonnet-4-5": {
"name": "Claude Sonnet 4.5"
},
"claude-haiku-4-5": {
"name": "Claude Haiku 4.5"
},
// Gemini
"gemini-3-pro-preview": {
"name": "Gemini 3 Pro"
},
"gemini-3-flash-preview": {
"name": "Gemini 3 Flash"
},
// GPT
"gpt-5.2-codex": {
"name": "GPT-5.2-Codex"
},
"gpt-5.2": {
"name": "GPT-5.2"
}
}
},
"GLM Coding": {
"name": "Z.AI",
"npm": "@ai-sdk/openai-compatible",
"options": {
"baseURL": "https://api.z.ai/api/coding/paas/v4",
"apiKey": "{env:ZAI_API_KEY}"
},
"models": {
"glm-4.7": {
"name": "GLM-4.7"
}
}
}
}
}