dsh-use-chatgpt 1.0.1 → 1.0.2

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.2",
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,201 @@ 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-free-model",
345
+ packageName: "@houyanchao/dsh-free-model",
346
+ description: "freeModelsDescription",
347
+ guide: "https://github.com/houyanchao/dsh-free-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 (current === revision) {
449
+ update({ inventory: "ready", installed, error: installed.has(state.error?.name) ? null : state.error });
450
+ }
451
+ } catch {
452
+ if (current === revision) update({ inventory: "failed" });
453
+ }
454
+ }
455
+ ctx.inject(["remote", "remote.pluginManager"], (scope) => {
456
+ scope.effect(() => {
457
+ connection = { manager: scope.remote.pluginManager };
458
+ const recheck = () => {
459
+ if (listeners.size) void refresh();
460
+ };
461
+ const unsubscribe = scope.remote.$on("plugin-manager/changed", recheck);
462
+ const reset = scope.on("connection/reset", recheck);
463
+ globalThis.window?.addEventListener("focus", recheck);
464
+ update({ ...initial, inventory: "loading" });
465
+ recheck();
466
+ return () => {
467
+ connection = void 0;
468
+ revision++;
469
+ update(initial);
470
+ unsubscribe();
471
+ reset();
472
+ globalThis.window?.removeEventListener("focus", recheck);
473
+ };
474
+ }, "dsh-use-chatgpt: recommended plugin inventory");
475
+ });
476
+ async function install(name) {
477
+ if (!connection || state.inventory !== "ready" || state.pending || state.installed.has(name)) return;
478
+ const active = connection;
479
+ const { manager } = active;
480
+ update({ pending: name, error: null });
481
+ try {
482
+ const info = rpcValue(await manager.inspect(name, { registry: npmRegistry }));
483
+ if (active !== connection) return;
484
+ if (info.status !== "accepted") {
485
+ update({ error: { name, message: info.reason, problem: info.problem } });
486
+ return;
487
+ }
488
+ if (info.registry !== npmRegistry || info.name !== name || info.bundle !== true || typeof info.version !== "string" || !publishedVersion.test(info.version)) throw new Error();
489
+ const requestId = globalThis.crypto?.randomUUID?.();
490
+ const options = {
491
+ registry: npmRegistry,
492
+ enabled: true,
493
+ expected: { name, version: info.version },
494
+ ...requestId && { requestId }
495
+ };
496
+ let result;
497
+ try {
498
+ result = rpcValue(await manager.installBundle(`${name}@${info.version}`, options));
499
+ } catch (error) {
500
+ if (!requestId || active !== connection) throw error;
501
+ result = rpcValue(await manager.waitForInstall(requestId));
502
+ if (!result) throw error;
503
+ }
504
+ if (!["applied", "restart-required", "overridden"].includes(result.application)) {
505
+ throw new Error(result.error?.diagnostic || result.error?.code);
506
+ }
507
+ } catch (error) {
508
+ if (active === connection) update({ error: { name, message: error.message } });
509
+ } finally {
510
+ if (active === connection) {
511
+ await refresh();
512
+ if (active === connection) update({ pending: null });
513
+ }
514
+ }
515
+ }
516
+ return {
517
+ getSnapshot: () => state,
518
+ subscribe(listener) {
519
+ listeners.add(listener);
520
+ if (listeners.size === 1) void refresh();
521
+ return () => listeners.delete(listener);
522
+ },
523
+ install,
524
+ refresh
525
+ };
526
+ }
527
+
339
528
  // client/NativeChatOptions.jsx
340
- var import_react3 = require("react");
529
+ var import_react4 = require("react");
341
530
  var import_dsh_client_ui_primitives2 = require("@deepseek-ai/dsh-client-ui-primitives");
342
531
 
343
532
  // client/use-chat-options.js
