@blockrun/cc 0.4.0 → 0.5.0
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/dist/commands/start.js +3 -3
- package/dist/proxy/server.d.ts +1 -0
- package/dist/proxy/server.js +10 -0
- package/package.json +1 -1
package/dist/commands/start.js
CHANGED
|
@@ -24,7 +24,7 @@ export async function startCommand(options) {
|
|
|
24
24
|
console.log(`Model: ${chalk.green(model)}`);
|
|
25
25
|
console.log(`Proxy: ${chalk.cyan(`http://localhost:${port}`)}`);
|
|
26
26
|
console.log(`Backend: ${chalk.dim(apiUrl)}\n`);
|
|
27
|
-
const server = createProxy({ port, apiUrl, chain: 'solana' });
|
|
27
|
+
const server = createProxy({ port, apiUrl, chain: 'solana', modelOverride: model });
|
|
28
28
|
launchServer(server, port, shouldLaunch, model);
|
|
29
29
|
}
|
|
30
30
|
else {
|
|
@@ -45,7 +45,7 @@ export async function startCommand(options) {
|
|
|
45
45
|
console.log(`Model: ${chalk.green(model)}`);
|
|
46
46
|
console.log(`Proxy: ${chalk.cyan(`http://localhost:${port}`)}`);
|
|
47
47
|
console.log(`Backend: ${chalk.dim(apiUrl)}\n`);
|
|
48
|
-
const server = createProxy({ port, apiUrl, chain: 'base' });
|
|
48
|
+
const server = createProxy({ port, apiUrl, chain: 'base', modelOverride: model });
|
|
49
49
|
launchServer(server, port, shouldLaunch, model);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
@@ -57,7 +57,7 @@ function launchServer(server, port, shouldLaunch, model) {
|
|
|
57
57
|
const cleanEnv = { ...process.env };
|
|
58
58
|
delete cleanEnv.CLAUDE_ACCESS_TOKEN;
|
|
59
59
|
delete cleanEnv.CLAUDE_OAUTH_TOKEN;
|
|
60
|
-
const claudeArgs = [
|
|
60
|
+
const claudeArgs = [];
|
|
61
61
|
if (model)
|
|
62
62
|
claudeArgs.push('--model', model);
|
|
63
63
|
const claude = spawn('claude', claudeArgs, {
|
package/dist/proxy/server.d.ts
CHANGED
package/dist/proxy/server.js
CHANGED
|
@@ -29,6 +29,16 @@ export function createProxy(options) {
|
|
|
29
29
|
});
|
|
30
30
|
req.on('end', async () => {
|
|
31
31
|
try {
|
|
32
|
+
if (options.modelOverride && body) {
|
|
33
|
+
try {
|
|
34
|
+
const parsed = JSON.parse(body);
|
|
35
|
+
if (parsed.model) {
|
|
36
|
+
parsed.model = options.modelOverride;
|
|
37
|
+
body = JSON.stringify(parsed);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
catch { /* not JSON, pass through */ }
|
|
41
|
+
}
|
|
32
42
|
const headers = {
|
|
33
43
|
'Content-Type': 'application/json',
|
|
34
44
|
};
|