@mgamadeus/ddd-agents 0.1.5 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.md +4 -0
  2. package/dist/chat.js +135 -126
  3. package/dist/chat.js.map +1 -1
  4. package/dist/chunks/{ConversationMessageInputComposerWidgets-BbpB0fZl.js → ConversationMessageInputComposerWidgets-Brm9t2n7.js} +4 -2
  5. package/dist/chunks/{ConversationMessageInputComposerWidgets-BbpB0fZl.js.map → ConversationMessageInputComposerWidgets-Brm9t2n7.js.map} +1 -1
  6. package/dist/chunks/WebSearchResultsConversationWidget-BXt98hGu.js.map +1 -1
  7. package/dist/chunks/canvas-behaviours-BpN_1xdZ.js.map +1 -1
  8. package/dist/chunks/{widget-click-signal-sources-cjIjjftL.js → canvas-title-slot-context-DV9gzj3u.js} +98 -10
  9. package/dist/chunks/canvas-title-slot-context-DV9gzj3u.js.map +1 -0
  10. package/dist/chunks/{canvasBodies-C_pdv17v.js → canvasBodies-DXQI9l9v.js} +2 -2
  11. package/dist/chunks/{canvasBodies-C_pdv17v.js.map → canvasBodies-DXQI9l9v.js.map} +1 -1
  12. package/dist/chunks/{widget-name-resolver-7WnzCpdG.js → widget-name-resolver-2_qV5T39.js} +9 -9
  13. package/dist/chunks/{widget-name-resolver-7WnzCpdG.js.map → widget-name-resolver-2_qV5T39.js.map} +1 -1
  14. package/dist/client-testing.js +2 -2
  15. package/dist/files/chat/Conversation.module.scss +19 -0
  16. package/dist/files/i18n-keys.json +9 -0
  17. package/dist/image-render.js +2 -2
  18. package/dist/index.js +2 -2
  19. package/dist/kit.js +1 -1
  20. package/dist/preview.js +3 -3
  21. package/dist/renderer.js +28 -23
  22. package/dist/styles.css +62 -15
  23. package/dist/types/chat/ConversationMessageInput/ConversationMessageInput.d.ts +26 -4
  24. package/dist/types/chat/ConversationMessageInput/ConversationMessageInputAttachments/ConversationMessageInputAttachmentPreviewWidget.d.ts +6 -3
  25. package/dist/types/chat/ConversationMessageList/ConversationMessageList.d.ts +6 -1
  26. package/dist/types/chat/ConversationView.d.ts +11 -0
  27. package/dist/types/chat/ConversationViewBody/ConversationViewBody.d.ts +14 -0
  28. package/dist/types/chat/controller/AgentChatController.d.ts +46 -2
  29. package/dist/types/chat/conversation-send-message.d.ts +2 -2
  30. package/dist/types/entries/chat.d.ts +3 -3
  31. package/dist/types/entries/renderer.d.ts +4 -0
  32. package/dist/types/renderer/ConversationWidgetCallbacksContext.d.ts +7 -0
  33. package/dist/types/renderer/canvas/canvas-behaviours.d.ts +5 -0
  34. package/dist/types/renderer/canvas/canvas-title-slot-context.d.ts +6 -0
  35. package/dist/types/renderer/composer-library-file.d.ts +12 -0
  36. package/dist/types/renderer/composer-widget-fence.d.ts +4 -4
  37. package/dist/types/renderer/conversationWidgetRegistry.d.ts +12 -0
  38. package/package.json +1 -1
  39. package/public-api.json +12 -0
  40. package/dist/chunks/widget-click-signal-sources-cjIjjftL.js.map +0 -1
@@ -2,8 +2,8 @@
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
4
  import { l as listWidgetHydratorTypes, g as getWidgetHydrator, b as registerWidgetHydrator, c as abandonWidgetHydrationReads, u as unregisterWidgetHydrator } from "./chunks/WebSearchResultsConversationWidget-BXt98hGu.js";
5
- import { j as conversationWidgetRegistry, k as replaceConversationWidgetRegistryEntries } from "./chunks/widget-name-resolver-7WnzCpdG.js";
6
- import { l, s } from "./chunks/widget-name-resolver-7WnzCpdG.js";
5
+ import { j as conversationWidgetRegistry, k as replaceConversationWidgetRegistryEntries } from "./chunks/widget-name-resolver-2_qV5T39.js";
6
+ import { l, s } from "./chunks/widget-name-resolver-2_qV5T39.js";
7
7
  import { c, r, s as s2 } from "./chunks/canvasStorage-DHNluopA.js";
8
8
  const DEFAULT_SCRIPTED_ASSISTANT_ANSWER = "Done.";
9
9
  const DEFAULT_PAGE_SIZE = 50;
@@ -266,3 +266,22 @@
266
266
  }
267
267
  }
268
268
  }
269
+
270
+ // `renderAssistantAvatar`: the host's avatar left of an assistant message, at its top; the message keeps the rest of
271
+ // the row.
272
+ .assistantMessageWithAvatar {
273
+ display: flex;
274
+ align-items: flex-start;
275
+ gap: $x1;
276
+ min-width: 0;
277
+ }
278
+
279
+ .assistantAvatar {
280
+ flex: 0 0 auto;
281
+ display: flex;
282
+ }
283
+
284
+ .assistantMessageBesideAvatar {
285
+ flex: 1 1 auto;
286
+ min-width: 0;
287
+ }
@@ -795,6 +795,15 @@
795
795
  "src/widgets/WritingDraftConversationWidget/WritingDraftWidget/WritingDraftWidget.tsx"
796
796
  ]
797
797
  },
