@oobe-protocol-labs/sap-mcp-server 0.9.16 → 0.9.20

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.
Files changed (602) hide show
  1. package/.env.example +8 -7
  2. package/CHANGELOG.md +199 -0
  3. package/README.md +3 -3
  4. package/USER_DOCS/01_HOSTED_REMOTE_MCP.md +1 -1
  5. package/USER_DOCS/04_CLIENT_CONFIGS.md +3 -3
  6. package/USER_DOCS/05_SKILLS_AND_TOOLS.md +16 -8
  7. package/USER_DOCS/06_DESKTOP_GUI_WIZARD.md +5 -5
  8. package/config.example.json +5 -4
  9. package/config.schema.json +7 -2
  10. package/config.secure-example.json +5 -4
  11. package/dist/adapters/index.d.ts +7 -1
  12. package/dist/adapters/index.d.ts.map +1 -1
  13. package/dist/adapters/index.js +7 -1
  14. package/dist/adapters/index.js.map +1 -1
  15. package/dist/adapters/mcp/errors.d.ts +13 -1
  16. package/dist/adapters/mcp/errors.d.ts.map +1 -1
  17. package/dist/adapters/mcp/errors.js +13 -1
  18. package/dist/adapters/mcp/errors.js.map +1 -1
  19. package/dist/adapters/mcp/index.d.ts +7 -1
  20. package/dist/adapters/mcp/index.d.ts.map +1 -1
  21. package/dist/adapters/mcp/index.js +7 -1
  22. package/dist/adapters/mcp/index.js.map +1 -1
  23. package/dist/adapters/mcp/prompt-response.d.ts +13 -1
  24. package/dist/adapters/mcp/prompt-response.d.ts.map +1 -1
  25. package/dist/adapters/mcp/prompt-response.js +13 -1
  26. package/dist/adapters/mcp/prompt-response.js.map +1 -1
  27. package/dist/adapters/mcp/resource-response.d.ts +14 -1
  28. package/dist/adapters/mcp/resource-response.d.ts.map +1 -1
  29. package/dist/adapters/mcp/resource-response.js +14 -1
  30. package/dist/adapters/mcp/resource-response.js.map +1 -1
  31. package/dist/adapters/mcp/sdk-compat.d.ts +11 -3
  32. package/dist/adapters/mcp/sdk-compat.d.ts.map +1 -1
  33. package/dist/adapters/mcp/sdk-compat.js +213 -24
  34. package/dist/adapters/mcp/sdk-compat.js.map +1 -1
  35. package/dist/adapters/mcp/tool-response.d.ts +39 -4
  36. package/dist/adapters/mcp/tool-response.d.ts.map +1 -1
  37. package/dist/adapters/mcp/tool-response.js +39 -4
  38. package/dist/adapters/mcp/tool-response.js.map +1 -1
  39. package/dist/adapters/solana/commitment.d.ts +14 -2
  40. package/dist/adapters/solana/commitment.d.ts.map +1 -1
  41. package/dist/adapters/solana/commitment.js +14 -2
  42. package/dist/adapters/solana/commitment.js.map +1 -1
  43. package/dist/adapters/solana/connection.d.ts +11 -2
  44. package/dist/adapters/solana/connection.d.ts.map +1 -1
  45. package/dist/adapters/solana/connection.js +11 -2
  46. package/dist/adapters/solana/connection.js.map +1 -1
  47. package/dist/adapters/solana/index.d.ts +7 -1
  48. package/dist/adapters/solana/index.d.ts.map +1 -1
  49. package/dist/adapters/solana/index.js +7 -1
  50. package/dist/adapters/solana/index.js.map +1 -1
  51. package/dist/adapters/solana/public-key.d.ts +11 -2
  52. package/dist/adapters/solana/public-key.d.ts.map +1 -1
  53. package/dist/adapters/solana/public-key.js +11 -2
  54. package/dist/adapters/solana/public-key.js.map +1 -1
  55. package/dist/config/defaults.d.ts +5 -0
  56. package/dist/config/defaults.d.ts.map +1 -1
  57. package/dist/config/defaults.js +5 -0
  58. package/dist/config/defaults.js.map +1 -1
  59. package/dist/config/env.d.ts +4 -0
  60. package/dist/config/env.d.ts.map +1 -1
  61. package/dist/config/env.js +11 -6
  62. package/dist/config/env.js.map +1 -1
  63. package/dist/config/index.d.ts +5 -0
  64. package/dist/config/index.d.ts.map +1 -1
  65. package/dist/config/index.js +5 -0
  66. package/dist/config/index.js.map +1 -1
  67. package/dist/config/mcp-client-injection.d.ts.map +1 -1
  68. package/dist/config/mcp-client-injection.js +97 -1
  69. package/dist/config/mcp-client-injection.js.map +1 -1
  70. package/dist/config/paths.d.ts +5 -0
  71. package/dist/config/paths.d.ts.map +1 -1
  72. package/dist/config/paths.js +5 -0
  73. package/dist/config/paths.js.map +1 -1
  74. package/dist/config/profiles.d.ts +3 -10
  75. package/dist/config/profiles.d.ts.map +1 -1
  76. package/dist/config/profiles.js +5 -0
  77. package/dist/config/profiles.js.map +1 -1
  78. package/dist/config/schema.d.ts +5 -0
  79. package/dist/config/schema.d.ts.map +1 -1
  80. package/dist/config/schema.js +5 -0
  81. package/dist/config/schema.js.map +1 -1
  82. package/dist/config/secure-config.d.ts +5 -0
  83. package/dist/config/secure-config.d.ts.map +1 -1
  84. package/dist/config/secure-config.js +5 -0
  85. package/dist/config/secure-config.js.map +1 -1
  86. package/dist/config/setup.d.ts +5 -0
  87. package/dist/config/setup.d.ts.map +1 -1
  88. package/dist/config/setup.js +5 -0
  89. package/dist/config/setup.js.map +1 -1
  90. package/dist/config-cli.d.ts +3 -13
  91. package/dist/config-cli.d.ts.map +1 -1
  92. package/dist/config-cli.js +5 -0
  93. package/dist/config-cli.js.map +1 -1
  94. package/dist/core/constants.d.ts +25 -6
  95. package/dist/core/constants.d.ts.map +1 -1
  96. package/dist/core/constants.js +27 -8
  97. package/dist/core/constants.js.map +1 -1
  98. package/dist/core/errors.d.ts +5 -0
  99. package/dist/core/errors.d.ts.map +1 -1
  100. package/dist/core/errors.js +5 -0
  101. package/dist/core/errors.js.map +1 -1
  102. package/dist/core/guards.d.ts +5 -0
  103. package/dist/core/guards.d.ts.map +1 -1
  104. package/dist/core/guards.js +3 -1
  105. package/dist/core/guards.js.map +1 -1
  106. package/dist/core/index.d.ts +7 -1
  107. package/dist/core/index.d.ts.map +1 -1
  108. package/dist/core/index.js +7 -1
  109. package/dist/core/index.js.map +1 -1
  110. package/dist/core/logger.js +1 -1
  111. package/dist/core/logger.js.map +1 -1
  112. package/dist/core/result.d.ts +77 -9
  113. package/dist/core/result.d.ts.map +1 -1
  114. package/dist/core/result.js +68 -9
  115. package/dist/core/result.js.map +1 -1
  116. package/dist/core/types.d.ts +5 -0
  117. package/dist/core/types.d.ts.map +1 -1
  118. package/dist/core/types.js +3 -4
  119. package/dist/core/types.js.map +1 -1
  120. package/dist/index.d.ts +5 -0
  121. package/dist/index.d.ts.map +1 -1
  122. package/dist/index.js +5 -0
  123. package/dist/index.js.map +1 -1
  124. package/dist/payments/facilitator-rpc-fallback.d.ts.map +1 -1
  125. package/dist/payments/facilitator-rpc-fallback.js +95 -0
  126. package/dist/payments/facilitator-rpc-fallback.js.map +1 -1
  127. package/dist/payments/hosted-tool-eligibility.d.ts +1 -0
  128. package/dist/payments/hosted-tool-eligibility.d.ts.map +1 -1
  129. package/dist/payments/hosted-tool-eligibility.js +1 -0
  130. package/dist/payments/hosted-tool-eligibility.js.map +1 -1
  131. package/dist/payments/mcp-session-cache.d.ts +35 -0
  132. package/dist/payments/mcp-session-cache.d.ts.map +1 -0
  133. package/dist/payments/mcp-session-cache.js +83 -0
  134. package/dist/payments/mcp-session-cache.js.map +1 -0
  135. package/dist/payments/monetization-gate.d.ts +5 -0
  136. package/dist/payments/monetization-gate.d.ts.map +1 -1
  137. package/dist/payments/monetization-gate.js +24 -1
  138. package/dist/payments/monetization-gate.js.map +1 -1
  139. package/dist/payments/pricing.d.ts +1 -0
  140. package/dist/payments/pricing.d.ts.map +1 -1
  141. package/dist/payments/pricing.js +64 -8
  142. package/dist/payments/pricing.js.map +1 -1
  143. package/dist/payments/usage-ledger.d.ts +36 -2
  144. package/dist/payments/usage-ledger.d.ts.map +1 -1
  145. package/dist/payments/usage-ledger.js +121 -4
  146. package/dist/payments/usage-ledger.js.map +1 -1
  147. package/dist/payments/x402-paid-call.d.ts +50 -0
  148. package/dist/payments/x402-paid-call.d.ts.map +1 -1
  149. package/dist/payments/x402-paid-call.js +171 -0
  150. package/dist/payments/x402-paid-call.js.map +1 -1
  151. package/dist/policy/default-policies.d.ts +18 -2
  152. package/dist/policy/default-policies.d.ts.map +1 -1
  153. package/dist/policy/default-policies.js +18 -2
  154. package/dist/policy/default-policies.js.map +1 -1
  155. package/dist/policy/index.d.ts +6 -3
  156. package/dist/policy/index.d.ts.map +1 -1
  157. package/dist/policy/index.js +6 -3
  158. package/dist/policy/index.js.map +1 -1
  159. package/dist/policy/local-policy-engine.d.ts +71 -13
  160. package/dist/policy/local-policy-engine.d.ts.map +1 -1
  161. package/dist/policy/local-policy-engine.js +33 -11
  162. package/dist/policy/local-policy-engine.js.map +1 -1
  163. package/dist/policy/permission-checks.d.ts +29 -3
  164. package/dist/policy/permission-checks.d.ts.map +1 -1
  165. package/dist/policy/permission-checks.js +29 -3
  166. package/dist/policy/permission-checks.js.map +1 -1
  167. package/dist/policy/policy-engine.d.ts +22 -2
  168. package/dist/policy/policy-engine.d.ts.map +1 -1
  169. package/dist/policy/policy-engine.js +22 -2
  170. package/dist/policy/policy-engine.js.map +1 -1
  171. package/dist/policy/policy-types.d.ts +55 -5
  172. package/dist/policy/policy-types.d.ts.map +1 -1
  173. package/dist/policy/policy-types.js +8 -1
  174. package/dist/policy/policy-types.js.map +1 -1
  175. package/dist/policy/risk-level.d.ts +32 -3
  176. package/dist/policy/risk-level.d.ts.map +1 -1
  177. package/dist/policy/risk-level.js +32 -3
  178. package/dist/policy/risk-level.js.map +1 -1
  179. package/dist/policy/spending-limits.d.ts +29 -3
  180. package/dist/policy/spending-limits.d.ts.map +1 -1
  181. package/dist/policy/spending-limits.js +29 -3
  182. package/dist/policy/spending-limits.js.map +1 -1
  183. package/dist/premium/activation-manager.d.ts +43 -0
  184. package/dist/premium/activation-manager.d.ts.map +1 -0
  185. package/dist/premium/activation-manager.js +131 -0
  186. package/dist/premium/activation-manager.js.map +1 -0
  187. package/dist/premium/builtin-plugins.d.ts +143 -0
  188. package/dist/premium/builtin-plugins.d.ts.map +1 -0
  189. package/dist/premium/builtin-plugins.js +394 -0
  190. package/dist/premium/builtin-plugins.js.map +1 -0
  191. package/dist/premium/event-store.d.ts +61 -0
  192. package/dist/premium/event-store.d.ts.map +1 -0
  193. package/dist/premium/event-store.js +130 -0
  194. package/dist/premium/event-store.js.map +1 -0
  195. package/dist/premium/index.d.ts +54 -0
  196. package/dist/premium/index.d.ts.map +1 -0
  197. package/dist/premium/index.js +54 -0
  198. package/dist/premium/index.js.map +1 -0
  199. package/dist/premium/manifest-builder.d.ts +65 -0
  200. package/dist/premium/manifest-builder.d.ts.map +1 -0
  201. package/dist/premium/manifest-builder.js +182 -0
  202. package/dist/premium/manifest-builder.js.map +1 -0
  203. package/dist/premium/meme-radar-capabilities.d.ts +38 -0
  204. package/dist/premium/meme-radar-capabilities.d.ts.map +1 -0
  205. package/dist/premium/meme-radar-capabilities.js +306 -0
  206. package/dist/premium/meme-radar-capabilities.js.map +1 -0
  207. package/dist/premium/metrics.d.ts +27 -0
  208. package/dist/premium/metrics.d.ts.map +1 -0
  209. package/dist/premium/metrics.js +65 -0
  210. package/dist/premium/metrics.js.map +1 -0
  211. package/dist/premium/plugin-validator.d.ts +39 -0
  212. package/dist/premium/plugin-validator.d.ts.map +1 -0
  213. package/dist/premium/plugin-validator.js +325 -0
  214. package/dist/premium/plugin-validator.js.map +1 -0
  215. package/dist/premium/private-manifest-loader.d.ts +111 -0
  216. package/dist/premium/private-manifest-loader.d.ts.map +1 -0
  217. package/dist/premium/private-manifest-loader.js +285 -0
  218. package/dist/premium/private-manifest-loader.js.map +1 -0
  219. package/dist/premium/provider-bridge.d.ts +109 -0
  220. package/dist/premium/provider-bridge.d.ts.map +1 -0
  221. package/dist/premium/provider-bridge.js +239 -0
  222. package/dist/premium/provider-bridge.js.map +1 -0
  223. package/dist/premium/session-manager.d.ts +125 -0
  224. package/dist/premium/session-manager.d.ts.map +1 -0
  225. package/dist/premium/session-manager.js +337 -0
  226. package/dist/premium/session-manager.js.map +1 -0
  227. package/dist/premium/stream-broker.d.ts +98 -0
  228. package/dist/premium/stream-broker.d.ts.map +1 -0
  229. package/dist/premium/stream-broker.js +199 -0
  230. package/dist/premium/stream-broker.js.map +1 -0
  231. package/dist/premium/tech-fundamentals-capabilities.d.ts +37 -0
  232. package/dist/premium/tech-fundamentals-capabilities.d.ts.map +1 -0
  233. package/dist/premium/tech-fundamentals-capabilities.js +283 -0
  234. package/dist/premium/tech-fundamentals-capabilities.js.map +1 -0
  235. package/dist/premium/trading-capabilities.d.ts +36 -0
  236. package/dist/premium/trading-capabilities.d.ts.map +1 -0
  237. package/dist/premium/trading-capabilities.js +205 -0
  238. package/dist/premium/trading-capabilities.js.map +1 -0
  239. package/dist/premium/types.d.ts +518 -0
  240. package/dist/premium/types.d.ts.map +1 -0
  241. package/dist/premium/types.js +23 -0
  242. package/dist/premium/types.js.map +1 -0
  243. package/dist/premium/webhook-engine.d.ts +102 -0
  244. package/dist/premium/webhook-engine.d.ts.map +1 -0
  245. package/dist/premium/webhook-engine.js +382 -0
  246. package/dist/premium/webhook-engine.js.map +1 -0
  247. package/dist/prompts/context/sap-agent-context.prompt.d.ts +5 -0
  248. package/dist/prompts/context/sap-agent-context.prompt.d.ts.map +1 -1
  249. package/dist/prompts/context/sap-agent-context.prompt.js +2 -8
  250. package/dist/prompts/context/sap-agent-context.prompt.js.map +1 -1
  251. package/dist/prompts/context/sap-agent-intent-router.prompt.d.ts +14 -0
  252. package/dist/prompts/context/sap-agent-intent-router.prompt.d.ts.map +1 -0
  253. package/dist/prompts/context/sap-agent-intent-router.prompt.js +155 -0
  254. package/dist/prompts/context/sap-agent-intent-router.prompt.js.map +1 -0
  255. package/dist/prompts/context/sap-agent-start.prompt.js +1 -0
  256. package/dist/prompts/context/sap-agent-start.prompt.js.map +1 -1
  257. package/dist/prompts/developer/debug-sap-error.prompt.d.ts +5 -0
  258. package/dist/prompts/developer/debug-sap-error.prompt.d.ts.map +1 -1
  259. package/dist/prompts/developer/debug-sap-error.prompt.js +3 -4
  260. package/dist/prompts/developer/debug-sap-error.prompt.js.map +1 -1
  261. package/dist/prompts/developer/generate-sap-integration.prompt.d.ts +5 -0
  262. package/dist/prompts/developer/generate-sap-integration.prompt.d.ts.map +1 -1
  263. package/dist/prompts/developer/generate-sap-integration.prompt.js +3 -4
  264. package/dist/prompts/developer/generate-sap-integration.prompt.js.map +1 -1
  265. package/dist/prompts/developer/index.d.ts +4 -1
  266. package/dist/prompts/developer/index.d.ts.map +1 -1
  267. package/dist/prompts/developer/index.js +4 -1
  268. package/dist/prompts/developer/index.js.map +1 -1
  269. package/dist/prompts/execution-proof/explain-proof-of-execution.prompt.d.ts +5 -0
  270. package/dist/prompts/execution-proof/explain-proof-of-execution.prompt.d.ts.map +1 -1
  271. package/dist/prompts/execution-proof/explain-proof-of-execution.prompt.js +3 -4
  272. package/dist/prompts/execution-proof/explain-proof-of-execution.prompt.js.map +1 -1
  273. package/dist/prompts/execution-proof/index.d.ts +4 -1
  274. package/dist/prompts/execution-proof/index.d.ts.map +1 -1
  275. package/dist/prompts/execution-proof/index.js +4 -1
  276. package/dist/prompts/execution-proof/index.js.map +1 -1
  277. package/dist/prompts/execution-proof/verify-execution-proof.prompt.d.ts +5 -0
  278. package/dist/prompts/execution-proof/verify-execution-proof.prompt.d.ts.map +1 -1
  279. package/dist/prompts/execution-proof/verify-execution-proof.prompt.js +3 -4
  280. package/dist/prompts/execution-proof/verify-execution-proof.prompt.js.map +1 -1
  281. package/dist/prompts/index.d.ts +4 -1
  282. package/dist/prompts/index.d.ts.map +1 -1
  283. package/dist/prompts/index.js +4 -1
  284. package/dist/prompts/index.js.map +1 -1
  285. package/dist/prompts/payments/create-paid-api.prompt.d.ts +5 -0
  286. package/dist/prompts/payments/create-paid-api.prompt.d.ts.map +1 -1
  287. package/dist/prompts/payments/create-paid-api.prompt.js +3 -4
  288. package/dist/prompts/payments/create-paid-api.prompt.js.map +1 -1
  289. package/dist/prompts/payments/explain-x402-settlement.prompt.d.ts +5 -0
  290. package/dist/prompts/payments/explain-x402-settlement.prompt.d.ts.map +1 -1
  291. package/dist/prompts/payments/explain-x402-settlement.prompt.js +3 -4
  292. package/dist/prompts/payments/explain-x402-settlement.prompt.js.map +1 -1
  293. package/dist/prompts/payments/index.d.ts +4 -1
  294. package/dist/prompts/payments/index.d.ts.map +1 -1
  295. package/dist/prompts/payments/index.js +4 -1
  296. package/dist/prompts/payments/index.js.map +1 -1
  297. package/dist/prompts/register-prompts.d.ts +18 -2
  298. package/dist/prompts/register-prompts.d.ts.map +1 -1
  299. package/dist/prompts/register-prompts.js +21 -3
  300. package/dist/prompts/register-prompts.js.map +1 -1
  301. package/dist/prompts/registry/analyze-sap-agent.prompt.d.ts +5 -0
  302. package/dist/prompts/registry/analyze-sap-agent.prompt.d.ts.map +1 -1
  303. package/dist/prompts/registry/analyze-sap-agent.prompt.js +3 -4
  304. package/dist/prompts/registry/analyze-sap-agent.prompt.js.map +1 -1
  305. package/dist/prompts/registry/index.d.ts +4 -1
  306. package/dist/prompts/registry/index.d.ts.map +1 -1
  307. package/dist/prompts/registry/index.js +4 -1
  308. package/dist/prompts/registry/index.js.map +1 -1
  309. package/dist/prompts/registry/register-sap-agent.prompt.d.ts +5 -0
  310. package/dist/prompts/registry/register-sap-agent.prompt.d.ts.map +1 -1
  311. package/dist/prompts/registry/register-sap-agent.prompt.js +3 -4
  312. package/dist/prompts/registry/register-sap-agent.prompt.js.map +1 -1
  313. package/dist/remote/premium-memory.d.ts +90 -0
  314. package/dist/remote/premium-memory.d.ts.map +1 -0
  315. package/dist/remote/premium-memory.js +161 -0
  316. package/dist/remote/premium-memory.js.map +1 -0
  317. package/dist/remote/premium-routes.d.ts +99 -0
  318. package/dist/remote/premium-routes.d.ts.map +1 -0
  319. package/dist/remote/premium-routes.js +346 -0
  320. package/dist/remote/premium-routes.js.map +1 -0
  321. package/dist/remote/public-home/sections.d.ts.map +1 -1
  322. package/dist/remote/public-home/sections.js +7 -1
  323. package/dist/remote/public-home/sections.js.map +1 -1
  324. package/dist/remote/public-home/types.d.ts +6 -0
  325. package/dist/remote/public-home/types.d.ts.map +1 -1
  326. package/dist/remote/server.d.ts +18 -0
  327. package/dist/remote/server.d.ts.map +1 -1
  328. package/dist/remote/server.js +298 -116
  329. package/dist/remote/server.js.map +1 -1
  330. package/dist/remote/tx-relay.d.ts +42 -0
  331. package/dist/remote/tx-relay.d.ts.map +1 -0
  332. package/dist/remote/tx-relay.js +118 -0
  333. package/dist/remote/tx-relay.js.map +1 -0
  334. package/dist/resources/current/sap-current-config.resource.d.ts +5 -0
  335. package/dist/resources/current/sap-current-config.resource.d.ts.map +1 -1
  336. package/dist/resources/current/sap-current-config.resource.js +2 -5
  337. package/dist/resources/current/sap-current-config.resource.js.map +1 -1
  338. package/dist/resources/execution-proof/index.d.ts +5 -0
  339. package/dist/resources/execution-proof/index.d.ts.map +1 -1
  340. package/dist/resources/execution-proof/index.js +5 -0
  341. package/dist/resources/execution-proof/index.js.map +1 -1
  342. package/dist/resources/execution-proof/sap-execution-record.resource.d.ts +5 -0
  343. package/dist/resources/execution-proof/sap-execution-record.resource.d.ts.map +1 -1
  344. package/dist/resources/execution-proof/sap-execution-record.resource.js +3 -4
  345. package/dist/resources/execution-proof/sap-execution-record.resource.js.map +1 -1
  346. package/dist/resources/index.d.ts +5 -0
  347. package/dist/resources/index.d.ts.map +1 -1
  348. package/dist/resources/index.js +5 -0
  349. package/dist/resources/index.js.map +1 -1
  350. package/dist/resources/memory/index.d.ts +5 -0
  351. package/dist/resources/memory/index.d.ts.map +1 -1
  352. package/dist/resources/memory/index.js +5 -0
  353. package/dist/resources/memory/index.js.map +1 -1
  354. package/dist/resources/memory/sap-memory.resource.d.ts +5 -0
  355. package/dist/resources/memory/sap-memory.resource.d.ts.map +1 -1
  356. package/dist/resources/memory/sap-memory.resource.js +3 -4
  357. package/dist/resources/memory/sap-memory.resource.js.map +1 -1
  358. package/dist/resources/profile/sap-active-profile.resource.d.ts +5 -0
  359. package/dist/resources/profile/sap-active-profile.resource.d.ts.map +1 -1
  360. package/dist/resources/profile/sap-active-profile.resource.js +2 -5
  361. package/dist/resources/profile/sap-active-profile.resource.js.map +1 -1
  362. package/dist/resources/register-resources.d.ts +5 -0
  363. package/dist/resources/register-resources.d.ts.map +1 -1
  364. package/dist/resources/register-resources.js +3 -1
  365. package/dist/resources/register-resources.js.map +1 -1
  366. package/dist/resources/registry/index.d.ts +5 -0
  367. package/dist/resources/registry/index.d.ts.map +1 -1
  368. package/dist/resources/registry/index.js +5 -0
  369. package/dist/resources/registry/index.js.map +1 -1
  370. package/dist/resources/registry/sap-agent.resource.d.ts +5 -0
  371. package/dist/resources/registry/sap-agent.resource.d.ts.map +1 -1
  372. package/dist/resources/registry/sap-agent.resource.js +3 -4
  373. package/dist/resources/registry/sap-agent.resource.js.map +1 -1
  374. package/dist/resources/registry/sap-global-registry.resource.d.ts +18 -4
  375. package/dist/resources/registry/sap-global-registry.resource.d.ts.map +1 -1
  376. package/dist/resources/registry/sap-global-registry.resource.js +18 -4
  377. package/dist/resources/registry/sap-global-registry.resource.js.map +1 -1
  378. package/dist/resources/reputation/index.d.ts +4 -1
  379. package/dist/resources/reputation/index.d.ts.map +1 -1
  380. package/dist/resources/reputation/index.js +4 -1
  381. package/dist/resources/reputation/index.js.map +1 -1
  382. package/dist/resources/reputation/sap-reputation.resource.d.ts +18 -4
  383. package/dist/resources/reputation/sap-reputation.resource.d.ts.map +1 -1
  384. package/dist/resources/reputation/sap-reputation.resource.js +18 -4
  385. package/dist/resources/reputation/sap-reputation.resource.js.map +1 -1
  386. package/dist/resources/tool-schema/index.d.ts +4 -1
  387. package/dist/resources/tool-schema/index.d.ts.map +1 -1
  388. package/dist/resources/tool-schema/index.js +4 -1
  389. package/dist/resources/tool-schema/index.js.map +1 -1
  390. package/dist/resources/tool-schema/sap-tool-schema.resource.d.ts +18 -4
  391. package/dist/resources/tool-schema/sap-tool-schema.resource.d.ts.map +1 -1
  392. package/dist/resources/tool-schema/sap-tool-schema.resource.js +18 -4
  393. package/dist/resources/tool-schema/sap-tool-schema.resource.js.map +1 -1
  394. package/dist/sap/index.d.ts +7 -1
  395. package/dist/sap/index.d.ts.map +1 -1
  396. package/dist/sap/index.js +7 -1
  397. package/dist/sap/index.js.map +1 -1
  398. package/dist/sap/sap-client-manager.d.ts +80 -13
  399. package/dist/sap/sap-client-manager.d.ts.map +1 -1
  400. package/dist/sap/sap-client-manager.js +80 -13
  401. package/dist/sap/sap-client-manager.js.map +1 -1
  402. package/dist/sap/sap-errors.d.ts +22 -3
  403. package/dist/sap/sap-errors.d.ts.map +1 -1
  404. package/dist/sap/sap-errors.js +22 -3
  405. package/dist/sap/sap-errors.js.map +1 -1
  406. package/dist/sap/sap-types.d.ts +75 -6
  407. package/dist/sap/sap-types.d.ts.map +1 -1
  408. package/dist/sap/sap-types.js +11 -1
  409. package/dist/sap/sap-types.js.map +1 -1
  410. package/dist/schemas/common.schema.d.ts +45 -8
  411. package/dist/schemas/common.schema.d.ts.map +1 -1
  412. package/dist/schemas/common.schema.js +45 -8
  413. package/dist/schemas/common.schema.js.map +1 -1
  414. package/dist/schemas/developer.schema.d.ts +22 -3
  415. package/dist/schemas/developer.schema.d.ts.map +1 -1
  416. package/dist/schemas/developer.schema.js +22 -3
  417. package/dist/schemas/developer.schema.js.map +1 -1
  418. package/dist/schemas/execution-proof.schema.d.ts +29 -4
  419. package/dist/schemas/execution-proof.schema.d.ts.map +1 -1
  420. package/dist/schemas/execution-proof.schema.js +29 -4
  421. package/dist/schemas/execution-proof.schema.js.map +1 -1
  422. package/dist/schemas/identity.schema.d.ts +23 -3
  423. package/dist/schemas/identity.schema.d.ts.map +1 -1
  424. package/dist/schemas/identity.schema.js +23 -3
  425. package/dist/schemas/identity.schema.js.map +1 -1
  426. package/dist/schemas/index.d.ts +11 -1
  427. package/dist/schemas/index.d.ts.map +1 -1
  428. package/dist/schemas/index.js +11 -1
  429. package/dist/schemas/index.js.map +1 -1
  430. package/dist/schemas/memory.schema.d.ts +23 -3
  431. package/dist/schemas/memory.schema.d.ts.map +1 -1
  432. package/dist/schemas/memory.schema.js +23 -3
  433. package/dist/schemas/memory.schema.js.map +1 -1
  434. package/dist/schemas/payments.schema.d.ts +24 -3
  435. package/dist/schemas/payments.schema.d.ts.map +1 -1
  436. package/dist/schemas/payments.schema.js +24 -3
  437. package/dist/schemas/payments.schema.js.map +1 -1
  438. package/dist/schemas/registry.schema.d.ts +36 -4
  439. package/dist/schemas/registry.schema.d.ts.map +1 -1
  440. package/dist/schemas/registry.schema.js +36 -4
  441. package/dist/schemas/registry.schema.js.map +1 -1
  442. package/dist/schemas/reputation.schema.d.ts +22 -3
  443. package/dist/schemas/reputation.schema.d.ts.map +1 -1
  444. package/dist/schemas/reputation.schema.js +22 -3
  445. package/dist/schemas/reputation.schema.js.map +1 -1
  446. package/dist/schemas/settlement.schema.d.ts +31 -4
  447. package/dist/schemas/settlement.schema.d.ts.map +1 -1
  448. package/dist/schemas/settlement.schema.js +31 -4
  449. package/dist/schemas/settlement.schema.js.map +1 -1
  450. package/dist/schemas/tool-schema.schema.d.ts +29 -3
  451. package/dist/schemas/tool-schema.schema.d.ts.map +1 -1
  452. package/dist/schemas/tool-schema.schema.js +29 -3
  453. package/dist/schemas/tool-schema.schema.js.map +1 -1
  454. package/dist/schemas/transaction.schema.d.ts +23 -3
  455. package/dist/schemas/transaction.schema.d.ts.map +1 -1
  456. package/dist/schemas/transaction.schema.js +23 -3
  457. package/dist/schemas/transaction.schema.js.map +1 -1
  458. package/dist/security/approval-required.d.ts +19 -2
  459. package/dist/security/approval-required.d.ts.map +1 -1
  460. package/dist/security/approval-required.js +19 -2
  461. package/dist/security/approval-required.js.map +1 -1
  462. package/dist/security/index.d.ts +7 -1
  463. package/dist/security/index.d.ts.map +1 -1
  464. package/dist/security/index.js +7 -1
  465. package/dist/security/index.js.map +1 -1
  466. package/dist/security/private-key-guard.d.ts +18 -2
  467. package/dist/security/private-key-guard.d.ts.map +1 -1
  468. package/dist/security/private-key-guard.js +19 -2
  469. package/dist/security/private-key-guard.js.map +1 -1
  470. package/dist/security/prompt-injection-notes.d.ts +10 -1
  471. package/dist/security/prompt-injection-notes.d.ts.map +1 -1
  472. package/dist/security/prompt-injection-notes.js +10 -1
  473. package/dist/security/prompt-injection-notes.js.map +1 -1
  474. package/dist/security/unsafe-action-guard.d.ts +36 -10
  475. package/dist/security/unsafe-action-guard.d.ts.map +1 -1
  476. package/dist/security/unsafe-action-guard.js +67 -15
  477. package/dist/security/unsafe-action-guard.js.map +1 -1
  478. package/dist/server/create-server.d.ts +18 -3
  479. package/dist/server/create-server.d.ts.map +1 -1
  480. package/dist/server/create-server.js +18 -3
  481. package/dist/server/create-server.js.map +1 -1
  482. package/dist/server/index.d.ts +6 -1
  483. package/dist/server/index.d.ts.map +1 -1
  484. package/dist/server/index.js +6 -1
  485. package/dist/server/index.js.map +1 -1
  486. package/dist/server/register-capabilities.d.ts +17 -2
  487. package/dist/server/register-capabilities.d.ts.map +1 -1
  488. package/dist/server/register-capabilities.js +17 -2
  489. package/dist/server/register-capabilities.js.map +1 -1
  490. package/dist/server/server-metadata.d.ts +34 -1
  491. package/dist/server/server-metadata.d.ts.map +1 -1
  492. package/dist/server/server-metadata.js +35 -2
  493. package/dist/server/server-metadata.js.map +1 -1
  494. package/dist/session/agent-session.d.ts +35 -4
  495. package/dist/session/agent-session.d.ts.map +1 -1
  496. package/dist/session/agent-session.js +35 -4
  497. package/dist/session/agent-session.js.map +1 -1
  498. package/dist/session/delegated-session.d.ts +31 -3
  499. package/dist/session/delegated-session.d.ts.map +1 -1
  500. package/dist/session/delegated-session.js +31 -3
  501. package/dist/session/delegated-session.js.map +1 -1
  502. package/dist/session/index.d.ts +7 -1
  503. package/dist/session/index.d.ts.map +1 -1
  504. package/dist/session/index.js +7 -1
  505. package/dist/session/index.js.map +1 -1
  506. package/dist/session/redis-session-store.d.ts +94 -21
  507. package/dist/session/redis-session-store.d.ts.map +1 -1
  508. package/dist/session/redis-session-store.js +87 -20
  509. package/dist/session/redis-session-store.js.map +1 -1
  510. package/dist/session/session-limits.d.ts +34 -4
  511. package/dist/session/session-limits.d.ts.map +1 -1
  512. package/dist/session/session-limits.js +34 -4
  513. package/dist/session/session-limits.js.map +1 -1
  514. package/dist/session/session-permissions.d.ts +57 -7
  515. package/dist/session/session-permissions.d.ts.map +1 -1
  516. package/dist/session/session-permissions.js +57 -7
  517. package/dist/session/session-permissions.js.map +1 -1
  518. package/dist/session/session-store.d.ts +9 -1
  519. package/dist/session/session-store.d.ts.map +1 -1
  520. package/dist/session/session-store.js +18 -3
  521. package/dist/session/session-store.js.map +1 -1
  522. package/dist/session/session-types.d.ts +33 -4
  523. package/dist/session/session-types.d.ts.map +1 -1
  524. package/dist/session/session-types.js +9 -1
  525. package/dist/session/session-types.js.map +1 -1
  526. package/dist/signer/index.d.ts +7 -1
  527. package/dist/signer/index.d.ts.map +1 -1
  528. package/dist/signer/index.js +7 -1
  529. package/dist/signer/index.js.map +1 -1
  530. package/dist/signer/load-keypair.d.ts +25 -4
  531. package/dist/signer/load-keypair.d.ts.map +1 -1
  532. package/dist/signer/load-keypair.js +25 -4
  533. package/dist/signer/load-keypair.js.map +1 -1
  534. package/dist/signer/local-keypair-signer.d.ts +16 -2
  535. package/dist/signer/local-keypair-signer.d.ts.map +1 -1
  536. package/dist/signer/local-keypair-signer.js +16 -2
  537. package/dist/signer/local-keypair-signer.js.map +1 -1
  538. package/dist/signer/signer-resolver.d.ts +19 -2
  539. package/dist/signer/signer-resolver.d.ts.map +1 -1
  540. package/dist/signer/signer-resolver.js +26 -3
  541. package/dist/signer/signer-resolver.js.map +1 -1
  542. package/dist/signer/signer-types.d.ts +47 -5
  543. package/dist/signer/signer-types.d.ts.map +1 -1
  544. package/dist/signer/signer-types.js +13 -1
  545. package/dist/signer/signer-types.js.map +1 -1
  546. package/dist/tools/agent-start-tool.js +20 -1
  547. package/dist/tools/agent-start-tool.js.map +1 -1
  548. package/dist/tools/client-sdk-tools.d.ts.map +1 -1
  549. package/dist/tools/client-sdk-tools.js +27 -2
  550. package/dist/tools/client-sdk-tools.js.map +1 -1
  551. package/dist/tools/estimate-tool-cost.d.ts +13 -0
  552. package/dist/tools/estimate-tool-cost.d.ts.map +1 -0
  553. package/dist/tools/estimate-tool-cost.js +139 -0
  554. package/dist/tools/estimate-tool-cost.js.map +1 -0
  555. package/dist/tools/index.d.ts +6 -0
  556. package/dist/tools/index.d.ts.map +1 -1
  557. package/dist/tools/index.js +7 -0
  558. package/dist/tools/index.js.map +1 -1
  559. package/dist/tools/magicblock-tools.d.ts +25 -0
  560. package/dist/tools/magicblock-tools.d.ts.map +1 -1
  561. package/dist/tools/magicblock-tools.js +116 -8
  562. package/dist/tools/magicblock-tools.js.map +1 -1
  563. package/dist/tools/perp-tools.d.ts +39 -0
  564. package/dist/tools/perp-tools.d.ts.map +1 -0
  565. package/dist/tools/perp-tools.js +1110 -0
  566. package/dist/tools/perp-tools.js.map +1 -0
  567. package/dist/tools/premium-tools.d.ts +8 -0
  568. package/dist/tools/premium-tools.d.ts.map +1 -0
  569. package/dist/tools/premium-tools.js +732 -0
  570. package/dist/tools/premium-tools.js.map +1 -0
  571. package/dist/tools/register-tools.d.ts.map +1 -1
  572. package/dist/tools/register-tools.js +9 -0
  573. package/dist/tools/register-tools.js.map +1 -1
  574. package/dist/tools/sap-sdk-tools.d.ts.map +1 -1
  575. package/dist/tools/sap-sdk-tools.js +42 -32
  576. package/dist/tools/sap-sdk-tools.js.map +1 -1
  577. package/dist/tools/x402-paid-call-tool.js +2 -2
  578. package/dist/tools/x402-paid-call-tool.js.map +1 -1
  579. package/dist/transports/index.d.ts +6 -1
  580. package/dist/transports/index.d.ts.map +1 -1
  581. package/dist/transports/index.js +6 -1
  582. package/dist/transports/index.js.map +1 -1
  583. package/dist/transports/stdio.d.ts +17 -5
  584. package/dist/transports/stdio.d.ts.map +1 -1
  585. package/dist/transports/stdio.js +17 -5
  586. package/dist/transports/stdio.js.map +1 -1
  587. package/dist/tui/wizard-save.d.ts +88 -8
  588. package/dist/tui/wizard-save.d.ts.map +1 -1
  589. package/dist/tui/wizard-save.js +77 -8
  590. package/dist/tui/wizard-save.js.map +1 -1
  591. package/docs/06_PAYMENTS_X402_AND_PAYSH.md +3 -3
  592. package/docs/07_ENDPOINTS_AND_CLIENTS.md +4 -1
  593. package/docs/14_DESKTOP_WIZARD_RELEASE.md +3 -3
  594. package/docs/16_SAP_AGENT_IDENTITY_PIPELINE.md +6 -0
  595. package/docs/18_PREMIUM_PLUGIN_RUNTIME.md +108 -0
  596. package/docs/README.md +12 -0
  597. package/package.json +8 -9
  598. package/server.json +3 -3
  599. package/skills/sap-agent-registry/SKILL.md +6 -0
  600. package/skills/sap-mcp/SKILL.md +27 -4
  601. package/skills/sap-mcp/TOOL_REFERENCE.md +4 -1
  602. package/skills/sap-payments-x402/SKILL.md +22 -8
