@ramme-io/kernel 7.3.1 → 8.1.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-Bdcl3v8h.js → AiGateway-CjamGYdA.js} +409 -358
- package/dist/{bodewellAdapter-BzbeTSIP.js → bodewellAdapter-PfSOdsEI.js} +1 -1
- package/dist/deviceReadings-cxZE1T-0.js +1627 -0
- package/dist/index.es.js +4341 -4610
- package/dist/kernel/src/agents/roster.d.ts +11 -3
- package/dist/kernel/src/agents/roster.d.ts.map +1 -1
- package/dist/kernel/src/agents/scope.d.ts +21 -0
- package/dist/kernel/src/agents/scope.d.ts.map +1 -0
- package/dist/kernel/src/agents/scope.test.d.ts +2 -0
- package/dist/kernel/src/agents/scope.test.d.ts.map +1 -0
- package/dist/kernel/src/components/AIChatPanel.d.ts +12 -0
- package/dist/kernel/src/components/AIChatPanel.d.ts.map +1 -1
- package/dist/kernel/src/engine/runtime/data-seeder.d.ts +2 -0
- package/dist/kernel/src/engine/runtime/data-seeder.d.ts.map +1 -1
- package/dist/kernel/src/engine/runtime/useSignal.d.ts +15 -0
- package/dist/kernel/src/engine/runtime/useSignal.d.ts.map +1 -1
- package/dist/kernel/src/engine/runtime/useSignal.test.d.ts +2 -0
- package/dist/kernel/src/engine/runtime/useSignal.test.d.ts.map +1 -0
- package/dist/kernel/src/index.d.ts +2 -4
- package/dist/kernel/src/index.d.ts.map +1 -1
- package/dist/kernel/src/renderers/AppDocumentRenderer.d.ts +57 -5
- package/dist/kernel/src/renderers/AppDocumentRenderer.d.ts.map +1 -1
- package/dist/kernel/src/renderers/AppOrientation.test.d.ts +2 -0
- package/dist/kernel/src/renderers/AppOrientation.test.d.ts.map +1 -0
- package/dist/kernel/src/server.d.ts +3 -0
- package/dist/kernel/src/server.d.ts.map +1 -1
- package/dist/kernel/src/services/ai/AiGatewayService.d.ts.map +1 -1
- package/dist/kernel/src/services/ai/providers/GeminiAdapter.d.ts.map +1 -1
- package/dist/kernel/src/services/ai/providers/OllamaAdapter.d.ts +1 -0
- package/dist/kernel/src/services/ai/providers/OllamaAdapter.d.ts.map +1 -1
- package/dist/kernel/src/services/ai/toolPromptGenerator.d.ts +0 -1
- package/dist/kernel/src/services/ai/toolPromptGenerator.d.ts.map +1 -1
- package/dist/kernel/src/signals/deviceReadings.d.ts +9 -0
- package/dist/kernel/src/signals/deviceReadings.d.ts.map +1 -0
- package/dist/kernel/src/signals/deviceReadings.test.d.ts +2 -0
- package/dist/kernel/src/signals/deviceReadings.test.d.ts.map +1 -0
- package/dist/kernel/src/signals/index.d.ts +1 -0
- package/dist/kernel/src/signals/index.d.ts.map +1 -1
- package/dist/server.es.js +43 -41
- package/dist/signals.es.js +12 -10
- package/package.json +4 -4
- package/dist/index-kBkq1FSR.js +0 -1236
- package/dist/kernel/src/events/mockEventSource.d.ts +0 -28
- package/dist/kernel/src/events/mockEventSource.d.ts.map +0 -1
- package/dist/kernel/src/services/MarketDataService.d.ts +0 -29
- package/dist/kernel/src/services/MarketDataService.d.ts.map +0 -1
- package/dist/kernel/src/services/marketSession.d.ts +0 -33
- package/dist/kernel/src/services/marketSession.d.ts.map +0 -1
- package/dist/kernel/src/services/marketSession.test.d.ts +0 -14
- package/dist/kernel/src/services/marketSession.test.d.ts.map +0 -1
- package/dist/kernel/src/stores/useMarketDataStore.d.ts +0 -50
- package/dist/kernel/src/stores/useMarketDataStore.d.ts.map +0 -1
|
@@ -11,10 +11,18 @@
|
|
|
11
11
|
* SCOPE ENFORCEMENT (IRON LAW):
|
|
12
12
|
* An agent MUST NOT write to manifest keys outside its declared `scope[]`.
|
|
13
13
|
* The Strategist cannot modify `pages`. The Architect cannot modify `theme`.
|
|
14
|
-
*
|
|
14
|
+
*
|
|
15
|
+
* ENFORCEMENT POINT: `scopePatch(role, patch)` in ./scope.ts. It strips every
|
|
16
|
+
* key outside the role's scope and reports what it dropped. In the builder,
|
|
17
|
+
* `applyAIBlueprint(blueprint, source)` (products/builder/src/lib/wizard/wizard-store.ts)
|
|
18
|
+
* requires the producing role and calls `scopePatch` before merging; one-shot
|
|
19
|
+
* Genesis generation is the only unscoped writer and must say so by passing
|
|
20
|
+
* the explicit `'genesis'` source. A new consumer that applies agent output to
|
|
21
|
+
* a manifest without `scopePatch` breaks this law.
|
|
15
22
|
*
|
|
16
23
|
* LOCATION (canonical): framework/kernel/src/agents/roster.ts
|
|
17
24
|
* EXPORT (public): @ramme-io/kernel → AGENT_ROSTER, AgentRole, AgentDefinition
|
|
25
|
+
* (scopePatch is exported beside it from ./scope)
|
|
18
26
|
*/
|
|
19
27
|
/**
|
|
20
28
|
* Valid keys that map to agent definitions in AGENT_ROSTER.
|
|
@@ -24,7 +32,7 @@ export type AgentRole = 'strategist' | 'architect' | 'designer' | 'product_owner
|
|
|
24
32
|
* A single agent definition. Consumed by:
|
|
25
33
|
* - /api/ai/chat/route.ts (systemPrompt injection)
|
|
26
34
|
* - UI components (name, color, avatar rendering)
|
|
27
|
-
* -
|
|
35
|
+
* - scopePatch() in ./scope.ts (scope enforcement)
|
|
28
36
|
*/
|
|
29
37
|
export interface AgentDefinition {
|
|
30
38
|
/** Unique identifier for the agent. Used in API requests as `agentRole`. */
|
|
@@ -37,7 +45,7 @@ export interface AgentDefinition {
|
|
|
37
45
|
color: string;
|
|
38
46
|
/**
|
|
39
47
|
* The AppSpecification keys this agent is authorized to modify.
|
|
40
|
-
* Enforced by
|
|
48
|
+
* Enforced by `scopePatch()` (./scope.ts).
|
|
41
49
|
*/
|
|
42
50
|
scope: Array<'meta' | 'config' | 'resources' | 'domain' | 'pages' | 'theme' | 'modules'>;
|
|
43
51
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roster.d.ts","sourceRoot":"","sources":["../../../../src/agents/roster.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"roster.d.ts","sourceRoot":"","sources":["../../../../src/agents/roster.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAMH;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,YAAY,GAAG,WAAW,GAAG,UAAU,GAAG,eAAe,CAAC;AAElF;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,4EAA4E;IAC5E,EAAE,EAAE,SAAS,CAAC;IACd,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,IAAI,EAAE,MAAM,CAAC;IACb,kEAAkE;IAClE,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,KAAK,EAAE,KAAK,CAAC,MAAM,GAAG,QAAQ,GAAG,WAAW,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,CAAC,CAAC;IACzF;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAC;CACtB;AAMD;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,SAAS,EAAE,eAAe,CAsH3D,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { AgentDefinition, AgentRole } from './roster';
|
|
2
|
+
|
|
3
|
+
/** A top-level AppSpecification key an agent may be granted. */
|
|
4
|
+
export type ManifestScopeKey = AgentDefinition['scope'][number];
|
|
5
|
+
export interface ScopedPatch<T extends object> {
|
|
6
|
+
/** The patch with every out-of-scope key removed. */
|
|
7
|
+
patch: Partial<T>;
|
|
8
|
+
/** The keys that were present in the input and removed, in input order. */
|
|
9
|
+
dropped: string[];
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Returns only the keys of `patch` that `AGENT_ROSTER[role].scope` permits,
|
|
13
|
+
* and reports the ones it removed. Keys outside the seven manifest keys are
|
|
14
|
+
* dropped too — an agent cannot be in scope for a key the manifest lacks.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* const { patch, dropped } = scopePatch('strategist', { meta, pages });
|
|
18
|
+
* // patch → { meta }, dropped → ['pages']
|
|
19
|
+
*/
|
|
20
|
+
export declare function scopePatch<T extends object>(role: AgentRole, patch: T): ScopedPatch<T>;
|
|
21
|
+
//# sourceMappingURL=scope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scope.d.ts","sourceRoot":"","sources":["../../../../src/agents/scope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAgB,KAAK,eAAe,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAE9E,gEAAgE;AAChE,MAAM,MAAM,gBAAgB,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhE,MAAM,WAAW,WAAW,CAAC,CAAC,SAAS,MAAM;IAC3C,qDAAqD;IACrD,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IAClB,2EAA2E;IAC3E,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CActF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scope.test.d.ts","sourceRoot":"","sources":["../../../../src/agents/scope.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
import { AIChatToolCall } from '../../../ui/src/index.ts';
|
|
3
|
+
import { ToolDefinition } from '../../../shared/index.ts';
|
|
2
4
|
|
|
3
5
|
/** One message as the frame shows it. */
|
|
4
6
|
export interface PanelMessage {
|
|
5
7
|
role: 'user' | 'assistant' | 'system';
|
|
6
8
|
content: string;
|
|
9
|
+
toolCall?: AIChatToolCall;
|
|
7
10
|
}
|
|
8
11
|
export interface AIChatPanelFrameProps {
|
|
9
12
|
messages: PanelMessage[];
|
|
@@ -19,6 +22,8 @@ export interface AIChatPanelFrameProps {
|
|
|
19
22
|
footer?: React.ReactNode;
|
|
20
23
|
/** A link in an answer was clicked. Return true when it was handled. */
|
|
21
24
|
onLinkClick?: (href: string) => boolean;
|
|
25
|
+
/** Renders a tool call as a card. See AIChatThread. */
|
|
26
|
+
renderToolCall?: (toolCall: AIChatToolCall) => React.ReactNode | undefined;
|
|
22
27
|
}
|
|
23
28
|
/**
|
|
24
29
|
* The panel itself — position, open and close, window controls, the thread —
|
|
@@ -47,6 +52,13 @@ export interface AIChatPanelProps {
|
|
|
47
52
|
transport?: 'local' | 'proxy' | 'auto';
|
|
48
53
|
/** Override the proxy URL. Defaults to '/api/ai/generate'. */
|
|
49
54
|
proxyUrl?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Tools the model may call. Without any it can only answer in text. Pass a
|
|
57
|
+
* product's own definitions here, with `renderToolCall` below to draw them.
|
|
58
|
+
*/
|
|
59
|
+
tools?: ToolDefinition[];
|
|
60
|
+
/** Renders a tool call as a card. See AIChatThread. */
|
|
61
|
+
renderToolCall?: (toolCall: AIChatToolCall) => React.ReactNode | undefined;
|
|
50
62
|
}
|
|
51
63
|
/** The frame, driven by useRammeAI — the kernel's own chat, unchanged. */
|
|
52
64
|
export declare const AIChatPanel: React.FC<AIChatPanelProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AIChatPanel.d.ts","sourceRoot":"","sources":["../../../../src/components/AIChatPanel.tsx"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAsB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"AIChatPanel.d.ts","sourceRoot":"","sources":["../../../../src/components/AIChatPanel.tsx"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAsB,MAAM,OAAO,CAAC;AAM3C,OAAO,EAAgB,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,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AC;IACzB,uDAAuD;IACvD,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;CAC5E;AAeD,0EAA0E;AAC1E,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA+BlD,CAAC"}
|
|
@@ -6,5 +6,7 @@
|
|
|
6
6
|
* On app launch, it checks if data exists. If not, it writes the seed data
|
|
7
7
|
* provided by the Kernel/Manifest into the browser's storage.
|
|
8
8
|
*/
|
|
9
|
+
/** Every Data Lake collection lives in localStorage under this prefix plus its name. */
|
|
10
|
+
export declare const DATA_LAKE_PREFIX = "ramme_db_";
|
|
9
11
|
export declare const initializeDataLake: (registry: Record<string, any[]>) => void;
|
|
10
12
|
//# sourceMappingURL=data-seeder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-seeder.d.ts","sourceRoot":"","sources":["../../../../../src/engine/runtime/data-seeder.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"data-seeder.d.ts","sourceRoot":"","sources":["../../../../../src/engine/runtime/data-seeder.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,wFAAwF;AACxF,eAAO,MAAM,gBAAgB,cAAc,CAAC;AAG5C,eAAO,MAAM,kBAAkB,GAAI,UAAU,MAAM,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,SAyBjE,CAAC"}
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WHICH STORE, AND WHY IT MATTERS
|
|
3
|
+
*
|
|
4
|
+
* This hook reads the Signal Hub in `stores/useSignalStore.ts` — the store every
|
|
5
|
+
* adapter writes to (`BaseSignalAdapter.emit()` → `setSignal()`, MQTT →
|
|
6
|
+
* `bufferSignal()`), and the one `@ramme-io/kernel` exports as `useSignalStore`.
|
|
7
|
+
*
|
|
8
|
+
* It used to read the older store in `./useSignalStore.ts`, which no adapter
|
|
9
|
+
* writes to. A component built on `useSignal` therefore never saw live data: it
|
|
10
|
+
* showed the manifest default and reported `stale` forever, however many Signals
|
|
11
|
+
* arrived. That older store is still read by `DynamicBlock` through
|
|
12
|
+
* `useGeneratedSignals`, so it stays for now; it is simply not where Signals go.
|
|
13
|
+
* `useSignal.test.tsx` holds the line: a Signal emitted by an adapter must be
|
|
14
|
+
* what this hook returns.
|
|
15
|
+
*/
|
|
1
16
|
export interface SignalState {
|
|
2
17
|
id: string;
|
|
3
18
|
value: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSignal.d.ts","sourceRoot":"","sources":["../../../../../src/engine/runtime/useSignal.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useSignal.d.ts","sourceRoot":"","sources":["../../../../../src/engine/runtime/useSignal.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,GAAG,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC;CAC3B;AAKD,eAAO,MAAM,SAAS,GAAI,UAAU,MAAM,KAAG,WAoB5C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSignal.test.d.ts","sourceRoot":"","sources":["../../../../../src/engine/runtime/useSignal.test.tsx"],"names":[],"mappings":""}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from './agents/roster';
|
|
2
|
+
export * from './agents/scope';
|
|
2
3
|
export * from './services/GhostBridge';
|
|
3
4
|
export * from './engine/runtime/ManifestContext';
|
|
4
5
|
export * from './engine/runtime/MqttContext';
|
|
@@ -18,10 +19,10 @@ export * from './renderers/AppDocumentRenderer';
|
|
|
18
19
|
export * from './apps/spriteGrid';
|
|
19
20
|
export * from './apps/quantize';
|
|
20
21
|
export * from './apps/spr';
|
|
22
|
+
export { deviceReadingsToSignals } from './signals/deviceReadings';
|
|
21
23
|
export * from './stores/useAppStore';
|
|
22
24
|
export * from './stores/useSettingsStore';
|
|
23
25
|
export * from './stores/spatialStore';
|
|
24
|
-
export * from './stores/useMarketDataStore';
|
|
25
26
|
export { useSignalStore, selectSignalById, selectSignalsByDomain, selectSignalsBySource, } from './stores/useSignalStore';
|
|
26
27
|
export { BaseSignalAdapter } from './signals/BaseSignalAdapter';
|
|
27
28
|
export * from './signals/bodewellAdapter';
|
|
@@ -36,8 +37,6 @@ export * from './services/ai/models';
|
|
|
36
37
|
export { generateToolSystemPrompt } from './services/ai/toolPromptGenerator';
|
|
37
38
|
export { AiGateway, aiGateway } from './services/AiGateway';
|
|
38
39
|
export * from './services/ai';
|
|
39
|
-
export * from './services/MarketDataService';
|
|
40
|
-
export * from './services/marketSession';
|
|
41
40
|
export type { AITransport, ChatMessage, TransportMode, ToolCall, ToolDefinitionWire, StreamEvent } from './services/ai/transport';
|
|
42
41
|
export { LocalTransportAdapter } from './services/ai/adapters/LocalTransportAdapter';
|
|
43
42
|
export { ProxyTransportAdapter } from './services/ai/adapters/ProxyTransportAdapter';
|
|
@@ -57,5 +56,4 @@ export * from './engine/renderers/route-generator';
|
|
|
57
56
|
export * from './components/SmartTable';
|
|
58
57
|
export * from './components/AutoForm';
|
|
59
58
|
export * from './components/settings/SettingsModal';
|
|
60
|
-
export * from './events/mockEventSource';
|
|
61
59
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAOA,cAAc,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings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E,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAG5D,cAAc,eAAe,CAAC;AAG9B,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,aAAa,EAAE,QAAQ,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAClI,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;AAC7C,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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { AppDocument, AppColor } from '../../../shared/index.ts';
|
|
2
|
+
import { AppDocument, AppColor, PanelOrientation, DEVICE_PALETTE } from '../../../shared/index.ts';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* A colour as three channels, whichever form the document wrote it in.
|
|
@@ -13,8 +13,10 @@ import { AppDocument, AppColor } from '../../../shared/index.ts';
|
|
|
13
13
|
* to predict the panel exactly. Tokens and explicit "R G B" triplets both went
|
|
14
14
|
* the same way, so nothing about the document could avoid it.
|
|
15
15
|
*/
|
|
16
|
-
export declare const appColorRgb: (color: AppColor | undefined, fallback?: string) => [number, number, number];
|
|
17
|
-
export declare const resolveAppColor: (color: AppColor | undefined, fallback?: string) => string;
|
|
16
|
+
export declare const appColorRgb: (color: AppColor | undefined, fallback?: string, palette?: DevicePalette) => [number, number, number];
|
|
17
|
+
export declare const resolveAppColor: (color: AppColor | undefined, fallback?: string, palette?: DevicePalette) => string;
|
|
18
|
+
/** The seven tokens a board draws with. */
|
|
19
|
+
export type DevicePalette = typeof DEVICE_PALETTE;
|
|
18
20
|
/**
|
|
19
21
|
* Text as the panel will actually draw it.
|
|
20
22
|
*
|
|
@@ -35,18 +37,68 @@ export type AppData = Record<string, Record<string, unknown>>;
|
|
|
35
37
|
* from the asset route. Without one, an image draws as an empty outline.
|
|
36
38
|
*/
|
|
37
39
|
export type AssetLoader = (hash: string) => Promise<Uint8Array | null>;
|
|
40
|
+
/**
|
|
41
|
+
* An image's drawn size in a column `room` wide, by the board's own rule
|
|
42
|
+
* (imageSize() in AppDocument.h). Photos are made 304 wide; on an upright
|
|
43
|
+
* panel a retro one shrinks by whole steps, so its pixels stay square, and a
|
|
44
|
+
* full-colour one smoothly. Without it the board skipped every photo upright
|
|
45
|
+
* (H4GFW110, 2026-10-28), and this preview has to show what the board shows.
|
|
46
|
+
*/
|
|
47
|
+
export declare const imageDrawnSize: (node: {
|
|
48
|
+
width: number;
|
|
49
|
+
height: number;
|
|
50
|
+
scale: number;
|
|
51
|
+
format?: "spr" | "jpeg";
|
|
52
|
+
}, room: number) => {
|
|
53
|
+
width: number;
|
|
54
|
+
height: number;
|
|
55
|
+
scale: number;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* The document's lettering — see `font` on AppDocumentSchema. Inter and TAY are
|
|
59
|
+
* the board's smooth faces; pixel is its built-in 5x7, scaled.
|
|
60
|
+
*/
|
|
61
|
+
type Face = 'inter' | 'pixel' | 'tay';
|
|
62
|
+
/**
|
|
63
|
+
* The face a line is actually drawn in at `px`: a display face (TAY) only
|
|
64
|
+
* from DISPLAY_FACE_MIN_PX up, the body face (Inter) below it. Pixel at every
|
|
65
|
+
* size. faceAtPx() in AppDocument.h is the board's copy of this rule.
|
|
66
|
+
*/
|
|
67
|
+
export declare const faceAtPx: (face: Face, px: number) => Face;
|
|
38
68
|
export interface AppDocumentRendererProps {
|
|
39
69
|
document: AppDocument;
|
|
40
70
|
/** Values the bindings read. Missing fields draw as the placeholder. */
|
|
41
71
|
data?: AppData;
|
|
42
72
|
/**
|
|
43
|
-
* Display scale. 1 renders at true device size — 320x240 CSS pixels
|
|
44
|
-
* is small on a desktop and exactly right for
|
|
73
|
+
* Display scale. 1 renders at true device size — 320x240 CSS pixels, or
|
|
74
|
+
* 240x320 upright — which is small on a desktop and exactly right for
|
|
75
|
+
* judging whether text fits.
|
|
45
76
|
*/
|
|
46
77
|
scale?: number;
|
|
78
|
+
/**
|
|
79
|
+
* Which way the board stands: `landscape` (the default, and every board
|
|
80
|
+
* before Settings → Turn) or `portrait`. The document is the same; the
|
|
81
|
+
* panel it reflows into is not.
|
|
82
|
+
*/
|
|
83
|
+
orientation?: PanelOrientation;
|
|
47
84
|
/** Where image blocks get their bytes. Without it they draw as outlines. */
|
|
48
85
|
loadAsset?: AssetLoader;
|
|
86
|
+
/**
|
|
87
|
+
* The colours tokens resolve to. Omit for the board's built-in palette;
|
|
88
|
+
* pass an account theme's dark half to preview a board that has taken it.
|
|
89
|
+
*/
|
|
90
|
+
palette?: DevicePalette;
|
|
49
91
|
className?: string;
|
|
50
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* Panel geometry, as the board draws a document: 320 wide and 240 high
|
|
95
|
+
* sideways, 240 by 320 upright (PANEL_SIZE in @ramme-io/shared). The part is a
|
|
96
|
+
* 240x320 panel the firmware turns. This said 240 by 320, unconditionally,
|
|
97
|
+
* until 2026-09-26, so the preview showed a tall screen while every board drew
|
|
98
|
+
* the same document wide and cut off anything below 240 — see
|
|
99
|
+
* AppScreenSizeSchema. Now the board says which way it stands, and the
|
|
100
|
+
* preview follows it.
|
|
101
|
+
*/
|
|
51
102
|
export declare const AppDocumentRenderer: React.FC<AppDocumentRendererProps>;
|
|
103
|
+
export {};
|
|
52
104
|
//# sourceMappingURL=AppDocumentRenderer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppDocumentRenderer.d.ts","sourceRoot":"","sources":["../../../../src/renderers/AppDocumentRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EACV,WAAW,EAGX,QAAQ,
|
|
1
|
+
{"version":3,"file":"AppDocumentRenderer.d.ts","sourceRoot":"","sources":["../../../../src/renderers/AppDocumentRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EACV,WAAW,EAGX,QAAQ,EAMR,gBAAgB,EACjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAEL,cAAc,EAWf,MAAM,kBAAkB,CAAC;AAwE1B;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,WAAW,GACtB,OAAO,QAAQ,GAAG,SAAS,EAC3B,WAAU,MAAqB,EAC/B,UAAS,aAA8B,KACtC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CASzB,CAAC;AAEF,eAAO,MAAM,eAAe,GAC1B,OAAO,QAAQ,GAAG,SAAS,EAC3B,iBAAuB,EACvB,UAAS,aAA8B,KACtC,MAGF,CAAC;AAEF,2CAA2C;AAC3C,MAAM,MAAM,aAAa,GAAG,OAAO,cAAc,CAAC;AAUlD;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,GAAI,OAAO,MAAM,KAAG,MAO9B,CAAC;AAEd,gFAAgF;AAChF,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAiJ9D;;;;;;;GAOG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;AAkDvE;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,GACzB,MAAM;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,CAAA;CAAE,EAC/E,MAAM,MAAM,KACX;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAShD,CAAC;AAsFF;;;GAGG;AACH,KAAK,IAAI,GAAG,OAAO,GAAG,OAAO,GAAG,KAAK,CAAC;AAGtC;;;;GAIG;AACH,eAAO,MAAM,QAAQ,GAAI,MAAM,IAAI,EAAE,IAAI,MAAM,KAAG,IACW,CAAC;AA2T9D,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,WAAW,CAAC;IACtB,wEAAwE;IACxE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B,4EAA4E;IAC5E,SAAS,CAAC,EAAE,WAAW,CAAC;IACxB;;;OAGG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAiFlE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppOrientation.test.d.ts","sourceRoot":"","sources":["../../../../src/renderers/AppOrientation.test.tsx"],"names":[],"mappings":""}
|
|
@@ -23,6 +23,8 @@
|
|
|
23
23
|
*/
|
|
24
24
|
export { AGENT_ROSTER } from './agents/roster';
|
|
25
25
|
export type { AgentRole } from './agents/roster';
|
|
26
|
+
export { scopePatch } from './agents/scope';
|
|
27
|
+
export type { ScopedPatch, ManifestScopeKey } from './agents/scope';
|
|
26
28
|
export { NeuralGateway } from './services/NeuralGateway';
|
|
27
29
|
export { AiGatewayService, aiGatewayService } from './services/ai/AiGatewayService';
|
|
28
30
|
export { generateAppDocument, AppDocumentGenerationError, } from './services/ai/generateAppDocument';
|
|
@@ -43,5 +45,6 @@ export type { ChatMessage, StreamEvent, ToolCall, ToolDefinitionWire, } from './
|
|
|
43
45
|
export type { AiProvider, AiModelConfig, AiProviderAdapter, AiResponse, AiConfigSource } from './services/ai/types';
|
|
44
46
|
export type { RateLimitConfig } from './services/ai/RateLimiter';
|
|
45
47
|
export { decodeSpr, encodeSpr, sprByteLength } from './apps/spr';
|
|
48
|
+
export { deviceReadingsToSignals } from './signals/deviceReadings';
|
|
46
49
|
export type { SprImage, SprDecodeResult, Rgb } from './apps/spr';
|
|
47
50
|
//# sourceMappingURL=server.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAOpE,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAGzD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAIpF,OAAO,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names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,aAAa,EAAqB,MAAM,SAAS,CAAC;AACvE,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAShF,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAmB;IAC1C,OAAO,CAAC,WAAW,CAAsB;IACzC,OAAO,CAAC,QAAQ,CAAqC;IAErD,OAAO;
|
|
1
|
+
{"version":3,"file":"AiGatewayService.d.ts","sourceRoot":"","sources":["../../../../../src/services/ai/AiGatewayService.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,aAAa,EAAqB,MAAM,SAAS,CAAC;AACvE,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAShF,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAmB;IAC1C,OAAO,CAAC,WAAW,CAAsB;IACzC,OAAO,CAAC,QAAQ,CAAqC;IAErD,OAAO;IAsBP,MAAM,CAAC,WAAW,IAAI,gBAAgB;IAOtC;;OAEG;IACG,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC;IAuB1E;;OAEG;IACI,UAAU,CACf,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,aAAa,GACpB,aAAa,CAAC,MAAM,CAAC;IAexB;;;OAGG;IACI,UAAU,CACf,QAAQ,EAAE,WAAW,EAAE,EACvB,MAAM,EAAE,aAAa,EACrB,KAAK,CAAC,EAAE,kBAAkB,EAAE,GAC3B,aAAa,CAAC,WAAW,CAAC;IAkB7B;;OAEG;IACG,cAAc,CAAC,CAAC,EACpB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,CAAC,CAAC;IAeb;;OAEG;IACH,oBAAoB,IAAI,MAAM;IAI9B;;OAEG;IACG,UAAU,CAAC,QAAQ,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;CAQ7F;AAGD,eAAO,MAAM,gBAAgB,kBAAiC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeminiAdapter.d.ts","sourceRoot":"","sources":["../../../../../../src/services/ai/providers/GeminiAdapter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"GeminiAdapter.d.ts","sourceRoot":"","sources":["../../../../../../src/services/ai/providers/GeminiAdapter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAgBjF,qBAAa,aAAc,YAAW,iBAAiB;IAC9C,UAAU,CACf,QAAQ,EAAE,WAAW,EAAE,EACvB,MAAM,EAAE,aAAa,EACrB,KAAK,CAAC,EAAE,kBAAkB,EAAE,GAC3B,aAAa,CAAC,WAAW,CAAC;IA6EvB,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;IAmBpD,OAAO,CAAC,cAAc;CA6BvB"}
|
|
@@ -14,5 +14,6 @@ export declare class OllamaAdapter implements AiProviderAdapter {
|
|
|
14
14
|
streamText(prompt: string, config: AiModelConfig): AsyncIterable<string>;
|
|
15
15
|
generateObject<T>(prompt: string, schema: unknown, config: AiModelConfig): Promise<T>;
|
|
16
16
|
listModels(_apiKey?: string, baseUrl?: string): Promise<string[]>;
|
|
17
|
+
private normalizeError;
|
|
17
18
|
}
|
|
18
19
|
//# sourceMappingURL=OllamaAdapter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OllamaAdapter.d.ts","sourceRoot":"","sources":["../../../../../../src/services/ai/providers/OllamaAdapter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"OllamaAdapter.d.ts","sourceRoot":"","sources":["../../../../../../src/services/ai/providers/OllamaAdapter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAgBjF,qBAAa,aAAc,YAAW,iBAAiB;IACrD;;;;;;OAMG;IACI,UAAU,CACf,QAAQ,EAAE,WAAW,EAAE,EACvB,MAAM,EAAE,aAAa,EACrB,KAAK,CAAC,EAAE,kBAAkB,EAAE,GAC3B,aAAa,CAAC,WAAW,CAAC;IA8DvB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC;IAsBnE,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,GAAG,aAAa,CAAC,MAAM,CAAC;IAkDzE,cAAc,CAAC,CAAC,EACpB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,CAAC,CAAC;IAWP,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,GAAE,MAAiC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAajG,OAAO,CAAC,cAAc;CA6BvB"}
|
|
@@ -16,7 +16,6 @@ import { ToolDefinition } from '../../../../shared/index.ts';
|
|
|
16
16
|
*
|
|
17
17
|
* const systemPrompt = basePrompt + '\n\n' + generateToolSystemPrompt([
|
|
18
18
|
* AI_TOOLS.get_telemetry_graph,
|
|
19
|
-
* AI_TOOLS.get_stock_chart,
|
|
20
19
|
* ]);
|
|
21
20
|
*/
|
|
22
21
|
export declare function generateToolSystemPrompt(tools: ToolDefinition[]): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolPromptGenerator.d.ts","sourceRoot":"","sources":["../../../../../src/services/ai/toolPromptGenerator.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"toolPromptGenerator.d.ts","sourceRoot":"","sources":["../../../../../src/services/ai/toolPromptGenerator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,MAAM,CAoDxE"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DeviceReading, Signal } from '../../../shared/index.ts';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Readings → Signals: id `<deviceId>:<key>`, source `http`, the environment
|
|
5
|
+
* domain. A reading's own time when its board had a believable clock, else
|
|
6
|
+
* the time the report arrived.
|
|
7
|
+
*/
|
|
8
|
+
export declare const deviceReadingsToSignals: (deviceId: string, readings: DeviceReading[], receivedAt: number) => Signal[];
|
|
9
|
+
//# sourceMappingURL=deviceReadings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deviceReadings.d.ts","sourceRoot":"","sources":["../../../../src/signals/deviceReadings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAkB,KAAK,aAAa,EAAE,KAAK,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAOnF;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,GAAI,UAAU,MAAM,EAAE,UAAU,aAAa,EAAE,EAAE,YAAY,MAAM,KAAG,MAAM,EAY5G,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deviceReadings.test.d.ts","sourceRoot":"","sources":["../../../../src/signals/deviceReadings.test.ts"],"names":[],"mappings":""}
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
* import { toBodewellSignals } from '@ramme-io/kernel'; // ❌ pulls in React
|
|
17
17
|
*/
|
|
18
18
|
export * from './bodewellAdapter';
|
|
19
|
+
export * from './deviceReadings';
|
|
19
20
|
export { BaseSignalAdapter } from './BaseSignalAdapter';
|
|
20
21
|
export type { AdapterStatus } from './BaseSignalAdapter';
|
|
21
22
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/signals/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/signals/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/server.es.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { n as E } from "./AiGateway-
|
|
2
|
-
import { A as
|
|
3
|
-
import { streamText as O, generateObject as
|
|
1
|
+
import { n as E } from "./AiGateway-CjamGYdA.js";
|
|
2
|
+
import { A as k, c as x, g as J, a as L, d as M, D as F, G as Y, f as U, I as B, O as H, e as q, h as z, b as V, i as W, j as C, s as X, k as Q } from "./AiGateway-CjamGYdA.js";
|
|
3
|
+
import { streamText as O, generateObject as g } from "ai";
|
|
4
4
|
import { createGoogleGenerativeAI as u } from "@ai-sdk/google";
|
|
5
|
-
import { A as S, D as
|
|
6
|
-
import {
|
|
7
|
-
function
|
|
5
|
+
import { A as S, D as G, a as T, b as y, c as _, e as f } from "./deviceReadings-cxZE1T-0.js";
|
|
6
|
+
import { f as ee, h as te, B as ae, E as se, F as re, g as oe, P as ne, R as ce, S as ie, T as me, W as le, d as pe } from "./deviceReadings-cxZE1T-0.js";
|
|
7
|
+
function h(e) {
|
|
8
8
|
const a = typeof process < "u" ? process.env.GOOGLE_GENERATIVE_AI_API_KEY : void 0, s = e || a;
|
|
9
9
|
if (!s)
|
|
10
10
|
throw new Error(
|
|
@@ -14,7 +14,7 @@ function A(e) {
|
|
|
14
14
|
);
|
|
15
15
|
return s;
|
|
16
16
|
}
|
|
17
|
-
const
|
|
17
|
+
const N = {
|
|
18
18
|
/**
|
|
19
19
|
* Generate a validated, typed object using the Vercel AI SDK.
|
|
20
20
|
*
|
|
@@ -27,8 +27,8 @@ const P = {
|
|
|
27
27
|
* @param opts.apiKey - Optional client-provided key
|
|
28
28
|
*/
|
|
29
29
|
async generateSchema(e) {
|
|
30
|
-
const a =
|
|
31
|
-
return (await
|
|
30
|
+
const a = h(e.apiKey), s = u({ apiKey: a }), t = e.role ? S[e.role] : null, r = e.model ?? (t == null ? void 0 : t.model) ?? T, o = e.temperature ?? (t == null ? void 0 : t.temperature) ?? 0.3;
|
|
31
|
+
return (await g({
|
|
32
32
|
model: s(r),
|
|
33
33
|
schema: e.schema,
|
|
34
34
|
prompt: e.prompt,
|
|
@@ -49,7 +49,7 @@ const P = {
|
|
|
49
49
|
* @returns A Response object — directly return this from your route handler.
|
|
50
50
|
*/
|
|
51
51
|
streamChatResponse(e) {
|
|
52
|
-
const a =
|
|
52
|
+
const a = h(e.apiKey), s = u({ apiKey: a }), t = e.role ? S[e.role] : null, r = e.model ?? (t == null ? void 0 : t.model) ?? G, o = e.temperature ?? (t == null ? void 0 : t.temperature) ?? 0.5;
|
|
53
53
|
return O({
|
|
54
54
|
model: s(r),
|
|
55
55
|
messages: e.messages,
|
|
@@ -58,15 +58,15 @@ const P = {
|
|
|
58
58
|
}).toTextStreamResponse();
|
|
59
59
|
}
|
|
60
60
|
};
|
|
61
|
-
class
|
|
61
|
+
class R extends Error {
|
|
62
62
|
constructor(a, s, t) {
|
|
63
63
|
super(a), this.issues = s, this.attempts = t, this.name = "AppDocumentGenerationError";
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
-
const
|
|
66
|
+
const $ = (e) => {
|
|
67
67
|
const a = e.match(/```(?:json)?\s*([\s\S]*?)```/), s = (a ? a[1] : e).trim(), t = s.indexOf("{"), r = s.lastIndexOf("}");
|
|
68
68
|
return t === -1 || r === -1 || r <= t ? s : s.slice(t, r + 1);
|
|
69
|
-
},
|
|
69
|
+
}, v = (e) => e.issues.map((a) => `${a.path.join(".") || "(root)"}: ${a.message}`), b = async ({
|
|
70
70
|
request: e,
|
|
71
71
|
current: a,
|
|
72
72
|
complete: s,
|
|
@@ -76,7 +76,7 @@ const w = (e) => {
|
|
|
76
76
|
|
|
77
77
|
${r}
|
|
78
78
|
|
|
79
|
-
${
|
|
79
|
+
${_}
|
|
80
80
|
${JSON.stringify(a)}
|
|
81
81
|
|
|
82
82
|
Request: ${e}` : `${y}
|
|
@@ -86,67 +86,69 @@ ${r}
|
|
|
86
86
|
Request: ${e}`;
|
|
87
87
|
let n = o, c = [];
|
|
88
88
|
for (let l = 0; l <= t; l += 1) {
|
|
89
|
-
const
|
|
89
|
+
const A = await s(n);
|
|
90
90
|
let p;
|
|
91
91
|
try {
|
|
92
|
-
p = JSON.parse(
|
|
92
|
+
p = JSON.parse($(A));
|
|
93
93
|
} catch {
|
|
94
94
|
c = ["the reply was not JSON"], n = `${o}
|
|
95
95
|
|
|
96
96
|
Your last reply was not valid JSON. Reply with the JSON object only.`;
|
|
97
97
|
continue;
|
|
98
98
|
}
|
|
99
|
-
const d = E(p),
|
|
100
|
-
if (
|
|
101
|
-
return { document:
|
|
99
|
+
const d = E(p), i = f.safeParse(d.value);
|
|
100
|
+
if (i.success && d.issues.length === 0)
|
|
101
|
+
return { document: i.data, repairs: l };
|
|
102
102
|
c = [
|
|
103
|
-
...d.issues.map((
|
|
104
|
-
...
|
|
103
|
+
...d.issues.map((m) => `${m.path.join(".") || "(root)"}: ${m.message}`),
|
|
104
|
+
...i.success ? [] : v(i.error)
|
|
105
105
|
], n = `${o}
|
|
106
106
|
|
|
107
107
|
Your last reply did not validate:
|
|
108
|
-
${c.map((
|
|
108
|
+
${c.map((m) => `- ${m}`).join(`
|
|
109
109
|
`)}
|
|
110
110
|
Here it is:
|
|
111
111
|
${JSON.stringify(p)}
|
|
112
112
|
|
|
113
113
|
Return the corrected JSON object only.`;
|
|
114
114
|
}
|
|
115
|
-
throw new
|
|
115
|
+
throw new R(
|
|
116
116
|
"The model could not produce a valid app document.",
|
|
117
117
|
c,
|
|
118
118
|
t + 1
|
|
119
119
|
);
|
|
120
120
|
};
|
|
121
121
|
export {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
122
|
+
k as AGENT_ROSTER,
|
|
123
|
+
ee as ActionSchema,
|
|
124
|
+
x as AiConfigResolver,
|
|
125
|
+
J as AiGateway,
|
|
126
|
+
L as AiGatewayService,
|
|
127
|
+
M as AnthropicAdapter,
|
|
128
|
+
R as AppDocumentGenerationError,
|
|
129
|
+
te as AppSpecificationSchema,
|
|
130
|
+
ae as BlockSchema,
|
|
131
131
|
F as DeepSeekAdapter,
|
|
132
|
-
|
|
133
|
-
|
|
132
|
+
se as EntitySchema,
|
|
133
|
+
re as FieldSchema,
|
|
134
134
|
Y as GeminiAdapter,
|
|
135
135
|
U as GrokAdapter,
|
|
136
136
|
B as InMemoryRateLimiter,
|
|
137
|
-
|
|
137
|
+
N as NeuralGateway,
|
|
138
138
|
H as OllamaAdapter,
|
|
139
139
|
q as OpenAIAdapter,
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
140
|
+
oe as PageSchema,
|
|
141
|
+
ne as PageSectionSchema,
|
|
142
|
+
ce as ResourceSchema,
|
|
143
|
+
ie as SignalSchema,
|
|
144
144
|
me as TriggerSchema,
|
|
145
|
-
|
|
145
|
+
le as WorkflowSchema,
|
|
146
146
|
z as aiGateway,
|
|
147
147
|
V as aiGatewayService,
|
|
148
148
|
W as decodeSpr,
|
|
149
|
+
pe as deviceReadingsToSignals,
|
|
149
150
|
C as encodeSpr,
|
|
150
151
|
b as generateAppDocument,
|
|
151
|
-
X as
|
|
152
|
+
X as scopePatch,
|
|
153
|
+
Q as sprByteLength
|
|
152
154
|
};
|