dsh-agy-link 0.6.50 → 0.6.52

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
@@ -52,6 +52,9 @@ window.__ModuleLoader__.load({
52
52
  "account.add": "添加 Google 账号",
53
53
  "account.aliasDefault": "备用 Google 账号 {number}",
54
54
  "account.defaultAlias": "主账号(系统登录)",
55
+ "decision.quickFill": "💬 点击选项快速填入:",
56
+ "decision.insertTooltip": "点击填入: {text}",
57
+ "decision.insertPayload": "我选择 {choice}",
55
58
  "account.proxyPlaceholder": "专属代理 URL(如 http://127.0.0.1:7890,留空则继承全局)",
56
59
  "account.aliasPlaceholder": "账号别名(例如:备用账号 2)",
57
60
  "account.removeTitle": "移除此账号",
@@ -286,6 +289,9 @@ window.__ModuleLoader__.load({
286
289
  "account.add": "Add Google account",
287
290
  "account.aliasDefault": "Backup Google account {number}",
288
291
  "account.defaultAlias": "Primary account (system sign-in)",
292
+ "decision.quickFill": "💬 Click an option to fill it in:",
293
+ "decision.insertTooltip": "Insert: {text}",
294
+ "decision.insertPayload": "I choose {choice}",
289
295
  "account.proxyPlaceholder": "Dedicated proxy URL (e.g. http://127.0.0.1:7890; leave blank to inherit global)",
290
296
  "account.aliasPlaceholder": "Account alias (for example: Backup account 2)",
291
297
  "account.removeTitle": "Remove this account",
@@ -520,6 +526,9 @@ window.__ModuleLoader__.load({
520
526
  "account.add": "Adicionar conta Google",
521
527
  "account.aliasDefault": "Conta Google reserva {number}",
522
528
  "account.defaultAlias": "Conta principal (login do sistema)",
529
+ "decision.quickFill": "💬 Clique numa opção para preenchê-la:",
530
+ "decision.insertTooltip": "Inserir: {text}",
531
+ "decision.insertPayload": "Escolho {choice}",
523
532
  "account.proxyPlaceholder": "URL de proxy dedicada (ex.: http://127.0.0.1:7890; deixe vazio para herdar a global)",
524
533
  "account.aliasPlaceholder": "Apelido da conta (por exemplo: Conta reserva 2)",
525
534
  "account.removeTitle": "Remover esta conta",
@@ -754,6 +763,9 @@ window.__ModuleLoader__.load({
754
763
  "account.add": "Añadir cuenta de Google",
755
764
  "account.aliasDefault": "Cuenta de Google de respaldo {number}",
756
765
  "account.defaultAlias": "Cuenta principal (inicio de sesión del sistema)",
766
+ "decision.quickFill": "💬 Haz clic en una opción para rellenarla:",
767
+ "decision.insertTooltip": "Insertar: {text}",
768
+ "decision.insertPayload": "Elijo {choice}",
757
769
  "account.proxyPlaceholder": "URL de proxy dedicada (p. ej., http://127.0.0.1:7890; déjalo vacío para heredar la global)",
758
770
  "account.aliasPlaceholder": "Alias de la cuenta (por ejemplo: Cuenta de respaldo 2)",
759
771
  "account.removeTitle": "Eliminar esta cuenta",
@@ -3754,7 +3766,9 @@ window.__ModuleLoader__.load({
3754
3766
  box.className = "agy-decision-container";
3755
3767
  const header = document.createElement("div");
3756
3768
  header.className = "agy-decision-header";
3757
- header.innerHTML = "<span>💬 点击选项快速填入:</span>";
3769
+ const headerLabel = document.createElement("span");
3770
+ headerLabel.textContent = activeTranslate("decision.quickFill");
3771
+ header.appendChild(headerLabel);
3758
3772
  box.appendChild(header);
3759
3773
  const chips = document.createElement("div");
3760
3774
  chips.className = "agy-decision-chips";
@@ -3762,7 +3776,7 @@ window.__ModuleLoader__.load({
3762
3776
  const chip = document.createElement("button");
3763
3777
  chip.type = "button";
3764
3778
  chip.className = "agy-decision-chip";
3765
- chip.title = `点击填入: ${opt.fullText}`;
3779
+ chip.title = activeTranslate("decision.insertTooltip", { text: opt.fullText });
3766
3780
  const numSpan = document.createElement("span");
3767
3781
  numSpan.className = "agy-decision-chip-num";
3768
3782
  numSpan.textContent = opt.num ?? "👉";
@@ -3774,7 +3788,7 @@ window.__ModuleLoader__.load({
3774
3788
  chip.onclick = (e) => {
3775
3789
  e.stopPropagation();
3776
3790
  const cleanText = opt.fullText.replace(/^[0-9]+[、..:]\s*/, "").trim();
3777
- insertTextIntoChatComposer(`我选择 ${opt.num ? opt.num + " " : ""}${cleanText}`);
3791
+ insertTextIntoChatComposer(activeTranslate("decision.insertPayload", { choice: (opt.num ? opt.num + " " : "") + cleanText }));
3778
3792
  chip.classList.add("selected");
3779
3793
  setTimeout(() => chip.classList.remove("selected"), 1200);
3780
3794
  };
@@ -3797,8 +3811,24 @@ window.__ModuleLoader__.load({
3797
3811
  scanAndEnhanceDecisions();
3798
3812
  }, 100);
3799
3813
  }
3800
- function installDecisionChips() {
3814
+ /** Active translator for the scan pass (module scope: the scan runs outside install). */
3815
+ let activeTranslate = (key, params) => {
3816
+ return ({
3817
+ "decision.quickFill": "💬 Click an option to fill it in:",
3818
+ "decision.insertTooltip": "Insert: {text}",
3819
+ "decision.insertPayload": "I choose {choice}"
3820
+ }[key] ?? key).replace(/\{(\w+)\}/g, (_, name) => String(params?.[name] ?? ""));
3821
+ };
3822
+ function translatorFor(ctx) {
3823
+ try {
3824
+ const bound = (ctx?.locale)?.bind?.(NS);
3825
+ if (typeof bound === "function") return bound;
3826
+ } catch {}
3827
+ return activeTranslate;
3828
+ }
3829
+ function installDecisionChips(ctx) {
3801
3830
  if (typeof window === "undefined" || typeof document === "undefined") return () => {};
3831
+ activeTranslate = translatorFor(ctx);
3802
3832
  decisionChipsDispose?.();
3803
3833
  injectStyles$4();
3804
3834
  const observer = new MutationObserver(() => {
@@ -10374,7 +10404,7 @@ body[data-ds-dark-theme] select.agy-select { color-scheme: dark; }
10374
10404
  ctx.effect(() => installAutoExpandReasoning());
10375
10405
  ctx.effect(() => installMermaidRendering());
10376
10406
  ctx.effect(() => installImageEnhancer(ctx));
10377
- ctx.effect(() => installDecisionChips());
10407
+ ctx.effect(() => installDecisionChips(ctx));
10378
10408
  ctx.effect(() => installCompactionCard());
10379
10409
  ctx.effect(() => {
10380
10410
  try {