sideby 0.28.3 → 0.30.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 +1 -1
- package/dist/src/cli/commands.d.ts +12 -0
- package/dist/src/cli/commands.js +337 -13
- package/dist/src/cli/json-schemas.js +87 -1
- package/dist/src/cli/main.js +65 -4
- package/dist/src/core/config.d.ts +25 -0
- package/dist/src/core/config.js +34 -0
- package/dist/src/core/fs-safe.d.ts +22 -1
- package/dist/src/core/fs-safe.js +68 -1
- package/dist/src/core/handoff-run.d.ts +2 -0
- package/dist/src/core/handoff-run.js +12 -6
- package/dist/src/core/launch.d.ts +6 -1
- package/dist/src/core/live-sessions.d.ts +2 -0
- package/dist/src/core/messages.d.ts +2 -0
- package/dist/src/core/messages.js +12 -34
- package/dist/src/core/network.d.ts +5 -2
- package/dist/src/core/network.js +15 -45
- package/dist/src/core/run-link.d.ts +6 -1
- package/dist/src/core/run-link.js +62 -22
- package/dist/src/core/search-catalog.d.ts +1 -1
- package/dist/src/core/search-catalog.js +37 -0
- package/dist/src/core/session-handoffs.d.ts +22 -0
- package/dist/src/core/session-handoffs.js +110 -0
- package/dist/src/core/session-hooks.d.ts +33 -0
- package/dist/src/core/session-hooks.js +92 -0
- package/dist/src/core/session-select.d.ts +18 -3
- package/dist/src/core/session-select.js +82 -8
- package/dist/src/core/unattended-ended.d.ts +62 -0
- package/dist/src/core/unattended-ended.js +275 -0
- package/dist/src/core/unattended-pending.d.ts +56 -0
- package/dist/src/core/unattended-pending.js +182 -0
- package/dist/src/core/unattended-state.d.ts +129 -0
- package/dist/src/core/unattended-state.js +373 -0
- package/dist/src/core/unattended.d.ts +142 -0
- package/dist/src/core/unattended.js +349 -0
- package/dist/src/panel/background.js +8 -0
- package/dist/src/panel/handler.d.ts +37 -0
- package/dist/src/panel/handler.js +156 -2
- package/dist/src/panel/i18n.d.ts +97 -0
- package/dist/src/panel/i18n.js +194 -0
- package/dist/src/panel/page-logic.d.ts +129 -0
- package/dist/src/panel/page-logic.js +166 -0
- package/dist/src/panel/page-script.js +638 -7
- package/dist/src/panel/page-styles.js +69 -0
- package/dist/src/panel/page.js +2 -0
- package/dist/src/plugins/bus.js +1 -0
- package/dist/src/runtime.d.ts +17 -1
- package/dist/src/runtime.js +78 -15
- package/dist/src/types.d.ts +48 -0
- package/dist/src/unattended/hook.d.ts +46 -0
- package/dist/src/unattended/hook.js +288 -0
- package/package.json +1 -1
- package/schemas/config.json +76 -0
- package/schemas/messages.json +4 -0
- package/schemas/send.json +4 -0
- package/schemas/sessions-copy.json +4 -0
- package/schemas/sessions-open-run.json +4 -0
- package/schemas/sessions.json +7 -0
- package/schemas/unattended-defer.json +143 -0
- package/schemas/unattended-pending.json +154 -0
- package/schemas/unattended.json +291 -0
- package/skills/sideby/SKILL.md +3 -2
- package/skills/sideby/references/sessions.md +1 -1
- package/skills/sideby/references/unattended.md +58 -0
package/dist/build.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"id":"
|
|
1
|
+
{"id":"20261029T083543-3dde66"}
|
|
@@ -9,6 +9,14 @@ export interface Io {
|
|
|
9
9
|
/** The terminal Auto Handoff counts down on (spec §3.17); `process.stdin` when left out. */
|
|
10
10
|
stdin?: HandoffIo['stdin'];
|
|
11
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Takes sideby's own `--unattended` (spec §3.37) out of the arguments `run` and `resume` pass to the Host, anywhere
|
|
14
|
+
* before `--`: no Host has an option of that name.
|
|
15
|
+
*/
|
|
16
|
+
export declare function takeUnattended(args: readonly string[]): {
|
|
17
|
+
args: string[];
|
|
18
|
+
unattended: boolean;
|
|
19
|
+
};
|
|
12
20
|
/**
|
|
13
21
|
* Takes sideby's own `--ignore-network` (spec §3.35) out of the arguments `run` and `resume` pass to the Host,
|
|
14
22
|
* anywhere before `--`: no Host has an option of that name.
|
|
@@ -130,6 +138,8 @@ export declare function cmdConfig(a: ParsedArgs, io: Io): Promise<number>;
|
|
|
130
138
|
* `sideby sessions open-run <account|session-id>` opens the Run Board of one (spec §3.32 step 2b).
|
|
131
139
|
*/
|
|
132
140
|
export declare function cmdSessions(a: ParsedArgs, io: Io, runtime?: Runtime): Promise<number>;
|
|
141
|
+
/** The line that says a session id was followed along its Handoff chain (ADR-0057). */
|
|
142
|
+
export declare function handedOverLine(from: string, label: string, doing: string): string;
|
|
133
143
|
export declare function cmdHistory(a: ParsedArgs, io: Io): Promise<number>;
|
|
134
144
|
export interface SendArgs extends ParsedArgs {
|
|
135
145
|
/** Every `--image` given, in order (main.ts collects them; parseArgs keeps only the last). */
|
|
@@ -153,6 +163,8 @@ export declare function cmdTheme(a: ParsedArgs, io: Io): Promise<number>;
|
|
|
153
163
|
* `network` after a preview (exit 10 without `--yes`).
|
|
154
164
|
*/
|
|
155
165
|
export declare function cmdNetwork(a: ParsedArgs, io: Io): Promise<number>;
|
|
166
|
+
/** `sideby unattended …` (spec §3.37, ADR-0058): status, on and off, the Schedule, Pending Decisions and `defer`. */
|
|
167
|
+
export declare function cmdUnattended(a: ParsedArgs, io: Io): Promise<number>;
|
|
156
168
|
/**
|
|
157
169
|
* `sideby commands <words>` (spec §3.36, ADR-0054): the Search Catalog the Panel's Command Palette searches, read-only.
|
|
158
170
|
* Titles and places are in English, as every other command prints; the words may be English or Chinese.
|
package/dist/src/cli/commands.js
CHANGED
|
@@ -22,6 +22,7 @@ import { USAGE_DAYS } from '../core/quota-levels.js';
|
|
|
22
22
|
import { groupsToUndo, remoteControlNothingToDo, remoteControlTodo, } from '../core/remote-control.js';
|
|
23
23
|
import { SEARCH_CATALOG, searchCatalog } from '../core/search-catalog.js';
|
|
24
24
|
import { SHELLS } from '../core/shell-init.js';
|
|
25
|
+
import { clockText, daysText } from '../core/unattended-state.js';
|
|
25
26
|
import { MODEL_NAME } from '../families/shared/model-args.js';
|
|
26
27
|
import { AI_TASK_KINDS, hiddenIn, inDisplayOrder, pinnedIn, suggestAlias, suggestName, withPinned, } from '../panel/page-logic.js';
|
|
27
28
|
import { createRuntime, UnknownFamilyError } from '../runtime.js';
|
|
@@ -43,6 +44,32 @@ async function whileRunning(rt, fn) {
|
|
|
43
44
|
async function runAccount(rt, ref, args, io, opts = {}) {
|
|
44
45
|
return whileRunning(rt, () => runAccountNow(rt, ref, args, io, opts));
|
|
45
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Takes sideby's own `--unattended` (spec §3.37) out of the arguments `run` and `resume` pass to the Host, anywhere
|
|
49
|
+
* before `--`: no Host has an option of that name.
|
|
50
|
+
*/
|
|
51
|
+
export function takeUnattended(args) {
|
|
52
|
+
const end = args.indexOf('--');
|
|
53
|
+
const head = end === -1 ? args : args.slice(0, end);
|
|
54
|
+
if (!head.includes('--unattended'))
|
|
55
|
+
return { args: [...args], unattended: false };
|
|
56
|
+
return {
|
|
57
|
+
args: [...head.filter((x) => x !== '--unattended'), ...(end === -1 ? [] : args.slice(end))],
|
|
58
|
+
unattended: true,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
/** Both of sideby's own Launch options, as `run` and `resume` find them among the Host's arguments. */
|
|
62
|
+
function takeLaunchFlags(args) {
|
|
63
|
+
const net = takeIgnoreNetwork(args);
|
|
64
|
+
const un = takeUnattended(net.args);
|
|
65
|
+
return {
|
|
66
|
+
args: un.args,
|
|
67
|
+
flags: {
|
|
68
|
+
...(net.ignoreNetwork ? { ignoreNetwork: true } : {}),
|
|
69
|
+
...(un.unattended ? { unattended: true } : {}),
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
}
|
|
46
73
|
/**
|
|
47
74
|
* Takes sideby's own `--ignore-network` (spec §3.35) out of the arguments `run` and `resume` pass to the Host,
|
|
48
75
|
* anywhere before `--`: no Host has an option of that name.
|
|
@@ -501,12 +528,11 @@ export async function cmdRun(a, io, command) {
|
|
|
501
528
|
if (command === 'login' && (extra.length || a.rest.length))
|
|
502
529
|
throw new UsageError('login takes no extra arguments');
|
|
503
530
|
const rt = await createRuntime();
|
|
504
|
-
const { args,
|
|
505
|
-
const net = ignoreNetwork ? { ignoreNetwork } : {};
|
|
531
|
+
const { args, flags } = takeLaunchFlags([...extra, ...a.rest]);
|
|
506
532
|
if (command === 'run' && rt.pickCommandFamily(ref) !== undefined)
|
|
507
|
-
return runPick(rt, ref, args, io,
|
|
533
|
+
return runPick(rt, ref, args, io, flags);
|
|
508
534
|
if (command === 'run')
|
|
509
|
-
return runAccount(rt, ref, args, io,
|
|
535
|
+
return runAccount(rt, ref, args, io, flags);
|
|
510
536
|
return runLogin(rt, ref, io);
|
|
511
537
|
}
|
|
512
538
|
/** Who an Account is signed in as, for `runLogin`; identity fields and Same Login peers only, never a credential. */
|
|
@@ -570,8 +596,8 @@ export async function cmdResume(a, io) {
|
|
|
570
596
|
if (!family)
|
|
571
597
|
throw new UsageError('usage: sideby resume <family> [-- host args]');
|
|
572
598
|
const rt = await createRuntime();
|
|
573
|
-
const { args,
|
|
574
|
-
const route = await rt.resumeLaunch(family, args,
|
|
599
|
+
const { args, flags } = takeLaunchFlags([...extra, ...a.rest]);
|
|
600
|
+
const route = await rt.resumeLaunch(family, args, flags);
|
|
575
601
|
if (route.launch.notice)
|
|
576
602
|
io.err(c.cyan(route.launch.notice));
|
|
577
603
|
if (route.newSession)
|
|
@@ -588,7 +614,7 @@ function shellQuote(arg) {
|
|
|
588
614
|
export async function cmdNext(a, io) {
|
|
589
615
|
const [family, ...extra] = a.positionals;
|
|
590
616
|
if (!family || extra.length)
|
|
591
|
-
throw new UsageError('usage: sideby next <family> [--dry-run] [--include-api] [--ignore-network] [-- host args]');
|
|
617
|
+
throw new UsageError('usage: sideby next <family> [--dry-run] [--include-api] [--ignore-network] [--unattended] [-- host args]');
|
|
592
618
|
const includeApi = a.flags.has('include-api');
|
|
593
619
|
const rt = await createRuntime();
|
|
594
620
|
const plan = await rt.handoff(family, { includeApi });
|
|
@@ -654,7 +680,10 @@ export async function cmdNext(a, io) {
|
|
|
654
680
|
io.out(c.dim('Tip: ask your old session for a short handoff note and paste it into the new one.'));
|
|
655
681
|
if (!rt.handoffSettings().auto)
|
|
656
682
|
io.out(c.dim('Sessions can also hand over by themselves when quota runs low: see `sideby handoff status`.'));
|
|
657
|
-
return runAccount(rt, plan.pick, a.rest, io,
|
|
683
|
+
return runAccount(rt, plan.pick, a.rest, io, {
|
|
684
|
+
...(a.flags.has('ignore-network') ? { ignoreNetwork: true } : {}),
|
|
685
|
+
...(a.flags.has('unattended') ? { unattended: true } : {}),
|
|
686
|
+
});
|
|
658
687
|
}
|
|
659
688
|
export async function cmdDoctor(a, io) {
|
|
660
689
|
const rt = await createRuntime();
|
|
@@ -1571,8 +1600,15 @@ export async function cmdUi(a, io) {
|
|
|
1571
1600
|
if (srv.reused)
|
|
1572
1601
|
return 0;
|
|
1573
1602
|
io.out(c.dim('Ctrl+C to stop'));
|
|
1603
|
+
// Like the background Panel, a Panel left running notices the end of a stretch of Unattended Mode (spec §3.37).
|
|
1604
|
+
const { watchUnattendedEnded } = await import('../core/unattended-ended.js');
|
|
1605
|
+
const stopWatch = watchUnattendedEnded(paths, async (ctx) => {
|
|
1606
|
+
for (const f of await (await createRuntime()).unattendedEnded(ctx))
|
|
1607
|
+
io.err(`sideby: [${f.plugin}] unattended.ended failed: ${f.error}`);
|
|
1608
|
+
});
|
|
1574
1609
|
await new Promise((resolve) => {
|
|
1575
1610
|
const stop = () => {
|
|
1611
|
+
stopWatch();
|
|
1576
1612
|
void srv.close().then(resolve);
|
|
1577
1613
|
};
|
|
1578
1614
|
process.once('SIGINT', stop);
|
|
@@ -2991,8 +3027,11 @@ export async function cmdSessions(a, io, runtime) {
|
|
|
2991
3027
|
const rt = runtime ?? (await createRuntime());
|
|
2992
3028
|
const { listLiveSessions, sessionLabel } = await import('../core/live-sessions.js');
|
|
2993
3029
|
const { withRuns } = await import('../core/run-link.js');
|
|
3030
|
+
const { readHandoffChains, withHandoffs } = await import('../core/session-handoffs.js');
|
|
2994
3031
|
const r = await listLiveSessions(rt, first ? { only: first } : {});
|
|
2995
|
-
|
|
3032
|
+
// Where an Auto Handoff chain led to a Session, its earlier ids; the Run Link falls back to them (ADR-0057).
|
|
3033
|
+
const handed = withHandoffs(await readHandoffChains(rt.paths.stateDir), r.sessions);
|
|
3034
|
+
const sessions = await withRuns(rt.env, rt.paths.home, handed);
|
|
2996
3035
|
if (a.flags.has('json')) {
|
|
2997
3036
|
json(io, { sessions, problems: r.problems });
|
|
2998
3037
|
return 0;
|
|
@@ -3034,6 +3073,10 @@ export async function cmdSessions(a, io, runtime) {
|
|
|
3034
3073
|
io.out(c.dim('Copy one for another AI: sideby sessions copy <account|session-id>'));
|
|
3035
3074
|
return 0;
|
|
3036
3075
|
}
|
|
3076
|
+
/** The line that says a session id was followed along its Handoff chain (ADR-0057). */
|
|
3077
|
+
export function handedOverLine(from, label, doing) {
|
|
3078
|
+
return c.dim(`${from.slice(0, 8)} was handed over to ${label}; ${doing}`);
|
|
3079
|
+
}
|
|
3037
3080
|
/** Prints the listing's problems to stderr unless the output is JSON. */
|
|
3038
3081
|
const listedProblems = (a, io) => (l) => {
|
|
3039
3082
|
if (!a.flags.has('json'))
|
|
@@ -3047,7 +3090,7 @@ async function sessionsOpenRun(a, args, io, runtime) {
|
|
|
3047
3090
|
const rt = runtime ?? (await createRuntime());
|
|
3048
3091
|
const { selectSession } = await import('../core/session-select.js');
|
|
3049
3092
|
const { openRunBoard } = await import('../core/run-link.js');
|
|
3050
|
-
const { session: s } = await selectSession(rt, target, {
|
|
3093
|
+
const { session: s, handedOverFrom } = await selectSession(rt, target, {
|
|
3051
3094
|
next: { verb: 'open the run report of', command: (id) => `sideby sessions open-run ${id}` },
|
|
3052
3095
|
onListed: listedProblems(a, io),
|
|
3053
3096
|
});
|
|
@@ -3055,9 +3098,17 @@ async function sessionsOpenRun(a, args, io, runtime) {
|
|
|
3055
3098
|
const r = await openRunBoard(rt, s.sessionId);
|
|
3056
3099
|
const board = tildify(r.board, rt.paths.home);
|
|
3057
3100
|
if (a.flags.has('json')) {
|
|
3058
|
-
json(io, {
|
|
3101
|
+
json(io, {
|
|
3102
|
+
opened: true,
|
|
3103
|
+
board,
|
|
3104
|
+
sessionId: s.sessionId,
|
|
3105
|
+
label: s.label,
|
|
3106
|
+
...(handedOverFrom ? { handedOverFrom } : {}),
|
|
3107
|
+
});
|
|
3059
3108
|
return 0;
|
|
3060
3109
|
}
|
|
3110
|
+
if (handedOverFrom)
|
|
3111
|
+
io.out(handedOverLine(handedOverFrom, s.label, 'opening its run report'));
|
|
3061
3112
|
io.out(`${c.green('✓')} opened the run report of ${c.bold(s.label)}`);
|
|
3062
3113
|
io.out(c.dim(` ${board}`));
|
|
3063
3114
|
return 0;
|
|
@@ -3074,13 +3125,22 @@ async function sessionsCopy(a, args, io, runtime) {
|
|
|
3074
3125
|
const { sessionCopyText } = await import('../core/live-sessions.js');
|
|
3075
3126
|
const { copyToClipboard } = await import('../core/live-sessions-copy.js');
|
|
3076
3127
|
const { selectSession } = await import('../core/session-select.js');
|
|
3077
|
-
const { session: s } = await selectSession(rt, target, { onListed: listedProblems(a, io) });
|
|
3128
|
+
const { session: s, handedOverFrom } = await selectSession(rt, target, { onListed: listedProblems(a, io) });
|
|
3078
3129
|
const text = sessionCopyText(s, as, lang);
|
|
3079
3130
|
const program = await copyToClipboard(text, rt.env);
|
|
3080
3131
|
if (a.flags.has('json')) {
|
|
3081
|
-
json(io, {
|
|
3132
|
+
json(io, {
|
|
3133
|
+
copied: program !== null,
|
|
3134
|
+
as,
|
|
3135
|
+
text,
|
|
3136
|
+
sessionId: s.sessionId,
|
|
3137
|
+
label: s.label,
|
|
3138
|
+
...(handedOverFrom ? { handedOverFrom } : {}),
|
|
3139
|
+
});
|
|
3082
3140
|
return 0;
|
|
3083
3141
|
}
|
|
3142
|
+
if (handedOverFrom)
|
|
3143
|
+
io.out(handedOverLine(handedOverFrom, s.label, 'copying that one'));
|
|
3084
3144
|
const what = as === 'reference' ? 'a reference to' : as === 'id' ? 'the id of' : 'the resume command of';
|
|
3085
3145
|
if (program) {
|
|
3086
3146
|
io.out(`${c.green('✓')} copied ${what} ${c.bold(s.label)}; paste it into the other AI`);
|
|
@@ -3443,6 +3503,8 @@ export async function cmdSend(a, io) {
|
|
|
3443
3503
|
return 0;
|
|
3444
3504
|
}
|
|
3445
3505
|
const home = rt.paths.home;
|
|
3506
|
+
if (r.handedOverFrom)
|
|
3507
|
+
io.out(handedOverLine(r.handedOverFrom, r.to, 'sending there'));
|
|
3446
3508
|
if (r.status === 'delivered') {
|
|
3447
3509
|
io.out(`${c.green('✓')} delivered to ${c.bold(r.to)} (message ${r.id})`);
|
|
3448
3510
|
if (r.note)
|
|
@@ -3906,6 +3968,268 @@ export async function cmdNetwork(a, io) {
|
|
|
3906
3968
|
io.out(c.dim('Sessions started without sideby (running `claude` or `codex` directly) are not checked.'));
|
|
3907
3969
|
return 0;
|
|
3908
3970
|
}
|
|
3971
|
+
/** The family a `defer` from inside a session comes from: its Account, else the Host's own variables. */
|
|
3972
|
+
function deferFamily(env) {
|
|
3973
|
+
const ref = env.SIDEBY_ACCOUNT;
|
|
3974
|
+
if (ref?.includes(':'))
|
|
3975
|
+
return ref.slice(0, ref.indexOf(':'));
|
|
3976
|
+
if (env.CLAUDE_CODE_SESSION_ID || env.CLAUDECODE)
|
|
3977
|
+
return 'claude';
|
|
3978
|
+
if (env.CODEX_THREAD_ID)
|
|
3979
|
+
return 'codex';
|
|
3980
|
+
return 'unknown';
|
|
3981
|
+
}
|
|
3982
|
+
/** One line for where Unattended Mode stands now. */
|
|
3983
|
+
function unattendedLine(s, now) {
|
|
3984
|
+
const at = (iso) => clock2(iso, now);
|
|
3985
|
+
const slot = s.slot ? ` · Slot "${s.slot}"` : '';
|
|
3986
|
+
if (s.reason === 'slot' || s.reason === 'manual')
|
|
3987
|
+
return `${c.green('on')}${s.reason === 'manual' ? ' · turned on by hand' : slot}${s.until ? ` · until ${at(s.until)}` : ' · no end: the Schedule covers every hour'}`;
|
|
3988
|
+
if (s.reason === 'session')
|
|
3989
|
+
return `${c.green('on')} for this session only (started with --unattended)`;
|
|
3990
|
+
if (s.reason === 'paused')
|
|
3991
|
+
return `${c.yellow('paused')}${slot}${s.until ? ` · until ${at(s.until)}, then the Schedule goes on` : ' · until you turn it on (`sideby unattended on`)'}`;
|
|
3992
|
+
return `${c.dim('off')}${s.next ? ` · next ${at(s.next.at)}${s.next.slot ? ` (${s.next.slot})` : ''}` : ''}`;
|
|
3993
|
+
}
|
|
3994
|
+
const clock2 = (iso, now) => clockText(Date.parse(iso), now.getTime());
|
|
3995
|
+
function printSchedule(io, schedule) {
|
|
3996
|
+
if (!schedule.length) {
|
|
3997
|
+
io.out(c.dim('Schedule: empty. Add weeknights 23:00-08:00 with `sideby unattended schedule preset weeknights`.'));
|
|
3998
|
+
return;
|
|
3999
|
+
}
|
|
4000
|
+
io.out('Schedule:');
|
|
4001
|
+
schedule.forEach((s, i) => {
|
|
4002
|
+
const night = s.end <= s.start ? (s.end === s.start ? ' (whole day)' : ' (next day)') : '';
|
|
4003
|
+
io.out(` ${i + 1}. ${s.name ? `${s.name} ` : ''}${daysText(s.days)} ${s.start}-${s.end}${night}`);
|
|
4004
|
+
});
|
|
4005
|
+
}
|
|
4006
|
+
function printUnattended(io, s, now, opts = {}) {
|
|
4007
|
+
io.out(`Unattended Mode: ${unattendedLine(s, now)}`);
|
|
4008
|
+
if (s.problem)
|
|
4009
|
+
io.out(c.red(s.problem));
|
|
4010
|
+
if (opts.schedule !== false)
|
|
4011
|
+
printSchedule(io, s.schedule);
|
|
4012
|
+
if (s.pending)
|
|
4013
|
+
io.out(`Pending decisions: ${c.yellow(String(s.pending))} open; see them with \`sideby unattended pending\`.`);
|
|
4014
|
+
if (!s.configured)
|
|
4015
|
+
io.out(c.cyan('Not set up yet: `sideby unattended on` or `sideby unattended schedule preset weeknights` sets it up, and Claude and Codex sessions sideby starts after that are covered.'));
|
|
4016
|
+
else
|
|
4017
|
+
io.out(c.dim('Covers Claude sessions sideby starts (questions and permission prompts), and questions in Codex sessions once you trust `unattended-hook` in /hooks; Codex approval prompts still wait. Not Grok, pi, desktop apps or sessions started without sideby.'));
|
|
4018
|
+
}
|
|
4019
|
+
/** `sideby unattended …` (spec §3.37, ADR-0058): status, on and off, the Schedule, Pending Decisions and `defer`. */
|
|
4020
|
+
export async function cmdUnattended(a, io) {
|
|
4021
|
+
const [sub, ...rest] = a.positionals;
|
|
4022
|
+
const asJson = a.flags.has('json');
|
|
4023
|
+
const allow = (...names) => {
|
|
4024
|
+
for (const k of a.flags.keys())
|
|
4025
|
+
if (k !== 'json' && !names.includes(k))
|
|
4026
|
+
throw new UsageError(`--${k} does not go with \`sideby unattended ${sub ?? ''}\`; run \`sideby unattended --help\``);
|
|
4027
|
+
if (a.rest.length)
|
|
4028
|
+
throw new UsageError('`sideby unattended` takes no arguments after `--`');
|
|
4029
|
+
};
|
|
4030
|
+
const u = await import('../core/unattended.js');
|
|
4031
|
+
const rt = await createRuntime();
|
|
4032
|
+
const families = [...rt.families.keys()];
|
|
4033
|
+
const paths = rt.paths;
|
|
4034
|
+
const now = () => rt.readContext().now;
|
|
4035
|
+
const { checkUnattendedEnded } = await import('../core/unattended-ended.js');
|
|
4036
|
+
// Turning it off or on may end a stretch: notice it now, not at the next command (spec §3.37).
|
|
4037
|
+
const noticeEnd = () => checkUnattendedEnded(paths, async (ctx) => void (await rt.unattendedEnded(ctx)));
|
|
4038
|
+
const show = (change, done) => {
|
|
4039
|
+
if (asJson) {
|
|
4040
|
+
json(io, { ...change.status, changed: change.changed, ...(change.undo ? { undo: change.undo } : {}) });
|
|
4041
|
+
return 0;
|
|
4042
|
+
}
|
|
4043
|
+
io.out(change.changed ? `${c.green('✓')} ${done}` : done);
|
|
4044
|
+
printUnattended(io, change.status, now());
|
|
4045
|
+
if (change.undo)
|
|
4046
|
+
io.out(c.dim(`Undo: ${change.undo}`));
|
|
4047
|
+
return 0;
|
|
4048
|
+
};
|
|
4049
|
+
if (sub === undefined || sub === 'status') {
|
|
4050
|
+
allow();
|
|
4051
|
+
if (rest.length)
|
|
4052
|
+
throw new UsageError('usage: sideby unattended [status] [--json]');
|
|
4053
|
+
const s = await rt.unattendedStatus();
|
|
4054
|
+
if (asJson)
|
|
4055
|
+
json(io, s);
|
|
4056
|
+
else
|
|
4057
|
+
printUnattended(io, s, now());
|
|
4058
|
+
return 0;
|
|
4059
|
+
}
|
|
4060
|
+
if (sub === 'on') {
|
|
4061
|
+
allow('for', 'until', 'slot-end');
|
|
4062
|
+
if (rest.length)
|
|
4063
|
+
throw new UsageError('usage: sideby unattended on [--for <n>h|<n>m | --until <HH:MM|date and time> | --slot-end]');
|
|
4064
|
+
const status = await rt.unattendedStatus();
|
|
4065
|
+
const value = (k) => {
|
|
4066
|
+
const v = a.flags.get(k);
|
|
4067
|
+
return typeof v === 'string' ? v : undefined;
|
|
4068
|
+
};
|
|
4069
|
+
const r = u.onUntil({
|
|
4070
|
+
...(a.flags.has('for') ? { for: value('for') ?? '' } : {}),
|
|
4071
|
+
...(a.flags.has('until') ? { until: value('until') ?? '' } : {}),
|
|
4072
|
+
...(a.flags.has('slot-end') ? { slotEnd: true } : {}),
|
|
4073
|
+
}, status.schedule, now());
|
|
4074
|
+
if ('error' in r)
|
|
4075
|
+
throw new UsageError(r.error);
|
|
4076
|
+
const change = await u.turnUnattendedOn({ paths, families, until: r.until, now: now() });
|
|
4077
|
+
await noticeEnd();
|
|
4078
|
+
return show(change, `Unattended Mode is on until ${clock2(new Date(r.until).toISOString(), now())}.`);
|
|
4079
|
+
}
|
|
4080
|
+
if (sub === 'off') {
|
|
4081
|
+
allow();
|
|
4082
|
+
if (rest.length)
|
|
4083
|
+
throw new UsageError('usage: sideby unattended off [--json]');
|
|
4084
|
+
const change = await u.turnUnattendedOff({ paths, families, now: now() });
|
|
4085
|
+
await noticeEnd();
|
|
4086
|
+
const s = change.status;
|
|
4087
|
+
return show(change, !change.changed
|
|
4088
|
+
? s.reason === 'paused'
|
|
4089
|
+
? s.until
|
|
4090
|
+
? 'Unattended Mode is already paused until this Slot ends.'
|
|
4091
|
+
: 'Unattended Mode is already paused until you turn it on.'
|
|
4092
|
+
: s.reason === 'session'
|
|
4093
|
+
? 'Unattended Mode is off for the computer; this session was started with --unattended and stays on.'
|
|
4094
|
+
: 'Unattended Mode is already off.'
|
|
4095
|
+
: s.reason === 'paused'
|
|
4096
|
+
? s.until
|
|
4097
|
+
? 'Unattended Mode is paused until this Slot ends; the next Slot turns it on as usual.'
|
|
4098
|
+
: 'Unattended Mode is paused until you turn it on: your Schedule covers every hour, so it has no end.'
|
|
4099
|
+
: 'Unattended Mode is off.');
|
|
4100
|
+
}
|
|
4101
|
+
if (sub === 'schedule') {
|
|
4102
|
+
const [action, ...args] = rest;
|
|
4103
|
+
if (action === undefined) {
|
|
4104
|
+
allow();
|
|
4105
|
+
const s = await rt.unattendedStatus();
|
|
4106
|
+
if (asJson)
|
|
4107
|
+
json(io, s);
|
|
4108
|
+
else
|
|
4109
|
+
printSchedule(io, s.schedule);
|
|
4110
|
+
return 0;
|
|
4111
|
+
}
|
|
4112
|
+
if (action === 'add') {
|
|
4113
|
+
allow('days', 'from', 'to', 'name', 'at');
|
|
4114
|
+
if (args.length)
|
|
4115
|
+
throw new UsageError('usage: sideby unattended schedule add --days <mon-fri|sat,sun|…> --from HH:MM --to HH:MM [--name <name>]');
|
|
4116
|
+
const get = (k) => {
|
|
4117
|
+
const v = a.flags.get(k);
|
|
4118
|
+
return typeof v === 'string' ? v : undefined;
|
|
4119
|
+
};
|
|
4120
|
+
const slot = u.slotFromOptions({
|
|
4121
|
+
...(get('days') !== undefined ? { days: get('days') } : {}),
|
|
4122
|
+
...(get('from') !== undefined ? { from: get('from') } : {}),
|
|
4123
|
+
...(get('to') !== undefined ? { to: get('to') } : {}),
|
|
4124
|
+
...(get('name') !== undefined ? { name: get('name') } : {}),
|
|
4125
|
+
});
|
|
4126
|
+
if ('error' in slot)
|
|
4127
|
+
throw new UsageError(slot.error);
|
|
4128
|
+
const at = get('at');
|
|
4129
|
+
if (at !== undefined && !/^[1-9]\d{0,2}$/.test(at))
|
|
4130
|
+
throw new UsageError('--at takes a position such as 1 (the first Slot); leave it out to add at the end');
|
|
4131
|
+
const change = await u.addUnattendedSlot({ paths, families, slot, ...(at ? { at: Number(at) } : {}) });
|
|
4132
|
+
await noticeEnd();
|
|
4133
|
+
return show(change, change.changed ? 'Added the Slot.' : 'That Slot is already in the Schedule.');
|
|
4134
|
+
}
|
|
4135
|
+
if (action === 'remove') {
|
|
4136
|
+
allow();
|
|
4137
|
+
const n = args[0];
|
|
4138
|
+
if (args.length !== 1 || !n || !/^[1-9]\d{0,2}$/.test(n))
|
|
4139
|
+
throw new UsageError('usage: sideby unattended schedule remove <number>, the number `sideby unattended` shows (1 is the first)');
|
|
4140
|
+
const change = await u.removeUnattendedSlot({ paths, families, n: Number(n) });
|
|
4141
|
+
await noticeEnd();
|
|
4142
|
+
return show(change, `Removed Slot ${n}.`);
|
|
4143
|
+
}
|
|
4144
|
+
if (action === 'preset') {
|
|
4145
|
+
allow();
|
|
4146
|
+
const preset = args[0] ? u.UNATTENDED_PRESETS[args[0]] : undefined;
|
|
4147
|
+
if (args.length !== 1 || !preset)
|
|
4148
|
+
throw new UsageError(`usage: sideby unattended schedule preset weeknights (Monday to Friday, 23:00 to 08:00)`);
|
|
4149
|
+
const change = await u.addUnattendedSlot({ paths, families, slot: preset });
|
|
4150
|
+
await noticeEnd();
|
|
4151
|
+
return show(change, change.changed
|
|
4152
|
+
? `Added ${preset.name}: ${daysText(preset.days)} ${preset.start}-${preset.end}.`
|
|
4153
|
+
: `${preset.name} is already in the Schedule.`);
|
|
4154
|
+
}
|
|
4155
|
+
throw new UsageError('usage: sideby unattended schedule [add --days … --from … --to … [--name …] | remove <number> | preset weeknights]');
|
|
4156
|
+
}
|
|
4157
|
+
if (sub === 'pending') {
|
|
4158
|
+
const { listPendingDecisions, markPendingDone } = await import('../core/unattended-pending.js');
|
|
4159
|
+
const [action, ...args] = rest;
|
|
4160
|
+
if (action === 'done') {
|
|
4161
|
+
allow('all');
|
|
4162
|
+
const all = a.flags.has('all');
|
|
4163
|
+
if (all === Boolean(args.length) || args.length > 1)
|
|
4164
|
+
throw new UsageError('usage: sideby unattended pending done <id> | --all (the id is in `sideby unattended pending`)');
|
|
4165
|
+
let done;
|
|
4166
|
+
try {
|
|
4167
|
+
done = await markPendingDone(paths.stateDir, all ? 'all' : args[0], now());
|
|
4168
|
+
}
|
|
4169
|
+
catch (err) {
|
|
4170
|
+
throw new UserError(err.message, { code: 'no-pending' });
|
|
4171
|
+
}
|
|
4172
|
+
const pending = await listPendingDecisions(paths.stateDir, { now: now() });
|
|
4173
|
+
if (asJson)
|
|
4174
|
+
json(io, { done: done.map((d) => d.id), pending });
|
|
4175
|
+
else
|
|
4176
|
+
io.out(`${c.green('✓')} marked ${done.length === 1 ? '1 decision' : `${done.length} decisions`} done; ${pending.length} still open.`);
|
|
4177
|
+
return 0;
|
|
4178
|
+
}
|
|
4179
|
+
allow('all');
|
|
4180
|
+
if (action !== undefined)
|
|
4181
|
+
throw new UsageError('usage: sideby unattended pending [--all] | pending done <id>|--all');
|
|
4182
|
+
const pending = await listPendingDecisions(paths.stateDir, { all: a.flags.has('all'), now: now() });
|
|
4183
|
+
if (asJson) {
|
|
4184
|
+
json(io, { pending });
|
|
4185
|
+
return 0;
|
|
4186
|
+
}
|
|
4187
|
+
if (!pending.length) {
|
|
4188
|
+
io.out('Nothing is waiting for you.');
|
|
4189
|
+
return 0;
|
|
4190
|
+
}
|
|
4191
|
+
for (const d of pending) {
|
|
4192
|
+
const where = [
|
|
4193
|
+
d.account ?? d.family,
|
|
4194
|
+
d.kind === 'question' ? 'question' : d.kind === 'permission' ? 'needed your OK' : 'left undone',
|
|
4195
|
+
d.agentType ? `subagent ${d.agentType}` : '',
|
|
4196
|
+
d.doneAt ? 'done' : '',
|
|
4197
|
+
]
|
|
4198
|
+
.filter(Boolean)
|
|
4199
|
+
.join(' · ');
|
|
4200
|
+
io.out(`${c.bold(d.id)} ${clock2(d.at, now())} ${c.dim(where)}`);
|
|
4201
|
+
for (const line of d.text.split('\n'))
|
|
4202
|
+
io.out(` ${line}`);
|
|
4203
|
+
if (d.sessionId)
|
|
4204
|
+
io.out(c.dim(` session ${d.sessionId}${d.cwd ? ` in ${tildify(d.cwd, paths.home)}` : ''}`));
|
|
4205
|
+
}
|
|
4206
|
+
io.out(c.dim('Mark one done with `sideby unattended pending done <id>`, or all with `--all`.'));
|
|
4207
|
+
return 0;
|
|
4208
|
+
}
|
|
4209
|
+
if (sub === 'defer') {
|
|
4210
|
+
allow();
|
|
4211
|
+
const text = rest.join(' ').trim();
|
|
4212
|
+
if (!text)
|
|
4213
|
+
throw new UsageError('usage: sideby unattended defer "<one sentence on what was left undone>"');
|
|
4214
|
+
const { addPendingDecision } = await import('../core/unattended-pending.js');
|
|
4215
|
+
const env = process.env;
|
|
4216
|
+
const sessionId = env.CLAUDE_CODE_SESSION_ID || env.CODEX_THREAD_ID;
|
|
4217
|
+
const decision = await addPendingDecision(paths.stateDir, {
|
|
4218
|
+
kind: 'deferred',
|
|
4219
|
+
family: deferFamily(env),
|
|
4220
|
+
...(env.SIDEBY_ACCOUNT ? { account: env.SIDEBY_ACCOUNT } : {}),
|
|
4221
|
+
...(sessionId ? { sessionId } : {}),
|
|
4222
|
+
cwd: process.cwd(),
|
|
4223
|
+
text,
|
|
4224
|
+
}, now());
|
|
4225
|
+
if (asJson)
|
|
4226
|
+
json(io, { decision });
|
|
4227
|
+
else
|
|
4228
|
+
io.out(`${c.green('✓')} kept for the user (${decision.id}); they see it with \`sideby unattended pending\`. Go on with the rest of the task.`);
|
|
4229
|
+
return 0;
|
|
4230
|
+
}
|
|
4231
|
+
throw new UsageError('usage: sideby unattended [status|on|off|schedule|pending|defer]; run `sideby unattended --help`');
|
|
4232
|
+
}
|
|
3909
4233
|
/**
|
|
3910
4234
|
* `sideby commands <words>` (spec §3.36, ADR-0054): the Search Catalog the Panel's Command Palette searches, read-only.
|
|
3911
4235
|
* Titles and places are in English, as every other command prints; the words may be English or Chinese.
|
|
@@ -1,13 +1,31 @@
|
|
|
1
1
|
// JSON Schemas for every `--json` output. Additive changes keep schemaVersion 1; removals, renames or
|
|
2
2
|
// meaning changes bump it (spec §3.9). `pnpm schemas` writes these to schemas/*.json.
|
|
3
3
|
import { Type } from 'typebox';
|
|
4
|
-
import { ConfigSchema, HandoffSettingsSchema } from '../core/config.js';
|
|
4
|
+
import { ConfigSchema, HandoffSettingsSchema, UnattendedSlotSchema } from '../core/config.js';
|
|
5
5
|
const Str = Type.String();
|
|
6
6
|
/** Why sideby cannot do something itself (spec §3.23); `reason` keeps the English text. */
|
|
7
7
|
const ReasonCode = Type.Union(['local-build', 'npx', 'volta', 'not-writable', 'project', 'source', 'skill-in-git'].map((k) => Type.Literal(k)), { description: 'Why, as a code a page can say in its own language.' });
|
|
8
8
|
const Level = Type.Union([Type.Literal('ok'), Type.Literal('warn'), Type.Literal('fail')]);
|
|
9
9
|
const Kind = Type.Union([Type.Literal('subscription'), Type.Literal('api')]);
|
|
10
10
|
const Version = Type.Literal(1);
|
|
11
|
+
/** One Pending Decision of Unattended Mode (spec §3.37). */
|
|
12
|
+
const PendingDecision = Type.Object({
|
|
13
|
+
id: Str,
|
|
14
|
+
at: Type.String({ description: 'When it was kept; ISO.' }),
|
|
15
|
+
kind: Type.Union([Type.Literal('question'), Type.Literal('permission'), Type.Literal('deferred')], {
|
|
16
|
+
description: 'question: the ask tool was refused; permission: a permission request Claude Code was about to show was refused; deferred: kept with `sideby unattended defer`.',
|
|
17
|
+
}),
|
|
18
|
+
family: Str,
|
|
19
|
+
account: Type.Optional(Type.String({ description: 'The account the session ran as.' })),
|
|
20
|
+
sessionId: Type.Optional(Str),
|
|
21
|
+
cwd: Type.Optional(Str),
|
|
22
|
+
agentId: Type.Optional(Type.String({ description: 'The subagent a permission request came from.' })),
|
|
23
|
+
agentType: Type.Optional(Type.String({ description: 'Its type, such as `general-purpose`.' })),
|
|
24
|
+
text: Type.String({
|
|
25
|
+
description: 'The question and its options, the tool and what it was to do, or the deferred text; at most 4000 characters.',
|
|
26
|
+
}),
|
|
27
|
+
doneAt: Type.Optional(Type.String({ description: 'When it was marked done; ISO.' })),
|
|
28
|
+
});
|
|
11
29
|
/** The menu bar shortcut (`sideby menubar hotkey`, spec §3.31). */
|
|
12
30
|
const hotkeyProps = {
|
|
13
31
|
keys: Type.String({
|
|
@@ -436,6 +454,9 @@ const MessageReceipt = Type.Object({
|
|
|
436
454
|
description: 'true while a delivered Message waits for the user to approve it in the target terminal (ADR-0045); dropped once it is read, and after 6 minutes unread the status becomes paste-needed.',
|
|
437
455
|
})),
|
|
438
456
|
sentAt: Str,
|
|
457
|
+
handedOverFrom: Type.Optional(Type.String({
|
|
458
|
+
description: 'The session id that was named, when an Auto Handoff chain led from it to this target (ADR-0057).',
|
|
459
|
+
})),
|
|
439
460
|
});
|
|
440
461
|
const IndexState = Type.Union(['building', 'ready', 'off', 'unavailable'].map((k) => Type.Literal(k)), {
|
|
441
462
|
description: '`building`: the History Index is still reading files (what is built answers already); `off`: config `history.index` is false or the index file could not be opened, so only titles and folders are searched; `unavailable`: this Node has no `node:sqlite`.',
|
|
@@ -906,6 +927,9 @@ export const OUTPUT_SCHEMAS = {
|
|
|
906
927
|
}),
|
|
907
928
|
family: Str,
|
|
908
929
|
sessionId: Type.String({ description: "The host's own session id." }),
|
|
930
|
+
handedOverFrom: Type.Optional(Type.Array(Str, {
|
|
931
|
+
description: "When an Auto Handoff chain led to this session: the earlier hops' session ids, oldest first (ADR-0057).",
|
|
932
|
+
})),
|
|
909
933
|
title: Type.String({
|
|
910
934
|
description: "The host's own title for the session, or its working directory name when the host gives none; may be empty.",
|
|
911
935
|
}),
|
|
@@ -963,6 +987,9 @@ export const OUTPUT_SCHEMAS = {
|
|
|
963
987
|
board: Type.String({ description: 'The Run Board file opened, with the home folder as ~.' }),
|
|
964
988
|
sessionId: Str,
|
|
965
989
|
label: Type.String({ description: 'The Session Label of the session whose run report was opened.' }),
|
|
990
|
+
handedOverFrom: Type.Optional(Type.String({
|
|
991
|
+
description: 'The session id that was named, when an Auto Handoff chain led from it to this session (ADR-0057).',
|
|
992
|
+
})),
|
|
966
993
|
}, { title: 'sideby sessions open-run --json' }),
|
|
967
994
|
'sessions-copy': Type.Object({
|
|
968
995
|
schemaVersion: Version,
|
|
@@ -973,6 +1000,9 @@ export const OUTPUT_SCHEMAS = {
|
|
|
973
1000
|
text: Type.String({ description: 'The text copied, also when it could not be.' }),
|
|
974
1001
|
sessionId: Str,
|
|
975
1002
|
label: Type.String({ description: 'The Session Label of the session copied.' }),
|
|
1003
|
+
handedOverFrom: Type.Optional(Type.String({
|
|
1004
|
+
description: 'The session id that was named, when an Auto Handoff chain led from it to this session (ADR-0057).',
|
|
1005
|
+
})),
|
|
976
1006
|
}, { title: 'sideby sessions copy --json' }),
|
|
977
1007
|
history: Type.Object({
|
|
978
1008
|
schemaVersion: Version,
|
|
@@ -1158,6 +1188,62 @@ export const OUTPUT_SCHEMAS = {
|
|
|
1158
1188
|
before: Type.Object({ guard: Type.Boolean(), allow: Type.Array(Str) }),
|
|
1159
1189
|
after: Type.Object({ guard: Type.Boolean(), allow: Type.Array(Str) }),
|
|
1160
1190
|
}, { title: 'sideby network on|off|allow --json' }),
|
|
1191
|
+
unattended: Type.Object({
|
|
1192
|
+
schemaVersion: Version,
|
|
1193
|
+
on: Type.Boolean({ description: 'Unattended Mode is on now.' }),
|
|
1194
|
+
reason: Type.Union([
|
|
1195
|
+
Type.Literal('slot'),
|
|
1196
|
+
Type.Literal('manual'),
|
|
1197
|
+
Type.Literal('session'),
|
|
1198
|
+
Type.Literal('paused'),
|
|
1199
|
+
Type.Literal('off'),
|
|
1200
|
+
], {
|
|
1201
|
+
description: 'slot: a Slot of the Schedule turned it on; manual: the user did; session: only this session, started with --unattended; paused: off until the current Slot ends; off.',
|
|
1202
|
+
}),
|
|
1203
|
+
until: Type.Optional(Type.String({
|
|
1204
|
+
description: 'When it turns off (on), or when the pause ends (paused); ISO. Absent for a session alone, and when the Schedule covers every hour (on with no end, or paused until `on`).',
|
|
1205
|
+
})),
|
|
1206
|
+
slot: Type.Optional(Type.String({ description: 'The Slot it is in: its name, or its days and times when it has none.' })),
|
|
1207
|
+
slotNumber: Type.Optional(Type.Integer({ description: 'That Slot’s number in `schedule`, from 1.', minimum: 1 })),
|
|
1208
|
+
next: Type.Optional(Type.Object({
|
|
1209
|
+
at: Type.String({ description: 'ISO.' }),
|
|
1210
|
+
slot: Str,
|
|
1211
|
+
slotNumber: Type.Optional(Type.Integer({ minimum: 1 })),
|
|
1212
|
+
}, { description: 'The next time a Slot turns it on by itself.' })),
|
|
1213
|
+
configured: Type.Boolean({
|
|
1214
|
+
description: 'The config has an `unattended` section, so sideby adds its hook to the Claude and Codex sessions it starts.',
|
|
1215
|
+
}),
|
|
1216
|
+
schedule: Type.Array(UnattendedSlotSchema, {
|
|
1217
|
+
description: 'Config `unattended.schedule`, numbered from 1.',
|
|
1218
|
+
}),
|
|
1219
|
+
pending: Type.Integer({ description: 'Open Pending Decisions (`sideby unattended pending`).' }),
|
|
1220
|
+
coverage: Type.Record(Str, Type.Union([Type.Literal('covered'), Type.Literal('needs-trust'), Type.Literal('not-covered')]), {
|
|
1221
|
+
description: 'Per family: covered (sessions sideby starts get the hook), needs-trust (Codex runs it once the user trusts it in /hooks), not-covered (no hook sideby can add, or the feature was never used).',
|
|
1222
|
+
}),
|
|
1223
|
+
slotEnd: Type.Optional(Type.String({
|
|
1224
|
+
description: 'When `on --slot-end` would end: the end of the current or next Slot, when that is within 72 hours; ISO.',
|
|
1225
|
+
})),
|
|
1226
|
+
manual: Type.Optional(Type.Object({
|
|
1227
|
+
mode: Type.Union([Type.Literal('on'), Type.Literal('pause')]),
|
|
1228
|
+
until: Type.Optional(Type.String({
|
|
1229
|
+
description: 'ISO. Absent only for a pause made while the Schedule covers every hour: it lasts until `on`.',
|
|
1230
|
+
})),
|
|
1231
|
+
at: Type.String({ description: 'When the user chose it; ISO.' }),
|
|
1232
|
+
}, { description: 'The manual state in effect now: on until, or paused until.' })),
|
|
1233
|
+
problem: Type.Optional(Type.String({
|
|
1234
|
+
description: 'Why sideby cannot keep its state: `<state>/unattended` is a link, someone else’s, or writable by others. Says what to do.',
|
|
1235
|
+
})),
|
|
1236
|
+
changed: Type.Optional(Type.Boolean({ description: 'Set by on, off and schedule changes: whether anything changed.' })),
|
|
1237
|
+
undo: Type.Optional(Type.String({ description: 'The command that puts back what the change replaced.' })),
|
|
1238
|
+
}, { title: 'sideby unattended [on|off|schedule …] --json' }),
|
|
1239
|
+
'unattended-pending': Type.Object({
|
|
1240
|
+
schemaVersion: Version,
|
|
1241
|
+
pending: Type.Array(PendingDecision, {
|
|
1242
|
+
description: 'Open Pending Decisions, oldest first; with --all the done ones too.',
|
|
1243
|
+
}),
|
|
1244
|
+
done: Type.Optional(Type.Array(Str, { description: '`pending done`: the ids marked done.' })),
|
|
1245
|
+
}, { title: 'sideby unattended pending [done <id>|--all] --json' }),
|
|
1246
|
+
'unattended-defer': Type.Object({ schemaVersion: Version, decision: PendingDecision }, { title: 'sideby unattended defer "<text>" --json' }),
|
|
1161
1247
|
browser: Type.Object({
|
|
1162
1248
|
schemaVersion: Version,
|
|
1163
1249
|
enabled: Type.Boolean({
|