344
- var import_react2 = require("react");
533
+ var import_react3 = require("react");
345
534
  async function readOrSave(profileId, id, signal, patch) {
346
535
  const params = new URLSearchParams({ profileId, sessionId: id });
347
536
  const response = await fetch("/api/dsh-use-chatgpt/chat-options?" + params, {
@@ -357,11 +546,11 @@ async function readOrSave(profileId, id, signal, patch) {
357
546
  return data.features;
358
547
  }
359
548
  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)(() => {
549
+ const [state, setState] = (0, import_react3.useState)({ id });
550
+ const [revision, setRevision] = (0, import_react3.useState)(0);
551
+ const generation = (0, import_react3.useRef)(null);
552
+ const writing = (0, import_react3.useRef)(false);
553
+ (0, import_react3.useEffect)(() => {
365
554
  const controller = new AbortController();
366
555
  const { signal } = controller;
367
556
  generation.current = controller;
@@ -396,20 +585,20 @@ function useChatOptions(profileId, id) {
396
585
  }
397
586
 
398
587
  // client/NativeChatOptions.jsx
399
- var import_jsx_runtime3 = require("react/jsx-runtime");
588
+ var import_jsx_runtime4 = require("react/jsx-runtime");
400
589
  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: [
590
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("button", { type: "button", className: "cg-search-retry", title: message, onClick: retry, children: [
402
591
  t("searchRetry"),
403
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "cg-search-sr", role: "alert", children: message })
592
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "cg-search-sr", role: "alert", children: message })
404
593
  ] });
405
594
  }
406
595
  function SessionSearch({ profileId, id, t }) {
407
596
  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)(
597
+ if (!features) return error ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SearchRetry, { t, message: error, retry }) : null;
598
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "cg-search-tool", "aria-busy": Boolean(saving), children: [
599
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { title: t("searchHelp"), className: "cg-search-label", children: [
600
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: t("webSearch") }),
601
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
413
602
  import_dsh_client_ui_primitives2.Switch,
414
603
  {
415
604
  checked: features.webSearch,
@@ -421,21 +610,21 @@ function SessionSearch({ profileId, id, t }) {
421
610
  }
422
611
  )
423
612
  ] }),
424
- error && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { role: "alert", className: "cg-search-failure", title: error, children: t("saveFailed") })
613
+ error && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { role: "alert", className: "cg-search-failure", title: error, children: t("saveFailed") })
425
614
  ] });
426
615
  }
427
616
  function ConnectedSearch({ id, t, useConnection: useConnection2 }) {
428
617
  const { connection, error, refresh } = useConnection2();
429
- if (error) return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(SearchRetry, { t, message: t("requestFailed"), retry: () => {
618
+ if (error) return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SearchRetry, { t, message: t("requestFailed"), retry: () => {
430
619
  void refresh();
431
620
  } });
432
621
  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]));
622
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SessionSearch, { id, profileId: connection.profileId, t }, JSON.stringify([id, connection.profileId]));
434
623
  }
435
624
  function ModelSearch({ directory, id, t, useConnection: useConnection2 }) {
436
- const model = (0, import_react3.useSyncExternalStore)(directory.subscribe, directory.getSnapshot);
625
+ const model = (0, import_react4.useSyncExternalStore)(directory.subscribe, directory.getSnapshot);
437
626
  if (model.current?.provider !== "chatgpt-plan" || model.routable === false) return null;
438
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ConnectedSearch, { id, t, useConnection: useConnection2 });
627
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ConnectedSearch, { id, t, useConnection: useConnection2 });
439
628
  }
440
629
  function registerNativeChatOptions(ctx, useConnection2) {
441
630
  ctx.inject(["slots", "sessions", "modelDirectories"], (scope) => {
@@ -449,7 +638,7 @@ function registerNativeChatOptions(ctx, useConnection2) {
449
638
  return { id, directory: scope.modelDirectories.directoryFor(id).store };
450
639
  }
451
640
  }, function NativeSearch({ id, directory, t }) {
452
- return directory ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ModelSearch, { id, directory, t, useConnection: useConnection2 }) : null;
641
+ return directory ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ModelSearch, { id, directory, t, useConnection: useConnection2 }) : null;
453
642
  }));
454
643
  });
455
644
  }
@@ -461,9 +650,9 @@ var chatgpt_button_black_21_default = 'data:image/svg+xml,<svg preserveAspectRat
461
650
  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
651
 
463
652
  // client/ChatGPTMark.jsx
