@hasna/switcher 0.2.14 → 0.2.15
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/claude-desktop.js +8 -8
- package/dist/cli/index.js +32 -4
- package/dist/index.js +9 -9
- package/dist/mcp/index.js +13 -13
- package/dist/sdk.js +9 -9
- package/dist/serve/index.js +2 -2
- package/openapi.json +1 -1
- package/package.json +5 -2
package/dist/claude-desktop.js
CHANGED
|
@@ -20,7 +20,7 @@ import { lstat as lstat4, opendir as opendir2, realpath as realpath2, stat as st
|
|
|
20
20
|
import { lstatSync as lstatSync3 } from "node:fs";
|
|
21
21
|
import { isAbsolute as isAbsolute3, join as join4, relative as relative2, resolve as resolve3 } from "node:path";
|
|
22
22
|
|
|
23
|
-
//
|
|
23
|
+
// node_modules/zod/v3/external.js
|
|
24
24
|
var exports_external = {};
|
|
25
25
|
__export(exports_external, {
|
|
26
26
|
void: () => voidType,
|
|
@@ -132,7 +132,7 @@ __export(exports_external, {
|
|
|
132
132
|
BRAND: () => BRAND
|
|
133
133
|
});
|
|
134
134
|
|
|
135
|
-
//
|
|
135
|
+
// node_modules/zod/v3/helpers/util.js
|
|
136
136
|
var util;
|
|
137
137
|
(function(util2) {
|
|
138
138
|
util2.assertEqual = (_) => {};
|
|
@@ -263,7 +263,7 @@ var getParsedType = (data) => {
|
|
|
263
263
|
}
|
|
264
264
|
};
|
|
265
265
|
|
|
266
|
-
//
|
|
266
|
+
// node_modules/zod/v3/ZodError.js
|
|
267
267
|
var ZodIssueCode = util.arrayToEnum([
|
|
268
268
|
"invalid_type",
|
|
269
269
|
"invalid_literal",
|
|
@@ -382,7 +382,7 @@ ZodError.create = (issues) => {
|
|
|
382
382
|
return error;
|
|
383
383
|
};
|
|
384
384
|
|
|
385
|
-
//
|
|
385
|
+
// node_modules/zod/v3/locales/en.js
|
|
386
386
|
var errorMap = (issue, _ctx) => {
|
|
387
387
|
let message;
|
|
388
388
|
switch (issue.code) {
|
|
@@ -485,7 +485,7 @@ var errorMap = (issue, _ctx) => {
|
|
|
485
485
|
};
|
|
486
486
|
var en_default = errorMap;
|
|
487
487
|
|
|
488
|
-
//
|
|
488
|
+
// node_modules/zod/v3/errors.js
|
|
489
489
|
var overrideErrorMap = en_default;
|
|
490
490
|
function setErrorMap(map) {
|
|
491
491
|
overrideErrorMap = map;
|
|
@@ -493,7 +493,7 @@ function setErrorMap(map) {
|
|
|
493
493
|
function getErrorMap() {
|
|
494
494
|
return overrideErrorMap;
|
|
495
495
|
}
|
|
496
|
-
//
|
|
496
|
+
// node_modules/zod/v3/helpers/parseUtil.js
|
|
497
497
|
var makeIssue = (params) => {
|
|
498
498
|
const { data, path, errorMaps, issueData } = params;
|
|
499
499
|
const fullPath = [...path, ...issueData.path || []];
|
|
@@ -599,14 +599,14 @@ var isAborted = (x) => x.status === "aborted";
|
|
|
599
599
|
var isDirty = (x) => x.status === "dirty";
|
|
600
600
|
var isValid = (x) => x.status === "valid";
|
|
601
601
|
var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
|
602
|
-
//
|
|
602
|
+
// node_modules/zod/v3/helpers/errorUtil.js
|
|
603
603
|
var errorUtil;
|
|
604
604
|
(function(errorUtil2) {
|
|
605
605
|
errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
|
606
606
|
errorUtil2.toString = (message) => typeof message === "string" ? message : message?.message;
|
|
607
607
|
})(errorUtil || (errorUtil = {}));
|
|
608
608
|
|
|
609
|
-
//
|
|
609
|
+
// node_modules/zod/v3/types.js
|
|
610
610
|
class ParseInputLazyPath {
|
|
611
611
|
constructor(parent, value, path, key) {
|
|
612
612
|
this._cachedPath = [];
|
package/dist/cli/index.js
CHANGED
|
@@ -514,7 +514,7 @@ function canonicalPolicyJSON(value) {
|
|
|
514
514
|
return JSON.stringify(value, (_key, item) => item && typeof item === "object" && !Array.isArray(item) ? Object.fromEntries(Object.entries(item).sort(([a], [b]) => a.localeCompare(b))) : item);
|
|
515
515
|
}
|
|
516
516
|
// package.json
|
|
517
|
-
var version = "0.2.
|
|
517
|
+
var version = "0.2.15";
|
|
518
518
|
|
|
519
519
|
// src/version.ts
|
|
520
520
|
var VERSION = version;
|
|
@@ -2570,7 +2570,7 @@ var openapi_default = {
|
|
|
2570
2570
|
openapi: "3.0.3",
|
|
2571
2571
|
info: {
|
|
2572
2572
|
title: "Switcher API",
|
|
2573
|
-
version: "0.2.
|
|
2573
|
+
version: "0.2.15",
|
|
2574
2574
|
description: "Authenticated provider/profile/catalog control plane. Launches run locally; the API never returns provider credentials."
|
|
2575
2575
|
},
|
|
2576
2576
|
security: [
|
|
@@ -8336,6 +8336,31 @@ var MAX_REQUEST_BODY_BYTES = 64 * 1024 * 1024;
|
|
|
8336
8336
|
var REQUEST_BYTES_PER_CONTEXT_TOKEN = 16;
|
|
8337
8337
|
var CLOSING_MESSAGE = "Switcher gateway: this launch is shutting down. Start a new session with `switcher launch`.";
|
|
8338
8338
|
var PROVIDER_FIX = "Check the provider's status and your network, then retry.";
|
|
8339
|
+
var EXPLAINED_UPSTREAM_STATUSES = new Set([400, 413, 422]);
|
|
8340
|
+
var LARGE_TOOL_COUNT = 128;
|
|
8341
|
+
var LARGE_REQUEST_BYTES = 256 * 1024;
|
|
8342
|
+
function toolDefinitionCount(body) {
|
|
8343
|
+
const record2 = (value) => value && typeof value === "object" && !Array.isArray(value) ? value : undefined;
|
|
8344
|
+
const count = (value) => {
|
|
8345
|
+
if (!value)
|
|
8346
|
+
return 0;
|
|
8347
|
+
let total = Array.isArray(value.functions) ? value.functions.length : 0;
|
|
8348
|
+
for (const tool of Array.isArray(value.tools) ? value.tools : []) {
|
|
8349
|
+
const declarations = record2(tool)?.functionDeclarations ?? record2(tool)?.function_declarations;
|
|
8350
|
+
total += Array.isArray(declarations) ? declarations.length : 1;
|
|
8351
|
+
}
|
|
8352
|
+
return total;
|
|
8353
|
+
};
|
|
8354
|
+
const top = record2(body);
|
|
8355
|
+
return count(top) + count(record2(top?.generateContentRequest));
|
|
8356
|
+
}
|
|
8357
|
+
function upstreamRejectionMessage(status, providerId, sent) {
|
|
8358
|
+
const provider = idSchema.safeParse(providerId).success ? `the provider ${providerId}` : "the provider";
|
|
8359
|
+
const message = `Switcher inference gateway: ${provider} rejected the request with HTTP ${status} (upstream_http_${status}). Switcher sent ${sent.tools} tool definition${sent.tools === 1 ? "" : "s"} in a ${Math.ceil(sent.bytes / 1024)} KB request.`;
|
|
8360
|
+
if (sent.tools <= LARGE_TOOL_COUNT && sent.bytes <= LARGE_REQUEST_BYTES)
|
|
8361
|
+
return message;
|
|
8362
|
+
return `${message} Some providers reject large tool sets or large requests. Start a new session instead of resuming this one, or reduce the MCP servers enabled for this harness.`;
|
|
8363
|
+
}
|
|
8339
8364
|
function requestBodyLimit(models, policy) {
|
|
8340
8365
|
const allowed = new Set(policy.allowedModels);
|
|
8341
8366
|
const contextWindow = Math.max(0, ...models.filter((model) => allowed.has(model.id)).map((model) => Number.isSafeInteger(model.contextWindow) && model.contextWindow > 0 ? model.contextWindow : 0));
|
|
@@ -8480,6 +8505,7 @@ function createInferenceHandler(input, timing = {}, options = {}) {
|
|
|
8480
8505
|
headers["anthropic-beta"] = request.headers.get("anthropic-beta");
|
|
8481
8506
|
}
|
|
8482
8507
|
const candidates = [resolved, ...policy.fallbacks[resolved] ?? []];
|
|
8508
|
+
let sent = { tools: 0, bytes: 0 };
|
|
8483
8509
|
try {
|
|
8484
8510
|
if (candidates.some((model) => !known.has(model) || !policy.allowedModels.includes(model)))
|
|
8485
8511
|
throw new Error("invalid_fallback_policy");
|
|
@@ -8514,8 +8540,10 @@ function createInferenceHandler(input, timing = {}, options = {}) {
|
|
|
8514
8540
|
delete upstreamHeaders["anthropic-beta"];
|
|
8515
8541
|
Object.assign(upstreamHeaders, translated.auth);
|
|
8516
8542
|
}
|
|
8543
|
+
const sentBody = translated?.body ?? outgoing, serialized = JSON.stringify(sentBody);
|
|
8544
|
+
sent = { tools: toolDefinitionCount(sentBody), bytes: Buffer.byteLength(serialized) };
|
|
8517
8545
|
try {
|
|
8518
|
-
response = await activity.run(() => fetch(endpoint(input.baseUrl) + path, { method: "POST", headers: upstreamHeaders, body:
|
|
8546
|
+
response = await activity.run(() => fetch(endpoint(input.baseUrl) + path, { method: "POST", headers: upstreamHeaders, body: serialized, redirect: "manual", ...activity.fetchOptions }));
|
|
8519
8547
|
} catch {
|
|
8520
8548
|
current.reason = activity.timedOut() ? "provider_idle_timeout" : signal.aborted ? "request_cancelled" : "network_error";
|
|
8521
8549
|
throw new Error("provider_request_failed");
|
|
@@ -8546,7 +8574,7 @@ function createInferenceHandler(input, timing = {}, options = {}) {
|
|
|
8546
8574
|
return Response.json({ type: "error", error: { type: "invalid_request_error", code: "context_length_exceeded", message: "prompt is too long: the provider context window was exceeded. Compact the conversation or start a new session." } }, { status: 400 });
|
|
8547
8575
|
if (paymentRequired)
|
|
8548
8576
|
return fail(402, "provider_payment_required", "The selected provider rejected this request for billing or credit limits (HTTP 402). Check the account balance, API-key spending limit, and requested output-token budget before retrying.");
|
|
8549
|
-
const rejected = fail(response.status >= 300 && response.status < 400 ? 502 : response.status, `upstream_http_${response.status}
|
|
8577
|
+
const rejected = fail(response.status >= 300 && response.status < 400 ? 502 : response.status, `upstream_http_${response.status}`, EXPLAINED_UPSTREAM_STATUSES.has(response.status) ? upstreamRejectionMessage(response.status, input.providerId, sent) : undefined);
|
|
8550
8578
|
const retryAfter = response.headers.get("retry-after");
|
|
8551
8579
|
if ((response.status === 429 || response.status === 503) && retryAfter && retryAfter.length <= 128 && (/^\d+$/.test(retryAfter) || Number.isFinite(Date.parse(retryAfter))))
|
|
8552
8580
|
rejected.headers.set("retry-after", retryAfter);
|
package/dist/index.js
CHANGED
|
@@ -13,7 +13,7 @@ var __export = (target, all) => {
|
|
|
13
13
|
});
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
//
|
|
16
|
+
// node_modules/zod/v3/external.js
|
|
17
17
|
var exports_external = {};
|
|
18
18
|
__export(exports_external, {
|
|
19
19
|
void: () => voidType,
|
|
@@ -125,7 +125,7 @@ __export(exports_external, {
|
|
|
125
125
|
BRAND: () => BRAND
|
|
126
126
|
});
|
|
127
127
|
|
|
128
|
-
//
|
|
128
|
+
// node_modules/zod/v3/helpers/util.js
|
|
129
129
|
var util;
|
|
130
130
|
(function(util2) {
|
|
131
131
|
util2.assertEqual = (_) => {};
|
|
@@ -256,7 +256,7 @@ var getParsedType = (data) => {
|
|
|
256
256
|
}
|
|
257
257
|
};
|
|
258
258
|
|
|
259
|
-
//
|
|
259
|
+
// node_modules/zod/v3/ZodError.js
|
|
260
260
|
var ZodIssueCode = util.arrayToEnum([
|
|
261
261
|
"invalid_type",
|
|
262
262
|
"invalid_literal",
|
|
@@ -375,7 +375,7 @@ ZodError.create = (issues) => {
|
|
|
375
375
|
return error;
|
|
376
376
|
};
|
|
377
377
|
|
|
378
|
-
//
|
|
378
|
+
// node_modules/zod/v3/locales/en.js
|
|
379
379
|
var errorMap = (issue, _ctx) => {
|
|
380
380
|
let message;
|
|
381
381
|
switch (issue.code) {
|
|
@@ -478,7 +478,7 @@ var errorMap = (issue, _ctx) => {
|
|
|
478
478
|
};
|
|
479
479
|
var en_default = errorMap;
|
|
480
480
|
|
|
481
|
-
//
|
|
481
|
+
// node_modules/zod/v3/errors.js
|
|
482
482
|
var overrideErrorMap = en_default;
|
|
483
483
|
function setErrorMap(map) {
|
|
484
484
|
overrideErrorMap = map;
|
|
@@ -486,7 +486,7 @@ function setErrorMap(map) {
|
|
|
486
486
|
function getErrorMap() {
|
|
487
487
|
return overrideErrorMap;
|
|
488
488
|
}
|
|
489
|
-
//
|
|
489
|
+
// node_modules/zod/v3/helpers/parseUtil.js
|
|
490
490
|
var makeIssue = (params) => {
|
|
491
491
|
const { data, path, errorMaps, issueData } = params;
|
|
492
492
|
const fullPath = [...path, ...issueData.path || []];
|
|
@@ -592,14 +592,14 @@ var isAborted = (x) => x.status === "aborted";
|
|
|
592
592
|
var isDirty = (x) => x.status === "dirty";
|
|
593
593
|
var isValid = (x) => x.status === "valid";
|
|
594
594
|
var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
|
595
|
-
//
|
|
595
|
+
// node_modules/zod/v3/helpers/errorUtil.js
|
|
596
596
|
var errorUtil;
|
|
597
597
|
(function(errorUtil2) {
|
|
598
598
|
errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
|
599
599
|
errorUtil2.toString = (message) => typeof message === "string" ? message : message?.message;
|
|
600
600
|
})(errorUtil || (errorUtil = {}));
|
|
601
601
|
|
|
602
|
-
//
|
|
602
|
+
// node_modules/zod/v3/types.js
|
|
603
603
|
class ParseInputLazyPath {
|
|
604
604
|
constructor(parent, value, path, key) {
|
|
605
605
|
this._cachedPath = [];
|
|
@@ -4200,7 +4200,7 @@ async function boundedJson(response, maxBytes = MAX_BYTES) {
|
|
|
4200
4200
|
}
|
|
4201
4201
|
}
|
|
4202
4202
|
|
|
4203
|
-
//
|
|
4203
|
+
// node_modules/@hasna/contracts/dist/client/transport.js
|
|
4204
4204
|
import { isIP } from "net";
|
|
4205
4205
|
import { spawnSync } from "child_process";
|
|
4206
4206
|
import { closeSync as closeSync2, fstatSync as fstatSync2, openSync as openSync2, readFileSync as readFileSync2 } from "fs";
|
package/dist/mcp/index.js
CHANGED
|
@@ -19,7 +19,7 @@ var __export = (target, all) => {
|
|
|
19
19
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
20
20
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
21
21
|
|
|
22
|
-
//
|
|
22
|
+
// node_modules/zod/v3/external.js
|
|
23
23
|
var exports_external = {};
|
|
24
24
|
__export(exports_external, {
|
|
25
25
|
void: () => voidType,
|
|
@@ -131,7 +131,7 @@ __export(exports_external, {
|
|
|
131
131
|
BRAND: () => BRAND
|
|
132
132
|
});
|
|
133
133
|
|
|
134
|
-
//
|
|
134
|
+
// node_modules/zod/v3/helpers/util.js
|
|
135
135
|
var util;
|
|
136
136
|
(function(util2) {
|
|
137
137
|
util2.assertEqual = (_) => {};
|
|
@@ -262,7 +262,7 @@ var getParsedType = (data) => {
|
|
|
262
262
|
}
|
|
263
263
|
};
|
|
264
264
|
|
|
265
|
-
//
|
|
265
|
+
// node_modules/zod/v3/ZodError.js
|
|
266
266
|
var ZodIssueCode = util.arrayToEnum([
|
|
267
267
|
"invalid_type",
|
|
268
268
|
"invalid_literal",
|
|
@@ -381,7 +381,7 @@ ZodError.create = (issues) => {
|
|
|
381
381
|
return error;
|
|
382
382
|
};
|
|
383
383
|
|
|
384
|
-
//
|
|
384
|
+
// node_modules/zod/v3/locales/en.js
|
|
385
385
|
var errorMap = (issue, _ctx) => {
|
|
386
386
|
let message;
|
|
387
387
|
switch (issue.code) {
|
|
@@ -484,7 +484,7 @@ var errorMap = (issue, _ctx) => {
|
|
|
484
484
|
};
|
|
485
485
|
var en_default = errorMap;
|
|
486
486
|
|
|
487
|
-
//
|
|
487
|
+
// node_modules/zod/v3/errors.js
|
|
488
488
|
var overrideErrorMap = en_default;
|
|
489
489
|
function setErrorMap(map) {
|
|
490
490
|
overrideErrorMap = map;
|
|
@@ -492,7 +492,7 @@ function setErrorMap(map) {
|
|
|
492
492
|
function getErrorMap() {
|
|
493
493
|
return overrideErrorMap;
|
|
494
494
|
}
|
|
495
|
-
//
|
|
495
|
+
// node_modules/zod/v3/helpers/parseUtil.js
|
|
496
496
|
var makeIssue = (params) => {
|
|
497
497
|
const { data, path, errorMaps, issueData } = params;
|
|
498
498
|
const fullPath = [...path, ...issueData.path || []];
|
|
@@ -598,14 +598,14 @@ var isAborted = (x) => x.status === "aborted";
|
|
|
598
598
|
var isDirty = (x) => x.status === "dirty";
|
|
599
599
|
var isValid = (x) => x.status === "valid";
|
|
600
600
|
var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
|
601
|
-
//
|
|
601
|
+
// node_modules/zod/v3/helpers/errorUtil.js
|
|
602
602
|
var errorUtil;
|
|
603
603
|
(function(errorUtil2) {
|
|
604
604
|
errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
|
605
605
|
errorUtil2.toString = (message) => typeof message === "string" ? message : message?.message;
|
|
606
606
|
})(errorUtil || (errorUtil = {}));
|
|
607
607
|
|
|
608
|
-
//
|
|
608
|
+
// node_modules/zod/v3/types.js
|
|
609
609
|
class ParseInputLazyPath {
|
|
610
610
|
constructor(parent, value, path, key) {
|
|
611
611
|
this._cachedPath = [];
|
|
@@ -4049,7 +4049,7 @@ function canonicalPolicyJSON(value) {
|
|
|
4049
4049
|
return JSON.stringify(value, (_key, item) => item && typeof item === "object" && !Array.isArray(item) ? Object.fromEntries(Object.entries(item).sort(([a], [b]) => a.localeCompare(b))) : item);
|
|
4050
4050
|
}
|
|
4051
4051
|
// package.json
|
|
4052
|
-
var version = "0.2.
|
|
4052
|
+
var version = "0.2.15";
|
|
4053
4053
|
|
|
4054
4054
|
// src/version.ts
|
|
4055
4055
|
var VERSION = version;
|
|
@@ -4243,7 +4243,7 @@ async function boundedJson(response, maxBytes = MAX_BYTES) {
|
|
|
4243
4243
|
}
|
|
4244
4244
|
}
|
|
4245
4245
|
|
|
4246
|
-
//
|
|
4246
|
+
// node_modules/@hasna/contracts/dist/client/transport.js
|
|
4247
4247
|
import { isIP } from "net";
|
|
4248
4248
|
import { spawnSync } from "child_process";
|
|
4249
4249
|
import { closeSync as closeSync2, fstatSync as fstatSync2, openSync as openSync2, readFileSync as readFileSync2 } from "fs";
|
|
@@ -5919,7 +5919,7 @@ import { chmod, mkdir } from "fs/promises";
|
|
|
5919
5919
|
import { dirname as dirname2, resolve } from "path";
|
|
5920
5920
|
import { createHash as createHash2 } from "crypto";
|
|
5921
5921
|
|
|
5922
|
-
//
|
|
5922
|
+
// node_modules/@hasna/contracts/dist/auth/index.js
|
|
5923
5923
|
import { createHash, createHmac, randomBytes, timingSafeEqual } from "crypto";
|
|
5924
5924
|
var MAX_TENANT_ID_LENGTH = 64;
|
|
5925
5925
|
var TENANT_ID_PATTERN = new RegExp(`^[A-Za-z0-9][A-Za-z0-9._-]{0,${MAX_TENANT_ID_LENGTH - 1}}$`);
|
|
@@ -7080,7 +7080,7 @@ var openapi_default = {
|
|
|
7080
7080
|
openapi: "3.0.3",
|
|
7081
7081
|
info: {
|
|
7082
7082
|
title: "Switcher API",
|
|
7083
|
-
version: "0.2.
|
|
7083
|
+
version: "0.2.15",
|
|
7084
7084
|
description: "Authenticated provider/profile/catalog control plane. Launches run locally; the API never returns provider credentials."
|
|
7085
7085
|
},
|
|
7086
7086
|
security: [
|
|
@@ -11693,7 +11693,7 @@ async function openCliRuntime(env = process.env, resolveCredential2) {
|
|
|
11693
11693
|
return { client: new SwitcherClient({ baseUrl: service.url, apiKey }), mode: "local", providerEnv, close: service.close };
|
|
11694
11694
|
}
|
|
11695
11695
|
|
|
11696
|
-
//
|
|
11696
|
+
// node_modules/@hasna/contracts/dist/executable-trust.js
|
|
11697
11697
|
import { constants as constants2 } from "fs";
|
|
11698
11698
|
import { access as access2, lstat as lstat2, open, readlink, realpath, rename, unlink } from "fs/promises";
|
|
11699
11699
|
import { dirname as dirname3, isAbsolute as isAbsolute3, join as join5, parse as parse2, sep as sep2 } from "path";
|
package/dist/sdk.js
CHANGED
|
@@ -13,7 +13,7 @@ var __export = (target, all) => {
|
|
|
13
13
|
});
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
//
|
|
16
|
+
// node_modules/zod/v3/external.js
|
|
17
17
|
var exports_external = {};
|
|
18
18
|
__export(exports_external, {
|
|
19
19
|
void: () => voidType,
|
|
@@ -125,7 +125,7 @@ __export(exports_external, {
|
|
|
125
125
|
BRAND: () => BRAND
|
|
126
126
|
});
|
|
127
127
|
|
|
128
|
-
//
|
|
128
|
+
// node_modules/zod/v3/helpers/util.js
|
|
129
129
|
var util;
|
|
130
130
|
(function(util2) {
|
|
131
131
|
util2.assertEqual = (_) => {};
|
|
@@ -256,7 +256,7 @@ var getParsedType = (data) => {
|
|
|
256
256
|
}
|
|
257
257
|
};
|
|
258
258
|
|
|
259
|
-
//
|
|
259
|
+
// node_modules/zod/v3/ZodError.js
|
|
260
260
|
var ZodIssueCode = util.arrayToEnum([
|
|
261
261
|
"invalid_type",
|
|
262
262
|
"invalid_literal",
|
|
@@ -375,7 +375,7 @@ ZodError.create = (issues) => {
|
|
|
375
375
|
return error;
|
|
376
376
|
};
|
|
377
377
|
|
|
378
|
-
//
|
|
378
|
+
// node_modules/zod/v3/locales/en.js
|
|
379
379
|
var errorMap = (issue, _ctx) => {
|
|
380
380
|
let message;
|
|
381
381
|
switch (issue.code) {
|
|
@@ -478,7 +478,7 @@ var errorMap = (issue, _ctx) => {
|
|
|
478
478
|
};
|
|
479
479
|
var en_default = errorMap;
|
|
480
480
|
|
|
481
|
-
//
|
|
481
|
+
// node_modules/zod/v3/errors.js
|
|
482
482
|
var overrideErrorMap = en_default;
|
|
483
483
|
function setErrorMap(map) {
|
|
484
484
|
overrideErrorMap = map;
|
|
@@ -486,7 +486,7 @@ function setErrorMap(map) {
|
|
|
486
486
|
function getErrorMap() {
|
|
487
487
|
return overrideErrorMap;
|
|
488
488
|
}
|
|
489
|
-
//
|
|
489
|
+
// node_modules/zod/v3/helpers/parseUtil.js
|
|
490
490
|
var makeIssue = (params) => {
|
|
491
491
|
const { data, path, errorMaps, issueData } = params;
|
|
492
492
|
const fullPath = [...path, ...issueData.path || []];
|
|
@@ -592,14 +592,14 @@ var isAborted = (x) => x.status === "aborted";
|
|
|
592
592
|
var isDirty = (x) => x.status === "dirty";
|
|
593
593
|
var isValid = (x) => x.status === "valid";
|
|
594
594
|
var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
|
595
|
-
//
|
|
595
|
+
// node_modules/zod/v3/helpers/errorUtil.js
|
|
596
596
|
var errorUtil;
|
|
597
597
|
(function(errorUtil2) {
|
|
598
598
|
errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
|
599
599
|
errorUtil2.toString = (message) => typeof message === "string" ? message : message?.message;
|
|
600
600
|
})(errorUtil || (errorUtil = {}));
|
|
601
601
|
|
|
602
|
-
//
|
|
602
|
+
// node_modules/zod/v3/types.js
|
|
603
603
|
class ParseInputLazyPath {
|
|
604
604
|
constructor(parent, value, path, key) {
|
|
605
605
|
this._cachedPath = [];
|
|
@@ -4200,7 +4200,7 @@ async function boundedJson(response, maxBytes = MAX_BYTES) {
|
|
|
4200
4200
|
}
|
|
4201
4201
|
}
|
|
4202
4202
|
|
|
4203
|
-
//
|
|
4203
|
+
// node_modules/@hasna/contracts/dist/client/transport.js
|
|
4204
4204
|
import { isIP } from "net";
|
|
4205
4205
|
import { spawnSync } from "child_process";
|
|
4206
4206
|
import { closeSync as closeSync2, fstatSync as fstatSync2, openSync as openSync2, readFileSync as readFileSync2 } from "fs";
|
package/dist/serve/index.js
CHANGED
|
@@ -68,7 +68,7 @@ function canonicalPolicyJSON(value) {
|
|
|
68
68
|
return JSON.stringify(value, (_key, item) => item && typeof item === "object" && !Array.isArray(item) ? Object.fromEntries(Object.entries(item).sort(([a], [b]) => a.localeCompare(b))) : item);
|
|
69
69
|
}
|
|
70
70
|
// package.json
|
|
71
|
-
var version = "0.2.
|
|
71
|
+
var version = "0.2.15";
|
|
72
72
|
|
|
73
73
|
// src/version.ts
|
|
74
74
|
var VERSION = version;
|
|
@@ -922,7 +922,7 @@ var openapi_default = {
|
|
|
922
922
|
openapi: "3.0.3",
|
|
923
923
|
info: {
|
|
924
924
|
title: "Switcher API",
|
|
925
|
-
version: "0.2.
|
|
925
|
+
version: "0.2.15",
|
|
926
926
|
description: "Authenticated provider/profile/catalog control plane. Launches run locally; the API never returns provider credentials."
|
|
927
927
|
},
|
|
928
928
|
security: [
|
package/openapi.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hasna/switcher",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.15",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Universal provider and model switcher for coding harnesses with an API, SDK and self-hosted storage",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -79,13 +79,16 @@
|
|
|
79
79
|
},
|
|
80
80
|
"dependencies": {
|
|
81
81
|
"@hasna/contracts": "1.3.8",
|
|
82
|
-
"@modelcontextprotocol/sdk": "
|
|
82
|
+
"@modelcontextprotocol/sdk": "1.32.1",
|
|
83
83
|
"jsonc-parser": "3.3.1",
|
|
84
84
|
"yaml": "2.9.0",
|
|
85
85
|
"zod": "3.25.76",
|
|
86
86
|
"@aws-sdk/client-secrets-manager": "3.1127.0",
|
|
87
87
|
"pg": "8.23.0"
|
|
88
88
|
},
|
|
89
|
+
"overrides": {
|
|
90
|
+
"proxy-addr": "2.0.8"
|
|
91
|
+
},
|
|
89
92
|
"repository": {
|
|
90
93
|
"type": "git",
|
|
91
94
|
"url": "https://github.com/hasna/apps.git",
|