@squadbase/vite-server 0.1.17-dev.3b633bb → 0.1.17-dev.423ee34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/dist/cli/index.js +3307 -739
  2. package/dist/connectors/airtable-oauth.js +50 -8
  3. package/dist/connectors/airtable.js +46 -8
  4. package/dist/connectors/amplitude.js +10 -8
  5. package/dist/connectors/anthropic.js +4 -2
  6. package/dist/connectors/asana.js +39 -10
  7. package/dist/connectors/attio.js +32 -13
  8. package/dist/connectors/aws-billing.js +10 -8
  9. package/dist/connectors/azure-sql.js +33 -7
  10. package/dist/connectors/backlog-api-key.js +42 -15
  11. package/dist/connectors/clickup.js +52 -10
  12. package/dist/connectors/cosmosdb.js +14 -12
  13. package/dist/connectors/customerio.js +10 -8
  14. package/dist/connectors/dbt.js +688 -25
  15. package/dist/connectors/freshdesk.js +84 -8
  16. package/dist/connectors/freshsales.js +10 -8
  17. package/dist/connectors/freshservice.js +10 -8
  18. package/dist/connectors/gamma.js +17 -15
  19. package/dist/connectors/gemini.js +4 -2
  20. package/dist/connectors/github.js +14 -12
  21. package/dist/connectors/gmail-oauth.js +10 -10
  22. package/dist/connectors/gmail.js +6 -4
  23. package/dist/connectors/google-ads.js +10 -8
  24. package/dist/connectors/google-analytics-oauth.js +154 -25
  25. package/dist/connectors/google-analytics.js +536 -109
  26. package/dist/connectors/google-audit-log.js +6 -4
  27. package/dist/connectors/google-calendar-oauth.js +63 -15
  28. package/dist/connectors/google-calendar.js +63 -11
  29. package/dist/connectors/google-docs.js +10 -10
  30. package/dist/connectors/google-drive.js +32 -10
  31. package/dist/connectors/google-search-console-oauth.js +128 -17
  32. package/dist/connectors/google-sheets.js +8 -6
  33. package/dist/connectors/google-slides.js +10 -10
  34. package/dist/connectors/grafana.js +47 -10
  35. package/dist/connectors/hubspot-oauth.js +41 -9
  36. package/dist/connectors/hubspot.js +27 -9
  37. package/dist/connectors/influxdb.js +10 -8
  38. package/dist/connectors/intercom-oauth.js +72 -12
  39. package/dist/connectors/intercom.js +14 -12
  40. package/dist/connectors/jdbc.js +8 -6
  41. package/dist/connectors/jira-api-key.js +70 -11
  42. package/dist/connectors/kintone-api-token.js +68 -18
  43. package/dist/connectors/kintone.js +56 -11
  44. package/dist/connectors/linear.js +56 -12
  45. package/dist/connectors/linkedin-ads.js +43 -14
  46. package/dist/connectors/mailchimp-oauth.js +8 -6
  47. package/dist/connectors/mailchimp.js +8 -6
  48. package/dist/connectors/meta-ads-oauth.js +35 -14
  49. package/dist/connectors/meta-ads.js +37 -14
  50. package/dist/connectors/mixpanel.js +10 -8
  51. package/dist/connectors/monday.js +11 -9
  52. package/dist/connectors/mongodb.js +10 -8
  53. package/dist/connectors/notion-oauth.js +60 -11
  54. package/dist/connectors/notion.js +62 -11
  55. package/dist/connectors/openai.js +4 -2
  56. package/dist/connectors/oracle.js +25 -7
  57. package/dist/connectors/outlook-oauth.js +20 -20
  58. package/dist/connectors/powerbi-oauth.js +12 -12
  59. package/dist/connectors/salesforce.js +44 -9
  60. package/dist/connectors/semrush.js +8 -6
  61. package/dist/connectors/sentry.js +38 -10
  62. package/dist/connectors/shopify-oauth.js +43 -10
  63. package/dist/connectors/shopify.js +10 -8
  64. package/dist/connectors/sqlserver.js +33 -7
  65. package/dist/connectors/stripe-api-key.js +68 -15
  66. package/dist/connectors/stripe-oauth.js +70 -19
  67. package/dist/connectors/supabase.js +24 -5
  68. package/dist/connectors/tableau.js +16 -14
  69. package/dist/connectors/tiktok-ads.js +39 -16
  70. package/dist/connectors/wix-store.js +10 -8
  71. package/dist/connectors/zendesk-oauth.js +55 -12
  72. package/dist/connectors/zendesk.js +14 -12
  73. package/dist/index.d.ts +1 -0
  74. package/dist/index.js +3336 -743
  75. package/dist/main.js +3325 -737
  76. package/dist/vite-plugin.js +3305 -737
  77. 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.
@@ -185,7 +187,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
185
187
  /**
186
188
  * Create tools for connections that belong to this connector.
187
189
  * Filters connections by connectorKey internally.
188
- * Returns tools keyed as `${connectorKey}_${toolName}`.
190
+ * Returns tools keyed as `connector_${connectorKey}_${toolName}`.
189
191
  */
