shinjuku-shield 0.3.134 → 0.3.135
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 +5 -5
- package/manifest.json +4 -4
- package/package.json +3 -3
- package/shinjuku-wallet.mjs +25 -9
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.135. 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.135
|
|
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.135 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.135 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.135", "mcp"] } } }
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
On native Windows, if the host cannot find `npx`, use `"command": "cmd"` and
|
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": "45b6c2ae1564c104f82be3d93124b0dffe53f6d5663167b874e720fb8231bc6f",
|
|
5
|
+
"bytes": 8896515,
|
|
6
|
+
"sourceCommit": "282e02a7d33f0f072f2c0ffa95f74166a0ef5b68",
|
|
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",
|
|
@@ -1037,5 +1037,5 @@
|
|
|
1037
1037
|
"version": "1.8.0"
|
|
1038
1038
|
}
|
|
1039
1039
|
],
|
|
1040
|
-
"publishedAt": "2026-10-31T16:
|
|
1040
|
+
"publishedAt": "2026-10-31T16:57:08.434Z"
|
|
1041
1041
|
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shinjuku-shield",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.135",
|
|
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": "45b6c2ae",
|
|
7
|
+
"shinjukuSha256": "45b6c2ae1564c104f82be3d93124b0dffe53f6d5663167b874e720fb8231bc6f",
|
|
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
|
@@ -60100,10 +60100,19 @@ function prewarmWalletP03History(args) {
|
|
|
60100
60100
|
const runKey = lastRunReportKey(args.store, args.programId, args.pool, args.deploymentIdentity, args.cache);
|
|
60101
60101
|
if (runKey === void 0) return false;
|
|
60102
60102
|
const prior = prewarmedWalks.get(runKey);
|
|
60103
|
-
|
|
60103
|
+
const recheck = prior !== void 0 && prior.settled === true && Number.isFinite(args.paymentStartedAt) && prior.startedAt < args.paymentStartedAt;
|
|
60104
|
+
if (prior !== void 0 && !recheck && Date.now() - prior.startedAt <= HISTORY_PREWARM_JOIN_MS) {
|
|
60104
60105
|
latestPrewarm = prior.promise;
|
|
60105
60106
|
return true;
|
|
60106
60107
|
}
|
|
60108
|
+
if (recheck && Date.now() - prior.startedAt <= HISTORY_PREWARM_JOIN_MS) {
|
|
60109
|
+
const kept2 = prior.report;
|
|
60110
|
+
const recent = recentLoads.get(runKey);
|
|
60111
|
+
if (kept2 !== null && typeof kept2 === "object" && prior.startedAt >= proofBuiltAt && !PAYMENT_TAKEN_REPORTS.has(kept2) && (recent === void 0 || recentAgeStart(recent) < prior.startedAt)) {
|
|
60112
|
+
recentLoads.set(runKey, { startedAt: prior.startedAt, report: kept2, ageFrom: prior.startedAt });
|
|
60113
|
+
}
|
|
60114
|
+
markPhase("prewarm-recheck");
|
|
60115
|
+
}
|
|
60107
60116
|
const shared2 = sharedWalks.get(runKey);
|
|
60108
60117
|
if (shared2 !== void 0 && Date.now() - shared2.startedAt <= HISTORY_PREWARM_JOIN_MS) {
|
|
60109
60118
|
shared2.joined = true;
|
|
@@ -60136,12 +60145,14 @@ function prewarmWalletP03History(args) {
|
|
|
60136
60145
|
}
|
|
60137
60146
|
const marks = walletHistoryHomeMarks(args.store);
|
|
60138
60147
|
const entry = { startedAt: Date.now(), settled: false, marks };
|
|
60139
|
-
|
|
60148
|
+
const { paymentStartedAt: _paymentStartedAt, ...walkArgs } = args;
|
|
60149
|
+
entry.promise = loadWalletP03HistoryNow({ ...walkArgs, forceRead: false, onListed: () => {
|
|
60140
60150
|
entry.listedAt ??= Date.now();
|
|
60141
60151
|
} });
|
|
60142
60152
|
entry.promise.then(prepareReport).catch(() => {
|
|
60143
60153
|
});
|
|
60144
|
-
entry.promise.then(() => {
|
|
60154
|
+
entry.promise.then((report) => {
|
|
60155
|
+
entry.report = report;
|
|
60145
60156
|
entry.settled = true;
|
|
60146
60157
|
}, () => {
|
|
60147
60158
|
entry.settled = true;
|
|
@@ -60682,7 +60693,7 @@ var init_walletHistory = __esm({
|
|
|
60682
60693
|
recentScope = new AsyncLocalStorage3();
|
|
60683
60694
|
withRecentWalletHistory = (fn, { accept } = {}) => recentScope.run({ accept }, fn);
|
|
60684
60695
|
recentLoads = /* @__PURE__ */ new Map();
|
|
60685
|
-
recentAgeStart = (recent) => poolReadAtOf(recent.report) ?? recent.startedAt;
|
|
60696
|
+
recentAgeStart = (recent) => recent.ageFrom ?? poolReadAtOf(recent.report) ?? recent.startedAt;
|
|
60686
60697
|
forgetRecentWalletHistory = () => {
|
|
60687
60698
|
recentLoads.clear();
|
|
60688
60699
|
proofBuiltAt = Date.now();
|
|
@@ -110041,6 +110052,7 @@ function onOwnTorCircuit(pay) {
|
|
|
110041
110052
|
}
|
|
110042
110053
|
async function payTurn({ session, target, method, headers, body, maxPrice, policy, cap, requestId, memoryOnly, opts }) {
|
|
110043
110054
|
if (session.closed) fail25("fetch_session_closed", "this payer session is closed; open a new one");
|
|
110055
|
+
const paymentStartedAt = Date.now();
|
|
110044
110056
|
const timing = typeof opts?.timing === "function" ? opts.timing : session.timing();
|
|
110045
110057
|
const mark = (phase) => {
|
|
110046
110058
|
try {
|
|
@@ -110057,7 +110069,7 @@ async function payTurn({ session, target, method, headers, body, maxPrice, polic
|
|
|
110057
110069
|
let askLeg1;
|
|
110058
110070
|
if (!rerun) {
|
|
110059
110071
|
if (store !== void 0) {
|
|
110060
|
-
startHistoryPrewarm(session, store, mark);
|
|
110072
|
+
startHistoryPrewarm(session, store, mark, paymentStartedAt);
|
|
110061
110073
|
warmFloatPay({ store, connection: session.connection });
|
|
110062
110074
|
warmFloatConfig({ origin: new URL(session.memoServiceUrl).origin, timing: mark });
|
|
110063
110075
|
startRecoveredPaymentTools(lazyProofTools(session));
|
|
@@ -110142,6 +110154,7 @@ async function payTurn({ session, target, method, headers, body, maxPrice, polic
|
|
|
110142
110154
|
timing,
|
|
110143
110155
|
mark,
|
|
110144
110156
|
memoryOnly,
|
|
110157
|
+
paymentStartedAt,
|
|
110145
110158
|
answerByMs: opts?.answerByMs,
|
|
110146
110159
|
paidFrom: opts?.paidFrom
|
|
110147
110160
|
}).finally(rotateTorCircuit));
|
|
@@ -110239,10 +110252,11 @@ function warmPaymentHistory(session) {
|
|
|
110239
110252
|
} catch {
|
|
110240
110253
|
}
|
|
110241
110254
|
}
|
|
110242
|
-
function startHistoryPrewarm(session, store, mark) {
|
|
110255
|
+
function startHistoryPrewarm(session, store, mark, paymentStartedAt) {
|
|
110243
110256
|
try {
|
|
110244
110257
|
withPhaseScope(mark, "prewarm", () => prewarmWalletP03History({
|
|
110245
110258
|
store,
|
|
110259
|
+
paymentStartedAt,
|
|
110246
110260
|
connection: connectSplit(session.connection, session.historyUrl),
|
|
110247
110261
|
programId: session.programId,
|
|
110248
110262
|
pool: store.state.pool,
|
|
@@ -110356,7 +110370,7 @@ function startedIds(policy) {
|
|
|
110356
110370
|
if (ids === void 0) startedUnder.set(policy, ids = /* @__PURE__ */ new Set());
|
|
110357
110371
|
return ids;
|
|
110358
110372
|
}
|
|
110359
|
-
async function paidCall({ session, target, method, headers, body, cap, maxPrice, requestId, price, challenge, timing, mark, memoryOnly = false, answerByMs, paidFrom }) {
|
|
110373
|
+
async function paidCall({ session, target, method, headers, body, cap, maxPrice, requestId, price, challenge, timing, mark, memoryOnly = false, paymentStartedAt, answerByMs, paidFrom }) {
|
|
110360
110374
|
if (session.closed) fail25("fetch_session_closed", "this payer session is closed; open a new one");
|
|
110361
110375
|
const floatConfig = price?.floatConfig;
|
|
110362
110376
|
const release = await paymentLease(session);
|
|
@@ -110383,7 +110397,7 @@ async function paidCall({ session, target, method, headers, body, cap, maxPrice,
|
|
|
110383
110397
|
throw error;
|
|
110384
110398
|
}
|
|
110385
110399
|
}
|
|
110386
|
-
if (own?.kind !== "pocket" && !replayOnly) startHistoryPrewarm(session, store, mark);
|
|
110400
|
+
if (own?.kind !== "pocket" && !replayOnly) startHistoryPrewarm(session, store, mark, paymentStartedAt);
|
|
110387
110401
|
const policy = session.spendPolicy;
|
|
110388
110402
|
const prepared = preparedOnly(own, store);
|
|
110389
110403
|
const askPrepared = prepared && sendsKeptBytes(own, {
|
|
@@ -151155,7 +151169,9 @@ var localAiAppsLines = (answer) => [
|
|
|
151155
151169
|
` base_url = "${answer.baseUrl}"`,
|
|
151156
151170
|
' env_key = "SHINJUKU_AI_KEY"',
|
|
151157
151171
|
' wire_api = "responses"',
|
|
151158
|
-
|
|
151172
|
+
// CX3 (live, npm 0.3.134, 2026-10-31): Codex pays once per model call, and one turn makes several (PrivAI: a turn with 2 tool
|
|
151173
|
+
// calls made 4 paid calls, 0.0208 USDC, 2 min 28 s over Tor; mcp66: a one-sentence turn with no tool made 2, 0.009792 USDC).
|
|
151174
|
+
"Set SHINJUKU_AI_KEY to the api key above, then start it with: codex --profile shinjuku. Codex pays once per model call, and one turn can make several: about 0.005 USDC each with the fee on qwen3-8-flash (a short turn paid about 0.01 USDC; a turn with 2 tool calls paid about 0.021 USDC). Your other Codex sessions stay as they are."
|
|
151159
151175
|
];
|
|
151160
151176
|
var localAiCodexHint = () => `For a Codex session on this address, run: ${cli2()} infer status --verbose`;
|
|
151161
151177
|
var LOCAL_AI_CAP_SOURCE = { setup: "from your limits", default: "default", flag: "given at start" };
|