@mgamadeus/ddd-agents 0.1.5 → 0.1.6

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 (37) hide show
  1. package/dist/chat.js +99 -120
  2. package/dist/chat.js.map +1 -1
  3. package/dist/chunks/{ConversationMessageInputComposerWidgets-BbpB0fZl.js → ConversationMessageInputComposerWidgets-Brm9t2n7.js} +4 -2
  4. package/dist/chunks/{ConversationMessageInputComposerWidgets-BbpB0fZl.js.map → ConversationMessageInputComposerWidgets-Brm9t2n7.js.map} +1 -1
  5. package/dist/chunks/WebSearchResultsConversationWidget-BXt98hGu.js.map +1 -1
  6. package/dist/chunks/canvas-behaviours-BpN_1xdZ.js.map +1 -1
  7. package/dist/chunks/{widget-click-signal-sources-cjIjjftL.js → canvas-title-slot-context-DV9gzj3u.js} +98 -10
  8. package/dist/chunks/canvas-title-slot-context-DV9gzj3u.js.map +1 -0
  9. package/dist/chunks/{canvasBodies-C_pdv17v.js → canvasBodies-DXQI9l9v.js} +2 -2
  10. package/dist/chunks/{canvasBodies-C_pdv17v.js.map → canvasBodies-DXQI9l9v.js.map} +1 -1
  11. package/dist/chunks/{widget-name-resolver-7WnzCpdG.js → widget-name-resolver-2_qV5T39.js} +9 -9
  12. package/dist/chunks/{widget-name-resolver-7WnzCpdG.js.map → widget-name-resolver-2_qV5T39.js.map} +1 -1
  13. package/dist/client-testing.js +2 -2
  14. package/dist/files/i18n-keys.json +9 -0
  15. package/dist/image-render.js +2 -2
  16. package/dist/index.js +2 -2
  17. package/dist/kit.js +1 -1
  18. package/dist/preview.js +3 -3
  19. package/dist/renderer.js +28 -23
  20. package/dist/styles.css +43 -14
  21. package/dist/types/chat/ConversationMessageInput/ConversationMessageInput.d.ts +26 -4
  22. package/dist/types/chat/ConversationMessageInput/ConversationMessageInputAttachments/ConversationMessageInputAttachmentPreviewWidget.d.ts +6 -3
  23. package/dist/types/chat/ConversationView.d.ts +9 -0
  24. package/dist/types/chat/ConversationViewBody/ConversationViewBody.d.ts +12 -0
  25. package/dist/types/chat/controller/AgentChatController.d.ts +19 -1
  26. package/dist/types/chat/conversation-send-message.d.ts +2 -2
  27. package/dist/types/entries/chat.d.ts +1 -1
  28. package/dist/types/entries/renderer.d.ts +4 -0
  29. package/dist/types/renderer/ConversationWidgetCallbacksContext.d.ts +7 -0
  30. package/dist/types/renderer/canvas/canvas-behaviours.d.ts +5 -0
  31. package/dist/types/renderer/canvas/canvas-title-slot-context.d.ts +6 -0
  32. package/dist/types/renderer/composer-library-file.d.ts +12 -0
  33. package/dist/types/renderer/composer-widget-fence.d.ts +4 -4
  34. package/dist/types/renderer/conversationWidgetRegistry.d.ts +12 -0
  35. package/package.json +1 -1
  36. package/public-api.json +10 -0
  37. 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;
