shinjuku-shielded 0.3.173 → 0.3.174

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
@@ -6,13 +6,13 @@ 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.173. The npm packages `shinjuku-shield` and
9
+ This is version 0.3.174. 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
- npx -y shinjuku@0.3.173 setup
15
+ npx -y shinjuku@0.3.174 setup
16
16
  ```
17
17
 
18
18
  Setup offers to install the `shinjuku` command and, on Windows, adds npm's
@@ -35,13 +35,13 @@ Every wallet command works after `shinjuku`, for example `shinjuku balance`,
35
35
  Claude Code:
36
36
 
37
37
  ```sh
38
- claude mcp add --scope user shinjuku -- npx -y --no-audit --no-fund shinjuku-shield@0.3.173 mcp
38
+ claude mcp add --scope user shinjuku -- npx -y --no-audit --no-fund shinjuku-shield@0.3.174 mcp
39
39
  ```
40
40
 
41
41
  Claude Desktop (`claude_desktop_config.json`) or Cursor (`~/.cursor/mcp.json`):
42
42
 
43
43
  ```json
44
- { "mcpServers": { "shinjuku": { "command": "npx", "args": ["-y", "--no-audit", "--no-fund", "shinjuku-shield@0.3.173", "mcp"] } } }
44
+ { "mcpServers": { "shinjuku": { "command": "npx", "args": ["-y", "--no-audit", "--no-fund", "shinjuku-shield@0.3.174", "mcp"] } } }
45
45
  ```
46
46
 
47
47
  On native Windows, if the host cannot find `npx`, use `"command": "cmd"` and
@@ -54,7 +54,7 @@ Codex (the Codex app and Codex CLI read the same file, `~/.codex/config.toml`):
54
54
  ```toml
55
55
  [mcp_servers.shinjuku]
56
56
  command = "npx"
57
- args = ["-y", "--no-audit", "--no-fund", "shinjuku-shield@0.3.173", "mcp"]
57
+ args = ["-y", "--no-audit", "--no-fund", "shinjuku-shield@0.3.174", "mcp"]
58
58
  startup_timeout_sec = 120
59
59
  tool_timeout_sec = 300
