@ramme-io/kernel 7.3.0 → 8.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.
Files changed (53) hide show
  1. package/dist/{AiGateway-Bdcl3v8h.js → AiGateway-U28yN4Mf.js} +409 -358
  2. package/dist/{bodewellAdapter-BzbeTSIP.js → bodewellAdapter-Cw9brU9k.js} +1 -1
  3. package/dist/deviceReadings-3Z4nql34.js +16 -0
  4. package/dist/index-BrFe7_2L.js +1614 -0
  5. package/dist/index.es.js +4340 -4610
  6. package/dist/kernel/src/agents/roster.d.ts +11 -3
  7. package/dist/kernel/src/agents/roster.d.ts.map +1 -1
  8. package/dist/kernel/src/agents/scope.d.ts +21 -0
  9. package/dist/kernel/src/agents/scope.d.ts.map +1 -0
  10. package/dist/kernel/src/agents/scope.test.d.ts +2 -0
  11. package/dist/kernel/src/agents/scope.test.d.ts.map +1 -0
  12. package/dist/kernel/src/components/AIChatPanel.d.ts +12 -0
  13. package/dist/kernel/src/components/AIChatPanel.d.ts.map +1 -1
  14. package/dist/kernel/src/engine/runtime/data-seeder.d.ts +2 -0
  15. package/dist/kernel/src/engine/runtime/data-seeder.d.ts.map +1 -1
  16. package/dist/kernel/src/engine/runtime/useSignal.d.ts +15 -0
  17. package/dist/kernel/src/engine/runtime/useSignal.d.ts.map +1 -1
  18. package/dist/kernel/src/engine/runtime/useSignal.test.d.ts +2 -0
  19. package/dist/kernel/src/engine/runtime/useSignal.test.d.ts.map +1 -0
  20. package/dist/kernel/src/index.d.ts +1 -4
  21. package/dist/kernel/src/index.d.ts.map +1 -1
  22. package/dist/kernel/src/renderers/AppDocumentRenderer.d.ts +57 -5
  23. package/dist/kernel/src/renderers/AppDocumentRenderer.d.ts.map +1 -1
  24. package/dist/kernel/src/renderers/AppOrientation.test.d.ts +2 -0
  25. package/dist/kernel/src/renderers/AppOrientation.test.d.ts.map +1 -0
  26. package/dist/kernel/src/server.d.ts +3 -0
  27. package/dist/kernel/src/server.d.ts.map +1 -1
  28. package/dist/kernel/src/services/ai/AiGatewayService.d.ts.map +1 -1
  29. package/dist/kernel/src/services/ai/providers/GeminiAdapter.d.ts.map +1 -1
  30. package/dist/kernel/src/services/ai/providers/OllamaAdapter.d.ts +1 -0
  31. package/dist/kernel/src/services/ai/providers/OllamaAdapter.d.ts.map +1 -1
  32. package/dist/kernel/src/services/ai/toolPromptGenerator.d.ts +0 -1
  33. package/dist/kernel/src/services/ai/toolPromptGenerator.d.ts.map +1 -1
  34. package/dist/kernel/src/signals/deviceReadings.d.ts +9 -0
  35. package/dist/kernel/src/signals/deviceReadings.d.ts.map +1 -0
  36. package/dist/kernel/src/signals/deviceReadings.test.d.ts +2 -0
  37. package/dist/kernel/src/signals/deviceReadings.test.d.ts.map +1 -0
  38. package/dist/kernel/src/signals/index.d.ts +1 -0
  39. package/dist/kernel/src/signals/index.d.ts.map +1 -1
  40. package/dist/server.es.js +47 -44
  41. package/dist/signals.es.js +12 -10
  42. package/package.json +4 -4
  43. package/dist/index-kBkq1FSR.js +0 -1236
  44. package/dist/kernel/src/events/mockEventSource.d.ts +0 -28
  45. package/dist/kernel/src/events/mockEventSource.d.ts.map +0 -1
  46. package/dist/kernel/src/services/MarketDataService.d.ts +0 -29
  47. package/dist/kernel/src/services/MarketDataService.d.ts.map +0 -1
  48. package/dist/kernel/src/services/marketSession.d.ts +0 -33
  49. package/dist/kernel/src/services/marketSession.d.ts.map +0 -1
  50. package/dist/kernel/src/services/marketSession.test.d.ts +0 -14
  51. package/dist/kernel/src/services/marketSession.test.d.ts.map +0 -1
  52. package/dist/kernel/src/stores/useMarketDataStore.d.ts +0 -50
  53. package/dist/kernel/src/stores/useMarketDataStore.d.ts.map +0 -1
