@squadbase/vite-server 0.1.17-dev.3b633bb → 0.1.17-dev.423ee34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +3307 -739
- package/dist/connectors/airtable-oauth.js +50 -8
- package/dist/connectors/airtable.js +46 -8
- package/dist/connectors/amplitude.js +10 -8
- package/dist/connectors/anthropic.js +4 -2
- package/dist/connectors/asana.js +39 -10
- package/dist/connectors/attio.js +32 -13
- package/dist/connectors/aws-billing.js +10 -8
- package/dist/connectors/azure-sql.js +33 -7
- package/dist/connectors/backlog-api-key.js +42 -15
- package/dist/connectors/clickup.js +52 -10
- package/dist/connectors/cosmosdb.js +14 -12
- package/dist/connectors/customerio.js +10 -8
- package/dist/connectors/dbt.js +688 -25
- package/dist/connectors/freshdesk.js +84 -8
- package/dist/connectors/freshsales.js +10 -8
- package/dist/connectors/freshservice.js +10 -8
- package/dist/connectors/gamma.js +17 -15
- package/dist/connectors/gemini.js +4 -2
- package/dist/connectors/github.js +14 -12
- package/dist/connectors/gmail-oauth.js +10 -10
- package/dist/connectors/gmail.js +6 -4
- package/dist/connectors/google-ads.js +10 -8
- package/dist/connectors/google-analytics-oauth.js +154 -25
- package/dist/connectors/google-analytics.js +536 -109
- package/dist/connectors/google-audit-log.js +6 -4
- package/dist/connectors/google-calendar-oauth.js +63 -15
- package/dist/connectors/google-calendar.js +63 -11
- package/dist/connectors/google-docs.js +10 -10
- package/dist/connectors/google-drive.js +32 -10
- package/dist/connectors/google-search-console-oauth.js +128 -17
- package/dist/connectors/google-sheets.js +8 -6
- package/dist/connectors/google-slides.js +10 -10
- package/dist/connectors/grafana.js +47 -10
- package/dist/connectors/hubspot-oauth.js +41 -9
- package/dist/connectors/hubspot.js +27 -9
- package/dist/connectors/influxdb.js +10 -8
- package/dist/connectors/intercom-oauth.js +72 -12
- package/dist/connectors/intercom.js +14 -12
- package/dist/connectors/jdbc.js +8 -6
- package/dist/connectors/jira-api-key.js +70 -11
- package/dist/connectors/kintone-api-token.js +68 -18
- package/dist/connectors/kintone.js +56 -11
- package/dist/connectors/linear.js +56 -12
- package/dist/connectors/linkedin-ads.js +43 -14
- package/dist/connectors/mailchimp-oauth.js +8 -6
- package/dist/connectors/mailchimp.js +8 -6
- package/dist/connectors/meta-ads-oauth.js +35 -14
- package/dist/connectors/meta-ads.js +37 -14
- package/dist/connectors/mixpanel.js +10 -8
- package/dist/connectors/monday.js +11 -9
- package/dist/connectors/mongodb.js +10 -8
- package/dist/connectors/notion-oauth.js +60 -11
- package/dist/connectors/notion.js +62 -11
- package/dist/connectors/openai.js +4 -2
- package/dist/connectors/oracle.js +25 -7
- package/dist/connectors/outlook-oauth.js +20 -20
- package/dist/connectors/powerbi-oauth.js +12 -12
- package/dist/connectors/salesforce.js +44 -9
- package/dist/connectors/semrush.js +8 -6
- package/dist/connectors/sentry.js +38 -10
- package/dist/connectors/shopify-oauth.js +43 -10
- package/dist/connectors/shopify.js +10 -8
- package/dist/connectors/sqlserver.js +33 -7
- package/dist/connectors/stripe-api-key.js +68 -15
- package/dist/connectors/stripe-oauth.js +70 -19
- package/dist/connectors/supabase.js +24 -5
- package/dist/connectors/tableau.js +16 -14
- package/dist/connectors/tiktok-ads.js +39 -16
- package/dist/connectors/wix-store.js +10 -8
- package/dist/connectors/zendesk-oauth.js +55 -12
- package/dist/connectors/zendesk.js +14 -12
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3336 -743
- package/dist/main.js +3325 -737
- package/dist/vite-plugin.js +3305 -737
- package/package.json +1 -1
|
@@ -16,6 +16,7 @@ var init_parameter_definition = __esm({
|
|
|
16
16
|
type;
|
|
17
17
|
secret;
|
|
18
18
|
required;
|
|
19
|
+
isDeprecated;
|
|
19
20
|
constructor(config) {
|
|
20
21
|
this.slug = config.slug;
|
|
21
22
|
this.name = config.name;
|
|
@@ -24,6 +25,7 @@ var init_parameter_definition = __esm({
|
|
|
24
25
|
this.type = config.type;
|
|
25
26
|
this.secret = config.secret;
|
|
26
27
|
this.required = config.required;
|
|
28
|
+
this.isDeprecated = config.isDeprecated ?? false;
|
|
27
29
|
}
|
|
28
30
|
/**
|
|
29
31
|
* Get the parameter value from a ConnectorConnectionObject.
|
|
@@ -254,7 +256,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
254
256
|
/**
|
|
255
257
|
* Create tools for connections that belong to this connector.
|
|
256
258
|
* Filters connections by connectorKey internally.
|
|
257
|
-
* Returns tools keyed as
|
|
259
|
+
* Returns tools keyed as `connector_${connectorKey}_${toolName}`.
|
|
258
260
|
*/
|
|
259
261
|
createTools(connections, config, opts) {
|
|
260
262
|
const myConnections = connections.filter(
|
|
@@ -264,7 +266,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
264
266
|
for (const t of Object.values(this.tools)) {
|
|
265
267
|
const tool = t.createTool(myConnections, config);
|
|
266
268
|
const originalToModelOutput = tool.toModelOutput;
|
|
267
|
-
result[
|
|
269
|
+
result[`connector_${this.connectorKey}_${t.name}`] = {
|
|
268
270
|
...tool,
|
|
269
271
|
toModelOutput: async (options) => {
|
|
270
272
|
if (!originalToModelOutput) {
|
|
@@ -549,10 +551,10 @@ var googleSearchConsoleOauthOnboarding = new ConnectorOnboarding({
|
|
|
549
551
|
- Write only 1 sentence between tool calls, then immediately call the next tool. Skip unnecessary explanations and proceed efficiently`
|
|
550
552
|
},
|
|
551
553
|
dataOverviewInstructions: {
|
|
552
|
-
en: `1. Call
|
|
553
|
-
2. Call
|
|
554
|
-
ja: `1.
|
|
555
|
-
2.
|
|
554
|
+
en: `1. Call connector_google-search-console-oauth_request with GET /sites/{siteUrl} to fetch metadata for the configured site
|
|
555
|
+
2. Call connector_google-search-console-oauth_request with POST /sites/{siteUrl}/searchAnalytics/query and a small body \u2014 startDate/endDate covering the last 7 days, dimensions ["date"], rowLimit 7 \u2014 to verify that performance data is available`,
|
|
556
|
+
ja: `1. connector_google-search-console-oauth_request \u3067 GET /sites/{siteUrl} \u3092\u547C\u3073\u51FA\u3057\u3001\u8A2D\u5B9A\u3055\u308C\u305F\u30B5\u30A4\u30C8\u306E\u30E1\u30BF\u30C7\u30FC\u30BF\u3092\u53D6\u5F97
|
|
557
|
+
2. connector_google-search-console-oauth_request \u3067 POST /sites/{siteUrl}/searchAnalytics/query \u3092\u76F4\u8FD17\u65E5\u9593\u306E startDate/endDate\u3001dimensions ["date"]\u3001rowLimit 7 \u3067\u547C\u3073\u51FA\u3057\u3001\u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u30C7\u30FC\u30BF\u306E\u53EF\u7528\u6027\u3092\u78BA\u8A8D`
|
|
556
558
|
}
|
|
557
559
|
});
|
|
558
560
|
|
|
@@ -575,6 +577,33 @@ function isVerified(site) {
|
|
|
575
577
|
const level = site.permissionLevel ?? "";
|
|
576
578
|
return level !== "" && level !== "siteUnverifiedUser";
|
|
577
579
|
}
|
|
580
|
+
function formatDate(daysAgo) {
|
|
581
|
+
const d = /* @__PURE__ */ new Date();
|
|
582
|
+
d.setDate(d.getDate() - daysAgo);
|
|
583
|
+
return d.toISOString().slice(0, 10);
|
|
584
|
+
}
|
|
585
|
+
async function querySearchAnalytics(proxyFetch, siteUrl, dimensions, rowLimit) {
|
|
586
|
+
try {
|
|
587
|
+
const res = await proxyFetch(
|
|
588
|
+
`${SITES_URL}/${encodeURIComponent(siteUrl)}/searchAnalytics/query`,
|
|
589
|
+
{
|
|
590
|
+
method: "POST",
|
|
591
|
+
headers: { "Content-Type": "application/json" },
|
|
592
|
+
body: JSON.stringify({
|
|
593
|
+
startDate: formatDate(28),
|
|
594
|
+
endDate: formatDate(1),
|
|
595
|
+
dimensions,
|
|
596
|
+
rowLimit
|
|
597
|
+
})
|
|
598
|
+
}
|
|
599
|
+
);
|
|
600
|
+
if (!res.ok) return [];
|
|
601
|
+
const data = await res.json();
|
|
602
|
+
return data.rows ?? [];
|
|
603
|
+
} catch {
|
|
604
|
+
return [];
|
|
605
|
+
}
|
|
606
|
+
}
|
|
578
607
|
var googleSearchConsoleOauthSetupFlow = {
|
|
579
608
|
initialState: () => ({}),
|
|
580
609
|
steps: [
|
|
@@ -613,7 +642,6 @@ var googleSearchConsoleOauthSetupFlow = {
|
|
|
613
642
|
}
|
|
614
643
|
const allSites = await listSites(rt.config.proxyFetch);
|
|
615
644
|
const verified = allSites.filter(isVerified);
|
|
616
|
-
const siteByUrl = new Map(verified.map((s) => [s.siteUrl ?? "", s]));
|
|
617
645
|
const targetSiteUrls = await resolveSetupSelection({
|
|
618
646
|
selected: state.sites,
|
|
619
647
|
allSentinel: ALL_SITES,
|
|
@@ -625,15 +653,98 @@ var googleSearchConsoleOauthSetupFlow = {
|
|
|
625
653
|
sections.push("_No sites selected._", "");
|
|
626
654
|
return sections.join("\n");
|
|
627
655
|
}
|
|
628
|
-
sections.push("| Site URL | Permission Level |");
|
|
629
|
-
sections.push("|----------|------------------|");
|
|
630
656
|
for (const siteUrl of targetSiteUrls) {
|
|
631
|
-
const site = siteByUrl.get(siteUrl);
|
|
632
|
-
const permission = site?.permissionLevel ?? "-";
|
|
633
657
|
const safeSiteUrl = siteUrl.replace(/\|/g, "\\|");
|
|
634
|
-
sections.push(
|
|
658
|
+
sections.push(`### Site: ${safeSiteUrl}`, "");
|
|
659
|
+
const topQueries = await querySearchAnalytics(
|
|
660
|
+
rt.config.proxyFetch,
|
|
661
|
+
siteUrl,
|
|
662
|
+
["query"],
|
|
663
|
+
10
|
|
664
|
+
);
|
|
665
|
+
if (topQueries.length > 0) {
|
|
666
|
+
sections.push("#### Top Search Queries (last 28 days)", "");
|
|
667
|
+
sections.push("| Query | Clicks | Impressions | CTR | Avg Position |");
|
|
668
|
+
sections.push("|-------|--------|-------------|-----|-------------|");
|
|
669
|
+
for (const row of topQueries) {
|
|
670
|
+
const q = (row.keys?.[0] ?? "").replace(/\|/g, "\\|");
|
|
671
|
+
const clicks = row.clicks ?? 0;
|
|
672
|
+
const impressions = row.impressions ?? 0;
|
|
673
|
+
const ctr = ((row.ctr ?? 0) * 100).toFixed(1);
|
|
674
|
+
const pos = (row.position ?? 0).toFixed(1);
|
|
675
|
+
sections.push(
|
|
676
|
+
`| ${q} | ${clicks} | ${impressions} | ${ctr}% | ${pos} |`
|
|
677
|
+
);
|
|
678
|
+
}
|
|
679
|
+
sections.push("");
|
|
680
|
+
}
|
|
681
|
+
const topPages = await querySearchAnalytics(
|
|
682
|
+
rt.config.proxyFetch,
|
|
683
|
+
siteUrl,
|
|
684
|
+
["page"],
|
|
685
|
+
10
|
|
686
|
+
);
|
|
687
|
+
if (topPages.length > 0) {
|
|
688
|
+
sections.push("#### Top Pages (last 28 days)", "");
|
|
689
|
+
sections.push("| Page | Clicks | Impressions | CTR | Avg Position |");
|
|
690
|
+
sections.push("|------|--------|-------------|-----|-------------|");
|
|
691
|
+
for (const row of topPages) {
|
|
692
|
+
const pg = (row.keys?.[0] ?? "").replace(/\|/g, "\\|");
|
|
693
|
+
const clicks = row.clicks ?? 0;
|
|
694
|
+
const impressions = row.impressions ?? 0;
|
|
695
|
+
const ctr = ((row.ctr ?? 0) * 100).toFixed(1);
|
|
696
|
+
const pos = (row.position ?? 0).toFixed(1);
|
|
697
|
+
sections.push(
|
|
698
|
+
`| ${pg} | ${clicks} | ${impressions} | ${ctr}% | ${pos} |`
|
|
699
|
+
);
|
|
700
|
+
}
|
|
701
|
+
sections.push("");
|
|
702
|
+
}
|
|
703
|
+
const deviceRows = await querySearchAnalytics(
|
|
704
|
+
rt.config.proxyFetch,
|
|
705
|
+
siteUrl,
|
|
706
|
+
["device"],
|
|
707
|
+
5
|
|
708
|
+
);
|
|
709
|
+
if (deviceRows.length > 0) {
|
|
710
|
+
sections.push("#### Device Breakdown (last 28 days)", "");
|
|
711
|
+
sections.push("| Device | Clicks | Impressions | CTR | Avg Position |");
|
|
712
|
+
sections.push("|--------|--------|-------------|-----|-------------|");
|
|
713
|
+
for (const row of deviceRows) {
|
|
714
|
+
const dev = row.keys?.[0] ?? "";
|
|
715
|
+
const clicks = row.clicks ?? 0;
|
|
716
|
+
const impressions = row.impressions ?? 0;
|
|
717
|
+
const ctr = ((row.ctr ?? 0) * 100).toFixed(1);
|
|
718
|
+
const pos = (row.position ?? 0).toFixed(1);
|
|
719
|
+
sections.push(
|
|
720
|
+
`| ${dev} | ${clicks} | ${impressions} | ${ctr}% | ${pos} |`
|
|
721
|
+
);
|
|
722
|
+
}
|
|
723
|
+
sections.push("");
|
|
724
|
+
}
|
|
725
|
+
const countryRows = await querySearchAnalytics(
|
|
726
|
+
rt.config.proxyFetch,
|
|
727
|
+
siteUrl,
|
|
728
|
+
["country"],
|
|
729
|
+
10
|
|
730
|
+
);
|
|
731
|
+
if (countryRows.length > 0) {
|
|
732
|
+
sections.push("#### Top Countries (last 28 days)", "");
|
|
733
|
+
sections.push("| Country | Clicks | Impressions | CTR | Avg Position |");
|
|
734
|
+
sections.push("|---------|--------|-------------|-----|-------------|");
|
|
735
|
+
for (const row of countryRows) {
|
|
736
|
+
const c = row.keys?.[0] ?? "";
|
|
737
|
+
const clicks = row.clicks ?? 0;
|
|
738
|
+
const impressions = row.impressions ?? 0;
|
|
739
|
+
const ctr = ((row.ctr ?? 0) * 100).toFixed(1);
|
|
740
|
+
const pos = (row.position ?? 0).toFixed(1);
|
|
741
|
+
sections.push(
|
|
742
|
+
`| ${c} | ${clicks} | ${impressions} | ${ctr}% | ${pos} |`
|
|
743
|
+
);
|
|
744
|
+
}
|
|
745
|
+
sections.push("");
|
|
746
|
+
}
|
|
635
747
|
}
|
|
636
|
-
sections.push("");
|
|
637
748
|
return sections.join("\n");
|
|
638
749
|
}
|
|
639
750
|
};
|
|
@@ -796,8 +907,8 @@ var googleSearchConsoleOauthConnector = new ConnectorPlugin({
|
|
|
796
907
|
systemPrompt: {
|
|
797
908
|
en: `### Tools
|
|
798
909
|
|
|
799
|
-
- \`
|
|
800
|
-
- \`
|
|
910
|
+
- \`connector_google-search-console-oauth_request\`: Send authenticated requests to the Google Search Console API (Webmasters v3). Use it for searchAnalytics queries, sitemap inspection, and site metadata. The {siteUrl} placeholder in paths is automatically replaced and URL-encoded. Authentication is configured automatically via OAuth.
|
|
911
|
+
- \`connector_google-search-console-oauth_listSites\`: List accessible Search Console sites. Use during setup to discover available properties.
|
|
801
912
|
|
|
802
913
|
### Search Console API Reference
|
|
803
914
|
|
|
@@ -882,8 +993,8 @@ sitemaps.forEach(s => console.log(s.path, s.lastSubmitted));
|
|
|
882
993
|
\`\`\``,
|
|
883
994
|
ja: `### \u30C4\u30FC\u30EB
|
|
884
995
|
|
|
885
|
-
- \`
|
|
886
|
-
- \`
|
|
996
|
+
- \`connector_google-search-console-oauth_request\`: Google Search Console API (Webmasters v3) \u3078\u8A8D\u8A3C\u6E08\u307F\u30EA\u30AF\u30A8\u30B9\u30C8\u3092\u9001\u4FE1\u3057\u307E\u3059\u3002searchAnalytics \u30AF\u30A8\u30EA\u3001\u30B5\u30A4\u30C8\u30DE\u30C3\u30D7\u78BA\u8A8D\u3001\u30B5\u30A4\u30C8\u30E1\u30BF\u30C7\u30FC\u30BF\u306E\u53D6\u5F97\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002\u30D1\u30B9\u5185\u306E{siteUrl}\u30D7\u30EC\u30FC\u30B9\u30DB\u30EB\u30C0\u30FC\u306F\u81EA\u52D5\u7684\u306BURL\u30A8\u30F3\u30B3\u30FC\u30C9\u3055\u308C\u7F6E\u63DB\u3055\u308C\u307E\u3059\u3002OAuth\u7D4C\u7531\u3067\u8A8D\u8A3C\u306F\u81EA\u52D5\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002
|
|
997
|
+
- \`connector_google-search-console-oauth_listSites\`: \u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306ASearch Console\u30B5\u30A4\u30C8\u306E\u4E00\u89A7\u3092\u53D6\u5F97\u3057\u307E\u3059\u3002\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u6642\u306B\u5229\u7528\u53EF\u80FD\u306A\u30D7\u30ED\u30D1\u30C6\u30A3\u3092\u78BA\u8A8D\u3059\u308B\u305F\u3081\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002
|
|
887
998
|
|
|
888
999
|
### Search Console API \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9
|
|
889
1000
|
|
|
@@ -16,6 +16,7 @@ var init_parameter_definition = __esm({
|
|
|
16
16
|
type;
|
|
17
17
|
secret;
|
|
18
18
|
required;
|
|
19
|
+
isDeprecated;
|
|
19
20
|
constructor(config) {
|
|
20
21
|
this.slug = config.slug;
|
|
21
22
|
this.name = config.name;
|
|
@@ -24,6 +25,7 @@ var init_parameter_definition = __esm({
|
|
|
24
25
|
this.type = config.type;
|
|
25
26
|
this.secret = config.secret;
|
|
26
27
|
this.required = config.required;
|
|
28
|
+
this.isDeprecated = config.isDeprecated ?? false;
|
|
27
29
|
}
|
|
28
30
|
/**
|
|
29
31
|
* Get the parameter value from a ConnectorConnectionObject.
|
|
@@ -241,7 +243,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
241
243
|
/**
|
|
242
244
|
* Create tools for connections that belong to this connector.
|
|
243
245
|
* Filters connections by connectorKey internally.
|
|
244
|
-
* Returns tools keyed as
|
|
246
|
+
* Returns tools keyed as `connector_${connectorKey}_${toolName}`.
|
|
245
247
|
*/
|
|
246
248
|
createTools(connections, config, opts) {
|
|
247
249
|
const myConnections = connections.filter(
|
|
@@ -251,7 +253,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
251
253
|
for (const t of Object.values(this.tools)) {
|
|
252
254
|
const tool = t.createTool(myConnections, config);
|
|
253
255
|
const originalToModelOutput = tool.toModelOutput;
|
|
254
|
-
result[
|
|
256
|
+
result[`connector_${this.connectorKey}_${t.name}`] = {
|
|
255
257
|
...tool,
|
|
256
258
|
toModelOutput: async (options) => {
|
|
257
259
|
if (!originalToModelOutput) {
|
|
@@ -701,9 +703,9 @@ var googleSheetsConnector = new ConnectorPlugin({
|
|
|
701
703
|
systemPrompt: {
|
|
702
704
|
en: `### Tools (setup-time only)
|
|
703
705
|
|
|
704
|
-
- \`
|
|
706
|
+
- \`connector_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.
|
|
705
707
|
|
|
706
|
-
> **Important**: The \`
|
|
708
|
+
> **Important**: The \`connector_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.
|
|
707
709
|
|
|
708
710
|
> **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).
|
|
709
711
|
|
|
@@ -775,9 +777,9 @@ await sheets.batchUpdate(spreadsheetId, [
|
|
|
775
777
|
\`\`\``,
|
|
776
778
|
ja: `### \u30C4\u30FC\u30EB\uFF08\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u6642\u306E\u307F\uFF09
|
|
777
779
|
|
|
778
|
-
- \`
|
|
780
|
+
- \`connector_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
|
|
779
781
|
|
|
780
|
-
> **\u91CD\u8981**: \`
|
|
782
|
+
> **\u91CD\u8981**: \`connector_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
|
|
781
783
|
|
|
782
784
|
> **\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
|
|
783
785
|
|
|
@@ -172,7 +172,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
172
172
|
/**
|
|
173
173
|
* Create tools for connections that belong to this connector.
|
|
174
174
|
* Filters connections by connectorKey internally.
|
|
175
|
-
* Returns tools keyed as
|
|
175
|
+
* Returns tools keyed as `connector_${connectorKey}_${toolName}`.
|
|
176
176
|
*/
|
|
177
177
|
createTools(connections, config, opts) {
|
|
178
178
|
const myConnections = connections.filter(
|
|
@@ -182,7 +182,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
182
182
|
for (const t of Object.values(this.tools)) {
|
|
183
183
|
const tool = t.createTool(myConnections, config);
|
|
184
184
|
const originalToModelOutput = tool.toModelOutput;
|
|
185
|
-
result[
|
|
185
|
+
result[`connector_${this.connectorKey}_${t.name}`] = {
|
|
186
186
|
...tool,
|
|
187
187
|
toModelOutput: async (options) => {
|
|
188
188
|
if (!originalToModelOutput) {
|
|
@@ -322,10 +322,10 @@ function normalizeRequestPath(path2, basePathSegment) {
|
|
|
322
322
|
// ../connectors/src/connectors/google-slides/setup.ts
|
|
323
323
|
var googleSlidesOnboarding = new ConnectorOnboarding({
|
|
324
324
|
dataOverviewInstructions: {
|
|
325
|
-
en: `1. Create a new presentation with
|
|
326
|
-
2. Call
|
|
327
|
-
ja: `1.
|
|
328
|
-
2.
|
|
325
|
+
en: `1. Create a new presentation with connector_google-slides-oauth_request (POST with body { title: "..." }) or use an existing presentation ID.
|
|
326
|
+
2. Call connector_google-slides-oauth_request with GET /{presentationId} to fetch presentation metadata (title, slide count, layout info).`,
|
|
327
|
+
ja: `1. connector_google-slides-oauth_request \u3092 POST\uFF08Body: { title: "..." }\uFF09\u3067\u547C\u3073\u51FA\u3057\u3066\u65B0\u3057\u3044\u30D7\u30EC\u30BC\u30F3\u30C6\u30FC\u30B7\u30E7\u30F3\u3092\u4F5C\u6210\u3059\u308B\u304B\u3001\u65E2\u5B58\u306E\u30D7\u30EC\u30BC\u30F3\u30C6\u30FC\u30B7\u30E7\u30F3ID\u3092\u5229\u7528\u3057\u307E\u3059\u3002
|
|
328
|
+
2. connector_google-slides-oauth_request \u3067 GET /{presentationId} \u3092\u547C\u3073\u51FA\u3057\u3001\u30D7\u30EC\u30BC\u30F3\u30C6\u30FC\u30B7\u30E7\u30F3\u306E\u30E1\u30BF\u30C7\u30FC\u30BF\uFF08\u30BF\u30A4\u30C8\u30EB\u3001\u30B9\u30E9\u30A4\u30C9\u6570\u3001\u30EC\u30A4\u30A2\u30A6\u30C8\u60C5\u5831\uFF09\u3092\u53D6\u5F97\u3057\u307E\u3059\u3002`
|
|
329
329
|
}
|
|
330
330
|
});
|
|
331
331
|
|
|
@@ -561,9 +561,9 @@ var googleSlidesConnector = new ConnectorPlugin({
|
|
|
561
561
|
systemPrompt: {
|
|
562
562
|
en: `### Tools (setup-time only)
|
|
563
563
|
|
|
564
|
-
- \`
|
|
564
|
+
- \`connector_google-slides-oauth_request\`: Call the Google Slides API directly during setup / data overview. Supports read and write operations. Use it to get presentation metadata, slide content, create new presentations, and modify slides. Authentication is configured automatically via OAuth.
|
|
565
565
|
|
|
566
|
-
> **Important**: The \`
|
|
566
|
+
> **Important**: The \`connector_google-slides-oauth_request\` tool is only available at setup time. Inside server-logic handlers, use the SDK (\`connection(id).createPresentation\`, 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.
|
|
567
567
|
|
|
568
568
|
### Google Slides API Reference
|
|
569
569
|
|
|
@@ -640,9 +640,9 @@ await slides.batchUpdate(presentationId, [
|
|
|
640
640
|
If a handler test fails with \`Connection proxy is not configured\`, retry \u2014 this usually means the sandbox is still initializing. Do NOT abandon the SDK and construct OAuth proxy URLs manually.`,
|
|
641
641
|
ja: `### \u30C4\u30FC\u30EB\uFF08\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u6642\u306E\u307F\uFF09
|
|
642
642
|
|
|
643
|
-
- \`
|
|
643
|
+
- \`connector_google-slides-oauth_request\`: \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3084\u30C7\u30FC\u30BF\u6982\u8981\u628A\u63E1\u6642\u306B Google Slides API \u3092\u76F4\u63A5\u53E9\u304F\u30C4\u30FC\u30EB\u3067\u3059\u3002\u8AAD\u307F\u53D6\u308A\u3068\u66F8\u304D\u8FBC\u307F\u306E\u4E21\u65B9\u3092\u30B5\u30DD\u30FC\u30C8\u3057\u307E\u3059\u3002\u30D7\u30EC\u30BC\u30F3\u30C6\u30FC\u30B7\u30E7\u30F3\u306E\u30E1\u30BF\u30C7\u30FC\u30BF\u30FB\u30B9\u30E9\u30A4\u30C9\u5185\u5BB9\u306E\u53D6\u5F97\u3001\u65B0\u3057\u3044\u30D7\u30EC\u30BC\u30F3\u30C6\u30FC\u30B7\u30E7\u30F3\u306E\u4F5C\u6210\u3001\u30B9\u30E9\u30A4\u30C9\u306E\u5909\u66F4\u306A\u3069\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002OAuth \u7D4C\u7531\u3067\u8A8D\u8A3C\u306F\u81EA\u52D5\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002
|
|
644
644
|
|
|
645
|
-
> **\u91CD\u8981**: \`
|
|
645
|
+
> **\u91CD\u8981**: \`connector_google-slides-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).createPresentation\` \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
|
|
646
646
|
|
|
647
647
|
### Google Slides API \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9
|
|
648
648
|
|
|
@@ -16,6 +16,7 @@ var init_parameter_definition = __esm({
|
|
|
16
16
|
type;
|
|
17
17
|
secret;
|
|
18
18
|
required;
|
|
19
|
+
isDeprecated;
|
|
19
20
|
constructor(config) {
|
|
20
21
|
this.slug = config.slug;
|
|
21
22
|
this.name = config.name;
|
|
@@ -24,6 +25,7 @@ var init_parameter_definition = __esm({
|
|
|
24
25
|
this.type = config.type;
|
|
25
26
|
this.secret = config.secret;
|
|
26
27
|
this.required = config.required;
|
|
28
|
+
this.isDeprecated = config.isDeprecated ?? false;
|
|
27
29
|
}
|
|
28
30
|
/**
|
|
29
31
|
* Get the parameter value from a ConnectorConnectionObject.
|
|
@@ -281,7 +283,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
281
283
|
/**
|
|
282
284
|
* Create tools for connections that belong to this connector.
|
|
283
285
|
* Filters connections by connectorKey internally.
|
|
284
|
-
* Returns tools keyed as
|
|
286
|
+
* Returns tools keyed as `connector_${connectorKey}_${toolName}`.
|
|
285
287
|
*/
|
|
286
288
|
createTools(connections, config, opts) {
|
|
287
289
|
const myConnections = connections.filter(
|
|
@@ -291,7 +293,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
291
293
|
for (const t of Object.values(this.tools)) {
|
|
292
294
|
const tool = t.createTool(myConnections, config);
|
|
293
295
|
const originalToModelOutput = tool.toModelOutput;
|
|
294
|
-
result[
|
|
296
|
+
result[`connector_${this.connectorKey}_${t.name}`] = {
|
|
295
297
|
...tool,
|
|
296
298
|
toModelOutput: async (options) => {
|
|
297
299
|
if (!originalToModelOutput) {
|
|
@@ -421,12 +423,12 @@ var AUTH_TYPES = {
|
|
|
421
423
|
// ../connectors/src/connectors/grafana/setup.ts
|
|
422
424
|
var grafanaOnboarding = new ConnectorOnboarding({
|
|
423
425
|
dataOverviewInstructions: {
|
|
424
|
-
en: `1. Call
|
|
425
|
-
2. Call
|
|
426
|
-
3. For a specific datasource, call
|
|
427
|
-
ja: `1.
|
|
428
|
-
2.
|
|
429
|
-
3. \u7279\u5B9A\u306E\u30C7\u30FC\u30BF\u30BD\u30FC\u30B9\u306B\u5BFE\u3057\u3066
|
|
426
|
+
en: `1. Call connector_grafana_request with GET /api/datasources to list all configured datasources
|
|
427
|
+
2. Call connector_grafana_request with GET /api/search?type=dash-db&limit=10 to list dashboards
|
|
428
|
+
3. For a specific datasource, call connector_grafana_request with POST /api/ds/query to run a test query`,
|
|
429
|
+
ja: `1. connector_grafana_request \u3067 GET /api/datasources \u3092\u547C\u3073\u51FA\u3057\u3001\u8A2D\u5B9A\u6E08\u307F\u306E\u30C7\u30FC\u30BF\u30BD\u30FC\u30B9\u4E00\u89A7\u3092\u53D6\u5F97
|
|
430
|
+
2. connector_grafana_request \u3067 GET /api/search?type=dash-db&limit=10 \u3092\u547C\u3073\u51FA\u3057\u3001\u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9\u4E00\u89A7\u3092\u53D6\u5F97
|
|
431
|
+
3. \u7279\u5B9A\u306E\u30C7\u30FC\u30BF\u30BD\u30FC\u30B9\u306B\u5BFE\u3057\u3066 connector_grafana_request \u3067 POST /api/ds/query \u3092\u547C\u3073\u51FA\u3057\u3001\u30C6\u30B9\u30C8\u30AF\u30A8\u30EA\u3092\u5B9F\u884C`
|
|
430
432
|
}
|
|
431
433
|
});
|
|
432
434
|
|
|
@@ -477,6 +479,26 @@ async function listDatasources(params) {
|
|
|
477
479
|
const data = await res.json();
|
|
478
480
|
return data ?? [];
|
|
479
481
|
}
|
|
482
|
+
async function countDashboards(params) {
|
|
483
|
+
try {
|
|
484
|
+
const res = await apiFetch(params, "/api/search?type=dash-db&limit=5000");
|
|
485
|
+
if (!res.ok) return null;
|
|
486
|
+
const data = await res.json();
|
|
487
|
+
return Array.isArray(data) ? data.length : null;
|
|
488
|
+
} catch {
|
|
489
|
+
return null;
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
async function countAlertRules(params) {
|
|
493
|
+
try {
|
|
494
|
+
const res = await apiFetch(params, "/api/alert-rules");
|
|
495
|
+
if (!res.ok) return null;
|
|
496
|
+
const data = await res.json();
|
|
497
|
+
return Array.isArray(data) ? data.length : null;
|
|
498
|
+
} catch {
|
|
499
|
+
return null;
|
|
500
|
+
}
|
|
501
|
+
}
|
|
480
502
|
var grafanaSetupFlow = {
|
|
481
503
|
initialState: () => ({}),
|
|
482
504
|
steps: [
|
|
@@ -549,6 +571,21 @@ var grafanaSetupFlow = {
|
|
|
549
571
|
sections.push(`| Default | ${ds.isDefault ? "yes" : "no"} |`);
|
|
550
572
|
sections.push("");
|
|
551
573
|
}
|
|
574
|
+
const [dashboardCount, alertCount] = await Promise.all([
|
|
575
|
+
countDashboards(rt.params),
|
|
576
|
+
countAlertRules(rt.params)
|
|
577
|
+
]);
|
|
578
|
+
if (dashboardCount != null || alertCount != null) {
|
|
579
|
+
sections.push(
|
|
580
|
+
rt.language === "ja" ? "### \u30B3\u30F3\u30C6\u30F3\u30C4\u6982\u8981" : "### Content overview",
|
|
581
|
+
""
|
|
582
|
+
);
|
|
583
|
+
sections.push("| Resource | Count |");
|
|
584
|
+
sections.push("|----------|-------|");
|
|
585
|
+
sections.push(`| Dashboards | ${dashboardCount ?? "-"} |`);
|
|
586
|
+
sections.push(`| Alert rules | ${alertCount ?? "-"} |`);
|
|
587
|
+
sections.push("");
|
|
588
|
+
}
|
|
552
589
|
return sections.join("\n");
|
|
553
590
|
}
|
|
554
591
|
};
|
|
@@ -650,7 +687,7 @@ var grafanaConnector = new ConnectorPlugin({
|
|
|
650
687
|
systemPrompt: {
|
|
651
688
|
en: `### Tools
|
|
652
689
|
|
|
653
|
-
- \`
|
|
690
|
+
- \`connector_grafana_request\`: The only way to call the Grafana HTTP API. Use it to list datasources, search dashboards, execute datasource queries, manage alerts, and read annotations. Authentication is handled automatically via Bearer token. The path must start with \`/\`.
|
|
654
691
|
|
|
655
692
|
### Business Logic
|
|
656
693
|
|
|
@@ -708,7 +745,7 @@ export default async function handler(c: Context) {
|
|
|
708
745
|
- \`GET /api/health\` \u2014 Health check`,
|
|
709
746
|
ja: `### \u30C4\u30FC\u30EB
|
|
710
747
|
|
|
711
|
-
- \`
|
|
748
|
+
- \`connector_grafana_request\`: Grafana HTTP API\u3092\u547C\u3073\u51FA\u3059\u552F\u4E00\u306E\u624B\u6BB5\u3067\u3059\u3002\u30C7\u30FC\u30BF\u30BD\u30FC\u30B9\u306E\u4E00\u89A7\u53D6\u5F97\u3001\u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9\u691C\u7D22\u3001\u30C7\u30FC\u30BF\u30BD\u30FC\u30B9\u30AF\u30A8\u30EA\u306E\u5B9F\u884C\u3001\u30A2\u30E9\u30FC\u30C8\u7BA1\u7406\u3001\u30A2\u30CE\u30C6\u30FC\u30B7\u30E7\u30F3\u306E\u8AAD\u307F\u53D6\u308A\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002\u8A8D\u8A3C\u306FBearer\u30C8\u30FC\u30AF\u30F3\u3067\u81EA\u52D5\u51E6\u7406\u3055\u308C\u307E\u3059\u3002\u30D1\u30B9\u306F \`/\` \u3067\u59CB\u3081\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
|
|
712
749
|
|
|
713
750
|
### Business Logic
|
|
714
751
|
|
|
@@ -114,7 +114,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
114
114
|
/**
|
|
115
115
|
* Create tools for connections that belong to this connector.
|
|
116
116
|
* Filters connections by connectorKey internally.
|
|
117
|
-
* Returns tools keyed as
|
|
117
|
+
* Returns tools keyed as `connector_${connectorKey}_${toolName}`.
|
|
118
118
|
*/
|
|
119
119
|
createTools(connections, config, opts) {
|
|
120
120
|
const myConnections = connections.filter(
|
|
@@ -124,7 +124,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
124
124
|
for (const t of Object.values(this.tools)) {
|
|
125
125
|
const tool = t.createTool(myConnections, config);
|
|
126
126
|
const originalToModelOutput = tool.toModelOutput;
|
|
127
|
-
result[
|
|
127
|
+
result[`connector_${this.connectorKey}_${t.name}`] = {
|
|
128
128
|
...tool,
|
|
129
129
|
toModelOutput: async (options) => {
|
|
130
130
|
if (!originalToModelOutput) {
|
|
@@ -392,11 +392,11 @@ var hubspotOnboarding = new ConnectorOnboarding({
|
|
|
392
392
|
- Write only 1 sentence between tool calls, then immediately call the next tool. Skip unnecessary explanations and proceed efficiently`
|
|
393
393
|
},
|
|
394
394
|
dataOverviewInstructions: {
|
|
395
|
-
en: `1. Call
|
|
396
|
-
2. Call
|
|
395
|
+
en: `1. Call connector_hubspot-oauth_request with GET /crm/v3/objects/contacts?limit=5 to explore contacts structure
|
|
396
|
+
2. Call connector_hubspot-oauth_request with GET /crm/v3/objects/deals?limit=5 to explore deals structure
|
|
397
397
|
3. Explore other object types (companies, etc.) as needed to understand available data`,
|
|
398
|
-
ja: `1.
|
|
399
|
-
2.
|
|
398
|
+
ja: `1. connector_hubspot-oauth_request \u3067 GET /crm/v3/objects/contacts?limit=5 \u3092\u547C\u3073\u51FA\u3057\u3001\u30B3\u30F3\u30BF\u30AF\u30C8\u306E\u69CB\u9020\u3092\u78BA\u8A8D
|
|
399
|
+
2. connector_hubspot-oauth_request \u3067 GET /crm/v3/objects/deals?limit=5 \u3092\u547C\u3073\u51FA\u3057\u3001\u53D6\u5F15\u306E\u69CB\u9020\u3092\u78BA\u8A8D
|
|
400
400
|
3. \u5FC5\u8981\u306B\u5FDC\u3058\u3066\u4ED6\u306E\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u30BF\u30A4\u30D7\uFF08\u4F01\u696D\u306A\u3069\uFF09\u3092\u63A2\u7D22\u3057\u3001\u5229\u7528\u53EF\u80FD\u306A\u30C7\u30FC\u30BF\u3092\u628A\u63E1`
|
|
401
401
|
}
|
|
402
402
|
});
|
|
@@ -434,6 +434,19 @@ async function listProperties(proxyFetch, objectType) {
|
|
|
434
434
|
const data = await res.json();
|
|
435
435
|
return data.results ?? [];
|
|
436
436
|
}
|
|
437
|
+
async function fetchObjectCount(proxyFetch, objectType) {
|
|
438
|
+
try {
|
|
439
|
+
const res = await apiFetch(
|
|
440
|
+
proxyFetch,
|
|
441
|
+
`/crm/v3/objects/${objectType}?limit=1`
|
|
442
|
+
);
|
|
443
|
+
if (!res.ok) return null;
|
|
444
|
+
const data = await res.json();
|
|
445
|
+
return typeof data.total === "number" ? data.total : null;
|
|
446
|
+
} catch {
|
|
447
|
+
return null;
|
|
448
|
+
}
|
|
449
|
+
}
|
|
437
450
|
var hubspotOauthSetupFlow = {
|
|
438
451
|
initialState: () => ({}),
|
|
439
452
|
steps: [
|
|
@@ -464,8 +477,27 @@ var hubspotOauthSetupFlow = {
|
|
|
464
477
|
limit: HUBSPOT_SETUP_MAX_OBJECT_TYPES
|
|
465
478
|
});
|
|
466
479
|
const sections = ["## HubSpot", ""];
|
|
480
|
+
const countByType = /* @__PURE__ */ new Map();
|
|
481
|
+
for (const objectType of targetObjectTypes) {
|
|
482
|
+
countByType.set(
|
|
483
|
+
objectType,
|
|
484
|
+
await fetchObjectCount(rt.config.proxyFetch, objectType)
|
|
485
|
+
);
|
|
486
|
+
}
|
|
487
|
+
sections.push("### Record counts", "");
|
|
488
|
+
sections.push("| Object type | Record count |");
|
|
489
|
+
sections.push("|-------------|-------------|");
|
|
490
|
+
for (const objectType of targetObjectTypes) {
|
|
491
|
+
const count = countByType.get(objectType);
|
|
492
|
+
sections.push(
|
|
493
|
+
`| ${objectType} | ${count == null ? "-" : count.toLocaleString()} |`
|
|
494
|
+
);
|
|
495
|
+
}
|
|
496
|
+
sections.push("");
|
|
467
497
|
for (const objectType of targetObjectTypes) {
|
|
468
|
-
|
|
498
|
+
const count = countByType.get(objectType);
|
|
499
|
+
const countLabel = count == null ? "" : ` (${count.toLocaleString()} records)`;
|
|
500
|
+
sections.push(`### Object: ${objectType}${countLabel}`, "");
|
|
469
501
|
const props = await listProperties(rt.config.proxyFetch, objectType);
|
|
470
502
|
const limited = props.slice(0, HUBSPOT_SETUP_MAX_PROPERTIES);
|
|
471
503
|
sections.push("| Property | Type | Label |");
|
|
@@ -515,7 +547,7 @@ var hubspotOauthConnector = new ConnectorPlugin({
|
|
|
515
547
|
systemPrompt: {
|
|
516
548
|
en: `### Tools
|
|
517
549
|
|
|
518
|
-
- \`
|
|
550
|
+
- \`connector_hubspot-oauth_request\`: The only way to call the HubSpot API. Use it to query contacts, deals, companies, and other CRM objects. Authentication is configured automatically via OAuth. HubSpot uses cursor-based pagination with the \`after\` parameter from \`paging.next.after\` in the response.
|
|
519
551
|
|
|
520
552
|
### HubSpot API Reference
|
|
521
553
|
|
|
@@ -560,7 +592,7 @@ const data = await res.json();
|
|
|
560
592
|
\`\`\``,
|
|
561
593
|
ja: `### \u30C4\u30FC\u30EB
|
|
562
594
|
|
|
563
|
-
- \`
|
|
595
|
+
- \`connector_hubspot-oauth_request\`: HubSpot API\u3092\u547C\u3073\u51FA\u3059\u552F\u4E00\u306E\u624B\u6BB5\u3067\u3059\u3002\u30B3\u30F3\u30BF\u30AF\u30C8\u3001\u53D6\u5F15\u3001\u4F1A\u793E\u3001\u305D\u306E\u4ED6\u306ECRM\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u30AF\u30A8\u30EA\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002OAuth\u7D4C\u7531\u3067\u8A8D\u8A3C\u306F\u81EA\u52D5\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002HubSpot\u306F\u30EC\u30B9\u30DD\u30F3\u30B9\u306E \`paging.next.after\` \u304B\u3089\u306E \`after\` \u30D1\u30E9\u30E1\u30FC\u30BF\u306B\u3088\u308B\u30AB\u30FC\u30BD\u30EB\u30D9\u30FC\u30B9\u306E\u30DA\u30FC\u30B8\u30CD\u30FC\u30B7\u30E7\u30F3\u3092\u4F7F\u7528\u3057\u307E\u3059\u3002
|
|
564
596
|
|
|
565
597
|
### HubSpot API \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9
|
|
566
598
|
|