@agent-native/core 0.161.0 → 0.161.1

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.
@@ -21,7 +21,7 @@ import { isInBackgroundFunctionRuntime } from "../durable-background.js";
21
21
  import { BUILDER_MODEL_CONFIG } from "../model-config.js";
22
22
  import { getBuilderGatewayRequestHeaders } from "./builder-gateway-headers.js";
23
23
  import { gatewayVisitorFacingError, LLM_MISSING_CREDENTIALS_ERROR_CODE, LLM_MISSING_CREDENTIALS_MESSAGE, } from "./credential-errors.js";
24
- import { classifyTerminalErrorCode, describeErrorWithCauses, isContextOverflowCode, isContextOverflowMessage, isProviderConnectionErrorMessage, } from "./error-detail.js";
24
+ import { classifyTerminalErrorCode, describeErrorWithCauses, isBuilderGatewayInternalErrorMessage, isContextOverflowCode, isContextOverflowMessage, isProviderConnectionErrorMessage, } from "./error-detail.js";
25
25
  import { FIRST_STREAM_EVENT_TIMEOUT_MS } from "./first-event-timeout.js";
26
26
  import { resolveMaxOutputTokensForEngine } from "./output-tokens.js";
27
27
  import { splitSystemPromptForCache, stablePrefixCacheControl, } from "./prompt-cache.js";
@@ -340,6 +340,11 @@ function isTransientGatewayFailure(rawMessage, status) {
340
340
  if (status !== undefined && RETRYABLE_GATEWAY_STATUSES.has(status)) {
341
341
  return true;
342
342
  }
343
+ // The gateway's unhandled-500 envelope, which reaches the in-stream error
344
+ // frame with no status at all. Without this it read as terminal there while
345
+ // the identical body read as retryable when it arrived as an HTTP 500.
346
+ if (isBuilderGatewayInternalErrorMessage(rawMessage))
347
+ return true;
343
348
  return TRANSIENT_UPSTREAM_PATTERN.test(rawMessage);
344
349
  }
345
350
  /**
@@ -35,6 +35,23 @@ export declare function isProviderConnectionError(err: unknown): boolean;
35
35
  * for every other engine, which still delivers its own message intact.
36
36
  */
37
37
  export declare function isContextOverflowMessage(message: string): boolean;
38
+ /**
39
+ * The Builder gateway's own 500 envelope, which is the whole message: an
40
+ * apology sentence plus a correlation id, e.g. "Sorry, we ran into an issue
41
+ * processing your request. ERROR ID: 0f3c...". The apology prose varies; the
42
+ * correlation id does not, so that is what the predicate below anchors on.
43
+ */
44
+ export declare const BUILDER_GATEWAY_INTERNAL_ERROR_CODE = "builder_gateway_internal_error";
45
+ /**
46
+ * The gateway attaches that envelope to an unhandled 500, and it arrives two
47
+ * ways: as an HTTP body, which is already retried because 500 is in the
48
+ * engine's retryable status set, and as an in-stream error frame after the
49
+ * gateway has already answered 200, where there is no status to read and the
50
+ * prose carries no keyword any other predicate here matches. Naming it is what
51
+ * makes the second path behave like the first instead of dying uncoded on the
52
+ * first attempt.
53
+ */
54
+ export declare function isBuilderGatewayInternalErrorMessage(message: string): boolean;
38
55
  /** The overflow codes a provider or gateway may report instead of prose. */
39
56
  export declare function isContextOverflowCode(code: string | undefined): boolean;
40
57
  /** Classification fields an AI SDK provider failure carries. */
@@ -83,6 +83,28 @@ export function isContextOverflowMessage(message) {
83
83
  msg.includes("input token count exceeds") ||
84
84
  msg.includes("request too large"));
85
85
  }
