Files
wehub-resource-sync c48612c494
CI / E2E Tests (push) Has been cancelled
CI / Lint, Typecheck & Unit Tests (push) Has been cancelled
Docs Build / Build docs site (push) Has been cancelled
Publish @openmaic packages / Build, validate & publish (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:03:23 +08:00

29 lines
942 B
TypeScript

import { describe, expect, it } from 'vitest';
import { buildSystemPrompt } from '@/lib/agent/runtime/build-agent';
describe('buildSystemPrompt capability boundary', () => {
const prompt = buildSystemPrompt({ id: 's1', title: 'Photosynthesis' }).toLowerCase();
it('grants reading and slide regeneration', () => {
expect(prompt).toContain('read_scene_content');
expect(prompt).toContain('regenerate_scene');
});
it('grants interactive-scene bug fixing', () => {
expect(prompt).toContain('edit_interactive_html');
expect(prompt).toContain('interactive');
});
it('still forbids structural and non-slide edits', () => {
expect(prompt).toContain('cannot');
// Structural ops remain out of scope.
expect(prompt).toMatch(/add|delete|reorder|duplicate/);
});
it('embeds the active scene id/title', () => {
expect(prompt).toContain('s1');
expect(prompt).toContain('photosynthesis');
});
});