@ramme-io/kernel 6.0.3 → 7.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.
Files changed (44) hide show
  1. package/dist/{AiGateway-BmV6ypkd.js → AiGateway-ujqOJuoj.js} +1203 -1071
  2. package/dist/index.es.js +6153 -5982
  3. package/dist/kernel/src/apps/spr.d.ts +55 -0
  4. package/dist/kernel/src/apps/spr.d.ts.map +1 -0
  5. package/dist/kernel/src/apps/spr.test.d.ts +2 -0
  6. package/dist/kernel/src/apps/spr.test.d.ts.map +1 -0
  7. package/dist/kernel/src/components/AIChatPanel.d.ts +32 -1
  8. package/dist/kernel/src/components/AIChatPanel.d.ts.map +1 -1
  9. package/dist/kernel/src/components/AIChatPanel.test.d.ts +2 -0
  10. package/dist/kernel/src/components/AIChatPanel.test.d.ts.map +1 -0
  11. package/dist/kernel/src/components/settings/AiSettingsPanel.d.ts +7 -0
  12. package/dist/kernel/src/components/settings/AiSettingsPanel.d.ts.map +1 -1
  13. package/dist/kernel/src/engine/runtime/useRammeAI.d.ts +10 -1
  14. package/dist/kernel/src/engine/runtime/useRammeAI.d.ts.map +1 -1
  15. package/dist/kernel/src/hooks/useAIKeyOrchestrator.d.ts.map +1 -1
  16. package/dist/kernel/src/index.d.ts +2 -0
  17. package/dist/kernel/src/index.d.ts.map +1 -1
  18. package/dist/kernel/src/renderers/AppDocumentRenderer.d.ts +22 -9
  19. package/dist/kernel/src/renderers/AppDocumentRenderer.d.ts.map +1 -1
  20. package/dist/kernel/src/renderers/AppDocumentRenderer.test.d.ts +2 -0
  21. package/dist/kernel/src/renderers/AppDocumentRenderer.test.d.ts.map +1 -0
  22. package/dist/kernel/src/renderers/AppImage.test.d.ts +2 -0
  23. package/dist/kernel/src/renderers/AppImage.test.d.ts.map +1 -0
  24. package/dist/kernel/src/server.d.ts +3 -0
  25. package/dist/kernel/src/server.d.ts.map +1 -1
  26. package/dist/kernel/src/services/MarketDataService.d.ts +5 -0
  27. package/dist/kernel/src/services/MarketDataService.d.ts.map +1 -1
  28. package/dist/kernel/src/services/ai/ConfigResolver.d.ts +23 -8
  29. package/dist/kernel/src/services/ai/ConfigResolver.d.ts.map +1 -1
  30. package/dist/kernel/src/services/ai/providers/AnthropicAdapter.d.ts +37 -0
  31. package/dist/kernel/src/services/ai/providers/AnthropicAdapter.d.ts.map +1 -1
  32. package/dist/kernel/src/services/ai/providers/AnthropicAdapter.test.d.ts +2 -0
  33. package/dist/kernel/src/services/ai/providers/AnthropicAdapter.test.d.ts.map +1 -0
  34. package/dist/kernel/src/services/ai/providers/openAiCompatibleStreamChat.d.ts +1 -1
  35. package/dist/kernel/src/services/ai/transport.d.ts +16 -1
  36. package/dist/kernel/src/services/ai/transport.d.ts.map +1 -1
  37. package/dist/kernel/src/services/marketSession.d.ts +33 -0
  38. package/dist/kernel/src/services/marketSession.d.ts.map +1 -0
  39. package/dist/kernel/src/services/marketSession.test.d.ts +14 -0
  40. package/dist/kernel/src/services/marketSession.test.d.ts.map +1 -0
  41. package/dist/kernel/src/stores/useMarketDataStore.d.ts +33 -0
  42. package/dist/kernel/src/stores/useMarketDataStore.d.ts.map +1 -1
  43. package/dist/server.es.js +32 -29
  44. package/package.json +4 -4
