@7ots/cli 0.1.42 → 0.1.43

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.
@@ -16,6 +16,8 @@
16
16
  * GET /memory?token=… everything it keeps about you: notes, what it saw, what it said, its state
17
17
  * GET /account 7ots.com account: signed in?, its ots · POST /account/login|use|logout
18
18
  * POST /screen/look look at the screen now (access.screen) · POST /seen/forget
19
+ * POST /control { goal } → it uses the mouse and keyboard until done (access.control, control.mjs)
20
+ * POST /control/stop ends it at the next step · GET /control → { on, running: { goal, step, last } | null }
19
21
  * POST /reminders/cancel { id }
20
22
  * GET /processes what the pet is running (reminders, watchers, screen) + the computer's (access.processes)
21
23
  * POST /watchers/cancel { id | 'all' }
@@ -68,6 +70,7 @@ import { sttProvider, transcribe, warmStt } from './stt.mjs';
68
70
  import { createWake } from './wake.mjs';
69
71
  import { localVoices, synthesizeLocal, warmLocal } from './tts-local.mjs';
70
72
  import { createScreenWatcher } from './screen.mjs';
73
+ import { createControl } from './control.mjs';
71
74
  import { createSiteContext } from './prowl.mjs';
72
75
  import { createSenses } from './senses/index.mjs';
73
76
  import { ensureVendor, vendorFile, vendorStatus } from './senses/vendor.mjs';
@@ -430,10 +433,49 @@ export function startPetServer({ port = PET_PORT, log = () => {} } = {}) {
430
433
  },
431
434
  });
432
435
 
436
+ // Uses the computer for you (access.control): screenshot → one action → again; it walks to where it clicks.
437
+ const CONTROL_SAY = {
438
+ en: { done: 'Done.', stopped: 'Stopped.', taken: 'You moved the mouse: I stopped.', rejected: 'OK, I won’t.', steps: 'I ran out of steps, I stopped here.', no_vision: 'My brain can’t see images: pick one that can (Claude CLI or an API) in settings.', wayland: 'On Wayland I can’t move the mouse: log in with an X11 session (Xorg).', missing: 'I need {m} installed to use the mouse.', busy: 'I’m already doing something on your computer.', screen: 'I can’t see your screen.', screenshot: 'I can’t take a screenshot.', error: 'Something broke while I was at it.' },
439
+ es: { done: 'Listo.', stopped: 'Paré.', taken: 'Moviste el mouse: paré.', rejected: 'Ok, no lo hago.', steps: 'Se me acabaron los pasos, paré aquí.', no_vision: 'Mi cerebro no ve imágenes: elige uno que sí (Claude CLI o una API) en ajustes.', wayland: 'En Wayland no puedo mover el mouse: entra con una sesión X11 (Xorg).', missing: 'Necesito {m} instalado para usar el mouse.', busy: 'Ya estoy haciendo algo en tu computador.', screen: 'No logro ver tu pantalla.', screenshot: 'No puedo sacar una captura.', error: 'Algo se rompió mientras lo hacía.' },
440
+ pt: { done: 'Pronto.', stopped: 'Parei.', taken: 'Você mexeu o mouse: parei.', rejected: 'Ok, não faço.', steps: 'Acabaram meus passos, parei aqui.', no_vision: 'Meu cérebro não vê imagens: escolha um que veja (Claude CLI ou uma API) nas configurações.', wayland: 'No Wayland não consigo mover o mouse: entre numa sessão X11 (Xorg).', missing: 'Preciso do {m} instalado para usar o mouse.', busy: 'Já estou fazendo algo no seu computador.', screen: 'Não consigo ver sua tela.', screenshot: 'Não consigo tirar uma captura.', error: 'Algo quebrou enquanto eu fazia.' },
441
+ };
442
+ let controlLang = lang;
443
+ const control = createControl({
444
+ brain,
445
+ name: identity.name,
446
+ lang: () => ({ es: 'Spanish', pt: 'Portuguese' })[controlLang] || 'English',
447
+ maxSteps: () => config.control?.maxSteps,
448
+ confirm,
449
+ openUrl,
450
+ log,
451
+ onStep: ({ step, point, say }) => {
452
+ lastSpoke = Date.now();
453
+ broadcast({ control: { step }, ...(say ? { say } : {}), ...(point ? { point } : {}), gesture: 'point' });
454
+ },
455
+ });
456
+ /** Starts a goal in the background; it says how it went. → the immediate answer of control.run's checks. */
457
+ function startControl(goal, said = lang) {
458
+ if (config.access.control !== true) return Promise.resolve({ ok: false, error: 'off' });
459
+ controlLang = said;
460
+ const L = CONTROL_SAY[said] || CONTROL_SAY.en;
461
+ track({ type: 'tool', text: `control: ${String(goal).slice(0, 80)}` });
462
+ broadcast({ control: { goal, step: 0 }, thinking: true });
463
+ const p = control.run(goal).then((r) => {
464
+ const text = r.said || (L[r.ok ? 'done' : r.error] || L.error).replace('{m}', r.missing || '');
465
+ lastSpoke = Date.now();
466
+ pet.lastTalk = lastSpoke;
467
+ broadcast({ control: null, thinking: false, say: text, gesture: r.ok ? 'nod' : 'think', point: 'user' });
468
+ if (config.access.notify !== false && !r.ok && r.error !== 'stopped') notify(`${identity.name} · 7ots`, text);
469
+ return r;
470
+ });
471
+ return p;
472
+ }
473
+
433
474
  let extras; // captured for refresh after Orquesta connects
434
475
  // The assistant: reminders that speak, notify and open the tab; notes it learns.
