@fiction/sdk 1.0.59 → 1.0.61

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 (25) hide show
  1. package/dist/{FModal.vue_vue_type_script_setup_true_lang-C4CbSGGe.js → FModal.vue_vue_type_script_setup_true_lang-Ce7y9PSl.js} +2 -2
  2. package/dist/{FModal.vue_vue_type_script_setup_true_lang-C4CbSGGe.js.map → FModal.vue_vue_type_script_setup_true_lang-Ce7y9PSl.js.map} +1 -1
  3. package/dist/{SelfProvider.vue_vue_type_script_setup_true_lang-DFXdpHBQ.js → SelfProvider.vue_vue_type_script_setup_true_lang-26F7cqUz.js} +2 -2
  4. package/dist/{SelfProvider.vue_vue_type_script_setup_true_lang-DFXdpHBQ.js.map → SelfProvider.vue_vue_type_script_setup_true_lang-26F7cqUz.js.map} +1 -1
  5. package/dist/{SelfWidgetInline-RP4Bgvb2.js → SelfWidgetInline-DM14q3uW.js} +2 -2
  6. package/dist/{SelfWidgetInline-RP4Bgvb2.js.map → SelfWidgetInline-DM14q3uW.js.map} +1 -1
  7. package/dist/{SelfWidgetModal-BfSYtDi_.js → SelfWidgetModal-BpkLEYY0.js} +3 -3
  8. package/dist/{SelfWidgetModal-BfSYtDi_.js.map → SelfWidgetModal-BpkLEYY0.js.map} +1 -1
  9. package/dist/{SelfWidgetPopup-DZkw2epa.js → SelfWidgetPopup-DjwPpHLy.js} +2 -2
  10. package/dist/{SelfWidgetPopup-DZkw2epa.js.map → SelfWidgetPopup-DjwPpHLy.js.map} +1 -1
  11. package/dist/SelfWrap.vue_vue_type_script_setup_true_lang-DLAFn8rY.js +7826 -0
  12. package/dist/SelfWrap.vue_vue_type_script_setup_true_lang-DLAFn8rY.js.map +1 -0
  13. package/dist/demo/index.d.ts +8 -8
  14. package/dist/sdk.css +1 -1
  15. package/dist/sdkClient.d.ts +12 -12
  16. package/dist/self/accounts.d.ts +104 -0
  17. package/dist/self/index.d.ts +2 -0
  18. package/dist/self/schema.d.ts +1 -1
  19. package/dist/self/ui/SelfWrap.vue.d.ts +4 -4
  20. package/dist/self.js +43 -40
  21. package/dist/widget.js +87 -87
  22. package/dist/widget.js.map +1 -1
  23. package/package.json +6 -7
  24. package/dist/SelfWrap.vue_vue_type_script_setup_true_lang-rvOPLj1D.js +0 -5600
  25. package/dist/SelfWrap.vue_vue_type_script_setup_true_lang-rvOPLj1D.js.map +0 -1
@@ -214,10 +214,10 @@ export declare class FictionSDK extends SettingsObject<FictionSDKSettings> {
214
214
  }[] | undefined;
215
215
  email?: string | null | undefined;
216
216
  website?: string | null | undefined;
217
- accounts?: Record<string, {
218
- handle?: string | undefined;
219
- url?: string | undefined;
220
- }> | null | undefined;
217
+ accounts?: {
218
+ platform: "email" | "website" | "linkedin" | "x" | "facebook" | "tiktok" | "youtube" | "github" | "instagram" | "threads" | "phone";
219
+ handle: string;
220
+ }[] | null | undefined;
221
221
  basePrompt?: string | null | undefined;
222
222
  firstMessage?: string | null | undefined;
223
223
  personalityPrompt?: string | null | undefined;
@@ -452,10 +452,10 @@ export declare class FictionSDK extends SettingsObject<FictionSDKSettings> {
452
452
  }[] | undefined;
453
453
  email?: string | null | undefined;
454
454
  website?: string | null | undefined;
455
- accounts?: Record<string, {
456
- handle?: string | undefined;
457
- url?: string | undefined;
458
- }> | null | undefined;
455
+ accounts?: {
456
+ platform: "email" | "website" | "linkedin" | "x" | "facebook" | "tiktok" | "youtube" | "github" | "instagram" | "threads" | "phone";
457
+ handle: string;
458
+ }[] | null | undefined;
459
459
  basePrompt?: string | null | undefined;
460
460
  firstMessage?: string | null | undefined;