@@ -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
@@ -5858,6 +5858,28 @@ thead + tbody .agents_row_VBlQR-:first-child {
5858
5858
  .agents_compact_ZBtAbD > * {
5859
5859
  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
5860
  }
5861
+ .agents_compact_ZBtAbD.agents_compactStacked_XxL484 {
5862
+ flex-wrap: wrap;
5863
+ gap: 0 0.5rem;
5864
+ }
5865
+ .agents_compact_ZBtAbD.agents_compactStacked_XxL484 .agents_actions_IOFQ5W {
5866
+ height: 2.5rem;
5867
+ }
5868
+ .agents_compact_ZBtAbD.agents_compactWithActionsStart_WXtqy0 {
5869
+ padding-left: 0.5rem;
5870
+ }
5871
+ .agents_compact_ZBtAbD .agents_compactTopSlot_x57yOL {
5872
+ flex: 0 0 100%;
5873
+ min-width: 0;
5874
+ }
5875
+ .agents_compact_ZBtAbD .agents_compactActionsStart_3SeY5C {
5876
+ display: flex;
5877
+ flex-shrink: 0;
5878
+ align-items: center;
5879
+ max-width: 2.5rem;
5880
+ height: 2.5rem;
5881
+ max-height: 2.5rem;
5882
+ }
5861
5883
  .agents_compact_ZBtAbD .agents_editableInput_bxHt-e {
5862
5884
  flex: 1;
5863
5885
  align-self: center;
@@ -6240,6 +6262,15 @@ thead + tbody .agents_row_VBlQR-:first-child {
6240
6262
  word-break: break-word;
6241
6263
  }
6242
6264
 
6265
+ .agents_messageWithWidgetsAboveBubble_bWTYWp {
6266
+ display: flex;
6267
+ flex-direction: column;
6268
+ align-items: flex-end;
6269
+ gap: 0.5rem;
6270
+ align-self: flex-end;
6271
+ max-width: min(37.5rem, 100%);
6272
+ }
6273
+
6243
6274
  .agents_whiteBubble_4-I21V {
6244
6275
  background-color: var(--agents-bg, white);
6245
6276
  }
@@ -6575,6 +6606,14 @@ thead + tbody .agents_row_VBlQR-:first-child {
6575
6606
  margin-bottom: 0.5rem;
6576
6607
  }
6577
6608
 
6609
+ .agents_titleSlot_ZFjpZe {
6610
+ flex: 1 1 auto;
6611
+ min-width: 0;
6612
+ display: flex;
6613
+ align-items: center;
6614
+ margin-right: auto;
6615
+ }
6616
+
6578
6617
  .agents_rootBoxed_WyFSTZ:not(.agents_rootFullBleedContent_-D9E-y) .agents_closeButtonRow_Ra3aXk {
6579
6618
  margin-bottom: 0;
6580
6619
  }
@@ -6946,8 +6985,8 @@ thead + tbody .agents_row_VBlQR-:first-child {
6946
6985
 
6947
6986
  .agents_strip_1KGkcV {
6948
6987
  display: flex;
6949
- gap: 1.25rem;
6950
- padding: 1rem 1rem 0.5rem 0;
6988
+ gap: 0.5rem;
6989
+ padding: 0 0 0.5rem;
6951
6990
  overflow-x: auto;
6952
6991
  }.agents_card_8HbjAG {
6953
6992
  position: relative;
@@ -7003,17 +7042,7 @@ thead + tbody .agents_row_VBlQR-:first-child {
7003
7042
 
7004
7043
  .agents_removeButtonHolder_Ik959X {
7005
7044
  position: absolute;
7006
- top: 0;
7007
- right: 0;
7008
- transform: translate(40%, -40%);
7045
+ top: 0.25rem;
7046
+ right: 0.25rem;
7009
7047
  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
7048
  }
@@ -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
@@ -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.
@@ -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`.
@@ -1,6 +1,8 @@
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 { ConversationComposerWidget } from "../../renderer/conversation-composer-widget";
5
+ import type { ComposerLibraryFile } from "../../renderer/composer-library-file";
4
6
  import type { AgentsChatStore } from "../store/create-agents-chat-store";
5
7
  import { type AgentChatActivityTiming, type ResolvedAgentChatActivityTiming } from "./chat-activity-timing";
6
8
  import type { ChatScrollTarget } from "./chat-scroll-target";
@@ -30,6 +32,8 @@ export interface AgentChatComposerHandle {
30
32
  * nothing while the composer is not shown (a closed conversation).
31
33
  */
32
34
  setComposerDraft: (text: string) => void;
35
+ /** Focuses the composer, the caret at the end of its draft (e.g. after files were dropped on the chat). */
36
+ focusComposer?: () => void;
33
37
  }
34
38
  /** Where the model of the next send comes from — read at send time (an admin's pick can change between renders). */
35
39
  export interface AgentChatSendModelSource {
@@ -72,6 +76,13 @@ export interface AgentChatControllerProps {
72
76
  sendModelSource?: AgentChatSendModelSource;
73
77
  /** Called after a send that carried attachments, so the host clears them from the composer. */
74
78
  onAttachmentsSent?: () => void;
79
+ /**
80
+ * Called after an accepted send that carried composer widgets (the widget context's and `hostComposerWidgets`), with
81
+ * those widgets — the host clears the ones it owns.
82
+ */
83
+ onComposerWidgetsSent?: (composerWidgets: ConversationComposerWidget[]) => void;
84
+ /** Widget callback: put media-library files into the composer (a file library canvas's "Use in chat"). */
85
+ attachLibraryFilesToComposer?: (libraryFiles: ComposerLibraryFile[]) => void;
75
86
  /** The empty state of a new chat: a synthetic first assistant message (client state only), as markdown. */
76
87
  startingIdeasMarkdown?: string;
77
88
  /** While true the chat follows the bottom; a rising edge jumps to the newest message (a voice chat). */
@@ -83,9 +94,14 @@ export interface AgentChatControllerProps {
83
94
  /** Class names of the two wrappers around the conversation view (the host's layout). */
84
95
  chatAreaClassName?: string;
85
96
  chatWrapClassName?: string;
97
+ /** Further props of the chat area element (e.g. a host's file drop zone handlers). */
98
+ chatAreaProps?: Omit<HTMLAttributes<HTMLDivElement>, "className" | "ref">;
86
99
  /** Slots of the conversation view. */
87
100
  progressStepperSlot?: ReactNode;
101
+ /** The host's layer while files are dragged over the window (see `ConversationViewBody`'s `fileDropHintSlot`). */
102
+ fileDropHintSlot?: ReactNode;
88
103
  inputActionsSlot?: ReactNode;
104
+ inputActionsSlotStart?: ReactNode;
89
105
  inputTopSlot?: ReactNode;
90
106
  inputSendDisabled?: boolean;
91
107
  inputReplacementSlot?: ReactNode;
@@ -97,6 +113,8 @@ export interface AgentChatControllerProps {
97
113
  isQuestionPinSuspended?: boolean;
98
114
  /** The attachments that ride along on the next send. */
99
115
  outgoingAttachments?: ConversationAttachmentReference[];
116
+ /** Composer widgets the host holds outside the widget context, sent with the next send (see `ConversationMessageInput`). */
117
+ hostComposerWidgets?: ConversationComposerWidget[];
100
118
  /** The agent's activity at the tail of the thread (the agent avatar slot). */
101
119
  ThinkingIndicator: ComponentType<AgentChatActivityProps>;
102
120
  /** A layer over the message column (a voice chat's focus mode); shown while `isContentOverlayShown`. */
@@ -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
  /**
@@ -32,7 +32,7 @@ export { ConversationMessageUser, type ConversationMessageUserProps, type Conver
32
32
  export { ConversationMessageWidgets, type ConversationMessageWidgetsProps, } from "../chat/ConversationMessage/ConversationMessageWidgets/ConversationMessageWidgets";
33
33
  export { ConversationMessageSystem, type ConversationMessageSystemProps, } from "../chat/ConversationMessage/ConversationMessageSystem/ConversationMessageSystem";
34
34
  export { ConversationMessageInput, MAX_MESSAGE_LENGTH, type ConversationMessageInputHandle, type ConversationMessageInputProps, } from "../chat/ConversationMessageInput/ConversationMessageInput";
35
- export type { ConversationMessageInputAttachmentPreview, ConversationMessageInputAttachmentUploadStatus, } from "../chat/ConversationMessageInput/ConversationMessageInputAttachments/ConversationMessageInputAttachmentPreviewWidget";
35
+ export { ConversationMessageInputAttachmentPreviewWidget, type ConversationMessageInputAttachmentPreview, type ConversationMessageInputAttachmentPreviewWidgetProps, type ConversationMessageInputAttachmentUploadStatus, } from "../chat/ConversationMessageInput/ConversationMessageInputAttachments/ConversationMessageInputAttachmentPreviewWidget";
36
36
  export type { AssistantServerMessagePayload } from "../chat/normalize-server-message-to-markdown";
37
37
  export { useActivityTicker, SUCCESS_BEAT_MS } from "../chat/controller/use-activity-ticker";
38
38
  export { type AgentChatActivityTiming, type ResolvedAgentChatActivityTiming, DEFAULT_AGENT_CHAT_ACTIVITY_TIMING, resolveAgentChatActivityTiming, } from "../chat/controller/chat-activity-timing";
@@ -11,6 +11,10 @@ export * from "../renderer/render-report/widget-render-report";
11
11
  export * from "../renderer/widget-hydration";
12
12
  export { unregisterWidgetHydrator } from "../renderer/widget-hydration/widget-hydration.registry";
13
13
  export * from "../renderer/canvas/canvas-behaviours";
14
+ export { CanvasTitleSlotContext, useCanvasTitleSlot } from "../renderer/canvas/canvas-title-slot-context";
15
+ export type { ComposerLibraryFile } from "../renderer/composer-library-file";
16
+ export type { ConversationComposerWidget } from "../renderer/conversation-composer-widget";
17
+ export { buildComposerWidgetFenceBlock, buildMessageTextWithComposerWidgets, splitComposerWidgetFencesFromMessageText, type SplitComposerWidgetFencesResult, } from "../renderer/composer-widget-fence";
14
18
  export * from "../renderer/canvas/canvas-state";
15
19
  export { canvasBodies, canvasFeatureFlagOf, type CanvasBodyProps } from "../renderer/canvas/canvasBodies";
16
20
  export { readOpenEntityActionTarget, type OpenEntityActionTarget, } from "../renderer/canvas/entity-detail-instance";
@@ -1,5 +1,6 @@
1
1
  import { ReactNode } from "react";
2
2
  import { ConversationComposerWidget } from "./conversation-composer-widget";
3
+ import type { ComposerLibraryFile } from "./composer-library-file";
3
4
  import { CanvasOpenRequest, CanvasState, LastClosedCanvas } from "./canvas/canvas-state";
4
5
  import type { CanvasCreatedEntity } from "./canvas/canvas-reducers";
5
6
  /** A message of the transcript a widget reads (its id and author role, its type and text); the chat's messages carry more. */
@@ -131,6 +132,12 @@ export interface ConversationWidgetCallbacks {
131
132
  * message. No-op by default; hosts that own a chat input wire it to that input's imperative handle.
132
133
  */
133
134
  prefillComposer: (text: string) => void;
135
+ /**
136
+ * Put files that are already in the project's media library into the composer as attachments, without uploading
137
+ * them again (a file library canvas's "Use in chat"). Set only by a host whose composer holds attachments; a canvas
138
+ * offers no "Use in chat" where it is undefined.
139
+ */
140
+ attachLibraryFilesToComposer?: (libraryFiles: ComposerLibraryFile[]) => void;
134
141
  /**
135
142
  * Inject a model-visible / user-invisible SIGNAL into the CURRENT conversation and drive one agent turn. Unlike
136
143
  * `sendMessageToChat` (which posts a visible USER message), this does NOT render a chat bubble — it tells the agent
@@ -55,6 +55,11 @@ export interface CanvasBehaviour {
55
55
  * content.
56
56
  */
57
57
  readonly overlayCloseButton?: boolean;
58
+ /**
59
+ * The body's title sits in the close button's row instead of in a row of its own below it: the body portals it into
60
+ * the pane's title slot (`useCanvasTitleSlot`). Default false: the row holds the button alone.
61
+ */
62
+ readonly titleBesideCloseButton?: boolean;
58
63
  }
59
64
  /** Width of the canvas pane (% of the split) when a behaviour declares none. */
60
65
  export declare const DEFAULT_CANVAS_WIDTH_PERCENT = 50;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * The place beside the canvas pane's close button, for a canvas whose behaviour declares `titleBesideCloseButton`:
3
+ * its body portals its title there. Null outside a canvas pane and for every other canvas.
4
+ */
5
+ export declare const CanvasTitleSlotContext: import("react").Context<HTMLElement | null>;
6
+ export declare const useCanvasTitleSlot: () => HTMLElement | null;
@@ -0,0 +1,12 @@
1
+ /** A file that is already in the project's media library, put into the chat composer without uploading it again. */
2
+ export interface ComposerLibraryFile {
3
+ /** The library's file id the agent's media tools address the file by. */
4
+ fileId: string;
5
+ fileName: string;
6
+ mimeType: string;
7
+ sizeBytes?: number;
8
+ /** A small picture of the file for its card in the composer; documents have none. */
9
+ thumbnailUrl?: string;
10
+ /** A URL the agent can fetch the file from; absent when the library gives none. */
11
+ publicUrl?: string;
12
+ }
@@ -22,9 +22,9 @@ export interface SplitComposerWidgetFencesResult {
22
22
  /**
23
23
  * The inverse of {@link buildMessageTextWithComposerWidgets}. Extracts every ```widget fence in `text` whose `type`
24
24
  * resolves (canonical or legacy `Directive` form, see `widget-name-resolver.ts`) to a registered widget that
25
- * declares a `composerComponent` — the only fences a user bubble renders as a read-only widget instead of leaving as
26
- * text. Every other fence — prose, and fences for widgets WITHOUT a `composerComponent` — is left in `text`
27
- * verbatim. Never throws: an unterminated fence, malformed JSON, or an unresolved/non-composable `type` just leaves
28
- * that fence untouched.
25
+ * declares a `composerComponent` or `sentInCustomerMessage` — the only fences a user bubble renders as a read-only
26
+ * widget instead of leaving as text. Every other fence — prose, and fences for widgets the customer's message never
27
+ * carries — is left in `text` verbatim. Never throws: an unterminated fence, malformed JSON, or an
28
+ * unresolved/non-customer `type` just leaves that fence untouched.
29
29
  */
30
30
  export declare const splitComposerWidgetFencesFromMessageText: (text: string) => SplitComposerWidgetFencesResult;
@@ -41,6 +41,18 @@ export interface ConversationWidgetEntry {
41
41
  * removes the whole widget.
42
42
  */
43
43
  removeLastPartFromComposerWidgetFields?: (fields: Record<string, unknown>) => Record<string, unknown> | null;
44
+ /**
45
+ * The customer's OWN message may carry this widget's fence: the user bubble extracts it
46
+ * (`splitComposerWidgetFencesFromMessageText`) and renders `component` above the prose. For an input widget whose
47
+ * input UI is not a `composerComponent` (an app's upload strip, e.g. its attached-files echo). `composerComponent` implies it.
48
+ */
49
+ sentInCustomerMessage?: boolean;
50
+ /**
51
+ * Where the customer's message shows this widget's echo: `insideBubble` (default) above the prose inside the
52
+ * coloured bubble, or `aboveBubble` on its own, right-aligned above the bubble (the attached images) — a message that
53
+ * is nothing but such widgets shows no bubble at all.
54
+ */
55
+ customerMessagePlacement?: "insideBubble" | "aboveBubble";
44
56
  }
45
57
  /** The entries of a set of registration modules (`*.widget-registration.ts` files an app or the package globbed). */
46
58
  export declare const readConversationWidgetRegistrations: (registrationModules: Record<string, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mgamadeus/ddd-agents",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "The web frontend of the ddd-agents module: the agent chat, the widget renderer and the composed-view kit.",
5
5
  "keywords": [
6
6
  "ddd",