sideby 0.43.0 → 0.44.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/dist/build.json CHANGED
@@ -1 +1 @@
1
- {"id":"20261123T084452-36eed7"}
1
+ {"id":"20261123T103613-7b7f5c"}
@@ -902,6 +902,13 @@ export const OUTPUT_SCHEMAS = {
902
902
  usedPercent: Type.Number({ description: 'Rounded.' }),
903
903
  limit: Type.Number({ description: "This window's Takeover Limit in percent." }),
904
904
  }, { description: 'The window closest to its own Takeover Limit; absent when none is open.' })),
905
+ windows: Type.Optional(Type.Array(Type.Object({
906
+ label: Type.String({ description: 'Such as `5h` or `7d`.' }),
907
+ usedPercent: Type.Number({ description: 'Rounded; what is left is 100 minus it.' }),
908
+ resetsAt: Str,
909
+ }), {
910
+ description: 'Every counted window (no model name) that has not reset yet, so a caller can show what the pick has left; absent when none is open.',
911
+ })),
905
912
  resetsAt: Type.Optional(Type.String({
906
913
  description: 'For full: when it is usable again. With a window used up, when those windows reset; otherwise when every window is under its Takeover Limit again.',
907
914
  })),
@@ -36,6 +36,8 @@ export declare class FileMemo<T> {
36
36
  pass(scope: string): MemoPass<T>;
37
37
  /** What is remembered, for the cache file; clears `dirty`. */
38
38
  dump(): MemoDump;
39
+ /** The scopes a pass ended in since the last call, for merging into the cache file; clears `dirty`. */
40
+ takeFresh(): MemoDump;
39
41
  /**
40
42
  * Takes remembered parses from the cache file for scopes this process has not read yet. The values are trusted
41
43
  * to have the shape `persist.version` stands for; a stale one never matches, because its signature differs.
@@ -14,6 +14,12 @@ export class FileMemo {
14
14
  stats = { hits: 0, misses: 0 };
15
15
  /** True when a pass changed what is remembered since the last `dump`. */
16
16
  dirty = false;
17
+ /**
18
+ * Scopes a pass ended in since the last `takeFresh`. Only these are this process's own news: the others hold what
19
+ * the cache file had when this process started, which another sideby process sharing the state directory may since
20
+ * have replaced with newer parses.
21
+ */
22
+ #fresh = new Set();
17
23
  persist;
18
24
  constructor(persist) {
19
25
  if (!persist)
@@ -61,6 +67,7 @@ export class FileMemo {
61
67
  if (!before || before.size !== seen.size || [...seen].some(([k, v]) => before.get(k) !== v))
62
68
  this.dirty = true;
63
69
  this.#scopes.set(scope, seen);
70
+ this.#fresh.add(scope);
64
71
  },
65
72
  };
66
73
  }
@@ -72,6 +79,18 @@ export class FileMemo {
72
79
  out[scope] = Object.fromEntries([...files].map(([path, e]) => [path, [e.sig, e.value]]));
73
80
  return out;
74
81
  }
