@squadbase/vite-server 0.1.3-dev.8 → 0.1.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/cli/index.js +14229 -29321
- package/dist/connectors/airtable-oauth.js +43 -6
- package/dist/connectors/airtable.js +43 -6
- package/dist/connectors/amplitude.js +43 -6
- package/dist/connectors/anthropic.js +43 -6
- package/dist/connectors/asana.js +43 -6
- package/dist/connectors/attio.js +43 -6
- package/dist/connectors/{google-ads-oauth.d.ts → backlog-api-key.d.ts} +1 -1
- package/dist/connectors/backlog-api-key.js +629 -0
- package/dist/connectors/customerio.js +43 -6
- package/dist/connectors/dbt.js +43 -6
- package/dist/connectors/{google-sheets-oauth.d.ts → gamma.d.ts} +1 -1
- package/dist/connectors/gamma.js +866 -0
- package/dist/connectors/gemini.js +43 -6
- package/dist/connectors/gmail-oauth.js +65 -8
- package/dist/connectors/gmail.js +104 -44
- package/dist/connectors/google-ads.d.ts +1 -1
- package/dist/connectors/google-ads.js +410 -332
- package/dist/connectors/google-analytics-oauth.js +61 -8
- package/dist/connectors/google-analytics.js +107 -292
- package/dist/connectors/google-calendar-oauth.js +61 -8
- package/dist/connectors/google-calendar.js +111 -58
- package/dist/connectors/{linkedin-ads-oauth.d.ts → google-docs.d.ts} +1 -1
- package/dist/connectors/google-docs.js +631 -0
- package/dist/connectors/google-drive.d.ts +5 -0
- package/dist/connectors/google-drive.js +875 -0
- package/dist/connectors/google-sheets.d.ts +1 -1
- package/dist/connectors/google-sheets.js +267 -285
- package/dist/connectors/google-slides.d.ts +5 -0
- package/dist/connectors/google-slides.js +663 -0
- package/dist/connectors/grafana.js +43 -6
- package/dist/connectors/hubspot-oauth.js +43 -6
- package/dist/connectors/hubspot.js +43 -6
- package/dist/connectors/intercom-oauth.js +43 -6
- package/dist/connectors/intercom.js +43 -6
- package/dist/connectors/jira-api-key.js +43 -6
- package/dist/connectors/kintone-api-token.js +256 -82
- package/dist/connectors/kintone.js +43 -6
- package/dist/connectors/linkedin-ads.js +188 -168
- package/dist/connectors/mailchimp-oauth.js +43 -6
- package/dist/connectors/mailchimp.js +43 -6
- package/dist/connectors/mixpanel.d.ts +5 -0
- package/dist/connectors/mixpanel.js +779 -0
- package/dist/connectors/notion-oauth.js +43 -6
- package/dist/connectors/notion.js +43 -6
- package/dist/connectors/openai.js +43 -6
- package/dist/connectors/sentry.d.ts +5 -0
- package/dist/connectors/sentry.js +761 -0
- package/dist/connectors/shopify-oauth.js +43 -6
- package/dist/connectors/shopify.js +43 -6
- package/dist/connectors/stripe-api-key.js +46 -7
- package/dist/connectors/stripe-oauth.js +43 -6
- package/dist/connectors/wix-store.js +43 -6
- package/dist/connectors/zendesk-oauth.js +43 -6
- package/dist/connectors/zendesk.js +43 -6
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4419 -3855
- package/dist/main.js +5481 -4918
- package/dist/vite-plugin.js +4474 -3948
- package/package.json +30 -12
- package/dist/connectors/google-ads-oauth.js +0 -890
- package/dist/connectors/google-sheets-oauth.js +0 -718
- package/dist/connectors/linkedin-ads-oauth.js +0 -848
|
@@ -245,21 +245,58 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
245
245
|
* Filters connections by connectorKey internally.
|
|
246
246
|
* Returns tools keyed as `${connectorKey}_${toolName}`.
|
|
247
247
|
*/
|
|
248
|
-
createTools(connections, config) {
|
|
248
|
+
createTools(connections, config, opts) {
|
|
249
249
|
const myConnections = connections.filter(
|
|
250
250
|
(c) => _ConnectorPlugin.deriveKey(c.connector.slug, c.connector.authType) === this.connectorKey
|
|
251
251
|
);
|
|
252
252
|
const result = {};
|
|
253
253
|
for (const t of Object.values(this.tools)) {
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
254
|
+
const tool = t.createTool(myConnections, config);
|
|
255
|
+
const originalToModelOutput = tool.toModelOutput;
|
|
256
|
+
result[`${this.connectorKey}_${t.name}`] = {
|
|
257
|
+
...tool,
|
|
258
|
+
toModelOutput: async (options) => {
|
|
259
|
+
if (!originalToModelOutput) {
|
|
260
|
+
return opts.truncateOutput(options.output);
|
|
261
|
+
}
|
|
262
|
+
const modelOutput = await originalToModelOutput(options);
|
|
263
|
+
if (modelOutput.type === "text" || modelOutput.type === "json") {
|
|
264
|
+
return opts.truncateOutput(modelOutput.value);
|
|
265
|
+
}
|
|
266
|
+
return modelOutput;
|
|
267
|
+
}
|
|
268
|
+
};
|
|
258
269
|
}
|
|
259
270
|
return result;
|
|
260
271
|
}
|
|
261
272
|
static deriveKey(slug, authType) {
|
|
262
|
-
|
|
273
|
+
if (authType) return `${slug}-${authType}`;
|
|
274
|
+
const LEGACY_NULL_AUTH_TYPE_MAP = {
|
|
275
|
+
// user-password
|
|
276
|
+
"postgresql": "user-password",
|
|
277
|
+
"mysql": "user-password",
|
|
278
|
+
"clickhouse": "user-password",
|
|
279
|
+
"kintone": "user-password",
|
|
280
|
+
"squadbase-db": "user-password",
|
|
281
|
+
// service-account
|
|
282
|
+
"snowflake": "service-account",
|
|
283
|
+
"bigquery": "service-account",
|
|
284
|
+
"google-analytics": "service-account",
|
|
285
|
+
"google-calendar": "service-account",
|
|
286
|
+
"aws-athena": "service-account",
|
|
287
|
+
"redshift": "service-account",
|
|
288
|
+
// api-key
|
|
289
|
+
"databricks": "api-key",
|
|
290
|
+
"dbt": "api-key",
|
|
291
|
+
"airtable": "api-key",
|
|
292
|
+
"openai": "api-key",
|
|
293
|
+
"gemini": "api-key",
|
|
294
|
+
"anthropic": "api-key",
|
|
295
|
+
"wix-store": "api-key"
|
|
296
|
+
};
|
|
297
|
+
const fallbackAuthType = LEGACY_NULL_AUTH_TYPE_MAP[slug];
|
|
298
|
+
if (fallbackAuthType) return `${slug}-${fallbackAuthType}`;
|
|
299
|
+
return slug;
|
|
263
300
|
}
|
|
264
301
|
};
|
|
265
302
|
|
|
@@ -90,21 +90,58 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
90
90
|
* Filters connections by connectorKey internally.
|
|
91
91
|
* Returns tools keyed as `${connectorKey}_${toolName}`.
|
|
92
92
|
*/
|
|
93
|
-
createTools(connections, config) {
|
|
93
|
+
createTools(connections, config, opts) {
|
|
94
94
|
const myConnections = connections.filter(
|
|
95
95
|
(c) => _ConnectorPlugin.deriveKey(c.connector.slug, c.connector.authType) === this.connectorKey
|
|
96
96
|
);
|
|
97
97
|
const result = {};
|
|
98
98
|
for (const t of Object.values(this.tools)) {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
99
|
+
const tool = t.createTool(myConnections, config);
|
|
100
|
+
const originalToModelOutput = tool.toModelOutput;
|
|
101
|
+
result[`${this.connectorKey}_${t.name}`] = {
|
|
102
|
+
...tool,
|
|
103
|
+
toModelOutput: async (options) => {
|
|
104
|
+
if (!originalToModelOutput) {
|
|
105
|
+
return opts.truncateOutput(options.output);
|
|
106
|
+
}
|
|
107
|
+
const modelOutput = await originalToModelOutput(options);
|
|
108
|
+
if (modelOutput.type === "text" || modelOutput.type === "json") {
|
|
109
|
+
return opts.truncateOutput(modelOutput.value);
|
|
110
|
+
}
|
|
111
|
+
return modelOutput;
|
|
112
|
+
}
|
|
113
|
+
};
|
|
103
114
|
}
|
|
104
115
|
return result;
|
|
105
116
|
}
|
|
106
117
|
static deriveKey(slug, authType) {
|
|
107
|
-
|
|
118
|
+
if (authType) return `${slug}-${authType}`;
|
|
119
|
+
const LEGACY_NULL_AUTH_TYPE_MAP = {
|
|
120
|
+
// user-password
|
|
121
|
+
"postgresql": "user-password",
|
|
122
|
+
"mysql": "user-password",
|
|
123
|
+
"clickhouse": "user-password",
|
|
124
|
+
"kintone": "user-password",
|
|
125
|
+
"squadbase-db": "user-password",
|
|
126
|
+
// service-account
|
|
127
|
+
"snowflake": "service-account",
|
|
128
|
+
"bigquery": "service-account",
|
|
129
|
+
"google-analytics": "service-account",
|
|
130
|
+
"google-calendar": "service-account",
|
|
131
|
+
"aws-athena": "service-account",
|
|
132
|
+
"redshift": "service-account",
|
|
133
|
+
// api-key
|
|
134
|
+
"databricks": "api-key",
|
|
135
|
+
"dbt": "api-key",
|
|
136
|
+
"airtable": "api-key",
|
|
137
|
+
"openai": "api-key",
|
|
138
|
+
"gemini": "api-key",
|
|
139
|
+
"anthropic": "api-key",
|
|
140
|
+
"wix-store": "api-key"
|
|
141
|
+
};
|
|
142
|
+
const fallbackAuthType = LEGACY_NULL_AUTH_TYPE_MAP[slug];
|
|
143
|
+
if (fallbackAuthType) return `${slug}-${fallbackAuthType}`;
|
|
144
|
+
return slug;
|
|
108
145
|
}
|
|
109
146
|
};
|
|
110
147
|
|
|
@@ -219,21 +219,58 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
219
219
|
* Filters connections by connectorKey internally.
|
|
220
220
|
* Returns tools keyed as `${connectorKey}_${toolName}`.
|
|
221
221
|
*/
|
|
222
|
-
createTools(connections, config) {
|
|
222
|
+
createTools(connections, config, opts) {
|
|
223
223
|
const myConnections = connections.filter(
|
|
224
224
|
(c) => _ConnectorPlugin.deriveKey(c.connector.slug, c.connector.authType) === this.connectorKey
|
|
225
225
|
);
|
|
226
226
|
const result = {};
|
|
227
227
|
for (const t of Object.values(this.tools)) {
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
228
|
+
const tool = t.createTool(myConnections, config);
|
|
229
|
+
const originalToModelOutput = tool.toModelOutput;
|
|
230
|
+
result[`${this.connectorKey}_${t.name}`] = {
|
|
231
|
+
...tool,
|
|
232
|
+
toModelOutput: async (options) => {
|
|
233
|
+
if (!originalToModelOutput) {
|
|
234
|
+
return opts.truncateOutput(options.output);
|
|
235
|
+
}
|
|
236
|
+
const modelOutput = await originalToModelOutput(options);
|
|
237
|
+
if (modelOutput.type === "text" || modelOutput.type === "json") {
|
|
238
|
+
return opts.truncateOutput(modelOutput.value);
|
|
239
|
+
}
|
|
240
|
+
return modelOutput;
|
|
241
|
+
}
|
|
242
|
+
};
|
|
232
243
|
}
|
|
233
244
|
return result;
|
|
234
245
|
}
|
|
235
246
|
static deriveKey(slug, authType) {
|
|
236
|
-
|
|
247
|
+
if (authType) return `${slug}-${authType}`;
|
|
248
|
+
const LEGACY_NULL_AUTH_TYPE_MAP = {
|
|
249
|
+
// user-password
|
|
250
|
+
"postgresql": "user-password",
|
|
251
|
+
"mysql": "user-password",
|
|
252
|
+
"clickhouse": "user-password",
|
|
253
|
+
"kintone": "user-password",
|
|
254
|
+
"squadbase-db": "user-password",
|
|
255
|
+
// service-account
|
|
256
|
+
"snowflake": "service-account",
|
|
257
|
+
"bigquery": "service-account",
|
|
258
|
+
"google-analytics": "service-account",
|
|
259
|
+
"google-calendar": "service-account",
|
|
260
|
+
"aws-athena": "service-account",
|
|
261
|
+
"redshift": "service-account",
|
|
262
|
+
// api-key
|
|
263
|
+
"databricks": "api-key",
|
|
264
|
+
"dbt": "api-key",
|
|
265
|
+
"airtable": "api-key",
|
|
266
|
+
"openai": "api-key",
|
|
267
|
+
"gemini": "api-key",
|
|
268
|
+
"anthropic": "api-key",
|
|
269
|
+
"wix-store": "api-key"
|
|
270
|
+
};
|
|
271
|
+
const fallbackAuthType = LEGACY_NULL_AUTH_TYPE_MAP[slug];
|
|
272
|
+
if (fallbackAuthType) return `${slug}-${fallbackAuthType}`;
|
|
273
|
+
return slug;
|
|
237
274
|
}
|
|
238
275
|
};
|
|
239
276
|
|
|
@@ -90,21 +90,58 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
90
90
|
* Filters connections by connectorKey internally.
|
|
91
91
|
* Returns tools keyed as `${connectorKey}_${toolName}`.
|
|
92
92
|
*/
|
|
93
|
-
createTools(connections, config) {
|
|
93
|
+
createTools(connections, config, opts) {
|
|
94
94
|
const myConnections = connections.filter(
|
|
95
95
|
(c) => _ConnectorPlugin.deriveKey(c.connector.slug, c.connector.authType) === this.connectorKey
|
|
96
96
|
);
|
|
97
97
|
const result = {};
|
|
98
98
|
for (const t of Object.values(this.tools)) {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
99
|
+
const tool = t.createTool(myConnections, config);
|
|
100
|
+
const originalToModelOutput = tool.toModelOutput;
|
|
101
|
+
result[`${this.connectorKey}_${t.name}`] = {
|
|
102
|
+
...tool,
|
|
103
|
+
toModelOutput: async (options) => {
|
|
104
|
+
if (!originalToModelOutput) {
|
|
105
|
+
return opts.truncateOutput(options.output);
|
|
106
|
+
}
|
|
107
|
+
const modelOutput = await originalToModelOutput(options);
|
|
108
|
+
if (modelOutput.type === "text" || modelOutput.type === "json") {
|
|
109
|
+
return opts.truncateOutput(modelOutput.value);
|
|
110
|
+
}
|
|
111
|
+
return modelOutput;
|
|
112
|
+
}
|
|
113
|
+
};
|
|
103
114
|
}
|
|
104
115
|
return result;
|
|
105
116
|
}
|
|
106
117
|
static deriveKey(slug, authType) {
|
|
107
|
-
|
|
118
|
+
if (authType) return `${slug}-${authType}`;
|
|
119
|
+
const LEGACY_NULL_AUTH_TYPE_MAP = {
|
|
120
|
+
// user-password
|
|
121
|
+
"postgresql": "user-password",
|
|
122
|
+
"mysql": "user-password",
|
|
123
|
+
"clickhouse": "user-password",
|
|
124
|
+
"kintone": "user-password",
|
|
125
|
+
"squadbase-db": "user-password",
|
|
126
|
+
// service-account
|
|
127
|
+
"snowflake": "service-account",
|
|
128
|
+
"bigquery": "service-account",
|
|
129
|
+
"google-analytics": "service-account",
|
|
130
|
+
"google-calendar": "service-account",
|
|
131
|
+
"aws-athena": "service-account",
|
|
132
|
+
"redshift": "service-account",
|
|
133
|
+
// api-key
|
|
134
|
+
"databricks": "api-key",
|
|
135
|
+
"dbt": "api-key",
|
|
136
|
+
"airtable": "api-key",
|
|
137
|
+
"openai": "api-key",
|
|
138
|
+
"gemini": "api-key",
|
|
139
|
+
"anthropic": "api-key",
|
|
140
|
+
"wix-store": "api-key"
|
|
141
|
+
};
|
|
142
|
+
const fallbackAuthType = LEGACY_NULL_AUTH_TYPE_MAP[slug];
|
|
143
|
+
if (fallbackAuthType) return `${slug}-${fallbackAuthType}`;
|
|
144
|
+
return slug;
|
|
108
145
|
}
|
|
109
146
|
};
|
|
110
147
|
|
|
@@ -237,21 +237,58 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
237
237
|
* Filters connections by connectorKey internally.
|
|
238
238
|
* Returns tools keyed as `${connectorKey}_${toolName}`.
|
|
239
239
|
*/
|
|
240
|
-
createTools(connections, config) {
|
|
240
|
+
createTools(connections, config, opts) {
|
|
241
241
|
const myConnections = connections.filter(
|
|
242
242
|
(c) => _ConnectorPlugin.deriveKey(c.connector.slug, c.connector.authType) === this.connectorKey
|
|
243
243
|
);
|
|
244
244
|
const result = {};
|
|
245
245
|
for (const t of Object.values(this.tools)) {
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
246
|
+
const tool = t.createTool(myConnections, config);
|
|
247
|
+
const originalToModelOutput = tool.toModelOutput;
|
|
248
|
+
result[`${this.connectorKey}_${t.name}`] = {
|
|
249
|
+
...tool,
|
|
250
|
+
toModelOutput: async (options) => {
|
|
251
|
+
if (!originalToModelOutput) {
|
|
252
|
+
return opts.truncateOutput(options.output);
|
|
253
|
+
}
|
|
254
|
+
const modelOutput = await originalToModelOutput(options);
|
|
255
|
+
if (modelOutput.type === "text" || modelOutput.type === "json") {
|
|
256
|
+
return opts.truncateOutput(modelOutput.value);
|
|
257
|
+
}
|
|
258
|
+
return modelOutput;
|
|
259
|
+
}
|
|
260
|
+
};
|
|
250
261
|
}
|
|
251
262
|
return result;
|
|
252
263
|
}
|
|
253
264
|
static deriveKey(slug, authType) {
|
|
254
|
-
|
|
265
|
+
if (authType) return `${slug}-${authType}`;
|
|
266
|
+
const LEGACY_NULL_AUTH_TYPE_MAP = {
|
|
267
|
+
// user-password
|
|
268
|
+
"postgresql": "user-password",
|
|
269
|
+
"mysql": "user-password",
|
|
270
|
+
"clickhouse": "user-password",
|
|
271
|
+
"kintone": "user-password",
|
|
272
|
+
"squadbase-db": "user-password",
|
|
273
|
+
// service-account
|
|
274
|
+
"snowflake": "service-account",
|
|
275
|
+
"bigquery": "service-account",
|
|
276
|
+
"google-analytics": "service-account",
|
|
277
|
+
"google-calendar": "service-account",
|
|
278
|
+
"aws-athena": "service-account",
|
|
279
|
+
"redshift": "service-account",
|
|
280
|
+
// api-key
|
|
281
|
+
"databricks": "api-key",
|
|
282
|
+
"dbt": "api-key",
|
|
283
|
+
"airtable": "api-key",
|
|
284
|
+
"openai": "api-key",
|
|
285
|
+
"gemini": "api-key",
|
|
286
|
+
"anthropic": "api-key",
|
|
287
|
+
"wix-store": "api-key"
|
|
288
|
+
};
|
|
289
|
+
const fallbackAuthType = LEGACY_NULL_AUTH_TYPE_MAP[slug];
|
|
290
|
+
if (fallbackAuthType) return `${slug}-${fallbackAuthType}`;
|
|
291
|
+
return slug;
|
|
255
292
|
}
|
|
256
293
|
};
|
|
257
294
|
|
|
@@ -186,21 +186,58 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
186
186
|
* Filters connections by connectorKey internally.
|
|
187
187
|
* Returns tools keyed as `${connectorKey}_${toolName}`.
|
|
188
188
|
*/
|
|
189
|
-
createTools(connections, config) {
|
|
189
|
+
createTools(connections, config, opts) {
|
|
190
190
|
const myConnections = connections.filter(
|
|
191
191
|
(c) => _ConnectorPlugin.deriveKey(c.connector.slug, c.connector.authType) === this.connectorKey
|
|
192
192
|
);
|
|
193
193
|
const result = {};
|
|
194
194
|
for (const t of Object.values(this.tools)) {
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
195
|
+
const tool = t.createTool(myConnections, config);
|
|
196
|
+
const originalToModelOutput = tool.toModelOutput;
|
|
197
|
+
result[`${this.connectorKey}_${t.name}`] = {
|
|
198
|
+
...tool,
|
|
199
|
+
toModelOutput: async (options) => {
|
|
200
|
+
if (!originalToModelOutput) {
|
|
201
|
+
return opts.truncateOutput(options.output);
|
|
202
|
+
}
|
|
203
|
+
const modelOutput = await originalToModelOutput(options);
|
|
204
|
+
if (modelOutput.type === "text" || modelOutput.type === "json") {
|
|
205
|
+
return opts.truncateOutput(modelOutput.value);
|
|
206
|
+
}
|
|
207
|
+
return modelOutput;
|
|
208
|
+
}
|
|
209
|
+
};
|
|
199
210
|
}
|
|
200
211
|
return result;
|
|
201
212
|
}
|
|
202
213
|
static deriveKey(slug, authType) {
|
|
203
|
-
|
|
214
|
+
if (authType) return `${slug}-${authType}`;
|
|
215
|
+
const LEGACY_NULL_AUTH_TYPE_MAP = {
|
|
216
|
+
// user-password
|
|
217
|
+
"postgresql": "user-password",
|
|
218
|
+
"mysql": "user-password",
|
|
219
|
+
"clickhouse": "user-password",
|
|
220
|
+
"kintone": "user-password",
|
|
221
|
+
"squadbase-db": "user-password",
|
|
222
|
+
// service-account
|
|
223
|
+
"snowflake": "service-account",
|
|
224
|
+
"bigquery": "service-account",
|
|
225
|
+
"google-analytics": "service-account",
|
|
226
|
+
"google-calendar": "service-account",
|
|
227
|
+
"aws-athena": "service-account",
|
|
228
|
+
"redshift": "service-account",
|
|
229
|
+
// api-key
|
|
230
|
+
"databricks": "api-key",
|
|
231
|
+
"dbt": "api-key",
|
|
232
|
+
"airtable": "api-key",
|
|
233
|
+
"openai": "api-key",
|
|
234
|
+
"gemini": "api-key",
|
|
235
|
+
"anthropic": "api-key",
|
|
236
|
+
"wix-store": "api-key"
|
|
237
|
+
};
|
|
238
|
+
const fallbackAuthType = LEGACY_NULL_AUTH_TYPE_MAP[slug];
|
|
239
|
+
if (fallbackAuthType) return `${slug}-${fallbackAuthType}`;
|
|
240
|
+
return slug;
|
|
204
241
|
}
|
|
205
242
|
};
|
|
206
243
|
|