@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.
@@ -343,6 +343,16 @@ var AUTH_TYPES = {
343
343
  USER_PASSWORD: "user-password"
344
344
  };
345
345
 
346
+ // ../connectors/src/lib/normalize-path.ts
347
+ function normalizeRequestPath(path2, basePathSegment) {
348
+ let p = path2.trim();
349
+ if (!p.startsWith("/")) p = "/" + p;
350
+ if (p === basePathSegment || p.startsWith(basePathSegment + "/")) {
351
+ p = p.slice(basePathSegment.length) || "/";
352
+ }
353
+ return p;
354
+ }
355
+
346
356
  // ../connectors/src/connectors/asana/setup.ts
347
357
  var asanaOnboarding = new ConnectorOnboarding({
348
358
  dataOverviewInstructions: {
@@ -359,7 +369,9 @@ var asanaOnboarding = new ConnectorOnboarding({
359
369
 
360
370
  // ../connectors/src/connectors/asana/tools/request.ts
361
371
  import { z } from "zod";
362
- var BASE_URL2 = "https://app.asana.com/api/1.0";
372
+ var BASE_HOST = "https://app.asana.com";
373
+ var BASE_PATH_SEGMENT = "/api/1.0";
374
+ var BASE_URL2 = `${BASE_HOST}${BASE_PATH_SEGMENT}`;
363
375
  var REQUEST_TIMEOUT_MS = 6e4;
364
376
  var inputSchema = z.object({
365
377
  toolUseIntent: z.string().optional().describe(
@@ -423,7 +435,8 @@ Pagination: Use limit (1-100) and offset query parameters. The response includes
423
435
  );
424
436
  try {
425
437
  const token = parameters.personalAccessToken.getValue(connection2);
426
- const url = `${BASE_URL2}${path2}`;
438
+ const normalizedPath = normalizeRequestPath(path2, BASE_PATH_SEGMENT);
439
+ const url = `${BASE_URL2}${normalizedPath}`;
427
440
  const controller = new AbortController();
428
441
  const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS);
429
442
  try {
@@ -29496,7 +29496,7 @@ var awsBillingConnector = new ConnectorPlugin({
29496
29496
  description: "Connect to AWS Cost Explorer to analyze AWS spend, usage, and forecast costs across services, accounts, and regions.",
29497
29497
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/6u4IRN1BNS0EVSjsWSnrq1/53721bfc097a5ff04d07c15cc5e80a0d/Amazon_Web_Services-Logo.wine.svg",
29498
29498
  parameters,
29499
- releaseFlag: { dev1: true, dev2: false, prod: false },
29499
+ releaseFlag: { dev1: true, dev2: true, prod: true },
29500
29500
  categories: ["finance"],
29501
29501
  onboarding: awsBillingOnboarding,
29502
29502
  systemPrompt: {
@@ -255,9 +255,21 @@ var AUTH_TYPES = {
255
255
  USER_PASSWORD: "user-password"
256
256
  };
257
257
 
258
+ // ../connectors/src/lib/normalize-path.ts
259
+ function normalizeRequestPath(path2, basePathSegment) {
260
+ let p = path2.trim();
261
+ if (!p.startsWith("/")) p = "/" + p;
262
+ if (p === basePathSegment || p.startsWith(basePathSegment + "/")) {
263
+ p = p.slice(basePathSegment.length) || "/";
264
+ }
265
+ return p;
266
+ }
267
+
258
268
  // ../connectors/src/connectors/gmail-oauth/tools/request.ts
259
269
  import { z } from "zod";
260
- var BASE_URL2 = "https://gmail.googleapis.com/gmail/v1/users";
270
+ var BASE_HOST = "https://gmail.googleapis.com";
271
+ var BASE_PATH_SEGMENT = "/gmail/v1/users";
272
+ var BASE_URL2 = `${BASE_HOST}${BASE_PATH_SEGMENT}`;
261
273
  var REQUEST_TIMEOUT_MS = 6e4;
262
274
  var cachedToken = null;
263
275
  async function getProxyToken(config) {
@@ -333,7 +345,8 @@ All paths are relative to https://gmail.googleapis.com/gmail/v1/users. Use '/me'
333
345
  `[connector-request] gmail-oauth/${connection2.name}: ${method} ${path2}`
334
346
  );
335
347
  try {
336
- let url = `${BASE_URL2}${path2.startsWith("/") ? "" : "/"}${path2}`;
348
+ const normalizedPath = normalizeRequestPath(path2, BASE_PATH_SEGMENT);
349
+ let url = `${BASE_URL2}${normalizedPath}`;
337
350
  if (queryParams) {
338
351
  const searchParams = new URLSearchParams(queryParams);
339
352
  url += `?${searchParams.toString()}`;
@@ -255,9 +255,21 @@ var AUTH_TYPES = {
255
255
  USER_PASSWORD: "user-password"
256
256
  };
257
257
 
258
+ // ../connectors/src/lib/normalize-path.ts
259
+ function normalizeRequestPath(path2, basePathSegment) {
260
+ let p = path2.trim();
261
+ if (!p.startsWith("/")) p = "/" + p;
262
+ if (p === basePathSegment || p.startsWith(basePathSegment + "/")) {
263
+ p = p.slice(basePathSegment.length) || "/";
264
+ }
265
+ return p;
266
+ }
267
+
258
268
  // ../connectors/src/connectors/gmail/tools/request-with-delegation.ts
259
269
  import { z } from "zod";
260
- var BASE_URL2 = "https://gmail.googleapis.com/gmail/v1/users";
270
+ var BASE_HOST = "https://gmail.googleapis.com";
271
+ var BASE_PATH_SEGMENT = "/gmail/v1/users";
272
+ var BASE_URL2 = `${BASE_HOST}${BASE_PATH_SEGMENT}`;
261
273
  var REQUEST_TIMEOUT_MS = 6e4;
262
274
  function decodeServiceAccount(keyJsonBase64) {
263
275
  const decoded = Buffer.from(keyJsonBase64, "base64").toString("utf-8");
@@ -342,7 +354,8 @@ var requestWithDelegationTool = new ConnectorTool({
342
354
  serviceAccountEmail
343
355
  };
344
356
  }
345
- let url = `${BASE_URL2}${path2.startsWith("/") ? "" : "/"}${path2}`;
357
+ const normalizedPath = normalizeRequestPath(path2, BASE_PATH_SEGMENT);
358
+ let url = `${BASE_URL2}${normalizedPath}`;
346
359
  if (queryParams) {
347
360
  const searchParams = new URLSearchParams(queryParams);
348
361
  url += `?${searchParams.toString()}`;
@@ -413,9 +426,7 @@ var gmailOnboarding = new ConnectorOnboarding({
413
426
  - \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
414
427
  - \u300C\u5165\u529B\u3057\u76F4\u3059\u300D: \u30B9\u30C6\u30C3\u30D7 1 \u304B\u3089\u518D\u5B9F\u884C
415
428
 
416
- 4. \u5168\u30A2\u30C9\u30EC\u30B9\u304C\u6210\u529F\u3057\u305F\u3089 \`finalizeSetup\` \u3092\u547C\u3076\u3002\`projectKnowledge\` \u306E \`#### \u30B9\u30B3\u30FC\u30D7\` \u7BC0\u306B\u5404\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092 1 \u884C\u305A\u3064\u5217\u6319\u3059\u308B:
417
- - \`- subject: alice@example.com\`
418
- - \`- subject: bob@example.com\`
429
+ 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
419
430
 
420
431
  #### \u5236\u7D04
421
432
  - \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
@@ -438,21 +449,19 @@ var gmailOnboarding = new ConnectorOnboarding({
438
449
  - On "retry" \u2192 re-run step 2 with the previously entered email list
439
450
  - On "Re-enter" \u2192 re-run step 1
440
451
 
441
- 4. Once every email succeeds, call \`finalizeSetup\`. Under \`#### \u30B9\u30B3\u30FC\u30D7\` in \`projectKnowledge\`, list each email on its own line:
442
- - \`- subject: alice@example.com\`
443
- - \`- subject: bob@example.com\`
452
+ 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.
444
453
 
445
454
  #### Constraints
446
455
  - Do NOT read message bodies during setup. Only the \`/me/profile\` verification is permitted
447
456
  - Write at most 1 sentence between tool calls`
448
457
  },
449
458
  dataOverviewInstructions: {
450
- en: `Pick ONE email from \`#### \u30B9\u30B3\u30FC\u30D7\` (a \`- subject: <email>\` line) and use it as \`subject\` for every call below. Pass \`scopes: ${READONLY_SCOPES}\` every time.
459
+ en: `Pick ONE target user and use that user's email as \`subject\` for every call below. Pass \`scopes: ${READONLY_SCOPES}\` every time.
451
460
 
452
461
  1. \`method=GET\`, \`path=/me/labels\` to list labels.
453
462
  2. \`method=GET\`, \`path=/me/messages?maxResults=5\` to fetch recent message IDs.
454
463
  3. For each message id, \`method=GET\`, \`path=/me/messages/{id}?format=metadata\`.`,
455
- ja: `\`#### \u30B9\u30B3\u30FC\u30D7\` \u306E \`- subject: <email>\` \u884C\u304B\u3089 1 \u3064\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_SCOPES}\` \u3092\u6E21\u3057\u307E\u3059\u3002
464
+ 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_SCOPES}\` \u3092\u6E21\u3057\u307E\u3059\u3002
456
465
 
457
466
  1. \`method=GET\`\u3001\`path=/me/labels\` \u3067\u30E9\u30D9\u30EB\u4E00\u89A7\u3092\u53D6\u5F97
458
467
  2. \`method=GET\`\u3001\`path=/me/messages?maxResults=5\` \u3067\u6700\u8FD1\u306E\u30E1\u30C3\u30BB\u30FC\u30B8 ID \u3092\u53D6\u5F97
@@ -475,7 +484,7 @@ var gmailConnector = new ConnectorPlugin({
475
484
  systemPrompt: {
476
485
  en: `### Tools
477
486
 
478
- - \`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. The set of users this connection works with is recorded in the project knowledge under "#### \u30B9\u30B3\u30FC\u30D7" as \`- subject: <email>\` lines \u2014 read those and pick a subject before calling. Always pass \`scopes\`.
487
+ - \`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\`.
479
488
 
480
489
  ### OAuth Scopes (pass as \`scopes\` argument)
481
490
 
@@ -539,7 +548,7 @@ import { connection } from "@squadbase/vite-server/connectors/gmail";
539
548
 
540
549
  const gmail = connection("<connectionId>");
541
550
 
542
- // Pick the impersonated user from project knowledge ("#### \u30B9\u30B3\u30FC\u30D7").
551
+ // The user to impersonate.
543
552
  const subject = "alice@example.com";
544
553
  const READ = ["https://www.googleapis.com/auth/gmail.readonly"];
545
554
 
@@ -568,7 +577,7 @@ for (const msg of messages.messages ?? []) {
568
577
  \`\`\``,
569
578
  ja: `### \u30C4\u30FC\u30EB
570
579
 
571
- - \`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\u3053\u306E\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u304C\u5BFE\u8C61\u3068\u3059\u308B\u30E6\u30FC\u30B6\u30FC\u306F Project Knowledge \u306E "#### \u30B9\u30B3\u30FC\u30D7" \u306B \`- subject: <email>\` \u5F62\u5F0F\u3067\u8A18\u9332\u3055\u308C\u3066\u3044\u308B\u305F\u3081\u3001\u547C\u3073\u51FA\u3057\u524D\u306B\u305D\u3053\u3092\u8AAD\u3093\u3067 subject \u3092\u6C7A\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002\`scopes\` \u3082\u6BCE\u56DE\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002
580
+ - \`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
572
581
 
573
582
  ### OAuth \u30B9\u30B3\u30FC\u30D7 (\`scopes\` \u5F15\u6570\u3067\u6E21\u3059)
574
583
 
@@ -632,7 +641,7 @@ import { connection } from "@squadbase/vite-server/connectors/gmail";
632
641
 
633
642
  const gmail = connection("<connectionId>");
634
643
 
635
- // \u4EE3\u7406\u5BFE\u8C61\u30E6\u30FC\u30B6\u30FC\u306F Project Knowledge ("#### \u30B9\u30B3\u30FC\u30D7") \u304B\u3089\u9078\u3076
644
+ // \u4EE3\u7406\u5BFE\u8C61\u30E6\u30FC\u30B6\u30FC
636
645
  const subject = "alice@example.com";
637
646
  const READ = ["https://www.googleapis.com/auth/gmail.readonly"];
638
647
 
@@ -255,9 +255,21 @@ var AUTH_TYPES = {
255
255
  USER_PASSWORD: "user-password"
256
256
  };
257
257
 
258
+ // ../connectors/src/lib/normalize-path.ts
259
+ function normalizeRequestPath(path2, basePathSegment) {
260
+ let p = path2.trim();
261
+ if (!p.startsWith("/")) p = "/" + p;
262
+ if (p === basePathSegment || p.startsWith(basePathSegment + "/")) {
263
+ p = p.slice(basePathSegment.length) || "/";
264
+ }
265
+ return p;
266
+ }
267
+
258
268
  // ../connectors/src/connectors/google-audit-log/tools/request-with-delegation.ts
259
269
  import { z } from "zod";
260
- var BASE_URL2 = "https://admin.googleapis.com/admin/reports/v1";
270
+ var BASE_HOST = "https://admin.googleapis.com";
271
+ var BASE_PATH_SEGMENT = "/admin/reports/v1";
272
+ var BASE_URL2 = `${BASE_HOST}${BASE_PATH_SEGMENT}`;
261
273
  var REQUEST_TIMEOUT_MS = 6e4;
262
274
  function decodeServiceAccount(keyJsonBase64) {
263
275
  const decoded = Buffer.from(keyJsonBase64, "base64").toString("utf-8");
@@ -343,7 +355,8 @@ var requestWithDelegationTool = new ConnectorTool({
343
355
  serviceAccountEmail
344
356
  };
345
357
  }
346
- let url = `${BASE_URL2}${path2.startsWith("/") ? "" : "/"}${path2}`;
358
+ const normalizedPath = normalizeRequestPath(path2, BASE_PATH_SEGMENT);
359
+ let url = `${BASE_URL2}${normalizedPath}`;
347
360
  if (queryParams) {
348
361
  const searchParams = new URLSearchParams(queryParams);
349
362
  url += `?${searchParams.toString()}`;
@@ -413,8 +426,7 @@ var googleAuditLogOnboarding = new ConnectorOnboarding({
413
426
  - \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
414
427
  - \u300C\u5165\u529B\u3057\u76F4\u3059\u300D: \u30B9\u30C6\u30C3\u30D7 1 \u304B\u3089\u518D\u5B9F\u884C
415
428
 
416
- 4. \u5168\u30A2\u30C9\u30EC\u30B9\u304C\u6210\u529F\u3057\u305F\u3089 \`finalizeSetup\` \u3092\u547C\u3076\u3002\`projectKnowledge\` \u306E \`#### \u30B9\u30B3\u30FC\u30D7\` \u7BC0\u306B\u5404\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092 1 \u884C\u305A\u3064\u5217\u6319\u3059\u308B:
417
- - \`- subject: admin@example.com\`
429
+ 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
418
430
 
419
431
  #### \u5236\u7D04
420
432
  - \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
@@ -438,20 +450,19 @@ var googleAuditLogOnboarding = new ConnectorOnboarding({
438
450
  - On "retry" \u2192 re-run step 2 with the previously entered email list
439
451
  - On "Re-enter" \u2192 re-run step 1
440
452
 
441
- 4. Once every email succeeds, call \`finalizeSetup\`. Under \`#### \u30B9\u30B3\u30FC\u30D7\` in \`projectKnowledge\`, list each email on its own line:
442
- - \`- subject: admin@example.com\`
453
+ 4. Once every email succeeds, call \`finalizeSetup\`. Record the verified admin email addresses as this connection's scope info.
443
454
 
444
455
  #### Constraints
445
456
  - Do NOT read audit log contents during setup. Only the access verification call in step 2 is permitted
446
457
  - Write at most 1 sentence between tool calls`
447
458
  },
448
459
  dataOverviewInstructions: {
449
- en: `Pick ONE admin email from \`#### \u30B9\u30B3\u30FC\u30D7\` (a \`- subject: <email>\` line) and use it as \`subject\` for every call below. Pass \`scopes: ${READONLY_SCOPES}\` every time.
460
+ en: `Pick ONE admin user and use that user's email as \`subject\` for every call below. Pass \`scopes: ${READONLY_SCOPES}\` every time.
450
461
 
451
462
  1. \`method=GET\`, \`path=/activity/users/all/applications/login\`, \`queryParams={ maxResults: "10" }\` to verify recent login activity events are available.
452
463
  2. \`method=GET\`, \`path=/activity/users/all/applications/admin\`, \`queryParams={ maxResults: "10" }\` to inspect recent admin console events.
453
464
  3. \`method=GET\`, \`path=/usage/dates/{YYYY-MM-DD}\` (use yesterday's date) to fetch a customer-level usage report sample.`,
454
- ja: `\`#### \u30B9\u30B3\u30FC\u30D7\` \u306E \`- subject: <email>\` \u884C\u304B\u3089 1 \u3064\u306E\u7BA1\u7406\u8005\u3092\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_SCOPES}\` \u3092\u6E21\u3057\u307E\u3059\u3002
465
+ 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_SCOPES}\` \u3092\u6E21\u3057\u307E\u3059\u3002
455
466
 
456
467
  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
457
468
  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
@@ -466,15 +477,15 @@ var googleAuditLogConnector = new ConnectorPlugin({
466
477
  authType: AUTH_TYPES.SERVICE_ACCOUNT,
467
478
  name: "Google Audit Log",
468
479
  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.",
469
- iconUrl: "https://www.gstatic.com/images/branding/product/2x/admin_2020q4_48dp.png",
480
+ iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/6VWp0bASiAEgiSlwoZOT8A/fb59a3a2d0219db7df0a943b286a5995/admin_2020q4_48dp.png",
470
481
  parameters,
471
- releaseFlag: { dev1: true, dev2: false, prod: false },
482
+ releaseFlag: { dev1: true, dev2: true, prod: true },
472
483
  categories: ["observability"],
473
484
  onboarding: googleAuditLogOnboarding,
474
485
  systemPrompt: {
475
486
  en: `### Tools
476
487
 
477
- - \`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. The set of admins this connection works with is recorded in the project knowledge under "#### \u30B9\u30B3\u30FC\u30D7" as \`- subject: <email>\` lines \u2014 read those and pick a subject before calling. Always pass \`scopes\`.
488
+ - \`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\`.
478
489
 
479
490
  ### OAuth Scopes (pass as \`scopes\` argument)
480
491
 
@@ -532,7 +543,7 @@ import { connection } from "@squadbase/vite-server/connectors/google-audit-log";
532
543
 
533
544
  const reports = connection("<connectionId>");
534
545
 
535
- const SUBJECT = "admin@example.com"; // pick from "#### \u30B9\u30B3\u30FC\u30D7" in project knowledge
546
+ const SUBJECT = "admin@example.com"; // the admin user to impersonate
536
547
  const AUDIT = ["https://www.googleapis.com/auth/admin.reports.audit.readonly"];
537
548
 
538
549
  export default async function handler(c: Context) {
@@ -563,7 +574,7 @@ export default async function handler(c: Context) {
563
574
  \`\`\``,
564
575
  ja: `### \u30C4\u30FC\u30EB
565
576
 
566
- - \`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\u3053\u306E\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u304C\u5BFE\u8C61\u3068\u3059\u308B\u7BA1\u7406\u8005\u306F Project Knowledge \u306E "#### \u30B9\u30B3\u30FC\u30D7" \u306B \`- subject: <email>\` \u5F62\u5F0F\u3067\u8A18\u9332\u3055\u308C\u3066\u3044\u308B\u305F\u3081\u3001\u547C\u3073\u51FA\u3057\u524D\u306B\u305D\u3053\u3092\u8AAD\u3093\u3067 subject \u3092\u6C7A\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002\`scopes\` \u3082\u6BCE\u56DE\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002
577
+ - \`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
567
578
 
568
579
  ### OAuth \u30B9\u30B3\u30FC\u30D7 (\`scopes\` \u5F15\u6570\u3067\u6E21\u3059)
569
580
 
@@ -620,7 +631,7 @@ import { connection } from "@squadbase/vite-server/connectors/google-audit-log";
620
631
 
621
632
  const reports = connection("<connectionId>");
622
633
 
623
- const SUBJECT = "admin@example.com"; // Project Knowledge \u306E "#### \u30B9\u30B3\u30FC\u30D7" \u304B\u3089\u9078\u3076
634
+ const SUBJECT = "admin@example.com"; // \u4EE3\u7406\u5BFE\u8C61\u306E\u7BA1\u7406\u8005
624
635
  const AUDIT = ["https://www.googleapis.com/auth/admin.reports.audit.readonly"];
625
636
 
626
637
  export default async function handler(c: Context) {
@@ -271,6 +271,16 @@ var AUTH_TYPES = {
271
271
  USER_PASSWORD: "user-password"
272
272
  };
273
273
 
274
+ // ../connectors/src/lib/normalize-path.ts
275
+ function normalizeRequestPath(path2, basePathSegment) {
276
+ let p = path2.trim();
277
+ if (!p.startsWith("/")) p = "/" + p;
278
+ if (p === basePathSegment || p.startsWith(basePathSegment + "/")) {
279
+ p = p.slice(basePathSegment.length) || "/";
280
+ }
281
+ return p;
282
+ }
283
+
274
284
  // ../connectors/src/connectors/google-calendar-oauth/tools/list-calendars.ts
275
285
  import { z } from "zod";
276
286
  var BASE_URL2 = "https://www.googleapis.com/calendar/v3";
@@ -428,7 +438,9 @@ var googleCalendarOauthOnboarding = new ConnectorOnboarding({
428
438
 
429
439
  // ../connectors/src/connectors/google-calendar-oauth/tools/request.ts
430
440
  import { z as z2 } from "zod";
431
- var BASE_URL3 = "https://www.googleapis.com/calendar/v3";
441
+ var BASE_HOST = "https://www.googleapis.com";
442
+ var BASE_PATH_SEGMENT = "/calendar/v3";
443
+ var BASE_URL3 = `${BASE_HOST}${BASE_PATH_SEGMENT}`;
432
444
  var REQUEST_TIMEOUT_MS2 = 6e4;
433
445
  var cachedToken2 = null;
434
446
  async function getProxyToken2(config) {
@@ -505,7 +517,11 @@ Authentication is handled automatically via OAuth proxy.
505
517
  try {
506
518
  const calendarId = parameters.calendarId.tryGetValue(connection2) ?? "primary";
507
519
  const resolvedPath = path2.replace(/\{calendarId\}/g, calendarId);
508
- let url = `${BASE_URL3}${resolvedPath.startsWith("/") ? "" : "/"}${resolvedPath}`;
520
+ const normalizedPath = normalizeRequestPath(
521
+ resolvedPath,
522
+ BASE_PATH_SEGMENT
523
+ );
524
+ let url = `${BASE_URL3}${normalizedPath}`;
509
525
  if (queryParams) {
510
526
  const searchParams = new URLSearchParams(queryParams);
511
527
  url += `?${searchParams.toString()}`;
@@ -278,7 +278,21 @@ var AUTH_TYPES = {
278
278
 
279
279
  // ../connectors/src/connectors/google-calendar/tools/request.ts
280
280
  import { z } from "zod";
281
- var BASE_URL2 = "https://www.googleapis.com/calendar/v3";
281
+
282
+ // ../connectors/src/lib/normalize-path.ts
283
+ function normalizeRequestPath(path2, basePathSegment) {
284
+ let p = path2.trim();
285
+ if (!p.startsWith("/")) p = "/" + p;
286
+ if (p === basePathSegment || p.startsWith(basePathSegment + "/")) {
287
+ p = p.slice(basePathSegment.length) || "/";
288
+ }
289
+ return p;
290
+ }
291
+
292
+ // ../connectors/src/connectors/google-calendar/tools/request.ts
293
+ var BASE_HOST = "https://www.googleapis.com";
294
+ var BASE_PATH_SEGMENT = "/calendar/v3";
295
+ var BASE_URL2 = `${BASE_HOST}${BASE_PATH_SEGMENT}`;
282
296
  var REQUEST_TIMEOUT_MS = 6e4;
283
297
  function decodeServiceAccount(keyJsonBase64) {
284
298
  const decoded = Buffer.from(keyJsonBase64, "base64").toString("utf-8");
@@ -357,7 +371,8 @@ var requestTool = new ConnectorTool({
357
371
  serviceAccountEmail
358
372
  };
359
373
  }
360
- let url = `${BASE_URL2}${path2.startsWith("/") ? "" : "/"}${path2}`;
374
+ const normalizedPath = normalizeRequestPath(path2, BASE_PATH_SEGMENT);
375
+ let url = `${BASE_URL2}${normalizedPath}`;
361
376
  if (queryParams) {
362
377
  const searchParams = new URLSearchParams(queryParams);
363
378
  url += `?${searchParams.toString()}`;
@@ -407,7 +422,9 @@ var requestTool = new ConnectorTool({
407
422
 
408
423
  // ../connectors/src/connectors/google-calendar/tools/request-with-delegation.ts
409
424
  import { z as z2 } from "zod";
410
- var BASE_URL3 = "https://www.googleapis.com/calendar/v3";
425
+ var BASE_HOST2 = "https://www.googleapis.com";
426
+ var BASE_PATH_SEGMENT2 = "/calendar/v3";
427
+ var BASE_URL3 = `${BASE_HOST2}${BASE_PATH_SEGMENT2}`;
411
428
  var REQUEST_TIMEOUT_MS2 = 6e4;
412
429
  function decodeServiceAccount2(keyJsonBase64) {
413
430
  const decoded = Buffer.from(keyJsonBase64, "base64").toString("utf-8");
@@ -492,7 +509,8 @@ var requestWithDelegationTool = new ConnectorTool({
492
509
  serviceAccountEmail
493
510
  };
494
511
  }
495
- let url = `${BASE_URL3}${path2.startsWith("/") ? "" : "/"}${path2}`;
512
+ const normalizedPath = normalizeRequestPath(path2, BASE_PATH_SEGMENT2);
513
+ let url = `${BASE_URL3}${normalizedPath}`;
496
514
  if (queryParams) {
497
515
  const searchParams = new URLSearchParams(queryParams);
498
516
  url += `?${searchParams.toString()}`;
@@ -615,9 +633,7 @@ var googleCalendarOnboarding = new ConnectorOnboarding({
615
633
 
616
634
  ## \u30B9\u30C6\u30C3\u30D7 4: Project Knowledge \u306B\u8A18\u9332
617
635
 
618
- \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\`projectKnowledge\` \u306E \`#### \u30B9\u30B3\u30FC\u30D7\` \u7BC0\u306B\u5404\u30AB\u30EC\u30F3\u30C0\u30FC\u3092 1 \u884C\u305A\u3064\u5217\u6319\u3059\u308B:
619
- - \u30C9\u30E1\u30A4\u30F3\u5168\u4F53\u306E\u59D4\u4EFB\u7D4C\u7531: \`- calendar: <calendarId> (delegation, subject: <subject>, name: "<\u30AB\u30EC\u30F3\u30C0\u30FC\u540D>")\`
620
- - \u30B5\u30FC\u30D3\u30B9\u30A2\u30AB\u30A6\u30F3\u30C8\u7D4C\u8DEF: \`- calendar: <calendarId> (service-account, name: "<\u30AB\u30EC\u30F3\u30C0\u30FC\u540D>")\`
636
+ \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
621
637
 
622
638
  ## \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
623
639
 
@@ -709,9 +725,7 @@ Discover calendars from each Workspace user and let the user narrow them down.
709
725
 
710
726
  ## Step 4: Record in Project Knowledge
711
727
 
712
- 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\`. Under \`#### \u30B9\u30B3\u30FC\u30D7\` in \`projectKnowledge\`, list each calendar on its own line:
713
- - Via Domain-wide Delegation: \`- calendar: <calendarId> (delegation, subject: <subject>, name: "<calendar name>")\`
714
- - Via service account: \`- calendar: <calendarId> (service-account, name: "<calendar name>")\`
728
+ 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.
715
729
 
716
730
  ## Step 5: Escalation when zero calendars are selected
717
731
 
@@ -737,18 +751,18 @@ Behavior per selection:
737
751
  - Write at most 1 sentence between tool calls`
738
752
  },
739
753
  dataOverviewInstructions: {
740
- en: `For each calendar recorded under \`#### \u30B9\u30B3\u30FC\u30D7\`, fetch metadata and a small sample of upcoming events. The annotation on each line tells you which tool to use:
741
- - \`(delegation, subject: <email>, ...)\` \u2192 \`${requestWithDelegationToolName}\` with \`subject: <email>\`
742
- - \`(service-account, ...)\` \u2192 \`${requestToolName}\`
754
+ 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:
755
+ - Calendars accessed via delegation \u2192 \`${requestWithDelegationToolName}\` with the user's email as \`subject\`
756
+ - Calendars shared directly with the service account \u2192 \`${requestToolName}\`
743
757
 
744
758
  Pass \`scopes: ${READONLY_SCOPES}\` for every call.
745
759
 
746
760
  For each calendar:
747
761
  1. \`method=GET\`, \`path=/calendars/<id>\` to fetch metadata.
748
762
  2. \`method=GET\`, \`path=/calendars/<id>/events\`, \`queryParams={ timeMin: <RFC3339 now>, maxResults: "10", singleEvents: "true", orderBy: "startTime" }\`.`,
749
- ja: `\`#### \u30B9\u30B3\u30FC\u30D7\` \u306E\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\u5404\u884C\u306E\u6CE8\u91C8\u3067\u4F7F\u7528\u3059\u308B\u30C4\u30FC\u30EB\u3092\u9078\u3073\u307E\u3059:
750
- - \`(delegation, subject: <email>, ...)\` \u2192 \`${requestWithDelegationToolName}\` \u3092 \`subject: <email>\` \u4ED8\u304D\u3067\u547C\u3076
751
- - \`(service-account, ...)\` \u2192 \`${requestToolName}\` \u3092\u547C\u3076
763
+ 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:
764
+ - 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
765
+ - service account \u306B\u76F4\u63A5\u5171\u6709\u3055\u308C\u305F\u30AB\u30EC\u30F3\u30C0\u30FC \u2192 \`${requestToolName}\` \u3092\u547C\u3076
752
766
 
753
767
  \`scopes\` \u306F\u6BCE\u56DE \`${READONLY_SCOPES}\` \u3092\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002
754
768
 
@@ -797,10 +811,10 @@ Per-endpoint scope reference: https://developers.google.com/calendar/api/auth
797
811
 
798
812
  ### Choosing the right tool
799
813
 
800
- Read \`#### \u30B9\u30B3\u30FC\u30D7\` in the project knowledge for this connection. Each calendar appears as a \`- calendar: <id> (...)\` line whose annotation tells you which tool to use:
814
+ Each calendar configured for this connection has an access path. Match the path to the tool:
801
815
 
802
- - \`(delegation, subject: <email>, name: "...")\` \u2192 use \`request_with_delegation\` and pass \`subject: <email>\`
803
- - \`(service-account, name: "...")\` \u2192 use \`request\` (no \`subject\`)
816
+ - A Workspace user's calendar accessed via Domain-wide Delegation \u2192 use \`request_with_delegation\` and pass that user's email as \`subject\`
817
+ - A calendar shared directly with the service account \u2192 use \`request\` (no \`subject\`)
804
818
 
805
819
  ### Path conventions
806
820
 
@@ -855,14 +869,14 @@ export default async function handler(c: Context) {
855
869
  orderBy: "startTime",
856
870
  });
857
871
 
858
- // Project knowledge says: alice@example.com is reachable via delegation
872
+ // alice@example.com is accessed via delegation
859
873
  const aliceRes = await calendar.requestWithDelegation(
860
874
  \`/calendars/alice@example.com/events?\${qs}\`,
861
875
  { subject: "alice@example.com", scopes: READ },
862
876
  );
863
877
  const alice = await aliceRes.json();
864
878
 
865
- // Project knowledge says: team@example.com is shared with the SA
879
+ // team@example.com is shared directly with the service account
866
880
  const teamRes = await calendar.request(
867
881
  \`/calendars/team@example.com/events?\${qs}\`,
868
882
  { scopes: READ },
@@ -895,10 +909,10 @@ export default async function handler(c: Context) {
895
909
 
896
910
  ### \u9069\u5207\u306A\u30C4\u30FC\u30EB\u306E\u9078\u3073\u65B9
897
911
 
898
- \u3053\u306E\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306E Project Knowledge \u306E \`#### \u30B9\u30B3\u30FC\u30D7\` \u3092\u8AAD\u3093\u3067\u304F\u3060\u3055\u3044\u3002\u5404\u30AB\u30EC\u30F3\u30C0\u30FC\u306F \`- calendar: <id> (...)\` \u5F62\u5F0F\u306E\u884C\u3068\u3057\u3066\u8A18\u9332\u3055\u308C\u3066\u304A\u308A\u3001\u6CE8\u91C8\u304C\u3069\u3061\u3089\u306E\u30C4\u30FC\u30EB\u3092\u4F7F\u3046\u3079\u304D\u304B\u3092\u793A\u3057\u307E\u3059:
912
+ \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:
899
913
 
900
- - \`(delegation, subject: <email>, name: "...")\` \u2192 \`request_with_delegation\` \u3092\u4F7F\u3044\u3001\`subject: <email>\` \u3092\u6E21\u3059
901
- - \`(service-account, name: "...")\` \u2192 \`request\` \u3092\u4F7F\u3046\uFF08\`subject\` \u4E0D\u8981\uFF09
914
+ - 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
915
+ - 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
902
916
 
903
917
  ### \u30D1\u30B9\u306E\u66F8\u304D\u65B9
904
918
 
@@ -953,14 +967,14 @@ export default async function handler(c: Context) {
953
967
  orderBy: "startTime",
954
968
  });
955
969
 
956
- // Project Knowledge: alice@example.com \u306F delegation \u7D4C\u8DEF\u3067\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD
970
+ // alice@example.com \u306F delegation \u7D4C\u8DEF\u3067\u30A2\u30AF\u30BB\u30B9
957
971
  const aliceRes = await calendar.requestWithDelegation(
958
972
  \`/calendars/alice@example.com/events?\${qs}\`,
959
973
  { subject: "alice@example.com", scopes: READ },
960
974
  );
961
975
  const alice = await aliceRes.json();
962
976
 
963
- // Project Knowledge: team@example.com \u306F SA \u306B\u5171\u6709\u3055\u308C\u3066\u3044\u308B
977
+ // team@example.com \u306F SA \u306B\u76F4\u63A5\u5171\u6709
964
978
  const teamRes = await calendar.request(
965
979
  \`/calendars/team@example.com/events?\${qs}\`,
966
980
  { scopes: READ },
@@ -203,6 +203,16 @@ var AUTH_TYPES = {
203
203
  USER_PASSWORD: "user-password"
204
204
  };
205
205
 
206
+ // ../connectors/src/lib/normalize-path.ts
207
+ function normalizeRequestPath(path2, basePathSegment) {
208
+ let p = path2.trim();
209
+ if (!p.startsWith("/")) p = "/" + p;
210
+ if (p === basePathSegment || p.startsWith(basePathSegment + "/")) {
211
+ p = p.slice(basePathSegment.length) || "/";
212
+ }
213
+ return p;
214
+ }
215
+
206
216
  // ../connectors/src/connectors/google-docs/setup.ts
207
217
  var googleDocsOnboarding = new ConnectorOnboarding({
208
218
  dataOverviewInstructions: {
@@ -218,7 +228,9 @@ var parameters = {};
218
228
 
219
229
  // ../connectors/src/connectors/google-docs/tools/request.ts
220
230
  import { z } from "zod";
221
- var DOCS_BASE_URL2 = "https://docs.googleapis.com/v1/documents";
231
+ var DOCS_BASE_HOST = "https://docs.googleapis.com";
232
+ var DOCS_BASE_PATH_SEGMENT = "/v1/documents";
233
+ var DOCS_BASE_URL2 = `${DOCS_BASE_HOST}${DOCS_BASE_PATH_SEGMENT}`;
222
234
  var REQUEST_TIMEOUT_MS = 6e4;
223
235
  var cachedToken = null;
224
236
  async function getProxyToken(config) {
@@ -293,7 +305,11 @@ Authentication is handled automatically via OAuth proxy.`,
293
305
  `[connector-request] google-docs/${connection2.name}: ${method} ${path2}`
294
306
  );
295
307
  try {
296
- let url = `${DOCS_BASE_URL2}${path2 === "" || path2.startsWith("/") ? "" : "/"}${path2}`;
308
+ const normalizedPath = normalizeRequestPath(
309
+ path2,
310
+ DOCS_BASE_PATH_SEGMENT
311
+ );
312
+ let url = `${DOCS_BASE_URL2}${normalizedPath === "/" ? "" : normalizedPath}`;
297
313
  if (queryParams) {
298
314
  const searchParams = new URLSearchParams(queryParams);
299
315
  url += `?${searchParams.toString()}`;
@@ -292,6 +292,16 @@ var AUTH_TYPES = {
292
292
  USER_PASSWORD: "user-password"
293
293
  };
294
294
 
295
+ // ../connectors/src/lib/normalize-path.ts
296
+ function normalizeRequestPath(path2, basePathSegment) {
297
+ let p = path2.trim();
298
+ if (!p.startsWith("/")) p = "/" + p;
299
+ if (p === basePathSegment || p.startsWith(basePathSegment + "/")) {
300
+ p = p.slice(basePathSegment.length) || "/";
301
+ }
302
+ return p;
303
+ }
304
+
295
305
  // ../connectors/src/connectors/google-drive/setup.ts
296
306
  var googleDriveOnboarding = new ConnectorOnboarding({
297
307
  dataOverviewInstructions: {
@@ -307,7 +317,9 @@ var parameters = {};
307
317
 
308
318
  // ../connectors/src/connectors/google-drive/tools/request.ts
309
319
  import { z } from "zod";
310
- var BASE_URL2 = "https://www.googleapis.com/drive/v3";
320
+ var BASE_HOST = "https://www.googleapis.com";
321
+ var BASE_PATH_SEGMENT = "/drive/v3";
322
+ var BASE_URL2 = `${BASE_HOST}${BASE_PATH_SEGMENT}`;
311
323
  var REQUEST_TIMEOUT_MS = 6e4;
312
324
  var cachedToken = null;
313
325
  async function getProxyToken(config) {
@@ -382,7 +394,8 @@ Authentication is handled automatically via OAuth proxy.`,
382
394
  `[connector-request] google-drive/${connection2.name}: ${method} ${path2}`
383
395
  );
384
396
  try {
385
- let url = `${BASE_URL2}${path2.startsWith("/") ? "" : "/"}${path2}`;
397
+ const normalizedPath = normalizeRequestPath(path2, BASE_PATH_SEGMENT);
398
+ let url = `${BASE_URL2}${normalizedPath}`;
386
399
  if (queryParams) {
387
400
  const searchParams = new URLSearchParams(queryParams);
388
401
  url += `?${searchParams.toString()}`;
@@ -273,9 +273,21 @@ var AUTH_TYPES = {
273
273
  USER_PASSWORD: "user-password"
274
274
  };
275
275
 
276
+ // ../connectors/src/lib/normalize-path.ts
277
+ function normalizeRequestPath(path2, basePathSegment) {
278
+ let p = path2.trim();
279
+ if (!p.startsWith("/")) p = "/" + p;
280
+ if (p === basePathSegment || p.startsWith(basePathSegment + "/")) {
281
+ p = p.slice(basePathSegment.length) || "/";
282
+ }
283
+ return p;
284
+ }
285
+
276
286
  // ../connectors/src/connectors/google-sheets/tools/request.ts
277
287
  import { z } from "zod";
278
- var SHEETS_BASE_URL2 = "https://sheets.googleapis.com/v4/spreadsheets";
288
+ var SHEETS_BASE_HOST = "https://sheets.googleapis.com";
289
+ var SHEETS_BASE_PATH_SEGMENT = "/v4/spreadsheets";
290
+ var SHEETS_BASE_URL2 = `${SHEETS_BASE_HOST}${SHEETS_BASE_PATH_SEGMENT}`;
279
291
  var REQUEST_TIMEOUT_MS = 6e4;
280
292
  var cachedToken = null;
281
293
  async function getProxyToken(config) {
@@ -355,7 +367,11 @@ Authentication is handled automatically via OAuth proxy.`,
355
367
  `[connector-request] google-sheets/${connection2.name}: ${method} ${path2}`
356
368
  );
357
369
  try {
358
- let url = `${SHEETS_BASE_URL2}${path2 === "" || path2.startsWith("/") ? "" : "/"}${path2}`;
370
+ const normalizedPath = normalizeRequestPath(
371
+ path2,
372
+ SHEETS_BASE_PATH_SEGMENT
373
+ );
374
+ let url = `${SHEETS_BASE_URL2}${normalizedPath === "/" ? "" : normalizedPath}`;
359
375
  if (queryParams) {
360
376
  const searchParams = new URLSearchParams(queryParams);
361
377
  url += `?${searchParams.toString()}`;