@quantish/agent 0.1.38 → 0.1.40
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/index.js +15 -64
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -424,10 +424,22 @@ var MCPClientManager = class {
|
|
|
424
424
|
} catch (error2) {
|
|
425
425
|
console.warn("Failed to fetch Discovery MCP tools:", error2);
|
|
426
426
|
}
|
|
427
|
+
const discoverySearchTools = /* @__PURE__ */ new Set([
|
|
428
|
+
"search_markets",
|
|
429
|
+
"get_market_details",
|
|
430
|
+
"get_trending_markets",
|
|
431
|
+
"get_categories",
|
|
432
|
+
"get_market_stats",
|
|
433
|
+
"get_search_status",
|
|
434
|
+
"find_arbitrage"
|
|
435
|
+
]);
|
|
427
436
|
if (this.tradingClient) {
|
|
428
437
|
try {
|
|
429
438
|
const tradingTools = await this.tradingClient.listTools();
|
|
430
439
|
for (const tool of tradingTools) {
|
|
440
|
+
if (discoverySearchTools.has(tool.name)) {
|
|
441
|
+
continue;
|
|
442
|
+
}
|
|
431
443
|
allTools.push({ ...tool, source: "trading" });
|
|
432
444
|
this.toolSourceMap.set(tool.name, "trading");
|
|
433
445
|
}
|
|
@@ -662,40 +674,9 @@ async function runSetup() {
|
|
|
662
674
|
let skipTrading = false;
|
|
663
675
|
if (quantishKey) {
|
|
664
676
|
console.log(chalk.dim(`Current trading key: ${quantishKey.slice(0, 12)}...`));
|
|
665
|
-
const action = await prompt("Keep (Enter), new key (n),
|
|
677
|
+
const action = await prompt("Keep current key (Enter), enter new key (n), or disable trading (d): ");
|
|
666
678
|
if (action.toLowerCase() === "n") {
|
|
667
679
|
quantishKey = await prompt("Enter your Quantish Trading API key: ", true);
|
|
668
|
-
} else if (action.toLowerCase() === "c") {
|
|
669
|
-
console.log(chalk.dim("\nCreating a new wallet on Quantish Signing Server..."));
|
|
670
|
-
const externalId = await prompt("Enter a unique identifier (e.g., email or username): ");
|
|
671
|
-
if (!externalId) {
|
|
672
|
-
console.log(chalk.red("Identifier is required to create an account."));
|
|
673
|
-
console.log(chalk.dim("Keeping current key.\n"));
|
|
674
|
-
} else {
|
|
675
|
-
try {
|
|
676
|
-
const mcpClient = createMCPClient(config.getTradingMcpUrl(), "");
|
|
677
|
-
const result = await mcpClient.callTool("request_api_key", { externalId });
|
|
678
|
-
if (result.success && typeof result.data === "object" && result.data !== null) {
|
|
679
|
-
const data = result.data;
|
|
680
|
-
quantishKey = data.apiKey;
|
|
681
|
-
console.log(chalk.green("\n\u2713 New wallet created!"));
|
|
682
|
-
console.log(chalk.dim(` EOA Address: ${data.eoaAddress}`));
|
|
683
|
-
console.log(chalk.dim(" (Your Safe wallet will deploy on first trade)\n"));
|
|
684
|
-
if (data.apiSecret) {
|
|
685
|
-
console.log(chalk.yellow("\u26A0\uFE0F Save your API secret (shown only once):"));
|
|
686
|
-
console.log(chalk.bold.yellow(` ${String(data.apiSecret)}`));
|
|
687
|
-
console.log();
|
|
688
|
-
}
|
|
689
|
-
} else {
|
|
690
|
-
console.log(chalk.red("Failed to create wallet: " + (result.error || "Unknown error")));
|
|
691
|
-
console.log(chalk.dim("Keeping current key.\n"));
|
|
692
|
-
}
|
|
693
|
-
} catch (error2) {
|
|
694
|
-
console.log(chalk.red("Failed to connect to Quantish Trading Server."));
|
|
695
|
-
console.log(chalk.dim(String(error2)));
|
|
696
|
-
console.log(chalk.dim("Keeping current key.\n"));
|
|
697
|
-
}
|
|
698
|
-
}
|
|
699
680
|
} else if (action.toLowerCase() === "d") {
|
|
700
681
|
quantishKey = void 0;
|
|
701
682
|
skipTrading = true;
|
|
@@ -759,39 +740,9 @@ async function runSetup() {
|
|
|
759
740
|
let skipKalshi = false;
|
|
760
741
|
if (kalshiKey) {
|
|
761
742
|
console.log(chalk.dim(`Current Kalshi key: ${kalshiKey.slice(0, 12)}...`));
|
|
762
|
-
const action = await prompt("Keep (Enter), new key (n),
|
|
743
|
+
const action = await prompt("Keep current key (Enter), enter new key (n), or disable Kalshi (d): ");
|
|
763
744
|
if (action.toLowerCase() === "n") {
|
|
764
745
|
kalshiKey = await prompt("Enter your Kalshi API key: ", true);
|
|
765
|
-
} else if (action.toLowerCase() === "c") {
|
|
766
|
-
console.log(chalk.dim("\nCreating a new Solana wallet on Kalshi MCP..."));
|
|
767
|
-
const externalId = await prompt("Enter a unique identifier (e.g., email or username): ");
|
|
768
|
-
if (!externalId) {
|
|
769
|
-
console.log(chalk.red("Identifier is required to create an account."));
|
|
770
|
-
console.log(chalk.dim("Keeping current key.\n"));
|
|
771
|
-
} else {
|
|
772
|
-
try {
|
|
773
|
-
const kalshiClient = createMCPClient(KALSHI_MCP_URL, "", "kalshi");
|
|
774
|
-
const result = await kalshiClient.callTool("kalshi_signup", { externalId });
|
|
775
|
-
if (result.success && typeof result.data === "object" && result.data !== null) {
|
|
776
|
-
const data = result.data;
|
|
777
|
-
kalshiKey = data.apiKey;
|
|
778
|
-
console.log(chalk.green("\n\u2713 New Kalshi wallet created!"));
|
|
779
|
-
console.log(chalk.dim(` Solana Address: ${data.walletAddress}`));
|
|
780
|
-
if (data.apiSecret) {
|
|
781
|
-
console.log(chalk.yellow("\n\u26A0\uFE0F Save your API secret (shown only once):"));
|
|
782
|
-
console.log(chalk.bold.yellow(` ${String(data.apiSecret)}`));
|
|
783
|
-
console.log();
|
|
784
|
-
}
|
|
785
|
-
} else {
|
|
786
|
-
console.log(chalk.red("Failed to create wallet: " + (result.error || "Unknown error")));
|
|
787
|
-
console.log(chalk.dim("Keeping current key.\n"));
|
|
788
|
-
}
|
|
789
|
-
} catch (error2) {
|
|
790
|
-
console.log(chalk.red("Failed to connect to Kalshi MCP."));
|
|
791
|
-
console.log(chalk.dim(String(error2)));
|
|
792
|
-
console.log(chalk.dim("Keeping current key.\n"));
|
|
793
|
-
}
|
|
794
|
-
}
|
|
795
746
|
} else if (action.toLowerCase() === "d") {
|
|
796
747
|
kalshiKey = void 0;
|
|
797
748
|
skipKalshi = true;
|
|
@@ -5488,7 +5439,7 @@ Stopped ${count} background process${count > 1 ? "es" : ""}.`);
|
|
|
5488
5439
|
}
|
|
5489
5440
|
|
|
5490
5441
|
// src/index.ts
|
|
5491
|
-
var VERSION = "0.1.
|
|
5442
|
+
var VERSION = "0.1.36";
|
|
5492
5443
|
function cleanup() {
|
|
5493
5444
|
if (processManager.hasRunning()) {
|
|
5494
5445
|
const count = processManager.runningCount();
|