@@ -2,21 +2,16 @@ import type { Hooks } from "@opencode-ai/plugin";
22import { isOpenSpecProject } from "./utils/detection" ;
33import { OPENSPEC_SYSTEM_PROMPT } from "./prompts" ;
44
5- export function createConfigHook ( ctx : { directory : string } , log : ( msg : string , ... args : any [ ] ) => void ) : Hooks [ "config" ] {
5+ export function createConfigHook ( ctx : { directory : string } ) : Hooks [ "config" ] {
66 return async ( config ) => {
7- log ( "[OpenSpec Plugin] Config hook triggered." ) ;
8-
97 // 1. Check if this is an OpenSpec project
108 const mockCtx = { directory : ctx . directory } as any ;
119
1210 const isActive = await isOpenSpecProject ( mockCtx ) ;
1311 if ( ! isActive ) {
14- log ( "[OpenSpec Plugin] Config hook: Not an OpenSpec project, skipping." ) ;
1512 return ;
1613 }
1714
18- log ( "[OpenSpec Plugin] Config hook: Injecting openspec-plan agent." ) ;
19-
2015 // 2. Define the OpenSpec Plan Agent
2116 const openSpecAgent = {
2217 name : "openspec-plan" ,
@@ -39,15 +34,7 @@ export function createConfigHook(ctx: { directory: string }, log: (msg: string,
3934
4035 // 3. Inject into configuration
4136 const agentConfig = ( config . agent || { } ) as any ;
42-
43- // Check if already injected to avoid potential re-injection loops
44- if ( agentConfig [ "openspec-plan" ] ) {
45- log ( "[OpenSpec Plugin] Agent already exists, updating..." ) ;
46- }
47-
4837 agentConfig [ "openspec-plan" ] = openSpecAgent ;
4938 config . agent = agentConfig ;
50-
51- log ( "[OpenSpec Plugin] Config hook: Injection complete." ) ;
5239 } ;
5340}
0 commit comments