@gemies/sdk 6.4.0 → 6.5.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @gemies/sdk
2
2
 
3
+ ## 6.5.0
4
+
5
+ - **A scheduled reply or task that ended without an answer reads as one.** The server stores it as
6
+ a typed failure (`{ type: 'failure', code: 'task_unfinished' }` in the message's content), and
7
+ the thread draws "%{name} couldn't finish this task." in the reader's language (`chat.taskUnfinished`),
8
+ never the run's own status line ("Token budget exhausted…").
9
+
3
10
  ## 6.4.0
4
11
 
5
12
  - **Stop no longer cancels an answer that had already finished.** The stop endpoint answers
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gemies/sdk",
3
- "version": "6.4.0",
3
+ "version": "6.5.0",
4
4
  "description": "The Gemies SDK: the conversation runtime, chat UI, voice calls and dictation for Oxy apps that talk to a gemie",
5
5
  "main": "src/index.ts",
6
6
  "react-native": "src/index.ts",
@@ -1,3 +1,4 @@
1
+ import { messageFailureOf } from '../../runtime/thread/message-failure';
1
2
  import { AgentProgress } from '@oxy.so/bloom/agent-progress';
2
3
  import { AgentReplyIdentity } from '@oxy.so/bloom/agent-reply';
3
4
  import {
@@ -557,6 +558,12 @@ function ReplyTurn({
557
558
  {t('chat.consultFailed', { name: agent.name })}
558
559
  </Text>
559
560
  ) : null}
561
+ {/* A requested run that ended with no answer: the app's words, never the run's. */}
562
+ {agent && messageFailureOf(message.content) === 'task_unfinished' ? (
563
+ <Text className="text-sm text-muted-foreground">
564
+ {t('chat.taskUnfinished', { name: agent.name })}
565
+ </Text>
566
+ ) : null}
560
567
  {bubbled ? (
561
568
  // Only the words are the bubble: the work log and the cards stay above it, whole.
562
569
  // Its turn actions are the icons beside it, so Bloom's own row under it is off.
@@ -121,6 +121,7 @@ export const COPY_EN: Readonly<Record<string, CopyEntry>> = {
121
121
  'chat.toolCard.scheduled': 'Scheduled',
122
122
  'chat.turnActions': 'Message actions',
123
123
  'chat.consultFailed': "%{name} couldn't answer.",
124
+ 'chat.taskUnfinished': "%{name} couldn't finish this task.",
124
125
  'chat.shareFailed': "Couldn't create the share link.",
125
126
  'chat.sharedFailed': "Couldn't load this conversation.",
126
127
  'chat.sharedGone': 'This shared conversation is no longer available.',
@@ -117,6 +117,7 @@ export const COPY_ES: Readonly<Record<string, CopyEntry>> = {
117
117
  'chat.toolCard.scheduled': 'Programada',
118
118
  'chat.turnActions': 'Acciones del mensaje',
119
119
  'chat.consultFailed': '%{name} no pudo responder.',
120
+ 'chat.taskUnfinished': '%{name} no ha podido terminar esta tarea.',
120
121
  'chat.shareFailed': 'No se pudo crear el enlace para compartir.',
121
122
  'chat.sharedFailed': 'No se pudo cargar esta conversación.',
122
123
  'chat.sharedGone': 'Esta conversación compartida ya no está disponible.',
@@ -0,0 +1,18 @@
1
+ import type { MessageContent } from '../types';
2
+
3
+ /**
4
+ * A gemie's own message that carries no words: a run the person asked for (a scheduled reply, a
5
+ * task) that ended without an answer. The server stores it as one `{ type: 'failure', code }` part
6
+ * (`packages/api/src/domain/conversation.ts`) and the thread draws it in the reader's language,
7
+ * never the run's status line.
8
+ */
9
+ export type MessageFailureCode = 'task_unfinished';
10
+
11
+ /** The failure a message is, when it is one. */
12
+ export function messageFailureOf(content: MessageContent): MessageFailureCode | null {
13
+ if (!Array.isArray(content)) return null;
14
+ for (const part of content) {
15
+ if (part.type === 'failure' && part.code === 'task_unfinished') return part.code;
16
+ }
17
+ return null;
18
+ }