@7ots/cli 0.1.17 → 0.1.36

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.
Files changed (107) hide show
  1. package/.env.example +14 -0
  2. package/README.md +11 -0
  3. package/brand/logos/base.svg +1 -0
  4. package/brand/logos/clawpump.png +0 -0
  5. package/brand/logos/conductors.svg +1 -0
  6. package/brand/logos/notlogin.svg +12 -0
  7. package/brand/logos/pumpfun.png +0 -0
  8. package/brand/logos/solana.png +0 -0
  9. package/brand/logos/spawnerbot.svg +1 -0
  10. package/brand/logos/virtuals.png +0 -0
  11. package/cli/7ots.mjs +61 -1
  12. package/cli/lib/account.mjs +23 -3
  13. package/cli/lib/assistant.mjs +92 -14
  14. package/cli/lib/brain.mjs +84 -11
  15. package/cli/lib/card-shot.mjs +1 -1
  16. package/cli/lib/config.mjs +14 -3
  17. package/cli/lib/desktop-sync.mjs +177 -0
  18. package/cli/lib/i18n.mjs +9 -0
  19. package/cli/lib/inferences.mjs +19 -2
  20. package/cli/lib/integrations.mjs +98 -13
  21. package/cli/lib/mcp.mjs +1 -1
  22. package/cli/lib/open.mjs +3 -1
  23. package/cli/lib/pet-server.mjs +352 -41
  24. package/cli/lib/prompts.mjs +1 -1
  25. package/cli/lib/screen.mjs +1 -1
  26. package/cli/lib/senses/gestures.mjs +121 -0
  27. package/cli/lib/senses/index.mjs +490 -0
  28. package/cli/lib/senses/rules.mjs +159 -0
  29. package/cli/lib/senses/sources/activity.mjs +95 -0
  30. package/cli/lib/senses/sources/calendar.mjs +75 -0
  31. package/cli/lib/senses/sources/index.mjs +17 -0
  32. package/cli/lib/senses/sources/mail.mjs +48 -0
  33. package/cli/lib/senses/sources/system.mjs +39 -0
  34. package/cli/lib/senses/util.mjs +41 -0
  35. package/cli/lib/senses/vendor.mjs +78 -0
  36. package/cli/lib/stt-local.py +16 -8
  37. package/cli/lib/stt.mjs +53 -6
  38. package/cli/lib/tooluse.mjs +56 -0
  39. package/cli/lib/tts-local.mjs +2 -2
  40. package/cli/lib/vm.mjs +2 -2
  41. package/cli/lib/wake-local.py +109 -0
  42. package/cli/lib/wake.mjs +102 -0
  43. package/cli/pet/electron/main.cjs +190 -8
  44. package/cli/pet/pet.html +153 -34
  45. package/cli/pet/senses.html +342 -0
  46. package/cli/pet/settings.html +815 -74
  47. package/dist/7ots.esm.js +373 -146
  48. package/dist/7ots.esm.js.map +4 -4
  49. package/dist/7ots.iife.js +373 -146
  50. package/dist/7ots.iife.js.map +4 -4
  51. package/llms.txt +27 -0
  52. package/package.json +5 -2
  53. package/server/channels/apuchat.mjs +18 -4
  54. package/server/errors.mjs +90 -0
  55. package/server/notify.mjs +78 -0
  56. package/server/server.mjs +84 -14
  57. package/server/settings.mjs +3 -0
  58. package/server/site.mjs +401 -0
  59. package/server/tts.mjs +29 -5
  60. package/src/avatar/AvatarStage.js +2 -2
  61. package/src/avatar/three.js +3 -2
  62. package/src/character/AvatarEditor.js +2 -1
  63. package/src/character/Character.js +38 -5
  64. package/src/character/TradingCard.js +2 -0
  65. package/src/character/beat.js +64 -2
  66. package/src/character/mods/orc.js +8 -1
  67. package/src/character/mods.js +104 -10
  68. package/src/character/motion.js +252 -1
  69. package/src/character/parts.js +40 -38
  70. package/src/character/styles.js +40 -38
  71. package/src/character3d/Character3D.js +26 -5
  72. package/src/character3d/body.js +14 -12
  73. package/src/character3d/export.js +693 -0
  74. package/src/character3d/fx.js +13 -0
  75. package/src/character3d/index.js +2 -0
  76. package/src/character3d/materials.js +106 -10
  77. package/src/character3d/room-themes.js +1184 -0
  78. package/src/character3d/room.js +487 -0
  79. package/src/character3d/stage.js +14 -2
  80. package/src/creator/StepCreator.js +316 -0
  81. package/src/i18n/index.js +3 -3
  82. package/src/i18n/messages/character.js +352 -4
  83. package/src/i18n/messages/creator.js +138 -0
  84. package/src/i18n/messages/identity.js +89 -1
  85. package/src/i18n/messages/platform.js +270 -4
  86. package/src/i18n/messages/server.js +443 -1
  87. package/src/i18n/messages/widget.js +233 -0
  88. package/src/identity/random.js +14 -2
  89. package/src/identity/schema.js +2 -1
  90. package/src/index.js +9 -2
  91. package/src/voice/tags.js +22 -0
  92. package/server/platform/apuchat.mjs +0 -266
  93. package/server/platform/auth.mjs +0 -319
  94. package/server/platform/connect.mjs +0 -387
  95. package/server/platform/crypto.mjs +0 -80
  96. package/server/platform/db.mjs +0 -275
  97. package/server/platform/device.mjs +0 -222
  98. package/server/platform/integrations.mjs +0 -169
  99. package/server/platform/look.mjs +0 -20
  100. package/server/platform/mods.mjs +0 -222
  101. package/server/platform/orquesta.mjs +0 -577
  102. package/server/platform/profile.mjs +0 -161
  103. package/server/platform/routes.mjs +0 -542
  104. package/server/platform/runtime.mjs +0 -242
  105. package/server/platform/sites.mjs +0 -146
  106. package/server/platform/store.mjs +0 -456
  107. package/server/platform/vm.mjs +0 -1057
