@7ots/cli 0.1.10 → 0.1.12

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.
@@ -299,6 +299,23 @@
299
299
  <button type="button" id="scPlay" data-t="scPlay"></button>
300
300
  <span class="msg" id="scMsg" role="status"></span>
301
301
  </div>
302
+ <h3 class="sh" data-t="muH"></h3>
303
+ <p class="hint" data-t="muHint"></p>
304
+ <div class="row">
305
+ <div class="chips" id="muMode"></div>
306
+ <input type="range" id="muVol" min="0" max="1" step="0.05" style="max-width:10rem" aria-label="volume">
307
+ </div>
308
+ <p class="hint" id="muFiles"></p>
309
+ <div class="row">
310
+ <label class="chip"><input type="checkbox" id="enOn"> <span data-t="enOn"></span></label>
311
+ <div class="chips" id="enKind"></div>
312
+ <select id="enDance" aria-label="dance"></select>
313
+ </div>
314
+ <div class="row">
315
+ <button type="button" id="muDance" data-t="muDance"></button>
316
+ <button type="button" id="muEnter" data-t="muEnter"></button>
317
+ <span class="msg" id="muMsg" role="status"></span>
318
+ </div>
302
319
  <h3 class="sh" data-t="modsH"></h3>
303
320
  <p class="hint" data-t="modsHint"></p>
304
321
  <div id="mods"></div>
@@ -383,7 +400,7 @@
383
400
  notify: 'Notifications', notifyD: 'A desktop notification when a reminder fires.',
384
401
  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.',
385
402
  petH: 'How chatty', annoyHint: 'How often it comments on what you do.', a0: 'Quiet', a1: 'A little', a2: 'Normal', a3: 'Chatty',
386
- 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' },
403
+ 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' },
387
404
  view: 'Look:', v2d: '2D', v3d: '3D plush', viewNext: 'Changed — the ot switches right away.',
388
405
  notesH: 'What it knows about you', notesHint: 'Its notes. Tell it “remember that…” to add one.', noNotes: 'Nothing yet.', forget: 'Forget', forgetAll: 'Forget everything', sure: 'Click again to forget everything',
389
406
  remH: 'Processes', remHint: 'What {name} is doing for you: reminders, alerts and the programs it’s waiting on. Ask it “remind me…”, “let me know if BTC reaches 85k” or “tell me when the build finishes”.', infTotal: 'Last {n} calls: {in} in → {out} out · {all} tokens', petRuns: 'What {name} is running', pcRuns: 'On this computer', refreshPs: 'Refresh', noRems: 'Nothing pending: no reminders or alerts.', psOff: '{name} can’t see your programs. Turn on “Processes and apps” to list them and let it wait for one to finish.', psOn: 'Turn on', screenEvery: 'Looks at your screen every {n} min', lastSeen: 'last: {what}', priceW: '{coin} {op} {value} {vs}', priceNow: 'now {p}', procW: '“{m}” {until}', untilExit: 'when it ends', untilStart: 'when it starts', running: 'running', notRunning: 'not running', remind: 'Reminder', cpu: 'CPU', mem: 'Mem', up: 'Up', prog: 'Program', cancel: 'Cancel',
@@ -417,7 +434,7 @@
417
434
  notify: 'Notificaciones', notifyD: 'Una notificación de escritorio cuando suena un recordatorio.',
418
435
  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.',
419
436
  petH: 'Cuánto habla', annoyHint: 'Qué tan seguido comenta lo que haces.', a0: 'Callado', a1: 'Poco', a2: 'Normal', a3: 'Charlatán',
420
- 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' },
437
+ 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' },
421
438
  view: 'Aspecto:', v2d: '2D', v3d: 'Peluche 3D', viewNext: 'Listo: el ot cambia al instante.',
422
439
  notesH: 'Lo que sabe de ti', notesHint: 'Sus notas. Dile “anota que…” para agregar una.', noNotes: 'Nada todavía.', forget: 'Olvidar', forgetAll: 'Olvidar todo', sure: 'Haz clic otra vez para olvidar todo',
423
440
  remH: 'Procesos', remHint: 'Lo que {name} está haciendo por ti: recordatorios, alertas y los programas que está esperando. Pídele “recuérdame…”, “avísame si BTC llega a 85 mil” o “avísame cuando termine el build”.', infTotal: 'Últimas {n} llamadas: {in} entrada → {out} salida · {all} tokens', petRuns: 'Lo que {name} tiene corriendo', pcRuns: 'En este computador', refreshPs: 'Actualizar', noRems: 'Nada pendiente: sin recordatorios ni alertas.', psOff: '{name} no ve tus programas. Activa “Procesos y apps” para listarlos y que pueda esperar a que uno termine.', psOn: 'Activar', screenEvery: 'Mira tu pantalla cada {n} min', lastSeen: 'última: {what}', priceW: '{coin} {op} {value} {vs}', priceNow: 'ahora {p}', procW: '“{m}” {until}', untilExit: 'cuando termine', untilStart: 'cuando empiece', running: 'corriendo', notRunning: 'no está corriendo', remind: 'Recordatorio', cpu: 'CPU', mem: 'Mem', up: 'Hace', prog: 'Programa', cancel: 'Cancelar',
@@ -451,7 +468,7 @@
451
468
  notify: 'Notificações', notifyD: 'Uma notificação na área de trabalho quando um lembrete toca.',
452
469
  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.',
453
470
  petH: 'Quanto fala', annoyHint: 'Com que frequência comenta o que você faz.', a0: 'Calado', a1: 'Pouco', a2: 'Normal', a3: 'Tagarela',
454
- 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' },
471
+ 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' },
455
472
  view: 'Visual:', v2d: '2D', v3d: 'Pelúcia 3D', viewNext: 'Pronto: o ot muda na hora.',
