sideby 0.24.0 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/README.md +3 -1
  2. package/ai-tasks.json +17 -0
  3. package/dist/build.json +1 -1
  4. package/dist/src/cli/commands.d.ts +14 -0
  5. package/dist/src/cli/commands.js +120 -12
  6. package/dist/src/cli/json-schemas.js +47 -0
  7. package/dist/src/cli/main.js +41 -6
  8. package/dist/src/core/ask.d.ts +10 -6
  9. package/dist/src/core/ask.js +52 -9
  10. package/dist/src/core/config.d.ts +16 -0
  11. package/dist/src/core/config.js +16 -0
  12. package/dist/src/core/egress.d.ts +103 -0
  13. package/dist/src/core/egress.js +333 -0
  14. package/dist/src/core/handoff-run.d.ts +4 -2
  15. package/dist/src/core/handoff-run.js +18 -11
  16. package/dist/src/core/launch.d.ts +5 -1
  17. package/dist/src/core/launch.js +5 -0
  18. package/dist/src/core/network.d.ts +131 -0
  19. package/dist/src/core/network.js +317 -0
  20. package/dist/src/families/agy/index.js +4 -1
  21. package/dist/src/families/claude/index.js +4 -1
  22. package/dist/src/families/codex/index.js +8 -1
  23. package/dist/src/families/grok/index.js +4 -1
  24. package/dist/src/families/pi/index.js +4 -1
  25. package/dist/src/network/hook.d.ts +15 -0
  26. package/dist/src/network/hook.js +69 -0
  27. package/dist/src/panel/handler.d.ts +3 -0
  28. package/dist/src/panel/handler.js +33 -1
  29. package/dist/src/panel/i18n.d.ts +51 -0
  30. package/dist/src/panel/i18n.js +102 -0
  31. package/dist/src/panel/page-logic.d.ts +23 -1
  32. package/dist/src/panel/page-logic.js +33 -0
  33. package/dist/src/panel/page-script.js +130 -2
  34. package/dist/src/panel/page-styles.js +11 -3
  35. package/dist/src/runtime.d.ts +18 -1
  36. package/dist/src/runtime.js +78 -7
  37. package/dist/src/types.d.ts +7 -0
  38. package/package.json +2 -2
  39. package/schemas/config.json +20 -0
  40. package/schemas/network-set.json +129 -0
  41. package/schemas/network.json +199 -0
  42. package/schemas/try.json +4 -0
  43. package/skills/sideby/SKILL.md +3 -2
  44. package/skills/sideby/references/ai-tasks.md +2 -1
  45. package/skills/sideby/references/network.md +37 -0
@@ -20,6 +20,7 @@ import { acceptInbound, groupsToAccept, inboundGroups, undoInbound, waitingFiles
20
20
  import { listLiveSessions, liveKey, referenceText, sessionCopyText, } from '../core/live-sessions.js';
21
21
  import { listMessages, sendMessage } from '../core/messages.js';
22
22
  import { accountModel, setAccountModel } from '../core/model-choice.js';
23
+ import { GUARDED_FAMILIES, setNetwork } from '../core/network.js';
23
24
  import { tildify } from '../core/paths.js';
24
25
  import { remoteControlTodo } from '../core/remote-control.js';
25
26
  import { openRunBoard, withRuns } from '../core/run-link.js';
@@ -553,6 +554,9 @@ async function buildState(rt, opts) {
553
554
  opts.updates ? updateState(rt, opts.readOnly).catch(() => undefined) : Promise.resolve(undefined),
554
555
  ]);
555
556
  const health = healthByAccount(history);
557
+ const network = accounts.some((a) => GUARDED_FAMILIES.includes(a.family))
558
+ ? await rt.networkStatus().catch(() => undefined)
559
+ : undefined;
556
560
  // Reads of Accounts that are gone are dropped.
557
561
  for (const ref of opts.readings.keys())
558
562
  if (!accounts.some((a) => a.ref === ref))
@@ -626,6 +630,7 @@ async function buildState(rt, opts) {
626
630
  display: rt.displayOrder(),
627
631
  ...(rt.quotaChecks().length ? { quotaChecks: rt.quotaChecks() } : {}),
628
632
  ...(rt.config.panel && Object.keys(rt.config.panel).length ? { panel: rt.config.panel } : {}),
633
+ ...(network ? { network } : {}),
629
634
  };
630
635
  }
631
636
  /** The `display` of a /api/display-order body: null, or string lists only; anything else is refused. */
@@ -1081,7 +1086,7 @@ export function createPanelHandler(opts) {
1081
1086
  const account = optString(body, 'account');
1082
1087
  if (!account)
1083
1088
  throw new HttpError(400, '"account" is required');
1084
- return tryAccount(await getRuntime(), account);
1089
+ return tryAccount(await getRuntime(), account, undefined, optString(body, 'model'));
1085
1090
  },
1086
1091
  },
1087
1092
  // Themes (spec §3.34): `use` a Theme, `undo` the last switch, `accent` saves and uses the Theme File custom.json
@@ -1702,6 +1707,33 @@ export function createPanelHandler(opts) {
1702
1707
  return { ...r, path: tildify(r.path, home), ...(r.target ? { target: tildify(r.target, home) } : {}) };
1703
1708
  },
1704
1709
  },
1710
+ // Network Guard (spec §3.35): asks every address now. Only sideby's own cache changes, so a read-only Panel may.
1711
+ '/api/network/check': {
1712
+ writes: () => false,
1713
+ async run() {
1714
+ return (await getRuntime()).networkStatus({ check: true });
1715
+ },
1716
+ },
1717
+ // Network Guard's switch and countries (spec §3.35): config `network`, shown first like every config change.
1718
+ '/api/network/settings': {
1719
+ writes: (body) => body.confirm === true,
1720
+ async run(body) {
1721
+ const change = {};
1722
+ if (body.guard !== undefined) {
1723
+ if (typeof body.guard !== 'boolean')
1724
+ throw new HttpError(400, '"guard" must be true or false');
1725
+ change.guard = body.guard;
1726
+ }
1727
+ if (body.allow !== undefined) {
1728
+ if (!Array.isArray(body.allow) || !body.allow.every((x) => typeof x === 'string'))
1729
+ throw new HttpError(400, '"allow" must be a list of country codes');
1730
+ change.allow = body.allow;
1731
+ }
1732
+ const rt = await getRuntime();
1733
+ const r = await setNetwork(rt.paths.configFile, change, { apply: optBool(body, 'confirm') });
1734
+ return { ...r, file: tildify(r.file, rt.paths.home) };
1735
+ },
1736
+ },
1705
1737
  // Browser Sign-ins on or off (spec §3.24): config `browser.signIns`, shown first like every config change.
