@segmentstream/agent 0.19.1 → 0.20.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 (48) hide show
  1. package/README.md +20 -0
  2. package/dist/_chunks/{build-metadata-CZ245Pl3.mjs → build-metadata-sfCL9qIC.mjs} +1 -1
  3. package/dist/_chunks/{inbound-request-Dx1B6Y5r.mjs → inbound-request-gJ5wpsBF.mjs} +5 -2
  4. package/dist/_chunks/{principal-BnJuWJtk.mjs → principal-DFcIfKSa.mjs} +1 -1
  5. package/dist/extension/hooks/authorization.mjs +1 -1
  6. package/dist/extension/lib/attachment-tools.mjs +1 -1
  7. package/dist/extension/lib/build-metadata.mjs +1 -1
  8. package/dist/extension/lib/confirmations.mjs +1 -1
  9. package/dist/extension/lib/conversation-runtime.mjs +14 -11
  10. package/dist/extension/lib/model-service-alert.d.ts +7 -0
  11. package/dist/extension/lib/model-service-alert.mjs +40 -0
  12. package/dist/extension/lib/model-service-failure.d.ts +4 -0
  13. package/dist/extension/lib/model-service-failure.mjs +38 -0
  14. package/dist/extension/lib/ontology-connection.mjs +1 -1
  15. package/dist/extension/lib/ontology-file-call.mjs +1 -1
  16. package/dist/extension/lib/ontology-tools.mjs +1 -1
  17. package/dist/extension/lib/runtime-envelope.mjs +1 -1
  18. package/dist/extension/lib/stored-files.mjs +1 -1
  19. package/dist/extension/lib/telegram/adapter.mjs +3 -3
  20. package/dist/extension/lib/telegram/attachment-description.mjs +1 -1
  21. package/dist/extension/lib/telegram/attachments-send.mjs +2 -2
  22. package/dist/extension/lib/telegram/callbacks.mjs +2 -2
  23. package/dist/extension/lib/telegram/confirmation-expiry.mjs +1 -1
  24. package/dist/extension/lib/telegram/confirmations.mjs +2 -2
  25. package/dist/extension/lib/telegram/conversations.mjs +1 -1
  26. package/dist/extension/lib/telegram/customer-text.d.ts +3 -1
  27. package/dist/extension/lib/telegram/customer-text.mjs +1 -1
  28. package/dist/extension/lib/telegram/deferred-confirmations.mjs +2 -2
  29. package/dist/extension/lib/telegram/durable-typing.mjs +1 -1
  30. package/dist/extension/lib/telegram/files.mjs +2 -2
  31. package/dist/extension/lib/telegram/health.mjs +1 -1
  32. package/dist/extension/lib/telegram/images.mjs +1 -1
  33. package/dist/extension/lib/telegram/inbound-request.mjs +1 -1
  34. package/dist/extension/lib/telegram/inbound.mjs +2 -2
  35. package/dist/extension/lib/telegram/lifecycle.mjs +3 -3
  36. package/dist/extension/lib/telegram/media-policy.mjs +1 -1
  37. package/dist/extension/lib/telegram/principal.mjs +1 -1
  38. package/dist/extension/lib/telegram/session-recovery.mjs +1 -1
  39. package/dist/extension/lib/telegram/silent.mjs +2 -2
  40. package/dist/extension/lib/telegram/structured.mjs +1 -1
  41. package/dist/extension/lib/telegram/texts.d.ts +1 -1
  42. package/dist/extension/lib/telegram/texts.mjs +2 -0
  43. package/dist/extension/lib/telegram/turn-errors.mjs +5 -4
  44. package/dist/extension/lib/telegram/voice.mjs +1 -1
  45. package/dist/extension/model.mjs +1 -1
  46. package/dist/extension/tools/attachments_promote.mjs +1 -1
  47. package/dist/extension/tools/questions_ask.mjs +1 -1
  48. package/package.json +2 -2
package/README.md CHANGED
@@ -648,6 +648,26 @@ Recovery applies only to session reads. Dispatch failures are never retried beca
648
648
  the inbox may already have accepted them. Other provider errors propagate to operator
649
649
  diagnostics. A group receives a failure notice only after routing selected a reply or
650
650
  a workspace hook acknowledged the task. Notice wording comes from workspace `texts.notice`.
651
+
652
+ Failed model calls with an explicit budget-exhaustion reason select optional
653
+ `texts.notice.modelBudgetExceeded`; known temporary provider failures (rate limits,
654
+ timeouts and unavailable services) select `texts.notice.modelUnavailable`. Both use
655
+ the usual locale fallback and then the existing failure notice (`failed` for turns,
656
+ `recovery` for session failures) when unconfigured. Supply
657
+ budget copy that explains that an administrator must restore the budget before
658
+ retrying, and temporary-outage copy that asks the member to wait before retrying.
659
+ Unknown model failures retain the ordinary notice; raw provider messages and hints
660
+ never become user-facing text. Session recovery failures use the same classification.
661
+
662
+ The conversation recorder also writes a `model_service_alert` decision for recognized
663
+ model service failures on every channel it can archive, including private HTTP sessions.
664
+ This durable operator alert contains only the safe category, failure code, retry policy
665
+ and ordinary event coordinates. A workspace-wide archive event key limits it to one
666
+ alert per category per UTC day, including across chats, concurrent workers and replays.
667
+ The first insert also emits `[segmentstream] model service alert` in runtime logs.
668
+ Per-turn diagnostics remain available; alerting failures do not replace the original
669
+ error. Read alerts with `segmentstream agent logs --query model_service_alert --all`.
670
+ This does not submit member feedback or send an operator chat message.
651
671
  See [the incident and verification procedure](../../docs/telegram-session-recovery.md).
652
672
 
653
673
  ### Opt-in attachment lifecycle
@@ -4,7 +4,7 @@ import { createRequire as __eveCreateRequire } from "node:module";
4
4
  const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
