@7ots/cli 0.1.36 → 0.1.38

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@7ots/cli",
3
- "version": "0.1.36",
3
+ "version": "0.1.38",
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/server.mjs CHANGED
@@ -480,7 +480,7 @@ function redirectSlash(req, res, pathname) {
480
480
  res.end();
481
481
  }
482
482
 
483
- const STATIC_DIRS = ['site', 'brand', 'examples', 'src', 'dist'];
483
+ const STATIC_DIRS = ['site', 'brand', 'examples', 'src', 'dist', 'oss'];
484
484
 
485
485
  async function serveStatic(req, res, url) {
486
486
  const pathname = url.pathname;
@@ -141,7 +141,7 @@ export class AvatarStage {
141
141
  orbit: this.cfg.orbit === true,
142
142
  quality: this.cfg.quality || 'high',
143
143
  // escenario propio por encima del panel del widget (z-index 2147483000)
144
- stage: { key: 'overlay', zIndex: 2147483001, maxDpr: 1.5 },
144
+ stage: { key: 'overlay', zIndex: 2147483001, maxDpr: 2 },
145
145
  });
146
146
  this._ch = ch;
147
147
  this.mode = ch.fallback ? '2d' : '3d-plush';
@@ -321,7 +321,7 @@ export function createRoom3D(el, spec, opts = {}) {
321
321
  const k = Object.keys(POIS).find((kk) => { const p = POIS[kk]; return Math.hypot(x - (p.seat?.[0] ?? p.at[0]), z - (p.seat?.[2] ?? p.at[1])) < 0.9; });
322
322
  if (k && (POIS[k].seat || blocked(x, z))) return run((dead) => act(k, dead));
323
323
  if (blocked(x, z)) return;
324
- run(async (dead) => { await guard(dead)(leaveSeat()); doing(t('room.walk')); await guard(dead)(walkTo(x, z, 1.3)); doing(t('room.you')); });
324
+ run(async (dead) => { await guard(dead)(leaveSeat()); doing(t('room.walk')); await guard(dead)(walkTo(x, z, 1.3)); doing(t('room.you')); el.focus({ preventScroll: true }); });
325
325
  });
326
326
  box.addEventListener('click', (e) => {
327
327
  const b = e.target.closest('button');
@@ -12,6 +12,7 @@
12
12
  * bajan de ~50 se reduce el DPR a pasos, y se recupera cuando sobra margen;
13
13
  * - las vistas fuera de pantalla (IntersectionObserver) ni se animan ni se dibujan;
14
14
  * - con la pestaña oculta el bucle se detiene del todo;
15
+ * - `fps` opcional: tope de cuadros por segundo (el pet de escritorio dibuja a 30);
15
16
  * - entorno (RoomEnvironment → PMREM) generado una vez y compartido por todas las escenas.
16
17
  *
17
18
  * Requisito: la página debe declarar el importmap de three (igual que src/avatar/AvatarStage.js):
@@ -43,6 +44,8 @@ class Stage {
43
44
  this.minDpr = Math.min(opts.minDpr || 0.75, this.maxDpr);
44
45
  this.dpr = this.maxDpr;
45
46
  this.adaptive = opts.adaptive !== false;
47
+ // fps: frame cap (the desktop pet at 30 is as smooth to the eye and costs half the CPU/GPU of 60)
48
+ this.fps = opts.fps || 0;
46
49
  const canvas = document.createElement('canvas');
47
50
  canvas.className = 'ots3d-canvas';
48
51
  canvas.setAttribute('aria-hidden', 'true');
@@ -157,6 +160,7 @@ class Stage {
157
160
  // una vista cuyo elemento salió del DOM sin destroy() (la vista cambió por innerHTML) no se dibuja más
158
161
  for (const v of this.visible) if (!v.el.isConnected) this.visible.delete(v);
159
162
  if (!this.visible.size) return this.clear();
163
+ if (this.fps && t - this.last < 1000 / this.fps - 4) return (this.raf = requestAnimationFrame((tt) => this.frame(tt)));
160
164
  const dt = Math.min(64, Math.max(0, t - this.last));
161
165
  this.last = t;
162
166
  const t0 = performance.now();
@@ -198,8 +202,9 @@ class Stage {
198
202
  triangles: r.info.render.triangles, dpr: this.dpr, views: this.visible.size, characters: chars,
199
203
  });
200
204
  if (this.adaptive && this._statT) {
201
- if (fps < 48 && this.dpr > this.minDpr) { this.dpr = Math.max(this.minDpr, Math.round((this.dpr - 0.25) * 100) / 100); this._good = 0; }
202
- else if (fps > 57 && this.dpr < this.maxDpr && ++this._good >= 3) { this.dpr = Math.min(this.maxDpr, this.dpr + 0.25); this._good = 0; }
205
+ const goal = this.fps || 60;
206
+ if (fps < goal * 0.8 && this.dpr > this.minDpr) { this.dpr = Math.max(this.minDpr, Math.round((this.dpr - 0.25) * 100) / 100); this._good = 0; }
207
+ else if (fps > goal * 0.95 && this.dpr < this.maxDpr && ++this._good >= 3) { this.dpr = Math.min(this.maxDpr, this.dpr + 0.25); this._good = 0; }
203
208
  }
204
209
  this._statT = t;
205
210
  this._frames = 0;
package/src/index.js CHANGED
@@ -67,6 +67,7 @@ export { UIManager } from './ui/UIManager.js';
67
67
  export { AvatarStage, MOODS, GESTURES, MOODS_2D, ALL_GESTURES, GESTURE_3D } from './avatar/AvatarStage.js';
68
68
  export { loadCharacter3D } from './avatar/three.js';
69
69
  export { VoiceEngine } from './voice/VoiceEngine.js';
70
+ export { stripMarkdown } from './voice/tags.js';
70
71
  export { ProxyLLM } from './llm/ProxyLLM.js';
71
72
  export { ApuchatBridge, createApuchatActions } from './integrations/apuchat.js';
72
73
  export { createApumailActions } from './integrations/apumail.js';