1706
1738
  '/api/browser/settings': {
1707
1739
  writes: (body) => body.confirm === true,
@@ -645,6 +645,12 @@ declare const en: {
645
645
  'th.removeSure': string;
646
646
  'th.removed': string;
647
647
  'ask.title.theme': string;
648
+ 'ask.title.network': string;
649
+ 'ask.task.network': string;
650
+ 'ask.ph.network': string;
651
+ 'ask.ex.network.1': string;
652
+ 'ask.ex.network.2': string;
653
+ 'ask.ex.network.3': string;
648
654
  'ask.ph.theme': string;
649
655
  'ask.ex.theme.1': string;
650
656
  'ask.ex.theme.2': string;
@@ -1269,6 +1275,51 @@ declare const en: {
1269
1275
  'set.g.ai': string;
1270
1276
  'set.quotaChecksHint': string;
1271
1277
  'set.ahHint': string;
1278
+ 'net.title': string;
1279
+ 'net.hint': string;
1280
+ 'net.explain': string;
1281
+ 'net.switch': string;
1282
+ 'net.allow': string;
1283
+ 'net.current': string;
1284
+ 'net.pickFirst': string;
1285
+ 'net.now': string;
1286
+ 'net.recheck': string;
1287
+ 'net.ok': string;
1288
+ 'net.blocked': string;
1289
+ 'net.unknown': string;
1290
+ 'net.notChecked': string;
1291
+ 'net.seen': string;
1292
+ 'net.checked': string;
1293
+ 'net.ipChanged': string;
1294
+ 'net.noTargets': string;
1295
+ 'net.skipped': string;
1296
+ 'net.notCovered': string;
1297
+ 'net.save': string;
1298
+ 'net.savedOn': string;
1299
+ 'net.savedOff': string;
1300
+ 'net.checkFailed': string;
1301
+ 'net.bannerTitle': string;
1302
+ 'net.bannerBlocked': string;
1303
+ 'net.bannerUnknown': string;
1304
+ 'net.listSep': string;
1305
+ 'net.listLast': string;
1306
+ 'net.keepOne': string;
1307
+ 'ai.ask.network': string;
1308
+ 'net.cty.US': string;
1309
+ 'net.cty.JP': string;
1310
+ 'net.cty.SG': string;
1311
+ 'net.cty.GB': string;
1312
+ 'net.cty.DE': string;
1313
+ 'net.cty.FR': string;
1314
+ 'net.cty.NL': string;
1315
+ 'net.cty.CA': string;
1316
+ 'net.cty.AU': string;
1317
+ 'net.cty.KR': string;
1318
+ 'net.cty.TW': string;
1319
+ 'net.cty.HK': string;
1320
+ 'net.cty.CN': string;
1321
+ 'net.cty.MO': string;
1322
+ 'net.cty.IN': string;
1272
1323
  'set.aiHint': string;
1273
1324
  'set.more': string;
1274
1325
  'set.saveFailed': string;
@@ -647,6 +647,12 @@ const en = {
647
647
  'th.removeSure': 'Remove for good?',
648
648
  'th.removed': 'Removed {name}',
649
649
  'ask.title.theme': 'Let AI pick your colors',
650
+ 'ask.title.network': 'Let AI help',
651
+ 'ask.task.network': 'AI asks which countries your requests may leave from, shows the change, and turns the check on only after you agree.',
652
+ 'ask.ph.network': 'Where are you, and which proxy nodes do you use? Or paste what was blocked.',
653
+ 'ask.ex.network.1': 'I am in the US; stop everything when the proxy drops',
654
+ 'ask.ex.network.2': 'Allow only my Japan and Singapore nodes',
655
+ 'ask.ex.network.3': 'A message was blocked; help me check the proxy',
650
656
  'ask.ph.theme': 'What feel do you want? A website or a color works too.',
651
657
  'ask.ex.theme.1': 'Quiet and gray, like Notion',
652
658
  'ask.ex.theme.2': 'Green, like my company site',
@@ -1271,6 +1277,51 @@ const en = {
1271
1277
  'set.g.ai': 'Let AI help',
1272
1278
  'set.quotaChecksHint': 'Each tool asks for its own quota, at most every {n} minutes per account. sideby does not read their sign-ins.',
1273
1279
  'set.ahHint': 'When an account is about to run out, the task moves on to another account by itself.',
1280
+ 'net.title': 'Network check',
1281
+ 'net.hint': 'Stops Claude and Codex when your requests would leave from a country you did not allow, for example when the proxy stopped.',
1282
+ 'net.explain': 'Before an account starts, and before each message and tool call in a session sideby started, sideby checks which country your requests leave from. When it is not one you allow, or cannot be told, it stops and says what to do. It guards against a proxy that stopped or a node in the wrong country; it does not make use from an unsupported region allowed.',
1283
+ 'net.switch': 'Check the network',
1284
+ 'net.allow': 'Countries your requests may leave from',
1285
+ 'net.current': 'now',
1286
+ 'net.pickFirst': 'Choose at least one country to turn it on. sideby never chooses for you, not even the current one.',
1287
+ 'net.now': 'Where your requests leave from',
1288
+ 'net.recheck': 'Check again',
1289
+ 'net.ok': 'allowed',
1290
+ 'net.blocked': 'not allowed',
1291
+ 'net.unknown': 'cannot tell',
1292
+ 'net.notChecked': 'not checked yet',
1293
+ 'net.seen': 'seen',
1294
+ 'net.checked': 'checked {when}',
1295
+ 'net.ipChanged': 'The exit address changed in the last day (same check; nothing is blocked for that).',
1296
+ 'net.noTargets': 'No Claude or Codex account is checked here.',
1297
+ 'net.skipped': '{refs}: API accounts are checked when they start (a third-party endpoint is not checked).',
1298
+ 'net.notCovered': 'Only sessions sideby starts are checked; running claude or codex directly is not. sideby asks the vendor’s own /cdn-cgi/trace with your proxy settings and no credential, and keeps only the country.',
1299
+ 'net.save': 'Save',
1300
+ 'net.savedOn': 'Network check is on.',
1301
+ 'net.savedOff': 'Network check is off.',
1302
+ 'net.checkFailed': 'Could not check: {msg}',
1303
+ 'net.bannerTitle': 'Wrong network.',
1304
+ 'net.bannerBlocked': 'Requests now leave from {cty}, not from {allow}. sideby will stop new sessions and messages until the proxy is right.',
1305
+ 'net.bannerUnknown': 'sideby cannot tell where requests leave from ({why}); the proxy may be off. Sessions and messages are stopped until it can.',
1306
+ 'net.listSep': ', ',
1307
+ 'net.listLast': ' or ',
1308
+ 'net.keepOne': 'Network check is on, so keep at least one country, or turn it off first.',
1309
+ 'ai.ask.network': 'Stop Claude and Codex when my network is not in the US or Japan.',
1310
+ 'net.cty.US': 'United States',
1311
+ 'net.cty.JP': 'Japan',
1312
+ 'net.cty.SG': 'Singapore',
1313
+ 'net.cty.GB': 'United Kingdom',
1314
+ 'net.cty.DE': 'Germany',
1315
+ 'net.cty.FR': 'France',
1316
+ 'net.cty.NL': 'Netherlands',
1317
+ 'net.cty.CA': 'Canada',
1318
+ 'net.cty.AU': 'Australia',
1319
+ 'net.cty.KR': 'South Korea',
1320
+ 'net.cty.TW': 'Taiwan',
1321
+ 'net.cty.HK': 'Hong Kong',
1322
+ 'net.cty.CN': 'Mainland China',
1323
+ 'net.cty.MO': 'Macau',
1324
+ 'net.cty.IN': 'India',
1274
1325
  'set.aiHint': 'Your AI assistant can do anything on this page for you, through the sideby skill.',
1275
1326
  'set.more': 'All settings…',
1276
1327
  'set.saveFailed': 'Could not save the setting: {msg}',
@@ -2040,6 +2091,12 @@ const zh = {
2040
2091
  'th.removeSure': '确定删除?',
2041
2092
  'th.removed': '已删除「{name}」',
2042
2093
  'ask.title.theme': '让 AI 帮我配色',
2094
+ 'ask.title.network': '让 AI 帮我',
2095
+ 'ask.task.network': 'AI 会问你允许哪些地区,先给你看改动,你同意后才打开检查。',
2096
+ 'ask.ph.network': '你在哪里、用哪些代理节点?或者贴上被拦下的提示。',
2097
+ 'ask.ex.network.1': '我在美国,代理一断就全部拦住',
2098
+ 'ask.ex.network.2': '只允许日本和新加坡节点',
2099
+ 'ask.ex.network.3': '消息被拦了,帮我查查代理',
2043
2100
  'ask.ph.theme': '想要什么感觉?给个网址或颜色也行。',
2044
2101
  'ask.ex.theme.1': '素净的灰色,像 Notion',
2045
2102
  'ask.ex.theme.2': '绿色,和我们公司官网一样',
@@ -2664,6 +2721,51 @@ const zh = {
2664
2721
  'set.g.ai': '让 AI 帮我',
2665
2722
  'set.quotaChecksHint': '各工具自己查询每个账号的额度,最多每 {n} 分钟一次。sideby 不读它们的登录信息。',
2666
2723
  'set.ahHint': '账号额度快用完时,任务自己换到另一个账号接着做。',
2724
+ 'net.title': '网络检查',
2725
+ 'net.hint': '请求要从你没允许的国家或地区发出时(比如代理断了),拦下 Claude 和 Codex。',
2726
+ 'net.explain': '账号启动前,以及 sideby 启动的会话里每条消息、每次工具调用前,sideby 都会查一下请求从哪个国家或地区发出。不在你允许的范围里,或者查不出来,就拦下并告诉你怎么办。它防的是代理断了、节点切错了;不会让在不支持的地区使用变得合规。',
2727
+ 'net.switch': '检查网络',
2728
+ 'net.allow': '允许请求从这些地区发出',
2729
+ 'net.current': '当前',
2730
+ 'net.pickFirst': '至少选一个地区才能打开。sideby 不替你选,当前所在的地区也不会自动选上。',
2731
+ 'net.now': '现在的请求从哪里发出',
2732
+ 'net.recheck': '重新检查',
2733
+ 'net.ok': '允许',
2734
+ 'net.blocked': '不允许',
2735
+ 'net.unknown': '查不出',
2736
+ 'net.notChecked': '还没查过',
2737
+ 'net.seen': '查到',
2738
+ 'net.checked': '{when}查过',
2739
+ 'net.ipChanged': '出口 IP 最近一天变过(不会因此拦截)。',
2740
+ 'net.noTargets': '这里没有要检查的 Claude 或 Codex 账号。',
2741
+ 'net.skipped': '{refs}:API 账号在启动时检查(第三方接口不检查)。',
2742
+ 'net.notCovered': '只检查 sideby 启动的会话,直接运行 claude 或 codex 不检查。sideby 带着你的代理设置访问服务商自己的 /cdn-cgi/trace,不带任何凭证,只保留国家或地区。',
2743
+ 'net.save': '保存',
2744
+ 'net.savedOn': '网络检查已打开。',
2745
+ 'net.savedOff': '网络检查已关闭。',
2746
+ 'net.checkFailed': '没能检查:{msg}',
2747
+ 'net.bannerTitle': '网络不对。',
2748
+ 'net.bannerBlocked': '现在请求从{cty}发出,不在{allow}里。代理恢复前,sideby 会拦下新会话和消息。',
2749
+ 'net.bannerUnknown': 'sideby 查不出请求从哪里发出({why}),代理可能没开。能查出来之前,会话和消息都会被拦下。',
2750
+ 'net.listSep': '、',
2751
+ 'net.listLast': '、',
2752
+ 'net.keepOne': '网络检查开着,至少留一个地区;不想检查就先关掉。',
2753
+ 'ai.ask.network': '网络不在美国或日本时,别让 Claude 和 Codex 用。',
2754
+ 'net.cty.US': '美国',
2755
+ 'net.cty.JP': '日本',
2756
+ 'net.cty.SG': '新加坡',
2757
+ 'net.cty.GB': '英国',
2758
+ 'net.cty.DE': '德国',
2759
+ 'net.cty.FR': '法国',
2760
+ 'net.cty.NL': '荷兰',
2761
+ 'net.cty.CA': '加拿大',
2762
+ 'net.cty.AU': '澳大利亚',
2763
+ 'net.cty.KR': '韩国',
2764
+ 'net.cty.TW': '台湾',
2765
+ 'net.cty.HK': '香港',
2766
+ 'net.cty.CN': '中国大陆',
2767
+ 'net.cty.MO': '澳门',
2768
+ 'net.cty.IN': '印度',
2667
2769
  'set.aiHint': '这个页面上能做的事,都可以让你的 AI 助手通过 sideby skill 帮你做。',
2668
2770
  'set.more': '所有设置…',
2669
2771
  'set.saveFailed': '设置没有保存:{msg}',
@@ -538,8 +538,28 @@ export declare function stripSecrets(text: string): {
538
538
  text: string;
539
539
  removed: boolean;
540
540
  };
541
+ /**
542
+ * Network Guard facts for the `network` AI Task (spec §3.35), one plain line each, from the Panel state's `network`:
543
+ * the switch, the allowed countries and the newest result per address. No address is ever in it, only countries.
544
+ */
545
+ export declare function networkTaskFacts(n: {
546
+ guard: boolean;
547
+ allow: readonly string[];
548
+ targets: readonly {
549
+ url: string;
550
+ status: string;
551
+ loc?: string;
552
+ checkedAt?: string;
553
+ error?: string;
554
+ accounts: readonly string[];
555
+ }[];
556
+ accounts: readonly {
557
+ ref: string;
558
+ skip?: string;
559
+ }[];
560
+ }): string[];
541
561
  /** The kinds of AI Task (spec §3.28); anything else is refused. */
542
- export declare const AI_TASK_KINDS: readonly ['free', 'fix', 'quota', 'account', 'host', 'plugin', 'terminal', 'theme', 'handoff', 'menubar', 'hotkey'];
562
+ export declare const AI_TASK_KINDS: readonly ['free', 'fix', 'quota', 'account', 'host', 'plugin', 'terminal', 'theme', 'handoff', 'menubar', 'hotkey', 'network'];
543
563
  export type AiTaskKind = (typeof AI_TASK_KINDS)[number];
544
564
  /**
545
565
  * The message keys of the AI dialog for `task` (spec §3.28 "每个入口的提示"): its title, the text box placeholder and
@@ -625,6 +645,8 @@ export declare function taskPrompt(input: {
625
645
  terminals?: readonly string[];
626
646
  /** Auto Handoff facts, one per line, as `handoffTaskFacts` gives them (`handoff` task). */
627
647
  handoff?: readonly string[];
648
+ /** Network Guard facts, one per line, as `networkTaskFacts` gives them (`network` task, spec §3.35). */
649
+ network?: readonly string[];
628
650
  };
629
651
  /** Files saved for the task (spec §3.28 "附件"): absolute paths and their kind. */
630
652
  attachments?: readonly {
@@ -961,6 +961,27 @@ export function stripSecrets(text) {
961
961
  });
962
962
  return { text: out, removed };
963
963
  }
964
+ /**
965
+ * Network Guard facts for the `network` AI Task (spec §3.35), one plain line each, from the Panel state's `network`:
966
+ * the switch, the allowed countries and the newest result per address. No address is ever in it, only countries.
967
+ */
968
+ export function networkTaskFacts(n) {
969
+ const out = [`guard: ${n.guard ? 'on' : 'off'}`, `allow: ${n.allow.join(', ') || 'none'}`];
970
+ for (const t of n.targets) {
971
+ let host = t.url;
972
+ try {
973
+ host = new URL(t.url).hostname;
974
+ }
975
+ catch {
976
+ // keep the URL
977
+ }
978
+ out.push(`${host}: ${t.status}${t.loc ? `, country ${t.loc}` : ''}${t.checkedAt ? `, checked ${t.checkedAt}` : ''}${t.error ? `, ${t.error}` : ''} (${t.accounts.join(', ')})`);
979
+ }
980
+ for (const a of n.accounts)
981
+ if (a.skip)
982
+ out.push(`${a.ref}: not checked here (${a.skip})`);
983
+ return out;
984
+ }
964
985
  /** The kinds of AI Task (spec §3.28); anything else is refused. */
965
986
  export const AI_TASK_KINDS = [
966
987
  'free',
@@ -974,6 +995,7 @@ export const AI_TASK_KINDS = [
974
995
  'handoff',
975
996
  'menubar',
976
997
  'hotkey',
998
+ 'network',
977
999
  ];
978
1000
  /**
979
1001
  * The message keys of the AI dialog for `task` (spec §3.28 "每个入口的提示"): its title, the text box placeholder and
@@ -1080,6 +1102,9 @@ export function taskPrompt(input, strip) {
1080
1102
  pHotkey: '先运行 `sideby menubar hotkey --json` 看现在用的组合。再查本机已经被占的组合:`defaults read com.apple.symbolichotkeys AppleSymbolicHotKeys` 里 enabled 为 1 的系统快捷键,以及 `/Applications` 里装了哪些常用全局快捷键的 App(Raycast、Alfred、ChatGPT、Claude 等),按它们的默认快捷键判断;不要打开它们的配置文件(里面可能有密钥),拿不准就问我。问我习惯用哪只手、平时常按哪些快捷键,然后推荐 2 到 3 个按起来顺手、又没被占的组合(两个键最顺手,比如 ⌥X;必须带 ⌥、⌘ 或 ⌃),说清每个会占掉什么(比如 ⌥X 不能再打出 ≈)。我选定后运行 `sideby menubar hotkey <组合>`,几秒内生效,不用重启;再请我按一下,确认能打开菜单。按了没反应,说明别的 App 先占了,换下一个。不要改系统或别的 App 的快捷键设置。',
1081
1103
  pMenubar: '先运行 `sideby menubar --json`。`state` 为 `off`:它被关掉了(常见于菜单里的「从状态栏隐藏…」),给我看 `sideby menubar on` 的预览,我同意后加 `--yes`。`state` 为 `on` 但 `loaded` 为 `false`:macOS 没在运行它,`sideby menubar on --yes` 只是重新启动,不改文件。`loaded` 为 `true`:它在运行但被挡住了,依次查:状态栏是否太满或被刘海挡住(按住 ⌘ 拖动图标);有没有 Ice、Bartender、Hidden Bar 这类菜单栏整理工具把它收起来了(查 `/Applications`,告诉我去它的设置里把 sideby(显示为 osascript)挪出来);macOS 26 及以上要在「系统设置 › 菜单栏」里允许 osascript(`sideby menubar --json` 里的快捷键 `hotkey.label` 可以在任何地方打开菜单,用来确认它在运行)。不要结束或重启任何不是 sideby 的进程。',
1082
1104
  cHandoff: '自动接力现在的设置(来自 `sideby handoff status --json`):',
1105
+ network: '帮我设置 sideby 的网络检查:请求要从我没允许的国家或地区发出时(比如代理断了、节点切错了),拦下 Claude 和 Codex。',
1106
+ cNetwork: '网络检查现在的情况(来自 `sideby network --json`):',
1107
+ pNetwork: '先运行 `sideby network check --json`,告诉我现在每个地址的请求从哪里发出。问我允许哪些国家或地区;不要替我决定,也不要因为现在在哪就把它加进去(网络不对时那正是错的地区)。我说了以后,先不加 `--yes` 跑 `sideby network allow <代码>... --json` 和 `sideby network on --json` 给我看预览,我同意后再加 `--yes`。告诉我:只检查 sideby 启动的会话;Codex 要在 `/hooks` 里信任一次 `network-hook`;临时跳过一次用 `sideby run <账号> --ignore-network`。被拦过的话,先帮我查代理(开没开、哪个节点),再跑 `sideby network check --json` 确认。它只防代理出意外,不会让在不支持的地区使用变得合规;不要帮我隐藏所在地(时区、指纹之类)。',
1083
1108
  pHandoff: '先运行 `sideby handoff status --json` 和 `sideby quota --json`,看清每个账号的额度来源和用量。只用 `sideby handoff enable …` 或 `sideby config set handoff.<键> <值>` 改设置;先不加 `--yes` 给我看预览,我同意后再加 `--yes`。没有额度数据的账号排在顺序后面,并告诉我怎么让它显示额度。',
1084
1109
  cAccount: '账号:',
1085
1110
  cFamily: '家族:',
@@ -1126,6 +1151,9 @@ export function taskPrompt(input, strip) {
1126
1151
  pHotkey: 'Run `sideby menubar hotkey --json` first to see the current shortcut. Then find the combinations already taken on this Mac: the system shortcuts with enabled 1 in `defaults read com.apple.symbolichotkeys AppleSymbolicHotKeys`, and the apps in /Applications that usually hold a global shortcut (Raycast, Alfred, ChatGPT, Claude and the like), judged by their default shortcuts; do not open their config files (they may hold keys), and ask me when unsure. Ask which hand I use and which shortcuts I press often, then recommend 2 or 3 combinations that are easy to press and free (two keys are easiest, such as ⌥X; each needs ⌥, ⌘ or ⌃), and say what each takes away (⌥X no longer types ≈). Once I pick one, run `sideby menubar hotkey <keys>`: it works within seconds, with no restart; then ask me to press it and check the menu opens. If nothing happens another app took it first, so try the next. Never change the shortcuts of macOS or another app.',
1127
1152
  pMenubar: 'Run `sideby menubar --json` first. `state` is `off`: it was turned off (often with "Hide from Menu Bar…" in its menu); show me the preview of `sideby menubar on`, and add `--yes` after I agree. `state` is `on` with `loaded: false`: macOS is not running it; `sideby menubar on --yes` only starts it again and changes no file. `loaded: true`: it runs but is hidden; check in turn whether the menu bar is too full or the notch covers it (hold ⌘ and drag icons), whether a menu bar organizer such as Ice, Bartender or Hidden Bar tucked it away (look in /Applications, and tell me where in its settings to move sideby, shown as osascript, out), and, on macOS 26 and later, whether osascript is allowed under System Settings › Menu Bar. The shortcut in `hotkey.label` opens the menu from anywhere, which shows it is running. Never end or restart a process that is not sideby\'s.',
1128
1153
  cHandoff: 'Auto Handoff now (from `sideby handoff status --json`):',
1154
+ network: "Help me set up sideby's network check: stop Claude and Codex when my requests would leave from a country I did not allow (for example when the proxy stopped or a node in the wrong country is picked).",
1155
+ cNetwork: 'Network check now (from `sideby network --json`):',
1156
+ pNetwork: "Run `sideby network check --json` first and tell me where each address's requests leave from now. Ask me which countries to allow; never decide for me, and never add the current country because it is current (on a wrong network that is the wrong one). Once I say, run `sideby network allow <codes>... --json` and `sideby network on --json` without `--yes` to show me the change, and add `--yes` after I agree. Tell me: only sessions sideby starts are checked; in Codex I trust `network-hook` once in `/hooks`; `sideby run <account> --ignore-network` skips it once. If something was blocked, help me check the proxy (is it on, which node) first, then run `sideby network check --json` to confirm. It guards against proxy accidents; it does not make use from an unsupported region allowed, and never help hide where I am (time zone, fingerprints).",
1129
1157
  pHandoff: 'Run `sideby handoff status --json` and `sideby quota --json` first to see where each account gets its quota and how much is used. Change settings only with `sideby handoff enable …` or `sideby config set handoff.<key> <value>`; show me the preview without `--yes` first, and add `--yes` only after I agree. Put accounts without quota data last in the order, and tell me how to make them show it.',
1130
1158
  cAccount: 'Account: ',
1131
1159
  cFamily: 'Family: ',
@@ -1195,6 +1223,11 @@ export function taskPrompt(input, strip) {
1195
1223
  if (lines.length)
1196
1224
  facts.push('- ' + L.cHandoff, ...lines.map((l) => ' - ' + l));
1197
1225
  }
1226
+ if (task === 'network') {
1227
+ const lines = (c.network || []).map(clean).filter(Boolean);
1228
+ if (lines.length)
1229
+ facts.push('- ' + L.cNetwork, ...lines.map((l) => ' - ' + l));
1230
+ }
1198
1231
  const version = clean(c.version);
1199
1232
  if (version)
1200
1233
  facts.push('- ' + L.cVersion + version);
@@ -3,7 +3,7 @@
3
3
  import { groupsToAccept } from '../core/inbound.js';
4
4
  import { quotaIsStale } from '../core/quota-levels.js';
5
5
  import { remoteControlTodo } from '../core/remote-control.js';
6
- import { aiTaskAccounts, aliasArgsOf, aliasIssue, askBridge, askBridged, askCopy, attentionReasons, attentionWhy, autostartNote, bindingWindow, cacheHitRate, canLeaveLocal, categoryOrder, codeSwapOutcome, dotsKeepKeyboard, enableOutcome, fileSize, fixPrompt, foldSkips, foldToolCalls, formatDuration, handoffChangeOf, handoffHintAccount, handoffTaskFacts, hiddenIn, highlightParts, histFilters, historyEmpty, historyWhen, hotkeyFromKey, hotkeyPressKind, inDisplayOrder, loginClusters, loginKey, maskEmail, matchesQuery, mdBlocks, mdInline, menuPlacement, mergeDaily, mergeUsage, messageChip, messageNews, newAccountDir, nextReset, panelFixes, panelHint, panelLang, panelMigration, panelPrefs, passedWindow, pinnedIn, quotaAskable, quotaHighLevel, quotaPressure, radioStep, remoteControlSummary, reorder, rowBadge, runCodeSwap, saveHandoffChange, sendBlock, sendFileProblem, sendResultView, sessionAge, sessionLabelParts, shortCwd, shortSessionLabel, sortAccounts, sortSessions, steadyOrder, stripSecrets, suggestAlias, suggestName, switchFailure, tailInView, taskFindings, updatedAge, widthFollower, widthTier, windowState, withPinned, } from './page-logic.js';
6
+ import { aiTaskAccounts, aliasArgsOf, aliasIssue, askBridge, askBridged, askCopy, attentionReasons, attentionWhy, autostartNote, bindingWindow, cacheHitRate, canLeaveLocal, categoryOrder, codeSwapOutcome, dotsKeepKeyboard, enableOutcome, fileSize, fixPrompt, foldSkips, foldToolCalls, formatDuration, handoffChangeOf, handoffHintAccount, handoffTaskFacts, hiddenIn, highlightParts, histFilters, historyEmpty, historyWhen, hotkeyFromKey, hotkeyPressKind, inDisplayOrder, loginClusters, loginKey, maskEmail, matchesQuery, mdBlocks, mdInline, menuPlacement, mergeDaily, mergeUsage, messageChip, messageNews, networkTaskFacts, newAccountDir, nextReset, panelFixes, panelHint, panelLang, panelMigration, panelPrefs, passedWindow, pinnedIn, quotaAskable, quotaHighLevel, quotaPressure, radioStep, remoteControlSummary, reorder, rowBadge, runCodeSwap, saveHandoffChange, sendBlock, sendFileProblem, sendResultView, sessionAge, sessionLabelParts, shortCwd, shortSessionLabel, sortAccounts, sortSessions, steadyOrder, stripSecrets, suggestAlias, suggestName, switchFailure, tailInView, taskFindings, updatedAge, widthFollower, widthTier, windowState, withPinned, } from './page-logic.js';
7
7
  const LOGIC = [
8
8
  quotaIsStale,
9
9
  aiTaskAccounts,
@@ -34,6 +34,7 @@ const LOGIC = [
34
34
  handoffChangeOf,
35
35
  handoffHintAccount,
36
36
  handoffTaskFacts,
37
+ networkTaskFacts,
37
38
  inDisplayOrder,
38
39
  loginClusters,
39
40
  loginKey,
@@ -5703,6 +5704,7 @@ const MAIN = String.raw `
5703
5704
  if (S.state && rcSummary()) out.push('rc')
5704
5705
  if (S.state && ahState()) out.push('ah')
5705
5706
  if (S.state && (S.state.quotaChecks || []).length) out.push('checks')
5707
+ if (S.state && S.state.network) out.push('net')
5706
5708
  return out
5707
5709
  }
5708
5710
  function renderSettingsButton() {
@@ -5714,6 +5716,7 @@ const MAIN = String.raw `
5714
5716
  b.setAttribute('aria-label', t('set.button') + (warn ? colon() + t('set.rcOn') : ''))
5715
5717
  refreshSettings()
5716
5718
  if (dlg.kind === 'rc') renderRc()
5719
+ if (dlg.kind === 'net' && net && !net.busy) renderNet()
5717
5720
  }
5718
5721
  // The settings live in two places (spec §3.29, 2026-10-20). The header popover holds only what people change
5719
5722
  // often, one click each and no explanations: language, theme, Auto Handoff, asking an AI, and "All settings…".
@@ -5794,6 +5797,13 @@ const MAIN = String.raw `
5794
5797
  h('button', { class: 'seg-btn', type: 'button', 'aria-pressed': String(v === c.on), onclick: () => { if (v !== c.on) { leave(false); setCheck(c.family, v) } } }, text)))))
5795
5798
  }
5796
5799
  }
5800
+ // Network Guard (spec §3.35): its own dialog, with the state on the link.
5801
+ const netItems = []
5802
+ if (secs.includes('net')) {
5803
+ const n = S.state.network
5804
+ const bad = netProblem()
5805
+ netItems.push(link(t('net.title'), bad ? t('net.blocked') : n.guard ? t('ah.on') : t('ah.off'), bad ? 'chip-fail' : n.guard ? 'chip-ok' : '', openNet, true))
5806
+ }
5797
5807
  // Everything here can also be asked of an AI assistant through the sideby skill (spec §3.8).
5798
5808
  const ai = [aiLink(leave), link(t('ask.plugin'), '', '', () => openAsk({ task: 'plugin', context: { version: BOOT.version } }), true)]
5799
5809
  return [
@@ -5802,6 +5812,7 @@ const MAIN = String.raw `
5802
5812
  { id: 'accounts', title: t('set.g.accounts'), items: acct },
5803
5813
  { id: 'quota', title: t('set.g.quota'), items: checks, foot: t('set.quotaChecksHint', { n: every }) },
5804
5814
  { id: 'handoff', title: t('ah.button'), items: [ahLink(leave)].filter(Boolean), foot: t('set.ahHint') },
5815
+ { id: 'network', title: t('net.title'), items: netItems, foot: t('net.hint') },
5805
5816
  { id: 'ai', title: t('set.g.ai'), items: ai, foot: t('set.aiHint') },
5806
5817
  ].filter((g) => g.items.length)
5807
5818
  }
@@ -6170,7 +6181,122 @@ const MAIN = String.raw `
6170
6181
  return Boolean(u && u.skillUpdate && u.skillUpdate.installed && u.skillUpdate.installed.length)
6171
6182
  }
6172
6183
  // Example phrases: a click puts one in the Let AI do it box (spec §3.28).
6173
- const AI_ASKS = ['ai.ask.quota', 'ai.ask.pick', 'ai.ask.new', 'ai.ask.api', 'ai.ask.pin', 'ai.ask.hide', 'ai.ask.relogin', 'ai.ask.fix', 'ai.ask.handoff', 'ai.ask.handoffRules', 'ai.ask.session', 'ai.ask.history', 'ai.ask.send', 'ai.ask.inbound', 'ai.ask.menubar', 'ai.ask.rc', 'ai.ask.theme', 'ai.ask.tool']
6184
+ const AI_ASKS = ['ai.ask.quota', 'ai.ask.pick', 'ai.ask.new', 'ai.ask.api', 'ai.ask.pin', 'ai.ask.hide', 'ai.ask.relogin', 'ai.ask.fix', 'ai.ask.handoff', 'ai.ask.handoffRules', 'ai.ask.session', 'ai.ask.history', 'ai.ask.send', 'ai.ask.inbound', 'ai.ask.menubar', 'ai.ask.rc', 'ai.ask.network', 'ai.ask.theme', 'ai.ask.tool']
6185
+ // Network Guard (spec §3.35): one dialog with the switch, the allowed countries and the newest result per address.
6186
+ // Countries are never ticked for the user, the current one included: a wrong network would allow itself.
6187
+ const NET_COMMON = ['US', 'JP', 'SG', 'GB', 'DE', 'FR', 'NL', 'CA', 'AU', 'KR', 'TW', 'HK']
6188
+ let net = null
6189
+ function netState() { return S.state && S.state.network }
6190
+ function netProblem() {
6191
+ const n = netState()
6192
+ return n && n.active ? n.targets.find((x) => x.status === 'blocked' || x.status === 'unknown') || null : null
6193
+ }
6194
+ function netCountry(code) {
6195
+ const name = t('net.cty.' + code)
6196
+ if (name === 'net.cty.' + code) return code
6197
+ return lang === 'zh' ? name + '(' + code + ')' : name + ' (' + code + ')'
6198
+ }
6199
+ // "A, B or C" in English, "A、B、C" in Chinese.
6200
+ function netList(items) {
6201
+ if (items.length < 2) return items.join('')
6202
+ return items.slice(0, -1).join(t('net.listSep')) + t('net.listLast') + items[items.length - 1]
6203
+ }
6204
+ function openNet() {
6205
+ const n = netState()
6206
+ if (!n) return
6207
+ net = { guard: n.guard, allow: [...n.allow], busy: false, checking: false }
6208
+ showDialog('net')
6209
+ renderNet()
6210
+ // Opening it answers "where am I now" at once, unless a result is fresh.
6211
+ if (!n.targets.some((x) => x.checkedAt && Date.now() - Date.parse(x.checkedAt) < 60000)) netCheck()
6212
+ }
6213
+ async function netCheck() {
6214
+ if (!net) net = { guard: false, allow: [], busy: false, checking: false }
6215
+ net.checking = true
6216
+ if (dlg.kind === 'net') renderNet()
6217
+ renderBanners()
6218
+ try { S.state.network = await api('/api/network/check', {}) } catch (e) { toast(t('net.checkFailed', { msg: e.message }), { kind: 'fail' }) }
6219
+ net.checking = false
6220
+ if (dlg.kind === 'net') renderNet()
6221
+ renderBanners()
6222
+ }
6223
+ async function netSave() {
6224
+ net.busy = true
6225
+ renderNet()
6226
+ try {
6227
+ await api('/api/network/settings', { guard: net.guard, allow: net.allow, confirm: true })
6228
+ toast(t(net.guard ? 'net.savedOn' : 'net.savedOff'))
6229
+ await load({ silent: true })
6230
+ if (dlg.kind === 'net') dlg.el.close()
6231
+ } catch (e) { toast(e.message, { kind: 'fail' }) }
6232
+ if (net) net.busy = false
6233
+ if (dlg.kind === 'net') renderNet()
6234
+ }
6235
+ function renderNet() {
6236
+ const n = netState()
6237
+ if (!n || !net) return
6238
+ const here = new Set(n.targets.map((x) => x.loc).filter(Boolean))
6239
+ const list = [...new Set([...NET_COMMON, ...net.allow, ...here])]
6240
+ const changed = net.guard !== n.guard || net.allow.join() !== n.allow.join()
6241
+ const toggle = (c) => {
6242
+ net.allow = net.allow.includes(c) ? net.allow.filter((x) => x !== c) : [...net.allow, c]
6243
+ renderNet()
6244
+ }
6245
+ const sw = h('div', { class: 'set-row' }, h('span', { class: 'set-label' }, t('net.switch')),
6246
+ h('div', { class: 'seg', role: 'group', 'aria-label': t('net.switch') }, [[true, t('ah.on')], [false, t('ah.off')]].map(([v, text]) =>
6247
+ h('button', { class: 'seg-btn', type: 'button', 'data-key': 'net-sw-' + v, disabled: BOOT.readOnly || net.busy || (v && !net.allow.length), 'aria-pressed': String(net.guard === v), onclick: () => { net.guard = v; renderNet() } }, text))))
6248
+ const countries = h('div', { class: 'net-countries', role: 'group', 'aria-label': t('net.allow') }, list.map((c) =>
6249
+ h('button', { class: 'net-cty', type: 'button', 'data-key': 'net-cty-' + c, disabled: BOOT.readOnly || net.busy, 'aria-pressed': String(net.allow.includes(c)), onclick: () => toggle(c) },
6250
+ netCountry(c), here.has(c) ? h('span', { class: 'chip chip-sm' }, t('net.current')) : null)))
6251
+ const status = (x) => x.status === 'ok' ? ['chip-ok', t('net.ok')] : x.status === 'blocked' ? ['chip-fail', t('net.blocked')] : x.status === 'unknown' ? ['chip-fail', t('net.unknown')] : ['', t('net.notChecked')]
6252
+ const rows = n.targets.map((x) => {
6253
+ const [cls, label] = n.allow.length || x.status === 'not-checked' ? status(x) : ['', t('net.seen')]
6254
+ return h('li', { class: 'rc-row' },
6255
+ h('div', null, h('code', null, new URL(x.url).hostname), ' ', x.loc ? h('b', null, netCountry(x.loc)) : null, ' ', h('span', { class: 'chip chip-sm ' + cls }, label)),
6256
+ h('div', { class: 'muted small' }, [x.checkedAt ? t('net.checked', { when: ago(x.checkedAt) }) : null, x.error || null, x.accounts.join(', ')].filter(Boolean).join(' · ')),
6257
+ x.ipChanged ? h('div', { class: 'muted small' }, t('net.ipChanged')) : null)
6258
+ })
6259
+ const skipped = n.accounts.filter((a) => a.skip === 'third-party' || a.skip === 'at-launch')
6260
+ const body = [
6261
+ h('p', { class: 'small' }, t('net.explain')),
6262
+ h('div', { class: 'row-actions' },
6263
+ h('button', { class: 'btn btn-sm', type: 'button', 'data-key': 'net-ask', onclick: askNetwork }, icon('bot'), t('ask.title.network'))),
6264
+ sw,
6265
+ h('div', { class: 'set-label' }, t('net.allow')),
6266
+ countries,
6267
+ !net.allow.length ? h('p', { class: 'small muted', 'data-enter': 'net-pick' }, t(net.guard ? 'net.keepOne' : 'net.pickFirst')) : null,
6268
+ h('div', { class: 'set-row' }, h('span', { class: 'set-label' }, t('net.now')),
6269
+ h('button', { class: 'btn btn-sm', type: 'button', 'data-key': 'net-check', disabled: net.checking, 'aria-busy': net.checking ? 'true' : null, onclick: netCheck }, net.checking ? spinner() : icon('refresh'), t('net.recheck'))),
6270
+ rows.length ? h('ul', { class: 'rc-list' }, rows) : h('p', { class: 'small muted' }, t('net.noTargets')),
6271
+ skipped.length ? h('p', { class: 'small muted' }, t('net.skipped', { refs: skipped.map((a) => a.ref).join(', ') })) : null,
6272
+ h('p', { class: 'small muted' }, t('net.notCovered')),
6273
+ BOOT.readOnly ? h('p', { class: 'small' }, t('rc.readOnlyBoth')) : null,
6274
+ ]
6275
+ const foot = [h('button', { class: 'btn', type: 'button', 'data-key': 'net-close', disabled: net.busy, onclick: () => dlg.el.close() }, t(changed ? 'btn.cancel' : 'btn.close'))]
6276
+ if (!BOOT.readOnly && changed) foot.push(h('button', { class: 'btn btn-primary', type: 'button', 'data-key': 'net-save', 'data-enter': 'net-save', disabled: net.busy || (net.guard && !net.allow.length), 'aria-busy': net.busy ? 'true' : null, onclick: netSave }, net.busy ? spinner() : null, t('net.save')))
6277
+ swapKids(dlg.el, dialogFrame(t('net.title'), null, body, foot))
6278
+ }
6279
+ // Let AI do it (spec §3.28): the AI asks which countries, shows the change and writes it after the user agrees.
6280
+ function askNetwork() {
6281
+ const n = netState()
6282
+ if (!n) return
6283
+ openAsk({ task: 'network', context: { network: networkTaskFacts(n), version: BOOT.version } })
6284
+ }
6285
+ // Where the problem shows: a banner on every page while the guard is on and the exit is wrong or unknown.
6286
+ function netBanner() {
6287
+ const x = netProblem()
6288
+ if (!x) return null
6289
+ const n = netState()
6290
+ const text = x.status === 'blocked'
6291
+ ? t('net.bannerBlocked', { cty: netCountry(x.loc), allow: netList(n.allow.map(netCountry)) })
6292
+ : t('net.bannerUnknown', { why: x.error || '' })
6293
+ return h('div', { class: 'banner banner-warn', role: 'status', 'data-enter': 'net-banner' },
6294
+ h('div', null, h('b', null, t('net.bannerTitle') + (lang === 'zh' ? '' : ' ')), text),
6295
+ h('div', { class: 'banner-actions' },
6296
+ h('button', { class: 'btn btn-sm btn-primary', type: 'button', 'data-key': 'net-banner-check', disabled: Boolean(net && net.checking), 'aria-busy': net && net.checking ? 'true' : null, onclick: netCheck }, net && net.checking ? spinner() : null, t('net.recheck')),
6297
+ h('button', { class: 'btn btn-sm', type: 'button', onclick: openNet }, t('net.title')),
6298
+ h('button', { class: 'btn btn-sm', type: 'button', onclick: askNetwork }, icon('bot'), t('ask.title.network'))))
6299
+ }
6174
6300
  function openRc() {
6175
6301
  if (!S.state || !rcSummary()) return
6176
6302
  rc.target = null
@@ -7099,6 +7225,8 @@ const MAIN = String.raw `
7099
7225
  if (rcBanner) out.push(rcBanner)
7100
7226
  const inbBanner = inboundBanner()
7101
7227
  if (inbBanner) out.push(inbBanner)
7228
+ const nb = netBanner()
7229
+ if (nb) out.push(nb)
7102
7230
  const errs = S.state.pluginErrors
7103
7231
  if (errs.length) out.push(h('div', { class: 'banner banner-warn', role: 'status' }, h('div', null,
7104
7232
  h('b', null, tn('banner.plugins', errs.length) + ' '), t('banner.pluginsHint'),
@@ -559,16 +559,24 @@ a.btn:hover { text-decoration: none; }
559
559
  .error-note { justify-content: space-between; gap: 12px; }
560
560
  .error-note > span { min-width: 0; overflow-wrap: anywhere; }
561
561
  .error-note > .note-sub { flex-basis: 100%; color: var(--text); }
562
- .banner { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 11px 14px; border-radius: calc(var(--radius) - 2px); margin-bottom: 12px; border: 1px solid var(--border); background: var(--surface); }
562
+ .banner { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 11px 14px; border-radius: calc(var(--radius) - 2px); margin-bottom: 12px; border: 1px solid var(--border); background: var(--surface); }
563
563
  .banner > div { min-width: 0; }
564
+ /* The text takes the room; buttons that no longer fit beside it move below it instead of squeezing it. */
565
+ .banner > div:not(.banner-actions) { flex: 1 1 260px; }
564
566
  .banner-quiet { padding: 8px 14px; background: transparent; border-style: dashed; }
565
567
  .banner-fail { background: var(--fail-soft); border-color: transparent; color: var(--fail); }
566
568
  .banner-warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
567
569
  .banner ul { margin: 6px 0 0; padding-left: 18px; }
570
+ .net-countries { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; }
571
+ .net-cty { display: inline-flex; align-items: center; gap: 4px; height: var(--ctl-h-sm); padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; font-size: var(--control-size); cursor: pointer; transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease; }
572
+ .net-cty:hover { background: var(--hover); }
573
+ .net-cty[aria-pressed=true] { background: var(--active); border-color: var(--accent); font-weight: var(--strong-weight); }
574
+ .net-cty .chip { margin-left: 2px; }
575
+ @media (prefers-reduced-motion: reduce) { .net-cty { transition: none; } }
568
576
  .rc-list { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 8px; }
569
577
  .rc-row { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; display: grid; gap: 2px; }
570
578
  .rc-row code { word-break: break-all; }
571
- .banner-actions { display: flex; gap: 8px; flex: none; }
579
+ .banner-actions { display: flex; flex-wrap: wrap; gap: 8px; flex: 0 1 auto; }
572
580
  .hp-rules { list-style: none; margin: 0; padding: 0; counter-reset: hp-rule; display: flex; flex-direction: column; }
573
581
  .hp-rules > li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border); }
574
582
  .hp-rules > li:last-child { border-bottom: 0; }
@@ -983,7 +991,7 @@ select:is(:hover, :focus) { --chevron: var(--text); }
983
991
  .tagline { display: none; }
984
992
  .brand .logo { width: 34px; height: 34px; }
985
993
  .brand h1 { font-size: 19px; }
986
- .banner { flex-direction: column; }
994
+ .banner > div:not(.banner-actions) { flex-basis: 100%; }
987
995
  .stat { padding: 11px 13px; align-items: flex-start; flex-direction: column; gap: 6px; }
988
996
  .stat-value { font-size: 19px; }
989
997
  .stat-sub { white-space: normal; }