shinjuku-shielded 0.3.164 → 0.3.166
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 +33 -14
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.166. 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.166
|
|
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.166 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.166 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.166", "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.166", "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": "162d3a005e0491faedec0df58d95385a183a68993d209faa54e51dbdc2c81afb",
|
|
5
|
+
"bytes": 9298964,
|
|
6
|
+
"sourceCommit": "4d37fd634d7539d6289106ed611016d77dd7249f",
|
|
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-
|
|
1041
|
+
"publishedAt": "2026-11-05T02:48:05.006Z"
|
|
1042
1042
|
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shinjuku-shielded",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.166",
|
|
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": "162d3a00",
|
|
7
|
+
"shinjukuSha256": "162d3a005e0491faedec0df58d95385a183a68993d209faa54e51dbdc2c81afb",
|
|
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`,
|
|
@@ -104040,10 +104049,13 @@ async function sellerRefusalText(response) {
|
|
|
104040
104049
|
if (reader) {
|
|
104041
104050
|
try {
|
|
104042
104051
|
const decoder = new TextDecoder();
|
|
104043
|
-
|
|
104052
|
+
let bytes2 = 0;
|
|
104053
|
+
while (bytes2 < SELLER_REASON_READ_BYTES) {
|
|
104044
104054
|
const { done, value: value2 } = await reader.read();
|
|
104045
104055
|
if (done) break;
|
|
104046
|
-
|
|
104056
|
+
const part = value2.subarray(0, SELLER_REASON_READ_BYTES - bytes2);
|
|
104057
|
+
bytes2 += part.length;
|
|
104058
|
+
text3 += decoder.decode(part, { stream: true });
|
|
104047
104059
|
}
|
|
104048
104060
|
} catch {
|
|
104049
104061
|
text3 = "";
|
|
@@ -104056,16 +104068,17 @@ async function sellerRefusalText(response) {
|
|
|
104056
104068
|
let named = text3.trim() !== "";
|
|
104057
104069
|
try {
|
|
104058
104070
|
const parsed2 = JSON.parse(text3);
|
|
104059
|
-
const candidate = parsed2?.error?.message ?? parsed2?.error ?? parsed2?.message;
|
|
104071
|
+
const candidate = typeof parsed2 === "string" ? parsed2 : parsed2?.error?.message ?? parsed2?.error ?? parsed2?.message;
|
|
104060
104072
|
if (typeof candidate === "string") said = candidate;
|
|
104061
104073
|
else named = false;
|
|
104062
104074
|
} catch {
|
|
104063
104075
|
}
|
|
104064
104076
|
if (!named || GENERIC_REASON.test(said.trim())) {
|
|
104065
104077
|
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] ??
|
|
104078
|
+
said = headers.find((reason) => !GENERIC_REASON.test(reason.trim())) ?? (named ? said : headers[0] ?? "");
|
|
104067
104079
|
}
|
|
104068
|
-
const
|
|
104080
|
+
const whole = said.replace(/[^\x20-\x7e]+/g, " ").replace(/\s+/g, " ").trim();
|
|
104081
|
+
const line = whole.length > SELLER_REASON_MAX ? `${whole.slice(0, SELLER_REASON_MAX - 3)}...` : whole;
|
|
104069
104082
|
return line && !/^(\{\s*\}|\[\s*\])$/.test(line) ? line : void 0;
|
|
104070
104083
|
}
|
|
104071
104084
|
function x402Header(response, name) {
|
|
@@ -105858,7 +105871,7 @@ function paidResult(record, replayed) {
|
|
|
105858
105871
|
float: { floatId: record.floatId }
|
|
105859
105872
|
};
|
|
105860
105873
|
}
|
|
105861
|
-
var import_web3115, FLOAT_PAYMENT_SCHEMA2, REGENERATE_CODES, FLOAT_PAYMENT_WAL_PREFIX2, FLOAT_CONFIG_SCHEMA, FLOAT_PAY_PATH, FLOAT_MEMO_PATH, FLOAT_STATUS_PATH, MAX_BODY_BYTES, FLOAT_REFUND_ETA_SECONDS, REFUND_READ_EARLY_MS, REFUND_ETA_MAX_SECONDS, refundDueOf, REFUND_SETTLED_AFTER_MS, REFUND_OUTCOME_NEWS_MS, FINISHING_POLL_MS, FINISHING_LIMIT_MS, SELLER_TIMEOUT_MS, FLOAT_STATUS_START_MS, FLOAT_STATUS_POLL_MS, FLOAT_STATUS_TIMEOUT_MS, FLOAT_TRANSFER_DEAD, FLOAT_PAYMENT_REVERTED, VERDICT_POLL_MS, SELLER_ANSWER_VERDICT_MS, TRANSFER_MIN_BLOCKS_LEFT, TRANSFER_FRESH_MS, BLOCK_HEIGHT_TIMEOUT_MS, CONFIG_TIMEOUT_MS, MEMO_UPLOAD_TIMEOUT_MS, CONFIG_CACHE_MS, FLOAT_POOL_WARM_MS, DECIMAL3, POSITIVE, PENDING_CODES, FLOAT_FRONT_HEADER, hash7, fail21, GENERIC_REASON, FEE_PAYER_RESENDS, FEE_PAYER_RESEND_MS, GLOBAL_DISPATCHER4, sortedJson, MODEL_ID, floatPaymentWalName, floatRecordName, FLOAT_KEEP_BYTES_MS, memoryOnlyNeedsScrub, FLOAT_KEEP_OPEN_REQUEST_MS, configCache, configGeneration, configReadSequence, configReads, configRefreshes, SPECULATED_MAX_AGE_MS, speculatedQuotes, poolDomains, FLOAT_FACTS_SCHEMA, floatFacts, floatFactsKey, floatFactsMac, poolDomainReads, poolDomainWarmFailedAt, WARM_RETRY_MS, payerGenerator, etaEntry, loadPayerGenerator, plainText, BROADCAST_REFUSED, BROADCAST_REFUSED_STANDARD, BROADCAST_DEAD, TRANSFER_LANDING_WINDOW_MS, PROOF_DELIVERY_MS, SELF_BROADCAST_LEG1_LEFT_MS, BROADCAST_UNSIGNED, BROADCAST_NO_LOOKUP, BROADCAST_LANDED, BROADCAST_LIMIT_MS, BROADCAST_QUOTE_MARGIN_MS, SELF_BROADCAST_RESEND_MS, SELF_BROADCAST_UNANSWERED_RESEND_MS, SELLER_HEADERS_MAX_COUNT, SELLER_HEADERS_MAX_BYTES, SELLER_HEADERS_KEPT;
|
|
105874
|
+
var import_web3115, FLOAT_PAYMENT_SCHEMA2, REGENERATE_CODES, FLOAT_PAYMENT_WAL_PREFIX2, FLOAT_CONFIG_SCHEMA, FLOAT_PAY_PATH, FLOAT_MEMO_PATH, FLOAT_STATUS_PATH, MAX_BODY_BYTES, FLOAT_REFUND_ETA_SECONDS, REFUND_READ_EARLY_MS, REFUND_ETA_MAX_SECONDS, refundDueOf, REFUND_SETTLED_AFTER_MS, REFUND_OUTCOME_NEWS_MS, FINISHING_POLL_MS, FINISHING_LIMIT_MS, SELLER_TIMEOUT_MS, FLOAT_STATUS_START_MS, FLOAT_STATUS_POLL_MS, FLOAT_STATUS_TIMEOUT_MS, FLOAT_TRANSFER_DEAD, FLOAT_PAYMENT_REVERTED, VERDICT_POLL_MS, SELLER_ANSWER_VERDICT_MS, TRANSFER_MIN_BLOCKS_LEFT, TRANSFER_FRESH_MS, BLOCK_HEIGHT_TIMEOUT_MS, CONFIG_TIMEOUT_MS, MEMO_UPLOAD_TIMEOUT_MS, CONFIG_CACHE_MS, FLOAT_POOL_WARM_MS, DECIMAL3, POSITIVE, PENDING_CODES, FLOAT_FRONT_HEADER, hash7, fail21, GENERIC_REASON, SELLER_REASON_MAX, SELLER_REASON_READ_BYTES, FEE_PAYER_RESENDS, FEE_PAYER_RESEND_MS, GLOBAL_DISPATCHER4, sortedJson, MODEL_ID, floatPaymentWalName, floatRecordName, FLOAT_KEEP_BYTES_MS, memoryOnlyNeedsScrub, FLOAT_KEEP_OPEN_REQUEST_MS, configCache, configGeneration, configReadSequence, configReads, configRefreshes, SPECULATED_MAX_AGE_MS, speculatedQuotes, poolDomains, FLOAT_FACTS_SCHEMA, floatFacts, floatFactsKey, floatFactsMac, poolDomainReads, poolDomainWarmFailedAt, WARM_RETRY_MS, payerGenerator, etaEntry, loadPayerGenerator, plainText, BROADCAST_REFUSED, BROADCAST_REFUSED_STANDARD, BROADCAST_DEAD, TRANSFER_LANDING_WINDOW_MS, PROOF_DELIVERY_MS, SELF_BROADCAST_LEG1_LEFT_MS, BROADCAST_UNSIGNED, BROADCAST_NO_LOOKUP, BROADCAST_LANDED, BROADCAST_LIMIT_MS, BROADCAST_QUOTE_MARGIN_MS, SELF_BROADCAST_RESEND_MS, SELF_BROADCAST_UNANSWERED_RESEND_MS, SELLER_HEADERS_MAX_COUNT, SELLER_HEADERS_MAX_BYTES, SELLER_HEADERS_KEPT;
|
|
105862
105875
|
var init_floatPay = __esm({
|
|
105863
105876
|
"wallet/src/pay/floatPay.mjs"() {
|
|
105864
105877
|
"use strict";
|
|
@@ -105926,6 +105939,8 @@ var init_floatPay = __esm({
|
|
|
105926
105939
|
throw Object.assign(new Error(code2), extra);
|
|
105927
105940
|
};
|
|
105928
105941
|
GENERIC_REASON = /^payment[\s_-]*required[.!]?$/i;
|
|
105942
|
+
SELLER_REASON_MAX = 1200;
|
|
105943
|
+
SELLER_REASON_READ_BYTES = 4096;
|
|
105929
105944
|
FEE_PAYER_RESENDS = 8;
|
|
105930
105945
|
FEE_PAYER_RESEND_MS = 15e3;
|
|
105931
105946
|
GLOBAL_DISPATCHER4 = /* @__PURE__ */ Symbol.for("undici.globalDispatcher.1");
|
|
@@ -107823,12 +107838,9 @@ function endpoint(value2) {
|
|
|
107823
107838
|
return url.href;
|
|
107824
107839
|
}
|
|
107825
107840
|
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);
|
|
107841
|
+
return typeof published === "string" && sameHostAndPath(published, requested);
|
|
107830
107842
|
}
|
|
107831
|
-
function
|
|
107843
|
+
function sameHostAndPath(published, requested) {
|
|
107832
107844
|
try {
|
|
107833
107845
|
const seller = new URL(published);
|
|
107834
107846
|
const asked = new URL(requested);
|
|
@@ -107836,8 +107848,7 @@ function sameParsedResource(published, requested) {
|
|
|
107836
107848
|
if (seller.username !== asked.username || seller.password !== asked.password || seller.host !== asked.host) return false;
|
|
107837
107849
|
const segments = (url) => url.pathname.split("/").map(decodeURIComponent);
|
|
107838
107850
|
const [sellerPath, askedPath] = [segments(seller), segments(asked)];
|
|
107839
|
-
|
|
107840
|
-
return seller.search === "" || sameQueryItems(seller, asked);
|
|
107851
|
+
return sellerPath.length === askedPath.length && sellerPath.every((segment, index) => segment === askedPath[index]);
|
|
107841
107852
|
} catch {
|
|
107842
107853
|
return false;
|
|
107843
107854
|
}
|
|
@@ -110249,8 +110260,16 @@ function refusalSay(a, tool, again, npmVersion) {
|
|
|
110249
110260
|
`${what[0].toUpperCase()}${what.slice(1)} went out${slow}. Not known yet whether it comes back. Nothing to do now.`,
|
|
110250
110261
|
`${Seller} took ${a.sellerAnswerSeconds} s; Solana payments expire in about 30 s. ${kept3}. Nothing to do now.`
|
|
110251
110262
|
] : [];
|
|
110263
|
+
const data2 = tool === "inference_chat" ? "no answer" : "no data";
|
|
110264
|
+
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}.`;
|
|
110265
|
+
const comesBack = [
|
|
110266
|
+
`Your ${total ? `${total} USDC` : "payment"} comes back by itself unless ${seller} still takes it.`,
|
|
110267
|
+
`${what[0].toUpperCase()}${what.slice(1)} comes back unless ${seller} still takes it.`
|
|
110268
|
+
];
|
|
110269
|
+
const refusedLines = !unsure && late2.length === 0 ? comesBack.map((tail) => `${refusedHead} ${tail}`) : [];
|
|
110252
110270
|
return [
|
|
110253
110271
|
...late2,
|
|
110272
|
+
...refusedLines,
|
|
110254
110273
|
`${head} ${kept3}. Nothing to do; do not pay again yet.`,
|
|
110255
110274
|
`${head} ${kept3}. Do not pay again yet.`,
|
|
110256
110275
|
`${head} ${kept3}. Nothing to do now.`,
|