82
+ /** The scopes a pass ended in since the last call, for merging into the cache file; clears `dirty`. */
83
+ takeFresh() {
84
+ this.dirty = false;
85
+ const out = {};
86
+ for (const scope of this.#fresh) {
87
+ const files = this.#scopes.get(scope);
88
+ if (files)
89
+ out[scope] = Object.fromEntries([...files].map(([path, e]) => [path, [e.sig, e.value]]));
90
+ }
91
+ this.#fresh.clear();
92
+ return out;
93
+ }
75
94
  /**
76
95
  * Takes remembered parses from the cache file for scopes this process has not read yet. The values are trusted
77
96
  * to have the shape `persist.version` stands for; a stale one never matches, because its signature differs.
@@ -93,6 +112,7 @@ export class FileMemo {
93
112
  }
94
113
  clear() {
95
114
  this.#scopes.clear();
115
+ this.#fresh.clear();
96
116
  this.dirty = false;
97
117
  this.stats.hits = 0;
98
118
  this.stats.misses = 0;
@@ -58,6 +58,15 @@ export interface HandoffEntry {
58
58
  usedPercent: number;
59
59
  limit: number;
60
60
  };
61
+ /**
62
+ * Every counted window (no model `name`) that has not reset, so a caller can show what the pick has left (spec
63
+ * §3.45); absent when none is open.
64
+ */
65
+ windows?: {
66
+ label: string;
67
+ usedPercent: number;
68
+ resetsAt: string;
69
+ }[];
61
70
  /**
62
71
  * For `full`: when the last window at or over its own Takeover Limit resets, so the Account is usable again. In a
63
72
  * plan for a start the user asks for (`lastResort`), an Account with a window used up is usable again once those
@@ -32,6 +32,7 @@ export const blocked = (e) => Boolean(e.sameLoginAs || e.skip);
32
32
  function entry(c, now, limits, lastResort, liveSessions) {
33
33
  const pressure = quotaPressure(c.quota, now);
34
34
  const use = limitUse(c.quota, now, limits);
35
+ const open = openWindows(c.quota, now);
35
36
  const base = {
36
37
  ref: c.ref,
37
38
  kind: c.kind,
@@ -47,6 +48,15 @@ function entry(c, now, limits, lastResort, liveSessions) {
47
48
  },
48
49
  }
49
50
  : {}),
51
+ ...(open?.length
52
+ ? {
53
+ windows: open.map((w) => ({
54
+ label: w.label,
55
+ usedPercent: Math.round(w.usedPercent),
56
+ resetsAt: w.resetsAt,
57
+ })),
58
+ }
59
+ : {}),
50
60
  ...(c.quota.status === 'ok' ? { observedAt: c.quota.observedAt } : {}),
51
61
  ...(c.quota.status === 'ok' && c.quota.from ? { quotaFrom: c.quota.from } : {}),
52
62
  };
@@ -1,7 +1,12 @@
1
- // Keeps the persisted FileMemos (core/file-memo.ts) in `<stateDir>/cache/file-memo.json`, so a new process does not
1
+ // Keeps the persisted FileMemos (core/file-memo.ts) in `<stateDir>/cache/file-memo-2.json`, so a new process does not
2
2
  // parse every session log again: the Panel worker starts cold after each restart, reinstall or language switch,
3
3
  // and parsing the logs of a busy HOME takes seconds, while reading this file back takes milliseconds.
4
4
  //
5
+ // Several sideby processes share a state directory (a Panel worker, a background Panel, launchers that wait for hours).
6
+ // Each one writes only the scopes it read itself since its last write, into what the file holds at that moment, so a
7
+ // process that loaded the file long ago never puts its old parses back over newer ones. An older sideby that is still
8
+ // running writes the whole of `cache/file-memo.json`; this file has another name, so it cannot undo these merges.
9
+ //
5
10
  // The file holds token counts, session ids and log paths, never a credential; it is written atomically with mode
6
11
  // 600. Anything unexpected in it (another format, a parse error, a memo version that changed) is ignored and the
7
12
  // logs are parsed again, which gives the same results.
@@ -15,7 +20,7 @@ export const SAVE_INTERVAL_MS = 60_000;
15
20
  /** A write waits this long after the last read, so one Panel refresh over every Account is written as a whole. */
16
21
  export const SAVE_DELAY_MS = 2_000;
17
22
  export function memoCachePath(stateDir) {
18
- return join(stateDir, 'cache', 'file-memo.json');
23
+ return join(stateDir, 'cache', 'file-memo-2.json');
19
24
  }
20
25
  const stores = new Map();
21
26
  /** One store per state directory and process. */
