@ziggy-ai/client-sdk 0.1.1 → 0.1.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.
Files changed (46) hide show
  1. package/dist/__tests__/analytics.test.d.ts +2 -0
  2. package/dist/__tests__/analytics.test.d.ts.map +1 -0
  3. package/dist/__tests__/app-client.test.d.ts +2 -0
  4. package/dist/__tests__/app-client.test.d.ts.map +1 -0
  5. package/dist/__tests__/callback-handler.test.d.ts +2 -0
  6. package/dist/__tests__/callback-handler.test.d.ts.map +1 -0
  7. package/dist/__tests__/connection.test.d.ts +2 -0
  8. package/dist/__tests__/connection.test.d.ts.map +1 -0
  9. package/dist/__tests__/context.test.d.ts +2 -0
  10. package/dist/__tests__/context.test.d.ts.map +1 -0
  11. package/dist/__tests__/errors.test.d.ts +2 -0
  12. package/dist/__tests__/errors.test.d.ts.map +1 -0
  13. package/dist/__tests__/stream-parser.test.d.ts +2 -0
  14. package/dist/__tests__/stream-parser.test.d.ts.map +1 -0
  15. package/dist/analytics.d.ts +22 -0
  16. package/dist/analytics.d.ts.map +1 -0
  17. package/dist/app.d.ts +60 -0
  18. package/dist/app.d.ts.map +1 -0
  19. package/dist/auth.d.ts +9 -0
  20. package/dist/auth.d.ts.map +1 -0
  21. package/dist/callback-handler.d.ts +64 -0
  22. package/dist/callback-handler.d.ts.map +1 -0
  23. package/dist/chat.d.ts +38 -0
  24. package/dist/chat.d.ts.map +1 -0
  25. package/dist/connection.d.ts +19 -0
  26. package/dist/connection.d.ts.map +1 -0
  27. package/dist/context.d.ts +35 -0
  28. package/dist/context.d.ts.map +1 -0
  29. package/dist/errors.d.ts +16 -0
  30. package/dist/errors.d.ts.map +1 -0
  31. package/dist/feedback.d.ts +29 -0
  32. package/dist/feedback.d.ts.map +1 -0
  33. package/dist/index.d.ts +45 -828
  34. package/dist/index.d.ts.map +1 -0
  35. package/dist/index.js +33 -0
  36. package/dist/quests.d.ts +38 -0
  37. package/dist/quests.d.ts.map +1 -0
  38. package/dist/session.d.ts +28 -0
  39. package/dist/session.d.ts.map +1 -0
  40. package/dist/stream-parser.d.ts +24 -0
  41. package/dist/stream-parser.d.ts.map +1 -0
  42. package/dist/tools.d.ts +22 -0
  43. package/dist/tools.d.ts.map +1 -0
  44. package/dist/types.d.ts +533 -0
  45. package/dist/types.d.ts.map +1 -0
  46. package/package.json +2 -2
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=analytics.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analytics.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/analytics.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=app-client.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-client.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/app-client.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=callback-handler.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"callback-handler.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/callback-handler.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=connection.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/connection.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=context.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/context.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=errors.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/errors.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=stream-parser.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stream-parser.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/stream-parser.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Analytics module — batched event reporting.
3
+ *
4
+ * Accumulates events and flushes every 30 seconds or on disconnect.
5
+ */
6
+ import type { Connection } from './connection.js';
7
+ export declare class AnalyticsClient {
8
+ private connection;
9
+ private sessionId;
10
+ private pending;
11
+ private flushTimer;
12
+ constructor(connection: Connection);
13
+ /** Start batching for a session */
14
+ start(sessionId: string): void;
15
+ /** Stop batching and flush remaining events */
16
+ stop(): Promise<void>;
17
+ /** Track an event */
18
+ track(type: string, data?: Record<string, unknown>): void;
19
+ /** Flush pending events */
20
+ flush(): Promise<void>;
21
+ }
22
+ //# sourceMappingURL=analytics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../src/analytics.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAUlD,qBAAa,eAAe;IAC1B,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,SAAS,CAAuB;IACxC,OAAO,CAAC,OAAO,CAAwB;IACvC,OAAO,CAAC,UAAU,CAA+C;gBAErD,UAAU,EAAE,UAAU;IAIlC,mCAAmC;IACnC,KAAK,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAO9B,+CAA+C;IACzC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAQ3B,qBAAqB;IACrB,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAQzD,2BAA2B;IACrB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAgB7B"}
package/dist/app.d.ts ADDED
@@ -0,0 +1,60 @@
1
+ /**
2
+ * App configuration client — triggers, quick actions, brand registration.
3
+ *
4
+ * Wraps the /v1/apps/* endpoints. App identity comes from the API key
5
+ * (resolved server-side by auth middleware), so no appId is needed here.
6
+ */
7
+ import type { Connection } from './connection.js';
8
+ import type { RegisterTriggersRequest, RegisterTriggersResponse, ListTriggersResponse, DeleteResponse, RegisterQuickActionsRequest, RegisterQuickActionsResponse, ListQuickActionsResponse, RegisterBrandRequest, GetBrandResponse, SetCredentialsRequest, SetCredentialsResponse, GetCredentialsResponse } from './types.js';
9
+ export declare class AppClient {
10
+ private connection;
11
+ constructor(connection: Connection);
12
+ /**
13
+ * Register triggers (full sync — replaces all existing triggers).
14
+ */
15
+ registerTriggers(request: RegisterTriggersRequest): Promise<RegisterTriggersResponse>;
16
+ /**
17
+ * List all registered triggers.
18
+ */
19
+ listTriggers(): Promise<ListTriggersResponse>;
20
+ /**
21
+ * Delete a specific trigger by ID.
22
+ */
23
+ deleteTrigger(triggerId: string): Promise<DeleteResponse>;
24
+ /**
25
+ * Register quick action sets (full sync — replaces all existing sets).
26
+ */
27
+ registerQuickActions(request: RegisterQuickActionsRequest): Promise<RegisterQuickActionsResponse>;
28
+ /**
29
+ * List all registered quick action sets.
30
+ */
31
+ listQuickActions(): Promise<ListQuickActionsResponse>;
32
+ /**
33
+ * Delete a specific quick action set by ID.
34
+ */
35
+ deleteQuickActionSet(setId: string): Promise<DeleteResponse>;
36
+ /**
37
+ * Set or update brand configuration.
38
+ */
39
+ setBrand(brand: RegisterBrandRequest): Promise<{
40
+ updated: boolean;
41
+ }>;
42
+ /**
43
+ * Get brand configuration.
44
+ */
45
+ getBrand(): Promise<GetBrandResponse>;
46
+ /**
47
+ * Set or update tool credentials (encrypted at rest).
48
+ * Merges with existing credentials — pass only the ones to update.
49
+ */
50
+ setCredentials(request: SetCredentialsRequest): Promise<SetCredentialsResponse>;
51
+ /**
52
+ * List which credential keys are stored (values are never returned).
53
+ */
54
+ getCredentials(): Promise<GetCredentialsResponse>;
55
+ /**
56
+ * Delete all stored credentials.
57
+ */
58
+ deleteCredentials(): Promise<DeleteResponse>;
59
+ }
60
+ //# sourceMappingURL=app.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EACV,uBAAuB,EACvB,wBAAwB,EACxB,oBAAoB,EACpB,cAAc,EACd,2BAA2B,EAC3B,4BAA4B,EAC5B,wBAAwB,EACxB,oBAAoB,EACpB,gBAAgB,EAChB,qBAAqB,EACrB,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,YAAY,CAAC;AAEpB,qBAAa,SAAS;IACpB,OAAO,CAAC,UAAU,CAAa;gBAEnB,UAAU,EAAE,UAAU;IAMlC;;OAEG;IACG,gBAAgB,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAI3F;;OAEG;IACG,YAAY,IAAI,OAAO,CAAC,oBAAoB,CAAC;IAInD;;OAEG;IACG,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAM/D;;OAEG;IACG,oBAAoB,CAAC,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,4BAA4B,CAAC;IAIvG;;OAEG;IACG,gBAAgB,IAAI,OAAO,CAAC,wBAAwB,CAAC;IAI3D;;OAEG;IACG,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAMlE;;OAEG;IACG,QAAQ,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAI1E;;OAEG;IACG,QAAQ,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAM3C;;;OAGG;IACG,cAAc,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAIrF;;OAEG;IACG,cAAc,IAAI,OAAO,CAAC,sBAAsB,CAAC;IAIvD;;OAEG;IACG,iBAAiB,IAAI,OAAO,CAAC,cAAc,CAAC;CAGnD"}
package/dist/auth.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ /**
2
+ * API key injection for HTTP requests.
3
+ */
4
+ import type { ZiggyClientConfig } from './types.js';
5
+ /**
6
+ * Build default headers with API key.
7
+ */
8
+ export declare function buildHeaders(config: ZiggyClientConfig, extra?: Record<string, string>): Record<string, string>;
9
+ //# sourceMappingURL=auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,iBAAiB,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAM9G"}
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Callback Handler — host-app-side handler for Ziggy tool execution requests.
3
+ *
4
+ * When Ziggy needs the host app to execute a tool (navigate, retry, etc.),
5
+ * it POSTs to the app's registered callbackUrl. This module provides a
6
+ * framework for handling those requests.
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * import { CallbackHandler } from '@ziggy-ai/client-sdk';
11
+ *
12
+ * const handler = new CallbackHandler();
13
+ *
14
+ * handler.on('support.navigate', async ({ sessionId, path }) => {
15
+ * router.push(path);
16
+ * return { navigated: true, previousPath: router.currentPath };
17
+ * });
18
+ *
19
+ * handler.on('support.retry_process', async ({ sessionId, processId }) => {
20
+ * await transforms.retry(processId);
21
+ * return { retried: true, newProcessId: transforms.latestId };
22
+ * });
23
+ *
24
+ * // In your API route handler:
25
+ * app.post('/api/ziggy/callback', async (req, res) => {
26
+ * const result = await handler.handle(req.body);
27
+ * res.json(result);
28
+ * });
29
+ * ```
30
+ */
31
+ export interface CallbackRequest {
32
+ toolId: string;
33
+ params: Record<string, unknown>;
34
+ requestId: string;
35
+ sessionId?: string;
36
+ }
37
+ export interface CallbackResponse {
38
+ requestId: string;
39
+ success: boolean;
40
+ result?: unknown;
41
+ error?: string;
42
+ }
43
+ export type ToolHandler = (params: Record<string, unknown>, sessionId?: string) => Promise<unknown>;
44
+ export declare class CallbackHandler {
45
+ private handlers;
46
+ /**
47
+ * Register a handler for a specific tool ID.
48
+ */
49
+ on(toolId: string, handler: ToolHandler): this;
50
+ /**
51
+ * Remove a handler for a specific tool ID.
52
+ */
53
+ off(toolId: string): this;
54
+ /**
55
+ * Handle an incoming callback request from Ziggy.
56
+ * Returns a response object suitable for sending back as JSON.
57
+ */
58
+ handle(request: CallbackRequest): Promise<CallbackResponse>;
59
+ /**
60
+ * List all registered tool IDs.
61
+ */
62
+ get registeredTools(): string[];
63
+ }
64
+ //# sourceMappingURL=callback-handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"callback-handler.d.ts","sourceRoot":"","sources":["../src/callback-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,WAAW,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpG,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAkC;IAElD;;OAEG;IACH,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,IAAI;IAK9C;;OAEG;IACH,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAKzB;;;OAGG;IACG,MAAM,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAyBjE;;OAEG;IACH,IAAI,eAAe,IAAI,MAAM,EAAE,CAE9B;CACF"}
package/dist/chat.d.ts ADDED
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Chat module — non-streaming and streaming.
3
+ */
4
+ import type { Connection } from './connection.js';
5
+ import type { SessionManager } from './session.js';
6
+ import type { ChatRequest, ChatResponse, ActionRequest, ActionResponse, StreamEvent } from './types.js';
7
+ export declare class ChatClient {
8
+ private connection;
9
+ private sessionManager;
10
+ private userId;
11
+ constructor(connection: Connection, sessionManager: SessionManager);
12
+ /** Set the current user ID (called after session creation) */
13
+ setUserId(userId: string): void;
14
+ /**
15
+ * Send a non-streaming chat message.
16
+ */
17
+ send(request: ChatRequest): Promise<ChatResponse>;
18
+ /**
19
+ * Send a streaming chat message.
20
+ * Returns an async iterable of structured stream events.
21
+ */
22
+ stream(request: ChatRequest): AsyncGenerator<StreamEvent, void, undefined>;
23
+ /**
24
+ * Execute a support action by ID (non-streaming).
25
+ * Actions from trigger buttons and quick actions go through this method.
26
+ */
27
+ action(request: ActionRequest): Promise<ActionResponse>;
28
+ /**
29
+ * Execute a support action by ID (streaming).
30
+ * Returns an async iterable of structured stream events.
31
+ */
32
+ actionStream(request: ActionRequest): AsyncGenerator<StreamEvent, void, undefined>;
33
+ /**
34
+ * Resume an interrupted stream from a given sequence number.
35
+ */
36
+ resume(streamId: string, afterSeq: number): AsyncGenerator<StreamEvent, void, undefined>;
37
+ }
38
+ //# sourceMappingURL=chat.d.ts.map
@@ -0,0 +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,WAAW,EACZ,MAAM,YAAY,CAAC;AAGpB,qBAAa,UAAU;IACrB,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,cAAc,CAAiB;IACvC,OAAO,CAAC,MAAM,CAAuB;gBAEzB,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc;IAKlE,8DAA8D;IAC9D,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAI/B;;OAEG;IACG,IAAI,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC;IAYvD;;;OAGG;IACI,MAAM,CAAC,OAAO,EAAE,WAAW,GAAG,cAAc,CAAC,WAAW,EAAE,IAAI,EAAE,SAAS,CAAC;IAmBjF;;;OAGG;IACG,MAAM,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC;IAY7D;;;OAGG;IACI,YAAY,CAAC,OAAO,EAAE,aAAa,GAAG,cAAc,CAAC,WAAW,EAAE,IAAI,EAAE,SAAS,CAAC;IAmBzF;;OAEG;IACI,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,cAAc,CAAC,WAAW,EAAE,IAAI,EAAE,SAAS,CAAC;CAUhG"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * HTTP connection layer.
3
+ *
4
+ * Handles fetch requests with auth, timeouts, and error mapping.
5
+ */
6
+ import type { ZiggyClientConfig } from './types.js';
7
+ export declare class Connection {
8
+ private config;
9
+ constructor(config: ZiggyClientConfig);
10
+ /**
11
+ * Make an authenticated JSON request.
12
+ */
13
+ request<T>(method: string, path: string, body?: unknown, extraHeaders?: Record<string, string>): Promise<T>;
14
+ /**
15
+ * Make an authenticated request that returns a ReadableStream (for ndjson).
16
+ */
17
+ streamRequest(method: string, path: string, body?: unknown): Promise<Response>;
18
+ }
19
+ //# sourceMappingURL=connection.d.ts.map
@@ -0,0 +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,GACb,OAAO,CAAC,QAAQ,CAAC;CAmCrB"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Context module — batched context updates with flush control.
3
+ *
4
+ * Auto-batches context pushes every 10 seconds, with immediate flush
5
+ * on important events (page navigation, errors).
6
+ */
7
+ import type { SessionManager } from './session.js';
8
+ import type { ContextPushResponse, ContextEvent } from './types.js';
9
+ export declare class ContextManager {
10
+ private sessionManager;
11
+ private userId;
12
+ private pendingContext;
13
+ private pendingEvents;
14
+ private flushTimer;
15
+ private onTrigger?;
16
+ constructor(sessionManager: SessionManager);
17
+ /** Set user ID and start batching */
18
+ start(userId: string, onTrigger?: (response: ContextPushResponse) => void): void;
19
+ /** Stop batching */
20
+ stop(): void;
21
+ /**
22
+ * Queue a context update. Merges with pending batch.
23
+ * Flushes immediately for important changes.
24
+ */
25
+ update(context: Record<string, unknown>): void;
26
+ /**
27
+ * Queue an event for the next flush.
28
+ */
29
+ addEvent(event: ContextEvent): void;
30
+ /**
31
+ * Flush pending context and events to the server.
32
+ */
33
+ flush(): Promise<void>;
34
+ }
35
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAOpE,qBAAa,cAAc;IACzB,OAAO,CAAC,cAAc,CAAiB;IACvC,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,cAAc,CAA+B;IACrD,OAAO,CAAC,aAAa,CAAsB;IAC3C,OAAO,CAAC,UAAU,CAA+C;IACjE,OAAO,CAAC,SAAS,CAAC,CAA0C;gBAEhD,cAAc,EAAE,cAAc;IAI1C,qCAAqC;IACrC,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,CAAC,QAAQ,EAAE,mBAAmB,KAAK,IAAI,GAAG,IAAI;IAShF,oBAAoB;IACpB,IAAI,IAAI,IAAI;IAOZ;;;OAGG;IACH,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAU9C;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI;IAInC;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAwB7B"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Error types and retry logic for the client SDK.
3
+ */
4
+ import { ZiggyError, ZiggyConnectionError } from './types.js';
5
+ export { ZiggyError, ZiggyConnectionError };
6
+ /** Default retry config */
7
+ export interface RetryConfig {
8
+ maxRetries: number;
9
+ baseDelayMs: number;
10
+ maxDelayMs: number;
11
+ }
12
+ /**
13
+ * Retry with exponential backoff.
14
+ */
15
+ export declare function withRetry<T>(fn: () => Promise<T>, config?: Partial<RetryConfig>): Promise<T>;
16
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAE9D,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,CAAC;AAE5C,2BAA2B;AAC3B,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB;AAQD;;GAEG;AACH,wBAAsB,SAAS,CAAC,CAAC,EAC/B,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACpB,MAAM,GAAE,OAAO,CAAC,WAAW,CAAM,GAChC,OAAO,CAAC,CAAC,CAAC,CA0BZ"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Feedback module — reactions, detailed feedback, outcome recording.
3
+ */
4
+ import type { Connection } from './connection.js';
5
+ import type { ReactionRequest, FeedbackRequest } from './types.js';
6
+ export declare class FeedbackClient {
7
+ private connection;
8
+ constructor(connection: Connection);
9
+ /**
10
+ * Quick reaction on a message.
11
+ */
12
+ react(messageId: string, reaction: ReactionRequest['reaction']): Promise<void>;
13
+ /**
14
+ * Submit detailed feedback.
15
+ */
16
+ submit(feedback: FeedbackRequest): Promise<void>;
17
+ /**
18
+ * Record an outcome.
19
+ */
20
+ recordOutcome(outcome: {
21
+ coordinationId: string;
22
+ success: boolean;
23
+ agentIds?: string[];
24
+ patternId?: string;
25
+ questId?: string;
26
+ toolIds?: string[];
27
+ }): Promise<void>;
28
+ }
29
+ //# sourceMappingURL=feedback.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feedback.d.ts","sourceRoot":"","sources":["../src/feedback.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEnE,qBAAa,cAAc;IACzB,OAAO,CAAC,UAAU,CAAa;gBAEnB,UAAU,EAAE,UAAU;IAIlC;;OAEG;IACG,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAOpF;;OAEG;IACG,MAAM,CAAC,QAAQ,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAItD;;OAEG;IACG,aAAa,CAAC,OAAO,EAAE;QAC3B,cAAc,EAAE,MAAM,CAAC;QACvB,OAAO,EAAE,OAAO,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;KACpB,GAAG,OAAO,CAAC,IAAI,CAAC;CAMlB"}