sideby 0.29.0 → 0.30.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build.json +1 -1
- package/dist/src/cli/commands.d.ts +10 -0
- package/dist/src/cli/commands.js +306 -8
- package/dist/src/cli/json-schemas.js +75 -1
- package/dist/src/cli/main.js +83 -4
- package/dist/src/core/config.d.ts +25 -0
- package/dist/src/core/config.js +34 -0
- package/dist/src/core/fs-safe.d.ts +22 -1
- package/dist/src/core/fs-safe.js +68 -1
- package/dist/src/core/handoff-run.d.ts +2 -0
- package/dist/src/core/handoff-run.js +12 -6
- package/dist/src/core/launch.d.ts +6 -1
- package/dist/src/core/messages.js +9 -31
- package/dist/src/core/network.d.ts +5 -2
- package/dist/src/core/network.js +15 -45
- package/dist/src/core/search-catalog.d.ts +1 -1
- package/dist/src/core/search-catalog.js +37 -0
- package/dist/src/core/session-hooks.d.ts +33 -0
- package/dist/src/core/session-hooks.js +92 -0
- package/dist/src/core/unattended-ended.d.ts +62 -0
- package/dist/src/core/unattended-ended.js +275 -0
- package/dist/src/core/unattended-pending.d.ts +56 -0
- package/dist/src/core/unattended-pending.js +182 -0
- package/dist/src/core/unattended-state.d.ts +129 -0
- package/dist/src/core/unattended-state.js +373 -0
- package/dist/src/core/unattended.d.ts +142 -0
- package/dist/src/core/unattended.js +349 -0
- package/dist/src/panel/background.js +8 -0
- package/dist/src/panel/handler.d.ts +37 -0
- package/dist/src/panel/handler.js +153 -1
- package/dist/src/panel/i18n.d.ts +97 -0
- package/dist/src/panel/i18n.js +194 -0
- package/dist/src/panel/page-logic.d.ts +129 -0
- package/dist/src/panel/page-logic.js +166 -0
- package/dist/src/panel/page-script.js +638 -7
- package/dist/src/panel/page-styles.js +69 -0
- package/dist/src/panel/page.js +2 -0
- package/dist/src/plugins/bus.js +1 -0
- package/dist/src/runtime.d.ts +17 -1
- package/dist/src/runtime.js +78 -15
- package/dist/src/types.d.ts +48 -0
- package/dist/src/unattended/hook.d.ts +46 -0
- package/dist/src/unattended/hook.js +288 -0
- package/package.json +1 -1
- package/schemas/config.json +76 -0
- package/schemas/unattended-defer.json +143 -0
- package/schemas/unattended-pending.json +154 -0
- package/schemas/unattended.json +291 -0
- package/skills/sideby/SKILL.md +2 -1
- package/skills/sideby/references/unattended.md +58 -0
package/dist/src/panel/i18n.d.ts
CHANGED
|
@@ -1476,6 +1476,103 @@ declare const en: {
|
|
|
1476
1476
|
'banner.plugins.one': string;
|
|
1477
1477
|
'banner.plugins.other': string;
|
|
1478
1478
|
'banner.pluginsHint': string;
|
|
1479
|
+
'page.unattended': string;
|
|
1480
|
+
'ua.title': string;
|
|
1481
|
+
'ua.intro': string;
|
|
1482
|
+
'ua.ask': string;
|
|
1483
|
+
'ua.on': string;
|
|
1484
|
+
'ua.off': string;
|
|
1485
|
+
'ua.paused': string;
|
|
1486
|
+
'ua.byHand': string;
|
|
1487
|
+
'ua.slotQuoted': string;
|
|
1488
|
+
'ua.slotN': string;
|
|
1489
|
+
'ua.untilToday': string;
|
|
1490
|
+
'ua.untilDay': string;
|
|
1491
|
+
'ua.backToday': string;
|
|
1492
|
+
'ua.backDay': string;
|
|
1493
|
+
'ua.nextToday': string;
|
|
1494
|
+
'ua.nextDay': string;
|
|
1495
|
+
'ua.today': string;
|
|
1496
|
+
'ua.tomorrow': string;
|
|
1497
|
+
'ua.noEnd': string;
|
|
1498
|
+
'ua.pausedOpen': string;
|
|
1499
|
+
'ua.onNote': string;
|
|
1500
|
+
'ua.offNote': string;
|
|
1501
|
+
'ua.pausedNote': string;
|
|
1502
|
+
'ua.turnOn': string;
|
|
1503
|
+
'ua.turnOff': string;
|
|
1504
|
+
'ua.pauseSlot': string;
|
|
1505
|
+
'ua.pause': string;
|
|
1506
|
+
'ua.for': string;
|
|
1507
|
+
'ua.choice.slotNow': string;
|
|
1508
|
+
'ua.choice.slotNext': string;
|
|
1509
|
+
'ua.choice.4h': string;
|
|
1510
|
+
'ua.choice.12h': string;
|
|
1511
|
+
'ua.choice.time': string;
|
|
1512
|
+
'ua.pickTime': string;
|
|
1513
|
+
'ua.pickHint': string;
|
|
1514
|
+
'ua.turnOnGo': string;
|
|
1515
|
+
'ua.toastOn': string;
|
|
1516
|
+
'ua.toastOnAlways': string;
|
|
1517
|
+
'ua.toastOff': string;
|
|
1518
|
+
'ua.toastPaused': string;
|
|
1519
|
+
'ua.toastPausedOpen': string;
|
|
1520
|
+
'ua.undone': string;
|
|
1521
|
+
'ua.badge': string;
|
|
1522
|
+
'ua.badgeOn': string;
|
|
1523
|
+
'ua.badgeTitle': string;
|
|
1524
|
+
'ua.firstUse': string;
|
|
1525
|
+
'ua.schedule': string;
|
|
1526
|
+
'ua.scheduleNote': string;
|
|
1527
|
+
'ua.scheduleEmpty': string;
|
|
1528
|
+
'ua.addSlot': string;
|
|
1529
|
+
'ua.preset': string;
|
|
1530
|
+
'ua.presetName': string;
|
|
1531
|
+
'ua.presetAdded': string;
|
|
1532
|
+
'ua.slotAdded': string;
|
|
1533
|
+
'ua.slotRemoved': string;
|
|
1534
|
+
'ua.saved': string;
|
|
1535
|
+
'ua.days': string;
|
|
1536
|
+
'ua.daysOf': string;
|
|
1537
|
+
'ua.keepDay': string;
|
|
1538
|
+
'ua.startOf': string;
|
|
1539
|
+
'ua.endOf': string;
|
|
1540
|
+
'ua.overnight': string;
|
|
1541
|
+
'ua.allDay': string;
|
|
1542
|
+
'ua.remove': string;
|
|
1543
|
+
'ua.pending': string;
|
|
1544
|
+
'ua.pendingNote': string;
|
|
1545
|
+
'ua.pendingEmpty': string;
|
|
1546
|
+
'ua.pendingBlocked': string;
|
|
1547
|
+
'ua.loading': string;
|
|
1548
|
+
'ua.kind.question': string;
|
|
1549
|
+
'ua.kind.deferred': string;
|
|
1550
|
+
'ua.kind.permission': string;
|
|
1551
|
+
'ua.agent': string;
|
|
1552
|
+
'ua.done': string;
|
|
1553
|
+
'ua.allDone': string;
|
|
1554
|
+
'ua.doneOne': string;
|
|
1555
|
+
'ua.doneMany.one': string;
|
|
1556
|
+
'ua.doneMany.other': string;
|
|
1557
|
+
'ua.waiting.one': string;
|
|
1558
|
+
'ua.waiting.other': string;
|
|
1559
|
+
'ua.back': string;
|
|
1560
|
+
'ua.backLive': string;
|
|
1561
|
+
'ua.liveIn': string;
|
|
1562
|
+
'ua.ended': string;
|
|
1563
|
+
'ua.noSession': string;
|
|
1564
|
+
'ua.resumeWhat': string;
|
|
1565
|
+
'ua.more': string;
|
|
1566
|
+
'ua.less': string;
|
|
1567
|
+
'ua.cover': string;
|
|
1568
|
+
'ua.coverLine': string;
|
|
1569
|
+
'ua.codexTrust': string;
|
|
1570
|
+
'ua.notSupported': string;
|
|
1571
|
+
'ua.listSep': string;
|
|
1572
|
+
'ua.readOnly': string;
|
|
1573
|
+
'ua.problem': string;
|
|
1574
|
+
'ua.unreadable': string;
|
|
1575
|
+
'ai.ask.unattended': string;
|
|
1479
1576
|
};
|
|
1480
1577
|
export type MessageKey = keyof typeof en;
|
|
1481
1578
|
export declare const MESSAGES: Record<PanelLang, Record<string, string>>;
|
package/dist/src/panel/i18n.js
CHANGED
|
@@ -1478,6 +1478,103 @@ const en = {
|
|
|
1478
1478
|
'banner.plugins.one': '{n} plugin problem.',
|
|
1479
1479
|
'banner.plugins.other': '{n} plugin problems.',
|
|
1480
1480
|
'banner.pluginsHint': 'Run sideby plugins for details.',
|
|
1481
|
+
'page.unattended': 'Unattended',
|
|
1482
|
+
'ua.title': 'Unattended Mode',
|
|
1483
|
+
'ua.intro': 'While you are away, sessions sideby starts keep going instead of stopping to wait for you. Turn it on before you step away, or let a Schedule do it every night.',
|
|
1484
|
+
'ua.ask': 'Let AI help',
|
|
1485
|
+
'ua.on': 'On',
|
|
1486
|
+
'ua.off': 'Off',
|
|
1487
|
+
'ua.paused': 'Paused',
|
|
1488
|
+
'ua.byHand': 'turned on by you',
|
|
1489
|
+
'ua.slotQuoted': 'Slot “{name}”',
|
|
1490
|
+
'ua.slotN': 'Slot {n}',
|
|
1491
|
+
'ua.untilToday': 'until {time}',
|
|
1492
|
+
'ua.untilDay': 'until {day} {time}',
|
|
1493
|
+
'ua.backToday': 'back on at {time}',
|
|
1494
|
+
'ua.backDay': 'back on {day} {time}',
|
|
1495
|
+
'ua.nextToday': 'next: {time}',
|
|
1496
|
+
'ua.nextDay': 'next: {day} {time}',
|
|
1497
|
+
'ua.today': 'today',
|
|
1498
|
+
'ua.tomorrow': 'tomorrow',
|
|
1499
|
+
'ua.noEnd': 'stays on: your Schedule covers every hour',
|
|
1500
|
+
'ua.pausedOpen': 'until you turn it on again',
|
|
1501
|
+
'ua.onNote': 'Sessions sideby starts do not stop to wait for you. Questions go on with the recommended choice; a step Claude Code wants you to confirm is refused, and the session finds another way or skips it. What they skipped is listed below.',
|
|
1502
|
+
'ua.offNote': 'When it is on, sessions sideby starts do not stop to wait for you: no questions, and no prompts asking you to confirm a step.',
|
|
1503
|
+
'ua.pausedNote': 'Until then, sessions ask you as usual. Turn it on now to go back.',
|
|
1504
|
+
'ua.turnOn': 'Turn on now',
|
|
1505
|
+
'ua.turnOff': 'Turn off now',
|
|
1506
|
+
'ua.pauseSlot': 'Pause until this Slot ends',
|
|
1507
|
+
'ua.pause': 'Pause',
|
|
1508
|
+
'ua.for': 'How long?',
|
|
1509
|
+
'ua.choice.slotNow': 'Until this Slot ends',
|
|
1510
|
+
'ua.choice.slotNext': 'Until the next Slot ends',
|
|
1511
|
+
'ua.choice.4h': '4 hours',
|
|
1512
|
+
'ua.choice.12h': '12 hours',
|
|
1513
|
+
'ua.choice.time': 'Until a time',
|
|
1514
|
+
'ua.pickTime': 'Time to turn it off',
|
|
1515
|
+
'ua.pickHint': 'Pick a time',
|
|
1516
|
+
'ua.turnOnGo': 'Turn on',
|
|
1517
|
+
'ua.toastOn': 'Unattended Mode is on, {until}.',
|
|
1518
|
+
'ua.toastOnAlways': 'Unattended Mode is on.',
|
|
1519
|
+
'ua.toastOff': 'Unattended Mode is off.',
|
|
1520
|
+
'ua.toastPaused': 'Paused, {back}.',
|
|
1521
|
+
'ua.toastPausedOpen': 'Paused until you turn it on again.',
|
|
1522
|
+
'ua.undone': 'Undone.',
|
|
1523
|
+
'ua.badge': 'Unattended · {until}',
|
|
1524
|
+
'ua.badgeOn': 'Unattended',
|
|
1525
|
+
'ua.badgeTitle': 'Sessions sideby starts do not stop to ask you. Open the Unattended page.',
|
|
1526
|
+
'ua.firstUse': 'Sessions you start from now on are covered. Sessions already running started without it: start them again to cover them.',
|
|
1527
|
+
'ua.schedule': 'Schedule',
|
|
1528
|
+
'ua.scheduleNote': 'It turns on by itself at these times, in this computer’s time zone. Changes save at once.',
|
|
1529
|
+
'ua.scheduleEmpty': 'No Slot yet. Add one, and Unattended Mode turns on by itself at that time.',
|
|
1530
|
+
'ua.addSlot': 'Add a Slot',
|
|
1531
|
+
'ua.preset': 'Weeknights 23:00–08:00',
|
|
1532
|
+
'ua.presetName': 'Weeknights',
|
|
1533
|
+
'ua.presetAdded': 'Added Weeknights 23:00–08:00.',
|
|
1534
|
+
'ua.slotAdded': 'Slot added.',
|
|
1535
|
+
'ua.slotRemoved': 'Slot removed.',
|
|
1536
|
+
'ua.saved': 'Schedule saved.',
|
|
1537
|
+
'ua.days': 'Mo,Tu,We,Th,Fr,Sa,Su',
|
|
1538
|
+
'ua.daysOf': 'Days of {slot}',
|
|
1539
|
+
'ua.keepDay': 'A Slot needs at least one day',
|
|
1540
|
+
'ua.startOf': 'Start of {slot}',
|
|
1541
|
+
'ua.endOf': 'End of {slot}',
|
|
1542
|
+
'ua.overnight': 'next day',
|
|
1543
|
+
'ua.allDay': 'all day',
|
|
1544
|
+
'ua.remove': 'Remove {slot}',
|
|
1545
|
+
'ua.pending': 'Waiting for you',
|
|
1546
|
+
'ua.pendingNote': 'Questions sessions did not ask you, steps that needed your OK, and steps they skipped. Nothing here was done.',
|
|
1547
|
+
'ua.pendingEmpty': 'Nothing is waiting for you.',
|
|
1548
|
+
'ua.pendingBlocked': 'sideby cannot read them until the folder named above is fixed.',
|
|
1549
|
+
'ua.loading': 'Reading…',
|
|
1550
|
+
'ua.kind.question': 'Question',
|
|
1551
|
+
'ua.kind.deferred': 'Not done',
|
|
1552
|
+
'ua.kind.permission': 'Needed your OK',
|
|
1553
|
+
'ua.agent': 'in subagent {type}',
|
|
1554
|
+
'ua.done': 'Done',
|
|
1555
|
+
'ua.allDone': 'Mark all done',
|
|
1556
|
+
'ua.doneOne': 'Marked done.',
|
|
1557
|
+
'ua.doneMany.one': 'Marked {n} done.',
|
|
1558
|
+
'ua.doneMany.other': 'Marked {n} done.',
|
|
1559
|
+
'ua.waiting.one': '{n} thing waits for you',
|
|
1560
|
+
'ua.waiting.other': '{n} things wait for you',
|
|
1561
|
+
'ua.back': 'Back to the session',
|
|
1562
|
+
'ua.backLive': 'Show it on the Sessions page',
|
|
1563
|
+
'ua.liveIn': 'Still running in {account}',
|
|
1564
|
+
'ua.ended': 'Ended',
|
|
1565
|
+
'ua.noSession': 'Not tied to a session',
|
|
1566
|
+
'ua.resumeWhat': 'the command that resumes it; paste it into a terminal',
|
|
1567
|
+
'ua.more': 'Show all',
|
|
1568
|
+
'ua.less': 'Show less',
|
|
1569
|
+
'ua.cover': 'Where it works',
|
|
1570
|
+
'ua.coverLine': 'Only in Claude Code and Codex sessions that sideby starts. Running claude or codex yourself is not covered.',
|
|
1571
|
+
'ua.codexTrust': 'Codex: only its questions. Open {cmd} in Codex once and trust sideby’s hook; Codex’s own approval prompts still wait for you.',
|
|
1572
|
+
'ua.notSupported': '{hosts}: not supported yet.',
|
|
1573
|
+
'ua.listSep': ', ',
|
|
1574
|
+
'ua.readOnly': 'Read-only view. Use sideby unattended to change it.',
|
|
1575
|
+
'ua.problem': 'sideby cannot keep its state: {msg}',
|
|
1576
|
+
'ua.unreadable': 'sideby could not read Unattended Mode. Refresh to try again.',
|
|
1577
|
+
'ai.ask.unattended': 'Run unattended tonight, until 8 tomorrow morning.',
|
|
1481
1578
|
};
|
|
1482
1579
|
const zh = {
|
|
1483
1580
|
'top.tagline': '所有 AI 编程账号,并排运行。',
|
|
@@ -2956,5 +3053,102 @@ const zh = {
|
|
|
2956
3053
|
'banner.plugins.one': '{n} 个插件问题。',
|
|
2957
3054
|
'banner.plugins.other': '{n} 个插件问题。',
|
|
2958
3055
|
'banner.pluginsHint': '运行 sideby plugins 查看详情。',
|
|
3056
|
+
'page.unattended': '无人值守',
|
|
3057
|
+
'ua.title': '无人值守',
|
|
3058
|
+
'ua.intro': '你不在的时候,sideby 启动的会话继续跑,不停下来等你。离开前打开,或者设个时间表每晚自动开。',
|
|
3059
|
+
'ua.ask': '让 AI 帮我',
|
|
3060
|
+
'ua.on': '已开启',
|
|
3061
|
+
'ua.off': '未开启',
|
|
3062
|
+
'ua.paused': '已暂停',
|
|
3063
|
+
'ua.byHand': '手动开启',
|
|
3064
|
+
'ua.slotQuoted': '时段『{name}』',
|
|
3065
|
+
'ua.slotN': '时段 {n}',
|
|
3066
|
+
'ua.untilToday': '到 {time}',
|
|
3067
|
+
'ua.untilDay': '到{day} {time}',
|
|
3068
|
+
'ua.backToday': '到 {time} 后恢复',
|
|
3069
|
+
'ua.backDay': '到{day} {time} 后恢复',
|
|
3070
|
+
'ua.nextToday': '下一次 {time}',
|
|
3071
|
+
'ua.nextDay': '下一次 {day} {time}',
|
|
3072
|
+
'ua.today': '今天',
|
|
3073
|
+
'ua.tomorrow': '明天',
|
|
3074
|
+
'ua.noEnd': '一直开着:时间表覆盖了每个小时',
|
|
3075
|
+
'ua.pausedOpen': '等你再打开',
|
|
3076
|
+
'ua.onNote': 'sideby 启动的会话不会停下来等你:提问按推荐继续;Claude Code 要你确认的操作直接拒绝,会话换个做法或跳过。跳过的记在下面。',
|
|
3077
|
+
'ua.offNote': '开着时,sideby 启动的会话不停下来等你:不提问,也不弹要你确认的框。',
|
|
3078
|
+
'ua.pausedNote': '在那之前,会话照常问你。现在开就恢复。',
|
|
3079
|
+
'ua.turnOn': '现在开',
|
|
3080
|
+
'ua.turnOff': '现在关',
|
|
3081
|
+
'ua.pauseSlot': '暂停到这一段结束',
|
|
3082
|
+
'ua.pause': '暂停',
|
|
3083
|
+
'ua.for': '开多久?',
|
|
3084
|
+
'ua.choice.slotNow': '到这一段结束',
|
|
3085
|
+
'ua.choice.slotNext': '到下一个时段结束',
|
|
3086
|
+
'ua.choice.4h': '4 小时',
|
|
3087
|
+
'ua.choice.12h': '12 小时',
|
|
3088
|
+
'ua.choice.time': '到某个时间',
|
|
3089
|
+
'ua.pickTime': '关闭的时间',
|
|
3090
|
+
'ua.pickHint': '选一个时间',
|
|
3091
|
+
'ua.turnOnGo': '开启',
|
|
3092
|
+
'ua.toastOn': '无人值守已开启,{until}。',
|
|
3093
|
+
'ua.toastOnAlways': '无人值守已开启。',
|
|
3094
|
+
'ua.toastOff': '无人值守已关闭。',
|
|
3095
|
+
'ua.toastPaused': '已暂停,{back}。',
|
|
3096
|
+
'ua.toastPausedOpen': '已暂停,等你再打开。',
|
|
3097
|
+
'ua.undone': '已撤销。',
|
|
3098
|
+
'ua.badge': '无人值守 · {until}',
|
|
3099
|
+
'ua.badgeOn': '无人值守',
|
|
3100
|
+
'ua.badgeTitle': 'sideby 启动的会话不会停下来问你。打开无人值守页。',
|
|
3101
|
+
'ua.firstUse': '之后启动的会话生效。现在已经在跑的会话没有这个功能,重新启动后才生效。',
|
|
3102
|
+
'ua.schedule': '时间表',
|
|
3103
|
+
'ua.scheduleNote': '到这些时间自动开,按这台电脑的时区。改了立即保存。',
|
|
3104
|
+
'ua.scheduleEmpty': '还没有时段。加一个,到点自动开。',
|
|
3105
|
+
'ua.addSlot': '添加时段',
|
|
3106
|
+
'ua.preset': '工作日夜间 23:00–08:00',
|
|
3107
|
+
'ua.presetName': '工作日夜间',
|
|
3108
|
+
'ua.presetAdded': '已添加 工作日夜间 23:00–08:00。',
|
|
3109
|
+
'ua.slotAdded': '已添加时段。',
|
|
3110
|
+
'ua.slotRemoved': '已删除时段。',
|
|
3111
|
+
'ua.saved': '时间表已保存。',
|
|
3112
|
+
'ua.days': '一,二,三,四,五,六,日',
|
|
3113
|
+
'ua.daysOf': '{slot}的日期',
|
|
3114
|
+
'ua.keepDay': '时段至少要有一天',
|
|
3115
|
+
'ua.startOf': '{slot}开始时间',
|
|
3116
|
+
'ua.endOf': '{slot}结束时间',
|
|
3117
|
+
'ua.overnight': '次日',
|
|
3118
|
+
'ua.allDay': '全天',
|
|
3119
|
+
'ua.remove': '删除{slot}',
|
|
3120
|
+
'ua.pending': '待你决定',
|
|
3121
|
+
'ua.pendingNote': '会话没问你的问题、要你确认的操作和跳过的操作。这里的事都还没做。',
|
|
3122
|
+
'ua.pendingEmpty': '没有待你决定的事',
|
|
3123
|
+
'ua.pendingBlocked': '上面说的文件夹修好之前,sideby 读不到它们。',
|
|
3124
|
+
'ua.loading': '正在读取…',
|
|
3125
|
+
'ua.kind.question': '提问',
|
|
3126
|
+
'ua.kind.deferred': '没做的操作',
|
|
3127
|
+
'ua.kind.permission': '要你确认的操作',
|
|
3128
|
+
'ua.agent': '子 agent {type}',
|
|
3129
|
+
'ua.done': '已处理',
|
|
3130
|
+
'ua.allDone': '全部标为已处理',
|
|
3131
|
+
'ua.doneOne': '已标为已处理。',
|
|
3132
|
+
'ua.doneMany.one': '已把 {n} 条标为已处理。',
|
|
3133
|
+
'ua.doneMany.other': '已把 {n} 条标为已处理。',
|
|
3134
|
+
'ua.waiting.one': '{n} 件事待你决定',
|
|
3135
|
+
'ua.waiting.other': '{n} 件事待你决定',
|
|
3136
|
+
'ua.back': '回到会话',
|
|
3137
|
+
'ua.backLive': '在会话页找到它',
|
|
3138
|
+
'ua.liveIn': '还在 {account} 里运行',
|
|
3139
|
+
'ua.ended': '已结束',
|
|
3140
|
+
'ua.noSession': '没有关联会话',
|
|
3141
|
+
'ua.resumeWhat': '恢复会话的命令,粘贴到终端运行',
|
|
3142
|
+
'ua.more': '展开',
|
|
3143
|
+
'ua.less': '收起',
|
|
3144
|
+
'ua.cover': '受保护范围',
|
|
3145
|
+
'ua.coverLine': '只对 sideby 启动的 Claude、Codex 会话生效;直接运行 claude 或 codex 的会话不受影响。',
|
|
3146
|
+
'ua.codexTrust': 'Codex:只管提问。在 Codex 里打开一次 {cmd},信任 sideby 的 hook;Codex 自己的批准提示仍会等你。',
|
|
3147
|
+
'ua.notSupported': '{hosts}:暂不支持。',
|
|
3148
|
+
'ua.listSep': '、',
|
|
3149
|
+
'ua.readOnly': '只读视图。修改请用 sideby unattended 命令。',
|
|
3150
|
+
'ua.problem': 'sideby 没法保存状态:{msg}',
|
|
3151
|
+
'ua.unreadable': 'sideby 读不到无人值守的状态。刷新再试一次。',
|
|
3152
|
+
'ai.ask.unattended': '今晚无人值守,到明早 8 点',
|
|
2959
3153
|
};
|
|
2960
3154
|
export const MESSAGES = { en, zh };
|
|
@@ -945,3 +945,132 @@ export declare function enableOutcome<P extends {
|
|
|
945
945
|
} | {
|
|
946
946
|
kind: 'done';
|
|
947
947
|
};
|
|
948
|
+
/**
|
|
949
|
+
* A moment as the Unattended page says it, relative to now in this computer's time zone: today (`08:00`), tomorrow,
|
|
950
|
+
* a weekday within the coming week (0 = Sunday, as `Date.getDay`), else a date. The page words it in its language.
|
|
951
|
+
*/
|
|
952
|
+
export declare function uaWhen(atMs: number, nowMs: number): {
|
|
953
|
+
hhmm: string;
|
|
954
|
+
day: 'today' | 'tomorrow' | 'week' | 'date';
|
|
955
|
+
weekday: number;
|
|
956
|
+
month: number;
|
|
957
|
+
date: number;
|
|
958
|
+
};
|
|
959
|
+
/**
|
|
960
|
+
* The status card's sentence (like Android's Do Not Disturb): on (by a Slot or by hand), paused, or off; with the
|
|
961
|
+
* Slot, when it ends or comes back, and when a Slot turns it on next. `noEnd`: the Schedule covers every hour.
|
|
962
|
+
*/
|
|
963
|
+
export declare function uaStatusParts(s: {
|
|
964
|
+
on: boolean;
|
|
965
|
+
reason: string;
|
|
966
|
+
until?: string;
|
|
967
|
+
slotNumber?: number;
|
|
968
|
+
next?: {
|
|
969
|
+
at: string;
|
|
970
|
+
slotNumber?: number;
|
|
971
|
+
};
|
|
972
|
+
}): {
|
|
973
|
+
state: 'on' | 'paused' | 'off';
|
|
974
|
+
byHand: boolean;
|
|
975
|
+
slot: number | null;
|
|
976
|
+
until: number | null;
|
|
977
|
+
noEnd: boolean;
|
|
978
|
+
next: {
|
|
979
|
+
at: number;
|
|
980
|
+
slot: number | null;
|
|
981
|
+
} | null;
|
|
982
|
+
};
|
|
983
|
+
/**
|
|
984
|
+
* What "Turn on now" offers (spec §3.37): until the current or next Slot ends (only when there is one within 72
|
|
985
|
+
* hours), 4 hours, 12 hours, or a time the user picks. The first is chosen; without a Slot, 12 hours.
|
|
986
|
+
*/
|
|
987
|
+
export declare function uaOnChoices(slotEnd: string | undefined, nowMs: number): {
|
|
988
|
+
options: {
|
|
989
|
+
id: 'slot' | '4h' | '12h' | 'time';
|
|
990
|
+
until: number | null;
|
|
991
|
+
}[];
|
|
992
|
+
chosen: 'slot' | '12h';
|
|
993
|
+
};
|
|
994
|
+
/**
|
|
995
|
+
* When a picked clock time (`HH:MM`) is: today when that is still ahead, else tomorrow, built from the day so a clock
|
|
996
|
+
* change in between does not move the hour (the server reads `until` the same way). Null for anything else.
|
|
997
|
+
*/
|
|
998
|
+
export declare function uaPickTime(hhmm: string, nowMs: number): {
|
|
999
|
+
until: number;
|
|
1000
|
+
tomorrow: boolean;
|
|
1001
|
+
} | null;
|
|
1002
|
+
/** What follows a Slot's end time: `next` (it ends the next day) or `whole` (start equals end: 24 hours). */
|
|
1003
|
+
export declare function uaSlotNight(slot: {
|
|
1004
|
+
start: string;
|
|
1005
|
+
end: string;
|
|
1006
|
+
}): 'next' | 'whole' | '';
|
|
1007
|
+
/**
|
|
1008
|
+
* A Slot's days as runs of days in a row, Monday first (0 = Monday): `[[0, 4]]` for Monday to Friday, `[[4, 0]]` for
|
|
1009
|
+
* Friday to Monday; `all` when every day is in it.
|
|
1010
|
+
*/
|
|
1011
|
+
export declare function uaDayRuns(days: readonly string[]): {
|
|
1012
|
+
all: boolean;
|
|
1013
|
+
runs: [number, number][];
|
|
1014
|
+
};
|
|
1015
|
+
/** A day chip pressed: the days with it added or taken away, in week order; null when it would leave none. */
|
|
1016
|
+
export declare function uaToggleDay(days: readonly string[], day: string): string[] | null;
|
|
1017
|
+
/** Whether two Slots cover the same days and times (names aside). */
|
|
1018
|
+
export declare function uaSameSlot(a: {
|
|
1019
|
+
days: readonly string[];
|
|
1020
|
+
start: string;
|
|
1021
|
+
end: string;
|
|
1022
|
+
}, b: {
|
|
1023
|
+
days: readonly string[];
|
|
1024
|
+
start: string;
|
|
1025
|
+
end: string;
|
|
1026
|
+
}): boolean;
|
|
1027
|
+
/**
|
|
1028
|
+
* Pending Decisions grouped by the Session that left them, the group with the newest one first and each group oldest
|
|
1029
|
+
* first; those kept outside a Session (`sideby unattended defer` in a terminal) form one group without a session.
|
|
1030
|
+
*/
|
|
1031
|
+
export declare function uaGroupPending<D extends {
|
|
1032
|
+
id: string;
|
|
1033
|
+
at: string;
|
|
1034
|
+
sessionId?: string;
|
|
1035
|
+
}>(list: readonly D[]): {
|
|
1036
|
+
key: string;
|
|
1037
|
+
first: D;
|
|
1038
|
+
items: D[];
|
|
1039
|
+
}[];
|
|
1040
|
+
/**
|
|
1041
|
+
* A time typed into the Unattended page's 24-hour fields as `HH:MM`, or null when it is not one. Takes `7:30`,
|
|
1042
|
+
* `07:30`, `730`, `0730`, `7` (07:00), and the full-width colon a Chinese input method types; the field's `pattern`
|
|
1043
|
+
* accepts the same.
|
|
1044
|
+
*/
|
|
1045
|
+
export declare function uaParseClock(text: string): string | null;
|
|
1046
|
+
/** An arrow key in a time field: the hour or the minute one up or down, wrapping like the browser's own time field. */
|
|
1047
|
+
export declare function uaStepClock(text: string, part: 'h' | 'm', delta: number): string | null;
|
|
1048
|
+
/**
|
|
1049
|
+
* Whether the Unattended page reads its Pending Decisions now: at once the first time; otherwise not before `nextAt`
|
|
1050
|
+
* (a failed read puts it a full refresh round away, so a count that changed meanwhile cannot make it try again at
|
|
1051
|
+
* once), then when the last read is `everyMs` old, failed, or the status counts a different number than the list.
|
|
1052
|
+
*/
|
|
1053
|
+
export declare function uaShouldRead(o: {
|
|
1054
|
+
now: number;
|
|
1055
|
+
at: number;
|
|
1056
|
+
nextAt: number;
|
|
1057
|
+
everyMs: number;
|
|
1058
|
+
loading: boolean;
|
|
1059
|
+
hasData: boolean;
|
|
1060
|
+
failed: boolean;
|
|
1061
|
+
statusCount?: number;
|
|
1062
|
+
listCount?: number;
|
|
1063
|
+
}): boolean;
|
|
1064
|
+
/**
|
|
1065
|
+
* How many Pending Decisions wait, as the Unattended tab counts them: the ones the latest status lists, less those
|
|
1066
|
+
* being marked done right now (`inflight`, each with the status it was made on). A status that lists its ids
|
|
1067
|
+
* subtracts only the ids it still has, so a status read after the server took a mark does not count it twice; one
|
|
1068
|
+
* without ids subtracts only the marks made on that same status.
|
|
1069
|
+
*/
|
|
1070
|
+
export declare function uaWaitingCount(status: {
|
|
1071
|
+
pending: number;
|
|
1072
|
+
pendingIds?: readonly string[];
|
|
1073
|
+
} | null | undefined, inflight: readonly {
|
|
1074
|
+
id: string;
|
|
1075
|
+
on: unknown;
|
|
1076
|
+
}[]): number;
|
|
@@ -1721,3 +1721,169 @@ export function enableOutcome(r) {
|
|
|
1721
1721
|
const bad = r.results.find((x) => !x.ok);
|
|
1722
1722
|
return bad ? { kind: 'failed', step: bad, plan: r.plan } : { kind: 'done' };
|
|
1723
1723
|
}
|
|
1724
|
+
// ---------- Unattended Mode (spec §3.37) ----------
|
|
1725
|
+
/**
|
|
1726
|
+
* A moment as the Unattended page says it, relative to now in this computer's time zone: today (`08:00`), tomorrow,
|
|
1727
|
+
* a weekday within the coming week (0 = Sunday, as `Date.getDay`), else a date. The page words it in its language.
|
|
1728
|
+
*/
|
|
1729
|
+
export function uaWhen(atMs, nowMs) {
|
|
1730
|
+
const d = new Date(atMs);
|
|
1731
|
+
const hhmm = `${String(d.getHours()).padStart(2, '0')}:${String(d.getMinutes()).padStart(2, '0')}`;
|
|
1732
|
+
const midnight = (x) => new Date(x.getFullYear(), x.getMonth(), x.getDate()).getTime();
|
|
1733
|
+
const days = Math.round((midnight(d) - midnight(new Date(nowMs))) / 86400000);
|
|
1734
|
+
const day = days === 0 ? 'today' : days === 1 ? 'tomorrow' : days > 1 && days < 7 ? 'week' : 'date';
|
|
1735
|
+
return { hhmm, day, weekday: d.getDay(), month: d.getMonth() + 1, date: d.getDate() };
|
|
1736
|
+
}
|
|
1737
|
+
/**
|
|
1738
|
+
* The status card's sentence (like Android's Do Not Disturb): on (by a Slot or by hand), paused, or off; with the
|
|
1739
|
+
* Slot, when it ends or comes back, and when a Slot turns it on next. `noEnd`: the Schedule covers every hour.
|
|
1740
|
+
*/
|
|
1741
|
+
export function uaStatusParts(s) {
|
|
1742
|
+
const until = s.until ? Date.parse(s.until) : null;
|
|
1743
|
+
const state = s.on && s.reason !== 'session' ? 'on' : s.reason === 'paused' ? 'paused' : 'off';
|
|
1744
|
+
return {
|
|
1745
|
+
state,
|
|
1746
|
+
byHand: state === 'on' && s.reason === 'manual',
|
|
1747
|
+
slot: s.slotNumber ? s.slotNumber - 1 : null,
|
|
1748
|
+
until,
|
|
1749
|
+
noEnd: state !== 'off' && until === null,
|
|
1750
|
+
next: s.next
|
|
1751
|
+
? { at: Date.parse(s.next.at), slot: s.next.slotNumber ? s.next.slotNumber - 1 : null }
|
|
1752
|
+
: null,
|
|
1753
|
+
};
|
|
1754
|
+
}
|
|
1755
|
+
/**
|
|
1756
|
+
* What "Turn on now" offers (spec §3.37): until the current or next Slot ends (only when there is one within 72
|
|
1757
|
+
* hours), 4 hours, 12 hours, or a time the user picks. The first is chosen; without a Slot, 12 hours.
|
|
1758
|
+
*/
|
|
1759
|
+
export function uaOnChoices(slotEnd, nowMs) {
|
|
1760
|
+
const hour = 3600000;
|
|
1761
|
+
const options = [];
|
|
1762
|
+
if (slotEnd)
|
|
1763
|
+
options.push({ id: 'slot', until: Date.parse(slotEnd) });
|
|
1764
|
+
options.push({ id: '4h', until: nowMs + 4 * hour }, { id: '12h', until: nowMs + 12 * hour }, { id: 'time', until: null });
|
|
1765
|
+
return { options, chosen: slotEnd ? 'slot' : '12h' };
|
|
1766
|
+
}
|
|
1767
|
+
/**
|
|
1768
|
+
* When a picked clock time (`HH:MM`) is: today when that is still ahead, else tomorrow, built from the day so a clock
|
|
1769
|
+
* change in between does not move the hour (the server reads `until` the same way). Null for anything else.
|
|
1770
|
+
*/
|
|
1771
|
+
export function uaPickTime(hhmm, nowMs) {
|
|
1772
|
+
const m = /^([01]\d|2[0-3]):([0-5]\d)$/.exec(hhmm);
|
|
1773
|
+
if (!m)
|
|
1774
|
+
return null;
|
|
1775
|
+
const now = new Date(nowMs);
|
|
1776
|
+
const [y, mo, d] = [now.getFullYear(), now.getMonth(), now.getDate()];
|
|
1777
|
+
const today = new Date(y, mo, d, Number(m[1]), Number(m[2])).getTime();
|
|
1778
|
+
return today > nowMs
|
|
1779
|
+
? { until: today, tomorrow: false }
|
|
1780
|
+
: { until: new Date(y, mo, d + 1, Number(m[1]), Number(m[2])).getTime(), tomorrow: true };
|
|
1781
|
+
}
|
|
1782
|
+
/** What follows a Slot's end time: `next` (it ends the next day) or `whole` (start equals end: 24 hours). */
|
|
1783
|
+
export function uaSlotNight(slot) {
|
|
1784
|
+
return slot.end === slot.start ? 'whole' : slot.end < slot.start ? 'next' : '';
|
|
1785
|
+
}
|
|
1786
|
+
/**
|
|
1787
|
+
* A Slot's days as runs of days in a row, Monday first (0 = Monday): `[[0, 4]]` for Monday to Friday, `[[4, 0]]` for
|
|
1788
|
+
* Friday to Monday; `all` when every day is in it.
|
|
1789
|
+
*/
|
|
1790
|
+
export function uaDayRuns(days) {
|
|
1791
|
+
const days7 = ['mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun'];
|
|
1792
|
+
const on = days7.map((d) => days.includes(d));
|
|
1793
|
+
if (on.every(Boolean))
|
|
1794
|
+
return { all: true, runs: [] };
|
|
1795
|
+
const first = on.indexOf(false);
|
|
1796
|
+
const runs = [];
|
|
1797
|
+
for (let k = 1; k <= 7; k++) {
|
|
1798
|
+
const i = (first + k) % 7;
|
|
1799
|
+
if (!on[i])
|
|
1800
|
+
continue;
|
|
1801
|
+
const last = runs[runs.length - 1];
|
|
1802
|
+
if (k > 1 && on[(i + 6) % 7] && last)
|
|
1803
|
+
last[1] = i;
|
|
1804
|
+
else
|
|
1805
|
+
runs.push([i, i]);
|
|
1806
|
+
}
|
|
1807
|
+
return { all: false, runs: runs.sort((a, b) => a[0] - b[0]) };
|
|
1808
|
+
}
|
|
1809
|
+
/** A day chip pressed: the days with it added or taken away, in week order; null when it would leave none. */
|
|
1810
|
+
export function uaToggleDay(days, day) {
|
|
1811
|
+
const days7 = ['mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun'];
|
|
1812
|
+
const next = days.includes(day) ? days.filter((d) => d !== day) : [...days, day];
|
|
1813
|
+
return next.length ? days7.filter((d) => next.includes(d)) : null;
|
|
1814
|
+
}
|
|
1815
|
+
/** Whether two Slots cover the same days and times (names aside). */
|
|
1816
|
+
export function uaSameSlot(a, b) {
|
|
1817
|
+
return (a.start === b.start &&
|
|
1818
|
+
a.end === b.end &&
|
|
1819
|
+
a.days.length === b.days.length &&
|
|
1820
|
+
a.days.every((d) => b.days.includes(d)));
|
|
1821
|
+
}
|
|
1822
|
+
/**
|
|
1823
|
+
* Pending Decisions grouped by the Session that left them, the group with the newest one first and each group oldest
|
|
1824
|
+
* first; those kept outside a Session (`sideby unattended defer` in a terminal) form one group without a session.
|
|
1825
|
+
*/
|
|
1826
|
+
export function uaGroupPending(list) {
|
|
1827
|
+
const groups = new Map();
|
|
1828
|
+
for (const d of [...list].sort((a, b) => Date.parse(a.at) - Date.parse(b.at) || a.id.localeCompare(b.id))) {
|
|
1829
|
+
const key = d.sessionId ? `s:${d.sessionId}` : 'none';
|
|
1830
|
+
groups.set(key, [...(groups.get(key) ?? []), d]);
|
|
1831
|
+
}
|
|
1832
|
+
const newest = (items) => Date.parse(items[items.length - 1].at);
|
|
1833
|
+
return [...groups]
|
|
1834
|
+
.sort(([, a], [, b]) => newest(b) - newest(a))
|
|
1835
|
+
.map(([key, items]) => ({ key, first: items[0], items }));
|
|
1836
|
+
}
|
|
1837
|
+
/**
|
|
1838
|
+
* A time typed into the Unattended page's 24-hour fields as `HH:MM`, or null when it is not one. Takes `7:30`,
|
|
1839
|
+
* `07:30`, `730`, `0730`, `7` (07:00), and the full-width colon a Chinese input method types; the field's `pattern`
|
|
1840
|
+
* accepts the same.
|
|
1841
|
+
*/
|
|
1842
|
+
export function uaParseClock(text) {
|
|
1843
|
+
const m = /^ *([01]?[0-9]|2[0-3])(?:[::.]?([0-5][0-9]))? *$/.exec(text);
|
|
1844
|
+
if (!m)
|
|
1845
|
+
return null;
|
|
1846
|
+
return `${m[1].padStart(2, '0')}:${m[2] ?? '00'}`;
|
|
1847
|
+
}
|
|
1848
|
+
/** An arrow key in a time field: the hour or the minute one up or down, wrapping like the browser's own time field. */
|
|
1849
|
+
export function uaStepClock(text, part, delta) {
|
|
1850
|
+
const clock = /^ *([01]?[0-9]|2[0-3])(?:[::.]?([0-5][0-9]))? *$/.exec(text);
|
|
1851
|
+
if (!clock)
|
|
1852
|
+
return null;
|
|
1853
|
+
let h = Number(clock[1]);
|
|
1854
|
+
let m = Number(clock[2] ?? 0);
|
|
1855
|
+
if (part === 'h')
|
|
1856
|
+
h = (((h + delta) % 24) + 24) % 24;
|
|
1857
|
+
else
|
|
1858
|
+
m = (((m + delta) % 60) + 60) % 60;
|
|
1859
|
+
return `${String(h).padStart(2, '0')}:${String(m).padStart(2, '0')}`;
|
|
1860
|
+
}
|
|
1861
|
+
/**
|
|
1862
|
+
* Whether the Unattended page reads its Pending Decisions now: at once the first time; otherwise not before `nextAt`
|
|
1863
|
+
* (a failed read puts it a full refresh round away, so a count that changed meanwhile cannot make it try again at
|
|
1864
|
+
* once), then when the last read is `everyMs` old, failed, or the status counts a different number than the list.
|
|
1865
|
+
*/
|
|
1866
|
+
export function uaShouldRead(o) {
|
|
1867
|
+
if (o.loading)
|
|
1868
|
+
return false;
|
|
1869
|
+
if (!o.hasData && !o.failed)
|
|
1870
|
+
return true;
|
|
1871
|
+
if (o.now < o.nextAt)
|
|
1872
|
+
return false;
|
|
1873
|
+
return (o.now - o.at >= o.everyMs ||
|
|
1874
|
+
o.failed ||
|
|
1875
|
+
(o.hasData && o.statusCount !== undefined && o.statusCount !== o.listCount));
|
|
1876
|
+
}
|
|
1877
|
+
/**
|
|
1878
|
+
* How many Pending Decisions wait, as the Unattended tab counts them: the ones the latest status lists, less those
|
|
1879
|
+
* being marked done right now (`inflight`, each with the status it was made on). A status that lists its ids
|
|
1880
|
+
* subtracts only the ids it still has, so a status read after the server took a mark does not count it twice; one
|
|
1881
|
+
* without ids subtracts only the marks made on that same status.
|
|
1882
|
+
*/
|
|
1883
|
+
export function uaWaitingCount(status, inflight) {
|
|
1884
|
+
if (!status)
|
|
1885
|
+
return 0;
|
|
1886
|
+
if (Array.isArray(status.pendingIds))
|
|
1887
|
+
return status.pendingIds.filter((id) => !inflight.some((x) => x.id === id)).length;
|
|
1888
|
+
return Math.max(0, status.pending - inflight.filter((x) => x.on === status).length);
|
|
1889
|
+
}
|