@@ -1,13 +1,29 @@
1
1
  /**
2
- * SAP Client Manager
2
+ * @name sap/sap-client-manager
3
+ * @description Creates and manages the SAP SDK client (`SapClient`) as a singleton with
4
+ * connection, wallet, and program ID configuration.
3
5
  *
4
- * Creates and manages SapClient from @oobe-protocol-labs/synapse-sap-sdk
5
- * with proper connection, wallet, and program ID configuration.
6
+ * @flow
7
+ * 1. `SapClientManager.getInstance()` returns the singleton manager.
8
+ * 2. `initialize(config)` creates a `SapClient` from the SDK, loading a wallet when needed.
9
+ * 3. If config hasn't changed, the existing client is reused.
10
+ * 4. `createSapClient`, `getSapClient`, and `isSapClientInitialized` are convenience wrappers.
11
+ *
12
+ * @module sap/sap-client-manager
6
13
  */
7
14
  import type { SapMcpConfig } from '../core/types.js';
8
15
  import type { SapClient } from '@oobe-protocol-labs/synapse-sap-sdk';
9
16
  /**
10
- * SAP Client Manager
17
+ * @name SapClientManager
18
+ * @description Singleton manager for the SAP SDK client with config-aware reinitialization.
19
+ *
20
+ * @method getInstance — Returns the singleton `SapClientManager` instance.
21
+ * @method initialize — Creates or reuses the `SapClient` based on config changes.
22
+ * @method getClient — Returns the initialized client (throws if not initialized).
23
+ * @method getClientOrNull — Returns the initialized client or `null`.
24
+ * @method reset — Resets the client and config (for testing).
25
+ *
26
+ * @usedBy `createSapClient`, `getSapClient`, `isSapClientInitialized`, `create-server.ts`
11
27
  */
