@supcoflow/chat 1.0.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSES/orca.txt +25 -0
- package/README.md +135 -47
- package/dist/apariencia.d.ts +17 -0
- package/dist/apariencia.d.ts.map +1 -0
- package/dist/cliente.d.ts +25 -0
- package/dist/cliente.d.ts.map +1 -0
- package/dist/componentes/Adjuntos.d.ts +11 -0
- package/dist/componentes/Adjuntos.d.ts.map +1 -0
- package/dist/componentes/Burbuja.d.ts +6 -0
- package/dist/componentes/Burbuja.d.ts.map +1 -0
- package/dist/componentes/Compositor.d.ts +22 -0
- package/dist/componentes/Compositor.d.ts.map +1 -0
- package/dist/componentes/Inicio.d.ts +14 -0
- package/dist/componentes/Inicio.d.ts.map +1 -0
- package/dist/componentes/Markdown.d.ts +4 -0
- package/dist/componentes/Markdown.d.ts.map +1 -0
- package/dist/componentes/Mensajes.d.ts +10 -0
- package/dist/componentes/Mensajes.d.ts.map +1 -0
- package/dist/componentes/Panel.d.ts +12 -0
- package/dist/componentes/Panel.d.ts.map +1 -0
- package/dist/componentes/PreguntaHitl.d.ts +8 -0
- package/dist/componentes/PreguntaHitl.d.ts.map +1 -0
- package/dist/componentes/Widget.d.ts +24 -0
- package/dist/componentes/Widget.d.ts.map +1 -0
- package/dist/contexto.d.ts +10 -0
- package/dist/contexto.d.ts.map +1 -0
- package/dist/estado-del-widget.d.ts +18 -37
- package/dist/estado-del-widget.d.ts.map +1 -1
- package/dist/estado.d.ts +52 -0
- package/dist/estado.d.ts.map +1 -0
- package/dist/evidencia/adjuntos.d.ts +45 -0
- package/dist/evidencia/adjuntos.d.ts.map +1 -0
- package/dist/evidencia/captura.d.ts +56 -0
- package/dist/evidencia/captura.d.ts.map +1 -0
- package/dist/evidencia/elemento.d.ts +46 -0
- package/dist/evidencia/elemento.d.ts.map +1 -0
- package/dist/evidencia/extraer-elemento.d.ts +11 -0
- package/dist/evidencia/extraer-elemento.d.ts.map +1 -0
- package/dist/evidencia/resumen-de-evidencia.d.ts +11 -0
- package/dist/evidencia/resumen-de-evidencia.d.ts.map +1 -0
- package/dist/evidencia/selector-de-elementos.d.ts +11 -0
- package/dist/evidencia/selector-de-elementos.d.ts.map +1 -0
- package/dist/evidencia/subida.d.ts +17 -0
- package/dist/evidencia/subida.d.ts.map +1 -0
- package/dist/iife.d.ts +2 -0
- package/dist/iife.d.ts.map +1 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +166 -2
- package/dist/index.js.map +7 -1
- package/dist/markdown.d.ts +31 -0
- package/dist/markdown.d.ts.map +1 -0
- package/dist/montar.d.ts +9 -0
- package/dist/montar.d.ts.map +1 -0
- package/dist/opciones.d.ts +97 -0
- package/dist/opciones.d.ts.map +1 -0
- package/dist/protocolo.d.ts +82 -0
- package/dist/protocolo.d.ts.map +1 -0
- package/dist/react.d.ts +11 -0
- package/dist/react.d.ts.map +1 -0
- package/dist/sesion-guardada.d.ts +5 -0
- package/dist/sesion-guardada.d.ts.map +1 -0
- package/dist/tema.d.ts +13 -0
- package/dist/tema.d.ts.map +1 -0
- package/dist/textos.d.ts +52 -0
- package/dist/textos.d.ts.map +1 -0
- package/dist/widget.iife.js +166 -0
- package/dist/widget.iife.js.map +7 -0
- package/package.json +14 -33
- package/CHANGELOG.md +0 -24
- package/dist/ChatDeIntake.d.ts +0 -11
- package/dist/ChatDeIntake.d.ts.map +0 -1
- package/dist/ChatDeIntake.js +0 -56
- package/dist/ChatDeIntake.js.map +0 -1
- package/dist/estado-del-widget.js +0 -46
- package/dist/estado-del-widget.js.map +0 -1
- package/dist/partes-visibles.d.ts +0 -16
- package/dist/partes-visibles.d.ts.map +0 -1
- package/dist/partes-visibles.js +0 -14
- package/dist/partes-visibles.js.map +0 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export type Inline = {
|
|
2
|
+
tipo: "texto";
|
|
3
|
+
texto: string;
|
|
4
|
+
} | {
|
|
5
|
+
tipo: "negrita";
|
|
6
|
+
hijos: Inline[];
|
|
7
|
+
} | {
|
|
8
|
+
tipo: "cursiva";
|
|
9
|
+
hijos: Inline[];
|
|
10
|
+
} | {
|
|
11
|
+
tipo: "codigo";
|
|
12
|
+
texto: string;
|
|
13
|
+
} | {
|
|
14
|
+
tipo: "link";
|
|
15
|
+
href: string;
|
|
16
|
+
hijos: Inline[];
|
|
17
|
+
};
|
|
18
|
+
export type Bloque = {
|
|
19
|
+
tipo: "parrafo";
|
|
20
|
+
hijos: Inline[];
|
|
21
|
+
} | {
|
|
22
|
+
tipo: "lista";
|
|
23
|
+
ordenada: boolean;
|
|
24
|
+
items: Inline[][];
|
|
25
|
+
} | {
|
|
26
|
+
tipo: "codigo";
|
|
27
|
+
texto: string;
|
|
28
|
+
};
|
|
29
|
+
export declare function renderizarMarkdown(texto: string): Bloque[];
|
|
30
|
+
export declare function parsearInlines(texto: string): Inline[];
|
|
31
|
+
//# sourceMappingURL=markdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../src/markdown.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,MAAM,GACd;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAChC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,GACpC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,GACpC;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACjC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAEpD,MAAM,MAAM,MAAM,GACd;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,GACpC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,EAAE,CAAA;CAAE,GACvD;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAMtC,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAqD1D;AAID,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CA2DtD"}
|
package/dist/montar.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type OpcionesDelChat } from "./opciones";
|
|
2
|
+
export interface ChatMontado {
|
|
3
|
+
desmontar(): void;
|
|
4
|
+
}
|
|
5
|
+
/** El núcleo (§1.1 del diseño). Crea un host con shadow root, mete el CSS y, sólo si el motor
|
|
6
|
+
* dice que el chat de este proyecto está activo para este origen, renderiza el widget. Sin `ok`
|
|
7
|
+
* no se dibuja nada (§2.4) — pero el host queda, vacío, para que `desmontar` tenga qué sacar. */
|
|
8
|
+
export declare function montarChat(contenedor: HTMLElement, opcionesCrudas: OpcionesDelChat): ChatMontado;
|
|
9
|
+
//# sourceMappingURL=montar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"montar.d.ts","sourceRoot":"","sources":["../src/montar.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAwC,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AAOxF,MAAM,WAAW,WAAW;IAC1B,SAAS,IAAI,IAAI,CAAC;CACnB;AAED;;iGAEiG;AACjG,wBAAgB,UAAU,CAAC,UAAU,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,GAAG,WAAW,CAqFhG"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import type { EventoDelPreview } from "./protocolo";
|
|
2
|
+
/** Las variables CSS del tema (§2.1). Cada una termina como `--scf-<nombre>` en el host. */
|
|
3
|
+
export interface TemaDelChat {
|
|
4
|
+
acento: string;
|
|
5
|
+
fondo: string;
|
|
6
|
+
texto: string;
|
|
7
|
+
textoSuave: string;
|
|
8
|
+
radio: string;
|
|
9
|
+
fuente: string;
|
|
10
|
+
}
|
|
11
|
+
/** Lo que el widget le cuenta al desarrollador que lo instala (§2.5). */
|
|
12
|
+
export interface Diagnostico {
|
|
13
|
+
visible: boolean;
|
|
14
|
+
status: number;
|
|
15
|
+
motivo: string | null;
|
|
16
|
+
}
|
|
17
|
+
/** Quién es el usuario según la app del cliente (§4 del diseño de la marca). DECLARADO, no
|
|
18
|
+
* verificado: el rol no da permisos a nada, es contexto de diagnóstico (la mitad de los «no me
|
|
19
|
+
* aparece el botón» son permisos). `id`, `rol` y `atributos` viajan al modelo y al reporte.
|
|
20
|
+
* `nombre` (desde la 2.2.0) lo usa SÓLO el saludo de la pantalla de inicio y nunca sale del
|
|
21
|
+
* navegador: es PII de un usuario final de OTRA empresa y el reporte termina en un issue de GitHub. */
|
|
22
|
+
export interface UsuarioDelChat {
|
|
23
|
+
id?: string;
|
|
24
|
+
nombre?: string;
|
|
25
|
+
rol?: string;
|
|
26
|
+
atributos?: Record<string, string>;
|
|
27
|
+
}
|
|
28
|
+
export declare const MAX_USUARIO_ID = 100;
|
|
29
|
+
export declare const MAX_USUARIO_ROL = 60;
|
|
30
|
+
export declare const MAX_ATRIBUTOS = 8;
|
|
31
|
+
export declare const MAX_ATRIBUTO_CLAVE = 40;
|
|
32
|
+
export declare const MAX_ATRIBUTO_VALOR = 200;
|
|
33
|
+
export declare const MAX_USUARIO_NOMBRE = 80;
|
|
34
|
+
export declare const MAX_SALUDO = 140;
|
|
35
|
+
export interface OpcionesDelChat {
|
|
36
|
+
tenantId: string;
|
|
37
|
+
projectId: string;
|
|
38
|
+
/** Default: producción. Se acepta con o sin barra final. */
|
|
39
|
+
backendUrl?: string;
|
|
40
|
+
modo?: "burbuja" | "inline";
|
|
41
|
+
posicion?: "derecha" | "izquierda";
|
|
42
|
+
titulo?: string;
|
|
43
|
+
/** La segunda línea de la pantalla de inicio (2.2.0). Gana sobre la marca, como `titulo`. */
|
|
44
|
+
saludo?: string;
|
|
45
|
+
/** El panel arranca abierto (2.2.0). En `modo: "inline"` no aplica. Default false. */
|
|
46
|
+
abierto?: boolean;
|
|
47
|
+
tema?: Partial<TemaDelChat>;
|
|
48
|
+
contexto?: {
|
|
49
|
+
versionApp?: string;
|
|
50
|
+
};
|
|
51
|
+
/** URL y navegador al primer mensaje (§3.4). Default true; errores de consola NUNCA. */
|
|
52
|
+
contextoAutomatico?: boolean;
|
|
53
|
+
onDiagnostico?: (d: Diagnostico) => void;
|
|
54
|
+
usuario?: UsuarioDelChat;
|
|
55
|
+
/** INTERNA (§5.3): la usa la consola de Supcoflow para el preview; en tu sitio no hace nada útil.
|
|
56
|
+
* Manda el header `x-supcoflow-preview`, apaga la subida de evidencias y muestra el rótulo. */
|
|
57
|
+
previewToken?: string;
|
|
58
|
+
/** INTERNA (2.2.0): cada evento v1 que el widget consume, más `enviado`/`respondido` con lo que
|
|
59
|
+
* mandó. La usa la consola de Supcoflow para la columna «actividad» del preview; en tu sitio no
|
|
60
|
+
* hace nada útil. Sin `data-*`. Un callback que lanza no tumba el chat. */
|
|
61
|
+
onEvento?: (e: EventoDelPreview) => void;
|
|
62
|
+
}
|
|
63
|
+
export interface OpcionesResueltas {
|
|
64
|
+
tenantId: string;
|
|
65
|
+
projectId: string;
|
|
66
|
+
backendUrl: string;
|
|
67
|
+
modo: "burbuja" | "inline";
|
|
68
|
+
posicion: "derecha" | "izquierda";
|
|
69
|
+
titulo: string;
|
|
70
|
+
saludo: string | undefined;
|
|
71
|
+
abierto: boolean;
|
|
72
|
+
tema: TemaDelChat;
|
|
73
|
+
contexto: {
|
|
74
|
+
versionApp?: string;
|
|
75
|
+
};
|
|
76
|
+
contextoAutomatico: boolean;
|
|
77
|
+
onDiagnostico: ((d: Diagnostico) => void) | undefined;
|
|
78
|
+
usuario: UsuarioDelChat;
|
|
79
|
+
previewToken: string | null;
|
|
80
|
+
onEvento: ((e: EventoDelPreview) => void) | undefined;
|
|
81
|
+
}
|
|
82
|
+
/** Whitelist, no blacklist: sólo `id`, `nombre`, `rol` y `atributos` salen de acá. Un cliente en JS
|
|
83
|
+
* puede pasar cualquier cosa, y lo que no se nombra no viaja. `id`, `rol` y `nombre` no valen como
|
|
84
|
+
* atributo: los dos primeros colisionarían con `usuario_id`/`usuario_rol`, y `nombre` con la
|
|
85
|
+
* promesa de que no viaja. */
|
|
86
|
+
export declare function normalizarUsuario(u: unknown): UsuarioDelChat;
|
|
87
|
+
export declare const BACKEND_POR_DEFECTO = "https://chat.supcoflow.dev";
|
|
88
|
+
export declare const TEMA_POR_DEFECTO: TemaDelChat;
|
|
89
|
+
export declare function normalizarOpciones(o: OpcionesDelChat): OpcionesResueltas;
|
|
90
|
+
/** Los `data-*` del `<script>` del IIFE (§1.2): `data-tenant`, `data-project`, `data-backend`,
|
|
91
|
+
* `data-posicion`, `data-titulo`, `data-saludo`, `data-acento`, `data-version-app`,
|
|
92
|
+
* `data-contexto-automatico`, `data-usuario-id`, `data-usuario-rol`, `data-usuario-nombre`,
|
|
93
|
+
* `data-abierto="true"`. `dataset` ya los entrega en camelCase. Sólo traduce; los defaults son de
|
|
94
|
+
* normalizarOpciones. Sin `data-usuario-atributos` (un <script> no lleva objetos) y sin
|
|
95
|
+
* `previewToken`/`onEvento` (son internas: sin equivalente `data-*`). */
|
|
96
|
+
export declare function opcionesDesdeDataset(d: Record<string, string | undefined>): OpcionesDelChat;
|
|
97
|
+
//# sourceMappingURL=opciones.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opciones.d.ts","sourceRoot":"","sources":["../src/opciones.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,4FAA4F;A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,eAAO,MAAM,gBAAgB,EAAE,WAQ9B,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,eAAe,GAAG,iBAAiB,CAoBxE;AAED;;;;;yEAKyE;AACzE,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG,eAAe,CAiB3F"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
export interface OpcionDePregunta {
|
|
2
|
+
id: string;
|
|
3
|
+
label: string;
|
|
4
|
+
style: "danger" | "default" | "primary";
|
|
5
|
+
}
|
|
6
|
+
/** `id` es el sessionId durable de Eve; `indice`, su índice absoluto de eventos. Para el widget
|
|
7
|
+
* son un id y un número que se guardan y se devuelven tal cual. */
|
|
8
|
+
export interface CursorDeSesion {
|
|
9
|
+
id: string;
|
|
10
|
+
indice: number;
|
|
11
|
+
}
|
|
12
|
+
export type EventoDelWidget = {
|
|
13
|
+
v: 1;
|
|
14
|
+
t: "sesion";
|
|
15
|
+
id: string;
|
|
16
|
+
indice: number;
|
|
17
|
+
} | {
|
|
18
|
+
v: 1;
|
|
19
|
+
t: "usuario";
|
|
20
|
+
texto: string;
|
|
21
|
+
} | {
|
|
22
|
+
v: 1;
|
|
23
|
+
t: "texto";
|
|
24
|
+
delta: string;
|
|
25
|
+
} | {
|
|
26
|
+
v: 1;
|
|
27
|
+
t: "asistente";
|
|
28
|
+
texto: string;
|
|
29
|
+
} | {
|
|
30
|
+
v: 1;
|
|
31
|
+
t: "pregunta";
|
|
32
|
+
requestId: string;
|
|
33
|
+
kind: "question" | "session-limit" | "tool-approval";
|
|
34
|
+
prompt: string;
|
|
35
|
+
opciones: OpcionDePregunta[];
|
|
36
|
+
libre: boolean;
|
|
37
|
+
} | {
|
|
38
|
+
v: 1;
|
|
39
|
+
t: "pregunta_resuelta";
|
|
40
|
+
requestId: string;
|
|
41
|
+
outcome: string;
|
|
42
|
+
optionId?: string;
|
|
43
|
+
text?: string;
|
|
44
|
+
} | {
|
|
45
|
+
v: 1;
|
|
46
|
+
/** 2.2.0: una herramienta que el agente llamó. El backend lo emite SÓLO en sesiones de
|
|
47
|
+
* preview (la regla del sitio ajeno —«se dibuja texto y nada más»— sigue en pie afuera).
|
|
48
|
+
* El reducer lo ignora; lo consume `onEvento`. */
|
|
49
|
+
t: "herramienta";
|
|
50
|
+
nombre: string;
|
|
51
|
+
resumen: string;
|
|
52
|
+
resultado?: string;
|
|
53
|
+
} | {
|
|
54
|
+
v: 1;
|
|
55
|
+
t: "espera";
|
|
56
|
+
indice: number;
|
|
57
|
+
} | {
|
|
58
|
+
v: 1;
|
|
59
|
+
t: "fin";
|
|
60
|
+
} | {
|
|
61
|
+
v: 1;
|
|
62
|
+
t: "error";
|
|
63
|
+
codigo: string;
|
|
64
|
+
mensaje: string;
|
|
65
|
+
terminal: boolean;
|
|
66
|
+
};
|
|
67
|
+
/** Un borde cierra el stream: `espera`, `fin`, o un `error` terminal. Un error NO terminal
|
|
68
|
+
* (`step.failed`) sigue con `espera`, así que no cierra. */
|
|
69
|
+
export declare function esBorde(e: EventoDelWidget): boolean;
|
|
70
|
+
/** Lo que `onEvento` entrega (2.2.0): cada evento v1 consumido, más dos sintéticos con lo que el
|
|
71
|
+
* widget MANDÓ — sin ellos la actividad del preview vería las respuestas y no las preguntas. */
|
|
72
|
+
export type EventoDelPreview = EventoDelWidget | {
|
|
73
|
+
t: "enviado";
|
|
74
|
+
texto: string;
|
|
75
|
+
contexto?: Record<string, string>;
|
|
76
|
+
} | {
|
|
77
|
+
t: "respondido";
|
|
78
|
+
requestId: string;
|
|
79
|
+
optionId?: string;
|
|
80
|
+
text?: string;
|
|
81
|
+
};
|
|
82
|
+
//# sourceMappingURL=protocolo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocolo.d.ts","sourceRoot":"","sources":["../src/protocolo.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,gBAAgB;IAC/B,EA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,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GACD;IAAE,CAAC,EAAE,CAAC,CAAC;IAAC,CAAC,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACrC;IAAE,CAAC,EAAE,CAAC,CAAC;IAAC,CAAC,EAAE,KAAK,CAAA;CAAE,GAClB;IAAE,CAAC,EAAE,CAAC,CAAC;IAAC,CAAC,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,CAAC;AAE7E;4DAC4D;AAC5D,wBAAgB,OAAO,CAAC,CAAC,EAAE,eAAe,GAAG,OAAO,CAEnD;AAED;gGACgG;AAChG,MAAM,MAAM,gBAAgB,GACxB,eAAe,GACf;IAAE,CAAC,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,GAClE;IAAE,CAAC,EAAE,YAAY,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC"}
|
package/dist/react.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ReactElement } from "react";
|
|
2
|
+
import type { OpcionesDelChat } from "./opciones";
|
|
3
|
+
/** Alias de compatibilidad con la 1.x: `contexto={{ versionApp }}`. `url` ya no se declara —
|
|
4
|
+
* viaja sola por `contextoAutomatico` (§3.4). */
|
|
5
|
+
export type ContextoDelReporte = {
|
|
6
|
+
versionApp?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function ChatDeIntake(props: OpcionesDelChat & {
|
|
9
|
+
className?: string;
|
|
10
|
+
}): ReactElement;
|
|
11
|
+
//# sourceMappingURL=react.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"AAGA,OAAO,EAAoC,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAE5E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD;iDACiD;AACjD,MAAM,MAAM,kBAAkB,GAAG;IAAE,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzD,wBAAgB,YAAY,CAAC,KAAK,EAAE,eAAe,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,YAAY,CAY1F"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CursorDeSesion } from "./protocolo";
|
|
2
|
+
export declare function claveDeSesion(tenantId: string, projectId: string): string;
|
|
3
|
+
export declare function leerSesion(storage: Pick<Storage, "getItem">, clave: string): CursorDeSesion | null;
|
|
4
|
+
export declare function guardarSesion(storage: Pick<Storage, "setItem" | "removeItem">, clave: string, cursor: CursorDeSesion | null): void;
|
|
5
|
+
//# sourceMappingURL=sesion-guardada.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sesion-guardada.d.ts","sourceRoot":"","sources":["../src/sesion-guardada.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAQlD,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAEzE;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAUlG;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,GAAG,YAAY,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,GAAG,IAAI,GAAG,IAAI,CAOlI"}
|
package/dist/tema.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type TemaDelChat } from "./opciones";
|
|
2
|
+
/**
|
|
3
|
+
* El color del texto que va ENCIMA del acento (2.2.0, hallazgo 2 del spec del 2026-09-11).
|
|
4
|
+
*
|
|
5
|
+
* Hasta la 2.1.0 el CSS tenía `color: #fff` fijo sobre el acento en cinco lugares, y el acento
|
|
6
|
+
* guardado en producción para el proyecto de prueba era `#fcba03`: blanco sobre amarillo. Acá se
|
|
7
|
+
* calcula la luminancia relativa (WCAG 2.x) y se elige oscuro si el acento es claro. Se parsean
|
|
8
|
+
* `#rgb`, `#rrggbb`, `rgb()` y `rgba()`, que es lo que un cliente escribe; un nombre de color o
|
|
9
|
+
* un `var()` no se parsea y cae a blanco, que es exactamente lo de antes — nunca peor.
|
|
10
|
+
*/
|
|
11
|
+
export declare function sobreAcento(acento: string): "#ffffff" | "#111111";
|
|
12
|
+
export declare function variablesDelTema(tema: TemaDelChat): string;
|
|
13
|
+
//# sourceMappingURL=tema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tema.d.ts","sourceRoot":"","sources":["../src/tema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAUhE;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CASjE;AAaD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAW1D"}
|
package/dist/textos.d.ts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export declare const TEXTOS: Readonly<{
|
|
2
|
+
abrir: "Abrir el chat de ayuda";
|
|
3
|
+
cerrar: "Cerrar";
|
|
4
|
+
minimizar: "Minimizar";
|
|
5
|
+
placeholder: "Preguntá o contá qué pasó…";
|
|
6
|
+
enviar: "Enviar";
|
|
7
|
+
escribiendo: "Escribiendo…";
|
|
8
|
+
errorDeEnvio: "No se pudo enviar. Probá de nuevo.";
|
|
9
|
+
sesionVencida: "La conversación anterior venció. Escribí para empezar una nueva.";
|
|
10
|
+
reintentar: "Reintentar";
|
|
11
|
+
respuestaLibre: "Escribí tu respuesta…";
|
|
12
|
+
responder: "Responder";
|
|
13
|
+
esUnaMaquina: "Sos atendido por un asistente automático.";
|
|
14
|
+
preview: "Preview";
|
|
15
|
+
senalar: "Señalar un elemento de la página";
|
|
16
|
+
seleccionando: "Hacé clic en el elemento que falla. Esc para cancelar.";
|
|
17
|
+
adjuntar: "Adjuntar";
|
|
18
|
+
capturarPantalla: "Capturar pantalla";
|
|
19
|
+
capturarElemento: "Capturar este elemento";
|
|
20
|
+
adjuntarImagen: "Adjuntar imagen";
|
|
21
|
+
quitar: "Quitar";
|
|
22
|
+
pendiente: "Pendiente";
|
|
23
|
+
subiendo: "Subiendo…";
|
|
24
|
+
adjuntado: "Adjuntado";
|
|
25
|
+
falloDeSubida: "No se pudo adjuntar.";
|
|
26
|
+
reintentarSubida: "Reintentar";
|
|
27
|
+
sinCaptura: "Sin captura. El elemento se adjunta igual.";
|
|
28
|
+
topeDeAdjuntos: "Máximo 4 adjuntos por conversación.";
|
|
29
|
+
imagenInvalida: "Ese archivo no es una imagen, o es demasiado grande.";
|
|
30
|
+
elementoSenalado: "Elemento señalado";
|
|
31
|
+
hola: "Hola";
|
|
32
|
+
saludoPorDefecto: "¿En qué te ayudamos?";
|
|
33
|
+
oEscribi: "o escribí abajo";
|
|
34
|
+
asistenteAutomatico: "Asistente automático";
|
|
35
|
+
atribucion: "Supcoflow";
|
|
36
|
+
enviarAria: "Enviar el mensaje";
|
|
37
|
+
}>;
|
|
38
|
+
/** Los dos arranques de la pantalla de inicio (§5.2 de la marca): cada uno manda su `mensaje`
|
|
39
|
+
* como PRIMER mensaje del usuario, por el mismo camino que escribir. Son dos porque son las dos
|
|
40
|
+
* tools del agente; un tercero («tengo una idea») no tiene destino. No configurables por proyecto. */
|
|
41
|
+
export declare const ARRANQUES: readonly {
|
|
42
|
+
titulo: string;
|
|
43
|
+
detalle: string;
|
|
44
|
+
mensaje: string;
|
|
45
|
+
}[];
|
|
46
|
+
/** El avatar cuando el proyecto no subió logo: las iniciales del título. Filtra tokens de ≤2 caracteres
|
|
47
|
+
* (artículos, preposiciones como "de", "la", "el") porque la especificación literal de Task 5 (2026-09-11)
|
|
48
|
+
* no hacía esta distinción y fallaba su propio test ("Ayuda de Turnera" esperaba "AT", el código daba "AD").
|
|
49
|
+
* Este es un heurístico mínimo: no es una lista explícita de artículos, sino un corte de longitud que
|
|
50
|
+
* en la práctica descarta los más cortos. */
|
|
51
|
+
export declare function inicialesDe(titulo: string): string;
|
|
52
|
+
//# sourceMappingURL=textos.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textos.d.ts","sourceRoot":"","sources":["../src/textos.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsCjB,CAAC;AAEH;;sGAEsG;AACtG,eAAO,MAAM,SAAS,EAAE,SAAS;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,EAGnF,CAAC;AAEH;;;;6CAI6C;AAC7C,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAKlD"}
|