@ramme-io/kernel 8.1.7 → 8.2.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.
@@ -1,4 +1,4 @@
1
- import { j as x, k as O, l as F, m as M } from "./deviceReadings-D8PeyG1y.js";
1
+ import { j as x, k as O, l as F, m as C } from "./deviceReadings-C4Rzi815.js";
2
2
  const se = {
3
3
  // ── ROOM 1: STRATEGY OFFICE ──────────────────────────────────────
4
4
  strategist: {
@@ -136,23 +136,27 @@ const G = {
136
136
  grok: ["grok-beta", "grok-vision-beta"],
137
137
  deepseek: ["deepseek-chat", "deepseek-coder"],
138
138
  // Real, currently-pulled models on this deployment's Ollama instance
139
- // (verified via GET /api/tags, not guessed) — 'llama3.1'/'mistral'/
140
- // 'codellama'/'qwen2.5' were never actually pulled locally, so picking
141
- // any of them would 404 at request time. llama3.3 leads the list (used
142
- // as PROVIDER_MODELS[provider][0], the auto-selected default on
143
- // provider switch) since it's already this app's proven-reliable
144
- // default for Ollama-backed report generation elsewhere
145
- // (core/ai_router.py's DEFAULT_MODELS) — llama3.2 (3B) was found live
146
- // to mis-trigger tool calls on plain greetings.
147
- ollama: ["llama3.3", "qwen2.5:32b", "qwen2.5-coder:32b", "qwen2.5-coder:14b", "qwen2.5-coder:7b", "llama3.2"]
148
- }, ut = {
139
+ // (verified via GET /api/tags, not guessed): a model listed here and not
140
+ // pulled 404s at request time. qwen3.5:27b leads (PROVIDER_MODELS[p][0] is
141
+ // the auto-selected default on provider switch): 4/4 on the chat tool-call
142
+ // check, 1.5s to the first word; see PROVIDER_DEFAULT_MODEL in
143
+ // @ramme-io/shared. gpt-oss:20b is the faster, smaller second choice.
144
+ ollama: ["qwen3.5:27b", "gpt-oss:20b"]
145
+ }, ut = [
146
+ "llama3.3",
147
+ "llama3.2",
148
+ "qwen2.5:32b",
149
+ "qwen2.5-coder:32b",
150
+ "qwen2.5-coder:14b",
151
+ "qwen2.5-coder:7b"
152
+ ], dt = {
149
153
  "google-gemini": "Google Gemini",
150
154
  openai: "OpenAI",
151
155
  anthropic: "Anthropic (Claude)",
152
156
  grok: "xAI Grok",
153
157
  deepseek: "DeepSeek",
154
158
  ollama: "Ollama (Local)"
155
- }, dt = {
159
+ }, mt = {
156
160
  "google-gemini": "AIzaSy…",
157
161
  openai: "sk-…",
158
162
  anthropic: "sk-ant-…",
@@ -224,7 +228,7 @@ var f;
224
228
  (function(n) {
225
229
  n.ZodString = "ZodString", n.ZodNumber = "ZodNumber", n.ZodNaN = "ZodNaN", n.ZodBigInt = "ZodBigInt", n.ZodBoolean = "ZodBoolean", n.ZodDate = "ZodDate", n.ZodSymbol = "ZodSymbol", n.ZodUndefined = "ZodUndefined", n.ZodNull = "ZodNull", n.ZodAny = "ZodAny", n.ZodUnknown = "ZodUnknown", n.ZodNever = "ZodNever", n.ZodVoid = "ZodVoid", n.ZodArray = "ZodArray", n.ZodObject = "ZodObject", n.ZodUnion = "ZodUnion", n.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", n.ZodIntersection = "ZodIntersection", n.ZodTuple = "ZodTuple", n.ZodRecord = "ZodRecord", n.ZodMap = "ZodMap", n.ZodSet = "ZodSet", n.ZodFunction = "ZodFunction", n.ZodLazy = "ZodLazy", n.ZodLiteral = "ZodLiteral", n.ZodEnum = "ZodEnum", n.ZodEffects = "ZodEffects", n.ZodNativeEnum = "ZodNativeEnum", n.ZodOptional = "ZodOptional", n.ZodNullable = "ZodNullable", n.ZodDefault = "ZodDefault", n.ZodCatch = "ZodCatch", n.ZodPromise = "ZodPromise", n.ZodBranded = "ZodBranded", n.ZodPipeline = "ZodPipeline", n.ZodReadonly = "ZodReadonly";
226
230
  })(f || (f = {}));
227
- function P(n) {
231
+ function T(n) {
228
232
  if (n.target !== "openAi")
229
233
  return {};
230
234
  const e = [
@@ -337,7 +341,7 @@ function ge(n, e) {
337
341
  };
338
342
  }
339
343
  function fe(n, e) {
340
- return e.effectStrategy === "input" ? b(n.schema._def, e) : P(e);
344
+ return e.effectStrategy === "input" ? b(n.schema._def, e) : T(e);
341
345
  }
342
346
  function ye(n) {
343
347
  return {
@@ -447,10 +451,10 @@ function ne(n, e) {
447
451
  case "email":
448
452
  switch (e.emailStrategy) {
449
453
  case "format:email":
450
- $(r, "email", t.message, e);
454
+ I(r, "email", t.message, e);
451
455
  break;
452
456
  case "format:idn-email":
453
- $(r, "idn-email", t.message, e);
457
+ I(r, "idn-email", t.message, e);
454
458
  break;
455
459
  case "pattern:zod":
456
460
  _(r, R.email, t.message, e);
@@ -458,10 +462,10 @@ function ne(n, e) {
458
462
  }
459
463
  break;
460
464
  case "url":
461
- $(r, "uri", t.message, e);
465
+ I(r, "uri", t.message, e);
462
466
  break;
463
467
  case "uuid":
464
- $(r, "uuid", t.message, e);
468
+ I(r, "uuid", t.message, e);
465
469
  break;
466
470
  case "regex":
467
471
  _(r, t.regex, t.message, e);
@@ -479,16 +483,16 @@ function ne(n, e) {
479
483
  _(r, RegExp(`${z(t.value, e)}$`), t.message, e);
480
484
  break;
481
485
  case "datetime":
482
- $(r, "date-time", t.message, e);
486
+ I(r, "date-time", t.message, e);
483
487
  break;
484
488
  case "date":
485
- $(r, "date", t.message, e);
489
+ I(r, "date", t.message, e);
486
490
  break;
487
491
  case "time":
488
- $(r, "time", t.message, e);
492
+ I(r, "time", t.message, e);
489
493
  break;
490
494
  case "duration":
491
- $(r, "duration", t.message, e);
495
+ I(r, "duration", t.message, e);
492
496
  break;
493
497
  case "length":
494
498
  k(r, "minLength", typeof r.minLength == "number" ? Math.max(r.minLength, t.value) : t.value, t.message, e), k(r, "maxLength", typeof r.maxLength == "number" ? Math.min(r.maxLength, t.value) : t.value, t.message, e);
@@ -498,7 +502,7 @@ function ne(n, e) {
498
502
  break;
499
503
  }
500
504
  case "ip": {
501
- t.version !== "v6" && $(r, "ipv4", t.message, e), t.version !== "v4" && $(r, "ipv6", t.message, e);
505
+ t.version !== "v6" && I(r, "ipv4", t.message, e), t.version !== "v4" && I(r, "ipv6", t.message, e);
502
506
  break;
503
507
  }
504
508
  case "base64url":
@@ -521,7 +525,7 @@ function ne(n, e) {
521
525
  case "base64": {
522
526
  switch (e.base64Strategy) {
523
527
  case "format:binary": {
524
- $(r, "binary", t.message, e);
528
+ I(r, "binary", t.message, e);
525
529
  break;
526
530
  }
527
531
  case "contentEncoding:base64": {
@@ -550,7 +554,7 @@ function ke(n) {
550
554
  Ae.has(n[r]) || (e += "\\"), e += n[r];
551
555
  return e;
552
556
  }
553
- function $(n, e, r, t) {
557
+ function I(n, e, r, t) {
554
558
  var o;
555
559
  n.format || (o = n.anyOf) != null && o.some((a) => a.format) ? (n.anyOf || (n.anyOf = []), n.format && (n.anyOf.push({
556
560
  format: n.format,
@@ -638,7 +642,7 @@ function oe(n, e) {
638
642
  [u]: b(n.valueType._def, {
639
643
  ...e,
640
644
  currentPath: [...e.currentPath, "properties", u]
641
- }) ?? P(e)
645
+ }) ?? T(e)
642
646
  }), {}),
643
647
  additionalProperties: e.rejectedAdditionalProperties
644
648
  };
@@ -681,10 +685,10 @@ function ve(n, e) {
681
685
  const r = b(n.keyType._def, {
682
686
  ...e,
683
687
  currentPath: [...e.currentPath, "items", "items", "0"]
684
- }) || P(e), t = b(n.valueType._def, {
688
+ }) || T(e), t = b(n.valueType._def, {
685
689
  ...e,
686
690
  currentPath: [...e.currentPath, "items", "items", "1"]
687
- }) || P(e);
691
+ }) || T(e);
688
692
  return {
689
693
  type: "array",
690
694
  maxItems: 125,
@@ -705,7 +709,7 @@ function Se(n) {
705
709
  }
706
710
  function xe(n) {
707
711
  return n.target === "openAi" ? void 0 : {
708
- not: P({
712
+ not: T({
709
713
  ...n,
710
714
  currentPath: [...n.currentPath, "not"]
711
715
  })
@@ -719,7 +723,7 @@ function Oe(n) {
719
723
  type: "null"
720
724
  };
721
725
  }
722
- const L = {
726
+ const q = {
723
727
  ZodString: "string",
724
728
  ZodNumber: "number",
725
729
  ZodBigInt: "integer",
@@ -730,9 +734,9 @@ function _e(n, e) {
730
734
  if (e.target === "openApi3")
731
735
  return X(n, e);
732
736
  const r = n.options instanceof Map ? Array.from(n.options.values()) : n.options;
733
- if (r.every((t) => t._def.typeName in L && (!t._def.checks || !t._def.checks.length))) {
737
+ if (r.every((t) => t._def.typeName in q && (!t._def.checks || !t._def.checks.length))) {
734
738
  const t = r.reduce((o, a) => {
735
- const s = L[a._def.typeName];
739
+ const s = q[a._def.typeName];
736
740
  return s && !o.includes(s) ? [...o, s] : o;
737
741
  }, []);
738
742
  return {
@@ -782,14 +786,14 @@ const X = (n, e) => {
782
786
  })).filter((t) => !!t && (!e.strictUnions || typeof t == "object" && Object.keys(t).length > 0));
783
787
  return r.length ? { anyOf: r } : void 0;
784
788
  };
785
- function Pe(n, e) {
789
+ function Te(n, e) {
786
790
  if (["ZodString", "ZodNumber", "ZodBigInt", "ZodBoolean", "ZodNull"].includes(n.innerType._def.typeName) && (!n.innerType._def.checks || !n.innerType._def.checks.length))
787
791
  return e.target === "openApi3" ? {
788
- type: L[n.innerType._def.typeName],
792
+ type: q[n.innerType._def.typeName],
789
793
  nullable: !0
790
794
  } : {
791
795
  type: [
792
- L[n.innerType._def.typeName],
796
+ q[n.innerType._def.typeName],
793
797
  "null"
794
798
  ]
795
799
  };
@@ -806,7 +810,7 @@ function Pe(n, e) {
806
810
  });
807
811
  return r && { anyOf: [r, { type: "null" }] };
808
812
  }
809
- function Te(n, e) {
813
+ function Pe(n, e) {
810
814
  const r = {
811
815
  type: "number"
812
816
  };
@@ -838,7 +842,7 @@ function Re(n, e) {
838
842
  let i = a[c];
839
843
  if (i === void 0 || i._def === void 0)
840
844
  continue;
841
- let l = Ie(i);
845
+ let l = $e(i);
842
846
  l && r && (i._def.typeName === "ZodOptional" && (i = i._def.innerType), i.isNullable() || (i = i.nullable()), l = !1);
843
847
  const u = b(i._def, {
844
848
  ...e,
@@ -848,10 +852,10 @@ function Re(n, e) {
848
852
  u !== void 0 && (t.properties[c] = u, l || o.push(c));
849
853
  }
850
854
  o.length && (t.required = o);
851
- const s = $e(n, e);
855
+ const s = Ie(n, e);
852
856
  return s !== void 0 && (t.additionalProperties = s), t;
853
857
  }
854
- function $e(n, e) {
858
+ function Ie(n, e) {
855
859
  if (n.catchall._def.typeName !== "ZodNever")
856
860
  return b(n.catchall._def, {
857
861
  ...e,
@@ -866,7 +870,7 @@ function $e(n, e) {
866
870
  return e.removeAdditionalStrategy === "strict" ? e.allowedAdditionalProperties : e.rejectedAdditionalProperties;
867
871
  }
868
872
  }
869
- function Ie(n) {
873
+ function $e(n) {
870
874
  try {
871
875
  return n.isOptional();
872
876
  } catch {
@@ -884,11 +888,11 @@ const Ne = (n, e) => {
884
888
  return r ? {
885
889
  anyOf: [
886
890
  {
887
- not: P(e)
891
+ not: T(e)
888
892
  },
889
893
  r
890
894
  ]
891
- } : P(e);
895
+ } : T(e);
892
896
  }, je = (n, e) => {
893
897
  if (e.pipeStrategy === "input")
894
898
  return b(n.in._def, e);
@@ -908,7 +912,7 @@ const Ne = (n, e) => {
908
912
  function De(n, e) {
909
913
  return b(n.type._def, e);
910
914
  }
911
- function Ce(n, e) {
915
+ function Me(n, e) {
912
916
  const t = {
913
917
  type: "array",
914
918
  uniqueItems: !0,
@@ -919,7 +923,7 @@ function Ce(n, e) {
919
923
  };
920
924
  return n.minSize && k(t, "minItems", n.minSize.value, n.minSize.message, e), n.maxSize && k(t, "maxItems", n.maxSize.value, n.maxSize.message, e), t;
921
925
  }
922
- function Me(n, e) {
926
+ function Ce(n, e) {
923
927
  return n.rest ? {
924
928
  type: "array",
925
929
  minItems: n.items.length,
@@ -943,18 +947,18 @@ function Me(n, e) {
943
947
  }
944
948
  function Ze(n) {
945
949
  return {
946
- not: P(n)
950
+ not: T(n)
947
951
  };
948
952
  }
949
- function qe(n) {
950
- return P(n);
953
+ function Le(n) {
954
+ return T(n);
951
955
  }
952
- const Le = (n, e) => b(n.innerType._def, e), Ue = (n, e, r) => {
956
+ const qe = (n, e) => b(n.innerType._def, e), Ue = (n, e, r) => {
953
957
  switch (e) {
954
958
  case f.ZodString:
955
959
  return ne(n, r);
956
960
  case f.ZodNumber:
957
- return Te(n, r);
961
+ return Pe(n, r);
958
962
  case f.ZodObject:
959
963
  return Re(n, r);
960
964
  case f.ZodBigInt:
@@ -975,7 +979,7 @@ const Le = (n, e) => b(n.innerType._def, e), Ue = (n, e, r) => {
975
979
  case f.ZodIntersection:
976
980
  return be(n, r);
977
981
  case f.ZodTuple:
978
- return Me(n, r);
982
+ return Ce(n, r);
979
983
  case f.ZodRecord:
980
984
  return oe(n, r);
981
985
  case f.ZodLiteral:
@@ -985,13 +989,13 @@ const Le = (n, e) => b(n.innerType._def, e), Ue = (n, e, r) => {
985
989
  case f.ZodNativeEnum:
986
990
  return Se(n);
987
991
  case f.ZodNullable:
988
- return Pe(n, r);
992
+ return Te(n, r);
989
993
  case f.ZodOptional:
990
994
  return Ne(n, r);
991
995
  case f.ZodMap:
992
996
  return ve(n, r);
993
997
  case f.ZodSet:
994
- return Ce(n, r);
998
+ return Me(n, r);
995
999
  case f.ZodLazy:
996
1000
  return () => n.getter()._def;
997
1001
  case f.ZodPromise:
@@ -1002,15 +1006,15 @@ const Le = (n, e) => b(n.innerType._def, e), Ue = (n, e, r) => {
1002
1006
  case f.ZodEffects:
1003
1007
  return fe(n, r);
1004
1008
  case f.ZodAny:
1005
- return P(r);
1009
+ return T(r);
1006
1010
  case f.ZodUnknown:
1007
- return qe(r);
1011
+ return Le(r);
1008
1012
  case f.ZodDefault:
1009
1013
  return ge(n, r);
1010
1014
  case f.ZodBranded:
1011
1015
  return te(n, r);
1012
1016
  case f.ZodReadonly:
1013
- return Le(n, r);
1017
+ return qe(n, r);
1014
1018
  case f.ZodCatch:
1015
1019
  return pe(n, r);
1016
1020
  case f.ZodPipeline:
@@ -1054,7 +1058,7 @@ const ze = (n, e) => {
1054
1058
  return { $ref: ee(e.currentPath, n.path) };
1055
1059
  case "none":
1056
1060
  case "seen":
1057
- return n.path.length < e.currentPath.length && n.path.every((r, t) => e.currentPath[t] === r) ? (console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`), P(e)) : e.$refStrategy === "seen" ? P(e) : void 0;
1061
+ return n.path.length < e.currentPath.length && n.path.every((r, t) => e.currentPath[t] === r) ? (console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`), T(e)) : e.$refStrategy === "seen" ? T(e) : void 0;
1058
1062
  }
1059
1063
  }, Be = (n, e, r) => (n.description && (r.description = n.description, e.markdownDescription && (r.markdownDescription = n.description)), r), Je = (n, e) => {
1060
1064
  const r = le(e);
@@ -1063,12 +1067,12 @@ const ze = (n, e) => {
1063
1067
  [l]: b(u._def, {
1064
1068
  ...r,
1065
1069
  currentPath: [...r.basePath, r.definitionPath, l]
1066
- }, !0) ?? P(r)
1070
+ }, !0) ?? T(r)
1067
1071
  }), {}) : void 0;
1068
1072
  const o = typeof e == "string" ? e : (e == null ? void 0 : e.nameStrategy) === "title" || e == null ? void 0 : e.name, a = b(n._def, o === void 0 ? r : {
1069
1073
  ...r,
1070
1074
  currentPath: [...r.basePath, r.definitionPath, o]
1071
- }, !1) ?? P(r), s = typeof e == "object" && e.name !== void 0 && e.nameStrategy === "title" ? e.name : void 0;
1075
+ }, !1) ?? T(r), s = typeof e == "object" && e.name !== void 0 && e.nameStrategy === "title" ? e.name : void 0;
1072
1076
  s !== void 0 && (a.title = s), r.flags.hasReferencedOpenAiAnyType && (t || (t = {}), t[r.openAiAnyTypeName] || (t[r.openAiAnyTypeName] = {
1073
1077
  // Skipping "object" as no properties can be defined and additionalProperties must be "false"
1074
1078
  type: ["string", "number", "integer", "boolean", "array", "null"],
@@ -1096,7 +1100,7 @@ const ze = (n, e) => {
1096
1100
  };
1097
1101
  return r.target === "jsonSchema7" ? c.$schema = "http://json-schema.org/draft-07/schema#" : (r.target === "jsonSchema2019-09" || r.target === "openAi") && (c.$schema = "https://json-schema.org/draft/2019-09/schema#"), r.target === "openAi" && ("anyOf" in c || "oneOf" in c || "allOf" in c || "type" in c && Array.isArray(c.type)) && console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."), c;
1098
1102
  };
1099
- function mt(n) {
1103
+ function pt(n) {
1100
1104
  const e = Je(n.parameters, { target: "jsonSchema7", $refStrategy: "none" });
1101
1105
  return {
1102
1106
  name: n.name,
@@ -1327,6 +1331,11 @@ class We {
1327
1331
  model: a,
1328
1332
  messages: e.map((g) => ({ role: g.role, content: g.content })),
1329
1333
  stream: !0,
1334
+ // A thinking model (qwen3.5) otherwise reasons before its first word:
1335
+ // 4.0s median to first output against 1.5s with it off, and the same
1336
+ // 4/4 on the tool-call check (2026-11-25). A model without thinking
1337
+ // ignores the flag.
1338
+ think: !1,
1330
1339
  ...s && { tools: s }
1331
1340
  })
1332
1341
  });
@@ -1351,10 +1360,10 @@ class We {
1351
1360
  try {
1352
1361
  const E = JSON.parse(v);
1353
1362
  if ((m = E.message) != null && m.content && (yield { type: "text-delta", text: E.message.content }), (p = E.message) != null && p.tool_calls)
1354
- for (const I of E.message.tool_calls)
1363
+ for (const $ of E.message.tool_calls)
1355
1364
  yield {
1356
1365
  type: "tool-call",
1357
- toolCall: { name: (h = I.function) == null ? void 0 : h.name, arguments: ((w = I.function) == null ? void 0 : w.arguments) ?? {} }
1366
+ toolCall: { name: (h = $.function) == null ? void 0 : h.name, arguments: ((w = $.function) == null ? void 0 : w.arguments) ?? {} }
1358
1367
  };
1359
1368
  } catch {
1360
1369
  }
@@ -1451,7 +1460,7 @@ Do not include any explanation, only the raw JSON object.`, a = await this.gener
1451
1460
  return o.code = "API_ERROR", o.status = e, o;
1452
1461
  }
1453
1462
  }
1454
- const q = (n) => {
1463
+ const L = (n) => {
1455
1464
  try {
1456
1465
  return JSON.parse(n);
1457
1466
  } catch {
@@ -1514,7 +1523,7 @@ class Fe {
1514
1523
  });
1515
1524
  if (!m.ok) {
1516
1525
  const v = await m.text();
1517
- throw this.normalizeError(m.status, q(v));
1526
+ throw this.normalizeError(m.status, L(v));
1518
1527
  }
1519
1528
  if (!m.body) throw new Error("No response body for streaming");
1520
1529
  const p = m.body.getReader(), h = new TextDecoder();
@@ -1524,19 +1533,19 @@ class Fe {
1524
1533
  const { done: v, value: E } = await p.read();
1525
1534
  if (v) break;
1526
1535
  w += h.decode(E, { stream: !0 });
1527
- const I = w.split(`
1536
+ const $ = w.split(`
1528
1537
  `);
1529
- w = I.pop() || "";
1530
- for (const j of I) {
1538
+ w = $.pop() || "";
1539
+ for (const j of $) {
1531
1540
  const N = j.trim();
1532
1541
  if (!(!N || !N.startsWith("data: ")))
1533
1542
  try {
1534
- const T = JSON.parse(N.slice(6));
1535
- if (T.type === "content_block_start" && ((y = T.content_block) == null ? void 0 : y.type) === "tool_use")
1536
- g = { id: T.content_block.id, name: T.content_block.name, argsBuf: "" };
1537
- else if (T.type === "content_block_delta")
1538
- ((A = T.delta) == null ? void 0 : A.type) === "text_delta" && T.delta.text ? yield { type: "text-delta", text: T.delta.text } : ((S = T.delta) == null ? void 0 : S.type) === "input_json_delta" && g && (g.argsBuf += T.delta.partial_json ?? "");
1539
- else if (T.type === "content_block_stop" && g) {
1543
+ const P = JSON.parse(N.slice(6));
1544
+ if (P.type === "content_block_start" && ((y = P.content_block) == null ? void 0 : y.type) === "tool_use")
1545
+ g = { id: P.content_block.id, name: P.content_block.name, argsBuf: "" };
1546
+ else if (P.type === "content_block_delta")
1547
+ ((A = P.delta) == null ? void 0 : A.type) === "text_delta" && P.delta.text ? yield { type: "text-delta", text: P.delta.text } : ((S = P.delta) == null ? void 0 : S.type) === "input_json_delta" && g && (g.argsBuf += P.delta.partial_json ?? "");
1548
+ else if (P.type === "content_block_stop" && g) {
1540
1549
  try {
1541
1550
  yield {
1542
1551
  type: "tool-call",
@@ -1587,7 +1596,7 @@ class Fe {
1587
1596
  });
1588
1597
  if (!i.ok) {
1589
1598
  const m = await i.text();
1590
- throw console.error("🔴 RAW ANTHROPIC ERROR:", i.status, m), console.error("🔴 Request was made to:", `${c}/messages`), console.error("🔴 Model requested:", o), this.normalizeError(i.status, q(m));
1599
+ throw console.error("🔴 RAW ANTHROPIC ERROR:", i.status, m), console.error("🔴 Request was made to:", `${c}/messages`), console.error("🔴 Model requested:", o), this.normalizeError(i.status, L(m));
1591
1600
  }
1592
1601
  return ((d = (u = (await i.json()).content) == null ? void 0 : u[0]) == null ? void 0 : d.text) || "";
1593
1602
  }
@@ -1621,7 +1630,7 @@ class Fe {
1621
1630
  });
1622
1631
  if (!i.ok) {
1623
1632
  const p = await i.text();
1624
- throw console.error("🔴 RAW ANTHROPIC STREAM ERROR:", i.status, p), console.error("🔴 Request was made to:", `${c}/messages`), console.error("🔴 Model requested:", o), this.normalizeError(i.status, q(p));
1633
+ throw console.error("🔴 RAW ANTHROPIC STREAM ERROR:", i.status, p), console.error("🔴 Request was made to:", `${c}/messages`), console.error("🔴 Model requested:", o), this.normalizeError(i.status, L(p));
1625
1634
  }
1626
1635
  if (!i.body) throw new Error("No response body for streaming");
1627
1636
  const l = i.body.getReader(), u = new TextDecoder();
@@ -1699,7 +1708,7 @@ IMPORTANT: Respond ONLY with valid JSON. No markdown, no explanation, just the J
1699
1708
  });
1700
1709
  if (!d.ok) {
1701
1710
  const A = await d.text();
1702
- throw console.error("🔴 RAW ANTHROPIC OBJECT ERROR:", d.status, A), console.error("🔴 Request was made to:", `${i}/messages`), console.error("🔴 Model requested:", a), this.normalizeError(d.status, q(A));
1711
+ throw console.error("🔴 RAW ANTHROPIC OBJECT ERROR:", d.status, A), console.error("🔴 Request was made to:", `${i}/messages`), console.error("🔴 Model requested:", a), this.normalizeError(d.status, L(A));
1703
1712
  }
1704
1713
  const p = ((y = (g = (await d.json()).content) == null ? void 0 : g[0]) == null ? void 0 : y.text) || "{}", h = p.match(/\{[\s\S]*\}/), w = h ? h[0] : p;
1705
1714
  return JSON.parse(w);
@@ -1726,7 +1735,7 @@ IMPORTANT: Respond ONLY with valid JSON. No markdown, no explanation, just the J
1726
1735
  return o.code = "API_ERROR", o.status = e, o;
1727
1736
  }
1728
1737
  }
1729
- function C(n) {
1738
+ function M(n) {
1730
1739
  if (!(!n || n.length === 0))
1731
1740
  return n.map((e) => ({
1732
1741
  type: "function",
@@ -1766,8 +1775,8 @@ async function* Y(n, e, r, t) {
1766
1775
  if (!v) continue;
1767
1776
  if (v.content && (yield { type: "text-delta", text: v.content }), v.tool_calls)
1768
1777
  for (const E of v.tool_calls) {
1769
- const I = E.index ?? 0, j = i.get(I) ?? { name: "", args: "" };
1770
- E.id && (j.id = E.id), (d = E.function) != null && d.name && (j.name += E.function.name), (m = E.function) != null && m.arguments && (j.args += E.function.arguments), i.set(I, j);
1778
+ const $ = E.index ?? 0, j = i.get($) ?? { name: "", args: "" };
1779
+ E.id && (j.id = E.id), (d = E.function) != null && d.name && (j.name += E.function.name), (m = E.function) != null && m.arguments && (j.args += E.function.arguments), i.set($, j);
1771
1780
  }
1772
1781
  } catch {
1773
1782
  }
@@ -1805,7 +1814,7 @@ class Ve {
1805
1814
  messages: W(e),
1806
1815
  temperature: s,
1807
1816
  stream: !0,
1808
- ...C(t) && { tools: C(t), tool_choice: "auto" }
1817
+ ...M(t) && { tools: M(t), tool_choice: "auto" }
1809
1818
  },
1810
1819
  this.normalizeError
1811
1820
  );
@@ -1946,7 +1955,7 @@ class Ke {
1946
1955
  messages: W(e),
1947
1956
  temperature: s,
1948
1957
  stream: !0,
1949
- ...C(t) && { tools: C(t), tool_choice: "auto" }
1958
+ ...M(t) && { tools: M(t), tool_choice: "auto" }
1950
1959
  },
1951
1960
  this.normalizeError
1952
1961
  );
@@ -2076,7 +2085,7 @@ class Xe {
2076
2085
  messages: W(e),
2077
2086
  temperature: s,
2078
2087
  stream: !0,
2079
- ...C(t) && { tools: C(t), tool_choice: "auto" }
2088
+ ...M(t) && { tools: M(t), tool_choice: "auto" }
2080
2089
  },
2081
2090
  this.normalizeError
2082
2091
  );
@@ -2301,8 +2310,8 @@ class D {
2301
2310
  return o.listModels(r, t);
2302
2311
  }
2303
2312
  }
2304
- const ht = D.getInstance();
2305
- class gt {
2313
+ const gt = D.getInstance();
2314
+ class ft {
2306
2315
  /**
2307
2316
  * Resolve configuration with 3-tier priority:
2308
2317
  * 1. User's localStorage override (highest priority)
@@ -2396,7 +2405,7 @@ class gt {
2396
2405
  const et = ([n, e, r]) => n >> 3 << 11 | e >> 2 << 5 | r >> 3, tt = (n) => {
2397
2406
  const e = n >> 11 & 31, r = n >> 5 & 63, t = n & 31;
2398
2407
  return [e << 3 | e >> 2, r << 2 | r >> 4, t << 3 | t >> 2];
2399
- }, H = (n) => Math.ceil(n / 2), ae = (n, e, r) => O.headerBytes + r * 2 + H(n) * e, ft = (n) => {
2408
+ }, H = (n) => Math.ceil(n / 2), ae = (n, e, r) => O.headerBytes + r * 2 + H(n) * e, yt = (n) => {
2400
2409
  const { width: e, height: r, palette: t, indices: o } = n;
2401
2410
  if (!Number.isInteger(e) || !Number.isInteger(r) || e < 1 || r < 1 || e > 65535 || r > 65535)
2402
2411
  throw new RangeError(`encodeSpr: bad size ${e}x${r}`);
@@ -2419,7 +2428,7 @@ const et = ([n, e, r]) => n >> 3 << 11 | e >> 2 << 5 | r >> 3, tt = (n) => {
2419
2428
  a[m] |= u & 1 ? d : d << 4;
2420
2429
  }
2421
2430
  return a;
2422
- }, yt = (n) => {
2431
+ }, wt = (n) => {
2423
2432
  const e = (m) => ({ ok: !1, reason: m });
2424
2433
  if (n.length < O.headerBytes) return e("shorter than the header");
2425
2434
  if (n.length > F) return e(`${n.length} bytes; at most ${F}`);
@@ -2457,10 +2466,10 @@ const et = ([n, e, r]) => n >> 3 << 11 | e >> 2 << 5 | r >> 3, tt = (n) => {
2457
2466
  `).map((i) => i.trim()).filter((i) => i.length > 0);
2458
2467
  if (r.length === 0) return { ok: !1, error: "grid has no rows" };
2459
2468
  const t = r.length, o = r[0].length;
2460
- if (o > M || t > M)
2469
+ if (o > C || t > C)
2461
2470
  return {
2462
2471
  ok: !1,
2463
- error: `grid is ${o}x${t} and the largest sprite is ${M}x${M}`
2472
+ error: `grid is ${o}x${t} and the largest sprite is ${C}x${C}`
2464
2473
  };
2465
2474
  const a = r.map((i, l) => ({ i: l, len: i.length })).filter((i) => i.len !== o);
2466
2475
  if (a.length > 0) {
@@ -2488,7 +2497,7 @@ const et = ([n, e, r]) => n >> 3 << 11 | e >> 2 << 5 | r >> 3, tt = (n) => {
2488
2497
  c[d] |= l & 1 ? u : u << 4;
2489
2498
  }
2490
2499
  return { ok: !0, sprite: { width: o, height: t, palette: e, pixels: rt(c) } };
2491
- }, wt = (n) => {
2500
+ }, bt = (n) => {
2492
2501
  const e = nt(n.pixels), r = Math.ceil(n.width / 2), t = [];
2493
2502
  for (let o = 0; o < n.height; o++) {
2494
2503
  let a = "";
@@ -2500,7 +2509,7 @@ const et = ([n, e, r]) => n >> 3 << 11 | e >> 2 << 5 | r >> 3, tt = (n) => {
2500
2509
  }
2501
2510
  return t.join(`
2502
2511
  `);
2503
- }, bt = (n) => {
2512
+ }, Et = (n) => {
2504
2513
  const e = [];
2505
2514
  if (!n || typeof n != "object") return { value: n, issues: e };
2506
2515
  const r = n.blocks;
@@ -2553,7 +2562,7 @@ class it {
2553
2562
  return this.rateLimiter.getRemainingRequests();
2554
2563
  }
2555
2564
  }
2556
- const Et = new it({ maxRequests: 10, windowMs: 6e4 });
2565
+ const At = new it({ maxRequests: 10, windowMs: 6e4 });
2557
2566
  export {
2558
2567
  se as A,
2559
2568
  Xe as D,
@@ -2561,25 +2570,26 @@ export {
2561
2570
  Qe as I,
2562
2571
  We as O,
2563
2572
  G as P,
2573
+ ut as R,
2564
2574
  D as a,
2565
- ht as b,
2566
- gt as c,
2575
+ gt as b,
2576
+ ft as c,
2567
2577
  Fe as d,
2568
2578
  Ve as e,
2569
2579
  Ke as f,
2570
2580
  it as g,
2571
- Et as h,
2572
- yt as i,
2573
- ft as j,
2581
+ At as h,
2582
+ wt as i,
2583
+ yt as j,
2574
2584
  ae as k,
2575
- ut as l,
2585
+ dt as l,
2576
2586
  at as m,
2577
- bt as n,
2578
- wt as o,
2587
+ Et as n,
2588
+ bt as o,
2579
2589
  et as p,
2580
2590
  tt as q,
2581
- dt as r,
2591
+ mt as r,
2582
2592
  lt as s,
2583
- mt as t,
2593
+ pt as t,
2584
2594
  Ge as u
2585
2595
  };
@@ -1,4 +1,4 @@
1
- import { S, i as E } from "./deviceReadings-D8PeyG1y.js";
1
+ import { S, i as E } from "./deviceReadings-C4Rzi815.js";
2
2
  import f from "react";
3
3
  const p = (t) => {
4
4
  let s;
@@ -1030,7 +1030,7 @@ var j = "gemini-2.5-flash", lt = "gemini-2.5-flash", ut = "gemini-2.5-pro", Ht =
1030
1030
  anthropic: "claude-haiku-4-5-20251001",
1031
1031
  grok: "grok-2-1212",
1032
1032
  deepseek: "deepseek-chat",
1033
- ollama: "llama3.3"
1033
+ ollama: "qwen3.5:27b"
1034
1034
  }, Ut = {
1035
1035
  /** The Strategist: high creativity, exploratory conversation */
1036
1036
  STRATEGIST: {