@pagelines/sdk 1.0.686 → 1.0.688
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.js +216 -163
- package/dist/AgentProvider.js.map +1 -1
- package/dist/AgentWrap.js +932 -872
- package/dist/AgentWrap.js.map +1 -1
- package/dist/agent/ui/AgentAvatar.vue.d.ts +27 -0
- package/dist/agent/ui/AgentChat.vue.d.ts +18 -2
- package/dist/agent/ui/AgentProvider.vue.d.ts +19 -2
- package/dist/agent/ui/AgentWrap.vue.d.ts +3 -0
- package/dist/agent/ui/ElAgentChat.vue.d.ts +16 -2
- package/dist/agent/ui/ElCreateAgent.vue.d.ts +54 -0
- package/dist/contract.js +10 -2
- package/dist/contract.js.map +1 -1
- package/dist/demo/index.d.ts +27 -0
- package/dist/sdkClient.d.ts +81 -0
- package/dist/widget/composables/useWidgetState.d.ts +81 -0
- package/dist/widget.js +1 -1
- package/dist/widget.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Agent } from '@pagelines/core';
|
|
2
|
+
/**
|
|
3
|
+
* The one agent avatar. Image + status dot (upper-right arc) + owner
|
|
4
|
+
* sub-mark (lower-left tangent), all derived from the canonical `Agent`
|
|
5
|
+
* — never from per-call-site props that can drift.
|
|
6
|
+
*
|
|
7
|
+
* Product rule: an assistant's avatar ALWAYS carries its owner mark.
|
|
8
|
+
* The mark matters most exactly where it used to be suppressed — a
|
|
9
|
+
* public agent an anonymous visitor is meeting for the first time, where
|
|
10
|
+
* "whose assistant is this" is the question and the visitor has no other
|
|
11
|
+
* way to answer it. `Agent.ownerMarkUrl` is the single source.
|
|
12
|
+
*
|
|
13
|
+
* Geometry mirrors the app's `IdentityAvatar` / `StatusDot`: dot at the
|
|
14
|
+
* 45° arc point (14.6% inset, minus half the dot), sub-mark 36% of the
|
|
15
|
+
* avatar sitting ~3% outside the circle so its ring reads as a frame.
|
|
16
|
+
* Duplicated rather than imported because this package publishes
|
|
17
|
+
* standalone and cannot depend on app `src/`; keep the two in step.
|
|
18
|
+
*/
|
|
19
|
+
type __VLS_Props = {
|
|
20
|
+
agent: Agent;
|
|
21
|
+
showStatus?: boolean;
|
|
22
|
+
/** Ring color follows the surface so the mark reads as framed, not cut out. */
|
|
23
|
+
isLight?: boolean;
|
|
24
|
+
};
|
|
25
|
+
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>;
|
|
26
|
+
declare const _default: typeof __VLS_export;
|
|
27
|
+
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PageLinesSDK } from '../../sdkClient';
|
|
2
2
|
import { ButtonIconPreset } from '../../widget/PLWidget';
|
|
3
|
-
import { ColorName } from '@pagelines/core';
|
|
3
|
+
import { ColorName, SuggestedPrompt } from '@pagelines/core';
|
|
4
4
|
import { Agent } from '../schema';
|
|
5
5
|
type __VLS_Props = {
|
|
6
6
|
sdk: PageLinesSDK;
|
|
@@ -15,13 +15,29 @@ type __VLS_Props = {
|
|
|
15
15
|
theme?: ColorName;
|
|
16
16
|
requireAuth?: boolean;
|
|
17
17
|
chatOnly?: boolean;
|
|
18
|
+
/** Render chat without profile chrome so a host page can provide it. */
|
|
19
|
+
bare?: boolean;
|
|
20
|
+
emptyStateMessage?: string;
|
|
21
|
+
suggestedPrompts?: SuggestedPrompt[];
|
|
18
22
|
};
|
|
19
|
-
|
|
23
|
+
type __VLS_Slots = {
|
|
24
|
+
'empty-heading': (props: {
|
|
25
|
+
agent: Agent;
|
|
26
|
+
isLight: boolean;
|
|
27
|
+
}) => any;
|
|
28
|
+
};
|
|
29
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
20
30
|
error: (message: string) => any;
|
|
21
31
|
close: (value: string) => any;
|
|
22
32
|
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
23
33
|
onError?: ((message: string) => any) | undefined;
|
|
24
34
|
onClose?: ((value: string) => any) | undefined;
|
|
25
35
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
36
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
26
37
|
declare const _default: typeof __VLS_export;
|
|
27
38
|
export default _default;
|
|
39
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
40
|
+
new (): {
|
|
41
|
+
$slots: S;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
@@ -1,24 +1,41 @@
|
|
|
1
1
|
import { PageLinesSDK } from '../../sdkClient';
|
|
2
2
|
import { ButtonIconPreset } from '../../widget/PLWidget';
|
|
3
|
-
import {
|
|
3
|
+
import { SuggestedPrompt } from '@pagelines/core';
|
|
4
|
+
import { Agent, AgentConfig } from '../schema';
|
|
4
5
|
type __VLS_Props = {
|
|
5
6
|
sdk?: PageLinesSDK;
|
|
6
7
|
agent?: AgentConfig;
|
|
7
8
|
handle?: string;
|
|
8
9
|
context?: string;
|
|
10
|
+
clientContext?: string;
|
|
9
11
|
firstMessage?: string;
|
|
10
12
|
buttonText?: string;
|
|
11
13
|
buttonIcon?: ButtonIconPreset;
|
|
12
14
|
hasClose?: boolean;
|
|
13
15
|
chatOnly?: boolean;
|
|
16
|
+
bare?: boolean;
|
|
14
17
|
apiBase?: string;
|
|
18
|
+
emptyStateMessage?: string;
|
|
19
|
+
suggestedPrompts?: SuggestedPrompt[];
|
|
15
20
|
};
|
|
16
|
-
|
|
21
|
+
type __VLS_Slots = {
|
|
22
|
+
'empty-heading': (props: {
|
|
23
|
+
agent: Agent;
|
|
24
|
+
isLight: boolean;
|
|
25
|
+
}) => any;
|
|
26
|
+
};
|
|
27
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
17
28
|
error: (message: string) => any;
|
|
18
29
|
close: (value: string) => any;
|
|
19
30
|
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
20
31
|
onError?: ((message: string) => any) | undefined;
|
|
21
32
|
onClose?: ((value: string) => any) | undefined;
|
|
22
33
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
34
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
23
35
|
declare const _default: typeof __VLS_export;
|
|
24
36
|
export default _default;
|
|
37
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
38
|
+
new (): {
|
|
39
|
+
$slots: S;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
@@ -7,10 +7,13 @@ type __VLS_Props = {
|
|
|
7
7
|
agent?: AgentConfig;
|
|
8
8
|
handle?: string;
|
|
9
9
|
context?: string;
|
|
10
|
+
clientContext?: string;
|
|
10
11
|
firstMessage?: string;
|
|
11
12
|
buttonText?: string;
|
|
12
13
|
buttonIcon?: ButtonIconPreset;
|
|
13
14
|
hasClose?: boolean;
|
|
15
|
+
chatOnly?: boolean;
|
|
16
|
+
bare?: boolean;
|
|
14
17
|
apiBase?: string;
|
|
15
18
|
};
|
|
16
19
|
type __VLS_Slots = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AgentChatController } from '../AgentController';
|
|
2
|
-
import { Agent } from '@pagelines/core';
|
|
2
|
+
import { SuggestedPrompt, Agent } from '@pagelines/core';
|
|
3
3
|
type ChatScope = 'private' | 'org' | 'public';
|
|
4
4
|
type __VLS_Props = {
|
|
5
5
|
chatController?: AgentChatController;
|
|
@@ -13,7 +13,21 @@ type __VLS_Props = {
|
|
|
13
13
|
headerMeta?: string;
|
|
14
14
|
/** Center transcript + composer in a 720px column — for wide desktop shells. */
|
|
15
15
|
centered?: boolean;
|
|
16
|
+
/** Optional zero-state actions supplied by the embedding surface. */
|
|
17
|
+
suggestedPrompts?: SuggestedPrompt[];
|
|
16
18
|
};
|
|
17
|
-
|
|
19
|
+
type __VLS_Slots = {
|
|
20
|
+
'empty-heading': (props: {
|
|
21
|
+
agent: Agent;
|
|
22
|
+
isLight: boolean;
|
|
23
|
+
}) => any;
|
|
24
|
+
};
|
|
25
|
+
declare const __VLS_base: 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>;
|
|
26
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
18
27
|
declare const _default: typeof __VLS_export;
|
|
19
28
|
export default _default;
|
|
29
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
30
|
+
new (): {
|
|
31
|
+
$slots: S;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
@@ -84,6 +84,33 @@ declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {
|
|
|
84
84
|
headline?: string | undefined;
|
|
85
85
|
summary?: string | undefined;
|
|
86
86
|
} | undefined;
|
|
87
|
+
owner?: {
|
|
88
|
+
userId: string;
|
|
89
|
+
fullName?: string | undefined;
|
|
90
|
+
avatar?: {
|
|
91
|
+
mediaId?: string | undefined;
|
|
92
|
+
userId?: string | undefined;
|
|
93
|
+
orgId?: string | undefined;
|
|
94
|
+
agentId?: string | null | undefined;
|
|
95
|
+
filename?: string | undefined;
|
|
96
|
+
mimeType?: string | undefined;
|
|
97
|
+
size?: number | undefined;
|
|
98
|
+
src?: string | undefined;
|
|
99
|
+
alt?: string | undefined;
|
|
100
|
+
context?: "avatar" | "cover" | "general" | undefined;
|
|
101
|
+
status?: "processing" | "active" | "failed" | "deleted" | undefined;
|
|
102
|
+
quality?: "high" | "low" | "standard" | undefined;
|
|
103
|
+
createdAt?: string | undefined;
|
|
104
|
+
updatedAt?: string | undefined;
|
|
105
|
+
type?: "audio" | "document" | "image" | "video" | undefined;
|
|
106
|
+
mediaType?: "audio" | "document" | "image" | "video" | undefined;
|
|
107
|
+
className?: string | undefined;
|
|
108
|
+
width?: number | undefined;
|
|
109
|
+
height?: number | undefined;
|
|
110
|
+
duration?: number | undefined;
|
|
111
|
+
blurhash?: string | undefined;
|
|
112
|
+
} | undefined;
|
|
113
|
+
} | undefined;
|
|
87
114
|
visibility?: "org" | "private" | "public" | undefined;
|
|
88
115
|
status?: string | undefined;
|
|
89
116
|
createdAt?: string | undefined;
|
|
@@ -189,6 +216,33 @@ declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {
|
|
|
189
216
|
headline?: string | undefined;
|
|
190
217
|
summary?: string | undefined;
|
|
191
218
|
} | undefined;
|
|
219
|
+
owner?: {
|
|
220
|
+
userId: string;
|
|
221
|
+
fullName?: string | undefined;
|
|
222
|
+
avatar?: {
|
|
223
|
+
mediaId?: string | undefined;
|
|
224
|
+
userId?: string | undefined;
|
|
225
|
+
orgId?: string | undefined;
|
|
226
|
+
agentId?: string | null | undefined;
|
|
227
|
+
filename?: string | undefined;
|
|
228
|
+
mimeType?: string | undefined;
|
|
229
|
+
size?: number | undefined;
|
|
230
|
+
src?: string | undefined;
|
|
231
|
+
alt?: string | undefined;
|
|
232
|
+
context?: "avatar" | "cover" | "general" | undefined;
|
|
233
|
+
status?: "processing" | "active" | "failed" | "deleted" | undefined;
|
|
234
|
+
quality?: "high" | "low" | "standard" | undefined;
|
|
235
|
+
createdAt?: string | undefined;
|
|
236
|
+
updatedAt?: string | undefined;
|
|
237
|
+
type?: "audio" | "document" | "image" | "video" | undefined;
|
|
238
|
+
mediaType?: "audio" | "document" | "image" | "video" | undefined;
|
|
239
|
+
className?: string | undefined;
|
|
240
|
+
width?: number | undefined;
|
|
241
|
+
height?: number | undefined;
|
|
242
|
+
duration?: number | undefined;
|
|
243
|
+
blurhash?: string | undefined;
|
|
244
|
+
} | undefined;
|
|
245
|
+
} | undefined;
|
|
192
246
|
visibility?: "org" | "private" | "public" | undefined;
|
|
193
247
|
status?: string | undefined;
|
|
194
248
|
createdAt?: string | undefined;
|
package/dist/contract.js
CHANGED
|
@@ -4445,6 +4445,11 @@ var Xr = preprocess((e) => Array.isArray(e) ? e.filter((e) => e && typeof e == "
|
|
|
4445
4445
|
summary: string().optional(),
|
|
4446
4446
|
status: string()
|
|
4447
4447
|
}).optional(),
|
|
4448
|
+
owner: object({
|
|
4449
|
+
userId: string(),
|
|
4450
|
+
fullName: string().optional(),
|
|
4451
|
+
avatar: A.optional()
|
|
4452
|
+
}).optional(),
|
|
4448
4453
|
visibility: _enum([
|
|
4449
4454
|
"private",
|
|
4450
4455
|
"org",
|
|
@@ -4466,13 +4471,16 @@ var Xr = preprocess((e) => Array.isArray(e) ? e.filter((e) => e && typeof e == "
|
|
|
4466
4471
|
...e.config instanceof Agent ? e.config.toConfig() : e.config,
|
|
4467
4472
|
context: e.context
|
|
4468
4473
|
} : e;
|
|
4469
|
-
super("Agent", t), this.agentId = r(this.settings.agentId), this.handle = r(this.settings.handle), this.ownerId = r(this.settings.ownerId), this.orgId = r(this.settings.orgId), this.name = r(this.settings.name), this.title = r(this.settings.title), this.summary = r(this.settings.summary), this.entityType = r(this.settings.entityType), this.avatarId = r(this.settings.avatarId), this.coverId = r(this.settings.coverId), this.avatar = r(this.settings.avatar), this.cover = r(this.settings.cover), this.email = r(this.settings.email), this.website = r(this.settings.website), this.accounts = r(this.settings.accounts), this.model = r(this.settings.model), this.lastActiveAt = r(this.settings.lastActiveAt), this.lastMessageAt = r(this.settings.lastMessageAt), this.timezone = r(this.settings.timezone), this.desiredStatus = r(this.settings.desiredStatus), this.automationPrimaryChannel = r(this.settings.automationPrimaryChannel), this.heartbeatEnabled = r(this.settings.heartbeatEnabled), this.onboardedAt = r(this.settings.onboardedAt), this.org = r(this.settings.org), this.visibility = r(this.settings.visibility), this.status = r(this.settings.status), this.createdAt = r(this.settings.createdAt), this.updatedAt = r(this.settings.updatedAt), this.isPrimary = r(this.settings.isPrimary), this.lifecycle = r(this.settings.lifecycle), this.changedAt = r(this.settings.changedAt), this.detail = r(this.settings.detail), this.blocker = r(this.settings.blocker), this.operation = r(this.settings.operation), this.state = n(() => toAgentState({
|
|
4474
|
+
super("Agent", t), this.agentId = r(this.settings.agentId), this.handle = r(this.settings.handle), this.ownerId = r(this.settings.ownerId), this.orgId = r(this.settings.orgId), this.name = r(this.settings.name), this.title = r(this.settings.title), this.summary = r(this.settings.summary), this.entityType = r(this.settings.entityType), this.avatarId = r(this.settings.avatarId), this.coverId = r(this.settings.coverId), this.avatar = r(this.settings.avatar), this.cover = r(this.settings.cover), this.email = r(this.settings.email), this.website = r(this.settings.website), this.accounts = r(this.settings.accounts), this.model = r(this.settings.model), this.lastActiveAt = r(this.settings.lastActiveAt), this.lastMessageAt = r(this.settings.lastMessageAt), this.timezone = r(this.settings.timezone), this.desiredStatus = r(this.settings.desiredStatus), this.automationPrimaryChannel = r(this.settings.automationPrimaryChannel), this.heartbeatEnabled = r(this.settings.heartbeatEnabled), this.onboardedAt = r(this.settings.onboardedAt), this.org = r(this.settings.org), this.owner = r(this.settings.owner), this.visibility = r(this.settings.visibility), this.status = r(this.settings.status), this.createdAt = r(this.settings.createdAt), this.updatedAt = r(this.settings.updatedAt), this.isPrimary = r(this.settings.isPrimary), this.lifecycle = r(this.settings.lifecycle), this.changedAt = r(this.settings.changedAt), this.detail = r(this.settings.detail), this.blocker = r(this.settings.blocker), this.operation = r(this.settings.operation), this.state = n(() => toAgentState({
|
|
4470
4475
|
lifecycle: this.lifecycle.value ?? "unknown",
|
|
4471
4476
|
detail: this.detail.value,
|
|
4472
4477
|
changedAt: this.changedAt.value,
|
|
4473
4478
|
blocker: this.blocker.value,
|
|
4474
4479
|
operation: this.operation.value
|
|
4475
|
-
}, this.displayName.value)), this.avatarUrl = n(() => this.avatar.value?.src || getDefaultAvatarUrl(this.name.value)), this.
|
|
4480
|
+
}, this.displayName.value)), this.avatarUrl = n(() => this.avatar.value?.src || getDefaultAvatarUrl(this.name.value)), this.ownerMarkUrl = n(() => {
|
|
4481
|
+
let e = this.owner.value;
|
|
4482
|
+
if (e) return e.avatar?.src || getDefaultAvatarUrl(e.fullName || e.userId);
|
|
4483
|
+
}), this.displayName = n(() => this.name.value || "Unnamed"), this.hasCustomHandle = n(() => !!this.handle.value && !/\d{13,}$/.test(this.handle.value)), this.displayHandle = n(() => this.hasCustomHandle.value ? `@${this.handle.value}` : void 0), this.isContextPrimary = n(() => !!this.agentId.value && this.agentId.value === this.settings.context?.primaryAgentId), this.wakeUpLabel = n(() => `Wake up ${this.displayName.value}`), this.manageLabel = n(() => `Manage ${this.displayName.value}`), this.hasReceivedMessage = n(() => !!this.lastMessageAt.value);
|
|
4476
4484
|
}
|
|
4477
4485
|
merge(e) {
|
|
4478
4486
|
for (let t of Zr) {
|