sideby 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +453 -2
- package/README.zh-CN.md +455 -0
- package/dist/build.json +1 -0
- package/dist/src/cli/args.d.ts +13 -0
- package/dist/src/cli/args.js +38 -0
- package/dist/src/cli/commands.d.ts +37 -0
- package/dist/src/cli/commands.js +487 -0
- package/dist/src/cli/format.d.ts +16 -0
- package/dist/src/cli/format.js +80 -0
- package/dist/src/cli/json-schemas.d.ts +2 -0
- package/dist/src/cli/json-schemas.js +224 -0
- package/dist/src/cli/main.d.ts +2 -0
- package/dist/src/cli/main.js +186 -0
- package/dist/src/cli/schemas.d.ts +1 -0
- package/dist/src/cli/schemas.js +16 -0
- package/dist/src/core/account-name.d.ts +2 -0
- package/dist/src/core/account-name.js +2 -0
- package/dist/src/core/accounts.d.ts +18 -0
- package/dist/src/core/accounts.js +116 -0
- package/dist/src/core/config.d.ts +60 -0
- package/dist/src/core/config.js +181 -0
- package/dist/src/core/create.d.ts +30 -0
- package/dist/src/core/create.js +126 -0
- package/dist/src/core/doctor.d.ts +41 -0
- package/dist/src/core/doctor.js +171 -0
- package/dist/src/core/errors.d.ts +12 -0
- package/dist/src/core/errors.js +14 -0
- package/dist/src/core/file-memo.d.ts +24 -0
- package/dist/src/core/file-memo.js +41 -0
- package/dist/src/core/fs-safe.d.ts +38 -0
- package/dist/src/core/fs-safe.js +205 -0
- package/dist/src/core/handoff.d.ts +41 -0
- package/dist/src/core/handoff.js +54 -0
- package/dist/src/core/identity.d.ts +23 -0
- package/dist/src/core/identity.js +79 -0
- package/dist/src/core/last-doctor.d.ts +36 -0
- package/dist/src/core/last-doctor.js +69 -0
- package/dist/src/core/launch.d.ts +35 -0
- package/dist/src/core/launch.js +108 -0
- package/dist/src/core/login-path.d.ts +23 -0
- package/dist/src/core/login-path.js +96 -0
- package/dist/src/core/paths.d.ts +13 -0
- package/dist/src/core/paths.js +32 -0
- package/dist/src/core/quota-levels.d.ts +19 -0
- package/dist/src/core/quota-levels.js +34 -0
- package/dist/src/core/secret-file.d.ts +30 -0
- package/dist/src/core/secret-file.js +116 -0
- package/dist/src/core/share-mode-names.d.ts +1 -0
- package/dist/src/core/share-mode-names.js +10 -0
- package/dist/src/core/share-modes.d.ts +24 -0
- package/dist/src/core/share-modes.js +405 -0
- package/dist/src/core/shell-init.d.ts +25 -0
- package/dist/src/core/shell-init.js +61 -0
- package/dist/src/core/skill-check.d.ts +11 -0
- package/dist/src/core/skill-check.js +57 -0
- package/dist/src/core/usage-days.d.ts +15 -0
- package/dist/src/core/usage-days.js +33 -0
- package/dist/src/core/version.d.ts +9 -0
- package/dist/src/core/version.js +46 -0
- package/dist/src/desktop/app.d.ts +60 -0
- package/dist/src/desktop/app.js +316 -0
- package/dist/src/desktop/icon.d.ts +16 -0
- package/dist/src/desktop/icon.js +174 -0
- package/dist/src/families/claude/index.d.ts +10 -0
- package/dist/src/families/claude/index.js +124 -0
- package/dist/src/families/claude/layout.d.ts +6 -0
- package/dist/src/families/claude/layout.js +5 -0
- package/dist/src/families/claude/quota-cache.d.ts +31 -0
- package/dist/src/families/claude/quota-cache.js +111 -0
- package/dist/src/families/claude/quota.d.ts +3 -0
- package/dist/src/families/claude/quota.js +53 -0
- package/dist/src/families/claude/usage.d.ts +22 -0
- package/dist/src/families/claude/usage.js +146 -0
- package/dist/src/families/codex/index.d.ts +5 -0
- package/dist/src/families/codex/index.js +67 -0
- package/dist/src/families/codex/rollout.d.ts +67 -0
- package/dist/src/families/codex/rollout.js +298 -0
- package/dist/src/families/grok/index.d.ts +8 -0
- package/dist/src/families/grok/index.js +78 -0
- package/dist/src/families/index.d.ts +3 -0
- package/dist/src/families/index.js +40 -0
- package/dist/src/families/logos.d.ts +21 -0
- package/dist/src/families/logos.js +26 -0
- package/dist/src/families/pi/index.d.ts +3 -0
- package/dist/src/families/pi/index.js +54 -0
- package/dist/src/families/shared/toml.d.ts +5 -0
- package/dist/src/families/shared/toml.js +16 -0
- package/dist/src/index.d.ts +5 -0
- package/dist/src/index.js +4 -0
- package/dist/src/panel/background.d.ts +62 -0
- package/dist/src/panel/background.js +274 -0
- package/dist/src/panel/handler.d.ts +93 -0
- package/dist/src/panel/handler.js +411 -0
- package/dist/src/panel/i18n.d.ts +287 -0
- package/dist/src/panel/i18n.js +570 -0
- package/dist/src/panel/page-logic.d.ts +154 -0
- package/dist/src/panel/page-logic.js +326 -0
- package/dist/src/panel/page-script.d.ts +2 -0
- package/dist/src/panel/page-script.js +1633 -0
- package/dist/src/panel/page-styles.d.ts +7 -0
- package/dist/src/panel/page-styles.js +514 -0
- package/dist/src/panel/page.d.ts +20 -0
- package/dist/src/panel/page.js +96 -0
- package/dist/src/panel/server.d.ts +32 -0
- package/dist/src/panel/server.js +133 -0
- package/dist/src/panel/theme.d.ts +116 -0
- package/dist/src/panel/theme.js +132 -0
- package/dist/src/plugins/account-script.d.ts +4 -0
- package/dist/src/plugins/account-script.js +66 -0
- package/dist/src/plugins/bus.d.ts +33 -0
- package/dist/src/plugins/bus.js +84 -0
- package/dist/src/plugins/loader.d.ts +58 -0
- package/dist/src/plugins/loader.js +250 -0
- package/dist/src/quota/claude-statusline.d.ts +28 -0
- package/dist/src/quota/claude-statusline.js +301 -0
- package/dist/src/quota/statusline-tap.d.ts +11 -0
- package/dist/src/quota/statusline-tap.js +104 -0
- package/dist/src/runtime.d.ts +149 -0
- package/dist/src/runtime.js +371 -0
- package/dist/src/types.d.ts +278 -0
- package/dist/src/types.js +3 -0
- package/dist/testing/demo.d.ts +8 -0
- package/dist/testing/demo.js +50 -0
- package/dist/testing/index.d.ts +36 -0
- package/dist/testing/index.js +117 -0
- package/package.json +66 -4
- package/schemas/alias.json +102 -0
- package/schemas/app-install.json +74 -0
- package/schemas/app-uninstall.json +54 -0
- package/schemas/config.json +166 -0
- package/schemas/doctor.json +229 -0
- package/schemas/error.json +25 -0
- package/schemas/list.json +177 -0
- package/schemas/new.json +181 -0
- package/schemas/next.json +127 -0
- package/schemas/plugins.json +74 -0
- package/schemas/quota-setup.json +60 -0
- package/schemas/quota-teardown.json +30 -0
- package/schemas/quota.json +203 -0
- package/skills/sideby/SKILL.md +52 -0
- package/skills/sideby/references/accounts.md +31 -0
- package/skills/sideby/references/diagnose.md +47 -0
- package/skills/sideby/references/handoff.md +41 -0
- package/skills/sideby/references/quota.md +14 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export const DEMO_ITEMS = [
|
|
2
|
+
{ path: 'skills', mode: 'link' },
|
|
3
|
+
{ path: 'rules.md', mode: 'link' },
|
|
4
|
+
{ path: 'hooks', mode: 'copy', hostMessage: 'hooks must be a real directory' },
|
|
5
|
+
{ path: 'theme.json', mode: 'link-or-copy' },
|
|
6
|
+
{ path: 'trusted.toml', mode: 'link-or-local' },
|
|
7
|
+
{ path: 'cli.json', mode: 'local' },
|
|
8
|
+
{ path: 'config.toml', mode: 'local-if-api' },
|
|
9
|
+
{ path: 'auth.json', mode: 'info', credential: true, noSymlink: true },
|
|
10
|
+
{ path: '.demo.json', mode: 'json-key', key: 'servers', mainPath: '.demo.json', credential: true },
|
|
11
|
+
];
|
|
12
|
+
export function demoFamily(overrides = {}) {
|
|
13
|
+
return {
|
|
14
|
+
id: 'demo',
|
|
15
|
+
title: 'Demo',
|
|
16
|
+
bin: 'demo',
|
|
17
|
+
installUrl: 'https://example.invalid/demo',
|
|
18
|
+
selectVar: 'DEMO_HOME',
|
|
19
|
+
layout: { main: '.demo', account: '.demo-<name>' },
|
|
20
|
+
hijackVars: ['DEMO_API_KEY', 'DEMO_BASE_URL'],
|
|
21
|
+
apiVars: ['DEMO_BASE_URL', 'DEMO_API_KEY'],
|
|
22
|
+
sharedItems: DEMO_ITEMS,
|
|
23
|
+
login: { args: ['login'], hint: 'run demo login' },
|
|
24
|
+
...overrides,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export function demoPlugin(def = demoFamily(), extra) {
|
|
28
|
+
return {
|
|
29
|
+
name: 'demo-family',
|
|
30
|
+
async register(api) {
|
|
31
|
+
api.family(def);
|
|
32
|
+
await extra?.(api);
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export function asBuiltin(plugin, defaultEnabled = true) {
|
|
37
|
+
return { plugin, version: '0.0.0-test', description: 'test', defaultEnabled };
|
|
38
|
+
}
|
|
39
|
+
/** Populates a Main Account with one source for every demo Shared Item. */
|
|
40
|
+
export async function seedDemoMain(write) {
|
|
41
|
+
await write('.demo/skills/a/SKILL.md', '# a\n');
|
|
42
|
+
await write('.demo/rules.md', 'rules\n');
|
|
43
|
+
await write('.demo/hooks/pre.sh', '#!/bin/sh\n', 0o755);
|
|
44
|
+
await write('.demo/theme.json', '{"dark":true}\n');
|
|
45
|
+
await write('.demo/trusted.toml', 'trusted = []\n');
|
|
46
|
+
await write('.demo/cli.json', '{"model":"x"}\n');
|
|
47
|
+
await write('.demo/config.toml', 'model = "main"\n');
|
|
48
|
+
await write('.demo/auth.json', '{"token":"fake-main"}\n', 0o600);
|
|
49
|
+
await write('.demo.json', '{"servers":{"a":{"cmd":"a"}},"user":"main"}\n', 0o600);
|
|
50
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Env } from '../src/types.ts';
|
|
2
|
+
export interface FakeHome {
|
|
3
|
+
home: string;
|
|
4
|
+
/** Directory prepended to PATH; fake Host binaries live here. */
|
|
5
|
+
bin: string;
|
|
6
|
+
/** Environment for code under test: HOME, XDG dirs and PATH all point inside the fake HOME. */
|
|
7
|
+
env: Env;
|
|
8
|
+
path(...parts: string[]): string;
|
|
9
|
+
write(rel: string, data: string, mode?: number): Promise<string>;
|
|
10
|
+
mkdir(rel: string): Promise<string>;
|
|
11
|
+
}
|
|
12
|
+
/** Runs `fn` with a fresh fake HOME and removes it afterwards. */
|
|
13
|
+
export declare function withFakeHome<T>(fn: (h: FakeHome) => Promise<T>): Promise<T>;
|
|
14
|
+
export interface FakeHostOptions {
|
|
15
|
+
exitCode?: number;
|
|
16
|
+
/** Signal the fake Host sends itself after recording, for example `SIGTERM`. */
|
|
17
|
+
selfSignal?: string;
|
|
18
|
+
/** Seconds to sleep before exiting, so tests can signal it. */
|
|
19
|
+
sleep?: number;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Installs a fake Host executable named `name` that appends its argv, selected env and received signals
|
|
23
|
+
* to `<bin>/<name>.log` as JSON lines.
|
|
24
|
+
*/
|
|
25
|
+
export declare function fakeHost(h: FakeHome, name: string, opts?: FakeHostOptions): Promise<string>;
|
|
26
|
+
export interface HostRecord {
|
|
27
|
+
argv: string[];
|
|
28
|
+
env: Record<string, string>;
|
|
29
|
+
pid: number;
|
|
30
|
+
signal?: string;
|
|
31
|
+
}
|
|
32
|
+
export declare function readHostLog(h: FakeHome, name: string): Promise<HostRecord[]>;
|
|
33
|
+
/** Snapshot of every path under `root` with its type, symlink target or content hash, for write audits. */
|
|
34
|
+
export declare function snapshot(root: string): Promise<Map<string, string>>;
|
|
35
|
+
/** Lists keys whose snapshot value differs, appeared or disappeared. */
|
|
36
|
+
export declare function diffSnapshots(before: Map<string, string>, after: Map<string, string>): string[];
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
// Test helpers for sideby and its Plugins. Every test runs against a throwaway HOME and fake Host binaries,
|
|
2
|
+
// so nothing a test does can reach the developer's real accounts.
|
|
3
|
+
import { chmod, mkdir, mkdtemp, readdir, readFile, readlink, realpath, rm, writeFile } from 'node:fs/promises';
|
|
4
|
+
import { homedir, tmpdir } from 'node:os';
|
|
5
|
+
import { join } from 'node:path';
|
|
6
|
+
/** Runs `fn` with a fresh fake HOME and removes it afterwards. */
|
|
7
|
+
export async function withFakeHome(fn) {
|
|
8
|
+
const base = await realpath(await mkdtemp(join(tmpdir(), 'sideby-test-')));
|
|
9
|
+
const home = join(base, 'home');
|
|
10
|
+
const bin = join(base, 'bin');
|
|
11
|
+
await mkdir(home, { recursive: true });
|
|
12
|
+
await mkdir(bin, { recursive: true });
|
|
13
|
+
const realHome = homedir();
|
|
14
|
+
if (home === realHome || home.startsWith(`${realHome}/.`))
|
|
15
|
+
throw new Error('fake HOME resolved inside the real HOME');
|
|
16
|
+
const env = {
|
|
17
|
+
HOME: home,
|
|
18
|
+
XDG_CONFIG_HOME: join(home, '.config'),
|
|
19
|
+
XDG_STATE_HOME: join(home, '.local', 'state'),
|
|
20
|
+
PATH: `${bin}:/usr/bin:/bin`,
|
|
21
|
+
NO_COLOR: '1',
|
|
22
|
+
};
|
|
23
|
+
const h = {
|
|
24
|
+
home,
|
|
25
|
+
bin,
|
|
26
|
+
env,
|
|
27
|
+
path: (...parts) => join(home, ...parts),
|
|
28
|
+
async write(rel, data, mode = 0o644) {
|
|
29
|
+
const p = join(home, rel);
|
|
30
|
+
await mkdir(join(p, '..'), { recursive: true });
|
|
31
|
+
await writeFile(p, data, { mode });
|
|
32
|
+
await chmod(p, mode);
|
|
33
|
+
return p;
|
|
34
|
+
},
|
|
35
|
+
async mkdir(rel) {
|
|
36
|
+
const p = join(home, rel);
|
|
37
|
+
await mkdir(p, { recursive: true });
|
|
38
|
+
return p;
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
try {
|
|
42
|
+
return await fn(h);
|
|
43
|
+
}
|
|
44
|
+
finally {
|
|
45
|
+
await rm(base, { recursive: true, force: true });
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Installs a fake Host executable named `name` that appends its argv, selected env and received signals
|
|
50
|
+
* to `<bin>/<name>.log` as JSON lines.
|
|
51
|
+
*/
|
|
52
|
+
export async function fakeHost(h, name, opts = {}) {
|
|
53
|
+
const log = join(h.bin, `${name}.log`);
|
|
54
|
+
const script = `#!/usr/bin/env node
|
|
55
|
+
const fs = require('node:fs')
|
|
56
|
+
const log = ${JSON.stringify(log)}
|
|
57
|
+
const rec = (o) => fs.appendFileSync(log, JSON.stringify(o) + '\\n')
|
|
58
|
+
rec({ argv: process.argv.slice(2), env: process.env, pid: process.pid })
|
|
59
|
+
for (const s of ['SIGINT', 'SIGTERM', 'SIGHUP', 'SIGQUIT']) process.on(s, () => { rec({ signal: s }); process.exit(${opts.sleep ? 100 : 0}) })
|
|
60
|
+
const finish = () => {
|
|
61
|
+
${opts.selfSignal ? `process.removeAllListeners(${JSON.stringify(opts.selfSignal)}); process.kill(process.pid, ${JSON.stringify(opts.selfSignal)})` : `process.exit(${opts.exitCode ?? 0})`}
|
|
62
|
+
}
|
|
63
|
+
${opts.sleep ? `setTimeout(finish, ${Math.round(opts.sleep * 1000)})` : 'finish()'}
|
|
64
|
+
`;
|
|
65
|
+
const p = join(h.bin, name);
|
|
66
|
+
await writeFile(p, script.replace('#!/usr/bin/env node', `#!${process.execPath}`), { mode: 0o755 });
|
|
67
|
+
return p;
|
|
68
|
+
}
|
|
69
|
+
export async function readHostLog(h, name) {
|
|
70
|
+
try {
|
|
71
|
+
const raw = await readFile(join(h.bin, `${name}.log`), 'utf8');
|
|
72
|
+
return raw
|
|
73
|
+
.split('\n')
|
|
74
|
+
.filter(Boolean)
|
|
75
|
+
.map((l) => JSON.parse(l));
|
|
76
|
+
}
|
|
77
|
+
catch {
|
|
78
|
+
return [];
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/** Snapshot of every path under `root` with its type, symlink target or content hash, for write audits. */
|
|
82
|
+
export async function snapshot(root) {
|
|
83
|
+
const out = new Map();
|
|
84
|
+
const { createHash } = await import('node:crypto');
|
|
85
|
+
const { lstat } = await import('node:fs/promises');
|
|
86
|
+
async function walk(dir, rel) {
|
|
87
|
+
let entries;
|
|
88
|
+
try {
|
|
89
|
+
entries = await readdir(dir);
|
|
90
|
+
}
|
|
91
|
+
catch {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
for (const e of entries.sort()) {
|
|
95
|
+
const p = join(dir, e);
|
|
96
|
+
const r = rel ? `${rel}/${e}` : e;
|
|
97
|
+
const st = await lstat(p);
|
|
98
|
+
if (st.isSymbolicLink())
|
|
99
|
+
out.set(r, `link:${await readlink(p)}`);
|
|
100
|
+
else if (st.isDirectory()) {
|
|
101
|
+
out.set(r, `dir:${(st.mode & 0o777).toString(8)}`);
|
|
102
|
+
await walk(p, r);
|
|
103
|
+
}
|
|
104
|
+
else
|
|
105
|
+
out.set(r, `file:${(st.mode & 0o777).toString(8)}:${createHash('sha256')
|
|
106
|
+
.update(await readFile(p))
|
|
107
|
+
.digest('hex')}`);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
await walk(root, '');
|
|
111
|
+
return out;
|
|
112
|
+
}
|
|
113
|
+
/** Lists keys whose snapshot value differs, appeared or disappeared. */
|
|
114
|
+
export function diffSnapshots(before, after) {
|
|
115
|
+
const keys = new Set([...before.keys(), ...after.keys()]);
|
|
116
|
+
return [...keys].filter((k) => before.get(k) !== after.get(k)).sort();
|
|
117
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,68 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sideby",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Run every AI coding account side by side: Claude Code, Codex, Grok and pi, with one shared config and a quota panel.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"claude-code",
|
|
9
|
+
"codex",
|
|
10
|
+
"grok",
|
|
11
|
+
"pi",
|
|
12
|
+
"multi-account",
|
|
13
|
+
"ai-coding",
|
|
14
|
+
"cli",
|
|
15
|
+
"quota"
|
|
16
|
+
],
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/Adonis0123/sideby.git"
|
|
20
|
+
},
|
|
21
|
+
"homepage": "https://github.com/Adonis0123/sideby#readme",
|
|
22
|
+
"bugs": "https://github.com/Adonis0123/sideby/issues",
|
|
23
|
+
"engines": {
|
|
24
|
+
"node": ">=22.18.0"
|
|
25
|
+
},
|
|
26
|
+
"bin": {
|
|
27
|
+
"sideby": "dist/src/cli/main.js"
|
|
28
|
+
},
|
|
29
|
+
"exports": {
|
|
30
|
+
".": {
|
|
31
|
+
"types": "./dist/src/index.d.ts",
|
|
32
|
+
"default": "./dist/src/index.js"
|
|
33
|
+
},
|
|
34
|
+
"./testing": {
|
|
35
|
+
"types": "./dist/testing/index.d.ts",
|
|
36
|
+
"default": "./dist/testing/index.js"
|
|
37
|
+
},
|
|
38
|
+
"./package.json": "./package.json"
|
|
39
|
+
},
|
|
40
|
+
"files": [
|
|
41
|
+
"dist",
|
|
42
|
+
"schemas",
|
|
43
|
+
"skills",
|
|
44
|
+
"README.md",
|
|
45
|
+
"README.zh-CN.md",
|
|
46
|
+
"LICENSE"
|
|
47
|
+
],
|
|
48
|
+
"scripts": {
|
|
49
|
+
"build": "rm -rf dist && tsc -p tsconfig.build.json && chmod +x dist/src/cli/main.js && node scripts/write-build-id.ts",
|
|
50
|
+
"typecheck": "tsc --noEmit",
|
|
51
|
+
"lint": "biome check .",
|
|
52
|
+
"format": "biome check --write .",
|
|
53
|
+
"test": "node --test --test-concurrency=4 \"src/**/*.test.ts\" \"testing/**/*.test.ts\"",
|
|
54
|
+
"schemas": "node src/cli/schemas.ts",
|
|
55
|
+
"leak-check": "sh scripts/leak-check.sh",
|
|
56
|
+
"check": "pnpm typecheck && pnpm lint && pnpm test && pnpm leak-check",
|
|
57
|
+
"version": "node scripts/sync-skill-version.ts && git add skills/sideby/SKILL.md"
|
|
58
|
+
},
|
|
59
|
+
"dependencies": {
|
|
60
|
+
"typebox": "^1.3.34"
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"@biomejs/biome": "2.5.15",
|
|
64
|
+
"@types/node": "^22.18.0",
|
|
65
|
+
"typescript": "^7.0.2"
|
|
66
|
+
},
|
|
67
|
+
"packageManager": "pnpm@10.15.0"
|
|
68
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "sideby/alias.json",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"required": [
|
|
6
|
+
"schemaVersion",
|
|
7
|
+
"ok",
|
|
8
|
+
"alias",
|
|
9
|
+
"status"
|
|
10
|
+
],
|
|
11
|
+
"properties": {
|
|
12
|
+
"schemaVersion": {
|
|
13
|
+
"type": "number",
|
|
14
|
+
"const": 1
|
|
15
|
+
},
|
|
16
|
+
"ok": {
|
|
17
|
+
"type": "boolean",
|
|
18
|
+
"description": "False when a config `shellInitFile` was not rewritten."
|
|
19
|
+
},
|
|
20
|
+
"alias": {
|
|
21
|
+
"type": "string"
|
|
22
|
+
},
|
|
23
|
+
"status": {
|
|
24
|
+
"anyOf": [
|
|
25
|
+
{
|
|
26
|
+
"type": "string",
|
|
27
|
+
"const": "added"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"type": "string",
|
|
31
|
+
"const": "exists"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"type": "string",
|
|
35
|
+
"const": "removed"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"type": "string",
|
|
39
|
+
"const": "absent"
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
"account": {
|
|
44
|
+
"type": "string"
|
|
45
|
+
},
|
|
46
|
+
"args": {
|
|
47
|
+
"type": "array",
|
|
48
|
+
"items": {
|
|
49
|
+
"type": "string"
|
|
50
|
+
},
|
|
51
|
+
"description": "Host arguments `sideby run <alias>` adds."
|
|
52
|
+
},
|
|
53
|
+
"shellInitFiles": {
|
|
54
|
+
"type": "array",
|
|
55
|
+
"items": {
|
|
56
|
+
"type": "object",
|
|
57
|
+
"required": [
|
|
58
|
+
"shell",
|
|
59
|
+
"path",
|
|
60
|
+
"ok"
|
|
61
|
+
],
|
|
62
|
+
"properties": {
|
|
63
|
+
"shell": {
|
|
64
|
+
"anyOf": [
|
|
65
|
+
{
|
|
66
|
+
"type": "string",
|
|
67
|
+
"const": "zsh"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"type": "string",
|
|
71
|
+
"const": "bash"
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
},
|
|
75
|
+
"path": {
|
|
76
|
+
"type": "string"
|
|
77
|
+
},
|
|
78
|
+
"ok": {
|
|
79
|
+
"type": "boolean"
|
|
80
|
+
},
|
|
81
|
+
"action": {
|
|
82
|
+
"anyOf": [
|
|
83
|
+
{
|
|
84
|
+
"type": "string",
|
|
85
|
+
"const": "written"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"type": "string",
|
|
89
|
+
"const": "unchanged"
|
|
90
|
+
}
|
|
91
|
+
]
|
|
92
|
+
},
|
|
93
|
+
"message": {
|
|
94
|
+
"type": "string"
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
"description": "One entry per config `shellInitFile`, rewritten after the change."
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
"title": "sideby alias add|rm --json"
|
|
102
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "sideby/app-install.json",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"required": [
|
|
6
|
+
"schemaVersion",
|
|
7
|
+
"platform",
|
|
8
|
+
"path",
|
|
9
|
+
"files",
|
|
10
|
+
"mode",
|
|
11
|
+
"node",
|
|
12
|
+
"entry",
|
|
13
|
+
"updated",
|
|
14
|
+
"hints"
|
|
15
|
+
],
|
|
16
|
+
"properties": {
|
|
17
|
+
"schemaVersion": {
|
|
18
|
+
"type": "number",
|
|
19
|
+
"const": 1
|
|
20
|
+
},
|
|
21
|
+
"platform": {
|
|
22
|
+
"anyOf": [
|
|
23
|
+
{
|
|
24
|
+
"type": "string",
|
|
25
|
+
"const": "darwin"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"type": "string",
|
|
29
|
+
"const": "linux"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
"path": {
|
|
34
|
+
"type": "string"
|
|
35
|
+
},
|
|
36
|
+
"files": {
|
|
37
|
+
"type": "array",
|
|
38
|
+
"items": {
|
|
39
|
+
"type": "string"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"mode": {
|
|
43
|
+
"anyOf": [
|
|
44
|
+
{
|
|
45
|
+
"type": "string",
|
|
46
|
+
"const": "panel"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"type": "string",
|
|
50
|
+
"const": "url"
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
"url": {
|
|
55
|
+
"type": "string"
|
|
56
|
+
},
|
|
57
|
+
"node": {
|
|
58
|
+
"type": "string"
|
|
59
|
+
},
|
|
60
|
+
"entry": {
|
|
61
|
+
"type": "string"
|
|
62
|
+
},
|
|
63
|
+
"updated": {
|
|
64
|
+
"type": "boolean"
|
|
65
|
+
},
|
|
66
|
+
"hints": {
|
|
67
|
+
"type": "array",
|
|
68
|
+
"items": {
|
|
69
|
+
"type": "string"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"title": "sideby app install --json"
|
|
74
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "sideby/app-uninstall.json",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"required": [
|
|
6
|
+
"schemaVersion",
|
|
7
|
+
"platform",
|
|
8
|
+
"removed",
|
|
9
|
+
"skipped"
|
|
10
|
+
],
|
|
11
|
+
"properties": {
|
|
12
|
+
"schemaVersion": {
|
|
13
|
+
"type": "number",
|
|
14
|
+
"const": 1
|
|
15
|
+
},
|
|
16
|
+
"platform": {
|
|
17
|
+
"anyOf": [
|
|
18
|
+
{
|
|
19
|
+
"type": "string",
|
|
20
|
+
"const": "darwin"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"type": "string",
|
|
24
|
+
"const": "linux"
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
"removed": {
|
|
29
|
+
"type": "array",
|
|
30
|
+
"items": {
|
|
31
|
+
"type": "string"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"skipped": {
|
|
35
|
+
"type": "array",
|
|
36
|
+
"items": {
|
|
37
|
+
"type": "object",
|
|
38
|
+
"required": [
|
|
39
|
+
"path",
|
|
40
|
+
"reason"
|
|
41
|
+
],
|
|
42
|
+
"properties": {
|
|
43
|
+
"path": {
|
|
44
|
+
"type": "string"
|
|
45
|
+
},
|
|
46
|
+
"reason": {
|
|
47
|
+
"type": "string"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"title": "sideby app uninstall --json"
|
|
54
|
+
}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "sideby/config.json",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"properties": {
|
|
6
|
+
"$schema": {
|
|
7
|
+
"type": "string"
|
|
8
|
+
},
|
|
9
|
+
"accounts": {
|
|
10
|
+
"type": "object",
|
|
11
|
+
"patternProperties": {
|
|
12
|
+
"^.*$": {
|
|
13
|
+
"type": "object",
|
|
14
|
+
"properties": {
|
|
15
|
+
"args": {
|
|
16
|
+
"type": "array",
|
|
17
|
+
"items": {
|
|
18
|
+
"type": "string"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"additionalProperties": false
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"description": "Per-Account settings keyed by `<family>:<name>`."
|
|
26
|
+
},
|
|
27
|
+
"aliases": {
|
|
28
|
+
"type": "object",
|
|
29
|
+
"patternProperties": {
|
|
30
|
+
"^[A-Za-z_][A-Za-z0-9_-]*$": {
|
|
31
|
+
"anyOf": [
|
|
32
|
+
{
|
|
33
|
+
"type": "string"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"type": "object",
|
|
37
|
+
"required": [
|
|
38
|
+
"account"
|
|
39
|
+
],
|
|
40
|
+
"properties": {
|
|
41
|
+
"account": {
|
|
42
|
+
"type": "string",
|
|
43
|
+
"pattern": "^[^:]+:.+$",
|
|
44
|
+
"description": "The Account ref, `<family>:<name>`."
|
|
45
|
+
},
|
|
46
|
+
"args": {
|
|
47
|
+
"type": "array",
|
|
48
|
+
"items": {
|
|
49
|
+
"type": "string"
|
|
50
|
+
},
|
|
51
|
+
"description": "Host arguments `sideby run <alias>` adds after the Account `args`, before the user’s."
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"additionalProperties": false
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"description": "Short shell function names created by `sideby shell-init`, mapped to an Account ref or to `{ account, args }`."
|
|
60
|
+
},
|
|
61
|
+
"ignore": {
|
|
62
|
+
"type": "array",
|
|
63
|
+
"items": {
|
|
64
|
+
"type": "string"
|
|
65
|
+
},
|
|
66
|
+
"description": "Account refs that are not Accounts."
|
|
67
|
+
},
|
|
68
|
+
"pluginDirs": {
|
|
69
|
+
"type": "array",
|
|
70
|
+
"items": {
|
|
71
|
+
"type": "string"
|
|
72
|
+
},
|
|
73
|
+
"description": "Absolute or `~/` paths of Plugin directories."
|
|
74
|
+
},
|
|
75
|
+
"plugins": {
|
|
76
|
+
"type": "object",
|
|
77
|
+
"patternProperties": {
|
|
78
|
+
"^.*$": {
|
|
79
|
+
"type": "object",
|
|
80
|
+
"patternProperties": {
|
|
81
|
+
"^.*$": {}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"description": "Per-Plugin settings; `enabled: false` turns a Plugin off."
|
|
86
|
+
},
|
|
87
|
+
"extraSharedItems": {
|
|
88
|
+
"type": "object",
|
|
89
|
+
"patternProperties": {
|
|
90
|
+
"^.*$": {
|
|
91
|
+
"type": "array",
|
|
92
|
+
"items": {
|
|
93
|
+
"type": "object",
|
|
94
|
+
"required": [
|
|
95
|
+
"path",
|
|
96
|
+
"mode"
|
|
97
|
+
],
|
|
98
|
+
"properties": {
|
|
99
|
+
"path": {
|
|
100
|
+
"type": "string",
|
|
101
|
+
"minLength": 1,
|
|
102
|
+
"pattern": "^(?!/)(?!.*(^|/)\\.\\.(/|$)).+$"
|
|
103
|
+
},
|
|
104
|
+
"mode": {
|
|
105
|
+
"anyOf": [
|
|
106
|
+
{
|
|
107
|
+
"type": "string",
|
|
108
|
+
"const": "link"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"type": "string",
|
|
112
|
+
"const": "copy"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"type": "string",
|
|
116
|
+
"const": "link-or-copy"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"type": "string",
|
|
120
|
+
"const": "link-or-local"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"type": "string",
|
|
124
|
+
"const": "local"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"type": "string",
|
|
128
|
+
"const": "local-if-api"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"type": "string",
|
|
132
|
+
"const": "info"
|
|
133
|
+
}
|
|
134
|
+
]
|
|
135
|
+
},
|
|
136
|
+
"noSymlink": {
|
|
137
|
+
"type": "boolean"
|
|
138
|
+
},
|
|
139
|
+
"credential": {
|
|
140
|
+
"type": "boolean"
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
"additionalProperties": false
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
"shellInitFile": {
|
|
149
|
+
"type": "object",
|
|
150
|
+
"properties": {
|
|
151
|
+
"zsh": {
|
|
152
|
+
"type": "string",
|
|
153
|
+
"minLength": 1
|
|
154
|
+
},
|
|
155
|
+
"bash": {
|
|
156
|
+
"type": "string",
|
|
157
|
+
"minLength": 1
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
"additionalProperties": false,
|
|
161
|
+
"description": "Absolute or `~/` paths of files sideby rewrites with the `sideby shell-init <shell>` output whenever it adds an Account or an alias; source the file from your shell rc."
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
"additionalProperties": false,
|
|
165
|
+
"title": "sideby config"
|
|
166
|
+
}
|