@kya-os/mcp-i-runtime 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +4 -0
- package/dist/auth/handshake.d.ts +136 -0
- package/dist/auth/handshake.d.ts.map +1 -0
- package/dist/auth/handshake.js +276 -0
- package/dist/auth/handshake.js.map +1 -0
- package/dist/auth/index.d.ts +6 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +12 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/types.d.ts +52 -0
- package/dist/auth/types.d.ts.map +1 -0
- package/dist/auth/types.js +10 -0
- package/dist/auth/types.js.map +1 -0
- package/dist/cache/oauth-config-cache.d.ts +69 -0
- package/dist/cache/oauth-config-cache.d.ts.map +1 -0
- package/dist/cache/oauth-config-cache.js +76 -0
- package/dist/cache/oauth-config-cache.js.map +1 -0
- package/dist/cache/tool-protection-cache.d.ts +102 -0
- package/dist/cache/tool-protection-cache.d.ts.map +1 -0
- package/dist/cache/tool-protection-cache.js +131 -0
- package/dist/cache/tool-protection-cache.js.map +1 -0
- package/dist/compliance/index.d.ts +8 -0
- package/dist/compliance/index.d.ts.map +1 -0
- package/dist/compliance/index.js +24 -0
- package/dist/compliance/index.js.map +1 -0
- package/dist/compliance/schema-registry.d.ts +50 -0
- package/dist/compliance/schema-registry.d.ts.map +1 -0
- package/dist/compliance/schema-registry.js +438 -0
- package/dist/compliance/schema-registry.js.map +1 -0
- package/dist/compliance/schema-verifier.d.ts +110 -0
- package/dist/compliance/schema-verifier.d.ts.map +1 -0
- package/dist/compliance/schema-verifier.js +518 -0
- package/dist/compliance/schema-verifier.js.map +1 -0
- package/dist/config/remote-config.d.ts +188 -0
- package/dist/config/remote-config.d.ts.map +1 -0
- package/dist/config/remote-config.js +268 -0
- package/dist/config/remote-config.js.map +1 -0
- package/dist/config.d.ts +182 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +148 -0
- package/dist/config.js.map +1 -0
- package/dist/identity/idp-token-resolver.d.ts +69 -0
- package/dist/identity/idp-token-resolver.d.ts.map +1 -0
- package/dist/identity/idp-token-resolver.js +136 -0
- package/dist/identity/idp-token-resolver.js.map +1 -0
- package/dist/identity/idp-token-storage.interface.d.ts +80 -0
- package/dist/identity/idp-token-storage.interface.d.ts.map +1 -0
- package/dist/identity/idp-token-storage.interface.js +14 -0
- package/dist/identity/idp-token-storage.interface.js.map +1 -0
- package/dist/identity/user-did-manager.d.ts +228 -0
- package/dist/identity/user-did-manager.d.ts.map +1 -0
- package/dist/identity/user-did-manager.js +356 -0
- package/dist/identity/user-did-manager.js.map +1 -0
- package/dist/index.d.ts +69 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +193 -0
- package/dist/index.js.map +1 -0
- package/dist/logging/index.d.ts +5 -0
- package/dist/logging/index.d.ts.map +1 -0
- package/dist/logging/index.js +10 -0
- package/dist/logging/index.js.map +1 -0
- package/dist/logging/logger.d.ts +33 -0
- package/dist/logging/logger.d.ts.map +1 -0
- package/dist/logging/logger.js +104 -0
- package/dist/logging/logger.js.map +1 -0
- package/dist/proof/generator.d.ts +109 -0
- package/dist/proof/generator.d.ts.map +1 -0
- package/dist/proof/generator.js +236 -0
- package/dist/proof/generator.js.map +1 -0
- package/dist/proof/index.d.ts +5 -0
- package/dist/proof/index.d.ts.map +1 -0
- package/dist/proof/index.js +11 -0
- package/dist/proof/index.js.map +1 -0
- package/dist/providers/base.d.ts +95 -0
- package/dist/providers/base.d.ts.map +1 -0
- package/dist/providers/base.js +47 -0
- package/dist/providers/base.js.map +1 -0
- package/dist/providers/memory.d.ts +42 -0
- package/dist/providers/memory.d.ts.map +1 -0
- package/dist/providers/memory.js +121 -0
- package/dist/providers/memory.js.map +1 -0
- package/dist/runtime/audit-logger.d.ts +37 -0
- package/dist/runtime/audit-logger.d.ts.map +1 -0
- package/dist/runtime/audit-logger.js +9 -0
- package/dist/runtime/audit-logger.js.map +1 -0
- package/dist/runtime/base.d.ts +392 -0
- package/dist/runtime/base.d.ts.map +1 -0
- package/dist/runtime/base.js +1527 -0
- package/dist/runtime/base.js.map +1 -0
- package/dist/runtime/dif-core.d.ts +33 -0
- package/dist/runtime/dif-core.d.ts.map +1 -0
- package/dist/runtime/dif-core.js +14 -0
- package/dist/runtime/dif-core.js.map +1 -0
- package/dist/runtime/ext-apps-constants.d.ts +20 -0
- package/dist/runtime/ext-apps-constants.d.ts.map +1 -0
- package/dist/runtime/ext-apps-constants.js +23 -0
- package/dist/runtime/ext-apps-constants.js.map +1 -0
- package/dist/services/access-control.service.d.ts +138 -0
- package/dist/services/access-control.service.d.ts.map +1 -0
- package/dist/services/access-control.service.js +721 -0
- package/dist/services/access-control.service.js.map +1 -0
- package/dist/services/authorization/authorization-registry.d.ts +29 -0
- package/dist/services/authorization/authorization-registry.d.ts.map +1 -0
- package/dist/services/authorization/authorization-registry.js +58 -0
- package/dist/services/authorization/authorization-registry.js.map +1 -0
- package/dist/services/authorization/types.d.ts +53 -0
- package/dist/services/authorization/types.d.ts.map +1 -0
- package/dist/services/authorization/types.js +10 -0
- package/dist/services/authorization/types.js.map +1 -0
- package/dist/services/batch-delegation.service.d.ts +53 -0
- package/dist/services/batch-delegation.service.d.ts.map +1 -0
- package/dist/services/batch-delegation.service.js +95 -0
- package/dist/services/batch-delegation.service.js.map +1 -0
- package/dist/services/crypto.service.d.ts +69 -0
- package/dist/services/crypto.service.d.ts.map +1 -0
- package/dist/services/crypto.service.js +225 -0
- package/dist/services/crypto.service.js.map +1 -0
- package/dist/services/delegation-error-formatter.d.ts +124 -0
- package/dist/services/delegation-error-formatter.d.ts.map +1 -0
- package/dist/services/delegation-error-formatter.js +214 -0
- package/dist/services/delegation-error-formatter.js.map +1 -0
- package/dist/services/errors.d.ts +49 -0
- package/dist/services/errors.d.ts.map +1 -0
- package/dist/services/errors.js +66 -0
- package/dist/services/errors.js.map +1 -0
- package/dist/services/index.d.ts +9 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +15 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/oauth-config.service.d.ts +53 -0
- package/dist/services/oauth-config.service.d.ts.map +1 -0
- package/dist/services/oauth-config.service.js +141 -0
- package/dist/services/oauth-config.service.js.map +1 -0
- package/dist/services/oauth-provider-registry.d.ts +88 -0
- package/dist/services/oauth-provider-registry.d.ts.map +1 -0
- package/dist/services/oauth-provider-registry.js +128 -0
- package/dist/services/oauth-provider-registry.js.map +1 -0
- package/dist/services/oauth-service.d.ts +122 -0
- package/dist/services/oauth-service.d.ts.map +1 -0
- package/dist/services/oauth-service.js +442 -0
- package/dist/services/oauth-service.js.map +1 -0
- package/dist/services/oauth-token-retrieval.service.d.ts +49 -0
- package/dist/services/oauth-token-retrieval.service.d.ts.map +1 -0
- package/dist/services/oauth-token-retrieval.service.js +150 -0
- package/dist/services/oauth-token-retrieval.service.js.map +1 -0
- package/dist/services/policy.service.d.ts +130 -0
- package/dist/services/policy.service.d.ts.map +1 -0
- package/dist/services/policy.service.js +399 -0
- package/dist/services/policy.service.js.map +1 -0
- package/dist/services/proof-verifier.d.ts +103 -0
- package/dist/services/proof-verifier.d.ts.map +1 -0
- package/dist/services/proof-verifier.js +190 -0
- package/dist/services/proof-verifier.js.map +1 -0
- package/dist/services/provider-resolver.d.ts +89 -0
- package/dist/services/provider-resolver.d.ts.map +1 -0
- package/dist/services/provider-resolver.js +196 -0
- package/dist/services/provider-resolver.js.map +1 -0
- package/dist/services/provider-validator.d.ts +55 -0
- package/dist/services/provider-validator.d.ts.map +1 -0
- package/dist/services/provider-validator.js +135 -0
- package/dist/services/provider-validator.js.map +1 -0
- package/dist/services/session-registration.service.d.ts +80 -0
- package/dist/services/session-registration.service.d.ts.map +1 -0
- package/dist/services/session-registration.service.js +174 -0
- package/dist/services/session-registration.service.js.map +1 -0
- package/dist/services/storage.service.d.ts +116 -0
- package/dist/services/storage.service.d.ts.map +1 -0
- package/dist/services/storage.service.js +411 -0
- package/dist/services/storage.service.js.map +1 -0
- package/dist/services/tool-context-builder.d.ts +74 -0
- package/dist/services/tool-context-builder.d.ts.map +1 -0
- package/dist/services/tool-context-builder.js +215 -0
- package/dist/services/tool-context-builder.js.map +1 -0
- package/dist/services/tool-protection.service.d.ts +209 -0
- package/dist/services/tool-protection.service.d.ts.map +1 -0
- package/dist/services/tool-protection.service.js +752 -0
- package/dist/services/tool-protection.service.js.map +1 -0
- package/dist/session/index.d.ts +5 -0
- package/dist/session/index.d.ts.map +1 -0
- package/dist/session/index.js +11 -0
- package/dist/session/index.js.map +1 -0
- package/dist/session/manager.d.ts +118 -0
- package/dist/session/manager.d.ts.map +1 -0
- package/dist/session/manager.js +285 -0
- package/dist/session/manager.js.map +1 -0
- package/dist/types/oauth-required-error.d.ts +46 -0
- package/dist/types/oauth-required-error.d.ts.map +1 -0
- package/dist/types/oauth-required-error.js +42 -0
- package/dist/types/oauth-required-error.js.map +1 -0
- package/dist/types/tool-protection.d.ts +144 -0
- package/dist/types/tool-protection.d.ts.map +1 -0
- package/dist/types/tool-protection.js +48 -0
- package/dist/types/tool-protection.js.map +1 -0
- package/dist/utils/base58.d.ts +31 -0
- package/dist/utils/base58.d.ts.map +1 -0
- package/dist/utils/base58.js +103 -0
- package/dist/utils/base58.js.map +1 -0
- package/dist/utils/base64.d.ts +32 -0
- package/dist/utils/base64.d.ts.map +1 -0
- package/dist/utils/base64.js +172 -0
- package/dist/utils/base64.js.map +1 -0
- package/dist/utils/cors.d.ts +52 -0
- package/dist/utils/cors.d.ts.map +1 -0
- package/dist/utils/cors.js +79 -0
- package/dist/utils/cors.js.map +1 -0
- package/dist/utils/did-helpers.d.ts +168 -0
- package/dist/utils/did-helpers.d.ts.map +1 -0
- package/dist/utils/did-helpers.js +222 -0
- package/dist/utils/did-helpers.js.map +1 -0
- package/dist/utils/index.d.ts +8 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +24 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/storage-keys.d.ts +120 -0
- package/dist/utils/storage-keys.d.ts.map +1 -0
- package/dist/utils/storage-keys.js +217 -0
- package/dist/utils/storage-keys.js.map +1 -0
- package/dist/wire-format.d.ts +62 -0
- package/dist/wire-format.d.ts.map +1 -0
- package/dist/wire-format.js +89 -0
- package/dist/wire-format.js.map +1 -0
- package/package.json +83 -0
- package/src/__tests__/cache/tool-protection-cache.test.ts +640 -0
- package/src/__tests__/config/provider-runtime-config.test.ts +309 -0
- package/src/__tests__/config.test.ts +307 -0
- package/src/__tests__/identity/user-did-manager.test.ts +232 -0
- package/src/__tests__/index.test.ts +56 -0
- package/src/__tests__/integration/full-flow.test.ts +779 -0
- package/src/__tests__/integration.test.ts +281 -0
- package/src/__tests__/providers/base.test.ts +173 -0
- package/src/__tests__/providers/memory.test.ts +319 -0
- package/src/__tests__/regression/phase2-regression.test.ts +406 -0
- package/src/__tests__/runtime/audit-logger.test.ts +154 -0
- package/src/__tests__/runtime/base-extensions.test.ts +595 -0
- package/src/__tests__/runtime/base.test.ts +1328 -0
- package/src/__tests__/runtime/delegation-flow.test.ts +159 -0
- package/src/__tests__/runtime/process-tool-call-security.test.ts +1024 -0
- package/src/__tests__/runtime/proof-client-did.test.ts +376 -0
- package/src/__tests__/runtime/provider-selection.test.ts +292 -0
- package/src/__tests__/runtime/route-interception.test.ts +670 -0
- package/src/__tests__/runtime/tool-protection-enforcement.test.ts +989 -0
- package/src/__tests__/services/access-control-retry.test.ts +595 -0
- package/src/__tests__/services/agentshield-integration.test.ts +709 -0
- package/src/__tests__/services/cache-busting.test.ts +125 -0
- package/src/__tests__/services/oauth-service-errors.test.ts +704 -0
- package/src/__tests__/services/oauth-service-pkce.test.ts +556 -0
- package/src/__tests__/services/oauth-service-secret-resolution.test.ts +349 -0
- package/src/__tests__/services/provider-resolver-edge-cases.test.ts +591 -0
- package/src/__tests__/services/tool-protection-failsafe.test.ts +683 -0
- package/src/__tests__/services/tool-protection-merged-config.test.ts +664 -0
- package/src/__tests__/services/tool-protection-oauth-provider.test.ts +300 -0
- package/src/__tests__/services/tool-protection.service.test.ts +1201 -0
- package/src/__tests__/utils/mock-providers.ts +340 -0
- package/src/__tests__/wire-format.test.ts +123 -0
- package/src/auth/__tests__/resume-token.test.ts +42 -0
- package/src/auth/handshake.ts +476 -0
- package/src/auth/index.ts +15 -0
- package/src/auth/types.ts +68 -0
- package/src/cache/__tests__/oauth-config-cache.test.ts +215 -0
- package/src/cache/oauth-config-cache.d.ts +69 -0
- package/src/cache/oauth-config-cache.d.ts.map +1 -0
- package/src/cache/oauth-config-cache.js.map +1 -0
- package/src/cache/oauth-config-cache.ts +123 -0
- package/src/cache/tool-protection-cache.ts +184 -0
- package/src/compliance/EXAMPLE.md +412 -0
- package/src/compliance/__tests__/schema-verifier.test.ts +791 -0
- package/src/compliance/index.ts +8 -0
- package/src/compliance/schema-registry.ts +460 -0
- package/src/compliance/schema-verifier.ts +708 -0
- package/src/config/__tests__/merged-config.spec.ts +445 -0
- package/src/config/__tests__/remote-config-edge-cases.test.ts +424 -0
- package/src/config/__tests__/remote-config-helpers.test.ts +280 -0
- package/src/config/__tests__/remote-config.spec.ts +265 -0
- package/src/config/remote-config.ts +368 -0
- package/src/config.ts +312 -0
- package/src/identity/__tests__/idp-token-resolver.test.ts +340 -0
- package/src/identity/__tests__/user-did-manager.test.ts +487 -0
- package/src/identity/idp-token-resolver.ts +181 -0
- package/src/identity/idp-token-storage.interface.ts +102 -0
- package/src/identity/user-did-manager.ts +592 -0
- package/src/index.ts +331 -0
- package/src/logging/__tests__/logger.test.ts +366 -0
- package/src/logging/index.ts +10 -0
- package/src/logging/logger.ts +112 -0
- package/src/proof/__tests__/crypto-parity.test.ts +202 -0
- package/src/proof/__tests__/proof-generator.test.ts +484 -0
- package/src/proof/generator.ts +347 -0
- package/src/proof/index.ts +12 -0
- package/src/providers/base.d.ts +91 -0
- package/src/providers/base.d.ts.map +1 -0
- package/src/providers/base.js.map +1 -0
- package/src/providers/base.ts +100 -0
- package/src/providers/memory.ts +142 -0
- package/src/runtime/__tests__/dif-esm-bridge.test.ts +33 -0
- package/src/runtime/__tests__/ext-apps-consent.test.ts +334 -0
- package/src/runtime/audit-logger.ts +39 -0
- package/src/runtime/base.ts +2100 -0
- package/src/runtime/dif-core.ts +39 -0
- package/src/runtime/ext-apps-constants.ts +20 -0
- package/src/services/__tests__/access-control.integration.test.ts +441 -0
- package/src/services/__tests__/access-control.proof-response-validation.test.ts +578 -0
- package/src/services/__tests__/access-control.service.test.ts +1132 -0
- package/src/services/__tests__/batch-delegation.service.test.ts +351 -0
- package/src/services/__tests__/crypto.service.test.ts +531 -0
- package/src/services/__tests__/delegation-error-formatter.test.ts +643 -0
- package/src/services/__tests__/oauth-config.service.test.ts +359 -0
- package/src/services/__tests__/oauth-provider-registry.test.ts +142 -0
- package/src/services/__tests__/oauth-token-retrieval.service.test.ts +365 -0
- package/src/services/__tests__/proof-verifier.integration.test.ts +494 -0
- package/src/services/__tests__/proof-verifier.test.ts +489 -0
- package/src/services/__tests__/provider-resolution.integration.test.ts +202 -0
- package/src/services/__tests__/provider-resolver.test.ts +213 -0
- package/src/services/__tests__/provider-validator.test.ts +370 -0
- package/src/services/__tests__/session-registration.service.test.ts +312 -0
- package/src/services/__tests__/storage.service.test.ts +358 -0
- package/src/services/__tests__/tool-context-builder.test.ts +438 -0
- package/src/services/access-control.service.ts +1048 -0
- package/src/services/authorization/authorization-registry.ts +67 -0
- package/src/services/authorization/types.ts +71 -0
- package/src/services/batch-delegation.service.ts +136 -0
- package/src/services/crypto.service.ts +296 -0
- package/src/services/delegation-error-formatter.ts +299 -0
- package/src/services/errors.ts +76 -0
- package/src/services/index.ts +34 -0
- package/src/services/oauth-config.service.d.ts +53 -0
- package/src/services/oauth-config.service.d.ts.map +1 -0
- package/src/services/oauth-config.service.js.map +1 -0
- package/src/services/oauth-config.service.ts +192 -0
- package/src/services/oauth-provider-registry.d.ts +57 -0
- package/src/services/oauth-provider-registry.d.ts.map +1 -0
- package/src/services/oauth-provider-registry.js.map +1 -0
- package/src/services/oauth-provider-registry.ts +141 -0
- package/src/services/oauth-service.ts +652 -0
- package/src/services/oauth-token-retrieval.service.ts +245 -0
- package/src/services/policy.service.ts +527 -0
- package/src/services/proof-verifier.ts +295 -0
- package/src/services/provider-resolver.d.ts +48 -0
- package/src/services/provider-resolver.d.ts.map +1 -0
- package/src/services/provider-resolver.js.map +1 -0
- package/src/services/provider-resolver.ts +236 -0
- package/src/services/provider-validator.ts +170 -0
- package/src/services/session-registration.service.ts +259 -0
- package/src/services/storage.service.ts +566 -0
- package/src/services/tool-context-builder.ts +285 -0
- package/src/services/tool-protection.service.ts +971 -0
- package/src/session/__tests__/session-manager.test.ts +327 -0
- package/src/session/index.ts +10 -0
- package/src/session/manager.ts +380 -0
- package/src/types/__tests__/oauth-required-error.test.ts +79 -0
- package/src/types/__tests__/tool-protection.test.ts +121 -0
- package/src/types/oauth-required-error.ts +71 -0
- package/src/types/tool-protection.ts +179 -0
- package/src/utils/__tests__/base58.test.ts +281 -0
- package/src/utils/__tests__/base64.test.ts +239 -0
- package/src/utils/__tests__/cors.test.ts +184 -0
- package/src/utils/__tests__/did-helpers.test.ts +156 -0
- package/src/utils/__tests__/storage-keys.test.ts +372 -0
- package/src/utils/base58.ts +109 -0
- package/src/utils/base64.ts +185 -0
- package/src/utils/cors.ts +93 -0
- package/src/utils/did-helpers.ts +229 -0
- package/src/utils/index.ts +8 -0
- package/src/utils/storage-keys.ts +285 -0
- package/src/wire-format.ts +114 -0
- package/tsconfig.json +21 -0
- package/vitest.config.mts +57 -0
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Remote Configuration Fetching
|
|
3
|
+
*
|
|
4
|
+
* Service for fetching configuration from remote APIs (AgentShield dashboard)
|
|
5
|
+
* with caching support for performance optimization.
|
|
6
|
+
*
|
|
7
|
+
* C2 (#2916) classification: **product-layer, no DIF equivalent.** These are
|
|
8
|
+
* config-fetch + extraction/shaping helpers (`fetchRemoteConfig` plus the
|
|
9
|
+
* `getToolProtection` / `extractToolProtections` / `getPolicy` / `extractPolicy` /
|
|
10
|
+
* `isPolicyEnabled` accessors): they retrieve the remote dashboard config and
|
|
11
|
+
* reshape it for consumers. They perform no policy evaluation — the allow/deny
|
|
12
|
+
* decision lives in the runtime tool-call path, not here. The DIF `@kya-os/mcp`
|
|
13
|
+
* core owns no remote-config / dashboard-fetch equivalent, so there is nothing to
|
|
14
|
+
* compose from DIF here. Like CORS and the `.well-known` manifests, this module is
|
|
15
|
+
* therefore NOT re-homed onto a DIF primitive; it stays product-side through the
|
|
16
|
+
* decommission. Its cache hit/miss, response-shape compatibility, projectId
|
|
17
|
+
* requirement, and extraction behavior are frozen by
|
|
18
|
+
* `config/__tests__/remote-config.spec.ts`. Relocating it out of
|
|
19
|
+
* `@kya-os/mcp-i-core` into a surviving package is a C3 (#2917, consumer repoint)
|
|
20
|
+
* concern; the breaking wire/DB renames are C4 (#2918).
|
|
21
|
+
*
|
|
22
|
+
* @module @kya-os/mcp-i-core/config/remote-config
|
|
23
|
+
*/
|
|
24
|
+
import type { MCPIConfig } from '@kya-os/contracts/config';
|
|
25
|
+
import type { ToolProtection, ToolProtectionMap } from '@kya-os/contracts/tool-protection';
|
|
26
|
+
import type { PolicyConfig } from '@kya-os/contracts';
|
|
27
|
+
/**
|
|
28
|
+
* Options for fetching remote configuration
|
|
29
|
+
*/
|
|
30
|
+
export interface RemoteConfigOptions {
|
|
31
|
+
/**
|
|
32
|
+
* API base URL
|
|
33
|
+
* @example 'https://kya.vouched.id'
|
|
34
|
+
*/
|
|
35
|
+
apiUrl: string;
|
|
36
|
+
/**
|
|
37
|
+
* API key for authentication
|
|
38
|
+
*/
|
|
39
|
+
apiKey: string;
|
|
40
|
+
/**
|
|
41
|
+
* Project ID (optional, preferred over agentDid)
|
|
42
|
+
* Used for project-scoped configuration
|
|
43
|
+
*/
|
|
44
|
+
projectId?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Agent DID (optional, used when projectId not available)
|
|
47
|
+
* Used for agent-scoped configuration
|
|
48
|
+
*/
|
|
49
|
+
agentDid?: string;
|
|
50
|
+
/**
|
|
51
|
+
* Cache TTL in milliseconds
|
|
52
|
+
* @default 300000 (5 minutes)
|
|
53
|
+
*/
|
|
54
|
+
cacheTtl?: number;
|
|
55
|
+
/**
|
|
56
|
+
* Fetch provider function
|
|
57
|
+
* Platform-agnostic fetch implementation
|
|
58
|
+
*/
|
|
59
|
+
fetchProvider: (url: string, options: RequestInit) => Promise<Response>;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Cache interface for remote configuration
|
|
63
|
+
* Abstracts platform-specific caching (KV, Redis, Memory, etc.)
|
|
64
|
+
*/
|
|
65
|
+
export interface RemoteConfigCache {
|
|
66
|
+
/**
|
|
67
|
+
* Get a cached value
|
|
68
|
+
*/
|
|
69
|
+
get(key: string): Promise<string | null>;
|
|
70
|
+
/**
|
|
71
|
+
* Set a cached value with TTL
|
|
72
|
+
*/
|
|
73
|
+
set(key: string, value: string, ttl: number): Promise<void>;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Fetch configuration from remote API (AgentShield dashboard)
|
|
77
|
+
*
|
|
78
|
+
* Attempts to fetch configuration from the AgentShield API with caching support.
|
|
79
|
+
* Falls back gracefully if remote fetch fails.
|
|
80
|
+
*
|
|
81
|
+
* @param options - Remote config options
|
|
82
|
+
* @param cache - Optional cache implementation
|
|
83
|
+
* @returns Configuration object or null if fetch fails
|
|
84
|
+
*/
|
|
85
|
+
export declare function fetchRemoteConfig(options: RemoteConfigOptions, cache?: RemoteConfigCache): Promise<MCPIConfig | null>;
|
|
86
|
+
/**
|
|
87
|
+
* Get tool protection for a specific tool from a merged config
|
|
88
|
+
*
|
|
89
|
+
* This helper function extracts tool protection from a merged config response.
|
|
90
|
+
* It handles both the new format (toolProtection.tools) and returns null
|
|
91
|
+
* for unprotected or unknown tools.
|
|
92
|
+
*
|
|
93
|
+
* @param config - Merged config object (must have toolProtection.tools)
|
|
94
|
+
* @param toolName - Name of the tool to look up
|
|
95
|
+
* @returns Tool protection or null if tool not protected or not found
|
|
96
|
+
*
|
|
97
|
+
* @since 1.6.0
|
|
98
|
+
*/
|
|
99
|
+
export declare function getToolProtection(config: {
|
|
100
|
+
toolProtection?: {
|
|
101
|
+
tools?: ToolProtectionMap;
|
|
102
|
+
};
|
|
103
|
+
}, toolName: string): ToolProtection | null;
|
|
104
|
+
/**
|
|
105
|
+
* Extract tool protections map from merged config
|
|
106
|
+
*
|
|
107
|
+
* This helper function extracts the tool protections map from a merged config.
|
|
108
|
+
* Returns an empty object if no tools are found.
|
|
109
|
+
*
|
|
110
|
+
* @param config - Config object that may contain toolProtection.tools
|
|
111
|
+
* @returns Tool protection map or empty object
|
|
112
|
+
*
|
|
113
|
+
* @since 1.6.0
|
|
114
|
+
*/
|
|
115
|
+
export declare function extractToolProtections(config: {
|
|
116
|
+
toolProtection?: {
|
|
117
|
+
tools?: ToolProtectionMap;
|
|
118
|
+
};
|
|
119
|
+
} | null | undefined): ToolProtectionMap;
|
|
120
|
+
/**
|
|
121
|
+
* Check if config has embedded tool protections
|
|
122
|
+
*
|
|
123
|
+
* Utility to check if a config response is in the new merged format
|
|
124
|
+
* with embedded tool protections.
|
|
125
|
+
*
|
|
126
|
+
* @param config - Config object to check
|
|
127
|
+
* @returns True if config has embedded tools, false otherwise
|
|
128
|
+
*
|
|
129
|
+
* @since 1.6.0
|
|
130
|
+
*/
|
|
131
|
+
export declare function hasMergedToolProtections(config: unknown): config is {
|
|
132
|
+
toolProtection: {
|
|
133
|
+
tools: ToolProtectionMap;
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
/**
|
|
137
|
+
* Get policy configuration from a merged config
|
|
138
|
+
*
|
|
139
|
+
* This helper function extracts policy configuration from a merged config response.
|
|
140
|
+
* Returns null if no policy is present in the config.
|
|
141
|
+
*
|
|
142
|
+
* @param config - Config object that may contain policy
|
|
143
|
+
* @returns Policy configuration or null if not present
|
|
144
|
+
*
|
|
145
|
+
* @since 1.7.0
|
|
146
|
+
*/
|
|
147
|
+
export declare function getPolicy(config: {
|
|
148
|
+
policy?: PolicyConfig;
|
|
149
|
+
} | null | undefined): PolicyConfig | null;
|
|
150
|
+
/**
|
|
151
|
+
* Extract policy configuration from merged config with defaults
|
|
152
|
+
*
|
|
153
|
+
* This helper function extracts the policy from a merged config.
|
|
154
|
+
* Returns the default policy config if no policy is found.
|
|
155
|
+
*
|
|
156
|
+
* @param config - Config object that may contain policy
|
|
157
|
+
* @returns Policy configuration (never null, returns defaults if missing)
|
|
158
|
+
*
|
|
159
|
+
* @since 1.7.0
|
|
160
|
+
*/
|
|
161
|
+
export declare function extractPolicy(config: {
|
|
162
|
+
policy?: PolicyConfig;
|
|
163
|
+
} | null | undefined): PolicyConfig;
|
|
164
|
+
/**
|
|
165
|
+
* Check if config has embedded policy configuration
|
|
166
|
+
*
|
|
167
|
+
* Utility to check if a config response includes policy configuration.
|
|
168
|
+
*
|
|
169
|
+
* @param config - Config object to check
|
|
170
|
+
* @returns True if config has policy, false otherwise
|
|
171
|
+
*
|
|
172
|
+
* @since 1.7.0
|
|
173
|
+
*/
|
|
174
|
+
export declare function hasMergedPolicy(config: unknown): config is {
|
|
175
|
+
policy: PolicyConfig;
|
|
176
|
+
};
|
|
177
|
+
/**
|
|
178
|
+
* Check if policy enforcement is enabled for a config
|
|
179
|
+
*
|
|
180
|
+
* @param config - Config object that may contain policy
|
|
181
|
+
* @returns True if policy is present and enabled
|
|
182
|
+
*
|
|
183
|
+
* @since 1.7.0
|
|
184
|
+
*/
|
|
185
|
+
export declare function isPolicyEnabled(config: {
|
|
186
|
+
policy?: PolicyConfig;
|
|
187
|
+
} | null | undefined): boolean;
|
|
188
|
+
//# sourceMappingURL=remote-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote-config.d.ts","sourceRoot":"","sources":["../../src/config/remote-config.ts"],"names":[],"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,cAAc,GAAG,IAAI,CAqBvB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE;IAAE,cAAc,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,iBAAiB,CAAA;KAAE,CAAA;CAAE,GAAG,IAAI,GAAG,SAAS,GAC5E,iBAAiB,CAKnB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,OAAO,GACd,MAAM,IAAI;IAAE,cAAc,EAAE;QAAE,KAAK,EAAE,iBAAiB,CAAA;KAAE,CAAA;CAAE,CAc5D;AAMD;;;;;;;;;;GAUG;AACH,wBAAgB,SAAS,CACvB,MAAM,EAAE;IAAE,MAAM,CAAC,EAAE,YAAY,CAAA;CAAE,GAAG,IAAI,GAAG,SAAS,GACnD,YAAY,GAAG,IAAI,CAKrB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE;IAAE,MAAM,CAAC,EAAE,YAAY,CAAA;CAAE,GAAG,IAAI,GAAG,SAAS,GACnD,YAAY,CAMd;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,OAAO,GACd,MAAM,IAAI;IAAE,MAAM,EAAE,YAAY,CAAA;CAAE,CAWpC;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE;IAAE,MAAM,CAAC,EAAE,YAAY,CAAA;CAAE,GAAG,IAAI,GAAG,SAAS,GACnD,OAAO,CAIT"}
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Remote Configuration Fetching
|
|
4
|
+
*
|
|
5
|
+
* Service for fetching configuration from remote APIs (AgentShield dashboard)
|
|
6
|
+
* with caching support for performance optimization.
|
|
7
|
+
*
|
|
8
|
+
* C2 (#2916) classification: **product-layer, no DIF equivalent.** These are
|
|
9
|
+
* config-fetch + extraction/shaping helpers (`fetchRemoteConfig` plus the
|
|
10
|
+
* `getToolProtection` / `extractToolProtections` / `getPolicy` / `extractPolicy` /
|
|
11
|
+
* `isPolicyEnabled` accessors): they retrieve the remote dashboard config and
|
|
12
|
+
* reshape it for consumers. They perform no policy evaluation — the allow/deny
|
|
13
|
+
* decision lives in the runtime tool-call path, not here. The DIF `@kya-os/mcp`
|
|
14
|
+
* core owns no remote-config / dashboard-fetch equivalent, so there is nothing to
|
|
15
|
+
* compose from DIF here. Like CORS and the `.well-known` manifests, this module is
|
|
16
|
+
* therefore NOT re-homed onto a DIF primitive; it stays product-side through the
|
|
17
|
+
* decommission. Its cache hit/miss, response-shape compatibility, projectId
|
|
18
|
+
* requirement, and extraction behavior are frozen by
|
|
19
|
+
* `config/__tests__/remote-config.spec.ts`. Relocating it out of
|
|
20
|
+
* `@kya-os/mcp-i-core` into a surviving package is a C3 (#2917, consumer repoint)
|
|
21
|
+
* concern; the breaking wire/DB renames are C4 (#2918).
|
|
22
|
+
*
|
|
23
|
+
* @module @kya-os/mcp-i-core/config/remote-config
|
|
24
|
+
*/
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.fetchRemoteConfig = fetchRemoteConfig;
|
|
27
|
+
exports.getToolProtection = getToolProtection;
|
|
28
|
+
exports.extractToolProtections = extractToolProtections;
|
|
29
|
+
exports.hasMergedToolProtections = hasMergedToolProtections;
|
|
30
|
+
exports.getPolicy = getPolicy;
|
|
31
|
+
exports.extractPolicy = extractPolicy;
|
|
32
|
+
exports.hasMergedPolicy = hasMergedPolicy;
|
|
33
|
+
exports.isPolicyEnabled = isPolicyEnabled;
|
|
34
|
+
const agentshield_api_1 = require("@kya-os/contracts/agentshield-api");
|
|
35
|
+
const contracts_1 = require("@kya-os/contracts");
|
|
36
|
+
/**
|
|
37
|
+
* Fetch configuration from remote API (AgentShield dashboard)
|
|
38
|
+
*
|
|
39
|
+
* Attempts to fetch configuration from the AgentShield API with caching support.
|
|
40
|
+
* Falls back gracefully if remote fetch fails.
|
|
41
|
+
*
|
|
42
|
+
* @param options - Remote config options
|
|
43
|
+
* @param cache - Optional cache implementation
|
|
44
|
+
* @returns Configuration object or null if fetch fails
|
|
45
|
+
*/
|
|
46
|
+
async function fetchRemoteConfig(options, cache) {
|
|
47
|
+
const { apiUrl, apiKey, projectId, agentDid, cacheTtl = 300000, fetchProvider } = options;
|
|
48
|
+
// Generate cache key
|
|
49
|
+
const cacheKey = projectId
|
|
50
|
+
? `config:project:${projectId}`
|
|
51
|
+
: agentDid
|
|
52
|
+
? `config:agent:${agentDid}`
|
|
53
|
+
: null;
|
|
54
|
+
// Try cache first
|
|
55
|
+
if (cache && cacheKey) {
|
|
56
|
+
try {
|
|
57
|
+
const cached = await cache.get(cacheKey);
|
|
58
|
+
if (cached) {
|
|
59
|
+
try {
|
|
60
|
+
const parsed = JSON.parse(cached);
|
|
61
|
+
if (parsed.expiresAt > Date.now()) {
|
|
62
|
+
return parsed.config;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
// Invalid cache entry, continue to fetch
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
// Cache read failed, continue to fetch
|
|
72
|
+
console.warn('[RemoteConfig] Cache read failed:', error);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
// Fetch from API
|
|
76
|
+
try {
|
|
77
|
+
// ❌ REMOVED: Legacy agent-scoped endpoint fallback
|
|
78
|
+
// Agent-only scoping causes cross-user delegation leakage (Priority 3 fallback issue)
|
|
79
|
+
// projectId is now REQUIRED for proper user isolation
|
|
80
|
+
if (!projectId) {
|
|
81
|
+
console.error('[RemoteConfig] projectId is required for user-scoped delegation. ' +
|
|
82
|
+
'Agent-only scoping has been deprecated due to security concerns (cross-user delegation leakage). ' +
|
|
83
|
+
'Please configure AGENTSHIELD_PROJECT_ID environment variable.');
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
// ✅ PROJECT-SCOPED ENDPOINT: Ensures delegations are properly scoped to user+agent
|
|
87
|
+
const url = `${apiUrl}${agentshield_api_1.AGENTSHIELD_ENDPOINTS.CONFIG(projectId)}`;
|
|
88
|
+
const response = await fetchProvider(url, {
|
|
89
|
+
headers: {
|
|
90
|
+
'Authorization': `Bearer ${apiKey}`,
|
|
91
|
+
'Content-Type': 'application/json'
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
if (!response.ok) {
|
|
95
|
+
console.warn(`[RemoteConfig] API returned ${response.status}: ${response.statusText}`);
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
const data = await response.json();
|
|
99
|
+
// Extract config from API response
|
|
100
|
+
// API response format: { success: boolean, data: { config: MCPIConfig } }
|
|
101
|
+
const responseData = data;
|
|
102
|
+
const config = responseData.config || responseData.data?.config || (responseData.success ? responseData.data : null);
|
|
103
|
+
if (!config) {
|
|
104
|
+
console.warn('[RemoteConfig] No config found in API response');
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
// Cache the result
|
|
108
|
+
if (cache && cacheKey) {
|
|
109
|
+
try {
|
|
110
|
+
await cache.set(cacheKey, JSON.stringify({
|
|
111
|
+
config,
|
|
112
|
+
expiresAt: Date.now() + cacheTtl
|
|
113
|
+
}), cacheTtl);
|
|
114
|
+
}
|
|
115
|
+
catch (error) {
|
|
116
|
+
// Cache write failed, but we got the config so continue
|
|
117
|
+
console.warn('[RemoteConfig] Cache write failed:', error);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return config;
|
|
121
|
+
}
|
|
122
|
+
catch (error) {
|
|
123
|
+
console.warn('[RemoteConfig] Failed to fetch config:', error);
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Get tool protection for a specific tool from a merged config
|
|
129
|
+
*
|
|
130
|
+
* This helper function extracts tool protection from a merged config response.
|
|
131
|
+
* It handles both the new format (toolProtection.tools) and returns null
|
|
132
|
+
* for unprotected or unknown tools.
|
|
133
|
+
*
|
|
134
|
+
* @param config - Merged config object (must have toolProtection.tools)
|
|
135
|
+
* @param toolName - Name of the tool to look up
|
|
136
|
+
* @returns Tool protection or null if tool not protected or not found
|
|
137
|
+
*
|
|
138
|
+
* @since 1.6.0
|
|
139
|
+
*/
|
|
140
|
+
function getToolProtection(config, toolName) {
|
|
141
|
+
const tools = config?.toolProtection?.tools;
|
|
142
|
+
if (!tools) {
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
145
|
+
// Check for specific tool protection first
|
|
146
|
+
let protection = tools[toolName];
|
|
147
|
+
// Fall back to wildcard protection if specific tool not found
|
|
148
|
+
if (!protection && tools['*']) {
|
|
149
|
+
protection = tools['*'];
|
|
150
|
+
}
|
|
151
|
+
// Return null for unprotected tools (requiresDelegation: false) or unknown tools
|
|
152
|
+
if (!protection || !protection.requiresDelegation) {
|
|
153
|
+
return null;
|
|
154
|
+
}
|
|
155
|
+
return protection;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Extract tool protections map from merged config
|
|
159
|
+
*
|
|
160
|
+
* This helper function extracts the tool protections map from a merged config.
|
|
161
|
+
* Returns an empty object if no tools are found.
|
|
162
|
+
*
|
|
163
|
+
* @param config - Config object that may contain toolProtection.tools
|
|
164
|
+
* @returns Tool protection map or empty object
|
|
165
|
+
*
|
|
166
|
+
* @since 1.6.0
|
|
167
|
+
*/
|
|
168
|
+
function extractToolProtections(config) {
|
|
169
|
+
if (!config?.toolProtection?.tools) {
|
|
170
|
+
return {};
|
|
171
|
+
}
|
|
172
|
+
return config.toolProtection.tools;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Check if config has embedded tool protections
|
|
176
|
+
*
|
|
177
|
+
* Utility to check if a config response is in the new merged format
|
|
178
|
+
* with embedded tool protections.
|
|
179
|
+
*
|
|
180
|
+
* @param config - Config object to check
|
|
181
|
+
* @returns True if config has embedded tools, false otherwise
|
|
182
|
+
*
|
|
183
|
+
* @since 1.6.0
|
|
184
|
+
*/
|
|
185
|
+
function hasMergedToolProtections(config) {
|
|
186
|
+
if (!config || typeof config !== 'object') {
|
|
187
|
+
return false;
|
|
188
|
+
}
|
|
189
|
+
const c = config;
|
|
190
|
+
return (c.toolProtection !== undefined &&
|
|
191
|
+
typeof c.toolProtection === 'object' &&
|
|
192
|
+
c.toolProtection !== null &&
|
|
193
|
+
'tools' in c.toolProtection &&
|
|
194
|
+
typeof c.toolProtection.tools === 'object' &&
|
|
195
|
+
c.toolProtection.tools !== null // typeof null === 'object' in JS
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
// ============================================================================
|
|
199
|
+
// Policy Configuration Helpers
|
|
200
|
+
// ============================================================================
|
|
201
|
+
/**
|
|
202
|
+
* Get policy configuration from a merged config
|
|
203
|
+
*
|
|
204
|
+
* This helper function extracts policy configuration from a merged config response.
|
|
205
|
+
* Returns null if no policy is present in the config.
|
|
206
|
+
*
|
|
207
|
+
* @param config - Config object that may contain policy
|
|
208
|
+
* @returns Policy configuration or null if not present
|
|
209
|
+
*
|
|
210
|
+
* @since 1.7.0
|
|
211
|
+
*/
|
|
212
|
+
function getPolicy(config) {
|
|
213
|
+
if (!config?.policy) {
|
|
214
|
+
return null;
|
|
215
|
+
}
|
|
216
|
+
return config.policy;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Extract policy configuration from merged config with defaults
|
|
220
|
+
*
|
|
221
|
+
* This helper function extracts the policy from a merged config.
|
|
222
|
+
* Returns the default policy config if no policy is found.
|
|
223
|
+
*
|
|
224
|
+
* @param config - Config object that may contain policy
|
|
225
|
+
* @returns Policy configuration (never null, returns defaults if missing)
|
|
226
|
+
*
|
|
227
|
+
* @since 1.7.0
|
|
228
|
+
*/
|
|
229
|
+
function extractPolicy(config) {
|
|
230
|
+
if (!config?.policy) {
|
|
231
|
+
// Return a deep clone to prevent mutation of the shared default
|
|
232
|
+
return structuredClone(contracts_1.DEFAULT_POLICY_CONFIG);
|
|
233
|
+
}
|
|
234
|
+
return config.policy;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Check if config has embedded policy configuration
|
|
238
|
+
*
|
|
239
|
+
* Utility to check if a config response includes policy configuration.
|
|
240
|
+
*
|
|
241
|
+
* @param config - Config object to check
|
|
242
|
+
* @returns True if config has policy, false otherwise
|
|
243
|
+
*
|
|
244
|
+
* @since 1.7.0
|
|
245
|
+
*/
|
|
246
|
+
function hasMergedPolicy(config) {
|
|
247
|
+
if (!config || typeof config !== 'object') {
|
|
248
|
+
return false;
|
|
249
|
+
}
|
|
250
|
+
const c = config;
|
|
251
|
+
return (c.policy !== undefined &&
|
|
252
|
+
typeof c.policy === 'object' &&
|
|
253
|
+
c.policy !== null);
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Check if policy enforcement is enabled for a config
|
|
257
|
+
*
|
|
258
|
+
* @param config - Config object that may contain policy
|
|
259
|
+
* @returns True if policy is present and enabled
|
|
260
|
+
*
|
|
261
|
+
* @since 1.7.0
|
|
262
|
+
*/
|
|
263
|
+
function isPolicyEnabled(config) {
|
|
264
|
+
const policy = getPolicy(config);
|
|
265
|
+
// Default to true to match DEFAULT_POLICY_CONFIG.enabled and PolicyService.isEnabled()
|
|
266
|
+
return policy?.enabled ?? true;
|
|
267
|
+
}
|
|
268
|
+
//# sourceMappingURL=remote-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote-config.js","sourceRoot":"","sources":["../../src/config/remote-config.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;AA0EH,8CAgGC;AAeD,8CAwBC;AAaD,wDAOC;AAaD,4DAgBC;AAiBD,8BAOC;AAaD,sCAQC;AAYD,0CAaC;AAUD,0CAMC;AAnVD,uEAA0E;AAC1E,iDAA0D;AA0D1D;;;;;;;;;GASG;AACI,KAAK,UAAU,iBAAiB,CACrC,OAA4B,EAC5B,KAAyB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-based Runtime Configuration
|
|
3
|
+
*
|
|
4
|
+
* Core configuration for MCP-I runtime using the provider pattern.
|
|
5
|
+
* This is the foundation for all platform-specific implementations.
|
|
6
|
+
*
|
|
7
|
+
* @module @kya-os/mcp-i-core/config
|
|
8
|
+
*/
|
|
9
|
+
import type { MCPIBaseConfig, RuntimeIdentityConfig, ProofingConfig, DelegationConfig, ToolProtectionSourceConfig } from '@kya-os/contracts/config';
|
|
10
|
+
import type { CryptoProvider, ClockProvider, FetchProvider, StorageProvider, NonceCacheProvider, IdentityProvider } from './providers/base';
|
|
11
|
+
import type { ToolProtectionService } from './services/tool-protection.service';
|
|
12
|
+
/**
|
|
13
|
+
* Provider-based runtime configuration
|
|
14
|
+
*
|
|
15
|
+
* This configuration is used internally by MCPIRuntimeBase and provides
|
|
16
|
+
* the foundation for all platform-specific implementations. It uses the
|
|
17
|
+
* provider pattern for platform abstraction, allowing different implementations
|
|
18
|
+
* for Node.js, Cloudflare Workers, and other environments.
|
|
19
|
+
*/
|
|
20
|
+
export interface ProviderRuntimeConfig extends MCPIBaseConfig {
|
|
21
|
+
/**
|
|
22
|
+
* Cryptographic operations provider
|
|
23
|
+
* Handles signing, verification, and key generation
|
|
24
|
+
*/
|
|
25
|
+
cryptoProvider: CryptoProvider;
|
|
26
|
+
/**
|
|
27
|
+
* Time operations provider
|
|
28
|
+
* Provides current time and timestamp generation
|
|
29
|
+
*/
|
|
30
|
+
clockProvider: ClockProvider;
|
|
31
|
+
/**
|
|
32
|
+
* HTTP fetch operations provider
|
|
33
|
+
* Handles external API calls
|
|
34
|
+
*/
|
|
35
|
+
fetchProvider: FetchProvider;
|
|
36
|
+
/**
|
|
37
|
+
* Storage operations provider
|
|
38
|
+
* Handles persistent data storage
|
|
39
|
+
*/
|
|
40
|
+
storageProvider: StorageProvider;
|
|
41
|
+
/**
|
|
42
|
+
* Nonce cache provider
|
|
43
|
+
* Handles replay prevention
|
|
44
|
+
*/
|
|
45
|
+
nonceCacheProvider: NonceCacheProvider;
|
|
46
|
+
/**
|
|
47
|
+
* Identity management provider
|
|
48
|
+
* Handles agent identity and DID operations
|
|
49
|
+
*/
|
|
50
|
+
identityProvider: IdentityProvider;
|
|
51
|
+
/**
|
|
52
|
+
* Session configuration
|
|
53
|
+
* Controls session handling and timeouts
|
|
54
|
+
*/
|
|
55
|
+
session?: {
|
|
56
|
+
/**
|
|
57
|
+
* Allowed timestamp skew in seconds
|
|
58
|
+
* @default 120
|
|
59
|
+
*/
|
|
60
|
+
timestampSkewSeconds?: number;
|
|
61
|
+
/**
|
|
62
|
+
* Session TTL in minutes
|
|
63
|
+
* @default 30
|
|
64
|
+
*/
|
|
65
|
+
ttlMinutes?: number;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Identity configuration (optional)
|
|
69
|
+
* When provided, enables identity features
|
|
70
|
+
*/
|
|
71
|
+
identity?: RuntimeIdentityConfig;
|
|
72
|
+
/**
|
|
73
|
+
* Proofing configuration (optional)
|
|
74
|
+
* When provided, enables proof generation
|
|
75
|
+
*/
|
|
76
|
+
proofing?: ProofingConfig;
|
|
77
|
+
/**
|
|
78
|
+
* Delegation configuration (optional)
|
|
79
|
+
* When provided, enables delegation verification
|
|
80
|
+
*/
|
|
81
|
+
delegation?: DelegationConfig;
|
|
82
|
+
/**
|
|
83
|
+
* Tool protection service (optional)
|
|
84
|
+
* When provided, enables runtime tool protection
|
|
85
|
+
* Note: This is different from tool registry which is compile-time
|
|
86
|
+
*/
|
|
87
|
+
toolProtectionService?: ToolProtectionService;
|
|
88
|
+
/**
|
|
89
|
+
* Tool protection source configuration (optional)
|
|
90
|
+
* Alternative to toolProtectionService for configuration-based setup
|
|
91
|
+
*/
|
|
92
|
+
toolProtection?: ToolProtectionSourceConfig;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Builder for provider runtime configuration
|
|
96
|
+
* Helps create valid configurations with proper defaults
|
|
97
|
+
*/
|
|
98
|
+
export declare class ProviderRuntimeConfigBuilder {
|
|
99
|
+
private config;
|
|
100
|
+
/**
|
|
101
|
+
* Set the providers (required)
|
|
102
|
+
*/
|
|
103
|
+
withProviders(providers: {
|
|
104
|
+
cryptoProvider: CryptoProvider;
|
|
105
|
+
clockProvider: ClockProvider;
|
|
106
|
+
fetchProvider: FetchProvider;
|
|
107
|
+
storageProvider: StorageProvider;
|
|
108
|
+
nonceCacheProvider: NonceCacheProvider;
|
|
109
|
+
identityProvider: IdentityProvider;
|
|
110
|
+
}): this;
|
|
111
|
+
/**
|
|
112
|
+
* Set the environment
|
|
113
|
+
*/
|
|
114
|
+
withEnvironment(env: 'development' | 'production'): this;
|
|
115
|
+
/**
|
|
116
|
+
* Configure session handling
|
|
117
|
+
*/
|
|
118
|
+
withSession(session: {
|
|
119
|
+
timestampSkewSeconds?: number;
|
|
120
|
+
ttlMinutes?: number;
|
|
121
|
+
}): this;
|
|
122
|
+
/**
|
|
123
|
+
* Enable identity features
|
|
124
|
+
*/
|
|
125
|
+
withIdentity(identity: RuntimeIdentityConfig): this;
|
|
126
|
+
/**
|
|
127
|
+
* Enable proofing features
|
|
128
|
+
*/
|
|
129
|
+
withProofing(proofing: ProofingConfig): this;
|
|
130
|
+
/**
|
|
131
|
+
* Enable delegation features
|
|
132
|
+
*/
|
|
133
|
+
withDelegation(delegation: DelegationConfig): this;
|
|
134
|
+
/**
|
|
135
|
+
* Set tool protection service
|
|
136
|
+
*/
|
|
137
|
+
withToolProtectionService(service: ToolProtectionService): this;
|
|
138
|
+
/**
|
|
139
|
+
* Set tool protection configuration
|
|
140
|
+
*/
|
|
141
|
+
withToolProtection(config: ToolProtectionSourceConfig): this;
|
|
142
|
+
/**
|
|
143
|
+
* Enable audit features
|
|
144
|
+
*/
|
|
145
|
+
withAudit(audit: {
|
|
146
|
+
enabled: boolean;
|
|
147
|
+
includeProofHashes?: boolean;
|
|
148
|
+
}): this;
|
|
149
|
+
/**
|
|
150
|
+
* Enable well-known endpoints
|
|
151
|
+
*/
|
|
152
|
+
withWellKnown(wellKnown: {
|
|
153
|
+
enabled: boolean;
|
|
154
|
+
serviceName?: string;
|
|
155
|
+
}): this;
|
|
156
|
+
/**
|
|
157
|
+
* Build the configuration
|
|
158
|
+
* Validates that all required providers are set
|
|
159
|
+
*/
|
|
160
|
+
build(): ProviderRuntimeConfig;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Re-export base types for convenience
|
|
164
|
+
*/
|
|
165
|
+
export type { MCPIBaseConfig, RuntimeIdentityConfig as BaseIdentityConfig, ProofingConfig, DelegationConfig, ToolProtectionSourceConfig } from '@kya-os/contracts/config';
|
|
166
|
+
/**
|
|
167
|
+
* Re-export remote config utilities
|
|
168
|
+
*/
|
|
169
|
+
export { fetchRemoteConfig, getToolProtection, extractToolProtections, hasMergedToolProtections, type RemoteConfigOptions, type RemoteConfigCache } from './config/remote-config';
|
|
170
|
+
/**
|
|
171
|
+
* Create a provider runtime configuration
|
|
172
|
+
* Convenience function for creating configurations
|
|
173
|
+
*/
|
|
174
|
+
export declare function createProviderRuntimeConfig(providers: {
|
|
175
|
+
cryptoProvider: CryptoProvider;
|
|
176
|
+
clockProvider: ClockProvider;
|
|
177
|
+
fetchProvider: FetchProvider;
|
|
178
|
+
storageProvider: StorageProvider;
|
|
179
|
+
nonceCacheProvider: NonceCacheProvider;
|
|
180
|
+
identityProvider: IdentityProvider;
|
|
181
|
+
}, options?: Partial<Omit<ProviderRuntimeConfig, keyof typeof providers>>): ProviderRuntimeConfig;
|
|
182
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,qBAAqB,EACrB,cAAc,EACd,gBAAgB,EAChB,0BAA0B,EAC3B,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACb,aAAa,EACb,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