sideby 0.16.1 → 0.18.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 +7 -3
- package/ai-tasks.json +90 -0
- package/dist/build.json +1 -1
- package/dist/src/cli/commands.d.ts +25 -1
- package/dist/src/cli/commands.js +802 -15
- package/dist/src/cli/json-schemas.js +252 -1
- package/dist/src/cli/main.js +143 -4
- 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 +222 -0
- package/dist/src/core/ask.js +465 -0
- package/dist/src/core/attachments.d.ts +50 -0
- package/dist/src/core/attachments.js +442 -0
- package/dist/src/core/autostart.d.ts +118 -0
- package/dist/src/core/autostart.js +302 -0
- package/dist/src/core/brand-mark.d.ts +49 -11
- package/dist/src/core/brand-mark.js +116 -38
- package/dist/src/core/config.d.ts +102 -0
- package/dist/src/core/config.js +289 -11
- 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 +17 -4
- package/dist/src/core/launch.js +32 -24
- package/dist/src/core/local-build.d.ts +17 -5
- package/dist/src/core/local-build.js +61 -23
- package/dist/src/core/lock.d.ts +30 -0
- package/dist/src/core/lock.js +143 -0
- package/dist/src/core/probe.d.ts +78 -0
- package/dist/src/core/probe.js +127 -0
- package/dist/src/core/quota-levels.d.ts +6 -1
- package/dist/src/core/quota-levels.js +16 -5
- package/dist/src/core/same-login.d.ts +9 -4
- package/dist/src/core/same-login.js +9 -4
- package/dist/src/core/secret-file.d.ts +26 -0
- package/dist/src/core/secret-file.js +126 -7
- 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 +93 -0
- package/dist/src/core/terminal.js +376 -0
- package/dist/src/core/update.d.ts +34 -12
- package/dist/src/core/update.js +96 -84
- 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 +6 -0
- package/dist/src/families/claude/quota-cache.d.ts +24 -7
- package/dist/src/families/claude/quota-cache.js +72 -21
- package/dist/src/families/codex/handoff-hook.js +4 -4
- package/dist/src/families/codex/index.js +16 -0
- package/dist/src/families/codex/login-key.d.ts +8 -0
- package/dist/src/families/codex/login-key.js +33 -0
- package/dist/src/families/grok/handoff-hook.js +4 -4
- package/dist/src/families/grok/index.js +4 -0
- package/dist/src/families/login-keys.d.ts +6 -0
- package/dist/src/families/login-keys.js +6 -0
- package/dist/src/families/pi/index.js +5 -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 +15 -21
- package/dist/src/panel/handler.d.ts +41 -2
- package/dist/src/panel/handler.js +394 -10
- package/dist/src/panel/i18n.d.ts +205 -2
- package/dist/src/panel/i18n.js +441 -35
- package/dist/src/panel/page-logic.d.ts +301 -0
- package/dist/src/panel/page-logic.js +532 -0
- package/dist/src/panel/page-script.js +1135 -185
- package/dist/src/panel/page-styles.js +111 -32
- package/dist/src/panel/page.d.ts +12 -0
- package/dist/src/panel/page.js +7 -0
- package/dist/src/panel/server.d.ts +16 -2
- package/dist/src/panel/server.js +41 -13
- package/dist/src/plugins/check.d.ts +47 -0
- package/dist/src/plugins/check.js +544 -0
- package/dist/src/plugins/scaffold.d.ts +21 -0
- package/dist/src/plugins/scaffold.js +123 -0
- package/dist/src/quota/statusline-tap.js +1 -1
- package/dist/src/runtime.d.ts +19 -1
- package/dist/src/runtime.js +53 -14
- package/dist/src/types.d.ts +33 -0
- package/package.json +4 -3
- package/schemas/ask-choices.json +168 -0
- package/schemas/ask-print.json +87 -0
- package/schemas/ask.json +180 -0
- package/schemas/autostart.json +165 -0
- package/schemas/config-get.json +132 -0
- package/schemas/config-set.json +107 -0
- package/schemas/config.json +90 -7
- package/schemas/edit.json +119 -0
- package/schemas/error.json +4 -0
- package/schemas/families.json +4 -0
- package/schemas/key.json +93 -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/plugins-check.json +113 -0
- package/schemas/plugins-new.json +87 -0
- package/schemas/terminal.json +152 -0
- package/schemas/try.json +109 -0
- package/schemas/update.json +4 -0
- package/skills/sideby/SKILL.md +16 -6
- package/skills/sideby/references/accounts.md +1 -1
- package/skills/sideby/references/ai-tasks.md +126 -0
- package/skills/sideby/references/handoff.md +3 -1
- package/skills/sideby/references/panel.md +20 -0
- package/skills/sideby/references/update.md +1 -1
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
// Start the Panel at login (spec §3.29, ADR-0029): a LaunchAgent on macOS that runs this Node and this sideby's entry
|
|
2
|
+
// with `ui --background --no-open`. sideby writes, replaces or removes only a file that carries its marker; any other
|
|
3
|
+
// file at that path is reported and left alone. Every program runs through `AutostartContext.exec`, so tests never
|
|
4
|
+
// load a real agent.
|
|
5
|
+
import { execFile } from 'node:child_process';
|
|
6
|
+
import { mkdir, readFile, rm } from 'node:fs/promises';
|
|
7
|
+
import { tmpdir, userInfo } from 'node:os';
|
|
8
|
+
import { dirname, join } from 'node:path';
|
|
9
|
+
import { UserError } from './errors.js';
|
|
10
|
+
import { fileHash, realpathOrNull, sha256, statOrNull, writeIfUnchanged } from './fs-safe.js';
|
|
11
|
+
import { askLauncher, launcherProblem } from './terminal.js';
|
|
12
|
+
export const AUTOSTART_LABEL = 'dev.sideby.panel';
|
|
13
|
+
/** Present in every agent sideby writes; a file without it is someone else's. */
|
|
14
|
+
export const AUTOSTART_MARKER = 'Written by `sideby autostart`';
|
|
15
|
+
const defaultExec = (file, args) => new Promise((resolve) => {
|
|
16
|
+
execFile(file, [...args], { timeout: 15_000 }, (err, stdout, stderr) => {
|
|
17
|
+
const code = err ? (typeof err.code === 'number' ? err.code : 1) : 0;
|
|
18
|
+
resolve({ code, output: `${stdout}${stderr}` });
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
export const PANEL_AGENT = {
|
|
22
|
+
label: AUTOSTART_LABEL,
|
|
23
|
+
marker: AUTOSTART_MARKER,
|
|
24
|
+
command: 'autostart',
|
|
25
|
+
comment: 'starts the sideby panel in the background at login',
|
|
26
|
+
programArguments: (l) => programArgumentsFor(l),
|
|
27
|
+
launcherPaths: (args) => args.slice(0, 2),
|
|
28
|
+
later: 'the panel starts at your next login, or now with `sideby ui --background`',
|
|
29
|
+
};
|
|
30
|
+
export const agentPath = (home, agent) => join(home, 'Library', 'LaunchAgents', `${agent.label}.plist`);
|
|
31
|
+
export const autostartPath = (home) => agentPath(home, PANEL_AGENT);
|
|
32
|
+
const xml = (s) => s.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
|
33
|
+
const unxml = (s) => s.replace(/</g, '<').replace(/>/g, '>').replace(/&/g, '&');
|
|
34
|
+
export const programArgumentsFor = (l) => [l.node, l.entry, 'ui', '--background', '--no-open'];
|
|
35
|
+
/**
|
|
36
|
+
* The agent's file. The Panel's starts once at login, never again by itself, and outlives the job; an agent with
|
|
37
|
+
* `restartOnCrash` is the long-running process itself, which launchd starts again only after a failed exit.
|
|
38
|
+
*/
|
|
39
|
+
export function plistContent(args, agent = PANEL_AGENT, environment = {}) {
|
|
40
|
+
const vars = Object.entries(environment);
|
|
41
|
+
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
42
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
43
|
+
<!-- ${agent.marker}: ${agent.comment}. Turn it off with \`sideby ${agent.command} off\`. -->
|
|
44
|
+
<plist version="1.0">
|
|
45
|
+
<dict>
|
|
46
|
+
<key>Label</key>
|
|
47
|
+
<string>${agent.label}</string>
|
|
48
|
+
<key>ProgramArguments</key>
|
|
49
|
+
<array>
|
|
50
|
+
${args.map((a) => ` <string>${xml(a)}</string>`).join('\n')}
|
|
51
|
+
</array>
|
|
52
|
+
${vars.length
|
|
53
|
+
? ` <key>EnvironmentVariables</key>
|
|
54
|
+
<dict>
|
|
55
|
+
${vars.map(([k, v]) => ` <key>${xml(k)}</key>\n <string>${xml(v)}</string>`).join('\n')}
|
|
56
|
+
</dict>
|
|
57
|
+
`
|
|
58
|
+
: ''} <key>RunAtLoad</key>
|
|
59
|
+
<true/>
|
|
60
|
+
<key>KeepAlive</key>
|
|
61
|
+
${agent.restartOnCrash
|
|
62
|
+
? ` <dict>
|
|
63
|
+
<key>SuccessfulExit</key>
|
|
64
|
+
<false/>
|
|
65
|
+
</dict>
|
|
66
|
+
<key>ThrottleInterval</key>
|
|
67
|
+
<integer>30</integer>`
|
|
68
|
+
: ` <false/>
|
|
69
|
+
<key>AbandonProcessGroup</key>
|
|
70
|
+
<true/>`}
|
|
71
|
+
</dict>
|
|
72
|
+
</plist>
|
|
73
|
+
`;
|
|
74
|
+
}
|
|
75
|
+
/** The ProgramArguments of a file sideby wrote; null when it holds none. */
|
|
76
|
+
export function parseProgramArguments(content) {
|
|
77
|
+
const m = /<key>ProgramArguments<\/key>\s*<array>([\s\S]*?)<\/array>/.exec(content);
|
|
78
|
+
if (!m)
|
|
79
|
+
return null;
|
|
80
|
+
return [...m[1].matchAll(/<string>([\s\S]*?)<\/string>/g)].map((s) => unxml(s[1]));
|
|
81
|
+
}
|
|
82
|
+
const platformOf = (ctx) => ctx.platform ?? process.platform;
|
|
83
|
+
const UNSUPPORTED = 'sideby can start at login on macOS only for now; Linux and Windows come later';
|
|
84
|
+
async function readAgent(path) {
|
|
85
|
+
try {
|
|
86
|
+
return await readFile(path, 'utf8');
|
|
87
|
+
}
|
|
88
|
+
catch (err) {
|
|
89
|
+
if (err.code === 'ENOENT')
|
|
90
|
+
return null;
|
|
91
|
+
throw err;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
/** Whether a sideby agent (with the marker) is installed; reads only that one file. */
|
|
95
|
+
export async function autostartInstalled(home, agent = PANEL_AGENT) {
|
|
96
|
+
const content = await readAgent(agentPath(home, agent)).catch(() => null);
|
|
97
|
+
return content?.includes(agent.marker) ?? false;
|
|
98
|
+
}
|
|
99
|
+
export async function autostartStatus(ctx, agent = PANEL_AGENT) {
|
|
100
|
+
const path = agentPath(ctx.home, agent);
|
|
101
|
+
const supported = platformOf(ctx) === 'darwin';
|
|
102
|
+
const base = { supported, ...(supported ? {} : { reason: UNSUPPORTED }), path, current: false };
|
|
103
|
+
if (!supported)
|
|
104
|
+
return { ...base, state: 'off' };
|
|
105
|
+
const content = await readAgent(path);
|
|
106
|
+
if (content === null)
|
|
107
|
+
return { ...base, state: 'off' };
|
|
108
|
+
const args = content.includes(agent.marker) ? parseProgramArguments(content) : null;
|
|
109
|
+
if (!args)
|
|
110
|
+
return { ...base, state: 'foreign' };
|
|
111
|
+
const missing = [];
|
|
112
|
+
for (const p of agent.launcherPaths(args))
|
|
113
|
+
if (!(await statOrNull(p)))
|
|
114
|
+
missing.push(p);
|
|
115
|
+
const launcher = ctx.launcher ?? askLauncher();
|
|
116
|
+
const want = agent.programArguments(launcher);
|
|
117
|
+
const current = args.length === want.length && args.every((a, i) => a === want[i]);
|
|
118
|
+
return {
|
|
119
|
+
...base,
|
|
120
|
+
state: missing.length ? 'stale' : 'on',
|
|
121
|
+
programArguments: args,
|
|
122
|
+
current,
|
|
123
|
+
...(missing.length ? { missing } : {}),
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
/** Under the system's temporary folders, which are emptied without asking. */
|
|
127
|
+
async function inTempDir(path) {
|
|
128
|
+
const roots = ['/tmp/', '/private/tmp/', '/var/folders/', '/private/var/folders/'];
|
|
129
|
+
const t = await realpathOrNull(tmpdir());
|
|
130
|
+
if (t)
|
|
131
|
+
roots.push(`${t.replace(/\/+$/, '')}/`);
|
|
132
|
+
return roots.some((r) => path.startsWith(r));
|
|
133
|
+
}
|
|
134
|
+
/** Why the agent cannot start this launcher, with what to do instead; null when it can. */
|
|
135
|
+
export async function autostartLauncherProblem(l, command = 'autostart') {
|
|
136
|
+
const p = launcherProblem(l);
|
|
137
|
+
if (p?.reason === 'npx-cache')
|
|
138
|
+
return {
|
|
139
|
+
code: 'npx-cache',
|
|
140
|
+
message: `sideby runs from the npx cache, which npm may clear, so it cannot start at login from there; install it with \`npm i -g sideby\`, then run \`sideby ${command} on\` again`,
|
|
141
|
+
};
|
|
142
|
+
if (p)
|
|
143
|
+
return {
|
|
144
|
+
code: 'unsafe-path',
|
|
145
|
+
message: `the path of sideby or Node has characters a login item cannot run safely; install sideby with \`npm i -g sideby\` in an ordinary folder, then run \`sideby ${command} on\` again`,
|
|
146
|
+
};
|
|
147
|
+
if ((await inTempDir(l.entry)) || (await inTempDir(l.node)))
|
|
148
|
+
return {
|
|
149
|
+
code: 'temp-dir',
|
|
150
|
+
message: `sideby or Node runs from a temporary folder that the system empties, so it cannot start at login from there; install it with \`npm i -g sideby\`, then run \`sideby ${command} on\` again`,
|
|
151
|
+
};
|
|
152
|
+
return null;
|
|
153
|
+
}
|
|
154
|
+
const uidOf = (ctx) => ctx.uid ?? process.getuid?.() ?? 0;
|
|
155
|
+
const bootstrap = (ctx, path) => [
|
|
156
|
+
'launchctl',
|
|
157
|
+
'bootstrap',
|
|
158
|
+
`gui/${uidOf(ctx)}`,
|
|
159
|
+
path,
|
|
160
|
+
];
|
|
161
|
+
const bootout = (ctx, agent) => [
|
|
162
|
+
'launchctl',
|
|
163
|
+
'bootout',
|
|
164
|
+
`gui/${uidOf(ctx)}/${agent.label}`,
|
|
165
|
+
];
|
|
166
|
+
/** What `on` or `off` would change; writes nothing. */
|
|
167
|
+
export async function planAutostart(ctx, action, agent = PANEL_AGENT) {
|
|
168
|
+
const status = await autostartStatus(ctx, agent);
|
|
169
|
+
const path = status.path;
|
|
170
|
+
const hash = status.supported ? await fileHash(path) : null;
|
|
171
|
+
const plan = (extra) => ({
|
|
172
|
+
action,
|
|
173
|
+
status,
|
|
174
|
+
changed: false,
|
|
175
|
+
path,
|
|
176
|
+
commands: [],
|
|
177
|
+
hash,
|
|
178
|
+
...extra,
|
|
179
|
+
});
|
|
180
|
+
if (!status.supported)
|
|
181
|
+
return plan({ blocked: { code: 'unsupported', message: UNSUPPORTED } });
|
|
182
|
+
if (status.state === 'foreign')
|
|
183
|
+
return plan({
|
|
184
|
+
blocked: {
|
|
185
|
+
code: 'foreign',
|
|
186
|
+
message: `${path} was not written by sideby, so sideby leaves it alone; look at it, and remove or rename it yourself before \`sideby ${agent.command} ${action}\` if it is not needed`,
|
|
187
|
+
},
|
|
188
|
+
});
|
|
189
|
+
if (action === 'off')
|
|
190
|
+
return status.state === 'off' ? plan({}) : plan({ changed: true, commands: [bootout(ctx, agent)] });
|
|
191
|
+
const launcher = ctx.launcher ?? askLauncher();
|
|
192
|
+
const blocked = await autostartLauncherProblem(launcher, agent.command);
|
|
193
|
+
if (blocked)
|
|
194
|
+
return plan({ blocked });
|
|
195
|
+
const programArguments = agent.programArguments(launcher);
|
|
196
|
+
const content = plistContent(programArguments, agent, agent.environment?.(ctx.env ?? process.env));
|
|
197
|
+
const same = hash !== null && hash === sha256(content);
|
|
198
|
+
// The file alone does not start it: launchd may have let it go (a `launchctl bootout`, a failed start), and then
|
|
199
|
+
// only loading it again brings it back.
|
|
200
|
+
const loaded = !same || (await agentLoaded(ctx, agent));
|
|
201
|
+
return plan({
|
|
202
|
+
changed: !same || !loaded,
|
|
203
|
+
content,
|
|
204
|
+
programArguments,
|
|
205
|
+
commands: same
|
|
206
|
+
? loaded
|
|
207
|
+
? []
|
|
208
|
+
: [bootstrap(ctx, path)]
|
|
209
|
+
: [...(status.state === 'off' ? [] : [bootout(ctx, agent)]), bootstrap(ctx, path)],
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
/** Whether launchd holds the agent now; asks only for the login home, and counts any other HOME as loaded. */
|
|
213
|
+
async function agentLoaded(ctx, agent) {
|
|
214
|
+
if (launchctlNote(ctx))
|
|
215
|
+
return true;
|
|
216
|
+
const r = await (ctx.exec ?? defaultExec)('launchctl', ['print', `gui/${uidOf(ctx)}/${agent.label}`]).catch(() => null);
|
|
217
|
+
return r === null || r.code === 0;
|
|
218
|
+
}
|
|
219
|
+
/** Whether launchctl may run: only for the login user's own LaunchAgents, never for a demo or test HOME. */
|
|
220
|
+
function launchctlNote(ctx) {
|
|
221
|
+
let login = ctx.loginHome;
|
|
222
|
+
if (login === undefined)
|
|
223
|
+
try {
|
|
224
|
+
login = userInfo().homedir;
|
|
225
|
+
}
|
|
226
|
+
catch {
|
|
227
|
+
login = '';
|
|
228
|
+
}
|
|
229
|
+
return login === ctx.home
|
|
230
|
+
? null
|
|
231
|
+
: `HOME (${ctx.home}) is not your login home, so launchd was not told; it reads this file only from your login home`;
|
|
232
|
+
}
|
|
233
|
+
/** Carries out a plan the user confirmed. Refuses, changing nothing, when the file changed since it was planned. */
|
|
234
|
+
export async function applyAutostart(ctx, plan, agent = PANEL_AGENT) {
|
|
235
|
+
if (plan.blocked)
|
|
236
|
+
throw new UserError(plan.blocked.message, { code: plan.blocked.code });
|
|
237
|
+
const path = plan.path;
|
|
238
|
+
if (!plan.changed)
|
|
239
|
+
return {
|
|
240
|
+
changed: false,
|
|
241
|
+
state: plan.status.state,
|
|
242
|
+
path,
|
|
243
|
+
...(plan.programArguments ? { programArguments: plan.programArguments } : {}),
|
|
244
|
+
loaded: false,
|
|
245
|
+
};
|
|
246
|
+
if ((await fileHash(path)) !== plan.hash)
|
|
247
|
+
throw new UserError(`${path} changed since sideby looked at it; nothing was changed. Run the command again`, {
|
|
248
|
+
code: 'changed',
|
|
249
|
+
});
|
|
250
|
+
const exec = ctx.exec ?? defaultExec;
|
|
251
|
+
const note = launchctlNote(ctx);
|
|
252
|
+
const run = async (cmd) => (note ? null : exec(cmd[0], cmd.slice(1)));
|
|
253
|
+
if (plan.action === 'off') {
|
|
254
|
+
// The file goes first: bootout ends the job's whole process group, which holds this process when the menu bar
|
|
255
|
+
// item's own "Hide" runs it. Not loaded (already out, or never in) is fine: the file starts it at the next login.
|
|
256
|
+
await rm(path, { force: true });
|
|
257
|
+
await run(bootout(ctx, agent));
|
|
258
|
+
return { changed: true, state: 'off', path, loaded: note === null, ...(note ? { note } : {}) };
|
|
259
|
+
}
|
|
260
|
+
if (plan.status.state !== 'off')
|
|
261
|
+
await run(bootout(ctx, agent));
|
|
262
|
+
await mkdir(dirname(path), { recursive: true, mode: 0o755 });
|
|
263
|
+
// launchd skips an agent that others can write; 644 is what it expects.
|
|
264
|
+
if (!(await writeIfUnchanged(path, plan.hash, plan.content, 0o644)))
|
|
265
|
+
throw new UserError(`${path} changed while sideby was writing it; nothing was changed. Run the command again`, {
|
|
266
|
+
code: 'changed',
|
|
267
|
+
});
|
|
268
|
+
const r = await run(bootstrap(ctx, path));
|
|
269
|
+
const result = {
|
|
270
|
+
changed: true,
|
|
271
|
+
state: 'on',
|
|
272
|
+
path,
|
|
273
|
+
programArguments: plan.programArguments,
|
|
274
|
+
loaded: r !== null && r.code === 0,
|
|
275
|
+
};
|
|
276
|
+
if (note)
|
|
277
|
+
result.note = note;
|
|
278
|
+
else if (r && r.code !== 0)
|
|
279
|
+
result.note = `launchctl bootstrap failed (exit ${r.code}); ${agent.later}`;
|
|
280
|
+
return result;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* After `sideby update` or `pnpm local`: rewrites an existing sideby agent so it starts `launcher`. Never creates one,
|
|
284
|
+
* never touches a foreign file, and never throws; `rewritten` says whether the file changed.
|
|
285
|
+
*/
|
|
286
|
+
export async function refreshAutostart(ctx, agent = PANEL_AGENT) {
|
|
287
|
+
let state = 'off';
|
|
288
|
+
try {
|
|
289
|
+
const status = await autostartStatus(ctx, agent);
|
|
290
|
+
state = status.state;
|
|
291
|
+
if (status.state !== 'on' && status.state !== 'stale')
|
|
292
|
+
return { rewritten: false, state: status.state };
|
|
293
|
+
const plan = await planAutostart(ctx, 'on', agent);
|
|
294
|
+
if (plan.blocked)
|
|
295
|
+
return { rewritten: false, state: status.state, note: plan.blocked.message };
|
|
296
|
+
const r = await applyAutostart(ctx, plan, agent);
|
|
297
|
+
return { rewritten: r.changed, state: r.state, ...(r.note ? { note: r.note } : {}) };
|
|
298
|
+
}
|
|
299
|
+
catch (err) {
|
|
300
|
+
return { rewritten: false, state, note: err.message };
|
|
301
|
+
}
|
|
302
|
+
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/** A colour by name, or a fixed hex colour for a prop. */
|
|
2
|
+
export type Paint = 'ink' | 'light' | `#${string}`;
|
|
3
|
+
/** An outlined shape of one buddy, as SVG path data (absolute M, L, H, Q, C, Z) on its 64-unit grid. */
|
|
2
4
|
export interface BuddyPath {
|
|
3
5
|
d: string;
|
|
4
6
|
/** `body`, `shade`: the buddy's own colours; `none`: an open line. */
|
|
5
|
-
fill: 'body' | 'shade' | 'none';
|
|
6
|
-
/** Line colour; `
|
|
7
|
-
stroke?:
|
|
7
|
+
fill: 'body' | 'shade' | 'none' | Paint;
|
|
8
|
+
/** Line colour; `none` draws no line. Default ink. */
|
|
9
|
+
stroke?: Paint | 'none';
|
|
8
10
|
/** Line width on the 64-unit grid, before the buddy's scale. Default: the outline width. */
|
|
9
11
|
width?: number;
|
|
10
12
|
}
|
|
@@ -16,36 +18,46 @@ export interface BuddyDot {
|
|
|
16
18
|
ry: number;
|
|
17
19
|
fill: 'ink' | 'light';
|
|
18
20
|
}
|
|
19
|
-
/**
|
|
21
|
+
/** The body both buddies share, back to front: feet, arms, body; then the eyes. No forehead `>`: that belongs to Nika. */
|
|
20
22
|
export declare const BUDDY: {
|
|
21
23
|
paths: readonly BuddyPath[];
|
|
22
24
|
eyes: readonly BuddyDot[];
|
|
23
25
|
};
|
|
26
|
+
/** What one buddy wears and how it smiles: `behind` the body, its `mouth`, and `above` the face. */
|
|
27
|
+
export interface BuddyProps {
|
|
28
|
+
behind: readonly BuddyPath[];
|
|
29
|
+
mouth: BuddyPath;
|
|
30
|
+
above: readonly BuddyPath[];
|
|
31
|
+
}
|
|
32
|
+
/** Sai (blue): a red cape behind the shoulders, a gold crown with a red jewel, a small smile. */
|
|
33
|
+
export declare const SAI: BuddyProps;
|
|
34
|
+
/** Bai (amber): a green spare battery on its back, a bent antenna with a ball, an open laugh. */
|
|
35
|
+
export declare const BAI: BuddyProps;
|
|
24
36
|
/** The eye highlights sit towards where the buddy looks: `1` right, `-1` left. */
|
|
25
37
|
export declare function highlights(look: 1 | -1): BuddyDot[];
|
|
26
38
|
export interface BuddyColors {
|
|
27
39
|
body: string;
|
|
28
40
|
shade: string;
|
|
29
|
-
chevron: string;
|
|
30
41
|
}
|
|
31
42
|
export declare const MARK_COLORS: {
|
|
32
43
|
readonly blue: {
|
|
33
44
|
readonly body: '#3f8fc4';
|
|
34
45
|
readonly shade: '#29658e';
|
|
35
|
-
readonly chevron: '#f2b35e';
|
|
36
46
|
};
|
|
37
47
|
readonly amber: {
|
|
38
48
|
readonly body: '#f2b35e';
|
|
39
49
|
readonly shade: '#c98a35';
|
|
40
|
-
readonly chevron: '#3f8fc4';
|
|
41
50
|
};
|
|
42
51
|
readonly ink: '#1e2a44';
|
|
43
52
|
readonly light: '#f6f0e5';
|
|
44
53
|
};
|
|
45
54
|
export interface PlacedBuddy {
|
|
46
55
|
colors: BuddyColors;
|
|
56
|
+
props: BuddyProps;
|
|
47
57
|
/** Where the buddy looks (and which way its eye highlights sit). */
|
|
48
58
|
look: 1 | -1;
|
|
59
|
+
/** Mirror the props left to right, so what is worn on the back stays behind a buddy that turns the other way. */
|
|
60
|
+
mirror?: boolean;
|
|
49
61
|
/** 64-unit grid → mark units: translate by (x, y), then scale. */
|
|
50
62
|
x: number;
|
|
51
63
|
y: number;
|
|
@@ -64,6 +76,27 @@ export declare const MARK_VIEWBOX: {
|
|
|
64
76
|
readonly y: 3;
|
|
65
77
|
readonly size: 69;
|
|
66
78
|
};
|
|
79
|
+
/** Path data mirrored on the 64-unit grid (x → 64 − x); absolute M, L, H, Q, C, Z only. */
|
|
80
|
+
export declare function mirrorPath(d: string): string;
|
|
81
|
+
/** One shape of a placed buddy with its colours resolved; `fill` undefined inherits the surrounding fill. */
|
|
82
|
+
export interface BuddyShape {
|
|
83
|
+
d: string;
|
|
84
|
+
fill: string | undefined;
|
|
85
|
+
stroke: string;
|
|
86
|
+
width?: number;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* One buddy's shapes, back to front: the props behind, the body, the mouth, the eyes, the props above.
|
|
90
|
+
* `bodyFill`: `undefined` keeps the buddy's body colour, `null` leaves the body unfilled so it inherits.
|
|
91
|
+
*/
|
|
92
|
+
export declare function buddyShapes(b: PlacedBuddy, bodyFill?: string | null): {
|
|
93
|
+
paths: BuddyShape[];
|
|
94
|
+
above: BuddyShape[];
|
|
95
|
+
dots: BuddyDot[];
|
|
96
|
+
};
|
|
97
|
+
/** One placed buddy as SVG, drawn inside a group that sets the ink outline (`MARK_OUTLINE`). */
|
|
98
|
+
export declare function buddySvg(b: PlacedBuddy, line: number, bodyFill?: string | null): string;
|
|
99
|
+
export declare const MARK_OUTLINE: string;
|
|
67
100
|
/**
|
|
68
101
|
* The mark as SVG children (no outer <svg>). With `front` omitted the blue buddy's body has no fill of its own, so it
|
|
69
102
|
* takes the surrounding `fill` (the Panel's `--logo-fg`, which Portals set with `logoColor`); everything else is fixed.
|
|
@@ -74,8 +107,13 @@ export declare const MARK_SVG: string;
|
|
|
74
107
|
/** `<basePath>/icon.svg`: the whole mark on a transparent square, for a Portal's tab or menu (ADR-0006 amendment). */
|
|
75
108
|
export declare const ICON_SVG: string;
|
|
76
109
|
/**
|
|
77
|
-
* `<basePath>/favicon.svg`: the small cut for sizes below about 24 px,
|
|
78
|
-
*
|
|
79
|
-
*
|
|
110
|
+
* `<basePath>/favicon.svg`: the small cut for sizes below about 24 px, for a 16 pt browser tab (ADR-0022): Sai alone
|
|
111
|
+
* on a 32 grid at half scale, his body, eyes, cape and crown; no feet, arms or mouth. The same cut as the tab icons
|
|
112
|
+
* of the brand design sheet.
|
|
80
113
|
*/
|
|
81
114
|
export declare const FAVICON_SVG: string;
|
|
115
|
+
/**
|
|
116
|
+
* The Menu Bar Item's icon (spec §3.31): the favicon's small cut of Sai in colour, 18 pt square. It keeps its colours
|
|
117
|
+
* in light and dark mode, as the brand's tab icons do; the body's dark outline keeps it visible on both.
|
|
118
|
+
*/
|
|
119
|
+
export declare const MENUBAR_ICON_SVG: string;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
// The sideby mark: two buddies side by side, the amber one behind on the left and the blue one in front on the right,
|
|
2
2
|
// looking at each other (ADR-0022, the characters of the intro film). One source for the Panel header, the empty
|
|
3
3
|
// state, the Portal icon, the favicon and the app icon.
|
|
4
|
-
// One buddy is drawn on a 64-unit grid; the mark places two of them with a translate and a scale.
|
|
5
|
-
|
|
4
|
+
// One buddy is drawn on a 64-unit grid; the mark places two of them with a translate and a scale. Both share one
|
|
5
|
+
// gumdrop body; what tells them apart is a pair of props each, from the brand design sheet (ADR-0022 amendment):
|
|
6
|
+
// Sai, the blue one, wears a gold crown and a red cape; Bai, the amber one, a bent antenna and a spare battery.
|
|
7
|
+
/** The body both buddies share, back to front: feet, arms, body; then the eyes. No forehead `>`: that belongs to Nika. */
|
|
6
8
|
export const BUDDY = {
|
|
7
9
|
paths: [
|
|
8
10
|
{ d: 'M17 48 Q15 58 22 57 Q27 57 27 50 M37 50 Q37 57 42 57 Q49 58 47 48', fill: 'shade' },
|
|
@@ -11,14 +13,49 @@ export const BUDDY = {
|
|
|
11
13
|
d: 'M12 37 C12 27 17 23 25 23 H39 C47 23 52 27 52 37 C52 48 45 53 32 53 C19 53 12 48 12 37 Z',
|
|
12
14
|
fill: 'body',
|
|
13
15
|
},
|
|
14
|
-
{ d: 'M30 27 L34 29.31 L30 31.62', fill: 'none', stroke: 'chevron', width: 2.5 },
|
|
15
|
-
{ d: 'M29 46 Q32 49 35 46', fill: 'none', width: 2.5 },
|
|
16
16
|
],
|
|
17
17
|
eyes: [
|
|
18
18
|
{ cx: 22, cy: 38.5, rx: 4.5, ry: 6, fill: 'ink' },
|
|
19
19
|
{ cx: 42, cy: 38.5, rx: 4.5, ry: 6, fill: 'ink' },
|
|
20
20
|
],
|
|
21
21
|
};
|
|
22
|
+
const RED = '#e0685a';
|
|
23
|
+
const GOLD = '#ffd977';
|
|
24
|
+
const GREEN = '#5bb06a';
|
|
25
|
+
/** Sai (blue): a red cape behind the shoulders, a gold crown with a red jewel, a small smile. */
|
|
26
|
+
export const SAI = {
|
|
27
|
+
behind: [
|
|
28
|
+
{ d: 'M19 29 Q10 27 9 34 L4 53 Q13 57 22 50 L42 50 Q51 57 60 53 L55 34 Q54 27 45 29 Z', fill: RED },
|
|
29
|
+
],
|
|
30
|
+
mouth: { d: 'M29 46 Q32 49 35 46', fill: 'none', width: 2.5 },
|
|
31
|
+
above: [
|
|
32
|
+
{ d: 'M20 23 L17 10 L27 15 L32 6 L37 15 L47 10 L44 23 Z', fill: GOLD },
|
|
33
|
+
{
|
|
34
|
+
d: 'M35 19 C35 20.66 33.66 22 32 22 C30.34 22 29 20.66 29 19 C29 17.34 30.34 16 32 16 C33.66 16 35 17.34 35 19 Z',
|
|
35
|
+
fill: RED,
|
|
36
|
+
stroke: 'none',
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
};
|
|
40
|
+
/** Bai (amber): a green spare battery on its back, a bent antenna with a ball, an open laugh. */
|
|
41
|
+
export const BAI = {
|
|
42
|
+
behind: [
|
|
43
|
+
{
|
|
44
|
+
d: 'M52 23 H56 C58.21 23 60 24.79 60 27 L60 48 C60 50.21 58.21 52 56 52 H52 C49.79 52 48 50.21 48 48 L48 27 C48 24.79 49.79 23 52 23 Z',
|
|
45
|
+
fill: GREEN,
|
|
46
|
+
},
|
|
47
|
+
{ d: 'M52 23 L52 19 H57 L57 23', fill: GREEN },
|
|
48
|
+
{ d: 'M51 32 H57 M54 29 L54 35', fill: 'none', stroke: 'light', width: 2 },
|
|
49
|
+
],
|
|
50
|
+
mouth: { d: 'M29 46 Q32 52 35 46 Z', fill: 'ink', width: 2.5 },
|
|
51
|
+
above: [
|
|
52
|
+
{ d: 'M31 24 C24 17 26 9 36 10', fill: 'none', stroke: GREEN, width: 4 },
|
|
53
|
+
{
|
|
54
|
+
d: 'M44 10 C44 12.76 41.76 15 39 15 C36.24 15 34 12.76 34 10 C34 7.24 36.24 5 39 5 C41.76 5 44 7.24 44 10 Z',
|
|
55
|
+
fill: GREEN,
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
};
|
|
22
59
|
/** The eye highlights sit towards where the buddy looks: `1` right, `-1` left. */
|
|
23
60
|
export function highlights(look) {
|
|
24
61
|
return BUDDY.eyes.map((e) => ({
|
|
@@ -30,8 +67,8 @@ export function highlights(look) {
|
|
|
30
67
|
}));
|
|
31
68
|
}
|
|
32
69
|
export const MARK_COLORS = {
|
|
33
|
-
blue: { body: '#3f8fc4', shade: '#29658e'
|
|
34
|
-
amber: { body: '#f2b35e', shade: '#c98a35'
|
|
70
|
+
blue: { body: '#3f8fc4', shade: '#29658e' },
|
|
71
|
+
amber: { body: '#f2b35e', shade: '#c98a35' },
|
|
35
72
|
ink: '#1e2a44',
|
|
36
73
|
light: '#f6f0e5',
|
|
37
74
|
};
|
|
@@ -41,39 +78,76 @@ export const MARK = {
|
|
|
41
78
|
line: 2.75,
|
|
42
79
|
/** Outline width of a placed buddy before its scale, so the outline stays about 2.5 mark units. */
|
|
43
80
|
placedLine: 3.6,
|
|
44
|
-
back: { colors: MARK_COLORS.amber, look: 1, x: -2, y: 2, scale: 0.7 },
|
|
45
|
-
front: { colors: MARK_COLORS.blue, look: -1, x: 22, y: 16, scale: 0.7 },
|
|
81
|
+
back: { colors: MARK_COLORS.amber, props: BAI, look: 1, mirror: true, x: -2, y: 2, scale: 0.7 },
|
|
82
|
+
front: { colors: MARK_COLORS.blue, props: SAI, look: -1, x: 22, y: 16, scale: 0.7 },
|
|
46
83
|
};
|
|
47
84
|
/** The square the pair is drawn in, in mark units (the Panel's 40 px tile and the app icon tile). */
|
|
48
85
|
export const MARK_VIEWBOX = { x: -2.5, y: 3, size: 69 };
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
86
|
+
/** Path data mirrored on the 64-unit grid (x → 64 − x); absolute M, L, H, Q, C, Z only. */
|
|
87
|
+
export function mirrorPath(d) {
|
|
88
|
+
let cmd = '';
|
|
89
|
+
let n = 0;
|
|
90
|
+
return d.replace(/[MLHQCZ]|-?\d*\.?\d+/g, (t) => {
|
|
91
|
+
if (/[A-Z]/.test(t)) {
|
|
92
|
+
cmd = t;
|
|
93
|
+
n = 0;
|
|
94
|
+
return t;
|
|
95
|
+
}
|
|
96
|
+
const isX = cmd === 'H' || n++ % 2 === 0;
|
|
97
|
+
return isX ? String(Math.round((64 - Number(t)) * 1000) / 1000) : t;
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
const paint = (p) => (p === 'ink' ? MARK_COLORS.ink : p === 'light' ? MARK_COLORS.light : p);
|
|
101
|
+
/**
|
|
102
|
+
* One buddy's shapes, back to front: the props behind, the body, the mouth, the eyes, the props above.
|
|
103
|
+
* `bodyFill`: `undefined` keeps the buddy's body colour, `null` leaves the body unfilled so it inherits.
|
|
104
|
+
*/
|
|
105
|
+
export function buddyShapes(b, bodyFill) {
|
|
106
|
+
const resolve = (p) => {
|
|
107
|
+
const fill = p.fill === 'none'
|
|
108
|
+
? 'none'
|
|
109
|
+
: p.fill === 'shade'
|
|
110
|
+
? b.colors.shade
|
|
111
|
+
: p.fill === 'body'
|
|
112
|
+
? bodyFill === null
|
|
113
|
+
? undefined
|
|
114
|
+
: (bodyFill ?? b.colors.body)
|
|
115
|
+
: paint(p.fill);
|
|
116
|
+
const stroke = p.stroke === undefined ? MARK_COLORS.ink : p.stroke === 'none' ? 'none' : paint(p.stroke);
|
|
117
|
+
return { d: p.d, fill, stroke, ...(p.width ? { width: p.width } : {}) };
|
|
56
118
|
};
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
.
|
|
64
|
-
|
|
119
|
+
const prop = (p) => {
|
|
120
|
+
const s = resolve(p);
|
|
121
|
+
return b.mirror ? { ...s, d: mirrorPath(s.d) } : s;
|
|
122
|
+
};
|
|
123
|
+
return {
|
|
124
|
+
paths: [...b.props.behind.map(prop), ...BUDDY.paths.map(resolve), resolve(b.props.mouth)],
|
|
125
|
+
dots: [...BUDDY.eyes, ...highlights(b.look)],
|
|
126
|
+
above: b.props.above.map(prop),
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
function shapeSvg(s) {
|
|
130
|
+
const fill = s.fill === undefined ? '' : ` fill="${s.fill}"`;
|
|
131
|
+
const stroke = s.stroke === MARK_COLORS.ink ? '' : ` stroke="${s.stroke}"`;
|
|
132
|
+
const width = s.width ? ` stroke-width="${s.width}"` : '';
|
|
133
|
+
return `<path d="${s.d}"${fill}${stroke}${width}/>`;
|
|
134
|
+
}
|
|
135
|
+
/** One placed buddy as SVG, drawn inside a group that sets the ink outline (`MARK_OUTLINE`). */
|
|
136
|
+
export function buddySvg(b, line, bodyFill) {
|
|
137
|
+
const { paths, dots, above } = buddyShapes(b, bodyFill);
|
|
138
|
+
const eyes = dots
|
|
65
139
|
.map((e) => `<ellipse cx="${e.cx}" cy="${e.cy}" rx="${e.rx}" ry="${e.ry}" fill="${e.fill === 'ink' ? MARK_COLORS.ink : MARK_COLORS.light}"/>`)
|
|
66
140
|
.join('');
|
|
67
141
|
const transform = b.scale === 1 && b.x === 0 && b.y === 0 ? '' : ` transform="translate(${b.x} ${b.y}) scale(${b.scale})"`;
|
|
68
|
-
return `<g${transform} stroke-width="${line}">${paths}<g stroke="none">${
|
|
142
|
+
return `<g${transform} stroke-width="${line}">${paths.map(shapeSvg).join('')}<g stroke="none">${eyes}</g>${above.map(shapeSvg).join('')}</g>`;
|
|
69
143
|
}
|
|
70
|
-
const
|
|
144
|
+
export const MARK_OUTLINE = `stroke="${MARK_COLORS.ink}" stroke-linecap="round" stroke-linejoin="round"`;
|
|
71
145
|
/**
|
|
72
146
|
* The mark as SVG children (no outer <svg>). With `front` omitted the blue buddy's body has no fill of its own, so it
|
|
73
147
|
* takes the surrounding `fill` (the Panel's `--logo-fg`, which Portals set with `logoColor`); everything else is fixed.
|
|
74
148
|
*/
|
|
75
149
|
export function markSvgBody(front) {
|
|
76
|
-
return `<g ${
|
|
150
|
+
return `<g ${MARK_OUTLINE}>${buddySvg(MARK.back, MARK.placedLine)}${buddySvg(MARK.front, MARK.placedLine, front ?? null)}</g>`;
|
|
77
151
|
}
|
|
78
152
|
const viewBox = (v) => `${v.x} ${v.y} ${v.size} ${v.size}`;
|
|
79
153
|
/** The Panel's header logo: the mark sized for its 40 px tile. */
|
|
@@ -82,20 +156,24 @@ export const MARK_SVG = `<svg viewBox="${viewBox(MARK_VIEWBOX)}">${markSvgBody()
|
|
|
82
156
|
export const ICON_SVG = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="${viewBox(MARK_VIEWBOX)}" role="img" aria-label="sideby">` +
|
|
83
157
|
`${markSvgBody(MARK_COLORS.blue.body)}</svg>`;
|
|
84
158
|
/**
|
|
85
|
-
* `<basePath>/favicon.svg`: the small cut for sizes below about 24 px,
|
|
86
|
-
*
|
|
87
|
-
*
|
|
159
|
+
* `<basePath>/favicon.svg`: the small cut for sizes below about 24 px, for a 16 pt browser tab (ADR-0022): Sai alone
|
|
160
|
+
* on a 32 grid at half scale, his body, eyes, cape and crown; no feet, arms or mouth. The same cut as the tab icons
|
|
161
|
+
* of the brand design sheet.
|
|
88
162
|
*/
|
|
89
163
|
export const FAVICON_SVG = (() => {
|
|
90
|
-
const
|
|
91
|
-
const
|
|
92
|
-
const light = MARK_COLORS.light;
|
|
164
|
+
const sai = { ...MARK.front, x: 0, y: 0, scale: 1 };
|
|
165
|
+
const { paths, dots, above } = buddyShapes(sai);
|
|
93
166
|
const body = BUDDY.paths[2].d;
|
|
167
|
+
const keep = paths.filter((p) => p.d === body || SAI.behind.some((q) => q.d === p.d));
|
|
168
|
+
const eyes = dots
|
|
169
|
+
.map((e) => `<ellipse cx="${e.cx}" cy="${e.cy}" rx="${e.rx}" ry="${e.ry}" fill="${e.fill === 'ink' ? MARK_COLORS.ink : MARK_COLORS.light}"/>`)
|
|
170
|
+
.join('');
|
|
94
171
|
return (`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" role="img" aria-label="sideby">` +
|
|
95
|
-
`<g
|
|
96
|
-
|
|
97
|
-
`<g transform="translate(-7.2 -12.675) scale(0.725)"><path d="${body}" fill="${blue.body}" stroke="${ink}" stroke-width="2.759"/>` +
|
|
98
|
-
`<ellipse cx="22.5" cy="38" rx="5.5" ry="7" fill="${ink}"/><ellipse cx="41.5" cy="38" rx="5.5" ry="7" fill="${ink}"/>` +
|
|
99
|
-
`<ellipse cx="20.6" cy="35.4" rx="2.1" ry="2.6" fill="${light}"/><ellipse cx="39.6" cy="35.4" rx="2.1" ry="2.6" fill="${light}"/>` +
|
|
100
|
-
`</g></g></svg>`);
|
|
172
|
+
`<g transform="translate(0 -1) scale(.5)"><g ${MARK_OUTLINE} stroke-width="${MARK.line}">` +
|
|
173
|
+
`${keep.map(shapeSvg).join('')}<g stroke="none">${eyes}</g>${above.map(shapeSvg).join('')}</g></g></svg>`);
|
|
101
174
|
})();
|
|
175
|
+
/**
|
|
176
|
+
* The Menu Bar Item's icon (spec §3.31): the favicon's small cut of Sai in colour, 18 pt square. It keeps its colours
|
|
177
|
+
* in light and dark mode, as the brand's tab icons do; the body's dark outline keeps it visible on both.
|
|
178
|
+
*/
|
|
179
|
+
export const MENUBAR_ICON_SVG = FAVICON_SVG.replace('<svg ', '<svg width="18" height="18" ');
|