12
28
  export declare class SapClientManager {
13
29
  private static instance;
@@ -15,40 +31,91 @@ export declare class SapClientManager {
15
31
  private config;
16
32
  private constructor();
17
33
  /**
18
- * Compares the connection and wallet fields that affect SapClient construction.
34
+ * @name SapClientManager.isSameClientConfig
35
+ * @description Compares connection and wallet fields that affect SapClient construction.
36
+ *
37
+ * @param current — Current stored config.
38
+ * @param next — New config to compare against.
39
+ * @returns `true` if the relevant config fields match, `false` otherwise.
40
+ *
41
+ * @internal
19
42
  */
20
43
  private isSameClientConfig;
21
44
  /**
22
- * Get singleton instance
45
+ * @name SapClientManager.getInstance
46
+ * @description Returns the singleton `SapClientManager` instance, creating it if necessary.
47
+ *
48
+ * @returns The singleton `SapClientManager`.
49
+ *
50
+ * @usedBy `createSapClient`, `getSapClient`, `isSapClientInitialized`.
23
51
  */
24
52
  static getInstance(): SapClientManager;
25
53
  /**
26
- * Initialize SAP client from config
54
+ * @name SapClientManager.initialize
55
+ * @description Initializes the SAP client from config, reusing the existing client if config hasn't changed.
56
+ *
57
+ * @param config — SAP MCP configuration with RPC URL, program ID, mode, and wallet path.
58
+ * @returns The initialized `SapClient` instance.
59
+ * @throws `SapClientError` if client creation fails.
60
+ *
61
+ * @usedBy `createSapClient`, `create-server.ts:createSapMcpServer`.
27
62
  */
28
63
  initialize(config: SapMcpConfig): Promise<SapClient>;
29
64
  /**
30
- * Get SAP client instance
65
+ * @name SapClientManager.getClient
66
+ * @description Returns the initialized SAP client.
67
+ *
68
+ * @returns The `SapClient` instance.
69
+ * @throws `SapClientError` if the client has not been initialized.
70
+ *
71
+ * @usedBy `getSapClient`.
31
72
  */
32
73
  getClient(): SapClient;
33
74
  /**
34
- * Get client or null if not initialized
75
+ * @name SapClientManager.getClientOrNull
76
+ * @description Returns the initialized SAP client or `null` if not yet initialized.
77
+ *
78
+ * @returns The `SapClient` instance or `null`.
79
+ *
80
+ * @usedBy `isSapClientInitialized`.
35
81
  */
36
82
  getClientOrNull(): SapClient | null;
37
83
  /**
38
- * Reset client (for testing)
84
+ * @name SapClientManager.reset
85
+ * @description Resets the client and config to `null` (for testing purposes).
86
+ *
87
+ * @usedBy Test setup and teardown.
39
88
  */
40
89
  reset(): void;
41
90
  }
42
91
  /**
43
- * Create SAP client from config
92
+ * @name createSapClient
93
+ * @description Creates or reuses the SAP client from the given configuration.
94
+ *
95
+ * @param config — SAP MCP configuration.
96
+ * @returns The initialized `SapClient` instance.
97
+ * @throws `SapClientError` if initialization fails.
98
+ *
99
+ * @usedBy `create-server.ts:createSapMcpServer`.
44
100
  */
45
101
  export declare function createSapClient(config: SapMcpConfig): Promise<SapClient>;
46
102
  /**
47
- * Get existing SAP client
103
+ * @name getSapClient
104
+ * @description Returns the currently initialized SAP client.
105
+ *
106
+ * @returns The `SapClient` instance.
107
+ * @throws `SapClientError` if the client has not been initialized.
108
+ *
109
+ * @usedBy Tool handlers across the SAP MCP runtime.
48
110
  */
49
111
  export declare function getSapClient(): SapClient;
50
112
  /**
51
- * Check if SAP client is initialized
113
+ * @name isSapClientInitialized
114
+ * @description Checks whether the SAP client has been initialized.
115
+ *
116
+ * @returns `true` if the client is initialized, `false` otherwise.
117
+ *
118
+ * @usedBy Health checks and startup validation.
52
119
  */
53
120
  export declare function isSapClientInitialized(): boolean;
54
121
  //# sourceMappingURL=sap-client-manager.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sap-client-manager.d.ts","sourceRoot":"","sources":["../../src/sap/sap-client-manager.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAErE;;GAEG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAiC;IACxD,OAAO,CAAC,MAAM,CAA0B;IACxC,OAAO,CAAC,MAAM,CAA6B;IAE3C,OAAO;IAEP;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAQ1B;;OAEG;IACH,MAAM,CAAC,WAAW,IAA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CAAC,CAG9E;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,IAAI,SAAS,CAGxC;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAGhD"}
@@ -1,15 +1,31 @@
1
1
  /**
2
- * SAP Client Manager
2
+ * @name sap/sap-client-manager
3
+ * @description Creates and manages the SAP SDK client (`SapClient`) as a singleton with
4
+ * connection, wallet, and program ID configuration.
3
5
  *
4
- * Creates and manages SapClient from @oobe-protocol-labs/synapse-sap-sdk
5
- * with proper connection, wallet, and program ID configuration.
6
+ * @flow
7
+ * 1. `SapClientManager.getInstance()` returns the singleton manager.
8
+ * 2. `initialize(config)` creates a `SapClient` from the SDK, loading a wallet when needed.
9
+ * 3. If config hasn't changed, the existing client is reused.
10
+ * 4. `createSapClient`, `getSapClient`, and `isSapClientInitialized` are convenience wrappers.
11
+ *
12
+ * @module sap/sap-client-manager
6
13
  */
7
14
  import { createSapClient as createSdkClient } from '@oobe-protocol-labs/synapse-sap-sdk';
8
15
  import { Wallet } from '@coral-xyz/anchor';
9
16
  import { logger } from '../core/logger.js';
10
17
  import { SapClientError } from '../core/errors.js';
11
18
  /**
12
- * SAP Client Manager
19
+ * @name SapClientManager
20
+ * @description Singleton manager for the SAP SDK client with config-aware reinitialization.
21
+ *
22
+ * @method getInstance — Returns the singleton `SapClientManager` instance.
23
+ * @method initialize — Creates or reuses the `SapClient` based on config changes.
24
+ * @method getClient — Returns the initialized client (throws if not initialized).
25
+ * @method getClientOrNull — Returns the initialized client or `null`.
26
+ * @method reset — Resets the client and config (for testing).
27
+ *
28
+ * @usedBy `createSapClient`, `getSapClient`, `isSapClientInitialized`, `create-server.ts`
13
29
  */
14
30
  export class SapClientManager {
15
31
  static instance = null;
@@ -17,7 +33,14 @@ export class SapClientManager {
17
33
  config = null;
18
34
  constructor() { }
19
35
  /**
20
- * Compares the connection and wallet fields that affect SapClient construction.
36
+ * @name SapClientManager.isSameClientConfig
37
+ * @description Compares connection and wallet fields that affect SapClient construction.
38
+ *
39
+ * @param current — Current stored config.
40
+ * @param next — New config to compare against.
41
+ * @returns `true` if the relevant config fields match, `false` otherwise.
42
+ *
43
+ * @internal
21
44
  */
22
45
  isSameClientConfig(current, next) {
23
46
  return current.rpcUrl === next.rpcUrl
@@ -27,7 +50,12 @@ export class SapClientManager {
27
50
  && current.walletPath === next.walletPath;
28
51
  }
29
52
  /**
30
- * Get singleton instance
53
+ * @name SapClientManager.getInstance
54
+ * @description Returns the singleton `SapClientManager` instance, creating it if necessary.
55
+ *
56
+ * @returns The singleton `SapClientManager`.
57
+ *
58
+ * @usedBy `createSapClient`, `getSapClient`, `isSapClientInitialized`.
31
59
  */
32
60
  static getInstance() {
33
61
  if (!SapClientManager.instance) {
@@ -36,7 +64,14 @@ export class SapClientManager {
36
64
  return SapClientManager.instance;
37
65
  }
38
66
  /**
39
- * Initialize SAP client from config
67
+ * @name SapClientManager.initialize
68
+ * @description Initializes the SAP client from config, reusing the existing client if config hasn't changed.
69
+ *
70
+ * @param config — SAP MCP configuration with RPC URL, program ID, mode, and wallet path.
71
+ * @returns The initialized `SapClient` instance.
72
+ * @throws `SapClientError` if client creation fails.
73
+ *
74
+ * @usedBy `createSapClient`, `create-server.ts:createSapMcpServer`.
40
75
  */
41
76
  async initialize(config) {
42
77
  if (this.client && this.config && this.isSameClientConfig(this.config, config)) {
@@ -82,7 +117,13 @@ export class SapClientManager {
82
117
  }
83
118
  }
84
119
  /**
85
- * Get SAP client instance
120
+ * @name SapClientManager.getClient
121
+ * @description Returns the initialized SAP client.
122
+ *
123
+ * @returns The `SapClient` instance.
124
+ * @throws `SapClientError` if the client has not been initialized.
125
+ *
126
+ * @usedBy `getSapClient`.
86
127
  */
87
128
  getClient() {
88
129
  if (!this.client) {
@@ -91,13 +132,21 @@ export class SapClientManager {
91
132
  return this.client;
92
133
  }
93
134
  /**
94
- * Get client or null if not initialized
135
+ * @name SapClientManager.getClientOrNull
136
+ * @description Returns the initialized SAP client or `null` if not yet initialized.
137
+ *
138
+ * @returns The `SapClient` instance or `null`.
139
+ *
140
+ * @usedBy `isSapClientInitialized`.
95
141
  */
96
142
  getClientOrNull() {
97
143
  return this.client;
98
144
  }
99
145
  /**
100
- * Reset client (for testing)
146
+ * @name SapClientManager.reset
147
+ * @description Resets the client and config to `null` (for testing purposes).
148
+ *
149
+ * @usedBy Test setup and teardown.
101
150
  */
102
151
  reset() {
103
152
  this.client = null;
@@ -106,21 +155,39 @@ export class SapClientManager {
106
155
  }
107
156
  }
108
157
  /**
109
- * Create SAP client from config
158
+ * @name createSapClient
159
+ * @description Creates or reuses the SAP client from the given configuration.
160
+ *
161
+ * @param config — SAP MCP configuration.
162
+ * @returns The initialized `SapClient` instance.
163
+ * @throws `SapClientError` if initialization fails.
164
+ *
165
+ * @usedBy `create-server.ts:createSapMcpServer`.
110
166
  */
111
167
  export async function createSapClient(config) {
112
168
  const manager = SapClientManager.getInstance();
113
169
  return manager.initialize(config);
114
170
  }
115
171
  /**
116
- * Get existing SAP client
172
+ * @name getSapClient
173
+ * @description Returns the currently initialized SAP client.
174
+ *
175
+ * @returns The `SapClient` instance.
176
+ * @throws `SapClientError` if the client has not been initialized.
177
+ *
178
+ * @usedBy Tool handlers across the SAP MCP runtime.
117
179
  */
118
180
  export function getSapClient() {
119
181
  const manager = SapClientManager.getInstance();
120
182
  return manager.getClient();
121
183
  }
122
184
  /**
123
- * Check if SAP client is initialized
185
+ * @name isSapClientInitialized
186
+ * @description Checks whether the SAP client has been initialized.
187
+ *
188
+ * @returns `true` if the client is initialized, `false` otherwise.
189
+ *
190
+ * @usedBy Health checks and startup validation.
124
191
  */
125
192
  export function isSapClientInitialized() {
126
193
  const manager = SapClientManager.getInstance();
@@ -1 +1 @@
1
- {"version":3,"file":"sap-client-manager.js","sourceRoot":"","sources":["../../src/sap/sap-client-manager.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,eAAe,IAAI,eAAe,EAAE,MAAM,qCAAqC,CAA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W,EAAE,CAAC;IAC/C,OAAO,OAAO,CAAC,SAAS,EAAE,CAAC;AAC7B,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,sBAAsB;IACpC,MAAM,OAAO,GAAG,gBAAgB,CAAC,WAAW,EAAE,CAAC;IAC/C,OAAO,OAAO,CAAC,eAAe,EAAE,KAAK,IAAI,CAAC;AAC5C,CAAC"}
@@ -1,13 +1,32 @@
1
1
  /**
2
- * SAP-specific error handling
2
+ * @name sap/sap-errors
3
+ * @description SAP SDK error mapping and type-guarding utilities.
4
+ *
5
+ * @flow
6
+ * 1. `mapSapError` normalizes unknown errors into `SapSdkError` instances.
7
+ * 2. `isSapError` is a type guard for checking if an error is already a `SapSdkError`.
8
+ *
9
+ * @module sap/sap-errors
3
10
  */
4
11
  import { SapSdkError } from '../core/errors.js';
5
12
  /**
6
- * Map SAP SDK errors to user-friendly messages
13
+ * @name mapSapError
14
+ * @description Maps unknown SAP SDK errors to user-friendly `SapSdkError` instances.
15
+ *
16
+ * @param error — Unknown error value to normalize.
17
+ * @returns A `SapSdkError` wrapping the original error message.
18
+ *
19
+ * @usedBy Tool error handlers across the SAP MCP runtime.
7
20
  */
8
21
  export declare function mapSapError(error: unknown): SapSdkError;
9
22
  /**
10
- * Check if error is a SAP SDK error
23
+ * @name isSapError
24
+ * @description Type guard that checks whether an error is a `SapSdkError`.
25
+ *
26
+ * @param error — Unknown error value to check.
27
+ * @returns `true` if the error is a `SapSdkError`, narrowing the type.
28
+ *
29
+ * @usedBy Tool error handlers across the SAP MCP runtime.
11
30
  */
12
31
  export declare function isSapError(error: unknown): error is SapSdkError;
13
32
  //# sourceMappingURL=sap-errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sap-errors.d.ts","sourceRoot":"","sources":["../../src/sap/sap-errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,WAAW,CAUvD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,WAAW,CAE/D"}
1
+ {"version":3,"file":"sap-errors.d.ts","sourceRoot":"","sources":["../../src/sap/sap-errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,WAAW,CAUvD;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,WAAW,CAE/D"}
@@ -1,9 +1,22 @@
1
1
  /**
2
- * SAP-specific error handling
2
+ * @name sap/sap-errors
3
+ * @description SAP SDK error mapping and type-guarding utilities.
4
+ *
5
+ * @flow
6
+ * 1. `mapSapError` normalizes unknown errors into `SapSdkError` instances.
7
+ * 2. `isSapError` is a type guard for checking if an error is already a `SapSdkError`.
8
+ *
9
+ * @module sap/sap-errors
3
10
  */
4
11
  import { SapSdkError } from '../core/errors.js';
5
12
  /**
6
- * Map SAP SDK errors to user-friendly messages
13
+ * @name mapSapError
14
+ * @description Maps unknown SAP SDK errors to user-friendly `SapSdkError` instances.
15
+ *
16
+ * @param error — Unknown error value to normalize.
17
+ * @returns A `SapSdkError` wrapping the original error message.
18
+ *
19
+ * @usedBy Tool error handlers across the SAP MCP runtime.
7
20
  */
8
21
  export function mapSapError(error) {
9
22
  if (error instanceof SapSdkError) {
@@ -15,7 +28,13 @@ export function mapSapError(error) {
15
28
  return new SapSdkError('Unknown SAP SDK error');
16
29
  }
17
30
  /**
18
- * Check if error is a SAP SDK error
31
+ * @name isSapError
32
+ * @description Type guard that checks whether an error is a `SapSdkError`.
33
+ *
34
+ * @param error — Unknown error value to check.
35
+ * @returns `true` if the error is a `SapSdkError`, narrowing the type.
36
+ *
37
+ * @usedBy Tool error handlers across the SAP MCP runtime.
19
38
  */
20
39
  export function isSapError(error) {
21
40
  return error instanceof SapSdkError;
@@ -1 +1 @@
1
- {"version":3,"file":"sap-errors.js","sourceRoot":"","sources":["../../src/sap/sap-errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,KAAc;IACxC,IAAI,KAAK,YAAY,WAAW,EAAE,CAAC;QACjC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC3B,OAAO,IAAI,WAAW,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC/C,CAAC;IAED,OAAO,IAAI,WAAW,CAAC,uBAAuB,CAAC,CAAC;AAClD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,KAAc;IACvC,OAAO,KAAK,YAAY,WAAW,CAAC;AACtC,CAAC"}
1
+ {"version":3,"file":"sap-errors.js","sourceRoot":"","sources":["../../src/sap/sap-errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;;;;;;;GAQG;AACH,MAAM,UAAU,WAAW,CAAC,KAAc;IACxC,IAAI,KAAK,YAAY,WAAW,EAAE,CAAC;QACjC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC3B,OAAO,IAAI,WAAW,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC/C,CAAC;IAED,OAAO,IAAI,WAAW,CAAC,uBAAuB,CAAC,CAAC;AAClD,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,UAAU,CAAC,KAAc;IACvC,OAAO,KAAK,YAAY,WAAW,CAAC;AACtC,CAAC"}
@@ -1,9 +1,31 @@
1
1
  /**
2
- * SAP type definitions
2
+ * @name sap/sap-types
3
+ * @description SAP Protocol on-chain account type definitions.
4
+ *
5
+ * These types mirror the on-chain data structures for agents, stats, escrows,
6
+ * vaults, and tools in the SAP Protocol program.
7
+ *
8
+ * @flow
9
+ * 1. SAP MCP tool handlers cast deserialized on-chain account data to these types.
10
+ * 2. `sap/index.ts` re-exports them for external consumers.
11
+ *
12
+ * @module sap/sap-types
3
13
  */
4
14
  import type { PublicKey } from '@solana/web3.js';
5
15
  /**
6
- * SAP Agent account
16
+ * @name SapAgent
17
+ * @description On-chain SAP agent account data.
18
+ *
19
+ * @property wallet — Agent's Solana wallet public key.
20
+ * @property pda — Program Derived Address of the agent account.
21
+ * @property name — Agent display name.
22
+ * @property capabilities — Array of capability identifier strings.
23
+ * @property metadataUri — Optional URI to off-chain agent metadata.
24
+ * @property x402Endpoint — Optional URL for the agent's x402 payment endpoint.
25
+ * @property isActive — Whether the agent is currently active.
26
+ * @property registeredAt — Unix timestamp of agent registration.
27
+ *
28
+ * @usedBy SAP registry tools, `sap/index.ts`
7
29
  */
8
30
  export interface SapAgent {
9
31
  wallet: PublicKey;
@@ -16,7 +38,16 @@ export interface SapAgent {
16
38
  registeredAt: number;
17
39
  }
18
40
  /**
19
- * SAP Agent stats
41
+ * @name SapAgentStats
42
+ * @description Aggregate statistics for a SAP agent.
43
+ *
44
+ * @property totalCalls — Total number of calls made by the agent.
45
+ * @property totalEarnings — Total earnings in lamports.
46
+ * @property reputationScore — Numerical reputation score.
47
+ * @property feedbackCount — Number of feedback attestations received.
48
+ * @property averageRating — Average rating from attestations.
49
+ *
50
+ * @usedBy SAP reputation tools, `sap/index.ts`
20
51
  */
21
52
  export interface SapAgentStats {
22
53
  totalCalls: number;
@@ -26,7 +57,20 @@ export interface SapAgentStats {
26
57
  averageRating: number;
27
58
  }
28
59
  /**
29
- * SAP Escrow
60
+ * @name SapEscrow
61
+ * @description On-chain SAP escrow account data for payment settlement.
62
+ *
63
+ * @property pda — Program Derived Address of the escrow account.
64
+ * @property depositor — Public key of the depositor.
65
+ * @property agent — Public key of the agent the escrow is for.
66
+ * @property balance — Current escrow balance in lamports.
67
+ * @property pricePerCall — Price per call in lamports.
68
+ * @property maxCalls — Maximum calls covered by the escrow.
69
+ * @property callsRemaining — Number of calls remaining in the escrow.
70
+ * @property expiresAt — Unix timestamp of escrow expiry.
71
+ * @property isActive — Whether the escrow is currently active.
72
+ *
73
+ * @usedBy SAP settlement tools, `sap/index.ts`
30
74
  */
31
75
  export interface SapEscrow {
32
76
  pda: PublicKey;
@@ -40,7 +84,16 @@ export interface SapEscrow {
40
84
  isActive: boolean;
41
85
  }
42
86
  /**
43
- * SAP Vault
87
+ * @name SapVault
88
+ * @description On-chain SAP memory vault account data.
89
+ *
90
+ * @property pda — Program Derived Address of the vault account.
91
+ * @property agent — Public key of the agent owning the vault.
92
+ * @property nonce — Cryptographic nonce for the vault.
93
+ * @property totalInscriptions — Total number of inscriptions in the vault.
94
+ * @property currentEpoch — Current epoch number of the vault.
95
+ *
96
+ * @usedBy SAP memory tools, `sap/index.ts`
44
97
  */
45
98
  export interface SapVault {
46
99
  pda: PublicKey;
@@ -50,7 +103,23 @@ export interface SapVault {
50
103
  currentEpoch: number;
51
104
  }
52
105
  /**
53
- * SAP Tool
106
+ * @name SapTool
107
+ * @description On-chain SAP tool schema account data.
108
+ *
109
+ * @property pda — Program Derived Address of the tool schema account.
110
+ * @property agent — Public key of the agent that published the tool.
111
+ * @property name — Tool name string.
112
+ * @property protocolHash — Hash of the tool protocol definition.
113
+ * @property descriptionHash — Hash of the tool description.
114
+ * @property inputSchemaHash — Hash of the tool input JSON schema.
115
+ * @property outputSchemaHash — Hash of the tool output JSON schema.
116
+ * @property httpMethod — HTTP method the tool exposes.
117
+ * @property category — Numeric category code for tool classification.
118
+ * @property paramsCount — Total number of parameters the tool accepts.
119
+ * @property requiredParams — Number of required parameters.
120
+ * @property isCompound — Whether the tool is a compound (multi-step) tool.
121
+ *
122
+ * @usedBy SAP tool-schema tools, `sap/index.ts`
54
123
  */
55
124
  export interface SapTool {
56
125
  pda: PublicKey;
@@ -1 +1 @@
1
- {"version":3,"file":"sap-types.d.ts","sourceRoot":"","sources":["../../src/sap/sap-types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,SAAS,CAAC;IAClB,GAAG,EAAE,SAAS,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,SAAS,CAAC;IACf,SAAS,EAAE,SAAS,CAAC;IACrB,KAAK,EAAE,SAAS,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,SAAS,CAAC;IACf,KAAK,EAAE,SAAS,CAAC;IACjB,KAAK,EAAE,UAAU,CAAC;IAClB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,YAAY,EAAE,MAAM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S,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,SAAS,CAAC;IACf,KAAK,EAAE,SAAS,CAAC;IACjB,KAAK,EAAE,UAAU,CAAC;IAClB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,OAAO;IACtB,GAAG,EAAE,SAAS,CAAC;IACf,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,UAAU,CAAC;IACzB,eAAe,EAAE,UAAU,CAAC;IAC5B,eAAe,EAAE,UAAU,CAAC;IAC5B,gBAAgB,EAAE,UAAU,CAAC;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,OAAO,CAAC;CACrB"}
@@ -1,5 +1,15 @@
1
1
  /**
2
- * SAP type definitions
2
+ * @name sap/sap-types
3
+ * @description SAP Protocol on-chain account type definitions.
4
+ *
5
+ * These types mirror the on-chain data structures for agents, stats, escrows,
6
+ * vaults, and tools in the SAP Protocol program.
7
+ *
8
+ * @flow
9
+ * 1. SAP MCP tool handlers cast deserialized on-chain account data to these types.
10
+ * 2. `sap/index.ts` re-exports them for external consumers.
11
+ *
12
+ * @module sap/sap-types
3
13
  */
4
14
  export {};
5
15
  //# sourceMappingURL=sap-types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sap-types.js","sourceRoot":"","sources":["../../src/sap/sap-types.ts"],"names":[],"mappings":"AAAA;;GAEG"}
1
+ {"version":3,"file":"sap-types.js","sourceRoot":"","sources":["../../src/sap/sap-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG"}
@@ -1,25 +1,56 @@
1
1
  /**
2
- * Common Zod schemas
2
+ * @name schemas/common
3
+ * @description Shared Zod schema primitives reused across every SAP MCP tool schema.
4
+ *
5
+ * These base schemas — wallet addresses, public keys, signatures, PDAs, pagination,
6
+ * amounts, and SOL amounts — are imported by domain-specific schema modules to
7
+ * build consistent validation rules without duplication.
8
+ *
9
+ * @flow
10
+ * 1. Domain schema modules (identity, registry, payments, etc.) import the
11
+ * primitives they need from this file.
12
+ * 2. `schemas/index.ts` re-exports everything for the MCP tool layer.
13
+ * 3. Tool handlers consume the composed schemas for input validation.
14
+ *
15
+ * @module schemas/common
3
16
  */
4
17
  import { z } from 'zod';
5
18
  /**
6
- * Shared wallet schema definition used by the SAP MCP runtime.
19
+ * @name WalletSchema
20
+ * @description Zod schema validating a base58-encoded Solana wallet address.
21
+ *
22
+ * @usedBy `identity.schema.ts`, `registry.schema.ts`, `payments.schema.ts`, `reputation.schema.ts`, `settlement.schema.ts`
7
23
  */
8
24
  export declare const WalletSchema: z.ZodString;
9
25
  /**
10
- * Shared public key schema definition used by the SAP MCP runtime.
26
+ * @name PublicKeySchema
27
+ * @description Zod schema validating a base58-encoded Solana public key.
28
+ *
29
+ * @usedBy Domain schema modules requiring generic public key validation.
11
30
  */
12
31
  export declare const PublicKeySchema: z.ZodString;
13
32
  /**
14
- * Shared signature schema definition used by the SAP MCP runtime.
33
+ * @name SignatureSchema
34
+ * @description Zod schema validating a base58-encoded transaction signature.
35
+ *
36
+ * @usedBy `execution-proof.schema.ts`, `transaction.schema.ts`
15
37
  */
16
38
  export declare const SignatureSchema: z.ZodString;
17
39
  /**
18
- * Shared pda schema definition used by the SAP MCP runtime.
40
+ * @name PdaSchema
41
+ * @description Zod schema validating a base58-encoded Program Derived Address.
42
+ *
43
+ * @usedBy `memory.schema.ts`, `registry.schema.ts`, `settlement.schema.ts`
19
44
  */
20
45
  export declare const PdaSchema: z.ZodString;
21
46
  /**
22
- * Shared pagination schema definition used by the SAP MCP runtime.
47
+ * @name PaginationSchema
48
+ * @description Zod schema for pagination parameters (limit and offset) with sensible defaults.
49
+ *
50
+ * @property limit — Maximum number of items to return (default 50).
51
+ * @property offset — Number of items to skip (default 0).
52
+ *
53
+ * @usedBy List-type MCP tools across the SAP MCP runtime.
23
54
  */
24
55
  export declare const PaginationSchema: z.ZodObject<{
25
56
  limit: z.ZodDefault<z.ZodNumber>;
@@ -32,11 +63,17 @@ export declare const PaginationSchema: z.ZodObject<{
32
63
  offset?: number | undefined;
33
64
  }>;
34
65
  /**
35
- * Shared amount schema definition used by the SAP MCP runtime.
66
+ * @name AmountSchema
67
+ * @description Zod schema validating a positive amount in lamports (1 SOL = 1e9 lamports).
68
+ *
69
+ * @usedBy `payments.schema.ts`, `settlement.schema.ts`
36
70
  */
37
71
  export declare const AmountSchema: z.ZodNumber;
38
72
  /**
39
- * Shared sol amount schema definition used by the SAP MCP runtime.
73
+ * @name SolAmountSchema
74
+ * @description Zod schema validating a non-negative amount in SOL.
75
+ *
76
+ * @usedBy Transaction and balance-related MCP tools.
40
77
  */
41
78
  export declare const SolAmountSchema: z.ZodNumber;
42
79
  //# sourceMappingURL=common.schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"common.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/common.schema.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,YAAY,aAAiD,CAAC;AAC3E;;GAEG;AACH,eAAO,MAAM,eAAe,aAA6C,CAAC;AAC1E;;GAEG;AACH,eAAO,MAAM,eAAe,aAAwD,CAAC;AACrF;;GAEG;AACH,eAAO,MAAM,SAAS,aAA0D,CAAC;AAEjF;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;EAG3B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,YAAY,aAAuD,CAAC;AACjF;;GAEG;AACH,eAAO,MAAM,eAAe,aAAqD,CAAC"}
1
+ {"version":3,"file":"common.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/common.schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;GAKG;AACH,eAAO,MAAM,YAAY,aAAiD,CAAC;AAE3E;;;;;GAKG;AACH,eAAO,MAAM,eAAe,aAA6C,CAAC;AAE1E;;;;;GAKG;AACH,eAAO,MAAM,eAAe,aAAwD,CAAC;AAErF;;;;;GAKG;AACH,eAAO,MAAM,SAAS,aAA0D,CAAC;AAEjF;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;EAG3B,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,YAAY,aAAuD,CAAC;AAEjF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,aAAqD,CAAC"}