sideby 0.41.2 → 0.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/dist/build.json +1 -1
  2. package/dist/src/cli/commands.d.ts +2 -0
  3. package/dist/src/cli/commands.js +263 -32
  4. package/dist/src/cli/json-schemas.js +85 -4
  5. package/dist/src/cli/main.js +49 -7
  6. package/dist/src/core/claude-memory.d.ts +236 -0
  7. package/dist/src/core/claude-memory.js +937 -0
  8. package/dist/src/core/cli-commands.js +16 -3
  9. package/dist/src/core/config.d.ts +17 -0
  10. package/dist/src/core/config.js +266 -43
  11. package/dist/src/core/history-project.d.ts +14 -0
  12. package/dist/src/core/history-project.js +42 -12
  13. package/dist/src/core/history.d.ts +4 -6
  14. package/dist/src/core/history.js +5 -15
  15. package/dist/src/core/local-build.d.ts +12 -0
  16. package/dist/src/core/local-build.js +32 -0
  17. package/dist/src/core/search-catalog.js +49 -0
  18. package/dist/src/core/session-hooks.d.ts +12 -2
  19. package/dist/src/core/session-hooks.js +12 -8
  20. package/dist/src/core/unattended-followup.d.ts +62 -0
  21. package/dist/src/core/unattended-followup.js +205 -0
  22. package/dist/src/core/unattended-pending.d.ts +11 -3
  23. package/dist/src/core/unattended-pending.js +34 -8
  24. package/dist/src/families/claude/history.js +9 -1
  25. package/dist/src/families/claude/layout.d.ts +7 -0
  26. package/dist/src/families/claude/layout.js +17 -0
  27. package/dist/src/families/claude/live-sessions.js +2 -1
  28. package/dist/src/families/history.d.ts +22 -2
  29. package/dist/src/families/history.js +55 -0
  30. package/dist/src/handoff/messages.js +1 -1
  31. package/dist/src/panel/handler.d.ts +22 -4
  32. package/dist/src/panel/handler.js +71 -25
  33. package/dist/src/panel/i18n.d.ts +35 -1
  34. package/dist/src/panel/i18n.js +72 -4
  35. package/dist/src/panel/page-logic.d.ts +53 -0
  36. package/dist/src/panel/page-logic.js +96 -0
  37. package/dist/src/panel/page-script.js +174 -36
  38. package/dist/src/panel/page-styles.js +18 -0
  39. package/dist/src/runtime.d.ts +30 -0
  40. package/dist/src/runtime.js +85 -1
  41. package/dist/src/unattended/hook.d.ts +10 -5
  42. package/dist/src/unattended/hook.js +17 -12
  43. package/package.json +1 -1
  44. package/schemas/config.json +5 -1
  45. package/schemas/memory-set.json +117 -0
  46. package/schemas/memory.json +210 -0
  47. package/schemas/unattended-pending.json +156 -56
  48. package/skills/sideby/SKILL.md +3 -1
  49. package/skills/sideby/references/diagnose.md +1 -0
  50. package/skills/sideby/references/handoff.md +1 -1
  51. package/skills/sideby/references/panel.md +1 -1
  52. package/skills/sideby/references/sharing.md +23 -1
  53. package/skills/sideby/references/unattended.md +16 -5
@@ -1,8 +1,17 @@
1
- import type { FamilyDef, FamilyHistory, ParsedSession } from '../types.ts';
1
+ import type { Account, FamilyDef, FamilyHistory, HistoryMessage, ParsedSession } from '../types.ts';
2
2
  export type { HistoryFile, HistoryMessage, ParsedSession, TitleSource } from '../types.ts';
3
+ /**
4
+ * A message as a reader gives it inside sideby: a user message may say who made it, when the Host records that
5
+ * (Claude Code's `origin.kind`: `human`, `task-notification`, `peer`, …). Never shown, and not part of the plugin
6
+ * contract (`HistoryMessage`).
7
+ */
8
+ export interface ReadMessage extends HistoryMessage {
9
+ origin?: string;
10
+ }
3
11
  /** A Session History reader: a built-in Family's, or a plugin Family's `history` with its Family id. */
