shinjuku-shield 0.3.149 → 0.3.150
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 +10 -3
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.150. 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.150
|
|
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.150 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.150 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.150", "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.150", "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": "35457f8ab4f209c7518da98152cb6ee55157a1df110729c1c3998962cfb15dce",
|
|
5
|
+
"bytes": 8997333,
|
|
6
|
+
"sourceCommit": "9319b1ca86d33ad0730f0ed9553d382c060b3343",
|
|
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-01T18:50:14.510Z"
|
|
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.150",
|
|
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": "35457f8a",
|
|
7
|
+
"shinjukuSha256": "35457f8ab4f209c7518da98152cb6ee55157a1df110729c1c3998962cfb15dce",
|
|
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
|
@@ -112504,6 +112504,7 @@ __export(inference_exports, {
|
|
|
112504
112504
|
InferenceError: () => InferenceError,
|
|
112505
112505
|
MIN_MAX_TOKENS: () => MIN_MAX_TOKENS,
|
|
112506
112506
|
USEPOD_MIN_PAYMENT_ATOMIC: () => USEPOD_MIN_PAYMENT_ATOMIC,
|
|
112507
|
+
USEPOD_QUOTE_FEE_PERMILLE: () => USEPOD_QUOTE_FEE_PERMILLE,
|
|
112507
112508
|
USEPOD_X402_CHAT_URL: () => USEPOD_X402_CHAT_URL,
|
|
112508
112509
|
buildChatRequest: () => buildChatRequest,
|
|
112509
112510
|
ceilingAtomic: () => ceilingAtomic,
|
|
@@ -112614,7 +112615,8 @@ function inputTokensBound(messages, tools) {
|
|
|
112614
112615
|
return tokens;
|
|
112615
112616
|
}
|
|
112616
112617
|
function ceilingOf(entry, messages, maxTokens, tools) {
|
|
112617
|
-
const
|
|
112618
|
+
const listed = entry.priceInPerMAtomic * inputTokensBound(messages, tools) + entry.priceOutPerMAtomic * maxTokens;
|
|
112619
|
+
const estimate = ceilDiv(listed * (1000n + USEPOD_QUOTE_FEE_PERMILLE), 1000n * PER_M);
|
|
112618
112620
|
return estimate > USEPOD_MIN_PAYMENT_ATOMIC ? estimate : USEPOD_MIN_PAYMENT_ATOMIC;
|
|
112619
112621
|
}
|
|
112620
112622
|
function ceilingAtomic({ model, messages, maxTokens, tools }) {
|
|
@@ -112748,7 +112750,7 @@ function overCapNext(entry, messages, cap, ceiling) {
|
|
|
112748
112750
|
if (cap < USEPOD_MIN_PAYMENT_ATOMIC) {
|
|
112749
112751
|
return "allow more than 0.01 USDC (the AI provider's minimum per call) plus the Shinjuku fee for this call";
|
|
112750
112752
|
}
|
|
112751
|
-
const room = cap * PER_M - entry.priceInPerMAtomic * inputTokensBound(messages, void 0);
|
|
112753
|
+
const room = cap * PER_M * 1000n / (1000n + USEPOD_QUOTE_FEE_PERMILLE) - entry.priceInPerMAtomic * inputTokensBound(messages, void 0);
|
|
112752
112754
|
const fits = room > 0n ? room / entry.priceOutPerMAtomic : 0n;
|
|
112753
112755
|
return fits >= 1n ? `lower max_tokens to ${fits}, or allow up to ${usdcWords(ceiling)} for this call` : `shorten the messages, or allow up to ${usdcWords(ceiling)} for this call`;
|
|
112754
112756
|
}
|
|
@@ -112821,7 +112823,7 @@ async function inferenceChat({
|
|
|
112821
112823
|
maxTokensDefault: maxTokens === void 0 || maxTokens === null
|
|
112822
112824
|
};
|
|
112823
112825
|
}
|
|
112824
|
-
var USEPOD_X402_CHAT_URL, USEPOD_MIN_PAYMENT_ATOMIC, INFERENCE_NOTICE, ROLES, MAX_TOOLS, TOOL_NAME, MESSAGE_OVERHEAD_TOKENS, PER_M, InferenceError, fail30, modelIds, ceilDiv, spelling;
|
|
112826
|
+
var USEPOD_X402_CHAT_URL, USEPOD_MIN_PAYMENT_ATOMIC, INFERENCE_NOTICE, ROLES, MAX_TOOLS, TOOL_NAME, MESSAGE_OVERHEAD_TOKENS, PER_M, InferenceError, fail30, modelIds, ceilDiv, USEPOD_QUOTE_FEE_PERMILLE, spelling;
|
|
112825
112827
|
var init_inference = __esm({
|
|
112826
112828
|
"wallet/src/inference/index.mjs"() {
|
|
112827
112829
|
"use strict";
|
|
@@ -112850,6 +112852,7 @@ var init_inference = __esm({
|
|
|
112850
112852
|
};
|
|
112851
112853
|
modelIds = () => MODELS.map((model) => model.id).join(", ");
|
|
112852
112854
|
ceilDiv = (a, b) => (a + b - 1n) / b;
|
|
112855
|
+
USEPOD_QUOTE_FEE_PERMILLE = 100n;
|
|
112853
112856
|
spelling = (name) => String(name ?? "").toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
112854
112857
|
}
|
|
112855
112858
|
});
|
|
@@ -144072,6 +144075,10 @@ When it says ready, type /retry: it asks the same question again.` : receivedOnl
|
|
|
144072
144075
|
const { maxPaymentAtomic: payLimit, maxSessionAtomic: dayLimit } = caps.limits;
|
|
144073
144076
|
const atLimit = payLimit !== void 0 && caps.answer >= BigInt(payLimit) || dayLimit !== void 0 && caps.chat >= BigInt(dayLimit);
|
|
144074
144077
|
say3(`This answer costs more than the chat's caps allow. ${paidWords} ${capsLine2()} ${atLimit ? `To pay more, end the chat (/exit), raise your limits with ${commandLine("limits")}, then start it again: ${commandLine("chat")}` : `End the chat (/exit) and start it again with higher caps when you want more: ${commandLine(`chat --max-payment ${higherCap(caps.answer, payLimit, dayLimit)} --max-session ${higherCap(caps.chat, dayLimit)}`)}`}${closeOtherwise}`);
|
|
144078
|
+
} else if (code2 === "fetch_price_over_ceiling") {
|
|
144079
|
+
const fact = [error, error?.cause, error?.cause?.cause].find((one) => /^[0-9]{1,30}$/.test(String(one?.askedAtomic ?? "")));
|
|
144080
|
+
const asks = fact ? ` (${usdcWords(BigInt(fact.askedAtomic))}${/^[0-9]{1,30}$/.test(String(fact.ceilingAtomic ?? "")) ? `, the wallet expected at most ${usdcWords(BigInt(fact.ceilingAtomic))}` : ""})` : "";
|
|
144081
|
+
say3(`The AI provider asks more for this answer than the wallet expected${asks}, so it was not paid. ${paidWords} Try another model (/model ${models.find((entry) => entry.id !== turn.model)?.id ?? DEFAULT_MODEL2}), or ${again} later.${closeOtherwise}`);
|
|
144075
144082
|
} else if (code2 === "inference_no_provider") {
|
|
144076
144083
|
say3(`No AI provider can take this wallet's payment for ${turn.model} right now. ${paidWords} Try another model (/model ${models.find((entry) => entry.id !== turn.model)?.id ?? DEFAULT_MODEL2}), or ${again} later.${closeOtherwise}`);
|
|
144077
144084
|
} else if (NO_ANSWER_CODES.test(code2 ?? "")) {
|