Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1a8e110866 | ||
|
|
5e40db4e51 |
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "goodbuddy",
|
"name": "goodbuddy",
|
||||||
"version": "0.8.8",
|
"version": "0.8.10",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "goodbuddy",
|
"name": "goodbuddy",
|
||||||
"version": "0.8.8",
|
"version": "0.8.10",
|
||||||
"license": "UNLICENSED",
|
"license": "UNLICENSED",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@modelcontextprotocol/sdk": "^1.30.0",
|
"@modelcontextprotocol/sdk": "^1.30.0",
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "goodbuddy",
|
"name": "goodbuddy",
|
||||||
"version": "0.8.8",
|
"version": "0.8.10",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "Secure desktop AI workspace with controlled Agent Runtimes",
|
"description": "Secure desktop AI workspace with controlled Agent Runtimes",
|
||||||
"desktopName": "GoodBuddy",
|
"desktopName": "GoodBuddy",
|
||||||
|
|||||||
@@ -58,7 +58,8 @@ class FailingBrowserProfileService extends BrowserProfileService {
|
|||||||
async function writeSkill(
|
async function writeSkill(
|
||||||
root: string,
|
root: string,
|
||||||
id: string,
|
id: string,
|
||||||
name: string
|
name: string,
|
||||||
|
body = '仅用于离线测试。'
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const directory = join(root, id)
|
const directory = join(root, id)
|
||||||
await mkdir(directory, { recursive: true })
|
await mkdir(directory, { recursive: true })
|
||||||
@@ -76,7 +77,7 @@ async function writeSkill(
|
|||||||
'',
|
'',
|
||||||
`# ${name}`,
|
`# ${name}`,
|
||||||
'',
|
'',
|
||||||
'仅用于离线测试。'
|
body
|
||||||
].join('\n'),
|
].join('\n'),
|
||||||
'utf8'
|
'utf8'
|
||||||
)
|
)
|
||||||
@@ -327,7 +328,12 @@ describe('CapabilityService', () => {
|
|||||||
|
|
||||||
it('exposes the skill directory and names skills dropped by the budget', async () => {
|
it('exposes the skill directory and names skills dropped by the budget', async () => {
|
||||||
const { builtinRoot, service } = await createService()
|
const { builtinRoot, service } = await createService()
|
||||||
await writeSkill(builtinRoot, 'oversized-skill', '超长技能')
|
await writeSkill(
|
||||||
|
builtinRoot,
|
||||||
|
'oversized-skill',
|
||||||
|
'超长技能',
|
||||||
|
'超长技能说明。'.repeat(80)
|
||||||
|
)
|
||||||
|
|
||||||
const instructions = await service.getSkillInstructions('model')
|
const instructions = await service.getSkillInstructions('model')
|
||||||
expect(instructions).toContain(join(builtinRoot, 'document-writing'))
|
expect(instructions).toContain(join(builtinRoot, 'document-writing'))
|
||||||
@@ -335,6 +341,12 @@ describe('CapabilityService', () => {
|
|||||||
|
|
||||||
const truncated = await service.getSkillInstructions('model', 200)
|
const truncated = await service.getSkillInstructions('model', 200)
|
||||||
expect(truncated).toContain('因超出注入上限未加载')
|
expect(truncated).toContain('因超出注入上限未加载')
|
||||||
|
expect(truncated).toContain('超长技能')
|
||||||
|
|
||||||
|
const fullyTruncated = await service.getSkillInstructions('model', 1)
|
||||||
|
expect(fullyTruncated).toContain('因超出注入上限未加载')
|
||||||
|
expect(fullyTruncated).toContain('文档写作')
|
||||||
|
expect(fullyTruncated).toContain('超长技能')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('imports a managed Skill from a ZIP package', async () => {
|
it('imports a managed Skill from a ZIP package', async () => {
|
||||||
|
|||||||
@@ -1361,7 +1361,7 @@ export class CapabilityService {
|
|||||||
sections.push(section)
|
sections.push(section)
|
||||||
length += section.length
|
length += section.length
|
||||||
}
|
}
|
||||||
if (sections.length === 0) {
|
if (sections.length === 0 && skipped.length === 0) {
|
||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
return [
|
return [
|
||||||
|
|||||||
Reference in New Issue
Block a user