@@ -22,59 +22,41 @@ const CONFIG_DIR = ".config/opencode"
2222 * Default plugin configuration
2323 */
2424export interface AgentLoopPluginOptions {
25- /** Enable task loop functionality (default: true) */
2625 taskLoop ?: boolean
27- /** Enable iteration loop functionality (default: true) */
28- iterationLoop ?: boolean
2926 /** Default countdown seconds before auto-continuation (default: 2) */
3027 countdownSeconds ?: number
3128 /** Cooldown period in ms after errors (default: 3000) */
3229 errorCooldownMs ?: number
3330 /** Toast notification duration in ms (default: 900) */
3431 toastDurationMs ?: number
35- /** Agent name for continuation prompts */
36- agent ?: string
37- /** Model name for continuation prompts */
38- model ?: string
3932 /** Enable debug logging (default: true) */
4033 debug ?: boolean
4134 /** Path to log file for writing logs */
4235 logFilePath ?: string
4336 /** Path to custom continuation prompt template file */
44- continuationPromptFile ?: string
4537}
4638
4739/**
4840 * Internal configuration with all fields required
4941 */
5042interface InternalConfig {
5143 // All fields are required for internal use
52- taskLoop : boolean
53- iterationLoop : boolean
5444 countdownSeconds : number
5545 errorCooldownMs : number
5646 toastDurationMs : number
57- agent : string | undefined
58- model : string | undefined
5947 debug : boolean
6048 logFilePath : string | undefined
61- continuationPromptFile : string | undefined
6249}
6350
6451/**
6552 * Default configuration values
6653 */
6754const HARDCODED_DEFAULTS : InternalConfig = {
68- taskLoop : true ,
69- iterationLoop : true ,
7055 countdownSeconds : 2 ,
7156 errorCooldownMs : 3000 ,
7257 toastDurationMs : 900 ,
73- agent : undefined ,
74- model : undefined ,
7558 debug : true ,
7659 logFilePath : undefined ,
77- continuationPromptFile : undefined ,
7860}
7961
8062/**
@@ -116,23 +98,14 @@ function loadConfigFromFile(): AgentLoopPluginOptions | null {
11698
11799 // Return validated config (unknown properties are ignored)
118100 return {
119- taskLoop : config . taskLoop ,
120- iterationLoop : config . iterationLoop ,
121101 countdownSeconds : config . countdownSeconds ,
122102 errorCooldownMs : config . errorCooldownMs ,
123103 toastDurationMs : config . toastDurationMs ,
124- agent : config . agent ,
125- model : config . model ,
126104 debug : config . debug ,
127105 logFilePath : config . logFilePath ,
128- continuationPromptFile : config . continuationPromptFile ,
129106 }
130107 } catch ( error ) {
131- if ( error instanceof SyntaxError ) {
132- console . warn ( "[agent-loop-plugin] Config file contains invalid JSON" )
133- } else {
134- console . warn ( `[agent-loop-plugin] Failed to read config file: ${ error } ` )
135- }
108+ console . warn ( `[agent-loop-plugin] Failed to read config file: ${ error } ` )
136109 return null
137110 }
138111}
0 commit comments