@squadbase/vite-server 0.1.17 → 0.1.19-dev.a00d9c3

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 (82) hide show
  1. package/dist/cli/index.js +5961 -2986
  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 +291 -18
  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 +40 -16
  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 +40 -16
  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.d.ts +5 -0
  36. package/dist/connectors/hackernews.js +909 -0
  37. package/dist/connectors/hubspot-oauth.js +32 -13
  38. package/dist/connectors/hubspot.js +39 -15
  39. package/dist/connectors/influxdb.js +39 -15
  40. package/dist/connectors/intercom-oauth.js +32 -13
  41. package/dist/connectors/intercom.js +39 -15
  42. package/dist/connectors/jdbc.js +70 -19
  43. package/dist/connectors/jira-api-key.js +39 -15
  44. package/dist/connectors/kintone-api-token.js +39 -15
  45. package/dist/connectors/kintone.js +128 -15
  46. package/dist/connectors/linear.js +39 -15
  47. package/dist/connectors/linkedin-ads.js +39 -15
  48. package/dist/connectors/mailchimp-oauth.js +39 -15
  49. package/dist/connectors/mailchimp.js +39 -15
  50. package/dist/connectors/meta-ads-oauth.js +39 -15
  51. package/dist/connectors/meta-ads.js +39 -15
  52. package/dist/connectors/mixpanel.js +39 -15
  53. package/dist/connectors/monday.js +39 -15
  54. package/dist/connectors/mongodb.js +39 -15
  55. package/dist/connectors/notion-oauth.js +32 -13
  56. package/dist/connectors/notion.js +84 -15
  57. package/dist/connectors/openai.js +39 -15
  58. package/dist/connectors/oracle.js +293 -19
  59. package/dist/connectors/outlook-oauth.js +33 -14
  60. package/dist/connectors/powerbi-oauth.js +33 -14
  61. package/dist/connectors/salesforce.js +108 -15
  62. package/dist/connectors/semrush.js +39 -15
  63. package/dist/connectors/sentry.js +39 -15
  64. package/dist/connectors/shopify-oauth.js +32 -13
  65. package/dist/connectors/shopify.js +39 -15
  66. package/dist/connectors/slack.d.ts +5 -0
  67. package/dist/connectors/slack.js +656 -0
  68. package/dist/connectors/sqlserver.js +291 -18
  69. package/dist/connectors/stripe-api-key.js +39 -15
  70. package/dist/connectors/stripe-oauth.js +32 -13
  71. package/dist/connectors/supabase.js +293 -16
  72. package/dist/connectors/tableau.js +40 -16
  73. package/dist/connectors/tiktok-ads.js +39 -15
  74. package/dist/connectors/wix-store.js +39 -15
  75. package/dist/connectors/x.d.ts +5 -0
  76. package/dist/connectors/x.js +951 -0
  77. package/dist/connectors/zendesk-oauth.js +32 -13
  78. package/dist/connectors/zendesk.js +39 -15
  79. package/dist/index.js +6425 -3397
  80. package/dist/main.js +6425 -3397
  81. package/dist/vite-plugin.js +5965 -2987
  82. package/package.json +13 -4
