@axiom-lattice/client-sdk 1.0.13 → 1.0.15

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.
@@ -0,0 +1,294 @@
1
+ import { ApiError, AuthenticationError, NetworkError, } from "./types";
2
+ import { AbstractClient } from "./abstract-client";
3
+ import encoding from "./wechat_lib/encoding.js";
4
+ /**
5
+ * WeChat Mini Program client for interacting with the Axiom Lattice Agent Service API
6
+ */
7
+ export class WeChatClient extends AbstractClient {
8
+ /**
9
+ * Creates a new WeChatClient instance
10
+ * @param config - Configuration options for the client
11
+ */
12
+ constructor(config) {
13
+ super({
14
+ timeout: 300000,
15
+ ...config,
16
+ });
17
+ }
18
+ /**
19
+ * Set tenant ID for multi-tenant environments
20
+ * @param tenantId - Tenant identifier
21
+ */
22
+ setTenantId(tenantId) {
23
+ this.tenantId = tenantId;
24
+ }
25
+ /**
26
+ * Implementation of the abstract makeRequest method for WeChat clients
27
+ * @param url - The URL to make the request to
28
+ * @param options - Request options
29
+ * @returns A promise that resolves to the response data
30
+ */
31
+ async makeRequest(url, options) {
32
+ // Convert method to WeChat's expected type
33
+ const methodStr = options?.method || "GET";
34
+ const method = methodStr;
35
+ // Build full URL with query parameters if provided
36
+ let fullUrl = `${this.config.baseURL}${url}`;
37
+ // Prepare headers
38
+ const headers = {
39
+ "Content-Type": "application/json",
40
+ Authorization: `Bearer ${this.config.apiKey}`,
41
+ ...this.config.headers,
42
+ ...(options?.headers || {}),
43
+ };
44
+ if (this.tenantId) {
45
+ headers["x-tenant-id"] = this.tenantId;
46
+ }
47
+ return this.request({
48
+ url: fullUrl,
49
+ method,
50
+ data: options?.body,
51
+ });
52
+ }
53
+ /**
54
+ * Implementation of the abstract streamRequest method for WeChat clients
55
+ */
56
+ streamRequest(options, onEvent, onComplete, onError) {
57
+ return this.streamRun(options, onEvent, onComplete, onError);
58
+ }
59
+ /**
60
+ * Resume streaming from a known position
61
+ * @param options - Options for resuming the stream
62
+ * @param onEvent - Callback function that receives stream events
63
+ * @param onComplete - Optional callback function called when streaming completes
64
+ * @param onError - Optional callback function called when an error occurs
65
+ * @returns A function that can be called to stop the stream
66
+ */
67
+ resumeStream(options, onEvent, onComplete, onError) {
68
+ // Prepare headers
69
+ const headers = {
70
+ "Content-Type": "application/json",
71
+ Authorization: `Bearer ${this.config.apiKey}`,
72
+ ...this.config.headers,
73
+ };
74
+ if (this.tenantId) {
75
+ headers["x-tenant-id"] = this.tenantId;
76
+ }
77
+ // Create a request task to track and potentially abort the request
78
+ const requestTask = wx.request({
79
+ url: `${this.config.baseURL}/api/resume_stream`,
80
+ method: "POST",
81
+ data: {
82
+ thread_id: options.threadId,
83
+ message_id: options.messageId,
84
+ known_content: options.knownContent,
85
+ poll_interval: options.pollInterval || 100,
86
+ },
87
+ header: headers,
88
+ responseType: "text",
89
+ enableChunked: true,
90
+ success: () => {
91
+ // This will be called when the connection is established
92
+ // Actual data processing happens in the onChunkReceived callback
93
+ },
94
+ fail: (err) => {
95
+ if (onError) {
96
+ onError(new Error(`Resume stream request failed: ${err.errMsg}`));
97
+ }
98
+ },
99
+ complete: () => {
100
+ if (onComplete) {
101
+ onComplete();
102
+ }
103
+ },
104
+ });
105
+ // Set up the chunk received handler
106
+ requestTask.onChunkReceived((res) => {
107
+ if (!res.data)
108
+ return;
109
+ // Process the raw data line by line
110
+ const text = this.decodeUint8Array(res.data);
111
+ const lines = text.split("\n");
112
+ for (const line of lines) {
113
+ if (line.trim().startsWith("data: ")) {
114
+ try {
115
+ const eventData = JSON.parse(line.trim().slice(6));
116
+ onEvent(eventData);
117
+ }
118
+ catch (error) {
119
+ if (onError) {
120
+ onError(error instanceof Error ? error : new Error(String(error)));
121
+ }
122
+ }
123
+ }
124
+ }
125
+ });
126
+ // Return a function to abort the request
127
+ return () => {
128
+ requestTask.abort();
129
+ };
130
+ }
131
+ /**
132
+ * Helper method to make WeChat HTTP requests
133
+ * @private
134
+ */
135
+ async request(options) {
136
+ const { url, method, data } = options;
137
+ // Prepare headers
138
+ const headers = {
139
+ "Content-Type": "application/json",
140
+ Authorization: `Bearer ${this.config.apiKey}`,
141
+ ...this.config.headers,
142
+ };
143
+ if (this.tenantId) {
144
+ headers["x-tenant-id"] = this.tenantId;
145
+ }
146
+ return new Promise((resolve, reject) => {
147
+ wx.request({
148
+ url,
149
+ method,
150
+ data,
151
+ header: headers,
152
+ timeout: this.config.timeout,
153
+ success: (res) => {
154
+ const statusCode = res.statusCode;
155
+ if (statusCode >= 200 && statusCode < 300) {
156
+ resolve(res.data);
157
+ }
158
+ else if (statusCode === 401) {
159
+ reject(new AuthenticationError(res.data?.message || "Authentication failed"));
160
+ }
161
+ else {
162
+ reject(new ApiError(res.data?.message || "API Error", statusCode, res.data));
163
+ }
164
+ },
165
+ fail: (err) => {
166
+ reject(new NetworkError(`Request failed: ${err.errMsg}`));
167
+ },
168
+ });
169
+ });
170
+ }
171
+ /**
172
+ * Stream run results using WeChat's downloadFile API
173
+ * @param options - Options for streaming run results
174
+ * @param onEvent - Callback function that receives stream events
175
+ * @param onComplete - Optional callback function called when streaming completes
176
+ * @param onError - Optional callback function called when an error occurs
177
+ * @returns A function that can be called to stop the stream
178
+ */
179
+ streamRun(options, onEvent, onComplete, onError) {
180
+ // Prepare headers
181
+ const headers = {
182
+ "Content-Type": "application/json",
183
+ Authorization: `Bearer ${this.config.apiKey}`,
184
+ ...this.config.headers,
185
+ };
186
+ if (this.tenantId) {
187
+ headers["x-tenant-id"] = this.tenantId;
188
+ }
189
+ // Get request parameters from the abstract method
190
+ const requestParams = this.buildStreamRequestParams(options);
191
+ // Create a request task to track and potentially abort the request
192
+ const requestTask = wx.request({
193
+ url: `${this.config.baseURL}${requestParams.url}`,
194
+ method: requestParams.method,
195
+ data: requestParams.body,
196
+ header: headers,
197
+ responseType: "text",
198
+ enableChunked: true,
199
+ success: () => {
200
+ // This will be called when the connection is established
201
+ // Actual data processing happens in the onChunkReceived callback
202
+ },
203
+ fail: (err) => {
204
+ if (onError) {
205
+ onError(new Error(`Stream request failed: ${err.errMsg}`));
206
+ }
207
+ },
208
+ complete: async () => {
209
+ if (onComplete) {
210
+ // Fetch agent state before calling onComplete if enabled
211
+ if (options.enableReturnStateWhenSteamCompleted) {
212
+ try {
213
+ const state = await this.getAgentState(options.threadId);
214
+ onComplete(state);
215
+ }
216
+ catch (error) {
217
+ // If getting state fails, still call onComplete without state
218
+ onComplete();
219
+ }
220
+ }
221
+ else {
222
+ // Just call onComplete without state if not enabled
223
+ onComplete();
224
+ }
225
+ }
226
+ },
227
+ });
228
+ // Set up the chunk received handler
229
+ requestTask.onChunkReceived((res) => {
230
+ if (!res.data)
231
+ return;
232
+ // Process the raw data line by line
233
+ const text = this.decodeUint8Array(res.data);
234
+ const lines = text.split("\n");
235
+ for (const line of lines) {
236
+ if (line.trim().startsWith("data: ")) {
237
+ try {
238
+ const eventData = JSON.parse(line.trim().slice(6));
239
+ onEvent(eventData);
240
+ }
241
+ catch (error) {
242
+ if (onError) {
243
+ onError(error instanceof Error ? error : new Error(String(error)));
244
+ }
245
+ }
246
+ }
247
+ }
248
+ });
249
+ // Return a function to abort the request
250
+ return () => {
251
+ requestTask.abort();
252
+ };
253
+ }
254
+ decodeUint8Array(uint8Array) {
255
+ const data16 = this.buf2hex(uint8Array);
256
+ const requestData = this.hexToStr(data16);
257
+ return requestData;
258
+ }
259
+ buf2hex(arrayBuffer) {
260
+ return Array.prototype.map
261
+ .call(new Uint8Array(arrayBuffer), (x) => ("00" + x.toString(16)).slice(-2))
262
+ .join("");
263
+ }
264
+ /**
265
+ * Convert hexadecimal string to text (supports Chinese characters)
266
+ * @param {String} hex - Hexadecimal string
267
+ * @return {String} Decoded string including Chinese characters
268
+ */
269
+ hexToStr(hex) {
270
+ // Remove leading and trailing whitespace
271
+ let trimedStr = hex.trim();
272
+ // Check if the first two characters are '0x', if so, remove them
273
+ let rawStr = trimedStr.substr(0, 2).toLowerCase() === "0x"
274
+ ? trimedStr.substr(2)
275
+ : trimedStr;
276
+ // Get the length of the raw string
277
+ let len = rawStr.length;
278
+ // If the length is not divisible by 2, the hex value is invalid, return empty string
279
+ if (len % 2 !== 0) {
280
+ return "";
281
+ }
282
+ let curCharCode; // Store character code from each iteration
283
+ let resultStr = []; // Array to store converted decimal values
284
+ for (let i = 0; i < len; i = i + 2) {
285
+ curCharCode = parseInt(rawStr.substr(i, 2), 16);
286
+ resultStr.push(curCharCode);
287
+ }
288
+ // Default encoding is utf-8
289
+ let bytesView = new Uint8Array(resultStr); // Typed array of 8-bit unsigned integer values
290
+ let str = new encoding.TextDecoder().decode(bytesView);
291
+ return str;
292
+ }
293
+ }
294
+ //# sourceMappingURL=wechat-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wechat-client.js","sourceRoot":"","sources":["../src/wechat-client.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,QAAQ,EACR,mBAAmB,EAQnB,YAAY,GAKb,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,QAAQ,MAAM,0BAA0B,CAAC;AAChD;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,cAAc;IAC9C;;;OAGG;IACH,YAAY,MAAoB;QAC9B,KAAK,CAAC;YACJ,OAAO,EAAE,MAAM;YACf,GAAG,MAAM;SACV,CAAC,CAAC;IACL,CAAC;IAED;;;OAGG;IACH,WAAW,CAAC,QAAgB;QAC1B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED;;;;;OAKG;IACO,KAAK,CAAC,WAAW,CACzB,GAAW,EACX,OAIC;QAED,2CAA2C;QAC3C,MAAM,SAAS,GAAG,OAAO,EAAE,MAAM,IAAI,KAAK,CAAC;QAC3C,MAAM,MAAM,GAAG,SAA8C,CAAC;QAE9D,mDAAmD;QACnD,IAAI,OAAO,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,GAAG,GAAG,EAAE,CAAC;QAE7C,kBAA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C,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;YACrB,CAAC,CAAC,SAAS,CAAC;QAChB,mCAAmC;QACnC,IAAI,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC;QACxB,qFAAqF;QACrF,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;YAClB,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,IAAI,WAAW,CAAC,CAAC,2CAA2C;QAC5D,IAAI,SAAS,GAAG,EAAE,CAAC,CAAC,0CAA0C;QAC9D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YACnC,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAChD,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC9B,CAAC;QACD,4BAA4B;QAC5B,IAAI,SAAS,GAAG,IAAI,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,+CAA+C;QAC1F,IAAI,GAAG,GAAG,IAAI,QAAQ,CAAC,WAAW,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACvD,OAAO,GAAG,CAAC;IACb,CAAC;CACF"}
@@ -0,0 +1,2 @@
1
+ export = global;
2
+ //# sourceMappingURL=encoding-indexes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"encoding-indexes.d.ts","sourceRoot":"","sources":["../../src/wechat_lib/encoding-indexes.js"],"names":[],"mappings":""}