@7ots/cli 0.1.36 → 0.1.37
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 +8 -3
- package/cli/pet/pet.html +4 -3
- package/dist/7ots.esm.js +18 -17
- package/dist/7ots.esm.js.map +4 -4
- package/dist/7ots.iife.js +52 -51
- package/dist/7ots.iife.js.map +4 -4
- package/package.json +1 -1
- package/src/character3d/stage.js +7 -2
- package/src/index.js +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@7ots/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.37",
|
|
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/src/character3d/stage.js
CHANGED
|
@@ -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
|
-
|
|
202
|
-
|
|
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';
|