dsh-use-chatgpt 1.0.1 → 1.0.3

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/dist/client.js CHANGED
@@ -25,13 +25,13 @@ __export(index_exports, {
25
25
  inject: () => inject
26
26
  });
27
27
  module.exports = __toCommonJS(index_exports);
28
- var import_react4 = require("react");
28
+ var import_react5 = require("react");
29
29
  var import_dsh_client_ui_primitives3 = require("@deepseek-ai/dsh-client-ui-primitives");
30
30
 
31
31
  // package.json
32
32
  var package_default = {
33
33
  name: "dsh-use-chatgpt",
34
- version: "1.0.1",
34
+ version: "1.0.3",
35
35
  description: "ChatGPT plan model provider for a local DeepSeek Harness desktop instance",
36
36
  type: "module",
37
37
  engines: { node: "^22.19.0 || >=24.0.0" },
@@ -336,12 +336,202 @@ function ModelCatalog({ t, language, resource, profileId }) {
336
336
  ] });
337
337
  }
338
338
 
339
+ // client/PluginRecommendations.jsx
340
+ var import_react2 = require("react");
341
+ var import_jsx_runtime3 = require("react/jsx-runtime");
342
+ var plugins = [
343
+ {
344
+ title: "dsh-open-model",
345
+ packageName: "dsh-open-model",
346
+ description: "freeModelsDescription",
347
+ guide: "https://github.com/houyanchao/dsh-open-model#\u5728\u81EA\u7814-dsh-\u5BA2\u6237\u7AEF\u5B89\u88C5"
348
+ },
349
+ {
350
+ title: "dsh-timeline",
351
+ packageName: "dsh-timeline",
352
+ description: "timelineDescription",
353
+ guide: "https://github.com/houyanchao/dsh-timeline#-\u5B89\u88C5"
354
+ },
355
+ { title: "timeline", description: "browserDescription", stores: [
356
+ { label: "chromeStore", href: "https://chromewebstore.google.com/detail/fgebdnlceacaiaeikopldglhffljjlhh" },
357
+ { label: "edgeStore", href: "https://microsoftedge.microsoft.com/addons/detail/ekednjjojnhlajfobalaaihkibbdcbab" }
358
+ ] }
359
+ ];
360
+ function InstallButton({ plugin, installer, state, t }) {
361
+ const { packageName, title } = plugin;
362
+ let label = "installPlugin";
363
+ if (state.pending === packageName) label = "installingPlugin";
364
+ else if (state.inventory === "unavailable") label = "installUnavailable";
365
+ else if (state.inventory === "failed") label = "retryPlugins";
366
+ else if (state.inventory === "loading") label = "checkingPlugins";
367
+ else if (state.installed.has(packageName)) label = "installedPlugin";
368
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
369
+ "button",
370
+ {
371
+ type: "button",
372
+ className: "cg-plugin-action",
373
+ "data-state": label,
374
+ "aria-label": t("pluginAction", { name: title, action: t(label) }),
375
+ disabled: Boolean(state.pending) || label !== "installPlugin" && label !== "retryPlugins",
376
+ onClick: () => {
377
+ void (label === "retryPlugins" ? installer.refresh() : installer.install(packageName));
378
+ },
379
+ children: t(label)
380
+ }
381
+ );
382
+ }
383
+ function PluginRecommendations({ installer, t }) {
384
+ const headingId = (0, import_react2.useId)();
385
+ const state = (0, import_react2.useSyncExternalStore)(installer.subscribe, installer.getSnapshot);
386
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("section", { className: "cg-recommendations", "aria-labelledby": headingId, children: [
387
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("h2", { id: headingId, children: t("otherPlugins") }),
388
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("ul", { className: "cg-plugin-list", children: plugins.map((plugin) => {
389
+ const { title, packageName, description, stores } = plugin;
390
+ const error = packageName && state.error?.name === packageName && !state.installed.has(packageName) && state.error;
391
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("li", { className: "cg-plugin-row", children: [
392
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { children: [
393
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("strong", { children: title }),
394
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { children: t(description) })
395
+ ] }),
396
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "cg-plugin-actions", "aria-live": "polite", children: stores ? stores.map(
397
+ ({ label, href }) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
398
+ "a",
399
+ {
400
+ className: "cg-plugin-action",
401
+ href,
402
+ target: "_blank",
403
+ rel: "noopener noreferrer",
404
+ "aria-label": t("pluginAction", { name: title, action: t(label) }),
405
+ children: t(label)
406
+ },
407
+ label
408
+ )
409
+ ) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(InstallButton, { plugin, installer, state, t }) }),
410
+ error && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "dsh-use-chatgpt-error", role: "alert", children: error.problem === "not-found" ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
411
+ t("packageNotFound", { name: packageName }),
412
+ " ",
413
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("a", { href: plugin.guide, target: "_blank", rel: "noopener noreferrer", children: t("installGuide") })
414
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
415
+ t("installError"),
416
+ " ",
417
+ error.message
418
+ ] }) })
419
+ ] }, title);
420
+ }) }),
421
+ state.inventory === "failed" && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "dsh-use-chatgpt-error", role: "alert", children: t("inventoryError") })
422
+ ] });
423
+ }
424
+
425
+ // client/plugin-installer.js
426
+ var npmRegistry = "https://registry.npmjs.org/";
427
+ var publishedVersion = /^\d+\.\d+\.\d+(?:-[\da-z-]+(?:\.[\da-z-]+)*)?(?:\+[\da-z-]+(?:\.[\da-z-]+)*)?$/i;
428
+ function rpcValue(reply) {
429
+ if (!reply?.ok) throw new Error(reply?.error?.message);
430
+ return reply.value;
431
+ }
432
+ function createPluginInstaller(ctx) {
433
+ const listeners = /* @__PURE__ */ new Set();
434
+ const initial = { inventory: "unavailable", installed: /* @__PURE__ */ new Set(), pending: null, error: null };
435
+ let state = initial;
436
+ let connection;
437
+ let revision = 0;
438
+ function update(changes) {
439
+ state = { ...state, ...changes };
440
+ for (const listener of listeners) listener();
441
+ }
442
+ async function refresh() {
443
+ if (!connection) return;
444
+ const current = ++revision;
445
+ try {
446
+ const bundles = rpcValue(await connection.manager.listBundles());
447
+ const installed = new Set(bundles.filter((bundle) => bundle.installed || bundle.availability === "profile" || bundle.availability === "installation").map((bundle) => bundle.name));
448
+ if (installed.has("@houyanchao/dsh-free-model")) installed.add("dsh-open-model");
449
+ if (current === revision) {
450
+ update({ inventory: "ready", installed, error: installed.has(state.error?.name) ? null : state.error });
451
+ }
452
+ } catch {
453
+ if (current === revision) update({ inventory: "failed" });
454
+ }
455
+ }
456
+ ctx.inject(["remote", "remote.pluginManager"], (scope) => {
457
+ scope.effect(() => {
458
+ connection = { manager: scope.remote.pluginManager };
459
+ const recheck = () => {
460
+ if (listeners.size) void refresh();
461
+ };
462
+ const unsubscribe = scope.remote.$on("plugin-manager/changed", recheck);
463
+ const reset = scope.on("connection/reset", recheck);
464
+ globalThis.window?.addEventListener("focus", recheck);
465
+ update({ ...initial, inventory: "loading" });
466
+ recheck();
467
+ return () => {
468
+ connection = void 0;
469
+ revision++;
470
+ update(initial);
471
+ unsubscribe();
472
+ reset();
473
+ globalThis.window?.removeEventListener("focus", recheck);
474
+ };
475
+ }, "dsh-use-chatgpt: recommended plugin inventory");
476
+ });
477
+ async function install(name) {
478
+ if (!connection || state.inventory !== "ready" || state.pending || state.installed.has(name)) return;
479
+ const active = connection;
480
+ const { manager } = active;
481
+ update({ pending: name, error: null });
482
+ try {
483
+ const info = rpcValue(await manager.inspect(name, { registry: npmRegistry }));
484
+ if (active !== connection) return;
485
+ if (info.status !== "accepted") {
486
+ update({ error: { name, message: info.reason, problem: info.problem } });
487
+ return;
488
+ }
489
+ if (info.registry !== npmRegistry || info.name !== name || info.bundle !== true || typeof info.version !== "string" || !publishedVersion.test(info.version)) throw new Error();
490
+ const requestId = globalThis.crypto?.randomUUID?.();
491
+ const options = {
492
+ registry: npmRegistry,
493
+ enabled: true,
494
+ expected: { name, version: info.version },
495
+ ...requestId && { requestId }
496
+ };
497
+ let result;
498
+ try {
499
+ result = rpcValue(await manager.installBundle(`${name}@${info.version}`, options));
500
+ } catch (error) {
501
+ if (!requestId || active !== connection) throw error;
502
+ result = rpcValue(await manager.waitForInstall(requestId));
503
+ if (!result) throw error;
504
+ }
505
+ if (!["applied", "restart-required", "overridden"].includes(result.application)) {
506
+ throw new Error(result.error?.diagnostic || result.error?.code);
507
+ }
508
+ } catch (error) {
509
+ if (active === connection) update({ error: { name, message: error.message } });
510
+ } finally {
511
+ if (active === connection) {
512
+ await refresh();
513
+ if (active === connection) update({ pending: null });
514
+ }
515
+ }
516
+ }
517
+ return {
518
+ getSnapshot: () => state,
519
+ subscribe(listener) {
520
+ listeners.add(listener);
521
+ if (listeners.size === 1) void refresh();
522
+ return () => listeners.delete(listener);
523
+ },
524
+ install,
525
+ refresh
526
+ };
527
+ }
528
+
339
529
  // client/NativeChatOptions.jsx
340
- var import_react3 = require("react");
530
+ var import_react4 = require("react");
341
531
  var import_dsh_client_ui_primitives2 = require("@deepseek-ai/dsh-client-ui-primitives");
342
532
 
343
533
  // client/use-chat-options.js
