mirror of
https://github.com/deepseek-ai/deepseek-harness.git
synced 2026-10-26 16:55:08 +00:00
Profile templates and the default, optional, on-demand, retired, and installation-owned bundle lists move to the new data-only package @deepseek-ai/dsh-official-bundles, so editing a bundle list no longer touches app-boot.
45 lines
1.8 KiB
TypeScript
45 lines
1.8 KiB
TypeScript
/** MCP resource ownership across the resolved shipped profile templates. */
|
|
|
|
import { mkdtempSync, readFileSync, rmSync } from 'node:fs'
|
|
import { tmpdir } from 'node:os'
|
|
import { join } from 'node:path'
|
|
import { fileURLToPath } from 'node:url'
|
|
import { describe, expect, it } from 'vitest'
|
|
import { composeEntries, loadProfile } from '@deepseek-ai/dsh-app-boot'
|
|
import { PROFILE_TEMPLATES } from '@deepseek-ai/dsh-official-bundles'
|
|
|
|
const installAnchor = fileURLToPath(new URL('../package.json', import.meta.url))
|
|
const resourcePackage = '@deepseek-ai/dsh-mcp-resources'
|
|
|
|
describe('shipped MCP resource composition', () => {
|
|
it.each(Object.keys(PROFILE_TEMPLATES))('%s carries one shared resource consumer without a server', (name) => {
|
|
const home = mkdtempSync(join(tmpdir(), 'dsh-profile-mcp-'))
|
|
try {
|
|
const profile = loadProfile('dsh', name, installAnchor, home)
|
|
const warnings: string[] = []
|
|
const rows = composeEntries([
|
|
...profile.layers.map(layer => layer.patches),
|
|
profile.patches,
|
|
], message => warnings.push(message))
|
|
|
|
expect(rows.filter(row => row.name === resourcePackage)).toEqual([
|
|
{ id: 'mcp-resources', name: resourcePackage },
|
|
])
|
|
expect(rows.filter(row => row.name === '@deepseek-ai/dsh-mcp-client')).toEqual([])
|
|
expect(warnings).toEqual([])
|
|
|
|
const owners = profile.layers.filter((layer) => {
|
|
const manifest = JSON.parse(readFileSync(join(layer.packageDir, 'package.json'), 'utf8')) as {
|
|
dependencies?: Record<string, string>
|
|
}
|
|
return manifest.dependencies?.[resourcePackage] !== undefined
|
|
})
|
|
expect(owners.map(owner => owner.packageName)).toEqual([
|
|
name === 'sdk-minimal' ? '@deepseek-ai/dsh-sdk-minimal' : '@deepseek-ai/dsh-base',
|
|
])
|
|
} finally {
|
|
rmSync(home, { recursive: true, force: true })
|
|
}
|
|
})
|
|
})
|