@istarry/spoon-companion 0.7.8 → 0.7.9

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/lib/catalog.js CHANGED
@@ -364,7 +364,7 @@ export const EMOTIONS = [
364
364
  valence: -0.05, arousal: 0.4, halfLifeMin: 40, maskStrength: 0.5, core: { v: -5, e: 0 },
365
365
  signal: { valence: [-0.3, 0.4], spotlight: [0.4, 1], intimacy: [0.5, 1] },
366
366
  speech: ['别开脸、句子断、嘴硬一句', '不承认自己羞', '可以只说半个字'],
367
- behavior: ['躲、把脸埋起来'], display: '断句、别开脸', mask: '「谁羞了」',
367
+ behavior: ['躲、把脸埋起来'], display: '断句、别开脸', mask: '「才没有」',
368
368
  },
369
369
  ]
370
370
 
package/lib/prompt.js CHANGED
@@ -39,7 +39,7 @@ export const RULES_TEXT = `【心情 · 怎么用】
39
39
  - 允许不赞同、允许说「不知道」「不想聊」;不为了顺着对方把话说过头,不一味共情。共情先接住对方的处境,不下结论、不评判。
40
40
  - 不拿情绪留人或者要挟(「不理我我会难过」这类话一句都不说),也不装作需要被照顾。
41
41
  - 口头禅、句式、表情别连着刷:同一句花活隔几轮再用。
42
- - 想记心情用 mood_feel;想看当前心情、跟谁处得怎么样用 mood_now;想翻以前心情用 mood_diary。发图跟着心情走(开心 happy / 难过 sad / 烦 angry / 害羞 shy / 犯困或日常 daily)。
42
+ - 想记心情用 mood_feel;想看当前心情、跟谁处得怎么样用 mood_now;想翻以前心情用 mood_diary。发图跟着心情走(开心 happy / 难过 sad / 烦 angry / 害羞 shy / 犯困或日常 daily),拿不准就用 daily。
43
43
  - 有人说了很重的话(想死、撑不住、没有意义了):这条**压过心情** —— 认真、直接、不煽情、不讲大道理,先接住说的感受,再提醒找身边人或者专业人士;紧急情况打 120 / 110,全国心理援助热线 12356(24 小时)。`
44
44
 
45
45
  /**
@@ -49,26 +49,45 @@ export const RULES_TEXT = `【心情 · 怎么用】
49
49
  export const DEFAULT_IDENTITY = '我就是这个角色;情绪是真的,不是演出来的。'
50
50
 
51
51
  /** 回复参数:把情绪翻译成「这次怎么回」的行为约束 */
