发布 0.2.1 并完善工具边界与安全性

This commit is contained in:
mid
2026-08-10 14:49:43 +08:00
parent aca004c513
commit 32b7cc827c
47 changed files with 681 additions and 172 deletions
+24
View File
@@ -95,4 +95,28 @@ describe('deployment configuration', () => {
expect(agentGuide).toContain('git status --short --branch')
expect(completeReadme).toContain('## AI 接手清单')
})
it('keeps the management page under the reserved tools namespace', async () => {
const router = await readProjectFile('src/router.ts')
expect(router).toContain("path: '/tools/setting'")
expect(router).not.toContain("path: '/setting'")
})
it('uses the UTF-8 / Hex tool ID as the canonical default route', async () => {
const [router, catalogText, navigationText, registry] = await Promise.all([
readProjectFile('src/router.ts'),
readProjectFile('shared/tool-catalog.json'),
readProjectFile('shared/default-navigation.json'),
readProjectFile('src/tools/registry.ts'),
])
const catalog = JSON.parse(catalogText)
const navigation = JSON.parse(navigationText)
expect(catalog.tools.find(({ title }) => title === 'UTF-8 / Hex')?.id).toBe('utf8-hex')
expect(navigation.categories.flatMap(({ tools }) => tools)).toContain('utf8-hex')
expect(router).toContain("redirect: '/tools/utf8-hex'")
expect(router).not.toContain("'/tools/ascii-hex'")
expect(registry).toContain("'utf8-hex': defineAsyncComponent(() => import('./Utf8HexTool.vue'))")
})
})