breakroom 2.1.1 → 2.1.3
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/bin/setup.js +78 -9
- package/package.json +1 -1
package/bin/setup.js
CHANGED
|
@@ -55,24 +55,50 @@ const CANDIDATE_FILES = [
|
|
|
55
55
|
['.vscode', 'settings.json'],
|
|
56
56
|
['.vscode', 'mcp.json'],
|
|
57
57
|
['.windsurf', 'settings.json'],
|
|
58
|
+
['.trae', 'settings.json'],
|
|
59
|
+
['.trae', 'mcp.json'],
|
|
60
|
+
['.codex', 'config.json'],
|
|
61
|
+
['.codex', 'setup.json'],
|
|
62
|
+
['.opencode.json'],
|
|
63
|
+
['.opencode.jsonc'],
|
|
64
|
+
['AGENTS.md'],
|
|
65
|
+
['AGENT.md'],
|
|
66
|
+
['.cursorrules'],
|
|
67
|
+
['.windsurfrules'],
|
|
68
|
+
['.openclaw', 'config.yaml'],
|
|
69
|
+
['.openclaw', 'config.yml'],
|
|
70
|
+
['.cline', 'cline.json'],
|
|
71
|
+
['.cline', 'settings.json'],
|
|
72
|
+
['.clinerules'],
|
|
73
|
+
['.cody.json'],
|
|
74
|
+
['.tabby', 'config.json'],
|
|
75
|
+
['.amazonq', 'config.json'],
|
|
76
|
+
['.supermaven', 'config.json'],
|
|
77
|
+
['.augment', 'config.json'],
|
|
78
|
+
['.hermes', 'config.yaml'],
|
|
58
79
|
['litellm.yaml'],
|
|
59
80
|
['litellm.yml'],
|
|
60
81
|
['CLAUDE.md'],
|
|
61
|
-
['.clinerules'],
|
|
62
82
|
['.continuerc.json'],
|
|
63
83
|
['.aider.conf.yml'],
|
|
64
84
|
['.github', 'copilot-instructions.md'],
|
|
65
85
|
['.github', 'copilot-instructions', 'copilot-instructions.md'],
|
|
66
|
-
['.openclaw', 'config.yaml'],
|
|
67
|
-
['.openclaw', 'config.yml'],
|
|
68
86
|
// User-level agent/IDE configs
|
|
69
87
|
[os.homedir(), '.hermes', 'config.yaml'],
|
|
70
88
|
[os.homedir(), '.litellm', 'config.yaml'],
|
|
71
89
|
[os.homedir(), '.claude', 'settings.json'],
|
|
72
90
|
[os.homedir(), '.continue', 'config.json'],
|
|
91
|
+
[os.homedir(), '.codex', 'config.json'],
|
|
92
|
+
[os.homedir(), '.goose', 'config.yaml'],
|
|
93
|
+
[os.homedir(), '.opencode.json'],
|
|
94
|
+
[os.homedir(), '.opencode.jsonc'],
|
|
95
|
+
[os.homedir(), '.config', 'opencode.json'],
|
|
96
|
+
[os.homedir(), '.config', 'opencode.jsonc'],
|
|
73
97
|
[os.homedir(), '.config', 'breakroom', 'config.yaml'],
|
|
74
98
|
[os.homedir(), '.config', 'openclaw', 'config.yaml'],
|
|
75
99
|
[os.homedir(), '.openclaw', 'config.yaml'],
|
|
100
|
+
[os.homedir(), '.config', 'trae', 'config.json'],
|
|
101
|
+
[os.homedir(), '.config', 'codex', 'config.json'],
|
|
76
102
|
];
|
|
77
103
|
|
|
78
104
|
function candidateFiles() {
|
|
@@ -191,12 +217,51 @@ function jsonPatch(text, proxyUrl) {
|
|
|
191
217
|
return null;
|
|
192
218
|
}
|
|
193
219
|
const before = JSON.stringify(parsed, null, 2);
|
|
194
|
-
parsed
|
|
195
|
-
parsed.ANTHROPIC_BASE_URL = proxyUrl;
|
|
220
|
+
for (const k of ALL_BASE_URL_KEYS) { parsed[k] = proxyUrl; }
|
|
196
221
|
const after = `${JSON.stringify(parsed, null, 2)}\n`;
|
|
197
|
-
return { text: after, changed: after.trim() !== before.trim(), summary:
|
|
222
|
+
return { text: after, changed: after.trim() !== before.trim(), summary: `set ${ALL_BASE_URL_KEYS.length} base URL keys` };
|
|
198
223
|
}
|
|
199
224
|
|
|
225
|
+
const ALL_BASE_URL_VARS = [
|
|
226
|
+
'OPENAI_BASE_URL', 'ANTHROPIC_BASE_URL',
|
|
227
|
+
'GOOGLE_API_BASE', 'GEMINI_API_BASE', 'VERTEX_API_BASE',
|
|
228
|
+
'AZURE_OPENAI_ENDPOINT', 'AZURE_OPENAI_BASE_URL',
|
|
229
|
+
'OPENROUTER_BASE_URL',
|
|
230
|
+
'TOGETHER_API_BASE',
|
|
231
|
+
'GROQ_BASE_URL', 'GROQ_API_BASE',
|
|
232
|
+
'DEEPSEEK_BASE_URL', 'DEEPSEEK_API_BASE',
|
|
233
|
+
'MISTRAL_API_URL', 'MISTRAL_BASE_URL',
|
|
234
|
+
'PERPLEXITY_API_BASE', 'PERPLEXITY_BASE_URL',
|
|
235
|
+
'FIREWORKS_API_BASE', 'FIREWORKS_BASE_URL',
|
|
236
|
+
'COHERE_API_URL',
|
|
237
|
+
'AI21_BASE_URL',
|
|
238
|
+
'XAI_BASE_URL', 'XAI_API_BASE',
|
|
239
|
+
'REPLICATE_API_BASE',
|
|
240
|
+
'OPENAI_LIKE_API_BASE',
|
|
241
|
+
'LLM_BASE_URL', 'LLM_API_BASE', 'OPENAI_API_BASE',
|
|
242
|
+
];
|
|
243
|
+
|
|
244
|
+
const ALL_BASE_URL_KEYS = [
|
|
245
|
+
'OPENAI_BASE_URL', 'ANTHROPIC_BASE_URL',
|
|
246
|
+
'GOOGLE_API_BASE', 'GEMINI_API_BASE',
|
|
247
|
+
'AZURE_OPENAI_ENDPOINT',
|
|
248
|
+
'OPENROUTER_BASE_URL',
|
|
249
|
+
'TOGETHER_API_BASE',
|
|
250
|
+
'GROQ_BASE_URL',
|
|
251
|
+
'DEEPSEEK_BASE_URL',
|
|
252
|
+
'MISTRAL_API_URL',
|
|
253
|
+
'PERPLEXITY_API_BASE',
|
|
254
|
+
'FIREWORKS_API_BASE',
|
|
255
|
+
'COHERE_API_URL',
|
|
256
|
+
'AI21_BASE_URL',
|
|
257
|
+
'XAI_BASE_URL',
|
|
258
|
+
'REPLICATE_API_BASE',
|
|
259
|
+
'OPENAI_LIKE_API_BASE',
|
|
260
|
+
'LLM_BASE_URL', 'OPENAI_API_BASE',
|
|
261
|
+
'openAiBaseUrl', 'anthropicBaseUrl',
|
|
262
|
+
'openAiBaseURL', 'anthropicBaseURL',
|
|
263
|
+
];
|
|
264
|
+
|
|
200
265
|
function buildPatch(filePath, proxyUrl) {
|
|
201
266
|
const ext = path.extname(filePath).toLowerCase();
|
|
202
267
|
const basename = path.basename(filePath).toLowerCase();
|
|
@@ -204,9 +269,13 @@ function buildPatch(filePath, proxyUrl) {
|
|
|
204
269
|
const original = exists ? fs.readFileSync(filePath, 'utf8') : '';
|
|
205
270
|
|
|
206
271
|
if (basename.startsWith('.env')) {
|
|
207
|
-
|
|
208
|
-
const
|
|
209
|
-
|
|
272
|
+
let current = original;
|
|
273
|
+
const summaries = [];
|
|
274
|
+
for (const v of ALL_BASE_URL_VARS) {
|
|
275
|
+
const p = linePatch(current, v, proxyUrl);
|
|
276
|
+
if (p.changed) { current = p.text; summaries.push(p.summary); }
|
|
277
|
+
}
|
|
278
|
+
return { filePath, exists, original, updated: current, summaries };
|
|
210
279
|
}
|
|
211
280
|
|
|
212
281
|
if (ext === '.json') {
|