190
192
  createTools(connections, config, opts) {
191
193
  const myConnections = connections.filter(
@@ -195,7 +197,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
195
197
  for (const t of Object.values(this.tools)) {
196
198
  const tool = t.createTool(myConnections, config);
197
199
  const originalToModelOutput = tool.toModelOutput;
198
- result[`${this.connectorKey}_${t.name}`] = {
200
+ result[`connector_${this.connectorKey}_${t.name}`] = {
199
201
  ...tool,
200
202
  toModelOutput: async (options) => {
201
203
  if (!originalToModelOutput) {
@@ -476,10 +478,10 @@ var airtableOauthOnboarding = new ConnectorOnboarding({
476
478
  - Write only 1 sentence between tool calls, then immediately call the next tool. Skip unnecessary explanations and proceed efficiently`
477
479
  },
478
480
  dataOverviewInstructions: {
479
- en: `1. Call airtable-oauth_request with GET /meta/bases/{baseId}/tables to list tables and their fields
480
- 2. Call airtable-oauth_request with GET /{baseId}/{tableIdOrName}?maxRecords=5 to sample records from key tables`,
481
- ja: `1. airtable-oauth_request \u3067 GET /meta/bases/{baseId}/tables \u3092\u547C\u3073\u51FA\u3057\u3001\u30C6\u30FC\u30D6\u30EB\u3068\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u4E00\u89A7\u3092\u53D6\u5F97
482
- 2. airtable-oauth_request \u3067 GET /{baseId}/{tableIdOrName}?maxRecords=5 \u3092\u547C\u3073\u51FA\u3057\u3001\u4E3B\u8981\u30C6\u30FC\u30D6\u30EB\u306E\u30EC\u30B3\u30FC\u30C9\u3092\u30B5\u30F3\u30D7\u30EA\u30F3\u30B0`
481
+ en: `1. Call connector_airtable-oauth_request with GET /meta/bases/{baseId}/tables to list tables and their fields
482
+ 2. Call connector_airtable-oauth_request with GET /{baseId}/{tableIdOrName}?maxRecords=5 to sample records from key tables`,
483
+ ja: `1. connector_airtable-oauth_request \u3067 GET /meta/bases/{baseId}/tables \u3092\u547C\u3073\u51FA\u3057\u3001\u30C6\u30FC\u30D6\u30EB\u3068\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u4E00\u89A7\u3092\u53D6\u5F97
484
+ 2. connector_airtable-oauth_request \u3067 GET /{baseId}/{tableIdOrName}?maxRecords=5 \u3092\u547C\u3073\u51FA\u3057\u3001\u4E3B\u8981\u30C6\u30FC\u30D6\u30EB\u306E\u30EC\u30B3\u30FC\u30C9\u3092\u30B5\u30F3\u30D7\u30EA\u30F3\u30B0`
483
485
  }
484
486
  });
485
487
 
@@ -515,6 +517,26 @@ async function listTables(proxyFetch, baseId) {
515
517
  const data = await res.json();
516
518
  return data.tables ?? [];
517
519
  }
520
+ async function listSampleRecords(proxyFetch, baseId, tableId) {
521
+ try {
522
+ const res = await apiFetch(
523
+ proxyFetch,
524
+ `/${baseId}/${encodeURIComponent(tableId)}?maxRecords=3`
525
+ );
526
+ if (!res.ok) return [];
527
+ const data = await res.json();
528
+ return data.records ?? [];
529
+ } catch {
530
+ return [];
531
+ }
532
+ }
533
+ function formatCell(val) {
534
+ if (val == null) return "";
535
+ if (typeof val === "string") return val.length > 40 ? `${val.slice(0, 40)}\u2026` : val;
536
+ if (Array.isArray(val)) return `[${val.length} items]`;
537
+ if (typeof val === "object") return JSON.stringify(val).slice(0, 40);
538
+ return String(val);
539
+ }
518
540
  var airtableOauthSetupFlow = {
519
541
  initialState: () => ({}),
520
542
  steps: [
@@ -586,6 +608,26 @@ var airtableOauthSetupFlow = {
586
608
  sections.push(`| ${f.name} | ${f.type} | ${description || "-"} |`);
587
609
  }
588
610
  sections.push("");
611
+ const records = await listSampleRecords(
612
+ rt.config.proxyFetch,
613
+ baseId,
614
+ table.id
615
+ );
616
+ if (records.length > 0) {
617
+ const sampleFields = (table.fields ?? []).slice(0, 5).map((f) => f.name);
618
+ if (sampleFields.length > 0) {
619
+ sections.push(`##### Sample records (${records.length})`, "");
620
+ sections.push(`| ${sampleFields.join(" | ")} |`);
621
+ sections.push(`| ${sampleFields.map(() => "---").join(" | ")} |`);
622
+ for (const record of records) {
623
+ const cells = sampleFields.map(
624
+ (name) => formatCell(record.fields?.[name]).replace(/\|/g, "\\|")
625
+ );
626
+ sections.push(`| ${cells.join(" | ")} |`);
627
+ }
628
+ sections.push("");
629
+ }
630
+ }
589
631
  }
590
632
  return sections.join("\n");
591
633
  }
@@ -615,7 +657,7 @@ var airtableOauthConnector = new ConnectorPlugin({
615
657
  systemPrompt: {
616
658
  en: `### Tools
617
659
 
618
- - \`airtable-oauth_request\`: The only way to call the Airtable REST API. Use it to list tables, query/create/update/delete records. Authentication is configured automatically via OAuth. The {baseId} placeholder in paths is automatically replaced with the configured default base ID.
660
+ - \`connector_airtable-oauth_request\`: The only way to call the Airtable REST API. Use it to list tables, query/create/update/delete records. Authentication is configured automatically via OAuth. The {baseId} placeholder in paths is automatically replaced with the configured default base ID.
619
661
 
620
662
  ### Airtable API Reference
621
663
 
@@ -663,7 +705,7 @@ const recordsData = await records.json();
663
705
  \`\`\``,
664
706
  ja: `### \u30C4\u30FC\u30EB
665
707
 
666
- - \`airtable-oauth_request\`: Airtable REST API\u3092\u547C\u3073\u51FA\u3059\u552F\u4E00\u306E\u624B\u6BB5\u3067\u3059\u3002\u30C6\u30FC\u30D6\u30EB\u4E00\u89A7\u306E\u53D6\u5F97\u3001\u30EC\u30B3\u30FC\u30C9\u306E\u691C\u7D22\u30FB\u4F5C\u6210\u30FB\u66F4\u65B0\u30FB\u524A\u9664\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002OAuth\u7D4C\u7531\u3067\u8A8D\u8A3C\u306F\u81EA\u52D5\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002\u30D1\u30B9\u5185\u306E{baseId}\u30D7\u30EC\u30FC\u30B9\u30DB\u30EB\u30C0\u30FC\u306F\u8A2D\u5B9A\u6E08\u307F\u306E\u30C7\u30D5\u30A9\u30EB\u30C8\u30D9\u30FC\u30B9ID\u3067\u81EA\u52D5\u7684\u306B\u7F6E\u63DB\u3055\u308C\u307E\u3059\u3002
708
+ - \`connector_airtable-oauth_request\`: Airtable REST API\u3092\u547C\u3073\u51FA\u3059\u552F\u4E00\u306E\u624B\u6BB5\u3067\u3059\u3002\u30C6\u30FC\u30D6\u30EB\u4E00\u89A7\u306E\u53D6\u5F97\u3001\u30EC\u30B3\u30FC\u30C9\u306E\u691C\u7D22\u30FB\u4F5C\u6210\u30FB\u66F4\u65B0\u30FB\u524A\u9664\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002OAuth\u7D4C\u7531\u3067\u8A8D\u8A3C\u306F\u81EA\u52D5\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002\u30D1\u30B9\u5185\u306E{baseId}\u30D7\u30EC\u30FC\u30B9\u30DB\u30EB\u30C0\u30FC\u306F\u8A2D\u5B9A\u6E08\u307F\u306E\u30C7\u30D5\u30A9\u30EB\u30C8\u30D9\u30FC\u30B9ID\u3067\u81EA\u52D5\u7684\u306B\u7F6E\u63DB\u3055\u308C\u307E\u3059\u3002
667
709
 
668
710
  ### Airtable API \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9
669
711
 
@@ -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.
@@ -315,7 +317,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
315
317
  /**
316
318
  * Create tools for connections that belong to this connector.
317
319
  * Filters connections by connectorKey internally.
318
- * Returns tools keyed as `${connectorKey}_${toolName}`.
320
+ * Returns tools keyed as `connector_${connectorKey}_${toolName}`.
319
321
  */
320
322
  createTools(connections, config, opts) {
321
323
  const myConnections = connections.filter(
@@ -325,7 +327,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
325
327
  for (const t of Object.values(this.tools)) {
326
328
  const tool = t.createTool(myConnections, config);
327
329
  const originalToModelOutput = tool.toModelOutput;
328
- result[`${this.connectorKey}_${t.name}`] = {
330
+ result[`connector_${this.connectorKey}_${t.name}`] = {
329
331
  ...tool,
330
332
  toModelOutput: async (options) => {
331
333
  if (!originalToModelOutput) {
@@ -455,10 +457,10 @@ var AUTH_TYPES = {
455
457
  // ../connectors/src/connectors/airtable/setup.ts
456
458
  var airtableOnboarding = new ConnectorOnboarding({
457
459
  dataOverviewInstructions: {
458
- en: `1. Call airtable_request with GET meta/bases/{baseId}/tables to list tables and their fields
459
- 2. Call airtable_request with GET {baseId}/{tableIdOrName}?maxRecords=5 to sample records from key tables`,
460
- ja: `1. airtable_request \u3067 GET meta/bases/{baseId}/tables \u3092\u547C\u3073\u51FA\u3057\u3001\u30C6\u30FC\u30D6\u30EB\u3068\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u4E00\u89A7\u3092\u53D6\u5F97
461
- 2. airtable_request \u3067 GET {baseId}/{tableIdOrName}?maxRecords=5 \u3092\u547C\u3073\u51FA\u3057\u3001\u4E3B\u8981\u30C6\u30FC\u30D6\u30EB\u306E\u30EC\u30B3\u30FC\u30C9\u3092\u30B5\u30F3\u30D7\u30EA\u30F3\u30B0`
460
+ en: `1. Call connector_airtable_request with GET meta/bases/{baseId}/tables to list tables and their fields
461
+ 2. Call connector_airtable_request with GET {baseId}/{tableIdOrName}?maxRecords=5 to sample records from key tables`,
462
+ ja: `1. connector_airtable_request \u3067 GET meta/bases/{baseId}/tables \u3092\u547C\u3073\u51FA\u3057\u3001\u30C6\u30FC\u30D6\u30EB\u3068\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u4E00\u89A7\u3092\u53D6\u5F97
463
+ 2. connector_airtable_request \u3067 GET {baseId}/{tableIdOrName}?maxRecords=5 \u3092\u547C\u3073\u51FA\u3057\u3001\u4E3B\u8981\u30C6\u30FC\u30D6\u30EB\u306E\u30EC\u30B3\u30FC\u30C9\u3092\u30B5\u30F3\u30D7\u30EA\u30F3\u30B0`
462
464
  }
463
465
  });
464
466
 
@@ -496,6 +498,26 @@ async function listTables(params, baseId) {
496
498
  const data = await res.json();
497
499
  return data.tables ?? [];
498
500
  }
501
+ async function listSampleRecords(params, baseId, tableId) {
502
+ try {
503
+ const res = await apiFetch(
504
+ params,
505
+ `/${baseId}/${encodeURIComponent(tableId)}?maxRecords=3`
506
+ );
507
+ if (!res.ok) return [];
508
+ const data = await res.json();
509
+ return data.records ?? [];
510
+ } catch {
511
+ return [];
512
+ }
513
+ }
514
+ function formatCell(val) {
515
+ if (val == null) return "";
516
+ if (typeof val === "string") return val.length > 40 ? `${val.slice(0, 40)}\u2026` : val;
517
+ if (Array.isArray(val)) return `[${val.length} items]`;
518
+ if (typeof val === "object") return JSON.stringify(val).slice(0, 40);
519
+ return String(val);
520
+ }
499
521
  var airtableSetupFlow = {
500
522
  initialState: () => ({}),
501
523
  steps: [
@@ -567,6 +589,22 @@ var airtableSetupFlow = {
567
589
  sections.push(`| ${f.name} | ${f.type} | ${description || "-"} |`);
568
590
  }
569
591
  sections.push("");
592
+ const records = await listSampleRecords(rt.params, baseId, table.id);
593
+ if (records.length > 0) {
594
+ const sampleFields = (table.fields ?? []).slice(0, 5).map((f) => f.name);
595
+ if (sampleFields.length > 0) {
596
+ sections.push(`##### Sample records (${records.length})`, "");
597
+ sections.push(`| ${sampleFields.join(" | ")} |`);
598
+ sections.push(`| ${sampleFields.map(() => "---").join(" | ")} |`);
599
+ for (const record of records) {
600
+ const cells = sampleFields.map(
601
+ (name) => formatCell(record.fields?.[name]).replace(/\|/g, "\\|")
602
+ );
603
+ sections.push(`| ${cells.join(" | ")} |`);
604
+ }
605
+ sections.push("");
606
+ }
607
+ }
570
608
  }
571
609
  return sections.join("\n");
572
610
  }
@@ -658,7 +696,7 @@ var airtableConnector = new ConnectorPlugin({
658
696
  systemPrompt: {
659
697
  en: `### Tools
660
698
 
661
- - \`airtable_request\`: The only way to call the Airtable REST API. Use it to list tables, read records, and create/update records. The \`{baseId}\` placeholder in the path is automatically replaced. See the Airtable API Reference below for available endpoints and query parameters.
699
+ - \`connector_airtable_request\`: The only way to call the Airtable REST API. Use it to list tables, read records, and create/update records. The \`{baseId}\` placeholder in the path is automatically replaced. See the Airtable API Reference below for available endpoints and query parameters.
662
700
 
663
701
  ### Business Logic
664
702
 
@@ -717,7 +755,7 @@ export default async function handler(c: Context) {
717
755
  - If the response contains an \`offset\`, fetch the next page by appending \`?offset={offset}\` to the next request`,
718
756
  ja: `### \u30C4\u30FC\u30EB
719
757
 
720
- - \`airtable_request\`: Airtable REST API\u3092\u547C\u3073\u51FA\u3059\u552F\u4E00\u306E\u624B\u6BB5\u3067\u3059\u3002\u30C6\u30FC\u30D6\u30EB\u4E00\u89A7\u306E\u53D6\u5F97\u3001\u30EC\u30B3\u30FC\u30C9\u306E\u8AAD\u307F\u53D6\u308A\u3001\u30EC\u30B3\u30FC\u30C9\u306E\u4F5C\u6210\u30FB\u66F4\u65B0\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002\u30D1\u30B9\u5185\u306E \`{baseId}\` \u30D7\u30EC\u30FC\u30B9\u30DB\u30EB\u30C0\u306F\u81EA\u52D5\u7684\u306B\u7F6E\u63DB\u3055\u308C\u307E\u3059\u3002\u5229\u7528\u53EF\u80FD\u306A\u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8\u3068\u30AF\u30A8\u30EA\u30D1\u30E9\u30E1\u30FC\u30BF\u306F\u4E0B\u90E8\u306E\u300CAirtable API \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9\u300D\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002
758
+ - \`connector_airtable_request\`: Airtable REST API\u3092\u547C\u3073\u51FA\u3059\u552F\u4E00\u306E\u624B\u6BB5\u3067\u3059\u3002\u30C6\u30FC\u30D6\u30EB\u4E00\u89A7\u306E\u53D6\u5F97\u3001\u30EC\u30B3\u30FC\u30C9\u306E\u8AAD\u307F\u53D6\u308A\u3001\u30EC\u30B3\u30FC\u30C9\u306E\u4F5C\u6210\u30FB\u66F4\u65B0\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002\u30D1\u30B9\u5185\u306E \`{baseId}\` \u30D7\u30EC\u30FC\u30B9\u30DB\u30EB\u30C0\u306F\u81EA\u52D5\u7684\u306B\u7F6E\u63DB\u3055\u308C\u307E\u3059\u3002\u5229\u7528\u53EF\u80FD\u306A\u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8\u3068\u30AF\u30A8\u30EA\u30D1\u30E9\u30E1\u30FC\u30BF\u306F\u4E0B\u90E8\u306E\u300CAirtable API \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9\u300D\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002
721
759
 
722
760
  ### Business Logic
723
761
 
@@ -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.
@@ -275,7 +277,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
275
277
  /**
276
278
  * Create tools for connections that belong to this connector.
277
279
  * Filters connections by connectorKey internally.
278
- * Returns tools keyed as `${connectorKey}_${toolName}`.
280
+ * Returns tools keyed as `connector_${connectorKey}_${toolName}`.
279
281
  */
280
282
  createTools(connections, config, opts) {
281
283
  const myConnections = connections.filter(
@@ -285,7 +287,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
285
287
  for (const t of Object.values(this.tools)) {
286
288
  const tool = t.createTool(myConnections, config);
287
289
  const originalToModelOutput = tool.toModelOutput;
288
- result[`${this.connectorKey}_${t.name}`] = {
290
+ result[`connector_${this.connectorKey}_${t.name}`] = {
289
291
  ...tool,
290
292
  toModelOutput: async (options) => {
291
293
  if (!originalToModelOutput) {
@@ -411,13 +413,13 @@ var AUTH_TYPES = {
411
413
  var amplitudeOnboarding = new ConnectorOnboarding({
412
414
  dataOverviewInstructions: {
413
415
  en: `1. Check the connection's region parameter: use https://analytics.eu.amplitude.com for EU, https://amplitude.com for US (default)
414
- 2. Call amplitude_request with GET {baseUrl}/api/2/events/list to list available event types
415
- 3. Call amplitude_request with GET {baseUrl}/api/2/export?start=YYYYMMDDTHH&end=YYYYMMDDTHH to export raw event data for a time range
416
+ 2. Call connector_amplitude_request with GET {baseUrl}/api/2/events/list to list available event types
417
+ 3. Call connector_amplitude_request with GET {baseUrl}/api/2/export?start=YYYYMMDDTHH&end=YYYYMMDDTHH to export raw event data for a time range
416
418
  4. Use GET {baseUrl}/api/2/usersearch?user=QUERY and GET {baseUrl}/api/2/useractivity?user=AMPLITUDE_ID to explore user-level data
417
419
  NOTE: The Dashboard REST API endpoints (events/segmentation, funnels, retention, etc.) require a paid Growth or Enterprise plan. If you get a 403 Forbidden error, fall back to the Export API (/api/2/export) to retrieve raw events and perform aggregation in code instead.`,
418
420
  ja: `1. \u63A5\u7D9A\u306Eregion\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u78BA\u8A8D\uFF1AEU\u306E\u5834\u5408\u306F https://analytics.eu.amplitude.com\u3001US\uFF08\u30C7\u30D5\u30A9\u30EB\u30C8\uFF09\u306E\u5834\u5408\u306F https://amplitude.com \u3092\u4F7F\u7528
419
- 2. amplitude_request \u3067 GET {baseUrl}/api/2/events/list \u3092\u547C\u3073\u51FA\u3057\u3001\u5229\u7528\u53EF\u80FD\u306A\u30A4\u30D9\u30F3\u30C8\u30BF\u30A4\u30D7\u4E00\u89A7\u3092\u53D6\u5F97
420
- 3. amplitude_request \u3067 GET {baseUrl}/api/2/export?start=YYYYMMDDTHH&end=YYYYMMDDTHH \u3092\u547C\u3073\u51FA\u3057\u3001\u6307\u5B9A\u671F\u9593\u306E\u751F\u30A4\u30D9\u30F3\u30C8\u30C7\u30FC\u30BF\u3092\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8
421
+ 2. connector_amplitude_request \u3067 GET {baseUrl}/api/2/events/list \u3092\u547C\u3073\u51FA\u3057\u3001\u5229\u7528\u53EF\u80FD\u306A\u30A4\u30D9\u30F3\u30C8\u30BF\u30A4\u30D7\u4E00\u89A7\u3092\u53D6\u5F97
422
+ 3. connector_amplitude_request \u3067 GET {baseUrl}/api/2/export?start=YYYYMMDDTHH&end=YYYYMMDDTHH \u3092\u547C\u3073\u51FA\u3057\u3001\u6307\u5B9A\u671F\u9593\u306E\u751F\u30A4\u30D9\u30F3\u30C8\u30C7\u30FC\u30BF\u3092\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8
421
423
  4. GET {baseUrl}/api/2/usersearch?user=QUERY \u3084 GET {baseUrl}/api/2/useractivity?user=AMPLITUDE_ID \u3067\u30E6\u30FC\u30B6\u30FC\u30EC\u30D9\u30EB\u306E\u30C7\u30FC\u30BF\u3092\u63A2\u7D22
422
424
  \u6CE8\u610F: Dashboard REST API\uFF08events/segmentation\u3001funnels\u3001retention\u7B49\uFF09\u306F\u6709\u6599\u306EGrowth\u307E\u305F\u306FEnterprise\u30D7\u30E9\u30F3\u304C\u5FC5\u8981\u3067\u3059\u3002403 Forbidden\u30A8\u30E9\u30FC\u304C\u8FD4\u3055\u308C\u305F\u5834\u5408\u306F\u3001Export API\uFF08/api/2/export\uFF09\u3067\u751F\u30A4\u30D9\u30F3\u30C8\u3092\u53D6\u5F97\u3057\u3001\u30B3\u30FC\u30C9\u4E0A\u3067\u96C6\u8A08\u3092\u884C\u3063\u3066\u304F\u3060\u3055\u3044\u3002`
423
425
  }
@@ -643,7 +645,7 @@ var amplitudeConnector = new ConnectorPlugin({
643
645
  systemPrompt: {
644
646
  en: `### Tools
645
647
 
646
- - \`amplitude_request\`: The only way to call the Amplitude REST API. Use it for event segmentation, listing event types, user search, user activity, and data export. Authentication (Basic auth with API Key + Secret Key) is configured automatically. Provide the full URL including query parameters \u2014 the base URL varies by endpoint.
648
+ - \`connector_amplitude_request\`: The only way to call the Amplitude REST API. Use it for event segmentation, listing event types, user search, user activity, and data export. Authentication (Basic auth with API Key + Secret Key) is configured automatically. Provide the full URL including query parameters \u2014 the base URL varies by endpoint.
647
649
 
648
650
  ### Business Logic
649
651
 
@@ -707,7 +709,7 @@ IMPORTANT: Always start with the endpoints available on all plans. If you need a
707
709
  - \`g\` \u2014 Group by property`,
708
710
  ja: `### \u30C4\u30FC\u30EB
709
711
 
710
- - \`amplitude_request\`: Amplitude REST API\u3092\u547C\u3073\u51FA\u3059\u552F\u4E00\u306E\u624B\u6BB5\u3067\u3059\u3002\u30A4\u30D9\u30F3\u30C8\u30BB\u30B0\u30E1\u30F3\u30C6\u30FC\u30B7\u30E7\u30F3\u3001\u30A4\u30D9\u30F3\u30C8\u30BF\u30A4\u30D7\u4E00\u89A7\u3001\u30E6\u30FC\u30B6\u30FC\u691C\u7D22\u3001\u30E6\u30FC\u30B6\u30FC\u30A2\u30AF\u30C6\u30A3\u30D3\u30C6\u30A3\u3001\u30C7\u30FC\u30BF\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002\u8A8D\u8A3C\uFF08API Key + Secret Key\u306B\u3088\u308BBasic\u8A8D\u8A3C\uFF09\u306F\u81EA\u52D5\u7684\u306B\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002\u30AF\u30A8\u30EA\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u542B\u3080\u5B8C\u5168\u306AURL\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044 \u2014 \u30D9\u30FC\u30B9URL\u306F\u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8\u306B\u3088\u3063\u3066\u7570\u306A\u308A\u307E\u3059\u3002
712
+ - \`connector_amplitude_request\`: Amplitude REST API\u3092\u547C\u3073\u51FA\u3059\u552F\u4E00\u306E\u624B\u6BB5\u3067\u3059\u3002\u30A4\u30D9\u30F3\u30C8\u30BB\u30B0\u30E1\u30F3\u30C6\u30FC\u30B7\u30E7\u30F3\u3001\u30A4\u30D9\u30F3\u30C8\u30BF\u30A4\u30D7\u4E00\u89A7\u3001\u30E6\u30FC\u30B6\u30FC\u691C\u7D22\u3001\u30E6\u30FC\u30B6\u30FC\u30A2\u30AF\u30C6\u30A3\u30D3\u30C6\u30A3\u3001\u30C7\u30FC\u30BF\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002\u8A8D\u8A3C\uFF08API Key + Secret Key\u306B\u3088\u308BBasic\u8A8D\u8A3C\uFF09\u306F\u81EA\u52D5\u7684\u306B\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002\u30AF\u30A8\u30EA\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u542B\u3080\u5B8C\u5168\u306AURL\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044 \u2014 \u30D9\u30FC\u30B9URL\u306F\u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8\u306B\u3088\u3063\u3066\u7570\u306A\u308A\u307E\u3059\u3002
711
713
 
712
714
  ### Business Logic
713
715
 
@@ -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.
@@ -142,7 +144,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
142
144
  /**
143
145
  * Create tools for connections that belong to this connector.
144
146
  * Filters connections by connectorKey internally.
145
- * Returns tools keyed as `${connectorKey}_${toolName}`.
147
+ * Returns tools keyed as `connector_${connectorKey}_${toolName}`.
146
148
  */
147
149
  createTools(connections, config, opts) {
148
150
  const myConnections = connections.filter(
@@ -152,7 +154,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
152
154
  for (const t of Object.values(this.tools)) {
153
155
  const tool = t.createTool(myConnections, config);
154
156
  const originalToModelOutput = tool.toModelOutput;
155
- result[`${this.connectorKey}_${t.name}`] = {
157
+ result[`connector_${this.connectorKey}_${t.name}`] = {
156
158
  ...tool,
157
159
  toModelOutput: async (options) => {
158
160
  if (!originalToModelOutput) {
@@ -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.
@@ -312,7 +314,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
312
314
  /**
313
315
  * Create tools for connections that belong to this connector.
314
316
  * Filters connections by connectorKey internally.
315
- * Returns tools keyed as `${connectorKey}_${toolName}`.
317
+ * Returns tools keyed as `connector_${connectorKey}_${toolName}`.
316
318
  */
317
319
  createTools(connections, config, opts) {
318
320
  const myConnections = connections.filter(
@@ -322,7 +324,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
322
324
  for (const t of Object.values(this.tools)) {
323
325
  const tool = t.createTool(myConnections, config);
324
326
  const originalToModelOutput = tool.toModelOutput;
325
- result[`${this.connectorKey}_${t.name}`] = {
327
+ result[`connector_${this.connectorKey}_${t.name}`] = {
326
328
  ...tool,
327
329
  toModelOutput: async (options) => {
328
330
  if (!originalToModelOutput) {
@@ -462,13 +464,13 @@ function normalizeRequestPath(path2, basePathSegment) {
462
464
  // ../connectors/src/connectors/asana/setup.ts
463
465
  var asanaOnboarding = new ConnectorOnboarding({
464
466
  dataOverviewInstructions: {
465
- en: `1. Call asana_request with GET /workspaces to list all available workspaces
466
- 2. Pick the first workspace and call asana_request with GET /projects?workspace=WORKSPACE_GID&opt_fields=name,archived,created_at to list projects
467
- 3. Pick one project and call asana_request with GET /tasks?project=PROJECT_GID&opt_fields=name,completed,assignee.name,due_on,created_at&limit=10 to sample tasks
467
+ en: `1. Call connector_asana_request with GET /workspaces to list all available workspaces
468
+ 2. Pick the first workspace and call connector_asana_request with GET /projects?workspace=WORKSPACE_GID&opt_fields=name,archived,created_at to list projects
469
+ 3. Pick one project and call connector_asana_request with GET /tasks?project=PROJECT_GID&opt_fields=name,completed,assignee.name,due_on,created_at&limit=10 to sample tasks
468
470
  4. Explore sections via GET /sections?project=PROJECT_GID if the project uses board or section-based workflows`,
469
- ja: `1. asana_request \u3067 GET /workspaces \u3092\u547C\u3073\u51FA\u3057\u3001\u5229\u7528\u53EF\u80FD\u306A\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u4E00\u89A7\u3092\u53D6\u5F97
470
- 2. \u6700\u521D\u306E\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u3092\u9078\u3073\u3001asana_request \u3067 GET /projects?workspace=WORKSPACE_GID&opt_fields=name,archived,created_at \u3092\u547C\u3073\u51FA\u3057\u3066\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u4E00\u89A7\u3092\u53D6\u5F97
471
- 3. \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30921\u3064\u9078\u3073\u3001asana_request \u3067 GET /tasks?project=PROJECT_GID&opt_fields=name,completed,assignee.name,due_on,created_at&limit=10 \u3092\u547C\u3073\u51FA\u3057\u3066\u30BF\u30B9\u30AF\u3092\u30B5\u30F3\u30D7\u30EA\u30F3\u30B0
471
+ ja: `1. connector_asana_request \u3067 GET /workspaces \u3092\u547C\u3073\u51FA\u3057\u3001\u5229\u7528\u53EF\u80FD\u306A\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u4E00\u89A7\u3092\u53D6\u5F97
472
+ 2. \u6700\u521D\u306E\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u3092\u9078\u3073\u3001connector_asana_request \u3067 GET /projects?workspace=WORKSPACE_GID&opt_fields=name,archived,created_at \u3092\u547C\u3073\u51FA\u3057\u3066\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u4E00\u89A7\u3092\u53D6\u5F97
473
+ 3. \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30921\u3064\u9078\u3073\u3001connector_asana_request \u3067 GET /tasks?project=PROJECT_GID&opt_fields=name,completed,assignee.name,due_on,created_at&limit=10 \u3092\u547C\u3073\u51FA\u3057\u3066\u30BF\u30B9\u30AF\u3092\u30B5\u30F3\u30D7\u30EA\u30F3\u30B0
472
474
  4. \u30DC\u30FC\u30C9\u3084\u30BB\u30AF\u30B7\u30E7\u30F3\u30D9\u30FC\u30B9\u306E\u30EF\u30FC\u30AF\u30D5\u30ED\u30FC\u306E\u5834\u5408\u306F GET /sections?project=PROJECT_GID \u3067\u30BB\u30AF\u30B7\u30E7\u30F3\u3092\u78BA\u8A8D`
473
475
  }
474
476
  });
@@ -499,6 +501,26 @@ async function listWorkspaces(params) {
499
501
  const data = await res.json();
500
502
  return data.data ?? [];
501
503
  }
504
+ async function getTaskBreakdown(params, projectGid) {
505
+ try {
506
+ const res = await apiFetch(
507
+ params,
508
+ `/projects/${encodeURIComponent(projectGid)}/tasks?limit=100&opt_fields=completed`
509
+ );
510
+ if (!res.ok) return null;
511
+ const data = await res.json();
512
+ const tasks = data.data ?? [];
513
+ const completed = tasks.filter((t) => t.completed).length;
514
+ const hasMore = !!data.next_page?.offset;
515
+ return {
516
+ total: tasks.length + (hasMore ? 100 : 0),
517
+ completed,
518
+ incomplete: tasks.length - completed
519
+ };
520
+ } catch {
521
+ return null;
522
+ }
523
+ }
502
524
  async function listProjects(params, workspaceGid) {
503
525
  const all = [];
504
526
  const fields = encodeURIComponent("name,team.name,current_status");
@@ -587,6 +609,13 @@ var asanaSetupFlow = {
587
609
  const status = project.current_status?.title ?? project.current_status?.text ?? "-";
588
610
  sections.push(`- Team: ${team}`);
589
611
  sections.push(`- Current status: ${status}`);
612
+ const tasks = await getTaskBreakdown(rt.params, gid);
613
+ if (tasks) {
614
+ const suffix = tasks.total >= 100 ? "+" : "";
615
+ sections.push(
616
+ `- Tasks: ${tasks.total}${suffix} (${tasks.completed} completed, ${tasks.incomplete} incomplete)`
617
+ );
618
+ }
590
619
  sections.push("");
591
620
  }
592
621
  return sections.join("\n");
@@ -708,7 +737,7 @@ var asanaConnector = new ConnectorPlugin({
708
737
  systemPrompt: {
709
738
  en: `### Tools
710
739
 
711
- - \`asana_request\`: The only way to call the Asana REST API. Use it to list workspaces, projects, tasks, users, sections, tags, and more. Authentication (Bearer token with Personal Access Token) is configured automatically. Provide the API path and optionally append query parameters like opt_fields for field selection.
740
+ - \`connector_asana_request\`: The only way to call the Asana REST API. Use it to list workspaces, projects, tasks, users, sections, tags, and more. Authentication (Bearer token with Personal Access Token) is configured automatically. Provide the API path and optionally append query parameters like opt_fields for field selection.
712
741
 
713
742
  ### Business Logic
714
743
 
@@ -795,7 +824,7 @@ export default async function handler(c: Context) {
795
824
  - Users: name, email, photo`,
796
825
  ja: `### \u30C4\u30FC\u30EB
797
826
 
798
- - \`asana_request\`: Asana REST API\u3092\u547C\u3073\u51FA\u3059\u552F\u4E00\u306E\u624B\u6BB5\u3067\u3059\u3002\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u3001\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u3001\u30BF\u30B9\u30AF\u3001\u30E6\u30FC\u30B6\u30FC\u3001\u30BB\u30AF\u30B7\u30E7\u30F3\u3001\u30BF\u30B0\u306A\u3069\u306E\u4E00\u89A7\u53D6\u5F97\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002\u8A8D\u8A3C\uFF08Personal Access Token\u3092\u4F7F\u7528\u3057\u305FBearer\u30C8\u30FC\u30AF\u30F3\uFF09\u306F\u81EA\u52D5\u7684\u306B\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002API\u30D1\u30B9\u3092\u6307\u5B9A\u3057\u3001\u5FC5\u8981\u306B\u5FDC\u3058\u3066opt_fields\u306A\u3069\u306E\u30AF\u30A8\u30EA\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u4ED8\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002
827
+ - \`connector_asana_request\`: Asana REST API\u3092\u547C\u3073\u51FA\u3059\u552F\u4E00\u306E\u624B\u6BB5\u3067\u3059\u3002\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u3001\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u3001\u30BF\u30B9\u30AF\u3001\u30E6\u30FC\u30B6\u30FC\u3001\u30BB\u30AF\u30B7\u30E7\u30F3\u3001\u30BF\u30B0\u306A\u3069\u306E\u4E00\u89A7\u53D6\u5F97\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002\u8A8D\u8A3C\uFF08Personal Access Token\u3092\u4F7F\u7528\u3057\u305FBearer\u30C8\u30FC\u30AF\u30F3\uFF09\u306F\u81EA\u52D5\u7684\u306B\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002API\u30D1\u30B9\u3092\u6307\u5B9A\u3057\u3001\u5FC5\u8981\u306B\u5FDC\u3058\u3066opt_fields\u306A\u3069\u306E\u30AF\u30A8\u30EA\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u4ED8\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002
799
828
 
800
829
  ### Business Logic
801
830
 
@@ -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.
@@ -448,7 +450,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
448
450
  /**
449
451
  * Create tools for connections that belong to this connector.
450
452
  * Filters connections by connectorKey internally.
451
- * Returns tools keyed as `${connectorKey}_${toolName}`.
453
+ * Returns tools keyed as `connector_${connectorKey}_${toolName}`.
452
454
  */
453
455
  createTools(connections, config, opts) {
454
456
  const myConnections = connections.filter(
@@ -458,7 +460,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
458
460
  for (const t of Object.values(this.tools)) {
459
461
  const tool = t.createTool(myConnections, config);
460
462
  const originalToModelOutput = tool.toModelOutput;
461
- result[`${this.connectorKey}_${t.name}`] = {
463
+ result[`connector_${this.connectorKey}_${t.name}`] = {
462
464
  ...tool,
463
465
  toModelOutput: async (options) => {
464
466
  if (!originalToModelOutput) {
@@ -588,16 +590,16 @@ var AUTH_TYPES = {
588
590
  // ../connectors/src/connectors/attio/setup.ts
589
591
  var attioOnboarding = new ConnectorOnboarding({
590
592
  dataOverviewInstructions: {
591
- en: `1. Call attio_request with GET /objects to discover the object slugs actually configured in this workspace (typically people, companies, deals, plus any custom objects).
592
- 2. For each object you plan to use, call attio_request with GET /objects/{slug}/attributes to explore its attributes
593
- 3. Call attio_request with POST /objects/{slug}/records/query with { "limit": 5 } to sample records
594
- 4. Call attio_request with GET /workspace_members (top-level, snake_case) to list team members. The response shape is \`{ data: [{ id: { workspace_member_id }, first_name, last_name, email_address, ... }] }\`. You need this mapping in dashboard handlers to resolve \`owner\` and other actor-reference fields (which return \`referenced_actor_id\`, not a name). Sample one record that has an \`owner\` and confirm the shape \`{ referenced_actor_type, referenced_actor_id }\`, then use \`client.getWorkspaceMemberMap()\` in handlers to resolve IDs to names.
593
+ en: `1. Call connector_attio_request with GET /objects to discover the object slugs actually configured in this workspace (typically people, companies, deals, plus any custom objects).
594
+ 2. For each object you plan to use, call connector_attio_request with GET /objects/{slug}/attributes to explore its attributes
595
+ 3. Call connector_attio_request with POST /objects/{slug}/records/query with { "limit": 5 } to sample records
596
+ 4. Call connector_attio_request with GET /workspace_members (top-level, snake_case) to list team members. The response shape is \`{ data: [{ id: { workspace_member_id }, first_name, last_name, email_address, ... }] }\`. You need this mapping in dashboard handlers to resolve \`owner\` and other actor-reference fields (which return \`referenced_actor_id\`, not a name). Sample one record that has an \`owner\` and confirm the shape \`{ referenced_actor_type, referenced_actor_id }\`, then use \`client.getWorkspaceMemberMap()\` in handlers to resolve IDs to names.
595
597
  5. If an endpoint later returns 403 (tasks / threads / webhooks / meetings require specific scopes), call GET /self to inspect the token's active scopes.
596
598
  6. Explore lists via GET /lists as needed, and use /notes, /tasks, /threads, /comments, /webhooks, /meetings when the question requires them.`,
597
- ja: `1. attio_request \u3067 GET /objects \u3092\u547C\u3073\u51FA\u3057\u3001\u3053\u306E\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u306B\u5B9F\u5728\u3059\u308B\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8slug\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u901A\u5E38\u306F people / companies / deals\u3001\u52A0\u3048\u3066\u8A2D\u5B9A\u6E08\u307F\u306E\u30AB\u30B9\u30BF\u30E0\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\uFF09
598
- 2. \u4F7F\u3046\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u3054\u3068\u306B attio_request \u3067 GET /objects/{slug}/attributes \u3092\u547C\u3073\u51FA\u3057\u3001\u5C5E\u6027\u3092\u78BA\u8A8D
599
- 3. attio_request \u3067 POST /objects/{slug}/records/query \u3092 { "limit": 5 } \u3067\u547C\u3073\u51FA\u3057\u3001\u30EC\u30B3\u30FC\u30C9\u3092\u30B5\u30F3\u30D7\u30EA\u30F3\u30B0
600
- 4. attio_request \u3067 GET /workspace_members\uFF08\u30C8\u30C3\u30D7\u30EC\u30D9\u30EB\u3001\u30B9\u30CD\u30FC\u30AF\u30B1\u30FC\u30B9\uFF09\u3092\u547C\u3073\u51FA\u3057\u3001\u30C1\u30FC\u30E0\u30E1\u30F3\u30D0\u30FC\u4E00\u89A7\u3092\u53D6\u5F97\u3002\u30EC\u30B9\u30DD\u30F3\u30B9\u306F \`{ data: [{ id: { workspace_member_id }, first_name, last_name, email_address, ... }] }\` \u306E\u5F62\u5F0F\u3067\u3059\u3002\u3053\u306E\u30DE\u30C3\u30D4\u30F3\u30B0\u306F\u3001\`owner\` \u306A\u3069\u306E actor-reference \u30D5\u30A3\u30FC\u30EB\u30C9\uFF08\`referenced_actor_id\` \u3092\u8FD4\u3059\uFF09\u3092\u540D\u524D\u306B\u89E3\u6C7A\u3059\u308B\u305F\u3081\u306B\u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9\u30CF\u30F3\u30C9\u30E9\u3067\u5FC5\u9808\u3067\u3059\u3002\`owner\` \u3092\u6301\u3064\u30EC\u30B3\u30FC\u30C9\u30921\u4EF6\u30B5\u30F3\u30D7\u30EA\u30F3\u30B0\u3057\u3001\`{ referenced_actor_type, referenced_actor_id }\` \u306E\u5F62\u3092\u78BA\u8A8D\u3057\u305F\u4E0A\u3067\u3001\u30CF\u30F3\u30C9\u30E9\u3067\u306F \`client.getWorkspaceMemberMap()\` \u3092\u4F7F\u3063\u3066 ID \u2192 \u540D\u524D \u306B\u89E3\u6C7A\u3057\u3066\u304F\u3060\u3055\u3044
599
+ ja: `1. connector_attio_request \u3067 GET /objects \u3092\u547C\u3073\u51FA\u3057\u3001\u3053\u306E\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u306B\u5B9F\u5728\u3059\u308B\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8slug\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u901A\u5E38\u306F people / companies / deals\u3001\u52A0\u3048\u3066\u8A2D\u5B9A\u6E08\u307F\u306E\u30AB\u30B9\u30BF\u30E0\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\uFF09
600
+ 2. \u4F7F\u3046\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u3054\u3068\u306B connector_attio_request \u3067 GET /objects/{slug}/attributes \u3092\u547C\u3073\u51FA\u3057\u3001\u5C5E\u6027\u3092\u78BA\u8A8D
601
+ 3. connector_attio_request \u3067 POST /objects/{slug}/records/query \u3092 { "limit": 5 } \u3067\u547C\u3073\u51FA\u3057\u3001\u30EC\u30B3\u30FC\u30C9\u3092\u30B5\u30F3\u30D7\u30EA\u30F3\u30B0
602
+ 4. connector_attio_request \u3067 GET /workspace_members\uFF08\u30C8\u30C3\u30D7\u30EC\u30D9\u30EB\u3001\u30B9\u30CD\u30FC\u30AF\u30B1\u30FC\u30B9\uFF09\u3092\u547C\u3073\u51FA\u3057\u3001\u30C1\u30FC\u30E0\u30E1\u30F3\u30D0\u30FC\u4E00\u89A7\u3092\u53D6\u5F97\u3002\u30EC\u30B9\u30DD\u30F3\u30B9\u306F \`{ data: [{ id: { workspace_member_id }, first_name, last_name, email_address, ... }] }\` \u306E\u5F62\u5F0F\u3067\u3059\u3002\u3053\u306E\u30DE\u30C3\u30D4\u30F3\u30B0\u306F\u3001\`owner\` \u306A\u3069\u306E actor-reference \u30D5\u30A3\u30FC\u30EB\u30C9\uFF08\`referenced_actor_id\` \u3092\u8FD4\u3059\uFF09\u3092\u540D\u524D\u306B\u89E3\u6C7A\u3059\u308B\u305F\u3081\u306B\u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9\u30CF\u30F3\u30C9\u30E9\u3067\u5FC5\u9808\u3067\u3059\u3002\`owner\` \u3092\u6301\u3064\u30EC\u30B3\u30FC\u30C9\u30921\u4EF6\u30B5\u30F3\u30D7\u30EA\u30F3\u30B0\u3057\u3001\`{ referenced_actor_type, referenced_actor_id }\` \u306E\u5F62\u3092\u78BA\u8A8D\u3057\u305F\u4E0A\u3067\u3001\u30CF\u30F3\u30C9\u30E9\u3067\u306F \`client.getWorkspaceMemberMap()\` \u3092\u4F7F\u3063\u3066 ID \u2192 \u540D\u524D \u306B\u89E3\u6C7A\u3057\u3066\u304F\u3060\u3055\u3044
601
603
  5. \u5F8C\u6BB5\u3067 403 \u304C\u51FA\u305F\u5834\u5408\uFF08tasks / threads / webhooks / meetings \u306A\u3069\u306F\u500B\u5225\u306E scope \u304C\u5FC5\u8981\uFF09\u306F\u3001GET /self \u3092\u547C\u3073\u51FA\u3057\u3066API\u30C8\u30FC\u30AF\u30F3\u306E\u6709\u52B9 scope \u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044
602
604
  6. \u5FC5\u8981\u306B\u5FDC\u3058\u3066 GET /lists \u3067\u30EA\u30B9\u30C8\u3092\u63A2\u7D22\u3057\u3001/notes\u3001/tasks\u3001/threads\u3001/comments\u3001/webhooks\u3001/meetings \u3082\u6D3B\u7528\u3057\u3066\u304F\u3060\u3055\u3044`
603
605
  }
@@ -640,6 +642,21 @@ async function listAttributes(params, slug) {
640
642
  const data = await res.json();
641
643
  return data.data ?? [];
642
644
  }
645
+ async function probeRecordCount(params, slug) {
646
+ try {
647
+ const res = await apiFetch(params, `/objects/${slug}/records/query`, {
648
+ method: "POST",
649
+ headers: { "Content-Type": "application/json" },
650
+ body: JSON.stringify({ limit: 1 })
651
+ });
652
+ if (!res.ok) return null;
653
+ const data = await res.json();
654
+ const found = (data.data ?? []).length;
655
+ return found > 0 ? "1+" : "0";
656
+ } catch {
657
+ return null;
658
+ }
659
+ }
643
660
  var attioSetupFlow = {
644
661
  initialState: () => ({}),
645
662
  steps: [
@@ -675,7 +692,9 @@ var attioSetupFlow = {
675
692
  });
676
693
  const sections = ["## Attio", ""];
677
694
  for (const slug of targetObjects) {
678
- sections.push(`### Object: ${slug}`, "");
695
+ const recordIndicator = await probeRecordCount(rt.params, slug);
696
+ const heading = recordIndicator ? `### Object: ${slug} (records: ${recordIndicator})` : `### Object: ${slug}`;
697
+ sections.push(heading, "");
679
698
  const attrs = await listAttributes(rt.params, slug);
680
699
  const limited = attrs.slice(0, ATTIO_SETUP_MAX_ATTRIBUTES);
681
700
  sections.push("| Attribute | Type | Title |");
@@ -791,7 +810,7 @@ var attioConnector = new ConnectorPlugin({
791
810
  systemPrompt: {
792
811
  en: `### Tools
793
812
 
794
- - \`attio_request\`: The only way to call the Attio REST API. Use it for every Attio resource \u2014 records (people, companies, deals, and any custom objects configured in the workspace), their attributes, lists and entries, workspace members, notes, tasks, threads, comments, webhooks, and meetings. Authentication (Bearer token) is configured automatically. Querying records uses POST \`/objects/{object}/records/query\` with a JSON body. Use PATCH for partial updates (append multiselect) and PUT for full updates (overwrite multiselect). Always call GET \`/objects\` first to discover the actual object slugs in this workspace.
813
+ - \`connector_attio_request\`: The only way to call the Attio REST API. Use it for every Attio resource \u2014 records (people, companies, deals, and any custom objects configured in the workspace), their attributes, lists and entries, workspace members, notes, tasks, threads, comments, webhooks, and meetings. Authentication (Bearer token) is configured automatically. Querying records uses POST \`/objects/{object}/records/query\` with a JSON body. Use PATCH for partial updates (append multiselect) and PUT for full updates (overwrite multiselect). Always call GET \`/objects\` first to discover the actual object slugs in this workspace.
795
814
 
796
815
  ### Business Logic
797
816
 
@@ -938,7 +957,7 @@ export default async function handler(c: Context) {
938
957
  - \`offset\` \u2014 pagination offset`,
939
958
  ja: `### \u30C4\u30FC\u30EB
940
959
 
941
- - \`attio_request\`: Attio REST API\u3092\u547C\u3073\u51FA\u3059\u552F\u4E00\u306E\u624B\u6BB5\u3067\u3059\u3002\u30EC\u30B3\u30FC\u30C9\uFF08people\u3001companies\u3001deals\u3001\u304A\u3088\u3073\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u306B\u8A2D\u5B9A\u3055\u308C\u305F\u30AB\u30B9\u30BF\u30E0\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\uFF09\u3068\u305D\u306E\u5C5E\u6027\u3001\u30EA\u30B9\u30C8\u3068\u30A8\u30F3\u30C8\u30EA\u3001\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u30E1\u30F3\u30D0\u30FC\u3001\u30CE\u30FC\u30C8\u3001\u30BF\u30B9\u30AF\u3001\u30B9\u30EC\u30C3\u30C9\u3001\u30B3\u30E1\u30F3\u30C8\u3001Webhook\u3001\u30DF\u30FC\u30C6\u30A3\u30F3\u30B0\u306A\u3069\u3001\u3059\u3079\u3066\u306EAttio\u30EA\u30BD\u30FC\u30B9\u306E\u64CD\u4F5C\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002\u8A8D\u8A3C\uFF08Bearer\u30C8\u30FC\u30AF\u30F3\uFF09\u306F\u81EA\u52D5\u7684\u306B\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002\u30EC\u30B3\u30FC\u30C9\u306E\u30AF\u30A8\u30EA\u306B\u306F POST \`/objects/{object}/records/query\` \u3092\u30D5\u30A3\u30EB\u30BF\u4ED8\u304D\u306EJSON\u30DC\u30C7\u30A3\u3067\u4F7F\u7528\u3057\u307E\u3059\u3002\u90E8\u5206\u66F4\u65B0\uFF08multiselect\u306E\u8FFD\u52A0\uFF09\u306B\u306FPATCH\u3001\u5168\u7F6E\u63DB\uFF08multiselect\u306E\u4E0A\u66F8\u304D\uFF09\u306B\u306FPUT\u3092\u4F7F\u3044\u307E\u3059\u3002**\u5FC5\u305A** \u6700\u521D\u306B GET \`/objects\` \u3092\u547C\u3073\u51FA\u3057\u3066\u3001\u3053\u306E\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u306B\u5B9F\u5728\u3059\u308B\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8slug\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002
960
+ - \`connector_attio_request\`: Attio REST API\u3092\u547C\u3073\u51FA\u3059\u552F\u4E00\u306E\u624B\u6BB5\u3067\u3059\u3002\u30EC\u30B3\u30FC\u30C9\uFF08people\u3001companies\u3001deals\u3001\u304A\u3088\u3073\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u306B\u8A2D\u5B9A\u3055\u308C\u305F\u30AB\u30B9\u30BF\u30E0\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\uFF09\u3068\u305D\u306E\u5C5E\u6027\u3001\u30EA\u30B9\u30C8\u3068\u30A8\u30F3\u30C8\u30EA\u3001\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u30E1\u30F3\u30D0\u30FC\u3001\u30CE\u30FC\u30C8\u3001\u30BF\u30B9\u30AF\u3001\u30B9\u30EC\u30C3\u30C9\u3001\u30B3\u30E1\u30F3\u30C8\u3001Webhook\u3001\u30DF\u30FC\u30C6\u30A3\u30F3\u30B0\u306A\u3069\u3001\u3059\u3079\u3066\u306EAttio\u30EA\u30BD\u30FC\u30B9\u306E\u64CD\u4F5C\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002\u8A8D\u8A3C\uFF08Bearer\u30C8\u30FC\u30AF\u30F3\uFF09\u306F\u81EA\u52D5\u7684\u306B\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002\u30EC\u30B3\u30FC\u30C9\u306E\u30AF\u30A8\u30EA\u306B\u306F POST \`/objects/{object}/records/query\` \u3092\u30D5\u30A3\u30EB\u30BF\u4ED8\u304D\u306EJSON\u30DC\u30C7\u30A3\u3067\u4F7F\u7528\u3057\u307E\u3059\u3002\u90E8\u5206\u66F4\u65B0\uFF08multiselect\u306E\u8FFD\u52A0\uFF09\u306B\u306FPATCH\u3001\u5168\u7F6E\u63DB\uFF08multiselect\u306E\u4E0A\u66F8\u304D\uFF09\u306B\u306FPUT\u3092\u4F7F\u3044\u307E\u3059\u3002**\u5FC5\u305A** \u6700\u521D\u306B GET \`/objects\` \u3092\u547C\u3073\u51FA\u3057\u3066\u3001\u3053\u306E\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u306B\u5B9F\u5728\u3059\u308B\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8slug\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002
942
961
 
943
962
  ### Business Logic
944
963