@nextnext/mcp-server 0.1.7 → 0.2.1
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/dist/index.js +102 -38
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -102677,24 +102677,45 @@ var createIdentityTool = {
|
|
|
102677
102677
|
};
|
|
102678
102678
|
var getIdentityTool = {
|
|
102679
102679
|
name: "get_identity",
|
|
102680
|
-
description: "Check your current shopping identity and wallet status.",
|
|
102680
|
+
description: "Check your current shopping identity and wallet status. Include backupCode if you have one.",
|
|
102681
102681
|
inputSchema: {
|
|
102682
102682
|
type: "object",
|
|
102683
|
-
properties: {
|
|
102683
|
+
properties: {
|
|
102684
|
+
backupCode: {
|
|
102685
|
+
type: "string",
|
|
102686
|
+
description: "Your NextNext backup code (enc1.xxx). Include this if you have one."
|
|
102687
|
+
}
|
|
102688
|
+
},
|
|
102684
102689
|
required: []
|
|
102685
102690
|
},
|
|
102686
|
-
handler: async () => {
|
|
102687
|
-
const identity = getCurrentIdentity();
|
|
102691
|
+
handler: async (args) => {
|
|
102688
102692
|
const sessionId = getCurrentSessionId();
|
|
102693
|
+
const isStdioMode = sessionId === "stdio-local-session";
|
|
102694
|
+
let identity = null;
|
|
102695
|
+
if (isStdioMode) {
|
|
102696
|
+
identity = getCurrentIdentity();
|
|
102697
|
+
}
|
|
102698
|
+
if (!identity && args.backupCode) {
|
|
102699
|
+
try {
|
|
102700
|
+
await authenticateSession(args.backupCode);
|
|
102701
|
+
identity = getCurrentIdentity();
|
|
102702
|
+
console.error(`[get_identity] Authenticated with backup code`);
|
|
102703
|
+
} catch (error2) {
|
|
102704
|
+
console.error(`[get_identity] Auth failed: ${error2.message}`);
|
|
102705
|
+
}
|
|
102706
|
+
}
|
|
102689
102707
|
if (!identity) {
|
|
102690
102708
|
return {
|
|
102691
102709
|
content: [{
|
|
102692
102710
|
type: "text",
|
|
102693
102711
|
text: JSON.stringify({
|
|
102694
102712
|
status: "no_identity",
|
|
102695
|
-
|
|
102696
|
-
|
|
102697
|
-
|
|
102713
|
+
message: "No identity found. Include your backupCode if you have one.",
|
|
102714
|
+
solutions: [
|
|
102715
|
+
"1. If returning user: Include backupCode parameter",
|
|
102716
|
+
"2. If new user: Call create_identity() to get a backupCode"
|
|
102717
|
+
],
|
|
102718
|
+
example: 'get_identity(backupCode: "enc1.xxx...")'
|
|
102698
102719
|
}, null, 2)
|
|
102699
102720
|
}]
|
|
102700
102721
|
};
|
|
@@ -102729,40 +102750,68 @@ var identityTools = [
|
|
|
102729
102750
|
];
|
|
102730
102751
|
|
|
102731
102752
|
// src/tools/wallet-tools.ts
|
|
102753
|
+
init_context();
|
|
102754
|
+
function isStdioMode() {
|
|
102755
|
+
return getCurrentSessionId() === "stdio-local-session";
|
|
102756
|
+
}
|
|
102757
|
+
async function getIdentityForTool(backupCode) {
|
|
102758
|
+
if (isStdioMode()) {
|
|
102759
|
+
const sessionIdentity = getCurrentIdentity();
|
|
102760
|
+
if (sessionIdentity) {
|
|
102761
|
+
return sessionIdentity;
|
|
102762
|
+
}
|
|
102763
|
+
}
|
|
102764
|
+
if (backupCode) {
|
|
102765
|
+
try {
|
|
102766
|
+
await authenticateSession(backupCode);
|
|
102767
|
+
const identity = getCurrentIdentity();
|
|
102768
|
+
if (identity) {
|
|
102769
|
+
console.error(`[wallet-tools] Authenticated with backup code`);
|
|
102770
|
+
return identity;
|
|
102771
|
+
}
|
|
102772
|
+
} catch (error2) {
|
|
102773
|
+
console.error(`[wallet-tools] Auth failed: ${error2.message}`);
|
|
102774
|
+
}
|
|
102775
|
+
}
|
|
102776
|
+
return null;
|
|
102777
|
+
}
|
|
102732
102778
|
function identityRequiredResponse(toolName) {
|
|
102733
|
-
console.error(`[${toolName}] No identity
|
|
102779
|
+
console.error(`[${toolName}] No identity - backupCode required`);
|
|
102734
102780
|
return {
|
|
102735
102781
|
content: [{
|
|
102736
102782
|
type: "text",
|
|
102737
102783
|
text: JSON.stringify({
|
|
102738
102784
|
status: "identity_required",
|
|
102739
|
-
error: "
|
|
102740
|
-
whatHappened: "Your session was lost due to server restart/scaling. Your identity data is safe but needs to be re-linked.",
|
|
102785
|
+
error: "No identity provided. This tool requires your backupCode.",
|
|
102741
102786
|
solutions: [
|
|
102742
|
-
|
|
102743
|
-
"2. If new user: Call create_identity() first"
|
|
102787
|
+
"1. If returning user: Include backupCode parameter in this tool call",
|
|
102788
|
+
"2. If new user: Call create_identity() first to get a backupCode"
|
|
102744
102789
|
],
|
|
102745
|
-
|
|
102746
|
-
|
|
102790
|
+
example: `${toolName}(..., backupCode: "enc1.xxx...")`,
|
|
102791
|
+
hint: "The backupCode was given to you when you first created your identity. Include it in every tool call."
|
|
102747
102792
|
}, null, 2)
|
|
102748
102793
|
}]
|
|
102749
102794
|
};
|
|
102750
102795
|
}
|
|
102751
102796
|
var createBurnerWalletTool = {
|
|
102752
102797
|
name: "create_burner_wallet",
|
|
102753
|
-
description: "Create a new burner wallet for making payments. The wallet needs to be topped up with USDC before use.",
|
|
102798
|
+
description: "Create a new burner wallet for making payments. The wallet needs to be topped up with USDC before use. Include backupCode if you have one.",
|
|
102754
102799
|
inputSchema: {
|
|
102755
102800
|
type: "object",
|
|
102756
102801
|
properties: {
|
|
102757
102802
|
label: {
|
|
102758
102803
|
type: "string",
|
|
102759
102804
|
description: 'Optional label for the wallet (e.g., "shopping", "test")'
|
|
102805
|
+
},
|
|
102806
|
+
backupCode: {
|
|
102807
|
+
type: "string",
|
|
102808
|
+
description: "Your NextNext backup code (enc1.xxx). Include this if you have one. Get one from create_identity if new."
|
|
102760
102809
|
}
|
|
102761
102810
|
},
|
|
102762
102811
|
required: []
|
|
102763
102812
|
},
|
|
102764
102813
|
handler: async (args) => {
|
|
102765
|
-
const identity =
|
|
102814
|
+
const identity = await getIdentityForTool(args.backupCode);
|
|
102766
102815
|
if (!identity) {
|
|
102767
102816
|
return identityRequiredResponse("create_burner_wallet");
|
|
102768
102817
|
}
|
|
@@ -102791,13 +102840,17 @@ var createBurnerWalletTool = {
|
|
|
102791
102840
|
};
|
|
102792
102841
|
var getBurnerBalanceTool = {
|
|
102793
102842
|
name: "get_burner_balance",
|
|
102794
|
-
description: "Check the USDC and ETH balance of your wallet.",
|
|
102843
|
+
description: "Check the USDC and ETH balance of your wallet. Include backupCode if you have one.",
|
|
102795
102844
|
inputSchema: {
|
|
102796
102845
|
type: "object",
|
|
102797
102846
|
properties: {
|
|
102798
102847
|
walletId: {
|
|
102799
102848
|
type: "string",
|
|
102800
102849
|
description: "Optional: specific wallet ID. If not provided, uses your default identity-linked wallet."
|
|
102850
|
+
},
|
|
102851
|
+
backupCode: {
|
|
102852
|
+
type: "string",
|
|
102853
|
+
description: "Your NextNext backup code (enc1.xxx). Include this if you have one. Get one from create_identity if new."
|
|
102801
102854
|
}
|
|
102802
102855
|
},
|
|
102803
102856
|
required: []
|
|
@@ -102805,7 +102858,7 @@ var getBurnerBalanceTool = {
|
|
|
102805
102858
|
handler: async (args) => {
|
|
102806
102859
|
try {
|
|
102807
102860
|
let wallet;
|
|
102808
|
-
const identity =
|
|
102861
|
+
const identity = await getIdentityForTool(args.backupCode);
|
|
102809
102862
|
if (args.walletId) {
|
|
102810
102863
|
wallet = await getBurnerWallet(args.walletId);
|
|
102811
102864
|
if (!wallet) {
|
|
@@ -102857,14 +102910,19 @@ var getBurnerBalanceTool = {
|
|
|
102857
102910
|
};
|
|
102858
102911
|
var listBurnerWalletsTool = {
|
|
102859
102912
|
name: "list_burner_wallets",
|
|
102860
|
-
description: "List all burner wallets linked to your identity.",
|
|
102913
|
+
description: "List all burner wallets linked to your identity. Include backupCode if you have one.",
|
|
102861
102914
|
inputSchema: {
|
|
102862
102915
|
type: "object",
|
|
102863
|
-
properties: {
|
|
102916
|
+
properties: {
|
|
102917
|
+
backupCode: {
|
|
102918
|
+
type: "string",
|
|
102919
|
+
description: "Your NextNext backup code (enc1.xxx). Include this if you have one. Get one from create_identity if new."
|
|
102920
|
+
}
|
|
102921
|
+
},
|
|
102864
102922
|
required: []
|
|
102865
102923
|
},
|
|
102866
|
-
handler: async () => {
|
|
102867
|
-
const identity =
|
|
102924
|
+
handler: async (args) => {
|
|
102925
|
+
const identity = await getIdentityWithFallback(args.backupCode);
|
|
102868
102926
|
if (!identity) {
|
|
102869
102927
|
return identityRequiredResponse("list_burner_wallets");
|
|
102870
102928
|
}
|
|
@@ -102889,7 +102947,7 @@ var listBurnerWalletsTool = {
|
|
|
102889
102947
|
};
|
|
102890
102948
|
var paySellerTool = {
|
|
102891
102949
|
name: "pay_seller",
|
|
102892
|
-
description: "Pay a seller using gasless USDC transfer (x402/EIP-3009). Creates a signed authorization that the seller can submit on-chain. The buyer pays no gas.",
|
|
102950
|
+
description: "Pay a seller using gasless USDC transfer (x402/EIP-3009). Creates a signed authorization that the seller can submit on-chain. The buyer pays no gas. Include backupCode if you have one.",
|
|
102893
102951
|
inputSchema: {
|
|
102894
102952
|
type: "object",
|
|
102895
102953
|
properties: {
|
|
@@ -102908,13 +102966,17 @@ var paySellerTool = {
|
|
|
102908
102966
|
proposalId: {
|
|
102909
102967
|
type: "string",
|
|
102910
102968
|
description: "Optional: The proposal ID being paid for (for tracking)"
|
|
102969
|
+
},
|
|
102970
|
+
backupCode: {
|
|
102971
|
+
type: "string",
|
|
102972
|
+
description: "Your NextNext backup code (enc1.xxx). Include this if you have one. Get one from create_identity if new."
|
|
102911
102973
|
}
|
|
102912
102974
|
},
|
|
102913
102975
|
required: ["recipientAddress", "amount"]
|
|
102914
102976
|
},
|
|
102915
102977
|
handler: async (args) => {
|
|
102916
102978
|
try {
|
|
102917
|
-
const identity =
|
|
102979
|
+
const identity = await getIdentityForTool(args.backupCode);
|
|
102918
102980
|
if (!identity && !args.walletId) {
|
|
102919
102981
|
return identityRequiredResponse("pay_seller");
|
|
102920
102982
|
}
|
|
@@ -102999,7 +103061,7 @@ function getNostrClient() {
|
|
|
102999
103061
|
}
|
|
103000
103062
|
var postIntentTool = {
|
|
103001
103063
|
name: "post_intent",
|
|
103002
|
-
description: "Post a shopping intent to find products from sellers. Broadcasts your request to the seller network.
|
|
103064
|
+
description: "Post a shopping intent to find products from sellers. Broadcasts your request to the seller network. Include backupCode if you have one.",
|
|
103003
103065
|
inputSchema: {
|
|
103004
103066
|
type: "object",
|
|
103005
103067
|
properties: {
|
|
@@ -103018,40 +103080,42 @@ var postIntentTool = {
|
|
|
103018
103080
|
},
|
|
103019
103081
|
backupCode: {
|
|
103020
103082
|
type: "string",
|
|
103021
|
-
description: "
|
|
103083
|
+
description: "Your NextNext backup code (enc1.xxx). Include this if you have one. Get one from create_identity if new."
|
|
103022
103084
|
}
|
|
103023
103085
|
},
|
|
103024
103086
|
required: ["description", "budget"]
|
|
103025
103087
|
},
|
|
103026
103088
|
handler: async (args) => {
|
|
103027
|
-
|
|
103089
|
+
const { getCurrentSessionId: getCurrentSessionId2, authenticateSession: authenticateSession2 } = await Promise.resolve().then(() => (init_context(), exports_context));
|
|
103090
|
+
const isStdioMode2 = getCurrentSessionId2() === "stdio-local-session";
|
|
103091
|
+
let identity = null;
|
|
103092
|
+
if (isStdioMode2) {
|
|
103093
|
+
identity = getCurrentIdentity();
|
|
103094
|
+
}
|
|
103028
103095
|
const backupCode = args.backupCode || args.encryptedKey;
|
|
103029
103096
|
if (!identity && backupCode) {
|
|
103030
103097
|
try {
|
|
103031
|
-
const { authenticateSession: authenticateSession2 } = await Promise.resolve().then(() => (init_context(), exports_context));
|
|
103032
103098
|
await authenticateSession2(backupCode);
|
|
103033
103099
|
identity = getCurrentIdentity();
|
|
103034
|
-
console.error(`[post_intent]
|
|
103100
|
+
console.error(`[post_intent] Authenticated with backup code`);
|
|
103035
103101
|
} catch (error2) {
|
|
103036
|
-
console.error(`[post_intent]
|
|
103102
|
+
console.error(`[post_intent] Auth failed: ${error2.message}`);
|
|
103037
103103
|
}
|
|
103038
103104
|
}
|
|
103039
103105
|
if (!identity) {
|
|
103040
|
-
console.error(`[post_intent] No identity found
|
|
103106
|
+
console.error(`[post_intent] No identity found`);
|
|
103041
103107
|
return {
|
|
103042
103108
|
content: [{
|
|
103043
103109
|
type: "text",
|
|
103044
103110
|
text: JSON.stringify({
|
|
103045
103111
|
status: "identity_required",
|
|
103046
|
-
error: "
|
|
103047
|
-
whatHappened: "Your session was lost due to server restart/scaling. Your identity data is safe but needs to be re-linked.",
|
|
103112
|
+
error: "No identity found. Include your backupCode parameter.",
|
|
103048
103113
|
solutions: [
|
|
103049
|
-
|
|
103050
|
-
|
|
103051
|
-
"3. If new user: Call create_identity() first"
|
|
103114
|
+
"1. If returning user: Include backupCode parameter in this tool call",
|
|
103115
|
+
"2. If new user: Call create_identity() first to get a backupCode"
|
|
103052
103116
|
],
|
|
103053
|
-
|
|
103054
|
-
|
|
103117
|
+
example: 'post_intent(description: "...", budget: 100, backupCode: "enc1.xxx...")',
|
|
103118
|
+
hint: "The backupCode was given to you when you first created your identity."
|
|
103055
103119
|
}, null, 2)
|
|
103056
103120
|
}]
|
|
103057
103121
|
};
|