@blockrun/clawrouter 0.9.31 → 0.9.32
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/cli.js +16 -8
- package/dist/cli.js.map +1 -1
- package/dist/index.js +16 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/scripts/reinstall.sh +23 -1
- package/scripts/uninstall.sh +23 -1
package/dist/index.js
CHANGED
|
@@ -223,7 +223,7 @@ var BLOCKRUN_MODELS = [
|
|
|
223
223
|
},
|
|
224
224
|
{
|
|
225
225
|
id: "claude-sonnet-4",
|
|
226
|
-
name: "Claude Sonnet 4",
|
|
226
|
+
name: "Claude Sonnet 4.6",
|
|
227
227
|
inputPrice: 3,
|
|
228
228
|
outputPrice: 15,
|
|
229
229
|
contextWindow: 2e5,
|
|
@@ -233,7 +233,7 @@ var BLOCKRUN_MODELS = [
|
|
|
233
233
|
},
|
|
234
234
|
{
|
|
235
235
|
id: "claude-opus-4",
|
|
236
|
-
name: "Claude Opus 4",
|
|
236
|
+
name: "Claude Opus 4.6",
|
|
237
237
|
inputPrice: 15,
|
|
238
238
|
outputPrice: 75,
|
|
239
239
|
contextWindow: 2e5,
|
|
@@ -4192,6 +4192,19 @@ function buildModelPricing() {
|
|
|
4192
4192
|
}
|
|
4193
4193
|
return map;
|
|
4194
4194
|
}
|
|
4195
|
+
function buildProxyModelList(createdAt = Math.floor(Date.now() / 1e3)) {
|
|
4196
|
+
const seen = /* @__PURE__ */ new Set();
|
|
4197
|
+
return OPENCLAW_MODELS.filter((model) => {
|
|
4198
|
+
if (seen.has(model.id)) return false;
|
|
4199
|
+
seen.add(model.id);
|
|
4200
|
+
return true;
|
|
4201
|
+
}).map((model) => ({
|
|
4202
|
+
id: model.id,
|
|
4203
|
+
object: "model",
|
|
4204
|
+
created: createdAt,
|
|
4205
|
+
owned_by: model.id.includes("/") ? model.id.split("/")[0] ?? "blockrun" : "blockrun"
|
|
4206
|
+
}));
|
|
4207
|
+
}
|
|
4195
4208
|
function mergeRoutingConfig(overrides) {
|
|
4196
4209
|
if (!overrides) return DEFAULT_ROUTING_CONFIG;
|
|
4197
4210
|
return {
|
|
@@ -4317,12 +4330,7 @@ async function startProxy(options) {
|
|
|
4317
4330
|
return;
|
|
4318
4331
|
}
|
|
4319
4332
|
if (req.url === "/v1/models" && req.method === "GET") {
|
|
4320
|
-
const models =
|
|
4321
|
-
id: m.id,
|
|
4322
|
-
object: "model",
|
|
4323
|
-
created: Math.floor(Date.now() / 1e3),
|
|
4324
|
-
owned_by: m.id.split("/")[0] || "unknown"
|
|
4325
|
-
}));
|
|
4333
|
+
const models = buildProxyModelList();
|
|
4326
4334
|
res.writeHead(200, { "Content-Type": "application/json" });
|
|
4327
4335
|
res.end(JSON.stringify({ object: "list", data: models }));
|
|
4328
4336
|
return;
|