@@ -28,13 +33,23 @@ export function memoStore(stateDir, now = Date.now, delayMs = SAVE_DELAY_MS) {
28
33
  let writing;
29
34
  let lastWrite = Number.NEGATIVE_INFINITY;
30
35
  let timer;
31
- const load = async () => {
36
+ /** The cache file's memos, or null when it is missing or not one this sideby can read. */
37
+ const readCache = async () => {
32
38
  try {
33
39
  const data = JSON.parse(await readFile(file, 'utf8'));
34
- if (data?.format !== FORMAT || !data.memos || typeof data.memos !== 'object')
40
+ return data?.format === FORMAT && data.memos && typeof data.memos === 'object' ? data.memos : null;
41
+ }
42
+ catch {
43
+ return null;
44
+ }
45
+ };
46
+ const load = async () => {
47
+ try {
48
+ const memos = await readCache();
49
+ if (!memos)
35
50
  return;
36
51
  for (const [name, memo] of persistedMemos) {
37
- const saved = data.memos[name];
52
+ const saved = memos[name];
38
53
  if (saved && saved.version === memo.persist?.version && saved.data && typeof saved.data === 'object')
39
54
  memo.restore(saved.data);
40
55
  }
@@ -47,9 +62,18 @@ export function memoStore(stateDir, now = Date.now, delayMs = SAVE_DELAY_MS) {
47
62
  if (![...persistedMemos.values()].some((m) => m.dirty))
48
63
  return;
49
64
  lastWrite = now();
50
- const out = { format: FORMAT, memos: {} };
51
- for (const [name, memo] of persistedMemos)
52
- out.memos[name] = { version: memo.persist?.version ?? 0, data: memo.dump() };
65
+ // Taken before the file is read again, so a pass that ends meanwhile counts toward the next write.
66
+ const fresh = [...persistedMemos].map(([name, memo]) => [name, memo, memo.takeFresh()]);
67
+ // Memos this process does not know (another sideby's) are kept as they are.
68
+ const out = { format: FORMAT, memos: { ...(await readCache()) } };
69
+ for (const [name, memo, scopes] of fresh) {
70
+ const version = memo.persist?.version ?? 0;
71
+ const saved = out.memos[name];
72
+ // A memo of another version is dropped whole, as `load` would.
73
+ const data = saved?.version === version && saved.data && typeof saved.data === 'object' ? { ...saved.data } : {};
74
+ Object.assign(data, scopes);
75
+ out.memos[name] = { version, data };
76
+ }
53
77
  try {
54
78
  await mkdir(join(stateDir, 'cache'), { recursive: true, mode: 0o700 });
55
79
  await writeFileAtomic(file, JSON.stringify(out));
@@ -0,0 +1,12 @@
1
+ import type { Account } from '../types.ts';
2
+ export interface QuotaWatchDir {
3
+ dir: string;
4
+ /** Whether files sit in subfolders (`sessions/2026/11/23/…`). */
5
+ recursive: boolean;
6
+ /** The changed name (relative to `dir`, any separator) that counts. */
7
+ match: RegExp;
8
+ /** At most one change every this many ms: a running session appends to these files all the time. */
9
+ gapMs: number;
10
+ }
11
+ /** The folders to watch for `accounts`. */
12
+ export declare function quotaWatchDirs(accounts: readonly Account[]): QuotaWatchDir[];
@@ -0,0 +1,24 @@
1
+ // Folders of built-in Families whose files change an Account's Quota or usage, for the Panel's change feed (spec
2
+ // §3.45, ADR-0084). Internal on purpose: not part of the public FamilyDef. Only file names are matched; nothing here
3
+ // is ever read.
4
+ import { join } from 'node:path';
5
+ const SESSION_GAP_MS = 5000;
6
+ const DIRS = {
7
+ // Quota (until a kept answer exists, `localFallbackOnly`) and usage from `token_count` events.
8
+ codex: (a) => [
9
+ {
10
+ dir: join(a.dir, 'sessions'),
11
+ recursive: true,
12
+ match: /(^|[\\/])rollout-[^\\/]*\.jsonl$/,
13
+ gapMs: SESSION_GAP_MS,
14
+ },
15
+ ],
16
+ // The Quota Grok logs after each turn (ADR-0025).
17
+ grok: (a) => [
18
+ { dir: join(a.dir, 'logs'), recursive: false, match: /^unified\.jsonl$/, gapMs: SESSION_GAP_MS },
19
+ ],
20
+ };
21
+ /** The folders to watch for `accounts`. */
22
+ export function quotaWatchDirs(accounts) {
23
+ return accounts.flatMap((a) => (Object.hasOwn(DIRS, a.family) ? DIRS[a.family](a) : []));
24
+ }
@@ -0,0 +1,57 @@
1
+ export interface WatchDir {
2
+ dir: string;
3
+ recursive: boolean;
4
+ /** The changed name (relative to `dir`) that counts. An event without a name always counts. */
5
+ match: {
6
+ test(name: string): boolean;
7
+ };
8
+ /** At most one change every this many ms from this folder. */
9
+ gapMs: number;
10
+ }
11
+ /** What `GET /api/changes` answers. */
12
+ export interface ChangeAnswer {
13
+ seq: number;
14
+ /** The count differs from the `since` the page sent. */
15
+ changed: boolean;
16
+ /** Some folder is watched; false means the page keeps to its poll. */
17
+ watching: boolean;
18
+ }
19
+ /** How long after the first event a change counts: an atomic write (temporary file, then rename) counts once. */
20
+ export declare const GATHER_MS = 300;
21
+ /** How long a request with nothing new is held. */
22
+ export declare const HOLD_MS = 25000;
23
+ /** Watchers close this long after the last request: the page asks again at once, so only a gone page is this quiet. */
24
+ export declare const IDLE_MS = 40000;
25
+ /** `<state>/quota`: the status line cache and the kept answers of each Host's own CLI. */
26
+ export declare function stateQuotaDir(stateDir: string): WatchDir;
27
+ interface Timers {
28
+ now(): number;
29
+ set(fn: () => void, ms: number): unknown;
30
+ clear(t: unknown): void;
31
+ }
32
+ /**
33
+ * Turns events into counted changes: one `GATHER_MS` after the first event, and never sooner than `gapMs` (the
34
+ * event's folder) after the last one. Events meanwhile join that change; one whose folder allows an earlier time
35
+ * brings it forward.
36
+ */
37
+ export declare function changeClock(fire: () => void, timers?: Timers): {
38
+ poke(gapMs: number): void;
39
+ stop(): void;
40
+ };
41
+ /**
42
+ * The feed of one Panel. `dirs` lists what to watch; `onChange` runs once per counted change, before held requests
43
+ * are answered.
44
+ */
45
+ export declare function createChangeFeed(opts: {
46
+ dirs: () => Promise<WatchDir[]>;
47
+ onChange?: () => void;
48
+ }): {
49
+ /**
50
+ * The answer for a page that last saw `since` (null: none yet). Held up to `HOLD_MS` while nothing changed, or
51
+ * until `gone` settles (the request closed).
52
+ */
53
+ wait(since: number | null, gone: Promise<unknown>): Promise<ChangeAnswer>;
54
+ /** For tests: closes every watcher now. */
55
+ close: () => void;
56
+ };
57
+ export {};
@@ -0,0 +1,178 @@
1
+ // The Panel's change feed (spec §3.45, ADR-0084): while a page asks, watch the files Quota lands in and count their
2
+ // changes, so the page reads the state within about a second instead of at its next 20-second round. Events only bump
3
+ // a counter: no watched file is ever read here.
4
+ import { statSync, watch } from 'node:fs';
5
+ import { join } from 'node:path';
6
+ /** How long after the first event a change counts: an atomic write (temporary file, then rename) counts once. */
7
+ export const GATHER_MS = 300;
8
+ /** How long a request with nothing new is held. */
9
+ export const HOLD_MS = 25_000;
10
+ /** Watchers close this long after the last request: the page asks again at once, so only a gone page is this quiet. */
11
+ export const IDLE_MS = 40_000;
12
+ /** How often the folders are listed again while a page asks (a new Account, a folder made since). */
13
+ const RESCAN_MS = 60_000;
14
+ /** With several sessions open the status line rewrites its cache on every reply; each change rereads every Account. */
15
+ const QUOTA_GAP_MS = 5000;
16
+ /** sideby's own churn under `<state>/quota`: ask locks, the folder `claude -p /usage` runs in, Limit Reset records. */
17
+ const OWN = new Set(['asking', 'claude-run', 'limit-reset']);
18
+ /** `<state>/quota`: the status line cache and the kept answers of each Host's own CLI. */
19
+ export function stateQuotaDir(stateDir) {
20
+ return {
21
+ dir: join(stateDir, 'quota'),
22
+ recursive: true,
23
+ match: {
24
+ test: (name) => {
25
+ const parts = name.split(/[\\/]/);
26
+ const base = parts[parts.length - 1] ?? '';
27
+ return base.endsWith('.json') && !base.startsWith('.') && !OWN.has(parts[0] ?? '');
28
+ },
29
+ },
30
+ gapMs: QUOTA_GAP_MS,
31
+ };
32
+ }
33
+ const realTimers = {
34
+ now: () => Date.now(),
35
+ set: (fn, ms) => setTimeout(fn, ms).unref(),
36
+ clear: (t) => clearTimeout(t),
37
+ };
38
+ /**
39
+ * Turns events into counted changes: one `GATHER_MS` after the first event, and never sooner than `gapMs` (the
40
+ * event's folder) after the last one. Events meanwhile join that change; one whose folder allows an earlier time
41
+ * brings it forward.
42
+ */
43
+ export function changeClock(fire, timers = realTimers) {
44
+ let last = Number.NEGATIVE_INFINITY;
45
+ let due = null;
46
+ let timer;
47
+ return {
48
+ poke(gapMs) {
49
+ const at = timers.now();
50
+ const want = Math.max(at + GATHER_MS, last + gapMs);
51
+ if (due !== null && due <= want)
52
+ return;
53
+ if (due !== null)
54
+ timers.clear(timer);
55
+ due = want;
56
+ timer = timers.set(() => {
57
+ due = null;
58
+ last = timers.now();
59
+ fire();
60
+ }, want - at);
61
+ },
62
+ stop() {
63
+ if (due !== null)
64
+ timers.clear(timer);
65
+ due = null;
66
+ },
67
+ };
68
+ }
69
+ const isDir = (p) => {
70
+ try {
71
+ return statSync(p).isDirectory();
72
+ }
73
+ catch {
74
+ return false;
75
+ }
76
+ };
77
+ /**
78
+ * The feed of one Panel. `dirs` lists what to watch; `onChange` runs once per counted change, before held requests
79
+ * are answered.
80
+ */
81
+ export function createChangeFeed(opts) {
82
+ let seq = 0;
83
+ const waiters = new Set();
84
+ const watchers = new Map();
85
+ let lastAsk = 0;
86
+ let lastScan = 0;
87
+ let scanning = null;
88
+ let idle;
89
+ const clock = changeClock(() => {
90
+ seq++;
91
+ opts.onChange?.();
92
+ for (const done of [...waiters])
93
+ done();
94
+ });
95
+ function closeAll() {
96
+ for (const w of watchers.values())
97
+ w.close();
98
+ watchers.clear();
99
+ clock.stop();
100
+ lastScan = 0;
101
+ if (idle)
102
+ clearInterval(idle);
103
+ idle = undefined;
104
+ }
105
+ async function scan() {
106
+ lastScan = Date.now();
107
+ const dirs = await opts.dirs().catch(() => []);
108
+ const want = new Map(dirs.map((d) => [`${d.recursive ? 'r' : 'f'}\0${d.dir}`, d]));
109
+ for (const [key, w] of watchers)
110
+ if (!want.has(key)) {
111
+ w.close();
112
+ watchers.delete(key);
113
+ }
114
+ for (const [key, d] of want) {
115
+ if (watchers.has(key) || !isDir(d.dir))
116
+ continue;
117
+ // A platform without recursive watching, or a folder that cannot be watched, is left out: the page polls.
118
+ try {
119
+ const w = watch(d.dir, { recursive: d.recursive, persistent: false }, (_event, name) => {
120
+ if (name === null || d.match.test(String(name)))
121
+ clock.poke(d.gapMs);
122
+ });
123
+ // Unhandled, a watcher's error would end the process (a Portal's worker with it).
124
+ w.on('error', () => {
125
+ w.close();
126
+ if (watchers.get(key) === w)
127
+ watchers.delete(key);
128
+ });
129
+ watchers.set(key, w);
130
+ }
131
+ catch { }
132
+ }
133
+ }
134
+ async function ensure() {
135
+ if (!idle) {
136
+ idle = setInterval(() => {
137
+ if (!waiters.size && Date.now() - lastAsk > IDLE_MS)
138
+ closeAll();
139
+ }, 10_000).unref();
140
+ }
141
+ if (!scanning && (!lastScan || Date.now() - lastScan > RESCAN_MS))
142
+ scanning = scan().finally(() => {
143
+ scanning = null;
144
+ });
145
+ if (scanning)
146
+ await scanning;
147
+ }
148
+ return {
149
+ /**
150
+ * The answer for a page that last saw `since` (null: none yet). Held up to `HOLD_MS` while nothing changed, or
151
+ * until `gone` settles (the request closed).
152
+ */
153
+ async wait(since, gone) {
154
+ lastAsk = Date.now();
155
+ await ensure();
156
+ const now = () => ({
157
+ seq,
158
+ changed: since !== null && since !== seq,
159
+ watching: watchers.size > 0,
160
+ });
161
+ if (since === null || since !== seq || !watchers.size)
162
+ return now();
163
+ return new Promise((resolve) => {
164
+ const done = () => {
165
+ clearTimeout(timer);
166
+ waiters.delete(done);
167
+ lastAsk = Date.now();
168
+ resolve(now());
169
+ };
170
+ const timer = setTimeout(done, HOLD_MS).unref();
171
+ waiters.add(done);
172
+ void gone.then(done, done);
173
+ });
174
+ },
175
+ /** For tests: closes every watcher now. */
176
+ close: closeAll,
177
+ };
178
+ }
@@ -152,6 +152,10 @@ export type PanelAccount = (AccountStatus | (Account & Partial<AccountStatus>))
152
152
  modelInfo?: Omit<AccountModel, 'ref' | 'family'>;
153
153
  /** Its reads take longer than the state waits (`readBudget`); they go on, and a later state carries them. */
154
154
  pending?: true;
155
+ /** Its usage is still being read (the rest is current); a later state carries it. */
156
+ usagePending?: true;
157
+ /** The last complete state, shown while a new read of the Account takes longer than the state waits. */
158
+ refreshing?: true;
155
159
  };
156
160
  export type { DoctorHistory };
157
161
  /** Counts of failing and warning Findings per checked Account, from the Doctor history. */
@@ -283,6 +287,11 @@ export interface PanelState {
283
287
  * limit (a Last Resort), `unknown` when it has no Quota data and the accounts with data are full.
284
288
  */
285
289
  handoffReason?: Record<string, 'expiring' | 'room' | 'tight' | 'unknown'>;
290
+ /**
291
+ * Family → the "Best to use now" card's pick (spec §3.45): the same plan as `handoff`, also for a Family with one
292
+ * login, and when the running sessions are not known in time (ranked as if none ran).
293
+ */
294
+ pickNow?: Record<string, PickNow>;
286
295
  /** Auto Handoff settings (spec §3.17) and the Families that can start one; readiness comes from /api/handoff/status. */
287
296
  autoHandoff: {
288
297
  settings: HandoffSettings;
@@ -403,6 +412,24 @@ export declare function autostartView(s: AutostartStatus, home: string): {
403
412
  missing?: string[] | undefined;
404
413
  loaded?: boolean | undefined;
405
414
  };
415
+ /** One Family's "Best to use now" (spec §3.45). */
416
+ export interface PickNow {
417
+ /** The Account `sideby next` would pick; null when none can be started now. */
418
+ pick: string | null;
419
+ /** Whether any Account of the Family has Quota data; without any there is no pick. */
420
+ hasQuota: boolean;
421
+ /** Why the pick goes first, as `handoffReason`. */
422
+ reason?: 'expiring' | 'room' | 'tight' | 'unknown';
423
+ /** The Live Sessions of the pick's login, Pick Records included, when any. */
424
+ running?: number;
425
+ /** Why there is no pick: no Quota data, every signed-in Account has a window used up, or none is signed in. */
426
+ why?: 'no-quota' | 'used-up' | 'signed-out';
427
+ /** With `used-up`: the Account that comes back first. */
428
+ earliestReset?: {
429
+ ref: string;
430
+ at: string;
431
+ };
432
+ }
406
433
  /** The Live Sessions and Pick Records a pick counts (ADR-0083). */
407
434
  export interface PickLoad {
408
435
  live: ReadonlyMap<string, number>;
@@ -412,6 +439,17 @@ export interface PickLoad {
412
439
  export declare function handoffByFamily(rt: Runtime, accounts: readonly PanelAccount[], now: Date, load?: PickLoad): Record<string, string>;
413
440
  /** The plan behind each pick of `handoffByFamily`, spread by Room per Session when `load` is given (ADR-0083). */
414
441
  export declare function handoffPlans(rt: Runtime, accounts: readonly PanelAccount[], now: Date, load?: PickLoad): Record<string, HandoffPlan>;
442
+ /**
443
+ * `sideby next`'s plan for every Family with a Quota source and a signed-in or unknown Subscription Account read
444
+ * already, with how many logins it has: the Next pick takes those with two or more, the "Best to use now" card
445
+ * (spec §3.45) every one.
446
+ */
447
+ export declare function familyPlans(rt: Runtime, accounts: readonly PanelAccount[], now: Date, load?: PickLoad): Record<string, {
448
+ plan: HandoffPlan;
449
+ logins: number;
450
+ }>;
451
+ /** The "Best to use now" card's entry of a Family's plan (spec §3.45). */
452
+ export declare function pickNowOf(plan: HandoffPlan): PickNow;
415
453
  export type RemoteControlView = Omit<RemoteControlGroup, 'file'> & {
416
454
  file: string;
417
455
  };