goodcryptox-connector 3.1.1 → 3.2.0-21299

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +2 -2
  2. package/index.mjs +12 -3
  3. package/package.json +3 -3
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
- # goodcryptoX connector
1
+ # goodcryptoX MCP server
2
2
 
3
3
  Connects an AI app (Claude Code, Codex, Cursor or any app that speaks MCP over standard input and output) to **your own goodcryptoX installation**, as far as the access key you give it allows: reading your accounts, orders, bots and history; proposing orders and bots for you to launch; or, with a Trade key, trading within the limits you set on the key.
4
4
 
5
- You do not install this package yourself. In goodcryptoX, open **Settings › MCP & API**, pick a key, and copy the line for your app: it runs this package at the exact version of your goodcryptoX, with your installation's address and your key filled in. The guide: [Connect an AI agent](https://docs.goodcrypto.app/goodcryptox-3.0/connect-an-ai-agent).
5
+ You do not install this package yourself. In goodcryptoX, open **Settings › MCP & API**, pick a key, and copy the line for your app: it runs this package at the exact version of your goodcryptoX, with your installation's address and your key filled in. The guide: [AI agents](https://docs.goodcrypto.app/goodcryptox-3.0/ai-agents).
6
6
 
7
7
  ## Where it connects
8
8
 
package/index.mjs CHANGED
@@ -16386,11 +16386,11 @@ class Server extends Protocol {
16386
16386
  return this.notification({ method: "notifications/prompts/list_changed" });
16387
16387
  }
16388
16388
  }
16389
- const version = "3.1.1";
16389
+ const version = "3.2.0";
16390
16390
  const pkg = {
16391
16391
  version
16392
16392
  };
16393
- const INSTRUCTIONS = 'Access to a goodcryptoX trading runtime, as far as this key allows: reading accounts, instruments, orders, bots, history, candles and the current state of a topic, and previewing orders and DCA or Grid bots without placing them; with a Propose or trading key, proposing orders and bots for a person to review and launch; with a trading key, placing and canceling orders, setting leverage, and creating, changing, stopping and closing its own DCA or Grid bots within the limits a person set on the key. Every price, size and amount is a decimal string: read it as text, never as a floating-point number. A tool that answers "not yet known" means the runtime has not received that data yet: it is not empty and not zero; try again shortly. A tool that writes takes a `requestId` in its body: new for each new action, the same when retrying after no answer.';
16393
+ const INSTRUCTIONS = 'Access to a goodcryptoX trading runtime, as far as this key allows: reading accounts, instruments, orders, bots, history, candles, the current state of a topic, the base currency, credits, the referral program and this key\'s own limits, and previewing orders and DCA or Grid bots without placing them; with a Propose or trading key, proposing orders and bots for a person to review and launch; with a trading key, placing and canceling orders, setting leverage, and creating, changing, stopping and closing its own DCA or Grid bots within the limits a person set on the key. Every price, size and amount is a decimal string: read it as text, never as a floating-point number. A tool that answers "not yet known" means the runtime has not received that data yet: it is not empty and not zero; try again shortly. A tool that writes takes a `requestId` in its body: new for each new action, the same when retrying after no answer.';
16394
16394
  function createApiServer(o) {
16395
16395
  const base = o.url.replace(/\/+$/, "");
16396
16396
  const auth = { authorization: `Bearer ${o.key}` };
@@ -23355,7 +23355,16 @@ async function sameInstallation(url, r) {
23355
23355
  return false;
23356
23356
  }
23357
23357
  }
23358
+ class NotAnswering extends Error {
23359
+ constructor(url) {
23360
+ super(`goodcryptoX does not answer at ${url}. Copy the line again from goodcryptoX`);
23361
+ }
23362
+ }
23358
23363
  async function open(env, url, relay = connector) {
23364
+ if (url !== void 0 && env.GCX_R !== void 0 && env.GCX_RELAY === void 0 && env.GCX_MAILBOX === void 0) {
23365
+ if (await sameInstallation(url, env.GCX_R)) return null;
23366
+ throw new NotAnswering(url);
23367
+ }
23359
23368
  const remote = [env.GCX_RELAY, env.GCX_MAILBOX, env.GCX_R].some((v) => v !== void 0);
23360
23369
  if (url !== void 0 && (!remote || await sameInstallation(url, env.GCX_R))) {
23361
23370
  delete env.GCX_PAIR;
@@ -23688,7 +23697,7 @@ async function mcp() {
23688
23697
  await server.connect(new StdioServerTransport());
23689
23698
  } catch (e) {
23690
23699
  closeRemote();
23691
- const message2 = e instanceof Error && Object.values(sentences).some((s) => s === e.message) ? e.message : sentences.verify;
23700
+ const message2 = e instanceof NotAnswering || e instanceof Error && Object.values(sentences).some((s) => s === e.message) ? e.message : sentences.verify;
23692
23701
  process.stderr.write(`${message2}
23693
23702
  `);
23694
23703
  process.exitCode = 2;
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "goodcryptox-connector",
3
- "description": "Connects an AI app (Claude, Codex, Cursor or any MCP app) to your own goodcryptoX installation, on this computer or another, as far as its access key allows.",
3
+ "description": "The goodcryptoX MCP server: connects an AI app (Claude, Codex, Cursor or any MCP app) to your own goodcryptoX installation, on this computer or another, as far as its access key allows.",
4
4
  "license": "MIT",
5
5
  "author": "goodcryptoX",
6
- "homepage": "https://docs.goodcrypto.app/goodcryptox-3.0/connect-an-ai-agent",
6
+ "homepage": "https://docs.goodcrypto.app/goodcryptox-3.0/ai-agents",
7
7
  "bugs": {
8
8
  "email": "support@goodcrypto.app"
9
9
  },
@@ -26,5 +26,5 @@
26
26
  "engines": {
27
27
  "node": ">=18"
28
28
  },
29
- "version": "3.1.1"
29
+ "version": "3.2.0-21299"
30
30
  }