@agent-proxy/gateway 0.12.3 → 0.13.0
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/README.md +1 -1
- package/{schemas/gateway-config.schema.json → config.schema.json} +1 -1
- package/dist/index.js +8 -139
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -264,7 +264,7 @@ agent-proxy serve --config /path/to/config.json
|
|
|
264
264
|
|
|
265
265
|
不传 `--config` 时使用 `~/.agent-proxy-gateway/config.json`。
|
|
266
266
|
手动部署还需配置 Codex 的连接地址与模型目录;配置字段见
|
|
267
|
-
[配置格式](
|
|
267
|
+
[配置格式](config.schema.json)。`serve` 本身不执行安装或启动 Web 界面。
|
|
268
268
|
|
|
269
269
|
上游 API Key 在 macOS 保存在登录钥匙串中,其他平台保存在
|
|
270
270
|
`~/.agent-proxy-gateway/credentials.json`,权限应为仅本人可读写(Linux 为 `0600`)。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://raw.githubusercontent.com/aceHubert/codex-cliproxy-gateway/main/apps/gateway/
|
|
3
|
+
"$id": "https://raw.githubusercontent.com/aceHubert/codex-cliproxy-gateway/main/apps/gateway/config.schema.json",
|
|
4
4
|
"title": "codex-cliproxy gateway config",
|
|
5
5
|
"type": "object",
|
|
6
6
|
"required": [
|
package/dist/index.js
CHANGED
|
@@ -35,10 +35,11 @@ function agentConfigEnabled(config, key) {
|
|
|
35
35
|
function effectiveAgentConfig(config) {
|
|
36
36
|
return { ...AGENT_DEFAULTS, ...config };
|
|
37
37
|
}
|
|
38
|
-
var CONFIG_SCHEMA = JSON.parse(fs.readFileSync(path.resolve(import.meta.dir, "../
|
|
38
|
+
var CONFIG_SCHEMA = JSON.parse(fs.readFileSync(path.resolve(import.meta.dir, "../config.schema.json"), "utf8"));
|
|
39
39
|
var PACKAGE_JSON = JSON.parse(fs.readFileSync(path.resolve(import.meta.dir, "../package.json"), "utf8"));
|
|
40
|
-
var
|
|
41
|
-
var GATEWAY_CONFIG_VERSION =
|
|
40
|
+
var packageVersion = PACKAGE_JSON.version;
|
|
41
|
+
var GATEWAY_CONFIG_VERSION = typeof packageVersion === "string" && /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/.test(packageVersion) ? packageVersion : "latest";
|
|
42
|
+
var GATEWAY_CONFIG_SCHEMA_URL = "https://github.com/aceHubert/codex-cliproxy-gateway/releases/latest/download/config.schema.json";
|
|
42
43
|
function isJsonObject(value) {
|
|
43
44
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
44
45
|
}
|
|
@@ -5999,7 +6000,7 @@ function loadModelOverrides(file) {
|
|
|
5999
6000
|
}
|
|
6000
6001
|
return compileModelOverrides(value, file);
|
|
6001
6002
|
}
|
|
6002
|
-
async function resolveModelMergeJson(cacheFile,
|
|
6003
|
+
async function resolveModelMergeJson(cacheFile, fallbackFile, url, refresh = false) {
|
|
6003
6004
|
if (url && (refresh || !fs8.existsSync(cacheFile))) {
|
|
6004
6005
|
let source;
|
|
6005
6006
|
try {
|
|
@@ -6036,7 +6037,7 @@ async function resolveModelMergeJson(cacheFile, bundledFile, url, refresh = fals
|
|
|
6036
6037
|
fs8.rmSync(stagingFile, { force: true });
|
|
6037
6038
|
}
|
|
6038
6039
|
}
|
|
6039
|
-
return fs8.existsSync(cacheFile) ? cacheFile :
|
|
6040
|
+
return fs8.existsSync(cacheFile) ? cacheFile : fallbackFile;
|
|
6040
6041
|
}
|
|
6041
6042
|
function normalizeCatalog(value) {
|
|
6042
6043
|
if (Array.isArray(value))
|
|
@@ -6526,138 +6527,6 @@ function selectedModelsFromCatalog(catalog, prefix = "cliproxy/") {
|
|
|
6526
6527
|
// src/upstream-catalog.ts
|
|
6527
6528
|
import fs10 from "fs";
|
|
6528
6529
|
import path7 from "path";
|
|
6529
|
-
// models.json
|
|
6530
|
-
var models_default = {
|
|
6531
|
-
openai: [
|
|
6532
|
-
{
|
|
6533
|
-
name: "gpt-5.6-*",
|
|
6534
|
-
context_window: 272000,
|
|
6535
|
-
max_context_window: 372000,
|
|
6536
|
-
effective_context_window_percent: 95
|
|
6537
|
-
}
|
|
6538
|
-
],
|
|
6539
|
-
deepseek: [
|
|
6540
|
-
{
|
|
6541
|
-
name: "deepseek-v4.1-flash",
|
|
6542
|
-
description: "DeepSeek-V4.1-Flash with native multimodal visual understanding and improved text and agent capabilities.",
|
|
6543
|
-
default_reasoning_level: "max",
|
|
6544
|
-
shell_type: "shell_command",
|
|
6545
|
-
visibility: "list",
|
|
6546
|
-
supported_in_api: true,
|
|
6547
|
-
base_instructions: "",
|
|
6548
|
-
supports_reasoning_summaries: true,
|
|
6549
|
-
default_reasoning_summary: "none",
|
|
6550
|
-
support_verbosity: false,
|
|
6551
|
-
apply_patch_tool_type: "freeform",
|
|
6552
|
-
truncation_policy: {
|
|
6553
|
-
mode: "bytes",
|
|
6554
|
-
limit: 1e4
|
|
6555
|
-
},
|
|
6556
|
-
context_window: 1048576,
|
|
6557
|
-
max_context_window: 1048576,
|
|
6558
|
-
effective_context_window_percent: 95,
|
|
6559
|
-
supports_parallel_tool_calls: true,
|
|
6560
|
-
experimental_supported_tools: [],
|
|
6561
|
-
input_modalities: ["text", "image"]
|
|
6562
|
-
},
|
|
6563
|
-
{
|
|
6564
|
-
name: "deepseek-flash",
|
|
6565
|
-
description: "DeepSeek-V4.1-Flash with native multimodal visual understanding and improved text and agent capabilities.",
|
|
6566
|
-
default_reasoning_level: "max",
|
|
6567
|
-
shell_type: "shell_command",
|
|
6568
|
-
visibility: "list",
|
|
6569
|
-
supported_in_api: true,
|
|
6570
|
-
base_instructions: "",
|
|
6571
|
-
supports_reasoning_summaries: true,
|
|
6572
|
-
default_reasoning_summary: "none",
|
|
6573
|
-
support_verbosity: false,
|
|
6574
|
-
apply_patch_tool_type: "freeform",
|
|
6575
|
-
truncation_policy: {
|
|
6576
|
-
mode: "bytes",
|
|
6577
|
-
limit: 1e4
|
|
6578
|
-
},
|
|
6579
|
-
context_window: 1048576,
|
|
6580
|
-
max_context_window: 1048576,
|
|
6581
|
-
effective_context_window_percent: 95,
|
|
6582
|
-
supports_parallel_tool_calls: true,
|
|
6583
|
-
experimental_supported_tools: [],
|
|
6584
|
-
input_modalities: ["text", "image"]
|
|
6585
|
-
},
|
|
6586
|
-
{
|
|
6587
|
-
name: "deepseek-v4-*",
|
|
6588
|
-
description: "DeepSeek harnesses the power of the latest LLM technology to provide a superior user experience.",
|
|
6589
|
-
default_reasoning_level: "max",
|
|
6590
|
-
shell_type: "shell_command",
|
|
6591
|
-
visibility: "list",
|
|
6592
|
-
supported_in_api: true,
|
|
6593
|
-
base_instructions: "",
|
|
6594
|
-
supports_reasoning_summaries: true,
|
|
6595
|
-
default_reasoning_summary: "none",
|
|
6596
|
-
support_verbosity: false,
|
|
6597
|
-
apply_patch_tool_type: "freeform",
|
|
6598
|
-
truncation_policy: {
|
|
6599
|
-
mode: "bytes",
|
|
6600
|
-
limit: 1e4
|
|
6601
|
-
},
|
|
6602
|
-
context_window: 1048576,
|
|
6603
|
-
max_context_window: 1048576,
|
|
6604
|
-
effective_context_window_percent: 95,
|
|
6605
|
-
supports_parallel_tool_calls: true,
|
|
6606
|
-
experimental_supported_tools: [],
|
|
6607
|
-
input_modalities: ["text"]
|
|
6608
|
-
}
|
|
6609
|
-
],
|
|
6610
|
-
"z.ai": [
|
|
6611
|
-
{
|
|
6612
|
-
name: "glm-5.3",
|
|
6613
|
-
description: "Z.ai's latest flagship model",
|
|
6614
|
-
default_reasoning_level: "max",
|
|
6615
|
-
shell_type: "shell_command",
|
|
6616
|
-
visibility: "list",
|
|
6617
|
-
supported_in_api: true,
|
|
6618
|
-
base_instructions: "",
|
|
6619
|
-
supports_search_tool: true,
|
|
6620
|
-
supports_reasoning_summaries: true,
|
|
6621
|
-
default_reasoning_summary: "none",
|
|
6622
|
-
support_verbosity: false,
|
|
6623
|
-
apply_patch_tool_type: "freeform",
|
|
6624
|
-
truncation_policy: {
|
|
6625
|
-
mode: "bytes",
|
|
6626
|
-
limit: 1e4
|
|
6627
|
-
},
|
|
6628
|
-
context_window: 1048576,
|
|
6629
|
-
max_context_window: 1048576,
|
|
6630
|
-
effective_context_window_percent: 95,
|
|
6631
|
-
supports_parallel_tool_calls: true,
|
|
6632
|
-
experimental_supported_tools: []
|
|
6633
|
-
},
|
|
6634
|
-
{
|
|
6635
|
-
name: "glm-5.3-flash",
|
|
6636
|
-
description: "Z.ai's first native multimodal model in the GLM-5 series",
|
|
6637
|
-
default_reasoning_level: "max",
|
|
6638
|
-
shell_type: "shell_command",
|
|
6639
|
-
visibility: "list",
|
|
6640
|
-
supported_in_api: true,
|
|
6641
|
-
base_instructions: "",
|
|
6642
|
-
supports_search_tool: true,
|
|
6643
|
-
supports_reasoning_summaries: true,
|
|
6644
|
-
default_reasoning_summary: "none",
|
|
6645
|
-
support_verbosity: false,
|
|
6646
|
-
apply_patch_tool_type: "freeform",
|
|
6647
|
-
truncation_policy: {
|
|
6648
|
-
mode: "bytes",
|
|
6649
|
-
limit: 1e4
|
|
6650
|
-
},
|
|
6651
|
-
context_window: 1048576,
|
|
6652
|
-
max_context_window: 1048576,
|
|
6653
|
-
effective_context_window_percent: 95,
|
|
6654
|
-
supports_parallel_tool_calls: true,
|
|
6655
|
-
experimental_supported_tools: []
|
|
6656
|
-
}
|
|
6657
|
-
]
|
|
6658
|
-
};
|
|
6659
|
-
|
|
6660
|
-
// src/upstream-catalog.ts
|
|
6661
6530
|
var codexClientModels;
|
|
6662
6531
|
var vendorModelRules;
|
|
6663
6532
|
function configuredUpstreamType(config) {
|
|
@@ -6683,7 +6552,7 @@ async function loadModelOverrideRules(paths, config, refreshModelMerge) {
|
|
|
6683
6552
|
const modelsConfigFile = await resolveModelMergeJson(paths.modelMergeFile, undefined, config.modelMergeJson, refreshModelMerge);
|
|
6684
6553
|
return {
|
|
6685
6554
|
modelsConfigFile,
|
|
6686
|
-
rules: modelsConfigFile === undefined ?
|
|
6555
|
+
rules: modelsConfigFile === undefined ? [] : loadModelOverrides(modelsConfigFile)
|
|
6687
6556
|
};
|
|
6688
6557
|
}
|
|
6689
6558
|
function upstreamKeyOptional(baseUrl) {
|
|
@@ -6705,7 +6574,7 @@ async function rebuildCatalog(paths, config, proxyModels, modelsConfigFile) {
|
|
|
6705
6574
|
const result = await syncCatalog({
|
|
6706
6575
|
catalogFile: configuredCatalogFile(paths, config),
|
|
6707
6576
|
proxyModels,
|
|
6708
|
-
...modelsConfigFile === undefined ? { overrides:
|
|
6577
|
+
...modelsConfigFile === undefined ? { overrides: [] } : { modelsConfigFile }
|
|
6709
6578
|
});
|
|
6710
6579
|
fs10.rmSync(path7.join(paths.runtimeHome, "catalog-metadata.json"), { force: true });
|
|
6711
6580
|
return result;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-proxy/gateway",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "Agent Proxy 的 Bun 网关与 CLI 业务应用。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
},
|
|
12
12
|
"files": [
|
|
13
13
|
"dist",
|
|
14
|
-
"
|
|
14
|
+
"config.schema.json",
|
|
15
15
|
"README.md"
|
|
16
16
|
],
|
|
17
17
|
"scripts": {
|
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
"prepack": "bun ../../scripts/verify-package.ts ."
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@agent-proxy/agy": "0.
|
|
25
|
-
"@agent-proxy/codebuddy": "0.
|
|
26
|
-
"@agent-proxy/opencode-zen": "0.
|
|
27
|
-
"@agent-proxy/plugin-api": "0.
|
|
28
|
-
"@agent-proxy/qoder": "0.
|
|
29
|
-
"@agent-proxy/zcode": "0.
|
|
24
|
+
"@agent-proxy/agy": "0.13.0",
|
|
25
|
+
"@agent-proxy/codebuddy": "0.13.0",
|
|
26
|
+
"@agent-proxy/opencode-zen": "0.13.0",
|
|
27
|
+
"@agent-proxy/plugin-api": "0.13.0",
|
|
28
|
+
"@agent-proxy/qoder": "0.13.0",
|
|
29
|
+
"@agent-proxy/zcode": "0.13.0",
|
|
30
30
|
"bytes": "^3.1.2",
|
|
31
31
|
"i18next": "^26.4.2",
|
|
32
32
|
"react": "^19.2.0",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"react-i18next": "^17.0.16"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@agent-proxy/models": "0.
|
|
37
|
+
"@agent-proxy/models": "0.13.0"
|
|
38
38
|
},
|
|
39
39
|
"engines": {
|
|
40
40
|
"bun": ">=1.2.0"
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"type": "git",
|
|
49
49
|
"url": "git+https://github.com/aceHubert/codex-cliproxy-gateway.git"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "188f1458431e7447063b2267606768b3d884c3f2"
|
|
52
52
|
}
|