@connekz/connekz-agent 2.0.0 → 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,69 @@
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
+
35
+ ## [2.2.1] - 2026-07-10 (Patch Release)
36
+
37
+ ### Added
38
+
39
+ ### Changed
40
+
41
+ ### Fixed
42
+
43
+ ### Security
44
+
45
+ ## [2.2.0] - 2026-07-10 (Minor Release)
46
+
47
+ ### Added
48
+
49
+ ### Changed
50
+
51
+ ### Fixed
52
+
53
+ ### Security
54
+
55
+ ## [2.1.0] - 2026-07-10 (Minor Release)
56
+
57
+ ### Added
58
+ - `setSessionTools` declared in the public TypeScript types (`VoiceAgentAPI`) — it was implemented but missing from `types.d.ts`, breaking TypeScript consumers.
59
+ - `setSessionTools` can now be called before the socket connects — the latest slug set is queued and flushed on connection.
60
+ - `session-tools-updated` server confirmation event is now handled (logged at debug level) instead of warning "Unknown event type".
61
+
62
+ ### Fixed
63
+ - Broken type references in `types.d.ts`: `VoiceAgentStatus` → `ConnekzAgentStatus`, `ConnekzConversation` → `ConnekzTranscript`.
64
+ - Removed phantom `makeSleep` from the public types (it was never implemented).
65
+ - Removed the stale `./connekz-agent.css` package export — v2 injects styles at runtime and no CSS file ships in `dist/`. Consumers must remove `import '@connekz/connekz-agent/connekz-agent.css'`.
66
+
1
67
  ## [2.0.0] - 2026-06-23 (Major Release)
2
68
 
3
69
  ### 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:
@@ -104,7 +131,7 @@ const unsubAgentWave = connekzAgent.subscribe.onAgentWaveformUpdate((volume: num
104
131
  console.log('Agent volume:', volume);
105
132
  });
106
133
 
107
- const unsubTranscript = connekzAgent.subscribe.onTranscriptUpdate((transcript: readonly ConnekzConversation[]) => {
134
+ const unsubTranscript = connekzAgent.subscribe.onTranscriptUpdate((transcript: readonly ConnekzTranscript[]) => {
108
135
  console.log('Transcript:', transcript);
109
136
  });
110
137