86
+ /**
87
+ * The Builder gateway's own 500 envelope, which is the whole message: an
88
+ * apology sentence plus a correlation id, e.g. "Sorry, we ran into an issue
89
+ * processing your request. ERROR ID: 0f3c...". The apology prose varies; the
90
+ * correlation id does not, so that is what the predicate below anchors on.
91
+ */
92
+ export const BUILDER_GATEWAY_INTERNAL_ERROR_CODE = "builder_gateway_internal_error";
93
+ const BUILDER_GATEWAY_ERROR_ID_PATTERN = /\berror id:\s*([0-9a-f]+)\b/i;
94
+ const BUILDER_GATEWAY_ERROR_ID_MIN_CHARS = 8;
95
+ /**
96
+ * The gateway attaches that envelope to an unhandled 500, and it arrives two
97
+ * ways: as an HTTP body, which is already retried because 500 is in the
98
+ * engine's retryable status set, and as an in-stream error frame after the
99
+ * gateway has already answered 200, where there is no status to read and the
100
+ * prose carries no keyword any other predicate here matches. Naming it is what
101
+ * makes the second path behave like the first instead of dying uncoded on the
102
+ * first attempt.
103
+ */
104
+ export function isBuilderGatewayInternalErrorMessage(message) {
105
+ const match = BUILDER_GATEWAY_ERROR_ID_PATTERN.exec(message);
106
+ return (match !== null && match[1].length >= BUILDER_GATEWAY_ERROR_ID_MIN_CHARS);
107
+ }
86
108
  /** The overflow codes a provider or gateway may report instead of prose. */
