@eddyskywalker/dsh-chatgpt-subscription 0.11.4 → 0.11.7
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 +19 -0
- package/README.md +6 -0
- package/lib/client.js +96 -56
- package/lib/client.js.map +1 -1
- package/lib/index.js +360 -120
- package/lib/types/client/antigravity/styles.d.ts.map +1 -1
- package/lib/types/client/claude/styles.d.ts.map +1 -1
- package/lib/types/client/common/plugin-style.d.ts +23 -0
- package/lib/types/client/common/plugin-style.d.ts.map +1 -0
- package/lib/types/client/common/styles.d.ts.map +1 -1
- package/lib/types/client/kimi-code/styles.d.ts.map +1 -1
- package/lib/types/client/mermaid/styles.d.ts.map +1 -1
- package/lib/types/client/minimax-code/styles.d.ts.map +1 -1
- package/lib/types/client/styles.d.ts +5 -0
- package/lib/types/client/styles.d.ts.map +1 -1
- package/lib/types/client/workbuddy/styles.d.ts.map +1 -1
- package/lib/types/host/antigravity/adapter.d.ts.map +1 -1
- package/lib/types/host/antigravity/mapper.d.ts.map +1 -1
- package/lib/types/host/claude/adapter.d.ts.map +1 -1
- package/lib/types/host/claude/mapper.d.ts.map +1 -1
- package/lib/types/host/command-code/adapter.d.ts.map +1 -1
- package/lib/types/host/command-code/mapper.d.ts.map +1 -1
- package/lib/types/host/common/context-budget-fetch.d.ts +7 -0
- package/lib/types/host/common/context-budget-fetch.d.ts.map +1 -0
- package/lib/types/host/common/context-overflow.d.ts +7 -0
- package/lib/types/host/common/context-overflow.d.ts.map +1 -0
- package/lib/types/host/kimi-code/adapter.d.ts.map +1 -1
- package/lib/types/host/kimi-code/mapper.d.ts.map +1 -1
- package/lib/types/host/minimax-code/adapter.d.ts.map +1 -1
- package/lib/types/host/minimax-code/mapper.d.ts.map +1 -1
- package/lib/types/host/ollama/client.d.ts +29 -0
- package/lib/types/host/ollama/client.d.ts.map +1 -1
- package/lib/types/host/ollama/routes.d.ts.map +1 -1
- package/lib/types/host/responses-client.d.ts.map +1 -1
- package/lib/types/host/workbuddy/adapter.d.ts.map +1 -1
- package/lib/types/host/workbuddy/mapper.d.ts.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
- **插件内上下文预算恢复**:Kimi Code、MiniMax Code、Command Code、Claude、WorkBuddy 的模型请求在 HTTP 400/422 明确报告完整且一致的窗口、输入和输出 token 计数时,若输入仍能放下、上游输出预留等于实际发送的上限,会保留完整消息和工具,只降低输出上限并重试一次(预留 1024 tokens 余量,至少保留 1024 输出 tokens)。普通请求与摘要请求共用此路径,不修改 DSH、不截断历史。显式 thinking budget 不满足时不强行重试;鉴权、限流、字节限制、模糊计数、服务端忽略参数和流内错误保持原处理,输出截断也仍报告失败。Kimi/MiniMax 共用的输入估算补计推理文本和工具调用参数,避免将这些实际输入计为零。验证:截图预算的三种输出字段回归、MiniMax 普通/摘要真实 LLM 服务调用、Kimi Chat Completions 与 Command Code Responses 适配器回归通过;全量插件测试、强制源码及测试类型检查、构建通过。Codex 不支持输出上限字段,未套用此恢复;未进行真实账号端到端验证,不能据此认定截图中未知线路的所有压缩故障已解决。
|
|
6
|
+
|
|
7
|
+
- **修复设置页「订阅服务」整页样式丢失(只剩标签栏有样式)**。
|
|
8
|
+
- **根因**:客户端插件系统按属性记账样式归属。模块工厂 materialize 时会把文档里**所有未打标**的 `<style>` 认领给当时正在 materialize 的那个包(`style:not([data-plugin])` 被写上该包 id),并在该包重载 / 被新 revision 替换 / 被从依赖图剪除时执行 `removeOwnedStyles(id)`,按 owner 删掉这些标签。本插件的 7 张表(antigravity / claude / kimi-code / minimax-code / workbuddy / pool / mermaid)此前只用 `style.id = …` 注入、**不带 `data-plugin`**,于是先被别的包认领,再随那个包的重载被一起删除;而聊天区那张已按约定打了 `data-plugin` + `data-plugin-css` 的 `…/main` 表存活下来。设置页标签栏的样式来自 `…/main`(`.dsh-codex-segments`、`.dsh-hub-tabs`),正文控件来自被删掉的共享 `.dsha-*` 基础表,所以呈现为「标签栏正常、整页正文裸奔」。
|
|
9
|
+
- **修法**:新增 `src/client/common/plugin-style.ts` 的 `installPluginStyle(name, css, legacyId?)`,把原来的「`createElement` + `style.id` + 一次性 append」统一换成:按 `…/<name>` 的 `data-plugin-css` 定位、缺失时创建、**创建/命中时都盖上本包的 `data-plugin` 与唯一的 `data-plugin-css`**、内容变化时刷新 `textContent`、disposer 恒为空操作(标签归文档所有)。八个安装器全部改走它,原来判断存在即 return 的分支一并去掉,因此旧 bundle 在页面里留下的未打标元素会被**就地接管**(不会叠出第二份 CSS),`…/main` 的行为保持不变。
|
|
10
|
+
- **测试**:新增 `test/client-style-ownership.test.ts`(5 条)——八个安装器跑完后断言文档里不剩任何 `style:not([data-plugin])`(不给别的包留可认领对象)、每张表的 `data-plugin-css` 都指向本包;ChatGPT 默认页依赖的 `.dsha-*` 基础表(Kimi / Antigravity)确实带本包归属;模拟 `removeOwnedStyles` 删光后重新安装能全部恢复;模拟「旧 bundle 的未打标表已被别的包认领」时必须接管同一元素并改回本包;旧 bundle 的过期 CSS 必须被刷新而不是 dedupe 成空操作。
|
|
11
|
+
- **验证**:`npm run typecheck` 0 错误;全量 **2314 passed** / 9 skipped,仅 `test/quota-ui.test.tsx` 2 条与本次无关、且在本机时区(Etc/GMT+7)下必然失败的历史用例(把 UTC 的 2030-01-01 渲染成 2029-12-31)未过。
|
|
12
|
+
|
|
13
|
+
- **修复 Ollama「同步模型列表」报 `Failed to execute 'json' on 'Response': Unexpected end of JSON input`**([issue #36](https://github.com/Aa728848/dsh-chatgpt-subscription/issues/36))。
|
|
14
|
+
- **根因不在 Ollama Cloud**:issue 里推测的端点与鉴权都没问题——`CLOUD_BASE_URL` 一直就是 `https://ollama.com`,`/api/tags` 也一直带着 `Authorization: Bearer <key>`,只是从来没有任何一条断言钉住这两点(本次补上)。真正的原因是**本插件自己的路由**:`/ollama/api` 是全插件唯一没有用 `try/catch` 包起来的设置路由处理器,一旦它抛错,DSH 的 web server(`packages/host/webserver`)只会回一个**空的 400**(`res.writeHead(400); res.end()`)。卡片再把这个空响应体交给 `response.json()`,浏览器抛出的解析异常就成了用户看到的全部错误——既没有状态码,也没有请求信息,真实原因只留在主机日志里。同步路径上 `storeCatalog()` 当时是唯一没有保护的 `await`,设置文件写不进去就会走到这里。
|
|
15
|
+
- **修法(主机侧)**:路由处理器整体包进 `try/catch`,兜底用与 Claude / Kimi / WorkBuddy 等同级线路相同的 `{ok:false,error}` 500 信封,并补上它们都有、本线路唯独没有的 404 兜底;`storeCatalog()` 单独捕获,区分「列表读到了但本地存不下」与「读不到」。
|
|
16
|
+
- **修法(错误信息)**:新增 `fetchCatalog()` 保留失败原因——`auth`(401/403,含 `https://ollama.com/settings/keys`)、`upstream`(其他状态码)、`unreachable`(DNS/TLS/代理/超时)、`malformed`(200 但不是 `/api/tags` 文档,例如代理返回的 HTML);`loadCatalog()` 保持「返回空列表、绝不抛」的既有契约不变。另外,「取不到凭据」原本把「一个 key 都没有」和「所有 key 都在冷却中」合并成同一句「请先添加 API Key」,后者会被误导去加一个毫无作用的 key,现在分开提示。
|
|
17
|
+
- **修法(客户端侧)**:`src/client/ollama/api.ts` 先读 text 再解析,响应体为空或不是信封时报告状态码与 `content-type`,不再让 `response.json()` 的原生异常冒到界面上。
|
|
18
|
+
- **测试**:新增 `test/ollama-routes.test.ts`(12 条),每条都断言**响应体可解析**而不只是状态码——`#36` 的故障形态正是「一个字节都没写」;其中最承重的一条让设置存储在同步中途抛错。`test/ollama-client.test.ts` 增 6 条(四类失败分类、端点与 Bearer 头断言、空列表属于成功而非 malformed),`test/ollama-section.test.tsx` 增 2 条(空响应体 / 非 JSON 响应体下界面显示可读错误且**不含** `Unexpected end of JSON input`)。**已实测承重**:把 `src/host/ollama/{routes,client}.ts` 回退到修复前,路由测试 12 条中 8 条立即失败。
|
|
19
|
+
- **验证**:`npm run typecheck` 0 错误;全量 `npm test` **2367 passed / 7 skipped / 0 失败**(151 文件通过 / 1 跳过)。
|
|
20
|
+
- **边界**:未用真实 Ollama Cloud 账号端到端复验——结论来自对 DSH web server 抛错路径的源码路径与本地复现。`src/client/api.ts`(Codex 卡片)存在同一处 `response.json()` 写法,但不在本 issue 范围内,未改动。
|
|
21
|
+
|
|
22
|
+
- **压缩恢复排查(进行中)**:MiniMax、Kimi、Codex、Claude、Command Code、WorkBuddy 与 Antigravity 的已接入 HTTP/SSE 上下文超限错误现在映射为 `CONTEXT_WINDOW_EXCEEDED`,使支持该机制的 Harness 能进入溢出压缩恢复,而不是按普通 provider 错误终止。认证、限流、配额及输出上限错误保持原分类;未改写历史或放宽请求大小限制。MiniMax 的真实 Harness LLM 服务四组合回归已验证修复前失败、修复后通过;相关 584 条测试、强制源码类型检查、测试类型检查与构建通过;另运行 Harness 自动/手动压缩 138 条现有测试全部通过。新增 MiniMax 摘要成功及输出截断的模拟流回归,确认截断仍以 max-tokens 结束。Command Code OpenAI 与 Antigravity 的流内错误帧不再被忽略。尚未进行真实账号端到端验证;强制压缩具体失败原因及其他线路仍在排查,不能据此宣称所有压缩故障已解决。
|
|
23
|
+
|
|
5
24
|
- **修复 Claude 与 Command Code 登录时弹出两个一模一样的授权页**([#33](https://github.com/Aa728848/dsh-chatgpt-subscription/pull/33),由 @Anuii 提交)。
|
|
6
25
|
- **根因**:授权页被打开了两次。设置卡片在 `/login` 返回后调用 `window.open(authUrl)`(桌面端主窗口会把 http(s) 的 `window.open` 交给 `shell.openExternal`,即在系统浏览器中打开),而主机端 `/login` 路由调用 `beginLogin` 时没有传 `openBrowser`,于是走了默认实现,在主机上用 `cmd /c start`(macOS `open`、Linux `xdg-open`)把同一个地址又打开一次。
|
|
7
26
|
- **修法**:保留卡片打开,去掉主机打开。卡片打开的位置就是用户所在的位置(远程访问 GUI 时也正确),且与 Antigravity / WorkBuddy / Codex 早已采用的「只在卡片打开」一致。Claude 两个入口(登录、按账号重新登录)共用一份 `loginOptions`,默认 `openBrowser` 为空操作;测试仍可通过 `options.login` 注入自己的实现。Command Code 的 `beginWebLogin` 同样传入空操作。已核对生产接线(`registerClaudeRoutes` 的 options)不传 `login`,所以空操作在生产下不会被覆盖。
|
package/README.md
CHANGED
|
@@ -764,6 +764,12 @@ npm pack --dry-run
|
|
|
764
764
|
|
|
765
765
|
## 故障排查
|
|
766
766
|
|
|
767
|
+
### 压缩失败
|
|
768
|
+
|
|
769
|
+
Kimi Code、MiniMax Code、Command Code、Claude、WorkBuddy 遇到“输入加输出预留超限”时,插件可在 HTTP 400/422 的完整 token 计数证明输入仍能放下、且上游确实采用了请求输出上限的情况下,仅降低输出上限重试一次。消息、工具和历史保持不变,摘要请求也适用。降低后的输出仍可能截断,截断不会冒充完整摘要。Codex 不支持该输出参数,不走此恢复;输入本身超限、模糊错误或流内错误仍交给 Harness 处理。这不是对所有压缩故障的通用修复。
|
|
770
|
+
|
|
771
|
+
MiniMax、Kimi、Codex、Claude、Command Code、WorkBuddy 和 Antigravity 的错误处理会将明确的上下文超限错误交给 Harness 的溢出恢复机制。该机制需要宿主启用压缩后端;它不是无条件重发同一个超限请求。认证、配额、请求体字节限制和输出截断不会因此被当作上下文超限。手动压缩仍需生成完整摘要;如果摘要请求本身超限、被截断或缺少正文,修正错误分类也不能保证它成功。请保留失败会话中的 `compaction/end` 错误、provider/model、宿主及插件版本,以便定位。
|
|
772
|
+
|
|
767
773
|
| 现象 | 处理 |
|
|
768
774
|
| --- | --- |
|
|
769
775
|
| 1455 端口占用 | 结束旧登录任务或占用该端口的进程后重试;插件卸载会关闭 listener |
|
package/lib/client.js
CHANGED
|
@@ -8841,10 +8841,48 @@ window.__ModuleLoader__.load({
|
|
|
8841
8841
|
...init,
|
|
8842
8842
|
credentials: "same-origin"
|
|
8843
8843
|
});
|
|
8844
|
-
const envelope = await response
|
|
8844
|
+
const envelope = await readEnvelope(response);
|
|
8845
8845
|
if (!response.ok || !envelope.ok) throw new Error(envelope.error || `HTTP ${response.status}`);
|
|
8846
8846
|
return envelope.value;
|
|
8847
8847
|
}
|
|
8848
|
+
/**
|
|
8849
|
+
* Read the {ok,value,error} envelope, or say why there was not one.
|
|
8850
|
+
*
|
|
8851
|
+
* `response.json()` is not a way to report an error. A body that is empty —
|
|
8852
|
+
* which is what DSH's web server sends for a route handler that rejected, and
|
|
8853
|
+
* what a proxy sends for a blocked request — throws the browser's own
|
|
8854
|
+
* "Failed to execute 'json' on 'Response': Unexpected end of JSON input" (issue
|
|
8855
|
+
* #36), a sentence that names neither the status nor the request. Reading the
|
|
8856
|
+
* text first costs one string and turns every unreadable answer into a message
|
|
8857
|
+
* that says what the Host actually replied.
|
|
8858
|
+
*
|
|
8859
|
+
* The body is never echoed back: it can be an HTML page of arbitrary size, and
|
|
8860
|
+
* its content-type alone is what identifies the failure.
|
|
8861
|
+
*/
|
|
8862
|
+
async function readEnvelope(response) {
|
|
8863
|
+
let text;
|
|
8864
|
+
try {
|
|
8865
|
+
text = await response.text();
|
|
8866
|
+
} catch (cause) {
|
|
8867
|
+
throw new Error(unreadable(response, cause));
|
|
8868
|
+
}
|
|
8869
|
+
if (text.trim() === "") throw new Error(unreadable(response));
|
|
8870
|
+
let parsed;
|
|
8871
|
+
try {
|
|
8872
|
+
parsed = JSON.parse(text);
|
|
8873
|
+
} catch {
|
|
8874
|
+
throw new Error(unreadable(response));
|
|
8875
|
+
}
|
|
8876
|
+
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) throw new Error(unreadable(response));
|
|
8877
|
+
const envelope = parsed;
|
|
8878
|
+
if (typeof envelope.error !== "string") delete envelope.error;
|
|
8879
|
+
return envelope;
|
|
8880
|
+
}
|
|
8881
|
+
/** The one sentence every unreadable answer turns into. */
|
|
8882
|
+
function unreadable(response, cause) {
|
|
8883
|
+
const kind = response.headers.get("content-type") ?? "no content-type";
|
|
8884
|
+
return `The Ollama settings API answered with ${response.status} and no JSON body (${kind})` + (cause instanceof Error ? `: ${cause.message}` : "") + ". The Host log holds the underlying error.";
|
|
8885
|
+
}
|
|
8848
8886
|
//#endregion
|
|
8849
8887
|
//#region src/client/ollama/locales.ts
|
|
8850
8888
|
const NS_OLLAMA = "dsh-ollama";
|
|
@@ -9685,9 +9723,45 @@ window.__ModuleLoader__.load({
|
|
|
9685
9723
|
}
|
|
9686
9724
|
};
|
|
9687
9725
|
//#endregion
|
|
9688
|
-
//#region src/client/
|
|
9726
|
+
//#region src/client/common/plugin-style.ts
|
|
9727
|
+
/**
|
|
9728
|
+
* Shared installer for every stylesheet this plugin injects.
|
|
9729
|
+
*
|
|
9730
|
+
* The DSH client module system books stylesheet ownership by attribute. When a
|
|
9731
|
+
* package's factory materializes it claims every untagged `<style>` in the
|
|
9732
|
+
* document for itself (`style:not([data-plugin])` gains that package's id); when
|
|
9733
|
+
* a package reloads, is replaced at a new revision, or is pruned from the graph,
|
|
9734
|
+
* it removes every tag carrying its id. A sheet injected as a plain
|
|
9735
|
+
* `<style id=…>` therefore gets claimed by whichever sibling package
|
|
9736
|
+
* materializes next and is then deleted as that sibling's bookkeeping — which is
|
|
9737
|
+
* how the whole shared provider design system (`.dsha-*`) disappeared from the
|
|
9738
|
+
* settings page while the already-tagged chat-only `…/main` sheet survived.
|
|
9739
|
+
*
|
|
9740
|
+
* Tagging every sheet with this package's own `data-plugin` and a unique
|
|
9741
|
+
* `data-plugin-css` keeps the module system from attributing it to another
|
|
9742
|
+
* package, and re-running the installer on every `apply()` restores it after one
|
|
9743
|
+
* of our own reloads. The tag is owned by the document: the installer refreshes
|
|
9744
|
+
* stale text but never removes the element, so a stale fiber's teardown can
|
|
9745
|
+
* never take the styles away.
|
|
9746
|
+
*/
|
|
9689
9747
|
const PLUGIN_ID = "@eddyskywalker/dsh-chatgpt-subscription";
|
|
9690
|
-
|
|
9748
|
+
function installPluginStyle(name, css, legacyId) {
|
|
9749
|
+
if (typeof document === "undefined") return () => void 0;
|
|
9750
|
+
const pluginCss = `${PLUGIN_ID}/${name}`;
|
|
9751
|
+
let element = document.querySelector(`style[data-plugin-css="${pluginCss}"]`);
|
|
9752
|
+
element ??= legacyId === void 0 ? null : document.getElementById(legacyId);
|
|
9753
|
+
if (element === null) {
|
|
9754
|
+
element = document.createElement("style");
|
|
9755
|
+
if (legacyId !== void 0) element.id = legacyId;
|
|
9756
|
+
document.head.appendChild(element);
|
|
9757
|
+
}
|
|
9758
|
+
element.dataset.plugin = PLUGIN_ID;
|
|
9759
|
+
element.dataset.pluginCss = pluginCss;
|
|
9760
|
+
if (element.textContent !== css) element.textContent = css;
|
|
9761
|
+
return () => void 0;
|
|
9762
|
+
}
|
|
9763
|
+
//#endregion
|
|
9764
|
+
//#region src/client/styles.ts
|
|
9691
9765
|
const CSS = `
|
|
9692
9766
|
.dsh-codex-page{box-sizing:border-box;color:var(--dsw-alias-label-primary);display:flex;flex-direction:column;gap:20px;max-width:780px;min-width:0;padding:2px 0 30px}
|
|
9693
9767
|
.dsh-codex-page *{box-sizing:border-box}
|
|
@@ -9835,29 +9909,20 @@ window.__ModuleLoader__.load({
|
|
|
9835
9909
|
* create it when missing, refresh `textContent` when a rebuilt bundle ships
|
|
9836
9910
|
* different CSS (HMR), and return a no-op disposer unconditionally, matching
|
|
9837
9911
|
* the additive installers.
|
|
9912
|
+
*
|
|
9913
|
+
* Every other sheet this plugin injects now goes through the same installer
|
|
9914
|
+
* (`installPluginStyle`), which additionally stamps the ownership attributes
|
|
9915
|
+
* the client module system needs so the tag cannot be claimed by, and later
|
|
9916
|
+
* removed with, some other package.
|
|
9838
9917
|
*/
|
|
9839
9918
|
function installStyles() {
|
|
9840
|
-
|
|
9841
|
-
const existing = document.querySelector(`style[data-plugin-css="${STYLE_ID$5}"]`);
|
|
9842
|
-
if (existing !== null) {
|
|
9843
|
-
if (existing.textContent !== CSS) existing.textContent = CSS;
|
|
9844
|
-
return () => void 0;
|
|
9845
|
-
}
|
|
9846
|
-
const element = document.createElement("style");
|
|
9847
|
-
element.dataset.plugin = PLUGIN_ID;
|
|
9848
|
-
element.dataset.pluginCss = STYLE_ID$5;
|
|
9849
|
-
element.textContent = CSS;
|
|
9850
|
-
document.head.appendChild(element);
|
|
9851
|
-
return () => void 0;
|
|
9919
|
+
return installPluginStyle("main", CSS);
|
|
9852
9920
|
}
|
|
9853
9921
|
//#endregion
|
|
9854
9922
|
//#region src/client/antigravity/styles.ts
|
|
9855
9923
|
const STYLE_ID$4 = "dsh-antigravity-settings-style";
|
|
9856
9924
|
function installAntigravityStyles() {
|
|
9857
|
-
|
|
9858
|
-
const style = document.createElement("style");
|
|
9859
|
-
style.id = STYLE_ID$4;
|
|
9860
|
-
style.textContent = `
|
|
9925
|
+
installPluginStyle("antigravity", `
|
|
9861
9926
|
.dsha-page{box-sizing:border-box;color:var(--dsw-alias-label-primary);display:flex;flex-direction:column;gap:20px;max-width:780px;min-width:0;padding:2px 0 30px}
|
|
9862
9927
|
.dsha-page *{box-sizing:border-box}
|
|
9863
9928
|
.dsha-group{border-top:0.5px solid var(--dsw-alias-border-l2);min-width:0}
|
|
@@ -9931,8 +9996,7 @@ window.__ModuleLoader__.load({
|
|
|
9931
9996
|
.dsha-account-details{display:flex;flex-wrap:wrap;gap:14px;font-size:12px;color:var(--dsw-alias-label-secondary)}
|
|
9932
9997
|
.dsha-account-actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:2px}
|
|
9933
9998
|
.dsha-account-actions .dsha-btn{padding:5px 10px;font-size:12px}
|
|
9934
|
-
|
|
9935
|
-
document.head.append(style);
|
|
9999
|
+
`, STYLE_ID$4);
|
|
9936
10000
|
}
|
|
9937
10001
|
//#endregion
|
|
9938
10002
|
//#region src/client/common/styles.ts
|
|
@@ -9946,14 +10010,10 @@ window.__ModuleLoader__.load({
|
|
|
9946
10010
|
* them, so nothing that already rendered changes appearance.
|
|
9947
10011
|
*/
|
|
9948
10012
|
function installPoolStyles() {
|
|
9949
|
-
|
|
9950
|
-
const style = document.createElement("style");
|
|
9951
|
-
style.id = POOL_STYLE_ID;
|
|
9952
|
-
style.textContent = `
|
|
10013
|
+
installPluginStyle("pool", `
|
|
9953
10014
|
.dsha-badge.danger{background:color-mix(in srgb,var(--dsw-alias-label-danger,#d94b4b) 18%,var(--dsw-alias-bg-layer-1));color:var(--dsw-alias-label-danger,#d94b4b);border:0.5px solid color-mix(in srgb,var(--dsw-alias-label-danger,#d94b4b) 40%,transparent)}
|
|
9954
10015
|
.dsha-account-card .dsha-btn.danger{color:var(--dsw-alias-label-danger,#d94b4b)}
|
|
9955
|
-
|
|
9956
|
-
document.head.append(style);
|
|
10016
|
+
`, POOL_STYLE_ID);
|
|
9957
10017
|
}
|
|
9958
10018
|
//#endregion
|
|
9959
10019
|
//#region src/client/antigravity/AntigravityComposerQuota.tsx
|
|
@@ -10189,10 +10249,7 @@ window.__ModuleLoader__.load({
|
|
|
10189
10249
|
* markers, neither of which a sibling line renders.
|
|
10190
10250
|
*/
|
|
10191
10251
|
function installClaudeStyles() {
|
|
10192
|
-
|
|
10193
|
-
const style = document.createElement("style");
|
|
10194
|
-
style.id = STYLE_ID$3;
|
|
10195
|
-
style.textContent = `
|
|
10252
|
+
installPluginStyle("claude", `
|
|
10196
10253
|
.dsha-badge.claude-adopted{background:color-mix(in srgb,var(--dsw-alias-button-info-fill,#397ee8) 16%,var(--dsw-alias-bg-layer-1));border-color:color-mix(in srgb,var(--dsw-alias-button-info-fill,#397ee8) 45%,var(--dsw-alias-border-l2));color:var(--dsw-alias-label-primary)}
|
|
10197
10254
|
.dshcl-flow{border-bottom:0.5px solid var(--dsw-alias-border-l2);display:flex;flex-direction:column;gap:10px;padding:12px 0}
|
|
10198
10255
|
.dshcl-flow-url{background:var(--dsw-alias-bg-layer-1,rgba(127,127,127,.14));border:0.5px solid var(--dsw-alias-border-l2);border-radius:7px;color:var(--dsw-alias-label-primary);font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:11px;overflow-wrap:anywhere;padding:8px 10px;user-select:all}
|
|
@@ -10202,8 +10259,7 @@ window.__ModuleLoader__.load({
|
|
|
10202
10259
|
.dshcl-mono{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:11px;overflow-wrap:anywhere}
|
|
10203
10260
|
.dshcl-model-meta{color:var(--dsw-alias-label-tertiary);font-size:11px;margin-left:5px}
|
|
10204
10261
|
.dshcl-empty-inline{color:var(--dsw-alias-label-tertiary);font-size:12px}
|
|
10205
|
-
|
|
10206
|
-
document.head.append(style);
|
|
10262
|
+
`, STYLE_ID$3);
|
|
10207
10263
|
}
|
|
10208
10264
|
//#endregion
|
|
10209
10265
|
//#region src/client/command-code/CommandCodeComposerQuota.tsx
|
|
@@ -10522,11 +10578,7 @@ window.__ModuleLoader__.load({
|
|
|
10522
10578
|
`;
|
|
10523
10579
|
/** Kimi-specific rules layered on top of the shared control styles. */
|
|
10524
10580
|
function installKimiCodeStyles() {
|
|
10525
|
-
|
|
10526
|
-
const style = document.createElement("style");
|
|
10527
|
-
style.id = STYLE_ID$2;
|
|
10528
|
-
style.textContent = BASE;
|
|
10529
|
-
document.head.appendChild(style);
|
|
10581
|
+
installPluginStyle("kimi-code", BASE, STYLE_ID$2);
|
|
10530
10582
|
}
|
|
10531
10583
|
//#endregion
|
|
10532
10584
|
//#region src/client/minimax-code/MinimaxCodeComposerQuota.tsx
|
|
@@ -10624,16 +10676,12 @@ window.__ModuleLoader__.load({
|
|
|
10624
10676
|
* credential path and the model-name list.
|
|
10625
10677
|
*/
|
|
10626
10678
|
function installMinimaxCodeStyles() {
|
|
10627
|
-
|
|
10628
|
-
const style = document.createElement("style");
|
|
10629
|
-
style.id = STYLE_ID$1;
|
|
10630
|
-
style.textContent = `
|
|
10679
|
+
installPluginStyle("minimax-code", `
|
|
10631
10680
|
.dshm-mono{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:11px}
|
|
10632
10681
|
.dshm-model-list{display:flex;flex-wrap:wrap;gap:7px;padding-top:8px}
|
|
10633
10682
|
.dshm-model-list code{background:var(--dsw-alias-bg-layer-2);border:0.5px solid var(--dsw-alias-border-l2);border-radius:6px;color:var(--dsw-alias-label-secondary);font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:11px;padding:5px 8px;white-space:nowrap}
|
|
10634
10683
|
.dshm-quota-note{margin-top:12px}
|
|
10635
|
-
|
|
10636
|
-
document.head.append(style);
|
|
10684
|
+
`, STYLE_ID$1);
|
|
10637
10685
|
}
|
|
10638
10686
|
//#endregion
|
|
10639
10687
|
//#region src/client/workbuddy/WorkBuddyComposerQuota.tsx
|
|
@@ -10756,16 +10804,12 @@ window.__ModuleLoader__.load({
|
|
|
10756
10804
|
* every sibling tab, and the account card is the shared one.
|
|
10757
10805
|
*/
|
|
10758
10806
|
function installWorkBuddyStyles() {
|
|
10759
|
-
|
|
10760
|
-
const style = document.createElement("style");
|
|
10761
|
-
style.id = STYLE_ID;
|
|
10762
|
-
style.textContent = `
|
|
10807
|
+
installPluginStyle("workbuddy", `
|
|
10763
10808
|
.dshwb-mono{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:11px}
|
|
10764
10809
|
.dsha-account-add-actions{display:flex;flex-wrap:wrap;gap:8px}
|
|
10765
10810
|
.dsha-account-add-actions .dsha-btn{background:var(--dsw-alias-button-info-fill,#397ee8);border-color:transparent;color:var(--dsw-alias-button-info-label,#fff)}
|
|
10766
10811
|
.dsha-account-add-actions .dsha-btn:hover:not(:disabled){opacity:.9;background:var(--dsw-alias-button-info-fill,#397ee8)}
|
|
10767
|
-
|
|
10768
|
-
document.head.append(style);
|
|
10812
|
+
`, STYLE_ID);
|
|
10769
10813
|
}
|
|
10770
10814
|
//#endregion
|
|
10771
10815
|
//#region src/client/mermaid/sanitize.ts
|
|
@@ -10816,10 +10860,7 @@ window.__ModuleLoader__.load({
|
|
|
10816
10860
|
//#region src/client/mermaid/styles.ts
|
|
10817
10861
|
const MERMAID_STYLE_ID = "dsh-mermaid-renderer-style";
|
|
10818
10862
|
function installMermaidStyles() {
|
|
10819
|
-
|
|
10820
|
-
const style = document.createElement("style");
|
|
10821
|
-
style.id = MERMAID_STYLE_ID;
|
|
10822
|
-
style.textContent = `
|
|
10863
|
+
installPluginStyle("mermaid", `
|
|
10823
10864
|
.dsh-mermaid-wrapper{margin:12px 0;border:1px solid var(--dsw-alias-border-l2,rgba(255,255,255,0.12));border-radius:8px;overflow:hidden;background:var(--dsw-alias-bg-layer-2,#1a1a1a);box-shadow:0 2px 8px rgba(0,0,0,0.15)}
|
|
10824
10865
|
.dsh-mermaid-header{display:flex;align-items:center;justify-content:space-between;padding:6px 12px;background:var(--dsw-alias-bg-layer-1,rgba(0,0,0,0.25));border-bottom:1px solid var(--dsw-alias-border-l2,rgba(255,255,255,0.08));font-size:12px;color:var(--dsw-alias-label-secondary,#888)}
|
|
10825
10866
|
.dsh-mermaid-title{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:11px;text-transform:uppercase;letter-spacing:0.5px;color:var(--dsw-alias-label-tertiary,#aaa);font-weight:600}
|
|
@@ -10838,8 +10879,7 @@ window.__ModuleLoader__.load({
|
|
|
10838
10879
|
.dsh-mermaid-modal-btn:hover{background:rgba(255,255,255,0.15)}
|
|
10839
10880
|
.dsh-mermaid-modal-stage{flex:1;width:100%;height:100%;overflow:auto;display:flex;justify-content:center;align-items:center;padding:40px}
|
|
10840
10881
|
.dsh-mermaid-modal-stage svg{max-width:90vw;max-height:85vh;height:auto}
|
|
10841
|
-
|
|
10842
|
-
document.head.append(style);
|
|
10882
|
+
`, MERMAID_STYLE_ID);
|
|
10843
10883
|
}
|
|
10844
10884
|
//#endregion
|
|
10845
10885
|
//#region src/client/mermaid/renderer.ts
|