@syncagent/js
Advanced tools
+16
-0
@@ -23,2 +23,17 @@ interface ToolParameter { | ||
| baseUrl?: string; | ||
| /** | ||
| * Mandatory query filter applied to EVERY database operation. | ||
| * Use this for multi-tenant SaaS apps to scope the agent to the current user's data. | ||
| * | ||
| * @example | ||
| * // MongoDB — scope to current organization | ||
| * filter: { organizationId: currentUser.orgId } | ||
| * | ||
| * // SQL — scope to current tenant | ||
| * filter: { tenant_id: currentUser.tenantId } | ||
| * | ||
| * // Multiple fields | ||
| * filter: { org_id: org.id, deleted: false } | ||
| */ | ||
| filter?: Record<string, any>; | ||
| } | ||
@@ -69,2 +84,3 @@ interface Message { | ||
| private tools; | ||
| private filter; | ||
| constructor(config: SyncAgentConfig); | ||
@@ -71,0 +87,0 @@ private headers; |
+16
-0
@@ -23,2 +23,17 @@ interface ToolParameter { | ||
| baseUrl?: string; | ||
| /** | ||
| * Mandatory query filter applied to EVERY database operation. | ||
| * Use this for multi-tenant SaaS apps to scope the agent to the current user's data. | ||
| * | ||
| * @example | ||
| * // MongoDB — scope to current organization | ||
| * filter: { organizationId: currentUser.orgId } | ||
| * | ||
| * // SQL — scope to current tenant | ||
| * filter: { tenant_id: currentUser.tenantId } | ||
| * | ||
| * // Multiple fields | ||
| * filter: { org_id: org.id, deleted: false } | ||
| */ | ||
| filter?: Record<string, any>; | ||
| } | ||
@@ -69,2 +84,3 @@ interface Message { | ||
| private tools; | ||
| private filter; | ||
| constructor(config: SyncAgentConfig); | ||
@@ -71,0 +87,0 @@ private headers; |
+3
-2
@@ -75,3 +75,2 @@ "use strict"; | ||
| // src/client.ts | ||
| var SYNCAGENT_API_URL = "https://syncagentdev.vercel.app"; | ||
| var SyncAgentClient = class { | ||
@@ -82,5 +81,6 @@ constructor(config) { | ||
| this.apiKey = config.apiKey; | ||
| this.baseUrl = (config.baseUrl || SYNCAGENT_API_URL).replace(/\/$/, ""); | ||
| this.baseUrl = (config.baseUrl || "https://syncagent.dev").replace(/\/$/, ""); | ||
| this.connectionString = config.connectionString; | ||
| this.tools = config.tools || {}; | ||
| this.filter = config.filter || {}; | ||
| } | ||
@@ -140,2 +140,3 @@ headers() { | ||
| connectionString: this.connectionString, | ||
| ...this.filter && Object.keys(this.filter).length > 0 && { filter: this.filter }, | ||
| ...clientTools && { clientTools } | ||
@@ -142,0 +143,0 @@ }), |
+3
-2
@@ -49,3 +49,2 @@ // src/stream.ts | ||
| // src/client.ts | ||
| var SYNCAGENT_API_URL = "https://syncagentdev.vercel.app"; | ||
| var SyncAgentClient = class { | ||
@@ -56,5 +55,6 @@ constructor(config) { | ||
| this.apiKey = config.apiKey; | ||
| this.baseUrl = (config.baseUrl || SYNCAGENT_API_URL).replace(/\/$/, ""); | ||
| this.baseUrl = (config.baseUrl || "https://syncagent.dev").replace(/\/$/, ""); | ||
| this.connectionString = config.connectionString; | ||
| this.tools = config.tools || {}; | ||
| this.filter = config.filter || {}; | ||
| } | ||
@@ -114,2 +114,3 @@ headers() { | ||
| connectionString: this.connectionString, | ||
| ...this.filter && Object.keys(this.filter).length > 0 && { filter: this.filter }, | ||
| ...clientTools && { clientTools } | ||
@@ -116,0 +117,0 @@ }), |
+1
-1
| { | ||
| "name": "@syncagent/js", | ||
| "version": "0.2.1", | ||
| "version": "0.2.2", | ||
| "description": "SyncAgent JavaScript SDK — AI database agent for any app", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.cjs", |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
26247
4.93%506
3.69%