@signalcore/ui 1.0.0-beta.2 → 1.0.0-beta.4

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 (99) hide show
  1. package/README.md +126 -21
  2. package/dist/AgentAbout.js +6 -2
  3. package/dist/AgentAbout.js.map +1 -1
  4. package/dist/AgentChat.d.ts +25 -3
  5. package/dist/AgentChat.js +302 -28
  6. package/dist/AgentChat.js.map +1 -1
  7. package/dist/AgentSpace.d.ts +25 -4
  8. package/dist/AgentSpace.js +55 -11
  9. package/dist/AgentSpace.js.map +1 -1
  10. package/dist/Threads.d.ts +73 -0
  11. package/dist/Threads.js +140 -0
  12. package/dist/Threads.js.map +1 -0
  13. package/dist/View.d.ts +48 -0
  14. package/dist/View.js +101 -0
  15. package/dist/View.js.map +1 -0
  16. package/dist/automation/marks.js +7 -3
  17. package/dist/automation/marks.js.map +1 -1
  18. package/dist/automation/messages.d.ts +4 -0
  19. package/dist/automation/messages.js +5 -1
  20. package/dist/automation/messages.js.map +1 -1
  21. package/dist/automation/when.js +8 -0
  22. package/dist/automation/when.js.map +1 -1
  23. package/dist/blocks.d.ts +83 -2
  24. package/dist/client.d.ts +23 -5
  25. package/dist/client.js +8 -2
  26. package/dist/client.js.map +1 -1
  27. package/dist/contract.d.ts +9 -4
  28. package/dist/es.d.ts +2 -0
  29. package/dist/es.js +34 -3
  30. package/dist/es.js.map +1 -1
  31. package/dist/frames.d.ts +7 -1
  32. package/dist/frames.js.map +1 -1
  33. package/dist/index.d.ts +14 -7
  34. package/dist/index.js +11 -4
  35. package/dist/kit/Agenda.d.ts +25 -0
  36. package/dist/kit/Agenda.js +119 -0
  37. package/dist/kit/Agenda.js.map +1 -0
  38. package/dist/kit/Combobox.js +1 -1
  39. package/dist/kit/DateField.js +1 -1
  40. package/dist/kit/Kanban.d.ts +17 -0
  41. package/dist/kit/Kanban.js +157 -0
  42. package/dist/kit/Kanban.js.map +1 -0
  43. package/dist/kit/TimeField.js +1 -1
  44. package/dist/kit/Timeline.d.ts +14 -0
  45. package/dist/kit/Timeline.js +71 -0
  46. package/dist/kit/Timeline.js.map +1 -0
  47. package/dist/kit/context.d.ts +1 -1
  48. package/dist/kit/context.js.map +1 -1
  49. package/dist/kit/messages.d.ts +22 -0
  50. package/dist/kit/messages.js +10 -0
  51. package/dist/kit/messages.js.map +1 -1
  52. package/dist/surface/Form.js +1 -1
  53. package/dist/surface/Placed.d.ts +20 -0
  54. package/dist/surface/Placed.js +70 -0
  55. package/dist/surface/Placed.js.map +1 -0
  56. package/dist/surface/Surface.d.ts +4 -2
  57. package/dist/surface/Surface.js +78 -2
  58. package/dist/surface/Surface.js.map +1 -1
  59. package/dist/surface/places.d.ts +16 -0
  60. package/dist/surface/places.js +15 -0
  61. package/dist/surface/places.js.map +1 -0
  62. package/dist/surface/scope.d.ts +17 -1
  63. package/dist/surface/scope.js +1 -0
  64. package/dist/surface/scope.js.map +1 -1
  65. package/dist/types.d.ts +23 -0
  66. package/dist/types.js.map +1 -1
  67. package/dist/useConversation.d.ts +2 -0
  68. package/dist/useConversation.js +16 -0
  69. package/dist/useConversation.js.map +1 -1
  70. package/dist/widget.js +17 -16
  71. package/package.json +1 -1
  72. package/src/AgentAbout.tsx +4 -0
  73. package/src/AgentChat.tsx +417 -34
  74. package/src/AgentSpace.tsx +106 -14
  75. package/src/Threads.tsx +218 -0
  76. package/src/View.tsx +117 -0
  77. package/src/automation/marks.tsx +7 -0
  78. package/src/automation/messages.ts +8 -0
  79. package/src/automation/when.ts +4 -0
  80. package/src/blocks.ts +100 -2
  81. package/src/client.ts +42 -10
  82. package/src/contract.ts +404 -29
  83. package/src/es.ts +30 -0
  84. package/src/frames.ts +3 -1
  85. package/src/index.ts +36 -3
  86. package/src/kit/Agenda.tsx +161 -0
  87. package/src/kit/Kanban.tsx +182 -0
  88. package/src/kit/Timeline.tsx +58 -0
  89. package/src/kit/context.tsx +45 -1
  90. package/src/kit/messages.ts +31 -0
  91. package/src/styles.css +825 -66
  92. package/src/surface/Placed.tsx +98 -0
  93. package/src/surface/Surface.tsx +92 -1
  94. package/src/surface/places.ts +19 -0
  95. package/src/surface/scope.ts +24 -1
  96. package/src/types.ts +24 -0
  97. package/src/useConversation.ts +10 -0
  98. package/src/widget/element.tsx +54 -7
  99. package/src/widget/widget.css +13 -0
