@ramme-io/shared 2.0.1 → 2.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.
- package/dist/index.cjs +426 -89
- package/dist/index.d.cts +799 -7
- package/dist/index.d.ts +799 -7
- package/dist/index.js +403 -88
- package/package.json +4 -1
- package/.turbo/turbo-build.log +0 -20
- package/AGENTS.md +0 -2
- package/CHANGELOG.md +0 -7
- package/index.ts +0 -7
- package/src/ai/tools.ts +0 -178
- package/src/bodewell/schema.ts +0 -35
- package/src/schema.ts +0 -209
- package/tsconfig.json +0 -16
package/dist/index.d.ts
CHANGED
|
@@ -124,7 +124,15 @@ declare const ResourceSchema: z.ZodObject<{
|
|
|
124
124
|
} | undefined;
|
|
125
125
|
}>;
|
|
126
126
|
type ResourceDefinition = z.infer<typeof ResourceSchema>;
|
|
127
|
-
|
|
127
|
+
/**
|
|
128
|
+
* AppSignalSchema — the Signal DEFINITION used inside an app manifest.
|
|
129
|
+
* Describes the BLUEPRINT of a signal an app tracks (its label, kind,
|
|
130
|
+
* MQTT topic, refresh rate, etc.). This is NOT a runtime data packet.
|
|
131
|
+
*
|
|
132
|
+
* For the runtime data contract (a live sensor reading / market tick),
|
|
133
|
+
* use SignalSchema from '@ramme-io/shared' (Law 12 Universal Signal Protocol).
|
|
134
|
+
*/
|
|
135
|
+
declare const AppSignalSchema: z.ZodObject<{
|
|
128
136
|
id: z.ZodString;
|
|
129
137
|
label: z.ZodString;
|
|
130
138
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -167,7 +175,7 @@ declare const SignalSchema: z.ZodObject<{
|
|
|
167
175
|
min?: number | undefined;
|
|
168
176
|
max?: number | undefined;
|
|
169
177
|
}>;
|
|
170
|
-
type SignalDefinition = z.infer<typeof
|
|
178
|
+
type SignalDefinition = z.infer<typeof AppSignalSchema>;
|
|
171
179
|
declare const EntitySchema: z.ZodObject<{
|
|
172
180
|
id: z.ZodString;
|
|
173
181
|
name: z.ZodString;
|
|
@@ -550,6 +558,18 @@ declare const PageSchema: z.ZodObject<{
|
|
|
550
558
|
icon?: string | undefined;
|
|
551
559
|
}>;
|
|
552
560
|
type PageDefinition = z.infer<typeof PageSchema>;
|
|
561
|
+
declare const AuthStrategySchema: z.ZodEnum<["ENVIRONMENT", "SESSION_BYOK", "VAULT"]>;
|
|
562
|
+
declare const AIKeyManifestSchema: z.ZodObject<{
|
|
563
|
+
strategy: z.ZodEnum<["ENVIRONMENT", "SESSION_BYOK", "VAULT"]>;
|
|
564
|
+
status: z.ZodDefault<z.ZodEnum<["VALID", "KEY_EXPIRED", "BYOK_REQUIRED", "DEGRADED", "UNKNOWN"]>>;
|
|
565
|
+
}, "strip", z.ZodTypeAny, {
|
|
566
|
+
status: "VALID" | "KEY_EXPIRED" | "BYOK_REQUIRED" | "DEGRADED" | "UNKNOWN";
|
|
567
|
+
strategy: "ENVIRONMENT" | "SESSION_BYOK" | "VAULT";
|
|
568
|
+
}, {
|
|
569
|
+
strategy: "ENVIRONMENT" | "SESSION_BYOK" | "VAULT";
|
|
570
|
+
status?: "VALID" | "KEY_EXPIRED" | "BYOK_REQUIRED" | "DEGRADED" | "UNKNOWN" | undefined;
|
|
571
|
+
}>;
|
|
572
|
+
type AIKeyManifest = z.infer<typeof AIKeyManifestSchema>;
|
|
553
573
|
declare const AppSpecificationSchema: z.ZodObject<{
|
|
554
574
|
meta: z.ZodObject<{
|
|
555
575
|
name: z.ZodString;
|
|
@@ -572,16 +592,37 @@ declare const AppSpecificationSchema: z.ZodObject<{
|
|
|
572
592
|
}>;
|
|
573
593
|
config: z.ZodObject<{
|
|
574
594
|
theme: z.ZodDefault<z.ZodEnum<["light", "dark", "system", "corporate", "midnight", "blueprint"]>>;
|
|
595
|
+
layout: z.ZodDefault<z.ZodEnum<["dashboard", "explorer", "studio", "focus"]>>;
|
|
575
596
|
mockMode: z.ZodDefault<z.ZodBoolean>;
|
|
576
597
|
brokerUrl: z.ZodOptional<z.ZodString>;
|
|
598
|
+
aiKeyManifest: z.ZodOptional<z.ZodObject<{
|
|
599
|
+
strategy: z.ZodEnum<["ENVIRONMENT", "SESSION_BYOK", "VAULT"]>;
|
|
600
|
+
status: z.ZodDefault<z.ZodEnum<["VALID", "KEY_EXPIRED", "BYOK_REQUIRED", "DEGRADED", "UNKNOWN"]>>;
|
|
601
|
+
}, "strip", z.ZodTypeAny, {
|
|
602
|
+
status: "VALID" | "KEY_EXPIRED" | "BYOK_REQUIRED" | "DEGRADED" | "UNKNOWN";
|
|
603
|
+
strategy: "ENVIRONMENT" | "SESSION_BYOK" | "VAULT";
|
|
604
|
+
}, {
|
|
605
|
+
strategy: "ENVIRONMENT" | "SESSION_BYOK" | "VAULT";
|
|
606
|
+
status?: "VALID" | "KEY_EXPIRED" | "BYOK_REQUIRED" | "DEGRADED" | "UNKNOWN" | undefined;
|
|
607
|
+
}>>;
|
|
577
608
|
}, "strip", z.ZodTypeAny, {
|
|
609
|
+
layout: "dashboard" | "explorer" | "studio" | "focus";
|
|
578
610
|
theme: "light" | "dark" | "system" | "corporate" | "midnight" | "blueprint";
|
|
579
611
|
mockMode: boolean;
|
|
580
612
|
brokerUrl?: string | undefined;
|
|
613
|
+
aiKeyManifest?: {
|
|
614
|
+
status: "VALID" | "KEY_EXPIRED" | "BYOK_REQUIRED" | "DEGRADED" | "UNKNOWN";
|
|
615
|
+
strategy: "ENVIRONMENT" | "SESSION_BYOK" | "VAULT";
|
|
616
|
+
} | undefined;
|
|
581
617
|
}, {
|
|
618
|
+
layout?: "dashboard" | "explorer" | "studio" | "focus" | undefined;
|
|
582
619
|
theme?: "light" | "dark" | "system" | "corporate" | "midnight" | "blueprint" | undefined;
|
|
583
620
|
mockMode?: boolean | undefined;
|
|
584
621
|
brokerUrl?: string | undefined;
|
|
622
|
+
aiKeyManifest?: {
|
|
623
|
+
strategy: "ENVIRONMENT" | "SESSION_BYOK" | "VAULT";
|
|
624
|
+
status?: "VALID" | "KEY_EXPIRED" | "BYOK_REQUIRED" | "DEGRADED" | "UNKNOWN" | undefined;
|
|
625
|
+
} | undefined;
|
|
585
626
|
}>;
|
|
586
627
|
modules: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
587
628
|
resources: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -1042,9 +1083,14 @@ declare const AppSpecificationSchema: z.ZodObject<{
|
|
|
1042
1083
|
}>, "many">>;
|
|
1043
1084
|
}, "strip", z.ZodTypeAny, {
|
|
1044
1085
|
config: {
|
|
1086
|
+
layout: "dashboard" | "explorer" | "studio" | "focus";
|
|
1045
1087
|
theme: "light" | "dark" | "system" | "corporate" | "midnight" | "blueprint";
|
|
1046
1088
|
mockMode: boolean;
|
|
1047
1089
|
brokerUrl?: string | undefined;
|
|
1090
|
+
aiKeyManifest?: {
|
|
1091
|
+
status: "VALID" | "KEY_EXPIRED" | "BYOK_REQUIRED" | "DEGRADED" | "UNKNOWN";
|
|
1092
|
+
strategy: "ENVIRONMENT" | "SESSION_BYOK" | "VAULT";
|
|
1093
|
+
} | undefined;
|
|
1048
1094
|
};
|
|
1049
1095
|
meta: {
|
|
1050
1096
|
name: string;
|
|
@@ -1146,9 +1192,14 @@ declare const AppSpecificationSchema: z.ZodObject<{
|
|
|
1146
1192
|
}[] | undefined;
|
|
1147
1193
|
}, {
|
|
1148
1194
|
config: {
|
|
1195
|
+
layout?: "dashboard" | "explorer" | "studio" | "focus" | undefined;
|
|
1149
1196
|
theme?: "light" | "dark" | "system" | "corporate" | "midnight" | "blueprint" | undefined;
|
|
1150
1197
|
mockMode?: boolean | undefined;
|
|
1151
1198
|
brokerUrl?: string | undefined;
|
|
1199
|
+
aiKeyManifest?: {
|
|
1200
|
+
strategy: "ENVIRONMENT" | "SESSION_BYOK" | "VAULT";
|
|
1201
|
+
status?: "VALID" | "KEY_EXPIRED" | "BYOK_REQUIRED" | "DEGRADED" | "UNKNOWN" | undefined;
|
|
1202
|
+
} | undefined;
|
|
1152
1203
|
};
|
|
1153
1204
|
meta: {
|
|
1154
1205
|
name: string;
|
|
@@ -1268,6 +1319,285 @@ declare const FloraTelemetrySchema: z.ZodObject<{
|
|
|
1268
1319
|
}>;
|
|
1269
1320
|
type FloraTelemetry = z.infer<typeof FloraTelemetrySchema>;
|
|
1270
1321
|
|
|
1322
|
+
/**
|
|
1323
|
+
* @file schema.ts
|
|
1324
|
+
* @package @ramme-io/shared
|
|
1325
|
+
* @description The Universal Signal Contract — canonical Law 12 implementation.
|
|
1326
|
+
*
|
|
1327
|
+
* This is the SINGLE SOURCE OF TRUTH for all real-time data flowing through
|
|
1328
|
+
* the Ramme platform. ESP32 telemetry, financial market ticks, and SaaS
|
|
1329
|
+
* operational metrics all conform to this contract.
|
|
1330
|
+
*
|
|
1331
|
+
* Import from @ramme-io/shared:
|
|
1332
|
+
* import { SignalSchema, Signal } from '@ramme-io/shared';
|
|
1333
|
+
*
|
|
1334
|
+
* ─── IRON LAW — Logic = 0 ────────────────────────────────────────────────────
|
|
1335
|
+
* This file contains ONLY Zod schemas and inferred TypeScript types.
|
|
1336
|
+
* No functions. No class instances. No side effects. No imports from kernel.
|
|
1337
|
+
* Adapter logic belongs in @ramme-io/kernel/src/signals/.
|
|
1338
|
+
*/
|
|
1339
|
+
|
|
1340
|
+
/**
|
|
1341
|
+
* SignalSchema — The single Zod contract for all real-time data in Ramme.
|
|
1342
|
+
*
|
|
1343
|
+
* Every adapter (MQTT, HTTP, WebSocket, Mock) MUST produce `Signal` objects
|
|
1344
|
+
* that satisfy this schema before any data reaches a React hook or UI component.
|
|
1345
|
+
*
|
|
1346
|
+
* @field id Globally unique signal identifier.
|
|
1347
|
+
* Convention: '<entity-id>:<key>'
|
|
1348
|
+
* Examples: 'sensor-01:moisture', 'AAPL:price', 'api:latency'
|
|
1349
|
+
*
|
|
1350
|
+
* @field source The transport that delivered the signal.
|
|
1351
|
+
* 'mqtt' → Edge device (ESP32 via MQTT broker)
|
|
1352
|
+
* 'http' → REST API poll (stock ticker, SaaS webhook)
|
|
1353
|
+
* 'ws' → WebSocket stream (CDC, live feed)
|
|
1354
|
+
* 'mock' → Development / Storybook fixture
|
|
1355
|
+
*
|
|
1356
|
+
* @field domain Logical grouping namespace.
|
|
1357
|
+
* Examples: 'bodewell', 'finance', 'infrastructure'
|
|
1358
|
+
* RULE: Use abstract domain names, NOT hardware names.
|
|
1359
|
+
* Use 'agriculture', not 'esp32-bodewell-v4'.
|
|
1360
|
+
*
|
|
1361
|
+
* @field key The specific measurement being reported.
|
|
1362
|
+
* RULE: Keys MUST be abstract. Map hardware keys at the adapter.
|
|
1363
|
+
* Use 'moisture' not 'soil_vwc'.
|
|
1364
|
+
* Use 'price' not 'stock_price'.
|
|
1365
|
+
* Use 'latency' not 'api_response_time_ms'.
|
|
1366
|
+
*
|
|
1367
|
+
* @field value The scalar reading. Accepts number, string, or boolean.
|
|
1368
|
+
* Complex structures MUST be flattened into multiple Signals.
|
|
1369
|
+
*
|
|
1370
|
+
* @field unit Optional unit of measurement.
|
|
1371
|
+
* Examples: 'VWC%', 'USD', 'ms', '°C', 'pct', 'bpm'
|
|
1372
|
+
*
|
|
1373
|
+
* @field timestamp Unix timestamp in milliseconds (Date.now() format).
|
|
1374
|
+
* MUST reflect when the measurement was taken, not received.
|
|
1375
|
+
*
|
|
1376
|
+
* @field meta Optional pass-through for source metadata that does NOT
|
|
1377
|
+
* belong in the core contract. If a UI component reads from
|
|
1378
|
+
* meta, that field should be promoted to the core schema.
|
|
1379
|
+
*/
|
|
1380
|
+
declare const SignalSchema: z.ZodObject<{
|
|
1381
|
+
id: z.ZodString;
|
|
1382
|
+
source: z.ZodEnum<["mqtt", "http", "ws", "mock"]>;
|
|
1383
|
+
domain: z.ZodString;
|
|
1384
|
+
key: z.ZodString;
|
|
1385
|
+
value: z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodBoolean]>;
|
|
1386
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
1387
|
+
timestamp: z.ZodNumber;
|
|
1388
|
+
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1389
|
+
}, "strip", z.ZodTypeAny, {
|
|
1390
|
+
key: string;
|
|
1391
|
+
value: string | number | boolean;
|
|
1392
|
+
id: string;
|
|
1393
|
+
source: "mock" | "mqtt" | "http" | "ws";
|
|
1394
|
+
domain: string;
|
|
1395
|
+
timestamp: number;
|
|
1396
|
+
unit?: string | undefined;
|
|
1397
|
+
meta?: Record<string, unknown> | undefined;
|
|
1398
|
+
}, {
|
|
1399
|
+
key: string;
|
|
1400
|
+
value: string | number | boolean;
|
|
1401
|
+
id: string;
|
|
1402
|
+
source: "mock" | "mqtt" | "http" | "ws";
|
|
1403
|
+
domain: string;
|
|
1404
|
+
timestamp: number;
|
|
1405
|
+
unit?: string | undefined;
|
|
1406
|
+
meta?: Record<string, unknown> | undefined;
|
|
1407
|
+
}>;
|
|
1408
|
+
type Signal = z.infer<typeof SignalSchema>;
|
|
1409
|
+
/**
|
|
1410
|
+
* Schema for validating a batch of Signal objects.
|
|
1411
|
+
* Use this when parsing a firehose of incoming packets.
|
|
1412
|
+
*/
|
|
1413
|
+
declare const SignalArraySchema: z.ZodArray<z.ZodObject<{
|
|
1414
|
+
id: z.ZodString;
|
|
1415
|
+
source: z.ZodEnum<["mqtt", "http", "ws", "mock"]>;
|
|
1416
|
+
domain: z.ZodString;
|
|
1417
|
+
key: z.ZodString;
|
|
1418
|
+
value: z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodBoolean]>;
|
|
1419
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
1420
|
+
timestamp: z.ZodNumber;
|
|
1421
|
+
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1422
|
+
}, "strip", z.ZodTypeAny, {
|
|
1423
|
+
key: string;
|
|
1424
|
+
value: string | number | boolean;
|
|
1425
|
+
id: string;
|
|
1426
|
+
source: "mock" | "mqtt" | "http" | "ws";
|
|
1427
|
+
domain: string;
|
|
1428
|
+
timestamp: number;
|
|
1429
|
+
unit?: string | undefined;
|
|
1430
|
+
meta?: Record<string, unknown> | undefined;
|
|
1431
|
+
}, {
|
|
1432
|
+
key: string;
|
|
1433
|
+
value: string | number | boolean;
|
|
1434
|
+
id: string;
|
|
1435
|
+
source: "mock" | "mqtt" | "http" | "ws";
|
|
1436
|
+
domain: string;
|
|
1437
|
+
timestamp: number;
|
|
1438
|
+
unit?: string | undefined;
|
|
1439
|
+
meta?: Record<string, unknown> | undefined;
|
|
1440
|
+
}>, "many">;
|
|
1441
|
+
type SignalArray = z.infer<typeof SignalArraySchema>;
|
|
1442
|
+
/**
|
|
1443
|
+
* Canonical domain namespaces used across the Ramme platform.
|
|
1444
|
+
* Add new domains here as new data verticals are integrated.
|
|
1445
|
+
*
|
|
1446
|
+
* RULE: Domain names are abstract and product-agnostic.
|
|
1447
|
+
* 'agriculture' covers both Bodewell (hardware) and any future SaaS vertical.
|
|
1448
|
+
* 'finance' covers both terminal-ui and any future market data integration.
|
|
1449
|
+
*/
|
|
1450
|
+
declare const SIGNAL_DOMAINS: {
|
|
1451
|
+
readonly AGRICULTURE: "agriculture";
|
|
1452
|
+
readonly FINANCE: "finance";
|
|
1453
|
+
readonly INFRASTRUCTURE: "infrastructure";
|
|
1454
|
+
readonly USER_BEHAVIOR: "user_behavior";
|
|
1455
|
+
readonly LOGIC: "logic";
|
|
1456
|
+
};
|
|
1457
|
+
type SignalDomain = typeof SIGNAL_DOMAINS[keyof typeof SIGNAL_DOMAINS];
|
|
1458
|
+
|
|
1459
|
+
/**
|
|
1460
|
+
* @file base.schema.ts
|
|
1461
|
+
* @package @ramme-io/shared
|
|
1462
|
+
* @description Universal Signal Protocol — The foundational data contract
|
|
1463
|
+
* for ALL real-time data in the Ramme platform.
|
|
1464
|
+
*
|
|
1465
|
+
* ─── THE UNIVERSAL SIGNAL MANDATE ────────────────────────────────────────────
|
|
1466
|
+
* An ESP32 soil moisture reading, a NASDAQ price tick, and a database record
|
|
1467
|
+
* change are the SAME thing at the data-contract level: they are Signals.
|
|
1468
|
+
* The source changes. The shape does not.
|
|
1469
|
+
*
|
|
1470
|
+
* This schema is the "Steering Wheel" for all real-time data in Ramme.
|
|
1471
|
+
* All adapters (MQTT, HTTP, WebSocket, Mock) MUST produce SignalPacket[]
|
|
1472
|
+
* before any data reaches a React hook or UI component.
|
|
1473
|
+
*
|
|
1474
|
+
* ─── IRON LAW — Logic = 0 ────────────────────────────────────────────────────
|
|
1475
|
+
* This file contains ONLY Zod schemas and inferred TypeScript types.
|
|
1476
|
+
* No functions. No class instances. No side effects.
|
|
1477
|
+
* Adapters and processing logic belong in @ramme-io/kernel.
|
|
1478
|
+
*/
|
|
1479
|
+
|
|
1480
|
+
/**
|
|
1481
|
+
* The canonical set of signal "kinds" in the Ramme platform.
|
|
1482
|
+
*
|
|
1483
|
+
* - 'telemetry' ESP32 / edge hardware sensor readings (soil VWC, pH, temp)
|
|
1484
|
+
* - 'market' Financial data (stock price, bid/ask, volume, crypto tick)
|
|
1485
|
+
* - 'system' Infrastructure / SaaS operational metrics (CPU, uptime, API latency)
|
|
1486
|
+
* - 'logic' Derived / computed signals produced by Methodology Engines
|
|
1487
|
+
* (e.g. a "stress score" calculated from raw telemetry)
|
|
1488
|
+
*/
|
|
1489
|
+
declare const SignalKindSchema: z.ZodEnum<["telemetry", "market", "system", "logic"]>;
|
|
1490
|
+
type SignalKind = z.infer<typeof SignalKindSchema>;
|
|
1491
|
+
/**
|
|
1492
|
+
* The transport source that produced the signal.
|
|
1493
|
+
* The KIND describes WHAT the data is. The SOURCE describes HOW it arrived.
|
|
1494
|
+
*
|
|
1495
|
+
* - 'mqtt' Physical edge device (ESP32 via MQTT broker)
|
|
1496
|
+
* - 'http' REST API poll (stock ticker, SaaS webhook, database query)
|
|
1497
|
+
* - 'ws' WebSocket stream (real-time database CDC, live market feed)
|
|
1498
|
+
* - 'mock' Local development / Storybook fixtures
|
|
1499
|
+
*/
|
|
1500
|
+
declare const SignalSourceSchema: z.ZodEnum<["mqtt", "http", "ws", "mock"]>;
|
|
1501
|
+
type SignalSource = z.infer<typeof SignalSourceSchema>;
|
|
1502
|
+
/**
|
|
1503
|
+
* The single canonical shape for ALL real-time data in the Ramme platform.
|
|
1504
|
+
*
|
|
1505
|
+
* @example ESP32 telemetry:
|
|
1506
|
+
* { id: 'sensor-01:soil_vwc', kind: 'telemetry', key: 'soil_vwc',
|
|
1507
|
+
* value: 42.3, unit: 'VWC%', ts: 1747340000000, source: 'mqtt' }
|
|
1508
|
+
*
|
|
1509
|
+
* @example Stock ticker:
|
|
1510
|
+
* { id: 'AAPL:price', kind: 'market', key: 'price',
|
|
1511
|
+
* value: 189.45, unit: 'USD', ts: 1747340000000, source: 'http' }
|
|
1512
|
+
*
|
|
1513
|
+
* @example Derived logic signal:
|
|
1514
|
+
* { id: 'plant-01:stress_score', kind: 'logic', key: 'stress_score',
|
|
1515
|
+
* value: 0.72, unit: 'score', ts: 1747340000000, source: 'ws' }
|
|
1516
|
+
*/
|
|
1517
|
+
declare const SignalPacketSchema: z.ZodObject<{
|
|
1518
|
+
/**
|
|
1519
|
+
* Globally unique signal identifier.
|
|
1520
|
+
* Convention: '<device-or-entity-id>:<key>'
|
|
1521
|
+
* Examples: 'sensor-01:soil_vwc', 'AAPL:price', 'server-01:cpu_pct'
|
|
1522
|
+
*/
|
|
1523
|
+
id: z.ZodString;
|
|
1524
|
+
/**
|
|
1525
|
+
* The semantic category of this signal.
|
|
1526
|
+
* Determines which Methodology Engine processes it.
|
|
1527
|
+
*/
|
|
1528
|
+
kind: z.ZodEnum<["telemetry", "market", "system", "logic"]>;
|
|
1529
|
+
/**
|
|
1530
|
+
* The specific measurement or metric key within its kind.
|
|
1531
|
+
* RULE: Keys MUST be abstract and domain-agnostic where possible.
|
|
1532
|
+
* Use 'price' not 'stock_price'. Use 'moisture' not 'soil_vwc'.
|
|
1533
|
+
* Hardware-specific keys (soil_vwc) MUST be mapped to abstract keys
|
|
1534
|
+
* at the adapter layer BEFORE the SignalPacket is created.
|
|
1535
|
+
*/
|
|
1536
|
+
key: z.ZodString;
|
|
1537
|
+
/**
|
|
1538
|
+
* The scalar value. Accepts number, string, or boolean.
|
|
1539
|
+
* Structured data MUST be flattened into multiple SignalPackets,
|
|
1540
|
+
* one per measurable dimension.
|
|
1541
|
+
*/
|
|
1542
|
+
value: z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodBoolean]>;
|
|
1543
|
+
/**
|
|
1544
|
+
* Optional unit of measurement.
|
|
1545
|
+
* Examples: 'VWC%', 'USD', 'bpm', 'ms', '°C', 'pct'
|
|
1546
|
+
*/
|
|
1547
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
1548
|
+
/**
|
|
1549
|
+
* Unix timestamp in milliseconds (Date.now() format).
|
|
1550
|
+
* MUST represent when the measurement was taken, not when it was received.
|
|
1551
|
+
*/
|
|
1552
|
+
ts: z.ZodNumber;
|
|
1553
|
+
/**
|
|
1554
|
+
* The transport source that produced this signal.
|
|
1555
|
+
*/
|
|
1556
|
+
source: z.ZodOptional<z.ZodEnum<["mqtt", "http", "ws", "mock"]>>;
|
|
1557
|
+
/**
|
|
1558
|
+
* Optional domain namespace for grouping related signals.
|
|
1559
|
+
* Examples: 'bodewell', 'finance', 'infrastructure', 'user_behavior'
|
|
1560
|
+
*/
|
|
1561
|
+
domain: z.ZodOptional<z.ZodString>;
|
|
1562
|
+
/**
|
|
1563
|
+
* Optional pass-through for source-specific metadata that does NOT
|
|
1564
|
+
* belong in the core contract (e.g. device firmware version, exchange name).
|
|
1565
|
+
* RULE: If you find yourself reading from meta in UI components, that
|
|
1566
|
+
* field should be promoted to the core schema or handled in the adapter.
|
|
1567
|
+
*/
|
|
1568
|
+
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1569
|
+
}, "strip", z.ZodTypeAny, {
|
|
1570
|
+
key: string;
|
|
1571
|
+
value: string | number | boolean;
|
|
1572
|
+
id: string;
|
|
1573
|
+
kind: "system" | "logic" | "telemetry" | "market";
|
|
1574
|
+
ts: number;
|
|
1575
|
+
source?: "mock" | "mqtt" | "http" | "ws" | undefined;
|
|
1576
|
+
unit?: string | undefined;
|
|
1577
|
+
meta?: Record<string, unknown> | undefined;
|
|
1578
|
+
domain?: string | undefined;
|
|
1579
|
+
}, {
|
|
1580
|
+
key: string;
|
|
1581
|
+
value: string | number | boolean;
|
|
1582
|
+
id: string;
|
|
1583
|
+
kind: "system" | "logic" | "telemetry" | "market";
|
|
1584
|
+
ts: number;
|
|
1585
|
+
source?: "mock" | "mqtt" | "http" | "ws" | undefined;
|
|
1586
|
+
unit?: string | undefined;
|
|
1587
|
+
meta?: Record<string, unknown> | undefined;
|
|
1588
|
+
domain?: string | undefined;
|
|
1589
|
+
}>;
|
|
1590
|
+
type SignalPacket = z.infer<typeof SignalPacketSchema>;
|
|
1591
|
+
/** All valid signal kinds as a typed tuple for iteration/validation. */
|
|
1592
|
+
declare const SIGNAL_KINDS: ["telemetry", "market", "system", "logic"];
|
|
1593
|
+
/** All valid signal sources as a typed tuple. */
|
|
1594
|
+
declare const SIGNAL_SOURCES: ["mqtt", "http", "ws", "mock"];
|
|
1595
|
+
/**
|
|
1596
|
+
* Human-readable labels for each signal kind.
|
|
1597
|
+
* Used by UI components (e.g. filter dropdowns, legend badges).
|
|
1598
|
+
*/
|
|
1599
|
+
declare const SIGNAL_KIND_LABELS: Record<SignalKind, string>;
|
|
1600
|
+
|
|
1271
1601
|
declare const BodewellDeviceID: z.ZodEnum<["STK-V1-001", "STK-V1-002", "STK-V1-003", "STK-PRO-001", "STK-VIS-001"]>;
|
|
1272
1602
|
declare const BodewellTelemetrySchema: z.ZodObject<{
|
|
1273
1603
|
device_id: z.ZodEnum<["STK-V1-001", "STK-V1-002", "STK-V1-003", "STK-PRO-001", "STK-VIS-001"]>;
|
|
@@ -1407,11 +1737,473 @@ interface ToolCall {
|
|
|
1407
1737
|
* Add new tools here to make them available to the LLM.
|
|
1408
1738
|
*/
|
|
1409
1739
|
declare const AI_TOOLS: Record<string, ToolDefinition>;
|
|
1740
|
+
|
|
1741
|
+
/**
|
|
1742
|
+
* @file registry.ts
|
|
1743
|
+
* @package @ramme-io/shared
|
|
1744
|
+
* @description AI Model Registry — The Single Line of Truth for model assignments.
|
|
1745
|
+
*
|
|
1746
|
+
* ARCHITECTURAL ROLE:
|
|
1747
|
+
* Maps named agent roles to specific AI model configurations.
|
|
1748
|
+
* Changing a model for all agents is a ONE-LINE change here.
|
|
1749
|
+
*
|
|
1750
|
+
* IRON LAW — Logic = 0:
|
|
1751
|
+
* This file contains ONLY typed constants. No functions. No side effects.
|
|
1752
|
+
* The NeuralGateway in @ramme-io/kernel reads this registry at call time.
|
|
1753
|
+
*/
|
|
1754
|
+
/**
|
|
1755
|
+
* The canonical model string used for all structured output (generateObject).
|
|
1756
|
+
* Low temperature, high schema adherence required.
|
|
1757
|
+
*
|
|
1758
|
+
* Updated to gemini-2.5-flash (May 2026 stable series).
|
|
1759
|
+
* gemini-2.0-flash is deprecated and returns 404.
|
|
1760
|
+
*/
|
|
1761
|
+
declare const DEFAULT_SCHEMA_MODEL: "gemini-2.5-flash";
|
|
1762
|
+
/**
|
|
1763
|
+
* The canonical model string used for all streaming chat (streamText).
|
|
1764
|
+
*
|
|
1765
|
+
* Updated to gemini-2.5-flash (May 2026 stable series).
|
|
1766
|
+
*/
|
|
1767
|
+
declare const DEFAULT_CHAT_MODEL: "gemini-2.5-flash";
|
|
1410
1768
|
/**
|
|
1411
|
-
*
|
|
1412
|
-
*
|
|
1413
|
-
* The LLM is instructed to output tool calls in a strict XML format.
|
|
1769
|
+
* The canonical model string for reasoning-heavy roles (REVIEWER, etc.)
|
|
1770
|
+
* Uses the Pro tier for higher accuracy on structured plan output.
|
|
1414
1771
|
*/
|
|
1415
|
-
declare
|
|
1772
|
+
declare const DEFAULT_PRO_MODEL: "gemini-2.5-pro";
|
|
1773
|
+
/**
|
|
1774
|
+
* Maps each named agent role to its model configuration.
|
|
1775
|
+
* This is the authoritative source for which model each agent uses.
|
|
1776
|
+
*
|
|
1777
|
+
* To switch all agents to a new model: change DEFAULT_SCHEMA_MODEL above.
|
|
1778
|
+
* To switch a single agent: override its `model` field here.
|
|
1779
|
+
*/
|
|
1780
|
+
declare const AI_ROSTER: {
|
|
1781
|
+
/** The Strategist: high creativity, exploratory conversation */
|
|
1782
|
+
readonly STRATEGIST: {
|
|
1783
|
+
readonly model: "gemini-2.5-flash";
|
|
1784
|
+
readonly provider: "google-gemini";
|
|
1785
|
+
readonly temperature: 0.7;
|
|
1786
|
+
};
|
|
1787
|
+
/** The Architect: data schema and resource modeling — precision required */
|
|
1788
|
+
readonly ARCHITECT: {
|
|
1789
|
+
readonly model: "gemini-2.5-flash";
|
|
1790
|
+
readonly provider: "google-gemini";
|
|
1791
|
+
readonly temperature: 0.3;
|
|
1792
|
+
};
|
|
1793
|
+
/** The Designer: UI layout generation — moderate creativity */
|
|
1794
|
+
readonly DESIGNER: {
|
|
1795
|
+
readonly model: "gemini-2.5-flash";
|
|
1796
|
+
readonly provider: "google-gemini";
|
|
1797
|
+
readonly temperature: 0.5;
|
|
1798
|
+
};
|
|
1799
|
+
/** The Reviewer/Product Owner: structured plan output — strict adherence.
|
|
1800
|
+
* Uses the Pro tier for superior reasoning on complex structured tasks.
|
|
1801
|
+
*/
|
|
1802
|
+
readonly REVIEWER: {
|
|
1803
|
+
readonly model: "gemini-2.5-pro";
|
|
1804
|
+
readonly provider: "google-gemini";
|
|
1805
|
+
readonly temperature: 0.2;
|
|
1806
|
+
};
|
|
1807
|
+
/** The Genesis Engine: one-shot app generation — must be schema-strict */
|
|
1808
|
+
readonly GENESIS: {
|
|
1809
|
+
readonly model: "gemini-2.5-flash";
|
|
1810
|
+
readonly provider: "google-gemini";
|
|
1811
|
+
readonly temperature: 0.2;
|
|
1812
|
+
};
|
|
1813
|
+
};
|
|
1814
|
+
type AgentRoleKey = keyof typeof AI_ROSTER;
|
|
1815
|
+
type AgentRoleConfig = (typeof AI_ROSTER)[AgentRoleKey];
|
|
1816
|
+
|
|
1817
|
+
declare const THEME_SYSTEM_PROMPT = "\n You are a Senior UI Design Engineer specializing in WCAG 2.1 Accessibility.\n Generate a JSON theme for: \"Ramme Project\".\n\n CRITICAL FONT RULE: \n Do NOT use generic fonts like 'Roboto', 'Open Sans', or 'Lato' unless specifically asked. \n Instead, pick high-contrast, expressive pairings from Google Fonts that match the vibe. Dont be afraid of taking risks.\n \n\n VIBE-TO-FONT REFERENCE:\n - Futuristic/Cyberpunk: 'Orbitron', 'Space Grotesk', 'Rajdhani', 'Exo 2', 'Syne'\n - Elegant/Luxury: 'Playfair Display', 'Cormorant Garamond', 'Prata', 'Fraunces'\n - Brutalist/Bold: 'Archivo Black', 'Syne', 'Bebas Neue', 'Lexend', 'Clash Display'\n - Modern Tech: 'Inter', 'Sora', 'Plus Jakarta Sans', 'Outfit', 'Manrope'\n - Retro/Whimsical: 'BioRhyme', 'Space Mono', 'Zilla Slab', 'Bungee'\n \n RULES:\n 1. Use RGB space-separated values (e.g., \"13 110 253\").\n 2. Pick a high-quality Google Font pair (Heading + Body). \n 3. Ensure the 'fonts' object is included in the root of the JSON.\n 4. Use ONLY valid Google Font names (e.g., 'Montserrat', 'Inter', 'Playfair Display', 'Poppins', 'Lato', 'Merriweather').\n 5. Return ONLY raw JSON. No markdown backticks.\n 5. ACCESSIBILITY RULE (WCAG 2.1): \n - The Contrast Ratio between --app-text-color and --app-bg-color MUST be at least 4.5:1.\n - The Contrast Ratio between --app-primary-foreground-color and --app-primary-color MUST be at least 4.5:1.\n - If the background is Light (high RGB values), the text MUST be Dark (low RGB values).\n - If the background is Dark, the text MUST be Light.\n - SECONDARY/ACCENT: Must be vibrant but legible.\n\n JSON STRUCTURE:\n {\n \"name\": \"Theme Name\",\n \"description\": \"Vibe description\",\n \"fonts\": {\n \"heading\": \"Montserrat\",\n \"body\": \"Inter\"\n },\n \"cssVars\": {\n \"--app-primary-color\": \"R G B\",\n \"--app-primary-foreground-color\": \"R G B\",\n \"--app-secondary-color\": \"R G B\",\n \"--app-accent-color\": \"R G B\",\n \"--app-bg-color\": \"R G B\",\n \"--app-card-bg-color\": \"R G B\",\n \"--app-text-color\": \"R G B\",\n \"--app-border-color\": \"R G B\",\n \"--app-muted-bg\": \"R G B\",\n \"--app-input-bg-color\": \"R G B\",\n \"--app-input-border-color\": \"R G B\",\n \"--app-chart-1\": \"R G B\",\n \"--app-chart-2\": \"R G B\",\n \"--app-chart-3\": \"R G B\",\n \"--app-chart-4\": \"R G B\",\n \"--app-chart-5\": \"R G B\",\n \"--app-border-radius-md\": \"0.375rem\"\n }\n }\n";
|
|
1818
|
+
|
|
1819
|
+
/**
|
|
1820
|
+
* @file genesis.prompt.ts
|
|
1821
|
+
* @package @ramme-io/shared
|
|
1822
|
+
* @description Canonical system prompt for the GENESIS app-generation agent.
|
|
1823
|
+
*
|
|
1824
|
+
* Previously inlined in products/builder/src/app/api/adapt/route.ts.
|
|
1825
|
+
* Extracting it here makes the Design Law and component vocabulary
|
|
1826
|
+
* available to any future generator (CLI, second builder product, test suites).
|
|
1827
|
+
*
|
|
1828
|
+
* ─── IRON LAW — Logic = 0 ────────────────────────────────────────────────────
|
|
1829
|
+
* This file contains ONLY string constants. No functions. No side effects.
|
|
1830
|
+
* The route handler that calls NeuralGateway.generateSchema() lives in products/.
|
|
1831
|
+
*/
|
|
1832
|
+
/**
|
|
1833
|
+
* The canonical list of component types the GENESIS agent may reference
|
|
1834
|
+
* in generated page blocks. This list is the authoritative source —
|
|
1835
|
+
* update it here when @ramme-io/ui adds a new component.
|
|
1836
|
+
*/
|
|
1837
|
+
declare const GENESIS_VALID_COMPONENTS: readonly ["SmartTable", "StatCard", "DeviceCard", "BarChart", "LineChart", "PieChart", "ActivityFeed", "CodeBlock", "StatusBadge", "Card", "SectionHeader", "PageHeader", "Accordion", "FormTemplate", "ChatFAB", "EmptyState"];
|
|
1838
|
+
type GenesisComponentType = typeof GENESIS_VALID_COMPONENTS[number];
|
|
1839
|
+
/**
|
|
1840
|
+
* The LIBRARY_CONTEXT system prompt injected into every GENESIS generation call.
|
|
1841
|
+
*
|
|
1842
|
+
* Teaches the agent:
|
|
1843
|
+
* 1. Navigation strategy (sidebar vs hub_spoke)
|
|
1844
|
+
* 2. Data strategy (resource definitions)
|
|
1845
|
+
* 3. Logic strategy (workflow patterns)
|
|
1846
|
+
* 4. Interface strategy (component/data wiring)
|
|
1847
|
+
* 5. Theme strategy (preset selection)
|
|
1848
|
+
* 6. Design Law — Semantic Token Mandate (Law 13)
|
|
1849
|
+
*
|
|
1850
|
+
* GOVERNANCE: The Design Law section (§6) is the enforcement point for
|
|
1851
|
+
* Law 13 (The Semantic Styling Mandate, ratified May 2026).
|
|
1852
|
+
* When updating the semantic token vocabulary, update §6 here AND
|
|
1853
|
+
* the Law 13 entry in .rammerules.
|
|
1854
|
+
*/
|
|
1855
|
+
declare const GENESIS_LIBRARY_CONTEXT: string;
|
|
1856
|
+
|
|
1857
|
+
/**
|
|
1858
|
+
* @file schema.ts
|
|
1859
|
+
* @package @ramme-io/shared
|
|
1860
|
+
* @description Centralized Theme Schema — the canonical contract for AI-generated
|
|
1861
|
+
* and runtime theme overrides in the Ramme platform.
|
|
1862
|
+
*
|
|
1863
|
+
* Previously the AITheme interface was duplicated across 5 product themeAgent.ts files.
|
|
1864
|
+
* This is the SINGLE SOURCE OF TRUTH going forward.
|
|
1865
|
+
*
|
|
1866
|
+
* The ThemeOverridesSchema is also embedded into AppSpecificationSchema.config
|
|
1867
|
+
* so the GENESIS AI agent can generate custom themes as part of app manifests.
|
|
1868
|
+
*
|
|
1869
|
+
* ─── IRON LAW — Logic = 0 ────────────────────────────────────────────────────
|
|
1870
|
+
* This file contains ONLY Zod schemas and inferred TypeScript types.
|
|
1871
|
+
* The function that applies cssVars to document.documentElement belongs in kernel.
|
|
1872
|
+
*/
|
|
1873
|
+
|
|
1874
|
+
/**
|
|
1875
|
+
* ThemeOverridesSchema — a partial set of `--app-*` CSS variable values
|
|
1876
|
+
* that override the active theme preset at runtime.
|
|
1877
|
+
*
|
|
1878
|
+
* All fields are optional — only provide the variables you want to override.
|
|
1879
|
+
* The active theme preset (:root, .dark, .corporate, etc.) provides defaults
|
|
1880
|
+
* for any variable not included here.
|
|
1881
|
+
*
|
|
1882
|
+
* All color values MUST be space-separated RGB integers (not hex, not rgb()).
|
|
1883
|
+
* All radius/font values are CSS strings (e.g. "0.375rem", "Inter").
|
|
1884
|
+
*/
|
|
1885
|
+
declare const ThemeOverridesSchema: z.ZodObject<{
|
|
1886
|
+
'--app-primary-color': z.ZodOptional<z.ZodString>;
|
|
1887
|
+
'--app-primary-foreground-color': z.ZodOptional<z.ZodString>;
|
|
1888
|
+
'--app-secondary-color': z.ZodOptional<z.ZodString>;
|
|
1889
|
+
'--app-secondary-foreground-color': z.ZodOptional<z.ZodString>;
|
|
1890
|
+
'--app-accent-color': z.ZodOptional<z.ZodString>;
|
|
1891
|
+
'--app-accent-foreground-color': z.ZodOptional<z.ZodString>;
|
|
1892
|
+
'--app-bg-color': z.ZodOptional<z.ZodString>;
|
|
1893
|
+
'--app-card-bg-color': z.ZodOptional<z.ZodString>;
|
|
1894
|
+
'--app-text-color': z.ZodOptional<z.ZodString>;
|
|
1895
|
+
'--app-border-color': z.ZodOptional<z.ZodString>;
|
|
1896
|
+
'--app-muted-bg': z.ZodOptional<z.ZodString>;
|
|
1897
|
+
'--app-muted-text': z.ZodOptional<z.ZodString>;
|
|
1898
|
+
'--app-border-radius-sm': z.ZodOptional<z.ZodString>;
|
|
1899
|
+
'--app-border-radius-md': z.ZodOptional<z.ZodString>;
|
|
1900
|
+
'--app-border-radius-lg': z.ZodOptional<z.ZodString>;
|
|
1901
|
+
'--app-input-bg-color': z.ZodOptional<z.ZodString>;
|
|
1902
|
+
'--app-input-text-color': z.ZodOptional<z.ZodString>;
|
|
1903
|
+
'--app-input-border-color': z.ZodOptional<z.ZodString>;
|
|
1904
|
+
'--app-input-focus-ring-color': z.ZodOptional<z.ZodString>;
|
|
1905
|
+
'--app-input-placeholder-color': z.ZodOptional<z.ZodString>;
|
|
1906
|
+
'--app-chart-1': z.ZodOptional<z.ZodString>;
|
|
1907
|
+
'--app-chart-2': z.ZodOptional<z.ZodString>;
|
|
1908
|
+
'--app-chart-3': z.ZodOptional<z.ZodString>;
|
|
1909
|
+
'--app-chart-4': z.ZodOptional<z.ZodString>;
|
|
1910
|
+
'--app-chart-5': z.ZodOptional<z.ZodString>;
|
|
1911
|
+
}, "strict", z.ZodTypeAny, {
|
|
1912
|
+
'--app-primary-color'?: string | undefined;
|
|
1913
|
+
'--app-primary-foreground-color'?: string | undefined;
|
|
1914
|
+
'--app-secondary-color'?: string | undefined;
|
|
1915
|
+
'--app-secondary-foreground-color'?: string | undefined;
|
|
1916
|
+
'--app-accent-color'?: string | undefined;
|
|
1917
|
+
'--app-accent-foreground-color'?: string | undefined;
|
|
1918
|
+
'--app-bg-color'?: string | undefined;
|
|
1919
|
+
'--app-card-bg-color'?: string | undefined;
|
|
1920
|
+
'--app-text-color'?: string | undefined;
|
|
1921
|
+
'--app-border-color'?: string | undefined;
|
|
1922
|
+
'--app-muted-bg'?: string | undefined;
|
|
1923
|
+
'--app-muted-text'?: string | undefined;
|
|
1924
|
+
'--app-border-radius-sm'?: string | undefined;
|
|
1925
|
+
'--app-border-radius-md'?: string | undefined;
|
|
1926
|
+
'--app-border-radius-lg'?: string | undefined;
|
|
1927
|
+
'--app-input-bg-color'?: string | undefined;
|
|
1928
|
+
'--app-input-text-color'?: string | undefined;
|
|
1929
|
+
'--app-input-border-color'?: string | undefined;
|
|
1930
|
+
'--app-input-focus-ring-color'?: string | undefined;
|
|
1931
|
+
'--app-input-placeholder-color'?: string | undefined;
|
|
1932
|
+
'--app-chart-1'?: string | undefined;
|
|
1933
|
+
'--app-chart-2'?: string | undefined;
|
|
1934
|
+
'--app-chart-3'?: string | undefined;
|
|
1935
|
+
'--app-chart-4'?: string | undefined;
|
|
1936
|
+
'--app-chart-5'?: string | undefined;
|
|
1937
|
+
}, {
|
|
1938
|
+
'--app-primary-color'?: string | undefined;
|
|
1939
|
+
'--app-primary-foreground-color'?: string | undefined;
|
|
1940
|
+
'--app-secondary-color'?: string | undefined;
|
|
1941
|
+
'--app-secondary-foreground-color'?: string | undefined;
|
|
1942
|
+
'--app-accent-color'?: string | undefined;
|
|
1943
|
+
'--app-accent-foreground-color'?: string | undefined;
|
|
1944
|
+
'--app-bg-color'?: string | undefined;
|
|
1945
|
+
'--app-card-bg-color'?: string | undefined;
|
|
1946
|
+
'--app-text-color'?: string | undefined;
|
|
1947
|
+
'--app-border-color'?: string | undefined;
|
|
1948
|
+
'--app-muted-bg'?: string | undefined;
|
|
1949
|
+
'--app-muted-text'?: string | undefined;
|
|
1950
|
+
'--app-border-radius-sm'?: string | undefined;
|
|
1951
|
+
'--app-border-radius-md'?: string | undefined;
|
|
1952
|
+
'--app-border-radius-lg'?: string | undefined;
|
|
1953
|
+
'--app-input-bg-color'?: string | undefined;
|
|
1954
|
+
'--app-input-text-color'?: string | undefined;
|
|
1955
|
+
'--app-input-border-color'?: string | undefined;
|
|
1956
|
+
'--app-input-focus-ring-color'?: string | undefined;
|
|
1957
|
+
'--app-input-placeholder-color'?: string | undefined;
|
|
1958
|
+
'--app-chart-1'?: string | undefined;
|
|
1959
|
+
'--app-chart-2'?: string | undefined;
|
|
1960
|
+
'--app-chart-3'?: string | undefined;
|
|
1961
|
+
'--app-chart-4'?: string | undefined;
|
|
1962
|
+
'--app-chart-5'?: string | undefined;
|
|
1963
|
+
}>;
|
|
1964
|
+
type ThemeOverrides = z.infer<typeof ThemeOverridesSchema>;
|
|
1965
|
+
declare const ThemeFontsSchema: z.ZodObject<{
|
|
1966
|
+
/** Google Font name for headings (h1–h4, .font-serif). Example: "Playfair Display" */
|
|
1967
|
+
heading: z.ZodString;
|
|
1968
|
+
/** Google Font name for body text. Example: "Inter" */
|
|
1969
|
+
body: z.ZodString;
|
|
1970
|
+
/** Optional monospace font. Example: "Roboto Mono" */
|
|
1971
|
+
mono: z.ZodOptional<z.ZodString>;
|
|
1972
|
+
}, "strip", z.ZodTypeAny, {
|
|
1973
|
+
heading: string;
|
|
1974
|
+
body: string;
|
|
1975
|
+
mono?: string | undefined;
|
|
1976
|
+
}, {
|
|
1977
|
+
heading: string;
|
|
1978
|
+
body: string;
|
|
1979
|
+
mono?: string | undefined;
|
|
1980
|
+
}>;
|
|
1981
|
+
type ThemeFonts = z.infer<typeof ThemeFontsSchema>;
|
|
1982
|
+
/**
|
|
1983
|
+
* AIThemeSchema — The canonical contract for AI-generated themes.
|
|
1984
|
+
*
|
|
1985
|
+
* Previously duplicated across:
|
|
1986
|
+
* - products/bodewell-web/src/features/theme/services/themeAgent.ts
|
|
1987
|
+
* - products/ramme-marketing/src/features/theme/services/themeAgent.ts
|
|
1988
|
+
* - products/terminal-ui/src/features/theme/services/themeAgent.ts
|
|
1989
|
+
* - products/ai-sandbox/src/features/theme/services/themeAgent.ts
|
|
1990
|
+
* - framework/app-starter-template/template/src/features/theme/services/themeAgent.ts
|
|
1991
|
+
*
|
|
1992
|
+
* All themeAgent.ts files should import AITheme from '@ramme-io/shared'.
|
|
1993
|
+
*/
|
|
1994
|
+
declare const AIThemeSchema: z.ZodObject<{
|
|
1995
|
+
/** Short descriptive theme name. Example: "Midnight Garden" */
|
|
1996
|
+
name: z.ZodString;
|
|
1997
|
+
/** One-sentence vibe description. Example: "Dark indigo with golden accents." */
|
|
1998
|
+
description: z.ZodString;
|
|
1999
|
+
/** Google Font pairing for heading and body text. */
|
|
2000
|
+
fonts: z.ZodOptional<z.ZodObject<{
|
|
2001
|
+
/** Google Font name for headings (h1–h4, .font-serif). Example: "Playfair Display" */
|
|
2002
|
+
heading: z.ZodString;
|
|
2003
|
+
/** Google Font name for body text. Example: "Inter" */
|
|
2004
|
+
body: z.ZodString;
|
|
2005
|
+
/** Optional monospace font. Example: "Roboto Mono" */
|
|
2006
|
+
mono: z.ZodOptional<z.ZodString>;
|
|
2007
|
+
}, "strip", z.ZodTypeAny, {
|
|
2008
|
+
heading: string;
|
|
2009
|
+
body: string;
|
|
2010
|
+
mono?: string | undefined;
|
|
2011
|
+
}, {
|
|
2012
|
+
heading: string;
|
|
2013
|
+
body: string;
|
|
2014
|
+
mono?: string | undefined;
|
|
2015
|
+
}>>;
|
|
2016
|
+
/**
|
|
2017
|
+
* CSS variable overrides.
|
|
2018
|
+
* Every key must match an --app-* variable name.
|
|
2019
|
+
* All color values must be space-separated RGB integers.
|
|
2020
|
+
*/
|
|
2021
|
+
cssVars: z.ZodObject<{
|
|
2022
|
+
'--app-primary-color': z.ZodOptional<z.ZodString>;
|
|
2023
|
+
'--app-primary-foreground-color': z.ZodOptional<z.ZodString>;
|
|
2024
|
+
'--app-secondary-color': z.ZodOptional<z.ZodString>;
|
|
2025
|
+
'--app-secondary-foreground-color': z.ZodOptional<z.ZodString>;
|
|
2026
|
+
'--app-accent-color': z.ZodOptional<z.ZodString>;
|
|
2027
|
+
'--app-accent-foreground-color': z.ZodOptional<z.ZodString>;
|
|
2028
|
+
'--app-bg-color': z.ZodOptional<z.ZodString>;
|
|
2029
|
+
'--app-card-bg-color': z.ZodOptional<z.ZodString>;
|
|
2030
|
+
'--app-text-color': z.ZodOptional<z.ZodString>;
|
|
2031
|
+
'--app-border-color': z.ZodOptional<z.ZodString>;
|
|
2032
|
+
'--app-muted-bg': z.ZodOptional<z.ZodString>;
|
|
2033
|
+
'--app-muted-text': z.ZodOptional<z.ZodString>;
|
|
2034
|
+
'--app-border-radius-sm': z.ZodOptional<z.ZodString>;
|
|
2035
|
+
'--app-border-radius-md': z.ZodOptional<z.ZodString>;
|
|
2036
|
+
'--app-border-radius-lg': z.ZodOptional<z.ZodString>;
|
|
2037
|
+
'--app-input-bg-color': z.ZodOptional<z.ZodString>;
|
|
2038
|
+
'--app-input-text-color': z.ZodOptional<z.ZodString>;
|
|
2039
|
+
'--app-input-border-color': z.ZodOptional<z.ZodString>;
|
|
2040
|
+
'--app-input-focus-ring-color': z.ZodOptional<z.ZodString>;
|
|
2041
|
+
'--app-input-placeholder-color': z.ZodOptional<z.ZodString>;
|
|
2042
|
+
'--app-chart-1': z.ZodOptional<z.ZodString>;
|
|
2043
|
+
'--app-chart-2': z.ZodOptional<z.ZodString>;
|
|
2044
|
+
'--app-chart-3': z.ZodOptional<z.ZodString>;
|
|
2045
|
+
'--app-chart-4': z.ZodOptional<z.ZodString>;
|
|
2046
|
+
'--app-chart-5': z.ZodOptional<z.ZodString>;
|
|
2047
|
+
}, "strict", z.ZodTypeAny, {
|
|
2048
|
+
'--app-primary-color'?: string | undefined;
|
|
2049
|
+
'--app-primary-foreground-color'?: string | undefined;
|
|
2050
|
+
'--app-secondary-color'?: string | undefined;
|
|
2051
|
+
'--app-secondary-foreground-color'?: string | undefined;
|
|
2052
|
+
'--app-accent-color'?: string | undefined;
|
|
2053
|
+
'--app-accent-foreground-color'?: string | undefined;
|
|
2054
|
+
'--app-bg-color'?: string | undefined;
|
|
2055
|
+
'--app-card-bg-color'?: string | undefined;
|
|
2056
|
+
'--app-text-color'?: string | undefined;
|
|
2057
|
+
'--app-border-color'?: string | undefined;
|
|
2058
|
+
'--app-muted-bg'?: string | undefined;
|
|
2059
|
+
'--app-muted-text'?: string | undefined;
|
|
2060
|
+
'--app-border-radius-sm'?: string | undefined;
|
|
2061
|
+
'--app-border-radius-md'?: string | undefined;
|
|
2062
|
+
'--app-border-radius-lg'?: string | undefined;
|
|
2063
|
+
'--app-input-bg-color'?: string | undefined;
|
|
2064
|
+
'--app-input-text-color'?: string | undefined;
|
|
2065
|
+
'--app-input-border-color'?: string | undefined;
|
|
2066
|
+
'--app-input-focus-ring-color'?: string | undefined;
|
|
2067
|
+
'--app-input-placeholder-color'?: string | undefined;
|
|
2068
|
+
'--app-chart-1'?: string | undefined;
|
|
2069
|
+
'--app-chart-2'?: string | undefined;
|
|
2070
|
+
'--app-chart-3'?: string | undefined;
|
|
2071
|
+
'--app-chart-4'?: string | undefined;
|
|
2072
|
+
'--app-chart-5'?: string | undefined;
|
|
2073
|
+
}, {
|
|
2074
|
+
'--app-primary-color'?: string | undefined;
|
|
2075
|
+
'--app-primary-foreground-color'?: string | undefined;
|
|
2076
|
+
'--app-secondary-color'?: string | undefined;
|
|
2077
|
+
'--app-secondary-foreground-color'?: string | undefined;
|
|
2078
|
+
'--app-accent-color'?: string | undefined;
|
|
2079
|
+
'--app-accent-foreground-color'?: string | undefined;
|
|
2080
|
+
'--app-bg-color'?: string | undefined;
|
|
2081
|
+
'--app-card-bg-color'?: string | undefined;
|
|
2082
|
+
'--app-text-color'?: string | undefined;
|
|
2083
|
+
'--app-border-color'?: string | undefined;
|
|
2084
|
+
'--app-muted-bg'?: string | undefined;
|
|
2085
|
+
'--app-muted-text'?: string | undefined;
|
|
2086
|
+
'--app-border-radius-sm'?: string | undefined;
|
|
2087
|
+
'--app-border-radius-md'?: string | undefined;
|
|
2088
|
+
'--app-border-radius-lg'?: string | undefined;
|
|
2089
|
+
'--app-input-bg-color'?: string | undefined;
|
|
2090
|
+
'--app-input-text-color'?: string | undefined;
|
|
2091
|
+
'--app-input-border-color'?: string | undefined;
|
|
2092
|
+
'--app-input-focus-ring-color'?: string | undefined;
|
|
2093
|
+
'--app-input-placeholder-color'?: string | undefined;
|
|
2094
|
+
'--app-chart-1'?: string | undefined;
|
|
2095
|
+
'--app-chart-2'?: string | undefined;
|
|
2096
|
+
'--app-chart-3'?: string | undefined;
|
|
2097
|
+
'--app-chart-4'?: string | undefined;
|
|
2098
|
+
'--app-chart-5'?: string | undefined;
|
|
2099
|
+
}>;
|
|
2100
|
+
}, "strip", z.ZodTypeAny, {
|
|
2101
|
+
description: string;
|
|
2102
|
+
name: string;
|
|
2103
|
+
cssVars: {
|
|
2104
|
+
'--app-primary-color'?: string | undefined;
|
|
2105
|
+
'--app-primary-foreground-color'?: string | undefined;
|
|
2106
|
+
'--app-secondary-color'?: string | undefined;
|
|
2107
|
+
'--app-secondary-foreground-color'?: string | undefined;
|
|
2108
|
+
'--app-accent-color'?: string | undefined;
|
|
2109
|
+
'--app-accent-foreground-color'?: string | undefined;
|
|
2110
|
+
'--app-bg-color'?: string | undefined;
|
|
2111
|
+
'--app-card-bg-color'?: string | undefined;
|
|
2112
|
+
'--app-text-color'?: string | undefined;
|
|
2113
|
+
'--app-border-color'?: string | undefined;
|
|
2114
|
+
'--app-muted-bg'?: string | undefined;
|
|
2115
|
+
'--app-muted-text'?: string | undefined;
|
|
2116
|
+
'--app-border-radius-sm'?: string | undefined;
|
|
2117
|
+
'--app-border-radius-md'?: string | undefined;
|
|
2118
|
+
'--app-border-radius-lg'?: string | undefined;
|
|
2119
|
+
'--app-input-bg-color'?: string | undefined;
|
|
2120
|
+
'--app-input-text-color'?: string | undefined;
|
|
2121
|
+
'--app-input-border-color'?: string | undefined;
|
|
2122
|
+
'--app-input-focus-ring-color'?: string | undefined;
|
|
2123
|
+
'--app-input-placeholder-color'?: string | undefined;
|
|
2124
|
+
'--app-chart-1'?: string | undefined;
|
|
2125
|
+
'--app-chart-2'?: string | undefined;
|
|
2126
|
+
'--app-chart-3'?: string | undefined;
|
|
2127
|
+
'--app-chart-4'?: string | undefined;
|
|
2128
|
+
'--app-chart-5'?: string | undefined;
|
|
2129
|
+
};
|
|
2130
|
+
fonts?: {
|
|
2131
|
+
heading: string;
|
|
2132
|
+
body: string;
|
|
2133
|
+
mono?: string | undefined;
|
|
2134
|
+
} | undefined;
|
|
2135
|
+
}, {
|
|
2136
|
+
description: string;
|
|
2137
|
+
name: string;
|
|
2138
|
+
cssVars: {
|
|
2139
|
+
'--app-primary-color'?: string | undefined;
|
|
2140
|
+
'--app-primary-foreground-color'?: string | undefined;
|
|
2141
|
+
'--app-secondary-color'?: string | undefined;
|
|
2142
|
+
'--app-secondary-foreground-color'?: string | undefined;
|
|
2143
|
+
'--app-accent-color'?: string | undefined;
|
|
2144
|
+
'--app-accent-foreground-color'?: string | undefined;
|
|
2145
|
+
'--app-bg-color'?: string | undefined;
|
|
2146
|
+
'--app-card-bg-color'?: string | undefined;
|
|
2147
|
+
'--app-text-color'?: string | undefined;
|
|
2148
|
+
'--app-border-color'?: string | undefined;
|
|
2149
|
+
'--app-muted-bg'?: string | undefined;
|
|
2150
|
+
'--app-muted-text'?: string | undefined;
|
|
2151
|
+
'--app-border-radius-sm'?: string | undefined;
|
|
2152
|
+
'--app-border-radius-md'?: string | undefined;
|
|
2153
|
+
'--app-border-radius-lg'?: string | undefined;
|
|
2154
|
+
'--app-input-bg-color'?: string | undefined;
|
|
2155
|
+
'--app-input-text-color'?: string | undefined;
|
|
2156
|
+
'--app-input-border-color'?: string | undefined;
|
|
2157
|
+
'--app-input-focus-ring-color'?: string | undefined;
|
|
2158
|
+
'--app-input-placeholder-color'?: string | undefined;
|
|
2159
|
+
'--app-chart-1'?: string | undefined;
|
|
2160
|
+
'--app-chart-2'?: string | undefined;
|
|
2161
|
+
'--app-chart-3'?: string | undefined;
|
|
2162
|
+
'--app-chart-4'?: string | undefined;
|
|
2163
|
+
'--app-chart-5'?: string | undefined;
|
|
2164
|
+
};
|
|
2165
|
+
fonts?: {
|
|
2166
|
+
heading: string;
|
|
2167
|
+
body: string;
|
|
2168
|
+
mono?: string | undefined;
|
|
2169
|
+
} | undefined;
|
|
2170
|
+
}>;
|
|
2171
|
+
type AITheme = z.infer<typeof AIThemeSchema>;
|
|
2172
|
+
/** All built-in theme preset CSS class names. */
|
|
2173
|
+
declare const THEME_PRESETS: readonly ["light", "dark", "system", "corporate", "midnight", "blueprint"];
|
|
2174
|
+
type ThemePreset = typeof THEME_PRESETS[number];
|
|
2175
|
+
|
|
2176
|
+
declare const UserSchema: z.ZodObject<{
|
|
2177
|
+
id: z.ZodDefault<z.ZodString>;
|
|
2178
|
+
name: z.ZodString;
|
|
2179
|
+
email: z.ZodString;
|
|
2180
|
+
password: z.ZodOptional<z.ZodString>;
|
|
2181
|
+
role: z.ZodString;
|
|
2182
|
+
status: z.ZodOptional<z.ZodString>;
|
|
2183
|
+
joinedAt: z.ZodOptional<z.ZodString>;
|
|
2184
|
+
lastActive: z.ZodOptional<z.ZodString>;
|
|
2185
|
+
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
2186
|
+
}, "strip", z.ZodTypeAny, {
|
|
2187
|
+
email: string;
|
|
2188
|
+
id: string;
|
|
2189
|
+
name: string;
|
|
2190
|
+
role: string;
|
|
2191
|
+
status?: string | undefined;
|
|
2192
|
+
password?: string | undefined;
|
|
2193
|
+
joinedAt?: string | undefined;
|
|
2194
|
+
lastActive?: string | undefined;
|
|
2195
|
+
avatarUrl?: string | undefined;
|
|
2196
|
+
}, {
|
|
2197
|
+
email: string;
|
|
2198
|
+
name: string;
|
|
2199
|
+
role: string;
|
|
2200
|
+
status?: string | undefined;
|
|
2201
|
+
id?: string | undefined;
|
|
2202
|
+
password?: string | undefined;
|
|
2203
|
+
joinedAt?: string | undefined;
|
|
2204
|
+
lastActive?: string | undefined;
|
|
2205
|
+
avatarUrl?: string | undefined;
|
|
2206
|
+
}>;
|
|
2207
|
+
type User = z.infer<typeof UserSchema>;
|
|
1416
2208
|
|
|
1417
|
-
export { AI_TOOLS, type ActionDefinition, ActionSchema, type AppSpecification, AppSpecificationSchema, type Block, BlockSchema, schema as Bodewell, type EntityDefinition, EntitySchema, type FieldDefinition, FieldSchema, type FloraTelemetry, FloraTelemetrySchema, type PageDefinition, PageSchema, type PageSection, PageSectionSchema, type ResourceDefinition, ResourceSchema, type SignalDefinition, SignalSchema, type StockChartParams, type TelemetryGraphParams, type ToolCall, type ToolDefinition, TriggerSchema, type WorkflowDefinition, WorkflowSchema,
|
|
2209
|
+
export { type AIKeyManifest, AIKeyManifestSchema, type AITheme, AIThemeSchema, AI_ROSTER, AI_TOOLS, type ActionDefinition, ActionSchema, type AgentRoleConfig, type AgentRoleKey, AppSignalSchema, type AppSpecification, AppSpecificationSchema, AuthStrategySchema, type Block, BlockSchema, schema as Bodewell, DEFAULT_CHAT_MODEL, DEFAULT_PRO_MODEL, DEFAULT_SCHEMA_MODEL, type EntityDefinition, EntitySchema, type FieldDefinition, FieldSchema, type FloraTelemetry, FloraTelemetrySchema, GENESIS_LIBRARY_CONTEXT, GENESIS_VALID_COMPONENTS, type GenesisComponentType, type PageDefinition, PageSchema, type PageSection, PageSectionSchema, type ResourceDefinition, ResourceSchema, SIGNAL_DOMAINS, SIGNAL_KINDS, SIGNAL_KIND_LABELS, SIGNAL_SOURCES, type Signal, type SignalArray, SignalArraySchema, type SignalDefinition, type SignalDomain, type SignalKind, SignalKindSchema, type SignalPacket, SignalPacketSchema, SignalSchema, type SignalSource, SignalSourceSchema, type StockChartParams, THEME_PRESETS, THEME_SYSTEM_PROMPT, type TelemetryGraphParams, type ThemeFonts, ThemeFontsSchema, type ThemeOverrides, ThemeOverridesSchema, type ThemePreset, type ToolCall, type ToolDefinition, TriggerSchema, type User, UserSchema, type WorkflowDefinition, WorkflowSchema, stockChartParameters, telemetryGraphParameters };
|