stratagate-dsh 0.3.38 → 0.3.40

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/plugin.js CHANGED
@@ -16495,6 +16495,7 @@ var StrataGateRuntime = class _StrataGateRuntime {
16495
16495
  /** Persist the supplied embedding/rerank settings; omitted keys keep their value. */
16496
16496
  writeVectorSettings(values) {
16497
16497
  if (this.config.database === ":memory:") return;
16498
+ this.profileStore();
16498
16499
  const database = new DatabaseSync5(this.config.database);
16499
16500
  try {
16500
16501
  database.exec("PRAGMA busy_timeout = 5000");
@@ -20072,12 +20073,15 @@ async function handleAdminRequest(runtime, req, res) {
20072
20073
  if (req.method !== "PATCH") throw new AdminHttpError(405, "StrataGate settings require PATCH");
20073
20074
  sendJson(res, 200, await updateSettings(runtime, url, req));
20074
20075
  } else if (path === "/api/stratagate/models") {
20075
- if (req.method === "GET" && url.searchParams.has("provider") && !url.searchParams.has("kind")) {
20076
+ if (req.method === "GET" && !url.searchParams.has("kind")) {
20077
+ if (url.searchParams.has("url") || url.searchParams.has("key")) {
20078
+ throw new AdminHttpError(400, "Model credentials must be sent in a JSON body; credentials in the URL are not accepted");
20079
+ }
20076
20080
  sendJson(res, 200, await runtime.adminMemoryModelCatalog(url.searchParams.get("provider") || void 0));
20077
20081
  return;
20078
20082
  }
20079
- if (req.method === "POST" && !url.searchParams.has("kind") && req.body === void 0 && typeof req[Symbol.asyncIterator] !== "function") {
20080
- throw new AdminHttpError(405, "Memory models require GET");
20083
+ if (req.method === "POST" && req.body === void 0 && typeof req[Symbol.asyncIterator] !== "function") {
20084
+ throw new AdminHttpError(405, "Memory models require GET; embedding/rerank listing requires a JSON body");
20081
20085
  }
20082
20086
  if (req.method !== "GET" && req.method !== "POST") throw new AdminHttpError(405, "StrataGate model listing requires GET or POST");
20083
20087
  if (req.method === "GET" && (url.searchParams.has("url") || url.searchParams.has("key"))) {