You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/lib/config.ts
+11-17Lines changed: 11 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,15 @@
1
+
importconsolafrom"consola"
1
2
importfsfrom"node:fs"
2
3
3
4
import{PATHS}from"./paths"
4
5
5
6
exportinterfaceAppConfig{
6
-
extraPrompt: string
7
+
extraPrompts?: Record<string,string>
7
8
}
8
9
9
10
constdefaultConfig: AppConfig={
10
-
extraPrompt: `
11
+
extraPrompts: {
12
+
"gpt-5-codex": `
11
13
## Tool use
12
14
- You have access to many tools. If a tool exists to perform a specific task, you MUST use that tool instead of running a terminal command to perform that task.
13
15
### Bash tool
@@ -24,6 +26,7 @@ When using the TodoWrite tool, follow these rules:
24
26
## Special user requests
25
27
- If the user makes a simple request (such as asking for the time) which you can fulfill by running a terminal command (such as 'date'), you should do so.
26
28
`,
29
+
},
27
30
}
28
31
29
32
letcachedConfig: AppConfig|null=null
@@ -57,14 +60,9 @@ function readConfigFromDisk(): AppConfig {
57
60
)
58
61
returndefaultConfig
59
62
}
60
-
constparsed=JSON.parse(raw)asAppConfig
61
-
returnparsed
62
-
}catch{
63
-
fs.writeFileSync(
64
-
PATHS.CONFIG_PATH,
65
-
`${JSON.stringify(defaultConfig,null,2)}\n`,
66
-
"utf8",
67
-
)
63
+
returnJSON.parse(raw)asAppConfig
64
+
}catch(error){
65
+
consola.error("Failed to read config file, using default config",error)
68
66
returndefaultConfig
69
67
}
70
68
}
@@ -76,11 +74,7 @@ export function getConfig(): AppConfig {
0 commit comments