@ramme-io/kernel 2.1.2 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AiGateway-CwdiRjH4.js +1457 -0
- package/dist/index.es.js +6448 -6156
- package/dist/kernel/src/agents/roster.d.ts +58 -0
- package/dist/kernel/src/agents/roster.d.ts.map +1 -0
- package/dist/kernel/src/auth/AuthContext.d.ts +16 -0
- package/dist/kernel/src/auth/AuthContext.d.ts.map +1 -0
- package/dist/kernel/src/auth/LoginScreen.d.ts +4 -0
- package/dist/kernel/src/auth/LoginScreen.d.ts.map +1 -0
- package/dist/kernel/src/auth/ProtectedRoute.d.ts +4 -0
- package/dist/kernel/src/auth/ProtectedRoute.d.ts.map +1 -0
- package/dist/kernel/src/auth/SignupScreen.d.ts +4 -0
- package/dist/kernel/src/auth/SignupScreen.d.ts.map +1 -0
- package/dist/kernel/src/components/AIChatPanel.d.ts.map +1 -1
- package/dist/kernel/src/components/SmartTable.d.ts.map +1 -1
- package/dist/kernel/src/components/settings/AiSettingsPanel.d.ts.map +1 -1
- package/dist/kernel/src/components/settings/SettingsModal.d.ts.map +1 -1
- package/dist/kernel/src/engine/HitlSimulator.d.ts +1 -1
- package/dist/kernel/src/engine/TelemetrySmoother.d.ts +1 -1
- package/dist/kernel/src/engine/runtime/ManifestContext.d.ts +94 -89
- package/dist/kernel/src/engine/runtime/ManifestContext.d.ts.map +1 -1
- package/dist/kernel/src/engine/runtime/MqttContext.d.ts +1 -0
- package/dist/kernel/src/engine/runtime/MqttContext.d.ts.map +1 -1
- package/dist/kernel/src/engine/runtime/useLiveBridge.d.ts +94 -89
- package/dist/kernel/src/engine/runtime/useLiveBridge.d.ts.map +1 -1
- package/dist/kernel/src/engine/runtime/useRammeAI.d.ts.map +1 -1
- package/dist/kernel/src/engine/validation/schema.d.ts +1 -1
- package/dist/kernel/src/hooks/useAIKeyOrchestrator.d.ts +12 -0
- package/dist/kernel/src/hooks/useAIKeyOrchestrator.d.ts.map +1 -0
- package/dist/kernel/src/hooks/useDevice.d.ts +4 -4
- package/dist/kernel/src/index.d.ts +13 -0
- package/dist/kernel/src/index.d.ts.map +1 -1
- package/dist/kernel/src/server.d.ts +3 -0
- package/dist/kernel/src/server.d.ts.map +1 -1
- package/dist/kernel/src/services/GhostBridge.d.ts +54 -0
- package/dist/kernel/src/services/GhostBridge.d.ts.map +1 -0
- package/dist/kernel/src/services/MarketDataService.d.ts +24 -0
- package/dist/kernel/src/services/MarketDataService.d.ts.map +1 -0
- package/dist/kernel/src/services/NeuralGateway.d.ts +46 -0
- package/dist/kernel/src/services/NeuralGateway.d.ts.map +1 -0
- package/dist/kernel/src/services/ai/models.d.ts.map +1 -1
- package/dist/kernel/src/services/ai/providers/AnthropicAdapter.d.ts.map +1 -1
- package/dist/kernel/src/services/ai/providers/GeminiAdapter.d.ts.map +1 -1
- package/dist/kernel/src/services/ai/toolPromptGenerator.d.ts +23 -0
- package/dist/kernel/src/services/ai/toolPromptGenerator.d.ts.map +1 -0
- package/dist/kernel/src/signals/BaseSignalAdapter.d.ts +60 -0
- package/dist/kernel/src/signals/BaseSignalAdapter.d.ts.map +1 -0
- package/dist/kernel/src/stores/useMarketDataStore.d.ts +17 -0
- package/dist/kernel/src/stores/useMarketDataStore.d.ts.map +1 -0
- package/dist/kernel/src/stores/useSettingsStore.d.ts.map +1 -1
- package/dist/kernel/src/stores/useSignalStore.d.ts +58 -0
- package/dist/kernel/src/stores/useSignalStore.d.ts.map +1 -0
- package/dist/server.es.js +82 -24
- package/package.json +12 -5
- package/dist/index-rELWPQV7.js +0 -1157
- package/dist/kernel/src/engine/runtime/useWorkflowEngine.d.ts +0 -4
- package/dist/kernel/src/engine/runtime/useWorkflowEngine.d.ts.map +0 -1
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* Adheres strictly to the Zero Jank Mandate.
|
|
5
5
|
*/
|
|
6
6
|
export declare function useDevice(): {
|
|
7
|
-
timestamp
|
|
8
|
-
soilMoisture
|
|
9
|
-
ambientLight
|
|
10
|
-
temperature
|
|
7
|
+
timestamp?: number;
|
|
8
|
+
soilMoisture?: number;
|
|
9
|
+
ambientLight?: number;
|
|
10
|
+
temperature?: number;
|
|
11
11
|
};
|
|
12
12
|
//# sourceMappingURL=useDevice.d.ts.map
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export * from './agents/roster';
|
|
2
|
+
export * from './services/GhostBridge';
|
|
1
3
|
export * from './engine/runtime/ManifestContext';
|
|
2
4
|
export * from './engine/runtime/MqttContext';
|
|
3
5
|
export * from './engine/runtime/SitemapContext';
|
|
@@ -15,11 +17,17 @@ export * from './engine/runtime/useRammeAI';
|
|
|
15
17
|
export * from './stores/useAppStore';
|
|
16
18
|
export * from './stores/useSettingsStore';
|
|
17
19
|
export * from './stores/spatialStore';
|
|
20
|
+
export * from './stores/useMarketDataStore';
|
|
21
|
+
export { useSignalStore, selectSignalById, selectSignalsByDomain, selectSignalsBySource, } from './stores/useSignalStore';
|
|
22
|
+
export { BaseSignalAdapter } from './signals/BaseSignalAdapter';
|
|
23
|
+
export type { AdapterStatus } from './signals/BaseSignalAdapter';
|
|
18
24
|
export * from './components/settings/AiSettingsPanel';
|
|
19
25
|
export * from './components/AIChatPanel';
|
|
20
26
|
export * from './services/ai/models';
|
|
27
|
+
export { generateToolSystemPrompt } from './services/ai/toolPromptGenerator';
|
|
21
28
|
export { AiGateway, aiGateway } from './services/AiGateway';
|
|
22
29
|
export * from './services/ai';
|
|
30
|
+
export * from './services/MarketDataService';
|
|
23
31
|
export type { AITransport, ChatMessage, TransportMode } from './services/ai/transport';
|
|
24
32
|
export { LocalTransportAdapter } from './services/ai/adapters/LocalTransportAdapter';
|
|
25
33
|
export { ProxyTransportAdapter } from './services/ai/adapters/ProxyTransportAdapter';
|
|
@@ -27,6 +35,11 @@ export * from './engine/validation/schema';
|
|
|
27
35
|
export * from './engine/types/manifest-types';
|
|
28
36
|
export * from './engine/types/sitemap-entry';
|
|
29
37
|
export * from './hooks/useDevice';
|
|
38
|
+
export * from './hooks/useAIKeyOrchestrator';
|
|
39
|
+
export * from './auth/AuthContext';
|
|
40
|
+
export * from './auth/ProtectedRoute';
|
|
41
|
+
export * from './auth/LoginScreen';
|
|
42
|
+
export * from './auth/SignupScreen';
|
|
30
43
|
export * from './engine/renderers/DynamicBlock';
|
|
31
44
|
export * from './engine/renderers/DynamicPage';
|
|
32
45
|
export * from './engine/renderers/route-generator';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAOA,cAAc,iBAAiB,CAAC;AAOhC,cAAc,wBAAwB,CAAC;AAKvC,cAAc,kCAAkC,CAAC;AACjD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iCAAiC,CAAC;AAChD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sCAAsC,CAAC;AACrD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oCAAoC,CAAC;AACnD,cAAc,sCAAsC,CAAC;AACrD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,8BAA8B,CAAC;AAG7C,cAAc,iCAAiC,CAAC;AAGhD,cAAc,6BAA6B,CAAC;AAK5C,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAI5C,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,YAAY,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAGjE,cAAc,uCAAuC,CAAC;AAEtD,cAAc,0BAA0B,CAAC;AAEzC,cAAc,sBAAsB,CAAC;AAGrC,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAM7E,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAG5D,cAAc,eAAe,CAAC;AAC9B,cAAc,8BAA8B,CAAC;AAG7C,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACvF,OAAO,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AAMrF,cAAc,4BAA4B,CAAC;AAE3C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8BAA8B,CAAC;AAK7C,cAAc,mBAAmB,CAAC;AAClC,cAAc,8BAA8B,CAAC;AAK7C,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AAKpC,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AAKnD,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qCAAqC,CAAC"}
|
|
@@ -21,6 +21,9 @@
|
|
|
21
21
|
* import { aiGatewayService } from '@ramme-io/kernel';
|
|
22
22
|
* ```
|
|
23
23
|
*/
|
|
24
|
+
export { AGENT_ROSTER } from './agents/roster';
|
|
25
|
+
export type { AgentRole } from './agents/roster';
|
|
26
|
+
export { NeuralGateway } from './services/NeuralGateway';
|
|
24
27
|
export { AiGatewayService, aiGatewayService } from './services/ai/AiGatewayService';
|
|
25
28
|
export { AiConfigResolver } from './services/ai/ConfigResolver';
|
|
26
29
|
export { InMemoryRateLimiter } from './services/ai/RateLimiter';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAOH,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,YAAY,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAOjD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAGzD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAGhE,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAG1E,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAK5D,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8BAA8B,CAAC;AAG7C,YAAY,EACV,UAAU,EACV,aAAa,EACb,iBAAiB,EACjB,UAAU,EACV,cAAc,EACf,MAAM,qBAAqB,CAAC;AAE7B,YAAY,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { AppSpecification } from '../engine/validation/schema';
|
|
2
|
+
|
|
3
|
+
/** The postMessage event type. Both sides MUST use this exact string. */
|
|
4
|
+
export declare const GHOST_BRIDGE_MSG_TYPE: "RAMME_SYNC_MANIFEST";
|
|
5
|
+
/** Default target origin for postMessage. Use '*' only in local dev. */
|
|
6
|
+
export declare const GHOST_BRIDGE_DEFAULT_ORIGIN: "*";
|
|
7
|
+
/**
|
|
8
|
+
* Returns true when this code is running inside an <iframe> (Preview Shell).
|
|
9
|
+
* Detection method: window.parent !== window is always true inside iframes.
|
|
10
|
+
*/
|
|
11
|
+
export declare const isPreviewShell: () => boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Returns true when this code is running as the top-level orchestrator window.
|
|
14
|
+
* This is the Builder app or any parent-level orchestrator.
|
|
15
|
+
*/
|
|
16
|
+
export declare const isOrchestrator: () => boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Emit an AppSpecification manifest to a target iframe Preview Shell.
|
|
19
|
+
*
|
|
20
|
+
* HARD GUARD: Will throw a TypeError if called from inside an iframe.
|
|
21
|
+
* This prevents the Builder from accidentally postMessaging to its own parent.
|
|
22
|
+
*
|
|
23
|
+
* @param manifest The complete AppSpecification to broadcast
|
|
24
|
+
* @param target The contentWindow of the target <iframe> element
|
|
25
|
+
* @param targetOrigin The expected origin of the iframe. Defaults to '*' (dev only).
|
|
26
|
+
* In production, always specify the Preview Shell origin explicitly.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* // In the Builder (RuntimePreview.tsx):
|
|
30
|
+
* emitManifest(manifest, iframeRef.current.contentWindow, 'https://preview.ramme.io');
|
|
31
|
+
*/
|
|
32
|
+
export declare function emitManifest(manifest: AppSpecification, target: Window, targetOrigin?: string): void;
|
|
33
|
+
/**
|
|
34
|
+
* Attach a listener for incoming AppSpecification manifests from a parent Orchestrator.
|
|
35
|
+
* Intended for use inside ManifestContext.tsx in the Preview Shell.
|
|
36
|
+
*
|
|
37
|
+
* Returns an unsubscribe function — call it in useEffect cleanup to prevent
|
|
38
|
+
* memory leaks when the Preview Shell unmounts.
|
|
39
|
+
*
|
|
40
|
+
* @param handler Callback invoked with the received AppSpecification
|
|
41
|
+
* @param trustedOrigins Optional array of trusted parent origins for security validation.
|
|
42
|
+
* If empty, all origins are accepted (dev mode).
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* // In ManifestContext.tsx (Preview Shell):
|
|
46
|
+
* useEffect(() => {
|
|
47
|
+
* const unsubscribe = onManifestReceived((manifest) => {
|
|
48
|
+
* setManifest(manifest);
|
|
49
|
+
* });
|
|
50
|
+
* return unsubscribe;
|
|
51
|
+
* }, []);
|
|
52
|
+
*/
|
|
53
|
+
export declare function onManifestReceived(handler: (manifest: AppSpecification) => void, trustedOrigins?: string[]): () => void;
|
|
54
|
+
//# sourceMappingURL=GhostBridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GhostBridge.d.ts","sourceRoot":"","sources":["../../../../src/services/GhostBridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAMpE,yEAAyE;AACzE,eAAO,MAAM,qBAAqB,EAAG,qBAA8B,CAAC;AAEpE,wEAAwE;AACxE,eAAO,MAAM,2BAA2B,EAAG,GAAY,CAAC;AAMxD;;;GAGG;AACH,eAAO,MAAM,cAAc,QAAO,OAQjC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,QAAO,OAA4B,CAAC;AAM/D;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,gBAAgB,EAC1B,MAAM,EAAE,MAAM,EACd,YAAY,GAAE,MAAoC,GACjD,IAAI,CAkBN;AAMD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,CAAC,QAAQ,EAAE,gBAAgB,KAAK,IAAI,EAC7C,cAAc,GAAE,MAAM,EAAO,GAC5B,MAAM,IAAI,CAiCZ"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
declare class MarketDataService {
|
|
2
|
+
private ws;
|
|
3
|
+
private _keyId;
|
|
4
|
+
private _secret;
|
|
5
|
+
private isConnected;
|
|
6
|
+
private isAuthenticated;
|
|
7
|
+
private subscribedTickers;
|
|
8
|
+
private reconnectionTimeout;
|
|
9
|
+
private disconnectTimeout;
|
|
10
|
+
private static instance;
|
|
11
|
+
private constructor();
|
|
12
|
+
static getInstance(): MarketDataService;
|
|
13
|
+
connect(keyId?: string, secret?: string): void;
|
|
14
|
+
private authenticate;
|
|
15
|
+
subscribe(tickers: string[]): void;
|
|
16
|
+
unsubscribe(tickers: string[]): void;
|
|
17
|
+
private resubscribeTickers;
|
|
18
|
+
disconnect(): void;
|
|
19
|
+
getIsConnected(): boolean;
|
|
20
|
+
getSubscribedTickers(): string[];
|
|
21
|
+
}
|
|
22
|
+
export declare const marketDataService: MarketDataService;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=MarketDataService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarketDataService.d.ts","sourceRoot":"","sources":["../../../../src/services/MarketDataService.ts"],"names":[],"mappings":"AAcA,cAAM,iBAAiB;IACrB,OAAO,CAAC,EAAE,CAA0B;IACpC,OAAO,CAAC,MAAM,CAAqB;IACnC,OAAO,CAAC,OAAO,CAAqB;IACpC,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,eAAe,CAAS;IAChC,OAAO,CAAC,iBAAiB,CAAgB;IACzC,OAAO,CAAC,mBAAmB,CAA8C;IACzE,OAAO,CAAC,iBAAiB,CAA+B;IACxD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAoB;IAE3C,OAAO;WAIO,WAAW,IAAI,iBAAiB;IAOvC,OAAO,CACZ,KAAK,GAAE,MAA2D,EAClE,MAAM,GAAE,MAA2D,GAClE,IAAI;IA+FP,OAAO,CAAC,YAAY;IAcb,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI;IAuBlC,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI;IAgB3C,OAAO,CAAC,kBAAkB;IAmBnB,UAAU,IAAI,IAAI;IAsBlB,cAAc,IAAI,OAAO;IAIzB,oBAAoB,IAAI,MAAM,EAAE;CAGxC;AAED,eAAO,MAAM,iBAAiB,mBAAkC,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ZodSchema } from 'zod';
|
|
2
|
+
import { AI_ROSTER } from '../../../shared/index.ts';
|
|
3
|
+
|
|
4
|
+
export declare const NeuralGateway: {
|
|
5
|
+
/**
|
|
6
|
+
* Generate a validated, typed object using the Vercel AI SDK.
|
|
7
|
+
*
|
|
8
|
+
* Primary use: /api/adapt (One-Shot Genesis endpoint)
|
|
9
|
+
*
|
|
10
|
+
* @param opts.schema - Zod schema that constrains the output
|
|
11
|
+
* @param opts.prompt - User prompt (single-turn)
|
|
12
|
+
* @param opts.system - System instruction for the model
|
|
13
|
+
* @param opts.role - Optional AI_ROSTER key (sets model + temperature)
|
|
14
|
+
* @param opts.apiKey - Optional client-provided key
|
|
15
|
+
*/
|
|
16
|
+
generateSchema<T>(opts: {
|
|
17
|
+
schema: ZodSchema<T>;
|
|
18
|
+
prompt: string;
|
|
19
|
+
system?: string;
|
|
20
|
+
role?: keyof typeof AI_ROSTER;
|
|
21
|
+
model?: string;
|
|
22
|
+
temperature?: number;
|
|
23
|
+
apiKey?: string;
|
|
24
|
+
}): Promise<T>;
|
|
25
|
+
/**
|
|
26
|
+
* Stream a chat response and return a ready-to-return Next.js Response.
|
|
27
|
+
*
|
|
28
|
+
* Primary use: /api/ai/chat (agent chat), /api/ai/diagnostic (hardware scan)
|
|
29
|
+
*
|
|
30
|
+
* @param opts.messages - Full conversation history
|
|
31
|
+
* @param opts.system - System instruction (agent persona)
|
|
32
|
+
* @param opts.role - Optional AI_ROSTER key
|
|
33
|
+
* @param opts.apiKey - Optional client-provided key
|
|
34
|
+
*
|
|
35
|
+
* @returns A Response object — directly return this from your route handler.
|
|
36
|
+
*/
|
|
37
|
+
streamChatResponse(opts: {
|
|
38
|
+
messages: any[];
|
|
39
|
+
system: string;
|
|
40
|
+
role?: keyof typeof AI_ROSTER;
|
|
41
|
+
model?: string;
|
|
42
|
+
temperature?: number;
|
|
43
|
+
apiKey?: string;
|
|
44
|
+
}): Response;
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=NeuralGateway.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NeuralGateway.d.ts","sourceRoot":"","sources":["../../../../src/services/NeuralGateway.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAIH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACrC,OAAO,EAAE,SAAS,EAA4C,MAAM,kBAAkB,CAAC;AA+BvF,eAAO,MAAM,aAAa;IACxB;;;;;;;;;;OAUG;mBACkB,CAAC,QAAQ;QAC5B,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;QACrB,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,OAAO,SAAS,CAAC;QAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,GAAG,OAAO,CAAC,CAAC,CAAC;IAoBd;;;;;;;;;;;OAWG;6BACsB;QACvB,QAAQ,EAAE,GAAG,EAAE,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,OAAO,SAAS,CAAC;QAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,GAAG,QAAQ;CAgBb,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../../../src/services/ai/models.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../../../src/services/ai/models.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,CAQxD,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAOtD,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAMpE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnthropicAdapter.d.ts","sourceRoot":"","sources":["../../../../../../src/services/ai/providers/AnthropicAdapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEjE,qBAAa,gBAAiB,YAAW,iBAAiB;IAClD,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC;IAuDnE,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,GAAG,aAAa,CAAC,MAAM,CAAC;IA4FzE,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,CAAC,CAAC;IAwDpE,UAAU,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"AnthropicAdapter.d.ts","sourceRoot":"","sources":["../../../../../../src/services/ai/providers/AnthropicAdapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEjE,qBAAa,gBAAiB,YAAW,iBAAiB;IAClD,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC;IAuDnE,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,GAAG,aAAa,CAAC,MAAM,CAAC;IA4FzE,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,CAAC,CAAC;IAwDpE,UAAU,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAUtE,OAAO,CAAC,cAAc;CA6BvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeminiAdapter.d.ts","sourceRoot":"","sources":["../../../../../../src/services/ai/providers/GeminiAdapter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE5D,qBAAa,aAAc,YAAW,iBAAiB;IAC/C,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"GeminiAdapter.d.ts","sourceRoot":"","sources":["../../../../../../src/services/ai/providers/GeminiAdapter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE5D,qBAAa,aAAc,YAAW,iBAAiB;IAC/C,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC;IA8BnE,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,GAAG,aAAa,CAAC,MAAM,CAAC;IA0DzE,cAAc,CAAC,CAAC,EACpB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,CAAC,CAAC;IAkCP,UAAU,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAkBpD,OAAO,CAAC,cAAc;CAavB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ToolDefinition } from '../../../../shared/index.ts';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Generates the XML-formatted system prompt fragment for LLM tool calling.
|
|
5
|
+
* This is appended to the agent's system prompt when tools are enabled.
|
|
6
|
+
*
|
|
7
|
+
* The LLM is instructed to output tool calls in a strict XML format:
|
|
8
|
+
* <tool_call>{ "name": "...", "arguments": { ... } }</tool_call>
|
|
9
|
+
*
|
|
10
|
+
* @param tools Array of ToolDefinition objects to include in the prompt
|
|
11
|
+
* @returns A formatted string to append to the LLM system prompt
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* import { generateToolSystemPrompt } from '@ramme-io/kernel';
|
|
15
|
+
* import { AI_TOOLS } from '@ramme-io/shared';
|
|
16
|
+
*
|
|
17
|
+
* const systemPrompt = basePrompt + '\n\n' + generateToolSystemPrompt([
|
|
18
|
+
* AI_TOOLS.get_telemetry_graph,
|
|
19
|
+
* AI_TOOLS.get_stock_chart,
|
|
20
|
+
* ]);
|
|
21
|
+
*/
|
|
22
|
+
export declare function generateToolSystemPrompt(tools: ToolDefinition[]): string;
|
|
23
|
+
//# sourceMappingURL=toolPromptGenerator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolPromptGenerator.d.ts","sourceRoot":"","sources":["../../../../../src/services/ai/toolPromptGenerator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,MAAM,CAoExE"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Signal } from '../../../shared/index.ts';
|
|
2
|
+
|
|
3
|
+
export type AdapterStatus = 'idle' | 'connecting' | 'connected' | 'disconnected' | 'error';
|
|
4
|
+
export declare abstract class BaseSignalAdapter {
|
|
5
|
+
/**
|
|
6
|
+
* The transport source this adapter bridges.
|
|
7
|
+
* All Signals produced by this adapter will carry this source value.
|
|
8
|
+
*/
|
|
9
|
+
abstract readonly source: Signal['source'];
|
|
10
|
+
/**
|
|
11
|
+
* Human-readable adapter name for logging and debugging.
|
|
12
|
+
*/
|
|
13
|
+
abstract readonly name: string;
|
|
14
|
+
/**
|
|
15
|
+
* Current connection status.
|
|
16
|
+
*/
|
|
17
|
+
protected status: AdapterStatus;
|
|
18
|
+
/**
|
|
19
|
+
* Connect to the data source and begin emitting Signals.
|
|
20
|
+
* After this call, the adapter should start receiving data and
|
|
21
|
+
* calling this.emit() for each raw message.
|
|
22
|
+
*/
|
|
23
|
+
abstract connect(): void;
|
|
24
|
+
/**
|
|
25
|
+
* Disconnect from the data source and stop emitting Signals.
|
|
26
|
+
* MUST clean up all subscriptions, timers, and event listeners.
|
|
27
|
+
*/
|
|
28
|
+
abstract disconnect(): void;
|
|
29
|
+
/**
|
|
30
|
+
* Map a raw source-specific payload to a Signal shape.
|
|
31
|
+
*
|
|
32
|
+
* RULES:
|
|
33
|
+
* - Output key MUST be abstract (e.g. 'moisture', not 'soil_vwc')
|
|
34
|
+
* - Output id MUST follow '<entity-id>:<key>' convention
|
|
35
|
+
* - Output timestamp MUST represent when the reading was TAKEN, not received
|
|
36
|
+
* - NEVER return partial data — all required Signal fields must be present
|
|
37
|
+
*
|
|
38
|
+
* @param raw The raw payload from the source (Buffer, object, string)
|
|
39
|
+
* @param context Optional context from the transport (e.g. MQTT topic, URL path)
|
|
40
|
+
* @returns A partial Signal object (emit() completes validation)
|
|
41
|
+
*/
|
|
42
|
+
protected abstract mapToSignal(raw: unknown, context?: string): Omit<Signal, 'source'>;
|
|
43
|
+
/**
|
|
44
|
+
* Validates a raw payload and writes the resulting Signal to the store.
|
|
45
|
+
*
|
|
46
|
+
* Call this from your message handler AFTER mapToSignal() produces a shape.
|
|
47
|
+
* This is the Law 12 enforcement boundary — no Signal reaches the store
|
|
48
|
+
* without passing SignalSchema.parse().
|
|
49
|
+
*
|
|
50
|
+
* @param raw The raw source payload to adapt
|
|
51
|
+
* @param context Optional context (e.g. MQTT topic name)
|
|
52
|
+
* @returns The validated Signal object, or null if validation failed
|
|
53
|
+
*/
|
|
54
|
+
protected emit(raw: unknown, context?: string): Signal | null;
|
|
55
|
+
/**
|
|
56
|
+
* Returns the current adapter status.
|
|
57
|
+
*/
|
|
58
|
+
getStatus(): AdapterStatus;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=BaseSignalAdapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseSignalAdapter.d.ts","sourceRoot":"","sources":["../../../../src/signals/BaseSignalAdapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEH,OAAO,EAAgB,KAAK,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAO7D,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,YAAY,GAAG,WAAW,GAAG,cAAc,GAAG,OAAO,CAAC;AAM3F,8BAAsB,iBAAiB;IACrC;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;IAE3C;;OAEG;IACH,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAE/B;;OAEG;IACH,SAAS,CAAC,MAAM,EAAE,aAAa,CAAU;IAEzC;;;;OAIG;IACH,QAAQ,CAAC,OAAO,IAAI,IAAI;IAExB;;;OAGG;IACH,QAAQ,CAAC,UAAU,IAAI,IAAI;IAE3B;;;;;;;;;;;;OAYG;IACH,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC;IAEtF;;;;;;;;;;OAUG;IACH,SAAS,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IA2B7D;;OAEG;IACH,SAAS,IAAI,aAAa;CAG3B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface LivePriceData {
|
|
2
|
+
price: number;
|
|
3
|
+
change: number;
|
|
4
|
+
trend: 'up' | 'down' | 'flat';
|
|
5
|
+
}
|
|
6
|
+
interface MarketDataState {
|
|
7
|
+
livePrices: Record<string, LivePriceData>;
|
|
8
|
+
updatePrice: (ticker: string, newPrice: number) => void;
|
|
9
|
+
_messageBuffer: {
|
|
10
|
+
ticker: string;
|
|
11
|
+
price: number;
|
|
12
|
+
}[];
|
|
13
|
+
_flushBuffer: () => void;
|
|
14
|
+
}
|
|
15
|
+
export declare const useMarketDataStore: import('zustand').UseBoundStore<import('zustand').StoreApi<MarketDataState>>;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=useMarketDataStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMarketDataStore.d.ts","sourceRoot":"","sources":["../../../../src/stores/useMarketDataStore.ts"],"names":[],"mappings":"AAEA,UAAU,aAAa;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;CAC/B;AAED,UAAU,eAAe;IACvB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IAC1C,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACxD,cAAc,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACpD,YAAY,EAAE,MAAM,IAAI,CAAC;CAC1B;AA+CD,eAAO,MAAM,kBAAkB,8EAU5B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSettingsStore.d.ts","sourceRoot":"","sources":["../../../../src/stores/useSettingsStore.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"useSettingsStore.d.ts","sourceRoot":"","sources":["../../../../src/stores/useSettingsStore.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAKvD,UAAU,aAAa;IAErB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,eAAe,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,MAAM,EAAE,MAAM,OAAO,CAAC;IAGtB,4FAA4F;IAC5F,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACnD,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IACpD,WAAW,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,YAAY,EAAE,MAAM,IAAI,CAAC;IAGzB,qFAAqF;IACrF,UAAU,EAAE,UAAU,CAAC;IACvB,4DAA4D;IAC5D,OAAO,EAAE,MAAM,CAAC;IAChB,sEAAsE;IACtE,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,CAAC,QAAQ,EAAE,UAAU,KAAK,IAAI,CAAC;IAC9C,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,YAAY,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAGpC,cAAc,EAAE,OAAO,CAAC;IACxB,cAAc,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CAC5C;AAED,eAAO,MAAM,gBAAgB;;;;;;;;;;;;EAsI5B,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Signal } from '../../../shared/index.ts';
|
|
2
|
+
|
|
3
|
+
interface SignalState {
|
|
4
|
+
/**
|
|
5
|
+
* A flat record of all known Signals, keyed by Signal.id.
|
|
6
|
+
* Convention: signals['sensor-01:moisture'], signals['AAPL:price']
|
|
7
|
+
*/
|
|
8
|
+
signals: Record<string, Signal>;
|
|
9
|
+
/**
|
|
10
|
+
* The timestamp (Unix ms) of the most recently received signal.
|
|
11
|
+
* Useful for detecting stale data without subscribing to all signals.
|
|
12
|
+
*/
|
|
13
|
+
lastUpdated: number | null;
|
|
14
|
+
/**
|
|
15
|
+
* Validates and stores a Signal packet synchronously (one setState per call).
|
|
16
|
+
* Use for low-frequency sources (<10Hz). For high-frequency MQTT streams,
|
|
17
|
+
* use bufferSignal() to avoid per-packet React re-renders.
|
|
18
|
+
*
|
|
19
|
+
* @throws Never — parse errors are caught and logged, not re-thrown.
|
|
20
|
+
*/
|
|
21
|
+
setSignal: (packet: unknown) => void;
|
|
22
|
+
/**
|
|
23
|
+
* Drops a pre-validated Signal into the high-speed accumulator.
|
|
24
|
+
* Zero reactive overhead — does NOT call Zustand set().
|
|
25
|
+
* The RAF flush loop drains the accumulator into reactive state at ≤15Hz.
|
|
26
|
+
*
|
|
27
|
+
* CALLER CONTRACT: signal must already satisfy SignalSchema.
|
|
28
|
+
* Use after a successful safeParse() in the adapter/context layer.
|
|
29
|
+
*
|
|
30
|
+
* @param key The signal ID (signal.id) used as the accumulator key.
|
|
31
|
+
* @param signal The validated Signal object.
|
|
32
|
+
*/
|
|
33
|
+
bufferSignal: (key: string, signal: Signal) => void;
|
|
34
|
+
/**
|
|
35
|
+
* Reads a single Signal by ID without subscribing to the whole store.
|
|
36
|
+
* Use this in event handlers, not in render — for render, use the selector.
|
|
37
|
+
*/
|
|
38
|
+
getSignal: (id: string) => Signal | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* Clears all signals from the store.
|
|
41
|
+
* Use on disconnection or when switching tenants/apps.
|
|
42
|
+
*/
|
|
43
|
+
clearSignals: () => void;
|
|
44
|
+
/**
|
|
45
|
+
* Removes a single signal by ID.
|
|
46
|
+
* Use when a device goes offline and stale data should not be displayed.
|
|
47
|
+
*/
|
|
48
|
+
removeSignal: (id: string) => void;
|
|
49
|
+
}
|
|
50
|
+
export declare const useSignalStore: import('zustand').UseBoundStore<import('zustand').StoreApi<SignalState>>;
|
|
51
|
+
/** Select a single signal by ID — component only re-renders when THAT signal changes. */
|
|
52
|
+
export declare const selectSignalById: (id: string) => (state: SignalState) => Signal | undefined;
|
|
53
|
+
/** Select all signals for a given domain (e.g. 'agriculture', 'finance'). */
|
|
54
|
+
export declare const selectSignalsByDomain: (domain: string) => (state: SignalState) => Signal[];
|
|
55
|
+
/** Select all signals of a given source (e.g. 'mqtt', 'http'). */
|
|
56
|
+
export declare const selectSignalsBySource: (source: Signal["source"]) => (state: SignalState) => Signal[];
|
|
57
|
+
export {};
|
|
58
|
+
//# sourceMappingURL=useSignalStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSignalStore.d.ts","sourceRoot":"","sources":["../../../../src/stores/useSignalStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAGH,OAAO,EAAgB,KAAK,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAmB7D,UAAU,WAAW;IACnB;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEhC;;;OAGG;IACH,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAE3B;;;;;;OAMG;IACH,SAAS,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IAErC;;;;;;;;;;OAUG;IACH,YAAY,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAEpD;;;OAGG;IACH,SAAS,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IAE9C;;;OAGG;IACH,YAAY,EAAE,MAAM,IAAI,CAAC;IAEzB;;;OAGG;IACH,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC;AAMD,eAAO,MAAM,cAAc,0EAoCxB,CAAC;AA6BJ,yFAAyF;AACzF,eAAO,MAAM,gBAAgB,GAAI,IAAI,MAAM,MACxC,OAAO,WAAW,KAAG,MAAM,GAAG,SAA8B,CAAC;AAEhE,6EAA6E;AAC7E,eAAO,MAAM,qBAAqB,GAAI,QAAQ,MAAM,MACjD,OAAO,WAAW,KAAG,MAAM,EACmC,CAAC;AAElE,kEAAkE;AAClE,eAAO,MAAM,qBAAqB,GAAI,QAAQ,MAAM,CAAC,QAAQ,CAAC,MAC3D,OAAO,WAAW,KAAG,MAAM,EACmC,CAAC"}
|
package/dist/server.es.js
CHANGED
|
@@ -1,26 +1,84 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as o, D as i, o as l } from "./AiGateway-CwdiRjH4.js";
|
|
2
|
+
import { d as _, k as v, A as I, b as O, e as R, f as T, m as g, B as w, i as K, E as k, j as f, G as L, h as P, I as D, O as N, g as b, l as x, P as M, R as j, S as F, T as B, W as H, c as U, a as V } from "./AiGateway-CwdiRjH4.js";
|
|
3
|
+
import { streamText as A, generateObject as y } from "ai";
|
|
4
|
+
import { createGoogleGenerativeAI as c } from "@ai-sdk/google";
|
|
5
|
+
function n(e) {
|
|
6
|
+
const s = typeof process < "u" ? process.env.GOOGLE_GENERATIVE_AI_API_KEY : void 0, t = e || s;
|
|
7
|
+
if (!t)
|
|
8
|
+
throw new Error(
|
|
9
|
+
`[NeuralGateway] No API key found.
|
|
10
|
+
— Server: Set GOOGLE_GENERATIVE_AI_API_KEY in .env.local
|
|
11
|
+
— Client: Pass apiKey via request body`
|
|
12
|
+
);
|
|
13
|
+
return t;
|
|
14
|
+
}
|
|
15
|
+
const E = {
|
|
16
|
+
/**
|
|
17
|
+
* Generate a validated, typed object using the Vercel AI SDK.
|
|
18
|
+
*
|
|
19
|
+
* Primary use: /api/adapt (One-Shot Genesis endpoint)
|
|
20
|
+
*
|
|
21
|
+
* @param opts.schema - Zod schema that constrains the output
|
|
22
|
+
* @param opts.prompt - User prompt (single-turn)
|
|
23
|
+
* @param opts.system - System instruction for the model
|
|
24
|
+
* @param opts.role - Optional AI_ROSTER key (sets model + temperature)
|
|
25
|
+
* @param opts.apiKey - Optional client-provided key
|
|
26
|
+
*/
|
|
27
|
+
async generateSchema(e) {
|
|
28
|
+
const s = n(e.apiKey), t = c({ apiKey: s }), a = e.role ? o[e.role] : null, r = e.model ?? (a == null ? void 0 : a.model) ?? l, m = e.temperature ?? (a == null ? void 0 : a.temperature) ?? 0.3;
|
|
29
|
+
return (await y({
|
|
30
|
+
model: t(r),
|
|
31
|
+
schema: e.schema,
|
|
32
|
+
prompt: e.prompt,
|
|
33
|
+
...e.system ? { system: e.system } : {},
|
|
34
|
+
temperature: m
|
|
35
|
+
})).object;
|
|
36
|
+
},
|
|
37
|
+
/**
|
|
38
|
+
* Stream a chat response and return a ready-to-return Next.js Response.
|
|
39
|
+
*
|
|
40
|
+
* Primary use: /api/ai/chat (agent chat), /api/ai/diagnostic (hardware scan)
|
|
41
|
+
*
|
|
42
|
+
* @param opts.messages - Full conversation history
|
|
43
|
+
* @param opts.system - System instruction (agent persona)
|
|
44
|
+
* @param opts.role - Optional AI_ROSTER key
|
|
45
|
+
* @param opts.apiKey - Optional client-provided key
|
|
46
|
+
*
|
|
47
|
+
* @returns A Response object — directly return this from your route handler.
|
|
48
|
+
*/
|
|
49
|
+
streamChatResponse(e) {
|
|
50
|
+
const s = n(e.apiKey), t = c({ apiKey: s }), a = e.role ? o[e.role] : null, r = e.model ?? (a == null ? void 0 : a.model) ?? i;
|
|
51
|
+
return e.temperature ?? (a == null || a.temperature), A({
|
|
52
|
+
model: t(r),
|
|
53
|
+
messages: e.messages,
|
|
54
|
+
system: e.system
|
|
55
|
+
}).toTextStreamResponse();
|
|
56
|
+
}
|
|
57
|
+
};
|
|
2
58
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
59
|
+
_ as AGENT_ROSTER,
|
|
60
|
+
v as ActionSchema,
|
|
61
|
+
I as AiConfigResolver,
|
|
62
|
+
O as AiGateway,
|
|
63
|
+
R as AiGatewayService,
|
|
64
|
+
T as AnthropicAdapter,
|
|
65
|
+
g as AppSpecificationSchema,
|
|
66
|
+
w as BlockSchema,
|
|
67
|
+
K as DeepSeekAdapter,
|
|
68
|
+
k as EntitySchema,
|
|
69
|
+
f as FieldSchema,
|
|
70
|
+
L as GeminiAdapter,
|
|
71
|
+
P as GrokAdapter,
|
|
72
|
+
D as InMemoryRateLimiter,
|
|
73
|
+
E as NeuralGateway,
|
|
74
|
+
N as OllamaAdapter,
|
|
75
|
+
b as OpenAIAdapter,
|
|
76
|
+
x as PageSchema,
|
|
77
|
+
M as PageSectionSchema,
|
|
78
|
+
j as ResourceSchema,
|
|
79
|
+
F as SignalSchema,
|
|
80
|
+
B as TriggerSchema,
|
|
81
|
+
H as WorkflowSchema,
|
|
82
|
+
U as aiGateway,
|
|
83
|
+
V as aiGatewayService
|
|
26
84
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ramme-io/kernel",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.es.js",
|
|
@@ -26,22 +26,29 @@
|
|
|
26
26
|
"react": ">=18.2.0",
|
|
27
27
|
"react-dom": ">=18.2.0",
|
|
28
28
|
"react-router-dom": ">=6.0.0",
|
|
29
|
-
"zod": ">=3.0.0"
|
|
29
|
+
"zod": ">=3.0.0",
|
|
30
|
+
"ai": ">=4.0.0",
|
|
31
|
+
"@ai-sdk/google": ">=0.0.1",
|
|
32
|
+
"@ramme-io/ui": ">=2.1.0"
|
|
30
33
|
},
|
|
31
34
|
"devDependencies": {
|
|
35
|
+
"@ai-sdk/google": "^3.0.1",
|
|
36
|
+
"ai": "^6.0.3",
|
|
32
37
|
"react": "^18.2.0",
|
|
33
38
|
"react-dom": "^18.2.0",
|
|
34
|
-
"react-router-dom": "^6.
|
|
39
|
+
"react-router-dom": "^6.28.0",
|
|
35
40
|
"vite": "^5.3.1",
|
|
36
41
|
"vite-plugin-dts": "^3.9.1",
|
|
37
|
-
"zod": "^3.23.8"
|
|
42
|
+
"zod": "^3.23.8",
|
|
43
|
+
"@ramme-io/ui": "2.1.0"
|
|
38
44
|
},
|
|
39
45
|
"dependencies": {
|
|
40
46
|
"@types/react-syntax-highlighter": "^15.5.13",
|
|
47
|
+
"mqtt": "^5.14.1",
|
|
41
48
|
"react-markdown": "^10.1.0",
|
|
42
49
|
"react-syntax-highlighter": "^16.1.1",
|
|
43
50
|
"remark-gfm": "^4.0.1",
|
|
44
|
-
"@ramme-io/shared": "2.0.
|
|
51
|
+
"@ramme-io/shared": "2.0.2"
|
|
45
52
|
},
|
|
46
53
|
"scripts": {
|
|
47
54
|
"build": "vite build"
|