461
461
  personalityPrompt?: string | null | undefined;
@@ -577,10 +577,10 @@ export declare class FictionSDK extends SettingsObject<FictionSDKSettings> {
577
577
  }[] | undefined;
578
578
  email?: string | null | undefined;
579
579
  website?: string | null | undefined;
580
- accounts?: Record<string, {
581
- handle?: string | undefined;
582
- url?: string | undefined;
583
- }> | null | undefined;
580
+ accounts?: {
581
+ platform: "email" | "website" | "linkedin" | "x" | "facebook" | "tiktok" | "youtube" | "github" | "instagram" | "threads" | "phone";
582
+ handle: string;
583
+ }[] | null | undefined;
584
584
  basePrompt?: string | null | undefined;
585
585
  firstMessage?: string | null | undefined;
586
586
  personalityPrompt?: string | null | undefined;
@@ -0,0 +1,104 @@
1
+ import { z } from 'zod';
2
+ export declare const SocialAccountSchema: z.ZodObject<{
3
+ platform: z.ZodEnum<{
4
+ email: "email";
5
+ website: "website";
6
+ linkedin: "linkedin";
7
+ x: "x";
8
+ facebook: "facebook";
9
+ tiktok: "tiktok";
10
+ youtube: "youtube";
11
+ github: "github";
12
+ instagram: "instagram";
13
+ threads: "threads";
14
+ phone: "phone";
15
+ }>;
16
+ handle: z.ZodString;
17
+ }, z.core.$strip>;
18
+ export declare const SocialAccountsSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodArray<z.ZodObject<{
19
+ platform: z.ZodEnum<{
20
+ email: "email";
21
+ website: "website";
22
+ linkedin: "linkedin";
23
+ x: "x";
24
+ facebook: "facebook";
25
+ tiktok: "tiktok";
26
+ youtube: "youtube";
27
+ github: "github";
28
+ instagram: "instagram";
29
+ threads: "threads";
30
+ phone: "phone";
31
+ }>;
32
+ handle: z.ZodString;
33
+ }, z.core.$strip>>>;
34
+ export type SocialAccount = z.infer<typeof SocialAccountSchema>;
35
+ export type SocialAccounts = z.infer<typeof SocialAccountsSchema>;
36
+ export declare const SOCIAL_PLATFORMS: {
37
+ readonly linkedin: {
38
+ readonly label: "LinkedIn";
39
+ readonly icon: "i-simple-icons-linkedin";
40
+ readonly placeholder: "john-smith";
41
+ readonly getUrl: (handle: string) => string;
42
+ };
43
+ readonly x: {
44
+ readonly label: "X";
45
+ readonly icon: "i-simple-icons-x";
46
+ readonly placeholder: "johnsmith";
47
+ readonly getUrl: (handle: string) => string;
48
+ };
49
+ readonly facebook: {
50
+ readonly label: "Facebook";
51
+ readonly icon: "i-simple-icons-facebook";
52
+ readonly placeholder: "johnsmith";
53
+ readonly getUrl: (handle: string) => string;
54
+ };
55
+ readonly tiktok: {
56
+ readonly label: "TikTok";
57
+ readonly icon: "i-simple-icons-tiktok";
58
+ readonly placeholder: "johnsmith";
59
+ readonly getUrl: (handle: string) => string;
60
+ };
61
+ readonly youtube: {
62
+ readonly label: "YouTube";
63
+ readonly icon: "i-tabler-brand-youtube";
64
+ readonly placeholder: "johnsmith";
65
+ readonly getUrl: (handle: string) => string;
66
+ };
67
+ readonly github: {
68
+ readonly label: "GitHub";
69
+ readonly icon: "i-tabler-brand-github";
70
+ readonly placeholder: "johnsmith";
71
+ readonly getUrl: (handle: string) => string;
72
+ };
73
+ readonly instagram: {
74
+ readonly label: "Instagram";
75
+ readonly icon: "i-simple-icons-instagram";
76
+ readonly placeholder: "johnsmith";
77
+ readonly getUrl: (handle: string) => string;
78
+ };
79
+ readonly threads: {
80
+ readonly label: "Threads";
81
+ readonly icon: "i-simple-icons-threads";
82
+ readonly placeholder: "johnsmith";
83
+ readonly getUrl: (handle: string) => string;
84
+ };
85
+ readonly email: {
86
+ readonly label: "Email";
87
+ readonly icon: "i-tabler-mail";
88
+ readonly placeholder: "hello@example.com";
89
+ readonly getUrl: (handle: string) => string;
90
+ };
91
+ readonly phone: {
92
+ readonly label: "Phone";
93
+ readonly icon: "i-tabler-phone";
94
+ readonly placeholder: "+1-555-123-4567";
95
+ readonly getUrl: (handle: string) => string;
96
+ };
97
+ readonly website: {
98
+ readonly label: "Website";
99
+ readonly icon: "i-tabler-world";
100
+ readonly placeholder: "https://example.com";
101
+ readonly getUrl: (handle: string) => string;
102
+ };
103
+ };
104
+ export type SocialPlatform = keyof typeof SOCIAL_PLATFORMS;
@@ -5,6 +5,8 @@ import { default as SelfWidget } from './ui/SelfWidget.vue';
5
5
  import { default as SelfWrap } from './ui/SelfWrap.vue';