package/dist/server.es.js CHANGED
@@ -1,8 +1,8 @@
1
- import { C as d, a as E, H as O, J as y, K as G, n as _, L as T } from "./AiGateway-BmV6ypkd.js";
2
- import { k as J, w as b, A as k, i as x, g as L, o as M, z as Y, B as F, r as H, E as U, v as q, G as z, q as B, I as C, O as V, p as W, y as X, x as Q, R as Z, S as ee, T as te, W as ae, j as se, b as re } from "./AiGateway-BmV6ypkd.js";
1
+ import { M as u, a as E, N as O, Q as y, U as G, n as _, V as T } from "./AiGateway-ujqOJuoj.js";
2
+ import { l as J, C as L, A as M, j as b, h as k, v as x, L as U, H as Y, y as F, E as H, B as q, G as B, x as V, I as z, O as C, w as W, K as Q, J as X, R as Z, S as ee, T as te, W as ae, k as se, b as re, f as oe, r as ne, q as ce } from "./AiGateway-ujqOJuoj.js";
3
3
  import { streamText as w, generateObject as $ } from "ai";
4
4
  import { createGoogleGenerativeAI as S } from "@ai-sdk/google";
5
- function A(e) {
5
+ function h(e) {
6
6
  const a = typeof process < "u" ? process.env.GOOGLE_GENERATIVE_AI_API_KEY : void 0, s = e || a;
7
7
  if (!s)
8
8
  throw new Error(
@@ -25,7 +25,7 @@ const P = {
25
25
  * @param opts.apiKey - Optional client-provided key
26
26
  */
27
27
  async generateSchema(e) {
28
- const a = A(e.apiKey), s = S({ apiKey: a }), t = e.role ? d[e.role] : null, r = e.model ?? (t == null ? void 0 : t.model) ?? O, o = e.temperature ?? (t == null ? void 0 : t.temperature) ?? 0.3;
28
+ const a = h(e.apiKey), s = S({ apiKey: a }), t = e.role ? u[e.role] : null, r = e.model ?? (t == null ? void 0 : t.model) ?? O, o = e.temperature ?? (t == null ? void 0 : t.temperature) ?? 0.3;
29
29
  return (await $({
30
30
  model: s(r),
31
31
  schema: e.schema,
@@ -47,7 +47,7 @@ const P = {
47
47
  * @returns A Response object — directly return this from your route handler.
48
48
  */
49
49
  streamChatResponse(e) {
50
- const a = A(e.apiKey), s = S({ apiKey: a }), t = e.role ? d[e.role] : null, r = e.model ?? (t == null ? void 0 : t.model) ?? E, o = e.temperature ?? (t == null ? void 0 : t.temperature) ?? 0.5;
50
+ const a = h(e.apiKey), s = S({ apiKey: a }), t = e.role ? u[e.role] : null, r = e.model ?? (t == null ? void 0 : t.model) ?? E, o = e.temperature ?? (t == null ? void 0 : t.temperature) ?? 0.5;
51
51
  return w({
52
52
  model: s(r),
53
53
  messages: e.messages,
@@ -84,26 +84,26 @@ ${r}
84
84
  Request: ${e}`;
85
85
  let n = o, c = [];
86
86
  for (let l = 0; l <= t; l += 1) {
87
- const h = await s(n);
87
+ const A = await s(n);
88
88
  let p;
89
89
  try {
90
- p = JSON.parse(v(h));
90
+ p = JSON.parse(v(A));
91
91
  } catch {
92
92
  c = ["the reply was not JSON"], n = `${o}
93
93
 
94
94
  Your last reply was not valid JSON. Reply with the JSON object only.`;
95
95
  continue;
96
96
  }
97
- const u = _(p), i = T.safeParse(u.value);
98
- if (i.success && u.issues.length === 0)
99
- return { document: i.data, repairs: l };
97
+ const d = _(p), m = T.safeParse(d.value);
98
+ if (m.success && d.issues.length === 0)
99
+ return { document: m.data, repairs: l };
100
100
  c = [
101
- ...u.issues.map((m) => `${m.path.join(".") || "(root)"}: ${m.message}`),
102
- ...i.success ? [] : R(i.error)
101
+ ...d.issues.map((i) => `${i.path.join(".") || "(root)"}: ${i.message}`),
102
+ ...m.success ? [] : R(m.error)
103
103
  ], n = `${o}
104
104
 
105
105
  Your last reply did not validate:
106
- ${c.map((m) => `- ${m}`).join(`
106
+ ${c.map((i) => `- ${i}`).join(`
107
107
  `)}
108
108
  Here it is:
109
109
  ${JSON.stringify(p)}
@@ -118,30 +118,33 @@ Return the corrected JSON object only.`;
118
118
  };
119
119
  export {
120
120
  J as AGENT_ROSTER,
121
- b as ActionSchema,
122
- k as AiConfigResolver,
123
- x as AiGateway,
124
- L as AiGatewayService,
125
- M as AnthropicAdapter,
121
+ L as ActionSchema,
122
+ M as AiConfigResolver,
123
+ b as AiGateway,
124
+ k as AiGatewayService,
125
+ x as AnthropicAdapter,
126
126
  g as AppDocumentGenerationError,
127
- Y as AppSpecificationSchema,
128
- F as BlockSchema,
129
- H as DeepSeekAdapter,
130
- U as EntitySchema,
127
+ U as AppSpecificationSchema,
128
+ Y as BlockSchema,
129
+ F as DeepSeekAdapter,
130
+ H as EntitySchema,
131
131
  q as FieldSchema,
132
- z as GeminiAdapter,
133
- B as GrokAdapter,
134
- C as InMemoryRateLimiter,
132
+ B as GeminiAdapter,
133
+ V as GrokAdapter,
134
+ z as InMemoryRateLimiter,
135
135
  P as NeuralGateway,
136
- V as OllamaAdapter,
136
+ C as OllamaAdapter,
137
137
  W as OpenAIAdapter,
138
- X as PageSchema,
139
- Q as PageSectionSchema,
138
+ Q as PageSchema,
139
+ X as PageSectionSchema,
140
140
  Z as ResourceSchema,
141
141
  ee as SignalSchema,
142
142
  te as TriggerSchema,
143
143
  ae as WorkflowSchema,
144
144
  se as aiGateway,
145
145
  re as aiGatewayService,
146
- D as generateAppDocument
146
+ oe as decodeSpr,
147
+ ne as encodeSpr,
148
+ D as generateAppDocument,
149
+ ce as sprByteLength
147
150
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ramme-io/kernel",
3
- "version": "6.0.3",
3
+ "version": "7.1.0",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "type": "module",
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "peerDependencies": {
30
30
  "@ai-sdk/google": ">=0.0.1",
31
- "@ramme-io/ui": ">=4.1.1",
31
+ "@ramme-io/ui": ">=4.2.1",
32
32
  "ai": ">=4.0.0",
33
33
  "react": ">=18.2.0",
34
34
  "react-dom": ">=18.2.0",
@@ -52,7 +52,7 @@
52
52
  "vite-plugin-dts": "^3.9.1",
53
53
  "vitest": "^2.1.9",
54
54
  "zod": "^3.23.8",
55
- "@ramme-io/ui": "4.1.1"
55
+ "@ramme-io/ui": "4.2.1"
56
56
  },
57
57
  "dependencies": {
58
58
  "@types/react-syntax-highlighter": "^15.5.13",
@@ -63,7 +63,7 @@
63
63
  "remark-gfm": "^4.0.1",
64
64
  "zod-to-json-schema": "^3.23.0",
65
65
  "zustand": "^5.0.0",
66
- "@ramme-io/shared": "3.1.2"
66
+ "@ramme-io/shared": "3.2.0"
67
67
  },
68
68
  "scripts": {
69
69
  "build": "vite build",