4
- export interface HistoryReader extends Omit<FamilyHistory, 'resumeArgs' | 'toolText'> {
12
+ export interface HistoryReader extends Omit<FamilyHistory, 'resumeArgs' | 'toolText' | 'messages'> {
5
13
  family: string;
14
+ messages(path: string): AsyncIterable<ReadMessage>;
6
15
  /**
7
16
  * The text of the Session's tool calls (their input) and tool results, for searching tool output. Never the
8
17
  * record's other fields (ids, instructions, settings), so a search cannot match or show them.
@@ -18,3 +27,14 @@ export interface HistoryReader extends Omit<FamilyHistory, 'resumeArgs' | 'toolT
18
27
  export declare function checkParsed(family: string, p: ParsedSession | undefined): ParsedSession | undefined;
19
28
  /** The Session History reader of a Family: a built-in one's, else the `history` a plugin Family declares. */
20
29
  export declare function historyReader(familyId: string, families?: ReadonlyMap<string, FamilyDef>): HistoryReader | undefined;
30
+ /**
31
+ * One Account's Session records, listed once: `find` gives where Session `id`'s record is, or undefined. The id is
32
+ * matched against the names listed and never put into a path.
33
+ */
34
+ export interface SessionRecords {
35
+ find(id: string): string | undefined;
36
+ }
37
+ /** Whether sideby can find one Session's record by its id in a Family's Accounts (`sessionRecords`). */
38
+ export declare const findsSessionRecords: (familyId: string) => boolean;
39
+ /** The Session records of `account`, read-only; undefined when its Family is another one or keeps none sideby finds. */
40
+ export declare function sessionRecords(familyId: string, account: Account): Promise<SessionRecords | undefined>;
@@ -1,3 +1,5 @@
1
+ import { readdir } from 'node:fs/promises';
2
+ import { join } from 'node:path';
1
3
  import { claudeHistory } from './claude/history.js';
2
4
  import { codexHistory } from './codex/history.js';
3
5
  import { grokHistory } from './grok/history.js';
@@ -79,3 +81,56 @@ export function historyReader(familyId, families) {
79
81
  }
80
82
  return r;
81
83
  }
84
+ async function entries(dir) {
85
+ try {
86
+ return await readdir(dir, { withFileTypes: true });
87
+ }
88
+ catch {
89
+ return [];
90
+ }
91
+ }
92
+ /** Claude's `projects/<folder>/<id>.jsonl` (the first folder that has one). */
93
+ async function claudeRecords(account) {
94
+ const root = join(account.dir, 'projects');
95
+ const byId = new Map();
96
+ const folders = (await entries(root)).filter((e) => e.isDirectory());
97
+ const listed = await Promise.all(folders.map((f) => entries(join(root, f.name))));
98
+ folders.forEach((f, i) => {
99
+ for (const e of listed[i]) {
100
+ const id = e.name.slice(0, -'.jsonl'.length);
101
+ if (e.name.endsWith('.jsonl') && !e.isDirectory() && !byId.has(id))
102
+ byId.set(id, join(root, f.name, e.name));
103
+ }
104
+ });
105
+ return { find: (id) => byId.get(id) };
106
+ }
107
+ /** Codex's `sessions/<date folders>/rollout-…-<id>.jsonl`. */
108
+ async function codexRecords(account) {
109
+ const root = join(account.dir, 'sessions');
110
+ let names = [];
111
+ try {
112
+ names = (await readdir(root, { recursive: true })).filter((n) => n.endsWith('.jsonl'));
113
+ }
114
+ catch {
115
+ // no sessions yet
116
+ }
117
+ return {
118
+ find: (id) => {
119
+ const name = names.find((n) => n.endsWith(`-${id}.jsonl`));
120
+ return name === undefined ? undefined : join(root, name);
121
+ },
122
+ };
123
+ }
124
+ /** Where each built-in Family keeps its Session records in an Account (the files `list` finds). */
125
+ const RECORD_LISTS = {
126
+ claude: claudeRecords,
127
+ codex: codexRecords,
128
+ };
129
+ /** Whether sideby can find one Session's record by its id in a Family's Accounts (`sessionRecords`). */
130
+ export const findsSessionRecords = (familyId) => Object.hasOwn(RECORD_LISTS, familyId) && READERS.has(familyId);
131
+ /** The Session records of `account`, read-only; undefined when its Family is another one or keeps none sideby finds. */
132
+ export async function sessionRecords(familyId, account) {
133
+ if (account.family !== familyId || !Object.hasOwn(RECORD_LISTS, familyId))
134
+ return undefined;
135
+ return RECORD_LISTS[familyId](account);
136
+ }
@@ -8,7 +8,7 @@ const TEMPLATE = [
8
8
  'key decisions and why',
9
9
  'the files that matter',
10
10
  ].join('; ');
11
- const RULES = `Reference specs, ADRs, commits and diffs by path instead of repeating them, list the skills the next agent should use, and never include keys, passwords or personal data. End the brief with the line ${BRIEF_DONE} once it covers all of this.`;
11
+ const RULES = `Reference specs, ADRs, commits and diffs by path instead of repeating them, list the skills the next agent should use, and never include keys, passwords or personal data. Copy any standing permission or limit the user gave word for word, saying where it comes from (a file's path, or the user's message), and add no limit the user did not give. End the brief with the line ${BRIEF_DONE} once it covers all of this.`;
12
12
  const WINDOW_NAMES = { '5h': '5-hour', '7d': 'weekly' };
13
13
  const when = (iso) => {
14
14
  const t = new Date(iso);
@@ -12,7 +12,7 @@ import { type NetworkOverview } from '../core/network.ts';
12
12
  import { type ProgressView } from '../core/progress.ts';
13
13
  import { type RemoteControlGroup } from '../core/remote-control.ts';
14
14
  import { type UnattendedStatus } from '../core/unattended.ts';
15
- import { type PendingDecision } from '../core/unattended-pending.ts';
15
+ import { type PendingProject, type PendingRow } from '../core/unattended-followup.ts';
16
16
  import * as update from '../core/update.ts';
17
17
  import type { AccountStatus, DoctorHistory, FamilyInfo, QuotaCheckInfo, Runtime } from '../runtime.ts';
18
18
  import type { Account, FamilyLogo, QuotaResult, QuotaSetupPlan, UsageResult } from '../types.ts';
@@ -309,6 +309,12 @@ export interface PanelState {
309
309
  * `.claude.json` is read for it); absent with fewer than two Claude Accounts, unless it is on or has marks.
310
310
  */
311
311
  trust?: PanelTrust;
312
+ /**
313
+ * Shared Project Memory (spec §3.44): config `claude.shareMemory` and how many files Doctor moved into the Main Account,
314
+ * from the config and sideby's own records (no Account folder is read for it); absent with fewer than two Claude
315
+ * Accounts, unless it is on or Doctor moved something.
316
+ */
317
+ memory?: PanelMemory;
312
318
  }
313
319
  export interface PanelTrust {
314
320
  on: boolean;
@@ -319,8 +325,16 @@ export interface PanelTrust {
319
325
  at: string;
320
326
  }[];
321
327
  }
322
- /** One Pending Decision as the Panel's Unattended page lists it, with the way back to its Session. */
323
- export interface PanelPendingDecision extends PendingDecision {
328
+ export interface PanelMemory {
329
+ on: boolean;
330
+ /** Files Doctor moved into the Main Account so far. */
331
+ folded: number;
332
+ }
333
+ /**
334
+ * One Pending Decision as the Panel's Unattended page lists it, with its Project, state and reply (ADR-0078; `project`
335
+ * and `cwd` shortened with `~`) and the way back to its Session.
336
+ */
337
+ export interface PanelPendingDecision extends PendingRow {
324
338
  /** The Account's short name (its Alias when it has one). */
325
339
  accountLabel?: string;
326
340
  /** The Session still runs: its label, so the Sessions page finds it. */
@@ -338,10 +352,14 @@ export interface PanelPendingDecision extends PendingDecision {
338
352
  export type PanelUnattendedStatus = UnattendedStatus & {
339
353
  pendingIds: string[];
340
354
  };
341
- /** The Unattended page: the status and every open Pending Decision. */
355
+ /** The Unattended page: the status and every open Pending Decision, with each Project's counts in page order. */
342
356
  export interface PanelUnattended {
343
357
  status: PanelUnattendedStatus;
358
+ /** The open ones (`state` open or replied). */
344
359
  pending: PanelPendingDecision[];
360
+ projects: PendingProject[];
361
+ /** The ones marked done and kept (30 days), newest mark first, so one marked by mistake can be reopened. */
362
+ done: PanelPendingDecision[];
345
363
  }
346
364
  /** What a change on the Unattended page did, and the request that puts back what was there. */
347
365
  export interface PanelUnattendedChange {
@@ -39,7 +39,8 @@ import { checkThemeData, listThemes, NO_THEME, previewColors, removeThemeFile, r
39
39
  import { MIN_CALLS } from '../core/tuning.js';
40
40
  import { onUntil, setAnswerWait, setUnattendedSchedule, turnUnattendedOff, turnUnattendedOn, unattendedStatus, } from '../core/unattended.js';
41
41
  import { checkUnattendedEnded } from '../core/unattended-ended.js';
42
- import { listPendingDecisions, markPendingDone, reopenPendingDecision, } from '../core/unattended-pending.js';
42
+ import { pendingOverview, } from '../core/unattended-followup.js';
43
+ import { listPendingDecisions, markPendingDone, reopenPendingDecisions } from '../core/unattended-pending.js';
43
44
  import { readUnattendedConfig } from '../core/unattended-state.js';
44
45
  import * as update from '../core/update.js';
45
46
  import { buildId, localBuild, packageVersion } from '../core/version.js';
@@ -651,6 +652,7 @@ async function buildState(rt, opts) {
651
652
  const showBrowser = browser && (browser.families.matched.length || browser.families.openOnly.length);
652
653
  const progress = accounts.some((a) => PROGRESS_FAMILIES.includes(a.family)) ? rt.progressView() : undefined;
653
654
  const trust = await panelTrust(rt, accounts).catch(() => undefined);
655
+ const memory = await panelMemory(rt, accounts).catch(() => undefined);
654
656
  const permissions = aiTaskPermissions(rt.config);
655
657
  return {
656
658
  schemaVersion: 1,
@@ -700,8 +702,16 @@ async function buildState(rt, opts) {
700
702
  ...(unattended ? { unattended } : {}),
701
703
  ...(progress ? { progress } : {}),
702
704
  ...(trust ? { trust } : {}),
705
+ ...(memory ? { memory } : {}),
703
706
  };
704
707
  }
708
+ /** The Panel's view of Shared Project Memory (spec §3.44), or undefined when there is nothing to show. */
709
+ async function panelMemory(rt, accounts) {
710
+ const st = await rt.memoryOverview();
711
+ if (accounts.filter((a) => a.family === 'claude').length < 2 && !st.on && !st.folded.length)
712
+ return undefined;
713
+ return { on: st.on, folded: st.folded.reduce((n, f) => n + f.files, 0) };
714
+ }
705
715
  /** The Panel's view of carried trust (spec §3.43), or undefined when there is nothing to show. */
706
716
  async function panelTrust(rt, accounts) {
707
717
  const st = await rt.trustStatus();
@@ -738,31 +748,46 @@ async function unattendedView(rt, readOnly, live) {
738
748
  const families = [...rt.families.keys()];
739
749
  const [status, decisions, accounts] = await Promise.all([
740
750
  unattendedStatus({ paths: rt.paths, families, readOnly }),
741
- listPendingDecisions(rt.paths.stateDir, { prune: !readOnly }),
751
+ listPendingDecisions(rt.paths.stateDir, { prune: !readOnly, all: true }),
742
752
  rt.accounts(),
743
753
  ]);
754
+ const open = decisions.filter((d) => !d.doneAt);
744
755
  const labels = accountLabels(rt, accounts);
745
- const running = decisions.some((d) => d.sessionId)
756
+ const running = open.some((d) => d.sessionId)
746
757
  ? (await live(rt).catch(() => ({ sessions: [], problems: [] }))).sessions
747
758
  : [];
748
759
  const home = rt.paths.home;
760
+ // Each one's Project and whether the user replied in its session since (ADR-0078); a failure only leaves them out.
761
+ const overview = await pendingOverview({ decisions, accounts, stateDir: rt.paths.stateDir }).catch(() => ({
762
+ rows: decisions.map((d) => ({ ...d, project: '', projectName: '', state: d.doneAt ? 'done' : 'open' })),
763
+ projects: [],
764
+ }));
765
+ const shown = (d) => {
766
+ const label = d.account ? labels.get(d.account) : undefined;
767
+ const session = d.sessionId ? running.find((s) => s.sessionId === d.sessionId) : undefined;
768
+ const known = d.account && accounts.some((a) => a.ref === d.account);
769
+ const resume = d.sessionId && SAFE_SESSION_ID.test(d.sessionId) && known
770
+ ? resumeCommandFor(d.family, d.account, d.sessionId)
771
+ : undefined;
772
+ return {
773
+ ...d,
774
+ project: d.project && tildify(d.project, home),
775
+ ...(d.cwd ? { cwd: tildify(d.cwd, home) } : {}),
776
+ ...(label ? { accountLabel: label } : {}),
777
+ ...(session ? { live: { label: session.label, accountLabel: session.accountLabel } } : {}),
778
+ ...(resume ? { resume: d.cwd ? `cd ${shellArg(d.cwd)} && ${resume}` : resume } : {}),
779
+ };
780
+ };
749
781
  return {
750
- status: { ...status, pending: decisions.length, pendingIds: decisions.map((d) => d.id) },
751
- pending: decisions.map((d) => {
752
- const label = d.account ? labels.get(d.account) : undefined;
753
- const session = d.sessionId ? running.find((s) => s.sessionId === d.sessionId) : undefined;
754
- const known = d.account && accounts.some((a) => a.ref === d.account);
755
- const resume = d.sessionId && SAFE_SESSION_ID.test(d.sessionId) && known
756
- ? resumeCommandFor(d.family, d.account, d.sessionId)
757
- : undefined;
758
- return {
759
- ...d,
760
- ...(d.cwd ? { cwd: tildify(d.cwd, home) } : {}),
761
- ...(label ? { accountLabel: label } : {}),
762
- ...(session ? { live: { label: session.label, accountLabel: session.accountLabel } } : {}),
763
- ...(resume ? { resume: d.cwd ? `cd ${shellArg(d.cwd)} && ${resume}` : resume } : {}),
764
- };
765
- }),
782
+ status: { ...status, pending: open.length, pendingIds: open.map((d) => d.id) },
783
+ projects: overview.projects
784
+ .filter((p) => p.open + p.replied > 0)
785
+ .map((p) => ({ ...p, project: p.project && tildify(p.project, home) })),
786
+ pending: overview.rows.filter((d) => d.state !== 'done').map(shown),
787
+ done: overview.rows
788
+ .filter((d) => d.state === 'done')
789
+ .sort((a, b) => Date.parse(b.doneAt) - Date.parse(a.doneAt))
790
+ .map(shown),
766
791
  };
767
792
  }
768
793
  /** The `display` of a /api/display-order body: null, or string lists only; anything else is refused. */
@@ -1512,6 +1537,18 @@ export function createPanelHandler(opts) {
1512
1537
  return { ...r, file: tildify(r.file, rt.paths.home) };
1513
1538
  },
1514
1539
  },
1540
+ // Shared Project Memory (spec §3.44, ADR-0081): config `claude.shareMemory`, shown first like every config change;
1541
+ // the switch sends `confirm` with the words it shows beside it.
1542
+ '/api/memory/settings': {
1543
+ writes: (body) => body.confirm === true,
1544
+ async run(body) {
1545
+ if (typeof body.on !== 'boolean')
1546
+ throw new HttpError(400, '"on" must be true or false');
1547
+ const rt = await getRuntime();
1548
+ const r = await rt.memorySet(body.on, { apply: optBool(body, 'confirm') });
1549
+ return { ...r, file: tildify(r.file, rt.paths.home) };
1550
+ },
1551
+ },
1515
1552
  // Takes back the trust marks sideby copied (`sideby trust undo`): without `confirm` what it would do, with it done.
1516
1553
  '/api/trust/undo': {
1517
1554
  writes: (body) => body.confirm === true,
@@ -2070,18 +2107,27 @@ export function createPanelHandler(opts) {
2070
2107
  };
2071
2108
  },
2072
2109
  },
2073
- // Marks one Pending Decision done (or every open one with `all`), or with `done: false` opens one again.
2110
+ // Marks one Pending Decision done (or every open one with `all`, or the `ids` the page showed: a Project's replied
2111
+ // ones, ADR-0078), or with `done: false` opens them again.
2074
2112
  '/api/unattended/pending': {
2075
2113
  async run(body) {
2076
2114
  const id = optString(body, 'id');
2077
2115
  const all = body.all === true;
2078
- if (!id && !all)
2079
- throw new HttpError(400, '"id" or "all" is required');
2116
+ const ids = body.ids;
2117
+ if (ids !== undefined &&
2118
+ (!Array.isArray(ids) ||
2119
+ !ids.length ||
2120
+ ids.length > 10_000 ||
2121
+ !ids.every((x) => typeof x === 'string' && x.length <= 64)))
2122
+ throw new HttpError(400, '"ids" must be a list of Pending Decision ids');
2123
+ const list = ids;
2124
+ if (!id && !all && !list)
2125
+ throw new HttpError(400, '"id", "ids" or "all" is required');
2080
2126
  const rt = await getRuntime();
2081
2127
  try {
2082
- const changed = body.done === false && id
2083
- ? [await reopenPendingDecision(rt.paths.stateDir, id)]
2084
- : await markPendingDone(rt.paths.stateDir, all ? 'all' : id);
2128
+ const changed = body.done === false && (id || list)
2129
+ ? await reopenPendingDecisions(rt.paths.stateDir, list ?? [id])
2130
+ : await markPendingDone(rt.paths.stateDir, all ? 'all' : (list ?? id));
2085
2131
  return { ids: changed.map((d) => d.id) };
2086
2132
  }
2087
2133
  catch (err) {
@@ -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.allDone': string;
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;
@@ -1796,6 +1818,18 @@ declare const en: {
1796
1818
  'tr.onToast': string;
1797
1819
  'tr.offToast': string;
1798
1820
  'tr.failed': string;
1821
+ 'ai.ask.memory': string;
1822
+ 'mm.title': string;
1823
+ 'mm.hint': string;
1824
+ 'mm.switch': string;
1825
+ 'mm.what': string;
1826
+ 'mm.doctor': string;
1827
+ 'mm.offKeeps': string;
1828
+ 'mm.folded.one': string;
1829
+ 'mm.folded.other': string;
1830
+ 'mm.onToast': string;
1831
+ 'mm.offToast': string;
1832
+ 'mm.failed': string;
1799
1833
  };
1800
1834
  export type MessageKey = keyof typeof en;
1801
1835
  export declare const MESSAGES: Record<PanelLang, Record<string, string>>;
@@ -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. Nothing here was done.',
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.allDone': 'Mark all done',
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.',
@@ -1798,6 +1820,18 @@ const en = {
1798
1820
  'tr.onToast': 'Folder trust is reused now. Claude accounts sideby starts no longer ask where another account trusts the folder.',
1799
1821
  'tr.offToast': 'Folder trust is no longer reused. What was copied stays.',
1800
1822
  'tr.failed': 'Could not change folder trust: {msg}. Try again, or run sideby trust in a terminal.',
1823
+ 'ai.ask.memory': 'Let all my Claude accounts share what they remember about each project.',
1824
+ 'mm.title': 'Shared memory',
1825
+ 'mm.hint': 'Claude remembers what it learns about a project, but each account keeps its own memory. sideby can let all your Claude accounts share one memory per project.',
1826
+ 'mm.switch': 'Share project memory across my Claude accounts',
1827
+ 'mm.what': "Claude sessions sideby starts in your other accounts read and write the main account's memory of the project, so the next account knows what the last one learned.",
1828
+ 'mm.doctor': 'Memory an account wrote on its own (a session started without sideby) stays there until you click Fix all on the Accounts page; then it moves into the main account. A file that differs is kept beside the main one under a new name, and the emptied folder goes to the trash.',
1829
+ 'mm.offKeeps': 'Turning it off stops sharing from the next session on. Memory already moved into the main account stays there; it is not moved back to each account.',
1830
+ 'mm.folded.one': 'So far, Fix all moved 1 memory file into the main account.',
1831
+ 'mm.folded.other': 'So far, Fix all moved {n} memory files into the main account.',
1832
+ 'mm.onToast': "Shared memory is on. Claude accounts sideby starts from now on use the main account's memory; Fix all moves what they already wrote.",
1833
+ 'mm.offToast': 'Shared memory is off. Memory already in the main account stays.',
1834
+ 'mm.failed': 'Could not change shared memory: {msg}. Try again, or run sideby memory in a terminal.',
1801
1835
  };
1802
1836
  const zh = {
1803
1837
  'top.tagline': '所有 AI 编程账号,并排运行。',
@@ -3528,7 +3562,26 @@ const zh = {
3528
3562
  'ua.waitFailed': '没改成:{msg}',
3529
3563
  'ua.waited': '等了 {n} 分钟没人回答',
3530
3564
  'ua.pending': '待你决定',
3531
- 'ua.pendingNote': '会话没问你或没人回答的问题、要你确认的操作和跳过的操作。这里的事都还没做。',
3565
+ 'ua.pendingNote': '会话没问你或没人回答的问题、要你确认的操作和跳过的操作,按项目分组,先列没人碰过的。之后在会话里说过话的,折叠在每个项目下面:说过话不等于处理完了。',
3566
+ 'ua.replied': '之后在这个会话里说过话 · {ago}',
3567
+ 'ua.repliedTip': '记下这条之后,你 {when} 在这个会话里说过话。处理完没有,sideby 看不出来。',
3568
+ 'ua.noRecord': '看不到会话记录,看不出你之后在会话里说过话没有。',
3569
+ 'ua.projOpen.one': '{n} 条没人碰过',
3570
+ 'ua.projOpen.other': '{n} 条没人碰过',
3571
+ 'ua.projReplied.one': '{n} 条之后说过话',
3572
+ 'ua.projReplied.other': '{n} 条之后说过话',
3573
+ 'ua.projOther': '其他',
3574
+ 'ua.repliedShow.one': '之后说过话({n})',
3575
+ 'ua.repliedShow.other': '之后说过话({n})',
3576
+ 'ua.repliedBatch.one': '把这 1 条标为已处理',
3577
+ 'ua.repliedBatch.other': '把这 {n} 条标为已处理',
3578
+ 'ua.repliedCaution': '其中可能有没处理完的,先看一眼。',
3579
+ 'ua.doneShow.one': '已处理({n})',
3580
+ 'ua.doneShow.other': '已处理({n})',
3581
+ 'ua.doneListNote': '最近 30 天标为已处理的。标错了可以重新打开。',
3582
+ 'ua.doneWhen': '{when} 标为已处理',
3583
+ 'ua.reopen': '重新打开',
3584
+ 'ua.reopenedOne': '已重新打开。',
3532
3585
  'ua.pendingEmpty': '没有待你决定的事',
3533
3586
  'ua.pendingBlocked': '上面说的文件夹修好之前,sideby 读不到它们。',
3534
3587
  'ua.loading': '正在读取…',
@@ -3537,7 +3590,9 @@ const zh = {
3537
3590
  'ua.kind.permission': '要你确认的操作',
3538
3591
  'ua.agent': '子 agent {type}',
3539
3592
  'ua.done': '已处理',
3540
- 'ua.allDone': '全部标为已处理',
3593
+ 'ua.allDoneN.one': '标为已处理',
3594
+ 'ua.allDoneN.other': '全部 {n} 条标为已处理',
3595
+ 'ua.doneAlready': '这条已经标为已处理了。',
3541
3596
  'ua.doneOne': '已标为已处理。',
3542
3597
  'ua.doneMany.one': '已把 {n} 条标为已处理。',
3543
3598
  'ua.doneMany.other': '已把 {n} 条标为已处理。',
@@ -3560,6 +3615,7 @@ const zh = {
3560
3615
  'ua.problem': 'sideby 没法保存状态:{msg}',
3561
3616
  'ua.unreadable': 'sideby 读不到无人值守的状态。刷新再试一次。',
3562
3617
  'ai.ask.unattended': '今晚无人值守,到明早 8 点',
3618
+ 'ai.ask.pending': '按项目列出还没处理的待决事项',
3563
3619
  'ai.ask.progress': '后台任务跑着时,每 30 分钟告诉我会话在等什么。',
3564
3620
  'pr.title': '进度提醒',
3565
3621
  'pr.hint': 'Claude 会话等后台任务(子任务、长命令)时,告诉你在等什么、等了多久:默认每 30 分钟一次,也可以自己选。',
@@ -3596,5 +3652,17 @@ const zh = {
3596
3652
  'tr.onToast': '已开始沿用文件夹信任。sideby 启动的 Claude 账号,在别的账号信任过的文件夹里不再询问。',
3597
3653
  'tr.offToast': '已不再沿用文件夹信任。已经复制的保留。',
3598
3654
  'tr.failed': '没能改文件夹信任:{msg}。可以再试一次,或在终端运行 sideby trust。',
3655
+ 'ai.ask.memory': '让我所有 Claude 账号共用对每个项目的记忆。',
3656
+ 'mm.title': '共享记忆',
3657
+ 'mm.hint': 'Claude 会记住它在项目里学到的东西,但每个账号各记各的。sideby 可以让你所有 Claude 账号每个项目共用一份记忆。',
3658
+ 'mm.switch': '让我的 Claude 账号共用项目记忆',
3659
+ 'mm.what': 'sideby 在其他账号里启动的 Claude 会话,读写主账号对这个项目的记忆,下一个账号就知道上一个学到了什么。',
3660
+ 'mm.doctor': '账号自己写下的记忆(不经 sideby 启动的会话)先留在那个账号里,在账号页点「全部修复」后移进主账号。同名但内容不同的文件换个名字放在主账号那份旁边,清空的文件夹移到废纸篓。',
3661
+ 'mm.offKeeps': '关掉后,从下一个会话起不再共用。已经移进主账号的记忆留在主账号,不会搬回各账号。',
3662
+ 'mm.folded.one': '「全部修复」已把 1 个记忆文件移进主账号。',
3663
+ 'mm.folded.other': '「全部修复」已把 {n} 个记忆文件移进主账号。',
3664
+ 'mm.onToast': '已打开共享记忆。之后 sideby 启动的 Claude 账号用主账号的记忆;「全部修复」会把它们已经写下的移过来。',
3665
+ 'mm.offToast': '已关闭共享记忆。已经在主账号里的记忆保留。',
3666
+ 'mm.failed': '没能改共享记忆:{msg}。可以再试一次,或在终端运行 sideby memory。',
3599
3667
  };
3600
3668
  export const MESSAGES = { en, zh };
@@ -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`