@@ -1,28 +0,0 @@
1
- import { EntityEvent, EntityEventDensity, EntityEventFacets, EntityPriceSeries, EventBucketSize } from '../../../shared/index.ts';
2
-
3
- export interface MockEventOptions {
4
- /** Horizon in quarters. Defaults to the 5-quarter launch target. */
5
- quarters?: number;
6
- /** End of the window; defaults to today. */
7
- endDate?: Date;
8
- }
9
- /**
10
- * Full synthetic event history for a ticker, newest first — the same ordering
11
- * the real endpoint returns.
12
- */
13
- export declare function generateMockEvents(ticker: string, options?: MockEventOptions): EntityEvent[];
14
- /**
15
- * Daily OHLCV over the same window. The walk is nudged by same-day news
16
- * sentiment so the correlation view has something real to find — but the nudge
17
- * is deliberately small against the noise, because a mock where sentiment
18
- * cleanly predicts price would make every correlation visual look brilliant
19
- * and tell us nothing.
20
- */
21
- export declare function generateMockPriceSeries(ticker: string, events: EntityEvent[], options?: MockEventOptions): EntityPriceSeries;
22
- /**
23
- * Bucketed counts and mean sentiment — the shape the density strip and the
24
- * heatmap band both consume. Returned sparse: empty buckets are omitted.
25
- */
26
- export declare function buildMockDensity(ticker: string, events: EntityEvent[], bucket?: EventBucketSize): EntityEventDensity;
27
- export declare function buildMockFacets(ticker: string, events: EntityEvent[]): EntityEventFacets;
28
- //# sourceMappingURL=mockEventSource.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mockEventSource.d.ts","sourceRoot":"","sources":["../../../../src/events/mockEventSource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAGH,OAAO,KAAK,EAEV,WAAW,EACX,kBAAkB,EAElB,iBAAiB,EAEjB,iBAAiB,EACjB,eAAe,EAChB,MAAM,kBAAkB,CAAC;AA2G1B,MAAM,WAAW,gBAAgB;IAC/B,oEAAoE;IACpE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4CAA4C;IAC5C,OAAO,CAAC,EAAE,IAAI,CAAC;CAChB;AASD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,WAAW,EAAE,CAmG5F;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,WAAW,EAAE,EACrB,OAAO,CAAC,EAAE,gBAAgB,GACzB,iBAAiB,CA2CnB;AAUD;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,WAAW,EAAE,EACrB,MAAM,GAAE,eAAwB,GAC/B,kBAAkB,CAmCpB;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,iBAAiB,CAkBxF"}
@@ -1,29 +0,0 @@
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
- /**
14
- * Credentials are passed in, never read from VITE_ALPACA_*: a VITE_ variable is
15
- * copied into the browser bundle, and an Alpaca secret there is a brokerage
16
- * credential on a public page. Fetch them from a server you control.
17
- */
18
- connect(keyId?: string, secret?: string): void;
19
- private authenticate;
20
- subscribe(tickers: string[]): void;
21
- unsubscribe(tickers: string[]): void;
22
- private resubscribeTickers;
23
- disconnect(): void;
24
- getIsConnected(): boolean;
25
- getSubscribedTickers(): string[];
26
- }
27
- export declare const marketDataService: MarketDataService;
28
- export {};
29
- //# sourceMappingURL=MarketDataService.d.ts.map
@@ -1 +0,0 @@
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;IAO9C;;;;OAIG;IACI,OAAO,CAAC,KAAK,GAAE,MAAW,EAAE,MAAM,GAAE,MAAW,GAAG,IAAI;IAqH7D,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"}
@@ -1,33 +0,0 @@
1
- /**
2
- * Which US equities session is it right now?
3
- *
4
- * A live price and a frozen one look identical on screen, so a page that
5
- * streams quotes has to say which it is showing. Outside regular hours the
6
- * Alpaca IEX feed goes quiet and every row keeps whatever number it last had —
7
- * indistinguishable from a broken feed unless the page knows the market is
8
- * closed and labels the figure "At Close".
9
- *
10
- * WHY Intl RATHER THAN AN OFFSET
11
- *
12
- * Market hours are defined in New York local time, and New York moves between
13
- * EST and EDT. Subtracting a fixed 4 or 5 hours from UTC is right for about
14
- * half the year and silently an hour wrong for the other half — worst around
15
- * the open, where an hour decides whether the market is open at all. Intl
16
- * resolves the zone for the actual instant, so the DST transition costs
17
- * nothing.
18
- *
19
- * WHAT THIS DOES NOT KNOW
20
- *
21
- * Holidays. Thanksgiving, Good Friday and the early closes around Christmas
22
- * and Independence Day will read as `open` here. Getting that right needs a
23
- * calendar that has to be maintained, and a wrong calendar is worse than none
24
- * because it would claim closure with the same confidence it claims anything
25
- * else. The honest version of this function is one that knows the ordinary
26
- * week and says so; callers wanting holiday accuracy should ask the broker,
27
- * which is the only source that cannot drift.
28
- */
29
- export type MarketSession = 'pre' | 'open' | 'after' | 'closed';
30
- export declare function marketSession(now?: Date): MarketSession;
31
- /** Wording for a price when the market is not open, e.g. "At Close". */
32
- export declare function priceQualifier(session: MarketSession): string | null;
33
- //# sourceMappingURL=marketSession.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"marketSession.d.ts","sourceRoot":"","sources":["../../../../src/services/marketSession.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAwBhE,wBAAgB,aAAa,CAAC,GAAG,GAAE,IAAiB,GAAG,aAAa,CAOnE;AAED,wEAAwE;AACxE,wBAAgB,cAAc,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,GAAG,IAAI,CAWpE"}
@@ -1,14 +0,0 @@
1
- /**
2
- * Guards on the market session clock.
3
- *
4
- * These matter because the answer decides whether a number on screen is
5
- * labelled live or "At Close", and a wrong label is worse than no label: it
6
- * tells an operator a frozen price is current.
7
- *
8
- * Every case is expressed as a UTC instant, because that is what a browser
9
- * actually holds. Writing them in New York local time would hide the one thing
10
- * most likely to break — the DST offset — behind the same assumption the code
11
- * is being tested for.
12
- */
13
- export {};
14
- //# sourceMappingURL=marketSession.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"marketSession.test.d.ts","sourceRoot":"","sources":["../../../../src/services/marketSession.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG"}
@@ -1,50 +0,0 @@
1
- interface LivePriceData {
2
- price: number;
3
- change: number;
4
- trend: 'up' | 'down' | 'flat';
5
- }
6
- /**
7
- * The feed's own state, which nothing used to be able to see.
8
- *
9
- * MarketDataService already tracked `isConnected` and `isAuthenticated`, and
10
- * both were private. When the Alpaca socket failed the store simply stopped
11
- * receiving prices and every row kept its last number — a frozen price and a
12
- * live one render identically, so there was no way to tell a quiet market from
13
- * a dead feed.
14
- *
15
- * On 2026-09-23 that turned out to be hiding a specific, actionable error:
16
- * Alpaca's free tier allows one concurrent stream per account, and a second
17
- * client elsewhere was holding it, so every connection from the browser got
18
- * `[406] connection limit exceeded`. The service logged it to the console and
19
- * threw it away. It had been diagnosable in about a minute, and invisible for
20
- * however long it had been happening.
21
- *
22
- * `lastError` keeps the code as well as the message, because the code is what
23
- * separates "close your other tab" from "your key expired".
24
- */
25
- export type FeedStatus = 'idle' | 'connecting' | 'live' | 'error' | 'closed';
26
- export interface FeedError {
27
- code?: number;
28
- msg: string;
29
- }
30
- export interface FeedState {
31
- status: FeedStatus;
32
- /** epoch ms of the last price actually applied, not the last socket frame. */
33
- lastMessageAt: number | null;
34
- lastError: FeedError | null;
35
- }
36
- interface MarketDataState {
37
- livePrices: Record<string, LivePriceData>;
38
- feed: FeedState;
39
- updatePrice: (ticker: string, newPrice: number) => void;
40
- setFeedStatus: (status: FeedStatus) => void;
41
- setFeedError: (error: FeedError) => void;
42
- _messageBuffer: {
43
- ticker: string;
44
- price: number;
45
- }[];
46
- _flushBuffer: () => void;
47
- }
48
- export declare const useMarketDataStore: import('zustand').UseBoundStore<import('zustand').StoreApi<MarketDataState>>;
49
- export {};
50
- //# sourceMappingURL=useMarketDataStore.d.ts.map
@@ -1 +0,0 @@
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;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,MAAM,UAAU,GAClB,MAAM,GACN,YAAY,GACZ,MAAM,GACN,OAAO,GACP,QAAQ,CAAC;AAEb,MAAM,WAAW,SAAS;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,UAAU,CAAC;IACnB,8EAA8E;IAC9E,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,SAAS,EAAE,SAAS,GAAG,IAAI,CAAC;CAC7B;AAED,UAAU,eAAe;IACvB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IAC1C,IAAI,EAAE,SAAS,CAAC;IAChB,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACxD,aAAa,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;IAC5C,YAAY,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;IACzC,cAAc,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACpD,YAAY,EAAE,MAAM,IAAI,CAAC;CAC1B;AAoDD,eAAO,MAAM,kBAAkB,8EAuB5B,CAAC"}