87
109
  export function isContextOverflowCode(code) {
88
110
  const normalized = (code ?? "").toLowerCase();
@@ -203,5 +225,10 @@ export function classifyTerminalErrorCode(message) {
203
225
  if (/(?:err_)?ssl|tlsv?\d|tls handshake|ssl routines|econnreset|econnrefused|und_err_socket|socket hang up/i.test(message)) {
204
226
  return "provider_network_error";
205
227
  }
228
+ // Last, so a gateway 500 whose body happens to quote a more specific upstream
229
+ // failure keeps that classification instead of collapsing to this one.
230
+ if (isBuilderGatewayInternalErrorMessage(message)) {
231
+ return BUILDER_GATEWAY_INTERNAL_ERROR_CODE;
232
+ }
206
233
  return undefined;
207
234
  }
@@ -28,7 +28,7 @@ import { AGENT_CHAT_BACKGROUND_RUN_FIELD, AGENT_CHAT_PROCESS_RUN_PATH, backgroun
28
28
  import { applyContextXrayTransformForIteration } from "./engine/context-directives-transform.js";
29
29
  import { attemptContinuationDispatch } from "./engine/continuation-dispatch-retry.js";
30
30
  import { formatLlmCredentialErrorMessage, LLM_MISSING_CREDENTIALS_ERROR_CODE, LLM_MISSING_CREDENTIALS_MESSAGE, userFacingLlmCredentialError, } from "./engine/credential-errors.js";
31
- import { isContextOverflowCode, isContextOverflowMessage, isProviderConnectionErrorMessage, } from "./engine/error-detail.js";
31
+ import { BUILDER_GATEWAY_INTERNAL_ERROR_CODE, isContextOverflowCode, isContextOverflowMessage, isProviderConnectionErrorMessage, } from "./engine/error-detail.js";
32
32
  import { resolveEngine, explicitEngineName, registerBuiltinEngines, getStoredModelForEngine, normalizeModelForEngine, isResolvedEngineUsableForRequest, } from "./engine/index.js";
33
33
  import { resolveEmptyResponseRetryMaxOutputTokens, resolveMainChatMaxOutputTokens, resolveMaxOutputTokensForEngine, } from "./engine/output-tokens.js";
34
34
  import { PROVIDER_TO_ENV } from "./engine/provider-env-vars.js";
@@ -880,6 +880,9 @@ export function isRetryableError(err) {
880
880
  return true;
881
881
  }
882
882
  return (code === "builder_gateway_error" ||
883
+ // The gateway's unhandled-500 envelope arriving in-stream, where there is no
884
+ // status to read. Same failure as `http_500` below, so same verdict.
885
+ code === BUILDER_GATEWAY_INTERNAL_ERROR_CODE ||
883
886
  code === "builder_gateway_network_error" ||
884
887
  code === "provider_network_error" ||
885
888
  code === "http_429" ||
@@ -5177,6 +5180,8 @@ export function isRecoverableContinuationError(event) {
5177
5180
  // the server read the sentence instead, which a Builder-credits deployment
5178
5181
  // replaces with one visitor line.
5179
5182
  code === "http_500" ||
5183
+ // The same 500, delivered in-stream with no status attached.
5184
+ code === BUILDER_GATEWAY_INTERNAL_ERROR_CODE ||
5180
5185
  code === "http_502" ||
5181
5186
  code === "http_503" ||
5182
5187
  code === "http_504" ||
@@ -1,5 +1,6 @@
1
1
  import { formatChatErrorText, normalizeChatError, } from "../client/error-format.js";
2
2
  import { isCredentialGapCodeAgentEvent, normalizeCodeAgentTranscript, } from "../code-agents/transcript-normalizer.js";
3
+ import { BUILDER_GATEWAY_INTERNAL_ERROR_CODE } from "./engine/error-detail.js";
3
4
  const INTERRUPTED_TOOL_RESULT = "Interrupted before this tool returned a result.";
4
5
  export const ASSISTANT_RUN_DURATION_METADATA_KEY = "agentNativeRunDurationMs";
5
6
  const MAX_STORED_ATTACHMENT_CHARS = 60_000;
@@ -20,6 +21,10 @@ function isInternalContinuationError(event) {
20
21
  code === "http_408" ||
21
22
  code === "http_429" ||
22
23
  code === "http_500" ||
24
+ // The gateway's unhandled-500 envelope arriving in-stream. Without this the
25
+ // turn stored Builder's internal correlation id as the assistant's visible
26
+ // answer instead of a continuation.
27
+ code === BUILDER_GATEWAY_INTERNAL_ERROR_CODE ||
23
28
  code === "http_502" ||
24
29
  code === "http_503" ||
25
30
  code === "http_504" ||
@@ -1,4 +1,5 @@
1
1
  import { GATEWAY_UNAVAILABLE_VISITOR_MESSAGE } from "../agent/engine/credential-errors.js";
2
+ import { BUILDER_GATEWAY_INTERNAL_ERROR_CODE } from "../agent/engine/error-detail.js";
2
3
  /**
3
4
  * Append a Builder CTA markdown link to gateway errors that users can fix
4
5
  * outside the app. Used by both
@@ -21,6 +22,13 @@ const OPEN_BUILDER_SPACE_SETTINGS_LABEL = "Open Builder space settings";
21
22
  const START_NEW_CHAT_LABEL = "Start new chat";
22
23
  const UPGRADE_AT_BUILDER_LABEL = "Upgrade at builder.io";
23
24
  const BUILDER_AUTHENTICATION_ERROR = "Builder rejected the connected credentials. Reconnect Builder.io (free tier available) in Settings, then retry.";
25
+ /**
26
+ * The gateway's unhandled-500 envelope is an internal correlation id and an
27
+ * apology: nothing the reader can act on, and nothing that says whether the
28
+ * failure was theirs. Say where it broke and keep the raw sentence in
29
+ * `details`, which is the only place the error id is useful.
30
+ */
31
+ const GATEWAY_INTERNAL_ERROR_MESSAGE = "The model gateway hit an internal error before the agent could answer. Retry in a moment, and quote the error id below if it keeps happening.";
24
32
  function isSafeUpgradeUrl(url) {
25
33
  try {
26
34
  const parsed = new URL(url);
@@ -104,6 +112,10 @@ const KNOWN_CHAT_ERROR_KEYS = new Map([
104
112
  "The model gateway returned no error details and the chat couldn't recover. Wait a moment and retry, or start a new chat if it keeps happening.",
105
113
  "agentChat.errorMessages.gatewayNoDetails",
106
114
  ],
115
+ [
116
+ GATEWAY_INTERNAL_ERROR_MESSAGE,
117
+ "agentChat.errorMessages.gatewayInternalError",
118
+ ],
107
119
  [
108
120
  "The agent connection timed out before it could finish. You can continue from the partial work or retry.",
109
121
  "agentChat.errorMessages.inactivityTimeout",
@@ -233,6 +245,9 @@ export function normalizeChatError(errorMessage, errorCode) {
233
245
  details: text,
234
246
  };
235
247
  }
248
+ if (code === BUILDER_GATEWAY_INTERNAL_ERROR_CODE) {
249
+ return { message: GATEWAY_INTERNAL_ERROR_MESSAGE, details: text };
250
+ }
236
251
  if (code === "builder_auth_error") {
237
252
  return {
238
253
  message: BUILDER_AUTHENTICATION_ERROR,
@@ -1,4 +1,5 @@
1
1
  import { LLM_MISSING_CREDENTIALS_ERROR_CODE, LLM_MISSING_CREDENTIALS_MESSAGE, } from "../agent/engine/credential-errors.js";
2
+ import { BUILDER_GATEWAY_INTERNAL_ERROR_CODE } from "../agent/engine/error-detail.js";
2
3
  import { emitChatFirstOpenApp } from "./chat-first.js";
3
4
  import { formatChatErrorText, normalizeChatError } from "./error-format.js";
4
5
  import { humanizeToolLabelText, humanizeToolName, isToolCallActive, runningToolLabel, } from "./tool-display.js";
@@ -529,6 +530,9 @@ function isAutoRecoverableError(ev, errMsg) {
529
530
  code === "http_408" ||
530
531
  code === "http_429" ||
531
532
  code === "http_500" ||
533
+ // The gateway's unhandled-500 envelope delivered in-stream instead of as a
534
+ // status. Recoverable for the same reason `http_500` is.
535
+ code === BUILDER_GATEWAY_INTERNAL_ERROR_CODE ||
532
536
  code === "http_502" ||
533
537
  code === "http_503" ||
534
538
  code === "http_504" ||
@@ -13,8 +13,8 @@
13
13
  * Body: { json: any, fieldName?: string, type?: "map"|"array", requestSource?: string }
14
14
  */
15
15
  export declare const postCollabJson: import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
16
- ok?: undefined;
17
16
  error: string;
17
+ ok?: undefined;
18
18
  } | {
19
19
  error?: undefined;
20
20
  ok: boolean;
@@ -260,6 +260,7 @@ const messages = {
260
260
  "errorMessages.builderAuthentication": "رفض Builder بيانات الاعتماد المتصلة. أعد الاتصال بـ Builder.io من الإعدادات، ثم أعد المحاولة.",
261
261
  "errorMessages.builderModelUnauthorized": "رفض المزوّد الذي يشغّل هذا النموذج الطلب. اختر نموذجًا آخر، ثم أعد المحاولة.",
262
262
  "errorMessages.errorPrefix": "خطأ: {{message}}",
263
+ "errorMessages.gatewayInternalError": "حدث خطأ داخلي في بوابة النموذج قبل أن يتمكن الوكيل من الإجابة. أعد المحاولة بعد قليل، وإذا تكرر الأمر فأرفق معرّف الخطأ الظاهر أدناه.",
263
264
  "errorMessages.gatewayNoDetails": "لم تُرجع بوابة النموذج أي تفاصيل عن الخطأ وتعذّر على المحادثة الاسترداد. انتظر قليلًا ثم أعد المحاولة، أو ابدأ محادثة جديدة إذا استمرت المشكلة.",
264
265
  "errorMessages.inactivityTimeout": "انتهت مهلة اتصال الوكيل قبل أن يتمكن من الإكمال. يمكنك المتابعة من العمل الجزئي أو إعادة المحاولة.",
265
266
  "errorMessages.invalidToolSchema": "كان مخطط إحدى الأدوات غير صالح، لذلك رفض النموذج الطلب قبل بدئه. يمكن تخطي الأداة غير الصالحة وإعادة محاولة الطلب.",
@@ -389,6 +389,7 @@ const messages = {
389
389
  "errorMessages.builderAuthentication": "Builder hat die verbundenen Anmeldedaten abgelehnt. Verbinde Builder.io in den Einstellungen erneut und versuche es dann noch einmal.",
390
390
  "errorMessages.builderModelUnauthorized": "Der Anbieter hinter diesem Modell hat die Anfrage abgelehnt. Wähle ein anderes Modell und versuche es erneut.",
391
391
  "errorMessages.errorPrefix": "Fehler: {{message}}",
392
+ "errorMessages.gatewayInternalError": "Das Modell-Gateway hat einen internen Fehler ausgelöst, bevor der Agent antworten konnte. Versuchen Sie es in einem Moment erneut und geben Sie die untenstehende Fehler-ID an, wenn es weiterhin auftritt.",
392
393
  "errorMessages.gatewayNoDetails": "Das Modell-Gateway hat keine Fehlerdetails zurückgegeben und der Chat konnte nicht fortgesetzt werden. Warte einen Moment und versuche es erneut. Falls das Problem bestehen bleibt, starte einen neuen Chat.",
393
394
  "errorMessages.inactivityTimeout": "Die Verbindung zum Agenten wurde wegen Zeitüberschreitung beendet, bevor er fertig war. Du kannst mit dem Teilergebnis fortfahren oder es erneut versuchen.",
394
395
  "errorMessages.invalidToolSchema": "Ein Tool-Schema war ungültig. Deshalb hat das Modell die Anfrage abgelehnt, bevor sie gestartet wurde. Das ungültige Tool kann übersprungen und die Anfrage erneut gesendet werden.",
@@ -252,6 +252,7 @@ declare const messages: {
252
252
  readonly "errorMessages.builderAuthentication": "Builder rejected the connected credentials. Reconnect Builder.io in Settings, then retry.";
253
253
  readonly "errorMessages.builderModelUnauthorized": "The provider behind this model rejected the request. Pick a different model, then retry.";
254
254
  readonly "errorMessages.errorPrefix": "Error: {{message}}";
255
+ readonly "errorMessages.gatewayInternalError": "The model gateway hit an internal error before the agent could answer. Retry in a moment, and quote the error id below if it keeps happening.";
255
256
  readonly "errorMessages.gatewayNoDetails": "The model gateway returned no error details and the chat couldn't recover. Wait a moment and retry, or start a new chat if it keeps happening.";
256
257
  readonly "errorMessages.inactivityTimeout": "The agent connection timed out before it could finish. You can continue from the partial work or retry.";
257
258
  readonly "errorMessages.invalidToolSchema": "A tool schema was invalid, so the model rejected the request before it started. The invalid tool can be skipped and the request retried.";
@@ -252,6 +252,7 @@ const messages = {
252
252
  "errorMessages.builderAuthentication": "Builder rejected the connected credentials. Reconnect Builder.io in Settings, then retry.",
253
253
  "errorMessages.builderModelUnauthorized": "The provider behind this model rejected the request. Pick a different model, then retry.",
254
254
  "errorMessages.errorPrefix": "Error: {{message}}",
255
+ "errorMessages.gatewayInternalError": "The model gateway hit an internal error before the agent could answer. Retry in a moment, and quote the error id below if it keeps happening.",
255
256
  "errorMessages.gatewayNoDetails": "The model gateway returned no error details and the chat couldn't recover. Wait a moment and retry, or start a new chat if it keeps happening.",
256
257
  "errorMessages.inactivityTimeout": "The agent connection timed out before it could finish. You can continue from the partial work or retry.",
257
258
  "errorMessages.invalidToolSchema": "A tool schema was invalid, so the model rejected the request before it started. The invalid tool can be skipped and the request retried.",
@@ -396,6 +396,7 @@ const messages = {
396
396
  "errorMessages.builderAuthentication": "Builder rechazó las credenciales conectadas. Vuelve a conectar Builder.io en Ajustes e inténtalo de nuevo.",
397
397
  "errorMessages.builderModelUnauthorized": "El proveedor de este modelo rechazó la solicitud. Elige otro modelo y vuelve a intentarlo.",
398
398
  "errorMessages.errorPrefix": "Error: {{message}}",
399
+ "errorMessages.gatewayInternalError": "La pasarela del modelo tuvo un error interno antes de que el agente pudiera responder. Vuelve a intentarlo en un momento e indica el id de error de abajo si sigue ocurriendo.",
399
400
  "errorMessages.gatewayNoDetails": "La pasarela del modelo no devolvió detalles del error y el chat no pudo recuperarse. Espera un momento y vuelve a intentarlo. Si el problema continúa, inicia un chat nuevo.",
400
401
  "errorMessages.inactivityTimeout": "La conexión del agente expiró antes de que pudiera finalizar. Puedes continuar desde el trabajo parcial o volver a intentarlo.",
401
402
  "errorMessages.invalidToolSchema": "El esquema de una herramienta no era válido, así que el modelo rechazó la solicitud antes de iniciarla. Puedes omitir la herramienta no válida y volver a intentarlo.",
@@ -396,6 +396,7 @@ const messages = {
396
396
  "errorMessages.builderAuthentication": "Builder a rejeté les identifiants connectés. Reconnectez Builder.io dans les paramètres, puis réessayez.",
397
397
  "errorMessages.builderModelUnauthorized": "Le fournisseur de ce modèle a rejeté la demande. Choisissez un autre modèle, puis réessayez.",
398
398
  "errorMessages.errorPrefix": "Erreur : {{message}}",
399
+ "errorMessages.gatewayInternalError": "La passerelle du modèle a rencontré une erreur interne avant que l'agent puisse répondre. Réessayez dans un instant et indiquez l'identifiant d'erreur ci-dessous si cela persiste.",
399
400
  "errorMessages.gatewayNoDetails": "La passerelle du modèle n’a fourni aucun détail sur l’erreur et la discussion n’a pas pu reprendre. Patientez un instant et réessayez. Si le problème persiste, démarrez une nouvelle discussion.",
400
401
  "errorMessages.inactivityTimeout": "La connexion à l’agent a expiré avant la fin. Vous pouvez poursuivre à partir du travail partiel ou réessayer.",
401
402
  "errorMessages.invalidToolSchema": "Le schéma d’un outil n’était pas valide. Le modèle a donc rejeté la demande avant son démarrage. Vous pouvez ignorer cet outil et réessayer.",
@@ -252,6 +252,7 @@ const messages = {
252
252
  "errorMessages.builderAuthentication": "Builder ने कनेक्ट किए गए क्रेडेंशियल अस्वीकार कर दिए। सेटिंग्स में Builder.io को दोबारा कनेक्ट करें, फिर से प्रयास करें।",
253
253
  "errorMessages.builderModelUnauthorized": "इस मॉडल के पीछे मौजूद प्रदाता ने अनुरोध अस्वीकार कर दिया। कोई दूसरा मॉडल चुनें, फिर से प्रयास करें।",
254
254
  "errorMessages.errorPrefix": "त्रुटि: {{message}}",
255
+ "errorMessages.gatewayInternalError": "एजेंट के उत्तर देने से पहले मॉडल गेटवे में एक आंतरिक त्रुटि आई। कुछ देर में फिर कोशिश करें, और बार-बार होने पर नीचे दिया गया error id बताएं।",
255
256
  "errorMessages.gatewayNoDetails": "मॉडल गेटवे ने त्रुटि का कोई विवरण नहीं दिया और चैट रिकवर नहीं हो सकी। कुछ देर रुककर फिर से प्रयास करें या समस्या बनी रहने पर नई चैट शुरू करें।",
256
257
  "errorMessages.inactivityTimeout": "एजेंट का कनेक्शन काम पूरा होने से पहले समय सीमा पर पहुँच गया। आप आंशिक काम से जारी रख सकते हैं या फिर से प्रयास कर सकते हैं।",
257
258
  "errorMessages.invalidToolSchema": "एक टूल स्कीमा अमान्य था, इसलिए मॉडल ने अनुरोध शुरू होने से पहले ही अस्वीकार कर दिया। अमान्य टूल को छोड़कर अनुरोध दोबारा किया जा सकता है।",
@@ -250,6 +250,7 @@ const messages = {
250
250
  "errorMessages.builderAuthentication": "Builder が接続済みの認証情報を拒否しました。設定で Builder.io に再接続してから再試行してください。",
251
251
  "errorMessages.builderModelUnauthorized": "このモデルのプロバイダーがリクエストを拒否しました。別のモデルを選択して再試行してください。",
252
252
  "errorMessages.errorPrefix": "エラー:{{message}}",
253
+ "errorMessages.gatewayInternalError": "エージェントが応答する前にモデルゲートウェイで内部エラーが発生しました。少し待ってから再試行し、繰り返す場合は下のエラー ID を伝えてください。",
253
254
  "errorMessages.gatewayNoDetails": "モデルゲートウェイからエラーの詳細が返されず、チャットを復旧できませんでした。少し待ってから再試行し、繰り返し発生する場合は新しいチャットを開始してください。",
254
255
  "errorMessages.inactivityTimeout": "エージェントとの接続が完了前にタイムアウトしました。途中までの作業から続行するか、再試行できます。",
255
256
  "errorMessages.invalidToolSchema": "ツールのスキーマが無効だったため、モデルは開始前にリクエストを拒否しました。無効なツールをスキップして再試行できます。",
@@ -250,6 +250,7 @@ const messages = {
250
250
  "errorMessages.builderAuthentication": "Builder가 연결된 자격 증명을 거부했습니다. 설정에서 Builder.io를 다시 연결한 후 다시 시도하세요.",
251
251
  "errorMessages.builderModelUnauthorized": "이 모델의 제공업체가 요청을 거부했습니다. 다른 모델을 선택한 후 다시 시도하세요.",
252
252
  "errorMessages.errorPrefix": "오류: {{message}}",
253
+ "errorMessages.gatewayInternalError": "에이전트가 답변하기 전에 모델 게이트웨이에서 내부 오류가 발생했습니다. 잠시 후 다시 시도하고, 계속 발생하면 아래 오류 ID를 알려 주세요.",
253
254
  "errorMessages.gatewayNoDetails": "모델 게이트웨이가 오류 세부 정보를 반환하지 않아 채팅을 복구할 수 없습니다. 잠시 후 다시 시도하고, 문제가 계속되면 새 채팅을 시작하세요.",
254
255
  "errorMessages.inactivityTimeout": "에이전트 연결이 완료 전에 시간 초과되었습니다. 부분적으로 완료된 작업에서 계속하거나 다시 시도할 수 있습니다.",
255
256
  "errorMessages.invalidToolSchema": "도구 스키마가 올바르지 않아 모델이 요청 시작 전에 거부했습니다. 올바르지 않은 도구를 건너뛰고 요청을 다시 시도할 수 있습니다.",
@@ -396,6 +396,7 @@ const messages = {
396
396
  "errorMessages.builderAuthentication": "O Builder rejeitou as credenciais conectadas. Reconecte Builder.io em Configurações e tente novamente.",
397
397
  "errorMessages.builderModelUnauthorized": "O provedor por trás deste modelo rejeitou a solicitação. Escolha um modelo diferente e tente novamente.",
398
398
  "errorMessages.errorPrefix": "Erro: {{message}}",
399
+ "errorMessages.gatewayInternalError": "O gateway do modelo teve um erro interno antes de o agente poder responder. Tente novamente em instantes e informe o id de erro abaixo se continuar acontecendo.",
399
400
  "errorMessages.gatewayNoDetails": "O gateway do modelo não retornou detalhes do erro, e o chat não pôde ser recuperado. Aguarde um momento e tente novamente. Se o problema persistir, inicie um novo chat.",
400
401
  "errorMessages.inactivityTimeout": "A conexão com o agente expirou antes da conclusão. Você pode continuar a partir do trabalho parcial ou tentar novamente.",
401
402
  "errorMessages.invalidToolSchema": "O esquema de uma ferramenta era inválido, então o modelo rejeitou a solicitação antes de iniciá-la. Você pode ignorar a ferramenta inválida e tentar novamente.",
@@ -250,6 +250,7 @@ const messages = {
250
250
  "errorMessages.builderAuthentication": "Builder 拒绝了已连接的凭据。请在设置中重新连接 Builder.io,然后重试。",
251
251
  "errorMessages.builderModelUnauthorized": "此模型背后的提供商拒绝了请求。请选择其他模型后重试。",
252
252
  "errorMessages.errorPrefix": "错误:{{message}}",
253
+ "errorMessages.gatewayInternalError": "模型网关在智能体作答前发生内部错误。请稍后重试;如果持续出现,请提供下方的错误 ID。",
253
254
  "errorMessages.gatewayNoDetails": "模型网关未返回错误详情,聊天无法恢复。请稍等片刻后重试;如果问题持续出现,请开始新聊天。",
254
255
  "errorMessages.inactivityTimeout": "智能体连接在完成前超时。您可以从已完成的部分继续,也可以重试。",
255
256
  "errorMessages.invalidToolSchema": "工具架构无效,因此模型在请求开始前拒绝了该请求。可以跳过无效工具并重试请求。",
@@ -250,6 +250,7 @@ const messages = {
250
250
  "errorMessages.builderAuthentication": "Builder 拒絕了已連線的憑證。請在設定中重新連線至 Builder.io,然後重試。",
251
251
  "errorMessages.builderModelUnauthorized": "這個模型背後的供應商拒絕了要求。請選擇其他模型後重試。",
252
252
  "errorMessages.errorPrefix": "錯誤:{{message}}",
253
+ "errorMessages.gatewayInternalError": "模型閘道在代理回答前發生內部錯誤。請稍後重試;若持續發生,請提供下方的錯誤 ID。",
253
254
  "errorMessages.gatewayNoDetails": "模型閘道未傳回錯誤詳細資訊,聊天無法復原。請稍候再試;如果問題持續發生,請開始新聊天。",
254
255
  "errorMessages.inactivityTimeout": "代理連線在完成前逾時。您可以從已完成的部分繼續,也可以重試。",
255
256
  "errorMessages.invalidToolSchema": "工具結構描述無效,因此模型在要求開始前便拒絕了要求。您可以略過無效工具並重試要求。",
@@ -254,6 +254,7 @@ export declare const englishAgentChatMessages: {
254
254
  readonly "errorMessages.builderAuthentication": "Builder rejected the connected credentials. Reconnect Builder.io in Settings, then retry.";
255
255
  readonly "errorMessages.builderModelUnauthorized": "The provider behind this model rejected the request. Pick a different model, then retry.";
256
256
  readonly "errorMessages.errorPrefix": "Error: {{message}}";
257
+ readonly "errorMessages.gatewayInternalError": "The model gateway hit an internal error before the agent could answer. Retry in a moment, and quote the error id below if it keeps happening.";
257
258
  readonly "errorMessages.gatewayNoDetails": "The model gateway returned no error details and the chat couldn't recover. Wait a moment and retry, or start a new chat if it keeps happening.";
258
259
  readonly "errorMessages.inactivityTimeout": "The agent connection timed out before it could finish. You can continue from the partial work or retry.";
259
260
  readonly "errorMessages.invalidToolSchema": "A tool schema was invalid, so the model rejected the request before it started. The invalid tool can be skipped and the request retried.";
@@ -41,27 +41,27 @@ export declare function createObservabilityHandler(): import("h3").EventHandlerW
41
41
  thumbsUpRate: number;
42
42
  avgEvalScore: number;
43
43
  } | {
44
- error?: undefined;
45
- ok?: undefined;
46
44
  summary: import("./types.js").TraceSummary;
47
45
  spans: import("./types.js").TraceSpan[];
48
46
  id?: undefined;
49
- } | {
50
47
  error?: undefined;
51
48
  ok?: undefined;
49
+ } | {
52
50
  summary?: undefined;
53
51
  spans?: undefined;
54
52
  id: string;
55
- } | {
53
+ error?: undefined;
56
54
  ok?: undefined;
55
+ } | {
57
56
  summary?: undefined;
58
57
  spans?: undefined;
59
58
  id?: undefined;
60
59
  error: any;
60
+ ok?: undefined;
61
61
  } | {
62
- error?: undefined;
63
62
  summary?: undefined;
64
63
  spans?: undefined;
65
64
  id?: undefined;
66
65
  ok: boolean;
66
+ error?: undefined;
67
67
  }>>;
@@ -34,37 +34,37 @@ export declare function createListSecretsHandler(): import("h3").EventHandlerWit
34
34
  /** POST /_agent-native/secrets/:key — write a secret. */
35
35
  export declare function createWriteSecretHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
36
36
  error: string;
37
- ok?: undefined;
38
37
  status?: undefined;
38
+ ok?: undefined;
39
39
  } | {
40
- error?: undefined;
41
40
  ok: boolean;
42
41
  status: string;
42
+ error?: undefined;
43
43
  } | {
44
- ok?: undefined;
45
44
  error: string;
46
45
  removed?: undefined;
46
+ ok?: undefined;
47
47
  } | {
48
- error?: undefined;
49
48
  ok: boolean;
50
49
  removed: boolean;
50
+ error?: undefined;
51
51
  }>>;
52
52
  /**
53
53
  * POST /_agent-native/secrets/:key/test — validate an optional candidate value
54
54
  * or the current stored value without changing anything.
55
55
  */
56
56
  export declare function createTestSecretHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
57
- ok?: undefined;
58
57
  error: string;
59
58
  note?: undefined;
59
+ ok?: undefined;
60
60
  } | {
61
- error?: undefined;
62
61
  ok: boolean;
63
62
  note?: undefined;
64
- } | {
65
63
  error?: undefined;
64
+ } | {
66
65
  ok: boolean;
67
66
  note: string;
67
+ error?: undefined;
68
68
  } | {
69
69
  note?: undefined;
70
70
  ok: boolean;
@@ -95,11 +95,11 @@ export interface AdHocSecretPayload {
95
95
  export declare function createAdHocSecretHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<AdHocSecretPayload[] | {
96
96
  error: string;
97
97
  } | {
98
- error?: undefined;
99
98
  ok: boolean;
100
99
  key: string;
101
- } | {
102
100
  error?: undefined;
101
+ } | {
103
102
  ok: boolean;
104
103
  removed: boolean;
104
+ error?: undefined;
105
105
  }>>;
@@ -27,10 +27,10 @@ export declare function resolveAgentEngineApiKeyWriteTarget(event: H3Event, scop
27
27
  export declare function createAgentEngineApiKeyHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
28
28
  error: any;
29
29
  } | {
30
- error?: undefined;
31
30
  ok: boolean;
32
31
  key: string;
33
32
  baseUrlKey?: string;
34
33
  scope: AgentEngineApiKeyScope;
34
+ error?: undefined;
35
35
  }>>;
36
36
  export {};
@@ -26,8 +26,8 @@ export declare function createRealtimeTokenHandler(): import("h3").EventHandlerW
26
26
  expiresAt?: undefined;
27
27
  ttlSeconds?: undefined;
28
28
  } | {
29
- error?: undefined;
30
29
  token: string;
31
30
  expiresAt: string;
32
31
  ttlSeconds: number;
32
+ error?: undefined;
33
33
  }>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/core",
3
- "version": "0.161.0",
3
+ "version": "0.161.1",
4
4
  "description": "Framework for agent-native application development — where AI agents and UI share SQL state, actions, and context",
5
5
  "homepage": "https://github.com/BuilderIO/agent-native#readme",
6
6
  "bugs": {