shinjuku-shield 0.3.204 → 0.3.205

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 CHANGED
@@ -5,12 +5,12 @@ web services and AI answers from your private balance, so the payment does
5
5
  not show who paid. It works inside your AI app (Claude, Cursor, Codex) and in
6
6
  a terminal. Only you hold the keys: they never leave your computer.
7
7
 
8
- This is version 0.3.204. The command is `shinjuku`.
8
+ This is version 0.3.205. The command is `shinjuku`.
9
9
 
10
10
  ## Set up
11
11
 
12
12
  ```sh
13
- npx -y shinjuku@0.3.204 setup
13
+ npx -y shinjuku@0.3.205 setup
14
14
  ```
15
15
 
16
16
  Setup does every step for you:
@@ -42,13 +42,6 @@ shinjuku setup --add-to claude-code
42
42
  Then reconnect the wallet in Claude Code: type `/mcp`, pick `shinjuku`, and
43
43
  choose Reconnect.
44
44
 
45
- > **In this test version (not offered yet):**
46
- > - On Windows, the wallet downloads and starts Tor by itself, and starts it
47
- > again after a restart.
48
- > - `setup --add-to claude-desktop`, `--add-to cursor` and `--add-to codex` add
49
- > the wallet to Claude Desktop, Cursor and Codex. At the end of setup, the
50
- > wallet prints this line for every app it knows.
51
-
52
45
  ## Add money
53
46
 
54
47
  Ask your AI app: "Add 0.50 USDC to my private balance." It gives you a
@@ -107,28 +100,7 @@ Add it yourself. The name of the wallet in your app is `shinjuku`.
107
100
  Claude Code:
108
101
 
109
102
  ```sh
110
- claude mcp add --scope user shinjuku -- npx -y --no-audit --no-fund shinjuku-shield@0.3.204 mcp
111
- ```
112
-
113
- In this test version only (not offered yet), the same entry for Claude Desktop
114
- (`claude_desktop_config.json`) or Cursor (`~/.cursor/mcp.json`):
115
-
116
- ```json
117
- { "mcpServers": { "shinjuku": { "command": "npx", "args": ["-y", "--no-audit", "--no-fund", "shinjuku-shield@0.3.204", "mcp"] } } }
118
- ```
119
-
120
- On Windows, if the app cannot find `npx`, use `"command": "cmd"` and put
121
- `"/c", "npx"` at the start of `args`.
122
-
123
- In this test version only (not offered yet), Codex (the Codex app and Codex
124
- CLI read `~/.codex/config.toml`):
125
-
126
- ```toml
127
- [mcp_servers.shinjuku]
128
- command = "npx"
129
- args = ["-y", "--no-audit", "--no-fund", "shinjuku-shield@0.3.204", "mcp"]
130
- startup_timeout_sec = 120
131
- tool_timeout_sec = 300
103
+ claude mcp add --scope user shinjuku -- npx -y --no-audit --no-fund shinjuku-shield@0.3.205 mcp
132
104
  ```
133
105
 
134
106
  ## For builders: check what you install
@@ -144,7 +116,7 @@ with the Releases table in
144
116
  Versions are published from GitHub Actions with npm provenance.
145
117
 
146
118
  `shinjuku-shield` is the package that holds the wallet. `shinjuku-shielded`
147
- 0.3.204, its older name, runs this package at the same version, so wallets
119
+ 0.3.205, its older name, runs this package at the same version, so wallets
148
120
  installed under that name keep updating. New installs use `shinjuku`.
149
121
 
150
122
  The full guide is
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": "3a493f914e0d58e854685af40d3f380b1021aaca963528edb50a6a4447da7ff6",
5
- "bytes": 9497352,
6
- "sourceCommit": "3c56cca30529dbbccc0f7f62c7b52762e2a88416",
4
+ "sha256": "a74629364f4ac22ce7b0ac74294824d926277cc1d2c5fb160f69087cb04a0303",
5
+ "bytes": 9497703,
6
+ "sourceCommit": "e9c59a9bbfb935841c6182998ac30701f93aedfb",
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",
@@ -1932,5 +1932,5 @@
1932
1932
  }
1933
1933
  ]
1934
1934
  },
1935
- "publishedAt": "2026-11-09T08:48:48.690Z"
1935
+ "publishedAt": "2026-11-09T09:27:36.428Z"
1936
1936
  }
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "shinjuku-shield",
3
- "version": "0.3.204",
3
+ "version": "0.3.205",
4
4
  "mcpName": "io.github.ShinjukuStaition/shinjuku-shield",
5
5
  "description": "Shinjuku Shield, private x402 payments 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": "3a493f91",
7
- "shinjukuSha256": "3a493f914e0d58e854685af40d3f380b1021aaca963528edb50a6a4447da7ff6",
6
+ "shinjukuRelease": "a7462936",
7
+ "shinjukuSha256": "a74629364f4ac22ce7b0ac74294824d926277cc1d2c5fb160f69087cb04a0303",
8
8
  "license": "SEE LICENSE IN LICENSE.txt",
9
9
  "author": "Shinjuku Shield",
10
10
  "homepage": "https://github.com/ShinjukuStaition/shinjuku-shield#readme",
