@wwkit/freetoken 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +96 -0
- package/cli/helpers/args.js +48 -0
- package/cli/index.js +374 -0
- package/cli/pid-manager.js +87 -0
- package/client/index.html +25 -0
- package/client/public/favicon.svg +1 -0
- package/client/public/icons.svg +24 -0
- package/client/src/App.vue +136 -0
- package/client/src/assets/vite.svg +1 -0
- package/client/src/assets/vue.svg +1 -0
- package/client/src/components/ChatBox.vue +320 -0
- package/client/src/components/CheckList.vue +52 -0
- package/client/src/components/CodeBlock.vue +99 -0
- package/client/src/components/DetailBlock.vue +47 -0
- package/client/src/components/HelloWorld.vue +95 -0
- package/client/src/components/LangSwitch.vue +32 -0
- package/client/src/components/LinkList.vue +32 -0
- package/client/src/components/OsSwitch.vue +42 -0
- package/client/src/components/OsToggle.vue +15 -0
- package/client/src/components/PageHeader.vue +31 -0
- package/client/src/components/StepList.vue +92 -0
- package/client/src/composables/useClipboard.js +26 -0
- package/client/src/composables/useOs.js +22 -0
- package/client/src/data/docs/agent.js +1002 -0
- package/client/src/data/docs/auth.js +631 -0
- package/client/src/data/docs/builtin-tools.js +322 -0
- package/client/src/data/docs/chat.js +181 -0
- package/client/src/data/docs/index.js +9 -0
- package/client/src/data/docs/skills.js +396 -0
- package/client/src/data/docs/spec-conversion.js +1042 -0
- package/client/src/data/freeModels/bluesliu.js +97 -0
- package/client/src/data/freeModels/index.js +11 -0
- package/client/src/data/freeModels/nvidia.js +126 -0
- package/client/src/data/freeModels/openrouter.js +116 -0
- package/client/src/data/harness/claude.js +89 -0
- package/client/src/data/harness/codex.js +66 -0
- package/client/src/data/harness/dsh.js +86 -0
- package/client/src/data/harness/hermes.js +56 -0
- package/client/src/data/harness/index.js +22 -0
- package/client/src/data/harness/opencode.js +77 -0
- package/client/src/data/proxy/api-relay.js +53 -0
- package/client/src/data/proxy/builtin-proxy.js +54 -0
- package/client/src/data/proxy/cf-workers.js +67 -0
- package/client/src/data/proxy/ecs-forward.js +75 -0
- package/client/src/data/proxy/ecs-reverse.js +89 -0
- package/client/src/data/proxy/index.js +15 -0
- package/client/src/docs/claudecode.md +44 -0
- package/client/src/docs/codex.md +90 -0
- package/client/src/docs/hermesagent.md +42 -0
- package/client/src/docs/opencode.md +103 -0
- package/client/src/locales/en.js +436 -0
- package/client/src/locales/index.js +31 -0
- package/client/src/locales/zh-CN.js +461 -0
- package/client/src/main.js +16 -0
- package/client/src/router/index.js +76 -0
- package/client/src/style.css +15 -0
- package/client/src/views/AdminModelsView.vue +214 -0
- package/client/src/views/DocsView.vue +1604 -0
- package/client/src/views/FreeModelsView.vue +518 -0
- package/client/src/views/HarnessView.vue +314 -0
- package/client/src/views/HomeView.vue +147 -0
- package/client/src/views/ProxyView.vue +112 -0
- package/client/src/views/TokenMarketView.vue +26 -0
- package/client/vite.config.js +41 -0
- package/package.json +85 -0
- package/scripts/build-zip.sh +61 -0
- package/scripts/postinstall.js +7 -0
- package/server/src/config/targets.json +1 -0
- package/server/src/index.js +52 -0
- package/server/src/lib/coding-test.js +215 -0
- package/server/src/lib/database.js +353 -0
- package/server/src/lib/run-test.js +15 -0
- package/server/src/lib/scheduler.js +21 -0
- package/server/src/lib/tester.js +310 -0
- package/server/src/routes/admin.js +48 -0
- package/server/src/routes/proxy.js +64 -0
- package/server/src/routes/speed.js +87 -0
- package/src/config.js +45 -0
- package/src/config.json5 +27 -0
- package/src/index.js +10 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
OpenCode
|
|
2
|
+
|
|
3
|
+
复制本文
|
|
4
|
+
|
|
5
|
+
在 OpenCode 中使用千问AI平台模型
|
|
6
|
+
|
|
7
|
+
OpenCode 是一款终端 AI 编程工具,可以通过按量计费、Token Plan 个人版或 Token Plan 团队版接入千问AI平台。
|
|
8
|
+
|
|
9
|
+
安装 OpenCode
|
|
10
|
+
安装 Node.js(v18.0 或更高版本)。
|
|
11
|
+
在终端中执行以下命令安装 OpenCode:
|
|
12
|
+
npm install -g opencode-ai
|
|
13
|
+
运行以下命令验证安装。若有版本号输出,则表示安装成功。
|
|
14
|
+
opencode -v
|
|
15
|
+
|
|
16
|
+
配置接入凭证
|
|
17
|
+
使用文本编辑器打开:
|
|
18
|
+
macOS / Linux:~/.config/opencode/opencode.json
|
|
19
|
+
Windows:C:\Users\<用户名>\.config\opencode\opencode.json
|
|
20
|
+
将 YOUR_API_KEY 替换为 Token Plan 个人版专属 API Key。可用模型请参考 Token Plan 个人版支持的模型。
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
{
|
|
24
|
+
"$schema": "https://opencode.ai/config.json",
|
|
25
|
+
"provider": {
|
|
26
|
+
"bailian-token-plan-personal": {
|
|
27
|
+
"npm": "@ai-sdk/anthropic",
|
|
28
|
+
"name": "Alibaba Cloud Model Studio",
|
|
29
|
+
"options": {
|
|
30
|
+
"baseURL": "https://token-plan.cn-beijing.maas.aliyuncs.com/apps/anthropic/v1",
|
|
31
|
+
"apiKey": "YOUR_API_KEY"
|
|
32
|
+
},
|
|
33
|
+
"models": {
|
|
34
|
+
"qwen3.8-max": {
|
|
35
|
+
"name": "Qwen3.8 Max",
|
|
36
|
+
"reasoning": true,
|
|
37
|
+
"limit": {
|
|
38
|
+
"context": 983616,
|
|
39
|
+
"output": 131072
|
|
40
|
+
},
|
|
41
|
+
"modalities": {
|
|
42
|
+
"input": ["text", "image"],
|
|
43
|
+
"output": ["text"]
|
|
44
|
+
},
|
|
45
|
+
"options": {
|
|
46
|
+
"effort": "xhigh"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"qwen3.7-max": {
|
|
50
|
+
"name": "Qwen3.7 Max",
|
|
51
|
+
"options": {
|
|
52
|
+
"thinking": {
|
|
53
|
+
"type": "enabled",
|
|
54
|
+
"budgetTokens": 8192
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"qwen3.7-plus": {
|
|
59
|
+
"name": "Qwen3.7 Plus",
|
|
60
|
+
"modalities": {
|
|
61
|
+
"input": ["text", "image"],
|
|
62
|
+
"output": ["text"]
|
|
63
|
+
},
|
|
64
|
+
"options": {
|
|
65
|
+
"thinking": {
|
|
66
|
+
"type": "enabled",
|
|
67
|
+
"budgetTokens": 8192
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"qwen3.6-plus": {
|
|
72
|
+
"name": "Qwen3.6 Plus",
|
|
73
|
+
"modalities": {
|
|
74
|
+
"input": ["text", "image"],
|
|
75
|
+
"output": ["text"]
|
|
76
|
+
},
|
|
77
|
+
"options": {
|
|
78
|
+
"thinking": {
|
|
79
|
+
"type": "enabled",
|
|
80
|
+
"budgetTokens": 8192
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"qwen3.6-flash": {
|
|
85
|
+
"name": "Qwen3.6 Flash",
|
|
86
|
+
"modalities": {
|
|
87
|
+
"input": ["text", "image"],
|
|
88
|
+
"output": ["text"]
|
|
89
|
+
},
|
|
90
|
+
"options": {
|
|
91
|
+
"thinking": {
|
|
92
|
+
"type": "enabled",
|
|
93
|
+
"budgetTokens": 8192
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
o验证配置
|
|
102
|
+
保存配置后,重启 OpenCode,输入 /models,搜索 Alibaba Cloud Model Studio,选择需要使用的模型即可开始对话
|
|
103
|
+
|
|
@@ -0,0 +1,436 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
nav: {
|
|
3
|
+
home: 'Home',
|
|
4
|
+
harness: 'Harness',
|
|
5
|
+
freeModels: 'Free Models',
|
|
6
|
+
proxy: 'Proxy',
|
|
7
|
+
tokenMarket: 'Token Market',
|
|
8
|
+
docs: 'Docs',
|
|
9
|
+
},
|
|
10
|
+
footer: {
|
|
11
|
+
tagline: 'AI Harness Learning Hub — Master AI programming tools quickly',
|
|
12
|
+
note: 'Content on this site is for learning purposes only. Please comply with the terms of use of each tool and model.',
|
|
13
|
+
},
|
|
14
|
+
home: {
|
|
15
|
+
heroTitle: 'FreeToken',
|
|
16
|
+
heroSubtitle: 'One-stop learning for AI programming tools — from installation to model integration, from free resources to proxy solutions',
|
|
17
|
+
startLearning: 'Start Learning',
|
|
18
|
+
freeModelsBtn: 'Free Models',
|
|
19
|
+
sectionsTitle: 'Learning Sections',
|
|
20
|
+
cardEnter: 'Explore',
|
|
21
|
+
whatIsHarness: 'What is AI Harness?',
|
|
22
|
+
introP1: 'AI Harness (AI programming toolchain) refers to a collection of tools that help developers leverage Large Language Models (LLMs) for software development. They typically exist as command-line tools (CLI) or IDE plugins, capable of understanding code context, generating code, fixing bugs, running tests, and even completing full development tasks.',
|
|
23
|
+
introP2: 'Common AI Harness tools include DeepSeek Harness (official DeepSeek), OpenCode (open-source CLI), Codex CLI (official OpenAI), Claude Code (official Anthropic), and more. They can connect to various models like DeepSeek, GPT, and Claude to help developers improve programming efficiency.',
|
|
24
|
+
introP3: 'This site focuses on three core topics: Harness tool introductions, free model acquisition, and domestic proxy solutions. Whether you are a beginner or an experienced developer, you can find practical information here.',
|
|
25
|
+
sections: {
|
|
26
|
+
harness: {
|
|
27
|
+
title: 'Harness',
|
|
28
|
+
desc: 'Learn about DeepSeek Harness, OpenCode, Codex CLI, and Claude Code — four AI programming harness tools, including basic info, installation, and configuration.',
|
|
29
|
+
},
|
|
30
|
+
freeModels: {
|
|
31
|
+
title: 'Free Models',
|
|
32
|
+
desc: 'Get free LLM APIs from OpenRouter and Nvidia NIM. Learn registration and usage methods to start AI programming at zero cost.',
|
|
33
|
+
},
|
|
34
|
+
proxy: {
|
|
35
|
+
title: 'Proxy',
|
|
36
|
+
desc: 'Stably use GPT and Claude models in China. Covers API relay, built-in proxy, Cloudflare Workers self-hosted relay, and more solutions.',
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
harness: {
|
|
41
|
+
pageTitle: 'Harness Tools',
|
|
42
|
+
pageDesc: 'Basic info, installation, and configuration for DeepSeek Harness, OpenCode, Codex CLI, and Claude Code — four AI programming harness tools.',
|
|
43
|
+
install: 'Install',
|
|
44
|
+
config: 'Config',
|
|
45
|
+
develop: 'Develop',
|
|
46
|
+
requirements: 'Requirements',
|
|
47
|
+
startup: 'Startup',
|
|
48
|
+
nodeRequirement: 'Node.js Version Requirement',
|
|
49
|
+
envRequirement: 'Environment Variables',
|
|
50
|
+
envVarDesc: 'bluesliusharing',
|
|
51
|
+
startupCommand: 'Startup Command',
|
|
52
|
+
modelConfig: 'Model Configuration',
|
|
53
|
+
configTips: 'Configuration Tips',
|
|
54
|
+
modelSwitch: 'Switch Model',
|
|
55
|
+
sessionOperations: 'Session Operations',
|
|
56
|
+
sessionManagement: 'Session Management',
|
|
57
|
+
sessionExport: 'Export Session',
|
|
58
|
+
sessionImport: 'Import Session',
|
|
59
|
+
copyCommand: 'Copy Command',
|
|
60
|
+
curlInstall: 'curl Install',
|
|
61
|
+
npmInstall: 'npm Install',
|
|
62
|
+
gitInstall: 'Git Clone',
|
|
63
|
+
npmMirrorPlaceholder: 'npm mirror',
|
|
64
|
+
relatedLinks: 'Related Links',
|
|
65
|
+
mirrors: {
|
|
66
|
+
official: 'Official',
|
|
67
|
+
taobao: 'Taobao Mirror',
|
|
68
|
+
huawei: 'Huawei Mirror',
|
|
69
|
+
},
|
|
70
|
+
tools: {
|
|
71
|
+
dsh: {
|
|
72
|
+
name: 'DeepSeek Harness',
|
|
73
|
+
tagline: 'Official DeepSeek AI programming assistant',
|
|
74
|
+
description: 'A command-line AI programming assistant officially launched by DeepSeek, open-source, with native support for DeepSeek model series. Core feature: Everything is a plugin — all capability modules are replaceable.',
|
|
75
|
+
links: ['DeepSeek Official', 'GitHub', 'Documentation'],
|
|
76
|
+
badge: 'Open Source',
|
|
77
|
+
},
|
|
78
|
+
opencode: {
|
|
79
|
+
name: 'OpenCode',
|
|
80
|
+
tagline: 'Open-source AI terminal programming assistant',
|
|
81
|
+
description: 'A community-driven open-source interactive CLI programming assistant, supporting Agent / Skill / Command three-tier extension architecture and MCP tool integration.',
|
|
82
|
+
links: ['Official Docs', 'GitHub'],
|
|
83
|
+
badge: 'Open Source',
|
|
84
|
+
},
|
|
85
|
+
codex: {
|
|
86
|
+
name: 'Codex CLI',
|
|
87
|
+
tagline: 'Official OpenAI terminal programming assistant',
|
|
88
|
+
description: 'A command-line AI programming tool from OpenAI, open-source, providing code generation and modification capabilities based on GPT models, deeply integrated with the OpenAI ecosystem.',
|
|
89
|
+
links: ['Official Docs', 'GitHub'],
|
|
90
|
+
badge: 'Official',
|
|
91
|
+
},
|
|
92
|
+
claude: {
|
|
93
|
+
name: 'Claude Code',
|
|
94
|
+
tagline: 'Official Anthropic terminal AI assistant',
|
|
95
|
+
description: 'A command-line AI programming assistant from Anthropic, based on the Claude model series, featuring a 200K ultra-long context window, excelling at complex code reasoning and engineering tasks.',
|
|
96
|
+
links: ['Official Docs', 'GitHub'],
|
|
97
|
+
badge: 'Official',
|
|
98
|
+
},
|
|
99
|
+
hermes: {
|
|
100
|
+
name: 'Hermes Agent',
|
|
101
|
+
tagline: 'Open-source multimodal AI Agent',
|
|
102
|
+
description: 'Hermes Agent is an open-source multimodal AI Agent that supports multiple model backends, connecting to different LLM services through a unified configuration interface.',
|
|
103
|
+
links: ['GitHub'],
|
|
104
|
+
badge: 'Open Source',
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
freeModels: {
|
|
109
|
+
pageTitle: 'Free Models',
|
|
110
|
+
pageDesc: 'Free LLM API information from OpenRouter and Nvidia NIM, including available model lists, registration methods, and usage examples.',
|
|
111
|
+
modelList: 'Free Model List',
|
|
112
|
+
registration: 'Registration Steps',
|
|
113
|
+
usage: 'Usage Example',
|
|
114
|
+
usageCurl: 'curl Test',
|
|
115
|
+
usageConfig: 'OpenCode Config',
|
|
116
|
+
tips: 'Usage Tips',
|
|
117
|
+
relatedLinks: 'Related Links',
|
|
118
|
+
tableColumns: {
|
|
119
|
+
name: 'Model Name',
|
|
120
|
+
provider: 'Provider',
|
|
121
|
+
context: 'Context Window',
|
|
122
|
+
available: 'Available',
|
|
123
|
+
ttft: 'TTFT',
|
|
124
|
+
throughput: 'Throughput',
|
|
125
|
+
coding: 'Coding',
|
|
126
|
+
testedAt: 'Tested',
|
|
127
|
+
responseTime: 'Response Time',
|
|
128
|
+
status: 'Status',
|
|
129
|
+
note: 'Note',
|
|
130
|
+
},
|
|
131
|
+
providers: {
|
|
132
|
+
openrouter: {
|
|
133
|
+
name: 'OpenRouter',
|
|
134
|
+
tagline: 'Unified LLM API aggregation platform',
|
|
135
|
+
description: 'OpenRouter is a unified LLM API routing platform that aggregates models from OpenAI, Anthropic, Google, Meta, and other vendors. Some models offer free tiers, suitable for developer testing and learning.',
|
|
136
|
+
badge: 'Free Tier',
|
|
137
|
+
modelNotes: [
|
|
138
|
+
'Free, rate-limited',
|
|
139
|
+
'Free, rate-limited',
|
|
140
|
+
'Free, rate-limited',
|
|
141
|
+
'Free, rate-limited',
|
|
142
|
+
'Free, rate-limited',
|
|
143
|
+
],
|
|
144
|
+
registration: [
|
|
145
|
+
'Visit OpenRouter at https://openrouter.ai',
|
|
146
|
+
'Click Sign Up, login with GitHub or Google account',
|
|
147
|
+
'Go to the Keys page, click Create Key to generate an API Key',
|
|
148
|
+
'Save your API Key (format: sk-or-v1-xxxxx)',
|
|
149
|
+
'Free models are tagged with "Free" label and can be used directly',
|
|
150
|
+
],
|
|
151
|
+
tips: [
|
|
152
|
+
'Free models have rate limits (typically 10-20 requests/minute)',
|
|
153
|
+
'Some free models may not guarantee availability, keep several alternatives',
|
|
154
|
+
'Paid models are billed per token, prices are usually cheaper than official',
|
|
155
|
+
'OpenRouter supports OpenAI-compatible format, just replace baseURL',
|
|
156
|
+
],
|
|
157
|
+
links: ['Official Site', 'Free Model List', 'API Docs'],
|
|
158
|
+
},
|
|
159
|
+
nvidia: {
|
|
160
|
+
name: 'Nvidia NIM',
|
|
161
|
+
tagline: 'Free model inference service provided by Nvidia',
|
|
162
|
+
description: 'Nvidia provides free inference API endpoints for various open-source large models through the NIM (NVIDIA Inference Microservices) platform, including Llama, Mistral, Qwen, etc. Developers can obtain a free API Key after registration.',
|
|
163
|
+
badge: 'Free',
|
|
164
|
+
modelNotes: [
|
|
165
|
+
'Free',
|
|
166
|
+
'Free',
|
|
167
|
+
'Free',
|
|
168
|
+
'Free',
|
|
169
|
+
'Free',
|
|
170
|
+
'Embedding model, free',
|
|
171
|
+
],
|
|
172
|
+
registration: [
|
|
173
|
+
'Visit Nvidia developer platform at https://build.nvidia.com',
|
|
174
|
+
'Click Sign In, login with NVIDIA account (free to register)',
|
|
175
|
+
'Select the desired model, click "Get API Key"',
|
|
176
|
+
'The generated API Key format is: nvapi-xxxxx',
|
|
177
|
+
'Use OpenAI-compatible interface in your code',
|
|
178
|
+
],
|
|
179
|
+
tips: [
|
|
180
|
+
'Nvidia NIM has generous free quotas, suitable for learning and development testing',
|
|
181
|
+
'All models use OpenAI-compatible API format, low switching cost',
|
|
182
|
+
'Some large models (e.g., 405B) may have slower inference speed',
|
|
183
|
+
'NIM platform periodically adds new models, stay tuned for updates',
|
|
184
|
+
],
|
|
185
|
+
links: ['Nvidia NIM Official', 'API Docs', 'Model List'],
|
|
186
|
+
},
|
|
187
|
+
bluesliu: {
|
|
188
|
+
name: 'BluesLiu',
|
|
189
|
+
tagline: 'Site-provided free test model service',
|
|
190
|
+
description: 'BluesLiu is an internal test model service provided by this site, built on @ai-sdk/openai-compatible, aggregating models from MiniMax, Zhipu GLM, and more. No registration needed — use the shared API Key directly. Suitable for learning and quick testing.',
|
|
191
|
+
badge: 'Internal Test',
|
|
192
|
+
modelNotes: [
|
|
193
|
+
'General-purpose LLM by MiniMax',
|
|
194
|
+
'Aliyun CodeAgent model, excels at coding tasks',
|
|
195
|
+
'Zhipu GLM 5.1 model, strong general capability',
|
|
196
|
+
],
|
|
197
|
+
registration: [
|
|
198
|
+
'This service is site-provided, no registration needed',
|
|
199
|
+
'API Key is a shared secret: bluesliusharing',
|
|
200
|
+
'BaseURL: http://blues.huawei.com:32527/v1',
|
|
201
|
+
'Available models include MiniMax-M2.7, maas-glm-5-aliyun-codeagent, maas-glm-5.1-zhipu',
|
|
202
|
+
'Use OpenAI-compatible interface to call',
|
|
203
|
+
],
|
|
204
|
+
tips: [
|
|
205
|
+
'This service is for internal testing only, no long-term availability guarantee',
|
|
206
|
+
'Shared API Key, do not use in production',
|
|
207
|
+
'API address is intranet-only, requires Huawei intranet access',
|
|
208
|
+
'All models use OpenAI-compatible API format, low switching cost',
|
|
209
|
+
],
|
|
210
|
+
links: ['API Endpoint'],
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
proxy: {
|
|
215
|
+
pageTitle: 'Proxy Solutions',
|
|
216
|
+
pageDesc: 'Proxy configuration mechanisms work universally for all models, regardless of GPT or Claude. Categorized by proxy method: API relay, built-in proxy, Cloudflare Workers, ECS forward proxy, and ECS reverse proxy — five solutions in total.',
|
|
217
|
+
steps: 'Steps',
|
|
218
|
+
configExample: 'Configuration Example',
|
|
219
|
+
notes: 'Notes',
|
|
220
|
+
solutions: {
|
|
221
|
+
apiRelay: {
|
|
222
|
+
name: 'API Relay Service',
|
|
223
|
+
tagline: 'Forward requests via third-party relay platform',
|
|
224
|
+
description: 'Use third-party API relay services (e.g., API2D, OpenAI-SB, etc.) to forward requests to OpenAI or Anthropic. The relay platform provides a domestically accessible baseURL, with usage identical to the official API. Both GPT and Claude are supported.',
|
|
225
|
+
badge: 'Relay',
|
|
226
|
+
steps: [
|
|
227
|
+
'Register an account on the relay platform',
|
|
228
|
+
'Get the API Key assigned by the relay platform (usually sk-xxx or sk-ant-xxx format)',
|
|
229
|
+
'Confirm the target models supported by the platform (GPT / Claude / others)',
|
|
230
|
+
'Replace baseURL with the relay platform address in Harness, and apiKey with the relay Key',
|
|
231
|
+
'Keep model names consistent with official (e.g., gpt-4o, claude-sonnet-4-20250514)',
|
|
232
|
+
],
|
|
233
|
+
tips: [
|
|
234
|
+
'Relay services may have data security risks, choose a trusted platform',
|
|
235
|
+
'GPT baseURL must end with /v1, Claude baseURL must not end with /v1',
|
|
236
|
+
'Some relay platforms only support GPT or only Claude, confirm before registering',
|
|
237
|
+
'Recommended to prepare multiple solutions as backup',
|
|
238
|
+
],
|
|
239
|
+
},
|
|
240
|
+
builtinProxy: {
|
|
241
|
+
name: 'Harness Built-in Proxy',
|
|
242
|
+
tagline: 'Access via environment variables or baseURL configuration',
|
|
243
|
+
description: 'With an existing stable proxy channel (VPN / Clash / Shadowsocks, etc.), set HTTP proxy environment variables or specify baseURL directly in Harness config to route GPT and Claude requests through the proxy channel. No code modification needed, just configuration.',
|
|
244
|
+
badge: 'Built-in',
|
|
245
|
+
steps: [
|
|
246
|
+
'Ensure a usable proxy channel is available locally (VPN / Clash / SS, etc.)',
|
|
247
|
+
'Method 1: Set HTTPS_PROXY environment variable, all HTTP requests go through proxy (requires proxy to reach target API)',
|
|
248
|
+
'Method 2: Specify official baseURL directly in Harness config (proxy channel handles network reachability)',
|
|
249
|
+
'GPT and Claude use the same environment variables, no separate config needed',
|
|
250
|
+
'Verify proxy latency and stability to ensure good development experience',
|
|
251
|
+
],
|
|
252
|
+
tips: [
|
|
253
|
+
'This solution requires an existing proxy channel, whose stability determines the experience',
|
|
254
|
+
'Environment variable method is most universal, works with all Harness tools',
|
|
255
|
+
'Note the difference between HTTP proxy port (usually 7890/1087) and SOCKS5 port (usually 1080)',
|
|
256
|
+
'Set ALL_PROXY=socks5://127.0.0.1:1080 to route all terminal tools through SOCKS5 proxy',
|
|
257
|
+
],
|
|
258
|
+
},
|
|
259
|
+
cfWorkers: {
|
|
260
|
+
name: 'Cloudflare Workers Self-hosted Relay',
|
|
261
|
+
tagline: 'Build API forwarding service via CF Workers',
|
|
262
|
+
description: 'Build your own API relay service through Cloudflare Workers, with high stability and no dependency on third-party relay platforms. Requires a domain and Cloudflare account. GPT and Claude need separate Workers (different target hosts), but the mechanism is identical.',
|
|
263
|
+
badge: 'CF',
|
|
264
|
+
steps: [
|
|
265
|
+
'Register a Cloudflare account and add a domain',
|
|
266
|
+
'Create two Workers: one forwarding to api.openai.com, one to api.anthropic.com',
|
|
267
|
+
'Deploy Worker scripts',
|
|
268
|
+
'Configure custom domain routes (e.g., openai.your-domain.com and claude.your-domain.com)',
|
|
269
|
+
'Point baseURL to the corresponding Worker domain in Harness',
|
|
270
|
+
],
|
|
271
|
+
tips: [
|
|
272
|
+
'This solution is the most secure and reliable, you control all traffic forwarding',
|
|
273
|
+
'Requires some technical ability to deploy and configure Cloudflare',
|
|
274
|
+
'GPT and Claude Worker scripts are nearly identical, only target host differs',
|
|
275
|
+
'Cloudflare free tier allows 100,000 requests per day, sufficient for personal use',
|
|
276
|
+
],
|
|
277
|
+
},
|
|
278
|
+
ecsForward: {
|
|
279
|
+
name: 'ECS Forward Proxy',
|
|
280
|
+
tagline: 'Shadowsocks universal browser proxy',
|
|
281
|
+
description: 'Deploy Shadowsocks server on overseas Alibaba Cloud ECS, connect locally via SS client, and all traffic (browser, terminal, apps) is forwarded through ECS. This is a "forward proxy" where the client actively sends traffic to the proxy server. Both GPT and Claude can be accessed this way.',
|
|
282
|
+
badge: 'Forward',
|
|
283
|
+
steps: [
|
|
284
|
+
'Log in to Alibaba Cloud console, purchase ECS instance (Hong Kong/Singapore/US region recommended, 1 core 1G is sufficient)',
|
|
285
|
+
'Choose Ubuntu 22.04 or Debian 12 system image, record the public IP',
|
|
286
|
+
'Open TCP port 8388 in security group rules (Shadowsocks default port)',
|
|
287
|
+
'SSH into ECS, install Shadowsocks-libev',
|
|
288
|
+
'Edit config file /etc/shadowsocks/config.json',
|
|
289
|
+
'Start ss-server service and enable auto-start on boot',
|
|
290
|
+
'Install Shadowsocks client locally, fill in ECS public IP, port, password, and encryption method',
|
|
291
|
+
'Enable system proxy or PAC mode, browser can access external network through ECS',
|
|
292
|
+
],
|
|
293
|
+
tips: [
|
|
294
|
+
'Forward proxy is suitable for global bypassing, usable for both browser and terminal',
|
|
295
|
+
'All traffic goes through ECS forwarding, high bandwidth consumption',
|
|
296
|
+
'ECS region must be able to access target APIs (Hong Kong/Singapore/US West all work)',
|
|
297
|
+
'Can deploy both Shadowsocks and Nginx reverse proxy on the same ECS',
|
|
298
|
+
],
|
|
299
|
+
},
|
|
300
|
+
ecsReverse: {
|
|
301
|
+
name: 'ECS Reverse Proxy',
|
|
302
|
+
tagline: 'Nginx model API dedicated proxy',
|
|
303
|
+
description: 'Deploy Nginx reverse proxy on overseas Alibaba Cloud ECS to forward API requests to OpenAI / Anthropic. This is a "reverse proxy" where the client accesses the ECS address and Nginx forwards to the target API. Only proxies model API requests, lighter and lower latency, but cannot serve as a browser proxy. GPT and Claude can be configured with different location paths in the same Nginx.',
|
|
304
|
+
badge: 'Reverse',
|
|
305
|
+
steps: [
|
|
306
|
+
'Purchase Alibaba Cloud ECS instance (overseas region required, must be able to access OpenAI/Anthropic)',
|
|
307
|
+
'Install Nginx',
|
|
308
|
+
'Configure reverse proxy to forward /openai/ to api.openai.com and /anthropic/ to api.anthropic.com',
|
|
309
|
+
'Open ports 80 and 443 in Alibaba Cloud security group',
|
|
310
|
+
'(Optional) Configure domain and Let\'s Encrypt SSL certificate',
|
|
311
|
+
'Point baseURL to the ECS proxy address in Harness tools',
|
|
312
|
+
],
|
|
313
|
+
tips: [
|
|
314
|
+
'Reverse proxy only proxies API requests, lighter and lower latency, but cannot serve as browser proxy',
|
|
315
|
+
'GPT and Claude can share one Nginx, distinguished by different location paths',
|
|
316
|
+
'Recommended to configure HTTPS certificate to prevent API Key interception in transit',
|
|
317
|
+
'Choose ECS bandwidth of 5Mbps or above, model API responses are typically large',
|
|
318
|
+
'Note Alibaba Cloud pay-as-you-go traffic costs, overseas ECS traffic is slightly more expensive',
|
|
319
|
+
],
|
|
320
|
+
},
|
|
321
|
+
},
|
|
322
|
+
},
|
|
323
|
+
common: {
|
|
324
|
+
copy: 'Copy',
|
|
325
|
+
copied: 'Copied',
|
|
326
|
+
copiedToClipboard: 'Copied to clipboard',
|
|
327
|
+
copyFailed: 'Copy failed, please copy manually',
|
|
328
|
+
underConstruction: 'Under Construction',
|
|
329
|
+
},
|
|
330
|
+
docs: {
|
|
331
|
+
pageTitle: 'Docs',
|
|
332
|
+
pageDesc: 'Core LLM API knowledge — Chat Completions and Agent Tool Calling full workflow',
|
|
333
|
+
chat: {
|
|
334
|
+
tabLabel: 'Chat',
|
|
335
|
+
request: 'Request',
|
|
336
|
+
response: 'Response',
|
|
337
|
+
notes: 'Key Points',
|
|
338
|
+
paramName: 'Parameter',
|
|
339
|
+
paramType: 'Type',
|
|
340
|
+
paramRequired: 'Required',
|
|
341
|
+
paramDesc: 'Description',
|
|
342
|
+
yes: 'Yes',
|
|
343
|
+
no: 'No',
|
|
344
|
+
},
|
|
345
|
+
agent: {
|
|
346
|
+
tabLabel: 'Agent',
|
|
347
|
+
toolDefs: 'Tool Definitions',
|
|
348
|
+
scenario: 'Scenario',
|
|
349
|
+
execution: 'Execute',
|
|
350
|
+
output: 'Output',
|
|
351
|
+
summary: 'Loop Summary',
|
|
352
|
+
builtin: 'Built-in Tools',
|
|
353
|
+
builtinTitle: 'opencode Built-in Tool Full Descriptions',
|
|
354
|
+
builtinDesc: 'Below are the real description text and parameters JSON Schema for opencode agent built-in tools. Note that each tool description is far more than a single sentence — it includes usage scenarios, prohibition rules, parameter constraints, and behavioral guidelines. This is prompt engineering for the model.',
|
|
355
|
+
description: 'Description (Full Text)',
|
|
356
|
+
parameters: 'Parameters (JSON Schema)',
|
|
357
|
+
},
|
|
358
|
+
spec: {
|
|
359
|
+
tabLabel: 'Spec Conversion',
|
|
360
|
+
overview: 'Overview',
|
|
361
|
+
comparison: 'Comparison',
|
|
362
|
+
aspect: 'Aspect',
|
|
363
|
+
mappings: 'Mappings',
|
|
364
|
+
note: 'Note',
|
|
365
|
+
phase: 'Phase',
|
|
366
|
+
configExample: 'Config Example',
|
|
367
|
+
location: 'Location',
|
|
368
|
+
suggestedFix: 'Suggested Fix',
|
|
369
|
+
toolBridge: 'Protocol Bridge',
|
|
370
|
+
bridgeFlow: 'Bridge Flow',
|
|
371
|
+
formatName: 'Format',
|
|
372
|
+
pattern: 'Pattern',
|
|
373
|
+
gateway: 'OpenCode Gateway',
|
|
374
|
+
dsProxy: 'DeepSeek Reverse Proxy',
|
|
375
|
+
llmproxy: 'llmproxy Auth Proxy',
|
|
376
|
+
codeartsConv: 'CodeArts Conversion',
|
|
377
|
+
method: 'Method',
|
|
378
|
+
path: 'Path',
|
|
379
|
+
formatLabel: 'Format',
|
|
380
|
+
toolCalling: 'Tool Calling',
|
|
381
|
+
clientName: 'Client',
|
|
382
|
+
yes: 'Yes',
|
|
383
|
+
partial: 'Partial',
|
|
384
|
+
notPrimary: 'Not Primary',
|
|
385
|
+
endpointName: 'Endpoint',
|
|
386
|
+
used: 'Used By',
|
|
387
|
+
modelId: 'Model ID',
|
|
388
|
+
modelDisplay: 'Display Name',
|
|
389
|
+
context: 'Context',
|
|
390
|
+
requestHeaders: 'Request Headers',
|
|
391
|
+
requestBody: 'Request Body',
|
|
392
|
+
from: 'From',
|
|
393
|
+
to: 'To',
|
|
394
|
+
function: 'Function',
|
|
395
|
+
},
|
|
396
|
+
auth: {
|
|
397
|
+
tabLabel: 'Authentication',
|
|
398
|
+
layer: 'Layer',
|
|
399
|
+
file: 'File',
|
|
400
|
+
role: 'Role',
|
|
401
|
+
standardApi: 'Standard API',
|
|
402
|
+
deepseekWeb: 'DeepSeek Web',
|
|
403
|
+
},
|
|
404
|
+
skills: {
|
|
405
|
+
tabLabel: 'Skills',
|
|
406
|
+
thought: 'Thought',
|
|
407
|
+
reality: 'Reality',
|
|
408
|
+
priority: 'Priority',
|
|
409
|
+
tdd: 'TDD Concept',
|
|
410
|
+
skillCreation: 'Skill Creation',
|
|
411
|
+
platform: 'Platform',
|
|
412
|
+
install: 'Install',
|
|
413
|
+
hookFormat: 'Hook Format',
|
|
414
|
+
dimension: 'Dimension',
|
|
415
|
+
promptTemplate: 'Prompt Template',
|
|
416
|
+
outputContract: 'Output Contract',
|
|
417
|
+
fileMechanism: 'File Mechanism',
|
|
418
|
+
lifecycle: 'Lifecycle',
|
|
419
|
+
},
|
|
420
|
+
},
|
|
421
|
+
os: {
|
|
422
|
+
currentSystem: 'Current OS',
|
|
423
|
+
unix: 'macOS / Linux',
|
|
424
|
+
windows: 'Windows',
|
|
425
|
+
},
|
|
426
|
+
router: {
|
|
427
|
+
home: 'Home',
|
|
428
|
+
harness: 'Harness Tools',
|
|
429
|
+
freeModels: 'Free Models',
|
|
430
|
+
proxy: 'Proxy Solutions',
|
|
431
|
+
tokenMarket: 'Token Market',
|
|
432
|
+
docs: 'Docs',
|
|
433
|
+
siteName: 'AI Harness Learning Hub',
|
|
434
|
+
metaDesc: 'AI Harness Learning Hub - Learn AI programming tools (OpenCode, Codex, Claude Code), get free LLMs, domestic proxy solutions',
|
|
435
|
+
},
|
|
436
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { createI18n } from 'vue-i18n'
|
|
2
|
+
import zhCN from './zh-CN.js'
|
|
3
|
+
import en from './en.js'
|
|
4
|
+
|
|
5
|
+
const STORAGE_KEY = 'locale'
|
|
6
|
+
|
|
7
|
+
function getInitialLocale() {
|
|
8
|
+
const saved = localStorage.getItem(STORAGE_KEY)
|
|
9
|
+
if (saved && (saved === 'zh-CN' || saved === 'en')) {
|
|
10
|
+
return saved
|
|
11
|
+
}
|
|
12
|
+
return 'zh-CN'
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const i18n = createI18n({
|
|
16
|
+
legacy: false,
|
|
17
|
+
locale: getInitialLocale(),
|
|
18
|
+
fallbackLocale: 'zh-CN',
|
|
19
|
+
messages: {
|
|
20
|
+
'zh-CN': zhCN,
|
|
21
|
+
en,
|
|
22
|
+
},
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
export function setLocale(locale) {
|
|
26
|
+
i18n.global.locale.value = locale
|
|
27
|
+
localStorage.setItem(STORAGE_KEY, locale)
|
|
28
|
+
document.documentElement.lang = locale === 'zh-CN' ? 'zh-CN' : 'en'
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export default i18n
|