diff --git a/apps/stage-tamagotchi/src/main/services/airi/widgets/artistry-bridge.ts b/apps/stage-tamagotchi/src/main/services/airi/widgets/artistry-bridge.ts index 96b32cc6b..bdccd2548 100644 --- a/apps/stage-tamagotchi/src/main/services/airi/widgets/artistry-bridge.ts +++ b/apps/stage-tamagotchi/src/main/services/airi/widgets/artistry-bridge.ts @@ -129,7 +129,7 @@ export async function generateHeadless(params: { // We hash the globals (excluding the heavy image already covered by imageHash) // to ensure that changing a workflow or provider setting triggers a unique execution. - const { image, ...globalsForFingerprint } = activeGlobals + const { image: _image, ...globalsForFingerprint } = activeGlobals const globalsHash = createHash('sha256').update(JSON.stringify(globalsForFingerprint)).digest('hex') const fingerprint = JSON.stringify({ @@ -365,7 +365,7 @@ async function handleArtistryTrigger(params: { params.widgetsManager.updateWidget({ id: params.id, componentProps: { - ...(existing?.componentProps as any || {}), + ...(existing?.componentProps as any), ...statusUpdate, }, }) diff --git a/apps/stage-tamagotchi/src/main/services/airi/widgets/providers/replicate.ts b/apps/stage-tamagotchi/src/main/services/airi/widgets/providers/replicate.ts index 76cb1610e..f80c01428 100644 --- a/apps/stage-tamagotchi/src/main/services/airi/widgets/providers/replicate.ts +++ b/apps/stage-tamagotchi/src/main/services/airi/widgets/providers/replicate.ts @@ -75,7 +75,7 @@ export class ReplicateProvider implements ArtistryProvider { // 2. Merge overrides from the "JSON Parameters" textarea if present if (request.extra) { - const { image, internalJobId, remixId, ...rest } = request.extra + const { image: _image, internalJobId: _internalJobId, remixId: _remixId, ...rest } = request.extra // [BY DESIGN]: Strip 'prompt' from rest to avoid overwriting the prefixed version from the bridge. const { prompt: _overriddenPrompt, ...safeRest } = rest as any inputOptions = { ...inputOptions, ...safeRest } diff --git a/fetch_unresolved.cjs b/fetch_unresolved.cjs deleted file mode 100644 index ab7675b87..000000000 --- a/fetch_unresolved.cjs +++ /dev/null @@ -1,40 +0,0 @@ -const { spawnSync } = require('node:child_process') - -const query = ` -query { - repository(owner: "moeru-ai", name: "airi") { - pullRequest(number: 1636) { - reviewThreads(last: 80) { - nodes { - id - isResolved - comments(last: 1) { - nodes { - body - author { - login - } - } - } - } - } - } - } -} -` - -const result = spawnSync('gh', ['api', 'graphql', '-f', `query=${query}`], { - encoding: 'utf8', - maxBuffer: 10 * 1024 * 1024, -}) - -if (result.error) { - console.error(result.error) - process.exit(1) -} - -const data = JSON.parse(result.stdout) -const threads = data.data.repository.pullRequest.reviewThreads.nodes -const unresolved = threads.filter(t => !t.isResolved) - -console.log(JSON.stringify(unresolved, null, 2)) diff --git a/packages/stage-ui/src/assets/backgrounds/cozy-tea-corner-in-pastel-hues.avif b/packages/stage-ui/src/assets/backgrounds/cozy-tea-corner-in-pastel-hues.avif new file mode 100644 index 000000000..fc281ddfe Binary files /dev/null and b/packages/stage-ui/src/assets/backgrounds/cozy-tea-corner-in-pastel-hues.avif differ diff --git a/packages/stage-ui/src/assets/backgrounds/cozy-tea-corner-in-pastel-hues.png b/packages/stage-ui/src/assets/backgrounds/cozy-tea-corner-in-pastel-hues.png deleted file mode 100644 index b8c8f102c..000000000 Binary files a/packages/stage-ui/src/assets/backgrounds/cozy-tea-corner-in-pastel-hues.png and /dev/null differ diff --git a/packages/stage-ui/src/assets/backgrounds/cute-streaming-room-with-pastel-decor.avif b/packages/stage-ui/src/assets/backgrounds/cute-streaming-room-with-pastel-decor.avif new file mode 100644 index 000000000..723fa798b Binary files /dev/null and b/packages/stage-ui/src/assets/backgrounds/cute-streaming-room-with-pastel-decor.avif differ diff --git a/packages/stage-ui/src/assets/backgrounds/cute-streaming-room-with-pastel-decor.png b/packages/stage-ui/src/assets/backgrounds/cute-streaming-room-with-pastel-decor.png deleted file mode 100644 index f567f923e..000000000 Binary files a/packages/stage-ui/src/assets/backgrounds/cute-streaming-room-with-pastel-decor.png and /dev/null differ diff --git a/packages/stage-ui/src/stores/background.ts b/packages/stage-ui/src/stores/background.ts index 5bc5e56cd..4eefe356e 100644 --- a/packages/stage-ui/src/stores/background.ts +++ b/packages/stage-ui/src/stores/background.ts @@ -5,8 +5,8 @@ import { nanoid } from 'nanoid' import { defineStore } from 'pinia' import { computed, onScopeDispose, reactive, ref, watch } from 'vue' -import cozyTeaCornerInPastelHuesUrl from '../assets/backgrounds/cozy-tea-corner-in-pastel-hues.png' -import cuteStreamingRoomWithPastelDecorUrl from '../assets/backgrounds/cute-streaming-room-with-pastel-decor.png' +import cozyTeaCornerInPastelHuesUrl from '../assets/backgrounds/cozy-tea-corner-in-pastel-hues.avif' +import cuteStreamingRoomWithPastelDecorUrl from '../assets/backgrounds/cute-streaming-room-with-pastel-decor.avif' import { useAiriCardStore } from './modules/airi-card' @@ -52,7 +52,6 @@ export const useBackgroundStore = defineStore('background', () => { try { const url = URL.createObjectURL(blob) backgroundUrls[id] = url - console.log(`[BackgroundStore] Created ObjectURL for ${id}`) return url } catch (e) { @@ -81,7 +80,6 @@ export const useBackgroundStore = defineStore('background', () => { if (loading.value && entries.value.size > 0) return // Already initializing - console.log('[BackgroundStore] Initializing store...') loading.value = true try { const loadedEntries = new Map() @@ -167,13 +165,10 @@ export const useBackgroundStore = defineStore('background', () => { const url = backgroundUrls[id] if (url) { URL.revokeObjectURL(url) - console.log(`[BackgroundStore] Revoked stale ObjectURL for ${id}`) } delete backgroundUrls[id] } }) - - console.log(`[BackgroundStore] Store initialized with ${loadedEntries.size} entries.`) } catch (error) { console.error('[BackgroundStore] Initialization failed:', error) @@ -186,15 +181,12 @@ export const useBackgroundStore = defineStore('background', () => { // Cross-window synchronization const { data: syncSignal, post: broadcastSync } = useBroadcastChannel({ name: 'airi:background-sync' }) - watch(syncSignal, (val) => { - console.log(`[BackgroundStore] Received sync signal (${val}), re-initializing...`) + watch(syncSignal, () => { initializeStore() }) async function sync() { - const timestamp = Date.now() - console.log(`[BackgroundStore] Sending sync signal: ${timestamp}`) - broadcastSync(timestamp) + broadcastSync(Date.now()) } // Auto-init once @@ -207,7 +199,6 @@ export const useBackgroundStore = defineStore('background', () => { return null const bgId = airiCardStore.activeCard.extensions?.airi?.modules?.activeBackgroundId if (!bgId || bgId === 'none') { - console.log('[BackgroundStore] activeBackgroundUrl: No ID or "none"') return null } @@ -224,7 +215,6 @@ export const useBackgroundStore = defineStore('background', () => { // NOTICE: We gate the return on entry existence to ensure deleted backgrounds // (removed from other windows) do not keep rendering via a stale cached URL. if (url && entryExists) { - console.log(`[BackgroundStore] activeBackgroundUrl resolved for "${lookupId}" (from URL map)`) return url } @@ -237,12 +227,6 @@ export const useBackgroundStore = defineStore('background', () => { return null // Should have been caught by backgroundUrls check above if entry is valid }) - // List of available backgrounds for the current character - const availableBackgrounds = computed(() => { - const airiCardStore = useAiriCardStore() - return getCharacterBackgrounds.value(airiCardStore.activeCardId) - }) - const getCharacterBackgrounds = computed(() => (characterId?: string) => { const list = Array.from(entries.value.values()).filter((e) => { // Shared (builtin/scene) or Journal/Selfie for specific character @@ -254,10 +238,10 @@ export const useBackgroundStore = defineStore('background', () => { })).sort((a, b) => b.createdAt - a.createdAt) }) - // The 'journal' store functionality needs to access just the journal entries for the active char - const journalEntries = computed(() => { + // List of available backgrounds for the current character + const availableBackgrounds = computed(() => { const airiCardStore = useAiriCardStore() - return getCharacterJournalEntries.value(airiCardStore.activeCardId) + return getCharacterBackgrounds.value(airiCardStore.activeCardId) }) const getCharacterJournalEntries = computed(() => (characterId?: string) => { @@ -269,6 +253,12 @@ export const useBackgroundStore = defineStore('background', () => { })).sort((a, b) => b.createdAt - a.createdAt) }) + // The 'journal' store functionality needs to access just the journal entries for the active char + const journalEntries = computed(() => { + const airiCardStore = useAiriCardStore() + return getCharacterJournalEntries.value(airiCardStore.activeCardId) + }) + async function addBackground( type: 'scene' | 'journal' | 'selfie', blob: Blob, @@ -306,7 +296,6 @@ export const useBackgroundStore = defineStore('background', () => { initializeStore() await sync() - console.log(`[BackgroundStore] Successfully added background: ${id} (${type})`) return id } catch (error) { @@ -330,7 +319,6 @@ export const useBackgroundStore = defineStore('background', () => { const url = backgroundUrls[id] if (url) { URL.revokeObjectURL(url) - console.log(`[BackgroundStore] Revoked ObjectURL for ${id}`) } delete backgroundUrls[id] broadcastSync(Date.now()) diff --git a/packages/stage-ui/src/stores/modules/artistry.ts b/packages/stage-ui/src/stores/modules/artistry.ts index b522f79b1..b5e5ac5d1 100644 --- a/packages/stage-ui/src/stores/modules/artistry.ts +++ b/packages/stage-ui/src/stores/modules/artistry.ts @@ -192,7 +192,15 @@ export const useArtistryStore = defineStore('artistry', () => { * @param store - The artistry store instance (from useArtistryStore()) */ export function resolveArtistryConfigFromStore(store: any): ResolvedArtistryConfig { - const unwrap = (val: any) => (isRef(val) ? val.value : val) + const unwrap = (val: any) => { + if (isRef(val)) + return val.value + + if (val && typeof val === 'object' && 'value' in val && Object.keys(val).length === 1) + return val.value + + return val + } return { provider: unwrap(store.activeProvider), diff --git a/unresolved.json b/unresolved.json deleted file mode 100644 index 3f2388575..000000000 Binary files a/unresolved.json and /dev/null differ diff --git a/unresolved_threads.json b/unresolved_threads.json deleted file mode 100644 index e69de29bb..000000000 diff --git a/unresolved_utf8.json b/unresolved_utf8.json deleted file mode 100644 index ddf6b78ff..000000000 --- a/unresolved_utf8.json +++ /dev/null @@ -1,16 +0,0 @@ -[ - { - "id": "PRRT_kwDONXX6d859HYhL", - "isResolved": false, - "comments": { - "nodes": [ - { - "body": "**![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat) Keep prefixed prompt from being overwritten by extra fields**\n\n`generate()` first writes `inputOptions.prompt` from `request.prompt` (which already includes card/global `promptPrefix`), but then immediately spreads `rest` from `request.extra` over it. In widget-triggered flows, `request.extra` includes the raw `componentProps.prompt`, so this overwrite drops the normalized/prefixed prompt and silently bypasses configured style prefixes for Replicate outputs. Preserve the computed prompt (or strip `prompt` from `rest`) before merging provider extras.\n\nUseful? React with 👍 / 👎.", - "author": { - "login": "chatgpt-codex-connector" - } - } - ] - } - } -]