sleev 0.0.11 → 0.0.13
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 +19 -39
- package/dist/auth/browser.d.ts +12 -0
- package/dist/auth/browser.js +33 -24
- package/dist/auth/browser.js.map +1 -0
- package/dist/auth/firebase-tokens.d.ts +39 -0
- package/dist/auth/firebase-tokens.js +173 -0
- package/dist/auth/firebase-tokens.js.map +1 -0
- package/dist/auth/firebase.d.ts +17 -0
- package/dist/auth/firebase.js +55 -0
- package/dist/auth/firebase.js.map +1 -0
- package/dist/auth/login.d.ts +22 -0
- package/dist/auth/login.js +31 -28
- package/dist/auth/login.js.map +1 -0
- package/dist/auth/loopback.d.ts +19 -0
- package/dist/auth/loopback.js +114 -44
- package/dist/auth/loopback.js.map +1 -0
- package/dist/auth/schema.d.ts +26 -0
- package/dist/auth/schema.js +59 -17
- package/dist/auth/schema.js.map +1 -0
- package/dist/auth/token.d.ts +19 -0
- package/dist/auth/token.js +53 -0
- package/dist/auth/token.js.map +1 -0
- package/dist/auth/verify.d.ts +6 -0
- package/dist/auth/verify.js +22 -0
- package/dist/auth/verify.js.map +1 -0
- package/dist/cli.d.ts +8 -0
- package/dist/cli.js +245 -59
- package/dist/cli.js.map +1 -0
- package/dist/config/paths.d.ts +12 -0
- package/dist/config/paths.js +34 -0
- package/dist/config/paths.js.map +1 -0
- package/dist/config/store.d.ts +63 -0
- package/dist/config/store.js +270 -0
- package/dist/config/store.js.map +1 -0
- package/dist/control/local-installations.d.ts +13 -0
- package/dist/control/local-installations.js +37 -0
- package/dist/control/local-installations.js.map +1 -0
- package/dist/daemon/config.d.ts +10 -0
- package/dist/daemon/config.js +52 -0
- package/dist/daemon/config.js.map +1 -0
- package/dist/daemon/controller.d.ts +29 -0
- package/dist/daemon/controller.js +34 -0
- package/dist/daemon/controller.js.map +1 -0
- package/dist/daemon/health.d.ts +8 -0
- package/dist/daemon/health.js +47 -0
- package/dist/daemon/health.js.map +1 -0
- package/dist/daemon/start.d.ts +5 -0
- package/dist/daemon/start.js +24 -0
- package/dist/daemon/start.js.map +1 -0
- package/dist/daemon/systemd.d.ts +35 -0
- package/dist/daemon/systemd.js +181 -0
- package/dist/daemon/systemd.js.map +1 -0
- package/dist/gateway/acquire.d.ts +14 -0
- package/dist/gateway/acquire.js +112 -0
- package/dist/gateway/acquire.js.map +1 -0
- package/dist/gateway/manifest.d.ts +26 -0
- package/dist/gateway/manifest.js +98 -0
- package/dist/gateway/manifest.js.map +1 -0
- package/dist/gateway/platform.d.ts +5 -0
- package/dist/gateway/platform.js +27 -0
- package/dist/gateway/platform.js.map +1 -0
- package/dist/harness/claude.d.ts +8 -0
- package/dist/{apps → harness}/claude.js +28 -28
- package/dist/harness/claude.js.map +1 -0
- package/dist/harness/codex.d.ts +10 -0
- package/dist/harness/codex.js +213 -0
- package/dist/harness/codex.js.map +1 -0
- package/dist/harness/index.d.ts +13 -0
- package/dist/harness/index.js +63 -0
- package/dist/harness/index.js.map +1 -0
- package/dist/harness/opencode-config.d.ts +8 -0
- package/dist/{apps → harness}/opencode-config.js +116 -83
- package/dist/harness/opencode-config.js.map +1 -0
- package/dist/harness/opencode.d.ts +14 -0
- package/dist/harness/opencode.js +50 -0
- package/dist/harness/opencode.js.map +1 -0
- package/dist/harness/providers.d.ts +8 -0
- package/dist/harness/providers.js +30 -0
- package/dist/harness/providers.js.map +1 -0
- package/dist/harness/types.d.ts +14 -0
- package/dist/harness/types.js +2 -0
- package/dist/harness/types.js.map +1 -0
- package/dist/product.d.ts +12 -0
- package/dist/product.js +53 -10
- package/dist/product.js.map +1 -0
- package/dist/tui/clipboard.d.ts +1 -0
- package/dist/tui/clipboard.js +48 -0
- package/dist/tui/clipboard.js.map +1 -0
- package/dist/tui/openTuiApp.d.ts +1 -0
- package/dist/tui/openTuiApp.js +1436 -0
- package/dist/tui/openTuiApp.js.map +1 -0
- package/dist/tui/pages/flow-screen.d.ts +50 -0
- package/dist/tui/pages/flow-screen.js +435 -0
- package/dist/tui/pages/flow-screen.js.map +1 -0
- package/dist/tui/pages/footer.d.ts +7 -0
- package/dist/tui/pages/footer.js +14 -0
- package/dist/tui/pages/footer.js.map +1 -0
- package/dist/tui/pages/home-screen.d.ts +19 -0
- package/dist/tui/pages/home-screen.js +89 -0
- package/dist/tui/pages/home-screen.js.map +1 -0
- package/dist/tui/pages/index.d.ts +17 -0
- package/dist/tui/pages/index.js +11 -0
- package/dist/tui/pages/index.js.map +1 -0
- package/dist/tui/pages/local-setup-screen.d.ts +23 -0
- package/dist/tui/pages/local-setup-screen.js +134 -0
- package/dist/tui/pages/local-setup-screen.js.map +1 -0
- package/dist/tui/pages/location-card.d.ts +19 -0
- package/dist/tui/pages/location-card.js +116 -0
- package/dist/tui/pages/location-card.js.map +1 -0
- package/dist/tui/pages/menu-screen.d.ts +24 -0
- package/dist/tui/pages/menu-screen.js +117 -0
- package/dist/tui/pages/menu-screen.js.map +1 -0
- package/dist/tui/pages/session-grid.d.ts +23 -0
- package/dist/tui/pages/session-grid.js +552 -0
- package/dist/tui/pages/session-grid.js.map +1 -0
- package/dist/tui/pages/setup-screen.d.ts +15 -0
- package/dist/tui/pages/setup-screen.js +80 -0
- package/dist/tui/pages/setup-screen.js.map +1 -0
- package/dist/tui/pages/terminal-log.d.ts +14 -0
- package/dist/tui/pages/terminal-log.js +104 -0
- package/dist/tui/pages/terminal-log.js.map +1 -0
- package/dist/tui/pages/welcome-screen.d.ts +16 -0
- package/dist/tui/pages/welcome-screen.js +80 -0
- package/dist/tui/pages/welcome-screen.js.map +1 -0
- package/dist/tui/saved-tokens.d.ts +10 -0
- package/dist/tui/saved-tokens.js +104 -0
- package/dist/tui/saved-tokens.js.map +1 -0
- package/dist/tui/theme.d.ts +25 -0
- package/dist/tui/theme.js +27 -0
- package/dist/tui/theme.js.map +1 -0
- package/package.json +55 -38
- package/dist/apps/codex.js +0 -184
- package/dist/apps/opencode.js +0 -158
- package/dist/apps.js +0 -148
- package/dist/auth/command.js +0 -109
- package/dist/auth/index.js +0 -2
- package/dist/auth/validation.js +0 -27
- package/dist/credentials/index.js +0 -3
- package/dist/credentials/schema.js +0 -63
- package/dist/credentials/store.js +0 -52
- package/dist/harnesses.js +0 -66
- package/dist/index.js +0 -3
- package/dist/providers.js +0 -30
- package/dist/terminal.js +0 -55
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
// Validation for the on-disk Sleev auth file.
|
|
2
|
-
export function createAuthFile(input) {
|
|
3
|
-
const parsed = parseAuthInput(input);
|
|
4
|
-
return { version: 1, ...parsed };
|
|
5
|
-
}
|
|
6
|
-
export function parseAuthInput(input) {
|
|
7
|
-
if (!isRecord(input))
|
|
8
|
-
throw new Error('Sleev auth input must be an object.');
|
|
9
|
-
return parseAuthRecord(input);
|
|
10
|
-
}
|
|
11
|
-
export function parseAuthFile(input) {
|
|
12
|
-
if (!isRecord(input))
|
|
13
|
-
throw new Error('Sleev auth file must be an object.');
|
|
14
|
-
const version = input.version;
|
|
15
|
-
if (version !== 1)
|
|
16
|
-
throw new Error('Sleev auth file version is unsupported.');
|
|
17
|
-
return { version, ...parseAuthInput(input) };
|
|
18
|
-
}
|
|
19
|
-
function parseAuthRecord(input) {
|
|
20
|
-
if (!isRecord(input))
|
|
21
|
-
throw new Error('Sleev auth input must be an object.');
|
|
22
|
-
const token = stringField(input, 'token');
|
|
23
|
-
const label = nullableStringField(input, 'label');
|
|
24
|
-
const proxyUrl = stringField(input, 'proxyUrl');
|
|
25
|
-
const createdAt = stringField(input, 'createdAt');
|
|
26
|
-
if (!token.startsWith('slv_live_'))
|
|
27
|
-
throw new Error('Sleev auth token is invalid.');
|
|
28
|
-
validateUrl(proxyUrl, 'Sleev auth proxy URL');
|
|
29
|
-
if (Number.isNaN(Date.parse(createdAt)))
|
|
30
|
-
throw new Error('Sleev auth createdAt is invalid.');
|
|
31
|
-
return { token, label, proxyUrl, createdAt };
|
|
32
|
-
}
|
|
33
|
-
function stringField(input, key) {
|
|
34
|
-
const value = input[key];
|
|
35
|
-
if (typeof value !== 'string')
|
|
36
|
-
throw new Error(`${key} must be a string.`);
|
|
37
|
-
return value;
|
|
38
|
-
}
|
|
39
|
-
function nullableStringField(input, key) {
|
|
40
|
-
const value = input[key];
|
|
41
|
-
if (value === null || typeof value === 'undefined')
|
|
42
|
-
return null;
|
|
43
|
-
if (typeof value !== 'string')
|
|
44
|
-
throw new Error(`${key} must be a string or null.`);
|
|
45
|
-
return value;
|
|
46
|
-
}
|
|
47
|
-
function validateUrl(raw, name) {
|
|
48
|
-
const url = parseUrl(raw, name);
|
|
49
|
-
if (url.protocol !== 'https:' && url.protocol !== 'http:') {
|
|
50
|
-
throw new Error(`${name} must use http or https.`);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
function parseUrl(raw, name) {
|
|
54
|
-
try {
|
|
55
|
-
return new URL(raw);
|
|
56
|
-
}
|
|
57
|
-
catch {
|
|
58
|
-
throw new Error(`${name} must be a valid URL.`);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
function isRecord(input) {
|
|
62
|
-
return typeof input === 'object' && input !== null && !Array.isArray(input);
|
|
63
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
// Credential storage owns auth.json path resolution, validation, and safe writes.
|
|
2
|
-
import { chmod, mkdir, readFile, rename, rm, writeFile } from 'node:fs/promises';
|
|
3
|
-
import { dirname, join } from 'node:path';
|
|
4
|
-
import { homedir } from 'node:os';
|
|
5
|
-
import { parseAuthFile } from './schema.js';
|
|
6
|
-
export function authPath(env = process.env, platform = process.platform) {
|
|
7
|
-
return join(configRoot(env, platform), 'sleev', 'auth.json');
|
|
8
|
-
}
|
|
9
|
-
export async function readAuth(path = authPath()) {
|
|
10
|
-
try {
|
|
11
|
-
const raw = await readFile(path, 'utf8');
|
|
12
|
-
return parseAuthFile(JSON.parse(raw));
|
|
13
|
-
}
|
|
14
|
-
catch (err) {
|
|
15
|
-
if (errorCode(err) === 'ENOENT')
|
|
16
|
-
return null;
|
|
17
|
-
throw err;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
export async function writeAuth(auth, path = authPath()) {
|
|
21
|
-
const checked = parseAuthFile(auth);
|
|
22
|
-
const dir = dirname(path);
|
|
23
|
-
const tmp = join(dir, `.auth.${process.pid}.${Date.now()}.tmp`);
|
|
24
|
-
const body = `${JSON.stringify(checked, null, 2)}\n`;
|
|
25
|
-
await mkdir(dir, { recursive: true, mode: 0o700 });
|
|
26
|
-
await writeFile(tmp, body, { mode: 0o600 });
|
|
27
|
-
await rename(tmp, path);
|
|
28
|
-
await chmod(path, 0o600);
|
|
29
|
-
return { path };
|
|
30
|
-
}
|
|
31
|
-
export async function clearAuth(path = authPath()) {
|
|
32
|
-
try {
|
|
33
|
-
await rm(path);
|
|
34
|
-
}
|
|
35
|
-
catch (err) {
|
|
36
|
-
if (errorCode(err) === 'ENOENT')
|
|
37
|
-
return;
|
|
38
|
-
throw err;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
function configRoot(env, platform) {
|
|
42
|
-
if (platform === 'win32') {
|
|
43
|
-
return env.APPDATA || join(homedir(), 'AppData', 'Roaming');
|
|
44
|
-
}
|
|
45
|
-
return env.XDG_CONFIG_HOME || join(homedir(), '.config');
|
|
46
|
-
}
|
|
47
|
-
function errorCode(err) {
|
|
48
|
-
if (typeof err !== 'object' || err === null || !('code' in err))
|
|
49
|
-
return undefined;
|
|
50
|
-
const code = err.code;
|
|
51
|
-
return typeof code === 'string' ? code : undefined;
|
|
52
|
-
}
|
package/dist/harnesses.js
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
// Harness orchestration owns setup and cleanup across supported local tools.
|
|
2
|
-
import { setupClaude, unpatchClaude } from './apps/claude.js';
|
|
3
|
-
import { setupCodex, unpatchCodex } from './apps/codex.js';
|
|
4
|
-
import { availableOpenCodeProviders, setupOpenCode, unpatchOpenCode } from './apps/opencode.js';
|
|
5
|
-
export const HARNESSES = [
|
|
6
|
-
{
|
|
7
|
-
id: 'opencode',
|
|
8
|
-
label: 'opencode',
|
|
9
|
-
command: 'opencode',
|
|
10
|
-
available: async () => {
|
|
11
|
-
try {
|
|
12
|
-
return (await availableOpenCodeProviders()).length > 0;
|
|
13
|
-
}
|
|
14
|
-
catch {
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
setup: setupOpenCode,
|
|
19
|
-
unpatch: unpatchOpenCode,
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
id: 'claude-code',
|
|
23
|
-
label: 'claude code',
|
|
24
|
-
command: 'claude',
|
|
25
|
-
setup: setupClaude,
|
|
26
|
-
unpatch: unpatchClaude,
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
id: 'codex',
|
|
30
|
-
label: 'codex',
|
|
31
|
-
command: 'codex',
|
|
32
|
-
setup: setupCodex,
|
|
33
|
-
unpatch: unpatchCodex,
|
|
34
|
-
},
|
|
35
|
-
];
|
|
36
|
-
export async function setupHarnesses(auth, apps) {
|
|
37
|
-
for (const harness of HARNESSES) {
|
|
38
|
-
if (!apps.includes(harness.id))
|
|
39
|
-
continue;
|
|
40
|
-
await harness.setup(auth);
|
|
41
|
-
}
|
|
42
|
-
return { label: harnessLabels(apps) };
|
|
43
|
-
}
|
|
44
|
-
export async function unpatchHarnesses() {
|
|
45
|
-
const failures = [];
|
|
46
|
-
await Promise.all(HARNESSES.map(async (harness) => {
|
|
47
|
-
try {
|
|
48
|
-
await harness.unpatch();
|
|
49
|
-
}
|
|
50
|
-
catch (err) {
|
|
51
|
-
failures.push(`${harness.label}: ${message(err)}`);
|
|
52
|
-
}
|
|
53
|
-
}));
|
|
54
|
-
return { failures };
|
|
55
|
-
}
|
|
56
|
-
export function harnessLabels(ids) {
|
|
57
|
-
if (ids.length === 0)
|
|
58
|
-
return 'none';
|
|
59
|
-
const labels = ids.map((id) => HARNESSES.find((harness) => harness.id === id)?.label ?? id);
|
|
60
|
-
return labels.join(', ');
|
|
61
|
-
}
|
|
62
|
-
function message(err) {
|
|
63
|
-
if (err instanceof Error)
|
|
64
|
-
return err.message;
|
|
65
|
-
return String(err);
|
|
66
|
-
}
|
package/dist/index.js
DELETED
package/dist/providers.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
// Provider registry owns Sleev support metadata shared across harness adapters.
|
|
2
|
-
export const PROVIDERS = [
|
|
3
|
-
{ id: 'openai', label: 'OpenAI' },
|
|
4
|
-
{ id: 'anthropic', label: 'Anthropic' },
|
|
5
|
-
{
|
|
6
|
-
id: 'opencode',
|
|
7
|
-
label: 'OpenCode Zen',
|
|
8
|
-
models: [
|
|
9
|
-
'claude-sonnet-4-5',
|
|
10
|
-
'claude-sonnet-4-6',
|
|
11
|
-
'claude-opus-4-5',
|
|
12
|
-
'claude-opus-4-6',
|
|
13
|
-
'claude-opus-4-7',
|
|
14
|
-
'gpt-5.3-codex',
|
|
15
|
-
'gpt-5.3-codex-spark',
|
|
16
|
-
'gpt-5.4',
|
|
17
|
-
'gpt-5.4-mini',
|
|
18
|
-
'gpt-5.4-nano',
|
|
19
|
-
'gpt-5.4-pro',
|
|
20
|
-
'gpt-5.5',
|
|
21
|
-
'gpt-5.5-pro',
|
|
22
|
-
],
|
|
23
|
-
},
|
|
24
|
-
];
|
|
25
|
-
export function provider(id) {
|
|
26
|
-
const value = PROVIDERS.find((item) => item.id === id);
|
|
27
|
-
if (!value)
|
|
28
|
-
throw new Error(`Unsupported provider: ${id}`);
|
|
29
|
-
return value;
|
|
30
|
-
}
|
package/dist/terminal.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
// Terminal presentation helpers keep command output consistent without deps.
|
|
2
|
-
const styles = {
|
|
3
|
-
accent: ['\x1b[36m', '\x1b[39m'],
|
|
4
|
-
bold: ['\x1b[1m', '\x1b[22m'],
|
|
5
|
-
dim: ['\x1b[2m', '\x1b[22m'],
|
|
6
|
-
good: ['\x1b[32m', '\x1b[39m'],
|
|
7
|
-
bad: ['\x1b[31m', '\x1b[39m'],
|
|
8
|
-
};
|
|
9
|
-
export function brand(output) {
|
|
10
|
-
line(output, paint(output, 'accent', 'sleev'));
|
|
11
|
-
line(output);
|
|
12
|
-
}
|
|
13
|
-
export function step(output, text) {
|
|
14
|
-
line(output, `${paint(output, 'accent', '>')} ${text}`);
|
|
15
|
-
}
|
|
16
|
-
export function success(output, text) {
|
|
17
|
-
line(output, `${paint(output, 'good', 'OK')} ${text}`);
|
|
18
|
-
}
|
|
19
|
-
export function failure(output, text) {
|
|
20
|
-
line(output, `${paint(output, 'bad', 'ERR')} ${text}`);
|
|
21
|
-
}
|
|
22
|
-
export function note(output, text) {
|
|
23
|
-
line(output, paint(output, 'dim', text));
|
|
24
|
-
}
|
|
25
|
-
export function field(output, name, value) {
|
|
26
|
-
line(output, ` ${paint(output, 'dim', name.padEnd(10))} ${value}`);
|
|
27
|
-
}
|
|
28
|
-
export function choice(output, label, active) {
|
|
29
|
-
if (!active)
|
|
30
|
-
return ` ${label}`;
|
|
31
|
-
return `${paint(output, 'accent', '>')} ${paint(output, 'bold', label)}`;
|
|
32
|
-
}
|
|
33
|
-
export function prompt(output, text) {
|
|
34
|
-
return `${paint(output, 'accent', '?')} ${text} `;
|
|
35
|
-
}
|
|
36
|
-
export function inlineCode(output, value) {
|
|
37
|
-
return paint(output, 'bold', value);
|
|
38
|
-
}
|
|
39
|
-
export function line(output, text = '') {
|
|
40
|
-
output.write(`${text}\n`);
|
|
41
|
-
}
|
|
42
|
-
function paint(output, style, text) {
|
|
43
|
-
if (!color(output))
|
|
44
|
-
return text;
|
|
45
|
-
const [open, close] = styles[style];
|
|
46
|
-
return `${open}${text}${close}`;
|
|
47
|
-
}
|
|
48
|
-
function color(output) {
|
|
49
|
-
const stream = output;
|
|
50
|
-
if (process.env.NO_COLOR)
|
|
51
|
-
return false;
|
|
52
|
-
if (process.env.FORCE_COLOR && process.env.FORCE_COLOR !== '0')
|
|
53
|
-
return true;
|
|
54
|
-
return stream.isTTY === true;
|
|
55
|
-
}
|