344
- var import_react2 = require("react");
534
+ var import_react3 = require("react");
345
535
  async function readOrSave(profileId, id, signal, patch) {
346
536
  const params = new URLSearchParams({ profileId, sessionId: id });
347
537
  const response = await fetch("/api/dsh-use-chatgpt/chat-options?" + params, {
@@ -357,11 +547,11 @@ async function readOrSave(profileId, id, signal, patch) {
357
547
  return data.features;
358
548
  }
359
549
  function useChatOptions(profileId, id) {
360
- const [state, setState] = (0, import_react2.useState)({ id });
361
- const [revision, setRevision] = (0, import_react2.useState)(0);
362
- const generation = (0, import_react2.useRef)(null);
363
- const writing = (0, import_react2.useRef)(false);
364
- (0, import_react2.useEffect)(() => {
550
+ const [state, setState] = (0, import_react3.useState)({ id });
551
+ const [revision, setRevision] = (0, import_react3.useState)(0);
552
+ const generation = (0, import_react3.useRef)(null);
553
+ const writing = (0, import_react3.useRef)(false);
554
+ (0, import_react3.useEffect)(() => {
365
555
  const controller = new AbortController();
366
556
  const { signal } = controller;
367
557
  generation.current = controller;
@@ -396,20 +586,20 @@ function useChatOptions(profileId, id) {
396
586
  }
397
587
 
398
588
  // client/NativeChatOptions.jsx
399
- var import_jsx_runtime3 = require("react/jsx-runtime");
589
+ var import_jsx_runtime4 = require("react/jsx-runtime");
400
590
  function SearchRetry({ t, message, retry }) {
401
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("button", { type: "button", className: "cg-search-retry", title: message, onClick: retry, children: [
591
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("button", { type: "button", className: "cg-search-retry", title: message, onClick: retry, children: [
402
592
  t("searchRetry"),
403
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "cg-search-sr", role: "alert", children: message })
593
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "cg-search-sr", role: "alert", children: message })
404
594
  ] });
405
595
  }
406
596
  function SessionSearch({ profileId, id, t }) {
407
597
  const { features, saving, save, error, retry } = useChatOptions(profileId, id);
408
- if (!features) return error ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(SearchRetry, { t, message: error, retry }) : null;
409
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "cg-search-tool", "aria-busy": Boolean(saving), children: [
410
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { title: t("searchHelp"), className: "cg-search-label", children: [
411
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: t("webSearch") }),
412
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
598
+ if (!features) return error ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SearchRetry, { t, message: error, retry }) : null;
599
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "cg-search-tool", "aria-busy": Boolean(saving), children: [
600
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { title: t("searchHelp"), className: "cg-search-label", children: [
601
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: t("webSearch") }),
602
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
413
603
  import_dsh_client_ui_primitives2.Switch,
414
604
  {
415
605
  checked: features.webSearch,
@@ -421,21 +611,21 @@ function SessionSearch({ profileId, id, t }) {
421
611
  }
422
612
  )
423
613
  ] }),
424
- error && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { role: "alert", className: "cg-search-failure", title: error, children: t("saveFailed") })
614
+ error && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { role: "alert", className: "cg-search-failure", title: error, children: t("saveFailed") })
425
615
  ] });
426
616
  }
427
617
  function ConnectedSearch({ id, t, useConnection: useConnection2 }) {
428
618
  const { connection, error, refresh } = useConnection2();
429
- if (error) return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(SearchRetry, { t, message: t("requestFailed"), retry: () => {
619
+ if (error) return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SearchRetry, { t, message: t("requestFailed"), retry: () => {
430
620
  void refresh();
431
621
  } });
432
622
  if (connection?.status !== "connected" || !connection.sharing || !connection.profileId) return null;
433
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(SessionSearch, { id, profileId: connection.profileId, t }, JSON.stringify([id, connection.profileId]));
623
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SessionSearch, { id, profileId: connection.profileId, t }, JSON.stringify([id, connection.profileId]));
434
624
  }
435
625
  function ModelSearch({ directory, id, t, useConnection: useConnection2 }) {
436
- const model = (0, import_react3.useSyncExternalStore)(directory.subscribe, directory.getSnapshot);
626
+ const model = (0, import_react4.useSyncExternalStore)(directory.subscribe, directory.getSnapshot);
437
627
  if (model.current?.provider !== "chatgpt-plan" || model.routable === false) return null;
438
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ConnectedSearch, { id, t, useConnection: useConnection2 });
628
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ConnectedSearch, { id, t, useConnection: useConnection2 });
439
629
  }
440
630
  function registerNativeChatOptions(ctx, useConnection2) {
441
631
  ctx.inject(["slots", "sessions", "modelDirectories"], (scope) => {
@@ -449,7 +639,7 @@ function registerNativeChatOptions(ctx, useConnection2) {
449
639
  return { id, directory: scope.modelDirectories.directoryFor(id).store };
450
640
  }
451
641
  }, function NativeSearch({ id, directory, t }) {
452
- return directory ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ModelSearch, { id, directory, t, useConnection: useConnection2 }) : null;
642
+ return directory ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ModelSearch, { id, directory, t, useConnection: useConnection2 }) : null;
453
643
  }));
454
644
  });
455
645
  }
@@ -461,9 +651,9 @@ var chatgpt_button_black_21_default = 'data:image/svg+xml,<svg preserveAspectRat
461
651
  var chatgpt_button_white_21_default = 'data:image/svg+xml,<svg preserveAspectRatio="none" overflow="visible" style="display: block;" width="21" height="21" viewBox="0 0 21 21" fill="none" xmlns="http://www.w3.org/2000/svg">%0A<g id="ChatGPT logo &%23226;&%23128;&%23148; original vector">%0A<path id="Vector" d="M11.8102 19.1625C11.2327 19.1625 10.6841 19.0528 10.1643 18.8334C9.64459 18.6139 9.18259 18.3078 8.77834 17.9151C8.33944 18.0653 7.88322 18.1404 7.40967 18.1404C6.63582 18.1404 5.91972 17.9498 5.26137 17.5686C4.60302 17.1875 4.07172 16.6677 3.66747 16.0094C3.27477 15.351 3.07842 14.6176 3.07842 13.8091C3.07842 13.4742 3.12462 13.1103 3.21702 12.7176C2.75502 12.2903 2.39697 11.7994 2.14287 11.245C1.88877 10.679 1.76172 10.09 1.76172 9.47785C1.76172 8.85415 1.89454 8.25355 2.16019 7.67605C2.42584 7.09855 2.79544 6.6019 3.26899 6.1861C3.75409 5.75875 4.31427 5.46422 4.94952 5.30252C5.07657 4.64417 5.34222 4.05512 5.74647 3.53537C6.16227 3.00407 6.67047 2.58827 7.27107 2.28797C7.87167 1.98767 8.51269 1.83752 9.19414 1.83752C9.77164 1.83752 10.3203 1.94725 10.84 2.1667C11.3598 2.38615 11.8218 2.69222 12.226 3.08492C12.6649 2.93477 13.1211 2.8597 13.5947 2.8597C14.3685 2.8597 15.0846 3.05027 15.743 3.43142C16.4013 3.81257 16.9269 4.33232 17.3196 4.99067C17.7238 5.64902 17.9259 6.38245 17.9259 7.19095C17.9259 7.5259 17.8797 7.88973 17.7873 8.28242C18.2493 8.70977 18.6074 9.20643 18.8615 9.77238C19.1156 10.3268 19.2426 10.91 19.2426 11.5222C19.2426 12.1459 19.1098 12.7465 18.8442 13.324C18.5785 13.9015 18.2031 14.4039 17.718 14.8313C17.2445 15.2471 16.6901 15.5358 16.0548 15.6975C15.9278 16.3559 15.6564 16.9449 15.2406 17.4647C14.8363 17.996 14.3339 18.4118 13.7333 18.7121C13.1327 19.0124 12.4917 19.1625 11.8102 19.1625ZM7.53094 16.9969C8.10844 16.9969 8.61087 16.8756 9.03822 16.6331L12.2953 14.762C12.4108 14.6811 12.4686 14.5714 12.4686 14.4328V12.9429L8.27592 15.351C8.02182 15.5012 7.76772 15.5012 7.51362 15.351L4.23919 13.4626C4.23919 13.4973 4.23342 13.5377 4.22187 13.5839C4.22187 13.6301 4.22187 13.6994 4.22187 13.7918C4.22187 14.3808 4.36047 14.9237 4.63767 15.4203C4.92642 15.9054 5.32489 16.2866 5.83309 16.5638C6.34129 16.8525 6.90724 16.9969 7.53094 16.9969ZM7.70419 14.1729C7.77349 14.2076 7.83702 14.2249 7.89477 14.2249C7.95252 14.2249 8.01027 14.2076 8.06802 14.1729L9.36739 13.4279L5.19207 11.0024C4.93797 10.8523 4.81092 10.6271 4.81092 10.3268V6.56725C4.23342 6.82135 3.77142 7.21405 3.42492 7.74535C3.07842 8.2651 2.90517 8.8426 2.90517 9.47785C2.90517 10.0438 3.04954 10.5866 3.33829 11.1064C3.62704 11.6261 4.00242 12.0189 4.46442 12.2845L7.70419 14.1729ZM11.8102 18.0191C12.4224 18.0191 12.9768 17.8805 13.4734 17.6033C13.9701 17.3261 14.3628 16.9449 14.6515 16.4598C14.9403 15.9747 15.0846 15.4319 15.0846 14.8313V11.0891C15.0846 10.9505 15.0269 10.8465 14.9114 10.7772L13.5947 10.0149V14.8486C13.5947 15.1489 13.4676 15.3741 13.2135 15.5243L9.93912 17.4127C10.5051 17.817 11.1288 18.0191 11.8102 18.0191ZM12.4686 11.6781V9.32192L10.5108 8.21312L8.53579 9.32192V11.6781L10.5108 12.7869L12.4686 11.6781ZM7.40967 6.15145C7.40967 5.85115 7.53672 5.62592 7.79082 5.47577L11.0652 3.58735C10.4993 3.1831 9.87559 2.98097 9.19414 2.98097C8.58199 2.98097 8.02759 3.11957 7.53094 3.39677C7.03429 3.67397 6.64159 4.05512 6.35284 4.54022C6.07564 5.02532 5.93704 5.56817 5.93704 6.16878V9.89365C5.93704 10.0323 5.99479 10.142 6.11029 10.2228L7.40967 10.9851V6.15145ZM16.2108 14.4328C16.7883 14.1787 17.2445 13.786 17.5794 13.2547C17.9259 12.7234 18.0992 12.1459 18.0992 11.5222C18.0992 10.9562 17.9548 10.4134 17.6661 9.89365C17.3773 9.3739 17.0019 8.9812 16.5399 8.71555L13.3002 6.84445C13.2309 6.79825 13.1673 6.78092 13.1096 6.79248C13.0518 6.79248 12.9941 6.8098 12.9363 6.84445L11.637 7.5721L15.8296 10.0149C15.9567 10.0842 16.0491 10.1766 16.1068 10.2921C16.1761 10.3961 16.2108 10.5231 16.2108 10.6733V14.4328ZM12.7284 5.6317C12.9825 5.47 13.2366 5.47 13.4907 5.6317L16.7825 7.55477C16.7825 7.47393 16.7825 7.36997 16.7825 7.24292C16.7825 6.68852 16.6439 6.163 16.3667 5.66635C16.101 5.15815 15.7141 4.7539 15.2059 4.4536C14.7093 4.1533 14.1318 4.00315 13.4734 4.00315C12.8959 4.00315 12.3935 4.12442 11.9661 4.36697L8.70904 6.23808C8.59354 6.31892 8.53579 6.42865 8.53579 6.56725V8.0572L12.7284 5.6317Z" fill="white"/>%0A</g>%0A</svg>%0A';
