|
@@ -0,0 +1,32 @@
|
|
|
|
|
+import { describe, expect, it } from 'vitest';
|
|
|
|
|
+
|
|
|
|
|
+import type { Agent } from '$lib/types/entities';
|
|
|
|
|
+
|
|
|
|
|
+import { fromAgentCR, toAgentCR } from './agent';
|
|
|
|
|
+
|
|
|
|
|
+const agent: Agent = {
|
|
|
|
|
+ id: 'paas-48fb9d-agent-1ea2784d',
|
|
|
|
|
+ stack: 'default',
|
|
|
|
|
+ name: '米塔',
|
|
|
|
|
+ icon: 'bot',
|
|
|
|
|
+ description: '可爱助手',
|
|
|
|
|
+ tags: ['中文', 'assistant'],
|
|
|
|
|
+ systemPrompt: '你的名字是米塔',
|
|
|
|
|
+ model: { type: 'external', id: 'deepseek-v4-1-flash', name: 'deepseek-v4-1-flash' },
|
|
|
|
|
+ skills: [],
|
|
|
|
|
+ tools: [],
|
|
|
|
|
+ kbs: [],
|
|
|
|
|
+ subagents: [],
|
|
|
|
|
+ runtime: { name: 'lambdagent' },
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+describe('Agent CR annotations', () => {
|
|
|
|
|
+ it('round-trips the display name and metadata through agents.locostack.com annotations', () => {
|
|
|
|
|
+ const restored = fromAgentCR(toAgentCR(agent));
|
|
|
|
|
+
|
|
|
|
|
+ expect(restored.name).toBe('米塔');
|
|
|
|
|
+ expect(restored.icon).toBe('bot');
|
|
|
|
|
+ expect(restored.description).toBe('可爱助手');
|
|
|
|
|
+ expect(restored.tags).toEqual(['中文', 'assistant']);
|
|
|
|
|
+ });
|
|
|
|
|
+});
|