shinjuku-shield 0.3.245 → 0.3.246
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/manifest.json +4 -4
- package/package.json +3 -3
- package/shinjuku-wallet.mjs +55 -36
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ web services and AI answers from your private balance, so the payment does
|
|
|
8
8
|
not show who paid. It works inside your AI app (Claude, Cursor, Codex) and in
|
|
9
9
|
a terminal. Only you hold the keys: they never leave your computer.
|
|
10
10
|
|
|
11
|
-
This is version 0.3.
|
|
11
|
+
This is version 0.3.246. The command is `shinjuku`.
|
|
12
12
|
|
|
13
13
|
## Set up
|
|
14
14
|
|
|
@@ -112,7 +112,7 @@ Add it yourself. The name of the wallet in your app is `shinjuku`.
|
|
|
112
112
|
Claude Code:
|
|
113
113
|
|
|
114
114
|
```sh
|
|
115
|
-
claude mcp add --scope user shinjuku -- npx -y --prefer-offline --no-audit --no-fund shinjuku-shield@0.3.
|
|
115
|
+
claude mcp add --scope user shinjuku -- npx -y --prefer-offline --no-audit --no-fund shinjuku-shield@0.3.246 mcp
|
|
116
116
|
```
|
|
117
117
|
|
|
118
118
|
`--prefer-offline` runs the copy of the wallet that npm saved. If npm has not saved it yet, that start asks
|
|
@@ -131,7 +131,7 @@ with the Releases table in
|
|
|
131
131
|
Versions are published from GitHub Actions with npm provenance.
|
|
132
132
|
|
|
133
133
|
`shinjuku-shield` is the package that holds the wallet. `shinjuku-shielded`
|
|
134
|
-
0.3.
|
|
134
|
+
0.3.246, its older name, runs this package at the same version, so wallets
|
|
135
135
|
installed under that name keep updating. New installs use `shinjuku`.
|
|
136
136
|
|
|
137
137
|
The full guide is
|
package/manifest.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema": "carbon-shielded-wallet/bundle-manifest/v1",
|
|
3
3
|
"file": "shinjuku-wallet.mjs",
|
|
4
|
-
"sha256": "
|
|
5
|
-
"bytes":
|
|
6
|
-
"sourceCommit": "
|
|
4
|
+
"sha256": "e6713b6aec41d26eb5320d4a7dea93eb4bc9277c734d9a133f189344dd2f7707",
|
|
5
|
+
"bytes": 10760059,
|
|
6
|
+
"sourceCommit": "274525488440ff75f4d810ea501420f6ff8f2edf",
|
|
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",
|
|
@@ -2080,5 +2080,5 @@
|
|
|
2080
2080
|
}
|
|
2081
2081
|
]
|
|
2082
2082
|
},
|
|
2083
|
-
"publishedAt": "2026-11-
|
|
2083
|
+
"publishedAt": "2026-11-19T09:13:23.178Z"
|
|
2084
2084
|
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shinjuku-shield",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.246",
|
|
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": "e6713b6a",
|
|
7
|
+
"shinjukuSha256": "e6713b6aec41d26eb5320d4a7dea93eb4bc9277c734d9a133f189344dd2f7707",
|
|
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-wallet.mjs
CHANGED
|
@@ -61031,18 +61031,19 @@ function commandPathStep({ env = process.env, platform = process.platform, run:
|
|
|
61031
61031
|
function pathStepSays(step) {
|
|
61032
61032
|
return ["added", "failed", "profile"].includes(step?.state) || step?.state === "present" && step.thisWindow === false;
|
|
61033
61033
|
}
|
|
61034
|
-
function commandPathLines(step, hereLine, hereText = "In this window, type the longer command, for example:") {
|
|
61034
|
+
function commandPathLines(step, hereLine, hereText = "In this window, type the longer command, for example:", { nodeNote = "" } = {}) {
|
|
61035
61035
|
const here4 = [hereText, ` ${hereLine}`];
|
|
61036
61036
|
const windowsWord = typedCommandName(COMMAND_PACKAGE, "win32");
|
|
61037
|
+
const newWindow = nodeNote ? `${nodeNote} Then type ${windowsWord} in that new window.` : `Open a new window to type ${windowsWord}.`;
|
|
61037
61038
|
if (step?.state === "added") {
|
|
61038
|
-
return [step.broadcast === false ? `Added Shinjuku to your PATH
|
|
61039
|
+
return [step.broadcast === false ? `Added Shinjuku to your PATH.${nodeNote ? ` ${nodeNote}` : ""} Sign out of Windows and in again, then type ${windowsWord} in a new window.` : `Added Shinjuku to your PATH. ${newWindow}`, ...here4];
|
|
61039
61040
|
}
|
|
61040
|
-
if (step?.state === "present") return [`Shinjuku is on your PATH.
|
|
61041
|
+
if (step?.state === "present") return [`Shinjuku is on your PATH. ${newWindow}`, ...here4];
|
|
61041
61042
|
if (step?.state === "failed") {
|
|
61042
61043
|
return [
|
|
61043
61044
|
`Setup could not add Shinjuku to your PATH (${step.reason}). To add it yourself: open Start, type environment variables, open "Edit environment variables for your account", pick Path, choose Edit, then New, and paste this folder:`,
|
|
61044
61045
|
` ${step.folder}`,
|
|
61045
|
-
`Then open a new window to type ${windowsWord}.`,
|
|
61046
|
+
nodeNote ? `${nodeNote} Then type ${windowsWord} in that new window.` : `Then open a new window to type ${windowsWord}.`,
|
|
61046
61047
|
...here4
|
|
61047
61048
|
];
|
|
61048
61049
|
}
|
|
@@ -61198,6 +61199,11 @@ function agentCommandLine(words2, { npmVersion = ownNpmVersion(), code: code2 =
|
|
|
61198
61199
|
const line = install ? `${mark(install)} once (it installs the ${COMMAND_PACKAGE} command), then ${mark(command)}` : mark(command);
|
|
61199
61200
|
return needsNode ? `${line} (${needsNode})` : line;
|
|
61200
61201
|
}
|
|
61202
|
+
function nodeFirstSentence({ folder, env, platform = process.platform } = {}) {
|
|
61203
|
+
if (terminalFindsNode({ env, platform }) !== false) return "";
|
|
61204
|
+
if (folder && existsSync(join13(folder, "node.exe"))) return "";
|
|
61205
|
+
return NODE_FIRST_SENTENCE;
|
|
61206
|
+
}
|
|
61201
61207
|
function terminalFindsNode({ env, platform }) {
|
|
61202
61208
|
if (platform !== "win32" || platform !== process.platform || env !== void 0 && env !== process.env) return void 0;
|
|
61203
61209
|
const keys3 = terminalPathKeys();
|
|
@@ -61232,14 +61238,17 @@ function windowsNpmFolderOffPath({ env = process.env, platform = process.platfor
|
|
|
61232
61238
|
const onPath = shellPathEntries({ env, platform }).some((folder) => folder.trim() && folderKey2(folder) === folderKey2(prefix));
|
|
61233
61239
|
return onPath ? null : prefix;
|
|
61234
61240
|
}
|
|
61235
|
-
function notePathStep(state2) {
|
|
61241
|
+
function notePathStep(state2, folder) {
|
|
61236
61242
|
pathStepSaid = state2;
|
|
61243
|
+
pathStepFolder = folder;
|
|
61237
61244
|
}
|
|
61238
61245
|
function terminalUseLinesHere(npmVersion, options = {}) {
|
|
61239
61246
|
const platform = options.platform ?? process.platform;
|
|
61240
61247
|
const help = `${typedCommandName(COMMAND_PACKAGE, platform)} help`;
|
|
61241
61248
|
if (pathStepSaid && options.env === void 0) {
|
|
61249
|
+
const node3 = nodeFirstSentence({ folder: pathStepFolder, platform });
|
|
61242
61250
|
return [
|
|
61251
|
+
...node3 ? [node3] : [],
|
|
61243
61252
|
pathStepSaid === "profile" ? `After that profile line, a new terminal types ${help} and the other commands. In this terminal, type the longer command, for example:` : pathStepSaid === "failed" ? `After you add that folder to your PATH, a new window types ${help} and the other commands. In this window, type the longer command, for example:` : `Open a new window to type ${help} and the other commands. In this window, type the longer command, for example:`,
|
|
61244
61253
|
` ${oneTimeCommandLine("balance", npmVersion, { platform })}`
|
|
61245
61254
|
];
|
|
@@ -61305,7 +61314,7 @@ function olderInstalledCommand(npmVersion = ownNpmVersion(), options = {}) {
|
|
|
61305
61314
|
line: plain ? installCommandText({ platform }) : oneTimeCommandLine("setup", npmVersion, { platform })
|
|
61306
61315
|
};
|
|
61307
61316
|
}
|
|
61308
|
-
var versionSource, ownNpmVersion, runningNpmVersion, NPM_RUN_FOLDER, isRunnable, kept, keptTerminal, keptSame, NODE_FIRST_WORDS, folderKey2, pathStepSaid, OWN_PACKAGES, readPackage;
|
|
61317
|
+
var versionSource, ownNpmVersion, runningNpmVersion, NPM_RUN_FOLDER, isRunnable, kept, keptTerminal, keptSame, NODE_FIRST_WORDS, NODE_FIRST_SENTENCE, folderKey2, pathStepSaid, pathStepFolder, OWN_PACKAGES, readPackage;
|
|
61309
61318
|
var init_commandName = __esm({
|
|
61310
61319
|
"wallet/src/cli/commandName.mjs"() {
|
|
61311
61320
|
"use strict";
|
|
@@ -61332,6 +61341,7 @@ var init_commandName = __esm({
|
|
|
61332
61341
|
}
|
|
61333
61342
|
};
|
|
61334
61343
|
NODE_FIRST_WORDS = "first install Node.js 24 from https://nodejs.org: this terminal command needs it, and this computer has none yet; then open a new terminal window";
|
|
61344
|
+
NODE_FIRST_SENTENCE = "The shinjuku command needs Node.js, and this computer has none yet: first install Node.js 24 from https://nodejs.org, then open a new window.";
|
|
61335
61345
|
folderKey2 = (folder) => String(folder).trim().replace(/^"(.*)"$/, "$1").replace(/[\\/]+$/, "").toLowerCase();
|
|
61336
61346
|
OWN_PACKAGES = /* @__PURE__ */ new Set([...NPM_PACKAGE_NAMES, COMMAND_PACKAGE]);
|
|
61337
61347
|
readPackage = (file) => {
|
|
@@ -125743,7 +125753,7 @@ function linkSay(a) {
|
|
|
125743
125753
|
return programStartWords({ smartAppControl: a.smartAppControl === true, code: "UNKNOWN" }, { done: DEPOSIT_START_REFUSED_DONE }).say;
|
|
125744
125754
|
}
|
|
125745
125755
|
if (a.stage === "waiting" && a.landed === true) return "Your USDC went in, but its record step at Shinjuku did not finish. Nothing is lost; do not send it again. Ask me later.";
|
|
125746
|
-
return "The USDC is safe at the address and not private yet. Ask me for your balance in a minute; that tries again.";
|
|
125756
|
+
return "The USDC is safe at the address and not private yet. Ask me for your Shinjuku balance in a minute; that tries again.";
|
|
125747
125757
|
}
|
|
125748
125758
|
}
|
|
125749
125759
|
function realMove(move) {
|
|
@@ -126606,7 +126616,7 @@ var init_say = __esm({
|
|
|
126606
126616
|
init_updateWords();
|
|
126607
126617
|
init_programStart();
|
|
126608
126618
|
SAY_MAX_WORDS = 25;
|
|
126609
|
-
CHECK_FIRST = "Ask for your balance before you try again.";
|
|
126619
|
+
CHECK_FIRST = "Ask for your Shinjuku balance before you try again.";
|
|
126610
126620
|
MONEY_TOOLS = /* @__PURE__ */ new Set(["pay_for_service", "inference_chat", "wallet_unshield", "wallet_shield", "wallet_shield_from_elsewhere"]);
|
|
126611
126621
|
nextStepOf = (tool) => tool === void 0 || MONEY_TOOLS.has(tool) ? CHECK_FIRST : "Ask again.";
|
|
126612
126622
|
DECIMALS = 6;
|
|
@@ -143507,7 +143517,7 @@ function createAddFundsTool({
|
|
|
143507
143517
|
return `${prefix}Tell the user: the USDC is safe at this address and goes in only after an earlier add-funds request is closed or finishes: ${planBlockWords(answer.blockedBy)}, and it blocks new deposits. ${planBlockStep(answer.blockedBy)}.`;
|
|
143508
143518
|
}
|
|
143509
143519
|
if (answer.blockedBy) {
|
|
143510
|
-
return `${prefix}Tell the user: the USDC is safe at this address and goes in after an earlier deposit of this wallet finishes; ask about the balance in a few minutes.`;
|
|
143520
|
+
return `${prefix}Tell the user: the USDC is safe at this address and goes in after an earlier deposit of this wallet finishes; ask about the Shinjuku balance in a few minutes.`;
|
|
143511
143521
|
}
|
|
143512
143522
|
// falls through: a pending link with no known blocker keeps the words below
|
|
143513
143523
|
case "shielding":
|
|
@@ -144173,7 +144183,7 @@ function createBackup({ home, client, elicitTimeoutMs, unshown = () => false, lo
|
|
|
144173
144183
|
const unconfirmed = backupRecord(target);
|
|
144174
144184
|
if (unconfirmed) {
|
|
144175
144185
|
const noBox = asked.why === "unsupported";
|
|
144176
|
-
const say2 = `Your backup files are saved in ${unconfirmed.folder}, but you have not confirmed the backup yet. To confirm it, ${noBox ? "" : "say 'save my backup' and pick the place in the box this app shows, or "}run ${addFundsLine} in a terminal and answer its backup question.`;
|
|
144186
|
+
const say2 = `Your backup files are saved in ${unconfirmed.folder}, but you have not confirmed the backup yet. To confirm it, ${noBox ? "" : "say 'save my Shinjuku backup' and pick the place in the box this app shows, or "}run ${addFundsLine} in a terminal and answer its backup question.`;
|
|
144177
144187
|
return { refusal: json2({
|
|
144178
144188
|
say: say2,
|
|
144179
144189
|
ok: false,
|
|
@@ -144296,7 +144306,7 @@ function createBackup({ home, client, elicitTimeoutMs, unshown = () => false, lo
|
|
|
144296
144306
|
next: "The user chose no second copy in a box in this app. The backup in lastBackup stays the wallet's backup; never tell the user there is none."
|
|
144297
144307
|
});
|
|
144298
144308
|
if (asked.skipped) return json2({
|
|
144299
|
-
say: "No backup was saved. If this computer breaks, the money is lost. Say 'save my backup' at any time.",
|
|
144309
|
+
say: "No backup was saved. If this computer breaks, the money is lost. Say 'save my Shinjuku backup' at any time.",
|
|
144300
144310
|
ok: true,
|
|
144301
144311
|
skipped: true,
|
|
144302
144312
|
next: "The user chose no backup in a box in this app. Deposits can go on now."
|
|
@@ -144335,7 +144345,7 @@ var init_backupTool = __esm({
|
|
|
144335
144345
|
"use strict";
|
|
144336
144346
|
init_backup();
|
|
144337
144347
|
init_config();
|
|
144338
|
-
BACKUP_FIRST_SAY = "Before you add money, save a backup: plug in a USB stick and say 'save my backup'.";
|
|
144348
|
+
BACKUP_FIRST_SAY = "Before you add money, save a backup: plug in a USB stick and say 'save my Shinjuku backup'.";
|
|
144339
144349
|
BACKUP_WHERE_SAY = "Before you add money, save a backup of your wallet. Where should I save it: a USB stick (best: plug it in first), your Desktop, or your Documents folder?";
|
|
144340
144350
|
SKIP = "skip";
|
|
144341
144351
|
SKIP_WORDS = "Skip: no backup (you can lose your money if this computer breaks)";
|
|
@@ -151396,7 +151406,9 @@ ${canonical6}`;
|
|
|
151396
151406
|
const balance = {
|
|
151397
151407
|
name: "wallet_balance",
|
|
151398
151408
|
title: "Balance",
|
|
151399
|
-
|
|
151409
|
+
// Row 119 on 0.3.245 (Codex app, 2026-11-19): with another wallet connector on the account, Codex answered "what is my
|
|
151410
|
+
// balance" with that connector; this description names the Shinjuku, private and shielded balance (session-made, commit 0f3beb50b).
|
|
151411
|
+
description: `For "what is my balance" (Shinjuku, private, shielded): it answers ONE balance (balanceAtomic, what a payment can spend) and the public (unshielded) USDC. It ${BALANCE_READ_DOES}. On "show my wallet", print \`card\` as it is. largestPaymentAtomic: the most ONE payment can spend now; a payment above it is not refused: pay_for_service gets the balance ready first (a tell-first answer, then doneInMinutesLow to doneInMinutesHigh minutes) (changeSettling: 0 only while the last payment's change settles, about changeReadyInSeconds; then one payment can use it all, or up to changeUpToAtomic). balanceParts (above 1): never mention parts, accounts or a merge; say only that a large payment or send first gets the balance ready. balanceAtomic is one number; breakdown names the rest (shieldedAtomic is the same; privateSendPendingAtomic is what a running private send has not sent yet, already taken off; refundsInFlightAtomic is a refund Shinjuku proved, on its way, not in balanceAtomic; refundsNotCertainAtomic a refund the seller may have kept, in no number; openPaymentsAtomic: paid, waiting on its seller (same request_id finishes it, else refunded); setAsideAtomic (when not 0): value an older version set aside; totalAtomic adds these; during a pool move, pools lists each pool's share, movingAtomic is value on its way to the new pool, and move and poolSwitches show the move). unshieldedAtomic is the public USDC on the wallet's own Solana key (ownAddress), which wallet_shield makes private; unshieldedSolLamports is that key's SOL (Shinjuku pays every fee and rent). A stale balance (a new deposit, a received payment) reads the chain first; past about 20 s it answers the last balance with refreshing: true and finishes in the background (call again in 30 s); with a refreshReason that balance is exact and counts what the reason names (payment_settling: a payment that settles; account_join: all of it, while the wallet gets it ready to send; pool_move: value that arrives from the old pool; refund_check: a refund counted from an old read, which the wallet checks now (never say it is still on its way); first_check: a new wallet's own landed deposits (its first history check); own_send: the user's own send of ownSendAtomic is on its way, balanceAtomic null until it finishes). status reading (balanceAtomic null): the first read of a wallet that may hold money is not done; call again in 30 s. unshieldedAtomic null: not read now (unshieldedReason: tell the user that line). ownKeyTokens: the other tokens on ownAddress (not its USDC; [] when none; null when not read now: say nothing of other tokens), each { mint, amountAtomic, decimals, amount }, at most 10 (ownKeyTokensMore counts the rest); a token is its mint, never a name or symbol; no wallet tool sells, swaps or sends them: they stay on ownAddress. earlierDeposits (when any): USDC at an earlier pool's one-time deposit address, each with a notice line to tell the user; the wallet moves it itself. addFunds (when any): each open wallet_add_funds address, its state and the USDC known to wait there (heldAtomic; null with heldNote when not read in time). startsAtNextRequest true: it starts by itself once USDC is seen there (startsInMinutes; 0: at once). landingAtomic (when not 0): added USDC that landed on chain, not in balanceAtomic yet; this call finishes it (up to about 20 s), else call again when next says. incomingFromSalesAtomic (when not 0; incomingFromSalesPayments counts them): what buyers paid this wallet's sales, moving into the private balance by itself, not in balanceAtomic yet. session:the spending limits (null or "none": no limit), what is left, and how to change them (session.summary, only when a limit is set). With no limit set, say nothing about limits or counters. To add money, use wallet_add_funds. Amounts are atomic (1000000 = 1 USDC); say and usdc give USDC.`,
|
|
151400
151412
|
inputSchema: { type: "object", properties: {
|
|
151401
151413
|
verbose: { type: "boolean", description: "Optional. true adds `internal`: the engineering numbers (funded balance records, notes, payments without waiting, a 0 set-aside value). Default false." }
|
|
151402
151414
|
}, additionalProperties: false },
|
|
@@ -152001,19 +152013,19 @@ ${canonical6}`;
|
|
|
152001
152013
|
const unreadLinks = addFundsWaiting.filter((link3) => link3.heldAtomic === null);
|
|
152002
152014
|
const blockedArrivingNext = (links) => {
|
|
152003
152015
|
const plan = links.find((link3) => link3.blockedBy.kind === "plan");
|
|
152004
|
-
return plan ? `Tell the user: the USDC is safe at this address and goes in only after that earlier add-funds request is closed or finishes. ${planBlockStep(plan.blockedBy)}. Do not ask for a new address` : "Tell the user: the USDC is safe at this address and goes in after an earlier deposit of this wallet finishes; ask about the balance in a few minutes";
|
|
152016
|
+
return plan ? `Tell the user: the USDC is safe at this address and goes in only after that earlier add-funds request is closed or finishes. ${planBlockStep(plan.blockedBy)}. Do not ask for a new address` : "Tell the user: the USDC is safe at this address and goes in after an earlier deposit of this wallet finishes; ask about the Shinjuku balance in a few minutes";
|
|
152005
152017
|
};
|
|
152006
152018
|
const arrivingLine = (arriving) => {
|
|
152007
152019
|
const amount = /^[1-9][0-9]*$/.test(String(arriving.shieldingAtomic ?? "")) ? `${usdcText3(arriving.shieldingAtomic)} USDC` : /^[1-9][0-9]*$/.test(String(arriving.heldAtomic ?? "")) ? `${usdcText3(arriving.heldAtomic)} USDC` : "USDC (an amount still being read)";
|
|
152008
|
-
const when = arriving.blockedBy ? arriving.blockedBy.kind === "plan" ? `cannot go in yet: ${planBlockWords(arriving.blockedBy)}, and it blocks new deposits` : "is safe there; it goes in after an earlier deposit of this wallet finishes" : arriving.runnerDeposit === true ? "is becoming private now: the wallet's background process runs its deposit" : arriving.state === "shielding" && !arriving.startsAtNextRequest ? "is becoming private now (its deposit transaction was sent)" : arriving.startsInMinutes > 0 ? `becomes private by itself: its deposit starts in about ${minutesText2(arriving.startsInMinutes)}` : depositsAfterRoots ? "becomes private by itself: its deposit starts when the wallet has finished starting; ask again for the balance in a minute" : "becomes private by itself: its deposit starts now";
|
|
152020
|
+
const when = arriving.blockedBy ? arriving.blockedBy.kind === "plan" ? `cannot go in yet: ${planBlockWords(arriving.blockedBy)}, and it blocks new deposits` : "is safe there; it goes in after an earlier deposit of this wallet finishes" : arriving.runnerDeposit === true ? "is becoming private now: the wallet's background process runs its deposit" : arriving.state === "shielding" && !arriving.startsAtNextRequest ? "is becoming private now (its deposit transaction was sent)" : arriving.startsInMinutes > 0 ? `becomes private by itself: its deposit starts in about ${minutesText2(arriving.startsInMinutes)}` : depositsAfterRoots ? "becomes private by itself: its deposit starts when the wallet has finished starting; ask again for the Shinjuku balance in a minute" : "becomes private by itself: its deposit starts now";
|
|
152009
152021
|
return `${amount} arrived at add-funds address "${arriving.requestId}" and ${when}`;
|
|
152010
152022
|
};
|
|
152011
152023
|
const inWait = (arriving) => !(arriving.state === "shielding" && !arriving.startsAtNextRequest) && arriving.startsInMinutes > 0;
|
|
152012
152024
|
const runsOn = arrivingAll.some((arriving) => arriving.startsAtNextRequest === true) ? ` ${DEPOSIT_RUNS_ON}` : "";
|
|
152013
152025
|
if (arrivingAll.length === 1) {
|
|
152014
|
-
next = `${landedNext ? `${landedNext}. ` : ""}${arrivingLine(arrivingAll[0])}. ${inWait(arrivingAll[0]) ? "Tell the user it becomes private by itself at that time; they can ask about the balance after that to see it" : "Tell the user it becomes private by itself; they can ask about the balance to see it"}; do not hurry it.${runsOn} If balanceAtomic does not show it 10 minutes after that, call wallet_add_funds with request_id "${arrivingAll[0].requestId}": it finishes it now. Do not ask for a new address`;
|
|
152026
|
+
next = `${landedNext ? `${landedNext}. ` : ""}${arrivingLine(arrivingAll[0])}. ${inWait(arrivingAll[0]) ? "Tell the user it becomes private by itself at that time; they can ask about the Shinjuku balance after that to see it" : "Tell the user it becomes private by itself; they can ask about the Shinjuku balance to see it"}; do not hurry it.${runsOn} If balanceAtomic does not show it 10 minutes after that, call wallet_add_funds with request_id "${arrivingAll[0].requestId}": it finishes it now. Do not ask for a new address`;
|
|
152015
152027
|
} else if (arrivingAll.length > 1) {
|
|
152016
|
-
next = `${landedNext ? `${landedNext}. ` : ""}${arrivingAll.map(arrivingLine).join("; ")}. ${arrivingAll.some(inWait) ? "Tell the user the total; each becomes private by itself at the time named, and they can ask about the balance after that to see it" : "Tell the user the total; it becomes private by itself, and they can ask about the balance to see it"}; do not hurry it.${runsOn} If balanceAtomic does not show one 10 minutes after its time, call wallet_add_funds with its request_id: it finishes it now. Do not ask for a new address`;
|
|
152028
|
+
next = `${landedNext ? `${landedNext}. ` : ""}${arrivingAll.map(arrivingLine).join("; ")}. ${arrivingAll.some(inWait) ? "Tell the user the total; each becomes private by itself at the time named, and they can ask about the Shinjuku balance after that to see it" : "Tell the user the total; it becomes private by itself, and they can ask about the Shinjuku balance to see it"}; do not hurry it.${runsOn} If balanceAtomic does not show one 10 minutes after its time, call wallet_add_funds with its request_id: it finishes it now. Do not ask for a new address`;
|
|
152017
152029
|
} else if (arrivingBlocked.length) {
|
|
152018
152030
|
next = `${landedNext ? `${landedNext}. ` : ""}${arrivingBlocked.map(arrivingLine).join("; ")}. ${blockedArrivingNext(arrivingBlocked)}`;
|
|
152019
152031
|
} else if (one.balanceAtomic === "0" && addFundsWaiting.length) {
|
|
@@ -155129,11 +155141,12 @@ ${canonical6}`;
|
|
|
155129
155141
|
message: FUNDING_WALLET_QUESTION,
|
|
155130
155142
|
requestedSchema: {
|
|
155131
155143
|
type: "object",
|
|
155144
|
+
// Words that fit a checkbox and Yes/No buttons alike (Hermes shows the field as buttons; its 0.3.244 and 0.3.245
|
|
155145
|
+
// checks showed "Ticked/Unticked" and "Yes (ticked)/No (unticked)" beside them). Session-made, 2026-11-19.
|
|
155132
155146
|
properties: { another: {
|
|
155133
155147
|
type: "boolean",
|
|
155134
|
-
title: "Send to another wallet you own",
|
|
155135
|
-
|
|
155136
|
-
description: `Yes (ticked): nothing is sent now, and you name another wallet. No (unticked): send to ${job.to} anyway.`,
|
|
155148
|
+
title: "Send to another wallet you own?",
|
|
155149
|
+
description: `Yes: nothing is sent now, and you name another wallet. No: send to ${job.to} anyway.`,
|
|
155137
155150
|
default: true
|
|
155138
155151
|
} },
|
|
155139
155152
|
required: ["another"]
|
|
@@ -160270,11 +160283,12 @@ ${JSON.stringify(args ?? {})}`;
|
|
|
160270
160283
|
return tools;
|
|
160271
160284
|
}
|
|
160272
160285
|
function commandPathNext(step) {
|
|
160286
|
+
const node3 = step?.folder ? nodeFirstSentence({ folder: step.folder }) : "";
|
|
160273
160287
|
if (step?.state === "added") {
|
|
160274
|
-
return ` Setup added the shinjuku command's folder to the user's PATH. Tell the user: "Added Shinjuku to your PATH. Open a new window to type ${typedCommandName("shinjuku", "win32")}
|
|
160288
|
+
return ` Setup added the shinjuku command's folder to the user's PATH. Tell the user: "Added Shinjuku to your PATH. ${node3 ? `${node3} Then type ${typedCommandName("shinjuku", "win32")} in that new window.` : `Open a new window to type ${typedCommandName("shinjuku", "win32")}.`}"` + (step.broadcast === false ? " (If a new window still does not find it, sign out of Windows and in again.)" : "");
|
|
160275
160289
|
}
|
|
160276
160290
|
if (step?.state === "failed") {
|
|
160277
|
-
return ` The shinjuku command is in ${step.folder}, but setup could not add that folder to the user's PATH (${step.reason}). Tell the user: open Start, type environment variables, open "Edit environment variables for your account", pick Path, choose Edit, then New, paste ${step.folder}, and open a new window to type ${typedCommandName("shinjuku", "win32")}
|
|
160291
|
+
return ` The shinjuku command is in ${step.folder}, but setup could not add that folder to the user's PATH (${step.reason}). Tell the user: open Start, type environment variables, open "Edit environment variables for your account", pick Path, choose Edit, then New, paste ${step.folder}, and open a new window to type ${typedCommandName("shinjuku", "win32")}.` + (node3 ? ` Tell the user too: "${node3}"` : "");
|
|
160278
160292
|
}
|
|
160279
160293
|
if (step?.state === "profile") {
|
|
160280
160294
|
return ` The shinjuku command is in ${step.folder}, which the user's terminal does not search. Tell the user to add this line to the end of ${step.file}, then open a new terminal to type shinjuku: ${step.line}`;
|
|
@@ -160435,9 +160449,9 @@ function createSetupTools({
|
|
|
160435
160449
|
const file = summary.wallet.recoveryFile;
|
|
160436
160450
|
const limitLine = String(summary.caps.maxPayment) === NO_LIMIT_ATOMIC && String(summary.caps.maxSession) === NO_LIMIT_ATOMIC ? noLimitSetLine() : void 0;
|
|
160437
160451
|
const say2 = fitSay(file ? [`Your wallet is set up. ${BACKUP_FIRST_SAY}`] : [
|
|
160438
|
-
...limitLine ? [`Your wallet is set up. Ask to add funds. ${limitLine}`] : [],
|
|
160439
|
-
...chose2 ? [`Your wallet is set up (${chose2}). Ask to add funds to start.`] : [],
|
|
160440
|
-
"Your wallet is set up and ready. Ask to add funds to start."
|
|
160452
|
+
...limitLine ? [`Your Shinjuku wallet is set up. Ask to add funds. ${limitLine}`] : [],
|
|
160453
|
+
...chose2 ? [`Your Shinjuku wallet is set up (${chose2}). Ask to add funds to start.`] : [],
|
|
160454
|
+
"Your Shinjuku wallet is set up and ready. Ask to add funds to it to start."
|
|
160441
160455
|
]);
|
|
160442
160456
|
return json4({
|
|
160443
160457
|
say: say2,
|
|
@@ -160530,7 +160544,12 @@ function createSetupTools({
|
|
|
160530
160544
|
requestedSchema: {
|
|
160531
160545
|
type: "object",
|
|
160532
160546
|
properties: {
|
|
160533
|
-
confirm: {
|
|
160547
|
+
confirm: {
|
|
160548
|
+
type: "boolean",
|
|
160549
|
+
title: configDamaged ? "Repair the settings file (keeps the wallet)" : "Create the wallet",
|
|
160550
|
+
description: configDamaged ? "Untick to stop: nothing is changed." : "Untick to stop: nothing is created.",
|
|
160551
|
+
default: true
|
|
160552
|
+
},
|
|
160534
160553
|
...typeof torArg === "boolean" ? {} : { tor: { type: "boolean", title: SETUP_TOR_TITLE, description: `${SETUP_TOR_WHY} Setup downloads the wallet's files over Tor too.`, default: true } },
|
|
160535
160554
|
// Codex beginner audit 2026-11-03, item 6: the old title "Use private inference for your AI now" read as if this
|
|
160536
160555
|
// app's own chat turned private. It adds a private AI tool; the app's own chat does not change.
|
|
@@ -163531,7 +163550,7 @@ var init_stdioServer = __esm({
|
|
|
163531
163550
|
SUPPORTED_PROTOCOL_VERSIONS = Object.freeze(["2025-06-18", "2025-03-26", "2024-11-05"]);
|
|
163532
163551
|
MAX_LINE_BYTES = 4 * 1024 * 1024;
|
|
163533
163552
|
POSITIVE_ATOMIC7 = /^[1-9][0-9]{0,30}$/;
|
|
163534
|
-
INSTRUCTIONS_BASE = `A self-custody Shinjuku Shield wallet on this machine; no tool takes or returns its keys or passphrase. Each answer's say is one plain sentence for the user; other fields are data. Never tell the user a tool, field, code or protocol name (x402, MCP) unless told to. Map a plain request to one tool: "what is my balance" -> wallet_balance (starts no payment or new send; it finishes what is under way: added USDC into the user's private balance, a stopped earlier send to its address); "add money" / "deposit" / "move USDC in from Phantom or an exchange" -> wallet_add_funds (only gives a one-time address: nothing moves until the user sends USDC there; the next wallet_balance then moves it into their private balance); "shield the USDC on this wallet's own address" -> wallet_shield; "stop" / "cancel" -> wallet_cancel (the request_id of what to stop); "pay this URL" -> pay_for_service (no preview needed); "what does this URL cost" -> check_price (only when asked); "find a paid API for X" -> find_paid_services, then pay its url; "send 2 USDC to <address>" -> wallet_unshield; "show my payments" -> wallet_receipts; "sell, swap, or send a token other than USDC" -> no tool: this wallet does not do that, so say so and offer no sale; "which AI models" -> inference_models; "ask an AI model" -> inference_chat; "give my other AI app a private AI" -> inference_server action "start". wallet_balance answers ONE balance (balanceAtomic); pay_for_service pays any paid URL from it. Fields ending in Atomic count 1000000 per USDC; tell the user USDC. The wallet does its own upkeep. A shield, add-funds or unshield call can run for minutes: do as its next says. Pass your own request_id to pay_for_service: the same one never pays or moves money twice (a code ending in _retry_same_request: call again with it). pay_for_service never pays above the spending limits (one payment; 24 hours); with none, only the balance bounds it. Never claim a payment happened unless the answer has a transaction. After a pay or send call that stopped, failed, or this app calls rejected or interrupted, call wallet_receipts (a payment) or wallet_cancel (a send; no request_id) before you say whether it happened; never say nothing moved without that. Privacy: the chain does not show which wallet paid, but this app and its model provider see every URL, body, price and answer you handle; reach a seller or its domain only through these tools, never yourself (no curl, browser, DNS or DNS-over-HTTPS lookup), also when the user asks for no Tor: that shows their IP address to the site or a DNS company. When a poolSwitch.items[] item has tellUser true, tell the user its message once, in plain words; the wallet moves the balance itself.`;
|
|
163553
|
+
INSTRUCTIONS_BASE = `A self-custody Shinjuku Shield wallet on this machine; no tool takes or returns its keys or passphrase. Each answer's say is one plain sentence for the user; other fields are data. Never tell the user a tool, field, code or protocol name (x402, MCP) unless told to. Map a plain request to one tool: "what is my (Shinjuku) balance" -> wallet_balance (starts no payment or new send; it finishes what is under way: added USDC into the user's private balance, a stopped earlier send to its address); "add money" / "deposit" / "move USDC in from Phantom or an exchange" -> wallet_add_funds (only gives a one-time address: nothing moves until the user sends USDC there; the next wallet_balance then moves it into their private balance); "shield the USDC on this wallet's own address" -> wallet_shield; "stop" / "cancel" -> wallet_cancel (the request_id of what to stop); "pay this URL" -> pay_for_service (no preview needed); "what does this URL cost" -> check_price (only when asked); "find a paid API for X" -> find_paid_services, then pay its url; "send 2 USDC to <address>" -> wallet_unshield; "show my payments" -> wallet_receipts; "sell, swap, or send a token other than USDC" -> no tool: this wallet does not do that, so say so and offer no sale; "which AI models" -> inference_models; "ask an AI model" -> inference_chat; "give my other AI app a private AI" -> inference_server action "start". wallet_balance answers ONE balance (balanceAtomic); pay_for_service pays any paid URL from it. Fields ending in Atomic count 1000000 per USDC; tell the user USDC. The wallet does its own upkeep. A shield, add-funds or unshield call can run for minutes: do as its next says. Pass your own request_id to pay_for_service: the same one never pays or moves money twice (a code ending in _retry_same_request: call again with it). pay_for_service never pays above the spending limits (one payment; 24 hours); with none, only the balance bounds it. Never claim a payment happened unless the answer has a transaction. After a pay or send call that stopped, failed, or this app calls rejected or interrupted, call wallet_receipts (a payment) or wallet_cancel (a send; no request_id) before you say whether it happened; never say nothing moved without that. Privacy: the chain does not show which wallet paid, but this app and its model provider see every URL, body, price and answer you handle; reach a seller or its domain only through these tools, never yourself (no curl, browser, DNS or DNS-over-HTTPS lookup), also when the user asks for no Tor: that shows their IP address to the site or a DNS company. When a poolSwitch.items[] item has tellUser true, tell the user its message once, in plain words; the wallet moves the balance itself.`;
|
|
163535
163554
|
OWN_ADDRESS_LINE = '"Send to my (main) wallet": wallet_unshield with no to uses the address saved at setup; never ask for it.';
|
|
163536
163555
|
INSTRUCTIONS = `${INSTRUCTIONS_BASE} ${OWN_ADDRESS_LINE} ${HOST_BLOCKED_LINE}`;
|
|
163537
163556
|
MCP_LOG_LEVELS = Object.freeze(["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]);
|
|
@@ -174828,10 +174847,10 @@ function fundsView(store, plan, { now = Date.now(), running } = {}) {
|
|
|
174828
174847
|
fundedAccounts: Number.isSafeInteger(fundedAccounts2) ? fundedAccounts2 : null
|
|
174829
174848
|
} : null;
|
|
174830
174849
|
view2.status = "ready: " + (words2 ?? `your private balance is not known yet (${cli()} balance --pool ${store.state.pool} --refresh reads it)`) + (split4 > 1 && Number.isSafeInteger(fundedAccounts2) ? `; payments without waiting this epoch: up to ${fundedAccounts2} (one per funded deposit; ${cli()} balance says why)` : "");
|
|
174831
|
-
view2.next = process.env.SHINJUKU_WALLET_SETUP_NEXT_BY_PARENT === "1" ? SETUP_LINES_BELOW : inHomeJob() ? '\n Chat privately: press [t] on the home screen.\n In your agent app, ask "what is my balance".\n To add more money later: press [a] on the home screen.' : `
|
|
174850
|
+
view2.next = process.env.SHINJUKU_WALLET_SETUP_NEXT_BY_PARENT === "1" ? SETUP_LINES_BELOW : inHomeJob() ? '\n Chat privately: press [t] on the home screen.\n In your agent app, ask "what is my Shinjuku balance".\n To add more money later: press [a] on the home screen.' : `
|
|
174832
174851
|
Chat privately in this terminal: ${commandLine("chat")}
|
|
174833
174852
|
Use private AI from other apps: ${commandLine("infer start")}
|
|
174834
|
-
In your agent app, ask "what is my balance" or ask it to pay
|
|
174853
|
+
In your agent app, ask "what is my Shinjuku balance" or ask it to pay a URL with Shinjuku.
|
|
174835
174854
|
To add more money later: ${commandLine("add-funds")}`;
|
|
174836
174855
|
} else if (oldRouteStopped(store, plan) && !last?.stopped) {
|
|
174837
174856
|
view2.closed = true;
|
|
@@ -177475,9 +177494,9 @@ var GUIDE = Object.freeze({
|
|
|
177475
177494
|
});
|
|
177476
177495
|
var WALLET_FILE = `"$SHIELDED_WALLET_HOME/${GUIDE.pool}/wallet.json"`;
|
|
177477
177496
|
var FROM_SETUP = " (after setup, config.json gives it: no need to type it)";
|
|
177478
|
-
var SETUP_NEXT = inHomeJob() ? 'press [t] on the home screen to chat privately with an AI.\nOr open your agent app and ask "what is my balance".' : `chat privately with an AI in this terminal:
|
|
177497
|
+
var SETUP_NEXT = inHomeJob() ? 'press [t] on the home screen to chat privately with an AI.\nOr open your agent app and ask "what is my Shinjuku balance".' : `chat privately with an AI in this terminal:
|
|
177479
177498
|
${CLI_WORD} chat
|
|
177480
|
-
Or open your agent app and ask "what is my balance".`;
|
|
177499
|
+
Or open your agent app and ask "what is my Shinjuku balance".`;
|
|
177481
177500
|
var UNSHIELD_EXAMPLE = `${CLI_WORD} unshield --amount 0.5 --to <your wallet address>`;
|
|
177482
177501
|
function hintForThisRun(text3, values) {
|
|
177483
177502
|
let hint = String(text3);
|
|
@@ -181949,8 +181968,8 @@ function torNpxLine(words2, npmVersion, tunnelUrl, platform) {
|
|
|
181949
181968
|
function commandPathFix(deps, npmVersion, balanceLine2 = oneTimeCommandLine("balance", npmVersion), hereText) {
|
|
181950
181969
|
const step = commandPathStep({ env: deps.env ?? process.env, platform: deps.platform ?? process.platform });
|
|
181951
181970
|
if (pathStepSays(step)) {
|
|
181952
|
-
notePathStep(step.state);
|
|
181953
|
-
deps.io.out(`${commandPathLines(step, balanceLine2, hereText).join("\n")}
|
|
181971
|
+
notePathStep(step.state, step.folder);
|
|
181972
|
+
deps.io.out(`${commandPathLines(step, balanceLine2, hereText, { nodeNote: nodeFirstSentence({ folder: step.folder }) }).join("\n")}
|
|
181954
181973
|
|
|
181955
181974
|
`);
|
|
181956
181975
|
}
|
|
@@ -181992,7 +182011,7 @@ ${later(when)}
|
|
|
181992
182011
|
|
|
181993
182012
|
`);
|
|
181994
182013
|
} else if (result === "installed") {
|
|
181995
|
-
io.out(`npm installed version ${npmVersion}, but setup could not read the version of the shinjuku command this terminal finds. To check, run ${CLI_TYPED} version in a new window: it should say ${npmVersion}
|
|
182014
|
+
io.out(`npm installed version ${npmVersion}, but setup could not read the version of the shinjuku command this terminal finds. To check, run ${CLI_TYPED} version in a new window: it should say ${npmVersion}.${nodeFirstSentence() ? ` ${nodeFirstSentence()}` : ""} The longer command below works the same.${report.balanceLead}
|
|
181996
182015
|
${report.balanceLine}
|
|
181997
182016
|
|
|
181998
182017
|
`);
|
|
@@ -187867,7 +187886,7 @@ ${HOST_TARGETS.map((host, index) => ` ${index + 1} ${hostNames[host] ?? host}`
|
|
|
187867
187886
|
appLine: true,
|
|
187868
187887
|
npmArgs: npmPrefixArgs(setupHome(deps.env), platform).map((word2) => hostShellWord(word2, platform))
|
|
187869
187888
|
})}`,
|
|
187870
|
-
'Then restart the app and ask it "what is my balance".',
|
|
187889
|
+
'Then restart the app and ask it "what is my Shinjuku balance".',
|
|
187871
187890
|
""
|
|
187872
187891
|
].join("\n"));
|
|
187873
187892
|
return 0;
|
|
@@ -187883,7 +187902,7 @@ ${HOST_TARGETS.map((host, index) => ` ${index + 1} ${hostNames[host] ?? host}`
|
|
|
187883
187902
|
const hosts = await addToHosts([host], home, deps, { npmVersion, ask: deps.stdinIsTTY() ? deps.ask : void 0 });
|
|
187884
187903
|
if (hosts.kept.has(host)) return 0;
|
|
187885
187904
|
if (hosts.added.has(host)) {
|
|
187886
|
-
io.out(`Next: ask ${hostNames[host]} "what is my balance".
|
|
187905
|
+
io.out(`Next: ask ${hostNames[host]} "what is my Shinjuku balance".
|
|
187887
187906
|
`);
|
|
187888
187907
|
return 0;
|
|
187889
187908
|
}
|