462
652
 
463
653
  // client/ChatGPTMark.jsx
464
- var import_jsx_runtime4 = require("react/jsx-runtime");
654
+ var import_jsx_runtime5 = require("react/jsx-runtime");
465
655
  function ChatGPTMark({ size = 20, className = "", tone = "auto" }) {
466
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
656
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
467
657
  "span",
468
658
  {
469
659
  className: `dsh-use-chatgpt-mark ${className}`.trimEnd(),
@@ -471,53 +661,15 @@ function ChatGPTMark({ size = 20, className = "", tone = "auto" }) {
471
661
  "aria-hidden": "true",
472
662
  style: { width: size, height: size },
473
663
  children: [
474
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("img", { className: "dsh-chatgpt-dark-ink", src: chatgpt_button_black_21_default, alt: "" }),
475
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("img", { className: "dsh-chatgpt-light-ink", src: chatgpt_button_white_21_default, alt: "" })
664
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("img", { className: "dsh-chatgpt-dark-ink", src: chatgpt_button_black_21_default, alt: "" }),
665
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("img", { className: "dsh-chatgpt-light-ink", src: chatgpt_button_white_21_default, alt: "" })
476
666
  ]
477
667
  }
478
668
  );
479
669
  }
480
670
 
481
671
  // client/sidebar.css
482
- var sidebar_default = `.dsh-use-chatgpt-mark {
483
- display: inline-block;
484
- flex: none;
485
- }
486
-
487
- .dsh-use-chatgpt-mark img {
488
- display: block;
489
- width: 100%;
490
- height: 100%;
491
- }
492
-
493
- .dsh-use-chatgpt-mark .dsh-chatgpt-light-ink,
494
- .dsh-use-chatgpt-mark[data-tone="light"] .dsh-chatgpt-dark-ink,
495
- body[data-ds-dark-theme] .dsh-use-chatgpt-mark[data-tone="auto"] .dsh-chatgpt-dark-ink {
496
- display: none;
497
- }
498
-
499
- .dsh-use-chatgpt-mark[data-tone="light"] .dsh-chatgpt-light-ink,
500
- body[data-ds-dark-theme] .dsh-use-chatgpt-mark[data-tone="auto"] .dsh-chatgpt-light-ink {
501
- display: block;
502
- }
503
-
504
- /* The host's trailing slot normally aligns counters to the far edge. Keep the
505
- update badge beside the panel name, including while the unpin button shows. */
506
- button[aria-describedby] > span[id]:has(.dsh-use-chatgpt-update-badge) {
507
- margin-inline-start: 0;
508
- min-width: 0;
509
- opacity: 1;
510
- }
511
-
512
- .dsh-use-chatgpt-update-sr {
513
- position: absolute;
514
- width: 1px;
515
- height: 1px;
516
- overflow: hidden;
517
- clip-path: inset(50%);
518
- white-space: nowrap;
519
- }
520
- `;
672
+ var sidebar_default = '.dsh-use-chatgpt-mark {\n display: inline-block;\n flex: none;\n}\n\n.dsh-use-chatgpt-mark img {\n display: block;\n width: 100%;\n height: 100%;\n}\n\n.dsh-use-chatgpt-mark .dsh-chatgpt-light-ink,\n.dsh-use-chatgpt-mark[data-tone="light"] .dsh-chatgpt-dark-ink,\nbody[data-ds-dark-theme] .dsh-use-chatgpt-mark[data-tone="auto"] .dsh-chatgpt-dark-ink {\n display: none;\n}\n\n.dsh-use-chatgpt-mark[data-tone="light"] .dsh-chatgpt-light-ink,\nbody[data-ds-dark-theme] .dsh-use-chatgpt-mark[data-tone="auto"] .dsh-chatgpt-light-ink {\n display: block;\n}\n\n.dsh-use-chatgpt-update-dot {\n display: inline-block;\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background: var(--dsw-alias-label-primary, currentColor);\n}\n\n.dsh-use-chatgpt-update-sr {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n}\n';
521
673
 
522
674
  // client/updates.js
523
675
  var versionStatuses = /* @__PURE__ */ new Set(["update_available", "release_pending", "up_to_date", "latest_unstable"]);
@@ -576,10 +728,10 @@ function openPluginDetails(ctx) {
576
728
  }
577
729
 
578
730
  // client/settings.css