464
- var import_jsx_runtime4 = require("react/jsx-runtime");
653
+ var import_jsx_runtime5 = require("react/jsx-runtime");
465
654
  function ChatGPTMark({ size = 20, className = "", tone = "auto" }) {
466
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
655
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
467
656
  "span",
468
657
  {
469
658
  className: `dsh-use-chatgpt-mark ${className}`.trimEnd(),
@@ -471,53 +660,15 @@ function ChatGPTMark({ size = 20, className = "", tone = "auto" }) {
471
660
  "aria-hidden": "true",
472
661
  style: { width: size, height: size },
473
662
  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: "" })
663
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("img", { className: "dsh-chatgpt-dark-ink", src: chatgpt_button_black_21_default, alt: "" }),
664
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("img", { className: "dsh-chatgpt-light-ink", src: chatgpt_button_white_21_default, alt: "" })
476
665
  ]
477
666
  }
478
667
  );
479
668
  }
480
669
 
481
670
  // 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
- `;
671
+ 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
672
 
522
673
  // client/updates.js
523
674
  var versionStatuses = /* @__PURE__ */ new Set(["update_available", "release_pending", "up_to_date", "latest_unstable"]);
@@ -576,10 +727,10 @@ function openPluginDetails(ctx) {
576
727
  }
577
728
 
578
729
  // 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";
730
+ 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
731
 
581
732
  // client/index.jsx
582
- var import_jsx_runtime5 = require("react/jsx-runtime");
733
+ var import_jsx_runtime6 = require("react/jsx-runtime");
583
734
  var pluginId = "dsh-use-chatgpt";
584
735
  var apiBase = "/api/dsh-use-chatgpt";
585
736
  var connectionStatuses = ["disconnected", "connecting", "connected", "reauth_required"];
@@ -604,7 +755,7 @@ var dictionaries = {
604
755
  subtitle: "\u5728 DeepSeek Harness \u4E2D\u4F7F\u7528\u4F60\u7684 ChatGPT \u5957\u9910\u989D\u5EA6\u3002",
605
756
  browserTitle: "\u5728\u6D4F\u89C8\u5668\u4E2D\u7EE7\u7EED",
606
757
  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",
758
+ 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
759
  authorizationFailed: "\u6388\u6743\u672A\u5B8C\u6210",
609
760
  close: "\u5173\u95ED",
610
761
  reconnectAccount: "\u91CD\u65B0\u8FDE\u63A5",
@@ -632,11 +783,26 @@ var dictionaries = {
632
783
  modelsEmpty: "\u6B64\u8D26\u53F7\u6682\u65F6\u6CA1\u6709\u53EF\u7528\u7684 ChatGPT \u5957\u9910\u6A21\u578B\u3002",
633
784
  modelsFailed: "\u65E0\u6CD5\u8BFB\u53D6\u6A21\u578B\u5217\u8868\u3002",
634
785
  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"
786
+ updateTitle: "\u6709\u65B0\u7248\u672C",
787
+ updateDetails: "\u67E5\u770B\u66F4\u65B0",
788
+ updateBadge: "\u66F4\u65B0",
789
+ otherPlugins: "\u4F5C\u8005\u7684\u5176\u4ED6\u63D2\u4EF6",
790
+ 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",
791
+ 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",
792
+ 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",
793
+ installPlugin: "\u5B89\u88C5",
794
+ installedPlugin: "\u5DF2\u5B89\u88C5",
795
+ installingPlugin: "\u5B89\u88C5\u4E2D\u2026",
796
+ checkingPlugins: "\u68C0\u6D4B\u4E2D\u2026",
797
+ retryPlugins: "\u91CD\u65B0\u68C0\u6D4B",
798
+ installUnavailable: "\u5B89\u88C5\u4E0D\u53EF\u7528",
799
+ pluginAction: "{name} \xB7 {action}",
800
+ chromeStore: "Chrome \u7248",
801
+ edgeStore: "Edge \u7248",
802
+ inventoryError: "\u65E0\u6CD5\u8BFB\u53D6\u5DF2\u5B89\u88C5\u63D2\u4EF6\uFF0C\u8BF7\u91CD\u65B0\u68C0\u6D4B\u3002",
803
+ installError: "\u5B89\u88C5\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\u3002",
804
+ packageNotFound: "npm \u5B98\u65B9\u6E90\u6682\u672A\u627E\u5230 {name}\u3002",
805
+ installGuide: "\u67E5\u770B\u5B89\u88C5\u8BF4\u660E"
640
806
  },
641
807
  en: {
642
808
  webSearch: "Web search",
@@ -657,7 +823,7 @@ var dictionaries = {
657
823
  subtitle: "Use your ChatGPT plan allowance in DeepSeek Harness.",
658
824
  browserTitle: "Continue in your browser",
659
825
  chooseSignedIn: "Choose a signed-in account",
660
- authorizeHint: "Complete authorization in your browser within 1 minute to switch to this account.",
826
+ authorizeHint: "Complete authorization in your browser within 3 minutes to switch to this account.",
661
827
  authorizationFailed: "Authorization incomplete",
662
828
  close: "Close",
663
829
  reconnectAccount: "Reconnect",
@@ -685,11 +851,26 @@ var dictionaries = {
685
851
  modelsEmpty: "This account currently has no available ChatGPT plan models.",
686
852
  modelsFailed: "Could not load the model list.",
687
853
  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."
854
+ updateTitle: "Update available",
855
+ updateDetails: "View update",
856
+ updateBadge: "Update",
857
+ otherPlugins: "More plugins by this author",
858
+ freeModelsDescription: "Use free Kilo models in DSH, check availability, and choose which models appear in chat.",
859
+ timelineDescription: "Add a question timeline, bookmark folders, a prompt library, and chat exports to DSH.",
860
+ browserDescription: "Add a chat timeline, bookmarks, and a prompt library to ChatGPT, Gemini, DeepSeek, and other AI chat sites.",
861
+ installPlugin: "Install",
862
+ installedPlugin: "Installed",
863
+ installingPlugin: "Installing\u2026",
864
+ checkingPlugins: "Checking\u2026",
865
+ retryPlugins: "Check again",
866
+ installUnavailable: "Install unavailable",
867
+ pluginAction: "{name} \xB7 {action}",
868
+ chromeStore: "Chrome",
869
+ edgeStore: "Edge",
870
+ inventoryError: "Could not load installed plugins. Check again.",
871
+ installError: "Installation failed. Try again.",
872
+ packageNotFound: "The npm registry could not find {name}.",
873
+ installGuide: "View installation guide"
693
874
  }
694
875
  };
695
876
  function validFeatures(features) {
@@ -725,14 +906,14 @@ function isAccountDialogAction(action) {
725
906
  return action === "add-account" || action === "cancel-add";
726
907
  }
727
908
  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) => {
909
+ const [connection, setConnection] = (0, import_react5.useState)(null);
910
+ const [pending, setPending] = (0, import_react5.useState)(null);
911
+ const [error, setError] = (0, import_react5.useState)(null);
912
+ const lifetime = (0, import_react5.useRef)(null);
913
+ const pendingAction = (0, import_react5.useRef)(null);
914
+ const refreshSignal = (0, import_react5.useRef)(null);
915
+ const revision = (0, import_react5.useRef)(0);
916
+ const refresh = (0, import_react5.useCallback)(async (clearError = true) => {
736
917
  const signal = lifetime.current?.signal;
737
918
  if (!signal || refreshSignal.current === signal || pendingAction.current) return;
738
919
  const update = revision.current;
@@ -750,7 +931,7 @@ function useConnection() {
750
931
  if (refreshSignal.current === signal) refreshSignal.current = null;
751
932
  }
752
933
  }, []);
753
- (0, import_react4.useEffect)(() => {
934
+ (0, import_react5.useEffect)(() => {
754
935
  const controller = new AbortController();
755
936
  lifetime.current = controller;
756
937
  const onFocus = () => {
@@ -766,7 +947,7 @@ function useConnection() {
766
947
  };
767
948
  }, [refresh]);
768
949
  const polling = connection?.status === "connecting" || connection?.addingAccount;
769
- (0, import_react4.useEffect)(() => {
950
+ (0, import_react5.useEffect)(() => {
770
951
  if (!polling) return;
771
952
  const timer = window.setInterval(() => {
772
953
  void refresh(false);
@@ -810,7 +991,7 @@ function profileName(profile) {
810
991
  return profile.identity?.email || profile.identity?.name || profile.label;
811
992
  }
812
993
  function LoginScreen({ t, state }) {
813
- const titleId = (0, import_react4.useId)();
994
+ const titleId = (0, import_react5.useId)();
814
995
  const { connection, pending, error, refresh, run } = state;
815
996
  const waiting = connection?.status === "connecting" || pending === "sign-in" || pending === "cancel";
816
997
  const profiles = connection?.profiles ?? [];
@@ -825,18 +1006,18 @@ function LoginScreen({ t, state }) {
825
1006
  const target = existing || profiles.find((profile) => profile.pending);
826
1007
  void run("sign-in", target ? { profileId: target.id } : { newProfile: true });
827
1008
  }
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") })
1009
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("section", { className: "cg-account cg-welcome", "aria-labelledby": titleId, children: [
1010
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("header", { className: "cg-welcome-heading", children: [
1011
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ChatGPTMark, { size: 48 }),
1012
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h1", { id: titleId, children: t(waiting ? "browserTitle" : choosing ? "chooseSignedIn" : "startHere") })
832
1013
  ] }),
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: () => {
1014
+ hint && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "cg-account-status", role: "status", children: hint }),
1015
+ message && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "dsh-use-chatgpt-error", role: "alert", children: message }),
1016
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "dsh-use-chatgpt-actions", children: [
1017
+ !connection && error && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_dsh_client_ui_primitives3.Button, { variant: "outline", size: "sm", onClick: () => {
837
1018
  void refresh();
838
1019
  }, children: t("retry") }),
839
- waiting && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1020
+ waiting && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
840
1021
  import_dsh_client_ui_primitives3.Button,
841
1022
  {
842
1023
  variant: "outline",
@@ -848,7 +1029,7 @@ function LoginScreen({ t, state }) {
848
1029
  children: t("cancel")
849
1030
  }
850
1031
  ),
851
- choosing && signedIn.map((profile) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1032
+ choosing && signedIn.map((profile) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
852
1033
  import_dsh_client_ui_primitives3.Button,
853
1034
  {
854
1035
  variant: "outline",
@@ -861,7 +1042,7 @@ function LoginScreen({ t, state }) {
861
1042
  },
862
1043
  profile.id
863
1044
  )),
864
- connection?.available && !waiting && !choosing && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1045
+ connection?.available && !waiting && !choosing && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
865
1046
  import_dsh_client_ui_primitives3.Button,
866
1047
  {
867
1048
  className: "cg-primary",
@@ -876,7 +1057,7 @@ function LoginScreen({ t, state }) {
876
1057
  ] });
877
1058
  }
878
1059
  function AccountRow({ profile, current, busy, t, run }) {
879
- const [menuOpen, setMenuOpen] = (0, import_react4.useState)(false);
1060
+ const [menuOpen, setMenuOpen] = (0, import_react5.useState)(false);
880
1061
  const { id, identity, sharing } = profile;
881
1062
  const connected = !profile.pending && profile.status === "connected";
882
1063
  const email = identity?.email;
@@ -888,20 +1069,20 @@ function AccountRow({ profile, current, busy, t, run }) {
888
1069
  else if (profile.status === "reauth_required") status = "expiredAccount";
889
1070
  else if (!connected) status = "signedOut";
890
1071
  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") })
1072
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("li", { className: "cg-profile", children: [
1073
+ /* @__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 }) }),
1074
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "cg-profile-text", children: [
1075
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "cg-profile-name", children: [
1076
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("strong", { children: display }),
1077
+ current && connected && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "cg-current-account", children: t("activeAccount") })
897
1078
  ] }),
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) })
1079
+ (secondaryEmail || status) && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "cg-profile-meta", children: [
1080
+ secondaryEmail && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: secondaryEmail }),
1081
+ status && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: t(status) })
901
1082
  ] })
902
1083
  ] }),
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)(
1084
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "cg-profile-actions", children: connected ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
1085
+ !current && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
905
1086
  "button",
906
1087
  {
907
1088
  type: "button",
@@ -914,7 +1095,7 @@ function AccountRow({ profile, current, busy, t, run }) {
914
1095
  children: t("switchAccount")
915
1096
  }
916
1097
  ),
917
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1098
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
918
1099
  import_dsh_client_ui_primitives3.Menu,
919
1100
  {
920
1101
  open: menuOpen && !busy,
@@ -922,7 +1103,7 @@ function AccountRow({ profile, current, busy, t, run }) {
922
1103
  portal: true,
923
1104
  autoFocus: true,
924
1105
  dense: true,
925
- anchor: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1106
+ anchor: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
926
1107
  "button",
927
1108
  {
928
1109
  type: "button",
@@ -932,12 +1113,12 @@ function AccountRow({ profile, current, busy, t, run }) {
932
1113
  "aria-haspopup": "menu",
933
1114
  "aria-expanded": menuOpen && !busy,
934
1115
  onClick: () => setMenuOpen((open) => !open),
935
- children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(PanelIcon, { name: "more" })
1116
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PanelIcon, { name: "more" })
936
1117
  }
937
1118
  ),
938
1119
  items: [
939
1120
  { 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 }) }
1121
+ { id: "sign-out", label: t("signOut"), icon: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PanelIcon, { name: "signOut", size: 16 }) }
941
1122
  ],
942
1123
  onClose: () => setMenuOpen(false),
943
1124
  onSelect: () => {
@@ -946,7 +1127,7 @@ function AccountRow({ profile, current, busy, t, run }) {
946
1127
  }
947
1128
  }
948
1129
  )
949
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1130
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
950
1131
  "button",
951
1132
  {
952
1133
  type: "button",
@@ -962,7 +1143,7 @@ function AccountRow({ profile, current, busy, t, run }) {
962
1143
  ] });
963
1144
  }
964
1145
  function Account({ t, state }) {
965
- const titleId = (0, import_react4.useId)();
1146
+ const titleId = (0, import_react5.useId)();
966
1147
  const { connection, pending, error, run } = state;
967
1148
  const { profileId, profiles = [] } = connection;
968
1149
  const rows = profiles.filter((profile) => profile.status === "connected" || !profile.requiresNewRegistration);
@@ -979,9 +1160,9 @@ function Account({ t, state }) {
979
1160
  const busy = waiting || Boolean(pending) && !isAccountDialogAction(pending);
980
1161
  const needsConsent = connection.status === "connected" && !connection.sharing;
981
1162
  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)(
1163
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("section", { className: "cg-account", "aria-labelledby": titleId, children: [
1164
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("header", { className: "cg-account-heading", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h2", { id: titleId, children: t("account") }) }),
1165
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("ul", { className: "cg-profile-list", children: rows.map((profile) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
985
1166
  AccountRow,
986
1167
  {
987
1168
  profile,
@@ -992,10 +1173,10 @@ function Account({ t, state }) {
992
1173
  },
993
1174
  profile.id
994
1175
  )) }),
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)(
1176
+ message && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "dsh-use-chatgpt-error", role: "alert", children: message }),
1177
+ waiting ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "cg-account-flow", children: [
1178
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { role: "status", children: t("connecting") }),
1179
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "dsh-use-chatgpt-actions", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
999
1180
  import_dsh_client_ui_primitives3.Button,
1000
1181
  {
1001
1182
  variant: "outline",
@@ -1007,13 +1188,13 @@ function Account({ t, state }) {
1007
1188
  children: t("cancel")
1008
1189
  }
1009
1190
  ) })
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: () => {
1191
+ ] }) : needsConsent && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "cg-account-flow", children: [
1192
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: t("needsConsent") }),
1193
+ /* @__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
1194
  void run("enable", { profileId });
1014
1195
  }, children: t("enable") }) })
1015
1196
  ] }),
1016
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1197
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1017
1198
  "button",
1018
1199
  {
1019
1200
  type: "button",
@@ -1024,7 +1205,7 @@ function Account({ t, state }) {
1024
1205
  void run("add-account", { newProfile: true });
1025
1206
  },
1026
1207
  children: [
1027
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(PanelIcon, { name: "plus", size: 17 }),
1208
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PanelIcon, { name: "plus", size: 17 }),
1028
1209
  t("newAccount")
1029
1210
  ]
1030
1211
  }
@@ -1032,14 +1213,14 @@ function Account({ t, state }) {
1032
1213
  ] });
1033
1214
  }
1034
1215
  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)(() => {
1216
+ const [data, setData] = (0, import_react5.useState)(null);
1217
+ const [error, setError] = (0, import_react5.useState)(null);
1218
+ const [revision, setRevision] = (0, import_react5.useState)(0);
1219
+ const [refreshing, setRefreshing] = (0, import_react5.useState)(false);
1220
+ const refresh = (0, import_react5.useCallback)(() => {
1040
1221
  setRevision((value) => value + 1);
1041
1222
  }, []);
1042
- (0, import_react4.useEffect)(() => {
1223
+ (0, import_react5.useEffect)(() => {
1043
1224
  if (!read) {
1044
1225
  setData(null);
1045
1226
  setError(null);
@@ -1120,55 +1301,64 @@ async function readModels(profileId, signal, force) {
1120
1301
  if (!Array.isArray(data?.models)) throw new Error();
1121
1302
  return data.models.filter((model) => typeof model?.id === "string" && typeof model.name === "string");
1122
1303
  }
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",
1304
+ function UpdateBanner({ ctx, t, data }) {
1305
+ if (data?.status !== "update_available") return null;
1306
+ function openDetails(event) {
1307
+ if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;
1308
+ if (openPluginDetails(ctx)) event.preventDefault();
1309
+ }
1310
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "cg-update-banner", children: [
1311
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("p", { className: "cg-update-copy", children: [
1312
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("strong", { children: t("updateTitle") }),
1313
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { children: [
1314
+ "v",
1315
+ data.latestVersion
1316
+ ] })
1317
+ ] }),
1318
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1319
+ "a",
1131
1320
  {
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
- ]
1321
+ className: "cg-update-action",
1322
+ href: `https://www.npmjs.com/package/${package_default.name}`,
1323
+ target: "_blank",
1324
+ rel: "noopener noreferrer",
1325
+ onClick: openDetails,
1326
+ children: t("updateDetails")
1142
1327
  }
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") })
1328
+ )
1148
1329
  ] });