- var version = "0.19.1";
7
+ var version = "0.20.0";
8
8
  function agentBuild(environment = process.env) {
9
9
  return {
10
10
  agent: version,
@@ -33,6 +33,8 @@ function currentThreadId() {
33
33
  function customerCopy(locale = currentLocale()) {
34
34
  return {
35
35
  failed: telegramText("notice", "failed", locale),
36
+ modelBudgetExceeded: telegramText("notice", "modelBudgetExceeded", locale),
37
+ modelUnavailable: telegramText("notice", "modelUnavailable", locale),
36
38
  recovery: telegramText("notice", "recovery", locale),
37
39
  attachment: telegramText("notice", "attachment", locale),
38
40
  authorization: telegramText("notice", "authorization", locale),
@@ -60,8 +62,9 @@ function reportTelegramError(operation, error, metadata = {}, secrets = new Set(
60
62
  });
61
63
  return errorId;
62
64
  }
63
- function failureText(_errorId, kind = "failed", _locale = currentLocale()) {
64
- return customerCopy(_locale)[kind] ?? (kind === "cancelled" ? "⏹" : "⚠️");
65
+ function failureText(_errorId, kind = "failed", _locale = currentLocale(), fallback = "failed") {
66
+ const copy = customerCopy(_locale);
67
+ return copy[kind] ?? (kind === "modelBudgetExceeded" || kind === "modelUnavailable" ? copy[fallback] : void 0) ?? (kind === "cancelled" ? "⏹" : "⚠️");
65
68
  }
66
69
  function customerText(text, locale = currentLocale()) {
67
70
  if (!isTechnicalText(text)) return text;
@@ -4,7 +4,7 @@ import { createRequire as __eveCreateRequire } from "node:module";
4
4
  const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
- import { n as currentInboundRequest } from "./inbound-request-Dx1B6Y5r.mjs";
7
+ import { n as currentInboundRequest } from "./inbound-request-gJ5wpsBF.mjs";
8
8
  import { randomUUID } from "node:crypto";
9
9
  function telegramRuntimeSource(message, files, callbackQueryId) {
10
10
  const attachments = [];
@@ -5,7 +5,7 @@ const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
7
  import { localizedText } from "../lib/admission.mjs";
8
- import "../../_chunks/principal-BnJuWJtk.mjs";
8
+ import "../../_chunks/principal-DFcIfKSa.mjs";
9
9
  import { confirmationLocale } from "../lib/telegram/confirmation-text.mjs";
10
10
  import segmentstream from "../extension.mjs";
11
11
  import { defineHook } from "eve/hooks";
@@ -5,7 +5,7 @@ const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
7
  import { appOrigin } from "./environment.mjs";
8
- import { i as memberIdOf } from "../../_chunks/principal-BnJuWJtk.mjs";
8
+ import { i as memberIdOf } from "../../_chunks/principal-DFcIfKSa.mjs";
9
9
  import { runtimeToken } from "./runtime-token.mjs";
10
10
  import { agentAttachments } from "./attachments.mjs";
11
11
  import { telegramConversation } from "./telegram/files.mjs";
@@ -4,5 +4,5 @@ import { createRequire as __eveCreateRequire } from "node:module";
4
4
  const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
- import { t as agentBuild } from "../../_chunks/build-metadata-CZ245Pl3.mjs";
7
+ import { t as agentBuild } from "../../_chunks/build-metadata-sfCL9qIC.mjs";
8
8
  export { agentBuild };
@@ -5,7 +5,7 @@ const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
7
  import { withTelegramTexts } from "./telegram/texts.mjs";
8
- import { i as memberIdOf } from "../../_chunks/principal-BnJuWJtk.mjs";
8
+ import { i as memberIdOf } from "../../_chunks/principal-DFcIfKSa.mjs";
9
9
  import { confirmationCopy, confirmationLocale, renderConfirmation } from "./telegram/confirmation-text.mjs";
10
10
  import { chatPostCard } from "./telegram/chat-post-card.mjs";
11
11
  import { chatPostDigest, isChatPost } from "./chat-post-confirmation.mjs";
@@ -5,11 +5,12 @@ const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
7
  import { ENDS_CONVERSATION_INSTRUCTIONS } from "./group-routing/conversation-prompt.mjs";
8
- import { i as memberIdOf } from "../../_chunks/principal-BnJuWJtk.mjs";
8
+ import { i as memberIdOf } from "../../_chunks/principal-DFcIfKSa.mjs";
9
9
  import { n as contentText, t as CONTENT_CAPS } from "../../_chunks/content-cDtVnr8Y.mjs";
10
10
  import { conversationEvent, conversations, sessionFailureEventId, summarizeArguments } from "./conversations.mjs";
11
11
  import { parseAddress } from "./telegram/sessions.mjs";
12
12
  import { completionKind } from "./telegram/silent.mjs";
13
+ import { recordModelServiceAlert } from "./model-service-alert.mjs";
13
14
  import { decide } from "eve/ai";
14
15
  import { call } from "eve/events";
15
16
  function conversationCoordinates(context) {
@@ -105,16 +106,18 @@ function conversationRecorder(archive = conversations(), closing = async (messag
105
106
  resultText: contentText(event.data.output, CONTENT_CAPS.result),
106
107
  errorText: contentText(event.data.error?.message ?? (event.data.outcome === "failed" ? resultErrorMessage(event.data.output) : null), CONTENT_CAPS.error)
107
108
  }));
108
- } else if ((event.type === "turn.settled" || event.type === "model.settled" || event.type === "session.ended") && event.data.outcome === "failed") await archive.append(conversationEvent({
109
- ...base,
110
- eventId: event.type === "session.ended" ? sessionFailureEventId(context.session.id) : eventId,
111
- kind: "decision",
112
- decision: "silent",
113
- reason: event.type === "session.ended" ? "session.failed" : event.type,
114
- status: "failed",
115
- errorText: contentText(event.data.error?.message, CONTENT_CAPS.error)
116
- }));
117
- else if (event.type === "content.completed" && event.data.kind === "text" && event.data.phase === "reply" && !event.data.interrupted) {
109
+ } else if ((event.type === "turn.settled" || event.type === "model.settled" || event.type === "session.ended") && event.data.outcome === "failed") {
110
+ await archive.append(conversationEvent({
111
+ ...base,
112
+ eventId: event.type === "session.ended" ? sessionFailureEventId(context.session.id) : eventId,
113
+ kind: "decision",
114
+ decision: "silent",
115
+ reason: event.type === "session.ended" ? "session.failed" : event.type,
116
+ status: "failed",
117
+ errorText: contentText(event.data.error?.message, CONTENT_CAPS.error)
118
+ }));
119
+ if (event.type === "turn.settled" || event.type === "session.ended") await recordModelServiceAlert(archive, base, event.data.error);
120
+ } else if (event.type === "content.completed" && event.data.kind === "text" && event.data.phase === "reply" && !event.data.interrupted) {
118
121
  const message = typeof event.data.value === "string" ? event.data.value : "";
119
122
  const kind = completionKind(message);
120
123
  const silent = kind !== "reply";
@@ -0,0 +1,7 @@
1
+ import { type ConversationEvent, type Conversations } from "./conversations.js";
2
+ /**
3
+ * The archive is the durable operator alert. Its workspace-wide event key bounds repeated
4
+ * alerts to one per category per UTC day, across chats, workers and callback replays.
5
+ * Per-turn diagnostics remain separate. No prompt, provider payload or business data is copied.
6
+ */
7
+ export declare function recordModelServiceAlert(archive: Conversations, scope: Pick<ConversationEvent, "provider" | "chatId" | "chatType" | "threadId" | "participantIds" | "sessionId" | "turnId" | "at">, error: unknown): Promise<void>;
@@ -0,0 +1,40 @@
1
+ import { fileURLToPath as __eveFileURLToPath } from "node:url";
2
+ import { dirname as __eveDirname } from "node:path";
3
+ import { createRequire as __eveCreateRequire } from "node:module";
4
+ const __filename = __eveFileURLToPath(import.meta.url);
5
+ __eveDirname(__filename);
6
+ __eveCreateRequire(import.meta.url);
7
+ import { redactTelegramDiagnostic } from "./telegram/diagnostic-redaction.mjs";
8
+ import { conversationEvent } from "./conversations.mjs";
9
+ import { modelServiceFailure } from "./model-service-failure.mjs";
10
+ async function recordModelServiceAlert(archive, scope, error) {
11
+ const category = modelServiceFailure(error);
12
+ if (category === void 0) return;
13
+ const eventId = `agent:model-service-alert:${category}:${scope.at.slice(0, 10)}`;
14
+ const diagnostic = {
15
+ operation: "model_service_alert",
16
+ category,
17
+ code: "MODEL_CALL_FAILED",
18
+ retry: category === "modelBudgetExceeded" ? "after_budget_restored" : "later"
19
+ };
20
+ try {
21
+ if (await archive.append(conversationEvent({
22
+ ...scope,
23
+ eventId,
24
+ kind: "decision",
25
+ decision: "silent",
26
+ status: "failed",
27
+ reason: "model_service_alert",
28
+ argsSummary: JSON.stringify(diagnostic)
29
+ })) === true) console.error("[segmentstream] model service alert", {
30
+ eventId,
31
+ ...diagnostic
32
+ });
33
+ } catch (error) {
34
+ console.error("[segmentstream] model service alert archive unavailable", {
35
+ eventId,
36
+ error: redactTelegramDiagnostic(error)
37
+ });
38
+ }
39
+ }
40
+ export { recordModelServiceAlert };
@@ -0,0 +1,4 @@
1
+ /** Safe categories only: provider messages and retry hints never become customer copy. */
2
+ export type ModelServiceFailure = "modelBudgetExceeded" | "modelUnavailable";
3
+ /** Eve's normalized failure, including bounded cause chains retained in its details. */
4
+ export declare function modelServiceFailure(error: unknown): ModelServiceFailure | undefined;
@@ -0,0 +1,38 @@
1
+ import { fileURLToPath as __eveFileURLToPath } from "node:url";
2
+ import { dirname as __eveDirname } from "node:path";
3
+ import { createRequire as __eveCreateRequire } from "node:module";
4
+ const __filename = __eveFileURLToPath(import.meta.url);
5
+ __eveDirname(__filename);
6
+ __eveCreateRequire(import.meta.url);
7
+ function modelServiceFailure(error) {
8
+ const seen = new Set();
9
+ const messages = [];
10
+ let modelCall = false;
11
+ let unavailable = false;
12
+ function visit(value, depth) {
13
+ if (depth > 5 || value === null || typeof value !== "object" || seen.has(value)) return;
14
+ seen.add(value);
15
+ const failure = value;
16
+ modelCall ||= failure.code === "MODEL_CALL_FAILED";
17
+ unavailable ||= [
18
+ 408,
19
+ 429,
20
+ 500,
21
+ 502,
22
+ 503,
23
+ 504
24
+ ].includes(Number(failure.statusCode ?? failure.status));
25
+ if (typeof failure.message === "string") messages.push(failure.message.slice(0, 4e3));
26
+ for (const key of [
27
+ "cause",
28
+ "error",
29
+ "details",
30
+ "lastError"
31
+ ]) visit(failure[key], depth + 1);
32
+ }
33
+ visit(error, 0);
34
+ if (!modelCall) return;
35
+ if (messages.some((message) => /\bbudget\b.{0,60}\b(?:exceeded|exhausted)\b/iu.test(message) || /\b(?:exceeded|exhausted)\b.{0,60}\bbudget\b/iu.test(message))) return "modelBudgetExceeded";
36
+ if (unavailable || messages.some((message) => /\b(?:service|provider|temporarily) unavailable\b/iu.test(message) || /\b(?:overloaded|rate limit(?:ed)?|timed out|timeout)\b/iu.test(message))) return "modelUnavailable";
37
+ }
38
+ export { modelServiceFailure };
@@ -5,7 +5,7 @@ const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
7
  import { appOrigin } from "./environment.mjs";
8
- import { c as compatibleRuntimeEnvelope, i as memberIdOf, r as identityProviderOf, u as runtimeEnvelope } from "../../_chunks/principal-BnJuWJtk.mjs";
8
+ import { c as compatibleRuntimeEnvelope, i as memberIdOf, r as identityProviderOf, u as runtimeEnvelope } from "../../_chunks/principal-DFcIfKSa.mjs";
9
9
  import { runtimeToken, tokenExpiry } from "./runtime-token.mjs";
10
10
  import { CHAT_POST_ENVELOPE, chatPostDigest, chatPostOperationId, isChatPost } from "./chat-post-confirmation.mjs";
11
11
  import { actionApproval, confirmations } from "./confirmations.mjs";
@@ -4,7 +4,7 @@ import { createRequire as __eveCreateRequire } from "node:module";
4
4
  const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
- import { i as memberIdOf, u as runtimeEnvelope } from "../../_chunks/principal-BnJuWJtk.mjs";
7
+ import { i as memberIdOf, u as runtimeEnvelope } from "../../_chunks/principal-DFcIfKSa.mjs";
8
8
  import { isChatPost } from "./chat-post-confirmation.mjs";
9
9
  import { actionApproval, confirmations, inputHash } from "./confirmations.mjs";
10
10
  import { ontologyTools } from "./ontology-tools.mjs";
@@ -5,7 +5,7 @@ const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
7
  import { appOrigin } from "./environment.mjs";
8
- import { c as compatibleRuntimeEnvelope, i as memberIdOf, r as identityProviderOf, s as RUNTIME_SOURCE_PROTOCOL, u as runtimeEnvelope } from "../../_chunks/principal-BnJuWJtk.mjs";
8
+ import { c as compatibleRuntimeEnvelope, i as memberIdOf, r as identityProviderOf, s as RUNTIME_SOURCE_PROTOCOL, u as runtimeEnvelope } from "../../_chunks/principal-DFcIfKSa.mjs";
9
9
  import { redactDiagnostic } from "./diagnostics.mjs";
10
10
  import { describeConfirmation, object } from "./confirmation-description.mjs";
11
11
  import { runtimeToken } from "./runtime-token.mjs";
@@ -4,5 +4,5 @@ import { createRequire as __eveCreateRequire } from "node:module";
4
4
  const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
- import { c as compatibleRuntimeEnvelope, d as telegramRuntimeSource, l as principalRuntimeSource, s as RUNTIME_SOURCE_PROTOCOL, u as runtimeEnvelope } from "../../_chunks/principal-BnJuWJtk.mjs";
7
+ import { c as compatibleRuntimeEnvelope, d as telegramRuntimeSource, l as principalRuntimeSource, s as RUNTIME_SOURCE_PROTOCOL, u as runtimeEnvelope } from "../../_chunks/principal-DFcIfKSa.mjs";
8
8
  export { RUNTIME_SOURCE_PROTOCOL, compatibleRuntimeEnvelope, principalRuntimeSource, runtimeEnvelope, telegramRuntimeSource };
@@ -4,7 +4,7 @@ import { createRequire as __eveCreateRequire } from "node:module";
4
4
  const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
- import { i as memberIdOf } from "../../_chunks/principal-BnJuWJtk.mjs";
7
+ import { i as memberIdOf } from "../../_chunks/principal-DFcIfKSa.mjs";
8
8
  import { redactDiagnostic } from "./diagnostics.mjs";
9
9
  import { object } from "./confirmation-description.mjs";
10
10
  import { OntologyFileUnavailable, ontologyTools } from "./ontology-tools.mjs";
@@ -7,14 +7,14 @@ __eveCreateRequire(import.meta.url);
7
7
  import { telegramText, withTelegramTexts } from "./texts.mjs";
8
8
  import { manifestOf } from "../../config.mjs";
9
9
  import { appOrigin, channelsEnabled, proxyEnvironment, runtimeIdentityEnvironment, webhookSecret } from "../environment.mjs";
10
- import { n as conversationLanguage, o as telegramPrincipal } from "../../../_chunks/principal-BnJuWJtk.mjs";
10
+ import { n as conversationLanguage, o as telegramPrincipal } from "../../../_chunks/principal-DFcIfKSa.mjs";
11
11
  import { object } from "../confirmation-description.mjs";
12
12
  import { confirmationLocale } from "./confirmation-text.mjs";
13
13
  import { telegramSendScope } from "./send-queue.mjs";
14
14
  import { runtimeToken } from "../runtime-token.mjs";
15
15
  import { conversations } from "../conversations.mjs";
16
16
  import { withDeliveryDiagnostics } from "./delivery-diagnostics.mjs";
17
- import { d as failureText, h as withDeliveryLocale, i as withReplacedText, m as safeTelegramFetch, n as currentInboundRequest, o as currentLocale, p as reportTelegramError, r as runInboundRequest, t as InboundRequest } from "../../../_chunks/inbound-request-Dx1B6Y5r.mjs";
17
+ import { d as failureText, h as withDeliveryLocale, i as withReplacedText, m as safeTelegramFetch, n as currentInboundRequest, o as currentLocale, p as reportTelegramError, r as runInboundRequest, t as InboundRequest } from "../../../_chunks/inbound-request-gJ5wpsBF.mjs";
18
18
  import { chooseModel } from "../../model.mjs";
19
19
  import { groupRoutingHealth } from "../group-routing/health.mjs";
20
20
  import { decisionRouter } from "../group-routing/router.mjs";
@@ -23,7 +23,7 @@ import { MAXIMUM_DOWNLOAD_BYTES, connectionProxy } from "../connection-proxy.mjs
23
23
  import { dispatchStructuredMessage, structuredMessage } from "./structured.mjs";
24
24
  import { scopedAddress, sessionPolicy } from "./sessions.mjs";
25
25
  import { handleWorkspaceCallback, isWorkspaceCallback } from "./callbacks.mjs";
26
- import { t as agentBuild } from "../../../_chunks/build-metadata-CZ245Pl3.mjs";
26
+ import { t as agentBuild } from "../../../_chunks/build-metadata-sfCL9qIC.mjs";
27
27
  import { attachmentLifecycle } from "./lifecycle.mjs";
28
28
  import { observedMessages } from "./observed.mjs";
29
29
  import { expireDeferredCards, handleDeferredCallback, isDeferredCallback } from "./deferred-confirmations.mjs";
@@ -4,7 +4,7 @@ import { createRequire as __eveCreateRequire } from "node:module";
4
4
  const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
- import { p as reportTelegramError } from "../../../_chunks/inbound-request-Dx1B6Y5r.mjs";
7
+ import { p as reportTelegramError } from "../../../_chunks/inbound-request-gJ5wpsBF.mjs";
8
8
  import { describableImage } from "./images.mjs";
9
9
  import { MAXIMUM_ROUTING_PDF_CHARACTERS, extractRoutingPdf } from "./pdf-text.mjs";
10
10
  import { gateway, generateText } from "ai";
@@ -5,12 +5,12 @@ const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
7
  import { appOrigin, channelsEnabled, proxyEnvironment } from "../environment.mjs";
8
- import "../../../_chunks/principal-BnJuWJtk.mjs";
8
+ import "../../../_chunks/principal-DFcIfKSa.mjs";
9
9
  import { redactDiagnostic } from "../diagnostics.mjs";
10
10
  import { confirmationLocale } from "./confirmation-text.mjs";
11
11
  import { inTelegramSendQueue, telegramSendScope } from "./send-queue.mjs";
12
12
  import { runtimeToken } from "../runtime-token.mjs";
13
- import { d as failureText, f as formattingRefused, l as customerMessage, p as reportTelegramError } from "../../../_chunks/inbound-request-Dx1B6Y5r.mjs";
13
+ import { d as failureText, f as formattingRefused, l as customerMessage, p as reportTelegramError } from "../../../_chunks/inbound-request-gJ5wpsBF.mjs";
14
14
  import { MAXIMUM_PROXY_BODY_BYTES, connectionProxy } from "../connection-proxy.mjs";
15
15
  import { ACT_AS_HEADER } from "../ontology-connection.mjs";
16
16
  import { AttachmentError, CONVERSATION_HEADER, SESSION_HEADER } from "../attachments.mjs";
@@ -6,9 +6,9 @@ __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
7
  import { admitMessage } from "../admission.mjs";
8
8
  import { telegramText } from "./texts.mjs";
9
- import { d as telegramRuntimeSource, i as memberIdOf, o as telegramPrincipal, u as runtimeEnvelope } from "../../../_chunks/principal-BnJuWJtk.mjs";
9
+ import { d as telegramRuntimeSource, i as memberIdOf, o as telegramPrincipal, u as runtimeEnvelope } from "../../../_chunks/principal-DFcIfKSa.mjs";
10
10
  import { object } from "../confirmation-description.mjs";
11
- import { n as currentInboundRequest, p as reportTelegramError } from "../../../_chunks/inbound-request-Dx1B6Y5r.mjs";
11
+ import { n as currentInboundRequest, p as reportTelegramError } from "../../../_chunks/inbound-request-gJ5wpsBF.mjs";
12
12
  import { workspaceAction } from "./workspace-action.mjs";
13
13
  import { formatAddress, parseAddress, scopedAddress } from "./sessions.mjs";
14
14
  const isWorkspaceCallback = (data) => data?.startsWith("ws:") === true;
@@ -9,7 +9,7 @@ import { proxyEnvironment } from "../environment.mjs";
9
9
  import { telegramSendScope } from "./send-queue.mjs";
10
10
  import { runtimeToken } from "../runtime-token.mjs";
11
11
  import { conversations } from "../conversations.mjs";
12
- import { m as safeTelegramFetch, p as reportTelegramError } from "../../../_chunks/inbound-request-Dx1B6Y5r.mjs";
12
+ import { m as safeTelegramFetch, p as reportTelegramError } from "../../../_chunks/inbound-request-gJ5wpsBF.mjs";
13
13
  import { connectionProxy } from "../connection-proxy.mjs";
14
14
  import { deferredConfirmations } from "../deferred-confirmations.mjs";
15
15
  import { expireDeferredRecord } from "./deferred-confirmations.mjs";
@@ -5,12 +5,12 @@ const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
7
  import { telegramText } from "./texts.mjs";
8
- import { i as memberIdOf, o as telegramPrincipal } from "../../../_chunks/principal-BnJuWJtk.mjs";
8
+ import { i as memberIdOf, o as telegramPrincipal } from "../../../_chunks/principal-DFcIfKSa.mjs";
9
9
  import { humanText } from "../confirmation-description.mjs";
10
10
  import { renderConfirmation, withConfirmationText } from "./confirmation-text.mjs";
11
11
  import { chatPostCard, chatPostCardStatus, chatPostReceipt, withChatPostCard } from "./chat-post-card.mjs";
12
12
  import { conversationEvent } from "../conversations.mjs";
13
- import { n as currentInboundRequest, p as reportTelegramError } from "../../../_chunks/inbound-request-Dx1B6Y5r.mjs";
13
+ import { n as currentInboundRequest, p as reportTelegramError } from "../../../_chunks/inbound-request-gJ5wpsBF.mjs";
14
14
  import { agentMessage, observedChatKey, withConfirmationPrompt } from "../group-routing/observed.mjs";
15
15
  import { chatPostOperationId, isChatPost } from "../chat-post-confirmation.mjs";
16
16
  import { confirmations } from "../confirmations.mjs";
@@ -6,7 +6,7 @@ __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
7
  import { n as contentText, t as CONTENT_CAPS } from "../../../_chunks/content-cDtVnr8Y.mjs";
8
8
  import { conversationEvent, sessionFailureEventId } from "../conversations.mjs";
9
- import { n as currentInboundRequest, p as reportTelegramError, s as currentThreadId } from "../../../_chunks/inbound-request-Dx1B6Y5r.mjs";
9
+ import { n as currentInboundRequest, p as reportTelegramError, s as currentThreadId } from "../../../_chunks/inbound-request-gJ5wpsBF.mjs";
10
10
  import { currentConfirmationPrompt, observedChatKey } from "../group-routing/observed.mjs";
11
11
  import { archivedRoutingMessages } from "../group-routing/routing-context.mjs";
12
12
  import { contentShape, messageContent } from "./content.mjs";
@@ -6,6 +6,8 @@ export declare function currentLocale(): string;
6
6
  export declare function currentThreadId(): string | undefined;
7
7
  export declare function customerCopy(locale?: string): {
8
8
  failed: string | undefined;
9
+ modelBudgetExceeded: string | undefined;
10
+ modelUnavailable: string | undefined;
9
11
  recovery: string | undefined;
10
12
  attachment: string | undefined;
11
13
  authorization: string | undefined;
@@ -16,7 +18,7 @@ export declare function customerCopy(locale?: string): {
16
18
  };
17
19
  /** Original failures stay in operator diagnostics, joined to the public notice by a short reference. */
18
20
  export declare function reportTelegramError(operation: string, error: unknown, metadata?: Record<string, unknown>, secrets?: ReadonlySet<string>): string;
19
- export declare function failureText(_errorId: string, kind?: "failed" | "cancelled" | "recovery" | "attachment" | "authorization" | "response", _locale?: string): string;
21
+ export declare function failureText(_errorId: string, kind?: "failed" | "modelBudgetExceeded" | "modelUnavailable" | "cancelled" | "recovery" | "attachment" | "authorization" | "response", _locale?: string, fallback?: "failed" | "recovery"): string;
20
22
  export declare function customerText(text: string, locale?: string): string;
21
23
  /** Check what Telegram will display, including hidden link destinations, after removing markup. */
22
24
  export declare function customerMessage(text: string, locale?: string): TelegramText;
@@ -5,5 +5,5 @@ const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
7
  import { isTechnicalText } from "../customer-text-safety.mjs";
8
- import { a as TelegramDeliveryError, c as customerCopy, d as failureText, f as formattingRefused, h as withDeliveryLocale, l as customerMessage, m as safeTelegramFetch, o as currentLocale, p as reportTelegramError, s as currentThreadId, u as customerText } from "../../../_chunks/inbound-request-Dx1B6Y5r.mjs";
8
+ import { a as TelegramDeliveryError, c as customerCopy, d as failureText, f as formattingRefused, h as withDeliveryLocale, l as customerMessage, m as safeTelegramFetch, o as currentLocale, p as reportTelegramError, s as currentThreadId, u as customerText } from "../../../_chunks/inbound-request-gJ5wpsBF.mjs";
9
9
  export { TelegramDeliveryError, currentLocale, currentThreadId, customerCopy, customerMessage, customerText, failureText, formattingRefused, isTechnicalText, reportTelegramError, safeTelegramFetch, withDeliveryLocale };
@@ -5,12 +5,12 @@ const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
7
  import { telegramText, withTelegramLocale } from "./texts.mjs";
8
- import { o as telegramPrincipal } from "../../../_chunks/principal-BnJuWJtk.mjs";
8
+ import { o as telegramPrincipal } from "../../../_chunks/principal-DFcIfKSa.mjs";
9
9
  import { humanText } from "../confirmation-description.mjs";
10
10
  import { renderConfirmation, withConfirmationText } from "./confirmation-text.mjs";
11
11
  import { chatPostCard, chatPostCardStatus, chatPostReceipt, withChatPostCard } from "./chat-post-card.mjs";
12
12
  import { conversationEvent } from "../conversations.mjs";
13
- import { n as currentInboundRequest, p as reportTelegramError } from "../../../_chunks/inbound-request-Dx1B6Y5r.mjs";
13
+ import { n as currentInboundRequest, p as reportTelegramError } from "../../../_chunks/inbound-request-gJ5wpsBF.mjs";
14
14
  import { agentMessage, observedChatKey, withConfirmationPrompt } from "../group-routing/observed.mjs";
15
15
  import { CONFIRMATION_TTL_MS, inputHash } from "../confirmations.mjs";
16
16
  import { OntologyToolRejected } from "../ontology-tools.mjs";
@@ -8,7 +8,7 @@ import { channelsEnabled, proxyEnvironment } from "../environment.mjs";
8
8
  import { redactTelegramDiagnostic } from "./diagnostic-redaction.mjs";
9
9
  import { runtimeToken } from "../runtime-token.mjs";
10
10
  import { conversationEvent, conversations } from "../conversations.mjs";
11
- import { p as reportTelegramError } from "../../../_chunks/inbound-request-Dx1B6Y5r.mjs";
11
+ import { p as reportTelegramError } from "../../../_chunks/inbound-request-gJ5wpsBF.mjs";
12
12
  import { connectionProxy } from "../connection-proxy.mjs";
13
13
  import { sessions } from "eve/server";
14
14
  const object = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
@@ -4,8 +4,8 @@ import { createRequire as __eveCreateRequire } from "node:module";
4
4
  const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
- import { n as conversationLanguage } from "../../../_chunks/principal-BnJuWJtk.mjs";
8
- import { d as failureText, p as reportTelegramError } from "../../../_chunks/inbound-request-Dx1B6Y5r.mjs";
7
+ import { n as conversationLanguage } from "../../../_chunks/principal-DFcIfKSa.mjs";
8
+ import { d as failureText, p as reportTelegramError } from "../../../_chunks/inbound-request-gJ5wpsBF.mjs";
9
9
  import { describableImage, describeReceivedImage } from "./images.mjs";
10
10
  import { MAXIMUM_ATTACHMENT_BYTES, attachmentUrl } from "../attachments.mjs";
11
11
  function telegramConversation(chatId) {
@@ -4,7 +4,7 @@ import { createRequire as __eveCreateRequire } from "node:module";
4
4
  const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
- import { t as agentBuild } from "../../../_chunks/build-metadata-CZ245Pl3.mjs";
7
+ import { t as agentBuild } from "../../../_chunks/build-metadata-sfCL9qIC.mjs";
8
8
  import { runtimeRequestFailure } from "./runtime-request.mjs";
9
9
  import { GET } from "eve/channels";
10
10
  const HEALTH_ROUTE = "/eve/v1/telegram/health";
@@ -4,7 +4,7 @@ import { createRequire as __eveCreateRequire } from "node:module";
4
4
  const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
- import { p as reportTelegramError } from "../../../_chunks/inbound-request-Dx1B6Y5r.mjs";
7
+ import { p as reportTelegramError } from "../../../_chunks/inbound-request-gJ5wpsBF.mjs";
8
8
  import { gateway, generateText } from "ai";
9
9
  const MAXIMUM_IMAGE_DESCRIPTION_BYTES = 5242880;
10
10
  const MAXIMUM_NATIVE_IMAGE_BYTES = 3145728;
@@ -4,5 +4,5 @@ import { createRequire as __eveCreateRequire } from "node:module";
4
4
  const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
- import { i as withReplacedText, n as currentInboundRequest, r as runInboundRequest, t as InboundRequest } from "../../../_chunks/inbound-request-Dx1B6Y5r.mjs";
7
+ import { i as withReplacedText, n as currentInboundRequest, r as runInboundRequest, t as InboundRequest } from "../../../_chunks/inbound-request-gJ5wpsBF.mjs";
8
8
  export { InboundRequest, currentInboundRequest, runInboundRequest, withReplacedText };
@@ -6,8 +6,8 @@ __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
7
  import { effectiveGroupPolicy, groupPolicy } from "../group-routing/policy.mjs";
8
8
  import { admitMessage, localizedText } from "../admission.mjs";
9
- import { d as telegramRuntimeSource, n as conversationLanguage, o as telegramPrincipal, u as runtimeEnvelope } from "../../../_chunks/principal-BnJuWJtk.mjs";
10
- import { p as reportTelegramError } from "../../../_chunks/inbound-request-Dx1B6Y5r.mjs";
9
+ import { d as telegramRuntimeSource, n as conversationLanguage, o as telegramPrincipal, u as runtimeEnvelope } from "../../../_chunks/principal-DFcIfKSa.mjs";
10
+ import { p as reportTelegramError } from "../../../_chunks/inbound-request-gJ5wpsBF.mjs";
11
11
  import { addressingReason, conversationKey, otherRecipient } from "../group-routing/signals.mjs";
12
12
  import { conversationAddressing, conversationState } from "../group-routing/conversation.mjs";
13
13
  import { questionInvitation } from "../group-routing/engagement.mjs";
@@ -4,12 +4,12 @@ import { createRequire as __eveCreateRequire } from "node:module";
4
4
  const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
- import { d as telegramRuntimeSource, l as principalRuntimeSource, u as runtimeEnvelope } from "../../../_chunks/principal-BnJuWJtk.mjs";
7
+ import { d as telegramRuntimeSource, l as principalRuntimeSource, u as runtimeEnvelope } from "../../../_chunks/principal-DFcIfKSa.mjs";
8
8
  import { object } from "../confirmation-description.mjs";
9
- import { n as currentInboundRequest, p as reportTelegramError } from "../../../_chunks/inbound-request-Dx1B6Y5r.mjs";
9
+ import { n as currentInboundRequest, p as reportTelegramError } from "../../../_chunks/inbound-request-gJ5wpsBF.mjs";
10
10
  import { needsConfirmation } from "../confirmations.mjs";
11
11
  import { OntologyActionNotPermitted, actionToolName, ontologyTools } from "../ontology-tools.mjs";
12
- import { t as agentBuild } from "../../../_chunks/build-metadata-CZ245Pl3.mjs";
12
+ import { t as agentBuild } from "../../../_chunks/build-metadata-sfCL9qIC.mjs";
13
13
  var AttachmentLifecycleNotPermitted = class extends Error {
14
14
  code = "attachment_lifecycle_not_permitted";
15
15
  };
@@ -5,7 +5,7 @@ const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
7
  import { DEFAULT_IMAGE_DESCRIPTION_MODEL } from "../../config.mjs";
8
- import { p as reportTelegramError } from "../../../_chunks/inbound-request-Dx1B6Y5r.mjs";
8
+ import { p as reportTelegramError } from "../../../_chunks/inbound-request-gJ5wpsBF.mjs";
9
9
  function planMedia(capabilities, descriptionModel = null) {
10
10
  if (typeof descriptionModel === "string") return {
11
11
  images: "describe",
@@ -4,5 +4,5 @@ import { createRequire as __eveCreateRequire } from "node:module";
4
4
  const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
- import { a as rolesOf, i as memberIdOf, n as conversationLanguage, o as telegramPrincipal, r as identityProviderOf, t as TELEGRAM_AUTHENTICATOR } from "../../../_chunks/principal-BnJuWJtk.mjs";
7
+ import { a as rolesOf, i as memberIdOf, n as conversationLanguage, o as telegramPrincipal, r as identityProviderOf, t as TELEGRAM_AUTHENTICATOR } from "../../../_chunks/principal-DFcIfKSa.mjs";
8
8
  export { TELEGRAM_AUTHENTICATOR, conversationLanguage, identityProviderOf, memberIdOf, rolesOf, telegramPrincipal };
@@ -4,7 +4,7 @@ import { createRequire as __eveCreateRequire } from "node:module";
4
4
  const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
- import { p as reportTelegramError } from "../../../_chunks/inbound-request-Dx1B6Y5r.mjs";
7
+ import { p as reportTelegramError } from "../../../_chunks/inbound-request-gJ5wpsBF.mjs";
8
8
  import { createHash } from "node:crypto";
9
9
  function missingDeployment(error) {
10
10
  if (!(error instanceof Error) || error.name !== "RunKeyFetchError" || !("status" in error) || error.status !== 404) return false;
@@ -4,11 +4,11 @@ import { createRequire as __eveCreateRequire } from "node:module";
4
4
  const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
- import "../../../_chunks/principal-BnJuWJtk.mjs";
7
+ import "../../../_chunks/principal-DFcIfKSa.mjs";
8
8
  import { confirmationLocale } from "./confirmation-text.mjs";
9
9
  import { splitTelegramText } from "./format.mjs";
10
10
  import { inTelegramSendQueue } from "./send-queue.mjs";
11
- import { a as TelegramDeliveryError, l as customerMessage, o as currentLocale, p as reportTelegramError } from "../../../_chunks/inbound-request-Dx1B6Y5r.mjs";
11
+ import { a as TelegramDeliveryError, l as customerMessage, o as currentLocale, p as reportTelegramError } from "../../../_chunks/inbound-request-gJ5wpsBF.mjs";
12
12
  import { agentMessage, observedChatKey } from "../group-routing/observed.mjs";
13
13
  const SILENT_MARKERS = new Set(["[silent]", "no_reply"]);
14
14
  function isSilentReply(text) {
@@ -5,7 +5,7 @@ const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
7
  import { STRUCTURED_KINDS } from "./structured-settings.mjs";
8
- import { d as telegramRuntimeSource, u as runtimeEnvelope } from "../../../_chunks/principal-BnJuWJtk.mjs";
8
+ import { d as telegramRuntimeSource, u as runtimeEnvelope } from "../../../_chunks/principal-DFcIfKSa.mjs";
9
9
  import { workspaceAction } from "./workspace-action.mjs";
10
10
  const record = (value) => {
11
11
  if (value === null || typeof value !== "object" || Array.isArray(value)) throw new Error("Invalid structured Telegram object.");
@@ -3,7 +3,7 @@ export declare const TELEGRAM_TEXT_KEYS: {
3
3
  readonly callback: readonly ["error", "unknown", "forbidden", "expired", "already", "unsupported"];
4
4
  readonly confirmation: readonly ["question", "confirm", "cancel", "edit", "executing", "done", "cancelled", "failed", "expired", "interrupted"];
5
5
  readonly chatPost: readonly ["sent", "uncertain", "historyNotRecorded"];
6
- readonly notice: readonly ["failed", "recovery", "attachment", "authorization", "response", "connected", "disconnected", "cancelled"];
6
+ readonly notice: readonly ["failed", "modelBudgetExceeded", "modelUnavailable", "recovery", "attachment", "authorization", "response", "connected", "disconnected", "cancelled"];
7
7
  readonly authorization: readonly ["prompt", "url", "button"];
8
8
  };
9
9
  export type TelegramTexts = {
@@ -34,6 +34,8 @@ const TELEGRAM_TEXT_KEYS = {
34
34
  ],
35
35
  notice: [
36
36
  "failed",
37
+ "modelBudgetExceeded",
38
+ "modelUnavailable",
37
39
  "recovery",
38
40
  "attachment",
39
41
  "authorization",
@@ -5,11 +5,12 @@ const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
7
  import { telegramText } from "./texts.mjs";
8
- import { i as memberIdOf } from "../../../_chunks/principal-BnJuWJtk.mjs";
8
+ import { i as memberIdOf } from "../../../_chunks/principal-DFcIfKSa.mjs";
9
9
  import { confirmationLocale } from "./confirmation-text.mjs";
10
- import { c as customerCopy, d as failureText, o as currentLocale, p as reportTelegramError, s as currentThreadId } from "../../../_chunks/inbound-request-Dx1B6Y5r.mjs";
10
+ import { c as customerCopy, d as failureText, o as currentLocale, p as reportTelegramError, s as currentThreadId } from "../../../_chunks/inbound-request-gJ5wpsBF.mjs";
11
11
  import { recordSessionFailure } from "./conversations.mjs";
12
12
  import { isSilentRoutingCancellation } from "../group-routing/cancellation.mjs";
13
+ import { modelServiceFailure } from "../model-service-failure.mjs";
13
14
  function telegramFailureEvents(input) {
14
15
  return {
15
16
  async "interaction.opened"(fact, context) {
@@ -81,7 +82,7 @@ function telegramFailureEvents(input) {
81
82
  });
82
83
  return;
83
84
  }
84
- await channel.telegram.post(failureText(errorId, "failed", confirmationLocale(context.session.auth.current, currentLocale())));
85
+ await channel.telegram.post(failureText(errorId, modelServiceFailure(event.error) ?? "failed", confirmationLocale(context.session.auth.current, currentLocale())));
85
86
  },
86
87
  async "session.ended"(fact, context) {
87
88
  if (fact.data.outcome !== "failed") return;
@@ -104,7 +105,7 @@ function telegramFailureEvents(input) {
104
105
  failure: event
105
106
  });
106
107
  try {
107
- await channel.telegram.post(failureText(errorId, "recovery", locale));
108
+ await channel.telegram.post(failureText(errorId, modelServiceFailure(event) ?? "recovery", locale, "recovery"));
108
109
  } finally {
109
110
  await recorded;
110
111
  }
@@ -4,7 +4,7 @@ import { createRequire as __eveCreateRequire } from "node:module";
4
4
  const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
- import { p as reportTelegramError } from "../../../_chunks/inbound-request-Dx1B6Y5r.mjs";
7
+ import { p as reportTelegramError } from "../../../_chunks/inbound-request-gJ5wpsBF.mjs";
8
8
  import "../connection-proxy.mjs";
9
9
  import { gateway, transcribe } from "ai";
10
10
  const LABELS = {
@@ -5,7 +5,7 @@ const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
7
  import { isPreview } from "./lib/environment.mjs";
8
- import { a as rolesOf } from "../_chunks/principal-BnJuWJtk.mjs";
8
+ import { a as rolesOf } from "../_chunks/principal-DFcIfKSa.mjs";
9
9
  import { defineDynamic } from "eve";
10
10
  import { runs } from "eve/events";
11
11
  function chooseModel(input) {
@@ -4,7 +4,7 @@ import { createRequire as __eveCreateRequire } from "node:module";
4
4
  const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
- import { u as runtimeEnvelope } from "../../_chunks/principal-BnJuWJtk.mjs";
7
+ import { u as runtimeEnvelope } from "../../_chunks/principal-DFcIfKSa.mjs";
8
8
  import { n as workflowToolResult } from "../../_chunks/workflow-serializable-DU7WeCIW.mjs";
9
9
  import segmentstream from "../extension.mjs";
10
10
  import { actionApproval } from "../lib/confirmations.mjs";
@@ -4,7 +4,7 @@ import { createRequire as __eveCreateRequire } from "node:module";
4
4
  const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
- import { i as memberIdOf } from "../../_chunks/principal-BnJuWJtk.mjs";
7
+ import { i as memberIdOf } from "../../_chunks/principal-DFcIfKSa.mjs";
8
8
  import { n as workflowToolResult } from "../../_chunks/workflow-serializable-DU7WeCIW.mjs";
9
9
  import { pendingQuestions, questionKey } from "../lib/questions.mjs";
10
10
  import { stringArgument } from "../lib/attachment-tools.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@segmentstream/agent",
3
- "version": "0.19.1",
3
+ "version": "0.20.0",
4
4
  "description": "Mount a SegmentStream workspace's agent on eve: the ontology as tools, acting as the member who writes, and Telegram through the workspace's connection.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "SegmentStream",
@@ -66,7 +66,7 @@
66
66
  },
67
67
  "dependencies": {
68
68
  "@chat-adapter/telegram": "4.41.0",
69
- "@segmentstream-cloud/ontology": "0.61.0",
69
+ "@segmentstream-cloud/ontology": "0.61.1",
70
70
  "@vercel/oidc": "^3.8.4",
71
71
  "ai": "^7.0.137",
72
72
  "csv-parse": "^7.0.3",