579
- var settings_default = ".dsh-use-chatgpt-page {\n --cg-surface: var(--dsw-alias-bg-layer-1, #fff);\n --cg-ink: var(--dsw-alias-label-primary, #0d0d0d);\n --cg-muted: var(--dsw-alias-label-secondary, #5d5d5d);\n --cg-line: color-mix(in srgb, var(--cg-ink) 13%, var(--cg-surface));\n --cg-wash: color-mix(in srgb, var(--cg-ink) 5%, var(--cg-surface));\n --cg-accent: var(--cg-ink);\n --cg-allowed: #257250;\n width: 100%; height: 100%; min-width: 0; overflow: auto;\n background: var(--cg-surface); color: var(--cg-ink);\n font-family: inherit; font-size: 14px; line-height: 1.5; container: chatgpt-page / inline-size;\n}\nbody[data-ds-dark-theme] .dsh-use-chatgpt-page { --cg-allowed: #9ad5b0; }\n.dsh-use-chatgpt-page *, .dsh-use-chatgpt-page *::before, .dsh-use-chatgpt-page *::after { box-sizing: border-box; }\n.dsh-use-chatgpt-page [hidden] { display: none !important; }\n.dsh-use-chatgpt-content { width: min(calc(100% - 48px), 728px); margin: 0 auto; padding: 30px 0 58px; }\n.dsh-use-chatgpt-header { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 5px 12px; }\n.dsh-use-chatgpt-header h1 { margin: 0; font-size: 26px; line-height: 1.25; font-weight: 600; letter-spacing: -.045em; }\n.dsh-use-chatgpt-header p { grid-column: 1 / -1; margin: 0; color: var(--cg-muted); font-size: 15px; line-height: 1.55; }\n.cg-header-version { display: grid; justify-items: end; color: var(--cg-muted); text-align: end; }\n.cg-header-links { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 2px 6px; }\n.cg-project-link {\n display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;\n border-radius: 50%; color: var(--cg-muted); text-decoration: none;\n}\n.cg-project-link:is(:hover, :focus-visible) { background: var(--cg-wash); color: var(--cg-ink); }\n.dsh-use-chatgpt-page .dsh-use-chatgpt-actions button {\n display: inline-flex; align-items: center; justify-content: center; gap: 7px;\n min-height: 36px; padding: 6px 14px; border: 1px solid var(--cg-line); border-radius: 999px;\n background: var(--cg-wash); color: var(--cg-ink); cursor: pointer;\n font: inherit; font-size: 14px; line-height: 1.4; white-space: normal;\n}\n.dsh-use-chatgpt-page .dsh-use-chatgpt-actions button:hover:enabled {\n background: color-mix(in srgb, var(--cg-ink) 9%, var(--cg-surface));\n}\n.dsh-use-chatgpt-page :where(button, select, a, summary):focus-visible { outline: 2px solid var(--cg-ink); outline-offset: 3px; }\n.dsh-use-chatgpt-page button:disabled { cursor: default; opacity: .55; }\n.cg-dashboard { display: grid; gap: 34px; margin-top: 41px; }\n.cg-account { min-width: 0; }\n.cg-account-heading { padding-bottom: 12px; border-bottom: 1px solid var(--cg-line); }\n.cg-account-heading h2 { margin: 0; font-size: 16px; line-height: 1.5; font-weight: 600; }\n.cg-profile-list { margin: 0; padding: 0; list-style: none; }\n.cg-profile {\n display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px;\n min-height: 76px; padding-block: 14px; border-block-end: 1px solid var(--cg-line);\n}\n.cg-profile-avatar {\n display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; overflow: hidden;\n background: var(--cg-ink); color: var(--cg-surface); font-size: 13px; line-height: 1; font-weight: 550;\n}\n.cg-profile-text { display: grid; gap: 3px; min-width: 0; }\n.cg-profile-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }\n.cg-profile-name strong { min-width: 0; font-size: 15px; font-weight: 550; overflow-wrap: anywhere; }\n.cg-current-account {\n display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 999px;\n background: color-mix(in srgb, var(--cg-allowed) 13%, var(--cg-surface));\n color: var(--cg-allowed); font-size: 11px; font-weight: 600; white-space: nowrap;\n}\n.cg-profile-meta { display: flex; align-items: center; gap: 3px 12px; flex-wrap: wrap; font-size: 13px; color: var(--cg-muted); overflow-wrap: anywhere; }\n.cg-profile-actions { display: flex; align-items: center; justify-self: end; gap: 6px; }\n.cg-account-action, .cg-account-more, .cg-account-add {\n display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 32px;\n border: 1px solid transparent; border-radius: 999px; background: transparent; color: var(--cg-ink);\n font: inherit; font-size: 13px; font-weight: 500; line-height: 1.4; cursor: pointer;\n}\n.cg-account-action, .cg-account-add { border-color: var(--cg-line); padding: 5px 12px; }\n.cg-account-more { width: 32px; padding: 0; color: var(--cg-muted); }\n.cg-account-add { min-height: 36px; margin-block-start: 14px; font-size: 14px; }\n.cg-account-action:hover:enabled, .cg-account-add:hover:enabled,\n.cg-account-more:hover:enabled, .cg-account-more[aria-expanded=true] { color: var(--cg-ink); background: var(--cg-wash); }\n.cg-account-flow { display: grid; gap: 12px; justify-items: start; padding: 16px 0; }\n.cg-account-flow p { margin: 0; color: var(--cg-muted); }\n.dsh-use-chatgpt-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }\n.dsh-use-chatgpt-actions:empty { display: none; }\n.cg-account > p { margin: 12px 0; font-size: 14px; color: var(--cg-muted); }\n.dsh-use-chatgpt-page .dsh-use-chatgpt-error { color: var(--dsw-alias-state-warn-label, #9a461e); overflow-wrap: anywhere; }\n.cg-login-layout {\n display: grid; grid-template-columns: minmax(0, 1fr);\n grid-template-rows: minmax(min-content, 1fr) auto minmax(min-content, 1fr);\n justify-items: center; gap: 20px;\n min-height: 100%; width: 100%; padding: 20px clamp(16px, 4cqi, 40px);\n}\n.cg-welcome {\n grid-row: 2; display: flex; flex-direction: column; align-items: center;\n width: min(100%, 392px); text-align: center;\n}\n.cg-welcome-heading { display: grid; justify-items: center; gap: 22px; }\n.cg-welcome-heading h1 { margin: 0; font-size: clamp(26px, 4cqi, 34px); font-weight: 600; letter-spacing: -.035em; line-height: 1.18; text-wrap: balance; }\n.cg-welcome > .cg-account-status { margin: 12px 0 0; font-size: 15px; line-height: 1.6; text-wrap: balance; }\n.cg-welcome > .dsh-use-chatgpt-actions:not(:empty) {\n display: grid; width: min(100%, 310px); gap: 8px; margin-top: 26px;\n}\n.cg-welcome > .dsh-use-chatgpt-actions button { width: 100%; min-height: 46px; font-size: 15px; }\n.cg-welcome .dsh-use-chatgpt-actions .cg-primary { background: var(--cg-ink); color: var(--cg-surface); font-weight: 550; }\n.cg-welcome .dsh-use-chatgpt-actions .cg-primary:hover:enabled { background: color-mix(in srgb, var(--cg-ink) 85%, var(--cg-surface)); }\n.cg-login-footer { grid-row: 3; align-self: end; display: grid; justify-items: center; color: var(--cg-muted); text-align: center; }\n.cg-version {\n display: inline-flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 4px 7px; max-width: 100%;\n min-height: 32px; padding: 4px 0; border: 0; border-radius: 8px;\n background: transparent; color: inherit; font: inherit; font-size: 12px; font-variant-numeric: tabular-nums;\n overflow-wrap: anywhere; cursor: default;\n}\n.cg-login-footer .cg-version { justify-content: center; padding: 6px 10px; }\nbutton.cg-version { padding-inline: 8px; cursor: pointer; }\nbutton.cg-version:hover { color: var(--cg-ink); background: var(--cg-wash); }\n.dsh-use-chatgpt-update-badge {\n display: inline-flex; align-items: center; flex: none; vertical-align: middle;\n padding: 1px 6px; border-radius: 999px; white-space: nowrap;\n background-color: #171717;\n color: #fff;\n font-family: inherit; font-size: 11px; font-weight: 550; line-height: 16px;\n}\nbody[data-ds-dark-theme] .dsh-use-chatgpt-update-badge {\n background-color: #f5f5f5;\n color: #171717;\n}\n.cg-legacy-defaults { font-size: 14px; }\n.cg-legacy-defaults summary { cursor: pointer; }\n.cg-legacy-defaults p { margin: 8px 0; color: var(--cg-muted); }\n@container chatgpt-page (max-width: 510px) {\n .dsh-use-chatgpt-content { width: calc(100% - 36px); padding-block: 22px 36px; }\n .cg-dashboard { margin-top: 28px; }\n .cg-dashboard { gap: 26px; }\n .cg-profile { column-gap: 9px; }\n .cg-profile-meta { gap: 1px 8px; }\n}\n@container chatgpt-page (max-width: 360px) {\n .cg-profile:has(.cg-account-action) { grid-template-columns: auto minmax(0, 1fr); row-gap: 6px; }\n .cg-profile:has(.cg-account-action) .cg-profile-actions { grid-column: 2; justify-self: start; }\n}\n";
731
+ var settings_default = ".dsh-use-chatgpt-page {\n --cg-surface: var(--dsw-alias-bg-layer-1, #fff);\n --cg-ink: var(--dsw-alias-label-primary, #0d0d0d);\n --cg-muted: var(--dsw-alias-label-secondary, #5d5d5d);\n --cg-line: color-mix(in srgb, var(--cg-ink) 13%, var(--cg-surface));\n --cg-wash: color-mix(in srgb, var(--cg-ink) 5%, var(--cg-surface));\n --cg-accent: var(--cg-ink);\n --cg-allowed: #257250;\n width: 100%; height: 100%; min-width: 0; overflow: auto;\n background: var(--cg-surface); color: var(--cg-ink);\n font-family: inherit; font-size: 14px; line-height: 1.5; container: chatgpt-page / inline-size;\n}\nbody[data-ds-dark-theme] .dsh-use-chatgpt-page { --cg-allowed: #9ad5b0; }\n.dsh-use-chatgpt-page *, .dsh-use-chatgpt-page *::before, .dsh-use-chatgpt-page *::after { box-sizing: border-box; }\n.dsh-use-chatgpt-page [hidden] { display: none !important; }\n.dsh-use-chatgpt-content { width: min(calc(100% - 48px), 728px); margin: 0 auto; padding: 30px 0 58px; }\n.cg-update-banner {\n display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px;\n margin-block-end: 24px; padding: 8px 12px 8px 14px;\n border: 1px solid var(--dsw-alias-border-l3, var(--cg-line)); border-radius: 12px;\n background: color-mix(in srgb, var(--cg-ink) 3%, var(--cg-surface));\n}\n.cg-update-copy {\n display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px;\n flex: 1 1 180px; min-width: 0; margin: 0; overflow-wrap: anywhere;\n}\n.cg-update-copy strong { font-weight: 600; }\n.cg-update-copy span { color: var(--cg-muted); font-size: 13px; }\n.cg-update-action, .cg-plugin-action {\n display: inline-flex; align-items: center; min-height: 32px; padding-inline: 12px;\n border: 1px solid var(--dsw-alias-border-l3, var(--cg-line)); border-radius: 999px; white-space: nowrap;\n background: var(--cg-surface); color: var(--cg-ink); font-size: 13px; font-weight: 550; text-decoration: none;\n}\n.cg-update-action { margin-inline-start: auto; }\n.cg-update-action:hover, button.cg-plugin-action:enabled:hover { background: var(--dsw-alias-interactive-bg-hover, var(--cg-wash)); }\n.dsh-use-chatgpt-header { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 5px 12px; }\n.dsh-use-chatgpt-header h1 { margin: 0; font-size: 26px; line-height: 1.25; font-weight: 600; letter-spacing: -.045em; }\n.dsh-use-chatgpt-header p { grid-column: 1 / -1; margin: 0; color: var(--cg-muted); font-size: 15px; line-height: 1.55; }\n.cg-header-version { display: grid; justify-items: end; color: var(--cg-muted); text-align: end; }\n.cg-header-links { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 2px 6px; }\n.cg-project-link {\n display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;\n border-radius: 50%; color: var(--cg-muted); text-decoration: none;\n}\n.cg-project-link:is(:hover, :focus-visible) { background: var(--cg-wash); color: var(--cg-ink); }\n.dsh-use-chatgpt-page .dsh-use-chatgpt-actions button {\n display: inline-flex; align-items: center; justify-content: center; gap: 7px;\n min-height: 36px; padding: 6px 14px; border: 1px solid var(--cg-line); border-radius: 999px;\n background: var(--cg-wash); color: var(--cg-ink); cursor: pointer;\n font: inherit; font-size: 14px; line-height: 1.4; white-space: normal;\n}\n.dsh-use-chatgpt-page .dsh-use-chatgpt-actions button:hover:enabled {\n background: color-mix(in srgb, var(--cg-ink) 9%, var(--cg-surface));\n}\n.dsh-use-chatgpt-page :where(button, select, a, summary):focus-visible { outline: 2px solid var(--cg-ink); outline-offset: 3px; }\n.dsh-use-chatgpt-page button:disabled { cursor: default; opacity: .55; }\n.cg-dashboard { display: grid; gap: 34px; margin-top: 41px; }\n.cg-account { min-width: 0; }\n.cg-account-heading { padding-bottom: 12px; border-bottom: 1px solid var(--cg-line); }\n.cg-account-heading h2 { margin: 0; font-size: 16px; line-height: 1.5; font-weight: 600; }\n.cg-profile-list { margin: 0; padding: 0; list-style: none; }\n.cg-profile {\n display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px;\n min-height: 76px; padding-block: 14px; border-block-end: 1px solid var(--cg-line);\n}\n.cg-profile-avatar {\n display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; overflow: hidden;\n background: var(--cg-ink); color: var(--cg-surface); font-size: 13px; line-height: 1; font-weight: 550;\n}\n.cg-profile-text { display: grid; gap: 3px; min-width: 0; }\n.cg-profile-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }\n.cg-profile-name strong { min-width: 0; font-size: 15px; font-weight: 550; overflow-wrap: anywhere; }\n.cg-current-account {\n display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 999px;\n background: color-mix(in srgb, var(--cg-allowed) 13%, var(--cg-surface));\n color: var(--cg-allowed); font-size: 11px; font-weight: 600; white-space: nowrap;\n}\n.cg-profile-meta { display: flex; align-items: center; gap: 3px 12px; flex-wrap: wrap; font-size: 13px; color: var(--cg-muted); overflow-wrap: anywhere; }\n.cg-profile-actions { display: flex; align-items: center; justify-self: end; gap: 6px; }\n.cg-account-action, .cg-account-more, .cg-account-add {\n display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 32px;\n border: 1px solid transparent; border-radius: 999px; background: transparent; color: var(--cg-ink);\n font: inherit; font-size: 13px; font-weight: 500; line-height: 1.4; cursor: pointer;\n}\n.cg-account-action, .cg-account-add { border-color: var(--cg-line); padding: 5px 12px; }\n.cg-account-more { width: 32px; padding: 0; color: var(--cg-muted); }\n.cg-account-add { min-height: 36px; margin-block-start: 14px; font-size: 14px; }\n.cg-account-action:hover:enabled, .cg-account-add:hover:enabled,\n.cg-account-more:hover:enabled, .cg-account-more[aria-expanded=true] { color: var(--cg-ink); background: var(--cg-wash); }\n.cg-account-flow { display: grid; gap: 12px; justify-items: start; padding: 16px 0; }\n.cg-account-flow p { margin: 0; color: var(--cg-muted); }\n.dsh-use-chatgpt-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }\n.dsh-use-chatgpt-actions:empty { display: none; }\n.cg-account > p { margin: 12px 0; font-size: 14px; color: var(--cg-muted); }\n.dsh-use-chatgpt-page .dsh-use-chatgpt-error { color: var(--dsw-alias-state-warn-label, #9a461e); overflow-wrap: anywhere; }\n.cg-login-layout {\n display: grid; grid-template-columns: minmax(0, 1fr);\n grid-template-rows: minmax(min-content, 1fr) auto minmax(min-content, 1fr);\n justify-items: center; gap: 20px;\n min-height: 100%; width: 100%; padding: 20px clamp(16px, 4cqi, 40px);\n}\n.cg-login-layout > .cg-update-banner { grid-row: 1; align-self: start; width: min(100%, 728px); margin: 0; }\n.cg-welcome {\n grid-row: 2; display: flex; flex-direction: column; align-items: center;\n width: min(100%, 392px); text-align: center;\n}\n.cg-welcome-heading { display: grid; justify-items: center; gap: 22px; }\n.cg-welcome-heading h1 { margin: 0; font-size: clamp(26px, 4cqi, 34px); font-weight: 600; letter-spacing: -.035em; line-height: 1.18; text-wrap: balance; }\n.cg-welcome > .cg-account-status { margin: 12px 0 0; font-size: 15px; line-height: 1.6; text-wrap: balance; }\n.cg-welcome > .dsh-use-chatgpt-actions:not(:empty) {\n display: grid; width: min(100%, 310px); gap: 8px; margin-top: 26px;\n}\n.cg-welcome > .dsh-use-chatgpt-actions button { width: 100%; min-height: 46px; font-size: 15px; }\n.cg-welcome .dsh-use-chatgpt-actions .cg-primary { background: var(--cg-ink); color: var(--cg-surface); font-weight: 550; }\n.cg-welcome .dsh-use-chatgpt-actions .cg-primary:hover:enabled { background: color-mix(in srgb, var(--cg-ink) 85%, var(--cg-surface)); }\n.cg-login-footer { grid-row: 3; align-self: end; display: grid; justify-items: center; color: var(--cg-muted); text-align: center; }\n.cg-version {\n display: inline-flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 4px 7px; max-width: 100%;\n min-height: 32px; padding: 4px 0; border: 0; border-radius: 8px;\n background: transparent; color: inherit; font: inherit; font-size: 12px; font-variant-numeric: tabular-nums;\n overflow-wrap: anywhere; cursor: default;\n}\n.cg-login-footer .cg-version { justify-content: center; padding: 6px 10px; }\n.dsh-use-chatgpt-update-badge {\n display: inline-flex; align-items: center; flex: none; vertical-align: middle;\n padding: 1px 6px; border-radius: 999px; white-space: nowrap;\n background-color: #171717;\n color: #fff;\n font-family: inherit; font-size: 11px; font-weight: 550; line-height: 16px;\n}\nbody[data-ds-dark-theme] .dsh-use-chatgpt-update-badge {\n background-color: #f5f5f5;\n color: #171717;\n}\n.cg-legacy-defaults { font-size: 14px; }\n.cg-legacy-defaults summary { cursor: pointer; }\n.cg-legacy-defaults p { margin: 8px 0; color: var(--cg-muted); }\n.cg-recommendations { container-type: inline-size; }\n.cg-recommendations h2 { margin: 0 0 12px; font-size: 16px; line-height: 1.4; font-weight: 600; }\n.cg-plugin-list { margin: 0; padding: 0 16px; list-style: none; border: 1px solid var(--cg-line); border-radius: 14px; }\n.cg-plugin-row {\n display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 16px; padding-block: 13px;\n}\n.cg-plugin-row + .cg-plugin-row { border-block-start: 1px solid var(--cg-line); }\n.cg-plugin-row strong { font-weight: 550; }\n.cg-plugin-row p { margin: 2px 0 0; color: var(--cg-muted); font-size: 13px; overflow-wrap: anywhere; }\n.cg-plugin-actions { display: flex; gap: 6px; flex-wrap: wrap; }\n.cg-plugin-action { justify-content: center; font-family: inherit; cursor: pointer; }\na.cg-plugin-action {\n background: var(--dsw-static-neutral-bluish-1000, #0f1115); color: #fff; border-color: rgb(255 255 255 / 18%);\n}\na.cg-plugin-action:hover { background: var(--dsw-static-neutral-bluish-850, #2c2c2e); }\n.cg-plugin-action[data-state='installedPlugin'] { color: var(--cg-muted); background: var(--cg-wash); border-color: transparent; opacity: 1; }\n.cg-plugin-row .dsh-use-chatgpt-error { grid-column: 1 / -1; }\n.cg-plugin-row .dsh-use-chatgpt-error a { color: inherit; text-decoration: underline; }\n@container (max-width: 370px) {\n .cg-plugin-row { grid-template-columns: minmax(0, 1fr); }\n .cg-plugin-list { padding-inline: 12px; }\n}\n@container chatgpt-page (max-width: 510px) {\n .dsh-use-chatgpt-content { width: calc(100% - 36px); padding-block: 22px 36px; }\n .cg-dashboard { margin-top: 28px; }\n .cg-dashboard { gap: 26px; }\n .cg-profile { column-gap: 9px; }\n .cg-profile-meta { gap: 1px 8px; }\n}\n@container chatgpt-page (max-width: 360px) {\n .cg-profile:has(.cg-account-action) { grid-template-columns: auto minmax(0, 1fr); row-gap: 6px; }\n .cg-profile:has(.cg-account-action) .cg-profile-actions { grid-column: 2; justify-self: start; }\n}\n";
580
732
 
