@pagelines/sdk 1.0.603 → 1.0.605
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/AgentProvider.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/AgentWrap.vue_vue_type_script_setup_true_lang.js +1251 -1153
- package/dist/AgentWrap.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/agent/AgentController.d.ts +9 -1
- package/dist/agent/schema.d.ts +7 -1
- package/dist/agent/test/ElAgentChat.client.test.d.ts +1 -0
- package/dist/clients/ChatClient.d.ts +12 -1
- package/dist/index.js +72 -70
- package/dist/index.js.map +1 -1
- package/dist/sdkClient.js +256 -327
- package/dist/sdkClient.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
|
-
import { AgentConfig, SettingsObject } from '@pagelines/core';
|
|
2
|
+
import { AgentConfig, ChatToolActivityData, SettingsObject } from '@pagelines/core';
|
|
3
3
|
import { PageLinesSDK } from '../sdkClient';
|
|
4
4
|
import { AgentMode, ChatAttachment, ChatMessage, TextConnectionState, Agent } from './schema';
|
|
5
5
|
/**
|
|
@@ -52,6 +52,7 @@ export type ChatStreamFn = (args: {
|
|
|
52
52
|
onDone: (conversationId: string) => void;
|
|
53
53
|
onError: (error: string | ChatStreamError) => void;
|
|
54
54
|
onStatus?: (status: string) => void;
|
|
55
|
+
onToolActivity?: (activity: ChatToolActivityData) => void;
|
|
55
56
|
onWorkingEnd?: () => void;
|
|
56
57
|
}) => Promise<void>;
|
|
57
58
|
type AgentChatControllerSettings = {
|
|
@@ -60,6 +61,9 @@ type AgentChatControllerSettings = {
|
|
|
60
61
|
context?: string;
|
|
61
62
|
firstMessage?: string;
|
|
62
63
|
chatStreamFn?: ChatStreamFn;
|
|
64
|
+
cancelChatTurnFn?: (args: {
|
|
65
|
+
conversationId?: string;
|
|
66
|
+
}) => Promise<void> | void;
|
|
63
67
|
};
|
|
64
68
|
/** @deprecated Use AgentChatControllerSettings */
|
|
65
69
|
export type AgentControllerSettings = AgentChatControllerSettings;
|
|
@@ -67,6 +71,7 @@ export declare class AgentChatController extends SettingsObject<AgentChatControl
|
|
|
67
71
|
private isTextMode;
|
|
68
72
|
private lastMessage;
|
|
69
73
|
private isConnecting;
|
|
74
|
+
private activeTurnGeneration;
|
|
70
75
|
private conversationId?;
|
|
71
76
|
textState: Ref<TextConnectionState>;
|
|
72
77
|
agentMode: Ref<AgentMode>;
|
|
@@ -102,6 +107,8 @@ export declare class AgentChatController extends SettingsObject<AgentChatControl
|
|
|
102
107
|
};
|
|
103
108
|
private updateState;
|
|
104
109
|
private resetState;
|
|
110
|
+
private updateToolActivity;
|
|
111
|
+
private finishToolActivities;
|
|
105
112
|
private setupModeWatcher;
|
|
106
113
|
private setupAvailabilityWatcher;
|
|
107
114
|
/**
|
|
@@ -119,6 +126,7 @@ export declare class AgentChatController extends SettingsObject<AgentChatControl
|
|
|
119
126
|
}): Promise<void>;
|
|
120
127
|
endConversation(): Promise<void>;
|
|
121
128
|
sendChatMessage(message: string, attachments?: ChatAttachment[]): Promise<void>;
|
|
129
|
+
stopChatTurn(): Promise<void>;
|
|
122
130
|
private buildHistory;
|
|
123
131
|
/** Seed the controller with previously-loaded messages (e.g. from a server thread). */
|
|
124
132
|
loadMessages(args: {
|
package/dist/agent/schema.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { ChatToolActivityData } from '@pagelines/core';
|
|
1
2
|
export { Agent } from '@pagelines/core';
|
|
2
|
-
export type { AgentConfig } from '@pagelines/core';
|
|
3
|
+
export type { AgentConfig, ChatToolActivityData as ChatToolActivity } from '@pagelines/core';
|
|
3
4
|
export interface ChatAttachment {
|
|
4
5
|
type: 'image' | 'audio' | 'video' | 'document';
|
|
5
6
|
src: string;
|
|
@@ -40,6 +41,11 @@ export interface TextConnectionState {
|
|
|
40
41
|
* Render as live chrome, never as a transcript message.
|
|
41
42
|
*/
|
|
42
43
|
workingDescription?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Transient per-turn tool activity from `tool_activity` SSE frames.
|
|
46
|
+
* Render as live chrome/details, never as transcript content.
|
|
47
|
+
*/
|
|
48
|
+
toolActivities?: ChatToolActivityData[];
|
|
43
49
|
/**
|
|
44
50
|
* Durable send block from a server issue that retrying cannot fix in this
|
|
45
51
|
* session. Stays set until the controller is recreated or upstream state
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import { ChatAttachmentInput } from '@pagelines/core';
|
|
1
|
+
import { ChatAttachmentInput, ChatToolActivityData } from '@pagelines/core';
|
|
2
2
|
import { ChatMessage } from '../agent/schema';
|
|
3
3
|
import { SDKContext } from './types';
|
|
4
|
+
type CancelConversationTurnResponse = {
|
|
5
|
+
cancelled: boolean;
|
|
6
|
+
cancelledTurnIds: string[];
|
|
7
|
+
};
|
|
4
8
|
export interface ChatStreamError {
|
|
5
9
|
code: string;
|
|
6
10
|
error: string;
|
|
@@ -12,6 +16,10 @@ export interface ChatStreamError {
|
|
|
12
16
|
export declare class ChatClient {
|
|
13
17
|
private ctx;
|
|
14
18
|
constructor(ctx: SDKContext);
|
|
19
|
+
cancelConversationTurn(args: {
|
|
20
|
+
conversationId: string;
|
|
21
|
+
turnId?: string;
|
|
22
|
+
}): Promise<CancelConversationTurnResponse>;
|
|
15
23
|
/**
|
|
16
24
|
* Public/visitor chat — anonymous chat against an agent's public handle,
|
|
17
25
|
* routed through the messaging substrate. Same SSE wire format as
|
|
@@ -33,6 +41,7 @@ export declare class ChatClient {
|
|
|
33
41
|
onDone: (conversationId: string) => void;
|
|
34
42
|
onError: (error: string | ChatStreamError) => void;
|
|
35
43
|
onStatus?: (status: string) => void;
|
|
44
|
+
onToolActivity?: (activity: ChatToolActivityData) => void;
|
|
36
45
|
onWorkingEnd?: () => void;
|
|
37
46
|
}): Promise<void>;
|
|
38
47
|
/**
|
|
@@ -59,6 +68,8 @@ export declare class ChatClient {
|
|
|
59
68
|
onDone: (conversationId: string) => void;
|
|
60
69
|
onError: (error: string | ChatStreamError) => void;
|
|
61
70
|
onStatus?: (status: string) => void;
|
|
71
|
+
onToolActivity?: (activity: ChatToolActivityData) => void;
|
|
62
72
|
onWorkingEnd?: () => void;
|
|
63
73
|
}): Promise<void>;
|
|
64
74
|
}
|
|
75
|
+
export {};
|