@oobe-protocol-labs/sap-mcp-server 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +159 -0
- package/CHANGELOG.md +55 -0
- package/LICENSE +21 -0
- package/README.md +223 -0
- package/config.example.json +64 -0
- package/config.schema.json +370 -0
- package/config.secure-example.json +100 -0
- package/dist/adapters/index.d.ts +6 -0
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/adapters/index.js +6 -0
- package/dist/adapters/index.js.map +1 -0
- package/dist/adapters/mcp/errors.d.ts +7 -0
- package/dist/adapters/mcp/errors.d.ts.map +1 -0
- package/dist/adapters/mcp/errors.js +10 -0
- package/dist/adapters/mcp/errors.js.map +1 -0
- package/dist/adapters/mcp/index.d.ts +8 -0
- package/dist/adapters/mcp/index.d.ts.map +1 -0
- package/dist/adapters/mcp/index.js +8 -0
- package/dist/adapters/mcp/index.js.map +1 -0
- package/dist/adapters/mcp/prompt-response.d.ts +13 -0
- package/dist/adapters/mcp/prompt-response.d.ts.map +1 -0
- package/dist/adapters/mcp/prompt-response.js +7 -0
- package/dist/adapters/mcp/prompt-response.js.map +1 -0
- package/dist/adapters/mcp/resource-response.d.ts +8 -0
- package/dist/adapters/mcp/resource-response.d.ts.map +1 -0
- package/dist/adapters/mcp/resource-response.js +7 -0
- package/dist/adapters/mcp/resource-response.js.map +1 -0
- package/dist/adapters/mcp/sdk-compat.d.ts +191 -0
- package/dist/adapters/mcp/sdk-compat.d.ts.map +1 -0
- package/dist/adapters/mcp/sdk-compat.js +606 -0
- package/dist/adapters/mcp/sdk-compat.js.map +1 -0
- package/dist/adapters/mcp/tool-response.d.ts +32 -0
- package/dist/adapters/mcp/tool-response.d.ts.map +1 -0
- package/dist/adapters/mcp/tool-response.js +27 -0
- package/dist/adapters/mcp/tool-response.js.map +1 -0
- package/dist/adapters/solana/commitment.d.ts +9 -0
- package/dist/adapters/solana/commitment.d.ts.map +1 -0
- package/dist/adapters/solana/commitment.js +14 -0
- package/dist/adapters/solana/commitment.js.map +1 -0
- package/dist/adapters/solana/connection.d.ts +10 -0
- package/dist/adapters/solana/connection.d.ts.map +1 -0
- package/dist/adapters/solana/connection.js +13 -0
- package/dist/adapters/solana/connection.js.map +1 -0
- package/dist/adapters/solana/index.d.ts +7 -0
- package/dist/adapters/solana/index.d.ts.map +1 -0
- package/dist/adapters/solana/index.js +7 -0
- package/dist/adapters/solana/index.js.map +1 -0
- package/dist/adapters/solana/public-key.d.ts +9 -0
- package/dist/adapters/solana/public-key.d.ts.map +1 -0
- package/dist/adapters/solana/public-key.js +11 -0
- package/dist/adapters/solana/public-key.js.map +1 -0
- package/dist/cli.d.ts +29 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +269 -0
- package/dist/cli.js.map +1 -0
- package/dist/config/defaults.d.ts +28 -0
- package/dist/config/defaults.d.ts.map +1 -0
- package/dist/config/defaults.js +28 -0
- package/dist/config/defaults.js.map +1 -0
- package/dist/config/env.d.ts +297 -0
- package/dist/config/env.d.ts.map +1 -0
- package/dist/config/env.js +563 -0
- package/dist/config/env.js.map +1 -0
- package/dist/config/index.d.ts +7 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +7 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/mcp-client-injection.d.ts +113 -0
- package/dist/config/mcp-client-injection.d.ts.map +1 -0
- package/dist/config/mcp-client-injection.js +453 -0
- package/dist/config/mcp-client-injection.js.map +1 -0
- package/dist/config/paths.d.ts +37 -0
- package/dist/config/paths.d.ts.map +1 -0
- package/dist/config/paths.js +93 -0
- package/dist/config/paths.js.map +1 -0
- package/dist/config/profiles.d.ts +85 -0
- package/dist/config/profiles.d.ts.map +1 -0
- package/dist/config/profiles.js +346 -0
- package/dist/config/profiles.js.map +1 -0
- package/dist/config/schema.d.ts +9 -0
- package/dist/config/schema.d.ts.map +1 -0
- package/dist/config/schema.js +8 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/config/secure-config.d.ts +607 -0
- package/dist/config/secure-config.d.ts.map +1 -0
- package/dist/config/secure-config.js +526 -0
- package/dist/config/secure-config.js.map +1 -0
- package/dist/config/setup.d.ts +42 -0
- package/dist/config/setup.d.ts.map +1 -0
- package/dist/config/setup.js +173 -0
- package/dist/config/setup.js.map +1 -0
- package/dist/config/wizard.d.ts +15 -0
- package/dist/config/wizard.d.ts.map +1 -0
- package/dist/config/wizard.js +1176 -0
- package/dist/config/wizard.js.map +1 -0
- package/dist/config-cli.d.ts +21 -0
- package/dist/config-cli.d.ts.map +1 -0
- package/dist/config-cli.js +679 -0
- package/dist/config-cli.js.map +1 -0
- package/dist/core/constants.d.ts +78 -0
- package/dist/core/constants.d.ts.map +1 -0
- package/dist/core/constants.js +78 -0
- package/dist/core/constants.js.map +1 -0
- package/dist/core/errors.d.ts +188 -0
- package/dist/core/errors.d.ts.map +1 -0
- package/dist/core/errors.js +337 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/guards.d.ts +41 -0
- package/dist/core/guards.d.ts.map +1 -0
- package/dist/core/guards.js +93 -0
- package/dist/core/guards.js.map +1 -0
- package/dist/core/index.d.ts +11 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +10 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/logger.d.ts +64 -0
- package/dist/core/logger.d.ts.map +1 -0
- package/dist/core/logger.js +159 -0
- package/dist/core/logger.js.map +1 -0
- package/dist/core/result.d.ts +49 -0
- package/dist/core/result.d.ts.map +1 -0
- package/dist/core/result.js +61 -0
- package/dist/core/result.js.map +1 -0
- package/dist/core/types.d.ts +147 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +8 -0
- package/dist/core/types.js.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/payments/http-adapter.d.ts +76 -0
- package/dist/payments/http-adapter.d.ts.map +1 -0
- package/dist/payments/http-adapter.js +126 -0
- package/dist/payments/http-adapter.js.map +1 -0
- package/dist/payments/index.d.ts +12 -0
- package/dist/payments/index.d.ts.map +1 -0
- package/dist/payments/index.js +9 -0
- package/dist/payments/index.js.map +1 -0
- package/dist/payments/json-rpc.d.ts +49 -0
- package/dist/payments/json-rpc.d.ts.map +1 -0
- package/dist/payments/json-rpc.js +53 -0
- package/dist/payments/json-rpc.js.map +1 -0
- package/dist/payments/monetization-gate.d.ts +49 -0
- package/dist/payments/monetization-gate.d.ts.map +1 -0
- package/dist/payments/monetization-gate.js +398 -0
- package/dist/payments/monetization-gate.js.map +1 -0
- package/dist/payments/oobe-facilitator-server.d.ts +71 -0
- package/dist/payments/oobe-facilitator-server.d.ts.map +1 -0
- package/dist/payments/oobe-facilitator-server.js +409 -0
- package/dist/payments/oobe-facilitator-server.js.map +1 -0
- package/dist/payments/pay-sh-spec.d.ts +44 -0
- package/dist/payments/pay-sh-spec.d.ts.map +1 -0
- package/dist/payments/pay-sh-spec.js +218 -0
- package/dist/payments/pay-sh-spec.js.map +1 -0
- package/dist/payments/pricing.d.ts +60 -0
- package/dist/payments/pricing.d.ts.map +1 -0
- package/dist/payments/pricing.js +272 -0
- package/dist/payments/pricing.js.map +1 -0
- package/dist/payments/usage-ledger.d.ts +84 -0
- package/dist/payments/usage-ledger.d.ts.map +1 -0
- package/dist/payments/usage-ledger.js +126 -0
- package/dist/payments/usage-ledger.js.map +1 -0
- package/dist/policy/bento-policy-engine.d.ts +71 -0
- package/dist/policy/bento-policy-engine.d.ts.map +1 -0
- package/dist/policy/bento-policy-engine.js +218 -0
- package/dist/policy/bento-policy-engine.js.map +1 -0
- package/dist/policy/default-policies.d.ts +9 -0
- package/dist/policy/default-policies.d.ts.map +1 -0
- package/dist/policy/default-policies.js +69 -0
- package/dist/policy/default-policies.js.map +1 -0
- package/dist/policy/hybrid-policy-engine.d.ts +95 -0
- package/dist/policy/hybrid-policy-engine.d.ts.map +1 -0
- package/dist/policy/hybrid-policy-engine.js +297 -0
- package/dist/policy/hybrid-policy-engine.js.map +1 -0
- package/dist/policy/index.d.ts +10 -0
- package/dist/policy/index.d.ts.map +1 -0
- package/dist/policy/index.js +10 -0
- package/dist/policy/index.js.map +1 -0
- package/dist/policy/local-policy-engine.d.ts +119 -0
- package/dist/policy/local-policy-engine.d.ts.map +1 -0
- package/dist/policy/local-policy-engine.js +318 -0
- package/dist/policy/local-policy-engine.js.map +1 -0
- package/dist/policy/permission-checks.d.ts +19 -0
- package/dist/policy/permission-checks.d.ts.map +1 -0
- package/dist/policy/permission-checks.js +60 -0
- package/dist/policy/permission-checks.js.map +1 -0
- package/dist/policy/policy-engine.d.ts +57 -0
- package/dist/policy/policy-engine.d.ts.map +1 -0
- package/dist/policy/policy-engine.js +162 -0
- package/dist/policy/policy-engine.js.map +1 -0
- package/dist/policy/policy-types.d.ts +46 -0
- package/dist/policy/policy-types.d.ts.map +1 -0
- package/dist/policy/policy-types.js +5 -0
- package/dist/policy/policy-types.js.map +1 -0
- package/dist/policy/risk-level.d.ts +18 -0
- package/dist/policy/risk-level.d.ts.map +1 -0
- package/dist/policy/risk-level.js +46 -0
- package/dist/policy/risk-level.js.map +1 -0
- package/dist/policy/spending-limits.d.ts +17 -0
- package/dist/policy/spending-limits.d.ts.map +1 -0
- package/dist/policy/spending-limits.js +40 -0
- package/dist/policy/spending-limits.js.map +1 -0
- package/dist/prompts/context/sap-agent-context.prompt.d.ts +64 -0
- package/dist/prompts/context/sap-agent-context.prompt.d.ts.map +1 -0
- package/dist/prompts/context/sap-agent-context.prompt.js +336 -0
- package/dist/prompts/context/sap-agent-context.prompt.js.map +1 -0
- package/dist/prompts/developer/debug-sap-error.prompt.d.ts +13 -0
- package/dist/prompts/developer/debug-sap-error.prompt.d.ts.map +1 -0
- package/dist/prompts/developer/debug-sap-error.prompt.js +78 -0
- package/dist/prompts/developer/debug-sap-error.prompt.js.map +1 -0
- package/dist/prompts/developer/generate-sap-integration.prompt.d.ts +13 -0
- package/dist/prompts/developer/generate-sap-integration.prompt.d.ts.map +1 -0
- package/dist/prompts/developer/generate-sap-integration.prompt.js +132 -0
- package/dist/prompts/developer/generate-sap-integration.prompt.js.map +1 -0
- package/dist/prompts/developer/index.d.ts +6 -0
- package/dist/prompts/developer/index.d.ts.map +1 -0
- package/dist/prompts/developer/index.js +6 -0
- package/dist/prompts/developer/index.js.map +1 -0
- package/dist/prompts/execution-proof/explain-proof-of-execution.prompt.d.ts +13 -0
- package/dist/prompts/execution-proof/explain-proof-of-execution.prompt.d.ts.map +1 -0
- package/dist/prompts/execution-proof/explain-proof-of-execution.prompt.js +97 -0
- package/dist/prompts/execution-proof/explain-proof-of-execution.prompt.js.map +1 -0
- package/dist/prompts/execution-proof/index.d.ts +6 -0
- package/dist/prompts/execution-proof/index.d.ts.map +1 -0
- package/dist/prompts/execution-proof/index.js +6 -0
- package/dist/prompts/execution-proof/index.js.map +1 -0
- package/dist/prompts/execution-proof/verify-execution-proof.prompt.d.ts +13 -0
- package/dist/prompts/execution-proof/verify-execution-proof.prompt.d.ts.map +1 -0
- package/dist/prompts/execution-proof/verify-execution-proof.prompt.js +95 -0
- package/dist/prompts/execution-proof/verify-execution-proof.prompt.js.map +1 -0
- package/dist/prompts/index.d.ts +5 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/index.js +5 -0
- package/dist/prompts/index.js.map +1 -0
- package/dist/prompts/payments/create-paid-api.prompt.d.ts +13 -0
- package/dist/prompts/payments/create-paid-api.prompt.d.ts.map +1 -0
- package/dist/prompts/payments/create-paid-api.prompt.js +142 -0
- package/dist/prompts/payments/create-paid-api.prompt.js.map +1 -0
- package/dist/prompts/payments/explain-x402-settlement.prompt.d.ts +13 -0
- package/dist/prompts/payments/explain-x402-settlement.prompt.d.ts.map +1 -0
- package/dist/prompts/payments/explain-x402-settlement.prompt.js +83 -0
- package/dist/prompts/payments/explain-x402-settlement.prompt.js.map +1 -0
- package/dist/prompts/payments/index.d.ts +6 -0
- package/dist/prompts/payments/index.d.ts.map +1 -0
- package/dist/prompts/payments/index.js +6 -0
- package/dist/prompts/payments/index.js.map +1 -0
- package/dist/prompts/register-prompts.d.ts +10 -0
- package/dist/prompts/register-prompts.d.ts.map +1 -0
- package/dist/prompts/register-prompts.js +40 -0
- package/dist/prompts/register-prompts.js.map +1 -0
- package/dist/prompts/registry/analyze-sap-agent.prompt.d.ts +13 -0
- package/dist/prompts/registry/analyze-sap-agent.prompt.d.ts.map +1 -0
- package/dist/prompts/registry/analyze-sap-agent.prompt.js +85 -0
- package/dist/prompts/registry/analyze-sap-agent.prompt.js.map +1 -0
- package/dist/prompts/registry/index.d.ts +6 -0
- package/dist/prompts/registry/index.d.ts.map +1 -0
- package/dist/prompts/registry/index.js +6 -0
- package/dist/prompts/registry/index.js.map +1 -0
- package/dist/prompts/registry/register-sap-agent.prompt.d.ts +13 -0
- package/dist/prompts/registry/register-sap-agent.prompt.d.ts.map +1 -0
- package/dist/prompts/registry/register-sap-agent.prompt.js +152 -0
- package/dist/prompts/registry/register-sap-agent.prompt.js.map +1 -0
- package/dist/remote/auth/index.d.ts +86 -0
- package/dist/remote/auth/index.d.ts.map +1 -0
- package/dist/remote/auth/index.js +152 -0
- package/dist/remote/auth/index.js.map +1 -0
- package/dist/remote/server.d.ts +140 -0
- package/dist/remote/server.d.ts.map +1 -0
- package/dist/remote/server.js +412 -0
- package/dist/remote/server.js.map +1 -0
- package/dist/resources/current/sap-current-config.resource.d.ts +30 -0
- package/dist/resources/current/sap-current-config.resource.d.ts.map +1 -0
- package/dist/resources/current/sap-current-config.resource.js +142 -0
- package/dist/resources/current/sap-current-config.resource.js.map +1 -0
- package/dist/resources/execution-proof/index.d.ts +5 -0
- package/dist/resources/execution-proof/index.d.ts.map +1 -0
- package/dist/resources/execution-proof/index.js +5 -0
- package/dist/resources/execution-proof/index.js.map +1 -0
- package/dist/resources/execution-proof/sap-execution-record.resource.d.ts +13 -0
- package/dist/resources/execution-proof/sap-execution-record.resource.d.ts.map +1 -0
- package/dist/resources/execution-proof/sap-execution-record.resource.js +75 -0
- package/dist/resources/execution-proof/sap-execution-record.resource.js.map +1 -0
- package/dist/resources/index.d.ts +5 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +5 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/resources/memory/index.d.ts +5 -0
- package/dist/resources/memory/index.d.ts.map +1 -0
- package/dist/resources/memory/index.js +5 -0
- package/dist/resources/memory/index.js.map +1 -0
- package/dist/resources/memory/sap-memory.resource.d.ts +13 -0
- package/dist/resources/memory/sap-memory.resource.d.ts.map +1 -0
- package/dist/resources/memory/sap-memory.resource.js +77 -0
- package/dist/resources/memory/sap-memory.resource.js.map +1 -0
- package/dist/resources/profile/sap-active-profile.resource.d.ts +51 -0
- package/dist/resources/profile/sap-active-profile.resource.d.ts.map +1 -0
- package/dist/resources/profile/sap-active-profile.resource.js +119 -0
- package/dist/resources/profile/sap-active-profile.resource.js.map +1 -0
- package/dist/resources/register-resources.d.ts +10 -0
- package/dist/resources/register-resources.d.ts.map +1 -0
- package/dist/resources/register-resources.js +33 -0
- package/dist/resources/register-resources.js.map +1 -0
- package/dist/resources/registry/index.d.ts +6 -0
- package/dist/resources/registry/index.d.ts.map +1 -0
- package/dist/resources/registry/index.js +6 -0
- package/dist/resources/registry/index.js.map +1 -0
- package/dist/resources/registry/sap-agent.resource.d.ts +13 -0
- package/dist/resources/registry/sap-agent.resource.d.ts.map +1 -0
- package/dist/resources/registry/sap-agent.resource.js +75 -0
- package/dist/resources/registry/sap-agent.resource.js.map +1 -0
- package/dist/resources/registry/sap-global-registry.resource.d.ts +13 -0
- package/dist/resources/registry/sap-global-registry.resource.d.ts.map +1 -0
- package/dist/resources/registry/sap-global-registry.resource.js +71 -0
- package/dist/resources/registry/sap-global-registry.resource.js.map +1 -0
- package/dist/resources/reputation/index.d.ts +5 -0
- package/dist/resources/reputation/index.d.ts.map +1 -0
- package/dist/resources/reputation/index.js +5 -0
- package/dist/resources/reputation/index.js.map +1 -0
- package/dist/resources/reputation/sap-reputation.resource.d.ts +13 -0
- package/dist/resources/reputation/sap-reputation.resource.d.ts.map +1 -0
- package/dist/resources/reputation/sap-reputation.resource.js +75 -0
- package/dist/resources/reputation/sap-reputation.resource.js.map +1 -0
- package/dist/resources/stats/sap-network-stats.resource.d.ts +14 -0
- package/dist/resources/stats/sap-network-stats.resource.d.ts.map +1 -0
- package/dist/resources/stats/sap-network-stats.resource.js +86 -0
- package/dist/resources/stats/sap-network-stats.resource.js.map +1 -0
- package/dist/resources/tool-schema/index.d.ts +5 -0
- package/dist/resources/tool-schema/index.d.ts.map +1 -0
- package/dist/resources/tool-schema/index.js +5 -0
- package/dist/resources/tool-schema/index.js.map +1 -0
- package/dist/resources/tool-schema/sap-tool-schema.resource.d.ts +13 -0
- package/dist/resources/tool-schema/sap-tool-schema.resource.d.ts.map +1 -0
- package/dist/resources/tool-schema/sap-tool-schema.resource.js +75 -0
- package/dist/resources/tool-schema/sap-tool-schema.resource.js.map +1 -0
- package/dist/sap/index.d.ts +7 -0
- package/dist/sap/index.d.ts.map +1 -0
- package/dist/sap/index.js +6 -0
- package/dist/sap/index.js.map +1 -0
- package/dist/sap/sap-client-manager.d.ts +54 -0
- package/dist/sap/sap-client-manager.d.ts.map +1 -0
- package/dist/sap/sap-client-manager.js +129 -0
- package/dist/sap/sap-client-manager.js.map +1 -0
- package/dist/sap/sap-errors.d.ts +13 -0
- package/dist/sap/sap-errors.d.ts.map +1 -0
- package/dist/sap/sap-errors.js +23 -0
- package/dist/sap/sap-errors.js.map +1 -0
- package/dist/sap/sap-types.d.ts +69 -0
- package/dist/sap/sap-types.d.ts.map +1 -0
- package/dist/sap/sap-types.js +5 -0
- package/dist/sap/sap-types.js.map +1 -0
- package/dist/schemas/common.schema.d.ts +42 -0
- package/dist/schemas/common.schema.d.ts.map +1 -0
- package/dist/schemas/common.schema.js +36 -0
- package/dist/schemas/common.schema.js.map +1 -0
- package/dist/schemas/developer.schema.d.ts +31 -0
- package/dist/schemas/developer.schema.d.ts.map +1 -0
- package/dist/schemas/developer.schema.js +19 -0
- package/dist/schemas/developer.schema.js.map +1 -0
- package/dist/schemas/execution-proof.schema.d.ts +44 -0
- package/dist/schemas/execution-proof.schema.d.ts.map +1 -0
- package/dist/schemas/execution-proof.schema.js +26 -0
- package/dist/schemas/execution-proof.schema.js.map +1 -0
- package/dist/schemas/identity.schema.d.ts +34 -0
- package/dist/schemas/identity.schema.d.ts.map +1 -0
- package/dist/schemas/identity.schema.js +21 -0
- package/dist/schemas/identity.schema.js.map +1 -0
- package/dist/schemas/index.d.ts +15 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +15 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/memory.schema.d.ts +34 -0
- package/dist/schemas/memory.schema.d.ts.map +1 -0
- package/dist/schemas/memory.schema.js +21 -0
- package/dist/schemas/memory.schema.js.map +1 -0
- package/dist/schemas/payments.schema.d.ts +37 -0
- package/dist/schemas/payments.schema.d.ts.map +1 -0
- package/dist/schemas/payments.schema.js +22 -0
- package/dist/schemas/payments.schema.js.map +1 -0
- package/dist/schemas/registry.schema.d.ts +65 -0
- package/dist/schemas/registry.schema.d.ts.map +1 -0
- package/dist/schemas/registry.schema.js +34 -0
- package/dist/schemas/registry.schema.js.map +1 -0
- package/dist/schemas/reputation.schema.d.ts +31 -0
- package/dist/schemas/reputation.schema.d.ts.map +1 -0
- package/dist/schemas/reputation.schema.js +20 -0
- package/dist/schemas/reputation.schema.js.map +1 -0
- package/dist/schemas/settlement.schema.d.ts +50 -0
- package/dist/schemas/settlement.schema.d.ts.map +1 -0
- package/dist/schemas/settlement.schema.js +29 -0
- package/dist/schemas/settlement.schema.js.map +1 -0
- package/dist/schemas/tool-schema.schema.d.ts +56 -0
- package/dist/schemas/tool-schema.schema.d.ts.map +1 -0
- package/dist/schemas/tool-schema.schema.js +26 -0
- package/dist/schemas/tool-schema.schema.js.map +1 -0
- package/dist/schemas/transaction.schema.d.ts +34 -0
- package/dist/schemas/transaction.schema.d.ts.map +1 -0
- package/dist/schemas/transaction.schema.js +20 -0
- package/dist/schemas/transaction.schema.js.map +1 -0
- package/dist/security/approval-required.d.ts +9 -0
- package/dist/security/approval-required.d.ts.map +1 -0
- package/dist/security/approval-required.js +10 -0
- package/dist/security/approval-required.js.map +1 -0
- package/dist/security/index.d.ts +9 -0
- package/dist/security/index.d.ts.map +1 -0
- package/dist/security/index.js +9 -0
- package/dist/security/index.js.map +1 -0
- package/dist/security/private-key-guard.d.ts +11 -0
- package/dist/security/private-key-guard.d.ts.map +1 -0
- package/dist/security/private-key-guard.js +22 -0
- package/dist/security/private-key-guard.js.map +1 -0
- package/dist/security/prompt-injection-notes.d.ts +13 -0
- package/dist/security/prompt-injection-notes.d.ts.map +1 -0
- package/dist/security/prompt-injection-notes.js +23 -0
- package/dist/security/prompt-injection-notes.js.map +1 -0
- package/dist/security/tool-permissions.d.ts +30 -0
- package/dist/security/tool-permissions.d.ts.map +1 -0
- package/dist/security/tool-permissions.js +270 -0
- package/dist/security/tool-permissions.js.map +1 -0
- package/dist/security/unsafe-action-guard.d.ts +28 -0
- package/dist/security/unsafe-action-guard.d.ts.map +1 -0
- package/dist/security/unsafe-action-guard.js +175 -0
- package/dist/security/unsafe-action-guard.js.map +1 -0
- package/dist/server/create-server.d.ts +12 -0
- package/dist/server/create-server.d.ts.map +1 -0
- package/dist/server/create-server.js +57 -0
- package/dist/server/create-server.js.map +1 -0
- package/dist/server/index.d.ts +7 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +7 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/register-capabilities.d.ts +10 -0
- package/dist/server/register-capabilities.d.ts.map +1 -0
- package/dist/server/register-capabilities.js +23 -0
- package/dist/server/register-capabilities.js.map +1 -0
- package/dist/server/server-metadata.d.ts +32 -0
- package/dist/server/server-metadata.d.ts.map +1 -0
- package/dist/server/server-metadata.js +32 -0
- package/dist/server/server-metadata.js.map +1 -0
- package/dist/session/agent-session.d.ts +25 -0
- package/dist/session/agent-session.d.ts.map +1 -0
- package/dist/session/agent-session.js +35 -0
- package/dist/session/agent-session.js.map +1 -0
- package/dist/session/delegated-session.d.ts +20 -0
- package/dist/session/delegated-session.d.ts.map +1 -0
- package/dist/session/delegated-session.js +47 -0
- package/dist/session/delegated-session.js.map +1 -0
- package/dist/session/index.d.ts +10 -0
- package/dist/session/index.d.ts.map +1 -0
- package/dist/session/index.js +9 -0
- package/dist/session/index.js.map +1 -0
- package/dist/session/redis-session-store.d.ts +89 -0
- package/dist/session/redis-session-store.d.ts.map +1 -0
- package/dist/session/redis-session-store.js +219 -0
- package/dist/session/redis-session-store.js.map +1 -0
- package/dist/session/session-limits.d.ts +20 -0
- package/dist/session/session-limits.d.ts.map +1 -0
- package/dist/session/session-limits.js +55 -0
- package/dist/session/session-limits.js.map +1 -0
- package/dist/session/session-permissions.d.ts +37 -0
- package/dist/session/session-permissions.d.ts.map +1 -0
- package/dist/session/session-permissions.js +58 -0
- package/dist/session/session-permissions.js.map +1 -0
- package/dist/session/session-store.d.ts +38 -0
- package/dist/session/session-store.d.ts.map +1 -0
- package/dist/session/session-store.js +62 -0
- package/dist/session/session-store.js.map +1 -0
- package/dist/session/session-types.d.ts +33 -0
- package/dist/session/session-types.d.ts.map +1 -0
- package/dist/session/session-types.js +5 -0
- package/dist/session/session-types.js.map +1 -0
- package/dist/signer/external-signer.d.ts +16 -0
- package/dist/signer/external-signer.d.ts.map +1 -0
- package/dist/signer/external-signer.js +128 -0
- package/dist/signer/external-signer.js.map +1 -0
- package/dist/signer/index.d.ts +9 -0
- package/dist/signer/index.d.ts.map +1 -0
- package/dist/signer/index.js +8 -0
- package/dist/signer/index.js.map +1 -0
- package/dist/signer/load-keypair.d.ts +15 -0
- package/dist/signer/load-keypair.d.ts.map +1 -0
- package/dist/signer/load-keypair.js +39 -0
- package/dist/signer/load-keypair.js.map +1 -0
- package/dist/signer/local-keypair-signer.d.ts +11 -0
- package/dist/signer/local-keypair-signer.d.ts.map +1 -0
- package/dist/signer/local-keypair-signer.js +46 -0
- package/dist/signer/local-keypair-signer.js.map +1 -0
- package/dist/signer/signer-resolver.d.ts +10 -0
- package/dist/signer/signer-resolver.d.ts.map +1 -0
- package/dist/signer/signer-resolver.js +63 -0
- package/dist/signer/signer-resolver.js.map +1 -0
- package/dist/signer/signer-types.d.ts +35 -0
- package/dist/signer/signer-types.d.ts.map +1 -0
- package/dist/signer/signer-types.js +5 -0
- package/dist/signer/signer-types.js.map +1 -0
- package/dist/signer/signing-proxy.d.ts +45 -0
- package/dist/signer/signing-proxy.d.ts.map +1 -0
- package/dist/signer/signing-proxy.js +300 -0
- package/dist/signer/signing-proxy.js.map +1 -0
- package/dist/tools/client-sdk-tools.d.ts +22 -0
- package/dist/tools/client-sdk-tools.d.ts.map +1 -0
- package/dist/tools/client-sdk-tools.js +220 -0
- package/dist/tools/client-sdk-tools.js.map +1 -0
- package/dist/tools/index.d.ts +11 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +17 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/profile-tools.d.ts +12 -0
- package/dist/tools/profile-tools.d.ts.map +1 -0
- package/dist/tools/profile-tools.js +250 -0
- package/dist/tools/profile-tools.js.map +1 -0
- package/dist/tools/register-tools.d.ts +12 -0
- package/dist/tools/register-tools.d.ts.map +1 -0
- package/dist/tools/register-tools.js +36 -0
- package/dist/tools/register-tools.js.map +1 -0
- package/dist/tools/sap-network-stats.tool.d.ts +14 -0
- package/dist/tools/sap-network-stats.tool.d.ts.map +1 -0
- package/dist/tools/sap-network-stats.tool.js +101 -0
- package/dist/tools/sap-network-stats.tool.js.map +1 -0
- package/dist/tools/sap-sdk-tools.d.ts +15 -0
- package/dist/tools/sap-sdk-tools.d.ts.map +1 -0
- package/dist/tools/sap-sdk-tools.js +1515 -0
- package/dist/tools/sap-sdk-tools.js.map +1 -0
- package/dist/tools/sap-sns-tools.d.ts +35 -0
- package/dist/tools/sap-sns-tools.d.ts.map +1 -0
- package/dist/tools/sap-sns-tools.js +626 -0
- package/dist/tools/sap-sns-tools.js.map +1 -0
- package/dist/tools/skills-tools.d.ts +12 -0
- package/dist/tools/skills-tools.d.ts.map +1 -0
- package/dist/tools/skills-tools.js +273 -0
- package/dist/tools/skills-tools.js.map +1 -0
- package/dist/tools/transaction-tools.d.ts +14 -0
- package/dist/tools/transaction-tools.d.ts.map +1 -0
- package/dist/tools/transaction-tools.js +297 -0
- package/dist/tools/transaction-tools.js.map +1 -0
- package/dist/transports/http.d.ts +40 -0
- package/dist/transports/http.d.ts.map +1 -0
- package/dist/transports/http.js +212 -0
- package/dist/transports/http.js.map +1 -0
- package/dist/transports/index.d.ts +6 -0
- package/dist/transports/index.d.ts.map +1 -0
- package/dist/transports/index.js +6 -0
- package/dist/transports/index.js.map +1 -0
- package/dist/transports/stdio.d.ts +14 -0
- package/dist/transports/stdio.d.ts.map +1 -0
- package/dist/transports/stdio.js +32 -0
- package/dist/transports/stdio.js.map +1 -0
- package/dist/tui/components.d.ts +59 -0
- package/dist/tui/components.d.ts.map +1 -0
- package/dist/tui/components.js +82 -0
- package/dist/tui/components.js.map +1 -0
- package/dist/tui/config-wizard.d.ts +12 -0
- package/dist/tui/config-wizard.d.ts.map +1 -0
- package/dist/tui/config-wizard.js +348 -0
- package/dist/tui/config-wizard.js.map +1 -0
- package/dist/tui/wizard-save.d.ts +51 -0
- package/dist/tui/wizard-save.d.ts.map +1 -0
- package/dist/tui/wizard-save.js +148 -0
- package/dist/tui/wizard-save.js.map +1 -0
- package/docs/00_README.md +45 -0
- package/docs/01_PRODUCT_OVERVIEW.md +69 -0
- package/docs/02_ARCHITECTURE_AND_REQUEST_FLOW.md +120 -0
- package/docs/03_CONFIGURATION_AND_WIZARD.md +143 -0
- package/docs/04_LOCAL_STDIO_USAGE.md +118 -0
- package/docs/05_REMOTE_VPS_DEPLOYMENT.md +136 -0
- package/docs/06_PAYMENTS_X402_AND_PAYSH.md +162 -0
- package/docs/07_ENDPOINTS_AND_CLIENTS.md +114 -0
- package/docs/08_SECURITY_POLICY_AND_SIGNING.md +134 -0
- package/docs/09_TOOLS_SKILLS_AND_AGENT_GUIDE.md +72 -0
- package/docs/10_OPERATIONS_RELEASE_AND_PM2.md +90 -0
- package/docs/11_CODE_QUALITY_AUDIT.md +49 -0
- package/ecosystem.config.example.cjs +55 -0
- package/package.json +132 -0
- package/skills/README.md +146 -0
- package/skills/sap-agent-registry/SKILL.md +39 -0
- package/skills/sap-agentkit/SKILL.md +40 -0
- package/skills/sap-defi/SKILL.md +51 -0
- package/skills/sap-discovery-indexing/SKILL.md +33 -0
- package/skills/sap-escrow-settlement/SKILL.md +37 -0
- package/skills/sap-ledger-session/SKILL.md +24 -0
- package/skills/sap-market-data/SKILL.md +36 -0
- package/skills/sap-mcp/SKILL.md +202 -0
- package/skills/sap-mcp/TOOL_REFERENCE.md +184 -0
- package/skills/sap-memory-vault/SKILL.md +29 -0
- package/skills/sap-nft-metaplex/SKILL.md +38 -0
- package/skills/sap-operations/SKILL.md +97 -0
- package/skills/sap-payments-x402/SKILL.md +47 -0
- package/skills/sap-reputation-attestation/SKILL.md +30 -0
- package/skills/sap-sns/SKILL.md +51 -0
- package/skills/sap-social-gaming/SKILL.md +30 -0
- package/skills/sap-solana-token/SKILL.md +32 -0
- package/skills/sap-staking/SKILL.md +24 -0
- package/skills/sap-tool-registry/SKILL.md +29 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module skills-tools
|
|
3
|
+
* @description MCP tools for listing, bundling, and installing the SAP MCP skill pack.
|
|
4
|
+
*/
|
|
5
|
+
import type { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
6
|
+
import type { SapMcpContext } from '../core/types.js';
|
|
7
|
+
/**
|
|
8
|
+
* @name registerSkillsTools
|
|
9
|
+
* @description Registers skill pack discovery, export, and install tools.
|
|
10
|
+
*/
|
|
11
|
+
export declare function registerSkillsTools(server: Server, _context: SapMcpContext): void;
|
|
12
|
+
//# sourceMappingURL=skills-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skills-tools.d.ts","sourceRoot":"","sources":["../../src/tools/skills-tools.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAcH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAGxE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AA4MtD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,GAAG,IAAI,CA0GjF"}
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module skills-tools
|
|
3
|
+
* @description MCP tools for listing, bundling, and installing the SAP MCP skill pack.
|
|
4
|
+
*/
|
|
5
|
+
import { copyFileSync, existsSync, mkdirSync, readdirSync, readFileSync, statSync, } from 'fs';
|
|
6
|
+
import { dirname, join, relative, resolve } from 'path';
|
|
7
|
+
import { fileURLToPath } from 'url';
|
|
8
|
+
import { homedir } from 'os';
|
|
9
|
+
import { registerTool } from '../adapters/mcp/sdk-compat.js';
|
|
10
|
+
import { createTextResponse } from '../adapters/mcp/tool-response.js';
|
|
11
|
+
const SKILL_NAME_PATTERN = /^[a-zA-Z0-9_-]+$/;
|
|
12
|
+
/**
|
|
13
|
+
* @name parseInput
|
|
14
|
+
* @description Narrows unknown MCP tool input into skill tool input.
|
|
15
|
+
*/
|
|
16
|
+
function parseInput(input) {
|
|
17
|
+
if (!input || typeof input !== 'object' || Array.isArray(input)) {
|
|
18
|
+
return {};
|
|
19
|
+
}
|
|
20
|
+
const record = input;
|
|
21
|
+
const agent = record.agent;
|
|
22
|
+
return {
|
|
23
|
+
agent: agent === 'claude' || agent === 'codex' || agent === 'hermes' || agent === 'openclaw' || agent === 'custom'
|
|
24
|
+
? agent
|
|
25
|
+
: undefined,
|
|
26
|
+
targetDir: typeof record.targetDir === 'string' ? record.targetDir : undefined,
|
|
27
|
+
skills: Array.isArray(record.skills)
|
|
28
|
+
? record.skills.filter((item) => typeof item === 'string')
|
|
29
|
+
: undefined,
|
|
30
|
+
confirm: typeof record.confirm === 'boolean' ? record.confirm : undefined,
|
|
31
|
+
includeContents: typeof record.includeContents === 'boolean' ? record.includeContents : undefined,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* @name getSkillsRoot
|
|
36
|
+
* @description Resolves the bundled skills directory in source and built package layouts.
|
|
37
|
+
*/
|
|
38
|
+
function getSkillsRoot() {
|
|
39
|
+
const currentDir = dirname(fileURLToPath(import.meta.url));
|
|
40
|
+
return resolve(currentDir, '../../skills');
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* @name getDefaultTargetDir
|
|
44
|
+
* @description Returns the default skill directory for a supported local agent.
|
|
45
|
+
*/
|
|
46
|
+
function getDefaultTargetDir(agent) {
|
|
47
|
+
switch (agent) {
|
|
48
|
+
case 'claude':
|
|
49
|
+
return join(homedir(), '.claude', 'skills');
|
|
50
|
+
case 'codex':
|
|
51
|
+
return join(homedir(), '.codex', 'skills');
|
|
52
|
+
case 'hermes':
|
|
53
|
+
return join(homedir(), '.hermes', 'skills');
|
|
54
|
+
case 'openclaw':
|
|
55
|
+
return join(homedir(), '.openclaw', 'skills');
|
|
56
|
+
case 'custom':
|
|
57
|
+
case undefined:
|
|
58
|
+
return undefined;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* @name assertSafeSkillName
|
|
63
|
+
* @description Prevents path traversal through selected skill names.
|
|
64
|
+
*/
|
|
65
|
+
function assertSafeSkillName(skillName) {
|
|
66
|
+
if (!SKILL_NAME_PATTERN.test(skillName)) {
|
|
67
|
+
throw new Error(`Invalid skill name: ${skillName}`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* @name listBundledSkillNames
|
|
72
|
+
* @description Lists bundled skill directories.
|
|
73
|
+
*/
|
|
74
|
+
function listBundledSkillNames() {
|
|
75
|
+
const skillsRoot = getSkillsRoot();
|
|
76
|
+
if (!existsSync(skillsRoot)) {
|
|
77
|
+
return [];
|
|
78
|
+
}
|
|
79
|
+
return readdirSync(skillsRoot, { withFileTypes: true })
|
|
80
|
+
.filter((entry) => entry.isDirectory())
|
|
81
|
+
.map((entry) => entry.name)
|
|
82
|
+
.filter((name) => existsSync(join(skillsRoot, name, 'SKILL.md')))
|
|
83
|
+
.sort();
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* @name listFilesRecursive
|
|
87
|
+
* @description Lists all regular files below a directory.
|
|
88
|
+
*/
|
|
89
|
+
function listFilesRecursive(root) {
|
|
90
|
+
const files = [];
|
|
91
|
+
for (const entry of readdirSync(root, { withFileTypes: true })) {
|
|
92
|
+
const fullPath = join(root, entry.name);
|
|
93
|
+
if (entry.isDirectory()) {
|
|
94
|
+
files.push(...listFilesRecursive(fullPath));
|
|
95
|
+
}
|
|
96
|
+
else if (entry.isFile()) {
|
|
97
|
+
files.push(fullPath);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return files;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* @name resolveSelectedSkills
|
|
104
|
+
* @description Resolves requested skills or returns every bundled skill.
|
|
105
|
+
*/
|
|
106
|
+
function resolveSelectedSkills(selected) {
|
|
107
|
+
const available = new Set(listBundledSkillNames());
|
|
108
|
+
const names = selected && selected.length > 0 ? selected : Array.from(available);
|
|
109
|
+
for (const name of names) {
|
|
110
|
+
assertSafeSkillName(name);
|
|
111
|
+
if (!available.has(name)) {
|
|
112
|
+
throw new Error(`Bundled skill not found: ${name}`);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return names.sort();
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* @name getSkillSummaries
|
|
119
|
+
* @description Builds summaries for bundled skills.
|
|
120
|
+
*/
|
|
121
|
+
function getSkillSummaries(selected) {
|
|
122
|
+
const skillsRoot = getSkillsRoot();
|
|
123
|
+
return resolveSelectedSkills(selected).map((name) => {
|
|
124
|
+
const skillRoot = join(skillsRoot, name);
|
|
125
|
+
return {
|
|
126
|
+
name,
|
|
127
|
+
entrypoint: join(name, 'SKILL.md'),
|
|
128
|
+
files: listFilesRecursive(skillRoot)
|
|
129
|
+
.map((file) => relative(skillsRoot, file))
|
|
130
|
+
.sort(),
|
|
131
|
+
};
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* @name getSkillFiles
|
|
136
|
+
* @description Reads bundled skill files with paths relative to the skills root.
|
|
137
|
+
*/
|
|
138
|
+
function getSkillFiles(selected) {
|
|
139
|
+
const skillsRoot = getSkillsRoot();
|
|
140
|
+
return resolveSelectedSkills(selected).flatMap((name) => {
|
|
141
|
+
const skillRoot = join(skillsRoot, name);
|
|
142
|
+
return listFilesRecursive(skillRoot).map((file) => ({
|
|
143
|
+
path: relative(skillsRoot, file),
|
|
144
|
+
content: readFileSync(file, 'utf-8'),
|
|
145
|
+
}));
|
|
146
|
+
}).sort((left, right) => left.path.localeCompare(right.path));
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* @name resolveTargetDir
|
|
150
|
+
* @description Resolves the target skill directory from explicit input or a supported agent default.
|
|
151
|
+
*/
|
|
152
|
+
function resolveTargetDir(input) {
|
|
153
|
+
const targetDir = input.targetDir || getDefaultTargetDir(input.agent);
|
|
154
|
+
if (!targetDir) {
|
|
155
|
+
throw new Error('targetDir is required when agent is custom or omitted.');
|
|
156
|
+
}
|
|
157
|
+
return resolve(targetDir);
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* @name installSkillFiles
|
|
161
|
+
* @description Copies bundled skill files into the target skills directory.
|
|
162
|
+
*/
|
|
163
|
+
function installSkillFiles(files, targetDir) {
|
|
164
|
+
const skillsRoot = getSkillsRoot();
|
|
165
|
+
const copied = [];
|
|
166
|
+
for (const file of files) {
|
|
167
|
+
const source = join(skillsRoot, file.path);
|
|
168
|
+
const destination = join(targetDir, file.path);
|
|
169
|
+
if (!statSync(source).isFile()) {
|
|
170
|
+
continue;
|
|
171
|
+
}
|
|
172
|
+
mkdirSync(dirname(destination), { recursive: true, mode: 0o700 });
|
|
173
|
+
copyFileSync(source, destination);
|
|
174
|
+
copied.push(destination);
|
|
175
|
+
}
|
|
176
|
+
return copied;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* @name registerSkillsTools
|
|
180
|
+
* @description Registers skill pack discovery, export, and install tools.
|
|
181
|
+
*/
|
|
182
|
+
export function registerSkillsTools(server, _context) {
|
|
183
|
+
registerTool(server, 'sap_skills_list', {
|
|
184
|
+
title: 'List SAP MCP Skills',
|
|
185
|
+
description: 'List bundled SAP MCP skills and their files.',
|
|
186
|
+
inputSchema: {
|
|
187
|
+
skills: { type: 'array', items: { type: 'string' } },
|
|
188
|
+
},
|
|
189
|
+
}, async (input) => {
|
|
190
|
+
try {
|
|
191
|
+
const parsed = parseInput(input);
|
|
192
|
+
return createTextResponse(JSON.stringify({
|
|
193
|
+
skillsRoot: getSkillsRoot(),
|
|
194
|
+
skills: getSkillSummaries(parsed.skills),
|
|
195
|
+
upstream: {
|
|
196
|
+
repository: 'https://github.com/OOBE-PROTOCOL/synapse-sap-sdk',
|
|
197
|
+
ref: 'v0.21.0',
|
|
198
|
+
sourcePath: 'skills',
|
|
199
|
+
},
|
|
200
|
+
}, null, 2));
|
|
201
|
+
}
|
|
202
|
+
catch (error) {
|
|
203
|
+
return createTextResponse(`Error: ${error instanceof Error ? error.message : 'Unknown error'}`, { isError: true });
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
registerTool(server, 'sap_skills_bundle', {
|
|
207
|
+
title: 'Bundle SAP MCP Skills',
|
|
208
|
+
description: 'Return bundled SAP MCP skills as JSON so an agent can load or write them itself.',
|
|
209
|
+
inputSchema: {
|
|
210
|
+
skills: { type: 'array', items: { type: 'string' } },
|
|
211
|
+
includeContents: { type: 'boolean' },
|
|
212
|
+
},
|
|
213
|
+
}, async (input) => {
|
|
214
|
+
try {
|
|
215
|
+
const parsed = parseInput(input);
|
|
216
|
+
const files = getSkillFiles(parsed.skills);
|
|
217
|
+
return createTextResponse(JSON.stringify({
|
|
218
|
+
version: '1.0.0',
|
|
219
|
+
generatedBy: 'sap-mcp-server',
|
|
220
|
+
skills: getSkillSummaries(parsed.skills),
|
|
221
|
+
files: parsed.includeContents === false
|
|
222
|
+
? files.map((file) => ({ path: file.path }))
|
|
223
|
+
: files,
|
|
224
|
+
}, null, 2));
|
|
225
|
+
}
|
|
226
|
+
catch (error) {
|
|
227
|
+
return createTextResponse(`Error: ${error instanceof Error ? error.message : 'Unknown error'}`, { isError: true });
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
registerTool(server, 'sap_skills_install', {
|
|
231
|
+
title: 'Install SAP MCP Skills',
|
|
232
|
+
description: 'Install bundled SAP MCP skills into a local agent skill directory. Requires confirm: true.',
|
|
233
|
+
inputSchema: {
|
|
234
|
+
agent: { type: 'string', enum: ['claude', 'codex', 'hermes', 'openclaw', 'custom'] },
|
|
235
|
+
targetDir: { type: 'string' },
|
|
236
|
+
skills: { type: 'array', items: { type: 'string' } },
|
|
237
|
+
confirm: { type: 'boolean' },
|
|
238
|
+
},
|
|
239
|
+
}, async (input) => {
|
|
240
|
+
try {
|
|
241
|
+
const parsed = parseInput(input);
|
|
242
|
+
const targetDir = resolveTargetDir(parsed);
|
|
243
|
+
const files = getSkillFiles(parsed.skills);
|
|
244
|
+
const plan = {
|
|
245
|
+
targetDir,
|
|
246
|
+
skills: getSkillSummaries(parsed.skills),
|
|
247
|
+
fileCount: files.length,
|
|
248
|
+
};
|
|
249
|
+
if (!parsed.confirm) {
|
|
250
|
+
return createTextResponse(JSON.stringify({
|
|
251
|
+
success: false,
|
|
252
|
+
dryRun: true,
|
|
253
|
+
requiresConfirmation: true,
|
|
254
|
+
message: 'Call again with confirm: true to install these skill files.',
|
|
255
|
+
plan,
|
|
256
|
+
}, null, 2));
|
|
257
|
+
}
|
|
258
|
+
mkdirSync(targetDir, { recursive: true, mode: 0o700 });
|
|
259
|
+
const copied = installSkillFiles(files, targetDir);
|
|
260
|
+
return createTextResponse(JSON.stringify({
|
|
261
|
+
success: true,
|
|
262
|
+
dryRun: false,
|
|
263
|
+
targetDir,
|
|
264
|
+
copied,
|
|
265
|
+
message: `Installed ${copied.length} SAP MCP skill files.`,
|
|
266
|
+
}, null, 2));
|
|
267
|
+
}
|
|
268
|
+
catch (error) {
|
|
269
|
+
return createTextResponse(`Error: ${error instanceof Error ? error.message : 'Unknown error'}`, { isError: true });
|
|
270
|
+
}
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
//# sourceMappingURL=skills-tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skills-tools.js","sourceRoot":"","sources":["../../src/tools/skills-tools.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACL,YAAY,EACZ,UAAU,EACV,SAAS,EACT,WAAW,EACX,YAAY,EACZ,QAAQ,GACT,MAAM,IAAI,CAAC;AACZ,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAE7B,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAwBtE,MAAM,kBAAkB,GAAG,kBAAkB,CAAC;AAE9C;;;GAGG;AACH,SAAS,UAAU,CAAC,KAAc;IAChC,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CA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ACd,MAAM,EAAE,IAAI;oBACZ,oBAAoB,EAAE,IAAI;oBAC1B,OAAO,EAAE,6DAA6D;oBACtE,IAAI;iBACL,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;YACf,CAAC;YAED,SAAS,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;YACvD,MAAM,MAAM,GAAG,iBAAiB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;YACnD,OAAO,kBAAkB,CAAC,IAAI,CAAC,SAAS,CAAC;gBACvC,OAAO,EAAE,IAAI;gBACb,MAAM,EAAE,KAAK;gBACb,SAAS;gBACT,MAAM;gBACN,OAAO,EAAE,aAAa,MAAM,CAAC,MAAM,uBAAuB;aAC3D,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QACf,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,kBAAkB,CAAC,UAAU,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;QACrH,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module transaction-tools
|
|
3
|
+
* @description MCP tools for decoding, previewing, signing, and submitting Solana transactions.
|
|
4
|
+
*/
|
|
5
|
+
import type { SapMcpContext } from '../core/types.js';
|
|
6
|
+
import type { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
7
|
+
/**
|
|
8
|
+
* @name registerTransactionTools
|
|
9
|
+
* @description Registers real transaction decode, preview, signing, and submission tools.
|
|
10
|
+
* @param server - MCP server receiving the tool registrations.
|
|
11
|
+
* @param context - Runtime context containing Solana connection and optional signer.
|
|
12
|
+
*/
|
|
13
|
+
export declare function registerTransactionTools(server: Server, context: SapMcpContext): void;
|
|
14
|
+
//# sourceMappingURL=transaction-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transaction-tools.d.ts","sourceRoot":"","sources":["../../src/tools/transaction-tools.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAgPxE;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,IAAI,CAiIrF"}
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module transaction-tools
|
|
3
|
+
* @description MCP tools for decoding, previewing, signing, and submitting Solana transactions.
|
|
4
|
+
*/
|
|
5
|
+
import { LAMPORTS_PER_SOL, SystemProgram, Transaction, VersionedTransaction } from '@solana/web3.js';
|
|
6
|
+
import bs58 from 'bs58';
|
|
7
|
+
import { registerTool } from '../adapters/mcp/sdk-compat.js';
|
|
8
|
+
import { createTextResponse } from '../adapters/mcp/tool-response.js';
|
|
9
|
+
const SYSTEM_TRANSFER_INSTRUCTION_INDEX = 2;
|
|
10
|
+
const SYSTEM_TRANSFER_LAYOUT_BYTES = 12;
|
|
11
|
+
/**
|
|
12
|
+
* @name decodeInputBytes
|
|
13
|
+
* @description Decodes base64/base58 transaction text into raw bytes.
|
|
14
|
+
* @param value - Encoded transaction string.
|
|
15
|
+
* @param encoding - Encoding used by the incoming transaction.
|
|
16
|
+
* @returns Raw serialized transaction bytes.
|
|
17
|
+
*/
|
|
18
|
+
function decodeInputBytes(value, encoding = 'base64') {
|
|
19
|
+
if (encoding === 'base64') {
|
|
20
|
+
return Buffer.from(value, 'base64');
|
|
21
|
+
}
|
|
22
|
+
if (encoding === 'base58') {
|
|
23
|
+
return Buffer.from(bs58.decode(value));
|
|
24
|
+
}
|
|
25
|
+
throw new Error(`Unsupported transaction encoding: ${encoding}`);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* @name deserializeTransaction
|
|
29
|
+
* @description Deserializes a Solana transaction, preferring v0/versioned format before legacy fallback.
|
|
30
|
+
* @param value - Encoded transaction string.
|
|
31
|
+
* @param encoding - Encoding used by the incoming transaction.
|
|
32
|
+
* @returns Deserialized Solana transaction.
|
|
33
|
+
*/
|
|
34
|
+
function deserializeTransaction(value, encoding) {
|
|
35
|
+
const bytes = decodeInputBytes(value, encoding);
|
|
36
|
+
try {
|
|
37
|
+
return VersionedTransaction.deserialize(bytes);
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
return Transaction.from(bytes);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* @name parseSystemTransferLamports
|
|
45
|
+
* @description Reads lamports from a native System Program transfer instruction.
|
|
46
|
+
* @param data - Compiled instruction data.
|
|
47
|
+
* @returns Lamports for transfer instructions, otherwise zero.
|
|
48
|
+
*/
|
|
49
|
+
function parseSystemTransferLamports(data) {
|
|
50
|
+
if (data.byteLength < SYSTEM_TRANSFER_LAYOUT_BYTES) {
|
|
51
|
+
return 0n;
|
|
52
|
+
}
|
|
53
|
+
const view = new DataView(data.buffer, data.byteOffset, data.byteLength);
|
|
54
|
+
const instructionIndex = view.getUint32(0, true);
|
|
55
|
+
if (instructionIndex !== SYSTEM_TRANSFER_INSTRUCTION_INDEX) {
|
|
56
|
+
return 0n;
|
|
57
|
+
}
|
|
58
|
+
return view.getBigUint64(4, true);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* @name estimateNativeTransfer
|
|
62
|
+
* @description Estimates native SOL leaving the signer, or all native SOL transfers when no signer filter is supplied.
|
|
63
|
+
* @param transaction - Deserialized Solana transaction.
|
|
64
|
+
* @param signer - Optional signer to filter outgoing transfers.
|
|
65
|
+
* @returns Native transfer estimate in lamports and SOL.
|
|
66
|
+
*/
|
|
67
|
+
function estimateNativeTransfer(transaction, signer) {
|
|
68
|
+
let lamports = 0n;
|
|
69
|
+
if (transaction instanceof VersionedTransaction) {
|
|
70
|
+
const keys = transaction.message.staticAccountKeys;
|
|
71
|
+
for (const instruction of transaction.message.compiledInstructions) {
|
|
72
|
+
const programId = keys[instruction.programIdIndex];
|
|
73
|
+
if (!programId?.equals(SystemProgram.programId)) {
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
const fromIndex = instruction.accountKeyIndexes[0];
|
|
77
|
+
const from = fromIndex === undefined ? undefined : keys[fromIndex];
|
|
78
|
+
if (signer && !from?.equals(signer)) {
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
lamports += parseSystemTransferLamports(instruction.data);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
for (const instruction of transaction.instructions) {
|
|
86
|
+
if (!instruction.programId.equals(SystemProgram.programId)) {
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
const from = instruction.keys[0]?.pubkey;
|
|
90
|
+
if (signer && !from?.equals(signer)) {
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
lamports += parseSystemTransferLamports(instruction.data);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return {
|
|
97
|
+
lamports,
|
|
98
|
+
sol: Number(lamports) / LAMPORTS_PER_SOL,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* @name assertTransactionPolicy
|
|
103
|
+
* @description Enforces configured transaction value policy before signing or submitting a transaction.
|
|
104
|
+
* @param context - Shared MCP runtime context.
|
|
105
|
+
* @param transaction - Deserialized transaction to check.
|
|
106
|
+
* @param signer - Optional signer filter for signing checks.
|
|
107
|
+
*/
|
|
108
|
+
async function assertTransactionPolicy(context, transaction, signer) {
|
|
109
|
+
const nativeTransfer = estimateNativeTransfer(transaction, signer);
|
|
110
|
+
if (nativeTransfer.sol <= 0) {
|
|
111
|
+
return nativeTransfer;
|
|
112
|
+
}
|
|
113
|
+
const policy = await context.policyEngine.checkPermission('transaction:submit', {
|
|
114
|
+
amountSol: nativeTransfer.sol,
|
|
115
|
+
toolName: 'sap_sign_transaction',
|
|
116
|
+
});
|
|
117
|
+
if (!policy.allowed) {
|
|
118
|
+
throw new Error(policy.reason || `Native transfer of ${nativeTransfer.sol} SOL is blocked by policy`);
|
|
119
|
+
}
|
|
120
|
+
return nativeTransfer;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* @name serializeTransaction
|
|
124
|
+
* @description Serializes a legacy or versioned transaction as base64.
|
|
125
|
+
* @param transaction - Transaction to serialize.
|
|
126
|
+
* @returns Base64 encoded transaction bytes.
|
|
127
|
+
*/
|
|
128
|
+
function serializeTransaction(transaction) {
|
|
129
|
+
if (transaction instanceof VersionedTransaction) {
|
|
130
|
+
return Buffer.from(transaction.serialize()).toString('base64');
|
|
131
|
+
}
|
|
132
|
+
return transaction.serialize({
|
|
133
|
+
requireAllSignatures: false,
|
|
134
|
+
verifySignatures: false,
|
|
135
|
+
}).toString('base64');
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* @name describeTransaction
|
|
139
|
+
* @description Builds a stable JSON preview from a Solana transaction.
|
|
140
|
+
* @param transaction - Deserialized transaction.
|
|
141
|
+
* @returns Transaction metadata safe to expose to MCP clients.
|
|
142
|
+
*/
|
|
143
|
+
function describeTransaction(transaction, context) {
|
|
144
|
+
const nativeTransfer = estimateNativeTransfer(transaction);
|
|
145
|
+
const maxTxValueSol = context?.config.maxTxValueSol;
|
|
146
|
+
const policyAllowed = context
|
|
147
|
+
? nativeTransfer.sol <= context.config.requireApprovalAboveSol
|
|
148
|
+
&& nativeTransfer.sol <= context.config.maxTxValueSol
|
|
149
|
+
: undefined;
|
|
150
|
+
const policyReason = context && !policyAllowed
|
|
151
|
+
? maxTxValueSol !== undefined && nativeTransfer.sol > maxTxValueSol
|
|
152
|
+
? `Native transfer ${nativeTransfer.sol} SOL exceeds max ${maxTxValueSol} SOL`
|
|
153
|
+
: `Native transfer ${nativeTransfer.sol} SOL requires approval above ${context.config.requireApprovalAboveSol} SOL`
|
|
154
|
+
: undefined;
|
|
155
|
+
if (transaction instanceof VersionedTransaction) {
|
|
156
|
+
const header = transaction.message.header;
|
|
157
|
+
const accountKeys = transaction.message.staticAccountKeys.map((key) => key.toBase58());
|
|
158
|
+
return {
|
|
159
|
+
kind: 'versioned',
|
|
160
|
+
signatureCount: transaction.signatures.length,
|
|
161
|
+
readonlySignedAccounts: header.numReadonlySignedAccounts,
|
|
162
|
+
readonlyUnsignedAccounts: header.numReadonlyUnsignedAccounts,
|
|
163
|
+
requiredSignatures: header.numRequiredSignatures,
|
|
164
|
+
instructionCount: transaction.message.compiledInstructions.length,
|
|
165
|
+
accountKeys,
|
|
166
|
+
recentBlockhash: transaction.message.recentBlockhash,
|
|
167
|
+
feePayer: accountKeys[0],
|
|
168
|
+
nativeTransferSol: nativeTransfer.sol,
|
|
169
|
+
policyAllowed,
|
|
170
|
+
policyReason,
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
return {
|
|
174
|
+
kind: 'legacy',
|
|
175
|
+
signatureCount: transaction.signatures.length,
|
|
176
|
+
readonlySignedAccounts: 0,
|
|
177
|
+
readonlyUnsignedAccounts: 0,
|
|
178
|
+
requiredSignatures: transaction.signatures.length,
|
|
179
|
+
instructionCount: transaction.instructions.length,
|
|
180
|
+
accountKeys: transaction.instructions.flatMap((instruction) => instruction.keys.map((key) => key.pubkey.toBase58())),
|
|
181
|
+
recentBlockhash: transaction.recentBlockhash ?? '',
|
|
182
|
+
feePayer: transaction.feePayer?.toBase58(),
|
|
183
|
+
nativeTransferSol: nativeTransfer.sol,
|
|
184
|
+
policyAllowed,
|
|
185
|
+
policyReason,
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* @name registerTransactionTools
|
|
190
|
+
* @description Registers real transaction decode, preview, signing, and submission tools.
|
|
191
|
+
* @param server - MCP server receiving the tool registrations.
|
|
192
|
+
* @param context - Runtime context containing Solana connection and optional signer.
|
|
193
|
+
*/
|
|
194
|
+
export function registerTransactionTools(server, context) {
|
|
195
|
+
registerTool(server, 'sap_decode_transaction', {
|
|
196
|
+
title: 'Decode Transaction',
|
|
197
|
+
description: 'Decode a serialized Solana transaction and return stable transaction metadata.',
|
|
198
|
+
inputSchema: {
|
|
199
|
+
transaction: { type: 'string', description: 'Serialized transaction' },
|
|
200
|
+
encoding: { type: 'string', enum: ['base64', 'base58'], description: 'Input encoding' },
|
|
201
|
+
},
|
|
202
|
+
}, async (input) => {
|
|
203
|
+
try {
|
|
204
|
+
if (!input.transaction) {
|
|
205
|
+
throw new Error('transaction is required');
|
|
206
|
+
}
|
|
207
|
+
return createTextResponse(JSON.stringify(describeTransaction(deserializeTransaction(input.transaction, input.encoding), context), null, 2));
|
|
208
|
+
}
|
|
209
|
+
catch (error) {
|
|
210
|
+
return createTextResponse(`Error: ${error instanceof Error ? error.message : 'Unknown error'}`, { isError: true });
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
registerTool(server, 'sap_preview_transaction', {
|
|
214
|
+
title: 'Preview Transaction',
|
|
215
|
+
description: 'Preview a Solana transaction before signing or submission.',
|
|
216
|
+
inputSchema: {
|
|
217
|
+
transaction: { type: 'string', description: 'Serialized transaction' },
|
|
218
|
+
encoding: { type: 'string', enum: ['base64', 'base58'], description: 'Input encoding' },
|
|
219
|
+
},
|
|
220
|
+
}, async (input) => {
|
|
221
|
+
try {
|
|
222
|
+
if (!input.transaction) {
|
|
223
|
+
throw new Error('transaction is required');
|
|
224
|
+
}
|
|
225
|
+
const transaction = deserializeTransaction(input.transaction, input.encoding);
|
|
226
|
+
const preview = describeTransaction(transaction, context);
|
|
227
|
+
return createTextResponse(JSON.stringify({
|
|
228
|
+
...preview,
|
|
229
|
+
canSign: Boolean(context.signer),
|
|
230
|
+
signer: context.signer?.publicKey.toBase58(),
|
|
231
|
+
}, null, 2));
|
|
232
|
+
}
|
|
233
|
+
catch (error) {
|
|
234
|
+
return createTextResponse(`Error: ${error instanceof Error ? error.message : 'Unknown error'}`, { isError: true });
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
registerTool(server, 'sap_sign_transaction', {
|
|
238
|
+
title: 'Sign Transaction',
|
|
239
|
+
description: 'Sign a serialized Solana transaction with the configured SAP MCP signer.',
|
|
240
|
+
inputSchema: {
|
|
241
|
+
transaction: { type: 'string', description: 'Unsigned or partially signed transaction' },
|
|
242
|
+
encoding: { type: 'string', enum: ['base64', 'base58'], description: 'Input encoding' },
|
|
243
|
+
},
|
|
244
|
+
}, async (input) => {
|
|
245
|
+
try {
|
|
246
|
+
if (!context.signer) {
|
|
247
|
+
throw new Error('No signer configured. Use local-dev-keypair or external-signer mode.');
|
|
248
|
+
}
|
|
249
|
+
if (!input.transaction) {
|
|
250
|
+
throw new Error('transaction is required');
|
|
251
|
+
}
|
|
252
|
+
const transaction = deserializeTransaction(input.transaction, input.encoding);
|
|
253
|
+
const nativeTransfer = await assertTransactionPolicy(context, transaction, context.signer.publicKey);
|
|
254
|
+
const signedTransaction = await context.signer.signTransaction(transaction);
|
|
255
|
+
return createTextResponse(JSON.stringify({
|
|
256
|
+
success: true,
|
|
257
|
+
publicKey: context.signer.publicKey.toBase58(),
|
|
258
|
+
nativeTransferSol: nativeTransfer.sol,
|
|
259
|
+
transaction: serializeTransaction(signedTransaction),
|
|
260
|
+
encoding: 'base64',
|
|
261
|
+
}, null, 2));
|
|
262
|
+
}
|
|
263
|
+
catch (error) {
|
|
264
|
+
return createTextResponse(`Error: ${error instanceof Error ? error.message : 'Unknown error'}`, { isError: true });
|
|
265
|
+
}
|
|
266
|
+
});
|
|
267
|
+
registerTool(server, 'sap_submit_signed_transaction', {
|
|
268
|
+
title: 'Submit Signed Transaction',
|
|
269
|
+
description: 'Submit a signed Solana transaction through the configured RPC endpoint.',
|
|
270
|
+
inputSchema: {
|
|
271
|
+
signedTransaction: { type: 'string', description: 'Signed serialized transaction' },
|
|
272
|
+
encoding: { type: 'string', enum: ['base64', 'base58'], description: 'Input encoding' },
|
|
273
|
+
skipPreflight: { type: 'boolean', description: 'Skip RPC preflight checks' },
|
|
274
|
+
maxRetries: { type: 'number', description: 'Maximum RPC send retries' },
|
|
275
|
+
},
|
|
276
|
+
}, async (input) => {
|
|
277
|
+
try {
|
|
278
|
+
if (!input.signedTransaction) {
|
|
279
|
+
throw new Error('signedTransaction is required');
|
|
280
|
+
}
|
|
281
|
+
const rawTransaction = decodeInputBytes(input.signedTransaction, input.encoding);
|
|
282
|
+
await assertTransactionPolicy(context, deserializeTransaction(input.signedTransaction, input.encoding));
|
|
283
|
+
const signature = await context.connection.sendRawTransaction(rawTransaction, {
|
|
284
|
+
skipPreflight: input.skipPreflight,
|
|
285
|
+
maxRetries: input.maxRetries,
|
|
286
|
+
});
|
|
287
|
+
return createTextResponse(JSON.stringify({
|
|
288
|
+
success: true,
|
|
289
|
+
signature,
|
|
290
|
+
}, null, 2));
|
|
291
|
+
}
|
|
292
|
+
catch (error) {
|
|
293
|
+
return createTextResponse(`Error: ${error instanceof Error ? error.message : 'Unknown error'}`, { isError: true });
|
|
294
|
+
}
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
//# sourceMappingURL=transaction-tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transaction-tools.js","sourceRoot":"","sources":["../../src/tools/transaction-tools.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAa,aAAa,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAChH,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAmCtE,MAAM,iCAAiC,GAAG,CAAC,CAAC;AAC5C,MAAM,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