mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-05-05 17:56:56 +00:00
Introduce a runtime settings layer that hydrates persisted config at startup and reapplies aliases, payload rules, cache behavior, CLI compatibility, usage tuning, and related switches when settings change or SQLite updates. Replace the legacy prompt injection middleware path with a guardrail registry that supports prompt injection detection, PII masking, disabled guardrail overrides, and post-call response handling across the chat pipeline. Add a metadata registry for model catalog and alias resolution so catalog endpoints return enriched capabilities plus diagnostic headers and typed alias errors instead of ad hoc responses. Convert unsupported built-in web_search tools into an OmniRoute fallback tool, execute them through builtin skills, and preserve Responses API function call output with sanitized usage fields. Centralize provider header fingerprints for GitHub, Cursor, Qwen, Qoder, Kiro, and Antigravity, and migrate management passwords from env or plaintext storage into persisted bcrypt hashes during startup and login.
29 lines
1.1 KiB
TypeScript
29 lines
1.1 KiB
TypeScript
import test from "node:test";
|
|
import assert from "node:assert/strict";
|
|
|
|
const { CLI_TOOLS } = await import("../../src/shared/constants/cliTools.ts");
|
|
const { CLI_COMPAT_PROVIDER_IDS } =
|
|
await import("../../src/shared/constants/cliCompatProviders.ts");
|
|
const { CLI_TOOL_IDS } = await import("../../src/shared/services/cliRuntime.ts");
|
|
|
|
test("Amp CLI is registered as a guide-based CLI tool with shorthand mapping guidance", () => {
|
|
const amp = CLI_TOOLS.amp;
|
|
assert.ok(amp);
|
|
assert.equal(amp.configType, "guide");
|
|
assert.equal(amp.defaultCommand, "amp");
|
|
assert.deepEqual(amp.modelAliases, ["g25p", "g25f", "cs45", "g54"]);
|
|
|
|
const notesText = (amp.notes || [])
|
|
.map((note) => note?.text || "")
|
|
.join(" ")
|
|
.toLowerCase();
|
|
|
|
assert.match(notesText, /shorthand/);
|
|
assert.match(notesText, /g25p/);
|
|
assert.match(notesText, /claude-sonnet-4-5-20250929/);
|
|
});
|
|
|
|
test("Amp CLI is discoverable in runtime tooling but excluded from provider fingerprint toggles", () => {
|
|
assert.ok(CLI_TOOL_IDS.includes("amp"));
|
|
assert.equal(CLI_COMPAT_PROVIDER_IDS.includes("amp"), false);
|
|
});
|