@llmnative/agentico 0.27.1 → 0.28.0

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/server.mjs CHANGED
@@ -745,6 +745,7 @@ function ie(e) {
745
745
  "GET",
746
746
  "POST",
747
747
  "PUT",
748
+ "PATCH",
748
749
  "DELETE"
749
750
  ].includes(e.method)) return $(404, { error: "not found" });
750
751
  let o = M(t.project, t.tenant), s = l(t.project), c = ne.exec(n)?.[1], u = n === "/v1/chats" && e.method === "POST", d = e.method === "GET" || e.method === "DELETE" ? void 0 : await e.arrayBuffer(), f = u && d ? (() => {
@@ -880,6 +881,32 @@ function ie(e) {
880
881
  }
881
882
  if (y === "runner") return g(t, r, `/${v.slice(1).map(encodeURIComponent).join("/")}`, !1);
882
883
  if (y === "runner-namespace") return d(r, "admin"), g(t, r, `/${v.slice(1).map(encodeURIComponent).join("/")}`, !0);
884
+ if (y === "runner-defaults" && !b) {
885
+ let e = M(w, r.tenant);
886
+ if (C === "GET") return $(200, { defaults: (await h(e)).defaults ?? {} });
887
+ if (C === "PUT") {
888
+ d(r, "admin");
889
+ let a = await f(t), o = String(a.provider ?? "");
890
+ if (!/^[a-z][a-z0-9-]{0,31}$/.test(o)) throw new Z(400, "invalid");
891
+ let s = typeof a.model == "string" ? a.model.trim().slice(0, 120) : "", c = typeof a.reasoning == "string" && [
892
+ "low",
893
+ "medium",
894
+ "high",
895
+ "max"
896
+ ].includes(a.reasoning) ? a.reasoning : void 0, l = await h(e), u = { ...l.defaults ?? {} }, p = {
897
+ ...s ? { model: s } : {},
898
+ ...c ? { reasoning: c } : {}
899
+ };
900
+ return Object.keys(p).length ? u[o] = p : delete u[o], await n.put(L, {
901
+ ...l,
902
+ defaults: u
903
+ }), i("runner defaults set", {
904
+ namespace: e,
905
+ provider: o,
906
+ by: r.user.id
907
+ }), $(200, { defaults: u });
908
+ }
909
+ }
883
910
  if (y === "runners") {
884
911
  d(r, u("runners"));
885
912
  let e = l(w), n = r.role === "platform" ? { platform: !0 } : {