@neus/sdk 1.1.2 → 1.1.5
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 +21 -13
- package/SECURITY.md +38 -38
- package/cjs/client.cjs +5 -5
- package/cjs/index.cjs +5 -5
- package/cli/neus.mjs +2199 -2166
- package/client.js +5 -5
- package/package.json +1 -1
- package/types.d.ts +1014 -1014
- package/widgets/README.md +36 -36
- package/widgets/verify-gate/dist/ProofBadge.js +1 -1
- package/widgets/verify-gate/dist/VerifyGate.js +1 -1
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# @neus/sdk
|
|
2
2
|
|
|
3
|
-
Create, check, and reuse NEUS trust receipts from apps and backends. The same package ships the **`neus`** CLI for
|
|
3
|
+
Create, check, and reuse NEUS trust receipts from apps and backends. The same package ships the **`neus`** CLI for assistant setup.
|
|
4
4
|
|
|
5
|
-
NEUS
|
|
5
|
+
NEUS is trust infrastructure for apps, agents, and ecosystems.
|
|
6
6
|
|
|
7
7
|
Roadmap: [docs.neus.network/platform/status](https://docs.neus.network/platform/status)
|
|
8
8
|
|
|
@@ -18,25 +18,26 @@ One command detects your environment and configures hosted MCP for Claude Code,
|
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
20
|
npx -y -p @neus/sdk neus setup
|
|
21
|
-
npx -y -p @neus/sdk neus
|
|
21
|
+
npx -y -p @neus/sdk neus check
|
|
22
|
+
npx -y -p @neus/sdk neus examples
|
|
22
23
|
```
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
Ask your assistant: **"Use NEUS Verify before taking sensitive actions."**
|
|
25
26
|
|
|
26
27
|
## MCP docs
|
|
27
28
|
|
|
28
29
|
| Topic | Link |
|
|
29
30
|
| --------------------------------- | ----------------------------------------------------------------------------- |
|
|
30
31
|
| Setup, JSON snippets, and headers | [MCP setup](https://docs.neus.network/mcp/setup) |
|
|
31
|
-
|
|
|
32
|
+
| Reuse-first MCP flow | [MCP overview](https://docs.neus.network/mcp/overview) |
|
|
32
33
|
| Discovery URLs | [Discovery and endpoints](https://docs.neus.network/mcp/endpoints) |
|
|
33
|
-
| NEUS
|
|
34
|
+
| Install NEUS | [Install NEUS](https://docs.neus.network/install) |
|
|
34
35
|
|
|
35
36
|
Prefer `neus setup` over hand-editing config files so every host stays on **`https://mcp.neus.network/mcp`**.
|
|
36
37
|
|
|
37
38
|
## What you can ship
|
|
38
39
|
|
|
39
|
-
- Hosted verification flows that return
|
|
40
|
+
- Hosted verification flows that return reusable receipts
|
|
40
41
|
- Server checks before access, rewards, payments, or actions
|
|
41
42
|
- React gates with `VerifyGate`
|
|
42
43
|
- Agent identity and scoped delegation
|
|
@@ -50,7 +51,7 @@ Use Hosted Verify when you want NEUS to handle the signing/verification flow out
|
|
|
50
51
|
import { getHostedCheckoutUrl } from '@neus/sdk';
|
|
51
52
|
|
|
52
53
|
const url = getHostedCheckoutUrl({
|
|
53
|
-
gateId: '
|
|
54
|
+
gateId: 'gate_your-app-name',
|
|
54
55
|
returnUrl: 'https://yourapp.com/auth/callback'
|
|
55
56
|
});
|
|
56
57
|
|
|
@@ -103,7 +104,7 @@ import { VerifyGate } from '@neus/sdk/widgets';
|
|
|
103
104
|
export function Page() {
|
|
104
105
|
return (
|
|
105
106
|
<VerifyGate
|
|
106
|
-
gateId="
|
|
107
|
+
gateId="gate_your-app-name"
|
|
107
108
|
onVerified={result => {
|
|
108
109
|
console.log(result.qHash || result.qHashes);
|
|
109
110
|
}}
|
|
@@ -124,7 +125,7 @@ import { NeusClient } from '@neus/sdk';
|
|
|
124
125
|
const client = new NeusClient();
|
|
125
126
|
|
|
126
127
|
const result = await client.gateCheck({
|
|
127
|
-
gateId: '
|
|
128
|
+
gateId: 'gate_your-app-name',
|
|
128
129
|
address: '0x...'
|
|
129
130
|
});
|
|
130
131
|
|
|
@@ -163,16 +164,23 @@ const client = new NeusClient({
|
|
|
163
164
|
|
|
164
165
|
```bash
|
|
165
166
|
npx -y -p @neus/sdk neus setup
|
|
166
|
-
npx -y -p @neus/sdk neus
|
|
167
|
+
npx -y -p @neus/sdk neus check
|
|
167
168
|
```
|
|
168
169
|
|
|
169
170
|
`neus setup` configures MCP and signs you in: `NEUS_ACCESS_KEY` from the environment when set, otherwise the selected host starts OAuth. Cursor, VS Code, and Claude Code use browser sign-in on NEUS. Pass `--access-key <npk_...>` only to override.
|
|
170
171
|
|
|
171
172
|
Codex owns its local MCP OAuth session. Use `npx -y -p @neus/sdk neus setup --client codex`, then `npx -y -p @neus/sdk neus auth --client codex`.
|
|
172
173
|
|
|
173
|
-
|
|
174
|
+
Embed install UX with **`@neus/sdk/mcp-hosts`** (setup commands, deeplinks, host labels).
|
|
174
175
|
|
|
175
|
-
|
|
176
|
+
Claude Code users can install **`neus-trust@neus`** for the bundled session workflow:
|
|
177
|
+
|
|
178
|
+
```text
|
|
179
|
+
/plugin marketplace add https://github.com/neus/network
|
|
180
|
+
/plugin install neus-trust@neus
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
Other hosts: [Install NEUS](https://docs.neus.network/install).
|
|
176
184
|
|
|
177
185
|
## Docs
|
|
178
186
|
|
package/SECURITY.md
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
# NEUS SDK security notes
|
|
2
|
-
|
|
3
|
-
Treat **wallet signatures** and **API keys** as secrets. Do not log them, expose them to clients, or store them in analytics.
|
|
4
|
-
|
|
5
|
-
## Authentication model
|
|
6
|
-
|
|
7
|
-
- **Verification requests** are authenticated with a wallet signature over the **CAIP-380 Portable Proof** six-line signing string. Never roll your own message format in production—use the SDK or the hosted preparation step documented for HTTP integrations.
|
|
8
|
-
- **Proof lookups by `qHash`** are safe for public proofs. Private proofs return a minimal payload unless the caller proves ownership (authenticated owner or signed request).
|
|
9
|
-
- **Owner-only reads** of private proof payloads require an extra owner-signed request. The SDK attaches the required signed headers for you.
|
|
10
|
-
|
|
11
|
-
## Do not
|
|
12
|
-
|
|
13
|
-
- Do not treat proof signatures as bearer tokens (they are request-bound).
|
|
14
|
-
- Do not embed API keys in browser apps. Keep API keys server-side only.
|
|
15
|
-
- Do not log or persist proof signatures, API keys, or third-party auth credentials (if your integration uses them).
|
|
16
|
-
|
|
17
|
-
## Privacy defaults
|
|
18
|
-
|
|
19
|
-
**`client.verify()`** defaults to **private**.
|
|
20
|
-
|
|
21
|
-
**`VerifyGate`** create mode also defaults to **private**.
|
|
22
|
-
|
|
23
|
-
Use public visibility only when you need proof reuse without owner-authenticated access:
|
|
24
|
-
|
|
25
|
-
- unlisted public: `privacyLevel: 'public'`, `publicDisplay: false`
|
|
26
|
-
- listed public: `privacyLevel: 'public'`, `publicDisplay: true`
|
|
27
|
-
|
|
28
|
-
Do not treat unlisted public proofs as secret.
|
|
29
|
-
|
|
30
|
-
`storeOriginalContent` is an advanced storage control. Most integrations should leave the default as-is.
|
|
31
|
-
|
|
32
|
-
Controls:
|
|
33
|
-
|
|
34
|
-
- `privacyLevel` - private by default; switch to public only for intentional public reuse
|
|
35
|
-
- `publicDisplay` - discovery vs unlisted
|
|
36
|
-
- `storeOriginalContent` - advanced content-storage control
|
|
37
|
-
|
|
38
|
-
Discoverable listings require **`privacyLevel: 'public'`** and **`publicDisplay: true`**.
|
|
1
|
+
# NEUS SDK security notes
|
|
2
|
+
|
|
3
|
+
Treat **wallet signatures** and **API keys** as secrets. Do not log them, expose them to clients, or store them in analytics.
|
|
4
|
+
|
|
5
|
+
## Authentication model
|
|
6
|
+
|
|
7
|
+
- **Verification requests** are authenticated with a wallet signature over the **CAIP-380 Portable Proof** six-line signing string. Never roll your own message format in production—use the SDK or the hosted preparation step documented for HTTP integrations.
|
|
8
|
+
- **Proof lookups by `qHash`** are safe for public proofs. Private proofs return a minimal payload unless the caller proves ownership (authenticated owner or signed request).
|
|
9
|
+
- **Owner-only reads** of private proof payloads require an extra owner-signed request. The SDK attaches the required signed headers for you.
|
|
10
|
+
|
|
11
|
+
## Do not
|
|
12
|
+
|
|
13
|
+
- Do not treat proof signatures as bearer tokens (they are request-bound).
|
|
14
|
+
- Do not embed API keys in browser apps. Keep API keys server-side only.
|
|
15
|
+
- Do not log or persist proof signatures, API keys, or third-party auth credentials (if your integration uses them).
|
|
16
|
+
|
|
17
|
+
## Privacy defaults
|
|
18
|
+
|
|
19
|
+
**`client.verify()`** defaults to **private**.
|
|
20
|
+
|
|
21
|
+
**`VerifyGate`** create mode also defaults to **private**.
|
|
22
|
+
|
|
23
|
+
Use public visibility only when you need proof reuse without owner-authenticated access:
|
|
24
|
+
|
|
25
|
+
- unlisted public: `privacyLevel: 'public'`, `publicDisplay: false`
|
|
26
|
+
- listed public: `privacyLevel: 'public'`, `publicDisplay: true`
|
|
27
|
+
|
|
28
|
+
Do not treat unlisted public proofs as secret.
|
|
29
|
+
|
|
30
|
+
`storeOriginalContent` is an advanced storage control. Most integrations should leave the default as-is.
|
|
31
|
+
|
|
32
|
+
Controls:
|
|
33
|
+
|
|
34
|
+
- `privacyLevel` - private by default; switch to public only for intentional public reuse
|
|
35
|
+
- `publicDisplay` - discovery vs unlisted
|
|
36
|
+
- `storeOriginalContent` - advanced content-storage control
|
|
37
|
+
|
|
38
|
+
Discoverable listings require **`privacyLevel: 'public'`** and **`publicDisplay: true`**.
|
package/cjs/client.cjs
CHANGED
|
@@ -468,19 +468,19 @@ var NEUS_CONSTANTS = {
|
|
|
468
468
|
// client.js
|
|
469
469
|
var FALLBACK_PUBLIC_VERIFIER_CATALOG = {
|
|
470
470
|
"ownership-basic": { supportsDirectApi: true },
|
|
471
|
+
"ownership-social": { supportsDirectApi: false },
|
|
471
472
|
"ownership-pseudonym": { supportsDirectApi: true },
|
|
472
473
|
"ownership-dns-txt": { supportsDirectApi: true },
|
|
473
|
-
"ownership-social": { supportsDirectApi: false },
|
|
474
474
|
"ownership-org-oauth": { supportsDirectApi: false },
|
|
475
475
|
"contract-ownership": { supportsDirectApi: true },
|
|
476
|
+
"proof-of-human": { supportsDirectApi: false },
|
|
476
477
|
"nft-ownership": { supportsDirectApi: true },
|
|
477
478
|
"token-holding": { supportsDirectApi: true },
|
|
478
|
-
"wallet-link": { supportsDirectApi: true },
|
|
479
479
|
"wallet-risk": { supportsDirectApi: true },
|
|
480
|
-
"
|
|
480
|
+
"wallet-link": { supportsDirectApi: true },
|
|
481
|
+
"ai-content-moderation": { supportsDirectApi: true },
|
|
481
482
|
"agent-identity": { supportsDirectApi: true },
|
|
482
|
-
"agent-delegation": { supportsDirectApi: true }
|
|
483
|
-
"ai-content-moderation": { supportsDirectApi: true }
|
|
483
|
+
"agent-delegation": { supportsDirectApi: true }
|
|
484
484
|
};
|
|
485
485
|
var EVM_ADDRESS_RE = /^0x[a-fA-F0-9]{40}$/;
|
|
486
486
|
var WALLET_LINK_RELATIONSHIP_TYPES = /* @__PURE__ */ new Set(["primary", "personal", "org", "affiliate", "agent", "linked"]);
|
package/cjs/index.cjs
CHANGED
|
@@ -1180,19 +1180,19 @@ var init_client = __esm({
|
|
|
1180
1180
|
init_utils();
|
|
1181
1181
|
FALLBACK_PUBLIC_VERIFIER_CATALOG = {
|
|
1182
1182
|
"ownership-basic": { supportsDirectApi: true },
|
|
1183
|
+
"ownership-social": { supportsDirectApi: false },
|
|
1183
1184
|
"ownership-pseudonym": { supportsDirectApi: true },
|
|
1184
1185
|
"ownership-dns-txt": { supportsDirectApi: true },
|
|
1185
|
-
"ownership-social": { supportsDirectApi: false },
|
|
1186
1186
|
"ownership-org-oauth": { supportsDirectApi: false },
|
|
1187
1187
|
"contract-ownership": { supportsDirectApi: true },
|
|
1188
|
+
"proof-of-human": { supportsDirectApi: false },
|
|
1188
1189
|
"nft-ownership": { supportsDirectApi: true },
|
|
1189
1190
|
"token-holding": { supportsDirectApi: true },
|
|
1190
|
-
"wallet-link": { supportsDirectApi: true },
|
|
1191
1191
|
"wallet-risk": { supportsDirectApi: true },
|
|
1192
|
-
"
|
|
1192
|
+
"wallet-link": { supportsDirectApi: true },
|
|
1193
|
+
"ai-content-moderation": { supportsDirectApi: true },
|
|
1193
1194
|
"agent-identity": { supportsDirectApi: true },
|
|
1194
|
-
"agent-delegation": { supportsDirectApi: true }
|
|
1195
|
-
"ai-content-moderation": { supportsDirectApi: true }
|
|
1195
|
+
"agent-delegation": { supportsDirectApi: true }
|
|
1196
1196
|
};
|
|
1197
1197
|
EVM_ADDRESS_RE = /^0x[a-fA-F0-9]{40}$/;
|
|
1198
1198
|
WALLET_LINK_RELATIONSHIP_TYPES = /* @__PURE__ */ new Set(["primary", "personal", "org", "affiliate", "agent", "linked"]);
|