@signalcore/ui 1.0.0-beta.1 → 1.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -22
- package/dist/AgentAbout.js +11 -4
- package/dist/AgentAbout.js.map +1 -1
- package/dist/AgentChat.d.ts +7 -1
- package/dist/AgentChat.js +154 -2
- package/dist/AgentChat.js.map +1 -1
- package/dist/AgentSpace.d.ts +12 -3
- package/dist/AgentSpace.js +53 -11
- package/dist/AgentSpace.js.map +1 -1
- package/dist/AgentTasks.js +2 -1
- package/dist/AgentTasks.js.map +1 -1
- package/dist/Threads.d.ts +73 -0
- package/dist/Threads.js +140 -0
- package/dist/Threads.js.map +1 -0
- package/dist/VoiceCall.js +1 -1
- package/dist/VoiceCall.js.map +1 -1
- package/dist/about.d.ts +34 -144
- package/dist/about.js +6 -8
- package/dist/about.js.map +1 -1
- package/dist/automation/cron.d.ts +1 -1
- package/dist/automation/cron.js.map +1 -1
- package/dist/automation/marks.js +13 -5
- package/dist/automation/marks.js.map +1 -1
- package/dist/automation/messages.d.ts +6 -0
- package/dist/automation/messages.js +7 -1
- package/dist/automation/messages.js.map +1 -1
- package/dist/automation/types.d.ts +25 -128
- package/dist/automation/types.js +36 -0
- package/dist/automation/types.js.map +1 -0
- package/dist/automation/when.d.ts +1 -1
- package/dist/automation/when.js +13 -1
- package/dist/automation/when.js.map +1 -1
- package/dist/blocks.d.ts +23 -1
- package/dist/browser.js +2 -2
- package/dist/browser.js.map +1 -1
- package/dist/call.d.ts +1 -1
- package/dist/call.js.map +1 -1
- package/dist/client.d.ts +14 -4
- package/dist/client.js +7 -2
- package/dist/client.js.map +1 -1
- package/dist/contract.d.ts +267 -0
- package/dist/credentials.js.map +1 -1
- package/dist/dev.js +1 -1
- package/dist/dev.js.map +1 -1
- package/dist/es.d.ts +2 -0
- package/dist/es.js +31 -4
- package/dist/es.js.map +1 -1
- package/dist/frames.d.ts +7 -1
- package/dist/frames.js.map +1 -1
- package/dist/index.d.ts +6 -5
- package/dist/index.js +6 -4
- package/dist/kit/AudioPlayer.js +1 -1
- package/dist/kit/AudioPlayer.js.map +1 -1
- package/dist/kit/Choices.js +1 -1
- package/dist/kit/Choices.js.map +1 -1
- package/dist/kit/FileField.js +1 -1
- package/dist/kit/FileField.js.map +1 -1
- package/dist/kit/Popover.js.map +1 -1
- package/dist/kit/Tile.d.ts +1 -1
- package/dist/kit/Tile.js +1 -1
- package/dist/kit/Tile.js.map +1 -1
- package/dist/kit/messages.d.ts +13 -0
- package/dist/kit/messages.js +7 -1
- package/dist/kit/messages.js.map +1 -1
- package/dist/kit/uploads.d.ts +2 -1
- package/dist/kit/uploads.js +1 -1
- package/dist/kit/uploads.js.map +1 -1
- package/dist/kit/waveform.js.map +1 -1
- package/dist/markdown.js.map +1 -1
- package/dist/marks.js +2 -3
- package/dist/marks.js.map +1 -1
- package/dist/surface/Form.js +1 -1
- package/dist/surface/Markdown.js +1 -1
- package/dist/surface/Markdown.js.map +1 -1
- package/dist/surface/Surface.js +43 -4
- package/dist/surface/Surface.js.map +1 -1
- package/dist/surface/scope.d.ts +1 -1
- package/dist/surface/scope.js.map +1 -1
- package/dist/surface/values.js +1 -1
- package/dist/surface/values.js.map +1 -1
- package/dist/tint.d.ts +1 -1
- package/dist/tint.js +1 -1
- package/dist/tint.js.map +1 -1
- package/dist/types.d.ts +11 -0
- package/dist/types.js.map +1 -1
- package/dist/useConversation.d.ts +2 -0
- package/dist/useConversation.js +16 -0
- package/dist/useConversation.js.map +1 -1
- package/dist/usePolled.js +1 -1
- package/dist/usePolled.js.map +1 -1
- package/dist/voice/webgl.js +1 -1
- package/dist/voice/webgl.js.map +1 -1
- package/dist/widget.js +17 -16
- package/package.json +1 -1
- package/src/AgentAbout.tsx +14 -3
- package/src/AgentChat.tsx +203 -1
- package/src/AgentSpace.tsx +89 -13
- package/src/AgentTasks.tsx +2 -2
- package/src/Threads.tsx +218 -0
- package/src/VoiceCall.tsx +1 -1
- package/src/about.ts +42 -144
- package/src/automation/cron.ts +1 -1
- package/src/automation/marks.tsx +13 -2
- package/src/automation/messages.ts +12 -0
- package/src/automation/types.ts +58 -118
- package/src/automation/when.ts +7 -1
- package/src/blocks.ts +25 -0
- package/src/browser.ts +4 -4
- package/src/call.ts +1 -1
- package/src/client.ts +26 -10
- package/src/contract.ts +1934 -0
- package/src/credentials.ts +2 -2
- package/src/dev.ts +1 -1
- package/src/es.ts +29 -0
- package/src/frames.ts +3 -1
- package/src/index.ts +10 -1
- package/src/kit/AudioPlayer.tsx +1 -1
- package/src/kit/Choices.tsx +1 -1
- package/src/kit/FileField.tsx +1 -1
- package/src/kit/Popover.tsx +1 -1
- package/src/kit/Tile.tsx +1 -1
- package/src/kit/messages.ts +20 -0
- package/src/kit/uploads.ts +2 -2
- package/src/kit/waveform.ts +1 -1
- package/src/markdown.ts +1 -1
- package/src/marks.tsx +3 -123
- package/src/styles.css +206 -0
- package/src/surface/Markdown.tsx +1 -1
- package/src/surface/Surface.tsx +53 -4
- package/src/surface/scope.ts +3 -1
- package/src/surface/values.ts +5 -5
- package/src/tint.ts +1 -1
- package/src/types.ts +11 -0
- package/src/useConversation.ts +10 -0
- package/src/usePolled.ts +2 -2
- package/src/voice/webgl.ts +1 -1
- package/src/widget/element.tsx +13 -4
- package/src/widget/widget.css +13 -0
package/dist/es.js
CHANGED
|
@@ -41,6 +41,9 @@ 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",
|
|
46
|
+
platform: "Cuando llega un mensaje",
|
|
44
47
|
event: (app, event) => event ? `Cuando pasa «${event}» en ${app ?? "una app"}` : `Cuando pasa algo en ${app ?? "una app"}`,
|
|
45
48
|
next: (day, time) => [
|
|
46
49
|
"próxima",
|
|
@@ -78,8 +81,11 @@ const AUTOMATION_MESSAGES_ES = {
|
|
|
78
81
|
schedule: "horario",
|
|
79
82
|
webhook: "webhook",
|
|
80
83
|
event: app ? `evento de ${app}` : "evento",
|
|
84
|
+
platform: "un mensaje",
|
|
81
85
|
agent: "se lo pidieron en el chat",
|
|
82
|
-
test: "prueba"
|
|
86
|
+
test: "prueba",
|
|
87
|
+
api: "tu app",
|
|
88
|
+
after: "tras otra"
|
|
83
89
|
})[by],
|
|
84
90
|
statuses: {
|
|
85
91
|
running: "En curso",
|
|
@@ -179,7 +185,13 @@ const KIT_MESSAGES_ES = {
|
|
|
179
185
|
play: "Reproducir",
|
|
180
186
|
pause: "Pausar",
|
|
181
187
|
position: "Posición",
|
|
182
|
-
automation: AUTOMATION_MESSAGES_ES
|
|
188
|
+
automation: AUTOMATION_MESSAGES_ES,
|
|
189
|
+
connect: {
|
|
190
|
+
authorize: (app) => `Autorizar en ${app}`,
|
|
191
|
+
connected: "Conectada",
|
|
192
|
+
failed: "No se ha podido conectar",
|
|
193
|
+
preparing: "Preparando la conexión"
|
|
194
|
+
}
|
|
183
195
|
};
|
|
184
196
|
const BROWSER_MESSAGES_ES = {
|
|
185
197
|
agent: (name) => `Lo controla ${name}`,
|
|
@@ -259,6 +271,10 @@ const CHAT_MESSAGES_ES = {
|
|
|
259
271
|
inputs: {},
|
|
260
272
|
allow: "Aprobar",
|
|
261
273
|
decline: "Rechazar",
|
|
274
|
+
approvals: (count) => `${count} acciones esperan tu aprobación`,
|
|
275
|
+
approveAll: "Aprobar todo",
|
|
276
|
+
approveSome: (count) => `Aprobar ${count}`,
|
|
277
|
+
declineAll: "Rechazar todo",
|
|
262
278
|
confirming: "Esperando la confirmación del negocio",
|
|
263
279
|
handedOff: "Pasada a una persona",
|
|
264
280
|
handover: (holder, by, name) => {
|
|
@@ -360,6 +376,16 @@ const TASK_MESSAGES_ES = {
|
|
|
360
376
|
empty: "No hay nada programado. Pídele que te recuerde algo, o que te escriba más adelante.",
|
|
361
377
|
failed: "No se ha podido cambiar. Inténtalo de nuevo."
|
|
362
378
|
};
|
|
379
|
+
const THREAD_MESSAGES_ES = {
|
|
380
|
+
open: "Conversaciones",
|
|
381
|
+
title: "Tus conversaciones",
|
|
382
|
+
back: "Volver a la conversación",
|
|
383
|
+
new: "Nueva conversación",
|
|
384
|
+
untitled: "Conversación nueva",
|
|
385
|
+
unread: (count) => count === 1 ? "1 mensaje sin leer" : `${count} mensajes sin leer`,
|
|
386
|
+
waiting: "Te espera",
|
|
387
|
+
empty: "Aún no hay nada aquí."
|
|
388
|
+
};
|
|
363
389
|
const SPACE_MESSAGES_ES = {
|
|
364
390
|
modes: {
|
|
365
391
|
label: "Modo",
|
|
@@ -374,9 +400,10 @@ const SPACE_MESSAGES_ES = {
|
|
|
374
400
|
retry: "Reintentar",
|
|
375
401
|
chat: CHAT_MESSAGES_ES,
|
|
376
402
|
voice: VOICE_CALL_MESSAGES_ES,
|
|
377
|
-
tasks: TASK_MESSAGES_ES
|
|
403
|
+
tasks: TASK_MESSAGES_ES,
|
|
404
|
+
threads: THREAD_MESSAGES_ES
|
|
378
405
|
};
|
|
379
406
|
//#endregion
|
|
380
|
-
export { AUTOMATION_MESSAGES_ES, BROWSER_MESSAGES_ES, CHAT_MESSAGES_ES, KIT_MESSAGES_ES, SPACE_MESSAGES_ES, TASK_MESSAGES_ES, VOICE_CALL_MESSAGES_ES };
|
|
407
|
+
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 };
|
|
381
408
|
|
|
382
409
|
//# 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 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 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};\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,QAA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CAAM;CACpD,OAAO;CACP,OAAO;CACP,OAAO;CACP,SAAS;CACT,QAAQ;CACR,OAAO;CACP,MAAM;CACN,OAAO;CACP,OAAO;AACT"}
|
|
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 { 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};\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 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"],"mappings":";;AAgBA,MAAM,MAAM,SAAyB,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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
|
|
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";
|
package/dist/frames.js.map
CHANGED
|
@@ -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,KAAa,UAAU,MAAM,OAAO;AAEzD,MAAM,UAAU,UACd,SAAS,KAAK,KACd,OAAO,MAAM,OAAO,YACpB,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"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,IAAI;CAAC;CAAW;CAAW;CAAQ;AAAQ,CAAC;AACpF,MAAM,0BAA+B,IAAI,IAAI;CAAC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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
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
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
|
-
import { Automation as Automation$1, AutomationState, AutomationView, Board, Run, RunBy, RunRecord, RunStatus, RunStep, Step, Task, Trigger, Use } from "./automation/types.js";
|
|
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
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,
|
|
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, 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
9
|
import { KIT_MESSAGES, KitLocale, KitMessages } from "./kit/messages.js";
|
|
@@ -16,7 +16,6 @@ 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";
|
|
@@ -25,6 +24,8 @@ import { FileFamily, FileHost, MAX_MB, Uploader, accepts, familyOf } from "./kit
|
|
|
25
24
|
import { SurfaceAction, Values, chosen, filled, labelOf, picked, pressed, problemOf } from "./surface/values.js";
|
|
26
25
|
import { BlockProps, SurfaceComponents, SurfacePart } from "./surface/scope.js";
|
|
27
26
|
import { AgentChat, AgentChatProps, CHAT_MESSAGES, ChatCompose, ChatLook, ChatMessages, ChatPart, ChatSteps, HandoverBy } from "./AgentChat.js";
|
|
27
|
+
import { Conversation, ConversationProps, THREADS_POLL_MS, THREAD_MESSAGES, ThreadMessages, ThreadPart, Threads, ThreadsProps, Unread, useUnread } from "./Threads.js";
|
|
28
|
+
import { AgentCard, AgentCardProps, CardField, CardPart } from "./AgentCard.js";
|
|
28
29
|
import { ModeMessages, ModePart, SpaceMode } from "./Modes.js";
|
|
29
30
|
import { AgentTint, agentTint } from "./tint.js";
|
|
30
31
|
import { ORB_STYLES, OrbProps, OrbState, OrbStyle } from "./voice/orbs.js";
|
|
@@ -32,7 +33,7 @@ import { AgentActivity, CallEnd, CallEndedBy, CallLook, CallProblem, CallState,
|
|
|
32
33
|
import { Call, CallJoin, CallMeter, useCall } from "./useCall.js";
|
|
33
34
|
import { VOICE_CALL_MESSAGES, VoiceCall, VoiceCallMessages, VoiceCallPart, VoiceCallProps } from "./VoiceCall.js";
|
|
34
35
|
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";
|
|
36
|
+
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
37
|
import { Orb } from "./voice/Orb.js";
|
|
37
38
|
import { FILE_MESSAGES, FileMessages, FilePart, FileView, FileViewProps } from "./FileView.js";
|
|
38
39
|
import { Preview, cleanDocument, previewOf } from "./files.js";
|
|
@@ -60,4 +61,4 @@ import { DateTimeField, DateTimeFieldProps, TimeField, TimeFieldProps } from "./
|
|
|
60
61
|
import { Surface, SurfaceProps } from "./surface/Surface.js";
|
|
61
62
|
import { FaceRead, useAgentFace } from "./useAgentFace.js";
|
|
62
63
|
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,
|
|
64
|
+
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, 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, 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, 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, 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, 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, useUnread, useUploads, verbOf, whenOf };
|
package/dist/index.js
CHANGED
|
@@ -24,19 +24,19 @@ import { FileMark } from "./kit/FileMark.js";
|
|
|
24
24
|
import { MarkStack } from "./kit/MarkStack.js";
|
|
25
25
|
import { agentTint } from "./tint.js";
|
|
26
26
|
import { ABOUT_HOME, ABOUT_MESSAGES, AgentAbout, aboutBack } from "./AgentAbout.js";
|
|
27
|
+
import { taskCard } from "./automation/types.js";
|
|
27
28
|
import { AgentTasks, TASKS_POLL_MS, TASK_MESSAGES, useTasks } from "./AgentTasks.js";
|
|
28
|
-
import { AgentCard } from "./AgentCard.js";
|
|
29
29
|
import { BROWSER_MESSAGES, BrowserView } from "./BrowserView.js";
|
|
30
30
|
import { useDictation } from "./useDictation.js";
|
|
31
31
|
import { FILES_PER_MESSAGE, TOOL_ERROR_MAX, toolResultOf } from "./frames.js";
|
|
32
32
|
import { AudioPlayer } from "./kit/AudioPlayer.js";
|
|
33
33
|
import { Field } from "./kit/Field.js";
|
|
34
|
+
import { Checkbox, NumberInput, SecretInput, TextArea, TextInput } from "./kit/Inputs.js";
|
|
34
35
|
import { FileChip, FileChips, FileField, UploadChips, useUploads } from "./kit/FileField.js";
|
|
35
36
|
import { Card } from "./kit/Card.js";
|
|
36
37
|
import { Chips, Choices } from "./kit/Choices.js";
|
|
37
38
|
import { Combobox } from "./kit/Combobox.js";
|
|
38
39
|
import { DateField } from "./kit/DateField.js";
|
|
39
|
-
import { Checkbox, NumberInput, SecretInput, TextArea, TextInput } from "./kit/Inputs.js";
|
|
40
40
|
import { RangeField } from "./kit/RangeField.js";
|
|
41
41
|
import { RatingField } from "./kit/RatingField.js";
|
|
42
42
|
import { DateTimeField, TimeField } from "./kit/TimeField.js";
|
|
@@ -45,9 +45,11 @@ import { Surface } from "./surface/Surface.js";
|
|
|
45
45
|
import { useLive } from "./useLive.js";
|
|
46
46
|
import { NO_TOOL, useConversation } from "./useConversation.js";
|
|
47
47
|
import { AgentChat, CHAT_MESSAGES } from "./AgentChat.js";
|
|
48
|
+
import { Conversation, THREADS_POLL_MS, THREAD_MESSAGES, Threads, useUnread } from "./Threads.js";
|
|
49
|
+
import { AgentCard } from "./AgentCard.js";
|
|
48
50
|
import { useAgentFace } from "./useAgentFace.js";
|
|
49
51
|
import { AgentSpace, SPACE_MESSAGES, captionsOf } from "./AgentSpace.js";
|
|
50
|
-
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";
|
|
52
|
+
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";
|
|
51
53
|
import { durationOf, endedByReason, lookOf, orbOf } from "./call.js";
|
|
52
54
|
import { useCall } from "./useCall.js";
|
|
53
55
|
import { ORB_STYLES } from "./voice/orbs.js";
|
|
@@ -56,4 +58,4 @@ import { VOICE_CALL_MESSAGES, VoiceCall } from "./VoiceCall.js";
|
|
|
56
58
|
import { FILE_MESSAGES, FileView } from "./FileView.js";
|
|
57
59
|
import { Tile, Tiles } from "./kit/Tile.js";
|
|
58
60
|
import { WIDGET_FONTS } from "./types.js";
|
|
59
|
-
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, timeOf, toneOf, tookOf, toolName, toolResultOf, toolTitle, useAgentFace, useCall, useConversation, useDictation, useLive, useTasks, useUploads, verbOf, whenOf };
|
|
61
|
+
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, Conversation, 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, THREADS_POLL_MS, THREAD_MESSAGES, THREAD_MESSAGES_ES, TOOL_ERROR_MAX, TOPICS, Tag, TextArea, TextInput, Threads, 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, useUnread, useUploads, verbOf, whenOf };
|
package/dist/kit/AudioPlayer.js
CHANGED
|
@@ -111,6 +111,6 @@ function clock(seconds) {
|
|
|
111
111
|
return hours > 0 ? `${hours}:${String(minutes).padStart(2, "0")}:${rest}` : `${minutes}:${rest}`;
|
|
112
112
|
}
|
|
113
113
|
//#endregion
|
|
114
|
-
export { AudioPlayer
|
|
114
|
+
export { AudioPlayer };
|
|
115
115
|
|
|
116
116
|
//# sourceMappingURL=AudioPlayer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AudioPlayer.js","names":[],"sources":["../../src/kit/AudioPlayer.tsx"],"sourcesContent":["import { PauseIcon, PlayIcon } from \"@phosphor-icons/react\";\nimport { useRef, useState, type ReactEventHandler } from \"react\";\n\nimport { joined, useKit, useParts } from \"./context\";\nimport { useWaveform } from \"./waveform\";\n\nexport interface AudioPlayerProps {\n src: string | undefined;\n /** What it is, for screen readers: a voice note, a call's recording, a file's name. */\n label: string;\n onError?: ReactEventHandler<HTMLAudioElement> | undefined;\n /** In a bar, beside other tools: a smaller play, a shorter waveform. */\n compact?: boolean | undefined;\n className?: string | undefined;\n}\n\n/** How many bars the waveform draws, and how high an even one stands while it is read. */\nconst BARS = { full: 44, compact: 24 } as const;\nconst EVEN = 0.35;\n/** The quietest bar still shows: silence reads as a line, not as nothing. */\nconst LEAST = 0.12;\n\n/**\n * Audio, played the kit's way: a quiet round play and pause, the audio's own waveform (its bars\n * light up as it plays; dragging through it seeks), and its time (how long it is until it plays,\n * then how far it is). The browser's own element plays it, never shown; a length the file\n * doesn't tell yet is learnt as it plays.\n */\nexport function AudioPlayer({ src, label, onError, compact, className }: AudioPlayerProps) {\n const part = useParts();\n const { messages: words } = useKit();\n const audio = useRef<HTMLAudioElement>(null);\n const [playing, setPlaying] = useState(false);\n const [at, setAt] = useState(0);\n const [length, setLength] = useState<number | null>(null);\n const bars = compact ? BARS.compact : BARS.full;\n const wave = useWaveform(src, bars);\n const learn = () => {\n const seconds = audio.current?.duration;\n if (seconds !== undefined && Number.isFinite(seconds)) setLength(seconds);\n };\n // The element's length, else the decoded one (an Ogg tells it only once played through).\n const seconds = length ?? wave?.seconds ?? null;\n const played = seconds ? Math.min(1, at / seconds) : 0;\n return (\n <div\n role=\"group\"\n aria-label={label}\n className={joined(\n part(\"sc-audio\", ...(compact ? ([\"sc-audio--compact\"] as const) : [])),\n className,\n )}\n >\n <audio\n ref={audio}\n src={src}\n preload=\"metadata\"\n onLoadedMetadata={learn}\n onDurationChange={learn}\n onPlay={() => {\n setPlaying(true);\n }}\n onPause={() => {\n setPlaying(false);\n }}\n onEnded={() => {\n setPlaying(false);\n setAt(0);\n }}\n onTimeUpdate={() => {\n learn();\n setAt(audio.current?.currentTime ?? 0);\n }}\n onError={onError}\n />\n <button\n type=\"button\"\n className={part(\"sc-audio__play\")}\n aria-label={playing ? words.pause : words.play}\n disabled={src === undefined}\n onClick={() => {\n const element = audio.current;\n if (element === null) return;\n if (element.paused) void element.play();\n else element.pause();\n }}\n >\n {playing ? <PauseIcon weight=\"fill\" /> : <PlayIcon weight=\"fill\" />}\n </button>\n <div className={part(\"sc-audio__wave\")}>\n {Array.from({ length: bars }, (_, index) => (\n <span\n key={index}\n aria-hidden\n data-played={index / bars < played ? \"\" : undefined}\n style={{ height: `${Math.max(LEAST, wave?.heights[index] ?? EVEN) * 100}%` }}\n />\n ))}\n <input\n type=\"range\"\n min={0}\n max={seconds ?? 0}\n step=\"any\"\n value={Math.min(at, seconds ?? 0)}\n disabled={seconds === null}\n aria-label={words.position}\n aria-valuetext={clock(at)}\n onChange={(event) => {\n const seconds = Number(event.target.value);\n if (audio.current !== null) audio.current.currentTime = seconds;\n setAt(seconds);\n }}\n />\n </div>\n <span className={part(\"sc-audio__time\")}>\n {clock(playing || at > 0 ? at : (seconds ?? 0))}\n </span>\n </div>\n );\n}\n\n/** Seconds as a player says them: 0:07, 1:42, 1:02:05. */\
|
|
1
|
+
{"version":3,"file":"AudioPlayer.js","names":[],"sources":["../../src/kit/AudioPlayer.tsx"],"sourcesContent":["import { PauseIcon, PlayIcon } from \"@phosphor-icons/react\";\nimport { useRef, useState, type ReactEventHandler } from \"react\";\n\nimport { joined, useKit, useParts } from \"./context\";\nimport { useWaveform } from \"./waveform\";\n\nexport interface AudioPlayerProps {\n src: string | undefined;\n /** What it is, for screen readers: a voice note, a call's recording, a file's name. */\n label: string;\n onError?: ReactEventHandler<HTMLAudioElement> | undefined;\n /** In a bar, beside other tools: a smaller play, a shorter waveform. */\n compact?: boolean | undefined;\n className?: string | undefined;\n}\n\n/** How many bars the waveform draws, and how high an even one stands while it is read. */\nconst BARS = { full: 44, compact: 24 } as const;\nconst EVEN = 0.35;\n/** The quietest bar still shows: silence reads as a line, not as nothing. */\nconst LEAST = 0.12;\n\n/**\n * Audio, played the kit's way: a quiet round play and pause, the audio's own waveform (its bars\n * light up as it plays; dragging through it seeks), and its time (how long it is until it plays,\n * then how far it is). The browser's own element plays it, never shown; a length the file\n * doesn't tell yet is learnt as it plays.\n */\nexport function AudioPlayer({ src, label, onError, compact, className }: AudioPlayerProps) {\n const part = useParts();\n const { messages: words } = useKit();\n const audio = useRef<HTMLAudioElement>(null);\n const [playing, setPlaying] = useState(false);\n const [at, setAt] = useState(0);\n const [length, setLength] = useState<number | null>(null);\n const bars = compact ? BARS.compact : BARS.full;\n const wave = useWaveform(src, bars);\n const learn = () => {\n const seconds = audio.current?.duration;\n if (seconds !== undefined && Number.isFinite(seconds)) setLength(seconds);\n };\n // The element's length, else the decoded one (an Ogg tells it only once played through).\n const seconds = length ?? wave?.seconds ?? null;\n const played = seconds ? Math.min(1, at / seconds) : 0;\n return (\n <div\n role=\"group\"\n aria-label={label}\n className={joined(\n part(\"sc-audio\", ...(compact ? ([\"sc-audio--compact\"] as const) : [])),\n className,\n )}\n >\n <audio\n ref={audio}\n src={src}\n preload=\"metadata\"\n onLoadedMetadata={learn}\n onDurationChange={learn}\n onPlay={() => {\n setPlaying(true);\n }}\n onPause={() => {\n setPlaying(false);\n }}\n onEnded={() => {\n setPlaying(false);\n setAt(0);\n }}\n onTimeUpdate={() => {\n learn();\n setAt(audio.current?.currentTime ?? 0);\n }}\n onError={onError}\n />\n <button\n type=\"button\"\n className={part(\"sc-audio__play\")}\n aria-label={playing ? words.pause : words.play}\n disabled={src === undefined}\n onClick={() => {\n const element = audio.current;\n if (element === null) return;\n if (element.paused) void element.play();\n else element.pause();\n }}\n >\n {playing ? <PauseIcon weight=\"fill\" /> : <PlayIcon weight=\"fill\" />}\n </button>\n <div className={part(\"sc-audio__wave\")}>\n {Array.from({ length: bars }, (_, index) => (\n <span\n key={index}\n aria-hidden\n data-played={index / bars < played ? \"\" : undefined}\n style={{ height: `${Math.max(LEAST, wave?.heights[index] ?? EVEN) * 100}%` }}\n />\n ))}\n <input\n type=\"range\"\n min={0}\n max={seconds ?? 0}\n step=\"any\"\n value={Math.min(at, seconds ?? 0)}\n disabled={seconds === null}\n aria-label={words.position}\n aria-valuetext={clock(at)}\n onChange={(event) => {\n const seconds = Number(event.target.value);\n if (audio.current !== null) audio.current.currentTime = seconds;\n setAt(seconds);\n }}\n />\n </div>\n <span className={part(\"sc-audio__time\")}>\n {clock(playing || at > 0 ? at : (seconds ?? 0))}\n </span>\n </div>\n );\n}\n\n/** Seconds as a player says them: 0:07, 1:42, 1:02:05. */\nfunction clock(seconds: number): string {\n const whole = Math.max(0, Math.floor(seconds));\n const hours = Math.floor(whole / 3600);\n const minutes = Math.floor((whole % 3600) / 60);\n const rest = String(whole % 60).padStart(2, \"0\");\n return hours > 0 ? `${hours}:${String(minutes).padStart(2, \"0\")}:${rest}` : `${minutes}:${rest}`;\n}\n"],"mappings":";;;;;;;AAiBA,MAAM,OAAO;CAAE,MAAM;CAAI,SAAS;AAAG;AACrC,MA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GAAG,EAAE,GAAG,SAAS,GAAG,QAAQ,GAAG;AAC5F"}
|
package/dist/kit/Choices.js
CHANGED
package/dist/kit/Choices.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Choices.js","names":[],"sources":["../../src/kit/Choices.tsx"],"sourcesContent":["import { CheckIcon } from \"@phosphor-icons/react\";\nimport { useRef, type KeyboardEvent } from \"react\";\n\nimport { useParts } from \"./context\";\nimport { ariaOf, type ControlBase } from \"./Field\";\nimport { toggled, type Option } from \"./options\";\n\nconst MOVES: Readonly<Record<string, 1 | -1>> = {\n ArrowRight: 1,\n ArrowDown: 1,\n ArrowLeft: -1,\n ArrowUp: -1,\n};\n\n/**\n * A group of radios as native ones behave: one stop for Tab (the one checked, else the first),\n * the arrows move to the next or the previous one and check it, Home and End to the ends.\n */\nexport function useRadios(count: number, checked: number, check: (index: number) => void) {\n const items = useRef<(HTMLElement | null)[]>([]);\n return {\n ref: (index: number) => (element: HTMLElement | null) => {\n items.current[index] = element;\n },\n tabIndex: (index: number) => (index === Math.max(0, checked) ? 0 : -1),\n onKeyDown: (event: KeyboardEvent, index: number) => {\n const move = MOVES[event.key];\n const next =\n event.key === \"Home\"\n ? 0\n : event.key === \"End\"\n ? count - 1\n : move !== undefined\n ? (index + move + count) % count\n : null;\n if (next === null) return;\n event.preventDefault();\n items.current[next]?.focus();\n check(next);\n },\n };\n}\n\n/** Few short options with no hints sit side by side in one bar; any other few are cards. */\
|
|
1
|
+
{"version":3,"file":"Choices.js","names":[],"sources":["../../src/kit/Choices.tsx"],"sourcesContent":["import { CheckIcon } from \"@phosphor-icons/react\";\nimport { useRef, type KeyboardEvent } from \"react\";\n\nimport { useParts } from \"./context\";\nimport { ariaOf, type ControlBase } from \"./Field\";\nimport { toggled, type Option } from \"./options\";\n\nconst MOVES: Readonly<Record<string, 1 | -1>> = {\n ArrowRight: 1,\n ArrowDown: 1,\n ArrowLeft: -1,\n ArrowUp: -1,\n};\n\n/**\n * A group of radios as native ones behave: one stop for Tab (the one checked, else the first),\n * the arrows move to the next or the previous one and check it, Home and End to the ends.\n */\nexport function useRadios(count: number, checked: number, check: (index: number) => void) {\n const items = useRef<(HTMLElement | null)[]>([]);\n return {\n ref: (index: number) => (element: HTMLElement | null) => {\n items.current[index] = element;\n },\n tabIndex: (index: number) => (index === Math.max(0, checked) ? 0 : -1),\n onKeyDown: (event: KeyboardEvent, index: number) => {\n const move = MOVES[event.key];\n const next =\n event.key === \"Home\"\n ? 0\n : event.key === \"End\"\n ? count - 1\n : move !== undefined\n ? (index + move + count) % count\n : null;\n if (next === null) return;\n event.preventDefault();\n items.current[next]?.focus();\n check(next);\n },\n };\n}\n\n/** Few short options with no hints sit side by side in one bar; any other few are cards. */\nfunction segmented(options: Option[]): boolean {\n const length = options.reduce((sum, option) => sum + option.label.length, 0);\n return options.length <= 4 && length <= 32 && options.every((option) => !option.hint);\n}\n\n/**\n * One of a few options, all in sight, as a group of radios: one bar of segments when they are\n * short, else a card each with its hint under its label and a dot that fills when picked.\n */\nexport function Choices({\n options,\n value,\n onChange,\n ...control\n}: ControlBase & {\n options: Option[];\n value: string | null;\n onChange: (id: string) => void;\n}) {\n const part = useParts();\n const checked = options.findIndex((option) => option.id === value);\n const radios = useRadios(options.length, checked, (index) => {\n const option = options[index];\n if (option) onChange(option.id);\n });\n const bar = segmented(options);\n return (\n <div role=\"radiogroup\" {...ariaOf(control)} className={part(bar ? \"sc-segments\" : \"sc-picks\")}>\n {options.map((option, index) => (\n <button\n key={option.id}\n ref={radios.ref(index)}\n type=\"button\"\n role=\"radio\"\n aria-checked={index === checked}\n tabIndex={radios.tabIndex(index)}\n disabled={control.disabled}\n onKeyDown={(event) => radios.onKeyDown(event, index)}\n onClick={() => onChange(option.id)}\n className={part(\"sc-pick\")}\n >\n {!bar && <i aria-hidden />}\n <span>\n {option.label}\n {option.hint !== undefined && <small>{option.hint}</small>}\n </span>\n </button>\n ))}\n </div>\n );\n}\n\n/** Several of a few options: a chip each, ticked on and off, a check on those picked. */\nexport function Chips({\n options,\n value,\n onChange,\n ...control\n}: ControlBase & {\n options: Option[];\n value: string[];\n onChange: (ids: string[]) => void;\n}) {\n const part = useParts();\n return (\n <div role=\"group\" {...ariaOf(control)} aria-required={undefined} className={part(\"sc-chips\")}>\n {options.map((option) => {\n const on = value.includes(option.id);\n return (\n <button\n key={option.id}\n type=\"button\"\n role=\"checkbox\"\n aria-checked={on}\n title={option.hint}\n disabled={control.disabled}\n onClick={() => onChange(toggled(options, value, option.id))}\n className={part(\"sc-chip\")}\n >\n {on && <CheckIcon aria-hidden weight=\"bold\" />}\n {option.label}\n </button>\n );\n })}\n </div>\n );\n}\n"],"mappings":";;;;;;;AAOA,MAAM,QAA0C;CAC9C,YAAY;CACZ,WAAW;CACX,WAAW;CACX,SAAS;AACX;;;;;AAMA,SAAgB,UAAU,OAAe,SAAiB,OAAgC;CACxF,MAAM,QAAQ,OAA+B,CAAC,CAAC;CAC/C,OAAO;EACL,MAAM,WAAmB,YAAgC;GACvD,MAAM,QAAQ,SAAS;EACzB;EACA,WAAW,UAAmB,UAAU,KAAK,IAAI,GAAG,OAAO,IAAI,IAAI;EACnE,YAAY,OAAsB,UAAkB;GAClD,MAAM,OAAO,MAAM,MAAM;GACzB,MAAM,OACJ,MAAM,QAAQ,SACV,IACA,MAAM,QAAQ,QACZ,QAAQ,IACR,SAAS,KAAA,KACN,QAAQ,OAAO,SAAS,QACzB;GACV,IAAI,SAAS,MAAM;GACnB,MAAM,eAAe;GACrB,MAAM,QAAQ,KAAK,EAAE,MAAM;GAC3B,MAAM,IAAI;EACZ;CACF;AACF;;AAGA,SAAS,UAAU,SAA4B;CAC7C,MAAM,SAAS,QAAQ,QAAQ,KAAK,WAAW,MAAM,OAAO,MAAM,QAAQ,CAAC;CAC3E,OAAO,QAAQ,UAAU,KAAK,UAAU,MAAM,QAAQ,OAAO,WAAW,CAAC,OAAO,IAAI;AACtF;;;;;AAMA,SAAgB,QAAQ,EACtB,SACA,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eAAe,SAAS,QAAQ,SAAS,OAAO,OAAO,EAAE,CAAC;IAC1D,WAAW,KAAK,SAAS;IAR3B,UAAA,CAUG,MAAM,oBAAC,WAAD;KAAW,eAAA;KAAY,QAAO;IAAQ,CAAA,GAC5C,OAAO,KACF;GAXD,GAAA,OAAO,EAWN;EAEZ,CAAC;CACE,CAAA;AAET"}
|
package/dist/kit/FileField.js
CHANGED
|
@@ -336,6 +336,6 @@ function FileField({ value, onChange, files, accept, multiple = false, maxMb, on
|
|
|
336
336
|
});
|
|
337
337
|
}
|
|
338
338
|
//#endregion
|
|
339
|
-
export { FileChip, FileChips, FileField, UploadChips, carriesFiles,
|
|
339
|
+
export { FileChip, FileChips, FileField, UploadChips, carriesFiles, useUploads };
|
|
340
340
|
|
|
341
341
|
//# sourceMappingURL=FileField.js.map
|