@syntrologie/adapt-chatbot 2.8.0-canary.248 → 2.8.0-canary.249

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.
@@ -2,36 +2,33 @@
2
2
  * Adaptive Chatbot — Lit Mountable
3
3
  *
4
4
  * Thin wrapper that mounts <syntro-chat> from @syntrologie/chat with an
5
- * SsePostTransport pointed at the adaptive SSE backend.
5
+ * AgUiTransport pointed at the adaptive AG-UI streaming endpoint.
6
6
  *
7
7
  * Four pieces this mountable owns:
8
8
  *
9
9
  * 1. SDK token plumbing. The chat backend (`/api/adaptive/*`) is identified
10
10
  * by the workspace's `syn_*` SDK token. The token lives on
11
11
  * `window.__SYNTRO_CONFIG__.token` (set by runtime-config.js) — we read
12
- * it at mount time and forward it on both transports:
13
- * • SSE GET — append `?syn=${token}` to the URL. Browser EventSource
14
- * cannot set custom headers; the URL is the only channel.
15
- * • POST `/action` — `Authorization: Bearer ${token}` header.
12
+ * it at mount time and forward it via `Authorization: Bearer` header.
16
13
  *
17
14
  * 2. Cloudflare Turnstile bot-check token. When `TURNSTILE_SITEKEY` is set
18
15
  * (hardcoded at the top of this file — operator updates after running
19
16
  * terraform apply on cloudflare/turnstile in the infra repo), the
20
17
  * widget dynamically loads Cloudflare's Turnstile JS, renders an
21
- * invisible widget, and acquires a token before opening the SSE
22
- * connection. The token is forwarded on both transports the same way
23
- * the SDK token is — `?cft=` on SSE GET, `CF-Turnstile-Token` on POST.
18
+ * invisible widget, and acquires a token before the first message.
19
+ * The token is forwarded via `CF-Turnstile-Token` header.
24
20
  * If sitekey is empty (default), this step is skipped entirely.
25
21
  *
26
- * 3. Fallback card. If the SSE connection fails before any successful event
27
- * (Cloudflare Turnstile bot-check failure, CORS / network error, or a
28
- * server-side rejection), swap the chat UI for a per-customer fallback
29
- * card built from `props.fallback`. The end-user is redirected to the
30
- * customer's normal support path instead of seeing a raw error.
22
+ * 3. Fallback card. If the first agent run fails (Cloudflare Turnstile
23
+ * bot-check failure, CORS / network error, or a server-side rejection),
24
+ * swap the chat UI for a per-customer fallback card built from
25
+ * `props.fallback`. The end-user is redirected to the customer's normal
26
+ * support path instead of seeing a raw error.
31
27
  *
32
- * 4. A2UI passthrough. SSE-borne A2UI events (createSurface, updateDataModel,
33
- * …) get forwarded to `runtime.actions.applyBatch` so tiles can render
34
- * server-driven UI inside the chat surface.
28
+ * 4. A2UI passthrough. AG-UI CUSTOM events carrying A2UI payloads
29
+ * (createSurface, updateDataModel, …) get forwarded to
30
+ * `runtime.actions.applyBatch` so tiles can render server-driven UI
31
+ * inside the chat surface.
35
32
  */
36
33
  import '@syntrologie/chat';
37
34
  import type { ChatbotConfig, ChatbotWidgetRuntime } from './types.js';
@@ -1 +1 @@
1
- {"version":3,"file":"ChatAssistantLit.d.ts","sourceRoot":"","sources":["../src/ChatAssistantLit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAGH,OAAO,mBAAmB,CAAC;AAK3B,OAAO,KAAK,EAAE,aAAa,EAAmB,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvF,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,aAAa,CAAC;IACtB,OAAO,EAAE,oBAAoB,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAyHD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAkDpE;AAiGD,eAAO,MAAM,yBAAyB;qBACnB,WAAW,gBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAwOpE,CAAC"}
1
+ {"version":3,"file":"ChatAssistantLit.d.ts","sourceRoot":"","sources":["../src/ChatAssistantLit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAGH,OAAO,mBAAmB,CAAC;AAK3B,OAAO,KAAK,EAAE,aAAa,EAAmB,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvF,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,aAAa,CAAC;IACtB,OAAO,EAAE,oBAAoB,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAqGD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAkDpE;AAiGD,eAAO,MAAM,yBAAyB;qBACnB,WAAW,gBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CA6JpE,CAAC"}
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  ChatAssistantLitMountable,
3
3
  acquireTurnstileToken
4
- } from "./chunk-HMJHNZ4Z.js";
5
- import "./chunk-V6TY7KAL.js";
4
+ } from "./chunk-MHK4WRSD.js";
5
+ import "./chunk-UVKRO5ER.js";
6
6
  export {
7
7
  ChatAssistantLitMountable,
8
8
  acquireTurnstileToken