feat: add DeepSeek Harness runtime

This commit is contained in:
lofyer
2026-08-14 10:04:34 +08:00
parent fca9888f83
commit 8286e120a1
69 changed files with 13660 additions and 351 deletions
@@ -63,6 +63,13 @@ describe('bundled skills', () => {
expect(snapshot.skills.map((skill) => skill.id)).toContain(
'product-marketing'
)
expect(snapshot.skills).toContainEqual(
expect.objectContaining({
id: 'web-3d-game',
name: 'Web 3D Game',
assignments: expect.arrayContaining(['deepseek-harness'])
})
)
})
it('injects every enabled bundled skill with its resolved directory', async () => {
@@ -76,4 +83,19 @@ describe('bundled skills', () => {
expect(instructions).toContain(join(builtinSkillsRoot, skill.id))
}
})
it('exposes the 3D game Skill as a native Harness package', async () => {
const service = await createService()
await expect(
service.getRuntimeSkillContext('deepseek-harness')
).resolves.toMatchObject({
packages: expect.arrayContaining([
{
id: 'web-3d-game',
directory: join(builtinSkillsRoot, 'web-3d-game')
}
])
})
})
})
@@ -246,7 +246,12 @@ describe('CapabilityService', () => {
id: 'document-writing',
source: 'builtin',
enabled: true,
assignments: ['model', 'opencode', 'continue']
assignments: [
'model',
'opencode',
'continue',
'deepseek-harness'
]
}
]
})
@@ -625,9 +630,31 @@ describe('CapabilityService', () => {
})
})
it('rejects MCP assignments to Agent Runtimes', async () => {
it('allows Harness MCP assignment and rejects unsupported Agent Runtimes', async () => {
const { service } = await createService()
await expect(
service.saveMcpServer(undefined, {
name: 'Harness MCP',
description: '',
enabled: true,
allowDynamicTools: false,
assignments: ['deepseek-harness'],
secret: { action: 'keep' },
transport: 'stdio',
command: 'node',
args: ['server.js']
})
).resolves.toMatchObject({
mcpServers: [
expect.objectContaining({
assignments: ['deepseek-harness']
})
]
})
await expect(
service.getResolvedMcpServers('deepseek-harness')
).resolves.toHaveLength(1)
await expect(
service.saveMcpServer(undefined, {
name: 'Agent MCP',
@@ -640,7 +667,7 @@ describe('CapabilityService', () => {
command: 'node',
args: ['server.js']
})
).rejects.toThrow('只能分配给直连模型')
).rejects.toThrow('只能分配给直连模型或 DeepSeek Harness')
})
it('migrates legacy OpenCode MCP assignments to the direct model', async () => {
+13 -4
View File
@@ -269,7 +269,12 @@ function emptyStoredCapabilities(
function defaultSkillState(): z.infer<typeof skillStateSchema> {
return {
enabled: true,
assignments: ['model', 'opencode', 'continue']
assignments: [
'model',
'opencode',
'continue',
'deepseek-harness'
]
}
}
@@ -1606,10 +1611,14 @@ export class CapabilityService {
const value = mcpServerInputSchema.parse(input)
if (
value.assignments.some(
(assignment) => assignment !== 'model'
(assignment) =>
assignment !== 'model' &&
assignment !== 'deepseek-harness'
)
) {
throw new Error('当前版本的 MCP Server 只能分配给直连模型')
throw new Error(
'当前版本的 MCP Server 只能分配给直连模型或 DeepSeek Harness'
)
}
const state = await this.load()
const id = serverId ? mcpServerIdSchema.parse(serverId) : randomUUID()
@@ -1809,7 +1818,7 @@ export class CapabilityService {
async getResolvedMcpServers(
target: RuntimeTarget
): Promise<ResolvedMcpServer[]> {
if (target !== 'model') {
if (target !== 'model' && target !== 'deepseek-harness') {
return []
}
const state = await this.load()