@squadbase/vite-server 0.1.17-dev.24af54e → 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 +4873 -1073
- package/dist/connectors/airtable-oauth.js +78 -11
- package/dist/connectors/airtable.js +74 -11
- package/dist/connectors/amplitude.js +38 -11
- package/dist/connectors/anthropic.js +4 -2
- package/dist/connectors/asana.js +67 -13
- package/dist/connectors/attio.js +60 -16
- package/dist/connectors/aws-billing.js +38 -11
- package/dist/connectors/azure-sql.js +64 -13
- package/dist/connectors/backlog-api-key.js +70 -18
- package/dist/connectors/clickup.js +80 -13
- package/dist/connectors/cosmosdb.js +42 -15
- package/dist/connectors/customerio.js +39 -12
- package/dist/connectors/dbt.js +716 -28
- package/dist/connectors/freshdesk.js +112 -11
- package/dist/connectors/freshsales.js +38 -11
- package/dist/connectors/freshservice.js +38 -11
- package/dist/connectors/gamma.js +47 -20
- package/dist/connectors/gemini.js +4 -2
- package/dist/connectors/github.js +42 -15
- package/dist/connectors/gmail-oauth.js +38 -13
- package/dist/connectors/gmail.js +34 -7
- package/dist/connectors/google-ads.js +38 -11
- package/dist/connectors/google-analytics-oauth.js +182 -28
- package/dist/connectors/google-analytics.js +653 -104
- package/dist/connectors/google-audit-log.js +34 -7
- package/dist/connectors/google-calendar-oauth.js +91 -18
- package/dist/connectors/google-calendar.js +91 -14
- package/dist/connectors/google-docs.js +38 -13
- package/dist/connectors/google-drive.js +60 -13
- package/dist/connectors/google-search-console-oauth.js +156 -20
- package/dist/connectors/google-sheets.js +36 -9
- package/dist/connectors/google-slides.js +38 -13
- package/dist/connectors/grafana.js +75 -13
- package/dist/connectors/hubspot-oauth.js +69 -12
- package/dist/connectors/hubspot.js +55 -12
- package/dist/connectors/influxdb.js +38 -11
- package/dist/connectors/intercom-oauth.js +100 -15
- package/dist/connectors/intercom.js +42 -15
- package/dist/connectors/jdbc.js +36 -9
- package/dist/connectors/jira-api-key.js +98 -14
- package/dist/connectors/kintone-api-token.js +96 -21
- package/dist/connectors/kintone.js +84 -14
- package/dist/connectors/linear.js +84 -15
- package/dist/connectors/linkedin-ads.js +71 -17
- package/dist/connectors/mailchimp-oauth.js +36 -9
- package/dist/connectors/mailchimp.js +36 -9
- package/dist/connectors/meta-ads-oauth.js +63 -17
- package/dist/connectors/meta-ads.js +65 -17
- package/dist/connectors/mixpanel.js +38 -11
- package/dist/connectors/monday.js +39 -12
- package/dist/connectors/mongodb.js +38 -11
- package/dist/connectors/notion-oauth.js +88 -14
- package/dist/connectors/notion.js +90 -14
- package/dist/connectors/openai.js +4 -2
- package/dist/connectors/oracle.js +78 -20
- package/dist/connectors/outlook-oauth.js +48 -23
- package/dist/connectors/powerbi-oauth.js +321 -49
- package/dist/connectors/salesforce.js +72 -12
- package/dist/connectors/semrush.js +374 -52
- package/dist/connectors/sentry.js +66 -13
- package/dist/connectors/shopify-oauth.js +71 -13
- package/dist/connectors/shopify.js +38 -11
- package/dist/connectors/sqlserver.js +64 -13
- package/dist/connectors/stripe-api-key.js +96 -18
- package/dist/connectors/stripe-oauth.js +98 -22
- package/dist/connectors/supabase.js +55 -11
- package/dist/connectors/tableau.js +262 -92
- package/dist/connectors/tiktok-ads.js +67 -19
- package/dist/connectors/wix-store.js +38 -11
- package/dist/connectors/zendesk-oauth.js +83 -15
- package/dist/connectors/zendesk.js +42 -15
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4902 -1077
- package/dist/main.js +4891 -1071
- package/dist/vite-plugin.js +4871 -1071
- 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.
|
|
@@ -343,7 +345,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
343
345
|
/**
|
|
344
346
|
* Create tools for connections that belong to this connector.
|
|
345
347
|
* Filters connections by connectorKey internally.
|
|
346
|
-
* Returns tools keyed as
|
|
348
|
+
* Returns tools keyed as `connector_${connectorKey}_${toolName}`.
|
|
347
349
|
*/
|
|
348
350
|
createTools(connections, config, opts) {
|
|
349
351
|
const myConnections = connections.filter(
|
|
@@ -353,7 +355,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
353
355
|
for (const t of Object.values(this.tools)) {
|
|
354
356
|
const tool = t.createTool(myConnections, config);
|
|
355
357
|
const originalToModelOutput = tool.toModelOutput;
|
|
356
|
-
result[
|
|
358
|
+
result[`connector_${this.connectorKey}_${t.name}`] = {
|
|
357
359
|
...tool,
|
|
358
360
|
toModelOutput: async (options) => {
|
|
359
361
|
if (!originalToModelOutput) {
|
|
@@ -409,19 +411,34 @@ async function runSetupFlow(flow, params, ctx, config) {
|
|
|
409
411
|
};
|
|
410
412
|
let state = flow.initialState();
|
|
411
413
|
let answerIdx = 0;
|
|
414
|
+
const pendingParameterUpdates = [];
|
|
412
415
|
for (const step of flow.steps) {
|
|
413
416
|
const ans = ctx.answers[answerIdx];
|
|
414
417
|
if (ans && ans.questionSlug === step.slug) {
|
|
415
418
|
state = step.applyAnswer(state, ans.answer);
|
|
419
|
+
if (step.toParameterUpdates) {
|
|
420
|
+
pendingParameterUpdates.push(...step.toParameterUpdates(state));
|
|
421
|
+
}
|
|
416
422
|
answerIdx += 1;
|
|
417
423
|
continue;
|
|
418
424
|
}
|
|
425
|
+
const resolvedAllowFreeText = step.allowFreeText !== void 0 ? step.allowFreeText : true;
|
|
419
426
|
if (step.type === "text") {
|
|
427
|
+
if (step.fetchOptions) {
|
|
428
|
+
const options2 = await step.fetchOptions(state, runtime);
|
|
429
|
+
if (options2.length === 0) {
|
|
430
|
+
continue;
|
|
431
|
+
}
|
|
432
|
+
}
|
|
420
433
|
return {
|
|
421
434
|
type: "nextQuestion",
|
|
422
435
|
questionSlug: step.slug,
|
|
423
436
|
question: step.question[ctx.language],
|
|
424
|
-
questionType: "text"
|
|
437
|
+
questionType: "text",
|
|
438
|
+
allowFreeText: resolvedAllowFreeText,
|
|
439
|
+
...pendingParameterUpdates.length > 0 && {
|
|
440
|
+
parameterUpdates: pendingParameterUpdates
|
|
441
|
+
}
|
|
425
442
|
};
|
|
426
443
|
}
|
|
427
444
|
const options = step.fetchOptions ? await step.fetchOptions(state, runtime) : [];
|
|
@@ -433,11 +450,21 @@ async function runSetupFlow(flow, params, ctx, config) {
|
|
|
433
450
|
questionSlug: step.slug,
|
|
434
451
|
question: step.question[ctx.language],
|
|
435
452
|
questionType: step.type,
|
|
436
|
-
options
|
|
453
|
+
options,
|
|
454
|
+
allowFreeText: resolvedAllowFreeText,
|
|
455
|
+
...pendingParameterUpdates.length > 0 && {
|
|
456
|
+
parameterUpdates: pendingParameterUpdates
|
|
457
|
+
}
|
|
437
458
|
};
|
|
438
459
|
}
|
|
439
460
|
const dataInvestigationResult = await flow.finalize(state, runtime);
|
|
440
|
-
return {
|
|
461
|
+
return {
|
|
462
|
+
type: "fulfilled",
|
|
463
|
+
dataInvestigationResult,
|
|
464
|
+
...pendingParameterUpdates.length > 0 && {
|
|
465
|
+
parameterUpdates: pendingParameterUpdates
|
|
466
|
+
}
|
|
467
|
+
};
|
|
441
468
|
}
|
|
442
469
|
async function resolveSetupSelection(params) {
|
|
443
470
|
const { selected, allSentinel, fetchAll, limit } = params;
|
|
@@ -468,13 +495,13 @@ function normalizeRequestPath(path2, basePathSegment) {
|
|
|
468
495
|
// ../connectors/src/connectors/freshdesk/setup.ts
|
|
469
496
|
var freshdeskOnboarding = new ConnectorOnboarding({
|
|
470
497
|
dataOverviewInstructions: {
|
|
471
|
-
en: `1. Call
|
|
472
|
-
2. Call
|
|
498
|
+
en: `1. Call connector_freshdesk_request with GET /agents/me to confirm credentials.
|
|
499
|
+
2. Call connector_freshdesk_request with GET /tickets?per_page=10&order_by=created_at&order_type=desc to sample recent tickets. Each ticket carries \`status\`, \`priority\`, \`source\`, \`requester_id\`, \`responder_id\`, and \`created_at\`.
|
|
473
500
|
3. Call GET /contacts?per_page=10 to sample contacts (end users) and GET /companies?per_page=10 for companies.
|
|
474
501
|
4. To enumerate agents and groups, call GET /agents and GET /groups.
|
|
475
502
|
5. Pagination is page-based with \`page\` (1-indexed) and \`per_page\` (max 100). The \`Link\` response header carries the next-page URL when more results exist.`,
|
|
476
|
-
ja: `1.
|
|
477
|
-
2.
|
|
503
|
+
ja: `1. connector_freshdesk_request \u3067 GET /agents/me \u3092\u547C\u3073\u51FA\u3057\u3001\u8A8D\u8A3C\u60C5\u5831\u3092\u78BA\u8A8D\u3057\u307E\u3059\u3002
|
|
504
|
+
2. connector_freshdesk_request \u3067 GET /tickets?per_page=10&order_by=created_at&order_type=desc \u3092\u547C\u3073\u51FA\u3057\u3066\u6700\u8FD1\u306E\u30C1\u30B1\u30C3\u30C8\u3092\u30B5\u30F3\u30D7\u30EA\u30F3\u30B0\u3057\u307E\u3059\u3002\u5404\u30C1\u30B1\u30C3\u30C8\u306B\u306F \`status\`, \`priority\`, \`source\`, \`requester_id\`, \`responder_id\`, \`created_at\` \u306A\u3069\u304C\u542B\u307E\u308C\u307E\u3059\u3002
|
|
478
505
|
3. GET /contacts?per_page=10 \u3067\u9023\u7D61\u5148\uFF08\u30A8\u30F3\u30C9\u30E6\u30FC\u30B6\u30FC\uFF09\u3001GET /companies?per_page=10 \u3067\u4F1A\u793E\u60C5\u5831\u3092\u30B5\u30F3\u30D7\u30EA\u30F3\u30B0\u3057\u307E\u3059\u3002
|
|
479
506
|
4. \u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u3084\u30B0\u30EB\u30FC\u30D7\u306F GET /agents\u3001GET /groups \u3067\u53D6\u5F97\u3057\u307E\u3059\u3002
|
|
480
507
|
5. \u30DA\u30FC\u30B8\u30CD\u30FC\u30B7\u30E7\u30F3\u306F1\u59CB\u307E\u308A\u306E \`page\` \u3068 \`per_page\`\uFF08\u6700\u5927100\uFF09\u3002\u6B21\u30DA\u30FC\u30B8\u304C\u5B58\u5728\u3059\u308B\u5834\u5408\u306F \`Link\` \u30EC\u30B9\u30DD\u30F3\u30B9\u30D8\u30C3\u30C0\u306B\u6B21URL\u304C\u542B\u307E\u308C\u307E\u3059\u3002`
|
|
@@ -601,6 +628,80 @@ var freshdeskSetupFlow = {
|
|
|
601
628
|
);
|
|
602
629
|
}
|
|
603
630
|
sections.push("");
|
|
631
|
+
if (targetEntities.includes("tickets")) {
|
|
632
|
+
try {
|
|
633
|
+
const ticketRes = await apiFetch(
|
|
634
|
+
rt.params,
|
|
635
|
+
"/tickets?per_page=30&order_by=created_at&order_type=desc"
|
|
636
|
+
);
|
|
637
|
+
if (ticketRes.ok) {
|
|
638
|
+
const tickets = await ticketRes.json();
|
|
639
|
+
if (Array.isArray(tickets) && tickets.length > 0) {
|
|
640
|
+
const STATUS_MAP = {
|
|
641
|
+
2: "Open",
|
|
642
|
+
3: "Pending",
|
|
643
|
+
4: "Resolved",
|
|
644
|
+
5: "Closed"
|
|
645
|
+
};
|
|
646
|
+
const PRIORITY_MAP = {
|
|
647
|
+
1: "Low",
|
|
648
|
+
2: "Medium",
|
|
649
|
+
3: "High",
|
|
650
|
+
4: "Urgent"
|
|
651
|
+
};
|
|
652
|
+
const statusCounts = {};
|
|
653
|
+
for (const t of tickets) {
|
|
654
|
+
const s = t.status != null && STATUS_MAP[t.status] || String(t.status ?? "unknown");
|
|
655
|
+
statusCounts[s] = (statusCounts[s] ?? 0) + 1;
|
|
656
|
+
}
|
|
657
|
+
sections.push(
|
|
658
|
+
"### Ticket status breakdown (from recent tickets)",
|
|
659
|
+
""
|
|
660
|
+
);
|
|
661
|
+
sections.push("| Status | Count |");
|
|
662
|
+
sections.push("|--------|-------|");
|
|
663
|
+
for (const [status, cnt] of Object.entries(statusCounts).sort(
|
|
664
|
+
(a, b) => b[1] - a[1]
|
|
665
|
+
)) {
|
|
666
|
+
sections.push(`| ${status} | ${cnt} |`);
|
|
667
|
+
}
|
|
668
|
+
sections.push("");
|
|
669
|
+
const priorityCounts = {};
|
|
670
|
+
for (const t of tickets) {
|
|
671
|
+
const p = t.priority != null && PRIORITY_MAP[t.priority] || String(t.priority ?? "unknown");
|
|
672
|
+
priorityCounts[p] = (priorityCounts[p] ?? 0) + 1;
|
|
673
|
+
}
|
|
674
|
+
sections.push(
|
|
675
|
+
"### Ticket priority breakdown (from recent tickets)",
|
|
676
|
+
""
|
|
677
|
+
);
|
|
678
|
+
sections.push("| Priority | Count |");
|
|
679
|
+
sections.push("|----------|-------|");
|
|
680
|
+
for (const [priority, cnt] of Object.entries(priorityCounts).sort(
|
|
681
|
+
(a, b) => b[1] - a[1]
|
|
682
|
+
)) {
|
|
683
|
+
sections.push(`| ${priority} | ${cnt} |`);
|
|
684
|
+
}
|
|
685
|
+
sections.push("");
|
|
686
|
+
sections.push("### Recent tickets (sample)", "");
|
|
687
|
+
sections.push("| ID | Subject | Status | Priority | Created |");
|
|
688
|
+
sections.push("|----|---------|--------|----------|---------|");
|
|
689
|
+
for (const t of tickets.slice(0, 5)) {
|
|
690
|
+
const id = t.id != null ? String(t.id) : "-";
|
|
691
|
+
const subject = (t.subject ?? "-").replace(/\|/g, "\\|").slice(0, 60);
|
|
692
|
+
const status = t.status != null && STATUS_MAP[t.status] || String(t.status ?? "-");
|
|
693
|
+
const priority = t.priority != null && PRIORITY_MAP[t.priority] || String(t.priority ?? "-");
|
|
694
|
+
const created = t.created_at ? t.created_at.slice(0, 10) : "-";
|
|
695
|
+
sections.push(
|
|
696
|
+
`| ${id} | ${subject} | ${status} | ${priority} | ${created} |`
|
|
697
|
+
);
|
|
698
|
+
}
|
|
699
|
+
sections.push("");
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
} catch {
|
|
703
|
+
}
|
|
704
|
+
}
|
|
604
705
|
return sections.join("\n");
|
|
605
706
|
}
|
|
606
707
|
};
|
|
@@ -742,7 +843,7 @@ var freshdeskConnector = new ConnectorPlugin({
|
|
|
742
843
|
systemPrompt: {
|
|
743
844
|
en: `### Tools
|
|
744
845
|
|
|
745
|
-
- \`
|
|
846
|
+
- \`connector_freshdesk_request\`: The only way to call the Freshdesk REST API v2. Use it to list tickets, contacts, companies, agents, groups, and more. Authentication (HTTP Basic Auth using the API key as username) and the base URL (https://<domain>.freshdesk.com/api/v2) are configured automatically.
|
|
746
847
|
|
|
747
848
|
### Business Logic
|
|
748
849
|
|
|
@@ -819,7 +920,7 @@ export default async function handler(c: Context) {
|
|
|
819
920
|
- \`source\`: 1=Email, 2=Portal, 3=Phone, 7=Chat, 9=Feedback widget, 10=Outbound email`,
|
|
820
921
|
ja: `### \u30C4\u30FC\u30EB
|
|
821
922
|
|
|
822
|
-
- \`
|
|
923
|
+
- \`connector_freshdesk_request\`: Freshdesk REST API v2 \u3092\u547C\u3073\u51FA\u3059\u552F\u4E00\u306E\u624B\u6BB5\u3067\u3059\u3002\u30C1\u30B1\u30C3\u30C8\u3001\u9023\u7D61\u5148\u3001\u4F1A\u793E\u3001\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u3001\u30B0\u30EB\u30FC\u30D7\u306A\u3069\u306E\u53D6\u5F97\u30FB\u66F4\u65B0\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002\u8A8D\u8A3C\uFF08API \u30AD\u30FC\u3092\u30E6\u30FC\u30B6\u30FC\u540D\u3068\u3057\u305F HTTP Basic Auth\uFF09\u3068\u30D9\u30FC\u30B9URL\uFF08https://<\u30C9\u30E1\u30A4\u30F3>.freshdesk.com/api/v2\uFF09\u306F\u81EA\u52D5\u3067\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002
|
|
823
924
|
|
|
824
925
|
### Business Logic
|
|
825
926
|
|
|
@@ -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.
|
|
@@ -358,7 +360,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
358
360
|
/**
|
|
359
361
|
* Create tools for connections that belong to this connector.
|
|
360
362
|
* Filters connections by connectorKey internally.
|
|
361
|
-
* Returns tools keyed as
|
|
363
|
+
* Returns tools keyed as `connector_${connectorKey}_${toolName}`.
|
|
362
364
|
*/
|
|
363
365
|
createTools(connections, config, opts) {
|
|
364
366
|
const myConnections = connections.filter(
|
|
@@ -368,7 +370,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
368
370
|
for (const t of Object.values(this.tools)) {
|
|
369
371
|
const tool = t.createTool(myConnections, config);
|
|
370
372
|
const originalToModelOutput = tool.toModelOutput;
|
|
371
|
-
result[
|
|
373
|
+
result[`connector_${this.connectorKey}_${t.name}`] = {
|
|
372
374
|
...tool,
|
|
373
375
|
toModelOutput: async (options) => {
|
|
374
376
|
if (!originalToModelOutput) {
|
|
@@ -424,19 +426,34 @@ async function runSetupFlow(flow, params, ctx, config) {
|
|
|
424
426
|
};
|
|
425
427
|
let state = flow.initialState();
|
|
426
428
|
let answerIdx = 0;
|
|
429
|
+
const pendingParameterUpdates = [];
|
|
427
430
|
for (const step of flow.steps) {
|
|
428
431
|
const ans = ctx.answers[answerIdx];
|
|
429
432
|
if (ans && ans.questionSlug === step.slug) {
|
|
430
433
|
state = step.applyAnswer(state, ans.answer);
|
|
434
|
+
if (step.toParameterUpdates) {
|
|
435
|
+
pendingParameterUpdates.push(...step.toParameterUpdates(state));
|
|
436
|
+
}
|
|
431
437
|
answerIdx += 1;
|
|
432
438
|
continue;
|
|
433
439
|
}
|
|
440
|
+
const resolvedAllowFreeText = step.allowFreeText !== void 0 ? step.allowFreeText : true;
|
|
434
441
|
if (step.type === "text") {
|
|
442
|
+
if (step.fetchOptions) {
|
|
443
|
+
const options2 = await step.fetchOptions(state, runtime);
|
|
444
|
+
if (options2.length === 0) {
|
|
445
|
+
continue;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
435
448
|
return {
|
|
436
449
|
type: "nextQuestion",
|
|
437
450
|
questionSlug: step.slug,
|
|
438
451
|
question: step.question[ctx.language],
|
|
439
|
-
questionType: "text"
|
|
452
|
+
questionType: "text",
|
|
453
|
+
allowFreeText: resolvedAllowFreeText,
|
|
454
|
+
...pendingParameterUpdates.length > 0 && {
|
|
455
|
+
parameterUpdates: pendingParameterUpdates
|
|
456
|
+
}
|
|
440
457
|
};
|
|
441
458
|
}
|
|
442
459
|
const options = step.fetchOptions ? await step.fetchOptions(state, runtime) : [];
|
|
@@ -448,11 +465,21 @@ async function runSetupFlow(flow, params, ctx, config) {
|
|
|
448
465
|
questionSlug: step.slug,
|
|
449
466
|
question: step.question[ctx.language],
|
|
450
467
|
questionType: step.type,
|
|
451
|
-
options
|
|
468
|
+
options,
|
|
469
|
+
allowFreeText: resolvedAllowFreeText,
|
|
470
|
+
...pendingParameterUpdates.length > 0 && {
|
|
471
|
+
parameterUpdates: pendingParameterUpdates
|
|
472
|
+
}
|
|
452
473
|
};
|
|
453
474
|
}
|
|
454
475
|
const dataInvestigationResult = await flow.finalize(state, runtime);
|
|
455
|
-
return {
|
|
476
|
+
return {
|
|
477
|
+
type: "fulfilled",
|
|
478
|
+
dataInvestigationResult,
|
|
479
|
+
...pendingParameterUpdates.length > 0 && {
|
|
480
|
+
parameterUpdates: pendingParameterUpdates
|
|
481
|
+
}
|
|
482
|
+
};
|
|
456
483
|
}
|
|
457
484
|
async function resolveSetupSelection(params) {
|
|
458
485
|
const { selected, allSentinel, fetchAll, limit } = params;
|
|
@@ -483,13 +510,13 @@ function normalizeRequestPath(path2, basePathSegment) {
|
|
|
483
510
|
// ../connectors/src/connectors/freshsales/setup.ts
|
|
484
511
|
var freshsalesOnboarding = new ConnectorOnboarding({
|
|
485
512
|
dataOverviewInstructions: {
|
|
486
|
-
en: `1. Call
|
|
487
|
-
2. Call
|
|
513
|
+
en: `1. Call connector_freshsales_request with GET /selector/owners to confirm credentials and discover sales team members.
|
|
514
|
+
2. Call connector_freshsales_request with GET /contacts/filters to list available contact views (filters), then GET /contacts/view/{view_id} to fetch contacts in a view (paginated with \`page\` and \`per_page\`, default 25, max 100).
|
|
488
515
|
3. Repeat the same pattern for accounts (GET /sales_accounts/filters \u2192 /sales_accounts/view/{view_id}) and deals (GET /deals/filters \u2192 /deals/view/{view_id}).
|
|
489
516
|
4. To inspect deal pipeline metadata, call GET /selector/deal_pipelines and GET /selector/deal_stages.
|
|
490
517
|
5. Use GET /lookup to find specific records by attribute (e.g., look up a contact by email).`,
|
|
491
|
-
ja: `1.
|
|
492
|
-
2.
|
|
518
|
+
ja: `1. connector_freshsales_request \u3067 GET /selector/owners \u3092\u547C\u3073\u51FA\u3057\u3001\u8A8D\u8A3C\u60C5\u5831\u306E\u78BA\u8A8D\u3068\u55B6\u696D\u30E1\u30F3\u30D0\u30FC\u306E\u4E00\u89A7\u3092\u53D6\u5F97\u3057\u307E\u3059\u3002
|
|
519
|
+
2. connector_freshsales_request \u3067 GET /contacts/filters \u3092\u547C\u3073\u51FA\u3057\u3066\u30D3\u30E5\u30FC\uFF08filters\uFF09\u4E00\u89A7\u3092\u53D6\u5F97\u3057\u3001GET /contacts/view/{view_id} \u3067\u5404\u30D3\u30E5\u30FC\u306E\u9023\u7D61\u5148\u3092\u53D6\u5F97\u3057\u307E\u3059\uFF08\`page\` \u3068 \`per_page\` \u3067\u30DA\u30FC\u30B8\u30F3\u30B0\u3001\u30C7\u30D5\u30A9\u30EB\u30C825\u3001\u6700\u5927100\uFF09\u3002
|
|
493
520
|
3. \u540C\u3058\u30D1\u30BF\u30FC\u30F3\u3092\u53D6\u5F15\u5148\uFF08GET /sales_accounts/filters \u2192 /sales_accounts/view/{view_id}\uFF09\u3001\u5546\u8AC7\uFF08GET /deals/filters \u2192 /deals/view/{view_id}\uFF09\u306B\u3082\u9069\u7528\u3057\u307E\u3059\u3002
|
|
494
521
|
4. \u5546\u8AC7\u30D1\u30A4\u30D7\u30E9\u30A4\u30F3\u306E\u30E1\u30BF\u60C5\u5831\u306F GET /selector/deal_pipelines \u304A\u3088\u3073 GET /selector/deal_stages \u3067\u53D6\u5F97\u3057\u307E\u3059\u3002
|
|
495
522
|
5. \u7279\u5B9A\u30EC\u30B3\u30FC\u30C9\u3092\u5C5E\u6027\u3067\u691C\u7D22\u3059\u308B\u306B\u306F GET /lookup \u3092\u4F7F\u7528\u3057\u307E\u3059\uFF08\u4F8B: \u30E1\u30FC\u30EB\u3067\u9023\u7D61\u5148\u3092\u691C\u7D22\uFF09\u3002`
|
|
@@ -750,7 +777,7 @@ var freshsalesConnector = new ConnectorPlugin({
|
|
|
750
777
|
systemPrompt: {
|
|
751
778
|
en: `### Tools
|
|
752
779
|
|
|
753
|
-
- \`
|
|
780
|
+
- \`connector_freshsales_request\`: The only way to call the Freshsales / Freshworks CRM REST API. Use it to list and update contacts, accounts, deals, leads, sales activities, and selector metadata. Authentication (\`Authorization: Token token=<API_KEY>\` header \u2014 note: NOT HTTP Basic Auth) and the base URL (https://<bundle>.myfreshworks.com/crm/sales/api) are configured automatically.
|
|
754
781
|
|
|
755
782
|
### Business Logic
|
|
756
783
|
|
|
@@ -833,7 +860,7 @@ export default async function handler(c: Context) {
|
|
|
833
860
|
- GET \`/selector/territories\` / \`/selector/business_types\` / \`/selector/industry_types\` / \`/selector/contact_statuses\` / \`/selector/sales_activity_types\``,
|
|
834
861
|
ja: `### \u30C4\u30FC\u30EB
|
|
835
862
|
|
|
836
|
-
- \`
|
|
863
|
+
- \`connector_freshsales_request\`: Freshsales / Freshworks CRM REST API \u3092\u547C\u3073\u51FA\u3059\u552F\u4E00\u306E\u624B\u6BB5\u3067\u3059\u3002\u9023\u7D61\u5148\u3001\u53D6\u5F15\u5148\u3001\u5546\u8AC7\u3001\u30EA\u30FC\u30C9\u3001\u55B6\u696D\u6D3B\u52D5\u3001\u5404\u7A2E\u30BB\u30EC\u30AF\u30BF\u30FC\u30E1\u30BF\u60C5\u5831\u306E\u53D6\u5F97\u30FB\u66F4\u65B0\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002\u8A8D\u8A3C\uFF08\`Authorization: Token token=<API_KEY>\` \u30D8\u30C3\u30C0\u30FC \u2014 Freshdesk/Freshservice \u3068\u7570\u306A\u308A HTTP Basic Auth \u3067\u306F\u3042\u308A\u307E\u305B\u3093\uFF09\u3068\u30D9\u30FC\u30B9URL\uFF08https://<bundle>.myfreshworks.com/crm/sales/api\uFF09\u306F\u81EA\u52D5\u3067\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002
|
|
837
864
|
|
|
838
865
|
### Business Logic
|
|
839
866
|
|
|
@@ -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.
|
|
@@ -313,7 +315,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
313
315
|
/**
|
|
314
316
|
* Create tools for connections that belong to this connector.
|
|
315
317
|
* Filters connections by connectorKey internally.
|
|
316
|
-
* Returns tools keyed as
|
|
318
|
+
* Returns tools keyed as `connector_${connectorKey}_${toolName}`.
|
|
317
319
|
*/
|
|
318
320
|
createTools(connections, config, opts) {
|
|
319
321
|
const myConnections = connections.filter(
|
|
@@ -323,7 +325,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
323
325
|
for (const t of Object.values(this.tools)) {
|
|
324
326
|
const tool = t.createTool(myConnections, config);
|
|
325
327
|
const originalToModelOutput = tool.toModelOutput;
|
|
326
|
-
result[
|
|
328
|
+
result[`connector_${this.connectorKey}_${t.name}`] = {
|
|
327
329
|
...tool,
|
|
328
330
|
toModelOutput: async (options) => {
|
|
329
331
|
if (!originalToModelOutput) {
|
|
@@ -379,19 +381,34 @@ async function runSetupFlow(flow, params, ctx, config) {
|
|
|
379
381
|
};
|
|
380
382
|
let state = flow.initialState();
|
|
381
383
|
let answerIdx = 0;
|
|
384
|
+
const pendingParameterUpdates = [];
|
|
382
385
|
for (const step of flow.steps) {
|
|
383
386
|
const ans = ctx.answers[answerIdx];
|
|
384
387
|
if (ans && ans.questionSlug === step.slug) {
|
|
385
388
|
state = step.applyAnswer(state, ans.answer);
|
|
389
|
+
if (step.toParameterUpdates) {
|
|
390
|
+
pendingParameterUpdates.push(...step.toParameterUpdates(state));
|
|
391
|
+
}
|
|
386
392
|
answerIdx += 1;
|
|
387
393
|
continue;
|
|
388
394
|
}
|
|
395
|
+
const resolvedAllowFreeText = step.allowFreeText !== void 0 ? step.allowFreeText : true;
|
|
389
396
|
if (step.type === "text") {
|
|
397
|
+
if (step.fetchOptions) {
|
|
398
|
+
const options2 = await step.fetchOptions(state, runtime);
|
|
399
|
+
if (options2.length === 0) {
|
|
400
|
+
continue;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
390
403
|
return {
|
|
391
404
|
type: "nextQuestion",
|
|
392
405
|
questionSlug: step.slug,
|
|
393
406
|
question: step.question[ctx.language],
|
|
394
|
-
questionType: "text"
|
|
407
|
+
questionType: "text",
|
|
408
|
+
allowFreeText: resolvedAllowFreeText,
|
|
409
|
+
...pendingParameterUpdates.length > 0 && {
|
|
410
|
+
parameterUpdates: pendingParameterUpdates
|
|
411
|
+
}
|
|
395
412
|
};
|
|
396
413
|
}
|
|
397
414
|
const options = step.fetchOptions ? await step.fetchOptions(state, runtime) : [];
|
|
@@ -403,11 +420,21 @@ async function runSetupFlow(flow, params, ctx, config) {
|
|
|
403
420
|
questionSlug: step.slug,
|
|
404
421
|
question: step.question[ctx.language],
|
|
405
422
|
questionType: step.type,
|
|
406
|
-
options
|
|
423
|
+
options,
|
|
424
|
+
allowFreeText: resolvedAllowFreeText,
|
|
425
|
+
...pendingParameterUpdates.length > 0 && {
|
|
426
|
+
parameterUpdates: pendingParameterUpdates
|
|
427
|
+
}
|
|
407
428
|
};
|
|
408
429
|
}
|
|
409
430
|
const dataInvestigationResult = await flow.finalize(state, runtime);
|
|
410
|
-
return {
|
|
431
|
+
return {
|
|
432
|
+
type: "fulfilled",
|
|
433
|
+
dataInvestigationResult,
|
|
434
|
+
...pendingParameterUpdates.length > 0 && {
|
|
435
|
+
parameterUpdates: pendingParameterUpdates
|
|
436
|
+
}
|
|
437
|
+
};
|
|
411
438
|
}
|
|
412
439
|
async function resolveSetupSelection(params) {
|
|
413
440
|
const { selected, allSentinel, fetchAll, limit } = params;
|
|
@@ -438,13 +465,13 @@ function normalizeRequestPath(path2, basePathSegment) {
|
|
|
438
465
|
// ../connectors/src/connectors/freshservice/setup.ts
|
|
439
466
|
var freshserviceOnboarding = new ConnectorOnboarding({
|
|
440
467
|
dataOverviewInstructions: {
|
|
441
|
-
en: `1. Call
|
|
442
|
-
2. Call
|
|
468
|
+
en: `1. Call connector_freshservice_request with GET /agents to confirm credentials and view available agents.
|
|
469
|
+
2. Call connector_freshservice_request with GET /tickets?per_page=10 to sample recent tickets. Each ticket has \`status\`, \`priority\`, \`source\`, \`responder_id\`, \`requester_id\`, and \`created_at\`.
|
|
443
470
|
3. To enumerate organisational structure, call GET /departments and GET /locations.
|
|
444
471
|
4. For asset inventory, call GET /assets?per_page=10 \u2014 note that ITAM endpoints require the asset module to be enabled.
|
|
445
472
|
5. Pagination is page-based with \`page\` (1-indexed) and \`per_page\` (max 100). The \`Link\` response header carries the next-page URL when more results exist.`,
|
|
446
|
-
ja: `1.
|
|
447
|
-
2.
|
|
473
|
+
ja: `1. connector_freshservice_request \u3067 GET /agents \u3092\u547C\u3073\u51FA\u3057\u3001\u8A8D\u8A3C\u60C5\u5831\u306E\u78BA\u8A8D\u3068\u5229\u7528\u53EF\u80FD\u306A\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u4E00\u89A7\u3092\u53D6\u5F97\u3057\u307E\u3059\u3002
|
|
474
|
+
2. connector_freshservice_request \u3067 GET /tickets?per_page=10 \u3092\u547C\u3073\u51FA\u3057\u3066\u6700\u8FD1\u306E\u30C1\u30B1\u30C3\u30C8\u3092\u30B5\u30F3\u30D7\u30EA\u30F3\u30B0\u3057\u307E\u3059\u3002\u5404\u30C1\u30B1\u30C3\u30C8\u306B\u306F \`status\`, \`priority\`, \`source\`, \`responder_id\`, \`requester_id\`, \`created_at\` \u306A\u3069\u304C\u542B\u307E\u308C\u307E\u3059\u3002
|
|
448
475
|
3. \u7D44\u7E54\u69CB\u9020\u3092\u628A\u63E1\u3059\u308B\u306B\u306F GET /departments \u304A\u3088\u3073 GET /locations \u3092\u547C\u3073\u51FA\u3057\u307E\u3059\u3002
|
|
449
476
|
4. \u8CC7\u7523\u30A4\u30F3\u30D9\u30F3\u30C8\u30EA\u306F GET /assets?per_page=10 \u3067\u53D6\u5F97\u3067\u304D\u307E\u3059\uFF08ITAM \u30E2\u30B8\u30E5\u30FC\u30EB\u304C\u6709\u52B9\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\uFF09\u3002
|
|
450
477
|
5. \u30DA\u30FC\u30B8\u30CD\u30FC\u30B7\u30E7\u30F3\u306F1\u59CB\u307E\u308A\u306E \`page\` \u3068 \`per_page\`\uFF08\u6700\u5927100\uFF09\u3002\u6B21\u30DA\u30FC\u30B8\u304C\u5B58\u5728\u3059\u308B\u5834\u5408\u306F \`Link\` \u30EC\u30B9\u30DD\u30F3\u30B9\u30D8\u30C3\u30C0\u306B\u6B21URL\u304C\u542B\u307E\u308C\u307E\u3059\u3002`
|
|
@@ -731,7 +758,7 @@ var freshserviceConnector = new ConnectorPlugin({
|
|
|
731
758
|
systemPrompt: {
|
|
732
759
|
en: `### Tools
|
|
733
760
|
|
|
734
|
-
- \`
|
|
761
|
+
- \`connector_freshservice_request\`: The only way to call the Freshservice REST API v2. Use it to list tickets, agents, requesters, departments, locations, assets, problems, changes, releases, and more. Authentication (HTTP Basic Auth using the API key as username) and the base URL (https://<domain>.freshservice.com/api/v2) are configured automatically.
|
|
735
762
|
|
|
736
763
|
### Business Logic
|
|
737
764
|
|
|
@@ -807,7 +834,7 @@ export default async function handler(c: Context) {
|
|
|
807
834
|
- \`source\`: 1=Email, 2=Portal, 3=Phone, 4=Chat, 5=Feedback widget, 7=Yammer, 8=AwsCloudwatch, 9=Pagerduty, 10=Walkup, 11=Slack`,
|
|
808
835
|
ja: `### \u30C4\u30FC\u30EB
|
|
809
836
|
|
|
810
|
-
- \`
|
|
837
|
+
- \`connector_freshservice_request\`: Freshservice REST API v2 \u3092\u547C\u3073\u51FA\u3059\u552F\u4E00\u306E\u624B\u6BB5\u3067\u3059\u3002\u30C1\u30B1\u30C3\u30C8\u3001\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u3001\u8981\u6C42\u8005\u3001\u90E8\u7F72\u3001\u30ED\u30B1\u30FC\u30B7\u30E7\u30F3\u3001\u8CC7\u7523\u3001\u554F\u984C\u7BA1\u7406\u3001\u5909\u66F4\u7BA1\u7406\u3001\u30EA\u30EA\u30FC\u30B9\u306A\u3069\u306E\u53D6\u5F97\u30FB\u66F4\u65B0\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002\u8A8D\u8A3C\uFF08API \u30AD\u30FC\u3092\u30E6\u30FC\u30B6\u30FC\u540D\u3068\u3057\u305F HTTP Basic Auth\uFF09\u3068\u30D9\u30FC\u30B9URL\uFF08https://<\u30C9\u30E1\u30A4\u30F3>.freshservice.com/api/v2\uFF09\u306F\u81EA\u52D5\u3067\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002
|
|
811
838
|
|
|
812
839
|
### Business Logic
|
|
813
840
|
|
package/dist/connectors/gamma.js
CHANGED
|
@@ -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.
|
|
@@ -269,7 +271,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
269
271
|
/**
|
|
270
272
|
* Create tools for connections that belong to this connector.
|
|
271
273
|
* Filters connections by connectorKey internally.
|
|
272
|
-
* Returns tools keyed as
|
|
274
|
+
* Returns tools keyed as `connector_${connectorKey}_${toolName}`.
|
|
273
275
|
*/
|
|
274
276
|
createTools(connections, config, opts) {
|
|
275
277
|
const myConnections = connections.filter(
|
|
@@ -279,7 +281,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
279
281
|
for (const t of Object.values(this.tools)) {
|
|
280
282
|
const tool = t.createTool(myConnections, config);
|
|
281
283
|
const originalToModelOutput = tool.toModelOutput;
|
|
282
|
-
result[
|
|
284
|
+
result[`connector_${this.connectorKey}_${t.name}`] = {
|
|
283
285
|
...tool,
|
|
284
286
|
toModelOutput: async (options) => {
|
|
285
287
|
if (!originalToModelOutput) {
|
|
@@ -335,19 +337,34 @@ async function runSetupFlow(flow, params, ctx, config) {
|
|
|
335
337
|
};
|
|
336
338
|
let state = flow.initialState();
|
|
337
339
|
let answerIdx = 0;
|
|
340
|
+
const pendingParameterUpdates = [];
|
|
338
341
|
for (const step of flow.steps) {
|
|
339
342
|
const ans = ctx.answers[answerIdx];
|
|
340
343
|
if (ans && ans.questionSlug === step.slug) {
|
|
341
344
|
state = step.applyAnswer(state, ans.answer);
|
|
345
|
+
if (step.toParameterUpdates) {
|
|
346
|
+
pendingParameterUpdates.push(...step.toParameterUpdates(state));
|
|
347
|
+
}
|
|
342
348
|
answerIdx += 1;
|
|
343
349
|
continue;
|
|
344
350
|
}
|
|
351
|
+
const resolvedAllowFreeText = step.allowFreeText !== void 0 ? step.allowFreeText : true;
|
|
345
352
|
if (step.type === "text") {
|
|
353
|
+
if (step.fetchOptions) {
|
|
354
|
+
const options2 = await step.fetchOptions(state, runtime);
|
|
355
|
+
if (options2.length === 0) {
|
|
356
|
+
continue;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
346
359
|
return {
|
|
347
360
|
type: "nextQuestion",
|
|
348
361
|
questionSlug: step.slug,
|
|
349
362
|
question: step.question[ctx.language],
|
|
350
|
-
questionType: "text"
|
|
363
|
+
questionType: "text",
|
|
364
|
+
allowFreeText: resolvedAllowFreeText,
|
|
365
|
+
...pendingParameterUpdates.length > 0 && {
|
|
366
|
+
parameterUpdates: pendingParameterUpdates
|
|
367
|
+
}
|
|
351
368
|
};
|
|
352
369
|
}
|
|
353
370
|
const options = step.fetchOptions ? await step.fetchOptions(state, runtime) : [];
|
|
@@ -359,11 +376,21 @@ async function runSetupFlow(flow, params, ctx, config) {
|
|
|
359
376
|
questionSlug: step.slug,
|
|
360
377
|
question: step.question[ctx.language],
|
|
361
378
|
questionType: step.type,
|
|
362
|
-
options
|
|
379
|
+
options,
|
|
380
|
+
allowFreeText: resolvedAllowFreeText,
|
|
381
|
+
...pendingParameterUpdates.length > 0 && {
|
|
382
|
+
parameterUpdates: pendingParameterUpdates
|
|
383
|
+
}
|
|
363
384
|
};
|
|
364
385
|
}
|
|
365
386
|
const dataInvestigationResult = await flow.finalize(state, runtime);
|
|
366
|
-
return {
|
|
387
|
+
return {
|
|
388
|
+
type: "fulfilled",
|
|
389
|
+
dataInvestigationResult,
|
|
390
|
+
...pendingParameterUpdates.length > 0 && {
|
|
391
|
+
parameterUpdates: pendingParameterUpdates
|
|
392
|
+
}
|
|
393
|
+
};
|
|
367
394
|
}
|
|
368
395
|
async function resolveSetupSelection(params) {
|
|
369
396
|
const { selected, allSentinel, fetchAll, limit } = params;
|
|
@@ -384,12 +411,12 @@ var AUTH_TYPES = {
|
|
|
384
411
|
// ../connectors/src/connectors/gamma/setup.ts
|
|
385
412
|
var gammaOnboarding = new ConnectorOnboarding({
|
|
386
413
|
dataOverviewInstructions: {
|
|
387
|
-
en: `1. Call
|
|
388
|
-
2. Call
|
|
389
|
-
3. Try generating a simple presentation with
|
|
390
|
-
ja: `1.
|
|
391
|
-
2.
|
|
392
|
-
3.
|
|
414
|
+
en: `1. Call connector_gamma_request with GET /themes to list available themes in the workspace
|
|
415
|
+
2. Call connector_gamma_request with GET /folders to list workspace folders
|
|
416
|
+
3. Try generating a simple presentation with connector_gamma_generate: inputText "Sample presentation about AI", textMode "generate", numCards 3`,
|
|
417
|
+
ja: `1. connector_gamma_request \u3067 GET /themes \u3092\u547C\u3073\u51FA\u3057\u3001\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u3067\u5229\u7528\u53EF\u80FD\u306A\u30C6\u30FC\u30DE\u4E00\u89A7\u3092\u53D6\u5F97
|
|
418
|
+
2. connector_gamma_request \u3067 GET /folders \u3092\u547C\u3073\u51FA\u3057\u3001\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u306E\u30D5\u30A9\u30EB\u30C0\u4E00\u89A7\u3092\u53D6\u5F97
|
|
419
|
+
3. connector_gamma_generate \u3067\u30B7\u30F3\u30D7\u30EB\u306A\u30D7\u30EC\u30BC\u30F3\u30C6\u30FC\u30B7\u30E7\u30F3\u3092\u8A66\u4F5C: inputText "AI\u306B\u3064\u3044\u3066\u306E\u30B5\u30F3\u30D7\u30EB\u30D7\u30EC\u30BC\u30F3\u30C6\u30FC\u30B7\u30E7\u30F3", textMode "generate", numCards 3`
|
|
393
420
|
}
|
|
394
421
|
});
|
|
395
422
|
|
|
@@ -410,7 +437,7 @@ function apiFetch(params, path2, init) {
|
|
|
410
437
|
// ../connectors/src/connectors/gamma/setup-flow.ts
|
|
411
438
|
var ALL_FOLDERS = "__ALL_FOLDERS__";
|
|
412
439
|
var GAMMA_SETUP_MAX_FOLDERS = 20;
|
|
413
|
-
var FOLDERS_PAGE_LIMIT =
|
|
440
|
+
var FOLDERS_PAGE_LIMIT = 50;
|
|
414
441
|
async function listAllFolders(params) {
|
|
415
442
|
const results = [];
|
|
416
443
|
let after;
|
|
@@ -431,7 +458,7 @@ async function listAllFolders(params) {
|
|
|
431
458
|
return results;
|
|
432
459
|
}
|
|
433
460
|
async function listThemes(params) {
|
|
434
|
-
const res = await apiFetch(params, "/themes?limit=
|
|
461
|
+
const res = await apiFetch(params, "/themes?limit=50");
|
|
435
462
|
if (!res.ok) {
|
|
436
463
|
return [];
|
|
437
464
|
}
|
|
@@ -537,7 +564,7 @@ var requestTool = new ConnectorTool({
|
|
|
537
564
|
description: `Send authenticated requests to the Gamma REST API.
|
|
538
565
|
Authentication is handled automatically using the API Key (X-API-KEY header).
|
|
539
566
|
Use this tool for listing themes, listing folders, checking generation status, and other read operations.
|
|
540
|
-
For creating presentations/documents, prefer the
|
|
567
|
+
For creating presentations/documents, prefer the connector_gamma_generate tool instead.`,
|
|
541
568
|
inputSchema,
|
|
542
569
|
outputSchema,
|
|
543
570
|
async execute({ connectionId, method, path: path2, body }, connections) {
|
|
@@ -602,7 +629,7 @@ var inputSchema2 = z2.object({
|
|
|
602
629
|
format: z2.enum(["presentation", "document", "webpage", "social"]).optional().describe("Type of artifact to create. Defaults to 'presentation'."),
|
|
603
630
|
numCards: z2.number().int().min(1).max(75).optional().describe("Number of cards/slides. Defaults to 10."),
|
|
604
631
|
themeId: z2.string().optional().describe(
|
|
605
|
-
"Theme ID for look and feel. Use
|
|
632
|
+
"Theme ID for look and feel. Use connector_gamma_request GET /themes to list available themes."
|
|
606
633
|
),
|
|
607
634
|
tone: z2.string().optional().describe(
|
|
608
635
|
"Tone/voice of the output (e.g., 'professional', 'casual', 'academic'). Max 500 chars."
|
|
@@ -650,7 +677,7 @@ var generateTool = new ConnectorTool({
|
|
|
650
677
|
name: "generate",
|
|
651
678
|
description: `Generate a presentation, document, webpage, or social post using Gamma AI.
|
|
652
679
|
This tool creates the generation, then automatically polls until completion and returns the result URL.
|
|
653
|
-
Use
|
|
680
|
+
Use connector_gamma_request GET /themes first if you want to pick a specific theme.
|
|
654
681
|
Gamma does NOT support image uploads. To visualize data, embed raw numbers directly into inputText as structured text (markdown tables, bullet lists with figures) \u2014 Gamma AI will render charts and visuals from the data.`,
|
|
655
682
|
inputSchema: inputSchema2,
|
|
656
683
|
outputSchema: outputSchema2,
|
|
@@ -774,8 +801,8 @@ var gammaConnector = new ConnectorPlugin({
|
|
|
774
801
|
systemPrompt: {
|
|
775
802
|
en: `### Tools
|
|
776
803
|
|
|
777
|
-
- \`
|
|
778
|
-
- \`
|
|
804
|
+
- \`connector_gamma_request\`: Send authenticated requests to the Gamma REST API. Use for listing themes, folders, and checking generation status. Authentication (X-API-KEY) is configured automatically.
|
|
805
|
+
- \`connector_gamma_generate\`: Generate a presentation, document, webpage, or social post using Gamma AI. This tool handles the full workflow: creates the generation, polls for completion, and returns the result URL. Prefer this over manually calling POST /generations + polling.
|
|
779
806
|
|
|
780
807
|
### Business Logic
|
|
781
808
|
|
|
@@ -848,8 +875,8 @@ export default async function handler(c: Context) {
|
|
|
848
875
|
Gamma does NOT support uploading images. If you want to visualize data (charts, graphs, tables), embed the raw numbers and data directly into \`inputText\` as structured text (e.g., markdown tables, bullet lists with figures). Gamma AI will render appropriate visual elements from the data. Do NOT generate chart images locally and try to include them \u2014 instead, pass the data values inline so Gamma can create its own visualizations.`,
|
|
849
876
|
ja: `### \u30C4\u30FC\u30EB
|
|
850
877
|
|
|
851
|
-
- \`
|
|
852
|
-
- \`
|
|
878
|
+
- \`connector_gamma_request\`: Gamma REST API\u306B\u8A8D\u8A3C\u6E08\u307F\u30EA\u30AF\u30A8\u30B9\u30C8\u3092\u9001\u4FE1\u3057\u307E\u3059\u3002\u30C6\u30FC\u30DE\u4E00\u89A7\u3001\u30D5\u30A9\u30EB\u30C0\u4E00\u89A7\u3001\u751F\u6210\u30B9\u30C6\u30FC\u30BF\u30B9\u306E\u78BA\u8A8D\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002\u8A8D\u8A3C\uFF08X-API-KEY\uFF09\u306F\u81EA\u52D5\u7684\u306B\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002
|
|
879
|
+
- \`connector_gamma_generate\`: Gamma AI\u3092\u4F7F\u3063\u3066\u30D7\u30EC\u30BC\u30F3\u30C6\u30FC\u30B7\u30E7\u30F3\u3001\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3001\u30A6\u30A7\u30D6\u30DA\u30FC\u30B8\u3001\u30BD\u30FC\u30B7\u30E3\u30EB\u6295\u7A3F\u3092\u751F\u6210\u3057\u307E\u3059\u3002\u751F\u6210\u306E\u4F5C\u6210\u304B\u3089\u30DD\u30FC\u30EA\u30F3\u30B0\u3001\u7D50\u679CURL\u306E\u8FD4\u5374\u307E\u3067\u4E00\u62EC\u3067\u51E6\u7406\u3057\u307E\u3059\u3002\u624B\u52D5\u3067POST /generations + \u30DD\u30FC\u30EA\u30F3\u30B0\u3059\u308B\u3088\u308A\u3082\u3053\u3061\u3089\u3092\u63A8\u5968\u3057\u307E\u3059\u3002
|
|
853
880
|
|
|
854
881
|
### Business Logic
|
|
855
882
|
|