@tnnevol/dsh-codex-auth 0.1.0-rc.8.2 → 0.1.1-rc.2.0

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.
@@ -4,7 +4,7 @@
4
4
  "node": "^22.19.0 || >=24.0.0"
5
5
  },
6
6
  "dshPluginApi": {
7
- "version": "0.1.0-rc.8",
7
+ "version": "0.1.1-rc.2",
8
8
  "packages": [
9
9
  "@deepseek-ai/dsh-atomic-write",
10
10
  "@deepseek-ai/dsh-attachment",
package/lib/client.js CHANGED
@@ -494,7 +494,7 @@ window.__ModuleLoader__.load({
494
494
  background: "var(--dsw-alias-bg-layer-3, var(--dsw-alias-bg-layer-2))",
495
495
  boxShadow: "var(--dsw-alias-shadow-popover, 0 12px 30px rgb(0 0 0 / 24%))"
496
496
  };
497
- function PickerRow({ label, value, disabled, active, onClick }) {
497
+ function PickerRow({ label, value, disabled, active, onClick, onHover, onLeave }) {
498
498
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
499
499
  type: "button",
500
500
  disabled,
@@ -507,10 +507,14 @@ window.__ModuleLoader__.load({
507
507
  cursor: disabled ? "not-allowed" : "pointer"
508
508
  },
509
509
  onMouseEnter: (event) => {
510
- if (!disabled) event.currentTarget.style.background = "var(--dsw-alias-interactive-bg-hover, var(--dsw-alias-bg-layer-1))";
510
+ if (!disabled) {
511
+ event.currentTarget.style.background = "var(--dsw-alias-interactive-bg-hover, var(--dsw-alias-bg-layer-1))";
512
+ onHover?.();
513
+ }
511
514
  },
512
515
  onMouseLeave: (event) => {
513
516
  event.currentTarget.style.background = active ? "var(--dsw-alias-interactive-bg-active, var(--dsw-alias-interactive-bg-hover))" : "transparent";
517
+ onLeave?.(event);
514
518
  },
515
519
  onClick,
516
520
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
@@ -550,10 +554,35 @@ window.__ModuleLoader__.load({
550
554
  })]
551
555
  });
552
556
  }
553
- function GlobalModelPicker({ modelMenuLabel, effortMenuLabel, modelLabel, modelPlaceholder, effortLabel, selectedModelId, selectedEffortId, modelOptions, effortOptions, activeMenu, onToggle, onOpenSubmenu, onChooseModel, onChooseEffort }) {
557
+ function GlobalModelPicker({ modelMenuLabel, effortMenuLabel, modelLabel, modelPlaceholder, effortLabel, selectedModelId, selectedEffortId, modelOptions, effortOptions, activeMenu, onToggle, onOpenSubmenu, onCloseSubmenu, onChooseModel, onChooseEffort }) {
554
558
  const open = activeMenu !== null;
555
559
  const modelValue = modelLabel === "" ? modelPlaceholder : modelLabel;
556
560
  const buttonValue = effortLabel === "" ? modelValue : `${modelValue} · ${effortLabel}`;
561
+ const closeTimerRef = (0, react.useRef)(void 0);
562
+ const cancelScheduledClose = () => {
563
+ if (closeTimerRef.current === void 0) return;
564
+ clearTimeout(closeTimerRef.current);
565
+ closeTimerRef.current = void 0;
566
+ };
567
+ const scheduleSubmenuClose = () => {
568
+ cancelScheduledClose();
569
+ closeTimerRef.current = setTimeout(() => {
570
+ closeTimerRef.current = void 0;
571
+ onCloseSubmenu();
572
+ }, 220);
573
+ };
574
+ (0, react.useEffect)(() => () => {
575
+ cancelScheduledClose();
576
+ }, []);
577
+ const openSubmenu = (menu) => {
578
+ cancelScheduledClose();
579
+ onOpenSubmenu(menu);
580
+ };
581
+ const closeSubmenuOnParentLeave = (event) => {
582
+ const target = event.relatedTarget;
583
+ if (target instanceof Element && target.closest("[data-dsh-cascade-submenu]") !== null) return;
584
+ scheduleSubmenuClose();
585
+ };
557
586
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
558
587
  style: {
559
588
  position: "relative",
@@ -587,21 +616,32 @@ window.__ModuleLoader__.load({
587
616
  value: modelValue,
588
617
  active: activeMenu === "model",
589
618
  onClick: () => {
590
- onOpenSubmenu("model");
591
- }
619
+ openSubmenu("model");
620
+ },
621
+ onHover: () => {
622
+ openSubmenu("model");
623
+ },
624
+ onLeave: closeSubmenuOnParentLeave
592
625
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PickerRow, {
593
626
  label: effortMenuLabel,
594
627
  value: effortLabel,
595
628
  active: activeMenu === "effort",
596
629
  onClick: () => {
597
- onOpenSubmenu("effort");
598
- }
630
+ openSubmenu("effort");
631
+ },
632
+ onHover: () => {
633
+ openSubmenu("effort");
634
+ },
635
+ onLeave: closeSubmenuOnParentLeave
599
636
  })]
600
637
  }),
601
638
  activeMenu === "model" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
602
639
  role: "menu",
603
640
  "aria-label": modelMenuLabel,
641
+ "data-dsh-cascade-submenu": "model",
604
642
  style: pickerSubmenuStyle,
643
+ onMouseEnter: cancelScheduledClose,
644
+ onMouseLeave: onCloseSubmenu,
605
645
  children: modelOptions.map((option) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
606
646
  type: "button",
607
647
  role: "menuitemradio",
@@ -610,6 +650,12 @@ window.__ModuleLoader__.load({
610
650
  ...choiceItemStyle,
611
651
  background: "var(--dsw-alias-interactive-bg-active, var(--dsw-alias-interactive-bg-hover))"
612
652
  } : choiceItemStyle,
653
+ onMouseEnter: (event) => {
654
+ event.currentTarget.style.background = "var(--dsw-alias-interactive-bg-hover, var(--dsw-alias-bg-layer-1))";
655
+ },
656
+ onMouseLeave: (event) => {
657
+ event.currentTarget.style.background = option.id === selectedModelId ? "var(--dsw-alias-interactive-bg-active, var(--dsw-alias-interactive-bg-hover))" : "transparent";
658
+ },
613
659
  onClick: () => {
614
660
  onChooseModel(option.id);
615
661
  },
@@ -630,7 +676,10 @@ window.__ModuleLoader__.load({
630
676
  activeMenu === "effort" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
631
677
  role: "menu",
632
678
  "aria-label": effortMenuLabel,
679
+ "data-dsh-cascade-submenu": "effort",
633
680
  style: pickerSubmenuStyle,
681
+ onMouseEnter: cancelScheduledClose,
682
+ onMouseLeave: onCloseSubmenu,
634
683
  children: effortOptions.map((option) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
635
684
  type: "button",
636
685
  role: "menuitemradio",
@@ -639,6 +688,12 @@ window.__ModuleLoader__.load({
639
688
  ...choiceItemStyle,
640
689
  background: "var(--dsw-alias-interactive-bg-active, var(--dsw-alias-interactive-bg-hover))"
641
690
  } : choiceItemStyle,
691
+ onMouseEnter: (event) => {
692
+ event.currentTarget.style.background = "var(--dsw-alias-interactive-bg-hover, var(--dsw-alias-bg-layer-1))";
693
+ },
694
+ onMouseLeave: (event) => {
695
+ event.currentTarget.style.background = option.id === selectedEffortId ? "var(--dsw-alias-interactive-bg-active, var(--dsw-alias-interactive-bg-hover))" : "transparent";
696
+ },
642
697
  onClick: () => {
643
698
  onChooseEffort(option.id);
644
699
  },
@@ -785,16 +840,17 @@ window.__ModuleLoader__.load({
785
840
  onOpenSubmenu: (menu) => {
786
841
  setOpenMenu(menu);
787
842
  },
843
+ onCloseSubmenu: () => {
844
+ setOpenMenu("root");
845
+ },
788
846
  onChooseModel: (id) => {
789
847
  setDraftModel(id);
790
848
  setDraftEffort("");
791
849
  setFeedback("idle");
792
- setOpenMenu(null);
793
850
  },
794
851
  onChooseEffort: (id) => {
795
852
  setDraftEffort(id);
796
853
  setFeedback("idle");
797
- setOpenMenu(null);
798
854
  }
799
855
  }), selected === void 0 && modelLabel !== "" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
800
856
  style: bodyStyle$1,
package/lib/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { a as CODEX_PROVIDER, i as CODEX_AUTH_FILENAME, n as loginCodex, o as CodexCredentialStore, r as logoutCodex, s as codexAuthPath, t as codexAuthStatus } from "./auth-DQ2F4vc6.js";
2
2
  import { CODEX_AUTH_LOGIN_PATH, CODEX_AUTH_LOGOUT_PATH, CODEX_AUTH_SETTINGS_NAMESPACE, CODEX_AUTH_SETTINGS_PATH, CODEX_AUTH_STATUS_PATH, CODEX_GLOBAL_MODEL_PATH, CODEX_USAGE_PATH } from "./auth-paths.js";
3
- import { createModels } from "@earendil-works/pi-ai";
3
+ import { createModels, defaultProviderAuthContext } from "@earendil-works/pi-ai";
4
4
  import { openaiCodexProvider } from "@earendil-works/pi-ai/providers/openai-codex";
5
5
  import { basename } from "node:path";
6
6
  import { credentialRef } from "@deepseek-ai/dsh-credentials";
@@ -766,8 +766,12 @@ function viewImageTool(ctx) {
766
766
  /** OpenAI Codex adapter assembled from dsh's public pi-ai extension seam. */
767
767
  /** Keep the Codex stream open while the provider is still producing output. */
768
768
  const CODEX_STREAM_IDLE_TIMEOUT_MS = 3e5;
769
- /** Match dsh rc.8's default request-level image payload bound. */
769
+ /** Match DSH rc.2's default request-level image payload bound. */
770
770
  const CODEX_MAX_REQUEST_IMAGE_BYTES = 20971520;
771
+ /** Match DSH rc.2's default per-image total-pixel budget. */
772
+ const CODEX_REQUEST_IMAGE_PIXEL_BUDGET = 4194304;
773
+ /** Match DSH rc.2's default raw per-image byte budget. */
774
+ const CODEX_REQUEST_IMAGE_MAX_BYTES = 1048576;
771
775
  /**
772
776
  * Give dsh's generic adapter the bearer token resolved by the plugin-owned
773
777
  * OAuth store. This keeps the provider-native login flow separate from model
@@ -799,6 +803,8 @@ function createCodexAdapter(credentials, resolveAttachments) {
799
803
  displayName: "OpenAI Codex",
800
804
  streamIdleTimeoutMs: CODEX_STREAM_IDLE_TIMEOUT_MS,
801
805
  maxRequestImageBytes: CODEX_MAX_REQUEST_IMAGE_BYTES,
806
+ requestImagePixelBudget: CODEX_REQUEST_IMAGE_PIXEL_BUDGET,
807
+ requestImageMaxBytes: CODEX_REQUEST_IMAGE_MAX_BYTES,
802
808
  retryPolicy: resolveRetryPolicy(void 0, "dsh-codex-auth-plugin retryPolicy"),
803
809
  configuredMaxTokens: /* @__PURE__ */ new Map(),
804
810
  piProvider: requestProvider(provider)
@@ -808,6 +814,10 @@ function createCodexAdapter(credentials, resolveAttachments) {
808
814
  return new PiAiAdapter({
809
815
  profiles: () => profiles,
810
816
  resolveApiKey: async () => (await models.getAuth(CODEX_PROVIDER))?.auth.apiKey,
817
+ auth: {
818
+ credentials,
819
+ authContext: defaultProviderAuthContext()
820
+ },
811
821
  resolveAttachments
812
822
  });
813
823
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@tnnevol/dsh-codex-auth",
3
3
  "displayName": "Codex Auth",
4
4
  "description": "Standalone ChatGPT OAuth account management for DeepSeek Harness.",
5
- "version": "0.1.0-rc.8.2",
5
+ "version": "0.1.1-rc.2.0",
6
6
  "author": "tnnevol",
7
7
  "repository": {
8
8
  "type": "git",
@@ -75,56 +75,56 @@
75
75
  "peerDependencies": {
76
76
  "@earendil-works/pi-ai": "0.82.1",
77
77
  "@deepseek-ai/cordis": "^4.0.1-rc.1",
78
- "@deepseek-ai/dsh-attachment": "0.1.0-rc.8",
79
- "@deepseek-ai/dsh-agent-default-model": "0.1.0-rc.8",
80
- "@deepseek-ai/dsh-atomic-write": "0.1.0-rc.8",
81
- "@deepseek-ai/dsh-home-paths": "0.1.0-rc.8",
82
- "@deepseek-ai/dsh-host-webserver": "0.1.0-rc.8",
83
- "@deepseek-ai/dsh-invariants": "0.1.0-rc.8",
84
- "@deepseek-ai/dsh-llm": "0.1.0-rc.8",
85
- "@deepseek-ai/dsh-llm-pi-ai": "0.1.0-rc.8",
86
- "@deepseek-ai/dsh-settings": "0.1.0-rc.8",
87
- "@deepseek-ai/dsh-tools": "0.1.0-rc.8",
88
- "@deepseek-ai/dsh-client-locale": "0.1.0-rc.8",
89
- "@deepseek-ai/dsh-client-runtime": "0.1.0-rc.8",
90
- "@deepseek-ai/dsh-client-ui-primitives": "0.1.0-rc.8",
91
- "@deepseek-ai/dsh-client-ui-settings": "0.1.0-rc.8",
92
- "@deepseek-ai/dsh-client-ui-settings-plugins": "0.1.0-rc.8",
93
- "@deepseek-ai/dsh-client-ui-slots": "0.1.0-rc.8",
94
- "@deepseek-ai/dsh-credentials": "0.1.0-rc.8",
95
- "@deepseek-ai/dsh-fs": "0.1.0-rc.8",
96
- "@deepseek-ai/dsh-launch-environment": "0.1.0-rc.8",
97
- "@deepseek-ai/dsh-timeout": "0.1.0-rc.8",
78
+ "@deepseek-ai/dsh-attachment": "0.1.1-rc.2",
79
+ "@deepseek-ai/dsh-agent-default-model": "0.1.1-rc.2",
80
+ "@deepseek-ai/dsh-atomic-write": "0.1.1-rc.2",
81
+ "@deepseek-ai/dsh-home-paths": "0.1.1-rc.2",
82
+ "@deepseek-ai/dsh-host-webserver": "0.1.1-rc.2",
83
+ "@deepseek-ai/dsh-invariants": "0.1.1-rc.2",
84
+ "@deepseek-ai/dsh-llm": "0.1.1-rc.2",
85
+ "@deepseek-ai/dsh-llm-pi-ai": "0.1.1-rc.2",
86
+ "@deepseek-ai/dsh-settings": "0.1.1-rc.2",
87
+ "@deepseek-ai/dsh-tools": "0.1.1-rc.2",
88
+ "@deepseek-ai/dsh-client-locale": "0.1.1-rc.2",
89
+ "@deepseek-ai/dsh-client-runtime": "0.1.1-rc.2",
90
+ "@deepseek-ai/dsh-client-ui-primitives": "0.1.1-rc.2",
91
+ "@deepseek-ai/dsh-client-ui-settings": "0.1.1-rc.2",
92
+ "@deepseek-ai/dsh-client-ui-settings-plugins": "0.1.1-rc.2",
93
+ "@deepseek-ai/dsh-client-ui-slots": "0.1.1-rc.2",
94
+ "@deepseek-ai/dsh-credentials": "0.1.1-rc.2",
95
+ "@deepseek-ai/dsh-fs": "0.1.1-rc.2",
96
+ "@deepseek-ai/dsh-launch-environment": "0.1.1-rc.2",
97
+ "@deepseek-ai/dsh-timeout": "0.1.1-rc.2",
98
98
  "@deepseek-ai/schemastery": "3.18.1",
99
99
  "react": "^18.2.0"
100
100
  },
101
101
  "devDependencies": {
102
102
  "@earendil-works/pi-ai": "0.82.1",
103
103
  "@deepseek-ai/cordis": "^4.0.1",
104
- "@deepseek-ai/dsh-api-remotes": "0.1.0-rc.8",
105
- "@deepseek-ai/dsh-agent-default-model": "0.1.0-rc.8",
106
- "@deepseek-ai/dsh-attachment": "0.1.0-rc.8",
107
- "@deepseek-ai/dsh-atomic-write": "0.1.0-rc.8",
108
- "@deepseek-ai/dsh-client-connection": "0.1.0-rc.8",
109
- "@deepseek-ai/dsh-client-locale": "0.1.0-rc.8",
110
- "@deepseek-ai/dsh-client-runtime": "0.1.0-rc.8",
111
- "@deepseek-ai/dsh-client-ui-conversation": "0.1.0-rc.8",
112
- "@deepseek-ai/dsh-client-ui-model-selection": "0.1.0-rc.8",
113
- "@deepseek-ai/dsh-client-ui-primitives": "0.1.0-rc.8",
114
- "@deepseek-ai/dsh-client-ui-settings": "0.1.0-rc.8",
115
- "@deepseek-ai/dsh-client-ui-settings-plugins": "0.1.0-rc.8",
116
- "@deepseek-ai/dsh-client-ui-slots": "0.1.0-rc.8",
117
- "@deepseek-ai/dsh-credentials": "0.1.0-rc.8",
118
- "@deepseek-ai/dsh-home-paths": "0.1.0-rc.8",
119
- "@deepseek-ai/dsh-fs": "0.1.0-rc.8",
120
- "@deepseek-ai/dsh-host-webserver": "0.1.0-rc.8",
121
- "@deepseek-ai/dsh-invariants": "0.1.0-rc.8",
122
- "@deepseek-ai/dsh-launch-environment": "0.1.0-rc.8",
123
- "@deepseek-ai/dsh-llm": "0.1.0-rc.8",
124
- "@deepseek-ai/dsh-llm-pi-ai": "0.1.0-rc.8",
125
- "@deepseek-ai/dsh-settings": "0.1.0-rc.8",
126
- "@deepseek-ai/dsh-tools": "0.1.0-rc.8",
127
- "@deepseek-ai/dsh-timeout": "0.1.0-rc.8",
104
+ "@deepseek-ai/dsh-api-remotes": "0.1.1-rc.2",
105
+ "@deepseek-ai/dsh-agent-default-model": "0.1.1-rc.2",
106
+ "@deepseek-ai/dsh-attachment": "0.1.1-rc.2",
107
+ "@deepseek-ai/dsh-atomic-write": "0.1.1-rc.2",
108
+ "@deepseek-ai/dsh-client-connection": "0.1.1-rc.2",
109
+ "@deepseek-ai/dsh-client-locale": "0.1.1-rc.2",
110
+ "@deepseek-ai/dsh-client-runtime": "0.1.1-rc.2",
111
+ "@deepseek-ai/dsh-client-ui-conversation": "0.1.1-rc.2",
112
+ "@deepseek-ai/dsh-client-ui-model-selection": "0.1.1-rc.2",
113
+ "@deepseek-ai/dsh-client-ui-primitives": "0.1.1-rc.2",
114
+ "@deepseek-ai/dsh-client-ui-settings": "0.1.1-rc.2",
115
+ "@deepseek-ai/dsh-client-ui-settings-plugins": "0.1.1-rc.2",
116
+ "@deepseek-ai/dsh-client-ui-slots": "0.1.1-rc.2",
117
+ "@deepseek-ai/dsh-credentials": "0.1.1-rc.2",
118
+ "@deepseek-ai/dsh-home-paths": "0.1.1-rc.2",
119
+ "@deepseek-ai/dsh-fs": "0.1.1-rc.2",
120
+ "@deepseek-ai/dsh-host-webserver": "0.1.1-rc.2",
121
+ "@deepseek-ai/dsh-invariants": "0.1.1-rc.2",
122
+ "@deepseek-ai/dsh-launch-environment": "0.1.1-rc.2",
123
+ "@deepseek-ai/dsh-llm": "0.1.1-rc.2",
124
+ "@deepseek-ai/dsh-llm-pi-ai": "0.1.1-rc.2",
125
+ "@deepseek-ai/dsh-settings": "0.1.1-rc.2",
126
+ "@deepseek-ai/dsh-tools": "0.1.1-rc.2",
127
+ "@deepseek-ai/dsh-timeout": "0.1.1-rc.2",
128
128
  "@deepseek-ai/schemastery": "3.18.1",
129
129
  "@types/node": "^22.20.0",
130
130
  "@types/react": "~18.3.1",
@@ -133,4 +133,4 @@
133
133
  "typescript": "^5.9.3",
134
134
  "vitest": "^4.1.8"
135
135
  }
136
- }
136
+ }