@@ -110113,6 +110113,10 @@ function refundArrived(snapshot, refundTo) {
110113
110113
  function floatRefundHeld(snapshot, record) {
110114
110114
  return refundArrived(snapshot, record?.refundTo);
110115
110115
  }
110116
+ function submittedNewsOld(times, atMs) {
110117
+ const since = times.find((ms) => validPaymentTimeMs(ms) && ms <= atMs);
110118
+ return since === void 0 ? false : atMs - since >= REFUND_OUTCOME_NEWS_MS;
110119
+ }
110116
110120
  function returnArrivedFloatRefundBudgets(store, snapshot) {
110117
110121
  const refreshedAtMs = Date.parse(snapshot?.refreshedAt ?? "");
110118
110122
  const knowsRecipients = snapshotKnowsRecipients(snapshot);
@@ -110121,17 +110125,14 @@ function returnArrivedFloatRefundBudgets(store, snapshot) {
110121
110125
  const record = store.readWal(name);
110122
110126
  if (record?.schema !== FLOAT_PAYMENT_SCHEMA2 || typeof record.innerRequestId !== "string") continue;
110123
110127
  const state2 = floatRecordState(record);
110124
- if (state2 === "submitted") {
110125
- if (refundArrived(snapshot, record.refundTo)) releaseRefundedReservation({ store, requestId: record.innerRequestId });
110126
- continue;
110127
- }
110128
- if (state2 !== "refund_pending") continue;
110128
+ const submitted = state2 === "submitted";
110129
+ if (!submitted && state2 !== "refund_pending") continue;
110129
110130
  const arrivedNow = refundArrived(snapshot, record.refundTo);
110130
110131
  if (arrivedNow) releaseRefundedReservation({ store, requestId: record.innerRequestId });
110131
- const outcome = arrivedNow ? "refund_arrived" : record.refundOutcome === void 0 && refundCountStopped(record, refreshedAtMs, knowsRecipients) ? "refund_not_seen" : void 0;
110132
+ const outcome = arrivedNow ? "refund_arrived" : !submitted && record.refundOutcome === void 0 && refundCountStopped(record, refreshedAtMs, knowsRecipients) ? "refund_not_seen" : void 0;
110132
110133
  if (outcome === void 0 || outcome === record.refundOutcome) continue;
110133
110134
  const atMs = Number.isFinite(refreshedAtMs) ? refreshedAtMs : Date.now();
110134
- const old = !(atMs - record.refundPendingAtMs < REFUND_OUTCOME_NEWS_MS);
110135
+ const old = submitted ? submittedNewsOld([record.submittedAtMs, record.floatPaidAtMs, record.createdAtMs], atMs) : !(atMs - record.refundPendingAtMs < REFUND_OUTCOME_NEWS_MS);
110135
110136
  try {
110136
110137
  store.writeWal(name, { ...record, refundOutcome: outcome, refundOutcomeAtMs: atMs, refundOutcomeShown: old });
110137
110138
  } catch {
@@ -110155,7 +110156,7 @@ function paymentTimeText(paidAtMs, nowMs = Date.now()) {
110155
110156
  function validPaymentTimeMs(ms) {
110156
110157
  return Number.isSafeInteger(ms) && ms >= PAYMENT_TIME_MIN_MS && ms <= PAYMENT_TIME_MAX_MS && Number.isFinite(new Date(ms).getTime());
110157
110158
  }
110158
- function readFloatRefundOutcomes(store) {
110159
+ function readFloatRefundOutcomes(store, now = Date.now()) {
110159
110160
  const outcomes = [];
110160
110161
  let names;
110161
110162
  try {
@@ -110167,7 +110168,7 @@ function readFloatRefundOutcomes(store) {
110167
110168
  if (!name.startsWith(FLOAT_PAYMENT_WAL_PREFIX2)) continue;
110168
110169
  try {
110169
110170
  const record = store.readWal(name);
110170
- if (record?.schema !== FLOAT_PAYMENT_SCHEMA2 || floatRecordState(record) !== "refund_pending") continue;
110171
+ if (record?.schema !== FLOAT_PAYMENT_SCHEMA2 || !["refund_pending", "submitted"].includes(floatRecordState(record))) continue;
110171
110172
  if (record.refundOutcome === void 0 || record.refundOutcomeShown !== false) continue;
110172
110173
  const inner = String(record.innerRequestId ?? "");
110173
110174
  outcomes.push({
@@ -110177,7 +110178,8 @@ function readFloatRefundOutcomes(store) {
110177
110178
  outcome: record.refundOutcome,
110178
110179
  atMs: record.refundOutcomeAtMs,
110179
110180
  // The first VALID time (Codex round 1 on 7faf9c93: `??` took an invalid non-null time before a valid later one).
110180
- paidAtMs: [record.floatPaidAtMs, record.submittedAtMs, record.createdAtMs].find(validPaymentTimeMs),
110181
+ // and never one after now (Codex round 1 on 41e095b2: a time in the future is no time).
110182
+ paidAtMs: [record.floatPaidAtMs, record.submittedAtMs, record.createdAtMs].find((ms) => validPaymentTimeMs(ms) && ms <= now),
110181
110183
  ...inner.endsWith(":float") ? { requestId: inner.slice(0, -":float".length) } : {}
110182
110184
  });
110183
110185
  } catch {