@squadbase/vite-server 0.1.17-dev.d4fff69 → 0.1.17-dev.e4768d1

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 (78) hide show
  1. package/dist/cli/index.js +4786 -3023
  2. package/dist/connectors/airtable-oauth.js +39 -15
  3. package/dist/connectors/airtable.js +86 -15
  4. package/dist/connectors/amplitude.js +39 -15
  5. package/dist/connectors/anthropic.js +39 -15
  6. package/dist/connectors/asana.js +39 -15
  7. package/dist/connectors/attio.js +39 -15
  8. package/dist/connectors/aws-billing.js +39 -15
  9. package/dist/connectors/azure-sql.js +275 -15
  10. package/dist/connectors/backlog-api-key.js +39 -15
  11. package/dist/connectors/clickup.js +39 -15
  12. package/dist/connectors/cosmosdb.js +39 -15
  13. package/dist/connectors/customerio.js +39 -15
  14. package/dist/connectors/dbt.js +39 -15
  15. package/dist/connectors/freshdesk.js +39 -15
  16. package/dist/connectors/freshsales.js +39 -15
  17. package/dist/connectors/freshservice.js +39 -15
  18. package/dist/connectors/gamma.js +39 -15
  19. package/dist/connectors/gemini.js +39 -15
  20. package/dist/connectors/github.js +39 -15
  21. package/dist/connectors/gmail-oauth.js +32 -13
  22. package/dist/connectors/gmail.js +39 -15
  23. package/dist/connectors/google-ads.js +39 -15
  24. package/dist/connectors/google-analytics-oauth.js +39 -15
  25. package/dist/connectors/google-analytics.js +39 -15
  26. package/dist/connectors/google-audit-log.js +39 -15
  27. package/dist/connectors/google-calendar-oauth.js +39 -15
  28. package/dist/connectors/google-calendar.js +39 -15
  29. package/dist/connectors/google-docs.js +32 -13
  30. package/dist/connectors/google-drive.js +32 -13
  31. package/dist/connectors/google-search-console-oauth.js +39 -15
  32. package/dist/connectors/google-sheets.js +138 -195
  33. package/dist/connectors/google-slides.js +32 -13
  34. package/dist/connectors/grafana.js +39 -15
  35. package/dist/connectors/hackernews.js +32 -13
  36. package/dist/connectors/hubspot-oauth.js +32 -13
  37. package/dist/connectors/hubspot.js +39 -15
  38. package/dist/connectors/influxdb.js +39 -15
  39. package/dist/connectors/intercom-oauth.js +32 -13
  40. package/dist/connectors/intercom.js +39 -15
  41. package/dist/connectors/jdbc.js +39 -15
  42. package/dist/connectors/jira-api-key.js +39 -15
  43. package/dist/connectors/kintone-api-token.js +39 -15
  44. package/dist/connectors/kintone.js +128 -15
  45. package/dist/connectors/linear.js +39 -15
  46. package/dist/connectors/linkedin-ads.js +39 -15
  47. package/dist/connectors/mailchimp-oauth.js +39 -15
  48. package/dist/connectors/mailchimp.js +39 -15
  49. package/dist/connectors/meta-ads-oauth.js +39 -15
  50. package/dist/connectors/meta-ads.js +39 -15
  51. package/dist/connectors/mixpanel.js +39 -15
  52. package/dist/connectors/monday.js +39 -15
  53. package/dist/connectors/mongodb.js +39 -15
  54. package/dist/connectors/notion-oauth.js +32 -13
  55. package/dist/connectors/notion.js +84 -15
  56. package/dist/connectors/openai.js +39 -15
  57. package/dist/connectors/oracle.js +277 -15
  58. package/dist/connectors/outlook-oauth.js +32 -13
  59. package/dist/connectors/powerbi-oauth.js +32 -13
  60. package/dist/connectors/salesforce.js +108 -15
  61. package/dist/connectors/semrush.js +39 -15
  62. package/dist/connectors/sentry.js +39 -15
  63. package/dist/connectors/shopify-oauth.js +32 -13
  64. package/dist/connectors/shopify.js +39 -15
  65. package/dist/connectors/sqlserver.js +275 -15
  66. package/dist/connectors/stripe-api-key.js +39 -15
  67. package/dist/connectors/stripe-oauth.js +32 -13
  68. package/dist/connectors/supabase.js +284 -15
  69. package/dist/connectors/tableau.js +39 -15
  70. package/dist/connectors/tiktok-ads.js +39 -15
  71. package/dist/connectors/wix-store.js +39 -15
  72. package/dist/connectors/x.js +39 -15
  73. package/dist/connectors/zendesk-oauth.js +32 -13
  74. package/dist/connectors/zendesk.js +39 -15
  75. package/dist/index.js +4832 -3034
  76. package/dist/main.js +4832 -3034
  77. package/dist/vite-plugin.js +4786 -3023
  78. package/package.json +4 -4
