sideby 0.29.0 → 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 +10 -0
- package/dist/src/cli/commands.js +306 -8
- package/dist/src/cli/json-schemas.js +75 -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/messages.js +9 -31
- package/dist/src/core/network.d.ts +5 -2
- package/dist/src/core/network.js +15 -45
- package/dist/src/core/search-catalog.d.ts +1 -1
- package/dist/src/core/search-catalog.js +37 -0
- package/dist/src/core/session-hooks.d.ts +33 -0
- package/dist/src/core/session-hooks.js +92 -0
- 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 +153 -1
- 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/unattended-defer.json +143 -0
- package/schemas/unattended-pending.json +154 -0
- package/schemas/unattended.json +291 -0
- package/skills/sideby/SKILL.md +2 -1
- package/skills/sideby/references/unattended.md +58 -0
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
// Entry for `sideby unattended-hook <family> <event>` (spec §3.37, ADR-0058). Claude Code and Codex run it before the
|
|
2
|
+
// ask tool, and Claude Code also when it is about to ask the user for a permission (`PermissionRequest`), in every
|
|
3
|
+
// session sideby starts once the config has an `unattended` section. It imports only Node built-ins and leaf modules:
|
|
4
|
+
// never the Runtime, a Family index or core/accounts.ts. It reads the Schedule and the manual state on every call, so
|
|
5
|
+
// a session started before a Slot stops asking once the Slot begins.
|
|
6
|
+
//
|
|
7
|
+
// While Unattended Mode is off it does nothing (no output, exit 0). While on, it refuses the Host's ask tool (exit 2,
|
|
8
|
+
// the reason on stderr, which both Hosts hand to the model) and keeps the question as a Pending Decision; and it
|
|
9
|
+
// answers Claude Code's permission requests with a denial (JSON on stdout: Claude Code does not honor exit 2 for that
|
|
10
|
+
// event), keeping the request as a Pending Decision too. A failure before the decision is made does nothing: that is
|
|
11
|
+
// how a session behaves without the feature (unlike `network-hook`, which blocks when it cannot tell). Once the
|
|
12
|
+
// decision is to refuse, it refuses: keeping the Pending Decision and writing the reason are best effort, and their
|
|
13
|
+
// failure neither allows the call nor adds any output of its own.
|
|
14
|
+
import { resolvePaths } from '../core/paths.js';
|
|
15
|
+
import { addPendingDecision } from '../core/unattended-pending.js';
|
|
16
|
+
import { clockText, readUnattendedConfig, readUnattendedOverride, UNATTENDED_ENV, unattendedState, } from '../core/unattended-state.js';
|
|
17
|
+
export const UNATTENDED_HOOK_COMMAND = 'sideby unattended-hook';
|
|
18
|
+
/** The tool each Host's model asks the user with. */
|
|
19
|
+
export const ASK_TOOLS = {
|
|
20
|
+
claude: 'AskUserQuestion',
|
|
21
|
+
codex: 'request_user_input',
|
|
22
|
+
};
|
|
23
|
+
const STDIN_MAX = 8 * 1024 * 1024;
|
|
24
|
+
function prefersChinese(env) {
|
|
25
|
+
return /^zh/i.test(env.LC_ALL || env.LC_MESSAGES || env.LANG || '');
|
|
26
|
+
}
|
|
27
|
+
async function readInput(input) {
|
|
28
|
+
if (typeof input === 'string')
|
|
29
|
+
return input;
|
|
30
|
+
const chunks = [];
|
|
31
|
+
let size = 0;
|
|
32
|
+
for await (const chunk of input) {
|
|
33
|
+
const b = typeof chunk === 'string' ? Buffer.from(chunk) : Buffer.from(chunk);
|
|
34
|
+
size += b.length;
|
|
35
|
+
if (size > STDIN_MAX)
|
|
36
|
+
return '';
|
|
37
|
+
chunks.push(b);
|
|
38
|
+
}
|
|
39
|
+
return Buffer.concat(chunks).toString('utf8');
|
|
40
|
+
}
|
|
41
|
+
const text = (v, max = 4096) => typeof v === 'string' && v.trim() ? v.trim().slice(0, max) : undefined;
|
|
42
|
+
function parsePayload(raw) {
|
|
43
|
+
try {
|
|
44
|
+
const v = JSON.parse(raw);
|
|
45
|
+
if (!v || typeof v !== 'object' || typeof v.tool_name !== 'string')
|
|
46
|
+
return undefined;
|
|
47
|
+
const input = v.tool_input && typeof v.tool_input === 'object' ? v.tool_input : {};
|
|
48
|
+
const sessionId = text(v.session_id, 256);
|
|
49
|
+
const cwd = text(v.cwd);
|
|
50
|
+
// Kept only when plain: anything else from the Host is left out.
|
|
51
|
+
const plain = (x) => (typeof x === 'string' && /^[A-Za-z0-9_.:-]{1,64}$/.test(x) ? x : undefined);
|
|
52
|
+
const agentId = plain(v.agent_id);
|
|
53
|
+
const agentType = plain(v.agent_type);
|
|
54
|
+
return {
|
|
55
|
+
tool: v.tool_name,
|
|
56
|
+
input,
|
|
57
|
+
...(sessionId ? { sessionId } : {}),
|
|
58
|
+
...(cwd ? { cwd } : {}),
|
|
59
|
+
...(agentId ? { agentId } : {}),
|
|
60
|
+
...(agentType ? { agentType } : {}),
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
return undefined;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* The question as the user should read it later: each question (with its short header) and its options' labels.
|
|
69
|
+
* Claude's `AskUserQuestion` and Codex's `request_user_input` both take a `questions` list; anything else is kept as
|
|
70
|
+
* the tool's input.
|
|
71
|
+
*/
|
|
72
|
+
export function questionText(input) {
|
|
73
|
+
const list = Array.isArray(input.questions) ? input.questions : [input];
|
|
74
|
+
const parts = [];
|
|
75
|
+
for (const q of list) {
|
|
76
|
+
if (!q || typeof q !== 'object')
|
|
77
|
+
continue;
|
|
78
|
+
const r = q;
|
|
79
|
+
const question = text(r.question) ?? text(r.prompt) ?? text(r.message);
|
|
80
|
+
const head = [text(r.header, 200), question].filter(Boolean).join(': ');
|
|
81
|
+
const options = (Array.isArray(r.options) ? r.options : [])
|
|
82
|
+
.map((o) => (typeof o === 'string' ? text(o) : text(o?.label)))
|
|
83
|
+
.filter((o) => Boolean(o));
|
|
84
|
+
const lines = [head, ...options.map((o) => `- ${o}`)].filter(Boolean);
|
|
85
|
+
if (lines.length)
|
|
86
|
+
parts.push(lines.join('\n'));
|
|
87
|
+
}
|
|
88
|
+
return parts.join('\n\n') || JSON.stringify(input);
|
|
89
|
+
}
|
|
90
|
+
/** What the model reads instead of an answer. */
|
|
91
|
+
export function questionReason(state, now, zh, kept) {
|
|
92
|
+
const until = state.until ? clockText(Date.parse(state.until), now.getTime(), zh) : undefined;
|
|
93
|
+
const session = state.reason === 'session';
|
|
94
|
+
if (zh) {
|
|
95
|
+
const when = session ? '(这个会话)' : until ? `(到 ${until})` : '(没有结束时间)';
|
|
96
|
+
const keep = kept ? 'sideby 已把这个问题记下,等用户回来看' : 'sideby 没能记下这个问题,请写进最终汇报';
|
|
97
|
+
return `未显示:sideby 无人值守已开启${when},现在没人能回答,${keep}。不要再问。能撤回的选择按推荐的选项继续,在最终汇报里写出这个问题和你的选择。删除、对外发送或发布、部署、付费等难撤回的操作不要做:跳过它,运行 \`sideby unattended defer "<一句话>"\` 记下,再继续做其余的事。`;
|
|
98
|
+
}
|
|
99
|
+
const when = session ? 'for this session' : until ? `until ${until}` : 'with no end set';
|
|
100
|
+
const keep = kept
|
|
101
|
+
? 'sideby kept this question for the user to look at later'
|
|
102
|
+
: 'sideby could not keep this question, so put it in your final report';
|
|
103
|
+
return `Not shown: sideby's Unattended Mode is on ${when}, so nobody is here to answer, and ${keep}. Do not ask again. Where the choice can be undone, go on with the recommended option, and list the question and your choice in your final report. Do not do anything hard to undo (deleting, sending or posting anything outside, publishing, deploying, paying): skip it, record it with \`sideby unattended defer "<one sentence>"\`, and go on with the rest.`;
|
|
104
|
+
}
|
|
105
|
+
/** Tools whose kept summary is the file they work on, and the field it is in. */
|
|
106
|
+
const FILE_TOOLS = {
|
|
107
|
+
Read: 'file_path',
|
|
108
|
+
Write: 'file_path',
|
|
109
|
+
Edit: 'file_path',
|
|
110
|
+
MultiEdit: 'file_path',
|
|
111
|
+
NotebookEdit: 'notebook_path',
|
|
112
|
+
};
|
|
113
|
+
/** Words that run the next word as the command: the program is the word after them (and their options). */
|
|
114
|
+
/** Programs that run another one, each with its options that take a value of their own (`sudo -u root`, `nice -n 10`). */
|
|
115
|
+
const WRAPPERS = {
|
|
116
|
+
sudo: ['-u', '-g', '-C', '-h', '-p', '-U', '-r', '-t', '-T', '-D', '--user', '--group'],
|
|
117
|
+
doas: ['-u', '-C'],
|
|
118
|
+
env: ['-u', '-C', '-P', '--unset', '--chdir'],
|
|
119
|
+
nice: ['-n', '--adjustment'],
|
|
120
|
+
time: ['-f', '-o', '--format', '--output'],
|
|
121
|
+
exec: ['-a'],
|
|
122
|
+
command: [],
|
|
123
|
+
builtin: [],
|
|
124
|
+
nohup: [],
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* The program a command runs, by its file name only: the first word after `NAME=value` settings and wrappers such as
|
|
128
|
+
* `sudo` and `env`. Undefined when it cannot be told plainly (a quote, a variable, a subshell, anything but a name).
|
|
129
|
+
* Nothing else of the command is kept: its arguments can hold a token in any form.
|
|
130
|
+
*/
|
|
131
|
+
export function commandProgram(command) {
|
|
132
|
+
const words = command.trim().split(/\s+/);
|
|
133
|
+
let i = 0;
|
|
134
|
+
let wrapper;
|
|
135
|
+
while (i < words.length) {
|
|
136
|
+
const w = words[i];
|
|
137
|
+
if (/^[A-Za-z_][A-Za-z0-9_]*=/.test(w)) {
|
|
138
|
+
// A setting before the command; a quoted value may hold spaces, which leaves the rest unclear.
|
|
139
|
+
if (/^[A-Za-z_][A-Za-z0-9_]*=["']/.test(w))
|
|
140
|
+
return undefined;
|
|
141
|
+
i++;
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
if (wrapper && w.startsWith('-')) {
|
|
145
|
+
i += wrapper.includes(w) ? 2 : 1;
|
|
146
|
+
continue;
|
|
147
|
+
}
|
|
148
|
+
const name = w.slice(w.lastIndexOf('/') + 1);
|
|
149
|
+
if (!/^[A-Za-z0-9][A-Za-z0-9._+-]{0,63}$/.test(name))
|
|
150
|
+
return undefined;
|
|
151
|
+
if (Object.hasOwn(WRAPPERS, name)) {
|
|
152
|
+
wrapper = WRAPPERS[name];
|
|
153
|
+
i++;
|
|
154
|
+
continue;
|
|
155
|
+
}
|
|
156
|
+
return name;
|
|
157
|
+
}
|
|
158
|
+
return undefined;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* What a refused permission request is kept as, from a short list of fields per tool and never the whole input (an
|
|
162
|
+
* MCP tool's input can carry a header with a token): for Bash the program alone and the model's own description of
|
|
163
|
+
* the command, never its arguments (the whole command stays in the session's own record, reached through "back to
|
|
164
|
+
* the session"); the file of Read, Write, Edit, MultiEdit and NotebookEdit; the host WebFetch was to open; for any
|
|
165
|
+
* other tool its name only.
|
|
166
|
+
*/
|
|
167
|
+
export function permissionText(tool, input) {
|
|
168
|
+
if (tool === 'Bash') {
|
|
169
|
+
const command = text(input.command);
|
|
170
|
+
const program = command ? commandProgram(command) : undefined;
|
|
171
|
+
const about = text(input.description, 500);
|
|
172
|
+
return `${program ? `${tool}: ${program}` : tool}${about ? `\n(${about})` : ''}`;
|
|
173
|
+
}
|
|
174
|
+
const field = FILE_TOOLS[tool];
|
|
175
|
+
if (field) {
|
|
176
|
+
const file = text(input[field]);
|
|
177
|
+
return file ? `${tool}: ${file}` : tool;
|
|
178
|
+
}
|
|
179
|
+
if (tool === 'WebFetch') {
|
|
180
|
+
const url = text(input.url);
|
|
181
|
+
try {
|
|
182
|
+
return url ? `${tool}: ${new URL(url).hostname}` : tool;
|
|
183
|
+
}
|
|
184
|
+
catch {
|
|
185
|
+
return tool;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
return tool;
|
|
189
|
+
}
|
|
190
|
+
/** What the model reads instead of the permission prompt Claude Code would have shown. */
|
|
191
|
+
export function permissionReason(state, now, kept) {
|
|
192
|
+
const until = state.until ? clockText(Date.parse(state.until), now.getTime(), false) : undefined;
|
|
193
|
+
const when = state.reason === 'session' ? 'for this session' : until ? `until ${until}` : 'with no end set';
|
|
194
|
+
const keep = kept ? ' sideby kept this request for the user to look at later.' : '';
|
|
195
|
+
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.`;
|
|
196
|
+
}
|
|
197
|
+
/** What to do with this call: undefined allows it. Any error here allows it too (the caller catches it). */
|
|
198
|
+
async function decide(argv, env, input, now) {
|
|
199
|
+
const [family = '', event = ''] = argv;
|
|
200
|
+
const askTool = ASK_TOOLS[family];
|
|
201
|
+
const permission = family === 'claude' && event === 'PermissionRequest';
|
|
202
|
+
if (!permission && (event !== 'PreToolUse' || !askTool))
|
|
203
|
+
return undefined;
|
|
204
|
+
const paths = resolvePaths(env);
|
|
205
|
+
const { schedule } = await readUnattendedConfig(paths.configFile);
|
|
206
|
+
const override = await readUnattendedOverride(paths.stateDir);
|
|
207
|
+
const state = unattendedState({ schedule, override, now, session: env[UNATTENDED_ENV] === '1' });
|
|
208
|
+
if (!state.on)
|
|
209
|
+
return undefined;
|
|
210
|
+
const payload = parsePayload(await readInput(input));
|
|
211
|
+
if (!payload)
|
|
212
|
+
return undefined;
|
|
213
|
+
const zh = prefersChinese(env);
|
|
214
|
+
const account = text(env.SIDEBY_ACCOUNT, 256);
|
|
215
|
+
if (permission)
|
|
216
|
+
return {
|
|
217
|
+
json: true,
|
|
218
|
+
reason: (kept) => permissionReason(state, now, kept),
|
|
219
|
+
keep: () => addPendingDecision(paths.stateDir, {
|
|
220
|
+
kind: 'permission',
|
|
221
|
+
family,
|
|
222
|
+
...(account ? { account } : {}),
|
|
223
|
+
...(payload.sessionId ? { sessionId: payload.sessionId } : {}),
|
|
224
|
+
...(payload.cwd ? { cwd: payload.cwd } : {}),
|
|
225
|
+
...(payload.agentId ? { agentId: payload.agentId } : {}),
|
|
226
|
+
...(payload.agentType ? { agentType: payload.agentType } : {}),
|
|
227
|
+
text: permissionText(payload.tool, payload.input),
|
|
228
|
+
}, now, { dedupe: true }),
|
|
229
|
+
};
|
|
230
|
+
if (payload.tool === askTool) {
|
|
231
|
+
const question = questionText(payload.input);
|
|
232
|
+
return {
|
|
233
|
+
reason: (kept) => questionReason(state, now, zh, kept),
|
|
234
|
+
keep: () => addPendingDecision(paths.stateDir, {
|
|
235
|
+
kind: 'question',
|
|
236
|
+
family,
|
|
237
|
+
...(account ? { account } : {}),
|
|
238
|
+
...(payload.sessionId ? { sessionId: payload.sessionId } : {}),
|
|
239
|
+
...(payload.cwd ? { cwd: payload.cwd } : {}),
|
|
240
|
+
text: question,
|
|
241
|
+
}, now, { dedupe: true }),
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
return undefined;
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Returns the exit code: 0 lets the Host go on, 2 refuses the tool call (the reason is written to `err`). A permission
|
|
248
|
+
* request is refused with exit 0 and the decision written to `out`. Errors before the decision write nothing and
|
|
249
|
+
* exit 0; once it is a refusal, it is answered as one whatever happens to the record.
|
|
250
|
+
*/
|
|
251
|
+
export async function runUnattendedHook(argv, env, input, io, deps = {}) {
|
|
252
|
+
let refusal;
|
|
253
|
+
const now = deps.now ? deps.now() : new Date();
|
|
254
|
+
try {
|
|
255
|
+
refusal = await decide(argv, env, input, now);
|
|
256
|
+
}
|
|
257
|
+
catch {
|
|
258
|
+
return 0;
|
|
259
|
+
}
|
|
260
|
+
if (!refusal)
|
|
261
|
+
return 0;
|
|
262
|
+
let kept = true;
|
|
263
|
+
if (refusal.keep)
|
|
264
|
+
try {
|
|
265
|
+
await refusal.keep();
|
|
266
|
+
}
|
|
267
|
+
catch {
|
|
268
|
+
// Best effort: the reason then asks for the question in the final report instead.
|
|
269
|
+
kept = false;
|
|
270
|
+
}
|
|
271
|
+
if (refusal.json) {
|
|
272
|
+
const decision = { behavior: 'deny', message: refusal.reason(kept) };
|
|
273
|
+
try {
|
|
274
|
+
io.out.write(`${JSON.stringify({ hookSpecificOutput: { hookEventName: 'PermissionRequest', decision } })}\n`);
|
|
275
|
+
}
|
|
276
|
+
catch {
|
|
277
|
+
// Nothing reached Claude Code: it shows its prompt as it would without this hook.
|
|
278
|
+
}
|
|
279
|
+
return 0;
|
|
280
|
+
}
|
|
281
|
+
try {
|
|
282
|
+
io.err.write(`${refusal.reason(kept)}\n`);
|
|
283
|
+
}
|
|
284
|
+
catch {
|
|
285
|
+
// The Host still sees exit 2 and refuses the call.
|
|
286
|
+
}
|
|
287
|
+
return 2;
|
|
288
|
+
}
|
package/package.json
CHANGED
package/schemas/config.json
CHANGED
|
@@ -388,6 +388,82 @@
|
|
|
388
388
|
"additionalProperties": false,
|
|
389
389
|
"description": "Network Guard (spec §3.35, ADR-0053)."
|
|
390
390
|
},
|
|
391
|
+
"unattended": {
|
|
392
|
+
"type": "object",
|
|
393
|
+
"properties": {
|
|
394
|
+
"schedule": {
|
|
395
|
+
"type": "array",
|
|
396
|
+
"items": {
|
|
397
|
+
"type": "object",
|
|
398
|
+
"required": [
|
|
399
|
+
"days",
|
|
400
|
+
"start",
|
|
401
|
+
"end"
|
|
402
|
+
],
|
|
403
|
+
"properties": {
|
|
404
|
+
"name": {
|
|
405
|
+
"type": "string",
|
|
406
|
+
"minLength": 1,
|
|
407
|
+
"maxLength": 60,
|
|
408
|
+
"description": "What the Slot is called."
|
|
409
|
+
},
|
|
410
|
+
"days": {
|
|
411
|
+
"type": "array",
|
|
412
|
+
"items": {
|
|
413
|
+
"anyOf": [
|
|
414
|
+
{
|
|
415
|
+
"type": "string",
|
|
416
|
+
"const": "mon"
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
"type": "string",
|
|
420
|
+
"const": "tue"
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
"type": "string",
|
|
424
|
+
"const": "wed"
|
|
425
|
+
},
|
|
426
|
+
{
|
|
427
|
+
"type": "string",
|
|
428
|
+
"const": "thu"
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
"type": "string",
|
|
432
|
+
"const": "fri"
|
|
433
|
+
},
|
|
434
|
+
{
|
|
435
|
+
"type": "string",
|
|
436
|
+
"const": "sat"
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
"type": "string",
|
|
440
|
+
"const": "sun"
|
|
441
|
+
}
|
|
442
|
+
]
|
|
443
|
+
},
|
|
444
|
+
"minItems": 1,
|
|
445
|
+
"uniqueItems": true,
|
|
446
|
+
"description": "The days it starts on."
|
|
447
|
+
},
|
|
448
|
+
"start": {
|
|
449
|
+
"type": "string",
|
|
450
|
+
"pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$",
|
|
451
|
+
"description": "When it starts, `HH:MM` in 24-hour local time."
|
|
452
|
+
},
|
|
453
|
+
"end": {
|
|
454
|
+
"type": "string",
|
|
455
|
+
"pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$",
|
|
456
|
+
"description": "When it ends, `HH:MM`. An end before the start is the next day; an end equal to the start lasts the whole day."
|
|
457
|
+
}
|
|
458
|
+
},
|
|
459
|
+
"additionalProperties": false
|
|
460
|
+
},
|
|
461
|
+
"description": "Slots that turn Unattended Mode on and off by themselves, in this computer's time zone. Empty by default."
|
|
462
|
+
}
|
|
463
|
+
},
|
|
464
|
+
"additionalProperties": false,
|
|
465
|
+
"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."
|
|
466
|
+
},
|
|
391
467
|
"browser": {
|
|
392
468
|
"type": "object",
|
|
393
469
|
"properties": {
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "sideby/unattended-defer.json",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"required": [
|
|
6
|
+
"schemaVersion",
|
|
7
|
+
"decision"
|
|
8
|
+
],
|
|
9
|
+
"properties": {
|
|
10
|
+
"schemaVersion": {
|
|
11
|
+
"type": "number",
|
|
12
|
+
"const": 1
|
|
13
|
+
},
|
|
14
|
+
"decision": {
|
|
15
|
+
"type": "object",
|
|
16
|
+
"required": [
|
|
17
|
+
"id",
|
|
18
|
+
"at",
|
|
19
|
+
"kind",
|
|
20
|
+
"family",
|
|
21
|
+
"text"
|
|
22
|
+
],
|
|
23
|
+
"properties": {
|
|
24
|
+
"id": {
|
|
25
|
+
"type": "string"
|
|
26
|
+
},
|
|
27
|
+
"at": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"description": "When it was kept; ISO."
|
|
30
|
+
},
|
|
31
|
+
"kind": {
|
|
32
|
+
"anyOf": [
|
|
33
|
+
{
|
|
34
|
+
"type": "string",
|
|
35
|
+
"const": "question"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"type": "string",
|
|
39
|
+
"const": "permission"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"type": "string",
|
|
43
|
+
"const": "deferred"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"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`."
|
|
47
|
+
},
|
|
48
|
+
"family": {
|
|
49
|
+
"type": "string"
|
|
50
|
+
},
|
|
51
|
+
"account": {
|
|
52
|
+
"type": "string",
|
|
53
|
+
"description": "The account the session ran as."
|
|
54
|
+
},
|
|
55
|
+
"sessionId": {
|
|
56
|
+
"type": "string"
|
|
57
|
+
},
|
|
58
|
+
"cwd": {
|
|
59
|
+
"type": "string"
|
|
60
|
+
},
|
|
61
|
+
"agentId": {
|
|
62
|
+
"type": "string",
|
|
63
|
+
"description": "The subagent a permission request came from."
|
|
64
|
+
},
|
|
65
|
+
"agentType": {
|
|
66
|
+
"type": "string",
|
|
67
|
+
"description": "Its type, such as `general-purpose`."
|
|
68
|
+
},
|
|
69
|
+
"text": {
|
|
70
|
+
"type": "string",
|
|
71
|
+
"description": "The question and its options, the tool and what it was to do, or the deferred text; at most 4000 characters."
|
|
72
|
+
},
|
|
73
|
+
"doneAt": {
|
|
74
|
+
"type": "string",
|
|
75
|
+
"description": "When it was marked done; ISO."
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"_notice": {
|
|
80
|
+
"type": "object",
|
|
81
|
+
"properties": {
|
|
82
|
+
"update": {
|
|
83
|
+
"type": "object",
|
|
84
|
+
"required": [
|
|
85
|
+
"current",
|
|
86
|
+
"latest",
|
|
87
|
+
"command",
|
|
88
|
+
"message"
|
|
89
|
+
],
|
|
90
|
+
"properties": {
|
|
91
|
+
"current": {
|
|
92
|
+
"type": "string"
|
|
93
|
+
},
|
|
94
|
+
"latest": {
|
|
95
|
+
"type": "string"
|
|
96
|
+
},
|
|
97
|
+
"command": {
|
|
98
|
+
"type": "string",
|
|
99
|
+
"description": "Run it after the user agrees: it shows the plan and exits 10; then --yes."
|
|
100
|
+
},
|
|
101
|
+
"message": {
|
|
102
|
+
"type": "string"
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"skill": {
|
|
107
|
+
"type": "object",
|
|
108
|
+
"required": [
|
|
109
|
+
"installed",
|
|
110
|
+
"current",
|
|
111
|
+
"command",
|
|
112
|
+
"message"
|
|
113
|
+
],
|
|
114
|
+
"properties": {
|
|
115
|
+
"installed": {
|
|
116
|
+
"anyOf": [
|
|
117
|
+
{
|
|
118
|
+
"type": "string"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"type": "null"
|
|
122
|
+
}
|
|
123
|
+
],
|
|
124
|
+
"description": "The skill's version; null when it has none."
|
|
125
|
+
},
|
|
126
|
+
"current": {
|
|
127
|
+
"type": "string"
|
|
128
|
+
},
|
|
129
|
+
"command": {
|
|
130
|
+
"type": "string",
|
|
131
|
+
"description": "`sideby update`, which updates the skill with sideby: run it after the user agrees; it shows the plan and exits 10, then --yes."
|
|
132
|
+
},
|
|
133
|
+
"message": {
|
|
134
|
+
"type": "string"
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
"description": "Not the answer to the task: mention it briefly afterwards and offer to update."
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
"title": "sideby unattended defer \"<text>\" --json"
|
|
143
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "sideby/unattended-pending.json",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"required": [
|
|
6
|
+
"schemaVersion",
|
|
7
|
+
"pending"
|
|
8
|
+
],
|
|
9
|
+
"properties": {
|
|
10
|
+
"schemaVersion": {
|
|
11
|
+
"type": "number",
|
|
12
|
+
"const": 1
|
|
13
|
+
},
|
|
14
|
+
"pending": {
|
|
15
|
+
"type": "array",
|
|
16
|
+
"items": {
|
|
17
|
+
"type": "object",
|
|
18
|
+
"required": [
|
|
19
|
+
"id",
|
|
20
|
+
"at",
|
|
21
|
+
"kind",
|
|
22
|
+
"family",
|
|
23
|
+
"text"
|
|
24
|
+
],
|
|
25
|
+
"properties": {
|
|
26
|
+
"id": {
|
|
27
|
+
"type": "string"
|
|
28
|
+
},
|
|
29
|
+
"at": {
|
|
30
|
+
"type": "string",
|
|
31
|
+
"description": "When it was kept; ISO."
|
|
32
|
+
},
|
|
33
|
+
"kind": {
|
|
34
|
+
"anyOf": [
|
|
35
|
+
{
|
|
36
|
+
"type": "string",
|
|
37
|
+
"const": "question"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"type": "string",
|
|
41
|
+
"const": "permission"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"type": "string",
|
|
45
|
+
"const": "deferred"
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
"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`."
|
|
49
|
+
},
|
|
50
|
+
"family": {
|
|
51
|
+
"type": "string"
|
|
52
|
+
},
|
|
53
|
+
"account": {
|
|
54
|
+
"type": "string",
|
|
55
|
+
"description": "The account the session ran as."
|
|
56
|
+
},
|
|
57
|
+
"sessionId": {
|
|
58
|
+
"type": "string"
|
|
59
|
+
},
|
|
60
|
+
"cwd": {
|
|
61
|
+
"type": "string"
|
|
62
|
+
},
|
|
63
|
+
"agentId": {
|
|
64
|
+
"type": "string",
|
|
65
|
+
"description": "The subagent a permission request came from."
|
|
66
|
+
},
|
|
67
|
+
"agentType": {
|
|
68
|
+
"type": "string",
|
|
69
|
+
"description": "Its type, such as `general-purpose`."
|
|
70
|
+
},
|
|
71
|
+
"text": {
|
|
72
|
+
"type": "string",
|
|
73
|
+
"description": "The question and its options, the tool and what it was to do, or the deferred text; at most 4000 characters."
|
|
74
|
+
},
|
|
75
|
+
"doneAt": {
|
|
76
|
+
"type": "string",
|
|
77
|
+
"description": "When it was marked done; ISO."
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"description": "Open Pending Decisions, oldest first; with --all the done ones too."
|
|
82
|
+
},
|
|
83
|
+
"done": {
|
|
84
|
+
"type": "array",
|
|
85
|
+
"items": {
|
|
86
|
+
"type": "string"
|
|
87
|
+
},
|
|
88
|
+
"description": "`pending done`: the ids marked done."
|
|
89
|
+
},
|
|
90
|
+
"_notice": {
|
|
91
|
+
"type": "object",
|
|
92
|
+
"properties": {
|
|
93
|
+
"update": {
|
|
94
|
+
"type": "object",
|
|
95
|
+
"required": [
|
|
96
|
+
"current",
|
|
97
|
+
"latest",
|
|
98
|
+
"command",
|
|
99
|
+
"message"
|
|
100
|
+
],
|
|
101
|
+
"properties": {
|
|
102
|
+
"current": {
|
|
103
|
+
"type": "string"
|
|
104
|
+
},
|
|
105
|
+
"latest": {
|
|
106
|
+
"type": "string"
|
|
107
|
+
},
|
|
108
|
+
"command": {
|
|
109
|
+
"type": "string",
|
|
110
|
+
"description": "Run it after the user agrees: it shows the plan and exits 10; then --yes."
|
|
111
|
+
},
|
|
112
|
+
"message": {
|
|
113
|
+
"type": "string"
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
"skill": {
|
|
118
|
+
"type": "object",
|
|
119
|
+
"required": [
|
|
120
|
+
"installed",
|
|
121
|
+
"current",
|
|
122
|
+
"command",
|
|
123
|
+
"message"
|
|
124
|
+
],
|
|
125
|
+
"properties": {
|
|
126
|
+
"installed": {
|
|
127
|
+
"anyOf": [
|
|
128
|
+
{
|
|
129
|
+
"type": "string"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"type": "null"
|
|
133
|
+
}
|
|
134
|
+
],
|
|
135
|
+
"description": "The skill's version; null when it has none."
|
|
136
|
+
},
|
|
137
|
+
"current": {
|
|
138
|
+
"type": "string"
|
|
139
|
+
},
|
|
140
|
+
"command": {
|
|
141
|
+
"type": "string",
|
|
142
|
+
"description": "`sideby update`, which updates the skill with sideby: run it after the user agrees; it shows the plan and exits 10, then --yes."
|
|
143
|
+
},
|
|
144
|
+
"message": {
|
|
145
|
+
"type": "string"
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
"description": "Not the answer to the task: mention it briefly afterwards and offer to update."
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
"title": "sideby unattended pending [done <id>|--all] --json"
|
|
154
|
+
}
|