@solongate/proxy 0.82.18 → 0.82.20

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 (2) hide show
  1. package/dist/index.js +112 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -13964,6 +13964,9 @@ var init_pull_push = __esm({
13964
13964
 
13965
13965
  // src/index.ts
13966
13966
  init_config();
13967
+ import { readFileSync as readFileSync15 } from "fs";
13968
+ import { fileURLToPath as fileURLToPath4 } from "url";
13969
+ import { dirname as dirname4, join as join17 } from "path";
13967
13970
 
13968
13971
  // src/proxy.ts
13969
13972
  import { Server } from "@modelcontextprotocol/sdk/server/index.js";
@@ -16987,7 +16990,8 @@ ${msg.content.text}`;
16987
16990
  // src/index.ts
16988
16991
  init_cli_utils();
16989
16992
  var CLI_SUBCOMMANDS = /* @__PURE__ */ new Set(["shield", "create", "inject", "pull", "push", "list", "ls", "logs-server", "local-logs", "policy", "ratelimit", "dlp", "stats", "audit", "agents", "agent", "doctor", "watch", "keys", "mcp", "alerts", "webhooks", "dataroom"]);
16990
- var IS_HUMAN_CLI = process.argv.length <= 2 || CLI_SUBCOMMANDS.has(process.argv[2] ?? "");
16993
+ var CLI_INFO_ARGS = /* @__PURE__ */ new Set(["login", "help", "--help", "-h", "--version", "-v", "version"]);
16994
+ var IS_HUMAN_CLI = process.argv.length <= 2 || CLI_SUBCOMMANDS.has(process.argv[2] ?? "") || CLI_INFO_ARGS.has(process.argv[2] ?? "");
16991
16995
  if (!IS_HUMAN_CLI) {
16992
16996
  console.log = (...args) => {
16993
16997
  process.stderr.write(`[SolonGate] ${args.map(String).join(" ")}
@@ -17002,24 +17006,113 @@ if (!IS_HUMAN_CLI) {
17002
17006
  `);
17003
17007
  };
17004
17008
  }
17009
+ var PKG_VERSION = (() => {
17010
+ try {
17011
+ const p = join17(dirname4(fileURLToPath4(import.meta.url)), "..", "package.json");
17012
+ return JSON.parse(readFileSync15(p, "utf-8")).version || "unknown";
17013
+ } catch {
17014
+ return "unknown";
17015
+ }
17016
+ })();
17005
17017
  function printWelcome() {
17006
17018
  console.log("");
17007
- console.log(` ${c.bold}${c.blue4}SolonGate${c.reset} ${c.dim}\u2014 secure gateway for your AI agents${c.reset}`);
17019
+ console.log(` ${c.bold}${c.blue4}SolonGate${c.reset} ${c.dim}secure gateway for your AI agents${c.reset}`);
17008
17020
  console.log("");
17009
17021
  console.log(" Get started with one command:");
17010
17022
  console.log("");
17011
- console.log(` ${c.cyan}solongate${c.reset}`);
17023
+ console.log(` ${c.cyan}solongate${c.reset} ${c.dim}open the dataroom (login, policies, audit, settings)${c.reset}`);
17024
+ console.log(` ${c.cyan}solongate --help${c.reset} ${c.dim}list every command${c.reset}`);
17012
17025
  console.log("");
17013
- console.log(` ${c.dim}This opens the dataroom; log in from the Accounts panel to pair this${c.reset}`);
17014
- console.log(` ${c.dim}device and protect every Claude Code session with your cloud policy.${c.reset}`);
17026
+ console.log(` ${c.dim}Open the dataroom, log in from the Accounts panel to pair this${c.reset}`);
17027
+ console.log(` ${c.dim}device, then the guard protects every AI session with your policy.${c.reset}`);
17015
17028
  console.log(` ${c.dim}Manage it at ${c.reset}${c.cyan}https://dashboard.solongate.com${c.reset}`);
17016
17029
  console.log("");
17017
- console.log(` ${c.dim}Using local log storage? Show it live in the dashboard with${c.reset}`);
17018
- console.log(` ${c.cyan}solongate logs-server${c.reset}`);
17030
+ }
17031
+ function printHelp3() {
17032
+ const W = 46;
17033
+ const head = (t) => console.log(`
17034
+ ${c.bold}${t}${c.reset}`);
17035
+ const cmd = (syntax, desc = "") => {
17036
+ if (!desc) {
17037
+ console.log(` ${c.cyan}${syntax}${c.reset}`);
17038
+ return;
17039
+ }
17040
+ if (syntax.length <= W) {
17041
+ console.log(` ${c.cyan}${syntax}${c.reset}${" ".repeat(W - syntax.length)}${c.dim}${desc}${c.reset}`);
17042
+ } else {
17043
+ console.log(` ${c.cyan}${syntax}${c.reset}`);
17044
+ console.log(` ${" ".repeat(W)}${c.dim}${desc}${c.reset}`);
17045
+ }
17046
+ };
17047
+ console.log("");
17048
+ console.log(` ${c.bold}${c.blue4}SolonGate${c.reset} ${c.dim}secure gateway for your AI agents${c.reset} ${c.dim}v${PKG_VERSION}${c.reset}`);
17049
+ console.log("");
17050
+ console.log(` ${c.dim}Usage:${c.reset} ${c.cyan}solongate${c.reset} ${c.dim}[command]${c.reset} ${c.dim}(no command opens the dataroom: all of this in a terminal UI)${c.reset}`);
17051
+ head("Setup & status");
17052
+ cmd("solongate", "open the dataroom UI (login, policies, audit, settings)");
17053
+ cmd("doctor [--json]", "health check: login, policy, guard, local logs");
17054
+ cmd("create", "scaffold a guarded MCP server in this folder");
17055
+ cmd("logs-server", "serve local audit logs to the dashboard");
17056
+ head("Policies");
17057
+ cmd("policy list", "list all policies");
17058
+ cmd("policy show <id> [--version N]", "show one policy (rules, mode)");
17059
+ cmd("policy rules <id>", "list a policy's rules");
17060
+ cmd("policy allow <id> --tool <p> [--command|--path|--url <val>]", "add an ALLOW rule");
17061
+ cmd("policy revoke <id> <ruleId>", "remove a rule");
17062
+ cmd("policy activate <id> | --clear", "pin / unpin the active policy");
17063
+ cmd("policy rollback <id> <version>", "roll back to a version");
17064
+ cmd("policy versions <id>", "version history");
17065
+ cmd("policy active", "show the resolved active policy");
17066
+ cmd("policy dry-run <id|file.json> [--mode denylist|whitelist]", "replay recent traffic against rules");
17067
+ head("Rate limits");
17068
+ cmd("ratelimit show", "current limits + change history");
17069
+ cmd("ratelimit set --minute N [--hour N] [--day N] [--mode off|detect|block]", "edit limits (unset fields kept)");
17070
+ cmd("ratelimit history", "recent limit changes");
17071
+ head("DLP (secrets)");
17072
+ cmd("dlp show", "current mode + enabled patterns");
17073
+ cmd("dlp mode <off|detect|block>", "set enforcement mode");
17074
+ cmd("dlp enable <pattern>", "enable a built-in pattern");
17075
+ cmd("dlp disable <pattern>", "disable a built-in pattern");
17076
+ cmd("dlp add-custom --name X --re <regex>", "add a custom pattern");
17077
+ cmd("dlp remove-custom <name>", "remove a custom pattern");
17078
+ head("Monitoring");
17079
+ cmd("audit [--filter ALLOW|DENY] [--tool <s>] [--signal dlp|ratelimit] [--limit N]", "browse the audit log");
17080
+ cmd("audit whitelist <logId> [--scope exact|tool]", "turn a denial into an ALLOW rule");
17081
+ cmd("audit block <logId> [--scope exact|tool]", "turn a call into a DENY rule");
17082
+ cmd("stats [timeseries|drift]", "traffic & security statistics");
17083
+ cmd("watch [--filter DENY] [--tool <s>]", "live-tail tool calls (Ctrl+C to stop)");
17084
+ cmd("agents [--all]", "live agent feed");
17085
+ cmd("agent <agent_id>", "one-agent detail");
17086
+ head("Alerts & webhooks");
17087
+ cmd("alerts list");
17088
+ cmd("alerts add --signal deny|dlp|ratelimit|any --threshold N --window S (--email <a> | --telegram <id> | --slack <url>)", "spike alert");
17089
+ cmd("alerts remove <id>");
17090
+ cmd("webhooks list");
17091
+ cmd("webhooks add --url <https://\u2026> [--events denials|allowed|all]", "event webhook");
17092
+ cmd("webhooks remove <id>");
17093
+ head("Keys, MCP & advanced");
17094
+ cmd("keys list", "list API keys (prefix only)");
17095
+ cmd("keys create --name <name>", "create a key (secret shown once)");
17096
+ cmd("keys revoke <id>", "revoke a key");
17097
+ cmd("mcp", "list protected MCP servers");
17098
+ cmd("shield -- <command>", "wrap a command with LLM-path secret redaction");
17099
+ cmd("pull --policy-id <ID> [--file f]", "pull a cloud policy to a local file");
17100
+ cmd("push --policy-id <ID> [--file f]", "push a local policy file to the cloud");
17101
+ console.log("");
17102
+ console.log(` ${c.dim}Add ${c.reset}${c.cyan}--json${c.reset}${c.dim} to most read commands for machine output.${c.reset}`);
17103
+ console.log(` ${c.dim}Details for a command: ${c.reset}${c.cyan}solongate <command> help${c.reset}${c.dim} \xB7 Dashboard: ${c.reset}${c.cyan}https://dashboard.solongate.com${c.reset}`);
17019
17104
  console.log("");
17020
17105
  }
17021
17106
  async function main4() {
17022
17107
  const subcommand = process.argv[2];
17108
+ if (subcommand === "--help" || subcommand === "-h" || subcommand === "help") {
17109
+ printHelp3();
17110
+ return;
17111
+ }
17112
+ if (subcommand === "--version" || subcommand === "-v" || subcommand === "version") {
17113
+ console.log(PKG_VERSION);
17114
+ return;
17115
+ }
17023
17116
  if (IS_HUMAN_CLI) {
17024
17117
  const tuiBound = subcommand === "dataroom" || process.argv.length <= 2 && process.stdout.isTTY && process.stdin.isTTY;
17025
17118
  if (!tuiBound) {
@@ -17054,7 +17147,7 @@ async function main4() {
17054
17147
  if (subcommand === "login") {
17055
17148
  console.log("");
17056
17149
  console.log(` ${c.dim}\`solongate login\` was removed.${c.reset} Run ${c.cyan}solongate${c.reset} and add your`);
17057
- console.log(` account from the Accounts panel \u2014 the guard installs and updates from there.`);
17150
+ console.log(` account from the Accounts panel. The guard installs and updates from there.`);
17058
17151
  console.log("");
17059
17152
  return;
17060
17153
  }
@@ -17082,6 +17175,17 @@ async function main4() {
17082
17175
  await Promise.resolve().then(() => (init_pull_push(), pull_push_exports));
17083
17176
  return;
17084
17177
  }
17178
+ const hasProxySeparator = process.argv.includes("--");
17179
+ const looksLikeProxyFlag = (subcommand ?? "").startsWith("-");
17180
+ if (subcommand && !hasProxySeparator && !looksLikeProxyFlag) {
17181
+ process.stdout.write(`
17182
+ Unknown command: ${subcommand}
17183
+ `);
17184
+ process.stdout.write(` Run \`solongate --help\` to see every command, or \`solongate\` for the dataroom.
17185
+
17186
+ `);
17187
+ process.exit(1);
17188
+ }
17085
17189
  try {
17086
17190
  const config = parseArgs(process.argv);
17087
17191
  const proxy = new SolonGateProxy(config);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solongate/proxy",
3
- "version": "0.82.18",
3
+ "version": "0.82.20",
4
4
  "description": "AI tool security proxy: protect any AI tool server with customizable policies, path/command constraints, rate limiting, and audit logging. No code changes required.",
5
5
  "type": "module",
6
6
  "bin": {