@@ -75,6 +75,15 @@ var ConnectorPlugin = class _ConnectorPlugin {
75
75
  * `runSetupFlow` from `setup-flow.ts`.
76
76
  */
77
77
  setup;
78
+ /**
79
+ * 統一 introspection。SQL DB の `information_schema` / `SHOW` / `DESCRIBE` や SaaS の
80
+ * メタデータ API といった取得経路の差を吸収し、tables / columns / PK / FK を共通型
81
+ * {@link IntrospectedSchema} へ正規化して返す。取得経路は {@link IntrospectContext} で
82
+ * 抽象化され、SQL DB は `ctx.query`、SaaS は `ctx.proxyFetch` + `ctx.params` を使う。
83
+ * `ctx.profile === true` のときは L2 プロファイル(行数・NULL 率等)も best-effort で埋める。
84
+ * coding-agent の `DataContextIndex` がデータ地図を構築する際に使う。
85
+ */
86
+ introspect;
78
87
  /**
79
88
  * Opt-out of the default "verify before save" behavior on connection
80
89
  * creation. The backend invokes `checkConnection` synchronously while
@@ -89,6 +98,14 @@ var ConnectorPlugin = class _ConnectorPlugin {
89
98
  * the default verify-on-create behavior without opt-in.
90
99
  */
91
100
  skipConnectionCheckOnCreate;
101
+ /**
102
+ * 決定論的な「立ち上げ survey」レシピ(ルールベース prewarm 基盤)。実装した connector は、LLM を使わずに
103
+ * read-only で自分を survey する probe 列(テーブル/列メタデータ → 小サンプル)を宣言する。coding-agent の
104
+ * recon driver がこれを読み、connector ツールの `execute` を直接呼んで結果を seed にする。未実装の connector は
105
+ * driver 側で safely skip される(その connection は listConnections のみ seed)。標準 `information_schema` を
106
+ * 持つ SQL connector は `makeStandardSqlSurveyProbes` を使える。**probe は必ず read-only**。
107
+ */
108
+ surveyProbes;
92
109
  constructor(config) {
93
110
  this.slug = config.slug;
94
111
  this.authType = config.authType;
@@ -106,7 +123,9 @@ var ConnectorPlugin = class _ConnectorPlugin {
106
123
  this.query = config.query;
107
124
  this.checkConnection = config.checkConnection;
108
125
  this.setup = config.setup;
126
+ this.introspect = config.introspect;
109
127
  this.skipConnectionCheckOnCreate = config.skipConnectionCheckOnCreate;
128
+ this.surveyProbes = config.surveyProbes;
110
129
  }
111
130
  get connectorKey() {
112
131
  return _ConnectorPlugin.deriveKey(this.slug, this.authType);
@@ -144,25 +163,25 @@ var ConnectorPlugin = class _ConnectorPlugin {
144
163
  if (authType) return `${slug}-${authType}`;
145
164
  const LEGACY_NULL_AUTH_TYPE_MAP = {
146
165
  // user-password
147
- "postgresql": "user-password",
148
- "mysql": "user-password",
149
- "clickhouse": "user-password",
150
- "kintone": "user-password",
166
+ postgresql: "user-password",
167
+ mysql: "user-password",
168
+ clickhouse: "user-password",
169
+ kintone: "user-password",
151
170
  "squadbase-db": "user-password",
152
171
  // service-account
153
- "snowflake": "service-account",
154
- "bigquery": "service-account",
172
+ snowflake: "service-account",
173
+ bigquery: "service-account",
155
174
  "google-analytics": "service-account",
156
175
  "google-calendar": "service-account",
157
176
  "aws-athena": "service-account",
158
- "redshift": "service-account",
177
+ redshift: "service-account",
159
178
  // api-key
160
- "databricks": "api-key",
161
- "dbt": "api-key",
162
- "airtable": "api-key",
163
- "openai": "api-key",
164
- "gemini": "api-key",
165
- "anthropic": "api-key",
179
+ databricks: "api-key",
180
+ dbt: "api-key",
181
+ airtable: "api-key",
182
+ openai: "api-key",
183
+ gemini: "api-key",
184
+ anthropic: "api-key",
166
185
  "wix-store": "api-key"
167
186
  };
168
187
  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
@@ -218,6 +223,15 @@ var ConnectorPlugin = class _ConnectorPlugin {
218
223
  * `runSetupFlow` from `setup-flow.ts`.
219
224
  */
220
225
  setup;
226
+ /**
227
+ * 統一 introspection。SQL DB の `information_schema` / `SHOW` / `DESCRIBE` や SaaS の
228
+ * メタデータ API といった取得経路の差を吸収し、tables / columns / PK / FK を共通型
229
+ * {@link IntrospectedSchema} へ正規化して返す。取得経路は {@link IntrospectContext} で
230
+ * 抽象化され、SQL DB は `ctx.query`、SaaS は `ctx.proxyFetch` + `ctx.params` を使う。
231
+ * `ctx.profile === true` のときは L2 プロファイル(行数・NULL 率等)も best-effort で埋める。
232
+ * coding-agent の `DataContextIndex` がデータ地図を構築する際に使う。
233
+ */
234
+ introspect;
221
235
  /**
222
236
  * Opt-out of the default "verify before save" behavior on connection
223
237
  * creation. The backend invokes `checkConnection` synchronously while
@@ -232,6 +246,14 @@ var ConnectorPlugin = class _ConnectorPlugin {
232
246
  * the default verify-on-create behavior without opt-in.
233
247
  */
234
248
  skipConnectionCheckOnCreate;
249
+ /**
250
+ * 決定論的な「立ち上げ survey」レシピ(ルールベース prewarm 基盤)。実装した connector は、LLM を使わずに
251
+ * read-only で自分を survey する probe 列(テーブル/列メタデータ → 小サンプル)を宣言する。coding-agent の
252
+ * recon driver がこれを読み、connector ツールの `execute` を直接呼んで結果を seed にする。未実装の connector は
253
+ * driver 側で safely skip される(その connection は listConnections のみ seed)。標準 `information_schema` を
254
+ * 持つ SQL connector は `makeStandardSqlSurveyProbes` を使える。**probe は必ず read-only**。
255
+ */
256
+ surveyProbes;
235
257
  constructor(config) {
236
258
  this.slug = config.slug;
237
259
  this.authType = config.authType;
@@ -249,7 +271,9 @@ var ConnectorPlugin = class _ConnectorPlugin {
249
271
  this.query = config.query;
250
272
  this.checkConnection = config.checkConnection;
251
273
  this.setup = config.setup;
274
+ this.introspect = config.introspect;
252
275
  this.skipConnectionCheckOnCreate = config.skipConnectionCheckOnCreate;
276
+ this.surveyProbes = config.surveyProbes;
253
277
  }
254
278
  get connectorKey() {
255
279
  return _ConnectorPlugin.deriveKey(this.slug, this.authType);
@@ -287,25 +311,25 @@ var ConnectorPlugin = class _ConnectorPlugin {
287
311
  if (authType) return `${slug}-${authType}`;
288
312
  const LEGACY_NULL_AUTH_TYPE_MAP = {
289
313
  // user-password
290
- "postgresql": "user-password",
291
- "mysql": "user-password",
292
- "clickhouse": "user-password",
293
- "kintone": "user-password",
314
+ postgresql: "user-password",
315
+ mysql: "user-password",
316
+ clickhouse: "user-password",
317
+ kintone: "user-password",
294
318
  "squadbase-db": "user-password",
295
319
  // service-account
296
- "snowflake": "service-account",
297
- "bigquery": "service-account",
320
+ snowflake: "service-account",
321
+ bigquery: "service-account",
298
322
  "google-analytics": "service-account",
299
323
  "google-calendar": "service-account",
300
324
  "aws-athena": "service-account",
301
- "redshift": "service-account",
325
+ redshift: "service-account",
302
326
  // api-key
303
- "databricks": "api-key",
304
- "dbt": "api-key",
305
- "airtable": "api-key",
306
- "openai": "api-key",
307
- "gemini": "api-key",
308
- "anthropic": "api-key",
327
+ databricks: "api-key",
328
+ dbt: "api-key",
329
+ airtable: "api-key",
330
+ openai: "api-key",
331
+ gemini: "api-key",
332
+ anthropic: "api-key",
309
333
  "wix-store": "api-key"
310
334
  };
311
335
  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
@@ -277,6 +282,15 @@ var ConnectorPlugin = class _ConnectorPlugin {
277
282
  * `runSetupFlow` from `setup-flow.ts`.
278
283
  */
279
284
  setup;
285
+ /**
286
+ * 統一 introspection。SQL DB の `information_schema` / `SHOW` / `DESCRIBE` や SaaS の
287
+ * メタデータ API といった取得経路の差を吸収し、tables / columns / PK / FK を共通型
288
+ * {@link IntrospectedSchema} へ正規化して返す。取得経路は {@link IntrospectContext} で
289
+ * 抽象化され、SQL DB は `ctx.query`、SaaS は `ctx.proxyFetch` + `ctx.params` を使う。
290
+ * `ctx.profile === true` のときは L2 プロファイル(行数・NULL 率等)も best-effort で埋める。
291
+ * coding-agent の `DataContextIndex` がデータ地図を構築する際に使う。
292
+ */
293
+ introspect;
280
294
  /**
281
295
  * Opt-out of the default "verify before save" behavior on connection
282
296
  * creation. The backend invokes `checkConnection` synchronously while
@@ -291,6 +305,14 @@ var ConnectorPlugin = class _ConnectorPlugin {
291
305
  * the default verify-on-create behavior without opt-in.
292
306
  */
293
307
  skipConnectionCheckOnCreate;
308
+ /**
309
+ * 決定論的な「立ち上げ survey」レシピ(ルールベース prewarm 基盤)。実装した connector は、LLM を使わずに
310
+ * read-only で自分を survey する probe 列(テーブル/列メタデータ → 小サンプル)を宣言する。coding-agent の
311
+ * recon driver がこれを読み、connector ツールの `execute` を直接呼んで結果を seed にする。未実装の connector は
312
+ * driver 側で safely skip される(その connection は listConnections のみ seed)。標準 `information_schema` を
313
+ * 持つ SQL connector は `makeStandardSqlSurveyProbes` を使える。**probe は必ず read-only**。
314
+ */
315
+ surveyProbes;
294
316
  constructor(config) {
295
317
  this.slug = config.slug;
296
318
  this.authType = config.authType;
@@ -308,7 +330,9 @@ var ConnectorPlugin = class _ConnectorPlugin {
308
330
  this.query = config.query;
309
331
  this.checkConnection = config.checkConnection;
310
332
  this.setup = config.setup;
333
+ this.introspect = config.introspect;
311
334
  this.skipConnectionCheckOnCreate = config.skipConnectionCheckOnCreate;
335
+ this.surveyProbes = config.surveyProbes;
312
336
  }
313
337
  get connectorKey() {
314
338
  return _ConnectorPlugin.deriveKey(this.slug, this.authType);
@@ -346,25 +370,25 @@ var ConnectorPlugin = class _ConnectorPlugin {
346
370
  if (authType) return `${slug}-${authType}`;
347
371
  const LEGACY_NULL_AUTH_TYPE_MAP = {
348
372
  // user-password
349
- "postgresql": "user-password",
350
- "mysql": "user-password",
351
- "clickhouse": "user-password",
352
- "kintone": "user-password",
373
+ postgresql: "user-password",
374
+ mysql: "user-password",
375
+ clickhouse: "user-password",
376
+ kintone: "user-password",
353
377
  "squadbase-db": "user-password",
354
378
  // service-account
355
- "snowflake": "service-account",
356
- "bigquery": "service-account",
379
+ snowflake: "service-account",
380
+ bigquery: "service-account",
357
381
  "google-analytics": "service-account",
358
382
  "google-calendar": "service-account",
359
383
  "aws-athena": "service-account",
360
- "redshift": "service-account",
384
+ redshift: "service-account",
361
385
  // api-key
362
- "databricks": "api-key",
363
- "dbt": "api-key",
364
- "airtable": "api-key",
365
- "openai": "api-key",
366
- "gemini": "api-key",
367
- "anthropic": "api-key",
386
+ databricks: "api-key",
387
+ dbt: "api-key",
388
+ airtable: "api-key",
389
+ openai: "api-key",
390
+ gemini: "api-key",
391
+ anthropic: "api-key",
368
392
  "wix-store": "api-key"
369
393
  };
370
394
  const fallbackAuthType = LEGACY_NULL_AUTH_TYPE_MAP[slug];
@@ -75,6 +75,15 @@ var ConnectorPlugin = class _ConnectorPlugin {
75
75
  * `runSetupFlow` from `setup-flow.ts`.
76
76
  */
77
77
  setup;
78
+ /**
79
+ * 統一 introspection。SQL DB の `information_schema` / `SHOW` / `DESCRIBE` や SaaS の
80
+ * メタデータ API といった取得経路の差を吸収し、tables / columns / PK / FK を共通型
81
+ * {@link IntrospectedSchema} へ正規化して返す。取得経路は {@link IntrospectContext} で
82
+ * 抽象化され、SQL DB は `ctx.query`、SaaS は `ctx.proxyFetch` + `ctx.params` を使う。
83
+ * `ctx.profile === true` のときは L2 プロファイル(行数・NULL 率等)も best-effort で埋める。
84
+ * coding-agent の `DataContextIndex` がデータ地図を構築する際に使う。
85
+ */
86
+ introspect;
78
87
  /**
79
88
  * Opt-out of the default "verify before save" behavior on connection
80
89
  * creation. The backend invokes `checkConnection` synchronously while
@@ -89,6 +98,14 @@ var ConnectorPlugin = class _ConnectorPlugin {
89
98
  * the default verify-on-create behavior without opt-in.
90
99
  */
91
100
  skipConnectionCheckOnCreate;
101
+ /**
102
+ * 決定論的な「立ち上げ survey」レシピ(ルールベース prewarm 基盤)。実装した connector は、LLM を使わずに
103
+ * read-only で自分を survey する probe 列(テーブル/列メタデータ → 小サンプル)を宣言する。coding-agent の
104
+ * recon driver がこれを読み、connector ツールの `execute` を直接呼んで結果を seed にする。未実装の connector は
105
+ * driver 側で safely skip される(その connection は listConnections のみ seed)。標準 `information_schema` を
106
+ * 持つ SQL connector は `makeStandardSqlSurveyProbes` を使える。**probe は必ず read-only**。
107
+ */
108
+ surveyProbes;
92
109
  constructor(config) {
93
110
  this.slug = config.slug;
94
111
  this.authType = config.authType;
@@ -106,7 +123,9 @@ var ConnectorPlugin = class _ConnectorPlugin {
106
123
  this.query = config.query;
107
124
  this.checkConnection = config.checkConnection;
108
125
  this.setup = config.setup;
126
+ this.introspect = config.introspect;
109
127
  this.skipConnectionCheckOnCreate = config.skipConnectionCheckOnCreate;
128
+ this.surveyProbes = config.surveyProbes;
110
129
  }
111
130
  get connectorKey() {
112
131
  return _ConnectorPlugin.deriveKey(this.slug, this.authType);
@@ -144,25 +163,25 @@ var ConnectorPlugin = class _ConnectorPlugin {
144
163
  if (authType) return `${slug}-${authType}`;
145
164
  const LEGACY_NULL_AUTH_TYPE_MAP = {
146
165
  // user-password
147
- "postgresql": "user-password",
148
- "mysql": "user-password",
149
- "clickhouse": "user-password",
150
- "kintone": "user-password",
166
+ postgresql: "user-password",
167
+ mysql: "user-password",
168
+ clickhouse: "user-password",
169
+ kintone: "user-password",
151
170
  "squadbase-db": "user-password",
152
171
  // service-account
153
- "snowflake": "service-account",
154
- "bigquery": "service-account",
172
+ snowflake: "service-account",
173
+ bigquery: "service-account",
155
174
  "google-analytics": "service-account",
156
175
  "google-calendar": "service-account",
157
176
  "aws-athena": "service-account",
158
- "redshift": "service-account",
177
+ redshift: "service-account",
159
178
  // api-key
160
- "databricks": "api-key",
161
- "dbt": "api-key",
162
- "airtable": "api-key",
163
- "openai": "api-key",
164
- "gemini": "api-key",
165
- "anthropic": "api-key",
179
+ databricks: "api-key",
180
+ dbt: "api-key",
181
+ airtable: "api-key",
182
+ openai: "api-key",
183
+ gemini: "api-key",
184
+ anthropic: "api-key",
166
185
  "wix-store": "api-key"
167
186
  };
168
187
  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
@@ -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)
@@ -341,7 +346,7 @@ async function runMssqlQuery(parsed, sql, options = {}) {
341
346
  try {
342
347
  const result = await pool.request().query(sql);
343
348
  const recordset = result.recordset ?? [];
344
- return { rows: recordset };
349
+ return { rows: recordset, rowsAffected: result.rowsAffected ?? [] };
345
350
  } finally {
346
351
  await pool.close();
347
352
  }
@@ -526,10 +531,16 @@ async function runOracleQuery(parsed, sql, options = {}) {
526
531
  outFormat: oracledb.OUT_FORMAT_OBJECT,
527
532
  // Bound by the connector's own row cap, but keep the driver from
528
533
  // streaming arbitrarily large result sets.
529
- maxRows: 5e3
534
+ maxRows: 5e3,
535
+ // oracledb defaults to autoCommit=false, which silently rolls back
536
+ // DML when the connection closes.
537
+ autoCommit: true
530
538
  }
531
539
  );
532
- return { rows: result.rows ?? [] };
540
+ return {
541
+ rows: result.rows ?? [],
542
+ rowsAffected: result.rowsAffected
543
+ };
533
544
  } finally {
534
545
  try {
535
546
  await connection2.close();
@@ -984,6 +995,15 @@ var ConnectorPlugin = class _ConnectorPlugin {
984
995
  * `runSetupFlow` from `setup-flow.ts`.
985
996
  */
986
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;
987
1007
  /**
988
1008
  * Opt-out of the default "verify before save" behavior on connection
989
1009
  * creation. The backend invokes `checkConnection` synchronously while
@@ -998,6 +1018,14 @@ var ConnectorPlugin = class _ConnectorPlugin {
998
1018
  * the default verify-on-create behavior without opt-in.
999
1019
  */
1000
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;
1001
1029
  constructor(config) {
1002
1030
  this.slug = config.slug;
1003
1031
  this.authType = config.authType;
@@ -1015,7 +1043,9 @@ var ConnectorPlugin = class _ConnectorPlugin {
1015
1043
  this.query = config.query;
1016
1044
  this.checkConnection = config.checkConnection;
1017
1045
  this.setup = config.setup;
1046
+ this.introspect = config.introspect;
1018
1047
  this.skipConnectionCheckOnCreate = config.skipConnectionCheckOnCreate;
1048
+ this.surveyProbes = config.surveyProbes;
1019
1049
  }
1020
1050
  get connectorKey() {
1021
1051
  return _ConnectorPlugin.deriveKey(this.slug, this.authType);
@@ -1053,25 +1083,25 @@ var ConnectorPlugin = class _ConnectorPlugin {
1053
1083
  if (authType) return `${slug}-${authType}`;
1054
1084
  const LEGACY_NULL_AUTH_TYPE_MAP = {
1055
1085
  // user-password
1056
- "postgresql": "user-password",
1057
- "mysql": "user-password",
1058
- "clickhouse": "user-password",
1059
- "kintone": "user-password",
1086
+ postgresql: "user-password",
1087
+ mysql: "user-password",
1088
+ clickhouse: "user-password",
1089
+ kintone: "user-password",
1060
1090
  "squadbase-db": "user-password",
1061
1091
  // service-account
1062
- "snowflake": "service-account",
1063
- "bigquery": "service-account",
1092
+ snowflake: "service-account",
1093
+ bigquery: "service-account",
1064
1094
  "google-analytics": "service-account",
1065
1095
  "google-calendar": "service-account",
1066
1096
  "aws-athena": "service-account",
1067
- "redshift": "service-account",
1097
+ redshift: "service-account",
1068
1098
  // api-key
1069
- "databricks": "api-key",
1070
- "dbt": "api-key",
1071
- "airtable": "api-key",
1072
- "openai": "api-key",
1073
- "gemini": "api-key",
1074
- "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",
1075
1105
  "wix-store": "api-key"
1076
1106
  };
1077
1107
  const fallbackAuthType = LEGACY_NULL_AUTH_TYPE_MAP[slug];
@@ -1160,6 +1190,12 @@ var AUTH_TYPES = {
1160
1190
  USER_PASSWORD: "user-password"
1161
1191
  };
1162
1192
 
1193
+ // ../connectors/src/lib/sql-dml.ts
1194
+ function isDmlStatement(sql) {
1195
+ const stripped = sql.replace(/^(\s*(--[^\n]*\n|\/\*[\s\S]*?\*\/))+/, "").trimStart();
1196
+ return /^(insert|update|delete|merge)\b/i.test(stripped);
1197
+ }
1198
+
1163
1199
  // ../connectors/src/connectors/jdbc/index.ts
1164
1200
  init_pg_pool();
1165
1201
  init_ssh_tunnel();
@@ -1522,6 +1558,9 @@ var outputSchema = z.discriminatedUnion("success", [
1522
1558
  z.object({
1523
1559
  success: z.literal(true),
1524
1560
  rowCount: z.number(),
1561
+ rowsAffected: z.number().optional().describe(
1562
+ "Affected rows for INSERT/UPDATE/DELETE; undefined for SELECT"
1563
+ ),
1525
1564
  truncated: z.boolean(),
1526
1565
  rows: z.array(z.record(z.string(), z.unknown()))
1527
1566
  }),
@@ -1536,7 +1575,8 @@ var executeQueryTool = new ConnectorTool({
1536
1575
  Use for: schema exploration via \`information_schema\` (or USER_TABLES on Oracle), data sampling, analytical queries.
1537
1576
  The connector dispatches by JDBC URL prefix to the matching driver
1538
1577
  (PostgreSQL / Redshift / MySQL / MariaDB / SQL Server / Oracle), so use the dialect that matches the connection.
1539
- Always bound results: LIMIT for PG/MySQL/Redshift, TOP for SQL Server, FETCH FIRST for Oracle.`,
1578
+ Always bound results: LIMIT for PG/MySQL/Redshift, TOP for SQL Server, FETCH FIRST for Oracle.
1579
+ For INSERT/UPDATE/DELETE, \`rowCount\` is 0 and \`rows\` is empty (rowCount counts returned rows, not affected rows) \u2014 this is normal, not a failure; check \`rowsAffected\` for the number of affected rows.`,
1540
1580
  inputSchema,
1541
1581
  outputSchema,
1542
1582
  async execute({ connectionId, sql }, connections) {
@@ -1574,6 +1614,9 @@ Always bound results: LIMIT for PG/MySQL/Redshift, TOP for SQL Server, FETCH FIR
1574
1614
  return {
1575
1615
  success: true,
1576
1616
  rowCount: Math.min(rows.length, MAX_ROWS),
1617
+ // tedious counts SELECT result rows in rowsAffected too, so only
1618
+ // report it for DML. Multi-statement batches are summed.
1619
+ rowsAffected: isDmlStatement(sql) ? result.rowsAffected.reduce((sum, n) => sum + n, 0) : void 0,
1577
1620
  truncated: rows.length > MAX_ROWS,
1578
1621
  rows: rows.slice(0, MAX_ROWS)
1579
1622
  };
@@ -1591,6 +1634,8 @@ Always bound results: LIMIT for PG/MySQL/Redshift, TOP for SQL Server, FETCH FIR
1591
1634
  return {
1592
1635
  success: true,
1593
1636
  rowCount: Math.min(rows.length, MAX_ROWS),
1637
+ // oracledb sets rowsAffected only for DML; undefined for SELECT.
1638
+ rowsAffected: result.rowsAffected,
1594
1639
  truncated: rows.length > MAX_ROWS,
1595
1640
  rows: rows.slice(0, MAX_ROWS)
1596
1641
  };
@@ -1617,9 +1662,13 @@ Always bound results: LIMIT for PG/MySQL/Redshift, TOP for SQL Server, FETCH FIR
1617
1662
  );
1618
1663
  const rows = result.rows;
1619
1664
  const truncated = rows.length > MAX_ROWS;
1665
+ const isDml = ["INSERT", "UPDATE", "DELETE", "MERGE"].includes(
1666
+ result.command
1667
+ );
1620
1668
  return {
1621
1669
  success: true,
1622
1670
  rowCount: Math.min(rows.length, MAX_ROWS),
1671
+ rowsAffected: isDml ? result.rowCount ?? 0 : void 0,
1623
1672
  truncated,
1624
1673
  rows: rows.slice(0, MAX_ROWS)
1625
1674
  };
@@ -1643,9 +1692,11 @@ Always bound results: LIMIT for PG/MySQL/Redshift, TOP for SQL Server, FETCH FIR
1643
1692
  const [rows] = await Promise.race([queryPromise, timeoutPromise]);
1644
1693
  const resultRows = Array.isArray(rows) ? rows : [];
1645
1694
  const truncated = resultRows.length > MAX_ROWS;
1695
+ const rowsAffected = !Array.isArray(rows) && rows !== null && typeof rows === "object" && "affectedRows" in rows && typeof rows.affectedRows === "number" ? rows.affectedRows : void 0;
1646
1696
  return {
1647
1697
  success: true,
1648
1698
  rowCount: Math.min(resultRows.length, MAX_ROWS),
1699
+ rowsAffected,
1649
1700
  truncated,
1650
1701
  rows: resultRows.slice(0, MAX_ROWS)
1651
1702
  };