@oobe-protocol-labs/sap-mcp-server 0.9.22 → 0.9.36
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/.env.example +23 -9
- package/CHANGELOG.md +124 -6
- package/README.md +8 -7
- package/USER_DOCS/00_START_HERE.md +9 -1
- package/USER_DOCS/01_HOSTED_REMOTE_MCP.md +1 -1
- package/USER_DOCS/03_PAYMENTS_X402_PAYSH.md +1 -1
- package/USER_DOCS/04_CLIENT_CONFIGS.md +3 -3
- package/USER_DOCS/06_DESKTOP_GUI_WIZARD.md +5 -5
- package/config.example.json +5 -4
- package/dist/config/env.d.ts +22 -0
- package/dist/config/env.d.ts.map +1 -1
- package/dist/config/env.js +26 -8
- package/dist/config/env.js.map +1 -1
- package/dist/config/mcp-client-injection.d.ts.map +1 -1
- package/dist/config/mcp-client-injection.js +34 -5
- package/dist/config/mcp-client-injection.js.map +1 -1
- package/dist/config/paths.d.ts +9 -1
- package/dist/config/paths.d.ts.map +1 -1
- package/dist/config/paths.js +15 -1
- package/dist/config/paths.js.map +1 -1
- package/dist/config/profiles.d.ts +5 -0
- package/dist/config/profiles.d.ts.map +1 -1
- package/dist/config/profiles.js +37 -9
- package/dist/config/profiles.js.map +1 -1
- package/dist/config/wizard.d.ts.map +1 -1
- package/dist/config/wizard.js +44 -1
- package/dist/config/wizard.js.map +1 -1
- package/dist/config-cli.d.ts.map +1 -1
- package/dist/config-cli.js +17 -1
- package/dist/config-cli.js.map +1 -1
- package/dist/core/constants.d.ts +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/logger.js +1 -1
- package/dist/memory/async-processor.d.ts +107 -0
- package/dist/memory/async-processor.d.ts.map +1 -0
- package/dist/memory/async-processor.js +204 -0
- package/dist/memory/async-processor.js.map +1 -0
- package/dist/memory/auto-record.d.ts +47 -0
- package/dist/memory/auto-record.d.ts.map +1 -0
- package/dist/memory/auto-record.js +133 -0
- package/dist/memory/auto-record.js.map +1 -0
- package/dist/memory/database.d.ts +103 -0
- package/dist/memory/database.d.ts.map +1 -0
- package/dist/memory/database.js +337 -0
- package/dist/memory/database.js.map +1 -0
- package/dist/memory/hermes-bridge.d.ts +70 -0
- package/dist/memory/hermes-bridge.d.ts.map +1 -0
- package/dist/memory/hermes-bridge.js +155 -0
- package/dist/memory/hermes-bridge.js.map +1 -0
- package/dist/memory/index.d.ts +23 -0
- package/dist/memory/index.d.ts.map +1 -0
- package/dist/memory/index.js +22 -0
- package/dist/memory/index.js.map +1 -0
- package/dist/memory/memory-store.d.ts +76 -0
- package/dist/memory/memory-store.d.ts.map +1 -0
- package/dist/memory/memory-store.js +231 -0
- package/dist/memory/memory-store.js.map +1 -0
- package/dist/memory/stream-buffer-store.d.ts +69 -0
- package/dist/memory/stream-buffer-store.d.ts.map +1 -0
- package/dist/memory/stream-buffer-store.js +182 -0
- package/dist/memory/stream-buffer-store.js.map +1 -0
- package/dist/memory/tool-call-store.d.ts +68 -0
- package/dist/memory/tool-call-store.d.ts.map +1 -0
- package/dist/memory/tool-call-store.js +189 -0
- package/dist/memory/tool-call-store.js.map +1 -0
- package/dist/memory/types.d.ts +197 -0
- package/dist/memory/types.d.ts.map +1 -0
- package/dist/memory/types.js +15 -0
- package/dist/memory/types.js.map +1 -0
- package/dist/memory/utils.d.ts +30 -0
- package/dist/memory/utils.d.ts.map +1 -0
- package/dist/memory/utils.js +47 -0
- package/dist/memory/utils.js.map +1 -0
- package/dist/payments/hosted-tool-eligibility.d.ts.map +1 -1
- package/dist/payments/hosted-tool-eligibility.js +4 -6
- package/dist/payments/hosted-tool-eligibility.js.map +1 -1
- package/dist/payments/monetization-gate.d.ts +39 -0
- package/dist/payments/monetization-gate.d.ts.map +1 -1
- package/dist/payments/monetization-gate.js +165 -11
- package/dist/payments/monetization-gate.js.map +1 -1
- package/dist/payments/pay-sh-spec.d.ts.map +1 -1
- package/dist/payments/pay-sh-spec.js +4 -2
- package/dist/payments/pay-sh-spec.js.map +1 -1
- package/dist/payments/pricing.d.ts +3 -1
- package/dist/payments/pricing.d.ts.map +1 -1
- package/dist/payments/pricing.js +137 -56
- package/dist/payments/pricing.js.map +1 -1
- package/dist/payments/x402-paid-call.d.ts.map +1 -1
- package/dist/payments/x402-paid-call.js +26 -2
- package/dist/payments/x402-paid-call.js.map +1 -1
- package/dist/premium/builtin-plugins.d.ts +42 -0
- package/dist/premium/builtin-plugins.d.ts.map +1 -1
- package/dist/premium/builtin-plugins.js +91 -10
- package/dist/premium/builtin-plugins.js.map +1 -1
- package/dist/premium/manifest-builder.d.ts.map +1 -1
- package/dist/premium/manifest-builder.js +43 -7
- package/dist/premium/manifest-builder.js.map +1 -1
- package/dist/premium/meme-radar-capabilities.js +9 -9
- package/dist/premium/meme-radar-capabilities.js.map +1 -1
- package/dist/premium/plugin-validator.d.ts.map +1 -1
- package/dist/premium/plugin-validator.js +62 -1
- package/dist/premium/plugin-validator.js.map +1 -1
- package/dist/premium/provider-bridge.d.ts +25 -1
- package/dist/premium/provider-bridge.d.ts.map +1 -1
- package/dist/premium/provider-bridge.js +130 -20
- package/dist/premium/provider-bridge.js.map +1 -1
- package/dist/premium/session-manager.d.ts.map +1 -1
- package/dist/premium/session-manager.js +12 -3
- package/dist/premium/session-manager.js.map +1 -1
- package/dist/premium/tech-fundamentals-capabilities.js +5 -5
- package/dist/premium/tech-fundamentals-capabilities.js.map +1 -1
- package/dist/premium/trading-capabilities.js +5 -5
- package/dist/premium/trading-capabilities.js.map +1 -1
- package/dist/premium/webhook-engine.d.ts.map +1 -1
- package/dist/premium/webhook-engine.js +7 -1
- package/dist/premium/webhook-engine.js.map +1 -1
- package/dist/prompts/context/sap-agent-context.prompt.js +4 -3
- package/dist/prompts/context/sap-agent-context.prompt.js.map +1 -1
- package/dist/prompts/context/sap-agent-intent-router.prompt.js +1 -1
- package/dist/prompts/payments/explain-x402-settlement.prompt.js +1 -1
- package/dist/remote/premium-routes.d.ts.map +1 -1
- package/dist/remote/premium-routes.js +3 -2
- package/dist/remote/premium-routes.js.map +1 -1
- package/dist/remote/public-home/sections.d.ts.map +1 -1
- package/dist/remote/public-home/sections.js +2 -3
- package/dist/remote/public-home/sections.js.map +1 -1
- package/dist/remote/public-home/styles.d.ts +1 -1
- package/dist/remote/public-home/styles.js +2 -2
- package/dist/remote/server.d.ts.map +1 -1
- package/dist/remote/server.js +19 -4
- package/dist/remote/server.js.map +1 -1
- package/dist/server/server-metadata.js +1 -1
- package/dist/strategies/strategy-store.d.ts +82 -0
- package/dist/strategies/strategy-store.d.ts.map +1 -0
- package/dist/strategies/strategy-store.js +165 -0
- package/dist/strategies/strategy-store.js.map +1 -0
- package/dist/tools/agent-start-tool.d.ts.map +1 -1
- package/dist/tools/agent-start-tool.js +103 -16
- package/dist/tools/agent-start-tool.js.map +1 -1
- package/dist/tools/client-sdk-tools.d.ts.map +1 -1
- package/dist/tools/client-sdk-tools.js +156 -12
- package/dist/tools/client-sdk-tools.js.map +1 -1
- package/dist/tools/estimate-tool-cost.d.ts.map +1 -1
- package/dist/tools/estimate-tool-cost.js +11 -4
- package/dist/tools/estimate-tool-cost.js.map +1 -1
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +2 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/magicblock-tools.js +8 -8
- package/dist/tools/magicblock-tools.js.map +1 -1
- package/dist/tools/memory-tools.d.ts +26 -0
- package/dist/tools/memory-tools.d.ts.map +1 -0
- package/dist/tools/memory-tools.js +533 -0
- package/dist/tools/memory-tools.js.map +1 -0
- package/dist/tools/perp-tools.d.ts +7 -9
- package/dist/tools/perp-tools.d.ts.map +1 -1
- package/dist/tools/perp-tools.js +404 -367
- package/dist/tools/perp-tools.js.map +1 -1
- package/dist/tools/premium-tools.d.ts.map +1 -1
- package/dist/tools/premium-tools.js +8 -2
- package/dist/tools/premium-tools.js.map +1 -1
- package/dist/tools/profile-tools.d.ts.map +1 -1
- package/dist/tools/profile-tools.js +18 -1
- package/dist/tools/profile-tools.js.map +1 -1
- package/dist/tools/quick-context-tool.d.ts.map +1 -1
- package/dist/tools/quick-context-tool.js +101 -9
- package/dist/tools/quick-context-tool.js.map +1 -1
- package/dist/tools/register-tools.d.ts.map +1 -1
- package/dist/tools/register-tools.js +3 -0
- package/dist/tools/register-tools.js.map +1 -1
- package/dist/tools/sap-sdk-tools.d.ts.map +1 -1
- package/dist/tools/sap-sdk-tools.js +14 -13
- package/dist/tools/sap-sdk-tools.js.map +1 -1
- package/dist/tools/session-context-packet.d.ts +19 -0
- package/dist/tools/session-context-packet.d.ts.map +1 -0
- package/dist/tools/session-context-packet.js +256 -0
- package/dist/tools/session-context-packet.js.map +1 -0
- package/dist/tools/skills-tools.d.ts +10 -0
- package/dist/tools/skills-tools.d.ts.map +1 -1
- package/dist/tools/skills-tools.js +19 -0
- package/dist/tools/skills-tools.js.map +1 -1
- package/dist/tools/transaction-tools.d.ts +1 -0
- package/dist/tools/transaction-tools.d.ts.map +1 -1
- package/dist/tools/transaction-tools.js +248 -9
- package/dist/tools/transaction-tools.js.map +1 -1
- package/dist/tools/x402-paid-call-tool.d.ts.map +1 -1
- package/dist/tools/x402-paid-call-tool.js +55 -21
- package/dist/tools/x402-paid-call-tool.js.map +1 -1
- package/dist/wizard-core/desktop-flow.d.ts.map +1 -1
- package/dist/wizard-core/desktop-flow.js +4 -2
- package/dist/wizard-core/desktop-flow.js.map +1 -1
- package/docs/06_PAYMENTS_X402_AND_PAYSH.md +38 -13
- package/docs/07_ENDPOINTS_AND_CLIENTS.md +1 -1
- package/docs/09_TOOLS_SKILLS_AND_AGENT_GUIDE.md +14 -6
- package/docs/13_BOUNTY_PROGRAM_PROPOSAL.md +1 -1
- package/docs/14_DESKTOP_WIZARD_RELEASE.md +3 -3
- package/docs/15_DASHBOARD_SCREENSHARE_SCRIPT.md +1 -1
- package/docs/BRANCH_AND_CI.md +2 -2
- package/docs/README.md +1 -1
- package/package.json +3 -1
- package/server.json +3 -3
- package/skills/README.md +3 -3
- package/skills/sap-agent-registry/SKILL.md +2 -2
- package/skills/sap-agentkit/SKILL.md +10 -4
- package/skills/sap-defi/SKILL.md +42 -5
- package/skills/sap-discovery-indexing/SKILL.md +4 -3
- package/skills/sap-market-data/SKILL.md +9 -5
- package/skills/sap-mcp/SKILL.md +37 -24
- package/skills/sap-mcp/TOOL_REFERENCE.md +9 -8
- package/skills/sap-operations/SKILL.md +5 -4
- package/skills/sap-payments-x402/SKILL.md +34 -19
- package/assets/logos/drift.svg +0 -12
|
@@ -4,12 +4,55 @@
|
|
|
4
4
|
* premium capabilities, and skills list into one compact response to reduce agent
|
|
5
5
|
* bootstrap from 5+ tool calls to 1.
|
|
6
6
|
*/
|
|
7
|
+
import { execSync } from 'child_process';
|
|
7
8
|
import { registerTool } from '../adapters/mcp/sdk-compat.js';
|
|
8
9
|
import { createStructuredJsonResponse } from '../adapters/mcp/tool-response.js';
|
|
9
10
|
import { MCP_SERVER_VERSION } from '../core/constants.js';
|
|
10
11
|
import { listPremiumPlugins, publicPremiumProviderStatus } from '../premium/index.js';
|
|
11
|
-
import { listBundledSkillNames } from './skills-tools.js';
|
|
12
|
+
import { listBundledSkillNames, getBundledSkillContents } from './skills-tools.js';
|
|
12
13
|
import { CAPABILITIES } from '../server/server-metadata.js';
|
|
14
|
+
import { buildSessionContextPacket, normalizeSapAgentIntent, } from './session-context-packet.js';
|
|
15
|
+
/**
|
|
16
|
+
* @name getServerCommit
|
|
17
|
+
* @description Returns the short git commit hash of the current build.
|
|
18
|
+
* Falls back to 'unknown' when git is not available or the repo has no commits.
|
|
19
|
+
*/
|
|
20
|
+
function getServerCommit() {
|
|
21
|
+
try {
|
|
22
|
+
return execSync('git rev-parse --short HEAD', { encoding: 'utf-8', timeout: 2000 }).trim();
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
return 'unknown';
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* @name resolveNetwork
|
|
30
|
+
* @description Derives the Solana network name from an RPC URL.
|
|
31
|
+
*/
|
|
32
|
+
function resolveNetwork(rpcUrl) {
|
|
33
|
+
if (!rpcUrl)
|
|
34
|
+
return 'unknown';
|
|
35
|
+
if (rpcUrl.includes('mainnet'))
|
|
36
|
+
return 'mainnet-beta';
|
|
37
|
+
if (rpcUrl.includes('testnet'))
|
|
38
|
+
return 'testnet';
|
|
39
|
+
if (rpcUrl.includes('devnet'))
|
|
40
|
+
return 'devnet';
|
|
41
|
+
return 'custom';
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* @name buildRecommendedFlow
|
|
45
|
+
* @description Returns the recommended agent workflow based on server mode.
|
|
46
|
+
*/
|
|
47
|
+
function buildRecommendedFlow(mode) {
|
|
48
|
+
if (mode === 'hosted-api') {
|
|
49
|
+
return 'Hosted mode: use hosted reads directly, sap_payments_call_paid_tool for x402 paid hosted calls, sap_payments_register_agent/update_agent for wallet-owned registry writes, and sap_payments_finalize_transaction for hosted unsigned transactions. Never create signing scripts or read keypair JSON.';
|
|
50
|
+
}
|
|
51
|
+
if (mode === 'local-dev-keypair') {
|
|
52
|
+
return 'Local mode: use sap_preview_transaction → sap_sign_transaction → sap_submit_signed_transaction for signing. The active profile keypair is available for direct signing.';
|
|
53
|
+
}
|
|
54
|
+
return 'Read-only mode: no signing available. Use read-only tools (sol_get_balance, jupiter_getQuote, sap_list_all_agents, etc.).';
|
|
55
|
+
}
|
|
13
56
|
const ALL_SECTIONS = [
|
|
14
57
|
'version',
|
|
15
58
|
'tools',
|
|
@@ -28,7 +71,7 @@ const DEFAULT_MAX_CHARS = 4000;
|
|
|
28
71
|
export function registerQuickContextTool(server, context) {
|
|
29
72
|
registerTool(server, 'sap_quick_context', {
|
|
30
73
|
title: 'SAP MCP Quick Context',
|
|
31
|
-
description: 'Free single-call bootstrap aggregator. Returns a compact markdown-like summary with server version, total tools count, tools by category, pricing tiers summary, premium plugins/capabilities count, bundled skills list, and nextAction guidance. Use this instead of calling sap_agent_start, sap_pricing_catalog, sap_premium_plugin_catalog, sap_skills_list, and sap_get_tool_category_summary separately to reduce bootstrap from 5+ tool calls to 1.',
|
|
74
|
+
description: 'Free single-call bootstrap aggregator. Returns a compact markdown-like summary with server version, total tools count, tools by category, pricing tiers summary, premium plugins/capabilities count, bundled skills list, and nextAction guidance. Pass agentKnownVersion with the version you currently know to get skillsUpdateRequired + skillsContents (full SKILL.md inline) when the server version differs — this lets you auto-update your local skills in 1 call without a separate sap_skills_bundle. Use this instead of calling sap_agent_start, sap_pricing_catalog, sap_premium_plugin_catalog, sap_skills_list, and sap_get_tool_category_summary separately to reduce bootstrap from 5+ tool calls to 1.',
|
|
32
75
|
inputSchema: {
|
|
33
76
|
type: 'object',
|
|
34
77
|
properties: {
|
|
@@ -45,6 +88,15 @@ export function registerQuickContextTool(server, context) {
|
|
|
45
88
|
type: 'number',
|
|
46
89
|
description: 'Maximum character length for the summary string. Defaults to 4000. The summary is truncated if it exceeds this length.',
|
|
47
90
|
},
|
|
91
|
+
agentKnownVersion: {
|
|
92
|
+
type: 'string',
|
|
93
|
+
description: 'The SAP MCP version the agent currently knows about. When this differs from the server version, skillsUpdateRequired is set to true and skillsContents is populated with full SKILL.md contents. Omit to always force a skills update (first bootstrap).',
|
|
94
|
+
},
|
|
95
|
+
intent: {
|
|
96
|
+
type: 'string',
|
|
97
|
+
enum: ['connection', 'paid-call', 'registry-write', 'update-agent', 'transaction-finalize', 'escrow', 'identity', 'swap', 'external-x402', 'premium-stream', 'balance', 'discovery', 'general'],
|
|
98
|
+
description: 'Optional user intent for the embedded sessionContextPacket. Use this to route bootstrap toward paid calls, registry writes, swaps, escrow, external x402 agents, premium streams, balance reads, or discovery.',
|
|
99
|
+
},
|
|
48
100
|
},
|
|
49
101
|
},
|
|
50
102
|
outputSchema: {
|
|
@@ -52,6 +104,7 @@ export function registerQuickContextTool(server, context) {
|
|
|
52
104
|
properties: {
|
|
53
105
|
success: { type: 'boolean', description: 'Whether the quick context summary was generated.' },
|
|
54
106
|
version: { type: 'string', description: 'SAP MCP server version.' },
|
|
107
|
+
serverCommit: { type: 'string', description: 'Git commit hash of the running server build. Changes on every deploy even without version bump.' },
|
|
55
108
|
totalTools: { type: 'number', description: 'Total number of registered MCP tools.' },
|
|
56
109
|
toolsByCategory: { type: 'object', description: 'Tool counts by category (sap, sns, agentKit, premium, etc.).' },
|
|
57
110
|
pricingTiers: { type: 'array', description: 'Pricing tier names available on the hosted server.', items: { type: 'string' } },
|
|
@@ -59,11 +112,16 @@ export function registerQuickContextTool(server, context) {
|
|
|
59
112
|
premiumCapabilities: { type: 'number', description: 'Number of premium capabilities across all plugins.' },
|
|
60
113
|
premiumProvidersReady: { type: 'number', description: 'Number of premium providers with configured environment variables.' },
|
|
61
114
|
skills: { type: 'array', description: 'Bundled skill names available via sap_skills_bundle.', items: { type: 'string' } },
|
|
115
|
+
skillsUpdateRequired: { type: 'boolean', description: 'True when the server version differs from agentKnownVersion (or agentKnownVersion was omitted). When true, skillsContents contains the full SKILL.md contents of all bundled skills.' },
|
|
116
|
+
skillsContents: { type: 'array', description: 'Full SKILL.md contents of all bundled skills, included only when skillsUpdateRequired is true. Each entry has {name, content}.', items: { type: 'object' } },
|
|
117
|
+
environment: { type: 'object', description: 'Server environment summary: network (mainnet/devnet), mode (hosted-api/local-dev-keypair/readonly), authType (none/bearer), rateLimitPerMinute.', properties: { network: { type: 'string' }, mode: { type: 'string' }, authType: { type: 'string' }, rateLimitPerMinute: { type: 'number' } } },
|
|
118
|
+
recommendedFlow: { type: 'string', description: 'Recommended agent workflow based on server mode. Hosted: build unsigned → sign locally. Local: preview → sign → submit.' },
|
|
62
119
|
summary: { type: 'string', description: 'Compact markdown-like summary string suitable for agent context loading.' },
|
|
63
120
|
nextAction: { type: 'string', description: 'Concrete next action for the agent after loading this context.' },
|
|
121
|
+
sessionContextPacket: { type: 'object', description: 'Machine-readable SAP MCP routing, freshness, memory, proof-tape, and forbidden-action rules for this session.' },
|
|
64
122
|
truncated: { type: 'boolean', description: 'Whether the summary was truncated to fit within maxChars.' },
|
|
65
123
|
},
|
|
66
|
-
required: ['success', 'version', 'totalTools', 'toolsByCategory', 'pricingTiers', 'premiumPlugins', 'premiumCapabilities', 'premiumProvidersReady', 'skills', 'summary', 'nextAction', 'truncated'],
|
|
124
|
+
required: ['success', 'version', 'serverCommit', 'totalTools', 'toolsByCategory', 'pricingTiers', 'premiumPlugins', 'premiumCapabilities', 'premiumProvidersReady', 'skills', 'skillsUpdateRequired', 'environment', 'recommendedFlow', 'summary', 'nextAction', 'sessionContextPacket', 'truncated'],
|
|
67
125
|
},
|
|
68
126
|
annotations: {
|
|
69
127
|
readOnlyHint: true,
|
|
@@ -95,7 +153,11 @@ function parseQuickContextInput(input) {
|
|
|
95
153
|
const maxChars = typeof record.maxChars === 'number' && record.maxChars > 0
|
|
96
154
|
? Math.floor(record.maxChars)
|
|
97
155
|
: DEFAULT_MAX_CHARS;
|
|
98
|
-
|
|
156
|
+
const agentKnownVersion = typeof record.agentKnownVersion === 'string' && record.agentKnownVersion.length > 0
|
|
157
|
+
? record.agentKnownVersion
|
|
158
|
+
: undefined;
|
|
159
|
+
const intent = normalizeSapAgentIntent(record.intent);
|
|
160
|
+
return { include, compact, maxChars, agentKnownVersion, intent };
|
|
99
161
|
}
|
|
100
162
|
/**
|
|
101
163
|
* @name resolveSections
|
|
@@ -131,14 +193,24 @@ function buildQuickContextPayload(context, input) {
|
|
|
131
193
|
const premiumCapabilitiesCount = plugins.reduce((sum, plugin) => sum + plugin.capabilities.length, 0);
|
|
132
194
|
const premiumProvidersReady = Object.values(providerStatus).filter(Boolean).length;
|
|
133
195
|
const skills = listBundledSkillNames();
|
|
196
|
+
// Skills auto-update: when the agent passes agentKnownVersion and it differs
|
|
197
|
+
// from the server version (or agentKnownVersion is omitted — first bootstrap),
|
|
198
|
+
// include the full SKILL.md contents inline so the agent can update its local
|
|
199
|
+
// skills without a separate sap_skills_bundle call.
|
|
200
|
+
const skillsUpdateRequired = !input.agentKnownVersion || input.agentKnownVersion !== MCP_SERVER_VERSION;
|
|
201
|
+
const skillsContents = skillsUpdateRequired ? getBundledSkillContents() : undefined;
|
|
134
202
|
const toolsByCategory = CAPABILITIES.tools.categories;
|
|
135
203
|
const totalTools = CAPABILITIES.tools.count;
|
|
204
|
+
// Build pricing tiers from the actual monetization config, not hardcoded values.
|
|
205
|
+
// This ensures quick_context and estimate_tool_cost always agree.
|
|
206
|
+
const monPrices = context.config.monetization.prices;
|
|
136
207
|
const pricingTiers = [
|
|
137
208
|
'free=$0',
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
209
|
+
`micro-read=$${monPrices.microReadUsd ?? 0.001}`,
|
|
210
|
+
`read-premium=$${monPrices.readPremiumUsd ?? 0.002}`,
|
|
211
|
+
`builder=$${monPrices.builderUsd ?? 0.006}`,
|
|
212
|
+
`value-action=$${monPrices.valueFixedUsd ?? 0.06}`,
|
|
213
|
+
`heavy-value=$${monPrices.heavyValueUsd ?? 0.035}`,
|
|
142
214
|
'batch=clamped sum',
|
|
143
215
|
];
|
|
144
216
|
const summary = buildSummaryString({
|
|
@@ -158,6 +230,7 @@ function buildQuickContextPayload(context, input) {
|
|
|
158
230
|
return {
|
|
159
231
|
success: true,
|
|
160
232
|
version: MCP_SERVER_VERSION,
|
|
233
|
+
serverCommit: getServerCommit(),
|
|
161
234
|
totalTools,
|
|
162
235
|
toolsByCategory,
|
|
163
236
|
pricingTiers,
|
|
@@ -165,8 +238,18 @@ function buildQuickContextPayload(context, input) {
|
|
|
165
238
|
premiumCapabilities: premiumCapabilitiesCount,
|
|
166
239
|
premiumProvidersReady,
|
|
167
240
|
skills,
|
|
241
|
+
skillsUpdateRequired,
|
|
242
|
+
...(skillsUpdateRequired ? { skillsContents } : {}),
|
|
243
|
+
environment: {
|
|
244
|
+
network: resolveNetwork(context.config.rpcUrl),
|
|
245
|
+
mode: context.config.mode,
|
|
246
|
+
authType: process.env.SAP_HTTP_API_KEY ? 'bearer' : 'none',
|
|
247
|
+
rateLimitPerMinute: context.config.rateLimitPerMinute,
|
|
248
|
+
},
|
|
249
|
+
recommendedFlow: buildRecommendedFlow(context.config.mode),
|
|
168
250
|
summary: summary.text,
|
|
169
251
|
nextAction: buildNextAction(sections),
|
|
252
|
+
sessionContextPacket: buildSessionContextPacket(context, input.intent),
|
|
170
253
|
truncated: summary.truncated,
|
|
171
254
|
};
|
|
172
255
|
}
|
|
@@ -220,9 +303,18 @@ function buildNextAction(sections) {
|
|
|
220
303
|
}
|
|
221
304
|
return [
|
|
222
305
|
'Call sap_agent_start for the full startup playbook.',
|
|
306
|
+
'On future sessions, pass agentKnownVersion to sap_quick_context to auto-update local skills when the server version changes.',
|
|
223
307
|
'Then sap_skills_bundle with includeContents:true to load bundled skills.',
|
|
224
|
-
'
|
|
308
|
+
'If the server version is newer than your local SAP MCP repo, update it: git pull origin main && pnpm run build && pm2 restart sap-mcp-remote (or npx @oobe-protocol-labs/sap-mcp-server@latest for client installs).',
|
|
309
|
+
'Use sap_estimate_tool_cost before any paid tool call — set maxPriceUsd to estimate × 1.25.',
|
|
225
310
|
'Use sap_payments_readiness before any write or paid workflow.',
|
|
311
|
+
'Use sap_prepare_action before swaps, registry writes, escrow, external x402 calls, premium streams, or transaction finalization.',
|
|
312
|
+
'Treat memory as operational context/proof tape only; never use it as cached truth for balances, prices, quotes, blockhashes, simulations, liquidity, or agent account state.',
|
|
313
|
+
'For wallet/profile info: the hosted server is accountless — use sap_payments_profile_current (local bridge) not sap_profile_current.',
|
|
314
|
+
'For signing: use sap_payments_finalize_transaction with signerProfile to sign with a specific profile — no need to switch .active-profile.',
|
|
315
|
+
'For SOL/SPL transfers: use sap_build_sol_transfer or sap_build_spl_transfer (hosted builders), then sign locally with sap_payments_finalize_transaction.',
|
|
316
|
+
'For builder-supported writes, build unsigned on hosted and sign locally with sap_payments_finalize_transaction. For local-signer-only tools with no hosted builder, such as direct Adrena perps writes, stop and report the missing builder — do not route them through paid-call replay and do not create signing scripts.',
|
|
317
|
+
'Namespace: hosted tools are mcp__sap__* (e.g. mcp__sap__jupiter_getQuote). Local bridge tools are mcp__sap_payments__* (e.g. mcp__sap_payments__sap_payments_finalize_transaction). Search both namespaces when looking for a tool.',
|
|
226
318
|
].join(' ');
|
|
227
319
|
}
|
|
228
320
|
//# sourceMappingURL=quick-context-tool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quick-context-tool.js","sourceRoot":"","sources":["../../src/tools/quick-context-tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,4BAA4B,EAAE,MAAM,kCAAkC,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,kBAAkB,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AACtF,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"quick-context-tool.js","sourceRoot":"","sources":["../../src/tools/quick-context-tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,4BAA4B,EAAE,MAAM,kCAAkC,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,kBAAkB,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AACtF,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AACnF,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EACL,yBAAyB,EACzB,uBAAuB,GAExB,MAAM,6BAA6B,CAAC;AAErC;;;;GAIG;AACH,SAAS,eAAe;IAC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,CAAC,CAAC;AACd,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-tools.d.ts","sourceRoot":"","sources":["../../src/tools/register-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAEnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"register-tools.d.ts","sourceRoot":"","sources":["../../src/tools/register-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAEnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAqBtD;;;;;;;GAOG;AACH,wBAAsB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAgEzF"}
|
|
@@ -10,6 +10,7 @@ import { registerSkillsTools } from './skills-tools.js';
|
|
|
10
10
|
import { registerChatTools } from './chat-tools.js';
|
|
11
11
|
import { registerX402PaidCallTool } from './x402-paid-call-tool.js';
|
|
12
12
|
import { registerMagicBlockTools } from './magicblock-tools.js';
|
|
13
|
+
import { registerMemoryTools } from './memory-tools.js';
|
|
13
14
|
import { registerAgentStartTool } from './agent-start-tool.js';
|
|
14
15
|
import { registerEstimateToolCost } from './estimate-tool-cost.js';
|
|
15
16
|
import { registerQuickContextTool } from './quick-context-tool.js';
|
|
@@ -66,6 +67,8 @@ export async function registerTools(server, context) {
|
|
|
66
67
|
registerSkillsTools(server, context);
|
|
67
68
|
// Register MagicBlock tools (20 tools: ER Router, Private Payments, VRF).
|
|
68
69
|
registerMagicBlockTools(server, context);
|
|
70
|
+
// Register local memory tools (15 free tools: memory, strategies, streams, audit).
|
|
71
|
+
registerMemoryTools(server, context);
|
|
69
72
|
logger.debug('Tools registered', { count: getRegisteredTools(server).length });
|
|
70
73
|
}
|
|
71
74
|
//# sourceMappingURL=register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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwChC,CAAC;AAouCX;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,UAAU,GAAG,iBAAiB,CAW3E;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,UAAU,GAAG,eAAe,CAWvE;AA+1DD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,GAAG,IAAI,CAkBjF"}
|
|
@@ -437,10 +437,11 @@ function buildHostedPricingMeta(toolName) {
|
|
|
437
437
|
if (tier === 'free')
|
|
438
438
|
return 'free — no x402 payment required';
|
|
439
439
|
const prices = {
|
|
440
|
-
'read
|
|
441
|
-
'
|
|
442
|
-
'
|
|
443
|
-
'
|
|
440
|
+
'micro-read': '~$0.001',
|
|
441
|
+
'read-premium': '~$0.002',
|
|
442
|
+
'builder': '~$0.006',
|
|
443
|
+
'value-action': '~$0.06 standard / ~$0.035 heavy',
|
|
444
|
+
'batch': 'clamped sum',
|
|
444
445
|
};
|
|
445
446
|
const price = prices[tier] ?? '~$0.001';
|
|
446
447
|
return `${tier} tier — estimated ${price} USD per call. Use sap_estimate_tool_cost for exact pricing.`;
|
|
@@ -813,8 +814,8 @@ async function buildSapAgentContext(input, client) {
|
|
|
813
814
|
routing: {
|
|
814
815
|
firstReads: [
|
|
815
816
|
'Use sap_get_agent or sap_get_agent_profile when the owner wallet is known.',
|
|
816
|
-
'Use sap_list_agents with limit <= 20 and view: compact for
|
|
817
|
-
'Use sap_discover_agents or sap_list_all_agents only for
|
|
817
|
+
'Use sap_list_agents with limit <= 20 and view: compact for low-cost micro-read orientation.',
|
|
818
|
+
'Use sap_discover_agents or sap_list_all_agents only for read-premium search, enriched rows, large pages, or ecosystem-scale scans.',
|
|
818
819
|
],
|
|
819
820
|
paidHostedTools: 'Use sap_payments_call_paid_tool when a hosted tool returns x402 payment_required and the runtime cannot replay x402 natively.',
|
|
820
821
|
registryWrites: 'Use sap_payments_register_agent and sap_payments_update_agent for wallet-owned SAP registry writes. Do not retry hosted accountless writes after hosted_local_signer_required.',
|
|
@@ -1403,7 +1404,7 @@ function buildSapProtocolInvariants() {
|
|
|
1403
1404
|
treasury: SAP_PROTOCOL_TREASURY,
|
|
1404
1405
|
lamports: SAP_REGISTRATION_FEE_LAMPORTS.toString(10),
|
|
1405
1406
|
sol: Number(SAP_REGISTRATION_FEE_LAMPORTS) / 1_000_000_000,
|
|
1406
|
-
verification: 'sap_payments_register_agent verifies the landed transaction pre/post balance delta for the treasury account because deployed program behavior can
|
|
1407
|
+
verification: 'sap_payments_register_agent verifies the landed transaction pre/post balance delta for the treasury account because deployed program behavior can diverge from the source-level invariant.',
|
|
1407
1408
|
failureStatus: 'missing_or_underpaid',
|
|
1408
1409
|
failureRule: 'If protocolFee.status is missing_or_underpaid, the agent account can still exist, but sap_payments_register_agent must return success:false, agentRegistered:true, and protocolComplete:false. Do not retry registration automatically; inspect the signature, deployed SAP program, and treasury delta first.',
|
|
1409
1410
|
},
|
|
@@ -2247,11 +2248,11 @@ const discoveryTools = [
|
|
|
2247
2248
|
},
|
|
2248
2249
|
query: {
|
|
2249
2250
|
type: 'string',
|
|
2250
|
-
description: 'Optional text query for a
|
|
2251
|
+
description: 'Optional text query for a compact micro-read orientation search. Keep this narrow, for example "XONA" or "Solking".',
|
|
2251
2252
|
},
|
|
2252
2253
|
limit: {
|
|
2253
2254
|
type: 'number',
|
|
2254
|
-
description: 'Maximum compact orientation rows to include when wallet is not supplied. Defaults to 10 and is capped at 20 to keep this tool
|
|
2255
|
+
description: 'Maximum compact orientation rows to include when wallet is not supplied. Defaults to 10 and is capped at 20 to keep this tool in the micro-read tier.',
|
|
2255
2256
|
},
|
|
2256
2257
|
},
|
|
2257
2258
|
handler: async (input, client) => buildSapAgentContext(input, client),
|
|
@@ -2259,14 +2260,14 @@ const discoveryTools = [
|
|
|
2259
2260
|
{
|
|
2260
2261
|
name: 'sap_get_agent_profile',
|
|
2261
2262
|
title: 'Get SAP Agent Profile',
|
|
2262
|
-
description: '
|
|
2263
|
+
description: 'Micro-read exact SAP agent profile lookup by owner wallet. Use this for a known agent before read-premium discovery or enrichment.',
|
|
2263
2264
|
inputSchema: { wallet: { type: 'string', description: 'Solana public key of the agent owner wallet (base58)' } },
|
|
2264
2265
|
handler: async (input, client) => ({ profile: await client.discovery.getAgentProfile(requiredPublicKey(input, 'wallet')) }),
|
|
2265
2266
|
},
|
|
2266
2267
|
{
|
|
2267
2268
|
name: 'sap_is_agent_active',
|
|
2268
2269
|
title: 'Check SAP Agent Active',
|
|
2269
|
-
description: '
|
|
2270
|
+
description: 'Micro-read exact activity check for an owner wallet. Use this before read-premium discovery when the wallet is known.',
|
|
2270
2271
|
inputSchema: { wallet: { type: 'string', description: 'Solana public key of the wallet to check for an active SAP agent (base58)' } },
|
|
2271
2272
|
handler: async (input, client) => ({ active: await client.discovery.isAgentActive(requiredPublicKey(input, 'wallet')) }),
|
|
2272
2273
|
},
|
|
@@ -2299,7 +2300,7 @@ const discoveryTools = [
|
|
|
2299
2300
|
{
|
|
2300
2301
|
name: 'sap_list_agents',
|
|
2301
2302
|
title: 'List SAP Agents',
|
|
2302
|
-
description: 'Compact SAP agent orientation list.
|
|
2303
|
+
description: 'Compact SAP agent orientation list. Micro-read when limit <= 20, view is compact, hydrate is false, and includeProtocolIndexes is false; larger or enriched pages are read-premium.',
|
|
2303
2304
|
inputSchema: makeAgentDirectoryInputSchema(20),
|
|
2304
2305
|
handler: async (input, client) => {
|
|
2305
2306
|
const limit = Math.max(1, Math.min(optionalNumber(input, 'limit') ?? 20, 500));
|
|
@@ -2377,7 +2378,7 @@ const indexAndFetchTools = [
|
|
|
2377
2378
|
name: 'sap_fetch_protocol_index',
|
|
2378
2379
|
title: 'Fetch Protocol Index',
|
|
2379
2380
|
description: 'Fetch a SAP protocol index by protocol ID.',
|
|
2380
|
-
inputSchema: { protocolId: { type: 'string', description: 'Protocol ID to fetch the index for (e.g. "jupiter", "
|
|
2381
|
+
inputSchema: { protocolId: { type: 'string', description: 'Protocol ID to fetch the index for (e.g. "jupiter", "adrena")' } },
|
|
2381
2382
|
handler: async (input, client) => ({ index: await client.indexing.fetchProtocolIndexNullable(requiredString(input, 'protocolId')) }),
|
|
2382
2383
|
},
|
|
2383
2384
|
{
|