@neus/sdk 1.1.1 → 1.1.2
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.
- package/README.md +184 -206
- package/cjs/client.cjs +23 -15
- package/cjs/index.cjs +23 -15
- package/cjs/mcp-hosts.cjs +125 -0
- package/cli/neus.mjs +613 -342
- package/client.js +32 -17
- package/mcp-hosts.js +121 -0
- package/package.json +147 -142
- package/types.d.ts +38 -7
- package/widgets/README.md +6 -10
- package/widgets/verify-gate/dist/ProofBadge.js +14 -4
- package/widgets/verify-gate/dist/VerifyGate.js +66 -203
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// mcp-hosts.js
|
|
21
|
+
var mcp_hosts_exports = {};
|
|
22
|
+
__export(mcp_hosts_exports, {
|
|
23
|
+
IDE_HOST_BRAND_LOGOS: () => IDE_HOST_BRAND_LOGOS,
|
|
24
|
+
IDE_HOST_LABELS: () => IDE_HOST_LABELS,
|
|
25
|
+
MCP_INSTALL_CLIENTS: () => MCP_INSTALL_CLIENTS,
|
|
26
|
+
MCP_INSTALL_HOSTS: () => MCP_INSTALL_HOSTS,
|
|
27
|
+
NEUS_AUTH_CLI: () => NEUS_AUTH_CLI,
|
|
28
|
+
NEUS_MCP_SERVER_NAME: () => NEUS_MCP_SERVER_NAME,
|
|
29
|
+
NEUS_MCP_SETUP_DOCS_URL: () => NEUS_MCP_SETUP_DOCS_URL,
|
|
30
|
+
NEUS_MCP_URL: () => NEUS_MCP_URL,
|
|
31
|
+
NEUS_SETUP_CLI: () => NEUS_SETUP_CLI,
|
|
32
|
+
buildAuthCommandForClient: () => buildAuthCommandForClient,
|
|
33
|
+
buildCursorMcpInstallUrl: () => buildCursorMcpInstallUrl,
|
|
34
|
+
buildNeusMcpHttpConfig: () => buildNeusMcpHttpConfig,
|
|
35
|
+
buildSetupCommandForClient: () => buildSetupCommandForClient,
|
|
36
|
+
buildSetupCommandForHost: () => buildSetupCommandForHost,
|
|
37
|
+
buildVsCodeMcpInstallUrl: () => buildVsCodeMcpInstallUrl,
|
|
38
|
+
supportsMcpInstallDeeplink: () => supportsMcpInstallDeeplink
|
|
39
|
+
});
|
|
40
|
+
module.exports = __toCommonJS(mcp_hosts_exports);
|
|
41
|
+
var NEUS_MCP_SERVER_NAME = "neus";
|
|
42
|
+
var NEUS_MCP_URL = "https://mcp.neus.network/mcp";
|
|
43
|
+
var NEUS_SETUP_CLI = "npx -y -p @neus/sdk neus setup";
|
|
44
|
+
var NEUS_AUTH_CLI = "npx -y -p @neus/sdk neus auth";
|
|
45
|
+
var NEUS_MCP_SETUP_DOCS_URL = "https://docs.neus.network/mcp/ide-plugin";
|
|
46
|
+
var MCP_INSTALL_CLIENTS = ["claude", "codex", "cursor", "vscode"];
|
|
47
|
+
var MCP_INSTALL_HOSTS = ["cursor", "claude", "codex"];
|
|
48
|
+
var IDE_HOST_LABELS = {
|
|
49
|
+
cursor: "Cursor",
|
|
50
|
+
claude: "Claude Code",
|
|
51
|
+
codex: "Codex"
|
|
52
|
+
};
|
|
53
|
+
var IDE_HOST_BRAND_LOGOS = {
|
|
54
|
+
cursor: "/images/brandLogos/cursor.svg",
|
|
55
|
+
claude: "/images/brandLogos/anthropic.svg",
|
|
56
|
+
codex: "/images/brandLogos/openai.svg"
|
|
57
|
+
};
|
|
58
|
+
function buildNeusMcpHttpConfig(accessKey) {
|
|
59
|
+
const key = String(accessKey || "").trim();
|
|
60
|
+
return {
|
|
61
|
+
type: "http",
|
|
62
|
+
url: NEUS_MCP_URL,
|
|
63
|
+
...key ? { headers: { Authorization: `Bearer ${key}` } } : {}
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
function encodeBase64Json(value) {
|
|
67
|
+
const json = JSON.stringify(value);
|
|
68
|
+
if (typeof globalThis.btoa === "function") {
|
|
69
|
+
return globalThis.btoa(json);
|
|
70
|
+
}
|
|
71
|
+
return Buffer.from(json, "utf8").toString("base64");
|
|
72
|
+
}
|
|
73
|
+
function buildCursorMcpInstallUrl(accessKey) {
|
|
74
|
+
const config = buildNeusMcpHttpConfig(accessKey);
|
|
75
|
+
const encoded = encodeBase64Json(config);
|
|
76
|
+
return `cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(NEUS_MCP_SERVER_NAME)}&config=${encodeURIComponent(encoded)}`;
|
|
77
|
+
}
|
|
78
|
+
function buildVsCodeMcpInstallUrl(accessKey) {
|
|
79
|
+
const payload = {
|
|
80
|
+
name: NEUS_MCP_SERVER_NAME,
|
|
81
|
+
...buildNeusMcpHttpConfig(accessKey)
|
|
82
|
+
};
|
|
83
|
+
return `vscode:mcp/install?${encodeURIComponent(JSON.stringify(payload))}`;
|
|
84
|
+
}
|
|
85
|
+
function buildAuthCommandForClient(client) {
|
|
86
|
+
if (client === "codex") {
|
|
87
|
+
return `${NEUS_AUTH_CLI} --client codex`;
|
|
88
|
+
}
|
|
89
|
+
return NEUS_AUTH_CLI;
|
|
90
|
+
}
|
|
91
|
+
function buildSetupCommandForClient(client, accessKey) {
|
|
92
|
+
const key = String(accessKey || "").trim();
|
|
93
|
+
const setup = key ? `${NEUS_SETUP_CLI} --client ${client} --access-key ${key}` : `${NEUS_SETUP_CLI} --client ${client}`;
|
|
94
|
+
if (key) return setup;
|
|
95
|
+
return `${setup}
|
|
96
|
+
${buildAuthCommandForClient(client)}`;
|
|
97
|
+
}
|
|
98
|
+
function buildSetupCommandForHost(host, accessKey) {
|
|
99
|
+
return buildSetupCommandForClient(host, accessKey);
|
|
100
|
+
}
|
|
101
|
+
function supportsMcpInstallDeeplink(host) {
|
|
102
|
+
if (host !== "cursor") return false;
|
|
103
|
+
if (typeof navigator === "undefined") return false;
|
|
104
|
+
const ua = navigator.userAgent || "";
|
|
105
|
+
return !/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(ua);
|
|
106
|
+
}
|
|
107
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
108
|
+
0 && (module.exports = {
|
|
109
|
+
IDE_HOST_BRAND_LOGOS,
|
|
110
|
+
IDE_HOST_LABELS,
|
|
111
|
+
MCP_INSTALL_CLIENTS,
|
|
112
|
+
MCP_INSTALL_HOSTS,
|
|
113
|
+
NEUS_AUTH_CLI,
|
|
114
|
+
NEUS_MCP_SERVER_NAME,
|
|
115
|
+
NEUS_MCP_SETUP_DOCS_URL,
|
|
116
|
+
NEUS_MCP_URL,
|
|
117
|
+
NEUS_SETUP_CLI,
|
|
118
|
+
buildAuthCommandForClient,
|
|
119
|
+
buildCursorMcpInstallUrl,
|
|
120
|
+
buildNeusMcpHttpConfig,
|
|
121
|
+
buildSetupCommandForClient,
|
|
122
|
+
buildSetupCommandForHost,
|
|
123
|
+
buildVsCodeMcpInstallUrl,
|
|
124
|
+
supportsMcpInstallDeeplink
|
|
125
|
+
});
|