@closedrouter/cli 1.1.1 → 1.1.2
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.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ export interface LaunchPlan {
|
|
|
26
26
|
}
|
|
27
27
|
export declare function isGatewayModelAvailable(availableModels: string[], model: string): boolean;
|
|
28
28
|
export declare function buildLaunchPlan(tool: CliTool, serverUrl: string, apiKey: string, model: string, toolArgs?: string[], homeDir?: string, executablePath?: string): LaunchPlan;
|
|
29
|
+
export declare function modelSupportsHarness(model: Record<string, any>, tool: StartTool): boolean;
|
|
29
30
|
export declare function startCommand(options?: StartCommandOptions): Promise<void>;
|
|
30
31
|
export {};
|
|
31
32
|
//# sourceMappingURL=start.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../src/commands/start.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAWH,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,CAAC;AAC7E,KAAK,OAAO,GAAG,SAAS,CAAC;AAEzB,MAAM,WAAW,mBAAmB;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,UAAU,UAAU;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,GAAG,EAAE,MAAM,CAAC,UA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B,eAAe,CAC7B,IAAI,EAAE,OAAO,EACb,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,QAAQ,GAAE,MAAM,EAAO,EACvB,OAAO,SAAY,EACnB,cAAc,CAAC,EAAE,MAAM,GACtB,UAAU,CAqGZ;AAmBD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,IAAI,EAAE,SAAS,GAAG,OAAO,CAMzF;AA4ED,wBAAsB,YAAY,CAAC,OAAO,GAAE,mBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAsCnF"}
|
package/dist/index.js
CHANGED
|
@@ -8746,6 +8746,12 @@ function writeOwnedConfig(file) {
|
|
|
8746
8746
|
function modelId(model) {
|
|
8747
8747
|
return String(model.id || model.name || "");
|
|
8748
8748
|
}
|
|
8749
|
+
function modelSupportsHarness(model, tool) {
|
|
8750
|
+
if (tool === "claude")
|
|
8751
|
+
return true;
|
|
8752
|
+
const parameters = model.supported_parameters;
|
|
8753
|
+
return (model.status === undefined || model.status === "available") && (model.available_tool_account_count === undefined || model.available_tool_account_count > 0) && (!Array.isArray(parameters) || parameters.includes("tools"));
|
|
8754
|
+
}
|
|
8749
8755
|
async function selectTool(tool) {
|
|
8750
8756
|
const cleaned = tool?.toLowerCase();
|
|
8751
8757
|
if (cleaned) {
|
|
@@ -8822,7 +8828,7 @@ async function startCommand(options = {}) {
|
|
|
8822
8828
|
const apiKey = await ensurePlatformKey(tool, client, options);
|
|
8823
8829
|
client.setApiKey(apiKey);
|
|
8824
8830
|
const models = await client.listGatewayModels({ preferApiKey: true });
|
|
8825
|
-
const availableModels = models.map(modelId).filter(Boolean).sort();
|
|
8831
|
+
const availableModels = models.filter((item) => modelSupportsHarness(item, tool)).map(modelId).filter(Boolean).sort();
|
|
8826
8832
|
let model = options.model?.trim();
|
|
8827
8833
|
if (!model) {
|
|
8828
8834
|
if (availableModels.length === 0) {
|
|
@@ -8840,7 +8846,7 @@ async function startCommand(options = {}) {
|
|
|
8840
8846
|
model = String(choice);
|
|
8841
8847
|
}
|
|
8842
8848
|
if (!isGatewayModelAvailable(availableModels, model)) {
|
|
8843
|
-
throw new Error(`Model '${model}' is not available
|
|
8849
|
+
throw new Error(`Model '${model}' is not available for ${tool} with this platform key. Agent clients require a provider that supports gateway function tools. Choose another model from ClosedRouter's model catalog.`);
|
|
8844
8850
|
}
|
|
8845
8851
|
if (tool === "claude")
|
|
8846
8852
|
await ensureClaudeBridge(client, serverUrl, apiKey);
|
|
@@ -8897,7 +8903,7 @@ process.on("warning", (warning) => {
|
|
|
8897
8903
|
console.warn(warning.name, warning.message);
|
|
8898
8904
|
});
|
|
8899
8905
|
var program2 = new Command;
|
|
8900
|
-
program2.name("closedrouter").description("ClosedRouter CLI: Import local AI subscriptions & API keys into your shared token pool").version("1.1.
|
|
8906
|
+
program2.name("closedrouter").description("ClosedRouter CLI: Import local AI subscriptions & API keys into your shared token pool").version("1.1.2").option("-s, --server <url>", "ClosedRouter server base URL (default: http://localhost:8000)").action(async (options) => {
|
|
8901
8907
|
await onboardCommand({ server: options.server });
|
|
8902
8908
|
});
|
|
8903
8909
|
program2.command("onboard").description("Run the full interactive onboarding wizard").option("-s, --server <url>", "ClosedRouter server base URL").option("-a, --all", "Automatically import all discovered accounts").option("--shared", "Contribute accounts to the shared team pool").action(async (options) => {
|
package/package.json
CHANGED