@squadbase/vite-server 0.1.17-dev.3b633bb → 0.1.17-dev.71a85cd
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 +3310 -742
- 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 +21 -21
- package/dist/connectors/powerbi-oauth.js +13 -13
- 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 +17 -15
- 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 +3339 -746
- package/dist/main.js +3328 -740
- package/dist/vite-plugin.js +3308 -740
- 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.
|
|
@@ -224,7 +226,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
224
226
|
/**
|
|
225
227
|
* Create tools for connections that belong to this connector.
|
|
226
228
|
* Filters connections by connectorKey internally.
|
|
227
|
-
* Returns tools keyed as
|
|
229
|
+
* Returns tools keyed as `connector_${connectorKey}_${toolName}`.
|
|
228
230
|
*/
|
|
229
231
|
createTools(connections, config, opts) {
|
|
230
232
|
const myConnections = connections.filter(
|
|
@@ -234,7 +236,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
234
236
|
for (const t of Object.values(this.tools)) {
|
|
235
237
|
const tool = t.createTool(myConnections, config);
|
|
236
238
|
const originalToModelOutput = tool.toModelOutput;
|
|
237
|
-
result[
|
|
239
|
+
result[`connector_${this.connectorKey}_${t.name}`] = {
|
|
238
240
|
...tool,
|
|
239
241
|
toModelOutput: async (options) => {
|
|
240
242
|
if (!originalToModelOutput) {
|
|
@@ -806,7 +808,7 @@ var googleAuditLogConnector = new ConnectorPlugin({
|
|
|
806
808
|
systemPrompt: {
|
|
807
809
|
en: `### Tools
|
|
808
810
|
|
|
809
|
-
- \`
|
|
811
|
+
- \`connector_google-audit-log-service-account_request_with_delegation\`: Call the Google Workspace Admin SDK Reports API on behalf of a Workspace admin via Domain-wide Delegation. Pass \`subject\` as the admin email; the token will be issued as that user. Always pass \`scopes\`.
|
|
810
812
|
|
|
811
813
|
### OAuth Scopes (pass as \`scopes\` argument)
|
|
812
814
|
|
|
@@ -895,7 +897,7 @@ export default async function handler(c: Context) {
|
|
|
895
897
|
\`\`\``,
|
|
896
898
|
ja: `### \u30C4\u30FC\u30EB
|
|
897
899
|
|
|
898
|
-
- \`
|
|
900
|
+
- \`connector_google-audit-log-service-account_request_with_delegation\`: Domain-wide Delegation \u7D4C\u7531\u3067 Workspace \u7BA1\u7406\u8005\u306B\u306A\u308A\u3059\u307E\u3057\u3066 Google Workspace Admin SDK Reports API \u3092\u547C\u3073\u51FA\u3057\u307E\u3059\u3002\u4EE3\u7406\u5BFE\u8C61\u306E\u7BA1\u7406\u8005\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092 \`subject\` \u3068\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u30C8\u30FC\u30AF\u30F3\u306F\u305D\u306E\u30E6\u30FC\u30B6\u30FC\u3068\u3057\u3066\u767A\u884C\u3055\u308C\u307E\u3059\u3002\`scopes\` \u3082\u6BCE\u56DE\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
|
899
901
|
|
|
900
902
|
### OAuth \u30B9\u30B3\u30FC\u30D7 (\`scopes\` \u5F15\u6570\u3067\u6E21\u3059)
|
|
901
903
|
|
|
@@ -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.
|
|
@@ -240,7 +242,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
240
242
|
/**
|
|
241
243
|
* Create tools for connections that belong to this connector.
|
|
242
244
|
* Filters connections by connectorKey internally.
|
|
243
|
-
* Returns tools keyed as
|
|
245
|
+
* Returns tools keyed as `connector_${connectorKey}_${toolName}`.
|
|
244
246
|
*/
|
|
245
247
|
createTools(connections, config, opts) {
|
|
246
248
|
const myConnections = connections.filter(
|
|
@@ -250,7 +252,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
250
252
|
for (const t of Object.values(this.tools)) {
|
|
251
253
|
const tool = t.createTool(myConnections, config);
|
|
252
254
|
const originalToModelOutput = tool.toModelOutput;
|
|
253
|
-
result[
|
|
255
|
+
result[`connector_${this.connectorKey}_${t.name}`] = {
|
|
254
256
|
...tool,
|
|
255
257
|
toModelOutput: async (options) => {
|
|
256
258
|
if (!originalToModelOutput) {
|
|
@@ -535,10 +537,10 @@ var googleCalendarOauthOnboarding = new ConnectorOnboarding({
|
|
|
535
537
|
- Write only 1 sentence between tool calls, then immediately call the next tool. Skip unnecessary explanations and proceed efficiently`
|
|
536
538
|
},
|
|
537
539
|
dataOverviewInstructions: {
|
|
538
|
-
en: `1. Call
|
|
539
|
-
2. Call
|
|
540
|
-
ja: `1.
|
|
541
|
-
2.
|
|
540
|
+
en: `1. Call connector_google-calendar-oauth_request with GET /calendars/{calendarId} to get the default calendar's metadata
|
|
541
|
+
2. Call connector_google-calendar-oauth_request with GET /calendars/{calendarId}/events with query params timeMin (current RFC3339 timestamp), singleEvents=true, orderBy=startTime, and maxResults=10 to sample upcoming events`,
|
|
542
|
+
ja: `1. connector_google-calendar-oauth_request \u3067 GET /calendars/{calendarId} \u3092\u547C\u3073\u51FA\u3057\u3001\u30C7\u30D5\u30A9\u30EB\u30C8\u30AB\u30EC\u30F3\u30C0\u30FC\u306E\u30E1\u30BF\u30C7\u30FC\u30BF\u3092\u53D6\u5F97
|
|
543
|
+
2. connector_google-calendar-oauth_request \u3067 GET /calendars/{calendarId}/events \u3092\u30AF\u30A8\u30EA\u30D1\u30E9\u30E1\u30FC\u30BF timeMin\uFF08\u73FE\u5728\u306ERFC3339\u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\uFF09\u3001singleEvents=true\u3001orderBy=startTime\u3001maxResults=10 \u3067\u547C\u3073\u51FA\u3057\u3001\u76F4\u8FD1\u306E\u30A4\u30D9\u30F3\u30C8\u3092\u30B5\u30F3\u30D7\u30EA\u30F3\u30B0`
|
|
542
544
|
}
|
|
543
545
|
});
|
|
544
546
|
|
|
@@ -562,6 +564,37 @@ async function listCalendars(config) {
|
|
|
562
564
|
const data = await calendarApiFetch(config, url);
|
|
563
565
|
return data.items ?? [];
|
|
564
566
|
}
|
|
567
|
+
async function fetchEventActivity(config, calendarId) {
|
|
568
|
+
try {
|
|
569
|
+
const now = /* @__PURE__ */ new Date();
|
|
570
|
+
const thirtyDaysAgo = new Date(now.getTime() - 30 * 24 * 60 * 60 * 1e3);
|
|
571
|
+
const qs = new URLSearchParams({
|
|
572
|
+
maxResults: "250",
|
|
573
|
+
timeMin: thirtyDaysAgo.toISOString(),
|
|
574
|
+
timeMax: now.toISOString(),
|
|
575
|
+
showDeleted: "true"
|
|
576
|
+
});
|
|
577
|
+
const url = `https://www.googleapis.com/calendar/v3/calendars/${encodeURIComponent(
|
|
578
|
+
calendarId
|
|
579
|
+
)}/events?${qs.toString()}`;
|
|
580
|
+
const data = await calendarApiFetch(config, url);
|
|
581
|
+
const items = data.items ?? [];
|
|
582
|
+
const activity = {
|
|
583
|
+
total: items.length,
|
|
584
|
+
confirmed: 0,
|
|
585
|
+
tentative: 0,
|
|
586
|
+
cancelled: 0
|
|
587
|
+
};
|
|
588
|
+
for (const ev of items) {
|
|
589
|
+
if (ev.status === "confirmed") activity.confirmed += 1;
|
|
590
|
+
else if (ev.status === "tentative") activity.tentative += 1;
|
|
591
|
+
else if (ev.status === "cancelled") activity.cancelled += 1;
|
|
592
|
+
}
|
|
593
|
+
return activity;
|
|
594
|
+
} catch {
|
|
595
|
+
return null;
|
|
596
|
+
}
|
|
597
|
+
}
|
|
565
598
|
function displayName(c) {
|
|
566
599
|
return c.summaryOverride ?? c.summary ?? c.id;
|
|
567
600
|
}
|
|
@@ -607,19 +640,34 @@ var googleCalendarOauthSetupFlow = {
|
|
|
607
640
|
);
|
|
608
641
|
return sections.join("\n");
|
|
609
642
|
}
|
|
610
|
-
sections.push(
|
|
611
|
-
|
|
612
|
-
|
|
643
|
+
sections.push(
|
|
644
|
+
"| Calendar | Time Zone | Primary | Access | Events (30d) | Confirmed | Tentative | Cancelled |"
|
|
645
|
+
);
|
|
646
|
+
sections.push(
|
|
647
|
+
"|----------|-----------|---------|--------|--------------|-----------|-----------|-----------|"
|
|
648
|
+
);
|
|
649
|
+
const activities = await Promise.all(
|
|
650
|
+
targetIds.map((id) => fetchEventActivity(rt.config, id))
|
|
651
|
+
);
|
|
652
|
+
for (let i = 0; i < targetIds.length; i++) {
|
|
653
|
+
const id = targetIds[i];
|
|
613
654
|
const c = byId.get(id);
|
|
655
|
+
const activity = activities[i] ?? null;
|
|
656
|
+
const total = activity ? String(activity.total) : "-";
|
|
657
|
+
const confirmed = activity ? String(activity.confirmed) : "-";
|
|
658
|
+
const tentative = activity ? String(activity.tentative) : "-";
|
|
659
|
+
const cancelled = activity ? String(activity.cancelled) : "-";
|
|
614
660
|
if (!c) {
|
|
615
|
-
sections.push(
|
|
661
|
+
sections.push(
|
|
662
|
+
`| ${id} | - | - | - | ${total} | ${confirmed} | ${tentative} | ${cancelled} |`
|
|
663
|
+
);
|
|
616
664
|
continue;
|
|
617
665
|
}
|
|
618
666
|
const tz = c.timeZone ?? "-";
|
|
619
667
|
const primary = c.primary ? "yes" : "no";
|
|
620
668
|
const access = c.accessRole ?? "-";
|
|
621
669
|
sections.push(
|
|
622
|
-
`| ${displayName(c)} | ${tz} | ${primary} | ${access} |`
|
|
670
|
+
`| ${displayName(c)} | ${tz} | ${primary} | ${access} | ${total} | ${confirmed} | ${tentative} | ${cancelled} |`
|
|
623
671
|
);
|
|
624
672
|
}
|
|
625
673
|
sections.push("");
|
|
@@ -781,8 +829,8 @@ var googleCalendarOauthConnector = new ConnectorPlugin({
|
|
|
781
829
|
systemPrompt: {
|
|
782
830
|
en: `### Tools
|
|
783
831
|
|
|
784
|
-
- \`
|
|
785
|
-
- \`
|
|
832
|
+
- \`connector_google-calendar-oauth_request\`: Send authenticated requests to the Google Calendar API v3. Use it to list calendars, get events, and manage calendar data. The {calendarId} placeholder in paths is automatically replaced. Authentication is configured automatically via OAuth.
|
|
833
|
+
- \`connector_google-calendar-oauth_listCalendars\`: List accessible Google Calendars. Use during setup to discover available calendars.
|
|
786
834
|
|
|
787
835
|
### Google Calendar API v3 Reference
|
|
788
836
|
|
|
@@ -846,8 +894,8 @@ console.log(event.summary, event.attendees);
|
|
|
846
894
|
\`\`\``,
|
|
847
895
|
ja: `### \u30C4\u30FC\u30EB
|
|
848
896
|
|
|
849
|
-
- \`
|
|
850
|
-
- \`
|
|
897
|
+
- \`connector_google-calendar-oauth_request\`: Google Calendar API v3\u3078\u8A8D\u8A3C\u6E08\u307F\u30EA\u30AF\u30A8\u30B9\u30C8\u3092\u9001\u4FE1\u3057\u307E\u3059\u3002\u30AB\u30EC\u30F3\u30C0\u30FC\u306E\u4E00\u89A7\u53D6\u5F97\u3001\u30A4\u30D9\u30F3\u30C8\u306E\u53D6\u5F97\u3001\u30AB\u30EC\u30F3\u30C0\u30FC\u30C7\u30FC\u30BF\u306E\u7BA1\u7406\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002\u30D1\u30B9\u5185\u306E{calendarId}\u30D7\u30EC\u30FC\u30B9\u30DB\u30EB\u30C0\u30FC\u306F\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
|
|
898
|
+
- \`connector_google-calendar-oauth_listCalendars\`: \u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306AGoogle Calendar\u306E\u4E00\u89A7\u3092\u53D6\u5F97\u3057\u307E\u3059\u3002\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u6642\u306B\u5229\u7528\u53EF\u80FD\u306A\u30AB\u30EC\u30F3\u30C0\u30FC\u3092\u78BA\u8A8D\u3059\u308B\u305F\u3081\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002
|
|
851
899
|
|
|
852
900
|
### Google Calendar API v3 \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9
|
|
853
901
|
|
|
@@ -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.
|
|
@@ -245,7 +247,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
245
247
|
/**
|
|
246
248
|
* Create tools for connections that belong to this connector.
|
|
247
249
|
* Filters connections by connectorKey internally.
|
|
248
|
-
* Returns tools keyed as
|
|
250
|
+
* Returns tools keyed as `connector_${connectorKey}_${toolName}`.
|
|
249
251
|
*/
|
|
250
252
|
createTools(connections, config, opts) {
|
|
251
253
|
const myConnections = connections.filter(
|
|
@@ -255,7 +257,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
255
257
|
for (const t of Object.values(this.tools)) {
|
|
256
258
|
const tool = t.createTool(myConnections, config);
|
|
257
259
|
const originalToModelOutput = tool.toModelOutput;
|
|
258
|
-
result[
|
|
260
|
+
result[`connector_${this.connectorKey}_${t.name}`] = {
|
|
259
261
|
...tool,
|
|
260
262
|
toModelOutput: async (options) => {
|
|
261
263
|
if (!originalToModelOutput) {
|
|
@@ -930,6 +932,41 @@ async function listCalendars(params, subject) {
|
|
|
930
932
|
);
|
|
931
933
|
return data.items ?? [];
|
|
932
934
|
}
|
|
935
|
+
async function fetchEventActivity(params, subject, calendarId) {
|
|
936
|
+
try {
|
|
937
|
+
const now = /* @__PURE__ */ new Date();
|
|
938
|
+
const thirtyDaysAgo = new Date(now.getTime() - 30 * 24 * 60 * 60 * 1e3);
|
|
939
|
+
const qs = new URLSearchParams({
|
|
940
|
+
maxResults: "250",
|
|
941
|
+
timeMin: thirtyDaysAgo.toISOString(),
|
|
942
|
+
timeMax: now.toISOString(),
|
|
943
|
+
showDeleted: "true"
|
|
944
|
+
});
|
|
945
|
+
const url = `https://www.googleapis.com/calendar/v3/calendars/${encodeURIComponent(
|
|
946
|
+
calendarId
|
|
947
|
+
)}/events?${qs.toString()}`;
|
|
948
|
+
const data = await calendarApiFetch(
|
|
949
|
+
params,
|
|
950
|
+
subject,
|
|
951
|
+
url
|
|
952
|
+
);
|
|
953
|
+
const items = data.items ?? [];
|
|
954
|
+
const activity = {
|
|
955
|
+
total: items.length,
|
|
956
|
+
confirmed: 0,
|
|
957
|
+
tentative: 0,
|
|
958
|
+
cancelled: 0
|
|
959
|
+
};
|
|
960
|
+
for (const ev of items) {
|
|
961
|
+
if (ev.status === "confirmed") activity.confirmed += 1;
|
|
962
|
+
else if (ev.status === "tentative") activity.tentative += 1;
|
|
963
|
+
else if (ev.status === "cancelled") activity.cancelled += 1;
|
|
964
|
+
}
|
|
965
|
+
return activity;
|
|
966
|
+
} catch {
|
|
967
|
+
return null;
|
|
968
|
+
}
|
|
969
|
+
}
|
|
933
970
|
function displayName(c) {
|
|
934
971
|
return c.summaryOverride ?? c.summary ?? c.id;
|
|
935
972
|
}
|
|
@@ -996,19 +1033,34 @@ var googleCalendarSetupFlow = {
|
|
|
996
1033
|
);
|
|
997
1034
|
return sections.join("\n");
|
|
998
1035
|
}
|
|
999
|
-
sections.push(
|
|
1000
|
-
|
|
1001
|
-
|
|
1036
|
+
sections.push(
|
|
1037
|
+
"| Calendar | Time Zone | Primary | Access | Events (30d) | Confirmed | Tentative | Cancelled |"
|
|
1038
|
+
);
|
|
1039
|
+
sections.push(
|
|
1040
|
+
"|----------|-----------|---------|--------|--------------|-----------|-----------|-----------|"
|
|
1041
|
+
);
|
|
1042
|
+
const activities = await Promise.all(
|
|
1043
|
+
targetIds.map((id) => fetchEventActivity(rt.params, subj, id))
|
|
1044
|
+
);
|
|
1045
|
+
for (let i = 0; i < targetIds.length; i++) {
|
|
1046
|
+
const id = targetIds[i];
|
|
1002
1047
|
const c = byId.get(id);
|
|
1048
|
+
const activity = activities[i] ?? null;
|
|
1049
|
+
const total = activity ? String(activity.total) : "-";
|
|
1050
|
+
const confirmed = activity ? String(activity.confirmed) : "-";
|
|
1051
|
+
const tentative = activity ? String(activity.tentative) : "-";
|
|
1052
|
+
const cancelled = activity ? String(activity.cancelled) : "-";
|
|
1003
1053
|
if (!c) {
|
|
1004
|
-
sections.push(
|
|
1054
|
+
sections.push(
|
|
1055
|
+
`| ${id} | - | - | - | ${total} | ${confirmed} | ${tentative} | ${cancelled} |`
|
|
1056
|
+
);
|
|
1005
1057
|
continue;
|
|
1006
1058
|
}
|
|
1007
1059
|
const tz = c.timeZone ?? "-";
|
|
1008
1060
|
const primary = c.primary ? "yes" : "no";
|
|
1009
1061
|
const access = c.accessRole ?? "-";
|
|
1010
1062
|
sections.push(
|
|
1011
|
-
`| ${displayName(c)} | ${tz} | ${primary} | ${access} |`
|
|
1063
|
+
`| ${displayName(c)} | ${tz} | ${primary} | ${access} | ${total} | ${confirmed} | ${tentative} | ${cancelled} |`
|
|
1012
1064
|
);
|
|
1013
1065
|
}
|
|
1014
1066
|
sections.push("");
|
|
@@ -1036,8 +1088,8 @@ var googleCalendarConnector = new ConnectorPlugin({
|
|
|
1036
1088
|
|
|
1037
1089
|
This connector exposes two request tools that correspond to the two ways a Service Account can authenticate against the Google Calendar API:
|
|
1038
1090
|
|
|
1039
|
-
- \`
|
|
1040
|
-
- \`
|
|
1091
|
+
- \`connector_google-calendar-service-account_request_with_delegation\`: Call the Calendar API on behalf of the specified Workspace user via Domain-wide Delegation. Pass \`subject\` as the target user email. Requires Domain-wide Delegation to be authorized for the service account in the Workspace admin console.
|
|
1092
|
+
- \`connector_google-calendar-service-account_request\`: Call the Calendar API as the service account itself (no delegation). Only calendars explicitly shared with the service account email are accessible.
|
|
1041
1093
|
|
|
1042
1094
|
Both tools require a \`scopes\` argument.
|
|
1043
1095
|
|
|
@@ -1134,8 +1186,8 @@ export default async function handler(c: Context) {
|
|
|
1134
1186
|
|
|
1135
1187
|
\u3053\u306E\u30B3\u30CD\u30AF\u30BF\u30FC\u306F\u3001Service Account \u304C Google Calendar API \u306B\u8A8D\u8A3C\u3059\u308B 2 \u3064\u306E\u65B9\u6CD5\u306B\u5BFE\u5FDC\u3059\u308B 2 \u3064\u306E request \u30C4\u30FC\u30EB\u3092\u516C\u958B\u3057\u307E\u3059:
|
|
1136
1188
|
|
|
1137
|
-
- \`
|
|
1138
|
-
- \`
|
|
1189
|
+
- \`connector_google-calendar-service-account_request_with_delegation\`: \u6307\u5B9A\u3055\u308C\u305F Workspace \u30E6\u30FC\u30B6\u30FC\u306B\u4EE3\u308F\u3063\u3066 Domain-wide Delegation \u7D4C\u7531\u3067 Calendar API \u3092\u547C\u3073\u51FA\u3057\u307E\u3059\u3002\u4EE3\u7406\u5BFE\u8C61\u306E\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092 \`subject\` \u3068\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002Workspace \u7BA1\u7406\u30B3\u30F3\u30BD\u30FC\u30EB\u3067 Service Account \u306E Domain-wide Delegation \u304C\u627F\u8A8D\u3055\u308C\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
|
|
1190
|
+
- \`connector_google-calendar-service-account_request\`: Service Account \u81EA\u8EAB\u3068\u3057\u3066 Calendar API \u3092\u547C\u3073\u51FA\u3057\u307E\u3059 (Domain-wide Delegation \u3092\u4F7F\u308F\u306A\u3044\u7D4C\u8DEF)\u3002Service Account \u306E\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u306B\u660E\u793A\u7684\u306B\u5171\u6709\u3055\u308C\u3066\u3044\u308B\u30AB\u30EC\u30F3\u30C0\u30FC\u306E\u307F\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u3067\u3059\u3002
|
|
1139
1191
|
|
|
1140
1192
|
\u4E21\u30C4\u30FC\u30EB\u3068\u3082 \`scopes\` \u5F15\u6570\u304C\u5FC5\u9808\u3067\u3059\u3002
|
|
1141
1193
|
|
|
@@ -160,7 +160,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
160
160
|
/**
|
|
161
161
|
* Create tools for connections that belong to this connector.
|
|
162
162
|
* Filters connections by connectorKey internally.
|
|
163
|
-
* Returns tools keyed as
|
|
163
|
+
* Returns tools keyed as `connector_${connectorKey}_${toolName}`.
|
|
164
164
|
*/
|
|
165
165
|
createTools(connections, config, opts) {
|
|
166
166
|
const myConnections = connections.filter(
|
|
@@ -170,7 +170,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
170
170
|
for (const t of Object.values(this.tools)) {
|
|
171
171
|
const tool = t.createTool(myConnections, config);
|
|
172
172
|
const originalToModelOutput = tool.toModelOutput;
|
|
173
|
-
result[
|
|
173
|
+
result[`connector_${this.connectorKey}_${t.name}`] = {
|
|
174
174
|
...tool,
|
|
175
175
|
toModelOutput: async (options) => {
|
|
176
176
|
if (!originalToModelOutput) {
|
|
@@ -310,10 +310,10 @@ function normalizeRequestPath(path2, basePathSegment) {
|
|
|
310
310
|
// ../connectors/src/connectors/google-docs/setup.ts
|
|
311
311
|
var googleDocsOnboarding = new ConnectorOnboarding({
|
|
312
312
|
dataOverviewInstructions: {
|
|
313
|
-
en: `1. Create a new document with
|
|
314
|
-
2. Call
|
|
315
|
-
ja: `1.
|
|
316
|
-
2.
|
|
313
|
+
en: `1. Create a new document with connector_google-docs-oauth_request (POST with body { title: "..." }) or use an existing document ID.
|
|
314
|
+
2. Call connector_google-docs-oauth_request with GET /{documentId} to fetch the document's content and metadata.`,
|
|
315
|
+
ja: `1. connector_google-docs-oauth_request \u3092 POST\uFF08Body: { title: "..." }\uFF09\u3067\u547C\u3073\u51FA\u3057\u3066\u65B0\u3057\u3044\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3092\u4F5C\u6210\u3059\u308B\u304B\u3001\u65E2\u5B58\u306E\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8ID\u3092\u5229\u7528\u3057\u307E\u3059\u3002
|
|
316
|
+
2. connector_google-docs-oauth_request \u3067 GET /{documentId} \u3092\u547C\u3073\u51FA\u3057\u3001\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u5185\u5BB9\u3068\u30E1\u30BF\u30C7\u30FC\u30BF\u3092\u53D6\u5F97\u3057\u307E\u3059\u3002`
|
|
317
317
|
}
|
|
318
318
|
});
|
|
319
319
|
|
|
@@ -566,9 +566,9 @@ var googleDocsConnector = new ConnectorPlugin({
|
|
|
566
566
|
systemPrompt: {
|
|
567
567
|
en: `### Tools (setup-time only)
|
|
568
568
|
|
|
569
|
-
- \`
|
|
569
|
+
- \`connector_google-docs-oauth_request\`: Call the Google Docs API directly during setup / data overview. Supports read and write operations. Use it to get document content, create new documents, and modify document content via batchUpdate. Authentication is configured automatically via OAuth.
|
|
570
570
|
|
|
571
|
-
> **Important**: The \`
|
|
571
|
+
> **Important**: The \`connector_google-docs-oauth_request\` tool is only available at setup time. Inside server-logic handlers, use the SDK (\`connection(id).createDocument\`, 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.
|
|
572
572
|
|
|
573
573
|
### Google Docs API Reference
|
|
574
574
|
|
|
@@ -635,9 +635,9 @@ await docs.batchUpdate(documentId, [
|
|
|
635
635
|
\`\`\``,
|
|
636
636
|
ja: `### \u30C4\u30FC\u30EB\uFF08\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u6642\u306E\u307F\uFF09
|
|
637
637
|
|
|
638
|
-
- \`
|
|
638
|
+
- \`connector_google-docs-oauth_request\`: \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3084\u30C7\u30FC\u30BF\u6982\u8981\u628A\u63E1\u6642\u306B Google Docs 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\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u5185\u5BB9\u306E\u53D6\u5F97\u3001\u65B0\u3057\u3044\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u4F5C\u6210\u3001batchUpdate \u306B\u3088\u308B\u5185\u5BB9\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
|
|
639
639
|
|
|
640
|
-
> **\u91CD\u8981**: \`
|
|
640
|
+
> **\u91CD\u8981**: \`connector_google-docs-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).createDocument\` \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
|
|
641
641
|
|
|
642
642
|
### Google Docs API \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9
|
|
643
643
|
|
|
@@ -249,7 +249,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
249
249
|
/**
|
|
250
250
|
* Create tools for connections that belong to this connector.
|
|
251
251
|
* Filters connections by connectorKey internally.
|
|
252
|
-
* Returns tools keyed as
|
|
252
|
+
* Returns tools keyed as `connector_${connectorKey}_${toolName}`.
|
|
253
253
|
*/
|
|
254
254
|
createTools(connections, config, opts) {
|
|
255
255
|
const myConnections = connections.filter(
|
|
@@ -259,7 +259,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
259
259
|
for (const t of Object.values(this.tools)) {
|
|
260
260
|
const tool = t.createTool(myConnections, config);
|
|
261
261
|
const originalToModelOutput = tool.toModelOutput;
|
|
262
|
-
result[
|
|
262
|
+
result[`connector_${this.connectorKey}_${t.name}`] = {
|
|
263
263
|
...tool,
|
|
264
264
|
toModelOutput: async (options) => {
|
|
265
265
|
if (!originalToModelOutput) {
|
|
@@ -399,10 +399,10 @@ function normalizeRequestPath(path2, basePathSegment) {
|
|
|
399
399
|
// ../connectors/src/connectors/google-drive/setup.ts
|
|
400
400
|
var googleDriveOnboarding = new ConnectorOnboarding({
|
|
401
401
|
dataOverviewInstructions: {
|
|
402
|
-
en: `1. Call
|
|
403
|
-
2. Call
|
|
404
|
-
ja: `1.
|
|
405
|
-
2.
|
|
402
|
+
en: `1. Call connector_google-drive-oauth_request with GET /files?pageSize=20&fields=files(id,name,mimeType,modifiedTime)&orderBy=modifiedTime desc to list recent files
|
|
403
|
+
2. Call connector_google-drive-oauth_request with GET /about?fields=user,storageQuota to get account info and storage usage`,
|
|
404
|
+
ja: `1. connector_google-drive-oauth_request \u3067 GET /files?pageSize=20&fields=files(id,name,mimeType,modifiedTime)&orderBy=modifiedTime desc \u3092\u547C\u3073\u51FA\u3057\u3001\u6700\u8FD1\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u4E00\u89A7\u8868\u793A
|
|
405
|
+
2. connector_google-drive-oauth_request \u3067 GET /about?fields=user,storageQuota \u3092\u547C\u3073\u51FA\u3057\u3001\u30A2\u30AB\u30A6\u30F3\u30C8\u60C5\u5831\u3068\u30B9\u30C8\u30EC\u30FC\u30B8\u4F7F\u7528\u91CF\u3092\u53D6\u5F97`
|
|
406
406
|
}
|
|
407
407
|
});
|
|
408
408
|
|
|
@@ -543,6 +543,28 @@ var googleDriveSetupFlow = {
|
|
|
543
543
|
);
|
|
544
544
|
}
|
|
545
545
|
sections.push("");
|
|
546
|
+
try {
|
|
547
|
+
const counts = /* @__PURE__ */ new Map();
|
|
548
|
+
for (const f of allFiles) {
|
|
549
|
+
const key = f.mimeType === FOLDER_MIME ? "folder" : f.mimeType ?? "(unknown)";
|
|
550
|
+
counts.set(key, (counts.get(key) ?? 0) + 1);
|
|
551
|
+
}
|
|
552
|
+
const top = Array.from(counts.entries()).sort((a, b) => b[1] - a[1]).slice(0, 10);
|
|
553
|
+
if (top.length > 0) {
|
|
554
|
+
sections.push(
|
|
555
|
+
rt.language === "ja" ? "### \u30D5\u30A1\u30A4\u30EB\u7A2E\u5225\u306E\u5185\u8A33 (\u4E0A\u4F4D10\u4EF6)" : "### File type breakdown (top 10)",
|
|
556
|
+
""
|
|
557
|
+
);
|
|
558
|
+
sections.push("| Mime Type | Count |");
|
|
559
|
+
sections.push("|-----------|-------|");
|
|
560
|
+
for (const [mime, count] of top) {
|
|
561
|
+
const safe = mime.replace(/\|/g, "\\|");
|
|
562
|
+
sections.push(`| ${safe} | ${count} |`);
|
|
563
|
+
}
|
|
564
|
+
sections.push("");
|
|
565
|
+
}
|
|
566
|
+
} catch {
|
|
567
|
+
}
|
|
546
568
|
return sections.join("\n");
|
|
547
569
|
}
|
|
548
570
|
};
|
|
@@ -694,9 +716,9 @@ var googleDriveConnector = new ConnectorPlugin({
|
|
|
694
716
|
systemPrompt: {
|
|
695
717
|
en: `### Tools (setup-time only)
|
|
696
718
|
|
|
697
|
-
- \`
|
|
719
|
+
- \`connector_google-drive-oauth_request\`: Send authenticated requests to the Google Drive API v3 during setup / data overview. Supports GET, POST, and PATCH methods. Authentication is configured automatically via OAuth.
|
|
698
720
|
|
|
699
|
-
> **Important**: The \`
|
|
721
|
+
> **Important**: The \`connector_google-drive-oauth_request\` tool is only available at setup time. Inside server-logic handlers, use the SDK (\`connection(id).listFiles\`, 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.
|
|
700
722
|
|
|
701
723
|
### Google Drive API Reference
|
|
702
724
|
|
|
@@ -830,9 +852,9 @@ await drive.updateFile("fileId123", {}, "newFolderId", "oldFolderId");
|
|
|
830
852
|
\`\`\``,
|
|
831
853
|
ja: `### \u30C4\u30FC\u30EB\uFF08\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u6642\u306E\u307F\uFF09
|
|
832
854
|
|
|
833
|
-
- \`
|
|
855
|
+
- \`connector_google-drive-oauth_request\`: \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3084\u30C7\u30FC\u30BF\u6982\u8981\u628A\u63E1\u6642\u306B Google Drive API v3 \u3078\u8A8D\u8A3C\u6E08\u307F\u30EA\u30AF\u30A8\u30B9\u30C8\u3092\u9001\u4FE1\u3057\u307E\u3059\u3002GET, POST, PATCH \u30E1\u30BD\u30C3\u30C9\u3092\u30B5\u30DD\u30FC\u30C8\u3057\u307E\u3059\u3002OAuth \u7D4C\u7531\u3067\u8A8D\u8A3C\u306F\u81EA\u52D5\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002
|
|
834
856
|
|
|
835
|
-
> **\u91CD\u8981**: \`
|
|
857
|
+
> **\u91CD\u8981**: \`connector_google-drive-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).listFiles\` \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
|
|
836
858
|
|
|
837
859
|
### Google Drive API \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9
|
|
838
860
|
|