sideby 0.17.0 → 0.19.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/README.md +11 -1
- package/ai-tasks.json +90 -0
- package/dist/build.json +1 -1
- package/dist/src/cli/commands.d.ts +9 -1
- package/dist/src/cli/commands.js +507 -26
- package/dist/src/cli/json-schemas.js +196 -19
- package/dist/src/cli/main.js +79 -13
- package/dist/src/core/after-install.d.ts +54 -0
- package/dist/src/core/after-install.js +78 -0
- package/dist/src/core/ask.d.ts +87 -1
- package/dist/src/core/ask.js +122 -7
- package/dist/src/core/autostart.d.ts +38 -8
- package/dist/src/core/autostart.js +85 -39
- package/dist/src/core/brand-mark.d.ts +49 -11
- package/dist/src/core/brand-mark.js +116 -38
- package/dist/src/core/browser-profiles.js +7 -32
- package/dist/src/core/config.d.ts +19 -0
- package/dist/src/core/config.js +75 -2
- package/dist/src/core/desktop-app.d.ts +1 -1
- package/dist/src/core/desktop-app.js +2 -2
- package/dist/src/core/edit-settings.d.ts +24 -0
- package/dist/src/core/edit-settings.js +97 -0
- package/dist/src/core/handoff-brief.d.ts +4 -2
- package/dist/src/core/handoff-brief.js +6 -1
- package/dist/src/core/handoff-chain.d.ts +24 -0
- package/dist/src/core/handoff-chain.js +2 -0
- package/dist/src/core/handoff-run.d.ts +4 -3
- package/dist/src/core/handoff-run.js +14 -9
- package/dist/src/core/launch.d.ts +2 -0
- package/dist/src/core/launch.js +14 -10
- package/dist/src/core/local-build.d.ts +12 -5
- package/dist/src/core/local-build.js +49 -31
- package/dist/src/core/lock.d.ts +30 -0
- package/dist/src/core/lock.js +143 -0
- package/dist/src/core/pick-commands.d.ts +42 -0
- package/dist/src/core/pick-commands.js +44 -0
- package/dist/src/core/quota-levels.d.ts +6 -1
- package/dist/src/core/quota-levels.js +16 -5
- package/dist/src/core/shell-init.js +3 -1
- package/dist/src/core/shell-setup.d.ts +40 -0
- package/dist/src/core/shell-setup.js +54 -0
- package/dist/src/core/skill-check.d.ts +2 -0
- package/dist/src/core/skill-check.js +2 -0
- package/dist/src/core/task-spec.d.ts +95 -0
- package/dist/src/core/task-spec.js +209 -0
- package/dist/src/core/terminal.d.ts +21 -4
- package/dist/src/core/terminal.js +155 -10
- package/dist/src/core/update.d.ts +27 -16
- package/dist/src/core/update.js +69 -95
- package/dist/src/core/windows-dirs.d.ts +19 -0
- package/dist/src/core/windows-dirs.js +39 -0
- package/dist/src/desktop/icon.js +12 -15
- package/dist/src/families/claude/ai-task.d.ts +8 -0
- package/dist/src/families/claude/ai-task.js +38 -0
- package/dist/src/families/claude/handoff-hook.js +4 -4
- package/dist/src/families/claude/index.js +3 -0
- package/dist/src/families/codex/handoff-hook.js +4 -4
- package/dist/src/families/codex/index.js +9 -0
- package/dist/src/families/grok/handoff-hook.js +4 -4
- package/dist/src/families/grok/index.js +1 -0
- package/dist/src/families/pi/index.js +1 -0
- package/dist/src/handoff/hook.js +51 -30
- package/dist/src/handoff/levels.d.ts +24 -0
- package/dist/src/handoff/levels.js +70 -0
- package/dist/src/handoff/messages.d.ts +6 -3
- package/dist/src/handoff/messages.js +20 -7
- package/dist/src/handoff/reader.d.ts +6 -3
- package/dist/src/menubar/agent.d.ts +3 -0
- package/dist/src/menubar/agent.js +21 -0
- package/dist/src/menubar/script.d.ts +8 -0
- package/dist/src/menubar/script.js +457 -0
- package/dist/src/menubar/snapshot.d.ts +115 -0
- package/dist/src/menubar/snapshot.js +255 -0
- package/dist/src/menubar/strings.d.ts +87 -0
- package/dist/src/menubar/strings.js +88 -0
- package/dist/src/panel/background.js +12 -19
- package/dist/src/panel/handler.d.ts +30 -0
- package/dist/src/panel/handler.js +148 -80
- package/dist/src/panel/i18n.d.ts +72 -0
- package/dist/src/panel/i18n.js +144 -0
- package/dist/src/panel/page-logic.d.ts +105 -0
- package/dist/src/panel/page-logic.js +170 -15
- package/dist/src/panel/page-script.js +419 -111
- package/dist/src/panel/page-styles.js +45 -13
- package/dist/src/panel/page.d.ts +7 -0
- package/dist/src/panel/page.js +11 -1
- package/dist/src/runtime.d.ts +44 -2
- package/dist/src/runtime.js +107 -6
- package/dist/src/types.d.ts +14 -0
- package/package.json +4 -3
- package/schemas/alias-list.json +119 -0
- package/schemas/alias.json +27 -1
- package/schemas/ask-choices.json +168 -0
- package/schemas/ask-print.json +87 -0
- package/schemas/config.json +28 -1
- package/schemas/edit.json +119 -0
- package/schemas/error.json +4 -0
- package/schemas/families.json +4 -0
- package/schemas/list.json +4 -0
- package/schemas/local.json +1 -1
- package/schemas/menubar-snapshot.json +646 -0
- package/schemas/menubar-start.json +112 -0
- package/schemas/menubar.json +165 -0
- package/schemas/new.json +19 -0
- package/schemas/shell-init-setup.json +124 -0
- package/skills/sideby/SKILL.md +11 -4
- package/skills/sideby/references/accounts.md +10 -0
- package/skills/sideby/references/ai-tasks.md +10 -0
- package/skills/sideby/references/handoff.md +3 -1
- package/skills/sideby/references/panel.md +6 -0
- package/skills/sideby/references/setup.md +1 -1
- package/skills/sideby/references/update.md +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Env } from '../types.ts';
|
|
2
2
|
import type { Paths } from './paths.ts';
|
|
3
|
+
export { isZombieStat } from './lock.ts';
|
|
3
4
|
export declare const DEFAULT_REGISTRY = "https://registry.npmjs.org";
|
|
4
5
|
export declare const CHECK_INTERVAL_MS: number;
|
|
5
6
|
export declare const NOTICE_INTERVAL_MS: number;
|
|
@@ -66,8 +67,6 @@ export interface InstallMethod {
|
|
|
66
67
|
/** npm only: the prefix whose `lib/node_modules` holds sideby. */
|
|
67
68
|
prefix?: string;
|
|
68
69
|
}
|
|
69
|
-
/** Whether a Linux `/proc/<pid>/stat` line is of a zombie: the state after the parenthesised command name is `Z`. */
|
|
70
|
-
export declare function isZombieStat(stat: string): boolean;
|
|
71
70
|
/** Swapped in tests through `bindUpdateDeps`; the real machine otherwise. */
|
|
72
71
|
/**
|
|
73
72
|
* Whether `sideby autostart --refresh --json` rewrote the login item: it exits 0 also when nothing changed or the
|
|
@@ -97,19 +96,22 @@ export interface UpdateDeps {
|
|
|
97
96
|
appInstalled: (home: string, env: Env) => Promise<boolean>;
|
|
98
97
|
/** Runs `sideby app install --json` from the newly installed code and waits; false when it failed. */
|
|
99
98
|
refreshApp: (env: Env) => Promise<boolean>;
|
|
100
|
-
/**
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
99
|
+
/**
|
|
100
|
+
* Whether `sideby autostart on` (or `sideby menubar on`, ADR-0034) put its login item in this home (its file carries
|
|
101
|
+
* the sideby marker).
|
|
102
|
+
*/
|
|
103
|
+
autostartInstalled: (home: string, command?: LoginItemCommand) => Promise<boolean>;
|
|
104
|
+
/** Runs `sideby <command> --refresh --json` from the newly installed code and waits; false when it failed. */
|
|
105
|
+
refreshAutostart: (env: Env, command?: LoginItemCommand) => Promise<boolean>;
|
|
104
106
|
}
|
|
107
|
+
/** The commands whose login item records the sideby it starts. */
|
|
108
|
+
export type LoginItemCommand = 'autostart' | 'menubar';
|
|
105
109
|
/** Internal, for tests: replaces parts of the machine. Not part of the plugin or Portal contract. */
|
|
106
110
|
export declare function bindUpdateDeps(deps: Partial<UpdateDeps>): () => void;
|
|
107
111
|
/** Runs a program through the swappable machine (tests bind `exec`); a Local Build switch installs with it. */
|
|
108
112
|
export declare const runProgram: UpdateDeps['exec'];
|
|
109
|
-
/**
|
|
110
|
-
export declare const
|
|
111
|
-
/** Starts a program detached through the swappable machine; see `UpdateDeps.startDetached`. */
|
|
112
|
-
export declare const startDetached: (file: string, args: readonly string[], env: Env) => Promise<boolean>;
|
|
113
|
+
/** The machine in use: the real one, or the parts tests bound. Internal, for after-install.ts and local-build.ts. */
|
|
114
|
+
export declare const updateMachine: () => UpdateDeps;
|
|
113
115
|
/** The lock every install shares (`update-install.lock`), so a Local Build switch never races an Update. */
|
|
114
116
|
export declare const takeInstallLock: (paths: Paths) => Promise<(() => Promise<void>) | null>;
|
|
115
117
|
/** -1, 0 or 1 like a sort comparator; a prerelease sorts before its release. Null when either is not a version. */
|
|
@@ -292,6 +294,11 @@ export interface SkillUpdatePlan {
|
|
|
292
294
|
export declare function skillUpdatePlan(home: string, target: string): Promise<SkillUpdatePlan | null>;
|
|
293
295
|
/** Asks the registry now (whatever the switches say: the user asked) and returns what an Update would do. */
|
|
294
296
|
export declare function planUpdate(paths: Paths, env: Env): Promise<UpdatePlan>;
|
|
297
|
+
/**
|
|
298
|
+
* The plan of `sideby update --skill`: the installed skill toward this version, never the CLI. Asks no registry: what
|
|
299
|
+
* it says of a newer CLI comes from the last Update Check.
|
|
300
|
+
*/
|
|
301
|
+
export declare function planSkillUpdate(paths: Paths, env: Env): Promise<UpdatePlan>;
|
|
295
302
|
/** Updates the installed sideby skill when the plan says it is outdated and sideby may; null when it did nothing. */
|
|
296
303
|
export declare function applySkillUpdate(plan: SkillUpdatePlan | undefined, env: Env, onOutput?: (text: string) => void): Promise<{
|
|
297
304
|
ok: boolean;
|
|
@@ -323,17 +330,22 @@ export interface UpdateResult {
|
|
|
323
330
|
/** The installed sideby skill was updated too (true), or that failed (false); absent when it was not tried. */
|
|
324
331
|
skillUpdated?: boolean;
|
|
325
332
|
skillMessage?: string;
|
|
333
|
+
/** With `skillSync: 'background'`: the `sideby update --skill --yes` that updates the skill started on its own. */
|
|
334
|
+
skillSyncStarted?: boolean;
|
|
326
335
|
}
|
|
327
336
|
/**
|
|
328
|
-
* Runs the Update the plan names, then
|
|
329
|
-
*
|
|
330
|
-
* shown the plan and got a confirmation (or this is an Auto Update). One
|
|
331
|
-
* CLI, a Panel and an Auto Update share the lock). `panelPort` gives the
|
|
332
|
-
* null when none runs. A successful Update is recorded as said, so no
|
|
337
|
+
* Runs the Update the plan names, then what follows an install (after-install.ts): the desktop app and the login item
|
|
338
|
+
* are written again from the new code where installed, the skill follows, and a running background Panel starts again
|
|
339
|
+
* from the new code, last. The caller has shown the plan and got a confirmation (or this is an Auto Update). One
|
|
340
|
+
* Update runs at a time on this machine (the CLI, a Panel and an Auto Update share the lock). `panelPort` gives the
|
|
341
|
+
* port of the background Panel to restart, or null when none runs. A successful Update is recorded as said, so no
|
|
342
|
+
* notice for it follows.
|
|
333
343
|
*/
|
|
334
344
|
export declare function applyUpdate(paths: Paths, plan: UpdatePlan, env: Env, opts?: {
|
|
335
345
|
onOutput?: (text: string) => void;
|
|
336
346
|
panelPort?: () => Promise<number | null>;
|
|
347
|
+
/** `background` (the Panel): the new code updates the skill on its own; see `AfterInstallOptions.skillSync`. */
|
|
348
|
+
skillSync?: 'wait' | 'background';
|
|
337
349
|
}): Promise<UpdateResult>;
|
|
338
350
|
/** What keeps an Auto Update from installing `plan` until the user acts (an install it cannot update, a major version). */
|
|
339
351
|
export declare function lastingBlocker(plan: UpdatePlan): string | null;
|
|
@@ -347,4 +359,3 @@ export declare function autoUpdateBlocker(paths: Paths, plan: UpdatePlan): Promi
|
|
|
347
359
|
* `update.auto` is on and nothing blocks it. Only one runs at a time; it never throws.
|
|
348
360
|
*/
|
|
349
361
|
export declare function backgroundCheck(paths: Paths, env: Env, config: UpdateSettings, panelPort: () => Promise<number | null>): Promise<void>;
|
|
350
|
-
export {};
|
package/dist/src/core/update.js
CHANGED
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
// only network request sideby makes on its own: one GET for the `latest` dist-tag, carrying nothing about the user.
|
|
3
3
|
// Everything it learns goes to one state file shared by the CLI and every Panel.
|
|
4
4
|
import { spawn } from 'node:child_process';
|
|
5
|
-
import {
|
|
6
|
-
import { access, constants, mkdir, open, readdir, readFile, realpath, rm, stat } from 'node:fs/promises';
|
|
5
|
+
import { access, constants, mkdir, readdir, readFile, realpath, rm } from 'node:fs/promises';
|
|
7
6
|
import { dirname, join, sep } from 'node:path';
|
|
8
7
|
import { fileURLToPath } from 'node:url';
|
|
8
|
+
import { afterInstall, runSkillUpdate } from './after-install.js';
|
|
9
9
|
import { writeFileAtomic } from './fs-safe.js';
|
|
10
|
-
import {
|
|
10
|
+
import { processAlive, takeFileLock } from './lock.js';
|
|
11
|
+
import { installedSkills, REPO_URL, SKILL_UPDATE, SKILL_UPDATE_SHOWN, skillOwnerRepo } from './skill-check.js';
|
|
11
12
|
import { localBuild, packageVersion, parseLocalBuild } from './version.js';
|
|
13
|
+
export { isZombieStat } from './lock.js';
|
|
12
14
|
export const DEFAULT_REGISTRY = 'https://registry.npmjs.org';
|
|
13
15
|
export const CHECK_INTERVAL_MS = 24 * 60 * 60 * 1000;
|
|
14
16
|
export const NOTICE_INTERVAL_MS = 24 * 60 * 60 * 1000;
|
|
@@ -17,11 +19,7 @@ export const RETRY_INTERVAL_MS = 60 * 60 * 1000;
|
|
|
17
19
|
/** A failed Auto Update of one version is tried again after this long (a mirror may not have it yet). */
|
|
18
20
|
export const AUTO_RETRY_MS = 24 * 60 * 60 * 1000;
|
|
19
21
|
const FETCH_TIMEOUT_MS = 5000;
|
|
20
|
-
export const RELEASE_NOTES = (v) =>
|
|
21
|
-
/** Whether a Linux `/proc/<pid>/stat` line is of a zombie: the state after the parenthesised command name is `Z`. */
|
|
22
|
-
export function isZombieStat(stat) {
|
|
23
|
-
return /\)\s+Z\s/.test(stat.slice(stat.lastIndexOf(')')));
|
|
24
|
-
}
|
|
22
|
+
export const RELEASE_NOTES = (v) => `${REPO_URL}/releases/tag/v${v}`;
|
|
25
23
|
/** Swapped in tests through `bindUpdateDeps`; the real machine otherwise. */
|
|
26
24
|
/**
|
|
27
25
|
* Whether `sideby autostart --refresh --json` rewrote the login item: it exits 0 also when nothing changed or the
|
|
@@ -58,22 +56,7 @@ const realDeps = {
|
|
|
58
56
|
now: () => new Date(),
|
|
59
57
|
packageDir: ownPackageDir,
|
|
60
58
|
writable: (dir) => access(dir, constants.W_OK).then(() => true, () => false),
|
|
61
|
-
alive
|
|
62
|
-
try {
|
|
63
|
-
process.kill(pid, 0);
|
|
64
|
-
}
|
|
65
|
-
catch (err) {
|
|
66
|
-
return err.code === 'EPERM';
|
|
67
|
-
}
|
|
68
|
-
// An exited process nobody waited for (its parent went first) still answers signal 0 on Linux: a zombie holds
|
|
69
|
-
// no lock and runs no session.
|
|
70
|
-
try {
|
|
71
|
-
return !isZombieStat(readFileSync(`/proc/${pid}/stat`, 'utf8'));
|
|
72
|
-
}
|
|
73
|
-
catch {
|
|
74
|
-
return true; // no /proc (macOS): signal 0 is the answer
|
|
75
|
-
}
|
|
76
|
-
},
|
|
59
|
+
alive: processAlive,
|
|
77
60
|
exec: (file, args, opts) => new Promise((resolve) => {
|
|
78
61
|
let output = '';
|
|
79
62
|
const child = spawn(file, args, {
|
|
@@ -126,13 +109,16 @@ const realDeps = {
|
|
|
126
109
|
child.once('error', () => resolve(false));
|
|
127
110
|
child.once('close', (code) => resolve(code === 0));
|
|
128
111
|
}),
|
|
129
|
-
autostartInstalled: async (home) => {
|
|
112
|
+
autostartInstalled: async (home, command = 'autostart') => {
|
|
130
113
|
const { autostartInstalled } = await import('./autostart.js');
|
|
131
|
-
|
|
114
|
+
if (command === 'autostart')
|
|
115
|
+
return autostartInstalled(home);
|
|
116
|
+
const { MENUBAR_AGENT } = await import('../menubar/agent.js');
|
|
117
|
+
return autostartInstalled(home, MENUBAR_AGENT);
|
|
132
118
|
},
|
|
133
|
-
refreshAutostart: (env) => new Promise((resolve) => {
|
|
119
|
+
refreshAutostart: (env, command = 'autostart') => new Promise((resolve) => {
|
|
134
120
|
// By name, like refreshApp: the new code records its own Node and entry; it never creates a login item.
|
|
135
|
-
const child = spawn('sideby', [
|
|
121
|
+
const child = spawn('sideby', [command, '--refresh', '--json'], {
|
|
136
122
|
env: env,
|
|
137
123
|
stdio: ['ignore', 'pipe', 'ignore'],
|
|
138
124
|
timeout: 60_000,
|
|
@@ -158,14 +144,8 @@ export function bindUpdateDeps(deps) {
|
|
|
158
144
|
const deps = () => ({ ...realDeps, ...override });
|
|
159
145
|
/** Runs a program through the swappable machine (tests bind `exec`); a Local Build switch installs with it. */
|
|
160
146
|
export const runProgram = (file, args, opts) => deps().exec(file, args, opts);
|
|
161
|
-
/**
|
|
162
|
-
export const
|
|
163
|
-
.restartPanel(env, port)
|
|
164
|
-
.catch(() => false);
|
|
165
|
-
/** Starts a program detached through the swappable machine; see `UpdateDeps.startDetached`. */
|
|
166
|
-
export const startDetached = (file, args, env) => deps()
|
|
167
|
-
.startDetached(file, args, env)
|
|
168
|
-
.catch(() => false);
|
|
147
|
+
/** The machine in use: the real one, or the parts tests bound. Internal, for after-install.ts and local-build.ts. */
|
|
148
|
+
export const updateMachine = () => deps();
|
|
169
149
|
/** The lock every install shares (`update-install.lock`), so a Local Build switch never races an Update. */
|
|
170
150
|
export const takeInstallLock = (paths) => takeLock(paths, 'update-install.lock').catch(() => null);
|
|
171
151
|
// Build metadata is limited to what semver allows, so a version never carries a terminal escape into the notice.
|
|
@@ -376,41 +356,28 @@ export async function refreshUpdateCheck(paths, env) {
|
|
|
376
356
|
const LOCK_MAX_MS = 60 * 60 * 1000;
|
|
377
357
|
/** A lock file another process has just created and not yet written to. */
|
|
378
358
|
const LOCK_WRITE_GRACE_MS = 60 * 1000;
|
|
359
|
+
/** How often a holder touches its lock, and how long a lock nobody touched counts as held. */
|
|
360
|
+
const LOCK_BEAT_MS = 15 * 1000;
|
|
361
|
+
const LOCK_STALE_MS = 2 * 60 * 1000;
|
|
379
362
|
/**
|
|
380
|
-
* An exclusive lock file in the state directory holding `<pid> <ms since epoch>`. It is held while that pid runs
|
|
381
|
-
*
|
|
382
|
-
*
|
|
383
|
-
*
|
|
363
|
+
* An exclusive lock file in the state directory holding `<pid> <ms since epoch>`. It is held while that pid runs, the
|
|
364
|
+
* lock is under an hour old and its holder still touches it (every 15 s), however long an install takes on a slow
|
|
365
|
+
* mirror. A lock not touched for two minutes is free even when its pid runs: a Portal's worker thread that was ended
|
|
366
|
+
* mid-install leaves it behind in a process that lives on. An empty or unreadable lock is held for a minute (its owner
|
|
367
|
+
* may still be writing it). Null when held: the second caller fails at once instead of waiting. Release removes the
|
|
368
|
+
* file only while it still names this process.
|
|
384
369
|
*/
|
|
385
370
|
async function takeLock(paths, name) {
|
|
386
|
-
const file = join(paths.stateDir, name);
|
|
387
371
|
const d = deps();
|
|
388
|
-
const me = `${process.pid} ${d.now().getTime()}`;
|
|
389
372
|
await mkdir(paths.stateDir, { recursive: true, mode: 0o700 });
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
};
|
|
399
|
-
}
|
|
400
|
-
catch (err) {
|
|
401
|
-
if (err.code !== 'EEXIST')
|
|
402
|
-
return null;
|
|
403
|
-
const text = await readFile(file, 'utf8').catch(() => '');
|
|
404
|
-
const m = /^(\d+) (\d+)$/.exec(text);
|
|
405
|
-
const held = m
|
|
406
|
-
? d.alive(Number(m[1])) && d.now().getTime() - Number(m[2]) < LOCK_MAX_MS
|
|
407
|
-
: d.now().getTime() - ((await stat(file).catch(() => null))?.mtimeMs ?? 0) < LOCK_WRITE_GRACE_MS;
|
|
408
|
-
if (held)
|
|
409
|
-
return null;
|
|
410
|
-
await rm(file, { force: true });
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
return null;
|
|
373
|
+
return takeFileLock(join(paths.stateDir, name), {
|
|
374
|
+
alive: d.alive,
|
|
375
|
+
now: () => d.now().getTime(),
|
|
376
|
+
maxMs: LOCK_MAX_MS,
|
|
377
|
+
staleMs: LOCK_STALE_MS,
|
|
378
|
+
beatMs: LOCK_BEAT_MS,
|
|
379
|
+
writeGraceMs: LOCK_WRITE_GRACE_MS,
|
|
380
|
+
}).catch(() => null);
|
|
414
381
|
}
|
|
415
382
|
// ---- the notice
|
|
416
383
|
/**
|
|
@@ -743,17 +710,20 @@ export async function planUpdate(paths, env) {
|
|
|
743
710
|
const skill = await skillUpdatePlan(paths.home, plan.available ? latest : plan.current).catch(() => null);
|
|
744
711
|
return skill ? { ...plan, skill } : plan;
|
|
745
712
|
}
|
|
713
|
+
/**
|
|
714
|
+
* The plan of `sideby update --skill`: the installed skill toward this version, never the CLI. Asks no registry: what
|
|
715
|
+
* it says of a newer CLI comes from the last Update Check.
|
|
716
|
+
*/
|
|
717
|
+
export async function planSkillUpdate(paths, env) {
|
|
718
|
+
const current = packageVersion();
|
|
719
|
+
const cache = await readUpdateCache(paths).catch(() => ({}));
|
|
720
|
+
const plan = planFrom(await installMethod(env), current, cache.latest ?? current, env);
|
|
721
|
+
const skill = await skillUpdatePlan(paths.home, current).catch(() => null);
|
|
722
|
+
return skill ? { ...plan, skill } : plan;
|
|
723
|
+
}
|
|
746
724
|
/** Updates the installed sideby skill when the plan says it is outdated and sideby may; null when it did nothing. */
|
|
747
725
|
export async function applySkillUpdate(plan, env, onOutput) {
|
|
748
|
-
|
|
749
|
-
return null;
|
|
750
|
-
const [file, ...args] = SKILL_UPDATE;
|
|
751
|
-
const r = await deps()
|
|
752
|
-
.exec(file, args, { env, ...(onOutput ? { onOutput } : {}) })
|
|
753
|
-
.catch((e) => ({ code: 1, output: e instanceof Error ? e.message : String(e) }));
|
|
754
|
-
return r.code === 0
|
|
755
|
-
? { ok: true, message: 'updated the sideby skill' }
|
|
756
|
-
: { ok: false, message: `\`${plan.command}\` failed (exit ${r.code}); run it yourself to see why` };
|
|
726
|
+
return runSkillUpdate(deps(), plan, env, onOutput);
|
|
757
727
|
}
|
|
758
728
|
/**
|
|
759
729
|
* Updates only the sideby skill, for a CLI that is already current (`sideby update`, the Panel, Auto Update). Holds
|
|
@@ -777,11 +747,12 @@ export async function applySkillOnly(paths, plan, env, onOutput) {
|
|
|
777
747
|
}
|
|
778
748
|
}
|
|
779
749
|
/**
|
|
780
|
-
* Runs the Update the plan names, then
|
|
781
|
-
*
|
|
782
|
-
* shown the plan and got a confirmation (or this is an Auto Update). One
|
|
783
|
-
* CLI, a Panel and an Auto Update share the lock). `panelPort` gives the
|
|
784
|
-
* null when none runs. A successful Update is recorded as said, so no
|
|
750
|
+
* Runs the Update the plan names, then what follows an install (after-install.ts): the desktop app and the login item
|
|
751
|
+
* are written again from the new code where installed, the skill follows, and a running background Panel starts again
|
|
752
|
+
* from the new code, last. The caller has shown the plan and got a confirmation (or this is an Auto Update). One
|
|
753
|
+
* Update runs at a time on this machine (the CLI, a Panel and an Auto Update share the lock). `panelPort` gives the
|
|
754
|
+
* port of the background Panel to restart, or null when none runs. A successful Update is recorded as said, so no
|
|
755
|
+
* notice for it follows.
|
|
785
756
|
*/
|
|
786
757
|
export async function applyUpdate(paths, plan, env, opts = {}) {
|
|
787
758
|
const cmd = updateCommand(plan.method, plan.latest, env);
|
|
@@ -800,6 +771,13 @@ export async function applyUpdate(paths, plan, env, opts = {}) {
|
|
|
800
771
|
return fail('another sideby update is running; wait for it to finish, then run `sideby update` again', {
|
|
801
772
|
busy: true,
|
|
802
773
|
});
|
|
774
|
+
let released = false;
|
|
775
|
+
const free = async () => {
|
|
776
|
+
if (released)
|
|
777
|
+
return;
|
|
778
|
+
released = true;
|
|
779
|
+
await release().catch(() => { });
|
|
780
|
+
};
|
|
803
781
|
try {
|
|
804
782
|
const d = deps();
|
|
805
783
|
const r = await d.exec(cmd.run.file, cmd.run.args, {
|
|
@@ -811,30 +789,26 @@ export async function applyUpdate(paths, plan, env, opts = {}) {
|
|
|
811
789
|
await updateUpdateCache(paths, {
|
|
812
790
|
notified: { version: plan.latest, at: d.now().toISOString() },
|
|
813
791
|
}).catch(() => { });
|
|
814
|
-
const port = opts.panelPort ? await opts.panelPort().catch(() => null) : null;
|
|
815
|
-
const restarted = port !== null && (await d.restartPanel(env, port).catch(() => false));
|
|
816
|
-
// The desktop app records the Node and entry it starts and carries the icon of the version that wrote it, so
|
|
817
|
-
// the new code writes it again. Only where one is installed; a failure here never fails the Update.
|
|
818
|
-
const installed = await d.appInstalled(paths.home, env).catch(() => false);
|
|
819
|
-
const refreshed = installed && (await d.refreshApp(env).catch(() => false));
|
|
820
|
-
// The login item records the Node and entry it starts, like the app (ADR-0029); never created here.
|
|
821
|
-
const autostart = await d.autostartInstalled(paths.home).catch(() => false);
|
|
822
|
-
const refreshedAutostart = autostart ? await d.refreshAutostart(env).catch(() => false) : undefined;
|
|
823
792
|
// The skill teaches agents this version's commands, so it follows the CLI; a failure there keeps the Update.
|
|
824
|
-
const
|
|
793
|
+
const after = await afterInstall(d, env, {
|
|
794
|
+
home: paths.home,
|
|
795
|
+
release: free,
|
|
796
|
+
app: true,
|
|
797
|
+
skill: { plan: plan.skill },
|
|
798
|
+
...(opts.skillSync ? { skillSync: opts.skillSync } : {}),
|
|
799
|
+
...(opts.panelPort ? { panelPort: opts.panelPort } : {}),
|
|
800
|
+
...(opts.onOutput ? { onOutput: opts.onOutput } : {}),
|
|
801
|
+
});
|
|
825
802
|
return {
|
|
826
803
|
ok: true,
|
|
827
804
|
code: 0,
|
|
828
805
|
output: r.output,
|
|
829
806
|
message: `updated sideby from ${plan.current} to ${plan.latest}`,
|
|
830
|
-
|
|
831
|
-
refreshedApp: refreshed,
|
|
832
|
-
...(refreshedAutostart !== undefined ? { refreshedAutostart } : {}),
|
|
833
|
-
...(skill ? { skillUpdated: skill.ok, skillMessage: skill.message } : {}),
|
|
807
|
+
...after,
|
|
834
808
|
};
|
|
835
809
|
}
|
|
836
810
|
finally {
|
|
837
|
-
await
|
|
811
|
+
await free();
|
|
838
812
|
}
|
|
839
813
|
}
|
|
840
814
|
/** What keeps an Auto Update from installing `plan` until the user acts (an install it cannot update, a major version). */
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface WindowsDir {
|
|
2
|
+
win: string;
|
|
3
|
+
unix: string;
|
|
4
|
+
}
|
|
5
|
+
export interface WindowsDirs {
|
|
6
|
+
localAppData?: WindowsDir;
|
|
7
|
+
programs: WindowsDir[];
|
|
8
|
+
}
|
|
9
|
+
export type WindowsExec = (file: string, args: readonly string[]) => Promise<{
|
|
10
|
+
code: number;
|
|
11
|
+
stdout: string;
|
|
12
|
+
}>;
|
|
13
|
+
/** A Windows drive path (`C:\Windows`) as WSL mounts it (`/mnt/c/Windows`); undefined for anything else. */
|
|
14
|
+
export declare function toUnix(win: string, mount: string): string | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* The current Windows user's folders, from one `cmd.exe` call, remembered for the process; null when cmd.exe does not
|
|
17
|
+
* answer (WSL interop off, or no C: drive), for the caller to fall back without guessing between users.
|
|
18
|
+
*/
|
|
19
|
+
export declare function askWindowsDirs(exec: WindowsExec, mount: string): Promise<WindowsDirs | null>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// Windows' own folders as WSL sees them (spec §3.24, §3.28): one `cmd.exe` call names the current Windows user's
|
|
2
|
+
// `%LOCALAPPDATA%` and the Program Files folders, so sideby never guesses between the users under `C:\Users`.
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
/** A Windows drive path (`C:\Windows`) as WSL mounts it (`/mnt/c/Windows`); undefined for anything else. */
|
|
5
|
+
export function toUnix(win, mount) {
|
|
6
|
+
const m = /^([A-Za-z]):\\(.*)$/.exec(win.trim());
|
|
7
|
+
if (!m)
|
|
8
|
+
return undefined;
|
|
9
|
+
return join(mount, m[1].toLowerCase(), ...m[2].split('\\').filter(Boolean));
|
|
10
|
+
}
|
|
11
|
+
const memo = new Map();
|
|
12
|
+
/**
|
|
13
|
+
* The current Windows user's folders, from one `cmd.exe` call, remembered for the process; null when cmd.exe does not
|
|
14
|
+
* answer (WSL interop off, or no C: drive), for the caller to fall back without guessing between users.
|
|
15
|
+
*/
|
|
16
|
+
export async function askWindowsDirs(exec, mount) {
|
|
17
|
+
const hit = memo.get(mount);
|
|
18
|
+
if (hit)
|
|
19
|
+
return hit;
|
|
20
|
+
const r = await exec(join(mount, 'c', 'Windows', 'System32', 'cmd.exe'), [
|
|
21
|
+
'/d',
|
|
22
|
+
'/c',
|
|
23
|
+
'echo %LOCALAPPDATA%^|%ProgramFiles%^|%ProgramFiles(x86)%',
|
|
24
|
+
]).catch(() => null);
|
|
25
|
+
const parts = r?.code === 0 ? r.stdout.trim().split('|') : [];
|
|
26
|
+
const dir = (win) => {
|
|
27
|
+
const unix = win ? toUnix(win, mount) : undefined;
|
|
28
|
+
return win && unix ? { win: win.trim(), unix } : undefined;
|
|
29
|
+
};
|
|
30
|
+
const local = dir(parts[0]);
|
|
31
|
+
if (!local)
|
|
32
|
+
return null;
|
|
33
|
+
const found = {
|
|
34
|
+
localAppData: local,
|
|
35
|
+
programs: [dir(parts[1]), dir(parts[2])].filter((d) => d !== undefined),
|
|
36
|
+
};
|
|
37
|
+
memo.set(mount, found);
|
|
38
|
+
return found;
|
|
39
|
+
}
|
package/dist/src/desktop/icon.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// polylines (distance to a segment), ellipses use an analytic distance. Each shape is computed only inside its own
|
|
5
5
|
// bounding box and composited back to front, fill before outline, as an SVG renderer would.
|
|
6
6
|
import { deflateSync } from 'node:zlib';
|
|
7
|
-
import {
|
|
7
|
+
import { buddyShapes, MARK, MARK_COLORS, MARK_VIEWBOX, markSvgBody, } from '../core/brand-mark.js';
|
|
8
8
|
/** Text stored in every generated file, so `sideby app uninstall` deletes only what it wrote. */
|
|
9
9
|
export const APP_MARKER = 'sideby-app-install';
|
|
10
10
|
// The Panel's logo tile (page-styles.ts: .logo 40×40, radius 10); MARK_VIEWBOX maps onto the whole tile square.
|
|
@@ -246,23 +246,19 @@ function roundedRectMask(size, s) {
|
|
|
246
246
|
}
|
|
247
247
|
return m;
|
|
248
248
|
}
|
|
249
|
-
/** The shapes of one placed buddy, back to front, each with its colour. */
|
|
249
|
+
/** The shapes of one placed buddy, back to front, each with its colour (core/brand-mark.ts buddyShapes). */
|
|
250
250
|
function buddyLayers(size, b) {
|
|
251
251
|
const { k, map } = placement(size, b);
|
|
252
|
-
const
|
|
253
|
-
const fills = {
|
|
254
|
-
body: b.colors.body,
|
|
255
|
-
shade: b.colors.shade,
|
|
256
|
-
};
|
|
252
|
+
const { paths, dots, above } = buddyShapes(b);
|
|
257
253
|
const layers = [];
|
|
258
|
-
|
|
259
|
-
const polys = flatten(
|
|
260
|
-
if (
|
|
261
|
-
layers.push({ mask: fillMask(size, polys), color: rgb(
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
}
|
|
265
|
-
|
|
254
|
+
const shape = (s) => {
|
|
255
|
+
const polys = flatten(s.d, map);
|
|
256
|
+
if (s.fill && s.fill !== 'none')
|
|
257
|
+
layers.push({ mask: fillMask(size, polys), color: rgb(s.fill) });
|
|
258
|
+
if (s.stroke !== 'none')
|
|
259
|
+
layers.push({ mask: strokeMask(size, polys, (s.width ?? MARK.placedLine) * k), color: rgb(s.stroke) });
|
|
260
|
+
};
|
|
261
|
+
paths.forEach(shape);
|
|
266
262
|
for (const e of dots) {
|
|
267
263
|
const [cx, cy] = map(e.cx, e.cy);
|
|
268
264
|
layers.push({
|
|
@@ -270,6 +266,7 @@ function buddyLayers(size, b) {
|
|
|
270
266
|
color: rgb(e.fill === 'ink' ? MARK_COLORS.ink : MARK_COLORS.light),
|
|
271
267
|
});
|
|
272
268
|
}
|
|
269
|
+
above.forEach(shape);
|
|
273
270
|
return layers;
|
|
274
271
|
}
|
|
275
272
|
/** RGBA pixels (straight alpha) of the icon at `size`×`size`. */
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `args` without any argument that skips Claude Code's permission checks: the two bypass flags and a
|
|
3
|
+
* `--permission-mode bypassPermissions` (either form). Unless the arguments still pick another permission mode,
|
|
4
|
+
* `--permission-mode auto` comes first: no routine prompts, while auto mode's classifier blocks risky actions. It also
|
|
5
|
+
* outranks a settings file's `permissions.defaultMode`, and a session where auto mode is unavailable starts in Manual.
|
|
6
|
+
* Text after `--` is the Host's own and stays as it is.
|
|
7
|
+
*/
|
|
8
|
+
export declare function claudeAiTaskArgs(args: readonly string[]): string[];
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// How an AI Task starts Claude Code (spec §3.28 "权限检查", ADR-0031), checked against the permission modes page of
|
|
2
|
+
// the Claude Code docs on 2026-10-18 (Claude Code 2.1.301).
|
|
3
|
+
const BYPASS_FLAGS = ['--dangerously-skip-permissions', '--allow-dangerously-skip-permissions'];
|
|
4
|
+
const MODE = '--permission-mode';
|
|
5
|
+
const isBypass = (mode) => mode.toLowerCase() === 'bypasspermissions';
|
|
6
|
+
/**
|
|
7
|
+
* `args` without any argument that skips Claude Code's permission checks: the two bypass flags and a
|
|
8
|
+
* `--permission-mode bypassPermissions` (either form). Unless the arguments still pick another permission mode,
|
|
9
|
+
* `--permission-mode auto` comes first: no routine prompts, while auto mode's classifier blocks risky actions. It also
|
|
10
|
+
* outranks a settings file's `permissions.defaultMode`, and a session where auto mode is unavailable starts in Manual.
|
|
11
|
+
* Text after `--` is the Host's own and stays as it is.
|
|
12
|
+
*/
|
|
13
|
+
export function claudeAiTaskArgs(args) {
|
|
14
|
+
const end = args.indexOf('--');
|
|
15
|
+
const options = end === -1 ? args : args.slice(0, end);
|
|
16
|
+
const out = [];
|
|
17
|
+
let picked = false;
|
|
18
|
+
for (let i = 0; i < options.length; i++) {
|
|
19
|
+
const arg = options[i];
|
|
20
|
+
if (BYPASS_FLAGS.includes(arg))
|
|
21
|
+
continue;
|
|
22
|
+
if (arg.startsWith(`${MODE}=`)) {
|
|
23
|
+
if (isBypass(arg.slice(MODE.length + 1)))
|
|
24
|
+
continue;
|
|
25
|
+
picked = true;
|
|
26
|
+
}
|
|
27
|
+
else if (arg === MODE && i + 1 < options.length) {
|
|
28
|
+
const mode = options[++i];
|
|
29
|
+
if (isBypass(mode))
|
|
30
|
+
continue;
|
|
31
|
+
picked = true;
|
|
32
|
+
out.push(arg, mode);
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
out.push(arg);
|
|
36
|
+
}
|
|
37
|
+
return [...(picked ? [] : [MODE, 'auto']), ...out, ...(end === -1 ? [] : args.slice(end))];
|
|
38
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
// Claude Code for the handoff hook (spec §3.17): Quota
|
|
1
|
+
// Claude Code for the handoff hook (spec §3.17): the Quota windows from the status line tap's cache, and a used-up
|
|
2
2
|
// Quota told apart from a transient rate limit. Leaf module: the hook runs on every tool call.
|
|
3
|
-
import {
|
|
3
|
+
import { openWindows } from '../../core/quota-levels.js';
|
|
4
4
|
import { field } from '../../handoff/reader.js';
|
|
5
5
|
import { accountNameFromEnv, cacheStateDir, readQuotaCache } from './quota-cache.js';
|
|
6
6
|
/** Claude Code's wording when a subscription window is used up (as opposed to an overloaded server). */
|
|
7
7
|
const USED_UP = /usage limit|limit reached|out of (extra )?usage/i;
|
|
8
8
|
export const claudeHookReader = {
|
|
9
|
-
async
|
|
9
|
+
async windows(_input, env, now) {
|
|
10
10
|
const name = accountNameFromEnv(env);
|
|
11
11
|
if (!name)
|
|
12
12
|
return null;
|
|
@@ -14,7 +14,7 @@ export const claudeHookReader = {
|
|
|
14
14
|
const cache = await readQuotaCache(cacheStateDir(env), name);
|
|
15
15
|
if (cache.status !== 'ok')
|
|
16
16
|
return null;
|
|
17
|
-
return
|
|
17
|
+
return openWindows({ ...cache, source: 'statusline' }, now);
|
|
18
18
|
}
|
|
19
19
|
catch {
|
|
20
20
|
return null;
|
|
@@ -6,6 +6,7 @@ import { readSecretFile } from '../../core/secret-file.js';
|
|
|
6
6
|
import { claudeStatusline } from '../../quota/claude-statusline.js';
|
|
7
7
|
import { BUILTIN_LOGOS } from '../logos.js';
|
|
8
8
|
import { dirWrittenAt, groupedEntryWrittenAt, resumeFlagSession, withoutResumeFlag, } from '../shared/sessions.js';
|
|
9
|
+
import { claudeAiTaskArgs } from './ai-task.js';
|
|
9
10
|
import { claudeHandoff } from './handoff.js';
|
|
10
11
|
import { CLAUDE_LAYOUT } from './layout.js';
|
|
11
12
|
import { claudeModelChoice } from './model.js';
|
|
@@ -108,6 +109,8 @@ export const claudeFamily = {
|
|
|
108
109
|
secretVar: 'ANTHROPIC_AUTH_TOKEN',
|
|
109
110
|
// `-p` is one non-interactive prompt (Claude Code 2.1.301 --help, 2026-10-17).
|
|
110
111
|
probe: { args: ['-p', 'Reply with OK'] },
|
|
112
|
+
aiTaskArgs: claudeAiTaskArgs,
|
|
113
|
+
settingsFile: 'settings.json',
|
|
111
114
|
sharedItems: [
|
|
112
115
|
...LINKED.map((path) => ({ path, mode: 'link' })),
|
|
113
116
|
{ path: '.claude.json', mode: 'json-key', key: 'mcpServers', mainPath: '.claude.json', credential: true },
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
// Codex for the handoff hook (spec §3.17): Quota
|
|
1
|
+
// Codex for the handoff hook (spec §3.17): the Quota windows from the current session's rollout. Codex has no hook
|
|
2
2
|
// for a failed turn, so it starts a Handoff only before its limit. Leaf module: the hook runs on every tool call.
|
|
3
|
-
import {
|
|
3
|
+
import { openWindows } from '../../core/quota-levels.js';
|
|
4
4
|
import { field } from '../../handoff/reader.js';
|
|
5
5
|
import { lastRateLimits } from './rate-limits.js';
|
|
6
6
|
export const codexHookReader = {
|
|
7
|
-
async
|
|
7
|
+
async windows(input, _env, now) {
|
|
8
8
|
const file = field(input, 'transcript_path');
|
|
9
9
|
if (!file)
|
|
10
10
|
return null;
|
|
11
11
|
const windows = await lastRateLimits(file);
|
|
12
12
|
return windows
|
|
13
|
-
?
|
|
13
|
+
? openWindows({ status: 'ok', windows, observedAt: now.toISOString(), source: file }, now)
|
|
14
14
|
: null;
|
|
15
15
|
},
|
|
16
16
|
};
|
|
@@ -9,6 +9,7 @@ import { codexModelChoice } from './model.js';
|
|
|
9
9
|
import { readCodexQuota, readCodexUsage } from './rollout.js';
|
|
10
10
|
import { readCodexTuning } from './tuning.js';
|
|
11
11
|
const FILE_STORE_KEY = 'cli_auth_credentials_store';
|
|
12
|
+
const CODEX_BYPASS = ['--dangerously-bypass-approvals-and-sandbox', '--yolo'];
|
|
12
13
|
async function readModel(account) {
|
|
13
14
|
try {
|
|
14
15
|
return topLevelTomlString(await readFile(join(account.dir, 'config.toml'), 'utf8'), 'model');
|
|
@@ -38,6 +39,14 @@ export const codexFamily = {
|
|
|
38
39
|
// `-i, --image <FILE>...` takes several values (Codex 0.163.0 --help); AI Tasks pass `--image=<path>`, one value
|
|
39
40
|
// per flag, so the prompt after it stays a positional argument.
|
|
40
41
|
imageArg: '--image',
|
|
42
|
+
// An AI Task keeps Codex's approvals and sandbox (ADR-0031): the one flag that turns both off, and its `--yolo`
|
|
43
|
+
// alias, are dropped before `--`. Codex has no mode that blocks only risky actions, so nothing is added.
|
|
44
|
+
aiTaskArgs(args) {
|
|
45
|
+
const end = args.indexOf('--');
|
|
46
|
+
const options = end === -1 ? args : args.slice(0, end);
|
|
47
|
+
return [...options.filter((a) => !CODEX_BYPASS.includes(a)), ...(end === -1 ? [] : args.slice(end))];
|
|
48
|
+
},
|
|
49
|
+
settingsFile: 'config.toml',
|
|
41
50
|
sharedItems: [
|
|
42
51
|
{ path: 'AGENTS.md', mode: 'link' },
|
|
43
52
|
{ path: 'hooks.json', mode: 'link' },
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
// Grok Build for the handoff hook (spec §3.17, §3.26): Quota
|
|
1
|
+
// Grok Build for the handoff hook (spec §3.17, §3.26): the Quota windows from the kept answer of its CLI and the billing
|
|
2
2
|
// lines it writes to its log, and a turn that failed at the limit. Leaf module: the hook runs on every tool call. The
|
|
3
3
|
// wording comes from the grok 1.0.50 binary; check it again when Grok changes.
|
|
4
4
|
import { homedir } from 'node:os';
|
|
5
5
|
import { basename, join, resolve } from 'node:path';
|
|
6
6
|
import { ACCOUNT_NAME } from '../../core/account-name.js';
|
|
7
7
|
import { resolvePaths } from '../../core/paths.js';
|
|
8
|
-
import {
|
|
8
|
+
import { openWindows } from '../../core/quota-levels.js';
|
|
9
9
|
import { quotaStoreFile, readQuotaStore } from '../../core/quota-store.js';
|
|
10
10
|
import { field } from '../../handoff/reader.js';
|
|
11
11
|
import { grokLogFile, HOOK_LOG_READ_BYTES, lastGrokBilling } from './quota-log.js';
|
|
@@ -37,7 +37,7 @@ export const GROK_USED_UP = [
|
|
|
37
37
|
'status 402',
|
|
38
38
|
];
|
|
39
39
|
export const grokHookReader = {
|
|
40
|
-
async
|
|
40
|
+
async windows(_input, env, now) {
|
|
41
41
|
const account = grokAccountFromEnv(env);
|
|
42
42
|
if (!account)
|
|
43
43
|
return null;
|
|
@@ -52,7 +52,7 @@ export const grokHookReader = {
|
|
|
52
52
|
? log
|
|
53
53
|
: fetched
|
|
54
54
|
: (log ?? fetched);
|
|
55
|
-
return newer ?
|
|
55
|
+
return newer ? openWindows(newer, now) : null;
|
|
56
56
|
}
|
|
57
57
|
catch {
|
|
58
58
|
return null;
|
|
@@ -52,6 +52,7 @@ export const grokFamily = {
|
|
|
52
52
|
secretVar: 'XAI_API_KEY',
|
|
53
53
|
// `-p` is one non-interactive prompt (Grok Build 1.0.60 --help, 2026-10-17).
|
|
54
54
|
probe: { args: ['-p', 'Reply with OK'] },
|
|
55
|
+
settingsFile: 'config.toml',
|
|
55
56
|
sharedItems: [
|
|
56
57
|
{ path: 'skills', mode: 'link' },
|
|
57
58
|
{ path: 'installed-plugins', mode: 'link' },
|