@ziggy-ai/client-sdk 0.7.5 → 0.7.6
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/dist/chat.d.ts +6 -2
- package/dist/chat.d.ts.map +1 -1
- package/dist/connection.d.ts +1 -1
- package/dist/connection.d.ts.map +1 -1
- package/dist/index.js +7 -6
- package/package.json +1 -1
package/dist/chat.d.ts
CHANGED
|
@@ -19,7 +19,9 @@ export declare class ChatClient {
|
|
|
19
19
|
* Send a streaming chat message.
|
|
20
20
|
* Returns an async iterable of structured stream events.
|
|
21
21
|
*/
|
|
22
|
-
stream(request: ChatRequest
|
|
22
|
+
stream(request: ChatRequest, options?: {
|
|
23
|
+
signal?: AbortSignal;
|
|
24
|
+
}): AsyncGenerator<StreamEvent, void, undefined>;
|
|
23
25
|
/**
|
|
24
26
|
* Execute a support action by ID (non-streaming).
|
|
25
27
|
* Actions from trigger buttons and quick actions go through this method.
|
|
@@ -29,7 +31,9 @@ export declare class ChatClient {
|
|
|
29
31
|
* Execute a support action by ID (streaming).
|
|
30
32
|
* Returns an async iterable of structured stream events.
|
|
31
33
|
*/
|
|
32
|
-
actionStream(request: ActionRequest
|
|
34
|
+
actionStream(request: ActionRequest, options?: {
|
|
35
|
+
signal?: AbortSignal;
|
|
36
|
+
}): AsyncGenerator<StreamEvent, void, undefined>;
|
|
33
37
|
/**
|
|
34
38
|
* Resume an interrupted stream from a given sequence number.
|
|
35
39
|
*/
|
package/dist/chat.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../src/chat.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EACV,WAAW,EACX,YAAY,EACZ,aAAa,EACb,cAAc,EACd,W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;OAGG;IACG,MAAM,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC;IAY7D;;;OAGG;IACI,YAAY,CACjB,OAAO,EAAE,aAAa,EACtB,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GACjC,cAAc,CAAC,WAAW,EAAE,IAAI,EAAE,SAAS,CAAC;IAmB/C;;OAEG;IACI,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,cAAc,CAAC,WAAW,EAAE,IAAI,EAAE,SAAS,CAAC;IAW/F;;OAEG;IACG,eAAe,CAAC,cAAc,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAK1F;;OAEG;IACG,WAAW,CAAC,cAAc,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,QAAQ,EAAE,mBAAmB,EAAE,CAAA;KAAE,CAAC;IAQvG;;OAEG;IACG,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC;QAC9F,aAAa,EAAE,mBAAmB,EAAE,CAAC;QACrC,UAAU,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,OAAO,CAAA;SAAE,CAAC;KACjE,CAAC;CAOH"}
|
package/dist/connection.d.ts
CHANGED
|
@@ -14,6 +14,6 @@ export declare class Connection {
|
|
|
14
14
|
/**
|
|
15
15
|
* Make an authenticated request that returns a ReadableStream (for ndjson).
|
|
16
16
|
*/
|
|
17
|
-
streamRequest(method: string, path: string, body?: unknown): Promise<Response>;
|
|
17
|
+
streamRequest(method: string, path: string, body?: unknown, signal?: AbortSignal): Promise<Response>;
|
|
18
18
|
}
|
|
19
19
|
//# sourceMappingURL=connection.d.ts.map
|
package/dist/connection.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAIpD,qBAAa,UAAU;IACrB,OAAO,CAAC,MAAM,CAAoB;gBAEtB,MAAM,EAAE,iBAAiB;IAIrC;;OAEG;IACG,OAAO,CAAC,CAAC,EACb,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE,OAAO,EACd,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACpC,OAAO,CAAC,CAAC,CAAC;IAgDb;;OAEG;IACG,aAAa,CACjB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAIpD,qBAAa,UAAU;IACrB,OAAO,CAAC,MAAM,CAAoB;gBAEtB,MAAM,EAAE,iBAAiB;IAIrC;;OAEG;IACG,OAAO,CAAC,CAAC,EACb,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE,OAAO,EACd,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACpC,OAAO,CAAC,CAAC,CAAC;IAgDb;;OAEG;IACG,aAAa,CACjB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE,OAAO,EACd,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,QAAQ,CAAC;CAoCrB"}
|
package/dist/index.js
CHANGED
|
@@ -81,14 +81,15 @@ var Connection = class {
|
|
|
81
81
|
/**
|
|
82
82
|
* Make an authenticated request that returns a ReadableStream (for ndjson).
|
|
83
83
|
*/
|
|
84
|
-
async streamRequest(method, path, body) {
|
|
84
|
+
async streamRequest(method, path, body, signal) {
|
|
85
85
|
const url = `${this.config.baseUrl}/v1${path}`;
|
|
86
86
|
const headers = await buildHeaders(this.config);
|
|
87
87
|
try {
|
|
88
88
|
const response = await fetch(url, {
|
|
89
89
|
method,
|
|
90
90
|
headers,
|
|
91
|
-
body: body ? JSON.stringify(body) : void 0
|
|
91
|
+
body: body ? JSON.stringify(body) : void 0,
|
|
92
|
+
signal
|
|
92
93
|
});
|
|
93
94
|
if (!response.ok) {
|
|
94
95
|
let errorBody;
|
|
@@ -254,7 +255,7 @@ var ChatClient = class {
|
|
|
254
255
|
* Send a streaming chat message.
|
|
255
256
|
* Returns an async iterable of structured stream events.
|
|
256
257
|
*/
|
|
257
|
-
async *stream(request) {
|
|
258
|
+
async *stream(request, options) {
|
|
258
259
|
const sessionId = this.sessionManager.sessionId;
|
|
259
260
|
if (!sessionId) throw new Error("No active session");
|
|
260
261
|
if (!this.userId) throw new Error("No user ID set");
|
|
@@ -263,7 +264,7 @@ var ChatClient = class {
|
|
|
263
264
|
conversationId: this.sessionManager.conversationId || void 0,
|
|
264
265
|
userId: this.userId,
|
|
265
266
|
...request
|
|
266
|
-
});
|
|
267
|
+
}, options?.signal);
|
|
267
268
|
const tracker = new SequenceTracker();
|
|
268
269
|
for await (const event of parseNdjsonStream(response)) {
|
|
269
270
|
tracker.update(event);
|
|
@@ -288,7 +289,7 @@ var ChatClient = class {
|
|
|
288
289
|
* Execute a support action by ID (streaming).
|
|
289
290
|
* Returns an async iterable of structured stream events.
|
|
290
291
|
*/
|
|
291
|
-
async *actionStream(request) {
|
|
292
|
+
async *actionStream(request, options) {
|
|
292
293
|
const sessionId = this.sessionManager.sessionId;
|
|
293
294
|
if (!sessionId) throw new Error("No active session");
|
|
294
295
|
if (!this.userId) throw new Error("No user ID set");
|
|
@@ -296,7 +297,7 @@ var ChatClient = class {
|
|
|
296
297
|
sessionId,
|
|
297
298
|
userId: this.userId,
|
|
298
299
|
...request
|
|
299
|
-
});
|
|
300
|
+
}, options?.signal);
|
|
300
301
|
const tracker = new SequenceTracker();
|
|
301
302
|
for await (const event of parseNdjsonStream(response)) {
|
|
302
303
|
tracker.update(event);
|