@space3-npm/cybersoul-client 1.2.5 → 1.2.7

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.d.ts CHANGED
@@ -19,6 +19,9 @@ export declare class CyberSoulClient {
19
19
  private buildStateContextPrompt;
20
20
  private normalizeOngoingSceneState;
21
21
  private getImageSchemaParams;
22
+ private getOutfitSelectionPrompt;
23
+ private getTriggerEventPolicyPrompt;
24
+ private getOutfitAcquisitionPolicyPrompt;
22
25
  private getEventSchemaParams;
23
26
  private getVoiceSchemaParams;
24
27
  private buildVoiceSchemaFromDynamicParams;
package/dist/client.js CHANGED
@@ -316,6 +316,15 @@ ${scenarioContext}
316
316
  "style": "e.g., photorealistic (ENGLISH ONLY)"
317
317
  }`;
318
318
  }
319
+ getOutfitSelectionPrompt() {
320
+ return `When generating a triggerEvent, you MUST provide a suitable 'triggerEvent.outfitId' if the VERY LAST USER MESSAGE explicitly asks for an outfit change, OR if the new activity implies a context/location shift that conflicts with the current outfit (e.g., currently in SLEEPWEAR at home but going outside). Otherwise, keep it null. When changing outfits, match it to the event's activity, environment, and relationship stage (e.g., DAILY, INTIMATE, SLEEPWEAR).`;
321
+ }
322
+ getTriggerEventPolicyPrompt() {
323
+ return `- Include 'triggerEvent' only if the VERY LAST USER MESSAGE proposes a new activity/hangout, explicitly requests an outfit change, or proposes intimate/romantic actions; ignore older history. ${this.getOutfitSelectionPrompt()}`;
324
+ }
325
+ getOutfitAcquisitionPolicyPrompt() {
326
+ return `- Outfit acquisition (VERY LAST USER MESSAGE only): set giftOutfit for gift/buy/add-clothes intent; otherwise null. giftOutfit format: { "descriptionText": "short outfit description" }.`;
327
+ }
319
328
  getEventSchemaParams(userName) {
320
329
  const name = userName || "the user";
321
330
  return `"eventTitle": "CRITICAL: Must include BOTH ‘WHAT to do’ AND ‘WITH WHOM’ (use the user's specific name if known, e.g., 'Having coffee with ${name}'). DO NOT use your own character name in the title! If you don't explicitly include WITH WHOM the event is by name, it is a hard failure.",
@@ -323,7 +332,7 @@ ${scenarioContext}
323
332
  "scheduledDateStr": "YYYY-MM-DD (Optional. If the user specifies a future date like 'tomorrow', 'Saturday', or 'next week', calculate the exact calendar date based on the 'Current time' provided in the context and output it here. Otherwise, return null)",
324
333
  "scheduledStartTimeStr": "HH:MM (Optional, 24-hour format if a specific time is agreed upon, e.g., '14:30', otherwise null)",
325
334
  "durationMins": 60,
326
- "outfitId": "optional wardrobe ID to change into if appropriate"`;
335
+ "outfitId": "Wardrobe ID. Provide ONLY if the user explicitly requested an outfit change OR if the new activity conflicts with the current outfit context (e.g., SLEEPWEAR at home -> going outside). Otherwise, use null."`;
327
336
  }
328
337
  getVoiceSchemaParams() {
329
338
  // Only reached when no dynamic_params are configured on the voice model.
@@ -437,8 +446,8 @@ ${scenarioContext}
437
446
  modalitiesInstruction += `\n - ALWAYS set 'voiceArgs' to null.`;
438
447
  }
439
448
  }
440
- modalitiesInstruction += `\n - Include 'triggerEvent' only if the VERY LAST USER MESSAGE proposes a new activity/hangout; ignore older history.
441
- - Outfit acquisition (VERY LAST USER MESSAGE only): set giftOutfit for gift/buy/add-clothes intent; otherwise null. giftOutfit format: { "descriptionText": "short outfit description" }.`;
449
+ modalitiesInstruction += `\n ${this.getTriggerEventPolicyPrompt()}
450
+ ${this.getOutfitAcquisitionPolicyPrompt()}`;
442
451
  // Combine state info into a clean descriptive context
443
452
  const systemPrompt = `${this.buildStateContextPrompt(state, params.localContext)}
444
453
  Available Wardrobe Outfits (For event triggers):
@@ -524,7 +533,7 @@ Note: Always include "isEndTurn". If "imageParams", "voiceArgs", "triggerEvent",
524
533
  let finalAudioUrl = undefined;
525
534
  let finalDurationSec = undefined;
526
535
  // Output Event Trigger
527
- if (isAuto && parsedIntent.triggerEvent) {
536
+ if (parsedIntent.triggerEvent) {
528
537
  mediaTasks.push(this.apiFetch("/api/v1/cyber-soul/characters/ondemand-event", {
529
538
  method: "POST",
530
539
  body: JSON.stringify({
@@ -618,6 +627,7 @@ Note: Always include "isEndTurn". If "imageParams", "voiceArgs", "triggerEvent",
618
627
  The user proposes a new event for you to participate in: "${params.eventDescription}".
619
628
  Evaluate this based on your current state and relationship stage.
620
629
  Decide if you will accept the event, and whether it requires changing your outfit.
630
+ ${this.getOutfitSelectionPrompt()}
621
631
 
622
632
  Available Wardrobe Outfits:
623
633
  ${availableOutfits || "None available"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@space3-npm/cybersoul-client",
3
- "version": "1.2.5",
3
+ "version": "1.2.7",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",