@vibe-forge/workspace-assets 0.9.1 → 0.9.2-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -467,7 +467,7 @@
|
|
|
467
467
|
]
|
|
468
468
|
},
|
|
469
469
|
"options": {
|
|
470
|
-
"systemPrompt": "<system-prompt>\nThe project system rules are:\n# review\n\n> 必须检查发布改动的回归风险。\n\n# demo/security\n\n> Use when: 插件安全规则\n> Rule file path: node_modules/@vibe-forge/plugin-demo/rules/security.md\n> Only read this rule file when the task matches the scenario above.\n</system-prompt>\n\n\n<system-prompt>\nThe following skill modules are loaded for the project:\n# research\n\n> Skill description: 检索资料\n> Skill file path: .ai/skills/research/SKILL.md\n> Resolve relative paths in the resource content relative to the directory containing this skill file.\n\n<skill-content>\n先阅读 README.md,再补充结论。\n</skill-content>\n</system-prompt>\n\n\n<system-prompt>\nThe project includes the following entities:\n - architect: 负责拆解方案的实体\n\nWhen solving user problems, you may specify entities through `vibe-forge.StartTasks` as needed and have them coordinate multiple entity types to complete the work; use `GetTaskInfo` and `wait` to track progress
|
|
470
|
+
"systemPrompt": "<system-prompt>\nThe project system rules are:\n# review\n\n> 必须检查发布改动的回归风险。\n\n# demo/security\n\n> Use when: 插件安全规则\n> Rule file path: node_modules/@vibe-forge/plugin-demo/rules/security.md\n> Only read this rule file when the task matches the scenario above.\n</system-prompt>\n\n\n<system-prompt>\nThe following skill modules are loaded for the project:\n# research\n\n> Skill description: 检索资料\n> Skill file path: .ai/skills/research/SKILL.md\n> Resolve relative paths in the resource content relative to the directory containing this skill file.\n\n<skill-content>\n先阅读 README.md,再补充结论。\n</skill-content>\n</system-prompt>\n\n\n<system-prompt>\nThe project includes the following entities:\n - architect: 负责拆解方案的实体\n\nWhen solving user problems, you may specify entities through `vibe-forge.StartTasks` as needed and have them coordinate multiple entity types to complete the work; use `GetTaskInfo` and `wait` to track progress.\n</system-prompt>\n\n\n\n\n<system-prompt>\nYou are a professional project execution manager who can skillfully direct other entities to work toward your goal. Expectations:\n\n- Never complete code development work alone\n- You must coordinate other developers to complete tasks\n- You must keep them aligned with the goal and verify that their completion reports meet the requirements\n\nChoose the appropriate workflow based on the user's needs and the actual development goal, and use the workflow identifier to locate and load the corresponding definition.\n- Pass the identifier based on the actual need. This is not a path; use the standard workflow loading capability to resolve it.\n- Decide how to pass parameters based on their descriptions and actual usage scenarios.\nThe project includes the following workflows:\n- Workflow name: release\n - Description: 正式发布流程\n - Identifier: release\n - Parameters:\n - None\n\n- Workflow name: demo/release\n - Description: 插件发布流程\n - Identifier: demo/release\n - Parameters:\n - None\n\n</system-prompt>\n\n\n执行正式发布,并整理变更摘要。",
|
|
471
471
|
"tools": {
|
|
472
472
|
"include": [
|
|
473
473
|
"Edit",
|
|
@@ -113,6 +113,8 @@ describe('workspace asset prompt builders', () => {
|
|
|
113
113
|
expect(prompt).toContain('Workflow name: release')
|
|
114
114
|
expect(prompt).toContain('Identifier: release')
|
|
115
115
|
expect(prompt).toContain(' - version: 版本号')
|
|
116
|
+
expect(prompt).toContain('use the workflow identifier to locate and load the corresponding definition')
|
|
117
|
+
expect(prompt).not.toContain('load-spec')
|
|
116
118
|
})
|
|
117
119
|
|
|
118
120
|
it('builds spec route prompts without exposing file paths', () => {
|
|
@@ -144,6 +146,8 @@ describe('workspace asset prompt builders', () => {
|
|
|
144
146
|
expect(prompt).toContain('Description: 发布流程')
|
|
145
147
|
expect(prompt).toContain('Identifier: release')
|
|
146
148
|
expect(prompt).toContain(' - version: 版本号')
|
|
149
|
+
expect(prompt).toContain('use the workflow identifier to locate and load the corresponding definition')
|
|
150
|
+
expect(prompt).not.toContain('load-spec')
|
|
147
151
|
expect(prompt).not.toContain('professional project execution manager')
|
|
148
152
|
expect(prompt).not.toContain('.ai/specs/release/index.md')
|
|
149
153
|
expect(prompt).not.toContain('internal')
|
|
@@ -169,6 +173,10 @@ describe('workspace asset prompt builders', () => {
|
|
|
169
173
|
])
|
|
170
174
|
|
|
171
175
|
expect(prompt).toContain('reviewer: 负责代码审查')
|
|
176
|
+
expect(prompt).toContain('`vibe-forge.StartTasks`')
|
|
177
|
+
expect(prompt).toContain('`GetTaskInfo`')
|
|
178
|
+
expect(prompt).toContain('`wait`')
|
|
179
|
+
expect(prompt).not.toContain('run-tasks')
|
|
172
180
|
expect(prompt).not.toContain('需要关注变更风险')
|
|
173
181
|
expect(prompt).not.toContain('hidden')
|
|
174
182
|
})
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest'
|
|
2
|
+
|
|
3
|
+
import type { WorkspaceAssetBundle } from '@vibe-forge/types'
|
|
4
|
+
|
|
5
|
+
import { resolveSelectedMcpNames } from '#~/selection-internal.js'
|
|
6
|
+
|
|
7
|
+
const createBundle = (): WorkspaceAssetBundle => ({
|
|
8
|
+
cwd: '/tmp/workspace',
|
|
9
|
+
pluginConfigs: [],
|
|
10
|
+
pluginInstances: [],
|
|
11
|
+
assets: [],
|
|
12
|
+
rules: [],
|
|
13
|
+
specs: [],
|
|
14
|
+
entities: [],
|
|
15
|
+
skills: [],
|
|
16
|
+
hookPlugins: [],
|
|
17
|
+
opencodeOverlayAssets: [],
|
|
18
|
+
defaultIncludeMcpServers: [],
|
|
19
|
+
defaultExcludeMcpServers: ['TypeScriptLanguageService'],
|
|
20
|
+
mcpServers: {
|
|
21
|
+
TypeScriptLanguageService: {
|
|
22
|
+
kind: 'mcpServer',
|
|
23
|
+
id: 'mcp:TypeScriptLanguageService',
|
|
24
|
+
scope: 'workspace',
|
|
25
|
+
name: 'TypeScriptLanguageService',
|
|
26
|
+
displayName: 'TypeScriptLanguageService',
|
|
27
|
+
source: '/tmp/workspace/.ai.config.json',
|
|
28
|
+
command: 'node',
|
|
29
|
+
args: ['tslspmcp']
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
describe('resolveSelectedMcpNames', () => {
|
|
35
|
+
it('lets an explicit include override default excludes', () => {
|
|
36
|
+
const selected = resolveSelectedMcpNames(createBundle(), {
|
|
37
|
+
include: ['TypeScriptLanguageService']
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
expect(selected).toEqual(['TypeScriptLanguageService'])
|
|
41
|
+
})
|
|
42
|
+
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibe-forge/workspace-assets",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.2-alpha.0",
|
|
4
4
|
"description": "Workspace asset resolution and adapter asset planning for Vibe Forge",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#~/*.js": {
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
"fast-glob": "^3.3.3",
|
|
30
30
|
"front-matter": "^4.0.2",
|
|
31
31
|
"js-yaml": "^4.1.1",
|
|
32
|
-
"@vibe-forge/
|
|
32
|
+
"@vibe-forge/utils": "^0.9.0",
|
|
33
|
+
"@vibe-forge/definition-core": "^0.9.0",
|
|
33
34
|
"@vibe-forge/types": "^0.9.0",
|
|
34
|
-
"@vibe-forge/
|
|
35
|
-
"@vibe-forge/definition-core": "^0.9.0"
|
|
35
|
+
"@vibe-forge/config": "^0.9.1-alpha.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/js-yaml": "^4.0.9"
|
package/src/prompt-builders.ts
CHANGED
|
@@ -155,8 +155,8 @@ export const generateSpecRoutePrompt = (
|
|
|
155
155
|
: ''
|
|
156
156
|
|
|
157
157
|
return (
|
|
158
|
-
`<system-prompt>\n${activeIdentityPrompt}Choose the appropriate workflow based on the user's needs and the actual development goal, and
|
|
159
|
-
'- Pass the identifier based on the actual need. This is not a path; use the standard workflow
|
|
158
|
+
`<system-prompt>\n${activeIdentityPrompt}Choose the appropriate workflow based on the user's needs and the actual development goal, and use the workflow identifier to locate and load the corresponding definition.\n` +
|
|
159
|
+
'- Pass the identifier based on the actual need. This is not a path; use the standard workflow loading capability to resolve it.\n' +
|
|
160
160
|
'- Decide how to pass parameters based on their descriptions and actual usage scenarios.\n' +
|
|
161
161
|
'The project includes the following workflows:\n' +
|
|
162
162
|
`${specsRouteStr}\n` +
|
|
@@ -178,7 +178,7 @@ export const generateEntitiesRoutePrompt = (entities: Definition<Entity>[]) => {
|
|
|
178
178
|
})
|
|
179
179
|
.join('')
|
|
180
180
|
}\n` +
|
|
181
|
-
'When solving user problems, you may specify entities through `vibe-forge.StartTasks` as needed and have them coordinate multiple entity types to complete the work; use `GetTaskInfo` and `wait` to track progress
|
|
181
|
+
'When solving user problems, you may specify entities through `vibe-forge.StartTasks` as needed and have them coordinate multiple entity types to complete the work; use `GetTaskInfo` and `wait` to track progress.\n' +
|
|
182
182
|
'</system-prompt>\n'
|
|
183
183
|
)
|
|
184
184
|
}
|
|
@@ -219,7 +219,11 @@ export const resolveSelectedMcpNames = (
|
|
|
219
219
|
const includeRefs = selection?.include ??
|
|
220
220
|
(bundle.defaultIncludeMcpServers.length > 0 ? bundle.defaultIncludeMcpServers : undefined)
|
|
221
221
|
const excludeRefs = selection?.exclude ??
|
|
222
|
-
(
|
|
222
|
+
(
|
|
223
|
+
selection?.include == null && bundle.defaultExcludeMcpServers.length > 0
|
|
224
|
+
? bundle.defaultExcludeMcpServers
|
|
225
|
+
: undefined
|
|
226
|
+
)
|
|
223
227
|
|
|
224
228
|
const resolveRefs = (refs: string[] | undefined) => {
|
|
225
229
|
if (refs == null || refs.length === 0) return undefined
|