sideby 0.17.0 → 0.19.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.
- package/README.md +11 -1
- package/ai-tasks.json +90 -0
- package/dist/build.json +1 -1
- package/dist/src/cli/commands.d.ts +9 -1
- package/dist/src/cli/commands.js +507 -26
- package/dist/src/cli/json-schemas.js +196 -19
- package/dist/src/cli/main.js +79 -13
- package/dist/src/core/after-install.d.ts +54 -0
- package/dist/src/core/after-install.js +78 -0
- package/dist/src/core/ask.d.ts +87 -1
- package/dist/src/core/ask.js +122 -7
- package/dist/src/core/autostart.d.ts +38 -8
- package/dist/src/core/autostart.js +85 -39
- package/dist/src/core/brand-mark.d.ts +49 -11
- package/dist/src/core/brand-mark.js +116 -38
- package/dist/src/core/browser-profiles.js +7 -32
- package/dist/src/core/config.d.ts +19 -0
- package/dist/src/core/config.js +75 -2
- package/dist/src/core/desktop-app.d.ts +1 -1
- package/dist/src/core/desktop-app.js +2 -2
- package/dist/src/core/edit-settings.d.ts +24 -0
- package/dist/src/core/edit-settings.js +97 -0
- package/dist/src/core/handoff-brief.d.ts +4 -2
- package/dist/src/core/handoff-brief.js +6 -1
- package/dist/src/core/handoff-chain.d.ts +24 -0
- package/dist/src/core/handoff-chain.js +2 -0
- package/dist/src/core/handoff-run.d.ts +4 -3
- package/dist/src/core/handoff-run.js +14 -9
- package/dist/src/core/launch.d.ts +2 -0
- package/dist/src/core/launch.js +14 -10
- package/dist/src/core/local-build.d.ts +12 -5
- package/dist/src/core/local-build.js +49 -31
- package/dist/src/core/lock.d.ts +30 -0
- package/dist/src/core/lock.js +143 -0
- package/dist/src/core/pick-commands.d.ts +42 -0
- package/dist/src/core/pick-commands.js +44 -0
- package/dist/src/core/quota-levels.d.ts +6 -1
- package/dist/src/core/quota-levels.js +16 -5
- package/dist/src/core/shell-init.js +3 -1
- package/dist/src/core/shell-setup.d.ts +40 -0
- package/dist/src/core/shell-setup.js +54 -0
- package/dist/src/core/skill-check.d.ts +2 -0
- package/dist/src/core/skill-check.js +2 -0
- package/dist/src/core/task-spec.d.ts +95 -0
- package/dist/src/core/task-spec.js +209 -0
- package/dist/src/core/terminal.d.ts +21 -4
- package/dist/src/core/terminal.js +155 -10
- package/dist/src/core/update.d.ts +27 -16
- package/dist/src/core/update.js +69 -95
- package/dist/src/core/windows-dirs.d.ts +19 -0
- package/dist/src/core/windows-dirs.js +39 -0
- package/dist/src/desktop/icon.js +12 -15
- package/dist/src/families/claude/ai-task.d.ts +8 -0
- package/dist/src/families/claude/ai-task.js +38 -0
- package/dist/src/families/claude/handoff-hook.js +4 -4
- package/dist/src/families/claude/index.js +3 -0
- package/dist/src/families/codex/handoff-hook.js +4 -4
- package/dist/src/families/codex/index.js +9 -0
- package/dist/src/families/grok/handoff-hook.js +4 -4
- package/dist/src/families/grok/index.js +1 -0
- package/dist/src/families/pi/index.js +1 -0
- package/dist/src/handoff/hook.js +51 -30
- package/dist/src/handoff/levels.d.ts +24 -0
- package/dist/src/handoff/levels.js +70 -0
- package/dist/src/handoff/messages.d.ts +6 -3
- package/dist/src/handoff/messages.js +20 -7
- package/dist/src/handoff/reader.d.ts +6 -3
- package/dist/src/menubar/agent.d.ts +3 -0
- package/dist/src/menubar/agent.js +21 -0
- package/dist/src/menubar/script.d.ts +8 -0
- package/dist/src/menubar/script.js +457 -0
- package/dist/src/menubar/snapshot.d.ts +115 -0
- package/dist/src/menubar/snapshot.js +255 -0
- package/dist/src/menubar/strings.d.ts +87 -0
- package/dist/src/menubar/strings.js +88 -0
- package/dist/src/panel/background.js +12 -19
- package/dist/src/panel/handler.d.ts +30 -0
- package/dist/src/panel/handler.js +148 -80
- package/dist/src/panel/i18n.d.ts +72 -0
- package/dist/src/panel/i18n.js +144 -0
- package/dist/src/panel/page-logic.d.ts +105 -0
- package/dist/src/panel/page-logic.js +170 -15
- package/dist/src/panel/page-script.js +419 -111
- package/dist/src/panel/page-styles.js +45 -13
- package/dist/src/panel/page.d.ts +7 -0
- package/dist/src/panel/page.js +11 -1
- package/dist/src/runtime.d.ts +44 -2
- package/dist/src/runtime.js +107 -6
- package/dist/src/types.d.ts +14 -0
- package/package.json +4 -3
- package/schemas/alias-list.json +119 -0
- package/schemas/alias.json +27 -1
- package/schemas/ask-choices.json +168 -0
- package/schemas/ask-print.json +87 -0
- package/schemas/config.json +28 -1
- package/schemas/edit.json +119 -0
- package/schemas/error.json +4 -0
- package/schemas/families.json +4 -0
- package/schemas/list.json +4 -0
- package/schemas/local.json +1 -1
- package/schemas/menubar-snapshot.json +646 -0
- package/schemas/menubar-start.json +112 -0
- package/schemas/menubar.json +165 -0
- package/schemas/new.json +19 -0
- package/schemas/shell-init-setup.json +124 -0
- package/skills/sideby/SKILL.md +11 -4
- package/skills/sideby/references/accounts.md +10 -0
- package/skills/sideby/references/ai-tasks.md +10 -0
- package/skills/sideby/references/handoff.md +3 -1
- package/skills/sideby/references/panel.md +6 -0
- package/skills/sideby/references/setup.md +1 -1
- package/skills/sideby/references/update.md +1 -1
package/dist/src/panel/i18n.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
const en = {
|
|
5
5
|
'top.tagline': 'Every AI coding account, side by side.',
|
|
6
6
|
'top.refresh': 'Refresh',
|
|
7
|
+
'top.repo': 'sideby on GitHub',
|
|
7
8
|
'top.loading': 'Loading…',
|
|
8
9
|
'top.refreshing': 'Refreshing…',
|
|
9
10
|
'top.updated': 'Read {ago} · refreshes every {s} s',
|
|
@@ -23,6 +24,7 @@ const en = {
|
|
|
23
24
|
'upd.cannot': 'sideby cannot update itself here: {why}. Run this yourself:',
|
|
24
25
|
'upd.skillToo': 'The sideby skill agents read is updated with it.',
|
|
25
26
|
'upd.skillDone': 'The sideby skill was updated too; agents load it in their next session.',
|
|
27
|
+
'upd.skillSyncing': 'The sideby skill is updating in the background; agents load it in their next session.',
|
|
26
28
|
'upd.skillManaged': 'sideby leaves the skill alone ({why}). Update it with:',
|
|
27
29
|
'upd.checksOff': 'Update checks are off ({why}).',
|
|
28
30
|
'upd.latest': 'This is the newest version',
|
|
@@ -42,6 +44,7 @@ const en = {
|
|
|
42
44
|
'loc.switching': 'Switching…',
|
|
43
45
|
'loc.stuck': 'Switched, but this page still runs the old code. Reload it; a panel started with sideby ui needs a restart.',
|
|
44
46
|
'loc.reload': 'Reload page',
|
|
47
|
+
'loc.unconfirmed': 'Could not confirm the switch: this page cannot reach sideby. Reload the page to see which build runs.',
|
|
45
48
|
'upd.open': 'Update…',
|
|
46
49
|
'upd.autoIsOn': 'Auto Update: on',
|
|
47
50
|
'upd.autoIsOff': 'Auto Update: off',
|
|
@@ -59,6 +62,8 @@ const en = {
|
|
|
59
62
|
'upd.now': 'Update to {v}',
|
|
60
63
|
'upd.updating': 'Updating…',
|
|
61
64
|
'upd.done': 'Updated to sideby {v}.',
|
|
65
|
+
'upd.confirming': 'The connection dropped while sideby {v} was installing; checking whether the update finished…',
|
|
66
|
+
'upd.unconfirmed': 'Could not confirm the update to sideby {v}: this page cannot reach sideby. Reload the page to see which version runs.',
|
|
62
67
|
'upd.reloading': 'Waiting for the new version; this page reloads by itself.',
|
|
63
68
|
'upd.restartHint': 'This page still runs the old version. Restart sideby ui (or reload the page in your portal) to use the new one.',
|
|
64
69
|
'upd.skillLabel': 'Update skill',
|
|
@@ -409,6 +414,7 @@ const en = {
|
|
|
409
414
|
'ai.examples': 'Things you can say (click to copy):',
|
|
410
415
|
'ai.copy': 'Copy',
|
|
411
416
|
'ai.ask.quota': 'Which of my Claude accounts has the most quota left?',
|
|
417
|
+
'ai.ask.pick': 'Add cc: start whichever Claude account has the most quota left.',
|
|
412
418
|
'ai.ask.new': 'Add another Claude account with the short command cc009.',
|
|
413
419
|
'ai.ask.pin': 'Pin claude:work to the top.',
|
|
414
420
|
'ai.ask.fix': 'Check my accounts and fix what they should share.',
|
|
@@ -468,6 +474,7 @@ const en = {
|
|
|
468
474
|
'ask.terminal': 'Terminal',
|
|
469
475
|
'ask.chooseAccount': 'Choose an account',
|
|
470
476
|
'ask.confirm': 'Opens {terminal} and starts {ref} there.',
|
|
477
|
+
'ask.safe': 'Its permission checks stay on, so risky actions are checked first.',
|
|
471
478
|
'ask.open': 'Open in {terminal}',
|
|
472
479
|
'ask.opening': 'Opening…',
|
|
473
480
|
'ask.loading': 'Finding an account…',
|
|
@@ -505,6 +512,43 @@ const en = {
|
|
|
505
512
|
'ask.otherTool': 'Other tool…',
|
|
506
513
|
'ask.otherToolSub': 'Not in this list',
|
|
507
514
|
'ask.plugin': 'Let AI write a plugin',
|
|
515
|
+
'pk.title': 'Start the one with most room',
|
|
516
|
+
'pk.intro': 'A short command per tool that starts, each time, the account with the most quota left. When no account has quota data yet, it starts the main account and says so.',
|
|
517
|
+
'pk.none': 'Add a second account of a tool first: with one account there is nothing to pick.',
|
|
518
|
+
'pk.noneYet': 'Not set',
|
|
519
|
+
'pk.exists': 'starts the {host} account with the most room.',
|
|
520
|
+
'pk.start': 'Start the one with most room',
|
|
521
|
+
'pk.startTip': '{name} in a terminal: starts the {host} account with the most quota left',
|
|
522
|
+
'pk.remove': 'Remove',
|
|
523
|
+
'pk.removed': 'Removed {name}.',
|
|
524
|
+
'pk.nameLabel': 'Short command for {host}',
|
|
525
|
+
'pk.hint': 'Type it in a terminal to start the {host} account with the most room.',
|
|
526
|
+
'pk.shadows': '{name} is already a command on this computer ({path}). In your shell, typing {name} would start {host} instead.',
|
|
527
|
+
'pk.add': 'Add',
|
|
528
|
+
'pk.addAnyway': 'Add anyway',
|
|
529
|
+
'pk.added': 'Added {name}. It works in a new terminal window.',
|
|
530
|
+
'pk.newShell': 'New short commands work in a new terminal window.',
|
|
531
|
+
'pk.offerShort': 'Add {name}',
|
|
532
|
+
'pk.offerMore': ': start the one with most room',
|
|
533
|
+
'pk.rename': 'Rename',
|
|
534
|
+
'pk.addedSetup': 'Added {name}. One more step: let new terminals load it (above).',
|
|
535
|
+
'pk.renamedSetup': 'Renamed {old} to {name}. One more step: let new terminals load it (above).',
|
|
536
|
+
'ss.title': 'New terminals do not load your short commands yet.',
|
|
537
|
+
'ss.body': 'sideby can add this line to the end of {rc}:',
|
|
538
|
+
'ss.add': 'Add the line',
|
|
539
|
+
'ss.adding': 'Adding…',
|
|
540
|
+
'ss.added': 'Added to {rc}. Short commands work in a new terminal window.',
|
|
541
|
+
'ss.undo': 'Undo',
|
|
542
|
+
'ss.removed': 'Took sideby’s line out of {rc}.',
|
|
543
|
+
'pk.save': 'Save',
|
|
544
|
+
'pk.renamed': 'Renamed {old} to {name}. It works in a new terminal window.',
|
|
545
|
+
'pk.fileFailed': 'Saved in the config, but a shell-init file was not rewritten: {msg}',
|
|
546
|
+
'pk.why.othersFull': 'no quota data for it yet; the accounts with data are full',
|
|
547
|
+
'pk.offerNoName': 'Add a short command: start the one with most room',
|
|
548
|
+
'pk.namePh': 'for example cc',
|
|
549
|
+
'pk.started': 'Opened {terminal} with {ref} ({why}).',
|
|
550
|
+
'pk.why.room': '{n}% used, the most room',
|
|
551
|
+
'pk.why.noData': 'no quota data yet',
|
|
508
552
|
'login.opened': 'Opened {terminal}: sign in to {ref} there.',
|
|
509
553
|
'login.failed': 'Could not open a terminal. Copied: paste it into your terminal and press Return.',
|
|
510
554
|
'login.automation': 'Copied. To let sideby open {terminal}, turn it on in System Settings → Privacy & Security → Automation.',
|
|
@@ -561,6 +605,10 @@ const en = {
|
|
|
561
605
|
'menu.copyDir': 'Copy folder path',
|
|
562
606
|
'menu.copyEmail': 'Copy email',
|
|
563
607
|
'menu.check': 'Check this account',
|
|
608
|
+
'menu.editSettings': 'Open {file}',
|
|
609
|
+
'edit.opened': 'Opened {ref}’s {file} with your default program.',
|
|
610
|
+
'edit.shared': 'This file is shared: a change also applies to {names}.',
|
|
611
|
+
'edit.failed': 'Could not open {file} for {ref}: {msg}',
|
|
564
612
|
'menu.like': 'New account like this',
|
|
565
613
|
'menu.tune': 'Context tuning',
|
|
566
614
|
'menu.model': 'Model and effort…',
|
|
@@ -894,6 +942,30 @@ const en = {
|
|
|
894
942
|
'as.doneOn': 'sideby now starts in the background at login.',
|
|
895
943
|
'as.doneOff': 'sideby no longer starts at login.',
|
|
896
944
|
'as.nextLogin': 'It takes effect at your next login.',
|
|
945
|
+
'mb.label': 'Show quota in the menu bar',
|
|
946
|
+
'mb.hint': 'Shows how much your best account has used, and starts any account in your terminal when clicked.',
|
|
947
|
+
'mb.onTitle': 'Show quota in the menu bar',
|
|
948
|
+
'mb.offTitle': 'Hide from the menu bar',
|
|
949
|
+
'mb.writes': 'sideby will add this login item file so the menu bar item starts now and at each login:',
|
|
950
|
+
'mb.removes': 'sideby will stop the menu bar item and remove this login item file:',
|
|
951
|
+
'mb.turnOn': 'Turn on',
|
|
952
|
+
'mb.turnOff': 'Turn off',
|
|
953
|
+
'mb.hintTitle': 'See your quota in the menu bar',
|
|
954
|
+
'mb.hintBody': 'See at a glance whether you have quota to keep working, without opening the panel. Click any account there to start it in your terminal.',
|
|
955
|
+
'mb.hintYes': 'Show in menu bar',
|
|
956
|
+
'mb.hintNo': 'No thanks',
|
|
957
|
+
'mb.noWindow': 'The sideby icon appears in the menu bar now and at each login; nothing else opens.',
|
|
958
|
+
'mb.offNote': 'The sideby icon disappears from the menu bar now.',
|
|
959
|
+
'mb.alreadyOn': 'It already runs this sideby in the menu bar; nothing to change.',
|
|
960
|
+
'mb.alreadyOff': 'It is already off; nothing to change.',
|
|
961
|
+
'mb.doneOn': 'Look for the sideby icon in the top-right menu bar. If it is hidden, the menu bar may be full: hold ⌘ and drag icons to make room.',
|
|
962
|
+
'mb.doneOff': 'Removed from the menu bar.',
|
|
963
|
+
'mb.nextLogin': 'It appears at your next login.',
|
|
964
|
+
'mb.stale': 'It points to a sideby that is no longer there.',
|
|
965
|
+
'mb.other': 'It runs another copy of sideby, not this one.',
|
|
966
|
+
'mb.foreign': 'A login item with the same name was not made by sideby, so sideby leaves it alone.',
|
|
967
|
+
'mb.unsupported': 'Only on macOS for now.',
|
|
968
|
+
'ai.ask.menubar': 'Show my quota in the menu bar.',
|
|
897
969
|
'as.changedSince': 'Something changed since the preview; look at it again.',
|
|
898
970
|
'as.block.npx-cache': 'sideby runs from the npx cache, which npm may clear, so it cannot start at login from there. Install it first:',
|
|
899
971
|
'as.block.temp-dir': 'sideby runs from a temporary folder that the system empties. Install it first:',
|
|
@@ -926,6 +998,7 @@ const en = {
|
|
|
926
998
|
const zh = {
|
|
927
999
|
'top.tagline': '所有 AI 编程账号,并排运行。',
|
|
928
1000
|
'top.refresh': '刷新',
|
|
1001
|
+
'top.repo': 'sideby 的 GitHub 仓库',
|
|
929
1002
|
'top.loading': '加载中…',
|
|
930
1003
|
'top.refreshing': '刷新中…',
|
|
931
1004
|
'top.updated': '{ago}读取 · 每 {s} 秒自动刷新',
|
|
@@ -945,6 +1018,7 @@ const zh = {
|
|
|
945
1018
|
'upd.cannot': '这种安装方式下 sideby 不能自己更新:{why}。请自己运行:',
|
|
946
1019
|
'upd.skillToo': 'agent 读的 sideby skill 会一起更新。',
|
|
947
1020
|
'upd.skillDone': 'sideby skill 也已更新,agent 下次开会话时生效。',
|
|
1021
|
+
'upd.skillSyncing': 'sideby skill 正在后台更新,agent 下次开会话时生效。',
|
|
948
1022
|
'upd.skillManaged': 'sideby 不会自动更新这个 skill({why})。请用这条命令更新:',
|
|
949
1023
|
'upd.checksOff': '检查更新已关闭({why})。',
|
|
950
1024
|
'upd.latest': '已是最新版本',
|
|
@@ -964,6 +1038,7 @@ const zh = {
|
|
|
964
1038
|
'loc.switching': '正在切换…',
|
|
965
1039
|
'loc.stuck': '已经切换,但这个页面还在跑旧代码。刷新页面;用 sideby ui 打开的面板要重启一下。',
|
|
966
1040
|
'loc.reload': '刷新页面',
|
|
1041
|
+
'loc.unconfirmed': '没能确认是否已经切换:这个页面连不上 sideby。刷新页面看看现在跑的是哪个版本。',
|
|
967
1042
|
'upd.open': '更新…',
|
|
968
1043
|
'upd.autoIsOn': '自动更新:开',
|
|
969
1044
|
'upd.autoIsOff': '自动更新:关',
|
|
@@ -981,6 +1056,8 @@ const zh = {
|
|
|
981
1056
|
'upd.now': '更新到 {v}',
|
|
982
1057
|
'upd.updating': '更新中…',
|
|
983
1058
|
'upd.done': '已更新到 sideby {v}。',
|
|
1059
|
+
'upd.confirming': '安装 sideby {v} 时连接断了,正在确认是否已经更新好…',
|
|
1060
|
+
'upd.unconfirmed': '没能确认是否已更新到 sideby {v}:这个页面连不上 sideby。刷新页面看看现在是哪个版本。',
|
|
984
1061
|
'upd.reloading': '等待新版本启动,本页会自动刷新。',
|
|
985
1062
|
'upd.restartHint': '本页仍在运行旧版本。重启 sideby ui(在 Portal 里就刷新页面)后使用新版本。',
|
|
986
1063
|
'upd.skillLabel': '更新 skill',
|
|
@@ -1331,6 +1408,7 @@ const zh = {
|
|
|
1331
1408
|
'ai.examples': '可以这样说(点一下复制):',
|
|
1332
1409
|
'ai.copy': '复制',
|
|
1333
1410
|
'ai.ask.quota': '我哪个 Claude 账号剩余额度最多?',
|
|
1411
|
+
'ai.ask.pick': '加个 cc:每次自动启动额度最多的 Claude 账号。',
|
|
1334
1412
|
'ai.ask.new': '再加一个 Claude 账号,短命令叫 cc009。',
|
|
1335
1413
|
'ai.ask.pin': '把 claude:work 置顶。',
|
|
1336
1414
|
'ai.ask.fix': '检查一下我的账号,把该共享的修好。',
|
|
@@ -1390,6 +1468,7 @@ const zh = {
|
|
|
1390
1468
|
'ask.terminal': '终端',
|
|
1391
1469
|
'ask.chooseAccount': '选一个账号',
|
|
1392
1470
|
'ask.confirm': '将打开 {terminal},在里面启动 {ref}。',
|
|
1471
|
+
'ask.safe': '它的权限检查保持开启,有风险的操作会先经过检查。',
|
|
1393
1472
|
'ask.open': '在 {terminal} 中打开',
|
|
1394
1473
|
'ask.opening': '正在打开…',
|
|
1395
1474
|
'ask.loading': '正在挑选账号…',
|
|
@@ -1427,6 +1506,43 @@ const zh = {
|
|
|
1427
1506
|
'ask.otherTool': '其他工具……',
|
|
1428
1507
|
'ask.otherToolSub': '列表里没有',
|
|
1429
1508
|
'ask.plugin': '让 AI 写插件',
|
|
1509
|
+
'pk.title': '自动选最空的账号',
|
|
1510
|
+
'pk.intro': '每个工具一个短命令,每次启动额度剩得最多的账号。还没有任何额度数据时,启动主账号,并告诉你原因。',
|
|
1511
|
+
'pk.none': '先给某个工具再加一个账号:只有一个账号时没得挑。',
|
|
1512
|
+
'pk.noneYet': '未设置',
|
|
1513
|
+
'pk.exists': '启动额度最多的 {host} 账号。',
|
|
1514
|
+
'pk.start': '启动最空的账号',
|
|
1515
|
+
'pk.startTip': '在终端输入 {name}:启动额度剩得最多的 {host} 账号',
|
|
1516
|
+
'pk.remove': '删除',
|
|
1517
|
+
'pk.removed': '已删除 {name}。',
|
|
1518
|
+
'pk.nameLabel': '{host} 的短命令',
|
|
1519
|
+
'pk.hint': '在终端输入它,就会启动额度最多的 {host} 账号。',
|
|
1520
|
+
'pk.shadows': '这台电脑上已经有 {name} 命令({path})。加上后,在终端输入 {name} 会启动 {host},不再运行原来的命令。',
|
|
1521
|
+
'pk.add': '添加',
|
|
1522
|
+
'pk.addAnyway': '仍然添加',
|
|
1523
|
+
'pk.added': '已添加 {name},新开一个终端窗口就能用。',
|
|
1524
|
+
'pk.newShell': '新加的短命令要在新开的终端窗口里才能用。',
|
|
1525
|
+
'pk.offerShort': '添加 {name}',
|
|
1526
|
+
'pk.offerMore': ':自动选最空的账号',
|
|
1527
|
+
'pk.rename': '改名',
|
|
1528
|
+
'pk.addedSetup': '已添加 {name}。还差一步:让新终端能用它(见上方)。',
|
|
1529
|
+
'pk.renamedSetup': '已把 {old} 改名为 {name}。还差一步:让新终端能用它(见上方)。',
|
|
1530
|
+
'ss.title': '新开的终端还用不了你的短命令。',
|
|
1531
|
+
'ss.body': 'sideby 可以把下面这一行加到 {rc} 末尾:',
|
|
1532
|
+
'ss.add': '加上这一行',
|
|
1533
|
+
'ss.adding': '正在添加…',
|
|
1534
|
+
'ss.added': '已加到 {rc},新开一个终端窗口就能用短命令。',
|
|
1535
|
+
'ss.undo': '撤销',
|
|
1536
|
+
'ss.removed': '已从 {rc} 删掉 sideby 加的那一行。',
|
|
1537
|
+
'pk.save': '保存',
|
|
1538
|
+
'pk.renamed': '已把 {old} 改名为 {name},新开一个终端窗口就能用。',
|
|
1539
|
+
'pk.fileFailed': '配置已保存,但 shell-init 文件没能重写:{msg}',
|
|
1540
|
+
'pk.why.othersFull': '它还没有额度数据,有数据的账号都满了',
|
|
1541
|
+
'pk.offerNoName': '添加短命令:自动选最空的账号',
|
|
1542
|
+
'pk.namePh': '例如 cc',
|
|
1543
|
+
'pk.started': '已在 {terminal} 打开 {ref}({why})。',
|
|
1544
|
+
'pk.why.room': '已用 {n}%,余量最多',
|
|
1545
|
+
'pk.why.noData': '还没有额度数据',
|
|
1430
1546
|
'login.opened': '已打开 {terminal},请在那里登录 {ref}。',
|
|
1431
1547
|
'login.failed': '终端没打开,命令已复制:粘贴到你的终端,按回车。',
|
|
1432
1548
|
'login.automation': '命令已复制。要让 sideby 打开 {terminal},请在「系统设置 → 隐私与安全性 → 自动化」里打开它。',
|
|
@@ -1483,6 +1599,10 @@ const zh = {
|
|
|
1483
1599
|
'menu.copyDir': '复制目录路径',
|
|
1484
1600
|
'menu.copyEmail': '复制邮箱',
|
|
1485
1601
|
'menu.check': '检查这个账号',
|
|
1602
|
+
'menu.editSettings': '打开 {file}',
|
|
1603
|
+
'edit.opened': '已用默认程序打开 {ref} 的 {file}。',
|
|
1604
|
+
'edit.shared': '这个文件是共用的,改动对 {names} 也生效。',
|
|
1605
|
+
'edit.failed': '没能打开 {ref} 的 {file}:{msg}',
|
|
1486
1606
|
'menu.like': '照此新建账号',
|
|
1487
1607
|
'menu.tune': '上下文调优',
|
|
1488
1608
|
'menu.model': '模型和 effort…',
|
|
@@ -1816,6 +1936,30 @@ const zh = {
|
|
|
1816
1936
|
'as.doneOn': '已开启:登录后 sideby 会在后台启动。',
|
|
1817
1937
|
'as.doneOff': '已关闭:登录后不再启动 sideby。',
|
|
1818
1938
|
'as.nextLogin': '下次登录时生效。',
|
|
1939
|
+
'mb.label': '在状态栏显示额度',
|
|
1940
|
+
'mb.hint': '显示最合适账号的已用额度,点任一账号即可在终端启动。',
|
|
1941
|
+
'mb.onTitle': '在状态栏显示额度',
|
|
1942
|
+
'mb.offTitle': '从状态栏隐藏',
|
|
1943
|
+
'mb.writes': 'sideby 会添加下面这个登录项文件,现在立即显示状态栏图标,并在每次登录时启动:',
|
|
1944
|
+
'mb.removes': 'sideby 会停止状态栏图标,并删除下面这个登录项文件:',
|
|
1945
|
+
'mb.turnOn': '开启',
|
|
1946
|
+
'mb.turnOff': '关闭',
|
|
1947
|
+
'mb.hintTitle': '在状态栏看额度',
|
|
1948
|
+
'mb.hintBody': '不用打开面板,看一眼就知道额度够不够继续干活;点一下里面的账号还能直接在终端启动。',
|
|
1949
|
+
'mb.hintYes': '在状态栏显示',
|
|
1950
|
+
'mb.hintNo': '不用了',
|
|
1951
|
+
'mb.noWindow': '额度图标会立刻出现在状态栏,之后每次登录也会自动出现,不会打开其他窗口。',
|
|
1952
|
+
'mb.offNote': '状态栏里的额度图标会立刻消失。',
|
|
1953
|
+
'mb.alreadyOn': '状态栏已经在运行这份 sideby,不用改。',
|
|
1954
|
+
'mb.alreadyOff': '已经是关闭的,不用改。',
|
|
1955
|
+
'mb.doneOn': '看屏幕右上角状态栏里的 sideby 额度图标。如果没看到,可能是状态栏满了:按住 ⌘ 拖动图标腾出位置。',
|
|
1956
|
+
'mb.doneOff': '已从状态栏移除。',
|
|
1957
|
+
'mb.nextLogin': '下次登录时出现。',
|
|
1958
|
+
'mb.stale': '它指向的 sideby 已经不在了。',
|
|
1959
|
+
'mb.other': '它运行的是另一份 sideby,不是现在这份。',
|
|
1960
|
+
'mb.foreign': '同名的登录项不是 sideby 建的,sideby 不动它。',
|
|
1961
|
+
'mb.unsupported': '目前仅支持 macOS。',
|
|
1962
|
+
'ai.ask.menubar': '在状态栏显示我的额度。',
|
|
1819
1963
|
'as.changedSince': '预览之后有变化,请再看一遍。',
|
|
1820
1964
|
'as.block.npx-cache': 'sideby 现在从 npx 缓存运行,npm 可能清掉它,没法从那里登录后启动。先安装:',
|
|
1821
1965
|
'as.block.temp-dir': 'sideby 现在从系统会清空的临时文件夹运行。先安装:',
|
|
@@ -204,6 +204,44 @@ export declare function switchFailure(e: {
|
|
|
204
204
|
network?: boolean;
|
|
205
205
|
status?: number;
|
|
206
206
|
}): 'wait' | 'check' | 'fail';
|
|
207
|
+
/**
|
|
208
|
+
* What a request that may swap the server's code (an Update, a Local Build switch; spec §3.23) has done. `failure` is
|
|
209
|
+
* how the request failed (`switchFailure`), null for an answer. `landed` is what a fresh read of the state says
|
|
210
|
+
* (the version runs, the switch is in place), null while the state cannot be read. `waitedOut`: the wait for the new
|
|
211
|
+
* code is over. Without an answer only the state can confirm success; until the wait is over the page keeps reading.
|
|
212
|
+
*/
|
|
213
|
+
export declare function codeSwapOutcome(s: {
|
|
214
|
+
failure: 'wait' | 'check' | 'fail' | null;
|
|
215
|
+
landed: boolean | null;
|
|
216
|
+
waitedOut: boolean;
|
|
217
|
+
}): 'done' | 'waiting' | 'failed' | 'unknown';
|
|
218
|
+
/**
|
|
219
|
+
* Runs a request that may swap the server's code (an Update, a Local Build switch; spec §3.23). A background Panel
|
|
220
|
+
* restarting from the new code drops the answer, and a Portal moving to it may answer 5xx: without an answer only a
|
|
221
|
+
* fresh read of the state that shows the change counts as success (`codeSwapOutcome`). Each wait starts when the
|
|
222
|
+
* previous step ended, never before the request (an install can take longer than a wait): `windowMs` to confirm the
|
|
223
|
+
* change, reading every `pollMs` and once more at the end, then `windowMs` for the new build, which `reload`s the
|
|
224
|
+
* page. `done(answer)` returns false to stop after it; `stuck` when no new build came, `fail(error)` when the change
|
|
225
|
+
* did not happen, `unknown` when the state never answered.
|
|
226
|
+
*/
|
|
227
|
+
export declare function runCodeSwap(io: {
|
|
228
|
+
send: () => Promise<unknown>;
|
|
229
|
+
/** Reads the state; true when this read answered. */
|
|
230
|
+
readState: () => Promise<boolean>;
|
|
231
|
+
/** What the state just read says: the change is in place (true), is not (false), or cannot tell (null). */
|
|
232
|
+
landed: () => boolean | null;
|
|
233
|
+
newBuild: () => boolean;
|
|
234
|
+
reload: () => void;
|
|
235
|
+
now: () => number;
|
|
236
|
+
pause: (ms: number) => Promise<void>;
|
|
237
|
+
windowMs: number;
|
|
238
|
+
pollMs: number;
|
|
239
|
+
confirming: () => void;
|
|
240
|
+
done: (answer: unknown) => boolean;
|
|
241
|
+
stuck: () => void;
|
|
242
|
+
fail: (error: unknown) => void;
|
|
243
|
+
unknown: () => void;
|
|
244
|
+
}): Promise<void>;
|
|
207
245
|
export declare function panelFixes(f: {
|
|
208
246
|
code?: string;
|
|
209
247
|
}, skillUpdatable: boolean): boolean;
|
|
@@ -364,6 +402,50 @@ export declare function askCopy(task: string, has: (key: string) => boolean, fre
|
|
|
364
402
|
placeholder: string;
|
|
365
403
|
chips: string[];
|
|
366
404
|
};
|
|
405
|
+
/**
|
|
406
|
+
* Whether the Panel hands its AI Tasks to the Portal around it (ADR-0030): createPanelHandler was given
|
|
407
|
+
* `ask: { bridge: 'postMessage' }` and the page sits in a frame. A Panel opened on its own is its own parent; it keeps
|
|
408
|
+
* its header "Let AI do it" button and its own dialog. The page decides this when it loads.
|
|
409
|
+
*/
|
|
410
|
+
export declare function askBridged(boot: {
|
|
411
|
+
ask?: {
|
|
412
|
+
bridge?: string;
|
|
413
|
+
} | null;
|
|
414
|
+
}, win: {
|
|
415
|
+
parent: unknown;
|
|
416
|
+
}): boolean;
|
|
417
|
+
/**
|
|
418
|
+
* Hands an AI Task to the Portal around the Panel (ADR-0030) when `askBridged` says so: posts
|
|
419
|
+
* `{ type: 'local-tools:ask', version: 1, preset, native: { task, text, context }, text }` to the parent with the
|
|
420
|
+
* Panel's own origin as the target, and says it did, so the Panel opens no dialog of its own. Otherwise posts nothing
|
|
421
|
+
* and returns false.
|
|
422
|
+
*/
|
|
423
|
+
export declare function askBridge(boot: {
|
|
424
|
+
ask?: {
|
|
425
|
+
bridge?: string;
|
|
426
|
+
} | null;
|
|
427
|
+
}, opts: {
|
|
428
|
+
task?: string;
|
|
429
|
+
text?: string;
|
|
430
|
+
context?: object | null;
|
|
431
|
+
} | undefined, win: {
|
|
432
|
+
parent: {
|
|
433
|
+
postMessage(message: unknown, targetOrigin: string): void;
|
|
434
|
+
} | null;
|
|
435
|
+
location: {
|
|
436
|
+
origin: string;
|
|
437
|
+
};
|
|
438
|
+
}): boolean;
|
|
439
|
+
/**
|
|
440
|
+
* The "Attached files" section of a Task Prompt (spec §3.28 "附件"), in `lang` (`zh`, otherwise English): one line
|
|
441
|
+
* per file with its absolute path and kind, plus how to look at a video. Empty without files. `heading` goes before
|
|
442
|
+
* the section title, so a prompt with Markdown headings (`## `, a Task Spec from a Portal) gets one of its level.
|
|
443
|
+
* sideby's own Task Prompts and the ones a Portal hands over (ADR-0030) share it, word for word.
|
|
444
|
+
*/
|
|
445
|
+
export declare function attachedSection(files: readonly {
|
|
446
|
+
path: string;
|
|
447
|
+
kind: string;
|
|
448
|
+
}[], lang: string, heading?: string): string;
|
|
367
449
|
/**
|
|
368
450
|
* The Task Prompt of an AI Task (spec §3.28), in `lang` (`zh`, otherwise English): what to do, the context given,
|
|
369
451
|
* the fixed rules, pointers for the task and the invitation to contribute. For `free` the user's `text` is what to
|
|
@@ -500,3 +582,26 @@ export declare function handoffTaskFacts(settings: {
|
|
|
500
582
|
}[];
|
|
501
583
|
nextSteps?: readonly string[];
|
|
502
584
|
} | null): string[];
|
|
585
|
+
/**
|
|
586
|
+
* Whether a click on `target` inside a foldable row leaves the row as it is: a control, a tooltip, or anything in
|
|
587
|
+
* the open details, whose lines (a Same Login row's directories among them) are there to use, not to close the row.
|
|
588
|
+
*/
|
|
589
|
+
export declare function foldSkips(target: {
|
|
590
|
+
closest(selector: string): unknown;
|
|
591
|
+
}): boolean;
|
|
592
|
+
/** The Panel's layout bands, widest first; page-styles.ts hangs its narrow-screen rules on them. */
|
|
593
|
+
export type WidthTier = 'wide' | 'medium' | 'narrow' | 'phone';
|
|
594
|
+
/** The layout band for a viewport `width` in CSS pixels: up to 560 phone, up to 760 narrow, up to 1100 medium. */
|
|
595
|
+
export declare function widthTier(width: number): WidthTier;
|
|
596
|
+
/**
|
|
597
|
+
* Follows a viewport width that changes frame by frame (a window being dragged, a Portal's sidebar sliding open
|
|
598
|
+
* around the Panel's frame) and calls `apply` with the new band as soon as the width crosses into one, so the layout
|
|
599
|
+
* moves together with the sliding edge instead of after it. For `settleMs` after that (restarted while the width keeps
|
|
600
|
+
* moving) it only notes further crossings, then applies the band the width came to rest in if that differs, so one
|
|
601
|
+
* gesture changes the layout at most twice and never flickers on every frame. Returns the function to call with each
|
|
602
|
+
* new width.
|
|
603
|
+
*/
|
|
604
|
+
export declare function widthFollower<T>(shown: T, tierOf: (width: number) => T, apply: (tier: T) => void, settleMs: number, timers: {
|
|
605
|
+
set: (fn: () => void, ms: number) => unknown;
|
|
606
|
+
clear: (id: unknown) => void;
|
|
607
|
+
}): (width: number) => void;
|
|
@@ -393,6 +393,73 @@ export function switchFailure(e) {
|
|
|
393
393
|
return 'wait';
|
|
394
394
|
return (e.status ?? 0) >= 500 ? 'check' : 'fail';
|
|
395
395
|
}
|
|
396
|
+
/**
|
|
397
|
+
* What a request that may swap the server's code (an Update, a Local Build switch; spec §3.23) has done. `failure` is
|
|
398
|
+
* how the request failed (`switchFailure`), null for an answer. `landed` is what a fresh read of the state says
|
|
399
|
+
* (the version runs, the switch is in place), null while the state cannot be read. `waitedOut`: the wait for the new
|
|
400
|
+
* code is over. Without an answer only the state can confirm success; until the wait is over the page keeps reading.
|
|
401
|
+
*/
|
|
402
|
+
export function codeSwapOutcome(s) {
|
|
403
|
+
if (s.failure === null)
|
|
404
|
+
return 'done';
|
|
405
|
+
if (s.failure === 'fail')
|
|
406
|
+
return 'failed';
|
|
407
|
+
if (s.landed === true)
|
|
408
|
+
return 'done';
|
|
409
|
+
if (!s.waitedOut)
|
|
410
|
+
return 'waiting';
|
|
411
|
+
return s.landed === false ? 'failed' : 'unknown';
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* Runs a request that may swap the server's code (an Update, a Local Build switch; spec §3.23). A background Panel
|
|
415
|
+
* restarting from the new code drops the answer, and a Portal moving to it may answer 5xx: without an answer only a
|
|
416
|
+
* fresh read of the state that shows the change counts as success (`codeSwapOutcome`). Each wait starts when the
|
|
417
|
+
* previous step ended, never before the request (an install can take longer than a wait): `windowMs` to confirm the
|
|
418
|
+
* change, reading every `pollMs` and once more at the end, then `windowMs` for the new build, which `reload`s the
|
|
419
|
+
* page. `done(answer)` returns false to stop after it; `stuck` when no new build came, `fail(error)` when the change
|
|
420
|
+
* did not happen, `unknown` when the state never answered.
|
|
421
|
+
*/
|
|
422
|
+
export async function runCodeSwap(io) {
|
|
423
|
+
let answer = null;
|
|
424
|
+
let error = null;
|
|
425
|
+
let failure = null;
|
|
426
|
+
try {
|
|
427
|
+
answer = await io.send();
|
|
428
|
+
}
|
|
429
|
+
catch (e) {
|
|
430
|
+
error = e;
|
|
431
|
+
failure = switchFailure((e ?? {}));
|
|
432
|
+
}
|
|
433
|
+
const cut = failure === 'wait' || failure === 'check';
|
|
434
|
+
if (cut)
|
|
435
|
+
io.confirming();
|
|
436
|
+
let until = io.now() + io.windowMs;
|
|
437
|
+
for (;;) {
|
|
438
|
+
const landed = cut ? ((await io.readState()) ? io.landed() : null) : null;
|
|
439
|
+
// The server runs another build: the change is in place, and this page reloads into it.
|
|
440
|
+
if (io.newBuild())
|
|
441
|
+
return io.reload();
|
|
442
|
+
const out = codeSwapOutcome({ failure, landed, waitedOut: io.now() > until });
|
|
443
|
+
if (out === 'failed')
|
|
444
|
+
return io.fail(error);
|
|
445
|
+
if (out === 'unknown')
|
|
446
|
+
return io.unknown();
|
|
447
|
+
if (out === 'done')
|
|
448
|
+
break;
|
|
449
|
+
await io.pause(io.pollMs);
|
|
450
|
+
}
|
|
451
|
+
if (!io.done(answer))
|
|
452
|
+
return;
|
|
453
|
+
until = io.now() + io.windowMs;
|
|
454
|
+
for (;;) {
|
|
455
|
+
if (io.newBuild())
|
|
456
|
+
return io.reload();
|
|
457
|
+
if (io.now() > until)
|
|
458
|
+
return io.stuck();
|
|
459
|
+
await io.pause(io.pollMs);
|
|
460
|
+
await io.readState();
|
|
461
|
+
}
|
|
462
|
+
}
|
|
396
463
|
export function panelFixes(f, skillUpdatable) {
|
|
397
464
|
return skillUpdatable && f.code === 'skill.outdated';
|
|
398
465
|
}
|
|
@@ -637,6 +704,62 @@ export function askCopy(task, has, freeChips) {
|
|
|
637
704
|
const chips = own ? [1, 2, 3].map((n) => 'ask.ex.' + task + '.' + n).filter(has) : [];
|
|
638
705
|
return { title, placeholder, chips: chips.length ? chips : freeChips.slice() };
|
|
639
706
|
}
|
|
707
|
+
/**
|
|
708
|
+
* Whether the Panel hands its AI Tasks to the Portal around it (ADR-0030): createPanelHandler was given
|
|
709
|
+
* `ask: { bridge: 'postMessage' }` and the page sits in a frame. A Panel opened on its own is its own parent; it keeps
|
|
710
|
+
* its header "Let AI do it" button and its own dialog. The page decides this when it loads.
|
|
711
|
+
*/
|
|
712
|
+
export function askBridged(boot, win) {
|
|
713
|
+
return boot.ask?.bridge === 'postMessage' && Boolean(win.parent) && win.parent !== win;
|
|
714
|
+
}
|
|
715
|
+
/**
|
|
716
|
+
* Hands an AI Task to the Portal around the Panel (ADR-0030) when `askBridged` says so: posts
|
|
717
|
+
* `{ type: 'local-tools:ask', version: 1, preset, native: { task, text, context }, text }` to the parent with the
|
|
718
|
+
* Panel's own origin as the target, and says it did, so the Panel opens no dialog of its own. Otherwise posts nothing
|
|
719
|
+
* and returns false.
|
|
720
|
+
*/
|
|
721
|
+
export function askBridge(boot, opts, win) {
|
|
722
|
+
if (!askBridged(boot, win) || !win.parent)
|
|
723
|
+
return false;
|
|
724
|
+
const o = opts || {};
|
|
725
|
+
const task = o.task || 'free';
|
|
726
|
+
const text = o.text || '';
|
|
727
|
+
win.parent.postMessage({
|
|
728
|
+
type: 'local-tools:ask',
|
|
729
|
+
version: 1,
|
|
730
|
+
preset: task,
|
|
731
|
+
native: { task, text, context: o.context || {} },
|
|
732
|
+
text,
|
|
733
|
+
}, win.location.origin);
|
|
734
|
+
return true;
|
|
735
|
+
}
|
|
736
|
+
/**
|
|
737
|
+
* The "Attached files" section of a Task Prompt (spec §3.28 "附件"), in `lang` (`zh`, otherwise English): one line
|
|
738
|
+
* per file with its absolute path and kind, plus how to look at a video. Empty without files. `heading` goes before
|
|
739
|
+
* the section title, so a prompt with Markdown headings (`## `, a Task Spec from a Portal) gets one of its level.
|
|
740
|
+
* sideby's own Task Prompts and the ones a Portal hands over (ADR-0030) share it, word for word.
|
|
741
|
+
*/
|
|
742
|
+
export function attachedSection(files, lang, heading = '') {
|
|
743
|
+
if (!files.length)
|
|
744
|
+
return '';
|
|
745
|
+
const L = lang === 'zh'
|
|
746
|
+
? {
|
|
747
|
+
attached: '附件',
|
|
748
|
+
image: '图片',
|
|
749
|
+
video: '视频',
|
|
750
|
+
videoHint: '需要看视频内容时,用 ffmpeg 抽几帧再看,例如 `ffmpeg -i <视频> -vf fps=1 -frames:v 5 frame-%d.png`。',
|
|
751
|
+
}
|
|
752
|
+
: {
|
|
753
|
+
attached: 'Attached files',
|
|
754
|
+
image: 'image',
|
|
755
|
+
video: 'video',
|
|
756
|
+
videoHint: 'To see what a video shows, extract a few frames with ffmpeg first, for example `ffmpeg -i <video> -vf fps=1 -frames:v 5 frame-%d.png`.',
|
|
757
|
+
};
|
|
758
|
+
const lines = files.map((f) => '- ' + f.path + ' (' + (f.kind === 'video' ? L.video : L.image) + ')');
|
|
759
|
+
if (files.some((f) => f.kind === 'video'))
|
|
760
|
+
lines.push(L.videoHint);
|
|
761
|
+
return heading + L.attached + '\n' + lines.join('\n');
|
|
762
|
+
}
|
|
640
763
|
/**
|
|
641
764
|
* The Task Prompt of an AI Task (spec §3.28), in `lang` (`zh`, otherwise English): what to do, the context given,
|
|
642
765
|
* the fixed rules, pointers for the task and the invitation to contribute. For `free` the user's `text` is what to
|
|
@@ -688,10 +811,6 @@ export function taskPrompt(input, strip) {
|
|
|
688
811
|
pHost: '用 `sideby plugins new <id>` 生成插件骨架;收集事实时写明宿主的版本和日期;用 `sideby plugins check <id>` 检查,并在演示 HOME 里试一遍。',
|
|
689
812
|
pPlugin: '照 sideby 仓库的插件指南 docs/guide/plugins.zh-CN.md 写;写完用 `sideby plugins check <id>` 检查。',
|
|
690
813
|
pTerminal: "先问我用的是什么终端。只看这个终端的官方文档和它的 `--help`,找出「在指定目录新开一个窗口运行一条命令」的写法,写明你看的版本。写成一个模板:`{cmd}` 是要运行的命令,`{cwd}` 是文件夹,sideby 按参数填入,不经过 shell。保存要用 `sideby terminal --custom '<模板>'`,它会改 sideby 的设置,先问我。保存后让我在面板上点一次「让 AI 帮我」试一下,打不开就一起看错误再改。",
|
|
691
|
-
attached: '附件',
|
|
692
|
-
image: '图片',
|
|
693
|
-
video: '视频',
|
|
694
|
-
videoHint: '需要看视频内容时,用 ffmpeg 抽几帧再看,例如 `ffmpeg -i <视频> -vf fps=1 -frames:v 5 frame-%d.png`。',
|
|
695
814
|
share: '做好之后,问我愿不愿意把这次的改进分享给 sideby。我同意后,按 sideby 仓库的 CONTRIBUTING.md 提一个 pull request,提交前去掉我自己的账号名、路径和邮箱。',
|
|
696
815
|
shareTerminal: '跑通之后,问我愿不愿意把这个终端做成 sideby 的内置终端。我同意后,在 sideby 仓库 src/core/terminal.ts 的终端表里加一行并补上测试,按 CONTRIBUTING.md 提一个 pull request,提交前去掉我自己的账号名、路径和邮箱。',
|
|
697
816
|
}
|
|
@@ -731,10 +850,6 @@ export function taskPrompt(input, strip) {
|
|
|
731
850
|
pHost: 'Start with `sideby plugins new <id>`; note the Host version and the date with every fact you gather; check it with `sideby plugins check <id>` and try it in a demo HOME.',
|
|
732
851
|
pPlugin: 'Follow the plugins guide in the sideby repository (docs/guide/plugins.md); check it with `sideby plugins check <id>`.',
|
|
733
852
|
pTerminal: "Ask me which terminal I use first. Read only that terminal's official docs and its `--help` to find how it opens a new window that runs one command in a given folder, and note the version you read. Write it as a template: `{cmd}` is the command and `{cwd}` the folder; sideby fills them in as separate arguments, no shell runs it. Save it with `sideby terminal --custom '<template>'`, which changes sideby's settings, so ask me first. Then have me click Let AI do it in the Panel once to try it; if it does not open, look at the error with me and fix the template.",
|
|
734
|
-
attached: 'Attached files',
|
|
735
|
-
image: 'image',
|
|
736
|
-
video: 'video',
|
|
737
|
-
videoHint: 'To see what a video shows, extract a few frames with ffmpeg first, for example `ffmpeg -i <video> -vf fps=1 -frames:v 5 frame-%d.png`.',
|
|
738
853
|
share: 'When it works, ask me whether to share the improvement with sideby. Only with my yes, follow the CONTRIBUTING.md of the sideby repository to open a pull request, and first remove my own account names, paths and emails.',
|
|
739
854
|
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.',
|
|
740
855
|
};
|
|
@@ -784,13 +899,9 @@ export function taskPrompt(input, strip) {
|
|
|
784
899
|
facts.push('- ' + L.cLang);
|
|
785
900
|
const pointer = L['p' + task.charAt(0).toUpperCase() + task.slice(1)];
|
|
786
901
|
const parts = [L.task + '\n' + what, L.context + '\n' + facts.join('\n')];
|
|
787
|
-
const
|
|
788
|
-
if (
|
|
789
|
-
|
|
790
|
-
if (files.some((f) => f.kind === 'video'))
|
|
791
|
-
lines.push(L.videoHint);
|
|
792
|
-
parts.push(L.attached + '\n' + lines.join('\n'));
|
|
793
|
-
}
|
|
902
|
+
const attached = attachedSection(input.attachments || [], input.lang);
|
|
903
|
+
if (attached)
|
|
904
|
+
parts.push(attached);
|
|
794
905
|
parts.push(L.rules + '\n- ' + L.r1 + '\n- ' + L.r2 + '\n- ' + L.r3);
|
|
795
906
|
if (pointer)
|
|
796
907
|
parts.push(L.pointers + '\n' + pointer);
|
|
@@ -923,3 +1034,47 @@ export function handoffTaskFacts(settings, starters, accounts, now, status) {
|
|
|
923
1034
|
out.push('next steps: ' + status.nextSteps.join('; '));
|
|
924
1035
|
return out;
|
|
925
1036
|
}
|
|
1037
|
+
/**
|
|
1038
|
+
* Whether a click on `target` inside a foldable row leaves the row as it is: a control, a tooltip, or anything in
|
|
1039
|
+
* the open details, whose lines (a Same Login row's directories among them) are there to use, not to close the row.
|
|
1040
|
+
*/
|
|
1041
|
+
export function foldSkips(target) {
|
|
1042
|
+
return Boolean(target.closest('button, a, input, select, textarea, .tip, .row-detail'));
|
|
1043
|
+
}
|
|
1044
|
+
/** The layout band for a viewport `width` in CSS pixels: up to 560 phone, up to 760 narrow, up to 1100 medium. */
|
|
1045
|
+
export function widthTier(width) {
|
|
1046
|
+
return width <= 560 ? 'phone' : width <= 760 ? 'narrow' : width <= 1100 ? 'medium' : 'wide';
|
|
1047
|
+
}
|
|
1048
|
+
/**
|
|
1049
|
+
* Follows a viewport width that changes frame by frame (a window being dragged, a Portal's sidebar sliding open
|
|
1050
|
+
* around the Panel's frame) and calls `apply` with the new band as soon as the width crosses into one, so the layout
|
|
1051
|
+
* moves together with the sliding edge instead of after it. For `settleMs` after that (restarted while the width keeps
|
|
1052
|
+
* moving) it only notes further crossings, then applies the band the width came to rest in if that differs, so one
|
|
1053
|
+
* gesture changes the layout at most twice and never flickers on every frame. Returns the function to call with each
|
|
1054
|
+
* new width.
|
|
1055
|
+
*/
|
|
1056
|
+
export function widthFollower(shown, tierOf, apply, settleMs, timers) {
|
|
1057
|
+
let current = shown;
|
|
1058
|
+
let latest = shown;
|
|
1059
|
+
let timer = null;
|
|
1060
|
+
const settle = () => {
|
|
1061
|
+
timer = null;
|
|
1062
|
+
if (latest === current)
|
|
1063
|
+
return;
|
|
1064
|
+
current = latest;
|
|
1065
|
+
apply(latest);
|
|
1066
|
+
};
|
|
1067
|
+
return (width) => {
|
|
1068
|
+
latest = tierOf(width);
|
|
1069
|
+
if (timer !== null) {
|
|
1070
|
+
timers.clear(timer);
|
|
1071
|
+
timer = timers.set(settle, settleMs);
|
|
1072
|
+
return;
|
|
1073
|
+
}
|
|
1074
|
+
if (latest === current)
|
|
1075
|
+
return;
|
|
1076
|
+
current = latest;
|
|
1077
|
+
apply(latest);
|
|
1078
|
+
timer = timers.set(settle, settleMs);
|
|
1079
|
+
};
|
|
1080
|
+
}
|