@mgamadeus/ddd-agents 0.1.0-alpha.30 → 0.1.0-alpha.32

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.
@@ -12,22 +12,27 @@ description: Renders the result of searchConversations (cross-chat semantic reca
12
12
  Shows the matches from `searchConversations` grouped by conversation — reuses the same `AgentSearchResults` view the chat's own search panel uses. Each group is a card: conversation title (or "Untitled chat") · relative date, then its matched message rows (You / the agent + excerpt, query terms highlighted), with an arrow to open that conversation. Few groups render inline; many open in the canvas side panel.
13
13
 
14
14
  ## Data structure — DATA-COMPLETE (no re-fetch)
15
- **Unlike a self-hydrating widget, this widget does NOT fetch anything.** It renders entirely from the payload. The agent copies the `query` and the grouped results from the `searchConversations` tool output straight into the payload — the search is never re-run.
15
+ **Unlike a self-hydrating widget, this widget does NOT fetch anything.** It renders entirely from the payload. The agent names the search's tool call in `groupsFromToolCallId`; the platform writes that call's `groups` (and the `query`, when the block's is empty) into the block when the message is stored — the search is never re-run, and the agent never copies the groups.
16
16
  ```ts
17
17
  interface ConversationSearchResultsPayload {
18
18
  query: string; // the search query, used to highlight matched terms
19
19
  title?: string; // short LLM headline (user's language) shown on the collapsed canvas card; falls back to the query
20
20
  display?: "inline" | "canvas"; // OPTIONAL — normally OMIT; the widget auto-picks inline (few) vs canvas (many)
21
+ groupsFromToolCallId?: string; // written by the agent INSTEAD of `groups`: the id of the search's tool call; the platform fills `groups` from its stored result
21
22
  groups: {
22
23
  conversationId?: number; // the source chat (the open-arrow target)
23
24
  title?: string; // the chat's title
24
25
  summary?: string; // the chat's summary recap (shown under the title)
25
26
  dateTime?: string; // "Y-m-d H:i:s" of the most-recent matched message
26
27
  hits: { role?: string; excerpt?: string; dateTime?: string; indexInConversation?: number; messageId?: number }[];
27
- }[]; // dateTime per hit = that message's timestamp (shown on the row)
28
+ }[]; // filled by the platform (see above); what the widget renders — dateTime per hit = that message's timestamp (shown on the row)
28
29
  }
29
30
  ```
30
- Just copy the `groups` from the `searchConversations` result verbatim (title · summary · dateTime · hits with their per-message dateTime are all in it). Concrete payload example:
31
+ What the agent writes:
32
+ ```json
33
+ { "type": "ConversationSearchResults", "query": "facebook", "groupsFromToolCallId": "<id of the search's tool call>" }
34
+ ```
35
+ What the widget receives after the platform filled it:
31
36
  ```json
32
37
  {
33
38
  "query": "facebook",
@@ -41,7 +46,7 @@ Just copy the `groups` from the `searchConversations` result verbatim (title ·
41
46
  ```
42
47
 
43
48
  ## When to use
44
- - After calling `searchConversations` — render the matches as this widget instead of re-listing them in prose.
49
+ - After a search across earlier conversations — write the block with `groupsFromToolCallId` instead of re-listing the matches in prose.
45
50
  - Few matches → they render inline; many → they open in the canvas side panel automatically (or set `display`).
46
51
  - Skip for a single in-conversation recall (`recallConversation`) — that's the current chat, answer inline in prose.
47
52
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mgamadeus/ddd-agents",
3
- "version": "0.1.0-alpha.30",
3
+ "version": "0.1.0-alpha.32",
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",