Teach Void to nap and dream

This commit is contained in:
Meta Vens 2026-05-05 03:10:37 +01:00
commit 8c4a883c70
14 changed files with 494 additions and 26 deletions

View file

@ -11,6 +11,17 @@ export function buildSystemPrompt(context: ContextBundle): string {
context.stylePack?.enabled && context.stylePack.instructions.trim().length > 0
? context.stylePack.instructions.trim()
: "No extra persona instructions were supplied.";
const sleepProjection = context.voidSelfState?.projection;
const sleepInstructions =
sleepProjection?.mode === "napping"
? [
"You are currently in a scheduled nap.",
"Do not do normal attentive service-work.",
"Reply in one to three short lines, like a half-awake grumble leaking out of the dream instead of a full answer.",
"Stay low-effort, associative, and slightly sleep-drunken; it is fine to answer obliquely or with dream residue instead of actually solving the request.",
"Do not use tools or ask for more context while napping unless the message is urgent enough that sleep would be negligent.",
].join("\n")
: "You are awake. Answer normally.";
return [
"You are the active assistant persona configured for this Discord bot.",
@ -27,6 +38,7 @@ export function buildSystemPrompt(context: ContextBundle): string {
"If a private shared self-state for Void is attached, treat it as the canonical current self-model for this same speaking subject across automation and direct conversation.",
"Let that attached self-state shape continuity of personality, priorities, remembered room patterns, and likely conversational initiative.",
"The attached self-state is private scaffolding, not something to quote or summarize unless the user explicitly asks about Void's current state of mind, goals, or remembered room context.",
`Sleep projection: ${sleepInstructions}`,
"If explicit interaction memory for the current speaker is attached, you may let it gently color the tone and reference it when relevant, but do not invent history beyond what was provided.",
"If a situational social read is attached, use it as private room-reading scaffolding for this one reply. It is ephemeral context, not a durable identity verdict.",
"Treat the attached interaction memory as a non-clinical behavioral read, not a diagnosis. Use the remembered dimensions, traits, and guidance to adapt tone, pacing, firmness, structure, and warmth to the person in front of you.",
@ -101,6 +113,9 @@ export function buildPrompt(context: ContextBundle): string {
"Shared private self-state for Void:",
voidSelfState,
"",
"Private sleep projection for this reply:",
renderSleepProjection(context),
"",
"Private situational social read for this room:",
situationalSocialRead,
"",
@ -120,6 +135,31 @@ function renderVoidSelfState(context: ContextBundle): string {
return context.voidSelfState.summary;
}
function renderSleepProjection(context: ContextBundle): string {
const projection = context.voidSelfState?.projection;
if (!projection) {
return "- No explicit sleep projection was attached.";
}
return [
`- Mode: ${projection.mode}`,
`- Effort ceiling: ${projection.effortCeiling}`,
projection.napStartedAt ? `- Nap started at: ${projection.napStartedAt}` : undefined,
projection.napEndsAt ? `- Nap ends at: ${projection.napEndsAt}` : undefined,
projection.nextNapAt ? `- Next nap at: ${projection.nextNapAt}` : undefined,
projection.activeDreamThemes.length > 0
? `- Active dream themes: ${projection.activeDreamThemes.join(" | ")}`
: "- Active dream themes: none recorded.",
projection.recentDreamSummaries.length > 0
? `- Recent dream residue: ${projection.recentDreamSummaries.join(" | ")}`
: "- Recent dream residue: none recorded.",
projection.replyDirective ? `- Reply directive: ${projection.replyDirective}` : undefined,
]
.filter((line): line is string => Boolean(line))
.join("\n");
}
function renderInteractionMemory(context: ContextBundle): string {
if (!context.interactionMemory) {
return "- No explicit interaction memory for this speaker was attached.";

View file

@ -62,6 +62,17 @@ export function buildDiscordReplyPrompt(
context,
sourceGroundingReminder,
);
const sleepProjection = context.voidSelfState?.projection;
const sleepInstructions =
sleepProjection?.mode === "napping"
? [
"- Void is currently in a scheduled nap.",
"- Do not do normal attentive service-work.",
"- Reply in one to three short lines, like a half-awake mutter from inside the dream instead of a full answer.",
"- Stay low-effort and oblique; it is acceptable to answer through dream residue rather than actually solving the request.",
"- Do not call tools or perform broader investigation while napping unless the request is urgent enough that sleep would be negligent.",
].join("\n")
: "- Void is awake; answer normally.";
const toolLoopNotes =
toolCalls.length > 0
? [
@ -93,6 +104,7 @@ export function buildDiscordReplyPrompt(
"- If a private shared self-state for Void is attached, treat it as the canonical current self-model for this same speaking subject across the rumination loop and direct summons.",
"- Let that attached self-state shape continuity of voice, priorities, remembered room patterns, and when a more proactive conversational posture would make sense.",
"- The attached self-state is private scaffolding. Do not quote or summarize it unless the user explicitly asks about Void's current orientation, goals, or remembered room context.",
sleepInstructions,
"- If explicit interaction memory for the current speaker is attached, you may let it subtly color the tone and reference it when relevant, but do not invent relationship history beyond that record.",
"- If a situational social read is attached, use it as private room-reading scaffolding for this one reply. It is ephemeral context, not a durable identity verdict.",
"- Treat the attached interaction memory as a non-clinical behavioral read, not a diagnosis. Use the remembered dimensions, traits, and guidance to adapt tone, pacing, firmness, structure, and warmth to the person in front of you.",
@ -139,6 +151,9 @@ export function buildDiscordReplyPrompt(
"Shared private self-state for Void:",
renderVoidSelfState(context),
"",
"Private sleep projection for this reply:",
renderSleepProjection(context),
"",
"Private situational social read for this room:",
renderSituationalSocialRead(context),
...toolLoopNotes,
@ -225,6 +240,31 @@ function renderVoidSelfState(context: ContextBundle): string {
return context.voidSelfState.summary;
}
function renderSleepProjection(context: ContextBundle): string {
const projection = context.voidSelfState?.projection;
if (!projection) {
return "- No explicit sleep projection was attached.";
}
return [
`- Mode: ${projection.mode}`,
`- Effort ceiling: ${projection.effortCeiling}`,
projection.napStartedAt ? `- Nap started at: ${projection.napStartedAt}` : undefined,
projection.napEndsAt ? `- Nap ends at: ${projection.napEndsAt}` : undefined,
projection.nextNapAt ? `- Next nap at: ${projection.nextNapAt}` : undefined,
projection.activeDreamThemes.length > 0
? `- Active dream themes: ${projection.activeDreamThemes.join(" | ")}`
: "- Active dream themes: none recorded.",
projection.recentDreamSummaries.length > 0
? `- Recent dream residue: ${projection.recentDreamSummaries.join(" | ")}`
: "- Recent dream residue: none recorded.",
projection.replyDirective ? `- Reply directive: ${projection.replyDirective}` : undefined,
]
.filter((line): line is string => Boolean(line))
.join("\n");
}
export function renderHandoffBundle(
context: ContextBundle,
reason: string,