sideby 0.41.2 → 0.41.3
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.js +163 -32
- package/dist/src/cli/json-schemas.js +41 -4
- package/dist/src/cli/main.js +17 -6
- package/dist/src/core/cli-commands.js +1 -1
- package/dist/src/core/config.d.ts +16 -0
- package/dist/src/core/config.js +262 -42
- package/dist/src/core/history-project.d.ts +14 -0
- package/dist/src/core/history-project.js +42 -12
- package/dist/src/core/history.d.ts +4 -6
- package/dist/src/core/history.js +5 -15
- package/dist/src/core/local-build.d.ts +12 -0
- package/dist/src/core/local-build.js +32 -0
- package/dist/src/core/search-catalog.js +27 -0
- package/dist/src/core/unattended-followup.d.ts +62 -0
- package/dist/src/core/unattended-followup.js +205 -0
- package/dist/src/core/unattended-pending.d.ts +11 -3
- package/dist/src/core/unattended-pending.js +34 -8
- package/dist/src/families/claude/history.js +9 -1
- package/dist/src/families/history.d.ts +22 -2
- package/dist/src/families/history.js +55 -0
- package/dist/src/handoff/messages.js +1 -1
- package/dist/src/panel/handler.d.ts +11 -4
- package/dist/src/panel/handler.js +50 -25
- package/dist/src/panel/i18n.d.ts +23 -1
- package/dist/src/panel/i18n.js +48 -4
- package/dist/src/panel/page-logic.d.ts +53 -0
- package/dist/src/panel/page-logic.js +96 -0
- package/dist/src/panel/page-script.js +140 -36
- package/dist/src/panel/page-styles.js +17 -0
- package/dist/src/unattended/hook.d.ts +10 -5
- package/dist/src/unattended/hook.js +17 -12
- package/package.json +1 -1
- package/schemas/unattended-pending.json +156 -56
- package/skills/sideby/SKILL.md +2 -1
- package/skills/sideby/references/diagnose.md +1 -0
- package/skills/sideby/references/handoff.md +1 -1
- package/skills/sideby/references/panel.md +1 -1
- package/skills/sideby/references/unattended.md +16 -5
package/dist/src/panel/i18n.d.ts
CHANGED
|
@@ -1729,6 +1729,25 @@ declare const en: {
|
|
|
1729
1729
|
'ua.waited': string;
|
|
1730
1730
|
'ua.pending': string;
|
|
1731
1731
|
'ua.pendingNote': string;
|
|
1732
|
+
'ua.replied': string;
|
|
1733
|
+
'ua.repliedTip': string;
|
|
1734
|
+
'ua.noRecord': string;
|
|
1735
|
+
'ua.projOpen.one': string;
|
|
1736
|
+
'ua.projOpen.other': string;
|
|
1737
|
+
'ua.projReplied.one': string;
|
|
1738
|
+
'ua.projReplied.other': string;
|
|
1739
|
+
'ua.projOther': string;
|
|
1740
|
+
'ua.repliedShow.one': string;
|
|
1741
|
+
'ua.repliedShow.other': string;
|
|
1742
|
+
'ua.repliedBatch.one': string;
|
|
1743
|
+
'ua.repliedBatch.other': string;
|
|
1744
|
+
'ua.repliedCaution': string;
|
|
1745
|
+
'ua.doneShow.one': string;
|
|
1746
|
+
'ua.doneShow.other': string;
|
|
1747
|
+
'ua.doneListNote': string;
|
|
1748
|
+
'ua.doneWhen': string;
|
|
1749
|
+
'ua.reopen': string;
|
|
1750
|
+
'ua.reopenedOne': string;
|
|
1732
1751
|
'ua.pendingEmpty': string;
|
|
1733
1752
|
'ua.pendingBlocked': string;
|
|
1734
1753
|
'ua.loading': string;
|
|
@@ -1737,7 +1756,9 @@ declare const en: {
|
|
|
1737
1756
|
'ua.kind.permission': string;
|
|
1738
1757
|
'ua.agent': string;
|
|
1739
1758
|
'ua.done': string;
|
|
1740
|
-
'ua.
|
|
1759
|
+
'ua.allDoneN.one': string;
|
|
1760
|
+
'ua.allDoneN.other': string;
|
|
1761
|
+
'ua.doneAlready': string;
|
|
1741
1762
|
'ua.doneOne': string;
|
|
1742
1763
|
'ua.doneMany.one': string;
|
|
1743
1764
|
'ua.doneMany.other': string;
|
|
@@ -1760,6 +1781,7 @@ declare const en: {
|
|
|
1760
1781
|
'ua.problem': string;
|
|
1761
1782
|
'ua.unreadable': string;
|
|
1762
1783
|
'ai.ask.unattended': string;
|
|
1784
|
+
'ai.ask.pending': string;
|
|
1763
1785
|
'ai.ask.progress': string;
|
|
1764
1786
|
'pr.title': string;
|
|
1765
1787
|
'pr.hint': string;
|
package/dist/src/panel/i18n.js
CHANGED
|
@@ -1730,7 +1730,26 @@ const en = {
|
|
|
1730
1730
|
'ua.waitFailed': 'Could not change it: {msg}',
|
|
1731
1731
|
'ua.waited': 'No answer for {n} min',
|
|
1732
1732
|
'ua.pending': 'Waiting for you',
|
|
1733
|
-
'ua.pendingNote': 'Questions sessions did not ask you or nobody answered, steps that needed your OK, and steps they skipped.
|
|
1733
|
+
'ua.pendingNote': 'Questions sessions did not ask you or nobody answered, steps that needed your OK, and steps they skipped, by project. Untouched ones show first. The ones where you wrote in the session afterwards are folded under each project: writing there does not mean they were finished.',
|
|
1734
|
+
'ua.replied': 'You wrote in this session afterwards · {ago}',
|
|
1735
|
+
'ua.repliedTip': 'You wrote in this session at {when}, after this was kept. sideby cannot tell whether that finished it.',
|
|
1736
|
+
'ua.noRecord': 'Its session record is gone, so sideby cannot tell whether you wrote there afterwards.',
|
|
1737
|
+
'ua.projOpen.one': '{n} untouched',
|
|
1738
|
+
'ua.projOpen.other': '{n} untouched',
|
|
1739
|
+
'ua.projReplied.one': '{n} you wrote in afterwards',
|
|
1740
|
+
'ua.projReplied.other': '{n} you wrote in afterwards',
|
|
1741
|
+
'ua.projOther': 'Other',
|
|
1742
|
+
'ua.repliedShow.one': 'You wrote afterwards ({n})',
|
|
1743
|
+
'ua.repliedShow.other': 'You wrote afterwards ({n})',
|
|
1744
|
+
'ua.repliedBatch.one': 'Mark this one done',
|
|
1745
|
+
'ua.repliedBatch.other': 'Mark these {n} done',
|
|
1746
|
+
'ua.repliedCaution': 'Some of these may not be finished. Look them over first.',
|
|
1747
|
+
'ua.doneShow.one': 'Done ({n})',
|
|
1748
|
+
'ua.doneShow.other': 'Done ({n})',
|
|
1749
|
+
'ua.doneListNote': 'Marked done in the last 30 days. Reopen one you marked by mistake.',
|
|
1750
|
+
'ua.doneWhen': 'Marked done {when}',
|
|
1751
|
+
'ua.reopen': 'Reopen',
|
|
1752
|
+
'ua.reopenedOne': 'Reopened.',
|
|
1734
1753
|
'ua.pendingEmpty': 'Nothing is waiting for you.',
|
|
1735
1754
|
'ua.pendingBlocked': 'sideby cannot read them until the folder named above is fixed.',
|
|
1736
1755
|
'ua.loading': 'Reading…',
|
|
@@ -1739,7 +1758,9 @@ const en = {
|
|
|
1739
1758
|
'ua.kind.permission': 'Needed your OK',
|
|
1740
1759
|
'ua.agent': 'in subagent {type}',
|
|
1741
1760
|
'ua.done': 'Done',
|
|
1742
|
-
'ua.
|
|
1761
|
+
'ua.allDoneN.one': 'Mark it done',
|
|
1762
|
+
'ua.allDoneN.other': 'Mark all {n} done',
|
|
1763
|
+
'ua.doneAlready': 'Already marked done.',
|
|
1743
1764
|
'ua.doneOne': 'Marked done.',
|
|
1744
1765
|
'ua.doneMany.one': 'Marked {n} done.',
|
|
1745
1766
|
'ua.doneMany.other': 'Marked {n} done.',
|
|
@@ -1762,6 +1783,7 @@ const en = {
|
|
|
1762
1783
|
'ua.problem': 'sideby cannot keep its state: {msg}',
|
|
1763
1784
|
'ua.unreadable': 'sideby could not read Unattended Mode. Refresh to try again.',
|
|
1764
1785
|
'ai.ask.unattended': 'Run unattended tonight, until 8 tomorrow morning.',
|
|
1786
|
+
'ai.ask.pending': 'List by project the decisions my sessions left for me that are not handled yet.',
|
|
1765
1787
|
'ai.ask.progress': 'While background tasks run, tell me every 30 minutes what my sessions are waiting for.',
|
|
1766
1788
|
'pr.title': 'Progress updates',
|
|
1767
1789
|
'pr.hint': 'When a Claude session waits on background work (subagents, long commands), it tells you what it is waiting for and for how long, every 30 minutes or as often as you pick.',
|
|
@@ -3528,7 +3550,26 @@ const zh = {
|
|
|
3528
3550
|
'ua.waitFailed': '没改成:{msg}',
|
|
3529
3551
|
'ua.waited': '等了 {n} 分钟没人回答',
|
|
3530
3552
|
'ua.pending': '待你决定',
|
|
3531
|
-
'ua.pendingNote': '
|
|
3553
|
+
'ua.pendingNote': '会话没问你或没人回答的问题、要你确认的操作和跳过的操作,按项目分组,先列没人碰过的。之后在会话里说过话的,折叠在每个项目下面:说过话不等于处理完了。',
|
|
3554
|
+
'ua.replied': '之后在这个会话里说过话 · {ago}',
|
|
3555
|
+
'ua.repliedTip': '记下这条之后,你 {when} 在这个会话里说过话。处理完没有,sideby 看不出来。',
|
|
3556
|
+
'ua.noRecord': '看不到会话记录,看不出你之后在会话里说过话没有。',
|
|
3557
|
+
'ua.projOpen.one': '{n} 条没人碰过',
|
|
3558
|
+
'ua.projOpen.other': '{n} 条没人碰过',
|
|
3559
|
+
'ua.projReplied.one': '{n} 条之后说过话',
|
|
3560
|
+
'ua.projReplied.other': '{n} 条之后说过话',
|
|
3561
|
+
'ua.projOther': '其他',
|
|
3562
|
+
'ua.repliedShow.one': '之后说过话({n})',
|
|
3563
|
+
'ua.repliedShow.other': '之后说过话({n})',
|
|
3564
|
+
'ua.repliedBatch.one': '把这 1 条标为已处理',
|
|
3565
|
+
'ua.repliedBatch.other': '把这 {n} 条标为已处理',
|
|
3566
|
+
'ua.repliedCaution': '其中可能有没处理完的,先看一眼。',
|
|
3567
|
+
'ua.doneShow.one': '已处理({n})',
|
|
3568
|
+
'ua.doneShow.other': '已处理({n})',
|
|
3569
|
+
'ua.doneListNote': '最近 30 天标为已处理的。标错了可以重新打开。',
|
|
3570
|
+
'ua.doneWhen': '{when} 标为已处理',
|
|
3571
|
+
'ua.reopen': '重新打开',
|
|
3572
|
+
'ua.reopenedOne': '已重新打开。',
|
|
3532
3573
|
'ua.pendingEmpty': '没有待你决定的事',
|
|
3533
3574
|
'ua.pendingBlocked': '上面说的文件夹修好之前,sideby 读不到它们。',
|
|
3534
3575
|
'ua.loading': '正在读取…',
|
|
@@ -3537,7 +3578,9 @@ const zh = {
|
|
|
3537
3578
|
'ua.kind.permission': '要你确认的操作',
|
|
3538
3579
|
'ua.agent': '子 agent {type}',
|
|
3539
3580
|
'ua.done': '已处理',
|
|
3540
|
-
'ua.
|
|
3581
|
+
'ua.allDoneN.one': '标为已处理',
|
|
3582
|
+
'ua.allDoneN.other': '全部 {n} 条标为已处理',
|
|
3583
|
+
'ua.doneAlready': '这条已经标为已处理了。',
|
|
3541
3584
|
'ua.doneOne': '已标为已处理。',
|
|
3542
3585
|
'ua.doneMany.one': '已把 {n} 条标为已处理。',
|
|
3543
3586
|
'ua.doneMany.other': '已把 {n} 条标为已处理。',
|
|
@@ -3560,6 +3603,7 @@ const zh = {
|
|
|
3560
3603
|
'ua.problem': 'sideby 没法保存状态:{msg}',
|
|
3561
3604
|
'ua.unreadable': 'sideby 读不到无人值守的状态。刷新再试一次。',
|
|
3562
3605
|
'ai.ask.unattended': '今晚无人值守,到明早 8 点',
|
|
3606
|
+
'ai.ask.pending': '按项目列出还没处理的待决事项',
|
|
3563
3607
|
'ai.ask.progress': '后台任务跑着时,每 30 分钟告诉我会话在等什么。',
|
|
3564
3608
|
'pr.title': '进度提醒',
|
|
3565
3609
|
'pr.hint': 'Claude 会话等后台任务(子任务、长命令)时,告诉你在等什么、等了多久:默认每 30 分钟一次,也可以自己选。',
|
|
@@ -1008,6 +1008,19 @@ export declare function historyWhen(iso: string | undefined, now: number): {
|
|
|
1008
1008
|
n?: number;
|
|
1009
1009
|
date?: string;
|
|
1010
1010
|
} | null;
|
|
1011
|
+
/**
|
|
1012
|
+
* When the words for `iso` (historyWhen, and the page's date, which shows the year only for another year) change
|
|
1013
|
+
* next, as a time after `now`: the next minute under an hour, the next hour under a day, the next day under a week
|
|
1014
|
+
* (the seventh is when they turn into a date), and after that the next New Year. Infinity for a time that is not a date.
|
|
1015
|
+
*/
|
|
1016
|
+
export declare function historyWhenNext(iso: string | undefined, now: number): number;
|
|
1017
|
+
/**
|
|
1018
|
+
* A date formatter that keeps one Intl.DateTimeFormat per locale and options: `toLocaleDateString(locale, options)`
|
|
1019
|
+
* builds a new one on every call, which was most of the time a long list spent showing its dates.
|
|
1020
|
+
*/
|
|
1021
|
+
export declare function dateFormatter(): (date: Date, locale: string, options: Intl.DateTimeFormatOptions) => string;
|
|
1022
|
+
/** Everything a History row shows and its buttons act on, so a row drawn from the same can be kept as it is. */
|
|
1023
|
+
export declare function historyRowSig(session: unknown, words: readonly string[], noProject: boolean, lang: string): string;
|
|
1011
1024
|
/** `text` cut into the parts that match one of `words` (any case) and the parts between, for highlighting. */
|
|
1012
1025
|
export declare function highlightParts(text: string, words: readonly string[]): {
|
|
1013
1026
|
text: string;
|
|
@@ -1225,6 +1238,46 @@ export declare function uaGroupPending<D extends {
|
|
|
1225
1238
|
first: D;
|
|
1226
1239
|
items: D[];
|
|
1227
1240
|
}[];
|
|
1241
|
+
/**
|
|
1242
|
+
* Where a new toast goes among the shown ones: `replaces`, a keyed one with the same key and other text (the theme's
|
|
1243
|
+
* toast, say); `merges`, one with the same text, and the same key when the new one has a key, so two marks that each
|
|
1244
|
+
* carry an Undo stay two toasts with their own Undo.
|
|
1245
|
+
*/
|
|
1246
|
+
export declare function toastMerge<T extends {
|
|
1247
|
+
text: string;
|
|
1248
|
+
key: string | null;
|
|
1249
|
+
}>(shown: readonly T[], text: string, key?: string | null): {
|
|
1250
|
+
replaces: T | undefined;
|
|
1251
|
+
merges: T | undefined;
|
|
1252
|
+
};
|
|
1253
|
+
/**
|
|
1254
|
+
* Pending Decisions grouped by Project, then by the Session that left them, as the Unattended page and `sideby
|
|
1255
|
+
* unattended pending` show them (spec §3.37, ADR-0078). What nobody touched (`open`) comes first at every level: a
|
|
1256
|
+
* Project with an open one before the others, the newest open one first, then the rest by their newest one, and the
|
|
1257
|
+
* group without a Project (`project` '') last. Inside a Project a Session's open ones and its other ones are two
|
|
1258
|
+
* blocks, so every open block comes before every replied one, each set ordered the same way; inside a block the
|
|
1259
|
+
* replied ones before the done ones, each oldest first. Counts are per state.
|
|
1260
|
+
*/
|
|
1261
|
+
export declare function uaGroupByProject<D extends {
|
|
1262
|
+
id: string;
|
|
1263
|
+
at: string;
|
|
1264
|
+
sessionId?: string;
|
|
1265
|
+
project: string;
|
|
1266
|
+
projectName: string;
|
|
1267
|
+
state?: string;
|
|
1268
|
+
}>(list: readonly D[]): {
|
|
1269
|
+
key: string;
|
|
1270
|
+
project: string;
|
|
1271
|
+
name: string;
|
|
1272
|
+
open: number;
|
|
1273
|
+
replied: number;
|
|
1274
|
+
done: number;
|
|
1275
|
+
sessions: {
|
|
1276
|
+
key: string;
|
|
1277
|
+
first: D;
|
|
1278
|
+
items: D[];
|
|
1279
|
+
}[];
|
|
1280
|
+
}[];
|
|
1228
1281
|
/**
|
|
1229
1282
|
* A time typed into the Unattended page's 24-hour fields as `HH:MM`, or null when it is not one. Takes `7:30`,
|
|
1230
1283
|
* `07:30`, `730`, `0730`, `7` (07:00), and the full-width colon a Chinese input method types; the field's `pattern`
|
|
@@ -1799,6 +1799,42 @@ export function historyWhen(iso, now) {
|
|
|
1799
1799
|
const pad = (n) => String(n).padStart(2, '0');
|
|
1800
1800
|
return { key: 'time.on', date: d.getFullYear() + '-' + pad(d.getMonth() + 1) + '-' + pad(d.getDate()) };
|
|
1801
1801
|
}
|
|
1802
|
+
/**
|
|
1803
|
+
* When the words for `iso` (historyWhen, and the page's date, which shows the year only for another year) change
|
|
1804
|
+
* next, as a time after `now`: the next minute under an hour, the next hour under a day, the next day under a week
|
|
1805
|
+
* (the seventh is when they turn into a date), and after that the next New Year. Infinity for a time that is not a date.
|
|
1806
|
+
*/
|
|
1807
|
+
export function historyWhenNext(iso, now) {
|
|
1808
|
+
const ts = Date.parse(iso || '');
|
|
1809
|
+
if (!Number.isFinite(ts))
|
|
1810
|
+
return Number.POSITIVE_INFINITY;
|
|
1811
|
+
const ms = Math.max(0, now - ts);
|
|
1812
|
+
if (ms < 7 * 86_400_000) {
|
|
1813
|
+
const step = ms < 3_600_000 ? 60_000 : ms < 86_400_000 ? 3_600_000 : 86_400_000;
|
|
1814
|
+
return ts + (Math.floor(ms / step) + 1) * step;
|
|
1815
|
+
}
|
|
1816
|
+
return new Date(new Date(now).getFullYear() + 1, 0, 1).getTime();
|
|
1817
|
+
}
|
|
1818
|
+
/**
|
|
1819
|
+
* A date formatter that keeps one Intl.DateTimeFormat per locale and options: `toLocaleDateString(locale, options)`
|
|
1820
|
+
* builds a new one on every call, which was most of the time a long list spent showing its dates.
|
|
1821
|
+
*/
|
|
1822
|
+
export function dateFormatter() {
|
|
1823
|
+
const made = new Map();
|
|
1824
|
+
return (date, locale, options) => {
|
|
1825
|
+
const key = `${locale} ${JSON.stringify(options)}`;
|
|
1826
|
+
let f = made.get(key);
|
|
1827
|
+
if (!f) {
|
|
1828
|
+
f = new Intl.DateTimeFormat(locale, options);
|
|
1829
|
+
made.set(key, f);
|
|
1830
|
+
}
|
|
1831
|
+
return f.format(date);
|
|
1832
|
+
};
|
|
1833
|
+
}
|
|
1834
|
+
/** Everything a History row shows and its buttons act on, so a row drawn from the same can be kept as it is. */
|
|
1835
|
+
export function historyRowSig(session, words, noProject, lang) {
|
|
1836
|
+
return JSON.stringify([lang, words, Boolean(noProject), session]);
|
|
1837
|
+
}
|
|
1802
1838
|
/** `text` cut into the parts that match one of `words` (any case) and the parts between, for highlighting. */
|
|
1803
1839
|
export function highlightParts(text, words) {
|
|
1804
1840
|
const low = text.toLowerCase();
|
|
@@ -2146,6 +2182,66 @@ export function uaGroupPending(list) {
|
|
|
2146
2182
|
.sort(([, a], [, b]) => newest(b) - newest(a))
|
|
2147
2183
|
.map(([key, items]) => ({ key, first: items[0], items }));
|
|
2148
2184
|
}
|
|
2185
|
+
/**
|
|
2186
|
+
* Where a new toast goes among the shown ones: `replaces`, a keyed one with the same key and other text (the theme's
|
|
2187
|
+
* toast, say); `merges`, one with the same text, and the same key when the new one has a key, so two marks that each
|
|
2188
|
+
* carry an Undo stay two toasts with their own Undo.
|
|
2189
|
+
*/
|
|
2190
|
+
export function toastMerge(shown, text, key) {
|
|
2191
|
+
return {
|
|
2192
|
+
replaces: key ? shown.find((x) => x.key === key && x.text !== text) : undefined,
|
|
2193
|
+
merges: shown.find((x) => x.text === text && (!key || x.key === key)),
|
|
2194
|
+
};
|
|
2195
|
+
}
|
|
2196
|
+
/**
|
|
2197
|
+
* Pending Decisions grouped by Project, then by the Session that left them, as the Unattended page and `sideby
|
|
2198
|
+
* unattended pending` show them (spec §3.37, ADR-0078). What nobody touched (`open`) comes first at every level: a
|
|
2199
|
+
* Project with an open one before the others, the newest open one first, then the rest by their newest one, and the
|
|
2200
|
+
* group without a Project (`project` '') last. Inside a Project a Session's open ones and its other ones are two
|
|
2201
|
+
* blocks, so every open block comes before every replied one, each set ordered the same way; inside a block the
|
|
2202
|
+
* replied ones before the done ones, each oldest first. Counts are per state.
|
|
2203
|
+
*/
|
|
2204
|
+
export function uaGroupByProject(list) {
|
|
2205
|
+
const rank = (d) => (d.state === 'replied' ? 1 : d.state === 'done' ? 2 : 0);
|
|
2206
|
+
const time = (d) => Date.parse(d.at);
|
|
2207
|
+
const order = (a, b) => rank(a) - rank(b) || time(a) - time(b) || a.id.localeCompare(b.id);
|
|
2208
|
+
// Those with an open one first, the newest open one first; then by the newest one.
|
|
2209
|
+
const lead = (items) => {
|
|
2210
|
+
const open = items.filter((d) => rank(d) === 0).map(time);
|
|
2211
|
+
return [open.length ? 0 : 1, -Math.max(...(open.length ? open : items.map(time)))];
|
|
2212
|
+
};
|
|
2213
|
+
const before = (a, b) => {
|
|
2214
|
+
const [x, y] = [lead(a), lead(b)];
|
|
2215
|
+
return x[0] - y[0] || x[1] - y[1];
|
|
2216
|
+
};
|
|
2217
|
+
const projects = new Map();
|
|
2218
|
+
for (const d of list)
|
|
2219
|
+
projects.set(d.project, [...(projects.get(d.project) ?? []), d]);
|
|
2220
|
+
return [...projects]
|
|
2221
|
+
.sort(([pa, a], [pb, b]) => Number(pa === '') - Number(pb === '') || before(a, b) || pa.localeCompare(pb))
|
|
2222
|
+
.map(([project, items]) => {
|
|
2223
|
+
const sessions = new Map();
|
|
2224
|
+
for (const d of items) {
|
|
2225
|
+
const key = `${project}|${d.sessionId ? `s:${d.sessionId}` : 'none'}|${rank(d) === 0 ? 'open' : 'rest'}`;
|
|
2226
|
+
sessions.set(key, [...(sessions.get(key) ?? []), d]);
|
|
2227
|
+
}
|
|
2228
|
+
const count = (r) => items.filter((d) => rank(d) === r).length;
|
|
2229
|
+
return {
|
|
2230
|
+
key: `p:${project}`,
|
|
2231
|
+
project,
|
|
2232
|
+
name: items[0].projectName,
|
|
2233
|
+
open: count(0),
|
|
2234
|
+
replied: count(1),
|
|
2235
|
+
done: count(2),
|
|
2236
|
+
sessions: [...sessions]
|
|
2237
|
+
.sort(([ka, a], [kb, b]) => before(a, b) || ka.localeCompare(kb))
|
|
2238
|
+
.map(([key, s]) => {
|
|
2239
|
+
const sorted = [...s].sort(order);
|
|
2240
|
+
return { key, first: sorted[0], items: sorted };
|
|
2241
|
+
}),
|
|
2242
|
+
};
|
|
2243
|
+
});
|
|
2244
|
+
}
|
|
2149
2245
|
/**
|
|
2150
2246
|
* A time typed into the Unattended page's 24-hour fields as `HH:MM`, or null when it is not one. Takes `7:30`,
|
|
2151
2247
|
* `07:30`, `730`, `0730`, `7` (07:00), and the full-width colon a Chinese input method types; the field's `pattern`
|