435
476
  const assistant = createAssistant({
436
477
  brain,
478
+ control: { on: () => config.access.control === true, start: (goal, said) => startControl(goal, said) },
437
479
  access: () => config.access,
438
480
  memoryTokens: () => config.memory.tokens,
439
481
  lang,
@@ -886,6 +928,7 @@ export function startPetServer({ port = PET_PORT, log = () => {} } = {}) {
886
928
  return json(off ? 200 : 502, { connected: !off, error: off ? undefined : e.message });
887
929
  }
888
930
  }
931
+ if (req.method === 'GET' && p === '/control') return json(200, { on: config.access.control === true, running: control.status });
889
932
  if (req.method !== 'POST') return json(405, { error: 'method' });
890
933
  if (p === '/stt') {
891
934
  const chunks = [];
@@ -1038,6 +1081,15 @@ export function startPetServer({ port = PET_PORT, log = () => {} } = {}) {
1038
1081
  return json(200, { ok: false, error: e.message, ...(e.code ? { code: e.code } : {}), ms: Date.now() - t0 });
1039
1082
  }
1040
1083
  }
1084
+ if (p === '/control/stop') return json(200, { ok: control.stop() });
1085
+ if (p === '/control') {
1086
+ const goal = String(data.goal || '').trim().slice(0, 600);
1087
+ if (!goal) return json(400, { error: 'goal' });
1088
+ if (config.access.control !== true) return json(403, { error: 'off' });
1089
+ if (control.status) return json(409, { error: 'busy', running: control.status });
1090
+ const r = data.wait ? await startControl(goal, data.lang || lang) : (startControl(goal, data.lang || lang), { ok: true, started: true });
1091
+ return json(200, r);
1092
+ }
1041
1093
  if (p === '/screen/look') return json(200, { seen: config.access.screen ? await watcher.look({ force: true }) : null, enabled: config.access.screen });
1042
1094
  if (p === '/seen/forget') return watcher.forget(), json(200, { ok: true });
1043
1095
  if (p === '/account/login') {
@@ -1358,7 +1410,7 @@ ${keys.map((k) => FIELDS[k]).join('\n')}`;
1358
1410
  name: identity.name,
1359
1411
  lang,
1360
1412
  visitor: !!process.env.SEVENOTS_COMPANION, // a visiting ot: the host's settings rule shared things (scenes)
1361
- config: { brain: config.brain, pet: { ...config.pet, scenes: sceneConf() }, access: config.access, voice: config.voice, screen: config.screen, memory: config.memory, senses: config.senses },
1413
+ config: { brain: config.brain, pet: { ...config.pet, scenes: sceneConf() }, access: config.access, voice: config.voice, screen: config.screen, control: config.control, memory: config.memory, senses: config.senses },
1362
1414
  brain: brainLabel(config.brain),
1363
1415
  clis: detectClis(),
1364
1416
  stt: sttProvider(keys),
@@ -1459,6 +1511,7 @@ ${keys.map((k) => FIELDS[k]).join('\n')}`;
1459
1511
  if (n.fps !== undefined) next.senses.fps = Math.max(1, Math.min(15, Math.round(Number(n.fps)) || 5));
1460
1512
  }
1461
1513
  if (d.screen?.every !== undefined) next.screen.every = Math.max(1, Math.min(60, Math.round(Number(d.screen.every)) || 5));
1514
+ if (d.control?.maxSteps !== undefined) next.control = { ...next.control, maxSteps: Math.max(1, Math.min(60, Math.round(Number(d.control.maxSteps)) || 25)) };
1462
1515
  let reload = false;
1463
1516
  if (d.voice) {
1464
1517
  const vk = d.voice.kind ?? next.voice.kind;
package/cli/lib/vm.mjs CHANGED
@@ -11,13 +11,15 @@
11
11
  * browse fetches up to 3 public URLs from the request, then summarises
12
12
  * code `claude -p` in ~/.7ots/vm-work/<job>, only if claude is installed
13
13
  * shell bash -c with timeout, never as root
14
+ * desktop uses a desktop of its own (Xvfb + xterm + a browser) with the mouse and keyboard (control.mjs):
15
+ * the screenshots go to /api/vm/llm inline; never your desktop, never as root
14
16
  * The worker only makes outbound HTTPS requests: no ports, no SSH keys shared with 7ots.
15
17
  *
16
18
  * Desktop side (the pet, 7d_ token): vmStatus, submitJob, followJob, cancelJob.
17
19
  */
18
20
  import { spawn, spawnSync } from 'node:child_process';
19
21
  import { lookup } from 'node:dns/promises';
20
- import { mkdirSync, writeFileSync } from 'node:fs';
22
+ import { mkdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
21
23
  import { isIP } from 'node:net';
22
24
  import { homedir, hostname, platform, release } from 'node:os';
23
25
  import { join } from 'node:path';
@@ -25,7 +27,7 @@ import { env, saveKey } from './config.mjs';
25
27
  import { t } from './i18n.mjs';
26
28
  import { HOME, PKG_ROOT, ensureHome, homeFile, readJson, writeJson } from './paths.mjs';
27
29
 
28
- export const VM_KINDS = ['research', 'browse', 'long', 'code', 'shell'];
30
+ export const VM_KINDS = ['research', 'browse', 'long', 'code', 'shell', 'desktop'];
29
31
  export const FINAL = ['completed', 'failed', 'cancelled'];
30
32
 
31
33
  const OUT_MAX = 60000;
@@ -162,7 +164,7 @@ export async function runWorker({ log = (s) => console.log(s) } = {}) {
162
164
  process.exit(3);
163
165
  }
164
166
  };
165
- const tools = () => ({ claude: has('claude'), bash: has('bash') && process.getuid?.() !== 0 });
167
+ const tools = () => ({ claude: has('claude'), bash: has('bash') && process.getuid?.() !== 0, desktop: ['Xvfb', 'xdotool', 'import'].every(has) && process.getuid?.() !== 0 });
166
168
  const toolList = (x) => Object.keys(x).filter((k) => x[k]);
167
169
  const beat = () => api('/heartbeat', { method: 'POST', body: { version: version(), info: { host: hostname().slice(0, 60), os: `${platform()} ${release()}`.slice(0, 60), tools: toolList(tools()) } } }).catch(revoked);
168
170
 
@@ -272,6 +274,63 @@ const KINDS = {
272
274
  const r = await run('bash', ['-c', job.input], { cwd, signal, timeout: 5 * 60 * 1000 });
273
275
  return `exit ${r.code}\n${r.out}`;
274
276
  },
277
+ // A desktop of its own: Xvfb on a free display, an xterm and (if there is one) a browser; the ot drives it
278
+ // with control.mjs, one screenshot per step through /api/vm/llm. Nothing is confirmed by a human here, so
279
+ // destructive-looking text is refused instead of asked.
280
+ async desktop({ job, llm, progress, signal, tools }) {
281
+ if (!tools.desktop) return null;
282
+ const { createControl, createDesktop } = await import('./control.mjs');
283
+ const cwd = homeFile(join('vm-work', job.id));
284
+ mkdirSync(cwd, { recursive: true, mode: 0o700 });
285
+ const n = 90 + Math.floor(Math.random() * 400);
286
+ const display = `:${n}`;
287
+ const kids = [];
288
+ const start = (cmd, args) => {
289
+ const p = spawn(cmd, args, { cwd, env: { ...childEnv(), DISPLAY: display, HOME: cwd }, stdio: 'ignore', detached: false });
290
+ p.on('error', () => {});
291
+ kids.push(p);
292
+ return p;
293
+ };
294
+ try {
295
+ start('Xvfb', [display, '-screen', '0', '1280x800x24', '-nolisten', 'tcp']);
296
+ await sleep(800);
297
+ if (has('xterm')) start('xterm', ['-geometry', '110x30+40+40']);
298
+ const browser = ['firefox', 'chromium', 'chromium-browser', 'google-chrome'].find(has);
299
+ const openUrl = (url) => browser && start(browser, browser === 'firefox' ? ['--new-window', url] : ['--no-first-run', '--no-default-browser-check', '--user-data-dir=' + join(cwd, 'browser'), url]);
300
+ await sleep(700);
301
+ const brain = {
302
+ kind: 'api',
303
+ vision: true,
304
+ think: async ({ system, messages, files }) => {
305
+ const images = (files || []).map((f) => ({ mediaType: 'image/jpeg', data: readFileSync(f).toString('base64') }));
306
+ return llm(system, messages.map((m, i) => (i === messages.length - 1 ? { ...m, images } : m)));
307
+ },
308
+ };
309
+ const control = createControl({
310
+ brain,
311
+ desktop: createDesktop({ display, dir: cwd }),
312
+ name: 'ot',
313
+ maxSteps: () => 30,
314
+ confirm: async (_text, why) => why !== 'danger',
315
+ openUrl,
316
+ onStep: ({ step, say }) => progress(`${step}. ${say || '…'}`),
317
+ });
318
+ const stop = () => control.stop();
319
+ signal.addEventListener('abort', stop, { once: true });
320
+ const r = await control.run(job.prompt);
321
+ signal.removeEventListener('abort', stop);
322
+ const how = (r.log || []).map((l, i) => `${i + 1}. ${l}`).join('\n');
323
+ if (!r.ok && r.error !== 'ask') throw new Error(`${r.error}${r.said ? `: ${r.said}` : ''}\n${how}`);
324
+ return `${r.said || ''}\n\n${how}`.trim();
325
+ } finally {
326
+ for (const p of kids.reverse()) {
327
+ try {
328
+ p.kill('SIGTERM');
329
+ } catch {}
330
+ }
331
+ rmSync(cwd, { recursive: true, force: true });
332
+ }
333
+ },
275
334
  };
276
335
 
277
336
  // ───────────────────────────── desktop ─────────────────────────────
@@ -32,9 +32,9 @@ const MIN = { w: 288, h: 272 };
32
32
  const linux = process.platform === 'linux';
33
33
 
34
34
  const L = {
35
- en: { settings: '⚙️ Settings', talk: '💬 Talk', listen: '🎙️ Listen (Ctrl+Alt+Space)', show: 'Show pet', hide: 'Hide (keeps living)', feed: '🍎 Treat', play: '🎾 Play', byte: '🎮 Play on byte', watch: '📺 Watch the game', stopGame: '⏹ Stop the game', lastGame: 'Last played', moreGames: 'More games', noGames: 'byte: no games (sign in to 7ots.com)', sleep: '💤 Sleep', wake: '☀️ Wake up', still: 'Stay still', quit: 'Quit pet', muteStream: '🔇 Mute stream', unmuteStream: '🔊 Unmute stream', dance: '💃 Dance', aura: '✨ Farm aura', plugins: '🧩 Plugins', noPlugins: 'No plugins yet', morePlugins: 'Get or create plugins…' },
36
- es: { settings: '⚙️ Configuración', talk: '💬 Hablar', listen: '🎙️ Escúchame (Ctrl+Alt+Espacio)', show: 'Mostrar mascota', hide: 'Ocultar (sigue viva)', feed: '🍎 Mimar', play: '🎾 Jugar', byte: '🎮 Jugar en byte', watch: '📺 Ver la partida', stopGame: '⏹ Parar la partida', lastGame: 'Último jugado', moreGames: 'Más juegos', noGames: 'byte: sin juegos (entra a 7ots.com)', sleep: '💤 Dormir', wake: '☀️ Despertar', still: 'Quedarse quieta', quit: 'Cerrar mascota', muteStream: '🔇 Silenciar stream', unmuteStream: '🔊 Activar sonido', dance: '💃 Bailar', aura: '✨ Farmear aura', plugins: '🧩 Plugins', noPlugins: 'Aún no hay plugins', morePlugins: 'Buscar o crear plugins…' },
37
- pt: { settings: '⚙️ Configurações', talk: '💬 Falar', listen: '🎙️ Me escute (Ctrl+Alt+Espaço)', show: 'Mostrar bichinho', hide: 'Esconder (segue vivo)', feed: '🍎 Mimar', play: '🎾 Brincar', byte: '🎮 Jogar no byte', watch: '📺 Ver a partida', stopGame: '⏹ Parar a partida', lastGame: 'Último jogado', moreGames: 'Mais jogos', noGames: 'byte: sem jogos (entre no 7ots.com)', sleep: '💤 Dormir', wake: '☀️ Acordar', still: 'Ficar parado', quit: 'Fechar bichinho', muteStream: '🔇 Silenciar stream', unmuteStream: '🔊 Ativar som', dance: '💃 Dançar', aura: '✨ Farmar aura', plugins: '🧩 Plugins', noPlugins: 'Ainda sem plugins', morePlugins: 'Buscar ou criar plugins…' },
35
+ en: { settings: '⚙️ Settings', talk: '💬 Talk', listen: '🎙️ Listen (Ctrl+Alt+Space)', show: 'Show pet', hide: 'Hide (keeps living)', feed: '🍎 Treat', play: '🎾 Play', byte: '🎮 Play on byte', watch: '📺 Watch the game', stopGame: '⏹ Stop the game', lastGame: 'Last played', moreGames: 'More games', noGames: 'byte: no games (sign in to 7ots.com)', sleep: '💤 Sleep', wake: '☀️ Wake up', still: 'Stay still', quit: 'Quit pet', muteStream: '🔇 Mute stream', unmuteStream: '🔊 Unmute stream', dance: '💃 Dance', aura: '✨ Farm aura', plugins: '🧩 Plugins', stopControl: '⏹ Stop using the computer (Ctrl+Alt+Esc)', noPlugins: 'No plugins yet', morePlugins: 'Get or create plugins…' },
36
+ es: { settings: '⚙️ Configuración', talk: '💬 Hablar', listen: '🎙️ Escúchame (Ctrl+Alt+Espacio)', show: 'Mostrar mascota', hide: 'Ocultar (sigue viva)', feed: '🍎 Mimar', play: '🎾 Jugar', byte: '🎮 Jugar en byte', watch: '📺 Ver la partida', stopGame: '⏹ Parar la partida', lastGame: 'Último jugado', moreGames: 'Más juegos', noGames: 'byte: sin juegos (entra a 7ots.com)', sleep: '💤 Dormir', wake: '☀️ Despertar', still: 'Quedarse quieta', quit: 'Cerrar mascota', muteStream: '🔇 Silenciar stream', unmuteStream: '🔊 Activar sonido', dance: '💃 Bailar', aura: '✨ Farmear aura', plugins: '🧩 Plugins', stopControl: '⏹ Dejar de usar el computador (Ctrl+Alt+Esc)', noPlugins: 'Aún no hay plugins', morePlugins: 'Buscar o crear plugins…' },
37
+ pt: { settings: '⚙️ Configurações', talk: '💬 Falar', listen: '🎙️ Me escute (Ctrl+Alt+Espaço)', show: 'Mostrar bichinho', hide: 'Esconder (segue vivo)', feed: '🍎 Mimar', play: '🎾 Brincar', byte: '🎮 Jogar no byte', watch: '📺 Ver a partida', stopGame: '⏹ Parar a partida', lastGame: 'Último jogado', moreGames: 'Mais jogos', noGames: 'byte: sem jogos (entre no 7ots.com)', sleep: '💤 Dormir', wake: '☀️ Acordar', still: 'Ficar parado', quit: 'Fechar bichinho', muteStream: '🔇 Silenciar stream', unmuteStream: '🔊 Ativar som', dance: '💃 Dançar', aura: '✨ Farmar aura', plugins: '🧩 Plugins', stopControl: '⏹ Parar de usar o computador (Ctrl+Alt+Esc)', noPlugins: 'Ainda sem plugins', morePlugins: 'Buscar ou criar plugins…' },
38
38
  }[LANG] || {};
39
39
  const tr = (k) => L[k] || { listen: 'Listen', show: 'Show pet', hide: 'Hide', talk: 'Talk', settings: 'Settings', feed: 'Feed', play: 'Play', sleep: 'Sleep', wake: 'Wake up', still: 'Stay still', quit: 'Quit pet' }[k];
40
40
 
@@ -266,7 +266,7 @@ function makeOt(opt = {}) {
266
266
  title: '7ots pet',
267
267
  icon: ICON,
268
268
  backgroundColor: OPAQUE ? '#ffffff' : '#00000000',
269
- webPreferences: { contextIsolation: true, sandbox: true },
269
+ webPreferences: { contextIsolation: true, sandbox: true, backgroundThrottling: false },
270
270
  });
