@hasna/connectors 0.5.9 → 0.6.0
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/bin/index.js +52 -128
- package/bin/mcp.js +1 -1
- package/package.json +1 -1
package/bin/index.js
CHANGED
|
@@ -7370,7 +7370,7 @@ var PRESETS = {
|
|
|
7370
7370
|
commerce: { description: "Commerce and finance", connectors: ["stripe", "shopify", "revolut", "mercury", "pandadoc"] }
|
|
7371
7371
|
};
|
|
7372
7372
|
var program2 = new Command;
|
|
7373
|
-
program2.name("connectors").description("Install API connectors for your project").version("0.
|
|
7373
|
+
program2.name("connectors").description("Install API connectors for your project").version("0.6.0").enablePositionalOptions();
|
|
7374
7374
|
program2.command("interactive", { isDefault: true }).alias("i").description("Interactive connector browser").action(() => {
|
|
7375
7375
|
if (!isTTY) {
|
|
7376
7376
|
console.log(`Non-interactive environment detected. Use a subcommand:
|
|
@@ -8371,145 +8371,69 @@ Open this URL to authenticate:
|
|
|
8371
8371
|
}
|
|
8372
8372
|
process.exit(0);
|
|
8373
8373
|
});
|
|
8374
|
-
program2.command("init").option("--json", "Output
|
|
8375
|
-
|
|
8376
|
-
|
|
8377
|
-
|
|
8378
|
-
|
|
8379
|
-
|
|
8380
|
-
|
|
8381
|
-
|
|
8382
|
-
|
|
8383
|
-
|
|
8384
|
-
|
|
8385
|
-
|
|
8374
|
+
program2.command("init").option("--json", "Output presets and suggestions as JSON (non-interactive)", false).description("Get started with Connectors \u2014 see suggestions, presets, and next steps").action(async (options) => {
|
|
8375
|
+
const initPresets = [
|
|
8376
|
+
{ key: "ai", emoji: "\uD83E\uDD16", label: "AI & ML", connectors: ["anthropic", "openai", "groq", "mistral", "googlegemini", "elevenlabs"], description: "AI and ML models" },
|
|
8377
|
+
{ key: "communication", emoji: "\uD83D\uDCAC", label: "Communication", connectors: ["gmail", "slack", "discord", "resend", "twilio"], description: "Messaging and communication" },
|
|
8378
|
+
{ key: "devtools", emoji: "\uD83D\uDEE0", label: "Developer Tools", connectors: ["github", "vercel", "sentry", "docker", "cloudflare", "firecrawl"], description: "Developer tooling" },
|
|
8379
|
+
{ key: "commerce", emoji: "\uD83D\uDCB3", label: "Commerce", connectors: ["stripe", "shopify", "paypal", "revolut", "mercury"], description: "Commerce and finance" },
|
|
8380
|
+
{ key: "google", emoji: "\uD83D\uDCC1", label: "Google Workspace", connectors: ["gmail", "googledrive", "googlecalendar", "googledocs", "googlesheets"], description: "Google Workspace suite" }
|
|
8381
|
+
];
|
|
8382
|
+
const connectorsHome = join6(homedir3(), ".connectors");
|
|
8383
|
+
let configuredCount = 0;
|
|
8384
|
+
const configuredNames = [];
|
|
8385
|
+
try {
|
|
8386
|
+
if (existsSync6(connectorsHome)) {
|
|
8387
|
+
const entries = readdirSync4(connectorsHome).filter((e) => e.startsWith("connect-") && statSync3(join6(connectorsHome, e)).isDirectory());
|
|
8388
|
+
for (const entry of entries) {
|
|
8389
|
+
const profilesDir = join6(connectorsHome, entry, "profiles");
|
|
8390
|
+
if (existsSync6(profilesDir)) {
|
|
8391
|
+
configuredCount++;
|
|
8392
|
+
configuredNames.push(entry.replace(/^connect-/, ""));
|
|
8393
|
+
}
|
|
8394
|
+
}
|
|
8395
|
+
}
|
|
8396
|
+
} catch {}
|
|
8397
|
+
const jsonData = {
|
|
8398
|
+
total: CONNECTORS.length,
|
|
8399
|
+
configured: configuredCount,
|
|
8400
|
+
configuredConnectors: configuredNames,
|
|
8401
|
+
presets: initPresets.map((p) => ({
|
|
8402
|
+
key: p.key,
|
|
8403
|
+
label: p.label,
|
|
8404
|
+
description: p.description,
|
|
8405
|
+
connectors: p.connectors
|
|
8406
|
+
}))
|
|
8407
|
+
};
|
|
8408
|
+
if (options.json || !isTTY) {
|
|
8409
|
+
console.log(JSON.stringify(jsonData, null, 2));
|
|
8386
8410
|
process.exit(0);
|
|
8387
8411
|
return;
|
|
8388
8412
|
}
|
|
8389
|
-
if (!isTTY) {
|
|
8390
|
-
console.error("Interactive mode requires a TTY. Use --json for non-interactive output.");
|
|
8391
|
-
process.exit(1);
|
|
8392
|
-
return;
|
|
8393
|
-
}
|
|
8394
|
-
function ask(question) {
|
|
8395
|
-
return new Promise((resolve) => {
|
|
8396
|
-
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
8397
|
-
rl.question(question, (answer) => {
|
|
8398
|
-
rl.close();
|
|
8399
|
-
resolve(answer.trim());
|
|
8400
|
-
});
|
|
8401
|
-
});
|
|
8402
|
-
}
|
|
8403
8413
|
console.log();
|
|
8404
|
-
console.log(chalk2.bold(
|
|
8405
|
-
console.log(chalk2.dim(`Let's get you set up with the API connectors you need.
|
|
8406
|
-
`));
|
|
8407
|
-
console.log(chalk2.bold(`Available categories:
|
|
8408
|
-
`));
|
|
8409
|
-
const categoryList = CATEGORIES.map((cat) => ({
|
|
8410
|
-
name: cat,
|
|
8411
|
-
connectors: getConnectorsByCategory(cat)
|
|
8412
|
-
}));
|
|
8413
|
-
for (let i = 0;i < categoryList.length; i++) {
|
|
8414
|
-
const c = categoryList[i];
|
|
8415
|
-
console.log(` ${chalk2.cyan(String(i + 1).padStart(2))}. ${c.name} ${chalk2.dim(`(${c.connectors.length} connectors)`)}`);
|
|
8416
|
-
}
|
|
8414
|
+
console.log(chalk2.bold(`Welcome to Connectors! ${CONNECTORS.length} API connectors ready to use.`));
|
|
8417
8415
|
console.log();
|
|
8418
|
-
|
|
8419
|
-
|
|
8420
|
-
console.log(
|
|
8421
|
-
No categories selected. Exiting.
|
|
8422
|
-
`));
|
|
8423
|
-
process.exit(0);
|
|
8424
|
-
return;
|
|
8416
|
+
if (configuredCount > 0) {
|
|
8417
|
+
console.log(chalk2.green(` You already have ${configuredCount} connector${configuredCount === 1 ? "" : "s"} configured`) + chalk2.dim(` (${configuredNames.slice(0, 5).join(", ")}${configuredNames.length > 5 ? ", ..." : ""})`));
|
|
8418
|
+
console.log();
|
|
8425
8419
|
}
|
|
8426
|
-
|
|
8427
|
-
if (catIndices.length === 0) {
|
|
8428
|
-
console.log(chalk2.red(`
|
|
8429
|
-
No valid categories selected. Exiting.
|
|
8420
|
+
console.log(chalk2.bold(`Quick start bundles:
|
|
8430
8421
|
`));
|
|
8431
|
-
|
|
8432
|
-
|
|
8433
|
-
|
|
8434
|
-
const selectedCategories = catIndices.map((i) => categoryList[i]);
|
|
8435
|
-
const seen = new Set;
|
|
8436
|
-
const connectorPool = [];
|
|
8437
|
-
for (const cat of selectedCategories) {
|
|
8438
|
-
for (const c of cat.connectors) {
|
|
8439
|
-
if (!seen.has(c.name)) {
|
|
8440
|
-
seen.add(c.name);
|
|
8441
|
-
connectorPool.push({
|
|
8442
|
-
name: c.name,
|
|
8443
|
-
displayName: c.displayName,
|
|
8444
|
-
description: c.description,
|
|
8445
|
-
category: cat.name
|
|
8446
|
-
});
|
|
8447
|
-
}
|
|
8448
|
-
}
|
|
8422
|
+
for (const preset of initPresets) {
|
|
8423
|
+
console.log(` ${preset.emoji} ${chalk2.bold(preset.label)} ${chalk2.dim(`(${preset.connectors.length} connectors)`)}`);
|
|
8424
|
+
console.log(` ${chalk2.dim(preset.connectors.slice(0, 5).join(", ") + (preset.connectors.length > 5 ? ", ..." : ""))}`);
|
|
8449
8425
|
}
|
|
8450
8426
|
console.log();
|
|
8451
|
-
console.log(
|
|
8452
|
-
`));
|
|
8453
|
-
const nameWidth = Math.max(12, ...connectorPool.map((c) => c.name.length)) + 2;
|
|
8454
|
-
for (let i = 0;i < connectorPool.length; i++) {
|
|
8455
|
-
const c = connectorPool[i];
|
|
8456
|
-
console.log(` ${chalk2.cyan(String(i + 1).padStart(3))}. ${c.name.padEnd(nameWidth)}${chalk2.dim(c.description)}`);
|
|
8457
|
-
}
|
|
8427
|
+
console.log(`Run ${chalk2.cyan("connectors install --preset ai")} to install a bundle, or ${chalk2.cyan("connectors setup <name> --key <key>")} to set up a specific connector.`);
|
|
8458
8428
|
console.log();
|
|
8459
|
-
|
|
8460
|
-
if (!connAnswer) {
|
|
8461
|
-
console.log(chalk2.dim(`
|
|
8462
|
-
No connectors selected. Exiting.
|
|
8463
|
-
`));
|
|
8464
|
-
process.exit(0);
|
|
8465
|
-
return;
|
|
8466
|
-
}
|
|
8467
|
-
let toInstall;
|
|
8468
|
-
if (connAnswer.toLowerCase() === "all") {
|
|
8469
|
-
toInstall = connectorPool.map((c) => c.name);
|
|
8470
|
-
} else {
|
|
8471
|
-
const connIndices = connAnswer.split(",").map((s) => parseInt(s.trim(), 10) - 1).filter((i) => i >= 0 && i < connectorPool.length);
|
|
8472
|
-
if (connIndices.length === 0) {
|
|
8473
|
-
console.log(chalk2.red(`
|
|
8474
|
-
No valid connectors selected. Exiting.
|
|
8475
|
-
`));
|
|
8476
|
-
process.exit(1);
|
|
8477
|
-
return;
|
|
8478
|
-
}
|
|
8479
|
-
toInstall = connIndices.map((i) => connectorPool[i].name);
|
|
8480
|
-
}
|
|
8481
|
-
console.log(chalk2.bold(`
|
|
8482
|
-
Installing ${toInstall.length} connector(s)...
|
|
8429
|
+
console.log(chalk2.bold(`Next steps:
|
|
8483
8430
|
`));
|
|
8484
|
-
|
|
8485
|
-
|
|
8486
|
-
|
|
8487
|
-
|
|
8488
|
-
console.log(chalk2.green(` \u2713 ${result.connector}`));
|
|
8489
|
-
succeeded.push(result.connector);
|
|
8490
|
-
} else {
|
|
8491
|
-
console.log(chalk2.red(` \u2717 ${result.connector}: ${result.error}`));
|
|
8492
|
-
}
|
|
8493
|
-
}
|
|
8494
|
-
if (succeeded.length > 0) {
|
|
8495
|
-
console.log(chalk2.bold(`
|
|
8496
|
-
Next steps:
|
|
8497
|
-
`));
|
|
8498
|
-
console.log(` ${chalk2.dim("1.")} Import in your code:`);
|
|
8499
|
-
console.log(` ${chalk2.cyan(`import { ${succeeded.slice(0, 3).join(", ")}${succeeded.length > 3 ? ", ..." : ""} } from './.connectors'`)}`);
|
|
8500
|
-
console.log();
|
|
8501
|
-
console.log(` ${chalk2.dim("2.")} Configure authentication:`);
|
|
8502
|
-
console.log(` ${chalk2.cyan("connectors auth <name>")} ${chalk2.dim("\u2014 set API keys interactively")}`);
|
|
8503
|
-
console.log(` ${chalk2.cyan("connectors serve")} ${chalk2.dim("\u2014 open dashboard for OAuth setup")}`);
|
|
8504
|
-
console.log();
|
|
8505
|
-
console.log(` ${chalk2.dim("3.")} Check connector docs:`);
|
|
8506
|
-
console.log(` ${chalk2.cyan(`connectors docs ${succeeded[0]}`)} ${chalk2.dim("\u2014 see auth & env var details")}`);
|
|
8507
|
-
console.log();
|
|
8508
|
-
console.log(` ${chalk2.dim("4.")} Verify everything works:`);
|
|
8509
|
-
console.log(` ${chalk2.cyan("connectors doctor")} ${chalk2.dim("\u2014 health check all connectors")}`);
|
|
8510
|
-
}
|
|
8431
|
+
console.log(` ${chalk2.cyan("connectors list")} ${chalk2.dim(`\u2014 browse all ${CONNECTORS.length} connectors`)}`);
|
|
8432
|
+
console.log(` ${chalk2.cyan("connectors setup <name> --key <key>")} ${chalk2.dim("\u2014 set up a connector")}`);
|
|
8433
|
+
console.log(` ${chalk2.cyan("connectors ops <name>")} ${chalk2.dim("\u2014 see what a connector can do")}`);
|
|
8434
|
+
console.log(` ${chalk2.cyan("connectors serve")} ${chalk2.dim("\u2014 open the auth dashboard")}`);
|
|
8511
8435
|
console.log();
|
|
8512
|
-
process.exit(
|
|
8436
|
+
process.exit(0);
|
|
8513
8437
|
});
|
|
8514
8438
|
var SENSITIVE_FIELDS = new Set([
|
|
8515
8439
|
"clientsecret",
|
package/bin/mcp.js
CHANGED
|
@@ -20852,7 +20852,7 @@ async function getConnectorCommandHelp(name, command) {
|
|
|
20852
20852
|
loadConnectorVersions();
|
|
20853
20853
|
var server = new McpServer({
|
|
20854
20854
|
name: "connectors",
|
|
20855
|
-
version: "0.
|
|
20855
|
+
version: "0.6.0"
|
|
20856
20856
|
});
|
|
20857
20857
|
server.registerTool("search_connectors", {
|
|
20858
20858
|
title: "Search Connectors",
|