@totalreclaw/mcp-server 1.0.0
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 +113 -0
- package/dist/cli/setup.d.ts +43 -0
- package/dist/cli/setup.d.ts.map +1 -0
- package/dist/cli/setup.js +276 -0
- package/dist/cli/setup.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +700 -0
- package/dist/index.js.map +1 -0
- package/dist/prompts.d.ts +27 -0
- package/dist/prompts.d.ts.map +1 -0
- package/dist/prompts.js +219 -0
- package/dist/prompts.js.map +1 -0
- package/dist/resources/index.d.ts +2 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +8 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/resources/memory-context.d.ts +16 -0
- package/dist/resources/memory-context.d.ts.map +1 -0
- package/dist/resources/memory-context.js +111 -0
- package/dist/resources/memory-context.js.map +1 -0
- package/dist/server.d.ts +4 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +25 -0
- package/dist/server.js.map +1 -0
- package/dist/subgraph/crypto.d.ts +106 -0
- package/dist/subgraph/crypto.d.ts.map +1 -0
- package/dist/subgraph/crypto.js +287 -0
- package/dist/subgraph/crypto.js.map +1 -0
- package/dist/subgraph/embedding.d.ts +47 -0
- package/dist/subgraph/embedding.d.ts.map +1 -0
- package/dist/subgraph/embedding.js +77 -0
- package/dist/subgraph/embedding.js.map +1 -0
- package/dist/subgraph/index.d.ts +7 -0
- package/dist/subgraph/index.d.ts.map +1 -0
- package/dist/subgraph/index.js +23 -0
- package/dist/subgraph/index.js.map +1 -0
- package/dist/subgraph/lsh.d.ts +95 -0
- package/dist/subgraph/lsh.d.ts.map +1 -0
- package/dist/subgraph/lsh.js +211 -0
- package/dist/subgraph/lsh.js.map +1 -0
- package/dist/subgraph/reranker.d.ts +157 -0
- package/dist/subgraph/reranker.d.ts.map +1 -0
- package/dist/subgraph/reranker.js +427 -0
- package/dist/subgraph/reranker.js.map +1 -0
- package/dist/subgraph/search.d.ts +62 -0
- package/dist/subgraph/search.d.ts.map +1 -0
- package/dist/subgraph/search.js +208 -0
- package/dist/subgraph/search.js.map +1 -0
- package/dist/subgraph/store.d.ts +97 -0
- package/dist/subgraph/store.d.ts.map +1 -0
- package/dist/subgraph/store.js +270 -0
- package/dist/subgraph/store.js.map +1 -0
- package/dist/tools/export.d.ts +48 -0
- package/dist/tools/export.d.ts.map +1 -0
- package/dist/tools/export.js +126 -0
- package/dist/tools/export.js.map +1 -0
- package/dist/tools/forget.d.ts +43 -0
- package/dist/tools/forget.d.ts.map +1 -0
- package/dist/tools/forget.js +96 -0
- package/dist/tools/forget.js.map +1 -0
- package/dist/tools/import.d.ts +73 -0
- package/dist/tools/import.d.ts.map +1 -0
- package/dist/tools/import.js +248 -0
- package/dist/tools/import.js.map +1 -0
- package/dist/tools/index.d.ts +8 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +25 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/recall.d.ts +65 -0
- package/dist/tools/recall.d.ts.map +1 -0
- package/dist/tools/recall.js +113 -0
- package/dist/tools/recall.js.map +1 -0
- package/dist/tools/remember.d.ts +109 -0
- package/dist/tools/remember.d.ts.map +1 -0
- package/dist/tools/remember.js +227 -0
- package/dist/tools/remember.js.map +1 -0
- package/dist/tools/status.d.ts +43 -0
- package/dist/tools/status.d.ts.map +1 -0
- package/dist/tools/status.js +110 -0
- package/dist/tools/status.js.map +1 -0
- package/dist/tools/upgrade.d.ts +48 -0
- package/dist/tools/upgrade.d.ts.map +1 -0
- package/dist/tools/upgrade.js +122 -0
- package/dist/tools/upgrade.js.map +1 -0
- package/package.json +61 -0
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* TotalReclaw MCP - Billing Status Tool
|
|
4
|
+
*
|
|
5
|
+
* Shows subscription/billing status for the user's account.
|
|
6
|
+
* Queries the relay server's billing endpoint.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.statusToolDefinition = void 0;
|
|
10
|
+
exports.handleStatus = handleStatus;
|
|
11
|
+
const prompts_js_1 = require("../prompts.js");
|
|
12
|
+
exports.statusToolDefinition = {
|
|
13
|
+
name: 'totalreclaw_status',
|
|
14
|
+
description: prompts_js_1.STATUS_TOOL_DESCRIPTION,
|
|
15
|
+
inputSchema: {
|
|
16
|
+
type: 'object',
|
|
17
|
+
properties: {
|
|
18
|
+
wallet_address: {
|
|
19
|
+
type: 'string',
|
|
20
|
+
description: 'Smart Account address (derived from seed phrase)',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
required: ['wallet_address'],
|
|
24
|
+
},
|
|
25
|
+
annotations: {
|
|
26
|
+
readOnlyHint: true,
|
|
27
|
+
destructiveHint: false,
|
|
28
|
+
idempotentHint: true,
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Handle a totalreclaw_status tool call.
|
|
33
|
+
*
|
|
34
|
+
* Fetches billing status from the relay server and formats it for the LLM.
|
|
35
|
+
*/
|
|
36
|
+
async function handleStatus(serverUrl, authKey, args) {
|
|
37
|
+
const input = args;
|
|
38
|
+
const walletAddress = input?.wallet_address;
|
|
39
|
+
if (!walletAddress || typeof walletAddress !== 'string') {
|
|
40
|
+
return {
|
|
41
|
+
content: [{
|
|
42
|
+
type: 'text',
|
|
43
|
+
text: JSON.stringify({
|
|
44
|
+
error: 'wallet_address is required',
|
|
45
|
+
}),
|
|
46
|
+
}],
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
try {
|
|
50
|
+
const url = `${serverUrl.replace(/\/+$/, '')}/v1/billing/status?wallet_address=${encodeURIComponent(walletAddress)}`;
|
|
51
|
+
const response = await fetch(url, {
|
|
52
|
+
method: 'GET',
|
|
53
|
+
headers: {
|
|
54
|
+
'Authorization': `Bearer ${authKey}`,
|
|
55
|
+
'Content-Type': 'application/json',
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
if (!response.ok) {
|
|
59
|
+
const body = await response.text().catch(() => '');
|
|
60
|
+
return {
|
|
61
|
+
content: [{
|
|
62
|
+
type: 'text',
|
|
63
|
+
text: JSON.stringify({
|
|
64
|
+
error: `Failed to fetch billing status (HTTP ${response.status})`,
|
|
65
|
+
details: body || response.statusText,
|
|
66
|
+
}),
|
|
67
|
+
}],
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
const data = (await response.json());
|
|
71
|
+
// Format nicely for the LLM to present
|
|
72
|
+
const tierLabel = data.tier === 'pro' ? 'Pro' : 'Free';
|
|
73
|
+
const usage = `${data.free_writes_used}/${data.free_writes_limit}`;
|
|
74
|
+
const remaining = data.free_writes_limit - data.free_writes_used;
|
|
75
|
+
const expiresLabel = data.expires_at
|
|
76
|
+
? `Expires: ${new Date(data.expires_at).toLocaleDateString()}`
|
|
77
|
+
: 'No expiry';
|
|
78
|
+
const formatted = [
|
|
79
|
+
`Tier: ${tierLabel}`,
|
|
80
|
+
`Writes used: ${usage}`,
|
|
81
|
+
`Remaining: ${remaining}`,
|
|
82
|
+
expiresLabel,
|
|
83
|
+
].join('\n');
|
|
84
|
+
return {
|
|
85
|
+
content: [{
|
|
86
|
+
type: 'text',
|
|
87
|
+
text: JSON.stringify({
|
|
88
|
+
tier: data.tier,
|
|
89
|
+
free_writes_used: data.free_writes_used,
|
|
90
|
+
free_writes_limit: data.free_writes_limit,
|
|
91
|
+
remaining_writes: remaining,
|
|
92
|
+
expires_at: data.expires_at,
|
|
93
|
+
formatted,
|
|
94
|
+
}),
|
|
95
|
+
}],
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
catch (error) {
|
|
99
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
100
|
+
return {
|
|
101
|
+
content: [{
|
|
102
|
+
type: 'text',
|
|
103
|
+
text: JSON.stringify({
|
|
104
|
+
error: `Failed to check billing status: ${message}`,
|
|
105
|
+
}),
|
|
106
|
+
}],
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/tools/status.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAoCH,oCAoFC;AAtHD,8CAAwD;AAE3C,QAAA,oBAAoB,GAAG;IAClC,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,oCAAuB;IACpC,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,cAAc,EAAE;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,kDAAkD;aAChE;SACF;QACD,QAAQ,EAAE,CAAC,gBAAgB,CAAC;KAC7B;IACD,WAAW,EAAE;QACX,YAAY,EAAE,IAAI;QAClB,eAAe,EAAE,KAAK;QACtB,cAAc,EAAE,IAAI;KACrB;CACF,CAAC;AASF;;;;GAIG;AACI,KAAK,UAAU,YAAY,CAChC,SAAiB,EACjB,OAAe,EACf,IAAa;IAEb,MAAM,KAAK,GAAG,IAA+B,CAAC;IAC9C,MAAM,aAAa,GAAG,KAAK,EAAE,cAAwB,CAAC;IAEtD,IAAI,CAAC,aAAa,IAAI,OAAO,aAAa,KAAK,QAAQ,EAAE,CAAC;QACxD,OAAO;YACL,OAAO,EAAE,CAAC;oBACR,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;wBACnB,KAAK,EAAE,4BAA4B;qBACpC,CAAC;iBACH,CAAC;SACH,CAAC;IACJ,CAAC;IAED,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,GAAG,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,qCAAqC,kBAAkB,CAAC,aAAa,CAAC,EAAE,CAAC;QAErH,MAAM,QAA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,IAAI,CAAC,IAAI,CAAC,CAAC;QAEb,OAAO;YACL,OAAO,EAAE,CAAC;oBACR,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;wBACnB,IAAI,EAAE,IAAI,CAAC,IAAI;wBACf,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;wBACvC,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;wBACzC,gBAAgB,EAAE,SAAS;wBAC3B,UAAU,EAAE,IAAI,CAAC,UAAU;wBAC3B,SAAS;qBACV,CAAC;iBACH,CAAC;SACH,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;QACzE,OAAO;YACL,OAAO,EAAE,CAAC;oBACR,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;wBACnB,KAAK,EAAE,mCAAmC,OAAO,EAAE;qBACpD,CAAC;iBACH,CAAC;SACH,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TotalReclaw MCP - Billing Upgrade Tool
|
|
3
|
+
*
|
|
4
|
+
* Creates a checkout session for upgrading to Pro tier.
|
|
5
|
+
* Supports both Stripe (card) and Coinbase Commerce (crypto) payment methods.
|
|
6
|
+
*/
|
|
7
|
+
export declare const upgradeToolDefinition: {
|
|
8
|
+
name: string;
|
|
9
|
+
description: string;
|
|
10
|
+
inputSchema: {
|
|
11
|
+
type: string;
|
|
12
|
+
properties: {
|
|
13
|
+
wallet_address: {
|
|
14
|
+
type: string;
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
payment_method: {
|
|
18
|
+
type: string;
|
|
19
|
+
enum: string[];
|
|
20
|
+
default: string;
|
|
21
|
+
description: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
required: string[];
|
|
25
|
+
};
|
|
26
|
+
annotations: {
|
|
27
|
+
readOnlyHint: boolean;
|
|
28
|
+
destructiveHint: boolean;
|
|
29
|
+
idempotentHint: boolean;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
export interface CheckoutResponse {
|
|
33
|
+
checkout_url: string;
|
|
34
|
+
session_id?: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Handle a totalreclaw_upgrade tool call.
|
|
38
|
+
*
|
|
39
|
+
* Creates a checkout session via the relay server and returns
|
|
40
|
+
* the checkout URL for the user to complete payment.
|
|
41
|
+
*/
|
|
42
|
+
export declare function handleUpgrade(serverUrl: string, authKey: string, args: unknown): Promise<{
|
|
43
|
+
content: Array<{
|
|
44
|
+
type: string;
|
|
45
|
+
text: string;
|
|
46
|
+
}>;
|
|
47
|
+
}>;
|
|
48
|
+
//# sourceMappingURL=upgrade.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upgrade.d.ts","sourceRoot":"","sources":["../../src/tools/upgrade.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;CAwBjC,CAAC;AAEF,MAAM,WAAW,gBAAgB;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;GAKG;AACH,wBAAsB,aAAa,CACjC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,OAAO,GACZ,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CAqF7D"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* TotalReclaw MCP - Billing Upgrade Tool
|
|
4
|
+
*
|
|
5
|
+
* Creates a checkout session for upgrading to Pro tier.
|
|
6
|
+
* Supports both Stripe (card) and Coinbase Commerce (crypto) payment methods.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.upgradeToolDefinition = void 0;
|
|
10
|
+
exports.handleUpgrade = handleUpgrade;
|
|
11
|
+
const prompts_js_1 = require("../prompts.js");
|
|
12
|
+
exports.upgradeToolDefinition = {
|
|
13
|
+
name: 'totalreclaw_upgrade',
|
|
14
|
+
description: prompts_js_1.UPGRADE_TOOL_DESCRIPTION,
|
|
15
|
+
inputSchema: {
|
|
16
|
+
type: 'object',
|
|
17
|
+
properties: {
|
|
18
|
+
wallet_address: {
|
|
19
|
+
type: 'string',
|
|
20
|
+
description: 'Smart Account address',
|
|
21
|
+
},
|
|
22
|
+
payment_method: {
|
|
23
|
+
type: 'string',
|
|
24
|
+
enum: ['card', 'crypto'],
|
|
25
|
+
default: 'card',
|
|
26
|
+
description: 'Payment method preference',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
required: ['wallet_address'],
|
|
30
|
+
},
|
|
31
|
+
annotations: {
|
|
32
|
+
readOnlyHint: false,
|
|
33
|
+
destructiveHint: false,
|
|
34
|
+
idempotentHint: false,
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Handle a totalreclaw_upgrade tool call.
|
|
39
|
+
*
|
|
40
|
+
* Creates a checkout session via the relay server and returns
|
|
41
|
+
* the checkout URL for the user to complete payment.
|
|
42
|
+
*/
|
|
43
|
+
async function handleUpgrade(serverUrl, authKey, args) {
|
|
44
|
+
const input = args;
|
|
45
|
+
const walletAddress = input?.wallet_address;
|
|
46
|
+
const paymentMethod = input?.payment_method || 'card';
|
|
47
|
+
if (!walletAddress || typeof walletAddress !== 'string') {
|
|
48
|
+
return {
|
|
49
|
+
content: [{
|
|
50
|
+
type: 'text',
|
|
51
|
+
text: JSON.stringify({
|
|
52
|
+
error: 'wallet_address is required',
|
|
53
|
+
}),
|
|
54
|
+
}],
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
if (paymentMethod !== 'card' && paymentMethod !== 'crypto') {
|
|
58
|
+
return {
|
|
59
|
+
content: [{
|
|
60
|
+
type: 'text',
|
|
61
|
+
text: JSON.stringify({
|
|
62
|
+
error: 'payment_method must be "card" or "crypto"',
|
|
63
|
+
}),
|
|
64
|
+
}],
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
try {
|
|
68
|
+
const baseUrl = serverUrl.replace(/\/+$/, '');
|
|
69
|
+
const endpoint = paymentMethod === 'crypto'
|
|
70
|
+
? `${baseUrl}/v1/billing/checkout/crypto`
|
|
71
|
+
: `${baseUrl}/v1/billing/checkout`;
|
|
72
|
+
const response = await fetch(endpoint, {
|
|
73
|
+
method: 'POST',
|
|
74
|
+
headers: {
|
|
75
|
+
'Authorization': `Bearer ${authKey}`,
|
|
76
|
+
'Content-Type': 'application/json',
|
|
77
|
+
},
|
|
78
|
+
body: JSON.stringify({
|
|
79
|
+
wallet_address: walletAddress,
|
|
80
|
+
tier: 'pro',
|
|
81
|
+
}),
|
|
82
|
+
});
|
|
83
|
+
if (!response.ok) {
|
|
84
|
+
const body = await response.text().catch(() => '');
|
|
85
|
+
return {
|
|
86
|
+
content: [{
|
|
87
|
+
type: 'text',
|
|
88
|
+
text: JSON.stringify({
|
|
89
|
+
error: `Failed to create checkout session (HTTP ${response.status})`,
|
|
90
|
+
details: body || response.statusText,
|
|
91
|
+
}),
|
|
92
|
+
}],
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
const data = (await response.json());
|
|
96
|
+
const methodLabel = paymentMethod === 'crypto'
|
|
97
|
+
? 'Coinbase Commerce (USDC, USDT, ETH)'
|
|
98
|
+
: 'Stripe (credit/debit card)';
|
|
99
|
+
return {
|
|
100
|
+
content: [{
|
|
101
|
+
type: 'text',
|
|
102
|
+
text: JSON.stringify({
|
|
103
|
+
checkout_url: data.checkout_url,
|
|
104
|
+
payment_method: methodLabel,
|
|
105
|
+
message: `Open this URL to complete your upgrade to Pro: ${data.checkout_url}`,
|
|
106
|
+
}),
|
|
107
|
+
}],
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
catch (error) {
|
|
111
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
112
|
+
return {
|
|
113
|
+
content: [{
|
|
114
|
+
type: 'text',
|
|
115
|
+
text: JSON.stringify({
|
|
116
|
+
error: `Failed to create checkout session: ${message}`,
|
|
117
|
+
}),
|
|
118
|
+
}],
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=upgrade.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upgrade.js","sourceRoot":"","sources":["../../src/tools/upgrade.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAyCH,sCAyFC;AAhID,8CAAyD;AAE5C,QAAA,qBAAqB,GAAG;IACnC,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,qCAAwB;IACrC,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,cAAc,EAAE;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,uBAAuB;aACrC;YACD,cAAc,EAAE;gBACd,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC;gBACxB,OAAO,EAAE,MAAM;gBACf,WAAW,EAAE,2BAA2B;aACzC;SACF;QACD,QAAQ,EAAE,CAAC,gBAAgB,CAAC;KAC7B;IACD,WAAW,EAAE;QACX,YAAY,EAAE,KAAK;QACnB,eAAe,EAAE,KAAK;QACtB,cAAc,EAAE,KAAK;KACtB;CACF,CAAC;AAOF;;;;;GAKG;AACI,KAAK,UAAU,aAAa,CACjC,SAAiB,EACjB,OAAe,EACf,IAAa;IAEb,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|
4
|
+
"description": "MCP Server for TotalReclaw - zero-knowledge encrypted memory",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"bin": {
|
|
8
|
+
"totalreclaw-mcp": "dist/index.js",
|
|
9
|
+
"totalreclaw-setup": "dist/cli/setup.js"
|
|
10
|
+
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "tsc",
|
|
13
|
+
"test": "jest",
|
|
14
|
+
"test:watch": "jest --watch",
|
|
15
|
+
"lint": "eslint src --ext .ts",
|
|
16
|
+
"clean": "rm -rf dist",
|
|
17
|
+
"start": "node dist/index.js",
|
|
18
|
+
"setup": "node dist/cli/setup.js"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"totalreclaw",
|
|
22
|
+
"mcp",
|
|
23
|
+
"model-context-protocol",
|
|
24
|
+
"memory",
|
|
25
|
+
"encryption"
|
|
26
|
+
],
|
|
27
|
+
"author": "TotalReclaw Team",
|
|
28
|
+
"license": "MIT",
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@huggingface/transformers": "^3.8.1",
|
|
31
|
+
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
32
|
+
"@noble/hashes": "^2.0.1",
|
|
33
|
+
"@scure/bip39": "^2.0.1",
|
|
34
|
+
"@totalreclaw/client": "^0.3.0",
|
|
35
|
+
"permissionless": "^0.3.4",
|
|
36
|
+
"porter-stemmer": "^0.9.1",
|
|
37
|
+
"viem": "^2.47.0"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@types/jest": "^29.5.0",
|
|
41
|
+
"@types/node": "^20.11.0",
|
|
42
|
+
"@typescript-eslint/eslint-plugin": "^6.19.0",
|
|
43
|
+
"@typescript-eslint/parser": "^6.19.0",
|
|
44
|
+
"eslint": "^8.56.0",
|
|
45
|
+
"jest": "^29.7.0",
|
|
46
|
+
"ts-jest": "^29.1.0",
|
|
47
|
+
"typescript": "^5.3.0"
|
|
48
|
+
},
|
|
49
|
+
"engines": {
|
|
50
|
+
"node": ">=18.0.0"
|
|
51
|
+
},
|
|
52
|
+
"files": [
|
|
53
|
+
"dist",
|
|
54
|
+
"README.md"
|
|
55
|
+
],
|
|
56
|
+
"repository": {
|
|
57
|
+
"type": "git",
|
|
58
|
+
"url": "https://github.com/p-diogo/totalreclaw.git",
|
|
59
|
+
"directory": "mcp"
|
|
60
|
+
}
|
|
61
|
+
}
|