@connekz/connekz-agent 2.2.1 → 2.3.2

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/CHANGELOG.md CHANGED
@@ -1,3 +1,37 @@
1
+ ## [2.3.2] - 2026-07-14 (Patch Release)
2
+
3
+ ### Added
4
+
5
+ ### Changed
6
+
7
+ ### Fixed
8
+
9
+ ### Security
10
+
11
+ ## [2.3.1] - 2026-07-14 (Patch Release)
12
+
13
+ ### Added
14
+
15
+ ### Changed
16
+
17
+ ### Fixed
18
+
19
+ ### Security
20
+
21
+ ## [2.3.0] - 2026-07-14 (Minor Release)
22
+
23
+ ### Added
24
+
25
+ - `connekzAgent.getConversation()` — returns the full conversation history for the current thread as a chronological `ConnekzConversationMessage[]` (`{ id?, role: 'user' | 'ai' | 'system', message, at }`). Includes BOTH voice and text turns, seeded from the server thread history and kept live. Intended to be called inside an `onToolCall` handler (e.g. when a booking tool fires) to capture the transcript and forward it to your own backend.
26
+ - `connekzAgent.getThreadId()` — returns the current chat thread id (or `null` before a thread is established) for correlating a captured transcript with the server-side thread.
27
+ - New exported type `ConnekzConversationMessage`.
28
+
29
+ ### Changed
30
+
31
+ ### Fixed
32
+
33
+ ### Security
34
+
1
35
  ## [2.2.1] - 2026-07-10 (Patch Release)
2
36
 
3
37
  ### Added
package/README.md CHANGED
@@ -83,6 +83,33 @@ to clean up resources and unmount components.
83
83
  connekzAgent.stopCaptureTest(); // Stop audio capture test
84
84
  connekzAgent.playCapturedAudio(); // Playback captured audio test
85
85
  ````
86
+ - Conversation History:
87
+ ````typescript
88
+ // Full conversation for the current thread — both voice AND text turns,
89
+ // seeded from server history and kept live. Chronological snapshot.
90
+ const history = connekzAgent.getConversation();
91
+ // -> ConnekzConversationMessage[]: { id?, role: 'user' | 'ai' | 'system', message, at }[]
92
+
93
+ // Current chat thread id (null before a thread is established).
94
+ const threadId = connekzAgent.getThreadId();
95
+ ````
96
+ Typical use — capture the transcript when a tool fires (e.g. a booking) and
97
+ forward it to your own backend:
98
+ ````typescript
99
+ connekzAgent.subscribe.onToolCall(async (tool) => {
100
+ if (tool.name === 'book_meeting') {
101
+ const transcript = connekzAgent.getConversation();
102
+ const threadId = connekzAgent.getThreadId();
103
+ await fetch('/api/bookings', {
104
+ method: 'POST',
105
+ headers: { 'Content-Type': 'application/json' },
106
+ body: JSON.stringify({ booking: tool.arguments, threadId, transcript }),
107
+ });
108
+ return 'Booking captured';
109
+ }
110
+ return 'Unknown tool';
111
+ });
112
+ ````
86
113
 
87
114
  ## Subscriptions
88
115
  Subscribe to events for realtime updates: