autoverse-fyp 1.0.2 → 1.0.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.
- package/dist/browser.mjs +2 -3
- package/dist/index.d.mts +1 -60
- package/dist/index.d.ts +1 -60
- package/dist/index.js +3 -1115
- package/dist/index.mjs +3 -1102
- package/package.json +51 -62
package/dist/browser.mjs
CHANGED
|
@@ -229,13 +229,12 @@ function getWidgetHTML(serverUrl, botId) {
|
|
|
229
229
|
var setupView = document.createElement('div');
|
|
230
230
|
setupView.id = 'av-setup';
|
|
231
231
|
setupView.innerHTML = [
|
|
232
|
-
'<div class="av-logo">\u{1F916}</div>',
|
|
233
232
|
'<h3>Welcome to Autoverse</h3>',
|
|
234
233
|
'<p>Connect your AI customer service assistant to get started.</p>',
|
|
235
234
|
'<input id="av-bot-input" type="text" placeholder="Enter your Bot ID" autocomplete="off" spellcheck="false">',
|
|
236
235
|
'<button class="av-connect-btn" id="av-connect-btn">\u{1F517} Connect Bot</button>',
|
|
237
236
|
'<div class="av-error" id="av-setup-error"></div>',
|
|
238
|
-
'<div class="av-help">Get your Bot ID from the<br><a href="
|
|
237
|
+
'<div class="av-help">Get your Bot ID from the<br><a href="https://autoverse-nmbw.vercel.app" target="_blank">Autoverse Dashboard \u2192</a></div>'
|
|
239
238
|
].join('');
|
|
240
239
|
|
|
241
240
|
var chatView = document.createElement('div');
|
|
@@ -555,7 +554,7 @@ function getWidgetHTML(serverUrl, botId) {
|
|
|
555
554
|
})();
|
|
556
555
|
`;
|
|
557
556
|
}
|
|
558
|
-
var AUTOVERSE_CLOUD_URL = "https://
|
|
557
|
+
var AUTOVERSE_CLOUD_URL = "https://autoverse-production-be8b.up.railway.app";
|
|
559
558
|
function initWidget(options) {
|
|
560
559
|
try {
|
|
561
560
|
let inject2 = function() {
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import * as express_serve_static_core from 'express-serve-static-core';
|
|
2
|
-
import { Router } from 'express';
|
|
3
|
-
|
|
4
1
|
/**
|
|
5
2
|
* Autoverse Widget — Self-contained chat widget with setup flow.
|
|
6
3
|
* When no botId is provided, shows a setup screen asking for the Bot ID.
|
|
@@ -26,60 +23,4 @@ declare function initWidget(options?: {
|
|
|
26
23
|
botId?: string;
|
|
27
24
|
}): void;
|
|
28
25
|
|
|
29
|
-
|
|
30
|
-
role: "user" | "assistant";
|
|
31
|
-
content: string;
|
|
32
|
-
timestamp: number;
|
|
33
|
-
}
|
|
34
|
-
interface Session {
|
|
35
|
-
sessionId: string;
|
|
36
|
-
botId: string;
|
|
37
|
-
createdAt: string;
|
|
38
|
-
updatedAt: string;
|
|
39
|
-
messages: ChatMessage[];
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Initialize / attach the AI agent to a target website
|
|
44
|
-
*/
|
|
45
|
-
declare function runAgent(url: string, botId?: string, sessionId?: string): Promise<{
|
|
46
|
-
status: string;
|
|
47
|
-
items: number;
|
|
48
|
-
history: any[];
|
|
49
|
-
}>;
|
|
50
|
-
/**
|
|
51
|
-
* Process a user chat message using RAG and Groq
|
|
52
|
-
*/
|
|
53
|
-
declare function processChat(botId: string | undefined, url: string, query: string, sessionId?: string, pageUrl?: string): Promise<{
|
|
54
|
-
answer: string;
|
|
55
|
-
sessionId: string;
|
|
56
|
-
}>;
|
|
57
|
-
/**
|
|
58
|
-
* Retrieve session history for a specific Bot ID
|
|
59
|
-
*/
|
|
60
|
-
declare function getHistory(botId: string): Session[];
|
|
61
|
-
|
|
62
|
-
interface AutoverseConfig {
|
|
63
|
-
groqModel?: string;
|
|
64
|
-
groqBaseUrl?: string;
|
|
65
|
-
groqApiKey?: string;
|
|
66
|
-
language?: "en" | "ur" | "both";
|
|
67
|
-
verbose?: boolean;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
interface ServerConfig extends AutoverseConfig {
|
|
71
|
-
port?: number;
|
|
72
|
-
publicUrl?: string;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Express middleware — just add `app.use(autoverse())` and the chat widget
|
|
76
|
-
* auto-appears on every page. No script tags needed.
|
|
77
|
-
*/
|
|
78
|
-
declare function autoverse(config?: AutoverseConfig): Router;
|
|
79
|
-
/**
|
|
80
|
-
* Standalone server — serves both the API and admin dashboard.
|
|
81
|
-
* Deploy this as a single service and it handles everything.
|
|
82
|
-
*/
|
|
83
|
-
declare function startServer(config?: ServerConfig): Promise<express_serve_static_core.Express>;
|
|
84
|
-
|
|
85
|
-
export { autoverse, getHistory, getWidgetHTML, initWidget, processChat, runAgent, startServer };
|
|
26
|
+
export { getWidgetHTML, initWidget };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import * as express_serve_static_core from 'express-serve-static-core';
|
|
2
|
-
import { Router } from 'express';
|
|
3
|
-
|
|
4
1
|
/**
|
|
5
2
|
* Autoverse Widget — Self-contained chat widget with setup flow.
|
|
6
3
|
* When no botId is provided, shows a setup screen asking for the Bot ID.
|
|
@@ -26,60 +23,4 @@ declare function initWidget(options?: {
|
|
|
26
23
|
botId?: string;
|
|
27
24
|
}): void;
|
|
28
25
|
|
|
29
|
-
|
|
30
|
-
role: "user" | "assistant";
|
|
31
|
-
content: string;
|
|
32
|
-
timestamp: number;
|
|
33
|
-
}
|
|
34
|
-
interface Session {
|
|
35
|
-
sessionId: string;
|
|
36
|
-
botId: string;
|
|
37
|
-
createdAt: string;
|
|
38
|
-
updatedAt: string;
|
|
39
|
-
messages: ChatMessage[];
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Initialize / attach the AI agent to a target website
|
|
44
|
-
*/
|
|
45
|
-
declare function runAgent(url: string, botId?: string, sessionId?: string): Promise<{
|
|
46
|
-
status: string;
|
|
47
|
-
items: number;
|
|
48
|
-
history: any[];
|
|
49
|
-
}>;
|
|
50
|
-
/**
|
|
51
|
-
* Process a user chat message using RAG and Groq
|
|
52
|
-
*/
|
|
53
|
-
declare function processChat(botId: string | undefined, url: string, query: string, sessionId?: string, pageUrl?: string): Promise<{
|
|
54
|
-
answer: string;
|
|
55
|
-
sessionId: string;
|
|
56
|
-
}>;
|
|
57
|
-
/**
|
|
58
|
-
* Retrieve session history for a specific Bot ID
|
|
59
|
-
*/
|
|
60
|
-
declare function getHistory(botId: string): Session[];
|
|
61
|
-
|
|
62
|
-
interface AutoverseConfig {
|
|
63
|
-
groqModel?: string;
|
|
64
|
-
groqBaseUrl?: string;
|
|
65
|
-
groqApiKey?: string;
|
|
66
|
-
language?: "en" | "ur" | "both";
|
|
67
|
-
verbose?: boolean;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
interface ServerConfig extends AutoverseConfig {
|
|
71
|
-
port?: number;
|
|
72
|
-
publicUrl?: string;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Express middleware — just add `app.use(autoverse())` and the chat widget
|
|
76
|
-
* auto-appears on every page. No script tags needed.
|
|
77
|
-
*/
|
|
78
|
-
declare function autoverse(config?: AutoverseConfig): Router;
|
|
79
|
-
/**
|
|
80
|
-
* Standalone server — serves both the API and admin dashboard.
|
|
81
|
-
* Deploy this as a single service and it handles everything.
|
|
82
|
-
*/
|
|
83
|
-
declare function startServer(config?: ServerConfig): Promise<express_serve_static_core.Express>;
|
|
84
|
-
|
|
85
|
-
export { autoverse, getHistory, getWidgetHTML, initWidget, processChat, runAgent, startServer };
|
|
26
|
+
export { getWidgetHTML, initWidget };
|