dsh-github-copilot 0.4.0-alpha.87 → 0.4.0-alpha.91
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/AGENTS.md +3 -0
- package/CHANGELOG.md +12 -0
- package/README.md +109 -406
- package/README.zh.md +109 -417
- package/deployment-baseline.json +8 -1
- package/docs/agent-readiness.md +5 -0
- package/docs/auto-task-routing.md +79 -2
- package/docs/automatic-model-routing.md +168 -379
- package/docs/copilot-compaction.md +8 -0
- package/docs/copilot-usage.md +7 -9
- package/docs/dual-model.md +60 -46
- package/docs/image-input-compatibility.md +50 -79
- package/docs/images/copilot-model-preferences.png +0 -0
- package/docs/images/copilot-search-routing.png +0 -0
- package/docs/model-compatibility-acceptance.md +41 -0
- package/docs/npm-distribution.md +129 -178
- package/docs/official-first-016-alpha2.md +4 -0
- package/docs/official-first-020-rc1.md +4 -0
- package/docs/session-search-routing.md +123 -65
- package/docs/single-route-migration.md +112 -97
- package/lib/client.js +71 -17
- package/lib/client.js.map +1 -1
- package/lib/index.js +243 -45
- package/lib/remote.js +40 -1
- package/lib/types/auto-assessment-evidence.d.ts +46 -0
- package/lib/types/auto-model-host.d.ts +2 -2
- package/lib/types/auto-selection-explanation.d.ts +1 -0
- package/lib/types/auto-task-assessment.d.ts +5 -3
- package/lib/types/auto-task-classifier.d.ts +3 -1
- package/lib/types/pre-step-pressure.d.ts +8 -0
- package/lib/types/turn-selection.d.ts +26 -1
- package/package.json +1 -1
|
@@ -4,112 +4,127 @@
|
|
|
4
4
|
|
|
5
5
|
## Result and boundaries
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
7
|
+
One Host-owned OAuth account supplies many account models. The stable managed
|
|
8
|
+
route ID is `github-copilot-preview`, displayed as **GitHub Copilot**.
|
|
9
|
+
Fresh installations need no native provider definition. Upgrades preserve
|
|
10
|
+
existing `llm-pi-ai.providers.github-copilot`; two real groups can remain until
|
|
11
|
+
explicit migration. This is configuration removal, not hiding a card.
|
|
12
|
+
|
|
13
|
+
Native Add/Save can recreate another group. The warning is additive, not
|
|
14
|
+
single-route enforcement; Core Edit/Delete remains. Model discovery/UI lifecycle
|
|
15
|
+
is described in the [current README](../README.md#install-and-sign-in), not a
|
|
16
|
+
prerequisite to removing a route.
|
|
17
|
+
|
|
18
|
+
Keep `llm-pi-ai` and authorization mounted and preserve the sole credential
|
|
19
|
+
record `llm-pi-ai/github-copilot`. Do not sign out, delete credentials or remove
|
|
20
|
+
authorization to hide a group. `models: []` can mean the default catalog, not
|
|
21
|
+
disabled models.
|
|
22
|
+
|
|
23
|
+
Plugin code never auto-migrates settings, selections or histories. Installation,
|
|
24
|
+
real requests, Session/default changes, configuration edits and Host interruption
|
|
25
|
+
need their own explicit approvals. Public `session.selectModel` also writes the
|
|
26
|
+
future global default: other selected/history-backed Sessions keep their context,
|
|
27
|
+
but unselected empty Sessions may inherit it.
|
|
28
|
+
|
|
29
|
+
## Read-only readiness and maintenance scope
|
|
30
|
+
|
|
31
|
+
Use no-argument `githubCopilot.migrationStatus()` for fresh live-Agent evidence,
|
|
32
|
+
not stale generic `session/list` or an unversioned inventory. It reports:
|
|
33
|
+
|
|
34
|
+
| Field | Interpretation |
|
|
35
|
+
|---|---|
|
|
36
|
+
| `plugin.name/version`, `protocolVersion: 1`, `observedAt` | Loaded build's structural self-report, not full Desktop/Core byte attestation |
|
|
37
|
+
| `capabilities` | `agentsList`, `sessionProjections`, `settingsCas`, `providerRegistry`, `defaultSelection` |
|
|
38
|
+
| `complete.sessions/defaultSelection/routes` | Observation completeness; missing/false is unknown, not safe absence |
|
|
39
|
+
| `effectiveSelection` / `selectionSource` | Pending projection, then request-header config, then default only for genuinely empty Sessions with known projection state |
|
|
40
|
+
| `activeRequestSelection` | Latest recorded header, not proven in-flight model work; idle usually null |
|
|
41
|
+
| Native effective configuration and native/managed registration | Separate facts, never infer one from the other |
|
|
42
|
+
|
|
43
|
+
This read uses no auth/discovery, credentials or network and writes no settings
|
|
44
|
+
or Sessions. `historyScope: live-agents-only` excludes cold stored conversations.
|
|
45
|
+
Operators must acknowledge that old conversations may need explicit selection
|
|
46
|
+
when resumed. The observation is not an atomic cross-namespace transaction;
|
|
47
|
+
recheck immediately before CAS.
|
|
48
|
+
|
|
49
|
+
The planned `cloga/dsh-windows-ops` command
|
|
50
|
+
`tools/migrate-copilot-managed-route.ps1` is separate **config-only v1**
|
|
51
|
+
maintenance. This guide does not attest its publication or execution. It does
|
|
52
|
+
not select Sessions/defaults, scan cold history, install/restart DSH or certify a
|
|
53
|
+
Desktop baseline. Resolve approved selection blockers separately.
|
|
34
54
|
|
|
35
55
|
## Review before removal
|
|
36
56
|
|
|
37
|
-
1.
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
57
|
+
1. Verify an absence-preserving published plugin is installed **and loaded**,
|
|
58
|
+
with matching Host/Client. Older code may recreate the profile. A version
|
|
59
|
+
declaration or screenshot is not loaded-runtime evidence.
|
|
60
|
+
2. Ensure discovery and accepted managed models. Use visible Retry or intentional
|
|
61
|
+
Refresh, not repeated sign-in/disabled validation. Metadata is not transport
|
|
62
|
+
proof; a real test request needs separate approval.
|
|
63
|
+
3. Deliberately select only approved Sessions/defaults. Preserve model/effort
|
|
64
|
+
only if actually supported. Review paused histories, presets/task references
|
|
65
|
+
without bulk rewrites. Confirm selections before removing their old route.
|
|
66
|
+
4. Review configuration source, effective base layers, namespace revision and
|
|
67
|
+
ownership journals. Inherited configuration, ambiguity or another writer
|
|
68
|
+
blocks removal. Never delete journals or patch Core to force it.
|
|
69
|
+
|
|
70
|
+
Keep the existing profile if any prerequisite is uncertain.
|
|
44
71
|
|
|
45
72
|
## Apply the reviewed Ops migration after release
|
|
46
73
|
|
|
47
|
-
1.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
74
|
+
1. Recheck readiness/capabilities/completeness and approved selections. Obtain the
|
|
75
|
+
cold-history acknowledgement. Any Host interruption needs separate approval.
|
|
76
|
+
2. Take a private settings-only backup outside Git/shared docs. Do not copy or
|
|
77
|
+
disclose OAuth credentials. Check current user-native profile/base/journal.
|
|
78
|
+
3. CAS-remove only the reviewed user-native
|
|
79
|
+
`llm-pi-ai.providers.github-copilot` path against the observed revision.
|
|
80
|
+
Preserve the mount/section, credentials, companion and all other provider
|
|
81
|
+
fields. Conflict/already-absent is not permission for blind retry.
|
|
82
|
+
4. Read persisted/effective settings and actual registry, then composer and
|
|
83
|
+
`/model`. Report one managed group only when canonical registration is truly
|
|
84
|
+
absent and no other layer supplies it. A hidden card/write success is not enough.
|
|
85
|
+
5. Separately review any nonempty search `providers` allowlist. An approved
|
|
86
|
+
replacement of the legacy entry with `github-copilot-preview` preserves other
|
|
87
|
+
entries; never clear/broaden automatically.
|
|
88
|
+
6. Verify credentials, approved selections/default and other histories separately.
|
|
89
|
+
`route: not-configured` is optional canonical absence, not login failure or
|
|
90
|
+
proof of a successful model/search call.
|
|
91
|
+
|
|
92
|
+
A stuck **Deleting…** dialog proves neither removal nor its failure. Do not
|
|
93
|
+
repeat deletion; review persisted state after an authorized stop.
|
|
55
94
|
|
|
56
95
|
## History, search and rollback
|
|
57
96
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
## 中文操作说明
|
|
64
|
-
|
|
65
|
-
### 目标与限制
|
|
66
|
-
|
|
67
|
-
**V3 目标:**一个全局 Copilot 账号、多个共享账号模型,已显式选择/有历史选择的 Session 独立。插件代码不自动迁移配置、不强制唯一注册;实际只保留托管路由是发布后获准的 Ops 步骤:操作者先单独处理批准的 Session/默认值选择,仅配置 v1 维护再按 CAS 移除审核过的 user-native profile 并回读 registry。维护命令不写 Session/默认选择。禁止批量改写历史/设置/凭据或隐藏分组。
|
|
97
|
+
Managed IDs remain stable. No transparent canonical alias/history conversion is
|
|
98
|
+
created. Resumed canonical conversations need an explicit supported selection,
|
|
99
|
+
or preservation/restoration of their original route. Search keeps its existing
|
|
100
|
+
[initiator, metadata, allowlist and proof boundaries](./session-search-routing.md);
|
|
101
|
+
removing canonical does not turn managed chat into custom inline transport.
|
|
68
102
|
|
|
69
|
-
|
|
103
|
+
For rollback, stop the relevant Host with permission and compare fresh settings
|
|
104
|
+
with the private backup. Restore only reviewed canonical fields and approved
|
|
105
|
+
selection changes, never overwrite unrelated later edits. Keep ambiguous
|
|
106
|
+
journals for review. Restart with approval and verify registration, credentials
|
|
107
|
+
and selections separately; this is not model-call proof. Older plugin rollback
|
|
108
|
+
may recreate canonical, not a second account.
|
|
70
109
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
正常发现无需手工定义模型或常规手动刷新;公开 slot 仍不能替换 Core **Edit/Delete**,原生编辑器保留。显式界面登录/切换账号成功后强制发现一次;打开 Models 会另外通过非强制 `ensureModels()` 确保缺失/idle/过期/error/loading的已登录元数据,error 重开可在共享冷却结束后重试,但无同次挂载循环;loading 加入已有 Host 请求,不增加网络请求。新鲜 ready 不拉取,真正 unavailable 且空模型不自动重试。状态/详情本身仍无网络。`github-copilot` 默认 `accountModelTtlMs: 86400000`(24 小时最大复用)、`accountModelFailureCooldownMs: 300000`(5 分钟失败冷却),Host 合并为一个在途发现,不设周期元数据轮询;另有挂载期间每 60 秒更新相对时间文字的纯显示定时器,不调用 RPC/status/discovery。后台凭据/reset 事件清状态并只读查询,不对每个 token 事件强制发现;下次打开/使用再确保元数据。
|
|
74
|
-
|
|
75
|
-
alpha.7 的上次成功时间(`snapshot.discoveredAt`)只在模型数量旁、**Manage** 外显示一次:相对文字为英文,tooltip 和可访问语义 `time` 提供完整本地日期、时间及时区。缺失/无效/无账号时隐藏,未来时间显示绝对值。等待/失败保留上次成功时间,刷新成功才更新,退出登录清除;时间消失或卸载时清理显示定时器。缓存和发现生命周期不变。
|
|
76
|
-
|
|
77
|
-
同账号旧元数据可在 TTL 刷新/loading/error 时展示,但不能授权请求。凭据/账号/权限失效或 proof 到期立即撤销证据,TTL 不延长 token。明确 `UNKNOWN_MODEL` 只触发一次有界元数据刷新,不重放消息或切换模型;普通 HTTP/网络错误不能猜成模型不存在。新模型仍需支持的账号元数据。README 截图只提供合成展示证据;Host TTL/冷却时序需单元测试,不能靠截图证明。
|
|
78
|
-
|
|
79
|
-
升级不会自动删除已有 `llm-pi-ai.providers.github-copilot`。只有用户真正移除经过审核的旧配置后,composer 与 `/model` 才都会只列出托管 Copilot 分组,不是仅隐藏第二条路由。始终保留 `llm-pi-ai` 插件、授权服务和唯一 OAuth record `llm-pi-ai/github-copilot`;不要退出登录、删除凭据或卸载授权插件来隐藏分组,也不要用 `models: []` 冒充禁用。
|
|
80
|
-
|
|
81
|
-
安装、真实测试请求、默认模型/会话选择修改、停止 Host 和离线配置修改都需要各自明确授权。本文不是自动执行这些操作的许可。
|
|
82
|
-
|
|
83
|
-
### 只读就绪检查与维护范围(alpha.9)
|
|
84
|
-
|
|
85
|
-
使用无参数 `githubCopilot.migrationStatus()` 新鲜读取所有 live Agent Session,而不是依赖可能过时的通用 `session/list` 或不含加载版本的 inventory。结果提供加载构建 `plugin.name/version`、`protocolVersion: 1`、`observedAt`、五个 `capabilities` 标记(`agentsList`、`sessionProjections`、`settingsCas`、`providerRegistry`、`defaultSelection`)及 sessions/default/routes 的 `complete` 标记。缺失能力、false 完整性或必要选择/路由证据为 null 表示未知,不能推断安全缺失;idle Agent 的 `activeRequestSelection: null` 是正常值。
|
|
86
|
-
|
|
87
|
-
`effectiveSelection` 优先 pending projection,其次 request-header config;只有 projection 已知、确实无 pending/header 的空 live Session 才取默认值,`selectionSource` 表明来源。running Agent 的 `activeRequestSelection` 另报最近记录的 header,不证明 LLM 调用正在进行。路由标记区分有效 native 配置与 native/managed 注册。方法不执行 auth status/发现、不访问凭据/网络、不修改 settings/Session,也不新增常规界面。
|
|
88
|
-
|
|
89
|
-
协议 v1 的 `historyScope: live-agents-only` 不扫描冷存储历史,操作者必须确认知悉旧对话恢复时可能需要显式重选模型。加载版本/结构能力自报告不是完整 Desktop/Core 字节核验,也不是跨 namespace 原子事务;CAS 前立即复查。
|
|
90
|
-
|
|
91
|
-
`cloga/dsh-windows-ops` 计划的 `tools/migrate-copilot-managed-route.ps1` 是插件发布后独立的**仅配置 v1 维护**:不自动写 Session/默认值、不读冷历史、不安装/重启 DSH、不验收完整 Desktop 基线。若有选择阻塞,须先另行授权、手工处理;计划路径不表示命令已发布/安装或真实迁移已经完成。
|
|
92
|
-
|
|
93
|
-
### 移除前审核
|
|
94
|
-
|
|
95
|
-
1. **先实际运行新版本。** 确认目标 `0.4.0-alpha.9` 中保留 canonical 缺失的插件已在活动 profile 加载,Host 与 Client 匹配。provider 集成界面不要求执行这项可选路由移除。使用已发布且校验通过的制品;计划版本和磁盘安装都不是已发布/已加载的证明。旧版本可能在启动、登录或认证刷新时重建被删 profile,不能先删除再期待旧进程保留缺失。
|
|
96
|
-
2. **验证发现结果。** 打开 Models 确认登录,等待按需自动 ensure 完成,检查目标模型是否在 `github-copilot-preview` 的接受列表及能力警告中。错误可点 **Retry**;有意强制更新时使用 **Manage → Refresh models**。元数据成功不等于真实调用成功;可选测试请求须明确批准,正常消耗供应方资源,结果单独报告。不要重复登录或关闭校验强行恢复模型。
|
|
97
|
-
3. **有意迁移选择。** 只为明确批准迁移的 Session 选择托管模型,再确认获准的未来默认值。Core `session.selectModel` 也会保存该默认值,不能假设未选择的空会话不受影响。只有账号明确公布且 SDK 支持时才保留同一模型 ID/思考强度;否则请用户选择,不猜测替代项。检查 preset、定时任务和暂停会话的 canonical 引用,逐项审核未来选择,不批量改写历史、回放、来源记录或 preset 文件。
|
|
98
|
-
4. **检查所有权与并发。** 若 base composition/其它配置层仍提供 canonical profile,存在 journal 冲突,或其它进程正在编辑 settings,停止并审核。不强删 marker,不覆盖继承配置,不修改 Core。旧 journal 的精确恢复流程仍需保留其安全检查。
|
|
99
|
-
|
|
100
|
-
### 发布后执行明确批准的 Ops 迁移
|
|
101
|
-
|
|
102
|
-
1. 经批准安装并实际加载已发布插件;调用 `migrationStatus()` 检查协议/版本、必要能力与完整性,未知证据阻止维护。记录当前 Session 选择及未来默认值;如有获准的选择阻塞,在仅配置 v1 之外手工处理后再次查询。取得冷历史范围确认;命令不写这些选择。若需要中断 Host,仍须另行批准并检查活动会话。
|
|
103
|
-
2. 仅将设置私密备份到用户批准、Git/共享文档之外的位置,不打印/上传,不读取或复制 OAuth 凭据。检查当前 user-native profile、namespace revision、有效 base 层及所有权 journal;有继承配置、journal 歧义或并发变更则停止。
|
|
104
|
-
3. 通过已审核的公开 settings 路径,按读取到的 revision 做 **compare-and-swap(CAS)**,只移除 user-native **`llm-pi-ai.providers.github-copilot`**。保留 `llm-pi-ai` 挂载/section、companion 设置、凭据、其它 provider 和用户字段。冲突或路径已不存在时不盲重试,不整份改写设置、不删 journal、不改 Core。
|
|
105
|
-
4. 回读持久化/有效设置及真实 provider registry,再检查 composer 与 `/model`。只有 canonical 注册确实消失、其它层也不提供时,才能报告只剩托管分组;隐藏卡片或写入成功本身不够。冷启动 `listModels()` 可直接确保共享发现,无需先打开 Settings。
|
|
106
|
-
5. 单独审核 hosted-search 非空 `providers` allowlist。经批准,Ops 可将审核过的旧 route 条目改为 `github-copilot-preview`,保留无关条目;不得隐式清空或扩大列表。插件代码不会代做迁移。
|
|
107
|
-
6. 确认凭据仍已配置、获准 Session/默认值符合审核、其它已选/历史会话及历史保持原样。公开 `session.selectModel` 同时保存未来默认值,未选择的空会话可能继承它。`route: not-configured` 仅表示可选 canonical 缺失,不证明发现/模型/搜索调用成功。
|
|
108
|
-
|
|
109
|
-
### 历史、搜索与回退
|
|
110
|
-
|
|
111
|
-
旧 `github-copilot-preview` ID 保持不变。canonical 历史不改写,也不会被自动别名映射;仍选旧路由的暂停会话恢复时须显式选择支持的托管模型。如果必须继续原路由,应暂缓移除或恢复其 profile,不能宣称旧路由仍无缝可用。
|
|
112
|
-
|
|
113
|
-
托管普通对话交给原生 adapter;`ctx.web` 托管搜索仍只支持通过账号元数据/probe/allowlist 检查的 Responses 模型,按捕获的发起 Session 有效 request-header/config 或显式 `GenerateOptions` 与独立 owner plan 处理,不用全局默认值。`Agent.options` 仅是激活 seed,不是已选模型证据;无可证明的请求上下文时传统搜索不可用,新选择尚未发起下一请求时不能拿旧 header 当当前 prompt 指引;冷启动先确保共享元数据。缺少 `agents.currentInitiator` 时传统搜索不可用,显式带标记请求仍受既有检查保护。首次发现中的 OAuth 通知可能让该次搜索在 probe/wire 前保守失败,之后用户/driver 可以重新请求,不自动重试。自定义 inline 只用于仍配置的旧 canonical 路由,删除旧路由不会把托管对话变成旧 inline 路径。
|
|
110
|
+
## 中文操作说明
|
|
114
111
|
|
|
115
|
-
|
|
112
|
+
新安装无需原生 provider;升级保留已有 canonical 配置,两组都是真实路由,
|
|
113
|
+
不是两个账号。迁移只在明确批准后移除审核过的
|
|
114
|
+
`llm-pi-ai.providers.github-copilot`;唯一凭据、`llm-pi-ai`、授权服务及其它配置保留。
|
|
115
|
+
不要退出登录、删除凭据或使用 `models: []` 来隐藏分组。
|
|
116
|
+
|
|
117
|
+
先验证发布版本已实际加载,再调用无参数 `githubCopilot.migrationStatus()`。
|
|
118
|
+
版本、能力或完整性未知就停止;它只覆盖 live Agent,不扫描冷历史,也不调用
|
|
119
|
+
凭据/发现/网络。最新 header 不等于正在推理,结构自报不等于完整字节证明。
|
|
120
|
+
拟议 Ops 命令仅做配置维护,本文不证明其已发布、已执行或迁移已完成。
|
|
121
|
+
|
|
122
|
+
单独批准 Session/未来默认值选择、真实测试请求、配置写入与停止/重启。
|
|
123
|
+
`session.selectModel` 同时修改未来默认值,未选择的空 Session 可能继承;
|
|
124
|
+
其它已选/历史 Session 不批量改写。恢复旧 canonical 会话时可能需显式选择支持的
|
|
125
|
+
托管模型,不能承诺透明续接。
|
|
126
|
+
|
|
127
|
+
检查 base 层和 journal,私密备份设置但不复制 OAuth。写入前重新查询,
|
|
128
|
+
按 revision 做窄路径 CAS;冲突不盲重试。回读持久化/有效配置、真实 registry、
|
|
129
|
+
composer 与 `/model`,才能确认单组。搜索 allowlist 修改另行审核,不隐式扩大。
|
|
130
|
+
回退仅恢复获准字段,不用整份备份覆盖后来改动;注册恢复仍不证明模型调用成功。
|
package/lib/client.js
CHANGED
|
@@ -5645,6 +5645,44 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5645
5645
|
}))
|
|
5646
5646
|
};
|
|
5647
5647
|
//#endregion
|
|
5648
|
+
//#region lib/types/auto-assessment-evidence.js
|
|
5649
|
+
const milliseconds = number().int().min(0).max(Number.MAX_SAFE_INTEGER);
|
|
5650
|
+
const SemanticAssessmentEvidenceSchema = object({
|
|
5651
|
+
modelId: string().min(1).max(200).regex(/^[A-Za-z0-9][A-Za-z0-9._:/-]*$/u).optional(),
|
|
5652
|
+
budgetMs: milliseconds.refine((value) => value > 0),
|
|
5653
|
+
elapsedMs: milliseconds,
|
|
5654
|
+
stage: _enum([
|
|
5655
|
+
"preparing",
|
|
5656
|
+
"model-selected",
|
|
5657
|
+
"adapter-started",
|
|
5658
|
+
"text-received",
|
|
5659
|
+
"finished"
|
|
5660
|
+
]),
|
|
5661
|
+
adapterStartedMs: milliseconds.optional(),
|
|
5662
|
+
firstTextMs: milliseconds.optional(),
|
|
5663
|
+
nativeFinish: _enum(["stop", "non-stop"]).optional(),
|
|
5664
|
+
outputCharacters: number().int().min(0).max(2049),
|
|
5665
|
+
validation: _enum([
|
|
5666
|
+
"not-validated",
|
|
5667
|
+
"valid",
|
|
5668
|
+
"invalid",
|
|
5669
|
+
"context-omitted"
|
|
5670
|
+
])
|
|
5671
|
+
}).strict().superRefine((value, ctx) => {
|
|
5672
|
+
if (value.adapterStartedMs !== void 0 && value.adapterStartedMs > value.elapsedMs || value.firstTextMs !== void 0 && (value.adapterStartedMs === void 0 || value.firstTextMs < value.adapterStartedMs || value.firstTextMs > value.elapsedMs)) ctx.addIssue({
|
|
5673
|
+
code: "custom",
|
|
5674
|
+
message: "Inconsistent assessment timing"
|
|
5675
|
+
});
|
|
5676
|
+
if (value.stage === "model-selected" && value.modelId === void 0 || [
|
|
5677
|
+
"adapter-started",
|
|
5678
|
+
"text-received",
|
|
5679
|
+
"finished"
|
|
5680
|
+
].includes(value.stage) && value.adapterStartedMs === void 0 || value.stage === "text-received" && value.firstTextMs === void 0 || value.stage === "finished" && value.nativeFinish === void 0 || value.nativeFinish !== void 0 && value.stage !== "finished" || value.outputCharacters > 0 && value.firstTextMs === void 0 || value.firstTextMs !== void 0 && value.outputCharacters === 0) ctx.addIssue({
|
|
5681
|
+
code: "custom",
|
|
5682
|
+
message: "Inconsistent assessment phase"
|
|
5683
|
+
});
|
|
5684
|
+
});
|
|
5685
|
+
//#endregion
|
|
5648
5686
|
//#region lib/types/turn-selection.js
|
|
5649
5687
|
const ExplanationSchema = object({
|
|
5650
5688
|
assessment: object({
|
|
@@ -5672,7 +5710,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5672
5710
|
"timeout",
|
|
5673
5711
|
"failed",
|
|
5674
5712
|
"context-omitted"
|
|
5675
|
-
]).optional()
|
|
5713
|
+
]).optional(),
|
|
5714
|
+
semantic: SemanticAssessmentEvidenceSchema.optional()
|
|
5676
5715
|
}).strict(),
|
|
5677
5716
|
targetCategory: _enum([
|
|
5678
5717
|
"powerful",
|
|
@@ -6332,22 +6371,37 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6332
6371
|
"context-omitted": zh ? "判断上下文不完整" : "incomplete assessment context",
|
|
6333
6372
|
"insufficient-evidence": zh ? "本地规则尚不能确定任务需求" : "local rules cannot establish task demand"
|
|
6334
6373
|
};
|
|
6374
|
+
const conclusion = explanation.method === "no-fit" ? zh ? "没有候选能直接容纳估算输入;选中输入预算最大的模型,保留原生压缩或失败处理。" : "No candidate fits the estimated input. Selected the largest input budget for native recovery or failure." : explanation.fallback ? zh ? `目标分类 ${category[explanation.targetCategory]} 没有合格的可容纳候选,回退到 ${category[explanation.selectedCategory]}。` : `No eligible fitting ${category[explanation.targetCategory]} candidate; fell back to ${category[explanation.selectedCategory]}.` : explanation.assessment.diagnostic === "timeout" && explanation.assessment.demand === "unknown" ? zh ? `任务难度判断超时,需求仍不确定;按当前偏好兜底选择 ${category[explanation.selectedCategory]}。` : `Task assessment timed out; demand remains uncertain. The preference policy selected ${category[explanation.selectedCategory]} as a fallback.` : zh ? `本轮判断为${demand[explanation.assessment.demand]};按当前偏好选择 ${category[explanation.selectedCategory]} 类模型。` : `This task was assessed as ${demand[explanation.assessment.demand]}; the preference policy selected ${category[explanation.selectedCategory]}.`;
|
|
6375
|
+
const choice = explanation.method === "continuity" ? zh ? "上一轮模型仍满足本轮分类和输入要求,因此保持它。" : "Kept the previous model because it still meets this turn’s category and input requirements." : explanation.method === "only-candidate" ? zh ? "该分类只有一个可容纳的合格候选。" : "Only one eligible fitting candidate remains in this category." : explanation.method === "equal-distribution" ? zh ? `该分类有 ${explanation.categoryCandidateCount} 个可容纳候选;按本轮稳定等权规则选中,不代表质量排名。` : `Selected among ${explanation.categoryCandidateCount} fitting category candidates by stable equal-weight allocation, not a quality ranking.` : zh ? "所有候选均不适配;这不是成功的偏好匹配。" : "All candidates are oversized; this is not a successful preference match.";
|
|
6376
|
+
const diagnostic = explanation.assessment.diagnostic === void 0 ? void 0 : explanation.assessment.diagnostic === "disabled" ? zh ? "语义判断实验未开启;这是本地规则的判断边界,不代表会话没有上下文。" : "Semantic assessment is disabled; this is a limit of local rules, not proof that the conversation lacks context." : explanation.assessment.diagnostic === "timeout" ? zh ? "辅助判断未在等待预算内完成,不代表正式回答超时或任务简单;本轮保留需求不确定,再按偏好策略选模。" : "The auxiliary assessment did not complete within its waiting budget. This is not a timeout of the main answer or evidence of simplicity; selection used the unknown-demand preference policy." : zh ? `语义判断未提供完整可用依据(${{
|
|
6377
|
+
unavailable: "没有可用分类模型",
|
|
6378
|
+
"invalid-result": "结果无效",
|
|
6379
|
+
timeout: "超时",
|
|
6380
|
+
failed: "请求失败",
|
|
6381
|
+
"context-omitted": "上下文不完整"
|
|
6382
|
+
}[explanation.assessment.diagnostic]});未将失败当作简单任务。` : `Semantic assessment did not provide complete usable evidence (${{
|
|
6383
|
+
unavailable: "no classifier available",
|
|
6384
|
+
"invalid-result": "invalid result",
|
|
6385
|
+
timeout: "timeout",
|
|
6386
|
+
failed: "request failed",
|
|
6387
|
+
"context-omitted": "incomplete context"
|
|
6388
|
+
}[explanation.assessment.diagnostic]}); failure was not treated as simplicity.`;
|
|
6389
|
+
const evidence = explanation.assessment.semantic;
|
|
6335
6390
|
return {
|
|
6336
|
-
conclusion
|
|
6337
|
-
choice
|
|
6338
|
-
diagnostic
|
|
6339
|
-
|
|
6340
|
-
"
|
|
6341
|
-
|
|
6342
|
-
|
|
6343
|
-
"context-omitted": "
|
|
6344
|
-
}[
|
|
6345
|
-
|
|
6346
|
-
|
|
6347
|
-
|
|
6348
|
-
|
|
6349
|
-
|
|
6350
|
-
}[explanation.assessment.diagnostic]}); failure was not treated as simplicity.`,
|
|
6391
|
+
conclusion,
|
|
6392
|
+
choice,
|
|
6393
|
+
diagnostic,
|
|
6394
|
+
semantic: evidence === void 0 ? void 0 : zh ? `辅助分类模型:${evidence.modelId ?? "未选定"}。判断总耗时 ${evidence.elapsedMs} ms,等待预算 ${evidence.budgetMs} ms。${evidence.adapterStartedMs === void 0 ? "尚未开始适配器调用。" : `适配器调用始于 ${evidence.adapterStartedMs} ms。`}${evidence.firstTextMs === void 0 ? "未观察到文本输出。" : `首次文本输出于 ${evidence.firstTextMs} ms。`}${evidence.nativeFinish === void 0 ? "未观察到原生结束。" : evidence.nativeFinish === "stop" ? "观察到原生正常结束。" : "观察到原生非正常结束。"}结果校验:${{
|
|
6395
|
+
"not-validated": "未完成",
|
|
6396
|
+
valid: "通过",
|
|
6397
|
+
invalid: "无效",
|
|
6398
|
+
"context-omitted": "通过格式校验,但上下文省略阻止降级"
|
|
6399
|
+
}[evidence.validation]}。这些是辅助判断阶段,不证明网络或模型慢的具体原因,也不是正式回答的 Usage。` : `Auxiliary classifier: ${evidence.modelId ?? "not selected"}. Assessment total ${evidence.elapsedMs} ms; budget ${evidence.budgetMs} ms. ${evidence.adapterStartedMs === void 0 ? "Adapter call not started." : `Adapter call started at ${evidence.adapterStartedMs} ms.`} ${evidence.firstTextMs === void 0 ? "No text output observed." : `First text at ${evidence.firstTextMs} ms.`} ${evidence.nativeFinish === void 0 ? "No native finish observed." : evidence.nativeFinish === "stop" ? "Native stop observed." : "Native non-stop finish observed."} Result validation: ${{
|
|
6400
|
+
"not-validated": "not completed",
|
|
6401
|
+
valid: "passed",
|
|
6402
|
+
invalid: "invalid",
|
|
6403
|
+
"context-omitted": "format passed; omitted context prevented downshift"
|
|
6404
|
+
}[evidence.validation]}. These auxiliary milestones do not prove a network/model latency cause and are not main-answer Usage.`,
|
|
6351
6405
|
assessment: `${zh ? "判断来源:" : "Assessment: "}${explanation.assessment.source === "semantic" ? zh ? "语义分类" : "semantic classification" : zh ? "本地规则" : "local rules"}${explanation.assessment.signals.length ? ` — ${explanation.assessment.signals.map((signal) => signals[signal]).join(zh ? "、" : ", ")}` : ""}`
|
|
6352
6406
|
};
|
|
6353
6407
|
}
|
|
@@ -6470,7 +6524,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6470
6524
|
color: "var(--dsw-alias-label-primary, CanvasText)",
|
|
6471
6525
|
lineHeight: 1.6
|
|
6472
6526
|
}
|
|
6473
|
-
}, (0, react.createElement)("strong", null, zh ? "为什么本轮选择这个模型" : "Why this model was selected"), selection.mode === "auto" ? explanation === void 0 ? (0, react.createElement)("p", null, zh ? "本轮未保留详细选模原因;不使用当前设置反推历史。" : "Detailed selection reasons were not retained for this turn; today’s settings cannot reconstruct them.") : (0, react.createElement)("div", null, (0, react.createElement)("p", null, explanation.conclusion), (0, react.createElement)("p", null, explanation.choice), (0, react.createElement)("details", null, (0, react.createElement)("summary", null, zh ? "查看判断依据" : "Assessment details"), (0, react.createElement)("p", null, explanation.assessment), (0, react.createElement)("p", null, zh ? `${selection.candidateCount} 个合格候选;${selection.fittingCandidateCount ?? "未知"} 个可容纳估算输入。` : `${selection.candidateCount} eligible candidates; ${selection.fittingCandidateCount ?? "unknown"} fit the estimated input.`), explanation.diagnostic ? (0, react.createElement)("p", null, explanation.diagnostic) : null, (0, react.createElement)("p", null, zh ? "分类来自供应方;不保证实际速度、费用或任务质量。" : "Supplier categories do not guarantee actual speed, cost or task quality."))) : null, incomplete ? (0, react.createElement)("p", null, zh ? "模型归属不完整:部分尝试或历史未记录模型。原生 Usage 保持不变。" : "Model attribution is incomplete: some attempts or history have no recorded model. Native Usage is unchanged.") : null, (0, react.createElement)("p", null, zh ? "此记录说明选择方式,不证明执行;实际模型以原生 Usage 为准。" : "Selection evidence is not execution proof; see native Usage for recorded models."), (0, react.createElement)("button", {
|
|
6527
|
+
}, (0, react.createElement)("strong", null, zh ? "为什么本轮选择这个模型" : "Why this model was selected"), selection.mode === "auto" ? explanation === void 0 ? (0, react.createElement)("p", null, zh ? "本轮未保留详细选模原因;不使用当前设置反推历史。" : "Detailed selection reasons were not retained for this turn; today’s settings cannot reconstruct them.") : (0, react.createElement)("div", null, (0, react.createElement)("p", null, explanation.conclusion), (0, react.createElement)("p", null, explanation.choice), (0, react.createElement)("details", null, (0, react.createElement)("summary", null, zh ? "查看判断依据" : "Assessment details"), (0, react.createElement)("p", null, explanation.assessment), (0, react.createElement)("p", null, zh ? `${selection.candidateCount} 个合格候选;${selection.fittingCandidateCount ?? "未知"} 个可容纳估算输入。` : `${selection.candidateCount} eligible candidates; ${selection.fittingCandidateCount ?? "unknown"} fit the estimated input.`), explanation.diagnostic ? (0, react.createElement)("p", null, explanation.diagnostic) : null, explanation.semantic ? (0, react.createElement)("p", null, explanation.semantic) : null, (0, react.createElement)("p", null, zh ? "分类来自供应方;不保证实际速度、费用或任务质量。" : "Supplier categories do not guarantee actual speed, cost or task quality."))) : null, incomplete ? (0, react.createElement)("p", null, zh ? "模型归属不完整:部分尝试或历史未记录模型。原生 Usage 保持不变。" : "Model attribution is incomplete: some attempts or history have no recorded model. Native Usage is unchanged.") : null, (0, react.createElement)("p", null, zh ? "此记录说明选择方式,不证明执行;实际模型以原生 Usage 为准。" : "Selection evidence is not execution proof; see native Usage for recorded models."), (0, react.createElement)("button", {
|
|
6474
6528
|
ref: close,
|
|
6475
6529
|
type: "button",
|
|
6476
6530
|
style: button,
|