1149
1330
  }
1150
- function WorkspaceBody({ t, language, state }) {
1331
+ function PluginVersion({ t, data, loginFooter = false }) {
1332
+ const version = "v" + (data?.currentVersion ?? package_default.version);
1333
+ const Wrapper = loginFooter ? "footer" : "div";
1334
+ 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: [
1335
+ loginFooter && t("version"),
1336
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: version })
1337
+ ] }) });
1338
+ }
1339
+ function WorkspaceBody({ t, language, state, installer }) {
1151
1340
  const { connection, pending, run } = state;
1152
1341
  const authorized = connection.status === "connected" && connection.sharing;
1153
1342
  const profileId = connection?.profileId;
1154
- const loadModels = (0, import_react4.useCallback)((signal, force) => readModels(profileId, signal, force), [profileId]);
1343
+ const loadModels = (0, import_react5.useCallback)((signal, force) => readModels(profileId, signal, force), [profileId]);
1155
1344
  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: () => {
1345
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "cg-dashboard", children: [
1346
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Account, { t, state }),
1347
+ authorized && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
1348
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ModelCatalog, { t, language, resource: models, profileId }),
1349
+ connection.features?.webSearch && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("details", { className: "cg-legacy-defaults", children: [
1350
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("summary", { children: t("legacyDefaults") }),
1351
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: t("legacyHint") }),
1352
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_dsh_client_ui_primitives3.Button, { variant: "outline", size: "sm", disabled: Boolean(pending), onClick: () => {
1164
1353
  void run("features", { ...connection.features, webSearch: false });
1165
1354
  }, children: t("resetDefaults") })
1166
1355
  ] })
