@ramme-io/kernel 3.0.0 → 3.0.2

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.
@@ -308,17 +308,17 @@ e.object({
308
308
  var V = {};
309
309
  x(V, {
310
310
  BodewellCommandSchema: () => G,
311
- BodewellDeviceID: () => S,
311
+ BodewellDeviceID: () => R,
312
312
  BodewellTelemetrySchema: () => B
313
313
  });
314
- var S = e.enum([
314
+ var R = e.enum([
315
315
  "STK-V1-001",
316
316
  "STK-V1-002",
317
317
  "STK-V1-003",
318
318
  "STK-PRO-001",
319
319
  "STK-VIS-001"
320
320
  ]), B = e.object({
321
- device_id: S,
321
+ device_id: R,
322
322
  stick_id: e.string().optional().describe("Firmware alias for device_id"),
323
323
  timestamp: e.number().optional().describe("Epoch timestamp from NTP"),
324
324
  air_temp: e.number().optional().describe("Celsius"),
@@ -332,7 +332,7 @@ var S = e.enum([
332
332
  soil_moisture: e.number().optional().describe("Firmware alias for raw capacitance"),
333
333
  soil_moisture_raw: e.number().optional().describe("Unscaled capacitance (300-1100)")
334
334
  }).passthrough(), G = e.object({
335
- stick_id: S,
335
+ stick_id: R,
336
336
  // Note: Your API uses stick_id here, not device_id
337
337
  type: e.enum(["dry", "wet"]),
338
338
  value: e.number()
@@ -353,7 +353,7 @@ e.object({
353
353
  }).describe("The time range for the chart. Choose based on user request or default to '1M'."),
354
354
  metrics: e.array(e.enum(["price", "volume", "moving_average"])).min(1, "At least one metric is required").describe("Array of metrics to display. Always include 'price' and 'volume' unless user specifies otherwise.")
355
355
  });
356
- var R = "gemini-2.5-flash", z = "gemini-2.5-flash", H = "gemini-2.5-pro", pe = {
356
+ var S = "gemini-2.5-flash", z = "gemini-2.5-flash", H = "gemini-2.5-pro", pe = {
357
357
  /** The Strategist: high creativity, exploratory conversation */
358
358
  STRATEGIST: {
359
359
  model: z,
@@ -362,13 +362,13 @@ var R = "gemini-2.5-flash", z = "gemini-2.5-flash", H = "gemini-2.5-pro", pe = {
362
362
  },
363
363
  /** The Architect: data schema and resource modeling — precision required */
364
364
  ARCHITECT: {
365
- model: R,
365
+ model: S,
366
366
  provider: "google-gemini",
367
367
  temperature: 0.3
368
368
  },
369
369
  /** The Designer: UI layout generation — moderate creativity */
370
370
  DESIGNER: {
371
- model: R,
371
+ model: S,
372
372
  provider: "google-gemini",
373
373
  temperature: 0.5
374
374
  },
@@ -382,44 +382,44 @@ var R = "gemini-2.5-flash", z = "gemini-2.5-flash", H = "gemini-2.5-pro", pe = {
382
382
  },
383
383
  /** The Genesis Engine: one-shot app generation — must be schema-strict */
384
384
  GENESIS: {
385
- model: R,
385
+ model: S,
386
386
  provider: "google-gemini",
387
387
  temperature: 0.2
388
388
  }
389
- }, w = e.string().regex(
389
+ }, g = e.string().regex(
390
390
  /^\d{1,3}\s+\d{1,3}\s+\d{1,3}$/,
391
391
  'Must be space-separated RGB integers (e.g. "13 110 253")'
392
392
  ), W = e.object({
393
393
  // ── Core Brand ───────────────────────────────────────────────────────────
394
- "--app-primary-color": w.optional(),
395
- "--app-primary-foreground-color": w.optional(),
396
- "--app-secondary-color": w.optional(),
397
- "--app-secondary-foreground-color": w.optional(),
398
- "--app-accent-color": w.optional(),
399
- "--app-accent-foreground-color": w.optional(),
394
+ "--app-primary-color": g.optional(),
395
+ "--app-primary-foreground-color": g.optional(),
396
+ "--app-secondary-color": g.optional(),
397
+ "--app-secondary-foreground-color": g.optional(),
398
+ "--app-accent-color": g.optional(),
399
+ "--app-accent-foreground-color": g.optional(),
400
400
  // ── Base Surface ─────────────────────────────────────────────────────────
401
- "--app-bg-color": w.optional(),
402
- "--app-card-bg-color": w.optional(),
403
- "--app-text-color": w.optional(),
404
- "--app-border-color": w.optional(),
405
- "--app-muted-bg": w.optional(),
406
- "--app-muted-text": w.optional(),
401
+ "--app-bg-color": g.optional(),
402
+ "--app-card-bg-color": g.optional(),
403
+ "--app-text-color": g.optional(),
404
+ "--app-border-color": g.optional(),
405
+ "--app-muted-bg": g.optional(),
406
+ "--app-muted-text": g.optional(),
407
407
  // ── Shape ────────────────────────────────────────────────────────────────
408
408
  "--app-border-radius-sm": e.string().optional(),
409
409
  "--app-border-radius-md": e.string().optional(),
410
410
  "--app-border-radius-lg": e.string().optional(),
411
411
  // ── Form Controls ────────────────────────────────────────────────────────
412
- "--app-input-bg-color": w.optional(),
413
- "--app-input-text-color": w.optional(),
414
- "--app-input-border-color": w.optional(),
415
- "--app-input-focus-ring-color": w.optional(),
416
- "--app-input-placeholder-color": w.optional(),
412
+ "--app-input-bg-color": g.optional(),
413
+ "--app-input-text-color": g.optional(),
414
+ "--app-input-border-color": g.optional(),
415
+ "--app-input-focus-ring-color": g.optional(),
416
+ "--app-input-placeholder-color": g.optional(),
417
417
  // ── Chart Palette ────────────────────────────────────────────────────────
418
- "--app-chart-1": w.optional(),
419
- "--app-chart-2": w.optional(),
420
- "--app-chart-3": w.optional(),
421
- "--app-chart-4": w.optional(),
422
- "--app-chart-5": w.optional()
418
+ "--app-chart-1": g.optional(),
419
+ "--app-chart-2": g.optional(),
420
+ "--app-chart-3": g.optional(),
421
+ "--app-chart-4": g.optional(),
422
+ "--app-chart-5": g.optional()
423
423
  }).strict(), X = e.object({
424
424
  /** Google Font name for headings (h1–h4, .font-serif). Example: "Playfair Display" */
425
425
  heading: e.string(),
@@ -442,6 +442,22 @@ e.object({
442
442
  */
443
443
  cssVars: W
444
444
  });
445
+ e.object({
446
+ primary: g,
447
+ neutral: g,
448
+ success: g,
449
+ warning: g,
450
+ destructive: g,
451
+ radius: e.enum(["none", "sm", "md", "lg", "full"])
452
+ });
453
+ var me = {
454
+ primary: "13 110 253",
455
+ neutral: "24 24 27",
456
+ success: "34 197 94",
457
+ warning: "234 179 8",
458
+ destructive: "239 68 68",
459
+ radius: "md"
460
+ };
445
461
  e.object({
446
462
  id: e.string().default(""),
447
463
  name: e.string(),
@@ -498,21 +514,21 @@ class Q {
498
514
  }
499
515
  );
500
516
  if (!n.ok) {
501
- const g = await n.text();
502
- throw new Error(`Gemini Error ${n.status}: ${g}`);
517
+ const w = await n.text();
518
+ throw new Error(`Gemini Error ${n.status}: ${w}`);
503
519
  }
504
520
  const s = (d = n.body) == null ? void 0 : d.getReader();
505
521
  if (!s) throw new Error("No response body");
506
522
  const c = new TextDecoder();
507
523
  let i = "";
508
524
  for (; ; ) {
509
- const { done: g, value: y } = await s.read();
510
- if (g) break;
511
- i += c.decode(y, { stream: !0 });
512
- const E = i.split(`
525
+ const { done: w, value: E } = await s.read();
526
+ if (w) break;
527
+ i += c.decode(E, { stream: !0 });
528
+ const y = i.split(`
513
529
  `);
514
- i = E.pop() || "";
515
- for (const f of E) {
530
+ i = y.pop() || "";
531
+ for (const f of y) {
516
532
  const b = f.trim();
517
533
  if (!(!b || !b.startsWith("data: ")))
518
534
  try {
@@ -626,8 +642,8 @@ class Z {
626
642
  const u = h.trim();
627
643
  if (u)
628
644
  try {
629
- const g = JSON.parse(u);
630
- g.response && (yield g.response);
645
+ const w = JSON.parse(u);
646
+ w.response && (yield w.response);
631
647
  } catch {
632
648
  continue;
633
649
  }
@@ -731,8 +747,8 @@ class ee {
731
747
  const u = await i.text();
732
748
  console.error("🔴 RAW ANTHROPIC STREAM ERROR:", i.status, u), console.error("🔴 Request was made to:", `${c}/messages`), console.error("🔴 Model requested:", t);
733
749
  try {
734
- const g = JSON.parse(u);
735
- throw new Error(`Anthropic ${i.status}: ${((m = g.error) == null ? void 0 : m.message) || JSON.stringify(g)}`);
750
+ const w = JSON.parse(u);
751
+ throw new Error(`Anthropic ${i.status}: ${((m = w.error) == null ? void 0 : m.message) || JSON.stringify(w)}`);
736
752
  } catch {
737
753
  throw new Error(`Anthropic ${i.status}: ${u}`);
738
754
  }
@@ -742,14 +758,14 @@ class ee {
742
758
  let l = "";
743
759
  try {
744
760
  for (; ; ) {
745
- const { done: u, value: g } = await d.read();
761
+ const { done: u, value: w } = await d.read();
746
762
  if (u) break;
747
- l += p.decode(g, { stream: !0 });
748
- const y = l.split(`
763
+ l += p.decode(w, { stream: !0 });
764
+ const E = l.split(`
749
765
  `);
750
- l = y.pop() || "";
751
- for (const E of y) {
752
- const f = E.trim();
766
+ l = E.pop() || "";
767
+ for (const y of E) {
768
+ const f = y.trim();
753
769
  if (!f || !f.startsWith("data: ")) continue;
754
770
  const b = f.slice(6);
755
771
  try {
@@ -765,7 +781,7 @@ class ee {
765
781
  }
766
782
  }
767
783
  async generateObject(o, a) {
768
- var u, g, y;
784
+ var u, w, E;
769
785
  const {
770
786
  apiKey: r,
771
787
  model: t = "claude-sonnet-4-5-20250929",
@@ -794,16 +810,16 @@ IMPORTANT: Respond ONLY with valid JSON. No markdown, no explanation, just the J
794
810
  })
795
811
  });
796
812
  if (!d.ok) {
797
- const E = await d.text();
798
- console.error("🔴 RAW ANTHROPIC OBJECT ERROR:", d.status, E), console.error("🔴 Request was made to:", `${c}/messages`), console.error("🔴 Model requested:", t);
813
+ const y = await d.text();
814
+ console.error("🔴 RAW ANTHROPIC OBJECT ERROR:", d.status, y), console.error("🔴 Request was made to:", `${c}/messages`), console.error("🔴 Model requested:", t);
799
815
  try {
800
- const f = JSON.parse(E);
816
+ const f = JSON.parse(y);
801
817
  throw new Error(`Anthropic ${d.status}: ${((u = f.error) == null ? void 0 : u.message) || JSON.stringify(f)}`);
802
818
  } catch {
803
- throw new Error(`Anthropic ${d.status}: ${E}`);
819
+ throw new Error(`Anthropic ${d.status}: ${y}`);
804
820
  }
805
821
  }
806
- const l = ((y = (g = (await d.json()).content) == null ? void 0 : g[0]) == null ? void 0 : y.text) || "{}", m = l.match(/\{[\s\S]*\}/), h = m ? m[0] : l;
822
+ const l = ((E = (w = (await d.json()).content) == null ? void 0 : w[0]) == null ? void 0 : E.text) || "{}", m = l.match(/\{[\s\S]*\}/), h = m ? m[0] : l;
807
823
  return JSON.parse(h);
808
824
  }
809
825
  async listModels(o, a) {
@@ -882,14 +898,14 @@ class te {
882
898
  let p = "";
883
899
  try {
884
900
  for (; ; ) {
885
- const { done: u, value: g } = await i.read();
901
+ const { done: u, value: w } = await i.read();
886
902
  if (u) break;
887
- p += d.decode(g, { stream: !0 });
888
- const y = p.split(`
903
+ p += d.decode(w, { stream: !0 });
904
+ const E = p.split(`
889
905
  `);
890
- p = y.pop() || "";
891
- for (const E of y) {
892
- const f = E.trim();
906
+ p = E.pop() || "";
907
+ for (const y of E) {
908
+ const f = y.trim();
893
909
  if (!f || !f.startsWith("data: ")) continue;
894
910
  const b = f.slice(6);
895
911
  if (b !== "[DONE]")
@@ -1007,14 +1023,14 @@ class re {
1007
1023
  let p = "";
1008
1024
  try {
1009
1025
  for (; ; ) {
1010
- const { done: u, value: g } = await i.read();
1026
+ const { done: u, value: w } = await i.read();
1011
1027
  if (u) break;
1012
- p += d.decode(g, { stream: !0 });
1013
- const y = p.split(`
1028
+ p += d.decode(w, { stream: !0 });
1029
+ const E = p.split(`
1014
1030
  `);
1015
- p = y.pop() || "";
1016
- for (const E of y) {
1017
- const f = E.trim();
1031
+ p = E.pop() || "";
1032
+ for (const y of E) {
1033
+ const f = y.trim();
1018
1034
  if (!f || !f.startsWith("data: ")) continue;
1019
1035
  const b = f.slice(6);
1020
1036
  if (b !== "[DONE]")
@@ -1030,7 +1046,7 @@ class re {
1030
1046
  }
1031
1047
  }
1032
1048
  async generateObject(o, a, r) {
1033
- var u, g, y;
1049
+ var u, w, E;
1034
1050
  const { apiKey: t, model: n = "grok-beta", temperature: s = 0.7, baseUrl: c = "https://api.x.ai/v1" } = r;
1035
1051
  if (!t) throw new Error("Grok API key required");
1036
1052
  const i = `${o}
@@ -1048,10 +1064,10 @@ Respond with valid JSON only.`, d = await fetch(`${c}/chat/completions`, {
1048
1064
  })
1049
1065
  });
1050
1066
  if (!d.ok) {
1051
- const E = await d.json();
1052
- throw this.normalizeError(d.status, E);
1067
+ const y = await d.json();
1068
+ throw this.normalizeError(d.status, y);
1053
1069
  }
1054
- const l = ((y = (g = (u = (await d.json()).choices) == null ? void 0 : u[0]) == null ? void 0 : g.message) == null ? void 0 : y.content) || "{}", m = l.match(/\{[\s\S]*\}/), h = m ? m[0] : l;
1070
+ const l = ((E = (w = (u = (await d.json()).choices) == null ? void 0 : u[0]) == null ? void 0 : w.message) == null ? void 0 : E.content) || "{}", m = l.match(/\{[\s\S]*\}/), h = m ? m[0] : l;
1055
1071
  return JSON.parse(h);
1056
1072
  }
1057
1073
  async listModels(o, a) {
@@ -1121,14 +1137,14 @@ class oe {
1121
1137
  let p = "";
1122
1138
  try {
1123
1139
  for (; ; ) {
1124
- const { done: u, value: g } = await i.read();
1140
+ const { done: u, value: w } = await i.read();
1125
1141
  if (u) break;
1126
- p += d.decode(g, { stream: !0 });
1127
- const y = p.split(`
1142
+ p += d.decode(w, { stream: !0 });
1143
+ const E = p.split(`
1128
1144
  `);
1129
- p = y.pop() || "";
1130
- for (const E of y) {
1131
- const f = E.trim();
1145
+ p = E.pop() || "";
1146
+ for (const y of E) {
1147
+ const f = y.trim();
1132
1148
  if (!f || !f.startsWith("data: ")) continue;
1133
1149
  const b = f.slice(6);
1134
1150
  if (b !== "[DONE]")
@@ -1277,8 +1293,8 @@ class I {
1277
1293
  return t.listModels(a, r);
1278
1294
  }
1279
1295
  }
1280
- const ue = I.getInstance(), k = {};
1281
- class he {
1296
+ const he = I.getInstance(), k = {};
1297
+ class ge {
1282
1298
  /**
1283
1299
  * Resolve configuration with 3-tier priority:
1284
1300
  * 1. User's localStorage override (highest priority)
@@ -1424,9 +1440,9 @@ class ne {
1424
1440
  return this.rateLimiter.getRemainingRequests();
1425
1441
  }
1426
1442
  }
1427
- const ge = new ne({ maxRequests: 10, windowMs: 6e4 });
1443
+ const we = new ne({ maxRequests: 10, windowMs: 6e4 });
1428
1444
  export {
1429
- he as A,
1445
+ ge as A,
1430
1446
  U as B,
1431
1447
  z as D,
1432
1448
  j as E,
@@ -1439,19 +1455,20 @@ export {
1439
1455
  F as S,
1440
1456
  D as T,
1441
1457
  L as W,
1442
- ue as a,
1443
- ne as b,
1444
- ge as c,
1445
- ce as d,
1446
- I as e,
1447
- ee as f,
1448
- te as g,
1449
- re as h,
1450
- oe as i,
1451
- P as j,
1452
- q as k,
1453
- K as l,
1454
- le as m,
1455
- pe as n,
1456
- R as o
1458
+ me as a,
1459
+ he as b,
1460
+ I as c,
1461
+ ne as d,
1462
+ we as e,
1463
+ ce as f,
1464
+ ee as g,
1465
+ te as h,
1466
+ re as i,
1467
+ oe as j,
1468
+ P as k,
1469
+ q as l,
1470
+ K as m,
1471
+ le as n,
1472
+ pe as o,
1473
+ S as p
1457
1474
  };