@pagelines/sdk 1.0.878 → 1.0.880
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/README.md +68 -68
- package/dist/BotProvider.js +777 -0
- package/dist/BotProvider.js.map +1 -0
- package/dist/{AgentWidgetInline.js → BotWidgetInline.js} +8 -8
- package/dist/BotWidgetInline.js.map +1 -0
- package/dist/{AgentWidgetModal.js → BotWidgetModal.js} +7 -7
- package/dist/BotWidgetModal.js.map +1 -0
- package/dist/{AgentWrap.js → BotWrap.js} +1174 -1145
- package/dist/BotWrap.js.map +1 -0
- package/dist/{agent/AgentController.d.ts → bot/BotController.d.ts} +35 -18
- package/dist/bot/index.d.ts +14 -0
- package/dist/{agent → bot}/schema.d.ts +6 -6
- package/dist/{agent/ui/AgentAvatar.vue.d.ts → bot/ui/BotAvatar.vue.d.ts} +6 -6
- package/dist/{agent/ui/AgentChat.vue.d.ts → bot/ui/BotChat.vue.d.ts} +5 -5
- package/dist/{agent/ui/AgentProvider.vue.d.ts → bot/ui/BotProvider.vue.d.ts} +3 -3
- package/dist/{agent/ui/AgentWrap.vue.d.ts → bot/ui/BotWrap.vue.d.ts} +3 -4
- package/dist/{agent/ui/ElAgentAbout.vue.d.ts → bot/ui/ElBotAbout.vue.d.ts} +2 -2
- package/dist/{agent/ui/ElAgentChat.vue.d.ts → bot/ui/ElBotChat.vue.d.ts} +5 -5
- package/dist/{agent/ui/ElAgentChatPreview.vue.d.ts → bot/ui/ElBotChatPreview.vue.d.ts} +1 -1
- package/dist/{agent/ui/ElAgentHeader.vue.d.ts → bot/ui/ElBotHeader.vue.d.ts} +2 -2
- package/dist/{agent/ui/ElAgentModeSidebar.vue.d.ts → bot/ui/ElBotModeSidebar.vue.d.ts} +2 -2
- package/dist/{agent/ui/ElAgentSidebar.vue.d.ts → bot/ui/ElBotSidebar.vue.d.ts} +2 -2
- package/dist/bot/ui/ElCreateBot.vue.d.ts +12 -0
- package/dist/{agent → bot}/ui/ElModeHeader.vue.d.ts +2 -2
- package/dist/{agent → bot}/ui/ElProvisioningStatus.vue.d.ts +1 -1
- package/dist/{agent → bot}/ui/VoiceMode.vue.d.ts +4 -4
- package/dist/{agent → bot}/utils.d.ts +5 -5
- package/dist/{agent → bot}/voice/provider.d.ts +2 -2
- package/dist/{agent → bot}/voice/providers/livekit/provider.d.ts +4 -4
- package/dist/{agent → bot}/voice/voice-session-client.d.ts +1 -1
- package/dist/{agent → bot}/work-journal.d.ts +1 -1
- package/dist/{agent.js → bot.js} +83 -80
- package/dist/bot.js.map +1 -0
- package/dist/clients/BillingClient.d.ts +1 -1
- package/dist/clients/BotClient.d.ts +26 -0
- package/dist/clients/ChatClient.d.ts +6 -5
- package/dist/clients/ComputerClient.d.ts +16 -0
- package/dist/clients/UserClient.d.ts +4 -7
- package/dist/clients/types.d.ts +7 -2
- package/dist/contract/build.d.ts +1 -2
- package/dist/index.d.ts +3 -2
- package/dist/provider.js +1 -1
- package/dist/provider.js.map +1 -1
- package/dist/provider2.js +14 -14
- package/dist/provider2.js.map +1 -1
- package/dist/sdk.css +1 -1
- package/dist/sdk.js +4 -4
- package/dist/sdkClient.d.ts +33 -376
- package/dist/sdkClient.js +168 -170
- package/dist/sdkClient.js.map +1 -1
- package/dist/useWidgetState.js +9 -9
- package/dist/useWidgetState.js.map +1 -1
- package/dist/widget/PLWidget.d.ts +6 -6
- package/dist/widget/composables/useWidgetState.d.ts +3 -402
- package/dist/widget/index.d.ts +2 -2
- package/dist/widget/mode.d.ts +2 -2
- package/dist/widget/ui/{AgentWidgetInline.vue.d.ts → BotWidgetInline.vue.d.ts} +2 -2
- package/dist/widget/ui/{AgentWidgetModal.vue.d.ts → BotWidgetModal.vue.d.ts} +2 -2
- package/dist/widget/ui/{AgentWidgetPopup.vue.d.ts → BotWidgetPopup.vue.d.ts} +4 -4
- package/dist/widget.js +206 -206
- package/dist/widget.js.map +1 -1
- package/package.json +5 -5
- package/dist/AgentProvider.js +0 -764
- package/dist/AgentProvider.js.map +0 -1
- package/dist/AgentWidgetInline.js.map +0 -1
- package/dist/AgentWidgetModal.js.map +0 -1
- package/dist/AgentWrap.js.map +0 -1
- package/dist/agent/index.d.ts +0 -14
- package/dist/agent/ui/ElCreateAgent.vue.d.ts +0 -277
- package/dist/agent.js.map +0 -1
- package/dist/clients/AgentClient.d.ts +0 -48
- /package/dist/{agent → bot}/VoiceRecorderController.d.ts +0 -0
- /package/dist/{agent/ui/AgentInputEmail.vue.d.ts → bot/ui/BotInputEmail.vue.d.ts} +0 -0
- /package/dist/{agent/ui/AgentInputOneTimeCode.vue.d.ts → bot/ui/BotInputOneTimeCode.vue.d.ts} +0 -0
- /package/dist/{agent/ui/AgentSidebarClose.vue.d.ts → bot/ui/BotSidebarClose.vue.d.ts} +0 -0
- /package/dist/{agent/ui/AgentToolActivityGroup.vue.d.ts → bot/ui/BotToolActivityGroup.vue.d.ts} +0 -0
- /package/dist/{agent/ui/AgentWidget.vue.d.ts → bot/ui/BotWidget.vue.d.ts} +0 -0
- /package/dist/{agent → bot}/ui/ChatCardBlock.vue.d.ts +0 -0
- /package/dist/{agent → bot}/ui/ChatRichText.vue.d.ts +0 -0
- /package/dist/{agent → bot}/ui/ChatScroller.vue.d.ts +0 -0
- /package/dist/{agent → bot}/ui/ChatVisualBlock.vue.d.ts +0 -0
- /package/dist/{agent → bot}/ui/ElAuthGate.vue.d.ts +0 -0
- /package/dist/{agent → bot}/ui/ElAuthPanel.vue.d.ts +0 -0
- /package/dist/{agent/ui/ElAgentButton.vue.d.ts → bot/ui/ElBotButton.vue.d.ts} +0 -0
- /package/dist/{agent → bot}/ui/ElSidebar.vue.d.ts +0 -0
- /package/dist/{agent → bot}/ui/VoiceHistogramController.d.ts +0 -0
- /package/dist/{agent → bot}/ui/chat-diagram-layout.d.ts +0 -0
- /package/dist/{agent → bot}/ui/chat-visual-format.d.ts +0 -0
- /package/dist/{agent → bot}/ui/voice-mode-presentation.d.ts +0 -0
- /package/dist/{agent → bot}/voice/voice-error-copy.d.ts +0 -0
- /package/dist/{agent → bot}/voice/voice-work-state.d.ts +0 -0
- /package/dist/widget/ui/{AgentWidgetOnboard.vue.d.ts → BotWidgetOnboard.vue.d.ts} +0 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { ComputedRef, Ref } from 'vue';
|
|
2
|
-
import {
|
|
2
|
+
import { ChatStreamError, ChatToolActivityData, SettingsObject } from '@pagelines/core';
|
|
3
3
|
import { PageLinesSDK } from '../sdkClient';
|
|
4
|
-
import {
|
|
4
|
+
import { BotMode, ChatAttachment, ChatMessage, TextConnectionState, Bot } from './schema';
|
|
5
5
|
import { VoiceClientHandlers, VoiceSessionClient } from './voice/voice-session-client';
|
|
6
6
|
import { LiveTurnBlock, WorkJournalModel, WorkJournalOutcome } from './work-journal';
|
|
7
7
|
import { VoiceRecorderController } from './VoiceRecorderController';
|
|
8
8
|
export type ChatStreamErrorPresentation = {
|
|
9
9
|
surface: 'transcript';
|
|
10
10
|
issue: NonNullable<ChatMessage['issue']>;
|
|
11
|
-
sendBlockedReason?: 'account' | '
|
|
11
|
+
sendBlockedReason?: 'account' | 'bot_deleted';
|
|
12
12
|
} | {
|
|
13
13
|
surface: 'transient';
|
|
14
14
|
issue: NonNullable<TextConnectionState['transientIssue']>;
|
|
@@ -20,7 +20,7 @@ export type ChatStreamErrorPresentation = {
|
|
|
20
20
|
*
|
|
21
21
|
* Server contract: an `error` frame is never persisted — a message-shaped
|
|
22
22
|
* render of one silently vanishes on reload ("no disappearing states").
|
|
23
|
-
* Durable blocks (account bucket / deleted
|
|
23
|
+
* Durable blocks (account bucket / deleted bot) keep the transcript row +
|
|
24
24
|
* send block because the widget gate path has no persisted explainer behind
|
|
25
25
|
* them; every other soft issue is retry-in-chat → live chrome, like
|
|
26
26
|
* `workingDescription`.
|
|
@@ -47,24 +47,32 @@ export type ChatStreamFn = (args: {
|
|
|
47
47
|
export type ChatUploadFn = (args: {
|
|
48
48
|
file: File;
|
|
49
49
|
}) => Promise<ChatAttachment>;
|
|
50
|
-
export type
|
|
50
|
+
export type BotChatComposerState = {
|
|
51
51
|
text: string;
|
|
52
52
|
pendingAttachments: ChatAttachment[];
|
|
53
53
|
isUploading: boolean;
|
|
54
54
|
};
|
|
55
|
-
export type
|
|
55
|
+
export type BotChatControllerSettings = {
|
|
56
56
|
sdk?: PageLinesSDK;
|
|
57
|
-
|
|
57
|
+
bot: Bot;
|
|
58
58
|
context?: string;
|
|
59
59
|
firstMessage?: string;
|
|
60
60
|
chatStreamFn?: ChatStreamFn;
|
|
61
61
|
cancelChatTurnFn?: (args: {
|
|
62
62
|
conversationId?: string;
|
|
63
63
|
}) => Promise<void> | void;
|
|
64
|
+
/**
|
|
65
|
+
* Flag an assistant message. Omitted by hosts with no authenticated
|
|
66
|
+
* reporter (the public widget), which hides the action rather than
|
|
67
|
+
* offering a button that cannot report.
|
|
68
|
+
*/
|
|
69
|
+
reportMessageFn?: (args: {
|
|
70
|
+
messageId: string;
|
|
71
|
+
}) => Promise<void>;
|
|
64
72
|
uploadFileFn?: ChatUploadFn;
|
|
65
73
|
/**
|
|
66
|
-
* Where this
|
|
67
|
-
* an asleep-
|
|
74
|
+
* Where this bot is managed (wake/rebuild). In-app surfaces pass it so
|
|
75
|
+
* an asleep-bot send can answer with a wake link; anonymous/widget
|
|
68
76
|
* surfaces omit it — a visitor can't wake someone else's assistant.
|
|
69
77
|
*/
|
|
70
78
|
manageUrl?: string;
|
|
@@ -87,7 +95,7 @@ export type AgentChatControllerSettings = {
|
|
|
87
95
|
*/
|
|
88
96
|
createVoiceClientFn?: (args: {
|
|
89
97
|
/** Validated by the controller's gate — the surface does not re-check. */
|
|
90
|
-
|
|
98
|
+
botId: string;
|
|
91
99
|
orgId: string;
|
|
92
100
|
conversationId?: string;
|
|
93
101
|
handlers: VoiceClientHandlers;
|
|
@@ -97,7 +105,7 @@ export type AgentChatControllerSettings = {
|
|
|
97
105
|
onTurnStarted?: () => void;
|
|
98
106
|
onTurnCompleted?: (conversationId: string) => void;
|
|
99
107
|
};
|
|
100
|
-
export declare class
|
|
108
|
+
export declare class BotChatController extends SettingsObject<BotChatControllerSettings> {
|
|
101
109
|
private isTextMode;
|
|
102
110
|
private lastMessage;
|
|
103
111
|
private isConnecting;
|
|
@@ -138,9 +146,9 @@ export declare class AgentChatController extends SettingsObject<AgentChatControl
|
|
|
138
146
|
readonly liveStreamMessageId: import('vue').ShallowRef<string | undefined, string | undefined>;
|
|
139
147
|
private conversationId?;
|
|
140
148
|
textState: Ref<TextConnectionState>;
|
|
141
|
-
|
|
149
|
+
botMode: Ref<BotMode>;
|
|
142
150
|
sharedMessages: Ref<ChatMessage[]>;
|
|
143
|
-
readonly composerState: Ref<
|
|
151
|
+
readonly composerState: Ref<BotChatComposerState>;
|
|
144
152
|
/**
|
|
145
153
|
* The live line of work for the in-flight turn. Present only once the first
|
|
146
154
|
* activity arrives (before that, the top-level thinking cue owns the state —
|
|
@@ -182,8 +190,8 @@ export declare class AgentChatController extends SettingsObject<AgentChatControl
|
|
|
182
190
|
/** Build the live-conversation client for the voice surface. Undefined when this surface can't do voice. */
|
|
183
191
|
createVoiceClient(handlers: VoiceClientHandlers): VoiceSessionClient | undefined;
|
|
184
192
|
refreshMessages(): Promise<void>;
|
|
185
|
-
private
|
|
186
|
-
constructor(settings:
|
|
193
|
+
private _bot;
|
|
194
|
+
constructor(settings: BotChatControllerSettings);
|
|
187
195
|
get chatEnabled(): boolean;
|
|
188
196
|
get chatUnavailableReason(): string | undefined;
|
|
189
197
|
private mapChatError;
|
|
@@ -191,7 +199,7 @@ export declare class AgentChatController extends SettingsObject<AgentChatControl
|
|
|
191
199
|
* Errors we treat as recoverable mid-conversation: rate limits, timeouts,
|
|
192
200
|
* transient infra blips, dropped streams. We render an inline system bubble
|
|
193
201
|
* and keep the input enabled so the next attempt can succeed without
|
|
194
|
-
* forcing a manual reload. Hard errors (auth lost,
|
|
202
|
+
* forcing a manual reload. Hard errors (auth lost, bot missing) still
|
|
195
203
|
* fall through to handleError which marks the conversation dead.
|
|
196
204
|
*/
|
|
197
205
|
private isTransientError;
|
|
@@ -215,6 +223,15 @@ export declare class AgentChatController extends SettingsObject<AgentChatControl
|
|
|
215
223
|
* feedback" miss flagged in design.md → Action Feedback Contract.
|
|
216
224
|
*/
|
|
217
225
|
notify(text: string): void;
|
|
226
|
+
/** Whether this host can report at all — the action hides when it cannot. */
|
|
227
|
+
get canReportMessages(): boolean;
|
|
228
|
+
/**
|
|
229
|
+
* Flag an assistant message, matching what iOS has sent since it shipped:
|
|
230
|
+
* no category, no reason. The owner is never asked to classify what upset
|
|
231
|
+
* them, and the acknowledgement rides the same system bubble as every other
|
|
232
|
+
* adjacent-surface result.
|
|
233
|
+
*/
|
|
234
|
+
reportMessage(messageId: string): Promise<void>;
|
|
218
235
|
setComposerText(args: {
|
|
219
236
|
text: string;
|
|
220
237
|
}): void;
|
|
@@ -283,10 +300,10 @@ export declare class AgentChatController extends SettingsObject<AgentChatControl
|
|
|
283
300
|
* alone doesn't render anywhere. The raw error is kept on console.error
|
|
284
301
|
* so devs can tell which pipeline stage failed (the `[api]` /
|
|
285
302
|
* `[stream-open]` / `[stream-read]` / `[no-reply]` tags from
|
|
286
|
-
*
|
|
303
|
+
* bot/client.ts survive into the console line).
|
|
287
304
|
*/
|
|
288
305
|
private handleError;
|
|
289
|
-
setMode(mode:
|
|
306
|
+
setMode(mode: BotMode): Promise<void>;
|
|
290
307
|
startTextConversation(callbacks?: {
|
|
291
308
|
onConnect?: () => void;
|
|
292
309
|
}): Promise<void>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { default as BotChat } from './ui/BotChat.vue';
|
|
2
|
+
import { default as BotProvider } from './ui/BotProvider.vue';
|
|
3
|
+
import { default as BotWidget } from './ui/BotWidget.vue';
|
|
4
|
+
import { default as BotWrap } from './ui/BotWrap.vue';
|
|
5
|
+
import { default as ElBotChat } from './ui/ElBotChat.vue';
|
|
6
|
+
import { default as ElBotChatPreview } from './ui/ElBotChatPreview.vue';
|
|
7
|
+
import { default as VoiceMode } from './ui/VoiceMode.vue';
|
|
8
|
+
export { BotChatController } from './BotController';
|
|
9
|
+
export type { BotChatComposerState, ChatStreamFn, ChatUploadFn } from './BotController';
|
|
10
|
+
export { VoiceSessionClient } from './voice/voice-session-client';
|
|
11
|
+
export type { VoiceClientHandlers, VoiceLevelEvent, VoiceMetric, VoiceMetricName, VoiceSessionClientState, VoiceSessionError, } from './voice/voice-session-client';
|
|
12
|
+
export type { WorkJournalModel, WorkJournalOutcome, WorkJournalRow, WorkJournalTone } from './work-journal';
|
|
13
|
+
export * from './schema';
|
|
14
|
+
export { BotChat, BotProvider, BotWidget, BotWrap, ElBotChat, ElBotChatPreview, VoiceMode };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ChatAttachment, ChatToolActivityData } from '@pagelines/core';
|
|
2
|
-
export {
|
|
3
|
-
export type {
|
|
2
|
+
export { Bot } from '@pagelines/core';
|
|
3
|
+
export type { BotData, ChatAttachment, ChatToolActivityData as ChatToolActivity } from '@pagelines/core';
|
|
4
4
|
export interface ChatMessageIssue {
|
|
5
5
|
code: string;
|
|
6
6
|
bucket: 'account' | 'error';
|
|
@@ -11,7 +11,7 @@ export interface ChatMessageIssue {
|
|
|
11
11
|
export interface ChatMessage {
|
|
12
12
|
id: string;
|
|
13
13
|
text: string;
|
|
14
|
-
sender: 'user' | '
|
|
14
|
+
sender: 'user' | 'bot' | 'system';
|
|
15
15
|
timestamp: string;
|
|
16
16
|
conversationId?: string;
|
|
17
17
|
sequence?: string;
|
|
@@ -49,7 +49,7 @@ export interface TextConnectionState {
|
|
|
49
49
|
* session. Stays set until the controller is recreated or upstream state
|
|
50
50
|
* changes and the chat reloads.
|
|
51
51
|
*/
|
|
52
|
-
sendBlockedReason?: 'account' | '
|
|
52
|
+
sendBlockedReason?: 'account' | 'bot_deleted';
|
|
53
53
|
/**
|
|
54
54
|
* Transient turn failure from an `error` SSE frame the server did NOT
|
|
55
55
|
* persist. Live chrome like `workingDescription` — never a transcript
|
|
@@ -64,7 +64,7 @@ export interface TextConnectionState {
|
|
|
64
64
|
help?: string;
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
|
-
export declare const
|
|
67
|
+
export declare const BOT_MODES: readonly [{
|
|
68
68
|
readonly mode: "self";
|
|
69
69
|
readonly label: "Overview";
|
|
70
70
|
readonly icon: "i-tabler-user-square-rounded";
|
|
@@ -81,4 +81,4 @@ export declare const AGENT_MODES: readonly [{
|
|
|
81
81
|
readonly label: "About";
|
|
82
82
|
readonly icon: "i-tabler-user-circle";
|
|
83
83
|
}];
|
|
84
|
-
export type
|
|
84
|
+
export type BotMode = (typeof BOT_MODES)[number]['mode'];
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Bot } from '@pagelines/core';
|
|
2
2
|
/**
|
|
3
|
-
* The one
|
|
4
|
-
* sub-mark (lower-left tangent), all derived from the canonical `
|
|
3
|
+
* The one bot avatar. Image + status dot (upper-right arc) + owner
|
|
4
|
+
* sub-mark (lower-left tangent), all derived from the canonical `Bot`
|
|
5
5
|
* — never from per-call-site props that can drift.
|
|
6
6
|
*
|
|
7
7
|
* Product rule: an assistant's avatar ALWAYS carries its owner mark.
|
|
8
8
|
* The mark matters most exactly where it used to be suppressed — a
|
|
9
|
-
* public
|
|
9
|
+
* public bot an anonymous visitor is meeting for the first time, where
|
|
10
10
|
* "whose assistant is this" is the question and the visitor has no other
|
|
11
|
-
* way to answer it. `
|
|
11
|
+
* way to answer it. `Bot.ownerMarkUrl` is the single source.
|
|
12
12
|
*
|
|
13
13
|
* Geometry mirrors the app's `IdentityAvatar` / `StatusDot`: dot at the
|
|
14
14
|
* 45° arc point (14.6% inset, minus half the dot), sub-mark 36% of the
|
|
@@ -17,7 +17,7 @@ import { Agent } from '@pagelines/core';
|
|
|
17
17
|
* standalone and cannot depend on app `src/`; keep the two in step.
|
|
18
18
|
*/
|
|
19
19
|
type __VLS_Props = {
|
|
20
|
-
|
|
20
|
+
bot: Bot;
|
|
21
21
|
showStatus?: boolean;
|
|
22
22
|
/** Voice mode opts out: the owner is the one present and speaking, so the "whose assistant is this" question is already answered. */
|
|
23
23
|
showOwnerMark?: boolean;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BotChatControllerSettings } from '../BotController';
|
|
2
2
|
import { PageLinesSDK } from '../../sdkClient';
|
|
3
3
|
import { ButtonIconPreset } from '../../widget/PLWidget';
|
|
4
4
|
import { ColorName } from '@pagelines/core';
|
|
5
|
-
import {
|
|
5
|
+
import { Bot } from '../schema';
|
|
6
6
|
type __VLS_Props = {
|
|
7
7
|
sdk: PageLinesSDK;
|
|
8
|
-
|
|
8
|
+
bot: Bot;
|
|
9
9
|
context?: string;
|
|
10
10
|
firstMessage?: string;
|
|
11
11
|
buttonText?: string;
|
|
@@ -20,11 +20,11 @@ type __VLS_Props = {
|
|
|
20
20
|
bare?: boolean;
|
|
21
21
|
emptyStateMessage?: string;
|
|
22
22
|
/** Voice transport, supplied by hosts that ship it. See the note in createChatController. */
|
|
23
|
-
createVoiceClientFn?:
|
|
23
|
+
createVoiceClientFn?: BotChatControllerSettings['createVoiceClientFn'];
|
|
24
24
|
};
|
|
25
25
|
type __VLS_Slots = {
|
|
26
26
|
'empty-heading': (props: {
|
|
27
|
-
|
|
27
|
+
bot: Bot;
|
|
28
28
|
isLight: boolean;
|
|
29
29
|
}) => any;
|
|
30
30
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { PageLinesSDK } from '../../sdkClient';
|
|
2
2
|
import { ButtonIconPreset } from '../../widget/PLWidget';
|
|
3
|
-
import {
|
|
3
|
+
import { Bot } from '../schema';
|
|
4
4
|
type __VLS_Props = {
|
|
5
5
|
sdk?: PageLinesSDK;
|
|
6
|
-
|
|
6
|
+
bot?: Bot;
|
|
7
7
|
handle?: string;
|
|
8
8
|
context?: string;
|
|
9
9
|
clientContext?: string;
|
|
@@ -18,7 +18,7 @@ type __VLS_Props = {
|
|
|
18
18
|
};
|
|
19
19
|
type __VLS_Slots = {
|
|
20
20
|
'empty-heading': (props: {
|
|
21
|
-
|
|
21
|
+
bot: Bot;
|
|
22
22
|
isLight: boolean;
|
|
23
23
|
}) => any;
|
|
24
24
|
};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { AgentConfig } from '@pagelines/core';
|
|
2
1
|
import { PageLinesSDK } from '../../sdkClient';
|
|
3
2
|
import { ButtonIconPreset } from '../../widget/PLWidget';
|
|
4
|
-
import {
|
|
3
|
+
import { Bot } from '../schema';
|
|
5
4
|
type __VLS_Props = {
|
|
6
5
|
sdk?: PageLinesSDK;
|
|
7
|
-
|
|
6
|
+
bot?: Bot;
|
|
8
7
|
handle?: string;
|
|
9
8
|
context?: string;
|
|
10
9
|
clientContext?: string;
|
|
@@ -19,7 +18,7 @@ type __VLS_Props = {
|
|
|
19
18
|
type __VLS_Slots = {
|
|
20
19
|
default: (props: {
|
|
21
20
|
sdk: PageLinesSDK;
|
|
22
|
-
|
|
21
|
+
bot: Bot;
|
|
23
22
|
context?: string;
|
|
24
23
|
firstMessage?: string;
|
|
25
24
|
buttonText?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Bot } from '../schema';
|
|
2
2
|
type __VLS_Props = {
|
|
3
|
-
|
|
3
|
+
bot: Bot;
|
|
4
4
|
isOnline?: boolean;
|
|
5
5
|
};
|
|
6
6
|
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { BotChatController } from '../BotController';
|
|
2
|
+
import { Bot } from '@pagelines/core';
|
|
3
3
|
type ChatScope = 'private' | 'org' | 'public';
|
|
4
4
|
type __VLS_Props = {
|
|
5
|
-
chatController?:
|
|
6
|
-
|
|
5
|
+
chatController?: BotChatController;
|
|
6
|
+
bot: Bot;
|
|
7
7
|
variant?: 'dark' | 'light';
|
|
8
8
|
scope?: ChatScope;
|
|
9
9
|
scopeName?: string;
|
|
@@ -16,7 +16,7 @@ type __VLS_Props = {
|
|
|
16
16
|
};
|
|
17
17
|
type __VLS_Slots = {
|
|
18
18
|
'empty-heading': (props: {
|
|
19
|
-
|
|
19
|
+
bot: Bot;
|
|
20
20
|
isLight: boolean;
|
|
21
21
|
}) => any;
|
|
22
22
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Bot } from '@pagelines/core';
|
|
2
2
|
interface Props {
|
|
3
|
-
|
|
3
|
+
bot: Bot;
|
|
4
4
|
isOnline?: boolean;
|
|
5
5
|
}
|
|
6
6
|
declare const __VLS_export: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BotChatController } from '../BotController';
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
modelValue: boolean;
|
|
4
|
-
chatController?:
|
|
4
|
+
chatController?: BotChatController;
|
|
5
5
|
};
|
|
6
6
|
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
7
7
|
"update:modelValue": (value: boolean) => any;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Bot } from '@pagelines/core';
|
|
2
|
+
import { PageLinesSDK } from '../../sdkClient';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
sdk: PageLinesSDK;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
7
|
+
created: (bot: Bot) => any;
|
|
8
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
9
|
+
onCreated?: ((bot: Bot) => any) | undefined;
|
|
10
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PageLinesSDK } from '../../sdkClient';
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
sdk: PageLinesSDK;
|
|
4
|
-
|
|
4
|
+
computerId: string;
|
|
5
5
|
};
|
|
6
6
|
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
7
7
|
error: (message: string) => any;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Bot } from '@pagelines/core';
|
|
2
|
+
import { BotChatController } from '../BotController';
|
|
3
3
|
type __VLS_Props = {
|
|
4
|
-
|
|
5
|
-
chatController?:
|
|
4
|
+
bot: Bot;
|
|
5
|
+
chatController?: BotChatController;
|
|
6
6
|
isLight?: boolean;
|
|
7
7
|
/**
|
|
8
8
|
* The avatar to fill the background with, already decoded by the host
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BotData, getDefaultAvatarUrl } from '@pagelines/core';
|
|
2
2
|
export { getDefaultAvatarUrl };
|
|
3
3
|
export declare function getImageSrc(image: string | {
|
|
4
4
|
src?: string;
|
|
5
5
|
} | undefined): string;
|
|
6
|
-
type
|
|
7
|
-
export declare function
|
|
6
|
+
type BotLike = Pick<BotData, 'cover' | 'avatar' | 'name'>;
|
|
7
|
+
export declare function getBotAvatarUrl(bot: BotLike): string;
|
|
8
8
|
export declare function handleImageError(event: Event): void;
|
|
9
9
|
export declare function parseVoiceMessage(args: {
|
|
10
10
|
message: string;
|
|
11
11
|
source: string;
|
|
12
12
|
}): {
|
|
13
13
|
text: string;
|
|
14
|
-
sender: 'user' | '
|
|
14
|
+
sender: 'user' | 'bot';
|
|
15
15
|
} | null;
|
|
16
16
|
/**
|
|
17
17
|
* Parse button template string with self data variables
|
|
@@ -27,5 +27,5 @@ export declare function parseVoiceMessage(args: {
|
|
|
27
27
|
*/
|
|
28
28
|
export declare function parseButtonTemplate(args: {
|
|
29
29
|
template: string;
|
|
30
|
-
|
|
30
|
+
bot: Pick<BotData, 'name' | 'title' | 'handle'>;
|
|
31
31
|
}): string;
|
|
@@ -12,7 +12,7 @@ export interface VoiceSessionError {
|
|
|
12
12
|
code: string;
|
|
13
13
|
message: string;
|
|
14
14
|
}
|
|
15
|
-
export type VoiceDisconnectCause = '
|
|
15
|
+
export type VoiceDisconnectCause = 'bot' | 'error' | 'network' | 'unknown';
|
|
16
16
|
/**
|
|
17
17
|
* Who the transport says is talking. Raw energy is not a speech signal — room
|
|
18
18
|
* tone and the speaker's own playback both read as audible — so ducking,
|
|
@@ -20,7 +20,7 @@ export type VoiceDisconnectCause = 'agent' | 'error' | 'network' | 'unknown';
|
|
|
20
20
|
*/
|
|
21
21
|
export interface VoiceSpeakingState {
|
|
22
22
|
user: boolean;
|
|
23
|
-
|
|
23
|
+
bot: boolean;
|
|
24
24
|
}
|
|
25
25
|
export interface VoiceProviderClient {
|
|
26
26
|
connect: (handlers: {
|
|
@@ -16,7 +16,7 @@ export interface VoiceRoom {
|
|
|
16
16
|
on: (event: string, handler: (...args: any[]) => void) => unknown;
|
|
17
17
|
off: (event: string, handler: (...args: any[]) => void) => unknown;
|
|
18
18
|
remoteParticipants: ReadonlyMap<string, {
|
|
19
|
-
|
|
19
|
+
isBot: boolean;
|
|
20
20
|
attributes: Readonly<Record<string, string>>;
|
|
21
21
|
}>;
|
|
22
22
|
localParticipant: {
|
|
@@ -42,8 +42,8 @@ export declare class LiveKitVoiceProvider implements VoiceProviderClient {
|
|
|
42
42
|
private attachedElements;
|
|
43
43
|
private closing;
|
|
44
44
|
private userSpeaking;
|
|
45
|
-
private
|
|
46
|
-
private
|
|
45
|
+
private botActiveSpeaker;
|
|
46
|
+
private botStateSpeaking;
|
|
47
47
|
private lastSpeaking?;
|
|
48
48
|
constructor(mint: LiveKitMint, deps?: {
|
|
49
49
|
createRoom?: () => VoiceRoom;
|
|
@@ -54,7 +54,7 @@ export declare class LiveKitVoiceProvider implements VoiceProviderClient {
|
|
|
54
54
|
setMuted(muted: boolean): Promise<void>;
|
|
55
55
|
sampleLevel(prefer?: VoiceLevelEvent['source']): ReturnType<VoiceProviderClient['sampleLevel']>;
|
|
56
56
|
private publishSpeaking;
|
|
57
|
-
private
|
|
57
|
+
private waitForBotReady;
|
|
58
58
|
private analyserFor;
|
|
59
59
|
private watchMicLevel;
|
|
60
60
|
private attachRemoteAudio;
|
|
@@ -23,7 +23,7 @@ export interface VoiceClientHandlers {
|
|
|
23
23
|
onWorkChange?: (work: VoiceWorkStatus) => void;
|
|
24
24
|
}
|
|
25
25
|
export interface VoiceSessionClientSettings extends VoiceClientHandlers, Record<string, unknown> {
|
|
26
|
-
|
|
26
|
+
botId: string;
|
|
27
27
|
orgId: string;
|
|
28
28
|
conversationId?: string;
|
|
29
29
|
/** Last message already loaded by the host; the work stream starts after it. */
|
|
@@ -38,7 +38,7 @@ export type WorkJournalModel = {
|
|
|
38
38
|
* Views never infer the turn outcome from child activity statuses.
|
|
39
39
|
*/
|
|
40
40
|
export declare function durableJournalOutcome(msg: {
|
|
41
|
-
sender: 'user' | '
|
|
41
|
+
sender: 'user' | 'bot' | 'system';
|
|
42
42
|
turnOutcome?: 'failed' | 'stopped';
|
|
43
43
|
}): WorkJournalOutcome;
|
|
44
44
|
/**
|