feat: optimze skill and tool

This commit is contained in:
imccyu
2026-08-13 03:46:20 +08:00
parent 35b51dd15c
commit 499d397631
13 changed files with 132 additions and 30 deletions

View File

@@ -3,7 +3,7 @@
import { describe, expect, it } from 'vitest'
import type { RunningToolCall, ToolResultNode } from '@deepseek-ai/dsh-client-runtime/client'
import { cordisDefineCard } from '../src/client/card-model.ts'
import { cordisActionCard, cordisDefineCard } from '../src/client/card-model.ts'
const ARGS = '{"name":"clock","purpose":"顶栏时钟","code":{"client":"return {}","host":"harness.handle(\'now\', () => Date.now())"}}'
@@ -86,3 +86,20 @@ describe('cordisDefineCard', () => {
expect(card.purpose).toBeNull()
})
})
describe('cordisActionCard', () => {
it('keeps the Plugin identity and lifecycle result for Stop and Remove cards', () => {
const card = cordisActionCard(settled({
call: { name: 'cordis_stop', argsRaw: '{"pluginId":"clock-1"}' },
content: [{ type: 'text', text: 'Stopped clock-1.' }],
meta: undefined,
}))
expect(card).toEqual({
pluginId: 'clock-1',
output: 'Stopped clock-1.',
errorSummary: null,
state: 'ok',
})
})
})