581
733
  // client/index.jsx
582
- var import_jsx_runtime5 = require("react/jsx-runtime");
734
+ var import_jsx_runtime6 = require("react/jsx-runtime");
583
735
  var pluginId = "dsh-use-chatgpt";
584
736
  var apiBase = "/api/dsh-use-chatgpt";
585
737
  var connectionStatuses = ["disconnected", "connecting", "connected", "reauth_required"];
@@ -604,7 +756,7 @@ var dictionaries = {
604
756
  subtitle: "\u5728 DeepSeek Harness \u4E2D\u4F7F\u7528\u4F60\u7684 ChatGPT \u5957\u9910\u989D\u5EA6\u3002",
605
757
  browserTitle: "\u5728\u6D4F\u89C8\u5668\u4E2D\u7EE7\u7EED",
606
758
  chooseSignedIn: "\u9009\u62E9\u5DF2\u767B\u5F55\u8D26\u53F7",
607
- authorizeHint: "\u8BF7\u5728 1 \u5206\u949F\u5185\u5B8C\u6210\u6D4F\u89C8\u5668\u4E2D\u7684\u6388\u6743\u3002\u5B8C\u6210\u540E\u5C06\u5207\u6362\u5230\u8BE5\u8D26\u53F7\u3002",
759
+ authorizeHint: "\u8BF7\u5728 3 \u5206\u949F\u5185\u5B8C\u6210\u6D4F\u89C8\u5668\u4E2D\u7684\u6388\u6743\u3002\u5B8C\u6210\u540E\u5C06\u5207\u6362\u5230\u8BE5\u8D26\u53F7\u3002",
608
760
  authorizationFailed: "\u6388\u6743\u672A\u5B8C\u6210",
609
761
  close: "\u5173\u95ED",
610
762
  reconnectAccount: "\u91CD\u65B0\u8FDE\u63A5",
@@ -632,11 +784,26 @@ var dictionaries = {
632
784
  modelsEmpty: "\u6B64\u8D26\u53F7\u6682\u65F6\u6CA1\u6709\u53EF\u7528\u7684 ChatGPT \u5957\u9910\u6A21\u578B\u3002",
633
785
  modelsFailed: "\u65E0\u6CD5\u8BFB\u53D6\u6A21\u578B\u5217\u8868\u3002",
634
786
  refreshModels: "\u5237\u65B0\u6A21\u578B\u5217\u8868",
635
- updateDetails: "\u67E5\u770B\u5347\u7EA7\u8BE6\u60C5",
636
- updateBadge: "\u6709\u65B0\u7248\u672C",
637
- pluginDetails: "\u63D2\u4EF6\u8BE6\u60C5",
638
- updateAvailable: "\u53EF\u66F4\u65B0\u81F3 {version}",
639
- pluginDetailsFallback: "\u5728\u300C\u8BBE\u7F6E \u2192 \u63D2\u4EF6\u300D\u4E2D\u641C\u7D22 dsh-use-chatgpt \u67E5\u770B\u8BE6\u60C5\u3002"
787
+ updateTitle: "\u6709\u65B0\u7248\u672C",
788
+ updateDetails: "\u67E5\u770B\u66F4\u65B0",
789
+ updateBadge: "\u66F4\u65B0",
790
+ otherPlugins: "\u4F5C\u8005\u7684\u5176\u4ED6\u63D2\u4EF6",
791
+ freeModelsDescription: "\u5728 DSH \u4E2D\u4F7F\u7528 Kilo \u514D\u8D39\u6A21\u578B\uFF0C\u68C0\u6D4B\u53EF\u7528\u6027\u5E76\u9009\u62E9\u5728\u5BF9\u8BDD\u4E2D\u663E\u793A\u7684\u6A21\u578B\u3002",
792
+ timelineDescription: "\u4E3A DSH \u5BF9\u8BDD\u6DFB\u52A0\u63D0\u95EE\u65F6\u95F4\u8F74\u3001\u6536\u85CF\u5939\u3001\u63D0\u793A\u8BCD\u5E93\u548C\u591A\u683C\u5F0F\u5BFC\u51FA\u3002",
793
+ browserDescription: "\u4E3A ChatGPT\u3001Gemini\u3001DeepSeek \u7B49\u7F51\u9875\u6DFB\u52A0\u5BF9\u8BDD\u65F6\u95F4\u8F74\u3001\u6536\u85CF\u5939\u548C\u63D0\u793A\u8BCD\u5E93\u3002",
794
+ installPlugin: "\u5B89\u88C5",
795
+ installedPlugin: "\u5DF2\u5B89\u88C5",
796
+ installingPlugin: "\u5B89\u88C5\u4E2D\u2026",
797
+ checkingPlugins: "\u68C0\u6D4B\u4E2D\u2026",
798
+ retryPlugins: "\u91CD\u65B0\u68C0\u6D4B",
799
+ installUnavailable: "\u5B89\u88C5\u4E0D\u53EF\u7528",
800
+ pluginAction: "{name} \xB7 {action}",
801
+ chromeStore: "Chrome \u7248",
802
+ edgeStore: "Edge \u7248",
803
+ inventoryError: "\u65E0\u6CD5\u8BFB\u53D6\u5DF2\u5B89\u88C5\u63D2\u4EF6\uFF0C\u8BF7\u91CD\u65B0\u68C0\u6D4B\u3002",
804
+ installError: "\u5B89\u88C5\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\u3002",
805
+ packageNotFound: "npm \u5B98\u65B9\u6E90\u6682\u672A\u627E\u5230 {name}\u3002",
806
+ installGuide: "\u67E5\u770B\u5B89\u88C5\u8BF4\u660E"
640
807
  },
641
808
  en: {
642
809
  webSearch: "Web search",
@@ -657,7 +824,7 @@ var dictionaries = {
657
824
  subtitle: "Use your ChatGPT plan allowance in DeepSeek Harness.",
658
825
  browserTitle: "Continue in your browser",
659
826
  chooseSignedIn: "Choose a signed-in account",
660
- authorizeHint: "Complete authorization in your browser within 1 minute to switch to this account.",
827
+ authorizeHint: "Complete authorization in your browser within 3 minutes to switch to this account.",
661
828
  authorizationFailed: "Authorization incomplete",
662
829
  close: "Close",
663
830
  reconnectAccount: "Reconnect",
@@ -685,11 +852,26 @@ var dictionaries = {
685
852
  modelsEmpty: "This account currently has no available ChatGPT plan models.",
686
853
  modelsFailed: "Could not load the model list.",
687
854
  refreshModels: "Reload models",
688
- updateDetails: "View upgrade details",
689
- updateBadge: "Update available",
690
- pluginDetails: "Plugin details",
691
- updateAvailable: "Update to {version} available",
692
- pluginDetailsFallback: "Search for dsh-use-chatgpt under Settings \u2192 Plugins to view details."
855
+ updateTitle: "Update available",
856
+ updateDetails: "View update",
857
+ updateBadge: "Update",
858
+ otherPlugins: "More plugins by this author",
859
+ freeModelsDescription: "Use free Kilo models in DSH, check availability, and choose which models appear in chat.",
860
+ timelineDescription: "Add a question timeline, bookmark folders, a prompt library, and chat exports to DSH.",
861
+ browserDescription: "Add a chat timeline, bookmarks, and a prompt library to ChatGPT, Gemini, DeepSeek, and other AI chat sites.",
862
+ installPlugin: "Install",
863
+ installedPlugin: "Installed",
864
+ installingPlugin: "Installing\u2026",
865
+ checkingPlugins: "Checking\u2026",
866
+ retryPlugins: "Check again",
867
+ installUnavailable: "Install unavailable",
868
+ pluginAction: "{name} \xB7 {action}",
869
+ chromeStore: "Chrome",
870
+ edgeStore: "Edge",
871
+ inventoryError: "Could not load installed plugins. Check again.",
872
+ installError: "Installation failed. Try again.",
873
+ packageNotFound: "The npm registry could not find {name}.",
874
+ installGuide: "View installation guide"
693
875
  }
694
876
  };
695
877
  function validFeatures(features) {
@@ -725,14 +907,14 @@ function isAccountDialogAction(action) {
725
907
  return action === "add-account" || action === "cancel-add";
726
908
  }
727
909
  function useConnection() {
728
- const [connection, setConnection] = (0, import_react4.useState)(null);
729
- const [pending, setPending] = (0, import_react4.useState)(null);
730
- const [error, setError] = (0, import_react4.useState)(null);
731
- const lifetime = (0, import_react4.useRef)(null);
732
- const pendingAction = (0, import_react4.useRef)(null);
733
- const refreshSignal = (0, import_react4.useRef)(null);
734
- const revision = (0, import_react4.useRef)(0);
735
- const refresh = (0, import_react4.useCallback)(async (clearError = true) => {
910
+ const [connection, setConnection] = (0, import_react5.useState)(null);
911
+ const [pending, setPending] = (0, import_react5.useState)(null);
912
+ const [error, setError] = (0, import_react5.useState)(null);
913
+ const lifetime = (0, import_react5.useRef)(null);
914
+ const pendingAction = (0, import_react5.useRef)(null);
915
+ const refreshSignal = (0, import_react5.useRef)(null);
916
+ const revision = (0, import_react5.useRef)(0);
917
+ const refresh = (0, import_react5.useCallback)(async (clearError = true) => {
736
918
  const signal = lifetime.current?.signal;
737
919
  if (!signal || refreshSignal.current === signal || pendingAction.current) return;
738
920
  const update = revision.current;
@@ -750,7 +932,7 @@ function useConnection() {
750
932
  if (refreshSignal.current === signal) refreshSignal.current = null;
751
933
  }
752
934
  }, []);
753
- (0, import_react4.useEffect)(() => {
935
+ (0, import_react5.useEffect)(() => {
754
936
  const controller = new AbortController();
755
937
  lifetime.current = controller;
756
938
  const onFocus = () => {
@@ -766,7 +948,7 @@ function useConnection() {
766
948
  };
767
949
  }, [refresh]);
768
950
  const polling = connection?.status === "connecting" || connection?.addingAccount;
769
- (0, import_react4.useEffect)(() => {
951
+ (0, import_react5.useEffect)(() => {
770
952
  if (!polling) return;
771
953
  const timer = window.setInterval(() => {
772
954
  void refresh(false);
@@ -810,7 +992,7 @@ function profileName(profile) {
810
992
  return profile.identity?.email || profile.identity?.name || profile.label;
811
993
  }
812
994
  function LoginScreen({ t, state }) {
813
- const titleId = (0, import_react4.useId)();
995
+ const titleId = (0, import_react5.useId)();
814
996
  const { connection, pending, error, refresh, run } = state;
815
997
  const waiting = connection?.status === "connecting" || pending === "sign-in" || pending === "cancel";
816
998
  const profiles = connection?.profiles ?? [];
@@ -825,18 +1007,18 @@ function LoginScreen({ t, state }) {
825
1007
  const target = existing || profiles.find((profile) => profile.pending);
826
1008
  void run("sign-in", target ? { profileId: target.id } : { newProfile: true });
827
1009
  }
828
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("section", { className: "cg-account cg-welcome", "aria-labelledby": titleId, children: [
829
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("header", { className: "cg-welcome-heading", children: [
830
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ChatGPTMark, { size: 48 }),
831
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("h1", { id: titleId, children: t(waiting ? "browserTitle" : choosing ? "chooseSignedIn" : "startHere") })
1010
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("section", { className: "cg-account cg-welcome", "aria-labelledby": titleId, children: [
1011
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("header", { className: "cg-welcome-heading", children: [
1012
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ChatGPTMark, { size: 48 }),
1013
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h1", { id: titleId, children: t(waiting ? "browserTitle" : choosing ? "chooseSignedIn" : "startHere") })
832
1014
  ] }),
833
- hint && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "cg-account-status", role: "status", children: hint }),
834
- message && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "dsh-use-chatgpt-error", role: "alert", children: message }),
835
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dsh-use-chatgpt-actions", children: [
836
- !connection && error && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_dsh_client_ui_primitives3.Button, { variant: "outline", size: "sm", onClick: () => {
1015
+ hint && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "cg-account-status", role: "status", children: hint }),
1016
+ message && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "dsh-use-chatgpt-error", role: "alert", children: message }),
1017
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "dsh-use-chatgpt-actions", children: [
1018
+ !connection && error && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_dsh_client_ui_primitives3.Button, { variant: "outline", size: "sm", onClick: () => {
837
1019
  void refresh();
838
1020
  }, children: t("retry") }),
839
- waiting && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1021
+ waiting && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
840
1022
  import_dsh_client_ui_primitives3.Button,
841
1023
  {
842
1024
  variant: "outline",
@@ -848,7 +1030,7 @@ function LoginScreen({ t, state }) {
848
1030
  children: t("cancel")
849
1031
  }
850
1032
  ),
851
- choosing && signedIn.map((profile) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1033
+ choosing && signedIn.map((profile) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
852
1034
  import_dsh_client_ui_primitives3.Button,
853
1035
  {
854
1036
  variant: "outline",
@@ -861,7 +1043,7 @@ function LoginScreen({ t, state }) {
861
1043
  },
862
1044
  profile.id
863
1045
  )),
864
- connection?.available && !waiting && !choosing && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1046
+ connection?.available && !waiting && !choosing && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
865
1047
  import_dsh_client_ui_primitives3.Button,
866
1048
  {
867
1049
  className: "cg-primary",
@@ -876,7 +1058,7 @@ function LoginScreen({ t, state }) {
876
1058
  ] });
877
1059
  }
878
1060
  function AccountRow({ profile, current, busy, t, run }) {
879
- const [menuOpen, setMenuOpen] = (0, import_react4.useState)(false);
1061
+ const [menuOpen, setMenuOpen] = (0, import_react5.useState)(false);
880
1062
  const { id, identity, sharing } = profile;
881
1063
  const connected = !profile.pending && profile.status === "connected";
882
1064
  const email = identity?.email;
@@ -888,20 +1070,20 @@ function AccountRow({ profile, current, busy, t, run }) {
888
1070
  else if (profile.status === "reauth_required") status = "expiredAccount";
889
1071
  else if (!connected) status = "signedOut";
890
1072
  else if (!sharing) status = "noConsent";
891
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("li", { className: "cg-profile", children: [
892
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "cg-profile-avatar", "aria-hidden": "true", children: initials || /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(PanelIcon, { name: "account", size: 19 }) }),
893
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "cg-profile-text", children: [
894
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "cg-profile-name", children: [
895
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("strong", { children: display }),
896
- current && connected && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "cg-current-account", children: t("activeAccount") })
1073
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("li", { className: "cg-profile", children: [
1074
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "cg-profile-avatar", "aria-hidden": "true", children: initials || /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PanelIcon, { name: "account", size: 19 }) }),
1075
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "cg-profile-text", children: [
1076
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "cg-profile-name", children: [
1077
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("strong", { children: display }),
1078
+ current && connected && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "cg-current-account", children: t("activeAccount") })
897
1079
  ] }),
898
- (secondaryEmail || status) && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "cg-profile-meta", children: [
899
- secondaryEmail && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: secondaryEmail }),
900
- status && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: t(status) })
1080
+ (secondaryEmail || status) && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "cg-profile-meta", children: [
1081
+ secondaryEmail && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: secondaryEmail }),
1082
+ status && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: t(status) })
901
1083
  ] })
902
1084
  ] }),
903
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "cg-profile-actions", children: connected ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
904
- !current && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1085
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "cg-profile-actions", children: connected ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
1086
+ !current && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
905
1087
  "button",
906
1088
  {
907
1089
  type: "button",
@@ -914,7 +1096,7 @@ function AccountRow({ profile, current, busy, t, run }) {
914
1096
  children: t("switchAccount")
915
1097
  }
916
1098
  ),
917
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1099
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
918
1100
  import_dsh_client_ui_primitives3.Menu,
919
1101
  {
920
1102
  open: menuOpen && !busy,
@@ -922,7 +1104,7 @@ function AccountRow({ profile, current, busy, t, run }) {
922
1104
  portal: true,
923
1105
  autoFocus: true,
924
1106
  dense: true,
925
- anchor: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1107
+ anchor: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
926
1108
  "button",
927
1109
  {
928
1110
  type: "button",
@@ -932,12 +1114,12 @@ function AccountRow({ profile, current, busy, t, run }) {
932
1114
  "aria-haspopup": "menu",
933
1115
  "aria-expanded": menuOpen && !busy,
934
1116
  onClick: () => setMenuOpen((open) => !open),
935
- children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(PanelIcon, { name: "more" })
1117
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PanelIcon, { name: "more" })
936
1118
  }
937
1119
  ),
938
1120
  items: [
939
1121
  { type: "label", id: "account", text: email || display },
940
- { id: "sign-out", label: t("signOut"), icon: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(PanelIcon, { name: "signOut", size: 16 }) }
1122
+ { id: "sign-out", label: t("signOut"), icon: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PanelIcon, { name: "signOut", size: 16 }) }
941
1123
  ],
942
1124
  onClose: () => setMenuOpen(false),
943
1125
  onSelect: () => {
@@ -946,7 +1128,7 @@ function AccountRow({ profile, current, busy, t, run }) {
946
1128
  }
947
1129
  }
948
1130
  )
949
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1131
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
950
1132
  "button",
951
1133
  {
952
1134
  type: "button",
@@ -962,7 +1144,7 @@ function AccountRow({ profile, current, busy, t, run }) {
962
1144
  ] });
963
1145
  }
964
1146
  function Account({ t, state }) {
965
- const titleId = (0, import_react4.useId)();
1147
+ const titleId = (0, import_react5.useId)();
966
1148
  const { connection, pending, error, run } = state;
967
1149
  const { profileId, profiles = [] } = connection;
968
1150
  const rows = profiles.filter((profile) => profile.status === "connected" || !profile.requiresNewRegistration);
@@ -979,9 +1161,9 @@ function Account({ t, state }) {
979
1161
  const busy = waiting || Boolean(pending) && !isAccountDialogAction(pending);
980
1162
  const needsConsent = connection.status === "connected" && !connection.sharing;
981
1163
  const message = error ? !isAccountDialogAction(error.action) && (error.message || t("requestFailed")) : !waiting && connection.error?.message;
982
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("section", { className: "cg-account", "aria-labelledby": titleId, children: [
983
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("header", { className: "cg-account-heading", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("h2", { id: titleId, children: t("account") }) }),
984
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("ul", { className: "cg-profile-list", children: rows.map((profile) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1164
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("section", { className: "cg-account", "aria-labelledby": titleId, children: [
1165
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("header", { className: "cg-account-heading", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h2", { id: titleId, children: t("account") }) }),
1166
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("ul", { className: "cg-profile-list", children: rows.map((profile) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
985
1167
  AccountRow,
986
1168
  {
987
1169
  profile,
@@ -992,10 +1174,10 @@ function Account({ t, state }) {
992
1174
  },
993
1175
  profile.id
994
1176
  )) }),
995
- message && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "dsh-use-chatgpt-error", role: "alert", children: message }),
996
- waiting ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "cg-account-flow", children: [
997
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { role: "status", children: t("connecting") }),
998
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "dsh-use-chatgpt-actions", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1177
+ message && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "dsh-use-chatgpt-error", role: "alert", children: message }),
1178
+ waiting ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "cg-account-flow", children: [
1179
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { role: "status", children: t("connecting") }),
1180
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "dsh-use-chatgpt-actions", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
999
1181
  import_dsh_client_ui_primitives3.Button,
1000
1182
  {
1001
1183
  variant: "outline",
@@ -1007,13 +1189,13 @@ function Account({ t, state }) {
1007
1189
  children: t("cancel")
1008
1190
  }
1009
1191
  ) })
1010
- ] }) : needsConsent && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "cg-account-flow", children: [
1011
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { children: t("needsConsent") }),
1012
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "dsh-use-chatgpt-actions", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_dsh_client_ui_primitives3.Button, { variant: "primary", size: "sm", disabled: busy, onClick: () => {
1192
+ ] }) : needsConsent && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "cg-account-flow", children: [
1193
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: t("needsConsent") }),
1194
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "dsh-use-chatgpt-actions", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_dsh_client_ui_primitives3.Button, { variant: "primary", size: "sm", disabled: busy, onClick: () => {
1013
1195
  void run("enable", { profileId });
1014
1196
  }, children: t("enable") }) })
