sideby 0.38.1 → 0.39.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 +6 -0
- package/dist/src/cli/commands.js +88 -0
- package/dist/src/cli/json-schemas.js +35 -0
- package/dist/src/cli/main.js +29 -0
- package/dist/src/core/cli-commands.js +14 -2
- package/dist/src/core/config.d.ts +13 -0
- package/dist/src/core/config.js +18 -0
- package/dist/src/core/launch.d.ts +5 -0
- package/dist/src/core/launch.js +11 -1
- package/dist/src/core/progress-state.d.ts +80 -0
- package/dist/src/core/progress-state.js +216 -0
- package/dist/src/core/progress.d.ts +36 -0
- package/dist/src/core/progress.js +77 -0
- package/dist/src/core/prompt-origin.d.ts +40 -0
- package/dist/src/core/prompt-origin.js +98 -0
- package/dist/src/core/search-catalog.js +25 -0
- package/dist/src/core/unattended-attended.d.ts +109 -0
- package/dist/src/core/unattended-attended.js +337 -0
- package/dist/src/core/unattended.d.ts +10 -2
- package/dist/src/core/unattended.js +11 -2
- package/dist/src/handoff/hook.js +19 -4
- package/dist/src/network/hook.js +4 -8
- package/dist/src/panel/handler.d.ts +3 -0
- package/dist/src/panel/handler.js +15 -0
- package/dist/src/panel/i18n.d.ts +18 -0
- package/dist/src/panel/i18n.js +36 -0
- package/dist/src/panel/page-script.js +67 -2
- package/dist/src/panel/page-styles.js +14 -0
- package/dist/src/progress/hook.d.ts +50 -0
- package/dist/src/progress/hook.js +251 -0
- package/dist/src/runtime.d.ts +9 -0
- package/dist/src/runtime.js +45 -2
- package/dist/src/unattended/hook.d.ts +5 -0
- package/dist/src/unattended/hook.js +103 -9
- package/package.json +1 -1
- package/schemas/config.json +13 -0
- package/schemas/progress.json +137 -0
- package/schemas/unattended.json +38 -0
- package/skills/sideby/SKILL.md +3 -1
- package/skills/sideby/references/progress.md +25 -0
- package/skills/sideby/references/unattended.md +9 -1
|
@@ -12,12 +12,16 @@
|
|
|
12
12
|
// written as plain text (`{"decision":"block","reason":…}` on stdout), keeping the question; and it declines an MCP
|
|
13
13
|
// server's form, keeping what the server asked. In Claude it also runs in the background after a turn that failed for
|
|
14
14
|
// a passing reason (`StopFailure`, `asyncRewake`): it waits, then wakes the session with exit 2 so the turn goes on, at
|
|
15
|
-
// most three times in a row, and keeps a Pending Decision when that did not help (Turn Retry, ADR-0067).
|
|
16
|
-
//
|
|
15
|
+
// most three times in a row, and keeps a Pending Decision when that did not help (Turn Retry, ADR-0067). And in Claude
|
|
16
|
+
// it runs in the background on every prompt (`UserPromptSubmit`, `async`): a prompt a person typed makes that session
|
|
17
|
+
// an Attended Session for 30 minutes, which it leaves alone as if the mode were off, telling the user once (ADR-0075).
|
|
18
|
+
// A failure before the decision is made does nothing: that is
|
|
17
19
|
// how a session behaves without the feature (unlike `network-hook`, which blocks when it cannot tell). Once the
|
|
18
20
|
// decision is to refuse, it refuses: keeping the Pending Decision and writing the reason are best effort, and their
|
|
19
21
|
// failure neither allows the call nor adds any output of its own.
|
|
20
22
|
import { resolvePaths } from '../core/paths.js';
|
|
23
|
+
import { hostMade, launchPrompt, sidebyMessage } from '../core/prompt-origin.js';
|
|
24
|
+
import { ATTENDED_MS, markAttended, markTold, ownTranscript, promptOrigin, readAttended, sessionUnattended, } from '../core/unattended-attended.js';
|
|
21
25
|
import { addPendingDecision } from '../core/unattended-pending.js';
|
|
22
26
|
import { clearRetryStreak, countFailure, passingFailure, RETRY_LIMIT, readRetryStreak, retryDelay, retryGaveUpText, retryMessage, } from '../core/unattended-retry.js';
|
|
23
27
|
import { clockText, readUnattendedConfig, readUnattendedOverride, UNATTENDED_ENV, unattendedState, } from '../core/unattended-state.js';
|
|
@@ -326,6 +330,16 @@ export function permissionReason(state, now, kept) {
|
|
|
326
330
|
const keep = kept ? ' sideby kept this request for the user to look at later.' : '';
|
|
327
331
|
return `Not allowed: Claude Code wanted a person to confirm this action, and nobody is here (sideby's Unattended Mode is on ${when}).${keep} Rewrite it so it needs no confirmation: literal paths, "\${VAR:?}" for variables in rm targets, plain bash syntax, and rm as a command of its own. Or skip it, record it with \`sideby unattended defer "<what and why>"\`, and go on with the rest.`;
|
|
328
332
|
}
|
|
333
|
+
/**
|
|
334
|
+
* What the user reads once in an Attended Session while Unattended Mode is on (ADR-0075), as a `systemMessage`: shown
|
|
335
|
+
* in the session, never to the model.
|
|
336
|
+
*/
|
|
337
|
+
export function attendedNotice(state, zh) {
|
|
338
|
+
const session = state.reason === 'session';
|
|
339
|
+
if (zh)
|
|
340
|
+
return `sideby:你在,这个会话在你最后一条消息后 30 分钟内照常问你。${session ? '它是按无人值守启动的,30 分钟没人打字后恢复。' : '其他会话仍然无人值守。要全部关掉,运行 `sideby unattended off`。'}`;
|
|
341
|
+
return `sideby: you're here, so this session asks you as usual for 30 minutes after your last message. ${session ? 'It was started unattended, and goes back to that once nobody has typed for 30 minutes.' : 'Other sessions stay unattended. To turn Unattended Mode off everywhere, run `sideby unattended off`.'}`;
|
|
342
|
+
}
|
|
329
343
|
/** What to do with this call: undefined allows it. Any error here allows it too (the caller catches it). */
|
|
330
344
|
async function decide(argv, env, input, now) {
|
|
331
345
|
const [family = '', event = ''] = argv;
|
|
@@ -353,11 +367,35 @@ async function decide(argv, env, input, now) {
|
|
|
353
367
|
const raw = early ?? (await readInput(input));
|
|
354
368
|
const zh = prefersChinese(env);
|
|
355
369
|
const account = text(env.SIDEBY_ACCOUNT, 256);
|
|
370
|
+
/**
|
|
371
|
+
* An Attended Session (ADR-0075) is left alone, as when the mode is off: undefined while the session is not one.
|
|
372
|
+
* Where a `systemMessage` reaches the user (`Stop`, the ask tool's `PreToolUse`), the first such call of a stretch
|
|
373
|
+
* tells them once.
|
|
374
|
+
*/
|
|
375
|
+
const attended = async (sessionId, tell) => {
|
|
376
|
+
if (family !== 'claude' || !sessionId)
|
|
377
|
+
return undefined;
|
|
378
|
+
const r = await readAttended(paths.stateDir, sessionId, now);
|
|
379
|
+
if (!r)
|
|
380
|
+
return undefined;
|
|
381
|
+
if (!tell || r.toldAt)
|
|
382
|
+
return {};
|
|
383
|
+
return {
|
|
384
|
+
answer: {
|
|
385
|
+
json: (systemMessage) => ({ systemMessage }),
|
|
386
|
+
reason: () => attendedNotice(state, zh),
|
|
387
|
+
keep: () => markTold(paths.stateDir, sessionId, r.since, now),
|
|
388
|
+
},
|
|
389
|
+
};
|
|
390
|
+
};
|
|
356
391
|
if (stop || elicitation) {
|
|
357
392
|
const v = parseObject(raw);
|
|
358
393
|
if (!v)
|
|
359
394
|
return undefined;
|
|
360
395
|
const sessionId = text(v.session_id, 256);
|
|
396
|
+
const here = await attended(sessionId, stop);
|
|
397
|
+
if (here)
|
|
398
|
+
return here.answer;
|
|
361
399
|
const cwd = text(v.cwd);
|
|
362
400
|
const where = {
|
|
363
401
|
family,
|
|
@@ -391,6 +429,11 @@ async function decide(argv, env, input, now) {
|
|
|
391
429
|
const payload = parsePayload(raw);
|
|
392
430
|
if (!payload)
|
|
393
431
|
return undefined;
|
|
432
|
+
if (permission || payload.tool === askTool) {
|
|
433
|
+
const here = await attended(payload.sessionId, !permission);
|
|
434
|
+
if (here)
|
|
435
|
+
return here.answer;
|
|
436
|
+
}
|
|
394
437
|
if (permission)
|
|
395
438
|
return {
|
|
396
439
|
json: (message) => ({
|
|
@@ -431,6 +474,11 @@ async function decide(argv, env, input, now) {
|
|
|
431
474
|
* record.
|
|
432
475
|
*/
|
|
433
476
|
export async function runUnattendedHook(argv, env, input, io, deps = {}) {
|
|
477
|
+
if (argv[0] === 'claude' && argv[1] === 'UserPromptSubmit') {
|
|
478
|
+
// In the background: its output and exit code change nothing, and it never holds a prompt back.
|
|
479
|
+
await notePrompt(env, input, deps).catch(() => { });
|
|
480
|
+
return 0;
|
|
481
|
+
}
|
|
434
482
|
if (argv[0] === 'claude' && argv[1] === 'StopFailure') {
|
|
435
483
|
try {
|
|
436
484
|
const wake = await retryAfterFailure(env, input, deps);
|
|
@@ -479,12 +527,58 @@ export async function runUnattendedHook(argv, env, input, io, deps = {}) {
|
|
|
479
527
|
}
|
|
480
528
|
return 2;
|
|
481
529
|
}
|
|
482
|
-
/**
|
|
483
|
-
|
|
530
|
+
/**
|
|
531
|
+
* Whether the session is unattended right now: Unattended Mode is on, read fresh from the Schedule and the manual
|
|
532
|
+
* state, and the session is not an Attended Session.
|
|
533
|
+
*/
|
|
534
|
+
async function isOn(env, now, sessionId) {
|
|
484
535
|
const paths = resolvePaths(env);
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
536
|
+
return (await sessionUnattended({
|
|
537
|
+
stateDir: paths.stateDir,
|
|
538
|
+
configFile: paths.configFile,
|
|
539
|
+
session: env[UNATTENDED_ENV] === '1',
|
|
540
|
+
sessionId,
|
|
541
|
+
now,
|
|
542
|
+
})).on;
|
|
543
|
+
}
|
|
544
|
+
/** A prompt id as Claude Code writes it; anything else is not looked for. */
|
|
545
|
+
const PROMPT_ID = /^[A-Za-z0-9_.:-]{1,128}$/;
|
|
546
|
+
/**
|
|
547
|
+
* Claude's background `UserPromptSubmit` entry (spec §3.37 "有人在的会话", ADR-0075): makes the session an Attended
|
|
548
|
+
* Session when a person typed the prompt. Not counted: a prompt Claude Code made itself, a Message `sideby send`
|
|
549
|
+
* delivered, a prompt sideby put on the command line (or a session whose launch did not say which those are), a
|
|
550
|
+
* subagent's, and any prompt whose line in the session's own transcript does not say `human` within the wait. The
|
|
551
|
+
* transcript line decides, not the input: its text is checked as the prompt is, and its time is when the stretch is
|
|
552
|
+
* counted from, so an input made by hand that names another file, the launch's prompt or an old prompt marks nothing
|
|
553
|
+
* new. Nothing of the prompt is kept.
|
|
554
|
+
*/
|
|
555
|
+
async function notePrompt(env, input, deps) {
|
|
556
|
+
const v = parseObject(await readInput(input));
|
|
557
|
+
if (!v || v.agent_id !== undefined)
|
|
558
|
+
return;
|
|
559
|
+
const sessionId = text(v.session_id, 256);
|
|
560
|
+
const promptId = typeof v.prompt_id === 'string' && PROMPT_ID.test(v.prompt_id) ? v.prompt_id : undefined;
|
|
561
|
+
const prompt = typeof v.prompt === 'string' ? v.prompt : undefined;
|
|
562
|
+
const transcript = typeof v.transcript_path === 'string' ? v.transcript_path : undefined;
|
|
563
|
+
if (!sessionId || !promptId || prompt === undefined || !transcript)
|
|
564
|
+
return;
|
|
565
|
+
const notTyped = (s) => hostMade(s) || sidebyMessage(s) || launchPrompt(s, env);
|
|
566
|
+
if (notTyped(prompt) || !(await ownTranscript(transcript, sessionId, env)))
|
|
567
|
+
return;
|
|
568
|
+
const clock = deps.now ?? (() => new Date());
|
|
569
|
+
const line = await promptOrigin(transcript, promptId, {
|
|
570
|
+
...(deps.sleep ? { sleep: deps.sleep } : {}),
|
|
571
|
+
clock: () => clock().getTime(),
|
|
572
|
+
});
|
|
573
|
+
if (line?.origin !== 'human' || line.text === undefined || line.at === undefined || notTyped(line.text))
|
|
574
|
+
return;
|
|
575
|
+
const now = clock().getTime();
|
|
576
|
+
const at = Math.min(line.at, now);
|
|
577
|
+
if (at + ATTENDED_MS <= now)
|
|
578
|
+
return;
|
|
579
|
+
const account = text(env.SIDEBY_ACCOUNT, 256);
|
|
580
|
+
const cwd = text(v.cwd);
|
|
581
|
+
await markAttended(resolvePaths(env).stateDir, { sessionId, family: 'claude', ...(account ? { account } : {}), ...(cwd ? { cwd } : {}) }, new Date(at));
|
|
488
582
|
}
|
|
489
583
|
/**
|
|
490
584
|
* Turn Retry (spec §3.37 item 6, ADR-0067), Claude's background `StopFailure` hook (`asyncRewake`): Claude Code runs it
|
|
@@ -509,7 +603,7 @@ async function retryAfterFailure(env, input, deps) {
|
|
|
509
603
|
const said = [text(v.last_assistant_message, 1000), text(v.error_details, 1000)].filter(Boolean).join(' ');
|
|
510
604
|
// A later failure that is not retried (a used-up Quota, a lasting error) or comes while the mode is off still
|
|
511
605
|
// takes over the session: the wait an earlier failure left must not wake it.
|
|
512
|
-
if (!error || !passingFailure(error, said) || !(await isOn(env, now))) {
|
|
606
|
+
if (!error || !passingFailure(error, said) || !(await isOn(env, now, sessionId))) {
|
|
513
607
|
await clearRetryStreak(paths.stateDir, sessionId).catch(() => { });
|
|
514
608
|
return undefined;
|
|
515
609
|
}
|
|
@@ -534,7 +628,7 @@ async function retryAfterFailure(env, input, deps) {
|
|
|
534
628
|
return undefined;
|
|
535
629
|
if ((await readRetryStreak(paths.stateDir, sessionId))?.token !== streak.token)
|
|
536
630
|
return undefined;
|
|
537
|
-
if (!(await isOn(env, clock())))
|
|
631
|
+
if (!(await isOn(env, clock(), sessionId)))
|
|
538
632
|
return undefined;
|
|
539
633
|
return retryMessage(error, text(v.last_assistant_message, 1000) ?? '', streak.count, prefersChinese(env));
|
|
540
634
|
}
|
package/package.json
CHANGED
package/schemas/config.json
CHANGED
|
@@ -505,6 +505,19 @@
|
|
|
505
505
|
"additionalProperties": false,
|
|
506
506
|
"description": "Unattended Mode (spec §3.37, ADR-0058): while it is on, sessions sideby starts never stop to wait for a person. Present once the feature is used; from then on sideby adds its hook to every Claude and Codex session it starts, so turning it on later covers sessions already running. `sideby config unset unattended` stops adding it."
|
|
507
507
|
},
|
|
508
|
+
"progress": {
|
|
509
|
+
"type": "object",
|
|
510
|
+
"properties": {
|
|
511
|
+
"every": {
|
|
512
|
+
"type": "integer",
|
|
513
|
+
"minimum": 1,
|
|
514
|
+
"maximum": 240,
|
|
515
|
+
"description": "Progress Reminders: while a Claude session sideby started waits on background work (subagents, background commands), wake it every this many minutes so the model tells you in one or two sentences what it waits for. Each reminder is one model turn over the whole conversation, so it uses quota. Not set: off (the default). Sessions started afterwards get it; turning it off or changing the interval also reaches running sessions. Not while the session is unattended; Codex is not covered."
|
|
516
|
+
}
|
|
517
|
+
},
|
|
518
|
+
"additionalProperties": false,
|
|
519
|
+
"description": "Progress Reminders (spec §3.42, ADR-0076)."
|
|
520
|
+
},
|
|
508
521
|
"browser": {
|
|
509
522
|
"type": "object",
|
|
510
523
|
"properties": {
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "sideby/progress.json",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"required": [
|
|
6
|
+
"schemaVersion",
|
|
7
|
+
"action",
|
|
8
|
+
"on"
|
|
9
|
+
],
|
|
10
|
+
"properties": {
|
|
11
|
+
"schemaVersion": {
|
|
12
|
+
"type": "number",
|
|
13
|
+
"const": 1
|
|
14
|
+
},
|
|
15
|
+
"action": {
|
|
16
|
+
"anyOf": [
|
|
17
|
+
{
|
|
18
|
+
"type": "string",
|
|
19
|
+
"const": "status"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"type": "string",
|
|
23
|
+
"const": "on"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"type": "string",
|
|
27
|
+
"const": "off"
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
"on": {
|
|
32
|
+
"type": "boolean",
|
|
33
|
+
"description": "Progress Reminders are on: a Claude session sideby starts that waits on background work tells the user every `every` minutes what it waits for (spec §3.42)."
|
|
34
|
+
},
|
|
35
|
+
"every": {
|
|
36
|
+
"type": "integer",
|
|
37
|
+
"description": "Minutes between reminders, config `progress.every`; absent while off."
|
|
38
|
+
},
|
|
39
|
+
"defaultEvery": {
|
|
40
|
+
"type": "integer",
|
|
41
|
+
"description": "What `on` picks without --every (status only)."
|
|
42
|
+
},
|
|
43
|
+
"choices": {
|
|
44
|
+
"type": "array",
|
|
45
|
+
"items": {
|
|
46
|
+
"type": "integer"
|
|
47
|
+
},
|
|
48
|
+
"description": "The intervals the Panel offers (status only)."
|
|
49
|
+
},
|
|
50
|
+
"families": {
|
|
51
|
+
"type": "array",
|
|
52
|
+
"items": {
|
|
53
|
+
"type": "string"
|
|
54
|
+
},
|
|
55
|
+
"description": "Families whose sessions get reminders (status only); Codex has no hook that can wake a session."
|
|
56
|
+
},
|
|
57
|
+
"changed": {
|
|
58
|
+
"type": "boolean",
|
|
59
|
+
"description": "on and off: whether the config changed."
|
|
60
|
+
},
|
|
61
|
+
"before": {
|
|
62
|
+
"type": "integer",
|
|
63
|
+
"description": "on and off: the interval before, when it was on."
|
|
64
|
+
},
|
|
65
|
+
"undo": {
|
|
66
|
+
"type": "string",
|
|
67
|
+
"description": "on and off: the command that puts back what was there."
|
|
68
|
+
},
|
|
69
|
+
"message": {
|
|
70
|
+
"type": "string",
|
|
71
|
+
"description": "on and off: one line for the user."
|
|
72
|
+
},
|
|
73
|
+
"_notice": {
|
|
74
|
+
"type": "object",
|
|
75
|
+
"properties": {
|
|
76
|
+
"update": {
|
|
77
|
+
"type": "object",
|
|
78
|
+
"required": [
|
|
79
|
+
"current",
|
|
80
|
+
"latest",
|
|
81
|
+
"command",
|
|
82
|
+
"message"
|
|
83
|
+
],
|
|
84
|
+
"properties": {
|
|
85
|
+
"current": {
|
|
86
|
+
"type": "string"
|
|
87
|
+
},
|
|
88
|
+
"latest": {
|
|
89
|
+
"type": "string"
|
|
90
|
+
},
|
|
91
|
+
"command": {
|
|
92
|
+
"type": "string",
|
|
93
|
+
"description": "Run it after the user agrees: it shows the plan and exits 10; then --yes."
|
|
94
|
+
},
|
|
95
|
+
"message": {
|
|
96
|
+
"type": "string"
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
"skill": {
|
|
101
|
+
"type": "object",
|
|
102
|
+
"required": [
|
|
103
|
+
"installed",
|
|
104
|
+
"current",
|
|
105
|
+
"command",
|
|
106
|
+
"message"
|
|
107
|
+
],
|
|
108
|
+
"properties": {
|
|
109
|
+
"installed": {
|
|
110
|
+
"anyOf": [
|
|
111
|
+
{
|
|
112
|
+
"type": "string"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"type": "null"
|
|
116
|
+
}
|
|
117
|
+
],
|
|
118
|
+
"description": "The skill's version; null when it has none."
|
|
119
|
+
},
|
|
120
|
+
"current": {
|
|
121
|
+
"type": "string"
|
|
122
|
+
},
|
|
123
|
+
"command": {
|
|
124
|
+
"type": "string",
|
|
125
|
+
"description": "`sideby update`, which updates the skill with sideby: run it after the user agrees; it shows the plan and exits 10, then --yes."
|
|
126
|
+
},
|
|
127
|
+
"message": {
|
|
128
|
+
"type": "string"
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
"description": "Not the answer to the task: mention it briefly afterwards and offer to update."
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
"title": "sideby progress [on|off] --json"
|
|
137
|
+
}
|
package/schemas/unattended.json
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"configured",
|
|
10
10
|
"schedule",
|
|
11
11
|
"pending",
|
|
12
|
+
"attended",
|
|
12
13
|
"coverage"
|
|
13
14
|
],
|
|
14
15
|
"properties": {
|
|
@@ -156,6 +157,43 @@
|
|
|
156
157
|
"type": "integer",
|
|
157
158
|
"description": "Open Pending Decisions (`sideby unattended pending`)."
|
|
158
159
|
},
|
|
160
|
+
"attended": {
|
|
161
|
+
"type": "array",
|
|
162
|
+
"items": {
|
|
163
|
+
"type": "object",
|
|
164
|
+
"required": [
|
|
165
|
+
"sessionId",
|
|
166
|
+
"family",
|
|
167
|
+
"since",
|
|
168
|
+
"until"
|
|
169
|
+
],
|
|
170
|
+
"properties": {
|
|
171
|
+
"sessionId": {
|
|
172
|
+
"type": "string"
|
|
173
|
+
},
|
|
174
|
+
"family": {
|
|
175
|
+
"type": "string"
|
|
176
|
+
},
|
|
177
|
+
"account": {
|
|
178
|
+
"type": "string"
|
|
179
|
+
},
|
|
180
|
+
"cwd": {
|
|
181
|
+
"type": "string"
|
|
182
|
+
},
|
|
183
|
+
"since": {
|
|
184
|
+
"type": "string",
|
|
185
|
+
"format": "date-time",
|
|
186
|
+
"description": "When someone first typed into it after it last stopped counting."
|
|
187
|
+
},
|
|
188
|
+
"until": {
|
|
189
|
+
"type": "string",
|
|
190
|
+
"format": "date-time",
|
|
191
|
+
"description": "30 minutes after the last prompt someone typed into it."
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
"description": "Attended Sessions (ADR-0075): Claude sessions sideby started that someone typed into within the last 30 minutes. They ask as usual while the mode stays on for every other session. Latest `until` first. Read-only: only a prompt typed into the session sets it."
|
|
196
|
+
},
|
|
159
197
|
"coverage": {
|
|
160
198
|
"type": "object",
|
|
161
199
|
"patternProperties": {
|
package/skills/sideby/SKILL.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: sideby
|
|
3
3
|
description: Use when the user runs, or wants to run, several AI coding accounts (Claude Code, Codex, Grok Build, pi) side by side. Covers installing sideby and setting up a new account ("install sideby", "set up another Claude account", "add cc008", "配置一个 cc00x", "再加一个 Codex 账号"), explaining what accounts share and what stays separate ("what do my accounts share?", "这些账号共享了什么"), showing which account a session is ("show [cc001] in the status line", "加上账号标识"), finding a past session of any account ("找一下我上周改登录页的那个会话"), telling another running session something, in any account ("告诉 cc002 ……", "给跑构建的那个会话发消息"; Claude Code's own SendMessage reaches only sessions of the same account), seeing accounts, quota and usage, moving on when one hits its 5-hour or weekly limit, moving the current task to another account ("用 cc008 继续", "交回 cc008"), adding a short command (alias) or a pick command that starts whichever account has the most quota ("加个 cc"), adding an API account from a vendor's docs ("加一个 DeepSeek API 账号"), supporting a new tool, and repairing drifted account directories (skills, hooks, rules or settings not shared, wrong symlinks, credential file permissions). Drives the `sideby` CLI with `--json`; the agent does every step except browser sign-in, filling in secrets and starting interactive sessions, which it hands to the user as one command (inside an Auto Handoff session, `sideby handoff ready --to` moves the task itself).
|
|
4
4
|
metadata:
|
|
5
|
-
version: "0.
|
|
5
|
+
version: "0.39.0"
|
|
6
6
|
requires:
|
|
7
7
|
bins: [sideby, node]
|
|
8
8
|
cliHelp: sideby --help
|
|
@@ -84,6 +84,8 @@ Account refs are `<family>:<name>`; a bare `<name>` works only when it is unique
|
|
|
84
84
|
| A Claude API account's gateway rejects requests after an Advisor change, or why sideby adds `CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS` to API accounts ("API 账号网关报错了", "为什么 API 账号多了这个变量") | `sideby advisor --json` (`apiBetasOff`, each group's `apiAccounts`), `sideby config get claude.apiBetasOff --json`; `sideby advisor undo` or `sideby config set claude.apiBetasOff false` after they agree | `references/panel.md` |
|
|
85
85
|
| Stop Claude and Codex when the network is wrong ("网络不对时别让 Claude 用", "代理断了就拦住", "only allow US and Japan", "开网络检查"), see where requests leave from now, or a session says it was blocked | `sideby network --json`, `sideby network check --json`, `sideby network allow <CC>... --json` and `sideby network on --json` (each exits 10 first; rerun with `--yes` after they agree) | `references/network.md` |
|
|
86
86
|
| Leave sessions running with nobody there ("挂机", "无人值守", "今晚自己跑完", "设个时间段别问我", "keep going while I sleep"), set a nightly Schedule, or see what was left for the user | `sideby unattended on [--until 08:00] --json` (run it yourself when they say they are leaving), `sideby unattended schedule preset weeknights --json`, `sideby unattended --json`, `sideby unattended pending --json`; inside a session refused a question: `sideby unattended defer "<one sentence>"` | `references/unattended.md` |
|
|
87
|
+
| The user is back early and wants questions in one session ("我回来了,会话怎么还不问我", "为什么这个会话又开始问我", "I'm back, why doesn't it ask me"), or asks which sessions ask as usual | Tell them to type in that session: it asks as usual for 30 minutes after each message. `sideby unattended --json` lists them (`attended`); there is no command to set it. `sideby unattended off --json` turns it off everywhere | `references/unattended.md` |
|
|
88
|
+
| A session waits on background work and says nothing for a long time ("后台任务跑着时没动静", "等子任务时隔一阵告诉我进度", "tell me what it is waiting for every 10 minutes", "进度提醒"), or stop those updates ("别再报进度了", "turn off progress updates") | `sideby progress --json`, then `sideby progress on [--every <minutes>] --json` or `sideby progress off --json` (writes only sideby's config, no preview; relay that each update uses quota and that only Claude sessions started afterwards get it) | `references/progress.md` |
|
|
87
89
|
| See Claude quota, refresh it, or turn on live quota for Auto Handoff | `sideby quota claude --refresh --json` (no setup); `sideby quota setup claude` (exits 10) for Auto Handoff | `references/quota.md` |
|
|
88
90
|
| Update sideby or its skill ("is there a new version", "更新 sideby"), or an output has `_notice` | `sideby update --json` (exits 10 first) | `references/update.md` |
|
|
89
91
|
| See everything at once | `sideby ui` (local panel on `127.0.0.1:17420`; `--no-open` prints the address) | — |
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Progress updates: a waiting session says what it waits for
|
|
2
|
+
|
|
3
|
+
Progress Reminders (spec §3.42, ADR-0076): while a Claude session sideby started waits on background work (subagents, background commands), the session is idle and the model cannot say anything, so the user sees silence. With progress updates on, sideby wakes such a session every few minutes, and the model tells the user in one or two sentences what it waits for, how long it has waited and whether there is new output, then ends its turn.
|
|
4
|
+
|
|
5
|
+
## Turn it on or off
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
sideby progress --json # { on, every?, defaultEvery, choices, families }
|
|
9
|
+
sideby progress on --json # every 10 minutes (or keeps the interval it had)
|
|
10
|
+
sideby progress on --every 15 --json # 1 to 240 minutes
|
|
11
|
+
sideby progress off --json
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
It writes only sideby's config (`progress.every`), so there is no preview and no `--yes`; each change returns `undo`. Before turning it on for the user, tell them, in one line each:
|
|
15
|
+
- Each update is one model turn, which reads the whole conversation: it uses quota. That is why it is off by default.
|
|
16
|
+
- Claude sessions sideby starts from now on get it; a session already running needs a restart. Turning it off, or a new interval, reaches running sessions too.
|
|
17
|
+
- There are no updates while the session is unattended (Unattended Mode, unless the user typed there in the last 30 minutes), while a turn is running, or once the background work is done.
|
|
18
|
+
- Codex is not covered: no Codex hook can wake a waiting session. Grok, pi and sessions started without sideby are not covered either.
|
|
19
|
+
- In the Panel it is **Settings › Progress updates**.
|
|
20
|
+
|
|
21
|
+
## Inside a session that gets one
|
|
22
|
+
|
|
23
|
+
The reminder arrives as a message that starts `sideby progress reminder:` and names the background tasks, when the wait began and for how long. Answer it as it asks: one or two sentences for the user (what you wait for, how long, any new output if it is quick to look), then end your turn. Do not start new work or stop the tasks because of it. If the user asks how to stop these, the command is `sideby progress off`.
|
|
24
|
+
|
|
25
|
+
With Auto Handoff on, a reminder's turn does not change when or how the session hands over.
|
|
@@ -49,10 +49,18 @@ Then go on with the rest. Do not retry the question, and do not work around the
|
|
|
49
49
|
|
|
50
50
|
When a note from sideby says your last turn failed for a passing reason, the session was woken to go on: check what is already done (files, commits, background work), do not redo it, and continue where the turn stopped.
|
|
51
51
|
|
|
52
|
+
## When the user is back early: they just type
|
|
53
|
+
|
|
54
|
+
A Claude session the user types into asks as usual again for 30 minutes after each message they send (an **Attended Session**, ADR-0075): its questions, permission prompts and forms reach the user, and nothing of it is refused or kept. Every other session stays unattended, and the global state does not change. The first time it applies, the session shows the user one line saying so. So when the user says they are back but only wants to work in one session ("我回来了,这个会话怎么还不问我", "why is this session asking me again"), tell them to just type in it; no command is needed.
|
|
55
|
+
|
|
56
|
+
- See which sessions it covers now: `sideby unattended --json`, field `attended` (each `sessionId`, `account`, `cwd`, `since`, `until`).
|
|
57
|
+
- Only a prompt the user typed counts: not a background task's notification, not a Message from `sideby send` or another session, not the prompt sideby put on the command line, and not your own tool calls. There is no command to set it, and you must not try to make your own session count: if the user wants questions everywhere, run `sideby unattended off --json`.
|
|
58
|
+
- Typing into a terminal by automation (tmux `send-keys`) looks like a person to Claude Code and counts for that one session. Sessions started before this sideby version, and Codex sessions, do not have it.
|
|
59
|
+
|
|
52
60
|
## When the user is back
|
|
53
61
|
|
|
54
62
|
```sh
|
|
55
|
-
sideby unattended --json # on or off and why, until when, the next Slot, open decisions, coverage
|
|
63
|
+
sideby unattended --json # on or off and why, until when, the next Slot, open decisions, coverage, attended sessions
|
|
56
64
|
sideby unattended pending --json # each question, refused permission or skipped action, with account, session and folder
|
|
57
65
|
sideby unattended pending done <id> --json # or --all, once the user has dealt with them
|
|
58
66
|
```
|