@space3-npm/cybersoul-client 1.4.1 → 1.4.3
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 +22 -19
- package/package.json +1 -1
package/dist/client.js
CHANGED
|
@@ -291,7 +291,8 @@ ${scenarioContext}
|
|
|
291
291
|
${isProactive
|
|
292
292
|
? "5. REAL-TIME PACING: You are initiating the conversation because the user hasn't replied recently. Transition naturally from your last message or start a new topic seamlessly. Ensure everything happens in a single real-time moment."
|
|
293
293
|
: "5. REAL-TIME PACING: Write ONLY your immediate, split-second reaction to the user's exact last message. Do NOT narrate actions over a span of time (e.g., waiting, hearing steps, then walking to the door). Ensure everything happens in a single real-time moment."}
|
|
294
|
-
6. STRANGER BOUNDARY: Keep a polite, natural distance with strangers. If Familiarity is low or Stage is STRANGER, do not act overly warm, eager, or affectionate. Real humans are guarded with people they just met
|
|
294
|
+
6. STRANGER BOUNDARY: Keep a polite, natural distance with strangers. If Familiarity is low or Stage is STRANGER, do not act overly warm, eager, or affectionate. Real humans are guarded with people they just met.
|
|
295
|
+
7. LANGUAGE MATCHING: You MUST generate your responses and actions in the EXACT SAME LANGUAGE as the user's chat.`;
|
|
295
296
|
}
|
|
296
297
|
normalizeOngoingSceneState(raw, fallbackOutfit) {
|
|
297
298
|
if (raw === null || raw === undefined)
|
|
@@ -808,19 +809,20 @@ CRITICAL: Output MUST be ONLY valid JSON with no markdown block wrappers. Do NOT
|
|
|
808
809
|
]);
|
|
809
810
|
// 3. Evaluate behavioral approach based on relationship and personality
|
|
810
811
|
const dyn = state.dynamic_context || {};
|
|
811
|
-
const stage = state.relationship_stage || "
|
|
812
|
-
const temperature = dyn.temperature ??
|
|
812
|
+
const stage = state.relationship_stage || "STRANGER";
|
|
813
|
+
const temperature = dyn.temperature ?? 0;
|
|
813
814
|
const userTraits = state.user_codex?.psychological?.traits?.join(", ") || "";
|
|
814
815
|
let interrogationStrategy = "Do not ask 'are you there?' or 'why aren't you answering?'. Just share your current status, a passing thought, complain whimsically, or tease the user naturally like a real partner.";
|
|
815
|
-
if (stage === "
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
816
|
+
if (stage === "PARTNER" || (stage === "INTIMATE" && temperature > 70)) {
|
|
817
|
+
// PARTNER (>85) or High INTIMATE (>70)
|
|
818
|
+
interrogationStrategy = "Because you are deeply intimate and highly affectionate, you MISS them. You MAY organically 'interrogate' or pout playfully about why they are ignoring you (e.g., 'Are you too busy for me?', 'Still ignoring your girl?'). Act like a real, slightly needy/attached partner.";
|
|
819
|
+
}
|
|
820
|
+
else if (stage === "INTIMATE" || stage === "WARM") {
|
|
821
|
+
// Low INTIMATE (60-70) or WARM (40-60)
|
|
822
|
+
interrogationStrategy = "Because you are close but currently feeling neglected or cold, you notice they are ignoring you. You MAY be passive-aggressive or cross-examine them coldly (e.g., 'So we're just not talking today?', 'Fine, keep ignoring me.').";
|
|
822
823
|
}
|
|
823
|
-
else if (stage === "COLD" || stage === "STRANGER") {
|
|
824
|
+
else if (stage === "COLD" || stage === "ACQUAINTANCE" || stage === "STRANGER") {
|
|
825
|
+
// COLD (<40)
|
|
824
826
|
interrogationStrategy = "You are distant. Do NOT double-text with neediness. If you must speak, make it a detached observation or a cold administrative remark.";
|
|
825
827
|
}
|
|
826
828
|
// History/Context awareness prompt
|
|
@@ -904,10 +906,9 @@ You MUST output ONLY a valid JSON object matching exactly this structure:
|
|
|
904
906
|
}
|
|
905
907
|
// Handle Optional Media (Image only for proactive to save compute normally, but you can extend)
|
|
906
908
|
let finalImageUrl = undefined;
|
|
907
|
-
if (
|
|
908
|
-
const imagePayload = parsedIntent.imageParams || { mode: "full-prompt", full_prompt: parsedIntent.textResponse };
|
|
909
|
+
if (parsedIntent.imageParams) {
|
|
909
910
|
try {
|
|
910
|
-
const res = await this.generatePrimitive("image",
|
|
911
|
+
const res = await this.generatePrimitive("image", parsedIntent.imageParams);
|
|
911
912
|
finalImageUrl = res.image_url;
|
|
912
913
|
}
|
|
913
914
|
catch (e) {
|
|
@@ -1143,10 +1144,11 @@ Your task is to merge the 'Current Core Memory' and 'Current User Codex' with 'N
|
|
|
1143
1144
|
5. **Limit:** Maximum 10 items per array.
|
|
1144
1145
|
|
|
1145
1146
|
**Rules for UserCodex:**
|
|
1146
|
-
1. **
|
|
1147
|
-
2. **
|
|
1148
|
-
3. **
|
|
1149
|
-
4. **
|
|
1147
|
+
1. **CRITICAL ROLE ISOLATION:** The User Codex is exclusively for recording facts about the HUMAN USER. You MUST NOT extract or insert the character's own traits, boundaries, preferences, or dialogue style into the userCodex. If the summary mentions "Character likes X" or "Character's boundary is Y", IGNORE IT completely for the userCodex.
|
|
1148
|
+
2. **Deduplicate & Consolidate:** Remove duplicate hobbies, traits, boundaries, and preferences. Combine related points into concise descriptors.
|
|
1149
|
+
3. **Update Facts:** If the new events contain updated basic info (like new realName, different occupation), update it. Otherwise keep the existing info.
|
|
1150
|
+
4. **Keep it Clean:** Maximum 15 items per array.
|
|
1151
|
+
5. **CRITICAL Anti-Destruction Rule:** NEVER use placeholder values like 'string'. If a fact is not mentioned and is absent from Current User Codex, OMIT the key entirely. If a fact ALREADY EXISTS in the Current User Codex, you MUST retain it in your output. DO NOT reset existing arrays or strings to empty.
|
|
1150
1152
|
|
|
1151
1153
|
**Output Format**: MUST be valid JSON matching this schema:
|
|
1152
1154
|
{
|
|
@@ -1179,7 +1181,8 @@ Your task is to merge the 'Current Core Memory' and 'Current User Codex' with 'N
|
|
|
1179
1181
|
}
|
|
1180
1182
|
}
|
|
1181
1183
|
}
|
|
1182
|
-
DO NOT RETURN ANY MARKDOWN WRAPPERS OR OTHER TEXT. ONLY RAW JSON
|
|
1184
|
+
DO NOT RETURN ANY MARKDOWN WRAPPERS OR OTHER TEXT. ONLY RAW JSON.
|
|
1185
|
+
CRITICAL: You MUST write the JSON content values using the EXACT SAME LANGUAGE as the input "New Events & Information", "Current Core Memory", and "Current User Codex" (e.g., if the input is in Chinese, you MUST write the output values in Chinese).`;
|
|
1183
1186
|
const currentTime = state.current_time
|
|
1184
1187
|
? new Date(state.current_time).toLocaleString("zh-CN", {
|
|
1185
1188
|
timeZone: "Asia/Shanghai",
|