shinjuku-shield 0.3.232 → 0.3.234
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 +3 -3
- package/manifest.json +14 -14
- package/package.json +3 -3
- package/shinjuku-seller.mjs +138 -46
- package/shinjuku-wallet.mjs +4611 -2493
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ web services and AI answers from your private balance, so the payment does
|
|
|
8
8
|
not show who paid. It works inside your AI app (Claude, Cursor, Codex) and in
|
|
9
9
|
a terminal. Only you hold the keys: they never leave your computer.
|
|
10
10
|
|
|
11
|
-
This is version 0.3.
|
|
11
|
+
This is version 0.3.234. The command is `shinjuku`.
|
|
12
12
|
|
|
13
13
|
## Set up
|
|
14
14
|
|
|
@@ -112,7 +112,7 @@ Add it yourself. The name of the wallet in your app is `shinjuku`.
|
|
|
112
112
|
Claude Code:
|
|
113
113
|
|
|
114
114
|
```sh
|
|
115
|
-
claude mcp add --scope user shinjuku -- npx -y --prefer-offline --no-audit --no-fund shinjuku-shield@0.3.
|
|
115
|
+
claude mcp add --scope user shinjuku -- npx -y --prefer-offline --no-audit --no-fund shinjuku-shield@0.3.234 mcp
|
|
116
116
|
```
|
|
117
117
|
|
|
118
118
|
`--prefer-offline` runs the copy of the wallet that npm saved. If npm has not saved it yet, that start asks
|
|
@@ -131,7 +131,7 @@ with the Releases table in
|
|
|
131
131
|
Versions are published from GitHub Actions with npm provenance.
|
|
132
132
|
|
|
133
133
|
`shinjuku-shield` is the package that holds the wallet. `shinjuku-shielded`
|
|
134
|
-
0.3.
|
|
134
|
+
0.3.234, its older name, runs this package at the same version, so wallets
|
|
135
135
|
installed under that name keep updating. New installs use `shinjuku`.
|
|
136
136
|
|
|
137
137
|
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": "
|
|
5
|
-
"bytes":
|
|
6
|
-
"sourceCommit": "
|
|
4
|
+
"sha256": "a58340f4851a631086255680831eba498530769d1468b0add3478959b264ec15",
|
|
5
|
+
"bytes": 10510312,
|
|
6
|
+
"sourceCommit": "b0aa438771a15fa66313864cd06a94195f4c30c1",
|
|
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",
|
|
@@ -77,13 +77,13 @@
|
|
|
77
77
|
},
|
|
78
78
|
{
|
|
79
79
|
"path": "wallet/src/mcp/views/add-funds.html",
|
|
80
|
-
"sha256": "
|
|
81
|
-
"bytes":
|
|
80
|
+
"sha256": "411e3eedd8f2ba828c0451d1a3d4ac0ca33c9ed8fa36a625dc5d99df4fd68203",
|
|
81
|
+
"bytes": 7097
|
|
82
82
|
},
|
|
83
83
|
{
|
|
84
84
|
"path": "wallet/src/mcp/views/price-card.html",
|
|
85
|
-
"sha256": "
|
|
86
|
-
"bytes":
|
|
85
|
+
"sha256": "6ddd9d6c9309ccd028f0549c0d7de1d290cbd8ad1eecf45ac5126550779b0a72",
|
|
86
|
+
"bytes": 7866
|
|
87
87
|
},
|
|
88
88
|
{
|
|
89
89
|
"path": "wallet/src/mcp/views/receipts.html",
|
|
@@ -92,13 +92,13 @@
|
|
|
92
92
|
},
|
|
93
93
|
{
|
|
94
94
|
"path": "wallet/src/mcp/views/shared.js",
|
|
95
|
-
"sha256": "
|
|
96
|
-
"bytes":
|
|
95
|
+
"sha256": "a860d8c3487f2a2ec1a39eba720c79fe12e82c48faf82fb1a0e3e8546e3e2a5a",
|
|
96
|
+
"bytes": 7368
|
|
97
97
|
},
|
|
98
98
|
{
|
|
99
99
|
"path": "wallet/src/mcp/views/wallet-card.html",
|
|
100
|
-
"sha256": "
|
|
101
|
-
"bytes":
|
|
100
|
+
"sha256": "e4a20a52f5d8c96e2e7ab5624e9878b643fe2ba32f6dcf3dc61f70e12fc01717",
|
|
101
|
+
"bytes": 5522
|
|
102
102
|
},
|
|
103
103
|
{
|
|
104
104
|
"path": "wallet/vendor/ext-apps-1.7.5/app-with-deps.js",
|
|
@@ -1075,8 +1075,8 @@
|
|
|
1075
1075
|
],
|
|
1076
1076
|
"seller": {
|
|
1077
1077
|
"file": "shinjuku-seller.mjs",
|
|
1078
|
-
"sha256": "
|
|
1079
|
-
"bytes":
|
|
1078
|
+
"sha256": "3e3e3c578db21d80ffc28ab978364f001964a72b70dfd249082b510bd5298c91",
|
|
1079
|
+
"bytes": 4203882,
|
|
1080
1080
|
"entry": "wallet/src/seller/exact/index.mjs",
|
|
1081
1081
|
"external": [
|
|
1082
1082
|
"@x402/core/http",
|
|
@@ -1968,5 +1968,5 @@
|
|
|
1968
1968
|
}
|
|
1969
1969
|
]
|
|
1970
1970
|
},
|
|
1971
|
-
"publishedAt": "2026-11-
|
|
1971
|
+
"publishedAt": "2026-11-17T08:21:23.545Z"
|
|
1972
1972
|
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shinjuku-shield",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.234",
|
|
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": "
|
|
7
|
-
"shinjukuSha256": "
|
|
6
|
+
"shinjukuRelease": "a58340f4",
|
|
7
|
+
"shinjukuSha256": "a58340f4851a631086255680831eba498530769d1468b0add3478959b264ec15",
|
|
8
8
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
9
9
|
"author": "Shinjuku Shield",
|
|
10
10
|
"homepage": "https://github.com/ShinjukuStaition/shinjuku-shield#readme",
|
package/shinjuku-seller.mjs
CHANGED
|
@@ -33380,6 +33380,81 @@ var init_globalDispatcher = __esm({
|
|
|
33380
33380
|
});
|
|
33381
33381
|
|
|
33382
33382
|
// wallet/src/net/runEnd.mjs
|
|
33383
|
+
function trackRequests(dispatcher) {
|
|
33384
|
+
if (!dispatcher || typeof dispatcher.dispatch !== "function" || tracked.has(dispatcher)) return dispatcher;
|
|
33385
|
+
const state2 = { running: 0, idle: /* @__PURE__ */ new Set() };
|
|
33386
|
+
tracked.set(dispatcher, state2);
|
|
33387
|
+
const dispatch = dispatcher.dispatch;
|
|
33388
|
+
dispatcher.dispatch = function trackedDispatch(options, handler) {
|
|
33389
|
+
state2.running += 1;
|
|
33390
|
+
let open3 = true;
|
|
33391
|
+
const ended2 = () => {
|
|
33392
|
+
if (!open3) return;
|
|
33393
|
+
open3 = false;
|
|
33394
|
+
state2.running -= 1;
|
|
33395
|
+
if (state2.running === 0) for (const onIdle of [...state2.idle]) onIdle();
|
|
33396
|
+
};
|
|
33397
|
+
const observed2 = new Proxy(handler, {
|
|
33398
|
+
get(target, property) {
|
|
33399
|
+
const value2 = Reflect.get(target, property);
|
|
33400
|
+
if (typeof value2 !== "function") return value2;
|
|
33401
|
+
if (!REQUEST_END_CALLS.has(property)) return value2.bind(target);
|
|
33402
|
+
return (...args) => {
|
|
33403
|
+
try {
|
|
33404
|
+
return value2.apply(target, args);
|
|
33405
|
+
} finally {
|
|
33406
|
+
ended2();
|
|
33407
|
+
}
|
|
33408
|
+
};
|
|
33409
|
+
}
|
|
33410
|
+
});
|
|
33411
|
+
try {
|
|
33412
|
+
return dispatch.call(this, options, observed2);
|
|
33413
|
+
} catch (error) {
|
|
33414
|
+
ended2();
|
|
33415
|
+
throw error;
|
|
33416
|
+
}
|
|
33417
|
+
};
|
|
33418
|
+
return dispatcher;
|
|
33419
|
+
}
|
|
33420
|
+
function destroyNow(dispatcher, error) {
|
|
33421
|
+
try {
|
|
33422
|
+
return Promise.resolve(error === void 0 ? dispatcher.destroy() : dispatcher.destroy(error)).then(() => void 0, () => void 0);
|
|
33423
|
+
} catch {
|
|
33424
|
+
return Promise.resolve();
|
|
33425
|
+
}
|
|
33426
|
+
}
|
|
33427
|
+
function closeDispatcher(dispatcher) {
|
|
33428
|
+
if (!dispatcher || typeof dispatcher.destroy !== "function") return Promise.resolve();
|
|
33429
|
+
const known = retiring.get(dispatcher);
|
|
33430
|
+
if (known) return known;
|
|
33431
|
+
const state2 = tracked.get(dispatcher);
|
|
33432
|
+
const done = new Promise((resolveRetired) => {
|
|
33433
|
+
let timer;
|
|
33434
|
+
let over = false;
|
|
33435
|
+
const retire = () => {
|
|
33436
|
+
if (over) return;
|
|
33437
|
+
over = true;
|
|
33438
|
+
clearTimeout(timer);
|
|
33439
|
+
state2?.idle.delete(retire);
|
|
33440
|
+
destroyNow(dispatcher).then(resolveRetired);
|
|
33441
|
+
};
|
|
33442
|
+
timer = setTimeout(retire, CLOSE_WAIT_MS);
|
|
33443
|
+
timer.unref?.();
|
|
33444
|
+
if (state2 === void 0) return;
|
|
33445
|
+
if (state2.running === 0) {
|
|
33446
|
+
retire();
|
|
33447
|
+
return;
|
|
33448
|
+
}
|
|
33449
|
+
state2.idle.add(retire);
|
|
33450
|
+
});
|
|
33451
|
+
retiring.set(dispatcher, done);
|
|
33452
|
+
return done;
|
|
33453
|
+
}
|
|
33454
|
+
function destroyDispatcher(dispatcher, error) {
|
|
33455
|
+
if (!dispatcher || typeof dispatcher.destroy !== "function") return Promise.resolve();
|
|
33456
|
+
return destroyNow(dispatcher, error);
|
|
33457
|
+
}
|
|
33383
33458
|
function runSleep(ms) {
|
|
33384
33459
|
if (ended) return Promise.resolve();
|
|
33385
33460
|
return new Promise((resolve18) => {
|
|
@@ -33397,13 +33472,17 @@ function registerRunDispatchers(list) {
|
|
|
33397
33472
|
function registerRunSockets(list) {
|
|
33398
33473
|
socketSources.add(list);
|
|
33399
33474
|
}
|
|
33400
|
-
var ended, sources, runEnded, runEndedError, sleeps, socketSources;
|
|
33475
|
+
var ended, sources, CLOSE_WAIT_MS, tracked, retiring, REQUEST_END_CALLS, runEnded, runEndedError, sleeps, socketSources;
|
|
33401
33476
|
var init_runEnd = __esm({
|
|
33402
33477
|
"wallet/src/net/runEnd.mjs"() {
|
|
33403
33478
|
"use strict";
|
|
33404
33479
|
init_globalDispatcher();
|
|
33405
33480
|
ended = false;
|
|
33406
33481
|
sources = /* @__PURE__ */ new Set();
|
|
33482
|
+
CLOSE_WAIT_MS = 3e4;
|
|
33483
|
+
tracked = /* @__PURE__ */ new WeakMap();
|
|
33484
|
+
retiring = /* @__PURE__ */ new WeakMap();
|
|
33485
|
+
REQUEST_END_CALLS = /* @__PURE__ */ new Set(["onComplete", "onError", "onUpgrade", "onResponseEnd", "onResponseError"]);
|
|
33407
33486
|
runEnded = () => ended;
|
|
33408
33487
|
runEndedError = () => Object.assign(new Error("run_ended"), { code: "run_ended" });
|
|
33409
33488
|
sleeps = /* @__PURE__ */ new Set();
|
|
@@ -34894,6 +34973,12 @@ var init_keepAlive = __esm({
|
|
|
34894
34973
|
import { AsyncLocalStorage as AsyncLocalStorage2 } from "node:async_hooks";
|
|
34895
34974
|
import net from "node:net";
|
|
34896
34975
|
import { Duplex } from "node:stream";
|
|
34976
|
+
function connectSent(claim) {
|
|
34977
|
+
try {
|
|
34978
|
+
claim?.onConnect?.();
|
|
34979
|
+
} catch {
|
|
34980
|
+
}
|
|
34981
|
+
}
|
|
34897
34982
|
function claimTunnelOpen() {
|
|
34898
34983
|
const claim = tunnelOpenListener.getStore();
|
|
34899
34984
|
if (claim === void 0 || claim.claimed) return void 0;
|
|
@@ -34926,6 +35011,7 @@ function tunnelClient(Dispatcher, proxyPort, proxyHost) {
|
|
|
34926
35011
|
const target = String(params?.path ?? "");
|
|
34927
35012
|
const onOpen = claimTunnelOpen();
|
|
34928
35013
|
if (optimisticTarget(target)) {
|
|
35014
|
+
connectSent(onOpen);
|
|
34929
35015
|
try {
|
|
34930
35016
|
return await optimisticConnect(params, { proxyHost, proxyPort, closedInRow, onOpen });
|
|
34931
35017
|
} catch (error) {
|
|
@@ -34940,6 +35026,7 @@ function tunnelClient(Dispatcher, proxyPort, proxyHost) {
|
|
|
34940
35026
|
const own = claimTunnelSignal();
|
|
34941
35027
|
const signal = own === void 0 ? params?.signal : params?.signal ? AbortSignal.any([params.signal, own]) : own;
|
|
34942
35028
|
const startedAt = Date.now();
|
|
35029
|
+
connectSent(onOpen);
|
|
34943
35030
|
try {
|
|
34944
35031
|
const answer = await direct.connect(signal === params?.signal ? params : { ...params, signal });
|
|
34945
35032
|
closedInRow.delete(target);
|
|
@@ -34961,14 +35048,15 @@ function tunnelClient(Dispatcher, proxyPort, proxyHost) {
|
|
|
34961
35048
|
);
|
|
34962
35049
|
}
|
|
34963
35050
|
},
|
|
34964
|
-
|
|
34965
|
-
|
|
35051
|
+
// Through runEnd.mjs (to-do 143): undici calls these only from the outer dispatcher's own close or destroy.
|
|
35052
|
+
close: () => closeDispatcher(direct),
|
|
35053
|
+
destroy: (error) => destroyDispatcher(direct, error)
|
|
34966
35054
|
};
|
|
34967
35055
|
}
|
|
34968
35056
|
function proxyDispatcher(Dispatcher, proxy) {
|
|
34969
35057
|
const url = new URL(proxy);
|
|
34970
35058
|
const port = Number(url.port || (url.protocol === "https:" ? 443 : 80));
|
|
34971
|
-
return new Dispatcher({
|
|
35059
|
+
return trackRequests(new Dispatcher({
|
|
34972
35060
|
httpProxy: proxy,
|
|
34973
35061
|
httpsProxy: proxy,
|
|
34974
35062
|
noProxy: "",
|
|
@@ -34976,7 +35064,7 @@ function proxyDispatcher(Dispatcher, proxy) {
|
|
|
34976
35064
|
keepAliveTimeout: KEEP_ALIVE_MS,
|
|
34977
35065
|
keepAliveMaxTimeout: KEEP_ALIVE_MS,
|
|
34978
35066
|
clientFactory: () => tunnelClient(Dispatcher, port, url.hostname)
|
|
34979
|
-
});
|
|
35067
|
+
}));
|
|
34980
35068
|
}
|
|
34981
35069
|
function optimisticTarget(target) {
|
|
34982
35070
|
return String(process.env[RUN_MARK] ?? "").startsWith("tor ") && /:443$/.test(target);
|
|
@@ -35270,14 +35358,9 @@ async function onOwnTagDispatcher(dispatcher, task) {
|
|
|
35270
35358
|
return await ownTag.run(scope2, task);
|
|
35271
35359
|
} finally {
|
|
35272
35360
|
scope2.dispatcher = void 0;
|
|
35273
|
-
|
|
35361
|
+
closeDispatcher(dispatcher).then(() => {
|
|
35274
35362
|
ownTagDispatchers.delete(dispatcher);
|
|
35275
|
-
};
|
|
35276
|
-
try {
|
|
35277
|
-
dispatcher.close().then(drop, drop);
|
|
35278
|
-
} catch {
|
|
35279
|
-
drop();
|
|
35280
|
-
}
|
|
35363
|
+
});
|
|
35281
35364
|
}
|
|
35282
35365
|
}
|
|
35283
35366
|
function routeDispatcherOf(url) {
|
|
@@ -35311,14 +35394,9 @@ function onionInit(init = {}) {
|
|
|
35311
35394
|
function closeOnionDispatchersExcept(proxy) {
|
|
35312
35395
|
for (const [tag2, dispatcher] of onionDispatchers) {
|
|
35313
35396
|
if (tag2 === proxy) continue;
|
|
35314
|
-
|
|
35397
|
+
closeDispatcher(dispatcher).then(() => {
|
|
35315
35398
|
if (onionDispatchers.get(tag2) === dispatcher) onionDispatchers.delete(tag2);
|
|
35316
|
-
};
|
|
35317
|
-
try {
|
|
35318
|
-
dispatcher.close().then(drop, drop);
|
|
35319
|
-
} catch {
|
|
35320
|
-
drop();
|
|
35321
|
-
}
|
|
35399
|
+
});
|
|
35322
35400
|
}
|
|
35323
35401
|
}
|
|
35324
35402
|
function untilAborted(promise, signal) {
|
|
@@ -37960,13 +38038,7 @@ function switchTorTag() {
|
|
|
37960
38038
|
for (const one of /* @__PURE__ */ new Set([oldGlobal, nodeBuilt])) if (one !== void 0 && one !== activeGlobalDispatcher()) left.push(one);
|
|
37961
38039
|
laneDispatchers.clear();
|
|
37962
38040
|
setImmediate(() => {
|
|
37963
|
-
for (const dispatcher of left)
|
|
37964
|
-
try {
|
|
37965
|
-
dispatcher.close().catch(() => {
|
|
37966
|
-
});
|
|
37967
|
-
} catch {
|
|
37968
|
-
}
|
|
37969
|
-
}
|
|
38041
|
+
for (const dispatcher of left) closeDispatcher(dispatcher);
|
|
37970
38042
|
closeOnionDispatchersExcept(env.HTTP_PROXY);
|
|
37971
38043
|
});
|
|
37972
38044
|
torCircuitId += 1;
|
|
@@ -37996,11 +38068,7 @@ function dropTorLane(lane) {
|
|
|
37996
38068
|
if (dispatcher === void 0) return;
|
|
37997
38069
|
laneDispatchers.delete(lane);
|
|
37998
38070
|
setImmediate(() => {
|
|
37999
|
-
|
|
38000
|
-
dispatcher.close().catch(() => {
|
|
38001
|
-
});
|
|
38002
|
-
} catch {
|
|
38003
|
-
}
|
|
38071
|
+
closeDispatcher(dispatcher);
|
|
38004
38072
|
});
|
|
38005
38073
|
} catch {
|
|
38006
38074
|
}
|
|
@@ -43372,6 +43440,7 @@ var init_errorCodes = __esm({
|
|
|
43372
43440
|
"inference_max_payment_invalid",
|
|
43373
43441
|
"inference_max_tokens_required",
|
|
43374
43442
|
"inference_max_tokens_too_low",
|
|
43443
|
+
"inference_recovery_max_tokens_mismatch",
|
|
43375
43444
|
"inference_messages_invalid",
|
|
43376
43445
|
"inference_tools_invalid",
|
|
43377
43446
|
"inference_model_unknown",
|
|
@@ -44464,6 +44533,8 @@ var init_errorCodes = __esm({
|
|
|
44464
44533
|
"wallet_process_identity_unavailable",
|
|
44465
44534
|
"wallet_process_lease_lost",
|
|
44466
44535
|
"wallet_process_locked",
|
|
44536
|
+
// prove/programStart.mjs: this computer refused to start a wallet proof program (Smart App Control on Windows, 2026-11-16).
|
|
44537
|
+
"wallet_program_start_refused",
|
|
44467
44538
|
"wallet_store",
|
|
44468
44539
|
"wallet_store_already_exists",
|
|
44469
44540
|
"wallet_store_missing",
|
|
@@ -44906,6 +44977,9 @@ var init_errorCodes = __esm({
|
|
|
44906
44977
|
"fetch_challenge_invalid",
|
|
44907
44978
|
"fetch_seller_x402_v1",
|
|
44908
44979
|
"fetch_seller_unreachable",
|
|
44980
|
+
// fetch/payAndFetch.mjs payTurn: the seller gave no answer and this request id's payment record could not be read, so
|
|
44981
|
+
// whether another wallet process paid it is not known (Codex round 2 on 8049e71dd item 1).
|
|
44982
|
+
"fetch_payment_state_unknown",
|
|
44909
44983
|
// pay/sellerInput.mjs: the seller's own 402 says this GET lacks a query value; nothing was paid (UX128-6, 2026-10-29).
|
|
44910
44984
|
"fetch_seller_input_missing",
|
|
44911
44985
|
// pay/sellerInput.mjs: the seller's own 402 names another method (POST with a JSON body); nothing was paid (2026-11-12).
|
|
@@ -63181,12 +63255,13 @@ function manifestTool(base, value2, label) {
|
|
|
63181
63255
|
const tool = exactTool(value2, label);
|
|
63182
63256
|
return Object.freeze({ path: manifestPath(base, tool.path, true), sha256: tool.sha256 });
|
|
63183
63257
|
}
|
|
63184
|
-
function childFailure(status, stderr) {
|
|
63258
|
+
function childFailure(status, stderr, startError) {
|
|
63185
63259
|
const error = new Error(`p03_recovered_payment_child_failed:${status ?? "signal"}`);
|
|
63186
63260
|
Object.defineProperty(error, "childStderr", {
|
|
63187
63261
|
value: String(stderr ?? ""),
|
|
63188
63262
|
enumerable: false
|
|
63189
63263
|
});
|
|
63264
|
+
if (startError) Object.defineProperty(error, "startRefusedCode", { value: String(startError.code ?? "UNKNOWN"), enumerable: false });
|
|
63190
63265
|
return error;
|
|
63191
63266
|
}
|
|
63192
63267
|
function runAsync(command, args, { input, ...options } = {}) {
|
|
@@ -63197,6 +63272,7 @@ function runAsync(command, args, { input, ...options } = {}) {
|
|
|
63197
63272
|
function launchAsync(command, args, { stdin = "ignore", ...options } = {}) {
|
|
63198
63273
|
let child;
|
|
63199
63274
|
let timer;
|
|
63275
|
+
let refused2 = false;
|
|
63200
63276
|
const done = new Promise((resolvePromise, reject) => {
|
|
63201
63277
|
const out = [];
|
|
63202
63278
|
const err = [];
|
|
@@ -63205,7 +63281,8 @@ function launchAsync(command, args, { stdin = "ignore", ...options } = {}) {
|
|
|
63205
63281
|
try {
|
|
63206
63282
|
child = spawn(command, args, { windowsHide: true, stdio: [stdin, "pipe", "pipe"], ...options });
|
|
63207
63283
|
} catch (error) {
|
|
63208
|
-
|
|
63284
|
+
refused2 = true;
|
|
63285
|
+
reject(childFailure(void 0, error?.message, error));
|
|
63209
63286
|
return;
|
|
63210
63287
|
}
|
|
63211
63288
|
child.stdin?.on("error", () => {
|
|
@@ -63226,15 +63303,18 @@ function launchAsync(command, args, { stdin = "ignore", ...options } = {}) {
|
|
|
63226
63303
|
child.stdout.on("data", collect(out));
|
|
63227
63304
|
child.stderr.on("data", collect(err));
|
|
63228
63305
|
let settled = false;
|
|
63229
|
-
const finish = (status, stderr) => {
|
|
63306
|
+
const finish = (status, stderr, startError) => {
|
|
63230
63307
|
if (settled) return;
|
|
63231
63308
|
settled = true;
|
|
63232
63309
|
clearTimeout(timer);
|
|
63233
63310
|
if (status === 0 && !failed) resolvePromise(Buffer.concat(out).toString("utf8"));
|
|
63234
|
-
else reject(childFailure(failed ? void 0 : status, stderr ?? Buffer.concat(err).toString("utf8")));
|
|
63311
|
+
else reject(childFailure(failed ? void 0 : status, stderr ?? Buffer.concat(err).toString("utf8"), startError));
|
|
63235
63312
|
};
|
|
63236
63313
|
child.on("error", (error) => {
|
|
63237
|
-
if (child.pid === void 0)
|
|
63314
|
+
if (child.pid === void 0) {
|
|
63315
|
+
refused2 = true;
|
|
63316
|
+
finish(void 0, error?.message, error);
|
|
63317
|
+
}
|
|
63238
63318
|
});
|
|
63239
63319
|
child.on("close", (status) => finish(status));
|
|
63240
63320
|
});
|
|
@@ -63250,7 +63330,7 @@ function launchAsync(command, args, { stdin = "ignore", ...options } = {}) {
|
|
|
63250
63330
|
}
|
|
63251
63331
|
}
|
|
63252
63332
|
};
|
|
63253
|
-
return { done, send: send2, hold };
|
|
63333
|
+
return { done, send: send2, hold, startRefused: () => refused2 };
|
|
63254
63334
|
}
|
|
63255
63335
|
function observedToolSha256Async(tool) {
|
|
63256
63336
|
if (!isAbsolute4(tool.path) || !existsSync(tool.path)) return Promise.reject(new Error("tool_path_invalid"));
|
|
@@ -69623,7 +69703,7 @@ var init_amounts = __esm({
|
|
|
69623
69703
|
});
|
|
69624
69704
|
|
|
69625
69705
|
// wallet/src/mcp/discover.mjs
|
|
69626
|
-
var DEFAULT_DISCOVERY_SOURCES, DISCOVER_LIMITS, SYNONYMS, CACHE_TEMP_MAX_MS, discoverToolDefinition, heavyChain;
|
|
69706
|
+
var DEFAULT_DISCOVERY_SOURCES, TOR_REACH_LIMITS, DISCOVER_LIMITS, SYNONYMS, CACHE_TEMP_MAX_MS, discoverToolDefinition, heavyChain;
|
|
69627
69707
|
var init_discover = __esm({
|
|
69628
69708
|
"wallet/src/mcp/discover.mjs"() {
|
|
69629
69709
|
"use strict";
|
|
@@ -69656,6 +69736,16 @@ var init_discover = __esm({
|
|
|
69656
69736
|
upstream: "https://coinrailz.com/.well-known/x402"
|
|
69657
69737
|
})
|
|
69658
69738
|
]);
|
|
69739
|
+
TOR_REACH_LIMITS = Object.freeze({
|
|
69740
|
+
freshMs: 6 * 60 * 6e4,
|
|
69741
|
+
maxAgeMs: 72 * 60 * 6e4,
|
|
69742
|
+
markMaxAgeMs: 72 * 60 * 6e4,
|
|
69743
|
+
futureSlackMs: 10 * 6e4,
|
|
69744
|
+
fetchMs: 15e3,
|
|
69745
|
+
waitMs: 3e3,
|
|
69746
|
+
maxBytes: 1024 * 1024,
|
|
69747
|
+
failedPauseMs: 10 * 6e4
|
|
69748
|
+
});
|
|
69659
69749
|
DISCOVER_LIMITS = Object.freeze({
|
|
69660
69750
|
pageSize: 1e3,
|
|
69661
69751
|
/**
|
|
@@ -69895,7 +69985,7 @@ function floatRefundHeld(snapshot, record) {
|
|
|
69895
69985
|
function floatRecordState(record) {
|
|
69896
69986
|
return record?.state === "refund_pending" && record.ambiguous === true ? "submitted" : record?.state;
|
|
69897
69987
|
}
|
|
69898
|
-
var import_web3114, MAX_BODY_BYTES, REFUND_OUTCOME_NEWS_MS, RESULT_LIMIT_BYTES, RESIGN_ANSWER_MAX_BYTES, PAYMENT_TIME_MIN_MS, PAYMENT_TIME_MAX_MS, TRANSFER_LANDING_WINDOW_MS, PROOF_DELIVERY_MS, SELF_BROADCAST_LEG1_LEFT_MS, SELLER_HEADERS_MAX_BYTES;
|
|
69988
|
+
var import_web3114, MAX_BODY_BYTES, REFUND_OUTCOME_NEWS_MS, RESULT_LIMIT_BYTES, EARLY_READS_MS, RESIGN_ANSWER_MAX_BYTES, PAYMENT_TIME_MIN_MS, PAYMENT_TIME_MAX_MS, TRANSFER_LANDING_WINDOW_MS, PROOF_DELIVERY_MS, SELF_BROADCAST_LEG1_LEFT_MS, SELLER_HEADERS_MAX_BYTES;
|
|
69899
69989
|
var init_floatPay = __esm({
|
|
69900
69990
|
"wallet/src/pay/floatPay.mjs"() {
|
|
69901
69991
|
"use strict";
|
|
@@ -69931,6 +70021,7 @@ var init_floatPay = __esm({
|
|
|
69931
70021
|
MAX_BODY_BYTES = 12 * 1024;
|
|
69932
70022
|
REFUND_OUTCOME_NEWS_MS = 24 * 60 * 60 * 1e3;
|
|
69933
70023
|
RESULT_LIMIT_BYTES = 1024 * 1024;
|
|
70024
|
+
EARLY_READS_MS = Object.freeze([1e3, 2e3]);
|
|
69934
70025
|
RESIGN_ANSWER_MAX_BYTES = 128 * 1024;
|
|
69935
70026
|
PAYMENT_TIME_MIN_MS = Date.UTC(2024, 0, 1);
|
|
69936
70027
|
PAYMENT_TIME_MAX_MS = Date.UTC(9999, 11, 31);
|
|
@@ -75909,12 +76000,13 @@ function manifestTool2(base, value2, label) {
|
|
|
75909
76000
|
const tool = exactTool2(value2, label);
|
|
75910
76001
|
return Object.freeze({ path: manifestPath2(base, tool.path, true), sha256: tool.sha256 });
|
|
75911
76002
|
}
|
|
75912
|
-
function childFailure2(status, stderr) {
|
|
76003
|
+
function childFailure2(status, stderr, startError) {
|
|
75913
76004
|
const error = new Error(`p03_recovered_exit_child_failed:${status ?? "signal"}`);
|
|
75914
76005
|
Object.defineProperty(error, "childStderr", {
|
|
75915
76006
|
value: String(stderr ?? ""),
|
|
75916
76007
|
enumerable: false
|
|
75917
76008
|
});
|
|
76009
|
+
if (startError) Object.defineProperty(error, "startRefusedCode", { value: String(startError.code ?? "UNKNOWN"), enumerable: false });
|
|
75918
76010
|
return error;
|
|
75919
76011
|
}
|
|
75920
76012
|
function runAsync2(command, args, { input, ...options } = {}) {
|
|
@@ -75931,7 +76023,7 @@ function runAsync2(command, args, { input, ...options } = {}) {
|
|
|
75931
76023
|
...options
|
|
75932
76024
|
});
|
|
75933
76025
|
} catch (error) {
|
|
75934
|
-
reject(childFailure2(void 0, error?.message));
|
|
76026
|
+
reject(childFailure2(void 0, error?.message, error));
|
|
75935
76027
|
return;
|
|
75936
76028
|
}
|
|
75937
76029
|
const timer = setTimeout(() => {
|
|
@@ -75950,15 +76042,15 @@ function runAsync2(command, args, { input, ...options } = {}) {
|
|
|
75950
76042
|
child.stdout.on("data", collect(out));
|
|
75951
76043
|
child.stderr.on("data", collect(err));
|
|
75952
76044
|
let settled = false;
|
|
75953
|
-
const finish = (status, stderr) => {
|
|
76045
|
+
const finish = (status, stderr, startError) => {
|
|
75954
76046
|
if (settled) return;
|
|
75955
76047
|
settled = true;
|
|
75956
76048
|
clearTimeout(timer);
|
|
75957
76049
|
if (status === 0 && !failed) resolvePromise(Buffer.concat(out).toString("utf8"));
|
|
75958
|
-
else reject(childFailure2(failed ? void 0 : status, stderr ?? Buffer.concat(err).toString("utf8")));
|
|
76050
|
+
else reject(childFailure2(failed ? void 0 : status, stderr ?? Buffer.concat(err).toString("utf8"), startError));
|
|
75959
76051
|
};
|
|
75960
76052
|
child.on("error", (error) => {
|
|
75961
|
-
if (child.pid === void 0) finish(void 0, error?.message);
|
|
76053
|
+
if (child.pid === void 0) finish(void 0, error?.message, error);
|
|
75962
76054
|
});
|
|
75963
76055
|
child.on("close", (status) => finish(status));
|
|
75964
76056
|
if (input !== void 0) {
|
|
@@ -81014,6 +81106,7 @@ startStallCloser();
|
|
|
81014
81106
|
|
|
81015
81107
|
// wallet/src/seller/setup.mjs
|
|
81016
81108
|
init_tunnelGuard();
|
|
81109
|
+
init_runEnd();
|
|
81017
81110
|
init_serviceUrl();
|
|
81018
81111
|
init_backup();
|
|
81019
81112
|
init_files();
|
|
@@ -81125,8 +81218,7 @@ Or run ${cli()} seller setup again and choose no Tor.`
|
|
|
81125
81218
|
const dispatcher = proxyDispatcher(proxyDispatcherClass(), tagged.href.replace(/\/$/, ""));
|
|
81126
81219
|
return {
|
|
81127
81220
|
fetch: (input, init = {}) => fetch(input, { ...init, dispatcher }),
|
|
81128
|
-
close: () => dispatcher
|
|
81129
|
-
})
|
|
81221
|
+
close: () => closeDispatcher(dispatcher)
|
|
81130
81222
|
};
|
|
81131
81223
|
}
|
|
81132
81224
|
var usdc = (atomic4) => {
|