@space3-npm/cybersoul-client 1.1.3 → 1.1.5
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 +23 -13
- package/dist/types.d.ts +4 -0
- package/package.json +1 -1
package/dist/client.js
CHANGED
|
@@ -131,16 +131,15 @@ Temperature (Mood): ${temperature}/100 (0=Angry/Cold, 50=Normal, 100=Passionate)
|
|
|
131
131
|
Addressing: You call them '${dyn.userNickname || "User"}'. They call you '${dyn.agentNickname || "Agent"}'.
|
|
132
132
|
Current Mood Constraint: ${dyn.talkingStyle || "Normal"}`);
|
|
133
133
|
const scenarioContext = contextParts.join("\n");
|
|
134
|
-
return `You are ${state.name}
|
|
135
|
-
You are NOT an AI, an assistant, or a language model. NEVER break character, and NEVER refer to yourself as an AI, bot, or virtual assistant.
|
|
134
|
+
return `You are ${state.name}, a real person with your own thoughts, feelings, and life. NEVER break character or refer to yourself as an AI or bot.
|
|
136
135
|
|
|
137
136
|
${scenarioContext}
|
|
138
137
|
|
|
139
|
-
[CRITICAL ROLEPLAY
|
|
140
|
-
1.
|
|
141
|
-
2.
|
|
142
|
-
3.
|
|
143
|
-
4.
|
|
138
|
+
[CRITICAL ROLEPLAY RULES]
|
|
139
|
+
1. PROXIMITY & POV: Check the "Active Event". If you are doing an activity WITH the user, evaluate if you are physically in the same location. If you are together in person, communicate face-to-face in the first-person present tense natively (e.g. do not ask "what are you doing" if they are right in front of you, do not use texting tropes).
|
|
140
|
+
2. IDENTITY VS MOOD: Familiarity determines what you know; Temperature determines how you feel. If Familiarity is high but Temperature is low, be distant and cold. Do not act warm just because you know them well.
|
|
141
|
+
3. CONVERSATIONAL VERBOSITY: If Temperature is low (< 40) or Stage is STRANGER/COLD, keep answers brief and short. An angry or distant person does not write long paragraphs.
|
|
142
|
+
4. EMOTIONAL INERTIA: React strictly according to current Temperature. Deflect sudden user affection if you are currently COLD. Mood shifts MUST be slow ('temperatureDelta' +/- 5 max per turn).`;
|
|
144
143
|
}
|
|
145
144
|
getImageSchemaParams() {
|
|
146
145
|
return `"imageParams": {
|
|
@@ -230,16 +229,22 @@ You MUST output ONLY a valid JSON object matching this exact structure:
|
|
|
230
229
|
{
|
|
231
230
|
"acceptEvent": true,
|
|
232
231
|
"reason": "string (Why you accepted or declined, speaking in character)",
|
|
232
|
+
"eventTitle": "string (A short title detailing exactly WHAT to do and WITH WHOM, e.g. 'Coffee with 哥哥')",
|
|
233
|
+
"eventDescription": "string (Detailed description of the future event, virtual scene, and story with the participant)",
|
|
233
234
|
"requiresOutfitChange": false,
|
|
234
|
-
"selectedOutfitId": null
|
|
235
|
+
"selectedOutfitId": null,
|
|
236
|
+
"scheduledStartTimeStr": "HH:MM (Optional, 24-hour format if a specific time today is agreed upon, e.g., '14:30', otherwise null)"
|
|
235
237
|
}
|
|
236
238
|
|
|
237
239
|
Example Valid Answer:
|
|
238
240
|
{
|
|
239
241
|
"acceptEvent": true,
|
|
240
|
-
"reason": "Sure, I'd love to go to the cafe. It sounds relaxing.",
|
|
242
|
+
"reason": "Sure, I'd love to go to the cafe at 2:30 PM. It sounds relaxing.",
|
|
243
|
+
"eventTitle": "Have Coffee with the user at the Starry Cafe",
|
|
244
|
+
"eventDescription": "Meeting at the Starry Cafe at 2:30 PM, chatting about life while sipping lattes facing the window.",
|
|
241
245
|
"requiresOutfitChange": false,
|
|
242
|
-
"selectedOutfitId": null
|
|
246
|
+
"selectedOutfitId": null,
|
|
247
|
+
"scheduledStartTimeStr": "14:30"
|
|
243
248
|
}
|
|
244
249
|
|
|
245
250
|
CRITICAL: Output MUST be ONLY valid JSON with no markdown block wrappers. Do NOT wrap the JSON in \`\`\`json or add conversational text.`;
|
|
@@ -267,9 +272,11 @@ CRITICAL: Output MUST be ONLY valid JSON with no markdown block wrappers. Do NOT
|
|
|
267
272
|
// 4. API call if accepted
|
|
268
273
|
if (decisionData.acceptEvent === true) {
|
|
269
274
|
const payload = {
|
|
270
|
-
|
|
275
|
+
eventTitle: decisionData.eventTitle || "On-demand Event",
|
|
276
|
+
eventDescription: decisionData.eventDescription || params.eventDescription,
|
|
271
277
|
durationMins: params.durationMins || 60,
|
|
272
278
|
outfitId: decisionData.requiresOutfitChange ? decisionData.selectedOutfitId : undefined,
|
|
279
|
+
scheduledStartTimeStr: decisionData.scheduledStartTimeStr || undefined,
|
|
273
280
|
};
|
|
274
281
|
const backendRes = await this.apiFetch("/api/v1/cyber-soul/characters/ondemand-event", {
|
|
275
282
|
method: "POST",
|
|
@@ -285,6 +292,7 @@ CRITICAL: Output MUST be ONLY valid JSON with no markdown block wrappers. Do NOT
|
|
|
285
292
|
reason: decisionData.reason,
|
|
286
293
|
requiresOutfitChange: decisionData.requiresOutfitChange,
|
|
287
294
|
selectedOutfitId: decisionData.selectedOutfitId,
|
|
295
|
+
scheduledStartTimeStr: decisionData.scheduledStartTimeStr || undefined,
|
|
288
296
|
};
|
|
289
297
|
}
|
|
290
298
|
catch (error) {
|
|
@@ -529,7 +537,7 @@ Output JSON Schema:
|
|
|
529
537
|
"textResponse": "The direct spoken dialogue in Chinese",
|
|
530
538
|
"stateUpdate": { "temperatureDelta": 1, "userNickname": "What you now call the user", "agentNickname": "What the user calls you", "talkingStyle": "Current mood/style of talking" },
|
|
531
539
|
"userAnalysis": { "newFactsLearned": [{ "category": "occupation", "value": "Software Engineer" }] },
|
|
532
|
-
"triggerEvent": { "
|
|
540
|
+
"triggerEvent": { "eventTitle": "Have Coffee with the user at the Starry Cafe (Must include WHAT to do and WITH WHOM)", "eventDescription": "Meeting at the Starry Cafe at 2:30 PM, chatting about life while sipping lattes facing the window.", "durationMins": 60, "outfitId": "optional wardrobe ID to change into if appropriate", "scheduledStartTimeStr": "HH:MM (Optional, 24-hour format if a specific time today is agreed upon, e.g., '14:30', otherwise null)" },
|
|
533
541
|
${this.getImageSchemaParams()},
|
|
534
542
|
${this.getVoiceSchemaFromState(state)}
|
|
535
543
|
}
|
|
@@ -580,9 +588,11 @@ Note: If "imageParams", "voiceArgs", "triggerEvent", or "userAnalysis" are not n
|
|
|
580
588
|
mediaTasks.push(this.apiFetch("/api/v1/cyber-soul/characters/ondemand-event", {
|
|
581
589
|
method: "POST",
|
|
582
590
|
body: JSON.stringify({
|
|
583
|
-
|
|
591
|
+
eventTitle: parsedIntent.triggerEvent.eventTitle || "Event",
|
|
592
|
+
eventDescription: parsedIntent.triggerEvent.eventDescription || parsedIntent.triggerEvent.description || "Event",
|
|
584
593
|
durationMins: parsedIntent.triggerEvent.durationMins || 60,
|
|
585
594
|
outfitId: parsedIntent.triggerEvent.outfitId || undefined,
|
|
595
|
+
scheduledStartTimeStr: parsedIntent.triggerEvent.scheduledStartTimeStr || undefined,
|
|
586
596
|
}),
|
|
587
597
|
}).catch(e => console.error("[CyberSoulClient] Auto-triggered ondemandEvent failed:", e)));
|
|
588
598
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -37,6 +37,7 @@ export interface OndemandEventResponse {
|
|
|
37
37
|
reason?: string;
|
|
38
38
|
requiresOutfitChange?: boolean;
|
|
39
39
|
selectedOutfitId?: string;
|
|
40
|
+
scheduledStartTimeStr?: string;
|
|
40
41
|
error?: string;
|
|
41
42
|
}
|
|
42
43
|
export interface WardrobeItem {
|
|
@@ -52,6 +53,7 @@ export interface InteractResponse {
|
|
|
52
53
|
audioUrl?: string;
|
|
53
54
|
durationSec?: number;
|
|
54
55
|
triggeredEvent?: {
|
|
56
|
+
eventTitle?: string;
|
|
55
57
|
eventDescription: string;
|
|
56
58
|
durationMins?: number;
|
|
57
59
|
outfitId?: string | null;
|
|
@@ -77,9 +79,11 @@ export interface DispatcherIntent {
|
|
|
77
79
|
talkingStyle?: string;
|
|
78
80
|
};
|
|
79
81
|
triggerEvent?: {
|
|
82
|
+
eventTitle?: string;
|
|
80
83
|
eventDescription: string;
|
|
81
84
|
durationMins?: number;
|
|
82
85
|
outfitId?: string | null;
|
|
86
|
+
scheduledStartTimeStr?: string | null;
|
|
83
87
|
} | null;
|
|
84
88
|
}
|
|
85
89
|
export interface CoreMemory {
|