remove the desktop-pet system
Build / build (push) Canceled after 0s
Playwright / e2e (push) Canceled after 0s

The pet feature was three loosely coupled subsystems that no core flow
depended on: the Petdex catalog page, the pet install/preference store, and
the pet-state socket. All three are removed.

The only cross-boundary touch point was a try/catch-wrapped observer that
mapped chat-run events to pet animations. Removing it leaves the /chat-run
event contract unchanged: no event name, field name, field type, or emission
timing changed.

Removing petdexPublicRoutes also closes the unauthenticated outbound proxy
at /api/hermes/petdex/asset, which shrinks the SSRF surface.
This commit is contained in:
2026-10-20 13:24:17 +08:00
committed by trae-solo-agent
parent 5e1003ceb7
commit b709ec6742
30 changed files with 64 additions and 1793 deletions
-58
View File
@@ -1,58 +0,0 @@
// @vitest-environment jsdom
import { beforeEach, describe, expect, it, vi } from 'vitest'
import { createPinia, setActivePinia } from 'pinia'
import type { ActivePet } from '@/api/hermes/pets'
const mockPetsApi = vi.hoisted(() => ({
fetchActivePet: vi.fn(),
adoptPet: vi.fn(),
updateActivePetPreferences: vi.fn(),
}))
vi.mock('@/api/hermes/pets', () => mockPetsApi)
import { usePetsStore } from '@/stores/hermes/pets'
function activePet(overrides: Partial<ActivePet> = {}): ActivePet {
return {
enabled: true,
slug: 'desk-cat',
displayName: 'Desk Cat',
kind: 'cat',
submittedBy: 'petdex',
source: 'petdex',
mime: 'image/webp',
spritesheetDataUrl: 'data:image/webp;base64,AA==',
spritesheetRevision: 1,
frameW: 192,
frameH: 208,
framesPerState: 6,
loopMs: 1100,
scale: 0.33,
position: { x: 10, y: 20 },
stateRows: ['idle'],
installedAt: 1,
updatedAt: 1,
...overrides,
}
}
describe('Pets Store', () => {
beforeEach(() => {
setActivePinia(createPinia())
vi.clearAllMocks()
})
it('disables and clears the active pet when hiding it', async () => {
const store = usePetsStore()
store.activePet = activePet()
mockPetsApi.updateActivePetPreferences.mockResolvedValue(null)
await store.hideActivePet()
expect(mockPetsApi.updateActivePetPreferences).toHaveBeenCalledWith({ enabled: false })
expect(store.activePet).toBeNull()
expect(store.hasActivePet).toBe(false)
expect(store.saving).toBe(false)
})
})