Lines 16-100javascript
17var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
18 // If the importer is in node compatibility mode or this is not an ESM
19 // file that has been converted to a CommonJS file using a Babel-
20 // compatible transform (i.e. "__esModule" has not been set), then set
21 // "default" to the CommonJS "module.exports" for node compatibility.
22 isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27var import_yargs = __toESM(require("yargs"));
28var import_helpers = require("yargs/helpers");
31var import_node_fetch2 = __toESM(require("node-fetch"));
34var import_fs = require("fs");
35var import_os = require("os");
36var import_path = require("path");
37var CONFIG_DIR = (0, import_path.join)((0, import_os.homedir)(), ".signals");
38var CONFIG_FILE = (0, import_path.join)(CONFIG_DIR, "config.json");
39function getConfigPath() {
42function saveConfig(config) {
43 if (!(0, import_fs.existsSync)(CONFIG_DIR)) {
44 (0, import_fs.mkdirSync)(CONFIG_DIR, { recursive: true, mode: 448 });
46 (0, import_fs.writeFileSync)(CONFIG_FILE, JSON.stringify(config, null, 2) + "\n", { mode: 384 });
48function loadSavedConfig() {
49 if (!(0, import_fs.existsSync)(CONFIG_FILE)) return null;
51 const data = JSON.parse((0, import_fs.readFileSync)(CONFIG_FILE, "utf-8"));
53 if (typeof data.apiKey === "string") config.apiKey = data.apiKey;
54 if (typeof data.accessToken === "string") config.accessToken = data.accessToken;
55 if (typeof data.refreshToken === "string") config.refreshToken = data.refreshToken;
56 if (typeof data.expiresAt === "number") config.expiresAt = data.expiresAt;
57 if (typeof data.tokenType === "string") config.tokenType = data.tokenType;
58 if (config.apiKey || config.accessToken) return config;
63function clearConfig() {
64 if ((0, import_fs.existsSync)(CONFIG_FILE)) {
65 (0, import_fs.unlinkSync)(CONFIG_FILE);
71 const envKey = process.env.SIGNALS_API_KEY;
72 if (envKey) return { apiKey: envKey };
73 const saved = loadSavedConfig();
74 if (saved) return saved;
75 console.error("Error: Not authenticated.");
76 console.error('Run "max login" to connect, or set SIGNALS_API_KEY in your environment.');
81var import_child_process = require("child_process");
82var import_node_fetch = __toESM(require("node-fetch"));
HighSandbox Evasion Gated Capability
Source gates dangerous network, credential, or execution behavior behind CI, host, platform, time, or geo fingerprint checks.
dist/index.jsView on unpkg · L36 HighChild Process
Package source references child process execution.
dist/index.jsView on unpkg · L80 83var DEVICE_CODE_GRANT = "urn:ietf:params:oauth:grant-type:device_code";
84function oauthBaseUrl() {
85 return (process.env.SIGNALS_OAUTH_URL || "https://yourmax.ai").replace(/\/$/, "");
86}
HighSame File Env Network Execution
A single source file combines environment access, network access, and code or shell execution; review context before blocking.
dist/index.jsView on unpkg · L70 88 return process.env.SIGNALS_CLI_CLIENT_ID || "signals-cli";
90async function parseJson(response) {
91 const text = await response.text();
93 return text ? JSON.parse(text) : {};
95 return { error: "invalid_response", error_description: text };
98function toTokenSet(json) {
100 accessToken: json.access_token,