sideby 0.32.2 → 0.33.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/assets/brand/sai-painted-1024.png +0 -0
- package/assets/brand/sai-painted-128.png +0 -0
- package/assets/brand/sai-painted-256.png +0 -0
- package/assets/brand/sai-painted-64.png +0 -0
- package/dist/build.json +1 -1
- package/dist/src/cli/commands.js +57 -14
- package/dist/src/cli/format.js +3 -1
- package/dist/src/cli/json-schemas.js +30 -5
- package/dist/src/cli/main.js +9 -4
- package/dist/src/core/brand-mark.d.ts +18 -115
- package/dist/src/core/brand-mark.js +43 -174
- package/dist/src/core/messages.d.ts +17 -5
- package/dist/src/core/messages.js +38 -15
- package/dist/src/core/quota-fetch.js +9 -2
- package/dist/src/desktop/icon.d.ts +13 -1
- package/dist/src/desktop/icon.js +153 -285
- package/dist/src/families/claude/deliver.js +9 -1
- package/dist/src/families/claude/messaging.d.ts +7 -1
- package/dist/src/families/claude/messaging.js +10 -2
- package/dist/src/families/codex/deliver.d.ts +10 -1
- package/dist/src/families/codex/deliver.js +24 -2
- package/dist/src/families/messaging.d.ts +6 -1
- package/dist/src/menubar/script.d.ts +5 -0
- package/dist/src/menubar/script.js +111 -25
- package/dist/src/menubar/snapshot.d.ts +25 -5
- package/dist/src/menubar/snapshot.js +114 -26
- package/dist/src/menubar/strings.d.ts +22 -6
- package/dist/src/menubar/strings.js +22 -6
- package/dist/src/panel/handler.d.ts +2 -2
- package/dist/src/panel/handler.js +8 -2
- package/dist/src/panel/i18n.d.ts +5 -0
- package/dist/src/panel/i18n.js +14 -4
- package/dist/src/panel/page-logic.d.ts +25 -4
- package/dist/src/panel/page-logic.js +122 -10
- package/dist/src/panel/page-script.js +39 -8
- package/dist/src/panel/page-styles.js +5 -5
- package/dist/src/panel/page.js +2 -2
- package/dist/src/panel/theme.d.ts +4 -1
- package/dist/src/runtime.d.ts +3 -1
- package/dist/src/runtime.js +1 -1
- package/package.json +2 -1
- package/schemas/menubar-snapshot.json +102 -2
- package/schemas/messages.json +6 -2
- package/schemas/send.json +6 -2
- package/skills/sideby/SKILL.md +1 -1
- package/skills/sideby/references/panel.md +1 -1
- package/skills/sideby/references/sessions.md +6 -3
|
@@ -29,10 +29,18 @@ export declare const MENUBAR_STRINGS: {
|
|
|
29
29
|
readonly quietTip: 'Not used on this computer since · use on the web or other computers is not included';
|
|
30
30
|
readonly fetchFailed: 'The last check failed: {error}';
|
|
31
31
|
readonly windowTip: '{label}: {p}% used';
|
|
32
|
-
readonly windowResetsTip: '{label}: {p}% used · resets in {
|
|
32
|
+
readonly windowResetsTip: '{label}: {p}% used · resets {date} (in {left})';
|
|
33
|
+
readonly windowPassedTip: '{label}: reset at {date} · new numbers come with the next check';
|
|
33
34
|
readonly window: '{label} {p}%';
|
|
34
|
-
readonly
|
|
35
|
-
readonly
|
|
35
|
+
readonly windowPassed: '{label} –';
|
|
36
|
+
readonly resets: '{label} resets {time}';
|
|
37
|
+
readonly resetIn: '{label} · {time}';
|
|
38
|
+
readonly resetDue: 'Reset due; awaiting update';
|
|
39
|
+
readonly resetDueTip: 'Every window has reset · click Refresh to check now';
|
|
40
|
+
readonly rowRefreshing: 'Refreshing…';
|
|
41
|
+
readonly rowRefreshFailed: 'Refresh failed';
|
|
42
|
+
readonly hoursWindow: '{n}-hour window';
|
|
43
|
+
readonly daysWindow: '{n}-day window';
|
|
36
44
|
readonly moreApi: 'API keys ({n})';
|
|
37
45
|
readonly moreSignedOut: '{n} signed out';
|
|
38
46
|
readonly moreMixed: '{n} more';
|
|
@@ -88,10 +96,18 @@ export declare const MENUBAR_STRINGS: {
|
|
|
88
96
|
readonly quietTip: '之后这台电脑没用过这个账号 · 网页或其他电脑上的用量不在内';
|
|
89
97
|
readonly fetchFailed: '上次检查没成功:{error}';
|
|
90
98
|
readonly windowTip: '{label}:已用 {p}%';
|
|
91
|
-
readonly windowResetsTip: '{label}:已用 {p}% · {
|
|
99
|
+
readonly windowResetsTip: '{label}:已用 {p}% · {date} 重置({left}后)';
|
|
100
|
+
readonly windowPassedTip: '{label}:已于 {date} 重置 · 下次检查时更新';
|
|
92
101
|
readonly window: '{label} {p}%';
|
|
93
|
-
readonly
|
|
94
|
-
readonly
|
|
102
|
+
readonly windowPassed: '{label} –';
|
|
103
|
+
readonly resets: '{label} {time}重置';
|
|
104
|
+
readonly resetIn: '{label} · {time}';
|
|
105
|
+
readonly resetDue: '已到重置时间,待更新';
|
|
106
|
+
readonly resetDueTip: '所有窗口都已重置 · 点“刷新”马上检查';
|
|
107
|
+
readonly rowRefreshing: '刷新中…';
|
|
108
|
+
readonly rowRefreshFailed: '刷新失败';
|
|
109
|
+
readonly hoursWindow: '{n}小时窗口';
|
|
110
|
+
readonly daysWindow: '{n}天窗口';
|
|
95
111
|
readonly moreApi: '{n} 个 API 密钥账号';
|
|
96
112
|
readonly moreSignedOut: '{n} 个未登录账号';
|
|
97
113
|
readonly moreMixed: '另外 {n} 个账号';
|
|
@@ -29,10 +29,18 @@ export const MENUBAR_STRINGS = {
|
|
|
29
29
|
quietTip: 'Not used on this computer since · use on the web or other computers is not included',
|
|
30
30
|
fetchFailed: 'The last check failed: {error}',
|
|
31
31
|
windowTip: '{label}: {p}% used',
|
|
32
|
-
windowResetsTip: '{label}: {p}% used · resets in {
|
|
32
|
+
windowResetsTip: '{label}: {p}% used · resets {date} (in {left})',
|
|
33
|
+
windowPassedTip: '{label}: reset at {date} · new numbers come with the next check',
|
|
33
34
|
window: '{label} {p}%',
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
windowPassed: '{label} –',
|
|
36
|
+
resets: '{label} resets {time}',
|
|
37
|
+
resetIn: '{label} · {time}',
|
|
38
|
+
resetDue: 'Reset due; awaiting update',
|
|
39
|
+
resetDueTip: 'Every window has reset · click Refresh to check now',
|
|
40
|
+
rowRefreshing: 'Refreshing…',
|
|
41
|
+
rowRefreshFailed: 'Refresh failed',
|
|
42
|
+
hoursWindow: '{n}-hour window',
|
|
43
|
+
daysWindow: '{n}-day window',
|
|
36
44
|
moreApi: 'API keys ({n})',
|
|
37
45
|
moreSignedOut: '{n} signed out',
|
|
38
46
|
moreMixed: '{n} more',
|
|
@@ -88,10 +96,18 @@ export const MENUBAR_STRINGS = {
|
|
|
88
96
|
quietTip: '之后这台电脑没用过这个账号 · 网页或其他电脑上的用量不在内',
|
|
89
97
|
fetchFailed: '上次检查没成功:{error}',
|
|
90
98
|
windowTip: '{label}:已用 {p}%',
|
|
91
|
-
windowResetsTip: '{label}:已用 {p}% · {
|
|
99
|
+
windowResetsTip: '{label}:已用 {p}% · {date} 重置({left}后)',
|
|
100
|
+
windowPassedTip: '{label}:已于 {date} 重置 · 下次检查时更新',
|
|
92
101
|
window: '{label} {p}%',
|
|
93
|
-
|
|
94
|
-
|
|
102
|
+
windowPassed: '{label} –',
|
|
103
|
+
resets: '{label} {time}重置',
|
|
104
|
+
resetIn: '{label} · {time}',
|
|
105
|
+
resetDue: '已到重置时间,待更新',
|
|
106
|
+
resetDueTip: '所有窗口都已重置 · 点“刷新”马上检查',
|
|
107
|
+
rowRefreshing: '刷新中…',
|
|
108
|
+
rowRefreshFailed: '刷新失败',
|
|
109
|
+
hoursWindow: '{n}小时窗口',
|
|
110
|
+
daysWindow: '{n}天窗口',
|
|
95
111
|
moreApi: '{n} 个 API 密钥账号',
|
|
96
112
|
moreSignedOut: '{n} 个未登录账号',
|
|
97
113
|
moreMixed: '另外 {n} 个账号',
|
|
@@ -83,9 +83,9 @@ export interface PanelMessageStatus {
|
|
|
83
83
|
/** The target's Session Label, and the sender's when sideby could tell it, for the Panel's message notices. */
|
|
84
84
|
to: string;
|
|
85
85
|
from?: string;
|
|
86
|
-
/** For `paste-needed`: the line to paste into the target's tab. */
|
|
86
|
+
/** For `paste-needed`: the line to paste into the target's tab; for `unknown`, the same line behind a click (ADR-0065). */
|
|
87
87
|
pasteText?: string;
|
|
88
|
-
/** Why a paste is needed,
|
|
88
|
+
/** Why a paste is needed, what the target must still do, or why the delivery could not be confirmed. */
|
|
89
89
|
note?: string;
|
|
90
90
|
/** Delivered, but the target shows it only once the user approves it in its terminal (ADR-0045). */
|
|
91
91
|
needsApproval?: true;
|
|
@@ -1656,7 +1656,13 @@ export function createPanelHandler(opts) {
|
|
|
1656
1656
|
const session = (await liveSessions(rt)).sessions.find((s) => s.sessionId === id);
|
|
1657
1657
|
if (!session)
|
|
1658
1658
|
throw new HttpError(404, 'This session is no longer running; refresh the list.');
|
|
1659
|
-
|
|
1659
|
+
// The person at the Panel sends it, never a Session the server happens to run under.
|
|
1660
|
+
const receipt = await sendTo(rt, id, {
|
|
1661
|
+
text,
|
|
1662
|
+
images: images.map((f) => f.path),
|
|
1663
|
+
lang,
|
|
1664
|
+
fromUser: true,
|
|
1665
|
+
});
|
|
1660
1666
|
// The Message has its own copies now; the staged ones would only wait a day to be cleared.
|
|
1661
1667
|
await removeStaged(rt.paths, ids).catch(() => 0);
|
|
1662
1668
|
// Only a Message the user pastes needs the way to the target's tab.
|
|
@@ -1683,7 +1689,7 @@ export function createPanelHandler(opts) {
|
|
|
1683
1689
|
sentAt: m.sentAt,
|
|
1684
1690
|
to: m.to,
|
|
1685
1691
|
...(m.from ? { from: m.from } : {}),
|
|
1686
|
-
...(m.status === 'paste-needed' ? { pasteText: m.pasteText } : {}),
|
|
1692
|
+
...(m.status === 'paste-needed' || m.status === 'unknown' ? { pasteText: m.pasteText } : {}),
|
|
1687
1693
|
...(m.note ? { note: m.note } : {}),
|
|
1688
1694
|
...(m.needsApproval ? { needsApproval: true } : {}),
|
|
1689
1695
|
};
|
package/dist/src/panel/i18n.d.ts
CHANGED
|
@@ -1101,6 +1101,7 @@ declare const en: {
|
|
|
1101
1101
|
'send.stored': string;
|
|
1102
1102
|
'send.copyLine': string;
|
|
1103
1103
|
'send.copied': string;
|
|
1104
|
+
'send.copiedUnknown': string;
|
|
1104
1105
|
'send.jump': string;
|
|
1105
1106
|
'send.again': string;
|
|
1106
1107
|
'send.chip.delivered': string;
|
|
@@ -1115,6 +1116,10 @@ declare const en: {
|
|
|
1115
1116
|
'send.chip.approve': string;
|
|
1116
1117
|
'send.approve': string;
|
|
1117
1118
|
'msgn.approve': string;
|
|
1119
|
+
'send.chip.unknown': string;
|
|
1120
|
+
'send.unknown': string;
|
|
1121
|
+
'send.unknownCaution': string;
|
|
1122
|
+
'msgn.unknown': string;
|
|
1118
1123
|
'inb.title': string;
|
|
1119
1124
|
'inb.explain': string;
|
|
1120
1125
|
'inb.banner': string;
|
package/dist/src/panel/i18n.js
CHANGED
|
@@ -366,7 +366,7 @@ const en = {
|
|
|
366
366
|
'win.7d': 'Weekly',
|
|
367
367
|
'win.5h.short': '5-hour',
|
|
368
368
|
'win.7d.short': 'Weekly',
|
|
369
|
-
'quota.resetsIn': 'resets
|
|
369
|
+
'quota.resetsIn': 'resets {d}',
|
|
370
370
|
'quota.staleShort': 'from {ago}',
|
|
371
371
|
'col.tokens': 'Tokens · {n} days',
|
|
372
372
|
'col.last': 'Last used',
|
|
@@ -1103,6 +1103,7 @@ const en = {
|
|
|
1103
1103
|
'send.stored': 'Saved, but not sent to {name} yet. Paste this line into its terminal tab:',
|
|
1104
1104
|
'send.copyLine': 'Copy this line',
|
|
1105
1105
|
'send.copied': "Copied. Paste it into {name}'s tab.",
|
|
1106
|
+
'send.copiedUnknown': 'Copied. Paste it into {name} only if the message never shows up there.',
|
|
1106
1107
|
'send.jump': 'Go to its Orca tab',
|
|
1107
1108
|
'send.again': 'Send another',
|
|
1108
1109
|
'send.chip.delivered': 'Delivered',
|
|
@@ -1117,6 +1118,10 @@ const en = {
|
|
|
1117
1118
|
'send.chip.approve': 'Waits for approval',
|
|
1118
1119
|
'send.approve': '{name} got it, but shows it only after you approve it in its terminal',
|
|
1119
1120
|
'msgn.approve': '{to} got a message but holds it until you approve it in its terminal',
|
|
1121
|
+
'send.chip.unknown': 'Not confirmed',
|
|
1122
|
+
'send.unknown': 'sideby could not confirm that {name} got it. It may still show up: look at the session before you send it again.',
|
|
1123
|
+
'send.unknownCaution': 'Paste this line only if the message never shows up there. If both arrive, the session gets it twice.',
|
|
1124
|
+
'msgn.unknown': 'sideby could not confirm that {to} got the message',
|
|
1120
1125
|
'inb.title': 'Receiving messages',
|
|
1121
1126
|
'inb.explain': 'A Claude session can show a message from another session right away, or hold it until you approve it in its terminal. A held message is dropped after about 5 minutes.',
|
|
1122
1127
|
'inb.banner': 'Messages to {refs} wait for your approval in the terminal, and are dropped after about 5 minutes.',
|
|
@@ -1140,7 +1145,7 @@ const en = {
|
|
|
1140
1145
|
'inb.allSet': 'Every account already receives messages directly.',
|
|
1141
1146
|
'inb.readOnly': 'This Panel is read-only. Run sideby messages inbound accept, or ask your AI to do it.',
|
|
1142
1147
|
'msgn.show': 'Show',
|
|
1143
|
-
'msgn.badge': '{n}
|
|
1148
|
+
'msgn.badge': '{n} with a message to check',
|
|
1144
1149
|
'tune.title': 'Context tuning',
|
|
1145
1150
|
'tune.intro': 'Looks at how you used this over the last {days} days and estimates what auto-compact size would use the fewest tokens. It is only an estimate, and nothing changes until you press Use.',
|
|
1146
1151
|
'tune.loading': 'Working it out from your recent sessions…',
|
|
@@ -1956,7 +1961,7 @@ const zh = {
|
|
|
1956
1961
|
'win.7d': '每周额度',
|
|
1957
1962
|
'win.5h.short': '5 小时',
|
|
1958
1963
|
'win.7d.short': '每周',
|
|
1959
|
-
'quota.resetsIn': '{d}
|
|
1964
|
+
'quota.resetsIn': '{d}重置',
|
|
1960
1965
|
'quota.staleShort': '{ago}的数据',
|
|
1961
1966
|
'col.tokens': 'Tokens · 近 {n} 天',
|
|
1962
1967
|
'col.last': '最近使用',
|
|
@@ -2693,6 +2698,7 @@ const zh = {
|
|
|
2693
2698
|
'send.stored': '已存好,但还没发给 {name}。把下面这句粘贴到它的标签页:',
|
|
2694
2699
|
'send.copyLine': '复制这句',
|
|
2695
2700
|
'send.copied': '已复制,粘贴到 {name} 的标签页即可。',
|
|
2701
|
+
'send.copiedUnknown': '已复制。只有 {name} 那边一直没出现这条消息时,才粘贴过去。',
|
|
2696
2702
|
'send.jump': '跳到它的 Orca 标签页',
|
|
2697
2703
|
'send.again': '再发一条',
|
|
2698
2704
|
'send.chip.delivered': '已送达',
|
|
@@ -2707,6 +2713,10 @@ const zh = {
|
|
|
2707
2713
|
'send.chip.approve': '等批准',
|
|
2708
2714
|
'send.approve': '{name} 已收到,但要你在它的终端里批准后才会显示',
|
|
2709
2715
|
'msgn.approve': '{to} 收到一条消息,要你在它的终端里批准后才会显示',
|
|
2716
|
+
'send.chip.unknown': '未确认送达',
|
|
2717
|
+
'send.unknown': 'sideby 没法确认 {name} 收到了。它可能稍后才出现:再发一次前,先去那个会话看看。',
|
|
2718
|
+
'send.unknownCaution': '只有那边一直没出现这条消息时,才粘贴这句。两边都到的话,它会收到两次。',
|
|
2719
|
+
'msgn.unknown': 'sideby 没法确认 {to} 收到了这条消息',
|
|
2710
2720
|
'inb.title': '接收消息',
|
|
2711
2721
|
'inb.explain': 'Claude 会话收到别的会话发来的消息时,可以直接显示,也可以先等你在终端里批准。等批准的消息约 5 分钟没人批准就会被丢掉。',
|
|
2712
2722
|
'inb.banner': '发给 {refs} 的消息要你在终端里批准,约 5 分钟后会被丢掉。',
|
|
@@ -2730,7 +2740,7 @@ const zh = {
|
|
|
2730
2740
|
'inb.allSet': '所有账号都已经直接接收消息。',
|
|
2731
2741
|
'inb.readOnly': '这个 Panel 是只读的。请运行 sideby messages inbound accept,或让你的 AI 来做。',
|
|
2732
2742
|
'msgn.show': '查看',
|
|
2733
|
-
'msgn.badge': '有 {n}
|
|
2743
|
+
'msgn.badge': '有 {n} 个会话的消息要你看一下',
|
|
2734
2744
|
'tune.title': '上下文调优',
|
|
2735
2745
|
'tune.intro': '看看你最近 {days} 天的用法,估算「自动压缩」设成多少最省 token。这只是估算;你点「使用」之前,sideby 不会改任何设置。',
|
|
2736
2746
|
'tune.loading': '正在根据你最近的会话计算…',
|
|
@@ -52,6 +52,19 @@ export interface LogicUsage {
|
|
|
52
52
|
}
|
|
53
53
|
/** A short countdown such as `2h 05m`, `3d 4h` or `12m` (`2小时05分` in Chinese); fixed shape so it does not jump. */
|
|
54
54
|
export declare function formatDuration(ms: number, lang: string): string;
|
|
55
|
+
/**
|
|
56
|
+
* When a quota window resets, in words (spec §3.31): under 24 hours a countdown (`in 4h 20m`, `4小时20分后`); else
|
|
57
|
+
* the next local calendar day (`tomorrow 4:59 PM`, `明天 16:59`), up to 6 days the weekday (`Wed 4:59 PM`, `周三
|
|
58
|
+
* 16:59`), later the date (`Nov 11, 4:59 PM`, `11月11日 16:59`) with the year when it is not this year. One rule for
|
|
59
|
+
* the menu bar, the Panel and the CLI. `timeZone` is for tests; the local zone otherwise. Times are composed by hand
|
|
60
|
+
* from numbers, so ICU's spacing (a narrow no-break space before PM) never shows.
|
|
61
|
+
*/
|
|
62
|
+
export declare function resetWhen(resetsAt: string, now: number, lang: string, timeZone?: string): string;
|
|
63
|
+
/**
|
|
64
|
+
* A reset time in full for hover text, such as `Wed, Nov 4, 4:59 PM` or `11月4日周三 16:59`, with the year when it is
|
|
65
|
+
* not this year. `timeZone` is for tests.
|
|
66
|
+
*/
|
|
67
|
+
export declare function resetDate(resetsAt: string, now: number, lang: string, timeZone?: string): string;
|
|
55
68
|
/**
|
|
56
69
|
* A Long Window: longer than one day (weekly, a billing period), from `windowMinutes` or else a label such as `7d`.
|
|
57
70
|
* The page's copy of `isLongWindow` in core/quota-levels.ts; a test keeps the two equal.
|
|
@@ -414,10 +427,12 @@ export interface LogicMessage {
|
|
|
414
427
|
* What the "Send to it" dialog shows after a send: `done` (the Host took it; `hint` is any note, shown as a yellow
|
|
415
428
|
* hint), `approve` (it took it, but the target shows it only once the user approves it there; `reason` says how, ADR-0045),
|
|
416
429
|
* `paste` (the user pastes `pasteText`; `reason` says why, `jump` offers the
|
|
417
|
-
* target's Orca tab)
|
|
430
|
+
* target's Orca tab), `stored` (kept as a file only; `pasteText` for reference) or `unknown` (sideby could not tell if
|
|
431
|
+
* it arrived, ADR-0065: `reason` says why, and `pasteText` is offered only with a caution, never as the next step).
|
|
432
|
+
* A status this page does not know is shown as `unknown`, never as a request to paste. `key` is the headline's key.
|
|
418
433
|
*/
|
|
419
434
|
export declare function sendResultView(m: LogicMessage, orca: boolean): {
|
|
420
|
-
kind: 'done' | 'approve' | 'paste' | 'stored';
|
|
435
|
+
kind: 'done' | 'approve' | 'paste' | 'stored' | 'unknown';
|
|
421
436
|
key: string;
|
|
422
437
|
pasteText: string;
|
|
423
438
|
reason: string;
|
|
@@ -429,6 +444,11 @@ export declare function messageChip(status: string | undefined, needsApproval?:
|
|
|
429
444
|
key: string;
|
|
430
445
|
tone: 'ok' | 'warn' | 'accent';
|
|
431
446
|
} | null;
|
|
447
|
+
/**
|
|
448
|
+
* Whether a Session's latest Message asks the user to look: it waits for a paste, or it could not be confirmed. The
|
|
449
|
+
* Sessions tab counts running Sessions for which this holds.
|
|
450
|
+
*/
|
|
451
|
+
export declare function messageToCheck(status: string | undefined): boolean;
|
|
432
452
|
/** The latest Message to one Session, as `/api/sessions/messages` gives it (`PanelMessageStatus` in handler.ts). */
|
|
433
453
|
export interface LogicMessageStatus {
|
|
434
454
|
id: string;
|
|
@@ -440,11 +460,12 @@ export interface LogicMessageStatus {
|
|
|
440
460
|
}
|
|
441
461
|
/** A Session Label without its short id: `cc002 · knip cleanup · 61230c3d` → `cc002 · knip cleanup`. */
|
|
442
462
|
export declare function shortSessionLabel(label: string | undefined): string;
|
|
443
|
-
export type MessageNewsKind = 'new' | 'approve' | 'read' | 'paste';
|
|
463
|
+
export type MessageNewsKind = 'new' | 'approve' | 'read' | 'paste' | 'unknown';
|
|
444
464
|
/**
|
|
445
465
|
* What changed between two readings of the latest Messages, for the Panel's notices (spec §3.32): `new` (a Message
|
|
446
466
|
* reached a Session), `approve` (it reached one that shows it only once the user approves it, ADR-0045), `read` (its
|
|
447
|
-
* Session read it)
|
|
467
|
+
* Session read it), `paste` (it waits for the user to paste it) or `unknown` (sideby could not confirm it arrived,
|
|
468
|
+
* ADR-0065; announced once, as the status never changes by itself). The first reading (`before` null) only sets the
|
|
448
469
|
* baseline, so opening the Panel announces nothing that was already there.
|
|
449
470
|
*/
|
|
450
471
|
export declare function messageNews(before: Record<string, LogicMessageStatus> | null, after: Record<string, LogicMessageStatus>): {
|
|
@@ -18,6 +18,101 @@ export function formatDuration(ms, lang) {
|
|
|
18
18
|
return zh ? `${h}小时${mm}分` : `${h}h ${mm}m`;
|
|
19
19
|
return zh ? `${m}分钟` : `${m}m`;
|
|
20
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* When a quota window resets, in words (spec §3.31): under 24 hours a countdown (`in 4h 20m`, `4小时20分后`); else
|
|
23
|
+
* the next local calendar day (`tomorrow 4:59 PM`, `明天 16:59`), up to 6 days the weekday (`Wed 4:59 PM`, `周三
|
|
24
|
+
* 16:59`), later the date (`Nov 11, 4:59 PM`, `11月11日 16:59`) with the year when it is not this year. One rule for
|
|
25
|
+
* the menu bar, the Panel and the CLI. `timeZone` is for tests; the local zone otherwise. Times are composed by hand
|
|
26
|
+
* from numbers, so ICU's spacing (a narrow no-break space before PM) never shows.
|
|
27
|
+
*/
|
|
28
|
+
export function resetWhen(resetsAt, now, lang, timeZone) {
|
|
29
|
+
const zh = lang === 'zh';
|
|
30
|
+
const at = Date.parse(resetsAt);
|
|
31
|
+
if (!Number.isFinite(at))
|
|
32
|
+
return '?';
|
|
33
|
+
// Decided on the exact difference, so 23 h 59 m 30 s is still a countdown, not tomorrow's date.
|
|
34
|
+
if (at - now < 86_400_000) {
|
|
35
|
+
const minutes = Math.min(1439, Math.max(1, Math.ceil((at - now) / 60000)));
|
|
36
|
+
const h = Math.floor(minutes / 60);
|
|
37
|
+
const m = minutes % 60;
|
|
38
|
+
if (zh)
|
|
39
|
+
return h > 0 ? `${h}小时${m}分后` : `${m}分后`;
|
|
40
|
+
return h > 0 ? `in ${h}h ${m}m` : `in ${m}m`;
|
|
41
|
+
}
|
|
42
|
+
const fmt = new Intl.DateTimeFormat('en-US', {
|
|
43
|
+
timeZone,
|
|
44
|
+
year: 'numeric',
|
|
45
|
+
month: 'numeric',
|
|
46
|
+
day: 'numeric',
|
|
47
|
+
hour: 'numeric',
|
|
48
|
+
minute: 'numeric',
|
|
49
|
+
hourCycle: 'h23',
|
|
50
|
+
});
|
|
51
|
+
const parts = (t) => {
|
|
52
|
+
const p = {};
|
|
53
|
+
for (const x of fmt.formatToParts(new Date(t)))
|
|
54
|
+
if (x.type !== 'literal')
|
|
55
|
+
p[x.type] = Number(x.value);
|
|
56
|
+
return { y: p.year, mo: p.month, d: p.day, h: p.hour % 24, mi: p.minute };
|
|
57
|
+
};
|
|
58
|
+
const r = parts(at);
|
|
59
|
+
const n = parts(now);
|
|
60
|
+
const dayOf = (x) => Math.round(Date.UTC(x.y, x.mo - 1, x.d) / 86400000);
|
|
61
|
+
const days = dayOf(r) - dayOf(n);
|
|
62
|
+
const mm = String(r.mi).padStart(2, '0');
|
|
63
|
+
const time = zh
|
|
64
|
+
? `${String(r.h).padStart(2, '0')}:${mm}`
|
|
65
|
+
: `${r.h % 12 || 12}:${mm} ${r.h < 12 ? 'AM' : 'PM'}`;
|
|
66
|
+
if (days === 1)
|
|
67
|
+
return zh ? `明天 ${time}` : `tomorrow ${time}`;
|
|
68
|
+
const weekday = new Date(Date.UTC(r.y, r.mo - 1, r.d)).getUTCDay();
|
|
69
|
+
if (days > 1 && days <= 6)
|
|
70
|
+
return zh
|
|
71
|
+
? `周${'日一二三四五六'.charAt(weekday)} ${time}`
|
|
72
|
+
: `${['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'][weekday]} ${time}`;
|
|
73
|
+
const month = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'][r.mo - 1];
|
|
74
|
+
if (zh)
|
|
75
|
+
return `${r.y !== n.y ? `${r.y}年` : ''}${r.mo}月${r.d}日 ${time}`;
|
|
76
|
+
return `${month} ${r.d}${r.y !== n.y ? `, ${r.y}` : ''}, ${time}`;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* A reset time in full for hover text, such as `Wed, Nov 4, 4:59 PM` or `11月4日周三 16:59`, with the year when it is
|
|
80
|
+
* not this year. `timeZone` is for tests.
|
|
81
|
+
*/
|
|
82
|
+
export function resetDate(resetsAt, now, lang, timeZone) {
|
|
83
|
+
const zh = lang === 'zh';
|
|
84
|
+
const at = Date.parse(resetsAt);
|
|
85
|
+
if (!Number.isFinite(at))
|
|
86
|
+
return '?';
|
|
87
|
+
const p = {};
|
|
88
|
+
const fmt = new Intl.DateTimeFormat('en-US', {
|
|
89
|
+
timeZone,
|
|
90
|
+
year: 'numeric',
|
|
91
|
+
month: 'numeric',
|
|
92
|
+
day: 'numeric',
|
|
93
|
+
hour: 'numeric',
|
|
94
|
+
minute: 'numeric',
|
|
95
|
+
hourCycle: 'h23',
|
|
96
|
+
});
|
|
97
|
+
for (const x of fmt.formatToParts(new Date(at)))
|
|
98
|
+
if (x.type !== 'literal')
|
|
99
|
+
p[x.type] = Number(x.value);
|
|
100
|
+
const y = p.year;
|
|
101
|
+
const mo = p.month;
|
|
102
|
+
const d = p.day;
|
|
103
|
+
const h = p.hour % 24;
|
|
104
|
+
const mm = String(p.minute).padStart(2, '0');
|
|
105
|
+
let thisYear = y;
|
|
106
|
+
for (const x of fmt.formatToParts(new Date(now)))
|
|
107
|
+
if (x.type === 'year')
|
|
108
|
+
thisYear = Number(x.value);
|
|
109
|
+
const weekday = new Date(Date.UTC(y, mo - 1, d)).getUTCDay();
|
|
110
|
+
if (zh)
|
|
111
|
+
return `${y !== thisYear ? `${y}年` : ''}${mo}月${d}日周${'日一二三四五六'.charAt(weekday)} ${String(h).padStart(2, '0')}:${mm}`;
|
|
112
|
+
const month = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'][mo - 1];
|
|
113
|
+
const wd = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'][weekday];
|
|
114
|
+
return `${wd}, ${month} ${d}${y !== thisYear ? `, ${y}` : ''}, ${h % 12 || 12}:${mm} ${h < 12 ? 'AM' : 'PM'}`;
|
|
115
|
+
}
|
|
21
116
|
/**
|
|
22
117
|
* A Long Window: longer than one day (weekly, a billing period), from `windowMinutes` or else a label such as `7d`.
|
|
23
118
|
* The page's copy of `isLongWindow` in core/quota-levels.ts; a test keeps the two equal.
|
|
@@ -727,7 +822,9 @@ export function sessionLabelParts(s) {
|
|
|
727
822
|
* What the "Send to it" dialog shows after a send: `done` (the Host took it; `hint` is any note, shown as a yellow
|
|
728
823
|
* hint), `approve` (it took it, but the target shows it only once the user approves it there; `reason` says how, ADR-0045),
|
|
729
824
|
* `paste` (the user pastes `pasteText`; `reason` says why, `jump` offers the
|
|
730
|
-
* target's Orca tab)
|
|
825
|
+
* target's Orca tab), `stored` (kept as a file only; `pasteText` for reference) or `unknown` (sideby could not tell if
|
|
826
|
+
* it arrived, ADR-0065: `reason` says why, and `pasteText` is offered only with a caution, never as the next step).
|
|
827
|
+
* A status this page does not know is shown as `unknown`, never as a request to paste. `key` is the headline's key.
|
|
731
828
|
*/
|
|
732
829
|
export function sendResultView(m, orca) {
|
|
733
830
|
const pasteText = m.pasteText || '';
|
|
@@ -752,7 +849,9 @@ export function sendResultView(m, orca) {
|
|
|
752
849
|
hint: '',
|
|
753
850
|
jump: Boolean(orca && pasteText),
|
|
754
851
|
};
|
|
755
|
-
|
|
852
|
+
if (m.status === 'stored')
|
|
853
|
+
return { kind: 'stored', key: 'send.stored', pasteText, reason: note, hint: '', jump: false };
|
|
854
|
+
return { kind: 'unknown', key: 'send.unknown', pasteText, reason: note, hint: '', jump: false };
|
|
756
855
|
}
|
|
757
856
|
/** The chip a Sessions row shows for the latest Message to it, or null when there is none worth showing. */
|
|
758
857
|
export function messageChip(status, needsApproval) {
|
|
@@ -765,8 +864,18 @@ export function messageChip(status, needsApproval) {
|
|
|
765
864
|
return { key: 'send.chip.read', tone: 'ok' };
|
|
766
865
|
if (status === 'paste-needed')
|
|
767
866
|
return { key: 'send.chip.paste', tone: 'warn' };
|
|
867
|
+
// Given to the channel, but never confirmed (ADR-0065).
|
|
868
|
+
if (status === 'unknown')
|
|
869
|
+
return { key: 'send.chip.unknown', tone: 'warn' };
|
|
768
870
|
return null;
|
|
769
871
|
}
|
|
872
|
+
/**
|
|
873
|
+
* Whether a Session's latest Message asks the user to look: it waits for a paste, or it could not be confirmed. The
|
|
874
|
+
* Sessions tab counts running Sessions for which this holds.
|
|
875
|
+
*/
|
|
876
|
+
export function messageToCheck(status) {
|
|
877
|
+
return status === 'paste-needed' || status === 'unknown';
|
|
878
|
+
}
|
|
770
879
|
/** A Session Label without its short id: `cc002 · knip cleanup · 61230c3d` → `cc002 · knip cleanup`. */
|
|
771
880
|
export function shortSessionLabel(label) {
|
|
772
881
|
const parts = (label || '').split(' · ').filter(Boolean);
|
|
@@ -777,7 +886,8 @@ export function shortSessionLabel(label) {
|
|
|
777
886
|
/**
|
|
778
887
|
* What changed between two readings of the latest Messages, for the Panel's notices (spec §3.32): `new` (a Message
|
|
779
888
|
* reached a Session), `approve` (it reached one that shows it only once the user approves it, ADR-0045), `read` (its
|
|
780
|
-
* Session read it)
|
|
889
|
+
* Session read it), `paste` (it waits for the user to paste it) or `unknown` (sideby could not confirm it arrived,
|
|
890
|
+
* ADR-0065; announced once, as the status never changes by itself). The first reading (`before` null) only sets the
|
|
781
891
|
* baseline, so opening the Panel announces nothing that was already there.
|
|
782
892
|
*/
|
|
783
893
|
export function messageNews(before, after) {
|
|
@@ -795,13 +905,15 @@ export function messageNews(before, after) {
|
|
|
795
905
|
const fresh = !same || was.status === 'stored';
|
|
796
906
|
const kind = m.status === 'paste-needed'
|
|
797
907
|
? 'paste'
|
|
798
|
-
:
|
|
799
|
-
?
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
:
|
|
908
|
+
: m.status === 'unknown'
|
|
909
|
+
? 'unknown'
|
|
910
|
+
: fresh
|
|
911
|
+
? m.status === 'delivered' && m.needsApproval
|
|
912
|
+
? 'approve'
|
|
913
|
+
: 'new'
|
|
914
|
+
: m.status === 'read'
|
|
915
|
+
? 'read'
|
|
916
|
+
: null;
|
|
805
917
|
if (kind)
|
|
806
918
|
out.push({ kind, sessionId, id: m.id, to: shortSessionLabel(m.to), from: shortSessionLabel(m.from) });
|
|
807
919
|
}
|
|
@@ -5,7 +5,7 @@ import { groupsToAccept } from '../core/inbound.js';
|
|
|
5
5
|
import { quotaIsStale } from '../core/quota-levels.js';
|
|
6
6
|
import { remoteControlTodo } from '../core/remote-control.js';
|
|
7
7
|
import { catalogMatchLevel, catalogNorm, searchCatalog } from '../core/search-catalog.js';
|
|
8
|
-
import { aiTaskAccounts, aliasArgsOf, aliasIssue, askBridge, askBridged, askCopy, attentionReasons, attentionWhy, autostartNote, bindingWindow, cacheHitRate, canLeaveLocal, categoryOrder, codeSwapOutcome, dotsKeepKeyboard, enableOutcome, fileSize, fixPrompt, foldSkips, foldToolCalls, formatDuration, handoffChangeOf, handoffHintAccount, handoffTaskFacts, hiddenIn, highlightParts, histFilters, historyEmpty, historyWhen, hotkeyFromKey, hotkeyPressKind, inDisplayOrder, loginClusters, loginKey, longWindow, maskEmail, matchesQuery, mdBlocks, mdInline, menuPlacement, mergeDaily, mergeUsage, messageChip, messageNews, networkTaskFacts, newAccountDir, nextReset, panelFixes, panelHint, panelLang, panelMigration, panelPrefs, passedWindow, pinnedIn, quotaAskable, quotaHighLevel, quotaPressure, radioStep, reloadForBuild, remoteControlSummary, reorder, rowBadge, runCodeSwap, saveHandoffChange, sendBlock, sendFileProblem, sendResultView, sessionAge, sessionLabelParts, shortCwd, shortSessionLabel, sortAccounts, sortSessions, steadyOrder, stripSecrets, suggestAlias, suggestName, switchFailure, tailInView, taskFindings, uaDayRuns, uaGroupPending, uaOnChoices, uaParseClock, uaPickTime, uaSameSlot, uaShouldRead, uaSlotNight, uaStatusParts, uaStepClock, uaToggleDay, uaWaitingCount, uaWhen, updatedAge, widthFollower, widthTier, windowState, withPinned, } from './page-logic.js';
|
|
8
|
+
import { aiTaskAccounts, aliasArgsOf, aliasIssue, askBridge, askBridged, askCopy, attentionReasons, attentionWhy, autostartNote, bindingWindow, cacheHitRate, canLeaveLocal, categoryOrder, codeSwapOutcome, dotsKeepKeyboard, enableOutcome, fileSize, fixPrompt, foldSkips, foldToolCalls, formatDuration, handoffChangeOf, handoffHintAccount, handoffTaskFacts, hiddenIn, highlightParts, histFilters, historyEmpty, historyWhen, hotkeyFromKey, hotkeyPressKind, inDisplayOrder, loginClusters, loginKey, longWindow, maskEmail, matchesQuery, mdBlocks, mdInline, menuPlacement, mergeDaily, mergeUsage, messageChip, messageNews, messageToCheck, networkTaskFacts, newAccountDir, nextReset, panelFixes, panelHint, panelLang, panelMigration, panelPrefs, passedWindow, pinnedIn, quotaAskable, quotaHighLevel, quotaPressure, radioStep, reloadForBuild, remoteControlSummary, reorder, resetWhen, rowBadge, runCodeSwap, saveHandoffChange, sendBlock, sendFileProblem, sendResultView, sessionAge, sessionLabelParts, shortCwd, shortSessionLabel, sortAccounts, sortSessions, steadyOrder, stripSecrets, suggestAlias, suggestName, switchFailure, tailInView, taskFindings, uaDayRuns, uaGroupPending, uaOnChoices, uaParseClock, uaPickTime, uaSameSlot, uaShouldRead, uaSlotNight, uaStatusParts, uaStepClock, uaToggleDay, uaWaitingCount, uaWhen, updatedAge, widthFollower, widthTier, windowState, withPinned, } from './page-logic.js';
|
|
9
9
|
const LOGIC = [
|
|
10
10
|
quotaIsStale,
|
|
11
11
|
catalogNorm,
|
|
@@ -33,6 +33,7 @@ const LOGIC = [
|
|
|
33
33
|
fixPrompt,
|
|
34
34
|
foldSkips,
|
|
35
35
|
formatDuration,
|
|
36
|
+
resetWhen,
|
|
36
37
|
foldToolCalls,
|
|
37
38
|
highlightParts,
|
|
38
39
|
historyEmpty,
|
|
@@ -54,6 +55,7 @@ const LOGIC = [
|
|
|
54
55
|
mergeUsage,
|
|
55
56
|
messageChip,
|
|
56
57
|
messageNews,
|
|
58
|
+
messageToCheck,
|
|
57
59
|
longWindow,
|
|
58
60
|
newAccountDir,
|
|
59
61
|
nextReset,
|
|
@@ -1353,7 +1355,8 @@ const MAIN = String.raw `
|
|
|
1353
1355
|
const left = prefs.quota === 'left'
|
|
1354
1356
|
const shown = left ? 100 - st.pct : st.pct
|
|
1355
1357
|
const asOf = stale ? t('quota.asOf', { ago: ago(observedAt) }) : ''
|
|
1356
|
-
|
|
1358
|
+
// The same words as the menu bar and the CLI (spec §3.31): a countdown under a day, then tomorrow, a weekday, a date.
|
|
1359
|
+
const reset = passed ? t('quota.resetShort') : t('quota.resetsIn', { d: resetWhen(w.resetsAt, now, lang) })
|
|
1357
1360
|
// The wide list's column says only the model group, so the hover names which of its limits this is.
|
|
1358
1361
|
const title = [withLength ? winTitle(w.label) : '', passed ? t('quota.resetNoData', { date: day(passed.since) }) : t('quota.resetsAt', { at: clock(w.resetsAt) }), asOf].filter(Boolean).join(' · ')
|
|
1359
1362
|
return h('div', { class: 'meter lvl-' + st.level + (stale || passed ? ' lvl-stale' : ''), title },
|
|
@@ -2235,8 +2238,8 @@ const MAIN = String.raw `
|
|
|
2235
2238
|
function emptyState() {
|
|
2236
2239
|
const fams = S.state.families.slice().sort((x, y) => Number(y.installed) - Number(x.installed))
|
|
2237
2240
|
return h('div', { class: 'empty' },
|
|
2238
|
-
// The header's mark, cloned (page.ts
|
|
2239
|
-
h('span', { class: 'logo', 'aria-hidden': 'true' }, document.querySelector('.brand .logo
|
|
2241
|
+
// The header's mark, cloned (page.ts takes it from core/brand-mark.ts).
|
|
2242
|
+
h('span', { class: 'logo', 'aria-hidden': 'true' }, document.querySelector('.brand .logo img')?.cloneNode(true) ?? null),
|
|
2240
2243
|
h('h3', null, t('empty.title')),
|
|
2241
2244
|
h('p', { class: 'muted' }, t('empty.body')),
|
|
2242
2245
|
fams.length ? h('ul', { class: 'host-list' }, fams.map((f) => h('li', null, badge(f.id, 'sm'), h('span', null, f.title),
|
|
@@ -3396,10 +3399,10 @@ const MAIN = String.raw `
|
|
|
3396
3399
|
// "asked" numbers each reading and "applied" is the newest one used, so an answer that comes back late never
|
|
3397
3400
|
// replaces a newer one; "own" holds the ids this Panel sent, never announced.
|
|
3398
3401
|
const mn = { base: null, at: 0, loading: false, asked: 0, applied: 0, own: new Set() }
|
|
3399
|
-
// Running Sessions whose latest Message waits for a paste, for the count on the Sessions tab.
|
|
3402
|
+
// Running Sessions whose latest Message waits for a paste or could not be confirmed, for the count on the Sessions tab.
|
|
3400
3403
|
function pasteCount() {
|
|
3401
3404
|
if (!sp.data) return 0
|
|
3402
|
-
return sp.data.sessions.filter((s) => sp.msgs[s.sessionId] && sp.msgs[s.sessionId].status
|
|
3405
|
+
return sp.data.sessions.filter((s) => sp.msgs[s.sessionId] && messageToCheck(sp.msgs[s.sessionId].status)).length
|
|
3403
3406
|
}
|
|
3404
3407
|
function noteMessages(latest, seq) {
|
|
3405
3408
|
if (seq < mn.applied) return
|
|
@@ -3420,6 +3423,11 @@ const MAIN = String.raw `
|
|
|
3420
3423
|
toast(t('msgn.approve', { to: n.to || t('msgn.aSession') }), { kind: 'info', key: 'msg-' + n.sessionId, keep: true, duration: 12000, action: BOOT.readOnly ? null : { label: t('inb.go'), run: openInbound } })
|
|
3421
3424
|
continue
|
|
3422
3425
|
}
|
|
3426
|
+
if (n.kind === 'unknown') {
|
|
3427
|
+
// It may still arrive, so nothing is copied and nothing waits: "View" opens the row's chip with the reason (ADR-0065).
|
|
3428
|
+
toast(t('msgn.unknown', { to: n.to || t('msgn.aSession') }), { kind: 'info', key: 'msg-' + n.sessionId, action: { label: t('msgn.show'), run: () => showSession(n.sessionId, true) } })
|
|
3429
|
+
continue
|
|
3430
|
+
}
|
|
3423
3431
|
const key = n.kind === 'read' ? 'msgn.read' : n.kind === 'paste' ? 'msgn.paste' : n.from ? 'msgn.newFrom' : 'msgn.new'
|
|
3424
3432
|
const there = curPage === 'sessions' && hs.mode !== 'history'
|
|
3425
3433
|
const line = n.kind === 'paste' ? latest[n.sessionId].pasteText : null
|
|
@@ -3604,6 +3612,22 @@ const MAIN = String.raw `
|
|
|
3604
3612
|
}))
|
|
3605
3613
|
return btn
|
|
3606
3614
|
}
|
|
3615
|
+
// Not confirmed (ADR-0065): why, and the line only with the warning that a paste may deliver it twice.
|
|
3616
|
+
if (chip.key === 'send.chip.unknown') {
|
|
3617
|
+
const btn = h('button', { class: cls + ' sess-msg-paste', type: 'button', 'aria-haspopup': 'dialog', 'data-key': 'sess-msg-' + s.sessionId }, t(chip.key), icon('chevron'))
|
|
3618
|
+
btn.addEventListener('click', () => openPopover(btn, 'sess-paste', t(chip.key), () => {
|
|
3619
|
+
const out = [msg.note ? h('p', { class: 'small muted' }, msg.note) : null]
|
|
3620
|
+
if (msg.pasteText) {
|
|
3621
|
+
const area = h('textarea', { class: 'sess-copy-text mono', readonly: true, rows: '3', 'aria-label': t('send.copyLine') })
|
|
3622
|
+
area.value = msg.pasteText
|
|
3623
|
+
const copy = h('button', { class: 'btn btn-sm', type: 'button' }, icon('copy'), h('span', null, t('send.copyLine')))
|
|
3624
|
+
copy.addEventListener('click', () => sessCopy(copy, msg.pasteText, () => { closeMenu(true); toast(t('toast.copied', { text: msg.pasteText })) }))
|
|
3625
|
+
out.push(h('p', { class: 'small' }, t('send.unknownCaution')), area, h('div', { class: 'pop-actions' }, copy))
|
|
3626
|
+
}
|
|
3627
|
+
return out
|
|
3628
|
+
}))
|
|
3629
|
+
return btn
|
|
3630
|
+
}
|
|
3607
3631
|
if (chip.tone !== 'warn' || !msg.pasteText) return h('span', { class: cls, tabindex: '0', 'data-tip': t('send.chipTip') }, t(chip.key))
|
|
3608
3632
|
const btn = h('button', { class: cls + ' sess-msg-paste', type: 'button', 'aria-haspopup': 'dialog', 'data-key': 'sess-msg-' + s.sessionId }, t(chip.key), icon('chevron'))
|
|
3609
3633
|
btn.addEventListener('click', () => openPopover(btn, 'sess-paste', t('send.chip.paste'), () => {
|
|
@@ -4747,7 +4771,7 @@ const MAIN = String.raw `
|
|
|
4747
4771
|
const r = await api('/api/sessions/send', { sessionId: mine.s.sessionId, text, attachments: ready.map((f) => f.id), lang })
|
|
4748
4772
|
ready.forEach((f) => { f.sent = true })
|
|
4749
4773
|
mine.result = r
|
|
4750
|
-
ownMessage(mine.s.sessionId, { id: r.message.id, status: r.message.status, sentAt: r.message.sentAt, to: r.message.to, ...(r.message.status
|
|
4774
|
+
ownMessage(mine.s.sessionId, { id: r.message.id, status: r.message.status, sentAt: r.message.sentAt, to: r.message.to, ...(messageToCheck(r.message.status) ? { pasteText: r.message.pasteText } : {}), ...(r.message.note ? { note: r.message.note } : {}) })
|
|
4751
4775
|
renderSessionsPage()
|
|
4752
4776
|
} catch (e) { mine.error = e }
|
|
4753
4777
|
dlg.busy = false
|
|
@@ -4766,7 +4790,7 @@ const MAIN = String.raw `
|
|
|
4766
4790
|
const v = sendResultView(r.message, Boolean(r.orca))
|
|
4767
4791
|
const out = []
|
|
4768
4792
|
if (v.kind === 'done') out.push(h('div', { class: 'note note-ok', role: 'status' }, icon('tick'), h('span', null, t(v.key, { name }))))
|
|
4769
|
-
else out.push(h('div', { class: 'note' + (v.kind === 'paste' || v.kind === 'approve' ? ' note-warn' : ''), role: 'status' }, h('b', null, t(v.key, { name })), v.reason ? h('span', { class: 'note-line' }, v.reason) : null))
|
|
4793
|
+
else out.push(h('div', { class: 'note' + (v.kind === 'paste' || v.kind === 'approve' || v.kind === 'unknown' ? ' note-warn' : ''), role: 'status' }, h('b', null, t(v.key, { name })), v.reason ? h('span', { class: 'note-line' }, v.reason) : null))
|
|
4770
4794
|
if (v.hint) out.push(h('p', { class: 'note note-warn small' }, v.hint))
|
|
4771
4795
|
if (v.kind === 'approve' && !BOOT.readOnly)
|
|
4772
4796
|
out.push(h('div', { class: 'pop-actions' }, h('button', { class: 'btn btn-sm btn-primary', type: 'button', onclick: openInbound }, t('inb.go'))))
|
|
@@ -4777,6 +4801,13 @@ const MAIN = String.raw `
|
|
|
4777
4801
|
h('div', { class: 'send-line-actions' }, copy,
|
|
4778
4802
|
v.jump ? h('button', { class: 'btn btn-sm', type: 'button', onclick: () => jumpToOrca(sd.s) }, icon('link'), t('send.jump')) : null)))
|
|
4779
4803
|
}
|
|
4804
|
+
// Not confirmed: the line is there for when it never shows up, never the next step, and never copied by itself.
|
|
4805
|
+
if (v.kind === 'unknown' && v.pasteText) {
|
|
4806
|
+
const copy = h('button', { class: 'btn btn-sm', type: 'button' }, icon('copy'), t('send.copyLine'))
|
|
4807
|
+
copy.addEventListener('click', () => sessCopy(copy, v.pasteText, () => toast(t('send.copiedUnknown', { name }))))
|
|
4808
|
+
out.push(h('p', { class: 'small muted' }, t('send.unknownCaution')),
|
|
4809
|
+
h('div', { class: 'send-line' }, h('code', { class: 'send-line-text' }, v.pasteText), h('div', { class: 'send-line-actions' }, copy)))
|
|
4810
|
+
}
|
|
4780
4811
|
return out
|
|
4781
4812
|
}
|
|
4782
4813
|
function sendAgain() {
|
|
@@ -8,11 +8,11 @@ const colorDecls = (tokens) => Object.entries(tokens)
|
|
|
8
8
|
.map(([k, v]) => `${THEME_TOKENS[k]}: ${v}`)
|
|
9
9
|
.join('; ');
|
|
10
10
|
// Colors defined from other tokens, before each scheme's Theme colors so a Theme can set them; repeated in both schemes so they follow that scheme's base colors. Dark mode keeps
|
|
11
|
-
// the logo tile light: the mark
|
|
12
|
-
//
|
|
11
|
+
// the logo tile light: the painted mark (core/brand-mark.ts, ADR-0064) is drawn for a light ground. `--logo-fg` no longer
|
|
12
|
+
// colours the mark (it is a painting); it stays the brand blue so Themes that set it keep working (ADR-0050).
|
|
13
13
|
const DERIVED_COLORS = `
|
|
14
14
|
--btn-text: var(--text); --btn-hover-text: var(--accent); --check: var(--focus);
|
|
15
|
-
--logo-bg: var(--surface-2); --logo-fg: #3f8fc4; /* design-system-ignore: the
|
|
15
|
+
--logo-bg: var(--surface-2); --logo-fg: #3f8fc4; /* design-system-ignore: the brand blue (ADR-0050); the painted mark keeps its own colours (ADR-0064) */ --logo-line: var(--border);
|
|
16
16
|
--focus-outline: 2px solid var(--focus); --focus-ring: none;
|
|
17
17
|
--scrim: color-mix(in srgb, var(--text) 40%, transparent);`;
|
|
18
18
|
// The usage chart (--spark) takes the main button's hue at a readable lightness, keeping its chroma: a black-and-white
|
|
@@ -100,8 +100,8 @@ code, .mono { font-family: var(--mono); font-size: 0.92em; }
|
|
|
100
100
|
.ver-pill.has-update { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
|
|
101
101
|
.ver-pill.has-update::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
|
|
102
102
|
.logo { display: inline-flex; flex: none; width: 40px; height: 40px; border-radius: 10px; background: var(--logo-bg); box-shadow: inset 0 0 0 1px var(--logo-line); }
|
|
103
|
-
/*
|
|
104
|
-
.logo
|
|
103
|
+
/* The painted mark (core/brand-mark.ts), 3 px in from the tile's edge; desktop/icon.ts lays the app icon out the same way. */
|
|
104
|
+
.logo img { display: block; width: 100%; height: 100%; padding: 7.5%; box-sizing: border-box; object-fit: contain; }
|
|
105
105
|
.top-actions { display: flex; align-items: center; gap: 8px; }
|
|
106
106
|
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
|
|
107
107
|
.section-head > div:first-child { min-width: 0; }
|