@@ -76,7 +76,7 @@ export interface FactAsk {
76
76
  export interface FactAutomation {
77
77
  id: string;
78
78
  name: string;
79
- kind: "schedule" | "webhook" | "event" | "platform";
79
+ kind: "schedule" | "webhook" | "event" | "platform" | "manual" | "after";
80
80
  title: string;
81
81
  summary: string;
82
82
  schedule: string | null;
@@ -156,7 +156,7 @@ export interface RunDetailOut {
156
156
  agent_id: string;
157
157
  automation: string;
158
158
  title: string;
159
- by: "schedule" | "webhook" | "event" | "platform" | "agent" | "test";
159
+ by: "schedule" | "webhook" | "event" | "platform" | "agent" | "test" | "api" | "after";
160
160
  conversation_id: string | null;
161
161
  status: "running" | "waiting" | "done" | "failed" | "skipped";
162
162
  summary: string | null;
@@ -168,6 +168,8 @@ export interface RunDetailOut {
168
168
  tokens_out: number;
169
169
  opened: Array<string>;
170
170
  decision?: RunsDecisionOut | null;
171
+ result?: unknown;
172
+ contact_id?: string | null;
171
173
  steps: Array<RunStepOut>;
172
174
  }
173
175
  export interface RunOut {
@@ -175,7 +177,7 @@ export interface RunOut {
175
177
  agent_id: string;
176
178
  automation: string;
177
179
  title: string;
178
- by: "schedule" | "webhook" | "event" | "platform" | "agent" | "test";
180
+ by: "schedule" | "webhook" | "event" | "platform" | "agent" | "test" | "api" | "after";
179
181
  conversation_id: string | null;
180
182
  status: "running" | "waiting" | "done" | "failed" | "skipped";
181
183
  summary: string | null;
@@ -187,6 +189,8 @@ export interface RunOut {
187
189
  tokens_out: number;
188
190
  opened: Array<string>;
189
191
  decision?: RunsDecisionOut | null;
192
+ result?: unknown;
193
+ contact_id?: string | null;
190
194
  }
191
195
  export interface RunStepOut {
192
196
  seq: number;
@@ -240,7 +244,7 @@ export interface TaskOut {
240
244
  last_run: RunOut | null;
241
245
  }
242
246
  export interface TriggerView {
243
- kind: "schedule" | "webhook" | "event" | "platform";
247
+ kind: "schedule" | "webhook" | "event" | "platform" | "manual" | "after";
244
248
  schedule: string | null;
245
249
  timezone: string | null;
246
250
  url: string | null;
@@ -251,6 +255,7 @@ export interface TriggerView {
251
255
  icon: string | null;
252
256
  decides?: boolean;
253
257
  channels?: Array<string>;
258
+ after?: string | null;
254
259
  }
255
260
  export interface Use {
256
261
  kind: "app" | "ai" | "agent" | "notify" | "send" | "data" | "http";
package/dist/es.d.ts CHANGED
@@ -3,6 +3,7 @@ import { KitMessages } from "./kit/messages.js";
3
3
  import { TaskMessages } from "./AgentTasks.js";
4
4
  import { BrowserMessages } from "./BrowserView.js";
5
5
  import { ChatMessages } from "./AgentChat.js";
6
+ import { ThreadMessages } from "./Threads.js";
6
7
  import { VoiceCallMessages } from "./VoiceCall.js";
7
8
  import { SpaceMessages } from "./AgentSpace.js";
8
9
  //#region src/es.d.ts
@@ -12,6 +13,7 @@ export declare const BROWSER_MESSAGES_ES: BrowserMessages;
12
13
  export declare const CHAT_MESSAGES_ES: ChatMessages;
13
14
  export declare const VOICE_CALL_MESSAGES_ES: VoiceCallMessages;
14
15
  export declare const TASK_MESSAGES_ES: TaskMessages;
16
+ export declare const THREAD_MESSAGES_ES: ThreadMessages;
15
17
  export declare const SPACE_MESSAGES_ES: SpaceMessages;
16
18
  //#endregion
17
19
  //# sourceMappingURL=es.d.ts.map
package/dist/es.js CHANGED
@@ -41,6 +41,8 @@ const AUTOMATION_MESSAGES_ES = {
41
41
  on: (often, when) => `${often}, ${when.charAt(0).toLowerCase()}${when.slice(1)}`,
42
42
  custom: "Con un horario propio",
43
43
  webhook: "Cuando otro sistema la llama",
44
+ manual: "Cuando alguien la inicia",
45
+ after: (automation) => automation ? `Tras «${automation}»` : "Tras otra automatización",
44
46
  platform: "Cuando llega un mensaje",
45
47
  event: (app, event) => event ? `Cuando pasa «${event}» en ${app ?? "una app"}` : `Cuando pasa algo en ${app ?? "una app"}`,
46
48
  next: (day, time) => [
@@ -81,7 +83,9 @@ const AUTOMATION_MESSAGES_ES = {
81
83
  event: app ? `evento de ${app}` : "evento",
82
84
  platform: "un mensaje",
83
85
  agent: "se lo pidieron en el chat",
84
- test: "prueba"
86
+ test: "prueba",
87
+ api: "tu app",
88
+ after: "tras otra"
85
89
  })[by],
86
90
  statuses: {
87
91
  running: "En curso",
@@ -187,6 +191,16 @@ const KIT_MESSAGES_ES = {
187
191
  connected: "Conectada",
188
192
  failed: "No se ha podido conectar",
189
193
  preparing: "Preparando la conexión"
194
+ },
195
+ calendar: {
196
+ allDay: "Todo el día",
197
+ empty: "Nada previsto"
198
+ },
199
+ board: {
200
+ move: (card) => `Mover ${card}`,
201
+ moveTo: "Mover a",
202
+ moved: (card, column) => `${card} a ${column}`,
203
+ empty: "Nada aquí"
190
204
  }
191
205
  };
192
206
  const BROWSER_MESSAGES_ES = {
@@ -267,8 +281,14 @@ const CHAT_MESSAGES_ES = {
267
281
  inputs: {},
268
282
  allow: "Aprobar",
269
283
  decline: "Rechazar",
284
+ approvals: (count) => `${count} acciones esperan tu aprobación`,
285
+ approveAll: "Aprobar todo",
286
+ approveSome: (count) => `Aprobar ${count}`,
287
+ declineAll: "Rechazar todo",
270
288
  confirming: "Esperando la confirmación del negocio",
271
289
  handedOff: "Pasada a una persona",
290
+ opened: (name, title) => `${name} abrió ${title}`,
291
+ closePlaced: "Cerrar",
272
292
  handover: (holder, by, name) => {
273
293
  const automation = by.kind === "automation" ? ` por «${by.title}»` : "";
274
294
  switch (holder) {
@@ -368,6 +388,16 @@ const TASK_MESSAGES_ES = {
368
388
  empty: "No hay nada programado. Pídele que te recuerde algo, o que te escriba más adelante.",
369
389
  failed: "No se ha podido cambiar. Inténtalo de nuevo."
370
390
  };
391
+ const THREAD_MESSAGES_ES = {
392
+ open: "Conversaciones",
393
+ title: "Tus conversaciones",
394
+ back: "Volver a la conversación",
395
+ new: "Nueva conversación",
396
+ untitled: "Conversación nueva",
397
+ unread: (count) => count === 1 ? "1 mensaje sin leer" : `${count} mensajes sin leer`,
398
+ waiting: "Te espera",
399
+ empty: "Aún no hay nada aquí."
400
+ };
371
401
  const SPACE_MESSAGES_ES = {
372
402
  modes: {
373
403
  label: "Modo",
@@ -382,9 +412,10 @@ const SPACE_MESSAGES_ES = {
382
412
  retry: "Reintentar",
383
413
  chat: CHAT_MESSAGES_ES,
384
414
  voice: VOICE_CALL_MESSAGES_ES,
385
- tasks: TASK_MESSAGES_ES
415
+ tasks: TASK_MESSAGES_ES,
416
+ threads: THREAD_MESSAGES_ES
386
417
  };
387
418
  //#endregion
388
- export { AUTOMATION_MESSAGES_ES, BROWSER_MESSAGES_ES, CHAT_MESSAGES_ES, KIT_MESSAGES_ES, SPACE_MESSAGES_ES, TASK_MESSAGES_ES, VOICE_CALL_MESSAGES_ES };
419
+ export { AUTOMATION_MESSAGES_ES, BROWSER_MESSAGES_ES, CHAT_MESSAGES_ES, KIT_MESSAGES_ES, SPACE_MESSAGES_ES, TASK_MESSAGES_ES, THREAD_MESSAGES_ES, VOICE_CALL_MESSAGES_ES };
389
420
 
390
421
  //# sourceMappingURL=es.js.map
package/dist/es.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"es.js","names":[],"sources":["../src/es.ts"],"sourcesContent":["/**\n * The package's words in Spanish, for the people an agent serves: the chat, the browser it drives,\n * the kit's controls (with an automation's and its runs'), a call and the agent's space. English\n * is every component's default; a host in Spanish passes these as `messages`, the calendar's\n * language as `locale` (`import { es } from \"@signalcore/ui/locale\"`).\n */\nimport type { ChatMessages } from \"./AgentChat\";\nimport type { SpaceMessages } from \"./AgentSpace\";\nimport type { TaskMessages } from \"./AgentTasks\";\nimport type { AutomationMessages, DayRef } from \"./automation/messages\";\nimport type { BrowserMessages } from \"./BrowserView\";\nimport type { KitMessages } from \"./kit/messages\";\nimport type { VoiceCallMessages } from \"./VoiceCall\";\n\n/** The article before a time: \"la 1:00\", \"las 8:00\". */\nconst at = (time: string): string => `a ${time.startsWith(\"1:\") ? \"la\" : \"las\"} ${time}`;\n\nconst list = (items: readonly string[]): string => new Intl.ListFormat(\"es\").format(items);\n\n/** A weekday as the plural says it: \"los lunes\", \"los sábados\". */\nconst days = (name: string): string => (name.endsWith(\"s\") ? name : `${name}s`);\n\nconst capital = (text: string): string => text.charAt(0).toUpperCase() + text.slice(1);\n\n/** A day said after \"próxima\": \"hoy\", \"mañana\", \"el lunes\", \"el 3 nov\". */\nfunction nextDay(day: DayRef): string {\n switch (day.kind) {\n case \"today\":\n return \"hoy\";\n case \"tomorrow\":\n return \"mañana\";\n case \"yesterday\":\n return \"\";\n default:\n return `el ${day.name}`;\n }\n}\n\n/** A message sent on a channel, by the channel's kind: \"un WhatsApp\", \"un SMS\". */\nconst SENT: Readonly<Record<string, string>> = {\n whatsapp: \"un WhatsApp\",\n instagram: \"un mensaje de Instagram\",\n sms: \"un SMS\",\n};\n\n/** What an automation's tool call did, by what the tool's name says, done or (a test) not. */\nconst TOOL = {\n search: [(app: string) => `Buscó en ${app}`, (app: string) => `Buscó en ${app}`],\n send: [(app: string) => `Envió por ${app}`, (app: string) => `Habría enviado por ${app}`],\n create: [(app: string) => `Creó en ${app}`, (app: string) => `Habría creado en ${app}`],\n update: [(app: string) => `Cambió en ${app}`, (app: string) => `Habría cambiado en ${app}`],\n remove: [(app: string) => `Borró en ${app}`, (app: string) => `Habría borrado en ${app}`],\n use: [(app: string) => `Usó ${app}`, (app: string) => `Habría usado ${app}`],\n} as const;\n\nexport const AUTOMATION_MESSAGES_ES: AutomationMessages = {\n daily: \"Cada día\",\n weekdays: \"Cada día laborable\",\n weekends: \"Los fines de semana\",\n weekly: (names) =>\n names.length === 1 ? `Cada ${names[0] ?? \"\"}` : `Los ${list(names.map(days))}`,\n monthly: (numbers) =>\n numbers.length === 1\n ? `El día ${numbers[0] ?? \"\"} de cada mes`\n : `Los días ${list(numbers.map(String))} de cada mes`,\n at: (times) => list(times.map(at)),\n every: (count, unit) =>\n unit === \"minute\"\n ? count === 1\n ? \"Cada minuto\"\n : `Cada ${count} minutos`\n : count === 1\n ? \"Cada hora\"\n : `Cada ${count} horas`,\n between: (from, to) => `de ${from} a ${to}`,\n on: (often, when) => `${often}, ${when.charAt(0).toLowerCase()}${when.slice(1)}`,\n custom: \"Con un horario propio\",\n webhook: \"Cuando otro sistema la llama\",\n platform: \"Cuando llega un mensaje\",\n event: (app, event) =>\n event\n ? `Cuando pasa «${event}» en ${app ?? \"una app\"}`\n : `Cuando pasa algo en ${app ?? \"una app\"}`,\n next: (day, time) =>\n [\"próxima\", nextDay(day), time === null ? \"\" : at(time)].filter(Boolean).join(\" \"),\n states: { active: \"Activa\", paused: \"En pausa\", failing: \"Falló la última\" },\n switchLabel: \"Activa\",\n steps: \"Pasos\",\n runs: \"Ejecuciones\",\n noRuns: \"Aún no se ha ejecutado.\",\n uses: {\n ai: \"IA\",\n agent: \"Agente\",\n notify: \"Aviso\",\n send: \"Mensaje\",\n data: \"Tabla\",\n http: \"Web\",\n },\n more: (count) => `+${count}`,\n gone: \"Esta automatización ya no existe.\",\n moment: (day, time) => {\n switch (day.kind) {\n case \"today\":\n return `Hoy ${time}`;\n case \"yesterday\":\n return `Ayer ${time}`;\n case \"tomorrow\":\n return `Mañana ${time}`;\n default:\n return `${capital(day.name)} ${time}`;\n }\n },\n by: (by, app) =>\n ({\n schedule: \"horario\",\n webhook: \"webhook\",\n event: app ? `evento de ${app}` : \"evento\",\n platform: \"un mensaje\",\n agent: \"se lo pidieron en el chat\",\n test: \"prueba\",\n })[by],\n statuses: {\n running: \"En curso\",\n waiting: \"Esperando\",\n done: \"Hecha\",\n failed: \"Falló\",\n skipped: \"Omitida\",\n },\n dry: (summary) => `Prueba: ${summary}`,\n took: (ms) => {\n if (ms < 1000) return \"menos de 1 s\";\n const seconds = Math.round(ms / 1000);\n return seconds < 60 ? `${seconds} s` : `${Math.floor(seconds / 60)} min ${seconds % 60} s`;\n },\n opened: \"Conversaciones que abrió\",\n conversation: (index) => `Conversación ${index}`,\n askedIn: \"La conversación donde se lo pidieron\",\n noCalls: \"No llegó a hacer nada.\",\n outside: \"Fuera de los pasos\",\n times: (count) => `×${count}`,\n calls: {\n tool: (verb, app, would) => TOOL[verb][would ? 1 : 0](app),\n ai: \"Usó la IA\",\n notify: (would) => (would ? \"Habría avisado en la bandeja\" : \"Avisó en la bandeja\"),\n send: (channel, to, would) => {\n const sent = `${SENT[channel ?? \"\"] ?? \"un mensaje\"} a ${to || \"un contacto\"}`;\n return would ? `Habría enviado ${sent}` : `Envió ${sent}`;\n },\n start: (would) => (would ? \"Habría abierto una conversación\" : \"Abrió una conversación\"),\n find: (table) => `Consultó ${table}`,\n add: (table, would) =>\n would ? `Habría añadido una fila a ${table}` : `Añadió una fila a ${table}`,\n change: (table, would) =>\n would ? `Habría cambiado una fila de ${table}` : `Cambió una fila de ${table}`,\n http: (host, would) => (would ? `Habría llamado a ${host}` : `Llamó a ${host}`),\n files: \"Buscó en los archivos\",\n read: (file) => `Leyó ${file}`,\n wrote: (file, would) => (would ? `Habría guardado ${file}` : `Guardó ${file}`),\n listed: \"Miró sus archivos\",\n remember: (would) => (would ? \"Habría guardado un recuerdo\" : \"Guardó un recuerdo\"),\n recall: \"Buscó en lo aprendido\",\n },\n};\n\nconst FAMILIES: Readonly<Record<string, string>> = {\n image: \"imágenes\",\n video: \"vídeos\",\n audio: \"audios\",\n text: \"textos\",\n};\n\nexport const KIT_MESSAGES_ES: KitMessages = {\n required: \"Este campo es obligatorio\",\n chooseDate: \"Elige un día\",\n chooseTime: \"Elige una hora\",\n chooseMoment: \"Elige día y hora\",\n chooseOption: \"Elige una opción\",\n other: \"Otra respuesta\",\n otherPlaceholder: \"Escribe tu respuesta\",\n chooseRating: \"Elige una puntuación\",\n check: \"Marca la casilla para seguir\",\n invalidEmail: \"Correo no válido\",\n invalidPhone: \"Teléfono no válido\",\n invalidUrl: \"Dirección no válida\",\n invalidNumber: \"Escribe un número\",\n invalidTime: \"Escribe la hora así: 9:30\",\n atLeast: (min) => `Como mínimo ${min}`,\n atMost: (max) => `Como máximo ${max}`,\n unavailableDate: \"Ese día no está disponible\",\n unavailableTime: \"Esa hora no está disponible\",\n optional: \"Opcional\",\n pick: \"Elige…\",\n search: \"Buscar…\",\n noResults: \"Sin resultados\",\n show: \"Mostrar\",\n hide: \"Ocultar\",\n increase: \"Sumar\",\n decrease: \"Restar\",\n remove: (label) => `Quitar ${label}`,\n yes: \"Sí\",\n no: \"No\",\n rated: (value, max) => `${value} de ${max}`,\n stars: (count) => (count === 1 ? \"1 estrella\" : `${count} estrellas`),\n send: \"Enviar\",\n sent: \"Enviado\",\n chooseFile: \"Falta el archivo\",\n upload: (multiple) => (multiple ? \"Sube archivos\" : \"Sube un archivo\"),\n drop: \"Suelta aquí o elige\",\n limits: (kinds, size) => (kinds ? `${kinds}, hasta ${size}` : `Hasta ${size}`),\n anyOf: (family) => FAMILIES[family] ?? family,\n uploading: \"Subiendo\",\n tooBig: (size) => `Pasa de ${size}`,\n wrongType: \"Aquí no vale este tipo de archivo\",\n tooMany: (max) => `Como máximo ${max} archivos`,\n uploadFailed: \"No se ha podido subir\",\n retry: \"Reintentar\",\n stillUploading: \"Espera a que termine de subir\",\n fixFiles: \"Quita o reintenta los archivos con error\",\n open: (name) => `Abrir ${name}`,\n file: \"Archivo\",\n play: \"Reproducir\",\n pause: \"Pausar\",\n position: \"Posición\",\n automation: AUTOMATION_MESSAGES_ES,\n connect: {\n authorize: (app) => `Autorizar en ${app}`,\n connected: \"Conectada\",\n failed: \"No se ha podido conectar\",\n preparing: \"Preparando la conexión\",\n },\n};\n\nexport const BROWSER_MESSAGES_ES: BrowserMessages = {\n agent: (name) => `Lo controla ${name}`,\n agentMine: (name) => `${name}, en tu Chrome`,\n person: \"Lo controlas tú\",\n take: \"Tomar el control\",\n giveBack: \"Devolver\",\n handedOver: (name) => `${name} te pasa el navegador`,\n done: \"Listo, sigue\",\n closed: \"El navegador se cerró mientras te esperaba.\",\n close: \"Cerrar el navegador\",\n expand: \"Ampliar\",\n shrink: \"Reducir\",\n blank: \"Página en blanco\",\n screen: (where) => `Navegador: ${where}`,\n};\n\nexport const CHAT_MESSAGES_ES: ChatMessages = {\n placeholder: (name) => `Escribe a ${name}…`,\n connecting: \"Conectando…\",\n awaiting: \"Responde arriba para seguir…\",\n thinking: (name) => `${name} está pensando`,\n typing: \"Escribiendo\",\n working: \"Trabajando\",\n writing: \"Escribiendo\",\n elapsed: (seconds) => `${seconds} s`,\n escape: \"esc para detener\",\n done: (seconds) =>\n `Listo en ${seconds < 60 ? `${seconds} s` : `${Math.floor(seconds / 60)} min ${seconds % 60} s`}`,\n empty: (name) => `Habla con ${name}`,\n intro: () => \"\",\n send: \"Enviar\",\n attach: \"Adjuntar archivos\",\n drop: \"Suelta para adjuntar\",\n dictate: \"Dictar\",\n dictateStop: \"Parar y escribirlo\",\n dictation: {\n listening: \"Escuchando…\",\n writing: \"Escribiéndolo…\",\n failed: \"No te he oído: permite el micrófono e inténtalo otra vez\",\n },\n stop: \"Detener\",\n log: \"Conversación\",\n steps: {\n show: \"Muestra\",\n ask_person: \"Pregunta\",\n search_files: \"Busca en archivos\",\n read_file: \"Lee un archivo\",\n keep_file: \"Guarda un archivo\",\n remember: \"Recuerda\",\n recall: \"Busca en lo aprendido\",\n escalate: \"Pasa a una persona\",\n notify: \"Avisa\",\n data_find: \"Consulta una tabla\",\n data_add: \"Añade una fila\",\n data_update: \"Cambia una fila\",\n browser_open: \"Abre una página\",\n browser_read: \"Lee la página\",\n browser_click: \"Hace clic\",\n browser_fill: \"Rellena un campo\",\n browser_scroll: \"Desplaza la página\",\n browser_back: \"Vuelve atrás\",\n browser_submit: \"Envía en la web\",\n browser_hand_over: \"Te pasa el navegador\",\n browser_attach: \"Sube un archivo a la web\",\n browser_download: \"Guarda un archivo de la web\",\n browser_screenshot: \"Hace una captura de la web\",\n browser_record: \"Graba la web en vídeo\",\n browser_fill_key: \"Escribe una clave en la web\",\n ask_builder: \"Se lo pide al builder\",\n send_message: \"Envía un mensaje\",\n voice_note: \"Manda una nota de voz\",\n ai: \"Usa la IA\",\n call: \"Llama\",\n },\n failed: \"falló\",\n approval: \"Necesita tu aprobación\",\n request: (name, action) => `${name} quiere hacer «${action}»`,\n inputs: {},\n allow: \"Aprobar\",\n decline: \"Rechazar\",\n confirming: \"Esperando la confirmación del negocio\",\n handedOff: \"Pasada a una persona\",\n handover: (holder, by, name) => {\n const automation = by.kind === \"automation\" ? ` por «${by.title}»` : \"\";\n switch (holder) {\n case \"agent\":\n if (by.kind === \"owner\") return `Devolviste la conversación a ${name}`;\n return `Se devolvió a ${name}${automation}`;\n case \"person\":\n if (by.kind === \"owner\") return `Pausaste a ${name}`;\n if (by.kind === \"agent\") return `${name} la pasó a una persona`;\n return `Pasó a una persona${automation}`;\n case \"nobody\":\n return `Ignorada${automation}`;\n }\n },\n skipped: \"No respondió\",\n cut: (heard) =>\n heard === \"\" ? \"Interrumpida antes de que se oyera nada\" : `Interrumpida tras «${heard}»`,\n write: \"Responde como el negocio…\",\n business: \"Tú\",\n voiceNote: \"Nota de voz\",\n delivery: {\n queued: \"Esperando para salir\",\n sent: \"Enviado\",\n delivered: \"Entregado\",\n read: \"Leído\",\n failed: \"No entregado\",\n },\n undelivered: (error) => (error ? `No entregado: ${error}` : \"No entregado\"),\n noTool: \"Esta página no puede hacer eso\",\n kit: KIT_MESSAGES_ES,\n browser: BROWSER_MESSAGES_ES,\n};\n\nexport const VOICE_CALL_MESSAGES_ES: VoiceCallMessages = {\n call: (name) => `Llamada con ${name}`,\n states: {\n connecting: \"Conectando…\",\n listening: \"Escuchando\",\n thinking: \"Pensando\",\n speaking: \"Hablando\",\n reconnecting: \"Reconectando…\",\n ended: \"Llamada terminada\",\n },\n calling: (name) => `Llamando a ${name}`,\n ended: {\n person: () => \"Has colgado\",\n agent: (name) => `${name} ha colgado`,\n limit: () => \"Se alcanzó la duración máxima\",\n dropped: () => \"Se cortó la llamada\",\n },\n problems: {\n denied: {\n title: () => \"Sin permiso para el micrófono\",\n help: \"Permite el micrófono a esta página (en el icono junto a la dirección) y vuelve a llamar.\",\n },\n nomic: {\n title: () => \"No hay ningún micrófono\",\n help: \"Conecta uno, o elige otro en los ajustes de sonido del sistema, y vuelve a llamar.\",\n },\n inuse: {\n title: () => \"El micrófono está ocupado\",\n help: \"Otra aplicación lo está usando. Ciérrala y vuelve a llamar.\",\n },\n unsupported: {\n title: () => \"Este navegador no puede llamar\",\n help: \"Abre la página por https en un Chrome, Edge, Safari o Firefox actual.\",\n },\n off: {\n title: () => \"Las llamadas no están activadas\",\n help: \"Este servicio aún no atiende llamadas. Escríbele mientras tanto.\",\n },\n builder: {\n title: (name) => `${name} no atiende llamadas`,\n help: \"Escríbele en el chat.\",\n },\n refused: {\n title: (name) => `${name} no puede atender la llamada`,\n help: \"Inténtalo de nuevo en un momento.\",\n },\n failed: {\n title: (name) => `No se ha podido llamar a ${name}`,\n help: \"Comprueba tu conexión y vuelve a intentarlo.\",\n },\n unanswered: {\n title: (name) => `${name} no contesta`,\n help: \"Ahora mismo no atiende llamadas. Inténtalo de nuevo en un momento.\",\n },\n },\n mute: \"Silenciar\",\n hangUp: \"Colgar\",\n keys: \"Espacio silencia y activa el micrófono\",\n muted: \"Tu micrófono está silenciado\",\n hear: (name) => `Oír a ${name}`,\n};\n\nexport const TASK_MESSAGES_ES: TaskMessages = {\n open: (count) =>\n count === 1 ? \"Tienes 1 tarea programada\" : `Tienes ${count} tareas programadas`,\n title: \"Tus tareas\",\n back: \"Volver a la conversación\",\n remove: \"Quitar\",\n empty: \"No hay nada programado. Pídele que te recuerde algo, o que te escriba más adelante.\",\n failed: \"No se ha podido cambiar. Inténtalo de nuevo.\",\n};\n\nexport const SPACE_MESSAGES_ES: SpaceMessages = {\n modes: { label: \"Modo\", text: \"Texto\", voice: \"Voz\" },\n again: \"Volver a llamar\",\n close: \"Cerrar\",\n agent: \"Agente\",\n opening: \"Abriendo la conversación…\",\n failed: \"No se ha podido abrir la conversación.\",\n retry: \"Reintentar\",\n chat: CHAT_MESSAGES_ES,\n voice: VOICE_CALL_MESSAGES_ES,\n tasks: TASK_MESSAGES_ES,\n};\n"],"mappings":";;AAeA,MAAM,MAAM,SAAyB,KAAK,KAAK,WAAW,IAAI,IAAI,OAAO,MAAM,GAAG;AAElF,MAAM,QAAQ,UAAqC,IAAI,KAAK,WAAW,IAAI,CAAC,CAAC,OAAO,KAAK;;AAGzF,MAAM,QAAQ,SAA0B,KAAK,SAAS,GAAG,IAAI,OAAO,GAAG,KAAK;AAE5E,MAAM,WAAW,SAAyB,KAAK,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,KAAK,MAAM,CAAC;;AAGrF,SAAS,QAAQ,KAAqB;CACpC,QAAQ,IAAI,MAAZ;EACE,KAAK,SACH,OAAO;EACT,KAAK,YACH,OAAO;EACT,KAAK,aACH,OAAO;EACT,SACE,OAAO,MAAM,IAAI;CACrB;AACF;;AAGA,MAAM,OAAyC;CAC7C,UAAU;CACV,WAAW;CACX,KAAK;AACP;;AAGA,MAAM,OAAO;CACX,QAAQ,EAAE,QAAgB,YAAY,QAAQ,QAAgB,YAAY,KAAK;CAC/E,MAAM,EAAE,QAAgB,aAAa,QAAQ,QAAgB,sBAAsB,KAAK;CACxF,QAAQ,EAAE,QAAgB,WAAW,QAAQ,QAAgB,oBAAoB,KAAK;CACtF,QAAQ,EAAE,QAAgB,aAAa,QAAQ,QAAgB,sBAAsB,KAAK;CAC1F,QAAQ,EAAE,QAAgB,YAAY,QAAQ,QAAgB,qBAAqB,KAAK;CACxF,KAAK,EAAE,QAAgB,OAAO,QAAQ,QAAgB,gBAAgB,KAAK;AAC7E;AAEA,MAAa,yBAA6C;CACxD,OAAO;CACP,UAAU;CACV,UAAU;CACV,SAAS,UACP,MAAM,WAAW,IAAI,QAAQ,MAAM,MAAM,OAAO,OAAO,KAAK,MAAM,IAAI,IAAI,CAAC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sources":["../src/es.ts"],"sourcesContent":["/**\n * The package's words in Spanish, for the people an agent serves: the chat, the browser it drives,\n * the kit's controls (with an automation's and its runs'), a call and the agent's space. English\n * is every component's default; a host in Spanish passes these as `messages`, the calendar's\n * language as `locale` (`import { es } from \"@signalcore/ui/locale\"`).\n */\nimport type { ChatMessages } from \"./AgentChat\";\nimport type { SpaceMessages } from \"./AgentSpace\";\nimport type { TaskMessages } from \"./AgentTasks\";\nimport type { AutomationMessages, DayRef } from \"./automation/messages\";\nimport type { BrowserMessages } from \"./BrowserView\";\nimport type { KitMessages } from \"./kit/messages\";\nimport type { ThreadMessages } from \"./Threads\";\nimport type { VoiceCallMessages } from \"./VoiceCall\";\n\n/** The article before a time: \"la 1:00\", \"las 8:00\". */\nconst at = (time: string): string => `a ${time.startsWith(\"1:\") ? \"la\" : \"las\"} ${time}`;\n\nconst list = (items: readonly string[]): string => new Intl.ListFormat(\"es\").format(items);\n\n/** A weekday as the plural says it: \"los lunes\", \"los sábados\". */\nconst days = (name: string): string => (name.endsWith(\"s\") ? name : `${name}s`);\n\nconst capital = (text: string): string => text.charAt(0).toUpperCase() + text.slice(1);\n\n/** A day said after \"próxima\": \"hoy\", \"mañana\", \"el lunes\", \"el 3 nov\". */\nfunction nextDay(day: DayRef): string {\n switch (day.kind) {\n case \"today\":\n return \"hoy\";\n case \"tomorrow\":\n return \"mañana\";\n case \"yesterday\":\n return \"\";\n default:\n return `el ${day.name}`;\n }\n}\n\n/** A message sent on a channel, by the channel's kind: \"un WhatsApp\", \"un SMS\". */\nconst SENT: Readonly<Record<string, string>> = {\n whatsapp: \"un WhatsApp\",\n instagram: \"un mensaje de Instagram\",\n sms: \"un SMS\",\n};\n\n/** What an automation's tool call did, by what the tool's name says, done or (a test) not. */\nconst TOOL = {\n search: [(app: string) => `Buscó en ${app}`, (app: string) => `Buscó en ${app}`],\n send: [(app: string) => `Envió por ${app}`, (app: string) => `Habría enviado por ${app}`],\n create: [(app: string) => `Creó en ${app}`, (app: string) => `Habría creado en ${app}`],\n update: [(app: string) => `Cambió en ${app}`, (app: string) => `Habría cambiado en ${app}`],\n remove: [(app: string) => `Borró en ${app}`, (app: string) => `Habría borrado en ${app}`],\n use: [(app: string) => `Usó ${app}`, (app: string) => `Habría usado ${app}`],\n} as const;\n\nexport const AUTOMATION_MESSAGES_ES: AutomationMessages = {\n daily: \"Cada día\",\n weekdays: \"Cada día laborable\",\n weekends: \"Los fines de semana\",\n weekly: (names) =>\n names.length === 1 ? `Cada ${names[0] ?? \"\"}` : `Los ${list(names.map(days))}`,\n monthly: (numbers) =>\n numbers.length === 1\n ? `El día ${numbers[0] ?? \"\"} de cada mes`\n : `Los días ${list(numbers.map(String))} de cada mes`,\n at: (times) => list(times.map(at)),\n every: (count, unit) =>\n unit === \"minute\"\n ? count === 1\n ? \"Cada minuto\"\n : `Cada ${count} minutos`\n : count === 1\n ? \"Cada hora\"\n : `Cada ${count} horas`,\n between: (from, to) => `de ${from} a ${to}`,\n on: (often, when) => `${often}, ${when.charAt(0).toLowerCase()}${when.slice(1)}`,\n custom: \"Con un horario propio\",\n webhook: \"Cuando otro sistema la llama\",\n manual: \"Cuando alguien la inicia\",\n after: (automation) => (automation ? `Tras «${automation}»` : \"Tras otra automatización\"),\n platform: \"Cuando llega un mensaje\",\n event: (app, event) =>\n event\n ? `Cuando pasa «${event}» en ${app ?? \"una app\"}`\n : `Cuando pasa algo en ${app ?? \"una app\"}`,\n next: (day, time) =>\n [\"próxima\", nextDay(day), time === null ? \"\" : at(time)].filter(Boolean).join(\" \"),\n states: { active: \"Activa\", paused: \"En pausa\", failing: \"Falló la última\" },\n switchLabel: \"Activa\",\n steps: \"Pasos\",\n runs: \"Ejecuciones\",\n noRuns: \"Aún no se ha ejecutado.\",\n uses: {\n ai: \"IA\",\n agent: \"Agente\",\n notify: \"Aviso\",\n send: \"Mensaje\",\n data: \"Tabla\",\n http: \"Web\",\n },\n more: (count) => `+${count}`,\n gone: \"Esta automatización ya no existe.\",\n moment: (day, time) => {\n switch (day.kind) {\n case \"today\":\n return `Hoy ${time}`;\n case \"yesterday\":\n return `Ayer ${time}`;\n case \"tomorrow\":\n return `Mañana ${time}`;\n default:\n return `${capital(day.name)} ${time}`;\n }\n },\n by: (by, app) =>\n ({\n schedule: \"horario\",\n webhook: \"webhook\",\n event: app ? `evento de ${app}` : \"evento\",\n platform: \"un mensaje\",\n agent: \"se lo pidieron en el chat\",\n test: \"prueba\",\n api: \"tu app\",\n after: \"tras otra\",\n })[by],\n statuses: {\n running: \"En curso\",\n waiting: \"Esperando\",\n done: \"Hecha\",\n failed: \"Falló\",\n skipped: \"Omitida\",\n },\n dry: (summary) => `Prueba: ${summary}`,\n took: (ms) => {\n if (ms < 1000) return \"menos de 1 s\";\n const seconds = Math.round(ms / 1000);\n return seconds < 60 ? `${seconds} s` : `${Math.floor(seconds / 60)} min ${seconds % 60} s`;\n },\n opened: \"Conversaciones que abrió\",\n conversation: (index) => `Conversación ${index}`,\n askedIn: \"La conversación donde se lo pidieron\",\n noCalls: \"No llegó a hacer nada.\",\n outside: \"Fuera de los pasos\",\n times: (count) => `×${count}`,\n calls: {\n tool: (verb, app, would) => TOOL[verb][would ? 1 : 0](app),\n ai: \"Usó la IA\",\n notify: (would) => (would ? \"Habría avisado en la bandeja\" : \"Avisó en la bandeja\"),\n send: (channel, to, would) => {\n const sent = `${SENT[channel ?? \"\"] ?? \"un mensaje\"} a ${to || \"un contacto\"}`;\n return would ? `Habría enviado ${sent}` : `Envió ${sent}`;\n },\n start: (would) => (would ? \"Habría abierto una conversación\" : \"Abrió una conversación\"),\n find: (table) => `Consultó ${table}`,\n add: (table, would) =>\n would ? `Habría añadido una fila a ${table}` : `Añadió una fila a ${table}`,\n change: (table, would) =>\n would ? `Habría cambiado una fila de ${table}` : `Cambió una fila de ${table}`,\n http: (host, would) => (would ? `Habría llamado a ${host}` : `Llamó a ${host}`),\n files: \"Buscó en los archivos\",\n read: (file) => `Leyó ${file}`,\n wrote: (file, would) => (would ? `Habría guardado ${file}` : `Guardó ${file}`),\n listed: \"Miró sus archivos\",\n remember: (would) => (would ? \"Habría guardado un recuerdo\" : \"Guardó un recuerdo\"),\n recall: \"Buscó en lo aprendido\",\n },\n};\n\nconst FAMILIES: Readonly<Record<string, string>> = {\n image: \"imágenes\",\n video: \"vídeos\",\n audio: \"audios\",\n text: \"textos\",\n};\n\nexport const KIT_MESSAGES_ES: KitMessages = {\n required: \"Este campo es obligatorio\",\n chooseDate: \"Elige un día\",\n chooseTime: \"Elige una hora\",\n chooseMoment: \"Elige día y hora\",\n chooseOption: \"Elige una opción\",\n other: \"Otra respuesta\",\n otherPlaceholder: \"Escribe tu respuesta\",\n chooseRating: \"Elige una puntuación\",\n check: \"Marca la casilla para seguir\",\n invalidEmail: \"Correo no válido\",\n invalidPhone: \"Teléfono no válido\",\n invalidUrl: \"Dirección no válida\",\n invalidNumber: \"Escribe un número\",\n invalidTime: \"Escribe la hora así: 9:30\",\n atLeast: (min) => `Como mínimo ${min}`,\n atMost: (max) => `Como máximo ${max}`,\n unavailableDate: \"Ese día no está disponible\",\n unavailableTime: \"Esa hora no está disponible\",\n optional: \"Opcional\",\n pick: \"Elige…\",\n search: \"Buscar…\",\n noResults: \"Sin resultados\",\n show: \"Mostrar\",\n hide: \"Ocultar\",\n increase: \"Sumar\",\n decrease: \"Restar\",\n remove: (label) => `Quitar ${label}`,\n yes: \"Sí\",\n no: \"No\",\n rated: (value, max) => `${value} de ${max}`,\n stars: (count) => (count === 1 ? \"1 estrella\" : `${count} estrellas`),\n send: \"Enviar\",\n sent: \"Enviado\",\n chooseFile: \"Falta el archivo\",\n upload: (multiple) => (multiple ? \"Sube archivos\" : \"Sube un archivo\"),\n drop: \"Suelta aquí o elige\",\n limits: (kinds, size) => (kinds ? `${kinds}, hasta ${size}` : `Hasta ${size}`),\n anyOf: (family) => FAMILIES[family] ?? family,\n uploading: \"Subiendo\",\n tooBig: (size) => `Pasa de ${size}`,\n wrongType: \"Aquí no vale este tipo de archivo\",\n tooMany: (max) => `Como máximo ${max} archivos`,\n uploadFailed: \"No se ha podido subir\",\n retry: \"Reintentar\",\n stillUploading: \"Espera a que termine de subir\",\n fixFiles: \"Quita o reintenta los archivos con error\",\n open: (name) => `Abrir ${name}`,\n file: \"Archivo\",\n play: \"Reproducir\",\n pause: \"Pausar\",\n position: \"Posición\",\n automation: AUTOMATION_MESSAGES_ES,\n connect: {\n authorize: (app) => `Autorizar en ${app}`,\n connected: \"Conectada\",\n failed: \"No se ha podido conectar\",\n preparing: \"Preparando la conexión\",\n },\n calendar: { allDay: \"Todo el día\", empty: \"Nada previsto\" },\n board: {\n move: (card) => `Mover ${card}`,\n moveTo: \"Mover a\",\n moved: (card, column) => `${card} a ${column}`,\n empty: \"Nada aquí\",\n },\n};\n\nexport const BROWSER_MESSAGES_ES: BrowserMessages = {\n agent: (name) => `Lo controla ${name}`,\n agentMine: (name) => `${name}, en tu Chrome`,\n person: \"Lo controlas tú\",\n take: \"Tomar el control\",\n giveBack: \"Devolver\",\n handedOver: (name) => `${name} te pasa el navegador`,\n done: \"Listo, sigue\",\n closed: \"El navegador se cerró mientras te esperaba.\",\n close: \"Cerrar el navegador\",\n expand: \"Ampliar\",\n shrink: \"Reducir\",\n blank: \"Página en blanco\",\n screen: (where) => `Navegador: ${where}`,\n};\n\nexport const CHAT_MESSAGES_ES: ChatMessages = {\n placeholder: (name) => `Escribe a ${name}…`,\n connecting: \"Conectando…\",\n awaiting: \"Responde arriba para seguir…\",\n thinking: (name) => `${name} está pensando`,\n typing: \"Escribiendo\",\n working: \"Trabajando\",\n writing: \"Escribiendo\",\n elapsed: (seconds) => `${seconds} s`,\n escape: \"esc para detener\",\n done: (seconds) =>\n `Listo en ${seconds < 60 ? `${seconds} s` : `${Math.floor(seconds / 60)} min ${seconds % 60} s`}`,\n empty: (name) => `Habla con ${name}`,\n intro: () => \"\",\n send: \"Enviar\",\n attach: \"Adjuntar archivos\",\n drop: \"Suelta para adjuntar\",\n dictate: \"Dictar\",\n dictateStop: \"Parar y escribirlo\",\n dictation: {\n listening: \"Escuchando…\",\n writing: \"Escribiéndolo…\",\n failed: \"No te he oído: permite el micrófono e inténtalo otra vez\",\n },\n stop: \"Detener\",\n log: \"Conversación\",\n steps: {\n show: \"Muestra\",\n ask_person: \"Pregunta\",\n search_files: \"Busca en archivos\",\n read_file: \"Lee un archivo\",\n keep_file: \"Guarda un archivo\",\n remember: \"Recuerda\",\n recall: \"Busca en lo aprendido\",\n escalate: \"Pasa a una persona\",\n notify: \"Avisa\",\n data_find: \"Consulta una tabla\",\n data_add: \"Añade una fila\",\n data_update: \"Cambia una fila\",\n browser_open: \"Abre una página\",\n browser_read: \"Lee la página\",\n browser_click: \"Hace clic\",\n browser_fill: \"Rellena un campo\",\n browser_scroll: \"Desplaza la página\",\n browser_back: \"Vuelve atrás\",\n browser_submit: \"Envía en la web\",\n browser_hand_over: \"Te pasa el navegador\",\n browser_attach: \"Sube un archivo a la web\",\n browser_download: \"Guarda un archivo de la web\",\n browser_screenshot: \"Hace una captura de la web\",\n browser_record: \"Graba la web en vídeo\",\n browser_fill_key: \"Escribe una clave en la web\",\n ask_builder: \"Se lo pide al builder\",\n send_message: \"Envía un mensaje\",\n voice_note: \"Manda una nota de voz\",\n ai: \"Usa la IA\",\n call: \"Llama\",\n },\n failed: \"falló\",\n approval: \"Necesita tu aprobación\",\n request: (name, action) => `${name} quiere hacer «${action}»`,\n inputs: {},\n allow: \"Aprobar\",\n decline: \"Rechazar\",\n approvals: (count) => `${count} acciones esperan tu aprobación`,\n approveAll: \"Aprobar todo\",\n approveSome: (count) => `Aprobar ${count}`,\n declineAll: \"Rechazar todo\",\n confirming: \"Esperando la confirmación del negocio\",\n handedOff: \"Pasada a una persona\",\n opened: (name, title) => `${name} abrió ${title}`,\n closePlaced: \"Cerrar\",\n handover: (holder, by, name) => {\n const automation = by.kind === \"automation\" ? ` por «${by.title}»` : \"\";\n switch (holder) {\n case \"agent\":\n if (by.kind === \"owner\") return `Devolviste la conversación a ${name}`;\n return `Se devolvió a ${name}${automation}`;\n case \"person\":\n if (by.kind === \"owner\") return `Pausaste a ${name}`;\n if (by.kind === \"agent\") return `${name} la pasó a una persona`;\n return `Pasó a una persona${automation}`;\n case \"nobody\":\n return `Ignorada${automation}`;\n }\n },\n skipped: \"No respondió\",\n cut: (heard) =>\n heard === \"\" ? \"Interrumpida antes de que se oyera nada\" : `Interrumpida tras «${heard}»`,\n write: \"Responde como el negocio…\",\n business: \"Tú\",\n voiceNote: \"Nota de voz\",\n delivery: {\n queued: \"Esperando para salir\",\n sent: \"Enviado\",\n delivered: \"Entregado\",\n read: \"Leído\",\n failed: \"No entregado\",\n },\n undelivered: (error) => (error ? `No entregado: ${error}` : \"No entregado\"),\n noTool: \"Esta página no puede hacer eso\",\n kit: KIT_MESSAGES_ES,\n browser: BROWSER_MESSAGES_ES,\n};\n\nexport const VOICE_CALL_MESSAGES_ES: VoiceCallMessages = {\n call: (name) => `Llamada con ${name}`,\n states: {\n connecting: \"Conectando…\",\n listening: \"Escuchando\",\n thinking: \"Pensando\",\n speaking: \"Hablando\",\n reconnecting: \"Reconectando…\",\n ended: \"Llamada terminada\",\n },\n calling: (name) => `Llamando a ${name}`,\n ended: {\n person: () => \"Has colgado\",\n agent: (name) => `${name} ha colgado`,\n limit: () => \"Se alcanzó la duración máxima\",\n dropped: () => \"Se cortó la llamada\",\n },\n problems: {\n denied: {\n title: () => \"Sin permiso para el micrófono\",\n help: \"Permite el micrófono a esta página (en el icono junto a la dirección) y vuelve a llamar.\",\n },\n nomic: {\n title: () => \"No hay ningún micrófono\",\n help: \"Conecta uno, o elige otro en los ajustes de sonido del sistema, y vuelve a llamar.\",\n },\n inuse: {\n title: () => \"El micrófono está ocupado\",\n help: \"Otra aplicación lo está usando. Ciérrala y vuelve a llamar.\",\n },\n unsupported: {\n title: () => \"Este navegador no puede llamar\",\n help: \"Abre la página por https en un Chrome, Edge, Safari o Firefox actual.\",\n },\n off: {\n title: () => \"Las llamadas no están activadas\",\n help: \"Este servicio aún no atiende llamadas. Escríbele mientras tanto.\",\n },\n builder: {\n title: (name) => `${name} no atiende llamadas`,\n help: \"Escríbele en el chat.\",\n },\n refused: {\n title: (name) => `${name} no puede atender la llamada`,\n help: \"Inténtalo de nuevo en un momento.\",\n },\n failed: {\n title: (name) => `No se ha podido llamar a ${name}`,\n help: \"Comprueba tu conexión y vuelve a intentarlo.\",\n },\n unanswered: {\n title: (name) => `${name} no contesta`,\n help: \"Ahora mismo no atiende llamadas. Inténtalo de nuevo en un momento.\",\n },\n },\n mute: \"Silenciar\",\n hangUp: \"Colgar\",\n keys: \"Espacio silencia y activa el micrófono\",\n muted: \"Tu micrófono está silenciado\",\n hear: (name) => `Oír a ${name}`,\n};\n\nexport const TASK_MESSAGES_ES: TaskMessages = {\n open: (count) =>\n count === 1 ? \"Tienes 1 tarea programada\" : `Tienes ${count} tareas programadas`,\n title: \"Tus tareas\",\n back: \"Volver a la conversación\",\n remove: \"Quitar\",\n empty: \"No hay nada programado. Pídele que te recuerde algo, o que te escriba más adelante.\",\n failed: \"No se ha podido cambiar. Inténtalo de nuevo.\",\n};\n\nexport const THREAD_MESSAGES_ES: ThreadMessages = {\n open: \"Conversaciones\",\n title: \"Tus conversaciones\",\n back: \"Volver a la conversación\",\n new: \"Nueva conversación\",\n untitled: \"Conversación nueva\",\n unread: (count) => (count === 1 ? \"1 mensaje sin leer\" : `${count} mensajes sin leer`),\n waiting: \"Te espera\",\n empty: \"Aún no hay nada aquí.\",\n};\n\nexport const SPACE_MESSAGES_ES: SpaceMessages = {\n modes: { label: \"Modo\", text: \"Texto\", voice: \"Voz\" },\n again: \"Volver a llamar\",\n close: \"Cerrar\",\n agent: \"Agente\",\n opening: \"Abriendo la conversación…\",\n failed: \"No se ha podido abrir la conversación.\",\n retry: \"Reintentar\",\n chat: CHAT_MESSAGES_ES,\n voice: VOICE_CALL_MESSAGES_ES,\n tasks: TASK_MESSAGES_ES,\n threads: THREAD_MESSAGES_ES,\n};\n"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,MAAa,qBAAqC;CAChD,MAAM;CACN,OAAO;CACP,MAAM;CACN,KAAK;CACL,UAAU;CACV,SAAS,UAAW,UAAU,IAAI,uBAAuB,GAAG,MAAM;CAClE,SAAS;CACT,OAAO;AACT;AAEA,MAAa,oBAAmC;CAC9C,OAAO;EAAE,OAAO;EAAQ,MAAM;EAAS,OAAO;CAAM;CACpD,OAAO;CACP,OAAO;CACP,OAAO;CACP,SAAS;CACT,QAAQ;CACR,OAAO;CACP,MAAM;CACN,OAAO;CACP,OAAO;CACP,SAAS;AACX"}
package/dist/frames.d.ts CHANGED
@@ -70,7 +70,8 @@ export type Frame = {
70
70
  } & BrowserFrame);
71
71
  /**
72
72
  * Up: the person says something (words, files they uploaded to the conversation, or both), acts
73
- * on a surface, or stops the reply on its way; takes the browser or gives it back, and acts on it
73
+ * on a surface (several things at once: a yes or no on each call a reply waits on), or stops
74
+ * the reply on its way; takes the browser or gives it back, and acts on it
74
75
  * while they hold it. And what a tool of the host's answered, run in the page: its output, or
75
76
  * why it failed.
76
77
  */
@@ -81,6 +82,11 @@ export type UpFrame = {
81
82
  } | ({
82
83
  type: "action";
83
84
  } & Action) | {
85
+ type: "actions";
86
+ actions: ({
87
+ type: "action";
88
+ } & Action)[];
89
+ } | {
84
90
  type: "stop";
85
91
  } | {
86
92
  type: "browser.control";
@@ -1 +1 @@
1
- {"version":3,"file":"frames.js","names":[],"sources":["../src/frames.ts"],"sourcesContent":["import type { Surface } from \"./blocks\";\nimport type {\n Action,\n Attachment,\n BrowserControl,\n BrowserFrame,\n BrowserInput,\n BrowserState,\n Decides,\n Decision,\n Handover,\n Holder,\n Message,\n Request,\n Step,\n StepState,\n ToolCall,\n} from \"./types\";\n\n/**\n * The frames of a conversation's socket, as v3/README.md documents them. Down: a message stored;\n * a piece of the reply as it streams; a surface the agent shows (`awaits`: the turn stops until\n * the person acts on it); an action running, told again as its state moves; an action that needs\n * a yes, the person's (the turn stopped) or the business's (`decides`: the turn went on); the\n * conversation handed to a person, and why (the agent stays quiet in it\n * until it is released); the turn over, or stopped by the person; or what went wrong (`code` for\n * the app to word, `detail` for a log). A socket that opens mid-turn is first told the turn so\n * far, from the person's message on. Who answers the conversation, after any change of it (`holder`:\n * who now, and the change); and what was decided of a person's message, when it is stored,\n * settles or is cleared (`decision`, null then). And the conversation's browser: its state, whole, whenever it changes\n * (told at once to a socket that opens), and its screen as it paints. And one of the host's own\n * tools the agent called, for the page to run (`tool`): its step works meanwhile, the turn waits\n * for its `tool_result`, and a person's socket that opens while it waits is told it again.\n */\nexport type Frame =\n | { type: \"working\" }\n | { type: \"message\"; message: Message }\n | { type: \"text\"; delta: string }\n | { type: \"ui\"; id: string; surface: Surface; awaits: boolean }\n | { type: \"step\"; id: string; state: StepState; action?: string; output?: string }\n | ({ type: \"request\"; id: string } & Request)\n | ({ type: \"tool\" } & ToolCall)\n | { type: \"handoff\"; reason: string }\n | { type: \"holder\"; handled_by: Holder; handover: Handover }\n | { type: \"decision\"; message_id: string; decision: Decision | null }\n | { type: \"done\" }\n | { type: \"stopped\" }\n | { type: \"error\"; code: string; detail: string }\n | ({ type: \"browser\"; open: true } & BrowserState)\n | { type: \"browser\"; open: false }\n | ({ type: \"browser.frame\" } & BrowserFrame);\n\n/**\n * Up: the person says something (words, files they uploaded to the conversation, or both), acts\n * on a surface, or stops the reply on its way; takes the browser or gives it back, and acts on it\n * while they hold it. And what a tool of the host's answered, run in the page: its output, or\n * why it failed.\n */\nexport type UpFrame =\n | { type: \"say\"; text: string; files?: string[] }\n | ({ type: \"action\" } & Action)\n | { type: \"stop\" }\n | { type: \"browser.control\"; to: BrowserControl }\n | { type: \"browser.close\" }\n | { type: \"browser.input\"; event: BrowserInput }\n | ToolResult;\n\n/** What a host's tool answered: what it gave back (null for nothing), or why it failed. */\nexport type ToolResult =\n | { type: \"tool_result\"; id: string; output: unknown }\n | { type: \"tool_result\"; id: string; error: string };\n\nconst STATES: ReadonlySet<string> = new Set([\"running\", \"waiting\", \"done\", \"failed\"]);\nconst HOLDERS: ReadonlySet<string> = new Set([\"agent\", \"person\", \"nobody\"]);\nconst DECISIONS: ReadonlySet<string> = new Set([\"deciding\", \"answer\", \"skip\", \"hold\", \"ignore\"]);\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === \"object\" && value !== null;\n\nconst isState = (value: unknown): value is StepState =>\n typeof value === \"string\" && STATES.has(value);\n\n// The blocks inside are the API's, validated at `show`; the renderer draws what it knows.\nconst isSurface = (value: unknown): value is Surface =>\n isRecord(value) && Array.isArray(value.blocks) && typeof value.text === \"string\";\n\nconst isDecides = (value: unknown): value is Decides => value === \"person\" || value === \"business\";\n\nconst isRequest = (value: unknown): value is Request =>\n isRecord(value) &&\n typeof value.action === \"string\" &&\n isRecord(value.input) &&\n (value.decides === undefined || isDecides(value.decides));\n\nconst isStep = (value: unknown): value is Step =>\n isRecord(value) &&\n typeof value.id === \"string\" &&\n typeof value.action === \"string\" &&\n isState(value.state) &&\n (value.output === null || typeof value.output === \"string\") &&\n (value.surface === null || isSurface(value.surface)) &&\n typeof value.awaits === \"boolean\" &&\n (value.request === null || isRequest(value.request));\n\nconst isSize = (value: Record<string, unknown>): boolean =>\n typeof value.width === \"number\" && typeof value.height === \"number\";\n\nconst orNull = (value: unknown): string | null => (typeof value === \"string\" ? value : null);\n\nconst isHolder = (value: unknown): value is Holder =>\n typeof value === \"string\" && HOLDERS.has(value);\n\n/** A change of who answers as told, or null when it is not one: a reason or title left out is none. */\nfunction handoverOf(value: unknown): Handover | null {\n if (!isRecord(value) || !isHolder(value.holder)) return null;\n if (typeof value.by !== \"string\" || typeof value.at !== \"string\") return null;\n const { holder, by, at } = value;\n return { holder, reason: orNull(value.reason) ?? \"\", by, title: orNull(value.title), at };\n}\n\n/** A message's decision as told, or null when it is not one; what it leaves out is none. */\nfunction decisionOf(value: unknown): Decision | null {\n if (!isRecord(value) || typeof value.kind !== \"string\" || !DECISIONS.has(value.kind)) return null;\n return {\n kind: value.kind as Decision[\"kind\"],\n reason: orNull(value.reason),\n automation: orNull(value.automation),\n title: orNull(value.title),\n run_id: orNull(value.run_id),\n };\n}\n\n/** The browser's state as told, or null when it is not one this package can draw. */\nfunction browserOf(frame: Record<string, unknown>): BrowserState | null {\n const { url, title, control } = frame;\n if (typeof url !== \"string\" || typeof title !== \"string\" || !isSize(frame)) return null;\n if (control !== \"agent\" && control !== \"person\") return null;\n return {\n where: frame.where === \"mine\" ? \"mine\" : \"hosted\",\n url,\n title,\n control,\n reason: orNull(frame.reason),\n wait: orNull(frame.wait),\n width: frame.width as number,\n height: frame.height as number,\n };\n}\n\nconst isAction = (value: unknown): value is Action =>\n isRecord(value) &&\n typeof value.surface === \"string\" &&\n typeof value.name === \"string\" &&\n isRecord(value.data) &&\n typeof value.label === \"string\";\n\nconst isAttachment = (value: unknown): value is Attachment =>\n isRecord(value) &&\n typeof value.id === \"string\" &&\n typeof value.name === \"string\" &&\n typeof value.media_type === \"string\" &&\n typeof value.size === \"number\";\n\nconst isMessage = (value: unknown): value is Message =>\n isRecord(value) &&\n typeof value.id === \"string\" &&\n (value.role === \"user\" || value.role === \"assistant\") &&\n typeof value.text === \"string\" &&\n (value.action === null || isAction(value.action)) &&\n Array.isArray(value.steps) &&\n value.steps.every(isStep) &&\n (value.files === undefined || (Array.isArray(value.files) && value.files.every(isAttachment))) &&\n typeof value.created_at === \"string\";\n\n/** The most files one message carries. */\nexport const FILES_PER_MESSAGE = 10;\n\n/**\n * What saying something sends: the words trimmed, and the ids of the files uploaded for it\n * beside them (only when there are); null when there is neither.\n */\nexport function sayOf(text: string, files: readonly string[] = []): UpFrame | null {\n const words = text.trim();\n if (words === \"\" && files.length === 0) return null;\n return files.length === 0\n ? { type: \"say\", text: words }\n : { type: \"say\", text: words, files: [...files] };\n}\n\n/** The most of a tool's error the API takes: the agent reads the rest of it as cut. */\nexport const TOOL_ERROR_MAX = 2000;\n\n/**\n * What a host's tool call answers up, from how its promise settled: what it gave back (`null` for\n * nothing, which JSON would leave out), or the reason it threw in words (an error's message; its\n * kind when it says nothing), as much of it as the API takes.\n */\nexport function toolResultOf(id: string, settled: PromiseSettledResult<unknown>): ToolResult {\n if (settled.status === \"fulfilled\") {\n return { type: \"tool_result\", id, output: settled.value ?? null };\n }\n const reason: unknown = settled.reason;\n const words = (reason instanceof Error ? reason.message : String(reason)).trim();\n const error = words || (reason instanceof Error ? reason.name : \"Error\");\n return { type: \"tool_result\", id, error: error.slice(0, TOOL_ERROR_MAX) };\n}\n\n/**\n * One frame, read without trusting it. Kinds this package does not know yet (more will come:\n * `audio`) and anything malformed are null, to be let pass.\n */\nexport function frameOf(raw: unknown): Frame | null {\n if (typeof raw !== \"string\") return null;\n let frame: unknown;\n try {\n frame = JSON.parse(raw);\n } catch {\n return null;\n }\n if (!isRecord(frame)) return null;\n const { id, action, output } = frame;\n if (frame.type === \"message\" && isMessage(frame.message)) {\n return { type: \"message\", message: frame.message };\n }\n if (frame.type === \"text\" && typeof frame.delta === \"string\") {\n return { type: \"text\", delta: frame.delta };\n }\n if (frame.type === \"ui\" && typeof id === \"string\" && isSurface(frame.surface)) {\n return { type: \"ui\", id, surface: frame.surface, awaits: frame.awaits === true };\n }\n if (frame.type === \"step\" && typeof id === \"string\" && isState(frame.state)) {\n return {\n type: \"step\",\n id,\n state: frame.state,\n ...(typeof action === \"string\" ? { action } : {}),\n ...(typeof output === \"string\" ? { output } : {}),\n };\n }\n if (\n frame.type === \"request\" &&\n typeof id === \"string\" &&\n typeof action === \"string\" &&\n isRecord(frame.input)\n ) {\n // Left out by an API from before it: the person on the screen gave every yes then.\n const decides = isDecides(frame.decides) ? frame.decides : \"person\";\n return { type: \"request\", id, action, input: frame.input, decides };\n }\n if (\n frame.type === \"tool\" &&\n typeof id === \"string\" &&\n typeof frame.name === \"string\" &&\n isRecord(frame.input)\n ) {\n return { type: \"tool\", id, name: frame.name, input: frame.input };\n }\n if (frame.type === \"handoff\" && typeof frame.reason === \"string\") {\n return { type: \"handoff\", reason: frame.reason };\n }\n if (frame.type === \"holder\" && isHolder(frame.handled_by)) {\n const handover = handoverOf(frame.handover);\n return handover && { type: \"holder\", handled_by: frame.handled_by, handover };\n }\n if (frame.type === \"decision\" && typeof frame.message_id === \"string\") {\n const { message_id } = frame;\n if (frame.decision === null) return { type: \"decision\", message_id, decision: null };\n const decision = decisionOf(frame.decision);\n return decision && { type: \"decision\", message_id, decision };\n }\n if (frame.type === \"browser\") {\n if (frame.open === false) return { type: \"browser\", open: false };\n const browser = frame.open === true ? browserOf(frame) : null;\n return browser && { type: \"browser\", open: true, ...browser };\n }\n if (frame.type === \"browser.frame\" && typeof frame.jpeg === \"string\" && isSize(frame)) {\n const { jpeg, width, height } = frame as { jpeg: string; width: number; height: number };\n return { type: \"browser.frame\", jpeg, width, height };\n }\n if (frame.type === \"working\" || frame.type === \"done\" || frame.type === \"stopped\") {\n return { type: frame.type };\n }\n if (\n frame.type === \"error\" &&\n typeof frame.code === \"string\" &&\n typeof frame.detail === \"string\"\n ) {\n return { type: \"error\", code: frame.code, detail: frame.detail };\n }\n return null;\n}\n"],"mappings":";AAwEA,MAAM,yBAA8B,IAAI,IAAI;CAAC;CAAW;CAAW;CAAQ;AAAQ,CAAC;AACpF,MAAM,0BAA+B,IAAI,IAAI;CAAC;CAAS;CAAU;AAAQ,CAAC;AAC1E,MAAM,4BAAiC,IAAI,IAAI;CAAC;CAAY;CAAU;CAAQ;CAAQ;AAAQ,CAAC;AAE/F,MAAM,YAAY,UAChB,OAAO,UAAU,YAAY,UAAU;AAEzC,MAAM,WAAW,UACf,OAAO,UAAU,YAAY,OAAO,IAAI,KAAK;AAG/C,MAAM,aAAa,UACjB,SAAS,KAAK,KAAK,MAAM,QAAQ,MAAM,MAAM,KAAK,OAAO,MAAM,SAAS;AAE1E,MAAM,aAAa,UAAqC,UAAU,YAAY,UAAU;AAExF,MAAM,aAAa,UACjB,SAAS,KAAK,KACd,OAAO,MAAM,WAAW,YACxB,SAAS,MAAM,KAAK,MACnB,MAAM,YAAY,KAAA,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EAAE,MAAM;EAAS,MAAM,MAAM;EAAM,QAAQ,MAAM;CAAO;CAEjE,OAAO;AACT"}
1
+ {"version":3,"file":"frames.js","names":[],"sources":["../src/frames.ts"],"sourcesContent":["import type { Surface } from \"./blocks\";\nimport type {\n Action,\n Attachment,\n BrowserControl,\n BrowserFrame,\n BrowserInput,\n BrowserState,\n Decides,\n Decision,\n Handover,\n Holder,\n Message,\n Request,\n Step,\n StepState,\n ToolCall,\n} from \"./types\";\n\n/**\n * The frames of a conversation's socket, as v3/README.md documents them. Down: a message stored;\n * a piece of the reply as it streams; a surface the agent shows (`awaits`: the turn stops until\n * the person acts on it); an action running, told again as its state moves; an action that needs\n * a yes, the person's (the turn stopped) or the business's (`decides`: the turn went on); the\n * conversation handed to a person, and why (the agent stays quiet in it\n * until it is released); the turn over, or stopped by the person; or what went wrong (`code` for\n * the app to word, `detail` for a log). A socket that opens mid-turn is first told the turn so\n * far, from the person's message on. Who answers the conversation, after any change of it (`holder`:\n * who now, and the change); and what was decided of a person's message, when it is stored,\n * settles or is cleared (`decision`, null then). And the conversation's browser: its state, whole, whenever it changes\n * (told at once to a socket that opens), and its screen as it paints. And one of the host's own\n * tools the agent called, for the page to run (`tool`): its step works meanwhile, the turn waits\n * for its `tool_result`, and a person's socket that opens while it waits is told it again.\n */\nexport type Frame =\n | { type: \"working\" }\n | { type: \"message\"; message: Message }\n | { type: \"text\"; delta: string }\n | { type: \"ui\"; id: string; surface: Surface; awaits: boolean }\n | { type: \"step\"; id: string; state: StepState; action?: string; output?: string }\n | ({ type: \"request\"; id: string } & Request)\n | ({ type: \"tool\" } & ToolCall)\n | { type: \"handoff\"; reason: string }\n | { type: \"holder\"; handled_by: Holder; handover: Handover }\n | { type: \"decision\"; message_id: string; decision: Decision | null }\n | { type: \"done\" }\n | { type: \"stopped\" }\n | { type: \"error\"; code: string; detail: string }\n | ({ type: \"browser\"; open: true } & BrowserState)\n | { type: \"browser\"; open: false }\n | ({ type: \"browser.frame\" } & BrowserFrame);\n\n/**\n * Up: the person says something (words, files they uploaded to the conversation, or both), acts\n * on a surface (several things at once: a yes or no on each call a reply waits on), or stops\n * the reply on its way; takes the browser or gives it back, and acts on it\n * while they hold it. And what a tool of the host's answered, run in the page: its output, or\n * why it failed.\n */\nexport type UpFrame =\n | { type: \"say\"; text: string; files?: string[] }\n | ({ type: \"action\" } & Action)\n | { type: \"actions\"; actions: ({ type: \"action\" } & Action)[] }\n | { type: \"stop\" }\n | { type: \"browser.control\"; to: BrowserControl }\n | { type: \"browser.close\" }\n | { type: \"browser.input\"; event: BrowserInput }\n | ToolResult;\n\n/** What a host's tool answered: what it gave back (null for nothing), or why it failed. */\nexport type ToolResult =\n | { type: \"tool_result\"; id: string; output: unknown }\n | { type: \"tool_result\"; id: string; error: string };\n\nconst STATES: ReadonlySet<string> = new Set([\"running\", \"waiting\", \"done\", \"failed\"]);\nconst HOLDERS: ReadonlySet<string> = new Set([\"agent\", \"person\", \"nobody\"]);\nconst DECISIONS: ReadonlySet<string> = new Set([\"deciding\", \"answer\", \"skip\", \"hold\", \"ignore\"]);\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === \"object\" && value !== null;\n\nconst isState = (value: unknown): value is StepState =>\n typeof value === \"string\" && STATES.has(value);\n\n// The blocks inside are the API's, validated at `show`; the renderer draws what it knows.\nconst isSurface = (value: unknown): value is Surface =>\n isRecord(value) && Array.isArray(value.blocks) && typeof value.text === \"string\";\n\nconst isDecides = (value: unknown): value is Decides => value === \"person\" || value === \"business\";\n\nconst isRequest = (value: unknown): value is Request =>\n isRecord(value) &&\n typeof value.action === \"string\" &&\n isRecord(value.input) &&\n (value.decides === undefined || isDecides(value.decides));\n\nconst isStep = (value: unknown): value is Step =>\n isRecord(value) &&\n typeof value.id === \"string\" &&\n typeof value.action === \"string\" &&\n isState(value.state) &&\n (value.output === null || typeof value.output === \"string\") &&\n (value.surface === null || isSurface(value.surface)) &&\n typeof value.awaits === \"boolean\" &&\n (value.request === null || isRequest(value.request));\n\nconst isSize = (value: Record<string, unknown>): boolean =>\n typeof value.width === \"number\" && typeof value.height === \"number\";\n\nconst orNull = (value: unknown): string | null => (typeof value === \"string\" ? value : null);\n\nconst isHolder = (value: unknown): value is Holder =>\n typeof value === \"string\" && HOLDERS.has(value);\n\n/** A change of who answers as told, or null when it is not one: a reason or title left out is none. */\nfunction handoverOf(value: unknown): Handover | null {\n if (!isRecord(value) || !isHolder(value.holder)) return null;\n if (typeof value.by !== \"string\" || typeof value.at !== \"string\") return null;\n const { holder, by, at } = value;\n return { holder, reason: orNull(value.reason) ?? \"\", by, title: orNull(value.title), at };\n}\n\n/** A message's decision as told, or null when it is not one; what it leaves out is none. */\nfunction decisionOf(value: unknown): Decision | null {\n if (!isRecord(value) || typeof value.kind !== \"string\" || !DECISIONS.has(value.kind)) return null;\n return {\n kind: value.kind as Decision[\"kind\"],\n reason: orNull(value.reason),\n automation: orNull(value.automation),\n title: orNull(value.title),\n run_id: orNull(value.run_id),\n };\n}\n\n/** The browser's state as told, or null when it is not one this package can draw. */\nfunction browserOf(frame: Record<string, unknown>): BrowserState | null {\n const { url, title, control } = frame;\n if (typeof url !== \"string\" || typeof title !== \"string\" || !isSize(frame)) return null;\n if (control !== \"agent\" && control !== \"person\") return null;\n return {\n where: frame.where === \"mine\" ? \"mine\" : \"hosted\",\n url,\n title,\n control,\n reason: orNull(frame.reason),\n wait: orNull(frame.wait),\n width: frame.width as number,\n height: frame.height as number,\n };\n}\n\nconst isAction = (value: unknown): value is Action =>\n isRecord(value) &&\n typeof value.surface === \"string\" &&\n typeof value.name === \"string\" &&\n isRecord(value.data) &&\n typeof value.label === \"string\";\n\nconst isAttachment = (value: unknown): value is Attachment =>\n isRecord(value) &&\n typeof value.id === \"string\" &&\n typeof value.name === \"string\" &&\n typeof value.media_type === \"string\" &&\n typeof value.size === \"number\";\n\nconst isMessage = (value: unknown): value is Message =>\n isRecord(value) &&\n typeof value.id === \"string\" &&\n (value.role === \"user\" || value.role === \"assistant\") &&\n typeof value.text === \"string\" &&\n (value.action === null || isAction(value.action)) &&\n Array.isArray(value.steps) &&\n value.steps.every(isStep) &&\n (value.files === undefined || (Array.isArray(value.files) && value.files.every(isAttachment))) &&\n typeof value.created_at === \"string\";\n\n/** The most files one message carries. */\nexport const FILES_PER_MESSAGE = 10;\n\n/**\n * What saying something sends: the words trimmed, and the ids of the files uploaded for it\n * beside them (only when there are); null when there is neither.\n */\nexport function sayOf(text: string, files: readonly string[] = []): UpFrame | null {\n const words = text.trim();\n if (words === \"\" && files.length === 0) return null;\n return files.length === 0\n ? { type: \"say\", text: words }\n : { type: \"say\", text: words, files: [...files] };\n}\n\n/** The most of a tool's error the API takes: the agent reads the rest of it as cut. */\nexport const TOOL_ERROR_MAX = 2000;\n\n/**\n * What a host's tool call answers up, from how its promise settled: what it gave back (`null` for\n * nothing, which JSON would leave out), or the reason it threw in words (an error's message; its\n * kind when it says nothing), as much of it as the API takes.\n */\nexport function toolResultOf(id: string, settled: PromiseSettledResult<unknown>): ToolResult {\n if (settled.status === \"fulfilled\") {\n return { type: \"tool_result\", id, output: settled.value ?? null };\n }\n const reason: unknown = settled.reason;\n const words = (reason instanceof Error ? reason.message : String(reason)).trim();\n const error = words || (reason instanceof Error ? reason.name : \"Error\");\n return { type: \"tool_result\", id, error: error.slice(0, TOOL_ERROR_MAX) };\n}\n\n/**\n * One frame, read without trusting it. Kinds this package does not know yet (more will come:\n * `audio`) and anything malformed are null, to be let pass.\n */\nexport function frameOf(raw: unknown): Frame | null {\n if (typeof raw !== \"string\") return null;\n let frame: unknown;\n try {\n frame = JSON.parse(raw);\n } catch {\n return null;\n }\n if (!isRecord(frame)) return null;\n const { id, action, output } = frame;\n if (frame.type === \"message\" && isMessage(frame.message)) {\n return { type: \"message\", message: frame.message };\n }\n if (frame.type === \"text\" && typeof frame.delta === \"string\") {\n return { type: \"text\", delta: frame.delta };\n }\n if (frame.type === \"ui\" && typeof id === \"string\" && isSurface(frame.surface)) {\n return { type: \"ui\", id, surface: frame.surface, awaits: frame.awaits === true };\n }\n if (frame.type === \"step\" && typeof id === \"string\" && isState(frame.state)) {\n return {\n type: \"step\",\n id,\n state: frame.state,\n ...(typeof action === \"string\" ? { action } : {}),\n ...(typeof output === \"string\" ? { output } : {}),\n };\n }\n if (\n frame.type === \"request\" &&\n typeof id === \"string\" &&\n typeof action === \"string\" &&\n isRecord(frame.input)\n ) {\n // Left out by an API from before it: the person on the screen gave every yes then.\n const decides = isDecides(frame.decides) ? frame.decides : \"person\";\n return { type: \"request\", id, action, input: frame.input, decides };\n }\n if (\n frame.type === \"tool\" &&\n typeof id === \"string\" &&\n typeof frame.name === \"string\" &&\n isRecord(frame.input)\n ) {\n return { type: \"tool\", id, name: frame.name, input: frame.input };\n }\n if (frame.type === \"handoff\" && typeof frame.reason === \"string\") {\n return { type: \"handoff\", reason: frame.reason };\n }\n if (frame.type === \"holder\" && isHolder(frame.handled_by)) {\n const handover = handoverOf(frame.handover);\n return handover && { type: \"holder\", handled_by: frame.handled_by, handover };\n }\n if (frame.type === \"decision\" && typeof frame.message_id === \"string\") {\n const { message_id } = frame;\n if (frame.decision === null) return { type: \"decision\", message_id, decision: null };\n const decision = decisionOf(frame.decision);\n return decision && { type: \"decision\", message_id, decision };\n }\n if (frame.type === \"browser\") {\n if (frame.open === false) return { type: \"browser\", open: false };\n const browser = frame.open === true ? browserOf(frame) : null;\n return browser && { type: \"browser\", open: true, ...browser };\n }\n if (frame.type === \"browser.frame\" && typeof frame.jpeg === \"string\" && isSize(frame)) {\n const { jpeg, width, height } = frame as { jpeg: string; width: number; height: number };\n return { type: \"browser.frame\", jpeg, width, height };\n }\n if (frame.type === \"working\" || frame.type === \"done\" || frame.type === \"stopped\") {\n return { type: frame.type };\n }\n if (\n frame.type === \"error\" &&\n typeof frame.code === \"string\" &&\n typeof frame.detail === \"string\"\n ) {\n return { type: \"error\", code: frame.code, detail: frame.detail };\n }\n return null;\n}\n"],"mappings":";AA0EA,MAAM,yBAA8B,IAAI,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S,WAAW;EAC5B,IAAI,MAAM,SAAS,OAAO,OAAO;GAAE,MAAM;GAAW,MAAM;EAAM;EAChE,MAAM,UAAU,MAAM,SAAS,OAAO,UAAU,KAAK,IAAI;EACzD,OAAO,WAAW;GAAE,MAAM;GAAW,MAAM;GAAM,GAAG;EAAQ;CAC9D;CACA,IAAI,MAAM,SAAS,mBAAmB,OAAO,MAAM,SAAS,YAAY,OAAO,KAAK,GAAG;EACrF,MAAM,EAAE,MAAM,OAAO,WAAW;EAChC,OAAO;GAAE,MAAM;GAAiB;GAAM;GAAO;EAAO;CACtD;CACA,IAAI,MAAM,SAAS,aAAa,MAAM,SAAS,UAAU,MAAM,SAAS,WACtE,OAAO,EAAE,MAAM,MAAM,KAAK;CAE5B,IACE,MAAM,SAAS,WACf,OAAO,MAAM,SAAS,YACtB,OAAO,MAAM,WAAW,UAExB,OAAO;EAAE,MAAM;EAAS,MAAM,MAAM;EAAM,QAAQ,MAAM;CAAO;CAEjE,OAAO;AACT"}
package/dist/index.d.ts CHANGED
@@ -2,11 +2,11 @@ import { formatSize } from "./kit/numbers.js";
2
2
  import { About, AboutOut, AboutState, ActionFact, AskFact, AutomationFact, AutomationKind, ChannelFact, ChannelKind, ConnectionFact, DataFact, DeviceFact, DeviceKind, Does, Facts, FileFact, ICONS, Icon, MemoryFact, Provider, StatusTone, TOPICS, Told, Topic, VaultFact, aboutState, actionWords, appSteps, appTitle, automationsOf, countOf, generatedName, namesOf, toneOf, toolName, toolTitle } from "./about.js";
3
3
  import { Automation as Automation$1, AutomationState, AutomationView, Board, Run, RunBy, RunRecord, RunStatus, RunStep, Step, Task, Trigger, Use, taskCard } from "./automation/types.js";
4
4
  import { Credentials, Speaker, VISITOR_KEY } from "./credentials.js";
5
- import { AutomationBlock, Block, ButtonBlock, CardBlock, ChartBlock, ChartPoint, ChoiceBlock, DividerBlock, Entry, FieldKind, FieldValue, FieldsBlock, FormBlock, FormField, ImageBlock, ListBlock, NoteBlock, Option, StackBlock, StatBlock, Surface as Surface$1, TableBlock, TextBlock, Tone } from "./blocks.js";
6
- import { Action, AgentFace, Attachment, Author, BrowserControl, BrowserFrame, BrowserInput, BrowserState, BrowserWhere, CallGlance, CallReason, CallToken, Channel, ChannelGlance, ChannelSettings, ChannelStatus, ChannelWeb, ContactGlance, Conversation, ConversationDetail, ConversationFile, ConversationPerson, Decides, Decision, Delivery, FileAt, FileBlock, FileIndex, FilePreview, Handover, Holder, HoursSpan, Message, Request, Step as Step$1, StepApp, StepState, StoredFile, ToolCall, WIDGET_FONTS, WeekHours, Weekday, WidgetConfig, WidgetFont, WidgetLook } from "./types.js";
5
+ import { AutomationBlock, Block, BoardBlock, BoardCard, BoardColumn, ButtonBlock, CalendarBlock, CalendarEvent, CardBlock, ChartBlock, ChartPoint, ChoiceBlock, DividerBlock, Entry, FieldKind, FieldValue, FieldsBlock, FormBlock, FormField, HostBlock, ImageBlock, ListBlock, NoteBlock, Option, Place, StackBlock, StatBlock, Surface as Surface$1, TableBlock, TextBlock, TimelineBlock, TimelineItem, Tone } from "./blocks.js";
6
+ import { Action, AgentFace, Attachment, Author, BrowserControl, BrowserFrame, BrowserInput, BrowserState, BrowserWhere, CallGlance, CallReason, CallToken, Channel, ChannelGlance, ChannelSettings, ChannelStatus, ChannelWeb, ContactGlance, ConversationDetail, ConversationFile, ConversationPerson, Decides, Decision, Delivery, FileAt, FileBlock, FileIndex, FilePreview, Handover, Holder, HoursSpan, Message, Request, Step as Step$1, StepApp, StepState, StoredFile, ToolCall, ViewRendered, WIDGET_FONTS, WeekHours, Weekday, WidgetConfig, WidgetFont, WidgetLook } from "./types.js";
7
7
  import { ApiError, Client, ClientOptions, Files, UploadOptions, createClient } from "./client.js";
8
8
  import { AUTOMATION_MESSAGES, AutomationMessages, CallMessages, DayRef, Verb } from "./automation/messages.js";
9
- import { KIT_MESSAGES, KitLocale, KitMessages } from "./kit/messages.js";
9
+ import { BoardMessages, CalendarMessages, KIT_MESSAGES, KitLocale, KitMessages } from "./kit/messages.js";
10
10
  import { KitClassNames, KitPart, KitProvider } from "./kit/context.js";
11
11
  import { ABOUT_HOME, ABOUT_MESSAGES, AboutControls, AboutMessages, AboutPart, AboutTools, AboutView, AgentAbout, AgentAboutProps, AppDirectory, aboutBack } from "./AgentAbout.js";
12
12
  import { AGENT_ICONS, AgentIcon, agentGlyph } from "./agentIcons.js";
@@ -16,15 +16,18 @@ import { Cron, Wall, fires, occurrences, offsetOf, parseCron } from "./automatio
16
16
  import { When, clockOf, dayRefOf, lineOf, momentOf, scheduleOf, timeOf, tookOf, whenOf } from "./automation/when.js";
17
17
  import { CallLine, Names, StepGroup, appOf, callWords, groupsOf, namingOf, verbOf } from "./automation/record.js";
18
18
  import { AgentTasks, AgentTasksProps, TASKS_POLL_MS, TASK_MESSAGES, TaskMessages, TaskPart, useTasks } from "./AgentTasks.js";
19
- import { AgentCard, AgentCardProps, CardField, CardPart } from "./AgentCard.js";
20
19
  import { FILES_PER_MESSAGE, Frame, TOOL_ERROR_MAX, ToolResult, UpFrame, toolResultOf } from "./frames.js";
21
20
  import { LiveConversation, NO_TOOL, ToolHandler, useConversation } from "./useConversation.js";
22
21
  import { BROWSER_MESSAGES, BrowserMessages, BrowserPart, BrowserView, BrowserViewProps } from "./BrowserView.js";
23
22
  import { Dictate, Dictation, useDictation } from "./useDictation.js";
23
+ import { Placed, PlacedPart } from "./surface/Placed.js";
24
+ import { EVERY_PLACE, SurfacePlaces, placeOf } from "./surface/places.js";
24
25
  import { FileFamily, FileHost, MAX_MB, Uploader, accepts, familyOf } from "./kit/uploads.js";
25
26
  import { SurfaceAction, Values, chosen, filled, labelOf, picked, pressed, problemOf } from "./surface/values.js";
26
- import { BlockProps, SurfaceComponents, SurfacePart } from "./surface/scope.js";
27
+ import { BlockProps, HostBlockProps, HostBlocks, SurfaceComponents, SurfacePart } from "./surface/scope.js";
27
28
  import { AgentChat, AgentChatProps, CHAT_MESSAGES, ChatCompose, ChatLook, ChatMessages, ChatPart, ChatSteps, HandoverBy } from "./AgentChat.js";
29
+ import { Conversation, ConversationProps, THREADS_POLL_MS, THREAD_MESSAGES, ThreadMessages, ThreadPart, Threads, ThreadsProps, Unread, useUnread } from "./Threads.js";
30
+ import { AgentCard, AgentCardProps, CardField, CardPart } from "./AgentCard.js";
28
31
  import { ModeMessages, ModePart, SpaceMode } from "./Modes.js";
29
32
  import { AgentTint, agentTint } from "./tint.js";
30
33
  import { ORB_STYLES, OrbProps, OrbState, OrbStyle } from "./voice/orbs.js";
@@ -32,11 +35,13 @@ import { AgentActivity, CallEnd, CallEndedBy, CallLook, CallProblem, CallState,
32
35
  import { Call, CallJoin, CallMeter, useCall } from "./useCall.js";
33
36
  import { VOICE_CALL_MESSAGES, VoiceCall, VoiceCallMessages, VoiceCallPart, VoiceCallProps } from "./VoiceCall.js";
34
37
  import { AgentSpace, AgentSpaceProps, SPACE_MESSAGES, SpaceLayout, SpaceMessages, SpacePart, captionsOf } from "./AgentSpace.js";
35
- import { AUTOMATION_MESSAGES_ES, BROWSER_MESSAGES_ES, CHAT_MESSAGES_ES, KIT_MESSAGES_ES, SPACE_MESSAGES_ES, TASK_MESSAGES_ES, VOICE_CALL_MESSAGES_ES } from "./es.js";
38
+ import { AUTOMATION_MESSAGES_ES, BROWSER_MESSAGES_ES, CHAT_MESSAGES_ES, KIT_MESSAGES_ES, SPACE_MESSAGES_ES, TASK_MESSAGES_ES, THREAD_MESSAGES_ES, VOICE_CALL_MESSAGES_ES } from "./es.js";
36
39
  import { Orb } from "./voice/Orb.js";
37
40
  import { FILE_MESSAGES, FileMessages, FilePart, FileView, FileViewProps } from "./FileView.js";
38
41
  import { Preview, cleanDocument, previewOf } from "./files.js";
39
42
  import { Button, ButtonProps } from "./kit/Button.js";
43
+ import { Agenda, daysOf, hoursOf } from "./kit/Agenda.js";
44
+ import { Kanban, placed } from "./kit/Kanban.js";
40
45
  import { Card } from "./kit/Card.js";
41
46
  import { ControlBase, Field, FieldIds } from "./kit/Field.js";
42
47
  import { Chips, Choices } from "./kit/Choices.js";
@@ -55,9 +60,11 @@ import { RatingField } from "./kit/RatingField.js";
55
60
  import { Switch, SwitchProps } from "./kit/Switch.js";
56
61
  import { AudioPlayer, AudioPlayerProps } from "./kit/AudioPlayer.js";
57
62
  import { Tag } from "./kit/Tag.js";
63
+ import { Timeline, formatWhen } from "./kit/Timeline.js";
58
64
  import { Tile, TileProps, Tiles } from "./kit/Tile.js";
59
65
  import { DateTimeField, DateTimeFieldProps, TimeField, TimeFieldProps } from "./kit/TimeField.js";
60
66
  import { Surface, SurfaceProps } from "./surface/Surface.js";
61
67
  import { FaceRead, useAgentFace } from "./useAgentFace.js";
68
+ import { VIEW_POLL_MS, View, ViewProps, ViewRead, useView } from "./View.js";
62
69
  import { Live, LiveHandlers, useLive } from "./useLive.js";
63
- export { ABOUT_HOME, ABOUT_MESSAGES, AGENT_ICONS, AUTOMATION_MESSAGES, AUTOMATION_MESSAGES_ES, type About, type AboutControls, type AboutMessages, type AboutOut, type AboutPart, type AboutState, type AboutTools, type AboutView, type Action, type ActionFact, AgentAbout, type AgentAboutProps, type AgentActivity, AgentCard, type AgentCardProps, AgentChat, type AgentChatProps, type AgentFace, type AgentIcon, AgentSpace, type AgentSpaceProps, AgentTasks, type AgentTasksProps, type AgentTint, ApiError, type AppDirectory, type AskFact, type Attachment, AudioPlayer, type AudioPlayerProps, type Author, Automation, type AutomationBlock, type Automation$1 as AutomationData, type AutomationFact, type AutomationKind, type AutomationMessages, type AutomationProps, type AutomationState, type Step as AutomationStep, type AutomationView, BROWSER_MESSAGES, BROWSER_MESSAGES_ES, type Block, type BlockProps, type Board, type BrowserControl, type BrowserFrame, type BrowserInput, type BrowserMessages, type BrowserPart, type BrowserState, BrowserView, type BrowserViewProps, type BrowserWhere, Button, type ButtonBlock, type ButtonProps, CHAT_MESSAGES, CHAT_MESSAGES_ES, type Call, type CallEnd, type CallEndedBy, type CallGlance, type CallJoin, type CallLine, type CallLook, type CallMessages, type CallMeter, type CallProblem, type CallReason, type CallState, type CallToken, Card, type CardBlock, type CardField, type CardPart, type Channel, type ChannelFact, type ChannelGlance, type ChannelKind, type ChannelSettings, type ChannelStatus, type ChannelWeb, type ChartBlock, type ChartPoint, type ChatCompose, type ChatLook, type ChatMessages, type ChatPart, type ChatSteps, Checkbox, Chips, type ChoiceBlock, Choices, type Client, type ClientOptions, Combobox, type ComboboxProps, type ConnectionFact, type ContactGlance, type ControlBase, type Conversation, type ConversationDetail, type ConversationFile, type ConversationPerson, type Credentials, type Cron, type DataFact, DateField, type DateFieldProps, DateTimeField, type DateTimeFieldProps, type DayRef, type Decides, type Decision, type Delivery, type DeviceFact, type DeviceKind, type Dictate, type Dictation, type DividerBlock, type Does, type Entry, FILES_PER_MESSAGE, FILE_MESSAGES, type FaceRead, type Facts, Field, type FieldIds, type FieldKind, type FieldValue, type FieldsBlock, type FileAt, type FileBlock, FileChip, type FileChipProps, FileChips, type FileFact, type FileFamily, FileField, type FileFieldProps, type FileHost, type FileIndex, FileMark, type FileMessages, type FilePart, type FilePreview, FileView, type FileViewProps, type Files, type FormBlock, type FormField, type Frame, type Handover, type HandoverBy, type Holder, type HoursSpan, ICONS, type Icon, type ImageBlock, KIT_MESSAGES, KIT_MESSAGES_ES, type KitClassNames, type KitLocale, type KitMessages, type KitPart, KitProvider, List, type ListBlock, type Live, type LiveConversation, type LiveHandlers, MAX_MB, Mark, type MarkProps, MarkStack, type MemoryFact, type Message, type ModeMessages, type ModePart, NO_TOOL, type Names, Note, type NoteBlock, NumberInput, ORB_STYLES, type Option, Orb, type OrbProps, type OrbState, type OrbStyle, type Preview, type Provider, RangeField, RatingField, type Request, Row, type RowProps, type Run, type RunBy, type RunRecord, type RunStatus, type RunStep, RunView, type RunViewProps, SPACE_MESSAGES, SPACE_MESSAGES_ES, SecretInput, type SpaceLayout, type SpaceMessages, type SpaceMode, type SpacePart, type Speaker, type StackBlock, Stat, type StatBlock, Stats, type StatusTone, type Step$1 as Step, type StepApp, type StepGroup, type StepState, type StoredFile, Surface, type SurfaceAction, type SurfaceComponents, type Surface$1 as SurfaceData, type SurfacePart, type SurfaceProps, Switch, type SwitchProps, TASKS_POLL_MS, TASK_MESSAGES, TASK_MESSAGES_ES, TOOL_ERROR_MAX, TOPICS, type TableBlock, Tag, type Task, type TaskMessages, type TaskPart, TextArea, type TextBlock, TextInput, Tile, type TileProps, Tiles, TimeField, type TimeFieldProps, type Told, type Tone, type ToolCall, type ToolHandler, type ToolResult, type Topic, type Trigger, type UpFrame, type Upload, UploadChips, type UploadOptions, type UploadRules, type Uploader, type Uploads, type Use, VISITOR_KEY, VOICE_CALL_MESSAGES, VOICE_CALL_MESSAGES_ES, type Values, type VaultFact, type Verb, VoiceCall, type VoiceCallMessages, type VoiceCallPart, type VoiceCallProps, WIDGET_FONTS, type Wall, type WeekHours, type Weekday, type When, type WidgetConfig, type WidgetFont, type WidgetLook, aboutBack, aboutState, accepts, actionWords, agentGlyph, agentTint, appOf, appSteps, appTitle, automationsOf, callWords, captionsOf, chosen, cleanDocument, clockOf, countOf, createClient, dayRefOf, durationOf, endedByReason, familyOf, filled, fires, formatSize, generatedName, groupsOf, labelOf, lineOf, lookOf, momentOf, namesOf, namingOf, occurrences, offsetOf, orbOf, parseCron, picked, pressed, previewOf, problemOf, scheduleOf, taskCard, timeOf, toneOf, tookOf, toolName, toolResultOf, toolTitle, useAgentFace, useCall, useConversation, useDictation, useLive, useTasks, useUploads, verbOf, whenOf };
70
+ export { ABOUT_HOME, ABOUT_MESSAGES, AGENT_ICONS, AUTOMATION_MESSAGES, AUTOMATION_MESSAGES_ES, type About, type AboutControls, type AboutMessages, type AboutOut, type AboutPart, type AboutState, type AboutTools, type AboutView, type Action, type ActionFact, Agenda, AgentAbout, type AgentAboutProps, type AgentActivity, AgentCard, type AgentCardProps, AgentChat, type AgentChatProps, type AgentFace, type AgentIcon, AgentSpace, type AgentSpaceProps, AgentTasks, type AgentTasksProps, type AgentTint, ApiError, type AppDirectory, type AskFact, type Attachment, AudioPlayer, type AudioPlayerProps, type Author, Automation, type AutomationBlock, type Automation$1 as AutomationData, type AutomationFact, type AutomationKind, type AutomationMessages, type AutomationProps, type AutomationState, type Step as AutomationStep, type AutomationView, BROWSER_MESSAGES, BROWSER_MESSAGES_ES, type Block, type BlockProps, type Board, type BoardBlock, type BoardCard, type BoardColumn, type BoardMessages, type BrowserControl, type BrowserFrame, type BrowserInput, type BrowserMessages, type BrowserPart, type BrowserState, BrowserView, type BrowserViewProps, type BrowserWhere, Button, type ButtonBlock, type ButtonProps, CHAT_MESSAGES, CHAT_MESSAGES_ES, type CalendarBlock, type CalendarEvent, type CalendarMessages, type Call, type CallEnd, type CallEndedBy, type CallGlance, type CallJoin, type CallLine, type CallLook, type CallMessages, type CallMeter, type CallProblem, type CallReason, type CallState, type CallToken, Card, type CardBlock, type CardField, type CardPart, type Channel, type ChannelFact, type ChannelGlance, type ChannelKind, type ChannelSettings, type ChannelStatus, type ChannelWeb, type ChartBlock, type ChartPoint, type ChatCompose, type ChatLook, type ChatMessages, type ChatPart, type ChatSteps, Checkbox, Chips, type ChoiceBlock, Choices, type Client, type ClientOptions, Combobox, type ComboboxProps, type ConnectionFact, type ContactGlance, type ControlBase, Conversation, type ConversationDetail, type ConversationFile, type ConversationPerson, type ConversationProps, type Credentials, type Cron, type DataFact, DateField, type DateFieldProps, DateTimeField, type DateTimeFieldProps, type DayRef, type Decides, type Decision, type Delivery, type DeviceFact, type DeviceKind, type Dictate, type Dictation, type DividerBlock, type Does, EVERY_PLACE, type Entry, FILES_PER_MESSAGE, FILE_MESSAGES, type FaceRead, type Facts, Field, type FieldIds, type FieldKind, type FieldValue, type FieldsBlock, type FileAt, type FileBlock, FileChip, type FileChipProps, FileChips, type FileFact, type FileFamily, FileField, type FileFieldProps, type FileHost, type FileIndex, FileMark, type FileMessages, type FilePart, type FilePreview, FileView, type FileViewProps, type Files, type FormBlock, type FormField, type Frame, type Handover, type HandoverBy, type Holder, type HostBlock, type HostBlockProps, type HostBlocks, type HoursSpan, ICONS, type Icon, type ImageBlock, KIT_MESSAGES, KIT_MESSAGES_ES, Kanban, type KitClassNames, type KitLocale, type KitMessages, type KitPart, KitProvider, List, type ListBlock, type Live, type LiveConversation, type LiveHandlers, MAX_MB, Mark, type MarkProps, MarkStack, type MemoryFact, type Message, type ModeMessages, type ModePart, NO_TOOL, type Names, Note, type NoteBlock, NumberInput, ORB_STYLES, type Option, Orb, type OrbProps, type OrbState, type OrbStyle, type Place, Placed, type PlacedPart, type Preview, type Provider, RangeField, RatingField, type Request, Row, type RowProps, type Run, type RunBy, type RunRecord, type RunStatus, type RunStep, RunView, type RunViewProps, SPACE_MESSAGES, SPACE_MESSAGES_ES, SecretInput, type SpaceLayout, type SpaceMessages, type SpaceMode, type SpacePart, type Speaker, type StackBlock, Stat, type StatBlock, Stats, type StatusTone, type Step$1 as Step, type StepApp, type StepGroup, type StepState, type StoredFile, Surface, type SurfaceAction, type SurfaceComponents, type Surface$1 as SurfaceData, type SurfacePart, type SurfacePlaces, type SurfaceProps, Switch, type SwitchProps, TASKS_POLL_MS, TASK_MESSAGES, TASK_MESSAGES_ES, THREADS_POLL_MS, THREAD_MESSAGES, THREAD_MESSAGES_ES, TOOL_ERROR_MAX, TOPICS, type TableBlock, Tag, type Task, type TaskMessages, type TaskPart, TextArea, type TextBlock, TextInput, type ThreadMessages, type ThreadPart, Threads, type ThreadsProps, Tile, type TileProps, Tiles, TimeField, type TimeFieldProps, Timeline, type TimelineBlock, type TimelineItem, type Told, type Tone, type ToolCall, type ToolHandler, type ToolResult, type Topic, type Trigger, type Unread, type UpFrame, type Upload, UploadChips, type UploadOptions, type UploadRules, type Uploader, type Uploads, type Use, VIEW_POLL_MS, VISITOR_KEY, VOICE_CALL_MESSAGES, VOICE_CALL_MESSAGES_ES, type Values, type VaultFact, type Verb, View, type ViewProps, type ViewRead, type ViewRendered, VoiceCall, type VoiceCallMessages, type VoiceCallPart, type VoiceCallProps, WIDGET_FONTS, type Wall, type WeekHours, type Weekday, type When, type WidgetConfig, type WidgetFont, type WidgetLook, aboutBack, aboutState, accepts, actionWords, agentGlyph, agentTint, appOf, appSteps, appTitle, automationsOf, callWords, captionsOf, chosen, cleanDocument, clockOf, countOf, createClient, dayRefOf, daysOf, durationOf, endedByReason, familyOf, filled, fires, formatSize, formatWhen, generatedName, groupsOf, hoursOf, labelOf, lineOf, lookOf, momentOf, namesOf, namingOf, occurrences, offsetOf, orbOf, parseCron, picked, placeOf, placed, pressed, previewOf, problemOf, scheduleOf, taskCard, timeOf, toneOf, tookOf, toolName, toolResultOf, toolTitle, useAgentFace, useCall, useConversation, useDictation, useLive, useTasks, useUnread, useUploads, useView, verbOf, whenOf };
package/dist/index.js CHANGED
@@ -26,18 +26,22 @@ import { agentTint } from "./tint.js";
26
26
  import { ABOUT_HOME, ABOUT_MESSAGES, AgentAbout, aboutBack } from "./AgentAbout.js";
27
27
  import { taskCard } from "./automation/types.js";
28
28
  import { AgentTasks, TASKS_POLL_MS, TASK_MESSAGES, useTasks } from "./AgentTasks.js";
29
- import { AgentCard } from "./AgentCard.js";
30
29
  import { BROWSER_MESSAGES, BrowserView } from "./BrowserView.js";
31
30
  import { useDictation } from "./useDictation.js";
32
31
  import { FILES_PER_MESSAGE, TOOL_ERROR_MAX, toolResultOf } from "./frames.js";
33
32
  import { AudioPlayer } from "./kit/AudioPlayer.js";
34
33
  import { Field } from "./kit/Field.js";
34
+ import { Checkbox, NumberInput, SecretInput, TextArea, TextInput } from "./kit/Inputs.js";
35
35
  import { FileChip, FileChips, FileField, UploadChips, useUploads } from "./kit/FileField.js";
36
+ import { Placed } from "./surface/Placed.js";
37
+ import { EVERY_PLACE, placeOf } from "./surface/places.js";
38
+ import { Agenda, daysOf, hoursOf } from "./kit/Agenda.js";
39
+ import { Kanban, placed } from "./kit/Kanban.js";
36
40
  import { Card } from "./kit/Card.js";
41
+ import { Timeline, formatWhen } from "./kit/Timeline.js";
37
42
  import { Chips, Choices } from "./kit/Choices.js";
38
43
  import { Combobox } from "./kit/Combobox.js";
39
44
  import { DateField } from "./kit/DateField.js";
40
- import { Checkbox, NumberInput, SecretInput, TextArea, TextInput } from "./kit/Inputs.js";
41
45
  import { RangeField } from "./kit/RangeField.js";
42
46
  import { RatingField } from "./kit/RatingField.js";
43
47
  import { DateTimeField, TimeField } from "./kit/TimeField.js";
@@ -46,9 +50,11 @@ import { Surface } from "./surface/Surface.js";
46
50
  import { useLive } from "./useLive.js";
47
51
  import { NO_TOOL, useConversation } from "./useConversation.js";
48
52
  import { AgentChat, CHAT_MESSAGES } from "./AgentChat.js";
53
+ import { Conversation, THREADS_POLL_MS, THREAD_MESSAGES, Threads, useUnread } from "./Threads.js";
54
+ import { AgentCard } from "./AgentCard.js";
49
55
  import { useAgentFace } from "./useAgentFace.js";
50
56
  import { AgentSpace, SPACE_MESSAGES, captionsOf } from "./AgentSpace.js";
51
- import { AUTOMATION_MESSAGES_ES, BROWSER_MESSAGES_ES, CHAT_MESSAGES_ES, KIT_MESSAGES_ES, SPACE_MESSAGES_ES, TASK_MESSAGES_ES, VOICE_CALL_MESSAGES_ES } from "./es.js";
57
+ import { AUTOMATION_MESSAGES_ES, BROWSER_MESSAGES_ES, CHAT_MESSAGES_ES, KIT_MESSAGES_ES, SPACE_MESSAGES_ES, TASK_MESSAGES_ES, THREAD_MESSAGES_ES, VOICE_CALL_MESSAGES_ES } from "./es.js";
52
58
  import { durationOf, endedByReason, lookOf, orbOf } from "./call.js";
53
59
  import { useCall } from "./useCall.js";
54
60
  import { ORB_STYLES } from "./voice/orbs.js";
@@ -57,4 +63,5 @@ import { VOICE_CALL_MESSAGES, VoiceCall } from "./VoiceCall.js";
57
63
  import { FILE_MESSAGES, FileView } from "./FileView.js";
58
64
  import { Tile, Tiles } from "./kit/Tile.js";
59
65
  import { WIDGET_FONTS } from "./types.js";
60
- export { ABOUT_HOME, ABOUT_MESSAGES, AGENT_ICONS, AUTOMATION_MESSAGES, AUTOMATION_MESSAGES_ES, AgentAbout, AgentCard, AgentChat, AgentSpace, AgentTasks, ApiError, AudioPlayer, Automation, BROWSER_MESSAGES, BROWSER_MESSAGES_ES, BrowserView, Button, CHAT_MESSAGES, CHAT_MESSAGES_ES, Card, Checkbox, Chips, Choices, Combobox, DateField, DateTimeField, FILES_PER_MESSAGE, FILE_MESSAGES, Field, FileChip, FileChips, FileField, FileMark, FileView, ICONS, KIT_MESSAGES, KIT_MESSAGES_ES, KitProvider, List, MAX_MB, Mark, MarkStack, NO_TOOL, Note, NumberInput, ORB_STYLES, Orb, RangeField, RatingField, Row, RunView, SPACE_MESSAGES, SPACE_MESSAGES_ES, SecretInput, Stat, Stats, Surface, Switch, TASKS_POLL_MS, TASK_MESSAGES, TASK_MESSAGES_ES, TOOL_ERROR_MAX, TOPICS, Tag, TextArea, TextInput, Tile, Tiles, TimeField, UploadChips, VISITOR_KEY, VOICE_CALL_MESSAGES, VOICE_CALL_MESSAGES_ES, VoiceCall, WIDGET_FONTS, aboutBack, aboutState, accepts, actionWords, agentGlyph, agentTint, appOf, appSteps, appTitle, automationsOf, callWords, captionsOf, chosen, cleanDocument, clockOf, countOf, createClient, dayRefOf, durationOf, endedByReason, familyOf, filled, fires, formatSize, generatedName, groupsOf, labelOf, lineOf, lookOf, momentOf, namesOf, namingOf, occurrences, offsetOf, orbOf, parseCron, picked, pressed, previewOf, problemOf, scheduleOf, taskCard, timeOf, toneOf, tookOf, toolName, toolResultOf, toolTitle, useAgentFace, useCall, useConversation, useDictation, useLive, useTasks, useUploads, verbOf, whenOf };
66
+ import { VIEW_POLL_MS, View, useView } from "./View.js";
67
+ export { ABOUT_HOME, ABOUT_MESSAGES, AGENT_ICONS, AUTOMATION_MESSAGES, AUTOMATION_MESSAGES_ES, Agenda, AgentAbout, AgentCard, AgentChat, AgentSpace, AgentTasks, ApiError, AudioPlayer, Automation, BROWSER_MESSAGES, BROWSER_MESSAGES_ES, BrowserView, Button, CHAT_MESSAGES, CHAT_MESSAGES_ES, Card, Checkbox, Chips, Choices, Combobox, Conversation, DateField, DateTimeField, EVERY_PLACE, FILES_PER_MESSAGE, FILE_MESSAGES, Field, FileChip, FileChips, FileField, FileMark, FileView, ICONS, KIT_MESSAGES, KIT_MESSAGES_ES, Kanban, KitProvider, List, MAX_MB, Mark, MarkStack, NO_TOOL, Note, NumberInput, ORB_STYLES, Orb, Placed, RangeField, RatingField, Row, RunView, SPACE_MESSAGES, SPACE_MESSAGES_ES, SecretInput, Stat, Stats, Surface, Switch, TASKS_POLL_MS, TASK_MESSAGES, TASK_MESSAGES_ES, THREADS_POLL_MS, THREAD_MESSAGES, THREAD_MESSAGES_ES, TOOL_ERROR_MAX, TOPICS, Tag, TextArea, TextInput, Threads, Tile, Tiles, TimeField, Timeline, UploadChips, VIEW_POLL_MS, VISITOR_KEY, VOICE_CALL_MESSAGES, VOICE_CALL_MESSAGES_ES, View, VoiceCall, WIDGET_FONTS, aboutBack, aboutState, accepts, actionWords, agentGlyph, agentTint, appOf, appSteps, appTitle, automationsOf, callWords, captionsOf, chosen, cleanDocument, clockOf, countOf, createClient, dayRefOf, daysOf, durationOf, endedByReason, familyOf, filled, fires, formatSize, formatWhen, generatedName, groupsOf, hoursOf, labelOf, lineOf, lookOf, momentOf, namesOf, namingOf, occurrences, offsetOf, orbOf, parseCron, picked, placeOf, placed, pressed, previewOf, problemOf, scheduleOf, taskCard, timeOf, toneOf, tookOf, toolName, toolResultOf, toolTitle, useAgentFace, useCall, useConversation, useDictation, useLive, useTasks, useUnread, useUploads, useView, verbOf, whenOf };
@@ -0,0 +1,25 @@
1
+ import { CalendarEvent } from "../blocks.js";
2
+ //#region src/kit/Agenda.d.ts
3
+ /** The days a calendar shows from its first: a day's, or a week's. */
4
+ export declare function daysOf(span: "day" | "week", start: string): string[];
5
+ /** An event's hours as the language writes them: "10:00 – 11:00", one end, or none (a day). */
6
+ export declare function hoursOf(event: CalendarEvent, code: string): string | null;
7
+ /**
8
+ * A day's events, or a week's, at their hours: each day under its weekday and number (today in
9
+ * the accent), its events in order, each with its hours (or "all day"), its title and a quiet
10
+ * line of detail. In a narrow place the days go one under another, an empty one a single quiet
11
+ * line; wide enough, the week stands as seven columns. An event with a page opens it apart;
12
+ * with `onEvent`, pressing one sends it.
13
+ */
14
+ export declare function Agenda({ span, start, events, onEvent, disabled, today }: {
15
+ span: "day" | "week";
16
+ /** The first day shown, "YYYY-MM-DD". */
17
+ start: string;
18
+ events: CalendarEvent[];
19
+ onEvent?: ((event: CalendarEvent) => void) | undefined;
20
+ disabled?: boolean | undefined;
21
+ /** What counts as today; now by default. */
22
+ today?: Date | undefined;
23
+ }): import("react").JSX.Element;
24
+ //#endregion
25
+ //# sourceMappingURL=Agenda.d.ts.map