@eddyskywalker/dsh-chatgpt-subscription 0.1.11 → 0.1.13
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 +9 -59
- package/README.md +4 -2
- package/lib/client.js +6 -0
- package/lib/client.js.map +1 -1
- package/lib/index.js +104 -3
- package/lib/types/client/CodexSubscriptionSection.d.ts.map +1 -1
- package/lib/types/client/locales.d.ts +5 -1
- package/lib/types/client/locales.d.ts.map +1 -1
- package/lib/types/host/platform-token-store.d.ts.map +1 -1
- package/lib/types/host/token-store-macos.d.ts +19 -0
- package/lib/types/host/token-store-macos.d.ts.map +1 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/shared/contracts.d.ts +1 -1
- package/lib/types/shared/contracts.d.ts.map +1 -1
- package/package.json +126 -126
package/CHANGELOG.md
CHANGED
|
@@ -1,59 +1,9 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
## 0.1.
|
|
4
|
-
|
|
5
|
-
-
|
|
6
|
-
-
|
|
7
|
-
- 新增
|
|
8
|
-
-
|
|
9
|
-
|
|
10
|
-
- 统一模型目录显示名与 Codex App 风格:`5.6 Sol`、`5.6 Terra`、`5.6 Luna`、`5.5`、`5.4`、`5.4 Mini`、`5.3 Codex Spark`,并为 Spark 避免发送不兼容的 `reasoning.summary`。
|
|
11
|
-
|
|
12
|
-
## 0.1.10 - 2026-08-17
|
|
13
|
-
|
|
14
|
-
- 移除临时 Bash Prompt 兼容模块:由于上游 DSH `0.1.0-rc.7` 已经原生修复持久化 Bash 提示符不匹配与重置问题,现按照标记 `DSH_COMPAT_REMOVE(persistent-bash-prompt-mismatch)` 安全移除全部相关兼容代码与测试。保留子代理报告去重兼容模块 `DSH_COMPAT_REMOVE(subagent-report-settlement-dedup)`。
|
|
15
|
-
- 增强 Responses Mapper 对 DSH `0.1.0-rc.7` 中新版规范 `ReplayEnvelope` 嵌套结构(`response.outputItems`)的兼容解构支持。
|
|
16
|
-
|
|
17
|
-
## 0.1.8 - 2026-08-17
|
|
18
|
-
|
|
19
|
-
- 修复 Cordis 插件依赖安全检查:使用 `ctx.inject(['terminals'], ...)` 作用域安全声明,解决在未加载 terminals 服务的 Profile 或非终端环境下直接访问 `ctx.terminals` 抛出 `cannot get property "terminals" without inject` 的启动崩溃问题。
|
|
20
|
-
|
|
21
|
-
## 0.1.7 - 2026-08-17
|
|
22
|
-
|
|
23
|
-
- 临时兼容 DSH `0.1.0-rc.6` 持久化 Bash 提示符不匹配(70倍命令提速):修补 PTY 会话在 `tool-bash-persistent` 设置 `__DSH_PERSISTENT_BASH_PROMPT__ ` 时的就绪判定,避免因底层硬编码 `dsh> ` 及 6 字符截断导致回退到 3.5 秒静默超时。代码统一标记为 `DSH_COMPAT_REMOVE(persistent-bash-prompt-mismatch)`,待 DSH 原生修复后可整体移除。
|
|
24
|
-
|
|
25
|
-
## 0.1.6 - 2026-08-17
|
|
26
|
-
|
|
27
|
-
- 临时兼容 DSH `0.1.0-rc.6` 的子代理报告去重:当 `subagent-settled` 已携带与同一子代理排队 `subagent-report` 完全相同的最终内容时,删除重复报告,保留 settlement 通知;部分报告、不同内容和不同子代理不受影响。代码统一标记为 `DSH_COMPAT_REMOVE(subagent-report-settlement-dedup)`,待 DSH 原生修复后可整体移除。
|
|
28
|
-
- 新增 Linux Host 支持:平台凭据存储选择、用户私有 `0600` TokenStore,以及 Bash/POSIX shell 工具调用兼容说明与测试。
|
|
29
|
-
- 设置页现在根据 Host 返回值展示 Windows DPAPI 或 Linux 文件存储及其真实安全边界。
|
|
30
|
-
- 移除与 Codex 订阅接入无关的执行过程详情折叠功能。
|
|
31
|
-
|
|
32
|
-
## 0.1.2 - 2026-08-16
|
|
33
|
-
|
|
34
|
-
- 优化过程详情折叠(Process folding)的初始化时机与节点匹配探测逻辑。
|
|
35
|
-
- 增强客户端 DOM 观察与挂载测试用例覆盖。
|
|
36
|
-
|
|
37
|
-
## 0.1.1 - 2026-08-16
|
|
38
|
-
|
|
39
|
-
- 新增执行过程详情与思考过程的可折叠展示机制(Collapsible process detail folding)。
|
|
40
|
-
- 增强客户端与服务端 Responses 过程解析及 UI 交互。
|
|
41
|
-
|
|
42
|
-
## 0.1.0 - 2026-08-16
|
|
43
|
-
|
|
44
|
-
- 首个正式版本发布。
|
|
45
|
-
- 完善客户端 UI 样式体系与 `@eddyskywalker` 命名空间配置。
|
|
46
|
-
- 增强命令执行工具与无状态安全重试机制。
|
|
47
|
-
|
|
48
|
-
## 0.1.0-alpha.0 - 2026-08-14
|
|
49
|
-
|
|
50
|
-
- 新增 DSH Host/Client 双端插件与一级“Codex 订阅”设置入口。
|
|
51
|
-
- 新增 ChatGPT OAuth PKCE、localhost callback、DPAPI TokenStore、刷新和注销。
|
|
52
|
-
- 新增 `codex-chatgpt` LLM Adapter、固定 Responses SSE、vision、reasoning 与工具调用映射。
|
|
53
|
-
- 新增 401 单次刷新重试、DSH 有界 retry policy、取消与安全工具参数校验。
|
|
54
|
-
- 新增 Wham usage 双 bucket/双窗口解析、缓存、节流、连接测试和可访问进度条。
|
|
55
|
-
- 新增 OAuth、路由、DPAPI、Responses、额度与 Client 注册测试。
|
|
56
|
-
- 修复 OAuth 失败详情被状态刷新清空、旧 keep-alive 回调连接复用,以及 refresh token 失效后重复尝试的问题;token exchange 现在显示脱敏错误标识。
|
|
57
|
-
- 修复工具调用 replay 缺失时仍发送孤立 `function_call_output` 导致 Codex 返回 400;现在会补全调用配对,并安全处理被压缩历史中的孤立结果。
|
|
58
|
-
|
|
59
|
-
这是首个 prerelease;没有稳定版升级承诺。ChatGPT backend compatibility 可能随上游变化。
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.12 - 2026-08-20
|
|
4
|
+
|
|
5
|
+
- 适配 DSH `0.1.0-rc.8`:peerDependencies / devDependencies 中全部 DSH 包范围从 `^0.1.0-rc.6` 提升至 `^0.1.0-rc.8`,并重新生成 package-lock.json。已在本机 rc.8 依赖集上验证:typecheck、55 项测试与 tsdown 构建全部通过,插件代码无需改动。
|
|
6
|
+
- 移除已无引用的 `@deepseek-ai/dsh-agent` peer 依赖(子代理报告去重兼容模块已于 0.1.11 移除)。
|
|
7
|
+
- 新增 `@deepseek-ai/dsh-client-connection` peer 依赖(客户端 `ContentBlock` 类型来源,符合 rc.8 客户端包 peer 声明惯例)。
|
|
8
|
+
- 说明:rc.8 中 `@deepseek-ai/dsh-client-ui-slots` 不再是 DSH 运行时依赖图成员(仅保留为各客户端包的 devDependency),插件继续将其声明为 peer 依赖以保证安装时解析(`^0.1.0-rc.6` 联网安装时解析到 rc.8;本地锁文件因离线环境暂固定 rc.7,API 与 rc.8 用法一致)。
|
|
9
|
+
|
package/README.md
CHANGED
|
@@ -115,9 +115,10 @@ DSH 模型选择器应显示 **“Codex(ChatGPT 订阅)”**。
|
|
|
115
115
|
若 DSH 已异常退出,可在确认路径后手动处理凭据文件:
|
|
116
116
|
|
|
117
117
|
- Windows:`%DSH_HOME%\storages\dsh-chatgpt-subscription\oauth.dpapi`,未设置 `DSH_HOME` 时为 `%USERPROFILE%\.dsh\storages\dsh-chatgpt-subscription\oauth.dpapi`;
|
|
118
|
+
- macOS:凭据位于登录钥匙串,可执行 `security delete-generic-password -s dsh-chatgpt-subscription -a oauth` 删除;
|
|
118
119
|
- Linux:`$DSH_HOME/storages/dsh-chatgpt-subscription/oauth.json`,未设置 `DSH_HOME` 时为 `~/.dsh/storages/dsh-chatgpt-subscription/oauth.json`。
|
|
119
120
|
|
|
120
|
-
> Windows 文件只能由创建它的用户通过 DPAPI 解密。Linux 文件是未额外加密的 JSON,依赖目录 `0700` 和文件 `0600` 隔离;不要复制、打印或提交该文件。跨平台迁移需要重新登录。
|
|
121
|
+
> Windows 文件只能由创建它的用户通过 DPAPI 解密。macOS 凭据由登录钥匙串在本机加密保存。Linux 文件是未额外加密的 JSON,依赖目录 `0700` 和文件 `0600` 隔离;不要复制、打印或提交该文件。跨平台迁移需要重新登录。
|
|
121
122
|
|
|
122
123
|
## 安全边界
|
|
123
124
|
|
|
@@ -125,8 +126,9 @@ DSH 模型选择器应显示 **“Codex(ChatGPT 订阅)”**。
|
|
|
125
126
|
- OAuth token 只发送到 `https://auth.openai.com/oauth/token`;
|
|
126
127
|
- 模型、图片、搜索与额度地址分别固定为 `https://chatgpt.com/backend-api/codex/responses`、`https://chatgpt.com/backend-api/codex/images/generations`、`https://chatgpt.com/backend-api/codex/alpha/search` 和 `https://chatgpt.com/backend-api/wham/usage`,没有 endpoint override;
|
|
127
128
|
- Windows token bundle 使用 CurrentUser DPAPI;明文只经过 Host 内存和 PowerShell stdin/stdout;
|
|
129
|
+
- macOS token bundle 存入登录钥匙串,通过系统 `security` 命令读写;明文只经过 Host 内存和 `security` 命令行参数,Keychain 在本机加密保存;
|
|
128
130
|
- Linux token bundle 原子写入当前用户私有文件并在读取时校验普通文件、所有者与 `0600` 权限,同时拒绝符号链接;该文件没有应用层加密,同 UID 进程、root、备份和磁盘快照仍可读取;
|
|
129
|
-
-
|
|
131
|
+
- 所有平台的 token 都不会进入浏览器、`settings.yaml` 或日志;
|
|
130
132
|
- 工具调用只有在参数是完整 JSON 对象时才产生可执行的 `block-end`;畸形参数终止本次生成;
|
|
131
133
|
- 所有修改状态的路由只接受同源 JSON POST,并校验 `Origin` 与 `Host`。
|
|
132
134
|
|
package/lib/client.js
CHANGED
|
@@ -700,6 +700,7 @@ window.__ModuleLoader__.load({
|
|
|
700
700
|
function storageLabel(storage, t) {
|
|
701
701
|
if (storage === void 0 || !storage.available) return t("storageUnavailable");
|
|
702
702
|
if (storage.kind === "windows-dpapi") return t("storageWindows");
|
|
703
|
+
if (storage.kind === "macos-keychain") return t("storageMacKeychain");
|
|
703
704
|
if (storage.kind === "linux-file") return t("storageLinuxFile");
|
|
704
705
|
if (storage.kind === "memory") return t("storageMemory");
|
|
705
706
|
return t("storageUnavailable");
|
|
@@ -707,6 +708,7 @@ window.__ModuleLoader__.load({
|
|
|
707
708
|
function storageNotice(storage, t) {
|
|
708
709
|
if (storage === void 0 || !storage.available) return t("securityUnavailable");
|
|
709
710
|
if (storage.kind === "windows-dpapi") return t("securityWindows");
|
|
711
|
+
if (storage.kind === "macos-keychain") return t("securityMacKeychain");
|
|
710
712
|
if (storage.kind === "linux-file") return t("securityLinuxFile");
|
|
711
713
|
if (storage.kind === "memory") return t("securityMemory");
|
|
712
714
|
return t("securityUnavailable");
|
|
@@ -819,10 +821,12 @@ window.__ModuleLoader__.load({
|
|
|
819
821
|
expires: "令牌到期",
|
|
820
822
|
storage: "凭据存储",
|
|
821
823
|
storageWindows: "Windows DPAPI(当前用户加密)",
|
|
824
|
+
storageMacKeychain: "macOS 钥匙串(Keychain 加密)",
|
|
822
825
|
storageLinuxFile: "Linux 用户私有文件(权限 0600)",
|
|
823
826
|
storageMemory: "仅 Host 内存(不持久化)",
|
|
824
827
|
storageUnavailable: "凭据存储不可用",
|
|
825
828
|
securityWindows: "令牌由 Host 使用 Windows CurrentUser DPAPI 加密,不会进入浏览器、settings.yaml 或日志。",
|
|
829
|
+
securityMacKeychain: "令牌由 Host 存入 macOS 登录钥匙串(Keychain),在本机加密保存,不会进入浏览器、settings.yaml 或日志。",
|
|
826
830
|
securityLinuxFile: "令牌仅写入 Host 上当前 Linux 用户可读的 0600 文件,但不会额外加密;同 UID 进程、root、备份和磁盘快照仍可能读取。",
|
|
827
831
|
securityMemory: "令牌仅保留在 Host 内存中,Host 退出后丢失。",
|
|
828
832
|
securityUnavailable: "Host 无法安全访问凭据存储;请修复文件所有者或权限后重试。",
|
|
@@ -900,10 +904,12 @@ window.__ModuleLoader__.load({
|
|
|
900
904
|
expires: "Token expires",
|
|
901
905
|
storage: "Credential storage",
|
|
902
906
|
storageWindows: "Windows DPAPI (current-user encrypted)",
|
|
907
|
+
storageMacKeychain: "macOS Keychain (encrypted)",
|
|
903
908
|
storageLinuxFile: "Linux user-private file (mode 0600)",
|
|
904
909
|
storageMemory: "Host memory only (not persistent)",
|
|
905
910
|
storageUnavailable: "Credential storage unavailable",
|
|
906
911
|
securityWindows: "The Host encrypts tokens with Windows CurrentUser DPAPI; they never enter the browser, settings.yaml, or logs.",
|
|
912
|
+
securityMacKeychain: "The Host stores tokens in the macOS login Keychain, encrypted on this machine; they never enter the browser, settings.yaml, or logs.",
|
|
907
913
|
securityLinuxFile: "Tokens are stored in a mode-0600 file readable only by the current Linux user, but are not additionally encrypted; same-UID processes, root, backups, and disk snapshots can still read them.",
|
|
908
914
|
securityMemory: "Tokens remain only in Host memory and are lost when the Host exits.",
|
|
909
915
|
securityUnavailable: "The Host cannot safely access credential storage. Fix the file owner or permissions and retry.",
|
package/lib/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","names":["formatPercent"],"sources":["../src/compat.ts","../src/client/quota.ts","../src/client/CodexComposerQuota.tsx","../src/client/CodexImageToolView.tsx","../src/shared/model-catalog.ts","../src/client/api.ts","../src/client/CodexSubscriptionSection.tsx","../src/client/locales.ts","../src/client/styles.ts","../src/client/index.tsx"],"sourcesContent":["/**\n * Compatibility constants for the ChatGPT-backed Codex flow. The backend and\n * OAuth parameters are not a public third-party API contract, so every such\n * value is isolated here for review and rollback.\n */\nexport const CHATGPT_OAUTH_ISSUER = 'https://auth.openai.com' as const\nexport const CHATGPT_OAUTH_CLIENT_ID = 'app_EMoamEEZ73f0CkXaXp7hrann' as const\nexport const OAUTH_CALLBACK_HOST = 'localhost' as const\nexport const OAUTH_CALLBACK_PORT = 1455 as const\nexport const OAUTH_CALLBACK_PATH = '/auth/callback' as const\nexport const OAUTH_REDIRECT_URI = `http://${OAUTH_CALLBACK_HOST}:${OAUTH_CALLBACK_PORT}${OAUTH_CALLBACK_PATH}` as const\nexport const OAUTH_SCOPE = 'openid profile email offline_access' as const\nexport const OAUTH_ORIGINATOR = 'opencode' as const\nexport const OAUTH_LOGIN_TIMEOUT_MS = 5 * 60_000\nexport const TOKEN_REFRESH_MARGIN_MS = 60_000\nexport const ROUTE_PREFIX = '/api/dsh-chatgpt-subscription' as const\nexport const PLUGIN_VERSION = '0.1.0-alpha.0' as const\nexport const CODEX_CHATGPT_PROVIDER_ID = 'codex-chatgpt' as const\n\nexport const CODEX_API_BASE = 'https://chatgpt.com/backend-api/codex' as const\nexport const CODEX_RESPONSES_URL = `${CODEX_API_BASE}/responses` as const\nexport const CODEX_IMAGE_GENERATION_URL = `${CODEX_API_BASE}/images/generations` as const\nexport const CODEX_SEARCH_URL = `${CODEX_API_BASE}/alpha/search` as const\nexport const CODEX_USAGE_URL = 'https://chatgpt.com/backend-api/wham/usage' as const\nexport const CODEX_ORIGINATOR = 'opencode' as const\nexport const CODEX_ENHANCED_ORIGINATOR = 'pi' as const\nexport const CODEX_IMAGE_TOOL_NAME = 'codex_image_generate' as const\nexport const CODEX_IMAGE_MODEL = 'gpt-image-2' as const\nexport const CODEX_SEARCH_PROVIDER_ID = 'codex-subscription' as const\nexport const QUOTA_CACHE_MS = 60_000\nexport const QUOTA_MIN_UPSTREAM_INTERVAL_MS = 15_000\n\nexport const OAUTH_AUTHORIZE_URL = `${CHATGPT_OAUTH_ISSUER}/oauth/authorize` as const\nexport const OAUTH_TOKEN_URL = `${CHATGPT_OAUTH_ISSUER}/oauth/token` as const\n","import type { QuotaBucketDto, QuotaStatusDto, QuotaWindowDto } from '../shared/contracts.ts'\n\nexport interface SelectedQuotaWindow {\n bucket: QuotaBucketDto\n window: QuotaWindowDto\n remainingPercent: number\n}\n\nexport function selectQuotaForModel(quota: QuotaStatusDto | undefined, modelId: string | undefined): SelectedQuotaWindow | null {\n if (quota === undefined || quota.buckets.length === 0) return null\n const model = modelId?.toLowerCase() ?? ''\n const wantsSpark = model.includes('spark')\n const bucket = wantsSpark\n ? quota.buckets.find(candidate => `${candidate.id} ${candidate.name}`.toLowerCase().includes('spark'))\n : quota.buckets.find(candidate => candidate.id === 'codex')\n ?? quota.buckets.find(candidate => candidate.name.toLowerCase() === 'codex')\n if (bucket === undefined) return null\n const windows = quotaWindows(bucket)\n if (windows.length === 0) return null\n const window = windows.reduce((tightest, candidate) => (\n candidate.usedPercent > tightest.usedPercent ? candidate : tightest\n ), windows[0]!)\n return {\n bucket,\n window,\n remainingPercent: Math.max(0, 100 - window.usedPercent),\n }\n}\n\nexport function quotaWindows(bucket: QuotaBucketDto): QuotaWindowDto[] {\n if (bucket.windows.length > 0) return bucket.windows\n return [bucket.primary, bucket.secondary].filter((window): window is QuotaWindowDto => window !== null)\n}\n","import { useEffect, useMemo, useRef, useState, useSyncExternalStore } from 'react'\nimport type { SnapshotStore } from '@deepseek-ai/dsh-client-runtime/client'\nimport type { ModelDirectoryState } from '@deepseek-ai/dsh-client-ui-model-selection/client'\nimport type { PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'\nimport { CODEX_CHATGPT_PROVIDER_ID } from '../compat.ts'\nimport type { PluginStatusDto } from '../shared/contracts.ts'\nimport { SubscriptionApi } from './api.ts'\nimport { NS } from './locales.ts'\nimport { selectQuotaForModel } from './quota.ts'\n\ntype Props = PropsRuntime<'conversation.input.right'> & PropsLocale<typeof NS> & {\n api: SubscriptionApi\n directory: SnapshotStore<ModelDirectoryState>\n loadModelDirectory: () => void\n}\n\nexport function CodexComposerQuota({ api, directory, loadModelDirectory, t }: Props): React.JSX.Element | null {\n const modelState = useStore(directory)\n const [status, setStatus] = useState<PluginStatusDto | null>(null)\n const [loading, setLoading] = useState(false)\n const mountedRef = useRef(false)\n const selected = modelState.current\n const isCodex = selected?.provider === CODEX_CHATGPT_PROVIDER_ID\n\n useEffect(() => {\n loadModelDirectory()\n }, [loadModelDirectory])\n\n useEffect(() => {\n mountedRef.current = true\n return () => {\n mountedRef.current = false\n }\n }, [])\n\n useEffect(() => {\n if (!isCodex) return\n let disposed = false\n const refresh = async (): Promise<void> => {\n setLoading(true)\n try {\n const next = await api.status()\n if (!disposed && mountedRef.current) setStatus(next)\n } catch {\n if (!disposed && mountedRef.current) setStatus(null)\n } finally {\n if (!disposed && mountedRef.current) setLoading(false)\n }\n }\n void refresh()\n const timer = window.setInterval(() => {\n if (document.visibilityState === 'visible') void refresh()\n }, 60_000)\n return () => {\n disposed = true\n window.clearInterval(timer)\n }\n }, [api, isCodex])\n\n const quota = useMemo(() => selectQuotaForModel(status?.quota, selected?.model), [selected?.model, status?.quota])\n if (!isCodex || status?.preferences.quickQuotaVisible !== true) return null\n const level = quota === null\n ? 'normal'\n : quota.remainingPercent <= 5\n ? 'danger'\n : quota.remainingPercent <= 20\n ? 'warning'\n : 'normal'\n return <span className=\"dsh-codex-composer-quota\" data-level={level} aria-label={quota === null ? t('quickQuotaLoading') : `${t('quickQuotaLabel')}: ${formatPercent(quota.remainingPercent)}`}>\n <span>{t('quickQuotaLabel')}</span>\n <strong>{quota === null ? (loading ? t('quickQuotaLoading') : '—') : formatPercent(quota.remainingPercent)}</strong>\n </span>\n}\n\nfunction useStore<T>(store: SnapshotStore<T>): T {\n return useSyncExternalStore(\n (listener) => store.subscribe(listener),\n () => store.getSnapshot(),\n () => store.getSnapshot(),\n )\n}\n\nfunction formatPercent(value: number): string {\n return `${new Intl.NumberFormat(undefined, { maximumFractionDigits: 0 }).format(value)}%`\n}\n","import { useEffect, useState } from 'react'\nimport type { ImageAttachmentRef } from '@deepseek-ai/dsh-attachment'\nimport type { ContentBlock } from '@deepseek-ai/dsh-client-connection/client'\nimport type { PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'\nimport { NS } from './locales.ts'\n\nexport type ImageLoader = (attachment: ImageAttachmentRef) => Promise<string>\n\ntype Props = PropsRuntime<'tool.call.toolview'> & PropsLocale<typeof NS> & {\n loadImage: ImageLoader\n}\n\nexport function CodexImageToolView({ block, loadImage, t }: Props): React.JSX.Element {\n const settled = 'kind' in block\n const isError = settled ? block.isError : false\n const prompt = promptFromBlock(block)\n const images = settled && !isError ? imageBlocks(block.content) : []\n const label = isError ? t('imageToolFailed') : settled ? t('imageToolDone') : t('imageToolRunning')\n const summary = prompt ?? textSummary(settled ? block.content : [])\n return <div className=\"dsh-codex-image-tool\" data-state={isError ? 'error' : settled ? 'done' : 'running'}>\n <div className=\"dsh-codex-image-tool-head\">\n <span className=\"dsh-codex-image-dot\" aria-hidden=\"true\" />\n <span className=\"dsh-codex-image-title\">{label}</span>\n {summary !== null ? <span className=\"dsh-codex-image-summary\">{summary}</span> : null}\n </div>\n {images.length > 0 ? <div className=\"dsh-codex-image-grid\">\n {images.map((attachment) => <GeneratedImage key={String(attachment.attachmentId)} attachment={attachment} load={loadImage} label={attachment.name ?? t('image')} t={t} />)}\n </div> : null}\n </div>\n}\n\nfunction GeneratedImage({ attachment, load, label, t }: {\n attachment: ImageAttachmentRef\n load: ImageLoader\n label: string\n t: Props['t']\n}): React.JSX.Element {\n const [src, setSrc] = useState<string | null>(null)\n const [failed, setFailed] = useState(false)\n useEffect(() => {\n let disposed = false\n setSrc(null)\n setFailed(false)\n load(attachment).then((url) => {\n if (!disposed) setSrc(url)\n }, () => {\n if (!disposed) setFailed(true)\n })\n return () => {\n disposed = true\n }\n }, [attachment, load])\n if (failed) return <span className=\"dsh-codex-image-failed\">{t('imageLoadFailed')}</span>\n if (src === null) return <span className=\"dsh-codex-image-loading\">{t('imageLoading')}</span>\n return <img className=\"dsh-codex-image-preview\" src={src} alt={label} />\n}\n\nfunction promptFromBlock(block: Props['block']): string | null {\n const raw = 'kind' in block ? block.call?.argsRaw : block.argsRaw\n if (typeof raw !== 'string' || raw.trim() === '') return null\n try {\n const value = JSON.parse(raw) as unknown\n return typeof value === 'object'\n && value !== null\n && !Array.isArray(value)\n && typeof (value as { prompt?: unknown }).prompt === 'string'\n ? (value as { prompt: string }).prompt\n : null\n } catch {\n return null\n }\n}\n\nfunction imageBlocks(blocks: readonly ContentBlock[]): ImageAttachmentRef[] {\n const result: ImageAttachmentRef[] = []\n for (const block of blocks) {\n if (block.type === 'image') result.push(block.attachment)\n if (block.type === 'tool-result') result.push(...imageBlocks(block.content))\n }\n return result\n}\n\nfunction textSummary(blocks: readonly ContentBlock[]): string | null {\n const text = blocks\n .map((block) => block.type === 'text' || block.type === 'reasoning' ? block.text : '')\n .filter(Boolean)\n .join(' ')\n .trim()\n return text === '' ? null : text\n}\n","export type CodexModelModality = 'text' | 'image'\n\nexport interface CodexModelCatalogEntry {\n id: string\n name: string\n contextWindow: number\n inputModalities: readonly CodexModelModality[]\n defaultReasoningEffort: string\n reasoningProfile: 'standard' | 'gpt-5.6'\n supportsReasoningSummary: boolean\n}\n\nexport const CODEX_MODEL_CATALOG = [\n {\n id: 'gpt-5.6-sol',\n name: '5.6 Sol',\n contextWindow: 272_000,\n inputModalities: ['text', 'image'],\n defaultReasoningEffort: 'medium',\n reasoningProfile: 'gpt-5.6',\n supportsReasoningSummary: true,\n },\n {\n id: 'gpt-5.6-terra',\n name: '5.6 Terra',\n contextWindow: 272_000,\n inputModalities: ['text', 'image'],\n defaultReasoningEffort: 'medium',\n reasoningProfile: 'gpt-5.6',\n supportsReasoningSummary: true,\n },\n {\n id: 'gpt-5.6-luna',\n name: '5.6 Luna',\n contextWindow: 272_000,\n inputModalities: ['text', 'image'],\n defaultReasoningEffort: 'medium',\n reasoningProfile: 'gpt-5.6',\n supportsReasoningSummary: true,\n },\n {\n id: 'gpt-5.5',\n name: '5.5',\n contextWindow: 272_000,\n inputModalities: ['text', 'image'],\n defaultReasoningEffort: 'medium',\n reasoningProfile: 'standard',\n supportsReasoningSummary: true,\n },\n {\n id: 'gpt-5.4',\n name: '5.4',\n contextWindow: 272_000,\n inputModalities: ['text', 'image'],\n defaultReasoningEffort: 'none',\n reasoningProfile: 'standard',\n supportsReasoningSummary: true,\n },\n {\n id: 'gpt-5.4-mini',\n name: '5.4 Mini',\n contextWindow: 272_000,\n inputModalities: ['text', 'image'],\n defaultReasoningEffort: 'none',\n reasoningProfile: 'standard',\n supportsReasoningSummary: true,\n },\n {\n id: 'gpt-5.3-codex-spark',\n name: '5.3 Codex Spark',\n contextWindow: 258_000,\n inputModalities: ['text'],\n defaultReasoningEffort: 'high',\n reasoningProfile: 'standard',\n supportsReasoningSummary: false,\n },\n] as const satisfies readonly CodexModelCatalogEntry[]\n\nexport type CodexModelId = typeof CODEX_MODEL_CATALOG[number]['id']\n\nexport const DEFAULT_CODEX_MODEL = CODEX_MODEL_CATALOG[0]\n\nexport function resolveCodexCatalogEntry(model: string): CodexModelCatalogEntry {\n return CODEX_MODEL_CATALOG.find((entry) => entry.id === model) ?? DEFAULT_CODEX_MODEL\n}\n\nexport function codexModelSupportsImageInput(model: string): boolean {\n return resolveCodexCatalogEntry(model).inputModalities.includes('image')\n}\n\nexport function codexModelSupportsReasoningSummary(model: string): boolean {\n return resolveCodexCatalogEntry(model).supportsReasoningSummary\n}\n","import { ROUTE_PREFIX } from '../compat.ts'\r\nimport type {\r\n ApiEnvelope,\r\n LoginEventDto,\r\n LoginStartDto,\r\n PluginStatusDto,\n QuotaStatusDto,\n ConnectionTestDto,\n SubscriptionPreferencesDto,\n SubscriptionPreferencesUpdateDto,\n} from '../shared/contracts.ts'\n\r\nexport class SubscriptionApi {\r\n status(): Promise<PluginStatusDto> {\r\n return request<PluginStatusDto>(`${ROUTE_PREFIX}/status`)\r\n }\r\n\r\n startLogin(): Promise<LoginStartDto> {\r\n return post<LoginStartDto>(`${ROUTE_PREFIX}/login/start`, {})\r\n }\r\n\r\n cancelLogin(loginId: string): Promise<{ cancelled: boolean }> {\r\n return post(`${ROUTE_PREFIX}/login/cancel`, { loginId })\r\n }\r\n\r\n logout(): Promise<{ authenticated: false }> {\r\n return post(`${ROUTE_PREFIX}/logout`, {})\r\n }\r\n\r\n refresh(): Promise<PluginStatusDto> {\r\n return post(`${ROUTE_PREFIX}/token/refresh`, {})\r\n }\r\n\r\n refreshQuota(): Promise<QuotaStatusDto> {\r\n return post(`${ROUTE_PREFIX}/quota/refresh`, {})\r\n }\r\n\r\n testConnection(): Promise<ConnectionTestDto> {\n return post(`${ROUTE_PREFIX}/connection/test`, {})\n }\n\n updatePreferences(patch: SubscriptionPreferencesUpdateDto): Promise<SubscriptionPreferencesDto> {\n return post(`${ROUTE_PREFIX}/preferences/update`, patch)\n }\n\n events(loginId: string): EventSource {\n return new EventSource(`${ROUTE_PREFIX}/login/events?loginId=${encodeURIComponent(loginId)}`)\n }\n}\n\r\nasync function post<T>(url: string, body: object): Promise<T> {\n return request<T>(url, {\r\n method: 'POST',\r\n headers: { 'content-type': 'application/json' },\r\n body: JSON.stringify(body),\r\n })\r\n}\r\n\r\nasync function request<T>(url: string, init?: RequestInit): Promise<T> {\r\n const response = await fetch(url, { ...init, credentials: 'same-origin' })\r\n const envelope = await response.json() as ApiEnvelope<T>\r\n if (!response.ok || !envelope.ok) {\r\n throw new Error(envelope.ok ? `Request failed (${response.status})` : envelope.error.message)\r\n }\r\n return envelope.value\r\n}\r\n\r\nexport function parseLoginEvent(event: MessageEvent<string>): LoginEventDto | null {\r\n try {\r\n const value = JSON.parse(event.data) as LoginEventDto\r\n return typeof value === 'object' && value !== null && typeof value.type === 'string' ? value : null\r\n } catch {\r\n return null\r\n }\r\n}\r\n","import { useCallback, useEffect, useRef, useState } from 'react'\r\nimport type { PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'\nimport type { CredentialStorageDto, PluginStatusDto, QuotaBucketDto, QuotaWindowDto, SubscriptionPreferencesUpdateDto } from '../shared/contracts.ts'\nimport { CODEX_MODEL_CATALOG } from '../shared/model-catalog.ts'\nimport { SubscriptionApi, parseLoginEvent } from './api.ts'\nimport { NS } from './locales.ts'\nimport { quotaWindows } from './quota.ts'\n\ntype Props = PropsRuntime<'settings.section'> & PropsLocale<typeof NS>\ntype BusyAction = 'login' | 'token' | 'quota' | 'test' | 'logout' | 'preferences' | null\ntype Translate = Props['t']\r\n\r\nexport function CodexSubscriptionSection({ t }: Props): React.JSX.Element {\n const apiRef = useRef(new SubscriptionApi())\r\n const eventSourceRef = useRef<EventSource | null>(null)\r\n const [status, setStatus] = useState<PluginStatusDto | null>(null)\r\n const [busy, setBusy] = useState<BusyAction>(null)\r\n const [error, setError] = useState<string | null>(null)\r\n const [authUrl, setAuthUrl] = useState<string | null>(null)\r\n const [popupBlocked, setPopupBlocked] = useState(false)\r\n const [connection, setConnection] = useState<{ latencyMs: number; checkedAt: number } | null>(null)\r\n\r\n const load = useCallback(async (quiet = false) => {\r\n if (!quiet) setError(null)\r\n try {\r\n const next = await apiRef.current.status()\r\n setStatus(next)\r\n if (next.error !== undefined) setError(next.error.message)\r\n } catch (cause) {\r\n if (!quiet) setError(messageOf(cause))\r\n }\r\n }, [])\r\n\r\n useEffect(() => {\r\n void load()\r\n const refreshWhenVisible = (): void => {\r\n if (document.visibilityState === 'visible') void load(true)\r\n }\r\n document.addEventListener('visibilitychange', refreshWhenVisible)\r\n const timer = window.setInterval(refreshWhenVisible, 60_000)\r\n return () => {\r\n window.clearInterval(timer)\r\n document.removeEventListener('visibilitychange', refreshWhenVisible)\r\n eventSourceRef.current?.close()\r\n }\r\n }, [load])\r\n\r\n const watchLogin = useCallback((loginId: string) => {\r\n eventSourceRef.current?.close()\r\n const source = apiRef.current.events(loginId)\r\n eventSourceRef.current = source\r\n const finish = async (message?: string): Promise<void> => {\r\n source.close()\r\n eventSourceRef.current = null\r\n setBusy(null)\r\n setAuthUrl(null)\r\n if (message !== undefined) setError(message)\r\n // Preserve the terminal OAuth error while refreshing the account DTO.\r\n await load(true)\r\n }\r\n source.addEventListener('completed', (event) => {\r\n const parsed = parseLoginEvent(event as MessageEvent<string>)\r\n if (parsed?.type === 'completed') void finish()\r\n })\r\n source.addEventListener('cancelled', () => void finish())\r\n source.addEventListener('failed', (event) => {\r\n const parsed = parseLoginEvent(event as MessageEvent<string>)\r\n void finish(parsed?.type === 'failed' ? parsed.error.message : 'ChatGPT sign-in failed.')\r\n })\r\n }, [load])\r\n\r\n useEffect(() => {\r\n const loginId = status?.login.active ? status.login.loginId : null\r\n if (loginId !== null && loginId !== undefined && eventSourceRef.current === null) watchLogin(loginId)\r\n }, [status?.login.active, status?.login.loginId, watchLogin])\r\n\r\n const startLogin = async (): Promise<void> => {\r\n setBusy('login')\r\n setError(null)\r\n setPopupBlocked(false)\r\n const popup = window.open('about:blank', 'dsh-chatgpt-oauth', 'popup,width=560,height=760')\r\n try {\r\n const login = await apiRef.current.startLogin()\r\n setAuthUrl(login.authUrl)\r\n if (popup === null) setPopupBlocked(true)\r\n else popup.location.replace(login.authUrl)\r\n watchLogin(login.loginId)\r\n await load(true)\r\n } catch (cause) {\r\n popup?.close()\r\n setBusy(null)\r\n setError(messageOf(cause))\r\n }\r\n }\r\n\r\n const cancelLogin = async (): Promise<void> => {\r\n const loginId = status?.login.loginId\r\n if (loginId === null || loginId === undefined) return\r\n setBusy('login')\r\n try {\r\n await apiRef.current.cancelLogin(loginId)\r\n eventSourceRef.current?.close()\r\n eventSourceRef.current = null\r\n setAuthUrl(null)\r\n await load()\r\n } catch (cause) {\r\n setError(messageOf(cause))\r\n } finally {\r\n setBusy(null)\r\n }\r\n }\r\n\r\n const refreshToken = async (): Promise<void> => run('token', async () => {\r\n setStatus(await apiRef.current.refresh())\r\n })\r\n\r\n const refreshQuota = async (): Promise<void> => run('quota', async () => {\r\n const quota = await apiRef.current.refreshQuota()\r\n setStatus((current) => current === null ? current : { ...current, quota })\r\n })\r\n\r\n const testConnection = async (): Promise<void> => run('test', async () => {\n const result = await apiRef.current.testConnection()\n setConnection({ latencyMs: result.latencyMs, checkedAt: result.checkedAt })\n })\n\n const updatePreferences = async (patch: SubscriptionPreferencesUpdateDto): Promise<void> => run('preferences', async () => {\n const preferences = await apiRef.current.updatePreferences(patch)\n setStatus((current) => current === null ? current : { ...current, preferences })\n })\n\n const logout = async (): Promise<void> => run('logout', async () => {\n await apiRef.current.logout()\r\n eventSourceRef.current?.close()\r\n eventSourceRef.current = null\r\n setAuthUrl(null)\r\n setConnection(null)\r\n await load()\r\n })\r\n\r\n const run = async (action: Exclude<BusyAction, null>, task: () => Promise<void>): Promise<void> => {\r\n setBusy(action)\r\n setError(null)\r\n try {\r\n await task()\r\n } catch (cause) {\r\n setError(messageOf(cause))\r\n } finally {\r\n setBusy(null)\r\n }\r\n }\r\n\r\n const account = status?.account\r\n return <section className=\"dsh-codex-page\" aria-labelledby=\"dsh-codex-title\">\r\n <header>\r\n <h2 id=\"dsh-codex-title\" className=\"dsh-codex-title\">{t('title')}</h2>\r\n <p className=\"dsh-codex-intro\">{t('intro')}</p>\r\n </header>\r\n\r\n {error !== null ? <div className=\"dsh-codex-errorbar\" role=\"alert\">\r\n <span>{error}</span>\r\n {status === null ? <Button disabled={busy !== null} onClick={() => load()}>{t('retry')}</Button> : null}\r\n </div> : null}\r\n\r\n {status === null && error === null ? <Skeleton label={t('loading')} /> : <>\r\n <Section title={t('account')}>\r\n <InfoRow label={status?.authenticated ? t('signedIn') : t('signedOut')} value={account?.email ?? '—'} />\r\n {status?.authenticated ? <>\r\n <InfoRow label={t('plan')} value={account?.planType ?? t('unknown')} />\r\n <InfoRow label={t('accountId')} value={account?.accountIdSuffix ?? '—'} />\r\n <InfoRow label={t('expires')} value={formatDate(account?.tokenExpiresAt)} />\r\n </> : null}\r\n <InfoRow label={t('storage')} value={storageLabel(status?.storage, t)} />\r\n <p className=\"dsh-codex-notice\">{storageNotice(status?.storage, t)}</p>\r\n {status?.login.active ? <p className=\"dsh-codex-muted\" role=\"status\">{t('pending')}</p> : null}\r\n {popupBlocked ? <p className=\"dsh-codex-error\">{t('popupBlocked')}</p> : null}\r\n {authUrl !== null ? <a className=\"dsh-codex-link\" href={authUrl} target=\"_blank\" rel=\"noreferrer\">{t('continueLogin')}</a> : null}\r\n <div className=\"dsh-codex-actions\">\r\n {status?.login.active\r\n ? <Button disabled={busy !== null} onClick={cancelLogin}>{t('cancel')}</Button>\r\n : <Button primary disabled={busy !== null || status?.storage.available === false} onClick={startLogin}>{status?.authenticated ? t('signInAgain') : t('signIn')}</Button>}\r\n {status?.authenticated ? <>\r\n <Button disabled={busy !== null} onClick={refreshToken}>{t('refreshToken')}</Button>\r\n <Button disabled={busy !== null} onClick={logout}>{t('signOut')}</Button>\r\n </> : null}\r\n </div>\r\n </Section>\r\n\r\n <Section title={t('connection')}>\r\n <InfoRow label={t('provider')} value=\"Codex(ChatGPT 订阅) · codex-chatgpt\" />\r\n <InfoRow label={t('connectionState')} value={connection === null ? t('untested') : t('connected')} />\r\n {connection !== null ? <InfoRow label={t('latency')} value={`${connection.latencyMs} ms · ${formatDate(connection.checkedAt)}`} /> : null}\n <div className=\"dsh-codex-models\" aria-label={t('models')}>\n {CODEX_MODEL_CATALOG.map((model) => <code key={model.id} title={model.id}>{model.name}</code>)}\n </div>\n <div className=\"dsh-codex-actions\">\r\n <Button disabled={!status?.authenticated || busy !== null} onClick={testConnection}>{busy === 'test' ? t('testing') : t('testConnection')}</Button>\r\n </div>\r\n </Section>\n\n <Section title={t('enhancements')}>\n <div className=\"dsh-codex-pref-row\">\n <div>\n <strong>{t('searchProvider')}</strong>\n <p className=\"dsh-codex-muted\">{t('searchProviderHint')}</p>\n </div>\n <div className=\"dsh-codex-segments\" role=\"radiogroup\" aria-label={t('searchProvider')}>\n <label>\n <input type=\"radio\" name=\"dsh-codex-search-provider\" checked={status?.preferences.searchProvider === 'dsh'} disabled={busy !== null} onChange={() => updatePreferences({ searchProvider: 'dsh' })} />\n <span>{t('searchProviderDsh')}</span>\n </label>\n <label>\n <input type=\"radio\" name=\"dsh-codex-search-provider\" checked={status?.preferences.searchProvider === 'codex'} disabled={busy !== null} onChange={() => updatePreferences({ searchProvider: 'codex' })} />\n <span>{t('searchProviderCodex')}</span>\n </label>\n </div>\n </div>\n <label className=\"dsh-codex-check\">\n <input type=\"checkbox\" checked={status?.preferences.quickQuotaVisible === true} disabled={busy !== null} onChange={(event) => updatePreferences({ quickQuotaVisible: event.currentTarget.checked })} />\n <span>\n <strong>{t('quickQuota')}</strong>\n <small>{t('quickQuotaHint')}</small>\n </span>\n </label>\n </Section>\n\n <Section title={t('quota')} aside={<Button disabled={!status?.authenticated || busy !== null} onClick={refreshQuota}>{busy === 'quota' ? t('refreshing') : t('refreshQuota')}</Button>}>\n <p className=\"dsh-codex-muted\">{t('quotaIntro')}</p>\n {status?.quota.state === 'signed-out' ? <p className=\"dsh-codex-empty\">{t('quotaSignedOut')}</p> : null}\n {status?.quota.buckets.map((bucket) => <QuotaBucket key={bucket.id} bucket={bucket} t={t} />)}\n {status?.quota.credits !== null && status?.quota.credits !== undefined ? <QuotaFact label={t('credits')} value={status.quota.credits.unlimited ? t('unlimited') : status.quota.credits.balance ?? (status.quota.credits.hasCredits ? t('available') : t('unavailable'))} /> : null}\n {status?.quota.individualLimit !== null && status?.quota.individualLimit !== undefined ? <QuotaFact label={t('monthlySpend')} value={individualLimitLabel(status.quota.individualLimit, t)} /> : null}\n {status?.quota.resetCredits !== null && status?.quota.resetCredits !== undefined ? <QuotaFact label={t('resetCredits')} value={String(status.quota.resetCredits.availableCount)} /> : null}\n {status?.quota.spendControlReached === true ? <p className=\"dsh-codex-warning\" role=\"status\">{t('spendControlReached')}</p> : null}\n {status?.quota.state === 'empty' ? <p className=\"dsh-codex-empty\">{t('noQuota')}</p> : null}\n {status?.quota.stale ? <p className=\"dsh-codex-warning\" role=\"status\">{t('stale')}</p> : null}\r\n {status?.quota.error ? <p className=\"dsh-codex-error\" role=\"alert\">{status.quota.error.message}</p> : null}\r\n {status?.quota.fetchedAt ? <p className=\"dsh-codex-timestamp\">{t('updated')}: {formatDate(status.quota.fetchedAt)}</p> : null}\r\n </Section>\r\n </>}\r\n\r\n <span className=\"dsh-codex-sr\" aria-live=\"polite\">{busy === null ? '' : busy}</span>\r\n </section>\r\n}\r\n\r\nfunction Section({ title, aside, children }: { title: string; aside?: React.ReactNode; children: React.ReactNode }): React.JSX.Element {\r\n return <section className=\"dsh-codex-group\">\r\n <div className=\"dsh-codex-grouphead\"><h3>{title}</h3>{aside}</div>\r\n {children}\r\n </section>\r\n}\r\n\r\nfunction Button({ primary = false, disabled, onClick, children }: { primary?: boolean; disabled?: boolean; onClick: () => void | Promise<void>; children: React.ReactNode }): React.JSX.Element {\r\n return <button className={`dsh-codex-button${primary ? ' dsh-codex-button-primary' : ''}`} type=\"button\" disabled={disabled} onClick={() => void onClick()}>{children}</button>\r\n}\r\n\r\nfunction InfoRow({ label, value }: { label: string; value: string }): React.JSX.Element {\r\n return <div className=\"dsh-codex-row\"><span className=\"dsh-codex-label\">{label}</span><span className=\"dsh-codex-value\">{value}</span></div>\r\n}\r\n\r\nexport function storageLabel(storage: CredentialStorageDto | undefined, t: Translate): string {\r\n if (storage === undefined || !storage.available) return t('storageUnavailable')\r\n if (storage.kind === 'windows-dpapi') return t('storageWindows')\r\n if (storage.kind === 'linux-file') return t('storageLinuxFile')\r\n if (storage.kind === 'memory') return t('storageMemory')\r\n return t('storageUnavailable')\r\n}\r\n\r\nexport function storageNotice(storage: CredentialStorageDto | undefined, t: Translate): string {\r\n if (storage === undefined || !storage.available) return t('securityUnavailable')\r\n if (storage.kind === 'windows-dpapi') return t('securityWindows')\r\n if (storage.kind === 'linux-file') return t('securityLinuxFile')\r\n if (storage.kind === 'memory') return t('securityMemory')\r\n return t('securityUnavailable')\r\n}\r\n\r\nfunction QuotaBucket({ bucket, t }: { bucket: QuotaBucketDto; t: Translate }): React.JSX.Element {\n const windows = quotaWindows(bucket)\n return <article className=\"dsh-codex-quota-card\">\n <div className=\"dsh-codex-quota-title\"><strong>{bucket.name}</strong>{bucket.planType ? <span>{bucket.planType}</span> : null}</div>\n {windows.map((window, index) => <QuotaBar key={`${window.windowDurationMins ?? 'x'}:${window.resetsAt ?? 'x'}:${index}`} label={windowLabel(window.windowDurationMins, t)} window={window} t={t} />)}\n </article>\n}\n\nfunction QuotaFact({ label, value }: { label: string; value: string }): React.JSX.Element {\n return <div className=\"dsh-codex-quota-fact\"><span>{label}</span><strong>{value}</strong></div>\n}\n\r\nexport function QuotaBar({ label, window, t }: { label: string; window: QuotaWindowDto; t: Translate }): React.JSX.Element {\r\n const percent = window.usedPercent\r\n const level = percent >= 95 ? 'danger' : percent >= 80 ? 'warning' : 'normal'\r\n const remaining = Math.max(0, 100 - percent)\r\n return <div className=\"dsh-codex-meter-wrap\">\r\n <div className=\"dsh-codex-meter-label\"><span>{label}</span><strong>{formatPercent(percent)}</strong></div>\r\n <div className={`dsh-codex-meter dsh-codex-meter-${level}`} role=\"progressbar\" aria-label={`${label}: ${formatPercent(percent)} ${t('used')}`} aria-valuemin={0} aria-valuemax={100} aria-valuenow={percent}>\r\n <span style={{ width: `${percent}%` }} />\r\n </div>\r\n <div className=\"dsh-codex-meter-meta\">\r\n <span>{percent >= 100 ? `${t('exhausted')} · ${formatPercent(remaining)} ${t('remaining')}` : `${formatPercent(percent)} ${t('used')} · ${formatPercent(remaining)} ${t('remaining')}`}</span>\r\n <span>{window.resetsAt === null ? '—' : `${t('resets')}: ${formatReset(window.resetsAt)}`}</span>\r\n </div>\r\n </div>\r\n}\r\n\r\nfunction Skeleton({ label }: { label: string }): React.JSX.Element {\r\n return <div className=\"dsh-codex-skeleton\" role=\"status\" aria-label={label}><span /><span /></div>\r\n}\r\n\r\nexport function windowLabel(minutes: number | null, t: Translate): string {\r\n if (minutes === null) return t('limitWindow')\r\n const [value, unit]: [number, Intl.NumberFormatOptions['unit']] = minutes >= 1440 && minutes % 1440 === 0\r\n ? [minutes / 1440, 'day']\r\n : minutes >= 60 && minutes % 60 === 0\r\n ? [minutes / 60, 'hour']\r\n : [Math.round(minutes), 'minute']\r\n return `${new Intl.NumberFormat(undefined, { style: 'unit', unit, unitDisplay: 'long' }).format(value)} ${t('limitWindow')}`\r\n}\r\n\r\nfunction formatPercent(value: number): string {\n return `${new Intl.NumberFormat(undefined, { maximumFractionDigits: 1 }).format(value)}%`\n}\n\nfunction individualLimitLabel(limit: NonNullable<PluginStatusDto['quota']['individualLimit']>, t: Translate): string {\n const parts = [\n limit.remainingPercent !== null ? `${formatPercent(limit.remainingPercent)} ${t('remaining')}` : null,\n limit.limit !== null ? `${t('limit')}: ${limit.limit}` : null,\n limit.used !== null ? `${t('used')}: ${limit.used}` : null,\n limit.resetsAt !== null ? `${t('resets')}: ${formatReset(limit.resetsAt)}` : null,\n ].filter((part): part is string => part !== null)\n return parts.length > 0 ? parts.join(' · ') : t('unknown')\n}\n\r\nfunction formatDate(seconds: number | undefined): string {\r\n if (seconds === undefined) return '—'\r\n return new Intl.DateTimeFormat(undefined, { dateStyle: 'medium', timeStyle: 'short' }).format(seconds * 1000)\r\n}\r\n\r\nexport function formatReset(seconds: number): string {\r\n const absolute = formatDate(seconds)\r\n const diff = seconds * 1000 - Date.now()\r\n const abs = Math.abs(diff)\r\n const [amount, unit]: [number, Intl.RelativeTimeFormatUnit] = abs >= 86_400_000\r\n ? [Math.round(diff / 86_400_000), 'day']\r\n : abs >= 3_600_000\r\n ? [Math.round(diff / 3_600_000), 'hour']\r\n : [Math.round(diff / 60_000), 'minute']\r\n return `${absolute} (${new Intl.RelativeTimeFormat(undefined, { numeric: 'auto' }).format(amount, unit)})`\r\n}\r\n\r\nfunction messageOf(error: unknown): string {\r\n return error instanceof Error ? error.message : String(error)\r\n}\r\n","export const NS = 'dsh-chatgpt-subscription' as const\n\nexport const zh = {\n title: 'Codex 订阅',\n intro: '使用 ChatGPT 账号登录,在 DSH 中使用订阅可用的 Codex 模型。',\n account: '账号',\n signedOut: '尚未登录',\n signedIn: '已登录',\n plan: '套餐',\n accountId: '账号 ID',\n expires: '令牌到期',\n storage: '凭据存储',\n storageWindows: 'Windows DPAPI(当前用户加密)',\n storageLinuxFile: 'Linux 用户私有文件(权限 0600)',\n storageMemory: '仅 Host 内存(不持久化)',\n storageUnavailable: '凭据存储不可用',\n securityWindows: '令牌由 Host 使用 Windows CurrentUser DPAPI 加密,不会进入浏览器、settings.yaml 或日志。',\n securityLinuxFile: '令牌仅写入 Host 上当前 Linux 用户可读的 0600 文件,但不会额外加密;同 UID 进程、root、备份和磁盘快照仍可能读取。',\n securityMemory: '令牌仅保留在 Host 内存中,Host 退出后丢失。',\n securityUnavailable: 'Host 无法安全访问凭据存储;请修复文件所有者或权限后重试。',\n signIn: '使用 ChatGPT 登录',\n signInAgain: '重新登录',\n cancel: '取消登录',\n signOut: '注销',\n refreshToken: '刷新凭据',\n pending: '请在浏览器中完成登录。',\n popupBlocked: '浏览器拦截了登录窗口,请使用下面的链接继续。',\n continueLogin: '打开 ChatGPT 登录页',\n loading: '正在读取状态…',\n connection: '连接',\n provider: 'Provider',\n connectionState: '连接状态',\n connected: '可用',\n untested: '尚未测试',\n testConnection: '测试连接',\n testing: '测试中…',\n latency: '最近延迟',\n models: '可用模型',\n enhancements: '增强功能',\n searchProvider: '搜索来源',\n searchProviderHint: '选择 DSH Web 搜索工具使用默认来源,或改用当前 ChatGPT 订阅的 Codex 搜索来源。',\n searchProviderDsh: 'DSH 默认',\n searchProviderCodex: 'Codex 订阅',\n quickQuota: '在输入框旁显示快捷用量',\n quickQuotaHint: '仅在当前会话选中 codex-chatgpt 模型时显示。',\n quota: '用量与限额',\n quotaIntro: '数据来自 ChatGPT Codex 用量服务。页面可见时最多每 60 秒刷新一次。',\n refreshQuota: '刷新用量',\n refreshing: '刷新中…',\n noQuota: '当前套餐未返回可显示的限额窗口。',\n quotaSignedOut: '登录后可查看订阅限额。',\n stale: '显示的是上次成功获取的数据。',\n updated: '更新时间',\n primary: '主要窗口',\n secondary: '次要窗口',\n limitWindow: '额度',\n used: '已使用',\n remaining: '剩余',\n available: '可用',\n unavailable: '不可用',\n unlimited: '无限',\n credits: 'Credits',\n monthlySpend: '月度消费控制',\n resetCredits: '重置次数',\n spendControlReached: '已触发月度消费控制,新的订阅调用可能被限制。',\n limit: '上限',\n exhausted: '额度已用尽',\n resets: '重置',\n quickQuotaLabel: 'Codex 剩余',\n quickQuotaLoading: '用量…',\n imageToolRunning: '正在生成图片',\n imageToolDone: '已生成图片',\n imageToolFailed: '图片生成失败',\n image: '图片',\n openImage: '打开图片',\n openNamedImage: '打开 {name}',\n imageLoading: '加载图片…',\n imageLoadFailed: '图片加载失败,点击重试',\n imagePreviewClose: '关闭',\n imagePreviewOpenOriginal: '打开原图',\n retry: '重试',\n unknown: '未知',\n} as const\n\nexport const en: Record<keyof typeof zh, string> = {\n title: 'Codex subscription',\n intro: 'Sign in with ChatGPT to use Codex models available to your subscription in DSH.',\n account: 'Account',\n signedOut: 'Not signed in',\n signedIn: 'Signed in',\n plan: 'Plan',\n accountId: 'Account ID',\n expires: 'Token expires',\n storage: 'Credential storage',\n storageWindows: 'Windows DPAPI (current-user encrypted)',\n storageLinuxFile: 'Linux user-private file (mode 0600)',\n storageMemory: 'Host memory only (not persistent)',\n storageUnavailable: 'Credential storage unavailable',\n securityWindows: 'The Host encrypts tokens with Windows CurrentUser DPAPI; they never enter the browser, settings.yaml, or logs.',\n securityLinuxFile: 'Tokens are stored in a mode-0600 file readable only by the current Linux user, but are not additionally encrypted; same-UID processes, root, backups, and disk snapshots can still read them.',\n securityMemory: 'Tokens remain only in Host memory and are lost when the Host exits.',\n securityUnavailable: 'The Host cannot safely access credential storage. Fix the file owner or permissions and retry.',\n signIn: 'Sign in with ChatGPT',\n signInAgain: 'Sign in again',\n cancel: 'Cancel sign-in',\n signOut: 'Sign out',\n refreshToken: 'Refresh credentials',\n pending: 'Complete sign-in in your browser.',\n popupBlocked: 'The sign-in window was blocked. Use the link below to continue.',\n continueLogin: 'Open ChatGPT sign-in',\n loading: 'Reading status…',\n connection: 'Connection',\n provider: 'Provider',\n connectionState: 'Connection status',\n connected: 'Available',\n untested: 'Not tested',\n testConnection: 'Test connection',\n testing: 'Testing…',\n latency: 'Last latency',\n models: 'Available models',\n enhancements: 'Enhancements',\n searchProvider: 'Search provider',\n searchProviderHint: 'Choose whether DSH web search uses its default provider or the Codex search source from this ChatGPT subscription.',\n searchProviderDsh: 'DSH default',\n searchProviderCodex: 'Codex subscription',\n quickQuota: 'Show quick usage beside the composer',\n quickQuotaHint: 'Shown only when the current session uses a codex-chatgpt model.',\n quota: 'Usage and limits',\n quotaIntro: 'Data comes from the ChatGPT Codex usage service and refreshes at most once per minute while visible.',\n refreshQuota: 'Refresh usage',\n refreshing: 'Refreshing…',\n noQuota: 'Your plan did not return any displayable limit windows.',\n quotaSignedOut: 'Sign in to view subscription limits.',\n stale: 'Showing the last successfully fetched data.',\n updated: 'Updated',\n primary: 'Primary window',\n secondary: 'Secondary window',\n limitWindow: 'limit',\n used: 'used',\n remaining: 'remaining',\n available: 'Available',\n unavailable: 'Unavailable',\n unlimited: 'Unlimited',\n credits: 'Credits',\n monthlySpend: 'Monthly spend control',\n resetCredits: 'Reset credits',\n spendControlReached: 'Monthly spend control has been reached; new subscription calls may be limited.',\n limit: 'Limit',\n exhausted: 'Quota exhausted',\n resets: 'Resets',\n quickQuotaLabel: 'Codex left',\n quickQuotaLoading: 'Usage…',\n imageToolRunning: 'Generating image',\n imageToolDone: 'Generated image',\n imageToolFailed: 'Image generation failed',\n image: 'Image',\n openImage: 'Open image',\n openNamedImage: 'Open {name}',\n imageLoading: 'Loading image…',\n imageLoadFailed: 'Image failed to load. Click to retry',\n imagePreviewClose: 'Close',\n imagePreviewOpenOriginal: 'Open original',\n retry: 'Retry',\n unknown: 'Unknown',\n}\n\nexport type LocaleKey = keyof typeof zh\nexport const dictionaries = { zh, en }\n","const STYLE_ID = '@eddyskywalker/dsh-chatgpt-subscription/main'\r\n\r\nconst CSS = `\r\n.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}\r\n.dsh-codex-page *{box-sizing:border-box}\r\n.dsh-codex-title{font-size:15px;font-weight:650;line-height:1.4;margin:0 0 5px}\r\n.dsh-codex-intro,.dsh-codex-muted{color:var(--dsw-alias-label-secondary);font-size:13px;line-height:1.55;margin:0}\r\n.dsh-codex-group{border-top:1px solid var(--dsw-alias-border-l2);min-width:0}\r\n.dsh-codex-grouphead{align-items:center;display:flex;gap:12px;justify-content:space-between;min-height:48px}\r\n.dsh-codex-grouphead h3{font-size:14px;font-weight:650;margin:0}\r\n.dsh-codex-row{align-items:center;border-bottom:1px solid var(--dsw-alias-border-l2);display:flex;gap:20px;justify-content:space-between;min-height:44px;padding:8px 0}\r\n.dsh-codex-label{color:var(--dsw-alias-label-secondary);font-size:13px;flex:0 0 auto}\r\n.dsh-codex-value{font-size:13px;min-width:0;overflow-wrap:anywhere;text-align:right}\r\n.dsh-codex-actions{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end;padding-top:12px}\n.dsh-codex-button{background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);border-radius:999px;color:var(--dsw-alias-label-primary);cursor:pointer;font:inherit;font-size:13px;line-height:1;padding:8px 13px;white-space:nowrap}\n.dsh-codex-button:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}\n.dsh-codex-button:focus-visible,.dsh-codex-link:focus-visible{outline:2px solid var(--dsw-alias-button-info-fill,#397ee8);outline-offset:2px}\n.dsh-codex-button:disabled{cursor:default;opacity:.5}\r\n.dsh-codex-button-primary{background:var(--dsw-alias-button-info-fill,#397ee8);border-color:transparent;color:var(--dsw-alias-button-info-label,#fff)}\r\n.dsh-codex-notice{background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);border-radius:7px;color:var(--dsw-alias-label-secondary);font-size:12px;line-height:1.55;margin:12px 0 0;padding:10px 12px}\r\n.dsh-codex-error,.dsh-codex-warning{font-size:12px;line-height:1.5;margin:8px 0 0}\r\n.dsh-codex-error{color:var(--dsw-alias-label-danger,#d94b4b)}\r\n.dsh-codex-warning{color:var(--dsw-alias-label-warning,#c77a18)}\r\n.dsh-codex-errorbar{align-items:center;background:color-mix(in srgb,var(--dsw-alias-label-danger,#d94b4b) 9%,transparent);border:1px solid color-mix(in srgb,var(--dsw-alias-label-danger,#d94b4b) 28%,transparent);border-radius:7px;color:var(--dsw-alias-label-danger,#d94b4b);display:flex;font-size:13px;gap:12px;justify-content:space-between;padding:10px 12px}\r\n.dsh-codex-link{color:var(--dsw-alias-label-link,#3278d4);display:inline-block;font-size:13px;margin-top:8px}\r\n.dsh-codex-models{display:flex;flex-wrap:wrap;gap:6px;padding-top:12px}\n.dsh-codex-models code{background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);border-radius:5px;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:11px;padding:4px 6px}\n.dsh-codex-pref-row{align-items:center;border-bottom:1px solid var(--dsw-alias-border-l2);display:flex;gap:16px;justify-content:space-between;min-height:58px;padding:10px 0}\n.dsh-codex-pref-row strong,.dsh-codex-check strong{display:block;font-size:13px;font-weight:600;line-height:1.35}\n.dsh-codex-segments{background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);border-radius:8px;display:flex;flex:none;gap:2px;padding:2px}\n.dsh-codex-segments label{cursor:pointer;display:block}\n.dsh-codex-segments input{position:absolute;opacity:0;pointer-events:none}\n.dsh-codex-segments span{border-radius:6px;color:var(--dsw-alias-label-secondary);display:block;font-size:12px;line-height:1;padding:7px 10px;white-space:nowrap}\n.dsh-codex-segments input:checked+span{background:var(--dsw-alias-bg-base);box-shadow:0 1px 2px rgba(0,0,0,.08);color:var(--dsw-alias-label-primary)}\n.dsh-codex-segments input:focus-visible+span{outline:2px solid var(--dsw-alias-button-info-fill,#397ee8);outline-offset:2px}\n.dsh-codex-segments input:disabled+span{cursor:default;opacity:.5}\n.dsh-codex-check{align-items:flex-start;border-bottom:1px solid var(--dsw-alias-border-l2);cursor:pointer;display:flex;gap:10px;padding:12px 0}\n.dsh-codex-check input{flex:none;margin-top:2px}\n.dsh-codex-check small{color:var(--dsw-alias-label-secondary);display:block;font-size:12px;line-height:1.45;margin-top:2px}\n.dsh-codex-quota-card{background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);border-radius:8px;margin-top:12px;padding:12px}\n.dsh-codex-quota-title{align-items:center;display:flex;font-size:13px;gap:8px;justify-content:space-between}\n.dsh-codex-quota-title span{color:var(--dsw-alias-label-tertiary);font-size:11px;text-transform:uppercase}\n.dsh-codex-quota-fact{align-items:flex-start;border-bottom:1px solid var(--dsw-alias-border-l2);display:flex;font-size:12px;gap:12px;justify-content:space-between;line-height:1.45;padding:10px 0}\n.dsh-codex-quota-fact span{color:var(--dsw-alias-label-secondary);flex:none}\n.dsh-codex-quota-fact strong{font-weight:600;min-width:0;overflow-wrap:anywhere;text-align:right}\n.dsh-codex-meter-wrap{margin-top:13px}\n.dsh-codex-meter-label,.dsh-codex-meter-meta{display:flex;gap:10px;justify-content:space-between}\r\n.dsh-codex-meter-label{font-size:12px;margin-bottom:6px}\r\n.dsh-codex-meter-meta{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:1.45;margin-top:6px}\r\n.dsh-codex-meter{background:var(--dsw-alias-bg-layer-1,rgba(127,127,127,.15));border-radius:999px;height:7px;overflow:hidden;width:100%}\r\n.dsh-codex-meter>span{background:var(--dsw-alias-button-info-fill,#397ee8);border-radius:inherit;display:block;height:100%;max-width:100%;min-width:0;transition:width .25s ease}\r\n.dsh-codex-meter-warning>span{background:var(--dsw-alias-label-warning,#d58a24)}\r\n.dsh-codex-meter-danger>span{background:var(--dsw-alias-label-danger,#d94b4b)}\r\n.dsh-codex-empty{border:1px dashed var(--dsw-alias-border-l2);border-radius:7px;color:var(--dsw-alias-label-tertiary);font-size:12px;margin:12px 0 0;padding:16px;text-align:center}\r\n.dsh-codex-timestamp{color:var(--dsw-alias-label-tertiary);font-size:11px;margin:10px 0 0;text-align:right}\r\n.dsh-codex-skeleton{display:grid;gap:9px;padding-top:10px}\r\n.dsh-codex-skeleton span{animation:dsh-codex-pulse 1.4s ease-in-out infinite;background:var(--dsw-alias-bg-layer-2);border-radius:5px;height:42px}\n.dsh-codex-skeleton span:nth-child(2){animation-delay:.12s}.dsh-codex-skeleton span:nth-child(3){animation-delay:.24s}\n.dsh-codex-sr{height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;clip:rect(0 0 0 0);white-space:nowrap}\n.dsh-codex-composer-quota{align-items:center;background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);border-radius:999px;color:var(--dsw-alias-label-secondary);display:inline-flex;font-size:11px;gap:6px;height:28px;line-height:1;max-width:160px;padding:0 9px;white-space:nowrap}\n.dsh-codex-composer-quota strong{color:var(--dsw-alias-label-primary);font-size:11px;font-weight:650}\n.dsh-codex-composer-quota[data-level=warning] strong{color:var(--dsw-alias-label-warning,#d58a24)}\n.dsh-codex-composer-quota[data-level=danger] strong{color:var(--dsw-alias-label-danger,#d94b4b)}\n.dsh-codex-image-tool{border:1px solid var(--dsw-alias-border-l2);border-radius:8px;display:flex;flex-direction:column;gap:8px;margin:4px 0 4px 4px;max-width:520px;padding:10px 12px}\n.dsh-codex-image-tool-head{align-items:center;display:flex;font-size:13px;gap:8px;min-width:0}\n.dsh-codex-image-dot{background:var(--dsw-alias-button-info-fill,#397ee8);border-radius:50%;display:inline-block;flex:none;height:8px;width:8px}\n.dsh-codex-image-tool[data-state=error] .dsh-codex-image-dot{background:var(--dsw-alias-label-danger,#d94b4b)}\n.dsh-codex-image-title{font-weight:600}\n.dsh-codex-image-summary{color:var(--dsw-alias-label-tertiary);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}\n.dsh-codex-image-grid{display:flex;flex-wrap:wrap;gap:8px}\n.dsh-codex-image-preview{background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);border-radius:8px;display:block;max-height:260px;max-width:min(100%,360px);object-fit:contain}\n.dsh-codex-image-loading,.dsh-codex-image-failed{border:1px dashed var(--dsw-alias-border-l2);border-radius:8px;color:var(--dsw-alias-label-tertiary);display:inline-flex;font-size:12px;line-height:1.4;padding:18px 20px}\n.dsh-codex-image-failed{color:var(--dsw-alias-label-danger,#d94b4b)}\n@keyframes dsh-codex-pulse{0%,100%{opacity:.55}50%{opacity:1}}\n@media(max-width:560px){.dsh-codex-row,.dsh-codex-pref-row,.dsh-codex-quota-fact{align-items:flex-start;flex-direction:column;gap:3px}.dsh-codex-value,.dsh-codex-quota-fact strong{text-align:left}.dsh-codex-actions{justify-content:flex-start}.dsh-codex-grouphead{align-items:flex-start;flex-direction:column;gap:0;padding:12px 0}.dsh-codex-meter-meta{align-items:flex-start;flex-direction:column;gap:2px}.dsh-codex-errorbar{align-items:flex-start;flex-direction:column}.dsh-codex-segments{width:100%}.dsh-codex-segments label{flex:1}.dsh-codex-segments span{text-align:center}.dsh-codex-image-tool{max-width:100%;margin-left:0}}\n@media(prefers-reduced-motion:reduce){.dsh-codex-meter>span{transition:none}.dsh-codex-skeleton span{animation:none}}\r\n`\r\n\r\nexport function installStyles(): () => void {\r\n if (document.querySelector(`style[data-plugin-css=\"${STYLE_ID}\"]`) !== null) return () => undefined\r\n const element = document.createElement('style')\r\n element.dataset.plugin = '@eddyskywalker/dsh-chatgpt-subscription'\r\n element.dataset.pluginCss = STYLE_ID\r\n element.textContent = CSS\r\n document.head.appendChild(element)\r\n return () => element.remove()\r\n}\r\n","import type { ClientContext } from '@deepseek-ai/dsh-client-runtime/client'\nimport type { ImageAttachmentRef } from '@deepseek-ai/dsh-attachment'\nimport type {} from '@deepseek-ai/dsh-client-ui-settings/client'\nimport type {} from '@deepseek-ai/dsh-client-locale/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-slots'\nimport type {} from '@deepseek-ai/dsh-client-ui-model-selection/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-conversation/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-tool/client'\nimport { CODEX_IMAGE_TOOL_NAME } from '../compat.ts'\nimport { CodexComposerQuota } from './CodexComposerQuota.tsx'\nimport { CodexImageToolView, type ImageLoader } from './CodexImageToolView.tsx'\nimport { CodexSubscriptionSection } from './CodexSubscriptionSection.tsx'\nimport { SubscriptionApi } from './api.ts'\nimport { dictionaries, NS, type LocaleKey } from './locales.ts'\nimport { installStyles } from './styles.ts'\n\r\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\r\n interface LocaleNamespaceMap {\r\n 'dsh-chatgpt-subscription': LocaleKey\r\n }\r\n}\r\n\r\nexport const inject = ['slots', 'locale', 'modelDirectories', 'conversation']\n\r\nexport function apply(ctx: ClientContext): void {\r\n ctx.effect(() => ctx.locale.register(NS, dictionaries), 'dsh-chatgpt-subscription: dictionaries')\r\n ctx.effect(() => installStyles(), 'dsh-chatgpt-subscription: styles')\r\n ctx.slots.inject('settings.section', () => ctx.slots.register({\n name: 'settings.section',\n id: 'codex-subscription',\n order: 45,\n label: 'Codex 订阅',\n locale: NS,\n }, CodexSubscriptionSection))\n ctx.slots.inject('conversation.input.right', () => ctx.slots.register({\n name: 'conversation.input.right',\n id: 'codex-subscription-quota',\n order: 35,\n locale: NS,\n inject: (sessionId) => {\n const directory = ctx.modelDirectories.directoryFor(sessionId)\n return {\n api: new SubscriptionApi(),\n directory: directory.store,\n loadModelDirectory: () => {\n void directory.load().catch(() => undefined)\n },\n }\n },\n }, CodexComposerQuota))\n ctx.slots.inject('tool.call.toolview', () => ctx.slots.register({\n name: 'tool.call.toolview',\n key: CODEX_IMAGE_TOOL_NAME,\n locale: NS,\n inject: (sessionId) => ({\n loadImage: imageLoader(ctx, sessionId),\n }),\n }, CodexImageToolView))\n}\n\nfunction imageLoader(ctx: ClientContext, sessionId: string): ImageLoader {\n const conversation = ctx.conversation as unknown as {\n resolveImage(sessionId: string, attachment: ImageAttachmentRef): Promise<string>\n }\n return (attachment) => conversation.resolveImage(sessionId, attachment)\n}\n"],"mappings":";;;;;;;;EAeA,MAAa,eAAe;EAE5B,MAAa,4BAA4B;EASzC,MAAa,wBAAwB;;;EClBrC,SAAgB,oBAAoB,OAAmC,SAAyD;GAC9H,IAAI,UAAU,KAAA,KAAa,MAAM,QAAQ,WAAW,GAAG,OAAO;GAG9D,MAAM,UAFQ,SAAS,YAAY,KAAK,GAAA,CACf,SAAS,OACV,IACpB,MAAM,QAAQ,MAAK,cAAa,GAAG,UAAU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,CAAC,CAAC,YAAY,KAAA,CAAS;MAC7C;KACF;IACF;GACF,GAAG,kBAAkB,CAAC;GACtB,IAAI,MAAM,OAAO,4BAA4B,IAAI,MAAM,SAAS;IAC9D,MAAM;IACN,KAAK;IACL,QAAQ;IACR,SAAS,eAAe,EACtB,WAAW,YAAY,KAAK,SAAS,EACvC;GACF,GAAG,kBAAkB,CAAC;EACxB;EAEA,SAAS,YAAY,KAAoB,WAAgC;GACvE,MAAM,eAAe,IAAI;GAGzB,QAAQ,eAAe,aAAa,aAAa,WAAW,UAAU;EACxE"}
|
|
1
|
+
{"version":3,"file":"client.js","names":["formatPercent"],"sources":["../src/compat.ts","../src/client/quota.ts","../src/client/CodexComposerQuota.tsx","../src/client/CodexImageToolView.tsx","../src/shared/model-catalog.ts","../src/client/api.ts","../src/client/CodexSubscriptionSection.tsx","../src/client/locales.ts","../src/client/styles.ts","../src/client/index.tsx"],"sourcesContent":["/**\n * Compatibility constants for the ChatGPT-backed Codex flow. The backend and\n * OAuth parameters are not a public third-party API contract, so every such\n * value is isolated here for review and rollback.\n */\nexport const CHATGPT_OAUTH_ISSUER = 'https://auth.openai.com' as const\nexport const CHATGPT_OAUTH_CLIENT_ID = 'app_EMoamEEZ73f0CkXaXp7hrann' as const\nexport const OAUTH_CALLBACK_HOST = 'localhost' as const\nexport const OAUTH_CALLBACK_PORT = 1455 as const\nexport const OAUTH_CALLBACK_PATH = '/auth/callback' as const\nexport const OAUTH_REDIRECT_URI = `http://${OAUTH_CALLBACK_HOST}:${OAUTH_CALLBACK_PORT}${OAUTH_CALLBACK_PATH}` as const\nexport const OAUTH_SCOPE = 'openid profile email offline_access' as const\nexport const OAUTH_ORIGINATOR = 'opencode' as const\nexport const OAUTH_LOGIN_TIMEOUT_MS = 5 * 60_000\nexport const TOKEN_REFRESH_MARGIN_MS = 60_000\nexport const ROUTE_PREFIX = '/api/dsh-chatgpt-subscription' as const\nexport const PLUGIN_VERSION = '0.1.0-alpha.0' as const\nexport const CODEX_CHATGPT_PROVIDER_ID = 'codex-chatgpt' as const\n\nexport const CODEX_API_BASE = 'https://chatgpt.com/backend-api/codex' as const\nexport const CODEX_RESPONSES_URL = `${CODEX_API_BASE}/responses` as const\nexport const CODEX_IMAGE_GENERATION_URL = `${CODEX_API_BASE}/images/generations` as const\nexport const CODEX_SEARCH_URL = `${CODEX_API_BASE}/alpha/search` as const\nexport const CODEX_USAGE_URL = 'https://chatgpt.com/backend-api/wham/usage' as const\nexport const CODEX_ORIGINATOR = 'opencode' as const\nexport const CODEX_ENHANCED_ORIGINATOR = 'pi' as const\nexport const CODEX_IMAGE_TOOL_NAME = 'codex_image_generate' as const\nexport const CODEX_IMAGE_MODEL = 'gpt-image-2' as const\nexport const CODEX_SEARCH_PROVIDER_ID = 'codex-subscription' as const\nexport const QUOTA_CACHE_MS = 60_000\nexport const QUOTA_MIN_UPSTREAM_INTERVAL_MS = 15_000\n\nexport const OAUTH_AUTHORIZE_URL = `${CHATGPT_OAUTH_ISSUER}/oauth/authorize` as const\nexport const OAUTH_TOKEN_URL = `${CHATGPT_OAUTH_ISSUER}/oauth/token` as const\n","import type { QuotaBucketDto, QuotaStatusDto, QuotaWindowDto } from '../shared/contracts.ts'\n\nexport interface SelectedQuotaWindow {\n bucket: QuotaBucketDto\n window: QuotaWindowDto\n remainingPercent: number\n}\n\nexport function selectQuotaForModel(quota: QuotaStatusDto | undefined, modelId: string | undefined): SelectedQuotaWindow | null {\n if (quota === undefined || quota.buckets.length === 0) return null\n const model = modelId?.toLowerCase() ?? ''\n const wantsSpark = model.includes('spark')\n const bucket = wantsSpark\n ? quota.buckets.find(candidate => `${candidate.id} ${candidate.name}`.toLowerCase().includes('spark'))\n : quota.buckets.find(candidate => candidate.id === 'codex')\n ?? quota.buckets.find(candidate => candidate.name.toLowerCase() === 'codex')\n if (bucket === undefined) return null\n const windows = quotaWindows(bucket)\n if (windows.length === 0) return null\n const window = windows.reduce((tightest, candidate) => (\n candidate.usedPercent > tightest.usedPercent ? candidate : tightest\n ), windows[0]!)\n return {\n bucket,\n window,\n remainingPercent: Math.max(0, 100 - window.usedPercent),\n }\n}\n\nexport function quotaWindows(bucket: QuotaBucketDto): QuotaWindowDto[] {\n if (bucket.windows.length > 0) return bucket.windows\n return [bucket.primary, bucket.secondary].filter((window): window is QuotaWindowDto => window !== null)\n}\n","import { useEffect, useMemo, useRef, useState, useSyncExternalStore } from 'react'\nimport type { SnapshotStore } from '@deepseek-ai/dsh-client-runtime/client'\nimport type { ModelDirectoryState } from '@deepseek-ai/dsh-client-ui-model-selection/client'\nimport type { PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'\nimport { CODEX_CHATGPT_PROVIDER_ID } from '../compat.ts'\nimport type { PluginStatusDto } from '../shared/contracts.ts'\nimport { SubscriptionApi } from './api.ts'\nimport { NS } from './locales.ts'\nimport { selectQuotaForModel } from './quota.ts'\n\ntype Props = PropsRuntime<'conversation.input.right'> & PropsLocale<typeof NS> & {\n api: SubscriptionApi\n directory: SnapshotStore<ModelDirectoryState>\n loadModelDirectory: () => void\n}\n\nexport function CodexComposerQuota({ api, directory, loadModelDirectory, t }: Props): React.JSX.Element | null {\n const modelState = useStore(directory)\n const [status, setStatus] = useState<PluginStatusDto | null>(null)\n const [loading, setLoading] = useState(false)\n const mountedRef = useRef(false)\n const selected = modelState.current\n const isCodex = selected?.provider === CODEX_CHATGPT_PROVIDER_ID\n\n useEffect(() => {\n loadModelDirectory()\n }, [loadModelDirectory])\n\n useEffect(() => {\n mountedRef.current = true\n return () => {\n mountedRef.current = false\n }\n }, [])\n\n useEffect(() => {\n if (!isCodex) return\n let disposed = false\n const refresh = async (): Promise<void> => {\n setLoading(true)\n try {\n const next = await api.status()\n if (!disposed && mountedRef.current) setStatus(next)\n } catch {\n if (!disposed && mountedRef.current) setStatus(null)\n } finally {\n if (!disposed && mountedRef.current) setLoading(false)\n }\n }\n void refresh()\n const timer = window.setInterval(() => {\n if (document.visibilityState === 'visible') void refresh()\n }, 60_000)\n return () => {\n disposed = true\n window.clearInterval(timer)\n }\n }, [api, isCodex])\n\n const quota = useMemo(() => selectQuotaForModel(status?.quota, selected?.model), [selected?.model, status?.quota])\n if (!isCodex || status?.preferences.quickQuotaVisible !== true) return null\n const level = quota === null\n ? 'normal'\n : quota.remainingPercent <= 5\n ? 'danger'\n : quota.remainingPercent <= 20\n ? 'warning'\n : 'normal'\n return <span className=\"dsh-codex-composer-quota\" data-level={level} aria-label={quota === null ? t('quickQuotaLoading') : `${t('quickQuotaLabel')}: ${formatPercent(quota.remainingPercent)}`}>\n <span>{t('quickQuotaLabel')}</span>\n <strong>{quota === null ? (loading ? t('quickQuotaLoading') : '—') : formatPercent(quota.remainingPercent)}</strong>\n </span>\n}\n\nfunction useStore<T>(store: SnapshotStore<T>): T {\n return useSyncExternalStore(\n (listener) => store.subscribe(listener),\n () => store.getSnapshot(),\n () => store.getSnapshot(),\n )\n}\n\nfunction formatPercent(value: number): string {\n return `${new Intl.NumberFormat(undefined, { maximumFractionDigits: 0 }).format(value)}%`\n}\n","import { useEffect, useState } from 'react'\nimport type { ImageAttachmentRef } from '@deepseek-ai/dsh-attachment'\nimport type { ContentBlock } from '@deepseek-ai/dsh-client-connection/client'\nimport type { PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'\nimport { NS } from './locales.ts'\n\nexport type ImageLoader = (attachment: ImageAttachmentRef) => Promise<string>\n\ntype Props = PropsRuntime<'tool.call.toolview'> & PropsLocale<typeof NS> & {\n loadImage: ImageLoader\n}\n\nexport function CodexImageToolView({ block, loadImage, t }: Props): React.JSX.Element {\n const settled = 'kind' in block\n const isError = settled ? block.isError : false\n const prompt = promptFromBlock(block)\n const images = settled && !isError ? imageBlocks(block.content) : []\n const label = isError ? t('imageToolFailed') : settled ? t('imageToolDone') : t('imageToolRunning')\n const summary = prompt ?? textSummary(settled ? block.content : [])\n return <div className=\"dsh-codex-image-tool\" data-state={isError ? 'error' : settled ? 'done' : 'running'}>\n <div className=\"dsh-codex-image-tool-head\">\n <span className=\"dsh-codex-image-dot\" aria-hidden=\"true\" />\n <span className=\"dsh-codex-image-title\">{label}</span>\n {summary !== null ? <span className=\"dsh-codex-image-summary\">{summary}</span> : null}\n </div>\n {images.length > 0 ? <div className=\"dsh-codex-image-grid\">\n {images.map((attachment) => <GeneratedImage key={String(attachment.attachmentId)} attachment={attachment} load={loadImage} label={attachment.name ?? t('image')} t={t} />)}\n </div> : null}\n </div>\n}\n\nfunction GeneratedImage({ attachment, load, label, t }: {\n attachment: ImageAttachmentRef\n load: ImageLoader\n label: string\n t: Props['t']\n}): React.JSX.Element {\n const [src, setSrc] = useState<string | null>(null)\n const [failed, setFailed] = useState(false)\n useEffect(() => {\n let disposed = false\n setSrc(null)\n setFailed(false)\n load(attachment).then((url) => {\n if (!disposed) setSrc(url)\n }, () => {\n if (!disposed) setFailed(true)\n })\n return () => {\n disposed = true\n }\n }, [attachment, load])\n if (failed) return <span className=\"dsh-codex-image-failed\">{t('imageLoadFailed')}</span>\n if (src === null) return <span className=\"dsh-codex-image-loading\">{t('imageLoading')}</span>\n return <img className=\"dsh-codex-image-preview\" src={src} alt={label} />\n}\n\nfunction promptFromBlock(block: Props['block']): string | null {\n const raw = 'kind' in block ? block.call?.argsRaw : block.argsRaw\n if (typeof raw !== 'string' || raw.trim() === '') return null\n try {\n const value = JSON.parse(raw) as unknown\n return typeof value === 'object'\n && value !== null\n && !Array.isArray(value)\n && typeof (value as { prompt?: unknown }).prompt === 'string'\n ? (value as { prompt: string }).prompt\n : null\n } catch {\n return null\n }\n}\n\nfunction imageBlocks(blocks: readonly ContentBlock[]): ImageAttachmentRef[] {\n const result: ImageAttachmentRef[] = []\n for (const block of blocks) {\n if (block.type === 'image') result.push(block.attachment)\n if (block.type === 'tool-result') result.push(...imageBlocks(block.content))\n }\n return result\n}\n\nfunction textSummary(blocks: readonly ContentBlock[]): string | null {\n const text = blocks\n .map((block) => block.type === 'text' || block.type === 'reasoning' ? block.text : '')\n .filter(Boolean)\n .join(' ')\n .trim()\n return text === '' ? null : text\n}\n","export type CodexModelModality = 'text' | 'image'\n\nexport interface CodexModelCatalogEntry {\n id: string\n name: string\n contextWindow: number\n inputModalities: readonly CodexModelModality[]\n defaultReasoningEffort: string\n reasoningProfile: 'standard' | 'gpt-5.6'\n supportsReasoningSummary: boolean\n}\n\nexport const CODEX_MODEL_CATALOG = [\n {\n id: 'gpt-5.6-sol',\n name: '5.6 Sol',\n contextWindow: 272_000,\n inputModalities: ['text', 'image'],\n defaultReasoningEffort: 'medium',\n reasoningProfile: 'gpt-5.6',\n supportsReasoningSummary: true,\n },\n {\n id: 'gpt-5.6-terra',\n name: '5.6 Terra',\n contextWindow: 272_000,\n inputModalities: ['text', 'image'],\n defaultReasoningEffort: 'medium',\n reasoningProfile: 'gpt-5.6',\n supportsReasoningSummary: true,\n },\n {\n id: 'gpt-5.6-luna',\n name: '5.6 Luna',\n contextWindow: 272_000,\n inputModalities: ['text', 'image'],\n defaultReasoningEffort: 'medium',\n reasoningProfile: 'gpt-5.6',\n supportsReasoningSummary: true,\n },\n {\n id: 'gpt-5.5',\n name: '5.5',\n contextWindow: 272_000,\n inputModalities: ['text', 'image'],\n defaultReasoningEffort: 'medium',\n reasoningProfile: 'standard',\n supportsReasoningSummary: true,\n },\n {\n id: 'gpt-5.4',\n name: '5.4',\n contextWindow: 272_000,\n inputModalities: ['text', 'image'],\n defaultReasoningEffort: 'none',\n reasoningProfile: 'standard',\n supportsReasoningSummary: true,\n },\n {\n id: 'gpt-5.4-mini',\n name: '5.4 Mini',\n contextWindow: 272_000,\n inputModalities: ['text', 'image'],\n defaultReasoningEffort: 'none',\n reasoningProfile: 'standard',\n supportsReasoningSummary: true,\n },\n {\n id: 'gpt-5.3-codex-spark',\n name: '5.3 Codex Spark',\n contextWindow: 258_000,\n inputModalities: ['text'],\n defaultReasoningEffort: 'high',\n reasoningProfile: 'standard',\n supportsReasoningSummary: false,\n },\n] as const satisfies readonly CodexModelCatalogEntry[]\n\nexport type CodexModelId = typeof CODEX_MODEL_CATALOG[number]['id']\n\nexport const DEFAULT_CODEX_MODEL = CODEX_MODEL_CATALOG[0]\n\nexport function resolveCodexCatalogEntry(model: string): CodexModelCatalogEntry {\n return CODEX_MODEL_CATALOG.find((entry) => entry.id === model) ?? DEFAULT_CODEX_MODEL\n}\n\nexport function codexModelSupportsImageInput(model: string): boolean {\n return resolveCodexCatalogEntry(model).inputModalities.includes('image')\n}\n\nexport function codexModelSupportsReasoningSummary(model: string): boolean {\n return resolveCodexCatalogEntry(model).supportsReasoningSummary\n}\n","import { ROUTE_PREFIX } from '../compat.ts'\r\nimport type {\r\n ApiEnvelope,\r\n LoginEventDto,\r\n LoginStartDto,\r\n PluginStatusDto,\n QuotaStatusDto,\n ConnectionTestDto,\n SubscriptionPreferencesDto,\n SubscriptionPreferencesUpdateDto,\n} from '../shared/contracts.ts'\n\r\nexport class SubscriptionApi {\r\n status(): Promise<PluginStatusDto> {\r\n return request<PluginStatusDto>(`${ROUTE_PREFIX}/status`)\r\n }\r\n\r\n startLogin(): Promise<LoginStartDto> {\r\n return post<LoginStartDto>(`${ROUTE_PREFIX}/login/start`, {})\r\n }\r\n\r\n cancelLogin(loginId: string): Promise<{ cancelled: boolean }> {\r\n return post(`${ROUTE_PREFIX}/login/cancel`, { loginId })\r\n }\r\n\r\n logout(): Promise<{ authenticated: false }> {\r\n return post(`${ROUTE_PREFIX}/logout`, {})\r\n }\r\n\r\n refresh(): Promise<PluginStatusDto> {\r\n return post(`${ROUTE_PREFIX}/token/refresh`, {})\r\n }\r\n\r\n refreshQuota(): Promise<QuotaStatusDto> {\r\n return post(`${ROUTE_PREFIX}/quota/refresh`, {})\r\n }\r\n\r\n testConnection(): Promise<ConnectionTestDto> {\n return post(`${ROUTE_PREFIX}/connection/test`, {})\n }\n\n updatePreferences(patch: SubscriptionPreferencesUpdateDto): Promise<SubscriptionPreferencesDto> {\n return post(`${ROUTE_PREFIX}/preferences/update`, patch)\n }\n\n events(loginId: string): EventSource {\n return new EventSource(`${ROUTE_PREFIX}/login/events?loginId=${encodeURIComponent(loginId)}`)\n }\n}\n\r\nasync function post<T>(url: string, body: object): Promise<T> {\n return request<T>(url, {\r\n method: 'POST',\r\n headers: { 'content-type': 'application/json' },\r\n body: JSON.stringify(body),\r\n })\r\n}\r\n\r\nasync function request<T>(url: string, init?: RequestInit): Promise<T> {\r\n const response = await fetch(url, { ...init, credentials: 'same-origin' })\r\n const envelope = await response.json() as ApiEnvelope<T>\r\n if (!response.ok || !envelope.ok) {\r\n throw new Error(envelope.ok ? `Request failed (${response.status})` : envelope.error.message)\r\n }\r\n return envelope.value\r\n}\r\n\r\nexport function parseLoginEvent(event: MessageEvent<string>): LoginEventDto | null {\r\n try {\r\n const value = JSON.parse(event.data) as LoginEventDto\r\n return typeof value === 'object' && value !== null && typeof value.type === 'string' ? value : null\r\n } catch {\r\n return null\r\n }\r\n}\r\n","import { useCallback, useEffect, useRef, useState } from 'react'\r\nimport type { PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'\r\nimport type { CredentialStorageDto, PluginStatusDto, QuotaBucketDto, QuotaWindowDto, SubscriptionPreferencesUpdateDto } from '../shared/contracts.ts'\r\nimport { CODEX_MODEL_CATALOG } from '../shared/model-catalog.ts'\r\nimport { SubscriptionApi, parseLoginEvent } from './api.ts'\r\nimport { NS } from './locales.ts'\r\nimport { quotaWindows } from './quota.ts'\r\n\r\ntype Props = PropsRuntime<'settings.section'> & PropsLocale<typeof NS>\r\ntype BusyAction = 'login' | 'token' | 'quota' | 'test' | 'logout' | 'preferences' | null\r\ntype Translate = Props['t']\r\n\r\nexport function CodexSubscriptionSection({ t }: Props): React.JSX.Element {\r\n const apiRef = useRef(new SubscriptionApi())\r\n const eventSourceRef = useRef<EventSource | null>(null)\r\n const [status, setStatus] = useState<PluginStatusDto | null>(null)\r\n const [busy, setBusy] = useState<BusyAction>(null)\r\n const [error, setError] = useState<string | null>(null)\r\n const [authUrl, setAuthUrl] = useState<string | null>(null)\r\n const [popupBlocked, setPopupBlocked] = useState(false)\r\n const [connection, setConnection] = useState<{ latencyMs: number; checkedAt: number } | null>(null)\r\n\r\n const load = useCallback(async (quiet = false) => {\r\n if (!quiet) setError(null)\r\n try {\r\n const next = await apiRef.current.status()\r\n setStatus(next)\r\n if (next.error !== undefined) setError(next.error.message)\r\n } catch (cause) {\r\n if (!quiet) setError(messageOf(cause))\r\n }\r\n }, [])\r\n\r\n useEffect(() => {\r\n void load()\r\n const refreshWhenVisible = (): void => {\r\n if (document.visibilityState === 'visible') void load(true)\r\n }\r\n document.addEventListener('visibilitychange', refreshWhenVisible)\r\n const timer = window.setInterval(refreshWhenVisible, 60_000)\r\n return () => {\r\n window.clearInterval(timer)\r\n document.removeEventListener('visibilitychange', refreshWhenVisible)\r\n eventSourceRef.current?.close()\r\n }\r\n }, [load])\r\n\r\n const watchLogin = useCallback((loginId: string) => {\r\n eventSourceRef.current?.close()\r\n const source = apiRef.current.events(loginId)\r\n eventSourceRef.current = source\r\n const finish = async (message?: string): Promise<void> => {\r\n source.close()\r\n eventSourceRef.current = null\r\n setBusy(null)\r\n setAuthUrl(null)\r\n if (message !== undefined) setError(message)\r\n // Preserve the terminal OAuth error while refreshing the account DTO.\r\n await load(true)\r\n }\r\n source.addEventListener('completed', (event) => {\r\n const parsed = parseLoginEvent(event as MessageEvent<string>)\r\n if (parsed?.type === 'completed') void finish()\r\n })\r\n source.addEventListener('cancelled', () => void finish())\r\n source.addEventListener('failed', (event) => {\r\n const parsed = parseLoginEvent(event as MessageEvent<string>)\r\n void finish(parsed?.type === 'failed' ? parsed.error.message : 'ChatGPT sign-in failed.')\r\n })\r\n }, [load])\r\n\r\n useEffect(() => {\r\n const loginId = status?.login.active ? status.login.loginId : null\r\n if (loginId !== null && loginId !== undefined && eventSourceRef.current === null) watchLogin(loginId)\r\n }, [status?.login.active, status?.login.loginId, watchLogin])\r\n\r\n const startLogin = async (): Promise<void> => {\r\n setBusy('login')\r\n setError(null)\r\n setPopupBlocked(false)\r\n const popup = window.open('about:blank', 'dsh-chatgpt-oauth', 'popup,width=560,height=760')\r\n try {\r\n const login = await apiRef.current.startLogin()\r\n setAuthUrl(login.authUrl)\r\n if (popup === null) setPopupBlocked(true)\r\n else popup.location.replace(login.authUrl)\r\n watchLogin(login.loginId)\r\n await load(true)\r\n } catch (cause) {\r\n popup?.close()\r\n setBusy(null)\r\n setError(messageOf(cause))\r\n }\r\n }\r\n\r\n const cancelLogin = async (): Promise<void> => {\r\n const loginId = status?.login.loginId\r\n if (loginId === null || loginId === undefined) return\r\n setBusy('login')\r\n try {\r\n await apiRef.current.cancelLogin(loginId)\r\n eventSourceRef.current?.close()\r\n eventSourceRef.current = null\r\n setAuthUrl(null)\r\n await load()\r\n } catch (cause) {\r\n setError(messageOf(cause))\r\n } finally {\r\n setBusy(null)\r\n }\r\n }\r\n\r\n const refreshToken = async (): Promise<void> => run('token', async () => {\r\n setStatus(await apiRef.current.refresh())\r\n })\r\n\r\n const refreshQuota = async (): Promise<void> => run('quota', async () => {\r\n const quota = await apiRef.current.refreshQuota()\r\n setStatus((current) => current === null ? current : { ...current, quota })\r\n })\r\n\r\n const testConnection = async (): Promise<void> => run('test', async () => {\r\n const result = await apiRef.current.testConnection()\r\n setConnection({ latencyMs: result.latencyMs, checkedAt: result.checkedAt })\r\n })\r\n\r\n const updatePreferences = async (patch: SubscriptionPreferencesUpdateDto): Promise<void> => run('preferences', async () => {\r\n const preferences = await apiRef.current.updatePreferences(patch)\r\n setStatus((current) => current === null ? current : { ...current, preferences })\r\n })\r\n\r\n const logout = async (): Promise<void> => run('logout', async () => {\r\n await apiRef.current.logout()\r\n eventSourceRef.current?.close()\r\n eventSourceRef.current = null\r\n setAuthUrl(null)\r\n setConnection(null)\r\n await load()\r\n })\r\n\r\n const run = async (action: Exclude<BusyAction, null>, task: () => Promise<void>): Promise<void> => {\r\n setBusy(action)\r\n setError(null)\r\n try {\r\n await task()\r\n } catch (cause) {\r\n setError(messageOf(cause))\r\n } finally {\r\n setBusy(null)\r\n }\r\n }\r\n\r\n const account = status?.account\r\n return <section className=\"dsh-codex-page\" aria-labelledby=\"dsh-codex-title\">\r\n <header>\r\n <h2 id=\"dsh-codex-title\" className=\"dsh-codex-title\">{t('title')}</h2>\r\n <p className=\"dsh-codex-intro\">{t('intro')}</p>\r\n </header>\r\n\r\n {error !== null ? <div className=\"dsh-codex-errorbar\" role=\"alert\">\r\n <span>{error}</span>\r\n {status === null ? <Button disabled={busy !== null} onClick={() => load()}>{t('retry')}</Button> : null}\r\n </div> : null}\r\n\r\n {status === null && error === null ? <Skeleton label={t('loading')} /> : <>\r\n <Section title={t('account')}>\r\n <InfoRow label={status?.authenticated ? t('signedIn') : t('signedOut')} value={account?.email ?? '—'} />\r\n {status?.authenticated ? <>\r\n <InfoRow label={t('plan')} value={account?.planType ?? t('unknown')} />\r\n <InfoRow label={t('accountId')} value={account?.accountIdSuffix ?? '—'} />\r\n <InfoRow label={t('expires')} value={formatDate(account?.tokenExpiresAt)} />\r\n </> : null}\r\n <InfoRow label={t('storage')} value={storageLabel(status?.storage, t)} />\r\n <p className=\"dsh-codex-notice\">{storageNotice(status?.storage, t)}</p>\r\n {status?.login.active ? <p className=\"dsh-codex-muted\" role=\"status\">{t('pending')}</p> : null}\r\n {popupBlocked ? <p className=\"dsh-codex-error\">{t('popupBlocked')}</p> : null}\r\n {authUrl !== null ? <a className=\"dsh-codex-link\" href={authUrl} target=\"_blank\" rel=\"noreferrer\">{t('continueLogin')}</a> : null}\r\n <div className=\"dsh-codex-actions\">\r\n {status?.login.active\r\n ? <Button disabled={busy !== null} onClick={cancelLogin}>{t('cancel')}</Button>\r\n : <Button primary disabled={busy !== null || status?.storage.available === false} onClick={startLogin}>{status?.authenticated ? t('signInAgain') : t('signIn')}</Button>}\r\n {status?.authenticated ? <>\r\n <Button disabled={busy !== null} onClick={refreshToken}>{t('refreshToken')}</Button>\r\n <Button disabled={busy !== null} onClick={logout}>{t('signOut')}</Button>\r\n </> : null}\r\n </div>\r\n </Section>\r\n\r\n <Section title={t('connection')}>\r\n <InfoRow label={t('provider')} value=\"Codex(ChatGPT 订阅) · codex-chatgpt\" />\r\n <InfoRow label={t('connectionState')} value={connection === null ? t('untested') : t('connected')} />\r\n {connection !== null ? <InfoRow label={t('latency')} value={`${connection.latencyMs} ms · ${formatDate(connection.checkedAt)}`} /> : null}\r\n <div className=\"dsh-codex-models\" aria-label={t('models')}>\r\n {CODEX_MODEL_CATALOG.map((model) => <code key={model.id} title={model.id}>{model.name}</code>)}\r\n </div>\r\n <div className=\"dsh-codex-actions\">\r\n <Button disabled={!status?.authenticated || busy !== null} onClick={testConnection}>{busy === 'test' ? t('testing') : t('testConnection')}</Button>\r\n </div>\r\n </Section>\r\n\r\n <Section title={t('enhancements')}>\r\n <div className=\"dsh-codex-pref-row\">\r\n <div>\r\n <strong>{t('searchProvider')}</strong>\r\n <p className=\"dsh-codex-muted\">{t('searchProviderHint')}</p>\r\n </div>\r\n <div className=\"dsh-codex-segments\" role=\"radiogroup\" aria-label={t('searchProvider')}>\r\n <label>\r\n <input type=\"radio\" name=\"dsh-codex-search-provider\" checked={status?.preferences.searchProvider === 'dsh'} disabled={busy !== null} onChange={() => updatePreferences({ searchProvider: 'dsh' })} />\r\n <span>{t('searchProviderDsh')}</span>\r\n </label>\r\n <label>\r\n <input type=\"radio\" name=\"dsh-codex-search-provider\" checked={status?.preferences.searchProvider === 'codex'} disabled={busy !== null} onChange={() => updatePreferences({ searchProvider: 'codex' })} />\r\n <span>{t('searchProviderCodex')}</span>\r\n </label>\r\n </div>\r\n </div>\r\n <label className=\"dsh-codex-check\">\r\n <input type=\"checkbox\" checked={status?.preferences.quickQuotaVisible === true} disabled={busy !== null} onChange={(event) => updatePreferences({ quickQuotaVisible: event.currentTarget.checked })} />\r\n <span>\r\n <strong>{t('quickQuota')}</strong>\r\n <small>{t('quickQuotaHint')}</small>\r\n </span>\r\n </label>\r\n </Section>\r\n\r\n <Section title={t('quota')} aside={<Button disabled={!status?.authenticated || busy !== null} onClick={refreshQuota}>{busy === 'quota' ? t('refreshing') : t('refreshQuota')}</Button>}>\r\n <p className=\"dsh-codex-muted\">{t('quotaIntro')}</p>\r\n {status?.quota.state === 'signed-out' ? <p className=\"dsh-codex-empty\">{t('quotaSignedOut')}</p> : null}\r\n {status?.quota.buckets.map((bucket) => <QuotaBucket key={bucket.id} bucket={bucket} t={t} />)}\r\n {status?.quota.credits !== null && status?.quota.credits !== undefined ? <QuotaFact label={t('credits')} value={status.quota.credits.unlimited ? t('unlimited') : status.quota.credits.balance ?? (status.quota.credits.hasCredits ? t('available') : t('unavailable'))} /> : null}\r\n {status?.quota.individualLimit !== null && status?.quota.individualLimit !== undefined ? <QuotaFact label={t('monthlySpend')} value={individualLimitLabel(status.quota.individualLimit, t)} /> : null}\r\n {status?.quota.resetCredits !== null && status?.quota.resetCredits !== undefined ? <QuotaFact label={t('resetCredits')} value={String(status.quota.resetCredits.availableCount)} /> : null}\r\n {status?.quota.spendControlReached === true ? <p className=\"dsh-codex-warning\" role=\"status\">{t('spendControlReached')}</p> : null}\r\n {status?.quota.state === 'empty' ? <p className=\"dsh-codex-empty\">{t('noQuota')}</p> : null}\r\n {status?.quota.stale ? <p className=\"dsh-codex-warning\" role=\"status\">{t('stale')}</p> : null}\r\n {status?.quota.error ? <p className=\"dsh-codex-error\" role=\"alert\">{status.quota.error.message}</p> : null}\r\n {status?.quota.fetchedAt ? <p className=\"dsh-codex-timestamp\">{t('updated')}: {formatDate(status.quota.fetchedAt)}</p> : null}\r\n </Section>\r\n </>}\r\n\r\n <span className=\"dsh-codex-sr\" aria-live=\"polite\">{busy === null ? '' : busy}</span>\r\n </section>\r\n}\r\n\r\nfunction Section({ title, aside, children }: { title: string; aside?: React.ReactNode; children: React.ReactNode }): React.JSX.Element {\r\n return <section className=\"dsh-codex-group\">\r\n <div className=\"dsh-codex-grouphead\"><h3>{title}</h3>{aside}</div>\r\n {children}\r\n </section>\r\n}\r\n\r\nfunction Button({ primary = false, disabled, onClick, children }: { primary?: boolean; disabled?: boolean; onClick: () => void | Promise<void>; children: React.ReactNode }): React.JSX.Element {\r\n return <button className={`dsh-codex-button${primary ? ' dsh-codex-button-primary' : ''}`} type=\"button\" disabled={disabled} onClick={() => void onClick()}>{children}</button>\r\n}\r\n\r\nfunction InfoRow({ label, value }: { label: string; value: string }): React.JSX.Element {\r\n return <div className=\"dsh-codex-row\"><span className=\"dsh-codex-label\">{label}</span><span className=\"dsh-codex-value\">{value}</span></div>\r\n}\r\n\r\nexport function storageLabel(storage: CredentialStorageDto | undefined, t: Translate): string {\r\n if (storage === undefined || !storage.available) return t('storageUnavailable')\r\n if (storage.kind === 'windows-dpapi') return t('storageWindows')\r\n if (storage.kind === 'macos-keychain') return t('storageMacKeychain')\r\n if (storage.kind === 'linux-file') return t('storageLinuxFile')\r\n if (storage.kind === 'memory') return t('storageMemory')\r\n return t('storageUnavailable')\r\n}\r\n\r\nexport function storageNotice(storage: CredentialStorageDto | undefined, t: Translate): string {\r\n if (storage === undefined || !storage.available) return t('securityUnavailable')\r\n if (storage.kind === 'windows-dpapi') return t('securityWindows')\r\n if (storage.kind === 'macos-keychain') return t('securityMacKeychain')\r\n if (storage.kind === 'linux-file') return t('securityLinuxFile')\r\n if (storage.kind === 'memory') return t('securityMemory')\r\n return t('securityUnavailable')\r\n}\r\n\r\nfunction QuotaBucket({ bucket, t }: { bucket: QuotaBucketDto; t: Translate }): React.JSX.Element {\r\n const windows = quotaWindows(bucket)\r\n return <article className=\"dsh-codex-quota-card\">\r\n <div className=\"dsh-codex-quota-title\"><strong>{bucket.name}</strong>{bucket.planType ? <span>{bucket.planType}</span> : null}</div>\r\n {windows.map((window, index) => <QuotaBar key={`${window.windowDurationMins ?? 'x'}:${window.resetsAt ?? 'x'}:${index}`} label={windowLabel(window.windowDurationMins, t)} window={window} t={t} />)}\r\n </article>\r\n}\r\n\r\nfunction QuotaFact({ label, value }: { label: string; value: string }): React.JSX.Element {\r\n return <div className=\"dsh-codex-quota-fact\"><span>{label}</span><strong>{value}</strong></div>\r\n}\r\n\r\nexport function QuotaBar({ label, window, t }: { label: string; window: QuotaWindowDto; t: Translate }): React.JSX.Element {\r\n const percent = window.usedPercent\r\n const level = percent >= 95 ? 'danger' : percent >= 80 ? 'warning' : 'normal'\r\n const remaining = Math.max(0, 100 - percent)\r\n return <div className=\"dsh-codex-meter-wrap\">\r\n <div className=\"dsh-codex-meter-label\"><span>{label}</span><strong>{formatPercent(percent)}</strong></div>\r\n <div className={`dsh-codex-meter dsh-codex-meter-${level}`} role=\"progressbar\" aria-label={`${label}: ${formatPercent(percent)} ${t('used')}`} aria-valuemin={0} aria-valuemax={100} aria-valuenow={percent}>\r\n <span style={{ width: `${percent}%` }} />\r\n </div>\r\n <div className=\"dsh-codex-meter-meta\">\r\n <span>{percent >= 100 ? `${t('exhausted')} · ${formatPercent(remaining)} ${t('remaining')}` : `${formatPercent(percent)} ${t('used')} · ${formatPercent(remaining)} ${t('remaining')}`}</span>\r\n <span>{window.resetsAt === null ? '—' : `${t('resets')}: ${formatReset(window.resetsAt)}`}</span>\r\n </div>\r\n </div>\r\n}\r\n\r\nfunction Skeleton({ label }: { label: string }): React.JSX.Element {\r\n return <div className=\"dsh-codex-skeleton\" role=\"status\" aria-label={label}><span /><span /></div>\r\n}\r\n\r\nexport function windowLabel(minutes: number | null, t: Translate): string {\r\n if (minutes === null) return t('limitWindow')\r\n const [value, unit]: [number, Intl.NumberFormatOptions['unit']] = minutes >= 1440 && minutes % 1440 === 0\r\n ? [minutes / 1440, 'day']\r\n : minutes >= 60 && minutes % 60 === 0\r\n ? [minutes / 60, 'hour']\r\n : [Math.round(minutes), 'minute']\r\n return `${new Intl.NumberFormat(undefined, { style: 'unit', unit, unitDisplay: 'long' }).format(value)} ${t('limitWindow')}`\r\n}\r\n\r\nfunction formatPercent(value: number): string {\r\n return `${new Intl.NumberFormat(undefined, { maximumFractionDigits: 1 }).format(value)}%`\r\n}\r\n\r\nfunction individualLimitLabel(limit: NonNullable<PluginStatusDto['quota']['individualLimit']>, t: Translate): string {\r\n const parts = [\r\n limit.remainingPercent !== null ? `${formatPercent(limit.remainingPercent)} ${t('remaining')}` : null,\r\n limit.limit !== null ? `${t('limit')}: ${limit.limit}` : null,\r\n limit.used !== null ? `${t('used')}: ${limit.used}` : null,\r\n limit.resetsAt !== null ? `${t('resets')}: ${formatReset(limit.resetsAt)}` : null,\r\n ].filter((part): part is string => part !== null)\r\n return parts.length > 0 ? parts.join(' · ') : t('unknown')\r\n}\r\n\r\nfunction formatDate(seconds: number | undefined): string {\r\n if (seconds === undefined) return '—'\r\n return new Intl.DateTimeFormat(undefined, { dateStyle: 'medium', timeStyle: 'short' }).format(seconds * 1000)\r\n}\r\n\r\nexport function formatReset(seconds: number): string {\r\n const absolute = formatDate(seconds)\r\n const diff = seconds * 1000 - Date.now()\r\n const abs = Math.abs(diff)\r\n const [amount, unit]: [number, Intl.RelativeTimeFormatUnit] = abs >= 86_400_000\r\n ? [Math.round(diff / 86_400_000), 'day']\r\n : abs >= 3_600_000\r\n ? [Math.round(diff / 3_600_000), 'hour']\r\n : [Math.round(diff / 60_000), 'minute']\r\n return `${absolute} (${new Intl.RelativeTimeFormat(undefined, { numeric: 'auto' }).format(amount, unit)})`\r\n}\r\n\r\nfunction messageOf(error: unknown): string {\r\n return error instanceof Error ? error.message : String(error)\r\n}\r\n","export const NS = 'dsh-chatgpt-subscription' as const\n\nexport const zh = {\n title: 'Codex 订阅',\n intro: '使用 ChatGPT 账号登录,在 DSH 中使用订阅可用的 Codex 模型。',\n account: '账号',\n signedOut: '尚未登录',\n signedIn: '已登录',\n plan: '套餐',\n accountId: '账号 ID',\n expires: '令牌到期',\n storage: '凭据存储',\n storageWindows: 'Windows DPAPI(当前用户加密)',\n storageMacKeychain: 'macOS 钥匙串(Keychain 加密)',\n storageLinuxFile: 'Linux 用户私有文件(权限 0600)',\n storageMemory: '仅 Host 内存(不持久化)',\n storageUnavailable: '凭据存储不可用',\n securityWindows: '令牌由 Host 使用 Windows CurrentUser DPAPI 加密,不会进入浏览器、settings.yaml 或日志。',\n securityMacKeychain: '令牌由 Host 存入 macOS 登录钥匙串(Keychain),在本机加密保存,不会进入浏览器、settings.yaml 或日志。',\n securityLinuxFile: '令牌仅写入 Host 上当前 Linux 用户可读的 0600 文件,但不会额外加密;同 UID 进程、root、备份和磁盘快照仍可能读取。',\n securityMemory: '令牌仅保留在 Host 内存中,Host 退出后丢失。',\n securityUnavailable: 'Host 无法安全访问凭据存储;请修复文件所有者或权限后重试。',\n signIn: '使用 ChatGPT 登录',\n signInAgain: '重新登录',\n cancel: '取消登录',\n signOut: '注销',\n refreshToken: '刷新凭据',\n pending: '请在浏览器中完成登录。',\n popupBlocked: '浏览器拦截了登录窗口,请使用下面的链接继续。',\n continueLogin: '打开 ChatGPT 登录页',\n loading: '正在读取状态…',\n connection: '连接',\n provider: 'Provider',\n connectionState: '连接状态',\n connected: '可用',\n untested: '尚未测试',\n testConnection: '测试连接',\n testing: '测试中…',\n latency: '最近延迟',\n models: '可用模型',\n enhancements: '增强功能',\n searchProvider: '搜索来源',\n searchProviderHint: '选择 DSH Web 搜索工具使用默认来源,或改用当前 ChatGPT 订阅的 Codex 搜索来源。',\n searchProviderDsh: 'DSH 默认',\n searchProviderCodex: 'Codex 订阅',\n quickQuota: '在输入框旁显示快捷用量',\n quickQuotaHint: '仅在当前会话选中 codex-chatgpt 模型时显示。',\n quota: '用量与限额',\n quotaIntro: '数据来自 ChatGPT Codex 用量服务。页面可见时最多每 60 秒刷新一次。',\n refreshQuota: '刷新用量',\n refreshing: '刷新中…',\n noQuota: '当前套餐未返回可显示的限额窗口。',\n quotaSignedOut: '登录后可查看订阅限额。',\n stale: '显示的是上次成功获取的数据。',\n updated: '更新时间',\n primary: '主要窗口',\n secondary: '次要窗口',\n limitWindow: '额度',\n used: '已使用',\n remaining: '剩余',\n available: '可用',\n unavailable: '不可用',\n unlimited: '无限',\n credits: 'Credits',\n monthlySpend: '月度消费控制',\n resetCredits: '重置次数',\n spendControlReached: '已触发月度消费控制,新的订阅调用可能被限制。',\n limit: '上限',\n exhausted: '额度已用尽',\n resets: '重置',\n quickQuotaLabel: 'Codex 剩余',\n quickQuotaLoading: '用量…',\n imageToolRunning: '正在生成图片',\n imageToolDone: '已生成图片',\n imageToolFailed: '图片生成失败',\n image: '图片',\n openImage: '打开图片',\n openNamedImage: '打开 {name}',\n imageLoading: '加载图片…',\n imageLoadFailed: '图片加载失败,点击重试',\n imagePreviewClose: '关闭',\n imagePreviewOpenOriginal: '打开原图',\n retry: '重试',\n unknown: '未知',\n} as const\n\nexport const en: Record<keyof typeof zh, string> = {\n title: 'Codex subscription',\n intro: 'Sign in with ChatGPT to use Codex models available to your subscription in DSH.',\n account: 'Account',\n signedOut: 'Not signed in',\n signedIn: 'Signed in',\n plan: 'Plan',\n accountId: 'Account ID',\n expires: 'Token expires',\n storage: 'Credential storage',\n storageWindows: 'Windows DPAPI (current-user encrypted)',\n storageMacKeychain: 'macOS Keychain (encrypted)',\n storageLinuxFile: 'Linux user-private file (mode 0600)',\n storageMemory: 'Host memory only (not persistent)',\n storageUnavailable: 'Credential storage unavailable',\n securityWindows: 'The Host encrypts tokens with Windows CurrentUser DPAPI; they never enter the browser, settings.yaml, or logs.',\n securityMacKeychain: 'The Host stores tokens in the macOS login Keychain, encrypted on this machine; they never enter the browser, settings.yaml, or logs.',\n securityLinuxFile: 'Tokens are stored in a mode-0600 file readable only by the current Linux user, but are not additionally encrypted; same-UID processes, root, backups, and disk snapshots can still read them.',\n securityMemory: 'Tokens remain only in Host memory and are lost when the Host exits.',\n securityUnavailable: 'The Host cannot safely access credential storage. Fix the file owner or permissions and retry.',\n signIn: 'Sign in with ChatGPT',\n signInAgain: 'Sign in again',\n cancel: 'Cancel sign-in',\n signOut: 'Sign out',\n refreshToken: 'Refresh credentials',\n pending: 'Complete sign-in in your browser.',\n popupBlocked: 'The sign-in window was blocked. Use the link below to continue.',\n continueLogin: 'Open ChatGPT sign-in',\n loading: 'Reading status…',\n connection: 'Connection',\n provider: 'Provider',\n connectionState: 'Connection status',\n connected: 'Available',\n untested: 'Not tested',\n testConnection: 'Test connection',\n testing: 'Testing…',\n latency: 'Last latency',\n models: 'Available models',\n enhancements: 'Enhancements',\n searchProvider: 'Search provider',\n searchProviderHint: 'Choose whether DSH web search uses its default provider or the Codex search source from this ChatGPT subscription.',\n searchProviderDsh: 'DSH default',\n searchProviderCodex: 'Codex subscription',\n quickQuota: 'Show quick usage beside the composer',\n quickQuotaHint: 'Shown only when the current session uses a codex-chatgpt model.',\n quota: 'Usage and limits',\n quotaIntro: 'Data comes from the ChatGPT Codex usage service and refreshes at most once per minute while visible.',\n refreshQuota: 'Refresh usage',\n refreshing: 'Refreshing…',\n noQuota: 'Your plan did not return any displayable limit windows.',\n quotaSignedOut: 'Sign in to view subscription limits.',\n stale: 'Showing the last successfully fetched data.',\n updated: 'Updated',\n primary: 'Primary window',\n secondary: 'Secondary window',\n limitWindow: 'limit',\n used: 'used',\n remaining: 'remaining',\n available: 'Available',\n unavailable: 'Unavailable',\n unlimited: 'Unlimited',\n credits: 'Credits',\n monthlySpend: 'Monthly spend control',\n resetCredits: 'Reset credits',\n spendControlReached: 'Monthly spend control has been reached; new subscription calls may be limited.',\n limit: 'Limit',\n exhausted: 'Quota exhausted',\n resets: 'Resets',\n quickQuotaLabel: 'Codex left',\n quickQuotaLoading: 'Usage…',\n imageToolRunning: 'Generating image',\n imageToolDone: 'Generated image',\n imageToolFailed: 'Image generation failed',\n image: 'Image',\n openImage: 'Open image',\n openNamedImage: 'Open {name}',\n imageLoading: 'Loading image…',\n imageLoadFailed: 'Image failed to load. Click to retry',\n imagePreviewClose: 'Close',\n imagePreviewOpenOriginal: 'Open original',\n retry: 'Retry',\n unknown: 'Unknown',\n}\n\nexport type LocaleKey = keyof typeof zh\nexport const dictionaries = { zh, en }\n","const STYLE_ID = '@eddyskywalker/dsh-chatgpt-subscription/main'\r\n\r\nconst CSS = `\r\n.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}\r\n.dsh-codex-page *{box-sizing:border-box}\r\n.dsh-codex-title{font-size:15px;font-weight:650;line-height:1.4;margin:0 0 5px}\r\n.dsh-codex-intro,.dsh-codex-muted{color:var(--dsw-alias-label-secondary);font-size:13px;line-height:1.55;margin:0}\r\n.dsh-codex-group{border-top:1px solid var(--dsw-alias-border-l2);min-width:0}\r\n.dsh-codex-grouphead{align-items:center;display:flex;gap:12px;justify-content:space-between;min-height:48px}\r\n.dsh-codex-grouphead h3{font-size:14px;font-weight:650;margin:0}\r\n.dsh-codex-row{align-items:center;border-bottom:1px solid var(--dsw-alias-border-l2);display:flex;gap:20px;justify-content:space-between;min-height:44px;padding:8px 0}\r\n.dsh-codex-label{color:var(--dsw-alias-label-secondary);font-size:13px;flex:0 0 auto}\r\n.dsh-codex-value{font-size:13px;min-width:0;overflow-wrap:anywhere;text-align:right}\r\n.dsh-codex-actions{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end;padding-top:12px}\n.dsh-codex-button{background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);border-radius:999px;color:var(--dsw-alias-label-primary);cursor:pointer;font:inherit;font-size:13px;line-height:1;padding:8px 13px;white-space:nowrap}\n.dsh-codex-button:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}\n.dsh-codex-button:focus-visible,.dsh-codex-link:focus-visible{outline:2px solid var(--dsw-alias-button-info-fill,#397ee8);outline-offset:2px}\n.dsh-codex-button:disabled{cursor:default;opacity:.5}\r\n.dsh-codex-button-primary{background:var(--dsw-alias-button-info-fill,#397ee8);border-color:transparent;color:var(--dsw-alias-button-info-label,#fff)}\r\n.dsh-codex-notice{background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);border-radius:7px;color:var(--dsw-alias-label-secondary);font-size:12px;line-height:1.55;margin:12px 0 0;padding:10px 12px}\r\n.dsh-codex-error,.dsh-codex-warning{font-size:12px;line-height:1.5;margin:8px 0 0}\r\n.dsh-codex-error{color:var(--dsw-alias-label-danger,#d94b4b)}\r\n.dsh-codex-warning{color:var(--dsw-alias-label-warning,#c77a18)}\r\n.dsh-codex-errorbar{align-items:center;background:color-mix(in srgb,var(--dsw-alias-label-danger,#d94b4b) 9%,transparent);border:1px solid color-mix(in srgb,var(--dsw-alias-label-danger,#d94b4b) 28%,transparent);border-radius:7px;color:var(--dsw-alias-label-danger,#d94b4b);display:flex;font-size:13px;gap:12px;justify-content:space-between;padding:10px 12px}\r\n.dsh-codex-link{color:var(--dsw-alias-label-link,#3278d4);display:inline-block;font-size:13px;margin-top:8px}\r\n.dsh-codex-models{display:flex;flex-wrap:wrap;gap:6px;padding-top:12px}\n.dsh-codex-models code{background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);border-radius:5px;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:11px;padding:4px 6px}\n.dsh-codex-pref-row{align-items:center;border-bottom:1px solid var(--dsw-alias-border-l2);display:flex;gap:16px;justify-content:space-between;min-height:58px;padding:10px 0}\n.dsh-codex-pref-row strong,.dsh-codex-check strong{display:block;font-size:13px;font-weight:600;line-height:1.35}\n.dsh-codex-segments{background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);border-radius:8px;display:flex;flex:none;gap:2px;padding:2px}\n.dsh-codex-segments label{cursor:pointer;display:block}\n.dsh-codex-segments input{position:absolute;opacity:0;pointer-events:none}\n.dsh-codex-segments span{border-radius:6px;color:var(--dsw-alias-label-secondary);display:block;font-size:12px;line-height:1;padding:7px 10px;white-space:nowrap}\n.dsh-codex-segments input:checked+span{background:var(--dsw-alias-bg-base);box-shadow:0 1px 2px rgba(0,0,0,.08);color:var(--dsw-alias-label-primary)}\n.dsh-codex-segments input:focus-visible+span{outline:2px solid var(--dsw-alias-button-info-fill,#397ee8);outline-offset:2px}\n.dsh-codex-segments input:disabled+span{cursor:default;opacity:.5}\n.dsh-codex-check{align-items:flex-start;border-bottom:1px solid var(--dsw-alias-border-l2);cursor:pointer;display:flex;gap:10px;padding:12px 0}\n.dsh-codex-check input{flex:none;margin-top:2px}\n.dsh-codex-check small{color:var(--dsw-alias-label-secondary);display:block;font-size:12px;line-height:1.45;margin-top:2px}\n.dsh-codex-quota-card{background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);border-radius:8px;margin-top:12px;padding:12px}\n.dsh-codex-quota-title{align-items:center;display:flex;font-size:13px;gap:8px;justify-content:space-between}\n.dsh-codex-quota-title span{color:var(--dsw-alias-label-tertiary);font-size:11px;text-transform:uppercase}\n.dsh-codex-quota-fact{align-items:flex-start;border-bottom:1px solid var(--dsw-alias-border-l2);display:flex;font-size:12px;gap:12px;justify-content:space-between;line-height:1.45;padding:10px 0}\n.dsh-codex-quota-fact span{color:var(--dsw-alias-label-secondary);flex:none}\n.dsh-codex-quota-fact strong{font-weight:600;min-width:0;overflow-wrap:anywhere;text-align:right}\n.dsh-codex-meter-wrap{margin-top:13px}\n.dsh-codex-meter-label,.dsh-codex-meter-meta{display:flex;gap:10px;justify-content:space-between}\r\n.dsh-codex-meter-label{font-size:12px;margin-bottom:6px}\r\n.dsh-codex-meter-meta{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:1.45;margin-top:6px}\r\n.dsh-codex-meter{background:var(--dsw-alias-bg-layer-1,rgba(127,127,127,.15));border-radius:999px;height:7px;overflow:hidden;width:100%}\r\n.dsh-codex-meter>span{background:var(--dsw-alias-button-info-fill,#397ee8);border-radius:inherit;display:block;height:100%;max-width:100%;min-width:0;transition:width .25s ease}\r\n.dsh-codex-meter-warning>span{background:var(--dsw-alias-label-warning,#d58a24)}\r\n.dsh-codex-meter-danger>span{background:var(--dsw-alias-label-danger,#d94b4b)}\r\n.dsh-codex-empty{border:1px dashed var(--dsw-alias-border-l2);border-radius:7px;color:var(--dsw-alias-label-tertiary);font-size:12px;margin:12px 0 0;padding:16px;text-align:center}\r\n.dsh-codex-timestamp{color:var(--dsw-alias-label-tertiary);font-size:11px;margin:10px 0 0;text-align:right}\r\n.dsh-codex-skeleton{display:grid;gap:9px;padding-top:10px}\r\n.dsh-codex-skeleton span{animation:dsh-codex-pulse 1.4s ease-in-out infinite;background:var(--dsw-alias-bg-layer-2);border-radius:5px;height:42px}\n.dsh-codex-skeleton span:nth-child(2){animation-delay:.12s}.dsh-codex-skeleton span:nth-child(3){animation-delay:.24s}\n.dsh-codex-sr{height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;clip:rect(0 0 0 0);white-space:nowrap}\n.dsh-codex-composer-quota{align-items:center;background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);border-radius:999px;color:var(--dsw-alias-label-secondary);display:inline-flex;font-size:11px;gap:6px;height:28px;line-height:1;max-width:160px;padding:0 9px;white-space:nowrap}\n.dsh-codex-composer-quota strong{color:var(--dsw-alias-label-primary);font-size:11px;font-weight:650}\n.dsh-codex-composer-quota[data-level=warning] strong{color:var(--dsw-alias-label-warning,#d58a24)}\n.dsh-codex-composer-quota[data-level=danger] strong{color:var(--dsw-alias-label-danger,#d94b4b)}\n.dsh-codex-image-tool{border:1px solid var(--dsw-alias-border-l2);border-radius:8px;display:flex;flex-direction:column;gap:8px;margin:4px 0 4px 4px;max-width:520px;padding:10px 12px}\n.dsh-codex-image-tool-head{align-items:center;display:flex;font-size:13px;gap:8px;min-width:0}\n.dsh-codex-image-dot{background:var(--dsw-alias-button-info-fill,#397ee8);border-radius:50%;display:inline-block;flex:none;height:8px;width:8px}\n.dsh-codex-image-tool[data-state=error] .dsh-codex-image-dot{background:var(--dsw-alias-label-danger,#d94b4b)}\n.dsh-codex-image-title{font-weight:600}\n.dsh-codex-image-summary{color:var(--dsw-alias-label-tertiary);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}\n.dsh-codex-image-grid{display:flex;flex-wrap:wrap;gap:8px}\n.dsh-codex-image-preview{background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);border-radius:8px;display:block;max-height:260px;max-width:min(100%,360px);object-fit:contain}\n.dsh-codex-image-loading,.dsh-codex-image-failed{border:1px dashed var(--dsw-alias-border-l2);border-radius:8px;color:var(--dsw-alias-label-tertiary);display:inline-flex;font-size:12px;line-height:1.4;padding:18px 20px}\n.dsh-codex-image-failed{color:var(--dsw-alias-label-danger,#d94b4b)}\n@keyframes dsh-codex-pulse{0%,100%{opacity:.55}50%{opacity:1}}\n@media(max-width:560px){.dsh-codex-row,.dsh-codex-pref-row,.dsh-codex-quota-fact{align-items:flex-start;flex-direction:column;gap:3px}.dsh-codex-value,.dsh-codex-quota-fact strong{text-align:left}.dsh-codex-actions{justify-content:flex-start}.dsh-codex-grouphead{align-items:flex-start;flex-direction:column;gap:0;padding:12px 0}.dsh-codex-meter-meta{align-items:flex-start;flex-direction:column;gap:2px}.dsh-codex-errorbar{align-items:flex-start;flex-direction:column}.dsh-codex-segments{width:100%}.dsh-codex-segments label{flex:1}.dsh-codex-segments span{text-align:center}.dsh-codex-image-tool{max-width:100%;margin-left:0}}\n@media(prefers-reduced-motion:reduce){.dsh-codex-meter>span{transition:none}.dsh-codex-skeleton span{animation:none}}\r\n`\r\n\r\nexport function installStyles(): () => void {\r\n if (document.querySelector(`style[data-plugin-css=\"${STYLE_ID}\"]`) !== null) return () => undefined\r\n const element = document.createElement('style')\r\n element.dataset.plugin = '@eddyskywalker/dsh-chatgpt-subscription'\r\n element.dataset.pluginCss = STYLE_ID\r\n element.textContent = CSS\r\n document.head.appendChild(element)\r\n return () => element.remove()\r\n}\r\n","import type { ClientContext } from '@deepseek-ai/dsh-client-runtime/client'\nimport type { ImageAttachmentRef } from '@deepseek-ai/dsh-attachment'\nimport type {} from '@deepseek-ai/dsh-client-ui-settings/client'\nimport type {} from '@deepseek-ai/dsh-client-locale/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-slots'\nimport type {} from '@deepseek-ai/dsh-client-ui-model-selection/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-conversation/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-tool/client'\nimport { CODEX_IMAGE_TOOL_NAME } from '../compat.ts'\nimport { CodexComposerQuota } from './CodexComposerQuota.tsx'\nimport { CodexImageToolView, type ImageLoader } from './CodexImageToolView.tsx'\nimport { CodexSubscriptionSection } from './CodexSubscriptionSection.tsx'\nimport { SubscriptionApi } from './api.ts'\nimport { dictionaries, NS, type LocaleKey } from './locales.ts'\nimport { installStyles } from './styles.ts'\n\r\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\r\n interface LocaleNamespaceMap {\r\n 'dsh-chatgpt-subscription': LocaleKey\r\n }\r\n}\r\n\r\nexport const inject = ['slots', 'locale', 'modelDirectories', 'conversation']\n\r\nexport function apply(ctx: ClientContext): void {\r\n ctx.effect(() => ctx.locale.register(NS, dictionaries), 'dsh-chatgpt-subscription: dictionaries')\r\n ctx.effect(() => installStyles(), 'dsh-chatgpt-subscription: styles')\r\n ctx.slots.inject('settings.section', () => ctx.slots.register({\n name: 'settings.section',\n id: 'codex-subscription',\n order: 45,\n label: 'Codex 订阅',\n locale: NS,\n }, CodexSubscriptionSection))\n ctx.slots.inject('conversation.input.right', () => ctx.slots.register({\n name: 'conversation.input.right',\n id: 'codex-subscription-quota',\n order: 35,\n locale: NS,\n inject: (sessionId) => {\n const directory = ctx.modelDirectories.directoryFor(sessionId)\n return {\n api: new SubscriptionApi(),\n directory: directory.store,\n loadModelDirectory: () => {\n void directory.load().catch(() => undefined)\n },\n }\n },\n }, CodexComposerQuota))\n ctx.slots.inject('tool.call.toolview', () => ctx.slots.register({\n name: 'tool.call.toolview',\n key: CODEX_IMAGE_TOOL_NAME,\n locale: NS,\n inject: (sessionId) => ({\n loadImage: imageLoader(ctx, sessionId),\n }),\n }, CodexImageToolView))\n}\n\nfunction imageLoader(ctx: ClientContext, sessionId: string): ImageLoader {\n const conversation = ctx.conversation as unknown as {\n resolveImage(sessionId: string, attachment: ImageAttachmentRef): Promise<string>\n }\n return (attachment) => conversation.resolveImage(sessionId, attachment)\n}\n"],"mappings":";;;;;;;;EAeA,MAAa,eAAe;EAE5B,MAAa,4BAA4B;EASzC,MAAa,wBAAwB;;;EClBrC,SAAgB,oBAAoB,OAAmC,SAAyD;GAC9H,IAAI,UAAU,KAAA,KAAa,MAAM,QAAQ,WAAW,GAAG,OAAO;GAG9D,MAAM,UAFQ,SAAS,YAAY,KAAK,GAAA,CACf,SAAS,OACV,IACpB,MAAM,QAAQ,MAAK,cAAa,GAAG,UAAU,GAAG,GAAG,UAAU,OAAO,YAAY,CAAC,CAAC,SAAS,OAAO,CAAC,IACnG,MAAM,QAAQ,MAAK,cAAa,UAAU,OAAO,OAAO,KACrD,MAAM,QAAQ,MAAK,cAAa,UAAU,KAAK,YAAY,MAAM,OAAO;GAC/E,IAAI,WAAW,KAAA,GAAW,OAAO;GACjC,MAAM,UAAU,aAAa,MAAM;GACnC,IAAI,QAAQ,WAAW,GAAG,OAAO;GACjC,MAAM,SAAS,QAAQ,QAAQ,UAAU,cACvC,UAAU,cAAc,SAAS,cAAc,YAAY,UAC1D,QAAQ,EAAG;GACd,OAAO;IACL;IACA;IACA,kBAAkB,KAAK,IAAI,GAAG,MAAM,OAAO,WAAW;GACxD;EACF;EAEA,SAAgB,aAAa,QAA0C;GACrE,IAAI,OAAO,QAAQ,SAAS,GAAG,OAAO,OAAO;GAC7C,OAAO,CAAC,OAAO,SAAS,OAAO,SAAS,CAAC,CAAC,QAAQ,WAAqC,WAAW,IAAI;EACxG;;;EChBA,SAAgB,mBAAmB,EAAE,KAAK,WAAW,oBAAoB,KAAsC;GAC7G,MAAM,aAAa,SAAS,SAAS;GACrC,MAAM,CAAC,QAAQ,cAAA,GAAA,MAAA,SAAA,CAA8C,IAAI;GACjE,MAAM,CAAC,SAAS,eAAA,GAAA,MAAA,SAAA,CAAuB,KAAK;GA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B;;;EChEA,MAAa,SAAS;GAAC;GAAS;GAAU;GAAoB;EAAc;EAE5E,SAAgB,MAAM,KAA0B;GAC9C,IAAI,aAAa,IAAI,OAAO,SAAS,IAAI,YAAY,GAAG,wCAAwC;GAChG,IAAI,aAAa,cAAc,GAAG,kCAAkC;GACpE,IAAI,MAAM,OAAO,0BAA0B,IAAI,MAAM,SAAS;IAC5D,MAAM;IACN,IAAI;IACJ,OAAO;IACP,OAAO;IACP,QAAQ;GACV,GAAG,wBAAwB,CAAC;GAC5B,IAAI,MAAM,OAAO,kCAAkC,IAAI,MAAM,SAAS;IACpE,MAAM;IACN,IAAI;IACJ,OAAO;IACP,QAAQ;IACR,SAAS,cAAc;KACrB,MAAM,YAAY,IAAI,iBAAiB,aAAa,SAAS;KAC7D,OAAO;MACL,KAAK,IAAI,gBAAgB;MACzB,WAAW,UAAU;MACrB,0BAA0B;OACxB,UAAe,KAAK,CAAC,CAAC,YAAY,KAAA,CAAS;MAC7C;KACF;IACF;GACF,GAAG,kBAAkB,CAAC;GACtB,IAAI,MAAM,OAAO,4BAA4B,IAAI,MAAM,SAAS;IAC9D,MAAM;IACN,KAAK;IACL,QAAQ;IACR,SAAS,eAAe,EACtB,WAAW,YAAY,KAAK,SAAS,EACvC;GACF,GAAG,kBAAkB,CAAC;EACxB;EAEA,SAAS,YAAY,KAAoB,WAAgC;GACvE,MAAM,eAAe,IAAI;GAGzB,QAAQ,eAAe,aAAa,aAAa,WAAW,UAAU;EACxE"}
|
package/lib/index.js
CHANGED
|
@@ -6,11 +6,11 @@ import { WebError } from "@deepseek-ai/dsh-web";
|
|
|
6
6
|
import http from "node:http";
|
|
7
7
|
import { settingsNamespace } from "@deepseek-ai/dsh-settings";
|
|
8
8
|
import z from "@deepseek-ai/schemastery";
|
|
9
|
+
import { spawn } from "node:child_process";
|
|
9
10
|
import { constants } from "node:fs";
|
|
10
11
|
import { chmod, lstat, mkdir, open, rename, stat, unlink } from "node:fs/promises";
|
|
11
12
|
import { homedir } from "node:os";
|
|
12
13
|
import { dirname, join } from "node:path";
|
|
13
|
-
import { spawn } from "node:child_process";
|
|
14
14
|
//#region src/compat.ts
|
|
15
15
|
/**
|
|
16
16
|
* Compatibility constants for the ChatGPT-backed Codex flow. The backend and
|
|
@@ -2401,6 +2401,106 @@ function parseStoredCredentials(value) {
|
|
|
2401
2401
|
};
|
|
2402
2402
|
}
|
|
2403
2403
|
//#endregion
|
|
2404
|
+
//#region src/host/token-store-macos.ts
|
|
2405
|
+
const DEFAULT_SERVICE = "dsh-chatgpt-subscription";
|
|
2406
|
+
const DEFAULT_ACCOUNT = "oauth";
|
|
2407
|
+
/**
|
|
2408
|
+
* macOS credential storage backed by the login Keychain through the built-in
|
|
2409
|
+
* `security` command-line tool. The payload is encrypted at rest by the
|
|
2410
|
+
* Keychain, so this store reports itself as encrypted like Windows DPAPI.
|
|
2411
|
+
*/
|
|
2412
|
+
var MacKeychainTokenStore = class {
|
|
2413
|
+
service;
|
|
2414
|
+
account;
|
|
2415
|
+
storage = {
|
|
2416
|
+
kind: "macos-keychain",
|
|
2417
|
+
encrypted: true
|
|
2418
|
+
};
|
|
2419
|
+
constructor(service = DEFAULT_SERVICE, account = DEFAULT_ACCOUNT) {
|
|
2420
|
+
this.service = service;
|
|
2421
|
+
this.account = account;
|
|
2422
|
+
if (process.platform !== "darwin") throw new Error("macOS Keychain storage requires macOS");
|
|
2423
|
+
}
|
|
2424
|
+
async load() {
|
|
2425
|
+
const result = await runSecurity([
|
|
2426
|
+
"find-generic-password",
|
|
2427
|
+
"-a",
|
|
2428
|
+
this.account,
|
|
2429
|
+
"-s",
|
|
2430
|
+
this.service,
|
|
2431
|
+
"-w"
|
|
2432
|
+
]);
|
|
2433
|
+
if (result.code === 44) return null;
|
|
2434
|
+
if (result.code !== 0) throw new Error("Keychain credential read failed");
|
|
2435
|
+
try {
|
|
2436
|
+
const payload = result.stdout.replace(/\r?\n$/, "");
|
|
2437
|
+
return parseStoredCredentials(JSON.parse(payload));
|
|
2438
|
+
} catch {
|
|
2439
|
+
throw new Error("Keychain credential payload is invalid");
|
|
2440
|
+
}
|
|
2441
|
+
}
|
|
2442
|
+
async save(value) {
|
|
2443
|
+
if ((await runSecurity([
|
|
2444
|
+
"add-generic-password",
|
|
2445
|
+
"-a",
|
|
2446
|
+
this.account,
|
|
2447
|
+
"-s",
|
|
2448
|
+
this.service,
|
|
2449
|
+
"-w",
|
|
2450
|
+
JSON.stringify(value),
|
|
2451
|
+
"-U"
|
|
2452
|
+
])).code !== 0) throw new Error("Keychain credential write failed");
|
|
2453
|
+
}
|
|
2454
|
+
async clear() {
|
|
2455
|
+
const result = await runSecurity([
|
|
2456
|
+
"delete-generic-password",
|
|
2457
|
+
"-a",
|
|
2458
|
+
this.account,
|
|
2459
|
+
"-s",
|
|
2460
|
+
this.service
|
|
2461
|
+
]);
|
|
2462
|
+
if (result.code !== 0 && result.code !== 44) throw new Error("Keychain credential deletion failed");
|
|
2463
|
+
}
|
|
2464
|
+
};
|
|
2465
|
+
function runSecurity(args) {
|
|
2466
|
+
return new Promise((resolve, reject) => {
|
|
2467
|
+
const child = spawn("security", args, {
|
|
2468
|
+
env: { ...process.env },
|
|
2469
|
+
stdio: [
|
|
2470
|
+
"ignore",
|
|
2471
|
+
"pipe",
|
|
2472
|
+
"pipe"
|
|
2473
|
+
]
|
|
2474
|
+
});
|
|
2475
|
+
let stdout = "";
|
|
2476
|
+
let stderrLength = 0;
|
|
2477
|
+
const timer = setTimeout(() => {
|
|
2478
|
+
child.kill();
|
|
2479
|
+
reject(/* @__PURE__ */ new Error("Keychain helper timed out"));
|
|
2480
|
+
}, 1e4);
|
|
2481
|
+
child.stdout.setEncoding("utf8");
|
|
2482
|
+
child.stdout.on("data", (chunk) => {
|
|
2483
|
+
stdout += chunk;
|
|
2484
|
+
if (stdout.length > 1 << 20) child.kill();
|
|
2485
|
+
});
|
|
2486
|
+
child.stderr.on("data", (chunk) => {
|
|
2487
|
+
stderrLength += chunk.length;
|
|
2488
|
+
if (stderrLength > 1 << 20) child.kill();
|
|
2489
|
+
});
|
|
2490
|
+
child.once("error", (error) => {
|
|
2491
|
+
clearTimeout(timer);
|
|
2492
|
+
reject(error);
|
|
2493
|
+
});
|
|
2494
|
+
child.once("close", (code) => {
|
|
2495
|
+
clearTimeout(timer);
|
|
2496
|
+
resolve({
|
|
2497
|
+
code: code ?? 1,
|
|
2498
|
+
stdout
|
|
2499
|
+
});
|
|
2500
|
+
});
|
|
2501
|
+
});
|
|
2502
|
+
}
|
|
2503
|
+
//#endregion
|
|
2404
2504
|
//#region src/host/token-store-linux.ts
|
|
2405
2505
|
const DIRECTORY_MODE = 448;
|
|
2406
2506
|
const FILE_MODE = 384;
|
|
@@ -2607,8 +2707,9 @@ function runPowerShell(script, path, stdin) {
|
|
|
2607
2707
|
//#region src/host/platform-token-store.ts
|
|
2608
2708
|
function createPlatformTokenStore(platform = process.platform) {
|
|
2609
2709
|
if (platform === "win32") return new WindowsDpapiTokenStore();
|
|
2710
|
+
if (platform === "darwin") return new MacKeychainTokenStore();
|
|
2610
2711
|
if (platform === "linux") return new LinuxFileTokenStore();
|
|
2611
|
-
throw new Error(`Unsupported platform ${platform}; dsh-chatgpt-subscription supports Windows and Linux.`);
|
|
2712
|
+
throw new Error(`Unsupported platform ${platform}; dsh-chatgpt-subscription supports Windows, macOS, and Linux.`);
|
|
2612
2713
|
}
|
|
2613
2714
|
//#endregion
|
|
2614
2715
|
//#region src/host/search-provider-switcher.ts
|
|
@@ -2692,4 +2793,4 @@ function localWebServerBaseUrl(host, port) {
|
|
|
2692
2793
|
return `http://${host === "0.0.0.0" ? "127.0.0.1" : host}:${port}`;
|
|
2693
2794
|
}
|
|
2694
2795
|
//#endregion
|
|
2695
|
-
export { CodexChatGptAdapter, LinuxFileTokenStore, OAuthService, ResponsesClient, UsageService, WindowsDpapiTokenStore, apply, createCodexImageTool, createCodexSearchProvider, createPlatformTokenStore, inject, mapCodexUsage, parseCodexUsage, parseResponsesStream };
|
|
2796
|
+
export { CodexChatGptAdapter, LinuxFileTokenStore, MacKeychainTokenStore, OAuthService, ResponsesClient, UsageService, WindowsDpapiTokenStore, apply, createCodexImageTool, createCodexSearchProvider, createPlatformTokenStore, inject, mapCodexUsage, parseCodexUsage, parseResponsesStream };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodexSubscriptionSection.d.ts","sourceRoot":"","sources":["../../../src/client/CodexSubscriptionSection.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AACjF,OAAO,KAAK,EAAE,oBAAoB,EAAmC,cAAc,EAAoC,MAAM,wBAAwB,CAAA;AAGrJ,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAA;AAGjC,KAAK,KAAK,GAAG,YAAY,CAAC,kBAAkB,CAAC,GAAG,WAAW,CAAC,OAAO,EAAE,CAAC,CAAA;AAEtE,KAAK,SAAS,GAAG,KAAK,CAAC,GAAG,CAAC,CAAA;AAE3B,wBAAgB,wBAAwB,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAuOxE;AAiBD,wBAAgB,YAAY,CAAC,OAAO,EAAE,oBAAoB,GAAG,SAAS,EAAE,CAAC,EAAE,SAAS,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"CodexSubscriptionSection.d.ts","sourceRoot":"","sources":["../../../src/client/CodexSubscriptionSection.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AACjF,OAAO,KAAK,EAAE,oBAAoB,EAAmC,cAAc,EAAoC,MAAM,wBAAwB,CAAA;AAGrJ,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAA;AAGjC,KAAK,KAAK,GAAG,YAAY,CAAC,kBAAkB,CAAC,GAAG,WAAW,CAAC,OAAO,EAAE,CAAC,CAAA;AAEtE,KAAK,SAAS,GAAG,KAAK,CAAC,GAAG,CAAC,CAAA;AAE3B,wBAAgB,wBAAwB,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAuOxE;AAiBD,wBAAgB,YAAY,CAAC,OAAO,EAAE,oBAAoB,GAAG,SAAS,EAAE,CAAC,EAAE,SAAS,GAAG,MAAM,CAO5F;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,SAAS,EAAE,CAAC,EAAE,SAAS,GAAG,MAAM,CAO7F;AAcD,wBAAgB,QAAQ,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,cAAc,CAAC;IAAC,CAAC,EAAE,SAAS,CAAA;CAAE,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAczH;AAMD,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,EAAE,CAAC,EAAE,SAAS,GAAG,MAAM,CAQxE;AAqBD,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAUnD"}
|
|
@@ -10,10 +10,12 @@ export declare const zh: {
|
|
|
10
10
|
readonly expires: "令牌到期";
|
|
11
11
|
readonly storage: "凭据存储";
|
|
12
12
|
readonly storageWindows: "Windows DPAPI(当前用户加密)";
|
|
13
|
+
readonly storageMacKeychain: "macOS 钥匙串(Keychain 加密)";
|
|
13
14
|
readonly storageLinuxFile: "Linux 用户私有文件(权限 0600)";
|
|
14
15
|
readonly storageMemory: "仅 Host 内存(不持久化)";
|
|
15
16
|
readonly storageUnavailable: "凭据存储不可用";
|
|
16
17
|
readonly securityWindows: "令牌由 Host 使用 Windows CurrentUser DPAPI 加密,不会进入浏览器、settings.yaml 或日志。";
|
|
18
|
+
readonly securityMacKeychain: "令牌由 Host 存入 macOS 登录钥匙串(Keychain),在本机加密保存,不会进入浏览器、settings.yaml 或日志。";
|
|
17
19
|
readonly securityLinuxFile: "令牌仅写入 Host 上当前 Linux 用户可读的 0600 文件,但不会额外加密;同 UID 进程、root、备份和磁盘快照仍可能读取。";
|
|
18
20
|
readonly securityMemory: "令牌仅保留在 Host 内存中,Host 退出后丢失。";
|
|
19
21
|
readonly securityUnavailable: "Host 无法安全访问凭据存储;请修复文件所有者或权限后重试。";
|
|
@@ -94,10 +96,12 @@ export declare const dictionaries: {
|
|
|
94
96
|
readonly expires: "令牌到期";
|
|
95
97
|
readonly storage: "凭据存储";
|
|
96
98
|
readonly storageWindows: "Windows DPAPI(当前用户加密)";
|
|
99
|
+
readonly storageMacKeychain: "macOS 钥匙串(Keychain 加密)";
|
|
97
100
|
readonly storageLinuxFile: "Linux 用户私有文件(权限 0600)";
|
|
98
101
|
readonly storageMemory: "仅 Host 内存(不持久化)";
|
|
99
102
|
readonly storageUnavailable: "凭据存储不可用";
|
|
100
103
|
readonly securityWindows: "令牌由 Host 使用 Windows CurrentUser DPAPI 加密,不会进入浏览器、settings.yaml 或日志。";
|
|
104
|
+
readonly securityMacKeychain: "令牌由 Host 存入 macOS 登录钥匙串(Keychain),在本机加密保存,不会进入浏览器、settings.yaml 或日志。";
|
|
101
105
|
readonly securityLinuxFile: "令牌仅写入 Host 上当前 Linux 用户可读的 0600 文件,但不会额外加密;同 UID 进程、root、备份和磁盘快照仍可能读取。";
|
|
102
106
|
readonly securityMemory: "令牌仅保留在 Host 内存中,Host 退出后丢失。";
|
|
103
107
|
readonly securityUnavailable: "Host 无法安全访问凭据存储;请修复文件所有者或权限后重试。";
|
|
@@ -164,6 +168,6 @@ export declare const dictionaries: {
|
|
|
164
168
|
readonly retry: "重试";
|
|
165
169
|
readonly unknown: "未知";
|
|
166
170
|
};
|
|
167
|
-
en: Record<"
|
|
171
|
+
en: Record<"quota" | "account" | "storage" | "stale" | "pending" | "title" | "intro" | "signedOut" | "signedIn" | "plan" | "accountId" | "expires" | "storageWindows" | "storageMacKeychain" | "storageLinuxFile" | "storageMemory" | "storageUnavailable" | "securityWindows" | "securityMacKeychain" | "securityLinuxFile" | "securityMemory" | "securityUnavailable" | "signIn" | "signInAgain" | "cancel" | "signOut" | "refreshToken" | "popupBlocked" | "continueLogin" | "loading" | "connection" | "provider" | "connectionState" | "connected" | "untested" | "testConnection" | "testing" | "latency" | "models" | "enhancements" | "searchProvider" | "searchProviderHint" | "searchProviderDsh" | "searchProviderCodex" | "quickQuota" | "quickQuotaHint" | "quotaIntro" | "refreshQuota" | "refreshing" | "noQuota" | "quotaSignedOut" | "updated" | "primary" | "secondary" | "limitWindow" | "used" | "remaining" | "available" | "unavailable" | "unlimited" | "credits" | "monthlySpend" | "resetCredits" | "spendControlReached" | "limit" | "exhausted" | "resets" | "quickQuotaLabel" | "quickQuotaLoading" | "imageToolRunning" | "imageToolDone" | "imageToolFailed" | "image" | "openImage" | "openNamedImage" | "imageLoading" | "imageLoadFailed" | "imagePreviewClose" | "imagePreviewOpenOriginal" | "retry" | "unknown", string>;
|
|
168
172
|
};
|
|
169
173
|
//# sourceMappingURL=locales.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locales.d.ts","sourceRoot":"","sources":["../../../src/client/locales.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,EAAE,EAAG,0BAAmC,CAAA;AAErD,eAAO,MAAM,EAAE
|
|
1
|
+
{"version":3,"file":"locales.d.ts","sourceRoot":"","sources":["../../../src/client/locales.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,EAAE,EAAG,0BAAmC,CAAA;AAErD,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkFL,CAAA;AAEV,eAAO,MAAM,EAAE,EAAE,MAAM,CAAC,MAAM,OAAO,EAAE,EAAE,MAAM,CAkF9C,CAAA;AAED,MAAM,MAAM,SAAS,GAAG,MAAM,OAAO,EAAE,CAAA;AACvC,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAa,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-token-store.d.ts","sourceRoot":"","sources":["../../../src/host/platform-token-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"platform-token-store.d.ts","sourceRoot":"","sources":["../../../src/host/platform-token-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAKlD,wBAAgB,wBAAwB,CAAC,QAAQ,GAAE,MAAM,CAAC,QAA2B,GAAG,UAAU,CAKjG"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { TokenStore, StoredOAuthCredentials } from './token-store.ts';
|
|
2
|
+
/**
|
|
3
|
+
* macOS credential storage backed by the login Keychain through the built-in
|
|
4
|
+
* `security` command-line tool. The payload is encrypted at rest by the
|
|
5
|
+
* Keychain, so this store reports itself as encrypted like Windows DPAPI.
|
|
6
|
+
*/
|
|
7
|
+
export declare class MacKeychainTokenStore implements TokenStore {
|
|
8
|
+
private readonly service;
|
|
9
|
+
private readonly account;
|
|
10
|
+
readonly storage: {
|
|
11
|
+
readonly kind: "macos-keychain";
|
|
12
|
+
readonly encrypted: true;
|
|
13
|
+
};
|
|
14
|
+
constructor(service?: string, account?: string);
|
|
15
|
+
load(): Promise<StoredOAuthCredentials | null>;
|
|
16
|
+
save(value: StoredOAuthCredentials): Promise<void>;
|
|
17
|
+
clear(): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=token-store-macos.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token-store-macos.d.ts","sourceRoot":"","sources":["../../../src/host/token-store-macos.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AAM1E;;;;GAIG;AACH,qBAAa,qBAAsB,YAAW,UAAU;IAIpD,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAJ1B,QAAQ,CAAC,OAAO;;;MAAuD;gBAGpD,OAAO,SAAkB,EACzB,OAAO,SAAkB;IAKtC,IAAI,IAAI,OAAO,CAAC,sBAAsB,GAAG,IAAI,CAAC;IAY9C,IAAI,CAAC,KAAK,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;IAKlD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAI7B"}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export { createCodexSearchProvider } from './host/codex-search.ts';
|
|
|
8
8
|
export { ResponsesClient, parseResponsesStream } from './host/responses-client.ts';
|
|
9
9
|
export { UsageService, mapCodexUsage, parseCodexUsage } from './host/usage-service.ts';
|
|
10
10
|
export { createPlatformTokenStore } from './host/platform-token-store.ts';
|
|
11
|
+
export { MacKeychainTokenStore } from './host/token-store-macos.ts';
|
|
11
12
|
export { LinuxFileTokenStore } from './host/token-store-linux.ts';
|
|
12
13
|
export { WindowsDpapiTokenStore } from './host/token-store-windows.ts';
|
|
13
14
|
export type { TokenStore, StoredOAuthCredentials } from './host/token-store.ts';
|
package/lib/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAmBlD,eAAO,MAAM,MAAM,UAA4E,CAAA;AAE/F,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAgCxC;AAED,OAAO,EAAE,YAAY,EAAE,M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AA;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAA;AACtE,YAAY,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA"}
|
|
@@ -4,7 +4,7 @@ export interface SanitizedAccountDto {
|
|
|
4
4
|
accountIdSuffix: string | null;
|
|
5
5
|
tokenExpiresAt: number;
|
|
6
6
|
}
|
|
7
|
-
export type CredentialStorageKind = 'windows-dpapi' | 'linux-file' | 'memory';
|
|
7
|
+
export type CredentialStorageKind = 'windows-dpapi' | 'macos-keychain' | 'linux-file' | 'memory';
|
|
8
8
|
export interface CredentialStorageDto {
|
|
9
9
|
kind: CredentialStorageKind;
|
|
10
10
|
encrypted: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../../src/shared/contracts.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,cAAc,EAAE,MAAM,CAAA;CACvB;AAED,MAAM,MAAM,qBAAqB,GAC7B,eAAe,GACf,YAAY,GACZ,QAAQ,CAAA;AAEZ,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,qBAAqB,CAAA;IAC3B,SAAS,EAAE,OAAO,CAAA;IAClB,SAAS,EAAE,OAAO,CAAA;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,aAAa,EAAE,OAAO,CAAA;IACtB,OAAO,EAAE,mBAAmB,GAAG,IAAI,CAAA;IACnC,OAAO,EAAE,oBAAoB,CAAA;IAC7B,KAAK,EAAE;QACL,MAAM,EAAE,OAAO,CAAA;QACf,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;QACtB,SAAS,EAAE,MA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M,CAAA;CAAE,GACtC;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACtC;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,cAAc,CAAA;CAAE,CAAA;AAE9D,MAAM,WAAW,cAAc;IAC7B,IAAI,EACA,aAAa,GACb,eAAe,GACf,cAAc,GACd,iBAAiB,GACjB,eAAe,GACf,wBAAwB,GACxB,6BAA6B,GAC7B,mBAAmB,GACnB,gBAAgB,GAChB,gBAAgB,GAChB,mBAAmB,GACnB,cAAc,GACd,mBAAmB,GACnB,cAAc,GACd,UAAU,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,MAAM,WAAW,CAAC,CAAC,IACrB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CAAE,GACtB;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,cAAc,CAAA;CAAE,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,126 +1,126 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@eddyskywalker/dsh-chatgpt-subscription",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "DSH provider plugin for Codex access through a ChatGPT subscription.",
|
|
5
|
-
"author": {
|
|
6
|
-
"name": "eddyskywalker",
|
|
7
|
-
"url": "https://www.npmjs.com/~eddyskywalker"
|
|
8
|
-
},
|
|
9
|
-
"repository": {
|
|
10
|
-
"type": "git",
|
|
11
|
-
"url": "git+https://github.com/Aa728848/dsh-chatgpt-subscription.git"
|
|
12
|
-
},
|
|
13
|
-
"homepage": "https://github.com/Aa728848/dsh-chatgpt-subscription#readme",
|
|
14
|
-
"bugs": {
|
|
15
|
-
"url": "https://github.com/Aa728848/dsh-chatgpt-subscription/issues"
|
|
16
|
-
},
|
|
17
|
-
"keywords": [
|
|
18
|
-
"dsh-plugin",
|
|
19
|
-
"dsh",
|
|
20
|
-
"deepseek-harness",
|
|
21
|
-
"chatgpt",
|
|
22
|
-
"codex",
|
|
23
|
-
"openai",
|
|
24
|
-
"provider"
|
|
25
|
-
],
|
|
26
|
-
"type": "module",
|
|
27
|
-
"publishConfig": {
|
|
28
|
-
"access": "public",
|
|
29
|
-
"tag": "latest"
|
|
30
|
-
},
|
|
31
|
-
"main": "lib/index.js",
|
|
32
|
-
"types": "lib/types/index.d.ts",
|
|
33
|
-
"exports": {
|
|
34
|
-
".": {
|
|
35
|
-
"types": "./lib/types/index.d.ts",
|
|
36
|
-
"default": "./lib/index.js"
|
|
37
|
-
},
|
|
38
|
-
"./client": {
|
|
39
|
-
"types": "./lib/types/client/index.d.ts",
|
|
40
|
-
"default": "./lib/client.js"
|
|
41
|
-
},
|
|
42
|
-
"./package.json": "./package.json"
|
|
43
|
-
},
|
|
44
|
-
"dsh": {
|
|
45
|
-
"bundle": {
|
|
46
|
-
"patch": "./cordis.patch.yml"
|
|
47
|
-
},
|
|
48
|
-
"client": {
|
|
49
|
-
"inject": [
|
|
50
|
-
"@deepseek-ai/dsh-client-runtime",
|
|
51
|
-
"@deepseek-ai/dsh-client-locale",
|
|
52
|
-
"@deepseek-ai/dsh-client-ui-slots",
|
|
53
|
-
"@deepseek-ai/dsh-client-ui-settings",
|
|
54
|
-
"@deepseek-ai/dsh-client-ui-model-selection",
|
|
55
|
-
"@deepseek-ai/dsh-client-ui-conversation",
|
|
56
|
-
"@deepseek-ai/dsh-client-ui-tool"
|
|
57
|
-
],
|
|
58
|
-
"platform": "web"
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
"peerDependencies": {
|
|
62
|
-
"@deepseek-ai/cordis": "^4.0.1",
|
|
63
|
-
"@deepseek-ai/cordis-plugin-loader": "^1.0.2",
|
|
64
|
-
"@deepseek-ai/dsh-
|
|
65
|
-
"@deepseek-ai/dsh-
|
|
66
|
-
"@deepseek-ai/dsh-client-locale": "^0.1.0-rc.
|
|
67
|
-
"@deepseek-ai/dsh-client-runtime": "^0.1.0-rc.
|
|
68
|
-
"@deepseek-ai/dsh-client-ui-conversation": "^0.1.0-rc.
|
|
69
|
-
"@deepseek-ai/dsh-client-ui-model-selection": "^0.1.0-rc.
|
|
70
|
-
"@deepseek-ai/dsh-client-ui-settings": "^0.1.0-rc.
|
|
71
|
-
"@deepseek-ai/dsh-client-ui-slots": "^0.1.0-rc.6",
|
|
72
|
-
"@deepseek-ai/dsh-client-ui-tool": "^0.1.0-rc.
|
|
73
|
-
"@deepseek-ai/dsh-host-webserver": "^0.1.0-rc.
|
|
74
|
-
"@deepseek-ai/dsh-llm": "^0.1.0-rc.
|
|
75
|
-
"@deepseek-ai/dsh-settings": "^0.1.0-rc.
|
|
76
|
-
"@deepseek-ai/dsh-tools": "^0.1.0-rc.
|
|
77
|
-
"@deepseek-ai/dsh-web": "^0.1.0-rc.
|
|
78
|
-
"@deepseek-ai/schemastery": "^3.18.1",
|
|
79
|
-
"react": "^18.2.0"
|
|
80
|
-
},
|
|
81
|
-
"devDependencies": {
|
|
82
|
-
"@deepseek-ai/cordis": "^4.0.1",
|
|
83
|
-
"@deepseek-ai/cordis-plugin-loader": "^1.0.2",
|
|
84
|
-
"@deepseek-ai/dsh-
|
|
85
|
-
"@deepseek-ai/dsh-
|
|
86
|
-
"@deepseek-ai/dsh-client-locale": "^0.1.0-rc.
|
|
87
|
-
"@deepseek-ai/dsh-client-runtime": "^0.1.0-rc.
|
|
88
|
-
"@deepseek-ai/dsh-client-ui-conversation": "^0.1.0-rc.
|
|
89
|
-
"@deepseek-ai/dsh-client-ui-model-selection": "^0.1.0-rc.
|
|
90
|
-
"@deepseek-ai/dsh-client-ui-settings": "^0.1.0-rc.
|
|
91
|
-
"@deepseek-ai/dsh-client-ui-slots": "^0.1.0-rc.6",
|
|
92
|
-
"@deepseek-ai/dsh-client-ui-tool": "^0.1.0-rc.
|
|
93
|
-
"@deepseek-ai/dsh-host-webserver": "^0.1.0-rc.
|
|
94
|
-
"@deepseek-ai/dsh-llm": "^0.1.0-rc.
|
|
95
|
-
"@deepseek-ai/dsh-settings": "^0.1.0-rc.
|
|
96
|
-
"@deepseek-ai/dsh-tools": "^0.1.0-rc.
|
|
97
|
-
"@deepseek-ai/dsh-web": "^0.1.0-rc.
|
|
98
|
-
"@deepseek-ai/schemastery": "^3.18.1",
|
|
99
|
-
"@types/node": "^22.20.0",
|
|
100
|
-
"@types/react": "~18.3.1",
|
|
101
|
-
"@types/react-dom": "^18.3.5",
|
|
102
|
-
"jsdom": "29.1.1",
|
|
103
|
-
"react": "^18.3.1",
|
|
104
|
-
"react-dom": "^18.3.1",
|
|
105
|
-
"tsdown": "0.22.2",
|
|
106
|
-
"typescript": "~5.7.2",
|
|
107
|
-
"vitest": "^4.1.8"
|
|
108
|
-
},
|
|
109
|
-
"files": [
|
|
110
|
-
"lib/index.js",
|
|
111
|
-
"lib/client.js",
|
|
112
|
-
"lib/client.js.map",
|
|
113
|
-
"lib/types/**/*.d.ts",
|
|
114
|
-
"lib/types/**/*.d.ts.map",
|
|
115
|
-
"cordis.patch.yml",
|
|
116
|
-
"README.md",
|
|
117
|
-
"CHANGELOG.md"
|
|
118
|
-
],
|
|
119
|
-
"license": "MIT",
|
|
120
|
-
"scripts": {
|
|
121
|
-
"build": "tsc -b && tsdown",
|
|
122
|
-
"prepack": "npm run build",
|
|
123
|
-
"test": "vitest run",
|
|
124
|
-
"typecheck": "tsc -b --pretty false"
|
|
125
|
-
}
|
|
126
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@eddyskywalker/dsh-chatgpt-subscription",
|
|
3
|
+
"version": "0.1.13",
|
|
4
|
+
"description": "DSH provider plugin for Codex access through a ChatGPT subscription.",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "eddyskywalker",
|
|
7
|
+
"url": "https://www.npmjs.com/~eddyskywalker"
|
|
8
|
+
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/Aa728848/dsh-chatgpt-subscription.git"
|
|
12
|
+
},
|
|
13
|
+
"homepage": "https://github.com/Aa728848/dsh-chatgpt-subscription#readme",
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/Aa728848/dsh-chatgpt-subscription/issues"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"dsh-plugin",
|
|
19
|
+
"dsh",
|
|
20
|
+
"deepseek-harness",
|
|
21
|
+
"chatgpt",
|
|
22
|
+
"codex",
|
|
23
|
+
"openai",
|
|
24
|
+
"provider"
|
|
25
|
+
],
|
|
26
|
+
"type": "module",
|
|
27
|
+
"publishConfig": {
|
|
28
|
+
"access": "public",
|
|
29
|
+
"tag": "latest"
|
|
30
|
+
},
|
|
31
|
+
"main": "lib/index.js",
|
|
32
|
+
"types": "lib/types/index.d.ts",
|
|
33
|
+
"exports": {
|
|
34
|
+
".": {
|
|
35
|
+
"types": "./lib/types/index.d.ts",
|
|
36
|
+
"default": "./lib/index.js"
|
|
37
|
+
},
|
|
38
|
+
"./client": {
|
|
39
|
+
"types": "./lib/types/client/index.d.ts",
|
|
40
|
+
"default": "./lib/client.js"
|
|
41
|
+
},
|
|
42
|
+
"./package.json": "./package.json"
|
|
43
|
+
},
|
|
44
|
+
"dsh": {
|
|
45
|
+
"bundle": {
|
|
46
|
+
"patch": "./cordis.patch.yml"
|
|
47
|
+
},
|
|
48
|
+
"client": {
|
|
49
|
+
"inject": [
|
|
50
|
+
"@deepseek-ai/dsh-client-runtime",
|
|
51
|
+
"@deepseek-ai/dsh-client-locale",
|
|
52
|
+
"@deepseek-ai/dsh-client-ui-slots",
|
|
53
|
+
"@deepseek-ai/dsh-client-ui-settings",
|
|
54
|
+
"@deepseek-ai/dsh-client-ui-model-selection",
|
|
55
|
+
"@deepseek-ai/dsh-client-ui-conversation",
|
|
56
|
+
"@deepseek-ai/dsh-client-ui-tool"
|
|
57
|
+
],
|
|
58
|
+
"platform": "web"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"peerDependencies": {
|
|
62
|
+
"@deepseek-ai/cordis": "^4.0.1",
|
|
63
|
+
"@deepseek-ai/cordis-plugin-loader": "^1.0.2",
|
|
64
|
+
"@deepseek-ai/dsh-attachment": "^0.1.0-rc.8",
|
|
65
|
+
"@deepseek-ai/dsh-client-connection": "^0.1.0-rc.8",
|
|
66
|
+
"@deepseek-ai/dsh-client-locale": "^0.1.0-rc.8",
|
|
67
|
+
"@deepseek-ai/dsh-client-runtime": "^0.1.0-rc.8",
|
|
68
|
+
"@deepseek-ai/dsh-client-ui-conversation": "^0.1.0-rc.8",
|
|
69
|
+
"@deepseek-ai/dsh-client-ui-model-selection": "^0.1.0-rc.8",
|
|
70
|
+
"@deepseek-ai/dsh-client-ui-settings": "^0.1.0-rc.8",
|
|
71
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.1.0-rc.6",
|
|
72
|
+
"@deepseek-ai/dsh-client-ui-tool": "^0.1.0-rc.8",
|
|
73
|
+
"@deepseek-ai/dsh-host-webserver": "^0.1.0-rc.8",
|
|
74
|
+
"@deepseek-ai/dsh-llm": "^0.1.0-rc.8",
|
|
75
|
+
"@deepseek-ai/dsh-settings": "^0.1.0-rc.8",
|
|
76
|
+
"@deepseek-ai/dsh-tools": "^0.1.0-rc.8",
|
|
77
|
+
"@deepseek-ai/dsh-web": "^0.1.0-rc.8",
|
|
78
|
+
"@deepseek-ai/schemastery": "^3.18.1",
|
|
79
|
+
"react": "^18.2.0"
|
|
80
|
+
},
|
|
81
|
+
"devDependencies": {
|
|
82
|
+
"@deepseek-ai/cordis": "^4.0.1",
|
|
83
|
+
"@deepseek-ai/cordis-plugin-loader": "^1.0.2",
|
|
84
|
+
"@deepseek-ai/dsh-attachment": "^0.1.0-rc.8",
|
|
85
|
+
"@deepseek-ai/dsh-client-connection": "^0.1.0-rc.8",
|
|
86
|
+
"@deepseek-ai/dsh-client-locale": "^0.1.0-rc.8",
|
|
87
|
+
"@deepseek-ai/dsh-client-runtime": "^0.1.0-rc.8",
|
|
88
|
+
"@deepseek-ai/dsh-client-ui-conversation": "^0.1.0-rc.8",
|
|
89
|
+
"@deepseek-ai/dsh-client-ui-model-selection": "^0.1.0-rc.8",
|
|
90
|
+
"@deepseek-ai/dsh-client-ui-settings": "^0.1.0-rc.8",
|
|
91
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.1.0-rc.6",
|
|
92
|
+
"@deepseek-ai/dsh-client-ui-tool": "^0.1.0-rc.8",
|
|
93
|
+
"@deepseek-ai/dsh-host-webserver": "^0.1.0-rc.8",
|
|
94
|
+
"@deepseek-ai/dsh-llm": "^0.1.0-rc.8",
|
|
95
|
+
"@deepseek-ai/dsh-settings": "^0.1.0-rc.8",
|
|
96
|
+
"@deepseek-ai/dsh-tools": "^0.1.0-rc.8",
|
|
97
|
+
"@deepseek-ai/dsh-web": "^0.1.0-rc.8",
|
|
98
|
+
"@deepseek-ai/schemastery": "^3.18.1",
|
|
99
|
+
"@types/node": "^22.20.0",
|
|
100
|
+
"@types/react": "~18.3.1",
|
|
101
|
+
"@types/react-dom": "^18.3.5",
|
|
102
|
+
"jsdom": "29.1.1",
|
|
103
|
+
"react": "^18.3.1",
|
|
104
|
+
"react-dom": "^18.3.1",
|
|
105
|
+
"tsdown": "0.22.2",
|
|
106
|
+
"typescript": "~5.7.2",
|
|
107
|
+
"vitest": "^4.1.8"
|
|
108
|
+
},
|
|
109
|
+
"files": [
|
|
110
|
+
"lib/index.js",
|
|
111
|
+
"lib/client.js",
|
|
112
|
+
"lib/client.js.map",
|
|
113
|
+
"lib/types/**/*.d.ts",
|
|
114
|
+
"lib/types/**/*.d.ts.map",
|
|
115
|
+
"cordis.patch.yml",
|
|
116
|
+
"README.md",
|
|
117
|
+
"CHANGELOG.md"
|
|
118
|
+
],
|
|
119
|
+
"license": "MIT",
|
|
120
|
+
"scripts": {
|
|
121
|
+
"build": "tsc -b && tsdown",
|
|
122
|
+
"prepack": "npm run build",
|
|
123
|
+
"test": "vitest run",
|
|
124
|
+
"typecheck": "tsc -b --pretty false"
|
|
125
|
+
}
|
|
126
|
+
}
|