@squadbase/vite-server 0.1.17-dev.a9ddcfa → 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.
- package/dist/cli/index.js +8941 -3700
- package/dist/connectors/airtable-oauth.js +87 -23
- package/dist/connectors/airtable.js +130 -23
- package/dist/connectors/amplitude.js +47 -23
- package/dist/connectors/anthropic.js +41 -17
- package/dist/connectors/asana.js +76 -25
- package/dist/connectors/attio.js +69 -28
- package/dist/connectors/aws-billing.js +47 -23
- package/dist/connectors/azure-sql.js +322 -25
- package/dist/connectors/backlog-api-key.js +79 -30
- package/dist/connectors/clickup.js +89 -25
- package/dist/connectors/cosmosdb.js +51 -27
- package/dist/connectors/customerio.js +47 -23
- package/dist/connectors/dbt.js +725 -40
- package/dist/connectors/freshdesk.js +121 -23
- package/dist/connectors/freshsales.js +47 -23
- package/dist/connectors/freshservice.js +47 -23
- package/dist/connectors/gamma.js +54 -30
- package/dist/connectors/gemini.js +41 -17
- package/dist/connectors/github.js +51 -27
- package/dist/connectors/gmail-oauth.js +42 -23
- package/dist/connectors/gmail.js +43 -19
- package/dist/connectors/google-ads.js +47 -23
- package/dist/connectors/google-analytics-oauth.js +191 -40
- package/dist/connectors/google-analytics.js +529 -111
- package/dist/connectors/google-audit-log.js +43 -19
- package/dist/connectors/google-calendar-oauth.js +100 -30
- package/dist/connectors/google-calendar.js +100 -26
- package/dist/connectors/google-docs.js +42 -23
- package/dist/connectors/google-drive.js +64 -23
- package/dist/connectors/google-search-console-oauth.js +165 -32
- package/dist/connectors/google-sheets.js +142 -199
- package/dist/connectors/google-slides.js +42 -23
- package/dist/connectors/grafana.js +84 -25
- package/dist/connectors/hackernews.d.ts +5 -0
- package/dist/connectors/hackernews.js +909 -0
- package/dist/connectors/hubspot-oauth.js +73 -22
- package/dist/connectors/hubspot.js +64 -24
- package/dist/connectors/influxdb.js +47 -23
- package/dist/connectors/intercom-oauth.js +104 -25
- package/dist/connectors/intercom.js +51 -27
- package/dist/connectors/jdbc.js +76 -25
- package/dist/connectors/jira-api-key.js +107 -26
- package/dist/connectors/kintone-api-token.js +105 -33
- package/dist/connectors/kintone.js +182 -26
- package/dist/connectors/linear.js +93 -27
- package/dist/connectors/linkedin-ads.js +80 -29
- package/dist/connectors/mailchimp-oauth.js +45 -21
- package/dist/connectors/mailchimp.js +45 -21
- package/dist/connectors/meta-ads-oauth.js +72 -29
- package/dist/connectors/meta-ads.js +74 -29
- package/dist/connectors/mixpanel.js +47 -23
- package/dist/connectors/monday.js +48 -24
- package/dist/connectors/mongodb.js +47 -23
- package/dist/connectors/notion-oauth.js +92 -24
- package/dist/connectors/notion.js +144 -26
- package/dist/connectors/openai.js +41 -17
- package/dist/connectors/oracle.js +316 -26
- package/dist/connectors/outlook-oauth.js +53 -34
- package/dist/connectors/powerbi-oauth.js +45 -26
- package/dist/connectors/salesforce.js +150 -24
- package/dist/connectors/semrush.js +45 -21
- package/dist/connectors/sentry.js +75 -25
- package/dist/connectors/shopify-oauth.js +75 -23
- package/dist/connectors/shopify.js +47 -23
- package/dist/connectors/sqlserver.js +322 -25
- package/dist/connectors/stripe-api-key.js +105 -30
- package/dist/connectors/stripe-oauth.js +102 -32
- package/dist/connectors/supabase.js +315 -21
- package/dist/connectors/tableau.js +54 -30
- package/dist/connectors/tiktok-ads.js +76 -31
- package/dist/connectors/wix-store.js +47 -23
- package/dist/connectors/x.d.ts +5 -0
- package/dist/connectors/x.js +951 -0
- package/dist/connectors/zendesk-oauth.js +87 -25
- package/dist/connectors/zendesk.js +51 -27
- package/dist/index.js +9005 -3709
- package/dist/main.js +9005 -3709
- package/dist/vite-plugin.js +8939 -3698
- package/package.json +12 -4
package/dist/connectors/gamma.js
CHANGED
|
@@ -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
|
|
@@ -232,6 +237,15 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
232
237
|
* `runSetupFlow` from `setup-flow.ts`.
|
|
233
238
|
*/
|
|
234
239
|
setup;
|
|
240
|
+
/**
|
|
241
|
+
* 統一 introspection。SQL DB の `information_schema` / `SHOW` / `DESCRIBE` や SaaS の
|
|
242
|
+
* メタデータ API といった取得経路の差を吸収し、tables / columns / PK / FK を共通型
|
|
243
|
+
* {@link IntrospectedSchema} へ正規化して返す。取得経路は {@link IntrospectContext} で
|
|
244
|
+
* 抽象化され、SQL DB は `ctx.query`、SaaS は `ctx.proxyFetch` + `ctx.params` を使う。
|
|
245
|
+
* `ctx.profile === true` のときは L2 プロファイル(行数・NULL 率等)も best-effort で埋める。
|
|
246
|
+
* coding-agent の `DataContextIndex` がデータ地図を構築する際に使う。
|
|
247
|
+
*/
|
|
248
|
+
introspect;
|
|
235
249
|
/**
|
|
236
250
|
* Opt-out of the default "verify before save" behavior on connection
|
|
237
251
|
* creation. The backend invokes `checkConnection` synchronously while
|
|
@@ -246,6 +260,14 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
246
260
|
* the default verify-on-create behavior without opt-in.
|
|
247
261
|
*/
|
|
248
262
|
skipConnectionCheckOnCreate;
|
|
263
|
+
/**
|
|
264
|
+
* 決定論的な「立ち上げ survey」レシピ(ルールベース prewarm 基盤)。実装した connector は、LLM を使わずに
|
|
265
|
+
* read-only で自分を survey する probe 列(テーブル/列メタデータ → 小サンプル)を宣言する。coding-agent の
|
|
266
|
+
* recon driver がこれを読み、connector ツールの `execute` を直接呼んで結果を seed にする。未実装の connector は
|
|
267
|
+
* driver 側で safely skip される(その connection は listConnections のみ seed)。標準 `information_schema` を
|
|
268
|
+
* 持つ SQL connector は `makeStandardSqlSurveyProbes` を使える。**probe は必ず read-only**。
|
|
269
|
+
*/
|
|
270
|
+
surveyProbes;
|
|
249
271
|
constructor(config) {
|
|
250
272
|
this.slug = config.slug;
|
|
251
273
|
this.authType = config.authType;
|
|
@@ -263,7 +285,9 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
263
285
|
this.query = config.query;
|
|
264
286
|
this.checkConnection = config.checkConnection;
|
|
265
287
|
this.setup = config.setup;
|
|
288
|
+
this.introspect = config.introspect;
|
|
266
289
|
this.skipConnectionCheckOnCreate = config.skipConnectionCheckOnCreate;
|
|
290
|
+
this.surveyProbes = config.surveyProbes;
|
|
267
291
|
}
|
|
268
292
|
get connectorKey() {
|
|
269
293
|
return _ConnectorPlugin.deriveKey(this.slug, this.authType);
|
|
@@ -271,7 +295,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
271
295
|
/**
|
|
272
296
|
* Create tools for connections that belong to this connector.
|
|
273
297
|
* Filters connections by connectorKey internally.
|
|
274
|
-
* Returns tools keyed as
|
|
298
|
+
* Returns tools keyed as `connector_${connectorKey}_${toolName}`.
|
|
275
299
|
*/
|
|
276
300
|
createTools(connections, config, opts) {
|
|
277
301
|
const myConnections = connections.filter(
|
|
@@ -281,7 +305,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
281
305
|
for (const t of Object.values(this.tools)) {
|
|
282
306
|
const tool = t.createTool(myConnections, config);
|
|
283
307
|
const originalToModelOutput = tool.toModelOutput;
|
|
284
|
-
result[
|
|
308
|
+
result[`connector_${this.connectorKey}_${t.name}`] = {
|
|
285
309
|
...tool,
|
|
286
310
|
toModelOutput: async (options) => {
|
|
287
311
|
if (!originalToModelOutput) {
|
|
@@ -301,25 +325,25 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
301
325
|
if (authType) return `${slug}-${authType}`;
|
|
302
326
|
const LEGACY_NULL_AUTH_TYPE_MAP = {
|
|
303
327
|
// user-password
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
328
|
+
postgresql: "user-password",
|
|
329
|
+
mysql: "user-password",
|
|
330
|
+
clickhouse: "user-password",
|
|
331
|
+
kintone: "user-password",
|
|
308
332
|
"squadbase-db": "user-password",
|
|
309
333
|
// service-account
|
|
310
|
-
|
|
311
|
-
|
|
334
|
+
snowflake: "service-account",
|
|
335
|
+
bigquery: "service-account",
|
|
312
336
|
"google-analytics": "service-account",
|
|
313
337
|
"google-calendar": "service-account",
|
|
314
338
|
"aws-athena": "service-account",
|
|
315
|
-
|
|
339
|
+
redshift: "service-account",
|
|
316
340
|
// api-key
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
341
|
+
databricks: "api-key",
|
|
342
|
+
dbt: "api-key",
|
|
343
|
+
airtable: "api-key",
|
|
344
|
+
openai: "api-key",
|
|
345
|
+
gemini: "api-key",
|
|
346
|
+
anthropic: "api-key",
|
|
323
347
|
"wix-store": "api-key"
|
|
324
348
|
};
|
|
325
349
|
const fallbackAuthType = LEGACY_NULL_AUTH_TYPE_MAP[slug];
|
|
@@ -411,12 +435,12 @@ var AUTH_TYPES = {
|
|
|
411
435
|
// ../connectors/src/connectors/gamma/setup.ts
|
|
412
436
|
var gammaOnboarding = new ConnectorOnboarding({
|
|
413
437
|
dataOverviewInstructions: {
|
|
414
|
-
en: `1. Call
|
|
415
|
-
2. Call
|
|
416
|
-
3. Try generating a simple presentation with
|
|
417
|
-
ja: `1.
|
|
418
|
-
2.
|
|
419
|
-
3.
|
|
438
|
+
en: `1. Call connector_gamma_request with GET /themes to list available themes in the workspace
|
|
439
|
+
2. Call connector_gamma_request with GET /folders to list workspace folders
|
|
440
|
+
3. Try generating a simple presentation with connector_gamma_generate: inputText "Sample presentation about AI", textMode "generate", numCards 3`,
|
|
441
|
+
ja: `1. connector_gamma_request \u3067 GET /themes \u3092\u547C\u3073\u51FA\u3057\u3001\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u3067\u5229\u7528\u53EF\u80FD\u306A\u30C6\u30FC\u30DE\u4E00\u89A7\u3092\u53D6\u5F97
|
|
442
|
+
2. connector_gamma_request \u3067 GET /folders \u3092\u547C\u3073\u51FA\u3057\u3001\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u306E\u30D5\u30A9\u30EB\u30C0\u4E00\u89A7\u3092\u53D6\u5F97
|
|
443
|
+
3. connector_gamma_generate \u3067\u30B7\u30F3\u30D7\u30EB\u306A\u30D7\u30EC\u30BC\u30F3\u30C6\u30FC\u30B7\u30E7\u30F3\u3092\u8A66\u4F5C: inputText "AI\u306B\u3064\u3044\u3066\u306E\u30B5\u30F3\u30D7\u30EB\u30D7\u30EC\u30BC\u30F3\u30C6\u30FC\u30B7\u30E7\u30F3", textMode "generate", numCards 3`
|
|
420
444
|
}
|
|
421
445
|
});
|
|
422
446
|
|
|
@@ -564,7 +588,7 @@ var requestTool = new ConnectorTool({
|
|
|
564
588
|
description: `Send authenticated requests to the Gamma REST API.
|
|
565
589
|
Authentication is handled automatically using the API Key (X-API-KEY header).
|
|
566
590
|
Use this tool for listing themes, listing folders, checking generation status, and other read operations.
|
|
567
|
-
For creating presentations/documents, prefer the
|
|
591
|
+
For creating presentations/documents, prefer the connector_gamma_generate tool instead.`,
|
|
568
592
|
inputSchema,
|
|
569
593
|
outputSchema,
|
|
570
594
|
async execute({ connectionId, method, path: path2, body }, connections) {
|
|
@@ -629,7 +653,7 @@ var inputSchema2 = z2.object({
|
|
|
629
653
|
format: z2.enum(["presentation", "document", "webpage", "social"]).optional().describe("Type of artifact to create. Defaults to 'presentation'."),
|
|
630
654
|
numCards: z2.number().int().min(1).max(75).optional().describe("Number of cards/slides. Defaults to 10."),
|
|
631
655
|
themeId: z2.string().optional().describe(
|
|
632
|
-
"Theme ID for look and feel. Use
|
|
656
|
+
"Theme ID for look and feel. Use connector_gamma_request GET /themes to list available themes."
|
|
633
657
|
),
|
|
634
658
|
tone: z2.string().optional().describe(
|
|
635
659
|
"Tone/voice of the output (e.g., 'professional', 'casual', 'academic'). Max 500 chars."
|
|
@@ -677,7 +701,7 @@ var generateTool = new ConnectorTool({
|
|
|
677
701
|
name: "generate",
|
|
678
702
|
description: `Generate a presentation, document, webpage, or social post using Gamma AI.
|
|
679
703
|
This tool creates the generation, then automatically polls until completion and returns the result URL.
|
|
680
|
-
Use
|
|
704
|
+
Use connector_gamma_request GET /themes first if you want to pick a specific theme.
|
|
681
705
|
Gamma does NOT support image uploads. To visualize data, embed raw numbers directly into inputText as structured text (markdown tables, bullet lists with figures) \u2014 Gamma AI will render charts and visuals from the data.`,
|
|
682
706
|
inputSchema: inputSchema2,
|
|
683
707
|
outputSchema: outputSchema2,
|
|
@@ -801,8 +825,8 @@ var gammaConnector = new ConnectorPlugin({
|
|
|
801
825
|
systemPrompt: {
|
|
802
826
|
en: `### Tools
|
|
803
827
|
|
|
804
|
-
- \`
|
|
805
|
-
- \`
|
|
828
|
+
- \`connector_gamma_request\`: Send authenticated requests to the Gamma REST API. Use for listing themes, folders, and checking generation status. Authentication (X-API-KEY) is configured automatically.
|
|
829
|
+
- \`connector_gamma_generate\`: Generate a presentation, document, webpage, or social post using Gamma AI. This tool handles the full workflow: creates the generation, polls for completion, and returns the result URL. Prefer this over manually calling POST /generations + polling.
|
|
806
830
|
|
|
807
831
|
### Business Logic
|
|
808
832
|
|
|
@@ -875,8 +899,8 @@ export default async function handler(c: Context) {
|
|
|
875
899
|
Gamma does NOT support uploading images. If you want to visualize data (charts, graphs, tables), embed the raw numbers and data directly into \`inputText\` as structured text (e.g., markdown tables, bullet lists with figures). Gamma AI will render appropriate visual elements from the data. Do NOT generate chart images locally and try to include them \u2014 instead, pass the data values inline so Gamma can create its own visualizations.`,
|
|
876
900
|
ja: `### \u30C4\u30FC\u30EB
|
|
877
901
|
|
|
878
|
-
- \`
|
|
879
|
-
- \`
|
|
902
|
+
- \`connector_gamma_request\`: Gamma REST API\u306B\u8A8D\u8A3C\u6E08\u307F\u30EA\u30AF\u30A8\u30B9\u30C8\u3092\u9001\u4FE1\u3057\u307E\u3059\u3002\u30C6\u30FC\u30DE\u4E00\u89A7\u3001\u30D5\u30A9\u30EB\u30C0\u4E00\u89A7\u3001\u751F\u6210\u30B9\u30C6\u30FC\u30BF\u30B9\u306E\u78BA\u8A8D\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002\u8A8D\u8A3C\uFF08X-API-KEY\uFF09\u306F\u81EA\u52D5\u7684\u306B\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002
|
|
903
|
+
- \`connector_gamma_generate\`: Gamma AI\u3092\u4F7F\u3063\u3066\u30D7\u30EC\u30BC\u30F3\u30C6\u30FC\u30B7\u30E7\u30F3\u3001\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3001\u30A6\u30A7\u30D6\u30DA\u30FC\u30B8\u3001\u30BD\u30FC\u30B7\u30E3\u30EB\u6295\u7A3F\u3092\u751F\u6210\u3057\u307E\u3059\u3002\u751F\u6210\u306E\u4F5C\u6210\u304B\u3089\u30DD\u30FC\u30EA\u30F3\u30B0\u3001\u7D50\u679CURL\u306E\u8FD4\u5374\u307E\u3067\u4E00\u62EC\u3067\u51E6\u7406\u3057\u307E\u3059\u3002\u624B\u52D5\u3067POST /generations + \u30DD\u30FC\u30EA\u30F3\u30B0\u3059\u308B\u3088\u308A\u3082\u3053\u3061\u3089\u3092\u63A8\u5968\u3057\u307E\u3059\u3002
|
|
880
904
|
|
|
881
905
|
### Business Logic
|
|
882
906
|
|
|
@@ -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
|
|
@@ -105,6 +110,15 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
105
110
|
* `runSetupFlow` from `setup-flow.ts`.
|
|
106
111
|
*/
|
|
107
112
|
setup;
|
|
113
|
+
/**
|
|
114
|
+
* 統一 introspection。SQL DB の `information_schema` / `SHOW` / `DESCRIBE` や SaaS の
|
|
115
|
+
* メタデータ API といった取得経路の差を吸収し、tables / columns / PK / FK を共通型
|
|
116
|
+
* {@link IntrospectedSchema} へ正規化して返す。取得経路は {@link IntrospectContext} で
|
|
117
|
+
* 抽象化され、SQL DB は `ctx.query`、SaaS は `ctx.proxyFetch` + `ctx.params` を使う。
|
|
118
|
+
* `ctx.profile === true` のときは L2 プロファイル(行数・NULL 率等)も best-effort で埋める。
|
|
119
|
+
* coding-agent の `DataContextIndex` がデータ地図を構築する際に使う。
|
|
120
|
+
*/
|
|
121
|
+
introspect;
|
|
108
122
|
/**
|
|
109
123
|
* Opt-out of the default "verify before save" behavior on connection
|
|
110
124
|
* creation. The backend invokes `checkConnection` synchronously while
|
|
@@ -119,6 +133,14 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
119
133
|
* the default verify-on-create behavior without opt-in.
|
|
120
134
|
*/
|
|
121
135
|
skipConnectionCheckOnCreate;
|
|
136
|
+
/**
|
|
137
|
+
* 決定論的な「立ち上げ survey」レシピ(ルールベース prewarm 基盤)。実装した connector は、LLM を使わずに
|
|
138
|
+
* read-only で自分を survey する probe 列(テーブル/列メタデータ → 小サンプル)を宣言する。coding-agent の
|
|
139
|
+
* recon driver がこれを読み、connector ツールの `execute` を直接呼んで結果を seed にする。未実装の connector は
|
|
140
|
+
* driver 側で safely skip される(その connection は listConnections のみ seed)。標準 `information_schema` を
|
|
141
|
+
* 持つ SQL connector は `makeStandardSqlSurveyProbes` を使える。**probe は必ず read-only**。
|
|
142
|
+
*/
|
|
143
|
+
surveyProbes;
|
|
122
144
|
constructor(config) {
|
|
123
145
|
this.slug = config.slug;
|
|
124
146
|
this.authType = config.authType;
|
|
@@ -136,7 +158,9 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
136
158
|
this.query = config.query;
|
|
137
159
|
this.checkConnection = config.checkConnection;
|
|
138
160
|
this.setup = config.setup;
|
|
161
|
+
this.introspect = config.introspect;
|
|
139
162
|
this.skipConnectionCheckOnCreate = config.skipConnectionCheckOnCreate;
|
|
163
|
+
this.surveyProbes = config.surveyProbes;
|
|
140
164
|
}
|
|
141
165
|
get connectorKey() {
|
|
142
166
|
return _ConnectorPlugin.deriveKey(this.slug, this.authType);
|
|
@@ -144,7 +168,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
144
168
|
/**
|
|
145
169
|
* Create tools for connections that belong to this connector.
|
|
146
170
|
* Filters connections by connectorKey internally.
|
|
147
|
-
* Returns tools keyed as
|
|
171
|
+
* Returns tools keyed as `connector_${connectorKey}_${toolName}`.
|
|
148
172
|
*/
|
|
149
173
|
createTools(connections, config, opts) {
|
|
150
174
|
const myConnections = connections.filter(
|
|
@@ -154,7 +178,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
154
178
|
for (const t of Object.values(this.tools)) {
|
|
155
179
|
const tool = t.createTool(myConnections, config);
|
|
156
180
|
const originalToModelOutput = tool.toModelOutput;
|
|
157
|
-
result[
|
|
181
|
+
result[`connector_${this.connectorKey}_${t.name}`] = {
|
|
158
182
|
...tool,
|
|
159
183
|
toModelOutput: async (options) => {
|
|
160
184
|
if (!originalToModelOutput) {
|
|
@@ -174,25 +198,25 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
174
198
|
if (authType) return `${slug}-${authType}`;
|
|
175
199
|
const LEGACY_NULL_AUTH_TYPE_MAP = {
|
|
176
200
|
// user-password
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
201
|
+
postgresql: "user-password",
|
|
202
|
+
mysql: "user-password",
|
|
203
|
+
clickhouse: "user-password",
|
|
204
|
+
kintone: "user-password",
|
|
181
205
|
"squadbase-db": "user-password",
|
|
182
206
|
// service-account
|
|
183
|
-
|
|
184
|
-
|
|
207
|
+
snowflake: "service-account",
|
|
208
|
+
bigquery: "service-account",
|
|
185
209
|
"google-analytics": "service-account",
|
|
186
210
|
"google-calendar": "service-account",
|
|
187
211
|
"aws-athena": "service-account",
|
|
188
|
-
|
|
212
|
+
redshift: "service-account",
|
|
189
213
|
// api-key
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
214
|
+
databricks: "api-key",
|
|
215
|
+
dbt: "api-key",
|
|
216
|
+
airtable: "api-key",
|
|
217
|
+
openai: "api-key",
|
|
218
|
+
gemini: "api-key",
|
|
219
|
+
anthropic: "api-key",
|
|
196
220
|
"wix-store": "api-key"
|
|
197
221
|
};
|
|
198
222
|
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
|
|
@@ -365,6 +370,15 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
365
370
|
* `runSetupFlow` from `setup-flow.ts`.
|
|
366
371
|
*/
|
|
367
372
|
setup;
|
|
373
|
+
/**
|
|
374
|
+
* 統一 introspection。SQL DB の `information_schema` / `SHOW` / `DESCRIBE` や SaaS の
|
|
375
|
+
* メタデータ API といった取得経路の差を吸収し、tables / columns / PK / FK を共通型
|
|
376
|
+
* {@link IntrospectedSchema} へ正規化して返す。取得経路は {@link IntrospectContext} で
|
|
377
|
+
* 抽象化され、SQL DB は `ctx.query`、SaaS は `ctx.proxyFetch` + `ctx.params` を使う。
|
|
378
|
+
* `ctx.profile === true` のときは L2 プロファイル(行数・NULL 率等)も best-effort で埋める。
|
|
379
|
+
* coding-agent の `DataContextIndex` がデータ地図を構築する際に使う。
|
|
380
|
+
*/
|
|
381
|
+
introspect;
|
|
368
382
|
/**
|
|
369
383
|
* Opt-out of the default "verify before save" behavior on connection
|
|
370
384
|
* creation. The backend invokes `checkConnection` synchronously while
|
|
@@ -379,6 +393,14 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
379
393
|
* the default verify-on-create behavior without opt-in.
|
|
380
394
|
*/
|
|
381
395
|
skipConnectionCheckOnCreate;
|
|
396
|
+
/**
|
|
397
|
+
* 決定論的な「立ち上げ survey」レシピ(ルールベース prewarm 基盤)。実装した connector は、LLM を使わずに
|
|
398
|
+
* read-only で自分を survey する probe 列(テーブル/列メタデータ → 小サンプル)を宣言する。coding-agent の
|
|
399
|
+
* recon driver がこれを読み、connector ツールの `execute` を直接呼んで結果を seed にする。未実装の connector は
|
|
400
|
+
* driver 側で safely skip される(その connection は listConnections のみ seed)。標準 `information_schema` を
|
|
401
|
+
* 持つ SQL connector は `makeStandardSqlSurveyProbes` を使える。**probe は必ず read-only**。
|
|
402
|
+
*/
|
|
403
|
+
surveyProbes;
|
|
382
404
|
constructor(config) {
|
|
383
405
|
this.slug = config.slug;
|
|
384
406
|
this.authType = config.authType;
|
|
@@ -396,7 +418,9 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
396
418
|
this.query = config.query;
|
|
397
419
|
this.checkConnection = config.checkConnection;
|
|
398
420
|
this.setup = config.setup;
|
|
421
|
+
this.introspect = config.introspect;
|
|
399
422
|
this.skipConnectionCheckOnCreate = config.skipConnectionCheckOnCreate;
|
|
423
|
+
this.surveyProbes = config.surveyProbes;
|
|
400
424
|
}
|
|
401
425
|
get connectorKey() {
|
|
402
426
|
return _ConnectorPlugin.deriveKey(this.slug, this.authType);
|
|
@@ -404,7 +428,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
404
428
|
/**
|
|
405
429
|
* Create tools for connections that belong to this connector.
|
|
406
430
|
* Filters connections by connectorKey internally.
|
|
407
|
-
* Returns tools keyed as
|
|
431
|
+
* Returns tools keyed as `connector_${connectorKey}_${toolName}`.
|
|
408
432
|
*/
|
|
409
433
|
createTools(connections, config, opts) {
|
|
410
434
|
const myConnections = connections.filter(
|
|
@@ -414,7 +438,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
414
438
|
for (const t of Object.values(this.tools)) {
|
|
415
439
|
const tool = t.createTool(myConnections, config);
|
|
416
440
|
const originalToModelOutput = tool.toModelOutput;
|
|
417
|
-
result[
|
|
441
|
+
result[`connector_${this.connectorKey}_${t.name}`] = {
|
|
418
442
|
...tool,
|
|
419
443
|
toModelOutput: async (options) => {
|
|
420
444
|
if (!originalToModelOutput) {
|
|
@@ -434,25 +458,25 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
434
458
|
if (authType) return `${slug}-${authType}`;
|
|
435
459
|
const LEGACY_NULL_AUTH_TYPE_MAP = {
|
|
436
460
|
// user-password
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
461
|
+
postgresql: "user-password",
|
|
462
|
+
mysql: "user-password",
|
|
463
|
+
clickhouse: "user-password",
|
|
464
|
+
kintone: "user-password",
|
|
441
465
|
"squadbase-db": "user-password",
|
|
442
466
|
// service-account
|
|
443
|
-
|
|
444
|
-
|
|
467
|
+
snowflake: "service-account",
|
|
468
|
+
bigquery: "service-account",
|
|
445
469
|
"google-analytics": "service-account",
|
|
446
470
|
"google-calendar": "service-account",
|
|
447
471
|
"aws-athena": "service-account",
|
|
448
|
-
|
|
472
|
+
redshift: "service-account",
|
|
449
473
|
// api-key
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
474
|
+
databricks: "api-key",
|
|
475
|
+
dbt: "api-key",
|
|
476
|
+
airtable: "api-key",
|
|
477
|
+
openai: "api-key",
|
|
478
|
+
gemini: "api-key",
|
|
479
|
+
anthropic: "api-key",
|
|
456
480
|
"wix-store": "api-key"
|
|
457
481
|
};
|
|
458
482
|
const fallbackAuthType = LEGACY_NULL_AUTH_TYPE_MAP[slug];
|
|
@@ -544,16 +568,16 @@ var AUTH_TYPES = {
|
|
|
544
568
|
// ../connectors/src/connectors/github/setup.ts
|
|
545
569
|
var githubOnboarding = new ConnectorOnboarding({
|
|
546
570
|
dataOverviewInstructions: {
|
|
547
|
-
en: `1. Call
|
|
548
|
-
2. Call
|
|
571
|
+
en: `1. Call connector_github_request with GET /user to confirm credentials and discover the authenticated account (login, name, plan).
|
|
572
|
+
2. Call connector_github_request with GET /user/repos?per_page=10&sort=updated to sample repositories the token can see. For organisation-owned repos, use GET /orgs/{org}/repos.
|
|
549
573
|
3. Pick a representative repo and inspect its activity:
|
|
550
574
|
- GET /repos/{owner}/{repo}/issues?state=open&per_page=10 \u2014 recent open issues (the GitHub API treats pull requests as issues; filter with the \`pull_request\` field if you want only issues).
|
|
551
575
|
- GET /repos/{owner}/{repo}/pulls?state=open&per_page=10 \u2014 open pull requests.
|
|
552
576
|
- GET /repos/{owner}/{repo}/commits?per_page=10 \u2014 recent commits on the default branch.
|
|
553
577
|
4. For broad discovery, use the search endpoints (GET /search/repositories?q=..., /search/issues?q=..., /search/code?q=...). These are heavily rate-limited (30 req/min for authenticated users), so use them sparingly.
|
|
554
578
|
5. Pagination is page-based: \`?page=1&per_page=100\` (max 100). The \`Link\` response header carries \`rel="next"\` / \`rel="last"\` URLs when more results exist.`,
|
|
555
|
-
ja: `1.
|
|
556
|
-
2.
|
|
579
|
+
ja: `1. connector_github_request \u3067 GET /user \u3092\u547C\u3073\u51FA\u3057\u3001\u8A8D\u8A3C\u60C5\u5831\u306E\u78BA\u8A8D\u3068\u8A8D\u8A3C\u6E08\u307F\u30A2\u30AB\u30A6\u30F3\u30C8\u306E\u60C5\u5831\uFF08login, name, plan\uFF09\u3092\u53D6\u5F97\u3057\u307E\u3059\u3002
|
|
580
|
+
2. connector_github_request \u3067 GET /user/repos?per_page=10&sort=updated \u3092\u547C\u3073\u51FA\u3057\u3066\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306A\u30EA\u30DD\u30B8\u30C8\u30EA\u3092\u30B5\u30F3\u30D7\u30EA\u30F3\u30B0\u3057\u307E\u3059\u3002Organization \u6240\u6709\u306E\u30EA\u30DD\u30B8\u30C8\u30EA\u306F GET /orgs/{org}/repos \u3092\u4F7F\u7528\u3057\u307E\u3059\u3002
|
|
557
581
|
3. \u4EE3\u8868\u7684\u306A\u30EA\u30DD\u30B8\u30C8\u30EA\u3092\u9078\u3073\u3001\u30A2\u30AF\u30C6\u30A3\u30D3\u30C6\u30A3\u3092\u78BA\u8A8D\u3057\u307E\u3059:
|
|
558
582
|
- GET /repos/{owner}/{repo}/issues?state=open&per_page=10 \u2014 \u76F4\u8FD1\u306E\u30AA\u30FC\u30D7\u30F3\u30A4\u30B7\u30E5\u30FC\uFF08GitHub API \u306F\u30D7\u30EB\u30EA\u30AF\u30A8\u30B9\u30C8\u3082\u30A4\u30B7\u30E5\u30FC\u6271\u3044\u3057\u307E\u3059\u3002\u30A4\u30B7\u30E5\u30FC\u306E\u307F\u304C\u5FC5\u8981\u306A\u5834\u5408\u306F \`pull_request\` \u30D5\u30A3\u30FC\u30EB\u30C9\u3067\u9664\u5916\uFF09\u3002
|
|
559
583
|
- GET /repos/{owner}/{repo}/pulls?state=open&per_page=10 \u2014 \u30AA\u30FC\u30D7\u30F3\u306A\u30D7\u30EB\u30EA\u30AF\u30A8\u30B9\u30C8\u4E00\u89A7\u3002
|
|
@@ -881,14 +905,14 @@ var githubConnector = new ConnectorPlugin({
|
|
|
881
905
|
systemPrompt: {
|
|
882
906
|
en: `### Tools
|
|
883
907
|
|
|
884
|
-
- \`
|
|
908
|
+
- \`connector_github_request\`: The only way to call the GitHub REST API. Use it to read repositories, issues, pull requests, commits, comments, releases, GitHub Actions runs, organisation metadata, and the search endpoints. Authentication (\`Authorization: Bearer <PAT>\`) and required headers (\`Accept: application/vnd.github+json\`, \`X-GitHub-Api-Version: 2022-11-28\`, \`User-Agent\`) are configured automatically. Both Classic (\`ghp_\u2026\`) and fine-grained (\`github_pat_\u2026\`) tokens work.
|
|
885
909
|
|
|
886
910
|
### Cloning Repositories for Deep Code Exploration
|
|
887
911
|
|
|
888
|
-
\`
|
|
912
|
+
\`connector_github_request\` plus \`/repos/{owner}/{repo}/contents/{path}\` is fine for reading a few files. When the task requires deep exploration \u2014 reading many files, searching across the codebase with ripgrep / grep, or inspecting many commits \u2014 prefer \`git clone\` via the bash tool. Follow these rules **strictly**:
|
|
889
913
|
|
|
890
914
|
1. **Always clone OUTSIDE the dashboard project.** The current working directory is the user's Vite-based dashboard project, which is itself a git repository. Cloning into it (or any subdirectory of it) would pollute the dashboard's git index, risk accidental commits, and create nested-repo confusion. Always clone into a path outside the project \u2014 use \`$(mktemp -d)\`, \`/tmp/<unique-name>\`, or \`~/.cache/<unique-name>\`.
|
|
891
|
-
2. **NEVER commit, push, or otherwise write to the cloned repo.** This is a strictly read-only flow. Do not run \`git commit\`, \`git push\`, \`git tag\`, \`git rebase\`, or any other write operation inside the cloned working tree. The connector is for reading source; if the task requires writing back to GitHub (creating an issue, posting a comment, etc.), use \`
|
|
915
|
+
2. **NEVER commit, push, or otherwise write to the cloned repo.** This is a strictly read-only flow. Do not run \`git commit\`, \`git push\`, \`git tag\`, \`git rebase\`, or any other write operation inside the cloned working tree. The connector is for reading source; if the task requires writing back to GitHub (creating an issue, posting a comment, etc.), use \`connector_github_request\` \u2014 never \`git push\`.
|
|
892
916
|
3. **Authenticate via HTTPS using the PAT inline.** Run \`git clone https://<TOKEN>@github.com/<owner>/<repo>.git <target-dir>\`. Avoid logging the URL with the token interpolated; redact when echoing commands.
|
|
893
917
|
4. **Prefer shallow clones.** Use \`--depth=1 --single-branch\` unless full history is specifically required.
|
|
894
918
|
5. **Clean up when done.** Remove the cloned directory (\`rm -rf <target-dir>\`) once exploration is complete.
|
|
@@ -988,14 +1012,14 @@ export default async function handler(c: Context) {
|
|
|
988
1012
|
- GET \`/rate_limit\` \u2014 Inspect remaining quota across REST / GraphQL / search`,
|
|
989
1013
|
ja: `### \u30C4\u30FC\u30EB
|
|
990
1014
|
|
|
991
|
-
- \`
|
|
1015
|
+
- \`connector_github_request\`: GitHub REST API \u3092\u547C\u3073\u51FA\u3059\u552F\u4E00\u306E\u624B\u6BB5\u3067\u3059\u3002\u30EA\u30DD\u30B8\u30C8\u30EA\u3001Issue\u3001Pull Request\u3001\u30B3\u30DF\u30C3\u30C8\u3001\u30B3\u30E1\u30F3\u30C8\u3001Release\u3001GitHub Actions \u306E\u30E9\u30F3\u3001\u7D44\u7E54\u30E1\u30BF\u60C5\u5831\u3001\u30B5\u30FC\u30C1\u7CFB\u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8\u306E\u53D6\u5F97\u30FB\u66F4\u65B0\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002\u8A8D\u8A3C\uFF08\`Authorization: Bearer <PAT>\`\uFF09\u3068\u5FC5\u9808\u30D8\u30C3\u30C0\uFF08\`Accept: application/vnd.github+json\`\u3001\`X-GitHub-Api-Version: 2022-11-28\`\u3001\`User-Agent\`\uFF09\u306F\u81EA\u52D5\u3067\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002Classic\uFF08\`ghp_\u2026\`\uFF09/ fine-grained\uFF08\`github_pat_\u2026\`\uFF09\u3069\u3061\u3089\u306E PAT \u3082\u5229\u7528\u53EF\u80FD\u3067\u3059\u3002
|
|
992
1016
|
|
|
993
1017
|
### \u6DF1\u3044\u30B3\u30FC\u30C9\u63A2\u7D22\u306E\u305F\u3081\u306E\u30EA\u30DD\u30B8\u30C8\u30EA\u30AF\u30ED\u30FC\u30F3
|
|
994
1018
|
|
|
995
|
-
\u6570\u30D5\u30A1\u30A4\u30EB\u3092\u8AAD\u3080\u7A0B\u5EA6\u306A\u3089 \`
|
|
1019
|
+
\u6570\u30D5\u30A1\u30A4\u30EB\u3092\u8AAD\u3080\u7A0B\u5EA6\u306A\u3089 \`connector_github_request\` \u3068 \`/repos/{owner}/{repo}/contents/{path}\` \u3067\u5341\u5206\u3067\u3059\u3002\u591A\u6570\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u8AAD\u3080\u3001ripgrep / grep \u3067\u6A2A\u65AD\u691C\u7D22\u3059\u308B\u3001\u8907\u6570\u30B3\u30DF\u30C3\u30C8\u3092\u8ABF\u3079\u308B\u306A\u3069 **\u6DF1\u3044\u63A2\u7D22\u304C\u5FC5\u8981\u306A\u5834\u5408\u306F** bash \u30C4\u30FC\u30EB\u7D4C\u7531\u3067 \`git clone\` \u3092\u4F7F\u3063\u3066\u304F\u3060\u3055\u3044\u3002\u4EE5\u4E0B\u306E\u30EB\u30FC\u30EB\u3092 **\u53B3\u5B88** \u3059\u308B\u3053\u3068\uFF1A
|
|
996
1020
|
|
|
997
1021
|
1. **\u5FC5\u305A\u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u5916\u306B\u30AF\u30ED\u30FC\u30F3\u3059\u308B\u3053\u3068\u3002** \u73FE\u5728\u306E\u4F5C\u696D\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306F\u30E6\u30FC\u30B6\u30FC\u306E Vite \u30D9\u30FC\u30B9\u306E\u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\uFF08\u305D\u308C\u81EA\u4F53\u304C git \u30EA\u30DD\u30B8\u30C8\u30EA\uFF09\u3067\u3059\u3002\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u5185\uFF08\u3042\u308B\u3044\u306F\u305D\u306E\u30B5\u30D6\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\uFF09\u306B\u30AF\u30ED\u30FC\u30F3\u3059\u308B\u3068\u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9\u306E git \u306E\u72B6\u614B\u3092\u6C5A\u67D3\u3057\u3001\u8AA4\u30B3\u30DF\u30C3\u30C8\u3084\u30CD\u30B9\u30C8\u3057\u305F\u30EA\u30DD\u30B8\u30C8\u30EA\u306E\u6DF7\u4E71\u306E\u539F\u56E0\u306B\u306A\u308A\u307E\u3059\u3002\u5FC5\u305A\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u5916\u306E\u30D1\u30B9\uFF08\`$(mktemp -d)\`, \`/tmp/<unique-name>\`, \`~/.cache/<unique-name>\` \u306A\u3069\uFF09\u306B\u30AF\u30ED\u30FC\u30F3\u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
|
998
|
-
2. **\u7D76\u5BFE\u306B commit / push / \u66F8\u304D\u8FBC\u307F\u64CD\u4F5C\u3092\u3057\u306A\u3044\u3053\u3068\u3002** \u3053\u308C\u306F\u53B3\u5BC6\u306B read-only \u306E\u30D5\u30ED\u30FC\u3067\u3059\u3002\u30AF\u30ED\u30FC\u30F3\u3057\u305F\u4F5C\u696D\u30C4\u30EA\u30FC\u5185\u3067 \`git commit\` / \`git push\` / \`git tag\` / \`git rebase\` \u306A\u3069\u306E\u66F8\u304D\u8FBC\u307F\u64CD\u4F5C\u3092\u884C\u308F\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002GitHub \u3078\u306E\u66F8\u304D\u8FBC\u307F\u304C\u5FC5\u8981\u306A\u5834\u5408\uFF08Issue \u4F5C\u6210\u3001\u30B3\u30E1\u30F3\u30C8\u6295\u7A3F\u7B49\uFF09\u306F \`
|
|
1022
|
+
2. **\u7D76\u5BFE\u306B commit / push / \u66F8\u304D\u8FBC\u307F\u64CD\u4F5C\u3092\u3057\u306A\u3044\u3053\u3068\u3002** \u3053\u308C\u306F\u53B3\u5BC6\u306B read-only \u306E\u30D5\u30ED\u30FC\u3067\u3059\u3002\u30AF\u30ED\u30FC\u30F3\u3057\u305F\u4F5C\u696D\u30C4\u30EA\u30FC\u5185\u3067 \`git commit\` / \`git push\` / \`git tag\` / \`git rebase\` \u306A\u3069\u306E\u66F8\u304D\u8FBC\u307F\u64CD\u4F5C\u3092\u884C\u308F\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002GitHub \u3078\u306E\u66F8\u304D\u8FBC\u307F\u304C\u5FC5\u8981\u306A\u5834\u5408\uFF08Issue \u4F5C\u6210\u3001\u30B3\u30E1\u30F3\u30C8\u6295\u7A3F\u7B49\uFF09\u306F \`connector_github_request\` \u3092\u4F7F\u7528\u3057\u3001\`git push\` \u3067\u884C\u308F\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002
|
|
999
1023
|
3. **HTTPS \u8A8D\u8A3C\u3067 PAT \u3092\u30A4\u30F3\u30E9\u30A4\u30F3\u3067\u6E21\u3059\u3053\u3068\u3002** \`git clone https://<TOKEN>@github.com/<owner>/<repo>.git <target-dir>\` \u306E\u3088\u3046\u306B\u57CB\u3081\u8FBC\u307F\u307E\u3059\u3002\u30C8\u30FC\u30AF\u30F3\u5165\u308A\u306E URL \u3092\u305D\u306E\u307E\u307E\u30ED\u30B0\u306B\u51FA\u529B\u3057\u306A\u3044\u3088\u3046\u3001\u30B3\u30DE\u30F3\u30C9\u3092\u30A8\u30B3\u30FC\u3059\u308B\u969B\u306F\u30DE\u30B9\u30AF\u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
|
1000
1024
|
4. **shallow clone \u3092\u512A\u5148\u3059\u308B\u3053\u3068\u3002** \u5C65\u6B74\u304C\u7279\u306B\u5FC5\u8981\u3067\u306A\u3044\u9650\u308A \`--depth=1 --single-branch\` \u3092\u4F7F\u7528\u3057\u307E\u3059\u3002
|
|
1001
1025
|
5. **\u4F5C\u696D\u5F8C\u306F\u524A\u9664\u3059\u308B\u3053\u3068\u3002** \u63A2\u7D22\u304C\u7D42\u308F\u3063\u305F\u3089\u30AF\u30ED\u30FC\u30F3\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u524A\u9664\uFF08\`rm -rf <target-dir>\`\uFF09\u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
|
@@ -173,6 +173,15 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
173
173
|
* `runSetupFlow` from `setup-flow.ts`.
|
|
174
174
|
*/
|
|
175
175
|
setup;
|
|
176
|
+
/**
|
|
177
|
+
* 統一 introspection。SQL DB の `information_schema` / `SHOW` / `DESCRIBE` や SaaS の
|
|
178
|
+
* メタデータ API といった取得経路の差を吸収し、tables / columns / PK / FK を共通型
|
|
179
|
+
* {@link IntrospectedSchema} へ正規化して返す。取得経路は {@link IntrospectContext} で
|
|
180
|
+
* 抽象化され、SQL DB は `ctx.query`、SaaS は `ctx.proxyFetch` + `ctx.params` を使う。
|
|
181
|
+
* `ctx.profile === true` のときは L2 プロファイル(行数・NULL 率等)も best-effort で埋める。
|
|
182
|
+
* coding-agent の `DataContextIndex` がデータ地図を構築する際に使う。
|
|
183
|
+
*/
|
|
184
|
+
introspect;
|
|
176
185
|
/**
|
|
177
186
|
* Opt-out of the default "verify before save" behavior on connection
|
|
178
187
|
* creation. The backend invokes `checkConnection` synchronously while
|
|
@@ -187,6 +196,14 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
187
196
|
* the default verify-on-create behavior without opt-in.
|
|
188
197
|
*/
|
|
189
198
|
skipConnectionCheckOnCreate;
|
|
199
|
+
/**
|
|
200
|
+
* 決定論的な「立ち上げ survey」レシピ(ルールベース prewarm 基盤)。実装した connector は、LLM を使わずに
|
|
201
|
+
* read-only で自分を survey する probe 列(テーブル/列メタデータ → 小サンプル)を宣言する。coding-agent の
|
|
202
|
+
* recon driver がこれを読み、connector ツールの `execute` を直接呼んで結果を seed にする。未実装の connector は
|
|
203
|
+
* driver 側で safely skip される(その connection は listConnections のみ seed)。標準 `information_schema` を
|
|
204
|
+
* 持つ SQL connector は `makeStandardSqlSurveyProbes` を使える。**probe は必ず read-only**。
|
|
205
|
+
*/
|
|
206
|
+
surveyProbes;
|
|
190
207
|
constructor(config) {
|
|
191
208
|
this.slug = config.slug;
|
|
192
209
|
this.authType = config.authType;
|
|
@@ -204,7 +221,9 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
204
221
|
this.query = config.query;
|
|
205
222
|
this.checkConnection = config.checkConnection;
|
|
206
223
|
this.setup = config.setup;
|
|
224
|
+
this.introspect = config.introspect;
|
|
207
225
|
this.skipConnectionCheckOnCreate = config.skipConnectionCheckOnCreate;
|
|
226
|
+
this.surveyProbes = config.surveyProbes;
|
|
208
227
|
}
|
|
209
228
|
get connectorKey() {
|
|
210
229
|
return _ConnectorPlugin.deriveKey(this.slug, this.authType);
|
|
@@ -212,7 +231,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
212
231
|
/**
|
|
213
232
|
* Create tools for connections that belong to this connector.
|
|
214
233
|
* Filters connections by connectorKey internally.
|
|
215
|
-
* Returns tools keyed as
|
|
234
|
+
* Returns tools keyed as `connector_${connectorKey}_${toolName}`.
|
|
216
235
|
*/
|
|
217
236
|
createTools(connections, config, opts) {
|
|
218
237
|
const myConnections = connections.filter(
|
|
@@ -222,7 +241,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
222
241
|
for (const t of Object.values(this.tools)) {
|
|
223
242
|
const tool = t.createTool(myConnections, config);
|
|
224
243
|
const originalToModelOutput = tool.toModelOutput;
|
|
225
|
-
result[
|
|
244
|
+
result[`connector_${this.connectorKey}_${t.name}`] = {
|
|
226
245
|
...tool,
|
|
227
246
|
toModelOutput: async (options) => {
|
|
228
247
|
if (!originalToModelOutput) {
|
|
@@ -242,25 +261,25 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
242
261
|
if (authType) return `${slug}-${authType}`;
|
|
243
262
|
const LEGACY_NULL_AUTH_TYPE_MAP = {
|
|
244
263
|
// user-password
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
264
|
+
postgresql: "user-password",
|
|
265
|
+
mysql: "user-password",
|
|
266
|
+
clickhouse: "user-password",
|
|
267
|
+
kintone: "user-password",
|
|
249
268
|
"squadbase-db": "user-password",
|
|
250
269
|
// service-account
|
|
251
|
-
|
|
252
|
-
|
|
270
|
+
snowflake: "service-account",
|
|
271
|
+
bigquery: "service-account",
|
|
253
272
|
"google-analytics": "service-account",
|
|
254
273
|
"google-calendar": "service-account",
|
|
255
274
|
"aws-athena": "service-account",
|
|
256
|
-
|
|
275
|
+
redshift: "service-account",
|
|
257
276
|
// api-key
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
277
|
+
databricks: "api-key",
|
|
278
|
+
dbt: "api-key",
|
|
279
|
+
airtable: "api-key",
|
|
280
|
+
openai: "api-key",
|
|
281
|
+
gemini: "api-key",
|
|
282
|
+
anthropic: "api-key",
|
|
264
283
|
"wix-store": "api-key"
|
|
265
284
|
};
|
|
266
285
|
const fallbackAuthType = LEGACY_NULL_AUTH_TYPE_MAP[slug];
|
|
@@ -510,12 +529,12 @@ var gmailOnboarding = new ConnectorOnboarding({
|
|
|
510
529
|
- Write only 1 sentence between tool calls, then immediately call the next tool. Skip unnecessary explanations and proceed efficiently`
|
|
511
530
|
},
|
|
512
531
|
dataOverviewInstructions: {
|
|
513
|
-
en: `1. Call
|
|
514
|
-
2. Call
|
|
515
|
-
3. Call
|
|
516
|
-
ja: `1.
|
|
517
|
-
2.
|
|
518
|
-
3. \u5404\u30E1\u30C3\u30BB\u30FC\u30B8\u306B\u3064\u3044\u3066
|
|
532
|
+
en: `1. Call connector_gmail-oauth_request with GET /me/labels to list all labels
|
|
533
|
+
2. Call connector_gmail-oauth_request with GET /me/messages?maxResults=5 to get recent message IDs
|
|
534
|
+
3. Call connector_gmail-oauth_request with GET /me/messages/{id}?format=metadata for each message to see subjects and senders`,
|
|
535
|
+
ja: `1. connector_gmail-oauth_request \u3067 GET /me/labels \u3092\u547C\u3073\u51FA\u3057\u3001\u5168\u30E9\u30D9\u30EB\u4E00\u89A7\u3092\u53D6\u5F97
|
|
536
|
+
2. connector_gmail-oauth_request \u3067 GET /me/messages?maxResults=5 \u3092\u547C\u3073\u51FA\u3057\u3001\u6700\u65B0\u30E1\u30C3\u30BB\u30FC\u30B8ID\u3092\u53D6\u5F97
|
|
537
|
+
3. \u5404\u30E1\u30C3\u30BB\u30FC\u30B8\u306B\u3064\u3044\u3066 connector_gmail-oauth_request \u3067 GET /me/messages/{id}?format=metadata \u3092\u547C\u3073\u51FA\u3057\u3001\u4EF6\u540D\u3068\u9001\u4FE1\u8005\u3092\u78BA\u8A8D`
|
|
519
538
|
}
|
|
520
539
|
});
|
|
521
540
|
|
|
@@ -627,7 +646,7 @@ var gmailOauthConnector = new ConnectorPlugin({
|
|
|
627
646
|
systemPrompt: {
|
|
628
647
|
en: `### Tools
|
|
629
648
|
|
|
630
|
-
- \`
|
|
649
|
+
- \`connector_gmail-oauth_request\`: The only way to call the Gmail API (read-only). Use it to list messages, get message details, list labels, list threads, and get user profile. Authentication is configured automatically via OAuth.
|
|
631
650
|
|
|
632
651
|
### Gmail API Reference
|
|
633
652
|
|
|
@@ -710,7 +729,7 @@ thread.messages.forEach(m => console.log(m.snippet));
|
|
|
710
729
|
\`\`\``,
|
|
711
730
|
ja: `### \u30C4\u30FC\u30EB
|
|
712
731
|
|
|
713
|
-
- \`
|
|
732
|
+
- \`connector_gmail-oauth_request\`: Gmail API\u3092\u547C\u3073\u51FA\u3059\u552F\u4E00\u306E\u624B\u6BB5\u3067\u3059\uFF08\u8AAD\u307F\u53D6\u308A\u5C02\u7528\uFF09\u3002\u30E1\u30C3\u30BB\u30FC\u30B8\u4E00\u89A7\u306E\u53D6\u5F97\u3001\u30E1\u30C3\u30BB\u30FC\u30B8\u8A73\u7D30\u306E\u53D6\u5F97\u3001\u30E9\u30D9\u30EB\u4E00\u89A7\u3001\u30B9\u30EC\u30C3\u30C9\u4E00\u89A7\u3001\u30E6\u30FC\u30B6\u30FC\u30D7\u30ED\u30D5\u30A3\u30FC\u30EB\u306E\u53D6\u5F97\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002OAuth\u7D4C\u7531\u3067\u8A8D\u8A3C\u306F\u81EA\u52D5\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002
|
|
714
733
|
|
|
715
734
|
### Gmail API \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9
|
|
716
735
|
|