@useago/sdk 0.3.2 → 0.3.3

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 (116) hide show
  1. package/dist/AgoClient-DF7M2WAz.js +575 -0
  2. package/dist/AgoClient-bjN-z2ZQ.cjs +6 -0
  3. package/dist/angular.cjs +1 -143
  4. package/dist/angular.d.cts +530 -0
  5. package/dist/angular.d.ts +530 -2
  6. package/dist/angular.js +71 -139
  7. package/dist/createMockClient-D6uVh-B9.js +254 -0
  8. package/dist/createMockClient-DecMEUcK.cjs +1 -0
  9. package/dist/devtools.cjs +4 -78
  10. package/dist/devtools.d.cts +443 -0
  11. package/dist/devtools.d.ts +443 -2
  12. package/dist/devtools.js +46 -71
  13. package/dist/functions-Bz-1Bs3I.cjs +1 -0
  14. package/dist/functions-DdROP6Ui.js +312 -0
  15. package/dist/helpers.cjs +1 -15
  16. package/dist/{helpers/functions.d.ts → helpers.d.cts} +121 -62
  17. package/dist/helpers.d.ts +121 -2
  18. package/dist/helpers.js +16 -2
  19. package/dist/index.cjs +1 -347
  20. package/dist/index.d.cts +1150 -0
  21. package/dist/index.d.ts +1150 -20
  22. package/dist/index.js +128 -298
  23. package/dist/react.cjs +31 -22438
  24. package/dist/react.d.cts +960 -0
  25. package/dist/react.d.ts +960 -2
  26. package/dist/react.js +8401 -22376
  27. package/dist/rolldown-runtime-CaekUdDJ.cjs +1 -0
  28. package/dist/rolldown-runtime-DxmricAu.js +25 -0
  29. package/dist/vue.cjs +1 -336
  30. package/dist/vue.d.cts +1063 -0
  31. package/dist/vue.d.ts +1063 -2
  32. package/dist/vue.js +174 -316
  33. package/dist/{widget/types.d.ts → widget.d.cts} +41 -43
  34. package/dist/widget.d.ts +41 -2
  35. package/package.json +35 -24
  36. package/dist/AgoClient-DPZdN5n2.js +0 -905
  37. package/dist/AgoClient-DPZdN5n2.js.map +0 -1
  38. package/dist/AgoClient-wMVUQqCD.cjs +0 -976
  39. package/dist/AgoClient-wMVUQqCD.cjs.map +0 -1
  40. package/dist/angular/ago.service.d.ts +0 -98
  41. package/dist/angular/index.d.ts +0 -4
  42. package/dist/angular/provide.d.ts +0 -27
  43. package/dist/angular.cjs.map +0 -1
  44. package/dist/angular.js.map +0 -1
  45. package/dist/api/HttpClient.d.ts +0 -31
  46. package/dist/api/index.d.ts +0 -1
  47. package/dist/auto/createAgo.d.ts +0 -39
  48. package/dist/auto/index.d.ts +0 -1
  49. package/dist/client/AgoClient.d.ts +0 -169
  50. package/dist/client/errors.d.ts +0 -48
  51. package/dist/client/index.d.ts +0 -3
  52. package/dist/client/types.d.ts +0 -205
  53. package/dist/createMockClient-Ci_N2tH8.cjs +0 -104
  54. package/dist/createMockClient-Ci_N2tH8.cjs.map +0 -1
  55. package/dist/createMockClient-U0ae_AYy.js +0 -99
  56. package/dist/createMockClient-U0ae_AYy.js.map +0 -1
  57. package/dist/devtools/index.d.ts +0 -2
  58. package/dist/devtools/initDevPanel.d.ts +0 -15
  59. package/dist/devtools.cjs.map +0 -1
  60. package/dist/devtools.js.map +0 -1
  61. package/dist/functions/FunctionRegistry.d.ts +0 -41
  62. package/dist/functions/defineFunction.d.ts +0 -22
  63. package/dist/functions/index.d.ts +0 -2
  64. package/dist/functions/types.d.ts +0 -50
  65. package/dist/functions--c6lx3ic.cjs +0 -480
  66. package/dist/functions--c6lx3ic.cjs.map +0 -1
  67. package/dist/functions-C9F1dnmh.js +0 -398
  68. package/dist/functions-C9F1dnmh.js.map +0 -1
  69. package/dist/helpers/factory.d.ts +0 -20
  70. package/dist/helpers/index.d.ts +0 -1
  71. package/dist/index.cjs.map +0 -1
  72. package/dist/index.js.map +0 -1
  73. package/dist/react/components/ChatInput.d.ts +0 -12
  74. package/dist/react/components/ChatWidget.d.ts +0 -35
  75. package/dist/react/components/Markdown.d.ts +0 -12
  76. package/dist/react/components/Message.d.ts +0 -9
  77. package/dist/react/components/index.d.ts +0 -8
  78. package/dist/react/context/AgoContext.d.ts +0 -62
  79. package/dist/react/context/index.d.ts +0 -2
  80. package/dist/react/hooks/index.d.ts +0 -7
  81. package/dist/react/hooks/useAgo.d.ts +0 -14
  82. package/dist/react/hooks/useAgoContext.d.ts +0 -40
  83. package/dist/react/hooks/useAgoFunction.d.ts +0 -58
  84. package/dist/react/hooks/useAgoStore.d.ts +0 -17
  85. package/dist/react/hooks/useChat.d.ts +0 -45
  86. package/dist/react/hooks/useConversation.d.ts +0 -28
  87. package/dist/react/hooks/useMessages.d.ts +0 -26
  88. package/dist/react/index.d.ts +0 -24
  89. package/dist/react/testing.d.ts +0 -2
  90. package/dist/react.cjs.map +0 -1
  91. package/dist/react.js.map +0 -1
  92. package/dist/rolldown-runtime-BqCkTl7Q.cjs +0 -50
  93. package/dist/rolldown-runtime-CNZpIYwj.js +0 -33
  94. package/dist/state/ClientContextRegistry.d.ts +0 -64
  95. package/dist/state/createStore.d.ts +0 -30
  96. package/dist/streaming/SSEHandler.d.ts +0 -46
  97. package/dist/streaming/helpers.d.ts +0 -67
  98. package/dist/streaming/index.d.ts +0 -2
  99. package/dist/testing/createMockClient.d.ts +0 -42
  100. package/dist/testing/index.d.ts +0 -2
  101. package/dist/utils/eventEmitter.d.ts +0 -23
  102. package/dist/utils/index.d.ts +0 -2
  103. package/dist/utils/logger.d.ts +0 -14
  104. package/dist/vue/composables/useAgo.d.ts +0 -17
  105. package/dist/vue/composables/useAgoEvents.d.ts +0 -11
  106. package/dist/vue/composables/useAgoFunction.d.ts +0 -34
  107. package/dist/vue/composables/useAgoStore.d.ts +0 -18
  108. package/dist/vue/composables/useChat.d.ts +0 -251
  109. package/dist/vue/composables/useConversation.d.ts +0 -178
  110. package/dist/vue/composables/useMessages.d.ts +0 -89
  111. package/dist/vue/index.d.ts +0 -11
  112. package/dist/vue/plugin.d.ts +0 -16
  113. package/dist/vue/symbols.d.ts +0 -3
  114. package/dist/vue.cjs.map +0 -1
  115. package/dist/vue.js.map +0 -1
  116. package/dist/widget/index.d.ts +0 -1
