@squadbase/vite-server 0.1.7-dev.3 → 0.1.7-dev.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -72671,21 +72671,6 @@ await drive.updateFile("fileId123", {}, "newFolderId", "oldFolderId");
72671
72671
 
72672
72672
  // ../connectors/src/connectors/google-sheets/tools/request.ts
72673
72673
  import { z as z27 } from "zod";
72674
-
72675
- // ../connectors/src/connectors/google-sheets/parameters.ts
72676
- var parameters18 = {
72677
- spreadsheetId: new ParameterDefinition({
72678
- slug: "spreadsheet-id",
72679
- name: "Google Sheets Spreadsheet ID",
72680
- description: "The spreadsheet ID from the Google Sheets URL (the segment between /d/ and /edit in https://docs.google.com/spreadsheets/d/{spreadsheetId}/edit). Collected during the setup flow.",
72681
- envVarBaseKey: "GOOGLE_SHEETS_SPREADSHEET_ID",
72682
- type: "text",
72683
- secret: false,
72684
- required: true
72685
- })
72686
- };
72687
-
72688
- // ../connectors/src/connectors/google-sheets/tools/request.ts
72689
72674
  var SHEETS_BASE_URL = "https://sheets.googleapis.com/v4/spreadsheets";
72690
72675
  var REQUEST_TIMEOUT_MS17 = 6e4;
72691
72676
  var cachedToken13 = null;
@@ -72724,11 +72709,16 @@ var inputSchema27 = z27.object({
72724
72709
  "Brief description of what you intend to accomplish with this tool call"
72725
72710
  ),
72726
72711
  connectionId: z27.string().describe("ID of the Google Sheets connection to use"),
72727
- method: z27.enum(["GET"]).describe("HTTP method. Only GET is supported (read-only analysis)."),
72712
+ method: z27.enum(["GET", "POST", "PUT"]).describe(
72713
+ "HTTP method. GET for reads, PUT for values.update, POST for values.append / values:batchUpdate / values:batchGet / values:clear / values:batchClear."
72714
+ ),
72728
72715
  path: z27.string().describe(
72729
- "API path appended to https://sheets.googleapis.com/v4/spreadsheets (e.g., '/{spreadsheetId}', '/{spreadsheetId}/values/Sheet1!A1:D10'). The `{spreadsheetId}` placeholder is automatically replaced with the connection's configured spreadsheet ID."
72716
+ "API path appended to https://sheets.googleapis.com/v4/spreadsheets. The caller must provide the target spreadsheetId explicitly in the path (e.g., '/1AbCxyz...', '/1AbCxyz.../values/Sheet1!A1:D10')."
72730
72717
  ),
72731
- queryParams: z27.record(z27.string(), z27.string()).optional().describe("Query parameters to append to the URL")
72718
+ queryParams: z27.record(z27.string(), z27.string()).optional().describe("Query parameters to append to the URL"),
72719
+ body: z27.unknown().optional().describe(
72720
+ "Request body for POST/PUT. Will be JSON-serialized. Omit for GET."
72721
+ )
72732
72722
  });