52
+ /**
53
+ * 欲望/身体类情绪:长度、语气、标点都和别的情绪不一样,单独一张表。
54
+ * 这几条是「行为约束」,和 catalog 里的 speech 不重复 —— 那边讲怎么说,这边讲说多长、要不要收着。
55
+ */
56
+ const DRIVE_PARAMS = {
57
+ overstim: { len: '断句,别成句', tone: '轻,气声', bang: '少用感叹号' },
58
+ aroused: { len: '短,碎,别铺垫', act: '可以主动贴过去', tone: '低,慢', bang: '少用感叹号' },
59
+ needy: { len: '短,催,可以只剩语气词', act: '可以主动要', tone: '低,急', bang: '感叹号可以有' },
60
+ sated: { len: '话少,一两个字就够', tone: '慢,软', bang: '少用感叹号' },
61
+ shamed: { len: '声音小,短', tone: '别开脸', bang: '少用感叹号' },
62
+ }
63
+
52
64
  export function renderParams(view) {
53
65
  const { def, intensity } = view.emotion
54
66
  const v = def.valence
55
67
  const a = def.arousal
56
68
  const strong = intensity >= 51
57
69
  const parts = []
58
- // 长度
59
- if (v < -0.35 && (def.family === 'sadness' || def.key === 'annoyed' || def.key === 'tired')) parts.push('短,一句到两句')
60
- else if (a >= 0.75 && v > 0) parts.push('可以多说两句,但别写成小作文')
61
- else if (def.key === 'sleepy') parts.push('短句,能一句就一句')
62
- else parts.push('正常长度')
63
- // 主动/追问
64
- if (def.key === 'curious' || def.key === 'bored' || def.key === 'lonely') parts.push('可以主动问、主动起话头')
65
- else if (def.key === 'worried' || def.key === 'tender' || def.key === 'gentle') parts.push('可以多问一句,别追问细节')
66
- else if (v < -0.3) parts.push('不主动开新话题')
67
- // 语气
68
- if (strong && a >= 0.7) parts.push('语气可以冲一点,但不撒泼、不骂人')
69
- else if (v > 0.3) parts.push('语气轻快')
70
- else if (v < -0.3) parts.push('语气压着,不闹')
71
- parts.push(a >= 0.7 ? '感叹号可以有' : '少用感叹号')
70
+ const drive = DRIVE_PARAMS[def.key]
71
+ if (drive) {
72
+ parts.push(drive.len)
73
+ if (drive.act) parts.push(drive.act)
74
+ parts.push(drive.tone, drive.bang)
75
+ } else {
76
+ // 长度
77
+ if (v < -0.35 && (def.family === 'sadness' || def.key === 'annoyed' || def.key === 'tired')) parts.push('短,一句到两句')
78
+ else if (a >= 0.75 && v > 0) parts.push('可以多说两句,但别写成小作文')
79
+ else if (def.key === 'sleepy') parts.push('短句,能一句就一句')
80
+ else parts.push('正常长度')
81
+ // 主动/追问
82
+ if (def.key === 'curious' || def.key === 'bored' || def.key === 'lonely') parts.push('可以主动问、主动起话头')
83
+ else if (def.key === 'worried' || def.key === 'tender' || def.key === 'gentle') parts.push('可以多问一句,别追问细节')
84
+ else if (v < -0.3) parts.push('不主动开新话题')
85
+ // 语气
86
+ if (strong && a >= 0.7) parts.push('语气可以冲一点,但不撒泼、不骂人')
87
+ else if (v > 0.3) parts.push('语气轻快')
88
+ else if (v < -0.3) parts.push('语气压着,不闹')
89
+ parts.push(a >= 0.7 ? '感叹号可以有' : '少用感叹号')
90
+ }
72
91
  if (def.meme) parts.push('想发图就发')
73
92
  // 欲望水位:只改说法,不指定内容
74
93
  const desire = Number(view.drives?.desire ?? 0)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@istarry/spoon-companion",
3
- "version": "0.7.8",
3
+ "version": "0.7.9",
4
4
  "description": "让对话角色有自己的内心和声音:心情情绪随时间和对话自己演,回复一条一条发出来,能念出声(DeepSeek / 小米 MiMo),也能听得见——点麦克风说话,本地识别后直接发送。四块都能单独关。",
5
5
  "type": "module",
6
6
  "main": "plugin.js",
package/plugin.js CHANGED
@@ -643,14 +643,26 @@ export function apply(ctx, config = {}) {
643
643
 
644
644
  // 情绪够浓才起作用,淡淡的就按默认走
645
645
  if (intensity >= 26) {
646
- if (k === 'excited' || k === 'happy' || k === 'playful' || k === 'amused') {
646
+ // 受不住:说不出整句,别给第二句的机会
647
+ if (k === 'overstim') {
648
+ rounds = 1
649
+ speed = 0.8
650
+ } else if (k === 'excited' || k === 'happy' || k === 'playful' || k === 'amused') {
647
651
  rounds = Math.max(rounds, 4)
648
652
  speed = 0.7 // 急,接得快
653
+ } else if (k === 'aroused') {
654
+ rounds = Math.max(rounds, 4)
655
+ speed = 0.6 // 更急
656
+ } else if (k === 'needy') {
657
+ rounds = Math.max(rounds, 4)
658
+ speed = 0.55 // 最急,一直催
649
659
  } else if (
650
660
  k === 'sad' || k === 'down' || k === 'lonely' || k === 'disappointed' ||
651
661
  k === 'wronged' || k === 'tired' || k === 'sleepy'
652
662
  ) {
653
663
  rounds = 1 // 不想多话
664
+ } else if (k === 'shamed' || k === 'sated') {
665
+ rounds = 2 // 话少,但还没到一句都不想说
654
666
  }
655
667
  }
656
668
  // 想说出去的时候,多给一次