1015
1197
  ] }),
1016
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1198
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1017
1199
  "button",
1018
1200
  {
1019
1201
  type: "button",
@@ -1024,7 +1206,7 @@ function Account({ t, state }) {
1024
1206
  void run("add-account", { newProfile: true });
1025
1207
  },
1026
1208
  children: [
1027
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(PanelIcon, { name: "plus", size: 17 }),
1209
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PanelIcon, { name: "plus", size: 17 }),
1028
1210
  t("newAccount")
1029
1211
  ]
1030
1212
  }
@@ -1032,14 +1214,14 @@ function Account({ t, state }) {
1032
1214
  ] });
1033
1215
  }
1034
1216
  function usePageResource(read) {
1035
- const [data, setData] = (0, import_react4.useState)(null);
1036
- const [error, setError] = (0, import_react4.useState)(null);
1037
- const [revision, setRevision] = (0, import_react4.useState)(0);
1038
- const [refreshing, setRefreshing] = (0, import_react4.useState)(false);
1039
- const refresh = (0, import_react4.useCallback)(() => {
1217
+ const [data, setData] = (0, import_react5.useState)(null);
1218
+ const [error, setError] = (0, import_react5.useState)(null);
1219
+ const [revision, setRevision] = (0, import_react5.useState)(0);
1220
+ const [refreshing, setRefreshing] = (0, import_react5.useState)(false);
1221
+ const refresh = (0, import_react5.useCallback)(() => {
1040
1222
  setRevision((value) => value + 1);
1041
1223
  }, []);
1042
- (0, import_react4.useEffect)(() => {
1224
+ (0, import_react5.useEffect)(() => {
1043
1225
  if (!read) {
1044
1226
  setData(null);
1045
1227
  setError(null);
@@ -1120,55 +1302,64 @@ async function readModels(profileId, signal, force) {
1120
1302
  if (!Array.isArray(data?.models)) throw new Error();
1121
1303
  return data.models.filter((model) => typeof model?.id === "string" && typeof model.name === "string");
1122
1304
  }
1123
- function PluginVersion({ ctx, t, data, loginFooter = false }) {
1124
- const [fallback, setFallback] = (0, import_react4.useState)(false);
1125
- const hasUpdate = data?.status === "update_available";
1126
- const version = "v" + (data?.currentVersion ?? package_default.version);
1127
- const Wrapper = loginFooter ? "footer" : "div";
1128
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Wrapper, { className: loginFooter ? "cg-login-footer" : "cg-header-version", children: [
1129
- hasUpdate ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1130
- "button",
1305
+ function UpdateBanner({ ctx, t, data }) {
1306
+ if (data?.status !== "update_available") return null;
1307
+ function openDetails(event) {
1308
+ if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;
1309
+ if (openPluginDetails(ctx)) event.preventDefault();
1310
+ }
1311
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "cg-update-banner", children: [
1312
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("p", { className: "cg-update-copy", children: [
1313
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("strong", { children: t("updateTitle") }),
1314
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { children: [
1315
+ "v",
1316
+ data.latestVersion
1317
+ ] })
1318
+ ] }),
1319
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1320
+ "a",
1131
1321
  {
1132
- type: "button",
1133
- className: "cg-version",
1134
- onClick: () => setFallback(!openPluginDetails(ctx)),
1135
- title: t("updateAvailable", { version: data.latestVersion }),
1136
- "aria-label": `${version} \xB7 ${t("updateBadge")} \xB7 ${t("updateDetails")}`,
1137
- children: [
1138
- loginFooter && t("pluginDetails"),
1139
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: version }),
1140
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "dsh-use-chatgpt-update-badge", children: t("updateBadge") })
1141
- ]
1322
+ className: "cg-update-action",
1323
+ href: `https://www.npmjs.com/package/${package_default.name}`,
1324
+ target: "_blank",
1325
+ rel: "noopener noreferrer",
1326
+ onClick: openDetails,
1327
+ children: t("updateDetails")
1142
1328
  }
1143
- ) : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "cg-version", children: [
1144
- loginFooter && t("version"),
1145
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: version })
1146
- ] }),
1147
- hasUpdate && fallback && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("small", { role: "status", children: t("pluginDetailsFallback") })
1329
+ )
1148
1330
  ] });