6
6
  export { ClientAudio } from './ClientAudio';
7
7
  export * from './constants';
8
+ export { SocialAccountSchema, SocialAccountsSchema, SOCIAL_PLATFORMS } from './accounts';
9
+ export type { SocialAccount, SocialAccounts, SocialPlatform } from './accounts';
8
10
  export * from './schema';
9
11
  export { SelfAgent, SelfModal, SelfProvider, SelfWidget, SelfWrap };
10
12
  export * from './utils';
@@ -28,7 +28,7 @@ export interface AudioLevel {
28
28
  }
29
29
  export declare const AGENT_MODES: readonly [{
30
30
  readonly mode: "self";
31
- readonly label: "Mode";
31
+ readonly label: "Overview";
32
32
  readonly icon: "i-tabler-north-star";
33
33
  }, {
34
34
  readonly mode: "talk";
@@ -27,10 +27,10 @@ declare function __VLS_template(): {
27
27
  coverId?: string | null | undefined;
28
28
  email?: string | null | undefined;
29
29
  website?: string | null | undefined;
30
- accounts?: Record<string, {
31
- handle?: string | undefined;
32
- url?: string | undefined;
33
- }> | null | undefined;
30
+ accounts?: {
31
+ platform: "email" | "website" | "linkedin" | "x" | "facebook" | "tiktok" | "youtube" | "github" | "instagram" | "threads" | "phone";
32
+ handle: string;
33
+ }[] | null | undefined;
34
34
  basePrompt?: string | null | undefined;
35
35
  firstMessage?: string | null | undefined;
36
36
  personalityPrompt?: string | null | undefined;
package/dist/self.js CHANGED
@@ -1,11 +1,11 @@
1
- var E = Object.defineProperty;
2
- var d = (e, l) => E(e, "name", { value: l, configurable: !0 });
3
- import { a as A, g as C, c as I, b as M } from "./SelfWrap.vue_vue_type_script_setup_true_lang-rvOPLj1D.js";
4
- import { h as q, A as J, e as K, d as X, C as Y, V as ee, f as te, k as se, i as ae, j as oe, p as ie } from "./SelfWrap.vue_vue_type_script_setup_true_lang-rvOPLj1D.js";
5
- import { defineComponent as b, createBlock as u, openBlock as c, withCtx as k, createElementVNode as o, createVNode as O, ref as v, watch as U, nextTick as V, createElementBlock as h, createCommentVNode as f, normalizeClass as p, normalizeStyle as _, unref as x } from "vue";
6
- import { _ as $ } from "./FModal.vue_vue_type_script_setup_true_lang-C4CbSGGe.js";
7
- import { _ as N } from "./SelfProvider.vue_vue_type_script_setup_true_lang-DFXdpHBQ.js";
8
- const z = { class: "relative w-full h-[80vh] md:h-[600px]" }, P = /* @__PURE__ */ b({
1
+ var y = Object.defineProperty;
2
+ var c = (e, l) => y(e, "name", { value: l, configurable: !0 });
3
+ import { a as E, g as C, c as I, b as M } from "./SelfWrap.vue_vue_type_script_setup_true_lang-DLAFn8rY.js";
4
+ import { j as q, A as J, h as K, f as X, C as Y, e as ee, S as te, d as se, V as ae, i as oe, m as ie, k as le, l as ne, p as re } from "./SelfWrap.vue_vue_type_script_setup_true_lang-DLAFn8rY.js";
5
+ import { defineComponent as b, createBlock as u, openBlock as d, withCtx as k, createElementVNode as o, createVNode as O, ref as v, watch as _, nextTick as U, createElementBlock as h, createCommentVNode as f, normalizeClass as p, normalizeStyle as V, unref as x } from "vue";
6
+ import { _ as $ } from "./FModal.vue_vue_type_script_setup_true_lang-Ce7y9PSl.js";
7
+ import { _ as N } from "./SelfProvider.vue_vue_type_script_setup_true_lang-26F7cqUz.js";
8
+ const T = { class: "relative w-full h-[80vh] md:h-[600px]" }, W = /* @__PURE__ */ b({
9
9
  name: "SelfModal",
10
10
  __name: "SelfModal",
11
11
  props: {
@@ -19,7 +19,7 @@ const z = { class: "relative w-full h-[80vh] md:h-[600px]" }, P = /* @__PURE__ *
19
19
  emits: ["update:vis"],
20
20
  setup(e, { emit: l }) {
21
21
  const s = l;
22
- return (t, a) => (c(), u($, {
22
+ return (t, a) => (d(), u($, {
23
23
  vis: e.vis,
24
24
  "modal-class": "max-w-4xl p-0",
25
25
  "style-class": "bg-transparent shadow-2xl rounded-2xl",
@@ -27,7 +27,7 @@ const z = { class: "relative w-full h-[80vh] md:h-[600px]" }, P = /* @__PURE__ *
27
27
  "onUpdate:vis": a[1] || (a[1] = (n) => s("update:vis", n))
28
28
  }, {
29
29
  default: k(() => [
30
- o("div", z, [
30
+ o("div", T, [
31
31
  O(N, {
32
32
  sdk: e.sdk,
33
33
  self: e.self,
@@ -42,10 +42,10 @@ const z = { class: "relative w-full h-[80vh] md:h-[600px]" }, P = /* @__PURE__ *
42
42
  _: 1
43
43
  }, 8, ["vis"]));
44
44
  }
45
- }), T = {
45
+ }), z = {
46
46
  key: 0,
47
47
  class: "relative h-full w-full"
48
- }, D = { class: "group relative h-full w-full rounded-3xl overflow-hidden shadow-lg transition-all duration-300 ease-[cubic-bezier(0.25,1,0.33,1)] hover:shadow-2xl hover:translate-y-[-1px] hover:brightness-110 active:scale-[1.06] active:-translate-y-0.5 active:duration-100" }, F = ["src", "alt"], Z = /* @__PURE__ */ b({
48
+ }, F = { class: "group relative h-full w-full rounded-3xl overflow-hidden shadow-lg transition-all duration-300 ease-[cubic-bezier(0.25,1,0.33,1)] hover:shadow-2xl hover:translate-y-[-1px] hover:brightness-110 active:scale-[1.06] active:-translate-y-0.5 active:duration-100" }, D = ["src", "alt"], Z = /* @__PURE__ */ b({
49
49
  __name: "SelfWidget",
50
50
  props: {
51
51
  sdk: {},
@@ -59,34 +59,34 @@ const z = { class: "relative w-full h-[80vh] md:h-[600px]" }, P = /* @__PURE__ *
59
59
  function n() {
60
60
  t.value = !t.value;
61
61
  }
62
- d(n, "toggle"), U(t, async (m) => {
63
- m ? (await V(), setTimeout(() => {
62
+ c(n, "toggle"), _(t, async (g) => {
63
+ g ? (await U(), setTimeout(() => {
64
64
  a.value = !0;
65
65
  }, 400)) : a.value = !1;
66
66
  });
67
67
  function w() {
68
68
  t.value = !0;
69
69
  }
70
- d(w, "open");
71
- function g() {
70
+ c(w, "open");
71
+ function m() {
72
72
  t.value = !1;
73
73
  }
74
- d(g, "close");
75
- function y() {
76
- g();
74
+ c(m, "close");
75
+ function S() {
76
+ m();
77
77
  }
78
- return d(y, "handleClose"), l({
78
+ return c(S, "handleClose"), l({
79
79
  toggle: n,
80
80
  open: w,
81
- close: g
82
- }), (m, i) => (c(), u(A, {
81
+ close: m
82
+ }), (g, i) => (d(), u(E, {
83
83
  sdk: e.sdk,
84
84
  handle: e.handle,
85
85
  context: e.context,
86
86
  "first-message": e.firstMessage
87
87
  }, {
88
- default: k(({ self: r, sdk: S }) => [
89
- r ? (c(), h("div", {
88
+ default: k(({ self: r, sdk: A }) => [
89
+ r ? (d(), h("div", {
90
90
  key: 0,
91
91
  class: p(["fixed z-[999999] pointer-events-auto", [
92
92
  s.position === "bottom-left" ? "bottom-6 left-6" : s.position === "top-right" ? "top-6 right-6" : s.position === "top-left" ? "top-6 left-6" : "bottom-6 right-6"
@@ -96,20 +96,20 @@ const z = { class: "relative w-full h-[80vh] md:h-[600px]" }, P = /* @__PURE__ *
96
96
  class: p(["transition-all duration-500 ease-[cubic-bezier(0.25,1,0.33,1)] transform-gpu", [
97
97
  t.value ? "widget-expanded w-96 h-[600px] max-w-[calc(100vw-48px)] max-h-[calc(100vh-48px)] rounded-3xl opacity-100 scale-100" : "widget-button w-[80px] h-[80px] opacity-100 scale-100 flex items-center justify-center cursor-pointer"
98
98
  ]]),
99
- style: _({
99
+ style: V({
100
100
  "transform-origin": s.position === "bottom-left" ? "bottom left" : s.position === "top-right" ? "top right" : s.position === "top-left" ? "top left" : "bottom right"
101
101
  }),
102
- onClick: i[0] || (i[0] = (B) => t.value ? void 0 : n())
102
+ onClick: i[0] || (i[0] = (L) => t.value ? void 0 : n())
103
103
  }, [
104
- t.value ? f("", !0) : (c(), h("div", T, [
105
- o("div", D, [
104
+ t.value ? f("", !0) : (d(), h("div", z, [
105
+ o("div", F, [
106
106
  o("img", {
107
107
  src: x(C)(r) || x(I)(),
108
108
  alt: `${r.name} digital self`,
109
109
  class: "h-full w-full object-cover pointer-events-none",
110
110
  width: "80",
111
111
  height: "80"
112
- }, null, 8, F),
112
+ }, null, 8, D),
113
113
  i[1] || (i[1] = o("div", { class: "absolute inset-0 pointer-events-none bg-gradient-to-br from-transparent via-black/10 to-black/40 opacity-60 transition-opacity duration-300 group-hover:opacity-40" }, null, -1))
114
114
  ]),
115
115
  i[2] || (i[2] = o("div", { class: "absolute top-0.5 right-0.5" }, [
@@ -120,16 +120,16 @@ const z = { class: "relative w-full h-[80vh] md:h-[600px]" }, P = /* @__PURE__ *
120
120
  o("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" })
121
121
  ], -1))
122
122
  ])),
123
- t.value && r ? (c(), u(M, {
123
+ t.value && r ? (d(), u(M, {
124
124
  key: 1,
125
125
  class: "rounded-3xl shadow-2xl border border-white/10",
126
- sdk: S,
126
+ sdk: A,
127
127
  self: r,
128
128
  context: e.context,
129
129
  "first-message": e.firstMessage,
130
130
  "has-close": !0,
131
131
  "is-active": a.value,
132
- onClose: y
132
+ onClose: S
133
133
  }, null, 8, ["sdk", "self", "context", "first-message", "is-active"])) : f("", !0)
134
134
  ], 6)
135
135
  ], 2)) : f("", !0)
@@ -144,18 +144,21 @@ export {
144
144
  K as AUDIO_LEVEL_UPDATE_INTERVAL,
145
145
  X as AUDIO_SMOOTHING,
146
146
  Y as ClientAudio,
147
+ ee as SOCIAL_PLATFORMS,
147
148
  M as SelfAgent,
148
- P as SelfModal,
149
+ W as SelfModal,
149
150
  N as SelfProvider,
150
151
  Z as SelfWidget,
151
- A as SelfWrap,
152
- ee as VISUALIZER_CONFIG,
153
- te as VOICE_FREQUENCIES,
154
- se as generateFirstMessage,
152
+ E as SelfWrap,
153
+ te as SocialAccountSchema,
154
+ se as SocialAccountsSchema,
155
+ ae as VISUALIZER_CONFIG,
156
+ oe as VOICE_FREQUENCIES,
157
+ ie as generateFirstMessage,
155
158
  I as getFallbackAvatarDataUrl,
156
- ae as getImageSrc,
159
+ le as getImageSrc,
157
160
  C as getSelfAvatarUrl,
158
- oe as handleImageError,
159
- ie as parseVoiceMessage
161
+ ne as handleImageError,
162
+ re as parseVoiceMessage
160
163
  };
161
164
  //# sourceMappingURL=self.js.map