sideby 0.42.2 → 0.44.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 (66) hide show
  1. package/ai-tasks.json +10 -0
  2. package/dist/build.json +1 -1
  3. package/dist/src/cli/commands.js +54 -13
  4. package/dist/src/cli/json-schemas.js +65 -1
  5. package/dist/src/cli/main.js +11 -4
  6. package/dist/src/core/ask.d.ts +8 -14
  7. package/dist/src/core/ask.js +66 -30
  8. package/dist/src/core/egress.d.ts +5 -0
  9. package/dist/src/core/egress.js +32 -2
  10. package/dist/src/core/file-memo.d.ts +2 -0
  11. package/dist/src/core/file-memo.js +20 -0
  12. package/dist/src/core/handoff-run.js +41 -8
  13. package/dist/src/core/handoff-select.d.ts +5 -0
  14. package/dist/src/core/handoff-select.js +1 -1
  15. package/dist/src/core/handoff.d.ts +78 -1
  16. package/dist/src/core/handoff.js +100 -9
  17. package/dist/src/core/history-index.d.ts +4 -0
  18. package/dist/src/core/history-index.js +1 -1
  19. package/dist/src/core/live-sessions.d.ts +5 -0
  20. package/dist/src/core/live-sessions.js +12 -1
  21. package/dist/src/core/memo-store.js +32 -8
  22. package/dist/src/core/network.d.ts +37 -0
  23. package/dist/src/core/network.js +65 -1
  24. package/dist/src/core/pick-commands.d.ts +7 -1
  25. package/dist/src/core/pick-commands.js +15 -3
  26. package/dist/src/core/pick-records.d.ts +26 -0
  27. package/dist/src/core/pick-records.js +81 -0
  28. package/dist/src/families/agy/history.d.ts +2 -0
  29. package/dist/src/families/agy/history.js +118 -0
  30. package/dist/src/families/agy/index.js +5 -0
  31. package/dist/src/families/agy/quota.d.ts +5 -1
  32. package/dist/src/families/agy/quota.js +111 -10
  33. package/dist/src/families/history.js +2 -1
  34. package/dist/src/families/quota-watch.d.ts +12 -0
  35. package/dist/src/families/quota-watch.js +24 -0
  36. package/dist/src/network/hook.js +4 -4
  37. package/dist/src/network/page-script.d.ts +40 -0
  38. package/dist/src/network/page-script.js +270 -0
  39. package/dist/src/network/page.d.ts +11 -0
  40. package/dist/src/network/page.js +189 -0
  41. package/dist/src/network/panel.d.ts +5 -0
  42. package/dist/src/network/panel.js +7 -0
  43. package/dist/src/panel/changes.d.ts +57 -0
  44. package/dist/src/panel/changes.js +178 -0
  45. package/dist/src/panel/handler.d.ts +59 -1
  46. package/dist/src/panel/handler.js +374 -99
  47. package/dist/src/panel/i18n.d.ts +49 -0
  48. package/dist/src/panel/i18n.js +100 -2
  49. package/dist/src/panel/page-logic.d.ts +37 -3
  50. package/dist/src/panel/page-logic.js +106 -12
  51. package/dist/src/panel/page-script.js +194 -27
  52. package/dist/src/panel/page-styles.js +18 -8
  53. package/dist/src/panel/page.js +3 -1
  54. package/dist/src/runtime.d.ts +55 -5
  55. package/dist/src/runtime.js +105 -12
  56. package/dist/src/types.d.ts +3 -2
  57. package/package.json +1 -1
  58. package/schemas/network-diagnose.json +196 -0
  59. package/schemas/next.json +67 -2
  60. package/skills/sideby/SKILL.md +3 -2
  61. package/skills/sideby/references/accounts.md +1 -1
  62. package/skills/sideby/references/ai-tasks.md +1 -1
  63. package/skills/sideby/references/handoff.md +6 -2
  64. package/skills/sideby/references/network.md +6 -1
  65. package/skills/sideby/references/quota.md +1 -1
  66. package/skills/sideby/references/sessions.md +1 -1