1167
- ] })
1356
+ ] }),
1357
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PluginRecommendations, { installer, t })
1168
1358
  ] });
1169
1359
  }
1170
- function ChatGPTPage({ ctx, t, updates }) {
1171
- const titleId = (0, import_react4.useId)();
1360
+ function ChatGPTPage({ ctx, t, updates, installer }) {
1361
+ const titleId = (0, import_react5.useId)();
1172
1362
  const state = useConnection();
1173
1363
  const { connection, pending, error, run, dismissError } = state;
1174
1364
  const authorizing = connection?.addingAccount || isAccountDialogAction(pending);
@@ -1181,16 +1371,17 @@ function ChatGPTPage({ ctx, t, updates }) {
1181
1371
  }
1182
1372
  const connectedProfile = connection?.profiles?.some((profile) => profile.id === connection.profileId && profile.status === "connected" && !profile.pending);
1183
1373
  const signedIn = connection?.available && (connection.status === "connected" || connection.status === "connecting" && connectedProfile);
1184
- const version = (0, import_react4.useSyncExternalStore)(updates.subscribe, updates.getSnapshot);
1374
+ const version = (0, import_react5.useSyncExternalStore)(updates.subscribe, updates.getSnapshot);
1185
1375
  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)(
1376
+ (0, import_react5.useEffect)(updates.refresh, [updates]);
1377
+ 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: [
1378
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: signedIn ? "dsh-use-chatgpt-content" : "cg-login-layout", inert: dialogOpen ? "" : void 0, children: [
1379
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(UpdateBanner, { ctx, t, data: version }),
1380
+ signedIn && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("header", { className: "dsh-use-chatgpt-header", children: [
1381
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h1", { id: titleId, children: t("title") }),
1382
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "cg-header-links", children: [
1383
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PluginVersion, { t, data: version }),
1384
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_dsh_client_ui_primitives3.Tooltip, { label: t("viewProject"), children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1194
1385
  "a",
1195
1386
  {
1196
1387
  className: "cg-project-link",
@@ -1198,16 +1389,16 @@ function ChatGPTPage({ ctx, t, updates }) {
1198
1389
  target: "_blank",
1199
1390
  rel: "noopener noreferrer",
1200
1391
  "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" }) })
1392
+ 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
1393
  }
1203
1394
  ) })
1204
1395
  ] }),