456
473
  notesH: 'O que ele sabe de você', notesHint: 'As notas dele. Diga “anote que…” para adicionar.', noNotes: 'Nada ainda.', forget: 'Esquecer', forgetAll: 'Esquecer tudo', sure: 'Clique de novo para esquecer tudo',
457
474
  remH: 'Processos', remHint: 'O que {name} está fazendo por você: lembretes, alertas e os programas que está esperando. Peça “me lembre…”, “me avise se o BTC chegar a 85 mil” ou “me avise quando o build terminar”.', infTotal: 'Últimas {n} chamadas: {in} entrada → {out} saída · {all} tokens', petRuns: 'O que {name} está rodando', pcRuns: 'Neste computador', refreshPs: 'Atualizar', noRems: 'Nada pendente: sem lembretes nem alertas.', psOff: '{name} não vê seus programas. Ative “Processos e apps” para listá-los e esperar um terminar.', psOn: 'Ativar', screenEvery: 'Olha sua tela a cada {n} min', lastSeen: 'última: {what}', priceW: '{coin} {op} {value} {vs}', priceNow: 'agora {p}', procW: '“{m}” {until}', untilExit: 'quando terminar', untilStart: 'quando começar', running: 'rodando', notRunning: 'não está rodando', remind: 'Lembrete', cpu: 'CPU', mem: 'Mem', up: 'Há', prog: 'Programa', cancel: 'Cancelar',
@@ -1149,6 +1166,10 @@
1149
1166
  r.addEventListener('change', () => save({ pet: { view: k } }, $('#petMsg'), t('viewNext')));
1150
1167
  return el('label', { className: 'chip' }, r, t(`v${k}`));
1151
1168
  }));
1169
+ // its art style's background (comic panel, ukiyo-e…) behind the ot, or the ot alone
1170
+ const bd = el('input', { type: 'checkbox', checked: S.config.pet.backdrop !== false });
1171
+ bd.addEventListener('change', () => save({ pet: { backdrop: bd.checked } }, $('#petMsg'), t('viewNext')));
1172
+ $('#view').append(el('label', { className: 'chip', title: t('bdHint') }, bd, ' ', t('bd')));
1152
1173
  }
1153
1174
 
1154
1175
  // ── scenes between ots (pet/electron/director.cjs reads them from GET /scenes) ──
@@ -1180,6 +1201,43 @@
1180
1201
  }
1181
1202
  });
1182
1203
 
1204
+ // ── dances and music (POST /dance, /entrance; songs from GET /music) ──
1205
+ function renderMusic() {
1206
+ const p = S.config.pet;
1207
+ const mode = p.music || 'synth';
1208
+ const put = (pet) => save({ pet }, $('#muMsg')).then(() => renderMusic());
1209
+ $('#muMode').replaceChildren(...['synth', 'files', 'off'].map((k) => {
1210
+ const r = el('input', { type: 'radio', name: 'muMode', value: k, checked: mode === k });
1211
+ r.addEventListener('change', () => put({ music: k }));
1212
+ return el('label', { className: 'chip' }, r, (T[lang].muMode || T.en.muMode)[k]);
1213
+ }));
1214
+ $('#muVol').value = p.musicVol ?? 0.5;
1215
+ $('#muVol').onchange = (e) => put({ musicVol: Number(e.target.value) });
1216
+ const n = (S.musicFiles || []).length;
1217
+ $('#muFiles').hidden = mode !== 'files';
1218
+ $('#muFiles').textContent = t(n ? 'muSome' : 'muNone', { n, dir: '~/.7ots/music' });
1219
+ const en = { onStart: false, kind: 'wwe', dance: '', ...p.entrance };
1220
+ const putE = (e) => put({ entrance: e });
1221
+ $('#enOn').checked = !!en.onStart;
1222
+ $('#enOn').onchange = (e) => putE({ onStart: e.target.checked });
1223
+ $('#enKind').replaceChildren(...['wwe', 'rock', 'magic', 'random'].map((k) => {
1224
+ const r = el('input', { type: 'radio', name: 'enKind', value: k, checked: en.kind === k });
1225
+ r.addEventListener('change', () => putE({ kind: k }));
1226
+ return el('label', { className: 'chip' }, r, (T[lang].enKind || T.en.enKind)[k]);
1227
+ }));
1228
+ $('#enDance').replaceChildren(el('option', { value: '', textContent: t('enAny') }), ...(S.dances || []).map((d) => el('option', { value: d, textContent: d, selected: en.dance === d })));
1229
+ $('#enDance').onchange = (e) => putE({ dance: e.target.value });
1230
+ }
1231
+ for (const [id, path] of [['#muDance', '/dance'], ['#muEnter', '/entrance']])
1232
+ $(id).addEventListener('click', async () => {
1233
+ try {
1234
+ await api(path, {});
1235
+ flash($('#muMsg'), t('muDone'));
1236
+ } catch (e) {
1237
+ flash($('#muMsg'), t('err', { e: e.message }), 'err');
1238
+ }
1239
+ });
1240
+
1183
1241
  // ── mods of its look (src/character/mods.js): previews drawn with the 7ots library ──
1184
1242
  const modName = (m) => (m.name && typeof m.name === 'object' ? m.name[lang] || m.name.en || Object.values(m.name)[0] : m.name) || m.id;
1185
1243
  const modViews = []; // previews 3D vivos (se destruyen al redibujar)
@@ -1850,6 +1908,7 @@
1850
1908
  renderAccess();
1851
1909
  renderPet();
1852
1910
  renderScenes();
1911
+ renderMusic();
1853
1912
  renderMods();
1854
1913
  renderChar();
1855
1914
  renderLang();