@ramme-io/kernel 3.0.0 → 3.0.1
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/{AiGateway-CwdiRjH4.js → AiGateway-Bkgzga14.js} +113 -96
- package/dist/index.es.js +6393 -5979
- package/dist/kernel/src/auth/AuthContext.d.ts +7 -0
- package/dist/kernel/src/auth/AuthContext.d.ts.map +1 -1
- package/dist/kernel/src/components/AIChatPanel.d.ts.map +1 -1
- package/dist/kernel/src/components/RammeInspector.d.ts +4 -0
- package/dist/kernel/src/components/RammeInspector.d.ts.map +1 -0
- package/dist/kernel/src/components/ThemeLabPage.d.ts +22 -0
- package/dist/kernel/src/components/ThemeLabPage.d.ts.map +1 -0
- package/dist/kernel/src/hooks/useInspectorShortcut.d.ts +2 -0
- package/dist/kernel/src/hooks/useInspectorShortcut.d.ts.map +1 -0
- package/dist/kernel/src/index.d.ts +4 -0
- package/dist/kernel/src/index.d.ts.map +1 -1
- package/dist/kernel/src/services/ai/generateThemeWithAI.d.ts +8 -0
- package/dist/kernel/src/services/ai/generateThemeWithAI.d.ts.map +1 -0
- package/dist/kernel/src/stores/spatialStore.d.ts +0 -6
- package/dist/kernel/src/stores/spatialStore.d.ts.map +1 -1
- package/dist/kernel/src/stores/useSettingsStore.d.ts +16 -0
- package/dist/kernel/src/stores/useSettingsStore.d.ts.map +1 -1
- package/dist/server.es.js +2 -2
- package/package.json +8 -4
|
@@ -308,17 +308,17 @@ e.object({
|
|
|
308
308
|
var V = {};
|
|
309
309
|
x(V, {
|
|
310
310
|
BodewellCommandSchema: () => G,
|
|
311
|
-
BodewellDeviceID: () =>
|
|
311
|
+
BodewellDeviceID: () => R,
|
|
312
312
|
BodewellTelemetrySchema: () => B
|
|
313
313
|
});
|
|
314
|
-
var
|
|
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:
|
|
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:
|
|
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
|
|
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:
|
|
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:
|
|
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:
|
|
385
|
+
model: S,
|
|
386
386
|
provider: "google-gemini",
|
|
387
387
|
temperature: 0.2
|
|
388
388
|
}
|
|
389
|
-
},
|
|
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":
|
|
395
|
-
"--app-primary-foreground-color":
|
|
396
|
-
"--app-secondary-color":
|
|
397
|
-
"--app-secondary-foreground-color":
|
|
398
|
-
"--app-accent-color":
|
|
399
|
-
"--app-accent-foreground-color":
|
|
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":
|
|
402
|
-
"--app-card-bg-color":
|
|
403
|
-
"--app-text-color":
|
|
404
|
-
"--app-border-color":
|
|
405
|
-
"--app-muted-bg":
|
|
406
|
-
"--app-muted-text":
|
|
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":
|
|
413
|
-
"--app-input-text-color":
|
|
414
|
-
"--app-input-border-color":
|
|
415
|
-
"--app-input-focus-ring-color":
|
|
416
|
-
"--app-input-placeholder-color":
|
|
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":
|
|
419
|
-
"--app-chart-2":
|
|
420
|
-
"--app-chart-3":
|
|
421
|
-
"--app-chart-4":
|
|
422
|
-
"--app-chart-5":
|
|
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
|
|
502
|
-
throw new Error(`Gemini Error ${n.status}: ${
|
|
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:
|
|
510
|
-
if (
|
|
511
|
-
i += c.decode(
|
|
512
|
-
const
|
|
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 =
|
|
515
|
-
for (const f of
|
|
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
|
|
630
|
-
|
|
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
|
|
735
|
-
throw new Error(`Anthropic ${i.status}: ${((m =
|
|
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:
|
|
761
|
+
const { done: u, value: w } = await d.read();
|
|
746
762
|
if (u) break;
|
|
747
|
-
l += p.decode(
|
|
748
|
-
const
|
|
763
|
+
l += p.decode(w, { stream: !0 });
|
|
764
|
+
const E = l.split(`
|
|
749
765
|
`);
|
|
750
|
-
l =
|
|
751
|
-
for (const
|
|
752
|
-
const f =
|
|
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,
|
|
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
|
|
798
|
-
console.error("🔴 RAW ANTHROPIC OBJECT ERROR:", d.status,
|
|
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(
|
|
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}: ${
|
|
819
|
+
throw new Error(`Anthropic ${d.status}: ${y}`);
|
|
804
820
|
}
|
|
805
821
|
}
|
|
806
|
-
const 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:
|
|
901
|
+
const { done: u, value: w } = await i.read();
|
|
886
902
|
if (u) break;
|
|
887
|
-
p += d.decode(
|
|
888
|
-
const
|
|
903
|
+
p += d.decode(w, { stream: !0 });
|
|
904
|
+
const E = p.split(`
|
|
889
905
|
`);
|
|
890
|
-
p =
|
|
891
|
-
for (const
|
|
892
|
-
const f =
|
|
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:
|
|
1026
|
+
const { done: u, value: w } = await i.read();
|
|
1011
1027
|
if (u) break;
|
|
1012
|
-
p += d.decode(
|
|
1013
|
-
const
|
|
1028
|
+
p += d.decode(w, { stream: !0 });
|
|
1029
|
+
const E = p.split(`
|
|
1014
1030
|
`);
|
|
1015
|
-
p =
|
|
1016
|
-
for (const
|
|
1017
|
-
const f =
|
|
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,
|
|
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
|
|
1052
|
-
throw this.normalizeError(d.status,
|
|
1067
|
+
const y = await d.json();
|
|
1068
|
+
throw this.normalizeError(d.status, y);
|
|
1053
1069
|
}
|
|
1054
|
-
const 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:
|
|
1140
|
+
const { done: u, value: w } = await i.read();
|
|
1125
1141
|
if (u) break;
|
|
1126
|
-
p += d.decode(
|
|
1127
|
-
const
|
|
1142
|
+
p += d.decode(w, { stream: !0 });
|
|
1143
|
+
const E = p.split(`
|
|
1128
1144
|
`);
|
|
1129
|
-
p =
|
|
1130
|
-
for (const
|
|
1131
|
-
const f =
|
|
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
|
|
1281
|
-
class
|
|
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
|
|
1443
|
+
const we = new ne({ maxRequests: 10, windowMs: 6e4 });
|
|
1428
1444
|
export {
|
|
1429
|
-
|
|
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
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
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
|
};
|