Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix(mood-boards): keep board style helpers internal

[._.]/ Adam Eivyb58489246330
diff --git a/server/services/moodBoard/logic.js b/server/services/moodBoard/logic.js
index 1841c93baa..22c2274e4d 100644
--- a/server/services/moodBoard/logic.js
+++ b/server/services/moodBoard/logic.js
@@ -151,7 +151,7 @@ export function boardItemLocalImage(item) {
// Stored shape of the board's composite style prompt. Absent optionals become
// explicit nulls; `composedAt` is stamped when the writer didn't send one.
// `null` clears the style (the poster render has nothing to pin to).
-export function normalizeBoardStyle(style, now = nowIso()) {
+function normalizeBoardStyle(style, now = nowIso()) {
if (!style) return null;
return {
prompt: style.prompt,
diff --git a/server/services/moodBoard/logic.test.js b/server/services/moodBoard/logic.test.js
index 5526bad937..d707c07c5c 100644
--- a/server/services/moodBoard/logic.test.js
+++ b/server/services/moodBoard/logic.test.js
@@ -9,7 +9,6 @@ import {
buildBoardRecord,
applyBoardPatch,
applyBoardRestore,
- normalizeBoardStyle,
addItem,
updateItem,
removeItem,
@@ -70,7 +69,19 @@ describe('applyBoardPatch', () => {
expect(cleared.posterImageRef).toBeNull();
});
it('leaves style and poster in place when the patch omits them', () => {
- const styled = { ...base, style: normalizeBoardStyle({ prompt: 'keep' }, 't1'), posterImageRef: 'poster.png' };
+ const styled = {
+ ...base,
+ style: {
+ prompt: 'keep',
+ negativePrompt: null,
+ rationale: null,
+ analyzedItemCount: 0,
+ providerId: null,
+ model: null,
+ composedAt: 't1',
+ },
+ posterImageRef: 'poster.png',
+ };
const next = applyBoardPatch(styled, { name: 'B' });
expect(next.style.prompt).toBe('keep');
expect(next.posterImageRef).toBe('poster.png');
diff --git a/server/services/moodBoardCompositeStyle.js b/server/services/moodBoardCompositeStyle.js
index c8151c12fd..34438d48ca 100644
--- a/server/services/moodBoardCompositeStyle.js
+++ b/server/services/moodBoardCompositeStyle.js
@@ -39,7 +39,7 @@ const contentPrompt = (text) => trimTo(text, PROMPT_MAX)
.replace(/^(?:please\s+)?(?:create|generate|render|make)\s+(?:(?:an?|the)\s+(?:image|picture|poster)\s+(?:of|showing|depicting)\s+)?/i, '')
.trim();
-export function buildCompositeStylePrompt({ context, analyzedItemCount }) {
+function buildCompositeStylePrompt({ context, analyzedItemCount }) {
const payload = JSON.stringify({ board: context, analyzedItemCount });
return `You are a senior prompt engineer. Compose ONE ready-to-render still-image prompt that captures the shared visual style of a mood board.
diff --git a/server/services/moodBoardCompositeStyle.test.js b/server/services/moodBoardCompositeStyle.test.js
index 18796a8041..9c7e3c00c1 100644
--- a/server/services/moodBoardCompositeStyle.test.js
+++ b/server/services/moodBoardCompositeStyle.test.js
@@ -11,7 +11,7 @@ vi.mock('./promptRunner.js', async (importActual) => {
const aiProvider = await import('./aiProvider.js');
const promptRunner = await import('./promptRunner.js');
-const { buildCompositeStylePrompt, composeBoardPrompt } = await import('./moodBoardCompositeStyle.js');
+const { composeBoardPrompt } = await import('./moodBoardCompositeStyle.js');
const apiProvider = { id: 'ollama', type: 'api', defaultModel: 'qwen' };
const composedText = JSON.stringify({
@@ -53,8 +53,8 @@ describe('composeBoardPrompt', () => {
});
const sent = promptRunner.runPromptThroughProvider.mock.calls[0][0].prompt;
expect(sent).toContain('granular ink wash');
+ expect(sent).toContain('analyzedPrompt');
expect(sent).toContain('Dusty painted sci-fi.');
- expect(buildCompositeStylePrompt({ context: { items: [] }, analyzedItemCount: 1 })).toContain('analyzedPrompt');
expect(style.prompt.startsWith('a weathered foundry')).toBe(true);
expect(style.negativePrompt).toBe('gloss, neon, plastic');
expect(style.analyzedItemCount).toBe(1);