@@ -24,6 +24,16 @@ const STYLE_FINISH = {
24
24
  riso: 'toon', dotmatrix: 'toon', chalk: 'sketch', sticker: 'glossy', felt: 'clay', papercut: 'soft3d', lowpoly: 'toon', marble: 'soft3d', candy: 'glossy',
25
25
  holo: 'glossy', sumie: 'sketch', tarot: 'toon', retro70: 'toon', mosaic: 'toon', neonsign: 'neon', graffiti: 'toon', thermal: 'soft3d',
26
26
  };
27
+ /**
28
+ * Materiales del ot en 3D (look.material, LOOK_MATERIALS de identity/schema.js): plush = peluche, vinyl = el acabado
29
+ * y la textura de su spec; los demás fijan el acabado y la textura del cuerpo (los estilos artísticos mandan igual).
30
+ */
31
+ export const MATERIAL3D = {
32
+ clay: { finish: 'clay', texture: 'none' }, metal: { finish: 'metal', texture: 'none' }, glass: { finish: 'glass', texture: 'none' },
33
+ pearl: { finish: 'pearl', texture: 'none' }, holo: { finish: 'holo', texture: 'none' }, wood: { finish: 'clay', texture: 'wood' },
34
+ stone: { finish: 'clay', texture: 'stone' }, knit: { finish: 'velvet', texture: 'knit' }, glitter: { finish: 'glossy', texture: 'glitter' },
35
+ quilt: { finish: 'velvet', texture: 'quilt' }, honeycomb: { finish: 'glossy', texture: 'honeycomb' }, bubbles: { finish: 'glass', texture: 'bubbles' },
36
+ };
27
37
  /** Piezas del catálogo 2 sin modelo 3D propio → la existente más parecida (campo `as3d` en parts.js). */
