@mgamadeus/ddd-agents 0.10.6 → 0.11.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/dist/chat.js +10 -10
- package/dist/chunks/{ConversationMarkdown-06rFO7Fr.js → ConversationMarkdown-C3SKd3i-.js} +4 -4
- package/dist/chunks/{ConversationMarkdown-06rFO7Fr.js.map → ConversationMarkdown-C3SKd3i-.js.map} +1 -1
- package/dist/chunks/{ConversationMessageInputComposerWidgets-BbIuDOUV.js → ConversationMessageInputComposerWidgets-D7x-TFKG.js} +6 -6
- package/dist/chunks/{ConversationMessageInputComposerWidgets-BbIuDOUV.js.map → ConversationMessageInputComposerWidgets-D7x-TFKG.js.map} +1 -1
- package/dist/chunks/{VoiceBarsIcon-BKtx_QIg.js → VoiceBarsIcon-CNIPOLtV.js} +5 -5
- package/dist/chunks/VoiceBarsIcon-CNIPOLtV.js.map +1 -0
- package/dist/chunks/{WebSearchResultsConversationWidget-W7O1fBB0.js → WebSearchResultsConversationWidget-CUtKAdMM.js} +3 -3
- package/dist/chunks/{WebSearchResultsConversationWidget-W7O1fBB0.js.map → WebSearchResultsConversationWidget-CUtKAdMM.js.map} +1 -1
- package/dist/chunks/{browser-request-interception-BnzFbH0m.js → browser-request-interception-ydNOzeUL.js} +2 -2
- package/dist/chunks/{browser-request-interception-BnzFbH0m.js.map → browser-request-interception-ydNOzeUL.js.map} +1 -1
- package/dist/chunks/{canvas-reducers-DDg9T7t8.js → canvas-reducers-CAtcbD4i.js} +2 -2
- package/dist/chunks/{canvas-reducers-DDg9T7t8.js.map → canvas-reducers-CAtcbD4i.js.map} +1 -1
- package/dist/chunks/{canvas-title-slot-context-8HUvNDuc.js → canvas-title-slot-context-rl94V4u4.js} +3 -3
- package/dist/chunks/{canvas-title-slot-context-8HUvNDuc.js.map → canvas-title-slot-context-rl94V4u4.js.map} +1 -1
- package/dist/chunks/{canvasBodies-qC-A_rlz.js → canvasBodies-C3wydcKZ.js} +4 -4
- package/dist/chunks/{canvasBodies-qC-A_rlz.js.map → canvasBodies-C3wydcKZ.js.map} +1 -1
- package/dist/chunks/{canvasStorage-DaM9851h.js → canvasStorage-D9EnBraV.js} +2 -2
- package/dist/chunks/{canvasStorage-DaM9851h.js.map → canvasStorage-D9EnBraV.js.map} +1 -1
- package/dist/chunks/{link-navigation-BUcy5qWW.js → link-navigation-DRHt6g7U.js} +17 -1
- package/dist/chunks/{link-navigation-BUcy5qWW.js.map → link-navigation-DRHt6g7U.js.map} +1 -1
- package/dist/chunks/{widget-name-resolver-BNSfO2Aw.js → widget-name-resolver-akTPWt63.js} +514 -384
- package/dist/chunks/widget-name-resolver-akTPWt63.js.map +1 -0
- package/dist/client-testing.js +4 -4
- package/dist/files/i18n-keys.json +36 -0
- package/dist/files/renderer/widget-tree/composed-node-schema.json +2 -0
- package/dist/image-render.js +7 -7
- package/dist/index.js +6 -6
- package/dist/kit.js +2 -2
- package/dist/preview.js +7 -7
- package/dist/provider.js +1 -1
- package/dist/renderer.js +10 -10
- package/dist/styles.css +28 -0
- package/dist/types/provider/environment.d.ts +32 -2
- package/dist/types/provider/index.d.ts +1 -1
- package/dist/voice.js +2 -2
- package/dist/widgets.js +4 -4
- package/package.json +1 -1
- package/dist/chunks/VoiceBarsIcon-BKtx_QIg.js.map +0 -1
- package/dist/chunks/widget-name-resolver-BNSfO2Aw.js.map +0 -1
package/dist/client-testing.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { a as AgentsClientError, C as CONVERSATION_RUN_STATES_THAT_END_THE_CONVERSATION, r as readConversationRunStatusOfRunState } from "./chunks/conversation-CbWEHPbL.js";
|
|
3
3
|
import { c as composeAttachmentMessageText } from "./chunks/compose-attachment-message-text-FvVJbrge.js";
|
|
4
|
-
import { l as listWidgetHydratorTypes, k as getWidgetHydrator, h as registerWidgetHydrator, m as abandonWidgetHydrationReads, u as unregisterWidgetHydrator } from "./chunks/WebSearchResultsConversationWidget-
|
|
5
|
-
import { j as conversationWidgetRegistry, k as replaceConversationWidgetRegistryEntries } from "./chunks/widget-name-resolver-
|
|
6
|
-
import { l, s } from "./chunks/widget-name-resolver-
|
|
7
|
-
import { c, r, s as s2 } from "./chunks/canvasStorage-
|
|
4
|
+
import { l as listWidgetHydratorTypes, k as getWidgetHydrator, h as registerWidgetHydrator, m as abandonWidgetHydrationReads, u as unregisterWidgetHydrator } from "./chunks/WebSearchResultsConversationWidget-CUtKAdMM.js";
|
|
5
|
+
import { j as conversationWidgetRegistry, k as replaceConversationWidgetRegistryEntries } from "./chunks/widget-name-resolver-akTPWt63.js";
|
|
6
|
+
import { l, s } from "./chunks/widget-name-resolver-akTPWt63.js";
|
|
7
|
+
import { c, r, s as s2 } from "./chunks/canvasStorage-D9EnBraV.js";
|
|
8
8
|
const DEFAULT_SCRIPTED_ASSISTANT_ANSWER = "Done.";
|
|
9
9
|
const DEFAULT_PAGE_SIZE = 50;
|
|
10
10
|
const copyOf = (value) => JSON.parse(JSON.stringify(value));
|
|
@@ -562,6 +562,15 @@
|
|
|
562
562
|
"src/voice/AgentVoiceCallBand/AgentVoiceCallBand.tsx"
|
|
563
563
|
]
|
|
564
564
|
},
|
|
565
|
+
{
|
|
566
|
+
"key": "Continue in your personal space",
|
|
567
|
+
"defaultText": "Continue in your personal space",
|
|
568
|
+
"placeholders": [],
|
|
569
|
+
"contexts": [],
|
|
570
|
+
"usedIn": [
|
|
571
|
+
"src/widgets/ContinueInPersonalSpaceConversationWidget/ContinueInPersonalSpaceConversationWidget.tsx"
|
|
572
|
+
]
|
|
573
|
+
},
|
|
565
574
|
{
|
|
566
575
|
"key": "Conversation",
|
|
567
576
|
"defaultText": "Conversation",
|
|
@@ -852,6 +861,15 @@
|
|
|
852
861
|
"src/voice/admin/agent-voice-admin-format.ts"
|
|
853
862
|
]
|
|
854
863
|
},
|
|
864
|
+
{
|
|
865
|
+
"key": "Extend the permission",
|
|
866
|
+
"defaultText": "Extend the permission",
|
|
867
|
+
"placeholders": [],
|
|
868
|
+
"contexts": [],
|
|
869
|
+
"usedIn": [
|
|
870
|
+
"src/widgets/ExtendConnectionPermissionConversationWidget/ExtendConnectionPermissionConversationWidget.tsx"
|
|
871
|
+
]
|
|
872
|
+
},
|
|
855
873
|
{
|
|
856
874
|
"key": "Failed",
|
|
857
875
|
"defaultText": "Failed",
|
|
@@ -1214,6 +1232,15 @@
|
|
|
1214
1232
|
"src/renderer/WindowedWidget/WindowedWidget.tsx"
|
|
1215
1233
|
]
|
|
1216
1234
|
},
|
|
1235
|
+
{
|
|
1236
|
+
"key": "Only you may use this connection, and others read this conversation.",
|
|
1237
|
+
"defaultText": "Only you may use this connection, and others read this conversation.",
|
|
1238
|
+
"placeholders": [],
|
|
1239
|
+
"contexts": [],
|
|
1240
|
+
"usedIn": [
|
|
1241
|
+
"src/widgets/ContinueInPersonalSpaceConversationWidget/ContinueInPersonalSpaceConversationWidget.tsx"
|
|
1242
|
+
]
|
|
1243
|
+
},
|
|
1217
1244
|
{
|
|
1218
1245
|
"key": "Open %name%",
|
|
1219
1246
|
"defaultText": "Open %name%",
|
|
@@ -2475,6 +2502,15 @@
|
|
|
2475
2502
|
"src/widgets/EntityMentionConversationWidget/shared/entity-mention-presentation.ts"
|
|
2476
2503
|
]
|
|
2477
2504
|
},
|
|
2505
|
+
{
|
|
2506
|
+
"key": "This step needs a permission the connection does not have yet.",
|
|
2507
|
+
"defaultText": "This step needs a permission the connection does not have yet.",
|
|
2508
|
+
"placeholders": [],
|
|
2509
|
+
"contexts": [],
|
|
2510
|
+
"usedIn": [
|
|
2511
|
+
"src/widgets/ExtendConnectionPermissionConversationWidget/ExtendConnectionPermissionConversationWidget.tsx"
|
|
2512
|
+
]
|
|
2513
|
+
},
|
|
2478
2514
|
{
|
|
2479
2515
|
"key": "This view has nothing to show right now.",
|
|
2480
2516
|
"defaultText": "This view has nothing to show right now.",
|
|
@@ -3415,10 +3415,12 @@
|
|
|
3415
3415
|
"widgetTypes": [
|
|
3416
3416
|
"AttachedFiles",
|
|
3417
3417
|
"ComposedView",
|
|
3418
|
+
"ContinueInPersonalSpace",
|
|
3418
3419
|
"ConversationSearchResults",
|
|
3419
3420
|
"CustomVisualization",
|
|
3420
3421
|
"DriveFiles",
|
|
3421
3422
|
"EntityMention",
|
|
3423
|
+
"ExtendConnectionPermission",
|
|
3422
3424
|
"ImageGallery",
|
|
3423
3425
|
"MultiChoice",
|
|
3424
3426
|
"QuickReplies",
|
package/dist/image-render.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import React, { useRef, useEffect } from "react";
|
|
4
|
-
import { G as resolveWidgetName, j as conversationWidgetRegistry } from "./chunks/widget-name-resolver-
|
|
5
|
-
import { H } from "./chunks/widget-name-resolver-
|
|
6
|
-
import { z as ConversationWidgetRenderContext, a7 as WidgetImageReadinessContext, R as ReadOnlyConversationWidgetProvider, a8 as WidgetImageRenderContext, a9 as WidgetImageLiveHydrationContext, A as buildWidgetAgentSpaceKeyProps } from "./chunks/WebSearchResultsConversationWidget-
|
|
7
|
-
import { aa, ab, ac } from "./chunks/WebSearchResultsConversationWidget-
|
|
8
|
-
import { r as readWidgetImageReadiness, p as publishWidgetImageReadiness, i as interceptXMLHttpRequests, a as interceptFetchRequests, c as createHeaderlessResponse, t as toSameRealmFetchInput } from "./chunks/browser-request-interception-
|
|
9
|
-
import { W, b } from "./chunks/browser-request-interception-
|
|
10
|
-
import { U as getGoogleMapWidgetNames, X as getWidgetImageCaptureReadPathPrefix } from "./chunks/link-navigation-
|
|
4
|
+
import { G as resolveWidgetName, j as conversationWidgetRegistry } from "./chunks/widget-name-resolver-akTPWt63.js";
|
|
5
|
+
import { H } from "./chunks/widget-name-resolver-akTPWt63.js";
|
|
6
|
+
import { z as ConversationWidgetRenderContext, a7 as WidgetImageReadinessContext, R as ReadOnlyConversationWidgetProvider, a8 as WidgetImageRenderContext, a9 as WidgetImageLiveHydrationContext, A as buildWidgetAgentSpaceKeyProps } from "./chunks/WebSearchResultsConversationWidget-CUtKAdMM.js";
|
|
7
|
+
import { aa, ab, ac } from "./chunks/WebSearchResultsConversationWidget-CUtKAdMM.js";
|
|
8
|
+
import { r as readWidgetImageReadiness, p as publishWidgetImageReadiness, i as interceptXMLHttpRequests, a as interceptFetchRequests, c as createHeaderlessResponse, t as toSameRealmFetchInput } from "./chunks/browser-request-interception-ydNOzeUL.js";
|
|
9
|
+
import { W, b } from "./chunks/browser-request-interception-ydNOzeUL.js";
|
|
10
|
+
import { U as getGoogleMapWidgetNames, X as getWidgetImageCaptureReadPathPrefix } from "./chunks/link-navigation-DRHt6g7U.js";
|
|
11
11
|
const root = "agents_root_prMo3u";
|
|
12
12
|
const styles = {
|
|
13
13
|
root
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { h, i } from "./chunks/widget-name-resolver-
|
|
3
|
-
import { r as registerCanvasBodies, c as canvasBodies } from "./chunks/canvasBodies-
|
|
4
|
-
import { g, a, b } from "./chunks/canvasBodies-
|
|
5
|
-
import { a as isPackageCanvasId, d as declareCanvasKind, f as forgetCanvasKind } from "./chunks/WebSearchResultsConversationWidget-
|
|
6
|
-
import { r, b as b2, c, e, g as g2, h as h2 } from "./chunks/WebSearchResultsConversationWidget-
|
|
2
|
+
import { h, i } from "./chunks/widget-name-resolver-akTPWt63.js";
|
|
3
|
+
import { r as registerCanvasBodies, c as canvasBodies } from "./chunks/canvasBodies-C3wydcKZ.js";
|
|
4
|
+
import { g, a, b } from "./chunks/canvasBodies-C3wydcKZ.js";
|
|
5
|
+
import { a as isPackageCanvasId, d as declareCanvasKind, f as forgetCanvasKind } from "./chunks/WebSearchResultsConversationWidget-CUtKAdMM.js";
|
|
6
|
+
import { r, b as b2, c, e, g as g2, h as h2 } from "./chunks/WebSearchResultsConversationWidget-CUtKAdMM.js";
|
|
7
7
|
import { r as registerCanvasFeatureFlags, c as canvasFeatureFlags } from "./chunks/canvas-feature-flags-Cn8xBliA.js";
|
|
8
8
|
import { A, i as i2 } from "./chunks/icon-names-Di6c4zLo.js";
|
|
9
9
|
import { A as A2, f } from "./chunks/host-color-scheme-Jhb7JZR7.js";
|
|
10
|
-
import { A as A3, a as a2, B, C, b as b3, D, c as c2, d, e as e2, f as f2, G, H, g as g3, I, h as h3, L, M, i as i3, j, k, P, R, l, S, m, n, o, p, q, r as r2, T, s, t, u, v, w, W, x, y, z, E, F, J, K, N, O, Q, U, V, X, Y, Z, _, $, a0, a1, a2 as a22, a3, a4, a5, a6, a7, a8, a9, aa, ab } from "./chunks/link-navigation-
|
|
10
|
+
import { A as A3, a as a2, B, C, b as b3, D, c as c2, d, e as e2, f as f2, G, H, g as g3, I, h as h3, L, M, i as i3, j, k, P, R, l, S, m, n, o, p, q, r as r2, T, s, t, u, v, w, W, x, y, z, E, F, J, K, N, O, Q, U, V, X, Y, Z, _, $, a0, a1, a2 as a22, a3, a4, a5, a6, a7, a8, a9, aa, ab } from "./chunks/link-navigation-DRHt6g7U.js";
|
|
11
11
|
import { u as u2, a as a10 } from "./chunks/AgentsConversationClientContext-C4T7g_Qk.js";
|
|
12
12
|
const registerCanvasKind = (kind) => {
|
|
13
13
|
if (isPackageCanvasId(kind.canvasId)) {
|
package/dist/kit.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { A, C, a, b, c, d, e, E, r, f, u, g } from "./chunks/widget-name-resolver-
|
|
3
|
-
import { M } from "./chunks/WebSearchResultsConversationWidget-
|
|
2
|
+
import { A, C, a, b, c, d, e, E, r, f, u, g } from "./chunks/widget-name-resolver-akTPWt63.js";
|
|
3
|
+
import { M } from "./chunks/WebSearchResultsConversationWidget-CUtKAdMM.js";
|
|
4
4
|
import { E as E2, u as u2 } from "./chunks/entity-detail-name-3A82gDAp.js";
|
|
5
5
|
export {
|
|
6
6
|
A as ApexChart,
|
package/dist/preview.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { s as Text, Y as getWidgetSelfHydrationKeyFieldName, e as DEFAULT_WIDGET_SELF_HYDRATION_KEY_FIELD_NAME, V as getSandboxLegacyAliases } from "./chunks/link-navigation-
|
|
3
|
+
import { s as Text, Y as getWidgetSelfHydrationKeyFieldName, e as DEFAULT_WIDGET_SELF_HYDRATION_KEY_FIELD_NAME, V as getSandboxLegacyAliases } from "./chunks/link-navigation-DRHt6g7U.js";
|
|
4
4
|
import { useRef, useState, useMemo, useEffect, useCallback } from "react";
|
|
5
|
-
import { Q as buildComposedViewComponentRegistry, R as composedViewComponents, G as resolveWidgetName, j as conversationWidgetRegistry, o as ConversationWidgetErrorBoundary, S as ComposedViewComponentsContext } from "./chunks/widget-name-resolver-
|
|
6
|
-
import { aN as WidgetSurface, Z as readWidgetAgentSpaceKeyAttribute, j as canvasBehaviourOf, W as WidgetRenderReportContext, A as buildWidgetAgentSpaceKeyProps, S as StandaloneConversationWidgetProvider, z as ConversationWidgetRenderContext, a8 as WidgetImageRenderContext, ah as CANVAS_VIABLE_MIN_WIDTH, l as listWidgetHydratorTypes, k as getWidgetHydrator, u as unregisterWidgetHydrator, h as registerWidgetHydrator } from "./chunks/WebSearchResultsConversationWidget-
|
|
7
|
-
import { c as canvasBodies, E as EntityMentionAskButton } from "./chunks/canvasBodies-
|
|
8
|
-
import { f as decideCanvasOpen } from "./chunks/canvas-reducers-
|
|
9
|
-
import { p as publishWidgetImageReadiness, i as interceptXMLHttpRequests, d as isFetchRequest, c as createHeaderlessResponse } from "./chunks/browser-request-interception-
|
|
10
|
-
import { C as ConversationWidgetProvider, a as ConversationMessageInputComposerWidgets } from "./chunks/ConversationMessageInputComposerWidgets-
|
|
5
|
+
import { Q as buildComposedViewComponentRegistry, R as composedViewComponents, G as resolveWidgetName, j as conversationWidgetRegistry, o as ConversationWidgetErrorBoundary, S as ComposedViewComponentsContext } from "./chunks/widget-name-resolver-akTPWt63.js";
|
|
6
|
+
import { aN as WidgetSurface, Z as readWidgetAgentSpaceKeyAttribute, j as canvasBehaviourOf, W as WidgetRenderReportContext, A as buildWidgetAgentSpaceKeyProps, S as StandaloneConversationWidgetProvider, z as ConversationWidgetRenderContext, a8 as WidgetImageRenderContext, ah as CANVAS_VIABLE_MIN_WIDTH, l as listWidgetHydratorTypes, k as getWidgetHydrator, u as unregisterWidgetHydrator, h as registerWidgetHydrator } from "./chunks/WebSearchResultsConversationWidget-CUtKAdMM.js";
|
|
7
|
+
import { c as canvasBodies, E as EntityMentionAskButton } from "./chunks/canvasBodies-C3wydcKZ.js";
|
|
8
|
+
import { f as decideCanvasOpen } from "./chunks/canvas-reducers-CAtcbD4i.js";
|
|
9
|
+
import { p as publishWidgetImageReadiness, i as interceptXMLHttpRequests, d as isFetchRequest, c as createHeaderlessResponse } from "./chunks/browser-request-interception-ydNOzeUL.js";
|
|
10
|
+
import { C as ConversationWidgetProvider, a as ConversationMessageInputComposerWidgets } from "./chunks/ConversationMessageInputComposerWidgets-D7x-TFKG.js";
|
|
11
11
|
const page$1 = "agents_page_5VMDeD";
|
|
12
12
|
const chatColumn = "agents_chatColumn_FWcgdJ";
|
|
13
13
|
const widget = "agents_widget_3qpgMy";
|
package/dist/provider.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { A, i } from "./chunks/icon-names-Di6c4zLo.js";
|
|
3
3
|
import { A as A2, f } from "./chunks/host-color-scheme-Jhb7JZR7.js";
|
|
4
|
-
import { A as A3, a, B, C, b, D, c, d, e, f as f2, G, H, g, I, h, L, M, i as i2, j, k, P, R, l, S, m, n, o, p, q, r, T, s, t, u, v, w, W, x, y, z, E, F, J, K, N, O, Q, U, V, X, Y, Z, _, $, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, aa, ab } from "./chunks/link-navigation-
|
|
4
|
+
import { A as A3, a, B, C, b, D, c, d, e, f as f2, G, H, g, I, h, L, M, i as i2, j, k, P, R, l, S, m, n, o, p, q, r, T, s, t, u, v, w, W, x, y, z, E, F, J, K, N, O, Q, U, V, X, Y, Z, _, $, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, aa, ab } from "./chunks/link-navigation-DRHt6g7U.js";
|
|
5
5
|
import { u as u2, a as a10 } from "./chunks/AgentsConversationClientContext-C4T7g_Qk.js";
|
|
6
6
|
export {
|
|
7
7
|
A as AGENTS_ICON_NAMES,
|
package/dist/renderer.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { C, a, M, W, b, c, d, p, s } from "./chunks/ConversationMarkdown-
|
|
3
|
-
import { m as findWidgetFenceByPayloadHash, n as findWidgetFencesInMarkdown } from "./chunks/widget-name-resolver-
|
|
4
|
-
import { o, p as p2, q, t, v, w, j, x, y, z, B, D, F, G } from "./chunks/widget-name-resolver-
|
|
5
|
-
import { n as useResolvedConversationWidgetAgentSpaceKey, p as payloadHashOfInstanceId } from "./chunks/WebSearchResultsConversationWidget-
|
|
6
|
-
import { C as C2, o as o2, q as q2, t as t2, v as v2, w as w2, x as x2, y as y2, z as z2, D as D2, L, R, S, W as W2, A, j as j2, B as B2, E, F as F2, G as G2, H, I, J, K, N, O, P, k, Q, T, i, U, a as a2, V, X, Y, Z, _, h, $, s as s2, a0, u, a1, a2 as a22, a3, a4, a5, a6 } from "./chunks/WebSearchResultsConversationWidget-
|
|
7
|
-
import { C as C3, d as d2, g, i as i2, r, u as u2 } from "./chunks/canvas-title-slot-context-
|
|
8
|
-
import { c as c2, u as u3 } from "./chunks/canvasBodies-
|
|
2
|
+
import { C, a, M, W, b, c, d, p, s } from "./chunks/ConversationMarkdown-C3SKd3i-.js";
|
|
3
|
+
import { m as findWidgetFenceByPayloadHash, n as findWidgetFencesInMarkdown } from "./chunks/widget-name-resolver-akTPWt63.js";
|
|
4
|
+
import { o, p as p2, q, t, v, w, j, x, y, z, B, D, F, G } from "./chunks/widget-name-resolver-akTPWt63.js";
|
|
5
|
+
import { n as useResolvedConversationWidgetAgentSpaceKey, p as payloadHashOfInstanceId } from "./chunks/WebSearchResultsConversationWidget-CUtKAdMM.js";
|
|
6
|
+
import { C as C2, o as o2, q as q2, t as t2, v as v2, w as w2, x as x2, y as y2, z as z2, D as D2, L, R, S, W as W2, A, j as j2, B as B2, E, F as F2, G as G2, H, I, J, K, N, O, P, k, Q, T, i, U, a as a2, V, X, Y, Z, _, h, $, s as s2, a0, u, a1, a2 as a22, a3, a4, a5, a6 } from "./chunks/WebSearchResultsConversationWidget-CUtKAdMM.js";
|
|
7
|
+
import { C as C3, d as d2, g, i as i2, r, u as u2 } from "./chunks/canvas-title-slot-context-rl94V4u4.js";
|
|
8
|
+
import { c as c2, u as u3 } from "./chunks/canvasBodies-C3wydcKZ.js";
|
|
9
9
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
10
|
-
import { n as Skeleton } from "./chunks/link-navigation-
|
|
11
|
-
import { ac, ad, ae, af, ag } from "./chunks/link-navigation-
|
|
10
|
+
import { n as Skeleton } from "./chunks/link-navigation-DRHt6g7U.js";
|
|
11
|
+
import { ac, ad, ae, af, ag } from "./chunks/link-navigation-DRHt6g7U.js";
|
|
12
12
|
import { useMemo } from "react";
|
|
13
|
-
import { a as a7, b as b2, c as c3, d as d3, e } from "./chunks/canvas-reducers-
|
|
13
|
+
import { a as a7, b as b2, c as c3, d as d3, e } from "./chunks/canvas-reducers-CAtcbD4i.js";
|
|
14
14
|
import { a as a8 } from "./chunks/canvas-feature-flags-Cn8xBliA.js";
|
|
15
15
|
const pickSection = (payloadValue, fallback) => {
|
|
16
16
|
return payloadValue ?? fallback.data ?? void 0;
|
package/dist/styles.css
CHANGED
|
@@ -4347,6 +4347,20 @@ thead + tbody .agents_row_VBlQR-:first-child {
|
|
|
4347
4347
|
gap: 0.75rem;
|
|
4348
4348
|
min-width: 0;
|
|
4349
4349
|
width: 100%;
|
|
4350
|
+
}.agents_root_c0NCo5 {
|
|
4351
|
+
display: flex;
|
|
4352
|
+
flex-wrap: wrap;
|
|
4353
|
+
align-items: center;
|
|
4354
|
+
gap: 12px;
|
|
4355
|
+
}
|
|
4356
|
+
|
|
4357
|
+
.agents_notice_kKGwWh {
|
|
4358
|
+
display: flex;
|
|
4359
|
+
flex: 1 1 240px;
|
|
4360
|
+
align-items: flex-start;
|
|
4361
|
+
gap: 8px;
|
|
4362
|
+
min-width: 0;
|
|
4363
|
+
overflow-wrap: anywhere;
|
|
4350
4364
|
}.agents_chip_hRM85s {
|
|
4351
4365
|
display: inline-flex;
|
|
4352
4366
|
align-items: center;
|
|
@@ -4371,6 +4385,20 @@ thead + tbody .agents_row_VBlQR-:first-child {
|
|
|
4371
4385
|
|
|
4372
4386
|
.agents_remove_SMhLO7 {
|
|
4373
4387
|
cursor: pointer;
|
|
4388
|
+
}.agents_root_Z3Vqoh {
|
|
4389
|
+
display: flex;
|
|
4390
|
+
flex-wrap: wrap;
|
|
4391
|
+
align-items: center;
|
|
4392
|
+
gap: 12px;
|
|
4393
|
+
}
|
|
4394
|
+
|
|
4395
|
+
.agents_notice_C-mk81 {
|
|
4396
|
+
display: flex;
|
|
4397
|
+
flex: 1 1 240px;
|
|
4398
|
+
align-items: flex-start;
|
|
4399
|
+
gap: 8px;
|
|
4400
|
+
min-width: 0;
|
|
4401
|
+
overflow-wrap: anywhere;
|
|
4374
4402
|
}.agents_entityDetail_QEy9QH {
|
|
4375
4403
|
display: flex;
|
|
4376
4404
|
flex-direction: column;
|
|
@@ -10,6 +10,15 @@ import type { OpenEntityActionTarget } from "../renderer/canvas/entity-detail-in
|
|
|
10
10
|
export interface AgentsTexts {
|
|
11
11
|
translate: (key: string, replacements?: Record<string, string | number>, context?: string) => string;
|
|
12
12
|
}
|
|
13
|
+
/** The permission of an agent connection a step needs (`AgentsEnvironment.openConnectionPermissions`). */
|
|
14
|
+
export interface AgentsConnectionPermissionTarget {
|
|
15
|
+
/** The connection's id. */
|
|
16
|
+
connectionId: number;
|
|
17
|
+
/** The capability: MAIL, CALENDAR, CONTACTS, FILES or CHAT. */
|
|
18
|
+
capability: string;
|
|
19
|
+
/** The level the step needs (a level constant of the backend, e.g. SEND_WITH_APPROVAL). */
|
|
20
|
+
level: string;
|
|
21
|
+
}
|
|
13
22
|
/** One image of a gallery the app opens over the page. */
|
|
14
23
|
export interface AgentsGalleryImage {
|
|
15
24
|
/** Identifies the image within the gallery. */
|
|
@@ -164,8 +173,8 @@ export interface AgentsEnvironment {
|
|
|
164
173
|
components?: Partial<AgentsComponents>;
|
|
165
174
|
texts?: AgentsTexts;
|
|
166
175
|
/**
|
|
167
|
-
* Prepares a plain text (a model's words, a business name) for the app's `Text`, `Button
|
|
168
|
-
* replacements, which may read a string as markup. Default: the text unchanged.
|
|
176
|
+
* Prepares a plain text (a model's words, the owner's own message, a business name) for the app's `Text`, `Button`,
|
|
177
|
+
* `StatusBadge` and `Tooltip` replacements, which may read a string as markup. Default: the text unchanged.
|
|
169
178
|
*/
|
|
170
179
|
escapePlainTextForText?: (text: string) => string;
|
|
171
180
|
/**
|
|
@@ -182,6 +191,19 @@ export interface AgentsEnvironment {
|
|
|
182
191
|
onOpenEntity?: (target: OpenEntityActionTarget) => boolean;
|
|
183
192
|
/** Opens the images in the app's lightbox, starting at `startIndex`. Default: the start image in a new tab. */
|
|
184
193
|
openImageGallery?: (images: AgentsGalleryImage[], startIndex: number) => void;
|
|
194
|
+
/**
|
|
195
|
+
* Starts a NEW conversation in the owner's personal agent space whose first message is `ownerText`, and shows it (the
|
|
196
|
+
* `ContinueInPersonalSpace` widget's button: a request that only a connection of the owner alone may answer, asked in
|
|
197
|
+
* a conversation others read). Nothing goes back into the conversation the button sits in. Default: none — the
|
|
198
|
+
* widget then renders nothing.
|
|
199
|
+
*/
|
|
200
|
+
startConversationInPersonalSpace?: (ownerText: string) => void;
|
|
201
|
+
/**
|
|
202
|
+
* Opens the app's settings of an agent connection with the permission a step needs preselected (the
|
|
203
|
+
* `ExtendConnectionPermission` widget's button). The level takes effect only once the owner raised it there.
|
|
204
|
+
* Default: none — the widget then renders nothing.
|
|
205
|
+
*/
|
|
206
|
+
openConnectionPermissions?: (target: AgentsConnectionPermissionTarget) => void;
|
|
185
207
|
/** Reports a widget that crashed while rendering. Default: nothing (the crash is logged to the console). */
|
|
186
208
|
reportWidgetCrash?: (widgetName: string, error: Error, errorInfo: ErrorInfo) => void;
|
|
187
209
|
/**
|
|
@@ -262,6 +284,14 @@ export declare const translateText: (key: string, replacements?: Record<string,
|
|
|
262
284
|
export declare const escapePlainTextForText: (text: string) => string;
|
|
263
285
|
/** Opens an image gallery over the page (`AgentsEnvironment.openImageGallery`). */
|
|
264
286
|
export declare const openImageGallery: (images: AgentsGalleryImage[], startIndex: number) => void;
|
|
287
|
+
/** Whether the app can start a conversation in the owner's personal space (`AgentsEnvironment.startConversationInPersonalSpace`). */
|
|
288
|
+
export declare const canStartConversationInPersonalSpace: () => boolean;
|
|
289
|
+
/** Starts a conversation in the owner's personal space with `ownerText` as its first message; false when the app cannot. */
|
|
290
|
+
export declare const startConversationInPersonalSpace: (ownerText: string) => boolean;
|
|
291
|
+
/** Whether the app can open the permissions of a connection (`AgentsEnvironment.openConnectionPermissions`). */
|
|
292
|
+
export declare const canOpenConnectionPermissions: () => boolean;
|
|
293
|
+
/** Opens the permissions of a connection in the app; false when the app cannot. */
|
|
294
|
+
export declare const openConnectionPermissions: (target: AgentsConnectionPermissionTarget) => boolean;
|
|
265
295
|
/** The block field of the package's backend default (`WidgetBlockFieldNames::WIDGET_SELF_HYDRATION_KEY`). */
|
|
266
296
|
export declare const DEFAULT_WIDGET_SELF_HYDRATION_KEY_FIELD_NAME = "agentSpaceId";
|
|
267
297
|
/** The field of a widget block that carries the key of its agent space (`AgentsEnvironment.widgetSelfHydrationKeyFieldName`). */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { AgentsProvider, type AgentsProviderProps, useAgentsActiveAgentSpaceKey, useAgentsBudgetLimit, useAgentsComponents, useAgentsEnvironment, useAgentsMapsLoader, useAgentsOwnerSettings, useAgentsStateDispatch, useAgentsStateSelector, useAgentsTexts, } from "./AgentsProvider";
|
|
2
|
-
export { type AgentsAssistantBackgroundProps, type AgentsAssistantIconBadgeProps, type AgentsBudgetLimit, type AgentsEnvironment, type AgentsGalleryImage, type AgentsMapsLoaderState, type AgentsOwnerSettings, type AgentsSandboxLegacyAliases, type AgentsStateAction, type AgentsStateStore, type AgentsTexts, appendAnotherAgentSpaceToOwnerText, buildUnnamedAgentSpaceLabel, buildWidgetOfAnotherAgentSpaceExplanation, DEFAULT_AGENTS_TEXTS, DEFAULT_WIDGET_IMAGE_CAPTURE_READ_PATH_PREFIX, DEFAULT_WIDGET_SELF_HYDRATION_KEY_FIELD_NAME, escapePlainTextForText, getAgentDisplayName, getAgentsEnvironment, getFurtherCanvasBehaviours, getFurtherWidgetClickSignalSources, getGoogleMapWidgetNames, getSandboxLegacyAliases, getWidgetImageCaptureReadPathPrefix, getWidgetSelfHydrationKeyFieldName, openImageGallery, reportRunningTurn, reportWidgetCrash, setAgentsEnvironment, translateText, } from "./environment";
|
|
2
|
+
export { type AgentsAssistantBackgroundProps, type AgentsAssistantIconBadgeProps, type AgentsBudgetLimit, type AgentsEnvironment, type AgentsConnectionPermissionTarget, type AgentsGalleryImage, type AgentsMapsLoaderState, type AgentsOwnerSettings, type AgentsSandboxLegacyAliases, type AgentsStateAction, type AgentsStateStore, type AgentsTexts, appendAnotherAgentSpaceToOwnerText, buildUnnamedAgentSpaceLabel, buildWidgetOfAnotherAgentSpaceExplanation, DEFAULT_AGENTS_TEXTS, DEFAULT_WIDGET_IMAGE_CAPTURE_READ_PATH_PREFIX, DEFAULT_WIDGET_SELF_HYDRATION_KEY_FIELD_NAME, escapePlainTextForText, getAgentDisplayName, getAgentsEnvironment, getFurtherCanvasBehaviours, getFurtherWidgetClickSignalSources, getGoogleMapWidgetNames, getSandboxLegacyAliases, getWidgetImageCaptureReadPathPrefix, getWidgetSelfHydrationKeyFieldName, openImageGallery, reportRunningTurn, reportWidgetCrash, setAgentsEnvironment, translateText, } from "./environment";
|
|
3
3
|
export { classNames } from "./class-names";
|
|
4
4
|
export { useAgentsConversationClient, useOptionalAgentsConversationClient, } from "../client/AgentsConversationClientContext";
|
|
5
5
|
export { AgentsLink, type AgentsLinkNavigation, type AgentsLinkProps, useAgentsLinkNavigation, } from "./link-navigation";
|
package/dist/voice.js
CHANGED
|
@@ -3,9 +3,9 @@ import { useSyncExternalStore, useState, useEffect, useMemo, useRef, useCallback
|
|
|
3
3
|
import { t as textKey } from "./chunks/text-key-DnoZ4lAk.js";
|
|
4
4
|
import { f as formatAgentVoiceCallDuration } from "./chunks/format-agent-voice-call-duration-C-3hRc9p.js";
|
|
5
5
|
import { a as useOptionalAgentsConversationClient } from "./chunks/AgentsConversationClientContext-C4T7g_Qk.js";
|
|
6
|
-
import { c as DEFAULT_AGENTS_TEXTS, ab as useAgentsTexts, K as getAgentDisplayName, a4 as useAgentsComponents, D as DEFAULT_AGENTS_COMPONENTS } from "./chunks/link-navigation-
|
|
6
|
+
import { c as DEFAULT_AGENTS_TEXTS, ab as useAgentsTexts, K as getAgentDisplayName, a4 as useAgentsComponents, D as DEFAULT_AGENTS_COMPONENTS } from "./chunks/link-navigation-DRHt6g7U.js";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
-
import { V as VoiceBarsIcon, C as ConversationMessageWidgets, a as ConversationMessageUser } from "./chunks/VoiceBarsIcon-
|
|
8
|
+
import { V as VoiceBarsIcon, C as ConversationMessageWidgets, a as ConversationMessageUser } from "./chunks/VoiceBarsIcon-CNIPOLtV.js";
|
|
9
9
|
import { a as useOptionalAgentsChatStore, u as useAgentsChatSelector } from "./chunks/use-agents-chat-store-CuIkCz9v.js";
|
|
10
10
|
class AgentVoiceApiError extends Error {
|
|
11
11
|
constructor(code, httpStatus) {
|
package/dist/widgets.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { a2 as useIsEmailWidgetRender } from "./chunks/WebSearchResultsConversationWidget-
|
|
3
|
-
import { ad, ae, af, ag, ah, ai, aj, ak, aj as aj2, al, am, an, ao, ap, aq, ar, as, at, au, av, aw, ax, ay, az, aA, aB, aC, aD, aE, aF, aG, aH, aI, aJ, aK, aL, aM, aN, aO, aP, aQ, aR, aS, aT, aU, aV, aW, aX, aY, aZ, a_, a$, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, ba, bb, bc, bd, be, bf, bg, bh, bi, bj, bk, bl, bm } from "./chunks/WebSearchResultsConversationWidget-
|
|
2
|
+
import { a2 as useIsEmailWidgetRender } from "./chunks/WebSearchResultsConversationWidget-CUtKAdMM.js";
|
|
3
|
+
import { ad, ae, af, ag, ah, ai, aj, ak, aj as aj2, al, am, an, ao, ap, aq, ar, as, at, au, av, aw, ax, ay, az, aA, aB, aC, aD, aE, aF, aG, aH, aI, aJ, aK, aL, aM, aN, aO, aP, aQ, aR, aS, aT, aU, aV, aW, aX, aY, aZ, a_, a$, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, ba, bb, bc, bd, be, bf, bg, bh, bi, bj, bk, bl, bm } from "./chunks/WebSearchResultsConversationWidget-CUtKAdMM.js";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
import { r as StatusChip, s as Text, F as classNames } from "./chunks/link-navigation-
|
|
6
|
-
import { g, x } from "./chunks/link-navigation-
|
|
5
|
+
import { r as StatusChip, s as Text, F as classNames } from "./chunks/link-navigation-DRHt6g7U.js";
|
|
6
|
+
import { g, x } from "./chunks/link-navigation-DRHt6g7U.js";
|
|
7
7
|
import { useSyncExternalStore, useState, useEffect } from "react";
|
|
8
8
|
const WidgetStatusChip = (props) => /* @__PURE__ */ jsx(StatusChip, { ...props });
|
|
9
9
|
const widgetLabel = "agents_widgetLabel_WecWAw";
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"VoiceBarsIcon-BKtx_QIg.js","sources":["../../src/renderer/repair-malformed-widget-fences.ts","../../src/renderer/reference-naked-widget-json.ts","../../src/chat/strip-pre-call-message-marker.ts","../../src/chat/normalize-server-message-to-markdown.ts","../../src/chat/ConversationMessage/ConversationMessageUser/ConversationMessageUserWidgets.tsx","../../src/chat/ConversationMessage/ConversationMessageUser/ConversationMessageUser.tsx","../../src/chat/ConversationMessage/ConversationMessageWidgets/hooks/useTypewriter.ts","../../src/chat/ConversationMessage/ConversationMessageWidgets/hooks/useStreamingText.ts","../../src/chat/ConversationMessage/ConversationMessageWidgets/hooks/useFreshMessageBlockReveal.ts","../../src/chat/ConversationMessage/ConversationMessageWidgets/ConversationMessageHeader/ConversationMessageHeader.tsx","../../src/chat/ConversationMessage/ConversationMessageWidgets/copyRichToClipboard.ts","../../src/chat/ConversationMessage/ConversationMessageWidgets/ConversationMessageWidgets.tsx","../../src/chat/ConversationMessage/ConversationCallMarkerChip/VoiceBarsIcon/VoiceBarsIcon.tsx"],"sourcesContent":["import { findBalancedJsonObjectEnd } from \"./balanced-json-object\";\nimport { WIDGET_FENCE_LANG } from \"./widget-fence-syntax\";\n\n/**\n * Repair the ```widget fence defects a model produces when it switches into a function call mid-text, or drops a\n * closing fence, or opens a second widget before closing the first (text + fence + tool call\n * in ONE response). A LINE-AWARE pass: CommonMark opens a fence on a line that (after up to 3 spaces of indent)\n * starts with ``` , and closes it only on a line whose sole content — same indent rule — is ``` . Content inside\n * ANY open fence (widget, json, or anything else) is data and is never scanned or touched, so a ``` mentioned\n * inside a JSON string value never gets mistaken for a delimiter.\n *\n * Two repairs, both scoped to the ```widget lang only:\n * 1. A glued opener (```widget stuck to the end of a prose line, so Markdown never recognized it as starting a\n * line) is relocated onto its own line ONLY when a JSON object begins right after it — otherwise the text is\n * left completely untouched (a prose sentence that merely mentions ```widget must not be mangled).\n * 2. An open widget fence with no proper closing-fence LINE before either end-of-text or the next fence-opener\n * line gets a ``` closer spliced in right after its balanced JSON object (string-aware, so a ``` inside a JSON\n * string is never treated as the closer). A widget fence whose body isn't a JSON object at all is left\n * untouched — nothing could safely render there either way, and deleting text is not this function's job.\n *\n * The backend stores the model text as emitted, so this is the ONE place the shape is corrected — for stored\n * history and for every new message alike. Runs before `referenceNakedWidgetJson` so the re-fenced JSON is not\n * wrapped a second time. Pure; well-formed text is returned unchanged.\n */\n\n/** A fence delimiter LINE per CommonMark, either character: up to 3 spaces indent, then a run of 3+ of the same\n * fence character (`` ` `` or `~`), then the rest of the line. Used by {@link findFencedBlockRanges} — the GENERAL\n * \"is this real fence syntax\" question, as opposed to the WIDGET-fence-only scanning above. */\nconst ANY_FENCE_DELIM_LINE = /^ {0,3}(`{3,}|~{3,})(.*)$/;\n\n/** One real fence delimiter: its character, marker length and (trimmed) info string. */\ninterface FenceDelimiter {\n char: \"`\" | \"~\";\n length: number;\n info: string;\n}\n\n/**\n * Parse one line as a CommonMark fence delimiter, or null when it isn't one. A backtick run's info string may not\n * itself contain a backtick — CommonMark's own rule disambiguating a fence opener from an inline code span — so a\n * line such as \"```js `x`\" is not a fence delimiter at all (it never opens or closes anything).\n */\nconst parseFenceDelimiterLine = (line: string): FenceDelimiter | null => {\n const match = ANY_FENCE_DELIM_LINE.exec(line);\n if (!match) return null;\n const marker = match[1];\n const char = marker[0] as \"`\" | \"~\";\n const info = match[2].trim();\n if (char === \"`\" && info.includes(\"`\")) return null;\n return { char, length: marker.length, info };\n};\n\nconst isWidgetFenceInfo = (info: string): boolean => new RegExp(`^${WIDGET_FENCE_LANG}\\\\b`).test(info.trim());\n\n/** A ```widget opener anywhere in the text, glued or not — built from the shared lang constant. */\nconst widgetOpenerPattern = (): RegExp => new RegExp(\"```[ \\\\t]*\" + WIDGET_FENCE_LANG + \"\\\\b\");\n\n/** One line of `text` starting at `lineStart`: its content (terminator excluded — a trailing `\\r` of a CRLF\n * line ending is stripped too, so a delimiter regex's `.` never has to account for it) and the index right after\n * the line INCLUDING its terminator (or `text.length` at end-of-text). */\nconst readLine = (text: string, lineStart: number): { content: string; afterLine: number } => {\n const newlineIndex = text.indexOf(\"\\n\", lineStart);\n const lineEnd = newlineIndex === -1 ? text.length : newlineIndex;\n const afterLine = newlineIndex === -1 ? text.length : newlineIndex + 1;\n const rawContent = text.slice(lineStart, lineEnd);\n return { content: rawContent.endsWith(\"\\r\") ? rawContent.slice(0, -1) : rawContent, afterLine };\n};\n\n/**\n * Scan forward from `bodyStart` for a line that CLOSES the given opener: same fence character, a marker run at\n * least as long as the opener's, and nothing but whitespace after it (CommonMark's closing-fence rule). Unclosed →\n * end-of-text.\n */\nconst findClosingFenceEnd = (text: string, bodyStart: number, opener: FenceDelimiter): number => {\n let cursor = bodyStart;\n while (cursor < text.length) {\n const { content, afterLine } = readLine(text, cursor);\n const delimiter = parseFenceDelimiterLine(content);\n if (delimiter && delimiter.char === opener.char && delimiter.length >= opener.length && delimiter.info === \"\") {\n return afterLine;\n }\n cursor = afterLine;\n }\n return text.length;\n};\n\n/**\n * The `[start, end)` ranges of every REAL fenced code block in `text` — ``` or ~~~, CommonMark's own rules (up to\n * 3 spaces of indent, a closer using the same character with a run at least as long as the opener's, a backtick\n * opener's info string never containing a backtick). An unclosed opener runs to end-of-text. The GENERAL-PURPOSE\n * counterpart of this file's widget-fence-only scanning, built on the same {@link readLine} line walk — used by\n * `referenceNakedWidgetJson` to skip content genuinely inside a fence: a `~~~widget` fence (no tilde support\n * existed before), and content that follows a line which LOOKS like a backtick fence opener but isn't one per the\n * info-string rule above (that line never opens anything, so it can no longer swallow the real fence after it).\n */\nexport const findFencedBlockRanges = (text: string): Array<[number, number]> => {\n const ranges: Array<[number, number]> = [];\n let cursor = 0;\n while (cursor < text.length) {\n const { content, afterLine } = readLine(text, cursor);\n const opener = parseFenceDelimiterLine(content);\n if (opener) {\n const end = findClosingFenceEnd(text, afterLine, opener);\n ranges.push([cursor, end]);\n cursor = end;\n continue;\n }\n cursor = afterLine;\n }\n return ranges;\n};\n\n/**\n * Scan forward from `bodyStart` (right after a fence opener line) for the next LINE-anchored BACKTICK fence\n * delimiter (via {@link parseFenceDelimiterLine} — the same CommonMark rules `findFencedBlockRanges` uses, so a\n * line like \"```js `x`\" — an invalid info string, not a fence delimiter at all — is correctly skipped as plain\n * content rather than mistaken for one): a proper closing line (empty info) closes the fence normally; any other\n * delimiter line (another opener, any lang) is the boundary where this fence gave up without closing. Neither\n * found before end-of-text → unclosed at EOF.\n */\nconst findFenceEnd = (text: string, bodyStart: number): { closesAt: number } | { unclosedBoundary: number } => {\n let cursor = bodyStart;\n while (cursor < text.length) {\n const { content, afterLine } = readLine(text, cursor);\n const delimiter = parseFenceDelimiterLine(content);\n if (delimiter && delimiter.char === \"`\") {\n return delimiter.info === \"\" ? { closesAt: afterLine } : { unclosedBoundary: cursor };\n }\n cursor = afterLine;\n }\n return { unclosedBoundary: text.length };\n};\n\n/**\n * Resolve an OPEN widget fence's body starting at `bodyStart`: verbatim through a real closing-fence line when one\n * exists before end-of-text or the next fence-opener line; otherwise a ``` closer spliced in right after the\n * balanced JSON object; or, when the body isn't a JSON object at all, everything to end-of-text left untouched.\n */\nconst closeWidgetFenceBody = (text: string, bodyStart: number): { appended: string; resumeAt: number } => {\n const end = findFenceEnd(text, bodyStart);\n if (\"closesAt\" in end) {\n return { appended: text.slice(bodyStart, end.closesAt), resumeAt: end.closesAt };\n }\n const jsonObjectEnd = findBalancedJsonObjectEnd(text, bodyStart);\n if (jsonObjectEnd === null) {\n return { appended: text.slice(bodyStart), resumeAt: text.length };\n }\n return { appended: text.slice(bodyStart, jsonObjectEnd + 1) + \"\\n```\", resumeAt: jsonObjectEnd + 1 };\n};\n\nexport const repairMalformedWidgetFences = (text: string): string => {\n if (!widgetOpenerPattern().test(text)) return text;\n\n let result = \"\";\n let cursor = 0;\n while (cursor < text.length) {\n const { content, afterLine } = readLine(text, cursor);\n\n // Backtick fences only here (tilde ```widget``` has no repair path, same as before): a line whose backtick\n // run's info string itself contains a backtick (e.g. \"```js `x`\") is not a fence delimiter at all per\n // CommonMark, so it falls through to the glued-opener check / plain-text copy below, never swallowing a real\n // ```widget fence that follows it as a bogus \"other fence\".\n const delimiter = parseFenceDelimiterLine(content);\n if (delimiter && delimiter.char === \"`\") {\n const info = delimiter.info;\n if (info !== \"\" && isWidgetFenceInfo(info)) {\n result += content + text.slice(cursor + content.length, afterLine); // the opener line, verbatim\n const { appended, resumeAt } = closeWidgetFenceBody(text, afterLine);\n result += appended;\n cursor = resumeAt;\n continue;\n }\n if (info !== \"\") {\n // Some other fenced language: copy its whole body through untouched — never scanned for a widget opener,\n // so a widget-fence mention inside a JSON string value in THIS fence's content is never touched (a widget\n // fence itself can't legally start inside an already-open fence either way).\n const otherFenceEnd = findFenceEnd(text, afterLine);\n const bodyEnd = \"closesAt\" in otherFenceEnd ? otherFenceEnd.closesAt : text.length;\n result += text.slice(cursor, bodyEnd);\n cursor = bodyEnd;\n continue;\n }\n }\n\n // Not a fence-delimiter line: a glued opener (the fence's backticks stuck to the end of prose). Relocate onto\n // its own line ONLY when a JSON object begins right after it; a prose line that merely mentions ```widget with\n // nothing to render is left completely untouched.\n const gluedMatch = widgetOpenerPattern().exec(content);\n if (gluedMatch && gluedMatch.index > 0 && content.slice(0, gluedMatch.index).trim() !== \"\") {\n const bodyStart = afterLine;\n if (findBalancedJsonObjectEnd(text, bodyStart) !== null) {\n const openerLine = content.slice(gluedMatch.index) + text.slice(cursor + content.length, afterLine);\n result += content.slice(0, gluedMatch.index) + \"\\n\" + openerLine;\n const { appended, resumeAt } = closeWidgetFenceBody(text, bodyStart);\n result += appended;\n cursor = resumeAt;\n continue;\n }\n }\n\n result += text.slice(cursor, afterLine);\n cursor = afterLine;\n }\n return result;\n};\n","import { findBalancedJsonObjectEnd } from \"./balanced-json-object\";\nimport { findFencedBlockRanges } from \"./repair-malformed-widget-fences\";\nimport { resolveWidgetName } from \"./widget-name-resolver\";\n\n/**\n * Weak models (Gemini-3.5-Flash) intermittently emit a widget as a NAKED JSON line —\n * `{ \"type\": \"ExampleWidget\" }` — without the ```widget fence the skills instruct. Such a line is not rendered\n * by remarkWidgetFencePlugin (no fence) and not by the bare-line path (no `widget` prefix), so the customer sees raw\n * JSON. `detectUnrenderedWidgets` only DETECTS this (to corrective-signal the model); here we RENDER it: wrap a naked\n * line-starting JSON object whose `type` resolves to a REGISTERED widget in a ```widget fence, so the plugin renders\n * it — no model round-trip, the customer never sees JSON. UNKNOWN types are left untouched (the corrective-signal\n * path still handles `type: \"example\"` → suggest `ExampleWidget`).\n *\n * Fence-aware: JSON already inside any REAL fenced block (``` or ~~~, CommonMark rules — see\n * `findFencedBlockRanges`) is skipped (never double-fenced). Uses the SAME resolveWidgetName as the render plugin +\n * the detector, so \"would render\" is decided in one place.\n */\n\n/** A line-starting balanced { … } JSON object and its [start, end) span in the source text. */\ninterface JsonSpan {\n json: string;\n start: number;\n end: number;\n}\n\n/**\n * Scan line-starting balanced `{ … }` JSON objects (string-aware brace walk), returning each with its span. Mirrors\n * detect-unrendered-widgets' `extractNakedJsonCandidates`, but keeps offsets so the object can be replaced in place.\n */\nconst scanLineStartingJsonSpans = (text: string): JsonSpan[] => {\n const spans: JsonSpan[] = [];\n const lines = text.split(\"\\n\");\n let offset = 0;\n for (const line of lines) {\n const lineStart = offset;\n offset += line.length + 1;\n if (!line.trimStart().startsWith(\"{\")) continue;\n const openIndex = lineStart + line.indexOf(\"{\");\n const jsonObjectEnd = findBalancedJsonObjectEnd(text, openIndex);\n if (jsonObjectEnd !== null) {\n spans.push({ json: text.slice(openIndex, jsonObjectEnd + 1), start: openIndex, end: jsonObjectEnd + 1 });\n }\n }\n return spans;\n};\n\n/** The string `type` of a JSON object, or null when it is not an object with a non-empty string `type`. */\nconst widgetTypeOf = (jsonCandidate: string): string | null => {\n let parsed: unknown;\n try {\n parsed = JSON.parse(jsonCandidate);\n } catch {\n return null;\n }\n if (typeof parsed !== \"object\" || parsed === null) return null;\n const type = (parsed as Record<string, unknown>).type;\n return typeof type === \"string\" && type !== \"\" ? type : null;\n};\n\nexport const referenceNakedWidgetJson = (text: string): string => {\n if (!text.includes('\"type\"')) return text;\n\n const fencedRanges = findFencedBlockRanges(text);\n const isInsideFence = (position: number) => fencedRanges.some(([start, end]) => position >= start && position < end);\n\n // Right-to-left so each replacement leaves the earlier spans' offsets valid.\n const spans = scanLineStartingJsonSpans(text)\n .filter((span) => !isInsideFence(span.start))\n .reverse();\n\n let result = text;\n for (const span of spans) {\n const type = widgetTypeOf(span.json);\n if (type === null || resolveWidgetName(type) === undefined) continue; // unknown → leave for the corrective signal\n const fencedBlock = \"```widget\\n\" + span.json + \"\\n```\";\n result = result.slice(0, span.start) + fencedBlock + result.slice(span.end);\n }\n return result;\n};\n","/**\n * Mirrors `AIConversationMessage::PRE_CALL_MESSAGE_MARKER` (PHP). The model prefixes a short \"I'm about to do X\"\n * status line with this sentinel; the BACKEND only detects/signals on it and stores it RAW (it never strips). Every\n * render layer — this is the customer chat one — strips it before showing the text to the user.\n */\nexport const PRE_CALL_MESSAGE_MARKER = \"{preCallMessage}\";\n\n/**\n * The MANGLED JSON form some models emit instead of the sentinel (Gemini 3.5 Flash): the status line\n * arrives as `{ \"preCallMessage\": \"…\" }<` — optionally with extra fields and/or a trailing `<|im_call:…` pseudo call\n * marker — fused into the assistant text. Normalized to the inner status text so the user never sees raw JSON.\n * Mirrors the PHP normalization in `AIConversationMessage::stripPreCallMessageMarker`.\n */\nconst MANGLED_PRE_CALL_RE = /\\{\\s*\"preCallMessage\"\\s*:\\s*\"((?:[^\"\\\\]|\\\\.)*)\"\\s*,?\\s*[^}]*\\}\\s*(?:<\\S*)?/g;\n\n/**\n * Remove the {preCallMessage} sentinel from assistant text before display, and normalize the mangled JSON form to\n * its inner status line. Also holds back a leading PARTIAL of either shape while it is still streaming in (so the\n * user never sees a \"{preCa…\" or `{ \"preCallMessage\": \"Einen Mo` flash before the full form arrives).\n */\nexport const stripPreCallMessageMarker = (text: string): string => {\n if (!text) return text;\n const leading = text.replace(/^\\s+/, \"\");\n // The sentinel itself is still streaming (nothing after it yet) → render nothing until real content arrives.\n if (leading.length < PRE_CALL_MESSAGE_MARKER.length && PRE_CALL_MESSAGE_MARKER.startsWith(leading)) return \"\";\n // The mangled JSON form is still streaming (opened but not yet closed) → hold it back the same way.\n const mangledPrefix = '{ \"preCallMessage\"';\n const normalizedLeading = leading.replace(/\\s+/g, \" \");\n if (\n (normalizedLeading.length < mangledPrefix.length && mangledPrefix.startsWith(normalizedLeading)) ||\n (normalizedLeading.startsWith(mangledPrefix) && !normalizedLeading.includes(\"}\"))\n ) {\n return \"\";\n }\n const withMangledNormalized = text.replace(MANGLED_PRE_CALL_RE, (_match, escapedStatusLine: string) => {\n try {\n return JSON.parse(`\"${escapedStatusLine}\"`) as string;\n } catch {\n return escapedStatusLine;\n }\n });\n const withMarkerRemoved = withMangledNormalized.split(PRE_CALL_MESSAGE_MARKER).join(\"\");\n // The marker (or its mangled form) sits at the very start, after only whitespace → that whitespace was there\n // only to separate it from the rest of the text and is removed along with it. Anything else — a message that\n // never carried the marker there at all — keeps its OWN leading whitespace untouched, so a four-space-indented\n // code block at the start of a message stays indented (plain CommonMark code) instead of sliding to column 0\n // and becoming a widget fence.\n const markerWasLeading = leading.startsWith(PRE_CALL_MESSAGE_MARKER) || normalizedLeading.startsWith(mangledPrefix);\n return markerWasLeading ? withMarkerRemoved.replace(/^\\s+/, \"\") : withMarkerRemoved;\n};\n","import { referenceNakedWidgetJson } from \"../renderer/reference-naked-widget-json\";\nimport { repairMalformedWidgetFences } from \"../renderer/repair-malformed-widget-fences\";\n\nimport { stripPreCallMessageMarker } from \"./strip-pre-call-message-marker\";\n\ntype ServerTextPart = { type: \"text\"; text?: string };\n\ntype ServerComponentPart = {\n type: \"component\";\n name?: string;\n props?: Record<string, unknown>;\n};\n\ntype ServerToolUsePart = {\n type: \"tool_use\";\n name?: string;\n input?: unknown;\n};\n\ntype ServerMessagePart = ServerTextPart | ServerComponentPart | ServerToolUsePart;\n\nexport type AssistantServerMessagePayload = {\n role?: string;\n content?: ServerMessagePart[];\n parts?: ServerMessagePart[];\n messageId?: string;\n};\n\nconst WIDGET_ATTR_KEY = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/;\n\nconst isRecord = (value: unknown): value is Record<string, unknown> => typeof value === \"object\" && value !== null;\n\nconst isTextPart = (part: unknown): part is ServerTextPart => isRecord(part) && part.type === \"text\";\n\nconst isComponentPart = (part: unknown): part is ServerComponentPart =>\n isRecord(part) && part.type === \"component\" && typeof part.name === \"string\" && part.name.length > 0;\n\nconst isToolUsePart = (part: unknown): part is ServerToolUsePart => isRecord(part) && part.type === \"tool_use\";\n\nconst isMessagePart = (part: unknown): part is ServerMessagePart =>\n isTextPart(part) || isComponentPart(part) || isToolUsePart(part);\n\nconst isPayload = (value: unknown): value is AssistantServerMessagePayload => {\n if (!isRecord(value)) return false;\n const parts = value.content ?? value.parts;\n return Array.isArray(parts) && parts.every(isMessagePart);\n};\n\n/**\n * The model occasionally emits a single part object instead of an array\n * ({\"content\":{\"type\":\"text\",...}}). Coerce it so the message still renders.\n */\nconst coerceSinglePartPayload = (value: unknown): AssistantServerMessagePayload | null => {\n if (!isRecord(value)) return null;\n const part = value.content ?? value.parts;\n if (!isMessagePart(part)) return null;\n const rest = { ...value };\n delete rest.parts;\n return { ...rest, content: [part] };\n};\n\nconst encodeAttrValue = (value: unknown) => JSON.stringify(value).replace(/'/g, \"\\\\u0027\");\n\nconst propsToAttrs = (props: Record<string, unknown>) =>\n Object.entries(props)\n .filter(([key, value]) => value !== undefined && WIDGET_ATTR_KEY.test(key))\n .map(([key, value]) => `${key}='${encodeAttrValue(value)}'`)\n .join(\" \");\n\nconst componentPartToWidget = (part: ServerComponentPart) => {\n const attrs = propsToAttrs(part.props ?? {});\n return attrs ? `::${part.name}{${attrs}}` : `::${part.name}`;\n};\n\nconst toolUsePartToWidget = (part: ServerToolUsePart) => {\n const payload = encodeAttrValue({ name: part.name, input: part.input });\n return `::ToolTrace{payload='${payload}'}`;\n};\n\nconst partToMarkdown = (part: ServerMessagePart) => {\n if (isTextPart(part)) return part.text?.trim() ?? \"\";\n if (isToolUsePart(part)) return toolUsePartToWidget(part);\n return componentPartToWidget(part);\n};\n\nconst payloadToMarkdown = (payload: AssistantServerMessagePayload) => {\n return (payload.content ?? payload.parts ?? []).map(partToMarkdown).filter(Boolean).join(\"\\n\\n\");\n};\n\nconst tryParsePayload = (value: string): AssistantServerMessagePayload | null => {\n try {\n const parsed = JSON.parse(value) as unknown;\n return isPayload(parsed) ? parsed : coerceSinglePartPayload(parsed);\n } catch {\n return null;\n }\n};\n\nexport const normalizeServerMessageToMarkdown = (message: unknown): string => {\n let result: string;\n if (typeof message === \"string\") {\n const parsed = tryParsePayload(message);\n result = parsed ? payloadToMarkdown(parsed) : message;\n } else if (isPayload(message)) {\n result = payloadToMarkdown(message);\n } else {\n const coerced = coerceSinglePartPayload(message);\n if (coerced) {\n result = payloadToMarkdown(coerced);\n } else {\n console.warn(\"[AIExtensions] normalizeServerMessageToMarkdown: unrecognized message shape\", message);\n result = \"\";\n }\n }\n // The backend stores the {preCallMessage} status-line sentinel raw (it only detects/signals on it) — strip it here.\n // Then repair a ```widget fence the model broke mid-text (opener glued to the prose line / never closed — the model\n // switched into a tool call), then re-fence any naked widget JSON (a weak model emitted\n // `{ \"type\": \"ExampleWidget\" }` without a ```widget fence): wrapping a known widget type lets\n // remarkWidgetFencePlugin render it, so the customer never sees raw JSON.\n return referenceNakedWidgetJson(repairMalformedWidgetFences(stripPreCallMessageMarker(result)));\n};\n","import React from \"react\";\nimport { ConversationComposerWidget } from \"../../../renderer/conversation-composer-widget\";\nimport { conversationWidgetRegistry } from \"../../../renderer/conversationWidgetRegistry\";\nimport { ConversationWidgetErrorBoundary } from \"../../../renderer/ConversationWidgetErrorBoundary\";\n\nexport interface ConversationMessageUserWidgetsProps {\n /** Composer-widget fences extracted from the customer's own message text (see `splitComposerWidgetFencesFromMessageText`). */\n widgets: ConversationComposerWidget[];\n}\n\n/**\n * Read-only echo of the composer widgets the customer sent inside their OWN message — rendered above the prose. Reuses each widget's registered message `component` (the same one an\n * assistant reply would mount via the remark pipeline) directly with the fence's fields as `payload` — NOT the\n * remark/markdown pipeline itself, which never runs for user text (interpreting the customer's own prose as\n * Markdown would change every user bubble). `fresh={false}`: this is always a replay of content already sent, never\n * a live delivery. Each widget renders inside its own `ConversationWidgetErrorBoundary` so a malformed fence never\n * blanks the whole bubble.\n */\nexport const ConversationMessageUserWidgets = (props: ConversationMessageUserWidgetsProps) => {\n const { widgets } = props;\n\n if (widgets.length === 0) return null;\n\n return (\n <>\n {widgets.map((widget) => {\n const entry = conversationWidgetRegistry.widgets.find((candidate) => candidate.name === widget.widgetName);\n if (!entry) return null;\n const Component = entry.component;\n return (\n <ConversationWidgetErrorBoundary key={widget.composerWidgetId} widgetName={entry.name}>\n <Component payload={JSON.stringify(widget.fields)} fresh={false} />\n </ConversationWidgetErrorBoundary>\n );\n })}\n </>\n );\n};\n","import { Text } from \"../../../provider/components\";\nimport React, { useMemo } from \"react\";\nimport { classNames } from \"../../../provider/class-names\";\nimport styles from \"./ConversationMessageUser.module.scss\";\nimport { splitComposerWidgetFencesFromMessageText } from \"../../../renderer/composer-widget-fence\";\nimport type { ConversationComposerWidget } from \"../../../renderer/conversation-composer-widget\";\nimport { conversationWidgetRegistry } from \"../../../renderer/conversationWidgetRegistry\";\nimport { ConversationMessageUserWidgets } from \"./ConversationMessageUserWidgets\";\n\nexport type ConversationMessageUserTheme = \"default\" | \"light\" | \"dark\" | \"primary\";\n\nexport interface ConversationMessageUserProps {\n text: string;\n theme?: ConversationMessageUserTheme;\n /** @deprecated Never read: a customer message looks the same in every chat. Kept so existing callers compile. */\n isGenericChat?: boolean;\n}\n\n/** True when the widget's registry entry shows its echo on its own above the bubble (e.g. attached images). */\nconst isShownAboveBubble = (widget: ConversationComposerWidget): boolean =>\n conversationWidgetRegistry.widgets.find((entry) => entry.name === widget.widgetName)?.customerMessagePlacement ===\n \"aboveBubble\";\n\nexport const ConversationMessageUser = (props: ConversationMessageUserProps) => {\n const { text, theme = \"default\" } = props;\n\n // Pull any registered composer-widget fences out of the customer's own message text so they render as\n // read-only widgets above the prose, exactly like the assistant-side remark pipeline renders them in a reply —\n // but WITHOUT running that pipeline over user text (never treat the customer's own prose as Markdown).\n const { text: proseText, widgets } = useMemo(() => splitComposerWidgetFencesFromMessageText(text), [text]);\n const widgetsAboveBubble = useMemo(() => widgets.filter(isShownAboveBubble), [widgets]);\n const widgetsInsideBubble = useMemo(() => widgets.filter((widget) => !isShownAboveBubble(widget)), [widgets]);\n\n const bubbleClass =\n theme === \"light\"\n ? styles.whiteBubble\n : theme === \"dark\"\n ? styles.darkBubble\n : theme === \"primary\"\n ? styles.primaryBubble\n : undefined;\n\n const textColor =\n theme === \"light\"\n ? \"var(--agents-fg)\"\n : theme === \"dark\"\n ? \"var(--agents-chat-user-bubble-text)\"\n : \"var(--agents-fg-on-accent)\";\n\n const bubble = (\n <div className={classNames(styles.message, bubbleClass)} data-testid=\"chat-message-user\">\n <ConversationMessageUserWidgets widgets={widgetsInsideBubble} />\n {/* A widget-only message (e.g. images sent without text) has no prose line to render. */}\n {proseText !== \"\" && (\n <Text allowNewLines translate={false} color={textColor}>\n {proseText}\n </Text>\n )}\n </div>\n );\n\n if (widgetsAboveBubble.length === 0) return bubble;\n\n // Widgets placed above the bubble (e.g. attached images) stand on their own, right-aligned; a message that is nothing\n // but such widgets shows no bubble at all.\n return (\n <div className={styles.messageWithWidgetsAboveBubble}>\n <ConversationMessageUserWidgets widgets={widgetsAboveBubble} />\n {(proseText !== \"\" || widgetsInsideBubble.length > 0) && bubble}\n </div>\n );\n};\n","import { useRef, useState, useCallback } from \"react\";\n\ninterface UseTypewriterOptions {\n // Characters per second to reveal\n speed?: number;\n // Minimum interval between UI commits (ms) to reduce re-renders\n commitIntervalMs?: number;\n}\n\nexport const useTypewriter = (options: UseTypewriterOptions = {}) => {\n const { speed = 200, commitIntervalMs = 50 } = options;\n\n const [displayedText, setDisplayedText] = useState<string>(\"\");\n const [isFinished, setIsFinished] = useState<boolean>(false);\n\n const fullTextRef = useRef<string>(\"\");\n const typeRAFRef = useRef<number | null>(null);\n const lastTimestampRef = useRef<number | null>(null);\n const renderedLengthRef = useRef<number>(0);\n const speedRef = useRef<number>(speed);\n const commitIntervalRef = useRef<number>(commitIntervalMs);\n const lastCommitTsRef = useRef<number>(0);\n\n const startTypewriter = useCallback(() => {\n if (typeRAFRef.current !== null) return; // already running\n if (renderedLengthRef.current >= fullTextRef.current.length) return; // nothing to render\n\n const animate = (timestamp: number) => {\n if (lastTimestampRef.current === null) {\n lastTimestampRef.current = timestamp;\n }\n\n const elapsedSeconds = (timestamp - lastTimestampRef.current) / 1000;\n lastTimestampRef.current = timestamp;\n\n const charactersToAdd = Math.max(1, Math.floor(elapsedSeconds * speedRef.current));\n const nextLength = Math.min(fullTextRef.current.length, renderedLengthRef.current + charactersToAdd);\n\n renderedLengthRef.current = nextLength;\n\n // Only commit to React state at most every commitIntervalMs or when finished\n if (\n timestamp - lastCommitTsRef.current >= commitIntervalRef.current ||\n nextLength === fullTextRef.current.length\n ) {\n const nextText = fullTextRef.current.slice(0, nextLength);\n setDisplayedText(nextText);\n lastCommitTsRef.current = timestamp;\n }\n\n if (nextLength < fullTextRef.current.length) {\n typeRAFRef.current = requestAnimationFrame(animate);\n } else {\n typeRAFRef.current = null;\n lastTimestampRef.current = null;\n setIsFinished(true);\n }\n };\n\n typeRAFRef.current = requestAnimationFrame(animate);\n }, []);\n\n const appendText = useCallback(\n (text: string) => {\n if (!text) return;\n fullTextRef.current += text;\n setIsFinished(false);\n startTypewriter();\n },\n [startTypewriter],\n );\n\n const stopTypewriter = useCallback(() => {\n if (typeRAFRef.current !== null) {\n cancelAnimationFrame(typeRAFRef.current);\n typeRAFRef.current = null;\n lastTimestampRef.current = null;\n }\n }, []);\n\n const finishTypewriter = useCallback(() => {\n stopTypewriter();\n setDisplayedText(fullTextRef.current);\n renderedLengthRef.current = fullTextRef.current.length;\n setIsFinished(true);\n }, [stopTypewriter]);\n\n return {\n displayedText,\n appendText,\n stopTypewriter,\n finishTypewriter,\n isFinished,\n };\n};\n","import { useEffect, useRef, useCallback } from \"react\";\n\ninterface UseStreamingTextOptions {\n eventSource?: EventSource;\n onTextChunk?: (chunk: string) => void;\n onError?: () => void;\n onDone?: () => void;\n}\n\nexport const useStreamingText = ({ eventSource, onTextChunk, onError, onDone }: UseStreamingTextOptions) => {\n const bufferRef = useRef<string>(\"\");\n const flushRAFRef = useRef<number | null>(null);\n\n const onTextChunkRef = useRef<typeof onTextChunk>(null);\n const onErrorRef = useRef<typeof onError>(null);\n const onDoneRef = useRef<typeof onDone>(null);\n onTextChunkRef.current = onTextChunk;\n onErrorRef.current = onError;\n onDoneRef.current = onDone;\n\n const flushBuffer = useCallback(() => {\n flushRAFRef.current = null;\n if (!bufferRef.current) return;\n\n const chunk = bufferRef.current;\n bufferRef.current = \"\";\n onTextChunkRef.current?.(chunk);\n }, []);\n\n const finish = useCallback(() => {\n if (flushRAFRef.current !== null) {\n cancelAnimationFrame(flushRAFRef.current);\n flushRAFRef.current = null;\n }\n flushBuffer();\n onDoneRef.current?.();\n }, [flushBuffer]);\n\n const handleMessage = useCallback(\n (event: MessageEvent) => {\n // OpenAI Chat Completions terminator\n if (event.data === \"[DONE]\") {\n finish();\n return;\n }\n\n try {\n const parsed = JSON.parse(event.data);\n\n // Chat Completions streaming delta\n const piece =\n parsed?.choices?.[0]?.delta?.content ??\n // fallback: support simple formats too\n (typeof parsed === \"string\" ? parsed : (parsed?.text ?? \"\"));\n\n // Some servers send a final frame with finish_reason\n const finishReason = parsed?.choices?.[0]?.finish_reason;\n\n if (piece) {\n bufferRef.current += piece;\n if (flushRAFRef.current === null) {\n flushRAFRef.current = requestAnimationFrame(flushBuffer);\n }\n }\n\n if (finishReason === \"stop\") {\n finish();\n }\n } catch (error) {\n console.error(\"Error parsing SSE message:\", error, event.data);\n onErrorRef.current?.();\n }\n },\n [flushBuffer, finish],\n );\n\n const handleError = useCallback(() => {\n onErrorRef.current?.();\n\n if (flushRAFRef.current !== null) {\n cancelAnimationFrame(flushRAFRef.current);\n flushRAFRef.current = null;\n }\n\n flushBuffer();\n }, [flushBuffer]);\n\n useEffect(() => {\n if (typeof window === \"undefined\" || !eventSource) return;\n\n eventSource.addEventListener(\"message\", handleMessage);\n eventSource.addEventListener(\"error\", handleError);\n\n return () => {\n eventSource.removeEventListener(\"message\", handleMessage);\n eventSource.removeEventListener(\"error\", handleError);\n\n if (flushRAFRef.current !== null) {\n cancelAnimationFrame(flushRAFRef.current);\n flushRAFRef.current = null;\n }\n\n flushBuffer();\n };\n }, [eventSource, handleMessage, handleError, flushBuffer]);\n};\n","import { RefObject, useContext, useLayoutEffect } from \"react\";\nimport { WidgetWindowRootContext } from \"../../../../renderer/widget-windowing\";\n\n/**\n * Fade a freshly-delivered assistant reply's rendered block elements in, one after another, instead of\n * popping the whole wall of text in at once. The reveal operates on the DOM blocks the markdown renderer\n * already produces (the direct children of the `[data-markdown-blocks-root]` div that is containerRef's\n * DIRECT child — nested Markdown instances rendered by widgets stamp the same attribute deeper\n * down and must not be picked up) — the markdown string is never split, so code fences, tables, nested\n * lists, and widgets are handled uniformly.\n *\n * - Blocks in view on arrival (tested against the FULL viewport, edge to edge): a quick staggered fade-in\n * (STAGGER_STEP_MS apart, capped at STAGGER_CAP_MS; each block fades over the faster INITIAL_FADE_MS set\n * inline) — the visible screen fills with text down to the bottom edge fast, no hidden band at the bottom.\n * - Blocks below the fold: a single, calmer fade at the CSS default duration the FIRST time any pixel of\n * them enters the scroll root — never replayed, never reversed on scroll-up.\n * - VISIBILITY DEADLINE: whatever the observers did or did not see, every block still hidden\n * VISIBILITY_DEADLINE_MS after the reply arrived becomes plainly visible (no fade) and the observers are\n * dropped. Delivered text must never depend on a scroll event to become readable.\n *\n * Invariants:\n * - Opacity + transform only, never display/visibility/height — hidden blocks keep their final layout space\n * from the first frame, so the pin/reserve machinery in ConversationViewBody sees stable heights and Cmd+F /\n * selection / a11y still find the pending text.\n * - Only fresh static replies animate (the caller gates via `enabled`); streaming is excluded upstream.\n * - Once per message id: a re-render / windowing pass / navigate-away-and-back never replays it.\n * - A block can never be stuck hidden: hiding happens in the same synchronous useLayoutEffect that creates\n * the observer; the deadline and the cleanup both finalize every still-hidden block to visible. (A\n * \"-15% into the viewport\" trigger left the reply's closing question invisible while the pinned-question\n * policy never scrolled — the owner saw the question only after their next send. Hence zero margin AND the\n * deadline.)\n */\n\nconst STAGGER_STEP_MS = 90;\nconst STAGGER_CAP_MS = 720;\n// The initial screen-fill batch fades each block faster than the CSS default (900ms) so the first screen\n// populates snappily; blocks scrolled into view later keep the calmer default fade untouched.\nconst INITIAL_FADE_MS = 550;\n// Scroll-reveal trigger — below-the-fold blocks ONLY (the initial batch tests against the full viewport).\n// Zero margin: a block reveals the moment any pixel of it is inside the scroll root. (A negative bottom\n// margin — \"reveal once the top is 15% up into the viewport\" — left a block whose top sat in that bottom band\n// hidden for good when nothing scrolled; a percentage margin is even measured against the root's WIDTH.)\nconst SCROLL_REVEAL_ROOT_MARGIN = \"0px\";\n// Hard upper bound on hiding: after this, every still-hidden block is made visible without animation.\nexport const VISIBILITY_DEADLINE_MS = 2500;\n\n// Module-scoped so the guard survives unmount/remount of ConversationMessageWidgets (Redux re-render, widget\n// windowing, navigate-away-and-back within the session) — the same one-shot pattern as\n// reloadReopenMessageIdRef in ConversationMessageList.\nconst alreadyRevealedMessageIds = new Set<string | number>();\n\nexport const useFreshMessageBlockReveal = (options: {\n /**\n * The rendered-message container — ConversationMessageWidgets's existing renderedRef. Its DIRECT child must be\n * the reply's own `[data-markdown-blocks-root]` div (ConversationMarkdown renders exactly one Markdown,\n * whose context provider adds no DOM node); the hook queries only that direct child.\n */\n containerRef: RefObject<HTMLDivElement | null>;\n /** fresh && message != null — static fresh assistant replies only. */\n enabled: boolean;\n /** Once-only guard key; when null/undefined the reply animates but is not recorded. */\n messageId?: string | number | null;\n}): void => {\n const { containerRef, enabled, messageId } = options;\n const scrollRoot = useContext(WidgetWindowRootContext);\n\n useLayoutEffect(() => {\n if (!enabled) return;\n if (messageId != null && alreadyRevealedMessageIds.has(messageId)) return;\n if (typeof IntersectionObserver === \"undefined\") return;\n if (window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches) return;\n // Markdown rendered outside the chat scroll container (drawer/canvas hosts render their own Markdown\n // instances) has no scroll root and must never inherit the reveal.\n if (scrollRoot == null) return;\n\n // Direct child ONLY (`:scope >`): the shared Markdown component stamps `data-markdown-blocks-root` on\n // every instance, and a widget inside the reply can render its own nested Markdown (e.g.\n // WebSearchAnswer). The reply's own blocks root is always renderedRef's direct child — ConversationMarkdown\n // renders a context provider (no DOM node) around exactly one Markdown — so a descendant query could\n // conflate roots, while the direct-child query can only match the outer one.\n const blocksRoot = containerRef.current?.querySelector(\":scope > [data-markdown-blocks-root]\");\n if (blocksRoot == null) return;\n\n const blocks = Array.from(blocksRoot.children) as HTMLElement[];\n if (blocks.length === 0) return;\n\n for (const block of blocks) block.dataset.blockReveal = \"hidden\";\n if (messageId != null) alreadyRevealedMessageIds.add(messageId);\n\n // The one idempotent end state: observers gone, every still-hidden block plainly visible (the hook's\n // attribute and inline overrides removed — assigning \"revealed\" would start another 900ms fade), blocks\n // already revealed keep their finished state. Reached by the deadline, by cleanup, or by an observer\n // setup failure; queued observer callbacks after it are no-ops.\n let finalized = false;\n let scrollRevealObserver: IntersectionObserver | null = null;\n let initialViewportObserver: IntersectionObserver | null = null;\n const finalize = () => {\n if (finalized) return;\n finalized = true;\n initialViewportObserver?.disconnect();\n scrollRevealObserver?.disconnect();\n for (const block of blocks) {\n if (block.dataset.blockReveal === \"hidden\") {\n delete block.dataset.blockReveal;\n block.style.animationDelay = \"\";\n block.style.animationDuration = \"\";\n }\n }\n };\n const deadline = window.setTimeout(finalize, VISIBILITY_DEADLINE_MS);\n\n // Below-the-fold blocks reveal the first time any pixel of them enters the scroll root — single fade, no delay.\n scrollRevealObserver = new IntersectionObserver(\n (entries, observer) => {\n if (finalized) return;\n for (const entry of entries) {\n if (!entry.isIntersecting) continue;\n (entry.target as HTMLElement).dataset.blockReveal = \"revealed\";\n observer.unobserve(entry.target);\n }\n },\n { root: scrollRoot, rootMargin: SCROLL_REVEAL_ROOT_MARGIN, threshold: 0 },\n );\n\n // The initial pass fires exactly once, right after observe(), with every block's intersection state\n // against the FULL viewport (no trigger margin): everything visible — under the pinned question, down\n // to the bottom edge — reveals staggered, so the first screen is completely filled with text. The\n // blocks below the fold are handed to scrollRevealObserver.\n initialViewportObserver = new IntersectionObserver(\n (entries, observer) => {\n if (finalized) return;\n let staggerIndex = 0;\n for (const entry of entries) {\n const block = entry.target as HTMLElement;\n if (entry.isIntersecting) {\n block.style.animationDelay = `${Math.min(staggerIndex * STAGGER_STEP_MS, STAGGER_CAP_MS)}ms`;\n block.style.animationDuration = `${INITIAL_FADE_MS}ms`;\n staggerIndex++;\n block.dataset.blockReveal = \"revealed\";\n } else {\n scrollRevealObserver?.observe(block);\n }\n }\n observer.disconnect();\n },\n { root: scrollRoot, threshold: 0 },\n );\n\n for (const block of blocks) initialViewportObserver.observe(block);\n\n return () => {\n window.clearTimeout(deadline);\n finalize();\n };\n }, [enabled, messageId, scrollRoot, containerRef]);\n};\n","import { Icon, Text } from \"../../../../provider/components\";\nimport type { ChatAssistantCategory, ChatAssistantIdentity } from \"../../../chat-assistant-identity\";\nimport React, { memo } from \"react\";\nimport styles from \"./ConversationMessageHeader.module.scss\";\n\nexport interface ConversationMessageHeaderProps {\n aiPromptExtensionCategory?: ChatAssistantCategory;\n aiPromptExtension?: ChatAssistantIdentity;\n}\n\nexport const ConversationMessageHeader = memo((props: ConversationMessageHeaderProps) => {\n const { aiPromptExtensionCategory, aiPromptExtension } = props;\n\n // The extension's icon class is an icon of the app's icon set.\n const iconName = aiPromptExtension?.iconClass ?? \"ai\";\n\n return (\n <div className={styles.responseHeader}>\n <span className={styles.iconContainer}>\n <Icon color=\"var(--agents-fg-on-accent)\" hostIconName={iconName} />\n </span>\n <div>\n <Text role=\"help\" weight=\"bold\">\n {aiPromptExtension?.name ?? \"AI Extensions\"}\n </Text>\n {aiPromptExtensionCategory !== undefined ? (\n <Text role=\"caption\" replacements={{ productName: aiPromptExtensionCategory?.name }}>\n %productName% Assistant\n </Text>\n ) : null}\n {aiPromptExtensionCategory === undefined ? (\n <Text role=\"caption\">Assistant</Text>\n ) : null}\n </div>\n </div>\n );\n});\n","export async function copyRichToClipboard(plainText: string, html: string) {\n if (!plainText) {\n console.warn(\"No text to copy\");\n return;\n }\n\n if (!navigator.clipboard) {\n console.warn(\"Clipboard API not available\");\n return;\n }\n\n if (!(html && typeof ClipboardItem !== \"undefined\" && navigator.clipboard.write)) {\n console.warn(\"Clipboard does not support rich text, copying plain text only\");\n return navigator.clipboard.writeText(plainText);\n }\n try {\n const item = new ClipboardItem({\n \"text/plain\": new Blob([plainText], { type: \"text/plain\" }),\n \"text/html\": new Blob([html], { type: \"text/html\" }),\n });\n return navigator.clipboard.write([item]);\n } catch (error) {\n console.error(\"Failed to copy rich text to clipboard:\", error);\n return navigator.clipboard.writeText(plainText);\n }\n}\n","import { Button } from \"../../../provider/components\";\nimport type { ChatAssistantCategory, ChatAssistantIdentity } from \"../../chat-assistant-identity\";\nimport React, { memo, useCallback, useEffect, useRef, useState } from \"react\";\nimport styles from \"./ConversationMessageWidgets.module.scss\";\nimport { useTypewriter } from \"./hooks/useTypewriter\";\nimport { useStreamingText } from \"./hooks/useStreamingText\";\nimport { useFreshMessageBlockReveal } from \"./hooks/useFreshMessageBlockReveal\";\nimport { ConversationMessageHeader } from \"./ConversationMessageHeader/ConversationMessageHeader\";\nimport { ConversationMarkdown } from \"../../../renderer/ConversationMarkdown\";\nimport { copyRichToClipboard } from \"./copyRichToClipboard\";\nimport { normalizeServerMessageToMarkdown } from \"../../normalize-server-message-to-markdown\";\nimport { stripPreCallMessageMarker } from \"../../strip-pre-call-message-marker\";\nimport { useAgentsEnvironment } from \"../../../provider/AgentsProvider\";\n\nexport interface ConversationMessageWidgetsProps {\n aiPromptExtensionCategory?: ChatAssistantCategory;\n aiPromptExtension?: ChatAssistantIdentity;\n eventSource?: EventSource;\n message?: unknown;\n /**\n * The reply's widgets may be used (buttons, forms, hydration refresh): a live-delivered reply, and the newest reply\n * after a reload. Forwarded to every widget as `interactive` (+ the deprecated alias `fresh`).\n */\n interactive?: boolean;\n /**\n * The reply was delivered live right now — never after a reload. Forwarded to every widget as `justDelivered`, the\n * only gate for one-shot side effects (canvas open, draft creation), and the gate of the block reveal.\n */\n justDelivered?: boolean;\n hideWidgets?: boolean;\n /** Id of the host message: once-only guard of the block reveal, and the identity of a canvas opened from it. */\n messageId?: string | number | null;\n /**\n * Hide the assistant header (icon + name + \"Assistant\") and the copy button.\n * Used by a host, which renders bare assistant messages.\n */\n hideAssistantMeta?: boolean;\n /** Opt-in staggered fade-in of this fresh reply's markdown blocks (see useFreshMessageBlockReveal). Default off. */\n enableFreshMessageBlockReveal?: boolean;\n}\n\nexport const ConversationMessageWidgets = memo((props: ConversationMessageWidgetsProps) => {\n const {\n aiPromptExtensionCategory,\n aiPromptExtension,\n eventSource,\n message,\n interactive = false,\n justDelivered = false,\n hideWidgets = false,\n hideAssistantMeta = false,\n enableFreshMessageBlockReveal = false,\n messageId,\n } = props;\n const { MessageFooter } = useAgentsEnvironment();\n\n const [copied, setCopied] = useState(false);\n const timeoutRef = useRef<number | null>(null);\n const renderedRef = useRef<HTMLDivElement | null>(null);\n\n const { displayedText, appendText, finishTypewriter } = useTypewriter({\n speed: 200,\n commitIntervalMs: 100,\n });\n\n useEffect(() => {\n return () => {\n if (timeoutRef.current != null) window.clearTimeout(timeoutRef.current);\n };\n }, []);\n\n // Only stream when no static message is provided\n useStreamingText({\n eventSource: message != null ? undefined : eventSource,\n onTextChunk: appendText,\n onError: finishTypewriter,\n onDone: finishTypewriter,\n });\n\n // If a message is provided, render it directly; otherwise render streamed text\n // Static message → normalize (already strips the {preCallMessage} sentinel); live stream → strip it here too.\n const textToRender =\n message != null ? normalizeServerMessageToMarkdown(message) : stripPreCallMessageMarker(displayedText);\n\n // (The former \"a fresh widget message closes the open canvas\" layout effect is gone: a canvas is superseded only\n // by another canvas being opened — and a pinned canvas survives a widget reply.)\n\n // Fade the just-delivered reply's rendered blocks in (staggered in view, once on scroll below the fold). Static\n // live-delivered assistant replies only — never after a reload, and the streaming path (message == null) renders\n // progressively already.\n useFreshMessageBlockReveal({\n containerRef: renderedRef,\n enabled: enableFreshMessageBlockReveal && justDelivered && message != null,\n messageId,\n });\n\n const onCopy = useCallback(async () => {\n const fallbackText = textToRender || \"\";\n const plain = renderedRef.current?.innerText?.trim() || fallbackText;\n const html = renderedRef.current?.innerHTML || \"\";\n\n await copyRichToClipboard(plain, html);\n\n setCopied(true);\n if (timeoutRef.current != null) window.clearTimeout(timeoutRef.current);\n timeoutRef.current = window.setTimeout(() => setCopied(false), 2000);\n }, [textToRender]);\n\n return (\n <div className={styles.responseContainer}>\n {!hideAssistantMeta ? (\n <ConversationMessageHeader\n aiPromptExtensionCategory={aiPromptExtensionCategory}\n aiPromptExtension={aiPromptExtension}\n />\n ) : null}\n <div className={styles.responseMessage}>\n <div ref={renderedRef}>\n {/* TODO: move the markdown component into the component library */}\n <ConversationMarkdown\n markdown={textToRender}\n interactive={interactive}\n justDelivered={justDelivered}\n messageId={messageId ?? undefined}\n hideWidgets={hideWidgets}\n />\n </div>\n\n {!hideAssistantMeta ? (\n <Button\n variant=\"muted\"\n icon={copied ? \"check\" : \"duplicate\"}\n onClick={onCopy}\n size=\"small\"\n />\n ) : null}\n </div>\n\n {/* The app's footer under the message (for example an admin-only trace footer that gates itself). */}\n {MessageFooter ? <MessageFooter message={message} /> : null}\n </div>\n );\n});\n","import styles from \"./VoiceBarsIcon.module.scss\";\n\nexport interface VoiceBarsIconProps {\n /** Edge length in px; the bars take the current text colour. */\n size?: number;\n}\n\n/**\n * Five sound bars, the tallest in the middle — the mark of an in-app voice call with the agent.\n */\nexport const VoiceBarsIcon = (props: VoiceBarsIconProps) => {\n const { size = 18 } = props;\n return (\n <svg className={styles.icon} width={size} height={size} viewBox=\"0 0 24 24\" aria-hidden focusable=\"false\">\n <path d=\"M3.5 10.5v3M7.75 8v8M12 4.5v15M16.25 8v8M20.5 10.5v3\" />\n </svg>\n );\n};\n"],"names":["message","styles"],"mappings":";;;;;;AA4BA,MAAM,uBAAuB;AAc7B,MAAM,0BAA0B,CAAC,SAAwC;AACvE,QAAM,QAAQ,qBAAqB,KAAK,IAAI;AAC5C,MAAI,CAAC,MAAO,QAAO;AACnB,QAAM,SAAS,MAAM,CAAC;AACtB,QAAM,OAAO,OAAO,CAAC;AACrB,QAAM,OAAO,MAAM,CAAC,EAAE,KAAA;AACtB,MAAI,SAAS,OAAO,KAAK,SAAS,GAAG,EAAG,QAAO;AAC/C,SAAO,EAAE,MAAM,QAAQ,OAAO,QAAQ,KAAA;AACxC;AAEA,MAAM,oBAAoB,CAAC,SAA0B,IAAI,OAAO,IAAI,iBAAiB,KAAK,EAAE,KAAK,KAAK,KAAA,CAAM;AAG5G,MAAM,sBAAsB,MAAc,IAAI,OAAO,eAAe,oBAAoB,KAAK;AAK7F,MAAM,WAAW,CAAC,MAAc,cAA8D;AAC5F,QAAM,eAAe,KAAK,QAAQ,MAAM,SAAS;AACjD,QAAM,UAAU,iBAAiB,KAAK,KAAK,SAAS;AACpD,QAAM,YAAY,iBAAiB,KAAK,KAAK,SAAS,eAAe;AACrE,QAAM,aAAa,KAAK,MAAM,WAAW,OAAO;AAChD,SAAO,EAAE,SAAS,WAAW,SAAS,IAAI,IAAI,WAAW,MAAM,GAAG,EAAE,IAAI,YAAY,UAAA;AACtF;AAOA,MAAM,sBAAsB,CAAC,MAAc,WAAmB,WAAmC;AAC/F,MAAI,SAAS;AACb,SAAO,SAAS,KAAK,QAAQ;AAC3B,UAAM,EAAE,SAAS,UAAA,IAAc,SAAS,MAAM,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