@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.
Files changed (77) hide show
  1. package/dist/cli/index.js +4873 -1073
  2. package/dist/connectors/airtable-oauth.js +78 -11
  3. package/dist/connectors/airtable.js +74 -11
  4. package/dist/connectors/amplitude.js +38 -11
  5. package/dist/connectors/anthropic.js +4 -2
  6. package/dist/connectors/asana.js +67 -13
  7. package/dist/connectors/attio.js +60 -16
  8. package/dist/connectors/aws-billing.js +38 -11
  9. package/dist/connectors/azure-sql.js +64 -13
  10. package/dist/connectors/backlog-api-key.js +70 -18
  11. package/dist/connectors/clickup.js +80 -13
  12. package/dist/connectors/cosmosdb.js +42 -15
  13. package/dist/connectors/customerio.js +39 -12
  14. package/dist/connectors/dbt.js +716 -28
  15. package/dist/connectors/freshdesk.js +112 -11
  16. package/dist/connectors/freshsales.js +38 -11
  17. package/dist/connectors/freshservice.js +38 -11
  18. package/dist/connectors/gamma.js +47 -20
  19. package/dist/connectors/gemini.js +4 -2
  20. package/dist/connectors/github.js +42 -15
  21. package/dist/connectors/gmail-oauth.js +38 -13
  22. package/dist/connectors/gmail.js +34 -7
  23. package/dist/connectors/google-ads.js +38 -11
  24. package/dist/connectors/google-analytics-oauth.js +182 -28
  25. package/dist/connectors/google-analytics.js +653 -104
  26. package/dist/connectors/google-audit-log.js +34 -7
  27. package/dist/connectors/google-calendar-oauth.js +91 -18
  28. package/dist/connectors/google-calendar.js +91 -14
  29. package/dist/connectors/google-docs.js +38 -13
  30. package/dist/connectors/google-drive.js +60 -13
  31. package/dist/connectors/google-search-console-oauth.js +156 -20
  32. package/dist/connectors/google-sheets.js +36 -9
  33. package/dist/connectors/google-slides.js +38 -13
  34. package/dist/connectors/grafana.js +75 -13
  35. package/dist/connectors/hubspot-oauth.js +69 -12
  36. package/dist/connectors/hubspot.js +55 -12
  37. package/dist/connectors/influxdb.js +38 -11
  38. package/dist/connectors/intercom-oauth.js +100 -15
  39. package/dist/connectors/intercom.js +42 -15
  40. package/dist/connectors/jdbc.js +36 -9
  41. package/dist/connectors/jira-api-key.js +98 -14
  42. package/dist/connectors/kintone-api-token.js +96 -21
  43. package/dist/connectors/kintone.js +84 -14
  44. package/dist/connectors/linear.js +84 -15
  45. package/dist/connectors/linkedin-ads.js +71 -17
  46. package/dist/connectors/mailchimp-oauth.js +36 -9
  47. package/dist/connectors/mailchimp.js +36 -9
  48. package/dist/connectors/meta-ads-oauth.js +63 -17
  49. package/dist/connectors/meta-ads.js +65 -17
  50. package/dist/connectors/mixpanel.js +38 -11
  51. package/dist/connectors/monday.js +39 -12
  52. package/dist/connectors/mongodb.js +38 -11
  53. package/dist/connectors/notion-oauth.js +88 -14
  54. package/dist/connectors/notion.js +90 -14
  55. package/dist/connectors/openai.js +4 -2
  56. package/dist/connectors/oracle.js +78 -20
  57. package/dist/connectors/outlook-oauth.js +48 -23
  58. package/dist/connectors/powerbi-oauth.js +321 -49
  59. package/dist/connectors/salesforce.js +72 -12
  60. package/dist/connectors/semrush.js +374 -52
  61. package/dist/connectors/sentry.js +66 -13
  62. package/dist/connectors/shopify-oauth.js +71 -13
  63. package/dist/connectors/shopify.js +38 -11
  64. package/dist/connectors/sqlserver.js +64 -13
  65. package/dist/connectors/stripe-api-key.js +96 -18
  66. package/dist/connectors/stripe-oauth.js +98 -22
  67. package/dist/connectors/supabase.js +55 -11
  68. package/dist/connectors/tableau.js +262 -92
  69. package/dist/connectors/tiktok-ads.js +67 -19
  70. package/dist/connectors/wix-store.js +38 -11
  71. package/dist/connectors/zendesk-oauth.js +83 -15
  72. package/dist/connectors/zendesk.js +42 -15
  73. package/dist/index.d.ts +1 -0
  74. package/dist/index.js +4902 -1077
  75. package/dist/main.js +4891 -1071
  76. package/dist/vite-plugin.js +4871 -1071
  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.
@@ -169,7 +171,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
169
171
  /**
170
172
  * Create tools for connections that belong to this connector.
171
173
  * Filters connections by connectorKey internally.
172
- * Returns tools keyed as `${connectorKey}_${toolName}`.
174
+ * Returns tools keyed as `connector_${connectorKey}_${toolName}`.
173
175
  */
