@arelay/cli
Advanced tools
+13
-2
@@ -43,9 +43,20 @@ #!/usr/bin/env node | ||
| function clientFromFlags(values) { | ||
| const token = values.token ?? process.env.ARELAY_TOKEN ?? process.env.AGENT_API_TOKEN; | ||
| const token = values.token ?? process.env.ARELAY_TOKEN; | ||
| if (!token) { | ||
| // Name the removed variable instead of reporting a generic "no token", otherwise | ||
| // anyone still on AGENT_API_TOKEN sees a token error while a token is plainly set. | ||
| if (process.env.AGENT_API_TOKEN) { | ||
| fail('AGENT_API_TOKEN is no longer read. Rename it to ARELAY_TOKEN.'); | ||
| } | ||
| fail('No agent API token. Set ARELAY_TOKEN (portal → Account → Agent API tokens) or pass --token.'); | ||
| } | ||
| // A stale AGENT_RELAY_URL would otherwise fall through to the hosted default, so a | ||
| // self-hosted setup would quietly aim at arelay.app. Warn on stderr, which keeps the | ||
| // MCP stdio JSON-RPC stream on stdout clean. | ||
| if (!values.url && !process.env.ARELAY_URL && process.env.AGENT_RELAY_URL) { | ||
| console.error('Warning: AGENT_RELAY_URL is no longer read — rename it to ARELAY_URL. Using the default base URL.'); | ||
| } | ||
| return new ArelayClient({ | ||
| token, | ||
| baseUrl: values.url ?? process.env.ARELAY_URL ?? process.env.AGENT_RELAY_URL ?? undefined | ||
| baseUrl: values.url ?? process.env.ARELAY_URL ?? undefined | ||
| }); | ||
@@ -52,0 +63,0 @@ } |
+1
-1
@@ -71,3 +71,3 @@ import { type EncryptedEnvelope, type JsonWebKey } from './e2ee.js'; | ||
| constructor(options: ArelayClientOptions); | ||
| /** Build a client from ARELAY_TOKEN / ARELAY_URL (legacy AGENT_API_TOKEN / AGENT_RELAY_URL also accepted). */ | ||
| /** Build a client from ARELAY_TOKEN / ARELAY_URL. */ | ||
| static fromEnv(env?: NodeJS.ProcessEnv): ArelayClient; | ||
@@ -74,0 +74,0 @@ portalUrl(sessionId: string): string; |
+13
-3
@@ -51,11 +51,21 @@ import { encryptBytes, encryptString, envelopeToPayload } from './e2ee.js'; | ||
| } | ||
| /** Build a client from ARELAY_TOKEN / ARELAY_URL (legacy AGENT_API_TOKEN / AGENT_RELAY_URL also accepted). */ | ||
| /** Build a client from ARELAY_TOKEN / ARELAY_URL. */ | ||
| static fromEnv(env = process.env) { | ||
| const token = env.ARELAY_TOKEN ?? env.AGENT_API_TOKEN; | ||
| const token = env.ARELAY_TOKEN; | ||
| if (!token) { | ||
| // Point at the rename rather than reporting a missing token to someone who has | ||
| // one set under the name this used to accept. | ||
| if (env.AGENT_API_TOKEN) { | ||
| throw new Error('AGENT_API_TOKEN is no longer read. Rename it to ARELAY_TOKEN.'); | ||
| } | ||
| throw new Error('Set ARELAY_TOKEN to an agent API token from the portal.'); | ||
| } | ||
| // Failing beats silently defaulting to the hosted URL when a self-hosted | ||
| // deployment is configured under the old name. | ||
| if (!env.ARELAY_URL && env.AGENT_RELAY_URL) { | ||
| throw new Error('AGENT_RELAY_URL is no longer read. Rename it to ARELAY_URL.'); | ||
| } | ||
| return new ArelayClient({ | ||
| token, | ||
| baseUrl: env.ARELAY_URL ?? env.AGENT_RELAY_URL ?? DEFAULT_BASE_URL | ||
| baseUrl: env.ARELAY_URL ?? DEFAULT_BASE_URL | ||
| }); | ||
@@ -62,0 +72,0 @@ } |
| /** Kept in sync with package.json — version.test.ts fails the build if it drifts. */ | ||
| export declare const PACKAGE_VERSION = "0.1.6"; | ||
| export declare const PACKAGE_VERSION = "0.2.0"; |
+1
-1
| /** Kept in sync with package.json — version.test.ts fails the build if it drifts. */ | ||
| export const PACKAGE_VERSION = '0.1.6'; | ||
| export const PACKAGE_VERSION = '0.2.0'; |
+1
-1
| { | ||
| "name": "@arelay/cli", | ||
| "version": "0.1.6", | ||
| "version": "0.2.0", | ||
| "mcpName": "io.github.mmmikael/arelay", | ||
@@ -5,0 +5,0 @@ "publishConfig": { |
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
41955
2.78%891
2.41%12
9.09%