@istarry/spoon-companion 0.9.3 → 0.9.4

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 (2) hide show
  1. package/lib/state.js +5 -3
  2. package/package.json +1 -1
package/lib/state.js CHANGED
@@ -301,7 +301,9 @@ function tickDrives(state, now) {
301
301
  const { missed, hour } = mealState(now)
302
302
  const base = circadian(new Date(now))
303
303
  const awake = !(hour >= SLEEP.from && hour < SLEEP.to)
304
- const idle = (now - (drives.lastSocialAt || now)) / HOUR
304
+ // 从没记过"上次说话"时,不能当成"刚刚才说过" —— 那会让独处加成永远不触发。
305
+ const lastSocialAt = Number(drives.lastSocialAt) || 0
306
+ const idle = lastSocialAt > 0 ? (now - lastSocialAt) / HOUR : 24
305
307
 
306
308
  if (awake) {
307
309
  // 馋:只在下午茶和夜宵两个口子上来一点,其他时候几乎不动
@@ -310,9 +312,9 @@ function tickDrives(state, now) {
310
312
  // 饿只是嘴馋的子项:涨得慢、封顶 0.85,不会再顶满一整天
311
313
  drives.hunger = clamp01(Math.min(0.85, (drives.hunger ?? 0.1) + dt * (0.02 + missed * 0.015)))
312
314
  }
313
- // 困:按作息涨,睡一觉就重置
315
+ // 困:醒着按作息涨,睡着了是真的在恢复(不是继续涨)
314
316
  if (awake) drives.fatigue = clamp01(drives.fatigue + dt * (0.05 + base.sleepy * 0.12))
315
- else drives.fatigue = clamp01(drives.fatigue + dt * 0.02)
317
+ else drives.fatigue = clamp01(drives.fatigue - dt * 0.14)
316
318
 
317
319
  // 黏:清醒时慢慢涨,六个小时没消息就涨得更快
318
320
  if (awake) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@istarry/spoon-companion",
3
- "version": "0.9.3",
3
+ "version": "0.9.4",
4
4
  "description": "让对话角色有自己的内心和声音:心情情绪随时间和对话自己演,回复一条一条发出来,能念出声(DeepSeek / 小米 MiMo),也能听得见——点麦克风说话,本地识别后直接发送。四块都能单独关。",
5
5
  "type": "module",
6
6
  "main": "plugin.js",