@amaster.ai/client 1.1.0-beta.53 → 1.1.0-beta.55

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 (2) hide show
  1. package/package.json +11 -11
  2. package/types/copilot.d.ts +65 -34
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amaster.ai/client",
3
- "version": "1.1.0-beta.53",
3
+ "version": "1.1.0-beta.55",
4
4
  "description": "Unified API client for Amaster platform - All services in one package",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -72,16 +72,16 @@
72
72
  "registry": "https://registry.npmjs.org/"
73
73
  },
74
74
  "dependencies": {
75
- "@amaster.ai/auth-client": "1.1.0-beta.53",
76
- "@amaster.ai/bpm-client": "1.1.0-beta.53",
77
- "@amaster.ai/http-client": "1.1.0-beta.53",
78
- "@amaster.ai/entity-client": "1.1.0-beta.53",
79
- "@amaster.ai/function-client": "1.1.0-beta.53",
80
- "@amaster.ai/copilot-client": "1.1.0-beta.53",
81
- "@amaster.ai/workflow-client": "1.1.0-beta.53",
82
- "@amaster.ai/s3-client": "1.1.0-beta.53",
83
- "@amaster.ai/asr-client": "1.1.0-beta.53",
84
- "@amaster.ai/tts-client": "1.1.0-beta.53"
75
+ "@amaster.ai/asr-client": "1.1.0-beta.55",
76
+ "@amaster.ai/bpm-client": "1.1.0-beta.55",
77
+ "@amaster.ai/auth-client": "1.1.0-beta.55",
78
+ "@amaster.ai/copilot-client": "1.1.0-beta.55",
79
+ "@amaster.ai/entity-client": "1.1.0-beta.55",
80
+ "@amaster.ai/function-client": "1.1.0-beta.55",
81
+ "@amaster.ai/http-client": "1.1.0-beta.55",
82
+ "@amaster.ai/s3-client": "1.1.0-beta.55",
83
+ "@amaster.ai/tts-client": "1.1.0-beta.55",
84
+ "@amaster.ai/workflow-client": "1.1.0-beta.55"
85
85
  },
86
86
  "peerDependencies": {
87
87
  "axios": "^1.11.0"
@@ -1,49 +1,80 @@
1
- import type { SendStreamingMessageResponse, CancelTaskResponse, GetTaskResponse } from '@a2a-js/sdk';
2
- import type { ClientResult } from './common';
1
+ import type {
2
+ SendStreamingMessageResponse,
3
+ CancelTaskResponse,
4
+ GetTaskResponse,
5
+ } from "@a2a-js/sdk";
6
+ import type { ClientResult } from "./common";
3
7
 
4
8
  interface TextContent {
5
- type: "text";
6
- text: string;
9
+ type: "text";
10
+ text: string;
7
11
  }
8
12
  interface ImageContent {
9
- type: "image";
10
- data?: string;
11
- url?: string;
12
- mimeType?: string;
13
+ type: "image";
14
+ data?: string;
15
+ url?: string;
16
+ mimeType?: string;
13
17
  }
14
18
  interface FileContent {
15
- type: "file";
16
- data?: string;
17
- url?: string;
18
- mimeType?: string;
19
- name?: string;
19
+ type: "file";
20
+ data?: string;
21
+ url?: string;
22
+ mimeType?: string;
23
+ name?: string;
20
24
  }
21
25
  type MessageContent = TextContent | ImageContent | FileContent;
22
26
  interface ChatMessage {
23
- role: "system" | "user" | "assistant";
24
- content: string | MessageContent[];
27
+ role: "system" | "user" | "assistant";
28
+ content: string | MessageContent[];
25
29
  }
26
30
  interface ChatOptions {
27
- taskId?: string;
31
+ taskId?: string;
28
32
  }
29
33
  type CopilotClientAPI = {
30
- /**
31
- * Stream messages from Copilot Agent.
32
- *
33
- * @example
34
- * ```typescript
35
- * import { createCopilotClient, Data } from "@amaster.ai/copilot-client";
36
- *
37
- * const client = createCopilotClient();
38
- *
39
- * for await (const response of client.chat([{ role: "user", content: "Hello" }])) {
40
- * // deal response
41
- * }
42
- * ```
43
- */
44
- chat(messages: ChatMessage[], options?: ChatOptions): AsyncGenerator<SendStreamingMessageResponse, void, unknown>;
45
- cancelChat(taskId: string): Promise<ClientResult<CancelTaskResponse>>;
46
- getChatStatus(taskId: string): Promise<ClientResult<GetTaskResponse>>;
34
+ /**
35
+ * Stream messages from Copilot Agent.
36
+ *
37
+ * @example
38
+ * ```typescript
39
+ * import { createCopilotClient, Data } from "@amaster.ai/copilot-client";
40
+ *
41
+ * const client = createCopilotClient();
42
+ *
43
+ * for await (const response of client.chat([{ role: "user", content: "Hello" }])) {
44
+ * // deal response
45
+ * }
46
+ * ```
47
+ */
48
+ chat(
49
+ messages: ChatMessage[],
50
+ options?: ChatOptions
51
+ ): AsyncGenerator<SendStreamingMessageResponse, void, unknown>;
52
+ cancelChat(taskId: string): Promise<ClientResult<CancelTaskResponse>>;
53
+ getChatStatus(taskId?: string): Promise<{
54
+ working: boolean;
55
+ taskId?: string;
56
+ error?: string;
57
+ }>;
58
+ getHistory(
59
+ limit?: number,
60
+ next?: string
61
+ ): Promise<
62
+ | {
63
+ messages: SendStreamingMessageResponse[];
64
+ next: string;
65
+ hasMore: boolean;
66
+ }
67
+ | undefined
68
+ >;
69
+ newConversation(): Promise<void>;
47
70
  };
48
71
 
49
- export { type ChatMessage, type ChatOptions, type CopilotClientAPI, type FileContent, type ImageContent, type MessageContent, type TextContent };
72
+ export {
73
+ type ChatMessage,
74
+ type ChatOptions,
75
+ type CopilotClientAPI,
76
+ type FileContent,
77
+ type ImageContent,
78
+ type MessageContent,
79
+ type TextContent,
80
+ };