@agent-proxy/zcode 0.11.0 → 0.11.3
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 +20 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4 -1
- package/package.json +7 -6
package/README.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# @agent-proxy/zcode
|
|
2
|
+
|
|
3
|
+
[](https://github.com/aceHubert/codex-cliproxy-gateway/actions/workflows/deploy.yml)
|
|
4
|
+
[](https://www.npmjs.com/package/@agent-proxy/zcode)
|
|
5
|
+
|
|
6
|
+
Agent Proxy 的 ZCode 插件,组合本地配置、套餐与 API Key 模型目录,
|
|
7
|
+
处理 ZCode 模型路由和请求、响应转换。
|
|
8
|
+
通过 `createZcodePlugin` 接入宿主服务。
|
|
9
|
+
|
|
10
|
+
## 安装
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
bun add @agent-proxy/zcode
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
插件由 [@agent-proxy/gateway](https://www.npmjs.com/package/@agent-proxy/gateway)
|
|
17
|
+
显式装配,并依赖宿主注入 `HostServices`;使用前需准备可用的 ZCode 配置。
|
|
18
|
+
模型预设已内联到发布产物,无需安装私有 `@agent-proxy/models` 包。
|
|
19
|
+
|
|
20
|
+
[项目源码与文档](https://github.com/aceHubert/codex-cliproxy-gateway)
|
package/dist/index.d.ts
CHANGED
|
@@ -44,5 +44,6 @@ export declare function createZcodeAdapter<Config extends AgentConfig>(config: C
|
|
|
44
44
|
close(): void;
|
|
45
45
|
};
|
|
46
46
|
export declare const ZCODE_MODEL_PATTERNS: readonly string[];
|
|
47
|
+
export declare const ZCODE_RUNTIME_ARTIFACTS: readonly string[];
|
|
47
48
|
/** 插件只负责本代理路由,协议转换沿用原适配器实现。 */
|
|
48
49
|
export declare function createZcodePlugin(host: HostServices<AgentConfig>, dependencies?: ZcodeDependencies): GatewayPlugin;
|
package/dist/index.js
CHANGED
|
@@ -51,7 +51,7 @@ function buildZcodeAdapter(config, dependencies = {}) {
|
|
|
51
51
|
clearModelsCacheEntries(dependencies.codexModelsCacheFile, isZcodeModel);
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
|
-
const servedCatalogFile = path.join(cacheDirectory,
|
|
54
|
+
const servedCatalogFile = path.join(cacheDirectory, ZCODE_CATALOG_FILE_NAME);
|
|
55
55
|
/** 当前对外目录(各套餐作用域前缀的并集)。watch 或启动时重建,/v1/models 只读取这里。 */
|
|
56
56
|
let servedCatalog = { models: [] };
|
|
57
57
|
/** 已发布目录对应的各套餐快照;仅在身份变化时才重算,避免每次 /v1/models 重新求交集。 */
|
|
@@ -622,6 +622,9 @@ export function createZcodeAdapter(config, dependencies = {}) {
|
|
|
622
622
|
return bindHostMethods(buildZcodeAdapter(config, dependencies));
|
|
623
623
|
}
|
|
624
624
|
export const ZCODE_MODEL_PATTERNS = Object.freeze(["zcode/*", "zcode-*/*"]);
|
|
625
|
+
/** zcode 落在运行主目录的产物清单(目录缓存,与落盘点同源);卸载清理与受管值守卫经组合层聚合消费。 */
|
|
626
|
+
const ZCODE_CATALOG_FILE_NAME = "zcode-catalog.json";
|
|
627
|
+
export const ZCODE_RUNTIME_ARTIFACTS = Object.freeze([ZCODE_CATALOG_FILE_NAME]);
|
|
625
628
|
/** 插件只负责本代理路由,协议转换沿用原适配器实现。 */
|
|
626
629
|
export function createZcodePlugin(host, dependencies = {}) {
|
|
627
630
|
return withHostServices(host, () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-proxy/zcode",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.3",
|
|
4
4
|
"description": "Agent Proxy zcode 插件;保留基线转换行为。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
"./*.json": "./dist/*.json"
|
|
18
18
|
},
|
|
19
19
|
"files": [
|
|
20
|
-
"dist"
|
|
20
|
+
"dist",
|
|
21
|
+
"README.md"
|
|
21
22
|
],
|
|
22
23
|
"scripts": {
|
|
23
24
|
"build": "bun ../../scripts/build-library.ts",
|
|
@@ -33,11 +34,11 @@
|
|
|
33
34
|
"url": "git+https://github.com/aceHubert/codex-cliproxy-gateway.git"
|
|
34
35
|
},
|
|
35
36
|
"devDependencies": {
|
|
36
|
-
"@agent-proxy/models": "0.11.
|
|
37
|
+
"@agent-proxy/models": "0.11.1"
|
|
37
38
|
},
|
|
38
39
|
"dependencies": {
|
|
39
|
-
"@agent-proxy/llm-bridge": "0.11.
|
|
40
|
-
"@agent-proxy/plugin-api": "0.11.
|
|
40
|
+
"@agent-proxy/llm-bridge": "0.11.1",
|
|
41
|
+
"@agent-proxy/plugin-api": "0.11.1"
|
|
41
42
|
},
|
|
42
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "37235103f935530274005fa391dba83abe522888"
|
|
43
44
|
}
|