@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.
- package/dist/cli/index.js +5961 -2986
- package/dist/connectors/airtable-oauth.js +39 -15
- package/dist/connectors/airtable.js +86 -15
- package/dist/connectors/amplitude.js +39 -15
- package/dist/connectors/anthropic.js +39 -15
- package/dist/connectors/asana.js +39 -15
- package/dist/connectors/attio.js +39 -15
- package/dist/connectors/aws-billing.js +39 -15
- package/dist/connectors/azure-sql.js +291 -18
- package/dist/connectors/backlog-api-key.js +39 -15
- package/dist/connectors/clickup.js +39 -15
- package/dist/connectors/cosmosdb.js +39 -15
- package/dist/connectors/customerio.js +39 -15
- package/dist/connectors/dbt.js +39 -15
- package/dist/connectors/freshdesk.js +39 -15
- package/dist/connectors/freshsales.js +39 -15
- package/dist/connectors/freshservice.js +39 -15
- package/dist/connectors/gamma.js +39 -15
- package/dist/connectors/gemini.js +39 -15
- package/dist/connectors/github.js +39 -15
- package/dist/connectors/gmail-oauth.js +32 -13
- package/dist/connectors/gmail.js +39 -15
- package/dist/connectors/google-ads.js +39 -15
- package/dist/connectors/google-analytics-oauth.js +40 -16
- package/dist/connectors/google-analytics.js +39 -15
- package/dist/connectors/google-audit-log.js +39 -15
- package/dist/connectors/google-calendar-oauth.js +40 -16
- package/dist/connectors/google-calendar.js +39 -15
- package/dist/connectors/google-docs.js +32 -13
- package/dist/connectors/google-drive.js +32 -13
- package/dist/connectors/google-search-console-oauth.js +39 -15
- package/dist/connectors/google-sheets.js +138 -195
- package/dist/connectors/google-slides.js +32 -13
- package/dist/connectors/grafana.js +39 -15
- package/dist/connectors/hackernews.d.ts +5 -0
- package/dist/connectors/hackernews.js +909 -0
- package/dist/connectors/hubspot-oauth.js +32 -13
- package/dist/connectors/hubspot.js +39 -15
- package/dist/connectors/influxdb.js +39 -15
- package/dist/connectors/intercom-oauth.js +32 -13
- package/dist/connectors/intercom.js +39 -15
- package/dist/connectors/jdbc.js +70 -19
- package/dist/connectors/jira-api-key.js +39 -15
- package/dist/connectors/kintone-api-token.js +39 -15
- package/dist/connectors/kintone.js +128 -15
- package/dist/connectors/linear.js +39 -15
- package/dist/connectors/linkedin-ads.js +39 -15
- package/dist/connectors/mailchimp-oauth.js +39 -15
- package/dist/connectors/mailchimp.js +39 -15
- package/dist/connectors/meta-ads-oauth.js +39 -15
- package/dist/connectors/meta-ads.js +39 -15
- package/dist/connectors/mixpanel.js +39 -15
- package/dist/connectors/monday.js +39 -15
- package/dist/connectors/mongodb.js +39 -15
- package/dist/connectors/notion-oauth.js +32 -13
- package/dist/connectors/notion.js +84 -15
- package/dist/connectors/openai.js +39 -15
- package/dist/connectors/oracle.js +293 -19
- package/dist/connectors/outlook-oauth.js +33 -14
- package/dist/connectors/powerbi-oauth.js +33 -14
- package/dist/connectors/salesforce.js +108 -15
- package/dist/connectors/semrush.js +39 -15
- package/dist/connectors/sentry.js +39 -15
- package/dist/connectors/shopify-oauth.js +32 -13
- package/dist/connectors/shopify.js +39 -15
- package/dist/connectors/slack.d.ts +5 -0
- package/dist/connectors/slack.js +656 -0
- package/dist/connectors/sqlserver.js +291 -18
- package/dist/connectors/stripe-api-key.js +39 -15
- package/dist/connectors/stripe-oauth.js +32 -13
- package/dist/connectors/supabase.js +293 -16
- package/dist/connectors/tableau.js +40 -16
- package/dist/connectors/tiktok-ads.js +39 -15
- package/dist/connectors/wix-store.js +39 -15
- package/dist/connectors/x.d.ts +5 -0
- package/dist/connectors/x.js +951 -0
- package/dist/connectors/zendesk-oauth.js +32 -13
- package/dist/connectors/zendesk.js +39 -15
- package/dist/index.js +6425 -3397
- package/dist/main.js +6425 -3397
- package/dist/vite-plugin.js +5965 -2987
- package/package.json +13 -4
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
2
|
-
var __esm = (fn, res) => function __init() {
|
|
3
|
-
|
|
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
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
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
|
-
|
|
264
|
-
|
|
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
|
-
|
|
292
|
+
redshift: "service-account",
|
|
269
293
|
// api-key
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
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
|
-
|
|
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
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
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
|
-
|
|
293
|
-
|
|
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
|
-
|
|
321
|
+
redshift: "service-account",
|
|
298
322
|
// api-key
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
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
|
-
|
|
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
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
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
|
-
|
|
302
|
-
|
|
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
|
-
|
|
330
|
+
redshift: "service-account",
|
|
307
331
|
// api-key
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
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
|
-
|
|
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
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
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
|
-
|
|
308
|
-
|
|
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
|
-
|
|
336
|
+
redshift: "service-account",
|
|
313
337
|
// api-key
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
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];
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
2
|
-
var __esm = (fn, res) => function __init() {
|
|
3
|
-
|
|
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
|
|
@@ -132,6 +137,15 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
132
137
|
* `runSetupFlow` from `setup-flow.ts`.
|
|
133
138
|
*/
|
|
134
139
|
setup;
|
|
140
|
+
/**
|
|
141
|
+
* 統一 introspection。SQL DB の `information_schema` / `SHOW` / `DESCRIBE` や SaaS の
|
|
142
|
+
* メタデータ API といった取得経路の差を吸収し、tables / columns / PK / FK を共通型
|
|
143
|
+
* {@link IntrospectedSchema} へ正規化して返す。取得経路は {@link IntrospectContext} で
|
|
144
|
+
* 抽象化され、SQL DB は `ctx.query`、SaaS は `ctx.proxyFetch` + `ctx.params` を使う。
|
|
145
|
+
* `ctx.profile === true` のときは L2 プロファイル(行数・NULL 率等)も best-effort で埋める。
|
|
146
|
+
* coding-agent の `DataContextIndex` がデータ地図を構築する際に使う。
|
|
147
|
+
*/
|
|
148
|
+
introspect;
|
|
135
149
|
/**
|
|
136
150
|
* Opt-out of the default "verify before save" behavior on connection
|
|
137
151
|
* creation. The backend invokes `checkConnection` synchronously while
|
|
@@ -146,6 +160,14 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
146
160
|
* the default verify-on-create behavior without opt-in.
|
|
147
161
|
*/
|
|
148
162
|
skipConnectionCheckOnCreate;
|
|
163
|
+
/**
|
|
164
|
+
* 決定論的な「立ち上げ survey」レシピ(ルールベース prewarm 基盤)。実装した connector は、LLM を使わずに
|
|
165
|
+
* read-only で自分を survey する probe 列(テーブル/列メタデータ → 小サンプル)を宣言する。coding-agent の
|
|
166
|
+
* recon driver がこれを読み、connector ツールの `execute` を直接呼んで結果を seed にする。未実装の connector は
|
|
167
|
+
* driver 側で safely skip される(その connection は listConnections のみ seed)。標準 `information_schema` を
|
|
168
|
+
* 持つ SQL connector は `makeStandardSqlSurveyProbes` を使える。**probe は必ず read-only**。
|
|
169
|
+
*/
|
|
170
|
+
surveyProbes;
|
|
149
171
|
constructor(config) {
|
|
150
172
|
this.slug = config.slug;
|
|
151
173
|
this.authType = config.authType;
|
|
@@ -163,7 +185,9 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
163
185
|
this.query = config.query;
|
|
164
186
|
this.checkConnection = config.checkConnection;
|
|
165
187
|
this.setup = config.setup;
|
|
188
|
+
this.introspect = config.introspect;
|
|
166
189
|
this.skipConnectionCheckOnCreate = config.skipConnectionCheckOnCreate;
|
|
190
|
+
this.surveyProbes = config.surveyProbes;
|
|
167
191
|
}
|
|
168
192
|
get connectorKey() {
|
|
169
193
|
return _ConnectorPlugin.deriveKey(this.slug, this.authType);
|
|
@@ -201,25 +225,25 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
201
225
|
if (authType) return `${slug}-${authType}`;
|
|
202
226
|
const LEGACY_NULL_AUTH_TYPE_MAP = {
|
|
203
227
|
// user-password
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
228
|
+
postgresql: "user-password",
|
|
229
|
+
mysql: "user-password",
|
|
230
|
+
clickhouse: "user-password",
|
|
231
|
+
kintone: "user-password",
|
|
208
232
|
"squadbase-db": "user-password",
|
|
209
233
|
// service-account
|
|
210
|
-
|
|
211
|
-
|
|
234
|
+
snowflake: "service-account",
|
|
235
|
+
bigquery: "service-account",
|
|
212
236
|
"google-analytics": "service-account",
|
|
213
237
|
"google-calendar": "service-account",
|
|
214
238
|
"aws-athena": "service-account",
|
|
215
|
-
|
|
239
|
+
redshift: "service-account",
|
|
216
240
|
// api-key
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
241
|
+
databricks: "api-key",
|
|
242
|
+
dbt: "api-key",
|
|
243
|
+
airtable: "api-key",
|
|
244
|
+
openai: "api-key",
|
|
245
|
+
gemini: "api-key",
|
|
246
|
+
anthropic: "api-key",
|
|
223
247
|
"wix-store": "api-key"
|
|
224
248
|
};
|
|
225
249
|
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
|
-
|
|
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
|
|
@@ -138,6 +143,15 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
138
143
|
* `runSetupFlow` from `setup-flow.ts`.
|
|
139
144
|
*/
|
|
140
145
|
setup;
|
|
146
|
+
/**
|
|
147
|
+
* 統一 introspection。SQL DB の `information_schema` / `SHOW` / `DESCRIBE` や SaaS の
|
|
148
|
+
* メタデータ API といった取得経路の差を吸収し、tables / columns / PK / FK を共通型
|
|
149
|
+
* {@link IntrospectedSchema} へ正規化して返す。取得経路は {@link IntrospectContext} で
|
|
150
|
+
* 抽象化され、SQL DB は `ctx.query`、SaaS は `ctx.proxyFetch` + `ctx.params` を使う。
|
|
151
|
+
* `ctx.profile === true` のときは L2 プロファイル(行数・NULL 率等)も best-effort で埋める。
|
|
152
|
+
* coding-agent の `DataContextIndex` がデータ地図を構築する際に使う。
|
|
153
|
+
*/
|
|
154
|
+
introspect;
|
|
141
155
|
/**
|
|
142
156
|
* Opt-out of the default "verify before save" behavior on connection
|
|
143
157
|
* creation. The backend invokes `checkConnection` synchronously while
|
|
@@ -152,6 +166,14 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
152
166
|
* the default verify-on-create behavior without opt-in.
|
|
153
167
|
*/
|
|
154
168
|
skipConnectionCheckOnCreate;
|
|
169
|
+
/**
|
|
170
|
+
* 決定論的な「立ち上げ survey」レシピ(ルールベース prewarm 基盤)。実装した connector は、LLM を使わずに
|
|
171
|
+
* read-only で自分を survey する probe 列(テーブル/列メタデータ → 小サンプル)を宣言する。coding-agent の
|
|
172
|
+
* recon driver がこれを読み、connector ツールの `execute` を直接呼んで結果を seed にする。未実装の connector は
|
|
173
|
+
* driver 側で safely skip される(その connection は listConnections のみ seed)。標準 `information_schema` を
|
|
174
|
+
* 持つ SQL connector は `makeStandardSqlSurveyProbes` を使える。**probe は必ず read-only**。
|
|
175
|
+
*/
|
|
176
|
+
surveyProbes;
|
|
155
177
|
constructor(config) {
|
|
156
178
|
this.slug = config.slug;
|
|
157
179
|
this.authType = config.authType;
|
|
@@ -169,7 +191,9 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
169
191
|
this.query = config.query;
|
|
170
192
|
this.checkConnection = config.checkConnection;
|
|
171
193
|
this.setup = config.setup;
|
|
194
|
+
this.introspect = config.introspect;
|
|
172
195
|
this.skipConnectionCheckOnCreate = config.skipConnectionCheckOnCreate;
|
|
196
|
+
this.surveyProbes = config.surveyProbes;
|
|
173
197
|
}
|
|
174
198
|
get connectorKey() {
|
|
175
199
|
return _ConnectorPlugin.deriveKey(this.slug, this.authType);
|
|
@@ -207,25 +231,25 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
207
231
|
if (authType) return `${slug}-${authType}`;
|
|
208
232
|
const LEGACY_NULL_AUTH_TYPE_MAP = {
|
|
209
233
|
// user-password
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
234
|
+
postgresql: "user-password",
|
|
235
|
+
mysql: "user-password",
|
|
236
|
+
clickhouse: "user-password",
|
|
237
|
+
kintone: "user-password",
|
|
214
238
|
"squadbase-db": "user-password",
|
|
215
239
|
// service-account
|
|
216
|
-
|
|
217
|
-
|
|
240
|
+
snowflake: "service-account",
|
|
241
|
+
bigquery: "service-account",
|
|
218
242
|
"google-analytics": "service-account",
|
|
219
243
|
"google-calendar": "service-account",
|
|
220
244
|
"aws-athena": "service-account",
|
|
221
|
-
|
|
245
|
+
redshift: "service-account",
|
|
222
246
|
// api-key
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
247
|
+
databricks: "api-key",
|
|
248
|
+
dbt: "api-key",
|
|
249
|
+
airtable: "api-key",
|
|
250
|
+
openai: "api-key",
|
|
251
|
+
gemini: "api-key",
|
|
252
|
+
anthropic: "api-key",
|
|
229
253
|
"wix-store": "api-key"
|
|
230
254
|
};
|
|
231
255
|
const fallbackAuthType = LEGACY_NULL_AUTH_TYPE_MAP[slug];
|