@@ -6,6 +6,8 @@ declare const en: {
6
6
  'top.loading': string;
7
7
  'top.refreshing': string;
8
8
  'top.updated': string;
9
+ 'top.updatedLive': string;
10
+ 'top.updatedTitleLive': string;
9
11
  'top.updatedTitle': string;
10
12
  'top.stale': string;
11
13
  'foot.text': string;
@@ -153,6 +155,27 @@ declare const en: {
153
155
  'stat.sessions.other': string;
154
156
  'stat.nextReset': string;
155
157
  'stat.noQuota': string;
158
+ 'stat.pickNow': string;
159
+ 'stat.pickNowIn': string;
160
+ 'stat.pickLeft': string;
161
+ 'stat.pickReset': string;
162
+ 'stat.pickTight': string;
163
+ 'stat.pickNoData': string;
164
+ 'stat.pickStart': string;
165
+ 'stat.pickStartTip': string;
166
+ 'stat.pickCopy': string;
167
+ 'stat.pickCopyTip': string;
168
+ 'stat.pickOnly': string;
169
+ 'stat.pickOthers': string;
170
+ 'stat.pickUsedUp': string;
171
+ 'stat.pickBack': string;
172
+ 'stat.pickWait': string;
173
+ 'stat.pickNoQuota': string;
174
+ 'stat.pickNoQuotaTip': string;
175
+ 'stat.pickSignIn': string;
176
+ 'stat.pickNoSource': string;
177
+ 'stat.pickNoSourceOne': string;
178
+ 'stat.pickReading': string;
156
179
  'need.error.one': string;
157
180
  'need.error.other': string;
158
181
  'need.health-fail.one': string;
@@ -292,6 +315,12 @@ declare const en: {
292
315
  'acct.next': string;
293
316
  'acct.nextWhy': string;
294
317
  'acct.nextCopy': string;
318
+ 'acct.nextWhyRoom': string;
319
+ 'acct.nextWhyExpiring': string;
320
+ 'acct.nextWhyTight': string;
321
+ 'acct.nextWhyUnknown': string;
322
+ 'acct.nextRunning.one': string;
323
+ 'acct.nextRunning.other': string;
295
324
  'stat.needWho': string;
296
325
  'stat.needWhoMore': string;
297
326
  'acct.sameLogin': string;
@@ -655,6 +684,8 @@ declare const en: {
655
684
  'ask.copyPrompt': string;
656
685
  'ask.promptShown': string;
657
686
  'ask.showPrompt': string;
687
+ 'ask.actualPrompt': string;
688
+ 'ask.promptChanged': string;
658
689
  'ask.readOnly': string;
659
690
  'ask.opened': string;
660
691
  'ask.failed': string;
@@ -718,6 +749,8 @@ declare const en: {
718
749
  'pk.namePh': string;
719
750
  'pk.started': string;
720
751
  'pk.why.room': string;
752
+ 'pk.why.roomRunning': string;
753
+ 'pk.why.expiring': string;
721
754
  'pk.why.tight': string;
722
755
  'pk.why.noData': string;
723
756
  'login.opened': string;
@@ -784,6 +817,9 @@ declare const en: {
784
817
  'ask.ex.network.1': string;
785
818
  'ask.ex.network.2': string;
786
819
  'ask.ex.network.3': string;
820
+ 'ask.title.network-diagnose': string;
821
+ 'ask.task.network-diagnose': string;
822
+ 'ask.ph.network-diagnose': string;
787
823
  'ask.ph.theme': string;
788
824
  'ask.ex.theme.1': string;
789
825
  'ask.ex.theme.2': string;
@@ -1462,6 +1498,19 @@ declare const en: {
1462
1498
  'net.pickFirst': string;
1463
1499
  'net.now': string;
1464
1500
  'net.recheck': string;
1501
+ 'net.diagnose': string;
1502
+ 'net.diagnoseRefresh': string;
1503
+ 'net.diagnosing': string;
1504
+ 'net.diagnoseOffline': string;
1505
+ 'net.diagnoseRoute': string;
1506
+ 'net.diagnoseDirect': string;
1507
+ 'net.diagnoseNoLocalProbe': string;
1508
+ 'net.diagnoseListenerUp': string;
1509
+ 'net.diagnoseListenerDown': string;
1510
+ 'net.diagnoseTcpLimit': string;
1511
+ 'net.diagnoseUnsupported': string;
1512
+ 'net.diagnoseInvalid': string;
1513
+ 'net.diagnoseChecked': string;
1465
1514
  'net.ok': string;
1466
1515
  'net.blocked': string;
1467
1516
  'net.unknown': string;
@@ -8,6 +8,8 @@ const en = {
8
8
  'top.loading': 'Loading…',
9
9
  'top.refreshing': 'Refreshing…',
10
10
  'top.updated': 'Read {ago} · refreshes every {s} s',
11
+ 'top.updatedLive': 'Read {ago} · updates as quota changes',
12
+ 'top.updatedTitleLive': 'Quota, usage and health of each account, last read at {at}. The page reads them again as soon as a quota file changes, and every {s} s.',
11
13
  'top.updatedTitle': 'Quota, usage and health of every account, last read at {at}. They are read again every {s} s while this page is open.',
12
14
  'top.stale': 'Not refreshed: the panel cannot be reached or the last read failed.',
13
15
  'foot.text': 'runs on this machine; nothing leaves it.',
@@ -155,6 +157,27 @@ const en = {
155
157
  'stat.sessions.other': '{n} sessions',
156
158
  'stat.nextReset': 'Next quota reset',
157
159
  'stat.noQuota': 'No quota data',
160
+ 'stat.pickNow': 'Best to use now',
161
+ 'stat.pickNowIn': 'Best to use now · {title}',
162
+ 'stat.pickLeft': '{w} {n}% left',
163
+ 'stat.pickReset': '{w} reset',
164
+ 'stat.pickTight': 'all past their limit',
165
+ 'stat.pickNoData': 'no quota data for it yet',
166
+ 'stat.pickStart': 'Start',
167
+ 'stat.pickStartTip': 'Click to start it in a terminal.',
168
+ 'stat.pickCopy': 'Copy',
169
+ 'stat.pickCopyTip': 'Click to copy the command that starts it: sideby next {family}',
170
+ 'stat.pickOnly': 'Your only {title} account, and it has quota left.',
171
+ 'stat.pickOthers': 'Other tools:{list}',
172
+ 'stat.pickUsedUp': 'All used up',
173
+ 'stat.pickBack': '{ref} is back {when}',
174
+ 'stat.pickWait': 'wait for the next reset',
175
+ 'stat.pickNoQuota': 'No quota data yet',
176
+ 'stat.pickNoQuotaTip': 'A pick shows here once one of these accounts has quota data: start a session in one, or press Refresh.',
177
+ 'stat.pickSignIn': 'Sign in to an account first',
178
+ 'stat.pickNoSource': 'No subscription account here shows its quota',
179
+ 'stat.pickNoSourceOne': 'No subscription account of this tool shows its quota',
180
+ 'stat.pickReading': 'Reading quota…',
158
181
  'need.error.one': '{n} unreadable',
159
182
  'need.error.other': '{n} unreadable',
160
183
  'need.health-fail.one': '{n} with issues',
@@ -294,6 +317,12 @@ const en = {
294
317
  'acct.next': 'Suggested',
295
318
  'acct.nextWhy': 'Of the {title} accounts, this one has the most quota left, so it is the one to use next. sideby never switches by itself.',
296
319
  'acct.nextCopy': 'Copy the command that starts it',
320
+ 'acct.nextWhyRoom': 'Of the {title} accounts, this one leaves the most quota for each session already running on it, so new work spreads instead of piling onto one account. sideby never switches by itself.',
321
+ 'acct.nextWhyExpiring': "Of the {title} accounts, this one's weekly or monthly quota resets within a day, and what is left would be lost then, so use it first. sideby never switches by itself.",
322
+ 'acct.nextWhyTight': 'Every {title} account is past its limit; this one has the most left, so it is the one to use next. It may run out soon. sideby never switches by itself.',
323
+ 'acct.nextWhyUnknown': 'The {title} accounts with quota data are full; this one has no quota data yet, so it is the one to try next. sideby never switches by itself.',
324
+ 'acct.nextRunning.one': '1 session running on it',
325
+ 'acct.nextRunning.other': '{n} sessions running on it',
297
326
  'stat.needWho': '{names}',
298
327
  'stat.needWhoMore': '{names} and {n} more',
299
328
  'acct.sameLogin': 'Same login as {names}',
@@ -657,6 +686,8 @@ const en = {
657
686
  'ask.copyPrompt': 'Copy prompt',
658
687
  'ask.promptShown': 'the prompt',
659
688
  'ask.showPrompt': 'See the prompt',
689
+ 'ask.actualPrompt': 'Exact prompt to send',
690
+ 'ask.promptChanged': 'The prompt changed. Review the new prompt and confirm again; nothing was opened.',
660
691
  'ask.readOnly': 'This panel is read-only, so it cannot open a terminal. Copy the prompt and paste it into any AI.',
661
692
  'ask.opened': 'Opened {terminal} with {ref}. Carry on there.',
662
693
  'ask.failed': '{terminal} did not open.',
@@ -719,7 +750,9 @@ const en = {
719
750
  'pk.offerNoNameShort': 'Add short command',
720
751
  'pk.namePh': 'e.g. cc',
721
752
  'pk.started': 'Opened {ref} in {terminal} ({why}).',
722
- 'pk.why.room': '{w}{n}% used, most quota left',
753
+ 'pk.why.room': '{w}{n}% used, most quota left for each running session',
754
+ 'pk.why.roomRunning': '{w}{n}% used, {running} running, most quota left for each session',
755
+ 'pk.why.expiring': '{w}{n}% used; its weekly or monthly quota resets within a day, so it goes first',
723
756
  'pk.why.tight': 'every account is past its limit ({limit}% of a 5-hour window, {longLimit}% of a weekly one); this one has the most left, {w}{n}% used',
724
757
  'pk.why.noData': 'no quota data yet',
725
758
  'login.opened': 'Opened {terminal}: sign in to {ref} there.',
@@ -786,6 +819,9 @@ const en = {
786
819
  'ask.ex.network.1': 'I am in the US; stop everything when the proxy drops',
787
820
  'ask.ex.network.2': 'Allow only my Japan and Singapore nodes',
788
821
  'ask.ex.network.3': 'A message was blocked; help me check the proxy',
822
+ 'ask.title.network-diagnose': 'Let AI diagnose',
823
+ 'ask.task.network-diagnose': 'AI explains the offline route, listener and cached Guard facts. It is read-only and changes nothing.',
824
+ 'ask.ph.network-diagnose': 'No added text; the current diagnosis is included automatically',
789
825
  'ask.ph.theme': 'What feel do you want? A website or a color works too.',
790
826
  'ask.ex.theme.1': 'Quiet and gray, like Notion',
791
827
  'ask.ex.theme.2': 'Green, like my company site',
@@ -1464,6 +1500,19 @@ const en = {
1464
1500
  'net.pickFirst': 'Choose at least one country to turn it on. sideby never chooses for you, not even the current one.',
1465
1501
  'net.now': 'Where your requests leave from',
1466
1502
  'net.recheck': 'Check again',
1503
+ 'net.diagnose': 'Diagnose connection',
1504
+ 'net.diagnoseRefresh': 'Refresh diagnosis',
1505
+ 'net.diagnosing': 'Diagnosing…',
1506
+ 'net.diagnoseOffline': 'Offline only: reads the Guard cache and tests a selected local proxy TCP listener. It sends no online trace and never connects to a remote proxy.',
1507
+ 'net.diagnoseRoute': 'Selected route: {proxy}',
1508
+ 'net.diagnoseDirect': 'Direct connection; no proxy listener to test.',
1509
+ 'net.diagnoseNoLocalProbe': 'No local TCP listener probe: the proxy is remote, invalid, or has no explicit port for its scheme.',
1510
+ 'net.diagnoseListenerUp': 'TCP listener reachable at {host}:{port}.',
1511
+ 'net.diagnoseListenerDown': 'TCP listener not reachable at {host}:{port} ({error}).',
1512
+ 'net.diagnoseTcpLimit': 'TCP reachability does not prove that HTTP CONNECT, SOCKS or the upstream proxy works.',
1513
+ 'net.diagnoseUnsupported': 'This proxy scheme is not supported by Network Guard, which supports HTTP CONNECT only. Configure an HTTP proxy or direct connection, then check again.',
1514
+ 'net.diagnoseInvalid': 'The proxy address is invalid. Correct it in the environment and start a new session.',
1515
+ 'net.diagnoseChecked': 'Diagnosed {when}',
1467
1516
  'net.ok': 'allowed',
1468
1517
  'net.blocked': 'not allowed',
1469
1518
  'net.unknown': 'cannot tell',
@@ -1855,6 +1904,8 @@ const zh = {
1855
1904
  'top.loading': '加载中…',
1856
1905
  'top.refreshing': '刷新中…',
1857
1906
  'top.updated': '{ago}读取 · 每 {s} 秒自动刷新',
1907
+ 'top.updatedLive': '{ago}读取 · 额度一变就更新',
1908
+ 'top.updatedTitleLive': '各账号的额度、用量和健康状态,上次读取于 {at}。额度文件一变就立即重新读取,另外每 {s} 秒读取一次。',
1858
1909
  'top.updatedTitle': '各账号的额度、用量和健康状态,上次读取于 {at}。页面打开时每 {s} 秒重新读取一次。',
1859
1910
  'top.stale': '没有刷新:连不上面板,或上次读取失败。',
1860
1911
  'foot.text': '只在本机运行,数据不会离开这台电脑。',
@@ -2002,6 +2053,27 @@ const zh = {
2002
2053
  'stat.sessions.other': '{n} 个会话',
2003
2054
  'stat.nextReset': '下一次额度重置',
2004
2055
  'stat.noQuota': '暂无额度数据',
2056
+ 'stat.pickNow': '现在最该用',
2057
+ 'stat.pickNowIn': '现在最该用 · {title}',
2058
+ 'stat.pickLeft': '{w}剩 {n}%',
2059
+ 'stat.pickReset': '{w}已重置',
2060
+ 'stat.pickTight': '都过了提醒线',
2061
+ 'stat.pickNoData': '还没有它的额度数据',
2062
+ 'stat.pickStart': '启动',
2063
+ 'stat.pickStartTip': '点一下在终端里启动它。',
2064
+ 'stat.pickCopy': '复制',
2065
+ 'stat.pickCopyTip': '点一下复制启动它的命令:sideby next {family}',
2066
+ 'stat.pickOnly': '这是你唯一的 {title} 账号,还有额度。',
2067
+ 'stat.pickOthers': '其他工具:{list}',
2068
+ 'stat.pickUsedUp': '都用完了',
2069
+ 'stat.pickBack': '{ref} {when}恢复',
2070
+ 'stat.pickWait': '等下一次重置',
2071
+ 'stat.pickNoQuota': '还没有额度数据',
2072
+ 'stat.pickNoQuotaTip': '这些账号有了额度数据,这里就会推荐一个:在其中一个账号开个会话,或点「刷新」。',
2073
+ 'stat.pickSignIn': '先登录一个账号',
2074
+ 'stat.pickNoSource': '没有能看到额度的订阅账号',
2075
+ 'stat.pickNoSourceOne': '这个工具没有能看到额度的订阅账号',
2076
+ 'stat.pickReading': '正在读取额度…',
2005
2077
  'need.error.one': '{n} 个读取失败',
2006
2078
  'need.error.other': '{n} 个读取失败',
2007
2079
  'need.health-fail.one': '{n} 个有问题',
@@ -2141,6 +2213,12 @@ const zh = {
2141
2213
  'acct.next': '建议使用',
2142
2214
  'acct.nextWhy': '{title} 的账号里,这个剩余额度最多,接下来用它最合适。sideby 不会自己切换。',
2143
2215
  'acct.nextCopy': '复制启动它的命令',
2216
+ 'acct.nextWhyRoom': '{title} 的账号里,按已在跑的会话分摊后,这个每个会话分到的额度最多,新任务会分散开,不挤在一个账号上。sideby 不会自己切换。',
2217
+ 'acct.nextWhyExpiring': '{title} 的账号里,这个的周额度或月额度一天内就重置,剩下的到时会作废,所以先用它。sideby 不会自己切换。',
2218
+ 'acct.nextWhyTight': '{title} 的账号都已到上限,这个剩得最多,接下来用它,可能很快用完。sideby 不会自己切换。',
2219
+ 'acct.nextWhyUnknown': '{title} 里有额度数据的账号都满了,这个还没有额度数据,接下来先试它。sideby 不会自己切换。',
2220
+ 'acct.nextRunning.one': '它上面有 1 个会话在跑',
2221
+ 'acct.nextRunning.other': '它上面有 {n} 个会话在跑',
2144
2222
  'stat.needWho': '{names}',
2145
2223
  'stat.needWhoMore': '{names} 等 {n} 个',
2146
2224
  'acct.sameLogin': '与 {names} 同一登录',
@@ -2504,6 +2582,8 @@ const zh = {
2504
2582
  'ask.copyPrompt': '复制提示词',
2505
2583
  'ask.promptShown': '提示词',
2506
2584
  'ask.showPrompt': '查看提示词',
2585
+ 'ask.actualPrompt': '将发送的完整提示词',
2586
+ 'ask.promptChanged': '提示词有变化。请查看新提示词后再次确认;这次没有打开终端。',
2507
2587
  'ask.readOnly': '这个面板是只读的,不能打开终端。复制提示词,贴给任何 AI 就行。',
2508
2588
  'ask.opened': '已用 {ref} 打开 {terminal},请到那边继续。',
2509
2589
  'ask.failed': '{terminal} 没有打开。',
@@ -2566,7 +2646,9 @@ const zh = {
2566
2646
  'pk.offerNoNameShort': '添加短命令',
2567
2647
  'pk.namePh': '例如 cc',
2568
2648
  'pk.started': '已在 {terminal} 启动 {ref}({why})。',
2569
- 'pk.why.room': '{w}已用 {n}%,剩余额度最多',
2649
+ 'pk.why.room': '{w}已用 {n}%,按在跑的会话分摊后额度最多',
2650
+ 'pk.why.roomRunning': '{w}已用 {n}%,有 {running} 个会话在跑,每个会话分到的额度最多',
2651
+ 'pk.why.expiring': '{w}已用 {n}%;它的周额度或月额度一天内重置,所以先用它',
2570
2652
  'pk.why.tight': '所有账号都已到上限(5 小时窗口 {limit}%,每周窗口 {longLimit}%);这个剩得最多,{w}已用 {n}%',
2571
2653
  'pk.why.noData': '还没有额度数据',
2572
2654
  'login.opened': '已打开 {terminal},请在那里登录 {ref}。',
@@ -2633,6 +2715,9 @@ const zh = {
2633
2715
  'ask.ex.network.1': '我在美国,代理一断就全部拦住',
2634
2716
  'ask.ex.network.2': '只允许日本和新加坡节点',
2635
2717
  'ask.ex.network.3': '消息被拦了,帮我查查代理',
2718
+ 'ask.title.network-diagnose': '让 AI 诊断',
2719
+ 'ask.task.network-diagnose': 'AI 只读解释离线路由、listener 和缓存检查结果,不修改任何设置或文件。',
2720
+ 'ask.ph.network-diagnose': '无需补充;会自动带上当前诊断',
2636
2721
  'ask.ph.theme': '想要什么感觉?给个网址或颜色也行。',
2637
2722
  'ask.ex.theme.1': '素净的灰色,像 Notion',
2638
2723
  'ask.ex.theme.2': '绿色,和我们公司官网一样',
@@ -3311,6 +3396,19 @@ const zh = {
3311
3396
  'net.pickFirst': '至少选一个地区才能打开。sideby 不替你选,当前所在的地区也不会自动选上。',
3312
3397
  'net.now': '现在的请求从哪里发出',
3313
3398
  'net.recheck': '重新检查',
3399
+ 'net.diagnose': '诊断连接',
3400
+ 'net.diagnoseRefresh': '刷新诊断',
3401
+ 'net.diagnosing': '正在诊断…',
3402
+ 'net.diagnoseOffline': '只读离线诊断:读取缓存并测试本地代理的 TCP listener,不发在线 trace,也不连接远程代理。',
3403
+ 'net.diagnoseRoute': '本次选择的路由:{proxy}',
3404
+ 'net.diagnoseDirect': '直连,没有代理 listener 要测试。',
3405
+ 'net.diagnoseNoLocalProbe': '未探测本地 TCP listener:代理在远程、地址无效,或该协议没有明确端口。',
3406
+ 'net.diagnoseListenerUp': 'TCP listener 可连接:{host}:{port}。',
3407
+ 'net.diagnoseListenerDown': 'TCP listener 连不上:{host}:{port}({error})。',
3408
+ 'net.diagnoseTcpLimit': 'TCP 能连接不代表 HTTP CONNECT、SOCKS 或上游代理协议可用。',
3409
+ 'net.diagnoseUnsupported': 'Network Guard 只支持 HTTP CONNECT,不支持这个代理协议。请配置 HTTP 代理或直连后再检查。',
3410
+ 'net.diagnoseInvalid': '代理地址无效。请修正环境变量,再新开会话。',
3411
+ 'net.diagnoseChecked': '{when}诊断过',
3314
3412
  'net.ok': '允许',
3315
3413
  'net.blocked': '不允许',
3316
3414
  'net.unknown': '查不出',
@@ -259,6 +259,17 @@ export declare function nextReset(accounts: LogicAccount[], now: number): {
259
259
  name: string;
260
260
  family: string;
261
261
  } | null;
262
+ /**
263
+ * Which tool the "Best to use now" card shows (spec §3.45): the one the family filter names, else the first in the
264
+ * page's group `order` with a pick, else the first with an entry, so the card says why nothing can be picked. Quota
265
+ * is never compared across tools. `others`: every other tool with an entry, in `order`, for the hover text.
266
+ */
267
+ export declare function pickNowChoice(pickNow: Record<string, {
268
+ pick: string | null;
269
+ }> | undefined, order: string[], filter: string): {
270
+ family: string;
271
+ others: string[];
272
+ } | null;
262
273
  /**
263
274
  * A name to offer for a new Account of a Family, given its existing Account names (`main` included or not).
264
275
  * Numbered names (`001` … `007`) continue after the highest number with the same width (`008`); otherwise
@@ -684,8 +695,9 @@ export declare function loginKey(refs: readonly string[]): string;
684
695
  * 16 capitals or digits), and a JWT (three base64url parts joined by dots, the first starting `eyJ`). Then any run of
685
696
  * 32 or more letters, digits, `_`, `-` or `+` that mixes letters and digits, unless the whitespace-free word it sits
686
697
  * in is a URL or a file path (it has a `/`); a 40-character git SHA is such a run. Everything else, whitespace and
687
- * newlines included, stays as it was. `removed` says whether anything was taken out, so the caller can point the
688
- * user to the key box.
698
+ * newlines included, stays as it was, except a URL with userinfo is reduced to scheme and host (credentials, path,
699
+ * query and fragment removed). `removed` says whether anything was taken out, so the caller can point the user to the
700
+ * key box.
689
701
  */
690
702
  export declare function stripSecrets(text: string): {
691
703
  text: string;
@@ -711,8 +723,28 @@ export declare function networkTaskFacts(n: {
711
723
  skip?: string;
712
724
  }[];
713
725
  }): string[];
726
+ export declare function networkDiagnoseTaskFacts(d: {
727
+ checkedAt: string;
728
+ targets: readonly {
729
+ url: string;
730
+ proxy: string;
731
+ guardSupport: string;
732
+ listener: null | {
733
+ host: string;
734
+ port: number;
735
+ reachable: boolean;
736
+ error?: string;
737
+ };
738
+ guard: {
739
+ status: string;
740
+ loc?: string;
741
+ checkedAt?: string;
742
+ error?: string;
743
+ };
744
+ }[];
745
+ }): string[];
714
746
  /** The kinds of AI Task (spec §3.28); anything else is refused. */
715
- export declare const AI_TASK_KINDS: readonly ['free', 'fix', 'quota', 'account', 'host', 'plugin', 'terminal', 'theme', 'handoff', 'menubar', 'hotkey', 'network', 'update'];
747
+ export declare const AI_TASK_KINDS: readonly ['free', 'fix', 'quota', 'account', 'host', 'plugin', 'terminal', 'theme', 'handoff', 'menubar', 'hotkey', 'network', 'network-diagnose', 'update'];
716
748
  export type AiTaskKind = (typeof AI_TASK_KINDS)[number];
717
749
  /**
718
750
  * The message keys of the AI dialog for `task` (spec §3.28 "每个入口的提示"): its title, the text box placeholder and
@@ -858,6 +890,8 @@ export declare function taskPrompt(input: {
858
890
  handoff?: readonly string[];
859
891
  /** Network Guard facts, one per line, as `networkTaskFacts` gives them (`network` task, spec §3.35). */
860
892
  network?: readonly string[];
893
+ /** Offline route/listener/cache facts for the fixed read-only `network-diagnose` task. */
894
+ networkDiagnose?: readonly string[];
861
895
  /** The error the last Update Check or Update showed (`update` task, spec §3.23). */
862
896
  updateError?: string;
863
897
  };
@@ -558,6 +558,17 @@ export function nextReset(accounts, now) {
558
558
  }
559
559
  return best;
560
560
  }
561
+ /**
562
+ * Which tool the "Best to use now" card shows (spec §3.45): the one the family filter names, else the first in the
563
+ * page's group `order` with a pick, else the first with an entry, so the card says why nothing can be picked. Quota
564
+ * is never compared across tools. `others`: every other tool with an entry, in `order`, for the hover text.
565
+ */
566
+ export function pickNowChoice(pickNow, order, filter) {
567
+ const has = (f) => Boolean(pickNow && Object.hasOwn(pickNow, f));
568
+ const picks = order.filter((f) => has(f) && pickNow[f].pick);
569
+ const family = filter ? (has(filter) ? filter : null) : (picks[0] ?? order.find(has) ?? null);
570
+ return family ? { family, others: order.filter((f) => f !== family && has(f)) } : null;
571
+ }
561
572
  /**
562
573
  * A name to offer for a new Account of a Family, given its existing Account names (`main` included or not).
563
574
  * Numbered names (`001` … `007`) continue after the highest number with the same width (`008`); otherwise
@@ -1236,8 +1247,9 @@ export function loginKey(refs) {
1236
1247
  * 16 capitals or digits), and a JWT (three base64url parts joined by dots, the first starting `eyJ`). Then any run of
1237
1248
  * 32 or more letters, digits, `_`, `-` or `+` that mixes letters and digits, unless the whitespace-free word it sits
1238
1249
  * in is a URL or a file path (it has a `/`); a 40-character git SHA is such a run. Everything else, whitespace and
1239
- * newlines included, stays as it was. `removed` says whether anything was taken out, so the caller can point the
1240
- * user to the key box.
1250
+ * newlines included, stays as it was, except a URL with userinfo is reduced to scheme and host (credentials, path,
1251
+ * query and fragment removed). `removed` says whether anything was taken out, so the caller can point the user to the
1252
+ * key box.
1241
1253
  */
1242
1254
  export function stripSecrets(text) {
1243
1255
  const mark = '[key removed]';
@@ -1247,6 +1259,33 @@ export function stripSecrets(text) {
1247
1259
  removed = true;
1248
1260
  return mark;
1249
1261
  });
1262
+ // URL userinfo is a credential too. Keep only its origin, and drop path/query/fragment with it; this also covers
1263
+ // a proxy URL pasted into the fixed network diagnosis task before its prompt is previewed or written to disk.
1264
+ w = w.replace(/\b[a-z][a-z\d+.-]*:\/\/\S+/gi, (value) => {
1265
+ const trailing = /[),.;!?]+$/.exec(value)?.[0] ?? '';
1266
+ try {
1267
+ const url = new URL(value.slice(0, value.length - trailing.length));
1268
+ if (!url.username && !url.password)
1269
+ return value;
1270
+ removed = true;
1271
+ return `${url.protocol}//${url.host}${trailing}`;
1272
+ }
1273
+ catch {
1274
+ return value;
1275
+ }
1276
+ });
1277
+ // Proxy environment values also allow user:password@host without a scheme. Keep only the host and port.
1278
+ w = w.replace(/(?<![A-Za-z0-9_@])[^:@\s/]+:[^@\s/]+@(?:\[[0-9A-Fa-f:.]+\]|[A-Za-z0-9.-]+)(?::\d{1,5})?(?:[/?#]\S*)?/g, (value) => {
1279
+ const trailing = /[),.;!?]+$/.exec(value)?.[0] ?? '';
1280
+ try {
1281
+ const url = new URL(`http://${value.slice(0, value.length - trailing.length)}`);
1282
+ removed = true;
1283
+ return `${url.host}${trailing}`;
1284
+ }
1285
+ catch {
1286
+ return value;
1287
+ }
1288
+ });
1250
1289
  if (w.includes('/'))
1251
1290
  return w;
1252
1291
  w = w.replace(/[A-Za-z0-9_+-]{32,}=*/g, (run) => {
@@ -1280,6 +1319,30 @@ export function networkTaskFacts(n) {
1280
1319
  out.push(`${a.ref}: not checked here (${a.skip})`);
1281
1320
  return out;
1282
1321
  }
1322
+ export function networkDiagnoseTaskFacts(d) {
1323
+ const out = [`diagnosed: ${d.checkedAt} (offline; no trace sent)`];
1324
+ for (const t of d.targets) {
1325
+ let host = t.url;
1326
+ try {
1327
+ host = new URL(t.url).hostname;
1328
+ }
1329
+ catch {
1330
+ /* keep the URL */
1331
+ }
1332
+ const listener = t.listener
1333
+ ? `TCP ${t.listener.host}:${t.listener.port} ${t.listener.reachable ? 'reachable' : 'not reachable'}${t.listener.error ? ` (${t.listener.error})` : ''}; this does not prove the proxy protocol works`
1334
+ : t.guardSupport === 'direct'
1335
+ ? 'direct; no proxy TCP listener to test'
1336
+ : 'no local TCP listener probe (remote proxy, invalid address, or no explicit port)';
1337
+ const support = t.guardSupport === 'unsupported'
1338
+ ? '; Guard does not support this proxy scheme; configure HTTP CONNECT or direct before an online check'
1339
+ : t.guardSupport === 'invalid'
1340
+ ? '; proxy address invalid; correct it and start a new session'
1341
+ : '';
1342
+ out.push(`${host}: proxy ${t.proxy}; ${listener}${support}; Guard ${t.guard.status}${t.guard.loc ? `, country ${t.guard.loc}` : ''}${t.guard.checkedAt ? `, checked ${t.guard.checkedAt}` : ', not checked yet'}${t.guard.error ? `, ${t.guard.error}` : ''}`);
1343
+ }
1344
+ return out;
1345
+ }
1283
1346
  /** The kinds of AI Task (spec §3.28); anything else is refused. */
1284
1347
  export const AI_TASK_KINDS = [
1285
1348
  'free',
@@ -1294,6 +1357,7 @@ export const AI_TASK_KINDS = [
1294
1357
  'menubar',
1295
1358
  'hotkey',
1296
1359
  'network',
1360
+ 'network-diagnose',
1297
1361
  'update',
1298
1362
  ];
1299
1363
  /**
@@ -1450,11 +1514,14 @@ export function taskPrompt(input, strip) {
1450
1514
  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 的进程。',
1451
1515
  cHandoff: '自动接力现在的设置(来自 `sideby handoff status --json`):',
1452
1516
  network: '帮我设置 sideby 的网络检查:请求要从我没允许的国家或地区发出时(比如代理断了、节点切错了),拦下 Claude 和 Codex。',
1517
+ 'network-diagnose': '根据下面的离线诊断 facts,向我解释当前网络异常和最可能的下一步。',
1453
1518
  cNetwork: '网络检查现在的情况(来自 `sideby network --json`):',
1519
+ cNetworkDiagnose: '离线诊断(来自 `sideby network diagnose --json`):',
1454
1520
  update: '帮我把 sideby 和它的 skill 更新到最新版:面板检查更新或更新时出错了,请找出原因并修好。',
1455
1521
  cUpdate: '面板上的报错:',
1456
1522
  pUpdate: '先运行 `sideby update --json`,看它能不能连上 npm、最新版是多少、是哪种安装方式(`canRun`)。连不上时先查网络:要走代理的话,看启动 sideby 的终端里有没有 `HTTPS_PROXY`、代理开没开;在中国大陆可以用镜像 `SIDEBY_UPDATE_REGISTRY=https://registry.npmmirror.com`,要写进 shell 配置文件前先问我。能更新时,`sideby update --json` 已经给出预览(退出码 10),我同意后再跑 `sideby update --yes --json`。`canRun` 为 `false` 时(npx、项目依赖、没有写权限的全局目录),把输出里的 `command` 给我,告诉我在哪里运行。skill 比 sideby 新不是问题,更新 sideby 就好。最后再跑一次 `sideby update --json`,确认 sideby 和 skill 都已是最新。',
1457
1523
  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` 确认。它只防代理出意外,不会让在不支持的地区使用变得合规;不要帮我隐藏所在地(时区、指纹之类)。',
1524
+ pNetworkDiagnose: '只解释这些 facts。TCP listener 可连接不代表 HTTP CONNECT、SOCKS 或上游代理可用。看到 SOCKS 或 HTTPS 代理时,明确说当前 Guard 只支持 HTTP CONNECT,建议我配置 HTTP 代理或直连。需要新的出口国家结果时,让我自己运行 `sideby network check --json`。不要修改网络、配置、代码或文件,不要切换出口,也不要运行任何写入命令。',
1458
1525
  pHandoff: '先运行 `sideby handoff status --json` 和 `sideby quota --json`,看清每个账号的额度来源和用量。只用 `sideby handoff enable …` 或 `sideby config set handoff.<键> <值>` 改设置;先不加 `--yes` 给我看预览,我同意后再加 `--yes`。没有额度数据的账号排在顺序后面,并告诉我怎么让它显示额度。',
1459
1526
  cAccount: '账号:',
1460
1527
  cFamily: '家族:',
@@ -1467,7 +1534,9 @@ export function taskPrompt(input, strip) {
1467
1534
  cNoTerminals: '本机没找到 sideby 支持的终端',
1468
1535
  cLang: '面板语言:中文(请用中文和我交流)',
1469
1536
  r1: '先用 sideby skill,怎么做见它的 references/ai-tasks.md。没装 skill 就先问我,我同意后运行 `npx skills add Adonis0123/sideby -g`。',
1537
+ r1ReadOnly: '装了 sideby skill 就看它的 references/ai-tasks.md;没装就只说明,不安装,也不运行其他写入命令。',
1470
1538
  r2: '会改文件的命令先给我看预览,我同意后才加 `--yes`。',
1539
+ rReadOnly: '这是固定只读任务:不得修改网络、配置、代码或文件,不得切换出口,不得自动运行在线检查。',
1471
1540
  r3: '不要替我登录,也不要让我把密钥发给你:密钥由我自己用 `sideby key <账号>` 输入。',
1472
1541
  pFix: '先运行 `sideby doctor --json` 看清问题;能自动修的交给 `sideby doctor --fix`。修完再跑一次 `sideby doctor`,告诉我还剩什么。',
1473
1542
  pQuota: '用 `sideby quota --json` 和 `sideby doctor --json` 看原因。',
@@ -1502,11 +1571,14 @@ export function taskPrompt(input, strip) {
1502
1571
  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.',
1503
1572
  cHandoff: 'Auto Handoff now (from `sideby handoff status --json`):',
1504
1573
  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).",
1574
+ 'network-diagnose': 'Explain the current network problem and the most likely next step from the offline diagnosis facts below.',
1505
1575
  cNetwork: 'Network check now (from `sideby network --json`):',
1576
+ cNetworkDiagnose: 'Offline diagnosis (from `sideby network diagnose --json`):',
1506
1577
  update: 'Bring sideby and its skill up to date: the Panel showed an error while checking for or installing an update. Find out why and fix it.',
1507
1578
  cUpdate: 'The error the Panel showed: ',
1508
1579
  pUpdate: 'Run `sideby update --json` first to see whether it reaches npm, the latest version and how sideby is installed (`canRun`). When it cannot reach npm, check the network: behind a proxy, whether the terminal that starts sideby has `HTTPS_PROXY` and the proxy is on; in mainland China the mirror `SIDEBY_UPDATE_REGISTRY=https://registry.npmmirror.com` helps, but ask me before writing it into a shell config file. When it can update, `sideby update --json` already shows the change (exit 10); run `sideby update --yes --json` after I agree. When `canRun` is false (npx, a project dependency, a global folder I cannot write), give me the `command` from its output and tell me where to run it. A skill newer than sideby is fine: updating sideby is enough. Finish with `sideby update --json` again to confirm sideby and the skill are current.',
1509
1580
  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).",
1581
+ pNetworkDiagnose: 'Explain these facts only. A reachable TCP listener does not prove that HTTP CONNECT, SOCKS or the upstream proxy works. For a SOCKS or HTTPS proxy, say that Guard currently supports HTTP CONNECT only and suggest configuring an HTTP proxy or a direct connection. If a fresh egress country is needed, ask me to run `sideby network check --json` myself. Do not change the network, configuration, code or files, do not switch the exit, and do not run any write command.',
1510
1582
  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.',
1511
1583
  cAccount: 'Account: ',
1512
1584
  cFamily: 'Family: ',
@@ -1519,7 +1591,9 @@ export function taskPrompt(input, strip) {
1519
1591
  cNoTerminals: 'No supported terminal is installed here',
1520
1592
  cLang: 'Panel language: English (talk to me in English)',
1521
1593
  r1: 'Use the sideby skill; its references/ai-tasks.md says how. If the skill is not installed, ask me first, and with my yes run `npx skills add Adonis0123/sideby -g`.',
1594
+ r1ReadOnly: 'If the sideby skill is installed, read its references/ai-tasks.md. If not, just say so; do not install it or run any other write command.',
1522
1595
  r2: 'Show me the preview of any command that changes files; add `--yes` only after I agree.',
1596
+ rReadOnly: 'This is a fixed read-only task: do not change the network, configuration, code or files, switch the exit, or automatically run an online check.',
1523
1597
  r3: 'Never sign in for me and never ask me to send you an API key: I enter keys myself with `sideby key <account>`.',
1524
1598
  pFix: 'Run `sideby doctor --json` first; `sideby doctor --fix` fixes what it can by itself. When you are done, run `sideby doctor` and tell me what is left.',
1525
1599
  pQuota: 'Use `sideby quota --json` and `sideby doctor --json` to see why.',
@@ -1532,14 +1606,21 @@ export function taskPrompt(input, strip) {
1532
1606
  shareTerminal: 'When it works, ask me whether to make this terminal built into sideby. Only with my yes, add a row to the terminal table in src/core/terminal.ts of the sideby repository with tests, follow its CONTRIBUTING.md to open a pull request, and first remove my own account names, paths and emails.',
1533
1607
  };
1534
1608
  const task = AI_TASK_KINDS.indexOf(input.task) >= 0 ? input.task : 'free';
1609
+ const fixedReadOnly = task === 'network-diagnose';
1535
1610
  const sentence = L[task] || L.free;
1536
- const what = task === 'free' ? text || sentence : text ? sentence + '\n' + L.says + text : sentence;
1611
+ const what = fixedReadOnly
1612
+ ? sentence
1613
+ : task === 'free'
1614
+ ? text || sentence
1615
+ : text
1616
+ ? sentence + '\n' + L.says + text
1617
+ : sentence;
1537
1618
  const facts = [];
1538
- if (account)
1619
+ if (!fixedReadOnly && account)
1539
1620
  facts.push('- ' + L.cAccount + account);
1540
- if (family)
1621
+ if (!fixedReadOnly && family)
1541
1622
  facts.push('- ' + L.cFamily + family);
1542
- const findings = c.findings || [];
1623
+ const findings = fixedReadOnly ? [] : c.findings || [];
1543
1624
  if (findings.length) {
1544
1625
  facts.push('- ' + L.cFindings);
1545
1626
  findings.forEach((f, i) => {
@@ -1556,7 +1637,7 @@ export function taskPrompt(input, strip) {
1556
1637
  facts.push(' ' + hint);
1557
1638
  });
1558
1639
  }
1559
- const reason = clean(c.quotaReason);
1640
+ const reason = fixedReadOnly ? '' : clean(c.quotaReason);
1560
1641
  if (reason)
1561
1642
  facts.push('- ' + L.cQuota + reason);
1562
1643
  if (task === 'terminal') {
@@ -1581,24 +1662,37 @@ export function taskPrompt(input, strip) {
1581
1662
  if (lines.length)
1582
1663
  facts.push('- ' + L.cNetwork, ...lines.map((l) => ' - ' + l));
1583
1664
  }
1665
+ if (task === 'network-diagnose') {
1666
+ const lines = (c.networkDiagnose || []).map(clean).filter(Boolean);
1667
+ if (lines.length)
1668
+ facts.push('- ' + L.cNetworkDiagnose, ...lines.map((l) => ' - ' + l));
1669
+ }
1584
1670
  if (task === 'update') {
1585
1671
  const err = clean(c.updateError);
1586
1672
  if (err)
1587
1673
  facts.push('- ' + L.cUpdate + err);
1588
1674
  }
1589
- const version = clean(c.version);
1675
+ const version = fixedReadOnly ? '' : clean(c.version);
1590
1676
  if (version)
1591
1677
  facts.push('- ' + L.cVersion + version);
1592
1678
  facts.push('- ' + L.cLang);
1593
- const pointer = L['p' + task.charAt(0).toUpperCase() + task.slice(1)];
1679
+ const pointerKey = task === 'network-diagnose' ? 'pNetworkDiagnose' : 'p' + task.charAt(0).toUpperCase() + task.slice(1);
1680
+ const pointer = L[pointerKey];
1594
1681
  const parts = [L.task + '\n' + what, L.context + '\n' + facts.join('\n')];
1595
- const attached = attachedSection(input.attachments || [], input.lang);
1682
+ const attached = fixedReadOnly ? '' : attachedSection(input.attachments || [], input.lang);
1596
1683
  if (attached)
1597
1684
  parts.push(attached);
1598
- parts.push(L.rules + '\n- ' + L.r1 + '\n- ' + L.r2 + '\n- ' + L.r3);
1685
+ parts.push(L.rules +
1686
+ '\n- ' +
1687
+ (fixedReadOnly ? L.r1ReadOnly : L.r1) +
1688
+ '\n- ' +
1689
+ (fixedReadOnly ? L.rReadOnly : L.r2) +
1690
+ '\n- ' +
1691
+ L.r3);
1599
1692
  if (pointer)
1600
1693
  parts.push(L.pointers + '\n' + pointer);
1601
- parts.push(task === 'terminal' ? L.shareTerminal : L.share);
1694
+ if (task !== 'network-diagnose')
1695
+ parts.push(task === 'terminal' ? L.shareTerminal : L.share);
1602
1696
  return parts.join('\n\n');
1603
1697
  }
1604
1698
  /**