72733
72723
  var outputSchema27 = z27.discriminatedUnion("success", [
72734
72724
  z27.object({
@@ -72743,12 +72733,13 @@ var outputSchema27 = z27.discriminatedUnion("success", [
72743
72733
  ]);
72744
72734
  var requestTool9 = new ConnectorTool({
72745
72735
  name: "request",
72746
- description: `Send authenticated GET requests to the Google Sheets API v4 for read-only analysis.
72747
- The \`{spreadsheetId}\` placeholder in the path is automatically replaced with the connection's configured spreadsheet ID.
72736
+ description: `Send authenticated requests to the Google Sheets API v4.
72737
+ Supports GET (read) and POST/PUT (write: update/append/batchUpdate/clear).
72738
+ The caller must include the target spreadsheetId in the path explicitly.
72748
72739
  Authentication is handled automatically via OAuth proxy.`,
72749
72740
  inputSchema: inputSchema27,
72750
72741
  outputSchema: outputSchema27,
72751
- async execute({ connectionId, method, path: path5, queryParams }, connections, config) {
72742
+ async execute({ connectionId, method, path: path5, queryParams, body }, connections, config) {
72752
72743
  const connection2 = connections.find((c6) => c6.id === connectionId);
72753
72744
  if (!connection2) {
72754
72745
  return {
@@ -72760,15 +72751,7 @@ Authentication is handled automatically via OAuth proxy.`,
72760
72751
  `[connector-request] google-sheets/${connection2.name}: ${method} ${path5}`
72761
72752
  );
72762
72753
  try {
72763
- const spreadsheetId = parameters18.spreadsheetId.tryGetValue(connection2);
72764
- if (!spreadsheetId) {
72765
- return {
72766
- success: false,
72767
- error: `Spreadsheet ID is not configured for connection "${connection2.name}". Ask the user for a Google Sheets URL and save it with updateConnectionParameters (parameterSlug: "spreadsheet-id") before calling this tool.`
72768
- };
72769
- }
72770
- const resolvedPath = path5.replace(/\{spreadsheetId\}/g, spreadsheetId);
72771
- let url = `${SHEETS_BASE_URL}${resolvedPath === "" || resolvedPath.startsWith("/") ? "" : "/"}${resolvedPath}`;
72754
+ let url = `${SHEETS_BASE_URL}${path5 === "" || path5.startsWith("/") ? "" : "/"}${path5}`;
72772
72755
  if (queryParams) {
72773
72756
  const searchParams = new URLSearchParams(queryParams);
72774
72757
  url += `?${searchParams.toString()}`;
@@ -72778,16 +72761,17 @@ Authentication is handled automatically via OAuth proxy.`,
72778
72761
  const controller = new AbortController();
72779
72762
  const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS17);
72780
72763
  try {
72764
+ const proxyBody = { url, method };
72765
+ if (body !== void 0 && method !== "GET") {
72766
+ proxyBody.body = body;
72767
+ }
72781
72768
  const response = await fetch(proxyUrl, {
72782
72769
  method: "POST",
72783
72770
  headers: {
72784
72771
  "Content-Type": "application/json",
72785
72772
  Authorization: `Bearer ${token}`
72786
72773
  },
72787
- body: JSON.stringify({
72788
- url,
72789
- method
72790
- }),
72774
+ body: JSON.stringify(proxyBody),
72791
72775
  signal: controller.signal
72792
72776
  });
72793
72777
  const data = await response.json();
@@ -72810,66 +72794,73 @@ Authentication is handled automatically via OAuth proxy.`,
72810
72794
  var requestToolName = `google-sheets-oauth_${requestTool9.name}`;
72811
72795
  var googleSheetsOnboarding = new ConnectorOnboarding({
72812
72796
  connectionSetupInstructions: {
72813
- ja: `\u4EE5\u4E0B\u306E\u624B\u9806\u3067Google Sheets (OAuth) \u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306E\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3092\u884C\u3063\u3066\u304F\u3060\u3055\u3044\u3002\u5206\u6790\u5BFE\u8C61\u306E\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u306F\u30E6\u30FC\u30B6\u30FC\u304B\u3089\u53D7\u3051\u53D6\u3063\u305FURL\u3067\u6307\u5B9A\u3057\u307E\u3059\uFF08\u65B0\u3057\u3044\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u306F\u4F5C\u6210\u3057\u307E\u305B\u3093\uFF09\u3002
72797
+ ja: `\u4EE5\u4E0B\u306E\u624B\u9806\u3067Google Sheets (OAuth) \u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306E\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3092\u884C\u3063\u3066\u304F\u3060\u3055\u3044\u3002\u3053\u306E\u30B3\u30CD\u30AF\u30BF\u306F\u8AAD\u307F\u66F8\u304D\u53EF\u80FD\u306A\u30B9\u30B3\u30FC\u30D7 (\`spreadsheets\`) \u3067\u63A5\u7D9A\u3055\u308C\u3001OAuth\u8A8D\u8A3C\u3057\u305FGoogle\u30A2\u30AB\u30A6\u30F3\u30C8\u304C\u6A29\u9650\u3092\u6301\u3064\u4EFB\u610F\u306E\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u306B\u5BFE\u3057\u3066\u8AAD\u307F\u66F8\u304D\u3067\u304D\u307E\u3059\u3002
72814
72798
 
72815
- 1. \`askUserQuestion\` \u3067\u5206\u6790\u5BFE\u8C61\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u306EURL\u3092\u30D2\u30A2\u30EA\u30F3\u30B0\u3059\u308B:
72799
+ 1. \`askUserQuestion\` \u3067\u64CD\u4F5C\u5BFE\u8C61\u306E\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8URL\u3092\u30D2\u30A2\u30EA\u30F3\u30B0\u3059\u308B:
72816
72800
  - \`type\`: \`"freeText"\`
72817
- - \`question\`: \u300C\u5206\u6790\u3057\u305F\u3044Google Sheets\u306EURL\u3092\u8CBC\u308A\u4ED8\u3051\u3066\u304F\u3060\u3055\u3044\u300D
72801
+ - \`question\`: \u300C\u64CD\u4F5C\u3057\u305F\u3044Google Sheets\u306EURL\u3092\u8CBC\u308A\u4ED8\u3051\u3066\u304F\u3060\u3055\u3044\uFF08\u8AAD\u307F\u53D6\u308A\u30FB\u7DE8\u96C6\u3069\u3061\u3089\u3082\u53EF\u80FD\u3067\u3059\uFF09\u300D
72818
72802
  - \`placeholder\`: \`"https://docs.google.com/spreadsheets/d/.../edit"\`
72819
72803
  2. \u53D7\u3051\u53D6\u3063\u305FURL\u304B\u3089\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8ID\u3092\u62BD\u51FA\u3059\u308B\u3002URL\u306E \`/d/\` \u3068 \`/edit\`\uFF08\u307E\u305F\u306F\u672B\u5C3E\uFF09\u306E\u9593\u306B\u3042\u308B\u6587\u5B57\u5217\u304C\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8ID\u3067\u3059\uFF08\u4F8B: \`https://docs.google.com/spreadsheets/d/1AbCxyz.../edit\` \u2192 \`1AbCxyz...\`\uFF09\u3002URL\u3067\u306F\u306A\u304FID\u3060\u3051\u304C\u6E21\u3055\u308C\u305F\u5834\u5408\u306F\u305D\u306E\u307E\u307E\u5229\u7528\u3057\u307E\u3059\u3002
72820
- 3. \u62BD\u51FA\u3057\u305FID\u3092 \`updateConnectionParameters\` \u3067\u4FDD\u5B58\u3059\u308B:
72821
- - \`parameterSlug\`: \`"spreadsheet-id"\`
72822
- - \`options\`: \`[{ value: <\u62BD\u51FA\u3057\u305FID>, label: <\u540C\u3058\u5024> }]\`\uFF081\u4EF6\u306E\u307F\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u81EA\u52D5\u9078\u629E\u3055\u308C\u308B\uFF09
72823
- 4. \`${requestToolName}\` \u3067\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u306B\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3059\u308B:
72804
+ 3. \`${requestToolName}\` \u3067\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u6027\u3092\u78BA\u8A8D\u3059\u308B:
72824
72805
  - \`method\`: \`"GET"\`
72825
- - \`path\`: \`"/{spreadsheetId}"\`\uFF08\`{spreadsheetId}\` \u306F\u30D7\u30EC\u30FC\u30B9\u30DB\u30EB\u30C0\u3002\u305D\u306E\u307E\u307E\u6E21\u305B\u3070\u4FDD\u5B58\u6E08\u307FID\u306B\u81EA\u52D5\u7F6E\u63DB\u3055\u308C\u307E\u3059\uFF09
72826
- 5. **\u691C\u8A3C\u5931\u6557\u6642\u306E\u518D\u30D2\u30A2\u30EA\u30F3\u30B0**: \u30B9\u30C6\u30C3\u30D74\u304C \`success: false\` \u3092\u8FD4\u3057\u305F\u5834\u5408\uFF08404/403/\u898B\u3064\u304B\u3089\u306A\u3044\u7B49\u3001\u3069\u3093\u306A\u30A8\u30E9\u30FC\u3067\u3082\uFF09\u3001\u4EE5\u4E0B\u306E\u624B\u9806\u3067\u518D\u8A66\u884C\u3059\u308B:
72827
- a. \u30E6\u30FC\u30B6\u30FC\u306B\u539F\u56E0\u306E\u53EF\u80FD\u6027\u3092\u4F1D\u3048\u308B\uFF08\u4F8B: URL\u304C\u9593\u9055\u3063\u3066\u3044\u308B\u3001OAuth\u9023\u643A\u3057\u305FGoogle\u30A2\u30AB\u30A6\u30F3\u30C8\u306B\u95B2\u89A7\u6A29\u9650\u304C\u306A\u3044\u3001\u30D7\u30E9\u30A4\u30D9\u30FC\u30C8\u30B7\u30FC\u30C8\u3067\u5225\u30A2\u30AB\u30A6\u30F3\u30C8\u3068\u5171\u6709\u3055\u308C\u3066\u3044\u308B\uFF09
72828
- b. \`askUserQuestion\` \u3067\u3082\u3046\u4E00\u5EA6URL\u3092\u805E\u304D\u76F4\u3059\uFF08\`type: "freeText"\`\u3001\`question: \u300C\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u3082\u3046\u4E00\u5EA6URL\u3092\u8CBC\u308A\u4ED8\u3051\u3066\u3044\u305F\u3060\u304F\u304B\u3001\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u306E\u5171\u6709\u8A2D\u5B9A\u3092\u3054\u78BA\u8A8D\u304F\u3060\u3055\u3044\u300D\`\uFF09
72829
- c. \u65B0\u3057\u304F\u53D7\u3051\u53D6\u3063\u305FURL\u304B\u3089ID\u3092\u62BD\u51FA\u3057 \`updateConnectionParameters\` \u3067\u4E0A\u66F8\u304D\u4FDD\u5B58\u3001\u518D\u5EA6 \`${requestToolName}\` \u3067\u691C\u8A3C
72830
- d. \u6210\u529F\u3059\u308B\u307E\u3067\uFF08\u307E\u305F\u306F\u30E6\u30FC\u30B6\u30FC\u304C\u4E2D\u65AD\u3059\u308B\u307E\u3067\uFF09\u3053\u306E\u30EB\u30FC\u30D7\u3092\u7E70\u308A\u8FD4\u3059\u3002\u540C\u3058ID\u304C\u518D\u5EA6\u5931\u6557\u3059\u308B\u5834\u5408\u306F\u5171\u6709\u8A2D\u5B9A\u306E\u554F\u984C\u306A\u306E\u3067\u30E6\u30FC\u30B6\u30FC\u306B\u305D\u306E\u65E8\u3092\u4F1D\u3048\u3066\u5224\u65AD\u3092\u4EF0\u3050
72806
+ - \`path\`: \`"/<\u62BD\u51FA\u3057\u305FspreadsheetId>"\`
72807
+ 4. **\u691C\u8A3C\u5931\u6557\u6642\u306E\u518D\u30D2\u30A2\u30EA\u30F3\u30B0**: \u30B9\u30C6\u30C3\u30D73\u304C \`success: false\` \u3092\u8FD4\u3057\u305F\u5834\u5408\uFF08404/403/\u898B\u3064\u304B\u3089\u306A\u3044\u7B49\uFF09\u3001\u4EE5\u4E0B\u306E\u624B\u9806\u3067\u518D\u8A66\u884C\u3059\u308B:
72808
+ a. \u30E6\u30FC\u30B6\u30FC\u306B\u539F\u56E0\u306E\u53EF\u80FD\u6027\u3092\u4F1D\u3048\u308B\uFF08URL\u304C\u9593\u9055\u3063\u3066\u3044\u308B\u3001OAuth\u9023\u643A\u3057\u305FGoogle\u30A2\u30AB\u30A6\u30F3\u30C8\u306B\u30A2\u30AF\u30BB\u30B9\u6A29\u9650\u304C\u306A\u3044\u3001\u30D7\u30E9\u30A4\u30D9\u30FC\u30C8\u30B7\u30FC\u30C8\u3067\u5225\u30A2\u30AB\u30A6\u30F3\u30C8\u3068\u5171\u6709\u3055\u308C\u3066\u3044\u308B \u7B49\uFF09
72809
+ b. \`askUserQuestion\` \u3067\u3082\u3046\u4E00\u5EA6URL\u3092\u805E\u304D\u76F4\u3057\u3001\u518D\u5EA6 \`${requestToolName}\` \u3067\u691C\u8A3C
72810
+ c. \u6210\u529F\u3059\u308B\u307E\u3067\uFF08\u307E\u305F\u306F\u30E6\u30FC\u30B6\u30FC\u304C\u4E2D\u65AD\u3059\u308B\u307E\u3067\uFF09\u3053\u306E\u30EB\u30FC\u30D7\u3092\u7E70\u308A\u8FD4\u3059
72831
72811
 
72832
72812
  #### \u5236\u7D04
72833
- - **\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u4E2D\u306B\u30BB\u30EB\u5024\u3092\u5927\u91CF\u306B\u53D6\u5F97\u3057\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\u306E\u307F
72813
+ - **\u63A5\u7D9A\u8A2D\u5B9A\u4E2D\u306F\u5927\u91CF\u306E\u30BB\u30EB\u5024\u3092\u53D6\u5F97\u3057\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\u306E\u307F
72814
+ - **\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8ID\u3092\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u30D1\u30E9\u30E1\u30FC\u30BF\u3068\u3057\u3066\u4FDD\u5B58\u3057\u306A\u3044**\u3002\u30CF\u30F3\u30C9\u30E9\u5074\u306E\u30B3\u30FC\u30C9\uFF08\`server-logic\`\uFF09\u306B\u5BFE\u8C61\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8ID\u3092\u76F4\u63A5\u6E21\u3059\u8A2D\u8A08\u306B\u306A\u3063\u3066\u3044\u308B\u305F\u3081\u3001\`updateConnectionParameters\` \u306F\u547C\u3070\u306A\u3044\u3053\u3068
72834
72815
  - \u30C4\u30FC\u30EB\u9593\u306F1\u6587\u3060\u3051\u66F8\u3044\u3066\u5373\u6B21\u306E\u30C4\u30FC\u30EB\u547C\u3073\u51FA\u3057\u3002\u4E0D\u8981\u306A\u8AAC\u660E\u306F\u7701\u7565\u3057\u3001\u52B9\u7387\u7684\u306B\u9032\u3081\u308B`,
72835
- en: `Follow these steps to set up the Google Sheets (OAuth) connection. The spreadsheet to analyze is specified by the URL provided by the user (no new spreadsheet is created).
72816
+ en: `Follow these steps to set up the Google Sheets (OAuth) connection. This connector uses the read/write \`spreadsheets\` scope, so it can read and edit any spreadsheet the authenticated Google account has access to.
72836
72817
 
72837
- 1. Call \`askUserQuestion\` to ask for the spreadsheet URL to analyze:
72818
+ 1. Call \`askUserQuestion\` to ask for the spreadsheet URL the user wants to work with:
72838
72819
  - \`type\`: \`"freeText"\`
72839
- - \`question\`: "Please paste the URL of the Google Sheet you want to analyze"
72820
+ - \`question\`: "Please paste the URL of the Google Sheet you want to work with (both read and edit are supported)."
72840
72821
  - \`placeholder\`: \`"https://docs.google.com/spreadsheets/d/.../edit"\`
72841
72822
  2. Extract the spreadsheet ID from the URL. It is the segment between \`/d/\` and \`/edit\` (or the end of the URL), e.g. \`https://docs.google.com/spreadsheets/d/1AbCxyz.../edit\` \u2192 \`1AbCxyz...\`. If the user pasted just the ID, use it as-is.
72842
- 3. Save the extracted ID via \`updateConnectionParameters\`:
72843
- - \`parameterSlug\`: \`"spreadsheet-id"\`
72844
- - \`options\`: \`[{ value: <extracted ID>, label: <same value> }]\` (a single option is auto-selected)
72845
- 4. Verify access by calling \`${requestToolName}\`:
72823
+ 3. Verify accessibility by calling \`${requestToolName}\`:
72846
72824
  - \`method\`: \`"GET"\`
72847
- - \`path\`: \`"/{spreadsheetId}"\` (the \`{spreadsheetId}\` placeholder is auto-replaced with the saved ID \u2014 pass it as-is)
72848
- 5. **Retry on verification failure**: If step 4 returns \`success: false\` (404/403/not found or any other error):
72849
- a. Tell the user the likely causes (wrong URL, OAuth-connected Google account lacks read access, private sheet shared with a different account, etc.)
72850
- b. Call \`askUserQuestion\` to re-ask for the URL (\`type: "freeText"\`, \`question: "I could not access that sheet. Please paste the URL again, or verify the share settings of the spreadsheet."\`)
72851
- c. Extract the ID from the new URL, overwrite it via \`updateConnectionParameters\`, and re-verify with \`${requestToolName}\`
72852
- d. Repeat until verification succeeds (or the user aborts). If the same ID keeps failing, it is a sharing/permissions issue \u2014 inform the user and ask how to proceed
72825
+ - \`path\`: \`"/<extracted spreadsheetId>"\`
72826
+ 4. **Retry on verification failure**: If step 3 returns \`success: false\` (404/403/not found or any other error):
72827
+ a. Tell the user the likely causes (wrong URL, OAuth-connected Google account lacks access, private sheet shared with a different account, etc.)
72828
+ b. Call \`askUserQuestion\` again to re-ask for the URL and re-verify with \`${requestToolName}\`
72829
+ c. Repeat until verification succeeds (or the user aborts)
72853
72830
 
72854
72831
  #### Constraints
72855
- - **Do NOT read large amounts of cell data during setup**. Only the metadata request specified above is allowed
72856
- - Write only 1 sentence between tool calls, then immediately call the next tool. Skip unnecessary explanations and proceed efficiently`
72832
+ - **Do NOT fetch large amounts of cell data during setup**. Only the metadata request specified above is allowed.
72833
+ - **Do NOT persist the spreadsheet ID as a connection parameter.** The handler-side code (\`server-logic\`) is designed to receive the target spreadsheet ID directly, so do NOT call \`updateConnectionParameters\`.
72834
+ - Write only 1 sentence between tool calls, then immediately call the next tool. Skip unnecessary explanations and proceed efficiently.`
72857
72835
  },
72858
72836
  dataOverviewInstructions: {
72859
- en: `1. Call ${requestToolName} with GET /{spreadsheetId} to fetch spreadsheet metadata (sheet names, grid properties)
72860
- 2. For each sheet of interest, call ${requestToolName} with GET /{spreadsheetId}/values/{SheetName}!A1:Z5 to sample the first rows and understand the column layout`,
72861
- ja: `1. ${requestToolName} \u3067 GET /{spreadsheetId} \u3092\u547C\u3073\u51FA\u3057\u3001\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u306E\u30E1\u30BF\u30C7\u30FC\u30BF\uFF08\u30B7\u30FC\u30C8\u540D\u3001\u30B0\u30EA\u30C3\u30C9\u30D7\u30ED\u30D1\u30C6\u30A3\uFF09\u3092\u53D6\u5F97
72862
- 2. \u4E3B\u8981\u306A\u30B7\u30FC\u30C8\u306B\u3064\u3044\u3066 ${requestToolName} \u3067 GET /{spreadsheetId}/values/{\u30B7\u30FC\u30C8\u540D}!A1:Z5 \u3092\u547C\u3073\u51FA\u3057\u3001\u5148\u982D\u6570\u884C\u3092\u30B5\u30F3\u30D7\u30EA\u30F3\u30B0\u3057\u3066\u30AB\u30E9\u30E0\u69CB\u9020\u3092\u628A\u63E1`
72837
+ en: `1. Call ${requestToolName} with GET /<spreadsheetId> to fetch spreadsheet metadata (sheet names, grid properties)
72838
+ 2. For each sheet of interest, call ${requestToolName} with GET /<spreadsheetId>/values/<SheetName>!A1:Z5 to sample the first rows and understand the column layout`,
72839
+ ja: `1. ${requestToolName} \u3067 GET /<spreadsheetId> \u3092\u547C\u3073\u51FA\u3057\u3001\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u306E\u30E1\u30BF\u30C7\u30FC\u30BF\uFF08\u30B7\u30FC\u30C8\u540D\u3001\u30B0\u30EA\u30C3\u30C9\u30D7\u30ED\u30D1\u30C6\u30A3\uFF09\u3092\u53D6\u5F97
72840
+ 2. \u4E3B\u8981\u306A\u30B7\u30FC\u30C8\u306B\u3064\u3044\u3066 ${requestToolName} \u3067 GET /<spreadsheetId>/values/<\u30B7\u30FC\u30C8\u540D>!A1:Z5 \u3092\u547C\u3073\u51FA\u3057\u3001\u5148\u982D\u6570\u884C\u3092\u30B5\u30F3\u30D7\u30EA\u30F3\u30B0\u3057\u3066\u30AB\u30E9\u30E0\u69CB\u9020\u3092\u628A\u63E1`
72863
72841
  }
72864
72842
  });
72865
72843
 
72844
+ // ../connectors/src/connectors/google-sheets/parameters.ts
72845
+ var parameters18 = {
72846
+ spreadsheetId: new ParameterDefinition({
72847
+ slug: "spreadsheet-id",
72848
+ name: "Google Sheets Spreadsheet ID",
72849
+ description: "The spreadsheet ID from the Google Sheets URL (the segment between /d/ and /edit in https://docs.google.com/spreadsheets/d/{spreadsheetId}/edit). Collected during the setup flow.",
72850
+ envVarBaseKey: "GOOGLE_SHEETS_SPREADSHEET_ID",
72851
+ type: "text",
72852
+ secret: false,
72853
+ required: false
72854
+ })
72855
+ };
72856
+
72866
72857
  // ../connectors/src/connectors/google-sheets/index.ts
72867
72858
  var tools18 = { request: requestTool9 };
72868
72859
  var googleSheetsConnector = new ConnectorPlugin({
72869
72860
  slug: "google-sheets",
72870
72861
  authType: AUTH_TYPES.OAUTH,
72871
72862
  name: "Google Sheets",
72872
- description: "Connect to an existing Google Sheets spreadsheet for read-only data analysis using OAuth.",
72863
+ description: "Connect to Google Sheets for read/write access via OAuth. Any spreadsheet the authenticated Google account can access is supported \u2014 the target spreadsheetId is passed per call.",
72873
72864
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/1UPQuggyiZmbb26CuaSr2h/032770e8739b183fa00b7625f024e536/google-sheets.svg",
72874
72865
  parameters: parameters18,
72875
72866
  releaseFlag: { dev1: true, dev2: false, prod: false },
@@ -72878,25 +72869,33 @@ var googleSheetsConnector = new ConnectorPlugin({
72878
72869
  allowlist: [
72879
72870
  {
72880
72871
  host: "sheets.googleapis.com",
72881
- methods: ["GET"]
72872
+ methods: ["GET", "POST", "PUT"]
72882
72873
  }
72883
72874
  ]
72884
72875
  },
72885
72876
  systemPrompt: {
72886
72877
  en: `### Tools (setup-time only)
72887
72878
 
72888
- - \`google-sheets-oauth_request\`: Call the Google Sheets API during setup / data overview. Read-only (GET only). Use it to fetch spreadsheet metadata and sample cell values. The \`{spreadsheetId}\` placeholder in the path is automatically replaced with the spreadsheet configured at setup time. Authentication is configured automatically via OAuth.
72879
+ - \`google-sheets-oauth_request\`: Call the Google Sheets API during setup / data overview. Supports GET, POST, and PUT. The caller must include the target spreadsheetId in the path explicitly (e.g., \`/1AbCxyz...\`, \`/1AbCxyz.../values/Sheet1!A1:D10\`). Authentication is configured automatically via OAuth.
72889
72880
 
72890
- > **Important**: The \`google-sheets-oauth_request\` tool is only available at setup time. Inside server-logic handlers, use the SDK (\`connection(id).getValues\`, etc.) \u2014 the SDK's fetch is already wired through the OAuth proxy. **Do NOT** hand-roll HTTP calls to \`_sqcore/connections/*/request\` from a handler.
72881
+ > **Important**: The \`google-sheets-oauth_request\` tool is only available at setup time. Inside server-logic handlers, use the SDK (\`connection(id).getValues(spreadsheetId, range)\`, etc.) \u2014 the SDK's fetch is already wired through the OAuth proxy. **Do NOT** hand-roll HTTP calls to \`_sqcore/connections/*/request\` from a handler.
72891
72882
 
72892
- > **Connection scope**: Each connection is bound to a single spreadsheet selected at setup time via URL. This connector does NOT create new spreadsheets and does NOT write to spreadsheets. The OAuth scope is \`spreadsheets.readonly\`.
72883
+ > **Connection scope**: The OAuth scope is \`spreadsheets\` (read/write). A connection is NOT bound to a single spreadsheet \u2014 the target spreadsheetId is passed per call. The spreadsheetId is NOT stored as a connection parameter or environment variable; pass it explicitly from the caller (e.g., as a query param or request input to the handler).
72893
72884
 
72894
- ### Google Sheets API Reference (read-only)
72885
+ ### Google Sheets API Reference
72895
72886
 
72887
+ Reads:
72896
72888
  - GET \`/{spreadsheetId}\` \u2014 Get spreadsheet metadata (title, sheets, properties)
72897
72889
  - GET \`/{spreadsheetId}/values/{range}\` \u2014 Get cell values for a range
72898
72890
  - GET \`/{spreadsheetId}/values:batchGet?ranges={range1}&ranges={range2}\` \u2014 Get values for multiple ranges
72899
72891
 
72892
+ Writes:
72893
+ - PUT \`/{spreadsheetId}/values/{range}?valueInputOption=USER_ENTERED\` \u2014 Overwrite a range (body: \`{ range, majorDimension, values }\`)
72894
+ - POST \`/{spreadsheetId}/values/{range}:append?valueInputOption=USER_ENTERED\` \u2014 Append rows after the existing data
72895
+ - POST \`/{spreadsheetId}/values/{range}:clear\` \u2014 Clear values in a range
72896
+ - POST \`/{spreadsheetId}/values:batchUpdate\` \u2014 Batch update / batch clear
72897
+ - POST \`/{spreadsheetId}:batchUpdate\` \u2014 Structural edits (addSheet, deleteSheet, updateCells, formatting, \u2026)
72898
+
72900
72899
  ### Range Notation (A1 notation)
72901
72900
  - \`Sheet1!A1:D10\` \u2014 Specific range on Sheet1
72902
72901
  - \`Sheet1!A:A\` \u2014 Entire column A on Sheet1
@@ -72906,20 +72905,24 @@ var googleSheetsConnector = new ConnectorPlugin({
72906
72905
 
72907
72906
  ### Tips
72908
72907
  - To explore a spreadsheet, first get metadata to see available sheet names
72908
+ - Use \`valueInputOption=USER_ENTERED\` to parse formulas/dates like the UI; use \`RAW\` to store inputs literally
72909
72909
  - Use \`valueRenderOption=FORMATTED_VALUE\` query param to get display values
72910
72910
  - Use \`valueRenderOption=UNFORMATTED_VALUE\` for raw numeric values
72911
72911
  - Use \`majorDimension=COLUMNS\` to get data organized by columns instead of rows
72912
72912
 
72913
72913
  ### Business Logic
72914
72914
 
72915
- The business logic type for this connector is "typescript". Write handler code using the connector SDK shown below. Do NOT access credentials directly from environment variables and do NOT read \`INTERNAL_SQUADBASE_*\` env vars \u2014 the SDK takes care of OAuth. The spreadsheet ID is bound to the connection at setup time; do NOT ask handler callers to pass it.
72915
+ The business logic type for this connector is "typescript". Write handler code using the connector SDK shown below. Do NOT access credentials directly from environment variables and do NOT read \`INTERNAL_SQUADBASE_*\` env vars \u2014 the SDK takes care of OAuth. The target spreadsheetId is NOT stored on the connection \u2014 the handler caller must pass it (as part of the request input).
72916
72916
 
72917
72917
  SDK surface (client created via \`connection(connectionId)\`):
72918
- - \`client.spreadsheetId\` \u2014 the spreadsheet ID configured for this connection.
72919
- - \`client.request(path, init?)\` \u2014 low-level authenticated fetch (\`path\` is appended to \`https://sheets.googleapis.com/v4/spreadsheets\`; \`{spreadsheetId}\` is auto-replaced).
72920
- - \`client.getSpreadsheet()\` \u2014 fetch spreadsheet metadata for the configured spreadsheet.
72921
- - \`client.getValues(range)\` \u2014 read a range (A1 notation) from the configured spreadsheet.
72922
- - \`client.batchGetValues(ranges)\` \u2014 read multiple ranges from the configured spreadsheet.
72918
+ - \`client.request(path, init?)\` \u2014 low-level authenticated fetch (\`path\` is appended to \`https://sheets.googleapis.com/v4/spreadsheets\`; the caller must include the target spreadsheetId).
72919
+ - \`client.getSpreadsheet(spreadsheetId)\` \u2014 fetch spreadsheet metadata.
72920
+ - \`client.getValues(spreadsheetId, range)\` \u2014 read a range (A1 notation).
72921
+ - \`client.batchGetValues(spreadsheetId, ranges)\` \u2014 read multiple ranges.
72922
+ - \`client.updateValues(spreadsheetId, range, values, valueInputOption?)\` \u2014 overwrite a range (requires write scope).
72923
+ - \`client.appendValues(spreadsheetId, range, values, valueInputOption?)\` \u2014 append rows (requires write scope).
72924
+ - \`client.clearValues(spreadsheetId, range)\` \u2014 clear a range (requires write scope).
72925
+ - \`client.batchUpdate(spreadsheetId, requests)\` \u2014 structural edits (requires write scope).
72923
72926
 
72924
72927
  If a handler test fails with \`Connection proxy is not configured\`, retry \u2014 the sandbox is still initializing. Do NOT abandon the SDK and construct OAuth proxy URLs manually.
72925
72928
 
@@ -72929,32 +72932,44 @@ If a handler test fails with \`Connection proxy is not configured\`, retry \u201
72929
72932
  import { connection } from "@squadbase/vite-server/connectors/google-sheets";
72930
72933
 
72931
72934
  const sheets = connection("<connectionId>");
72935
+ const spreadsheetId = "<passed from request input>";
72932
72936
 
72933
- // Get metadata for the configured spreadsheet
72934
- const metadata = await sheets.getSpreadsheet();
72935
- console.log(metadata.properties.title, metadata.sheets.map(s => s.properties.title));
72937
+ // Read: metadata and values
72938
+ const metadata = await sheets.getSpreadsheet(spreadsheetId);
72939
+ const values = await sheets.getValues(spreadsheetId, "Sheet1!A1:D10");
72936
72940
 
72937
- // Get cell values
72938
- const values = await sheets.getValues("Sheet1!A1:D10");
72939
- console.log(values.values); // 2D array
72941
+ // Write: overwrite, append, clear
72942
+ await sheets.updateValues(spreadsheetId, "Sheet1!A1:B2", [["name", "age"], ["Alice", 30]]);
72943
+ await sheets.appendValues(spreadsheetId, "Sheet1!A:B", [["Bob", 25]]);
72944
+ await sheets.clearValues(spreadsheetId, "Sheet1!A1:B10");
72940
72945
 
72941
- // Batch-get multiple ranges
72942
- const batch = await sheets.batchGetValues(["Sheet1!A:A", "Sheet2!B2:C100"]);
72946
+ // Structural edits (add a sheet)
72947
+ await sheets.batchUpdate(spreadsheetId, [
72948
+ { addSheet: { properties: { title: "NewSheet" } } },
72949
+ ]);
72943
72950
  \`\`\``,
72944
72951
  ja: `### \u30C4\u30FC\u30EB\uFF08\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u6642\u306E\u307F\uFF09
72945
72952
 
72946
- - \`google-sheets-oauth_request\`: \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3084\u30C7\u30FC\u30BF\u6982\u8981\u628A\u63E1\u6642\u306B Google Sheets API \u3092\u547C\u3073\u51FA\u3059\u30C4\u30FC\u30EB\u3067\u3059\u3002\u8AAD\u307F\u53D6\u308A\u5C02\u7528\uFF08GET \u306E\u307F\uFF09\u3067\u3059\u3002\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u306E\u30E1\u30BF\u30C7\u30FC\u30BF\u53D6\u5F97\u3084\u30BB\u30EB\u5024\u306E\u30B5\u30F3\u30D7\u30EA\u30F3\u30B0\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002\u30D1\u30B9\u5185\u306E \`{spreadsheetId}\` \u30D7\u30EC\u30FC\u30B9\u30DB\u30EB\u30C0\u306F\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u6642\u306B\u6307\u5B9A\u3055\u308C\u305F\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8ID\u306B\u81EA\u52D5\u7684\u306B\u7F6E\u63DB\u3055\u308C\u307E\u3059\u3002OAuth \u7D4C\u7531\u3067\u8A8D\u8A3C\u306F\u81EA\u52D5\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002
72953
+ - \`google-sheets-oauth_request\`: \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3084\u30C7\u30FC\u30BF\u6982\u8981\u628A\u63E1\u6642\u306B Google Sheets API \u3092\u547C\u3073\u51FA\u3059\u30C4\u30FC\u30EB\u3067\u3059\u3002GET / POST / PUT \u3092\u30B5\u30DD\u30FC\u30C8\u3057\u307E\u3059\u3002\u547C\u3073\u51FA\u3057\u5074\u304C\u30D1\u30B9\u306B\u5BFE\u8C61\u306E spreadsheetId \u3092\u660E\u793A\u7684\u306B\u542B\u3081\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\uFF08\u4F8B: \`/1AbCxyz...\`\u3001\`/1AbCxyz.../values/Sheet1!A1:D10\`\uFF09\u3002OAuth \u7D4C\u7531\u3067\u8A8D\u8A3C\u306F\u81EA\u52D5\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002
72947
72954
 
72948
- > **\u91CD\u8981**: \`google-sheets-oauth_request\` \u306F\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u6642\u306E\u307F\u5229\u7528\u53EF\u80FD\u3067\u3059\u3002\u30B5\u30FC\u30D0\u30FC\u30ED\u30B8\u30C3\u30AF\u306E\u30CF\u30F3\u30C9\u30E9\u5185\u3067\u306F\u5FC5\u305A SDK\uFF08\`connection(id).getValues\` \u306A\u3069\uFF09\u3092\u4F7F\u3063\u3066\u304F\u3060\u3055\u3044\u3002SDK \u306E fetch \u306F OAuth \u30D7\u30ED\u30AD\u30B7\u7D4C\u7531\u3067\u65E2\u306B\u914D\u7DDA\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u30CF\u30F3\u30C9\u30E9\u304B\u3089 \`_sqcore/connections/*/request\` \u3092\u624B\u66F8\u304D\u3067\u547C\u3073\u51FA\u3055\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002
72955
+ > **\u91CD\u8981**: \`google-sheets-oauth_request\` \u306F\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u6642\u306E\u307F\u5229\u7528\u53EF\u80FD\u3067\u3059\u3002\u30B5\u30FC\u30D0\u30FC\u30ED\u30B8\u30C3\u30AF\u306E\u30CF\u30F3\u30C9\u30E9\u5185\u3067\u306F\u5FC5\u305A SDK\uFF08\`connection(id).getValues(spreadsheetId, range)\` \u306A\u3069\uFF09\u3092\u4F7F\u3063\u3066\u304F\u3060\u3055\u3044\u3002SDK \u306E fetch \u306F OAuth \u30D7\u30ED\u30AD\u30B7\u7D4C\u7531\u3067\u65E2\u306B\u914D\u7DDA\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u30CF\u30F3\u30C9\u30E9\u304B\u3089 \`_sqcore/connections/*/request\` \u3092\u624B\u66F8\u304D\u3067\u547C\u3073\u51FA\u3055\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002
72949
72956
 
72950
- > **\u63A5\u7D9A\u30B9\u30B3\u30FC\u30D7**: \u5404\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306F\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u6642\u306BURL\u3067\u6307\u5B9A\u3055\u308C\u305F1\u3064\u306E\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u306B\u7D10\u3065\u304D\u307E\u3059\u3002\u3053\u306E\u30B3\u30CD\u30AF\u30BF\u306F\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u306E\u4F5C\u6210\u3084\u66F8\u304D\u8FBC\u307F\u306F\u884C\u3044\u307E\u305B\u3093\u3002OAuth \u30B9\u30B3\u30FC\u30D7\u306F \`spreadsheets.readonly\` \u3067\u3059\u3002
72957
+ > **\u63A5\u7D9A\u30B9\u30B3\u30FC\u30D7**: OAuth \u30B9\u30B3\u30FC\u30D7\u306F \`spreadsheets\`\uFF08\u8AAD\u307F\u66F8\u304D\u53EF\u80FD\uFF09\u3067\u3059\u3002\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306F\u5358\u4E00\u306E\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u306B\u7D10\u3065\u304D\u307E\u305B\u3093 \u2014 \u5BFE\u8C61\u306E spreadsheetId \u306F\u547C\u3073\u51FA\u3057\u3054\u3068\u306B\u6E21\u3057\u307E\u3059\u3002spreadsheetId \u306F\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u30D1\u30E9\u30E1\u30FC\u30BF\u3084\u74B0\u5883\u5909\u6570\u3068\u3057\u3066\u4FDD\u5B58\u3055\u308C\u306A\u3044\u305F\u3081\u3001\u30CF\u30F3\u30C9\u30E9\u306E\u547C\u3073\u51FA\u3057\u5143\uFF08\u30EA\u30AF\u30A8\u30B9\u30C8\u5165\u529B\u306A\u3069\uFF09\u304B\u3089\u660E\u793A\u7684\u306B\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002
72951
72958
 
72952
- ### Google Sheets API \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9\uFF08\u8AAD\u307F\u53D6\u308A\u5C02\u7528\uFF09
72959
+ ### Google Sheets API \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9
72953
72960
 
72961
+ \u8AAD\u307F\u53D6\u308A:
72954
72962
  - GET \`/{spreadsheetId}\` \u2014 \u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u306E\u30E1\u30BF\u30C7\u30FC\u30BF\u3092\u53D6\u5F97\uFF08\u30BF\u30A4\u30C8\u30EB\u3001\u30B7\u30FC\u30C8\u3001\u30D7\u30ED\u30D1\u30C6\u30A3\uFF09
72955
72963
  - GET \`/{spreadsheetId}/values/{range}\` \u2014 \u7BC4\u56F2\u306E\u30BB\u30EB\u5024\u3092\u53D6\u5F97
72956
72964
  - GET \`/{spreadsheetId}/values:batchGet?ranges={range1}&ranges={range2}\` \u2014 \u8907\u6570\u7BC4\u56F2\u306E\u5024\u3092\u53D6\u5F97
72957
72965
 
72966
+ \u66F8\u304D\u8FBC\u307F:
72967
+ - PUT \`/{spreadsheetId}/values/{range}?valueInputOption=USER_ENTERED\` \u2014 \u7BC4\u56F2\u3092\u4E0A\u66F8\u304D\uFF08body: \`{ range, majorDimension, values }\`\uFF09
72968
+ - POST \`/{spreadsheetId}/values/{range}:append?valueInputOption=USER_ENTERED\` \u2014 \u65E2\u5B58\u30C7\u30FC\u30BF\u306E\u5F8C\u308D\u306B\u884C\u3092\u8FFD\u8A18
72969
+ - POST \`/{spreadsheetId}/values/{range}:clear\` \u2014 \u7BC4\u56F2\u306E\u5024\u3092\u30AF\u30EA\u30A2
72970
+ - POST \`/{spreadsheetId}/values:batchUpdate\` \u2014 \u30D0\u30C3\u30C1\u66F4\u65B0 / \u30D0\u30C3\u30C1\u30AF\u30EA\u30A2
72971
+ - POST \`/{spreadsheetId}:batchUpdate\` \u2014 \u69CB\u9020\u5909\u66F4\uFF08addSheet, deleteSheet, updateCells, \u66F8\u5F0F\u8A2D\u5B9A \u7B49\uFF09
72972
+
72958
72973
  ### \u7BC4\u56F2\u306E\u8868\u8A18\u6CD5\uFF08A1\u8868\u8A18\u6CD5\uFF09
72959
72974
  - \`Sheet1!A1:D10\` \u2014 Sheet1\u4E0A\u306E\u7279\u5B9A\u7BC4\u56F2
72960
72975
  - \`Sheet1!A:A\` \u2014 Sheet1\u306EA\u5217\u5168\u4F53
@@ -72964,20 +72979,24 @@ const batch = await sheets.batchGetValues(["Sheet1!A:A", "Sheet2!B2:C100"]);
72964
72979
 
72965
72980
  ### \u30D2\u30F3\u30C8
72966
72981
  - \u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u3092\u63A2\u7D22\u3059\u308B\u306B\u306F\u3001\u307E\u305A\u30E1\u30BF\u30C7\u30FC\u30BF\u3092\u53D6\u5F97\u3057\u3066\u5229\u7528\u53EF\u80FD\u306A\u30B7\u30FC\u30C8\u540D\u3092\u78BA\u8A8D\u3057\u307E\u3059
72982
+ - \u6570\u5F0F\u3084\u65E5\u4ED8\u3092 UI \u3068\u540C\u3058\u3088\u3046\u306B\u89E3\u91C8\u3055\u305B\u308B\u306B\u306F \`valueInputOption=USER_ENTERED\`\u3001\u305D\u306E\u307E\u307E\u6587\u5B57\u5217\u3068\u3057\u3066\u4FDD\u5B58\u3059\u308B\u306B\u306F \`RAW\` \u3092\u4F7F\u3044\u307E\u3059
72967
72983
  - \u8868\u793A\u5024\u3092\u53D6\u5F97\u3059\u308B\u306B\u306F \`valueRenderOption=FORMATTED_VALUE\` \u30AF\u30A8\u30EA\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u4F7F\u7528\u3057\u307E\u3059
72968
72984
  - \u751F\u306E\u6570\u5024\u3092\u53D6\u5F97\u3059\u308B\u306B\u306F \`valueRenderOption=UNFORMATTED_VALUE\` \u3092\u4F7F\u7528\u3057\u307E\u3059
72969
72985
  - \u5217\u3054\u3068\u306B\u30C7\u30FC\u30BF\u3092\u53D6\u5F97\u3059\u308B\u306B\u306F \`majorDimension=COLUMNS\` \u3092\u4F7F\u7528\u3057\u307E\u3059
72970
72986
 
72971
72987
  ### Business Logic
72972
72988
 
72973
- \u3053\u306E\u30B3\u30CD\u30AF\u30BF\u306E\u30D3\u30B8\u30CD\u30B9\u30ED\u30B8\u30C3\u30AF\u30BF\u30A4\u30D7\u306F "typescript" \u3067\u3059\u3002\u4EE5\u4E0B\u306B\u793A\u3059\u30B3\u30CD\u30AF\u30BF SDK \u3092\u4F7F\u7528\u3057\u3066\u30CF\u30F3\u30C9\u30E9\u30B3\u30FC\u30C9\u3092\u8A18\u8FF0\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u74B0\u5883\u5909\u6570\u304B\u3089\u76F4\u63A5\u8A8D\u8A3C\u60C5\u5831\u306B\u30A2\u30AF\u30BB\u30B9\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002\`INTERNAL_SQUADBASE_*\` \u306E\u74B0\u5883\u5909\u6570\u3092\u4F7F\u3063\u3066\u624B\u52D5\u3067 OAuth \u30D7\u30ED\u30AD\u30B7\u3092\u53E9\u304F\u3053\u3068\u3082\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044 \u2014 SDK \u304C OAuth \u3092\u51E6\u7406\u3057\u307E\u3059\u3002\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8ID\u306F\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u6642\u306B\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306B\u7D10\u3065\u3051\u3089\u308C\u3066\u3044\u308B\u306E\u3067\u3001\u30CF\u30F3\u30C9\u30E9\u306E\u547C\u3073\u51FA\u3057\u5143\u306B\u6E21\u3055\u305B\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002
72989
+ \u3053\u306E\u30B3\u30CD\u30AF\u30BF\u306E\u30D3\u30B8\u30CD\u30B9\u30ED\u30B8\u30C3\u30AF\u30BF\u30A4\u30D7\u306F "typescript" \u3067\u3059\u3002\u4EE5\u4E0B\u306B\u793A\u3059\u30B3\u30CD\u30AF\u30BF SDK \u3092\u4F7F\u7528\u3057\u3066\u30CF\u30F3\u30C9\u30E9\u30B3\u30FC\u30C9\u3092\u8A18\u8FF0\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u74B0\u5883\u5909\u6570\u304B\u3089\u76F4\u63A5\u8A8D\u8A3C\u60C5\u5831\u306B\u30A2\u30AF\u30BB\u30B9\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002\`INTERNAL_SQUADBASE_*\` \u306E\u74B0\u5883\u5909\u6570\u3092\u4F7F\u3063\u3066\u624B\u52D5\u3067 OAuth \u30D7\u30ED\u30AD\u30B7\u3092\u53E9\u304F\u3053\u3068\u3082\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044 \u2014 SDK \u304C OAuth \u3092\u51E6\u7406\u3057\u307E\u3059\u3002\u5BFE\u8C61 spreadsheetId \u306F\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306B\u4FDD\u5B58\u3055\u308C\u306A\u3044\u305F\u3081\u3001\u30CF\u30F3\u30C9\u30E9\u306E\u547C\u3073\u51FA\u3057\u5143\uFF08\u30EA\u30AF\u30A8\u30B9\u30C8\u5165\u529B\u306A\u3069\uFF09\u304B\u3089\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002
72974
72990
 
72975
72991
  SDK\uFF08\`connection(connectionId)\` \u3067\u4F5C\u6210\u3057\u305F\u30AF\u30E9\u30A4\u30A2\u30F3\u30C8\uFF09:
72976
- - \`client.spreadsheetId\` \u2014 \u3053\u306E\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306B\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u308B\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8ID\u3002
72977
- - \`client.request(path, init?)\` \u2014 \u4F4E\u30EC\u30D9\u30EB\u306E\u8A8D\u8A3C\u4ED8\u304D fetch\uFF08\`path\` \u306F \`https://sheets.googleapis.com/v4/spreadsheets\` \u306B\u8FFD\u52A0\u3055\u308C\u3001\`{spreadsheetId}\` \u306F\u81EA\u52D5\u7F6E\u63DB\u3055\u308C\u307E\u3059\uFF09\u3002
72978
- - \`client.getSpreadsheet()\` \u2014 \u8A2D\u5B9A\u6E08\u307F\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u306E\u30E1\u30BF\u30C7\u30FC\u30BF\u3092\u53D6\u5F97\u3002
72979
- - \`client.getValues(range)\` \u2014 \u8A2D\u5B9A\u6E08\u307F\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u306E\u7BC4\u56F2\u306E\u5024\u3092\u53D6\u5F97\uFF08A1 \u8868\u8A18\uFF09\u3002
72980
- - \`client.batchGetValues(ranges)\` \u2014 \u8A2D\u5B9A\u6E08\u307F\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u306E\u8907\u6570\u7BC4\u56F2\u306E\u5024\u3092\u53D6\u5F97\u3002
72992
+ - \`client.request(path, init?)\` \u2014 \u4F4E\u30EC\u30D9\u30EB\u306E\u8A8D\u8A3C\u4ED8\u304D fetch\uFF08\`path\` \u306F \`https://sheets.googleapis.com/v4/spreadsheets\` \u306B\u8FFD\u52A0\u3055\u308C\u3001\u547C\u3073\u51FA\u3057\u5074\u304C spreadsheetId \u3092\u542B\u3081\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\uFF09\u3002
72993
+ - \`client.getSpreadsheet(spreadsheetId)\` \u2014 \u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u306E\u30E1\u30BF\u30C7\u30FC\u30BF\u3092\u53D6\u5F97\u3002
72994
+ - \`client.getValues(spreadsheetId, range)\` \u2014 \u7BC4\u56F2\u306E\u5024\u3092\u53D6\u5F97\uFF08A1 \u8868\u8A18\uFF09\u3002
72995
+ - \`client.batchGetValues(spreadsheetId, ranges)\` \u2014 \u8907\u6570\u7BC4\u56F2\u306E\u5024\u3092\u53D6\u5F97\u3002
72996
+ - \`client.updateValues(spreadsheetId, range, values, valueInputOption?)\` \u2014 \u7BC4\u56F2\u3092\u4E0A\u66F8\u304D\uFF08\u66F8\u304D\u8FBC\u307F\u30B9\u30B3\u30FC\u30D7\u304C\u5FC5\u8981\uFF09\u3002
72997
+ - \`client.appendValues(spreadsheetId, range, values, valueInputOption?)\` \u2014 \u884C\u3092\u8FFD\u8A18\uFF08\u66F8\u304D\u8FBC\u307F\u30B9\u30B3\u30FC\u30D7\u304C\u5FC5\u8981\uFF09\u3002
72998
+ - \`client.clearValues(spreadsheetId, range)\` \u2014 \u7BC4\u56F2\u306E\u5024\u3092\u30AF\u30EA\u30A2\uFF08\u66F8\u304D\u8FBC\u307F\u30B9\u30B3\u30FC\u30D7\u304C\u5FC5\u8981\uFF09\u3002
72999
+ - \`client.batchUpdate(spreadsheetId, requests)\` \u2014 \u69CB\u9020\u5909\u66F4\uFF08\u66F8\u304D\u8FBC\u307F\u30B9\u30B3\u30FC\u30D7\u304C\u5FC5\u8981\uFF09\u3002
72981
73000
 
72982
73001
  \u30CF\u30F3\u30C9\u30E9\u306E\u30C6\u30B9\u30C8\u304C \`Connection proxy is not configured\` \u3067\u5931\u6557\u3059\u308B\u5834\u5408\u306F\u518D\u8A66\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u901A\u5E38\u306F\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306E\u521D\u671F\u5316\u4E2D\u306B\u8D77\u304D\u307E\u3059\u3002SDK \u3092\u8AE6\u3081\u3066 OAuth \u30D7\u30ED\u30AD\u30B7\u306E URL \u3092\u81EA\u5206\u3067\u7D44\u307F\u7ACB\u3066\u308B\u3053\u3068\u306F **\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044**\u3002
72983
73002
 
@@ -72987,17 +73006,21 @@ SDK\uFF08\`connection(connectionId)\` \u3067\u4F5C\u6210\u3057\u305F\u30AF\u30E9
72987
73006
  import { connection } from "@squadbase/vite-server/connectors/google-sheets";
72988
73007
 
72989
73008
  const sheets = connection("<connectionId>");
73009
+ const spreadsheetId = "<\u30EA\u30AF\u30A8\u30B9\u30C8\u5165\u529B\u304B\u3089\u53D7\u3051\u53D6\u308B>";
72990
73010
 
72991
- // \u8A2D\u5B9A\u6E08\u307F\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u306E\u30E1\u30BF\u30C7\u30FC\u30BF\u3092\u53D6\u5F97
72992
- const metadata = await sheets.getSpreadsheet();
72993
- console.log(metadata.properties.title, metadata.sheets.map(s => s.properties.title));
73011
+ // \u8AAD\u307F\u53D6\u308A: \u30E1\u30BF\u30C7\u30FC\u30BF\u3068\u5024
73012
+ const metadata = await sheets.getSpreadsheet(spreadsheetId);
73013
+ const values = await sheets.getValues(spreadsheetId, "Sheet1!A1:D10");
72994
73014
 
72995
- // \u30BB\u30EB\u5024\u3092\u53D6\u5F97
72996
- const values = await sheets.getValues("Sheet1!A1:D10");
72997
- console.log(values.values); // 2D array
73015
+ // \u66F8\u304D\u8FBC\u307F: \u4E0A\u66F8\u304D\u30FB\u8FFD\u8A18\u30FB\u30AF\u30EA\u30A2
73016
+ await sheets.updateValues(spreadsheetId, "Sheet1!A1:B2", [["name", "age"], ["Alice", 30]]);
73017
+ await sheets.appendValues(spreadsheetId, "Sheet1!A:B", [["Bob", 25]]);
73018
+ await sheets.clearValues(spreadsheetId, "Sheet1!A1:B10");
72998
73019
 
72999
- // \u8907\u6570\u7BC4\u56F2\u3092\u30D0\u30C3\u30C1\u53D6\u5F97
73000
- const batch = await sheets.batchGetValues(["Sheet1!A:A", "Sheet2!B2:C100"]);
73020
+ // \u69CB\u9020\u5909\u66F4\uFF08\u30B7\u30FC\u30C8\u3092\u8FFD\u52A0\uFF09
73021
+ await sheets.batchUpdate(spreadsheetId, [
73022
+ { addSheet: { properties: { title: "NewSheet" } } },
73023
+ ]);
73001
73024
  \`\`\``
73002
73025
  },
73003
73026
  tools: tools18
@@ -85007,7 +85030,7 @@ var grafanaConnector = new ConnectorPlugin({
85007
85030
  description: "Connect to Grafana for monitoring dashboards, datasource queries, and alerting.",
85008
85031
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/3nGaPhV94lXQsHcCtv4mXz/0559d42f83066e8ba79e78410806750c/grafana-icon.webp",
85009
85032
  parameters: parameters58,
85010
- releaseFlag: { dev1: true, dev2: false, prod: false },
85033
+ releaseFlag: { dev1: true, dev2: true, prod: true },
85011
85034
  onboarding: grafanaOnboarding,
85012
85035
  systemPrompt: {
85013
85036
  en: `### Tools
@@ -86176,42 +86199,6 @@ await sentry.updateIssue("12345", { status: "resolved" });
86176
86199
 
86177
86200
  // ../connectors/src/connectors/salesforce/setup.ts
86178
86201
  var salesforceOnboarding = new ConnectorOnboarding({
86179
- connectionSetupInstructions: {
86180
- en: `#### Create a Connected App in Salesforce
86181
- 1. In Salesforce Setup, go to App Manager \u2192 New Connected App
86182
- 2. Under API (Enable OAuth Settings), check "Enable OAuth Settings"
86183
- 3. Add OAuth scopes: "Manage user data via APIs (api)" and "Perform requests at any time (refresh_token, offline_access)"
86184
- 4. Save and note the Consumer Key (client_id) and Consumer Secret (client_secret)
86185
-
86186
- #### Allow Username-Password Flow
86187
- 1. Go to Setup \u2192 Identity \u2192 OAuth and OpenID Connect Settings
86188
- 2. Enable "Allow OAuth Username-Password Flows"
86189
-
86190
- #### Reset your Security Token
86191
- 1. Go to Settings \u2192 My Personal Information \u2192 Reset My Security Token
86192
- 2. Salesforce emails you a new security token \u2014 append it to your password when entering the Password parameter (password + securityToken)
86193
-
86194
- #### Sandbox vs Production
86195
- - Leave Use Sandbox as "false" (or empty) to connect to production (login.salesforce.com)
86196
- - Set Use Sandbox to "true" to connect to a sandbox (test.salesforce.com)`,
86197
- ja: `#### Salesforce \u3067 Connected App \u3092\u4F5C\u6210
86198
- 1. Setup \u2192 App Manager \u2192 New Connected App
86199
- 2. API (Enable OAuth Settings) \u30BB\u30AF\u30B7\u30E7\u30F3\u3067 "Enable OAuth Settings" \u3092\u6709\u52B9\u5316
86200
- 3. OAuth \u30B9\u30B3\u30FC\u30D7\u306B "Manage user data via APIs (api)" \u3068 "Perform requests at any time (refresh_token, offline_access)" \u3092\u8FFD\u52A0
86201
- 4. \u4FDD\u5B58\u5F8C\u3001Consumer Key (client_id) \u3068 Consumer Secret (client_secret) \u3092\u63A7\u3048\u308B
86202
-
86203
- #### Username-Password Flow \u3092\u8A31\u53EF
86204
- 1. Setup \u2192 Identity \u2192 OAuth and OpenID Connect Settings
86205
- 2. "Allow OAuth Username-Password Flows" \u3092\u6709\u52B9\u5316
86206
-
86207
- #### Security Token \u306E\u767A\u884C
86208
- 1. \u500B\u4EBA\u8A2D\u5B9A \u2192 My Personal Information \u2192 Reset My Security Token
86209
- 2. Salesforce \u304B\u3089\u9001\u3089\u308C\u308B\u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u30C8\u30FC\u30AF\u30F3\u3092\u30D1\u30B9\u30EF\u30FC\u30C9\u306B\u9023\u7D50\u3057\u3066\u5165\u529B\uFF08password + securityToken\uFF09
86210
-
86211
- #### Sandbox / Production
86212
- - \u672C\u756A (login.salesforce.com) \u306E\u5834\u5408: Use Sandbox \u3092 "false" \u307E\u305F\u306F\u672A\u5165\u529B
86213
- - Sandbox (test.salesforce.com) \u306E\u5834\u5408: Use Sandbox \u3092 "true" \u306B\u8A2D\u5B9A`
86214
- },
86215
86202
  dataOverviewInstructions: {
86216
86203
  en: `1. Call salesforce_request with GET /services/data/v60.0/sobjects/ to list available sObjects (standard + custom)
86217
86204
  2. Call salesforce_request with GET /services/data/v60.0/sobjects/Account/describe to inspect Account fields; repeat for Contact, Opportunity, Lead as needed
@@ -86224,28 +86211,19 @@ var salesforceOnboarding = new ConnectorOnboarding({
86224
86211
 
86225
86212
  // ../connectors/src/connectors/salesforce/parameters.ts
86226
86213
  var parameters62 = {
86227
- username: new ParameterDefinition({
86228
- slug: "username",
86229
- name: "Username",
86230
- description: "Your Salesforce account username (the email you use to sign in).",
86231
- envVarBaseKey: "SALESFORCE_USERNAME",
86214
+ instanceUrl: new ParameterDefinition({
86215
+ slug: "instance-url",
86216
+ name: "Instance URL",
86217
+ description: "Your Salesforce org's My Domain URL (e.g., https://yourorg.my.salesforce.com). Find it under Setup \u2192 Company Settings \u2192 My Domain \u2192 Current My Domain URL.",
86218
+ envVarBaseKey: "SALESFORCE_INSTANCE_URL",
86232
86219
  type: "text",
86233
86220
  secret: false,
86234
86221
  required: true
86235
86222
  }),
86236
- password: new ParameterDefinition({
86237
- slug: "password",
86238
- name: "Password",
86239
- description: "Your Salesforce account password concatenated with your security token (password + securityToken). The security token is emailed to you when you reset it from Settings \u2192 My Personal Information \u2192 Reset My Security Token.",
86240
- envVarBaseKey: "SALESFORCE_PASSWORD",
86241
- type: "text",
86242
- secret: true,
86243
- required: true
86244
- }),
86245
86223
  clientId: new ParameterDefinition({
86246
86224
  slug: "client-id",
86247
86225
  name: "Consumer Key",
86248
- description: "The Consumer Key (client_id) of your Salesforce Connected App. Enable OAuth Settings and 'Allow OAuth Username-Password Flows' in your org's identity settings.",
86226
+ description: "The Consumer Key (client_id) of your External Client App (or Connected App). The app must enable the OAuth 2.0 Client Credentials Flow and bind a Run-As user with API access.",
86249
86227
  envVarBaseKey: "SALESFORCE_CLIENT_ID",
86250
86228
  type: "text",
86251
86229
  secret: false,
@@ -86254,20 +86232,11 @@ var parameters62 = {
86254
86232
  clientSecret: new ParameterDefinition({
86255
86233
  slug: "client-secret",
86256
86234
  name: "Consumer Secret",
86257
- description: "The Consumer Secret (client_secret) of your Salesforce Connected App.",
86235
+ description: "The Consumer Secret (client_secret) of your External Client App (or Connected App).",
86258
86236
  envVarBaseKey: "SALESFORCE_CLIENT_SECRET",
86259
86237
  type: "text",
86260
86238
  secret: true,
86261
86239
  required: true
86262
- }),
86263
- isSandbox: new ParameterDefinition({
86264
- slug: "is-sandbox",
86265
- name: "Use Sandbox",
86266
- description: 'Set to "true" to authenticate against a Salesforce sandbox (test.salesforce.com) instead of production (login.salesforce.com). Defaults to "false".',
86267
- envVarBaseKey: "SALESFORCE_IS_SANDBOX",
86268
- type: "text",
86269
- secret: false,
86270
- required: false
86271
86240
  })
86272
86241
  };
86273
86242
 
@@ -86298,10 +86267,17 @@ var outputSchema75 = z77.discriminatedUnion("success", [
86298
86267
  error: z77.string()
86299
86268
  })
86300
86269
  ]);
86270
+ function normalizeInstanceUrl(raw) {
86271
+ const trimmed = raw.trim().replace(/\/+$/, "");
86272
+ if (!/^https?:\/\//i.test(trimmed)) {
86273
+ return `https://${trimmed}`;
86274
+ }
86275
+ return trimmed;
86276
+ }
86301
86277
  var requestTool47 = new ConnectorTool({
86302
86278
  name: "request",
86303
86279
  description: `Send authenticated requests to the Salesforce REST API.
86304
- Authentication is handled automatically using the OAuth 2.0 username-password flow (Connected App Consumer Key + Secret with the Salesforce account credentials). An access token and instance URL are obtained on each request, so the tool user only provides the API path.
86280
+ Authentication is handled automatically using the OAuth 2.0 Client Credentials Flow (External Client App or Connected App Consumer Key + Secret). An access token is obtained on each request, so the tool user only provides the API path.
86305
86281
  Use this tool for all Salesforce interactions: describing sObjects, running SOQL queries (GET /services/data/vXX.X/query?q=...), reading/creating/updating standard (Account, Contact, Opportunity, Lead, Case) and custom objects.
86306
86282
  Prefer SOQL via the /query endpoint for filtered, joined, or aggregated reads rather than paginating /sobjects/{Type} endpoints.`,
86307
86283
  inputSchema: inputSchema75,
@@ -86318,20 +86294,16 @@ Prefer SOQL via the /query endpoint for filtered, joined, or aggregated reads ra
86318
86294
  `[connector-request] salesforce/${connection2.name}: ${method} ${path5}`
86319
86295
  );
86320
86296
  try {
86321
- const username = parameters62.username.getValue(connection2);
86322
- const password = parameters62.password.getValue(connection2);
86297
+ const instanceUrlParam = parameters62.instanceUrl.getValue(connection2);
86323
86298
  const clientId = parameters62.clientId.getValue(connection2);
86324
86299
  const clientSecret = parameters62.clientSecret.getValue(connection2);
86325
- const isSandbox = parameters62.isSandbox.tryGetValue(connection2)?.toLowerCase() === "true";
86326
- const loginHost = isSandbox ? "https://test.salesforce.com" : "https://login.salesforce.com";
86300
+ const instanceUrl = normalizeInstanceUrl(instanceUrlParam);
86327
86301
  const tokenBody = new URLSearchParams({
86328
- grant_type: "password",
86302
+ grant_type: "client_credentials",
86329
86303
  client_id: clientId,
86330
- client_secret: clientSecret,
86331
- username,
86332
- password
86304
+ client_secret: clientSecret
86333
86305
  });
86334
- const tokenRes = await fetch(`${loginHost}/services/oauth2/token`, {
86306
+ const tokenRes = await fetch(`${instanceUrl}/services/oauth2/token`, {
86335
86307
  method: "POST",
86336
86308
  headers: {
86337
86309
  "Content-Type": "application/x-www-form-urlencoded"
@@ -86346,13 +86318,14 @@ Prefer SOQL via the /query endpoint for filtered, joined, or aggregated reads ra
86346
86318
  };
86347
86319
  }
86348
86320
  const tokenJson = await tokenRes.json();
86349
- if (!tokenJson.access_token || !tokenJson.instance_url) {
86321
+ if (!tokenJson.access_token) {
86350
86322
  return {
86351
86323
  success: false,
86352
- error: "access_token or instance_url not found in token response"
86324
+ error: "access_token not found in token response"
86353
86325
  };
86354
86326
  }
86355
- const url = `${tokenJson.instance_url}${path5.startsWith("/") ? "" : "/"}${path5}`;
86327
+ const resolvedInstanceUrl = tokenJson.instance_url ?? instanceUrl;
86328
+ const url = `${resolvedInstanceUrl}${path5.startsWith("/") ? "" : "/"}${path5}`;
86356
86329
  const controller = new AbortController();
86357
86330
  const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS59);
86358
86331
  try {
@@ -86401,7 +86374,7 @@ Prefer SOQL via the /query endpoint for filtered, joined, or aggregated reads ra
86401
86374
  var tools62 = { request: requestTool47 };
86402
86375
  var salesforceConnector = new ConnectorPlugin({
86403
86376
  slug: "salesforce",
86404
- authType: AUTH_TYPES.USER_PASSWORD,
86377
+ authType: AUTH_TYPES.API_KEY,
86405
86378
  name: "Salesforce",
86406
86379
  description: "Connect to Salesforce CRM for accounts, contacts, opportunities, leads, cases, and custom objects via SOQL and the REST API.",
86407
86380
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/6vZlbrUKhxXIiuvWJlb8YB/bbc5e08b88de46c8ed338a74c7d0abb3/salesforce-icon.png",
@@ -86411,7 +86384,7 @@ var salesforceConnector = new ConnectorPlugin({
86411
86384
  systemPrompt: {
86412
86385
  en: `### Tools
86413
86386
 
86414
- - \`salesforce_request\`: The only way to call the Salesforce REST API. Use it to run SOQL queries, describe sObjects, and read/create/update/delete standard (Account, Contact, Opportunity, Lead, Case) and custom objects. Authentication (OAuth 2.0 username-password flow against the Connected App) is configured automatically \u2014 an access token and the org's instance URL are resolved on each request. Prefer SOQL via \`GET /services/data/v60.0/query?q=...\` over paginating \`/sobjects/{Type}\` endpoints for filtered or joined reads.
86387
+ - \`salesforce_request\`: The only way to call the Salesforce REST API. Use it to run SOQL queries, describe sObjects, and read/create/update/delete standard (Account, Contact, Opportunity, Lead, Case) and custom objects. Authentication (OAuth 2.0 Client Credentials Flow against the External Client App / Connected App) is configured automatically \u2014 an access token is resolved on each request against the configured org instance URL. Prefer SOQL via \`GET /services/data/v60.0/query?q=...\` over paginating \`/sobjects/{Type}\` endpoints for filtered or joined reads.
86415
86388
 
86416
86389
  ### Business Logic
86417
86390
 
@@ -86457,9 +86430,8 @@ export default async function handler(c: Context) {
86457
86430
 
86458
86431
  ### Salesforce REST API Reference
86459
86432
 
86460
- - Login host: \`https://login.salesforce.com\` (production) or \`https://test.salesforce.com\` (sandbox)
86461
- - Token endpoint: \`POST /services/oauth2/token\` (grant_type=password + client_id/secret + username/password)
86462
- - Base path after login: \`{instance_url}/services/data/v60.0\`
86433
+ - Token endpoint: \`POST {instance_url}/services/oauth2/token\` (grant_type=client_credentials + client_id/secret)
86434
+ - Base path: \`{instance_url}/services/data/v60.0\` where instance_url is the org's My Domain URL
86463
86435
  - Authentication: Bearer token (handled automatically per request)
86464
86436
  - Pagination (SOQL): follow \`nextRecordsUrl\` from the response (absolute path starting with \`/services/data/v60.0/query/...\`)
86465
86437
 
@@ -86483,7 +86455,7 @@ export default async function handler(c: Context) {
86483
86455
  - Parent-to-child subquery: \`SELECT Id, Name, (SELECT Id, Email FROM Contacts) FROM Account\``,
86484
86456
  ja: `### \u30C4\u30FC\u30EB
86485
86457
 
86486
- - \`salesforce_request\`: Salesforce REST API \u3092\u547C\u3073\u51FA\u3059\u552F\u4E00\u306E\u624B\u6BB5\u3067\u3059\u3002SOQL \u30AF\u30A8\u30EA\u306E\u5B9F\u884C\u3001sObject \u306E describe\u3001\u6A19\u6E96\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\uFF08Account, Contact, Opportunity, Lead, Case\uFF09\u3084\u30AB\u30B9\u30BF\u30E0\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u8AAD\u307F\u66F8\u304D\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002\u8A8D\u8A3C\uFF08Connected App + OAuth 2.0 Username-Password Flow\uFF09\u306F\u81EA\u52D5\u3067\u884C\u308F\u308C\u3001\u30EA\u30AF\u30A8\u30B9\u30C8\u3054\u3068\u306B\u30A2\u30AF\u30BB\u30B9\u30C8\u30FC\u30AF\u30F3\u3068\u7D44\u7E54\u306E instance URL \u304C\u89E3\u6C7A\u3055\u308C\u307E\u3059\u3002\u30D5\u30A3\u30EB\u30BF\u3084\u7D50\u5408\u306E\u3042\u308B\u8AAD\u307F\u53D6\u308A\u3067\u306F \`/sobjects/{Type}\` \u3092\u30DA\u30FC\u30B8\u30F3\u30B0\u3059\u308B\u306E\u3067\u306F\u306A\u304F\u3001\`GET /services/data/v60.0/query?q=...\` \u306E SOQL \u3092\u512A\u5148\u3057\u3066\u304F\u3060\u3055\u3044\u3002
86458
+ - \`salesforce_request\`: Salesforce REST API \u3092\u547C\u3073\u51FA\u3059\u552F\u4E00\u306E\u624B\u6BB5\u3067\u3059\u3002SOQL \u30AF\u30A8\u30EA\u306E\u5B9F\u884C\u3001sObject \u306E describe\u3001\u6A19\u6E96\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\uFF08Account, Contact, Opportunity, Lead, Case\uFF09\u3084\u30AB\u30B9\u30BF\u30E0\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u8AAD\u307F\u66F8\u304D\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002\u8A8D\u8A3C\uFF08External Client App / Connected App + OAuth 2.0 Client Credentials Flow\uFF09\u306F\u81EA\u52D5\u3067\u884C\u308F\u308C\u3001\u8A2D\u5B9A\u3055\u308C\u305F\u7D44\u7E54\u306E instance URL \u306B\u5BFE\u3057\u3066\u30EA\u30AF\u30A8\u30B9\u30C8\u3054\u3068\u306B\u30A2\u30AF\u30BB\u30B9\u30C8\u30FC\u30AF\u30F3\u304C\u89E3\u6C7A\u3055\u308C\u307E\u3059\u3002\u30D5\u30A3\u30EB\u30BF\u3084\u7D50\u5408\u306E\u3042\u308B\u8AAD\u307F\u53D6\u308A\u3067\u306F \`/sobjects/{Type}\` \u3092\u30DA\u30FC\u30B8\u30F3\u30B0\u3059\u308B\u306E\u3067\u306F\u306A\u304F\u3001\`GET /services/data/v60.0/query?q=...\` \u306E SOQL \u3092\u512A\u5148\u3057\u3066\u304F\u3060\u3055\u3044\u3002
86487
86459
 
86488
86460
  ### Business Logic
86489
86461
 
@@ -86529,9 +86501,8 @@ export default async function handler(c: Context) {
86529
86501
 
86530
86502
  ### Salesforce REST API \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9
86531
86503
 
86532
- - \u30ED\u30B0\u30A4\u30F3\u30DB\u30B9\u30C8: \`https://login.salesforce.com\`\uFF08\u672C\u756A\uFF09\u307E\u305F\u306F \`https://test.salesforce.com\`\uFF08Sandbox\uFF09
86533
- - \u30C8\u30FC\u30AF\u30F3\u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8: \`POST /services/oauth2/token\`\uFF08grant_type=password + client_id/secret + username/password\uFF09
86534
- - \u30ED\u30B0\u30A4\u30F3\u5F8C\u306E\u30D9\u30FC\u30B9\u30D1\u30B9: \`{instance_url}/services/data/v60.0\`
86504
+ - \u30C8\u30FC\u30AF\u30F3\u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8: \`POST {instance_url}/services/oauth2/token\`\uFF08grant_type=client_credentials + client_id/secret\uFF09
86505
+ - \u30D9\u30FC\u30B9\u30D1\u30B9: \`{instance_url}/services/data/v60.0\`\uFF08instance_url \u306F\u7D44\u7E54\u306E My Domain URL\uFF09
86535
86506
  - \u8A8D\u8A3C: Bearer \u30C8\u30FC\u30AF\u30F3\uFF08\u30EA\u30AF\u30A8\u30B9\u30C8\u3054\u3068\u306B\u81EA\u52D5\u8A2D\u5B9A\uFF09
86536
86507
  - \u30DA\u30FC\u30B8\u30CD\u30FC\u30B7\u30E7\u30F3\uFF08SOQL\uFF09: \u30EC\u30B9\u30DD\u30F3\u30B9\u306E \`nextRecordsUrl\`\uFF08\`/services/data/v60.0/query/...\` \u304B\u3089\u59CB\u307E\u308B\u7D76\u5BFE\u30D1\u30B9\uFF09\u3092\u8FBF\u308B
86537
86508
 
@@ -86773,7 +86744,7 @@ var influxdbConnector = new ConnectorPlugin({
86773
86744
  description: "Connect to InfluxDB (Cloud or OSS) to query time-series data with SQL, InfluxQL, or Flux and to write line protocol.",
86774
86745
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/J1JauVRNmahSVTVrpPfQK/18350d8d3f2dc3be25e8e36ee52914a0/influxdb.png",
86775
86746
  parameters: parameters63,
86776
- releaseFlag: { dev1: true, dev2: false, prod: false },
86747
+ releaseFlag: { dev1: true, dev2: true, prod: true },
86777
86748
  onboarding: influxdbOnboarding,
86778
86749
  systemPrompt: {
86779
86750
  en: `### Variant Detection