package/dist/vue.js CHANGED
@@ -1,325 +1,183 @@
1
- import { t as AgoClient } from "./AgoClient-DPZdN5n2.js";
2
- import { computed, inject, onMounted, onScopeDispose, onUnmounted, ref, shallowRef } from "vue";
3
- //#region src/vue/symbols.ts
4
- var AGO_CLIENT_KEY = Symbol("ago-client");
5
- //#endregion
6
- //#region src/vue/plugin.ts
7
- /**
8
- * Vue plugin that provides an AgoClient to the entire app via inject/provide.
9
- *
10
- * ```ts
11
- * import { AgoPlugin } from "@useago/sdk/vue";
12
- *
13
- * app.use(AgoPlugin, { baseUrl: "https://YOUR-DOMAIN.useago.com" });
14
- * ```
15
- */
16
- var AgoPlugin = { install(app, options) {
17
- const client = new AgoClient(options);
18
- app.provide(AGO_CLIENT_KEY, client);
1
+ import { t as A } from "./AgoClient-DF7M2WAz.js";
2
+ import { computed as y, inject as F, onMounted as g, onScopeDispose as N, onUnmounted as I, ref as c, shallowRef as D } from "vue";
3
+ var L = /* @__PURE__ */ Symbol("ago-client"), b = { install(t, n) {
4
+ const e = new A(n);
5
+ t.provide(L, e);
19
6
  } };
20
- //#endregion
21
- //#region src/vue/composables/useAgo.ts
22
- /**
23
- * Get or create an AgoClient.
24
- *
25
- * - Without args: returns the client from `AgoPlugin` (throws if none).
26
- * - With config: creates a new client instance.
27
- *
28
- * ```ts
29
- * // From plugin
30
- * const client = useAgo();
31
- *
32
- * // Standalone
33
- * const client = useAgo({ baseUrl: "https://YOUR-DOMAIN.useago.com" });
34
- * ```
35
- */
36
- function useAgo(config) {
37
- if (config) return new AgoClient(config);
38
- const client = inject(AGO_CLIENT_KEY);
39
- if (!client) throw new Error("useAgo(): no AgoClient found. Either pass config or install AgoPlugin.");
40
- return client;
7
+ function m(t) {
8
+ if (t) return new A(t);
9
+ const n = F(L);
10
+ if (!n) throw new Error("useAgo(): no AgoClient found. Either pass config or install AgoPlugin.");
11
+ return n;
41
12
  }
42
- //#endregion
43
- //#region src/vue/composables/useMessages.ts
44
- /**
45
- * Composable to manage messages in a conversation.
46
- *
47
- * ```ts
48
- * const { messages, sendMessage, isLoading } = useMessages();
49
- * ```
50
- */
51
- function useMessages(options = {}) {
52
- const client = options.client ?? useAgo();
53
- const messages = ref([]);
54
- const conversationId = ref(options.conversationId);
55
- const isLoading = ref(false);
56
- const error = ref(null);
57
- const handleStart = (data) => {
58
- if (!conversationId.value) conversationId.value = data.conversationId;
59
- };
60
- const handleChunk = (data) => {
61
- const idx = messages.value.findIndex((m) => m.id === data.messageId);
62
- if (idx >= 0) messages.value[idx] = {
63
- ...messages.value[idx],
64
- content: messages.value[idx].content + data.content
65
- };
66
- };
67
- const handleComplete = (message) => {
68
- const idx = messages.value.findIndex((m) => m.id === message.id);
69
- if (idx >= 0) messages.value[idx] = message;
70
- else messages.value.push(message);
71
- isLoading.value = false;
72
- };
73
- const handleError = (data) => {
74
- error.value = new Error(data.error);
75
- isLoading.value = false;
76
- };
77
- onMounted(() => {
78
- client.on("message:start", handleStart);
79
- client.on("message:chunk", handleChunk);
80
- client.on("message:complete", handleComplete);
81
- client.on("message:error", handleError);
82
- });
83
- onUnmounted(() => {
84
- client.off("message:start", handleStart);
85
- client.off("message:chunk", handleChunk);
86
- client.off("message:complete", handleComplete);
87
- client.off("message:error", handleError);
88
- });
89
- async function sendMessage(content, files) {
90
- isLoading.value = true;
91
- error.value = null;
92
- const userMsg = {
93
- id: `temp-${Date.now()}`,
94
- conversationId: conversationId.value || "",
95
- content,
96
- role: "user",
97
- status: "DONE",
98
- createdAt: /* @__PURE__ */ new Date()
99
- };
100
- const assistantMsg = {
101
- id: `temp-assistant-${Date.now()}`,
102
- conversationId: conversationId.value || "",
103
- content: "",
104
- role: "assistant",
105
- status: "IN_PROGRESS",
106
- createdAt: /* @__PURE__ */ new Date()
107
- };
108
- messages.value.push(userMsg, assistantMsg);
109
- try {
110
- const response = await client.sendMessage(content, {
111
- conversationId: conversationId.value,
112
- files
113
- });
114
- if (response.conversationId && !conversationId.value) conversationId.value = response.conversationId;
115
- messages.value = messages.value.filter((m) => !m.id.startsWith("temp-"));
116
- const updatedUser = {
117
- ...userMsg,
118
- id: userMsg.id.replace("temp-", "user-"),
119
- conversationId: response.conversationId
120
- };
121
- if (!messages.value.some((m) => m.id === response.id)) messages.value.push(updatedUser, response);
122
- else messages.value.push(updatedUser);
123
- return response;
124
- } catch (err) {
125
- error.value = err instanceof Error ? err : /* @__PURE__ */ new Error("Failed to send");
126
- isLoading.value = false;
127
- messages.value = messages.value.filter((m) => !m.id.startsWith("temp-"));
128
- return null;
129
- }
130
- }
131
- function clearMessages() {
132
- messages.value = [];
133
- conversationId.value = void 0;
134
- error.value = null;
135
- }
136
- return {
137
- messages,
138
- isLoading,
139
- error,
140
- conversationId,
141
- sendMessage,
142
- clearMessages
143
- };
13
+ function S(t = {}) {
14
+ const n = t.client ?? m(), e = c([]), s = c(t.conversationId), r = c(!1), a = c(null), u = (o) => {
15
+ s.value || (s.value = o.conversationId);
16
+ }, f = (o) => {
17
+ const i = e.value.findIndex((v) => v.id === o.messageId);
18
+ i >= 0 && (e.value[i] = {
19
+ ...e.value[i],
20
+ content: e.value[i].content + o.content
21
+ });
22
+ }, h = (o) => {
23
+ const i = e.value.findIndex((v) => v.id === o.id);
24
+ i >= 0 ? e.value[i] = o : e.value.push(o), r.value = !1;
25
+ }, C = (o) => {
26
+ a.value = new Error(o.error), r.value = !1;
27
+ };
28
+ g(() => {
29
+ n.on("message:start", u), n.on("message:chunk", f), n.on("message:complete", h), n.on("message:error", C);
30
+ }), I(() => {
31
+ n.off("message:start", u), n.off("message:chunk", f), n.off("message:complete", h), n.off("message:error", C);
32
+ });
33
+ async function d(o, i) {
34
+ r.value = !0, a.value = null;
35
+ const v = {
36
+ id: `temp-${Date.now()}`,
37
+ conversationId: s.value || "",
38
+ content: o,
39
+ role: "user",
40
+ status: "DONE",
41
+ createdAt: /* @__PURE__ */ new Date()
42
+ }, M = {
43
+ id: `temp-assistant-${Date.now()}`,
44
+ conversationId: s.value || "",
45
+ content: "",
46
+ role: "assistant",
47
+ status: "IN_PROGRESS",
48
+ createdAt: /* @__PURE__ */ new Date()
49
+ };
50
+ e.value.push(v, M);
51
+ try {
52
+ const l = await n.sendMessage(o, {
53
+ conversationId: s.value,
54
+ files: i
55
+ });
56
+ l.conversationId && !s.value && (s.value = l.conversationId), e.value = e.value.filter((E) => !E.id.startsWith("temp-"));
57
+ const w = {
58
+ ...v,
59
+ id: v.id.replace("temp-", "user-"),
60
+ conversationId: l.conversationId
61
+ };
62
+ return e.value.some((E) => E.id === l.id) ? e.value.push(w) : e.value.push(w, l), l;
63
+ } catch (l) {
64
+ return a.value = l instanceof Error ? l : /* @__PURE__ */ new Error("Failed to send"), r.value = !1, e.value = e.value.filter((w) => !w.id.startsWith("temp-")), null;
65
+ }
66
+ }
67
+ function p() {
68
+ e.value = [], s.value = void 0, a.value = null;
69
+ }
70
+ return {
71
+ messages: e,
72
+ isLoading: r,
73
+ error: a,
74
+ conversationId: s,
75
+ sendMessage: d,
76
+ clearMessages: p
77
+ };
144
78
  }
145
- //#endregion
146
- //#region src/vue/composables/useConversation.ts
147
- /**
148
- * Composable to manage conversations.
149
- *
150
- * ```ts
151
- * const { conversations, selectConversation } = useConversation();
152
- * ```
153
- */
154
- function useConversation(options = {}) {
155
- const client = options.client ?? useAgo();
156
- const autoLoad = options.autoLoad ?? true;
157
- const conversations = ref([]);
158
- const currentConversation = ref(null);
159
- const isLoading = ref(false);
160
- const error = ref(null);
161
- async function refreshConversations() {
162
- isLoading.value = true;
163
- error.value = null;
164
- try {
165
- conversations.value = await client.getConversations();
166
- } catch (err) {
167
- error.value = err instanceof Error ? err : /* @__PURE__ */ new Error("Failed to load conversations");
168
- } finally {
169
- isLoading.value = false;
170
- }
171
- }
172
- async function selectConversation(id) {
173
- isLoading.value = true;
174
- error.value = null;
175
- try {
176
- currentConversation.value = await client.getConversation(id);
177
- } catch (err) {
178
- error.value = err instanceof Error ? err : /* @__PURE__ */ new Error("Failed to load conversation");
179
- } finally {
180
- isLoading.value = false;
181
- }
182
- }
183
- function startNewConversation() {
184
- currentConversation.value = null;
185
- }
186
- onMounted(() => {
187
- if (autoLoad) refreshConversations();
188
- });
189
- return {
190
- conversations,
191
- currentConversation,
192
- isLoading,
193
- error,
194
- selectConversation,
195
- startNewConversation,
196
- refreshConversations
197
- };
79
+ function x(t = {}) {
80
+ const n = t.client ?? m(), e = t.autoLoad ?? !0, s = c([]), r = c(null), a = c(!1), u = c(null);
81
+ async function f() {
82
+ a.value = !0, u.value = null;
83
+ try {
84
+ s.value = await n.getConversations();
85
+ } catch (d) {
86
+ u.value = d instanceof Error ? d : /* @__PURE__ */ new Error("Failed to load conversations");
87
+ } finally {
88
+ a.value = !1;
89
+ }
90
+ }
91
+ async function h(d) {
92
+ a.value = !0, u.value = null;
93
+ try {
94
+ r.value = await n.getConversation(d);
95
+ } catch (p) {
96
+ u.value = p instanceof Error ? p : /* @__PURE__ */ new Error("Failed to load conversation");
97
+ } finally {
98
+ a.value = !1;
99
+ }
100
+ }
101
+ function C() {
102
+ r.value = null;
103
+ }
104
+ return g(() => {
105
+ e && f();
106
+ }), {
107
+ conversations: s,
108
+ currentConversation: r,
109
+ isLoading: a,
110
+ error: u,
111
+ selectConversation: h,
112
+ startNewConversation: C,
113
+ refreshConversations: f
114
+ };
198
115
  }
199
- //#endregion
200
- //#region src/vue/composables/useChat.ts
201
- /**
202
- * All-in-one composable combining messages + conversations.
203
- *
204
- * ```ts
205
- * const { messages, sendMessage, conversations, selectConversation } = useChat();
206
- * ```
207
- */
208
- function useChat(options = {}) {
209
- const msgResult = useMessages({
210
- client: options.client,
211
- conversationId: options.conversationId
212
- });
213
- const convResult = useConversation({
214
- client: options.client,
215
- autoLoad: options.autoLoad
216
- });
217
- const error = computed(() => msgResult.error.value || convResult.error.value);
218
- return {
219
- messages: msgResult.messages,
220
- isLoading: msgResult.isLoading,
221
- error,
222
- sendMessage: msgResult.sendMessage,
223
- clearMessages: msgResult.clearMessages,
224
- conversationId: msgResult.conversationId,
225
- conversations: convResult.conversations,
226
- currentConversation: convResult.currentConversation,
227
- isConversationsLoading: convResult.isLoading,
228
- selectConversation: convResult.selectConversation,
229
- startNewConversation: convResult.startNewConversation,
230
- refreshConversations: convResult.refreshConversations
231
- };
116
+ function k(t = {}) {
117
+ const n = S({
118
+ client: t.client,
119
+ conversationId: t.conversationId
120
+ }), e = x({
121
+ client: t.client,
122
+ autoLoad: t.autoLoad
123
+ }), s = y(() => n.error.value || e.error.value);
124
+ return {
125
+ messages: n.messages,
126
+ isLoading: n.isLoading,
127
+ error: s,
128
+ sendMessage: n.sendMessage,
129
+ clearMessages: n.clearMessages,
130
+ conversationId: n.conversationId,
131
+ conversations: e.conversations,
132
+ currentConversation: e.currentConversation,
133
+ isConversationsLoading: e.isLoading,
134
+ selectConversation: e.selectConversation,
135
+ startNewConversation: e.startNewConversation,
136
+ refreshConversations: e.refreshConversations
137
+ };
232
138
  }
233
- //#endregion
234
- //#region src/vue/composables/useAgoFunction.ts
235
- /**
236
- * Register a client-side function with auto-cleanup on unmount.
237
- *
238
- * ```ts
239
- * useAgoFunction("showToast", {
240
- * description: "Show a toast",
241
- * parameters: { type: "object", properties: { message: { type: "string" } } },
242
- * handler: async (args) => { toast(args.message); return { shown: true }; },
243
- * });
244
- * ```
245
- */
246
- function useAgoFunction(name, options) {
247
- const client = useAgo();
248
- onMounted(() => {
249
- client.registerFunction(name, options.handler, {
250
- description: options.description,
251
- parameters: options.parameters
252
- });
253
- });
254
- onUnmounted(() => {
255
- client.unregisterFunction(name);
256
- });
139
+ function O(t, n) {
140
+ const e = m();
141
+ g(() => {
142
+ e.registerFunction(t, n.handler, {
143
+ description: n.description,
144
+ parameters: n.parameters
145
+ });
146
+ }), I(() => {
147
+ e.unregisterFunction(t);
148
+ });
257
149
  }
258
- /**
259
- * Register navigation routes with auto-cleanup on unmount.
260
- * Works with vue-router's `useRouter().push`.
261
- *
262
- * ```ts
263
- * const router = useRouter();
264
- * useAgoNavigation((path) => router.push(path), [
265
- * { name: "dashboard", path: "/dashboard", description: "Main dashboard" },
266
- * ]);
267
- * ```
268
- */
269
- function useAgoNavigation(navigate, routes) {
270
- const client = useAgo();
271
- onMounted(() => {
272
- client.registerNavigationFunction(navigate, routes);
273
- });
274
- onUnmounted(() => {
275
- client.unregisterFunction("navigateToPage");
276
- });
150
+ function _(t, n) {
151
+ const e = m();
152
+ g(() => {
153
+ e.registerNavigationFunction(t, n);
154
+ }), I(() => {
155
+ e.unregisterFunction("navigateToPage");
156
+ });
277
157
  }
278
- //#endregion
279
- //#region src/vue/composables/useAgoEvents.ts
280
- /**
281
- * Subscribe to AGO client events with auto-cleanup on unmount.
282
- *
283
- * ```ts
284
- * useAgoEvents("message:complete", (msg) => {
285
- * console.log("Got message:", msg.content);
286
- * });
287
- * ```
288
- */
289
- function useAgoEvents(event, handler) {
290
- const client = useAgo();
291
- onMounted(() => {
292
- client.on(event, handler);
293
- });
294
- onUnmounted(() => {
295
- client.off(event, handler);
296
- });
158
+ function G(t, n) {
159
+ const e = m();
160
+ g(() => {
161
+ e.on(t, n);
162
+ }), I(() => {
163
+ e.off(t, n);
164
+ });
297
165
  }
298
- //#endregion
299
- //#region src/vue/composables/useAgoStore.ts
300
- /**
301
- * Read a framework-agnostic AGO store (`createStore`) as a reactive Vue ref.
302
- *
303
- * The ref's `.value` updates on every `store.set(...)`. Mutate through the store,
304
- * not the ref. A `shallowRef` is used because the store replaces its value
305
- * wholesale, so deep reactivity would be wasted work.
306
- *
307
- * ```ts
308
- * const cart = createStore({ items: [] as string[] });
309
- *
310
- * // in setup():
311
- * const state = useAgoStore(cart);
312
- * // template: {{ state.items.length }}
313
- * ```
314
- */
315
- function useAgoStore(store) {
316
- const state = shallowRef(store.get());
317
- onScopeDispose(store.subscribe((next) => {
318
- state.value = next;
319
- }));
320
- return state;
166
+ function T(t) {
167
+ const n = D(t.get());
168
+ return N(t.subscribe((e) => {
169
+ n.value = e;
170
+ })), n;
321
171
  }
322
- //#endregion
323
- export { AGO_CLIENT_KEY, AgoPlugin, useAgo, useAgoEvents, useAgoFunction, useAgoNavigation, useAgoStore, useChat, useConversation, useMessages };
324
-
325
- //# sourceMappingURL=vue.js.map
172
+ export {
173
+ L as AGO_CLIENT_KEY,
174
+ b as AgoPlugin,
175
+ m as useAgo,
176
+ G as useAgoEvents,
177
+ O as useAgoFunction,
178
+ _ as useAgoNavigation,
179
+ T as useAgoStore,
180
+ k as useChat,
181
+ x as useConversation,
182
+ S as useMessages
183
+ };
@@ -1,43 +1,41 @@
1
- /**
2
- * Widget configuration types.
3
- *
4
- * These types describe the `window.AGO` configuration object
5
- * used by the embeddable chat widget snippet.
6
- *
7
- * @example
8
- * ```ts
9
- * import type { AgoWidgetConfig } from "@useago/sdk/widget";
10
- * ```
11
- */
12
- export interface AgoWidgetColors {
13
- button?: string;
14
- header?: string;
15
- agentMessage?: string;
16
- agentMessageFont?: string;
17
- background?: string;
18
- font?: string;
19
- userMessage?: string;
20
- userMessageFont?: string;
21
- }
22
- export interface AgoWidgetConfig {
23
- basepath: string;
24
- widgetApiKey: string;
25
- defaultAgent?: string;
26
- email?: string;
27
- title?: string;
28
- icon?: string;
29
- prompt?: string;
30
- notifications?: boolean;
31
- notificationMessage?: string;
32
- colors?: AgoWidgetColors;
33
- hideFooter?: boolean;
34
- jwt?: string;
35
- authToken?: string;
36
- permission?: string;
37
- metadata?: Record<string, unknown>;
38
- }
39
- declare global {
40
- interface Window {
41
- AGO: AgoWidgetConfig;
42
- }
43
- }
1
+ /**
2
+ * Widget configuration types.
3
+ *
4
+ * These types describe the `window.AGO` configuration object
5
+ * used by the embeddable chat widget snippet.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * import type { AgoWidgetConfig } from "@useago/sdk/widget";
10
+ * ```
11
+ */
12
+ export declare interface AgoWidgetColors {
13
+ button?: string;
14
+ header?: string;
15
+ agentMessage?: string;
16
+ agentMessageFont?: string;
17
+ background?: string;
18
+ font?: string;
19
+ userMessage?: string;
20
+ userMessageFont?: string;
21
+ }
22
+
23
+ export declare interface AgoWidgetConfig {
24
+ basepath: string;
25
+ widgetApiKey: string;
26
+ defaultAgent?: string;
27
+ email?: string;
28
+ title?: string;
29
+ icon?: string;
30
+ prompt?: string;
31
+ notifications?: boolean;
32
+ notificationMessage?: string;
33
+ colors?: AgoWidgetColors;
34
+ hideFooter?: boolean;
35
+ jwt?: string;
36
+ authToken?: string;
37
+ permission?: string;
38
+ metadata?: Record<string, unknown>;
39
+ }
40
+
41
+ export { }
package/dist/widget.d.ts CHANGED
@@ -1,2 +1,41 @@
1
- export * from './widget/index'
2
- export {}
1
+ /**
2
+ * Widget configuration types.
3
+ *
4
+ * These types describe the `window.AGO` configuration object
5
+ * used by the embeddable chat widget snippet.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * import type { AgoWidgetConfig } from "@useago/sdk/widget";
10
+ * ```
11
+ */
12
+ export declare interface AgoWidgetColors {
13
+ button?: string;
14
+ header?: string;
15
+ agentMessage?: string;
16
+ agentMessageFont?: string;
17
+ background?: string;
18
+ font?: string;
19
+ userMessage?: string;
20
+ userMessageFont?: string;
21
+ }
22
+
23
+ export declare interface AgoWidgetConfig {
24
+ basepath: string;
25
+ widgetApiKey: string;
26
+ defaultAgent?: string;
27
+ email?: string;
28
+ title?: string;
29
+ icon?: string;
30
+ prompt?: string;
31
+ notifications?: boolean;
32
+ notificationMessage?: string;
33
+ colors?: AgoWidgetColors;
34
+ hideFooter?: boolean;
35
+ jwt?: string;
36
+ authToken?: string;
37
+ permission?: string;
38
+ metadata?: Record<string, unknown>;
39
+ }
40
+
41
+ export { }