smoothagent 0.1.0
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/index.d.ts +112 -0
- package/index.js +118 -0
- package/index.mjs +209 -0
- package/package.json +41 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
export interface SmoothAgentOptions {
|
|
2
|
+
/** User JWT token (for chat operations) */
|
|
3
|
+
token?: string;
|
|
4
|
+
/** Admin JWT token (for project/user management) */
|
|
5
|
+
adminToken?: string;
|
|
6
|
+
/** Worker URL. Defaults to window.location.origin or https://agent.smoothcodes.com */
|
|
7
|
+
workerUrl?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface PromptOptions {
|
|
11
|
+
/** Called for each text delta */
|
|
12
|
+
onDelta?: (delta: string, fullText: string) => void;
|
|
13
|
+
/** Called when a tool is invoked */
|
|
14
|
+
onToolCall?: (info: { toolCallId: string; toolName: string }) => void;
|
|
15
|
+
/** Called when a tool returns a result */
|
|
16
|
+
onToolResult?: (info: { toolCallId: string; result: unknown }) => void;
|
|
17
|
+
/** Called when streaming finishes */
|
|
18
|
+
onFinish?: (info: { text: string; reason?: string }) => void;
|
|
19
|
+
/** Called on error */
|
|
20
|
+
onError?: (error: string) => void;
|
|
21
|
+
/** Override config for this prompt */
|
|
22
|
+
config?: Record<string, unknown>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface ChatOptions {
|
|
26
|
+
/** Override config */
|
|
27
|
+
config?: Record<string, unknown>;
|
|
28
|
+
onDelta?: (delta: string, fullText: string) => void;
|
|
29
|
+
onFinish?: (info: { text: string }) => void;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface Chat {
|
|
33
|
+
id: string;
|
|
34
|
+
configId?: string;
|
|
35
|
+
userId?: string;
|
|
36
|
+
title?: string;
|
|
37
|
+
messages?: Array<{ role: string; content: string }>;
|
|
38
|
+
createdAt?: string;
|
|
39
|
+
updatedAt?: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface Project {
|
|
43
|
+
id: string;
|
|
44
|
+
mcpUrl?: string;
|
|
45
|
+
llmProvider?: string;
|
|
46
|
+
llmModel?: string;
|
|
47
|
+
themeName?: string;
|
|
48
|
+
themeColor?: string;
|
|
49
|
+
plan?: string;
|
|
50
|
+
createdAt?: string;
|
|
51
|
+
updatedAt?: string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface PromptResult {
|
|
55
|
+
text: string;
|
|
56
|
+
promptId?: string | null;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface AuthResult {
|
|
60
|
+
token: string;
|
|
61
|
+
devId: string;
|
|
62
|
+
email: string;
|
|
63
|
+
plan?: string;
|
|
64
|
+
chatToken?: string;
|
|
65
|
+
verified?: boolean;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface UserTokenResult {
|
|
69
|
+
token: string;
|
|
70
|
+
configId: string;
|
|
71
|
+
userId: string;
|
|
72
|
+
expiresIn: string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export declare class SmoothAgent {
|
|
76
|
+
token: string | null;
|
|
77
|
+
adminToken: string | null;
|
|
78
|
+
workerUrl: string;
|
|
79
|
+
|
|
80
|
+
constructor(options?: SmoothAgentOptions);
|
|
81
|
+
|
|
82
|
+
// Auth
|
|
83
|
+
signup(email: string, password: string): Promise<AuthResult>;
|
|
84
|
+
login(email: string, password: string): Promise<AuthResult>;
|
|
85
|
+
me(): Promise<{ id: string; email: string; plan: string; createdAt: string; configsCount: number }>;
|
|
86
|
+
|
|
87
|
+
// Users
|
|
88
|
+
createUser(userId: string, options?: { configId?: string; plan?: string }): Promise<UserTokenResult>;
|
|
89
|
+
|
|
90
|
+
// Chats
|
|
91
|
+
createChat(title?: string): Promise<Chat>;
|
|
92
|
+
listChats(): Promise<Chat[]>;
|
|
93
|
+
getChat(chatId: string): Promise<Chat>;
|
|
94
|
+
deleteChat(chatId: string): Promise<{ cancelled: number }>;
|
|
95
|
+
|
|
96
|
+
// Prompts (streaming)
|
|
97
|
+
prompt(chatId: string, content: string, options?: PromptOptions): Promise<PromptResult>;
|
|
98
|
+
|
|
99
|
+
// Stateless chat (no history)
|
|
100
|
+
chat(messages: Array<{ role: string; content: string }>, options?: ChatOptions): Promise<PromptResult>;
|
|
101
|
+
|
|
102
|
+
// Projects (admin/dev)
|
|
103
|
+
createProject(data: { mcpUrl: string; llmProvider: string; llmApiKey: string; [key: string]: unknown }): Promise<{ id: string }>;
|
|
104
|
+
listProjects(): Promise<Project[]>;
|
|
105
|
+
updateProject(id: string, data: Partial<Project>): Promise<{ ok: boolean }>;
|
|
106
|
+
deleteProject(id: string): Promise<{ ok: boolean }>;
|
|
107
|
+
|
|
108
|
+
// Usage
|
|
109
|
+
getUsage(configId: string, days?: number): Promise<{ days: unknown[]; totals: Record<string, number>; period: string }>;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export default SmoothAgent;
|
package/index.js
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
class SmoothAgent {
|
|
4
|
+
constructor({ token, adminToken, workerUrl } = {}) {
|
|
5
|
+
this.token = token || null;
|
|
6
|
+
this.adminToken = adminToken || null;
|
|
7
|
+
this.workerUrl = workerUrl || (typeof window !== 'undefined' ? window.location?.origin : null) || 'https://agent.smoothcodes.com';
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
async signup(email, password) { return this._post('/auth/signup', { email, password }); }
|
|
11
|
+
async login(email, password) { return this._post('/auth/login', { email, password }); }
|
|
12
|
+
async me() { return this._get('/auth/me'); }
|
|
13
|
+
|
|
14
|
+
async createUser(userId, { configId, plan } = {}) {
|
|
15
|
+
const cfgId = configId || this._configIdFromToken();
|
|
16
|
+
if (!cfgId) throw new Error('configId required');
|
|
17
|
+
return this._post(`/dashboard/configs/${cfgId}/token`, { userId, plan });
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
async createChat(title) { return this._post('/chats', title ? { title } : {}); }
|
|
21
|
+
async listChats() { const d = await this._get('/chats'); return d.chats || []; }
|
|
22
|
+
async getChat(chatId) { return this._get(`/chats/${chatId}`); }
|
|
23
|
+
async deleteChat(chatId) { return this._fetch('DELETE', `/chats/${chatId}/prompt`); }
|
|
24
|
+
|
|
25
|
+
async prompt(chatId, content, opts = {}) {
|
|
26
|
+
const body = { content };
|
|
27
|
+
if (opts.config) body.config = opts.config;
|
|
28
|
+
const res = await fetch(`${this.workerUrl}/chats/${chatId}/prompt`, {
|
|
29
|
+
method: 'POST', headers: this._headers(), body: JSON.stringify(body),
|
|
30
|
+
});
|
|
31
|
+
if (!res.ok) { const e = await res.json().catch(() => ({})); throw new Error(e.error || `HTTP ${res.status}`); }
|
|
32
|
+
return this._consumeStream(res, opts);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
async chat(messages, opts = {}) {
|
|
36
|
+
const body = { messages };
|
|
37
|
+
if (opts.config) body.config = opts.config;
|
|
38
|
+
const res = await fetch(`${this.workerUrl}/chat`, {
|
|
39
|
+
method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body),
|
|
40
|
+
});
|
|
41
|
+
if (!res.ok) throw new Error(`HTTP ${res.status}`);
|
|
42
|
+
return this._consumeStream(res, opts);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
async createProject(data) { return this._post('/dashboard/configs', data); }
|
|
46
|
+
async listProjects() { const d = await this._get('/dashboard/configs'); return d.configs || []; }
|
|
47
|
+
async updateProject(id, data) { return this._fetch('PUT', `/dashboard/configs/${id}`, data); }
|
|
48
|
+
async deleteProject(id) { return this._fetch('DELETE', `/dashboard/configs/${id}`); }
|
|
49
|
+
async getUsage(configId, days = 7) { return this._get(`/dashboard/usage?configId=${configId}&days=${days}`); }
|
|
50
|
+
|
|
51
|
+
_headers() {
|
|
52
|
+
const h = { 'Content-Type': 'application/json' };
|
|
53
|
+
const t = this.token || this.adminToken;
|
|
54
|
+
if (t) h['Authorization'] = `Bearer ${t}`;
|
|
55
|
+
return h;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
async _get(path) {
|
|
59
|
+
const res = await fetch(`${this.workerUrl}${path}`, { headers: this._headers() });
|
|
60
|
+
if (!res.ok) { const e = await res.json().catch(() => ({})); throw new Error(e.error || `HTTP ${res.status}`); }
|
|
61
|
+
return res.json();
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
async _post(path, body) {
|
|
65
|
+
const res = await fetch(`${this.workerUrl}${path}`, {
|
|
66
|
+
method: 'POST', headers: this._headers(), body: JSON.stringify(body || {}),
|
|
67
|
+
});
|
|
68
|
+
if (!res.ok) { const e = await res.json().catch(() => ({})); throw new Error(e.error || `HTTP ${res.status}`); }
|
|
69
|
+
return res.json();
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
async _fetch(method, path, body) {
|
|
73
|
+
const opts = { method, headers: this._headers() };
|
|
74
|
+
if (body) opts.body = JSON.stringify(body);
|
|
75
|
+
const res = await fetch(`${this.workerUrl}${path}`, opts);
|
|
76
|
+
if (!res.ok) { const e = await res.json().catch(() => ({})); throw new Error(e.error || `HTTP ${res.status}`); }
|
|
77
|
+
return res.json();
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
async _consumeStream(res, { onDelta, onToolCall, onToolResult, onFinish, onError } = {}) {
|
|
81
|
+
let fullText = '';
|
|
82
|
+
const reader = res.body.pipeThrough(new TextDecoderStream()).getReader();
|
|
83
|
+
let buffer = '';
|
|
84
|
+
while (true) {
|
|
85
|
+
const { done, value } = await reader.read();
|
|
86
|
+
if (done) break;
|
|
87
|
+
buffer += value;
|
|
88
|
+
const lines = buffer.split('\n');
|
|
89
|
+
buffer = lines.pop() || '';
|
|
90
|
+
for (const line of lines) {
|
|
91
|
+
const trimmed = line.trim();
|
|
92
|
+
if (!trimmed.startsWith('data: ')) continue;
|
|
93
|
+
const payload = trimmed.slice(6);
|
|
94
|
+
if (payload === '[DONE]') continue;
|
|
95
|
+
try {
|
|
96
|
+
const data = JSON.parse(payload);
|
|
97
|
+
switch (data.type) {
|
|
98
|
+
case 'text-delta': fullText += data.delta; if (onDelta) onDelta(data.delta, fullText); break;
|
|
99
|
+
case 'tool-input-start': case 'tool-call': if (onToolCall) onToolCall({ toolCallId: data.toolCallId, toolName: data.toolName }); break;
|
|
100
|
+
case 'tool-output-available': case 'tool-result': if (onToolResult) onToolResult({ toolCallId: data.toolCallId, result: data.result || data.output }); break;
|
|
101
|
+
case 'error': if (onError) onError(data.errorText || data.message); break;
|
|
102
|
+
case 'finish': if (onFinish) onFinish({ text: fullText, reason: data.finishReason }); break;
|
|
103
|
+
}
|
|
104
|
+
} catch {}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return { text: fullText, promptId: res.headers.get('X-Prompt-Id') };
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
_configIdFromToken() {
|
|
111
|
+
if (!this.adminToken) return null;
|
|
112
|
+
try { return JSON.parse(atob(this.adminToken.split('.')[1])).configId || null; } catch { return null; }
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
module.exports = { SmoothAgent };
|
|
117
|
+
module.exports.SmoothAgent = SmoothAgent;
|
|
118
|
+
module.exports.default = SmoothAgent;
|
package/index.mjs
ADDED
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SmoothAgent SDK
|
|
3
|
+
* Zero deps. Works in browser and Node.js.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* import { SmoothAgent } from 'smoothagent';
|
|
7
|
+
*
|
|
8
|
+
* const agent = new SmoothAgent({ token: 'your_jwt_token' });
|
|
9
|
+
* const chat = await agent.createChat();
|
|
10
|
+
* const { text } = await agent.prompt(chat.id, 'Hello!', {
|
|
11
|
+
* onDelta: (delta) => process.stdout.write(delta),
|
|
12
|
+
* });
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
export class SmoothAgent {
|
|
16
|
+
constructor({ token, adminToken, workerUrl } = {}) {
|
|
17
|
+
this.token = token || null;
|
|
18
|
+
this.adminToken = adminToken || null;
|
|
19
|
+
this.workerUrl = workerUrl || (typeof window !== 'undefined' ? window.location?.origin : null) || 'https://agent.smoothcodes.com';
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// === Auth ===
|
|
23
|
+
|
|
24
|
+
async signup(email, password) {
|
|
25
|
+
return this._post('/auth/signup', { email, password });
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
async login(email, password) {
|
|
29
|
+
return this._post('/auth/login', { email, password });
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
async me() {
|
|
33
|
+
return this._get('/auth/me');
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// === Users (admin) ===
|
|
37
|
+
|
|
38
|
+
async createUser(userId, { configId, plan } = {}) {
|
|
39
|
+
const cfgId = configId || this._configIdFromToken();
|
|
40
|
+
if (!cfgId) throw new Error('configId required — pass configId or use a token with configId');
|
|
41
|
+
return this._post(`/dashboard/configs/${cfgId}/token`, { userId, plan });
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// === Chats ===
|
|
45
|
+
|
|
46
|
+
async createChat(title) {
|
|
47
|
+
return this._post('/chats', title ? { title } : {});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
async listChats() {
|
|
51
|
+
const data = await this._get('/chats');
|
|
52
|
+
return data.chats || [];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
async getChat(chatId) {
|
|
56
|
+
return this._get(`/chats/${chatId}`);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
async deleteChat(chatId) {
|
|
60
|
+
return this._fetch('DELETE', `/chats/${chatId}/prompt`);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// === Prompts ===
|
|
64
|
+
|
|
65
|
+
async prompt(chatId, content, { onDelta, onToolCall, onToolResult, onFinish, onError, config } = {}) {
|
|
66
|
+
const body = { content };
|
|
67
|
+
if (config) body.config = config;
|
|
68
|
+
|
|
69
|
+
const res = await fetch(`${this.workerUrl}/chats/${chatId}/prompt`, {
|
|
70
|
+
method: 'POST',
|
|
71
|
+
headers: this._headers(),
|
|
72
|
+
body: JSON.stringify(body),
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
if (!res.ok) {
|
|
76
|
+
const err = await res.json().catch(() => ({ error: `HTTP ${res.status}` }));
|
|
77
|
+
throw new Error(err.error || `HTTP ${res.status}`);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return this._consumeStream(res, { onDelta, onToolCall, onToolResult, onFinish, onError });
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// === Stateless chat (no history) ===
|
|
84
|
+
|
|
85
|
+
async chat(messages, { config, onDelta, onFinish } = {}) {
|
|
86
|
+
const body = { messages };
|
|
87
|
+
if (config) body.config = config;
|
|
88
|
+
|
|
89
|
+
const res = await fetch(`${this.workerUrl}/chat`, {
|
|
90
|
+
method: 'POST',
|
|
91
|
+
headers: { 'Content-Type': 'application/json' },
|
|
92
|
+
body: JSON.stringify(body),
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
if (!res.ok) throw new Error(`HTTP ${res.status}`);
|
|
96
|
+
return this._consumeStream(res, { onDelta, onFinish });
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// === Projects (admin/dev) ===
|
|
100
|
+
|
|
101
|
+
async createProject(data) {
|
|
102
|
+
return this._post('/dashboard/configs', data);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
async listProjects() {
|
|
106
|
+
const data = await this._get('/dashboard/configs');
|
|
107
|
+
return data.configs || [];
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
async updateProject(id, data) {
|
|
111
|
+
return this._fetch('PUT', `/dashboard/configs/${id}`, data);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
async deleteProject(id) {
|
|
115
|
+
return this._fetch('DELETE', `/dashboard/configs/${id}`);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// === Usage ===
|
|
119
|
+
|
|
120
|
+
async getUsage(configId, days = 7) {
|
|
121
|
+
return this._get(`/dashboard/usage?configId=${configId}&days=${days}`);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// === Internal ===
|
|
125
|
+
|
|
126
|
+
_headers() {
|
|
127
|
+
const h = { 'Content-Type': 'application/json' };
|
|
128
|
+
const t = this.token || this.adminToken;
|
|
129
|
+
if (t) h['Authorization'] = `Bearer ${t}`;
|
|
130
|
+
return h;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
async _get(path) {
|
|
134
|
+
const res = await fetch(`${this.workerUrl}${path}`, { headers: this._headers() });
|
|
135
|
+
if (!res.ok) { const e = await res.json().catch(() => ({})); throw new Error(e.error || `HTTP ${res.status}`); }
|
|
136
|
+
return res.json();
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
async _post(path, body) {
|
|
140
|
+
const res = await fetch(`${this.workerUrl}${path}`, {
|
|
141
|
+
method: 'POST', headers: this._headers(), body: JSON.stringify(body || {}),
|
|
142
|
+
});
|
|
143
|
+
if (!res.ok) { const e = await res.json().catch(() => ({})); throw new Error(e.error || `HTTP ${res.status}`); }
|
|
144
|
+
return res.json();
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
async _fetch(method, path, body) {
|
|
148
|
+
const opts = { method, headers: this._headers() };
|
|
149
|
+
if (body) opts.body = JSON.stringify(body);
|
|
150
|
+
const res = await fetch(`${this.workerUrl}${path}`, opts);
|
|
151
|
+
if (!res.ok) { const e = await res.json().catch(() => ({})); throw new Error(e.error || `HTTP ${res.status}`); }
|
|
152
|
+
return res.json();
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
async _consumeStream(res, { onDelta, onToolCall, onToolResult, onFinish, onError } = {}) {
|
|
156
|
+
let fullText = '';
|
|
157
|
+
const reader = res.body.pipeThrough(new TextDecoderStream()).getReader();
|
|
158
|
+
let buffer = '';
|
|
159
|
+
|
|
160
|
+
while (true) {
|
|
161
|
+
const { done, value } = await reader.read();
|
|
162
|
+
if (done) break;
|
|
163
|
+
buffer += value;
|
|
164
|
+
const lines = buffer.split('\n');
|
|
165
|
+
buffer = lines.pop() || '';
|
|
166
|
+
|
|
167
|
+
for (const line of lines) {
|
|
168
|
+
const trimmed = line.trim();
|
|
169
|
+
if (!trimmed.startsWith('data: ')) continue;
|
|
170
|
+
const payload = trimmed.slice(6);
|
|
171
|
+
if (payload === '[DONE]') continue;
|
|
172
|
+
|
|
173
|
+
try {
|
|
174
|
+
const data = JSON.parse(payload);
|
|
175
|
+
switch (data.type) {
|
|
176
|
+
case 'text-delta':
|
|
177
|
+
fullText += data.delta;
|
|
178
|
+
if (onDelta) onDelta(data.delta, fullText);
|
|
179
|
+
break;
|
|
180
|
+
case 'tool-input-start':
|
|
181
|
+
case 'tool-call':
|
|
182
|
+
if (onToolCall) onToolCall({ toolCallId: data.toolCallId, toolName: data.toolName });
|
|
183
|
+
break;
|
|
184
|
+
case 'tool-output-available':
|
|
185
|
+
case 'tool-result':
|
|
186
|
+
if (onToolResult) onToolResult({ toolCallId: data.toolCallId, result: data.result || data.output });
|
|
187
|
+
break;
|
|
188
|
+
case 'error':
|
|
189
|
+
if (onError) onError(data.errorText || data.message);
|
|
190
|
+
break;
|
|
191
|
+
case 'finish':
|
|
192
|
+
if (onFinish) onFinish({ text: fullText, reason: data.finishReason });
|
|
193
|
+
break;
|
|
194
|
+
}
|
|
195
|
+
} catch {}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
return { text: fullText, promptId: res.headers.get('X-Prompt-Id') };
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
_configIdFromToken() {
|
|
203
|
+
if (!this.adminToken) return null;
|
|
204
|
+
try {
|
|
205
|
+
const payload = JSON.parse(atob(this.adminToken.split('.')[1]));
|
|
206
|
+
return payload.configId || null;
|
|
207
|
+
} catch { return null; }
|
|
208
|
+
}
|
|
209
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "smoothagent",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "SmoothAgent SDK — white-label agentic chat with MCP tools. Browser + Node.js.",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"module": "index.mjs",
|
|
7
|
+
"types": "index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./index.mjs",
|
|
11
|
+
"require": "./index.js",
|
|
12
|
+
"types": "./index.d.ts"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"index.js",
|
|
17
|
+
"index.mjs",
|
|
18
|
+
"index.d.ts"
|
|
19
|
+
],
|
|
20
|
+
"keywords": [
|
|
21
|
+
"smooth",
|
|
22
|
+
"agent",
|
|
23
|
+
"chat",
|
|
24
|
+
"agentic",
|
|
25
|
+
"mcp",
|
|
26
|
+
"llm",
|
|
27
|
+
"ai",
|
|
28
|
+
"anthropic",
|
|
29
|
+
"openai",
|
|
30
|
+
"google",
|
|
31
|
+
"white-label",
|
|
32
|
+
"sdk"
|
|
33
|
+
],
|
|
34
|
+
"author": "SmoothAgent",
|
|
35
|
+
"license": "MIT",
|
|
36
|
+
"repository": {
|
|
37
|
+
"type": "git",
|
|
38
|
+
"url": "https://github.com/joaoquirino/smoothagent"
|
|
39
|
+
},
|
|
40
|
+
"homepage": "https://agent.smoothcodes.com"
|
|
41
|
+
}
|