@@ -1,6 +1,11 @@
1
1
  var __getOwnPropNames = Object.getOwnPropertyNames;
2
- var __esm = (fn, res) => function __init() {
3
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
2
+ var __esm = (fn, res, err) => function __init() {
3
+ if (err) throw err[0];
4
+ try {
5
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
6
+ } catch (e) {
7
+ throw err = [e], e;
8
+ }
4
9
  };
5
10
 
6
11
  // ../connectors/src/parameter-definition.ts
@@ -236,6 +241,15 @@ var ConnectorPlugin = class _ConnectorPlugin {
236
241
  * `runSetupFlow` from `setup-flow.ts`.
237
242
  */
238
243
  setup;
244
+ /**
245
+ * 統一 introspection。SQL DB の `information_schema` / `SHOW` / `DESCRIBE` や SaaS の
246
+ * メタデータ API といった取得経路の差を吸収し、tables / columns / PK / FK を共通型
247
+ * {@link IntrospectedSchema} へ正規化して返す。取得経路は {@link IntrospectContext} で
248
+ * 抽象化され、SQL DB は `ctx.query`、SaaS は `ctx.proxyFetch` + `ctx.params` を使う。
249
+ * `ctx.profile === true` のときは L2 プロファイル(行数・NULL 率等)も best-effort で埋める。
250
+ * coding-agent の `DataContextIndex` がデータ地図を構築する際に使う。
251
+ */
252
+ introspect;
239
253
  /**
240
254
  * Opt-out of the default "verify before save" behavior on connection
241
255
  * creation. The backend invokes `checkConnection` synchronously while
@@ -250,6 +264,14 @@ var ConnectorPlugin = class _ConnectorPlugin {
250
264
  * the default verify-on-create behavior without opt-in.
251
265
  */
252
266
  skipConnectionCheckOnCreate;
267
+ /**
268
+ * 決定論的な「立ち上げ survey」レシピ(ルールベース prewarm 基盤)。実装した connector は、LLM を使わずに
269
+ * read-only で自分を survey する probe 列(テーブル/列メタデータ → 小サンプル)を宣言する。coding-agent の
270
+ * recon driver がこれを読み、connector ツールの `execute` を直接呼んで結果を seed にする。未実装の connector は
271
+ * driver 側で safely skip される(その connection は listConnections のみ seed)。標準 `information_schema` を
272
+ * 持つ SQL connector は `makeStandardSqlSurveyProbes` を使える。**probe は必ず read-only**。
273
+ */
274
+ surveyProbes;
253
275
  constructor(config) {
254
276
  this.slug = config.slug;
255
277
  this.authType = config.authType;
@@ -267,7 +289,9 @@ var ConnectorPlugin = class _ConnectorPlugin {
267
289
  this.query = config.query;
268
290
  this.checkConnection = config.checkConnection;
269
291
  this.setup = config.setup;
292
+ this.introspect = config.introspect;
270
293
  this.skipConnectionCheckOnCreate = config.skipConnectionCheckOnCreate;
294
+ this.surveyProbes = config.surveyProbes;
271
295
  }
272
296
  get connectorKey() {
273
297
  return _ConnectorPlugin.deriveKey(this.slug, this.authType);
@@ -305,25 +329,25 @@ var ConnectorPlugin = class _ConnectorPlugin {
305
329
  if (authType) return `${slug}-${authType}`;
306
330
  const LEGACY_NULL_AUTH_TYPE_MAP = {
307
331
  // user-password
308
- "postgresql": "user-password",
309
- "mysql": "user-password",
310
- "clickhouse": "user-password",
311
- "kintone": "user-password",
332
+ postgresql: "user-password",
333
+ mysql: "user-password",
334
+ clickhouse: "user-password",
335
+ kintone: "user-password",
312
336
  "squadbase-db": "user-password",
313
337
  // service-account
314
- "snowflake": "service-account",
315
- "bigquery": "service-account",
338
+ snowflake: "service-account",
339
+ bigquery: "service-account",
316
340
  "google-analytics": "service-account",
317
341
  "google-calendar": "service-account",
318
342
  "aws-athena": "service-account",
319
- "redshift": "service-account",
343
+ redshift: "service-account",
320
344
  // api-key
321
- "databricks": "api-key",
322
- "dbt": "api-key",
323
- "airtable": "api-key",
324
- "openai": "api-key",
325
- "gemini": "api-key",
326
- "anthropic": "api-key",
345
+ databricks: "api-key",
346
+ dbt: "api-key",
347
+ airtable: "api-key",
348
+ openai: "api-key",
349
+ gemini: "api-key",
350
+ anthropic: "api-key",
327
351
  "wix-store": "api-key"
328
352
  };
329
353
  const fallbackAuthType = LEGACY_NULL_AUTH_TYPE_MAP[slug];
@@ -1,7 +1,12 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __getOwnPropNames = Object.getOwnPropertyNames;
3
- var __esm = (fn, res) => function __init() {
4
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
3
+ var __esm = (fn, res, err) => function __init() {
4
+ if (err) throw err[0];
5
+ try {
6
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
7
+ } catch (e) {
8
+ throw err = [e], e;
9
+ }
5
10
  };
6
11
  var __export = (target, all) => {
7
12
  for (var name in all)
@@ -990,6 +995,15 @@ var ConnectorPlugin = class _ConnectorPlugin {
990
995
  * `runSetupFlow` from `setup-flow.ts`.
991
996
  */
992
997
  setup;
998
+ /**
999
+ * 統一 introspection。SQL DB の `information_schema` / `SHOW` / `DESCRIBE` や SaaS の
1000
+ * メタデータ API といった取得経路の差を吸収し、tables / columns / PK / FK を共通型
1001
+ * {@link IntrospectedSchema} へ正規化して返す。取得経路は {@link IntrospectContext} で
1002
+ * 抽象化され、SQL DB は `ctx.query`、SaaS は `ctx.proxyFetch` + `ctx.params` を使う。
1003
+ * `ctx.profile === true` のときは L2 プロファイル(行数・NULL 率等)も best-effort で埋める。
1004
+ * coding-agent の `DataContextIndex` がデータ地図を構築する際に使う。
1005
+ */
1006
+ introspect;
993
1007
  /**
994
1008
  * Opt-out of the default "verify before save" behavior on connection
995
1009
  * creation. The backend invokes `checkConnection` synchronously while
@@ -1004,6 +1018,14 @@ var ConnectorPlugin = class _ConnectorPlugin {
1004
1018
  * the default verify-on-create behavior without opt-in.
1005
1019
  */
1006
1020
  skipConnectionCheckOnCreate;
1021
+ /**
1022
+ * 決定論的な「立ち上げ survey」レシピ(ルールベース prewarm 基盤)。実装した connector は、LLM を使わずに
1023
+ * read-only で自分を survey する probe 列(テーブル/列メタデータ → 小サンプル)を宣言する。coding-agent の
1024
+ * recon driver がこれを読み、connector ツールの `execute` を直接呼んで結果を seed にする。未実装の connector は
1025
+ * driver 側で safely skip される(その connection は listConnections のみ seed)。標準 `information_schema` を
1026
+ * 持つ SQL connector は `makeStandardSqlSurveyProbes` を使える。**probe は必ず read-only**。
1027
+ */
1028
+ surveyProbes;
1007
1029
  constructor(config) {
1008
1030
  this.slug = config.slug;
1009
1031
  this.authType = config.authType;
@@ -1021,7 +1043,9 @@ var ConnectorPlugin = class _ConnectorPlugin {
1021
1043
  this.query = config.query;
1022
1044
  this.checkConnection = config.checkConnection;
1023
1045
  this.setup = config.setup;
1046
+ this.introspect = config.introspect;
1024
1047
  this.skipConnectionCheckOnCreate = config.skipConnectionCheckOnCreate;
1048
+ this.surveyProbes = config.surveyProbes;
1025
1049
  }
1026
1050
  get connectorKey() {
1027
1051
  return _ConnectorPlugin.deriveKey(this.slug, this.authType);
@@ -1059,25 +1083,25 @@ var ConnectorPlugin = class _ConnectorPlugin {
1059
1083
  if (authType) return `${slug}-${authType}`;
1060
1084
  const LEGACY_NULL_AUTH_TYPE_MAP = {
1061
1085
  // user-password
1062
- "postgresql": "user-password",
1063
- "mysql": "user-password",
1064
- "clickhouse": "user-password",
1065
- "kintone": "user-password",
1086
+ postgresql: "user-password",
1087
+ mysql: "user-password",
1088
+ clickhouse: "user-password",
1089
+ kintone: "user-password",
1066
1090
  "squadbase-db": "user-password",
1067
1091
  // service-account
1068
- "snowflake": "service-account",
1069
- "bigquery": "service-account",
1092
+ snowflake: "service-account",
1093
+ bigquery: "service-account",
1070
1094
  "google-analytics": "service-account",
1071
1095
  "google-calendar": "service-account",
1072
1096
  "aws-athena": "service-account",
1073
- "redshift": "service-account",
1097
+ redshift: "service-account",
1074
1098
  // api-key
1075
- "databricks": "api-key",
1076
- "dbt": "api-key",
1077
- "airtable": "api-key",
1078
- "openai": "api-key",
1079
- "gemini": "api-key",
1080
- "anthropic": "api-key",
1099
+ databricks: "api-key",
1100
+ dbt: "api-key",
1101
+ airtable: "api-key",
1102
+ openai: "api-key",
1103
+ gemini: "api-key",
1104
+ anthropic: "api-key",
1081
1105
  "wix-store": "api-key"
1082
1106
  };
1083
1107
  const fallbackAuthType = LEGACY_NULL_AUTH_TYPE_MAP[slug];
@@ -1,6 +1,11 @@
1
1
  var __getOwnPropNames = Object.getOwnPropertyNames;
2
- var __esm = (fn, res) => function __init() {
3
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
2
+ var __esm = (fn, res, err) => function __init() {
3
+ if (err) throw err[0];
4
+ try {
5
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
6
+ } catch (e) {
7
+ throw err = [e], e;
8
+ }
4
9
  };
5
10
 
6
11
  // ../connectors/src/parameter-definition.ts
@@ -185,6 +190,15 @@ var ConnectorPlugin = class _ConnectorPlugin {
185
190
  * `runSetupFlow` from `setup-flow.ts`.
186
191
  */
187
192
  setup;
193
+ /**
194
+ * 統一 introspection。SQL DB の `information_schema` / `SHOW` / `DESCRIBE` や SaaS の
195
+ * メタデータ API といった取得経路の差を吸収し、tables / columns / PK / FK を共通型
196
+ * {@link IntrospectedSchema} へ正規化して返す。取得経路は {@link IntrospectContext} で
197
+ * 抽象化され、SQL DB は `ctx.query`、SaaS は `ctx.proxyFetch` + `ctx.params` を使う。
198
+ * `ctx.profile === true` のときは L2 プロファイル(行数・NULL 率等)も best-effort で埋める。
199
+ * coding-agent の `DataContextIndex` がデータ地図を構築する際に使う。
200
+ */
201
+ introspect;
188
202
  /**
189
203
  * Opt-out of the default "verify before save" behavior on connection
190
204
  * creation. The backend invokes `checkConnection` synchronously while
@@ -199,6 +213,14 @@ var ConnectorPlugin = class _ConnectorPlugin {
199
213
  * the default verify-on-create behavior without opt-in.
200
214
  */
201
215
  skipConnectionCheckOnCreate;
216
+ /**
217
+ * 決定論的な「立ち上げ survey」レシピ(ルールベース prewarm 基盤)。実装した connector は、LLM を使わずに
218
+ * read-only で自分を survey する probe 列(テーブル/列メタデータ → 小サンプル)を宣言する。coding-agent の
219
+ * recon driver がこれを読み、connector ツールの `execute` を直接呼んで結果を seed にする。未実装の connector は
220
+ * driver 側で safely skip される(その connection は listConnections のみ seed)。標準 `information_schema` を
221
+ * 持つ SQL connector は `makeStandardSqlSurveyProbes` を使える。**probe は必ず read-only**。
222
+ */
223
+ surveyProbes;
202
224
  constructor(config) {
203
225
  this.slug = config.slug;
204
226
  this.authType = config.authType;
@@ -216,7 +238,9 @@ var ConnectorPlugin = class _ConnectorPlugin {
216
238
  this.query = config.query;
217
239
  this.checkConnection = config.checkConnection;
218
240
  this.setup = config.setup;
241
+ this.introspect = config.introspect;
219
242
  this.skipConnectionCheckOnCreate = config.skipConnectionCheckOnCreate;
243
+ this.surveyProbes = config.surveyProbes;
220
244
  }
221
245
  get connectorKey() {
222
246
  return _ConnectorPlugin.deriveKey(this.slug, this.authType);
@@ -254,25 +278,25 @@ var ConnectorPlugin = class _ConnectorPlugin {
254
278
  if (authType) return `${slug}-${authType}`;
255
279
  const LEGACY_NULL_AUTH_TYPE_MAP = {
256
280
  // user-password
257
- "postgresql": "user-password",
258
- "mysql": "user-password",
259
- "clickhouse": "user-password",
260
- "kintone": "user-password",
281
+ postgresql: "user-password",
282
+ mysql: "user-password",
283
+ clickhouse: "user-password",
284
+ kintone: "user-password",
261
285
  "squadbase-db": "user-password",
262
286
  // service-account
263
- "snowflake": "service-account",
264
- "bigquery": "service-account",
287
+ snowflake: "service-account",
288
+ bigquery: "service-account",
265
289
  "google-analytics": "service-account",
266
290
  "google-calendar": "service-account",
267
291
  "aws-athena": "service-account",
268
- "redshift": "service-account",
292
+ redshift: "service-account",
269
293
  // api-key
270
- "databricks": "api-key",
271
- "dbt": "api-key",
272
- "airtable": "api-key",
273
- "openai": "api-key",
274
- "gemini": "api-key",
275
- "anthropic": "api-key",
294
+ databricks: "api-key",
295
+ dbt: "api-key",
296
+ airtable: "api-key",
297
+ openai: "api-key",
298
+ gemini: "api-key",
299
+ anthropic: "api-key",
276
300
  "wix-store": "api-key"
277
301
  };
278
302
  const fallbackAuthType = LEGACY_NULL_AUTH_TYPE_MAP[slug];
@@ -1,6 +1,11 @@
1
1
  var __getOwnPropNames = Object.getOwnPropertyNames;
2
- var __esm = (fn, res) => function __init() {
3
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
2
+ var __esm = (fn, res, err) => function __init() {
3
+ if (err) throw err[0];
4
+ try {
5
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
6
+ } catch (e) {
7
+ throw err = [e], e;
8
+ }
4
9
  };
5
10
 
6
11
  // ../connectors/src/parameter-definition.ts
@@ -214,6 +219,15 @@ var ConnectorPlugin = class _ConnectorPlugin {
214
219
  * `runSetupFlow` from `setup-flow.ts`.
215
220
  */
216
221
  setup;
222
+ /**
223
+ * 統一 introspection。SQL DB の `information_schema` / `SHOW` / `DESCRIBE` や SaaS の
224
+ * メタデータ API といった取得経路の差を吸収し、tables / columns / PK / FK を共通型
225
+ * {@link IntrospectedSchema} へ正規化して返す。取得経路は {@link IntrospectContext} で
226
+ * 抽象化され、SQL DB は `ctx.query`、SaaS は `ctx.proxyFetch` + `ctx.params` を使う。
227
+ * `ctx.profile === true` のときは L2 プロファイル(行数・NULL 率等)も best-effort で埋める。
228
+ * coding-agent の `DataContextIndex` がデータ地図を構築する際に使う。
229
+ */
230
+ introspect;
217
231
  /**
218
232
  * Opt-out of the default "verify before save" behavior on connection
219
233
  * creation. The backend invokes `checkConnection` synchronously while
@@ -228,6 +242,14 @@ var ConnectorPlugin = class _ConnectorPlugin {
228
242
  * the default verify-on-create behavior without opt-in.
229
243
  */
230
244
  skipConnectionCheckOnCreate;
245
+ /**
246
+ * 決定論的な「立ち上げ survey」レシピ(ルールベース prewarm 基盤)。実装した connector は、LLM を使わずに
247
+ * read-only で自分を survey する probe 列(テーブル/列メタデータ → 小サンプル)を宣言する。coding-agent の
248
+ * recon driver がこれを読み、connector ツールの `execute` を直接呼んで結果を seed にする。未実装の connector は
249
+ * driver 側で safely skip される(その connection は listConnections のみ seed)。標準 `information_schema` を
250
+ * 持つ SQL connector は `makeStandardSqlSurveyProbes` を使える。**probe は必ず read-only**。
251
+ */
252
+ surveyProbes;
231
253
  constructor(config) {
232
254
  this.slug = config.slug;
233
255
  this.authType = config.authType;
@@ -245,7 +267,9 @@ var ConnectorPlugin = class _ConnectorPlugin {
245
267
  this.query = config.query;
246
268
  this.checkConnection = config.checkConnection;
247
269
  this.setup = config.setup;
270
+ this.introspect = config.introspect;
248
271
  this.skipConnectionCheckOnCreate = config.skipConnectionCheckOnCreate;
272
+ this.surveyProbes = config.surveyProbes;
249
273
  }
250
274
  get connectorKey() {
251
275
  return _ConnectorPlugin.deriveKey(this.slug, this.authType);
@@ -283,25 +307,25 @@ var ConnectorPlugin = class _ConnectorPlugin {
283
307
  if (authType) return `${slug}-${authType}`;
284
308
  const LEGACY_NULL_AUTH_TYPE_MAP = {
285
309
  // user-password
286
- "postgresql": "user-password",
287
- "mysql": "user-password",
288
- "clickhouse": "user-password",
289
- "kintone": "user-password",
310
+ postgresql: "user-password",
311
+ mysql: "user-password",
312
+ clickhouse: "user-password",
313
+ kintone: "user-password",
290
314
  "squadbase-db": "user-password",
291
315
  // service-account
292
- "snowflake": "service-account",
293
- "bigquery": "service-account",
316
+ snowflake: "service-account",
317
+ bigquery: "service-account",
294
318
  "google-analytics": "service-account",
295
319
  "google-calendar": "service-account",
296
320
  "aws-athena": "service-account",
297
- "redshift": "service-account",
321
+ redshift: "service-account",
298
322
  // api-key
299
- "databricks": "api-key",
300
- "dbt": "api-key",
301
- "airtable": "api-key",
302
- "openai": "api-key",
303
- "gemini": "api-key",
304
- "anthropic": "api-key",
323
+ databricks: "api-key",
324
+ dbt: "api-key",
325
+ airtable: "api-key",
326
+ openai: "api-key",
327
+ gemini: "api-key",
328
+ anthropic: "api-key",
305
329
  "wix-store": "api-key"
306
330
  };
307
331
  const fallbackAuthType = LEGACY_NULL_AUTH_TYPE_MAP[slug];
@@ -1,6 +1,11 @@
1
1
  var __getOwnPropNames = Object.getOwnPropertyNames;
2
- var __esm = (fn, res) => function __init() {
3
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
2
+ var __esm = (fn, res, err) => function __init() {
3
+ if (err) throw err[0];
4
+ try {
5
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
6
+ } catch (e) {
7
+ throw err = [e], e;
8
+ }
4
9
  };
5
10
 
6
11
  // ../connectors/src/parameter-definition.ts
@@ -223,6 +228,15 @@ var ConnectorPlugin = class _ConnectorPlugin {
223
228
  * `runSetupFlow` from `setup-flow.ts`.
224
229
  */
225
230
  setup;
231
+ /**
232
+ * 統一 introspection。SQL DB の `information_schema` / `SHOW` / `DESCRIBE` や SaaS の
233
+ * メタデータ API といった取得経路の差を吸収し、tables / columns / PK / FK を共通型
234
+ * {@link IntrospectedSchema} へ正規化して返す。取得経路は {@link IntrospectContext} で
235
+ * 抽象化され、SQL DB は `ctx.query`、SaaS は `ctx.proxyFetch` + `ctx.params` を使う。
236
+ * `ctx.profile === true` のときは L2 プロファイル(行数・NULL 率等)も best-effort で埋める。
237
+ * coding-agent の `DataContextIndex` がデータ地図を構築する際に使う。
238
+ */
239
+ introspect;
226
240
  /**
227
241
  * Opt-out of the default "verify before save" behavior on connection
228
242
  * creation. The backend invokes `checkConnection` synchronously while
@@ -237,6 +251,14 @@ var ConnectorPlugin = class _ConnectorPlugin {
237
251
  * the default verify-on-create behavior without opt-in.
238
252
  */
239
253
  skipConnectionCheckOnCreate;
254
+ /**
255
+ * 決定論的な「立ち上げ survey」レシピ(ルールベース prewarm 基盤)。実装した connector は、LLM を使わずに
256
+ * read-only で自分を survey する probe 列(テーブル/列メタデータ → 小サンプル)を宣言する。coding-agent の
257
+ * recon driver がこれを読み、connector ツールの `execute` を直接呼んで結果を seed にする。未実装の connector は
258
+ * driver 側で safely skip される(その connection は listConnections のみ seed)。標準 `information_schema` を
259
+ * 持つ SQL connector は `makeStandardSqlSurveyProbes` を使える。**probe は必ず read-only**。
260
+ */
261
+ surveyProbes;
240
262
  constructor(config) {
241
263
  this.slug = config.slug;
242
264
  this.authType = config.authType;
@@ -254,7 +276,9 @@ var ConnectorPlugin = class _ConnectorPlugin {
254
276
  this.query = config.query;
255
277
  this.checkConnection = config.checkConnection;
256
278
  this.setup = config.setup;
279
+ this.introspect = config.introspect;
257
280
  this.skipConnectionCheckOnCreate = config.skipConnectionCheckOnCreate;
281
+ this.surveyProbes = config.surveyProbes;
258
282
  }
259
283
  get connectorKey() {
260
284
  return _ConnectorPlugin.deriveKey(this.slug, this.authType);
@@ -292,25 +316,25 @@ var ConnectorPlugin = class _ConnectorPlugin {
292
316
  if (authType) return `${slug}-${authType}`;
293
317
  const LEGACY_NULL_AUTH_TYPE_MAP = {
294
318
  // user-password
295
- "postgresql": "user-password",
296
- "mysql": "user-password",
297
- "clickhouse": "user-password",
298
- "kintone": "user-password",
319
+ postgresql: "user-password",
320
+ mysql: "user-password",
321
+ clickhouse: "user-password",
322
+ kintone: "user-password",
299
323
  "squadbase-db": "user-password",
300
324
  // service-account
301
- "snowflake": "service-account",
302
- "bigquery": "service-account",
325
+ snowflake: "service-account",
326
+ bigquery: "service-account",
303
327
  "google-analytics": "service-account",
304
328
  "google-calendar": "service-account",
305
329
  "aws-athena": "service-account",
306
- "redshift": "service-account",
330
+ redshift: "service-account",
307
331
  // api-key
308
- "databricks": "api-key",
309
- "dbt": "api-key",
310
- "airtable": "api-key",
311
- "openai": "api-key",
312
- "gemini": "api-key",
313
- "anthropic": "api-key",
332
+ databricks: "api-key",
333
+ dbt: "api-key",
334
+ airtable: "api-key",
335
+ openai: "api-key",
336
+ gemini: "api-key",
337
+ anthropic: "api-key",
314
338
  "wix-store": "api-key"
315
339
  };
316
340
  const fallbackAuthType = LEGACY_NULL_AUTH_TYPE_MAP[slug];
@@ -389,6 +413,24 @@ async function resolveSetupSelection(params) {
389
413
  return resolved.slice(0, limit);
390
414
  }
391
415
 
416
+ // ../connectors/src/introspect-concurrency.ts
417
+ async function mapWithConcurrency(items, limit, fn) {
418
+ const results = new Array(items.length);
419
+ let next = 0;
420
+ const workers = Array.from(
421
+ { length: Math.min(Math.max(limit, 1), items.length) },
422
+ async () => {
423
+ for (; ; ) {
424
+ const i = next++;
425
+ if (i >= items.length) return;
426
+ results[i] = await fn(items[i]);
427
+ }
428
+ }
429
+ );
430
+ await Promise.all(workers);
431
+ return results;
432
+ }
433
+
392
434
  // ../connectors/src/auth-types.ts
393
435
  var AUTH_TYPES = {
394
436
  OAUTH: "oauth",
@@ -570,6 +612,45 @@ var kintoneSetupFlow = {
570
612
  }
571
613
  };
572
614
 
615
+ // ../connectors/src/connectors/kintone/introspect.ts
616
+ var MAX_APPS = 100;
617
+ var CONCURRENCY = 5;
618
+ async function introspectKintone(ctx) {
619
+ const appsRes = await apiFetch(ctx.params, "apps.json");
620
+ if (!appsRes.ok) {
621
+ throw new Error(`kintone: apps.json failed (${appsRes.status})`);
622
+ }
623
+ const appsData = await appsRes.json();
624
+ const apps = (appsData.apps ?? []).slice(0, MAX_APPS);
625
+ const tables = (await mapWithConcurrency(apps, CONCURRENCY, async (app) => {
626
+ try {
627
+ const res = await apiFetch(
628
+ ctx.params,
629
+ `app/form/fields.json?app=${encodeURIComponent(app.appId)}`
630
+ );
631
+ if (!res.ok) return [];
632
+ const data = await res.json();
633
+ const columns = Object.values(
634
+ data.properties ?? {}
635
+ ).filter((f) => f.code || f.label).map((f) => ({
636
+ name: f.code || f.label || "",
637
+ dataType: f.type ?? "UNKNOWN",
638
+ nullable: f.required !== true
639
+ }));
640
+ const table = {
641
+ schema: String(app.appId),
642
+ name: app.name,
643
+ type: "table",
644
+ columns
645
+ };
646
+ return [table];
647
+ } catch {
648
+ return [];
649
+ }
650
+ })).flat();
651
+ return { tables };
652
+ }
653
+
573
654
  // ../connectors/src/connectors/kintone/tools/request.ts
574
655
  import { z } from "zod";
575
656
  var REQUEST_TIMEOUT_MS = 6e4;
@@ -791,6 +872,38 @@ export default async function handler(c: Context) {
791
872
  - \u6587\u5B57\u5217: \`like "\u90E8\u5206\u4E00\u81F4"\``
792
873
  },
793
874
  tools,
875
+ // 決定論的な立ち上げ survey(ルールベース prewarm)。round1: `apps.json` でアプリ一覧 → round2: 先頭アプリの
876
+ // フィールド定義を read-only GET(kintone の「テーブル」= アプリ)。
877
+ surveyProbes: (_connectionId, prior) => {
878
+ if (prior.length === 0) {
879
+ return [
880
+ {
881
+ tool: "request",
882
+ input: {
883
+ method: "GET",
884
+ path: "apps.json",
885
+ toolUseIntent: "List kintone apps"
886
+ }
887
+ }
888
+ ];
889
+ }
890
+ if (prior.length === 1) {
891
+ const out = prior[0]?.output;
892
+ const apps = out?.success !== false ? out?.data?.apps ?? [] : [];
893
+ return apps.map((a) => a.appId).filter(
894
+ (id) => typeof id === "string" || typeof id === "number"
895
+ ).slice(0, 3).map((appId) => ({
896
+ tool: "request",
897
+ input: {
898
+ method: "GET",
899
+ path: `app/form/fields.json?app=${appId}`,
900
+ toolUseIntent: `Fields for app ${appId}`
901
+ }
902
+ }));
903
+ }
904
+ return [];
905
+ },
906
+ introspect: (ctx) => introspectKintone(ctx),
794
907
  setup: (params, ctx, config) => runSetupFlow(kintoneSetupFlow, params, ctx, config),
795
908
  async checkConnection(params, _config) {
796
909
  const baseUrl = params[parameters.baseUrl.slug];
@@ -1,6 +1,11 @@
1
1
  var __getOwnPropNames = Object.getOwnPropertyNames;
2
- var __esm = (fn, res) => function __init() {
3
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
2
+ var __esm = (fn, res, err) => function __init() {
3
+ if (err) throw err[0];
4
+ try {
5
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
6
+ } catch (e) {
7
+ throw err = [e], e;
8
+ }
4
9
  };
5
10
 
6
11
  // ../connectors/src/parameter-definition.ts
@@ -229,6 +234,15 @@ var ConnectorPlugin = class _ConnectorPlugin {
229
234
  * `runSetupFlow` from `setup-flow.ts`.
230
235
  */
231
236
  setup;
237
+ /**
238
+ * 統一 introspection。SQL DB の `information_schema` / `SHOW` / `DESCRIBE` や SaaS の
239
+ * メタデータ API といった取得経路の差を吸収し、tables / columns / PK / FK を共通型
240
+ * {@link IntrospectedSchema} へ正規化して返す。取得経路は {@link IntrospectContext} で
241
+ * 抽象化され、SQL DB は `ctx.query`、SaaS は `ctx.proxyFetch` + `ctx.params` を使う。
242
+ * `ctx.profile === true` のときは L2 プロファイル(行数・NULL 率等)も best-effort で埋める。
243
+ * coding-agent の `DataContextIndex` がデータ地図を構築する際に使う。
244
+ */
245
+ introspect;
232
246
  /**
233
247
  * Opt-out of the default "verify before save" behavior on connection
234
248
  * creation. The backend invokes `checkConnection` synchronously while
@@ -243,6 +257,14 @@ var ConnectorPlugin = class _ConnectorPlugin {
243
257
  * the default verify-on-create behavior without opt-in.
244
258
  */
245
259
  skipConnectionCheckOnCreate;
260
+ /**
261
+ * 決定論的な「立ち上げ survey」レシピ(ルールベース prewarm 基盤)。実装した connector は、LLM を使わずに
262
+ * read-only で自分を survey する probe 列(テーブル/列メタデータ → 小サンプル)を宣言する。coding-agent の
263
+ * recon driver がこれを読み、connector ツールの `execute` を直接呼んで結果を seed にする。未実装の connector は
264
+ * driver 側で safely skip される(その connection は listConnections のみ seed)。標準 `information_schema` を
265
+ * 持つ SQL connector は `makeStandardSqlSurveyProbes` を使える。**probe は必ず read-only**。
266
+ */
267
+ surveyProbes;
246
268
  constructor(config) {
247
269
  this.slug = config.slug;
248
270
  this.authType = config.authType;
@@ -260,7 +282,9 @@ var ConnectorPlugin = class _ConnectorPlugin {
260
282
  this.query = config.query;
261
283
  this.checkConnection = config.checkConnection;
262
284
  this.setup = config.setup;
285
+ this.introspect = config.introspect;
263
286
  this.skipConnectionCheckOnCreate = config.skipConnectionCheckOnCreate;
287
+ this.surveyProbes = config.surveyProbes;
264
288
  }
265
289
  get connectorKey() {
266
290
  return _ConnectorPlugin.deriveKey(this.slug, this.authType);
@@ -298,25 +322,25 @@ var ConnectorPlugin = class _ConnectorPlugin {
298
322
  if (authType) return `${slug}-${authType}`;
299
323
  const LEGACY_NULL_AUTH_TYPE_MAP = {
300
324
  // user-password
301
- "postgresql": "user-password",
302
- "mysql": "user-password",
303
- "clickhouse": "user-password",
304
- "kintone": "user-password",
325
+ postgresql: "user-password",
326
+ mysql: "user-password",
327
+ clickhouse: "user-password",
328
+ kintone: "user-password",
305
329
  "squadbase-db": "user-password",
306
330
  // service-account
307
- "snowflake": "service-account",
308
- "bigquery": "service-account",
331
+ snowflake: "service-account",
332
+ bigquery: "service-account",
309
333
  "google-analytics": "service-account",
310
334
  "google-calendar": "service-account",
311
335
  "aws-athena": "service-account",
312
- "redshift": "service-account",
336
+ redshift: "service-account",
313
337
  // api-key
314
- "databricks": "api-key",
315
- "dbt": "api-key",
316
- "airtable": "api-key",
317
- "openai": "api-key",
318
- "gemini": "api-key",
319
- "anthropic": "api-key",
338
+ databricks: "api-key",
339
+ dbt: "api-key",
340
+ airtable: "api-key",
341
+ openai: "api-key",
342
+ gemini: "api-key",
343
+ anthropic: "api-key",
320
344
  "wix-store": "api-key"
321
345
  };
322
346
  const fallbackAuthType = LEGACY_NULL_AUTH_TYPE_MAP[slug];