omnius 1.0.325 → 1.0.326
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/index.js +137 -3
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -552312,7 +552312,10 @@ function detectProvider(url) {
|
|
|
552312
552312
|
modelsPath: isLocal ? "/v1/models" : "/v1/models"
|
|
552313
552313
|
};
|
|
552314
552314
|
}
|
|
552315
|
-
|
|
552315
|
+
function listProviderPresets() {
|
|
552316
|
+
return PROVIDER_PRESETS.map((p2) => ({ ...p2 }));
|
|
552317
|
+
}
|
|
552318
|
+
var PROVIDERS, PROVIDER_PRESETS;
|
|
552316
552319
|
var init_normalizeUrl = __esm({
|
|
552317
552320
|
"packages/backend-vllm/dist/normalizeUrl.js"() {
|
|
552318
552321
|
"use strict";
|
|
@@ -552384,6 +552387,28 @@ var init_normalizeUrl = __esm({
|
|
|
552384
552387
|
info: { id: "vllm", label: "vLLM (local)", local: true, authRequired: false, modelsPath: "/v1/models" }
|
|
552385
552388
|
}
|
|
552386
552389
|
];
|
|
552390
|
+
PROVIDER_PRESETS = [
|
|
552391
|
+
// --- Local runtimes ---
|
|
552392
|
+
{ id: "ollama", label: "Ollama (local)", local: true, authRequired: false, modelsPath: "/api/tags", defaultUrl: "http://127.0.0.1:11434", description: "Local Ollama runtime on port 11434." },
|
|
552393
|
+
{ id: "lmstudio", label: "LM Studio (local)", local: true, authRequired: false, modelsPath: "/v1/models", defaultUrl: "http://127.0.0.1:1234/v1", description: "Local OpenAI-compatible server on port 1234." },
|
|
552394
|
+
{ id: "vllm", label: "vLLM (local)", local: true, authRequired: false, modelsPath: "/v1/models", defaultUrl: "http://127.0.0.1:8000/v1", description: "Self-hosted OpenAI-compatible vLLM endpoint." },
|
|
552395
|
+
// --- Cloud providers ---
|
|
552396
|
+
{ id: "openai", label: "OpenAI", local: false, authRequired: true, keyPrefix: "sk-", modelsPath: "/v1/models", defaultUrl: "https://api.openai.com/v1", apiKeyUrl: "https://platform.openai.com/api-keys", description: "OpenAI API models." },
|
|
552397
|
+
{ id: "anthropic", label: "Anthropic (Claude)", local: false, authRequired: true, keyPrefix: "sk-ant-", modelsPath: "/v1/models", defaultUrl: "https://api.anthropic.com/v1", apiKeyUrl: "https://console.anthropic.com/settings/keys", description: "Claude via the Anthropic API." },
|
|
552398
|
+
{ id: "openrouter", label: "OpenRouter", local: false, authRequired: true, keyPrefix: "sk-or-", modelsPath: "/v1/models", defaultUrl: "https://openrouter.ai/api/v1", apiKeyUrl: "https://openrouter.ai/keys", description: "Routing across many hosted models." },
|
|
552399
|
+
{ id: "groq", label: "Groq", local: false, authRequired: true, keyPrefix: "gsk_", modelsPath: "/v1/models", defaultUrl: "https://api.groq.com/openai/v1", apiKeyUrl: "https://console.groq.com/keys", description: "Groq OpenAI-compatible inference." },
|
|
552400
|
+
{ id: "chutes", label: "Chutes AI", local: false, authRequired: true, keyPrefix: "cpk_", modelsPath: "/v1/models", defaultUrl: "https://llm.chutes.ai/v1", apiKeyUrl: "https://chutes.ai/app/api", description: "Chutes OpenAI-compatible endpoint." },
|
|
552401
|
+
{ id: "deepinfra", label: "DeepInfra", local: false, authRequired: true, modelsPath: "/v1/models", defaultUrl: "https://api.deepinfra.com/v1/openai", apiKeyUrl: "https://deepinfra.com/dash/api_keys", description: "DeepInfra hosted models." },
|
|
552402
|
+
{ id: "together", label: "Together AI", local: false, authRequired: true, modelsPath: "/v1/models", defaultUrl: "https://api.together.xyz/v1", apiKeyUrl: "https://api.together.xyz/settings/api-keys", description: "Together OpenAI-compatible inference." },
|
|
552403
|
+
{ id: "fireworks", label: "Fireworks AI", local: false, authRequired: true, keyPrefix: "fw_", modelsPath: "/v1/models", defaultUrl: "https://api.fireworks.ai/inference/v1", apiKeyUrl: "https://fireworks.ai/account/api-keys", description: "Fireworks OpenAI-compatible inference." },
|
|
552404
|
+
{ id: "mistral", label: "Mistral AI", local: false, authRequired: true, modelsPath: "/v1/models", defaultUrl: "https://api.mistral.ai/v1", apiKeyUrl: "https://console.mistral.ai/api-keys", description: "Mistral hosted models." },
|
|
552405
|
+
{ id: "cerebras", label: "Cerebras", local: false, authRequired: true, keyPrefix: "csk-", modelsPath: "/v1/models", defaultUrl: "https://api.cerebras.ai/v1", apiKeyUrl: "https://cloud.cerebras.ai/platform", description: "Cerebras OpenAI-compatible inference." },
|
|
552406
|
+
{ id: "sambanova", label: "SambaNova", local: false, authRequired: true, modelsPath: "/v1/models", defaultUrl: "https://api.sambanova.ai/v1", apiKeyUrl: "https://cloud.sambanova.ai/apis", description: "SambaNova OpenAI-compatible inference." },
|
|
552407
|
+
{ id: "nvidia", label: "NVIDIA NIM", local: false, authRequired: true, keyPrefix: "nvapi-", modelsPath: "/v1/models", defaultUrl: "https://integrate.api.nvidia.com/v1", apiKeyUrl: "https://build.nvidia.com", description: "NVIDIA-hosted NIM models." },
|
|
552408
|
+
{ id: "hyperbolic", label: "Hyperbolic", local: false, authRequired: true, modelsPath: "/v1/models", defaultUrl: "https://api.hyperbolic.xyz/v1", apiKeyUrl: "https://app.hyperbolic.xyz/settings", description: "Hyperbolic OpenAI-compatible inference." },
|
|
552409
|
+
// --- Catch-all ---
|
|
552410
|
+
{ id: "custom", label: "Custom endpoint", local: false, authRequired: false, modelsPath: "/v1/models", description: "Any OpenAI-compatible endpoint — enter a URL." }
|
|
552411
|
+
];
|
|
552387
552412
|
}
|
|
552388
552413
|
});
|
|
552389
552414
|
|
|
@@ -628928,7 +628953,7 @@ __export(commands_exports, {
|
|
|
628928
628953
|
registerSlashCommand: () => registerSlashCommand
|
|
628929
628954
|
});
|
|
628930
628955
|
import * as nodeOs from "node:os";
|
|
628931
|
-
import { execSync as nodeExecSync } from "node:child_process";
|
|
628956
|
+
import { execSync as nodeExecSync, spawn as nodeSpawn2 } from "node:child_process";
|
|
628932
628957
|
import { createHash as createHash35 } from "node:crypto";
|
|
628933
628958
|
import {
|
|
628934
628959
|
existsSync as existsSync127,
|
|
@@ -640039,6 +640064,87 @@ async function handleVoiceList(ctx3, focusFilename) {
|
|
|
640039
640064
|
if (msg) renderInfo(msg);
|
|
640040
640065
|
}
|
|
640041
640066
|
}
|
|
640067
|
+
function openUrlInBrowser(url) {
|
|
640068
|
+
if (process.env["OMNIUS_NO_BROWSER"] === "1") return false;
|
|
640069
|
+
if (!/^https?:\/\//i.test(url)) return false;
|
|
640070
|
+
const cmd = process.platform === "darwin" ? "open" : process.platform === "win32" ? "cmd" : "xdg-open";
|
|
640071
|
+
const args = process.platform === "win32" ? ["/c", "start", "", url] : [url];
|
|
640072
|
+
try {
|
|
640073
|
+
const child = nodeSpawn2(cmd, args, { stdio: "ignore", detached: true });
|
|
640074
|
+
child.on("error", () => {
|
|
640075
|
+
});
|
|
640076
|
+
child.unref();
|
|
640077
|
+
return true;
|
|
640078
|
+
} catch {
|
|
640079
|
+
return false;
|
|
640080
|
+
}
|
|
640081
|
+
}
|
|
640082
|
+
function clickableLink(url, text2 = url) {
|
|
640083
|
+
if (!process.stdout.isTTY) return text2;
|
|
640084
|
+
return `\x1B]8;;${url}\x07${text2}\x1B]8;;\x07`;
|
|
640085
|
+
}
|
|
640086
|
+
async function browseProviderPresets(ctx3, local) {
|
|
640087
|
+
const presets = listProviderPresets();
|
|
640088
|
+
const byKey = new Map(presets.map((p2) => [p2.id, p2]));
|
|
640089
|
+
const items = presets.map((p2) => ({
|
|
640090
|
+
key: p2.id,
|
|
640091
|
+
label: p2.local ? `${c3.green("●")} ${p2.label}` : p2.label,
|
|
640092
|
+
detail: [
|
|
640093
|
+
p2.defaultUrl || "enter a custom URL",
|
|
640094
|
+
p2.authRequired ? "API key required" : p2.local ? "local · no key" : "no key",
|
|
640095
|
+
p2.description || ""
|
|
640096
|
+
].filter(Boolean).join(" · ")
|
|
640097
|
+
}));
|
|
640098
|
+
let pending2 = null;
|
|
640099
|
+
const result = await tuiSelect({
|
|
640100
|
+
items,
|
|
640101
|
+
title: "Add inference provider",
|
|
640102
|
+
rl: ctx3.rl,
|
|
640103
|
+
availableRows: ctx3.availableContentRows?.(),
|
|
640104
|
+
onEnter: (item, { getInput, resolve: resolve71 }) => {
|
|
640105
|
+
const preset = byKey.get(item.key);
|
|
640106
|
+
if (!preset) return false;
|
|
640107
|
+
void (async () => {
|
|
640108
|
+
let url2 = preset.defaultUrl ?? "";
|
|
640109
|
+
if (!url2) {
|
|
640110
|
+
const typed = await getInput("Endpoint URL", "https://");
|
|
640111
|
+
if (!typed || !typed.trim()) {
|
|
640112
|
+
resolve71({ confirmed: false, key: item.key, index: -1 });
|
|
640113
|
+
return;
|
|
640114
|
+
}
|
|
640115
|
+
url2 = typed.trim();
|
|
640116
|
+
}
|
|
640117
|
+
let key2 = "";
|
|
640118
|
+
if (preset.authRequired || !preset.local) {
|
|
640119
|
+
let promptLabel = "API key";
|
|
640120
|
+
if (preset.apiKeyUrl) {
|
|
640121
|
+
const opened = openUrlInBrowser(preset.apiKeyUrl);
|
|
640122
|
+
promptLabel = opened ? `API key (opened ${preset.apiKeyUrl} in browser)` : `API key (get one: ${preset.apiKeyUrl})`;
|
|
640123
|
+
}
|
|
640124
|
+
const entered = await getInput(
|
|
640125
|
+
preset.authRequired ? promptLabel : `${promptLabel} (optional)`,
|
|
640126
|
+
""
|
|
640127
|
+
);
|
|
640128
|
+
key2 = (entered ?? "").trim();
|
|
640129
|
+
}
|
|
640130
|
+
pending2 = { url: url2, key: key2 };
|
|
640131
|
+
resolve71({ confirmed: true, key: "__apply__", index: -1 });
|
|
640132
|
+
})();
|
|
640133
|
+
return true;
|
|
640134
|
+
}
|
|
640135
|
+
});
|
|
640136
|
+
if (!result.confirmed || result.key !== "__apply__" || !pending2) {
|
|
640137
|
+
renderInfo("Provider selection cancelled.");
|
|
640138
|
+
return;
|
|
640139
|
+
}
|
|
640140
|
+
const { url, key } = pending2;
|
|
640141
|
+
const keyUrl = presets.find((p2) => p2.defaultUrl === url)?.apiKeyUrl;
|
|
640142
|
+
if (keyUrl) {
|
|
640143
|
+
process.stdout.write(` ${c3.dim("API key page:")} ${clickableLink(keyUrl)}
|
|
640144
|
+
`);
|
|
640145
|
+
}
|
|
640146
|
+
await handleEndpoint(key ? `${url} --auth ${key}` : url, ctx3, local);
|
|
640147
|
+
}
|
|
640042
640148
|
async function handleEndpoint(arg, ctx3, local = false) {
|
|
640043
640149
|
if (!arg) {
|
|
640044
640150
|
const history = loadUsageHistory("endpoint", ctx3.repoRoot);
|
|
@@ -640053,6 +640159,11 @@ async function handleEndpoint(arg, ctx3, local = false) {
|
|
|
640053
640159
|
detail: `${provider2} ${uses}${auth}`
|
|
640054
640160
|
};
|
|
640055
640161
|
});
|
|
640162
|
+
items.push({
|
|
640163
|
+
key: "__providers__",
|
|
640164
|
+
label: `${c3.cyan("◈")} Add from provider list`,
|
|
640165
|
+
detail: "Pick OpenAI, Anthropic, Groq, Ollama… and enter a key"
|
|
640166
|
+
});
|
|
640056
640167
|
items.push({
|
|
640057
640168
|
key: "__add__",
|
|
640058
640169
|
label: `${c3.green("+")} Add endpoint`,
|
|
@@ -640094,9 +640205,17 @@ async function handleEndpoint(arg, ctx3, local = false) {
|
|
|
640094
640205
|
resolve71({ confirmed: true, key: "__sponsor__", index: -1 });
|
|
640095
640206
|
return true;
|
|
640096
640207
|
}
|
|
640208
|
+
if (item.key === "__providers__") {
|
|
640209
|
+
resolve71({ confirmed: true, key: "__providers__", index: -1 });
|
|
640210
|
+
return true;
|
|
640211
|
+
}
|
|
640097
640212
|
return false;
|
|
640098
640213
|
}
|
|
640099
640214
|
});
|
|
640215
|
+
if (result.confirmed && result.key === "__providers__") {
|
|
640216
|
+
await browseProviderPresets(ctx3, local);
|
|
640217
|
+
return;
|
|
640218
|
+
}
|
|
640100
640219
|
if (result.confirmed && result.key === "__add__" && addedEndpoint) {
|
|
640101
640220
|
await handleEndpoint(addedEndpoint, ctx3, local);
|
|
640102
640221
|
return;
|
|
@@ -640122,6 +640241,11 @@ async function handleEndpoint(arg, ctx3, local = false) {
|
|
|
640122
640241
|
label: `${currentProvider.label} — ${ctx3.config.backendUrl}`,
|
|
640123
640242
|
detail: `${ctx3.config.backendType} ${ctx3.config.apiKey ? "Auth: Bearer token set" : "No auth"}`
|
|
640124
640243
|
},
|
|
640244
|
+
{
|
|
640245
|
+
key: "__providers__",
|
|
640246
|
+
label: `${c3.cyan("◈")} Add from provider list`,
|
|
640247
|
+
detail: "Pick OpenAI, Anthropic, Groq, Ollama… and enter a key"
|
|
640248
|
+
},
|
|
640125
640249
|
{
|
|
640126
640250
|
key: "__add__",
|
|
640127
640251
|
label: `${c3.green("+")} Add endpoint`,
|
|
@@ -640154,10 +640278,16 @@ async function handleEndpoint(arg, ctx3, local = false) {
|
|
|
640154
640278
|
resolve71({ confirmed: true, key: "__sponsor__", index: -1 });
|
|
640155
640279
|
return true;
|
|
640156
640280
|
}
|
|
640281
|
+
if (item.key === "__providers__") {
|
|
640282
|
+
resolve71({ confirmed: true, key: "__providers__", index: -1 });
|
|
640283
|
+
return true;
|
|
640284
|
+
}
|
|
640157
640285
|
return false;
|
|
640158
640286
|
}
|
|
640159
640287
|
});
|
|
640160
|
-
if (noHistResult.confirmed && noHistResult.key === "
|
|
640288
|
+
if (noHistResult.confirmed && noHistResult.key === "__providers__") {
|
|
640289
|
+
await browseProviderPresets(ctx3, local);
|
|
640290
|
+
} else if (noHistResult.confirmed && noHistResult.key === "__add__" && addedUrl) {
|
|
640161
640291
|
await handleEndpoint(addedUrl, ctx3, local);
|
|
640162
640292
|
} else if (noHistResult.confirmed && noHistResult.key === "__sponsor__") {
|
|
640163
640293
|
await handleSponsoredEndpoint(ctx3, local);
|
|
@@ -640207,6 +640337,10 @@ async function handleEndpoint(arg, ctx3, local = false) {
|
|
|
640207
640337
|
await handleSponsoredEndpoint(ctx3, local);
|
|
640208
640338
|
return;
|
|
640209
640339
|
}
|
|
640340
|
+
if (arg === "providers" || arg === "list" || arg === "browse") {
|
|
640341
|
+
await browseProviderPresets(ctx3, local);
|
|
640342
|
+
return;
|
|
640343
|
+
}
|
|
640210
640344
|
if (arg.startsWith("add ")) {
|
|
640211
640345
|
const addArg = arg.slice(4).replace(/\u2014/g, "--").replace(/\u2013/g, "--");
|
|
640212
640346
|
const addParts = addArg.split(/\s+/);
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omnius",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.326",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "omnius",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.326",
|
|
10
10
|
"bundleDependencies": [
|
|
11
11
|
"image-to-ascii"
|
|
12
12
|
],
|
package/package.json
CHANGED