dsh-connect-agnes-token-plan 0.13.1 → 0.13.2
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/CHANGELOG.md +10 -0
- package/README.md +6 -19
- package/client.js +38 -2
- package/docs/ADR.md +21 -0
- package/docs/DSH-PLUGIN.md +1 -1
- package/docs/SETUP.md +11 -0
- package/lib/agnescode-stats-store.js +66 -19
- package/lib/index.js +179 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -23,6 +23,16 @@
|
|
|
23
23
|
|
|
24
24
|
## [Unreleased]
|
|
25
25
|
|
|
26
|
+
## [0.13.2] — 2026-10-23
|
|
27
|
+
|
|
28
|
+
本版两件事:**网关新上的模型默认就能发图**,以及**余额胶囊上会多一段「· N 新模型」**。两处都只影响 AgnesCode(桌面端)这条线。
|
|
29
|
+
|
|
30
|
+
### 变更:新模型默认能发图,胶囊会告诉你网关多了哪个模型
|
|
31
|
+
|
|
32
|
+
- **改(识图)**:网关新上的模型不再默认被当成纯文本。旧版只认「官方文档表里写过的」那几个,表里没有的模型就不给图片入口——看不到任何提示,只能自己发现。现在没证据的模型**默认放开图片输入**,面板把它标成「可看图·未实测」;确认看不见图的模型才被收回去(记在一份否决清单里,带实测日期)。
|
|
33
|
+
- **新(胶囊)**:小浣熊/AgnesCode 的余额胶囊上会多一段「· N 新模型」。它比的是插件自己记的「这台机器见过哪些模型」,所以只在网关真的新上了模型时出现。新模型名字在 tooltip 和展开卡片里,最多列三个。标记保持 7 天,不弹窗、不需要点确认;装上新版后的第一次运行会把当时的目录当作「早就见过」,不会把整张表报成新的。
|
|
34
|
+
- **说明**:两处都只影响 AgnesCode 这条线,商汤 Token Plan 侧的面板与胶囊不变。
|
|
35
|
+
|
|
26
36
|
## [0.13.1] — 2026-10-22
|
|
27
37
|
|
|
28
38
|
本版只改一件事:**插件卡的标题**。中文叫「Agnes 模型接入」,英文叫「Agnes Model Access」,与「商汤模型接入」「魔搭模型接入」同构。
|
package/README.md
CHANGED
|
@@ -2,20 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
<p align="center"><b>把 Agnes(爱思)接进 DSH 的 Plugins 页插件卡,并在会话输入框常驻一枚用量胶囊。</b></p>
|
|
4
4
|
|
|
5
|
-
<p align="center">
|
|
6
|
-
<a href="#安装">安装</a> ·
|
|
7
|
-
<a href="#它是怎么工作的">工作原理</a> ·
|
|
8
|
-
<a href="CHANGELOG.md">更新日志</a> ·
|
|
9
|
-
<a href="https://github.com/eghrhegpe/dsh-connect-agnes-token-plan/issues">问题反馈</a>
|
|
10
|
-
</p>
|
|
5
|
+
<p align="center"><a href="#安装">安装</a> · <a href="#它是怎么工作的">工作原理</a> · <a href="CHANGELOG.md">更新日志</a> · <a href="https://github.com/eghrhegpe/dsh-connect-agnes-token-plan/issues">问题反馈</a></p>
|
|
11
6
|
|
|
12
7
|
<p align="center">
|
|
13
|
-
<a href="https://www.npmjs.com/package/dsh-connect-agnes-token-plan"><img src="https://img.shields.io/npm/v/dsh-connect-agnes-token-plan?style=flat-square&label=npm&color=cb3837" alt="npm version"></a>
|
|
14
|
-
<a href="https://
|
|
15
|
-
<a href="https://github.com/eghrhegpe/dsh-connect-agnes-token-plan/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/eghrhegpe/dsh-connect-agnes-token-plan/ci.yml?branch=main&style=flat-square&label=tests" alt="test status"></a>
|
|
16
|
-
<a href="LICENSE"><img src="https://img.shields.io/github/license/eghrhegpe/dsh-connect-agnes-token-plan?style=flat-square" alt="MIT license"></a>
|
|
17
|
-
<a href="https://github.com/eghrhegpe/dsh-connect-agnes-token-plan/stargazers"><img src="https://img.shields.io/github/stars/eghrhegpe/dsh-connect-agnes-token-plan?style=flat-square" alt="GitHub stars"></a>
|
|
18
|
-
<a href="https://dshfind.com/plugins/eghrhegpe/dsh-connect-agnes-token-plan"><img src="https://dshfind.com/api/badge/eghrhegpe/dsh-connect-agnes-token-plan" alt="dshfind plugin"></a>
|
|
8
|
+
<a href="https://www.npmjs.com/package/dsh-connect-agnes-token-plan"><img src="https://img.shields.io/npm/v/dsh-connect-agnes-token-plan?style=flat-square&label=npm&color=cb3837" alt="npm version"></a> <a href="https://www.npmjs.com/package/dsh-connect-agnes-token-plan"><img src="https://img.shields.io/npm/d18m/dsh-connect-agnes-token-plan?style=flat-square&label=downloads&color=cb3837" alt="npm downloads"></a> <a href="https://github.com/eghrhegpe/dsh-connect-agnes-token-plan/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/eghrhegpe/dsh-connect-agnes-token-plan/ci.yml?branch=main&style=flat-square&label=tests" alt="test status"></a>
|
|
9
|
+
<a href="LICENSE"><img src="https://img.shields.io/github/license/eghrhegpe/dsh-connect-agnes-token-plan?style=flat-square" alt="MIT license"></a> <a href="https://github.com/eghrhegpe/dsh-connect-agnes-token-plan/stargazers"><img src="https://img.shields.io/github/stars/eghrhegpe/dsh-connect-agnes-token-plan?style=flat-square" alt="GitHub stars"></a> <a href="https://dshfind.com/plugins/eghrhegpe/dsh-connect-agnes-token-plan"><img src="https://dshfind.com/api/badge/eghrhegpe/dsh-connect-agnes-token-plan" alt="dshfind plugin"></a>
|
|
19
10
|
</p>
|
|
20
11
|
|
|
21
12
|
把 Agnes 接进 DSH:**Plugins 页**的插件卡(三个 tab),外加**会话输入框右侧的一枚用量胶囊**。**DSH** 即 **DeepSeek Harness**;**Agnes**(爱思)是全模态大模型平台,本插件对接其**控制台 API** 与**推理 API**。
|
|
@@ -84,7 +75,8 @@
|
|
|
84
75
|
|
|
85
76
|
- 读数与面板**同源**:控制台百分比优先用平台自己报的 `usage_pct`、缺失才回落 `已用 / 上限`,**不做钳制**(超额窗口就显示 >100%,那是事实);桌面端画的是**存量**,所以**不造百分比**——网关只公布积分,没有「上限」可以当分母;
|
|
86
77
|
- 两条上游**互不借用**:`agnescode` 的会话只读它自己的路由、绝不画控制台窗口,反之亦然;切到**别的 provider**(其它插件)的模型时胶囊直接消失,也不再发任何请求;
|
|
87
|
-
- 读不到时**保留上一次数字并标「上次数据」**,不会清零或伪装成 0%;余额里的 `0` 是「烧完了」的读数(红色告警),`—`
|
|
78
|
+
- 读不到时**保留上一次数字并标「上次数据」**,不会清零或伪装成 0%;余额里的 `0` 是「烧完了」的读数(红色告警),`—` 才是「这次没读到」——这个区别是刻意的;
|
|
79
|
+
- 网关新上了模型时,余额胶囊会多一段**「· N 新模型」**(名字在 tooltip 与展开卡里,最多三个,保留 7 天)。这里的「新」指**这台机器第一次见到它**,不是上游的上架时间——网关目录没有这个字段。装上新版后的第一次运行只把当时的目录记下来当基线,不会把整张表报成新的。
|
|
88
80
|
|
|
89
81
|

