feat: add static repository plugin format
This commit is contained in:
@@ -1,6 +1,12 @@
|
||||
- id: cli-mock-llm
|
||||
name: './cli-mock-llm.ts'
|
||||
|
||||
- id: repository-plugin-runtime
|
||||
name: '@deepseek-ai/dsh-repository-plugin'
|
||||
|
||||
- id: repository-plugin-fixture
|
||||
name: './repository-plugin/dsh-plugin.mjs'
|
||||
|
||||
- id: base
|
||||
name: '@cordisjs/plugin-include'
|
||||
config:
|
||||
@@ -16,4 +22,8 @@
|
||||
model: cli-mock
|
||||
persistenceRoot: './.sessions'
|
||||
workspaceContext: false
|
||||
dshHome: './.dsh-home'
|
||||
skills:
|
||||
local:
|
||||
agentsHome: './.agents-home'
|
||||
persona: 'Keyless headless-agent smoke.'
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
name: repository-fixture
|
||||
description: Repository fixture skill.
|
||||
---
|
||||
|
||||
Static instructions from a prepared repository plugin.
|
||||
9
examples/headless-agent/tests/fixtures/repository-plugin/dsh-plugin.mjs
vendored
Normal file
9
examples/headless-agent/tests/fixtures/repository-plugin/dsh-plugin.mjs
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
// Generated by dsh-plugin-prepare. Do not edit.
|
||||
const manifest = { "name": "headless-repository-fixture", "skills": ["dsh-plugin-assets/skills/0"] }
|
||||
export const name = 'headless-repository-fixture'
|
||||
export const inject = ['loader']
|
||||
export async function apply(ctx) {
|
||||
const runtime = ctx.loader.builtins['dsh-repository-plugin']
|
||||
if (runtime === undefined) throw new Error('missing Cordis builtin dsh-repository-plugin')
|
||||
await ctx.plugin(runtime, { baseUrl: import.meta.url, manifest })
|
||||
}
|
||||
@@ -36,6 +36,17 @@ describe('headless-agent keyless smoke', () => {
|
||||
const result = lines.at(-1)
|
||||
expect(stderr).toBe('')
|
||||
expect(events.some(event => event.type === 'tool/call' && event.data.name === 'bash')).toBe(true)
|
||||
const catalogMessage = events.find(event => event.type === 'user/message'
|
||||
&& event.data.source.kind === 'plugin'
|
||||
&& event.data.source.plugin === 'dsh-tool-skill')
|
||||
const catalog = catalogMessage?.type === 'user/message'
|
||||
? catalogMessage.data.content.filter(block => block.type === 'text').map(block => block.text).join('\n')
|
||||
: ''
|
||||
expect(catalog.split('\n').find(line => line.includes('repository-fixture'))).toMatchInlineSnapshot(
|
||||
`
|
||||
"- \`repository-fixture\`: Repository fixture skill."
|
||||
`,
|
||||
)
|
||||
const toolResult = events.find(event => event.type === 'tool/result')
|
||||
expect(JSON.stringify(toolResult)).toContain('CLI_TOOL_ROUND_TRIP')
|
||||
expect(result).toMatchObject({
|
||||
|
||||
Reference in New Issue
Block a user