@vibe-forge/core 0.3.0 → 0.5.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.
@@ -0,0 +1,32 @@
1
+ import process from 'node:process'
2
+
3
+ import type { HookInputs, HookOutputs } from '#~/hooks/type.js'
4
+
5
+ export type HookEventName = keyof HookInputs
6
+
7
+ type HookInputPayload<K extends HookEventName> = Omit<HookInputs[K], 'hookEventName'>
8
+
9
+ const host = process.env.__VF_PROJECT_AI_SERVER_HOST__ ?? 'localhost'
10
+ const port = process.env.__VF_PROJECT_AI_SERVER_PORT__ ?? '8787'
11
+ const baseUrl = `http://${host}:${port}`
12
+
13
+ export const callHook = async <K extends HookEventName>(
14
+ hookEventName: K,
15
+ input: HookInputPayload<K>,
16
+ env: Record<string, unknown> = process.env
17
+ ): Promise<HookOutputs[K]> => {
18
+ const response = await fetch(`${baseUrl}/api/hooks/call`, {
19
+ method: 'POST',
20
+ headers: { 'Content-Type': 'application/json' },
21
+ body: JSON.stringify({
22
+ hookEventName,
23
+ input,
24
+ env
25
+ })
26
+ })
27
+ if (!response.ok) {
28
+ const errorText = await response.text()
29
+ throw new Error(`Failed to call hook: ${response.statusText} - ${errorText}`)
30
+ }
31
+ return response.json()
32
+ }
@@ -260,7 +260,7 @@ export class DefinitionLoader {
260
260
  '- 必须要协调其他的开发人员来完成任务\n' +
261
261
  '- 必须让他们按照目标进行完成,不要偏离目标,检查他们任务完成后的汇报内容是否符合要求\n' +
262
262
  '\n' +
263
- '根据用户需要以及实际的开发目标来决定使用不同的工作流程,调用 `mcp__TmarAITools__load-spec` mcp tool 完成工作流程的加载。\n' +
263
+ '根据用户需要以及实际的开发目标来决定使用不同的工作流程,调用 `load-spec` mcp tool 完成工作流程的加载。\n' +
264
264
  '- 根据实际需求传入标识,这不是路径,只能使用工具进行加载\n' +
265
265
  '- 通过参数的描述以及实际应用场景决定怎么传入参数\n' +
266
266
  '项目存在如下工作流程:\n' +