@7ots/cli 0.1.40 → 0.1.41
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/pet/electron/main.cjs +26 -3
- package/cli/pet/pet.html +17 -3
- package/package.json +1 -1
|
@@ -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', 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', 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', 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', 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…' },
|
|
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
|
|
|
@@ -458,6 +458,27 @@ function makeOt(opt = {}) {
|
|
|
458
458
|
{ label: tr('morePlugins'), click: () => openSettings(base, tok, 'plugins') },
|
|
459
459
|
]);
|
|
460
460
|
};
|
|
461
|
+
const press = (sel) => win.webContents.executeJavaScript(`document.querySelector(${JSON.stringify(sel)})?.click()`).catch(() => {});
|
|
462
|
+
const pickMenu = async (what) => {
|
|
463
|
+
if (what === 'care') return Menu.buildFromTemplate([
|
|
464
|
+
{ label: tr('feed'), click: () => press('[data-act=feed]') },
|
|
465
|
+
{ label: tr('dance') || 'Dance', click: () => press('#danceBtn') },
|
|
466
|
+
{ label: tr('aura') || 'Aura', click: () => press('#auraBtn') },
|
|
467
|
+
]);
|
|
468
|
+
if (what === 'voice') return Menu.buildFromTemplate([
|
|
469
|
+
{ label: tr('talk'), click: () => press('#talkBtn') },
|
|
470
|
+
{ label: tr('listen'), click: () => press('#micBtn') },
|
|
471
|
+
]);
|
|
472
|
+
if (what !== 'plug') return null;
|
|
473
|
+
const [pl] = await pluginLibs().catch(() => [null]);
|
|
474
|
+
const ps = (pl?.activePlugins() || []).filter((p) => p.manifest.panel);
|
|
475
|
+
return Menu.buildFromTemplate([
|
|
476
|
+
...ps.map((p) => ({ label: `${p.manifest.icon} ${p.manifest.name}${p.source === 'local' ? ' · dev' : ''}`, click: () => openPlugin(p.id) })),
|
|
477
|
+
{ label: tr('byte'), submenu: await gameMenu() },
|
|
478
|
+
{ type: 'separator' },
|
|
479
|
+
{ label: tr('morePlugins'), click: () => openSettings(base, tok, 'plugins') },
|
|
480
|
+
]);
|
|
481
|
+
};
|
|
461
482
|
const playGame = async (game) => {
|
|
462
483
|
try {
|
|
463
484
|
require('node:fs').writeFileSync(path.join(process.env.SEVENOTS_HOME || path.join(require('node:os').homedir(), '.7ots'), 'byte-last.json'), JSON.stringify({ slug: game, at: Date.now() }));
|
|
@@ -750,6 +771,8 @@ function makeOt(opt = {}) {
|
|
|
750
771
|
if (m.startsWith('\u00a77bye')) return HOST || dismiss();
|
|
751
772
|
if (m.startsWith('\u00a77ctx')) return (FULL ? menu() : guestMenu()).popup({ window: win });
|
|
752
773
|
if (m.startsWith('\u00a77game')) return FULL && gameMenu().then((mm) => mm.popup({ window: win }));
|
|
774
|
+
// the panel's grouped buttons (pet.html): one native menu each, like the game's (a page popover would fall in the click-through)
|
|
775
|
+
if (m.startsWith('\u00a77pick')) return FULL && pickMenu(m.slice(6)).then((mm) => mm?.popup({ window: win })).catch(() => {});
|
|
753
776
|
if (m.startsWith('\u00a77photo')) {
|
|
754
777
|
try {
|
|
755
778
|
return showPhoto(JSON.parse(m.slice(7)));
|
package/cli/pet/pet.html
CHANGED
|
@@ -161,6 +161,11 @@
|
|
|
161
161
|
.props .pow { left: 50%; top: 6%; font: 900 22px/1 system-ui, sans-serif; color: #ffd400; -webkit-text-stroke: 2px #1a1020; transform: translateX(-50%); white-space: nowrap; }
|
|
162
162
|
/* a visiting ot: its own little menu (play, say goodbye, settings); feeding, talking and sleep are the host's */
|
|
163
163
|
body.guest .ask, body.guest #gameBtn, body:not(.desktop) #gameBtn, body.guest #talkBtn, body.guest #micBtn, body.guest #sleepBtn { display: none !important; }
|
|
164
|
+
/* desktop (not a visitor): mimar/bailar/aura, hablar/mic and byte+plugins are one button each with a native menu (electron/main.cjs pickMenu) */
|
|
165
|
+
.grp { display: none !important; }
|
|
166
|
+
body.desktop:not(.guest) .grp { display: flex !important; }
|
|
167
|
+
body.desktop:not(.guest) [data-act=feed], body.desktop:not(.guest) #danceBtn, body.desktop:not(.guest) #auraBtn, body.desktop:not(.guest) #talkBtn, body.desktop:not(.guest) #micBtn, body.desktop:not(.guest) #gameBtn { display: none !important; }
|
|
168
|
+
body.listening #voiceBtn { background: var(--err); color: #fff; }
|
|
164
169
|
.bye { display: none; }
|
|
165
170
|
body.desktop.guest .bye { display: flex; }
|
|
166
171
|
body.desktop .bubble { max-width: 220px; font-size: 12.5px; padding: 8px 12px; }
|
|
@@ -236,6 +241,9 @@
|
|
|
236
241
|
<section class="stats" id="stats"></section>
|
|
237
242
|
|
|
238
243
|
<nav class="actions">
|
|
244
|
+
<button class="act primary grp" id="careBtn" type="button" data-pick="care"><svg viewBox="0 0 24 24"><path d="M12 20s-7-4.4-7-10a4 4 0 0 1 7-2.6A4 4 0 0 1 19 10c0 5.6-7 10-7 10z"/></svg></button>
|
|
245
|
+
<button class="act grp" id="voiceBtn" type="button" data-pick="voice"><svg viewBox="0 0 24 24"><path d="M4 5h11v8H8l-4 3z"/><rect x="16.5" y="9" width="4" height="7" rx="2"/><path d="M15 15a3.5 3.5 0 0 0 7 0M18.5 18.5V21"/></svg></button>
|
|
246
|
+
<button class="act grp" id="plugBtn" type="button" data-pick="plug"><svg viewBox="0 0 24 24"><path d="M5 8h4V6.5a2 2 0 1 1 4 0V8h4v4h-1.5a2 2 0 1 0 0 4H17v4H5v-4h1.5a2 2 0 1 0 0-4H5z"/></svg></button>
|
|
239
247
|
<button class="act primary" data-act="feed"><svg viewBox="0 0 24 24"><path d="M12 7c-1.5-2.5-6-2.5-7 1.5S7 20 9.5 20c1.2 0 1.6-.6 2.5-.6s1.3.6 2.5.6C17 20 20 12.5 19 8.5S13.5 4.5 12 7z"/><path d="M12 7c0-2 1-3.5 3-4"/></svg><span data-t="feed"></span></button>
|
|
240
248
|
<button class="act" id="talkBtn" type="button"><svg viewBox="0 0 24 24"><path d="M5 6h14v9H9l-4 3z"/></svg><span data-t="talk"></span></button>
|
|
241
249
|
<button class="act" id="micBtn" type="button"><svg viewBox="0 0 24 24"><rect x="9" y="3" width="6" height="11" rx="3"/><path d="M5.5 11a6.5 6.5 0 0 0 13 0M12 17.5V21"/></svg><span data-t="listen"></span></button>
|
|
@@ -258,17 +266,17 @@
|
|
|
258
266
|
<script type="module">
|
|
259
267
|
const BOOT = __BOOT__;
|
|
260
268
|
const T = {
|
|
261
|
-
en: { wakeOn: 'Say “hey {name}” and I listen', game: 'Play byte', dance: 'Dance', aura: 'Farm aura', settings: 'Settings', card: 'Card', dismiss: 'Send home', listen: 'Listen', listening: 'Listening… 🎙️', noStt: 'Voice control needs an OpenAI or ElevenLabs key (Settings).', noMic: 'I can’t reach the microphone. Allow microphone access in system settings.', sttErr: 'I didn’t catch that.', talk: 'Talk', askPh: 'Remind me to check email in 10 min…', feed: 'Treat', play: 'Play', sleep: 'Sleep', wake: 'Wake', food: 'Food', energy: 'Energy', fun: 'Fun', level: 'Level {l}', xp: '{x} / {n} xp', live: 'Live', off: 'Reconnecting…', approve: 'Approve', reject: 'Reject',
|
|
269
|
+
en: { pickCare: 'Treat · dance · aura', pickVoice: 'Talk · listen', pickPlug: 'Plugins', wakeOn: 'Say “hey {name}” and I listen', game: 'Play byte', dance: 'Dance', aura: 'Farm aura', settings: 'Settings', card: 'Card', dismiss: 'Send home', listen: 'Listen', listening: 'Listening… 🎙️', noStt: 'Voice control needs an OpenAI or ElevenLabs key (Settings).', noMic: 'I can’t reach the microphone. Allow microphone access in system settings.', sttErr: 'I didn’t catch that.', talk: 'Talk', askPh: 'Remind me to check email in 10 min…', feed: 'Treat', play: 'Play', sleep: 'Sleep', wake: 'Wake', food: 'Food', energy: 'Energy', fun: 'Fun', level: 'Level {l}', xp: '{x} / {n} xp', live: 'Live', off: 'Reconnecting…', approve: 'Approve', reject: 'Reject',
|
|
262
270
|
activity: 'Activity', empty: 'Nothing yet. Run a command or ask your coding agent something.', tally: '{ok} ok · {fail} failed · turns {turns}',
|
|
263
271
|
brain: 'Brain: {b}', age: 'Born {d}', lines: 'built-in phrases', now: 'now', m: '{n}m', h: '{n}h',
|
|
264
272
|
moods: { happy: 'Happy', neutral: 'Calm', sad: 'Sad', disgust: 'Bored', sleep: 'Asleep', thinking: 'Thinking' },
|
|
265
273
|
kind: { tool: 'Tool', shell: 'Shell', prompt: 'You asked', stop: 'Turn finished', notify: 'Needs you', start: 'Session started' } },
|
|
266
|
-
es: { wakeOn: 'Di “oye {name}” y te escucho', game: 'Jugar byte', dance: 'Bailar', aura: 'Farmear aura', settings: 'Ajustes', card: 'Tarjeta', dismiss: 'Despedir', listen: 'Escuchar', listening: 'Te escucho… 🎙️', noStt: 'Para hablarme por voz falta una key de OpenAI o ElevenLabs (Ajustes).', noMic: 'No puedo usar el micrófono. Permite el acceso en ajustes del sistema.', sttErr: 'No te entendí.', talk: 'Hablar', askPh: 'Recuérdame ver el correo en 10 min…', feed: 'Mimar', play: 'Jugar', sleep: 'Dormir', wake: 'Despertar', food: 'Comida', energy: 'Energía', fun: 'Diversión', level: 'Nivel {l}', xp: '{x} / {n} xp', live: 'En vivo', off: 'Reconectando…', approve: 'Aprobar', reject: 'Rechazar',
|
|
274
|
+
es: { pickCare: 'Mimar · bailar · aura', pickVoice: 'Hablar · escuchar', pickPlug: 'Plugins', wakeOn: 'Di “oye {name}” y te escucho', game: 'Jugar byte', dance: 'Bailar', aura: 'Farmear aura', settings: 'Ajustes', card: 'Tarjeta', dismiss: 'Despedir', listen: 'Escuchar', listening: 'Te escucho… 🎙️', noStt: 'Para hablarme por voz falta una key de OpenAI o ElevenLabs (Ajustes).', noMic: 'No puedo usar el micrófono. Permite el acceso en ajustes del sistema.', sttErr: 'No te entendí.', talk: 'Hablar', askPh: 'Recuérdame ver el correo en 10 min…', feed: 'Mimar', play: 'Jugar', sleep: 'Dormir', wake: 'Despertar', food: 'Comida', energy: 'Energía', fun: 'Diversión', level: 'Nivel {l}', xp: '{x} / {n} xp', live: 'En vivo', off: 'Reconectando…', approve: 'Aprobar', reject: 'Rechazar',
|
|
267
275
|
activity: 'Actividad', empty: 'Nada todavía. Ejecuta un comando o pregúntale algo a tu agente.', tally: '{ok} ok · {fail} fallos · turnos {turns}',
|
|
268
276
|
brain: 'Cerebro: {b}', age: 'Nació {d}', lines: 'frases propias', now: 'ahora', m: '{n} min', h: '{n} h',
|
|
269
277
|
moods: { happy: 'Feliz', neutral: 'Tranquilo', sad: 'Triste', disgust: 'Aburrido', sleep: 'Dormido', thinking: 'Pensando' },
|
|
270
278
|
kind: { tool: 'Herramienta', shell: 'Terminal', prompt: 'Preguntaste', stop: 'Turno terminado', notify: 'Te necesita', start: 'Sesión iniciada' } },
|
|
271
|
-
pt: { wakeOn: 'Diga “ei {name}” e eu ouço', game: 'Jogar byte', dance: 'Dançar', aura: 'Farmar aura', settings: 'Ajustes', card: 'Carta', dismiss: 'Despedir', listen: 'Ouvir', listening: 'Estou ouvindo… 🎙️', noStt: 'Para falar por voz falta uma key da OpenAI ou ElevenLabs (Ajustes).', noMic: 'Não consigo usar o microfone. Permita o acesso nas configurações do sistema.', sttErr: 'Não entendi.', talk: 'Falar', askPh: 'Me lembre de ver o e-mail em 10 min…', feed: 'Mimar', play: 'Brincar', sleep: 'Dormir', wake: 'Acordar', food: 'Comida', energy: 'Energia', fun: 'Diversão', level: 'Nível {l}', xp: '{x} / {n} xp', live: 'Ao vivo', off: 'Reconectando…', approve: 'Aprovar', reject: 'Recusar',
|
|
279
|
+
pt: { pickCare: 'Mimar · dançar · aura', pickVoice: 'Falar · ouvir', pickPlug: 'Plugins', wakeOn: 'Diga “ei {name}” e eu ouço', game: 'Jogar byte', dance: 'Dançar', aura: 'Farmar aura', settings: 'Ajustes', card: 'Carta', dismiss: 'Despedir', listen: 'Ouvir', listening: 'Estou ouvindo… 🎙️', noStt: 'Para falar por voz falta uma key da OpenAI ou ElevenLabs (Ajustes).', noMic: 'Não consigo usar o microfone. Permita o acesso nas configurações do sistema.', sttErr: 'Não entendi.', talk: 'Falar', askPh: 'Me lembre de ver o e-mail em 10 min…', feed: 'Mimar', play: 'Brincar', sleep: 'Dormir', wake: 'Acordar', food: 'Comida', energy: 'Energia', fun: 'Diversão', level: 'Nível {l}', xp: '{x} / {n} xp', live: 'Ao vivo', off: 'Reconectando…', approve: 'Aprovar', reject: 'Recusar',
|
|
272
280
|
activity: 'Atividade', empty: 'Nada ainda. Rode um comando ou pergunte algo ao seu agente.', tally: '{ok} ok · {fail} falhas · turnos {turns}',
|
|
273
281
|
brain: 'Cérebro: {b}', age: 'Nasceu {d}', lines: 'frases próprias', now: 'agora', m: '{n} min', h: '{n} h',
|
|
274
282
|
moods: { happy: 'Feliz', neutral: 'Tranquilo', sad: 'Triste', disgust: 'Entediado', sleep: 'Dormindo', thinking: 'Pensando' },
|
|
@@ -843,6 +851,12 @@
|
|
|
843
851
|
if (!desktop) $('#setBtn').removeAttribute('target'); // in a browser tab, Settings opens in place (its Back returns here); the desktop window opens a tab
|
|
844
852
|
$('#byeBtn').title = t('dismiss');
|
|
845
853
|
$('#byeBtn').addEventListener('click', () => console.debug('\u00a77bye'));
|
|
854
|
+
for (const [id, k] of [['careBtn', 'pickCare'], ['voiceBtn', 'pickVoice'], ['plugBtn', 'pickPlug']]) {
|
|
855
|
+
const b = $('#' + id);
|
|
856
|
+
b.title = t(k);
|
|
857
|
+
b.setAttribute('aria-label', t(k));
|
|
858
|
+
b.addEventListener('click', () => console.debug('\u00a77pick' + b.dataset.pick));
|
|
859
|
+
}
|
|
846
860
|
$('#gameBtn').addEventListener('click', () => console.debug('\u00a77game')); // the shell shows byte's games, then the game in a small window // the shell sends the visitor home
|
|
847
861
|
const talking = (on) => {
|
|
848
862
|
document.body.classList.toggle('talking', on);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@7ots/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.41",
|
|
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": {
|