shinjuku-shield 0.3.211 → 0.3.212
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 +4 -4
- package/manifest.json +6 -6
- package/package.json +3 -3
- package/shinjuku-seller.mjs +1 -0
- package/shinjuku-wallet.mjs +99 -63
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.
|
|
8
|
+
This is version 0.3.212. The command is `shinjuku`.
|
|
9
9
|
|
|
10
10
|
## Set up
|
|
11
11
|
|
|
12
12
|
```sh
|
|
13
|
-
npx -y shinjuku@0.3.
|
|
13
|
+
npx -y shinjuku@0.3.212 setup
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
Setup does every step for you:
|
|
@@ -100,7 +100,7 @@ Add it yourself. The name of the wallet in your app is `shinjuku`.
|
|
|
100
100
|
Claude Code:
|
|
101
101
|
|
|
102
102
|
```sh
|
|
103
|
-
claude mcp add --scope user shinjuku -- npx -y --no-audit --no-fund shinjuku-shield@0.3.
|
|
103
|
+
claude mcp add --scope user shinjuku -- npx -y --no-audit --no-fund shinjuku-shield@0.3.212 mcp
|
|
104
104
|
```
|
|
105
105
|
|
|
106
106
|
## For builders: check what you install
|
|
@@ -116,7 +116,7 @@ with the Releases table in
|
|
|
116
116
|
Versions are published from GitHub Actions with npm provenance.
|
|
117
117
|
|
|
118
118
|
`shinjuku-shield` is the package that holds the wallet. `shinjuku-shielded`
|
|
119
|
-
0.3.
|
|
119
|
+
0.3.212, its older name, runs this package at the same version, so wallets
|
|
120
120
|
installed under that name keep updating. New installs use `shinjuku`.
|
|
121
121
|
|
|
122
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": "
|
|
5
|
-
"bytes":
|
|
6
|
-
"sourceCommit": "
|
|
4
|
+
"sha256": "2dd06d0d1f1482e159084ac58482cb1a9f1a7d605d73cc74b291678481650edd",
|
|
5
|
+
"bytes": 9664309,
|
|
6
|
+
"sourceCommit": "16f55e7cd4a6424ec469d297048d0613e81a8afe",
|
|
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",
|
|
@@ -1040,8 +1040,8 @@
|
|
|
1040
1040
|
],
|
|
1041
1041
|
"seller": {
|
|
1042
1042
|
"file": "shinjuku-seller.mjs",
|
|
1043
|
-
"sha256": "
|
|
1044
|
-
"bytes":
|
|
1043
|
+
"sha256": "dacd62ea0f70f185497a7d6d4d9a65bca500a30152b1d4567fe46a351da4d0a2",
|
|
1044
|
+
"bytes": 4100977,
|
|
1045
1045
|
"entry": "wallet/src/seller/exact/index.mjs",
|
|
1046
1046
|
"external": [
|
|
1047
1047
|
"@x402/core/http",
|
|
@@ -1933,5 +1933,5 @@
|
|
|
1933
1933
|
}
|
|
1934
1934
|
]
|
|
1935
1935
|
},
|
|
1936
|
-
"publishedAt": "2026-11-
|
|
1936
|
+
"publishedAt": "2026-11-11T10:24:03.084Z"
|
|
1937
1937
|
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shinjuku-shield",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.212",
|
|
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": "2dd06d0d",
|
|
7
|
+
"shinjukuSha256": "2dd06d0d1f1482e159084ac58482cb1a9f1a7d605d73cc74b291678481650edd",
|
|
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
|
@@ -44842,6 +44842,7 @@ var init_errorCodes = __esm({
|
|
|
44842
44842
|
"wallet_status",
|
|
44843
44843
|
// 2026-10-08 zero config review: the pinned proof-tool set, download limits, a private passphrase file, host-config conflicts, Tor.
|
|
44844
44844
|
"setup_proof_tools_pin_mismatch",
|
|
44845
|
+
"setup_proof_tools_not_v2",
|
|
44845
44846
|
"setup_proof_tools_unpinned",
|
|
44846
44847
|
"setup_proof_tools_trust_invalid",
|
|
44847
44848
|
"setup_download_too_large",
|
package/shinjuku-wallet.mjs
CHANGED
|
@@ -79037,6 +79037,7 @@ var init_errorCodes = __esm({
|
|
|
79037
79037
|
"wallet_status",
|
|
79038
79038
|
// 2026-10-08 zero config review: the pinned proof-tool set, download limits, a private passphrase file, host-config conflicts, Tor.
|
|
79039
79039
|
"setup_proof_tools_pin_mismatch",
|
|
79040
|
+
"setup_proof_tools_not_v2",
|
|
79040
79041
|
"setup_proof_tools_unpinned",
|
|
79041
79042
|
"setup_proof_tools_trust_invalid",
|
|
79042
79043
|
"setup_download_too_large",
|
|
@@ -109688,6 +109689,26 @@ function assertV2PinnedSet(set, facilitator, platform = proofToolsPlatform()) {
|
|
|
109688
109689
|
}
|
|
109689
109690
|
return pin;
|
|
109690
109691
|
}
|
|
109692
|
+
function trustV2Set({ facilitator, release, channel, platform = proofToolsPlatform() }) {
|
|
109693
|
+
const served = release.proofTools;
|
|
109694
|
+
const pin = v2BuildPin(facilitator, platform);
|
|
109695
|
+
if (pin && served?.sumsSha256 === pin.sumsSha256) return Object.freeze({ ...pin, v2: true });
|
|
109696
|
+
if (served && channel && channelListsSet(channel, { facilitator, pool: release.pool, dir: served.dir, sumsSha256: served.sumsSha256 })) {
|
|
109697
|
+
return Object.freeze({ dir: served.dir, sumsSha256: served.sumsSha256, trusted: false, channelSeq: channel.seq, v2: true });
|
|
109698
|
+
}
|
|
109699
|
+
return Object.freeze({ ...assertV2PinnedSet(served, facilitator, platform), v2: true });
|
|
109700
|
+
}
|
|
109701
|
+
function assertV2SetContents(folder) {
|
|
109702
|
+
let manifest;
|
|
109703
|
+
try {
|
|
109704
|
+
manifest = readFileSync(join26(folder, "bundle", "manifest.json"));
|
|
109705
|
+
} catch {
|
|
109706
|
+
manifest = void 0;
|
|
109707
|
+
}
|
|
109708
|
+
if (namesHiddenProver(folder) !== true || !manifest || sha2567(manifest) !== V2_BUNDLE_MANIFEST_SHA256) {
|
|
109709
|
+
throw fail24("setup_proof_tools_not_v2", `the set of setup files ${basename9(folder).replace(/\.partial$/, "")} that Shinjuku names as the new set failed its check, so this wallet cannot use it; ${UPDATE_NEXT}`);
|
|
109710
|
+
}
|
|
109711
|
+
}
|
|
109691
109712
|
function namesHiddenProver(folder) {
|
|
109692
109713
|
try {
|
|
109693
109714
|
const raw = JSON.parse(readFileSync(join26(folder, "proof-tools.json"), "utf8"));
|
|
@@ -110535,6 +110556,7 @@ async function installProofToolsLeased({
|
|
|
110535
110556
|
const folder = join26(toolsRoot, dir);
|
|
110536
110557
|
if (existsSync(folder) && verifyToolsFolder(folder, sumsSha256)) {
|
|
110537
110558
|
mark("present");
|
|
110559
|
+
if (expected.v2) assertV2SetContents(folder);
|
|
110538
110560
|
if (checkPrograms) {
|
|
110539
110561
|
const listed = parseSums(readFileSync(join26(folder, "SHA256SUMS"), "utf8"));
|
|
110540
110562
|
await checkPrograms(listed.filter((entry) => executable(entry.path)).map((entry) => localPath(folder, entry.path)));
|
|
@@ -110777,6 +110799,7 @@ async function installProofToolsLeased({
|
|
|
110777
110799
|
writeOnDisk(toolsRoot, () => writeFileSync(join26(partial, "SHA256SUMS"), sums, { flag: "wx", mode: 384 }));
|
|
110778
110800
|
mark("hash-check-start");
|
|
110779
110801
|
if (!verifyToolsFolder(partial, sumsSha256)) throw fail24("setup_file_hash_mismatch", "the downloaded setup files folder did not check out on disk; rerun setup");
|
|
110802
|
+
if (expected.v2) assertV2SetContents(partial);
|
|
110780
110803
|
mark("hash-check-end");
|
|
110781
110804
|
held2();
|
|
110782
110805
|
if (existsSync(folder)) await folderMoveRetried(() => rmSync(folder, { recursive: true, force: true }));
|
|
@@ -110799,7 +110822,7 @@ async function trustServedSet({ home, facilitator, release, expected, fetchImpl
|
|
|
110799
110822
|
if (!/^wallet_channel_(unavailable|invalid):/.test(String(error?.message)) && !(pinned && /^wallet_channel_key_unset:/.test(String(error?.message)))) throw error;
|
|
110800
110823
|
body = void 0;
|
|
110801
110824
|
}
|
|
110802
|
-
if (v2) return
|
|
110825
|
+
if (v2) return trustV2Set({ facilitator, release, channel: body, platform });
|
|
110803
110826
|
if (expected?.trusted) {
|
|
110804
110827
|
assertServedSet(release, expected);
|
|
110805
110828
|
return expected;
|
|
@@ -110843,17 +110866,18 @@ async function refreshTrustedProofToolsOnce({ home, facilitator, pool: pool2, fe
|
|
|
110843
110866
|
if (pool2 !== void 0 && release.pool !== void 0 && release.pool !== pool2) {
|
|
110844
110867
|
return Object.freeze({ changed: false, dir: current?.dir, sumsSha256: current?.sumsSha256, reason: "release_names_another_pool" });
|
|
110845
110868
|
}
|
|
110846
|
-
if (release.proofToolsV2 !== void 0) assertV2PinnedSet(release.proofTools, origin, platform);
|
|
110847
|
-
if (current && current.sumsSha256 === release.proofTools.sumsSha256) {
|
|
110848
|
-
return Object.freeze({ changed: false, dir: current.dir, sumsSha256: current.sumsSha256 });
|
|
110849
|
-
}
|
|
110850
110869
|
let expected;
|
|
110851
110870
|
try {
|
|
110852
110871
|
expected = expectedProofTools(origin, void 0, void 0, platform);
|
|
110853
110872
|
} catch {
|
|
110854
110873
|
expected = void 0;
|
|
110855
110874
|
}
|
|
110856
|
-
const
|
|
110875
|
+
const v2Trusted = release.proofToolsV2 !== void 0 ? await trustServedSet({ home, facilitator: origin, release, expected, fetchImpl, ...keyOption, platform }) : void 0;
|
|
110876
|
+
if (current && current.sumsSha256 === release.proofTools.sumsSha256) {
|
|
110877
|
+
if (v2Trusted?.v2 && config.proofTools) assertV2SetContents(dirname22(config.proofTools));
|
|
110878
|
+
return Object.freeze({ changed: false, dir: current.dir, sumsSha256: current.sumsSha256 });
|
|
110879
|
+
}
|
|
110880
|
+
const trusted = v2Trusted ?? await trustServedSet({ home, facilitator: origin, release, expected, fetchImpl, ...keyOption, platform });
|
|
110857
110881
|
const tools = await installProofTools({
|
|
110858
110882
|
facilitator: origin,
|
|
110859
110883
|
toolsRoot: join26(home, "proof-tools"),
|
|
@@ -110896,7 +110920,7 @@ async function refreshChannelAfterProgramUpgrade({ home, facilitator, fetchImpl
|
|
|
110896
110920
|
}
|
|
110897
110921
|
return moved;
|
|
110898
110922
|
}
|
|
110899
|
-
var PINNED_PROOF_TOOLS, PINNED_PROOF_TOOLS_V2, paramsCheckEntry, setParamsCheckEntry, PARAMS_CHECK_LIMIT_MS, PARAMS_CHECK_SAY_EVERY_MS, PARAMS_CHECK_KILL_WAIT_MS, PARAMS_CHECK_ENV_KEYS, BUILT_IN_ONION_ORIGINS, PROOF_TOOLS_PLATFORMS, DEFAULT_PROOF_TOOLS_PLATFORM, UPDATE_NEXT, HEX644, DIR2, SUMS_LINE, MAX_FILES, LIMITS, RELEASE_TIMEOUT_MS, DOWNLOAD_LANES, RANGE_BYTES, RANGE_TIMEOUT_MS, RANGE_STALL_MS, RANGE_FLOOR_BYTES, SPEED_WINDOWS, rangeFloor, RANGE_ATTEMPTS, HEDGE_AFTER_MS, CONTENT_RANGE, PROGRESS_EVERY_MS, releasedBytes, megabytes, REQUIRED_FILES, sha2567, fail24, SMALL_HEDGE_MS, SMALL_LANES, LOST, SETUP_RELEASE_PATIENCE_MS, passing, localPath, executable, LAUNCH_CHECK_ARG, LAUNCH_CHECK_TIMEOUT_MS, LAUNCH_CHECK_EXITS, startRefused, toolPaths, SPACE_MARGIN_BYTES, DISK_FULL, diskFull, FOLDER_MOVE_BUSY, FOLDER_MOVE_RETRY_MS, RESUME_DIR, resumeName, trustedRefreshes;
|
|
110923
|
+
var PINNED_PROOF_TOOLS, PINNED_PROOF_TOOLS_V2, paramsCheckEntry, setParamsCheckEntry, PARAMS_CHECK_LIMIT_MS, PARAMS_CHECK_SAY_EVERY_MS, PARAMS_CHECK_KILL_WAIT_MS, PARAMS_CHECK_ENV_KEYS, V2_BUNDLE_MANIFEST_SHA256, BUILT_IN_ONION_ORIGINS, PROOF_TOOLS_PLATFORMS, DEFAULT_PROOF_TOOLS_PLATFORM, UPDATE_NEXT, HEX644, DIR2, SUMS_LINE, MAX_FILES, LIMITS, RELEASE_TIMEOUT_MS, DOWNLOAD_LANES, RANGE_BYTES, RANGE_TIMEOUT_MS, RANGE_STALL_MS, RANGE_FLOOR_BYTES, SPEED_WINDOWS, rangeFloor, RANGE_ATTEMPTS, HEDGE_AFTER_MS, CONTENT_RANGE, PROGRESS_EVERY_MS, releasedBytes, megabytes, REQUIRED_FILES, sha2567, fail24, SMALL_HEDGE_MS, SMALL_LANES, LOST, SETUP_RELEASE_PATIENCE_MS, passing, localPath, executable, LAUNCH_CHECK_ARG, LAUNCH_CHECK_TIMEOUT_MS, LAUNCH_CHECK_EXITS, startRefused, toolPaths, SPACE_MARGIN_BYTES, DISK_FULL, diskFull, FOLDER_MOVE_BUSY, FOLDER_MOVE_RETRY_MS, RESUME_DIR, resumeName, trustedRefreshes;
|
|
110900
110924
|
var init_proofTools = __esm({
|
|
110901
110925
|
"wallet/src/setup/proofTools.mjs"() {
|
|
110902
110926
|
"use strict";
|
|
@@ -110993,6 +111017,7 @@ var init_proofTools = __esm({
|
|
|
110993
111017
|
"XDG_CACHE_HOME",
|
|
110994
111018
|
"LANG"
|
|
110995
111019
|
];
|
|
111020
|
+
V2_BUNDLE_MANIFEST_SHA256 = "52092ea6985dd5b2a87671ee25055d01d19995029e412ab6ab44e2ccc1ef6cf8";
|
|
110996
111021
|
BUILT_IN_ONION_ORIGINS = /* @__PURE__ */ new Set([...FACILITATOR_SITE_ONIONS, ...FACILITATOR_SPARE_ONIONS]);
|
|
110997
111022
|
PROOF_TOOLS_PLATFORMS = Object.freeze(["linux-x64", "win32-x64", "linux-arm64", "darwin-arm64", "darwin-x64"]);
|
|
110998
111023
|
DEFAULT_PROOF_TOOLS_PLATFORM = "linux-x64";
|
|
@@ -126139,7 +126164,7 @@ var init_scan = __esm({
|
|
|
126139
126164
|
});
|
|
126140
126165
|
|
|
126141
126166
|
// wallet/src/move/migration.mjs
|
|
126142
|
-
import { join as join36 } from "node:path";
|
|
126167
|
+
import { dirname as dirname29, join as join36 } from "node:path";
|
|
126143
126168
|
function poolOrigin(value2, pool2, facilitator) {
|
|
126144
126169
|
let url;
|
|
126145
126170
|
try {
|
|
@@ -126226,20 +126251,31 @@ async function poolProofTools({ home, config, entry, release, facilitator, trust
|
|
|
126226
126251
|
const set = entry.proofTools;
|
|
126227
126252
|
if (!set) return void 0;
|
|
126228
126253
|
const v2 = release?.proofToolsV2 !== void 0;
|
|
126229
|
-
|
|
126254
|
+
const keyOption = publicKeyHex === void 0 ? {} : { publicKeyHex };
|
|
126255
|
+
const v2Trusted = v2 ? await (deps.trustServedSet ?? trustServedSet)({
|
|
126256
|
+
home,
|
|
126257
|
+
facilitator,
|
|
126258
|
+
release: { ...release, pool: entry.pool, proofTools: set },
|
|
126259
|
+
expected: void 0,
|
|
126260
|
+
fetchImpl,
|
|
126261
|
+
...keyOption,
|
|
126262
|
+
platform
|
|
126263
|
+
}) : void 0;
|
|
126230
126264
|
const recorded = poolToolPaths(config, entry.pool);
|
|
126231
|
-
if (recorded?.proofToolsRelease?.sumsSha256 === set.sumsSha256 && recorded.proofTools)
|
|
126232
|
-
|
|
126265
|
+
if (recorded?.proofToolsRelease?.sumsSha256 === set.sumsSha256 && recorded.proofTools) {
|
|
126266
|
+
if (v2Trusted?.v2) assertV2SetContents(dirname29(recorded.proofTools));
|
|
126267
|
+
return void 0;
|
|
126268
|
+
}
|
|
126269
|
+
let trusted = v2Trusted;
|
|
126233
126270
|
if (!v2 && trust.includes(set.sumsSha256)) {
|
|
126234
126271
|
trusted = Object.freeze({ dir: set.dir, sumsSha256: set.sumsSha256, trusted: true });
|
|
126235
|
-
} else {
|
|
126272
|
+
} else if (!v2) {
|
|
126236
126273
|
let pin;
|
|
126237
126274
|
try {
|
|
126238
126275
|
pin = expectedProofTools(facilitator, void 0, void 0, platform);
|
|
126239
126276
|
} catch {
|
|
126240
126277
|
pin = void 0;
|
|
126241
126278
|
}
|
|
126242
|
-
const keyOption = publicKeyHex === void 0 ? {} : { publicKeyHex };
|
|
126243
126279
|
try {
|
|
126244
126280
|
trusted = await (deps.trustServedSet ?? trustServedSet)({
|
|
126245
126281
|
home,
|
|
@@ -126251,7 +126287,7 @@ async function poolProofTools({ home, config, entry, release, facilitator, trust
|
|
|
126251
126287
|
platform
|
|
126252
126288
|
});
|
|
126253
126289
|
} catch (error) {
|
|
126254
|
-
if (
|
|
126290
|
+
if (!UNTRUSTED.test(String(error?.message))) throw error;
|
|
126255
126291
|
throw fail39("wallet_move_proof_tools_untrusted", `Shinjuku names the set of setup files ${set.dir} (SHA256SUMS ${set.sumsSha256}) for pool ${entry.pool}, and neither this wallet build's pin nor the signed release channel vouches for it; nothing was downloaded or moved. Update the wallet (npx -y --no-audit --no-fund ${NPX_PACKAGE}@latest), or (advanced) after you checked that set out of band run ${commandLine(`move --trust-proof-tools ${set.sumsSha256}`)} (repeat the flag once per set)`);
|
|
126256
126292
|
}
|
|
126257
126293
|
}
|
|
@@ -127749,7 +127785,7 @@ var init_job = __esm({
|
|
|
127749
127785
|
});
|
|
127750
127786
|
|
|
127751
127787
|
// wallet/src/move/mcpMove.mjs
|
|
127752
|
-
import { dirname as
|
|
127788
|
+
import { dirname as dirname30, resolve as resolve23 } from "node:path";
|
|
127753
127789
|
function createMoveScheduler({ session, underLease, log = () => {
|
|
127754
127790
|
}, env = process.env, onSettled = () => {
|
|
127755
127791
|
}, deps = {} }) {
|
|
@@ -127763,7 +127799,7 @@ function createMoveScheduler({ session, underLease, log = () => {
|
|
|
127763
127799
|
config = null;
|
|
127764
127800
|
}
|
|
127765
127801
|
const sessionPath = resolve23(session.walletPath);
|
|
127766
|
-
const enabled = Boolean(config) && resolve23(
|
|
127802
|
+
const enabled = Boolean(config) && resolve23(dirname30(dirname30(sessionPath))) === resolve23(home) && knownPools(config).some((pool2) => resolve23(homeWalletPath(home, pool2)) === sessionPath);
|
|
127767
127803
|
const passphrase2 = () => (deps.readPassphrase ?? (() => readSecretText(config.passphraseFile, "the passphrase file")))();
|
|
127768
127804
|
const storeOf = (pool2) => {
|
|
127769
127805
|
if (resolve23(homeWalletPath(home, pool2)) === sessionPath) return session.openStore();
|
|
@@ -130104,7 +130140,7 @@ var init_leg = __esm({
|
|
|
130104
130140
|
|
|
130105
130141
|
// wallet/src/succession/scheduler.mjs
|
|
130106
130142
|
import { randomInt as cryptoRandomInt } from "node:crypto";
|
|
130107
|
-
import { dirname as
|
|
130143
|
+
import { dirname as dirname31, resolve as resolve24 } from "node:path";
|
|
130108
130144
|
import { fileURLToPath as fileURLToPath16 } from "node:url";
|
|
130109
130145
|
function pocketCarryReason(carry) {
|
|
130110
130146
|
if (carry && CARRY_DONE.has(carry.state)) return { done: true, waits: false, code: null, reason: "" };
|
|
@@ -130770,7 +130806,7 @@ function startSuccessionScheduler({ store, openStore, session, underLease, log =
|
|
|
130770
130806
|
config = void 0;
|
|
130771
130807
|
}
|
|
130772
130808
|
const sessionPath = session?.walletPath ? resolve24(session.walletPath) : void 0;
|
|
130773
|
-
const enabled = Boolean(config && sessionPath) && resolve24(
|
|
130809
|
+
const enabled = Boolean(config && sessionPath) && resolve24(dirname31(dirname31(sessionPath))) === resolve24(home);
|
|
130774
130810
|
if (!enabled) {
|
|
130775
130811
|
return Object.freeze({
|
|
130776
130812
|
enabled: false,
|
|
@@ -130990,7 +131026,7 @@ var init_scheduler = __esm({
|
|
|
130990
131026
|
});
|
|
130991
131027
|
|
|
130992
131028
|
// wallet/src/deposit/adoptOneTime.mjs
|
|
130993
|
-
import { dirname as
|
|
131029
|
+
import { dirname as dirname32, resolve as resolve25 } from "node:path";
|
|
130994
131030
|
function openEarlierWallets({ home, store, passphrase: passphrase2, pools, open: open5 = openWalletStore }) {
|
|
130995
131031
|
const root = familyRoot(store.state.pool);
|
|
130996
131032
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -131124,7 +131160,7 @@ function createOneTimeAdopter({ session, log = () => {
|
|
|
131124
131160
|
config = null;
|
|
131125
131161
|
}
|
|
131126
131162
|
const sessionPath = resolve25(session.walletPath);
|
|
131127
|
-
const enabled = Boolean(config) && resolve25(
|
|
131163
|
+
const enabled = Boolean(config) && resolve25(dirname32(dirname32(sessionPath))) === resolve25(home) && knownPools(config).some((pool2) => resolve25(homeWalletPath(home, pool2)) === sessionPath);
|
|
131128
131164
|
let running;
|
|
131129
131165
|
let active = false;
|
|
131130
131166
|
let last = [];
|
|
@@ -131344,7 +131380,7 @@ var init_requestIds = __esm({
|
|
|
131344
131380
|
// wallet/src/mcp/stopLog.mjs
|
|
131345
131381
|
import { createHash as createHash34 } from "node:crypto";
|
|
131346
131382
|
import { lstat, open as open4, rename as rename3, stat as stat2, unlink as unlink3 } from "node:fs/promises";
|
|
131347
|
-
import { dirname as
|
|
131383
|
+
import { dirname as dirname33, join as join38 } from "node:path";
|
|
131348
131384
|
function logId(value2) {
|
|
131349
131385
|
if (typeof value2 === "number" && Number.isSafeInteger(value2)) return String(value2);
|
|
131350
131386
|
const text3 = String(value2);
|
|
@@ -131430,7 +131466,7 @@ var init_stopLog = __esm({
|
|
|
131430
131466
|
"wallet/src/mcp/stopLog.mjs"() {
|
|
131431
131467
|
"use strict";
|
|
131432
131468
|
init_fs();
|
|
131433
|
-
hostCancelLogPath = (walletPath2) => join38(
|
|
131469
|
+
hostCancelLogPath = (walletPath2) => join38(dirname33(walletPath2), "host-cancel.log");
|
|
131434
131470
|
HOST_CANCEL_LOG_MAX_BYTES = 1024 * 1024;
|
|
131435
131471
|
LOCK_STALE_MS = 1e4;
|
|
131436
131472
|
OWN_ID = /^auto-[0-9a-f]{12}$/;
|
|
@@ -136512,7 +136548,7 @@ var init_addFunds = __esm({
|
|
|
136512
136548
|
import { execFileSync as execFileSync3, spawnSync as spawnSync6 } from "node:child_process";
|
|
136513
136549
|
import { createHash as createHash35, randomBytes as randomBytes33, randomInt as randomInt6 } from "node:crypto";
|
|
136514
136550
|
import { homedir as homedir5, userInfo } from "node:os";
|
|
136515
|
-
import { basename as basename10, dirname as
|
|
136551
|
+
import { basename as basename10, dirname as dirname34, extname, isAbsolute as isAbsolute9, join as join39, posix, resolve as resolve26 } from "node:path";
|
|
136516
136552
|
function backupFiles(home) {
|
|
136517
136553
|
let config;
|
|
136518
136554
|
try {
|
|
@@ -136830,7 +136866,7 @@ function makeMissingFolder(place, net4, refuse12, noFolder, trail) {
|
|
|
136830
136866
|
const names = [];
|
|
136831
136867
|
let parent = place;
|
|
136832
136868
|
while (!existsSync(parent)) {
|
|
136833
|
-
const up =
|
|
136869
|
+
const up = dirname34(parent);
|
|
136834
136870
|
if (up === parent) throw noFolder(place);
|
|
136835
136871
|
names.unshift(basename10(parent));
|
|
136836
136872
|
parent = up;
|
|
@@ -138820,7 +138856,7 @@ var init_oldTransfer = __esm({
|
|
|
138820
138856
|
import { createHash as createHash36, randomBytes as randomBytes35 } from "node:crypto";
|
|
138821
138857
|
import { link as link2, mkdir as mkdir3, readFile as readFileAsync, rename as renameAsync, stat as statAsync, unlink as unlink4, writeFile as writeFileAsync } from "node:fs/promises";
|
|
138822
138858
|
import { hostname as hostname2 } from "node:os";
|
|
138823
|
-
import { basename as basename11, dirname as
|
|
138859
|
+
import { basename as basename11, dirname as dirname35, join as join40, resolve as resolve28 } from "node:path";
|
|
138824
138860
|
import { homedir as homedir6 } from "node:os";
|
|
138825
138861
|
import { fileURLToPath as fileURLToPath17 } from "node:url";
|
|
138826
138862
|
async function readReleasePoolsTwice(args) {
|
|
@@ -139509,7 +139545,7 @@ function walletHomeMarks(walletPath2) {
|
|
|
139509
139545
|
try {
|
|
139510
139546
|
const readAtMs = Date.now();
|
|
139511
139547
|
const file = statSync(walletPath2, { bigint: true });
|
|
139512
|
-
const wal = statSync(join40(
|
|
139548
|
+
const wal = statSync(join40(dirname35(walletPath2), "wal"), { bigint: true });
|
|
139513
139549
|
const marks = (stats) => `${stats.ino}:${stats.size}:${stats.mtimeNs}:${stats.ctimeNs}`;
|
|
139514
139550
|
const newestNs = [file.mtimeNs, file.ctimeNs, wal.mtimeNs, wal.ctimeNs].reduce((a, b) => a > b ? a : b);
|
|
139515
139551
|
return { marks: `${marks(file)}|${marks(wal)}`, newestMs: Number(newestNs / 1000000n), readAtMs };
|
|
@@ -139518,7 +139554,7 @@ function walletHomeMarks(walletPath2) {
|
|
|
139518
139554
|
}
|
|
139519
139555
|
}
|
|
139520
139556
|
function writeAutoBackup({ walletPath: walletPath2, pool: pool2, exportBundle, now = /* @__PURE__ */ new Date() }) {
|
|
139521
|
-
const folder = join40(
|
|
139557
|
+
const folder = join40(dirname35(dirname35(walletPath2)), "auto-backups", pool2);
|
|
139522
139558
|
mkdirSync(folder, { recursive: true, mode: 448 });
|
|
139523
139559
|
const stamp = now.toISOString().replace(/[:.]/g, "-");
|
|
139524
139560
|
let target = join40(folder, stamp);
|
|
@@ -140356,11 +140392,11 @@ function createWalletTools({
|
|
|
140356
140392
|
}) {
|
|
140357
140393
|
runningNpmVersion = npmVersion;
|
|
140358
140394
|
runningLimits = policy?.limits;
|
|
140359
|
-
const walletFolder = typeof session.walletPath === "string" ?
|
|
140395
|
+
const walletFolder = typeof session.walletPath === "string" ? dirname35(session.walletPath) : void 0;
|
|
140360
140396
|
const outDir = () => ({
|
|
140361
140397
|
dir: userFilesDir(),
|
|
140362
140398
|
base: userDownloadsDir(),
|
|
140363
|
-
forbid: walletFolder ? [walletFolder, ...
|
|
140399
|
+
forbid: walletFolder ? [walletFolder, ...dirname35(walletFolder) !== homedir6() ? [dirname35(walletFolder)] : []] : []
|
|
140364
140400
|
});
|
|
140365
140401
|
const intents = createIntents({ session });
|
|
140366
140402
|
const paysRunning = /* @__PURE__ */ new Map();
|
|
@@ -140368,7 +140404,7 @@ function createWalletTools({
|
|
|
140368
140404
|
const CLAIM_LOCK_WAIT_MS = 500;
|
|
140369
140405
|
const CLAIM_LOCK_STEP_MS = 20;
|
|
140370
140406
|
const CLAIM_LOCK_UNREADABLE_MS = 2e3;
|
|
140371
|
-
const payRunningDir = typeof session.walletPath === "string" ? join40(
|
|
140407
|
+
const payRunningDir = typeof session.walletPath === "string" ? join40(dirname35(session.walletPath), "pay-running") : void 0;
|
|
140372
140408
|
warmWalletProcessLease();
|
|
140373
140409
|
const ownHost = hostname2();
|
|
140374
140410
|
async function ownerState(other) {
|
|
@@ -140606,7 +140642,7 @@ ${key}`).digest("hex").slice(0, 40)}.json`);
|
|
|
140606
140642
|
const capOf2 = (value2) => POSITIVE_ATOMIC6.test(String(value2 ?? "")) ? BigInt(value2) : void 0;
|
|
140607
140643
|
const moved = { shield: 0n, unshield: 0n };
|
|
140608
140644
|
const DAY_MS3 = 24 * 60 * 60 * 1e3;
|
|
140609
|
-
const countsDir = typeof session.walletPath === "string" ? join40(
|
|
140645
|
+
const countsDir = typeof session.walletPath === "string" ? join40(dirname35(session.walletPath), "move-counts") : void 0;
|
|
140610
140646
|
const countsFile = countsDir ? join40(countsDir, `${process.pid}-${Date.now()}-${Math.random().toString(36).slice(2, 8)}.json`) : void 0;
|
|
140611
140647
|
const countsLock = countsDir ? `${countsDir}.lock` : void 0;
|
|
140612
140648
|
const countedAt = /* @__PURE__ */ new Map();
|
|
@@ -149540,7 +149576,7 @@ ${canonical5}`;
|
|
|
149540
149576
|
}
|
|
149541
149577
|
const transferResumeTimer = resumeSends ? setTimeout(() => resumeUnlessRunner("transfer", resumeTransfers), 0) : void 0;
|
|
149542
149578
|
transferResumeTimer?.unref?.();
|
|
149543
|
-
const discover = discoverTool(join40(
|
|
149579
|
+
const discover = discoverTool(join40(dirname35(session.walletPath), "discover-cache"), untilNoPayment, payingSignal);
|
|
149544
149580
|
const inferenceModule = async () => ops.inference ?? inference_exports;
|
|
149545
149581
|
const proxied = () => typeof ops.proxied === "function" ? ops.proxied() : inTorRun();
|
|
149546
149582
|
const usd = (atomic5) => `$${formatAtomic(atomic5, 6)}`;
|
|
@@ -150140,7 +150176,7 @@ ${canonical5}`;
|
|
|
150140
150176
|
home: () => {
|
|
150141
150177
|
try {
|
|
150142
150178
|
if (typeof session.walletPath !== "string") return void 0;
|
|
150143
|
-
const home =
|
|
150179
|
+
const home = dirname35(dirname35(resolve28(session.walletPath)));
|
|
150144
150180
|
const config = readSetupConfig(home);
|
|
150145
150181
|
return config?.pool && resolve28(homeWalletPath(home, config.pool)) === resolve28(session.walletPath) ? home : void 0;
|
|
150146
150182
|
} catch {
|
|
@@ -150420,7 +150456,7 @@ ${JSON.stringify(args ?? {})}`;
|
|
|
150420
150456
|
const stoppedSendTimer = resumeSends && !inSendRunner() ? setTimeout(finishStoppedSends, 0) : void 0;
|
|
150421
150457
|
stoppedSendTimer?.unref?.();
|
|
150422
150458
|
const tempCleanTimer = typeof session.walletPath === "string" ? setTimeout(() => {
|
|
150423
|
-
const pool2 =
|
|
150459
|
+
const pool2 = dirname35(session.walletPath);
|
|
150424
150460
|
removeStaleTemporaryFiles([pool2, join40(pool2, "wal"), join40(pool2, "move-counts")]).then((removed) => {
|
|
150425
150461
|
if (removed > 0) log(`MCP_TEMP_FILES_REMOVED ${removed}`);
|
|
150426
150462
|
}, () => {
|
|
@@ -151840,7 +151876,7 @@ var init_prompts = __esm({
|
|
|
151840
151876
|
// wallet/src/mcp/startMarks.mjs
|
|
151841
151877
|
import { randomBytes as randomBytes36 } from "node:crypto";
|
|
151842
151878
|
import { mkdir as mkdir4, readdir as readdir2, rename as rename4, rm, stat as stat3, writeFile as writeFile2 } from "node:fs/promises";
|
|
151843
|
-
import { dirname as
|
|
151879
|
+
import { dirname as dirname36, join as join41 } from "node:path";
|
|
151844
151880
|
function createStartMarks(walletPath2, { network, sinceStartMs = () => process.uptime() * 1e3 } = {}) {
|
|
151845
151881
|
const start = randomBytes36(4).toString("hex");
|
|
151846
151882
|
const steps = [];
|
|
@@ -151912,7 +151948,7 @@ var init_startMarks = __esm({
|
|
|
151912
151948
|
MARK_FILE = /^[0-9a-f]{8}\.json$/;
|
|
151913
151949
|
STEPS = Object.freeze(["server_started", "wallet_opened", "initialize_dispatched"]);
|
|
151914
151950
|
OUTCOMES = /* @__PURE__ */ new Set(["dispatched", "open_failed", "ended_undispatched"]);
|
|
151915
|
-
startMarksFolder = (walletPath2) => join41(
|
|
151951
|
+
startMarksFolder = (walletPath2) => join41(dirname36(walletPath2), START_MARKS_FOLDER);
|
|
151916
151952
|
}
|
|
151917
151953
|
});
|
|
151918
151954
|
|
|
@@ -151959,7 +151995,7 @@ __export(stdioServer_exports, {
|
|
|
151959
151995
|
withLaunchNotice: () => withLaunchNotice
|
|
151960
151996
|
});
|
|
151961
151997
|
import { createHash as createHash37 } from "node:crypto";
|
|
151962
|
-
import { dirname as
|
|
151998
|
+
import { dirname as dirname37, join as join42, resolve as resolve29, sep as sep5 } from "node:path";
|
|
151963
151999
|
import { fileURLToPath as fileURLToPath18 } from "node:url";
|
|
151964
152000
|
function createClientBridge() {
|
|
151965
152001
|
const bridge = {
|
|
@@ -152282,7 +152318,7 @@ function runningBundleFile({ moduleUrl = new URL("__bundled_source__/wallet/src/
|
|
|
152282
152318
|
} catch {
|
|
152283
152319
|
file = void 0;
|
|
152284
152320
|
}
|
|
152285
|
-
if (file &&
|
|
152321
|
+
if (file && dirname37(file) === dir) return file;
|
|
152286
152322
|
const named = join42(dir, "shinjuku-wallet.mjs");
|
|
152287
152323
|
return existsSync(named) ? named : void 0;
|
|
152288
152324
|
} catch {
|
|
@@ -152314,7 +152350,7 @@ function readWalletVersion({
|
|
|
152314
152350
|
}
|
|
152315
152351
|
const json5 = (name) => {
|
|
152316
152352
|
try {
|
|
152317
|
-
return JSON.parse(readText(join42(
|
|
152353
|
+
return JSON.parse(readText(join42(dirname37(bundleFile), name)));
|
|
152318
152354
|
} catch {
|
|
152319
152355
|
return void 0;
|
|
152320
152356
|
}
|
|
@@ -152857,7 +152893,7 @@ async function openWalletServer({
|
|
|
152857
152893
|
log(`MCP_READY pool=${session.pool} maxPayment=${limits.maxPaymentAtomic} maxSession=${limits.maxSessionAtomic}${limits.maxPerHostDayAtomic ? ` maxPerHostDay=${limits.maxPerHostDayAtomic}` : ""}${limits.allowHosts ? ` allowHosts=${limits.allowHosts.join(",")}` : ""} shield=${money.allowShield ? money.maxShieldAtomic ?? "on" : "off"} shieldFromElsewhere=${money.allowShield && session.memoServiceUrl ? "on" : "off"} unshield=${money.allowUnshield ? money.maxUnshieldAtomic ?? "on" : "off"}${money.unshieldTo.length ? ` unshieldTo=${money.unshieldTo.length}` : ""} autoFill=off reshield=${money.autoPockets && money.exitProofTools && money.proofToolsPath ? "on" : "off"} exactSellers=float`);
|
|
152858
152894
|
const warmDiscover = discoverWarmup ? () => {
|
|
152859
152895
|
loadX402Listings({
|
|
152860
|
-
cacheDir: join42(
|
|
152896
|
+
cacheDir: join42(dirname37(session.walletPath), "discover-cache"),
|
|
152861
152897
|
warm: true,
|
|
152862
152898
|
quiet: tools.untilNoPayment,
|
|
152863
152899
|
paying: tools.payingSignal
|
|
@@ -154318,7 +154354,7 @@ var init_serve = __esm({
|
|
|
154318
154354
|
// wallet/src/inference/serveRunner.mjs
|
|
154319
154355
|
import { randomBytes as randomBytes38 } from "node:crypto";
|
|
154320
154356
|
import { spawn as spawn6, spawnSync as spawnSync7 } from "node:child_process";
|
|
154321
|
-
import { dirname as
|
|
154357
|
+
import { dirname as dirname38, join as join43, resolve as resolve30 } from "node:path";
|
|
154322
154358
|
function writeAtomic4(path, text3) {
|
|
154323
154359
|
const temp = `${path}.${randomBytes38(4).toString("hex")}.tmp`;
|
|
154324
154360
|
writeFileSync(temp, text3, { mode: 384, flag: "wx" });
|
|
@@ -154331,7 +154367,7 @@ function writeAtomic4(path, text3) {
|
|
|
154331
154367
|
}
|
|
154332
154368
|
}
|
|
154333
154369
|
function earlierKeyFiles(home, walletPath2) {
|
|
154334
|
-
const first = walletPath2 ? join43(
|
|
154370
|
+
const first = walletPath2 ? join43(dirname38(resolve30(walletPath2)), KEY_FILE) : void 0;
|
|
154335
154371
|
let others = [];
|
|
154336
154372
|
try {
|
|
154337
154373
|
others = readdirSync(home, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => join43(home, entry.name, KEY_FILE)).filter((file) => file !== first && existsSync(file)).map((file) => {
|
|
@@ -154633,7 +154669,7 @@ async function launchLocalAiServerProcess({
|
|
|
154633
154669
|
execPath,
|
|
154634
154670
|
["-e", LAUNCHER2, logPath, execPath, ...execArgv, entry, ...args],
|
|
154635
154671
|
// In the entry file's folder (as the WMI start): a source run's --import tsx resolves there, and no user folder is held.
|
|
154636
|
-
{ detached: true, stdio: ["ignore", "pipe", "ignore"], windowsHide: true, env, cwd:
|
|
154672
|
+
{ detached: true, stdio: ["ignore", "pipe", "ignore"], windowsHide: true, env, cwd: dirname38(resolve30(entry)) }
|
|
154637
154673
|
);
|
|
154638
154674
|
} catch (error) {
|
|
154639
154675
|
return { error: `the background process could not be started (${error?.code ?? error?.name ?? "Error"})` };
|
|
@@ -154713,7 +154749,7 @@ async function startLocalAiServer({
|
|
|
154713
154749
|
try {
|
|
154714
154750
|
if (typeof walletPath2 !== "string" || !walletPath2) return failed(`no wallet is named; run setup first (${setupLine2})`);
|
|
154715
154751
|
walletPath2 = resolve30(walletPath2);
|
|
154716
|
-
const walletHome2 = home ??
|
|
154752
|
+
const walletHome2 = home ?? dirname38(dirname38(walletPath2));
|
|
154717
154753
|
const running = await liveServer(walletPath2);
|
|
154718
154754
|
if (running?.status?.state === "listening" && running.status.pid === running.holder.pid) {
|
|
154719
154755
|
try {
|
|
@@ -154841,7 +154877,7 @@ async function startLocalAiServer({
|
|
|
154841
154877
|
}
|
|
154842
154878
|
async function localAiServerStatus({ walletPath: walletPath2, home, walletMaxPaymentAtomic } = {}) {
|
|
154843
154879
|
walletPath2 = resolve30(walletPath2);
|
|
154844
|
-
const walletHome2 = home ??
|
|
154880
|
+
const walletHome2 = home ?? dirname38(dirname38(walletPath2));
|
|
154845
154881
|
let apiKey;
|
|
154846
154882
|
try {
|
|
154847
154883
|
apiKey = localAiServerApiKey(walletHome2, { walletPath: walletPath2 });
|
|
@@ -154984,12 +155020,12 @@ var init_serveRunner = __esm({
|
|
|
154984
155020
|
"SHINJUKU_KEEP_WARM_ONCE_PARENT"
|
|
154985
155021
|
];
|
|
154986
155022
|
KEY_FILE = "local-ai-server-key.txt";
|
|
154987
|
-
localAiHomeOf = (walletPath2) =>
|
|
155023
|
+
localAiHomeOf = (walletPath2) => dirname38(dirname38(resolve30(walletPath2)));
|
|
154988
155024
|
localAiServerLockPath = (walletPath2) => `${walletPath2}.local-ai-server.lock`;
|
|
154989
155025
|
localAiServerKeyPath = (home) => join43(home, KEY_FILE);
|
|
154990
|
-
localAiServerStatusPath = (walletPath2) => join43(
|
|
154991
|
-
localAiServerLogPath = (walletPath2) => join43(
|
|
154992
|
-
localAiServerStopPath = (walletPath2) => join43(
|
|
155026
|
+
localAiServerStatusPath = (walletPath2) => join43(dirname38(walletPath2), "local-ai-server.json");
|
|
155027
|
+
localAiServerLogPath = (walletPath2) => join43(dirname38(walletPath2), "local-ai-server.log");
|
|
155028
|
+
localAiServerStopPath = (walletPath2) => join43(dirname38(walletPath2), "local-ai-server.stop");
|
|
154993
155029
|
localAiBaseUrl = (port = INFERENCE_SERVE_PORT) => `http://${INFERENCE_SERVE_HOST}:${port}/v1`;
|
|
154994
155030
|
setLocalAiServerEntry = (file) => {
|
|
154995
155031
|
cliEntry = typeof file === "string" && file ? file : void 0;
|
|
@@ -158277,7 +158313,7 @@ ${words2}`;
|
|
|
158277
158313
|
import { spawn as spawn11, spawnSync as spawnSync9 } from "node:child_process";
|
|
158278
158314
|
import { createHash as createHash39, createHmac as createHmac13, randomBytes as randomBytes42, timingSafeEqual as timingSafeEqual6 } from "node:crypto";
|
|
158279
158315
|
import net3 from "node:net";
|
|
158280
|
-
import { dirname as
|
|
158316
|
+
import { dirname as dirname40, join as join47 } from "node:path";
|
|
158281
158317
|
import { Readable } from "node:stream";
|
|
158282
158318
|
import { pipeline } from "node:stream/promises";
|
|
158283
158319
|
function managedTorState(home) {
|
|
@@ -158727,7 +158763,7 @@ async function startTor(home, port, say2, assertHeld = () => {
|
|
|
158727
158763
|
stdio: ["ignore", errFd, errFd],
|
|
158728
158764
|
windowsHide: true,
|
|
158729
158765
|
// Linux: tor loads libevent, libssl and libcrypto from its own folder first, never other versions of the system's.
|
|
158730
|
-
...LINUX ? { env: { ...process.env, LD_LIBRARY_PATH:
|
|
158766
|
+
...LINUX ? { env: { ...process.env, LD_LIBRARY_PATH: dirname40(torExe(home)) } } : {}
|
|
158731
158767
|
});
|
|
158732
158768
|
} catch (error) {
|
|
158733
158769
|
throw blocked(error);
|
|
@@ -160388,7 +160424,7 @@ init_knownZero();
|
|
|
160388
160424
|
init_publicRead();
|
|
160389
160425
|
init_timing();
|
|
160390
160426
|
import { randomBytes as randomBytes44 } from "node:crypto";
|
|
160391
|
-
import { dirname as
|
|
160427
|
+
import { dirname as dirname42, join as join53, resolve as resolve41 } from "node:path";
|
|
160392
160428
|
import { spawn as spawn13 } from "node:child_process";
|
|
160393
160429
|
import { fileURLToPath as fileURLToPath22 } from "node:url";
|
|
160394
160430
|
|
|
@@ -161265,7 +161301,7 @@ init_processLock();
|
|
|
161265
161301
|
init_config();
|
|
161266
161302
|
init_proofTools();
|
|
161267
161303
|
import { spawnSync as spawnSync8 } from "node:child_process";
|
|
161268
|
-
import { dirname as
|
|
161304
|
+
import { dirname as dirname39, join as join45, resolve as resolve34 } from "node:path";
|
|
161269
161305
|
var NATIVE_SET_MOVE_FILE = "setup-files-move.json";
|
|
161270
161306
|
function nativeSetMoveRecord(home) {
|
|
161271
161307
|
try {
|
|
@@ -161401,7 +161437,7 @@ function manifestToolPaths(file) {
|
|
|
161401
161437
|
const walk = (value2) => {
|
|
161402
161438
|
if (!value2 || typeof value2 !== "object") return;
|
|
161403
161439
|
if (!Array.isArray(value2) && typeof value2.path === "string" && typeof value2.sha256 === "string" && Object.keys(value2).sort().join(",") === "path,sha256") {
|
|
161404
|
-
out.push(resolve34(
|
|
161440
|
+
out.push(resolve34(dirname39(file), value2.path));
|
|
161405
161441
|
return;
|
|
161406
161442
|
}
|
|
161407
161443
|
for (const item of Object.values(value2)) walk(item);
|
|
@@ -163602,7 +163638,7 @@ init_backup();
|
|
|
163602
163638
|
init_fs();
|
|
163603
163639
|
import { spawn as spawn12, spawnSync as spawnSync10 } from "node:child_process";
|
|
163604
163640
|
import { homedir as homedir7 } from "node:os";
|
|
163605
|
-
import { dirname as
|
|
163641
|
+
import { dirname as dirname41, join as join48 } from "node:path";
|
|
163606
163642
|
var INHERITED = {
|
|
163607
163643
|
win32: ["APPDATA", "HOMEDRIVE", "HOMEPATH", "LOCALAPPDATA", "PROCESSOR_ARCHITECTURE", "SYSTEMDRIVE", "SYSTEMROOT", "TEMP", "USERNAME", "USERPROFILE", "PROGRAMFILES"],
|
|
163608
163644
|
other: ["HOME", "LOGNAME", "SHELL", "TERM", "USER"]
|
|
@@ -163636,7 +163672,7 @@ var windowsSystemPath = (env) => {
|
|
|
163636
163672
|
};
|
|
163637
163673
|
function nodePathFix({ platform = process.platform, env = process.env, execPath = process.execPath } = {}) {
|
|
163638
163674
|
const system = platform === "win32" ? windowsSystemPath(env) : appPath({ platform, env });
|
|
163639
|
-
return [
|
|
163675
|
+
return [dirname41(execPath), system].join(platform === "win32" ? ";" : ":");
|
|
163640
163676
|
}
|
|
163641
163677
|
var npmProxyEnvironment = (url) => ({
|
|
163642
163678
|
npm_config_offline: "false",
|
|
@@ -165918,7 +165954,7 @@ function curlSavedFiles(bytes2, contentType, text3, values, deps, said) {
|
|
|
165918
165954
|
let forbid;
|
|
165919
165955
|
try {
|
|
165920
165956
|
const { walletPath: walletPath2 } = payerSessionOptions(values, deps);
|
|
165921
|
-
forbid = [
|
|
165957
|
+
forbid = [dirname42(resolve41(walletPath2)), dirname42(dirname42(resolve41(walletPath2)))];
|
|
165922
165958
|
} catch {
|
|
165923
165959
|
forbid = void 0;
|
|
165924
165960
|
}
|
|
@@ -167305,7 +167341,7 @@ function torArgv(argv2, env = process.env) {
|
|
|
167305
167341
|
const command = rest[0];
|
|
167306
167342
|
const walletAt = rest.indexOf("--wallet");
|
|
167307
167343
|
const walletFile = walletAt >= 0 ? rest[walletAt + 1] : void 0;
|
|
167308
|
-
const walletHome2 = walletFile && !walletFile.startsWith("--") ?
|
|
167344
|
+
const walletHome2 = walletFile && !walletFile.startsWith("--") ? dirname42(dirname42(resolve41(walletFile))) : void 0;
|
|
167309
167345
|
const home = walletHome2 && existsSync(join53(walletHome2, "config.json")) ? walletHome2 : setupHome(env);
|
|
167310
167346
|
let config;
|
|
167311
167347
|
try {
|
|
@@ -167411,7 +167447,7 @@ var SETUP_NEXT_BY_PARENT_ENV = "SHINJUKU_WALLET_SETUP_NEXT_BY_PARENT";
|
|
|
167411
167447
|
var TOR_DOWN_DETAIL = "The wallet runs only over Tor, and Tor is not running on this computer (after the computer restarts, Tor must be started again), so nothing was paid or sent.";
|
|
167412
167448
|
var recordedTunnelUrl = (configPath2) => {
|
|
167413
167449
|
try {
|
|
167414
|
-
return readSetupConfig(
|
|
167450
|
+
return readSetupConfig(dirname42(configPath2))?.torTunnel ?? TOR_HTTP_TUNNEL;
|
|
167415
167451
|
} catch {
|
|
167416
167452
|
return TOR_HTTP_TUNNEL;
|
|
167417
167453
|
}
|
|
@@ -167425,7 +167461,7 @@ async function runMcpTorDown({ exitCode, configPath: configPath2, input = proces
|
|
|
167425
167461
|
if (ownTorPlatform()) {
|
|
167426
167462
|
let recorded;
|
|
167427
167463
|
try {
|
|
167428
|
-
recorded = readSetupConfig(
|
|
167464
|
+
recorded = readSetupConfig(dirname42(configPath2))?.torTunnel;
|
|
167429
167465
|
} catch {
|
|
167430
167466
|
recorded = void 0;
|
|
167431
167467
|
}
|
|
@@ -168246,7 +168282,7 @@ ${places.map((place, index) => ` ${index + 1} ${place.label}`).join("\n")}
|
|
|
168246
168282
|
}
|
|
168247
168283
|
}
|
|
168248
168284
|
async function requireBackupBeforeAddress(deps, io, walletFile, again) {
|
|
168249
|
-
const home = walletFile !== void 0 ?
|
|
168285
|
+
const home = walletFile !== void 0 ? dirname42(dirname42(resolve41(walletFile))) : setupHome(deps.env);
|
|
168250
168286
|
let config;
|
|
168251
168287
|
try {
|
|
168252
168288
|
config = readSetupConfig(home);
|
|
@@ -168282,7 +168318,7 @@ function addFundsMakesAddress(values, deps) {
|
|
|
168282
168318
|
}
|
|
168283
168319
|
}
|
|
168284
168320
|
async function backupReminder(deps, io, walletFile) {
|
|
168285
|
-
const home = walletFile !== void 0 ?
|
|
168321
|
+
const home = walletFile !== void 0 ? dirname42(dirname42(resolve41(walletFile))) : setupHome(deps.env);
|
|
168286
168322
|
let config;
|
|
168287
168323
|
try {
|
|
168288
168324
|
config = readSetupConfig(home);
|
|
@@ -168311,7 +168347,7 @@ async function backupAfterExport(values, deps, io) {
|
|
|
168311
168347
|
`);
|
|
168312
168348
|
return;
|
|
168313
168349
|
}
|
|
168314
|
-
const place =
|
|
168350
|
+
const place = dirname42(resolve41(String(values.get("--to"))));
|
|
168315
168351
|
let saved;
|
|
168316
168352
|
try {
|
|
168317
168353
|
saved = await saveBackup(home, place, { cleared: false, withCode: false, requireOwnerOnly: true });
|