@squadbase/connectors 0.0.18 → 0.1.1-dev.1
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.ts +56 -0
- package/dist/index.js +414 -241
- package/package.json +3 -1
package/dist/index.d.ts
CHANGED
|
@@ -228,6 +228,20 @@ declare const connectors: {
|
|
|
228
228
|
success: false;
|
|
229
229
|
error: string;
|
|
230
230
|
}>;
|
|
231
|
+
listDatasets: ConnectorTool<{
|
|
232
|
+
connectionId: string;
|
|
233
|
+
toolUseIntent?: string | undefined;
|
|
234
|
+
}, {
|
|
235
|
+
success: true;
|
|
236
|
+
datasets: {
|
|
237
|
+
datasetId: string;
|
|
238
|
+
location: string;
|
|
239
|
+
friendlyName: string;
|
|
240
|
+
}[];
|
|
241
|
+
} | {
|
|
242
|
+
success: false;
|
|
243
|
+
error: string;
|
|
244
|
+
}>;
|
|
231
245
|
}>;
|
|
232
246
|
bigqueryOauth: ConnectorPlugin<{
|
|
233
247
|
projectId: ParameterDefinition;
|
|
@@ -258,6 +272,20 @@ declare const connectors: {
|
|
|
258
272
|
success: false;
|
|
259
273
|
error: string;
|
|
260
274
|
}>;
|
|
275
|
+
listDatasets: ConnectorTool<{
|
|
276
|
+
connectionId: string;
|
|
277
|
+
toolUseIntent?: string | undefined;
|
|
278
|
+
}, {
|
|
279
|
+
success: true;
|
|
280
|
+
datasets: {
|
|
281
|
+
datasetId: string;
|
|
282
|
+
location: string;
|
|
283
|
+
friendlyName: string;
|
|
284
|
+
}[];
|
|
285
|
+
} | {
|
|
286
|
+
success: false;
|
|
287
|
+
error: string;
|
|
288
|
+
}>;
|
|
261
289
|
}>;
|
|
262
290
|
databricks: ConnectorPlugin<{
|
|
263
291
|
host: ParameterDefinition;
|
|
@@ -587,6 +615,20 @@ declare const bigqueryConnector: ConnectorPlugin<{
|
|
|
587
615
|
success: false;
|
|
588
616
|
error: string;
|
|
589
617
|
}>;
|
|
618
|
+
listDatasets: ConnectorTool<{
|
|
619
|
+
connectionId: string;
|
|
620
|
+
toolUseIntent?: string | undefined;
|
|
621
|
+
}, {
|
|
622
|
+
success: true;
|
|
623
|
+
datasets: {
|
|
624
|
+
datasetId: string;
|
|
625
|
+
location: string;
|
|
626
|
+
friendlyName: string;
|
|
627
|
+
}[];
|
|
628
|
+
} | {
|
|
629
|
+
success: false;
|
|
630
|
+
error: string;
|
|
631
|
+
}>;
|
|
590
632
|
}>;
|
|
591
633
|
|
|
592
634
|
declare const bigqueryOauthConnector: ConnectorPlugin<{
|
|
@@ -618,6 +660,20 @@ declare const bigqueryOauthConnector: ConnectorPlugin<{
|
|
|
618
660
|
success: false;
|
|
619
661
|
error: string;
|
|
620
662
|
}>;
|
|
663
|
+
listDatasets: ConnectorTool<{
|
|
664
|
+
connectionId: string;
|
|
665
|
+
toolUseIntent?: string | undefined;
|
|
666
|
+
}, {
|
|
667
|
+
success: true;
|
|
668
|
+
datasets: {
|
|
669
|
+
datasetId: string;
|
|
670
|
+
location: string;
|
|
671
|
+
friendlyName: string;
|
|
672
|
+
}[];
|
|
673
|
+
} | {
|
|
674
|
+
success: false;
|
|
675
|
+
error: string;
|
|
676
|
+
}>;
|
|
621
677
|
}>;
|
|
622
678
|
|
|
623
679
|
declare const awsAthenaConnector: ConnectorPlugin<{
|
package/dist/index.js
CHANGED
|
@@ -679,7 +679,7 @@ var snowflakePatConnector = new ConnectorPlugin({
|
|
|
679
679
|
description: "Connect to Snowflake using a Personal Access Token (PAT).",
|
|
680
680
|
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/6oyVtAcP3pMlXaOrts9unk/b7a9dc25d15c388b66e983041b855447/snowflake.svg",
|
|
681
681
|
parameters: parameters8,
|
|
682
|
-
releaseFlag: { dev1: true, dev2:
|
|
682
|
+
releaseFlag: { dev1: true, dev2: true, prod: true },
|
|
683
683
|
setup: snowflakeSetup,
|
|
684
684
|
systemPrompt: `## Snowflake SQL Notes
|
|
685
685
|
- Use fully qualified names DB.SCHEMA.TABLE for table references
|
|
@@ -1135,8 +1135,68 @@ var listProjectsTool = new ConnectorTool({
|
|
|
1135
1135
|
}
|
|
1136
1136
|
});
|
|
1137
1137
|
|
|
1138
|
+
// src/connectors/bigquery/tools/list-datasets.ts
|
|
1139
|
+
import { z as z6 } from "zod";
|
|
1140
|
+
var inputSchema6 = z6.object({
|
|
1141
|
+
toolUseIntent: z6.string().optional().describe(
|
|
1142
|
+
"Brief description of what you intend to accomplish with this tool call"
|
|
1143
|
+
),
|
|
1144
|
+
connectionId: z6.string().describe("ID of the BigQuery connection to use")
|
|
1145
|
+
});
|
|
1146
|
+
var outputSchema6 = z6.discriminatedUnion("success", [
|
|
1147
|
+
z6.object({
|
|
1148
|
+
success: z6.literal(true),
|
|
1149
|
+
datasets: z6.array(
|
|
1150
|
+
z6.object({
|
|
1151
|
+
datasetId: z6.string(),
|
|
1152
|
+
location: z6.string(),
|
|
1153
|
+
friendlyName: z6.string()
|
|
1154
|
+
})
|
|
1155
|
+
)
|
|
1156
|
+
}),
|
|
1157
|
+
z6.object({
|
|
1158
|
+
success: z6.literal(false),
|
|
1159
|
+
error: z6.string()
|
|
1160
|
+
})
|
|
1161
|
+
]);
|
|
1162
|
+
var listDatasetsTool = new ConnectorTool({
|
|
1163
|
+
name: "listDatasets",
|
|
1164
|
+
description: `List datasets in the selected BigQuery project. Returns dataset IDs, locations, and friendly names.`,
|
|
1165
|
+
inputSchema: inputSchema6,
|
|
1166
|
+
outputSchema: outputSchema6,
|
|
1167
|
+
async execute({ connectionId }, connections) {
|
|
1168
|
+
const connection = connections.find((c) => c.id === connectionId);
|
|
1169
|
+
if (!connection) {
|
|
1170
|
+
return {
|
|
1171
|
+
success: false,
|
|
1172
|
+
error: `Connection ${connectionId} not found`
|
|
1173
|
+
};
|
|
1174
|
+
}
|
|
1175
|
+
try {
|
|
1176
|
+
const { BigQuery } = await import("@google-cloud/bigquery");
|
|
1177
|
+
const projectId = parameters11.projectId.getValue(connection);
|
|
1178
|
+
const serviceAccountJsonBase64 = parameters11.serviceAccountKeyJsonBase64.getValue(connection);
|
|
1179
|
+
const credentials = JSON.parse(
|
|
1180
|
+
Buffer.from(serviceAccountJsonBase64, "base64").toString("utf-8")
|
|
1181
|
+
);
|
|
1182
|
+
const bq = new BigQuery({ projectId, credentials });
|
|
1183
|
+
const [datasetsResult] = await bq.getDatasets();
|
|
1184
|
+
const datasets = datasetsResult.map((ds) => ({
|
|
1185
|
+
datasetId: ds.id ?? "",
|
|
1186
|
+
location: ds.metadata?.location ?? "",
|
|
1187
|
+
friendlyName: ds.metadata?.friendlyName ?? ds.id ?? ""
|
|
1188
|
+
})).filter((ds) => ds.datasetId !== "");
|
|
1189
|
+
return { success: true, datasets };
|
|
1190
|
+
} catch (err) {
|
|
1191
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
1192
|
+
return { success: false, error: msg };
|
|
1193
|
+
}
|
|
1194
|
+
}
|
|
1195
|
+
});
|
|
1196
|
+
|
|
1138
1197
|
// src/connectors/bigquery/setup.ts
|
|
1139
1198
|
var listProjectsToolName = `bigquery_${listProjectsTool.name}`;
|
|
1199
|
+
var listDatasetsToolName = `bigquery_${listDatasetsTool.name}`;
|
|
1140
1200
|
var bigquerySetup = new ConnectorSetup({
|
|
1141
1201
|
ja: `## BigQuery \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u624B\u9806
|
|
1142
1202
|
|
|
@@ -1152,11 +1212,11 @@ var bigquerySetup = new ConnectorSetup({
|
|
|
1152
1212
|
3. \u30E6\u30FC\u30B6\u30FC\u304C\u9078\u629E\u3057\u305F\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E \`label\` \u304C\u30E1\u30C3\u30BB\u30FC\u30B8\u3068\u3057\u3066\u5C4A\u304F\u306E\u3067\u3001\u30B9\u30C6\u30C3\u30D72\u306B\u9032\u3080
|
|
1153
1213
|
|
|
1154
1214
|
#### \u30B9\u30C6\u30C3\u30D72: \u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u9078\u629E
|
|
1155
|
-
1. \`
|
|
1215
|
+
1. \`${listDatasetsToolName}\` \u3092\u547C\u3073\u51FA\u3057\u3066\u3001\u9078\u629E\u3055\u308C\u305F\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u5185\u306E\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u4E00\u89A7\u3092\u53D6\u5F97\u3059\u308B
|
|
1156
1216
|
2. \`askUserQuestion\` \u3092\u547C\u3073\u51FA\u3059\uFF08multiSelect: true\uFF09:
|
|
1157
1217
|
- \`question\`: \u4F7F\u7528\u3059\u308B\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u3092\u9078\u629E\u3059\u308B\u3088\u3046\u4FC3\u3059\u3002\u300C\u4E0A\u8A18\u4EE5\u5916\u306E\u30D1\u30D6\u30EA\u30C3\u30AF\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306F \`bigquery-public-data.{\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u540D}\` \u306E\u5F62\u5F0F\u3067\u81EA\u7531\u5165\u529B\u3067\u304D\u307E\u3059\u300D\u3068\u660E\u8A18\u3059\u308B
|
|
1158
1218
|
- \`options\`: \u4EE5\u4E0B\u3092\u9806\u756A\u306B\u7D50\u5408\u3059\u308B
|
|
1159
|
-
1. \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u5185\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8: \u5404 \`{ label:
|
|
1219
|
+
1. \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u5185\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8: \u5404 \`{ label: datasetId, description: location }\`
|
|
1160
1220
|
2. \u30D1\u30D6\u30EA\u30C3\u30AF\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\uFF08\u56FA\u5B9A\u3067\u672B\u5C3E\u306B\u8FFD\u52A0\uFF09:
|
|
1161
1221
|
- \`{ label: "bigquery-public-data.thelook_ecommerce (public dataset)", description: "EC\u30B5\u30A4\u30C8\u306E\u30C7\u30E2\u30C7\u30FC\u30BF" }\`
|
|
1162
1222
|
- \`{ label: "bigquery-public-data.google_analytics_sample (public dataset)", description: "Google Analytics \u30B5\u30F3\u30D7\u30EB" }\`
|
|
@@ -1198,11 +1258,11 @@ Follow these steps to set up the BigQuery connection.
|
|
|
1198
1258
|
3. The \`label\` of the user's selected project will arrive as a message. Proceed to Step 2
|
|
1199
1259
|
|
|
1200
1260
|
#### Step 2: Dataset Selection
|
|
1201
|
-
1.
|
|
1261
|
+
1. Call \`${listDatasetsToolName}\` to get the list of datasets in the selected project
|
|
1202
1262
|
2. Call \`askUserQuestion\` (multiSelect: true):
|
|
1203
1263
|
- \`question\`: Ask the user to select datasets. State that other public datasets can be entered freely in the format \`bigquery-public-data.{dataset_name}\`
|
|
1204
1264
|
- \`options\`: Concatenate in order:
|
|
1205
|
-
1. Project datasets: each \`{ label:
|
|
1265
|
+
1. Project datasets: each \`{ label: datasetId, description: location }\`
|
|
1206
1266
|
2. Public datasets (always append at the end):
|
|
1207
1267
|
- \`{ label: "bigquery-public-data.thelook_ecommerce (public dataset)", description: "E-commerce demo data" }\`
|
|
1208
1268
|
- \`{ label: "bigquery-public-data.google_analytics_sample (public dataset)", description: "Google Analytics sample" }\`
|
|
@@ -1233,27 +1293,27 @@ Follow these steps to set up the BigQuery connection.
|
|
|
1233
1293
|
});
|
|
1234
1294
|
|
|
1235
1295
|
// src/connectors/bigquery/tools/execute-query.ts
|
|
1236
|
-
import { z as
|
|
1296
|
+
import { z as z7 } from "zod";
|
|
1237
1297
|
var MAX_ROWS5 = 500;
|
|
1238
|
-
var
|
|
1239
|
-
toolUseIntent:
|
|
1298
|
+
var inputSchema7 = z7.object({
|
|
1299
|
+
toolUseIntent: z7.string().optional().describe(
|
|
1240
1300
|
"Brief description of what you intend to accomplish with this tool call"
|
|
1241
1301
|
),
|
|
1242
|
-
connectionId:
|
|
1243
|
-
sql:
|
|
1302
|
+
connectionId: z7.string().describe("ID of the BigQuery connection to use"),
|
|
1303
|
+
sql: z7.string().describe(
|
|
1244
1304
|
"BigQuery SQL (GoogleSQL) query. Use backtick-quoted fully qualified names `project.dataset.table` for table references."
|
|
1245
1305
|
)
|
|
1246
1306
|
});
|
|
1247
|
-
var
|
|
1248
|
-
|
|
1249
|
-
success:
|
|
1250
|
-
rowCount:
|
|
1251
|
-
truncated:
|
|
1252
|
-
rows:
|
|
1307
|
+
var outputSchema7 = z7.discriminatedUnion("success", [
|
|
1308
|
+
z7.object({
|
|
1309
|
+
success: z7.literal(true),
|
|
1310
|
+
rowCount: z7.number(),
|
|
1311
|
+
truncated: z7.boolean(),
|
|
1312
|
+
rows: z7.array(z7.record(z7.string(), z7.unknown()))
|
|
1253
1313
|
}),
|
|
1254
|
-
|
|
1255
|
-
success:
|
|
1256
|
-
error:
|
|
1314
|
+
z7.object({
|
|
1315
|
+
success: z7.literal(false),
|
|
1316
|
+
error: z7.string()
|
|
1257
1317
|
})
|
|
1258
1318
|
]);
|
|
1259
1319
|
var executeQueryTool5 = new ConnectorTool({
|
|
@@ -1261,8 +1321,8 @@ var executeQueryTool5 = new ConnectorTool({
|
|
|
1261
1321
|
description: `Execute SQL against BigQuery. Returns up to ${MAX_ROWS5} rows.
|
|
1262
1322
|
Use for: schema exploration (INFORMATION_SCHEMA), data sampling, analytical queries.
|
|
1263
1323
|
Avoid loading large amounts of data; always include LIMIT in queries.`,
|
|
1264
|
-
inputSchema:
|
|
1265
|
-
outputSchema:
|
|
1324
|
+
inputSchema: inputSchema7,
|
|
1325
|
+
outputSchema: outputSchema7,
|
|
1266
1326
|
async execute({ connectionId, sql }, connections) {
|
|
1267
1327
|
const connection = connections.find((c) => c.id === connectionId);
|
|
1268
1328
|
if (!connection) {
|
|
@@ -1300,7 +1360,7 @@ Avoid loading large amounts of data; always include LIMIT in queries.`,
|
|
|
1300
1360
|
});
|
|
1301
1361
|
|
|
1302
1362
|
// src/connectors/bigquery/index.ts
|
|
1303
|
-
var tools5 = { executeQuery: executeQueryTool5, listProjects: listProjectsTool };
|
|
1363
|
+
var tools5 = { executeQuery: executeQueryTool5, listProjects: listProjectsTool, listDatasets: listDatasetsTool };
|
|
1304
1364
|
var bigqueryConnector = new ConnectorPlugin({
|
|
1305
1365
|
slug: "bigquery",
|
|
1306
1366
|
authType: null,
|
|
@@ -1313,9 +1373,9 @@ var bigqueryConnector = new ConnectorPlugin({
|
|
|
1313
1373
|
systemPrompt: `## BigQuery SQL Notes
|
|
1314
1374
|
- Use backtick-quoted fully qualified names \`project.dataset.table\` for table references
|
|
1315
1375
|
- Use INFORMATION_SCHEMA for schema exploration
|
|
1316
|
-
- List datasets: \`SELECT schema_name FROM \\\`project_id\\\`.INFORMATION_SCHEMA.SCHEMATA\`
|
|
1317
1376
|
- List tables: \`SELECT table_name FROM \\\`project_id.dataset\\\`.INFORMATION_SCHEMA.TABLES\`
|
|
1318
1377
|
- List columns: \`SELECT column_name, data_type FROM \\\`project_id.dataset\\\`.INFORMATION_SCHEMA.COLUMNS WHERE table_name = 'xxx'\`
|
|
1378
|
+
- To list datasets, use the listDatasets tool instead of INFORMATION_SCHEMA.SCHEMATA
|
|
1319
1379
|
- Always specify project_id explicitly in queries`,
|
|
1320
1380
|
tools: tools5,
|
|
1321
1381
|
async checkConnection(params, _config) {
|
|
@@ -1352,7 +1412,7 @@ var bigqueryConnector = new ConnectorPlugin({
|
|
|
1352
1412
|
});
|
|
1353
1413
|
|
|
1354
1414
|
// src/connectors/bigquery-oauth/tools/list-projects.ts
|
|
1355
|
-
import { z as
|
|
1415
|
+
import { z as z8 } from "zod";
|
|
1356
1416
|
var REQUEST_TIMEOUT_MS = 6e4;
|
|
1357
1417
|
var cachedToken = null;
|
|
1358
1418
|
async function getProxyToken(config) {
|
|
@@ -1383,32 +1443,32 @@ async function getProxyToken(config) {
|
|
|
1383
1443
|
};
|
|
1384
1444
|
return data.token;
|
|
1385
1445
|
}
|
|
1386
|
-
var
|
|
1387
|
-
toolUseIntent:
|
|
1446
|
+
var inputSchema8 = z8.object({
|
|
1447
|
+
toolUseIntent: z8.string().optional().describe(
|
|
1388
1448
|
"Brief description of what you intend to accomplish with this tool call"
|
|
1389
1449
|
),
|
|
1390
|
-
connectionId:
|
|
1450
|
+
connectionId: z8.string().describe("ID of the BigQuery OAuth connection to use")
|
|
1391
1451
|
});
|
|
1392
|
-
var
|
|
1393
|
-
|
|
1394
|
-
success:
|
|
1395
|
-
projects:
|
|
1396
|
-
|
|
1397
|
-
projectId:
|
|
1398
|
-
friendlyName:
|
|
1452
|
+
var outputSchema8 = z8.discriminatedUnion("success", [
|
|
1453
|
+
z8.object({
|
|
1454
|
+
success: z8.literal(true),
|
|
1455
|
+
projects: z8.array(
|
|
1456
|
+
z8.object({
|
|
1457
|
+
projectId: z8.string(),
|
|
1458
|
+
friendlyName: z8.string()
|
|
1399
1459
|
})
|
|
1400
1460
|
)
|
|
1401
1461
|
}),
|
|
1402
|
-
|
|
1403
|
-
success:
|
|
1404
|
-
error:
|
|
1462
|
+
z8.object({
|
|
1463
|
+
success: z8.literal(false),
|
|
1464
|
+
error: z8.string()
|
|
1405
1465
|
})
|
|
1406
1466
|
]);
|
|
1407
1467
|
var listProjectsTool2 = new ConnectorTool({
|
|
1408
1468
|
name: "listProjects",
|
|
1409
1469
|
description: `List GCP projects accessible with the current OAuth credentials. Returns project IDs and friendly names.`,
|
|
1410
|
-
inputSchema:
|
|
1411
|
-
outputSchema:
|
|
1470
|
+
inputSchema: inputSchema8,
|
|
1471
|
+
outputSchema: outputSchema8,
|
|
1412
1472
|
async execute({ connectionId }, connections, config) {
|
|
1413
1473
|
const connection = connections.find((c) => c.id === connectionId);
|
|
1414
1474
|
if (!connection) {
|
|
@@ -1458,8 +1518,134 @@ var listProjectsTool2 = new ConnectorTool({
|
|
|
1458
1518
|
}
|
|
1459
1519
|
});
|
|
1460
1520
|
|
|
1521
|
+
// src/connectors/bigquery-oauth/tools/list-datasets.ts
|
|
1522
|
+
import { z as z9 } from "zod";
|
|
1523
|
+
|
|
1524
|
+
// src/connectors/bigquery-oauth/parameters.ts
|
|
1525
|
+
var parameters12 = {
|
|
1526
|
+
projectId: new ParameterDefinition({
|
|
1527
|
+
slug: "project-id",
|
|
1528
|
+
name: "Google Cloud Project ID",
|
|
1529
|
+
description: "The ID of the Google Cloud project where resources will be managed.",
|
|
1530
|
+
envVarBaseKey: "BIGQUERY_OAUTH_PROJECT_ID",
|
|
1531
|
+
type: "text",
|
|
1532
|
+
secret: false,
|
|
1533
|
+
required: false
|
|
1534
|
+
})
|
|
1535
|
+
};
|
|
1536
|
+
|
|
1537
|
+
// src/connectors/bigquery-oauth/tools/list-datasets.ts
|
|
1538
|
+
var REQUEST_TIMEOUT_MS2 = 6e4;
|
|
1539
|
+
var cachedToken2 = null;
|
|
1540
|
+
async function getProxyToken2(config) {
|
|
1541
|
+
if (cachedToken2 && cachedToken2.expiresAt > Date.now() + 6e4) {
|
|
1542
|
+
return cachedToken2.token;
|
|
1543
|
+
}
|
|
1544
|
+
const url = `${config.appApiBaseUrl}/v0/database/${config.projectId}/environment/${config.environmentId}/oauth-request-proxy-token`;
|
|
1545
|
+
const res = await fetch(url, {
|
|
1546
|
+
method: "POST",
|
|
1547
|
+
headers: {
|
|
1548
|
+
"Content-Type": "application/json",
|
|
1549
|
+
"x-api-key": config.appApiKey,
|
|
1550
|
+
"project-id": config.projectId
|
|
1551
|
+
},
|
|
1552
|
+
body: JSON.stringify({
|
|
1553
|
+
sandboxId: config.sandboxId,
|
|
1554
|
+
issuedBy: "coding-agent"
|
|
1555
|
+
})
|
|
1556
|
+
});
|
|
1557
|
+
if (!res.ok) {
|
|
1558
|
+
const errorText = await res.text().catch(() => res.statusText);
|
|
1559
|
+
throw new Error(`Failed to get proxy token: HTTP ${res.status} ${errorText}`);
|
|
1560
|
+
}
|
|
1561
|
+
const data = await res.json();
|
|
1562
|
+
cachedToken2 = {
|
|
1563
|
+
token: data.token,
|
|
1564
|
+
expiresAt: new Date(data.expiresAt).getTime()
|
|
1565
|
+
};
|
|
1566
|
+
return data.token;
|
|
1567
|
+
}
|
|
1568
|
+
var inputSchema9 = z9.object({
|
|
1569
|
+
toolUseIntent: z9.string().optional().describe(
|
|
1570
|
+
"Brief description of what you intend to accomplish with this tool call"
|
|
1571
|
+
),
|
|
1572
|
+
connectionId: z9.string().describe("ID of the BigQuery OAuth connection to use")
|
|
1573
|
+
});
|
|
1574
|
+
var outputSchema9 = z9.discriminatedUnion("success", [
|
|
1575
|
+
z9.object({
|
|
1576
|
+
success: z9.literal(true),
|
|
1577
|
+
datasets: z9.array(
|
|
1578
|
+
z9.object({
|
|
1579
|
+
datasetId: z9.string(),
|
|
1580
|
+
location: z9.string(),
|
|
1581
|
+
friendlyName: z9.string()
|
|
1582
|
+
})
|
|
1583
|
+
)
|
|
1584
|
+
}),
|
|
1585
|
+
z9.object({
|
|
1586
|
+
success: z9.literal(false),
|
|
1587
|
+
error: z9.string()
|
|
1588
|
+
})
|
|
1589
|
+
]);
|
|
1590
|
+
var listDatasetsTool2 = new ConnectorTool({
|
|
1591
|
+
name: "listDatasets",
|
|
1592
|
+
description: `List datasets in the selected BigQuery project. Returns dataset IDs, locations, and friendly names.`,
|
|
1593
|
+
inputSchema: inputSchema9,
|
|
1594
|
+
outputSchema: outputSchema9,
|
|
1595
|
+
async execute({ connectionId }, connections, config) {
|
|
1596
|
+
const connection = connections.find((c) => c.id === connectionId);
|
|
1597
|
+
if (!connection) {
|
|
1598
|
+
return {
|
|
1599
|
+
success: false,
|
|
1600
|
+
error: `Connection ${connectionId} not found`
|
|
1601
|
+
};
|
|
1602
|
+
}
|
|
1603
|
+
const gcpProjectId = parameters12.projectId.getValue(connection);
|
|
1604
|
+
console.log(
|
|
1605
|
+
`[connector-query] bigquery-oauth/${connection.name}: listDatasets`
|
|
1606
|
+
);
|
|
1607
|
+
try {
|
|
1608
|
+
const token = await getProxyToken2(config.oauthProxy);
|
|
1609
|
+
const proxyUrl = `https://${config.oauthProxy.sandboxId}.${config.oauthProxy.previewBaseDomain}/_sqcore/connections/${connectionId}/request`;
|
|
1610
|
+
const controller = new AbortController();
|
|
1611
|
+
const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS2);
|
|
1612
|
+
try {
|
|
1613
|
+
const response = await fetch(proxyUrl, {
|
|
1614
|
+
method: "POST",
|
|
1615
|
+
headers: {
|
|
1616
|
+
"Content-Type": "application/json",
|
|
1617
|
+
Authorization: `Bearer ${token}`
|
|
1618
|
+
},
|
|
1619
|
+
body: JSON.stringify({
|
|
1620
|
+
url: `https://bigquery.googleapis.com/bigquery/v2/projects/${gcpProjectId}/datasets`,
|
|
1621
|
+
method: "GET"
|
|
1622
|
+
}),
|
|
1623
|
+
signal: controller.signal
|
|
1624
|
+
});
|
|
1625
|
+
const data = await response.json();
|
|
1626
|
+
if (!response.ok) {
|
|
1627
|
+
const errorMessage = typeof data?.error === "string" ? data.error : typeof data?.message === "string" ? data.message : `HTTP ${response.status} ${response.statusText}`;
|
|
1628
|
+
return { success: false, error: errorMessage };
|
|
1629
|
+
}
|
|
1630
|
+
const datasets = (data.datasets ?? []).map((ds) => ({
|
|
1631
|
+
datasetId: ds.datasetReference?.datasetId ?? "",
|
|
1632
|
+
location: ds.location ?? "",
|
|
1633
|
+
friendlyName: ds.friendlyName ?? ds.datasetReference?.datasetId ?? ""
|
|
1634
|
+
})).filter((ds) => ds.datasetId !== "");
|
|
1635
|
+
return { success: true, datasets };
|
|
1636
|
+
} finally {
|
|
1637
|
+
clearTimeout(timeout);
|
|
1638
|
+
}
|
|
1639
|
+
} catch (err) {
|
|
1640
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
1641
|
+
return { success: false, error: msg };
|
|
1642
|
+
}
|
|
1643
|
+
}
|
|
1644
|
+
});
|
|
1645
|
+
|
|
1461
1646
|
// src/connectors/bigquery-oauth/setup.ts
|
|
1462
1647
|
var listProjectsToolName2 = `bigquery-oauth_${listProjectsTool2.name}`;
|
|
1648
|
+
var listDatasetsToolName2 = `bigquery-oauth_${listDatasetsTool2.name}`;
|
|
1463
1649
|
var bigquerySetup2 = new ConnectorSetup({
|
|
1464
1650
|
ja: `## BigQuery \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u624B\u9806
|
|
1465
1651
|
|
|
@@ -1475,11 +1661,11 @@ var bigquerySetup2 = new ConnectorSetup({
|
|
|
1475
1661
|
3. \u30E6\u30FC\u30B6\u30FC\u304C\u9078\u629E\u3057\u305F\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E \`label\` \u304C\u30E1\u30C3\u30BB\u30FC\u30B8\u3068\u3057\u3066\u5C4A\u304F\u306E\u3067\u3001\u30B9\u30C6\u30C3\u30D72\u306B\u9032\u3080
|
|
1476
1662
|
|
|
1477
1663
|
#### \u30B9\u30C6\u30C3\u30D72: \u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u9078\u629E
|
|
1478
|
-
1. \`
|
|
1664
|
+
1. \`${listDatasetsToolName2}\` \u3092\u547C\u3073\u51FA\u3057\u3066\u3001\u9078\u629E\u3055\u308C\u305F\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u5185\u306E\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u4E00\u89A7\u3092\u53D6\u5F97\u3059\u308B
|
|
1479
1665
|
2. \`askUserQuestion\` \u3092\u547C\u3073\u51FA\u3059\uFF08multiSelect: true\uFF09:
|
|
1480
1666
|
- \`question\`: \u4F7F\u7528\u3059\u308B\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u3092\u9078\u629E\u3059\u308B\u3088\u3046\u4FC3\u3059\u3002\u300C\u4E0A\u8A18\u4EE5\u5916\u306E\u30D1\u30D6\u30EA\u30C3\u30AF\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306F \`bigquery-public-data.{\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u540D}\` \u306E\u5F62\u5F0F\u3067\u81EA\u7531\u5165\u529B\u3067\u304D\u307E\u3059\u300D\u3068\u660E\u8A18\u3059\u308B
|
|
1481
1667
|
- \`options\`: \u4EE5\u4E0B\u3092\u9806\u756A\u306B\u7D50\u5408\u3059\u308B
|
|
1482
|
-
1. \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u5185\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8: \u5404 \`{ label:
|
|
1668
|
+
1. \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u5185\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8: \u5404 \`{ label: datasetId, description: location }\`
|
|
1483
1669
|
2. \u30D1\u30D6\u30EA\u30C3\u30AF\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\uFF08\u56FA\u5B9A\u3067\u672B\u5C3E\u306B\u8FFD\u52A0\uFF09:
|
|
1484
1670
|
- \`{ label: "bigquery-public-data.thelook_ecommerce (public dataset)", description: "EC\u30B5\u30A4\u30C8\u306E\u30C7\u30E2\u30C7\u30FC\u30BF" }\`
|
|
1485
1671
|
- \`{ label: "bigquery-public-data.google_analytics_sample (public dataset)", description: "Google Analytics \u30B5\u30F3\u30D7\u30EB" }\`
|
|
@@ -1521,11 +1707,11 @@ Follow these steps to set up the BigQuery connection.
|
|
|
1521
1707
|
3. The \`label\` of the user's selected project will arrive as a message. Proceed to Step 2
|
|
1522
1708
|
|
|
1523
1709
|
#### Step 2: Dataset Selection
|
|
1524
|
-
1.
|
|
1710
|
+
1. Call \`${listDatasetsToolName2}\` to get the list of datasets in the selected project
|
|
1525
1711
|
2. Call \`askUserQuestion\` (multiSelect: true):
|
|
1526
1712
|
- \`question\`: Ask the user to select datasets. State that other public datasets can be entered freely in the format \`bigquery-public-data.{dataset_name}\`
|
|
1527
1713
|
- \`options\`: Concatenate in order:
|
|
1528
|
-
1. Project datasets: each \`{ label:
|
|
1714
|
+
1. Project datasets: each \`{ label: datasetId, description: location }\`
|
|
1529
1715
|
2. Public datasets (always append at the end):
|
|
1530
1716
|
- \`{ label: "bigquery-public-data.thelook_ecommerce (public dataset)", description: "E-commerce demo data" }\`
|
|
1531
1717
|
- \`{ label: "bigquery-public-data.google_analytics_sample (public dataset)", description: "Google Analytics sample" }\`
|
|
@@ -1555,27 +1741,14 @@ Follow these steps to set up the BigQuery connection.
|
|
|
1555
1741
|
- Skip unnecessary explanations and proceed efficiently`
|
|
1556
1742
|
});
|
|
1557
1743
|
|
|
1558
|
-
// src/connectors/bigquery-oauth/parameters.ts
|
|
1559
|
-
var parameters12 = {
|
|
1560
|
-
projectId: new ParameterDefinition({
|
|
1561
|
-
slug: "project-id",
|
|
1562
|
-
name: "Google Cloud Project ID",
|
|
1563
|
-
description: "The ID of the Google Cloud project where resources will be managed.",
|
|
1564
|
-
envVarBaseKey: "BIGQUERY_OAUTH_PROJECT_ID",
|
|
1565
|
-
type: "text",
|
|
1566
|
-
secret: false,
|
|
1567
|
-
required: false
|
|
1568
|
-
})
|
|
1569
|
-
};
|
|
1570
|
-
|
|
1571
1744
|
// src/connectors/bigquery-oauth/tools/execute-query.ts
|
|
1572
|
-
import { z as
|
|
1745
|
+
import { z as z10 } from "zod";
|
|
1573
1746
|
var MAX_ROWS6 = 500;
|
|
1574
|
-
var
|
|
1575
|
-
var
|
|
1576
|
-
async function
|
|
1577
|
-
if (
|
|
1578
|
-
return
|
|
1747
|
+
var REQUEST_TIMEOUT_MS3 = 6e4;
|
|
1748
|
+
var cachedToken3 = null;
|
|
1749
|
+
async function getProxyToken3(config) {
|
|
1750
|
+
if (cachedToken3 && cachedToken3.expiresAt > Date.now() + 6e4) {
|
|
1751
|
+
return cachedToken3.token;
|
|
1579
1752
|
}
|
|
1580
1753
|
const url = `${config.appApiBaseUrl}/v0/database/${config.projectId}/environment/${config.environmentId}/oauth-request-proxy-token`;
|
|
1581
1754
|
const res = await fetch(url, {
|
|
@@ -1595,31 +1768,31 @@ async function getProxyToken2(config) {
|
|
|
1595
1768
|
throw new Error(`Failed to get proxy token: HTTP ${res.status} ${errorText}`);
|
|
1596
1769
|
}
|
|
1597
1770
|
const data = await res.json();
|
|
1598
|
-
|
|
1771
|
+
cachedToken3 = {
|
|
1599
1772
|
token: data.token,
|
|
1600
1773
|
expiresAt: new Date(data.expiresAt).getTime()
|
|
1601
1774
|
};
|
|
1602
1775
|
return data.token;
|
|
1603
1776
|
}
|
|
1604
|
-
var
|
|
1605
|
-
toolUseIntent:
|
|
1777
|
+
var inputSchema10 = z10.object({
|
|
1778
|
+
toolUseIntent: z10.string().optional().describe(
|
|
1606
1779
|
"Brief description of what you intend to accomplish with this tool call"
|
|
1607
1780
|
),
|
|
1608
|
-
connectionId:
|
|
1609
|
-
sql:
|
|
1781
|
+
connectionId: z10.string().describe("ID of the BigQuery OAuth connection to use"),
|
|
1782
|
+
sql: z10.string().describe(
|
|
1610
1783
|
"BigQuery SQL (GoogleSQL) query. Use backtick-quoted fully qualified names `project.dataset.table` for table references."
|
|
1611
1784
|
)
|
|
1612
1785
|
});
|
|
1613
|
-
var
|
|
1614
|
-
|
|
1615
|
-
success:
|
|
1616
|
-
rowCount:
|
|
1617
|
-
truncated:
|
|
1618
|
-
rows:
|
|
1786
|
+
var outputSchema10 = z10.discriminatedUnion("success", [
|
|
1787
|
+
z10.object({
|
|
1788
|
+
success: z10.literal(true),
|
|
1789
|
+
rowCount: z10.number(),
|
|
1790
|
+
truncated: z10.boolean(),
|
|
1791
|
+
rows: z10.array(z10.record(z10.string(), z10.unknown()))
|
|
1619
1792
|
}),
|
|
1620
|
-
|
|
1621
|
-
success:
|
|
1622
|
-
error:
|
|
1793
|
+
z10.object({
|
|
1794
|
+
success: z10.literal(false),
|
|
1795
|
+
error: z10.string()
|
|
1623
1796
|
})
|
|
1624
1797
|
]);
|
|
1625
1798
|
function parseQueryResponse(data) {
|
|
@@ -1640,8 +1813,8 @@ var executeQueryTool6 = new ConnectorTool({
|
|
|
1640
1813
|
description: `Execute SQL against BigQuery via OAuth. Returns up to ${MAX_ROWS6} rows.
|
|
1641
1814
|
Use for: schema exploration (INFORMATION_SCHEMA), data sampling, analytical queries.
|
|
1642
1815
|
Avoid loading large amounts of data; always include LIMIT in queries.`,
|
|
1643
|
-
inputSchema:
|
|
1644
|
-
outputSchema:
|
|
1816
|
+
inputSchema: inputSchema10,
|
|
1817
|
+
outputSchema: outputSchema10,
|
|
1645
1818
|
async execute({ connectionId, sql }, connections, config) {
|
|
1646
1819
|
const connection = connections.find((c) => c.id === connectionId);
|
|
1647
1820
|
if (!connection) {
|
|
@@ -1655,11 +1828,11 @@ Avoid loading large amounts of data; always include LIMIT in queries.`,
|
|
|
1655
1828
|
`[connector-query] bigquery-oauth/${connection.name}: ${sql}`
|
|
1656
1829
|
);
|
|
1657
1830
|
try {
|
|
1658
|
-
const token = await
|
|
1831
|
+
const token = await getProxyToken3(config.oauthProxy);
|
|
1659
1832
|
const proxyUrl = `https://${config.oauthProxy.sandboxId}.${config.oauthProxy.previewBaseDomain}/_sqcore/connections/${connectionId}/request`;
|
|
1660
1833
|
const queryUrl = `https://bigquery.googleapis.com/bigquery/v2/projects/${gcpProjectId}/queries`;
|
|
1661
1834
|
const controller = new AbortController();
|
|
1662
|
-
const timeout = setTimeout(() => controller.abort(),
|
|
1835
|
+
const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS3);
|
|
1663
1836
|
try {
|
|
1664
1837
|
const response = await fetch(proxyUrl, {
|
|
1665
1838
|
method: "POST",
|
|
@@ -1698,7 +1871,7 @@ Avoid loading large amounts of data; always include LIMIT in queries.`,
|
|
|
1698
1871
|
});
|
|
1699
1872
|
|
|
1700
1873
|
// src/connectors/bigquery-oauth/index.ts
|
|
1701
|
-
var tools6 = { executeQuery: executeQueryTool6, listProjects: listProjectsTool2 };
|
|
1874
|
+
var tools6 = { executeQuery: executeQueryTool6, listProjects: listProjectsTool2, listDatasets: listDatasetsTool2 };
|
|
1702
1875
|
function parseQueryResponse2(data) {
|
|
1703
1876
|
const schema = data.schema;
|
|
1704
1877
|
const rawRows = data.rows;
|
|
@@ -1718,7 +1891,7 @@ var bigqueryOauthConnector = new ConnectorPlugin({
|
|
|
1718
1891
|
description: "Connect to Google BigQuery for data warehouse and analytics using OAuth.",
|
|
1719
1892
|
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/6nlehQyOmdbktG5hOYkYMr/6ca559140d5ddc7dadc5eac88858a563/bigquery.svg",
|
|
1720
1893
|
parameters: parameters12,
|
|
1721
|
-
releaseFlag: { dev1: true, dev2:
|
|
1894
|
+
releaseFlag: { dev1: true, dev2: true, prod: true },
|
|
1722
1895
|
setup: bigquerySetup2,
|
|
1723
1896
|
proxyPolicy: {
|
|
1724
1897
|
allowlist: [
|
|
@@ -1729,9 +1902,9 @@ var bigqueryOauthConnector = new ConnectorPlugin({
|
|
|
1729
1902
|
systemPrompt: `## BigQuery SQL Notes (OAuth)
|
|
1730
1903
|
- Use backtick-quoted fully qualified names \`project.dataset.table\` for table references
|
|
1731
1904
|
- Use INFORMATION_SCHEMA for schema exploration
|
|
1732
|
-
- List datasets: \`SELECT schema_name FROM \\\`project_id\\\`.INFORMATION_SCHEMA.SCHEMATA\`
|
|
1733
1905
|
- List tables: \`SELECT table_name FROM \\\`project_id.dataset\\\`.INFORMATION_SCHEMA.TABLES\`
|
|
1734
1906
|
- List columns: \`SELECT column_name, data_type FROM \\\`project_id.dataset\\\`.INFORMATION_SCHEMA.COLUMNS WHERE table_name = 'xxx'\`
|
|
1907
|
+
- To list datasets, use the listDatasets tool instead of INFORMATION_SCHEMA.SCHEMATA
|
|
1735
1908
|
- Always specify project_id explicitly in queries`,
|
|
1736
1909
|
tools: tools6,
|
|
1737
1910
|
async checkConnection(params, config) {
|
|
@@ -1822,27 +1995,27 @@ var parameters13 = {
|
|
|
1822
1995
|
};
|
|
1823
1996
|
|
|
1824
1997
|
// src/connectors/aws-athena/tools/execute-query.ts
|
|
1825
|
-
import { z as
|
|
1998
|
+
import { z as z11 } from "zod";
|
|
1826
1999
|
var MAX_ROWS7 = 500;
|
|
1827
2000
|
var POLL_INTERVAL_MS = 1e3;
|
|
1828
2001
|
var POLL_TIMEOUT_MS = 12e4;
|
|
1829
|
-
var
|
|
1830
|
-
toolUseIntent:
|
|
2002
|
+
var inputSchema11 = z11.object({
|
|
2003
|
+
toolUseIntent: z11.string().optional().describe(
|
|
1831
2004
|
"Brief description of what you intend to accomplish with this tool call"
|
|
1832
2005
|
),
|
|
1833
|
-
connectionId:
|
|
1834
|
-
sql:
|
|
2006
|
+
connectionId: z11.string().describe("ID of the AWS Athena connection to use"),
|
|
2007
|
+
sql: z11.string().describe("Athena SQL query (Presto/Trino based)")
|
|
1835
2008
|
});
|
|
1836
|
-
var
|
|
1837
|
-
|
|
1838
|
-
success:
|
|
1839
|
-
rowCount:
|
|
1840
|
-
truncated:
|
|
1841
|
-
rows:
|
|
2009
|
+
var outputSchema11 = z11.discriminatedUnion("success", [
|
|
2010
|
+
z11.object({
|
|
2011
|
+
success: z11.literal(true),
|
|
2012
|
+
rowCount: z11.number(),
|
|
2013
|
+
truncated: z11.boolean(),
|
|
2014
|
+
rows: z11.array(z11.record(z11.string(), z11.unknown()))
|
|
1842
2015
|
}),
|
|
1843
|
-
|
|
1844
|
-
success:
|
|
1845
|
-
error:
|
|
2016
|
+
z11.object({
|
|
2017
|
+
success: z11.literal(false),
|
|
2018
|
+
error: z11.string()
|
|
1846
2019
|
})
|
|
1847
2020
|
]);
|
|
1848
2021
|
var executeQueryTool7 = new ConnectorTool({
|
|
@@ -1850,8 +2023,8 @@ var executeQueryTool7 = new ConnectorTool({
|
|
|
1850
2023
|
description: `Execute SQL against AWS Athena. Returns up to ${MAX_ROWS7} rows.
|
|
1851
2024
|
Use for: schema exploration (SHOW DATABASES/TABLES, DESCRIBE TABLE), data sampling, analytical queries on S3 data.
|
|
1852
2025
|
Avoid loading large amounts of data; always include LIMIT in queries.`,
|
|
1853
|
-
inputSchema:
|
|
1854
|
-
outputSchema:
|
|
2026
|
+
inputSchema: inputSchema11,
|
|
2027
|
+
outputSchema: outputSchema11,
|
|
1855
2028
|
async execute({ connectionId, sql }, connections) {
|
|
1856
2029
|
const connection = connections.find((c) => c.id === connectionId);
|
|
1857
2030
|
if (!connection) {
|
|
@@ -2151,29 +2324,29 @@ var parameters14 = {
|
|
|
2151
2324
|
};
|
|
2152
2325
|
|
|
2153
2326
|
// src/connectors/redshift/tools/execute-query.ts
|
|
2154
|
-
import { z as
|
|
2327
|
+
import { z as z12 } from "zod";
|
|
2155
2328
|
var MAX_ROWS8 = 500;
|
|
2156
2329
|
var POLL_INTERVAL_MS2 = 1e3;
|
|
2157
2330
|
var POLL_TIMEOUT_MS2 = 12e4;
|
|
2158
|
-
var
|
|
2159
|
-
toolUseIntent:
|
|
2331
|
+
var inputSchema12 = z12.object({
|
|
2332
|
+
toolUseIntent: z12.string().optional().describe(
|
|
2160
2333
|
"Brief description of what you intend to accomplish with this tool call"
|
|
2161
2334
|
),
|
|
2162
|
-
connectionId:
|
|
2163
|
-
sql:
|
|
2335
|
+
connectionId: z12.string().describe("ID of the Redshift connection to use"),
|
|
2336
|
+
sql: z12.string().describe(
|
|
2164
2337
|
"SQL query to execute against Amazon Redshift."
|
|
2165
2338
|
)
|
|
2166
2339
|
});
|
|
2167
|
-
var
|
|
2168
|
-
|
|
2169
|
-
success:
|
|
2170
|
-
rowCount:
|
|
2171
|
-
truncated:
|
|
2172
|
-
rows:
|
|
2340
|
+
var outputSchema12 = z12.discriminatedUnion("success", [
|
|
2341
|
+
z12.object({
|
|
2342
|
+
success: z12.literal(true),
|
|
2343
|
+
rowCount: z12.number(),
|
|
2344
|
+
truncated: z12.boolean(),
|
|
2345
|
+
rows: z12.array(z12.record(z12.string(), z12.unknown()))
|
|
2173
2346
|
}),
|
|
2174
|
-
|
|
2175
|
-
success:
|
|
2176
|
-
error:
|
|
2347
|
+
z12.object({
|
|
2348
|
+
success: z12.literal(false),
|
|
2349
|
+
error: z12.string()
|
|
2177
2350
|
})
|
|
2178
2351
|
]);
|
|
2179
2352
|
var executeQueryTool8 = new ConnectorTool({
|
|
@@ -2181,8 +2354,8 @@ var executeQueryTool8 = new ConnectorTool({
|
|
|
2181
2354
|
description: `Execute SQL against Amazon Redshift. Returns up to ${MAX_ROWS8} rows.
|
|
2182
2355
|
Use for: schema exploration, data sampling, analytical queries.
|
|
2183
2356
|
Avoid loading large amounts of data; always include LIMIT in queries.`,
|
|
2184
|
-
inputSchema:
|
|
2185
|
-
outputSchema:
|
|
2357
|
+
inputSchema: inputSchema12,
|
|
2358
|
+
outputSchema: outputSchema12,
|
|
2186
2359
|
async execute({ connectionId, sql }, connections) {
|
|
2187
2360
|
const connection = connections.find((c) => c.id === connectionId);
|
|
2188
2361
|
if (!connection) {
|
|
@@ -2442,25 +2615,25 @@ var parameters15 = {
|
|
|
2442
2615
|
};
|
|
2443
2616
|
|
|
2444
2617
|
// src/connectors/databricks/tools/execute-query.ts
|
|
2445
|
-
import { z as
|
|
2618
|
+
import { z as z13 } from "zod";
|
|
2446
2619
|
var MAX_ROWS9 = 500;
|
|
2447
|
-
var
|
|
2448
|
-
toolUseIntent:
|
|
2620
|
+
var inputSchema13 = z13.object({
|
|
2621
|
+
toolUseIntent: z13.string().optional().describe(
|
|
2449
2622
|
"Brief description of what you intend to accomplish with this tool call"
|
|
2450
2623
|
),
|
|
2451
|
-
connectionId:
|
|
2452
|
-
sql:
|
|
2624
|
+
connectionId: z13.string().describe("ID of the Databricks connection to use"),
|
|
2625
|
+
sql: z13.string().describe("Databricks SQL query (Spark SQL based)")
|
|
2453
2626
|
});
|
|
2454
|
-
var
|
|
2455
|
-
|
|
2456
|
-
success:
|
|
2457
|
-
rowCount:
|
|
2458
|
-
truncated:
|
|
2459
|
-
rows:
|
|
2627
|
+
var outputSchema13 = z13.discriminatedUnion("success", [
|
|
2628
|
+
z13.object({
|
|
2629
|
+
success: z13.literal(true),
|
|
2630
|
+
rowCount: z13.number(),
|
|
2631
|
+
truncated: z13.boolean(),
|
|
2632
|
+
rows: z13.array(z13.record(z13.string(), z13.unknown()))
|
|
2460
2633
|
}),
|
|
2461
|
-
|
|
2462
|
-
success:
|
|
2463
|
-
error:
|
|
2634
|
+
z13.object({
|
|
2635
|
+
success: z13.literal(false),
|
|
2636
|
+
error: z13.string()
|
|
2464
2637
|
})
|
|
2465
2638
|
]);
|
|
2466
2639
|
var executeQueryTool9 = new ConnectorTool({
|
|
@@ -2468,8 +2641,8 @@ var executeQueryTool9 = new ConnectorTool({
|
|
|
2468
2641
|
description: `Execute SQL against Databricks. Returns up to ${MAX_ROWS9} rows.
|
|
2469
2642
|
Use for: schema exploration (SHOW CATALOGS/DATABASES/TABLES, DESCRIBE TABLE), data sampling, analytical queries.
|
|
2470
2643
|
Avoid loading large amounts of data; always include LIMIT in queries.`,
|
|
2471
|
-
inputSchema:
|
|
2472
|
-
outputSchema:
|
|
2644
|
+
inputSchema: inputSchema13,
|
|
2645
|
+
outputSchema: outputSchema13,
|
|
2473
2646
|
async execute({ connectionId, sql }, connections) {
|
|
2474
2647
|
const connection = connections.find((c) => c.id === connectionId);
|
|
2475
2648
|
if (!connection) {
|
|
@@ -2595,25 +2768,25 @@ var databricksConnector = new ConnectorPlugin({
|
|
|
2595
2768
|
});
|
|
2596
2769
|
|
|
2597
2770
|
// src/connectors/airtable/tools/request.ts
|
|
2598
|
-
import { z as
|
|
2771
|
+
import { z as z14 } from "zod";
|
|
2599
2772
|
var BASE_URL = "https://api.airtable.com/v0/";
|
|
2600
|
-
var
|
|
2601
|
-
var
|
|
2602
|
-
toolUseIntent:
|
|
2603
|
-
connectionId:
|
|
2604
|
-
method:
|
|
2605
|
-
path:
|
|
2606
|
-
body:
|
|
2773
|
+
var REQUEST_TIMEOUT_MS4 = 6e4;
|
|
2774
|
+
var inputSchema14 = z14.object({
|
|
2775
|
+
toolUseIntent: z14.string().optional().describe("Brief description of what you intend to accomplish with this tool call"),
|
|
2776
|
+
connectionId: z14.string().describe("ID of the Airtable connection to use"),
|
|
2777
|
+
method: z14.enum(["GET", "POST", "PATCH", "DELETE"]).describe("HTTP method"),
|
|
2778
|
+
path: z14.string().describe("API path (e.g., '{baseId}/{tableIdOrName}', 'meta/bases/{baseId}/tables'). {baseId} is automatically replaced."),
|
|
2779
|
+
body: z14.record(z14.string(), z14.unknown()).optional().describe("Request body (JSON)")
|
|
2607
2780
|
});
|
|
2608
|
-
var
|
|
2609
|
-
|
|
2610
|
-
success:
|
|
2611
|
-
status:
|
|
2612
|
-
data:
|
|
2781
|
+
var outputSchema14 = z14.discriminatedUnion("success", [
|
|
2782
|
+
z14.object({
|
|
2783
|
+
success: z14.literal(true),
|
|
2784
|
+
status: z14.number(),
|
|
2785
|
+
data: z14.record(z14.string(), z14.unknown())
|
|
2613
2786
|
}),
|
|
2614
|
-
|
|
2615
|
-
success:
|
|
2616
|
-
error:
|
|
2787
|
+
z14.object({
|
|
2788
|
+
success: z14.literal(false),
|
|
2789
|
+
error: z14.string()
|
|
2617
2790
|
})
|
|
2618
2791
|
]);
|
|
2619
2792
|
var requestTool = new ConnectorTool({
|
|
@@ -2621,8 +2794,8 @@ var requestTool = new ConnectorTool({
|
|
|
2621
2794
|
description: `Send authenticated requests to the Airtable API.
|
|
2622
2795
|
Authentication is handled automatically using the API Key.
|
|
2623
2796
|
{baseId} in the path is automatically replaced with the connection's base-id.`,
|
|
2624
|
-
inputSchema:
|
|
2625
|
-
outputSchema:
|
|
2797
|
+
inputSchema: inputSchema14,
|
|
2798
|
+
outputSchema: outputSchema14,
|
|
2626
2799
|
async execute({ connectionId, method, path, body }, connections) {
|
|
2627
2800
|
const connection = connections.find((c) => c.id === connectionId);
|
|
2628
2801
|
if (!connection) {
|
|
@@ -2635,7 +2808,7 @@ Authentication is handled automatically using the API Key.
|
|
|
2635
2808
|
const resolvedPath = path.replace(/\{baseId\}/g, baseId);
|
|
2636
2809
|
const url = `${BASE_URL}${resolvedPath}`;
|
|
2637
2810
|
const controller = new AbortController();
|
|
2638
|
-
const timeout = setTimeout(() => controller.abort(),
|
|
2811
|
+
const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS4);
|
|
2639
2812
|
try {
|
|
2640
2813
|
const response = await fetch(url, {
|
|
2641
2814
|
method,
|
|
@@ -2726,25 +2899,25 @@ await airtable.updateRecords("Tasks", [
|
|
|
2726
2899
|
});
|
|
2727
2900
|
|
|
2728
2901
|
// src/connectors/google-analytics/tools/request.ts
|
|
2729
|
-
import { z as
|
|
2902
|
+
import { z as z15 } from "zod";
|
|
2730
2903
|
var BASE_URL2 = "https://analyticsdata.googleapis.com/v1beta/";
|
|
2731
|
-
var
|
|
2732
|
-
var
|
|
2733
|
-
toolUseIntent:
|
|
2734
|
-
connectionId:
|
|
2735
|
-
method:
|
|
2736
|
-
path:
|
|
2737
|
-
body:
|
|
2904
|
+
var REQUEST_TIMEOUT_MS5 = 6e4;
|
|
2905
|
+
var inputSchema15 = z15.object({
|
|
2906
|
+
toolUseIntent: z15.string().optional().describe("Brief description of what you intend to accomplish with this tool call"),
|
|
2907
|
+
connectionId: z15.string().describe("ID of the Google Analytics connection to use"),
|
|
2908
|
+
method: z15.enum(["GET", "POST"]).describe("HTTP method"),
|
|
2909
|
+
path: z15.string().describe("API path (e.g., 'properties/{propertyId}:runReport'). {propertyId} is automatically replaced."),
|
|
2910
|
+
body: z15.record(z15.string(), z15.unknown()).optional().describe("POST request body (JSON)")
|
|
2738
2911
|
});
|
|
2739
|
-
var
|
|
2740
|
-
|
|
2741
|
-
success:
|
|
2742
|
-
status:
|
|
2743
|
-
data:
|
|
2912
|
+
var outputSchema15 = z15.discriminatedUnion("success", [
|
|
2913
|
+
z15.object({
|
|
2914
|
+
success: z15.literal(true),
|
|
2915
|
+
status: z15.number(),
|
|
2916
|
+
data: z15.record(z15.string(), z15.unknown())
|
|
2744
2917
|
}),
|
|
2745
|
-
|
|
2746
|
-
success:
|
|
2747
|
-
error:
|
|
2918
|
+
z15.object({
|
|
2919
|
+
success: z15.literal(false),
|
|
2920
|
+
error: z15.string()
|
|
2748
2921
|
})
|
|
2749
2922
|
]);
|
|
2750
2923
|
var requestTool2 = new ConnectorTool({
|
|
@@ -2752,8 +2925,8 @@ var requestTool2 = new ConnectorTool({
|
|
|
2752
2925
|
description: `Send authenticated requests to the Google Analytics Data API.
|
|
2753
2926
|
Authentication is handled automatically using a service account.
|
|
2754
2927
|
{propertyId} in the path is automatically replaced with the connection's property-id.`,
|
|
2755
|
-
inputSchema:
|
|
2756
|
-
outputSchema:
|
|
2928
|
+
inputSchema: inputSchema15,
|
|
2929
|
+
outputSchema: outputSchema15,
|
|
2757
2930
|
async execute({ connectionId, method, path, body }, connections) {
|
|
2758
2931
|
const connection = connections.find((c) => c.id === connectionId);
|
|
2759
2932
|
if (!connection) {
|
|
@@ -2778,7 +2951,7 @@ Authentication is handled automatically using a service account.
|
|
|
2778
2951
|
const resolvedPath = path.replace(/\{propertyId\}/g, propertyId);
|
|
2779
2952
|
const url = `${BASE_URL2}${resolvedPath}`;
|
|
2780
2953
|
const controller = new AbortController();
|
|
2781
|
-
const timeout = setTimeout(() => controller.abort(),
|
|
2954
|
+
const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS5);
|
|
2782
2955
|
try {
|
|
2783
2956
|
const response = await fetch(url, {
|
|
2784
2957
|
method,
|
|
@@ -2879,32 +3052,32 @@ const realtime = await ga.runRealtimeReport({
|
|
|
2879
3052
|
});
|
|
2880
3053
|
|
|
2881
3054
|
// src/connectors/kintone/tools/request.ts
|
|
2882
|
-
import { z as
|
|
2883
|
-
var
|
|
2884
|
-
var
|
|
2885
|
-
toolUseIntent:
|
|
2886
|
-
connectionId:
|
|
2887
|
-
method:
|
|
2888
|
-
path:
|
|
2889
|
-
body:
|
|
3055
|
+
import { z as z16 } from "zod";
|
|
3056
|
+
var REQUEST_TIMEOUT_MS6 = 6e4;
|
|
3057
|
+
var inputSchema16 = z16.object({
|
|
3058
|
+
toolUseIntent: z16.string().optional().describe("Brief description of what you intend to accomplish with this tool call"),
|
|
3059
|
+
connectionId: z16.string().describe("ID of the kintone connection to use"),
|
|
3060
|
+
method: z16.enum(["GET", "POST", "PUT", "DELETE"]).describe("HTTP method"),
|
|
3061
|
+
path: z16.string().describe("API path (e.g., 'apps.json', 'records.json?app=1&query=...')"),
|
|
3062
|
+
body: z16.record(z16.string(), z16.unknown()).optional().describe("Request body (JSON)")
|
|
2890
3063
|
});
|
|
2891
|
-
var
|
|
2892
|
-
|
|
2893
|
-
success:
|
|
2894
|
-
status:
|
|
2895
|
-
data:
|
|
3064
|
+
var outputSchema16 = z16.discriminatedUnion("success", [
|
|
3065
|
+
z16.object({
|
|
3066
|
+
success: z16.literal(true),
|
|
3067
|
+
status: z16.number(),
|
|
3068
|
+
data: z16.record(z16.string(), z16.unknown())
|
|
2896
3069
|
}),
|
|
2897
|
-
|
|
2898
|
-
success:
|
|
2899
|
-
error:
|
|
3070
|
+
z16.object({
|
|
3071
|
+
success: z16.literal(false),
|
|
3072
|
+
error: z16.string()
|
|
2900
3073
|
})
|
|
2901
3074
|
]);
|
|
2902
3075
|
var requestTool3 = new ConnectorTool({
|
|
2903
3076
|
name: "request",
|
|
2904
3077
|
description: `Send authenticated requests to the kintone REST API.
|
|
2905
3078
|
Authentication is handled automatically using username and password.`,
|
|
2906
|
-
inputSchema:
|
|
2907
|
-
outputSchema:
|
|
3079
|
+
inputSchema: inputSchema16,
|
|
3080
|
+
outputSchema: outputSchema16,
|
|
2908
3081
|
async execute({ connectionId, method, path, body }, connections) {
|
|
2909
3082
|
const connection = connections.find((c) => c.id === connectionId);
|
|
2910
3083
|
if (!connection) {
|
|
@@ -2918,7 +3091,7 @@ Authentication is handled automatically using username and password.`,
|
|
|
2918
3091
|
const authToken = Buffer.from(`${username}:${password}`).toString("base64");
|
|
2919
3092
|
const url = `${baseUrl.replace(/\/+$/, "")}/k/v1/${path}`;
|
|
2920
3093
|
const controller = new AbortController();
|
|
2921
|
-
const timeout = setTimeout(() => controller.abort(),
|
|
3094
|
+
const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS6);
|
|
2922
3095
|
try {
|
|
2923
3096
|
const headers = {
|
|
2924
3097
|
"X-Cybozu-Authorization": authToken
|
|
@@ -3015,33 +3188,33 @@ const { apps } = await kintone.listApps();
|
|
|
3015
3188
|
});
|
|
3016
3189
|
|
|
3017
3190
|
// src/connectors/wix-store/tools/request.ts
|
|
3018
|
-
import { z as
|
|
3191
|
+
import { z as z17 } from "zod";
|
|
3019
3192
|
var BASE_URL3 = "https://www.wixapis.com/";
|
|
3020
|
-
var
|
|
3021
|
-
var
|
|
3022
|
-
toolUseIntent:
|
|
3023
|
-
connectionId:
|
|
3024
|
-
method:
|
|
3025
|
-
path:
|
|
3026
|
-
body:
|
|
3193
|
+
var REQUEST_TIMEOUT_MS7 = 6e4;
|
|
3194
|
+
var inputSchema17 = z17.object({
|
|
3195
|
+
toolUseIntent: z17.string().optional().describe("Brief description of what you intend to accomplish with this tool call"),
|
|
3196
|
+
connectionId: z17.string().describe("ID of the Wix Store connection to use"),
|
|
3197
|
+
method: z17.enum(["GET", "POST"]).describe("HTTP method"),
|
|
3198
|
+
path: z17.string().describe("API path (e.g., 'stores/v1/products/query', 'stores/v2/orders/query')"),
|
|
3199
|
+
body: z17.record(z17.string(), z17.unknown()).optional().describe("Request body (JSON)")
|
|
3027
3200
|
});
|
|
3028
|
-
var
|
|
3029
|
-
|
|
3030
|
-
success:
|
|
3031
|
-
status:
|
|
3032
|
-
data:
|
|
3201
|
+
var outputSchema17 = z17.discriminatedUnion("success", [
|
|
3202
|
+
z17.object({
|
|
3203
|
+
success: z17.literal(true),
|
|
3204
|
+
status: z17.number(),
|
|
3205
|
+
data: z17.record(z17.string(), z17.unknown())
|
|
3033
3206
|
}),
|
|
3034
|
-
|
|
3035
|
-
success:
|
|
3036
|
-
error:
|
|
3207
|
+
z17.object({
|
|
3208
|
+
success: z17.literal(false),
|
|
3209
|
+
error: z17.string()
|
|
3037
3210
|
})
|
|
3038
3211
|
]);
|
|
3039
3212
|
var requestTool4 = new ConnectorTool({
|
|
3040
3213
|
name: "request",
|
|
3041
3214
|
description: `Send authenticated requests to the Wix Store API.
|
|
3042
3215
|
Authentication is handled automatically using the API Key and Site ID.`,
|
|
3043
|
-
inputSchema:
|
|
3044
|
-
outputSchema:
|
|
3216
|
+
inputSchema: inputSchema17,
|
|
3217
|
+
outputSchema: outputSchema17,
|
|
3045
3218
|
async execute({ connectionId, method, path, body }, connections) {
|
|
3046
3219
|
const connection = connections.find((c) => c.id === connectionId);
|
|
3047
3220
|
if (!connection) {
|
|
@@ -3053,7 +3226,7 @@ Authentication is handled automatically using the API Key and Site ID.`,
|
|
|
3053
3226
|
const siteId = parameters4.siteId.getValue(connection);
|
|
3054
3227
|
const url = `${BASE_URL3}${path}`;
|
|
3055
3228
|
const controller = new AbortController();
|
|
3056
|
-
const timeout = setTimeout(() => controller.abort(),
|
|
3229
|
+
const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS7);
|
|
3057
3230
|
try {
|
|
3058
3231
|
const response = await fetch(url, {
|
|
3059
3232
|
method,
|
|
@@ -3151,27 +3324,27 @@ const { collections } = await wix.queryCollections({ paging: { limit: 50 } });
|
|
|
3151
3324
|
});
|
|
3152
3325
|
|
|
3153
3326
|
// src/connectors/dbt/tools/request.ts
|
|
3154
|
-
import { z as
|
|
3155
|
-
var
|
|
3327
|
+
import { z as z18 } from "zod";
|
|
3328
|
+
var REQUEST_TIMEOUT_MS8 = 6e4;
|
|
3156
3329
|
function resolveGraphqlEndpoint(host) {
|
|
3157
3330
|
if (host.includes("emea")) return "https://metadata.emea.dbt.com/graphql";
|
|
3158
3331
|
if (host.includes(".au.")) return "https://metadata.au.dbt.com/graphql";
|
|
3159
3332
|
return "https://metadata.cloud.getdbt.com/graphql";
|
|
3160
3333
|
}
|
|
3161
|
-
var
|
|
3162
|
-
toolUseIntent:
|
|
3163
|
-
connectionId:
|
|
3164
|
-
query:
|
|
3165
|
-
variables:
|
|
3334
|
+
var inputSchema18 = z18.object({
|
|
3335
|
+
toolUseIntent: z18.string().optional().describe("Brief description of what you intend to accomplish with this tool call"),
|
|
3336
|
+
connectionId: z18.string().describe("ID of the dbt Cloud connection to use"),
|
|
3337
|
+
query: z18.string().describe("GraphQL query"),
|
|
3338
|
+
variables: z18.record(z18.string(), z18.unknown()).optional().describe("GraphQL variables (JSON)")
|
|
3166
3339
|
});
|
|
3167
|
-
var
|
|
3168
|
-
|
|
3169
|
-
success:
|
|
3170
|
-
data:
|
|
3340
|
+
var outputSchema18 = z18.discriminatedUnion("success", [
|
|
3341
|
+
z18.object({
|
|
3342
|
+
success: z18.literal(true),
|
|
3343
|
+
data: z18.record(z18.string(), z18.unknown())
|
|
3171
3344
|
}),
|
|
3172
|
-
|
|
3173
|
-
success:
|
|
3174
|
-
error:
|
|
3345
|
+
z18.object({
|
|
3346
|
+
success: z18.literal(false),
|
|
3347
|
+
error: z18.string()
|
|
3175
3348
|
})
|
|
3176
3349
|
]);
|
|
3177
3350
|
var requestTool5 = new ConnectorTool({
|
|
@@ -3179,8 +3352,8 @@ var requestTool5 = new ConnectorTool({
|
|
|
3179
3352
|
description: `Send authenticated requests to the dbt Cloud Discovery API (GraphQL).
|
|
3180
3353
|
Authentication is handled automatically using the API token.
|
|
3181
3354
|
{environmentId} in GraphQL variables is automatically replaced with the prod-env-id.`,
|
|
3182
|
-
inputSchema:
|
|
3183
|
-
outputSchema:
|
|
3355
|
+
inputSchema: inputSchema18,
|
|
3356
|
+
outputSchema: outputSchema18,
|
|
3184
3357
|
async execute({ connectionId, query, variables }, connections) {
|
|
3185
3358
|
const connection = connections.find((c) => c.id === connectionId);
|
|
3186
3359
|
if (!connection) {
|
|
@@ -3196,7 +3369,7 @@ Authentication is handled automatically using the API token.
|
|
|
3196
3369
|
) : void 0;
|
|
3197
3370
|
const endpoint = resolveGraphqlEndpoint(host);
|
|
3198
3371
|
const controller = new AbortController();
|
|
3199
|
-
const timeout = setTimeout(() => controller.abort(),
|
|
3372
|
+
const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS8);
|
|
3200
3373
|
try {
|
|
3201
3374
|
const response = await fetch(endpoint, {
|
|
3202
3375
|
method: "POST",
|
|
@@ -3339,27 +3512,27 @@ var parameters16 = {
|
|
|
3339
3512
|
};
|
|
3340
3513
|
|
|
3341
3514
|
// src/connectors/squadbase-db/tools/execute-query.ts
|
|
3342
|
-
import { z as
|
|
3515
|
+
import { z as z19 } from "zod";
|
|
3343
3516
|
var MAX_ROWS10 = 500;
|
|
3344
3517
|
var CONNECT_TIMEOUT_MS3 = 1e4;
|
|
3345
3518
|
var STATEMENT_TIMEOUT_MS2 = 6e4;
|
|
3346
|
-
var
|
|
3347
|
-
toolUseIntent:
|
|
3519
|
+
var inputSchema19 = z19.object({
|
|
3520
|
+
toolUseIntent: z19.string().optional().describe(
|
|
3348
3521
|
"Brief description of what you intend to accomplish with this tool call"
|
|
3349
3522
|
),
|
|
3350
|
-
connectionId:
|
|
3351
|
-
sql:
|
|
3523
|
+
connectionId: z19.string().describe("ID of the Squadbase DB connection to use"),
|
|
3524
|
+
sql: z19.string().describe("PostgreSQL SQL query. Always include LIMIT in queries.")
|
|
3352
3525
|
});
|
|
3353
|
-
var
|
|
3354
|
-
|
|
3355
|
-
success:
|
|
3356
|
-
rowCount:
|
|
3357
|
-
truncated:
|
|
3358
|
-
rows:
|
|
3526
|
+
var outputSchema19 = z19.discriminatedUnion("success", [
|
|
3527
|
+
z19.object({
|
|
3528
|
+
success: z19.literal(true),
|
|
3529
|
+
rowCount: z19.number(),
|
|
3530
|
+
truncated: z19.boolean(),
|
|
3531
|
+
rows: z19.array(z19.record(z19.string(), z19.unknown()))
|
|
3359
3532
|
}),
|
|
3360
|
-
|
|
3361
|
-
success:
|
|
3362
|
-
error:
|
|
3533
|
+
z19.object({
|
|
3534
|
+
success: z19.literal(false),
|
|
3535
|
+
error: z19.string()
|
|
3363
3536
|
})
|
|
3364
3537
|
]);
|
|
3365
3538
|
var executeQueryTool10 = new ConnectorTool({
|
|
@@ -3367,8 +3540,8 @@ var executeQueryTool10 = new ConnectorTool({
|
|
|
3367
3540
|
description: `Execute SQL against Squadbase DB (PostgreSQL). Returns up to ${MAX_ROWS10} rows.
|
|
3368
3541
|
Use for: schema exploration (information_schema), data sampling, analytical queries.
|
|
3369
3542
|
Avoid loading large amounts of data; always include LIMIT in queries.`,
|
|
3370
|
-
inputSchema:
|
|
3371
|
-
outputSchema:
|
|
3543
|
+
inputSchema: inputSchema19,
|
|
3544
|
+
outputSchema: outputSchema19,
|
|
3372
3545
|
async execute({ connectionId, sql }, connections) {
|
|
3373
3546
|
const connection = connections.find((c) => c.id === connectionId);
|
|
3374
3547
|
if (!connection) {
|
|
@@ -3473,7 +3646,7 @@ var openaiConnector = new ConnectorPlugin({
|
|
|
3473
3646
|
description: "Connect to OpenAI for AI model inference, embeddings, and image generation.",
|
|
3474
3647
|
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/53XJtCgUlW10x6i1X8xpxM/0bfd634069f1d74241296543cb20427a/openai.svg",
|
|
3475
3648
|
parameters: parameters6,
|
|
3476
|
-
releaseFlag: { dev1: true, dev2:
|
|
3649
|
+
releaseFlag: { dev1: true, dev2: true, prod: true },
|
|
3477
3650
|
systemPrompt: `## OpenAI SDK (TypeScript handler)
|
|
3478
3651
|
Use the OpenAI connector via the SDK in TypeScript handlers:
|
|
3479
3652
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@squadbase/connectors",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.1-dev.1",
|
|
4
4
|
"description": "Squadbase Connectors",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -30,6 +30,8 @@
|
|
|
30
30
|
"sync:dev1": "API_BASE_URL=https://dev1-api.squadbase.dev/v0 dotenv tsx scripts/sync-connectors.ts",
|
|
31
31
|
"sync:dev2": "API_BASE_URL=https://dev2-api.squadbase.dev/v0 dotenv tsx scripts/sync-connectors.ts",
|
|
32
32
|
"sync:prod": "API_BASE_URL=https://api.squadbase.dev/v0 dotenv tsx scripts/sync-connectors.ts",
|
|
33
|
+
"release": "npm run build && npm version patch && npm publish",
|
|
34
|
+
"release:dev": "npm run build && npm version prerelease --preid=dev && npm publish --tag dev",
|
|
33
35
|
"test": "vitest",
|
|
34
36
|
"test:e2e": "dotenv -e e2e/fixtures/secrets/.env -- vitest run --config vitest.config.e2e.ts"
|
|
35
37
|
},
|