798
+ {
799
+ "key": "Remove file",
800
+ "defaultText": "Remove file",
801
+ "placeholders": [],
802
+ "contexts": [],
803
+ "usedIn": [
804
+ "src/chat/ConversationMessageInput/ConversationMessageInputAttachments/ConversationMessageInputAttachmentPreviewWidget.tsx"
805
+ ]
806
+ },
798
807
  {
799
808
  "key": "Reply draft",
800
809
  "defaultText": "Reply draft",
@@ -1,8 +1,8 @@
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-7WnzCpdG.js";
5
- import { H } from "./chunks/widget-name-resolver-7WnzCpdG.js";
4
+ import { G as resolveWidgetName, j as conversationWidgetRegistry } from "./chunks/widget-name-resolver-2_qV5T39.js";
5
+ import { H } from "./chunks/widget-name-resolver-2_qV5T39.js";
6
6
  import { i as ConversationWidgetRenderContext, K as WidgetImageReadinessContext, R as ReadOnlyConversationWidgetProvider, N as WidgetImageRenderContext, O as WidgetImageLiveHydrationContext, j as buildWidgetAgentSpaceKeyProps } from "./chunks/WebSearchResultsConversationWidget-BXt98hGu.js";
7
7
  import { P, Q, T } from "./chunks/WebSearchResultsConversationWidget-BXt98hGu.js";
8
8
  import { r as readWidgetImageReadiness, p as publishWidgetImageReadiness } from "./chunks/widget-image-readiness-signal-C5yaKpJJ.js";
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import { h, i } from "./chunks/widget-name-resolver-7WnzCpdG.js";
3
- import { g, r, a, b } from "./chunks/canvasBodies-C_pdv17v.js";
2
+ import { h, i } from "./chunks/widget-name-resolver-2_qV5T39.js";
3
+ import { g, r, a, b } from "./chunks/canvasBodies-DXQI9l9v.js";
4
4
  import { r as r2 } from "./chunks/canvas-feature-flags-BmmxC3bz.js";
5
5
  import { r as r3, a as a2, b as b2 } from "./chunks/WebSearchResultsConversationWidget-BXt98hGu.js";
6
6
  import { A, i as i2 } from "./chunks/icon-names-Di6c4zLo.js";
package/dist/kit.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { A, C, a, b, c, d, e, E, r, f, u, g } from "./chunks/widget-name-resolver-7WnzCpdG.js";
2
+ import { A, C, a, b, c, d, e, E, r, f, u, g } from "./chunks/widget-name-resolver-2_qV5T39.js";
3
3
  import { M } from "./chunks/WebSearchResultsConversationWidget-BXt98hGu.js";
4
4
  import { E as E2, u as u2 } from "./chunks/entity-detail-name-3A82gDAp.js";
5
5
  export {
package/dist/preview.js CHANGED
@@ -2,14 +2,14 @@
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { s as Text, Y as getWidgetSelfHydrationKeyFieldName, e as DEFAULT_WIDGET_SELF_HYDRATION_KEY_FIELD_NAME, V as getSandboxLegacyAliases } from "./chunks/link-navigation-DyTApNeA.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-7WnzCpdG.js";
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-2_qV5T39.js";
6
6
  import { X as WidgetSurface, A as readWidgetAgentSpaceKeyAttribute, W as WidgetRenderReportContext, j as buildWidgetAgentSpaceKeyProps, S as StandaloneConversationWidgetProvider, i as ConversationWidgetRenderContext, N as WidgetImageRenderContext, _ as CANVAS_VIABLE_MIN_WIDTH, l as listWidgetHydratorTypes, g as getWidgetHydrator, u as unregisterWidgetHydrator, b as registerWidgetHydrator } from "./chunks/WebSearchResultsConversationWidget-BXt98hGu.js";
7
- import { c as canvasBodies, E as EntityMentionAskButton } from "./chunks/canvasBodies-C_pdv17v.js";
7
+ import { c as canvasBodies, E as EntityMentionAskButton } from "./chunks/canvasBodies-DXQI9l9v.js";
8
8
  import { c as canvasBehaviourOf } from "./chunks/canvas-behaviours-BpN_1xdZ.js";
9
9
  import { f as decideCanvasOpen } from "./chunks/canvas-reducers-CuX6L1zg.js";
10
10
  import { p as publishWidgetImageReadiness } from "./chunks/widget-image-readiness-signal-C5yaKpJJ.js";
11
11
  import axios from "axios";
12
- import { C as ConversationWidgetProvider, a as ConversationMessageInputComposerWidgets } from "./chunks/ConversationMessageInputComposerWidgets-BbpB0fZl.js";
12
+ import { C as ConversationWidgetProvider, a as ConversationMessageInputComposerWidgets } from "./chunks/ConversationMessageInputComposerWidgets-Brm9t2n7.js";
13
13
  const page$1 = "agents_page_5VMDeD";
14
14
  const chatColumn = "agents_chatColumn_FWcgdJ";
15
15
  const widget = "agents_widget_3qpgMy";
package/dist/renderer.js CHANGED
@@ -1,17 +1,17 @@
1
1
  "use client";
2
- import { C, a, M, W, b, d, g, i, p, r } from "./chunks/widget-click-signal-sources-cjIjjftL.js";
3
- import { m as findWidgetFenceByPayloadHash, n as findWidgetFencesInMarkdown } from "./chunks/widget-name-resolver-7WnzCpdG.js";
4
- import { o, p as p2, q, t, v, w, j, x, y, z, B, D, F, G } from "./chunks/widget-name-resolver-7WnzCpdG.js";
2
+ import { C, a, b, M, W, c, d, e, f, g, i, p, r, s, u } from "./chunks/canvas-title-slot-context-DV9gzj3u.js";
3
+ import { m as findWidgetFenceByPayloadHash, n as findWidgetFencesInMarkdown } from "./chunks/widget-name-resolver-2_qV5T39.js";
4
+ import { o, p as p2, q, t, v, w, j, x, y, z, B, D, F, G } from "./chunks/widget-name-resolver-2_qV5T39.js";
5
5
  import { d as useResolvedConversationWidgetAgentSpaceKey, p as payloadHashOfInstanceId } from "./chunks/WebSearchResultsConversationWidget-BXt98hGu.js";
6
- import { C as C2, e, f, h, i as i2, L, R, S, W as W2, j as j2, k, m, n, o as o2, q as q2, t as t2, v as v2, g as g2, w as w2, x as x2, y as y2, z as z2, A, b as b2, B as B2, s, D as D2, u, E, F as F2, G as G2, H, I, J } from "./chunks/WebSearchResultsConversationWidget-BXt98hGu.js";
7
- import { C as C3, a as a2, b as b3, d as d2, D as D3, c, e as e2, g as g3, i as i3, p as p3 } from "./chunks/canvas-behaviours-BpN_1xdZ.js";
8
- import { c as c2, u as u2 } from "./chunks/canvasBodies-C_pdv17v.js";
6
+ import { C as C2, e as e2, f as f2, h, i as i2, L, R, S, W as W2, j as j2, k, m, n, o as o2, q as q2, t as t2, v as v2, g as g2, w as w2, x as x2, y as y2, z as z2, A, b as b2, B as B2, s as s2, D as D2, u as u2, E, F as F2, G as G2, H, I, J } from "./chunks/WebSearchResultsConversationWidget-BXt98hGu.js";
7
+ import { C as C3, a as a2, b as b3, d as d2, D as D3, c as c2, e as e3, g as g3, i as i3, p as p3 } from "./chunks/canvas-behaviours-BpN_1xdZ.js";
8
+ import { c as c3, u as u3 } from "./chunks/canvasBodies-DXQI9l9v.js";
9
9
  import { jsxs, jsx } from "react/jsx-runtime";
10
10
  import { n as Skeleton } from "./chunks/link-navigation-DyTApNeA.js";
11
11
  import { ac, ad, ae, af, ag } from "./chunks/link-navigation-DyTApNeA.js";
12
12
  import { useMemo } from "react";
13
- import { a as a3, b as b4, c as c3, d as d3, e as e3 } from "./chunks/canvas-reducers-CuX6L1zg.js";
14
- import { c as c4 } from "./chunks/canvas-feature-flags-BmmxC3bz.js";
13
+ import { a as a3, b as b4, c as c4, d as d3, e as e4 } from "./chunks/canvas-reducers-CuX6L1zg.js";
14
+ import { c as c5 } from "./chunks/canvas-feature-flags-BmmxC3bz.js";
15
15
  const pickSection = (payloadValue, fallback) => {
16
16
  return payloadValue ?? fallback.data ?? void 0;
17
17
  };
@@ -102,15 +102,16 @@ export {
102
102
  a2 as CANVAS_FILLS_SCREEN_WIDTH_PERCENT,
103
103
  b3 as CANVAS_MIN_WIDTH_PX,
104
104
  d2 as CHAT_COLUMN_MIN_WIDTH_PX,
105
- C as ConversationMarkdown,
105
+ C as CanvasTitleSlotContext,
106
+ a as ConversationMarkdown,
106
107
  C2 as ConversationWidgetActions,
107
- e as ConversationWidgetAgentSpaceFrame,
108
- f as ConversationWidgetAgentSpaceHeader,
108
+ e2 as ConversationWidgetAgentSpaceFrame,
109
+ f2 as ConversationWidgetAgentSpaceHeader,
109
110
  h as ConversationWidgetContext,
110
111
  o as ConversationWidgetErrorBoundary,
111
112
  p2 as ConversationWidgetFeatureGate,
112
113
  ConversationWidgetGateSkeleton,
113
- a as ConversationWidgetHost,
114
+ b as ConversationWidgetHost,
114
115
  i2 as ConversationWidgetRenderContext,
115
116
  D3 as DEFAULT_CANVAS_WIDTH_PERCENT,
116
117
  L as LEGACY_CARD_CLICK_ORIGIN,
@@ -124,26 +125,28 @@ export {
124
125
  q as addComposedNodeSchemaApplicationPart,
125
126
  a3 as applyClearCanvas,
126
127
  b4 as applyCloseCanvas,
127
- c3 as applyOpenCanvas,
128
+ c4 as applyOpenCanvas,
128
129
  d3 as applyResetCanvasForNewTurn,
129
- e3 as applySetCanvasCreatedEntityId,
130
+ e4 as applySetCanvasCreatedEntityId,
131
+ c as buildComposerWidgetFenceBlock,
132
+ d as buildMessageTextWithComposerWidgets,
130
133
  j2 as buildWidgetAgentSpaceKeyProps,
131
- b as buildWidgetRenderReportSignal,
132
- c as canvasBehaviourOf,
133
- c2 as canvasBodies,
134
- c4 as canvasFeatureFlagOf,
134
+ e as buildWidgetRenderReportSignal,
135
+ c2 as canvasBehaviourOf,
136
+ c3 as canvasBodies,
137
+ c5 as canvasFeatureFlagOf,
135
138
  k as canvasInstanceIdForActiveAgentSpace,
136
139
  m as canvasInstanceIdForAgentSpace,
137
140
  n as canvasInstanceIdForEntity,
138
141
  o2 as canvasInstanceIdForMessage,
139
142
  q2 as canvasInstanceIdForMessagePayload,
140
- e2 as canvasWidthPercentOf,
143
+ e3 as canvasWidthPercentOf,
141
144
  t as closestWidgetNames,
142
145
  v as composedNodeSchema,
143
146
  w as composedViewTreeToWire,
144
147
  j as conversationWidgetRegistry,
145
148
  af as createAgentsWidgetHydrationStateStore,
146
- d as deepLinkableWidgetNameForCanvas,
149
+ f as deepLinkableWidgetNameForCanvas,
147
150
  t2 as defaultConversationWidgetCallbacks,
148
151
  v2 as entityIdOfInstanceId,
149
152
  findWidgetFenceByPayloadHash,
@@ -177,13 +180,15 @@ export {
177
180
  r as resolveDeepLinkableWidget,
178
181
  G as resolveWidgetName,
179
182
  B2 as sameCanvasAnchor,
180
- s as sameCanvasIdentity,
183
+ s2 as sameCanvasIdentity,
181
184
  sectionCoversKeys,
182
185
  D2 as shortStringHash,
183
- u as unregisterWidgetHydrator,
186
+ s as splitComposerWidgetFencesFromMessageText,
187
+ u2 as unregisterWidgetHydrator,
184
188
  useAnchorWidgetAgentSpaceKey,
185
189
  useAnchorWidgetFenceAgentSpaceKey,
186
- u2 as useAnchorWidgetPayload,
190
+ u3 as useAnchorWidgetPayload,
191
+ u as useCanvasTitleSlot,
187
192
  useConversationWidgetAgentSpaceFallback,
188
193
  E as useConversationWidgetContext,
189
194
  F2 as useIsEmailWidgetRender,
package/dist/styles.css CHANGED
@@ -5811,7 +5811,8 @@ thead + tbody .agents_row_VBlQR-:first-child {
5811
5811
  gap: 0.5rem;
5812
5812
  padding-top: 0.5rem;
5813
5813
  }
5814
- .agents_actions_IOFQ5W svg path {
5814
+
5815
+ .agents_ownAction_Mcpl9H svg path {
5815
5816
  fill: currentColor;
5816
5817
  }
5817
5818
 
@@ -5858,6 +5859,28 @@ thead + tbody .agents_row_VBlQR-:first-child {
5858
5859
  .agents_compact_ZBtAbD > * {
5859
5860
  transition: opacity 0.2s ease, max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1), max-width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
5860
5861
  }
5862
+ .agents_compact_ZBtAbD.agents_compactStacked_XxL484 {
5863
+ flex-wrap: wrap;
5864
+ gap: 0 0.5rem;
5865
+ }
5866
+ .agents_compact_ZBtAbD.agents_compactStacked_XxL484 .agents_actions_IOFQ5W {
5867
+ height: 2.5rem;
5868
+ }
5869
+ .agents_compact_ZBtAbD.agents_compactWithActionsStart_WXtqy0 {
5870
+ padding-left: 0.5rem;
5871
+ }
5872
+ .agents_compact_ZBtAbD .agents_compactTopSlot_x57yOL {
5873
+ flex: 0 0 100%;
5874
+ min-width: 0;
5875
+ }
5876
+ .agents_compact_ZBtAbD .agents_compactActionsStart_3SeY5C {
5877
+ display: flex;
5878
+ flex-shrink: 0;
5879
+ align-items: center;
5880
+ max-width: 2.5rem;
5881
+ height: 2.5rem;
5882
+ max-height: 2.5rem;
5883
+ }
5861
5884
  .agents_compact_ZBtAbD .agents_editableInput_bxHt-e {
5862
5885
  flex: 1;
5863
5886
  align-self: center;
@@ -6176,6 +6199,23 @@ thead + tbody .agents_row_VBlQR-:first-child {
6176
6199
  height: var(--agents-illustration-width);
6177
6200
  transform: rotate(-4.841deg);
6178
6201
  aspect-ratio: 1;
6202
+ }
6203
+
6204
+ .agents_assistantMessageWithAvatar_apVeK1 {
6205
+ display: flex;
6206
+ align-items: flex-start;
6207
+ gap: 0.5rem;
6208
+ min-width: 0;
6209
+ }
6210
+
6211
+ .agents_assistantAvatar_QDnNOx {
6212
+ flex: 0 0 auto;
6213
+ display: flex;
6214
+ }
6215
+
6216
+ .agents_assistantMessageBesideAvatar_fL4QyP {
6217
+ flex: 1 1 auto;
6218
+ min-width: 0;
6179
6219
  }.agents_avatar_Vlh0Vn {
6180
6220
  --agents-skeleton-radius: 0.25rem;
6181
6221
  width: 2.5rem;
@@ -6240,6 +6280,15 @@ thead + tbody .agents_row_VBlQR-:first-child {
6240
6280
  word-break: break-word;
6241
6281
  }
6242
6282
 
6283
+ .agents_messageWithWidgetsAboveBubble_bWTYWp {
6284
+ display: flex;
6285
+ flex-direction: column;
6286
+ align-items: flex-end;
6287
+ gap: 0.5rem;
6288
+ align-self: flex-end;
6289
+ max-width: min(37.5rem, 100%);
6290
+ }
6291
+
6243
6292
  .agents_whiteBubble_4-I21V {
6244
6293
  background-color: var(--agents-bg, white);
6245
6294
  }
@@ -6575,6 +6624,14 @@ thead + tbody .agents_row_VBlQR-:first-child {
6575
6624
  margin-bottom: 0.5rem;
6576
6625
  }
6577
6626
 
6627
+ .agents_titleSlot_ZFjpZe {
6628
+ flex: 1 1 auto;
6629
+ min-width: 0;
6630
+ display: flex;
6631
+ align-items: center;
6632
+ margin-right: auto;
6633
+ }
6634
+
6578
6635
  .agents_rootBoxed_WyFSTZ:not(.agents_rootFullBleedContent_-D9E-y) .agents_closeButtonRow_Ra3aXk {
6579
6636
  margin-bottom: 0;
6580
6637
  }
@@ -6946,8 +7003,8 @@ thead + tbody .agents_row_VBlQR-:first-child {
6946
7003
 
6947
7004
  .agents_strip_1KGkcV {
6948
7005
  display: flex;
6949
- gap: 1.25rem;
6950
- padding: 1rem 1rem 0.5rem 0;
7006
+ gap: 0.5rem;
7007
+ padding: 0 0 0.5rem;
6951
7008
  overflow-x: auto;
6952
7009
  }.agents_card_8HbjAG {
6953
7010
  position: relative;
@@ -7003,17 +7060,7 @@ thead + tbody .agents_row_VBlQR-:first-child {
7003
7060
 
7004
7061
  .agents_removeButtonHolder_Ik959X {
7005
7062
  position: absolute;
7006
- top: 0;
7007
- right: 0;
7008
- transform: translate(40%, -40%);
7063
+ top: 0.25rem;
7064
+ right: 0.25rem;
7009
7065
  display: flex;
7010
- opacity: 0;
7011
- transition: opacity 150ms ease;
7012
- }
7013
- .agents_removeButtonHolder_Ik959X:focus-within {
7014
- opacity: 1;
7015
- }
7016
-
7017
- .agents_card_8HbjAG:hover .agents_removeButtonHolder_Ik959X {
7018
- opacity: 1;
7019
7066
  }
@@ -18,11 +18,13 @@ export declare const CHARACTER_COUNTER_SHOWN_FROM_LENGTH: number;
18
18
  export interface ConversationMessageInputHandle {
19
19
  /** Replaces the input's text and focuses the caret at the end. */
20
20
  insertTextIntoInput: (text: string) => void;
21
+ /** Focuses the input, the caret at the end of its text (e.g. after files were dropped on the chat). */
22
+ focusInput?: () => void;
21
23
  }
22
24
  export interface ConversationMessageInputProps {
23
25
  /**
24
- * Callback when a message is submitted. `options.attachments` echoes `outgoingAttachmentImages`
25
- * when the host provided any — ConversationMessageInput itself never builds attachments, it only rides them along.
26
+ * Callback when a message is submitted. The text already carries every outgoing composer widget's fence;
27
+ * `options.composerWidgets` lists the same widgets (`outgoingComposerWidgets`, then `hostComposerWidgets`).
26
28
  */
27
29
  onSendMessage?: SendMessageHandler;
28
30
  /**
@@ -42,6 +44,11 @@ export interface ConversationMessageInputProps {
42
44
  * input; the chat keeps the full form.
43
45
  */
44
46
  compact?: boolean;
47
+ /**
48
+ * The compact form only: the top slot takes a row of its own above the text and the start cluster stands left of the
49
+ * text instead of in the action row. Default false: the compact layout keeps both where the full form has them.
50
+ */
51
+ compactStackedSlots?: boolean;
45
52
  /**
46
53
  * Compact only: shrunk to a small glowing pill showing one line, the placeholder or the start of a draft, its buttons
47
54
  * hidden but kept (the agent dashboard while the page is scrolled). The host expands it again on hover, focus or at the
@@ -66,6 +73,12 @@ export interface ConversationMessageInputProps {
66
73
  * Additional CSS classes to apply to the component
67
74
  */
68
75
  className?: string;
76
+ /**
77
+ * Additional CSS classes on the input's own box (the pill in the compact form), inside its glow. A host's decoration
78
+ * drawn over the input (e.g. a host's file-drop ring) gets the input's exact size this way, and its
79
+ * corners from `var(--ai-border-radius)`.
80
+ */
81
+ inputContainerClassName?: string;
69
82
  /**
70
83
  * Extra action controls rendered inside the input's bottom action row, left of the send button —
71
84
  * e.g. the agent model picker pill.
@@ -73,13 +86,15 @@ export interface ConversationMessageInputProps {
73
86
  actionsSlot?: React.ReactNode;
74
87
  /**
75
88
  * Action controls pinned to the LEFT edge of the bottom action row (the `actionsSlot` cluster
76
- * stays right, next to the send button) — e.g. the agent "+" attachments menu.
89
+ * stays right, next to the send button) — e.g. the agent "+" attachments menu. In the compact form with
90
+ * `compactStackedSlots` they stand left of the text, on its row.
77
91
  */
78
92
  actionsSlotStart?: React.ReactNode;
79
93
  /**
80
94
  * Host-owned content rendered above the editable text area, inside the input container —
81
95
  * attachment preview cards, validation error boxes, selection chips. Each injected block owns
82
- * its reveal/collapse animation.
96
+ * its reveal/collapse animation. In the compact form with `compactStackedSlots` it takes a row of its own above the
97
+ * text.
83
98
  */
84
99
  topSlot?: React.ReactNode;
85
100
  /** Shown in place of the send button while there is nothing to send — e.g. the button that starts a voice chat. */
@@ -96,6 +111,13 @@ export interface ConversationMessageInputProps {
96
111
  * on the next send. Owned and cleared by the host; ConversationMessageInput only forwards them.
97
112
  */
98
113
  outgoingAttachmentImages?: ConversationAttachmentReference[];
114
+ /**
115
+ * Composer widgets the HOST holds outside the widget context (e.g. a widget built from the files the host uploaded
116
+ * through its own control), sent exactly like `outgoingComposerWidgets`: their fences follow the
117
+ * context's own in the message text and in `options.composerWidgets`. Owned and cleared by the host; Backspace never
118
+ * touches them.
119
+ */
120
+ hostComposerWidgets?: ConversationComposerWidget[];
99
121
  /**
100
122
  * Composer widgets that ride along on the next send — mirrors `outgoingAttachmentImages`. On send their fences
101
123
  * are appended to the typed text (`buildMessageTextWithComposerWidgets`) and they ride along in `onSendMessage`'s
@@ -17,14 +17,17 @@ export type ConversationMessageInputAttachmentPreview = {
17
17
  };
18
18
  export interface ConversationMessageInputAttachmentPreviewWidgetProps {
19
19
  attachment: ConversationMessageInputAttachmentPreview;
20
- /** The card's ✕ — the host drops the attachment (and discards its in-flight upload result). */
21
- onRemove: () => void;
20
+ /**
21
+ * The card's bin — the host drops the attachment (and discards its in-flight upload result). Omitted → no bin: a
22
+ * read-only card (e.g. a sent message's echo of a non-image file).
23
+ */
24
+ onRemove?: () => void;
22
25
  testId?: string;
23
26
  }
24
27
  /**
25
28
  * One attachment card above the chat input: an image thumbnail (or a generic name/type/size card
26
29
  * for future non-image types), an upload progress bar while the media-library upload runs, a
27
- * failed state, and a ✕ to remove.
30
+ * failed state, and a bin that is always in view to remove it (only when the host passes `onRemove`).
28
31
  *
29
32
  * While uploading, a white caption with a black shadow sits over the image bottom:
30
33
  * "Uploading (45%)..." while bytes are still going out, "Processing..." once all bytes are sent
@@ -57,6 +57,11 @@ interface ConversationMessageListProps {
57
57
  * publishes that gap as `--chat-messages-gap`. Undefined (every other host) renders the rows exactly as before.
58
58
  */
59
59
  renderAfterMessage?: (message: ChatMessage) => React.ReactNode;
60
+ /**
61
+ * Host content beside each shown assistant message (an avatar face, 24–28 px): it stands left of the message, at its
62
+ * top. Undefined (every other host) renders the assistant messages exactly as before.
63
+ */
64
+ renderAssistantAvatar?: (message: ChatMessage) => React.ReactNode;
60
65
  /** The backend refuses every widget signal of a closed conversation, so no widget renders its controls. */
61
66
  isConversationClosed?: boolean;
62
67
  }
@@ -71,5 +76,5 @@ export declare const findUnansweredWidgetMessageId: (messages: ChatMessage[]) =>
71
76
  * widget of the same name. Pure, order-based: the newest widget of a type is the live one.
72
77
  */
73
78
  export declare const findSupersededWidgetMessageIds: (messages: ChatMessage[]) => Set<string | number>;
74
- export declare const ConversationMessageList: ({ className, messages, currentCategory, aiPromptExtension, isDebugMode, aiThinking, thinkingIndicator, hideAssistantMeta, userMessageTheme, error, rateLimitRetryAfterSeconds, onRetryFailedRun, messagesBottomRef, messagesListRef, enableFreshMessageBlockReveal, taskInstructionMessageId, renderAfterMessage, isConversationClosed, }: ConversationMessageListProps) => import("react/jsx-runtime").JSX.Element;
79
+ export declare const ConversationMessageList: ({ className, messages, currentCategory, aiPromptExtension, isDebugMode, aiThinking, thinkingIndicator, hideAssistantMeta, userMessageTheme, error, rateLimitRetryAfterSeconds, onRetryFailedRun, messagesBottomRef, messagesListRef, enableFreshMessageBlockReveal, taskInstructionMessageId, renderAfterMessage, renderAssistantAvatar, isConversationClosed, }: ConversationMessageListProps) => import("react/jsx-runtime").JSX.Element;
75
80
  export {};
@@ -5,6 +5,7 @@ import type { ChatMessage } from "./chat-message";
5
5
  import { ConversationMessageUserTheme } from "./ConversationMessage/ConversationMessageUser/ConversationMessageUser";
6
6
  import { ConversationMessageInputHandle } from "./ConversationMessageInput/ConversationMessageInput";
7
7
  import type { ConversationAttachmentReference } from "../contract/conversation";
8
+ import type { ConversationComposerWidget } from "../renderer/conversation-composer-widget";
8
9
  import { SendMessageHandler } from "./conversation-send-message";
9
10
  export interface ConversationViewProps {
10
11
  currentCategory?: ChatAssistantCategory;
@@ -121,6 +122,8 @@ export interface ConversationViewProps {
121
122
  * boundary is why the host cannot place the strip itself.
122
123
  */
123
124
  progressStepperSlot?: React.ReactNode;
125
+ /** See ConversationViewBody: the host's layer while files are dragged over the window. */
126
+ fileDropHintSlot?: React.ReactNode;
124
127
  /**
125
128
  * Scroll-up older-message pagination (opt-in — forwarded to ConversationViewBody). When `onLoadOlder` is provided, a top
126
129
  * sentinel prefetches the next older page and the viewport is anchored across the prepend. Default off.
@@ -175,6 +178,12 @@ export interface ConversationViewProps {
175
178
  * send. Owned and cleared by the host; ConversationView/ConversationMessageInput only forward them.
176
179
  */
177
180
  outgoingAttachmentImages?: ConversationAttachmentReference[];
181
+ /**
182
+ * Composer widgets the host holds outside the widget context (e.g. a widget built from the files the host
183
+ * uploaded), sent like the context's own on the next send. Owned and cleared by the host;
184
+ * ConversationView/ConversationMessageInput only forward them.
185
+ */
186
+ hostComposerWidgets?: ConversationComposerWidget[];
178
187
  /**
179
188
  * Imperative handle on the chat input (insertTextIntoInput) so host-owned controls — e.g. the
180
189
  * "+" menu's "Generate image" entry — can put text into it.
@@ -208,6 +217,8 @@ export interface ConversationViewProps {
208
217
  * started each turn. Forwarded through ConversationViewBody to ConversationMessageList. Undefined changes nothing.
209
218
  */
210
219
  renderAfterMessage?: (message: ChatMessage) => React.ReactNode;
220
+ /** Host content beside each shown assistant message (an avatar face), forwarded through ConversationViewBody. */
221
+ renderAssistantAvatar?: (message: ChatMessage) => React.ReactNode;
211
222
  /** Forwarded through ConversationViewBody to ConversationMessageList: a closed conversation renders no widget controls. */
212
223
  isConversationClosed?: boolean;
213
224
  onSuggestionClick: (text: string) => void;
@@ -2,6 +2,7 @@ import type { ChatAssistantCategory, ChatAssistantIdentity, ChatAssistantOpening
2
2
  import React from "react";
3
3
  import { ConversationMessageInputHandle } from "../ConversationMessageInput/ConversationMessageInput";
4
4
  import type { ConversationAttachmentReference } from "../../contract/conversation";
5
+ import type { ConversationComposerWidget } from "../../renderer/conversation-composer-widget";
5
6
  import { SendMessageHandler } from "../conversation-send-message";
6
7
  import { ConversationErrorType } from "../store/conversation-error-type";
7
8
  import type { ChatMessage } from "../chat-message";
@@ -64,6 +65,11 @@ export interface ConversationViewProps {
64
65
  * this view contributes nothing but the positioned pane root it is mounted in.
65
66
  */
66
67
  progressStepperSlot?: React.ReactNode;
68
+ /**
69
+ * Host-owned layer shown while files are dragged over the window: this chat takes them. Like `progressStepperSlot`
70
+ * the node positions itself against the pane root; it lies over the messages and under the input.
71
+ */
72
+ fileDropHintSlot?: React.ReactNode;
67
73
  /**
68
74
  * Optional external ref to the scrollable content wrapper. Forwarded so
69
75
  * callers can drive scroll-linked effects (e.g. an animated background
@@ -170,6 +176,12 @@ export interface ConversationViewProps {
170
176
  * send. Owned and cleared by the host; forwarded to ConversationMessageInput.
171
177
  */
172
178
  outgoingAttachmentImages?: ConversationAttachmentReference[];
179
+ /**
180
+ * Composer widgets the host holds outside the widget context (e.g. a widget built from the files the host
181
+ * uploaded), sent like the context's own on the next send. Owned and cleared by the host; forwarded to
182
+ * ConversationMessageInput.
183
+ */
184
+ hostComposerWidgets?: ConversationComposerWidget[];
173
185
  /**
174
186
  * Imperative handle on the chat input (insertTextIntoInput) so host-owned controls — e.g. the
175
187
  * "+" menu's "Generate image" entry — can put text into it. Forwarded to ConversationMessageInput's `apiRef`.
@@ -206,6 +218,8 @@ export interface ConversationViewProps {
206
218
  * activity card under the message that started each turn). Undefined changes nothing.
207
219
  */
208
220
  renderAfterMessage?: (message: ChatMessage) => React.ReactNode;
221
+ /** Host content beside each shown assistant message (an avatar face), forwarded to ConversationMessageList. */
222
+ renderAssistantAvatar?: (message: ChatMessage) => React.ReactNode;
209
223
  /** Forwarded to ConversationMessageList: a closed conversation renders no widget controls. */
210
224
  isConversationClosed?: boolean;
211
225
  onSuggestionClick: (text: string) => void;
@@ -1,6 +1,9 @@
1
- import { type ComponentType, type ReactNode, type Ref, type RefObject } from "react";
1
+ import { type ComponentType, type HTMLAttributes, type ReactNode, type Ref, type RefObject } from "react";
2
2
  import type { AgentsConversationClient } from "../../client/AgentsConversationClient";
3
3
  import { type ConversationAttachmentReference } from "../../contract/conversation";
4
+ import type { ChatMessage } from "../chat-message";
5
+ import type { ConversationComposerWidget } from "../../renderer/conversation-composer-widget";
6
+ import type { ComposerLibraryFile } from "../../renderer/composer-library-file";
4
7
  import type { AgentsChatStore } from "../store/create-agents-chat-store";
5
8
  import { type AgentChatActivityTiming, type ResolvedAgentChatActivityTiming } from "./chat-activity-timing";
6
9
  import type { ChatScrollTarget } from "./chat-scroll-target";
@@ -18,6 +21,19 @@ export interface AgentChatActivityProps {
18
21
  agentSpaceKey: number;
19
22
  /** The chat's resolved activity timing (`activityTiming`, the environment's, the package's), for the component's motion. */
20
23
  activityTiming?: ResolvedAgentChatActivityTiming;
24
+ /** The chat's store, for a component that reads more of the chat's state (`useAgentsChatSelector`). */
25
+ chatStore: AgentsChatStore;
26
+ /**
27
+ * The newest widget-carrying assistant message the owner has not answered yet (no later owner message, no later
28
+ * widget click) — null when there is none ({@link findUnansweredWidgetMessageId}). Whether that widget waits for an
29
+ * answer is the widget class's `AWAITS_OWNER_INPUT` on the server; the wire does not carry it, so a host that tells
30
+ * questions from other widgets checks the widget names of that message itself.
31
+ */
32
+ unansweredWidgetMessageId: string | number | null;
33
+ }
34
+ /** What the host's avatar beside an assistant message gets (`AssistantAvatar`). */
35
+ export interface AgentChatAssistantAvatarProps {
36
+ message: ChatMessage;
21
37
  }
22
38
  /** What the host's activity history under a message gets: the finished turn that message started, if any. */
23
39
  export interface AgentChatActivityHistoryProps {
@@ -30,6 +46,8 @@ export interface AgentChatComposerHandle {
30
46
  * nothing while the composer is not shown (a closed conversation).
31
47
  */
32
48
  setComposerDraft: (text: string) => void;
49
+ /** Focuses the composer, the caret at the end of its draft (e.g. after files were dropped on the chat). */
50
+ focusComposer?: () => void;
33
51
  }
34
52
  /** Where the model of the next send comes from — read at send time (an admin's pick can change between renders). */
35
53
  export interface AgentChatSendModelSource {
@@ -72,6 +90,19 @@ export interface AgentChatControllerProps {
72
90
  sendModelSource?: AgentChatSendModelSource;
73
91
  /** Called after a send that carried attachments, so the host clears them from the composer. */
74
92
  onAttachmentsSent?: () => void;
93
+ /**
94
+ * Called once for every send the chat accepted (typed, a widget's send, the opening request's message), with the
95
+ * text as sent, right when it goes out — e.g. for a host's send animation. A refused send (a closed conversation, a
96
+ * start still in flight) reports nothing.
97
+ */
98
+ onMessageSent?: (messageText: string) => void;
99
+ /**
100
+ * Called after an accepted send that carried composer widgets (the widget context's and `hostComposerWidgets`), with
101
+ * those widgets — the host clears the ones it owns.
102
+ */
103
+ onComposerWidgetsSent?: (composerWidgets: ConversationComposerWidget[]) => void;
104
+ /** Widget callback: put media-library files into the composer (a file library canvas's "Use in chat"). */
105
+ attachLibraryFilesToComposer?: (libraryFiles: ComposerLibraryFile[]) => void;
75
106
  /** The empty state of a new chat: a synthetic first assistant message (client state only), as markdown. */
76
107
  startingIdeasMarkdown?: string;
77
108
  /** While true the chat follows the bottom; a rising edge jumps to the newest message (a voice chat). */
@@ -83,9 +114,14 @@ export interface AgentChatControllerProps {
83
114
  /** Class names of the two wrappers around the conversation view (the host's layout). */
84
115
  chatAreaClassName?: string;
85
116
  chatWrapClassName?: string;
117
+ /** Further props of the chat area element (e.g. a host's file drop zone handlers). */
118
+ chatAreaProps?: Omit<HTMLAttributes<HTMLDivElement>, "className" | "ref">;
86
119
  /** Slots of the conversation view. */
87
120
  progressStepperSlot?: ReactNode;
121
+ /** The host's layer while files are dragged over the window (see `ConversationViewBody`'s `fileDropHintSlot`). */
122
+ fileDropHintSlot?: ReactNode;
88
123
  inputActionsSlot?: ReactNode;
124
+ inputActionsSlotStart?: ReactNode;
89
125
  inputTopSlot?: ReactNode;
90
126
  inputSendDisabled?: boolean;
91
127
  inputReplacementSlot?: ReactNode;
@@ -97,8 +133,16 @@ export interface AgentChatControllerProps {
97
133
  isQuestionPinSuspended?: boolean;
98
134
  /** The attachments that ride along on the next send. */
99
135
  outgoingAttachments?: ConversationAttachmentReference[];
100
- /** The agent's activity at the tail of the thread (the agent avatar slot). */
136
+ /** Composer widgets the host holds outside the widget context, sent with the next send (see `ConversationMessageInput`). */
137
+ hostComposerWidgets?: ConversationComposerWidget[];
138
+ /**
139
+ * The agent's activity at the tail of the thread (the agent avatar slot). Always mounted, also between turns: it is
140
+ * the resting avatar under the last message while `active` and `isAgentWorkingOnTask` are false, and the working one
141
+ * during a turn — one instance, never remounted by a turn's start or end.
142
+ */
101
143
  ThinkingIndicator: ComponentType<AgentChatActivityProps>;
144
+ /** Shown left of each assistant message, at its top (an avatar face, 24–28 px). Undefined: no avatar. */
145
+ AssistantAvatar?: ComponentType<AgentChatAssistantAvatarProps>;
102
146
  /** A layer over the message column (a voice chat's focus mode); shown while `isContentOverlayShown`. */
103
147
  ContentOverlay?: ComponentType<AgentChatActivityProps>;
104
148
  /** The kept activity lines under the message that started a turn (with `keepActivityHistoryAfterAnswer`). */
@@ -20,8 +20,8 @@ export type SendMessageOptions = {
20
20
  /**
21
21
  * Composer widgets sent alongside this message — informational for hosts (the message TEXT is already the
22
22
  * record: `onSendMessage` receives it with each widget's ```widget fence appended, see
23
- * `buildMessageTextWithComposerWidgets`). ConversationMessageInput never builds these — it forwards the
24
- * host-provided `outgoingComposerWidgets`.
23
+ * `buildMessageTextWithComposerWidgets`). ConversationMessageInput never builds these — it forwards the widget
24
+ * context's `outgoingComposerWidgets`, then the host's `hostComposerWidgets`.
25
25
  */
26
26
  composerWidgets?: ConversationComposerWidget[];
27
27
  /**