@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.
@@ -314,7 +316,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
314
316
  /**
315
317
  * Create tools for connections that belong to this connector.
316
318
  * Filters connections by connectorKey internally.
317
- * Returns tools keyed as `${connectorKey}_${toolName}`.
319
+ * Returns tools keyed as `connector_${connectorKey}_${toolName}`.
318
320
  */
319
321
  createTools(connections, config, opts) {
320
322
  const myConnections = connections.filter(
@@ -324,7 +326,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
324
326
  for (const t of Object.values(this.tools)) {
325
327
  const tool = t.createTool(myConnections, config);
326
328
  const originalToModelOutput = tool.toModelOutput;
327
- result[`${this.connectorKey}_${t.name}`] = {
329
+ result[`connector_${this.connectorKey}_${t.name}`] = {
328
330
  ...tool,
329
331
  toModelOutput: async (options) => {
330
332
  if (!originalToModelOutput) {
@@ -380,19 +382,34 @@ async function runSetupFlow(flow, params, ctx, config) {
380
382
  };
381
383
  let state = flow.initialState();
382
384
  let answerIdx = 0;
385
+ const pendingParameterUpdates = [];
383
386
  for (const step of flow.steps) {
384
387
  const ans = ctx.answers[answerIdx];
385
388
  if (ans && ans.questionSlug === step.slug) {
386
389
  state = step.applyAnswer(state, ans.answer);
390
+ if (step.toParameterUpdates) {
391
+ pendingParameterUpdates.push(...step.toParameterUpdates(state));
392
+ }
387
393
  answerIdx += 1;
388
394
  continue;
389
395
  }
396
+ const resolvedAllowFreeText = step.allowFreeText !== void 0 ? step.allowFreeText : true;
390
397
  if (step.type === "text") {
398
+ if (step.fetchOptions) {
399
+ const options2 = await step.fetchOptions(state, runtime);
400
+ if (options2.length === 0) {
401
+ continue;
402
+ }
403
+ }
391
404
  return {
392
405
  type: "nextQuestion",
393
406
  questionSlug: step.slug,
394
407
  question: step.question[ctx.language],
395
- questionType: "text"
408
+ questionType: "text",
409
+ allowFreeText: resolvedAllowFreeText,
410
+ ...pendingParameterUpdates.length > 0 && {
411
+ parameterUpdates: pendingParameterUpdates
412
+ }
396
413
  };
397
414
  }
398
415
  const options = step.fetchOptions ? await step.fetchOptions(state, runtime) : [];
@@ -404,11 +421,21 @@ async function runSetupFlow(flow, params, ctx, config) {
404
421
  questionSlug: step.slug,
405
422
  question: step.question[ctx.language],
406
423
  questionType: step.type,
407
- options
424
+ options,
425
+ allowFreeText: resolvedAllowFreeText,
426
+ ...pendingParameterUpdates.length > 0 && {
427
+ parameterUpdates: pendingParameterUpdates
428
+ }
408
429
  };
409
430
  }
410
431
  const dataInvestigationResult = await flow.finalize(state, runtime);
411
- return { type: "fulfilled", dataInvestigationResult };
432
+ return {
433
+ type: "fulfilled",
434
+ dataInvestigationResult,
435
+ ...pendingParameterUpdates.length > 0 && {
436
+ parameterUpdates: pendingParameterUpdates
437
+ }
438
+ };
412
439
  }
413
440
  async function resolveSetupSelection(params) {
414
441
  const { selected, allSentinel, fetchAll, limit } = params;
@@ -459,7 +486,7 @@ var influxdbOnboarding = new ConnectorOnboarding({
459
486
  dataOverviewInstructions: {
460
487
  en: `The instance may be either InfluxDB 3 (supports SQL) or InfluxDB 2 (Flux only; includes InfluxDB Cloud on '*.cloud2.influxdata.com'). Detect the variant first, then pick the matching endpoints.
461
488
 
462
- 1. Probe for InfluxDB 3: call influxdb_request with POST /api/v3/query_sql, body { "db": "<database>", "q": "SELECT 1" }
489
+ 1. Probe for InfluxDB 3: call connector_influxdb_request with POST /api/v3/query_sql, body { "db": "<database>", "q": "SELECT 1" }
463
490
  - 200 with JSON rows \u2192 InfluxDB 3. Continue with SQL.
464
491
  - 405 Method Not Allowed, or an HTML body like "<html>...405 Not Allowed..." \u2192 InfluxDB 2. Fall back to Flux (step 3).
465
492
  2. InfluxDB 3 data overview:
@@ -471,7 +498,7 @@ var influxdbOnboarding = new ConnectorOnboarding({
471
498
  - If the Organization parameter was not provided but v3 probing failed, ask the user to set it using updateConnectionParameters before continuing.`,
472
499
  ja: `\u63A5\u7D9A\u5148\u306F InfluxDB 3\uFF08SQL \u5BFE\u5FDC\uFF09\u3068 InfluxDB 2\uFF08Flux \u306E\u307F\u3002\`*.cloud2.influxdata.com\` \u306E InfluxDB Cloud \u3092\u542B\u3080\uFF09\u306E\u3069\u3061\u3089\u306E\u53EF\u80FD\u6027\u3082\u3042\u308A\u307E\u3059\u3002\u307E\u305A\u30D0\u30EA\u30A2\u30F3\u30C8\u3092\u5224\u5225\u3057\u3001\u305D\u308C\u306B\u5408\u3046\u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002
473
500
 
474
- 1. InfluxDB 3 \u306E\u5224\u5225: influxdb_request \u3067 POST /api/v3/query_sql\u3001body { "db": "<database>", "q": "SELECT 1" } \u3092\u5B9F\u884C
501
+ 1. InfluxDB 3 \u306E\u5224\u5225: connector_influxdb_request \u3067 POST /api/v3/query_sql\u3001body { "db": "<database>", "q": "SELECT 1" } \u3092\u5B9F\u884C
475
502
  - 200 + JSON \u884C\u304C\u8FD4\u308B \u2192 InfluxDB 3\u3002\u305D\u306E\u307E\u307E SQL \u3067\u7D9A\u884C\u3002
476
503
  - 405 Method Not Allowed\u3001\u307E\u305F\u306F "<html>...405 Not Allowed..." \u306E\u3088\u3046\u306A HTML \u672C\u6587\u304C\u8FD4\u308B \u2192 InfluxDB 2\u3002Flux \u306B\u30D5\u30A9\u30FC\u30EB\u30D0\u30C3\u30AF\uFF08\u624B\u9806 3\uFF09\u3002
477
504
  2. InfluxDB 3 \u306E\u5834\u5408\u306E\u30C7\u30FC\u30BF\u6982\u8981:
@@ -848,13 +875,13 @@ var influxdbConnector = new ConnectorPlugin({
848
875
 
849
876
  The configured instance may be **InfluxDB 3** (supports SQL via \`/api/v3/query_sql\`) or **InfluxDB 2** (Flux only; includes InfluxDB Cloud on \`*.cloud2.influxdata.com\`). Always probe first, then use the matching endpoints:
850
877
 
851
- 1. Call \`influxdb_request\` POST \`/api/v3/query_sql\` with body \`{ "db": "<database>", "q": "SELECT 1" }\`
878
+ 1. Call \`connector_influxdb_request\` POST \`/api/v3/query_sql\` with body \`{ "db": "<database>", "q": "SELECT 1" }\`
852
879
  2. 200 + JSON rows \u2192 InfluxDB 3. Use SQL endpoints.
853
880
  3. 405 Method Not Allowed or HTML body (e.g. \`<html>...405 Not Allowed...</html>\`) \u2192 InfluxDB 2. Use Flux via \`/api/v2/query?org={org}\`. Require the \`org\` parameter; if missing, ask the user via \`updateConnectionParameters\`.
854
881
 
855
882
  ### Tools
856
883
 
857
- - \`influxdb_request\`: The only way to call the InfluxDB HTTP API. Use it to run SQL / InfluxQL / Flux queries, write line protocol, and inspect buckets / databases. Authentication (\`Authorization: Token {token}\`) and the instance URL are configured automatically. On InfluxDB 3 prefer SQL (\`POST /api/v3/query_sql\`) \u2014 it returns JSON rows that are directly usable. On InfluxDB 2 use Flux (\`POST /api/v2/query?org={org}\`) \u2014 the response is annotated CSV. Writes use \`POST /api/v3/write_lp?db={db}\` (v3) or \`POST /api/v2/write?org={org}&bucket={bucket}\` (v2) with a line-protocol body and \`contentType\` set to \`text/plain; charset=utf-8\`.
884
+ - \`connector_influxdb_request\`: The only way to call the InfluxDB HTTP API. Use it to run SQL / InfluxQL / Flux queries, write line protocol, and inspect buckets / databases. Authentication (\`Authorization: Token {token}\`) and the instance URL are configured automatically. On InfluxDB 3 prefer SQL (\`POST /api/v3/query_sql\`) \u2014 it returns JSON rows that are directly usable. On InfluxDB 2 use Flux (\`POST /api/v2/query?org={org}\`) \u2014 the response is annotated CSV. Writes use \`POST /api/v3/write_lp?db={db}\` (v3) or \`POST /api/v2/write?org={org}&bucket={bucket}\` (v2) with a line-protocol body and \`contentType\` set to \`text/plain; charset=utf-8\`.
858
885
 
859
886
  ### Business Logic
860
887
 
@@ -919,13 +946,13 @@ export default async function handler(c: Context) {
919
946
 
920
947
  \u63A5\u7D9A\u5148\u306F **InfluxDB 3**\uFF08\`/api/v3/query_sql\` \u306E SQL \u5BFE\u5FDC\uFF09\u3068 **InfluxDB 2**\uFF08Flux \u306E\u307F\u3002\`*.cloud2.influxdata.com\` \u306E InfluxDB Cloud \u3092\u542B\u3080\uFF09\u306E\u3069\u3061\u3089\u306E\u53EF\u80FD\u6027\u3082\u3042\u308A\u307E\u3059\u3002\u5FC5\u305A\u6700\u521D\u306B\u30D7\u30ED\u30FC\u30D6\u3057\u3066\u304B\u3089\u3001\u5BFE\u5FDC\u3059\u308B\u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044:
921
948
 
922
- 1. \`influxdb_request\` \u3067 POST \`/api/v3/query_sql\`\u3001body \`{ "db": "<database>", "q": "SELECT 1" }\` \u3092\u547C\u3073\u51FA\u3059
949
+ 1. \`connector_influxdb_request\` \u3067 POST \`/api/v3/query_sql\`\u3001body \`{ "db": "<database>", "q": "SELECT 1" }\` \u3092\u547C\u3073\u51FA\u3059
923
950
  2. 200 + JSON \u884C \u2192 InfluxDB 3\u3002SQL \u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8\u3092\u4F7F\u7528\u3002
924
951
  3. 405 Method Not Allowed\u3001\u307E\u305F\u306F HTML \u672C\u6587\uFF08\u4F8B: \`<html>...405 Not Allowed...</html>\`\uFF09\u2192 InfluxDB 2\u3002\`/api/v2/query?org={org}\` \u304B\u3089 Flux \u3092\u4F7F\u7528\u3002\`org\` \u30D1\u30E9\u30E1\u30FC\u30BF\u5FC5\u9808\u3002\u672A\u8A2D\u5B9A\u306A\u3089 \`updateConnectionParameters\` \u3067\u30E6\u30FC\u30B6\u30FC\u306B\u8A2D\u5B9A\u3092\u4F9D\u983C\u3059\u308B\u3002
925
952
 
926
953
  ### \u30C4\u30FC\u30EB
927
954
 
928
- - \`influxdb_request\`: InfluxDB HTTP API \u3092\u547C\u3073\u51FA\u3059\u552F\u4E00\u306E\u624B\u6BB5\u3067\u3059\u3002SQL / InfluxQL / Flux \u30AF\u30A8\u30EA\u306E\u5B9F\u884C\u3001line protocol \u66F8\u304D\u8FBC\u307F\u3001bucket / database \u306E\u78BA\u8A8D\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002\u8A8D\u8A3C\uFF08\`Authorization: Token {token}\`\uFF09\u3068 instance URL \u306F\u81EA\u52D5\u3067\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002InfluxDB 3 \u3067\u306F SQL (\`POST /api/v3/query_sql\`) \u304C JSON \u884C\u3092\u8FD4\u3059\u305F\u3081\u6700\u3082\u6271\u3044\u3084\u3059\u3044\u3067\u3059\u3002InfluxDB 2 \u3067\u306F Flux (\`POST /api/v2/query?org={org}\`) \u3092\u4F7F\u7528\u3057\u3001\u30EC\u30B9\u30DD\u30F3\u30B9\u306F\u6CE8\u91C8\u4ED8\u304D CSV \u3067\u3059\u3002\u66F8\u304D\u8FBC\u307F\u306F \`POST /api/v3/write_lp?db={db}\` (v3) \u307E\u305F\u306F \`POST /api/v2/write?org={org}&bucket={bucket}\` (v2) \u306B line protocol \u3092\u9001\u308A\u307E\u3059\uFF08\`contentType\` \u306F \`text/plain; charset=utf-8\`\uFF09\u3002
955
+ - \`connector_influxdb_request\`: InfluxDB HTTP API \u3092\u547C\u3073\u51FA\u3059\u552F\u4E00\u306E\u624B\u6BB5\u3067\u3059\u3002SQL / InfluxQL / Flux \u30AF\u30A8\u30EA\u306E\u5B9F\u884C\u3001line protocol \u66F8\u304D\u8FBC\u307F\u3001bucket / database \u306E\u78BA\u8A8D\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002\u8A8D\u8A3C\uFF08\`Authorization: Token {token}\`\uFF09\u3068 instance URL \u306F\u81EA\u52D5\u3067\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002InfluxDB 3 \u3067\u306F SQL (\`POST /api/v3/query_sql\`) \u304C JSON \u884C\u3092\u8FD4\u3059\u305F\u3081\u6700\u3082\u6271\u3044\u3084\u3059\u3044\u3067\u3059\u3002InfluxDB 2 \u3067\u306F Flux (\`POST /api/v2/query?org={org}\`) \u3092\u4F7F\u7528\u3057\u3001\u30EC\u30B9\u30DD\u30F3\u30B9\u306F\u6CE8\u91C8\u4ED8\u304D CSV \u3067\u3059\u3002\u66F8\u304D\u8FBC\u307F\u306F \`POST /api/v3/write_lp?db={db}\` (v3) \u307E\u305F\u306F \`POST /api/v2/write?org={org}&bucket={bucket}\` (v2) \u306B line protocol \u3092\u9001\u308A\u307E\u3059\uFF08\`contentType\` \u306F \`text/plain; charset=utf-8\`\uFF09\u3002
929
956
 
930
957
  ### Business Logic
931
958
 
@@ -114,7 +114,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
114
114
  /**
115
115
  * Create tools for connections that belong to this connector.
116
116
  * Filters connections by connectorKey internally.
117
- * Returns tools keyed as `${connectorKey}_${toolName}`.
117
+ * Returns tools keyed as `connector_${connectorKey}_${toolName}`.
118
118
  */
119
119
  createTools(connections, config, opts) {
120
120
  const myConnections = connections.filter(
@@ -124,7 +124,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
124
124
  for (const t of Object.values(this.tools)) {
125
125
  const tool = t.createTool(myConnections, config);
126
126
  const originalToModelOutput = tool.toModelOutput;
127
- result[`${this.connectorKey}_${t.name}`] = {
127
+ result[`connector_${this.connectorKey}_${t.name}`] = {
128
128
  ...tool,
129
129
  toModelOutput: async (options) => {
130
130
  if (!originalToModelOutput) {
@@ -180,19 +180,34 @@ async function runSetupFlow(flow, params, ctx, config) {
180
180
  };
181
181
  let state = flow.initialState();
182
182
  let answerIdx = 0;
183
+ const pendingParameterUpdates = [];
183
184
  for (const step of flow.steps) {
184
185
  const ans = ctx.answers[answerIdx];
185
186
  if (ans && ans.questionSlug === step.slug) {
186
187
  state = step.applyAnswer(state, ans.answer);
188
+ if (step.toParameterUpdates) {
189
+ pendingParameterUpdates.push(...step.toParameterUpdates(state));
190
+ }
187
191
  answerIdx += 1;
188
192
  continue;
189
193
  }
194
+ const resolvedAllowFreeText = step.allowFreeText !== void 0 ? step.allowFreeText : true;
190
195
  if (step.type === "text") {
196
+ if (step.fetchOptions) {
197
+ const options2 = await step.fetchOptions(state, runtime);
198
+ if (options2.length === 0) {
199
+ continue;
200
+ }
201
+ }
191
202
  return {
192
203
  type: "nextQuestion",
193
204
  questionSlug: step.slug,
194
205
  question: step.question[ctx.language],
195
- questionType: "text"
206
+ questionType: "text",
207
+ allowFreeText: resolvedAllowFreeText,
208
+ ...pendingParameterUpdates.length > 0 && {
209
+ parameterUpdates: pendingParameterUpdates
210
+ }
196
211
  };
197
212
  }
198
213
  const options = step.fetchOptions ? await step.fetchOptions(state, runtime) : [];
@@ -204,11 +219,21 @@ async function runSetupFlow(flow, params, ctx, config) {
204
219
  questionSlug: step.slug,
205
220
  question: step.question[ctx.language],
206
221
  questionType: step.type,
207
- options
222
+ options,
223
+ allowFreeText: resolvedAllowFreeText,
224
+ ...pendingParameterUpdates.length > 0 && {
225
+ parameterUpdates: pendingParameterUpdates
226
+ }
208
227
  };
209
228
  }
210
229
  const dataInvestigationResult = await flow.finalize(state, runtime);
211
- return { type: "fulfilled", dataInvestigationResult };
230
+ return {
231
+ type: "fulfilled",
232
+ dataInvestigationResult,
233
+ ...pendingParameterUpdates.length > 0 && {
234
+ parameterUpdates: pendingParameterUpdates
235
+ }
236
+ };
212
237
  }
213
238
  async function resolveSetupSelection(params) {
214
239
  const { selected, allSentinel, fetchAll, limit } = params;
@@ -372,14 +397,14 @@ var intercomOauthOnboarding = new ConnectorOnboarding({
372
397
  - \u30C4\u30FC\u30EB\u9593\u306F1\u6587\u3060\u3051\u66F8\u3044\u3066\u5373\u6B21\u306E\u30C4\u30FC\u30EB\u547C\u3073\u51FA\u3057\u3002\u4E0D\u8981\u306A\u8AAC\u660E\u306F\u7701\u7565\u3057\u3001\u52B9\u7387\u7684\u306B\u9032\u3081\u308B`
373
398
  },
374
399
  dataOverviewInstructions: {
375
- en: `1. Call intercom-oauth_request with GET /contacts?per_page=5 to explore contacts structure
376
- 2. Call intercom-oauth_request with GET /conversations?per_page=5 to explore conversations structure
377
- 3. Call intercom-oauth_request with GET /data_attributes?model=contact to list contact data attributes
378
- 4. Call intercom-oauth_request with GET /companies?per_page=5 to explore company structure`,
379
- ja: `1. intercom-oauth_request \u3067 GET /contacts?per_page=5 \u3092\u547C\u3073\u51FA\u3057\u3001\u30B3\u30F3\u30BF\u30AF\u30C8\u306E\u69CB\u9020\u3092\u78BA\u8A8D
380
- 2. intercom-oauth_request \u3067 GET /conversations?per_page=5 \u3092\u547C\u3073\u51FA\u3057\u3001\u4F1A\u8A71\u306E\u69CB\u9020\u3092\u78BA\u8A8D
381
- 3. intercom-oauth_request \u3067 GET /data_attributes?model=contact \u3092\u547C\u3073\u51FA\u3057\u3001\u30B3\u30F3\u30BF\u30AF\u30C8\u306E\u30C7\u30FC\u30BF\u5C5E\u6027\u3092\u78BA\u8A8D
382
- 4. intercom-oauth_request \u3067 GET /companies?per_page=5 \u3092\u547C\u3073\u51FA\u3057\u3001\u4F01\u696D\u306E\u69CB\u9020\u3092\u78BA\u8A8D`
400
+ en: `1. Call connector_intercom-oauth_request with GET /contacts?per_page=5 to explore contacts structure
401
+ 2. Call connector_intercom-oauth_request with GET /conversations?per_page=5 to explore conversations structure
402
+ 3. Call connector_intercom-oauth_request with GET /data_attributes?model=contact to list contact data attributes
403
+ 4. Call connector_intercom-oauth_request with GET /companies?per_page=5 to explore company structure`,
404
+ ja: `1. connector_intercom-oauth_request \u3067 GET /contacts?per_page=5 \u3092\u547C\u3073\u51FA\u3057\u3001\u30B3\u30F3\u30BF\u30AF\u30C8\u306E\u69CB\u9020\u3092\u78BA\u8A8D
405
+ 2. connector_intercom-oauth_request \u3067 GET /conversations?per_page=5 \u3092\u547C\u3073\u51FA\u3057\u3001\u4F1A\u8A71\u306E\u69CB\u9020\u3092\u78BA\u8A8D
406
+ 3. connector_intercom-oauth_request \u3067 GET /data_attributes?model=contact \u3092\u547C\u3073\u51FA\u3057\u3001\u30B3\u30F3\u30BF\u30AF\u30C8\u306E\u30C7\u30FC\u30BF\u5C5E\u6027\u3092\u78BA\u8A8D
407
+ 4. connector_intercom-oauth_request \u3067 GET /companies?per_page=5 \u3092\u547C\u3073\u51FA\u3057\u3001\u4F01\u696D\u306E\u69CB\u9020\u3092\u78BA\u8A8D`
383
408
  }
384
409
  });
385
410
 
@@ -468,6 +493,66 @@ var intercomOauthSetupFlow = {
468
493
  );
469
494
  }
470
495
  sections.push("");
496
+ if (targetScopes.includes("conversations")) {
497
+ try {
498
+ const convRes = await apiFetch(
499
+ rt.config.proxyFetch,
500
+ "/conversations?per_page=5&order=desc&sort=updated_at"
501
+ );
502
+ if (convRes.ok) {
503
+ const convData = await convRes.json();
504
+ const conversations = convData.conversations ?? [];
505
+ if (conversations.length > 0) {
506
+ sections.push("### Recent conversations (sample)", "");
507
+ sections.push("| ID | State | Subject | Created |");
508
+ sections.push("|----|-------|---------|---------|");
509
+ for (const c of conversations.slice(0, 5)) {
510
+ const id = c.id ?? "-";
511
+ const state2 = c.state ?? (c.open ? "open" : "closed");
512
+ const subject = (c.source?.subject ?? "-").replace(/\|/g, "\\|").slice(0, 50);
513
+ const created = typeof c.created_at === "number" ? new Date(c.created_at * 1e3).toISOString().slice(0, 10) : "-";
514
+ sections.push(
515
+ `| ${id} | ${state2} | ${subject} | ${created} |`
516
+ );
517
+ }
518
+ sections.push("");
519
+ }
520
+ }
521
+ } catch {
522
+ }
523
+ }
524
+ if (targetScopes.includes("contacts")) {
525
+ try {
526
+ const contactRes = await apiFetch(
527
+ rt.config.proxyFetch,
528
+ "/contacts?per_page=50"
529
+ );
530
+ if (contactRes.ok) {
531
+ const contactData = await contactRes.json();
532
+ const contacts = contactData.data ?? [];
533
+ if (contacts.length > 0) {
534
+ const roleCounts = {};
535
+ for (const c of contacts) {
536
+ const role = c.role ?? "unknown";
537
+ roleCounts[role] = (roleCounts[role] ?? 0) + 1;
538
+ }
539
+ sections.push(
540
+ "### Contact type breakdown (from recent contacts)",
541
+ ""
542
+ );
543
+ sections.push("| Role | Count |");
544
+ sections.push("|------|-------|");
545
+ for (const [role, cnt] of Object.entries(roleCounts).sort(
546
+ (a, b) => b[1] - a[1]
547
+ )) {
548
+ sections.push(`| ${role} | ${cnt} |`);
549
+ }
550
+ sections.push("");
551
+ }
552
+ }
553
+ } catch {
554
+ }
555
+ }
471
556
  return sections.join("\n");
472
557
  }
473
558
  };
@@ -499,7 +584,7 @@ var intercomOauthConnector = new ConnectorPlugin({
499
584
  systemPrompt: {
500
585
  en: `### Tools
501
586
 
502
- - \`intercom-oauth_request\`: The only way to call the Intercom API. Use it to query contacts, conversations, companies, articles, tags, segments, and more. Authentication is configured automatically via OAuth. The Intercom-Version header is set automatically. Intercom uses cursor-based pagination with the \`starting_after\` parameter from \`pages.next.starting_after\` in the response.
587
+ - \`connector_intercom-oauth_request\`: The only way to call the Intercom API. Use it to query contacts, conversations, companies, articles, tags, segments, and more. Authentication is configured automatically via OAuth. The Intercom-Version header is set automatically. Intercom uses cursor-based pagination with the \`starting_after\` parameter from \`pages.next.starting_after\` in the response.
503
588
 
504
589
  ### Intercom API Reference
505
590
 
@@ -557,7 +642,7 @@ const data = await res.json();
557
642
  \`\`\``,
558
643
  ja: `### \u30C4\u30FC\u30EB
559
644
 
560
- - \`intercom-oauth_request\`: Intercom API\u3092\u547C\u3073\u51FA\u3059\u552F\u4E00\u306E\u624B\u6BB5\u3067\u3059\u3002\u30B3\u30F3\u30BF\u30AF\u30C8\u3001\u4F1A\u8A71\u3001\u4F01\u696D\u3001\u8A18\u4E8B\u3001\u30BF\u30B0\u3001\u30BB\u30B0\u30E1\u30F3\u30C8\u306A\u3069\u306E\u30AF\u30A8\u30EA\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002OAuth\u7D4C\u7531\u3067\u8A8D\u8A3C\u306F\u81EA\u52D5\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002Intercom-Version\u30D8\u30C3\u30C0\u30FC\u3082\u81EA\u52D5\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002Intercom\u306F\u30EC\u30B9\u30DD\u30F3\u30B9\u306E \`pages.next.starting_after\` \u304B\u3089\u306E \`starting_after\` \u30D1\u30E9\u30E1\u30FC\u30BF\u306B\u3088\u308B\u30AB\u30FC\u30BD\u30EB\u30D9\u30FC\u30B9\u306E\u30DA\u30FC\u30B8\u30CD\u30FC\u30B7\u30E7\u30F3\u3092\u4F7F\u7528\u3057\u307E\u3059\u3002
645
+ - \`connector_intercom-oauth_request\`: Intercom API\u3092\u547C\u3073\u51FA\u3059\u552F\u4E00\u306E\u624B\u6BB5\u3067\u3059\u3002\u30B3\u30F3\u30BF\u30AF\u30C8\u3001\u4F1A\u8A71\u3001\u4F01\u696D\u3001\u8A18\u4E8B\u3001\u30BF\u30B0\u3001\u30BB\u30B0\u30E1\u30F3\u30C8\u306A\u3069\u306E\u30AF\u30A8\u30EA\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002OAuth\u7D4C\u7531\u3067\u8A8D\u8A3C\u306F\u81EA\u52D5\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002Intercom-Version\u30D8\u30C3\u30C0\u30FC\u3082\u81EA\u52D5\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002Intercom\u306F\u30EC\u30B9\u30DD\u30F3\u30B9\u306E \`pages.next.starting_after\` \u304B\u3089\u306E \`starting_after\` \u30D1\u30E9\u30E1\u30FC\u30BF\u306B\u3088\u308B\u30AB\u30FC\u30BD\u30EB\u30D9\u30FC\u30B9\u306E\u30DA\u30FC\u30B8\u30CD\u30FC\u30B7\u30E7\u30F3\u3092\u4F7F\u7528\u3057\u307E\u3059\u3002
561
646
 
562
647
  ### Intercom API \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9
563
648
 
@@ -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.
@@ -273,7 +275,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
273
275
  /**
274
276
  * Create tools for connections that belong to this connector.
275
277
  * Filters connections by connectorKey internally.
276
- * Returns tools keyed as `${connectorKey}_${toolName}`.
278
+ * Returns tools keyed as `connector_${connectorKey}_${toolName}`.
277
279
  */
278
280
  createTools(connections, config, opts) {
279
281
  const myConnections = connections.filter(
@@ -283,7 +285,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
283
285
  for (const t of Object.values(this.tools)) {
284
286
  const tool = t.createTool(myConnections, config);
285
287
  const originalToModelOutput = tool.toModelOutput;
286
- result[`${this.connectorKey}_${t.name}`] = {
288
+ result[`connector_${this.connectorKey}_${t.name}`] = {
287
289
  ...tool,
288
290
  toModelOutput: async (options) => {
289
291
  if (!originalToModelOutput) {
@@ -339,19 +341,34 @@ async function runSetupFlow(flow, params, ctx, config) {
339
341
  };
340
342
  let state = flow.initialState();
341
343
  let answerIdx = 0;
344
+ const pendingParameterUpdates = [];
342
345
  for (const step of flow.steps) {
343
346
  const ans = ctx.answers[answerIdx];
344
347
  if (ans && ans.questionSlug === step.slug) {
345
348
  state = step.applyAnswer(state, ans.answer);
349
+ if (step.toParameterUpdates) {
350
+ pendingParameterUpdates.push(...step.toParameterUpdates(state));
351
+ }
346
352
  answerIdx += 1;
347
353
  continue;
348
354
  }
355
+ const resolvedAllowFreeText = step.allowFreeText !== void 0 ? step.allowFreeText : true;
349
356
  if (step.type === "text") {
357
+ if (step.fetchOptions) {
358
+ const options2 = await step.fetchOptions(state, runtime);
359
+ if (options2.length === 0) {
360
+ continue;
361
+ }
362
+ }
350
363
  return {
351
364
  type: "nextQuestion",
352
365
  questionSlug: step.slug,
353
366
  question: step.question[ctx.language],
354
- questionType: "text"
367
+ questionType: "text",
368
+ allowFreeText: resolvedAllowFreeText,
369
+ ...pendingParameterUpdates.length > 0 && {
370
+ parameterUpdates: pendingParameterUpdates
371
+ }
355
372
  };
356
373
  }
357
374
  const options = step.fetchOptions ? await step.fetchOptions(state, runtime) : [];
@@ -363,11 +380,21 @@ async function runSetupFlow(flow, params, ctx, config) {
363
380
  questionSlug: step.slug,
364
381
  question: step.question[ctx.language],
365
382
  questionType: step.type,
366
- options
383
+ options,
384
+ allowFreeText: resolvedAllowFreeText,
385
+ ...pendingParameterUpdates.length > 0 && {
386
+ parameterUpdates: pendingParameterUpdates
387
+ }
367
388
  };
368
389
  }
369
390
  const dataInvestigationResult = await flow.finalize(state, runtime);
370
- return { type: "fulfilled", dataInvestigationResult };
391
+ return {
392
+ type: "fulfilled",
393
+ dataInvestigationResult,
394
+ ...pendingParameterUpdates.length > 0 && {
395
+ parameterUpdates: pendingParameterUpdates
396
+ }
397
+ };
371
398
  }
372
399
  async function resolveSetupSelection(params) {
373
400
  const { selected, allSentinel, fetchAll, limit } = params;
@@ -388,14 +415,14 @@ var AUTH_TYPES = {
388
415
  // ../connectors/src/connectors/intercom/setup.ts
389
416
  var intercomOnboarding = new ConnectorOnboarding({
390
417
  dataOverviewInstructions: {
391
- en: `1. Call intercom_request with GET /contacts?per_page=5 to explore contacts structure
392
- 2. Call intercom_request with GET /conversations?per_page=5 to explore conversations structure
393
- 3. Call intercom_request with GET /data_attributes?model=contact to list contact data attributes
394
- 4. Call intercom_request with GET /companies?per_page=5 to explore company structure`,
395
- ja: `1. intercom_request \u3067 GET /contacts?per_page=5 \u3092\u547C\u3073\u51FA\u3057\u3001\u30B3\u30F3\u30BF\u30AF\u30C8\u306E\u69CB\u9020\u3092\u78BA\u8A8D
396
- 2. intercom_request \u3067 GET /conversations?per_page=5 \u3092\u547C\u3073\u51FA\u3057\u3001\u4F1A\u8A71\u306E\u69CB\u9020\u3092\u78BA\u8A8D
397
- 3. intercom_request \u3067 GET /data_attributes?model=contact \u3092\u547C\u3073\u51FA\u3057\u3001\u30B3\u30F3\u30BF\u30AF\u30C8\u306E\u30C7\u30FC\u30BF\u5C5E\u6027\u3092\u78BA\u8A8D
398
- 4. intercom_request \u3067 GET /companies?per_page=5 \u3092\u547C\u3073\u51FA\u3057\u3001\u4F01\u696D\u306E\u69CB\u9020\u3092\u78BA\u8A8D`
418
+ en: `1. Call connector_intercom_request with GET /contacts?per_page=5 to explore contacts structure
419
+ 2. Call connector_intercom_request with GET /conversations?per_page=5 to explore conversations structure
420
+ 3. Call connector_intercom_request with GET /data_attributes?model=contact to list contact data attributes
421
+ 4. Call connector_intercom_request with GET /companies?per_page=5 to explore company structure`,
422
+ ja: `1. connector_intercom_request \u3067 GET /contacts?per_page=5 \u3092\u547C\u3073\u51FA\u3057\u3001\u30B3\u30F3\u30BF\u30AF\u30C8\u306E\u69CB\u9020\u3092\u78BA\u8A8D
423
+ 2. connector_intercom_request \u3067 GET /conversations?per_page=5 \u3092\u547C\u3073\u51FA\u3057\u3001\u4F1A\u8A71\u306E\u69CB\u9020\u3092\u78BA\u8A8D
424
+ 3. connector_intercom_request \u3067 GET /data_attributes?model=contact \u3092\u547C\u3073\u51FA\u3057\u3001\u30B3\u30F3\u30BF\u30AF\u30C8\u306E\u30C7\u30FC\u30BF\u5C5E\u6027\u3092\u78BA\u8A8D
425
+ 4. connector_intercom_request \u3067 GET /companies?per_page=5 \u3092\u547C\u3073\u51FA\u3057\u3001\u4F01\u696D\u306E\u69CB\u9020\u3092\u78BA\u8A8D`
399
426
  }
400
427
  });
401
428
 
@@ -592,7 +619,7 @@ var intercomConnector = new ConnectorPlugin({
592
619
  systemPrompt: {
593
620
  en: `### Tools
594
621
 
595
- - \`intercom_request\`: The only way to call the Intercom API. Use it to query contacts, conversations, companies, articles, tags, segments, and more. Authentication (Bearer token) and API version header (Intercom-Version: 2.11) are configured automatically. Intercom uses cursor-based pagination with the \`starting_after\` parameter from \`pages.next.starting_after\` in the response. Use search endpoints (POST) for complex queries with filters.
622
+ - \`connector_intercom_request\`: The only way to call the Intercom API. Use it to query contacts, conversations, companies, articles, tags, segments, and more. Authentication (Bearer token) and API version header (Intercom-Version: 2.11) are configured automatically. Intercom uses cursor-based pagination with the \`starting_after\` parameter from \`pages.next.starting_after\` in the response. Use search endpoints (POST) for complex queries with filters.
596
623
 
597
624
  ### Business Logic
598
625
 
@@ -688,7 +715,7 @@ export default async function handler(c: Context) {
688
715
  - Date fields use Unix timestamps`,
689
716
  ja: `### \u30C4\u30FC\u30EB
690
717
 
691
- - \`intercom_request\`: Intercom API\u3092\u547C\u3073\u51FA\u3059\u552F\u4E00\u306E\u624B\u6BB5\u3067\u3059\u3002\u30B3\u30F3\u30BF\u30AF\u30C8\u3001\u4F1A\u8A71\u3001\u4F01\u696D\u3001\u8A18\u4E8B\u3001\u30BF\u30B0\u3001\u30BB\u30B0\u30E1\u30F3\u30C8\u306A\u3069\u306E\u30AF\u30A8\u30EA\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002\u8A8D\u8A3C\uFF08Bearer\u30C8\u30FC\u30AF\u30F3\uFF09\u3068API\u30D0\u30FC\u30B8\u30E7\u30F3\u30D8\u30C3\u30C0\u30FC\uFF08Intercom-Version: 2.11\uFF09\u306F\u81EA\u52D5\u7684\u306B\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002Intercom\u306F\u30EC\u30B9\u30DD\u30F3\u30B9\u306E \`pages.next.starting_after\` \u304B\u3089\u306E \`starting_after\` \u30D1\u30E9\u30E1\u30FC\u30BF\u306B\u3088\u308B\u30AB\u30FC\u30BD\u30EB\u30D9\u30FC\u30B9\u306E\u30DA\u30FC\u30B8\u30CD\u30FC\u30B7\u30E7\u30F3\u3092\u4F7F\u7528\u3057\u307E\u3059\u3002\u8907\u96D1\u306A\u30AF\u30A8\u30EA\u306B\u306Fsearch\u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8\uFF08POST\uFF09\u3092\u4F7F\u7528\u3057\u307E\u3059\u3002
718
+ - \`connector_intercom_request\`: Intercom API\u3092\u547C\u3073\u51FA\u3059\u552F\u4E00\u306E\u624B\u6BB5\u3067\u3059\u3002\u30B3\u30F3\u30BF\u30AF\u30C8\u3001\u4F1A\u8A71\u3001\u4F01\u696D\u3001\u8A18\u4E8B\u3001\u30BF\u30B0\u3001\u30BB\u30B0\u30E1\u30F3\u30C8\u306A\u3069\u306E\u30AF\u30A8\u30EA\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002\u8A8D\u8A3C\uFF08Bearer\u30C8\u30FC\u30AF\u30F3\uFF09\u3068API\u30D0\u30FC\u30B8\u30E7\u30F3\u30D8\u30C3\u30C0\u30FC\uFF08Intercom-Version: 2.11\uFF09\u306F\u81EA\u52D5\u7684\u306B\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002Intercom\u306F\u30EC\u30B9\u30DD\u30F3\u30B9\u306E \`pages.next.starting_after\` \u304B\u3089\u306E \`starting_after\` \u30D1\u30E9\u30E1\u30FC\u30BF\u306B\u3088\u308B\u30AB\u30FC\u30BD\u30EB\u30D9\u30FC\u30B9\u306E\u30DA\u30FC\u30B8\u30CD\u30FC\u30B7\u30E7\u30F3\u3092\u4F7F\u7528\u3057\u307E\u3059\u3002\u8907\u96D1\u306A\u30AF\u30A8\u30EA\u306B\u306Fsearch\u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8\uFF08POST\uFF09\u3092\u4F7F\u7528\u3057\u307E\u3059\u3002
692
719
 
693
720
  ### Business Logic
694
721
 
@@ -21,6 +21,7 @@ var init_parameter_definition = __esm({
21
21
  type;
22
22
  secret;
23
23
  required;
24
+ isDeprecated;
24
25
  constructor(config) {
25
26
  this.slug = config.slug;
26
27
  this.name = config.name;
@@ -29,6 +30,7 @@ var init_parameter_definition = __esm({
29
30
  this.type = config.type;
30
31
  this.secret = config.secret;
31
32
  this.required = config.required;
33
+ this.isDeprecated = config.isDeprecated ?? false;
32
34
  }
33
35
  /**
34
36
  * Get the parameter value from a ConnectorConnectionObject.
@@ -1021,7 +1023,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
1021
1023
  /**
1022
1024
  * Create tools for connections that belong to this connector.
1023
1025
  * Filters connections by connectorKey internally.
1024
- * Returns tools keyed as `${connectorKey}_${toolName}`.
1026
+ * Returns tools keyed as `connector_${connectorKey}_${toolName}`.
1025
1027
  */
1026
1028
  createTools(connections, config, opts) {
1027
1029
  const myConnections = connections.filter(
@@ -1031,7 +1033,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
1031
1033
  for (const t of Object.values(this.tools)) {
1032
1034
  const tool = t.createTool(myConnections, config);
1033
1035
  const originalToModelOutput = tool.toModelOutput;
1034
- result[`${this.connectorKey}_${t.name}`] = {
1036
+ result[`connector_${this.connectorKey}_${t.name}`] = {
1035
1037
  ...tool,
1036
1038
  toModelOutput: async (options) => {
1037
1039
  if (!originalToModelOutput) {
@@ -1087,19 +1089,34 @@ async function runSetupFlow(flow, params, ctx, config) {
1087
1089
  };
1088
1090
  let state = flow.initialState();
1089
1091
  let answerIdx = 0;
1092
+ const pendingParameterUpdates = [];
1090
1093
  for (const step of flow.steps) {
1091
1094
  const ans = ctx.answers[answerIdx];
1092
1095
  if (ans && ans.questionSlug === step.slug) {
1093
1096
  state = step.applyAnswer(state, ans.answer);
1097
+ if (step.toParameterUpdates) {
1098
+ pendingParameterUpdates.push(...step.toParameterUpdates(state));
1099
+ }
1094
1100
  answerIdx += 1;
1095
1101
  continue;
1096
1102
  }
1103
+ const resolvedAllowFreeText = step.allowFreeText !== void 0 ? step.allowFreeText : true;
1097
1104
  if (step.type === "text") {
1105
+ if (step.fetchOptions) {
1106
+ const options2 = await step.fetchOptions(state, runtime);
1107
+ if (options2.length === 0) {
1108
+ continue;
1109
+ }
1110
+ }
1098
1111
  return {
1099
1112
  type: "nextQuestion",
1100
1113
  questionSlug: step.slug,
1101
1114
  question: step.question[ctx.language],
1102
- questionType: "text"
1115
+ questionType: "text",
1116
+ allowFreeText: resolvedAllowFreeText,
1117
+ ...pendingParameterUpdates.length > 0 && {
1118
+ parameterUpdates: pendingParameterUpdates
1119
+ }
1103
1120
  };
1104
1121
  }
1105
1122
  const options = step.fetchOptions ? await step.fetchOptions(state, runtime) : [];
@@ -1111,11 +1128,21 @@ async function runSetupFlow(flow, params, ctx, config) {
1111
1128
  questionSlug: step.slug,
1112
1129
  question: step.question[ctx.language],
1113
1130
  questionType: step.type,
1114
- options
1131
+ options,
1132
+ allowFreeText: resolvedAllowFreeText,
1133
+ ...pendingParameterUpdates.length > 0 && {
1134
+ parameterUpdates: pendingParameterUpdates
1135
+ }
1115
1136
  };
1116
1137
  }
1117
1138
  const dataInvestigationResult = await flow.finalize(state, runtime);
1118
- return { type: "fulfilled", dataInvestigationResult };
1139
+ return {
1140
+ type: "fulfilled",
1141
+ dataInvestigationResult,
1142
+ ...pendingParameterUpdates.length > 0 && {
1143
+ parameterUpdates: pendingParameterUpdates
1144
+ }
1145
+ };
1119
1146
  }
1120
1147
  async function resolveSetupSelection(params) {
1121
1148
  const { selected, allSentinel, fetchAll, limit } = params;
@@ -1144,13 +1171,13 @@ init_utils2();
1144
1171
  // ../connectors/src/connectors/jdbc/setup.ts
1145
1172
  var jdbcOnboarding = new ConnectorOnboarding({
1146
1173
  dataOverviewInstructions: {
1147
- en: `1. Use \`jdbc_executeQuery\` to detect the database flavor: \`SELECT version()\` (works on PostgreSQL/MySQL/MariaDB)
1174
+ en: `1. Use \`connector_jdbc_executeQuery\` to detect the database flavor: \`SELECT version()\` (works on PostgreSQL/MySQL/MariaDB)
1148
1175
  2. List tables:
1149
1176
  - PostgreSQL: \`SELECT table_name FROM information_schema.tables WHERE table_schema = 'public'\`
1150
1177
  - MySQL/MariaDB: \`SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA = DATABASE()\`
1151
1178
  3. For key tables, fetch column info from \`information_schema.columns\`
1152
1179
  4. Sample up to 3 tables with \`SELECT * FROM <table_name> LIMIT 5\` if column info alone is insufficient`,
1153
- ja: `1. \`jdbc_executeQuery\` \u3067DB\u30D5\u30EC\u30FC\u30D0\u30FC\u3092\u5224\u5B9A: \`SELECT version()\` (PostgreSQL/MySQL/MariaDB \u3067\u52D5\u4F5C)
1180
+ ja: `1. \`connector_jdbc_executeQuery\` \u3067DB\u30D5\u30EC\u30FC\u30D0\u30FC\u3092\u5224\u5B9A: \`SELECT version()\` (PostgreSQL/MySQL/MariaDB \u3067\u52D5\u4F5C)
1154
1181
  2. \u30C6\u30FC\u30D6\u30EB\u4E00\u89A7\u3092\u53D6\u5F97:
1155
1182
  - PostgreSQL: \`SELECT table_name FROM information_schema.tables WHERE table_schema = 'public'\`
1156
1183
  - MySQL/MariaDB: \`SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA = DATABASE()\`
@@ -1670,7 +1697,7 @@ var jdbcConnector = new ConnectorPlugin({
1670
1697
  systemPrompt: {
1671
1698
  en: `### Tools
1672
1699
 
1673
- - \`jdbc_executeQuery\`: Executes a SQL query through a JDBC URL and returns rows. The connector dispatches by URL prefix to the matching native driver, so use the dialect that matches the connection. Use this for schema exploration via \`information_schema\` (or vendor equivalent) and for sampling data. See the SQL Reference below.
1700
+ - \`connector_jdbc_executeQuery\`: Executes a SQL query through a JDBC URL and returns rows. The connector dispatches by URL prefix to the matching native driver, so use the dialect that matches the connection. Use this for schema exploration via \`information_schema\` (or vendor equivalent) and for sampling data. See the SQL Reference below.
1674
1701
 
1675
1702
  ### Business Logic
1676
1703
 
@@ -1702,7 +1729,7 @@ Explicitly **not** supported via this connector \u2014 use the dedicated connect
1702
1729
  The platform's server-logic schema inference may wrap your query as \`SELECT * FROM (<inner>) AS _sq LIMIT N\` (PostgreSQL/MySQL syntax). For PostgreSQL / Redshift / MySQL routes this executes natively. For \`jdbc:sqlserver://\` and \`jdbc:oracle:thin:\` routes, the connector detects this exact wrapper at \`query()\` time, executes \`<inner>\` directly via the dialect-specific driver, and slices the first N rows in JS. You do not need to handle this \u2014 but in queries **you author**, do not use \`LIMIT\` for the SQL Server / Oracle routes; use \`TOP\` / \`FETCH FIRST\` as listed above.`,
1703
1730
  ja: `### \u30C4\u30FC\u30EB
1704
1731
 
1705
- - \`jdbc_executeQuery\`: JDBC URL \u7D4C\u7531\u3067 SQL \u30AF\u30A8\u30EA\u3092\u5B9F\u884C\u3057\u3001\u884C\u30C7\u30FC\u30BF\u3092\u8FD4\u3057\u307E\u3059\u3002\u30B3\u30CD\u30AF\u30BF\u306F URL \u30D7\u30EC\u30D5\u30A3\u30C3\u30AF\u30B9\u304B\u3089\u5BFE\u5FDC\u3059\u308B\u30CD\u30A4\u30C6\u30A3\u30D6\u30C9\u30E9\u30A4\u30D0\u3078\u632F\u308A\u5206\u3051\u308B\u305F\u3081\u3001\u63A5\u7D9A\u5148\u306B\u5408\u3063\u305F\u65B9\u8A00\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002\`information_schema\`\uFF08\u307E\u305F\u306F\u5404 DB \u306E\u540C\u7B49\u306E\u30E1\u30BF\u30C7\u30FC\u30BF\u30D3\u30E5\u30FC\uFF09\u3092\u4F7F\u3063\u305F\u30B9\u30AD\u30FC\u30DE\u63A2\u7D22\u3084\u30C7\u30FC\u30BF\u306E\u30B5\u30F3\u30D7\u30EA\u30F3\u30B0\u306B\u4F7F\u3044\u307E\u3059\u3002\u4E0B\u90E8\u306E\u300CSQL \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9\u300D\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002
1732
+ - \`connector_jdbc_executeQuery\`: JDBC URL \u7D4C\u7531\u3067 SQL \u30AF\u30A8\u30EA\u3092\u5B9F\u884C\u3057\u3001\u884C\u30C7\u30FC\u30BF\u3092\u8FD4\u3057\u307E\u3059\u3002\u30B3\u30CD\u30AF\u30BF\u306F URL \u30D7\u30EC\u30D5\u30A3\u30C3\u30AF\u30B9\u304B\u3089\u5BFE\u5FDC\u3059\u308B\u30CD\u30A4\u30C6\u30A3\u30D6\u30C9\u30E9\u30A4\u30D0\u3078\u632F\u308A\u5206\u3051\u308B\u305F\u3081\u3001\u63A5\u7D9A\u5148\u306B\u5408\u3063\u305F\u65B9\u8A00\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002\`information_schema\`\uFF08\u307E\u305F\u306F\u5404 DB \u306E\u540C\u7B49\u306E\u30E1\u30BF\u30C7\u30FC\u30BF\u30D3\u30E5\u30FC\uFF09\u3092\u4F7F\u3063\u305F\u30B9\u30AD\u30FC\u30DE\u63A2\u7D22\u3084\u30C7\u30FC\u30BF\u306E\u30B5\u30F3\u30D7\u30EA\u30F3\u30B0\u306B\u4F7F\u3044\u307E\u3059\u3002\u4E0B\u90E8\u306E\u300CSQL \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9\u300D\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002
1706
1733
 
1707
1734
  ### Business Logic
1708
1735