@squadbase/vite-server 0.1.17-dev.a107052 → 0.1.17-dev.d4fff69
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 +4284 -820
- package/dist/connectors/airtable-oauth.js +48 -8
- package/dist/connectors/airtable.js +44 -8
- package/dist/connectors/amplitude.js +8 -8
- package/dist/connectors/anthropic.js +2 -2
- package/dist/connectors/asana.js +37 -10
- package/dist/connectors/attio.js +30 -13
- package/dist/connectors/aws-billing.js +8 -8
- package/dist/connectors/azure-sql.js +47 -10
- package/dist/connectors/backlog-api-key.js +40 -15
- package/dist/connectors/clickup.js +50 -10
- package/dist/connectors/cosmosdb.js +12 -12
- package/dist/connectors/customerio.js +8 -8
- package/dist/connectors/dbt.js +686 -25
- package/dist/connectors/freshdesk.js +82 -8
- package/dist/connectors/freshsales.js +8 -8
- package/dist/connectors/freshservice.js +8 -8
- package/dist/connectors/gamma.js +15 -15
- package/dist/connectors/gemini.js +2 -2
- package/dist/connectors/github.js +12 -12
- package/dist/connectors/gmail-oauth.js +10 -10
- package/dist/connectors/gmail.js +4 -4
- package/dist/connectors/google-ads.js +8 -8
- package/dist/connectors/google-analytics-oauth.js +152 -25
- package/dist/connectors/google-analytics.js +475 -95
- package/dist/connectors/google-audit-log.js +4 -4
- package/dist/connectors/google-calendar-oauth.js +61 -15
- package/dist/connectors/google-calendar.js +61 -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 +126 -17
- package/dist/connectors/google-sheets.js +6 -6
- package/dist/connectors/google-slides.js +10 -10
- package/dist/connectors/grafana.js +45 -10
- package/dist/connectors/hackernews.d.ts +5 -0
- package/dist/connectors/hackernews.js +890 -0
- package/dist/connectors/hubspot-oauth.js +41 -9
- package/dist/connectors/hubspot.js +25 -9
- package/dist/connectors/influxdb.js +8 -8
- package/dist/connectors/intercom-oauth.js +72 -12
- package/dist/connectors/intercom.js +12 -12
- package/dist/connectors/jdbc.js +37 -10
- package/dist/connectors/jira-api-key.js +68 -11
- package/dist/connectors/kintone-api-token.js +66 -18
- package/dist/connectors/kintone.js +54 -11
- package/dist/connectors/linear.js +54 -12
- package/dist/connectors/linkedin-ads.js +41 -14
- package/dist/connectors/mailchimp-oauth.js +6 -6
- package/dist/connectors/mailchimp.js +6 -6
- package/dist/connectors/meta-ads-oauth.js +33 -14
- package/dist/connectors/meta-ads.js +35 -14
- package/dist/connectors/mixpanel.js +8 -8
- package/dist/connectors/monday.js +9 -9
- package/dist/connectors/mongodb.js +8 -8
- package/dist/connectors/notion-oauth.js +60 -11
- package/dist/connectors/notion.js +60 -11
- package/dist/connectors/openai.js +2 -2
- package/dist/connectors/oracle.js +39 -11
- package/dist/connectors/outlook-oauth.js +21 -21
- package/dist/connectors/powerbi-oauth.js +13 -13
- package/dist/connectors/salesforce.js +42 -9
- package/dist/connectors/semrush.js +6 -6
- package/dist/connectors/sentry.js +36 -10
- package/dist/connectors/shopify-oauth.js +43 -10
- package/dist/connectors/shopify.js +8 -8
- package/dist/connectors/sqlserver.js +47 -10
- package/dist/connectors/stripe-api-key.js +66 -15
- package/dist/connectors/stripe-oauth.js +70 -19
- package/dist/connectors/supabase.js +31 -6
- package/dist/connectors/tableau.js +15 -15
- package/dist/connectors/tiktok-ads.js +37 -16
- package/dist/connectors/wix-store.js +8 -8
- package/dist/connectors/x.d.ts +5 -0
- package/dist/connectors/x.js +927 -0
- package/dist/connectors/zendesk-oauth.js +55 -12
- package/dist/connectors/zendesk.js +12 -12
- package/dist/index.js +4302 -818
- package/dist/main.js +4302 -818
- package/dist/vite-plugin.js +4282 -818
- package/package.json +9 -1
|
@@ -118,7 +118,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
118
118
|
/**
|
|
119
119
|
* Create tools for connections that belong to this connector.
|
|
120
120
|
* Filters connections by connectorKey internally.
|
|
121
|
-
* Returns tools keyed as
|
|
121
|
+
* Returns tools keyed as `connector_${connectorKey}_${toolName}`.
|
|
122
122
|
*/
|
|
123
123
|
createTools(connections, config, opts) {
|
|
124
124
|
const myConnections = connections.filter(
|
|
@@ -128,7 +128,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
128
128
|
for (const t of Object.values(this.tools)) {
|
|
129
129
|
const tool = t.createTool(myConnections, config);
|
|
130
130
|
const originalToModelOutput = tool.toModelOutput;
|
|
131
|
-
result[
|
|
131
|
+
result[`connector_${this.connectorKey}_${t.name}`] = {
|
|
132
132
|
...tool,
|
|
133
133
|
toModelOutput: async (options) => {
|
|
134
134
|
if (!originalToModelOutput) {
|
|
@@ -395,13 +395,13 @@ var notionOauthOnboarding = new ConnectorOnboarding({
|
|
|
395
395
|
- Write only 1 sentence between tool calls, then immediately call the next tool. Skip unnecessary explanations and proceed efficiently`
|
|
396
396
|
},
|
|
397
397
|
dataOverviewInstructions: {
|
|
398
|
-
en: `1. Call
|
|
399
|
-
2. For each database found, call
|
|
400
|
-
3. Call
|
|
398
|
+
en: `1. Call connector_notion-oauth_request with POST /search and { "page_size": 5 } to discover available pages and databases
|
|
399
|
+
2. For each database found, call connector_notion-oauth_request with POST /databases/{database_id}/query and { "page_size": 5 } to sample records
|
|
400
|
+
3. Call connector_notion-oauth_request with GET /users to list workspace members
|
|
401
401
|
4. Explore page content with GET /blocks/{page_id}/children as needed`,
|
|
402
|
-
ja: `1.
|
|
403
|
-
2. \u898B\u3064\u304B\u3063\u305F\u5404\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u306B\u3064\u3044\u3066\
|
|
404
|
-
3.
|
|
402
|
+
ja: `1. connector_notion-oauth_request \u3067 POST /search \u3092 { "page_size": 5 } \u3067\u547C\u3073\u51FA\u3057\u3001\u5229\u7528\u53EF\u80FD\u306A\u30DA\u30FC\u30B8\u3068\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u3092\u691C\u51FA
|
|
403
|
+
2. \u898B\u3064\u304B\u3063\u305F\u5404\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u306B\u3064\u3044\u3066\u3001connector_notion-oauth_request \u3067 POST /databases/{database_id}/query \u3092 { "page_size": 5 } \u3067\u547C\u3073\u51FA\u3057\u3001\u30EC\u30B3\u30FC\u30C9\u3092\u30B5\u30F3\u30D7\u30EA\u30F3\u30B0
|
|
404
|
+
3. connector_notion-oauth_request \u3067 GET /users \u3092\u547C\u3073\u51FA\u3057\u3001\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u30E1\u30F3\u30D0\u30FC\u3092\u4E00\u89A7\u8868\u793A
|
|
405
405
|
4. \u5FC5\u8981\u306B\u5FDC\u3058\u3066 GET /blocks/{page_id}/children \u3067\u30DA\u30FC\u30B8\u30B3\u30F3\u30C6\u30F3\u30C4\u3092\u63A2\u7D22`
|
|
406
406
|
}
|
|
407
407
|
});
|
|
@@ -465,6 +465,38 @@ async function getDatabase(proxyFetch, databaseId) {
|
|
|
465
465
|
}
|
|
466
466
|
return await res.json();
|
|
467
467
|
}
|
|
468
|
+
async function queryDatabaseSample(proxyFetch, databaseId) {
|
|
469
|
+
try {
|
|
470
|
+
const res = await apiFetch(proxyFetch, `/databases/${databaseId}/query`, {
|
|
471
|
+
method: "POST",
|
|
472
|
+
body: JSON.stringify({ page_size: 3 })
|
|
473
|
+
});
|
|
474
|
+
if (!res.ok) return [];
|
|
475
|
+
const data = await res.json();
|
|
476
|
+
return data.results ?? [];
|
|
477
|
+
} catch {
|
|
478
|
+
return [];
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
function formatPropertyValue(prop) {
|
|
482
|
+
if (prop == null || typeof prop !== "object") return "";
|
|
483
|
+
const p = prop;
|
|
484
|
+
const t = p.type ?? "";
|
|
485
|
+
const v = p[t];
|
|
486
|
+
if (v == null) return "";
|
|
487
|
+
if (typeof v === "string" || typeof v === "number" || typeof v === "boolean")
|
|
488
|
+
return String(v);
|
|
489
|
+
if (Array.isArray(v)) {
|
|
490
|
+
if (v.length === 0) return "";
|
|
491
|
+
const first = v[0];
|
|
492
|
+
return first.plain_text ?? first.name ?? `[${v.length} items]`;
|
|
493
|
+
}
|
|
494
|
+
if (typeof v === "object") {
|
|
495
|
+
const o = v;
|
|
496
|
+
return o.name ?? o.plain_text ?? o.start ?? JSON.stringify(v).slice(0, 30);
|
|
497
|
+
}
|
|
498
|
+
return String(v);
|
|
499
|
+
}
|
|
468
500
|
var notionOauthSetupFlow = {
|
|
469
501
|
initialState: () => ({}),
|
|
470
502
|
steps: [
|
|
@@ -509,11 +541,28 @@ var notionOauthSetupFlow = {
|
|
|
509
541
|
sections.push(`### Database: ${title}`, "", `- id: \`${db.id}\``, "");
|
|
510
542
|
sections.push("| Property | Type |");
|
|
511
543
|
sections.push("|----------|------|");
|
|
512
|
-
|
|
544
|
+
const propEntries = Object.entries(db.properties ?? {});
|
|
545
|
+
for (const [name, def] of propEntries) {
|
|
513
546
|
const escapedName = name.replace(/\|/g, "\\|");
|
|
514
547
|
sections.push(`| ${escapedName} | ${def?.type ?? "-"} |`);
|
|
515
548
|
}
|
|
516
549
|
sections.push("");
|
|
550
|
+
const pages = await queryDatabaseSample(rt.config.proxyFetch, dbId);
|
|
551
|
+
if (pages.length > 0) {
|
|
552
|
+
const sampleProps = propEntries.slice(0, 5).map(([n]) => n);
|
|
553
|
+
if (sampleProps.length > 0) {
|
|
554
|
+
sections.push(`#### Sample pages (${pages.length})`, "");
|
|
555
|
+
sections.push(`| ${sampleProps.join(" | ")} |`);
|
|
556
|
+
sections.push(`| ${sampleProps.map(() => "---").join(" | ")} |`);
|
|
557
|
+
for (const page of pages) {
|
|
558
|
+
const cells = sampleProps.map(
|
|
559
|
+
(n) => formatPropertyValue(page.properties?.[n]).replace(/\|/g, "\\|")
|
|
560
|
+
);
|
|
561
|
+
sections.push(`| ${cells.join(" | ")} |`);
|
|
562
|
+
}
|
|
563
|
+
sections.push("");
|
|
564
|
+
}
|
|
565
|
+
}
|
|
517
566
|
}
|
|
518
567
|
return sections.join("\n");
|
|
519
568
|
}
|
|
@@ -543,7 +592,7 @@ var notionOauthConnector = new ConnectorPlugin({
|
|
|
543
592
|
systemPrompt: {
|
|
544
593
|
en: `### Tools
|
|
545
594
|
|
|
546
|
-
- \`
|
|
595
|
+
- \`connector_notion-oauth_request\`: The only way to call the Notion API. Use it to search pages and databases, query database records, retrieve page content and blocks, and manage workspace data. Authentication is configured automatically via OAuth. Notion-Version header is set automatically. Pagination uses cursor-based \`start_cursor\` and \`page_size\` (max 100) with \`has_more\` and \`next_cursor\` in the response.
|
|
547
596
|
|
|
548
597
|
### Notion API Reference
|
|
549
598
|
|
|
@@ -593,7 +642,7 @@ const data = await res.json();
|
|
|
593
642
|
\`\`\``,
|
|
594
643
|
ja: `### \u30C4\u30FC\u30EB
|
|
595
644
|
|
|
596
|
-
- \`
|
|
645
|
+
- \`connector_notion-oauth_request\`: Notion API\u3092\u547C\u3073\u51FA\u3059\u552F\u4E00\u306E\u624B\u6BB5\u3067\u3059\u3002\u30DA\u30FC\u30B8\u3084\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u306E\u691C\u7D22\u3001\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u30EC\u30B3\u30FC\u30C9\u306E\u30AF\u30A8\u30EA\u3001\u30DA\u30FC\u30B8\u30B3\u30F3\u30C6\u30F3\u30C4\u3084\u30D6\u30ED\u30C3\u30AF\u306E\u53D6\u5F97\u3001\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u30C7\u30FC\u30BF\u306E\u7BA1\u7406\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002OAuth\u7D4C\u7531\u3067\u8A8D\u8A3C\u306F\u81EA\u52D5\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002Notion-Version\u30D8\u30C3\u30C0\u30FC\u3082\u81EA\u52D5\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002\u30DA\u30FC\u30B8\u30CD\u30FC\u30B7\u30E7\u30F3\u306F\u30EC\u30B9\u30DD\u30F3\u30B9\u306E \`has_more\` \u3068 \`next_cursor\` \u306B\u3088\u308B\u30AB\u30FC\u30BD\u30EB\u30D9\u30FC\u30B9\u3067\u3001\`start_cursor\` \u3068 \`page_size\`\uFF08\u6700\u5927100\uFF09\u3092\u4F7F\u7528\u3057\u307E\u3059\u3002
|
|
597
646
|
|
|
598
647
|
### Notion API \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9
|
|
599
648
|
|
|
@@ -284,7 +284,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
284
284
|
/**
|
|
285
285
|
* Create tools for connections that belong to this connector.
|
|
286
286
|
* Filters connections by connectorKey internally.
|
|
287
|
-
* Returns tools keyed as
|
|
287
|
+
* Returns tools keyed as `connector_${connectorKey}_${toolName}`.
|
|
288
288
|
*/
|
|
289
289
|
createTools(connections, config, opts) {
|
|
290
290
|
const myConnections = connections.filter(
|
|
@@ -294,7 +294,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
294
294
|
for (const t of Object.values(this.tools)) {
|
|
295
295
|
const tool = t.createTool(myConnections, config);
|
|
296
296
|
const originalToModelOutput = tool.toModelOutput;
|
|
297
|
-
result[
|
|
297
|
+
result[`connector_${this.connectorKey}_${t.name}`] = {
|
|
298
298
|
...tool,
|
|
299
299
|
toModelOutput: async (options) => {
|
|
300
300
|
if (!originalToModelOutput) {
|
|
@@ -424,13 +424,13 @@ var AUTH_TYPES = {
|
|
|
424
424
|
// ../connectors/src/connectors/notion/setup.ts
|
|
425
425
|
var notionOnboarding = new ConnectorOnboarding({
|
|
426
426
|
dataOverviewInstructions: {
|
|
427
|
-
en: `1. Call
|
|
428
|
-
2. For each database found, call
|
|
429
|
-
3. Call
|
|
427
|
+
en: `1. Call connector_notion_request with POST /search and { "page_size": 5 } to discover available pages and databases
|
|
428
|
+
2. For each database found, call connector_notion_request with POST /databases/{database_id}/query and { "page_size": 5 } to sample records and understand the schema
|
|
429
|
+
3. Call connector_notion_request with GET /users to list workspace members
|
|
430
430
|
4. Explore page content with GET /blocks/{page_id}/children as needed`,
|
|
431
|
-
ja: `1.
|
|
432
|
-
2. \u898B\u3064\u304B\u3063\u305F\u5404\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u306B\u3064\u3044\u3066\
|
|
433
|
-
3.
|
|
431
|
+
ja: `1. connector_notion_request \u3067 POST /search \u3092 { "page_size": 5 } \u3067\u547C\u3073\u51FA\u3057\u3001\u5229\u7528\u53EF\u80FD\u306A\u30DA\u30FC\u30B8\u3068\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u3092\u691C\u51FA
|
|
432
|
+
2. \u898B\u3064\u304B\u3063\u305F\u5404\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u306B\u3064\u3044\u3066\u3001connector_notion_request \u3067 POST /databases/{database_id}/query \u3092 { "page_size": 5 } \u3067\u547C\u3073\u51FA\u3057\u3001\u30EC\u30B3\u30FC\u30C9\u306E\u30B5\u30F3\u30D7\u30EA\u30F3\u30B0\u3068\u30B9\u30AD\u30FC\u30DE\u306E\u628A\u63E1\u3092\u884C\u3046
|
|
433
|
+
3. connector_notion_request \u3067 GET /users \u3092\u547C\u3073\u51FA\u3057\u3001\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u30E1\u30F3\u30D0\u30FC\u3092\u4E00\u89A7\u8868\u793A
|
|
434
434
|
4. \u5FC5\u8981\u306B\u5FDC\u3058\u3066 GET /blocks/{page_id}/children \u3067\u30DA\u30FC\u30B8\u30B3\u30F3\u30C6\u30F3\u30C4\u3092\u63A2\u7D22`
|
|
435
435
|
}
|
|
436
436
|
});
|
|
@@ -494,6 +494,38 @@ async function getDatabase(params, databaseId) {
|
|
|
494
494
|
}
|
|
495
495
|
return await res.json();
|
|
496
496
|
}
|
|
497
|
+
async function queryDatabaseSample(params, databaseId) {
|
|
498
|
+
try {
|
|
499
|
+
const res = await apiFetch(params, `/databases/${databaseId}/query`, {
|
|
500
|
+
method: "POST",
|
|
501
|
+
body: JSON.stringify({ page_size: 3 })
|
|
502
|
+
});
|
|
503
|
+
if (!res.ok) return [];
|
|
504
|
+
const data = await res.json();
|
|
505
|
+
return data.results ?? [];
|
|
506
|
+
} catch {
|
|
507
|
+
return [];
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
function formatPropertyValue(prop) {
|
|
511
|
+
if (prop == null || typeof prop !== "object") return "";
|
|
512
|
+
const p = prop;
|
|
513
|
+
const t = p.type ?? "";
|
|
514
|
+
const v = p[t];
|
|
515
|
+
if (v == null) return "";
|
|
516
|
+
if (typeof v === "string" || typeof v === "number" || typeof v === "boolean")
|
|
517
|
+
return String(v);
|
|
518
|
+
if (Array.isArray(v)) {
|
|
519
|
+
if (v.length === 0) return "";
|
|
520
|
+
const first = v[0];
|
|
521
|
+
return first.plain_text ?? first.name ?? `[${v.length} items]`;
|
|
522
|
+
}
|
|
523
|
+
if (typeof v === "object") {
|
|
524
|
+
const o = v;
|
|
525
|
+
return o.name ?? o.plain_text ?? o.start ?? JSON.stringify(v).slice(0, 30);
|
|
526
|
+
}
|
|
527
|
+
return String(v);
|
|
528
|
+
}
|
|
497
529
|
var notionSetupFlow = {
|
|
498
530
|
initialState: () => ({}),
|
|
499
531
|
steps: [
|
|
@@ -538,11 +570,28 @@ var notionSetupFlow = {
|
|
|
538
570
|
sections.push(`### Database: ${title}`, "", `- id: \`${db.id}\``, "");
|
|
539
571
|
sections.push("| Property | Type |");
|
|
540
572
|
sections.push("|----------|------|");
|
|
541
|
-
|
|
573
|
+
const propEntries = Object.entries(db.properties ?? {});
|
|
574
|
+
for (const [name, def] of propEntries) {
|
|
542
575
|
const escapedName = name.replace(/\|/g, "\\|");
|
|
543
576
|
sections.push(`| ${escapedName} | ${def?.type ?? "-"} |`);
|
|
544
577
|
}
|
|
545
578
|
sections.push("");
|
|
579
|
+
const pages = await queryDatabaseSample(rt.params, dbId);
|
|
580
|
+
if (pages.length > 0) {
|
|
581
|
+
const sampleProps = propEntries.slice(0, 5).map(([n]) => n);
|
|
582
|
+
if (sampleProps.length > 0) {
|
|
583
|
+
sections.push(`#### Sample pages (${pages.length})`, "");
|
|
584
|
+
sections.push(`| ${sampleProps.join(" | ")} |`);
|
|
585
|
+
sections.push(`| ${sampleProps.map(() => "---").join(" | ")} |`);
|
|
586
|
+
for (const page of pages) {
|
|
587
|
+
const cells = sampleProps.map(
|
|
588
|
+
(n) => formatPropertyValue(page.properties?.[n]).replace(/\|/g, "\\|")
|
|
589
|
+
);
|
|
590
|
+
sections.push(`| ${cells.join(" | ")} |`);
|
|
591
|
+
}
|
|
592
|
+
sections.push("");
|
|
593
|
+
}
|
|
594
|
+
}
|
|
546
595
|
}
|
|
547
596
|
return sections.join("\n");
|
|
548
597
|
}
|
|
@@ -643,7 +692,7 @@ var notionConnector = new ConnectorPlugin({
|
|
|
643
692
|
systemPrompt: {
|
|
644
693
|
en: `### Tools
|
|
645
694
|
|
|
646
|
-
- \`
|
|
695
|
+
- \`connector_notion_request\`: The only way to call the Notion REST API. Use it to search pages and databases, query database records, retrieve page content and blocks, and manage workspace data. Authentication (Bearer token) and Notion-Version header are configured automatically. Pagination uses cursor-based \`start_cursor\` and \`page_size\` (max 100) with \`has_more\` and \`next_cursor\` in the response.
|
|
647
696
|
|
|
648
697
|
### Business Logic
|
|
649
698
|
|
|
@@ -713,7 +762,7 @@ export default async function handler(c: Context) {
|
|
|
713
762
|
- Properties with more than 25 items (e.g., people, relation) need the property endpoint for full data`,
|
|
714
763
|
ja: `### \u30C4\u30FC\u30EB
|
|
715
764
|
|
|
716
|
-
- \`
|
|
765
|
+
- \`connector_notion_request\`: Notion REST API\u3092\u547C\u3073\u51FA\u3059\u552F\u4E00\u306E\u624B\u6BB5\u3067\u3059\u3002\u30DA\u30FC\u30B8\u3084\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u306E\u691C\u7D22\u3001\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u30EC\u30B3\u30FC\u30C9\u306E\u30AF\u30A8\u30EA\u3001\u30DA\u30FC\u30B8\u30B3\u30F3\u30C6\u30F3\u30C4\u3084\u30D6\u30ED\u30C3\u30AF\u306E\u53D6\u5F97\u3001\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u30C7\u30FC\u30BF\u306E\u7BA1\u7406\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002\u8A8D\u8A3C\uFF08Bearer\u30C8\u30FC\u30AF\u30F3\uFF09\u3068Notion-Version\u30D8\u30C3\u30C0\u30FC\u306F\u81EA\u52D5\u7684\u306B\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002\u30DA\u30FC\u30B8\u30CD\u30FC\u30B7\u30E7\u30F3\u306F\u30EC\u30B9\u30DD\u30F3\u30B9\u306E \`has_more\` \u3068 \`next_cursor\` \u306B\u3088\u308B\u30AB\u30FC\u30BD\u30EB\u30D9\u30FC\u30B9\u3067\u3001\`start_cursor\` \u3068 \`page_size\`\uFF08\u6700\u5927100\uFF09\u3092\u4F7F\u7528\u3057\u307E\u3059\u3002
|
|
717
766
|
|
|
718
767
|
### Business Logic
|
|
719
768
|
|
|
@@ -144,7 +144,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
144
144
|
/**
|
|
145
145
|
* Create tools for connections that belong to this connector.
|
|
146
146
|
* Filters connections by connectorKey internally.
|
|
147
|
-
* Returns tools keyed as
|
|
147
|
+
* Returns tools keyed as `connector_${connectorKey}_${toolName}`.
|
|
148
148
|
*/
|
|
149
149
|
createTools(connections, config, opts) {
|
|
150
150
|
const myConnections = connections.filter(
|
|
@@ -154,7 +154,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
154
154
|
for (const t of Object.values(this.tools)) {
|
|
155
155
|
const tool = t.createTool(myConnections, config);
|
|
156
156
|
const originalToModelOutput = tool.toModelOutput;
|
|
157
|
-
result[
|
|
157
|
+
result[`connector_${this.connectorKey}_${t.name}`] = {
|
|
158
158
|
...tool,
|
|
159
159
|
toModelOutput: async (options) => {
|
|
160
160
|
if (!originalToModelOutput) {
|
|
@@ -334,10 +334,16 @@ async function runOracleQuery(parsed, sql, options = {}) {
|
|
|
334
334
|
outFormat: oracledb.OUT_FORMAT_OBJECT,
|
|
335
335
|
// Bound by the connector's own row cap, but keep the driver from
|
|
336
336
|
// streaming arbitrarily large result sets.
|
|
337
|
-
maxRows: 5e3
|
|
337
|
+
maxRows: 5e3,
|
|
338
|
+
// oracledb defaults to autoCommit=false, which silently rolls back
|
|
339
|
+
// DML when the connection closes.
|
|
340
|
+
autoCommit: true
|
|
338
341
|
}
|
|
339
342
|
);
|
|
340
|
-
return {
|
|
343
|
+
return {
|
|
344
|
+
rows: result.rows ?? [],
|
|
345
|
+
rowsAffected: result.rowsAffected
|
|
346
|
+
};
|
|
341
347
|
} finally {
|
|
342
348
|
try {
|
|
343
349
|
await connection2.close();
|
|
@@ -547,7 +553,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
547
553
|
/**
|
|
548
554
|
* Create tools for connections that belong to this connector.
|
|
549
555
|
* Filters connections by connectorKey internally.
|
|
550
|
-
* Returns tools keyed as
|
|
556
|
+
* Returns tools keyed as `connector_${connectorKey}_${toolName}`.
|
|
551
557
|
*/
|
|
552
558
|
createTools(connections, config, opts) {
|
|
553
559
|
const myConnections = connections.filter(
|
|
@@ -557,7 +563,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
557
563
|
for (const t of Object.values(this.tools)) {
|
|
558
564
|
const tool = t.createTool(myConnections, config);
|
|
559
565
|
const originalToModelOutput = tool.toModelOutput;
|
|
560
|
-
result[
|
|
566
|
+
result[`connector_${this.connectorKey}_${t.name}`] = {
|
|
561
567
|
...tool,
|
|
562
568
|
toModelOutput: async (options) => {
|
|
563
569
|
if (!originalToModelOutput) {
|
|
@@ -706,12 +712,12 @@ init_oracle_runner();
|
|
|
706
712
|
// ../connectors/src/connectors/oracle/setup.ts
|
|
707
713
|
var oracleOnboarding = new ConnectorOnboarding({
|
|
708
714
|
dataOverviewInstructions: {
|
|
709
|
-
en: `1. Use
|
|
715
|
+
en: `1. Use connector_oracle_executeQuery to confirm the version: \`SELECT BANNER FROM V$VERSION\`
|
|
710
716
|
2. Identify the current schema (Oracle treats users as schemas): \`SELECT USER FROM DUAL\`
|
|
711
717
|
3. List user tables: \`SELECT TABLE_NAME FROM USER_TABLES\`. To explore other schemas the connection has access to, use \`ALL_TABLES\` filtered by \`OWNER\`.
|
|
712
718
|
4. For key tables, fetch column info: \`SELECT COLUMN_NAME, DATA_TYPE FROM USER_TAB_COLUMNS WHERE TABLE_NAME = UPPER('xxx')\` (Oracle stores unquoted identifiers as upper-case).
|
|
713
719
|
5. Sample up to 3 tables. Oracle has no \`LIMIT\` keyword: use \`FETCH FIRST n ROWS ONLY\` or \`ROWNUM\`: \`SELECT * FROM <table> FETCH FIRST 5 ROWS ONLY\``,
|
|
714
|
-
ja: `1.
|
|
720
|
+
ja: `1. connector_oracle_executeQuery \u3067\u30D0\u30FC\u30B8\u30E7\u30F3\u3092\u78BA\u8A8D: \`SELECT BANNER FROM V$VERSION\`
|
|
715
721
|
2. \u73FE\u5728\u306E\u30B9\u30AD\u30FC\u30DE\uFF08Oracle\u3067\u306F\u30E6\u30FC\u30B6\u30FC\uFF1D\u30B9\u30AD\u30FC\u30DE\uFF09\u3092\u78BA\u8A8D: \`SELECT USER FROM DUAL\`
|
|
716
722
|
3. \u30E6\u30FC\u30B6\u30FC\u30C6\u30FC\u30D6\u30EB\u4E00\u89A7\u3092\u53D6\u5F97: \`SELECT TABLE_NAME FROM USER_TABLES\`\u3002\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306A\u4ED6\u30B9\u30AD\u30FC\u30DE\u3092\u53C2\u7167\u3059\u308B\u5834\u5408\u306F \`ALL_TABLES\` \u3092 \`OWNER\` \u3067\u30D5\u30A3\u30EB\u30BF\u30EA\u30F3\u30B0\u3002
|
|
717
723
|
4. \u4E3B\u8981\u30C6\u30FC\u30D6\u30EB\u306E\u30AB\u30E9\u30E0\u60C5\u5831\u3092\u53D6\u5F97: \`SELECT COLUMN_NAME, DATA_TYPE FROM USER_TAB_COLUMNS WHERE TABLE_NAME = UPPER('xxx')\`\uFF08Oracle \u306F\u30AF\u30A9\u30FC\u30C8\u306A\u3057\u8B58\u5225\u5B50\u3092\u5927\u6587\u5B57\u3067\u4FDD\u5B58\uFF09\u3002
|
|
@@ -840,6 +846,20 @@ var oracleSetupFlow = {
|
|
|
840
846
|
fetchAll: () => fetchTableAndViewNames(rt.params, owner),
|
|
841
847
|
limit: ORACLE_SETUP_MAX_TABLES
|
|
842
848
|
});
|
|
849
|
+
let rowCounts = /* @__PURE__ */ new Map();
|
|
850
|
+
try {
|
|
851
|
+
const countRows = await runOracleSetupQuery(
|
|
852
|
+
rt.params,
|
|
853
|
+
`SELECT TABLE_NAME, NUM_ROWS FROM ALL_TABLES WHERE OWNER = ${quoteLiteral(owner)}`
|
|
854
|
+
);
|
|
855
|
+
rowCounts = new Map(
|
|
856
|
+
countRows.filter((r) => r["NUM_ROWS"] != null).map((r) => [
|
|
857
|
+
String(r["TABLE_NAME"] ?? ""),
|
|
858
|
+
Number(r["NUM_ROWS"])
|
|
859
|
+
])
|
|
860
|
+
);
|
|
861
|
+
} catch {
|
|
862
|
+
}
|
|
843
863
|
const typeRows = targetTables.length > 0 ? await runOracleSetupQuery(
|
|
844
864
|
rt.params,
|
|
845
865
|
`SELECT OBJECT_NAME, OBJECT_TYPE FROM ALL_OBJECTS
|
|
@@ -869,7 +889,9 @@ var oracleSetupFlow = {
|
|
|
869
889
|
AND TABLE_NAME = ${quoteLiteral(table)}
|
|
870
890
|
ORDER BY COLUMN_ID`
|
|
871
891
|
);
|
|
872
|
-
|
|
892
|
+
const rowCount = rowCounts.get(table);
|
|
893
|
+
const rowCountSuffix = typeof rowCount === "number" ? ` (~${rowCount.toLocaleString()} rows)` : "";
|
|
894
|
+
sections.push(`#### ${heading}: ${table}${rowCountSuffix}`, "");
|
|
873
895
|
sections.push("| Column | Type | Nullable | Default |");
|
|
874
896
|
sections.push("|--------|------|----------|---------|");
|
|
875
897
|
for (const c of cols) {
|
|
@@ -907,6 +929,9 @@ var outputSchema = z.discriminatedUnion("success", [
|
|
|
907
929
|
z.object({
|
|
908
930
|
success: z.literal(true),
|
|
909
931
|
rowCount: z.number(),
|
|
932
|
+
rowsAffected: z.number().optional().describe(
|
|
933
|
+
"Affected rows for INSERT/UPDATE/DELETE; undefined for SELECT"
|
|
934
|
+
),
|
|
910
935
|
truncated: z.boolean(),
|
|
911
936
|
rows: z.array(z.record(z.string(), z.unknown()))
|
|
912
937
|
}),
|
|
@@ -921,7 +946,8 @@ var executeQueryTool = new ConnectorTool({
|
|
|
921
946
|
Use for: schema exploration via \`USER_TABLES\` / \`USER_TAB_COLUMNS\` / \`ALL_TABLES\`, data sampling, and analytical queries.
|
|
922
947
|
Oracle uses \`FETCH FIRST n ROWS ONLY\` (12c+) or \`ROWNUM\` for row limiting \u2014 there is no \`LIMIT\` keyword.
|
|
923
948
|
Unquoted identifiers are stored upper-case (\`SELECT * FROM employees\` resolves to \`EMPLOYEES\`).
|
|
924
|
-
Do NOT terminate statements with a semicolon; the driver rejects trailing terminators
|
|
949
|
+
Do NOT terminate statements with a semicolon; the driver rejects trailing terminators.
|
|
950
|
+
For INSERT/UPDATE/DELETE, \`rowCount\` is 0 and \`rows\` is empty (rowCount counts returned rows, not affected rows) \u2014 this is normal, not a failure; check \`rowsAffected\` for the number of affected rows.`,
|
|
925
951
|
inputSchema,
|
|
926
952
|
outputSchema,
|
|
927
953
|
async execute({ connectionId, sql }, connections) {
|
|
@@ -949,13 +975,15 @@ Do NOT terminate statements with a semicolon; the driver rejects trailing termin
|
|
|
949
975
|
}
|
|
950
976
|
try {
|
|
951
977
|
const cleanSql = sql.replace(/;\s*$/, "");
|
|
952
|
-
const { rows } = await runOracleQuery(parsed, cleanSql, {
|
|
978
|
+
const { rows, rowsAffected } = await runOracleQuery(parsed, cleanSql, {
|
|
953
979
|
tunnelParams: connectionParamsToRecord(connection2)
|
|
954
980
|
});
|
|
955
981
|
const truncated = rows.length > MAX_ROWS;
|
|
956
982
|
return {
|
|
957
983
|
success: true,
|
|
958
984
|
rowCount: Math.min(rows.length, MAX_ROWS),
|
|
985
|
+
// oracledb sets rowsAffected only for DML; undefined for SELECT.
|
|
986
|
+
rowsAffected,
|
|
959
987
|
truncated,
|
|
960
988
|
rows: rows.slice(0, MAX_ROWS)
|
|
961
989
|
};
|
|
@@ -983,7 +1011,7 @@ var oracleConnector = new ConnectorPlugin({
|
|
|
983
1011
|
systemPrompt: {
|
|
984
1012
|
en: `### Tools
|
|
985
1013
|
|
|
986
|
-
- \`
|
|
1014
|
+
- \`connector_oracle_executeQuery\`: Executes a SQL query against an Oracle Database and returns rows. Use it for schema exploration via \`USER_TABLES\` / \`USER_TAB_COLUMNS\` / \`ALL_TABLES\` and for sampling data. See the SQL Reference below for Oracle-specific syntax.
|
|
987
1015
|
|
|
988
1016
|
### Business Logic
|
|
989
1017
|
|
|
@@ -1002,7 +1030,7 @@ The business logic type for this connector is "sql".
|
|
|
1002
1030
|
- Row-limit compatibility: the platform's server-logic schema inference may wrap your query as \`SELECT * FROM (<inner>) AS _sq LIMIT N\`. Oracle has no \`LIMIT\` keyword, so the connector detects this exact wrapper at \`query()\` time, executes \`<inner>\` directly, and slices the first N rows in JS. You do not need to handle this \u2014 but do not author your own \`LIMIT\` clauses; use \`FETCH FIRST N ROWS ONLY\`, \`OFFSET m ROWS FETCH NEXT N ROWS ONLY\`, or \`ROWNUM\` filters.`,
|
|
1003
1031
|
ja: `### \u30C4\u30FC\u30EB
|
|
1004
1032
|
|
|
1005
|
-
- \`
|
|
1033
|
+
- \`connector_oracle_executeQuery\`: Oracle Database \u306B\u5BFE\u3057\u3066 SQL \u3092\u5B9F\u884C\u3057\u3001\u884C\u30C7\u30FC\u30BF\u3092\u8FD4\u3057\u307E\u3059\u3002\`USER_TABLES\` / \`USER_TAB_COLUMNS\` / \`ALL_TABLES\` \u3092\u4F7F\u3063\u305F\u30B9\u30AD\u30FC\u30DE\u63A2\u7D22\u3084\u30C7\u30FC\u30BF\u306E\u30B5\u30F3\u30D7\u30EA\u30F3\u30B0\u306B\u4F7F\u3044\u307E\u3059\u3002Oracle \u56FA\u6709\u306E\u69CB\u6587\u306F\u4E0B\u90E8\u306E\u300CSQL \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9\u300D\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
|
1006
1034
|
|
|
1007
1035
|
### Business Logic
|
|
1008
1036
|
|
|
@@ -232,7 +232,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
232
232
|
/**
|
|
233
233
|
* Create tools for connections that belong to this connector.
|
|
234
234
|
* Filters connections by connectorKey internally.
|
|
235
|
-
* Returns tools keyed as
|
|
235
|
+
* Returns tools keyed as `connector_${connectorKey}_${toolName}`.
|
|
236
236
|
*/
|
|
237
237
|
createTools(connections, config, opts) {
|
|
238
238
|
const myConnections = connections.filter(
|
|
@@ -242,7 +242,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
242
242
|
for (const t of Object.values(this.tools)) {
|
|
243
243
|
const tool = t.createTool(myConnections, config);
|
|
244
244
|
const originalToModelOutput = tool.toModelOutput;
|
|
245
|
-
result[
|
|
245
|
+
result[`connector_${this.connectorKey}_${t.name}`] = {
|
|
246
246
|
...tool,
|
|
247
247
|
toModelOutput: async (options) => {
|
|
248
248
|
if (!originalToModelOutput) {
|
|
@@ -533,27 +533,27 @@ var outlookOnboarding = new ConnectorOnboarding({
|
|
|
533
533
|
},
|
|
534
534
|
dataOverviewInstructions: {
|
|
535
535
|
en: `Mail
|
|
536
|
-
1. Call
|
|
537
|
-
2. Call
|
|
538
|
-
3. Call
|
|
539
|
-
4. Call
|
|
540
|
-
5. For threading, call
|
|
536
|
+
1. Call connector_outlook-oauth_request with GET /me/mailFolders to list mail folders
|
|
537
|
+
2. Call connector_outlook-oauth_request with GET /me/messages?$top=5&$select=id,subject,from,receivedDateTime,conversationId to sample recent messages
|
|
538
|
+
3. Call connector_outlook-oauth_request with GET /me/messages/{id} for an interesting message to inspect the full payload
|
|
539
|
+
4. Call connector_outlook-oauth_request with GET /me/mailFolders/{folderId}/messages?$top=5 to drill into a specific folder
|
|
540
|
+
5. For threading, call connector_outlook-oauth_request with GET /me/messages?$filter=conversationId%20eq%20'<id>'&$orderby=receivedDateTime%20asc to pull every message in a conversation
|
|
541
541
|
|
|
542
542
|
Calendar
|
|
543
|
-
6. Call
|
|
544
|
-
7. Call
|
|
545
|
-
8. Call
|
|
543
|
+
6. Call connector_outlook-oauth_request with GET /me/calendars to list calendars (default + shared)
|
|
544
|
+
7. Call connector_outlook-oauth_request with GET /me/calendarView?startDateTime=<startISO>&endDateTime=<endISO>&$top=5&$select=id,subject,start,end,attendees to sample upcoming occurrences (expands recurring events)
|
|
545
|
+
8. Call connector_outlook-oauth_request with GET /me/events/{eventId} for an interesting event to inspect attendees, body, and location`,
|
|
546
546
|
ja: `\u30E1\u30FC\u30EB
|
|
547
|
-
1.
|
|
548
|
-
2.
|
|
549
|
-
3. \u8208\u5473\u306E\u3042\u308B\u30E1\u30C3\u30BB\u30FC\u30B8\u306B\u3064\u3044\u3066
|
|
550
|
-
4.
|
|
551
|
-
5. \u30B9\u30EC\u30C3\u30C9\u3092\u8FFD\u3046\u5834\u5408\u306F
|
|
547
|
+
1. connector_outlook-oauth_request \u3067 GET /me/mailFolders \u3092\u547C\u3073\u51FA\u3057\u3001\u30E1\u30FC\u30EB\u30D5\u30A9\u30EB\u30C0\u4E00\u89A7\u3092\u53D6\u5F97
|
|
548
|
+
2. connector_outlook-oauth_request \u3067 GET /me/messages?$top=5&$select=id,subject,from,receivedDateTime,conversationId \u3092\u547C\u3073\u51FA\u3057\u3001\u6700\u65B0\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u30B5\u30F3\u30D7\u30EA\u30F3\u30B0
|
|
549
|
+
3. \u8208\u5473\u306E\u3042\u308B\u30E1\u30C3\u30BB\u30FC\u30B8\u306B\u3064\u3044\u3066 connector_outlook-oauth_request \u3067 GET /me/messages/{id} \u3092\u547C\u3073\u51FA\u3057\u3001\u30DA\u30A4\u30ED\u30FC\u30C9\u5168\u4F53\u3092\u78BA\u8A8D
|
|
550
|
+
4. connector_outlook-oauth_request \u3067 GET /me/mailFolders/{folderId}/messages?$top=5 \u3092\u547C\u3073\u51FA\u3057\u3001\u7279\u5B9A\u30D5\u30A9\u30EB\u30C0\u306E\u4E2D\u8EAB\u3092\u78BA\u8A8D
|
|
551
|
+
5. \u30B9\u30EC\u30C3\u30C9\u3092\u8FFD\u3046\u5834\u5408\u306F connector_outlook-oauth_request \u3067 GET /me/messages?$filter=conversationId%20eq%20'<id>'&$orderby=receivedDateTime%20asc \u3092\u547C\u3073\u51FA\u3057\u3001\u4F1A\u8A71\u306B\u542B\u307E\u308C\u308B\u5168\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u53D6\u5F97
|
|
552
552
|
|
|
553
553
|
\u30AB\u30EC\u30F3\u30C0\u30FC
|
|
554
|
-
6.
|
|
555
|
-
7.
|
|
556
|
-
8. \u8208\u5473\u306E\u3042\u308B\u30A4\u30D9\u30F3\u30C8\u306B\u3064\u3044\u3066
|
|
554
|
+
6. connector_outlook-oauth_request \u3067 GET /me/calendars \u3092\u547C\u3073\u51FA\u3057\u3001\u30AB\u30EC\u30F3\u30C0\u30FC\u4E00\u89A7 (\u30C7\u30D5\u30A9\u30EB\u30C8 + \u5171\u6709) \u3092\u53D6\u5F97
|
|
555
|
+
7. connector_outlook-oauth_request \u3067 GET /me/calendarView?startDateTime=<startISO>&endDateTime=<endISO>&$top=5&$select=id,subject,start,end,attendees \u3092\u547C\u3073\u51FA\u3057\u3001\u76F4\u8FD1\u306E occurrence \u3092\u30B5\u30F3\u30D7\u30EA\u30F3\u30B0 (\u7E70\u308A\u8FD4\u3057\u30A4\u30D9\u30F3\u30C8\u3092\u5C55\u958B)
|
|
556
|
+
8. \u8208\u5473\u306E\u3042\u308B\u30A4\u30D9\u30F3\u30C8\u306B\u3064\u3044\u3066 connector_outlook-oauth_request \u3067 GET /me/events/{eventId} \u3092\u547C\u3073\u51FA\u3057\u3001\u53C2\u52A0\u8005\u30FB\u672C\u6587\u30FB\u5834\u6240\u3092\u78BA\u8A8D`
|
|
557
557
|
}
|
|
558
558
|
});
|
|
559
559
|
|
|
@@ -653,7 +653,7 @@ var outlookOauthConnector = new ConnectorPlugin({
|
|
|
653
653
|
description: "Connect to Microsoft Outlook (Mail + Calendar) via Microsoft Graph using OAuth. Read-only access to the user's mailbox, mail folders, messages, attachments, calendars, and events.",
|
|
654
654
|
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/1J1FrRTYJjOh3CcSIqsz3I/6a467b4d926075ff99dc60820e0ae4b1/Microsoft_Outlook_Icon__2025%C3%A2__present_.svg",
|
|
655
655
|
parameters,
|
|
656
|
-
releaseFlag: { dev1: true, dev2:
|
|
656
|
+
releaseFlag: { dev1: true, dev2: true, prod: true },
|
|
657
657
|
categories: ["productivity"],
|
|
658
658
|
onboarding: outlookOnboarding,
|
|
659
659
|
proxyPolicy: {
|
|
@@ -667,7 +667,7 @@ var outlookOauthConnector = new ConnectorPlugin({
|
|
|
667
667
|
systemPrompt: {
|
|
668
668
|
en: `### Tools
|
|
669
669
|
|
|
670
|
-
- \`
|
|
670
|
+
- \`connector_outlook-oauth_request\`: The only way to call Microsoft Graph for Outlook (read-only). Use it to fetch the user profile (\`/me\`), list mail folders (\`/me/mailFolders\`), read messages (\`/me/messages\`, \`/me/messages/{id}\`), fetch attachments (\`/me/messages/{id}/attachments\`), list calendars (\`/me/calendars\`), and read events (\`/me/events\`, \`/me/calendarView\`). Authentication is configured automatically via OAuth.
|
|
671
671
|
|
|
672
672
|
### Microsoft Graph Reference (Outlook Mail)
|
|
673
673
|
|
|
@@ -800,7 +800,7 @@ events.value.forEach(e => console.log(e.start.dateTime, e.subject));
|
|
|
800
800
|
\`\`\``,
|
|
801
801
|
ja: `### \u30C4\u30FC\u30EB
|
|
802
802
|
|
|
803
|
-
- \`
|
|
803
|
+
- \`connector_outlook-oauth_request\`: Outlook \u5411\u3051\u306E Microsoft Graph \u3092\u547C\u3073\u51FA\u3059\u552F\u4E00\u306E\u624B\u6BB5\u3067\u3059\uFF08\u8AAD\u307F\u53D6\u308A\u5C02\u7528\uFF09\u3002\u30E6\u30FC\u30B6\u30FC\u30D7\u30ED\u30D5\u30A3\u30FC\u30EB (\`/me\`)\u3001\u30E1\u30FC\u30EB\u30D5\u30A9\u30EB\u30C0 (\`/me/mailFolders\`)\u3001\u30E1\u30C3\u30BB\u30FC\u30B8 (\`/me/messages\`)\u3001\u6DFB\u4ED8\u30D5\u30A1\u30A4\u30EB (\`/me/messages/{id}/attachments\`)\u3001\u30AB\u30EC\u30F3\u30C0\u30FC (\`/me/calendars\`)\u3001\u30A4\u30D9\u30F3\u30C8 (\`/me/events\`, \`/me/calendarView\`) \u306E\u53D6\u5F97\u306B\u4F7F\u3044\u307E\u3059\u3002OAuth \u7D4C\u7531\u3067\u8A8D\u8A3C\u306F\u81EA\u52D5\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002
|
|
804
804
|
|
|
805
805
|
### Microsoft Graph \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9 (Outlook \u30E1\u30FC\u30EB)
|
|
806
806
|
|
|
@@ -190,7 +190,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
190
190
|
/**
|
|
191
191
|
* Create tools for connections that belong to this connector.
|
|
192
192
|
* Filters connections by connectorKey internally.
|
|
193
|
-
* Returns tools keyed as
|
|
193
|
+
* Returns tools keyed as `connector_${connectorKey}_${toolName}`.
|
|
194
194
|
*/
|
|
195
195
|
createTools(connections, config, opts) {
|
|
196
196
|
const myConnections = connections.filter(
|
|
@@ -200,7 +200,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
200
200
|
for (const t of Object.values(this.tools)) {
|
|
201
201
|
const tool = t.createTool(myConnections, config);
|
|
202
202
|
const originalToModelOutput = tool.toModelOutput;
|
|
203
|
-
result[
|
|
203
|
+
result[`connector_${this.connectorKey}_${t.name}`] = {
|
|
204
204
|
...tool,
|
|
205
205
|
toModelOutput: async (options) => {
|
|
206
206
|
if (!originalToModelOutput) {
|
|
@@ -491,14 +491,14 @@ var powerbiOauthOnboarding = new ConnectorOnboarding({
|
|
|
491
491
|
- Write only 1 sentence between tool calls, then immediately call the next tool`
|
|
492
492
|
},
|
|
493
493
|
dataOverviewInstructions: {
|
|
494
|
-
en: `1. Call
|
|
495
|
-
2. For a target workspace, call
|
|
496
|
-
3. Call
|
|
497
|
-
4. For each interesting dataset call
|
|
498
|
-
ja: `1.
|
|
499
|
-
2. \u5BFE\u8C61\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u306B\u5BFE\u3057\u3066
|
|
500
|
-
3.
|
|
501
|
-
4. \u8208\u5473\u306E\u3042\u308B\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306B\u3064\u3044\u3066
|
|
494
|
+
en: `1. Call connector_powerbi-oauth_request with GET /groups to list accessible workspaces
|
|
495
|
+
2. For a target workspace, call connector_powerbi-oauth_request with GET /groups/{groupId}/datasets to list datasets
|
|
496
|
+
3. Call connector_powerbi-oauth_request with GET /groups/{groupId}/reports to list reports
|
|
497
|
+
4. For each interesting dataset call connector_powerbi-oauth_request with GET /groups/{groupId}/datasets/{datasetId}/tables to inspect tables`,
|
|
498
|
+
ja: `1. connector_powerbi-oauth_request \u3067 GET /groups \u3092\u547C\u3073\u51FA\u3057\u3001\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306A\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u4E00\u89A7\u3092\u53D6\u5F97
|
|
499
|
+
2. \u5BFE\u8C61\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u306B\u5BFE\u3057\u3066 connector_powerbi-oauth_request \u3067 GET /groups/{groupId}/datasets \u3092\u547C\u3073\u51FA\u3057\u3001\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u4E00\u89A7\u3092\u53D6\u5F97
|
|
500
|
+
3. connector_powerbi-oauth_request \u3067 GET /groups/{groupId}/reports \u3092\u547C\u3073\u51FA\u3057\u3001\u30EC\u30DD\u30FC\u30C8\u4E00\u89A7\u3092\u53D6\u5F97
|
|
501
|
+
4. \u8208\u5473\u306E\u3042\u308B\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u306B\u3064\u3044\u3066 connector_powerbi-oauth_request \u3067 GET /groups/{groupId}/datasets/{datasetId}/tables \u3092\u547C\u3073\u51FA\u3057\u3001\u30C6\u30FC\u30D6\u30EB\u69CB\u9020\u3092\u78BA\u8A8D`
|
|
502
502
|
}
|
|
503
503
|
});
|
|
504
504
|
|
|
@@ -892,7 +892,7 @@ var powerbiOauthConnector = new ConnectorPlugin({
|
|
|
892
892
|
description: "Connect to Microsoft Power BI using OAuth (Microsoft Entra ID). Use it to enumerate workspaces, datasets, and reports the signed-in user has access to, and to run DAX queries.",
|
|
893
893
|
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/2vXQCKGpMJ9kGSaqkZl9IS/cc5669c267fc5d11e7b1f8c01723e461/power-bi-icon.png",
|
|
894
894
|
parameters,
|
|
895
|
-
releaseFlag: { dev1: true, dev2:
|
|
895
|
+
releaseFlag: { dev1: true, dev2: true, prod: true },
|
|
896
896
|
categories: ["bi"],
|
|
897
897
|
onboarding: powerbiOauthOnboarding,
|
|
898
898
|
proxyPolicy: {
|
|
@@ -906,7 +906,7 @@ var powerbiOauthConnector = new ConnectorPlugin({
|
|
|
906
906
|
systemPrompt: {
|
|
907
907
|
en: `### Tools
|
|
908
908
|
|
|
909
|
-
- \`
|
|
909
|
+
- \`connector_powerbi-oauth_request\`: The only way to call the Power BI REST API v1.0. Use it to list workspaces (\`/groups\`), datasets, reports, and to run DAX via the \`executeQueries\` endpoint. Authentication is configured automatically via OAuth (Microsoft Entra ID).
|
|
910
910
|
|
|
911
911
|
### Business Logic
|
|
912
912
|
|
|
@@ -962,7 +962,7 @@ export default async function handler(c: Context) {
|
|
|
962
962
|
- Each \`executeQueries\` call accepts one query in the \`queries\` array (per current Power BI API limits)`,
|
|
963
963
|
ja: `### \u30C4\u30FC\u30EB
|
|
964
964
|
|
|
965
|
-
- \`
|
|
965
|
+
- \`connector_powerbi-oauth_request\`: Power BI REST API v1.0 \u3092\u547C\u3073\u51FA\u3059\u552F\u4E00\u306E\u624B\u6BB5\u3067\u3059\u3002\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9 (\`/groups\`)\u3001\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8\u3001\u30EC\u30DD\u30FC\u30C8\u306E\u4E00\u89A7\u53D6\u5F97\u3084\u3001\`executeQueries\` \u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8\u306B\u3088\u308B DAX \u306E\u5B9F\u884C\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002OAuth (Microsoft Entra ID) \u7D4C\u7531\u3067\u8A8D\u8A3C\u306F\u81EA\u52D5\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002
|
|
966
966
|
|
|
967
967
|
### Business Logic
|
|
968
968
|
|