@travisennis/acai 0.0.10 → 0.0.12
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.
- package/README.md +7 -4
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +29 -27
- package/dist/cli/stdin.d.ts +2 -1
- package/dist/cli/stdin.d.ts.map +1 -1
- package/dist/commands/generate-rules/service.d.ts +3 -2
- package/dist/commands/generate-rules/service.d.ts.map +1 -1
- package/dist/commands/health/utils.d.ts +3 -2
- package/dist/commands/health/utils.d.ts.map +1 -1
- package/dist/commands/init-project/utils.d.ts +2 -1
- package/dist/commands/init-project/utils.d.ts.map +1 -1
- package/dist/commands/init-project/utils.js +0 -11
- package/dist/commands/manager.d.ts.map +1 -1
- package/dist/commands/manager.js +6 -1
- package/dist/commands/resources/index.d.ts.map +1 -1
- package/dist/commands/resources/index.js +4 -1
- package/dist/commands/review/utils.d.ts +6 -1
- package/dist/commands/review/utils.d.ts.map +1 -1
- package/dist/commands/session/index.d.ts.map +1 -1
- package/dist/commands/session/index.js +6 -0
- package/dist/commands/session/types.d.ts +1 -0
- package/dist/commands/session/types.d.ts.map +1 -1
- package/dist/commands/tools/index.d.ts +3 -0
- package/dist/commands/tools/index.d.ts.map +1 -0
- package/dist/commands/tools/index.js +190 -0
- package/dist/commands/tools/templates.d.ts +6 -0
- package/dist/commands/tools/templates.d.ts.map +1 -0
- package/dist/commands/tools/templates.js +97 -0
- package/dist/config/index.d.ts +5 -0
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +41 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -3
- package/dist/models/anthropic-provider.d.ts +1 -1
- package/dist/models/deepseek-provider.d.ts +3 -3
- package/dist/models/deepseek-provider.js +17 -17
- package/dist/models/google-provider.d.ts +2 -4
- package/dist/models/google-provider.d.ts.map +1 -1
- package/dist/models/google-provider.js +2 -17
- package/dist/models/groq-provider.d.ts +2 -4
- package/dist/models/groq-provider.d.ts.map +1 -1
- package/dist/models/groq-provider.js +3 -21
- package/dist/models/opencode-go-provider.d.ts +35 -0
- package/dist/models/opencode-go-provider.d.ts.map +1 -0
- package/dist/models/opencode-go-provider.js +214 -0
- package/dist/models/opencode-zen-provider.d.ts +5 -5
- package/dist/models/opencode-zen-provider.d.ts.map +1 -1
- package/dist/models/opencode-zen-provider.js +41 -47
- package/dist/models/openrouter-provider.d.ts +5 -13
- package/dist/models/openrouter-provider.d.ts.map +1 -1
- package/dist/models/openrouter-provider.js +34 -138
- package/dist/models/providers.d.ts +3 -3
- package/dist/models/providers.d.ts.map +1 -1
- package/dist/models/providers.js +6 -0
- package/dist/models/xai-provider.d.ts +1 -2
- package/dist/models/xai-provider.d.ts.map +1 -1
- package/dist/models/xai-provider.js +0 -13
- package/dist/prompts/manager.d.ts.map +1 -1
- package/dist/prompts/manager.js +5 -1
- package/dist/prompts/mentions.d.ts.map +1 -1
- package/dist/prompts/mentions.js +35 -6
- package/dist/prompts/system-prompt.d.ts +1 -0
- package/dist/prompts/system-prompt.d.ts.map +1 -1
- package/dist/prompts/system-prompt.js +20 -5
- package/dist/repl/index.d.ts +1 -2
- package/dist/repl/index.d.ts.map +1 -1
- package/dist/repl/index.js +14 -53
- package/dist/sessions/manager.d.ts +3 -3
- package/dist/sessions/manager.d.ts.map +1 -1
- package/dist/sessions/manager.js +1 -1
- package/dist/skills/activated-tracker.d.ts +11 -0
- package/dist/skills/activated-tracker.d.ts.map +1 -0
- package/dist/skills/activated-tracker.js +16 -0
- package/dist/skills/index.d.ts +3 -2
- package/dist/skills/index.d.ts.map +1 -1
- package/dist/skills/index.js +7 -1
- package/dist/subagents/index.d.ts +2 -1
- package/dist/subagents/index.d.ts.map +1 -1
- package/dist/terminal/table/utils.d.ts +1 -1
- package/dist/terminal/table/utils.d.ts.map +1 -1
- package/dist/terminal/wrap-ansi.js +2 -2
- package/dist/tools/agent.js +1 -1
- package/dist/tools/apply-patch.d.ts +62 -0
- package/dist/tools/apply-patch.d.ts.map +1 -0
- package/dist/tools/apply-patch.js +377 -0
- package/dist/tools/bash.d.ts +4 -4
- package/dist/tools/bash.d.ts.map +1 -1
- package/dist/tools/bash.js +40 -8
- package/dist/tools/directory-tree.d.ts +4 -4
- package/dist/tools/directory-tree.d.ts.map +1 -1
- package/dist/tools/directory-tree.js +3 -1
- package/dist/tools/dynamic-tool-loader.d.ts +12 -3
- package/dist/tools/dynamic-tool-loader.d.ts.map +1 -1
- package/dist/tools/dynamic-tool-loader.js +299 -39
- package/dist/tools/edit-file.d.ts +2 -2
- package/dist/tools/edit-file.d.ts.map +1 -1
- package/dist/tools/edit-file.js +188 -79
- package/dist/tools/glob.d.ts +16 -16
- package/dist/tools/glob.d.ts.map +1 -1
- package/dist/tools/glob.js +30 -15
- package/dist/tools/grep.d.ts +14 -14
- package/dist/tools/grep.d.ts.map +1 -1
- package/dist/tools/grep.js +50 -29
- package/dist/tools/index.d.ts +57 -84
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +20 -5
- package/dist/tools/ls.d.ts +2 -2
- package/dist/tools/ls.d.ts.map +1 -1
- package/dist/tools/ls.js +2 -1
- package/dist/tools/read-file.d.ts +9 -11
- package/dist/tools/read-file.d.ts.map +1 -1
- package/dist/tools/read-file.js +21 -16
- package/dist/tools/save-file.d.ts +4 -4
- package/dist/tools/save-file.d.ts.map +1 -1
- package/dist/tools/save-file.js +26 -21
- package/dist/tools/skill.d.ts +2 -1
- package/dist/tools/skill.d.ts.map +1 -1
- package/dist/tools/skill.js +55 -12
- package/dist/tools/types.d.ts +8 -2
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/tools/web-fetch.d.ts +6 -18
- package/dist/tools/web-fetch.d.ts.map +1 -1
- package/dist/tools/web-fetch.js +45 -9
- package/dist/tools/web-search.d.ts +4 -22
- package/dist/tools/web-search.d.ts.map +1 -1
- package/dist/tools/web-search.js +1 -1
- package/dist/tui/autocomplete/file-search-provider.js +1 -1
- package/dist/tui/autocomplete/utils.d.ts +2 -1
- package/dist/tui/autocomplete/utils.d.ts.map +1 -1
- package/dist/tui/autocomplete/utils.js +25 -23
- package/dist/tui/components/editor.d.ts +2 -1
- package/dist/tui/components/editor.d.ts.map +1 -1
- package/dist/tui/components/editor.js +1 -1
- package/dist/tui/components/footer.d.ts +0 -2
- package/dist/tui/components/footer.d.ts.map +1 -1
- package/dist/tui/components/footer.js +1 -17
- package/dist/tui/components/markdown.d.ts +2 -2
- package/dist/tui/components/markdown.d.ts.map +1 -1
- package/dist/tui/components/welcome.d.ts +2 -1
- package/dist/tui/components/welcome.d.ts.map +1 -1
- package/dist/tui/editor-launcher.d.ts +3 -2
- package/dist/tui/editor-launcher.d.ts.map +1 -1
- package/dist/tui/index.d.ts +0 -1
- package/dist/tui/index.d.ts.map +1 -1
- package/dist/tui/tui.d.ts +1 -0
- package/dist/tui/tui.d.ts.map +1 -1
- package/dist/tui/tui.js +9 -0
- package/dist/tui/utils.d.ts +1 -5
- package/dist/tui/utils.d.ts.map +1 -1
- package/dist/tui/utils.js +271 -44
- package/dist/utils/binary-output.d.ts +32 -0
- package/dist/utils/binary-output.d.ts.map +1 -0
- package/dist/utils/binary-output.js +127 -0
- package/dist/utils/command-protection.d.ts.map +1 -1
- package/dist/utils/command-protection.js +92 -9
- package/dist/utils/parsing.d.ts +1 -1
- package/dist/utils/parsing.d.ts.map +1 -1
- package/package.json +28 -26
- package/dist/commands/add-directory/types.d.ts +0 -6
- package/dist/commands/add-directory/types.d.ts.map +0 -1
- package/dist/commands/add-directory/types.js +0 -1
- package/dist/commands/copy/types.d.ts +0 -3
- package/dist/commands/copy/types.d.ts.map +0 -1
- package/dist/commands/copy/types.js +0 -1
- package/dist/commands/review/types.d.ts +0 -12
- package/dist/commands/review/types.d.ts.map +0 -1
- package/dist/commands/review/types.js +0 -1
- package/dist/modes/manager.d.ts +0 -23
- package/dist/modes/manager.d.ts.map +0 -1
- package/dist/modes/manager.js +0 -77
- package/dist/modes/prompts.d.ts +0 -2
- package/dist/modes/prompts.d.ts.map +0 -1
- package/dist/modes/prompts.js +0 -143
- package/dist/tools/code-search.d.ts +0 -41
- package/dist/tools/code-search.d.ts.map +0 -1
- package/dist/tools/code-search.js +0 -195
- package/dist/utils/iterables.d.ts +0 -2
- package/dist/utils/iterables.d.ts.map +0 -1
- package/dist/utils/iterables.js +0 -6
|
@@ -25,28 +25,20 @@ const openResponses = createOpenResponses({
|
|
|
25
25
|
});
|
|
26
26
|
// Models using OpenAI-compatible API
|
|
27
27
|
const openrouterModels = {
|
|
28
|
-
"deepseek-v3-2": openRouterClient("deepseek/deepseek-v3.2"),
|
|
29
|
-
"glm-4-7": openRouterClient("z-ai/glm-4.7"),
|
|
30
|
-
"glm-4-7-flash": openRouterClient("z-ai/glm-4.7-flash"),
|
|
31
28
|
"minimax-m2-5": openRouterClient("minimax/minimax-m2.5"),
|
|
29
|
+
"minimax-m2-7": openRouterClient("minimax/minimax-m2.7"),
|
|
32
30
|
"sonnet-4.5": openRouterClient("anthropic/claude-sonnet-4.5"),
|
|
33
31
|
"opus-4.6": openRouterClient("anthropic/claude-opus-4.6"),
|
|
32
|
+
"owl-alpha": openRouterClient("openrouter/owl-alpha"),
|
|
34
33
|
"haiku-4.5": openRouterClient("anthropic/claude-haiku-4.5"),
|
|
35
34
|
"kimi-k2-5": openRouterClient("moonshotai/kimi-k2.5"),
|
|
36
|
-
"
|
|
37
|
-
"qwen3-max-thinking": openRouterClient("qwen/qwen3-max-thinking"),
|
|
38
|
-
"qwen3-coder-next": openRouterClient("qwen/qwen3-coder-next"),
|
|
35
|
+
"kimi-k2-6": openRouterClient("moonshotai/kimi-k2.6"),
|
|
39
36
|
"glm-5": openRouterClient("z-ai/glm-5"),
|
|
40
|
-
"
|
|
41
|
-
"grok-4-1-fast": openRouterClient("x-ai/grok-4.1-fast"),
|
|
37
|
+
"glm-5-1": openRouterClient("z-ai/glm-5.1"),
|
|
42
38
|
};
|
|
43
39
|
// Models using Open Responses API (GPT models)
|
|
44
40
|
const openResponsesModels = {
|
|
45
41
|
"gpt-oss-120b": openResponses("openai/gpt-oss-120b:exacto"),
|
|
46
|
-
"gpt-5.1-codex-mini": openResponses("openai/gpt-5.1-codex-mini"),
|
|
47
|
-
"gpt-5.1-codex-max": openResponses("openai/gpt-5.1-codex-max"),
|
|
48
|
-
"gpt-5.2": openResponses("openai/gpt-5.2"),
|
|
49
|
-
"gpt-5.2-codex": openResponses("openai/gpt-5.2-codex"),
|
|
50
42
|
"gpt-5-3-codex": openResponses("openai/gpt-5.3-codex"),
|
|
51
43
|
};
|
|
52
44
|
const allModels = { ...openrouterModels, ...openResponsesModels };
|
|
@@ -58,44 +50,20 @@ export const openrouterProvider = {
|
|
|
58
50
|
}),
|
|
59
51
|
};
|
|
60
52
|
export const openrouterModelRegistry = {
|
|
61
|
-
"openrouter:
|
|
62
|
-
id: "openrouter:
|
|
63
|
-
provider: "openrouter",
|
|
64
|
-
contextWindow: 163840,
|
|
65
|
-
maxOutputTokens: 16000,
|
|
66
|
-
defaultTemperature: 1.0,
|
|
67
|
-
promptFormat: "bracket",
|
|
68
|
-
supportsReasoning: true,
|
|
69
|
-
supportsToolCalling: true,
|
|
70
|
-
costPerInputToken: 0.00000027,
|
|
71
|
-
costPerOutputToken: 0.0000004,
|
|
72
|
-
},
|
|
73
|
-
"openrouter:glm-4-7": {
|
|
74
|
-
id: "openrouter:glm-4-7",
|
|
75
|
-
provider: "openrouter",
|
|
76
|
-
contextWindow: 200000,
|
|
77
|
-
maxOutputTokens: 131072,
|
|
78
|
-
defaultTemperature: 0.5,
|
|
79
|
-
promptFormat: "markdown",
|
|
80
|
-
supportsReasoning: true,
|
|
81
|
-
supportsToolCalling: true,
|
|
82
|
-
costPerInputToken: 1.1e-7,
|
|
83
|
-
costPerOutputToken: 0.0000022,
|
|
84
|
-
},
|
|
85
|
-
"openrouter:glm-4-7-flash": {
|
|
86
|
-
id: "openrouter:glm-4-7-flash",
|
|
53
|
+
"openrouter:minimax-m2-5": {
|
|
54
|
+
id: "openrouter:minimax-m2-5",
|
|
87
55
|
provider: "openrouter",
|
|
88
|
-
contextWindow:
|
|
56
|
+
contextWindow: 204800,
|
|
89
57
|
maxOutputTokens: 131072,
|
|
90
58
|
defaultTemperature: 0.5,
|
|
91
59
|
promptFormat: "markdown",
|
|
92
60
|
supportsReasoning: true,
|
|
93
61
|
supportsToolCalling: true,
|
|
94
|
-
costPerInputToken:
|
|
95
|
-
costPerOutputToken:
|
|
62
|
+
costPerInputToken: 3e-7,
|
|
63
|
+
costPerOutputToken: 0.0000012,
|
|
96
64
|
},
|
|
97
|
-
"openrouter:minimax-m2-
|
|
98
|
-
id: "openrouter:minimax-m2-
|
|
65
|
+
"openrouter:minimax-m2-7": {
|
|
66
|
+
id: "openrouter:minimax-m2-7",
|
|
99
67
|
provider: "openrouter",
|
|
100
68
|
contextWindow: 204800,
|
|
101
69
|
maxOutputTokens: 131072,
|
|
@@ -118,6 +86,18 @@ export const openrouterModelRegistry = {
|
|
|
118
86
|
costPerInputToken: 0.000005,
|
|
119
87
|
costPerOutputToken: 0.000025,
|
|
120
88
|
},
|
|
89
|
+
"openrouter:owl-alpha": {
|
|
90
|
+
id: "openrouter:owl-alpha",
|
|
91
|
+
provider: "openrouter",
|
|
92
|
+
contextWindow: 1048756,
|
|
93
|
+
maxOutputTokens: 262144,
|
|
94
|
+
defaultTemperature: 0.5,
|
|
95
|
+
promptFormat: "markdown",
|
|
96
|
+
supportsReasoning: false,
|
|
97
|
+
supportsToolCalling: true,
|
|
98
|
+
costPerInputToken: 0,
|
|
99
|
+
costPerOutputToken: 0,
|
|
100
|
+
},
|
|
121
101
|
"openrouter:sonnet-4.5": {
|
|
122
102
|
id: "openrouter:sonnet-4.5",
|
|
123
103
|
provider: "openrouter",
|
|
@@ -142,29 +122,17 @@ export const openrouterModelRegistry = {
|
|
|
142
122
|
costPerInputToken: 6e-7,
|
|
143
123
|
costPerOutputToken: 0.000003,
|
|
144
124
|
},
|
|
145
|
-
"openrouter:
|
|
146
|
-
id: "openrouter:
|
|
125
|
+
"openrouter:kimi-k2-6": {
|
|
126
|
+
id: "openrouter:kimi-k2-6",
|
|
147
127
|
provider: "openrouter",
|
|
148
128
|
contextWindow: 256000,
|
|
149
|
-
maxOutputTokens: 32768,
|
|
150
|
-
defaultTemperature: 0.55,
|
|
151
|
-
promptFormat: "markdown",
|
|
152
|
-
supportsReasoning: false,
|
|
153
|
-
supportsToolCalling: true,
|
|
154
|
-
costPerInputToken: 0.0000012,
|
|
155
|
-
costPerOutputToken: 0.000006,
|
|
156
|
-
},
|
|
157
|
-
"openrouter:qwen3-max-thinking": {
|
|
158
|
-
id: "openrouter:qwen3-max-thinking",
|
|
159
|
-
provider: "openrouter",
|
|
160
|
-
contextWindow: 262144,
|
|
161
129
|
maxOutputTokens: 65536,
|
|
162
|
-
defaultTemperature: 0
|
|
130
|
+
defaultTemperature: 1.0,
|
|
163
131
|
promptFormat: "markdown",
|
|
164
132
|
supportsReasoning: true,
|
|
165
133
|
supportsToolCalling: true,
|
|
166
|
-
costPerInputToken:
|
|
167
|
-
costPerOutputToken: 0.
|
|
134
|
+
costPerInputToken: 7.448e-7,
|
|
135
|
+
costPerOutputToken: 0.000004655,
|
|
168
136
|
},
|
|
169
137
|
"openrouter:glm-5": {
|
|
170
138
|
id: "openrouter:glm-5",
|
|
@@ -178,53 +146,17 @@ export const openrouterModelRegistry = {
|
|
|
178
146
|
costPerInputToken: 0.000001,
|
|
179
147
|
costPerOutputToken: 0.0000032,
|
|
180
148
|
},
|
|
181
|
-
"openrouter:
|
|
182
|
-
id: "openrouter:
|
|
183
|
-
provider: "openrouter",
|
|
184
|
-
contextWindow: 262144,
|
|
185
|
-
maxOutputTokens: 65536,
|
|
186
|
-
defaultTemperature: -1,
|
|
187
|
-
promptFormat: "markdown",
|
|
188
|
-
supportsReasoning: false,
|
|
189
|
-
supportsToolCalling: true,
|
|
190
|
-
costPerInputToken: 0.00000007,
|
|
191
|
-
costPerOutputToken: 0.0000003,
|
|
192
|
-
},
|
|
193
|
-
"openrouter:gpt-5.1-codex-mini": {
|
|
194
|
-
id: "openrouter:gpt-5.1-codex-mini",
|
|
195
|
-
provider: "openrouter",
|
|
196
|
-
contextWindow: 400000,
|
|
197
|
-
maxOutputTokens: 100000,
|
|
198
|
-
defaultTemperature: -1,
|
|
199
|
-
promptFormat: "xml",
|
|
200
|
-
supportsReasoning: true,
|
|
201
|
-
supportsToolCalling: true,
|
|
202
|
-
costPerInputToken: 0.00000025,
|
|
203
|
-
costPerOutputToken: 0.000002,
|
|
204
|
-
},
|
|
205
|
-
"openrouter:gpt-5.1-codex-max": {
|
|
206
|
-
id: "openrouter:gpt-5.1-codex-max",
|
|
207
|
-
provider: "openrouter",
|
|
208
|
-
contextWindow: 400000,
|
|
209
|
-
maxOutputTokens: 128000,
|
|
210
|
-
defaultTemperature: -1,
|
|
211
|
-
promptFormat: "xml",
|
|
212
|
-
supportsReasoning: true,
|
|
213
|
-
supportsToolCalling: true,
|
|
214
|
-
costPerInputToken: 0.00000125,
|
|
215
|
-
costPerOutputToken: 0.00001,
|
|
216
|
-
},
|
|
217
|
-
"openrouter:grok-code-fast-1": {
|
|
218
|
-
id: "openrouter:grok-code-fast-1",
|
|
149
|
+
"openrouter:glm-5-1": {
|
|
150
|
+
id: "openrouter:glm-5-1",
|
|
219
151
|
provider: "openrouter",
|
|
220
|
-
contextWindow:
|
|
221
|
-
maxOutputTokens:
|
|
152
|
+
contextWindow: 202752,
|
|
153
|
+
maxOutputTokens: 202752,
|
|
222
154
|
defaultTemperature: 0.5,
|
|
223
155
|
promptFormat: "markdown",
|
|
224
156
|
supportsReasoning: true,
|
|
225
157
|
supportsToolCalling: true,
|
|
226
|
-
costPerInputToken: 0.
|
|
227
|
-
costPerOutputToken: 0.
|
|
158
|
+
costPerInputToken: 0.0000014,
|
|
159
|
+
costPerOutputToken: 0.0000044,
|
|
228
160
|
},
|
|
229
161
|
"openrouter:gpt-oss-120b": {
|
|
230
162
|
id: "openrouter:gpt-oss-120b",
|
|
@@ -238,18 +170,6 @@ export const openrouterModelRegistry = {
|
|
|
238
170
|
costPerInputToken: 0.00000007256312,
|
|
239
171
|
costPerOutputToken: 0.0000002903936,
|
|
240
172
|
},
|
|
241
|
-
"openrouter:grok-4-1-fast": {
|
|
242
|
-
id: "openrouter:grok-4-1-fast",
|
|
243
|
-
provider: "openrouter",
|
|
244
|
-
contextWindow: 2000000,
|
|
245
|
-
maxOutputTokens: 30000,
|
|
246
|
-
defaultTemperature: 0.5,
|
|
247
|
-
promptFormat: "markdown",
|
|
248
|
-
supportsReasoning: true,
|
|
249
|
-
supportsToolCalling: true,
|
|
250
|
-
costPerInputToken: 0.0000002,
|
|
251
|
-
costPerOutputToken: 0.0000005,
|
|
252
|
-
},
|
|
253
173
|
"openrouter:haiku-4.5": {
|
|
254
174
|
id: "openrouter:haiku-4.5",
|
|
255
175
|
provider: "openrouter",
|
|
@@ -262,30 +182,6 @@ export const openrouterModelRegistry = {
|
|
|
262
182
|
costPerInputToken: 0.000001,
|
|
263
183
|
costPerOutputToken: 0.000005,
|
|
264
184
|
},
|
|
265
|
-
"openrouter:gpt-5.2": {
|
|
266
|
-
id: "openrouter:gpt-5.2",
|
|
267
|
-
provider: "openrouter",
|
|
268
|
-
contextWindow: 400000,
|
|
269
|
-
maxOutputTokens: 128000,
|
|
270
|
-
defaultTemperature: 1.0,
|
|
271
|
-
promptFormat: "xml",
|
|
272
|
-
supportsReasoning: true,
|
|
273
|
-
supportsToolCalling: true,
|
|
274
|
-
costPerInputToken: 0.00000175,
|
|
275
|
-
costPerOutputToken: 0.000014,
|
|
276
|
-
},
|
|
277
|
-
"openrouter:gpt-5.2-codex": {
|
|
278
|
-
id: "openrouter:gpt-5.2-codex",
|
|
279
|
-
provider: "openrouter",
|
|
280
|
-
contextWindow: 400000,
|
|
281
|
-
maxOutputTokens: 128000,
|
|
282
|
-
defaultTemperature: -1,
|
|
283
|
-
promptFormat: "xml",
|
|
284
|
-
supportsReasoning: true,
|
|
285
|
-
supportsToolCalling: true,
|
|
286
|
-
costPerInputToken: 0.00000175,
|
|
287
|
-
costPerOutputToken: 0.000014,
|
|
288
|
-
},
|
|
289
185
|
"openrouter:gpt-5-3-codex": {
|
|
290
186
|
id: "openrouter:gpt-5-3-codex",
|
|
291
187
|
provider: "openrouter",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
declare const providers: readonly ["anthropic", "openai", "google", "groq", "deepseek", "openrouter", "xai", "opencode"];
|
|
1
|
+
declare const providers: readonly ["anthropic", "openai", "google", "groq", "deepseek", "openrouter", "xai", "opencode", "opencode-go"];
|
|
2
2
|
type ModelProvider = (typeof providers)[number];
|
|
3
|
-
export declare const models: readonly ("anthropic:
|
|
4
|
-
export type ModelName = (typeof models)[number] | (`xai:${string}` & {}) | (`openai:${string}` & {}) | (`anthropic:${string}` & {}) | (`google:${string}` & {}) | (`groq:${string}` & {}) | (`deepseek:${string}` & {}) | (`openrouter:${string}` & {}) | (`opencode:${string}` & {});
|
|
3
|
+
export declare const models: readonly ("anthropic:haiku" | "anthropic:opus" | "anthropic:sonnet" | "deepseek:deepseek-v4-flash" | "deepseek:deepseek-v4-pro" | "openai:gpt-5.1-codex-mini" | "openai:gpt-5.2" | "openai:gpt-5.2-codex" | "opencode-go:deepseek-v4-flash" | "opencode-go:deepseek-v4-pro" | "opencode-go:glm-5" | "opencode-go:mimo-v2-pro" | "opencode-go:mimo-v2-omni" | "opencode-go:qwen3.6-plus" | "opencode-go:qwen3.5-plus" | "opencode-go:glm-5-1" | "opencode-go:kimi-k2-5" | "opencode-go:kimi-k2-6" | "opencode-go:minimax-m2-5" | "opencode-go:minimax-m2-7" | "opencode-go:mimo-v2-5" | "opencode-go:mimo-v2-5-pro" | "opencode:glm-5" | "opencode:minimax-m2.5" | "opencode:minimax-m2.7" | "opencode:glm-5-1" | "opencode:kimi-k2-5" | "opencode:kimi-k2-6" | "opencode:opus-4-6" | "openrouter:glm-5" | "openrouter:glm-5-1" | "openrouter:kimi-k2-5" | "openrouter:kimi-k2-6" | "openrouter:minimax-m2-5" | "openrouter:minimax-m2-7" | "openrouter:gpt-oss-120b" | "openrouter:gpt-5-3-codex" | "openrouter:sonnet-4.5" | "openrouter:opus-4.6" | "openrouter:owl-alpha" | "openrouter:haiku-4.5" | "xai:grok-4-1-fast")[];
|
|
4
|
+
export type ModelName = (typeof models)[number] | (`xai:${string}` & {}) | (`openai:${string}` & {}) | (`anthropic:${string}` & {}) | (`google:${string}` & {}) | (`groq:${string}` & {}) | (`deepseek:${string}` & {}) | (`openrouter:${string}` & {}) | (`opencode-go:${string}` & {}) | (`opencode:${string}` & {});
|
|
5
5
|
export declare function isSupportedModel(model: unknown): model is ModelName;
|
|
6
6
|
export declare function languageModel(model: ModelName): import("@ai-sdk/provider").LanguageModelV3;
|
|
7
7
|
export interface ModelMetadata<T = ModelName> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../source/models/providers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../source/models/providers.ts"],"names":[],"mappings":"AAgDA,QAAA,MAAM,SAAS,gHAUL,CAAC;AAEX,KAAK,aAAa,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AAchD,eAAO,MAAM,MAAM,gkCAUT,CAAC;AAEX,MAAM,MAAM,SAAS,GACjB,CAAC,OAAO,MAAM,CAAC,CAAC,MAAM,CAAC,GACvB,CAAC,OAAO,MAAM,EAAE,GAAG,EAAE,CAAC,GACtB,CAAC,UAAU,MAAM,EAAE,GAAG,EAAE,CAAC,GACzB,CAAC,aAAa,MAAM,EAAE,GAAG,EAAE,CAAC,GAC5B,CAAC,UAAU,MAAM,EAAE,GAAG,EAAE,CAAC,GACzB,CAAC,QAAQ,MAAM,EAAE,GAAG,EAAE,CAAC,GACvB,CAAC,YAAY,MAAM,EAAE,GAAG,EAAE,CAAC,GAC3B,CAAC,cAAc,MAAM,EAAE,GAAG,EAAE,CAAC,GAC7B,CAAC,eAAe,MAAM,EAAE,GAAG,EAAE,CAAC,GAC9B,CAAC,YAAY,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;AAEhC,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,SAAS,CAcnE;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,SAAS,8CAE7C;AAED,MAAM,WAAW,aAAa,CAAC,CAAC,GAAG,SAAS;IAC1C,EAAE,EAAE,CAAC,CAAC;IACN,QAAQ,EAAE,aAAa,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,YAAY,EAAE,KAAK,GAAG,UAAU,GAAG,SAAS,CAAC;CAC9C;AAGD,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,SAAS,EAAE,aAAa,CAU1D,CAAC;AAGF,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,IAAI,SAAS,CAEtE"}
|
package/dist/models/providers.js
CHANGED
|
@@ -5,6 +5,7 @@ import { deepseekModelNames, deepseekModelRegistry, deepseekProvider, } from "./
|
|
|
5
5
|
import { googleModelNames, googleModelRegistry, googleProvider, } from "./google-provider.js";
|
|
6
6
|
import { groqModelNames, groqModelRegistry, groqProvider, } from "./groq-provider.js";
|
|
7
7
|
import { openaiModelNames, openaiModelRegistry, openaiProvider, } from "./openai-provider.js";
|
|
8
|
+
import { opencodeGoModelNames, opencodeGoModelRegistry, opencodeGoProvider, } from "./opencode-go-provider.js";
|
|
8
9
|
import { opencodeZenModelNames, opencodeZenModelRegistry, opencodeZenProvider, } from "./opencode-zen-provider.js";
|
|
9
10
|
import { openrouterModelNames, openrouterModelRegistry, openrouterProvider, } from "./openrouter-provider.js";
|
|
10
11
|
import { xaiModelNames, xaiModelRegistry, xaiProvider, } from "./xai-provider.js";
|
|
@@ -17,6 +18,7 @@ const providers = [
|
|
|
17
18
|
"openrouter",
|
|
18
19
|
"xai",
|
|
19
20
|
"opencode",
|
|
21
|
+
"opencode-go",
|
|
20
22
|
];
|
|
21
23
|
const registry = createProviderRegistry({
|
|
22
24
|
...anthropicProvider,
|
|
@@ -26,6 +28,7 @@ const registry = createProviderRegistry({
|
|
|
26
28
|
...openaiProvider,
|
|
27
29
|
...openrouterProvider,
|
|
28
30
|
...xaiProvider,
|
|
31
|
+
...opencodeGoProvider,
|
|
29
32
|
...opencodeZenProvider,
|
|
30
33
|
});
|
|
31
34
|
export const models = [
|
|
@@ -36,6 +39,7 @@ export const models = [
|
|
|
36
39
|
...deepseekModelNames,
|
|
37
40
|
...openrouterModelNames,
|
|
38
41
|
...xaiModelNames,
|
|
42
|
+
...opencodeGoModelNames,
|
|
39
43
|
...opencodeZenModelNames,
|
|
40
44
|
];
|
|
41
45
|
export function isSupportedModel(model) {
|
|
@@ -48,6 +52,7 @@ export function isSupportedModel(model) {
|
|
|
48
52
|
model.startsWith("groq:") ||
|
|
49
53
|
model.startsWith("xai:") ||
|
|
50
54
|
model.startsWith("deepseek:") ||
|
|
55
|
+
model.startsWith("opencode-go:") ||
|
|
51
56
|
model.startsWith("opencode:"))));
|
|
52
57
|
}
|
|
53
58
|
export function languageModel(model) {
|
|
@@ -62,6 +67,7 @@ export const modelRegistry = {
|
|
|
62
67
|
...deepseekModelRegistry,
|
|
63
68
|
...openrouterModelRegistry,
|
|
64
69
|
...xaiModelRegistry,
|
|
70
|
+
...opencodeGoModelRegistry,
|
|
65
71
|
...opencodeZenModelRegistry,
|
|
66
72
|
};
|
|
67
73
|
// Check if a model name is valid
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import type { ModelMetadata } from "./providers.ts";
|
|
2
2
|
declare const xaiModels: {
|
|
3
3
|
readonly "grok-4-1-fast": import("@ai-sdk/provider").LanguageModelV3;
|
|
4
|
-
readonly "grok-code-fast-1": import("@ai-sdk/provider").LanguageModelV3;
|
|
5
4
|
};
|
|
6
5
|
type ModelName = `xai:${keyof typeof xaiModels}`;
|
|
7
6
|
export declare const xaiModelNames: ModelName[];
|
|
8
7
|
export declare const xaiProvider: {
|
|
9
8
|
xai: import("@ai-sdk/provider").ProviderV3 & {
|
|
10
|
-
languageModel(modelId: "grok-
|
|
9
|
+
languageModel(modelId: "grok-4-1-fast"): import("@ai-sdk/provider").LanguageModelV3;
|
|
11
10
|
embeddingModel(modelId: string): import("@ai-sdk/provider").EmbeddingModelV3;
|
|
12
11
|
imageModel(modelId: string): import("@ai-sdk/provider").ImageModelV3;
|
|
13
12
|
transcriptionModel(modelId: string): import("@ai-sdk/provider").TranscriptionModelV3;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xai-provider.d.ts","sourceRoot":"","sources":["../../source/models/xai-provider.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAQpD,QAAA,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"xai-provider.d.ts","sourceRoot":"","sources":["../../source/models/xai-provider.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAQpD,QAAA,MAAM,SAAS;;CAEL,CAAC;AAEX,KAAK,SAAS,GAAG,OAAO,MAAM,OAAO,SAAS,EAAE,CAAC;AAEjD,eAAO,MAAM,aAAa,EAAE,SAAS,EAEpC,CAAC;AAEF,eAAO,MAAM,WAAW;;;;;;;;;;CAKvB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE;KAC5B,CAAC,IAAI,SAAS,GAAG,aAAa,CAAC,SAAS,CAAC;CAc3C,CAAC"}
|
|
@@ -8,7 +8,6 @@ const xaiClient = createOpenAI({
|
|
|
8
8
|
});
|
|
9
9
|
const xaiModels = {
|
|
10
10
|
"grok-4-1-fast": xaiClient("grok-4.1-fast"),
|
|
11
|
-
"grok-code-fast-1": xaiClient("grok-code-fast-1"),
|
|
12
11
|
};
|
|
13
12
|
export const xaiModelNames = objectKeys(xaiModels).map((key) => `xai:${key}`);
|
|
14
13
|
export const xaiProvider = {
|
|
@@ -30,16 +29,4 @@ export const xaiModelRegistry = {
|
|
|
30
29
|
costPerInputToken: 0.0000002,
|
|
31
30
|
costPerOutputToken: 0.0000005,
|
|
32
31
|
},
|
|
33
|
-
"xai:grok-code-fast-1": {
|
|
34
|
-
id: "xai:grok-code-fast-1",
|
|
35
|
-
provider: "xai",
|
|
36
|
-
contextWindow: 256000,
|
|
37
|
-
maxOutputTokens: 10000,
|
|
38
|
-
defaultTemperature: -1,
|
|
39
|
-
promptFormat: "markdown",
|
|
40
|
-
supportsReasoning: true,
|
|
41
|
-
supportsToolCalling: true,
|
|
42
|
-
costPerInputToken: 0.0000002,
|
|
43
|
-
costPerOutputToken: 0.0000015,
|
|
44
|
-
},
|
|
45
32
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../source/prompts/manager.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAY,gBAAgB,EAAE,MAAM,IAAI,CAAC;AACrD,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,MAAM,MAAM,WAAW,GAAG,sBAAsB,CAAC;AAEjD,MAAM,WAAW,gBAAgB;IAC/B,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,GAAG,IAAI,MAAM,CAAC;IACd,cAAc,IAAI,gBAAgB,CAAC;IACnC,SAAS,IAAI,OAAO,CAAC;IACrB,UAAU,CAAC,IAAI,EA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Ac,IAAI,gBAAgB;IAqBlC,OAAO,CAAC,8BAA8B;IAoBtC,SAAS;IAIT,UAAU,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI;IAInC,UAAU;IAIV,YAAY;IAIZ,QAAQ;IAKR,oBAAoB,IAAI,MAAM;CAY/B"}
|
package/dist/prompts/manager.js
CHANGED
|
@@ -17,11 +17,15 @@ export class PromptManager {
|
|
|
17
17
|
if (isString(prompt) && prompt.trim().length > 0) {
|
|
18
18
|
return prompt;
|
|
19
19
|
}
|
|
20
|
+
if (this.hasContext()) {
|
|
21
|
+
return prompt ?? "";
|
|
22
|
+
}
|
|
20
23
|
throw new Error("No prompt available.");
|
|
21
24
|
}
|
|
22
25
|
getUserMessage() {
|
|
23
26
|
const currentPrompt = this.prompt;
|
|
24
|
-
|
|
27
|
+
const hasPrompt = isString(currentPrompt) && currentPrompt.trim().length > 0;
|
|
28
|
+
if (hasPrompt || this.hasContext()) {
|
|
25
29
|
let userMessage;
|
|
26
30
|
if (this.hasContext()) {
|
|
27
31
|
// Pass context items and the prompt string to createUserMessage
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mentions.d.ts","sourceRoot":"","sources":["../../source/prompts/mentions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAG5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAwGhD,wBAAsB,aAAa,CACjC,OAAO,EAAE,MAAM,EACf,EACE,OAAO,EACP,KAAK,EACL,UAAU,GACX,EAAE;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,aAAa,CAAC;IACrB,UAAU,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC,GACA,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,WAAW,EAAE,CAAA;CAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"mentions.d.ts","sourceRoot":"","sources":["../../source/prompts/mentions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAG5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAwGhD,wBAAsB,aAAa,CACjC,OAAO,EAAE,MAAM,EACf,EACE,OAAO,EACP,KAAK,EACL,UAAU,GACX,EAAE;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,aAAa,CAAC;IACrB,UAAU,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC,GACA,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,WAAW,EAAE,CAAA;CAAE,CAAC,CAwFtD"}
|
package/dist/prompts/mentions.js
CHANGED
|
@@ -75,20 +75,31 @@ async function processFileCommand(context) {
|
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
export async function processPrompt(message, { baseDir, model, pasteStore, }) {
|
|
78
|
-
|
|
78
|
+
// Regex matches # followed by a file path:
|
|
79
|
+
// - Can start with . (relative paths like ./file or .hidden)
|
|
80
|
+
// - Can start with / (absolute paths)
|
|
81
|
+
// - Can start with ~ (home directory)
|
|
82
|
+
// - Can start with alphanumeric/underscore (simple filenames)
|
|
83
|
+
// - Path continues with non-whitespace, non-# characters
|
|
84
|
+
// - Does NOT match # followed by just digits (paste placeholder format like [Paste #1])
|
|
85
|
+
// - Does NOT match # followed by digits and dots (version numbers like #1.2.3)
|
|
86
|
+
// - Does NOT match issue references like #123
|
|
87
|
+
const fileRegex = /(?<![a-zA-Z0-9_-])#(?![\d.]+(?:[\s,\]]|$))([./~]?[a-zA-Z0-9_][a-zA-Z0-9_./~-]*|[./~][a-zA-Z0-9_./~-]+)/g;
|
|
79
88
|
// Collect all matches for files
|
|
80
89
|
const fileMatches = Array.from(message.matchAll(fileRegex));
|
|
81
90
|
const mentionProcessingPromises = [];
|
|
91
|
+
const matchStrings = [];
|
|
82
92
|
// Process file references - collect promises
|
|
83
93
|
for (const match of fileMatches) {
|
|
84
|
-
const
|
|
85
|
-
if (
|
|
94
|
+
const filePath = match[1];
|
|
95
|
+
if (filePath) {
|
|
86
96
|
const context = {
|
|
87
97
|
model,
|
|
88
98
|
baseDir,
|
|
89
|
-
match:
|
|
99
|
+
match: filePath,
|
|
90
100
|
};
|
|
91
101
|
mentionProcessingPromises.push(processFileCommand(context));
|
|
102
|
+
matchStrings.push(match[0]); // Store the full match including #
|
|
92
103
|
}
|
|
93
104
|
}
|
|
94
105
|
let processedMessage = message;
|
|
@@ -110,9 +121,27 @@ export async function processPrompt(message, { baseDir, model, pasteStore, }) {
|
|
|
110
121
|
// Wait for all mentions to be processed
|
|
111
122
|
const mentionResults = await Promise.all(mentionProcessingPromises);
|
|
112
123
|
const context = [];
|
|
113
|
-
|
|
114
|
-
|
|
124
|
+
// Remove file references from message and add contents to context
|
|
125
|
+
for (let i = 0; i < mentionResults.length; i++) {
|
|
126
|
+
const fileContent = mentionResults[i];
|
|
127
|
+
const matchString = matchStrings[i];
|
|
128
|
+
// Add file content to context
|
|
129
|
+
context.push(fileContent);
|
|
130
|
+
// Remove the #filepath reference from the message
|
|
131
|
+
processedMessage = processedMessage.replace(matchString, "");
|
|
115
132
|
}
|
|
133
|
+
// Clean up multiple spaces left by removals, but preserve newlines
|
|
134
|
+
// First, normalize line endings to \n
|
|
135
|
+
processedMessage = processedMessage
|
|
136
|
+
.replace(/\r\n/g, "\n")
|
|
137
|
+
.replace(/\r/g, "\n");
|
|
138
|
+
// Replace multiple spaces with a single space (but not newlines)
|
|
139
|
+
processedMessage = processedMessage.replace(/[ \t]+/g, " ");
|
|
140
|
+
// Trim whitespace from each line while preserving empty lines
|
|
141
|
+
processedMessage = processedMessage
|
|
142
|
+
.split("\n")
|
|
143
|
+
.map((line) => line.trim())
|
|
144
|
+
.join("\n");
|
|
116
145
|
return {
|
|
117
146
|
message: processedMessage,
|
|
118
147
|
context,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system-prompt.d.ts","sourceRoot":"","sources":["../../source/prompts/system-prompt.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAI3D,KAAK,sBAAsB,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;
|
|
1
|
+
{"version":3,"file":"system-prompt.d.ts","sourceRoot":"","sources":["../../source/prompts/system-prompt.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAI3D,KAAK,sBAAsB,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AA8CF,wBAAsB,eAAe,CACnC,iBAAiB,EAAE,MAAM,EACzB,WAAW,EAAE,MAAM,EAAE,EACrB,QAAQ,CAAC,EAAE,MAAM,mBA+BlB;AAED,KAAK,mBAAmB,GAAG;IACzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAClC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,KAAK,kBAAkB,GAAG;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,sBAAsB,CAAC;CACpC,CAAC;AAKF,wBAAsB,YAAY,CAChC,OAAO,CAAC,EAAE,mBAAmB,GAC5B,OAAO,CAAC,kBAAkB,CAAC,CAkL7B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { platform } from "node:os";
|
|
2
|
-
import { config } from "../config/index.js";
|
|
2
|
+
import { config, parseSkillsPath } from "../config/index.js";
|
|
3
3
|
import { formatSkillsForPrompt, loadSkills } from "../skills/index.js";
|
|
4
4
|
import { formatSubagentsForPrompt, loadSubagents } from "../subagents/index.js";
|
|
5
5
|
import { getShell } from "../terminal/index.js";
|
|
@@ -8,22 +8,27 @@ import { getCurrentBranch, inGitDirectory } from "../utils/git.js";
|
|
|
8
8
|
async function getProjectContext() {
|
|
9
9
|
const agentsFiles = await config.readAgentsFiles();
|
|
10
10
|
const userAgentsFile = agentsFiles.find((f) => f.path === "~/.acai/AGENTS.md");
|
|
11
|
+
const configAgentsFile = agentsFiles.find((f) => f.path === "~/.config/AGENTS.md");
|
|
11
12
|
const cwdAgentsFile = agentsFiles.find((f) => f.path === "./AGENTS.md");
|
|
12
13
|
const userRules = (userAgentsFile?.content ?? "").trim();
|
|
14
|
+
const configRules = (configAgentsFile?.content ?? "").trim();
|
|
13
15
|
const cwdRules = (cwdAgentsFile?.content ?? "").trim();
|
|
14
16
|
const learnedRules = (await config.readLearnedRulesFile()).trim();
|
|
15
17
|
let result = "";
|
|
16
|
-
if (userRules || cwdRules) {
|
|
18
|
+
if (userRules || configRules || cwdRules) {
|
|
17
19
|
result += "## Project Context:\n\n";
|
|
18
20
|
if (userRules) {
|
|
19
21
|
result += `### ~/.acai/AGENTS.md\n\n<instructions>\n${userRules}\n</instructions>\n\n`;
|
|
20
22
|
}
|
|
23
|
+
if (configRules) {
|
|
24
|
+
result += `### ~/.config/AGENTS.md\n\n<instructions>\n${configRules}\n</instructions>\n\n`;
|
|
25
|
+
}
|
|
21
26
|
if (cwdRules) {
|
|
22
27
|
result += `### ./AGENTS.md\n\n<instructions>\n${cwdRules}\n</instructions>\n\n`;
|
|
23
28
|
}
|
|
24
29
|
}
|
|
25
30
|
if (learnedRules) {
|
|
26
|
-
if (!userRules && !cwdRules) {
|
|
31
|
+
if (!userRules && !configRules && !cwdRules) {
|
|
27
32
|
result += "## Project Rules:\n\n";
|
|
28
33
|
}
|
|
29
34
|
result += `### Important rules to follow\n\n${learnedRules}`;
|
|
@@ -31,6 +36,7 @@ async function getProjectContext() {
|
|
|
31
36
|
return {
|
|
32
37
|
text: result.trim(),
|
|
33
38
|
userAgentsMd: userRules,
|
|
39
|
+
configAgentsMd: configRules,
|
|
34
40
|
cwdAgentsMd: cwdRules,
|
|
35
41
|
learnedRules: learnedRules,
|
|
36
42
|
};
|
|
@@ -70,12 +76,20 @@ export async function systemPrompt(options) {
|
|
|
70
76
|
const { currentWorkingDir = DEFAULT_WORKING_DIRS, allowedDirs = DEFAULT_ALLOWED_DIR, logsPath, includeRules = true, skillsEnabled = true, minimalPrompt = true, } = options ?? {};
|
|
71
77
|
const projectContextResult = includeRules
|
|
72
78
|
? await getProjectContext()
|
|
73
|
-
: {
|
|
79
|
+
: {
|
|
80
|
+
text: "",
|
|
81
|
+
userAgentsMd: "",
|
|
82
|
+
configAgentsMd: "",
|
|
83
|
+
cwdAgentsMd: "",
|
|
84
|
+
learnedRules: "",
|
|
85
|
+
};
|
|
74
86
|
const projectContextText = projectContextResult.text;
|
|
75
87
|
const environmentInfoText = await environmentInfo(currentWorkingDir, allowedDirs, logsPath);
|
|
76
88
|
let skillsText = "";
|
|
77
89
|
if (skillsEnabled) {
|
|
78
|
-
const
|
|
90
|
+
const appConfig = await config.getConfig();
|
|
91
|
+
const skillPaths = parseSkillsPath(appConfig.skills.path);
|
|
92
|
+
const skills = await loadSkills(skillPaths);
|
|
79
93
|
skillsText = formatSkillsForPrompt(skills.getModelInvocable());
|
|
80
94
|
}
|
|
81
95
|
const subagents = await loadSubagents();
|
|
@@ -210,6 +224,7 @@ DEFAULT TO PARALLEL: Unless you have a specific reason why operations MUST be se
|
|
|
210
224
|
const components = {
|
|
211
225
|
core: `${corePrompt}\n\n${environmentInfoText}`,
|
|
212
226
|
userAgentsMd: projectContextResult.userAgentsMd,
|
|
227
|
+
configAgentsMd: projectContextResult.configAgentsMd,
|
|
213
228
|
cwdAgentsMd: projectContextResult.cwdAgentsMd,
|
|
214
229
|
learnedRules: projectContextResult.learnedRules,
|
|
215
230
|
skills: skillsText,
|
package/dist/repl/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { ConfigManager } from "../config/index.ts";
|
|
|
4
4
|
import type { WorkspaceContext } from "../index.ts";
|
|
5
5
|
import type { ModelManager } from "../models/manager.ts";
|
|
6
6
|
import type { PromptManager } from "../prompts/manager.ts";
|
|
7
|
-
import {
|
|
7
|
+
import type { SessionManager } from "../sessions/manager.ts";
|
|
8
8
|
import type { TokenCounter } from "../tokens/counter.ts";
|
|
9
9
|
import type { TokenTracker } from "../tokens/tracker.ts";
|
|
10
10
|
import type { CompleteToolSet } from "../tools/index.ts";
|
|
@@ -68,7 +68,6 @@ export declare class Repl {
|
|
|
68
68
|
private allThinkingBlocks;
|
|
69
69
|
private allToolExecutions;
|
|
70
70
|
private verboseMode;
|
|
71
|
-
private modeManager;
|
|
72
71
|
private config;
|
|
73
72
|
/** Creates a new Repl instance, initializing the TUI layout and components. */
|
|
74
73
|
constructor(options: ReplOptions);
|
package/dist/repl/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/repl/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,KAAK,EACL,UAAU,EACV,UAAU,EAEX,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAG7D,OAAO,KAAK,EAAU,aAAa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