60
60
  ```
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": "190dcbc3bb63059691cef5a801d8c249f403dff69a2e45c031da5f5edbde9f29",
5
- "bytes": 9389003,
6
- "sourceCommit": "1e7c5e1a6635c6b454956b060b7f5d6706b7e115",
4
+ "sha256": "1018a5346c79bc828bd3200c8c6c7d741cac55e279d5b88a70f895f44cc105c6",
5
+ "bytes": 9392332,
6
+ "sourceCommit": "1629d7280f4cef53ec8b06e6f303e11c2c8ac3fe",
7
7
  "sourceDirty": false,
8
8
  "installRecordMatchesLockfile": true,
9
9
  "releaseRule": "valid only when two fresh npm ci --ignore-scripts builds on different OSes give the same sha256; installRecordMatchesLockfile true means every entry npm installed equals its package-lock.json entry and every entry not marked optional, devOptional included, is installed: an optional entry (a package for another platform) may be absent",
@@ -1038,5 +1038,5 @@
1038
1038
  "version": "1.8.0"
1039
1039
  }
1040
1040
  ],
1041
- "publishedAt": "2026-11-05T13:06:18.056Z"
1041
+ "publishedAt": "2026-11-05T13:40:19.887Z"
1042
1042
  }
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "shinjuku-shielded",
3
- "version": "0.3.173",
3
+ "version": "0.3.174",
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": "190dcbc3",
7
- "shinjukuSha256": "190dcbc3bb63059691cef5a801d8c249f403dff69a2e45c031da5f5edbde9f29",
6
+ "shinjukuRelease": "1018a534",
7
+ "shinjukuSha256": "1018a5346c79bc828bd3200c8c6c7d741cac55e279d5b88a70f895f44cc105c6",
8
8
  "license": "SEE LICENSE IN LICENSE.txt",
9
9
  "author": "Shinjuku Shielded",
10
10
  "homepage": "https://github.com/ShinjukuStaition/shinjuku-shield#readme",
@@ -54246,6 +54246,7 @@ import { execFileSync as execFileSync2, spawnSync as spawnSync3 } from "node:chi
54246
54246
  import { randomBytes as randomBytes7 } from "node:crypto";
54247
54247
  import { homedir } from "node:os";
54248
54248
  import { basename as basename4, dirname as dirname6, isAbsolute as isAbsolute2, join as join9, relative as relative3, resolve as resolve6 } from "node:path";
54249
+ import { fileURLToPath as fileURLToPath4, pathToFileURL } from "node:url";
54249
54250
  function retiredPoolText(pool2, npmVersion) {
54250
54251
  const next = RETIRED_POOLS[pool2];
54251
54252
  if (!next) return void 0;
@@ -54460,6 +54461,29 @@ function mcpFlagsFromConfig(home, config) {
54460
54461
  ["--unshield-to", config.unshieldTo ? [...config.unshieldTo] : void 0]
54461
54462
  ].filter(([, value2]) => value2 !== void 0);
54462
54463
  }
54464
+ function hostEntry(target, entry, platform = process.platform) {
54465
+ const typed = ["vscode", "cline", "continue"].includes(target) ? { type: "stdio", ...entry } : entry;
54466
+ const folder = hostStartFolder(target, entry);
54467
+ if (target === "hermes" || folder === void 0) return typed;
54468
+ return { ...typed, cwd: target === "continue" && platform === "win32" ? pathToFileURL(folder).href : folder };
54469
+ }
54470
+ function hostStartFolder(target, entry) {
54471
+ const home = typeof entry?.env?.SHIELDED_WALLET_HOME === "string" ? resolve6(entry.env.SHIELDED_WALLET_HOME) : void 0;
54472
+ if (home === void 0 || !CWD_HOSTS.includes(target)) return void 0;
54473
+ return target === "hermes" || !hasPrefix(entry) ? home : void 0;
54474
+ }
54475
+ function noStartFolderWords(target, entry) {
54476
+ if (hasPrefix(entry) || hostStartFolder(target, entry) !== void 0) return "";
54477
+ return ` Your wallet folder path has a character that Windows reads as code (% & | < > ^ ! or "), so ${HOST_NAMES[target]} starts the wallet in a folder of its own: a settings file there (.npmrc) can stop the wallet. If the wallet does not start there, set up the wallet again in a folder without these characters.`;
54478
+ }
54479
+ function cwdFolder(cwd) {
54480
+ if (typeof cwd !== "string" || !cwd) return void 0;
54481
+ try {
54482
+ return resolve6(cwd.startsWith("file://") ? fileURLToPath4(cwd) : cwd);
54483
+ } catch {
54484
+ return void 0;
54485
+ }
54486
+ }
54463
54487
  function npxPackageWord(npmVersion) {
54464
54488
  const version3 = knownNpmVersion(npmVersion);
54465
54489
  return version3 ? `${NPX_PACKAGE}@${version3}` : NPX_PACKAGE;
@@ -54507,12 +54531,16 @@ function terminalUseLines(npmVersion) {
54507
54531
  return ["To type shinjuku balance and the other commands in a terminal, install the shinjuku command once:", ` ${installCommandText(npmVersion)}`];
54508
54532
  }
54509
54533
  function mcpServerEntry({ home, platform = process.platform, npmVersion, path, tor } = {}) {
54510
- const npx = ["npx", "-y", ...NPX_INSTALL_FLAGS, npxPackageWord(npmVersion), "mcp"];
54534
+ const npx = ["npx", "-y", ...NPX_INSTALL_FLAGS, ...npmPrefixArgs(home, platform), npxPackageWord(npmVersion), "mcp"];
54511
54535
  return {
54512
54536
  ...platform === "win32" ? { command: "cmd", args: ["/c", ...npx] } : { command: "npx", args: npx.slice(1) },
54513
54537
  env: { SHIELDED_WALLET_HOME: resolve6(home), ...path ? { PATH: path } : {}, ...npmStartEnvironment(tor ?? homeTorOn(home)) }
54514
54538
  };
54515
54539
  }
54540
+ function npmPrefixArgs(home, platform = process.platform) {
54541
+ const folder = resolve6(home);
54542
+ return platform === "win32" && CMD_ARG_CODE.test(folder) ? [] : [`--prefix=${folder}`];
54543
+ }
54516
54544
  function homeTorOn(home) {
54517
54545
  try {
54518
54546
  return readSetupConfig(home)?.tor === true;
@@ -54548,7 +54576,11 @@ function walletEntryShape(entry, defaultHome) {
54548
54576
  delete env.SHIELDED_WALLET_HOME;
54549
54577
  delete env.PATH;
54550
54578
  for (const key of NPM_START_KEYS) delete env[key];
54551
- return { home, args, env };
54579
+ const word2 = args.findIndex(isPackageWord);
54580
+ const own = (arg, index) => index < word2 && typeof arg === "string" && arg.startsWith("--prefix=");
54581
+ if (args.some((arg, index) => own(arg, index) && resolve6(arg.slice("--prefix=".length)) !== home)) return void 0;
54582
+ if (entry.cwd !== void 0 && cwdFolder(entry.cwd) !== home) return void 0;
54583
+ return { home, args: args.filter((arg, index) => !own(arg, index)), env };
54552
54584
  }
54553
54585
  function walletEntryHomeOf(existing, entry, { defaultHome = defaultWalletHome() } = {}) {
54554
54586
  const was = walletEntryShape(existing, defaultHome);
@@ -54705,11 +54737,11 @@ function hostConfigText({ home, env = process.env, platform = process.platform,
54705
54737
  const entry = mcpServerEntry({ home, platform, npmVersion });
54706
54738
  const more = ["vscode", "devin", "cline", "continue", "gemini", "antigravity"].filter((target) => !skip.has(target)).flatMap((target) => {
54707
54739
  const file = hostConfigFile(target, { platform, env, home: userHome });
54708
- if (target === "continue") return [`${HOST_NAMES[target]}: save these lines as ${file}:`, ...continueBlockText(hostEntry(target, entry)).trimEnd().split("\n").map((line) => ` ${line}`)];
54740
+ if (target === "continue") return [`${HOST_NAMES[target]}: save these lines as ${file}:`, ...continueBlockText(hostEntry(target, entry, platform)).trimEnd().split("\n").map((line) => ` ${line}`)];
54709
54741
  const key = hostServersKey(target);
54710
54742
  return [
54711
54743
  `${HOST_NAMES[target]} (${file}): in that file, add these lines inside the { } after "${key}" (put a comma after the entry before them; a file with no "${key}" gets "${key}": { } first):`,
54712
- ...`${JSON.stringify(MCP_SERVER_NAME)}: ${JSON.stringify(hostEntry(target, entry), null, 2)}`.split("\n").map((line) => ` ${line}`)
54744
+ ...`${JSON.stringify(MCP_SERVER_NAME)}: ${JSON.stringify(hostEntry(target, entry, platform), null, 2)}`.split("\n").map((line) => ` ${line}`)
54713
54745
  ];
54714
54746
  });
54715
54747
  const member = `${JSON.stringify(MCP_SERVER_NAME)}: ${JSON.stringify(entry, null, 2)}`;
@@ -54725,11 +54757,11 @@ function hostConfigText({ home, env = process.env, platform = process.platform,
54725
54757
  ] : [],
54726
54758
  ...skip.has("codex") ? [] : [
54727
54759
  "Codex (the Codex side of the ChatGPT desktop app, and Codex CLI), at the end of ~/.codex/config.toml:",
54728
- ...codexTomlBlock(entry).trimEnd().split("\n").map((line) => ` ${line}`)
54760
+ ...codexTomlBlock(hostEntry("codex", entry, platform)).trimEnd().split("\n").map((line) => ` ${line}`)
54729
54761
  ],
54730
54762
  ...skip.has("grok") ? [] : [
54731
54763
  `Grok Build (the grok command), at the end of ${hostConfigFile("grok", { platform, env, home: userHome })}:`,
54732
- ...codexTomlBlock(entry).trimEnd().split("\n").map((line) => ` ${line}`)
54764
+ ...codexTomlBlock(hostEntry("grok", entry, platform)).trimEnd().split("\n").map((line) => ` ${line}`)
54733
54765
  ],
54734
54766
  ...skip.has("hermes") ? [] : [
54735
54767
  `Hermes Agent, at the end of ${(() => {
@@ -54787,6 +54819,7 @@ function codexTomlBlock(entry, extra = []) {
54787
54819
  `[mcp_servers.${tomlKey(MCP_SERVER_NAME)}]`,
54788
54820
  `command = ${tomlString(entry.command)}`,
54789
54821
  `args = [${entry.args.map(tomlString).join(", ")}]`,
54822
+ ...typeof entry.cwd === "string" ? [`cwd = ${tomlString(entry.cwd)}`] : [],
54790
54823
  `startup_timeout_sec = ${CODEX_STARTUP_TIMEOUT_SEC}`,
54791
54824
  `tool_timeout_sec = ${CODEX_TOOL_TIMEOUT_SEC}`,
54792
54825
  ...extra
@@ -54992,6 +55025,7 @@ function codexServersIn(text3, names) {
54992
55025
  const value2 = tomlValue(found.text);
54993
55026
  if (rel.length === 1 && rel[0] === "command") server.command = value2;
54994
55027
  else if (rel.length === 1 && rel[0] === "args") server.args = value2;
55028
+ else if (rel.length === 1 && rel[0] === "cwd") server.cwd = value2;
54995
55029
  else if (rel.length === 1 && rel[0] === "env" && isPlainObject(value2)) server.env = { ...server.env, ...value2 };
54996
55030
  else if (rel.length === 2 && rel[0] === "env") server.env[rel[1]] = value2;
54997
55031
  else if (table.length === 2 && !(rel.length === 1 && (rel[0] === "startup_timeout_sec" || rel[0] === "tool_timeout_sec"))) {
@@ -55403,6 +55437,7 @@ function addToHermesHost(file, entry, { now = /* @__PURE__ */ new Date(), force
55403
55437
  if (basename4(dirname6(dirname6(file))) === "profiles" && !existsSync(dirname6(file))) {
55404
55438
  throw new Error(`setup_host_config_unreadable: Hermes' profile folder ${dirname6(file)} does not exist, so setup wrote nothing; pick a profile with hermes profile use, then run this setup line again, or add the printed entry by hand`);
55405
55439
  }
55440
+ entry = { ...entry, ...hermesCwd(entry) ? { cwd: hermesCwd(entry) } : {} };
55406
55441
  let replaced = [];
55407
55442
  const result = changeJsonFile(file, (text3) => {
55408
55443
  const names = [MCP_SERVER_NAME, ...OLD_MCP_SERVER_NAMES];
@@ -55477,10 +55512,13 @@ function isOlderSetupEntry(existing, entry, options) {
55477
55512
  const home = walletEntryHomeOf(existing, entry, options);
55478
55513
  return home !== void 0 && home === walletEntryShape(entry, home)?.home;
55479
55514
  }
55515
+ function isPackageWord(arg) {
55516
+ return typeof arg === "string" && (PINNED_PACKAGE.test(arg) || LAUNCHER_PACKAGE.test(arg) || NPM_PACKAGE_NAMES.includes(arg) || arg === COMMAND_PACKAGE);
55517
+ }
55480
55518
  function isOlderArgs(was, now) {
55481
55519
  const pinned = (args) => args.some((arg) => PINNED_PACKAGE.test(arg));
55482
55520
  if (pinned(was) && !pinned(now)) return false;
55483
- const plain = (args) => args.map((arg) => typeof arg === "string" && (PINNED_PACKAGE.test(arg) || LAUNCHER_PACKAGE.test(arg) || NPM_PACKAGE_NAMES.includes(arg) || arg === COMMAND_PACKAGE) ? NPX_PACKAGE : arg);
55521
+ const plain = (args) => args.map((arg) => isPackageWord(arg) ? NPX_PACKAGE : arg);
55484
55522
  return sameJson(plain(was), plain(now)) || sameJson(plain(was), plain(now).filter((arg) => !NPX_INSTALL_FLAGS.includes(arg)));
55485
55523
  }
55486
55524
  function isOlderClaudeCodeEntry(existing, options = {}) {
@@ -55774,7 +55812,7 @@ function changeFileOnce(file, change, { now, platform, restrict, codec = JSON_CO
55774
55812
  }
55775
55813
  return { changed: true, ...backup ? { backup } : {} };
55776
55814
  }
55777
- var import_web396, CONFIG_SCHEMA, CONFIG_FILE, NPM_PACKAGE_NAMES, COMMAND_PACKAGE, NPX_PACKAGE, NPX_INSTALL_FLAGS, MCP_SERVER_NAME, OLD_MCP_SERVER_NAMES, P03_BINDING, PRODUCTION, RETIRED_POOLS, NO_LIMIT_ATOMIC, DEFAULT_CAPS, OLD_DEFAULT_SETUP_CAPS, OLD_DEFAULT_WALLET_BUDGETS, capText, POSITIVE_ATOMIC, HOME_FOLDER, OLDER_HOME_FOLDER, defaultHomeWords, configPath, homeWalletPath, invalid, isPubkey, MAX_OWN_ADDRESSES, isOwnAddressText, salvagePath, clearConfigSalvage, HOST_TARGETS, HOST_NAMES, hostServersKey, hostEntry, CODEX_STARTUP_TIMEOUT_SEC, CODEX_TOOL_TIMEOUT_SEC, PINNED_PACKAGE, LAUNCHER_PACKAGE, NPM_VERSION, knownNpmVersion, RECOVERY_WORDS, NPX_WALLET_LINE, RELEASES_URL, npmStartEnvironment, NPM_START_KEYS, defaultWalletHome, CMD_UNSAFE, programOf, claudeLineDiffers, WINDOWS_SHELL_CODE, CLAUDE_DESKTOP_FILE, claudeDataDirsCache, CONTINUE_HEADER, tomlString, tomlKey, codexEntryOf, HERMES_TRUST, HERMES_TOOL_TIMEOUT_SEC, hermesCwd, HERMES_OWN_KEYS, HERMES_RESERVED_PROFILES, yamlString, hermesEntryOf, isPlainObject, sameJson, claudeCodeEntry, READ_ONLY_TOOL_NAMES, claudeCodeAllowRules, claudeCodeSettingsFile, UNREADABLE_JSON, JSON_CODEC, indentAt, TEXT_CODEC, RACED;
55815
+ var import_web396, CONFIG_SCHEMA, CONFIG_FILE, NPM_PACKAGE_NAMES, COMMAND_PACKAGE, NPX_PACKAGE, NPX_INSTALL_FLAGS, MCP_SERVER_NAME, OLD_MCP_SERVER_NAMES, P03_BINDING, PRODUCTION, RETIRED_POOLS, NO_LIMIT_ATOMIC, DEFAULT_CAPS, OLD_DEFAULT_SETUP_CAPS, OLD_DEFAULT_WALLET_BUDGETS, capText, POSITIVE_ATOMIC, HOME_FOLDER, OLDER_HOME_FOLDER, defaultHomeWords, configPath, homeWalletPath, invalid, isPubkey, MAX_OWN_ADDRESSES, isOwnAddressText, salvagePath, clearConfigSalvage, HOST_TARGETS, HOST_NAMES, hostServersKey, CWD_HOSTS, hasPrefix, CODEX_STARTUP_TIMEOUT_SEC, CODEX_TOOL_TIMEOUT_SEC, PINNED_PACKAGE, LAUNCHER_PACKAGE, NPM_VERSION, knownNpmVersion, RECOVERY_WORDS, NPX_WALLET_LINE, RELEASES_URL, npmStartEnvironment, CMD_ARG_CODE, NPM_START_KEYS, defaultWalletHome, CMD_UNSAFE, programOf, claudeLineDiffers, WINDOWS_SHELL_CODE, CLAUDE_DESKTOP_FILE, claudeDataDirsCache, CONTINUE_HEADER, tomlString, tomlKey, codexEntryOf, HERMES_TRUST, HERMES_TOOL_TIMEOUT_SEC, hermesCwd, HERMES_OWN_KEYS, HERMES_RESERVED_PROFILES, yamlString, hermesEntryOf, isPlainObject, sameJson, claudeCodeEntry, READ_ONLY_TOOL_NAMES, claudeCodeAllowRules, claudeCodeSettingsFile, UNREADABLE_JSON, JSON_CODEC, indentAt, TEXT_CODEC, RACED;
55778
55816
  var init_config = __esm({
55779
55817
  "wallet/src/setup/config.mjs"() {
55780
55818
  "use strict";
@@ -55851,7 +55889,8 @@ var init_config = __esm({
55851
55889
  hermes: "Hermes Agent"
55852
55890
  });
55853
55891
  hostServersKey = (target) => target === "vscode" ? "servers" : "mcpServers";
55854
- hostEntry = (target, entry) => ["vscode", "cline", "continue"].includes(target) ? { type: "stdio", ...entry } : entry;
55892
+ CWD_HOSTS = Object.freeze(["vscode", "codex", "grok", "gemini", "cline", "continue", "hermes"]);
55893
+ hasPrefix = (entry) => Array.isArray(entry?.args) && entry.args.some((arg) => typeof arg === "string" && arg.startsWith("--prefix="));
55855
55894
  CODEX_STARTUP_TIMEOUT_SEC = 120;
55856
55895
  CODEX_TOOL_TIMEOUT_SEC = 300;
55857
55896
  PINNED_PACKAGE = /^shinjuku(?:-shield(?:ed)?)?@(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$/;
@@ -55862,6 +55901,7 @@ var init_config = __esm({
55862
55901
  NPX_WALLET_LINE = /npx (?:--(?:prefer-)?offline )?-y ((?:--no-audit --no-fund )?(?:shinjuku-shield|shinjuku)@(\d+\.\d+\.\d+))((?: (?:setup|restore))(?=\s|$|[^\w-]))?/g;
55863
55902
  RELEASES_URL = "https://github.com/ShinjukuStaition/shinjuku-shield#releases";
55864
55903
  npmStartEnvironment = (tor) => tor ? { npm_config_offline: "true" } : { npm_config_prefer_offline: "true" };
55904
+ CMD_ARG_CODE = /[%&|<>^!"\r\n]/;
55865
55905
  NPM_START_KEYS = ["npm_config_offline", "npm_config_prefer_offline"];
55866
55906
  defaultWalletHome = (home = homedir()) => setupHome({}, home);
55867
55907
  CMD_UNSAFE = /[%"\r\n]/;
@@ -55875,6 +55915,7 @@ var init_config = __esm({
55875
55915
  codexEntryOf = (server) => ({
55876
55916
  command: server.command,
55877
55917
  args: server.args,
55918
+ ...server.cwd !== void 0 ? { cwd: server.cwd } : {},
55878
55919
  ...isPlainObject(server.env) && Object.keys(server.env).length ? { env: server.env } : {}
55879
55920
  });
55880
55921
  HERMES_TRUST = "untrusted";
@@ -55886,6 +55927,7 @@ var init_config = __esm({
55886
55927
  hermesEntryOf = (server) => ({
55887
55928
  command: server.command,
55888
55929
  args: server.args,
55930
+ ...server.cwd != null ? { cwd: server.cwd } : {},
55889
55931
  ...isPlainObject(server.env) && Object.keys(server.env).length ? { env: server.env } : {}
55890
55932
  });
55891
55933
  isPlainObject = (value2) => Boolean(value2) && typeof value2 === "object" && !Array.isArray(value2);
@@ -65146,7 +65188,7 @@ var init_witness = __esm({
65146
65188
  });
65147
65189
 
65148
65190
  // wallet/src/deposit/deposit.mjs
65149
- import { fileURLToPath as fileURLToPath4 } from "node:url";
65191
+ import { fileURLToPath as fileURLToPath5 } from "node:url";
65150
65192
  function relayOwnerKeypair(store, relay) {
65151
65193
  if (relay.own === true) return import_web3102.Keypair.fromSecretKey(Uint8Array.from(store.state.solanaSecretKey));
65152
65194
  if (relay.pocket === void 0) return depositKeypair(store.state, relay.index, relay.keyPool ?? store.state.pool);
@@ -65158,7 +65200,7 @@ function fail12(reason) {
65158
65200
  }
65159
65201
  function pinnedGenerator() {
65160
65202
  const url = new URL("../../vendor/shielded-x402-model/vectors/rust-vectors.json", new URL("__bundled_source__/wallet/src/deposit/deposit.mjs", import.meta.url).href);
65161
- return JSON.parse(readFileSync(fileURLToPath4(url), "utf8")).payerKeys.generator;
65203
+ return JSON.parse(readFileSync(fileURLToPath5(url), "utf8")).payerKeys.generator;
65162
65204
  }
65163
65205
  function assertDepositId(depositId) {
65164
65206
  if (!/^[0-9a-zA-Z_-]{1,64}$/.test(depositId ?? "")) fail12("id_invalid");
@@ -67428,7 +67470,7 @@ var init_successorHistories = __esm({
67428
67470
  import { createHash as createHash16 } from "node:crypto";
67429
67471
  import { join as join14, resolve as resolve11 } from "node:path";
67430
67472
  import { performance as performance4 } from "node:perf_hooks";
67431
- import { fileURLToPath as fileURLToPath5 } from "node:url";
67473
+ import { fileURLToPath as fileURLToPath6 } from "node:url";
67432
67474
  function pinnedGenerator2(profileVector) {
67433
67475
  if (profileVector?.payerKeys?.generator) return profileVector.payerKeys.generator;
67434
67476
  if (!committedGenerator) {
@@ -68007,7 +68049,7 @@ var init_recover = __esm({
68007
68049
  init_successorHistories();
68008
68050
  FIELD_MODULUS6 = BigInt("21888242871839275222246405745257275088548364400416034343698204186575808495617");
68009
68051
  MODEL_DIR = resolve11(
68010
- fileURLToPath5(new URL("../../vendor/shielded-x402-model/", new URL("__bundled_source__/wallet/src/recovery/recover.mjs", import.meta.url).href))
68052
+ fileURLToPath6(new URL("../../vendor/shielded-x402-model/", new URL("__bundled_source__/wallet/src/recovery/recover.mjs", import.meta.url).href))
68011
68053
  );
68012
68054
  seedBytes3 = (state2) => Uint8Array.from(Buffer.from(state2.seedHex, "hex"));
68013
68055
  REPLAY_VALUES = /* @__PURE__ */ new Map();
@@ -76000,7 +76042,7 @@ var init_solana_ed255192 = __esm({
76000
76042
  // spikes/shielded-x402-solana/scripts/verify-production-parameter-bundle.mjs
76001
76043
  import { createHash as createHash17 } from "node:crypto";
76002
76044
  import { dirname as dirname13, isAbsolute as isAbsolute5, relative as relative6, resolve as resolve12 } from "node:path";
76003
- import { fileURLToPath as fileURLToPath6 } from "node:url";
76045
+ import { fileURLToPath as fileURLToPath7 } from "node:url";
76004
76046
  function fail14(message) {
76005
76047
  throw new Error(`production parameter bundle rejected: ${message}`);
76006
76048
  }
@@ -76382,7 +76424,7 @@ var init_verify_production_parameter_bundle2 = __esm({
76382
76424
  FAWKES_VERSION2 = "4.7.0";
76383
76425
  FAWKES_CHECKSUM2 = "3f221a5c9ba1e17e60bbbf87022f317b02c41218024ae20ac4ab19eca74ea2a5";
76384
76426
  FIELD_BYTES5 = 32;
76385
- isMain = process.argv[1] && resolve12(process.argv[1]) === resolve12(fileURLToPath6(new URL("__bundled_source__/spikes/shielded-x402-solana/scripts/verify-production-parameter-bundle.mjs", import.meta.url).href));
76427
+ isMain = process.argv[1] && resolve12(process.argv[1]) === resolve12(fileURLToPath7(new URL("__bundled_source__/spikes/shielded-x402-solana/scripts/verify-production-parameter-bundle.mjs", import.meta.url).href));
76386
76428
  if (isMain) {
76387
76429
  const args = parseArgs(process.argv.slice(2));
76388
76430
  if (!args.bundle) fail14("--bundle is required");
@@ -76878,7 +76920,7 @@ var init_p03_recovered_exit = __esm({
76878
76920
  // spikes/shielded-x402-wallet/bin/shielded-wallet.mjs
76879
76921
  import { createHash as createHash19 } from "node:crypto";
76880
76922
  import { join as join16, resolve as resolve15 } from "node:path";
76881
- import { fileURLToPath as fileURLToPath7 } from "node:url";
76923
+ import { fileURLToPath as fileURLToPath8 } from "node:url";
76882
76924
  function walletHome() {
76883
76925
  return setupHome(process.env);
76884
76926
  }
@@ -78885,7 +78927,7 @@ var init_shielded_wallet = __esm({
78885
78927
  MAINNET_CONFIRMATION = "I_UNDERSTAND_MAINNET_USDC_SPEND";
78886
78928
  FIELD_MODULUS7 = BigInt("21888242871839275222246405745257275088548364400416034343698204186575808495617");
78887
78929
  MODEL_DIR2 = resolve15(
78888
- fileURLToPath7(new URL("../../shielded-x402-model/", new URL("__bundled_source__/spikes/shielded-x402-wallet/bin/shielded-wallet.mjs", import.meta.url).href))
78930
+ fileURLToPath8(new URL("../../shielded-x402-model/", new URL("__bundled_source__/spikes/shielded-x402-wallet/bin/shielded-wallet.mjs", import.meta.url).href))
78889
78931
  );
78890
78932
  WALLET_SCHEMA = "carbon-shielded-wallet/state/v1";
78891
78933
  passphrase = () => {
@@ -78927,7 +78969,7 @@ var init_shielded_wallet = __esm({
78927
78969
  return value2;
78928
78970
  };
78929
78971
  BROADCASTER_KEY_FILE_INVALID = "broadcaster_key_file_invalid: --broadcaster-key-file must be a solana-keygen JSON keypair file (a JSON array of 64 byte values)";
78930
- invokedDirectly = process.argv[1] && fileURLToPath7(new URL("__bundled_source__/spikes/shielded-x402-wallet/bin/shielded-wallet.mjs", import.meta.url).href) === resolve15(process.argv[1]);
78972
+ invokedDirectly = process.argv[1] && fileURLToPath8(new URL("__bundled_source__/spikes/shielded-x402-wallet/bin/shielded-wallet.mjs", import.meta.url).href) === resolve15(process.argv[1]);
78931
78973
  if (invokedDirectly) {
78932
78974
  main().catch((error) => {
78933
78975
  printFailure(error);
@@ -104755,7 +104797,7 @@ var init_balance = __esm({
104755
104797
  // wallet/src/pay/floatPay.mjs
104756
104798
  import { createHash as createHash26, createHmac as createHmac8, randomBytes as randomBytes16, timingSafeEqual as timingSafeEqual2 } from "node:crypto";
104757
104799
  import { dirname as dirname21, join as join20 } from "node:path";
104758
- import { fileURLToPath as fileURLToPath8 } from "node:url";
104800
+ import { fileURLToPath as fileURLToPath9 } from "node:url";
104759
104801
  function refundEtaLeft(dueAtMs, now = Date.now()) {
104760
104802
  if (!Number.isSafeInteger(dueAtMs) || now > dueAtMs + 6e4) return void 0;
104761
104803
  return Math.max(60, Math.ceil((dueAtMs - now) / 1e3));
@@ -106714,7 +106756,7 @@ var init_floatPay = __esm({
106714
106756
  poolDomainReads = /* @__PURE__ */ new Map();
106715
106757
  poolDomainWarmFailedAt = /* @__PURE__ */ new Map();
106716
106758
  WARM_RETRY_MS = 3e4;
106717
- loadPayerGenerator = () => payerGenerator ??= JSON.parse(readFileSync(fileURLToPath8(new URL(
106759
+ loadPayerGenerator = () => payerGenerator ??= JSON.parse(readFileSync(fileURLToPath9(new URL(
106718
106760
  "../../vendor/shielded-x402-model/vectors/rust-vectors.json",
106719
106761
  new URL("__bundled_source__/wallet/src/pay/floatPay.mjs", import.meta.url).href
106720
106762
  )), "utf8")).payerKeys.generator;
@@ -106762,13 +106804,13 @@ var init_floatPay = __esm({
106762
106804
  // wallet/src/unshield/selfPay.mjs
106763
106805
  import { randomBytes as randomBytes17 } from "node:crypto";
106764
106806
  import { join as join21 } from "node:path";
106765
- import { fileURLToPath as fileURLToPath9 } from "node:url";
106807
+ import { fileURLToPath as fileURLToPath10 } from "node:url";
106766
106808
  function fail22(reason) {
106767
106809
  throw new Error(`p03_self_pay_${reason}`);
106768
106810
  }
106769
106811
  function pinnedGenerator4() {
106770
106812
  const url = new URL("../../vendor/shielded-x402-model/vectors/rust-vectors.json", new URL("__bundled_source__/wallet/src/unshield/selfPay.mjs", import.meta.url).href);
106771
- return generator ??= Object.freeze(JSON.parse(readFileSync(fileURLToPath9(url), "utf8")).payerKeys.generator);
106813
+ return generator ??= Object.freeze(JSON.parse(readFileSync(fileURLToPath10(url), "utf8")).payerKeys.generator);
106772
106814
  }
106773
106815
  function abandonedMergeUnsent(store, id) {
106774
106816
  if (!MERGE_ID.test(id) || store.readWal(`self-pay-${id}`)?.state !== "abandoned") return false;
@@ -107390,7 +107432,7 @@ var init_privateSend = __esm({
107390
107432
 
107391
107433
  // wallet/src/pay/prepareRecoveredPayment.mjs
107392
107434
  import { join as join22, resolve as resolve17 } from "node:path";
107393
- import { fileURLToPath as fileURLToPath10 } from "node:url";
107435
+ import { fileURLToPath as fileURLToPath11 } from "node:url";
107394
107436
  function fail24(reason) {
107395
107437
  throw new Error(`p03_merchant_respend_${reason}`);
107396
107438
  }
@@ -108157,7 +108199,7 @@ var init_prepareRecoveredPayment = __esm({
108157
108199
  init_accountSelection();
108158
108200
  init_phaseTiming();
108159
108201
  init_privateSend();
108160
- MODEL_DIR3 = resolve17(fileURLToPath10(new URL("../../vendor/shielded-x402-model/", new URL("__bundled_source__/wallet/src/pay/prepareRecoveredPayment.mjs", import.meta.url).href)));
108202
+ MODEL_DIR3 = resolve17(fileURLToPath11(new URL("../../vendor/shielded-x402-model/", new URL("__bundled_source__/wallet/src/pay/prepareRecoveredPayment.mjs", import.meta.url).href)));
108161
108203
  seedBytes5 = (state2) => Uint8Array.from(Buffer.from(state2.seedHex, "hex"));
108162
108204
  EARLY_CHAIN_TIME_MAX_AGE_MS = 3e4;
108163
108205
  settledNoteExits = /* @__PURE__ */ new Map();
@@ -108510,7 +108552,7 @@ var init_anchorWait = __esm({
108510
108552
 
108511
108553
  // wallet/src/pay/payResource.mjs
108512
108554
  import { join as join24, resolve as resolvePath } from "node:path";
108513
- import { fileURLToPath as fileURLToPath11 } from "node:url";
108555
+ import { fileURLToPath as fileURLToPath12 } from "node:url";
108514
108556
  function assertOwnerUnshieldRequest(requestId, url) {
108515
108557
  const id = OWNER_UNSHIELD_REQUEST.exec(requestId)?.[1];
108516
108558
  if (!id || url !== `${OWNER_UNSHIELD_ORIGIN}/unshield/${id}`) fail25("owner_unshield_not_self_pay");
@@ -108542,7 +108584,7 @@ function recordedKind(record) {
108542
108584
  return void 0;
108543
108585
  }
108544
108586
  function assertOwnerUnshieldPayee(store, requirement) {
108545
- const generator2 = JSON.parse(readFileSync(fileURLToPath11(new URL(
108587
+ const generator2 = JSON.parse(readFileSync(fileURLToPath12(new URL(
108546
108588
  "../../vendor/shielded-x402-model/vectors/rust-vectors.json",
108547
108589
  new URL("__bundled_source__/wallet/src/pay/payResource.mjs", import.meta.url).href
108548
108590
  )), "utf8")).payerKeys.generator;
@@ -115783,7 +115825,7 @@ var init_floatRefundCheck = __esm({
115783
115825
  // wallet/src/unshield/cli.mjs
115784
115826
  import { randomBytes as randomBytes20 } from "node:crypto";
115785
115827
  import { resolve as resolve20 } from "node:path";
115786
- import { fileURLToPath as fileURLToPath12 } from "node:url";
115828
+ import { fileURLToPath as fileURLToPath13 } from "node:url";
115787
115829
  function facilitatorAnchor(origin, fetchImpl = fetch, { sleep: sleep5 = (ms) => new Promise((resolve43) => setTimeout(resolve43, ms)) } = {}) {
115788
115830
  noteAnchorOrigin(origin);
115789
115831
  const url = `${String(origin).replace(/\/+$/, "")}/api/x402/anchor`;
@@ -116287,7 +116329,7 @@ var init_cli = __esm({
116287
116329
  EXPIRED_PROOF_CLOCK_WAITS = 8;
116288
116330
  EXPIRED_PROOF_CLOCK_WAIT_MS = 15e3;
116289
116331
  EXIT_LEASE_WAIT_MS = 6e4;
116290
- if (process.argv[1] && resolve20(process.argv[1]) === fileURLToPath12(new URL("__bundled_source__/wallet/src/unshield/cli.mjs", import.meta.url).href)) {
116332
+ if (process.argv[1] && resolve20(process.argv[1]) === fileURLToPath13(new URL("__bundled_source__/wallet/src/unshield/cli.mjs", import.meta.url).href)) {
116291
116333
  main2().catch((error) => {
116292
116334
  console.error(describeCliErrorWithHint(error));
116293
116335
  process.exitCode = 1;
@@ -117017,7 +117059,7 @@ var init_migration = __esm({
117017
117059
 
117018
117060
  // wallet/src/pocket/cli.mjs
117019
117061
  import { resolve as resolve21 } from "node:path";
117020
- import { fileURLToPath as fileURLToPath13 } from "node:url";
117062
+ import { fileURLToPath as fileURLToPath14 } from "node:url";
117021
117063
  function parse3(command, args) {
117022
117064
  const spec = SPECS[command];
117023
117065
  const options = {};
@@ -117502,7 +117544,7 @@ var init_cli2 = __esm({
117502
117544
  } catch {
117503
117545
  }
117504
117546
  };
117505
- if (process.argv[1] && resolve21(process.argv[1]) === fileURLToPath13(new URL("__bundled_source__/wallet/src/pocket/cli.mjs", import.meta.url).href)) {
117547
+ if (process.argv[1] && resolve21(process.argv[1]) === fileURLToPath14(new URL("__bundled_source__/wallet/src/pocket/cli.mjs", import.meta.url).href)) {
117506
117548
  main3().catch((error) => {
117507
117549
  console.error(describeCliErrorWithHint(error, { fallback: "p03_pocket_cli_failed" }));
117508
117550
  process.exitCode = 1;
@@ -117836,7 +117878,7 @@ var init_autoPockets = __esm({
117836
117878
  });
117837
117879
 
117838
117880
  // wallet/src/move/job.mjs
117839
- import { fileURLToPath as fileURLToPath14 } from "node:url";
117881
+ import { fileURLToPath as fileURLToPath15 } from "node:url";
117840
117882
  import { randomBytes as randomBytes21 } from "node:crypto";
117841
117883
  function moveLegs(store, fromPool) {
117842
117884
  const prefix = moveWalPrefix(fromPool);
@@ -117951,7 +117993,7 @@ function moveBody({ amountAtomic, refundTo, fromPool, n, toPool }) {
117951
117993
  return { bodyText, moveId: hash10(bodyText) };
117952
117994
  }
117953
117995
  function walletEta2(store) {
117954
- const generator2 = JSON.parse(readFileSync(fileURLToPath14(new URL(
117996
+ const generator2 = JSON.parse(readFileSync(fileURLToPath15(new URL(
117955
117997
  "../../vendor/shielded-x402-model/vectors/rust-vectors.json",
117956
117998
  new URL("__bundled_source__/wallet/src/move/job.mjs", import.meta.url).href
117957
117999
  )), "utf8")).payerKeys.generator;
@@ -120408,7 +120450,7 @@ var init_leg = __esm({
120408
120450
  // wallet/src/succession/scheduler.mjs
120409
120451
  import { randomInt as cryptoRandomInt } from "node:crypto";
120410
120452
  import { dirname as dirname26, resolve as resolve23 } from "node:path";
120411
- import { fileURLToPath as fileURLToPath15 } from "node:url";
120453
+ import { fileURLToPath as fileURLToPath16 } from "node:url";
120412
120454
  function pocketCarryReason(carry) {
120413
120455
  if (carry && CARRY_DONE.has(carry.state)) return { done: true, waits: false, code: null, reason: "" };
120414
120456
  if (carry?.state !== "refused") return { done: false, waits: true, code: null, reason: "the wallet has not finished its check of the pool switch" };
@@ -121293,7 +121335,7 @@ var init_scheduler = __esm({
121293
121335
  const record = store.readWal(successionNoticeName(fromPool));
121294
121336
  return record?.schema === SUCCESSION_NOTICE_SCHEMA && record.from === fromPool && record.shown && typeof record.shown === "object" ? record.shown : {};
121295
121337
  };
121296
- MODEL_VECTORS = fileURLToPath15(new URL("../../vendor/shielded-x402-model/vectors/rust-vectors.json", new URL("__bundled_source__/wallet/src/succession/scheduler.mjs", import.meta.url).href));
121338
+ MODEL_VECTORS = fileURLToPath16(new URL("../../vendor/shielded-x402-model/vectors/rust-vectors.json", new URL("__bundled_source__/wallet/src/succession/scheduler.mjs", import.meta.url).href));
121297
121339
  pinnedGenerator6 = () => JSON.parse(readFileSync(MODEL_VECTORS, "utf8")).payerKeys.generator;
121298
121340
  yieldTurn3 = () => new Promise((resolveTurn) => {
121299
121341
  setImmediate(resolveTurn);
@@ -131792,7 +131834,7 @@ var init_jupiter = __esm({
131792
131834
  // wallet/src/mcp/tools.mjs
131793
131835
  import { randomBytes as randomBytes26, randomInt as randomInt7 } from "node:crypto";
131794
131836
  import { basename as basename9, dirname as dirname30, join as join34, resolve as resolve27 } from "node:path";
131795
- import { fileURLToPath as fileURLToPath16 } from "node:url";
131837
+ import { fileURLToPath as fileURLToPath17 } from "node:url";
131796
131838
  async function readReleasePoolsTwice(args) {
131797
131839
  try {
131798
131840
  return await readReleasePools(args);
@@ -133101,7 +133143,7 @@ function capHeldAtomic(one) {
133101
133143
  return parts.reduce((total, part) => total + BigInt(part), 0n);
133102
133144
  }
133103
133145
  function walletViewingEta(store) {
133104
- receiveGenerator ??= JSON.parse(readFileSync(fileURLToPath16(new URL(
133146
+ receiveGenerator ??= JSON.parse(readFileSync(fileURLToPath17(new URL(
133105
133147
  "../../vendor/shielded-x402-model/vectors/rust-vectors.json",
133106
133148
  new URL("__bundled_source__/wallet/src/mcp/tools.mjs", import.meta.url).href
133107
133149
  )), "utf8")).payerKeys.generator;
@@ -144302,7 +144344,7 @@ __export(stdioServer_exports, {
144302
144344
  });
144303
144345
  import { createHash as createHash33 } from "node:crypto";
144304
144346
  import { dirname as dirname31, join as join35, resolve as resolve28, sep as sep4 } from "node:path";
144305
- import { fileURLToPath as fileURLToPath17 } from "node:url";
144347
+ import { fileURLToPath as fileURLToPath18 } from "node:url";
144306
144348
  function createClientBridge() {
144307
144349
  const bridge = {
144308
144350
  capabilities: void 0,
@@ -144585,7 +144627,7 @@ function serveStdio({ input, output: output2, dispatch, log = () => {
144585
144627
  function runningBundleFile({ moduleUrl = new URL("__bundled_source__/wallet/src/mcp/stdioServer.mjs", import.meta.url).href, script = process.argv[1] } = {}) {
144586
144628
  let here3;
144587
144629
  try {
144588
- here3 = fileURLToPath17(moduleUrl);
144630
+ here3 = fileURLToPath18(moduleUrl);
144589
144631
  } catch {
144590
144632
  return void 0;
144591
144633
  }
@@ -147238,7 +147280,7 @@ var init_serveRunner = __esm({
147238
147280
  // wallet/src/pay/cli.mjs
147239
147281
  import { createHash as createHash34 } from "node:crypto";
147240
147282
  import { resolve as resolve30 } from "node:path";
147241
- import { fileURLToPath as fileURLToPath18 } from "node:url";
147283
+ import { fileURLToPath as fileURLToPath19 } from "node:url";
147242
147284
  async function main4(args = process.argv.slice(2)) {
147243
147285
  if (args.length === 1 && args[0] === "--help") {
147244
147286
  console.log(USAGE2);
@@ -147418,7 +147460,7 @@ var init_cli3 = __esm({
147418
147460
  init_errorLine();
147419
147461
  USAGE2 = "node --import tsx wallet/src/pay/cli.mjs --wallet <encrypted-file> --passphrase-file <file> [--rpc-file <file>] --proof-tools <manifest> --program <address> --url <seller-url> --request-id <stable-id> --maximum-atomic <amount> --memo-service <url> [--method GET|POST] [--body-file <private-file>] [--headers-file <private-json-object>] [--account-file <recovered-account-json>] [--out <private-file>] [--history-rpc <own|url>]";
147420
147462
  REQUIRED2 = ["wallet", "passphrase-file", "proof-tools", "program", "url", "request-id", "maximum-atomic", "memo-service"];
147421
- if (process.argv[1] && resolve30(process.argv[1]) === fileURLToPath18(new URL("__bundled_source__/wallet/src/pay/cli.mjs", import.meta.url).href)) {
147463
+ if (process.argv[1] && resolve30(process.argv[1]) === fileURLToPath19(new URL("__bundled_source__/wallet/src/pay/cli.mjs", import.meta.url).href)) {
147422
147464
  main4().catch((error) => {
147423
147465
  console.error(describeCliErrorWithHint(error));
147424
147466
  process.exitCode = 1;
@@ -151078,7 +151120,7 @@ __export(cli_exports, {
151078
151120
  startSeller: () => startSeller
151079
151121
  });
151080
151122
  import { join as join47, resolve as resolve40 } from "node:path";
151081
- import { fileURLToPath as fileURLToPath21 } from "node:url";
151123
+ import { fileURLToPath as fileURLToPath22 } from "node:url";
151082
151124
  async function startSeller(config, { fetchImpl = fetch, rpcFetch: rpcFetch2 } = {}) {
151083
151125
  let release;
151084
151126
  try {
@@ -151330,7 +151372,7 @@ var init_cli4 = __esm({
151330
151372
  return "?";
151331
151373
  }
151332
151374
  };
151333
- if (process.argv[1] && resolve40(process.argv[1]) === fileURLToPath21(new URL("__bundled_source__/wallet/src/seller/cli.mjs", import.meta.url).href)) {
151375
+ if (process.argv[1] && resolve40(process.argv[1]) === fileURLToPath22(new URL("__bundled_source__/wallet/src/seller/cli.mjs", import.meta.url).href)) {
151334
151376
  main7().catch(() => {
151335
151377
  console.error("p03_seller_start_failed");
151336
151378
  process.exitCode = 1;
@@ -151363,7 +151405,7 @@ init_timing();
151363
151405
  import { randomBytes as randomBytes34 } from "node:crypto";
151364
151406
  import { dirname as dirname37, join as join48, resolve as resolve41 } from "node:path";
151365
151407
  import { spawn as spawn13 } from "node:child_process";
151366
- import { fileURLToPath as fileURLToPath22 } from "node:url";
151408
+ import { fileURLToPath as fileURLToPath23 } from "node:url";
151367
151409
 
151368
151410
  // wallet/src/fetch/index.mjs
151369
151411
  init_session();
@@ -152423,7 +152465,7 @@ init_secretFile();
152423
152465
  init_usdcWords();
152424
152466
  init_commandName();
152425
152467
  import { resolve as resolve34 } from "node:path";
152426
- import { fileURLToPath as fileURLToPath19 } from "node:url";
152468
+ import { fileURLToPath as fileURLToPath20 } from "node:url";
152427
152469
  var usage = () => commandLine("prepare --wallet <encrypted-file> --passphrase-file <file> --program <address> [--dry-run] [--rpc-file <file>] --proof-tools <manifest> --profile <public-profile.json> --facilitator <https-origin> [--history-rpc <own|url>]");
152428
152470
  var VALUED = ["wallet", "passphrase-file", "program", "rpc-file", "proof-tools", "profile", "facilitator", "history-rpc"];
152429
152471
  var ALWAYS = ["wallet", "passphrase-file", "program"];
@@ -152568,7 +152610,7 @@ async function main5(args = process.argv.slice(2), { output: output2 = (result)
152568
152610
  await release();
152569
152611
  }
152570
152612
  }
152571
- if (process.argv[1] && resolve34(process.argv[1]) === fileURLToPath19(new URL("__bundled_source__/wallet/src/merge/cli.mjs", import.meta.url).href)) {
152613
+ if (process.argv[1] && resolve34(process.argv[1]) === fileURLToPath20(new URL("__bundled_source__/wallet/src/merge/cli.mjs", import.meta.url).href)) {
152572
152614
  main5().catch((error) => {
152573
152615
  console.error(describeCliErrorWithHint(error));
152574
152616
  process.exitCode = 1;
@@ -153158,7 +153200,7 @@ init_deposit();
153158
153200
  import { createPrivateKey as createPrivateKey3, sign as sign2 } from "node:crypto";
153159
153201
  import { createRequire } from "node:module";
153160
153202
  import { dirname as dirname35, join as join40, resolve as resolve36 } from "node:path";
153161
- import { fileURLToPath as fileURLToPath20, pathToFileURL as pathToFileURL2 } from "node:url";
153203
+ import { fileURLToPath as fileURLToPath21, pathToFileURL as pathToFileURL3 } from "node:url";
153162
153204
 
153163
153205
  // wallet/src/deposit/privacyCashLocal.mjs
153164
153206
  var import_web3136 = __toESM(require_index_cjs(), 1);
@@ -153166,7 +153208,7 @@ init_esm2();
153166
153208
  init_chain2();
153167
153209
  import { randomInt as randomInt9 } from "node:crypto";
153168
153210
  import { dirname as dirname34, join as join39 } from "node:path";
153169
- import { pathToFileURL } from "node:url";
153211
+ import { pathToFileURL as pathToFileURL2 } from "node:url";
153170
153212
  var PRIVACY_CASH_RELAY_SCHEMA = "carbon-shielded-x402/privacy-cash-relay/v1";
153171
153213
  var PRIVACY_CASH_RELAY_CONFIG_SCHEMA = "carbon-shielded-x402/privacy-cash-relay-config/v1";
153172
153214
  var MAX_TRANSACTION_BYTES = 1232;
@@ -153194,7 +153236,7 @@ var zeroPath = () => Array.from({ length: TREE_DEPTH2 }, () => "0");
153194
153236
  var toBeBytes = (decimal5) => Buffer.from(BigInt(decimal5).toString(16).padStart(64, "0"), "hex");
153195
153237
  async function loadPrivacyCashInternals(sdk, ids) {
153196
153238
  const dist = join39(dirname34(dirname34(sdk.keyBasePath)), "dist");
153197
- const load = (path) => import(pathToFileURL(join39(dist, path)).href);
153239
+ const load = (path) => import(pathToFileURL2(join39(dist, path)).href);
153198
153240
  const [{ Utxo }, { Keypair: UtxoKeypair }, prover, utils, encryption, constants2, { MerkleTree }] = await Promise.all([
153199
153241
  load("models/utxo.js"),
153200
153242
  load("models/keypair.js"),
@@ -154277,7 +154319,7 @@ async function quietly(operation) {
154277
154319
  }
154278
154320
  function sdkFolders(sdkDir) {
154279
154321
  if (sdkDir) return [resolve36(sdkDir)];
154280
- const folders = [fileURLToPath20(new URL("../../privacy-cash/", new URL("__bundled_source__/wallet/src/deposit/privacyCash.mjs", import.meta.url).href))];
154322
+ const folders = [fileURLToPath21(new URL("../../privacy-cash/", new URL("__bundled_source__/wallet/src/deposit/privacyCash.mjs", import.meta.url).href))];
154281
154323
  if (process.argv[1]) folders.push(resolve36(dirname35(process.argv[1]), "..", "privacy-cash"));
154282
154324
  return folders;
154283
154325
  }
@@ -154285,7 +154327,7 @@ function esmEntry(fromPackageDir, name) {
154285
154327
  const manifestPath3 = createRequire(join40(fromPackageDir, "package.json")).resolve(`${name}/package.json`);
154286
154328
  const entry = JSON.parse(readFileSync(manifestPath3, "utf8")).exports?.["."]?.import;
154287
154329
  if (typeof entry !== "string") fail45("sdk_missing");
154288
- return pathToFileURL2(join40(dirname35(manifestPath3), entry)).href;
154330
+ return pathToFileURL3(join40(dirname35(manifestPath3), entry)).href;
154289
154331
  }
154290
154332
  async function loadPrivacyCashSdk({ sdkDir } = {}) {
154291
154333
  if (!(Number(process.versions.node.split(".")[0]) >= 24)) fail45("node_too_old");
@@ -154303,7 +154345,7 @@ async function loadPrivacyCashSdk({ sdkDir } = {}) {
154303
154345
  if (!existsSync(`${keyBasePath}.wasm`) || !existsSync(`${keyBasePath}.zkey`)) fail45("sdk_circuit_missing");
154304
154346
  try {
154305
154347
  return await quietly(async () => {
154306
- const utils = await import(pathToFileURL2(join40(packageDir, "dist", "exportUtils.js")).href);
154348
+ const utils = await import(pathToFileURL3(join40(packageDir, "dist", "exportUtils.js")).href);
154307
154349
  const { WasmFactory } = await import(esmEntry(packageDir, "@lightprotocol/hasher.rs"));
154308
154350
  utils.setLogger(() => {
154309
154351
  });
@@ -157191,6 +157233,12 @@ var npmProxyEnvironment = (url) => ({
157191
157233
  NO_PROXY: "",
157192
157234
  no_proxy: ""
157193
157235
  });
157236
+ function withNoProxyArg(entry) {
157237
+ const at = entry.args.indexOf("npx");
157238
+ const index = entry.command === "npx" ? 0 : at + 1;
157239
+ if (entry.command !== "npx" && at < 0) return entry;
157240
+ return { ...entry, args: [...entry.args.slice(0, index), "--noproxy=", ...entry.args.slice(index)] };
157241
+ }
157194
157242
  var NPM_ONLINE_ENVIRONMENT = Object.freeze({ npm_config_offline: "false", npm_config_prefer_offline: "false", npm_config_prefer_online: "true" });
157195
157243
  var NPM_OFFLINE_ENVIRONMENT = Object.freeze({ npm_config_offline: "true" });
157196
157244
  var NPM_CACHE_KEYS = /* @__PURE__ */ new Set(["npm_config_cache", "npm_config_userconfig", "npm_config_globalconfig", "npm_config_prefix"]);
@@ -160363,7 +160411,7 @@ function validateMcp(values, env) {
160363
160411
  function requireMcpCaps(values) {
160364
160412
  for (const name of ["--max-payment", "--max-session"]) if (!values.has(name)) values.set(name, NO_LIMIT_ATOMIC);
160365
160413
  }
160366
- var CLI_FILE = fileURLToPath22(new URL("__bundled_source__/wallet/src/cli/shinjukuWallet.mjs", import.meta.url).href);
160414
+ var CLI_FILE = fileURLToPath23(new URL("__bundled_source__/wallet/src/cli/shinjukuWallet.mjs", import.meta.url).href);
160367
160415
  var cliEntry2;
160368
160416
  var setCliEntry = (file) => {
160369
160417
  cliEntry2 = typeof file === "string" && file ? file : void 0;
@@ -161688,7 +161736,7 @@ function hostStartCheck(app, options, deps, { terminal, noTor = false, cwd }) {
161688
161736
  `);
161689
161737
  const start = async (entry) => {
161690
161738
  if (!net4.url) return check(entry, { platform, env, terminal, extraEnv: NPM_ONLINE_ENVIRONMENT, ...at });
161691
- const filled = await check(entry, { platform, env, terminal, extraEnv: npmProxyEnvironment(net4.url), ...at });
161739
+ const filled = await check(withNoProxyArg(entry), { platform, env, terminal, extraEnv: npmProxyEnvironment(net4.url), ...at });
161692
161740
  if (!filled.ok) return filled;
161693
161741
  return check(entry, { platform, env, terminal, extraEnv: NPM_OFFLINE_ENVIRONMENT, ...at });
161694
161742
  };
@@ -161791,7 +161839,7 @@ ${claudeCodeLines({ ...claudeOptions, claudeProgram }).map((line) => ` ${line}`
161791
161839
  if (removed && status !== 0) status = runClaudeCli(claudeCodeArgs(options));
161792
161840
  if (status === 0) done.add(target);
161793
161841
  const homeNow = replacedOther ? ` Claude Code now uses the wallet in ${home}; the wallet in ${otherHome} is unchanged.` : "";
161794
- io.out(status === 0 ? `${removed ? "Replaced the wallet in" : "Added the wallet to"} Claude Code, for all your folders.${homeNow} ${allowWalletChecks(deps).say} ${RESTART_APP("Claude Code")}
161842
+ io.out(status === 0 ? `${removed ? "Replaced the wallet in" : "Added the wallet to"} Claude Code, for all your folders.${homeNow} ${allowWalletChecks(deps).say} ${RESTART_APP("Claude Code")}${noStartFolderWords(target, mcpServerEntry(options))}
161795
161843
  ` : `Claude Code did not take the server; its message is above. Run this yourself:
161796
161844
  ${claudeCodeLines({ ...claudeOptions, claudeProgram }).map((line) => ` ${line}`).join("\n")}
161797
161845
  ` + (removed ? `Setup removed the old ${MCP_SERVER_NAME} entry first, so Claude Code has none until that line runs.
@@ -161815,19 +161863,22 @@ ${claudeRemoveLines(claudeProgram, options.platform)}
161815
161863
  `);
161816
161864
  continue;
161817
161865
  }
161818
- const check = await hostStartCheck(app, options, deps, { terminal: false, noTor, ...target === "hermes" ? { cwd: resolve41(home) } : {} });
161866
+ const startFolder = hostStartFolder(target, mcpServerEntry(options));
161867
+ const check = await hostStartCheck(app, options, deps, { terminal: false, noTor, ...startFolder ? { cwd: startFolder } : {} });
161819
161868
  if (!check.ok) {
161820
161869
  io.out(`Not added to ${app}: ${hostCheckWords(app, check)}
161821
161870
  `);
161822
161871
  continue;
161823
161872
  }
161824
161873
  try {
161825
- const write = (entry, writeForce) => target === "codex" || target === "grok" ? addToCodexHost(file, entry, { force: writeForce, app }) : target === "hermes" ? addToHermesHost(file, entry, { force: writeForce }) : target === "continue" ? addToContinueHost(file, hostEntry(target, entry), { force: writeForce }) : addToJsonHost(file, hostEntry(target, entry), { force: writeForce, key: hostServersKey(target) });
161826
- const added = write(mcpServerEntry({ ...options, ...check.path ? { path: check.path } : {} }), force);
161874
+ const write = (entry, writeForce) => target === "codex" || target === "grok" ? addToCodexHost(file, hostEntry(target, entry, options.platform), { force: writeForce, app }) : target === "hermes" ? addToHermesHost(file, entry, { force: writeForce }) : target === "continue" ? addToContinueHost(file, hostEntry(target, entry, options.platform), { force: writeForce }) : addToJsonHost(file, hostEntry(target, entry, options.platform), { force: writeForce, key: hostServersKey(target) });
161875
+ const written = mcpServerEntry({ ...options, ...check.path ? { path: check.path } : {} });
161876
+ const added = write(written, force);
161877
+ const folderWords = noStartFolderWords(target, written);
161827
161878
  for (const old of added.replaced ?? []) io.out(`Replaced the old ${old} entry in ${app}.
161828
161879
  `);
161829
- io.out(!added.changed ? `${app} already has the wallet: ${file} (nothing changed). The wallet starts with this entry (checked). If ${app} does not show the wallet yet: ${hostAddedNext(target, app, options.platform)}
161830
- ` : `Added the wallet to ${app}: ${file}${added.backup ? ` (the old file was copied to ${added.backup}, readable by you alone)` : ""}. The wallet starts with this entry (checked). ${hostAddedNext(target, app, options.platform)}
161880
+ io.out(!added.changed ? `${app} already has the wallet: ${file} (nothing changed). The wallet starts with this entry (checked). If ${app} does not show the wallet yet: ${hostAddedNext(target, app, options.platform)}${folderWords}
161881
+ ` : `Added the wallet to ${app}: ${file}${added.backup ? ` (the old file was copied to ${added.backup}, readable by you alone)` : ""}. The wallet starts with this entry (checked). ${hostAddedNext(target, app, options.platform)}${folderWords}
161831
161882
  `);
161832
161883
  done.add(target);
161833
161884
  } catch (error) {
@@ -165317,7 +165368,7 @@ async function runTransferTokenCli(values, deps, io) {
165317
165368
  `);
165318
165369
  }
165319
165370
  function sellerIdentityOf(store) {
165320
- const generator2 = JSON.parse(readFileSync(fileURLToPath22(new URL(
165371
+ const generator2 = JSON.parse(readFileSync(fileURLToPath23(new URL(
165321
165372
  "../../vendor/shielded-x402-model/vectors/rust-vectors.json",
165322
165373
  new URL("__bundled_source__/wallet/src/cli/shinjukuWallet.mjs", import.meta.url).href
165323
165374
  )), "utf8")).payerKeys.generator;