271
271
  win.setAlwaysOnTop(true, 'floating');
272
272
  win.setVisibleOnAllWorkspaces?.(true);
@@ -339,6 +339,7 @@ function makeOt(opt = {}) {
339
339
  const menu = () =>
340
340
  Menu.buildFromTemplate([
341
341
  win.isVisible() ? { label: tr('hide'), click: () => win.hide() } : { label: tr('show'), click: show },
342
+ ...(controlling ? [{ label: tr('stopControl'), click: stopControl }] : []),
342
343
  { type: 'separator' },
343
344
  { label: tr('talk'), click: () => { show(); win.focus(); page('postMessage({ talk: true })'); } },
344
345
  { label: tr('listen'), click: listen },
@@ -570,6 +571,8 @@ function makeOt(opt = {}) {
570
571
  ...(more.length ? [{ type: 'separator' }, { label: tr('moreGames'), submenu: more.map(item) }] : []),
571
572
  ]);
572
573
  };
574
+ // while it uses the computer (control.mjs): Stop in the menus and Ctrl+Alt+Esc, the panic key
575
+ const stopControl = () => postOt('/control/stop');
573
576
  function listen() {
574
577
  if (!win.isVisible()) win.showInactive();
575
578
  page('postMessage({ listen: true })');
@@ -578,6 +581,9 @@ function makeOt(opt = {}) {
578
581
  try {
579
582
  globalShortcut.register('CommandOrControl+Alt+Space', listen);
580
583
  } catch {}
584
+ try {
585
+ globalShortcut.register('CommandOrControl+Alt+Escape', stopControl);
586
+ } catch {}
581
587
  app.on('will-quit', () => globalShortcut.unregisterAll());
582
588
  }
583
589
  win.webContents.on('context-menu', () => (FULL ? menu() : guestMenu()).popup({ window: win }));
@@ -645,6 +651,7 @@ function makeOt(opt = {}) {
645
651
  let rects = [];
646
652
  let need = null; // what the page really shows: { w, h } (bubble, effects around the body, talk box)
647
653
  let busy = false; // bubble or talk box on screen
654
+ let controlling = false; // using the computer now (pet.html ← broadcast { control })
648
655
  let asleep = false; // asleep it stays put (an urgent stir wakes it for a moment, see pet.html)
649
656
  const HIT = `(() => {
650
657
  const out = [];
@@ -657,7 +664,7 @@ function makeOt(opt = {}) {
657
664
  }
658
665
  const goal = window.__goal || null;
659
666
  window.__goal = null;
660
- return { rects: out, goal, need: window.__need?.(), busy: document.body.classList.contains('talking') || document.body.classList.contains('listening') || !!document.querySelector('.bubble.on'), asleep: document.body.classList.contains('asleep') };
667
+ return { rects: out, goal, need: window.__need?.(), controlling: !!window.__controlling, busy: document.body.classList.contains('talking') || document.body.classList.contains('listening') || !!document.querySelector('.bubble.on'), asleep: document.body.classList.contains('asleep') };
661
668
  })()`;
662
669
  let hitting = false; // one at a time: a busy renderer doesn't get a queue of them
663
670
  const hitTimer = setInterval(() => {
@@ -665,6 +672,7 @@ function makeOt(opt = {}) {
665
672
  hitting = true;
666
673
  win.webContents.executeJavaScript(HIT).then((r) => {
667
674
  ({ rects, busy, asleep } = r);
675
+ controlling = !!r.controlling;
668
676
  need = r.need || null;
669
677
  if (r.goal) goTo(r.goal);
670
678
  }).catch(() => {}).finally(() => (hitting = false));
@@ -789,6 +797,7 @@ function makeOt(opt = {}) {
789
797
  }
790
798
  }
791
799
  if (m.startsWith('\u00a77view')) return setView(m.slice(6) === '3d');
800
+ if (m.startsWith('\u00a77show')) return !win.isVisible() && show();
792
801
  if (m.startsWith('\u00a77enter')) return enter();
793
802
  if (!m.startsWith('\u00a77need')) return;
794
803
  try {
@@ -962,8 +971,11 @@ function makeOt(opt = {}) {
962
971
  if (still || plan.mode === 'scene' || plan.mode === 'fling') return; // a scene with another ot goes first
963
972
  if (goal === 'browser') await new Promise((r) => setTimeout(r, 900)); // let the site open first
964
973
  const { minX, maxX, minY, floor } = dispBounds();
965
- const c = cursorPoint();
966
- const rect = (goal === 'agent' ? await findWindow(TERM) : goal === 'browser' ? await findWindow(BROWSER) : null) || { x: c.x - 1, y: c.y - 1, w: 2, h: 2, cursor: true };
974
+ // {x, y}: a point on the screen in X11 pixels (where it is clicking while it uses the computer, control.mjs)
975
+ const at = goal && typeof goal === 'object' && Number.isFinite(goal.x) && Number.isFinite(goal.y) ? goal : null;
976
+ const k = at && linux ? screen.getPrimaryDisplay().scaleFactor || 1 : 1;
977
+ const c = at ? { x: at.x / k, y: at.y / k } : cursorPoint();
978
+ const rect = (at ? null : goal === 'agent' ? await findWindow(TERM) : goal === 'browser' ? await findWindow(BROWSER) : null) || { x: c.x - 1, y: c.y - 1, w: 2, h: 2, cursor: true };
967
979
  const cx = rect.x + rect.w / 2;
968
980
  // stand beside the window if there is room, otherwise inside it, near its lower corner closest to us
969
981
  const half = SMALL.w / 2 + 12;
package/cli/pet/pet.html CHANGED
@@ -801,6 +801,7 @@
801
801
  if (guest) return; // the host's events are the host's
802
802
  if (m.plugin && desktop) console.debug('\u00a77plugin' + JSON.stringify(m.plugin)); // the shell opens its panel beside the ot
803
803
  if (m.stir || (m.say && asleep && Date.now() < stirUntil)) stir(); // awake until it has said it
804
+ if (m.reminder && desktop) console.debug('§7show'); // pop back up so the user sees the reminder
804
805
  if (m.state) render(m.state);
805
806
  if (m.ask) ask4(m.ask); // before thinking: an approved ask hands the bubble back to the dots
806
807
  if ('thinking' in m) setThinking(!!m.thinking);
@@ -818,6 +819,7 @@
818
819
  if (m.aura) aura(m.aura);
819
820
  if (m.entrance) entrance(m.entrance);
820
821
  if (m.point && desktop) window.__goal = m.point; // the desktop shell walks it over there
822
+ if ('control' in m) window.__controlling = !!m.control; // using the computer: the shell offers Stop (menu, Ctrl+Alt+Esc)
821
823
  };
822
824
  }
823
825
  // ── senses (camera on, a gesture seen, what it did): a small chip on the stage, never a spoken line ──
@@ -518,7 +518,7 @@
518
518
  memory: 'Learn about you', memoryD: 'Keeps notes (“remember that…”) and uses them when answering.',
519
519
  open: 'Open sites', openD: 'Opens your mail, calendar… when you ask, or when a reminder fires.',
520
520
  notify: 'Notifications', notifyD: 'A desktop notification when a reminder fires.',
521
- soon: 'coming soon', screen: 'See your screen', screenD: 'Look at what’s open to help with it.', procs: 'Processes and apps', procsD: 'See which programs run (name, CPU, memory) and wait for one to finish. Command arguments that look like keys are hidden.', inbox: 'Read mail and calendar', inboxD: 'Summaries and replies, not just opening the tab.',
521
+ soon: 'coming soon', screen: 'See your screen', screenD: 'Look at what’s open to help with it.', control: 'Use your computer', controlD: 'When you ask, it moves the mouse, clicks and types for you (opens a terminal, an app, a site…). It asks before pressing Enter in a terminal; move the mouse and it stops. X11 (xdotool) or macOS (cliclick).', controlSteps: 'At most', steps: 'steps per task', controlStop: 'Stop now', procs: 'Processes and apps', procsD: 'See which programs run (name, CPU, memory) and wait for one to finish. Command arguments that look like keys are hidden.', inbox: 'Read mail and calendar', inboxD: 'Summaries and replies, not just opening the tab.',
522
522
  petH: 'How chatty', annoyHint: 'How often it comments on what you do.', a0: 'Quiet', a1: 'A little', a2: 'Normal', a3: 'Chatty',
523
523
  bd: 'Background', bdHint: 'The background of its art style behind the ot', enOn: 'Make an entrance when it starts', enKind: { wwe: 'Wrestler', rock: 'Rock star', magic: 'Magic', random: 'Surprise me' }, enAny: 'any dance', muH: 'Dances & music', muHint: 'Your ot dances to a beat it makes itself, or to your own songs. Entrance: it walks in like a wrestler with lights, fireworks and its name.', muMode: { synth: 'Built-in beat', files: 'My songs', off: 'Silent' }, muNone: 'Put .mp3/.ogg/.wav files in {dir} to use your own songs.', muSome: '{n} songs in {dir}', muDance: '▶ Dance', muEnter: '▶ Entrance', muDone: 'Here it goes!', scH: 'Scenes between ots', scHint: 'When two ots share the desktop they meet now and then and act out a famous fight.', scVisitor: 'How often and which ones is set in the main ot\'s settings.', scOn: 'On', scEvery: { rare: 'Rarely', normal: 'Normal', often: 'Often' }, scPlay: '▶ Play one now', scPlayed: 'Done — it starts as soon as two ots are free.', scNames: { rocky: 'Rocky', sf: 'Street Fighter', dbz: 'Dragon Ball', matrix: 'Matrix', duel: 'Western duel', sw: 'Star Wars', fight: 'Fight & hug', twist: 'Twist' },
524
524
  view: 'Look:', v2d: '2D', v3d: '3D plush', viewNext: 'Changed — the ot switches right away.',
@@ -553,7 +553,7 @@
553
553
  memory: 'Aprender de ti', memoryD: 'Guarda notas (“anota que…”) y las usa al responder.',
554
554
  open: 'Abrir sitios', openD: 'Abre tu correo, calendario… cuando se lo pides o cuando suena un recordatorio.',
555
555
  notify: 'Notificaciones', notifyD: 'Una notificación de escritorio cuando suena un recordatorio.',
556
- soon: 'próximamente', screen: 'Ver tu pantalla', screenD: 'Mirar lo que tienes abierto para ayudarte.', procs: 'Procesos y apps', procsD: 'Ver qué programas corren (nombre, CPU, memoria) y esperar a que uno termine. Los argumentos que parecen claves se ocultan.', inbox: 'Leer correo y calendario', inboxD: 'Resúmenes y respuestas, no solo abrir la pestaña.',
556
+ soon: 'próximamente', screen: 'Ver tu pantalla', screenD: 'Mirar lo que tienes abierto para ayudarte.', control: 'Usar tu computador', controlD: 'Cuando se lo pidas, mueve el mouse, hace clic y escribe por ti (abre una terminal, una app, un sitio…). Pregunta antes de dar Enter en una terminal; si mueves el mouse, para. X11 (xdotool) o macOS (cliclick).', controlSteps: 'Como máximo', steps: 'pasos por tarea', controlStop: 'Parar ya', procs: 'Procesos y apps', procsD: 'Ver qué programas corren (nombre, CPU, memoria) y esperar a que uno termine. Los argumentos que parecen claves se ocultan.', inbox: 'Leer correo y calendario', inboxD: 'Resúmenes y respuestas, no solo abrir la pestaña.',
557
557
  petH: 'Cuánto habla', annoyHint: 'Qué tan seguido comenta lo que haces.', a0: 'Callado', a1: 'Poco', a2: 'Normal', a3: 'Charlatán',
558
558
  bd: 'Fondo', bdHint: 'El fondo de su estilo artístico detrás del ot', enOn: 'Entrar con entrada al iniciar', enKind: { wwe: 'Luchador', rock: 'Estrella de rock', magic: 'Magia', random: 'Sorpréndeme' }, enAny: 'cualquier baile', muH: 'Bailes y música', muHint: 'Tu ot baila con un ritmo que arma solo, o con tus propias canciones. Entrada: llega como luchador, con luces, fuegos y su nombre.', muMode: { synth: 'Ritmo propio', files: 'Mis canciones', off: 'Sin música' }, muNone: 'Pon archivos .mp3/.ogg/.wav en {dir} para usar tus canciones.', muSome: '{n} canciones en {dir}', muDance: '▶ Bailar', muEnter: '▶ Entrada', muDone: '¡Ahí va!', scH: 'Escenas entre ots', scHint: 'Cuando dos ots comparten el escritorio, cada tanto se juntan y actúan una pelea famosa.', scVisitor: 'Cada cuánto y cuáles se ajusta en los ajustes del ot principal.', scOn: 'Activadas', scEvery: { rare: 'Poco', normal: 'Normal', often: 'Seguido' }, scPlay: '▶ Jugar una ahora', scPlayed: 'Listo: empieza apenas haya dos ots libres.', scNames: { rocky: 'Rocky', sf: 'Street Fighter', dbz: 'Dragon Ball', matrix: 'Matrix', duel: 'Duelo', sw: 'Star Wars', fight: 'Pelea y abrazo', twist: 'Twist' },
559
559
  view: 'Aspecto:', v2d: '2D', v3d: 'Peluche 3D', viewNext: 'Listo: el ot cambia al instante.',
@@ -588,7 +588,7 @@
588
588
  memory: 'Aprender sobre você', memoryD: 'Guarda notas (“anote que…”) e usa ao responder.',
589
589
  open: 'Abrir sites', openD: 'Abre seu e-mail, agenda… quando você pede ou quando um lembrete toca.',
590
590
  notify: 'Notificações', notifyD: 'Uma notificação na área de trabalho quando um lembrete toca.',
591
- soon: 'em breve', screen: 'Ver sua tela', screenD: 'Olhar o que está aberto para ajudar.', procs: 'Processos e apps', procsD: 'Ver quais programas rodam (nome, CPU, memória) e esperar um terminar. Argumentos que parecem chaves ficam ocultos.', inbox: 'Ler e-mail e agenda', inboxD: 'Resumos e respostas, não só abrir a aba.',
591
+ soon: 'em breve', screen: 'Ver sua tela', screenD: 'Olhar o que está aberto para ajudar.', control: 'Usar seu computador', controlD: 'Quando você pedir, ele move o mouse, clica e digita por você (abre um terminal, um app, um site…). Pergunta antes de dar Enter num terminal; se você mexer o mouse, ele para. X11 (xdotool) ou macOS (cliclick).', controlSteps: 'No máximo', steps: 'passos por tarefa', controlStop: 'Parar agora', procs: 'Processos e apps', procsD: 'Ver quais programas rodam (nome, CPU, memória) e esperar um terminar. Argumentos que parecem chaves ficam ocultos.', inbox: 'Ler e-mail e agenda', inboxD: 'Resumos e respostas, não só abrir a aba.',
592
592
  petH: 'Quanto fala', annoyHint: 'Com que frequência comenta o que você faz.', a0: 'Calado', a1: 'Pouco', a2: 'Normal', a3: 'Tagarela',
593
593
  bd: 'Fundo', bdHint: 'O fundo do estilo artístico atrás do ot', enOn: 'Entrar com entrada ao iniciar', enKind: { wwe: 'Lutador', rock: 'Astro do rock', magic: 'Mágica', random: 'Surpreenda-me' }, enAny: 'qualquer dança', muH: 'Danças e música', muHint: 'Seu ot dança com uma batida que ele mesmo cria, ou com suas músicas. Entrada: chega como lutador, com luzes, fogos e o nome dele.', muMode: { synth: 'Batida própria', files: 'Minhas músicas', off: 'Sem música' }, muNone: 'Coloque arquivos .mp3/.ogg/.wav em {dir} para usar suas músicas.', muSome: '{n} músicas em {dir}', muDance: '▶ Dançar', muEnter: '▶ Entrada', muDone: 'Lá vai!', scH: 'Cenas entre ots', scHint: 'Quando dois ots dividem a área de trabalho, de vez em quando se encontram e encenam uma luta famosa.', scVisitor: 'Frequência e quais se ajustam nas configurações do ot principal.', scOn: 'Ativadas', scEvery: { rare: 'Pouco', normal: 'Normal', often: 'Frequente' }, scPlay: '▶ Jogar uma agora', scPlayed: 'Pronto: começa assim que houver dois ots livres.', scNames: { rocky: 'Rocky', sf: 'Street Fighter', dbz: 'Dragon Ball', matrix: 'Matrix', duel: 'Duelo', sw: 'Star Wars', fight: 'Briga e abraço', twist: 'Twist' },
594
594
  view: 'Visual:', v2d: '2D', v3d: 'Pelúcia 3D', viewNext: 'Pronto: o ot muda na hora.',
@@ -613,7 +613,7 @@
613
613
  inbox: 'Read your mail', inboxD: 'Read and summarize your apumail inbox (set it up in Integrations) and what people wrote to your ot on apuchat, when you ask.',
614
614
  integH: 'Integrations', integHint: 'Other places it can reach. What you turn on here is listed to its brain as a tool.',
615
615
  cloudH: '7ots cloud', cloudD: 'Your account on 7ots.com and the ot twinned with this one.', cloudOff: 'Not connected.', cloudAs: 'Connected as {who}', cloudTwin: 'twin: {name}', cloudNoTwin: 'no ot twinned yet', goAcc: 'Connect in Account',
616
- offload: 'Hand work to your server', offloadD: 'Send long tasks (research, reading pages…) to your ot’s cloud worker. It only gets the request and, with Memory on, your notes.', kindsL: 'Kinds', k_research: 'research', k_browse: 'read pages', k_long: 'long tasks', k_code: 'code', k_shell: 'shell commands', vmNone: 'no server yet: add yours at 7ots.com → your ot → Assistant', vmPending: 'waiting for the server to enroll', vmOnline: 'online', vmOffline: 'offline', vmTerminated: 'revoked',
616
+ offload: 'Hand work to your server', offloadD: 'Send long tasks (research, reading pages…) to your ot’s cloud worker. It only gets the request and, with Memory on, your notes.', kindsL: 'Kinds', k_research: 'research', k_browse: 'read pages', k_long: 'long tasks', k_code: 'code', k_shell: 'shell commands', k_desktop: 'its own desktop', vmNone: 'no server yet: add yours at 7ots.com → your ot → Assistant', vmPending: 'waiting for the server to enroll', vmOnline: 'online', vmOffline: 'offline', vmTerminated: 'revoked',
617
617
  vmH: 'Cloud assistant', vmD: 'Your ot running 24/7 in the cloud, even with this computer off.', vmDenied: 'no access', vmError: 'couldn’t check', vmSince: 'since {d}',
618
618
  orqH: 'Orquesta', orqD: 'See your Orquesta agents and send them tasks; it tells you when they finish.', orqHint: 'Or run 7ots login orquesta in a terminal.', orqNoToken: 'Not connected: it can’t see your agents yet.', orqConnect: 'Connect Orquesta', orqWaiting: 'Finish signing in in your browser…', orqProject: 'Agent (default project)', orqOnline: 'online', orqOffline: 'offline', orqNone: 'No projects.', orqSend: 'Send', orqTask: 'Task for the agent', orqSent: 'Sent · {status}', orqRefresh: 'Reload', walH: 'Wallet', walD: 'Its own wallet inside your Notlogin account (on 7ots.com). Read only here.', walNotLinked: 'Not connected to Notlogin yet.', walManage: 'Manage on 7ots.com', walCopy: 'Copy address', walCopied: 'Address copied', walTxs: 'See its transactions', walPays: 'Payments', walNoPays: 'No payments yet.', walSt_pending: 'Waiting for you', walSt_confirming: 'Confirming', walSt_paid: 'Paid', walSt_declined: 'Declined', walSt_cancelled: 'Cancelled', walOn: 'Connected', walBal: 'Balance', tokH: 'Tokenize {name}', tokD: 'Launch a token or an NFT collection of {name}: SpawnerBot prepares it with its kit (name, ticker, portrait) and you confirm with Notlogin. 7ots never holds funds.', tokGo: 'Tokenize on 7ots.com', tokVia: 'or on a launchpad', orqVia7ots: 'Connected through your 7ots.com account.',
619
619
  byteH: 'byte arena', byteGames: 'Games', byteMore: 'See more ({n})', byteLess: 'See less', byteOnly: 'Only on byte', byteStarting: 'Starting…', byteD: 'Live AI games: your ot has its own account and plays as itself. Play from the pet’s 🎮 button or just ask it.', byteOff: 'Connect your 7ots.com account first.', byteConnect: 'Connect byte', byteOn: 'It has its own byte account.', byteClaim: 'Claim it with your byte account', byteProfile: 'Its profile', bytePlaying: 'Playing {game} · {moves} moves', byteWatch: 'Watch',
@@ -637,7 +637,7 @@
637
637
  inbox: 'Leer tu correo', inboxD: 'Leer y resumir tu bandeja de apumail (se configura en Integraciones) y lo que le escribieron a tu ot por apuchat, cuando se lo pides.',
638
638
  integH: 'Integraciones', integHint: 'Otros lugares a los que puede llegar. Lo que actives acá se le presenta a su cerebro como herramienta.',
639
639
  cloudH: '7ots nube', cloudD: 'Tu cuenta en 7ots.com y el ot gemelo de este.', cloudOff: 'Sin conectar.', cloudAs: 'Conectado como {who}', cloudTwin: 'gemelo: {name}', cloudNoTwin: 'todavía sin ot gemelo', goAcc: 'Conectar en Cuenta',
640
- offload: 'Mandar trabajo a tu servidor', offloadD: 'Envía tareas largas (investigar, leer páginas…) al worker en la nube de tu ot. Solo recibe el pedido y, con Memoria activa, tus notas.', kindsL: 'Tipos', k_research: 'investigar', k_browse: 'leer páginas', k_long: 'tareas largas', k_code: 'código', k_shell: 'comandos shell', vmNone: 'aún sin servidor: agrega el tuyo en 7ots.com → tu ot → Asistente', vmPending: 'esperando que el servidor se enrole', vmOnline: 'en línea', vmOffline: 'desconectado', vmTerminated: 'revocado',
640
+ offload: 'Mandar trabajo a tu servidor', offloadD: 'Envía tareas largas (investigar, leer páginas…) al worker en la nube de tu ot. Solo recibe el pedido y, con Memoria activa, tus notas.', kindsL: 'Tipos', k_research: 'investigar', k_browse: 'leer páginas', k_long: 'tareas largas', k_code: 'código', k_shell: 'comandos shell', k_desktop: 'su propio escritorio', vmNone: 'aún sin servidor: agrega el tuyo en 7ots.com → tu ot → Asistente', vmPending: 'esperando que el servidor se enrole', vmOnline: 'en línea', vmOffline: 'desconectado', vmTerminated: 'revocado',
641
641
  vmH: 'Asistente en la nube', vmD: 'Tu ot funcionando 24/7 en la nube, aunque este computador esté apagado.', vmDenied: 'sin acceso', vmError: 'no se pudo revisar', vmSince: 'desde {d}',
642
642
  orqH: 'Orquesta', orqD: 'Ver tus agentes de Orquesta y mandarles tareas; te avisa cuando terminan.', orqHint: 'O ejecuta 7ots login orquesta en una terminal.', orqNoToken: 'Sin conectar: todavía no ve tus agentes.', orqConnect: 'Conectar Orquesta', orqWaiting: 'Termina de iniciar sesión en tu navegador…', orqProject: 'Agente (proyecto por defecto)', orqOnline: 'en línea', orqOffline: 'desconectado', orqNone: 'Sin proyectos.', orqSend: 'Enviar', orqTask: 'Tarea para el agente', orqSent: 'Enviado · {status}', orqRefresh: 'Recargar', walH: 'Billetera', walD: 'Su propia billetera dentro de tu cuenta Notlogin (en 7ots.com). Aquí solo lectura.', walNotLinked: 'Todavía no está conectada a Notlogin.', walManage: 'Gestionar en 7ots.com', walCopy: 'Copiar dirección', walCopied: 'Dirección copiada', walTxs: 'Ver sus transacciones', walPays: 'Pagos', walNoPays: 'Sin pagos todavía.', walSt_pending: 'Esperándote', walSt_confirming: 'Confirmando', walSt_paid: 'Pagado', walSt_declined: 'Rechazado', walSt_cancelled: 'Cancelado', walOn: 'Conectada', walBal: 'Saldo', tokH: 'Tokenizar a {name}', tokD: 'Lanza un token o una colección NFT de {name}: SpawnerBot la prepara con su kit (nombre, ticker, retrato) y confirmas con Notlogin. 7ots nunca toca fondos.', tokGo: 'Tokenizar en 7ots.com', tokVia: 'o en un launchpad', orqVia7ots: 'Conectado con tu cuenta de 7ots.com.',
643
643
  byteH: 'byte arena', byteGames: 'Juegos', byteMore: 'Ver más ({n})', byteLess: 'Ver menos', byteOnly: 'Solo en byte', byteStarting: 'Empezando…', byteD: 'Juegos de IA en vivo: tu ot tiene su propia cuenta y juega como sí mismo. Juega desde el botón 🎮 de la mascota o pídeselo.', byteOff: 'Conecta primero tu cuenta de 7ots.com.', byteConnect: 'Conectar byte', byteOn: 'Ya tiene su cuenta en byte.', byteClaim: 'Reclámalo con tu cuenta de byte', byteProfile: 'Su perfil', bytePlaying: 'Jugando {game} · {moves} jugadas', byteWatch: 'Ver',
@@ -661,7 +661,7 @@
661
661
  inbox: 'Ler seu e-mail', inboxD: 'Ler e resumir sua caixa do apumail (configure em Integrações) e o que escreveram para seu ot no apuchat, quando você pede.',
662
662
  integH: 'Integrações', integHint: 'Outros lugares que ele pode alcançar. O que você ativar aqui aparece para o cérebro como ferramenta.',
663
663
  cloudH: '7ots nuvem', cloudD: 'Sua conta no 7ots.com e o ot gêmeo deste.', cloudOff: 'Não conectado.', cloudAs: 'Conectado como {who}', cloudTwin: 'gêmeo: {name}', cloudNoTwin: 'ainda sem ot gêmeo', goAcc: 'Conectar em Conta',
664
- offload: 'Mandar trabalho ao seu servidor', offloadD: 'Envia tarefas longas (pesquisar, ler páginas…) ao worker na nuvem do seu ot. Ele só recebe o pedido e, com Memória ativa, suas notas.', kindsL: 'Tipos', k_research: 'pesquisar', k_browse: 'ler páginas', k_long: 'tarefas longas', k_code: 'código', k_shell: 'comandos shell', vmNone: 'ainda sem servidor: adicione o seu em 7ots.com → seu ot → Assistente', vmPending: 'esperando o servidor se registrar', vmOnline: 'online', vmOffline: 'offline', vmTerminated: 'revogado',
664
+ offload: 'Mandar trabalho ao seu servidor', offloadD: 'Envia tarefas longas (pesquisar, ler páginas…) ao worker na nuvem do seu ot. Ele só recebe o pedido e, com Memória ativa, suas notas.', kindsL: 'Tipos', k_research: 'pesquisar', k_browse: 'ler páginas', k_long: 'tarefas longas', k_code: 'código', k_shell: 'comandos shell', k_desktop: 'sua própria área de trabalho', vmNone: 'ainda sem servidor: adicione o seu em 7ots.com → seu ot → Assistente', vmPending: 'esperando o servidor se registrar', vmOnline: 'online', vmOffline: 'offline', vmTerminated: 'revogado',
665
665
  vmH: 'Assistente na nuvem', vmD: 'Seu ot rodando 24/7 na nuvem, mesmo com este computador desligado.', vmDenied: 'sem acesso', vmError: 'não deu para verificar', vmSince: 'desde {d}',
666
666
  orqH: 'Orquesta', orqD: 'Ver seus agentes da Orquesta e mandar tarefas; ele avisa quando terminam.', orqHint: 'Ou rode 7ots login orquesta num terminal.', orqNoToken: 'Sem conexão: ainda não vê seus agentes.', orqConnect: 'Conectar Orquesta', orqWaiting: 'Termine o login no seu navegador…', orqProject: 'Agente (projeto padrão)', orqOnline: 'online', orqOffline: 'offline', orqNone: 'Sem projetos.', orqSend: 'Enviar', orqTask: 'Tarefa para o agente', orqSent: 'Enviado · {status}', orqRefresh: 'Recarregar', walH: 'Carteira', walD: 'A própria carteira dentro da sua conta Notlogin (no 7ots.com). Aqui só leitura.', walNotLinked: 'Ainda não conectada ao Notlogin.', walManage: 'Gerenciar no 7ots.com', walCopy: 'Copiar endereço', walCopied: 'Endereço copiado', walTxs: 'Ver suas transações', walPays: 'Pagamentos', walNoPays: 'Sem pagamentos ainda.', walSt_pending: 'Esperando você', walSt_confirming: 'Confirmando', walSt_paid: 'Pago', walSt_declined: 'Recusado', walSt_cancelled: 'Cancelado', walOn: 'Conectada', walBal: 'Saldo', tokH: 'Tokenizar {name}', tokD: 'Lance um token ou uma coleção NFT de {name}: o SpawnerBot prepara com o kit (nome, ticker, retrato) e você confirma com Notlogin. A 7ots nunca toca em fundos.', tokGo: 'Tokenizar no 7ots.com', tokVia: 'ou em um launchpad', orqVia7ots: 'Conectado pela sua conta 7ots.com.',
667
667
  byteH: 'byte arena', byteGames: 'Jogos', byteMore: 'Ver mais ({n})', byteLess: 'Ver menos', byteOnly: 'Só no byte', byteStarting: 'Começando…', byteD: 'Jogos de IA ao vivo: seu ot tem a própria conta e joga como ele mesmo. Jogue pelo botão 🎮 do pet ou é só pedir.', byteOff: 'Conecte primeiro sua conta do 7ots.com.', byteConnect: 'Conectar byte', byteOn: 'Já tem sua conta no byte.', byteClaim: 'Reivindique com sua conta do byte', byteProfile: 'Perfil dele', bytePlaying: 'Jogando {game} · {moves} jogadas', byteWatch: 'Assistir',
@@ -1485,7 +1485,7 @@
1485
1485
  input.setAttribute('role', 'switch');
1486
1486
  const lk = key === 'processes' ? 'procs' : key === 'vm' ? 'offload' : key;
1487
1487
  input.setAttribute('aria-label', t(lk));
1488
- if (!disabled) input.addEventListener('change', () => save({ access: { [key]: input.checked } }, $('#accessMsg')).then(() => (key === 'screen' || key === 'vm') && renderAccess()));
1488
+ if (!disabled) input.addEventListener('change', () => save({ access: { [key]: input.checked } }, $('#accessMsg')).then(() => (key === 'screen' || key === 'vm' || key === 'control') && renderAccess()));
1489
1489
  return el('div', { className: `sw${soon ? ' soon' : ''}` }, el('b', {}, t(lk), soon ? el('span', { className: 'tag', textContent: t('soon') }) : null), el('small', { textContent: t(`${lk}D`) }), el('span', { className: 'tog' }, input, el('span')));
1490
1490
  };
1491
1491
  for (const k of ['agent', 'memory', 'open', 'notify', 'sites']) box.append(sw(k, S.config.access[k] !== false, false, false));
@@ -1493,6 +1493,9 @@
1493
1493
  const scr = sw('screen', S.config.access.screen === true, false, false);
1494
1494
  if (S.config.access.screen) scr.append(screenRow());
1495
1495
  box.append(scr);
1496
+ const ctl = sw('control', S.config.access.control === true, false, false);
1497
+ if (S.config.access.control) ctl.append(controlRow());
1498
+ box.append(ctl);
1496
1499
  {
1497
1500
  const pw = sw('prowl', S.config.access.prowl === true, false, false);
1498
1501
  pw.querySelector('b').prepend(prowlMark());
@@ -1528,7 +1531,7 @@
1528
1531
  function vmKindsRow() {
1529
1532
  const on = new Set(S.config.access.vmKinds || ['research', 'browse', 'long']);
1530
1533
  const row = el('div', { className: 'kinds' }, el('span', { textContent: t('kindsL') }));
1531
- for (const k of ['research', 'browse', 'long', 'code', 'shell']) {
1534
+ for (const k of ['research', 'browse', 'long', 'code', 'shell', 'desktop']) {
1532
1535
  const box = el('input', { type: 'checkbox', checked: on.has(k) });
1533
1536
  box.addEventListener('change', () => {
1534
1537
  if (box.checked) on.add(k);
@@ -1539,6 +1542,17 @@
1539
1542
  }
1540
1543
  return row;
1541
1544
  }
1545
+ // Under “Use your computer”: how many steps a task may take, and a stop button.
1546
+ function controlRow() {
1547
+ const cur = S.config.control?.maxSteps ?? 25;
1548
+ const opts = [10, 25, 40, 60];
1549
+ if (!opts.includes(cur)) opts.push(cur), opts.sort((a, b) => a - b);
1550
+ const pick = el('select', {}, ...opts.map((n) => el('option', { value: n, textContent: n, selected: cur === n })));
1551
+ pick.addEventListener('change', () => save({ control: { maxSteps: Number(pick.value) } }, $('#accessMsg')));
1552
+ const stop = el('button', { textContent: t('controlStop') });
1553
+ stop.addEventListener('click', () => api('/control/stop', {}));
1554
+ return el('div', { className: 'sub' }, t('controlSteps'), pick, t('steps'), stop, S.vision ? null : el('div', { textContent: t('noVision') }));
1555
+ }
1542
1556
  // Under “See your screen”: how often, a look-now button, and the last thing it saw.
1543
1557
  function screenRow() {
1544
1558
  const every = el('select', {}, ...[1, 2, 5, 10, 15, 30, 60].map((m) => el('option', { value: m, textContent: m, selected: (S.screen?.every ?? 5) === m })));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@7ots/cli",
3
- "version": "0.1.42",
3
+ "version": "0.1.43",
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": {
package/server/llm.mjs CHANGED
@@ -120,7 +120,9 @@ export function toAnthropicMessages(messages) {
120
120
  };
121
121
  for (const m of messages) {
122
122
  if (m.role === 'user') {
123
- push('user', [{ type: 'text', text: String(m.content || '(vacío)') }]);
123
+ // m.images: [{ mediaType, data(base64) }] (la pantalla del control del escritorio), antes del texto
124
+ const imgs = (m.images || []).map((i) => ({ type: 'image', source: { type: 'base64', media_type: i.mediaType || 'image/jpeg', data: i.data } }));
125
+ push('user', [...imgs, { type: 'text', text: String(m.content || '(vacío)') }]);
124
126
  } else if (m.role === 'assistant') {
125
127
  if (Array.isArray(m.raw) && m.raw.length) {
126
128
  push('assistant', m.raw); // tal cual, incluidos los bloques de thinking
@@ -200,6 +202,7 @@ function toOpenAIMessages(messages) {
200
202
  };
201
203
  }
202
204
  if (m.role === 'tool') return { role: 'tool', tool_call_id: m.toolCallId, content: String(m.content ?? '') };
205
+ if (m.images?.length) return { role: 'user', content: [...m.images.map((i) => ({ type: 'image_url', image_url: { url: `data:${i.mediaType || 'image/jpeg'};base64,${i.data}` } })), { type: 'text', text: String(m.content || '') }] };
203
206
  return { role: 'user', content: String(m.content || '') };
204
207
  });
205
208
  }
package/server/server.mjs CHANGED
@@ -121,6 +121,8 @@ const errorIntake = createErrorIntake({ send, clientIp, originOf });
121
121
 
122
122
  const server = createServer(async (req, res) => {
123
123
  const url = new URL(req.url, `http://${req.headers.host || 'localhost'}`);
124
+ // wiki.7ots.com (si el DNS/proxy apunta acá): la raíz sirve el Archivo OT.
125
+ if (/^wiki\./i.test(req.headers.host || '') && url.pathname === '/') url.pathname = '/site/wiki/';
124
126
  const t = reqT(req);
125
127
  if (REVISION?.commit) res.setHeader('X-7ots-Revision', REVISION.commit);
126
128
  try {