|
|
90
82
|
|
|
@@ -118,12 +110,7 @@
|
|
|
118
110
|
|
|
119
111
|
## 运维诊断:这台机器现在挂没挂 provider?
|
|
120
112
|
|
|
121
|
-
provider /
|
|
122
|
-
|
|
123
|
-
```powershell
|
|
124
|
-
npm run doctor # 人读:每个 profile 的 provider / draw / video / agnescode 开关与模型清单
|
|
125
|
-
npm run doctor:json # 机器读:JSON(可进你的巡检 / 工单脚本)
|
|
126
|
-
```
|
|
113
|
+
provider / 出图 / 视频 / AgnesCode 开关的生效值存在插件私有状态文件里(`$DSH_HOME/state/<name>/`),不在任何配置或路由上;`npm run doctor` 只读状态文件、不碰凭据,Host 没起也能跑(人读 / 机器读两个口径见 [docs/SETUP.md](docs/SETUP.md) §6.1)。
|
|
127
114
|
|
|
128
115
|
## 文档
|
|
129
116
|
|
package/client.js
CHANGED
|
@@ -264,6 +264,12 @@ var dsh_connect_agnes_token_plan_client = (function() {
|
|
|
264
264
|
"agnescode.models": "模型({count})",
|
|
265
265
|
"agnescode.fallbackRoster": "未取到实时目录,以下为内置清单,倍率截至 {asOf}。",
|
|
266
266
|
"agnescode.memberOnly": "会员",
|
|
267
|
+
"agnescode.visionAssumed": "可看图·未实测",
|
|
268
|
+
"agnescode.visionAssumedTitle": "网关没声明这个模型能否看图,插件默认放开图片入口(未实测)。真发过去模型说看不到,就把它的 id 记进否决清单。",
|
|
269
|
+
"agnescd.newModels": "新模型",
|
|
270
|
+
"agnescd.newModelsRow": "本机新见",
|
|
271
|
+
"agnescd.newModelsTitle": "本机首次见到的模型:",
|
|
272
|
+
"agnescd.newModelsSep": "、",
|
|
267
273
|
"agnescode.rateTitle": "平台公布的积分消耗倍率(0 为免费)",
|
|
268
274
|
"agnescode.registeredPill": "已注册",
|
|
269
275
|
"agnescode.rosterHint": "勾选决定哪些模型推送进 DSH 模型列表,改动即时生效。",
|
|
@@ -524,6 +530,12 @@ var dsh_connect_agnes_token_plan_client = (function() {
|
|
|
524
530
|
"agnescode.models": "Models ({count})",
|
|
525
531
|
"agnescode.fallbackRoster": "Live catalogue unavailable — showing the built-in list, rates as of {asOf}.",
|
|
526
532
|
"agnescode.memberOnly": "member",
|
|
533
|
+
"agnescode.visionAssumed": "vision (unverified)",
|
|
534
|
+
"agnescode.visionAssumedTitle": "The gateway did not declare whether this model sees images, so picture input is allowed by default and this is unverified. If the model answers it cannot see the image, add its id to the vision denylist.",
|
|
535
|
+
"agnescd.newModels": "new",
|
|
536
|
+
"agnescd.newModelsRow": "New here",
|
|
537
|
+
"agnescd.newModelsTitle": "First seen on this machine: ",
|
|
538
|
+
"agnescd.newModelsSep": ", ",
|
|
527
539
|
"agnescode.rateTitle": "Credit multiplier as published by the platform (0 = free)",
|
|
528
540
|
"agnescode.registeredPill": "Registered",
|
|
529
541
|
"agnescode.rosterHint": "Ticking decides which models are pushed into DSH's model list; the change takes effect immediately.",
|
|
@@ -1562,6 +1574,10 @@ var dsh_connect_agnes_token_plan_client = (function() {
|
|
|
1562
1574
|
},
|
|
1563
1575
|
pillReading: { fontVariantNumeric: "tabular-nums" },
|
|
1564
1576
|
pillStale: { color: "var(--dsw-alias-label-secondary)" },
|
|
1577
|
+
pillNewTag: {
|
|
1578
|
+
color: "var(--dsw-alias-label-secondary)",
|
|
1579
|
+
flexShrink: 0
|
|
1580
|
+
},
|
|
1565
1581
|
pillErrorText: { color: "var(--dsw-alias-state-error-primary)" },
|
|
1566
1582
|
pillTierOk: { background: "var(--dsw-alias-state-success-primary, #22c55e)" },
|
|
1567
1583
|
pillTierWarn: { background: "var(--dsw-alias-state-warn-primary, #f59e0b)" },
|
|
@@ -4050,7 +4066,10 @@ var dsh_connect_agnes_token_plan_client = (function() {
|
|
|
4050
4066
|
}), h("span", { style: S.spacer }), promo === null ? null : h("span", { style: S.modelPromo }, promo), rate === null ? null : h("span", {
|
|
4051
4067
|
style: S.modelRate,
|
|
4052
4068
|
title: tt("agnescode.rateTitle")
|
|
4053
|
-
}, `×${rate}`), row
|
|
4069
|
+
}, `×${rate}`), row?.vision === true ? h("span", {
|
|
4070
|
+
style: S.modelBadge,
|
|
4071
|
+
title: row?.visionSource === "assumed" ? tt("agnescode.visionAssumedTitle") : void 0
|
|
4072
|
+
}, row?.visionSource === "assumed" ? tt("agnescode.visionAssumed") : tt("llm.rosterVision")) : null, row.memberOnly === true ? h("span", { style: S.modelBadge }, tt("agnescode.memberOnly")) : null), meta === "" ? null : h("div", { style: S.modelMeta }, meta));
|
|
4054
4073
|
})));
|
|
4055
4074
|
}
|
|
4056
4075
|
/**
|
|
@@ -4665,10 +4684,17 @@ var dsh_connect_agnes_token_plan_client = (function() {
|
|
|
4665
4684
|
const permanent = partOf(state, "permanentBalance");
|
|
4666
4685
|
const split = timeLimited === null || permanent === null ? null : `${tt("agnescode.balanceTimeLabel")} ${count(timeLimited)} · ${tt("agnescode.balancePermanentLabel")} ${count(permanent)}`;
|
|
4667
4686
|
const usageText = agnescodeUsageText(state?.usage ?? null, tt);
|
|
4687
|
+
const newIds = (Array.isArray(state?.newModelIds) ? state.newModelIds : []).filter((id) => typeof id === "string" && id !== "");
|
|
4688
|
+
const shownNames = newIds.map((id) => {
|
|
4689
|
+
const row = state?.models?.find((model) => model.id === id);
|
|
4690
|
+
return row?.name ?? row?.id ?? id;
|
|
4691
|
+
}).slice(0, 3);
|
|
4692
|
+
const newModelTitle = newIds.length === 0 ? null : `${tt("agnescd.newModelsTitle")}${shownNames.join(tt("agnescd.newModelsSep"))}${newIds.length > shownNames.length ? "…" : ""}`;
|
|
4668
4693
|
const title = [
|
|
4669
4694
|
tt("composer.balanceTitle"),
|
|
4670
4695
|
split,
|
|
4671
4696
|
why,
|
|
4697
|
+
newModelTitle,
|
|
4672
4698
|
stale ? tt("composer.stale") : null
|
|
4673
4699
|
].filter(Boolean).join(" · ");
|
|
4674
4700
|
const { popoverId, open, setOpen, rootRef, cardRef, triggerRef } = usePillPopover();
|
|
@@ -4693,6 +4719,10 @@ var dsh_connect_agnes_token_plan_client = (function() {
|
|
|
4693
4719
|
key: "why",
|
|
4694
4720
|
style: S.pillPopMuted
|
|
4695
4721
|
}, why) : null,
|
|
4722
|
+
newIds.length > 0 ? h("div", {
|
|
4723
|
+
key: "new-models",
|
|
4724
|
+
style: S.pillPopMuted
|
|
4725
|
+
}, `${tt("agnescd.newModelsRow")} ${shownNames.join(tt("agnescd.newModelsSep"))}${newIds.length > shownNames.length ? "…" : ""}`) : null,
|
|
4696
4726
|
stale ? h("div", {
|
|
4697
4727
|
key: "stale",
|
|
4698
4728
|
style: S.pillPopMuted
|
|
@@ -4716,7 +4746,13 @@ var dsh_connect_agnes_token_plan_client = (function() {
|
|
|
4716
4746
|
popoverOpen: open,
|
|
4717
4747
|
popoverId,
|
|
4718
4748
|
buttonRef: triggerRef,
|
|
4719
|
-
children: h("span", {
|
|
4749
|
+
children: [h("span", {
|
|
4750
|
+
key: "reading",
|
|
4751
|
+
style: S.pillReading
|
|
4752
|
+
}, pending ? "…" : balance === null ? "—" : `${count(balance)} ${tt("composer.balanceUnit")}`), newIds.length === 0 ? null : h("span", {
|
|
4753
|
+
key: "new-models",
|
|
4754
|
+
style: S.pillNewTag
|
|
4755
|
+
}, ` · ${newIds.length} ${tt("agnescd.newModels")}`)]
|
|
4720
4756
|
}), open ? h("div", {
|
|
4721
4757
|
ref: cardRef,
|
|
4722
4758
|
id: popoverId,
|
package/docs/ADR.md
CHANGED
|
@@ -206,3 +206,24 @@
|
|
|
206
206
|
- **受影响的文档**:`src/host/agnescode-models.ts`(`agnescodeThinkingLevelMap(id)` per-model + 模块头决策 1)、`test/agnescode.test.mjs`(新增 agnes-2.5-pro 断言块)、`docs/ROADMAP.md` §6.3.1(新增 2026-10-18 探针行)、`CHANGELOG.md`([Unreleased])。ADR-009 原文按考古纪律保留不改写。
|
|
207
207
|
- **与既有条目的关系**:细化 ADR-009 的档位映射(该裁定以 3.0-flash 探针为基础,未覆盖 2.5-pro 的阶梯差异);不改变 `docs/DSH-LLM-DEVELOP.md` §4 的通用裁法(Token Plan 侧 `thinkingLevelMapFor` 未动)。
|
|
208
208
|
|
|
209
|
+
## ADR-018 agnescode 识图默认放行:没证据的行也收图,但面板必须说「未实测」
|
|
210
|
+
|
|
211
|
+
- **日期**:2026-10-22
|
|
212
|
+
- **状态**:现行(实现见 `src/host/agnescode-models.ts` 的 `AGNESCODE_VISION_DENYLIST` / `agnescodeVisionVerdict` / `agnescodeVisionSource`,`agnescodeRoster` 把 `vision` 与 `visionSource` 一起透出;面板 chip 见 `src/client/agnescode-tab.ts`;门禁见 `test/agnescode.test.mjs` 的判定阶梯段与 `test/dom-render.test.mjs` 的 chip 段)
|
|
213
|
+
- **裁定**:判定阶梯四级——**实测否决集 → 行内声明 → `PROBED_VISION` 实测表 → 默认放行(`assumed`)**。前三级给面板一个朴素 chip;`assumed` 必须画成「可看图·未实测」并带 tooltip;否决项画 `vision:false`、无 chip。换言之:**默认值是「给它图片」,唯一能否掉它的是带日期实测的否决条目**。
|
|
214
|
+
- **理由**:网关 `/models` 的每一行都只写 `model_type: "text"`,从不说自己能不能看图(`fetchAgnescodeCatalog` 因此钉死 `vision:false`——那是 wire 事实,不是判决)。旧逻辑把「文档表里没有」读成「不支持」,于是网关每上一次新模型,图片入口就静默消失一次:用户看不到任何提示,只能自己发现并来报。这条失效方向是不可见的(能力缺失不像错报那样会在会话里露头),而错报在当前网关是可观测的:模型收到图片后自述看不见,HTTP 仍是 200。
|
|
215
|
+
- **代价与护栏**:默认放行把失效方向翻成「错报」,但没有翻成「谎报」——`visionSource` 让面板把未实测的行标出来,读者因此知道这是插件的默认,不是平台的声明。否决集是唯一维护面:发现某模型自述看不见,就把它带日期加进 `AGNESCODE_VISION_DENYLIST`。
|
|
216
|
+
- **边界**:只动 agnescode 这条上游;Token Plan 侧 `identifyVisionModel`(按 `/v1/models` 的 `input_modalities` 判定)不受影响,两侧判定函数不合并。`AGNESCODE_FALLBACK_MODELS` 的 `vision` 列是手写快照,不经过本判定函数;`visionSource` 只影响面板显示,不改变 descriptor 的 `input` 数组长度约定(`vision:true` → `["text","image"]`)。
|
|
217
|
+
- **复核条件**:若网关开始在 `/models` 里声明模态(`input_modalities` 或视觉标签),第二级(`declared`)就会接管绝大多数行,`assumed` 退化为稀有位——那时本条仍然成立,只是很少被用到。若哪天实测发现「未实测默认可看图」在本网关的错报代价高到不可接受(例如图片被静默吞掉且模型照常编造),把默认改回 `false` 并把本条的 `assumed` 换成一个显式的 `unknown` chip。
|
|
218
|
+
|
|
219
|
+
## ADR-019 网关新增模型走胶囊的「· N 新模型」,不弹窗、不留确认态
|
|
220
|
+
|
|
221
|
+
- **日期**:2026-10-22
|
|
222
|
+
- **状态**:现行(实现见 `src/host/agnescode-roster-seen-store.ts` 的首次见到历史、`src/host/routes/agnescode.ts` 的 `newModelIds` 差分、`src/client/composer-usage-pill.ts` 的 AgnesCode 胶囊段;门禁见 `test/agnescode.test.mjs` 的两个新段与 `test/dom-render.test.mjs` 的胶囊三帧)
|
|
223
|
+
- **裁定**:网关目录里出现本机没见过的 model id 时,**只在胶囊上多一段「· N 新模型」**(tooltip 与 popover 给名字,最多列三个),不弹窗、不阻塞、不留「已读」按钮。判定基准是插件自己写的首次见到文件 `agnescode-roster-seen.json`:**首次写入是播种(整表记为已见、一条都不报)**,之后新增的 id 记为「现在」并保持 7 天,离开目录的 id 从表里删除(重新上架算新)。
|
|
224
|
+
- **理由**:DSH 的 Host 面没有通知/弹窗服务,插件的可见面只有插件卡与胶囊;而胶囊本来就是读者扫余额的地方,把「网关多了个模型」放在余额旁边是同一类信息(都关于「现在能用什么」)。播种是必须的:升级后的第一次运行会把当时整张目录写成历史,否则每个老用户都会被告知全部七个模型都是新的——那是噪音,不是提醒。
|
|
225
|
+
- **为什么不是弹窗 / 已读态**:弹窗需要用户处理,而「多了个模型」不需要处理;已读态需要一个点击,等于把一个纯信息变成一次任务。7 天窗口是提醒的寿命:够长到用户会看见,够短到不会永远挂着。重上架的 id 再报一次,因为那说明这一行背后的东西换过手,值得知道。
|
|
226
|
+
- **边界**:只在 `modelsSource === "live"` 时差分——回退快照表是插件自己的六行文本,拿它差分会在登录/离线那几帧凭空造出「新模型」。差分对象是**整张 live 目录**,不是用户勾选的子集:某个模型是不是网关的新闻,与这台机器勾了哪些框无关;拿子集差分还会让一个上架很久的模型在「被勾上」的那天冒充新模型。`newModelIds` 缺席(旧生产者、离线、首次播种)时胶囊什么都不画,不画空段、不留悬空分隔符。该标记只出现在 agnescode provider 被选中的胶囊上;Token Plan 侧名册没有这个字段。
|
|
227
|
+
- **复核条件**:若网关开始提供「上架时间」字段,差分就应改成读那个字段,本文件降级为离线兜底;若 DSH 之后提供通知服务,这段可以迁过去,胶囊只留计数。
|
|
228
|
+
|
|
229
|
+
|
package/docs/DSH-PLUGIN.md
CHANGED
|
@@ -25,7 +25,7 @@ DSH 插件是一段在 **Host**(桌面版或 `dsh web`)进程内运行的代
|
|
|
25
25
|
{
|
|
26
26
|
"name": "dsh-connect-agnes-token-plan",
|
|
27
27
|
"icon": "./icon.svg", // Plugins 页插件卡图标:Host 读此字段按 SVG/PNG/JPEG/WebP 渲染(相对路径、落在 files 内、≤256 KiB,任一不满足会让整条元数据报错)
|
|
28
|
-
"version": "0.13.
|
|
28
|
+
"version": "0.13.2",
|
|
29
29
|
"main": "./lib/index.js", // Host 半边入口:src/host/*.ts 经 tsdown 打成的单条 bundle
|
|
30
30
|
"exports": {
|
|
31
31
|
".": "./lib/index.js", // 源码在 src/host/,lib/ 为纯构建产物(随库提交,git/市场直装零构建)
|
package/docs/SETUP.md
CHANGED
|
@@ -120,3 +120,14 @@ AgnesCode tab 读的是**另一个应用**(AgnesCode 桌面端)已经登录
|
|
|
120
120
|
信号与处置的整张表已迁到 **[TROUBLESHOOTING.md](./TROUBLESHOOTING.md)**(按面板上的**界面原文**索引:面板读不出来、登录被拒、模型目录为空、以及「看着像坏了其实是设计」的清单)。
|
|
121
121
|
|
|
122
122
|
本文件只管装、配、重启;排障从那份进。`shapeWarnings`、`quota.error` 按源降级、「可看图」为空是「读不到」等接口侧含义,那份表指到 [AGNES-API.md](./AGNES-API.md) 与 [ADR.md](./ADR.md),不在此重复。
|
|
123
|
+
|
|
124
|
+
### 6.1 查这台机器的开关生效值(doctor)
|
|
125
|
+
|
|
126
|
+
provider / 出图 / 视频 / AgnesCode 四个开关的生效值存在插件私有状态文件里(`$DSH_HOME/state/<name>/`),不在任何配置或路由上;`npm run doctor` 只读状态文件、不碰凭据,Host 没起也能跑:
|
|
127
|
+
|
|
128
|
+
```powershell
|
|
129
|
+
npm run doctor # 人读:每个 profile 的 provider / draw / video / agnescode 开关与模型清单
|
|
130
|
+
npm run doctor:json # 机器读:JSON(可进你的巡检 / 工单脚本)
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
doctor 的只读范围与实现见 [PITFALLS.md](./PITFALLS.md) §22 与 [ROADMAP.md](./ROADMAP.md) 的落地坐标。
|
|
@@ -2087,28 +2087,73 @@ function agnescodeRequestHeaders() {
|
|
|
2087
2087
|
return { ...AGNESCODE_BASE_HEADERS };
|
|
2088
2088
|
}
|
|
2089
2089
|
/**
|
|
2090
|
-
*
|
|
2091
|
-
*
|
|
2092
|
-
*
|
|
2093
|
-
*
|
|
2094
|
-
*
|
|
2095
|
-
*
|
|
2096
|
-
*
|
|
2097
|
-
*
|
|
2098
|
-
*
|
|
2099
|
-
*
|
|
2100
|
-
*
|
|
2101
|
-
*
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2090
|
+
* Models confirmed on this gateway to CANNOT read an image, in a LIVE probe
|
|
2091
|
+
* with the same picture + question the allow side was measured with (a live
|
|
2092
|
+
* re-probe runs against this set, so the day a gateway routing change makes a
|
|
2093
|
+
* denied model able to see, the baseline turns and the entry comes out).
|
|
2094
|
+
* Membership is a dated measurement, never a design call about the model.
|
|
2095
|
+
*
|
|
2096
|
+
* STARTS EMPTY: nothing about this gateway is known to be blind. An entry is
|
|
2097
|
+
* added only when a user reports a model that cannot see the image (with a
|
|
2098
|
+
* probe that proves it), and it leaves the same way. Until a report lands
|
|
2099
|
+
* here, every untagged row is OFFERED image input by default and labelled
|
|
2100
|
+
* unverified — see the companion verdict below.
|
|
2101
|
+
* @type {ReadonlySet<string>}
|
|
2102
|
+
*/
|
|
2103
|
+
const AGNESCODE_VISION_DENYLIST = Object.freeze(/* @__PURE__ */ new Set([]));
|
|
2104
|
+
/**
|
|
2105
|
+
* Whether an AgnesCode roster row accepts image input, together with how the
|
|
2106
|
+
* verdict was reached.
|
|
2107
|
+
*
|
|
2108
|
+
* The BFF's own `/models` rows declare no modality field (only `model_type:
|
|
2109
|
+
* "text"`), so `fetchAgnescodeCatalog` pins `vision: false` — a raw fact about
|
|
2110
|
+
* what the wire said, NOT a verdict. The verdict is made here. The ladder is
|
|
2111
|
+
* asymmetric on purpose: a false "it can see" (an image sent to a model that
|
|
2112
|
+
* ignores it, HTTP 200, no error anywhere upstream) is worse than a hidden
|
|
2113
|
+
* capability, so the DEFAULT is to offer the entry but SAY it is unverified,
|
|
2114
|
+
* and only a dated live probe may deny it:
|
|
2115
|
+
*
|
|
2116
|
+
* 1. `AGNESCODE_VISION_DENYLIST` wins: a row confirmed blind in a live probe is
|
|
2117
|
+
* not offered image input; `source: "denied"` tells the panel to draw no chip.
|
|
2118
|
+
* 2. A row carrying `vision: true` (a future BFF that starts declaring its own
|
|
2119
|
+
* modality) is `declared`.
|
|
2120
|
+
* 3. The `PROBED_VISION` official-docs table (llm-models.ts) — the Agnes family
|
|
2121
|
+
* the platform already proved — is `measured`.
|
|
2122
|
+
* 4. Otherwise: `assumed` (true). A model the docs table never mentioned is
|
|
2123
|
+
* still offered image input — it does not vanish from the image picker —
|
|
2124
|
+
* and the panel marks it unverified. Reading "absent from `PROBED_VISION`"
|
|
2125
|
+
* as "text-only" is what made every newly-listed gateway model silently
|
|
2126
|
+
* lose the attachment entry.
|
|
2105
2127
|
* @param {object} row - one AgnesCode roster row (must carry `id`).
|
|
2128
|
+
* @returns {object} the verdict and how it was reached.
|
|
2129
|
+
*/
|
|
2130
|
+
function agnescodeVisionVerdict(row) {
|
|
2131
|
+
const id = str(row?.id, "");
|
|
2132
|
+
if (id !== "" && AGNESCODE_VISION_DENYLIST.has(id)) return {
|
|
2133
|
+
vision: false,
|
|
2134
|
+
source: "denied"
|
|
2135
|
+
};
|
|
2136
|
+
if (row?.vision === true) return {
|
|
2137
|
+
vision: true,
|
|
2138
|
+
source: "declared"
|
|
2139
|
+
};
|
|
2140
|
+
if (id !== "" && PROBED_VISION[id] === true) return {
|
|
2141
|
+
vision: true,
|
|
2142
|
+
source: "measured"
|
|
2143
|
+
};
|
|
2144
|
+
return {
|
|
2145
|
+
vision: true,
|
|
2146
|
+
source: "assumed"
|
|
2147
|
+
};
|
|
2148
|
+
}
|
|
2149
|
+
/**
|
|
2150
|
+
* The boolean-only view of {@link agnescodeVisionVerdict}, kept for call sites
|
|
2151
|
+
* and tests that want the capability bit without the provenance.
|
|
2152
|
+
* @param {object} row - one AgnesCode roster row.
|
|
2106
2153
|
* @returns {boolean} whether the row accepts image input.
|
|
2107
2154
|
*/
|
|
2108
2155
|
function agnescodeVisionOf(row) {
|
|
2109
|
-
|
|
2110
|
-
const id = str(row?.id, "");
|
|
2111
|
-
return PROBED_VISION[id] === true;
|
|
2156
|
+
return agnescodeVisionVerdict(row).vision;
|
|
2112
2157
|
}
|
|
2113
2158
|
/**
|
|
2114
2159
|
* The AgnesCode model rows the panel shows and the adapter offers.
|
|
@@ -2128,10 +2173,12 @@ function agnescodeRoster(catalog, maxTokensOverrides) {
|
|
|
2128
2173
|
const multiplier = numZeroOk(row?.multiplier);
|
|
2129
2174
|
const maxOutputLength = agnescodeMaxTokensFor(id, row?.maxOutputLength, maxTokensOverrides);
|
|
2130
2175
|
const displayLabel = str(row?.displayLabel, "");
|
|
2176
|
+
const verdict = agnescodeVisionVerdict(row);
|
|
2131
2177
|
out.push({
|
|
2132
2178
|
id,
|
|
2133
2179
|
name: str(row?.name, id),
|
|
2134
|
-
vision:
|
|
2180
|
+
vision: verdict.vision,
|
|
2181
|
+
visionSource: verdict.source,
|
|
2135
2182
|
memberOnly: row?.memberOnly === true,
|
|
2136
2183
|
...multiplier === void 0 ? {} : { multiplier },
|
|
2137
2184
|
...displayLabel === "" ? {} : { displayLabel },
|
package/lib/index.js
CHANGED
|
@@ -106,7 +106,7 @@ function throttleDir() {
|
|
|
106
106
|
* @param {() => number} now - clock source.
|
|
107
107
|
* @returns {{code: string, parked: boolean, until: number|null, attempt: number}|null}
|
|
108
108
|
*/
|
|
109
|
-
function parse(raw, now) {
|
|
109
|
+
function parse$1(raw, now) {
|
|
110
110
|
if (raw === null || typeof raw !== "object" || Array.isArray(raw)) return null;
|
|
111
111
|
const body = raw;
|
|
112
112
|
const version = num(body.version, 0);
|
|
@@ -119,7 +119,7 @@ function parse(raw, now) {
|
|
|
119
119
|
};
|
|
120
120
|
const migrated = migrateToCurrent(body);
|
|
121
121
|
if (migrated === null) return null;
|
|
122
|
-
return parse({
|
|
122
|
+
return parse$1({
|
|
123
123
|
...migrated,
|
|
124
124
|
version: THROTTLE_VERSION
|
|
125
125
|
}, now);
|
|
@@ -158,7 +158,7 @@ function createFileThrottleStore({ dir = throttleDir(), now = Date.now } = {}) {
|
|
|
158
158
|
const file = join(dir, "throttle.json");
|
|
159
159
|
return {
|
|
160
160
|
async read() {
|
|
161
|
-
return parse(await readStateJson(file), now);
|
|
161
|
+
return parse$1(await readStateJson(file), now);
|
|
162
162
|
},
|
|
163
163
|
async write(state) {
|
|
164
164
|
const temporary = temporaryOf(dir, "throttle.json");
|
|
@@ -201,7 +201,7 @@ function createMemoryThrottleStore(now = Date.now) {
|
|
|
201
201
|
let held = null;
|
|
202
202
|
return {
|
|
203
203
|
async read() {
|
|
204
|
-
return parse(held, now);
|
|
204
|
+
return parse$1(held, now);
|
|
205
205
|
},
|
|
206
206
|
async write(state) {
|
|
207
207
|
held = {
|
|
@@ -2260,6 +2260,171 @@ function createFileAgnescodeModelsStore(options = {}) {
|
|
|
2260
2260
|
};
|
|
2261
2261
|
}
|
|
2262
2262
|
|
|
2263
|
+
//#endregion
|
|
2264
|
+
//#region src/host/agnescode-roster-seen-store.ts
|
|
2265
|
+
/**
|
|
2266
|
+
* dsh-connect-agnes-token-plan — when each AgnesCode roster id was FIRST seen.
|
|
2267
|
+
*
|
|
2268
|
+
* WHY this exists (and why it is a separate file, not `agnescode-store.ts`): the
|
|
2269
|
+
* gateway's catalogue rows carry no "listed since" fact — the model list is the
|
|
2270
|
+
* only signal that "a model is new to this user", and it is knowable only by
|
|
2271
|
+
* diffing today's roster against a roster THIS plugin wrote down. In memory
|
|
2272
|
+
* would do for one process, but the composer pill has to survive a restart to
|
|
2273
|
+
* be worth rendering, so the history lives in a state file of its own (the same
|
|
2274
|
+
* discipline as `agnescode-stats-store.ts`: one concern, one file, one reader).
|
|
2275
|
+
*
|
|
2276
|
+
* Semantics, stated once because two consumers read them:
|
|
2277
|
+
* - the FIRST ever write SEEDS: it stamps the whole roster one window back and
|
|
2278
|
+
* announces nothing new — an upgrade must not tell every existing user the
|
|
2279
|
+
* entire roster is brand new;
|
|
2280
|
+
* - an id that LEAVES the roster is dropped, so a model the gateway re-lists
|
|
2281
|
+
* later counts as new again (a re-listing IS a change the reader may want);
|
|
2282
|
+
* - "new" is a WINDOW, not a tick: an id first seen less than
|
|
2283
|
+
* {@link AGNESCODE_ROSTER_NEW_WINDOW_MS} ago stays new across polls, so the
|
|
2284
|
+
* marker does not vanish between two catalogue reads;
|
|
2285
|
+
* - a roster larger than {@link AGNESCODE_ROSTER_SEEN_MAX_IDS} is a shape
|
|
2286
|
+
* drift: nothing is written or announced for its duration (evicting a live
|
|
2287
|
+
* id would re-announce it next poll and the count would oscillate);
|
|
2288
|
+
* - an unrecognised or foreign-version file reads as "no history" (PITFALLS
|
|
2289
|
+
* §23), but the FIRST write over it is REFUSED, not stomped — the ADR-006
|
|
2290
|
+
* discipline. A caller that cannot write degrades to "no marker", never to a
|
|
2291
|
+
* wrong one.
|
|
2292
|
+
*
|
|
2293
|
+
* The marker is only fed from a LIVE roster: the static fallback table is this
|
|
2294
|
+
* plugin's own text, and diffing it would announce our rows as gateway news.
|
|
2295
|
+
*
|
|
2296
|
+
* @module dsh-connect-agnes-token-plan/agnescode-roster-seen-store
|
|
2297
|
+
*/
|
|
2298
|
+
/** Shape version, bumped when the persisted form changes incompatibly. */
|
|
2299
|
+
const AGNESCODE_ROSTER_SEEN_VERSION = 1;
|
|
2300
|
+
/**
|
|
2301
|
+
* How long a first sighting keeps reading as "new". Seven days: long enough that
|
|
2302
|
+
* a user who opens the panel twice a week still catches it, short enough that a
|
|
2303
|
+
* stale marker cannot outlive the model it announces.
|
|
2304
|
+
*/
|
|
2305
|
+
const AGNESCODE_ROSTER_NEW_WINDOW_MS = 6048e5;
|
|
2306
|
+
/**
|
|
2307
|
+
* The largest roster one file will track — a SHAPE-DRIFT guard, not a queue.
|
|
2308
|
+
* A roster past the cap is read as a broken/looping producer: NOTHING is
|
|
2309
|
+
* written or announced for its duration, and the previous map is kept as-is.
|
|
2310
|
+
*/
|
|
2311
|
+
const AGNESCODE_ROSTER_SEEN_MAX_IDS = 200;
|
|
2312
|
+
/** Where the record lives: the SHARED directory, `$DSH_HOME/state/<plugin>`. */
|
|
2313
|
+
function agnescodeRosterSeenDir() {
|
|
2314
|
+
return stateDir(name);
|
|
2315
|
+
}
|
|
2316
|
+
/**
|
|
2317
|
+
* Read one persisted map, keeping only well-formed entries. A non-numeric stamp
|
|
2318
|
+
* is dropped rather than coerced (a coerced `0` would read as "seen since 1970"
|
|
2319
|
+
* and mark nothing new forever). Never throws.
|
|
2320
|
+
* @param {unknown} raw - the persisted or posted value.
|
|
2321
|
+
* @returns {Record<string, number>} the usable entries (possibly empty).
|
|
2322
|
+
*/
|
|
2323
|
+
function normalizeRosterSeen(raw) {
|
|
2324
|
+
const source = raw !== null && typeof raw === "object" && !Array.isArray(raw) ? raw : {};
|
|
2325
|
+
const seen = {};
|
|
2326
|
+
for (const [id, stamp] of Object.entries(source)) {
|
|
2327
|
+
if (id === "" || typeof stamp !== "number" || !Number.isFinite(stamp) || stamp <= 0) continue;
|
|
2328
|
+
seen[id] = stamp;
|
|
2329
|
+
}
|
|
2330
|
+
return seen;
|
|
2331
|
+
}
|
|
2332
|
+
/**
|
|
2333
|
+
* Keep the map ONLY while the roster is a sane size: a roster past the cap is a
|
|
2334
|
+
* shape drift, so NOTHING is written or announced and the previous map survives.
|
|
2335
|
+
* @param {Record<string, number>} next - this round's map.
|
|
2336
|
+
* @returns {Record<string, number>|null} the map to persist, or `null` to skip.
|
|
2337
|
+
*/
|
|
2338
|
+
function bounded(next) {
|
|
2339
|
+
return Object.keys(next).length <= 200 ? next : null;
|
|
2340
|
+
}
|
|
2341
|
+
/** Is the parsed payload a shape THIS build recognises (a known version)? */
|
|
2342
|
+
function parse(raw) {
|
|
2343
|
+
if (raw === null || typeof raw !== "object" || Array.isArray(raw)) return null;
|
|
2344
|
+
const body = raw;
|
|
2345
|
+
if (body.version !== 1) return null;
|
|
2346
|
+
return { seen: normalizeRosterSeen(body.seen) };
|
|
2347
|
+
}
|
|
2348
|
+
/**
|
|
2349
|
+
* The file-backed first-sighting history.
|
|
2350
|
+
* @param {object} [options] - `{ dir, now }` (a clock source for the tests).
|
|
2351
|
+
* @returns {object} the store.
|
|
2352
|
+
*/
|
|
2353
|
+
function createFileAgnescodeRosterSeenStore({ dir = agnescodeRosterSeenDir(), now = Date.now } = {}) {
|
|
2354
|
+
const file = join(dir, "agnescode-roster-seen.json");
|
|
2355
|
+
const readThrough = async () => {
|
|
2356
|
+
const raw = await readStateJson(file);
|
|
2357
|
+
return {
|
|
2358
|
+
raw: raw === null ? null : raw,
|
|
2359
|
+
parsed: parse(raw)
|
|
2360
|
+
};
|
|
2361
|
+
};
|
|
2362
|
+
/** Persist one map (atomic). Refuses to stomp a foreign-version file (ADR-006). */
|
|
2363
|
+
const persist = async (seen) => {
|
|
2364
|
+
const { raw } = await readThrough();
|
|
2365
|
+
if (raw !== null && parse(raw) === null) return;
|
|
2366
|
+
const body = JSON.stringify({
|
|
2367
|
+
version: 1,
|
|
2368
|
+
seen,
|
|
2369
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
2370
|
+
});
|
|
2371
|
+
const temporary = temporaryOf(dir, "agnescode-roster-seen.json");
|
|
2372
|
+
await ensureStateDir(dir);
|
|
2373
|
+
await writeStateFile(file, body, { temporary });
|
|
2374
|
+
};
|
|
2375
|
+
return {
|
|
2376
|
+
/** The whole first-sighting map. */
|
|
2377
|
+
async seen() {
|
|
2378
|
+
const { parsed } = await readThrough();
|
|
2379
|
+
return parsed?.seen ?? {};
|
|
2380
|
+
},
|
|
2381
|
+
/** Whether this store has ever written a recognisable history. */
|
|
2382
|
+
async isSet() {
|
|
2383
|
+
const { parsed } = await readThrough();
|
|
2384
|
+
return parsed !== null;
|
|
2385
|
+
},
|
|
2386
|
+
/**
|
|
2387
|
+
* Record today's roster and answer which ids still read as new.
|
|
2388
|
+
* @param {string[]} ids - the FULL live roster as the gateway just listed it.
|
|
2389
|
+
* @param {number} [nowMs] - the clock (tests inject it).
|
|
2390
|
+
* @returns {Promise<{newIds: string[]}>} ids first seen inside the window,
|
|
2391
|
+
* oldest first; empty on the seeding write and on a roster with nothing fresh.
|
|
2392
|
+
*/
|
|
2393
|
+
async note(ids, nowMs = now()) {
|
|
2394
|
+
const list = Array.isArray(ids) ? ids.filter((id) => typeof id === "string" && id !== "") : [];
|
|
2395
|
+
const unique = [...new Set(list)];
|
|
2396
|
+
if (unique.length === 0) return { newIds: [] };
|
|
2397
|
+
const nowT = Number.isFinite(nowMs) ? nowMs : now();
|
|
2398
|
+
const { raw, parsed } = await readThrough();
|
|
2399
|
+
if (raw !== null && parsed === null) return { newIds: [] };
|
|
2400
|
+
const previous = parsed?.seen ?? {};
|
|
2401
|
+
const next = {};
|
|
2402
|
+
const seeded = parsed === null && raw === null;
|
|
2403
|
+
for (const id of unique) {
|
|
2404
|
+
const first = previous[id];
|
|
2405
|
+
next[id] = typeof first === "number" && first > 0 ? Math.min(first, nowT) : seeded ? nowT - AGNESCODE_ROSTER_NEW_WINDOW_MS : nowT;
|
|
2406
|
+
}
|
|
2407
|
+
const trimmed = bounded(next);
|
|
2408
|
+
if (trimmed === null) return { newIds: [] };
|
|
2409
|
+
if (seeded || Object.keys(previous).length !== Object.keys(trimmed).length || Object.keys(trimmed).some((id) => previous[id] !== trimmed[id])) await persist(trimmed);
|
|
2410
|
+
return { newIds: seeded ? [] : Object.entries(trimmed).filter(([, first]) => nowT - first < AGNESCODE_ROSTER_NEW_WINDOW_MS).sort((left, right) => left[1] - right[1]).map(([id]) => id) };
|
|
2411
|
+
},
|
|
2412
|
+
/** Forget the history (the next `note` reseeds). */
|
|
2413
|
+
async forget() {
|
|
2414
|
+
const { raw } = await readThrough();
|
|
2415
|
+
if (raw !== null && parse(raw) === null) return;
|
|
2416
|
+
const body = JSON.stringify({
|
|
2417
|
+
version: 1,
|
|
2418
|
+
seen: {},
|
|
2419
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
2420
|
+
});
|
|
2421
|
+
const temporary = temporaryOf(dir, "agnescode-roster-seen.json");
|
|
2422
|
+
await ensureStateDir(dir);
|
|
2423
|
+
await writeStateFile(file, body, { temporary });
|
|
2424
|
+
}
|
|
2425
|
+
};
|
|
2426
|
+
}
|
|
2427
|
+
|
|
2263
2428
|
//#endregion
|
|
2264
2429
|
//#region src/host/switch-precedence.ts
|
|
2265
2430
|
/**
|
|
@@ -5994,7 +6159,7 @@ function readThroughAgnescode(key, cache, inflight, produce) {
|
|
|
5994
6159
|
* @returns {Function} the `off()` unregister callback.
|
|
5995
6160
|
*/
|
|
5996
6161
|
function registerAgnescodeRoute(ctx, wiring) {
|
|
5997
|
-
const { settings, agnescodeStore, agnescodeSwitch, agnescodePublisher, agnescodeModels, cache, inflight, agnescodeFetch } = wiring;
|
|
6162
|
+
const { settings, agnescodeStore, agnescodeSwitch, agnescodePublisher, agnescodeModels, agnescodeRosterSeen, cache, inflight, agnescodeFetch } = wiring;
|
|
5998
6163
|
let lastHarvest = null;
|
|
5999
6164
|
let agnescodeHarvestInFlight = null;
|
|
6000
6165
|
let agnescodeLoginInFlight = null;
|
|
@@ -6067,6 +6232,12 @@ function registerAgnescodeRoute(ctx, wiring) {
|
|
|
6067
6232
|
const publisherState = agnescodePublisher?.state ?? null;
|
|
6068
6233
|
const enabledModelIds = agnescodeModels !== null && agnescodeModels !== void 0 ? await agnescodeModels.listEnabledIds().catch(() => []) : [];
|
|
6069
6234
|
const { usage, ...rateLimit } = await agnescodeStats.read();
|
|
6235
|
+
let newModelIds;
|
|
6236
|
+
if (liveRoster && agnescodeRosterSeen !== null && agnescodeRosterSeen !== void 0) {
|
|
6237
|
+
const offered = roster.map((r) => r.id).filter((id) => typeof id === "string" && id !== "");
|
|
6238
|
+
const noted = await agnescodeRosterSeen.note(offered);
|
|
6239
|
+
if (noted.newIds.length > 0) newModelIds = noted.newIds;
|
|
6240
|
+
}
|
|
6070
6241
|
return {
|
|
6071
6242
|
ok: true,
|
|
6072
6243
|
enabled: effectiveEnabled,
|
|
@@ -6083,6 +6254,7 @@ function registerAgnescodeRoute(ctx, wiring) {
|
|
|
6083
6254
|
models: roster,
|
|
6084
6255
|
modelsSource: liveRoster ? "live" : "fallback",
|
|
6085
6256
|
...liveRoster ? {} : { modelsAsOf: AGNESCODE_FALLBACK_ASOF },
|
|
6257
|
+
...newModelIds !== void 0 ? { newModelIds } : {},
|
|
6086
6258
|
enabledModelIds,
|
|
6087
6259
|
providerRegistered: publisherState?.registered === true,
|
|
6088
6260
|
...publisherState?.error !== null && publisherState?.error !== void 0 ? { providerError: publisherState.error } : {},
|
|
@@ -7760,6 +7932,7 @@ function apply(ctx, config = {}, deps = {}) {
|
|
|
7760
7932
|
const agnescodeStore = createAgnescodeStore({ credentials: () => ctx.get("credentials") ?? null });
|
|
7761
7933
|
const agnescodeSwitch = createFileAgnescodeStore({ profile });
|
|
7762
7934
|
const agnescodeModels = createFileAgnescodeModelsStore({ profile });
|
|
7935
|
+
const agnescodeRosterSeen = createFileAgnescodeRosterSeenStore();
|
|
7763
7936
|
const { publisher: agnescodePublisher, seed: agnescodeSeed } = wireAgnescodePublisher({
|
|
7764
7937
|
store: agnescodeStore,
|
|
7765
7938
|
panelSwitch: () => agnescodeSwitch.enabled().catch(() => null),
|
|
@@ -7806,6 +7979,7 @@ function apply(ctx, config = {}, deps = {}) {
|
|
|
7806
7979
|
agnescodeStore,
|
|
7807
7980
|
agnescodeSwitch,
|
|
7808
7981
|
agnescodeModels,
|
|
7982
|
+
agnescodeRosterSeen,
|
|
7809
7983
|
agnescodePublisher,
|
|
7810
7984
|
agnescodeFetch: deps.agnescodeFetch ?? ((url, options) => fetch(url, options))
|
|
7811
7985
|
};
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "dsh-connect-agnes-token-plan",
|
|
3
3
|
"displayName": "DSH Connect Agnes Token Plan",
|
|
4
4
|
"icon": "./icon.svg",
|
|
5
|
-
"version": "0.13.
|
|
5
|
+
"version": "0.13.2",
|
|
6
6
|
"description": "One-tap connect Agnes language, image and video models into DSH (off by default), with image recognition and thinking level filled in automatically. After signing in to the Agnes console (re-login uses AGNES_PASSWORD), you can see the quota windows (5-hour requests, weekly requests, daily images, video), account-wide cumulative usage, and a usage pill beside the input box. AgnesCode desktop models can be connected too (Windows only), re-reading the desktop app login when the token expires, with rate-limit hits backing off on their own.",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"dsh-plugin",
|