@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 +34 -0
- package/README.md +27 -0
- package/dist/connekz-agent.es.js +416 -403
- package/dist/connekz-agent.umd.js +9 -9
- package/package.json +1 -1
- package/types.d.ts +26 -0
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@connekz/connekz-agent",
|
|
3
3
|
"private": false,
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "2.2
|
|
5
|
+
"version": "2.3.2",
|
|
6
6
|
"description": "A package for Connekz clients to integrate Connekz Agent into their applications.",
|
|
7
7
|
"main": "./dist/connekz-agent.umd.js",
|
|
8
8
|
"module": "./dist/connekz-agent.es.js",
|
package/types.d.ts
CHANGED
|
@@ -28,6 +28,17 @@ export type ConnekzTranscript = {
|
|
|
28
28
|
forcedDisplay?: boolean; // Whether force to display this message
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
/**
|
|
32
|
+
* A single message in the full conversation history returned by
|
|
33
|
+
* `connekzAgent.getConversation()`. Covers both voice and text turns.
|
|
34
|
+
*/
|
|
35
|
+
export type ConnekzConversationMessage = {
|
|
36
|
+
id?: string; // Server message id (absent for not-yet-persisted local messages)
|
|
37
|
+
role: 'user' | 'ai' | 'system';
|
|
38
|
+
message: string;
|
|
39
|
+
at: string; // ISO date string (message createdAt)
|
|
40
|
+
}
|
|
41
|
+
|
|
31
42
|
// Export types for consumers of the package
|
|
32
43
|
export type ConnekzOptions = {
|
|
33
44
|
clientId: string; // Client ID for the connekz instance
|
|
@@ -122,6 +133,21 @@ export interface VoiceAgentAPI {
|
|
|
122
133
|
stopCaptureTest: () => void;
|
|
123
134
|
playCapturedAudio: () => void;
|
|
124
135
|
toggleMic: () => void;
|
|
136
|
+
/**
|
|
137
|
+
* Returns the full conversation history for the current thread as a
|
|
138
|
+
* chronological snapshot (ascending by time). Includes BOTH voice and text
|
|
139
|
+
* turns — seeded from the server thread history and kept live as new messages
|
|
140
|
+
* arrive. Returns an empty array before any conversation exists.
|
|
141
|
+
*
|
|
142
|
+
* Typical use: call this inside an `onToolCall` handler (e.g. when a booking
|
|
143
|
+
* tool fires) to capture the transcript and forward it to your own backend.
|
|
144
|
+
*/
|
|
145
|
+
getConversation: () => ConnekzConversationMessage[];
|
|
146
|
+
/**
|
|
147
|
+
* Returns the current chat thread id, or null before a thread is established.
|
|
148
|
+
* Useful for correlating a captured transcript with the server-side thread.
|
|
149
|
+
*/
|
|
150
|
+
getThreadId: () => string | null;
|
|
125
151
|
subscribe: AgentSubscribeAPI;
|
|
126
152
|
}
|
|
127
153
|
|