chore: bootstrap hermes-ui skeleton from 0.6.29 snapshot
Build / build (push) Canceled after 0s
NPM Lockfile Check / npm ci --ignore-scripts (push) Canceled after 0s
Playwright / e2e (push) Canceled after 0s

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.
This commit is contained in:
2026-10-16 10:34:35 +08:00
commit 1e9ea89d86
912 changed files with 287328 additions and 0 deletions
@@ -0,0 +1,52 @@
// @vitest-environment jsdom
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
const mockHasApiKey = vi.hoisted(() => vi.fn())
const mockIsStoredSuperAdmin = vi.hoisted(() => vi.fn())
vi.mock('@/api/client', () => ({
hasApiKey: mockHasApiKey,
isStoredSuperAdmin: mockIsStoredSuperAdmin,
}))
async function loadRouter() {
vi.resetModules()
return (await import('@/router')).default
}
describe('router login redirect', () => {
beforeEach(() => {
mockHasApiKey.mockReturnValue(false)
mockIsStoredSuperAdmin.mockReturnValue(true)
if (!document.queryCommandSupported) {
document.queryCommandSupported = vi.fn(() => false)
}
delete (window as any).hermesDesktop
window.location.hash = ''
})
afterEach(() => {
delete (window as any).hermesDesktop
})
it('keeps the web login redirect when a token exists', async () => {
mockHasApiKey.mockReturnValue(true)
const router = await loadRouter()
await router.push('/')
await router.isReady()
expect(router.currentRoute.value.name).toBe('hermes.chat')
}, 60_000)
it('does not redirect desktop login when a stale token exists', async () => {
mockHasApiKey.mockReturnValue(true)
;(window as any).hermesDesktop = { isDesktop: true }
const router = await loadRouter()
await router.push('/')
await router.isReady()
expect(router.currentRoute.value.name).toBe('login')
})
})