@base44-preview/sdk 0.8.26-pr.164.f8d1b0e → 0.8.26-pr.167.9a82260

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.
@@ -43,7 +43,7 @@ export interface AgentMessageToolCall {
43
43
  /** Arguments passed to the tool as JSON string. */
44
44
  arguments_string: string;
45
45
  /** Status of the tool call. */
46
- status: "running" | "success" | "error" | "stopped";
46
+ status: "running" | "success" | "error" | "stopped" | "waiting_for_user_input";
47
47
  /** Results from the tool call. */
48
48
  results?: string;
49
49
  }
@@ -41,6 +41,34 @@ function parseRealtimeMessage(dataStr) {
41
41
  return null;
42
42
  }
43
43
  }
44
+ // In-flight HTTP refetches for oversize realtime events. Lets multiple
45
+ // subscribers in the same browser (e.g. several React components subscribed
46
+ // to the same entity) share one HTTP call when they all receive the same
47
+ // oversize event. Keyed by `${entityName}:${id}:${timestamp}` so distinct
48
+ // updates are not collapsed.
49
+ const inflightRefetches = new Map();
50
+ /**
51
+ * Refetches a record over HTTP after the server signaled it had to slim the
52
+ * realtime broadcast (`_oversize: true`). Reuses an in-flight promise if
53
+ * one exists for the same (entityName, id, timestamp) so concurrent
54
+ * subscribers in the same browser fan out to a single HTTP call.
55
+ * @internal
56
+ */
57
+ function refetchTruncated(axios, baseURL, entityName, id, timestamp) {
58
+ const key = `${entityName}:${id}:${timestamp}`;
59
+ let promise = inflightRefetches.get(key);
60
+ if (!promise) {
61
+ promise = axios.get(`${baseURL}/${id}`);
62
+ inflightRefetches.set(key, promise);
63
+ // Clear the cache entry after the promise settles plus a short grace
64
+ // window so late subscribers can still piggy-back on the result. Use
65
+ // .then(success, failure) instead of .finally to avoid creating an
66
+ // unhandled rejection tail when the underlying axios call rejects.
67
+ const cleanup = () => setTimeout(() => inflightRefetches.delete(key), 5000);
68
+ promise.then(cleanup, cleanup);
69
+ }
70
+ return promise;
71
+ }
44
72
  /**
45
73
  * Creates a handler for a specific entity.
46
74
  *
@@ -130,11 +158,26 @@ function createEntityHandler(axios, appId, entityName, getSocket) {
130
158
  // Get the socket and subscribe to the room
131
159
  const socket = getSocket();
132
160
  const unsubscribe = socket.subscribeToRoom(room, {
133
- update_model: (msg) => {
161
+ update_model: async (msg) => {
162
+ var _a;
134
163
  const event = parseRealtimeMessage(msg.data);
135
164
  if (!event) {
136
165
  return;
137
166
  }
167
+ // Server signals oversize broadcasts with `_oversize: true` on
168
+ // `data`. The wire payload is bounded for transport; we transparently
169
+ // refetch the full record over HTTP so callers always see complete
170
+ // data. Skip on delete events — the record no longer exists.
171
+ if (event.type !== "delete" && ((_a = event.data) === null || _a === void 0 ? void 0 : _a._oversize)) {
172
+ try {
173
+ event.data = await refetchTruncated(axios, baseURL, entityName, event.id, event.timestamp);
174
+ }
175
+ catch (error) {
176
+ console.warn("[Base44 SDK] Failed to refetch oversize entity, falling through with stub payload:", error);
177
+ // event.data stays as the `{id, _oversize: true}` stub; user
178
+ // code receives partial data — same UX as today's drop-and-stale.
179
+ }
180
+ }
138
181
  try {
139
182
  callback(event);
140
183
  }
@@ -43,9 +43,9 @@ export interface InvokeLLMParams {
43
43
  prompt: string;
44
44
  /** Optionally specify a model to override the app-level model setting for this specific call.
45
45
  *
46
- * Options: `"gpt_5_mini"`, `"gemini_3_flash"`, `"gpt_5"`, `"gpt_5_4"`, `"gemini_3_1_pro"`, `"claude_sonnet_4_6"`, `"claude_opus_4_6"`
46
+ * Options: `"gpt_5_mini"`, `"gemini_3_flash"`, `"gpt_5"`, `"gpt_5_4"`, `"gpt_5_5"`, `"gemini_3_1_pro"`, `"claude_sonnet_4_6"`, `"claude_opus_4_6"`, `"claude_opus_4_7"`
47
47
  */
48
- model?: 'gpt_5_mini' | 'gemini_3_flash' | 'gpt_5' | 'gpt_5_4' | 'gemini_3_1_pro' | 'claude_sonnet_4_6' | 'claude_opus_4_6';
48
+ model?: 'gpt_5_mini' | 'gemini_3_flash' | 'gpt_5' | 'gpt_5_4' | 'gpt_5_5' | 'gemini_3_1_pro' | 'claude_sonnet_4_6' | 'claude_opus_4_6' | 'claude_opus_4_7';
49
49
  /** If set to `true`, the LLM will use Google Search, Maps, and News to gather real-time context before answering.
50
50
  * @default false
51
51
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base44-preview/sdk",
3
- "version": "0.8.26-pr.164.f8d1b0e",
3
+ "version": "0.8.26-pr.167.9a82260",
4
4
  "description": "JavaScript SDK for Base44 API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",