shinjuku-shield 0.3.164 → 0.3.165
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 +6 -6
- package/manifest.json +4 -4
- package/package.json +3 -3
- package/shinjuku-wallet.mjs +23 -10
package/README.md
CHANGED
|
@@ -6,19 +6,19 @@ answers privately, in a terminal chat or for your agent app. Its `mcp`
|
|
|
6
6
|
command runs a local MCP server (stdio) for your agent. Your keys never
|
|
7
7
|
leave your machine.
|
|
8
8
|
|
|
9
|
-
This is version 0.3.
|
|
9
|
+
This is version 0.3.165. The npm packages `shinjuku-shield` and
|
|
10
10
|
`shinjuku-shielded` hold the same files. The command is `shinjuku`.
|
|
11
11
|
|
|
12
12
|
## Set up
|
|
13
13
|
|
|
14
14
|
```sh
|
|
15
|
-
npm install -g shinjuku@0.3.
|
|
15
|
+
npm install -g shinjuku@0.3.165
|
|
16
16
|
shinjuku setup
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
Type the two lines as they are. `npx install shinjuku` does not work: npx
|
|
20
20
|
reads `install` as the name of another npm package. To set up without
|
|
21
|
-
installing, type `npx shinjuku@0.3.
|
|
21
|
+
installing, type `npx shinjuku@0.3.165 setup`.
|
|
22
22
|
|
|
23
23
|
Setup makes the wallet on this machine, a private passphrase file, and the
|
|
24
24
|
checked proof tools (about 191 MB), and writes `config.json`. It also writes
|
|
@@ -36,13 +36,13 @@ Every wallet command works after `shinjuku`, for example `shinjuku balance`,
|
|
|
36
36
|
Claude Code:
|
|
37
37
|
|
|
38
38
|
```sh
|
|
39
|
-
claude mcp add --scope user shinjuku -- npx -y --no-audit --no-fund shinjuku-shield@0.3.
|
|
39
|
+
claude mcp add --scope user shinjuku -- npx -y --no-audit --no-fund shinjuku-shield@0.3.165 mcp
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
Claude Desktop (`claude_desktop_config.json`) or Cursor (`~/.cursor/mcp.json`):
|
|
43
43
|
|
|
44
44
|
```json
|
|
45
|
-
{ "mcpServers": { "shinjuku": { "command": "npx", "args": ["-y", "--no-audit", "--no-fund", "shinjuku-shield@0.3.
|
|
45
|
+
{ "mcpServers": { "shinjuku": { "command": "npx", "args": ["-y", "--no-audit", "--no-fund", "shinjuku-shield@0.3.165", "mcp"] } } }
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
On native Windows, if the host cannot find `npx`, use `"command": "cmd"` and
|
|
@@ -55,7 +55,7 @@ Codex (the Codex app and Codex CLI read the same file, `~/.codex/config.toml`):
|
|
|
55
55
|
```toml
|
|
56
56
|
[mcp_servers.shinjuku]
|
|
57
57
|
command = "npx"
|
|
58
|
-
args = ["-y", "--no-audit", "--no-fund", "shinjuku-shield@0.3.
|
|
58
|
+
args = ["-y", "--no-audit", "--no-fund", "shinjuku-shield@0.3.165", "mcp"]
|
|
59
59
|
startup_timeout_sec = 120
|
|
60
60
|
tool_timeout_sec = 300
|
|
61
61
|
```
|
package/manifest.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema": "carbon-shielded-wallet/bundle-manifest/v1",
|
|
3
3
|
"file": "shinjuku-wallet.mjs",
|
|
4
|
-
"sha256": "
|
|
5
|
-
"bytes":
|
|
6
|
-
"sourceCommit": "
|
|
4
|
+
"sha256": "a896aa3cf3bf8327b7e63ff433a9373a16c26437b16ba8a319c0668c32523fbe",
|
|
5
|
+
"bytes": 9298619,
|
|
6
|
+
"sourceCommit": "9be43a07cd1eeab97561c7b4f80614bc6bfe42ce",
|
|
7
7
|
"sourceDirty": false,
|
|
8
8
|
"installRecordMatchesLockfile": true,
|
|
9
9
|
"releaseRule": "valid only when two fresh npm ci --ignore-scripts builds on different OSes give the same sha256; installRecordMatchesLockfile true means every entry npm installed equals its package-lock.json entry and every entry not marked optional, devOptional included, is installed: an optional entry (a package for another platform) may be absent",
|
|
@@ -1038,5 +1038,5 @@
|
|
|
1038
1038
|
"version": "1.8.0"
|
|
1039
1039
|
}
|
|
1040
1040
|
],
|
|
1041
|
-
"publishedAt": "2026-11-04T23:
|
|
1041
|
+
"publishedAt": "2026-11-04T23:56:32.008Z"
|
|
1042
1042
|
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shinjuku-shield",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.165",
|
|
4
4
|
"mcpName": "io.github.ShinjukuStaition/shinjuku-mcp",
|
|
5
5
|
"description": "Shinjuku Shielded, the private x402 facilitator on Solana: the self-custody wallet CLI and its MCP server. Shield, pay, and unshield USDC from any MCP agent, under caps you set.",
|
|
6
|
-
"shinjukuRelease": "
|
|
7
|
-
"shinjukuSha256": "
|
|
6
|
+
"shinjukuRelease": "a896aa3c",
|
|
7
|
+
"shinjukuSha256": "a896aa3cf3bf8327b7e63ff433a9373a16c26437b16ba8a319c0668c32523fbe",
|
|
8
8
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
9
9
|
"author": "Shinjuku Shielded",
|
|
10
10
|
"homepage": "https://github.com/ShinjukuStaition/shinjuku-shield#readme",
|
package/shinjuku-wallet.mjs
CHANGED
|
@@ -102902,7 +102902,16 @@ function floatOutcomeWords(code2, error, t) {
|
|
|
102902
102902
|
// recordVerdict): the code names no retry, because a rerun only resends the same transfer (a live check 0.3.106 gate, 2026-10-27).
|
|
102903
102903
|
case "p03_float_seller_refused_after_payment": {
|
|
102904
102904
|
const unsure = floatUnsureWords(code2, error, t, `${p.the} refused this request (HTTP ${error?.httpStatus}${typeof error?.sellerReason === "string" ? `: ${JSON.stringify(error.sellerReason)}` : ""}) after the payment was sent`);
|
|
102905
|
-
if (!floatChargeTooLate(error))
|
|
102905
|
+
if (!floatChargeTooLate(error)) {
|
|
102906
|
+
const data = t.ai ? "no answer" : "no data";
|
|
102907
|
+
const refused = error?.httpStatus === 402 ? `${p.the} refused the payment and sent ${data}` : `${p.the} refused the request (HTTP ${error?.httpStatus}) and sent ${data}`;
|
|
102908
|
+
const told = `${refused.charAt(0).toUpperCase()}${refused.slice(1)}. Your ${amountText(error?.paidAtomic, "payment")} comes back by itself unless ${p.the} still takes it`;
|
|
102909
|
+
return [
|
|
102910
|
+
code2,
|
|
102911
|
+
unsure[1],
|
|
102912
|
+
`${t.userReads === true ? `${told}.` : `Tell the user plainly: "${told}."`} It usually comes back about 2 minutes after the payment (up to about 7). ${t.userReads === true ? `Later: ${t.result}` : `The next wallet_balance, x402_pay or inference_chat answer says when the refund arrives (refundNotices: tell the user that line); ${t.result}`}. Do not pay again with ${t.newId} until then`
|
|
102913
|
+
];
|
|
102914
|
+
}
|
|
102906
102915
|
return [
|
|
102907
102916
|
code2,
|
|
102908
102917
|
`${unsure[1]}. ${p.The} worked ${error.sellerAnswerSeconds} s before it tried to charge, and its answer says the charge failed. A Solana payment expires about 30 s after it is signed, so ${p.a} that works this long before it charges cannot be paid by any wallet`,
|
|
@@ -104056,14 +104065,14 @@ async function sellerRefusalText(response) {
|
|
|
104056
104065
|
let named = text3.trim() !== "";
|
|
104057
104066
|
try {
|
|
104058
104067
|
const parsed2 = JSON.parse(text3);
|
|
104059
|
-
const candidate = parsed2?.error?.message ?? parsed2?.error ?? parsed2?.message;
|
|
104068
|
+
const candidate = typeof parsed2 === "string" ? parsed2 : parsed2?.error?.message ?? parsed2?.error ?? parsed2?.message;
|
|
104060
104069
|
if (typeof candidate === "string") said = candidate;
|
|
104061
104070
|
else named = false;
|
|
104062
104071
|
} catch {
|
|
104063
104072
|
}
|
|
104064
104073
|
if (!named || GENERIC_REASON.test(said.trim())) {
|
|
104065
104074
|
const headers = [x402HeaderText(response, "payment-response", "errorReason"), x402HeaderText(response, "payment-required", "error")].filter((reason) => reason !== void 0);
|
|
104066
|
-
said = headers.find((reason) => !GENERIC_REASON.test(reason.trim())) ?? (named ? said : headers[0] ??
|
|
104075
|
+
said = headers.find((reason) => !GENERIC_REASON.test(reason.trim())) ?? (named ? said : headers[0] ?? "");
|
|
104067
104076
|
}
|
|
104068
104077
|
const line = said.replace(/[^\x20-\x7e]+/g, " ").replace(/\s+/g, " ").trim().slice(0, 300);
|
|
104069
104078
|
return line && !/^(\{\s*\}|\[\s*\])$/.test(line) ? line : void 0;
|
|
@@ -107823,12 +107832,9 @@ function endpoint(value2) {
|
|
|
107823
107832
|
return url.href;
|
|
107824
107833
|
}
|
|
107825
107834
|
function standardResourceMatches(published, requested) {
|
|
107826
|
-
|
|
107827
|
-
const query = requested.indexOf("?");
|
|
107828
|
-
const bare = query >= 0 ? requested.slice(0, query) : requested;
|
|
107829
|
-
return [requested, bare].some((candidate) => published === candidate || candidate.startsWith("https://") && published === `http://${candidate.slice("https://".length)}`) || sameParsedResource(published, requested);
|
|
107835
|
+
return typeof published === "string" && sameHostAndPath(published, requested);
|
|
107830
107836
|
}
|
|
107831
|
-
function
|
|
107837
|
+
function sameHostAndPath(published, requested) {
|
|
107832
107838
|
try {
|
|
107833
107839
|
const seller = new URL(published);
|
|
107834
107840
|
const asked = new URL(requested);
|
|
@@ -107836,8 +107842,7 @@ function sameParsedResource(published, requested) {
|
|
|
107836
107842
|
if (seller.username !== asked.username || seller.password !== asked.password || seller.host !== asked.host) return false;
|
|
107837
107843
|
const segments = (url) => url.pathname.split("/").map(decodeURIComponent);
|
|
107838
107844
|
const [sellerPath, askedPath] = [segments(seller), segments(asked)];
|
|
107839
|
-
|
|
107840
|
-
return seller.search === "" || sameQueryItems(seller, asked);
|
|
107845
|
+
return sellerPath.length === askedPath.length && sellerPath.every((segment, index) => segment === askedPath[index]);
|
|
107841
107846
|
} catch {
|
|
107842
107847
|
return false;
|
|
107843
107848
|
}
|
|
@@ -110249,8 +110254,16 @@ function refusalSay(a, tool, again, npmVersion) {
|
|
|
110249
110254
|
`${what[0].toUpperCase()}${what.slice(1)} went out${slow}. Not known yet whether it comes back. Nothing to do now.`,
|
|
110250
110255
|
`${Seller} took ${a.sellerAnswerSeconds} s; Solana payments expire in about 30 s. ${kept3}. Nothing to do now.`
|
|
110251
110256
|
] : [];
|
|
110257
|
+
const data2 = tool === "inference_chat" ? "no answer" : "no data";
|
|
110258
|
+
const refusedHead = a.httpStatus === 402 ? `${Seller} refused the payment and sent ${data2}.` : Number.isInteger(a.httpStatus) ? `${Seller} refused the request (HTTP ${a.httpStatus}) and sent ${data2}.` : `${Seller} refused the request and sent ${data2}.`;
|
|
110259
|
+
const comesBack = [
|
|
110260
|
+
`Your ${total ? `${total} USDC` : "payment"} comes back by itself unless ${seller} still takes it.`,
|
|
110261
|
+
`${what[0].toUpperCase()}${what.slice(1)} comes back unless ${seller} still takes it.`
|
|
110262
|
+
];
|
|
110263
|
+
const refusedLines = !unsure && late2.length === 0 ? comesBack.map((tail) => `${refusedHead} ${tail}`) : [];
|
|
110252
110264
|
return [
|
|
110253
110265
|
...late2,
|
|
110266
|
+
...refusedLines,
|
|
110254
110267
|
`${head} ${kept3}. Nothing to do; do not pay again yet.`,
|
|
110255
110268
|
`${head} ${kept3}. Do not pay again yet.`,
|
|
110256
110269
|
`${head} ${kept3}. Nothing to do now.`,
|