174
176
  createTools(connections, config, opts) {
175
177
  const myConnections = connections.filter(
@@ -179,7 +181,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
179
181
  for (const t of Object.values(this.tools)) {
180
182
  const tool = t.createTool(myConnections, config);
181
183
  const originalToModelOutput = tool.toModelOutput;
182
- result[`${this.connectorKey}_${t.name}`] = {
184
+ result[`connector_${this.connectorKey}_${t.name}`] = {
183
185
  ...tool,
184
186
  toModelOutput: async (options) => {
185
187
  if (!originalToModelOutput) {
@@ -235,19 +237,34 @@ async function runSetupFlow(flow, params, ctx, config) {
235
237
  };
236
238
  let state = flow.initialState();
237
239
  let answerIdx = 0;
240
+ const pendingParameterUpdates = [];
238
241
  for (const step of flow.steps) {
239
242
  const ans = ctx.answers[answerIdx];
240
243
  if (ans && ans.questionSlug === step.slug) {
241
244
  state = step.applyAnswer(state, ans.answer);
245
+ if (step.toParameterUpdates) {
246
+ pendingParameterUpdates.push(...step.toParameterUpdates(state));
247
+ }
242
248
  answerIdx += 1;
243
249
  continue;
244
250
  }
251
+ const resolvedAllowFreeText = step.allowFreeText !== void 0 ? step.allowFreeText : true;
245
252
  if (step.type === "text") {
253
+ if (step.fetchOptions) {
254
+ const options2 = await step.fetchOptions(state, runtime);
255
+ if (options2.length === 0) {
256
+ continue;
257
+ }
258
+ }
246
259
  return {
247
260
  type: "nextQuestion",
248
261
  questionSlug: step.slug,
249
262
  question: step.question[ctx.language],
250
- questionType: "text"
263
+ questionType: "text",
264
+ allowFreeText: resolvedAllowFreeText,
265
+ ...pendingParameterUpdates.length > 0 && {
266
+ parameterUpdates: pendingParameterUpdates
267
+ }
251
268
  };
252
269
  }
253
270
  const options = step.fetchOptions ? await step.fetchOptions(state, runtime) : [];
@@ -259,11 +276,21 @@ async function runSetupFlow(flow, params, ctx, config) {
259
276
  questionSlug: step.slug,
260
277
  question: step.question[ctx.language],
261
278
  questionType: step.type,
262
- options
279
+ options,
280
+ allowFreeText: resolvedAllowFreeText,
281
+ ...pendingParameterUpdates.length > 0 && {
282
+ parameterUpdates: pendingParameterUpdates
283
+ }
263
284
  };
264
285
  }
265
286
  const dataInvestigationResult = await flow.finalize(state, runtime);
266
- return { type: "fulfilled", dataInvestigationResult };
287
+ return {
288
+ type: "fulfilled",
289
+ dataInvestigationResult,
290
+ ...pendingParameterUpdates.length > 0 && {
291
+ parameterUpdates: pendingParameterUpdates
292
+ }
293
+ };
267
294
  }
268
295
  async function resolveSetupSelection(params) {
269
296
  const { selected, allSentinel, fetchAll, limit } = params;
@@ -421,11 +448,11 @@ var metaAdsOauthOnboarding = new ConnectorOnboarding({
421
448
  - Write only 1 sentence between tool calls, then immediately call the next tool. Skip unnecessary explanations and proceed efficiently`
422
449
  },
423
450
  dataOverviewInstructions: {
424
- en: `1. Call meta-ads-oauth_request with GET act_{adAccountId}/campaigns?fields=id,name,status,objective to explore campaign data
425
- 2. Call meta-ads-oauth_request with GET act_{adAccountId}/insights?fields=impressions,clicks,spend,ctr,cpm&date_preset=last_7d to check recent performance
451
+ en: `1. Call connector_meta-ads-oauth_request with GET act_{adAccountId}/campaigns?fields=id,name,status,objective to explore campaign data
452
+ 2. Call connector_meta-ads-oauth_request with GET act_{adAccountId}/insights?fields=impressions,clicks,spend,ctr,cpm&date_preset=last_7d to check recent performance
426
453
  3. Explore ad sets and ads as needed to understand the data structure`,
427
- ja: `1. meta-ads-oauth_request \u3067 GET act_{adAccountId}/campaigns?fields=id,name,status,objective \u3092\u547C\u3073\u51FA\u3057\u3066\u30AD\u30E3\u30F3\u30DA\u30FC\u30F3\u30C7\u30FC\u30BF\u3092\u63A2\u7D22
428
- 2. meta-ads-oauth_request \u3067 GET act_{adAccountId}/insights?fields=impressions,clicks,spend,ctr,cpm&date_preset=last_7d \u3092\u547C\u3073\u51FA\u3057\u3066\u76F4\u8FD1\u306E\u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u3092\u78BA\u8A8D
454
+ ja: `1. connector_meta-ads-oauth_request \u3067 GET act_{adAccountId}/campaigns?fields=id,name,status,objective \u3092\u547C\u3073\u51FA\u3057\u3066\u30AD\u30E3\u30F3\u30DA\u30FC\u30F3\u30C7\u30FC\u30BF\u3092\u63A2\u7D22
455
+ 2. connector_meta-ads-oauth_request \u3067 GET act_{adAccountId}/insights?fields=impressions,clicks,spend,ctr,cpm&date_preset=last_7d \u3092\u547C\u3073\u51FA\u3057\u3066\u76F4\u8FD1\u306E\u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u3092\u78BA\u8A8D
429
456
  3. \u5FC5\u8981\u306B\u5FDC\u3058\u3066\u5E83\u544A\u30BB\u30C3\u30C8\u3084\u5E83\u544A\u30C7\u30FC\u30BF\u3092\u63A2\u7D22\u3057\u3001\u30C7\u30FC\u30BF\u69CB\u9020\u3092\u628A\u63E1`
430
457
  }
431
458
  });
@@ -476,6 +503,18 @@ async function listAdAccounts(proxyFetch) {
476
503
  const data = await res.json();
477
504
  return data.data ?? [];
478
505
  }
506
+ async function fetchCampaignCount(proxyFetch, accountId) {
507
+ try {
508
+ const url = `${BASE_URL3}/act_${encodeURIComponent(accountId)}/campaigns?summary=total_count&limit=0`;
509
+ const res = await proxyFetch(url, { method: "GET" });
510
+ if (!res.ok) return null;
511
+ const data = await res.json();
512
+ const total = data.summary?.total_count;
513
+ return typeof total === "number" ? total : null;
514
+ } catch {
515
+ return null;
516
+ }
517
+ }
479
518
  function bareAdAccountId(account) {
480
519
  if (account.account_id) return account.account_id;
481
520
  return (account.id ?? "").replace(/^act_/, "");
@@ -527,14 +566,21 @@ var metaAdsOauthSetupFlow = {
527
566
  sections.push("_No ad accounts selected._", "");
528
567
  return sections.join("\n");
529
568
  }
530
- sections.push("| Ad Account ID | Name | Currency | Status |");
531
- sections.push("|---------------|------|----------|--------|");
532
- for (const id of targetIds) {
569
+ sections.push("| Ad Account ID | Name | Currency | Status | Campaigns |");
570
+ sections.push("|---------------|------|----------|--------|-----------|");
571
+ const campaignCounts = await Promise.all(
572
+ targetIds.map((id) => fetchCampaignCount(rt.config.proxyFetch, id))
573
+ );
574
+ for (let i = 0; i < targetIds.length; i++) {
575
+ const id = targetIds[i];
533
576
  const account = byId.get(id);
534
577
  const name = (account?.name ?? "-").replace(/\|/g, "\\|");
535
578
  const currency = account?.currency ?? "-";
536
579
  const status = statusLabel(account?.account_status);
537
- sections.push(`| ${id} | ${name} | ${currency} | ${status} |`);
580
+ const campaigns = campaignCounts[i] == null ? "-" : String(campaignCounts[i]);
581
+ sections.push(
582
+ `| ${id} | ${name} | ${currency} | ${status} | ${campaigns} |`
583
+ );
538
584
  }
539
585
  sections.push("");
540
586
  return sections.join("\n");
@@ -689,8 +735,8 @@ var metaAdsOauthConnector = new ConnectorPlugin({
689
735
  systemPrompt: {
690
736
  en: `### Tools
691
737
 
692
- - \`meta-ads-oauth_request\`: Send authenticated requests to the Meta Marketing API v21.0. The {adAccountId} placeholder in paths is automatically replaced. Authentication is handled automatically via OAuth proxy.
693
- - \`meta-ads-oauth_listAdAccounts\`: List accessible Meta ad accounts. Use this during setup to discover available accounts.
738
+ - \`connector_meta-ads-oauth_request\`: Send authenticated requests to the Meta Marketing API v21.0. The {adAccountId} placeholder in paths is automatically replaced. Authentication is handled automatically via OAuth proxy.
739
+ - \`connector_meta-ads-oauth_listAdAccounts\`: List accessible Meta ad accounts. Use this during setup to discover available accounts.
694
740
 
695
741
  ### Meta Marketing API Reference
696
742
 
@@ -746,8 +792,8 @@ const data = await res.json();
746
792
  \`\`\``,
747
793
  ja: `### \u30C4\u30FC\u30EB
748
794
 
749
- - \`meta-ads-oauth_request\`: Meta Marketing API v21.0\u3078\u8A8D\u8A3C\u6E08\u307F\u30EA\u30AF\u30A8\u30B9\u30C8\u3092\u9001\u4FE1\u3057\u307E\u3059\u3002\u30D1\u30B9\u5185\u306E{adAccountId}\u30D7\u30EC\u30FC\u30B9\u30DB\u30EB\u30C0\u30FC\u306F\u81EA\u52D5\u7684\u306B\u7F6E\u63DB\u3055\u308C\u307E\u3059\u3002\u8A8D\u8A3C\u306FOAuth\u30D7\u30ED\u30AD\u30B7\u7D4C\u7531\u3067\u81EA\u52D5\u7684\u306B\u51E6\u7406\u3055\u308C\u307E\u3059\u3002
750
- - \`meta-ads-oauth_listAdAccounts\`: \u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306AMeta\u5E83\u544A\u30A2\u30AB\u30A6\u30F3\u30C8\u306E\u4E00\u89A7\u3092\u53D6\u5F97\u3057\u307E\u3059\u3002\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u6642\u306B\u5229\u7528\u53EF\u80FD\u306A\u30A2\u30AB\u30A6\u30F3\u30C8\u3092\u78BA\u8A8D\u3059\u308B\u305F\u3081\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002
795
+ - \`connector_meta-ads-oauth_request\`: Meta Marketing API v21.0\u3078\u8A8D\u8A3C\u6E08\u307F\u30EA\u30AF\u30A8\u30B9\u30C8\u3092\u9001\u4FE1\u3057\u307E\u3059\u3002\u30D1\u30B9\u5185\u306E{adAccountId}\u30D7\u30EC\u30FC\u30B9\u30DB\u30EB\u30C0\u30FC\u306F\u81EA\u52D5\u7684\u306B\u7F6E\u63DB\u3055\u308C\u307E\u3059\u3002\u8A8D\u8A3C\u306FOAuth\u30D7\u30ED\u30AD\u30B7\u7D4C\u7531\u3067\u81EA\u52D5\u7684\u306B\u51E6\u7406\u3055\u308C\u307E\u3059\u3002
796
+ - \`connector_meta-ads-oauth_listAdAccounts\`: \u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306AMeta\u5E83\u544A\u30A2\u30AB\u30A6\u30F3\u30C8\u306E\u4E00\u89A7\u3092\u53D6\u5F97\u3057\u307E\u3059\u3002\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u6642\u306B\u5229\u7528\u53EF\u80FD\u306A\u30A2\u30AB\u30A6\u30F3\u30C8\u3092\u78BA\u8A8D\u3059\u308B\u305F\u3081\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002
751
797
 
752
798
  ### Meta Marketing API \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9
753
799
 
@@ -16,6 +16,7 @@ var init_parameter_definition = __esm({
16
16
  type;
17
17
  secret;
18
18
  required;
19
+ isDeprecated;
19
20
  constructor(config) {
20
21
  this.slug = config.slug;
21
22
  this.name = config.name;
@@ -24,6 +25,7 @@ var init_parameter_definition = __esm({
24
25
  this.type = config.type;
25
26
  this.secret = config.secret;
26
27
  this.required = config.required;
28
+ this.isDeprecated = config.isDeprecated ?? false;
27
29
  }
28
30
  /**
29
31
  * Get the parameter value from a ConnectorConnectionObject.
@@ -240,7 +242,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
240
242
  /**
241
243
  * Create tools for connections that belong to this connector.
242
244
  * Filters connections by connectorKey internally.
243
- * Returns tools keyed as `${connectorKey}_${toolName}`.
245
+ * Returns tools keyed as `connector_${connectorKey}_${toolName}`.
244
246
  */
245
247
  createTools(connections, config, opts) {
246
248
  const myConnections = connections.filter(
@@ -250,7 +252,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
250
252
  for (const t of Object.values(this.tools)) {
251
253
  const tool = t.createTool(myConnections, config);
252
254
  const originalToModelOutput = tool.toModelOutput;
253
- result[`${this.connectorKey}_${t.name}`] = {
255
+ result[`connector_${this.connectorKey}_${t.name}`] = {
254
256
  ...tool,
255
257
  toModelOutput: async (options) => {
256
258
  if (!originalToModelOutput) {
@@ -306,19 +308,34 @@ async function runSetupFlow(flow, params, ctx, config) {
306
308
  };
307
309
  let state = flow.initialState();
308
310
  let answerIdx = 0;
311
+ const pendingParameterUpdates = [];
309
312
  for (const step of flow.steps) {
310
313
  const ans = ctx.answers[answerIdx];
311
314
  if (ans && ans.questionSlug === step.slug) {
312
315
  state = step.applyAnswer(state, ans.answer);
316
+ if (step.toParameterUpdates) {
317
+ pendingParameterUpdates.push(...step.toParameterUpdates(state));
318
+ }
313
319
  answerIdx += 1;
314
320
  continue;
315
321
  }
322
+ const resolvedAllowFreeText = step.allowFreeText !== void 0 ? step.allowFreeText : true;
316
323
  if (step.type === "text") {
324
+ if (step.fetchOptions) {
325
+ const options2 = await step.fetchOptions(state, runtime);
326
+ if (options2.length === 0) {
327
+ continue;
328
+ }
329
+ }
317
330
  return {
318
331
  type: "nextQuestion",
319
332
  questionSlug: step.slug,
320
333
  question: step.question[ctx.language],
321
- questionType: "text"
334
+ questionType: "text",
335
+ allowFreeText: resolvedAllowFreeText,
336
+ ...pendingParameterUpdates.length > 0 && {
337
+ parameterUpdates: pendingParameterUpdates
338
+ }
322
339
  };
323
340
  }
324
341
  const options = step.fetchOptions ? await step.fetchOptions(state, runtime) : [];
@@ -330,11 +347,21 @@ async function runSetupFlow(flow, params, ctx, config) {
330
347
  questionSlug: step.slug,
331
348
  question: step.question[ctx.language],
332
349
  questionType: step.type,
333
- options
350
+ options,
351
+ allowFreeText: resolvedAllowFreeText,
352
+ ...pendingParameterUpdates.length > 0 && {
353
+ parameterUpdates: pendingParameterUpdates
354
+ }
334
355
  };
335
356
  }
336
357
  const dataInvestigationResult = await flow.finalize(state, runtime);
337
- return { type: "fulfilled", dataInvestigationResult };
358
+ return {
359
+ type: "fulfilled",
360
+ dataInvestigationResult,
361
+ ...pendingParameterUpdates.length > 0 && {
362
+ parameterUpdates: pendingParameterUpdates
363
+ }
364
+ };
338
365
  }
339
366
  async function resolveSetupSelection(params) {
340
367
  const { selected, allSentinel, fetchAll, limit } = params;
@@ -453,11 +480,11 @@ var metaAdsOnboarding = new ConnectorOnboarding({
453
480
  - Write only 1 sentence between tool calls, then immediately call the next tool. Skip unnecessary explanations and proceed efficiently`
454
481
  },
455
482
  dataOverviewInstructions: {
456
- en: `1. Call meta-ads_request with GET act_{adAccountId}/campaigns?fields=id,name,status,objective to explore campaign data
457
- 2. Call meta-ads_request with GET act_{adAccountId}/insights?fields=impressions,clicks,spend,ctr,cpm&date_preset=last_7d to check recent performance
483
+ en: `1. Call connector_meta-ads_request with GET act_{adAccountId}/campaigns?fields=id,name,status,objective to explore campaign data
484
+ 2. Call connector_meta-ads_request with GET act_{adAccountId}/insights?fields=impressions,clicks,spend,ctr,cpm&date_preset=last_7d to check recent performance
458
485
  3. Explore ad sets and ads as needed to understand the data structure`,
459
- ja: `1. meta-ads_request \u3067 GET act_{adAccountId}/campaigns?fields=id,name,status,objective \u3092\u547C\u3073\u51FA\u3057\u3066\u30AD\u30E3\u30F3\u30DA\u30FC\u30F3\u30C7\u30FC\u30BF\u3092\u63A2\u7D22
460
- 2. meta-ads_request \u3067 GET act_{adAccountId}/insights?fields=impressions,clicks,spend,ctr,cpm&date_preset=last_7d \u3092\u547C\u3073\u51FA\u3057\u3066\u76F4\u8FD1\u306E\u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u3092\u78BA\u8A8D
486
+ ja: `1. connector_meta-ads_request \u3067 GET act_{adAccountId}/campaigns?fields=id,name,status,objective \u3092\u547C\u3073\u51FA\u3057\u3066\u30AD\u30E3\u30F3\u30DA\u30FC\u30F3\u30C7\u30FC\u30BF\u3092\u63A2\u7D22
487
+ 2. connector_meta-ads_request \u3067 GET act_{adAccountId}/insights?fields=impressions,clicks,spend,ctr,cpm&date_preset=last_7d \u3092\u547C\u3073\u51FA\u3057\u3066\u76F4\u8FD1\u306E\u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u3092\u78BA\u8A8D
461
488
  3. \u5FC5\u8981\u306B\u5FDC\u3058\u3066\u5E83\u544A\u30BB\u30C3\u30C8\u3084\u5E83\u544A\u30C7\u30FC\u30BF\u3092\u63A2\u7D22\u3057\u3001\u30C7\u30FC\u30BF\u69CB\u9020\u3092\u628A\u63E1`
462
489
  }
463
490
  });
@@ -505,6 +532,20 @@ async function listAdAccounts(params) {
505
532
  const data = await res.json();
506
533
  return data.data ?? [];
507
534
  }
535
+ async function fetchCampaignCount(params, accountId) {
536
+ try {
537
+ const res = await apiFetch(
538
+ params,
539
+ `/act_${encodeURIComponent(accountId)}/campaigns?summary=total_count&limit=0`
540
+ );
541
+ if (!res.ok) return null;
542
+ const data = await res.json();
543
+ const total = data.summary?.total_count;
544
+ return typeof total === "number" ? total : null;
545
+ } catch {
546
+ return null;
547
+ }
548
+ }
508
549
  function bareAdAccountId(account) {
509
550
  if (account.account_id) return account.account_id;
510
551
  return (account.id ?? "").replace(/^act_/, "");
@@ -556,14 +597,21 @@ var metaAdsSetupFlow = {
556
597
  sections.push("_No ad accounts selected._", "");
557
598
  return sections.join("\n");
558
599
  }
559
- sections.push("| Ad Account ID | Name | Currency | Status |");
560
- sections.push("|---------------|------|----------|--------|");
561
- for (const id of targetIds) {
600
+ sections.push("| Ad Account ID | Name | Currency | Status | Campaigns |");
601
+ sections.push("|---------------|------|----------|--------|-----------|");
602
+ const campaignCounts = await Promise.all(
603
+ targetIds.map((id) => fetchCampaignCount(rt.params, id))
604
+ );
605
+ for (let i = 0; i < targetIds.length; i++) {
606
+ const id = targetIds[i];
562
607
  const account = byId.get(id);
563
608
  const name = (account?.name ?? "-").replace(/\|/g, "\\|");
564
609
  const currency = account?.currency ?? "-";
565
610
  const status = statusLabel(account?.account_status);
566
- sections.push(`| ${id} | ${name} | ${currency} | ${status} |`);
611
+ const campaigns = campaignCounts[i] == null ? "-" : String(campaignCounts[i]);
612
+ sections.push(
613
+ `| ${id} | ${name} | ${currency} | ${status} | ${campaigns} |`
614
+ );
567
615
  }
568
616
  sections.push("");
569
617
  return sections.join("\n");
@@ -671,8 +719,8 @@ var metaAdsConnector = new ConnectorPlugin({
671
719
  systemPrompt: {
672
720
  en: `### Tools
673
721
 
674
- - \`meta-ads_request\`: Send authenticated requests to the Meta Marketing API v21.0. The {adAccountId} placeholder in paths is automatically replaced. Authentication is configured via the access token parameter.
675
- - \`meta-ads_listAdAccounts\`: List accessible Meta ad accounts. Use this during setup to discover available accounts.
722
+ - \`connector_meta-ads_request\`: Send authenticated requests to the Meta Marketing API v21.0. The {adAccountId} placeholder in paths is automatically replaced. Authentication is configured via the access token parameter.
723
+ - \`connector_meta-ads_listAdAccounts\`: List accessible Meta ad accounts. Use this during setup to discover available accounts.
676
724
 
677
725
  ### Meta Marketing API Reference
678
726
 
@@ -733,8 +781,8 @@ const accounts = await meta.listAdAccounts();
733
781
  \`\`\``,
734
782
  ja: `### \u30C4\u30FC\u30EB
735
783
 
736
- - \`meta-ads_request\`: Meta Marketing API v21.0\u3078\u8A8D\u8A3C\u6E08\u307F\u30EA\u30AF\u30A8\u30B9\u30C8\u3092\u9001\u4FE1\u3057\u307E\u3059\u3002\u30D1\u30B9\u5185\u306E{adAccountId}\u30D7\u30EC\u30FC\u30B9\u30DB\u30EB\u30C0\u30FC\u306F\u81EA\u52D5\u7684\u306B\u7F6E\u63DB\u3055\u308C\u307E\u3059\u3002\u8A8D\u8A3C\u306F\u30A2\u30AF\u30BB\u30B9\u30C8\u30FC\u30AF\u30F3\u30D1\u30E9\u30E1\u30FC\u30BF\u3067\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002
737
- - \`meta-ads_listAdAccounts\`: \u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306AMeta\u5E83\u544A\u30A2\u30AB\u30A6\u30F3\u30C8\u306E\u4E00\u89A7\u3092\u53D6\u5F97\u3057\u307E\u3059\u3002\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u6642\u306B\u5229\u7528\u53EF\u80FD\u306A\u30A2\u30AB\u30A6\u30F3\u30C8\u3092\u78BA\u8A8D\u3059\u308B\u305F\u3081\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002
784
+ - \`connector_meta-ads_request\`: Meta Marketing API v21.0\u3078\u8A8D\u8A3C\u6E08\u307F\u30EA\u30AF\u30A8\u30B9\u30C8\u3092\u9001\u4FE1\u3057\u307E\u3059\u3002\u30D1\u30B9\u5185\u306E{adAccountId}\u30D7\u30EC\u30FC\u30B9\u30DB\u30EB\u30C0\u30FC\u306F\u81EA\u52D5\u7684\u306B\u7F6E\u63DB\u3055\u308C\u307E\u3059\u3002\u8A8D\u8A3C\u306F\u30A2\u30AF\u30BB\u30B9\u30C8\u30FC\u30AF\u30F3\u30D1\u30E9\u30E1\u30FC\u30BF\u3067\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002
785
+ - \`connector_meta-ads_listAdAccounts\`: \u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306AMeta\u5E83\u544A\u30A2\u30AB\u30A6\u30F3\u30C8\u306E\u4E00\u89A7\u3092\u53D6\u5F97\u3057\u307E\u3059\u3002\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u6642\u306B\u5229\u7528\u53EF\u80FD\u306A\u30A2\u30AB\u30A6\u30F3\u30C8\u3092\u78BA\u8A8D\u3059\u308B\u305F\u3081\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002
738
786
 
739
787
  ### Meta Marketing API \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9
740
788
 
@@ -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.
@@ -332,7 +334,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
332
334
  /**
333
335
  * Create tools for connections that belong to this connector.
334
336
  * Filters connections by connectorKey internally.
335
- * Returns tools keyed as `${connectorKey}_${toolName}`.
337
+ * Returns tools keyed as `connector_${connectorKey}_${toolName}`.
336
338
  */
337
339
  createTools(connections, config, opts) {
338
340
  const myConnections = connections.filter(
@@ -342,7 +344,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
342
344
  for (const t of Object.values(this.tools)) {
343
345
  const tool = t.createTool(myConnections, config);
344
346
  const originalToModelOutput = tool.toModelOutput;
345
- result[`${this.connectorKey}_${t.name}`] = {
347
+ result[`connector_${this.connectorKey}_${t.name}`] = {
346
348
  ...tool,
347
349
  toModelOutput: async (options) => {
348
350
  if (!originalToModelOutput) {
@@ -398,19 +400,34 @@ async function runSetupFlow(flow, params, ctx, config) {
398
400
  };
399
401
  let state = flow.initialState();
400
402
  let answerIdx = 0;
403
+ const pendingParameterUpdates = [];
401
404
  for (const step of flow.steps) {
402
405
  const ans = ctx.answers[answerIdx];
403
406
  if (ans && ans.questionSlug === step.slug) {
404
407
  state = step.applyAnswer(state, ans.answer);
408
+ if (step.toParameterUpdates) {
409
+ pendingParameterUpdates.push(...step.toParameterUpdates(state));
410
+ }
405
411
  answerIdx += 1;
406
412
  continue;
407
413
  }
414
+ const resolvedAllowFreeText = step.allowFreeText !== void 0 ? step.allowFreeText : true;
408
415
  if (step.type === "text") {
416
+ if (step.fetchOptions) {
417
+ const options2 = await step.fetchOptions(state, runtime);
418
+ if (options2.length === 0) {
419
+ continue;
420
+ }
421
+ }
409
422
  return {
410
423
  type: "nextQuestion",
411
424
  questionSlug: step.slug,
412
425
  question: step.question[ctx.language],
413
- questionType: "text"
426
+ questionType: "text",
427
+ allowFreeText: resolvedAllowFreeText,
428
+ ...pendingParameterUpdates.length > 0 && {
429
+ parameterUpdates: pendingParameterUpdates
430
+ }
414
431
  };
415
432
  }
416
433
  const options = step.fetchOptions ? await step.fetchOptions(state, runtime) : [];
@@ -422,11 +439,21 @@ async function runSetupFlow(flow, params, ctx, config) {
422
439
  questionSlug: step.slug,
423
440
  question: step.question[ctx.language],
424
441
  questionType: step.type,
425
- options
442
+ options,
443
+ allowFreeText: resolvedAllowFreeText,
444
+ ...pendingParameterUpdates.length > 0 && {
445
+ parameterUpdates: pendingParameterUpdates
446
+ }
426
447
  };
427
448
  }
428
449
  const dataInvestigationResult = await flow.finalize(state, runtime);
429
- return { type: "fulfilled", dataInvestigationResult };
450
+ return {
451
+ type: "fulfilled",
452
+ dataInvestigationResult,
453
+ ...pendingParameterUpdates.length > 0 && {
454
+ parameterUpdates: pendingParameterUpdates
455
+ }
456
+ };
430
457
  }
431
458
 
432
459
  // ../connectors/src/auth-types.ts
@@ -446,15 +473,15 @@ var mixpanelOnboarding = new ConnectorOnboarding({
446
473
  - US (default): https://mixpanel.com/api/query (Query API), https://data.mixpanel.com/api/2.0/export (Export API)
447
474
  - EU: https://eu.mixpanel.com/api/query, https://data-eu.mixpanel.com/api/2.0/export
448
475
  - India: https://in.mixpanel.com/api/query, https://data-in.mixpanel.com/api/2.0/export
449
- 2. Call mixpanel_request with GET {exportBase}?from_date=YYYY-MM-DD&to_date=YYYY-MM-DD (use a short recent date range, e.g. 1-2 days) to export raw events and discover available event types and properties
450
- 3. Call mixpanel_request with POST {queryBase}/engage to query user profiles and understand user properties
476
+ 2. Call connector_mixpanel_request with GET {exportBase}?from_date=YYYY-MM-DD&to_date=YYYY-MM-DD (use a short recent date range, e.g. 1-2 days) to export raw events and discover available event types and properties
477
+ 3. Call connector_mixpanel_request with POST {queryBase}/engage to query user profiles and understand user properties
451
478
  NOTE: The Query API endpoints (insights, funnels, retention) require a bookmark_id or funnel_id from existing reports in Mixpanel. Use the Export API to retrieve raw events and aggregate in code if you need ad-hoc analysis.`,
452
479
  ja: `1. \u63A5\u7D9A\u306Eregion\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u78BA\u8A8D\u3057\u3066\u30D9\u30FC\u30B9URL\u3092\u6C7A\u5B9A\uFF1A
453
480
  - US\uFF08\u30C7\u30D5\u30A9\u30EB\u30C8\uFF09: https://mixpanel.com/api/query\uFF08Query API\uFF09\u3001https://data.mixpanel.com/api/2.0/export\uFF08Export API\uFF09
454
481
  - EU: https://eu.mixpanel.com/api/query\u3001https://data-eu.mixpanel.com/api/2.0/export
455
482
  - India: https://in.mixpanel.com/api/query\u3001https://data-in.mixpanel.com/api/2.0/export
456
- 2. mixpanel_request \u3067 GET {exportBase}?from_date=YYYY-MM-DD&to_date=YYYY-MM-DD \u3092\u547C\u3073\u51FA\u3057\uFF08\u76F4\u8FD11-2\u65E5\u306E\u77ED\u3044\u671F\u9593\u3092\u4F7F\u7528\uFF09\u3001\u751F\u30A4\u30D9\u30F3\u30C8\u3092\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u3057\u3066\u5229\u7528\u53EF\u80FD\u306A\u30A4\u30D9\u30F3\u30C8\u30BF\u30A4\u30D7\u3068\u30D7\u30ED\u30D1\u30C6\u30A3\u3092\u78BA\u8A8D
457
- 3. mixpanel_request \u3067 POST {queryBase}/engage \u3092\u547C\u3073\u51FA\u3057\u3001\u30E6\u30FC\u30B6\u30FC\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u3092\u7167\u4F1A\u3057\u3066\u30E6\u30FC\u30B6\u30FC\u30D7\u30ED\u30D1\u30C6\u30A3\u3092\u628A\u63E1
483
+ 2. connector_mixpanel_request \u3067 GET {exportBase}?from_date=YYYY-MM-DD&to_date=YYYY-MM-DD \u3092\u547C\u3073\u51FA\u3057\uFF08\u76F4\u8FD11-2\u65E5\u306E\u77ED\u3044\u671F\u9593\u3092\u4F7F\u7528\uFF09\u3001\u751F\u30A4\u30D9\u30F3\u30C8\u3092\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u3057\u3066\u5229\u7528\u53EF\u80FD\u306A\u30A4\u30D9\u30F3\u30C8\u30BF\u30A4\u30D7\u3068\u30D7\u30ED\u30D1\u30C6\u30A3\u3092\u78BA\u8A8D
484
+ 3. connector_mixpanel_request \u3067 POST {queryBase}/engage \u3092\u547C\u3073\u51FA\u3057\u3001\u30E6\u30FC\u30B6\u30FC\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u3092\u7167\u4F1A\u3057\u3066\u30E6\u30FC\u30B6\u30FC\u30D7\u30ED\u30D1\u30C6\u30A3\u3092\u628A\u63E1
458
485
  \u6CE8\u610F: Query API\u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8\uFF08insights\u3001funnels\u3001retention\uFF09\u306FMixpanel\u5185\u306E\u65E2\u5B58\u30EC\u30DD\u30FC\u30C8\u306Ebookmark_id\u307E\u305F\u306Ffunnel_id\u304C\u5FC5\u8981\u3067\u3059\u3002\u30A2\u30C9\u30DB\u30C3\u30AF\u5206\u6790\u304C\u5FC5\u8981\u306A\u5834\u5408\u306F\u3001Export API\u3067\u751F\u30A4\u30D9\u30F3\u30C8\u3092\u53D6\u5F97\u3057\u3001\u30B3\u30FC\u30C9\u4E0A\u3067\u96C6\u8A08\u3057\u3066\u304F\u3060\u3055\u3044\u3002`
459
486
  }
460
487
  });
@@ -730,7 +757,7 @@ var mixpanelConnector = new ConnectorPlugin({
730
757
  systemPrompt: {
731
758
  en: `### Tools
732
759
 
733
- - \`mixpanel_request\`: The only way to call the Mixpanel REST API. Use it for exporting raw events, querying insights/funnels/retention reports, and querying user profiles. Authentication (Basic auth with Service Account username + secret) is configured automatically. The project_id query parameter is appended automatically. Provide the full URL including query parameters \u2014 the base URL varies by region and endpoint type.
760
+ - \`connector_mixpanel_request\`: The only way to call the Mixpanel REST API. Use it for exporting raw events, querying insights/funnels/retention reports, and querying user profiles. Authentication (Basic auth with Service Account username + secret) is configured automatically. The project_id query parameter is appended automatically. Provide the full URL including query parameters \u2014 the base URL varies by region and endpoint type.
734
761
 
735
762
  ### Business Logic
736
763
 
@@ -789,7 +816,7 @@ export default async function handler(c: Context) {
789
816
  IMPORTANT: The Insights endpoint requires a bookmark_id from an existing report in the Mixpanel UI. For ad-hoc event analysis, use the Export API to retrieve raw events and aggregate them in code. The Export API is the most flexible and universally accessible endpoint.`,
790
817
  ja: `### \u30C4\u30FC\u30EB
791
818
 
792
- - \`mixpanel_request\`: Mixpanel REST API\u3092\u547C\u3073\u51FA\u3059\u552F\u4E00\u306E\u624B\u6BB5\u3067\u3059\u3002\u751F\u30A4\u30D9\u30F3\u30C8\u306E\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u3001\u30A4\u30F3\u30B5\u30A4\u30C8/\u30D5\u30A1\u30CD\u30EB/\u30EA\u30C6\u30F3\u30B7\u30E7\u30F3\u30EC\u30DD\u30FC\u30C8\u306E\u7167\u4F1A\u3001\u30E6\u30FC\u30B6\u30FC\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u306E\u7167\u4F1A\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002\u8A8D\u8A3C\uFF08Service Account\u306E\u30E6\u30FC\u30B6\u30FC\u540D+\u30B7\u30FC\u30AF\u30EC\u30C3\u30C8\u306B\u3088\u308BBasic\u8A8D\u8A3C\uFF09\u306F\u81EA\u52D5\u7684\u306B\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002project_id\u30AF\u30A8\u30EA\u30D1\u30E9\u30E1\u30FC\u30BF\u306F\u81EA\u52D5\u7684\u306B\u4ED8\u52A0\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\u30EA\u30FC\u30B8\u30E7\u30F3\u3068\u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8\u30BF\u30A4\u30D7\u306B\u3088\u3063\u3066\u7570\u306A\u308A\u307E\u3059\u3002
819
+ - \`connector_mixpanel_request\`: Mixpanel REST API\u3092\u547C\u3073\u51FA\u3059\u552F\u4E00\u306E\u624B\u6BB5\u3067\u3059\u3002\u751F\u30A4\u30D9\u30F3\u30C8\u306E\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u3001\u30A4\u30F3\u30B5\u30A4\u30C8/\u30D5\u30A1\u30CD\u30EB/\u30EA\u30C6\u30F3\u30B7\u30E7\u30F3\u30EC\u30DD\u30FC\u30C8\u306E\u7167\u4F1A\u3001\u30E6\u30FC\u30B6\u30FC\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u306E\u7167\u4F1A\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002\u8A8D\u8A3C\uFF08Service Account\u306E\u30E6\u30FC\u30B6\u30FC\u540D+\u30B7\u30FC\u30AF\u30EC\u30C3\u30C8\u306B\u3088\u308BBasic\u8A8D\u8A3C\uFF09\u306F\u81EA\u52D5\u7684\u306B\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002project_id\u30AF\u30A8\u30EA\u30D1\u30E9\u30E1\u30FC\u30BF\u306F\u81EA\u52D5\u7684\u306B\u4ED8\u52A0\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\u30EA\u30FC\u30B8\u30E7\u30F3\u3068\u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8\u30BF\u30A4\u30D7\u306B\u3088\u3063\u3066\u7570\u306A\u308A\u307E\u3059\u3002
793
820
 
794
821
  ### Business Logic
795
822
 
@@ -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.
@@ -362,7 +364,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
362
364
  /**
363
365
  * Create tools for connections that belong to this connector.
364
366
  * Filters connections by connectorKey internally.
365
- * Returns tools keyed as `${connectorKey}_${toolName}`.
367
+ * Returns tools keyed as `connector_${connectorKey}_${toolName}`.
366
368
  */
367
369
  createTools(connections, config, opts) {
368
370
  const myConnections = connections.filter(
@@ -372,7 +374,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
372
374
  for (const t of Object.values(this.tools)) {
373
375
  const tool = t.createTool(myConnections, config);
374
376
  const originalToModelOutput = tool.toModelOutput;
375
- result[`${this.connectorKey}_${t.name}`] = {
377
+ result[`connector_${this.connectorKey}_${t.name}`] = {
376
378
  ...tool,
377
379
  toModelOutput: async (options) => {
378
380
  if (!originalToModelOutput) {
@@ -428,19 +430,34 @@ async function runSetupFlow(flow, params, ctx, config) {
428
430
  };
429
431
  let state = flow.initialState();
430
432
  let answerIdx = 0;
433
+ const pendingParameterUpdates = [];
431
434
  for (const step of flow.steps) {
432
435
  const ans = ctx.answers[answerIdx];
433
436
  if (ans && ans.questionSlug === step.slug) {
434
437
  state = step.applyAnswer(state, ans.answer);
438
+ if (step.toParameterUpdates) {
439
+ pendingParameterUpdates.push(...step.toParameterUpdates(state));
440
+ }
435
441
  answerIdx += 1;
436
442
  continue;
437
443
  }
444
+ const resolvedAllowFreeText = step.allowFreeText !== void 0 ? step.allowFreeText : true;
438
445
  if (step.type === "text") {
446
+ if (step.fetchOptions) {
447
+ const options2 = await step.fetchOptions(state, runtime);
448
+ if (options2.length === 0) {
449
+ continue;
450
+ }
451
+ }
439
452
  return {
440
453
  type: "nextQuestion",
441
454
  questionSlug: step.slug,
442
455
  question: step.question[ctx.language],
443
- questionType: "text"
456
+ questionType: "text",
457
+ allowFreeText: resolvedAllowFreeText,
458
+ ...pendingParameterUpdates.length > 0 && {
459
+ parameterUpdates: pendingParameterUpdates
460
+ }
444
461
  };
445
462
  }
446
463
  const options = step.fetchOptions ? await step.fetchOptions(state, runtime) : [];
@@ -452,11 +469,21 @@ async function runSetupFlow(flow, params, ctx, config) {
452
469
  questionSlug: step.slug,
453
470
  question: step.question[ctx.language],
454
471
  questionType: step.type,
455
- options
472
+ options,
473
+ allowFreeText: resolvedAllowFreeText,
474
+ ...pendingParameterUpdates.length > 0 && {
475
+ parameterUpdates: pendingParameterUpdates
476
+ }
456
477
  };
457
478
  }
458
479
  const dataInvestigationResult = await flow.finalize(state, runtime);
459
- return { type: "fulfilled", dataInvestigationResult };
480
+ return {
481
+ type: "fulfilled",
482
+ dataInvestigationResult,
483
+ ...pendingParameterUpdates.length > 0 && {
484
+ parameterUpdates: pendingParameterUpdates
485
+ }
486
+ };
460
487
  }
461
488
  async function resolveSetupSelection(params) {
462
489
  const { selected, allSentinel, fetchAll, limit } = params;
@@ -477,13 +504,13 @@ var AUTH_TYPES = {
477
504
  // ../connectors/src/connectors/monday/setup.ts
478
505
  var mondayOnboarding = new ConnectorOnboarding({
479
506
  dataOverviewInstructions: {
480
- en: `1. Call monday_request with query \`{ me { id name email account { id name } } }\` to verify the token and identify the account
481
- 2. Call monday_request with query \`{ boards(limit: 10) { id name state board_kind workspace { id name } } }\` to list boards
482
- 3. For a target board, call monday_request with query \`{ boards(ids: [BOARD_ID]) { id name columns { id title type settings_str } } }\` to inspect column definitions
507
+ en: `1. Call connector_monday_request with query \`{ me { id name email account { id name } } }\` to verify the token and identify the account
508
+ 2. Call connector_monday_request with query \`{ boards(limit: 10) { id name state board_kind workspace { id name } } }\` to list boards
509
+ 3. For a target board, call connector_monday_request with query \`{ boards(ids: [BOARD_ID]) { id name columns { id title type settings_str } } }\` to inspect column definitions
483
510
  4. Sample items with \`{ boards(ids: [BOARD_ID]) { items_page(limit: 5) { cursor items { id name created_at updated_at column_values { id text value } } } } }\`
484
511
  5. Explore other resources (workspaces, users, tags) as needed`,
485
- ja: `1. monday_request \u3067\u30AF\u30A8\u30EA \`{ me { id name email account { id name } } }\` \u3092\u547C\u3073\u51FA\u3057\u3001\u30C8\u30FC\u30AF\u30F3\u306E\u691C\u8A3C\u3068\u30A2\u30AB\u30A6\u30F3\u30C8\u306E\u78BA\u8A8D
486
- 2. monday_request \u3067\u30AF\u30A8\u30EA \`{ boards(limit: 10) { id name state board_kind workspace { id name } } }\` \u3092\u547C\u3073\u51FA\u3057\u3001\u30DC\u30FC\u30C9\u4E00\u89A7\u3092\u53D6\u5F97
512
+ ja: `1. connector_monday_request \u3067\u30AF\u30A8\u30EA \`{ me { id name email account { id name } } }\` \u3092\u547C\u3073\u51FA\u3057\u3001\u30C8\u30FC\u30AF\u30F3\u306E\u691C\u8A3C\u3068\u30A2\u30AB\u30A6\u30F3\u30C8\u306E\u78BA\u8A8D
513
+ 2. connector_monday_request \u3067\u30AF\u30A8\u30EA \`{ boards(limit: 10) { id name state board_kind workspace { id name } } }\` \u3092\u547C\u3073\u51FA\u3057\u3001\u30DC\u30FC\u30C9\u4E00\u89A7\u3092\u53D6\u5F97
487
514
  3. \u5BFE\u8C61\u30DC\u30FC\u30C9\u306B\u5BFE\u3057\u3066 \`{ boards(ids: [BOARD_ID]) { id name columns { id title type settings_str } } }\` \u3092\u547C\u3073\u51FA\u3057\u3001\u30AB\u30E9\u30E0\u5B9A\u7FA9\u3092\u78BA\u8A8D
488
515
  4. \`{ boards(ids: [BOARD_ID]) { items_page(limit: 5) { cursor items { id name created_at updated_at column_values { id text value } } } } }\` \u3067\u30A2\u30A4\u30C6\u30E0\u3092\u30B5\u30F3\u30D7\u30EA\u30F3\u30B0
489
516
  5. \u5FC5\u8981\u306B\u5FDC\u3058\u3066\u4ED6\u306E\u30EA\u30BD\u30FC\u30B9\uFF08workspaces\u3001users\u3001tags\uFF09\u3092\u63A2\u7D22`
@@ -746,7 +773,7 @@ var mondayConnector = new ConnectorPlugin({
746
773
  systemPrompt: {
747
774
  en: `### Tools
748
775
 
749
- - \`monday_request\`: The only way to call the monday.com GraphQL API. Use it to query and mutate all monday.com resources: boards, items, groups, columns, column values, users, workspaces, tags, teams, and updates. Authentication is configured automatically. monday.com's API is GraphQL-only \u2014 send a query string and optional variables. Items on a board are paginated with cursor-based \`items_page(limit, cursor)\`; boards/users/workspaces use page-based \`limit\`/\`page\`. IDs are passed as the GraphQL \`ID\` scalar (string).
776
+ - \`connector_monday_request\`: The only way to call the monday.com GraphQL API. Use it to query and mutate all monday.com resources: boards, items, groups, columns, column values, users, workspaces, tags, teams, and updates. Authentication is configured automatically. monday.com's API is GraphQL-only \u2014 send a query string and optional variables. Items on a board are paginated with cursor-based \`items_page(limit, cursor)\`; boards/users/workspaces use page-based \`limit\`/\`page\`. IDs are passed as the GraphQL \`ID\` scalar (string).
750
777
 
751
778
  ### Business Logic
752
779
 
@@ -836,7 +863,7 @@ const items = res.data?.boards?.[0]?.items_page?.items; // always undefined!
836
863
  - Some fields (e.g. \`board.tags\`) are only populated for boards that explicitly use them.`,
837
864
  ja: `### \u30C4\u30FC\u30EB
838
865
 
839
- - \`monday_request\`: monday.com GraphQL API\u3092\u547C\u3073\u51FA\u3059\u552F\u4E00\u306E\u624B\u6BB5\u3067\u3059\u3002\u30DC\u30FC\u30C9\u3001\u30A2\u30A4\u30C6\u30E0\u3001\u30B0\u30EB\u30FC\u30D7\u3001\u30AB\u30E9\u30E0\u3001\u30AB\u30E9\u30E0\u5024\u3001\u30E6\u30FC\u30B6\u30FC\u3001\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u3001\u30BF\u30B0\u3001\u30C1\u30FC\u30E0\u3001\u30A2\u30C3\u30D7\u30C7\u30FC\u30C8\u306A\u3069\u3059\u3079\u3066\u306E\u30EA\u30BD\u30FC\u30B9\u306E\u30AF\u30A8\u30EA\u3068\u30DF\u30E5\u30FC\u30C6\u30FC\u30B7\u30E7\u30F3\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002\u8A8D\u8A3C\u306F\u81EA\u52D5\u7684\u306B\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002monday.com \u306E API \u306F GraphQL \u306E\u307F\u3067\u3001\u30AF\u30A8\u30EA\u6587\u5B57\u5217\u3068\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u5909\u6570\u3092\u9001\u4FE1\u3057\u307E\u3059\u3002\u30DC\u30FC\u30C9\u4E0A\u306E\u30A2\u30A4\u30C6\u30E0\u306F\u30AB\u30FC\u30BD\u30EB\u30D9\u30FC\u30B9\u306E \`items_page(limit, cursor)\` \u3067\u30DA\u30FC\u30B8\u30CD\u30FC\u30B7\u30E7\u30F3\u3055\u308C\u3001\u30DC\u30FC\u30C9\uFF0F\u30E6\u30FC\u30B6\u30FC\uFF0F\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u306F\u30DA\u30FC\u30B8\u30D9\u30FC\u30B9\u306E \`limit\`/\`page\` \u3092\u4F7F\u7528\u3057\u307E\u3059\u3002ID \u306F GraphQL \u306E \`ID\` \u30B9\u30AB\u30E9\u30FC\uFF08\u6587\u5B57\u5217\uFF09\u3068\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002
866
+ - \`connector_monday_request\`: monday.com GraphQL API\u3092\u547C\u3073\u51FA\u3059\u552F\u4E00\u306E\u624B\u6BB5\u3067\u3059\u3002\u30DC\u30FC\u30C9\u3001\u30A2\u30A4\u30C6\u30E0\u3001\u30B0\u30EB\u30FC\u30D7\u3001\u30AB\u30E9\u30E0\u3001\u30AB\u30E9\u30E0\u5024\u3001\u30E6\u30FC\u30B6\u30FC\u3001\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u3001\u30BF\u30B0\u3001\u30C1\u30FC\u30E0\u3001\u30A2\u30C3\u30D7\u30C7\u30FC\u30C8\u306A\u3069\u3059\u3079\u3066\u306E\u30EA\u30BD\u30FC\u30B9\u306E\u30AF\u30A8\u30EA\u3068\u30DF\u30E5\u30FC\u30C6\u30FC\u30B7\u30E7\u30F3\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002\u8A8D\u8A3C\u306F\u81EA\u52D5\u7684\u306B\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002monday.com \u306E API \u306F GraphQL \u306E\u307F\u3067\u3001\u30AF\u30A8\u30EA\u6587\u5B57\u5217\u3068\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u5909\u6570\u3092\u9001\u4FE1\u3057\u307E\u3059\u3002\u30DC\u30FC\u30C9\u4E0A\u306E\u30A2\u30A4\u30C6\u30E0\u306F\u30AB\u30FC\u30BD\u30EB\u30D9\u30FC\u30B9\u306E \`items_page(limit, cursor)\` \u3067\u30DA\u30FC\u30B8\u30CD\u30FC\u30B7\u30E7\u30F3\u3055\u308C\u3001\u30DC\u30FC\u30C9\uFF0F\u30E6\u30FC\u30B6\u30FC\uFF0F\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u306F\u30DA\u30FC\u30B8\u30D9\u30FC\u30B9\u306E \`limit\`/\`page\` \u3092\u4F7F\u7528\u3057\u307E\u3059\u3002ID \u306F GraphQL \u306E \`ID\` \u30B9\u30AB\u30E9\u30FC\uFF08\u6587\u5B57\u5217\uFF09\u3068\u3057\u3066\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002
840
867
 
841
868
  ### Business Logic
842
869