1149
1331
  }
1150
- function WorkspaceBody({ t, language, state }) {
1332
+ function PluginVersion({ t, data, loginFooter = false }) {
1333
+ const version = "v" + (data?.currentVersion ?? package_default.version);
1334
+ const Wrapper = loginFooter ? "footer" : "div";
1335
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Wrapper, { className: loginFooter ? "cg-login-footer" : "cg-header-version", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "cg-version", children: [
1336
+ loginFooter && t("version"),
1337
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: version })
1338
+ ] }) });
1339
+ }
1340
+ function WorkspaceBody({ t, language, state, installer }) {
1151
1341
  const { connection, pending, run } = state;
1152
1342
  const authorized = connection.status === "connected" && connection.sharing;
1153
1343
  const profileId = connection?.profileId;
1154
- const loadModels = (0, import_react4.useCallback)((signal, force) => readModels(profileId, signal, force), [profileId]);
1344
+ const loadModels = (0, import_react5.useCallback)((signal, force) => readModels(profileId, signal, force), [profileId]);
1155
1345
  const models = usePageResource(authorized && profileId ? loadModels : null);
1156
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "cg-dashboard", children: [
1157
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Account, { t, state }),
1158
- authorized && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
1159
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ModelCatalog, { t, language, resource: models, profileId }),
1160
- connection.features?.webSearch && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("details", { className: "cg-legacy-defaults", children: [
1161
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("summary", { children: t("legacyDefaults") }),
1162
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { children: t("legacyHint") }),
1163
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_dsh_client_ui_primitives3.Button, { variant: "outline", size: "sm", disabled: Boolean(pending), onClick: () => {
1346
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "cg-dashboard", children: [
1347
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Account, { t, state }),
1348
+ authorized && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
1349
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ModelCatalog, { t, language, resource: models, profileId }),
1350
+ connection.features?.webSearch && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("details", { className: "cg-legacy-defaults", children: [
1351
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("summary", { children: t("legacyDefaults") }),
1352
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: t("legacyHint") }),
1353
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_dsh_client_ui_primitives3.Button, { variant: "outline", size: "sm", disabled: Boolean(pending), onClick: () => {
1164
1354
  void run("features", { ...connection.features, webSearch: false });
1165
1355
  }, children: t("resetDefaults") })
1166
1356
  ] })