1205
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { children: t("subtitle") })
1396
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: t("subtitle") })
1206
1397
  ] }),
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 })
1398
+ signedIn ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(WorkspaceBody, { t, language, state, installer }, connection.profileId) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(LoginScreen, { t, state }),
1399
+ !signedIn && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PluginVersion, { t, data: version, loginFooter: true })
1209
1400
  ] }),
1210
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1401
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1211
1402
  import_dsh_client_ui_primitives3.Modal,
1212
1403
  {
1213
1404
  open: dialogOpen,
@@ -1215,22 +1406,24 @@ function ChatGPTPage({ ctx, t, updates }) {
1215
1406
  description: dialogError ? dialogError.message || t("requestFailed") : t("authorizeHint"),
1216
1407
  closeLabel: t(authorizing ? "cancel" : "close"),
1217
1408
  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") })
1409
+ 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
1410
  }
1220
1411
  )
1221
1412
  ] });
1222
1413
  }
1223
1414
  function SidebarIcon({ size = 16 }) {
1224
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ChatGPTMark, { size });
1415
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ChatGPTMark, { size });
1225
1416
  }
1226
1417
  function SidebarUpdateBadge({ updates, wide, t }) {
1227
- const version = (0, import_react4.useSyncExternalStore)(updates.subscribe, updates.getSnapshot);
1418
+ const version = (0, import_react5.useSyncExternalStore)(updates.subscribe, updates.getSnapshot);
1228
1419
  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") });
1420
+ if (wide) return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "dsh-use-chatgpt-update-badge", children: t("updateBadge") });
1421
+ 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
1422
  }
1231
1423
  var inject = ["locale", "slots"];
1232
1424
  function apply(ctx) {
1233
1425
  const updates = monitorUpdates(ctx);
1426
+ const installer = createPluginInstaller(ctx);
1234
1427
  const t = ctx.locale.bind(pluginId);
1235
1428
  registerNativeChatOptions(ctx, useConnection);
1236
1429
  ctx.effect(() => ctx.locale.register(pluginId, dictionaries), `${pluginId} translations`);
@@ -1254,14 +1447,14 @@ function apply(ctx) {
1254
1447
  id: pluginId,
1255
1448
  locale: pluginId
1256
1449
  }, function Trailing(props) {
1257
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SidebarUpdateBadge, { ...props, updates });
1450
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SidebarUpdateBadge, { ...props, updates });
1258
1451
  }));
1259
1452
  ctx.slots.inject("main", () => ctx.slots.register({
1260
1453
  name: "main",
1261
1454
  key: pluginId,
1262
1455
  locale: pluginId
1263
1456
  }, function Panel(props) {
1264
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ChatGPTPage, { ...props, ctx, updates });
1457
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ChatGPTPage, { ...props, ctx, updates, installer });
1265
1458
  }));
1266
1459
  }
1267
1460
  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.2",
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.2",
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" },