Import the client, server, skills, tests, and build scripts as the starting point for the rebuild, then trim the surfaces this project does not ship: Electron desktop packaging, the marketing website, and the ESP32 firmware tree. CI keeps the web build, e2e, lockfile, release, and Docker workflows. Rename the package and CLI entry points to hermes-ui, drop the prepare hook so npm ci no longer triggers a build, and drop the removed tsconfig and nodemon references. Rewrite AGENTS.md, ARCHITECTURE.md, DEVELOPMENT.md, and the READMEs so the documented package map and hard rules match this repository. reference_code/ is ignored: it is a read-only snapshot, not an input to the build.
36 lines
1.1 KiB
TypeScript
36 lines
1.1 KiB
TypeScript
import { stat } from 'fs/promises'
|
|
import { describe, expect, it } from 'vitest'
|
|
|
|
import {
|
|
MCU_PROMPTS,
|
|
MCU_TTS_SAMPLE_RATE,
|
|
isValidMcuAudioFileName,
|
|
mcuPromptFileName,
|
|
mcuPromptText,
|
|
mcuPromptUrl,
|
|
resolveMcuAudioPath,
|
|
type McuPromptId,
|
|
} from '../../packages/server/src/services/hermes/mcu-prompts'
|
|
|
|
describe('mcu prompts', () => {
|
|
it('serves bundled 24k prompt assets through local MCU audio URLs', async () => {
|
|
expect(MCU_TTS_SAMPLE_RATE).toBe(24000)
|
|
|
|
for (const id of Object.keys(MCU_PROMPTS) as McuPromptId[]) {
|
|
const fileName = mcuPromptFileName(id)
|
|
expect(fileName).toMatch(/-24k\.s16le\.pcm$/)
|
|
expect(mcuPromptUrl(id)).toBe(`/api/hermes/mcu/audio/${fileName}`)
|
|
expect(mcuPromptText(id)).toBeTruthy()
|
|
expect(isValidMcuAudioFileName(fileName)).toBe(true)
|
|
|
|
const resolved = await resolveMcuAudioPath(fileName)
|
|
expect(resolved?.bundled).toBe(true)
|
|
expect(resolved?.path).toContain('mcu-prompts')
|
|
|
|
const info = await stat(resolved!.path)
|
|
expect(info.size).toBeGreaterThan(0)
|
|
expect(info.size % 2).toBe(0)
|
|
}
|
|
})
|
|
})
|