@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,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Policy type definitions
|
|
3
|
+
*/
|
|
4
|
+
import type { SapPermission, SapRiskLevel } from '../core/types.js';
|
|
5
|
+
/**
|
|
6
|
+
* Policy definition
|
|
7
|
+
*/
|
|
8
|
+
export interface Policy {
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
description: string;
|
|
12
|
+
rules: PolicyRule[];
|
|
13
|
+
enabled: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Policy rule
|
|
17
|
+
*/
|
|
18
|
+
export interface PolicyRule {
|
|
19
|
+
id: string;
|
|
20
|
+
condition: string;
|
|
21
|
+
action: 'allow' | 'deny' | 'require_approval';
|
|
22
|
+
tools?: string[];
|
|
23
|
+
permissions?: SapPermission[];
|
|
24
|
+
maxAmountSol?: number;
|
|
25
|
+
riskLevel?: SapRiskLevel;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Policy evaluation result
|
|
29
|
+
*/
|
|
30
|
+
export interface PolicyResult {
|
|
31
|
+
allowed: boolean;
|
|
32
|
+
reason?: string;
|
|
33
|
+
requiresApproval?: boolean;
|
|
34
|
+
riskLevel?: SapRiskLevel;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Policy context
|
|
38
|
+
*/
|
|
39
|
+
export interface PolicyContext {
|
|
40
|
+
toolName: string;
|
|
41
|
+
permission: SapPermission;
|
|
42
|
+
amountSol?: number;
|
|
43
|
+
riskLevel?: SapRiskLevel;
|
|
44
|
+
sessionId?: string;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=policy-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"policy-types.d.ts","sourceRoot":"","sources":["../../src/policy/policy-types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEpE;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,kBAAkB,CAAC;IAC9C,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,WAAW,CAAC,EAAE,aAAa,EAAE,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,YAAY,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,SAAS,CAAC,EAAE,YAAY,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,aAAa,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,YAAY,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"policy-types.js","sourceRoot":"","sources":["../../src/policy/policy-types.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Risk level calculation
|
|
3
|
+
*/
|
|
4
|
+
import type { SapRiskLevel } from '../core/types.js';
|
|
5
|
+
/**
|
|
6
|
+
* Calculate risk level for a transaction
|
|
7
|
+
*/
|
|
8
|
+
export declare function calculateRiskLevel(params: {
|
|
9
|
+
amountSol: number;
|
|
10
|
+
isWriteOperation: boolean;
|
|
11
|
+
isKnownOperation: boolean;
|
|
12
|
+
toolName: string;
|
|
13
|
+
}): SapRiskLevel;
|
|
14
|
+
/**
|
|
15
|
+
* Check if risk level requires approval
|
|
16
|
+
*/
|
|
17
|
+
export declare function requiresApproval(riskLevel: SapRiskLevel): boolean;
|
|
18
|
+
//# sourceMappingURL=risk-level.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"risk-level.d.ts","sourceRoot":"","sources":["../../src/policy/risk-level.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,YAAY,CAgCf;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,YAAY,GAAG,OAAO,CAEjE"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Risk level calculation
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Calculate risk level for a transaction
|
|
6
|
+
*/
|
|
7
|
+
export function calculateRiskLevel(params) {
|
|
8
|
+
const { amountSol, isWriteOperation, isKnownOperation } = params;
|
|
9
|
+
// Base risk from amount
|
|
10
|
+
let risk = 'safe';
|
|
11
|
+
if (amountSol === 0) {
|
|
12
|
+
risk = 'safe';
|
|
13
|
+
}
|
|
14
|
+
else if (amountSol < 0.1) {
|
|
15
|
+
risk = 'low';
|
|
16
|
+
}
|
|
17
|
+
else if (amountSol < 1.0) {
|
|
18
|
+
risk = 'medium';
|
|
19
|
+
}
|
|
20
|
+
else if (amountSol < 10.0) {
|
|
21
|
+
risk = 'high';
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
risk = 'critical';
|
|
25
|
+
}
|
|
26
|
+
// Increase risk for write operations
|
|
27
|
+
if (isWriteOperation && risk === 'safe') {
|
|
28
|
+
risk = 'low';
|
|
29
|
+
}
|
|
30
|
+
// Decrease risk for known operations
|
|
31
|
+
if (isKnownOperation && risk !== 'safe') {
|
|
32
|
+
const levels = ['safe', 'low', 'medium', 'high', 'critical'];
|
|
33
|
+
const currentIndex = levels.indexOf(risk);
|
|
34
|
+
if (currentIndex > 0) {
|
|
35
|
+
risk = levels[currentIndex - 1];
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return risk;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Check if risk level requires approval
|
|
42
|
+
*/
|
|
43
|
+
export function requiresApproval(riskLevel) {
|
|
44
|
+
return riskLevel === 'high' || riskLevel === 'critical';
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=risk-level.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"risk-level.js","sourceRoot":"","sources":["../../src/policy/risk-level.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAKlC;IACC,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,GAAG,MAAM,CAAC;IAEjE,wBAAwB;IACxB,IAAI,IAAI,GAAiB,MAAM,CAAC;IAChC,IAAI,SAAS,KAAK,CAAC,EAAE,CAAC;QACpB,IAAI,GAAG,MAAM,CAAC;IAChB,CAAC;SAAM,IAAI,SAAS,GAAG,GAAG,EAAE,CAAC;QAC3B,IAAI,GAAG,KAAK,CAAC;IACf,CAAC;SAAM,IAAI,SAAS,GAAG,GAAG,EAAE,CAAC;QAC3B,IAAI,GAAG,QAAQ,CAAC;IAClB,CAAC;SAAM,IAAI,SAAS,GAAG,IAAI,EAAE,CAAC;QAC5B,IAAI,GAAG,MAAM,CAAC;IAChB,CAAC;SAAM,CAAC;QACN,IAAI,GAAG,UAAU,CAAC;IACpB,CAAC;IAED,qCAAqC;IACrC,IAAI,gBAAgB,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;QACxC,IAAI,GAAG,KAAK,CAAC;IACf,CAAC;IAED,qCAAqC;IACrC,IAAI,gBAAgB,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;QACxC,MAAM,MAAM,GAAmB,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;QAC7E,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC1C,IAAI,YAAY,GAAG,CAAC,EAAE,CAAC;YACrB,IAAI,GAAG,MAAM,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,SAAuB;IACtD,OAAO,SAAS,KAAK,MAAM,IAAI,SAAS,KAAK,UAAU,CAAC;AAC1D,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spending limits enforcement
|
|
3
|
+
*/
|
|
4
|
+
import type { SapMcpConfig } from '../core/types.js';
|
|
5
|
+
/**
|
|
6
|
+
* Check if amount is within spending limits
|
|
7
|
+
*/
|
|
8
|
+
export declare function checkSpendingLimit(config: SapMcpConfig, amountSol: number): {
|
|
9
|
+
allowed: boolean;
|
|
10
|
+
reason?: string;
|
|
11
|
+
requiresApproval?: boolean;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Calculate risk level based on amount
|
|
15
|
+
*/
|
|
16
|
+
export declare function calculateRiskLevel(amountSol: number): 'safe' | 'low' | 'medium' | 'high' | 'critical';
|
|
17
|
+
//# sourceMappingURL=spending-limits.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spending-limits.d.ts","sourceRoot":"","sources":["../../src/policy/spending-limits.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,MAAM,GAChB;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAAE,CAoBnE;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAMrG"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spending limits enforcement
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Check if amount is within spending limits
|
|
6
|
+
*/
|
|
7
|
+
export function checkSpendingLimit(config, amountSol) {
|
|
8
|
+
// Check max transaction limit
|
|
9
|
+
const maxTxValueSol = config.maxTxValueSol;
|
|
10
|
+
if (amountSol > maxTxValueSol) {
|
|
11
|
+
return {
|
|
12
|
+
allowed: false,
|
|
13
|
+
reason: `Amount ${amountSol} SOL exceeds maximum transaction limit ${maxTxValueSol} SOL`,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
// Check if approval is required
|
|
17
|
+
if (amountSol > config.requireApprovalAboveSol) {
|
|
18
|
+
return {
|
|
19
|
+
allowed: false,
|
|
20
|
+
requiresApproval: true,
|
|
21
|
+
reason: `Amount ${amountSol} SOL requires approval (threshold: ${config.requireApprovalAboveSol} SOL)`,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
return { allowed: true };
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Calculate risk level based on amount
|
|
28
|
+
*/
|
|
29
|
+
export function calculateRiskLevel(amountSol) {
|
|
30
|
+
if (amountSol === 0)
|
|
31
|
+
return 'safe';
|
|
32
|
+
if (amountSol < 0.1)
|
|
33
|
+
return 'low';
|
|
34
|
+
if (amountSol < 1.0)
|
|
35
|
+
return 'medium';
|
|
36
|
+
if (amountSol < 10.0)
|
|
37
|
+
return 'high';
|
|
38
|
+
return 'critical';
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=spending-limits.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spending-limits.js","sourceRoot":"","sources":["../../src/policy/spending-limits.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAChC,MAAoB,EACpB,SAAiB;IAEjB,8BAA8B;IAC9B,MAAM,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC;IAC3C,IAAI,SAAS,GAAG,aAAa,EAAE,CAAC;QAC9B,OAAO;YACL,OAAO,EAAE,KAAK;YACd,MAAM,EAAE,UAAU,SAAS,0CAA0C,aAAa,MAAM;SACzF,CAAC;IACJ,CAAC;IAED,gCAAgC;IAChC,IAAI,SAAS,GAAG,MAAM,CAAC,uBAAuB,EAAE,CAAC;QAC/C,OAAO;YACL,OAAO,EAAE,KAAK;YACd,gBAAgB,EAAE,IAAI;YACtB,MAAM,EAAE,UAAU,SAAS,sCAAsC,MAAM,CAAC,uBAAuB,OAAO;SACvG,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC3B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,SAAiB;IAClD,IAAI,SAAS,KAAK,CAAC;QAAE,OAAO,MAAM,CAAC;IACnC,IAAI,SAAS,GAAG,GAAG;QAAE,OAAO,KAAK,CAAC;IAClC,IAAI,SAAS,GAAG,GAAG;QAAE,OAAO,QAAQ,CAAC;IACrC,IAAI,SAAS,GAAG,IAAI;QAAE,OAAO,MAAM,CAAC;IACpC,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SAP MCP Agent Context Prompt
|
|
3
|
+
*
|
|
4
|
+
* Provides complete context about the current SAP MCP configuration,
|
|
5
|
+
* active profile, wallet, and available capabilities.
|
|
6
|
+
*
|
|
7
|
+
* Agents should call this prompt before executing any SAP-related operations
|
|
8
|
+
* to understand their operating context and constraints.
|
|
9
|
+
*
|
|
10
|
+
* @module prompts/context/sap-agent-context
|
|
11
|
+
*/
|
|
12
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
13
|
+
import type { SapMcpContext } from '../../core/types.js';
|
|
14
|
+
/**
|
|
15
|
+
* Registers the agent context prompt.
|
|
16
|
+
*
|
|
17
|
+
* This prompt provides a comprehensive, human-readable overview of the
|
|
18
|
+
* current SAP MCP configuration, including:
|
|
19
|
+
* - Active profile and agent identity
|
|
20
|
+
* - Operating mode and connection settings
|
|
21
|
+
* - Redacted signer status
|
|
22
|
+
* - Security limits and policy settings
|
|
23
|
+
* - Feature flags and logging configuration
|
|
24
|
+
* - Available profiles and management commands
|
|
25
|
+
*
|
|
26
|
+
* Agents should call this prompt at the start of a session or before
|
|
27
|
+
* performing any SAP operations to ensure they have accurate context.
|
|
28
|
+
*
|
|
29
|
+
* @param server - MCP server instance
|
|
30
|
+
* @param context - SAP MCP execution context
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```typescript
|
|
34
|
+
* // Agent calls the prompt
|
|
35
|
+
* const result = await mcp.getPrompt('sap-agent-context', {
|
|
36
|
+
* includeWallet: 'true',
|
|
37
|
+
* includeProfiles: 'true',
|
|
38
|
+
* });
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```markdown
|
|
43
|
+
* // Output includes:
|
|
44
|
+
* ## 🎯 SAP MCP Agent Context
|
|
45
|
+
*
|
|
46
|
+
* ### 📋 Active Profile
|
|
47
|
+
* - Name: citizen-support-agent
|
|
48
|
+
* - Agent Pubkey: HZreoFG...
|
|
49
|
+
*
|
|
50
|
+
* ### 🔐 Operating Mode
|
|
51
|
+
* - Mode: local-dev-keypair
|
|
52
|
+
* - RPC URL: https://api.devnet.solana.com
|
|
53
|
+
*
|
|
54
|
+
* ### 💳 Wallet Configuration
|
|
55
|
+
* - Managed by profile: yes
|
|
56
|
+
* - Secret material: never exposed through MCP
|
|
57
|
+
*
|
|
58
|
+
* ### 🛡️ Security Limits
|
|
59
|
+
* - Max TX Value: 1.0 SOL
|
|
60
|
+
* - Daily Limit: 10.0 SOL
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
export declare function sapAgentContextPrompt(server: Server, _context: SapMcpContext): void;
|
|
64
|
+
//# sourceMappingURL=sap-agent-context.prompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sap-agent-context.prompt.d.ts","sourceRoot":"","sources":["../../../src/prompts/context/sap-agent-context.prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAGnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAwBzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,GAAG,IAAI,CAoGnF"}
|
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SAP MCP Agent Context Prompt
|
|
3
|
+
*
|
|
4
|
+
* Provides complete context about the current SAP MCP configuration,
|
|
5
|
+
* active profile, wallet, and available capabilities.
|
|
6
|
+
*
|
|
7
|
+
* Agents should call this prompt before executing any SAP-related operations
|
|
8
|
+
* to understand their operating context and constraints.
|
|
9
|
+
*
|
|
10
|
+
* @module prompts/context/sap-agent-context
|
|
11
|
+
*/
|
|
12
|
+
import { registerPrompt } from '../../adapters/mcp/sdk-compat.js';
|
|
13
|
+
import { logger } from '../../core/logger.js';
|
|
14
|
+
import { getActiveProfile, loadProfileConfig, getCurrentProfileInfo, listProfiles, getProfileConfigPath } from '../../config/profiles.js';
|
|
15
|
+
import { getPreferredConfigDir } from '../../config/paths.js';
|
|
16
|
+
const HOSTED_MCP_URL = 'https://mcp.sap.oobeprotocol.ai/mcp';
|
|
17
|
+
const WIZARD_DESCRIPTOR_URL = 'https://mcp.sap.oobeprotocol.ai/.well-known/sap-mcp-wizard.json';
|
|
18
|
+
const WIZARD_INSTALL_SCRIPT_URL = 'https://mcp.sap.oobeprotocol.ai/wizard/install.sh';
|
|
19
|
+
const WIZARD_NPM_COMMAND = 'npm exec --yes --package @oobe-protocol-labs/sap-mcp-server -- sap-mcp-config wizard';
|
|
20
|
+
/**
|
|
21
|
+
* Registers the agent context prompt.
|
|
22
|
+
*
|
|
23
|
+
* This prompt provides a comprehensive, human-readable overview of the
|
|
24
|
+
* current SAP MCP configuration, including:
|
|
25
|
+
* - Active profile and agent identity
|
|
26
|
+
* - Operating mode and connection settings
|
|
27
|
+
* - Redacted signer status
|
|
28
|
+
* - Security limits and policy settings
|
|
29
|
+
* - Feature flags and logging configuration
|
|
30
|
+
* - Available profiles and management commands
|
|
31
|
+
*
|
|
32
|
+
* Agents should call this prompt at the start of a session or before
|
|
33
|
+
* performing any SAP operations to ensure they have accurate context.
|
|
34
|
+
*
|
|
35
|
+
* @param server - MCP server instance
|
|
36
|
+
* @param context - SAP MCP execution context
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```typescript
|
|
40
|
+
* // Agent calls the prompt
|
|
41
|
+
* const result = await mcp.getPrompt('sap-agent-context', {
|
|
42
|
+
* includeWallet: 'true',
|
|
43
|
+
* includeProfiles: 'true',
|
|
44
|
+
* });
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```markdown
|
|
49
|
+
* // Output includes:
|
|
50
|
+
* ## 🎯 SAP MCP Agent Context
|
|
51
|
+
*
|
|
52
|
+
* ### 📋 Active Profile
|
|
53
|
+
* - Name: citizen-support-agent
|
|
54
|
+
* - Agent Pubkey: HZreoFG...
|
|
55
|
+
*
|
|
56
|
+
* ### 🔐 Operating Mode
|
|
57
|
+
* - Mode: local-dev-keypair
|
|
58
|
+
* - RPC URL: https://api.devnet.solana.com
|
|
59
|
+
*
|
|
60
|
+
* ### 💳 Wallet Configuration
|
|
61
|
+
* - Managed by profile: yes
|
|
62
|
+
* - Secret material: never exposed through MCP
|
|
63
|
+
*
|
|
64
|
+
* ### 🛡️ Security Limits
|
|
65
|
+
* - Max TX Value: 1.0 SOL
|
|
66
|
+
* - Daily Limit: 10.0 SOL
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
export function sapAgentContextPrompt(server, _context) {
|
|
70
|
+
registerPrompt(server, 'sap-agent-context', {}, {
|
|
71
|
+
description: 'Get complete context about the current SAP MCP configuration, active profile, redacted signer status, and available capabilities. Use this before any SAP operations.',
|
|
72
|
+
arguments: [
|
|
73
|
+
{
|
|
74
|
+
name: 'includeWallet',
|
|
75
|
+
description: 'Include redacted signer status only; keypair paths and bytes are never exposed (default: false)',
|
|
76
|
+
required: false,
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: 'includeProfiles',
|
|
80
|
+
description: 'Include list of all available profiles (default: true)',
|
|
81
|
+
required: false,
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
}, async (args) => {
|
|
85
|
+
try {
|
|
86
|
+
const parsedArgs = args || {};
|
|
87
|
+
const includeWallet = parsedArgs.includeWallet === 'true';
|
|
88
|
+
const includeProfiles = parsedArgs.includeProfiles !== 'false';
|
|
89
|
+
const activeProfile = getActiveProfile();
|
|
90
|
+
const config = loadProfileConfig(activeProfile);
|
|
91
|
+
const profileInfo = getCurrentProfileInfo();
|
|
92
|
+
const configDir = getPreferredConfigDir();
|
|
93
|
+
const allProfiles = includeProfiles ? listProfiles() : [];
|
|
94
|
+
// Handle missing configuration
|
|
95
|
+
if (!config) {
|
|
96
|
+
logger.warn('Agent context requested but config not found', { profile: activeProfile });
|
|
97
|
+
return {
|
|
98
|
+
description: 'SAP MCP configuration not found',
|
|
99
|
+
messages: [
|
|
100
|
+
{
|
|
101
|
+
role: 'user',
|
|
102
|
+
content: {
|
|
103
|
+
type: 'text',
|
|
104
|
+
text: buildMissingConfigMessage(activeProfile, configDir),
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
// Build comprehensive context message
|
|
111
|
+
const contextText = buildContextMessage({
|
|
112
|
+
activeProfile,
|
|
113
|
+
config: config,
|
|
114
|
+
profileInfo,
|
|
115
|
+
configDir,
|
|
116
|
+
includeWallet,
|
|
117
|
+
includeProfiles,
|
|
118
|
+
allProfiles,
|
|
119
|
+
});
|
|
120
|
+
logger.debug('Agent context prompt generated', {
|
|
121
|
+
profile: activeProfile,
|
|
122
|
+
includeWallet,
|
|
123
|
+
includeProfiles,
|
|
124
|
+
profileCount: allProfiles.length,
|
|
125
|
+
});
|
|
126
|
+
return {
|
|
127
|
+
description: 'Complete SAP MCP agent context',
|
|
128
|
+
messages: [
|
|
129
|
+
{
|
|
130
|
+
role: 'user',
|
|
131
|
+
content: {
|
|
132
|
+
type: 'text',
|
|
133
|
+
text: contextText,
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
],
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
catch (error) {
|
|
140
|
+
logger.error('Failed to generate agent context prompt', { error });
|
|
141
|
+
return {
|
|
142
|
+
description: 'Error generating agent context',
|
|
143
|
+
messages: [
|
|
144
|
+
{
|
|
145
|
+
role: 'user',
|
|
146
|
+
content: {
|
|
147
|
+
type: 'text',
|
|
148
|
+
text: buildErrorMessage(error),
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
],
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
logger.info('Agent context prompt registered');
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Builds context message for successful config load.
|
|
159
|
+
*/
|
|
160
|
+
function buildContextMessage(options) {
|
|
161
|
+
const { activeProfile, config, includeWallet, includeProfiles, allProfiles } = options;
|
|
162
|
+
let contextText = `## 🎯 SAP MCP Agent Context
|
|
163
|
+
|
|
164
|
+
### 📋 Active Profile
|
|
165
|
+
- **Name:** \`${activeProfile}\`
|
|
166
|
+
- **Config Path:** \`${getProfileConfigPath(activeProfile)}\`
|
|
167
|
+
- **Agent Pubkey:** \`${config.agentPubkey || 'Not configured'}\`
|
|
168
|
+
|
|
169
|
+
### 🗣️ Response Language
|
|
170
|
+
- Answer in the same natural language as the user's latest request.
|
|
171
|
+
- If the user asks in English, answer in English even when previous context or tool data contains Italian.
|
|
172
|
+
- Keep SAP/Solana tool names, protocol IDs, addresses, and error strings unchanged.
|
|
173
|
+
|
|
174
|
+
### 🔐 Operating Mode
|
|
175
|
+
- **Mode:** \`${config.mode}\`
|
|
176
|
+
- **RPC URL:** \`${config.rpcUrl}\`
|
|
177
|
+
- **Commitment:** \`${config.commitment}\`
|
|
178
|
+
- **Program ID:** \`${config.programId}\`
|
|
179
|
+
|
|
180
|
+
`;
|
|
181
|
+
if (includeWallet) {
|
|
182
|
+
contextText += `### 💳 Signer Configuration
|
|
183
|
+
- **Managed By Profile:** ${config.walletPath ? 'Yes' : 'No'}
|
|
184
|
+
- **Type:** ${config.mode === 'local-dev-keypair' ? 'Keypair File' : config.mode}
|
|
185
|
+
- **Secret Material:** Never exposed through MCP context
|
|
186
|
+
- **Instruction:** Do not read wallet/keypair files; use MCP signing tools only
|
|
187
|
+
|
|
188
|
+
`;
|
|
189
|
+
}
|
|
190
|
+
contextText += `### 🛡️ Security Limits
|
|
191
|
+
- **Max TX Value:** ${config.maxTxValueSol} SOL
|
|
192
|
+
- **Daily Limit:** ${config.dailyLimitSol} SOL
|
|
193
|
+
- **Approval Required:** Above ${config.requireApprovalAboveSol} SOL
|
|
194
|
+
- **Policy Mode:** ${config.policy?.mode || 'local-only'}
|
|
195
|
+
|
|
196
|
+
### 🧰 Hosted Wizard Recovery
|
|
197
|
+
- If this agent cannot see \`${options.configDir}\`, \`~/.config/mcp-sap\`, or the current OS profile config, do not guess wallet paths and do not read keypair files.
|
|
198
|
+
- Ask the user to install/run the SAP MCP wizard from \`${WIZARD_DESCRIPTOR_URL}\` or \`${WIZARD_INSTALL_SCRIPT_URL}\`.
|
|
199
|
+
- Hosted MCP URL: \`${HOSTED_MCP_URL}\`
|
|
200
|
+
- Wizard command: \`${WIZARD_NPM_COMMAND}\`
|
|
201
|
+
- The wizard creates the user SAP profile, dedicated wallet path or external signer, policy limits, and optional MCP client injection.
|
|
202
|
+
|
|
203
|
+
### ⚙️ Features
|
|
204
|
+
- **HTTP API:** ${config.enableHttp ? `Enabled (port ${config.httpPort})` : 'Disabled'}
|
|
205
|
+
- **Metrics:** ${config.enableMetrics ? 'Enabled' : 'Disabled'}
|
|
206
|
+
- **Bento Guard:** ${config.bento?.enabled ? 'Enabled' : 'Disabled'}
|
|
207
|
+
- **Logging:** ${config.logLevel} (${config.logFormat})
|
|
208
|
+
|
|
209
|
+
### 🧭 SAP Tool Selection
|
|
210
|
+
- Use \`sap_profile_current\`, \`sap_profile_list\`, and \`sap_network_stats\` before operational work.
|
|
211
|
+
- Use \`sap_get_network_overview\` for live ecosystem counters.
|
|
212
|
+
- Use \`sap_list_all_agents\` when the user asks for every current SAP ecosystem agent. It enumerates on-chain \`AgentAccount\` PDAs and can include protocol index summaries.
|
|
213
|
+
- Use \`sap_discover_agents\` or \`sap_list_agents\` only when the user provides a \`protocol\`, \`capability\`, or \`capabilities\` filter.
|
|
214
|
+
- Use \`sap_fetch_protocol_index\` when a specific protocol ID is known and the user wants protocol-index membership.
|
|
215
|
+
- Never claim that global enumeration is impossible without first trying \`sap_list_all_agents\`.
|
|
216
|
+
|
|
217
|
+
### 🔗 Solana Protocol Tool Routing
|
|
218
|
+
Some MCP clients display tool names as \`mcp_sap_<tool>\`; inside this server the callable names omit that client prefix.
|
|
219
|
+
|
|
220
|
+
| Need | Preferred Tools |
|
|
221
|
+
| --- | --- |
|
|
222
|
+
| SOL/SPL balances and transfers | \`sol_get_balance\`, \`spl-token_getBalance\`, \`spl-token_getTokenAccounts\`, \`spl-token_transfer\`, \`spl-token_transferSol\` |
|
|
223
|
+
| Jupiter swaps and quotes | \`jupiter_getQuote\`, \`jupiter_swap\`, \`jupiter_swapInstructions\`, \`jupiter_smartSwap\`, \`jupiter_getOrder\`, \`jupiter_executeOrder\` |
|
|
224
|
+
| Jupiter token intelligence | \`jupiter_searchTokens\`, \`jupiter_getTokenInfo\`, \`jupiter_getTokenList\`, \`jupiter_shield\`, \`jupiter_getHoldings\` |
|
|
225
|
+
| DEX, perps, liquidity | \`drift_*\`, \`adrena_*\`, \`orca_*\`, \`raydium-pools_*\`, \`meteora_*\`, \`openbook_*\`, \`manifest_*\` |
|
|
226
|
+
| Price and market data | \`pyth_getPrice\`, \`pyth_getPriceHistory\`, \`pyth_listPriceFeeds\`, \`coingecko_getTokenPrice\`, \`coingecko_getTokenInfo\` |
|
|
227
|
+
| NFTs and domains | \`metaplex-nft_*\`, \`3land_*\`, \`sap_sns_*\`, \`sns_*\`, \`alldomains_*\` |
|
|
228
|
+
| Bridges, staking, actions | \`bridging_*\`, \`staking_*\`, \`jito_*\`, \`blinks_*\`, \`lulo_*\` |
|
|
229
|
+
|
|
230
|
+
### ⚠️ SNS Domain Registration — Critical Tool Selection
|
|
231
|
+
- **DO NOT use \`sns_registerDomain\`** (AgentKit) — it returns \`{ status: 'instruction_ready' }\` without building a real transaction. It cannot register domains.
|
|
232
|
+
- **DO NOT use \`sap_sns_build_register_domain_transaction\`** — it has an SDK bug that causes "The domain name is malformed" error.
|
|
233
|
+
- **USE \`sap_sns_register_agent_domain\`** — this is the only working SNS domain registration tool. It builds, signs, and submits the transaction with USDC payment in one call.
|
|
234
|
+
- SNS domain registration fees are paid in **USDC** (not SOL). SOL is only for rent-exempt and gas. The wallet must have both USDC and SOL.
|
|
235
|
+
- For availability checks, use \`sap_sns_check_domain\` or \`sap_sns_batch_check_domains\`.
|
|
236
|
+
|
|
237
|
+
For transactions, preview first with \`sap_preview_transaction\`; sign only with \`sap_sign_transaction\` after policy checks and user approval when required.
|
|
238
|
+
|
|
239
|
+
`;
|
|
240
|
+
if (includeProfiles && allProfiles.length > 0) {
|
|
241
|
+
contextText += `### 📂 Available Profiles
|
|
242
|
+
| Profile | Active | Mode | Agent Pubkey |
|
|
243
|
+
|---------|--------|------|--------------|
|
|
244
|
+
`;
|
|
245
|
+
for (const profile of allProfiles) {
|
|
246
|
+
const activeMarker = profile.name === activeProfile ? '●' : '○';
|
|
247
|
+
contextText += `| ${activeMarker} ${profile.name} | ${profile.name === activeProfile ? 'Yes' : 'No'} | ${profile.mode || 'unknown'} | ${profile.agentPubkey || 'N/A'} |
|
|
248
|
+
`;
|
|
249
|
+
}
|
|
250
|
+
contextText += `
|
|
251
|
+
**Profile Commands:**
|
|
252
|
+
\`\`\`bash
|
|
253
|
+
# Switch profile
|
|
254
|
+
npx sap-mcp-config profile <name>
|
|
255
|
+
|
|
256
|
+
# Create new profile
|
|
257
|
+
npx sap-mcp-config create-profile <name>
|
|
258
|
+
|
|
259
|
+
# List all profiles
|
|
260
|
+
npx sap-mcp-config profiles
|
|
261
|
+
|
|
262
|
+
# Show current profile info
|
|
263
|
+
npx sap-mcp-config profile-info
|
|
264
|
+
\`\`\`
|
|
265
|
+
|
|
266
|
+
`;
|
|
267
|
+
}
|
|
268
|
+
contextText += `### 🚀 Quick Commands
|
|
269
|
+
\`\`\`bash
|
|
270
|
+
# Start server
|
|
271
|
+
npx sap-mcp-server
|
|
272
|
+
|
|
273
|
+
# Check config
|
|
274
|
+
npx sap-mcp-config info
|
|
275
|
+
|
|
276
|
+
# Check pubkey
|
|
277
|
+
npx sap-mcp-config pubkey
|
|
278
|
+
|
|
279
|
+
# Modify settings
|
|
280
|
+
npx sap-mcp-config set <field> <value>
|
|
281
|
+
\`\`\`
|
|
282
|
+
|
|
283
|
+
---
|
|
284
|
+
|
|
285
|
+
**Ready for SAP operations!** ✅
|
|
286
|
+
`;
|
|
287
|
+
return contextText;
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Builds error message for missing configuration.
|
|
291
|
+
*/
|
|
292
|
+
function buildMissingConfigMessage(activeProfile, configDir) {
|
|
293
|
+
return `⚠️ **SAP MCP Configuration Not Found**
|
|
294
|
+
|
|
295
|
+
The configuration for profile "${activeProfile}" does not exist.
|
|
296
|
+
|
|
297
|
+
**Quick Setup:**
|
|
298
|
+
\`\`\`bash
|
|
299
|
+
${WIZARD_NPM_COMMAND}
|
|
300
|
+
\`\`\`
|
|
301
|
+
|
|
302
|
+
**Hosted Wizard Endpoint:**
|
|
303
|
+
- Descriptor: ${WIZARD_DESCRIPTOR_URL}
|
|
304
|
+
- Install script: ${WIZARD_INSTALL_SCRIPT_URL}
|
|
305
|
+
- Hosted MCP URL: ${HOSTED_MCP_URL}
|
|
306
|
+
|
|
307
|
+
This will guide you through:
|
|
308
|
+
1. Choosing/creating a profile name (e.g., citizen-support-agent)
|
|
309
|
+
2. Selecting server mode (readonly, local-dev-keypair, etc.)
|
|
310
|
+
3. Configuring Solana RPC endpoint
|
|
311
|
+
4. Creating or linking a dedicated wallet without exposing keypair bytes to agents
|
|
312
|
+
5. Setting security limits
|
|
313
|
+
|
|
314
|
+
If this agent cannot access the user's OS config directory, tell the user to run the wizard locally. Do not ask for keypair bytes, do not inspect \`~/.config/solana/id.json\`, and do not invent a wallet path.
|
|
315
|
+
|
|
316
|
+
**Current Profile:** ${activeProfile}
|
|
317
|
+
**Config Directory:** ${configDir}
|
|
318
|
+
`;
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Builds error message for prompt failures.
|
|
322
|
+
*/
|
|
323
|
+
function buildErrorMessage(error) {
|
|
324
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
325
|
+
return `⚠️ **Error Loading SAP MCP Context**
|
|
326
|
+
|
|
327
|
+
${errorMessage}
|
|
328
|
+
|
|
329
|
+
**Troubleshooting:**
|
|
330
|
+
1. Check if configuration exists: \`npx sap-mcp-config info\`
|
|
331
|
+
2. Verify profile: \`npx sap-mcp-config profile-info\`
|
|
332
|
+
3. Re-run wizard if needed: \`${WIZARD_NPM_COMMAND}\`
|
|
333
|
+
4. If the agent cannot see local OS config, use \`${WIZARD_DESCRIPTOR_URL}\` or \`${WIZARD_INSTALL_SCRIPT_URL}\`
|
|
334
|
+
`;
|
|
335
|
+
}
|
|
336
|
+
//# sourceMappingURL=sap-agent-context.prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sap-agent-context.prompt.js","sourceRoot":"","sources":["../../../src/prompts/context/sap-agent-context.prompt.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Debug SAP Error Prompt
|
|
3
|
+
*
|
|
4
|
+
* Provides structured debugging workflow for SAP-related errors.
|
|
5
|
+
* NO STUBS — Real implementation with error analysis.
|
|
6
|
+
*/
|
|
7
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
8
|
+
import type { SapMcpContext } from '../../core/types.js';
|
|
9
|
+
/**
|
|
10
|
+
* Executes the debug sap error prompt operation.
|
|
11
|
+
*/
|
|
12
|
+
export declare function debugSapErrorPrompt(server: Server, _context: SapMcpContext): void;
|
|
13
|
+
//# sourceMappingURL=debug-sap-error.prompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug-sap-error.prompt.d.ts","sourceRoot":"","sources":["../../../src/prompts/developer/debug-sap-error.prompt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAGnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,QAmJ1E"}
|