28
38
  function alias3D(s) {
29
39
  s.eyes = { ...s.eyes, type: as3d('eyes', s.eyes.type) };
@@ -43,10 +53,12 @@ function styled3D(spec) {
43
53
  return s;
44
54
  }
45
55
  import { shade, luminance, as3d } from '../character/parts.js';
56
+
57
+ const FINISH3D = new Set(['metal', 'glass', 'pearl', 'holo', 'velvet', 'pastel']);
46
58
  import { textureOf } from '../character/skin.js';
47
59
  import { GESTURES, GESTURE_ALIAS, VISEMES, EASE, clamp, lerp, approach, textToVisemes, babbleVisemes, HAND_POSES, MORPHS, EFFECTS, shapePoints, seeded } from '../character/motion.js';
48
60
  import { U, bodyGeometry, surfaceProbe } from './body.js';
49
- import { bodyMaterials, surfaceMaterial, mat, shadowTexture, CHEEK_IDS } from './materials.js';
61
+ import { bodyMaterials, surfaceMaterial, mat, shadowTexture, CHEEK_IDS, TEX_IDS } from './materials.js';
50
62
  import { FX3D, glyph, disposeFx } from './fx.js';
51
63
  import { buildModel, tickModel, modelGesture } from './model.js';
52
64
 
@@ -194,8 +206,12 @@ export class Character3D {
194
206
  const kk = (this.kk = Math.sqrt(W * H) / 1.25); // escala de accesorios (1 ≈ ot medio)
195
207
  const Y = (this.Y = (y) => (B.bottom - y) * U);
196
208
  const X = (this.X = (x) => (x - L.cx) * U);
197
- const tex = (this.tex = as3d('textures', textureOf(s)));
198
- const plush = (this.plush = !st && ((this.opts.material || 'plush') === 'plush' || ['fur', 'fuzz', 'feathers'].includes(tex)));
209
+ const mat3 = !st && MATERIAL3D[this.opts.material];
210
+ if (mat3) s.finish = mat3.finish;
211
+ const tex = (this.tex = mat3 ? mat3.texture : as3d('textures', textureOf(s)));
212
+ // a finish or texture picked in the creator (Acabado/Textura) that the shader draws wins over the default plush fur
213
+ const picked = !mat3 && (FINISH3D.has(s.finish) || (s.texture && s.texture !== 'auto' && tex in TEX_IDS));
214
+ const plush = (this.plush = !st && !mat3 && (['fur', 'fuzz', 'feathers'].includes(tex) || ((this.opts.material || 'plush') === 'plush' && !picked)));
199
215
  const furLen = (this.furLen = plush ? (tex === 'fuzz' || tex === 'none' ? 0.05 : 0.065) * kk : 0);
200
216
  const density = (this.density = furLen ? (this.quality === 'high' ? 1 / (furLen * 0.2) : 1 / (furLen * 0.32)) : 0);
201
217
  this.maxShells = this.quality === 'high' ? 28 : 10;
@@ -207,6 +223,7 @@ export class Character3D {
207
223
  lip: s.mouth.color || shade(body, dark ? 0.6 : -0.55),
208
224
  });
209
225
  this.furs = [];
226
+ this.pending = []; // glb de los mods que aún cargan (export.js los espera)
210
227
  this.parts = [];
211
228
  this.anims = [];
212
229
  this.bodyMeshes = [];
@@ -1210,7 +1227,7 @@ export class Character3D {
1210
1227
  holder.scale.setScalar(sc);
1211
1228
  g.add(holder);
1212
1229
  const tint = p.tint === 'body' ? this.spec.body.color : p.tint === 'color' ? a.color : '';
1213
- loadGlb(p.glb).then((scene) => {
1230
+ const job = loadGlb(p.glb).then((scene) => {
1214
1231
  const o = scene.clone(true);
1215
1232
  o.traverse((m) => {
1216
1233
  if (!m.isMesh) return;
@@ -1223,6 +1240,7 @@ export class Character3D {
1223
1240
  });
1224
1241
  holder.add(o);
1225
1242
  }).catch(() => g.add(plane()));
1243
+ this.pending.push(job);
1226
1244
  return g;
1227
1245
  }
1228
1246
 
@@ -1242,10 +1260,12 @@ export class Character3D {
1242
1260
  cv.getContext('2d').drawImage(img, 0, 0, cv.width, cv.height);
1243
1261
  tex.needsUpdate = true;
1244
1262
  };
1245
- img.src = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="${vx} ${vy} ${vw} ${vh}" width="${cv.width}" height="${cv.height}">${inner}</svg>`)}`;
1263
+ const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="${vx} ${vy} ${vw} ${vh}" width="${cv.width}" height="${cv.height}">${inner}</svg>`;
1264
+ img.src = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(svg)}`;
1246
1265
  const m = new THREE.Mesh(new THREE.PlaneGeometry(vw * sc, vh * sc), new THREE.MeshBasicMaterial({ map: tex, transparent: true, depthWrite: false, side: THREE.DoubleSide }));
1247
1266
  m.position.set((vx + vw / 2) * sc, -(vy + vh / 2) * sc, p.layer === 'back' ? -0.01 : 0.01);
1248
1267
  m.userData.ownMaterial = true;
1268
+ m.userData.modPlane = { svg, w: cv.width, h: cv.height }; // export.js lo rasteriza con o.rasterSvg (si no, lo deja fuera)
1249
1269
  return m;
1250
1270
  }
1251
1271
 
@@ -1473,6 +1493,7 @@ export class Character3D {
1473
1493
  this.fxg.rotation.y = this.yaw;
1474
1494
 
1475
1495
  for (const f of this.furs) f.u.uTime.value = sec;
1496
+ this.bodyU.uTime.value = sec; // destellos de la purpurina
1476
1497
  for (const a of this.anims) a(rm ? 0 : sec);
1477
1498
  }
1478
1499
 
@@ -92,6 +92,17 @@ export function bodyGeometry(pts, box, quality = 'high') {
92
92
  const Dc = depthK * mean;
93
93
 
94
94
  const [ws, hs] = quality === 'high' ? [96, 64] : [40, 26];
95
+ /** Dirección unitaria de la esfera → punto de la superficie (out). También la usa export.js para hornear. */
96
+ const surface = (x, y, z, out = new THREE.Vector3()) => {
97
+ const s2 = x * x + y * y;
98
+ const ang = Math.atan2(-y, x); // a coordenadas 2D (y hacia abajo)
99
+ const R = sampleTable(T, ang);
100
+ const Dt = depthK * Math.min(R, mean * 1.05);
101
+ const D = Dc + (Dt - Dc) * s2;
102
+ let py = (bottom - cy) * U + y * R * U;
103
+ if (py < 0.03) py = 0.03 + (py - 0.03) * 0.35; // asiento: aplana un poco la base para que «se apoye» en el suelo
104
+ return out.set(x * R * U, py, z * D * U);
105
+ };
95
106
  let g = new THREE.SphereGeometry(1, ws, hs);
96
107
  g.deleteAttribute('uv');
97
108
  g.deleteAttribute('normal');
@@ -100,23 +111,14 @@ export function bodyGeometry(pts, box, quality = 'high') {
100
111
  const v = new THREE.Vector3();
101
112
  for (let i = 0; i < pos.count; i++) {
102
113
  v.fromBufferAttribute(pos, i).normalize();
103
- const s2 = v.x * v.x + v.y * v.y;
104
- const ang = Math.atan2(-v.y, v.x); // a coordenadas 2D (y hacia abajo)
105
- const R = sampleTable(T, ang);
106
- const Dt = depthK * Math.min(R, mean * 1.05);
107
- const D = Dc + (Dt - Dc) * s2;
108
- pos.setXYZ(i, v.x * R * U, (bottom - cy) * U + v.y * R * U, v.z * D * U);
109
- }
110
- // asiento: aplana un poco la base para que «se apoye» en el suelo
111
- for (let i = 0; i < pos.count; i++) {
112
- const y = pos.getY(i);
113
- if (y < 0.03) pos.setY(i, 0.03 + (y - 0.03) * 0.35);
114
+ surface(v.x, v.y, v.z, v);
115
+ pos.setXYZ(i, v.x, v.y, v.z);
114
116
  }
115
117
  g.computeVertexNormals();
116
118
  g.computeBoundingBox();
117
119
  g.computeBoundingSphere();
118
120
  g.userData.shared = true; // cacheada: no se libera con el personaje
119
- const out = { geometry: g, table: T, cx, cy, bottom, mean, depth: Dc * U };
121
+ const out = { geometry: g, table: T, cx, cy, bottom, mean, depth: Dc * U, surface, segments: [ws, hs] };
120
122
  cache.set(key, out);
121
123
  if (cache.size > 160) cache.delete(cache.keys().next().value);
122
124
  return out;