cortico-world-agent-speed 0.2.9 → 0.2.10

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/CHANGELOG.md CHANGED
@@ -6,8 +6,8 @@
6
6
  - DeepSeek Chan's tail-wag frequency follows aggregate output with the updated figure pack. Acceleration, peaks, and sustained high output can trigger distinct native gestures. No speed display or continuous body stretching.
7
7
  - Fixed missing feedback when the pet first sees high output or is briefly busy. Reduced motion and partial source data keep the tail response and use only gentle nods.
8
8
  - The status bubble shows “Working” while Agent Speed reports activity, including tool-only work. Chat and voice bubbles still take priority.
9
- - DeepSeek Chan keeps a visible, speed-driven tail wag during output even after a facial expression or gesture ends. A brief zero reading during work no longer drops the tail straight to idle.
10
- - The pet briefly smiles when Agent Speed starts working and looks excited on a marked increase in output. These expressions do not add sound or body bounce.
9
+ - DeepSeek Chan's tail reacts more strongly to low output and gradually approaches its top speed instead of hitting a cutoff. Slow strokes are wider, fast strokes narrower, and brief zero readings during work do not reset the wag.
10
+ - The pet keeps its excited expression while Agent Speed reports output; chat, voice, and manual actions still take priority.
11
11
  - The inline dressing stage animates the actual installed figure, with its full body visible on the preview floor.
12
12
  - DeepSeek Chan artwork is not bundled in this npm package; compatible figure ZIPs can be installed separately from Agent Speed's dressing panel.
13
13
 
package/README.md CHANGED
@@ -15,7 +15,7 @@ Closing the window leaves the World enabled; use **Open window** to reopen it. D
15
15
 
16
16
  ## Behavior and limits
17
17
 
18
- - Agent Speed uses combined output across sessions. With the updated DeepSeek Chan figure pack, the tail's working rhythm follows output independently of gestures and expressions; a brief zero reading during work does not reset it. The pet does not display the rate or stretch to match it. For an existing DeepSeek Chan install, import the updated `deepseek-whale-figure.zip` in Agent Speed's dressing panel, confirm replacement, and reopen the pet window.
18
+ - Agent Speed uses combined output across sessions. With the updated DeepSeek Chan figure pack, tail-wag frequency responds more strongly at low output and gradually approaches 3.4× its idle cadence; the stroke narrows as the tail speeds up. A brief zero reading during work does not reset it. The pet does not display the rate or stretch to match it. For an existing DeepSeek Chan install, import the updated `deepseek-whale-figure.zip` in Agent Speed's dressing panel, confirm replacement, and reopen the pet window.
19
19
  - On top of activity animation, the World retains the upstream interactive pet. Actions such as typing to the pet or enabling voice can still involve the configured bot; **activity itself does not**. Voice input and computer use are off by default. If you deliberately assign the same global hotkey in both pets, use different keys or disable one binding.
20
20
  - The built-in pet's Coopanion-specific tray, chat page, and first-run settings remain tied to the built-in World. The extension has its own tray, window, settings, figure storage, and tools (`speed_pet_*`), independent of `desktop-pet`. Linux is not an advertised target for this extension. Native Windows and macOS GUI operation has not been verified in this checkout.
21
21
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cortico-world-agent-speed",
3
- "version": "0.2.9",
3
+ "version": "0.2.10",
4
4
  "type": "module",
5
5
  "description": "The Coopanion desktop pet with local Agent Speed activity animation",
6
6
  "main": "./src/index.ts",
@@ -15,6 +15,7 @@ const ATTACK_SECONDS = .2;
15
15
  const RELEASE_SECONDS = .7;
16
16
  // Exporters sample about once a second. Bridge one zero sample during active work.
17
17
  const TAIL_ZERO_GRACE_MS = 2200;
18
+ const TAIL_RESPONSE_RATE = 70;
18
19
  export const MAX_TAIL_TEMPO = 3.4;
19
20
  const STATIONARY_MOTION = /^(?:(?:small|little|gentle|quick)[_-])?(point|nod|wave|hop|flap|spin|dance|bow)(?:[_-](?:once|twice))?$/i;
