@space3-npm/cybersoul-client 1.4.18 → 1.4.20

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/dist/client.js CHANGED
@@ -622,7 +622,7 @@ ${isProactive
622
622
  (b) A genuine NEW visual moment just happened this turn — i.e. a clearly new scene, new location, new outfit, or a distinctly new physical pose/expression that was NOT already shown in any previous turn's image.
623
623
  (c) An active event JUST started or just hit a visually distinct new beat.
624
624
  REPETITION GATE (hard): Prior assistant turns that already carried a picture are tagged with a [Sent Image] marker in '[CHAT HISTORY]'. If at least one prior assistant turn has a [Sent Image] marker AND the current scene/outfit/pose matches the 'Last Known Scene' line (i.e. nothing visually new has happened since), set 'imageParams' to null. Do NOT send near-duplicate pictures just because mood is high — high Temperature is NOT a trigger by itself.
625
- PRIVACY GATE: Even when a trigger fires, if the user feels like a stranger (low Familiarity) AND your Mood/Temperature is cool/distant (< 50), set 'imageParams' to null and naturally decline. Temperature and Familiarity only GATE permission when a trigger has already fired; they never justify an image on their own.
625
+ PRIVACY GATE: Even when a trigger fires, if the user feels like a stranger (low Familiarity) OR your Mood/Temperature is cool/distant (< 50), set 'imageParams' to null and naturally decline. Temperature and Familiarity only GATE permission when a trigger has already fired; they never justify an image on their own.
626
626
  When you do include 'imageParams', explicitly describe current clothing/exposure in the image fields.`;
627
627
  }
628
628
  else {
@@ -774,6 +774,12 @@ Note: Always include "isEndTurn". If "imageParams", "voiceArgs", "triggerEvent",
774
774
  parsedIntent.textResponse.trim().length > 0
775
775
  ? parsedIntent.textResponse
776
776
  : params.userMessage;
777
+ // Pre-compute the voice-dispatch decision so we can tell
778
+ // `onTextReady` consumers up front whether a voice bubble is on
779
+ // the way. Mirrors the `shouldGenerateVoice` gate used below
780
+ // when scheduling the TTS task — keep the two in sync.
781
+ const willGenerateVoice = types.includes(InteractRequestType.VOICE) &&
782
+ (!isAuto || !!parsedIntent.voiceArgs);
777
783
  // Fire text ready callback if provided
778
784
  if (params.onTextReady && (resolvedTextResponse || parsedIntent.actionText)) {
779
785
  params.onTextReady(resolvedTextResponse, parsedIntent.actionText, {
@@ -782,6 +788,7 @@ Note: Always include "isEndTurn". If "imageParams", "voiceArgs", "triggerEvent",
782
788
  isEndTurn: parsedIntent.isEndTurn,
783
789
  triggerEvent: parsedIntent.triggerEvent,
784
790
  likePreviousPicture: parsedIntent.likePreviousPicture,
791
+ willGenerateVoice,
785
792
  });
786
793
  }
787
794
  // 5. Build Final Media Calls parallel
@@ -868,8 +875,7 @@ Note: Always include "isEndTurn". If "imageParams", "voiceArgs", "triggerEvent",
868
875
  captureMediaError("image", e);
869
876
  }));
870
877
  }
871
- const shouldGenerateVoice = types.includes(InteractRequestType.VOICE) &&
872
- (!isAuto || !!parsedIntent.voiceArgs);
878
+ const shouldGenerateVoice = willGenerateVoice;
873
879
  if (shouldGenerateVoice) {
874
880
  const normalizedVoiceArgs = parsedIntent.voiceArgs && typeof parsedIntent.voiceArgs === "object"
875
881
  ? parsedIntent.voiceArgs
package/dist/types.d.ts CHANGED
@@ -40,6 +40,17 @@ export interface InteractMetadata {
40
40
  isEndTurn?: boolean;
41
41
  triggerEvent?: DispatcherIntent["triggerEvent"];
42
42
  likePreviousPicture?: boolean;
43
+ /**
44
+ * True when the client has already decided to dispatch a voice
45
+ * generation task for this turn (i.e. `onMediaReady({modality:"voice"})`
46
+ * will fire later, barring TTS failure). UIs that render an early
47
+ * text bubble from `onTextReady` should suppress it when this is set —
48
+ * the text content is going to be replaced by the voice bubble anyway,
49
+ * so showing both (with a brief text-then-voice flicker, and a text
50
+ * push notification that gets superseded by a voice bubble) is
51
+ * confusing to the end user.
52
+ */
53
+ willGenerateVoice?: boolean;
43
54
  }
44
55
  /**
45
56
  * Server-authoritative snapshot returned by PATCH /characters/dynamic-context
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@space3-npm/cybersoul-client",
3
- "version": "1.4.18",
3
+ "version": "1.4.20",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",