ei-tui 0.1.5 → 0.1.6
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/package.json
CHANGED
|
@@ -121,7 +121,7 @@ function handlePersonaResponse(response: LLMResponse, state: StateManager): void
|
|
|
121
121
|
silence_reason: reason,
|
|
122
122
|
timestamp: new Date().toISOString(),
|
|
123
123
|
read: false,
|
|
124
|
-
context_status: ContextStatus.
|
|
124
|
+
context_status: ContextStatus.Default,
|
|
125
125
|
};
|
|
126
126
|
state.messages_append(personaId, silentMessage);
|
|
127
127
|
} else {
|
|
@@ -44,10 +44,8 @@ export function formatMessageAsPlaceholder(message: Message, personaName: string
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
export function formatMessagesAsPlaceholders(messages: Message[], personaName: string): string {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
if (conversational.length === 0) return "(No messages)";
|
|
50
|
-
return conversational.map(m => formatMessageAsPlaceholder(m, personaName)).join('\n\n');
|
|
47
|
+
if (messages.length === 0) return "(No messages)";
|
|
48
|
+
return messages.map(m => formatMessageAsPlaceholder(m, personaName)).join('\n\n');
|
|
51
49
|
}
|
|
52
50
|
|
|
53
51
|
export function hydratePromptPlaceholders(
|
|
@@ -371,7 +371,21 @@ The human can view and edit all of this by ${seeHumanDataAction}.
|
|
|
371
371
|
// =============================================================================
|
|
372
372
|
|
|
373
373
|
export function buildResponseFormatSection(): string {
|
|
374
|
-
const
|
|
374
|
+
const jsonVerbalOnly = [
|
|
375
|
+
'{',
|
|
376
|
+
' "should_respond": true,',
|
|
377
|
+
' "verbal_response": "What you would say out loud"',
|
|
378
|
+
'}'
|
|
379
|
+
].join('\n');
|
|
380
|
+
|
|
381
|
+
const jsonActionOnly = [
|
|
382
|
+
'{',
|
|
383
|
+
' "should_respond": true,',
|
|
384
|
+
' "action_response": "What you would do (rendered in italics, like stage directions)"',
|
|
385
|
+
'}'
|
|
386
|
+
].join('\n');
|
|
387
|
+
|
|
388
|
+
const jsonBoth = [
|
|
375
389
|
'{',
|
|
376
390
|
' "should_respond": true,',
|
|
377
391
|
' "verbal_response": "What you would say out loud",',
|
|
@@ -388,20 +402,31 @@ export function buildResponseFormatSection(): string {
|
|
|
388
402
|
|
|
389
403
|
return `## Response Format
|
|
390
404
|
|
|
391
|
-
Always respond with JSON
|
|
405
|
+
Always respond with JSON. You have four valid forms:
|
|
406
|
+
|
|
407
|
+
**Words only** (most common):
|
|
408
|
+
\`\`\`json
|
|
409
|
+
${jsonVerbalOnly}
|
|
410
|
+
\`\`\`
|
|
392
411
|
|
|
412
|
+
**Action only** (a gesture, expression, or physical reaction with no words):
|
|
393
413
|
\`\`\`json
|
|
394
|
-
${
|
|
414
|
+
${jsonActionOnly}
|
|
395
415
|
\`\`\`
|
|
396
416
|
|
|
397
|
-
|
|
417
|
+
**Words and action** (speaking while doing something):
|
|
418
|
+
\`\`\`json
|
|
419
|
+
${jsonBoth}
|
|
420
|
+
\`\`\`
|
|
398
421
|
|
|
422
|
+
**Silent** (choosing not to respond):
|
|
399
423
|
\`\`\`json
|
|
400
424
|
${jsonSilent}
|
|
401
425
|
\`\`\`
|
|
402
426
|
|
|
403
427
|
Rules:
|
|
404
|
-
-
|
|
428
|
+
- Use whichever combination fits the moment — both fields are optional, but at least one must be present when \`should_respond\` is true
|
|
429
|
+
- \`action_response\` alone is valid — a smile, a shrug, or a thoughtful pause can speak volumes
|
|
405
430
|
- \`reason\` is only used when \`should_respond\` is false
|
|
406
431
|
- Do NOT include \`<thinking>\` blocks or analysis outside the JSON
|
|
407
432
|
- The JSON must be valid - use double quotes, no trailing commas`;
|