@syncagent/js 0.1.9 → 0.2.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/dist/index.d.mts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -15,6 +15,11 @@ interface SyncAgentConfig {
|
|
|
15
15
|
connectionString: string;
|
|
16
16
|
/** Custom tools the AI agent can call — executed client-side in your app */
|
|
17
17
|
tools?: Record<string, ToolDefinition>;
|
|
18
|
+
/**
|
|
19
|
+
* Override the API base URL. Defaults to https://syncagent.dev
|
|
20
|
+
* Use this in development: baseUrl: "http://localhost:3100"
|
|
21
|
+
*/
|
|
22
|
+
baseUrl?: string;
|
|
18
23
|
}
|
|
19
24
|
interface Message {
|
|
20
25
|
role: "user" | "assistant";
|
package/dist/index.d.ts
CHANGED
|
@@ -15,6 +15,11 @@ interface SyncAgentConfig {
|
|
|
15
15
|
connectionString: string;
|
|
16
16
|
/** Custom tools the AI agent can call — executed client-side in your app */
|
|
17
17
|
tools?: Record<string, ToolDefinition>;
|
|
18
|
+
/**
|
|
19
|
+
* Override the API base URL. Defaults to https://syncagent.dev
|
|
20
|
+
* Use this in development: baseUrl: "http://localhost:3100"
|
|
21
|
+
*/
|
|
22
|
+
baseUrl?: string;
|
|
18
23
|
}
|
|
19
24
|
interface Message {
|
|
20
25
|
role: "user" | "assistant";
|
package/dist/index.js
CHANGED
|
@@ -72,13 +72,13 @@ function parseChunk(chunk) {
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
// src/client.ts
|
|
75
|
-
var SYNCAGENT_API_URL = "https://
|
|
75
|
+
var SYNCAGENT_API_URL = "https://syncagentdev.vercel.app";
|
|
76
76
|
var SyncAgentClient = class {
|
|
77
77
|
constructor(config) {
|
|
78
78
|
if (!config.apiKey) throw new Error("SyncAgent: apiKey is required");
|
|
79
79
|
if (!config.connectionString) throw new Error("SyncAgent: connectionString is required");
|
|
80
80
|
this.apiKey = config.apiKey;
|
|
81
|
-
this.baseUrl = SYNCAGENT_API_URL;
|
|
81
|
+
this.baseUrl = (config.baseUrl || SYNCAGENT_API_URL).replace(/\/$/, "");
|
|
82
82
|
this.connectionString = config.connectionString;
|
|
83
83
|
this.tools = config.tools || {};
|
|
84
84
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -46,13 +46,13 @@ function parseChunk(chunk) {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
// src/client.ts
|
|
49
|
-
var SYNCAGENT_API_URL = "https://
|
|
49
|
+
var SYNCAGENT_API_URL = "https://syncagentdev.vercel.app";
|
|
50
50
|
var SyncAgentClient = class {
|
|
51
51
|
constructor(config) {
|
|
52
52
|
if (!config.apiKey) throw new Error("SyncAgent: apiKey is required");
|
|
53
53
|
if (!config.connectionString) throw new Error("SyncAgent: connectionString is required");
|
|
54
54
|
this.apiKey = config.apiKey;
|
|
55
|
-
this.baseUrl = SYNCAGENT_API_URL;
|
|
55
|
+
this.baseUrl = (config.baseUrl || SYNCAGENT_API_URL).replace(/\/$/, "");
|
|
56
56
|
this.connectionString = config.connectionString;
|
|
57
57
|
this.tools = config.tools || {};
|
|
58
58
|
}
|