1167
- ] })
1357
+ ] }),
1358
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PluginRecommendations, { installer, t })
1168
1359
  ] });
1169
1360
  }
1170
- function ChatGPTPage({ ctx, t, updates }) {
1171
- const titleId = (0, import_react4.useId)();
1361
+ function ChatGPTPage({ ctx, t, updates, installer }) {
1362
+ const titleId = (0, import_react5.useId)();
1172
1363
  const state = useConnection();
1173
1364
  const { connection, pending, error, run, dismissError } = state;
1174
1365
  const authorizing = connection?.addingAccount || isAccountDialogAction(pending);
@@ -1181,16 +1372,17 @@ function ChatGPTPage({ ctx, t, updates }) {
1181
1372
  }
1182
1373
  const connectedProfile = connection?.profiles?.some((profile) => profile.id === connection.profileId && profile.status === "connected" && !profile.pending);
1183
1374
  const signedIn = connection?.available && (connection.status === "connected" || connection.status === "connecting" && connectedProfile);
1184
- const version = (0, import_react4.useSyncExternalStore)(updates.subscribe, updates.getSnapshot);
1375
+ const version = (0, import_react5.useSyncExternalStore)(updates.subscribe, updates.getSnapshot);
1185
1376
  const language = (ctx.locale.getSnapshot?.().active || document.documentElement.lang || "zh").startsWith("en") ? "en" : "zh";
1186
- (0, import_react4.useEffect)(updates.refresh, [updates]);
1187
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("section", { className: "dsh-use-chatgpt-page", "aria-label": signedIn ? void 0 : t("title"), "aria-labelledby": signedIn ? titleId : void 0, children: [
1188
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: signedIn ? "dsh-use-chatgpt-content" : "cg-login-layout", inert: dialogOpen ? "" : void 0, children: [
1189
- signedIn && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("header", { className: "dsh-use-chatgpt-header", children: [
1190
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("h1", { id: titleId, children: t("title") }),
1191
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "cg-header-links", children: [
1192
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(PluginVersion, { ctx, t, data: version }),
1193
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_dsh_client_ui_primitives3.Tooltip, { label: t("viewProject"), children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1377
+ (0, import_react5.useEffect)(updates.refresh, [updates]);
1378
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("section", { className: "dsh-use-chatgpt-page", "aria-label": signedIn ? void 0 : t("title"), "aria-labelledby": signedIn ? titleId : void 0, children: [
1379
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: signedIn ? "dsh-use-chatgpt-content" : "cg-login-layout", inert: dialogOpen ? "" : void 0, children: [
1380
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(UpdateBanner, { ctx, t, data: version }),
1381
+ signedIn && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("header", { className: "dsh-use-chatgpt-header", children: [
1382
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h1", { id: titleId, children: t("title") }),
1383
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "cg-header-links", children: [
1384
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PluginVersion, { t, data: version }),
1385
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_dsh_client_ui_primitives3.Tooltip, { label: t("viewProject"), children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1194
1386
  "a",
1195
1387
  {
1196
1388
  className: "cg-project-link",
@@ -1198,16 +1390,16 @@ function ChatGPTPage({ ctx, t, updates }) {
1198
1390
  target: "_blank",
1199
1391
  rel: "noopener noreferrer",
1200
1392
  "aria-label": t("viewProject"),
1201
- children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("svg", { width: "18", height: "18", viewBox: "0 0 16 16", fill: "currentColor", "aria-hidden": "true", focusable: "false", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8z" }) })
1393
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("svg", { width: "18", height: "18", viewBox: "0 0 16 16", fill: "currentColor", "aria-hidden": "true", focusable: "false", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8z" }) })
1202
1394
  }
1203
1395
  ) })
1204
1396
  ] }),
1205
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { children: t("subtitle") })
1397
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: t("subtitle") })
1206
1398
  ] }),
1207
- signedIn ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(WorkspaceBody, { t, language, state }, connection.profileId) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(LoginScreen, { t, state }),
1208
- !signedIn && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(PluginVersion, { ctx, t, data: version, loginFooter: true })
1399
+ signedIn ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(WorkspaceBody, { t, language, state, installer }, connection.profileId) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(LoginScreen, { t, state }),
1400
+ !signedIn && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PluginVersion, { t, data: version, loginFooter: true })
1209
1401
  ] }),
1210
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1402
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1211
1403
  import_dsh_client_ui_primitives3.Modal,
1212
1404
  {
1213
1405
  open: dialogOpen,
@@ -1215,22 +1407,24 @@ function ChatGPTPage({ ctx, t, updates }) {
1215
1407
  description: dialogError ? dialogError.message || t("requestFailed") : t("authorizeHint"),
1216
1408
  closeLabel: t(authorizing ? "cancel" : "close"),
1217
1409
  onClose: closeDialog,
1218
- footer: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_dsh_client_ui_primitives3.Button, { variant: "outline", autoFocus: true, disabled: pending === "cancel-add", onClick: closeDialog, children: t(authorizing ? "cancel" : "close") })
1410
+ footer: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_dsh_client_ui_primitives3.Button, { variant: "outline", autoFocus: true, disabled: pending === "cancel-add", onClick: closeDialog, children: t(authorizing ? "cancel" : "close") })
1219
1411
  }
1220
1412
  )
1221
1413
  ] });
1222
1414
  }
1223
1415
  function SidebarIcon({ size = 16 }) {
1224
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ChatGPTMark, { size });
1416
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ChatGPTMark, { size });
1225
1417
  }
1226
1418
  function SidebarUpdateBadge({ updates, wide, t }) {
1227
- const version = (0, import_react4.useSyncExternalStore)(updates.subscribe, updates.getSnapshot);
1419
+ const version = (0, import_react5.useSyncExternalStore)(updates.subscribe, updates.getSnapshot);
1228
1420
  if (version?.status !== "update_available") return null;
1229
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: wide ? "dsh-use-chatgpt-update-badge" : "dsh-use-chatgpt-update-sr", children: t("updateBadge") });
1421
+ if (wide) return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "dsh-use-chatgpt-update-badge", children: t("updateBadge") });
1422
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "dsh-use-chatgpt-update-dot", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "dsh-use-chatgpt-update-sr", children: t("updateBadge") }) });
1230
1423
  }
1231
1424
  var inject = ["locale", "slots"];
1232
1425
  function apply(ctx) {
1233
1426
  const updates = monitorUpdates(ctx);
1427
+ const installer = createPluginInstaller(ctx);
1234
1428
  const t = ctx.locale.bind(pluginId);
1235
1429
  registerNativeChatOptions(ctx, useConnection);
1236
1430
  ctx.effect(() => ctx.locale.register(pluginId, dictionaries), `${pluginId} translations`);
@@ -1254,14 +1448,14 @@ function apply(ctx) {
1254
1448
  id: pluginId,
1255
1449
  locale: pluginId
1256
1450
  }, function Trailing(props) {
1257
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SidebarUpdateBadge, { ...props, updates });
1451
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SidebarUpdateBadge, { ...props, updates });
1258
1452
  }));
1259
1453
  ctx.slots.inject("main", () => ctx.slots.register({
1260
1454
  name: "main",
1261
1455
  key: pluginId,
1262
1456
  locale: pluginId
1263
1457
  }, function Panel(props) {
1264
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ChatGPTPage, { ...props, ctx, updates });
1458
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ChatGPTPage, { ...props, ctx, updates, installer });
1265
1459
  }));
1266
1460
  }
1267
1461
  return module.exports; } });
package/dist/index.js CHANGED
@@ -24738,7 +24738,7 @@ function createChatGPT(config) {
24738
24738
  const sourceProfileId = displayed.profileId;
24739
24739
  const attempt = { controller: new AbortController(), addingAccount };
24740
24740
  login = attempt;
24741
- const timeout = AbortSignal.timeout(6e4);
24741
+ const timeout = AbortSignal.timeout(3 * 6e4);
24742
24742
  const signals = [attempt.controller.signal, timeout];
24743
24743
  if (options.signal) signals.push(options.signal);
24744
24744
  const signal = AbortSignal.any(signals);
@@ -26193,7 +26193,7 @@ function createPreferences(storageDir) {
26193
26193
  // package.json
26194
26194
  var package_default = {
26195
26195
  name: "dsh-use-chatgpt",
26196
- version: "1.0.1",
26196
+ version: "1.0.3",
26197
26197
  description: "ChatGPT plan model provider for a local DeepSeek Harness desktop instance",
26198
26198
  type: "module",
26199
26199
  engines: { node: "^22.19.0 || >=24.0.0" },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-use-chatgpt",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "ChatGPT plan model provider for a local DeepSeek Harness desktop instance",
5
5
  "type": "module",
6
6
  "engines": { "node": "^22.19.0 || >=24.0.0" },