@agent-proxy/agy 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/catalog.d.ts +1 -4
- package/dist/catalog.js +4 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +6 -5
package/README.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# @agent-proxy/agy
|
|
2
|
+
|
|
3
|
+
[](https://github.com/aceHubert/codex-cliproxy-gateway/actions/workflows/deploy.yml)
|
|
4
|
+
[](https://www.npmjs.com/package/@agent-proxy/agy)
|
|
5
|
+
|
|
6
|
+
Agent Proxy 的 Antigravity 插件,只读消费已有登录凭据,
|
|
7
|
+
获取动态模型目录并将客户端请求、响应与上游协议双向转换。
|
|
8
|
+
通过 `createAgyPlugin` 接入宿主服务;凭据过期时需在原客户端重新登录。
|
|
9
|
+
|
|
10
|
+
## 安装
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
bun add @agent-proxy/agy
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
插件由 [@agent-proxy/gateway](https://www.npmjs.com/package/@agent-proxy/gateway)
|
|
17
|
+
显式装配,并依赖宿主注入 `HostServices`。
|
|
18
|
+
模型预设已内联到发布产物,无需安装私有 `@agent-proxy/models` 包。
|
|
19
|
+
|
|
20
|
+
[项目源码与文档](https://github.com/aceHubert/codex-cliproxy-gateway)
|
package/dist/catalog.d.ts
CHANGED
|
@@ -64,10 +64,7 @@ export interface AgyCatalogStoreOptions {
|
|
|
64
64
|
/** manual 仅允许显式刷新;目录查询不按 TTL 拉取。 */
|
|
65
65
|
catalogMode?: "dynamic" | "manual";
|
|
66
66
|
}
|
|
67
|
-
|
|
68
|
-
* 目录存储:内存 + 磁盘双指纹缓存、TTL、单飞刷新、失败回退 last-good。
|
|
69
|
-
* 账号切换(identity 变化)后旧 key 条目不复用。
|
|
70
|
-
*/
|
|
67
|
+
export declare const AGY_RUNTIME_ARTIFACTS: readonly string[];
|
|
71
68
|
export declare function createAgyCatalogStore(options: AgyCatalogStoreOptions): {
|
|
72
69
|
/** 返回目录条目、档位家族与旧 id 重定向表;无凭据或完全无缓存时抛错。 */
|
|
73
70
|
catalog(): Promise<{
|
package/dist/catalog.js
CHANGED
|
@@ -277,12 +277,15 @@ export function mergeAgyCatalog(base, agy) {
|
|
|
277
277
|
* 目录存储:内存 + 磁盘双指纹缓存、TTL、单飞刷新、失败回退 last-good。
|
|
278
278
|
* 账号切换(identity 变化)后旧 key 条目不复用。
|
|
279
279
|
*/
|
|
280
|
+
/** agy 落在缓存目录的产物清单(目录缓存,与落盘点同源);卸载清理与受管值守卫经组合层聚合消费。 */
|
|
281
|
+
const AGY_CATALOG_FILE_NAME = "agy-catalog.json";
|
|
282
|
+
export const AGY_RUNTIME_ARTIFACTS = Object.freeze([AGY_CATALOG_FILE_NAME]);
|
|
280
283
|
export function createAgyCatalogStore(options) {
|
|
281
284
|
const now = options.now ?? Date.now;
|
|
282
285
|
const ttlMs = Math.max(60_000, options.ttlMs ?? CATALOG_TTL_MS);
|
|
283
286
|
const endpoint = options.endpoint ?? AGY_ENDPOINT;
|
|
284
287
|
const endpointDigest = createHash("sha256").update(endpoint).digest("hex").slice(0, 16);
|
|
285
|
-
const cacheFile = path.join(options.cacheDirectory,
|
|
288
|
+
const cacheFile = path.join(options.cacheDirectory, AGY_CATALOG_FILE_NAME);
|
|
286
289
|
let cached;
|
|
287
290
|
let retryAt = 0;
|
|
288
291
|
let refreshing;
|
package/dist/index.d.ts
CHANGED
|
@@ -41,6 +41,7 @@ export interface SafeAgyError {
|
|
|
41
41
|
/** 只输出预定义分类;私有错误正文(可能回显请求或凭据)不进客户端与日志。 */
|
|
42
42
|
export declare function safeAgyUpstreamError(status: number, body: string): SafeAgyError;
|
|
43
43
|
export { isAgyModel, mergeAgyCatalog };
|
|
44
|
+
export { AGY_RUNTIME_ARTIFACTS } from "./catalog.ts";
|
|
44
45
|
export declare function createAgyAdapter<Config extends AgentConfig>(config: Config, dependencies?: AgyDependencies): {
|
|
45
46
|
catalog(): Promise<ModelCatalog>;
|
|
46
47
|
/** 显式刷新不吞错;无 last-good 时由命令报告失败。 */
|
package/dist/index.js
CHANGED
|
@@ -358,6 +358,7 @@ function buildAgyAdapter(config, dependencies = {}) {
|
|
|
358
358
|
};
|
|
359
359
|
}
|
|
360
360
|
export { isAgyModel, mergeAgyCatalog };
|
|
361
|
+
export { AGY_RUNTIME_ARTIFACTS } from "./catalog.js";
|
|
361
362
|
export function createAgyAdapter(config, dependencies = {}) {
|
|
362
363
|
return bindHostMethods(buildAgyAdapter(config, dependencies));
|
|
363
364
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-proxy/agy",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.3",
|
|
4
4
|
"description": "Agent Proxy agy 插件;保留基线转换行为。",
|
|
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,10 +34,10 @@
|
|
|
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/plugin-api": "0.11.
|
|
40
|
+
"@agent-proxy/plugin-api": "0.11.1"
|
|
40
41
|
},
|
|
41
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "37235103f935530274005fa391dba83abe522888"
|
|
42
43
|
}
|