{
  "name": "scorpiox-frp",
  "version": "0.68.0",
  "description": "Pure C frp client engine (frpc protocol v0.67+, yamux multiplexing, token auth) as a Windows/Linux DLL for P/Invoke. Used by the Personal Tunnel WinUI3 Store app.",
  "exports": [
    {
      "name": "frp_version",
      "return": "const char*",
      "csharp_return": "string (IntPtr + PtrToStringAnsi)",
      "args": [],
      "notes": "Returns \"0.68.0\""
    },
    {
      "name": "frp_last_error",
      "return": "const char*",
      "csharp_return": "string (IntPtr + PtrToStringAnsi)",
      "args": [],
      "notes": "\"\" if none. Internal buffer — copy immediately."
    },
    {
      "name": "frp_start",
      "return": "int",
      "csharp_return": "int",
      "args": [
        {"name": "config_json", "type": "const char*", "csharp_type": "string", "marshal": "UnmanagedType.LPUTF8Str"}
      ],
      "notes": "0 ok, -1 error (see frp_last_error). BLOCKS until login + proxy registered — call from a worker thread. Single-proxy config: {server_addr, server_port, token, proxy_name, proxy_type, local_ip, local_port, remote_port}. Multi-proxy: {server_addr, server_port, token, proxies: [{name, local_port, remote_port}, ...]} (max 8). Re-start after stop supported."
    },
    {
      "name": "frp_stop",
      "return": "int",
      "csharp_return": "int",
      "args": [],
      "notes": "Blocking — joins worker threads, bounded 10s per tunnel (Linux timed join / Windows WaitForSingleObject 10000). Idempotent, returns 0."
    },
    {
      "name": "frp_status",
      "return": "int",
      "csharp_return": "int",
      "args": [],
      "notes": "1 = at least one tunnel running, 0 = stopped"
    },
    {
      "name": "frp_get_config",
      "return": "const char*",
      "csharp_return": "string (IntPtr + PtrToStringAnsi)",
      "args": [],
      "notes": "Applied config JSON, token redacted (token_set bool). Internal buffer — copy immediately."
    },
    {
      "name": "frp_runtime_status",
      "return": "const char*",
      "csharp_return": "string (IntPtr + PtrToStringAnsi)",
      "args": [],
      "notes": "Live JSON: {running, connected, last_error, proxies:[{name, connected, local_port, remote_port, reconnects, error}]}. Poll ~every 3s. Internal buffer — copy immediately."
    }
  ]
}
