@squadbase/vite-server 0.1.9-dev.b193824 → 0.1.9-dev.d3c856d
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 +125 -77
- package/dist/connectors/asana.js +15 -2
- package/dist/connectors/aws-billing.js +1 -1
- package/dist/connectors/gmail-oauth.js +15 -2
- package/dist/connectors/gmail.js +23 -14
- package/dist/connectors/google-audit-log.js +25 -14
- package/dist/connectors/google-calendar-oauth.js +18 -2
- package/dist/connectors/google-calendar.js +40 -26
- package/dist/connectors/google-docs.js +18 -2
- package/dist/connectors/google-drive.js +15 -2
- package/dist/connectors/google-sheets.js +18 -2
- package/dist/connectors/google-slides.js +18 -2
- package/dist/connectors/tiktok-ads.js +15 -2
- package/dist/index.js +125 -77
- package/dist/main.js +125 -77
- package/dist/vite-plugin.js +125 -77
- package/package.json +1 -1
package/dist/vite-plugin.js
CHANGED
|
@@ -94738,7 +94738,7 @@ var snowflakeOnboarding = new ConnectorOnboarding({
|
|
|
94738
94738
|
8. \u7D50\u679C\u306B\u5FDC\u3058\u3066\u5206\u5C90:
|
|
94739
94739
|
- **\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
|
|
94740
94740
|
- **\u30C6\u30FC\u30D6\u30EB\u304C1\u3064\u3060\u3051**: askUserQuestion \u306F\u4F7F\u308F\u305A\u81EA\u52D5\u63A1\u7528
|
|
94741
|
-
9. Phase 5 \u306E \`finalizeSetup\` \u306B\u6E21\u3059 \`projectKnowledge\` \u3067\u306F\u3001\u30B9\u30C6\u30C3\u30D72\u3067\u9078\u629E\u3057\u305F\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\
|
|
94741
|
+
9. Phase 5 \u306E \`finalizeSetup\` \u306B\u6E21\u3059 \`projectKnowledge\` \u3067\u306F\u3001\u30B9\u30C6\u30C3\u30D72\u3067\u9078\u629E\u3057\u305F\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u3068\u30B9\u30C6\u30C3\u30D75\u3067\u9078\u629E\u3057\u305F\u30B9\u30AD\u30FC\u30DE\u3092\u3001\u3053\u306E\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306E\u30B9\u30B3\u30FC\u30D7\u60C5\u5831\u3068\u3057\u3066\u8A18\u9332\u3059\u308B\uFF08\u8907\u6570\u9078\u629E\u3057\u305F\u5834\u5408\u306F\u5168\u4EF6\uFF09\u3002\u5404\u30B9\u30AD\u30FC\u30DE\u306B\u3064\u3044\u3066\u300C\u5168\u30C6\u30FC\u30D6\u30EB\u300D\u304C\u9078\u3070\u308C\u305F\u304B\u300C\u7279\u5B9A\u30C6\u30FC\u30D6\u30EB\u300D\u304C\u9078\u3070\u308C\u305F\u304B\u3092\u533A\u5225\u3057\u3066\u8A18\u9332\u3057\u3001\u7279\u5B9A\u30C6\u30FC\u30D6\u30EB\u304C\u9078\u3070\u308C\u305F\u5834\u5408\u306F\u5BFE\u8C61\u30C6\u30FC\u30D6\u30EB\u540D\u3082\u542B\u3081\u308B\u3002
|
|
94742
94742
|
|
|
94743
94743
|
#### \u5236\u7D04
|
|
94744
94744
|
- 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
|
|
@@ -94761,7 +94761,7 @@ var snowflakeOnboarding = new ConnectorOnboarding({
|
|
|
94761
94761
|
8. Branch based on results:
|
|
94762
94762
|
- **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
|
|
94763
94763
|
- **Exactly 1 table**: Do NOT call askUserQuestion. Auto-select it
|
|
94764
|
-
9. When passing \`projectKnowledge\` to \`finalizeSetup\` in Phase 5, record
|
|
94764
|
+
9. When passing \`projectKnowledge\` to \`finalizeSetup\` in Phase 5, record the databases selected in step 2 and the schemas selected in step 5 as this connection's scope info (record all of them if multiple were chosen). For each schema, indicate whether "all tables" or "specific tables" was chosen, and if specific tables were chosen, include the selected table names.
|
|
94765
94765
|
|
|
94766
94766
|
#### Constraints
|
|
94767
94767
|
- askUserQuestion options requires at least 2 items. If there is only 1 item, do NOT call askUserQuestion \u2014 proceed to the next step directly
|
|
@@ -96071,7 +96071,7 @@ var bigqueryOnboarding = new ConnectorOnboarding({
|
|
|
96071
96071
|
7. \u7D50\u679C\u306B\u5FDC\u3058\u3066\u5206\u5C90:
|
|
96072
96072
|
- **\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
|
|
96073
96073
|
- **\u30C6\u30FC\u30D6\u30EB\u304C1\u3064\u3060\u3051**: askUserQuestion \u306F\u4F7F\u308F\u305A\u81EA\u52D5\u63A1\u7528
|
|
96074
|
-
8. Phase 5 \u306E \`finalizeSetup\` \u306B\u6E21\u3059 \`projectKnowledge\` \u3067\u306F\u3001\u30B9\u30C6\u30C3\u30D75\u3067\u30E6\u30FC\u30B6\u30FC\u304C\u9078\u629E\u3057\u305F\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u3092
|
|
96074
|
+
8. Phase 5 \u306E \`finalizeSetup\` \u306B\u6E21\u3059 \`projectKnowledge\` \u3067\u306F\u3001\u30B9\u30C6\u30C3\u30D75\u3067\u30E6\u30FC\u30B6\u30FC\u304C\u9078\u629E\u3057\u305F\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u3092\u3053\u306E\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306E\u30B9\u30B3\u30FC\u30D7\u60C5\u5831\u3068\u3057\u3066\u8A18\u9332\u3059\u308B\uFF08\u8907\u6570\u9078\u629E\u3057\u305F\u5834\u5408\u306F\u5168\u4EF6\uFF09\u3002\u30D1\u30D6\u30EA\u30C3\u30AF\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306F \`bigquery-public-data.{dataset}\` \u306E\u5F62\u5F0F\u3067\u8A18\u9332\u3059\u308B\u3002
|
|
96075
96075
|
|
|
96076
96076
|
#### \u5236\u7D04
|
|
96077
96077
|
- **\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
|
|
@@ -96100,7 +96100,7 @@ var bigqueryOnboarding = new ConnectorOnboarding({
|
|
|
96100
96100
|
7. Branch based on results:
|
|
96101
96101
|
- **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
|
|
96102
96102
|
- **Exactly 1 table**: Do NOT call askUserQuestion. Auto-select it
|
|
96103
|
-
8. When passing \`projectKnowledge\` to \`finalizeSetup\` in Phase 5, record each dataset selected in step 5
|
|
96103
|
+
8. When passing \`projectKnowledge\` to \`finalizeSetup\` in Phase 5, record each dataset selected in step 5 as this connection's scope info (record all of them if multiple were chosen). Use the form \`bigquery-public-data.{dataset}\` for public datasets.
|
|
96104
96104
|
|
|
96105
96105
|
#### Constraints
|
|
96106
96106
|
- **Do NOT read table row data**. Only the metadata queries specified in the steps above are allowed. All other queries are forbidden
|
|
@@ -96528,7 +96528,7 @@ var bigqueryOnboarding2 = new ConnectorOnboarding({
|
|
|
96528
96528
|
7. \u7D50\u679C\u306B\u5FDC\u3058\u3066\u5206\u5C90:
|
|
96529
96529
|
- **\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
|
|
96530
96530
|
- **\u30C6\u30FC\u30D6\u30EB\u304C1\u3064\u3060\u3051**: askUserQuestion \u306F\u4F7F\u308F\u305A\u81EA\u52D5\u63A1\u7528
|
|
96531
|
-
8. Phase 5 \u306E \`finalizeSetup\` \u306B\u6E21\u3059 \`projectKnowledge\` \u3067\u306F\u3001\u30B9\u30C6\u30C3\u30D75\u3067\u30E6\u30FC\u30B6\u30FC\u304C\u9078\u629E\u3057\u305F\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u3092
|
|
96531
|
+
8. Phase 5 \u306E \`finalizeSetup\` \u306B\u6E21\u3059 \`projectKnowledge\` \u3067\u306F\u3001\u30B9\u30C6\u30C3\u30D75\u3067\u30E6\u30FC\u30B6\u30FC\u304C\u9078\u629E\u3057\u305F\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u3092\u3053\u306E\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306E\u30B9\u30B3\u30FC\u30D7\u60C5\u5831\u3068\u3057\u3066\u8A18\u9332\u3059\u308B\uFF08\u8907\u6570\u9078\u629E\u3057\u305F\u5834\u5408\u306F\u5168\u4EF6\uFF09\u3002\u30D1\u30D6\u30EA\u30C3\u30AF\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306F \`bigquery-public-data.{dataset}\` \u306E\u5F62\u5F0F\u3067\u8A18\u9332\u3059\u308B\u3002
|
|
96532
96532
|
|
|
96533
96533
|
#### \u5236\u7D04
|
|
96534
96534
|
- **\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
|
|
@@ -96557,7 +96557,7 @@ var bigqueryOnboarding2 = new ConnectorOnboarding({
|
|
|
96557
96557
|
7. Branch based on results:
|
|
96558
96558
|
- **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
|
|
96559
96559
|
- **Exactly 1 table**: Do NOT call askUserQuestion. Auto-select it
|
|
96560
|
-
8. When passing \`projectKnowledge\` to \`finalizeSetup\` in Phase 5, record each dataset selected in step 5
|
|
96560
|
+
8. When passing \`projectKnowledge\` to \`finalizeSetup\` in Phase 5, record each dataset selected in step 5 as this connection's scope info (record all of them if multiple were chosen). Use the form \`bigquery-public-data.{dataset}\` for public datasets.
|
|
96561
96561
|
|
|
96562
96562
|
#### Constraints
|
|
96563
96563
|
- **Do NOT read table row data**. Only the metadata queries specified in the steps above are allowed. All other queries are forbidden
|
|
@@ -97589,7 +97589,7 @@ var awsBillingConnector = new ConnectorPlugin({
|
|
|
97589
97589
|
description: "Connect to AWS Cost Explorer to analyze AWS spend, usage, and forecast costs across services, accounts, and regions.",
|
|
97590
97590
|
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/6u4IRN1BNS0EVSjsWSnrq1/53721bfc097a5ff04d07c15cc5e80a0d/Amazon_Web_Services-Logo.wine.svg",
|
|
97591
97591
|
parameters: parameters8,
|
|
97592
|
-
releaseFlag: { dev1: true, dev2:
|
|
97592
|
+
releaseFlag: { dev1: true, dev2: true, prod: true },
|
|
97593
97593
|
categories: ["finance"],
|
|
97594
97594
|
onboarding: awsBillingOnboarding,
|
|
97595
97595
|
systemPrompt: {
|
|
@@ -100044,6 +100044,16 @@ const realtime = await ga.runRealtimeReport({
|
|
|
100044
100044
|
// ../connectors/src/connectors/google-calendar/tools/request.ts
|
|
100045
100045
|
import { z as z24 } from "zod";
|
|
100046
100046
|
|
|
100047
|
+
// ../connectors/src/lib/normalize-path.ts
|
|
100048
|
+
function normalizeRequestPath(path4, basePathSegment) {
|
|
100049
|
+
let p2 = path4.trim();
|
|
100050
|
+
if (!p2.startsWith("/")) p2 = "/" + p2;
|
|
100051
|
+
if (p2 === basePathSegment || p2.startsWith(basePathSegment + "/")) {
|
|
100052
|
+
p2 = p2.slice(basePathSegment.length) || "/";
|
|
100053
|
+
}
|
|
100054
|
+
return p2;
|
|
100055
|
+
}
|
|
100056
|
+
|
|
100047
100057
|
// ../connectors/src/connectors/google-calendar/parameters.ts
|
|
100048
100058
|
var parameters15 = {
|
|
100049
100059
|
serviceAccountKeyJsonBase64: new ParameterDefinition({
|
|
@@ -100058,7 +100068,9 @@ var parameters15 = {
|
|
|
100058
100068
|
};
|
|
100059
100069
|
|
|
100060
100070
|
// ../connectors/src/connectors/google-calendar/tools/request.ts
|
|
100061
|
-
var
|
|
100071
|
+
var BASE_HOST = "https://www.googleapis.com";
|
|
100072
|
+
var BASE_PATH_SEGMENT = "/calendar/v3";
|
|
100073
|
+
var BASE_URL6 = `${BASE_HOST}${BASE_PATH_SEGMENT}`;
|
|
100062
100074
|
var REQUEST_TIMEOUT_MS14 = 6e4;
|
|
100063
100075
|
function decodeServiceAccount(keyJsonBase64) {
|
|
100064
100076
|
const decoded = Buffer.from(keyJsonBase64, "base64").toString("utf-8");
|
|
@@ -100137,7 +100149,8 @@ var requestTool5 = new ConnectorTool({
|
|
|
100137
100149
|
serviceAccountEmail
|
|
100138
100150
|
};
|
|
100139
100151
|
}
|
|
100140
|
-
|
|
100152
|
+
const normalizedPath = normalizeRequestPath(path4, BASE_PATH_SEGMENT);
|
|
100153
|
+
let url = `${BASE_URL6}${normalizedPath}`;
|
|
100141
100154
|
if (queryParams) {
|
|
100142
100155
|
const searchParams = new URLSearchParams(queryParams);
|
|
100143
100156
|
url += `?${searchParams.toString()}`;
|
|
@@ -100187,7 +100200,9 @@ var requestTool5 = new ConnectorTool({
|
|
|
100187
100200
|
|
|
100188
100201
|
// ../connectors/src/connectors/google-calendar/tools/request-with-delegation.ts
|
|
100189
100202
|
import { z as z25 } from "zod";
|
|
100190
|
-
var
|
|
100203
|
+
var BASE_HOST2 = "https://www.googleapis.com";
|
|
100204
|
+
var BASE_PATH_SEGMENT2 = "/calendar/v3";
|
|
100205
|
+
var BASE_URL7 = `${BASE_HOST2}${BASE_PATH_SEGMENT2}`;
|
|
100191
100206
|
var REQUEST_TIMEOUT_MS15 = 6e4;
|
|
100192
100207
|
function decodeServiceAccount2(keyJsonBase64) {
|
|
100193
100208
|
const decoded = Buffer.from(keyJsonBase64, "base64").toString("utf-8");
|
|
@@ -100272,7 +100287,8 @@ var requestWithDelegationTool = new ConnectorTool({
|
|
|
100272
100287
|
serviceAccountEmail
|
|
100273
100288
|
};
|
|
100274
100289
|
}
|
|
100275
|
-
|
|
100290
|
+
const normalizedPath = normalizeRequestPath(path4, BASE_PATH_SEGMENT2);
|
|
100291
|
+
let url = `${BASE_URL7}${normalizedPath}`;
|
|
100276
100292
|
if (queryParams) {
|
|
100277
100293
|
const searchParams = new URLSearchParams(queryParams);
|
|
100278
100294
|
url += `?${searchParams.toString()}`;
|
|
@@ -100395,9 +100411,7 @@ var googleCalendarOnboarding = new ConnectorOnboarding({
|
|
|
100395
100411
|
|
|
100396
100412
|
## \u30B9\u30C6\u30C3\u30D7 4: Project Knowledge \u306B\u8A18\u9332
|
|
100397
100413
|
|
|
100398
|
-
\u30B9\u30C6\u30C3\u30D7 2 \u3068 3 \u3067\u78BA\u5B9A\u3057\u305F calendarId \u96C6\u5408\u3092\u7D71\u5408\u3059\u308B\u3002\u5404 calendarId \u306B\u3064\u3044\u3066\u3001\u30B9\u30C6\u30C3\u30D7 2 \u3067\u758E\u901A\u78BA\u8A8D\u3057\u305F\u7D50\u679C\u304B\u3001\u30B9\u30C6\u30C3\u30D7 3 \u306E\u30C7\u30A3\u30B9\u30AB\u30D0\u30EA\u7D50\u679C\u304B\u3089\u7D4C\u8DEF\u3068 (delegation \u306E\u5834\u5408\u306F) subject \u3092\u7279\u5B9A\u3059\u308B\u3002\`finalizeSetup\` \u3092\u547C\u3073\u3001
|
|
100399
|
-
- \u30C9\u30E1\u30A4\u30F3\u5168\u4F53\u306E\u59D4\u4EFB\u7D4C\u7531: \`- calendar: <calendarId> (delegation, subject: <subject>, name: "<\u30AB\u30EC\u30F3\u30C0\u30FC\u540D>")\`
|
|
100400
|
-
- \u30B5\u30FC\u30D3\u30B9\u30A2\u30AB\u30A6\u30F3\u30C8\u7D4C\u8DEF: \`- calendar: <calendarId> (service-account, name: "<\u30AB\u30EC\u30F3\u30C0\u30FC\u540D>")\`
|
|
100414
|
+
\u30B9\u30C6\u30C3\u30D7 2 \u3068 3 \u3067\u78BA\u5B9A\u3057\u305F calendarId \u96C6\u5408\u3092\u7D71\u5408\u3059\u308B\u3002\u5404 calendarId \u306B\u3064\u3044\u3066\u3001\u30B9\u30C6\u30C3\u30D7 2 \u3067\u758E\u901A\u78BA\u8A8D\u3057\u305F\u7D50\u679C\u304B\u3001\u30B9\u30C6\u30C3\u30D7 3 \u306E\u30C7\u30A3\u30B9\u30AB\u30D0\u30EA\u7D50\u679C\u304B\u3089\u7D4C\u8DEF\u3068 (delegation \u306E\u5834\u5408\u306F) subject \u3092\u7279\u5B9A\u3059\u308B\u3002\`finalizeSetup\` \u3092\u547C\u3073\u3001\u5404\u30AB\u30EC\u30F3\u30C0\u30FC\u3092\u300C\u30AB\u30EC\u30F3\u30C0\u30FC\u540D\u30FB\u30AB\u30EC\u30F3\u30C0\u30FC ID\u30FB\u30A2\u30AF\u30BB\u30B9\u7D4C\u8DEF\uFF08delegation \u304B service-account \u304B\uFF09\u30FBdelegation \u306E\u5834\u5408\u306F subject\u300D\u3068\u3068\u3082\u306B\u3053\u306E\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306E\u30B9\u30B3\u30FC\u30D7\u60C5\u5831\u3068\u3057\u3066\u8A18\u9332\u3059\u308B\u3002
|
|
100401
100415
|
|
|
100402
100416
|
## \u30B9\u30C6\u30C3\u30D7 5: \u6700\u7D42\u7684\u306B\u30AB\u30EC\u30F3\u30C0\u30FC\u304C 0 \u4EF6\u306E\u3068\u304D\u306E\u30A8\u30B9\u30AB\u30EC\u30FC\u30B7\u30E7\u30F3
|
|
100403
100417
|
|
|
@@ -100489,9 +100503,7 @@ Discover calendars from each Workspace user and let the user narrow them down.
|
|
|
100489
100503
|
|
|
100490
100504
|
## Step 4: Record in Project Knowledge
|
|
100491
100505
|
|
|
100492
|
-
Aggregate the calendarIds from Steps 2 and 3. Cross-reference each calendarId against the verification result (Step 2) or the discovery result (Step 3) to recover its access path and, for delegation, the subject. Call \`finalizeSetup
|
|
100493
|
-
- Via Domain-wide Delegation: \`- calendar: <calendarId> (delegation, subject: <subject>, name: "<calendar name>")\`
|
|
100494
|
-
- Via service account: \`- calendar: <calendarId> (service-account, name: "<calendar name>")\`
|
|
100506
|
+
Aggregate the calendarIds from Steps 2 and 3. Cross-reference each calendarId against the verification result (Step 2) or the discovery result (Step 3) to recover its access path and, for delegation, the subject. Call \`finalizeSetup\` and record each calendar with its name, calendar ID, access path (delegation or service-account), and (for delegation) the subject as this connection's scope info.
|
|
100495
100507
|
|
|
100496
100508
|
## Step 5: Escalation when zero calendars are selected
|
|
100497
100509
|
|
|
@@ -100517,18 +100529,18 @@ Behavior per selection:
|
|
|
100517
100529
|
- Write at most 1 sentence between tool calls`
|
|
100518
100530
|
},
|
|
100519
100531
|
dataOverviewInstructions: {
|
|
100520
|
-
en: `For each calendar
|
|
100521
|
-
-
|
|
100522
|
-
-
|
|
100532
|
+
en: `For each calendar configured for this connection, fetch metadata and a small sample of upcoming events. Pick the tool that matches the calendar's access path:
|
|
100533
|
+
- Calendars accessed via delegation \u2192 \`${requestWithDelegationToolName}\` with the user's email as \`subject\`
|
|
100534
|
+
- Calendars shared directly with the service account \u2192 \`${requestToolName}\`
|
|
100523
100535
|
|
|
100524
100536
|
Pass \`scopes: ${READONLY_SCOPES}\` for every call.
|
|
100525
100537
|
|
|
100526
100538
|
For each calendar:
|
|
100527
100539
|
1. \`method=GET\`, \`path=/calendars/<id>\` to fetch metadata.
|
|
100528
100540
|
2. \`method=GET\`, \`path=/calendars/<id>/events\`, \`queryParams={ timeMin: <RFC3339 now>, maxResults: "10", singleEvents: "true", orderBy: "startTime" }\`.`,
|
|
100529
|
-
ja:
|
|
100530
|
-
-
|
|
100531
|
-
-
|
|
100541
|
+
ja: `\u3053\u306E\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u3067\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u308B\u5404\u30AB\u30EC\u30F3\u30C0\u30FC\u306B\u3064\u3044\u3066\u3001\u30E1\u30BF\u30C7\u30FC\u30BF\u3068\u76F4\u8FD1\u306E\u30A4\u30D9\u30F3\u30C8\u3092\u5C11\u91CF\u53D6\u5F97\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u30A2\u30AF\u30BB\u30B9\u7D4C\u8DEF\u306B\u5FDC\u3058\u3066\u30C4\u30FC\u30EB\u3092\u9078\u3073\u307E\u3059:
|
|
100542
|
+
- delegation \u7D4C\u7531\u306E\u30AB\u30EC\u30F3\u30C0\u30FC \u2192 \`${requestWithDelegationToolName}\` \u3092\u3001\u5BFE\u8C61\u30E6\u30FC\u30B6\u30FC\u306E\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092 \`subject\` \u3068\u3057\u3066\u547C\u3076
|
|
100543
|
+
- service account \u306B\u76F4\u63A5\u5171\u6709\u3055\u308C\u305F\u30AB\u30EC\u30F3\u30C0\u30FC \u2192 \`${requestToolName}\` \u3092\u547C\u3076
|
|
100532
100544
|
|
|
100533
100545
|
\`scopes\` \u306F\u6BCE\u56DE \`${READONLY_SCOPES}\` \u3092\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
|
100534
100546
|
|
|
@@ -100577,10 +100589,10 @@ Per-endpoint scope reference: https://developers.google.com/calendar/api/auth
|
|
|
100577
100589
|
|
|
100578
100590
|
### Choosing the right tool
|
|
100579
100591
|
|
|
100580
|
-
|
|
100592
|
+
Each calendar configured for this connection has an access path. Match the path to the tool:
|
|
100581
100593
|
|
|
100582
|
-
-
|
|
100583
|
-
-
|
|
100594
|
+
- A Workspace user's calendar accessed via Domain-wide Delegation \u2192 use \`request_with_delegation\` and pass that user's email as \`subject\`
|
|
100595
|
+
- A calendar shared directly with the service account \u2192 use \`request\` (no \`subject\`)
|
|
100584
100596
|
|
|
100585
100597
|
### Path conventions
|
|
100586
100598
|
|
|
@@ -100635,14 +100647,14 @@ export default async function handler(c: Context) {
|
|
|
100635
100647
|
orderBy: "startTime",
|
|
100636
100648
|
});
|
|
100637
100649
|
|
|
100638
|
-
//
|
|
100650
|
+
// alice@example.com is accessed via delegation
|
|
100639
100651
|
const aliceRes = await calendar.requestWithDelegation(
|
|
100640
100652
|
\`/calendars/alice@example.com/events?\${qs}\`,
|
|
100641
100653
|
{ subject: "alice@example.com", scopes: READ },
|
|
100642
100654
|
);
|
|
100643
100655
|
const alice = await aliceRes.json();
|
|
100644
100656
|
|
|
100645
|
-
//
|
|
100657
|
+
// team@example.com is shared directly with the service account
|
|
100646
100658
|
const teamRes = await calendar.request(
|
|
100647
100659
|
\`/calendars/team@example.com/events?\${qs}\`,
|
|
100648
100660
|
{ scopes: READ },
|
|
@@ -100675,10 +100687,10 @@ export default async function handler(c: Context) {
|
|
|
100675
100687
|
|
|
100676
100688
|
### \u9069\u5207\u306A\u30C4\u30FC\u30EB\u306E\u9078\u3073\u65B9
|
|
100677
100689
|
|
|
100678
|
-
\u3053\u306E\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\
|
|
100690
|
+
\u3053\u306E\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u3067\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u308B\u5404\u30AB\u30EC\u30F3\u30C0\u30FC\u306B\u306F\u30A2\u30AF\u30BB\u30B9\u7D4C\u8DEF\u304C\u3042\u308A\u307E\u3059\u3002\u7D4C\u8DEF\u306B\u5FDC\u3058\u3066\u30C4\u30FC\u30EB\u3092\u9078\u3093\u3067\u304F\u3060\u3055\u3044:
|
|
100679
100691
|
|
|
100680
|
-
-
|
|
100681
|
-
-
|
|
100692
|
+
- delegation \u7D4C\u7531\uFF08Workspace \u30E6\u30FC\u30B6\u30FC\u306E\u30AB\u30EC\u30F3\u30C0\u30FC\u306B Domain-wide Delegation \u3067\u30A2\u30AF\u30BB\u30B9\uFF09\u2192 \`request_with_delegation\` \u3092\u4F7F\u3044\u3001\u5BFE\u8C61\u30E6\u30FC\u30B6\u30FC\u306E\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092 \`subject\` \u3068\u3057\u3066\u6E21\u3059
|
|
100693
|
+
- service account \u7D4C\u7531\uFF08\u30B5\u30FC\u30D3\u30B9\u30A2\u30AB\u30A6\u30F3\u30C8\u306B\u76F4\u63A5\u5171\u6709\u3055\u308C\u305F\u30AB\u30EC\u30F3\u30C0\u30FC\uFF09\u2192 \`request\` \u3092\u4F7F\u3046\uFF08\`subject\` \u4E0D\u8981\uFF09
|
|
100682
100694
|
|
|
100683
100695
|
### \u30D1\u30B9\u306E\u66F8\u304D\u65B9
|
|
100684
100696
|
|
|
@@ -100733,14 +100745,14 @@ export default async function handler(c: Context) {
|
|
|
100733
100745
|
orderBy: "startTime",
|
|
100734
100746
|
});
|
|
100735
100747
|
|
|
100736
|
-
//
|
|
100748
|
+
// alice@example.com \u306F delegation \u7D4C\u8DEF\u3067\u30A2\u30AF\u30BB\u30B9
|
|
100737
100749
|
const aliceRes = await calendar.requestWithDelegation(
|
|
100738
100750
|
\`/calendars/alice@example.com/events?\${qs}\`,
|
|
100739
100751
|
{ subject: "alice@example.com", scopes: READ },
|
|
100740
100752
|
);
|
|
100741
100753
|
const alice = await aliceRes.json();
|
|
100742
100754
|
|
|
100743
|
-
//
|
|
100755
|
+
// team@example.com \u306F SA \u306B\u76F4\u63A5\u5171\u6709
|
|
100744
100756
|
const teamRes = await calendar.request(
|
|
100745
100757
|
\`/calendars/team@example.com/events?\${qs}\`,
|
|
100746
100758
|
{ scopes: READ },
|
|
@@ -100924,7 +100936,9 @@ var parameters16 = {
|
|
|
100924
100936
|
|
|
100925
100937
|
// ../connectors/src/connectors/google-calendar-oauth/tools/request.ts
|
|
100926
100938
|
import { z as z27 } from "zod";
|
|
100927
|
-
var
|
|
100939
|
+
var BASE_HOST3 = "https://www.googleapis.com";
|
|
100940
|
+
var BASE_PATH_SEGMENT3 = "/calendar/v3";
|
|
100941
|
+
var BASE_URL9 = `${BASE_HOST3}${BASE_PATH_SEGMENT3}`;
|
|
100928
100942
|
var REQUEST_TIMEOUT_MS17 = 6e4;
|
|
100929
100943
|
var cachedToken10 = null;
|
|
100930
100944
|
async function getProxyToken10(config) {
|
|
@@ -101001,7 +101015,11 @@ Authentication is handled automatically via OAuth proxy.
|
|
|
101001
101015
|
try {
|
|
101002
101016
|
const calendarId = parameters16.calendarId.tryGetValue(connection) ?? "primary";
|
|
101003
101017
|
const resolvedPath = path4.replace(/\{calendarId\}/g, calendarId);
|
|
101004
|
-
|
|
101018
|
+
const normalizedPath = normalizeRequestPath(
|
|
101019
|
+
resolvedPath,
|
|
101020
|
+
BASE_PATH_SEGMENT3
|
|
101021
|
+
);
|
|
101022
|
+
let url = `${BASE_URL9}${normalizedPath}`;
|
|
101005
101023
|
if (queryParams) {
|
|
101006
101024
|
const searchParams = new URLSearchParams(queryParams);
|
|
101007
101025
|
url += `?${searchParams.toString()}`;
|
|
@@ -101237,7 +101255,9 @@ var parameters17 = {};
|
|
|
101237
101255
|
|
|
101238
101256
|
// ../connectors/src/connectors/google-docs/tools/request.ts
|
|
101239
101257
|
import { z as z28 } from "zod";
|
|
101240
|
-
var
|
|
101258
|
+
var DOCS_BASE_HOST = "https://docs.googleapis.com";
|
|
101259
|
+
var DOCS_BASE_PATH_SEGMENT = "/v1/documents";
|
|
101260
|
+
var DOCS_BASE_URL = `${DOCS_BASE_HOST}${DOCS_BASE_PATH_SEGMENT}`;
|
|
101241
101261
|
var REQUEST_TIMEOUT_MS18 = 6e4;
|
|
101242
101262
|
var cachedToken11 = null;
|
|
101243
101263
|
async function getProxyToken11(config) {
|
|
@@ -101312,7 +101332,11 @@ Authentication is handled automatically via OAuth proxy.`,
|
|
|
101312
101332
|
`[connector-request] google-docs/${connection.name}: ${method} ${path4}`
|
|
101313
101333
|
);
|
|
101314
101334
|
try {
|
|
101315
|
-
|
|
101335
|
+
const normalizedPath = normalizeRequestPath(
|
|
101336
|
+
path4,
|
|
101337
|
+
DOCS_BASE_PATH_SEGMENT
|
|
101338
|
+
);
|
|
101339
|
+
let url = `${DOCS_BASE_URL}${normalizedPath === "/" ? "" : normalizedPath}`;
|
|
101316
101340
|
if (queryParams) {
|
|
101317
101341
|
const searchParams = new URLSearchParams(queryParams);
|
|
101318
101342
|
url += `?${searchParams.toString()}`;
|
|
@@ -101531,7 +101555,9 @@ var parameters18 = {};
|
|
|
101531
101555
|
|
|
101532
101556
|
// ../connectors/src/connectors/google-drive/tools/request.ts
|
|
101533
101557
|
import { z as z29 } from "zod";
|
|
101534
|
-
var
|
|
101558
|
+
var BASE_HOST4 = "https://www.googleapis.com";
|
|
101559
|
+
var BASE_PATH_SEGMENT4 = "/drive/v3";
|
|
101560
|
+
var BASE_URL10 = `${BASE_HOST4}${BASE_PATH_SEGMENT4}`;
|
|
101535
101561
|
var REQUEST_TIMEOUT_MS19 = 6e4;
|
|
101536
101562
|
var cachedToken12 = null;
|
|
101537
101563
|
async function getProxyToken12(config) {
|
|
@@ -101606,7 +101632,8 @@ Authentication is handled automatically via OAuth proxy.`,
|
|
|
101606
101632
|
`[connector-request] google-drive/${connection.name}: ${method} ${path4}`
|
|
101607
101633
|
);
|
|
101608
101634
|
try {
|
|
101609
|
-
|
|
101635
|
+
const normalizedPath = normalizeRequestPath(path4, BASE_PATH_SEGMENT4);
|
|
101636
|
+
let url = `${BASE_URL10}${normalizedPath}`;
|
|
101610
101637
|
if (queryParams) {
|
|
101611
101638
|
const searchParams = new URLSearchParams(queryParams);
|
|
101612
101639
|
url += `?${searchParams.toString()}`;
|
|
@@ -101965,7 +101992,9 @@ await drive.updateFile("fileId123", {}, "newFolderId", "oldFolderId");
|
|
|
101965
101992
|
|
|
101966
101993
|
// ../connectors/src/connectors/google-sheets/tools/request.ts
|
|
101967
101994
|
import { z as z30 } from "zod";
|
|
101968
|
-
var
|
|
101995
|
+
var SHEETS_BASE_HOST = "https://sheets.googleapis.com";
|
|
101996
|
+
var SHEETS_BASE_PATH_SEGMENT = "/v4/spreadsheets";
|
|
101997
|
+
var SHEETS_BASE_URL = `${SHEETS_BASE_HOST}${SHEETS_BASE_PATH_SEGMENT}`;
|
|
101969
101998
|
var REQUEST_TIMEOUT_MS20 = 6e4;
|
|
101970
101999
|
var cachedToken13 = null;
|
|
101971
102000
|
async function getProxyToken13(config) {
|
|
@@ -102045,7 +102074,11 @@ Authentication is handled automatically via OAuth proxy.`,
|
|
|
102045
102074
|
`[connector-request] google-sheets/${connection.name}: ${method} ${path4}`
|
|
102046
102075
|
);
|
|
102047
102076
|
try {
|
|
102048
|
-
|
|
102077
|
+
const normalizedPath = normalizeRequestPath(
|
|
102078
|
+
path4,
|
|
102079
|
+
SHEETS_BASE_PATH_SEGMENT
|
|
102080
|
+
);
|
|
102081
|
+
let url = `${SHEETS_BASE_URL}${normalizedPath === "/" ? "" : normalizedPath}`;
|
|
102049
102082
|
if (queryParams) {
|
|
102050
102083
|
const searchParams = new URLSearchParams(queryParams);
|
|
102051
102084
|
url += `?${searchParams.toString()}`;
|
|
@@ -102336,7 +102369,9 @@ var parameters20 = {};
|
|
|
102336
102369
|
|
|
102337
102370
|
// ../connectors/src/connectors/google-slides/tools/request.ts
|
|
102338
102371
|
import { z as z31 } from "zod";
|
|
102339
|
-
var
|
|
102372
|
+
var SLIDES_BASE_HOST = "https://slides.googleapis.com";
|
|
102373
|
+
var SLIDES_BASE_PATH_SEGMENT = "/v1/presentations";
|
|
102374
|
+
var SLIDES_BASE_URL = `${SLIDES_BASE_HOST}${SLIDES_BASE_PATH_SEGMENT}`;
|
|
102340
102375
|
var REQUEST_TIMEOUT_MS21 = 6e4;
|
|
102341
102376
|
var cachedToken14 = null;
|
|
102342
102377
|
async function getProxyToken14(config) {
|
|
@@ -102411,7 +102446,11 @@ Authentication is handled automatically via OAuth proxy.`,
|
|
|
102411
102446
|
`[connector-request] google-slides/${connection.name}: ${method} ${path4}`
|
|
102412
102447
|
);
|
|
102413
102448
|
try {
|
|
102414
|
-
|
|
102449
|
+
const normalizedPath = normalizeRequestPath(
|
|
102450
|
+
path4,
|
|
102451
|
+
SLIDES_BASE_PATH_SEGMENT
|
|
102452
|
+
);
|
|
102453
|
+
let url = `${SLIDES_BASE_URL}${normalizedPath === "/" ? "" : normalizedPath}`;
|
|
102415
102454
|
if (queryParams) {
|
|
102416
102455
|
const searchParams = new URLSearchParams(queryParams);
|
|
102417
102456
|
url += `?${searchParams.toString()}`;
|
|
@@ -107577,7 +107616,9 @@ var parameters40 = {
|
|
|
107577
107616
|
|
|
107578
107617
|
// ../connectors/src/connectors/asana/tools/request.ts
|
|
107579
107618
|
import { z as z48 } from "zod";
|
|
107580
|
-
var
|
|
107619
|
+
var BASE_HOST5 = "https://app.asana.com";
|
|
107620
|
+
var BASE_PATH_SEGMENT5 = "/api/1.0";
|
|
107621
|
+
var BASE_URL19 = `${BASE_HOST5}${BASE_PATH_SEGMENT5}`;
|
|
107581
107622
|
var REQUEST_TIMEOUT_MS37 = 6e4;
|
|
107582
107623
|
var inputSchema48 = z48.object({
|
|
107583
107624
|
toolUseIntent: z48.string().optional().describe(
|
|
@@ -107641,7 +107682,8 @@ Pagination: Use limit (1-100) and offset query parameters. The response includes
|
|
|
107641
107682
|
);
|
|
107642
107683
|
try {
|
|
107643
107684
|
const token = parameters40.personalAccessToken.getValue(connection);
|
|
107644
|
-
const
|
|
107685
|
+
const normalizedPath = normalizeRequestPath(path4, BASE_PATH_SEGMENT5);
|
|
107686
|
+
const url = `${BASE_URL19}${normalizedPath}`;
|
|
107645
107687
|
const controller = new AbortController();
|
|
107646
107688
|
const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS37);
|
|
107647
107689
|
try {
|
|
@@ -110056,7 +110098,9 @@ var parameters47 = {
|
|
|
110056
110098
|
|
|
110057
110099
|
// ../connectors/src/connectors/tiktok-ads/tools/request.ts
|
|
110058
110100
|
import { z as z60 } from "zod";
|
|
110059
|
-
var
|
|
110101
|
+
var BASE_HOST6 = "https://business-api.tiktok.com";
|
|
110102
|
+
var BASE_PATH_SEGMENT6 = "/open_api/v1.3";
|
|
110103
|
+
var BASE_URL27 = `${BASE_HOST6}${BASE_PATH_SEGMENT6}`;
|
|
110060
110104
|
var REQUEST_TIMEOUT_MS45 = 6e4;
|
|
110061
110105
|
var cachedToken23 = null;
|
|
110062
110106
|
async function getProxyToken23(config) {
|
|
@@ -110132,7 +110176,8 @@ The advertiser_id is automatically injected if configured.`,
|
|
|
110132
110176
|
);
|
|
110133
110177
|
try {
|
|
110134
110178
|
const advertiserId = parameters47.advertiserId.tryGetValue(connection) ?? "";
|
|
110135
|
-
|
|
110179
|
+
const normalizedPath = normalizeRequestPath(path4, BASE_PATH_SEGMENT6);
|
|
110180
|
+
let url = `${BASE_URL27}${normalizedPath}`;
|
|
110136
110181
|
if (method === "GET") {
|
|
110137
110182
|
const params = new URLSearchParams(queryParams ?? {});
|
|
110138
110183
|
if (advertiserId && !params.has("advertiser_id")) {
|
|
@@ -111346,7 +111391,9 @@ var parameters51 = {
|
|
|
111346
111391
|
};
|
|
111347
111392
|
|
|
111348
111393
|
// ../connectors/src/connectors/gmail/tools/request-with-delegation.ts
|
|
111349
|
-
var
|
|
111394
|
+
var BASE_HOST7 = "https://gmail.googleapis.com";
|
|
111395
|
+
var BASE_PATH_SEGMENT7 = "/gmail/v1/users";
|
|
111396
|
+
var BASE_URL28 = `${BASE_HOST7}${BASE_PATH_SEGMENT7}`;
|
|
111350
111397
|
var REQUEST_TIMEOUT_MS49 = 6e4;
|
|
111351
111398
|
function decodeServiceAccount3(keyJsonBase64) {
|
|
111352
111399
|
const decoded = Buffer.from(keyJsonBase64, "base64").toString("utf-8");
|
|
@@ -111431,7 +111478,8 @@ var requestWithDelegationTool2 = new ConnectorTool({
|
|
|
111431
111478
|
serviceAccountEmail
|
|
111432
111479
|
};
|
|
111433
111480
|
}
|
|
111434
|
-
|
|
111481
|
+
const normalizedPath = normalizeRequestPath(path4, BASE_PATH_SEGMENT7);
|
|
111482
|
+
let url = `${BASE_URL28}${normalizedPath}`;
|
|
111435
111483
|
if (queryParams) {
|
|
111436
111484
|
const searchParams = new URLSearchParams(queryParams);
|
|
111437
111485
|
url += `?${searchParams.toString()}`;
|
|
@@ -111502,9 +111550,7 @@ var gmailOnboarding = new ConnectorOnboarding({
|
|
|
111502
111550
|
- \u300C\u30EA\u30C8\u30E9\u30A4\u300D: \u76F4\u524D\u306E\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u30EA\u30B9\u30C8\u3067\u30B9\u30C6\u30C3\u30D7 2 \u3092\u518D\u5B9F\u884C
|
|
111503
111551
|
- \u300C\u5165\u529B\u3057\u76F4\u3059\u300D: \u30B9\u30C6\u30C3\u30D7 1 \u304B\u3089\u518D\u5B9F\u884C
|
|
111504
111552
|
|
|
111505
|
-
4. \u5168\u30A2\u30C9\u30EC\u30B9\u304C\u6210\u529F\u3057\u305F\u3089 \`finalizeSetup\` \u3092\u547C\u3076\u3002
|
|
111506
|
-
- \`- subject: alice@example.com\`
|
|
111507
|
-
- \`- subject: bob@example.com\`
|
|
111553
|
+
4. \u5168\u30A2\u30C9\u30EC\u30B9\u304C\u6210\u529F\u3057\u305F\u3089 \`finalizeSetup\` \u3092\u547C\u3076\u3002\u691C\u8A3C\u6E08\u307F\u306E\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\uFF08\u30B9\u30C6\u30C3\u30D7 2 \u3067 \`subject\` \u3068\u3057\u3066\u4F7F\u3063\u305F\u5404 \`<email>\`\uFF09\u3092\u3053\u306E\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306E\u30B9\u30B3\u30FC\u30D7\u60C5\u5831\u3068\u3057\u3066\u8A18\u9332\u3059\u308B\u3002
|
|
111508
111554
|
|
|
111509
111555
|
#### \u5236\u7D04
|
|
111510
111556
|
- \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u4E2D\u306B\u30E1\u30C3\u30BB\u30FC\u30B8\u672C\u6587\u3092\u8AAD\u307F\u53D6\u3089\u306A\u3044\u3053\u3068\u3002\u8A31\u53EF\u3055\u308C\u3066\u3044\u308B\u306E\u306F\u30B9\u30C6\u30C3\u30D7 2 \u306E \`/me/profile\` \u78BA\u8A8D\u306E\u307F
|
|
@@ -111527,21 +111573,19 @@ var gmailOnboarding = new ConnectorOnboarding({
|
|
|
111527
111573
|
- On "retry" \u2192 re-run step 2 with the previously entered email list
|
|
111528
111574
|
- On "Re-enter" \u2192 re-run step 1
|
|
111529
111575
|
|
|
111530
|
-
4. Once every email succeeds, call \`finalizeSetup\`.
|
|
111531
|
-
- \`- subject: alice@example.com\`
|
|
111532
|
-
- \`- subject: bob@example.com\`
|
|
111576
|
+
4. Once every email succeeds, call \`finalizeSetup\`. Record the verified email addresses (the \`<email>\` values used as \`subject\` in step 2) as this connection's scope info.
|
|
111533
111577
|
|
|
111534
111578
|
#### Constraints
|
|
111535
111579
|
- Do NOT read message bodies during setup. Only the \`/me/profile\` verification is permitted
|
|
111536
111580
|
- Write at most 1 sentence between tool calls`
|
|
111537
111581
|
},
|
|
111538
111582
|
dataOverviewInstructions: {
|
|
111539
|
-
en: `Pick ONE
|
|
111583
|
+
en: `Pick ONE target user and use that user's email as \`subject\` for every call below. Pass \`scopes: ${READONLY_SCOPES2}\` every time.
|
|
111540
111584
|
|
|
111541
111585
|
1. \`method=GET\`, \`path=/me/labels\` to list labels.
|
|
111542
111586
|
2. \`method=GET\`, \`path=/me/messages?maxResults=5\` to fetch recent message IDs.
|
|
111543
111587
|
3. For each message id, \`method=GET\`, \`path=/me/messages/{id}?format=metadata\`.`,
|
|
111544
|
-
ja:
|
|
111588
|
+
ja: `\u4EE3\u7406\u5BFE\u8C61\u306E\u30E6\u30FC\u30B6\u30FC\u3092 1 \u4EBA\u9078\u3073\u3001\u4EE5\u4E0B\u306E\u30B9\u30C6\u30C3\u30D7\u3067 \`subject\` \u5F15\u6570\u3068\u3057\u3066\u4F7F\u3063\u3066\u304F\u3060\u3055\u3044\u3002\`scopes\` \u306F\u6BCE\u56DE \`${READONLY_SCOPES2}\` \u3092\u6E21\u3057\u307E\u3059\u3002
|
|
111545
111589
|
|
|
111546
111590
|
1. \`method=GET\`\u3001\`path=/me/labels\` \u3067\u30E9\u30D9\u30EB\u4E00\u89A7\u3092\u53D6\u5F97
|
|
111547
111591
|
2. \`method=GET\`\u3001\`path=/me/messages?maxResults=5\` \u3067\u6700\u8FD1\u306E\u30E1\u30C3\u30BB\u30FC\u30B8 ID \u3092\u53D6\u5F97
|
|
@@ -111564,7 +111608,7 @@ var gmailConnector = new ConnectorPlugin({
|
|
|
111564
111608
|
systemPrompt: {
|
|
111565
111609
|
en: `### Tools
|
|
111566
111610
|
|
|
111567
|
-
- \`gmail-service-account_request_with_delegation\`: Call the Gmail API on behalf of the specified Workspace user via Domain-wide Delegation. Pass \`subject\` as the target user email; the token will be issued as that user.
|
|
111611
|
+
- \`gmail-service-account_request_with_delegation\`: Call the Gmail API on behalf of the specified Workspace user via Domain-wide Delegation. Pass \`subject\` as the target user's email; the token will be issued as that user. Always pass \`scopes\`.
|
|
111568
111612
|
|
|
111569
111613
|
### OAuth Scopes (pass as \`scopes\` argument)
|
|
111570
111614
|
|
|
@@ -111628,7 +111672,7 @@ import { connection } from "@squadbase/vite-server/connectors/gmail";
|
|
|
111628
111672
|
|
|
111629
111673
|
const gmail = connection("<connectionId>");
|
|
111630
111674
|
|
|
111631
|
-
//
|
|
111675
|
+
// The user to impersonate.
|
|
111632
111676
|
const subject = "alice@example.com";
|
|
111633
111677
|
const READ = ["https://www.googleapis.com/auth/gmail.readonly"];
|
|
111634
111678
|
|
|
@@ -111657,7 +111701,7 @@ for (const msg of messages.messages ?? []) {
|
|
|
111657
111701
|
\`\`\``,
|
|
111658
111702
|
ja: `### \u30C4\u30FC\u30EB
|
|
111659
111703
|
|
|
111660
|
-
- \`gmail-service-account_request_with_delegation\`: \u6307\u5B9A\u3055\u308C\u305F Workspace \u30E6\u30FC\u30B6\u30FC\u306B\u4EE3\u308F\u3063\u3066 Domain-wide Delegation \u7D4C\u7531\u3067 Gmail API \u3092\u547C\u3073\u51FA\u3057\u307E\u3059\u3002\u4EE3\u7406\u5BFE\u8C61\u306E\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092 \`subject\` \u3068\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u30C8\u30FC\u30AF\u30F3\u306F\u305D\u306E\u30E6\u30FC\u30B6\u30FC\u3068\u3057\u3066\u767A\u884C\u3055\u308C\u307E\u3059\u3002
|
|
111704
|
+
- \`gmail-service-account_request_with_delegation\`: \u6307\u5B9A\u3055\u308C\u305F Workspace \u30E6\u30FC\u30B6\u30FC\u306B\u4EE3\u308F\u3063\u3066 Domain-wide Delegation \u7D4C\u7531\u3067 Gmail API \u3092\u547C\u3073\u51FA\u3057\u307E\u3059\u3002\u4EE3\u7406\u5BFE\u8C61\u306E\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092 \`subject\` \u3068\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u30C8\u30FC\u30AF\u30F3\u306F\u305D\u306E\u30E6\u30FC\u30B6\u30FC\u3068\u3057\u3066\u767A\u884C\u3055\u308C\u307E\u3059\u3002\`scopes\` \u3082\u6BCE\u56DE\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
|
111661
111705
|
|
|
111662
111706
|
### OAuth \u30B9\u30B3\u30FC\u30D7 (\`scopes\` \u5F15\u6570\u3067\u6E21\u3059)
|
|
111663
111707
|
|
|
@@ -111721,7 +111765,7 @@ import { connection } from "@squadbase/vite-server/connectors/gmail";
|
|
|
111721
111765
|
|
|
111722
111766
|
const gmail = connection("<connectionId>");
|
|
111723
111767
|
|
|
111724
|
-
// \u4EE3\u7406\u5BFE\u8C61\u30E6\u30FC\u30B6\u30FC
|
|
111768
|
+
// \u4EE3\u7406\u5BFE\u8C61\u30E6\u30FC\u30B6\u30FC
|
|
111725
111769
|
const subject = "alice@example.com";
|
|
111726
111770
|
const READ = ["https://www.googleapis.com/auth/gmail.readonly"];
|
|
111727
111771
|
|
|
@@ -111754,7 +111798,9 @@ for (const msg of messages.messages ?? []) {
|
|
|
111754
111798
|
|
|
111755
111799
|
// ../connectors/src/connectors/gmail-oauth/tools/request.ts
|
|
111756
111800
|
import { z as z65 } from "zod";
|
|
111757
|
-
var
|
|
111801
|
+
var BASE_HOST8 = "https://gmail.googleapis.com";
|
|
111802
|
+
var BASE_PATH_SEGMENT8 = "/gmail/v1/users";
|
|
111803
|
+
var BASE_URL29 = `${BASE_HOST8}${BASE_PATH_SEGMENT8}`;
|
|
111758
111804
|
var REQUEST_TIMEOUT_MS50 = 6e4;
|
|
111759
111805
|
var cachedToken25 = null;
|
|
111760
111806
|
async function getProxyToken25(config) {
|
|
@@ -111830,7 +111876,8 @@ All paths are relative to https://gmail.googleapis.com/gmail/v1/users. Use '/me'
|
|
|
111830
111876
|
`[connector-request] gmail-oauth/${connection.name}: ${method} ${path4}`
|
|
111831
111877
|
);
|
|
111832
111878
|
try {
|
|
111833
|
-
|
|
111879
|
+
const normalizedPath = normalizeRequestPath(path4, BASE_PATH_SEGMENT8);
|
|
111880
|
+
let url = `${BASE_URL29}${normalizedPath}`;
|
|
111834
111881
|
if (queryParams) {
|
|
111835
111882
|
const searchParams = new URLSearchParams(queryParams);
|
|
111836
111883
|
url += `?${searchParams.toString()}`;
|
|
@@ -112140,7 +112187,9 @@ var parameters53 = {
|
|
|
112140
112187
|
};
|
|
112141
112188
|
|
|
112142
112189
|
// ../connectors/src/connectors/google-audit-log/tools/request-with-delegation.ts
|
|
112143
|
-
var
|
|
112190
|
+
var BASE_HOST9 = "https://admin.googleapis.com";
|
|
112191
|
+
var BASE_PATH_SEGMENT9 = "/admin/reports/v1";
|
|
112192
|
+
var BASE_URL30 = `${BASE_HOST9}${BASE_PATH_SEGMENT9}`;
|
|
112144
112193
|
var REQUEST_TIMEOUT_MS51 = 6e4;
|
|
112145
112194
|
function decodeServiceAccount4(keyJsonBase64) {
|
|
112146
112195
|
const decoded = Buffer.from(keyJsonBase64, "base64").toString("utf-8");
|
|
@@ -112226,7 +112275,8 @@ var requestWithDelegationTool3 = new ConnectorTool({
|
|
|
112226
112275
|
serviceAccountEmail
|
|
112227
112276
|
};
|
|
112228
112277
|
}
|
|
112229
|
-
|
|
112278
|
+
const normalizedPath = normalizeRequestPath(path4, BASE_PATH_SEGMENT9);
|
|
112279
|
+
let url = `${BASE_URL30}${normalizedPath}`;
|
|
112230
112280
|
if (queryParams) {
|
|
112231
112281
|
const searchParams = new URLSearchParams(queryParams);
|
|
112232
112282
|
url += `?${searchParams.toString()}`;
|
|
@@ -112296,8 +112346,7 @@ var googleAuditLogOnboarding = new ConnectorOnboarding({
|
|
|
112296
112346
|
- \u300C\u30EA\u30C8\u30E9\u30A4\u300D: \u76F4\u524D\u306E\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u30EA\u30B9\u30C8\u3067\u30B9\u30C6\u30C3\u30D7 2 \u3092\u518D\u5B9F\u884C
|
|
112297
112347
|
- \u300C\u5165\u529B\u3057\u76F4\u3059\u300D: \u30B9\u30C6\u30C3\u30D7 1 \u304B\u3089\u518D\u5B9F\u884C
|
|
112298
112348
|
|
|
112299
|
-
4. \u5168\u30A2\u30C9\u30EC\u30B9\u304C\u6210\u529F\u3057\u305F\u3089 \`finalizeSetup\` \u3092\u547C\u3076\u3002
|
|
112300
|
-
- \`- subject: admin@example.com\`
|
|
112349
|
+
4. \u5168\u30A2\u30C9\u30EC\u30B9\u304C\u6210\u529F\u3057\u305F\u3089 \`finalizeSetup\` \u3092\u547C\u3076\u3002\u691C\u8A3C\u6E08\u307F\u306E\u7BA1\u7406\u8005\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092\u3053\u306E\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306E\u30B9\u30B3\u30FC\u30D7\u60C5\u5831\u3068\u3057\u3066\u8A18\u9332\u3059\u308B\u3002
|
|
112301
112350
|
|
|
112302
112351
|
#### \u5236\u7D04
|
|
112303
112352
|
- \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u4E2D\u306B\u53D6\u5F97\u3057\u305F\u76E3\u67FB\u30ED\u30B0\u672C\u6587\u3092\u8AAD\u307F\u53D6\u3089\u306A\u3044\u3053\u3068\u3002\u8A31\u53EF\u3055\u308C\u3066\u3044\u308B\u306E\u306F\u30B9\u30C6\u30C3\u30D7 2 \u306E\u30A2\u30AF\u30BB\u30B9\u78BA\u8A8D\u306E\u307F
|
|
@@ -112321,20 +112370,19 @@ var googleAuditLogOnboarding = new ConnectorOnboarding({
|
|
|
112321
112370
|
- On "retry" \u2192 re-run step 2 with the previously entered email list
|
|
112322
112371
|
- On "Re-enter" \u2192 re-run step 1
|
|
112323
112372
|
|
|
112324
|
-
4. Once every email succeeds, call \`finalizeSetup\`.
|
|
112325
|
-
- \`- subject: admin@example.com\`
|
|
112373
|
+
4. Once every email succeeds, call \`finalizeSetup\`. Record the verified admin email addresses as this connection's scope info.
|
|
112326
112374
|
|
|
112327
112375
|
#### Constraints
|
|
112328
112376
|
- Do NOT read audit log contents during setup. Only the access verification call in step 2 is permitted
|
|
112329
112377
|
- Write at most 1 sentence between tool calls`
|
|
112330
112378
|
},
|
|
112331
112379
|
dataOverviewInstructions: {
|
|
112332
|
-
en: `Pick ONE admin
|
|
112380
|
+
en: `Pick ONE admin user and use that user's email as \`subject\` for every call below. Pass \`scopes: ${READONLY_SCOPES3}\` every time.
|
|
112333
112381
|
|
|
112334
112382
|
1. \`method=GET\`, \`path=/activity/users/all/applications/login\`, \`queryParams={ maxResults: "10" }\` to verify recent login activity events are available.
|
|
112335
112383
|
2. \`method=GET\`, \`path=/activity/users/all/applications/admin\`, \`queryParams={ maxResults: "10" }\` to inspect recent admin console events.
|
|
112336
112384
|
3. \`method=GET\`, \`path=/usage/dates/{YYYY-MM-DD}\` (use yesterday's date) to fetch a customer-level usage report sample.`,
|
|
112337
|
-
ja:
|
|
112385
|
+
ja: `\u5BFE\u8C61\u306E\u7BA1\u7406\u8005\u30E6\u30FC\u30B6\u30FC\u3092 1 \u4EBA\u9078\u3073\u3001\u4EE5\u4E0B\u306E\u30B9\u30C6\u30C3\u30D7\u3067 \`subject\` \u5F15\u6570\u3068\u3057\u3066\u4F7F\u3063\u3066\u304F\u3060\u3055\u3044\u3002\`scopes\` \u306F\u6BCE\u56DE \`${READONLY_SCOPES3}\` \u3092\u6E21\u3057\u307E\u3059\u3002
|
|
112338
112386
|
|
|
112339
112387
|
1. \`method=GET\`\u3001\`path=/activity/users/all/applications/login\`\u3001\`queryParams={ maxResults: "10" }\` \u3067\u76F4\u8FD1\u306E\u30ED\u30B0\u30A4\u30F3\u30A2\u30AF\u30C6\u30A3\u30D3\u30C6\u30A3\u304C\u53D6\u5F97\u3067\u304D\u308B\u3053\u3068\u3092\u78BA\u8A8D
|
|
112340
112388
|
2. \`method=GET\`\u3001\`path=/activity/users/all/applications/admin\`\u3001\`queryParams={ maxResults: "10" }\` \u3067\u76F4\u8FD1\u306E\u7BA1\u7406\u30B3\u30F3\u30BD\u30FC\u30EB\u64CD\u4F5C\u3092\u78BA\u8A8D
|
|
@@ -112349,15 +112397,15 @@ var googleAuditLogConnector = new ConnectorPlugin({
|
|
|
112349
112397
|
authType: AUTH_TYPES.SERVICE_ACCOUNT,
|
|
112350
112398
|
name: "Google Audit Log",
|
|
112351
112399
|
description: "Connect to the Google Workspace Admin SDK Reports API for audit activities and usage reports using a service account with domain-wide delegation. Read-only.",
|
|
112352
|
-
iconUrl: "https://
|
|
112400
|
+
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/6VWp0bASiAEgiSlwoZOT8A/fb59a3a2d0219db7df0a943b286a5995/admin_2020q4_48dp.png",
|
|
112353
112401
|
parameters: parameters53,
|
|
112354
|
-
releaseFlag: { dev1: true, dev2:
|
|
112402
|
+
releaseFlag: { dev1: true, dev2: true, prod: true },
|
|
112355
112403
|
categories: ["observability"],
|
|
112356
112404
|
onboarding: googleAuditLogOnboarding,
|
|
112357
112405
|
systemPrompt: {
|
|
112358
112406
|
en: `### Tools
|
|
112359
112407
|
|
|
112360
|
-
- \`google-audit-log-service-account_request_with_delegation\`: Call the Google Workspace Admin SDK Reports API on behalf of a Workspace admin via Domain-wide Delegation. Pass \`subject\` as the admin email; the token will be issued as that user.
|
|
112408
|
+
- \`google-audit-log-service-account_request_with_delegation\`: Call the Google Workspace Admin SDK Reports API on behalf of a Workspace admin via Domain-wide Delegation. Pass \`subject\` as the admin email; the token will be issued as that user. Always pass \`scopes\`.
|
|
112361
112409
|
|
|
112362
112410
|
### OAuth Scopes (pass as \`scopes\` argument)
|
|
112363
112411
|
|
|
@@ -112415,7 +112463,7 @@ import { connection } from "@squadbase/vite-server/connectors/google-audit-log";
|
|
|
112415
112463
|
|
|
112416
112464
|
const reports = connection("<connectionId>");
|
|
112417
112465
|
|
|
112418
|
-
const SUBJECT = "admin@example.com"; //
|
|
112466
|
+
const SUBJECT = "admin@example.com"; // the admin user to impersonate
|
|
112419
112467
|
const AUDIT = ["https://www.googleapis.com/auth/admin.reports.audit.readonly"];
|
|
112420
112468
|
|
|
112421
112469
|
export default async function handler(c: Context) {
|
|
@@ -112446,7 +112494,7 @@ export default async function handler(c: Context) {
|
|
|
112446
112494
|
\`\`\``,
|
|
112447
112495
|
ja: `### \u30C4\u30FC\u30EB
|
|
112448
112496
|
|
|
112449
|
-
- \`google-audit-log-service-account_request_with_delegation\`: Domain-wide Delegation \u7D4C\u7531\u3067 Workspace \u7BA1\u7406\u8005\u306B\u306A\u308A\u3059\u307E\u3057\u3066 Google Workspace Admin SDK Reports API \u3092\u547C\u3073\u51FA\u3057\u307E\u3059\u3002\u4EE3\u7406\u5BFE\u8C61\u306E\u7BA1\u7406\u8005\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092 \`subject\` \u3068\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u30C8\u30FC\u30AF\u30F3\u306F\u305D\u306E\u30E6\u30FC\u30B6\u30FC\u3068\u3057\u3066\u767A\u884C\u3055\u308C\u307E\u3059\u3002
|
|
112497
|
+
- \`google-audit-log-service-account_request_with_delegation\`: Domain-wide Delegation \u7D4C\u7531\u3067 Workspace \u7BA1\u7406\u8005\u306B\u306A\u308A\u3059\u307E\u3057\u3066 Google Workspace Admin SDK Reports API \u3092\u547C\u3073\u51FA\u3057\u307E\u3059\u3002\u4EE3\u7406\u5BFE\u8C61\u306E\u7BA1\u7406\u8005\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092 \`subject\` \u3068\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u30C8\u30FC\u30AF\u30F3\u306F\u305D\u306E\u30E6\u30FC\u30B6\u30FC\u3068\u3057\u3066\u767A\u884C\u3055\u308C\u307E\u3059\u3002\`scopes\` \u3082\u6BCE\u56DE\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
|
112450
112498
|
|
|
112451
112499
|
### OAuth \u30B9\u30B3\u30FC\u30D7 (\`scopes\` \u5F15\u6570\u3067\u6E21\u3059)
|
|
112452
112500
|
|
|
@@ -112503,7 +112551,7 @@ import { connection } from "@squadbase/vite-server/connectors/google-audit-log";
|
|
|
112503
112551
|
|
|
112504
112552
|
const reports = connection("<connectionId>");
|
|
112505
112553
|
|
|
112506
|
-
const SUBJECT = "admin@example.com"; //
|
|
112554
|
+
const SUBJECT = "admin@example.com"; // \u4EE3\u7406\u5BFE\u8C61\u306E\u7BA1\u7406\u8005
|
|
112507
112555
|
const AUDIT = ["https://www.googleapis.com/auth/admin.reports.audit.readonly"];
|
|
112508
112556
|
|
|
112509
112557
|
export default async function handler(c: Context) {
|