@squadbase/vite-server 0.0.1-build-25 → 0.0.2
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 +1194 -455
- package/dist/connectors/kintone.d.ts +5 -0
- package/dist/connectors/kintone.js +68 -0
- package/dist/index.js +55 -16952
- package/dist/main.js +55 -16952
- package/dist/vite-plugin.js +56 -16953
- package/package.json +6 -2
package/dist/cli/index.js
CHANGED
|
@@ -6872,11 +6872,11 @@ var require_bignumber = __commonJS({
|
|
|
6872
6872
|
return n > 0 || n === i ? i : i - 1;
|
|
6873
6873
|
}
|
|
6874
6874
|
function coeffToString(a) {
|
|
6875
|
-
var s,
|
|
6875
|
+
var s, z19, i = 1, j = a.length, r = a[0] + "";
|
|
6876
6876
|
for (; i < j; ) {
|
|
6877
6877
|
s = a[i++] + "";
|
|
6878
|
-
|
|
6879
|
-
for (;
|
|
6878
|
+
z19 = LOG_BASE - s.length;
|
|
6879
|
+
for (; z19--; s = "0" + s) ;
|
|
6880
6880
|
r += s;
|
|
6881
6881
|
}
|
|
6882
6882
|
for (j = r.length; r.charCodeAt(--j) === 48; ) ;
|
|
@@ -6909,15 +6909,15 @@ var require_bignumber = __commonJS({
|
|
|
6909
6909
|
function toExponential(str, e) {
|
|
6910
6910
|
return (str.length > 1 ? str.charAt(0) + "." + str.slice(1) : str) + (e < 0 ? "e" : "e+") + e;
|
|
6911
6911
|
}
|
|
6912
|
-
function toFixedPoint(str, e,
|
|
6912
|
+
function toFixedPoint(str, e, z19) {
|
|
6913
6913
|
var len, zs;
|
|
6914
6914
|
if (e < 0) {
|
|
6915
|
-
for (zs =
|
|
6915
|
+
for (zs = z19 + "."; ++e; zs += z19) ;
|
|
6916
6916
|
str = zs + str;
|
|
6917
6917
|
} else {
|
|
6918
6918
|
len = str.length;
|
|
6919
6919
|
if (++e > len) {
|
|
6920
|
-
for (zs =
|
|
6920
|
+
for (zs = z19, e -= len; --e; zs += z19) ;
|
|
6921
6921
|
str += zs;
|
|
6922
6922
|
} else if (e < len) {
|
|
6923
6923
|
str = str.slice(0, e) + "." + str.slice(e);
|
|
@@ -10685,10 +10685,10 @@ var require_jwtaccess = __commonJS({
|
|
|
10685
10685
|
*/
|
|
10686
10686
|
getRequestHeaders(url, additionalClaims, scopes) {
|
|
10687
10687
|
const key = this.getCachedKey(url, scopes);
|
|
10688
|
-
const
|
|
10688
|
+
const cachedToken3 = this.cache.get(key);
|
|
10689
10689
|
const now = Date.now();
|
|
10690
|
-
if (
|
|
10691
|
-
return
|
|
10690
|
+
if (cachedToken3 && cachedToken3.expiration - now > this.eagerRefreshThresholdMillis) {
|
|
10691
|
+
return cachedToken3.headers;
|
|
10692
10692
|
}
|
|
10693
10693
|
const iat = Math.floor(Date.now() / 1e3);
|
|
10694
10694
|
const exp = _JWTAccess.getExpirationTime(iat);
|
|
@@ -14324,22 +14324,7 @@ import { readFileSync, watch as fsWatch } from "fs";
|
|
|
14324
14324
|
import { readFile } from "fs/promises";
|
|
14325
14325
|
import path from "path";
|
|
14326
14326
|
|
|
14327
|
-
// node_modules/@squadbase/connectors/dist/
|
|
14328
|
-
import { z } from "zod";
|
|
14329
|
-
import { z as z2 } from "zod";
|
|
14330
|
-
import { z as z3 } from "zod";
|
|
14331
|
-
import { z as z4 } from "zod";
|
|
14332
|
-
import { z as z5 } from "zod";
|
|
14333
|
-
import { z as z6 } from "zod";
|
|
14334
|
-
import { z as z7 } from "zod";
|
|
14335
|
-
import { z as z8 } from "zod";
|
|
14336
|
-
import { z as z9 } from "zod";
|
|
14337
|
-
import { z as z10 } from "zod";
|
|
14338
|
-
import { z as z11 } from "zod";
|
|
14339
|
-
import { z as z12 } from "zod";
|
|
14340
|
-
import { z as z13 } from "zod";
|
|
14341
|
-
import { z as z14 } from "zod";
|
|
14342
|
-
import { z as z15 } from "zod";
|
|
14327
|
+
// node_modules/@squadbase/connectors/dist/chunk-5YEHPSNW.js
|
|
14343
14328
|
var ParameterDefinition = class {
|
|
14344
14329
|
slug;
|
|
14345
14330
|
name;
|
|
@@ -14382,6 +14367,63 @@ var ParameterDefinition = class {
|
|
|
14382
14367
|
return param.value;
|
|
14383
14368
|
}
|
|
14384
14369
|
};
|
|
14370
|
+
var parameters = {
|
|
14371
|
+
baseUrl: new ParameterDefinition({
|
|
14372
|
+
slug: "base-url",
|
|
14373
|
+
name: "kintone Base URL",
|
|
14374
|
+
description: "The base URL of your kintone environment (e.g., https://example.cybozu.com).",
|
|
14375
|
+
envVarBaseKey: "KINTONE_BASE_URL",
|
|
14376
|
+
type: "text",
|
|
14377
|
+
secret: false,
|
|
14378
|
+
required: true
|
|
14379
|
+
}),
|
|
14380
|
+
username: new ParameterDefinition({
|
|
14381
|
+
slug: "username",
|
|
14382
|
+
name: "kintone Username",
|
|
14383
|
+
description: "The username (login name) for kintone authentication.",
|
|
14384
|
+
envVarBaseKey: "KINTONE_USERNAME",
|
|
14385
|
+
type: "text",
|
|
14386
|
+
secret: false,
|
|
14387
|
+
required: true
|
|
14388
|
+
}),
|
|
14389
|
+
password: new ParameterDefinition({
|
|
14390
|
+
slug: "password",
|
|
14391
|
+
name: "kintone Password",
|
|
14392
|
+
description: "The password for kintone authentication.",
|
|
14393
|
+
envVarBaseKey: "KINTONE_PASSWORD",
|
|
14394
|
+
type: "text",
|
|
14395
|
+
secret: true,
|
|
14396
|
+
required: true
|
|
14397
|
+
})
|
|
14398
|
+
};
|
|
14399
|
+
|
|
14400
|
+
// node_modules/@squadbase/connectors/dist/index.js
|
|
14401
|
+
import { z } from "zod";
|
|
14402
|
+
import { z as z2 } from "zod";
|
|
14403
|
+
import { z as z3 } from "zod";
|
|
14404
|
+
import { z as z4 } from "zod";
|
|
14405
|
+
import { z as z5 } from "zod";
|
|
14406
|
+
import { z as z6 } from "zod";
|
|
14407
|
+
import { z as z7 } from "zod";
|
|
14408
|
+
import { z as z8 } from "zod";
|
|
14409
|
+
import { z as z9 } from "zod";
|
|
14410
|
+
import { z as z10 } from "zod";
|
|
14411
|
+
import { z as z11 } from "zod";
|
|
14412
|
+
import { z as z12 } from "zod";
|
|
14413
|
+
import { z as z13 } from "zod";
|
|
14414
|
+
import { z as z14 } from "zod";
|
|
14415
|
+
import { z as z15 } from "zod";
|
|
14416
|
+
import { z as z16 } from "zod";
|
|
14417
|
+
import { z as z17 } from "zod";
|
|
14418
|
+
var ConnectorSetup = class {
|
|
14419
|
+
prompts;
|
|
14420
|
+
constructor(prompts) {
|
|
14421
|
+
this.prompts = prompts;
|
|
14422
|
+
}
|
|
14423
|
+
getPrompt(language) {
|
|
14424
|
+
return this.prompts[language];
|
|
14425
|
+
}
|
|
14426
|
+
};
|
|
14385
14427
|
var ConnectorTool = class {
|
|
14386
14428
|
name;
|
|
14387
14429
|
description;
|
|
@@ -14410,26 +14452,30 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
14410
14452
|
name;
|
|
14411
14453
|
description;
|
|
14412
14454
|
iconUrl;
|
|
14413
|
-
order;
|
|
14414
14455
|
parameters;
|
|
14415
14456
|
releaseFlag;
|
|
14416
14457
|
proxyPolicy;
|
|
14458
|
+
experimentalAttributes;
|
|
14459
|
+
setup;
|
|
14417
14460
|
systemPrompt;
|
|
14418
14461
|
tools;
|
|
14419
14462
|
query;
|
|
14463
|
+
checkConnection;
|
|
14420
14464
|
constructor(config) {
|
|
14421
14465
|
this.slug = config.slug;
|
|
14422
14466
|
this.authType = config.authType;
|
|
14423
14467
|
this.name = config.name;
|
|
14424
14468
|
this.description = config.description;
|
|
14425
14469
|
this.iconUrl = config.iconUrl;
|
|
14426
|
-
this.order = config.order;
|
|
14427
14470
|
this.parameters = config.parameters;
|
|
14428
14471
|
this.releaseFlag = config.releaseFlag;
|
|
14429
14472
|
this.proxyPolicy = config.proxyPolicy;
|
|
14473
|
+
this.experimentalAttributes = config.experimentalAttributes;
|
|
14474
|
+
this.setup = config.setup;
|
|
14430
14475
|
this.systemPrompt = config.systemPrompt;
|
|
14431
14476
|
this.tools = config.tools;
|
|
14432
14477
|
this.query = config.query;
|
|
14478
|
+
this.checkConnection = config.checkConnection;
|
|
14433
14479
|
}
|
|
14434
14480
|
get connectorKey() {
|
|
14435
14481
|
return _ConnectorPlugin.deriveKey(this.slug, this.authType);
|
|
@@ -14494,7 +14540,91 @@ function buildQuestionmarkParams(sql, namedParams) {
|
|
|
14494
14540
|
});
|
|
14495
14541
|
return { text, values };
|
|
14496
14542
|
}
|
|
14497
|
-
var
|
|
14543
|
+
var snowflakeSetup = new ConnectorSetup({
|
|
14544
|
+
ja: `## Snowflake \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u624B\u9806
|
|
14545
|
+
|
|
14546
|
+
\u4EE5\u4E0B\u306E\u624B\u9806\u3067Snowflake\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306E\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3092\u884C\u3063\u3066\u304F\u3060\u3055\u3044\u3002
|
|
14547
|
+
|
|
14548
|
+
### \u624B\u9806
|
|
14549
|
+
|
|
14550
|
+
#### \u30B9\u30C6\u30C3\u30D71: \u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u9078\u629E
|
|
14551
|
+
1. \`SHOW DATABASES\` \u3092\u5B9F\u884C\u3057\u3066\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u4E00\u89A7\u3092\u53D6\u5F97\u3059\u308B
|
|
14552
|
+
2. \u7D50\u679C\u306B\u5FDC\u3058\u3066\u5206\u5C90:
|
|
14553
|
+
- **\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u304C2\u3064\u4EE5\u4E0A**: \`askUserQuestion\`\uFF08multiSelect: true\uFF09\u3067\u30E6\u30FC\u30B6\u30FC\u306B\u63D0\u793A\u3057\u3001\u4F7F\u7528\u3059\u308B\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u3092\u9078\u629E\u3055\u305B\u308B
|
|
14554
|
+
- **\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u304C1\u3064\u3060\u3051**: askUserQuestion \u306F\u4F7F\u308F\u305A\u81EA\u52D5\u63A1\u7528\u3002\u300C\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9 X \u3092\u81EA\u52D5\u9078\u629E\u3057\u307E\u3057\u305F\u300D\u30681\u6587\u3060\u3051\u66F8\u304F
|
|
14555
|
+
|
|
14556
|
+
#### \u30B9\u30C6\u30C3\u30D72: \u30B9\u30AD\u30FC\u30DE\u9078\u629E\uFF08\u30C6\u30FC\u30D6\u30EB\u7BC4\u56F2\u306E\u6307\u5B9A\u3092\u542B\u3080\uFF09
|
|
14557
|
+
3. \u9078\u629E\u3055\u308C\u305F\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u306B\u5BFE\u3057\u3066 \`SHOW SCHEMAS IN DATABASE {database}\` \u3092\u5B9F\u884C\u3057\u3066\u30B9\u30AD\u30FC\u30DE\u4E00\u89A7\u3092\u53D6\u5F97\u3059\u308B\uFF08\u8907\u6570\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u306E\u5834\u5408\u306F\u305D\u308C\u305E\u308C\u5B9F\u884C\uFF09
|
|
14558
|
+
4. INFORMATION_SCHEMA \u306A\u3069\u5185\u90E8\u30B9\u30AD\u30FC\u30DE\u306F\u9664\u5916\u3059\u308B
|
|
14559
|
+
5. \u5404\u30B9\u30AD\u30FC\u30DE\u306B\u3064\u3044\u3066 **2\u3064\u306E\u9078\u629E\u80A2** \u3092\u751F\u6210\u3057\u3001\`askUserQuestion\`\uFF08multiSelect: true\uFF09\u3067\u30E6\u30FC\u30B6\u30FC\u306B\u63D0\u793A\u3059\u308B:
|
|
14560
|
+
- \`{schema}\uFF08\u5168\u30C6\u30FC\u30D6\u30EB\uFF09\` \u2014 description: "{database}.{schema} \u5185\u306E\u5168\u30C6\u30FC\u30D6\u30EB\u3092\u4F7F\u7528"
|
|
14561
|
+
- \`{schema}\uFF08\u7279\u5B9A\u30C6\u30FC\u30D6\u30EB\u3092\u9078\u629E\uFF09\` \u2014 description: "{database}.{schema} \u5185\u306E\u7279\u5B9A\u30C6\u30FC\u30D6\u30EB\u306E\u307F\u4F7F\u7528"
|
|
14562
|
+
- \u30B9\u30AD\u30FC\u30DE\u304C1\u3064\u3060\u3051\u306E\u5834\u5408\u3082\u3001\u300C\u5168\u30C6\u30FC\u30D6\u30EB\u300D\u3068\u300C\u7279\u5B9A\u30C6\u30FC\u30D6\u30EB\u3092\u9078\u629E\u300D\u306E2\u3064\u306E\u9078\u629E\u80A2\u3092\u63D0\u793A\u3059\u308B\u3053\u3068
|
|
14563
|
+
|
|
14564
|
+
#### \u30B9\u30C6\u30C3\u30D73: \u30C6\u30FC\u30D6\u30EB\u9078\u629E\uFF08\u300C\u7279\u5B9A\u30C6\u30FC\u30D6\u30EB\u3092\u9078\u629E\u300D\u304C\u9078\u3070\u308C\u305F\u30B9\u30AD\u30FC\u30DE\u306E\u307F\uFF09
|
|
14565
|
+
6. \u300C\u5168\u30C6\u30FC\u30D6\u30EB\u300D\u304C\u9078\u3070\u308C\u305F\u30B9\u30AD\u30FC\u30DE\u306F\u30C6\u30FC\u30D6\u30EB\u9078\u629E\u3092\u30B9\u30AD\u30C3\u30D7\u3057\u3001\u5168\u30C6\u30FC\u30D6\u30EB\u3092\u5BFE\u8C61\u3068\u3059\u308B
|
|
14566
|
+
7. \u300C\u7279\u5B9A\u30C6\u30FC\u30D6\u30EB\u3092\u9078\u629E\u300D\u304C\u9078\u3070\u308C\u305F\u30B9\u30AD\u30FC\u30DE\u306B\u5BFE\u3057\u3066\u306E\u307F \`SHOW TABLES IN SCHEMA {database}.{schema}\` \u3092\u5B9F\u884C\u3057\u3066\u30C6\u30FC\u30D6\u30EB\u4E00\u89A7\u3092\u53D6\u5F97\u3059\u308B
|
|
14567
|
+
8. \u7D50\u679C\u306B\u5FDC\u3058\u3066\u5206\u5C90:
|
|
14568
|
+
- **\u30C6\u30FC\u30D6\u30EB\u304C2\u3064\u4EE5\u4E0A**: \`askUserQuestion\`\uFF08multiSelect: true\uFF09\u3067\u30E6\u30FC\u30B6\u30FC\u306B\u63D0\u793A\u3057\u3001\u4F7F\u7528\u3059\u308B\u30C6\u30FC\u30D6\u30EB\u3092\u9078\u629E\u3055\u305B\u308B\u3002description \u306B\u306F\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u540D.\u30B9\u30AD\u30FC\u30DE\u540D\u3092\u8A18\u8F09\u3059\u308B
|
|
14569
|
+
- **\u30C6\u30FC\u30D6\u30EB\u304C1\u3064\u3060\u3051**: askUserQuestion \u306F\u4F7F\u308F\u305A\u81EA\u52D5\u63A1\u7528
|
|
14570
|
+
|
|
14571
|
+
#### \u30B9\u30C6\u30C3\u30D74: \u4FDD\u5B58
|
|
14572
|
+
9. \`updateConnectionContext\` \u3067\u4EE5\u4E0B\u3092\u4FDD\u5B58\u3059\u308B:
|
|
14573
|
+
- \`database\`: \u9078\u629E\u3055\u308C\u305F\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u540D\uFF08\u8907\u6570\u306E\u5834\u5408\u306F\u30AB\u30F3\u30DE\u533A\u5207\u308A\uFF09
|
|
14574
|
+
- \`schema\`: \u9078\u629E\u3055\u308C\u305F\u30B9\u30AD\u30FC\u30DE\u540D\uFF08\u8907\u6570\u306E\u5834\u5408\u306F\u30AB\u30F3\u30DE\u533A\u5207\u308A\uFF09
|
|
14575
|
+
- \`tables\`: \u9078\u629E\u3055\u308C\u305F\u30C6\u30FC\u30D6\u30EB\u540D\uFF08\u5B8C\u5168\u4FEE\u98FE\u540D database.schema.table\u3001\u8907\u6570\u306E\u5834\u5408\u306F\u30AB\u30F3\u30DE\u533A\u5207\u308A\u3002\u300C\u5168\u30C6\u30FC\u30D6\u30EB\u300D\u306E\u5834\u5408\u306F "{database}.{schema}.*"\uFF09
|
|
14576
|
+
- \`note\`: \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u5185\u5BB9\u306E\u7C21\u5358\u306A\u8AAC\u660E
|
|
14577
|
+
|
|
14578
|
+
### \u91CD\u8981\u306A\u5236\u7D04
|
|
14579
|
+
- askUserQuestion \u306E options \u306B\u306F\u6700\u4F4E2\u4EF6\u5FC5\u8981\u30021\u4EF6\u3057\u304B\u306A\u3044\u5834\u5408\u306F askUserQuestion \u3092\u547C\u3070\u305A\u6B21\u306E\u30B9\u30C6\u30C3\u30D7\u306B\u9032\u3080\u3053\u3068
|
|
14580
|
+
- **\u30C6\u30FC\u30D6\u30EB\u306E\u884C\u30C7\u30FC\u30BF\u3092\u8AAD\u307F\u53D6\u3089\u306A\u3044\u3053\u3068**\u3002\u5B9F\u884C\u3057\u3066\u3088\u3044\u306E\u306F\u4E0A\u8A18\u624B\u9806\u3067\u6307\u5B9A\u3055\u308C\u305F\u30E1\u30BF\u30C7\u30FC\u30BF\u53D6\u5F97\u30AF\u30A8\u30EA\u306E\u307F\u3002\u305D\u308C\u4EE5\u5916\u306E\u30AF\u30A8\u30EA\u306F\u5B9F\u884C\u7981\u6B62
|
|
14581
|
+
|
|
14582
|
+
### \u5B9F\u884C\u65B9\u91DD
|
|
14583
|
+
- \u30C4\u30FC\u30EB\u9593\u306F1\u6587\u3060\u3051\u66F8\u3044\u3066\u5373\u6B21\u306E\u30C4\u30FC\u30EB\u547C\u3073\u51FA\u3057
|
|
14584
|
+
- \u4E0D\u8981\u306A\u8AAC\u660E\u306F\u7701\u7565\u3057\u3001\u52B9\u7387\u7684\u306B\u9032\u3081\u308B`,
|
|
14585
|
+
en: `## Snowflake Setup Instructions
|
|
14586
|
+
|
|
14587
|
+
Follow these steps to set up the Snowflake connection.
|
|
14588
|
+
|
|
14589
|
+
### Steps
|
|
14590
|
+
|
|
14591
|
+
#### Step 1: Database Selection
|
|
14592
|
+
1. Run \`SHOW DATABASES\` to get the list of databases
|
|
14593
|
+
2. Branch based on results:
|
|
14594
|
+
- **2 or more databases**: Present them to the user via \`askUserQuestion\` (multiSelect: true) and let them select which databases to use
|
|
14595
|
+
- **Exactly 1 database**: Do NOT call askUserQuestion. Auto-select it. Just write "Auto-selected database X" in one sentence
|
|
14596
|
+
|
|
14597
|
+
#### Step 2: Schema Selection (including table scope)
|
|
14598
|
+
3. For the selected database(s), run \`SHOW SCHEMAS IN DATABASE {database}\` to get the schema list (run separately for each database if multiple)
|
|
14599
|
+
4. Exclude internal schemas such as INFORMATION_SCHEMA
|
|
14600
|
+
5. For each schema, generate **two options** and present them via \`askUserQuestion\` (multiSelect: true):
|
|
14601
|
+
- \`{schema} (all tables)\` \u2014 description: "Use all tables in {database}.{schema}"
|
|
14602
|
+
- \`{schema} (select specific tables)\` \u2014 description: "Use only specific tables in {database}.{schema}"
|
|
14603
|
+
- Even if there is only 1 schema, present both "all tables" and "select specific tables" options
|
|
14604
|
+
|
|
14605
|
+
#### Step 3: Table Selection (only for schemas where "select specific tables" was chosen)
|
|
14606
|
+
6. For schemas where "all tables" was chosen, skip table selection and include all tables
|
|
14607
|
+
7. For schemas where "select specific tables" was chosen, run \`SHOW TABLES IN SCHEMA {database}.{schema}\` to get the table list
|
|
14608
|
+
8. Branch based on results:
|
|
14609
|
+
- **2 or more tables**: Present them to the user via \`askUserQuestion\` (multiSelect: true) and let them select which tables to use. Include database.schema in the description
|
|
14610
|
+
- **Exactly 1 table**: Do NOT call askUserQuestion. Auto-select it
|
|
14611
|
+
|
|
14612
|
+
#### Step 4: Save
|
|
14613
|
+
9. Call \`updateConnectionContext\` to save:
|
|
14614
|
+
- \`database\`: Selected database name(s) (comma-separated if multiple)
|
|
14615
|
+
- \`schema\`: Selected schema name(s) (comma-separated if multiple)
|
|
14616
|
+
- \`tables\`: Selected table names (fully qualified database.schema.table, comma-separated if multiple. Use "{database}.{schema}.*" for "all tables" schemas)
|
|
14617
|
+
- \`note\`: Brief description of the setup
|
|
14618
|
+
|
|
14619
|
+
### Important Constraint
|
|
14620
|
+
- askUserQuestion options requires at least 2 items. If there is only 1 item, do NOT call askUserQuestion \u2014 proceed to the next step directly
|
|
14621
|
+
- **Do NOT read table row data**. Only the metadata queries specified in the steps above are allowed. All other queries are forbidden
|
|
14622
|
+
|
|
14623
|
+
### Execution Policy
|
|
14624
|
+
- Write only 1 sentence between tool calls, then immediately call the next tool
|
|
14625
|
+
- Skip unnecessary explanations and proceed efficiently`
|
|
14626
|
+
});
|
|
14627
|
+
var parameters2 = {
|
|
14498
14628
|
account: new ParameterDefinition({
|
|
14499
14629
|
slug: "account",
|
|
14500
14630
|
name: "Snowflake Account",
|
|
@@ -14557,7 +14687,7 @@ var outputSchema = z.discriminatedUnion("success", [
|
|
|
14557
14687
|
success: z.literal(true),
|
|
14558
14688
|
rowCount: z.number(),
|
|
14559
14689
|
truncated: z.boolean(),
|
|
14560
|
-
rows: z.array(z.record(z.unknown()))
|
|
14690
|
+
rows: z.array(z.record(z.string(), z.unknown()))
|
|
14561
14691
|
}),
|
|
14562
14692
|
z.object({
|
|
14563
14693
|
success: z.literal(false),
|
|
@@ -14585,11 +14715,11 @@ Avoid loading large amounts of data; always include LIMIT in queries.`,
|
|
|
14585
14715
|
try {
|
|
14586
14716
|
const snowflake = (await import("snowflake-sdk")).default;
|
|
14587
14717
|
snowflake.configure({ logLevel: "ERROR" });
|
|
14588
|
-
const account =
|
|
14589
|
-
const user =
|
|
14590
|
-
const role =
|
|
14591
|
-
const warehouse =
|
|
14592
|
-
const privateKeyBase64 =
|
|
14718
|
+
const account = parameters2.account.getValue(connection);
|
|
14719
|
+
const user = parameters2.user.getValue(connection);
|
|
14720
|
+
const role = parameters2.role.getValue(connection);
|
|
14721
|
+
const warehouse = parameters2.warehouse.getValue(connection);
|
|
14722
|
+
const privateKeyBase64 = parameters2.privateKeyBase64.getValue(connection);
|
|
14593
14723
|
const privateKey = Buffer.from(privateKeyBase64, "base64").toString(
|
|
14594
14724
|
"utf-8"
|
|
14595
14725
|
);
|
|
@@ -14654,9 +14784,9 @@ var snowflakeConnector = new ConnectorPlugin({
|
|
|
14654
14784
|
name: "Snowflake",
|
|
14655
14785
|
description: "Connect to Snowflake for cloud data warehousing and analytics.",
|
|
14656
14786
|
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/6oyVtAcP3pMlXaOrts9unk/b7a9dc25d15c388b66e983041b855447/snowflake.svg",
|
|
14657
|
-
|
|
14658
|
-
parameters,
|
|
14787
|
+
parameters: parameters2,
|
|
14659
14788
|
releaseFlag: { dev1: true, dev2: true, prod: true },
|
|
14789
|
+
setup: snowflakeSetup,
|
|
14660
14790
|
systemPrompt: `## Snowflake SQL Notes
|
|
14661
14791
|
- Use fully qualified names DB.SCHEMA.TABLE for table references
|
|
14662
14792
|
- Schema exploration commands:
|
|
@@ -14666,19 +14796,58 @@ var snowflakeConnector = new ConnectorPlugin({
|
|
|
14666
14796
|
- List columns: \`DESCRIBE TABLE db_name.schema_name.table_name\`
|
|
14667
14797
|
- INFORMATION_SCHEMA is also available: \`SELECT * FROM db_name.INFORMATION_SCHEMA.TABLES\``,
|
|
14668
14798
|
tools,
|
|
14799
|
+
async checkConnection(params, _config) {
|
|
14800
|
+
try {
|
|
14801
|
+
const snowflake = (await import("snowflake-sdk")).default;
|
|
14802
|
+
snowflake.configure({ logLevel: "ERROR" });
|
|
14803
|
+
const privateKey = Buffer.from(
|
|
14804
|
+
params[parameters2.privateKeyBase64.slug],
|
|
14805
|
+
"base64"
|
|
14806
|
+
).toString("utf-8");
|
|
14807
|
+
const conn = snowflake.createConnection({
|
|
14808
|
+
account: params[parameters2.account.slug],
|
|
14809
|
+
username: params[parameters2.user.slug],
|
|
14810
|
+
role: params[parameters2.role.slug],
|
|
14811
|
+
warehouse: params[parameters2.warehouse.slug],
|
|
14812
|
+
authenticator: "SNOWFLAKE_JWT",
|
|
14813
|
+
privateKey
|
|
14814
|
+
});
|
|
14815
|
+
await new Promise((resolve, reject) => {
|
|
14816
|
+
conn.connect((err) => {
|
|
14817
|
+
if (err) reject(new Error(`Snowflake connect failed: ${err.message}`));
|
|
14818
|
+
else resolve();
|
|
14819
|
+
});
|
|
14820
|
+
});
|
|
14821
|
+
await new Promise((resolve, reject) => {
|
|
14822
|
+
conn.execute({
|
|
14823
|
+
sqlText: "SELECT 1",
|
|
14824
|
+
complete: (err) => {
|
|
14825
|
+
if (err) reject(new Error(`Snowflake query failed: ${err.message}`));
|
|
14826
|
+
else resolve();
|
|
14827
|
+
}
|
|
14828
|
+
});
|
|
14829
|
+
});
|
|
14830
|
+
conn.destroy((err) => {
|
|
14831
|
+
if (err) console.warn(`[connector-client] Snowflake destroy error: ${err.message}`);
|
|
14832
|
+
});
|
|
14833
|
+
return { success: true };
|
|
14834
|
+
} catch (e) {
|
|
14835
|
+
return { success: false, error: e instanceof Error ? e.message : String(e) };
|
|
14836
|
+
}
|
|
14837
|
+
},
|
|
14669
14838
|
async query(params, sql, namedParams) {
|
|
14670
14839
|
const resolvedSql = replaceLiteralParams(sql, namedParams);
|
|
14671
14840
|
const snowflake = (await import("snowflake-sdk")).default;
|
|
14672
14841
|
snowflake.configure({ logLevel: "ERROR" });
|
|
14673
14842
|
const privateKey = Buffer.from(
|
|
14674
|
-
params[
|
|
14843
|
+
params[parameters2.privateKeyBase64.slug],
|
|
14675
14844
|
"base64"
|
|
14676
14845
|
).toString("utf-8");
|
|
14677
14846
|
const conn = snowflake.createConnection({
|
|
14678
|
-
account: params[
|
|
14679
|
-
username: params[
|
|
14680
|
-
role: params[
|
|
14681
|
-
warehouse: params[
|
|
14847
|
+
account: params[parameters2.account.slug],
|
|
14848
|
+
username: params[parameters2.user.slug],
|
|
14849
|
+
role: params[parameters2.role.slug],
|
|
14850
|
+
warehouse: params[parameters2.warehouse.slug],
|
|
14682
14851
|
authenticator: "SNOWFLAKE_JWT",
|
|
14683
14852
|
privateKey
|
|
14684
14853
|
});
|
|
@@ -14705,7 +14874,7 @@ var snowflakeConnector = new ConnectorPlugin({
|
|
|
14705
14874
|
return { rows };
|
|
14706
14875
|
}
|
|
14707
14876
|
});
|
|
14708
|
-
var
|
|
14877
|
+
var parameters3 = {
|
|
14709
14878
|
account: new ParameterDefinition({
|
|
14710
14879
|
slug: "account",
|
|
14711
14880
|
name: "Snowflake Account",
|
|
@@ -14768,7 +14937,7 @@ var outputSchema2 = z2.discriminatedUnion("success", [
|
|
|
14768
14937
|
success: z2.literal(true),
|
|
14769
14938
|
rowCount: z2.number(),
|
|
14770
14939
|
truncated: z2.boolean(),
|
|
14771
|
-
rows: z2.array(z2.record(z2.unknown()))
|
|
14940
|
+
rows: z2.array(z2.record(z2.string(), z2.unknown()))
|
|
14772
14941
|
}),
|
|
14773
14942
|
z2.object({
|
|
14774
14943
|
success: z2.literal(false),
|
|
@@ -14796,11 +14965,11 @@ Avoid loading large amounts of data; always include LIMIT in queries.`,
|
|
|
14796
14965
|
try {
|
|
14797
14966
|
const snowflake = (await import("snowflake-sdk")).default;
|
|
14798
14967
|
snowflake.configure({ logLevel: "ERROR" });
|
|
14799
|
-
const account =
|
|
14800
|
-
const user =
|
|
14801
|
-
const role =
|
|
14802
|
-
const warehouse =
|
|
14803
|
-
const password =
|
|
14968
|
+
const account = parameters3.account.getValue(connection);
|
|
14969
|
+
const user = parameters3.user.getValue(connection);
|
|
14970
|
+
const role = parameters3.role.getValue(connection);
|
|
14971
|
+
const warehouse = parameters3.warehouse.getValue(connection);
|
|
14972
|
+
const password = parameters3.pat.getValue(connection);
|
|
14804
14973
|
const conn = snowflake.createConnection({
|
|
14805
14974
|
account,
|
|
14806
14975
|
username: user,
|
|
@@ -14861,9 +15030,9 @@ var snowflakePatConnector = new ConnectorPlugin({
|
|
|
14861
15030
|
name: "Snowflake (PAT)",
|
|
14862
15031
|
description: "Connect to Snowflake using a Personal Access Token (PAT).",
|
|
14863
15032
|
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/6oyVtAcP3pMlXaOrts9unk/b7a9dc25d15c388b66e983041b855447/snowflake.svg",
|
|
14864
|
-
|
|
14865
|
-
parameters: parameters2,
|
|
15033
|
+
parameters: parameters3,
|
|
14866
15034
|
releaseFlag: { dev1: true, dev2: false, prod: false },
|
|
15035
|
+
setup: snowflakeSetup,
|
|
14867
15036
|
systemPrompt: `## Snowflake SQL Notes
|
|
14868
15037
|
- Use fully qualified names DB.SCHEMA.TABLE for table references
|
|
14869
15038
|
- Schema exploration commands:
|
|
@@ -14873,16 +15042,55 @@ var snowflakePatConnector = new ConnectorPlugin({
|
|
|
14873
15042
|
- List columns: \`DESCRIBE TABLE db_name.schema_name.table_name\`
|
|
14874
15043
|
- INFORMATION_SCHEMA is also available: \`SELECT * FROM db_name.INFORMATION_SCHEMA.TABLES\``,
|
|
14875
15044
|
tools: tools2,
|
|
15045
|
+
async checkConnection(params, _config) {
|
|
15046
|
+
try {
|
|
15047
|
+
const snowflake = (await import("snowflake-sdk")).default;
|
|
15048
|
+
snowflake.configure({ logLevel: "ERROR" });
|
|
15049
|
+
const conn = snowflake.createConnection({
|
|
15050
|
+
account: params[parameters3.account.slug],
|
|
15051
|
+
username: params[parameters3.user.slug],
|
|
15052
|
+
role: params[parameters3.role.slug],
|
|
15053
|
+
warehouse: params[parameters3.warehouse.slug],
|
|
15054
|
+
password: params[parameters3.pat.slug]
|
|
15055
|
+
});
|
|
15056
|
+
await new Promise((resolve, reject) => {
|
|
15057
|
+
conn.connect((err) => {
|
|
15058
|
+
if (err)
|
|
15059
|
+
reject(new Error(`Snowflake connect failed: ${err.message}`));
|
|
15060
|
+
else resolve();
|
|
15061
|
+
});
|
|
15062
|
+
});
|
|
15063
|
+
await new Promise((resolve, reject) => {
|
|
15064
|
+
conn.execute({
|
|
15065
|
+
sqlText: "SELECT 1",
|
|
15066
|
+
complete: (err) => {
|
|
15067
|
+
if (err)
|
|
15068
|
+
reject(new Error(`Snowflake query failed: ${err.message}`));
|
|
15069
|
+
else resolve();
|
|
15070
|
+
}
|
|
15071
|
+
});
|
|
15072
|
+
});
|
|
15073
|
+
conn.destroy((err) => {
|
|
15074
|
+
if (err)
|
|
15075
|
+
console.warn(
|
|
15076
|
+
`[connector-client] Snowflake destroy error: ${err.message}`
|
|
15077
|
+
);
|
|
15078
|
+
});
|
|
15079
|
+
return { success: true };
|
|
15080
|
+
} catch (e) {
|
|
15081
|
+
return { success: false, error: e instanceof Error ? e.message : String(e) };
|
|
15082
|
+
}
|
|
15083
|
+
},
|
|
14876
15084
|
async query(params, sql, namedParams) {
|
|
14877
15085
|
const resolvedSql = replaceLiteralParams(sql, namedParams);
|
|
14878
15086
|
const snowflake = (await import("snowflake-sdk")).default;
|
|
14879
15087
|
snowflake.configure({ logLevel: "ERROR" });
|
|
14880
15088
|
const conn = snowflake.createConnection({
|
|
14881
|
-
account: params[
|
|
14882
|
-
username: params[
|
|
14883
|
-
role: params[
|
|
14884
|
-
warehouse: params[
|
|
14885
|
-
password: params[
|
|
15089
|
+
account: params[parameters3.account.slug],
|
|
15090
|
+
username: params[parameters3.user.slug],
|
|
15091
|
+
role: params[parameters3.role.slug],
|
|
15092
|
+
warehouse: params[parameters3.warehouse.slug],
|
|
15093
|
+
password: params[parameters3.pat.slug]
|
|
14886
15094
|
});
|
|
14887
15095
|
await new Promise((resolve, reject) => {
|
|
14888
15096
|
conn.connect((err) => {
|
|
@@ -14912,7 +15120,7 @@ var snowflakePatConnector = new ConnectorPlugin({
|
|
|
14912
15120
|
return { rows };
|
|
14913
15121
|
}
|
|
14914
15122
|
});
|
|
14915
|
-
var
|
|
15123
|
+
var parameters4 = {
|
|
14916
15124
|
connectionUrl: new ParameterDefinition({
|
|
14917
15125
|
slug: "connection-url",
|
|
14918
15126
|
name: "PostgreSQL Connection URL",
|
|
@@ -14938,7 +15146,7 @@ var outputSchema3 = z3.discriminatedUnion("success", [
|
|
|
14938
15146
|
success: z3.literal(true),
|
|
14939
15147
|
rowCount: z3.number(),
|
|
14940
15148
|
truncated: z3.boolean(),
|
|
14941
|
-
rows: z3.array(z3.record(z3.unknown()))
|
|
15149
|
+
rows: z3.array(z3.record(z3.string(), z3.unknown()))
|
|
14942
15150
|
}),
|
|
14943
15151
|
z3.object({
|
|
14944
15152
|
success: z3.literal(false),
|
|
@@ -14966,7 +15174,7 @@ Avoid loading large amounts of data; always include LIMIT in queries.`,
|
|
|
14966
15174
|
let connectionUrl;
|
|
14967
15175
|
try {
|
|
14968
15176
|
const { Pool } = await import("pg");
|
|
14969
|
-
connectionUrl =
|
|
15177
|
+
connectionUrl = parameters4.connectionUrl.getValue(connection);
|
|
14970
15178
|
const pool = new Pool({
|
|
14971
15179
|
connectionString: connectionUrl,
|
|
14972
15180
|
ssl: { rejectUnauthorized: false },
|
|
@@ -15002,8 +15210,7 @@ var postgresqlConnector = new ConnectorPlugin({
|
|
|
15002
15210
|
name: "PostgreSQL",
|
|
15003
15211
|
description: "Connect to PostgreSQL databases for relational data storage and querying.",
|
|
15004
15212
|
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/42AHi2uqteUn65MyqdN6V7/a0f68f12af6aac96bbcda5980f43de07/elephant.png",
|
|
15005
|
-
|
|
15006
|
-
parameters: parameters3,
|
|
15213
|
+
parameters: parameters4,
|
|
15007
15214
|
releaseFlag: { dev1: true, dev2: true, prod: true },
|
|
15008
15215
|
systemPrompt: `## PostgreSQL SQL Notes
|
|
15009
15216
|
- Schema exploration:
|
|
@@ -15011,11 +15218,27 @@ var postgresqlConnector = new ConnectorPlugin({
|
|
|
15011
15218
|
- List columns: \`SELECT column_name, data_type FROM information_schema.columns WHERE table_schema = 'public' AND table_name = 'xxx'\`
|
|
15012
15219
|
- Always include LIMIT in queries`,
|
|
15013
15220
|
tools: tools3,
|
|
15221
|
+
async checkConnection(params, _config) {
|
|
15222
|
+
const { Pool } = await import("pg");
|
|
15223
|
+
const pool = new Pool({
|
|
15224
|
+
connectionString: params[parameters4.connectionUrl.slug],
|
|
15225
|
+
ssl: { rejectUnauthorized: false },
|
|
15226
|
+
connectionTimeoutMillis: 1e4
|
|
15227
|
+
});
|
|
15228
|
+
try {
|
|
15229
|
+
await pool.query("SELECT 1");
|
|
15230
|
+
return { success: true };
|
|
15231
|
+
} catch (error) {
|
|
15232
|
+
return { success: false, error: error instanceof Error ? error.message : String(error) };
|
|
15233
|
+
} finally {
|
|
15234
|
+
await pool.end();
|
|
15235
|
+
}
|
|
15236
|
+
},
|
|
15014
15237
|
async query(params, sql, namedParams) {
|
|
15015
15238
|
const { Pool } = await import("pg");
|
|
15016
15239
|
const { text, values } = buildPositionalParams(sql, namedParams);
|
|
15017
15240
|
const pool = new Pool({
|
|
15018
|
-
connectionString: params[
|
|
15241
|
+
connectionString: params[parameters4.connectionUrl.slug],
|
|
15019
15242
|
ssl: { rejectUnauthorized: false },
|
|
15020
15243
|
connectionTimeoutMillis: 1e4,
|
|
15021
15244
|
statement_timeout: 6e4
|
|
@@ -15028,7 +15251,7 @@ var postgresqlConnector = new ConnectorPlugin({
|
|
|
15028
15251
|
}
|
|
15029
15252
|
}
|
|
15030
15253
|
});
|
|
15031
|
-
var
|
|
15254
|
+
var parameters5 = {
|
|
15032
15255
|
connectionUrl: new ParameterDefinition({
|
|
15033
15256
|
slug: "connection-url",
|
|
15034
15257
|
name: "MySQL Connection URL",
|
|
@@ -15054,7 +15277,7 @@ var outputSchema4 = z4.discriminatedUnion("success", [
|
|
|
15054
15277
|
success: z4.literal(true),
|
|
15055
15278
|
rowCount: z4.number(),
|
|
15056
15279
|
truncated: z4.boolean(),
|
|
15057
|
-
rows: z4.array(z4.record(z4.unknown()))
|
|
15280
|
+
rows: z4.array(z4.record(z4.string(), z4.unknown()))
|
|
15058
15281
|
}),
|
|
15059
15282
|
z4.object({
|
|
15060
15283
|
success: z4.literal(false),
|
|
@@ -15082,7 +15305,7 @@ Avoid loading large amounts of data; always include LIMIT in queries.`,
|
|
|
15082
15305
|
let connectionUrl;
|
|
15083
15306
|
try {
|
|
15084
15307
|
const mysql = await import("mysql2/promise");
|
|
15085
|
-
connectionUrl =
|
|
15308
|
+
connectionUrl = parameters5.connectionUrl.getValue(connection);
|
|
15086
15309
|
const pool = mysql.createPool({
|
|
15087
15310
|
uri: connectionUrl,
|
|
15088
15311
|
connectTimeout: CONNECT_TIMEOUT_MS2
|
|
@@ -15120,8 +15343,7 @@ var mysqlConnector = new ConnectorPlugin({
|
|
|
15120
15343
|
name: "MySQL",
|
|
15121
15344
|
description: "Connect to MySQL databases for relational data storage and querying.",
|
|
15122
15345
|
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/6ghPFeGgl7uBs5NHH1a4L/512c9433beec5b595caa41f04921c1f9/logo-mysql-170x115.png",
|
|
15123
|
-
|
|
15124
|
-
parameters: parameters4,
|
|
15346
|
+
parameters: parameters5,
|
|
15125
15347
|
releaseFlag: { dev1: true, dev2: true, prod: true },
|
|
15126
15348
|
systemPrompt: `## MySQL SQL Notes
|
|
15127
15349
|
- Schema exploration:
|
|
@@ -15129,11 +15351,26 @@ var mysqlConnector = new ConnectorPlugin({
|
|
|
15129
15351
|
- List columns: \`SELECT COLUMN_NAME, DATA_TYPE FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'xxx'\`
|
|
15130
15352
|
- Always include LIMIT in queries`,
|
|
15131
15353
|
tools: tools4,
|
|
15354
|
+
async checkConnection(params, _config) {
|
|
15355
|
+
const mysql = await import("mysql2/promise");
|
|
15356
|
+
const pool = mysql.createPool({
|
|
15357
|
+
uri: params[parameters5.connectionUrl.slug],
|
|
15358
|
+
connectTimeout: 1e4
|
|
15359
|
+
});
|
|
15360
|
+
try {
|
|
15361
|
+
await pool.query("SELECT 1");
|
|
15362
|
+
return { success: true };
|
|
15363
|
+
} catch (e) {
|
|
15364
|
+
return { success: false, error: e instanceof Error ? e.message : String(e) };
|
|
15365
|
+
} finally {
|
|
15366
|
+
await pool.end();
|
|
15367
|
+
}
|
|
15368
|
+
},
|
|
15132
15369
|
async query(params, sql, namedParams) {
|
|
15133
15370
|
const mysql = await import("mysql2/promise");
|
|
15134
15371
|
const { text, values } = buildQuestionmarkParams(sql, namedParams);
|
|
15135
15372
|
const pool = mysql.createPool({
|
|
15136
|
-
uri: params[
|
|
15373
|
+
uri: params[parameters5.connectionUrl.slug],
|
|
15137
15374
|
connectTimeout: 1e4
|
|
15138
15375
|
});
|
|
15139
15376
|
try {
|
|
@@ -15149,7 +15386,7 @@ var mysqlConnector = new ConnectorPlugin({
|
|
|
15149
15386
|
}
|
|
15150
15387
|
}
|
|
15151
15388
|
});
|
|
15152
|
-
var
|
|
15389
|
+
var parameters6 = {
|
|
15153
15390
|
serviceAccountKeyJsonBase64: new ParameterDefinition({
|
|
15154
15391
|
slug: "service-account-key-json-base64",
|
|
15155
15392
|
name: "Google Cloud Service Account JSON",
|
|
@@ -15166,39 +15403,36 @@ var parameters5 = {
|
|
|
15166
15403
|
envVarBaseKey: "BIGQUERY_PROJECT_ID",
|
|
15167
15404
|
type: "text",
|
|
15168
15405
|
secret: false,
|
|
15169
|
-
required:
|
|
15406
|
+
required: false
|
|
15170
15407
|
})
|
|
15171
15408
|
};
|
|
15172
|
-
var MAX_ROWS5 = 500;
|
|
15173
15409
|
var inputSchema5 = z5.object({
|
|
15174
15410
|
toolUseIntent: z5.string().optional().describe(
|
|
15175
15411
|
"Brief description of what you intend to accomplish with this tool call"
|
|
15176
15412
|
),
|
|
15177
|
-
connectionId: z5.string().describe("ID of the BigQuery connection to use")
|
|
15178
|
-
sql: z5.string().describe(
|
|
15179
|
-
"BigQuery SQL (GoogleSQL) query. Use backtick-quoted fully qualified names `project.dataset.table` for table references."
|
|
15180
|
-
)
|
|
15413
|
+
connectionId: z5.string().describe("ID of the BigQuery connection to use")
|
|
15181
15414
|
});
|
|
15182
15415
|
var outputSchema5 = z5.discriminatedUnion("success", [
|
|
15183
15416
|
z5.object({
|
|
15184
15417
|
success: z5.literal(true),
|
|
15185
|
-
|
|
15186
|
-
|
|
15187
|
-
|
|
15418
|
+
projects: z5.array(
|
|
15419
|
+
z5.object({
|
|
15420
|
+
projectId: z5.string(),
|
|
15421
|
+
friendlyName: z5.string()
|
|
15422
|
+
})
|
|
15423
|
+
)
|
|
15188
15424
|
}),
|
|
15189
15425
|
z5.object({
|
|
15190
15426
|
success: z5.literal(false),
|
|
15191
15427
|
error: z5.string()
|
|
15192
15428
|
})
|
|
15193
15429
|
]);
|
|
15194
|
-
var
|
|
15195
|
-
name: "
|
|
15196
|
-
description: `
|
|
15197
|
-
Use for: schema exploration (INFORMATION_SCHEMA), data sampling, analytical queries.
|
|
15198
|
-
Avoid loading large amounts of data; always include LIMIT in queries.`,
|
|
15430
|
+
var listProjectsTool = new ConnectorTool({
|
|
15431
|
+
name: "listProjects",
|
|
15432
|
+
description: `List GCP projects accessible with the service account credentials. Returns project IDs and friendly names.`,
|
|
15199
15433
|
inputSchema: inputSchema5,
|
|
15200
15434
|
outputSchema: outputSchema5,
|
|
15201
|
-
async execute({ connectionId
|
|
15435
|
+
async execute({ connectionId }, connections) {
|
|
15202
15436
|
const connection = connections.find((c) => c.id === connectionId);
|
|
15203
15437
|
if (!connection) {
|
|
15204
15438
|
return {
|
|
@@ -15206,78 +15440,222 @@ Avoid loading large amounts of data; always include LIMIT in queries.`,
|
|
|
15206
15440
|
error: `Connection ${connectionId} not found`
|
|
15207
15441
|
};
|
|
15208
15442
|
}
|
|
15209
|
-
console.log(
|
|
15210
|
-
`[connector-query] bigquery/${connection.name}: ${sql}`
|
|
15211
|
-
);
|
|
15212
15443
|
try {
|
|
15213
|
-
const
|
|
15214
|
-
const projectId = parameters5.projectId.getValue(connection);
|
|
15215
|
-
const serviceAccountJsonBase64 = parameters5.serviceAccountKeyJsonBase64.getValue(connection);
|
|
15444
|
+
const serviceAccountJsonBase64 = parameters6.serviceAccountKeyJsonBase64.getValue(connection);
|
|
15216
15445
|
const credentials = JSON.parse(
|
|
15217
15446
|
Buffer.from(serviceAccountJsonBase64, "base64").toString("utf-8")
|
|
15218
15447
|
);
|
|
15219
|
-
const
|
|
15220
|
-
const
|
|
15221
|
-
|
|
15222
|
-
|
|
15223
|
-
|
|
15224
|
-
|
|
15225
|
-
|
|
15226
|
-
|
|
15227
|
-
|
|
15228
|
-
|
|
15229
|
-
|
|
15448
|
+
const { GoogleAuth } = await Promise.resolve().then(() => __toESM(require_src6(), 1));
|
|
15449
|
+
const auth = new GoogleAuth({
|
|
15450
|
+
credentials,
|
|
15451
|
+
scopes: ["https://www.googleapis.com/auth/bigquery"]
|
|
15452
|
+
});
|
|
15453
|
+
const client = await auth.getClient();
|
|
15454
|
+
const res = await client.request({
|
|
15455
|
+
url: "https://bigquery.googleapis.com/bigquery/v2/projects"
|
|
15456
|
+
});
|
|
15457
|
+
const projects = (res.data.projects ?? []).map((p) => ({
|
|
15458
|
+
projectId: p.projectReference?.projectId ?? "",
|
|
15459
|
+
friendlyName: p.friendlyName ?? p.projectReference?.projectId ?? ""
|
|
15460
|
+
})).filter((p) => p.projectId !== "");
|
|
15461
|
+
return { success: true, projects };
|
|
15230
15462
|
} catch (err) {
|
|
15231
15463
|
const msg = err instanceof Error ? err.message : String(err);
|
|
15232
15464
|
return { success: false, error: msg };
|
|
15233
15465
|
}
|
|
15234
15466
|
}
|
|
15235
15467
|
});
|
|
15236
|
-
var
|
|
15237
|
-
var
|
|
15238
|
-
|
|
15239
|
-
|
|
15240
|
-
|
|
15241
|
-
|
|
15242
|
-
|
|
15243
|
-
|
|
15244
|
-
|
|
15245
|
-
|
|
15246
|
-
|
|
15247
|
-
-
|
|
15248
|
-
-
|
|
15249
|
-
|
|
15250
|
-
|
|
15251
|
-
|
|
15252
|
-
|
|
15253
|
-
|
|
15254
|
-
|
|
15255
|
-
|
|
15256
|
-
|
|
15257
|
-
|
|
15258
|
-
|
|
15259
|
-
|
|
15260
|
-
|
|
15261
|
-
|
|
15262
|
-
|
|
15263
|
-
|
|
15264
|
-
|
|
15265
|
-
|
|
15266
|
-
|
|
15267
|
-
|
|
15268
|
-
|
|
15269
|
-
|
|
15270
|
-
|
|
15271
|
-
|
|
15272
|
-
|
|
15273
|
-
|
|
15274
|
-
|
|
15275
|
-
|
|
15276
|
-
|
|
15277
|
-
|
|
15468
|
+
var listProjectsToolName = `bigquery_${listProjectsTool.name}`;
|
|
15469
|
+
var bigquerySetup = new ConnectorSetup({
|
|
15470
|
+
ja: `## BigQuery \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u624B\u9806
|
|
15471
|
+
|
|
15472
|
+
\u4EE5\u4E0B\u306E\u624B\u9806\u3067BigQuery\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306E\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3092\u884C\u3063\u3066\u304F\u3060\u3055\u3044\u3002
|
|
15473
|
+
|
|
15474
|
+
### \u624B\u9806
|
|
15475
|
+
|
|
15476
|
+
#### \u30B9\u30C6\u30C3\u30D71: \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u9078\u629E
|
|
15477
|
+
1. \`${listProjectsToolName}\` \u3092\u547C\u3073\u51FA\u3057\u3066\u3001\u30B5\u30FC\u30D3\u30B9\u30A2\u30AB\u30A6\u30F3\u30C8\u304C\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306AGCP\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u4E00\u89A7\u3092\u53D6\u5F97\u3059\u308B
|
|
15478
|
+
2. \`updateConnectionParameters\` \u3092\u547C\u3073\u51FA\u3059:
|
|
15479
|
+
- \`parameterSlug\`: \`"project-id"\`
|
|
15480
|
+
- \`options\`: \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u4E00\u89A7\u3002\u5404 option \u306E \`label\` \u306F \`\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u540D (id: \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8ID)\` \u306E\u5F62\u5F0F\u3001\`value\` \u306F\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8ID
|
|
15481
|
+
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
|
|
15482
|
+
|
|
15483
|
+
#### \u30B9\u30C6\u30C3\u30D72: \u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u9078\u629E
|
|
15484
|
+
1. \`SELECT schema_name FROM INFORMATION_SCHEMA.SCHEMATA\` \u3092\u5B9F\u884C\u3057\u3066\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u4E00\u89A7\u3092\u53D6\u5F97\u3059\u308B
|
|
15485
|
+
2. \u7D50\u679C\u306B\u5FDC\u3058\u3066\u5206\u5C90:
|
|
15486
|
+
- **\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u304C2\u3064\u4EE5\u4E0A**: \`askUserQuestion\`\uFF08multiSelect: true\uFF09\u3067\u30E6\u30FC\u30B6\u30FC\u306B\u63D0\u793A\u3057\u3001\u4F7F\u7528\u3059\u308B\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u3092\u9078\u629E\u3055\u305B\u308B
|
|
15487
|
+
- **\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u304C1\u3064\u3060\u3051**: askUserQuestion \u306F\u4F7F\u308F\u305A\u81EA\u52D5\u63A1\u7528\u3002\u300C\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8 X \u3092\u81EA\u52D5\u9078\u629E\u3057\u307E\u3057\u305F\u300D\u30681\u6587\u3060\u3051\u66F8\u304F
|
|
15488
|
+
|
|
15489
|
+
#### \u30B9\u30C6\u30C3\u30D73: \u30C6\u30FC\u30D6\u30EB\u9078\u629E
|
|
15490
|
+
3. \u9078\u629E\u3055\u308C\u305F\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306B\u5BFE\u3057\u3066 \`SELECT table_name FROM \\\`{project}.{dataset}.INFORMATION_SCHEMA.TABLES\\\`\` \u3092\u5B9F\u884C\u3057\u3066\u30C6\u30FC\u30D6\u30EB\u4E00\u89A7\u3092\u53D6\u5F97\u3059\u308B\uFF08\u8907\u6570\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306E\u5834\u5408\u306F UNION ALL \u3067\u4E00\u62EC\u53D6\u5F97\uFF09
|
|
15491
|
+
4. \u7D50\u679C\u306B\u5FDC\u3058\u3066\u5206\u5C90:
|
|
15492
|
+
- **\u30C6\u30FC\u30D6\u30EB\u304C2\u3064\u4EE5\u4E0A**: \`askUserQuestion\`\uFF08multiSelect: true\uFF09\u3067\u30E6\u30FC\u30B6\u30FC\u306B\u63D0\u793A\u3057\u3001\u4F7F\u7528\u3059\u308B\u30C6\u30FC\u30D6\u30EB\u3092\u9078\u629E\u3055\u305B\u308B\u3002description \u306B\u306F\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u540D\u3092\u8A18\u8F09\u3059\u308B
|
|
15493
|
+
- **\u30C6\u30FC\u30D6\u30EB\u304C1\u3064\u3060\u3051**: askUserQuestion \u306F\u4F7F\u308F\u305A\u81EA\u52D5\u63A1\u7528
|
|
15494
|
+
|
|
15495
|
+
#### \u30B9\u30C6\u30C3\u30D74: \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u5B8C\u4E86
|
|
15496
|
+
5. \`updateConnectionContext\` \u3092\u547C\u3073\u51FA\u3059:
|
|
15497
|
+
- \`dataset\`: \u9078\u629E\u3055\u308C\u305F\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u540D\uFF08\u8907\u6570\u306E\u5834\u5408\u306F\u30AB\u30F3\u30DE\u533A\u5207\u308A\uFF09
|
|
15498
|
+
- \`tables\`: \u9078\u629E\u3055\u308C\u305F\u30C6\u30FC\u30D6\u30EB\u540D\uFF08\u8907\u6570\u306E\u5834\u5408\u306F\u30AB\u30F3\u30DE\u533A\u5207\u308A\uFF09
|
|
15499
|
+
- \`note\`: \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u5185\u5BB9\u306E\u7C21\u5358\u306A\u8AAC\u660E
|
|
15500
|
+
|
|
15501
|
+
### \u91CD\u8981\u306A\u5236\u7D04
|
|
15502
|
+
- **\u30C6\u30FC\u30D6\u30EB\u306E\u884C\u30C7\u30FC\u30BF\u3092\u8AAD\u307F\u53D6\u3089\u306A\u3044\u3053\u3068**\u3002\u5B9F\u884C\u3057\u3066\u3088\u3044\u306E\u306F\u4E0A\u8A18\u624B\u9806\u3067\u6307\u5B9A\u3055\u308C\u305F\u30E1\u30BF\u30C7\u30FC\u30BF\u53D6\u5F97\u30AF\u30A8\u30EA\u306E\u307F\u3002\u305D\u308C\u4EE5\u5916\u306E\u30AF\u30A8\u30EA\u306F\u5B9F\u884C\u7981\u6B62
|
|
15503
|
+
|
|
15504
|
+
### \u5B9F\u884C\u65B9\u91DD
|
|
15505
|
+
- \u30C4\u30FC\u30EB\u9593\u306F1\u6587\u3060\u3051\u66F8\u3044\u3066\u5373\u6B21\u306E\u30C4\u30FC\u30EB\u547C\u3073\u51FA\u3057
|
|
15506
|
+
- \u4E0D\u8981\u306A\u8AAC\u660E\u306F\u7701\u7565\u3057\u3001\u52B9\u7387\u7684\u306B\u9032\u3081\u308B`,
|
|
15507
|
+
en: `## BigQuery Setup Instructions
|
|
15508
|
+
|
|
15509
|
+
Follow these steps to set up the BigQuery connection.
|
|
15510
|
+
|
|
15511
|
+
### Steps
|
|
15512
|
+
|
|
15513
|
+
#### Step 1: Project Selection
|
|
15514
|
+
1. Call \`${listProjectsToolName}\` to get the list of GCP projects accessible with the service account credentials
|
|
15515
|
+
2. Call \`updateConnectionParameters\`:
|
|
15516
|
+
- \`parameterSlug\`: \`"project-id"\`
|
|
15517
|
+
- \`options\`: The project list. Each option's \`label\` should be \`Project Name (id: project-id)\`, \`value\` should be the project ID
|
|
15518
|
+
3. The \`label\` of the user's selected project will arrive as a message. Proceed to Step 2
|
|
15519
|
+
|
|
15520
|
+
#### Step 2: Dataset Selection
|
|
15521
|
+
1. Run \`SELECT schema_name FROM INFORMATION_SCHEMA.SCHEMATA\` to get the list of datasets
|
|
15522
|
+
2. Branch based on results:
|
|
15523
|
+
- **2 or more datasets**: Present them to the user via \`askUserQuestion\` (multiSelect: true) and let them select which datasets to use
|
|
15524
|
+
- **Exactly 1 dataset**: Do NOT call askUserQuestion. Auto-select it. Just write "Auto-selected dataset X" in one sentence
|
|
15525
|
+
|
|
15526
|
+
#### Step 3: Table Selection
|
|
15527
|
+
3. For the selected dataset(s), run \`SELECT table_name FROM \\\`{project}.{dataset}.INFORMATION_SCHEMA.TABLES\\\`\` to get the table list (use UNION ALL for multiple datasets)
|
|
15528
|
+
4. Branch based on results:
|
|
15529
|
+
- **2 or more tables**: Present them to the user via \`askUserQuestion\` (multiSelect: true) and let them select which tables to use. Include the dataset name in the description
|
|
15530
|
+
- **Exactly 1 table**: Do NOT call askUserQuestion. Auto-select it
|
|
15531
|
+
|
|
15532
|
+
#### Step 4: Complete Setup
|
|
15533
|
+
5. Call \`updateConnectionContext\`:
|
|
15534
|
+
- \`dataset\`: Selected dataset name(s) (comma-separated if multiple)
|
|
15535
|
+
- \`tables\`: Selected table name(s) (comma-separated if multiple)
|
|
15536
|
+
- \`note\`: Brief description of the setup
|
|
15537
|
+
|
|
15538
|
+
### Important Constraints
|
|
15539
|
+
- **Do NOT read table row data**. Only the metadata queries specified in the steps above are allowed. All other queries are forbidden
|
|
15540
|
+
|
|
15541
|
+
### Execution Policy
|
|
15542
|
+
- Write only 1 sentence between tool calls, then immediately call the next tool
|
|
15543
|
+
- Skip unnecessary explanations and proceed efficiently`
|
|
15544
|
+
});
|
|
15545
|
+
var MAX_ROWS5 = 500;
|
|
15546
|
+
var inputSchema6 = z6.object({
|
|
15547
|
+
toolUseIntent: z6.string().optional().describe(
|
|
15548
|
+
"Brief description of what you intend to accomplish with this tool call"
|
|
15549
|
+
),
|
|
15550
|
+
connectionId: z6.string().describe("ID of the BigQuery connection to use"),
|
|
15551
|
+
sql: z6.string().describe(
|
|
15552
|
+
"BigQuery SQL (GoogleSQL) query. Use backtick-quoted fully qualified names `project.dataset.table` for table references."
|
|
15553
|
+
)
|
|
15554
|
+
});
|
|
15555
|
+
var outputSchema6 = z6.discriminatedUnion("success", [
|
|
15556
|
+
z6.object({
|
|
15557
|
+
success: z6.literal(true),
|
|
15558
|
+
rowCount: z6.number(),
|
|
15559
|
+
truncated: z6.boolean(),
|
|
15560
|
+
rows: z6.array(z6.record(z6.string(), z6.unknown()))
|
|
15561
|
+
}),
|
|
15562
|
+
z6.object({
|
|
15563
|
+
success: z6.literal(false),
|
|
15564
|
+
error: z6.string()
|
|
15278
15565
|
})
|
|
15279
|
-
|
|
15280
|
-
var
|
|
15566
|
+
]);
|
|
15567
|
+
var executeQueryTool5 = new ConnectorTool({
|
|
15568
|
+
name: "executeQuery",
|
|
15569
|
+
description: `Execute SQL against BigQuery. Returns up to ${MAX_ROWS5} rows.
|
|
15570
|
+
Use for: schema exploration (INFORMATION_SCHEMA), data sampling, analytical queries.
|
|
15571
|
+
Avoid loading large amounts of data; always include LIMIT in queries.`,
|
|
15572
|
+
inputSchema: inputSchema6,
|
|
15573
|
+
outputSchema: outputSchema6,
|
|
15574
|
+
async execute({ connectionId, sql }, connections) {
|
|
15575
|
+
const connection = connections.find((c) => c.id === connectionId);
|
|
15576
|
+
if (!connection) {
|
|
15577
|
+
return {
|
|
15578
|
+
success: false,
|
|
15579
|
+
error: `Connection ${connectionId} not found`
|
|
15580
|
+
};
|
|
15581
|
+
}
|
|
15582
|
+
console.log(
|
|
15583
|
+
`[connector-query] bigquery/${connection.name}: ${sql}`
|
|
15584
|
+
);
|
|
15585
|
+
try {
|
|
15586
|
+
const { BigQuery } = await import("@google-cloud/bigquery");
|
|
15587
|
+
const projectId = parameters6.projectId.getValue(connection);
|
|
15588
|
+
const serviceAccountJsonBase64 = parameters6.serviceAccountKeyJsonBase64.getValue(connection);
|
|
15589
|
+
const credentials = JSON.parse(
|
|
15590
|
+
Buffer.from(serviceAccountJsonBase64, "base64").toString("utf-8")
|
|
15591
|
+
);
|
|
15592
|
+
const bq = new BigQuery({ projectId, credentials });
|
|
15593
|
+
const [job] = await bq.createQueryJob({ query: sql });
|
|
15594
|
+
const [rows] = await job.getQueryResults();
|
|
15595
|
+
const allRows = rows;
|
|
15596
|
+
const truncated = allRows.length > MAX_ROWS5;
|
|
15597
|
+
return {
|
|
15598
|
+
success: true,
|
|
15599
|
+
rowCount: Math.min(allRows.length, MAX_ROWS5),
|
|
15600
|
+
truncated,
|
|
15601
|
+
rows: allRows.slice(0, MAX_ROWS5)
|
|
15602
|
+
};
|
|
15603
|
+
} catch (err) {
|
|
15604
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
15605
|
+
return { success: false, error: msg };
|
|
15606
|
+
}
|
|
15607
|
+
}
|
|
15608
|
+
});
|
|
15609
|
+
var tools5 = { executeQuery: executeQueryTool5, listProjects: listProjectsTool };
|
|
15610
|
+
var bigqueryConnector = new ConnectorPlugin({
|
|
15611
|
+
slug: "bigquery",
|
|
15612
|
+
authType: null,
|
|
15613
|
+
name: "BigQuery",
|
|
15614
|
+
description: "Connect to Google BigQuery for data warehouse and analytics.",
|
|
15615
|
+
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/6nlehQyOmdbktG5hOYkYMr/6ca559140d5ddc7dadc5eac88858a563/bigquery.svg",
|
|
15616
|
+
parameters: parameters6,
|
|
15617
|
+
releaseFlag: { dev1: true, dev2: true, prod: true },
|
|
15618
|
+
setup: bigquerySetup,
|
|
15619
|
+
systemPrompt: `## BigQuery SQL Notes
|
|
15620
|
+
- Use backtick-quoted fully qualified names \`project.dataset.table\` for table references
|
|
15621
|
+
- Use INFORMATION_SCHEMA for schema exploration
|
|
15622
|
+
- List datasets: \`SELECT schema_name FROM \\\`project_id\\\`.INFORMATION_SCHEMA.SCHEMATA\`
|
|
15623
|
+
- List tables: \`SELECT table_name FROM \\\`project_id.dataset\\\`.INFORMATION_SCHEMA.TABLES\`
|
|
15624
|
+
- List columns: \`SELECT column_name, data_type FROM \\\`project_id.dataset\\\`.INFORMATION_SCHEMA.COLUMNS WHERE table_name = 'xxx'\`
|
|
15625
|
+
- Always specify project_id explicitly in queries`,
|
|
15626
|
+
tools: tools5,
|
|
15627
|
+
async checkConnection(params, _config) {
|
|
15628
|
+
const { BigQuery } = await import("@google-cloud/bigquery");
|
|
15629
|
+
const credentials = JSON.parse(
|
|
15630
|
+
Buffer.from(params[parameters6.serviceAccountKeyJsonBase64.slug], "base64").toString("utf-8")
|
|
15631
|
+
);
|
|
15632
|
+
const bq = new BigQuery({
|
|
15633
|
+
projectId: params[parameters6.projectId.slug],
|
|
15634
|
+
credentials
|
|
15635
|
+
});
|
|
15636
|
+
try {
|
|
15637
|
+
const [job] = await bq.createQueryJob({ query: "SELECT 1" });
|
|
15638
|
+
await job.getQueryResults();
|
|
15639
|
+
return { success: true };
|
|
15640
|
+
} catch (error) {
|
|
15641
|
+
return { success: false, error: error instanceof Error ? error.message : String(error) };
|
|
15642
|
+
}
|
|
15643
|
+
},
|
|
15644
|
+
async query(params, sql, namedParams) {
|
|
15645
|
+
const { BigQuery } = await import("@google-cloud/bigquery");
|
|
15646
|
+
const resolvedSql = replaceLiteralParams(sql, namedParams);
|
|
15647
|
+
const credentials = JSON.parse(
|
|
15648
|
+
Buffer.from(params[parameters6.serviceAccountKeyJsonBase64.slug], "base64").toString("utf-8")
|
|
15649
|
+
);
|
|
15650
|
+
const bq = new BigQuery({
|
|
15651
|
+
projectId: params[parameters6.projectId.slug],
|
|
15652
|
+
credentials
|
|
15653
|
+
});
|
|
15654
|
+
const [job] = await bq.createQueryJob({ query: resolvedSql });
|
|
15655
|
+
const [rows] = await job.getQueryResults();
|
|
15656
|
+
return { rows };
|
|
15657
|
+
}
|
|
15658
|
+
});
|
|
15281
15659
|
var REQUEST_TIMEOUT_MS = 6e4;
|
|
15282
15660
|
var cachedToken = null;
|
|
15283
15661
|
async function getProxyToken(config) {
|
|
@@ -15308,25 +15686,218 @@ async function getProxyToken(config) {
|
|
|
15308
15686
|
};
|
|
15309
15687
|
return data.token;
|
|
15310
15688
|
}
|
|
15311
|
-
var
|
|
15312
|
-
toolUseIntent:
|
|
15689
|
+
var inputSchema7 = z7.object({
|
|
15690
|
+
toolUseIntent: z7.string().optional().describe(
|
|
15313
15691
|
"Brief description of what you intend to accomplish with this tool call"
|
|
15314
15692
|
),
|
|
15315
|
-
connectionId:
|
|
15316
|
-
|
|
15693
|
+
connectionId: z7.string().describe("ID of the BigQuery OAuth connection to use")
|
|
15694
|
+
});
|
|
15695
|
+
var outputSchema7 = z7.discriminatedUnion("success", [
|
|
15696
|
+
z7.object({
|
|
15697
|
+
success: z7.literal(true),
|
|
15698
|
+
projects: z7.array(
|
|
15699
|
+
z7.object({
|
|
15700
|
+
projectId: z7.string(),
|
|
15701
|
+
friendlyName: z7.string()
|
|
15702
|
+
})
|
|
15703
|
+
)
|
|
15704
|
+
}),
|
|
15705
|
+
z7.object({
|
|
15706
|
+
success: z7.literal(false),
|
|
15707
|
+
error: z7.string()
|
|
15708
|
+
})
|
|
15709
|
+
]);
|
|
15710
|
+
var listProjectsTool2 = new ConnectorTool({
|
|
15711
|
+
name: "listProjects",
|
|
15712
|
+
description: `List GCP projects accessible with the current OAuth credentials. Returns project IDs and friendly names.`,
|
|
15713
|
+
inputSchema: inputSchema7,
|
|
15714
|
+
outputSchema: outputSchema7,
|
|
15715
|
+
async execute({ connectionId }, connections, config) {
|
|
15716
|
+
const connection = connections.find((c) => c.id === connectionId);
|
|
15717
|
+
if (!connection) {
|
|
15718
|
+
return {
|
|
15719
|
+
success: false,
|
|
15720
|
+
error: `Connection ${connectionId} not found`
|
|
15721
|
+
};
|
|
15722
|
+
}
|
|
15723
|
+
console.log(
|
|
15724
|
+
`[connector-query] bigquery-oauth/${connection.name}: listProjects`
|
|
15725
|
+
);
|
|
15726
|
+
try {
|
|
15727
|
+
const token = await getProxyToken(config.oauthProxy);
|
|
15728
|
+
const proxyUrl = `https://${config.oauthProxy.sandboxId}.${config.oauthProxy.previewBaseDomain}/_sqcore/connections/${connectionId}/request`;
|
|
15729
|
+
const controller = new AbortController();
|
|
15730
|
+
const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS);
|
|
15731
|
+
try {
|
|
15732
|
+
const response = await fetch(proxyUrl, {
|
|
15733
|
+
method: "POST",
|
|
15734
|
+
headers: {
|
|
15735
|
+
"Content-Type": "application/json",
|
|
15736
|
+
Authorization: `Bearer ${token}`
|
|
15737
|
+
},
|
|
15738
|
+
body: JSON.stringify({
|
|
15739
|
+
url: "https://bigquery.googleapis.com/bigquery/v2/projects",
|
|
15740
|
+
method: "GET"
|
|
15741
|
+
}),
|
|
15742
|
+
signal: controller.signal
|
|
15743
|
+
});
|
|
15744
|
+
const data = await response.json();
|
|
15745
|
+
if (!response.ok) {
|
|
15746
|
+
const errorMessage = typeof data?.error === "string" ? data.error : typeof data?.message === "string" ? data.message : `HTTP ${response.status} ${response.statusText}`;
|
|
15747
|
+
return { success: false, error: errorMessage };
|
|
15748
|
+
}
|
|
15749
|
+
const projects = (data.projects ?? []).map((p) => ({
|
|
15750
|
+
projectId: p.projectReference?.projectId ?? "",
|
|
15751
|
+
friendlyName: p.friendlyName ?? p.projectReference?.projectId ?? ""
|
|
15752
|
+
})).filter((p) => p.projectId !== "");
|
|
15753
|
+
return { success: true, projects };
|
|
15754
|
+
} finally {
|
|
15755
|
+
clearTimeout(timeout);
|
|
15756
|
+
}
|
|
15757
|
+
} catch (err) {
|
|
15758
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
15759
|
+
return { success: false, error: msg };
|
|
15760
|
+
}
|
|
15761
|
+
}
|
|
15762
|
+
});
|
|
15763
|
+
var listProjectsToolName2 = `bigquery-oauth_${listProjectsTool2.name}`;
|
|
15764
|
+
var bigquerySetup2 = new ConnectorSetup({
|
|
15765
|
+
ja: `## BigQuery \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u624B\u9806
|
|
15766
|
+
|
|
15767
|
+
\u4EE5\u4E0B\u306E\u624B\u9806\u3067BigQuery\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306E\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3092\u884C\u3063\u3066\u304F\u3060\u3055\u3044\u3002
|
|
15768
|
+
|
|
15769
|
+
### \u624B\u9806
|
|
15770
|
+
|
|
15771
|
+
#### \u30B9\u30C6\u30C3\u30D71: \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u9078\u629E
|
|
15772
|
+
1. \`${listProjectsToolName2}\` \u3092\u547C\u3073\u51FA\u3057\u3066\u3001OAuth\u3067\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306AGCP\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u4E00\u89A7\u3092\u53D6\u5F97\u3059\u308B
|
|
15773
|
+
2. \`updateConnectionParameters\` \u3092\u547C\u3073\u51FA\u3059:
|
|
15774
|
+
- \`parameterSlug\`: \`"project-id"\`
|
|
15775
|
+
- \`options\`: \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u4E00\u89A7\u3002\u5404 option \u306E \`label\` \u306F \`\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u540D (id: \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8ID)\` \u306E\u5F62\u5F0F\u3001\`value\` \u306F\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8ID
|
|
15776
|
+
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
|
|
15777
|
+
|
|
15778
|
+
#### \u30B9\u30C6\u30C3\u30D72: \u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u9078\u629E
|
|
15779
|
+
1. \`SELECT schema_name FROM INFORMATION_SCHEMA.SCHEMATA\` \u3092\u5B9F\u884C\u3057\u3066\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u4E00\u89A7\u3092\u53D6\u5F97\u3059\u308B
|
|
15780
|
+
2. \u7D50\u679C\u306B\u5FDC\u3058\u3066\u5206\u5C90:
|
|
15781
|
+
- **\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u304C2\u3064\u4EE5\u4E0A**: \`askUserQuestion\`\uFF08multiSelect: true\uFF09\u3067\u30E6\u30FC\u30B6\u30FC\u306B\u63D0\u793A\u3057\u3001\u4F7F\u7528\u3059\u308B\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u3092\u9078\u629E\u3055\u305B\u308B
|
|
15782
|
+
- **\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u304C1\u3064\u3060\u3051**: askUserQuestion \u306F\u4F7F\u308F\u305A\u81EA\u52D5\u63A1\u7528\u3002\u300C\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8 X \u3092\u81EA\u52D5\u9078\u629E\u3057\u307E\u3057\u305F\u300D\u30681\u6587\u3060\u3051\u66F8\u304F
|
|
15783
|
+
|
|
15784
|
+
#### \u30B9\u30C6\u30C3\u30D73: \u30C6\u30FC\u30D6\u30EB\u9078\u629E
|
|
15785
|
+
3. \u9078\u629E\u3055\u308C\u305F\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306B\u5BFE\u3057\u3066 \`SELECT table_name FROM \\\`{project}.{dataset}.INFORMATION_SCHEMA.TABLES\\\`\` \u3092\u5B9F\u884C\u3057\u3066\u30C6\u30FC\u30D6\u30EB\u4E00\u89A7\u3092\u53D6\u5F97\u3059\u308B\uFF08\u8907\u6570\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306E\u5834\u5408\u306F UNION ALL \u3067\u4E00\u62EC\u53D6\u5F97\uFF09
|
|
15786
|
+
4. \u7D50\u679C\u306B\u5FDC\u3058\u3066\u5206\u5C90:
|
|
15787
|
+
- **\u30C6\u30FC\u30D6\u30EB\u304C2\u3064\u4EE5\u4E0A**: \`askUserQuestion\`\uFF08multiSelect: true\uFF09\u3067\u30E6\u30FC\u30B6\u30FC\u306B\u63D0\u793A\u3057\u3001\u4F7F\u7528\u3059\u308B\u30C6\u30FC\u30D6\u30EB\u3092\u9078\u629E\u3055\u305B\u308B\u3002description \u306B\u306F\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u540D\u3092\u8A18\u8F09\u3059\u308B
|
|
15788
|
+
- **\u30C6\u30FC\u30D6\u30EB\u304C1\u3064\u3060\u3051**: askUserQuestion \u306F\u4F7F\u308F\u305A\u81EA\u52D5\u63A1\u7528
|
|
15789
|
+
|
|
15790
|
+
#### \u30B9\u30C6\u30C3\u30D74: \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u5B8C\u4E86
|
|
15791
|
+
5. \`updateConnectionContext\` \u3092\u547C\u3073\u51FA\u3059:
|
|
15792
|
+
- \`dataset\`: \u9078\u629E\u3055\u308C\u305F\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u540D\uFF08\u8907\u6570\u306E\u5834\u5408\u306F\u30AB\u30F3\u30DE\u533A\u5207\u308A\uFF09
|
|
15793
|
+
- \`tables\`: \u9078\u629E\u3055\u308C\u305F\u30C6\u30FC\u30D6\u30EB\u540D\uFF08\u8907\u6570\u306E\u5834\u5408\u306F\u30AB\u30F3\u30DE\u533A\u5207\u308A\uFF09
|
|
15794
|
+
- \`note\`: \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u5185\u5BB9\u306E\u7C21\u5358\u306A\u8AAC\u660E
|
|
15795
|
+
|
|
15796
|
+
### \u91CD\u8981\u306A\u5236\u7D04
|
|
15797
|
+
- **\u30C6\u30FC\u30D6\u30EB\u306E\u884C\u30C7\u30FC\u30BF\u3092\u8AAD\u307F\u53D6\u3089\u306A\u3044\u3053\u3068**\u3002\u5B9F\u884C\u3057\u3066\u3088\u3044\u306E\u306F\u4E0A\u8A18\u624B\u9806\u3067\u6307\u5B9A\u3055\u308C\u305F\u30E1\u30BF\u30C7\u30FC\u30BF\u53D6\u5F97\u30AF\u30A8\u30EA\u306E\u307F\u3002\u305D\u308C\u4EE5\u5916\u306E\u30AF\u30A8\u30EA\u306F\u5B9F\u884C\u7981\u6B62
|
|
15798
|
+
|
|
15799
|
+
### \u5B9F\u884C\u65B9\u91DD
|
|
15800
|
+
- \u30C4\u30FC\u30EB\u9593\u306F1\u6587\u3060\u3051\u66F8\u3044\u3066\u5373\u6B21\u306E\u30C4\u30FC\u30EB\u547C\u3073\u51FA\u3057
|
|
15801
|
+
- \u4E0D\u8981\u306A\u8AAC\u660E\u306F\u7701\u7565\u3057\u3001\u52B9\u7387\u7684\u306B\u9032\u3081\u308B`,
|
|
15802
|
+
en: `## BigQuery Setup Instructions
|
|
15803
|
+
|
|
15804
|
+
Follow these steps to set up the BigQuery connection.
|
|
15805
|
+
|
|
15806
|
+
### Steps
|
|
15807
|
+
|
|
15808
|
+
#### Step 1: Project Selection
|
|
15809
|
+
1. Call \`${listProjectsToolName2}\` to get the list of GCP projects accessible with the OAuth credentials
|
|
15810
|
+
2. Call \`updateConnectionParameters\`:
|
|
15811
|
+
- \`parameterSlug\`: \`"project-id"\`
|
|
15812
|
+
- \`options\`: The project list. Each option's \`label\` should be \`Project Name (id: project-id)\`, \`value\` should be the project ID
|
|
15813
|
+
3. The \`label\` of the user's selected project will arrive as a message. Proceed to Step 2
|
|
15814
|
+
|
|
15815
|
+
#### Step 2: Dataset Selection
|
|
15816
|
+
1. Run \`SELECT schema_name FROM INFORMATION_SCHEMA.SCHEMATA\` to get the list of datasets
|
|
15817
|
+
2. Branch based on results:
|
|
15818
|
+
- **2 or more datasets**: Present them to the user via \`askUserQuestion\` (multiSelect: true) and let them select which datasets to use
|
|
15819
|
+
- **Exactly 1 dataset**: Do NOT call askUserQuestion. Auto-select it. Just write "Auto-selected dataset X" in one sentence
|
|
15820
|
+
|
|
15821
|
+
#### Step 3: Table Selection
|
|
15822
|
+
3. For the selected dataset(s), run \`SELECT table_name FROM \\\`{project}.{dataset}.INFORMATION_SCHEMA.TABLES\\\`\` to get the table list (use UNION ALL for multiple datasets)
|
|
15823
|
+
4. Branch based on results:
|
|
15824
|
+
- **2 or more tables**: Present them to the user via \`askUserQuestion\` (multiSelect: true) and let them select which tables to use. Include the dataset name in the description
|
|
15825
|
+
- **Exactly 1 table**: Do NOT call askUserQuestion. Auto-select it
|
|
15826
|
+
|
|
15827
|
+
#### Step 4: Complete Setup
|
|
15828
|
+
5. Call \`updateConnectionContext\`:
|
|
15829
|
+
- \`dataset\`: Selected dataset name(s) (comma-separated if multiple)
|
|
15830
|
+
- \`tables\`: Selected table name(s) (comma-separated if multiple)
|
|
15831
|
+
- \`note\`: Brief description of the setup
|
|
15832
|
+
|
|
15833
|
+
### Important Constraints
|
|
15834
|
+
- **Do NOT read table row data**. Only the metadata queries specified in the steps above are allowed. All other queries are forbidden
|
|
15835
|
+
|
|
15836
|
+
### Execution Policy
|
|
15837
|
+
- Write only 1 sentence between tool calls, then immediately call the next tool
|
|
15838
|
+
- Skip unnecessary explanations and proceed efficiently`
|
|
15839
|
+
});
|
|
15840
|
+
var parameters7 = {
|
|
15841
|
+
projectId: new ParameterDefinition({
|
|
15842
|
+
slug: "project-id",
|
|
15843
|
+
name: "Google Cloud Project ID",
|
|
15844
|
+
description: "The ID of the Google Cloud project where resources will be managed.",
|
|
15845
|
+
envVarBaseKey: "BIGQUERY_OAUTH_PROJECT_ID",
|
|
15846
|
+
type: "text",
|
|
15847
|
+
secret: false,
|
|
15848
|
+
required: false
|
|
15849
|
+
})
|
|
15850
|
+
};
|
|
15851
|
+
var MAX_ROWS6 = 500;
|
|
15852
|
+
var REQUEST_TIMEOUT_MS2 = 6e4;
|
|
15853
|
+
var cachedToken2 = null;
|
|
15854
|
+
async function getProxyToken2(config) {
|
|
15855
|
+
if (cachedToken2 && cachedToken2.expiresAt > Date.now() + 6e4) {
|
|
15856
|
+
return cachedToken2.token;
|
|
15857
|
+
}
|
|
15858
|
+
const url = `${config.appApiBaseUrl}/v0/database/${config.projectId}/environment/${config.environmentId}/oauth-request-proxy-token`;
|
|
15859
|
+
const res = await fetch(url, {
|
|
15860
|
+
method: "POST",
|
|
15861
|
+
headers: {
|
|
15862
|
+
"Content-Type": "application/json",
|
|
15863
|
+
"x-api-key": config.appApiKey,
|
|
15864
|
+
"project-id": config.projectId
|
|
15865
|
+
},
|
|
15866
|
+
body: JSON.stringify({
|
|
15867
|
+
sandboxId: config.sandboxId,
|
|
15868
|
+
issuedBy: "coding-agent"
|
|
15869
|
+
})
|
|
15870
|
+
});
|
|
15871
|
+
if (!res.ok) {
|
|
15872
|
+
const errorText = await res.text().catch(() => res.statusText);
|
|
15873
|
+
throw new Error(`Failed to get proxy token: HTTP ${res.status} ${errorText}`);
|
|
15874
|
+
}
|
|
15875
|
+
const data = await res.json();
|
|
15876
|
+
cachedToken2 = {
|
|
15877
|
+
token: data.token,
|
|
15878
|
+
expiresAt: new Date(data.expiresAt).getTime()
|
|
15879
|
+
};
|
|
15880
|
+
return data.token;
|
|
15881
|
+
}
|
|
15882
|
+
var inputSchema8 = z8.object({
|
|
15883
|
+
toolUseIntent: z8.string().optional().describe(
|
|
15884
|
+
"Brief description of what you intend to accomplish with this tool call"
|
|
15885
|
+
),
|
|
15886
|
+
connectionId: z8.string().describe("ID of the BigQuery OAuth connection to use"),
|
|
15887
|
+
sql: z8.string().describe(
|
|
15317
15888
|
"BigQuery SQL (GoogleSQL) query. Use backtick-quoted fully qualified names `project.dataset.table` for table references."
|
|
15318
15889
|
)
|
|
15319
15890
|
});
|
|
15320
|
-
var
|
|
15321
|
-
|
|
15322
|
-
success:
|
|
15323
|
-
rowCount:
|
|
15324
|
-
truncated:
|
|
15325
|
-
rows:
|
|
15891
|
+
var outputSchema8 = z8.discriminatedUnion("success", [
|
|
15892
|
+
z8.object({
|
|
15893
|
+
success: z8.literal(true),
|
|
15894
|
+
rowCount: z8.number(),
|
|
15895
|
+
truncated: z8.boolean(),
|
|
15896
|
+
rows: z8.array(z8.record(z8.string(), z8.unknown()))
|
|
15326
15897
|
}),
|
|
15327
|
-
|
|
15328
|
-
success:
|
|
15329
|
-
error:
|
|
15898
|
+
z8.object({
|
|
15899
|
+
success: z8.literal(false),
|
|
15900
|
+
error: z8.string()
|
|
15330
15901
|
})
|
|
15331
15902
|
]);
|
|
15332
15903
|
function parseQueryResponse(data) {
|
|
@@ -15347,8 +15918,8 @@ var executeQueryTool6 = new ConnectorTool({
|
|
|
15347
15918
|
description: `Execute SQL against BigQuery via OAuth. Returns up to ${MAX_ROWS6} rows.
|
|
15348
15919
|
Use for: schema exploration (INFORMATION_SCHEMA), data sampling, analytical queries.
|
|
15349
15920
|
Avoid loading large amounts of data; always include LIMIT in queries.`,
|
|
15350
|
-
inputSchema:
|
|
15351
|
-
outputSchema:
|
|
15921
|
+
inputSchema: inputSchema8,
|
|
15922
|
+
outputSchema: outputSchema8,
|
|
15352
15923
|
async execute({ connectionId, sql }, connections, config) {
|
|
15353
15924
|
const connection = connections.find((c) => c.id === connectionId);
|
|
15354
15925
|
if (!connection) {
|
|
@@ -15357,16 +15928,16 @@ Avoid loading large amounts of data; always include LIMIT in queries.`,
|
|
|
15357
15928
|
error: `Connection ${connectionId} not found`
|
|
15358
15929
|
};
|
|
15359
15930
|
}
|
|
15360
|
-
const gcpProjectId =
|
|
15931
|
+
const gcpProjectId = parameters7.projectId.getValue(connection);
|
|
15361
15932
|
console.log(
|
|
15362
15933
|
`[connector-query] bigquery-oauth/${connection.name}: ${sql}`
|
|
15363
15934
|
);
|
|
15364
15935
|
try {
|
|
15365
|
-
const token = await
|
|
15936
|
+
const token = await getProxyToken2(config.oauthProxy);
|
|
15366
15937
|
const proxyUrl = `https://${config.oauthProxy.sandboxId}.${config.oauthProxy.previewBaseDomain}/_sqcore/connections/${connectionId}/request`;
|
|
15367
15938
|
const queryUrl = `https://bigquery.googleapis.com/bigquery/v2/projects/${gcpProjectId}/queries`;
|
|
15368
15939
|
const controller = new AbortController();
|
|
15369
|
-
const timeout = setTimeout(() => controller.abort(),
|
|
15940
|
+
const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS2);
|
|
15370
15941
|
try {
|
|
15371
15942
|
const response = await fetch(proxyUrl, {
|
|
15372
15943
|
method: "POST",
|
|
@@ -15403,7 +15974,7 @@ Avoid loading large amounts of data; always include LIMIT in queries.`,
|
|
|
15403
15974
|
}
|
|
15404
15975
|
}
|
|
15405
15976
|
});
|
|
15406
|
-
var tools6 = { executeQuery: executeQueryTool6 };
|
|
15977
|
+
var tools6 = { executeQuery: executeQueryTool6, listProjects: listProjectsTool2 };
|
|
15407
15978
|
function parseQueryResponse2(data) {
|
|
15408
15979
|
const schema = data.schema;
|
|
15409
15980
|
const rawRows = data.rows;
|
|
@@ -15422,12 +15993,13 @@ var bigqueryOauthConnector = new ConnectorPlugin({
|
|
|
15422
15993
|
name: "BigQuery (OAuth)",
|
|
15423
15994
|
description: "Connect to Google BigQuery for data warehouse and analytics using OAuth.",
|
|
15424
15995
|
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/6nlehQyOmdbktG5hOYkYMr/6ca559140d5ddc7dadc5eac88858a563/bigquery.svg",
|
|
15425
|
-
|
|
15426
|
-
parameters: parameters6,
|
|
15996
|
+
parameters: parameters7,
|
|
15427
15997
|
releaseFlag: { dev1: true, dev2: false, prod: false },
|
|
15998
|
+
setup: bigquerySetup2,
|
|
15428
15999
|
proxyPolicy: {
|
|
15429
16000
|
allowlist: [
|
|
15430
|
-
{ host: "bigquery.googleapis.com", methods: ["GET", "POST", "PUT", "PATCH", "DELETE"] }
|
|
16001
|
+
{ host: "bigquery.googleapis.com", methods: ["GET", "POST", "PUT", "PATCH", "DELETE"] },
|
|
16002
|
+
{ host: "www.googleapis.com", pathPrefix: "/bigquery/v2", methods: ["GET", "POST"] }
|
|
15431
16003
|
]
|
|
15432
16004
|
},
|
|
15433
16005
|
systemPrompt: `## BigQuery SQL Notes (OAuth)
|
|
@@ -15438,9 +16010,28 @@ var bigqueryOauthConnector = new ConnectorPlugin({
|
|
|
15438
16010
|
- List columns: \`SELECT column_name, data_type FROM \\\`project_id.dataset\\\`.INFORMATION_SCHEMA.COLUMNS WHERE table_name = 'xxx'\`
|
|
15439
16011
|
- Always specify project_id explicitly in queries`,
|
|
15440
16012
|
tools: tools6,
|
|
16013
|
+
async checkConnection(params, config) {
|
|
16014
|
+
const { proxyFetch } = config;
|
|
16015
|
+
const projectId = params[parameters7.projectId.slug];
|
|
16016
|
+
const url = `https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/queries`;
|
|
16017
|
+
try {
|
|
16018
|
+
const res = await proxyFetch(url, {
|
|
16019
|
+
method: "POST",
|
|
16020
|
+
headers: { "Content-Type": "application/json" },
|
|
16021
|
+
body: JSON.stringify({ query: "SELECT 1", useLegacySql: false })
|
|
16022
|
+
});
|
|
16023
|
+
if (!res.ok) {
|
|
16024
|
+
const errorText = await res.text().catch(() => res.statusText);
|
|
16025
|
+
return { success: false, error: `BigQuery query failed: HTTP ${res.status} ${errorText}` };
|
|
16026
|
+
}
|
|
16027
|
+
return { success: true };
|
|
16028
|
+
} catch (error) {
|
|
16029
|
+
return { success: false, error: error instanceof Error ? error.message : String(error) };
|
|
16030
|
+
}
|
|
16031
|
+
},
|
|
15441
16032
|
async query(params, sql, namedParams, context) {
|
|
15442
16033
|
const { proxyFetch } = context;
|
|
15443
|
-
const projectId = params[
|
|
16034
|
+
const projectId = params[parameters7.projectId.slug];
|
|
15444
16035
|
const resolvedSql = replaceLiteralParams(sql, namedParams);
|
|
15445
16036
|
const url = `https://bigquery.googleapis.com/bigquery/v2/projects/${projectId}/queries`;
|
|
15446
16037
|
const res = await proxyFetch(url, {
|
|
@@ -15456,7 +16047,7 @@ var bigqueryOauthConnector = new ConnectorPlugin({
|
|
|
15456
16047
|
return { rows: parseQueryResponse2(data) };
|
|
15457
16048
|
}
|
|
15458
16049
|
});
|
|
15459
|
-
var
|
|
16050
|
+
var parameters8 = {
|
|
15460
16051
|
awsAccessKeyId: new ParameterDefinition({
|
|
15461
16052
|
slug: "aws-access-key-id",
|
|
15462
16053
|
name: "AWS Access Key ID",
|
|
@@ -15506,23 +16097,23 @@ var parameters7 = {
|
|
|
15506
16097
|
var MAX_ROWS7 = 500;
|
|
15507
16098
|
var POLL_INTERVAL_MS = 1e3;
|
|
15508
16099
|
var POLL_TIMEOUT_MS = 12e4;
|
|
15509
|
-
var
|
|
15510
|
-
toolUseIntent:
|
|
16100
|
+
var inputSchema9 = z9.object({
|
|
16101
|
+
toolUseIntent: z9.string().optional().describe(
|
|
15511
16102
|
"Brief description of what you intend to accomplish with this tool call"
|
|
15512
16103
|
),
|
|
15513
|
-
connectionId:
|
|
15514
|
-
sql:
|
|
16104
|
+
connectionId: z9.string().describe("ID of the AWS Athena connection to use"),
|
|
16105
|
+
sql: z9.string().describe("Athena SQL query (Presto/Trino based)")
|
|
15515
16106
|
});
|
|
15516
|
-
var
|
|
15517
|
-
|
|
15518
|
-
success:
|
|
15519
|
-
rowCount:
|
|
15520
|
-
truncated:
|
|
15521
|
-
rows:
|
|
16107
|
+
var outputSchema9 = z9.discriminatedUnion("success", [
|
|
16108
|
+
z9.object({
|
|
16109
|
+
success: z9.literal(true),
|
|
16110
|
+
rowCount: z9.number(),
|
|
16111
|
+
truncated: z9.boolean(),
|
|
16112
|
+
rows: z9.array(z9.record(z9.string(), z9.unknown()))
|
|
15522
16113
|
}),
|
|
15523
|
-
|
|
15524
|
-
success:
|
|
15525
|
-
error:
|
|
16114
|
+
z9.object({
|
|
16115
|
+
success: z9.literal(false),
|
|
16116
|
+
error: z9.string()
|
|
15526
16117
|
})
|
|
15527
16118
|
]);
|
|
15528
16119
|
var executeQueryTool7 = new ConnectorTool({
|
|
@@ -15530,8 +16121,8 @@ var executeQueryTool7 = new ConnectorTool({
|
|
|
15530
16121
|
description: `Execute SQL against AWS Athena. Returns up to ${MAX_ROWS7} rows.
|
|
15531
16122
|
Use for: schema exploration (SHOW DATABASES/TABLES, DESCRIBE TABLE), data sampling, analytical queries on S3 data.
|
|
15532
16123
|
Avoid loading large amounts of data; always include LIMIT in queries.`,
|
|
15533
|
-
inputSchema:
|
|
15534
|
-
outputSchema:
|
|
16124
|
+
inputSchema: inputSchema9,
|
|
16125
|
+
outputSchema: outputSchema9,
|
|
15535
16126
|
async execute({ connectionId, sql }, connections) {
|
|
15536
16127
|
const connection = connections.find((c) => c.id === connectionId);
|
|
15537
16128
|
if (!connection) {
|
|
@@ -15550,8 +16141,8 @@ Avoid loading large amounts of data; always include LIMIT in queries.`,
|
|
|
15550
16141
|
GetQueryExecutionCommand,
|
|
15551
16142
|
GetQueryResultsCommand
|
|
15552
16143
|
} = await import("@aws-sdk/client-athena");
|
|
15553
|
-
const workgroup =
|
|
15554
|
-
const outputLocation =
|
|
16144
|
+
const workgroup = parameters8.workgroup.tryGetValue(connection);
|
|
16145
|
+
const outputLocation = parameters8.outputLocation.tryGetValue(connection);
|
|
15555
16146
|
if (!workgroup && !outputLocation) {
|
|
15556
16147
|
return {
|
|
15557
16148
|
success: false,
|
|
@@ -15559,10 +16150,10 @@ Avoid loading large amounts of data; always include LIMIT in queries.`,
|
|
|
15559
16150
|
};
|
|
15560
16151
|
}
|
|
15561
16152
|
const client = new AthenaClient({
|
|
15562
|
-
region:
|
|
16153
|
+
region: parameters8.awsRegion.getValue(connection),
|
|
15563
16154
|
credentials: {
|
|
15564
|
-
accessKeyId:
|
|
15565
|
-
secretAccessKey:
|
|
16155
|
+
accessKeyId: parameters8.awsAccessKeyId.getValue(connection),
|
|
16156
|
+
secretAccessKey: parameters8.awsSecretAccessKey.getValue(connection)
|
|
15566
16157
|
}
|
|
15567
16158
|
});
|
|
15568
16159
|
const startParams = { QueryString: sql };
|
|
@@ -15624,8 +16215,7 @@ var awsAthenaConnector = new ConnectorPlugin({
|
|
|
15624
16215
|
name: "AWS Athena",
|
|
15625
16216
|
description: "Connect to AWS Athena for serverless SQL queries on S3 data.",
|
|
15626
16217
|
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/5x0vIHtUHfJJMZUv4RFOYZ/5059bac389f0169542f39cdb4b387d2c/Athena.svg",
|
|
15627
|
-
|
|
15628
|
-
parameters: parameters7,
|
|
16218
|
+
parameters: parameters8,
|
|
15629
16219
|
releaseFlag: { dev1: true, dev2: true, prod: true },
|
|
15630
16220
|
systemPrompt: `## AWS Athena SQL Notes
|
|
15631
16221
|
- Uses Presto/Trino based SQL syntax
|
|
@@ -15636,6 +16226,62 @@ var awsAthenaConnector = new ConnectorPlugin({
|
|
|
15636
16226
|
- Always include LIMIT in queries
|
|
15637
16227
|
- Query execution is asynchronous and results may take time to retrieve`,
|
|
15638
16228
|
tools: tools7,
|
|
16229
|
+
async checkConnection(params, _config) {
|
|
16230
|
+
try {
|
|
16231
|
+
const {
|
|
16232
|
+
AthenaClient,
|
|
16233
|
+
StartQueryExecutionCommand,
|
|
16234
|
+
GetQueryExecutionCommand
|
|
16235
|
+
} = await import("@aws-sdk/client-athena");
|
|
16236
|
+
const workgroup = params[parameters8.workgroup.slug];
|
|
16237
|
+
const outputLocation = params[parameters8.outputLocation.slug];
|
|
16238
|
+
if (!workgroup && !outputLocation) {
|
|
16239
|
+
return {
|
|
16240
|
+
success: false,
|
|
16241
|
+
error: "Either workgroup or output-location is required"
|
|
16242
|
+
};
|
|
16243
|
+
}
|
|
16244
|
+
const client = new AthenaClient({
|
|
16245
|
+
region: params[parameters8.awsRegion.slug],
|
|
16246
|
+
credentials: {
|
|
16247
|
+
accessKeyId: params[parameters8.awsAccessKeyId.slug],
|
|
16248
|
+
secretAccessKey: params[parameters8.awsSecretAccessKey.slug]
|
|
16249
|
+
}
|
|
16250
|
+
});
|
|
16251
|
+
const startParams = { QueryString: "SELECT 1" };
|
|
16252
|
+
if (workgroup) startParams.WorkGroup = workgroup;
|
|
16253
|
+
if (outputLocation) {
|
|
16254
|
+
startParams.ResultConfiguration = { OutputLocation: outputLocation };
|
|
16255
|
+
}
|
|
16256
|
+
const { QueryExecutionId } = await client.send(
|
|
16257
|
+
new StartQueryExecutionCommand(startParams)
|
|
16258
|
+
);
|
|
16259
|
+
const startTime = Date.now();
|
|
16260
|
+
while (true) {
|
|
16261
|
+
const exec = await client.send(
|
|
16262
|
+
new GetQueryExecutionCommand({ QueryExecutionId })
|
|
16263
|
+
);
|
|
16264
|
+
const state = exec.QueryExecution?.Status?.State;
|
|
16265
|
+
if (state === "SUCCEEDED") break;
|
|
16266
|
+
if (state === "FAILED" || state === "CANCELLED") {
|
|
16267
|
+
return {
|
|
16268
|
+
success: false,
|
|
16269
|
+
error: exec.QueryExecution?.Status?.StateChangeReason || `Query ${state}`
|
|
16270
|
+
};
|
|
16271
|
+
}
|
|
16272
|
+
if (Date.now() - startTime > 12e4) {
|
|
16273
|
+
return { success: false, error: "Query timed out after 120 seconds" };
|
|
16274
|
+
}
|
|
16275
|
+
await new Promise((r) => setTimeout(r, 1e3));
|
|
16276
|
+
}
|
|
16277
|
+
return { success: true };
|
|
16278
|
+
} catch (error) {
|
|
16279
|
+
return {
|
|
16280
|
+
success: false,
|
|
16281
|
+
error: error instanceof Error ? error.message : String(error)
|
|
16282
|
+
};
|
|
16283
|
+
}
|
|
16284
|
+
},
|
|
15639
16285
|
async query(params, sql, namedParams) {
|
|
15640
16286
|
const {
|
|
15641
16287
|
AthenaClient,
|
|
@@ -15644,16 +16290,16 @@ var awsAthenaConnector = new ConnectorPlugin({
|
|
|
15644
16290
|
GetQueryResultsCommand
|
|
15645
16291
|
} = await import("@aws-sdk/client-athena");
|
|
15646
16292
|
const resolvedSql = replaceLiteralParams(sql, namedParams);
|
|
15647
|
-
const workgroup = params[
|
|
15648
|
-
const outputLocation = params[
|
|
16293
|
+
const workgroup = params[parameters8.workgroup.slug];
|
|
16294
|
+
const outputLocation = params[parameters8.outputLocation.slug];
|
|
15649
16295
|
if (!workgroup && !outputLocation) {
|
|
15650
16296
|
throw new Error("Either workgroup or output-location is required");
|
|
15651
16297
|
}
|
|
15652
16298
|
const client = new AthenaClient({
|
|
15653
|
-
region: params[
|
|
16299
|
+
region: params[parameters8.awsRegion.slug],
|
|
15654
16300
|
credentials: {
|
|
15655
|
-
accessKeyId: params[
|
|
15656
|
-
secretAccessKey: params[
|
|
16301
|
+
accessKeyId: params[parameters8.awsAccessKeyId.slug],
|
|
16302
|
+
secretAccessKey: params[parameters8.awsSecretAccessKey.slug]
|
|
15657
16303
|
}
|
|
15658
16304
|
});
|
|
15659
16305
|
const startParams = { QueryString: resolvedSql };
|
|
@@ -15696,7 +16342,7 @@ var awsAthenaConnector = new ConnectorPlugin({
|
|
|
15696
16342
|
return { rows };
|
|
15697
16343
|
}
|
|
15698
16344
|
});
|
|
15699
|
-
var
|
|
16345
|
+
var parameters9 = {
|
|
15700
16346
|
awsAccessKeyId: new ParameterDefinition({
|
|
15701
16347
|
slug: "aws-access-key-id",
|
|
15702
16348
|
name: "AWS Access Key ID",
|
|
@@ -15754,7 +16400,7 @@ var parameters8 = {
|
|
|
15754
16400
|
secretArn: new ParameterDefinition({
|
|
15755
16401
|
slug: "secret-arn",
|
|
15756
16402
|
name: "Secrets Manager ARN",
|
|
15757
|
-
description: "The ARN of the secret in AWS Secrets Manager for database credentials.",
|
|
16403
|
+
description: "The ARN of the secret in AWS Secrets Manager for database credentials. Optional for both Provisioned Cluster and Serverless.",
|
|
15758
16404
|
envVarBaseKey: "REDSHIFT_SECRET_ARN",
|
|
15759
16405
|
type: "text",
|
|
15760
16406
|
secret: true,
|
|
@@ -15763,7 +16409,7 @@ var parameters8 = {
|
|
|
15763
16409
|
dbUser: new ParameterDefinition({
|
|
15764
16410
|
slug: "db-user",
|
|
15765
16411
|
name: "Database User",
|
|
15766
|
-
description: "The database user for IAM authentication.",
|
|
16412
|
+
description: "The database user for IAM authentication. Required for Provisioned Cluster if secret-arn is not set.",
|
|
15767
16413
|
envVarBaseKey: "REDSHIFT_DB_USER",
|
|
15768
16414
|
type: "text",
|
|
15769
16415
|
secret: false,
|
|
@@ -15773,25 +16419,25 @@ var parameters8 = {
|
|
|
15773
16419
|
var MAX_ROWS8 = 500;
|
|
15774
16420
|
var POLL_INTERVAL_MS2 = 1e3;
|
|
15775
16421
|
var POLL_TIMEOUT_MS2 = 12e4;
|
|
15776
|
-
var
|
|
15777
|
-
toolUseIntent:
|
|
16422
|
+
var inputSchema10 = z10.object({
|
|
16423
|
+
toolUseIntent: z10.string().optional().describe(
|
|
15778
16424
|
"Brief description of what you intend to accomplish with this tool call"
|
|
15779
16425
|
),
|
|
15780
|
-
connectionId:
|
|
15781
|
-
sql:
|
|
16426
|
+
connectionId: z10.string().describe("ID of the Redshift connection to use"),
|
|
16427
|
+
sql: z10.string().describe(
|
|
15782
16428
|
"SQL query to execute against Amazon Redshift."
|
|
15783
16429
|
)
|
|
15784
16430
|
});
|
|
15785
|
-
var
|
|
15786
|
-
|
|
15787
|
-
success:
|
|
15788
|
-
rowCount:
|
|
15789
|
-
truncated:
|
|
15790
|
-
rows:
|
|
16431
|
+
var outputSchema10 = z10.discriminatedUnion("success", [
|
|
16432
|
+
z10.object({
|
|
16433
|
+
success: z10.literal(true),
|
|
16434
|
+
rowCount: z10.number(),
|
|
16435
|
+
truncated: z10.boolean(),
|
|
16436
|
+
rows: z10.array(z10.record(z10.string(), z10.unknown()))
|
|
15791
16437
|
}),
|
|
15792
|
-
|
|
15793
|
-
success:
|
|
15794
|
-
error:
|
|
16438
|
+
z10.object({
|
|
16439
|
+
success: z10.literal(false),
|
|
16440
|
+
error: z10.string()
|
|
15795
16441
|
})
|
|
15796
16442
|
]);
|
|
15797
16443
|
var executeQueryTool8 = new ConnectorTool({
|
|
@@ -15799,8 +16445,8 @@ var executeQueryTool8 = new ConnectorTool({
|
|
|
15799
16445
|
description: `Execute SQL against Amazon Redshift. Returns up to ${MAX_ROWS8} rows.
|
|
15800
16446
|
Use for: schema exploration, data sampling, analytical queries.
|
|
15801
16447
|
Avoid loading large amounts of data; always include LIMIT in queries.`,
|
|
15802
|
-
inputSchema:
|
|
15803
|
-
outputSchema:
|
|
16448
|
+
inputSchema: inputSchema10,
|
|
16449
|
+
outputSchema: outputSchema10,
|
|
15804
16450
|
async execute({ connectionId, sql }, connections) {
|
|
15805
16451
|
const connection = connections.find((c) => c.id === connectionId);
|
|
15806
16452
|
if (!connection) {
|
|
@@ -15819,14 +16465,14 @@ Avoid loading large amounts of data; always include LIMIT in queries.`,
|
|
|
15819
16465
|
DescribeStatementCommand,
|
|
15820
16466
|
GetStatementResultCommand
|
|
15821
16467
|
} = await import("@aws-sdk/client-redshift-data");
|
|
15822
|
-
const awsAccessKeyId =
|
|
15823
|
-
const awsSecretAccessKey =
|
|
15824
|
-
const awsRegion =
|
|
15825
|
-
const database =
|
|
15826
|
-
const clusterIdentifier =
|
|
15827
|
-
const workgroupName =
|
|
15828
|
-
const secretArn =
|
|
15829
|
-
const dbUser =
|
|
16468
|
+
const awsAccessKeyId = parameters9.awsAccessKeyId.getValue(connection);
|
|
16469
|
+
const awsSecretAccessKey = parameters9.awsSecretAccessKey.getValue(connection);
|
|
16470
|
+
const awsRegion = parameters9.awsRegion.getValue(connection);
|
|
16471
|
+
const database = parameters9.database.getValue(connection);
|
|
16472
|
+
const clusterIdentifier = parameters9.clusterIdentifier.tryGetValue(connection);
|
|
16473
|
+
const workgroupName = parameters9.workgroupName.tryGetValue(connection);
|
|
16474
|
+
const secretArn = parameters9.secretArn.tryGetValue(connection);
|
|
16475
|
+
const dbUser = parameters9.dbUser.tryGetValue(connection);
|
|
15830
16476
|
if (!clusterIdentifier && !workgroupName) {
|
|
15831
16477
|
return {
|
|
15832
16478
|
success: false,
|
|
@@ -15895,8 +16541,7 @@ var redshiftConnector = new ConnectorPlugin({
|
|
|
15895
16541
|
name: "Redshift",
|
|
15896
16542
|
description: "Connect to Amazon Redshift for data warehouse analytics.",
|
|
15897
16543
|
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/AEwW2psmrnZ7htTVsgA9t/a637e31707c5d760be73ce1d8ec75580/aws-redshift-logo.svg",
|
|
15898
|
-
|
|
15899
|
-
parameters: parameters8,
|
|
16544
|
+
parameters: parameters9,
|
|
15900
16545
|
releaseFlag: { dev1: true, dev2: true, prod: true },
|
|
15901
16546
|
systemPrompt: `## Redshift SQL Notes
|
|
15902
16547
|
- Uses PostgreSQL based SQL syntax
|
|
@@ -15907,6 +16552,65 @@ var redshiftConnector = new ConnectorPlugin({
|
|
|
15907
16552
|
- Always include LIMIT in queries
|
|
15908
16553
|
- Query execution is asynchronous and results may take time to retrieve`,
|
|
15909
16554
|
tools: tools8,
|
|
16555
|
+
async checkConnection(params, _config) {
|
|
16556
|
+
try {
|
|
16557
|
+
const {
|
|
16558
|
+
RedshiftDataClient,
|
|
16559
|
+
ExecuteStatementCommand,
|
|
16560
|
+
DescribeStatementCommand
|
|
16561
|
+
} = await import("@aws-sdk/client-redshift-data");
|
|
16562
|
+
const clusterIdentifier = params[parameters9.clusterIdentifier.slug];
|
|
16563
|
+
const workgroupName = params[parameters9.workgroupName.slug];
|
|
16564
|
+
const secretArn = params[parameters9.secretArn.slug];
|
|
16565
|
+
const dbUser = params[parameters9.dbUser.slug];
|
|
16566
|
+
if (!clusterIdentifier && !workgroupName) {
|
|
16567
|
+
return {
|
|
16568
|
+
success: false,
|
|
16569
|
+
error: "Either cluster-identifier or workgroup-name is required"
|
|
16570
|
+
};
|
|
16571
|
+
}
|
|
16572
|
+
const client = new RedshiftDataClient({
|
|
16573
|
+
region: params[parameters9.awsRegion.slug],
|
|
16574
|
+
credentials: {
|
|
16575
|
+
accessKeyId: params[parameters9.awsAccessKeyId.slug],
|
|
16576
|
+
secretAccessKey: params[parameters9.awsSecretAccessKey.slug]
|
|
16577
|
+
}
|
|
16578
|
+
});
|
|
16579
|
+
const { Id: statementId } = await client.send(
|
|
16580
|
+
new ExecuteStatementCommand({
|
|
16581
|
+
Database: params[parameters9.database.slug],
|
|
16582
|
+
Sql: "SELECT 1",
|
|
16583
|
+
...clusterIdentifier && { ClusterIdentifier: clusterIdentifier },
|
|
16584
|
+
...workgroupName && { WorkgroupName: workgroupName },
|
|
16585
|
+
...secretArn && { SecretArn: secretArn },
|
|
16586
|
+
...dbUser && { DbUser: dbUser }
|
|
16587
|
+
})
|
|
16588
|
+
);
|
|
16589
|
+
const startTime = Date.now();
|
|
16590
|
+
while (true) {
|
|
16591
|
+
const desc = await client.send(
|
|
16592
|
+
new DescribeStatementCommand({ Id: statementId })
|
|
16593
|
+
);
|
|
16594
|
+
if (desc.Status === "FINISHED") break;
|
|
16595
|
+
if (desc.Status === "FAILED" || desc.Status === "ABORTED") {
|
|
16596
|
+
return {
|
|
16597
|
+
success: false,
|
|
16598
|
+
error: desc.Error || `Statement ${desc.Status}`
|
|
16599
|
+
};
|
|
16600
|
+
}
|
|
16601
|
+
if (Date.now() - startTime > 12e4) {
|
|
16602
|
+
return { success: false, error: "Query timed out after 120 seconds" };
|
|
16603
|
+
}
|
|
16604
|
+
await new Promise((r) => setTimeout(r, 1e3));
|
|
16605
|
+
}
|
|
16606
|
+
return { success: true };
|
|
16607
|
+
} catch (error) {
|
|
16608
|
+
return {
|
|
16609
|
+
success: false,
|
|
16610
|
+
error: error instanceof Error ? error.message : String(error)
|
|
16611
|
+
};
|
|
16612
|
+
}
|
|
16613
|
+
},
|
|
15910
16614
|
async query(params, sql, namedParams) {
|
|
15911
16615
|
const {
|
|
15912
16616
|
RedshiftDataClient,
|
|
@@ -15915,23 +16619,23 @@ var redshiftConnector = new ConnectorPlugin({
|
|
|
15915
16619
|
GetStatementResultCommand
|
|
15916
16620
|
} = await import("@aws-sdk/client-redshift-data");
|
|
15917
16621
|
const resolvedSql = replaceLiteralParams(sql, namedParams);
|
|
15918
|
-
const clusterIdentifier = params[
|
|
15919
|
-
const workgroupName = params[
|
|
15920
|
-
const secretArn = params[
|
|
15921
|
-
const dbUser = params[
|
|
16622
|
+
const clusterIdentifier = params[parameters9.clusterIdentifier.slug];
|
|
16623
|
+
const workgroupName = params[parameters9.workgroupName.slug];
|
|
16624
|
+
const secretArn = params[parameters9.secretArn.slug];
|
|
16625
|
+
const dbUser = params[parameters9.dbUser.slug];
|
|
15922
16626
|
if (!clusterIdentifier && !workgroupName) {
|
|
15923
16627
|
throw new Error("Either cluster-identifier or workgroup-name is required");
|
|
15924
16628
|
}
|
|
15925
16629
|
const client = new RedshiftDataClient({
|
|
15926
|
-
region: params[
|
|
16630
|
+
region: params[parameters9.awsRegion.slug],
|
|
15927
16631
|
credentials: {
|
|
15928
|
-
accessKeyId: params[
|
|
15929
|
-
secretAccessKey: params[
|
|
16632
|
+
accessKeyId: params[parameters9.awsAccessKeyId.slug],
|
|
16633
|
+
secretAccessKey: params[parameters9.awsSecretAccessKey.slug]
|
|
15930
16634
|
}
|
|
15931
16635
|
});
|
|
15932
16636
|
const { Id: statementId } = await client.send(
|
|
15933
16637
|
new ExecuteStatementCommand({
|
|
15934
|
-
Database: params[
|
|
16638
|
+
Database: params[parameters9.database.slug],
|
|
15935
16639
|
Sql: resolvedSql,
|
|
15936
16640
|
...clusterIdentifier && { ClusterIdentifier: clusterIdentifier },
|
|
15937
16641
|
...workgroupName && { WorkgroupName: workgroupName },
|
|
@@ -15967,7 +16671,7 @@ var redshiftConnector = new ConnectorPlugin({
|
|
|
15967
16671
|
return { rows };
|
|
15968
16672
|
}
|
|
15969
16673
|
});
|
|
15970
|
-
var
|
|
16674
|
+
var parameters10 = {
|
|
15971
16675
|
host: new ParameterDefinition({
|
|
15972
16676
|
slug: "host",
|
|
15973
16677
|
name: "Databricks Workspace Host",
|
|
@@ -15997,23 +16701,23 @@ var parameters9 = {
|
|
|
15997
16701
|
})
|
|
15998
16702
|
};
|
|
15999
16703
|
var MAX_ROWS9 = 500;
|
|
16000
|
-
var
|
|
16001
|
-
toolUseIntent:
|
|
16704
|
+
var inputSchema11 = z11.object({
|
|
16705
|
+
toolUseIntent: z11.string().optional().describe(
|
|
16002
16706
|
"Brief description of what you intend to accomplish with this tool call"
|
|
16003
16707
|
),
|
|
16004
|
-
connectionId:
|
|
16005
|
-
sql:
|
|
16708
|
+
connectionId: z11.string().describe("ID of the Databricks connection to use"),
|
|
16709
|
+
sql: z11.string().describe("Databricks SQL query (Spark SQL based)")
|
|
16006
16710
|
});
|
|
16007
|
-
var
|
|
16008
|
-
|
|
16009
|
-
success:
|
|
16010
|
-
rowCount:
|
|
16011
|
-
truncated:
|
|
16012
|
-
rows:
|
|
16711
|
+
var outputSchema11 = z11.discriminatedUnion("success", [
|
|
16712
|
+
z11.object({
|
|
16713
|
+
success: z11.literal(true),
|
|
16714
|
+
rowCount: z11.number(),
|
|
16715
|
+
truncated: z11.boolean(),
|
|
16716
|
+
rows: z11.array(z11.record(z11.string(), z11.unknown()))
|
|
16013
16717
|
}),
|
|
16014
|
-
|
|
16015
|
-
success:
|
|
16016
|
-
error:
|
|
16718
|
+
z11.object({
|
|
16719
|
+
success: z11.literal(false),
|
|
16720
|
+
error: z11.string()
|
|
16017
16721
|
})
|
|
16018
16722
|
]);
|
|
16019
16723
|
var executeQueryTool9 = new ConnectorTool({
|
|
@@ -16021,8 +16725,8 @@ var executeQueryTool9 = new ConnectorTool({
|
|
|
16021
16725
|
description: `Execute SQL against Databricks. Returns up to ${MAX_ROWS9} rows.
|
|
16022
16726
|
Use for: schema exploration (SHOW CATALOGS/DATABASES/TABLES, DESCRIBE TABLE), data sampling, analytical queries.
|
|
16023
16727
|
Avoid loading large amounts of data; always include LIMIT in queries.`,
|
|
16024
|
-
inputSchema:
|
|
16025
|
-
outputSchema:
|
|
16728
|
+
inputSchema: inputSchema11,
|
|
16729
|
+
outputSchema: outputSchema11,
|
|
16026
16730
|
async execute({ connectionId, sql }, connections) {
|
|
16027
16731
|
const connection = connections.find((c) => c.id === connectionId);
|
|
16028
16732
|
if (!connection) {
|
|
@@ -16036,9 +16740,9 @@ Avoid loading large amounts of data; always include LIMIT in queries.`,
|
|
|
16036
16740
|
);
|
|
16037
16741
|
try {
|
|
16038
16742
|
const { DBSQLClient } = await import("@databricks/sql");
|
|
16039
|
-
const host =
|
|
16040
|
-
const token =
|
|
16041
|
-
const httpPath =
|
|
16743
|
+
const host = parameters10.host.getValue(connection);
|
|
16744
|
+
const token = parameters10.token.getValue(connection);
|
|
16745
|
+
const httpPath = parameters10.httpPath.getValue(connection);
|
|
16042
16746
|
const client = new DBSQLClient();
|
|
16043
16747
|
await client.connect({ host, path: httpPath, token });
|
|
16044
16748
|
let session;
|
|
@@ -16077,8 +16781,7 @@ var databricksConnector = new ConnectorPlugin({
|
|
|
16077
16781
|
name: "Databricks",
|
|
16078
16782
|
description: "Connect to Databricks for data lakehouse and SQL analytics.",
|
|
16079
16783
|
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/6QgcrfpQOKg18P7DdgKerd/af55bf0d871339049824dd167b97a29f/databricks-icon.svg",
|
|
16080
|
-
|
|
16081
|
-
parameters: parameters9,
|
|
16784
|
+
parameters: parameters10,
|
|
16082
16785
|
releaseFlag: { dev1: true, dev2: true, prod: true },
|
|
16083
16786
|
systemPrompt: `## Databricks SQL Notes
|
|
16084
16787
|
- Uses Spark SQL / Databricks SQL syntax
|
|
@@ -16089,14 +16792,42 @@ var databricksConnector = new ConnectorPlugin({
|
|
|
16089
16792
|
- List columns: \`DESCRIBE TABLE table_name\`
|
|
16090
16793
|
- Always include LIMIT in queries`,
|
|
16091
16794
|
tools: tools9,
|
|
16795
|
+
async checkConnection(params, _config) {
|
|
16796
|
+
const { DBSQLClient } = await import("@databricks/sql");
|
|
16797
|
+
const client = new DBSQLClient();
|
|
16798
|
+
await client.connect({
|
|
16799
|
+
host: params[parameters10.host.slug],
|
|
16800
|
+
path: params[parameters10.httpPath.slug],
|
|
16801
|
+
token: params[parameters10.token.slug]
|
|
16802
|
+
});
|
|
16803
|
+
let session;
|
|
16804
|
+
let operation;
|
|
16805
|
+
try {
|
|
16806
|
+
session = await client.openSession();
|
|
16807
|
+
operation = await session.executeStatement("SELECT 1", {
|
|
16808
|
+
runAsync: true
|
|
16809
|
+
});
|
|
16810
|
+
await operation.fetchAll();
|
|
16811
|
+
return { success: true };
|
|
16812
|
+
} catch (e) {
|
|
16813
|
+
return { success: false, error: e instanceof Error ? e.message : String(e) };
|
|
16814
|
+
} finally {
|
|
16815
|
+
if (operation) await operation.close().catch(() => {
|
|
16816
|
+
});
|
|
16817
|
+
if (session) await session.close().catch(() => {
|
|
16818
|
+
});
|
|
16819
|
+
await client.close().catch(() => {
|
|
16820
|
+
});
|
|
16821
|
+
}
|
|
16822
|
+
},
|
|
16092
16823
|
async query(params, sql, namedParams) {
|
|
16093
16824
|
const { DBSQLClient } = await import("@databricks/sql");
|
|
16094
16825
|
const resolvedSql = replaceLiteralParams(sql, namedParams);
|
|
16095
16826
|
const client = new DBSQLClient();
|
|
16096
16827
|
await client.connect({
|
|
16097
|
-
host: params[
|
|
16098
|
-
path: params[
|
|
16099
|
-
token: params[
|
|
16828
|
+
host: params[parameters10.host.slug],
|
|
16829
|
+
path: params[parameters10.httpPath.slug],
|
|
16830
|
+
token: params[parameters10.token.slug]
|
|
16100
16831
|
});
|
|
16101
16832
|
let session;
|
|
16102
16833
|
let operation;
|
|
@@ -16117,7 +16848,7 @@ var databricksConnector = new ConnectorPlugin({
|
|
|
16117
16848
|
}
|
|
16118
16849
|
}
|
|
16119
16850
|
});
|
|
16120
|
-
var
|
|
16851
|
+
var parameters11 = {
|
|
16121
16852
|
baseId: new ParameterDefinition({
|
|
16122
16853
|
slug: "base-id",
|
|
16123
16854
|
name: "Airtable Base ID",
|
|
@@ -16138,23 +16869,23 @@ var parameters10 = {
|
|
|
16138
16869
|
})
|
|
16139
16870
|
};
|
|
16140
16871
|
var BASE_URL = "https://api.airtable.com/v0/";
|
|
16141
|
-
var
|
|
16142
|
-
var
|
|
16143
|
-
toolUseIntent:
|
|
16144
|
-
connectionId:
|
|
16145
|
-
method:
|
|
16146
|
-
path:
|
|
16147
|
-
body:
|
|
16872
|
+
var REQUEST_TIMEOUT_MS3 = 6e4;
|
|
16873
|
+
var inputSchema12 = z12.object({
|
|
16874
|
+
toolUseIntent: z12.string().optional().describe("Brief description of what you intend to accomplish with this tool call"),
|
|
16875
|
+
connectionId: z12.string().describe("ID of the Airtable connection to use"),
|
|
16876
|
+
method: z12.enum(["GET", "POST", "PATCH", "DELETE"]).describe("HTTP method"),
|
|
16877
|
+
path: z12.string().describe("API path (e.g., '{baseId}/{tableIdOrName}', 'meta/bases/{baseId}/tables'). {baseId} is automatically replaced."),
|
|
16878
|
+
body: z12.record(z12.string(), z12.unknown()).optional().describe("Request body (JSON)")
|
|
16148
16879
|
});
|
|
16149
|
-
var
|
|
16150
|
-
|
|
16151
|
-
success:
|
|
16152
|
-
status:
|
|
16153
|
-
data:
|
|
16880
|
+
var outputSchema12 = z12.discriminatedUnion("success", [
|
|
16881
|
+
z12.object({
|
|
16882
|
+
success: z12.literal(true),
|
|
16883
|
+
status: z12.number(),
|
|
16884
|
+
data: z12.record(z12.string(), z12.unknown())
|
|
16154
16885
|
}),
|
|
16155
|
-
|
|
16156
|
-
success:
|
|
16157
|
-
error:
|
|
16886
|
+
z12.object({
|
|
16887
|
+
success: z12.literal(false),
|
|
16888
|
+
error: z12.string()
|
|
16158
16889
|
})
|
|
16159
16890
|
]);
|
|
16160
16891
|
var requestTool = new ConnectorTool({
|
|
@@ -16162,8 +16893,8 @@ var requestTool = new ConnectorTool({
|
|
|
16162
16893
|
description: `Send authenticated requests to the Airtable API.
|
|
16163
16894
|
Authentication is handled automatically using the API Key.
|
|
16164
16895
|
{baseId} in the path is automatically replaced with the connection's base-id.`,
|
|
16165
|
-
inputSchema:
|
|
16166
|
-
outputSchema:
|
|
16896
|
+
inputSchema: inputSchema12,
|
|
16897
|
+
outputSchema: outputSchema12,
|
|
16167
16898
|
async execute({ connectionId, method, path: path5, body }, connections) {
|
|
16168
16899
|
const connection = connections.find((c) => c.id === connectionId);
|
|
16169
16900
|
if (!connection) {
|
|
@@ -16171,12 +16902,12 @@ Authentication is handled automatically using the API Key.
|
|
|
16171
16902
|
}
|
|
16172
16903
|
console.log(`[connector-request] airtable/${connection.name}: ${method} ${path5}`);
|
|
16173
16904
|
try {
|
|
16174
|
-
const apiKey =
|
|
16175
|
-
const baseId =
|
|
16905
|
+
const apiKey = parameters11.apiKey.getValue(connection);
|
|
16906
|
+
const baseId = parameters11.baseId.getValue(connection);
|
|
16176
16907
|
const resolvedPath = path5.replace(/\{baseId\}/g, baseId);
|
|
16177
16908
|
const url = `${BASE_URL}${resolvedPath}`;
|
|
16178
16909
|
const controller = new AbortController();
|
|
16179
|
-
const timeout = setTimeout(() => controller.abort(),
|
|
16910
|
+
const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS3);
|
|
16180
16911
|
try {
|
|
16181
16912
|
const response = await fetch(url, {
|
|
16182
16913
|
method,
|
|
@@ -16212,8 +16943,7 @@ var airtableConnector = new ConnectorPlugin({
|
|
|
16212
16943
|
name: "Airtable",
|
|
16213
16944
|
description: "Connect to Airtable for spreadsheet-database hybrid data management.",
|
|
16214
16945
|
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/19JUphfOZjyjTK6Zg4NGCf/8c56227b088cada52d3a2d9385a3be97/airtable.svg",
|
|
16215
|
-
|
|
16216
|
-
parameters: parameters10,
|
|
16946
|
+
parameters: parameters11,
|
|
16217
16947
|
releaseFlag: { dev1: true, dev2: true, prod: true },
|
|
16218
16948
|
systemPrompt: `## Airtable API
|
|
16219
16949
|
- Call the Airtable REST API using the authenticated request tool
|
|
@@ -16235,7 +16965,7 @@ var airtableConnector = new ConnectorPlugin({
|
|
|
16235
16965
|
- If the response contains an offset, fetch the next page by appending ?offset={offset} to the next request`,
|
|
16236
16966
|
tools: tools10
|
|
16237
16967
|
});
|
|
16238
|
-
var
|
|
16968
|
+
var parameters12 = {
|
|
16239
16969
|
serviceAccountKeyJsonBase64: new ParameterDefinition({
|
|
16240
16970
|
slug: "service-account-key-json-base64",
|
|
16241
16971
|
name: "Google Cloud Service Account JSON",
|
|
@@ -16256,23 +16986,23 @@ var parameters11 = {
|
|
|
16256
16986
|
})
|
|
16257
16987
|
};
|
|
16258
16988
|
var BASE_URL2 = "https://analyticsdata.googleapis.com/v1beta/";
|
|
16259
|
-
var
|
|
16260
|
-
var
|
|
16261
|
-
toolUseIntent:
|
|
16262
|
-
connectionId:
|
|
16263
|
-
method:
|
|
16264
|
-
path:
|
|
16265
|
-
body:
|
|
16989
|
+
var REQUEST_TIMEOUT_MS4 = 6e4;
|
|
16990
|
+
var inputSchema13 = z13.object({
|
|
16991
|
+
toolUseIntent: z13.string().optional().describe("Brief description of what you intend to accomplish with this tool call"),
|
|
16992
|
+
connectionId: z13.string().describe("ID of the Google Analytics connection to use"),
|
|
16993
|
+
method: z13.enum(["GET", "POST"]).describe("HTTP method"),
|
|
16994
|
+
path: z13.string().describe("API path (e.g., 'properties/{propertyId}:runReport'). {propertyId} is automatically replaced."),
|
|
16995
|
+
body: z13.record(z13.string(), z13.unknown()).optional().describe("POST request body (JSON)")
|
|
16266
16996
|
});
|
|
16267
|
-
var
|
|
16268
|
-
|
|
16269
|
-
success:
|
|
16270
|
-
status:
|
|
16271
|
-
data:
|
|
16997
|
+
var outputSchema13 = z13.discriminatedUnion("success", [
|
|
16998
|
+
z13.object({
|
|
16999
|
+
success: z13.literal(true),
|
|
17000
|
+
status: z13.number(),
|
|
17001
|
+
data: z13.record(z13.string(), z13.unknown())
|
|
16272
17002
|
}),
|
|
16273
|
-
|
|
16274
|
-
success:
|
|
16275
|
-
error:
|
|
17003
|
+
z13.object({
|
|
17004
|
+
success: z13.literal(false),
|
|
17005
|
+
error: z13.string()
|
|
16276
17006
|
})
|
|
16277
17007
|
]);
|
|
16278
17008
|
var requestTool2 = new ConnectorTool({
|
|
@@ -16280,8 +17010,8 @@ var requestTool2 = new ConnectorTool({
|
|
|
16280
17010
|
description: `Send authenticated requests to the Google Analytics Data API.
|
|
16281
17011
|
Authentication is handled automatically using a service account.
|
|
16282
17012
|
{propertyId} in the path is automatically replaced with the connection's property-id.`,
|
|
16283
|
-
inputSchema:
|
|
16284
|
-
outputSchema:
|
|
17013
|
+
inputSchema: inputSchema13,
|
|
17014
|
+
outputSchema: outputSchema13,
|
|
16285
17015
|
async execute({ connectionId, method, path: path5, body }, connections) {
|
|
16286
17016
|
const connection = connections.find((c) => c.id === connectionId);
|
|
16287
17017
|
if (!connection) {
|
|
@@ -16290,8 +17020,8 @@ Authentication is handled automatically using a service account.
|
|
|
16290
17020
|
console.log(`[connector-request] google-analytics/${connection.name}: ${method} ${path5}`);
|
|
16291
17021
|
try {
|
|
16292
17022
|
const { GoogleAuth } = await Promise.resolve().then(() => __toESM(require_src6(), 1));
|
|
16293
|
-
const keyJsonBase64 =
|
|
16294
|
-
const propertyId =
|
|
17023
|
+
const keyJsonBase64 = parameters12.serviceAccountKeyJsonBase64.getValue(connection);
|
|
17024
|
+
const propertyId = parameters12.propertyId.getValue(connection);
|
|
16295
17025
|
const credentials = JSON.parse(
|
|
16296
17026
|
Buffer.from(keyJsonBase64, "base64").toString("utf-8")
|
|
16297
17027
|
);
|
|
@@ -16306,7 +17036,7 @@ Authentication is handled automatically using a service account.
|
|
|
16306
17036
|
const resolvedPath = path5.replace(/\{propertyId\}/g, propertyId);
|
|
16307
17037
|
const url = `${BASE_URL2}${resolvedPath}`;
|
|
16308
17038
|
const controller = new AbortController();
|
|
16309
|
-
const timeout = setTimeout(() => controller.abort(),
|
|
17039
|
+
const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS4);
|
|
16310
17040
|
try {
|
|
16311
17041
|
const response = await fetch(url, {
|
|
16312
17042
|
method,
|
|
@@ -16342,8 +17072,7 @@ var googleAnalyticsConnector = new ConnectorPlugin({
|
|
|
16342
17072
|
name: "Google Analytics",
|
|
16343
17073
|
description: "Connect to Google Analytics for web analytics and reporting.",
|
|
16344
17074
|
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/7fs0ipzxuD9mACDzBATtxX/3c53ed90d15c96483e4f78cb29dab5e9/google-analytics.svg",
|
|
16345
|
-
|
|
16346
|
-
parameters: parameters11,
|
|
17075
|
+
parameters: parameters12,
|
|
16347
17076
|
releaseFlag: { dev1: true, dev2: true, prod: true },
|
|
16348
17077
|
systemPrompt: `## Google Analytics Data API
|
|
16349
17078
|
- Call the GA4 Data API using the authenticated request tool
|
|
@@ -16375,60 +17104,31 @@ averageSessionDuration, conversions, totalRevenue
|
|
|
16375
17104
|
- Relative: "today", "yesterday", "7daysAgo", "30daysAgo"`,
|
|
16376
17105
|
tools: tools11
|
|
16377
17106
|
});
|
|
16378
|
-
var
|
|
16379
|
-
|
|
16380
|
-
|
|
16381
|
-
|
|
16382
|
-
|
|
16383
|
-
|
|
16384
|
-
|
|
16385
|
-
secret: false,
|
|
16386
|
-
required: true
|
|
16387
|
-
}),
|
|
16388
|
-
username: new ParameterDefinition({
|
|
16389
|
-
slug: "username",
|
|
16390
|
-
name: "kintone Username",
|
|
16391
|
-
description: "The username (login name) for kintone authentication.",
|
|
16392
|
-
envVarBaseKey: "KINTONE_USERNAME",
|
|
16393
|
-
type: "text",
|
|
16394
|
-
secret: false,
|
|
16395
|
-
required: true
|
|
16396
|
-
}),
|
|
16397
|
-
password: new ParameterDefinition({
|
|
16398
|
-
slug: "password",
|
|
16399
|
-
name: "kintone Password",
|
|
16400
|
-
description: "The password for kintone authentication.",
|
|
16401
|
-
envVarBaseKey: "KINTONE_PASSWORD",
|
|
16402
|
-
type: "text",
|
|
16403
|
-
secret: true,
|
|
16404
|
-
required: true
|
|
16405
|
-
})
|
|
16406
|
-
};
|
|
16407
|
-
var REQUEST_TIMEOUT_MS4 = 6e4;
|
|
16408
|
-
var inputSchema12 = z12.object({
|
|
16409
|
-
toolUseIntent: z12.string().optional().describe("Brief description of what you intend to accomplish with this tool call"),
|
|
16410
|
-
connectionId: z12.string().describe("ID of the kintone connection to use"),
|
|
16411
|
-
method: z12.enum(["GET", "POST", "PUT", "DELETE"]).describe("HTTP method"),
|
|
16412
|
-
path: z12.string().describe("API path (e.g., 'apps.json', 'records.json?app=1&query=...')"),
|
|
16413
|
-
body: z12.record(z12.string(), z12.unknown()).optional().describe("Request body (JSON)")
|
|
17107
|
+
var REQUEST_TIMEOUT_MS5 = 6e4;
|
|
17108
|
+
var inputSchema14 = z14.object({
|
|
17109
|
+
toolUseIntent: z14.string().optional().describe("Brief description of what you intend to accomplish with this tool call"),
|
|
17110
|
+
connectionId: z14.string().describe("ID of the kintone connection to use"),
|
|
17111
|
+
method: z14.enum(["GET", "POST", "PUT", "DELETE"]).describe("HTTP method"),
|
|
17112
|
+
path: z14.string().describe("API path (e.g., 'apps.json', 'records.json?app=1&query=...')"),
|
|
17113
|
+
body: z14.record(z14.string(), z14.unknown()).optional().describe("Request body (JSON)")
|
|
16414
17114
|
});
|
|
16415
|
-
var
|
|
16416
|
-
|
|
16417
|
-
success:
|
|
16418
|
-
status:
|
|
16419
|
-
data:
|
|
17115
|
+
var outputSchema14 = z14.discriminatedUnion("success", [
|
|
17116
|
+
z14.object({
|
|
17117
|
+
success: z14.literal(true),
|
|
17118
|
+
status: z14.number(),
|
|
17119
|
+
data: z14.record(z14.string(), z14.unknown())
|
|
16420
17120
|
}),
|
|
16421
|
-
|
|
16422
|
-
success:
|
|
16423
|
-
error:
|
|
17121
|
+
z14.object({
|
|
17122
|
+
success: z14.literal(false),
|
|
17123
|
+
error: z14.string()
|
|
16424
17124
|
})
|
|
16425
17125
|
]);
|
|
16426
17126
|
var requestTool3 = new ConnectorTool({
|
|
16427
17127
|
name: "request",
|
|
16428
17128
|
description: `Send authenticated requests to the kintone REST API.
|
|
16429
17129
|
Authentication is handled automatically using username and password.`,
|
|
16430
|
-
inputSchema:
|
|
16431
|
-
outputSchema:
|
|
17130
|
+
inputSchema: inputSchema14,
|
|
17131
|
+
outputSchema: outputSchema14,
|
|
16432
17132
|
async execute({ connectionId, method, path: path5, body }, connections) {
|
|
16433
17133
|
const connection = connections.find((c) => c.id === connectionId);
|
|
16434
17134
|
if (!connection) {
|
|
@@ -16436,13 +17136,13 @@ Authentication is handled automatically using username and password.`,
|
|
|
16436
17136
|
}
|
|
16437
17137
|
console.log(`[connector-request] kintone/${connection.name}: ${method} ${path5}`);
|
|
16438
17138
|
try {
|
|
16439
|
-
const baseUrl =
|
|
16440
|
-
const username =
|
|
16441
|
-
const password =
|
|
17139
|
+
const baseUrl = parameters.baseUrl.getValue(connection);
|
|
17140
|
+
const username = parameters.username.getValue(connection);
|
|
17141
|
+
const password = parameters.password.getValue(connection);
|
|
16442
17142
|
const authToken = Buffer.from(`${username}:${password}`).toString("base64");
|
|
16443
17143
|
const url = `${baseUrl.replace(/\/+$/, "")}/k/v1/${path5}`;
|
|
16444
17144
|
const controller = new AbortController();
|
|
16445
|
-
const timeout = setTimeout(() => controller.abort(),
|
|
17145
|
+
const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS5);
|
|
16446
17146
|
try {
|
|
16447
17147
|
const response = await fetch(url, {
|
|
16448
17148
|
method,
|
|
@@ -16477,8 +17177,7 @@ var kintoneConnector = new ConnectorPlugin({
|
|
|
16477
17177
|
name: "kintone",
|
|
16478
17178
|
description: "Connect to kintone for business application data retrieval and analytics.",
|
|
16479
17179
|
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/76nPGMJFZkMFE3UQNo2JFy/e71dc5f5d5cec1306ce0e17aafbfd9f0/kintone.png",
|
|
16480
|
-
|
|
16481
|
-
parameters: parameters12,
|
|
17180
|
+
parameters,
|
|
16482
17181
|
releaseFlag: { dev1: true, dev2: true, prod: true },
|
|
16483
17182
|
systemPrompt: `## kintone REST API
|
|
16484
17183
|
- Call the kintone REST API using the authenticated request tool
|
|
@@ -16503,7 +17202,34 @@ var kintoneConnector = new ConnectorPlugin({
|
|
|
16503
17202
|
- Operators: and, or, not
|
|
16504
17203
|
- Sort: order by fieldName asc/desc
|
|
16505
17204
|
- Limit: limit 100 offset 0
|
|
16506
|
-
- String: like "partial match"
|
|
17205
|
+
- String: like "partial match"
|
|
17206
|
+
|
|
17207
|
+
## kintone SDK (TypeScript handler)
|
|
17208
|
+
Non-SQL connectors like kintone can also be used via the SDK in TypeScript handlers:
|
|
17209
|
+
|
|
17210
|
+
\`\`\`ts
|
|
17211
|
+
import { connection } from "@squadbase/vite-server/connectors/kintone";
|
|
17212
|
+
|
|
17213
|
+
const kintone = connection("<connectionId>");
|
|
17214
|
+
|
|
17215
|
+
// Authenticated fetch (returns standard Response)
|
|
17216
|
+
const res = await kintone.request("/k/v1/records.json?app=1&query=limit 10");
|
|
17217
|
+
const data = await res.json();
|
|
17218
|
+
|
|
17219
|
+
await kintone.request("/k/v1/record.json", {
|
|
17220
|
+
method: "POST",
|
|
17221
|
+
body: JSON.stringify({ app: 1, record: { title: { value: "Hello" } } }),
|
|
17222
|
+
});
|
|
17223
|
+
|
|
17224
|
+
// Convenience methods (uses @kintone/rest-api-client)
|
|
17225
|
+
const { records, totalCount } = await kintone.getRecords(1, {
|
|
17226
|
+
query: 'status = "Active"',
|
|
17227
|
+
fields: ["name", "email"],
|
|
17228
|
+
totalCount: true,
|
|
17229
|
+
});
|
|
17230
|
+
const { record } = await kintone.getRecord(1, 100);
|
|
17231
|
+
const { apps } = await kintone.listApps();
|
|
17232
|
+
\`\`\``,
|
|
16507
17233
|
tools: tools12
|
|
16508
17234
|
});
|
|
16509
17235
|
var parameters13 = {
|
|
@@ -16536,31 +17262,31 @@ var parameters13 = {
|
|
|
16536
17262
|
})
|
|
16537
17263
|
};
|
|
16538
17264
|
var BASE_URL3 = "https://www.wixapis.com/";
|
|
16539
|
-
var
|
|
16540
|
-
var
|
|
16541
|
-
toolUseIntent:
|
|
16542
|
-
connectionId:
|
|
16543
|
-
method:
|
|
16544
|
-
path:
|
|
16545
|
-
body:
|
|
17265
|
+
var REQUEST_TIMEOUT_MS6 = 6e4;
|
|
17266
|
+
var inputSchema15 = z15.object({
|
|
17267
|
+
toolUseIntent: z15.string().optional().describe("Brief description of what you intend to accomplish with this tool call"),
|
|
17268
|
+
connectionId: z15.string().describe("ID of the Wix Store connection to use"),
|
|
17269
|
+
method: z15.enum(["GET", "POST"]).describe("HTTP method"),
|
|
17270
|
+
path: z15.string().describe("API path (e.g., 'stores/v1/products/query', 'stores/v2/orders/query')"),
|
|
17271
|
+
body: z15.record(z15.string(), z15.unknown()).optional().describe("Request body (JSON)")
|
|
16546
17272
|
});
|
|
16547
|
-
var
|
|
16548
|
-
|
|
16549
|
-
success:
|
|
16550
|
-
status:
|
|
16551
|
-
data:
|
|
17273
|
+
var outputSchema15 = z15.discriminatedUnion("success", [
|
|
17274
|
+
z15.object({
|
|
17275
|
+
success: z15.literal(true),
|
|
17276
|
+
status: z15.number(),
|
|
17277
|
+
data: z15.record(z15.string(), z15.unknown())
|
|
16552
17278
|
}),
|
|
16553
|
-
|
|
16554
|
-
success:
|
|
16555
|
-
error:
|
|
17279
|
+
z15.object({
|
|
17280
|
+
success: z15.literal(false),
|
|
17281
|
+
error: z15.string()
|
|
16556
17282
|
})
|
|
16557
17283
|
]);
|
|
16558
17284
|
var requestTool4 = new ConnectorTool({
|
|
16559
17285
|
name: "request",
|
|
16560
17286
|
description: `Send authenticated requests to the Wix Store API.
|
|
16561
17287
|
Authentication is handled automatically using the API Key and Site ID.`,
|
|
16562
|
-
inputSchema:
|
|
16563
|
-
outputSchema:
|
|
17288
|
+
inputSchema: inputSchema15,
|
|
17289
|
+
outputSchema: outputSchema15,
|
|
16564
17290
|
async execute({ connectionId, method, path: path5, body }, connections) {
|
|
16565
17291
|
const connection = connections.find((c) => c.id === connectionId);
|
|
16566
17292
|
if (!connection) {
|
|
@@ -16572,7 +17298,7 @@ Authentication is handled automatically using the API Key and Site ID.`,
|
|
|
16572
17298
|
const siteId = parameters13.siteId.getValue(connection);
|
|
16573
17299
|
const url = `${BASE_URL3}${path5}`;
|
|
16574
17300
|
const controller = new AbortController();
|
|
16575
|
-
const timeout = setTimeout(() => controller.abort(),
|
|
17301
|
+
const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS6);
|
|
16576
17302
|
try {
|
|
16577
17303
|
const response = await fetch(url, {
|
|
16578
17304
|
method,
|
|
@@ -16609,7 +17335,6 @@ var wixStoreConnector = new ConnectorPlugin({
|
|
|
16609
17335
|
name: "Wix Store",
|
|
16610
17336
|
description: "Connect to Wix Store.",
|
|
16611
17337
|
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/YyFxclQFzROIYpFam6vRK/e7e75d3feac49a1cc5e433c147216d23/Wix_logo_black.svg",
|
|
16612
|
-
order: 110,
|
|
16613
17338
|
parameters: parameters13,
|
|
16614
17339
|
releaseFlag: { dev1: true, dev2: true, prod: true },
|
|
16615
17340
|
systemPrompt: `## Wix Store API
|
|
@@ -16672,26 +17397,26 @@ var parameters14 = {
|
|
|
16672
17397
|
required: true
|
|
16673
17398
|
})
|
|
16674
17399
|
};
|
|
16675
|
-
var
|
|
17400
|
+
var REQUEST_TIMEOUT_MS7 = 6e4;
|
|
16676
17401
|
function resolveGraphqlEndpoint(host) {
|
|
16677
17402
|
if (host.includes("emea")) return "https://metadata.emea.dbt.com/graphql";
|
|
16678
17403
|
if (host.includes(".au.")) return "https://metadata.au.dbt.com/graphql";
|
|
16679
17404
|
return "https://metadata.cloud.getdbt.com/graphql";
|
|
16680
17405
|
}
|
|
16681
|
-
var
|
|
16682
|
-
toolUseIntent:
|
|
16683
|
-
connectionId:
|
|
16684
|
-
query:
|
|
16685
|
-
variables:
|
|
17406
|
+
var inputSchema16 = z16.object({
|
|
17407
|
+
toolUseIntent: z16.string().optional().describe("Brief description of what you intend to accomplish with this tool call"),
|
|
17408
|
+
connectionId: z16.string().describe("ID of the dbt Cloud connection to use"),
|
|
17409
|
+
query: z16.string().describe("GraphQL query"),
|
|
17410
|
+
variables: z16.record(z16.string(), z16.unknown()).optional().describe("GraphQL variables (JSON)")
|
|
16686
17411
|
});
|
|
16687
|
-
var
|
|
16688
|
-
|
|
16689
|
-
success:
|
|
16690
|
-
data:
|
|
17412
|
+
var outputSchema16 = z16.discriminatedUnion("success", [
|
|
17413
|
+
z16.object({
|
|
17414
|
+
success: z16.literal(true),
|
|
17415
|
+
data: z16.record(z16.string(), z16.unknown())
|
|
16691
17416
|
}),
|
|
16692
|
-
|
|
16693
|
-
success:
|
|
16694
|
-
error:
|
|
17417
|
+
z16.object({
|
|
17418
|
+
success: z16.literal(false),
|
|
17419
|
+
error: z16.string()
|
|
16695
17420
|
})
|
|
16696
17421
|
]);
|
|
16697
17422
|
var requestTool5 = new ConnectorTool({
|
|
@@ -16699,8 +17424,8 @@ var requestTool5 = new ConnectorTool({
|
|
|
16699
17424
|
description: `Send authenticated requests to the dbt Cloud Discovery API (GraphQL).
|
|
16700
17425
|
Authentication is handled automatically using the API token.
|
|
16701
17426
|
{environmentId} in GraphQL variables is automatically replaced with the prod-env-id.`,
|
|
16702
|
-
inputSchema:
|
|
16703
|
-
outputSchema:
|
|
17427
|
+
inputSchema: inputSchema16,
|
|
17428
|
+
outputSchema: outputSchema16,
|
|
16704
17429
|
async execute({ connectionId, query, variables }, connections) {
|
|
16705
17430
|
const connection = connections.find((c) => c.id === connectionId);
|
|
16706
17431
|
if (!connection) {
|
|
@@ -16716,7 +17441,7 @@ Authentication is handled automatically using the API token.
|
|
|
16716
17441
|
) : void 0;
|
|
16717
17442
|
const endpoint = resolveGraphqlEndpoint(host);
|
|
16718
17443
|
const controller = new AbortController();
|
|
16719
|
-
const timeout = setTimeout(() => controller.abort(),
|
|
17444
|
+
const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS7);
|
|
16720
17445
|
try {
|
|
16721
17446
|
const response = await fetch(endpoint, {
|
|
16722
17447
|
method: "POST",
|
|
@@ -16758,7 +17483,6 @@ var dbtConnector = new ConnectorPlugin({
|
|
|
16758
17483
|
name: "dbt",
|
|
16759
17484
|
description: "Connect to dbt Cloud for data transformation and analytics engineering.",
|
|
16760
17485
|
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/4iT6ncXtdtHdkXexU0WgfZ/0367a38d245f2568eab5eb511f9ee692/dbt.png",
|
|
16761
|
-
order: 50,
|
|
16762
17486
|
parameters: parameters14,
|
|
16763
17487
|
releaseFlag: { dev1: true, dev2: true, prod: true },
|
|
16764
17488
|
systemPrompt: `## dbt Cloud Discovery API (GraphQL)
|
|
@@ -16828,23 +17552,23 @@ var parameters15 = {
|
|
|
16828
17552
|
var MAX_ROWS10 = 500;
|
|
16829
17553
|
var CONNECT_TIMEOUT_MS3 = 1e4;
|
|
16830
17554
|
var STATEMENT_TIMEOUT_MS2 = 6e4;
|
|
16831
|
-
var
|
|
16832
|
-
toolUseIntent:
|
|
17555
|
+
var inputSchema17 = z17.object({
|
|
17556
|
+
toolUseIntent: z17.string().optional().describe(
|
|
16833
17557
|
"Brief description of what you intend to accomplish with this tool call"
|
|
16834
17558
|
),
|
|
16835
|
-
connectionId:
|
|
16836
|
-
sql:
|
|
17559
|
+
connectionId: z17.string().describe("ID of the Squadbase DB connection to use"),
|
|
17560
|
+
sql: z17.string().describe("PostgreSQL SQL query. Always include LIMIT in queries.")
|
|
16837
17561
|
});
|
|
16838
|
-
var
|
|
16839
|
-
|
|
16840
|
-
success:
|
|
16841
|
-
rowCount:
|
|
16842
|
-
truncated:
|
|
16843
|
-
rows:
|
|
17562
|
+
var outputSchema17 = z17.discriminatedUnion("success", [
|
|
17563
|
+
z17.object({
|
|
17564
|
+
success: z17.literal(true),
|
|
17565
|
+
rowCount: z17.number(),
|
|
17566
|
+
truncated: z17.boolean(),
|
|
17567
|
+
rows: z17.array(z17.record(z17.string(), z17.unknown()))
|
|
16844
17568
|
}),
|
|
16845
|
-
|
|
16846
|
-
success:
|
|
16847
|
-
error:
|
|
17569
|
+
z17.object({
|
|
17570
|
+
success: z17.literal(false),
|
|
17571
|
+
error: z17.string()
|
|
16848
17572
|
})
|
|
16849
17573
|
]);
|
|
16850
17574
|
var executeQueryTool10 = new ConnectorTool({
|
|
@@ -16852,8 +17576,8 @@ var executeQueryTool10 = new ConnectorTool({
|
|
|
16852
17576
|
description: `Execute SQL against Squadbase DB (PostgreSQL). Returns up to ${MAX_ROWS10} rows.
|
|
16853
17577
|
Use for: schema exploration (information_schema), data sampling, analytical queries.
|
|
16854
17578
|
Avoid loading large amounts of data; always include LIMIT in queries.`,
|
|
16855
|
-
inputSchema:
|
|
16856
|
-
outputSchema:
|
|
17579
|
+
inputSchema: inputSchema17,
|
|
17580
|
+
outputSchema: outputSchema17,
|
|
16857
17581
|
async execute({ connectionId, sql }, connections) {
|
|
16858
17582
|
const connection = connections.find((c) => c.id === connectionId);
|
|
16859
17583
|
if (!connection) {
|
|
@@ -16903,8 +17627,7 @@ var squadbaseDbConnector = new ConnectorPlugin({
|
|
|
16903
17627
|
authType: null,
|
|
16904
17628
|
name: "Squadbase DB",
|
|
16905
17629
|
description: "Connect to Squadbase DB (PostgreSQL).",
|
|
16906
|
-
iconUrl: "",
|
|
16907
|
-
order: 100,
|
|
17630
|
+
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/25y0XqMxIufeD3egWH3bEl/659b4ade405890654cfaf91c03a4b458/icon.svg",
|
|
16908
17631
|
parameters: parameters15,
|
|
16909
17632
|
releaseFlag: { dev1: true, dev2: true, prod: true },
|
|
16910
17633
|
systemPrompt: `## Squadbase DB SQL Notes
|
|
@@ -16914,6 +17637,22 @@ var squadbaseDbConnector = new ConnectorPlugin({
|
|
|
16914
17637
|
- List columns: \`SELECT column_name, data_type FROM information_schema.columns WHERE table_schema = 'public' AND table_name = 'xxx'\`
|
|
16915
17638
|
- Always include LIMIT in queries`,
|
|
16916
17639
|
tools: tools15,
|
|
17640
|
+
async checkConnection(params, _config) {
|
|
17641
|
+
const { Pool } = await import("pg");
|
|
17642
|
+
const pool = new Pool({
|
|
17643
|
+
connectionString: params[parameters15.connectionUrl.slug],
|
|
17644
|
+
ssl: { rejectUnauthorized: false },
|
|
17645
|
+
connectionTimeoutMillis: 1e4
|
|
17646
|
+
});
|
|
17647
|
+
try {
|
|
17648
|
+
await pool.query("SELECT 1");
|
|
17649
|
+
return { success: true };
|
|
17650
|
+
} catch (error) {
|
|
17651
|
+
return { success: false, error: error instanceof Error ? error.message : String(error) };
|
|
17652
|
+
} finally {
|
|
17653
|
+
await pool.end();
|
|
17654
|
+
}
|
|
17655
|
+
},
|
|
16917
17656
|
async query(params, sql, namedParams) {
|
|
16918
17657
|
const { Pool } = await import("pg");
|
|
16919
17658
|
const { text, values } = buildPositionalParams(sql, namedParams);
|
|
@@ -16934,19 +17673,19 @@ var squadbaseDbConnector = new ConnectorPlugin({
|
|
|
16934
17673
|
var plugins = {
|
|
16935
17674
|
snowflake: snowflakeConnector,
|
|
16936
17675
|
snowflakePat: snowflakePatConnector,
|
|
16937
|
-
postgresql: postgresqlConnector,
|
|
16938
|
-
mysql: mysqlConnector,
|
|
16939
17676
|
bigquery: bigqueryConnector,
|
|
16940
17677
|
bigqueryOauth: bigqueryOauthConnector,
|
|
16941
|
-
awsAthena: awsAthenaConnector,
|
|
16942
|
-
redshift: redshiftConnector,
|
|
16943
17678
|
databricks: databricksConnector,
|
|
16944
|
-
|
|
17679
|
+
redshift: redshiftConnector,
|
|
17680
|
+
dbt: dbtConnector,
|
|
17681
|
+
awsAthena: awsAthenaConnector,
|
|
17682
|
+
postgresql: postgresqlConnector,
|
|
17683
|
+
mysql: mysqlConnector,
|
|
16945
17684
|
googleAnalytics: googleAnalyticsConnector,
|
|
17685
|
+
airtable: airtableConnector,
|
|
17686
|
+
squadbaseDb: squadbaseDbConnector,
|
|
16946
17687
|
kintone: kintoneConnector,
|
|
16947
|
-
wixStore: wixStoreConnector
|
|
16948
|
-
dbt: dbtConnector,
|
|
16949
|
-
squadbaseDb: squadbaseDbConnector
|
|
17688
|
+
wixStore: wixStoreConnector
|
|
16950
17689
|
};
|
|
16951
17690
|
var connectors = {
|
|
16952
17691
|
...plugins,
|
|
@@ -17163,62 +17902,62 @@ import { watch as fsWatch2 } from "fs";
|
|
|
17163
17902
|
import path2 from "path";
|
|
17164
17903
|
|
|
17165
17904
|
// src/types/data-source.ts
|
|
17166
|
-
import { z as
|
|
17167
|
-
var parameterMetaSchema =
|
|
17168
|
-
name:
|
|
17169
|
-
type:
|
|
17170
|
-
description:
|
|
17171
|
-
required:
|
|
17172
|
-
default:
|
|
17905
|
+
import { z as z18 } from "zod";
|
|
17906
|
+
var parameterMetaSchema = z18.object({
|
|
17907
|
+
name: z18.string(),
|
|
17908
|
+
type: z18.enum(["string", "number", "boolean"]),
|
|
17909
|
+
description: z18.string(),
|
|
17910
|
+
required: z18.boolean().optional(),
|
|
17911
|
+
default: z18.union([z18.string(), z18.number(), z18.boolean()]).optional()
|
|
17173
17912
|
});
|
|
17174
|
-
var dataSourceCacheConfigSchema =
|
|
17175
|
-
ttl:
|
|
17176
|
-
staleWhileRevalidate:
|
|
17913
|
+
var dataSourceCacheConfigSchema = z18.object({
|
|
17914
|
+
ttl: z18.number(),
|
|
17915
|
+
staleWhileRevalidate: z18.boolean().optional()
|
|
17177
17916
|
});
|
|
17178
|
-
var dataSourceSchemaObjectSchema =
|
|
17179
|
-
() =>
|
|
17180
|
-
type:
|
|
17181
|
-
format:
|
|
17182
|
-
description:
|
|
17183
|
-
nullable:
|
|
17184
|
-
enum:
|
|
17917
|
+
var dataSourceSchemaObjectSchema = z18.lazy(
|
|
17918
|
+
() => z18.object({
|
|
17919
|
+
type: z18.enum(["string", "number", "integer", "boolean", "object", "array", "null"]).optional(),
|
|
17920
|
+
format: z18.string().optional(),
|
|
17921
|
+
description: z18.string().optional(),
|
|
17922
|
+
nullable: z18.boolean().optional(),
|
|
17923
|
+
enum: z18.array(z18.union([z18.string(), z18.number(), z18.boolean(), z18.null()])).optional(),
|
|
17185
17924
|
items: dataSourceSchemaObjectSchema.optional(),
|
|
17186
|
-
properties:
|
|
17187
|
-
required:
|
|
17188
|
-
additionalProperties:
|
|
17189
|
-
minimum:
|
|
17190
|
-
maximum:
|
|
17191
|
-
minLength:
|
|
17192
|
-
maxLength:
|
|
17193
|
-
pattern:
|
|
17925
|
+
properties: z18.record(z18.string(), dataSourceSchemaObjectSchema).optional(),
|
|
17926
|
+
required: z18.array(z18.string()).optional(),
|
|
17927
|
+
additionalProperties: z18.union([z18.boolean(), dataSourceSchemaObjectSchema]).optional(),
|
|
17928
|
+
minimum: z18.number().optional(),
|
|
17929
|
+
maximum: z18.number().optional(),
|
|
17930
|
+
minLength: z18.number().optional(),
|
|
17931
|
+
maxLength: z18.number().optional(),
|
|
17932
|
+
pattern: z18.string().optional()
|
|
17194
17933
|
})
|
|
17195
17934
|
);
|
|
17196
|
-
var dataSourceMediaTypeSchema =
|
|
17935
|
+
var dataSourceMediaTypeSchema = z18.object({
|
|
17197
17936
|
schema: dataSourceSchemaObjectSchema.optional(),
|
|
17198
|
-
example:
|
|
17937
|
+
example: z18.unknown().optional()
|
|
17199
17938
|
});
|
|
17200
|
-
var dataSourceResponseSchema =
|
|
17201
|
-
description:
|
|
17202
|
-
content:
|
|
17939
|
+
var dataSourceResponseSchema = z18.object({
|
|
17940
|
+
description: z18.string().optional(),
|
|
17941
|
+
content: z18.record(z18.string(), dataSourceMediaTypeSchema).optional()
|
|
17203
17942
|
});
|
|
17204
17943
|
var jsonBaseFields = {
|
|
17205
|
-
description:
|
|
17206
|
-
parameters:
|
|
17944
|
+
description: z18.string(),
|
|
17945
|
+
parameters: z18.array(parameterMetaSchema).optional(),
|
|
17207
17946
|
response: dataSourceResponseSchema.optional(),
|
|
17208
17947
|
cache: dataSourceCacheConfigSchema.optional()
|
|
17209
17948
|
};
|
|
17210
|
-
var jsonSqlDataSourceSchema =
|
|
17949
|
+
var jsonSqlDataSourceSchema = z18.object({
|
|
17211
17950
|
...jsonBaseFields,
|
|
17212
|
-
type:
|
|
17213
|
-
query:
|
|
17214
|
-
connectionId:
|
|
17951
|
+
type: z18.literal("sql").optional(),
|
|
17952
|
+
query: z18.string(),
|
|
17953
|
+
connectionId: z18.string()
|
|
17215
17954
|
});
|
|
17216
|
-
var jsonTypeScriptDataSourceSchema =
|
|
17955
|
+
var jsonTypeScriptDataSourceSchema = z18.object({
|
|
17217
17956
|
...jsonBaseFields,
|
|
17218
|
-
type:
|
|
17219
|
-
handlerPath:
|
|
17957
|
+
type: z18.literal("typescript"),
|
|
17958
|
+
handlerPath: z18.string()
|
|
17220
17959
|
});
|
|
17221
|
-
var anyJsonDataSourceSchema =
|
|
17960
|
+
var anyJsonDataSourceSchema = z18.union([
|
|
17222
17961
|
jsonTypeScriptDataSourceSchema,
|
|
17223
17962
|
jsonSqlDataSourceSchema
|
|
17224
17963
|
]);
|