dsh-openai-subscription 0.1.7 → 0.1.9
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/README.md +1 -1
- package/README.zh.md +1 -1
- package/dist/client.js +33 -22
- package/dist/driver.js +17 -3
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -137,7 +137,7 @@ After installing dependencies, run `npm run check` (or `pnpm run check`) for typ
|
|
|
137
137
|
|
|
138
138
|
### Settings UI and navigation icons
|
|
139
139
|
|
|
140
|
-
|
|
140
|
+
Every button, picker, and code field shares one control spec: a theme-aware `1px` border taken from the host's own control border step, a `12px` radius, and the host's type scale. Variants change color only, never size or shape. The header and navigation reuse one local OpenAI SVG, with no additional runtime dependency or remote image requests; see [third-party notices](THIRD_PARTY_NOTICES.md).
|
|
141
141
|
|
|
142
142
|
The currently tested upstream DSH build does not expose custom settings navigation icons. Unextended hosts keep the default gear without affecting other plugin features. This project includes an **opt-in, build-guarded, reversible** local DSH extension; installing the plugin does not patch the host automatically. It preserves string labels and passes icons through `icon({ size, className })`, not DOM/CSS substitution. See [DSH settings icon extension](docs/DSH_SETTINGS_ICONS.md) for usage and upgrade caveats.
|
|
143
143
|
|
package/README.zh.md
CHANGED
|
@@ -137,7 +137,7 @@ dsh plugin --profile web remove dsh-openai-subscription
|
|
|
137
137
|
|
|
138
138
|
### 设置界面与导航图标
|
|
139
139
|
|
|
140
|
-
|
|
140
|
+
所有按钮、选择器与验证码输入框共用同一套控件规范:主题自适应的 `1px` 边框(取宿主自身的控件边框层级)、`12px` 圆角与宿主字号;变体只改变颜色,不改变尺寸或形状。顶部和导航复用本地 OpenAI SVG,无额外运行时依赖或远程图片请求;来源及许可证见 [第三方声明](THIRD_PARTY_NOTICES.md)。
|
|
141
141
|
|
|
142
142
|
当前官方 DSH 设置导航尚未提供自定义图标接口,未扩展的宿主仍显示默认齿轮,插件其他功能不受影响。本项目提供**显式执行、限定构建版本、可还原**的本机 DSH 扩展,不在安装时自动修改宿主。它保留字符串标签,通过 `icon({ size, className })` 传递图标,不使用 DOM/CSS 替换技巧。用法和升级注意事项见 [DSH 图标接口扩展](docs/DSH_SETTINGS_ICONS.md)。
|
|
143
143
|
|
package/dist/client.js
CHANGED
|
@@ -305,9 +305,10 @@ window.__ModuleLoader__.load({
|
|
|
305
305
|
.oasub-wrap {
|
|
306
306
|
--oasub-section-inset: 20px;
|
|
307
307
|
--oasub-card-border-width: 1px;
|
|
308
|
-
/*
|
|
309
|
-
|
|
310
|
-
--oasub-control-border
|
|
308
|
+
/* One control boundary for every button and picker: the host's own control
|
|
309
|
+
border step, so plugin controls carry the same weight as DSH's. */
|
|
310
|
+
--oasub-control-border: var(--dsw-alias-border-l3, rgba(15, 17, 21, .16));
|
|
311
|
+
--oasub-control-border-hover: var(--dsw-alias-border-l4, rgba(15, 17, 21, .2));
|
|
311
312
|
box-sizing: border-box;
|
|
312
313
|
display: flex;
|
|
313
314
|
flex-direction: column;
|
|
@@ -384,11 +385,11 @@ window.__ModuleLoader__.load({
|
|
|
384
385
|
.oasub-picker { position: relative; min-width: 0; }
|
|
385
386
|
.oasub-picker-trigger, .oasub-input-shell {
|
|
386
387
|
width: 100%; min-height: 56px; padding: 10px 12px;
|
|
387
|
-
border: 1px solid var(--
|
|
388
|
+
border: 1px solid var(--oasub-control-border); border-radius: 12px;
|
|
388
389
|
color: var(--dsw-alias-label-primary, #0f1115); background: var(--dsw-alias-bg-layer-2, #f5f6f7);
|
|
389
390
|
}
|
|
390
391
|
.oasub-picker-trigger { appearance: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; font: inherit; text-align: start; cursor: pointer; transition: border-color .16s, background .16s; }
|
|
391
|
-
.oasub-picker-trigger:hover:not(:disabled), .oasub-picker-trigger[aria-expanded="true"] { border-color: var(--oasub-control-border); background: var(--dsw-alias-bg-layer-1, #fff); }
|
|
392
|
+
.oasub-picker-trigger:hover:not(:disabled), .oasub-picker-trigger[aria-expanded="true"] { border-color: var(--oasub-control-border-hover); background: var(--dsw-alias-bg-layer-1, #fff); }
|
|
392
393
|
.oasub-picker-trigger:focus-visible, .oasub-input-shell:focus-within, .oasub-management-toggle:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary, #4176e6); outline-offset: 3px; }
|
|
393
394
|
.oasub-picker-trigger:disabled { opacity: .5; cursor: default; }
|
|
394
395
|
.oasub-picker-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
|
|
@@ -423,39 +424,46 @@ window.__ModuleLoader__.load({
|
|
|
423
424
|
.oasub-manage-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-block: 16px; border-top: 1px solid var(--dsw-alias-border-l2, rgba(15, 17, 21, .14)); }
|
|
424
425
|
.oasub-manage-row .oasub-status-detail { font-size: 11px; line-height: 17px; }
|
|
425
426
|
.oasub-manage-title { font-size: 13px; font-weight: 500; line-height: 20px; }
|
|
426
|
-
|
|
427
|
-
.oasub-manage-row > .oasub-button
|
|
428
|
-
.oasub-manage-row > .oasub-button.danger-quiet:hover:not(:disabled) { background: color-mix(in srgb, var(--dsw-alias-state-error-primary, #dc2626) 7%, transparent); border-color: var(--dsw-alias-state-error-primary, #dc2626); }
|
|
427
|
+
/* Management rows reuse the one button spec; only the row layout differs. */
|
|
428
|
+
.oasub-manage-row > .oasub-button { flex: none; }
|
|
429
429
|
@container (max-width: 460px) {
|
|
430
430
|
.oasub-context-grid { grid-template-columns: minmax(0, 1fr); }
|
|
431
431
|
.oasub-manage-row { align-items: flex-start; flex-direction: column; gap: 10px; }
|
|
432
432
|
.oasub-manage-row > .oasub-button { align-self: flex-start; }
|
|
433
433
|
}
|
|
434
|
+
/* One button spec for the whole panel: DSH's control radius, control border
|
|
435
|
+
step, and type scale. Variants change color only, never size or shape. */
|
|
434
436
|
.oasub-button {
|
|
435
437
|
appearance: none;
|
|
438
|
+
display: inline-flex;
|
|
439
|
+
align-items: center;
|
|
440
|
+
justify-content: center;
|
|
441
|
+
gap: 6px;
|
|
436
442
|
min-height: 36px;
|
|
437
|
-
padding:
|
|
443
|
+
padding: 0 16px;
|
|
438
444
|
border: 1px solid var(--oasub-control-border);
|
|
439
|
-
border-radius:
|
|
445
|
+
border-radius: 12px;
|
|
440
446
|
color: var(--dsw-alias-label-primary, #0f1115);
|
|
441
447
|
background: transparent;
|
|
442
448
|
font: inherit;
|
|
443
|
-
font-size:
|
|
449
|
+
font-size: 14px;
|
|
444
450
|
font-weight: 500;
|
|
445
|
-
line-height:
|
|
451
|
+
line-height: 22px;
|
|
446
452
|
cursor: pointer;
|
|
447
453
|
text-decoration: none;
|
|
448
454
|
text-align: center;
|
|
449
455
|
transition: background .16s ease, border-color .16s ease, opacity .16s ease, transform .16s ease;
|
|
450
456
|
}
|
|
451
|
-
.oasub-button:not(.primary):not(.danger):hover:not(:disabled) { border-color: var(--oasub-control-border-hover); background: var(--dsw-alias-interactive-bg-hover, rgba(15, 17, 21, .06)); }
|
|
457
|
+
.oasub-button:not(.primary):not(.danger):not(.danger-quiet):hover:not(:disabled) { border-color: var(--oasub-control-border-hover); background: var(--dsw-alias-interactive-bg-hover, rgba(15, 17, 21, .06)); }
|
|
452
458
|
.oasub-button:active:not(:disabled) { transform: translateY(1px); }
|
|
453
459
|
.oasub-button:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary, #4176e6); outline-offset: 2px; }
|
|
454
460
|
.oasub-button:disabled { cursor: default; opacity: .45; }
|
|
455
|
-
.oasub-button.primary { border-color: var(--dsw-alias-brand-primary, #4176e6); color: var(--dsw-alias-label-primary-
|
|
456
|
-
.oasub-button.primary:hover:not(:disabled) {
|
|
457
|
-
.oasub-button.danger { border-color: var(--dsw-alias-state-error-primary, #dc2626); color: var(--dsw-alias-label-primary-
|
|
461
|
+
.oasub-button.primary { border-color: var(--dsw-alias-button-primary-fill, var(--dsw-alias-brand-primary, #4176e6)); color: var(--dsw-alias-label-primary-foreground, #fff); background: var(--dsw-alias-button-primary-fill, var(--dsw-alias-brand-primary, #4176e6)); }
|
|
462
|
+
.oasub-button.primary:hover:not(:disabled) { border-color: var(--dsw-alias-button-primary-hover, var(--dsw-alias-brand-primary, #4176e6)); background: var(--dsw-alias-button-primary-hover, var(--dsw-alias-brand-primary, #4176e6)); }
|
|
463
|
+
.oasub-button.danger { border-color: var(--dsw-alias-state-error-primary, #dc2626); color: var(--dsw-alias-label-primary-foreground, #fff); background: var(--dsw-alias-state-error-primary, #dc2626); }
|
|
458
464
|
.oasub-button.danger:hover:not(:disabled) { filter: brightness(.94); }
|
|
465
|
+
.oasub-button.danger-quiet { color: var(--dsw-alias-state-error-primary, #b91c1c); border-color: color-mix(in srgb, var(--dsw-alias-state-error-primary, #dc2626) 25%, transparent); }
|
|
466
|
+
.oasub-button.danger-quiet:hover:not(:disabled) { background: var(--dsw-alias-interactive-bg-hover-danger, color-mix(in srgb, var(--dsw-alias-state-error-primary, #dc2626) 7%, transparent)); border-color: var(--dsw-alias-state-error-primary, #dc2626); }
|
|
459
467
|
.oasub-button.quiet { margin-left: auto; }
|
|
460
468
|
.oasub-notice {
|
|
461
469
|
display: flex;
|
|
@@ -478,10 +486,10 @@ window.__ModuleLoader__.load({
|
|
|
478
486
|
align-self: flex-start;
|
|
479
487
|
width: min(100%, 24ch);
|
|
480
488
|
min-width: 0;
|
|
481
|
-
border: 1px solid var(--
|
|
489
|
+
border: 1px solid var(--oasub-control-border);
|
|
482
490
|
margin: 0;
|
|
483
491
|
padding: 10px 14px;
|
|
484
|
-
border-radius:
|
|
492
|
+
border-radius: 12px;
|
|
485
493
|
color: var(--dsw-alias-label-primary, #0f1115);
|
|
486
494
|
background: var(--dsw-alias-bg-layer-2, #f5f6f7);
|
|
487
495
|
font-family: var(--ds-font-family-code, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
|
|
@@ -510,9 +518,10 @@ window.__ModuleLoader__.load({
|
|
|
510
518
|
.oasub-picker-option[data-active="true"] { outline: 1px solid Highlight; outline-offset: -1px; }
|
|
511
519
|
.oasub-picker-option[aria-disabled="true"], .oasub-picker-trigger:disabled { color: GrayText; opacity: 1; }
|
|
512
520
|
.oasub-button { border-color: ButtonText; }
|
|
513
|
-
.oasub-button.primary, .oasub-button.danger { border-color: ButtonText; color: ButtonText; background: ButtonFace; }
|
|
514
|
-
.oasub-button:not(.primary):not(.danger):hover:not(:disabled),
|
|
515
|
-
.oasub-button.primary:hover:not(:disabled), .oasub-button.danger:hover:not(:disabled)
|
|
521
|
+
.oasub-button.primary, .oasub-button.danger, .oasub-button.danger-quiet { border-color: ButtonText; color: ButtonText; background: ButtonFace; }
|
|
522
|
+
.oasub-button:not(.primary):not(.danger):not(.danger-quiet):hover:not(:disabled),
|
|
523
|
+
.oasub-button.primary:hover:not(:disabled), .oasub-button.danger:hover:not(:disabled),
|
|
524
|
+
.oasub-button.danger-quiet:hover:not(:disabled) { border-color: Highlight; filter: none; }
|
|
516
525
|
.oasub-button:focus-visible { outline-color: Highlight; }
|
|
517
526
|
.oasub-button:disabled { border-color: GrayText; color: GrayText; opacity: 1; }
|
|
518
527
|
}
|
|
@@ -1341,7 +1350,9 @@ window.__ModuleLoader__.load({
|
|
|
1341
1350
|
: null, el('div', { className: 'oasub-actions' }, configured
|
|
1342
1351
|
? el('button', {
|
|
1343
1352
|
type: 'button',
|
|
1344
|
-
|
|
1353
|
+
// Exactly one primary action per card: a pending credential
|
|
1354
|
+
// repair outranks the model sync action.
|
|
1355
|
+
className: 'oasub-button' + (info.modelsSynced || info.credentialState !== 'valid' ? '' : ' primary'),
|
|
1345
1356
|
disabled: busy,
|
|
1346
1357
|
'aria-describedby': 'oasub-sync-help',
|
|
1347
1358
|
onClick: requestModelSync,
|
package/dist/driver.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { setTimeout as delay } from 'node:timers/promises';
|
|
2
|
-
import { SubscriptionError, oauthFailureCode } from './errors.js';
|
|
2
|
+
import { SubscriptionError, failureCode, oauthFailureCode } from './errors.js';
|
|
3
3
|
import { normalizeOAuthCredential } from './oauth.js';
|
|
4
4
|
import { buildNodeCommand } from './platform.js';
|
|
5
5
|
export const VERIFICATION_URL = 'https://auth.openai.com/codex/device';
|
|
@@ -56,11 +56,25 @@ export async function runDeviceDriver(shell, modulePath, signal, notify, options
|
|
|
56
56
|
return null;
|
|
57
57
|
const timeout = AbortSignal.timeout(options.timeoutMs ?? DEVICE_TIMEOUT);
|
|
58
58
|
const combined = AbortSignal.any([signal, timeout]);
|
|
59
|
-
const
|
|
59
|
+
const spec = shell.resolve({
|
|
60
60
|
command: buildNodeCommand(DRIVER_DEVICE, modulePath),
|
|
61
61
|
signal: combined,
|
|
62
62
|
stdoutMaxBytes: MAX_OUTPUT,
|
|
63
|
-
})
|
|
63
|
+
});
|
|
64
|
+
let proc;
|
|
65
|
+
try {
|
|
66
|
+
// DSH 0.1.6+ resolves background handles asynchronously after launch
|
|
67
|
+
// preparation; awaiting also accepts executors that still return the
|
|
68
|
+
// handle synchronously, so both ShellExecutor contracts keep working.
|
|
69
|
+
proc = await shell.start(spec);
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
// Launch preparation failed before a handle existed; there is nothing to
|
|
73
|
+
// reap and no output was produced, so report a category without details.
|
|
74
|
+
if (signal.aborted)
|
|
75
|
+
return null;
|
|
76
|
+
throw new SubscriptionError(failureCode(error, 'process-exited'));
|
|
77
|
+
}
|
|
64
78
|
let buffer = '';
|
|
65
79
|
let total = 0;
|
|
66
80
|
let codeReceived = false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-openai-subscription",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "ChatGPT subscription sign-in for DeepSeek Harness via OpenAI device authorization.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"packageManager": "pnpm@10.6.3",
|
|
@@ -82,11 +82,11 @@
|
|
|
82
82
|
"@babel/parser": "^8.0.4",
|
|
83
83
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
84
84
|
"@deepseek-ai/cordis-plugin-timer": "^1.1.4",
|
|
85
|
-
"@deepseek-ai/dsh-authorization": "^0.1.
|
|
86
|
-
"@deepseek-ai/dsh-credentials": "^0.1.
|
|
87
|
-
"@deepseek-ai/dsh-settings": "^0.1.
|
|
88
|
-
"@deepseek-ai/dsh-shell": "^0.1.
|
|
89
|
-
"@deepseek-ai/dsh-typert-protocol": "^0.1.
|
|
85
|
+
"@deepseek-ai/dsh-authorization": "^0.1.6-alpha.2",
|
|
86
|
+
"@deepseek-ai/dsh-credentials": "^0.1.6-alpha.2",
|
|
87
|
+
"@deepseek-ai/dsh-settings": "^0.1.6-alpha.2",
|
|
88
|
+
"@deepseek-ai/dsh-shell": "^0.1.6-alpha.2",
|
|
89
|
+
"@deepseek-ai/dsh-typert-protocol": "^0.1.6-alpha.2",
|
|
90
90
|
"@types/node": "^25.6.1",
|
|
91
91
|
"esbuild": "^0.28.2",
|
|
92
92
|
"typescript": "^7.0.2"
|