@eddyskywalker/dsh-chatgpt-subscription 0.1.16 → 0.1.18
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 +1 -1
- package/README.md +1 -1
- package/lib/client.js +166 -72
- package/lib/client.js.map +1 -1
- package/lib/index.js +135 -19
- package/lib/types/client/CodexSubscriptionSection.d.ts +1 -0
- package/lib/types/client/CodexSubscriptionSection.d.ts.map +1 -1
- package/lib/types/client/api.d.ts +2 -1
- package/lib/types/client/api.d.ts.map +1 -1
- package/lib/types/client/locales.d.ts +15 -5
- package/lib/types/client/locales.d.ts.map +1 -1
- package/lib/types/host/preferences.d.ts.map +1 -1
- package/lib/types/host/routes.d.ts.map +1 -1
- package/lib/types/host/subagent-context-adapter.d.ts +24 -0
- package/lib/types/host/subagent-context-adapter.d.ts.map +1 -0
- package/lib/types/host/subagent-model-preference.d.ts +2 -2
- package/lib/types/host/subagent-model-preference.d.ts.map +1 -1
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/shared/contracts.d.ts +32 -2
- package/lib/types/shared/contracts.d.ts.map +1 -1
- package/lib/types/shared/preferences.d.ts.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
-
-
|
|
5
|
+
- 子代理设置扩展为 DSH 全部已接入 Provider/模型;思考深度使用所选模型的真实 reasoning effort 目录,上下文在选定模型后展开并作为子 Agent 的有效压缩预算。
|
|
6
6
|
- 设置页新增 GPT-5.6 Sol / Terra / Luna 有效上下文窗口配置:默认 272K,可选最高 1M,并动态影响 DSH 的模型解析、压缩阈值与溢出判断。
|
|
7
7
|
|
|
8
8
|
## 0.1.12 - 2026-08-20
|
package/README.md
CHANGED
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
**设置页**
|
|
40
40
|
|
|
41
41
|
- 展示账号(脱敏 email、套餐、账号 ID 后四位)、连接状态、额度与订阅增强功能开关;
|
|
42
|
-
-
|
|
42
|
+
- 当父 Agent 使用本插件的 `codex-chatgpt` 模型时,子代理可选择 DSH 当前接入的任意 Provider/模型(如 DeepSeek V4 Flash);思考深度来自所选模型公开能力,上下文在选定模型后展开配置;非 Codex 父 Agent完全沿用 DSH 默认子代理继承设计;
|
|
43
43
|
- 5.6 Sol / Terra / Luna 默认使用 272K 有效上下文,可在设置中选择最高 1M,用于 DSH 压缩与溢出判断;其他模型保持目录声明值;
|
|
44
44
|
- 可访问的进度条、窄窗口/200% 缩放布局、深浅主题与 reduced-motion。
|
|
45
45
|
|
package/lib/client.js
CHANGED
|
@@ -246,17 +246,6 @@ window.__ModuleLoader__.load({
|
|
|
246
246
|
"gpt-5.6-terra",
|
|
247
247
|
"gpt-5.6-luna"
|
|
248
248
|
];
|
|
249
|
-
const STANDARD_REASONING_EFFORTS = [
|
|
250
|
-
"none",
|
|
251
|
-
"low",
|
|
252
|
-
"medium",
|
|
253
|
-
"high",
|
|
254
|
-
"xhigh"
|
|
255
|
-
];
|
|
256
|
-
const GPT_56_REASONING_EFFORTS = [...STANDARD_REASONING_EFFORTS, "max"];
|
|
257
|
-
function reasoningEffortsForModel(model) {
|
|
258
|
-
return resolveCodexCatalogEntry(model).reasoningProfile === "gpt-5.6" ? GPT_56_REASONING_EFFORTS : STANDARD_REASONING_EFFORTS;
|
|
259
|
-
}
|
|
260
249
|
function resolveCodexCatalogEntry(model) {
|
|
261
250
|
return CODEX_MODEL_CATALOG.find((entry) => entry.id === model) ?? DEFAULT_CODEX_MODEL;
|
|
262
251
|
}
|
|
@@ -266,6 +255,9 @@ window.__ModuleLoader__.load({
|
|
|
266
255
|
status() {
|
|
267
256
|
return request(`${ROUTE_PREFIX}/status`);
|
|
268
257
|
}
|
|
258
|
+
models() {
|
|
259
|
+
return request(`${ROUTE_PREFIX}/models`);
|
|
260
|
+
}
|
|
269
261
|
startLogin() {
|
|
270
262
|
return post(`${ROUTE_PREFIX}/login/start`, {});
|
|
271
263
|
}
|
|
@@ -321,6 +313,7 @@ window.__ModuleLoader__.load({
|
|
|
321
313
|
const apiRef = (0, react.useRef)(new SubscriptionApi());
|
|
322
314
|
const eventSourceRef = (0, react.useRef)(null);
|
|
323
315
|
const [status, setStatus] = (0, react.useState)(null);
|
|
316
|
+
const [modelCatalog, setModelCatalog] = (0, react.useState)(null);
|
|
324
317
|
const [busy, setBusy] = (0, react.useState)(null);
|
|
325
318
|
const [error, setError] = (0, react.useState)(null);
|
|
326
319
|
const [authUrl, setAuthUrl] = (0, react.useState)(null);
|
|
@@ -330,8 +323,9 @@ window.__ModuleLoader__.load({
|
|
|
330
323
|
const load = (0, react.useCallback)(async (quiet = false) => {
|
|
331
324
|
if (!quiet) setError(null);
|
|
332
325
|
try {
|
|
333
|
-
const next = await apiRef.current.status();
|
|
326
|
+
const [next, models] = await Promise.all([apiRef.current.status(), apiRef.current.models()]);
|
|
334
327
|
setStatus(next);
|
|
328
|
+
setModelCatalog(models);
|
|
335
329
|
if (next.error !== void 0) setError(next.error.message);
|
|
336
330
|
} catch (cause) {
|
|
337
331
|
if (!quiet) setError(messageOf(cause));
|
|
@@ -620,51 +614,147 @@ window.__ModuleLoader__.load({
|
|
|
620
614
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("searchProviderCodex") })] })]
|
|
621
615
|
})]
|
|
622
616
|
}),
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
617
|
+
(() => {
|
|
618
|
+
const selectedProvider = modelCatalog?.providers.find((provider) => provider.id === status?.preferences.subagentProvider) ?? modelCatalog?.providers[0];
|
|
619
|
+
const selectedModel = selectedProvider?.models.find((model) => model.id === status?.preferences.subagentModel) ?? selectedProvider?.models[0];
|
|
620
|
+
const reasoning = selectedModel?.reasoning;
|
|
621
|
+
const selectedEffort = status?.preferences.subagentReasoningEffort ?? reasoning?.defaultEffort ?? reasoning?.efforts[0]?.id ?? "";
|
|
622
|
+
const savedContext = status?.preferences.subagentContextWindow ?? selectedModel?.contextWindow;
|
|
623
|
+
const contextDraft = contextDrafts.subagent;
|
|
624
|
+
const parsedContextValue = contextDraft === void 0 ? savedContext ?? null : parsePositiveCapacity(contextDraft);
|
|
625
|
+
const parsedContext = parsedContextValue !== null && (selectedModel?.maxContextWindow === void 0 || parsedContextValue <= selectedModel.maxContextWindow) ? parsedContextValue : null;
|
|
626
|
+
const contextDirty = contextDraft !== void 0 && parsedContext !== savedContext;
|
|
627
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
628
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
629
|
+
className: "dsh-codex-pref-row",
|
|
630
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: t("subagentProvider") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
631
|
+
className: "dsh-codex-muted",
|
|
632
|
+
children: t("subagentProviderHint")
|
|
633
|
+
})] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("select", {
|
|
634
|
+
className: "dsh-codex-select",
|
|
635
|
+
"aria-label": t("subagentProvider"),
|
|
636
|
+
value: selectedProvider?.id ?? "",
|
|
637
|
+
disabled: busy !== null || selectedProvider === void 0,
|
|
638
|
+
onChange: (event) => {
|
|
639
|
+
const provider = modelCatalog?.providers.find((entry) => entry.id === event.currentTarget.value);
|
|
640
|
+
const model = provider?.models[0];
|
|
641
|
+
if (provider === void 0 || model === void 0) return;
|
|
642
|
+
const effort = model.reasoning?.defaultEffort ?? model.reasoning?.efforts[0]?.id ?? null;
|
|
643
|
+
updatePreferences({
|
|
644
|
+
subagentProvider: provider.id,
|
|
645
|
+
subagentModel: model.id,
|
|
646
|
+
subagentReasoningEffort: effort,
|
|
647
|
+
subagentContextWindow: model.contextWindow ?? 1
|
|
648
|
+
});
|
|
649
|
+
setContextDrafts((drafts) => ({
|
|
650
|
+
...drafts,
|
|
651
|
+
subagent: formatCapacity(model.contextWindow ?? 1)
|
|
652
|
+
}));
|
|
653
|
+
},
|
|
654
|
+
children: modelCatalog?.providers.map((provider) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
655
|
+
value: provider.id,
|
|
656
|
+
children: provider.name
|
|
657
|
+
}, provider.id))
|
|
658
|
+
})]
|
|
661
659
|
}),
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
children:
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
660
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
661
|
+
className: "dsh-codex-pref-row",
|
|
662
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: t("subagentModel") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
663
|
+
className: "dsh-codex-muted",
|
|
664
|
+
children: t("subagentModelHint")
|
|
665
|
+
})] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("select", {
|
|
666
|
+
className: "dsh-codex-select",
|
|
667
|
+
"aria-label": t("subagentModel"),
|
|
668
|
+
value: selectedModel?.id ?? "",
|
|
669
|
+
disabled: busy !== null || selectedModel === void 0,
|
|
670
|
+
onChange: (event) => {
|
|
671
|
+
const model = selectedProvider?.models.find((entry) => entry.id === event.currentTarget.value);
|
|
672
|
+
if (selectedProvider === void 0 || model === void 0) return;
|
|
673
|
+
const effort = model.reasoning?.defaultEffort ?? model.reasoning?.efforts[0]?.id ?? null;
|
|
674
|
+
updatePreferences({
|
|
675
|
+
subagentProvider: selectedProvider.id,
|
|
676
|
+
subagentModel: model.id,
|
|
677
|
+
subagentReasoningEffort: effort,
|
|
678
|
+
subagentContextWindow: model.contextWindow ?? 1
|
|
679
|
+
});
|
|
680
|
+
setContextDrafts((drafts) => ({
|
|
681
|
+
...drafts,
|
|
682
|
+
subagent: formatCapacity(model.contextWindow ?? 1)
|
|
683
|
+
}));
|
|
684
|
+
},
|
|
685
|
+
children: selectedProvider?.models.map((model) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
686
|
+
value: model.id,
|
|
687
|
+
children: model.name
|
|
688
|
+
}, model.id))
|
|
689
|
+
})]
|
|
690
|
+
}),
|
|
691
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
692
|
+
className: "dsh-codex-pref-row",
|
|
693
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: t("subagentReasoningEffort") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
694
|
+
className: "dsh-codex-muted",
|
|
695
|
+
children: t("subagentReasoningEffortHint")
|
|
696
|
+
})] }), reasoning !== void 0 && reasoning.efforts.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("select", {
|
|
697
|
+
className: "dsh-codex-select",
|
|
698
|
+
"aria-label": t("subagentReasoningEffort"),
|
|
699
|
+
value: selectedEffort,
|
|
700
|
+
disabled: busy !== null,
|
|
701
|
+
onChange: (event) => void updatePreferences({ subagentReasoningEffort: event.currentTarget.value }),
|
|
702
|
+
children: reasoning.efforts.map((effort) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
703
|
+
value: effort.id,
|
|
704
|
+
children: effort.name
|
|
705
|
+
}, effort.id))
|
|
706
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
707
|
+
className: "dsh-codex-muted",
|
|
708
|
+
children: t("providerDefault")
|
|
709
|
+
})]
|
|
710
|
+
}),
|
|
711
|
+
selectedModel?.contextWindow !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
712
|
+
className: "dsh-codex-context-settings",
|
|
713
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("strong", { children: [
|
|
714
|
+
selectedModel.name,
|
|
715
|
+
" · ",
|
|
716
|
+
t("contextWindow")
|
|
717
|
+
] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
718
|
+
className: "dsh-codex-muted",
|
|
719
|
+
children: t("selectedModelContextHint")
|
|
720
|
+
})] }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
721
|
+
className: "dsh-codex-context-row",
|
|
722
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
723
|
+
htmlFor: "dsh-subagent-context",
|
|
724
|
+
children: t("effectiveContextWindow")
|
|
725
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
726
|
+
className: "dsh-codex-capacity-control",
|
|
727
|
+
children: [
|
|
728
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
729
|
+
id: "dsh-subagent-context",
|
|
730
|
+
type: "text",
|
|
731
|
+
inputMode: "numeric",
|
|
732
|
+
value: contextDraft ?? formatCapacity(savedContext ?? selectedModel.contextWindow),
|
|
733
|
+
disabled: busy !== null,
|
|
734
|
+
onChange: (event) => {
|
|
735
|
+
const value = event.currentTarget.value;
|
|
736
|
+
setContextDrafts((drafts) => ({
|
|
737
|
+
...drafts,
|
|
738
|
+
subagent: value
|
|
739
|
+
}));
|
|
740
|
+
}
|
|
741
|
+
}),
|
|
742
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("small", { children: t("tokens") }),
|
|
743
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
744
|
+
className: "dsh-codex-context-save",
|
|
745
|
+
type: "button",
|
|
746
|
+
disabled: busy !== null || !contextDirty || parsedContext === null,
|
|
747
|
+
onClick: () => {
|
|
748
|
+
if (parsedContext !== null) updatePreferences({ subagentContextWindow: parsedContext });
|
|
749
|
+
},
|
|
750
|
+
children: t("save")
|
|
751
|
+
})
|
|
752
|
+
]
|
|
753
|
+
})]
|
|
754
|
+
})]
|
|
755
|
+
}) : null
|
|
756
|
+
] });
|
|
757
|
+
})(),
|
|
668
758
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
669
759
|
className: "dsh-codex-context-settings",
|
|
670
760
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: t("contextWindows") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
@@ -911,22 +1001,16 @@ window.__ModuleLoader__.load({
|
|
|
911
1001
|
unitDisplay: "long"
|
|
912
1002
|
}).format(value)} ${t("limitWindow")}`;
|
|
913
1003
|
}
|
|
914
|
-
function
|
|
915
|
-
return t({
|
|
916
|
-
none: "reasoningNone",
|
|
917
|
-
low: "reasoningLow",
|
|
918
|
-
medium: "reasoningMedium",
|
|
919
|
-
high: "reasoningHigh",
|
|
920
|
-
xhigh: "reasoningXhigh",
|
|
921
|
-
max: "reasoningMax"
|
|
922
|
-
}[effort] ?? "unknown");
|
|
923
|
-
}
|
|
924
|
-
function parseCapacity(value) {
|
|
1004
|
+
function parsePositiveCapacity(value) {
|
|
925
1005
|
const matched = value.trim().toLowerCase().replace(/[,_\s]/g, "").match(/^(\d+(?:\.\d+)?)(k|m)?$/);
|
|
926
1006
|
if (matched === null) return null;
|
|
927
1007
|
const multiplier = matched[2] === "m" ? 1e6 : matched[2] === "k" ? 1e3 : 1;
|
|
928
1008
|
const parsed = Number(matched[1]) * multiplier;
|
|
929
|
-
return Number.isSafeInteger(parsed) && parsed >= 1
|
|
1009
|
+
return Number.isSafeInteger(parsed) && parsed >= 1 ? parsed : null;
|
|
1010
|
+
}
|
|
1011
|
+
function parseCapacity(value) {
|
|
1012
|
+
const parsed = parsePositiveCapacity(value);
|
|
1013
|
+
return parsed !== null && parsed <= 1e6 ? parsed : null;
|
|
930
1014
|
}
|
|
931
1015
|
function formatCapacity(value) {
|
|
932
1016
|
if (value % 1e3 === 0) return `${value / 1e3}K`;
|
|
@@ -1008,10 +1092,15 @@ window.__ModuleLoader__.load({
|
|
|
1008
1092
|
searchProviderHint: "选择 DSH Web 搜索工具使用默认来源,或改用当前 ChatGPT 订阅的 Codex 搜索来源。",
|
|
1009
1093
|
searchProviderDsh: "DSH 默认",
|
|
1010
1094
|
searchProviderCodex: "Codex 订阅",
|
|
1095
|
+
subagentProvider: "子代理 Provider",
|
|
1096
|
+
subagentProviderHint: "选择 DSH 当前已接入且可用的模型提供方。",
|
|
1011
1097
|
subagentModel: "子代理模型",
|
|
1012
|
-
subagentModelHint: "
|
|
1098
|
+
subagentModelHint: "仅当父 Agent 使用 Codex 订阅模型时生效;模型可来自任意已接入 Provider。",
|
|
1013
1099
|
subagentReasoningEffort: "子代理思考深度",
|
|
1014
|
-
subagentReasoningEffortHint: "
|
|
1100
|
+
subagentReasoningEffortHint: "选项来自所选模型实际公开的 reasoning effort 能力。",
|
|
1101
|
+
providerDefault: "使用 Provider 默认值",
|
|
1102
|
+
effectiveContextWindow: "有效上下文窗口",
|
|
1103
|
+
selectedModelContextHint: "选择模型后展开;该值仅用于子 Agent 的 DSH 上下文预算与压缩判断。",
|
|
1015
1104
|
reasoningNone: "无",
|
|
1016
1105
|
reasoningLow: "低",
|
|
1017
1106
|
reasoningMedium: "中",
|
|
@@ -1108,10 +1197,15 @@ window.__ModuleLoader__.load({
|
|
|
1108
1197
|
searchProviderHint: "Choose whether DSH web search uses its default provider or the Codex search source from this ChatGPT subscription.",
|
|
1109
1198
|
searchProviderDsh: "DSH default",
|
|
1110
1199
|
searchProviderCodex: "Codex subscription",
|
|
1200
|
+
subagentProvider: "Subagent provider",
|
|
1201
|
+
subagentProviderHint: "Choose from providers currently connected and available in DSH.",
|
|
1111
1202
|
subagentModel: "Subagent model",
|
|
1112
|
-
subagentModelHint: "
|
|
1203
|
+
subagentModelHint: "Applies only when the parent uses Codex; the selected child model may come from any connected provider.",
|
|
1113
1204
|
subagentReasoningEffort: "Subagent reasoning effort",
|
|
1114
|
-
subagentReasoningEffortHint: "
|
|
1205
|
+
subagentReasoningEffortHint: "Options come from the reasoning-effort capabilities exposed by the selected model.",
|
|
1206
|
+
providerDefault: "Use provider default",
|
|
1207
|
+
effectiveContextWindow: "Effective context window",
|
|
1208
|
+
selectedModelContextHint: "Shown after model selection; used only for the child Agent context budget and DSH compaction decisions.",
|
|
1115
1209
|
reasoningNone: "None",
|
|
1116
1210
|
reasoningLow: "Low",
|
|
1117
1211
|
reasoningMedium: "Medium",
|