20
21
 
@@ -24,10 +25,7 @@ const outputRate = (sample) =>
24
25
  Number.isFinite(sample?.outputPerSecond) && sample.outputPerSecond > 0 ? sample.outputPerSecond : 0;
25
26
 
26
27
  function targetTempo(rate) {
27
- // (t/s, multiplier): (0, 1), (20, 1.5), (80, 2.35), (180+, 3.4).
28
- if (rate <= 20) return 1 + .5 * (rate / 20);
29
- if (rate <= 80) return 1.5 + (2.35 - 1.5) * ((rate - 20) / 60);
30
- return 2.35 + (MAX_TAIL_TEMPO - 2.35) * (Math.min(rate - 80, 100) / 100);
28
+ return 1 + (MAX_TAIL_TEMPO - 1) * -Math.expm1(-rate / TAIL_RESPONSE_RATE);
31
29
  }
32
30
 
33
31
  function findMotion(words, reported, kind) {
@@ -48,7 +46,7 @@ export function createActivityMotion() {
48
46
  let nextSmall = 'point', nextPeak = 'hop';
49
47
  let tempoFrom = 1, tempoTo = 1, tempoElapsed = 0;
50
48
  let lastOutputAt = -Infinity, lastOutputRate = 0;
51
- let workStartedAt = null, faceUntil = 0, nextExcitedAt = 0;
49
+ let workStartedAt = null, smileUntil = 0;
52
50
  const activity = { active: false, engaged: false, cue: null, face: null, tailTempo: 1 };
53
51
 
54
52
  function clearCueHistory() {
@@ -86,19 +84,17 @@ export function createActivityMotion() {
86
84
  activity.active = rate > 0 || !!(fresh?.generating || fresh?.tools);
87
85
  activity.engaged = eligible && activity.active;
88
86
  activity.cue = null;
89
- if (!activity.active) {
90
- workStartedAt = null;
91
- nextExcitedAt = 0;
92
- } else if (!wasActive) workStartedAt = now;
93
- if (!activity.engaged || now >= faceUntil) activity.face = null;
87
+ if (!activity.engaged || !activity.active || rate > 0) smileUntil = 0;
88
+ if (!activity.active || rate > 0) workStartedAt = null;
89
+ else if (!wasActive) workStartedAt = now;
94
90
  if (workStartedAt !== null && now - workStartedAt > CUE_MAX_AGE_MS) workStartedAt = null;
95
91
  if (workStartedAt !== null && canCue && activity.engaged) {
96
92
  workStartedAt = null;
97
- if (reported?.includes('happy')) {
98
- activity.face = 'happy';
99
- faceUntil = now + 1200;
100
- }
93
+ if (reported?.includes('happy')) smileUntil = now + 1200;
101
94
  }
95
+ activity.face = activity.engaged
96
+ ? rate > 0 && reported?.includes('excited') ? 'excited' : now < smileUntil ? 'happy' : null
97
+ : null;
102
98
 
103
99
  // Hand gestures and expressions may pause for interaction; the tail
104
100
  // follows the feed independently. Never retain a peak across idle or loss.
@@ -136,12 +132,6 @@ export function createActivityMotion() {
136
132
  if (changed && rate >= PEAK_ENTER) peakArmed = false;
137
133
  const marked = changed && prior > 0 && rate >= MARKED_ENTER && rate - prior >= MARKED_RISE;
138
134
  const small = changed && prior > 0 && prior < SMALL_PREVIOUS_LIMIT && rate >= SMALL_ENTER && rate < MARKED_ENTER;
139
- if (marked && fresh.complete === true && eligible && canCue && now >= nextExcitedAt && reported?.includes('excited')) {
140
- activity.face = 'excited';
141
- faceUntil = now + 1600;
142
- nextExcitedAt = now + CUE_COOLDOWN_MS;
143
- }
144
-
145
135
  const sustained = nextSustainedAt !== null && rate >= HIGH_EXIT && now >= nextSustainedAt;
146
136
  if (!eligible || !canCue || now < nextCueAt || (!changed && !sustained)) return activity;
147
137