@7ots/cli 0.1.8 → 0.1.9
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/cli/7ots.mjs +15 -3
- package/package.json +1 -1
package/cli/7ots.mjs
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { spawn, spawnSync } from 'node:child_process';
|
|
8
|
-
import { existsSync, mkdirSync, openSync, writeFileSync } from 'node:fs';
|
|
8
|
+
import { existsSync, mkdirSync, openSync, statSync, writeFileSync } from 'node:fs';
|
|
9
9
|
import { createRequire } from 'node:module';
|
|
10
|
-
import { join } from 'node:path';
|
|
10
|
+
import { dirname, join } from 'node:path';
|
|
11
11
|
import { createIdentity, describe, identityPrompt, loadIdentity, cleanSeed } from './lib/identity.mjs';
|
|
12
12
|
import { loadConfig } from './lib/config.mjs';
|
|
13
13
|
import { t, cliLang } from './lib/i18n.mjs';
|
|
@@ -190,12 +190,24 @@ function menuLang() {
|
|
|
190
190
|
return pick(process.env.SEVENOTS_LANG) || pick(lang) || pick(String(process.env.LC_ALL || process.env.LC_MESSAGES || process.env.LANG || '').slice(0, 2).toLowerCase()) || cliLang();
|
|
191
191
|
}
|
|
192
192
|
|
|
193
|
+
// Electron installed per user (~/.7ots/electron) has a chrome-sandbox that is not root:4755, and Ubuntu 24.04+
|
|
194
|
+
// blocks unprivileged user namespaces (AppArmor), so Chromium aborts with SIGTRAP before showing a window.
|
|
195
|
+
// Without a usable setuid helper, run unsandboxed: the window only loads the pet's own 127.0.0.1 page.
|
|
196
|
+
function electronSandboxArgs(bin) {
|
|
197
|
+
if (process.platform !== 'linux') return [];
|
|
198
|
+
try {
|
|
199
|
+
const st = statSync(join(dirname(bin), 'chrome-sandbox'));
|
|
200
|
+
if (st.uid === 0 && st.mode & 0o4000) return [];
|
|
201
|
+
} catch {}
|
|
202
|
+
return ['--no-sandbox'];
|
|
203
|
+
}
|
|
204
|
+
|
|
193
205
|
function openDesktop({ opaque = false, view3d = false } = {}) {
|
|
194
206
|
console.log(dim(t('pet.electron')));
|
|
195
207
|
const { bin, error } = ensureElectron();
|
|
196
208
|
if (!bin) return Promise.resolve({ ok: false, error });
|
|
197
209
|
const log = openSync(homeFile('electron.log'), 'a');
|
|
198
|
-
const child = spawn(bin, [join(PKG_ROOT, 'cli', 'pet', 'electron', 'main.cjs')], {
|
|
210
|
+
const child = spawn(bin, [join(PKG_ROOT, 'cli', 'pet', 'electron', 'main.cjs'), ...electronSandboxArgs(bin)], {
|
|
199
211
|
stdio: ['ignore', log, log],
|
|
200
212
|
detached: true,
|
|
201
213
|
env: { ...process.env, SEVENOTS_PET_URL: `http://127.0.0.1:${PET_PORT}`, SEVENOTS_PET_TOKEN: petToken(), SEVENOTS_PET_OPAQUE: opaque ? '1' : '', SEVENOTS_PET_3D: view3d ? '1' : '', SEVENOTS_PET_LANG: menuLang() },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@7ots/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "7ots.com — your AI companion with a face of its own: a desktop pet that watches over your coding agent (Claude Code and shell hooks), a personal assistant (reminders, alerts, notes, opens sites, sees your screen if allowed) and a reproducible identity (face, personality, voice) for any agent — in apuchat meet calls, Orquesta projects or your own server.",
|
|
5
5
|
"homepage": "https://7ots.com",
|
|
6
6
|
"repository": {
|