@pagelines/sdk 1.0.472 → 1.0.473
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/AgentWrap.vue_vue_type_script_setup_true_lang.js +898 -854
- package/dist/AgentWrap.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/agent/AgentController.d.ts +15 -0
- package/dist/agent/ui/ElAgentChat.vue.d.ts +2 -0
- package/dist/clients/ChatClient.d.ts +13 -2
- package/dist/index.js +54 -54
- package/dist/index.js.map +1 -1
- package/dist/sdkClient.d.ts +0 -4
- package/dist/sdkClient.js +295 -231
- package/dist/sdkClient.js.map +1 -1
- package/package.json +1 -1
|
@@ -53,6 +53,13 @@ export declare class AgentChatController extends SettingsObject<AgentChatControl
|
|
|
53
53
|
get chatEnabled(): boolean;
|
|
54
54
|
get chatUnavailableReason(): string | undefined;
|
|
55
55
|
private mapChatError;
|
|
56
|
+
/**
|
|
57
|
+
* Errors we treat as recoverable mid-conversation: rate limits, timeouts,
|
|
58
|
+
* transient infra blips, dropped streams. We render an inline system bubble
|
|
59
|
+
* and keep the input enabled so the next attempt can succeed without
|
|
60
|
+
* forcing a manual reload. Hard errors (auth lost, agent missing) still
|
|
61
|
+
* fall through to handleError which marks the conversation dead.
|
|
62
|
+
*/
|
|
56
63
|
private isTransientError;
|
|
57
64
|
private isDuplicateMessage;
|
|
58
65
|
private addMessage;
|
|
@@ -63,6 +70,14 @@ export declare class AgentChatController extends SettingsObject<AgentChatControl
|
|
|
63
70
|
private updateState;
|
|
64
71
|
private resetState;
|
|
65
72
|
private setupModeWatcher;
|
|
73
|
+
/**
|
|
74
|
+
* Hard error path. Resets the connection and surfaces an inline bubble so
|
|
75
|
+
* the user actually sees what happened — `connectionStatus: 'error'`
|
|
76
|
+
* alone doesn't render anywhere. The raw error is kept on console.error
|
|
77
|
+
* so devs can tell which pipeline stage failed (the `[api]` /
|
|
78
|
+
* `[stream-open]` / `[stream-read]` / `[no-reply]` tags from
|
|
79
|
+
* agent/client.ts survive into the console line).
|
|
80
|
+
*/
|
|
66
81
|
private handleError;
|
|
67
82
|
setMode(mode: AgentMode): Promise<void>;
|
|
68
83
|
startTextConversation(callbacks?: {
|
|
@@ -11,6 +11,8 @@ type __VLS_Props = {
|
|
|
11
11
|
scopeName?: string;
|
|
12
12
|
setupHint?: string;
|
|
13
13
|
emptyStateMessage?: string;
|
|
14
|
+
/** Override the empty-state quick-prompts. Defaults to brief / triage / plan-this-week. */
|
|
15
|
+
starterPrompts?: readonly string[];
|
|
14
16
|
};
|
|
15
17
|
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
16
18
|
messagesContainer: HTMLDivElement;
|
|
@@ -2,6 +2,11 @@ import { SDKContext } from './types';
|
|
|
2
2
|
export declare class ChatClient {
|
|
3
3
|
private ctx;
|
|
4
4
|
constructor(ctx: SDKContext);
|
|
5
|
+
/**
|
|
6
|
+
* Public/visitor chat — anonymous chat against an agent's public handle.
|
|
7
|
+
* Stays on the legacy `AgentChatServer` route for now; substrate doesn't
|
|
8
|
+
* support visitor identities yet (deferred per `plans/features/chat.md`).
|
|
9
|
+
*/
|
|
5
10
|
chatStream(args: {
|
|
6
11
|
handle: string;
|
|
7
12
|
message: string;
|
|
@@ -24,6 +29,12 @@ export declare class ChatClient {
|
|
|
24
29
|
onError: (error: string) => void;
|
|
25
30
|
onStatus?: (status: string) => void;
|
|
26
31
|
}): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* Authenticated chat — substrate-backed (POST /api/messages + SSE on
|
|
34
|
+
* /api/chat/:agentId/stream). Same callback contract as the legacy
|
|
35
|
+
* `chatStream` so callers don't need to know which transport runs underneath.
|
|
36
|
+
* Mirrors `src/modules/agent/client.ts → sendChatMessageStream`.
|
|
37
|
+
*/
|
|
27
38
|
chatStreamAuthenticated(args: {
|
|
28
39
|
agentId: string;
|
|
29
40
|
message: string;
|
|
@@ -34,7 +45,9 @@ export declare class ChatClient {
|
|
|
34
45
|
mimeType: string;
|
|
35
46
|
mediaId?: string;
|
|
36
47
|
}>;
|
|
48
|
+
/** Reserved — substrate resolves conversation server-side from (userId, agentId). */
|
|
37
49
|
conversationId?: string;
|
|
50
|
+
/** Reserved — substrate replays history from the canonical messages table. */
|
|
38
51
|
history?: Array<{
|
|
39
52
|
role: 'user' | 'assistant';
|
|
40
53
|
content: string;
|
|
@@ -44,8 +57,6 @@ export declare class ChatClient {
|
|
|
44
57
|
onError: (error: string) => void;
|
|
45
58
|
onStatus?: (status: string) => void;
|
|
46
59
|
}): Promise<void>;
|
|
47
|
-
/** Shared SSE streaming logic for both public and authenticated chat */
|
|
48
|
-
private _streamChat;
|
|
49
60
|
chatMessage(args: {
|
|
50
61
|
handle: string;
|
|
51
62
|
message: string;
|