@cyanheads/mcp-ts-core 0.1.0-beta.12
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/CLAUDE.md +583 -0
- package/LICENSE +201 -0
- package/README.md +287 -0
- package/biome.json +103 -0
- package/dist/app.d.ts +82 -0
- package/dist/app.d.ts.map +1 -0
- package/dist/app.js +222 -0
- package/dist/app.js.map +1 -0
- package/dist/cli/init.d.ts +8 -0
- package/dist/cli/init.d.ts.map +1 -0
- package/dist/cli/init.js +161 -0
- package/dist/cli/init.js.map +1 -0
- package/dist/config/index.d.ts +349 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +464 -0
- package/dist/config/index.js.map +1 -0
- package/dist/context.d.ts +119 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +144 -0
- package/dist/context.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp-server/prompts/prompt-registration.d.ts +33 -0
- package/dist/mcp-server/prompts/prompt-registration.d.ts.map +1 -0
- package/dist/mcp-server/prompts/prompt-registration.js +91 -0
- package/dist/mcp-server/prompts/prompt-registration.js.map +1 -0
- package/dist/mcp-server/prompts/utils/newPromptDefinition.d.ts +49 -0
- package/dist/mcp-server/prompts/utils/newPromptDefinition.d.ts.map +1 -0
- package/dist/mcp-server/prompts/utils/newPromptDefinition.js +39 -0
- package/dist/mcp-server/prompts/utils/newPromptDefinition.js.map +1 -0
- package/dist/mcp-server/prompts/utils/promptDefinition.d.ts +37 -0
- package/dist/mcp-server/prompts/utils/promptDefinition.d.ts.map +1 -0
- package/dist/mcp-server/prompts/utils/promptDefinition.js +2 -0
- package/dist/mcp-server/prompts/utils/promptDefinition.js.map +1 -0
- package/dist/mcp-server/resources/resource-registration.d.ts +27 -0
- package/dist/mcp-server/resources/resource-registration.d.ts.map +1 -0
- package/dist/mcp-server/resources/resource-registration.js +85 -0
- package/dist/mcp-server/resources/resource-registration.js.map +1 -0
- package/dist/mcp-server/resources/utils/newResourceDefinition.d.ts +84 -0
- package/dist/mcp-server/resources/utils/newResourceDefinition.d.ts.map +1 -0
- package/dist/mcp-server/resources/utils/newResourceDefinition.js +40 -0
- package/dist/mcp-server/resources/utils/newResourceDefinition.js.map +1 -0
- package/dist/mcp-server/resources/utils/newResourceHandlerFactory.d.ts +32 -0
- package/dist/mcp-server/resources/utils/newResourceHandlerFactory.d.ts.map +1 -0
- package/dist/mcp-server/resources/utils/newResourceHandlerFactory.js +103 -0
- package/dist/mcp-server/resources/utils/newResourceHandlerFactory.js.map +1 -0
- package/dist/mcp-server/resources/utils/resourceDefinition.d.ts +94 -0
- package/dist/mcp-server/resources/utils/resourceDefinition.d.ts.map +1 -0
- package/dist/mcp-server/resources/utils/resourceDefinition.js +2 -0
- package/dist/mcp-server/resources/utils/resourceDefinition.js.map +1 -0
- package/dist/mcp-server/resources/utils/resourceHandlerFactory.d.ts +14 -0
- package/dist/mcp-server/resources/utils/resourceHandlerFactory.d.ts.map +1 -0
- package/dist/mcp-server/resources/utils/resourceHandlerFactory.js +111 -0
- package/dist/mcp-server/resources/utils/resourceHandlerFactory.js.map +1 -0
- package/dist/mcp-server/roots/roots-registration.d.ts +22 -0
- package/dist/mcp-server/roots/roots-registration.d.ts.map +1 -0
- package/dist/mcp-server/roots/roots-registration.js +25 -0
- package/dist/mcp-server/roots/roots-registration.js.map +1 -0
- package/dist/mcp-server/server.d.ts +34 -0
- package/dist/mcp-server/server.d.ts.map +1 -0
- package/dist/mcp-server/server.js +62 -0
- package/dist/mcp-server/server.js.map +1 -0
- package/dist/mcp-server/tasks/core/sessionAwareTaskStore.d.ts +42 -0
- package/dist/mcp-server/tasks/core/sessionAwareTaskStore.d.ts.map +1 -0
- package/dist/mcp-server/tasks/core/sessionAwareTaskStore.js +70 -0
- package/dist/mcp-server/tasks/core/sessionAwareTaskStore.js.map +1 -0
- package/dist/mcp-server/tasks/core/storageBackedTaskStore.d.ts +109 -0
- package/dist/mcp-server/tasks/core/storageBackedTaskStore.d.ts.map +1 -0
- package/dist/mcp-server/tasks/core/storageBackedTaskStore.js +209 -0
- package/dist/mcp-server/tasks/core/storageBackedTaskStore.js.map +1 -0
- package/dist/mcp-server/tasks/core/taskManager.d.ts +103 -0
- package/dist/mcp-server/tasks/core/taskManager.d.ts.map +1 -0
- package/dist/mcp-server/tasks/core/taskManager.js +144 -0
- package/dist/mcp-server/tasks/core/taskManager.js.map +1 -0
- package/dist/mcp-server/tasks/core/taskTypes.d.ts +11 -0
- package/dist/mcp-server/tasks/core/taskTypes.d.ts.map +1 -0
- package/dist/mcp-server/tasks/core/taskTypes.js +13 -0
- package/dist/mcp-server/tasks/core/taskTypes.js.map +1 -0
- package/dist/mcp-server/tasks/utils/taskToolDefinition.d.ts +108 -0
- package/dist/mcp-server/tasks/utils/taskToolDefinition.d.ts.map +1 -0
- package/dist/mcp-server/tasks/utils/taskToolDefinition.js +14 -0
- package/dist/mcp-server/tasks/utils/taskToolDefinition.js.map +1 -0
- package/dist/mcp-server/tools/tool-registration.d.ts +49 -0
- package/dist/mcp-server/tools/tool-registration.d.ts.map +1 -0
- package/dist/mcp-server/tools/tool-registration.js +269 -0
- package/dist/mcp-server/tools/tool-registration.js.map +1 -0
- package/dist/mcp-server/tools/utils/newToolDefinition.d.ts +73 -0
- package/dist/mcp-server/tools/utils/newToolDefinition.d.ts.map +1 -0
- package/dist/mcp-server/tools/utils/newToolDefinition.js +45 -0
- package/dist/mcp-server/tools/utils/newToolDefinition.js.map +1 -0
- package/dist/mcp-server/tools/utils/newToolHandlerFactory.d.ts +33 -0
- package/dist/mcp-server/tools/utils/newToolHandlerFactory.d.ts.map +1 -0
- package/dist/mcp-server/tools/utils/newToolHandlerFactory.js +107 -0
- package/dist/mcp-server/tools/utils/newToolHandlerFactory.js.map +1 -0
- package/dist/mcp-server/tools/utils/toolDefinition.d.ts +118 -0
- package/dist/mcp-server/tools/utils/toolDefinition.d.ts.map +1 -0
- package/dist/mcp-server/tools/utils/toolDefinition.js +2 -0
- package/dist/mcp-server/tools/utils/toolDefinition.js.map +1 -0
- package/dist/mcp-server/tools/utils/toolHandlerFactory.d.ts +34 -0
- package/dist/mcp-server/tools/utils/toolHandlerFactory.d.ts.map +1 -0
- package/dist/mcp-server/tools/utils/toolHandlerFactory.js +68 -0
- package/dist/mcp-server/tools/utils/toolHandlerFactory.js.map +1 -0
- package/dist/mcp-server/transports/ITransport.d.ts +15 -0
- package/dist/mcp-server/transports/ITransport.d.ts.map +1 -0
- package/dist/mcp-server/transports/ITransport.js +2 -0
- package/dist/mcp-server/transports/ITransport.js.map +1 -0
- package/dist/mcp-server/transports/auth/authFactory.d.ts +11 -0
- package/dist/mcp-server/transports/auth/authFactory.d.ts.map +1 -0
- package/dist/mcp-server/transports/auth/authFactory.js +43 -0
- package/dist/mcp-server/transports/auth/authFactory.js.map +1 -0
- package/dist/mcp-server/transports/auth/authMiddleware.d.ts +24 -0
- package/dist/mcp-server/transports/auth/authMiddleware.d.ts.map +1 -0
- package/dist/mcp-server/transports/auth/authMiddleware.js +69 -0
- package/dist/mcp-server/transports/auth/authMiddleware.js.map +1 -0
- package/dist/mcp-server/transports/auth/lib/authContext.d.ts +34 -0
- package/dist/mcp-server/transports/auth/lib/authContext.d.ts.map +1 -0
- package/dist/mcp-server/transports/auth/lib/authContext.js +25 -0
- package/dist/mcp-server/transports/auth/lib/authContext.js.map +1 -0
- package/dist/mcp-server/transports/auth/lib/authTypes.d.ts +19 -0
- package/dist/mcp-server/transports/auth/lib/authTypes.d.ts.map +1 -0
- package/dist/mcp-server/transports/auth/lib/authTypes.js +2 -0
- package/dist/mcp-server/transports/auth/lib/authTypes.js.map +1 -0
- package/dist/mcp-server/transports/auth/lib/authUtils.d.ts +18 -0
- package/dist/mcp-server/transports/auth/lib/authUtils.d.ts.map +1 -0
- package/dist/mcp-server/transports/auth/lib/authUtils.js +64 -0
- package/dist/mcp-server/transports/auth/lib/authUtils.js.map +1 -0
- package/dist/mcp-server/transports/auth/lib/checkScopes.d.ts +25 -0
- package/dist/mcp-server/transports/auth/lib/checkScopes.d.ts.map +1 -0
- package/dist/mcp-server/transports/auth/lib/checkScopes.js +34 -0
- package/dist/mcp-server/transports/auth/lib/checkScopes.js.map +1 -0
- package/dist/mcp-server/transports/auth/lib/claimParser.d.ts +34 -0
- package/dist/mcp-server/transports/auth/lib/claimParser.d.ts.map +1 -0
- package/dist/mcp-server/transports/auth/lib/claimParser.js +58 -0
- package/dist/mcp-server/transports/auth/lib/claimParser.js.map +1 -0
- package/dist/mcp-server/transports/auth/lib/withAuth.d.ts +25 -0
- package/dist/mcp-server/transports/auth/lib/withAuth.d.ts.map +1 -0
- package/dist/mcp-server/transports/auth/lib/withAuth.js +30 -0
- package/dist/mcp-server/transports/auth/lib/withAuth.js.map +1 -0
- package/dist/mcp-server/transports/auth/strategies/authStrategy.d.ts +18 -0
- package/dist/mcp-server/transports/auth/strategies/authStrategy.d.ts.map +1 -0
- package/dist/mcp-server/transports/auth/strategies/authStrategy.js +2 -0
- package/dist/mcp-server/transports/auth/strategies/authStrategy.js.map +1 -0
- package/dist/mcp-server/transports/auth/strategies/jwtStrategy.d.ts +14 -0
- package/dist/mcp-server/transports/auth/strategies/jwtStrategy.d.ts.map +1 -0
- package/dist/mcp-server/transports/auth/strategies/jwtStrategy.js +86 -0
- package/dist/mcp-server/transports/auth/strategies/jwtStrategy.js.map +1 -0
- package/dist/mcp-server/transports/auth/strategies/oauthStrategy.d.ts +14 -0
- package/dist/mcp-server/transports/auth/strategies/oauthStrategy.d.ts.map +1 -0
- package/dist/mcp-server/transports/auth/strategies/oauthStrategy.js +113 -0
- package/dist/mcp-server/transports/auth/strategies/oauthStrategy.js.map +1 -0
- package/dist/mcp-server/transports/http/httpErrorHandler.d.ts +25 -0
- package/dist/mcp-server/transports/http/httpErrorHandler.d.ts.map +1 -0
- package/dist/mcp-server/transports/http/httpErrorHandler.js +112 -0
- package/dist/mcp-server/transports/http/httpErrorHandler.js.map +1 -0
- package/dist/mcp-server/transports/http/httpTransport.d.ts +47 -0
- package/dist/mcp-server/transports/http/httpTransport.d.ts.map +1 -0
- package/dist/mcp-server/transports/http/httpTransport.js +396 -0
- package/dist/mcp-server/transports/http/httpTransport.js.map +1 -0
- package/dist/mcp-server/transports/http/httpTypes.d.ts +17 -0
- package/dist/mcp-server/transports/http/httpTypes.d.ts.map +1 -0
- package/dist/mcp-server/transports/http/httpTypes.js +2 -0
- package/dist/mcp-server/transports/http/httpTypes.js.map +1 -0
- package/dist/mcp-server/transports/http/protectedResourceMetadata.d.ts +21 -0
- package/dist/mcp-server/transports/http/protectedResourceMetadata.d.ts.map +1 -0
- package/dist/mcp-server/transports/http/protectedResourceMetadata.js +44 -0
- package/dist/mcp-server/transports/http/protectedResourceMetadata.js.map +1 -0
- package/dist/mcp-server/transports/http/sessionIdUtils.d.ts +33 -0
- package/dist/mcp-server/transports/http/sessionIdUtils.d.ts.map +1 -0
- package/dist/mcp-server/transports/http/sessionIdUtils.js +54 -0
- package/dist/mcp-server/transports/http/sessionIdUtils.js.map +1 -0
- package/dist/mcp-server/transports/http/sessionStore.d.ts +87 -0
- package/dist/mcp-server/transports/http/sessionStore.d.ts.map +1 -0
- package/dist/mcp-server/transports/http/sessionStore.js +209 -0
- package/dist/mcp-server/transports/http/sessionStore.js.map +1 -0
- package/dist/mcp-server/transports/manager.d.ts +22 -0
- package/dist/mcp-server/transports/manager.d.ts.map +1 -0
- package/dist/mcp-server/transports/manager.js +62 -0
- package/dist/mcp-server/transports/manager.js.map +1 -0
- package/dist/mcp-server/transports/stdio/stdioTransport.d.ts +44 -0
- package/dist/mcp-server/transports/stdio/stdioTransport.d.ts.map +1 -0
- package/dist/mcp-server/transports/stdio/stdioTransport.js +63 -0
- package/dist/mcp-server/transports/stdio/stdioTransport.js.map +1 -0
- package/dist/services/graph/core/GraphService.d.ts +205 -0
- package/dist/services/graph/core/GraphService.d.ts.map +1 -0
- package/dist/services/graph/core/GraphService.js +231 -0
- package/dist/services/graph/core/GraphService.js.map +1 -0
- package/dist/services/graph/core/IGraphProvider.d.ts +295 -0
- package/dist/services/graph/core/IGraphProvider.d.ts.map +1 -0
- package/dist/services/graph/core/IGraphProvider.js +8 -0
- package/dist/services/graph/core/IGraphProvider.js.map +1 -0
- package/dist/services/graph/types.d.ts +107 -0
- package/dist/services/graph/types.d.ts.map +1 -0
- package/dist/services/graph/types.js +8 -0
- package/dist/services/graph/types.js.map +1 -0
- package/dist/services/llm/core/ILlmProvider.d.ts +86 -0
- package/dist/services/llm/core/ILlmProvider.d.ts.map +1 -0
- package/dist/services/llm/core/ILlmProvider.js +2 -0
- package/dist/services/llm/core/ILlmProvider.js.map +1 -0
- package/dist/services/llm/providers/openrouter.provider.d.ts +187 -0
- package/dist/services/llm/providers/openrouter.provider.d.ts.map +1 -0
- package/dist/services/llm/providers/openrouter.provider.js +302 -0
- package/dist/services/llm/providers/openrouter.provider.js.map +1 -0
- package/dist/services/llm/types.d.ts +16 -0
- package/dist/services/llm/types.d.ts.map +1 -0
- package/dist/services/llm/types.js +9 -0
- package/dist/services/llm/types.js.map +1 -0
- package/dist/services/speech/core/ISpeechProvider.d.ts +92 -0
- package/dist/services/speech/core/ISpeechProvider.d.ts.map +1 -0
- package/dist/services/speech/core/ISpeechProvider.js +34 -0
- package/dist/services/speech/core/ISpeechProvider.js.map +1 -0
- package/dist/services/speech/core/SpeechService.d.ts +87 -0
- package/dist/services/speech/core/SpeechService.d.ts.map +1 -0
- package/dist/services/speech/core/SpeechService.js +135 -0
- package/dist/services/speech/core/SpeechService.js.map +1 -0
- package/dist/services/speech/providers/elevenlabs.provider.d.ts +77 -0
- package/dist/services/speech/providers/elevenlabs.provider.d.ts.map +1 -0
- package/dist/services/speech/providers/elevenlabs.provider.js +199 -0
- package/dist/services/speech/providers/elevenlabs.provider.js.map +1 -0
- package/dist/services/speech/providers/whisper.provider.d.ts +94 -0
- package/dist/services/speech/providers/whisper.provider.d.ts.map +1 -0
- package/dist/services/speech/providers/whisper.provider.js +240 -0
- package/dist/services/speech/providers/whisper.provider.js.map +1 -0
- package/dist/services/speech/types.d.ts +173 -0
- package/dist/services/speech/types.d.ts.map +1 -0
- package/dist/services/speech/types.js +8 -0
- package/dist/services/speech/types.js.map +1 -0
- package/dist/storage/core/IStorageProvider.d.ts +159 -0
- package/dist/storage/core/IStorageProvider.d.ts.map +1 -0
- package/dist/storage/core/IStorageProvider.js +2 -0
- package/dist/storage/core/IStorageProvider.js.map +1 -0
- package/dist/storage/core/StorageService.d.ts +22 -0
- package/dist/storage/core/StorageService.d.ts.map +1 -0
- package/dist/storage/core/StorageService.js +151 -0
- package/dist/storage/core/StorageService.js.map +1 -0
- package/dist/storage/core/storageFactory.d.ts +66 -0
- package/dist/storage/core/storageFactory.d.ts.map +1 -0
- package/dist/storage/core/storageFactory.js +122 -0
- package/dist/storage/core/storageFactory.js.map +1 -0
- package/dist/storage/core/storageValidation.d.ts +77 -0
- package/dist/storage/core/storageValidation.d.ts.map +1 -0
- package/dist/storage/core/storageValidation.js +303 -0
- package/dist/storage/core/storageValidation.js.map +1 -0
- package/dist/storage/providers/cloudflare/d1Provider.d.ts +94 -0
- package/dist/storage/providers/cloudflare/d1Provider.d.ts.map +1 -0
- package/dist/storage/providers/cloudflare/d1Provider.js +347 -0
- package/dist/storage/providers/cloudflare/d1Provider.js.map +1 -0
- package/dist/storage/providers/cloudflare/kvProvider.d.ts +21 -0
- package/dist/storage/providers/cloudflare/kvProvider.d.ts.map +1 -0
- package/dist/storage/providers/cloudflare/kvProvider.js +183 -0
- package/dist/storage/providers/cloudflare/kvProvider.js.map +1 -0
- package/dist/storage/providers/cloudflare/r2Provider.d.ts +28 -0
- package/dist/storage/providers/cloudflare/r2Provider.d.ts.map +1 -0
- package/dist/storage/providers/cloudflare/r2Provider.js +222 -0
- package/dist/storage/providers/cloudflare/r2Provider.js.map +1 -0
- package/dist/storage/providers/fileSystem/fileSystemProvider.d.ts +20 -0
- package/dist/storage/providers/fileSystem/fileSystemProvider.d.ts.map +1 -0
- package/dist/storage/providers/fileSystem/fileSystemProvider.js +282 -0
- package/dist/storage/providers/fileSystem/fileSystemProvider.js.map +1 -0
- package/dist/storage/providers/inMemory/inMemoryProvider.d.ts +21 -0
- package/dist/storage/providers/inMemory/inMemoryProvider.d.ts.map +1 -0
- package/dist/storage/providers/inMemory/inMemoryProvider.js +139 -0
- package/dist/storage/providers/inMemory/inMemoryProvider.js.map +1 -0
- package/dist/storage/providers/supabase/supabase.types.d.ts +49 -0
- package/dist/storage/providers/supabase/supabase.types.d.ts.map +1 -0
- package/dist/storage/providers/supabase/supabase.types.js +8 -0
- package/dist/storage/providers/supabase/supabase.types.js.map +1 -0
- package/dist/storage/providers/supabase/supabaseProvider.d.ts +24 -0
- package/dist/storage/providers/supabase/supabaseProvider.d.ts.map +1 -0
- package/dist/storage/providers/supabase/supabaseProvider.js +209 -0
- package/dist/storage/providers/supabase/supabaseProvider.js.map +1 -0
- package/dist/testing/index.d.ts +53 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +132 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/types-global/errors.d.ts +83 -0
- package/dist/types-global/errors.d.ts.map +1 -0
- package/dist/types-global/errors.js +113 -0
- package/dist/types-global/errors.js.map +1 -0
- package/dist/utils/formatting/diffFormatter.d.ts +227 -0
- package/dist/utils/formatting/diffFormatter.d.ts.map +1 -0
- package/dist/utils/formatting/diffFormatter.js +369 -0
- package/dist/utils/formatting/diffFormatter.js.map +1 -0
- package/dist/utils/formatting/index.d.ts +9 -0
- package/dist/utils/formatting/index.d.ts.map +1 -0
- package/dist/utils/formatting/index.js +9 -0
- package/dist/utils/formatting/index.js.map +1 -0
- package/dist/utils/formatting/markdownBuilder.d.ts +543 -0
- package/dist/utils/formatting/markdownBuilder.d.ts.map +1 -0
- package/dist/utils/formatting/markdownBuilder.js +674 -0
- package/dist/utils/formatting/markdownBuilder.js.map +1 -0
- package/dist/utils/formatting/tableFormatter.d.ts +261 -0
- package/dist/utils/formatting/tableFormatter.d.ts.map +1 -0
- package/dist/utils/formatting/tableFormatter.js +456 -0
- package/dist/utils/formatting/tableFormatter.js.map +1 -0
- package/dist/utils/formatting/treeFormatter.d.ts +344 -0
- package/dist/utils/formatting/treeFormatter.d.ts.map +1 -0
- package/dist/utils/formatting/treeFormatter.js +400 -0
- package/dist/utils/formatting/treeFormatter.js.map +1 -0
- package/dist/utils/internal/encoding.d.ts +42 -0
- package/dist/utils/internal/encoding.d.ts.map +1 -0
- package/dist/utils/internal/encoding.js +87 -0
- package/dist/utils/internal/encoding.js.map +1 -0
- package/dist/utils/internal/error-handler/errorHandler.d.ts +140 -0
- package/dist/utils/internal/error-handler/errorHandler.d.ts.map +1 -0
- package/dist/utils/internal/error-handler/errorHandler.js +318 -0
- package/dist/utils/internal/error-handler/errorHandler.js.map +1 -0
- package/dist/utils/internal/error-handler/helpers.d.ts +98 -0
- package/dist/utils/internal/error-handler/helpers.d.ts.map +1 -0
- package/dist/utils/internal/error-handler/helpers.js +214 -0
- package/dist/utils/internal/error-handler/helpers.js.map +1 -0
- package/dist/utils/internal/error-handler/mappings.d.ts +85 -0
- package/dist/utils/internal/error-handler/mappings.d.ts.map +1 -0
- package/dist/utils/internal/error-handler/mappings.js +234 -0
- package/dist/utils/internal/error-handler/mappings.js.map +1 -0
- package/dist/utils/internal/error-handler/types.d.ts +160 -0
- package/dist/utils/internal/error-handler/types.d.ts.map +1 -0
- package/dist/utils/internal/error-handler/types.js +6 -0
- package/dist/utils/internal/error-handler/types.js.map +1 -0
- package/dist/utils/internal/health.d.ts +60 -0
- package/dist/utils/internal/health.d.ts.map +1 -0
- package/dist/utils/internal/health.js +46 -0
- package/dist/utils/internal/health.js.map +1 -0
- package/dist/utils/internal/logger.d.ts +300 -0
- package/dist/utils/internal/logger.d.ts.map +1 -0
- package/dist/utils/internal/logger.js +573 -0
- package/dist/utils/internal/logger.js.map +1 -0
- package/dist/utils/internal/performance.d.ts +78 -0
- package/dist/utils/internal/performance.d.ts.map +1 -0
- package/dist/utils/internal/performance.js +227 -0
- package/dist/utils/internal/performance.js.map +1 -0
- package/dist/utils/internal/requestContext.d.ts +200 -0
- package/dist/utils/internal/requestContext.d.ts.map +1 -0
- package/dist/utils/internal/requestContext.js +163 -0
- package/dist/utils/internal/requestContext.js.map +1 -0
- package/dist/utils/internal/runtime.d.ts +49 -0
- package/dist/utils/internal/runtime.d.ts.map +1 -0
- package/dist/utils/internal/runtime.js +90 -0
- package/dist/utils/internal/runtime.js.map +1 -0
- package/dist/utils/internal/startupBanner.d.ts +23 -0
- package/dist/utils/internal/startupBanner.d.ts.map +1 -0
- package/dist/utils/internal/startupBanner.js +34 -0
- package/dist/utils/internal/startupBanner.js.map +1 -0
- package/dist/utils/metrics/tokenCounter.d.ts +97 -0
- package/dist/utils/metrics/tokenCounter.d.ts.map +1 -0
- package/dist/utils/metrics/tokenCounter.js +162 -0
- package/dist/utils/metrics/tokenCounter.js.map +1 -0
- package/dist/utils/network/fetchWithTimeout.d.ts +91 -0
- package/dist/utils/network/fetchWithTimeout.d.ts.map +1 -0
- package/dist/utils/network/fetchWithTimeout.js +305 -0
- package/dist/utils/network/fetchWithTimeout.js.map +1 -0
- package/dist/utils/pagination/pagination.d.ts +157 -0
- package/dist/utils/pagination/pagination.d.ts.map +1 -0
- package/dist/utils/pagination/pagination.js +191 -0
- package/dist/utils/pagination/pagination.js.map +1 -0
- package/dist/utils/parsing/csvParser.d.ts +84 -0
- package/dist/utils/parsing/csvParser.d.ts.map +1 -0
- package/dist/utils/parsing/csvParser.js +132 -0
- package/dist/utils/parsing/csvParser.js.map +1 -0
- package/dist/utils/parsing/dateParser.d.ts +103 -0
- package/dist/utils/parsing/dateParser.d.ts.map +1 -0
- package/dist/utils/parsing/dateParser.js +142 -0
- package/dist/utils/parsing/dateParser.js.map +1 -0
- package/dist/utils/parsing/frontmatterParser.d.ts +91 -0
- package/dist/utils/parsing/frontmatterParser.d.ts.map +1 -0
- package/dist/utils/parsing/frontmatterParser.js +163 -0
- package/dist/utils/parsing/frontmatterParser.js.map +1 -0
- package/dist/utils/parsing/index.d.ts +15 -0
- package/dist/utils/parsing/index.d.ts.map +1 -0
- package/dist/utils/parsing/index.js +15 -0
- package/dist/utils/parsing/index.js.map +1 -0
- package/dist/utils/parsing/jsonParser.d.ts +115 -0
- package/dist/utils/parsing/jsonParser.d.ts.map +1 -0
- package/dist/utils/parsing/jsonParser.js +177 -0
- package/dist/utils/parsing/jsonParser.js.map +1 -0
- package/dist/utils/parsing/pdfParser.d.ts +563 -0
- package/dist/utils/parsing/pdfParser.d.ts.map +1 -0
- package/dist/utils/parsing/pdfParser.js +775 -0
- package/dist/utils/parsing/pdfParser.js.map +1 -0
- package/dist/utils/parsing/thinkBlock.d.ts +31 -0
- package/dist/utils/parsing/thinkBlock.d.ts.map +1 -0
- package/dist/utils/parsing/thinkBlock.js +31 -0
- package/dist/utils/parsing/thinkBlock.js.map +1 -0
- package/dist/utils/parsing/xmlParser.d.ts +69 -0
- package/dist/utils/parsing/xmlParser.d.ts.map +1 -0
- package/dist/utils/parsing/xmlParser.js +140 -0
- package/dist/utils/parsing/xmlParser.js.map +1 -0
- package/dist/utils/parsing/yamlParser.d.ts +64 -0
- package/dist/utils/parsing/yamlParser.d.ts.map +1 -0
- package/dist/utils/parsing/yamlParser.js +129 -0
- package/dist/utils/parsing/yamlParser.js.map +1 -0
- package/dist/utils/scheduling/scheduler.d.ts +174 -0
- package/dist/utils/scheduling/scheduler.d.ts.map +1 -0
- package/dist/utils/scheduling/scheduler.js +248 -0
- package/dist/utils/scheduling/scheduler.js.map +1 -0
- package/dist/utils/security/idGenerator.d.ts +189 -0
- package/dist/utils/security/idGenerator.d.ts.map +1 -0
- package/dist/utils/security/idGenerator.js +301 -0
- package/dist/utils/security/idGenerator.js.map +1 -0
- package/dist/utils/security/index.d.ts +8 -0
- package/dist/utils/security/index.d.ts.map +1 -0
- package/dist/utils/security/index.js +8 -0
- package/dist/utils/security/index.js.map +1 -0
- package/dist/utils/security/rateLimiter.d.ts +171 -0
- package/dist/utils/security/rateLimiter.d.ts.map +1 -0
- package/dist/utils/security/rateLimiter.js +294 -0
- package/dist/utils/security/rateLimiter.js.map +1 -0
- package/dist/utils/security/sanitization.d.ts +430 -0
- package/dist/utils/security/sanitization.d.ts.map +1 -0
- package/dist/utils/security/sanitization.js +759 -0
- package/dist/utils/security/sanitization.js.map +1 -0
- package/dist/utils/telemetry/index.d.ts +12 -0
- package/dist/utils/telemetry/index.d.ts.map +1 -0
- package/dist/utils/telemetry/index.js +12 -0
- package/dist/utils/telemetry/index.js.map +1 -0
- package/dist/utils/telemetry/instrumentation.d.ts +62 -0
- package/dist/utils/telemetry/instrumentation.d.ts.map +1 -0
- package/dist/utils/telemetry/instrumentation.js +223 -0
- package/dist/utils/telemetry/instrumentation.js.map +1 -0
- package/dist/utils/telemetry/metrics.d.ts +170 -0
- package/dist/utils/telemetry/metrics.d.ts.map +1 -0
- package/dist/utils/telemetry/metrics.js +205 -0
- package/dist/utils/telemetry/metrics.js.map +1 -0
- package/dist/utils/telemetry/semconv.d.ts +147 -0
- package/dist/utils/telemetry/semconv.d.ts.map +1 -0
- package/dist/utils/telemetry/semconv.js +159 -0
- package/dist/utils/telemetry/semconv.js.map +1 -0
- package/dist/utils/telemetry/trace.d.ts +141 -0
- package/dist/utils/telemetry/trace.d.ts.map +1 -0
- package/dist/utils/telemetry/trace.js +193 -0
- package/dist/utils/telemetry/trace.js.map +1 -0
- package/dist/utils/types/guards.d.ts +209 -0
- package/dist/utils/types/guards.d.ts.map +1 -0
- package/dist/utils/types/guards.js +229 -0
- package/dist/utils/types/guards.js.map +1 -0
- package/dist/utils/types/index.d.ts +6 -0
- package/dist/utils/types/index.d.ts.map +1 -0
- package/dist/utils/types/index.js +6 -0
- package/dist/utils/types/index.js.map +1 -0
- package/dist/worker.d.ts +59 -0
- package/dist/worker.d.ts.map +1 -0
- package/dist/worker.js +216 -0
- package/dist/worker.js.map +1 -0
- package/package.json +377 -0
- package/skills/README.md +38 -0
- package/skills/add-export/SKILL.md +49 -0
- package/skills/add-prompt/SKILL.md +97 -0
- package/skills/add-provider/SKILL.md +53 -0
- package/skills/add-resource/SKILL.md +107 -0
- package/skills/add-service/SKILL.md +113 -0
- package/skills/add-tool/SKILL.md +110 -0
- package/skills/api-auth/SKILL.md +173 -0
- package/skills/api-config/SKILL.md +68 -0
- package/skills/api-context/SKILL.md +321 -0
- package/skills/api-errors/SKILL.md +146 -0
- package/skills/api-services/SKILL.md +24 -0
- package/skills/api-services/references/graph.md +124 -0
- package/skills/api-services/references/llm.md +46 -0
- package/skills/api-services/references/speech.md +72 -0
- package/skills/api-testing/SKILL.md +263 -0
- package/skills/api-utils/SKILL.md +106 -0
- package/skills/api-utils/references/formatting.md +237 -0
- package/skills/api-utils/references/parsing.md +263 -0
- package/skills/api-utils/references/security.md +226 -0
- package/skills/api-workers/SKILL.md +165 -0
- package/skills/devcheck/SKILL.md +31 -0
- package/skills/maintenance/SKILL.md +52 -0
- package/skills/migrate-mcp-ts-template/SKILL.md +131 -0
- package/skills/release/SKILL.md +67 -0
- package/skills/setup/SKILL.md +89 -0
- package/skills/walkthrough-init/SKILL.md +50 -0
- package/templates/.env.example +17 -0
- package/templates/AGENTS.md +113 -0
- package/templates/CLAUDE.md +113 -0
- package/templates/_tsconfig.json +33 -0
- package/templates/biome.template.json +43 -0
- package/templates/package.json +26 -0
- package/templates/src/index.ts +16 -0
- package/templates/src/mcp-server/prompts/definitions/echo.prompt.ts +19 -0
- package/templates/src/mcp-server/resources/definitions/echo.resource.ts +30 -0
- package/templates/src/mcp-server/tools/definitions/echo.tool.ts +24 -0
- package/templates/vitest.config.ts +12 -0
- package/tsconfig.base.json +44 -0
- package/vitest.config.base.ts +38 -0
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Helpers for working with trace context across boundaries.
|
|
3
|
+
* Provides utilities for W3C traceparent headers, distributed tracing,
|
|
4
|
+
* custom span creation, and context propagation across async boundaries.
|
|
5
|
+
* @module src/utils/telemetry/trace
|
|
6
|
+
*/
|
|
7
|
+
import { type Span } from '@opentelemetry/api';
|
|
8
|
+
import type { RequestContext } from '../../utils/internal/requestContext.js';
|
|
9
|
+
/**
|
|
10
|
+
* Parsed fields from a W3C `traceparent` header (`00-<traceId>-<spanId>-<flags>`).
|
|
11
|
+
* Used to propagate distributed trace context across service boundaries.
|
|
12
|
+
* @see https://www.w3.org/TR/trace-context/
|
|
13
|
+
*/
|
|
14
|
+
export interface TraceparentInfo {
|
|
15
|
+
/** Whether the trace is sampled (flags byte `01` = sampled, `00` = not sampled). */
|
|
16
|
+
sampled: boolean;
|
|
17
|
+
/** W3C parent span ID — 16 lowercase hex characters identifying the caller's span. */
|
|
18
|
+
spanId: string;
|
|
19
|
+
/** W3C trace ID — 32 lowercase hex characters shared across the entire distributed trace. */
|
|
20
|
+
traceId: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Builds a W3C `traceparent` header value from a `RequestContext` or the currently active span.
|
|
24
|
+
* Uses `ctx.traceId`/`ctx.spanId` when provided; falls back to the active OTel span context.
|
|
25
|
+
* The version field is always `00` and the flags byte is hardcoded to `01` (sampled).
|
|
26
|
+
* Returns `undefined` when neither source yields a trace ID and span ID.
|
|
27
|
+
*
|
|
28
|
+
* @param ctx - Optional RequestContext containing `traceId` and `spanId`
|
|
29
|
+
* @returns Formatted `traceparent` string (e.g., `00-<traceId>-<spanId>-01`), or `undefined`
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```typescript
|
|
33
|
+
* const traceparent = buildTraceparent(requestContext);
|
|
34
|
+
* if (traceparent) {
|
|
35
|
+
* fetch(url, { headers: { traceparent } });
|
|
36
|
+
* }
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export declare function buildTraceparent(ctx?: RequestContext): string | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Extracts W3C traceparent from headers and returns parsed trace/span IDs.
|
|
42
|
+
* Returns undefined if header is missing or malformed.
|
|
43
|
+
*
|
|
44
|
+
* @param headers - Headers object (Web API Headers or plain object)
|
|
45
|
+
* @returns Parsed traceparent info or undefined
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```typescript
|
|
49
|
+
* // Extract trace context from incoming request
|
|
50
|
+
* const trace = extractTraceparent(request.headers);
|
|
51
|
+
* if (trace) {
|
|
52
|
+
* logger.info('Processing with parent trace', {
|
|
53
|
+
* traceId: trace.traceId,
|
|
54
|
+
* sampled: trace.sampled
|
|
55
|
+
* });
|
|
56
|
+
* }
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
export declare function extractTraceparent(headers: Headers | Record<string, string | undefined>): TraceparentInfo | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* Creates a child RequestContext with parent trace context extracted from headers.
|
|
62
|
+
* Useful for propagating trace context from incoming HTTP requests.
|
|
63
|
+
*
|
|
64
|
+
* @param parentHeaders - Headers containing traceparent
|
|
65
|
+
* @param operation - Operation name for the new context
|
|
66
|
+
* @returns New RequestContext with inherited trace context
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```typescript
|
|
70
|
+
* // In HTTP handler
|
|
71
|
+
* const context = createContextWithParentTrace(
|
|
72
|
+
* request.headers,
|
|
73
|
+
* 'handleApiRequest'
|
|
74
|
+
* );
|
|
75
|
+
* logger.info('Processing request', context);
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
export declare function createContextWithParentTrace(parentHeaders: Headers | Record<string, string | undefined>, operation: string): RequestContext;
|
|
79
|
+
/**
|
|
80
|
+
* Injects the current active context into a carrier, returning it.
|
|
81
|
+
* Useful for HTTP headers: pass an object and use resulting key/values.
|
|
82
|
+
*
|
|
83
|
+
* @param carrier - Object to inject context into (typically headers)
|
|
84
|
+
* @returns Same carrier with injected trace context
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```typescript
|
|
88
|
+
* const headers = injectCurrentContextInto({
|
|
89
|
+
* 'Content-Type': 'application/json'
|
|
90
|
+
* });
|
|
91
|
+
* // headers now contains traceparent, tracestate, etc.
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
export declare function injectCurrentContextInto<T extends Record<string, unknown>>(carrier: T): T;
|
|
95
|
+
/**
|
|
96
|
+
* Creates a new span for manual instrumentation with automatic error handling.
|
|
97
|
+
* The span is automatically marked as OK on success or ERROR on exception.
|
|
98
|
+
* Errors are recorded as exceptions and automatically propagated.
|
|
99
|
+
*
|
|
100
|
+
* @param operationName - Name of the span (e.g., 'database.query', 'external.api')
|
|
101
|
+
* @param fn - Async function to execute within the span
|
|
102
|
+
* @param attributes - Optional attributes to attach to the span
|
|
103
|
+
* @returns Promise resolving to the function's return value
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* ```typescript
|
|
107
|
+
* // Instrument a database query
|
|
108
|
+
* const users = await withSpan(
|
|
109
|
+
* 'database.query.users',
|
|
110
|
+
* async () => db.users.findMany(),
|
|
111
|
+
* { 'db.table': 'users', 'db.operation': 'select' }
|
|
112
|
+
* );
|
|
113
|
+
* ```
|
|
114
|
+
*/
|
|
115
|
+
export declare function withSpan<T>(operationName: string, fn: (span: Span) => Promise<T>, attributes?: Record<string, string | number | boolean>): Promise<T>;
|
|
116
|
+
/**
|
|
117
|
+
* Runs a function within the currently active OpenTelemetry context.
|
|
118
|
+
* Useful for carrying the active context across async boundaries (e.g., `setTimeout`, `queueMicrotask`).
|
|
119
|
+
*
|
|
120
|
+
* **Limitation:** When `ctx` contains trace IDs, this function executes within the
|
|
121
|
+
* current active context rather than restoring `ctx`'s specific span context.
|
|
122
|
+
* Full span restoration would require span recreation, which this utility intentionally avoids.
|
|
123
|
+
* If `ctx` has no trace IDs, `fn` is called directly without any context wrapping.
|
|
124
|
+
*
|
|
125
|
+
* @param ctx - RequestContext containing trace IDs; if missing or lacking IDs, `fn` runs directly
|
|
126
|
+
* @param fn - Function to execute within the active OTel context
|
|
127
|
+
* @returns Result of `fn`
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* ```typescript
|
|
131
|
+
* // Carry the active OTel context into a setTimeout callback
|
|
132
|
+
* const context = requestContextService.createRequestContext({ operation: 'delayed' });
|
|
133
|
+
* setTimeout(() => {
|
|
134
|
+
* runInContext(context, () => {
|
|
135
|
+
* logger.info('Still in trace context', context);
|
|
136
|
+
* });
|
|
137
|
+
* }, 1000);
|
|
138
|
+
* ```
|
|
139
|
+
*/
|
|
140
|
+
export declare function runInContext<T>(ctx: RequestContext | undefined, fn: () => T): T;
|
|
141
|
+
//# sourceMappingURL=trace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trace.d.ts","sourceRoot":"","sources":["../../../src/utils/telemetry/trace.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAGL,KAAK,IAAI,EAGV,MAAM,oBAAoB,CAAC;AAG5B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAGzE;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,oFAAoF;IACpF,OAAO,EAAE,OAAO,CAAC;IACjB,sFAAsF;IACtF,MAAM,EAAE,MAAM,CAAC;IACf,6FAA6F;IAC7F,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,CAAC,EAAE,cAAc,GAAG,MAAM,GAAG,SAAS,CAOzE;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GACpD,eAAe,GAAG,SAAS,CAc7B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,4BAA4B,CAC1C,aAAa,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,EAC3D,SAAS,EAAE,MAAM,GAChB,cAAc,CAShB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,wBAAwB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAGzF;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,QAAQ,CAAC,CAAC,EAC9B,aAAa,EAAE,MAAM,EACrB,EAAE,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,EAC9B,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,GACrD,OAAO,CAAC,CAAC,CAAC,CA0BZ;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,GAAG,EAAE,cAAc,GAAG,SAAS,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAU/E"}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Helpers for working with trace context across boundaries.
|
|
3
|
+
* Provides utilities for W3C traceparent headers, distributed tracing,
|
|
4
|
+
* custom span creation, and context propagation across async boundaries.
|
|
5
|
+
* @module src/utils/telemetry/trace
|
|
6
|
+
*/
|
|
7
|
+
import { context as otContext, propagation, SpanStatusCode, trace, } from '@opentelemetry/api';
|
|
8
|
+
import { config } from '../../config/index.js';
|
|
9
|
+
import { requestContextService } from '../../utils/internal/requestContext.js';
|
|
10
|
+
/**
|
|
11
|
+
* Builds a W3C `traceparent` header value from a `RequestContext` or the currently active span.
|
|
12
|
+
* Uses `ctx.traceId`/`ctx.spanId` when provided; falls back to the active OTel span context.
|
|
13
|
+
* The version field is always `00` and the flags byte is hardcoded to `01` (sampled).
|
|
14
|
+
* Returns `undefined` when neither source yields a trace ID and span ID.
|
|
15
|
+
*
|
|
16
|
+
* @param ctx - Optional RequestContext containing `traceId` and `spanId`
|
|
17
|
+
* @returns Formatted `traceparent` string (e.g., `00-<traceId>-<spanId>-01`), or `undefined`
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* const traceparent = buildTraceparent(requestContext);
|
|
22
|
+
* if (traceparent) {
|
|
23
|
+
* fetch(url, { headers: { traceparent } });
|
|
24
|
+
* }
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export function buildTraceparent(ctx) {
|
|
28
|
+
const traceId = ctx?.traceId ?? trace.getActiveSpan()?.spanContext().traceId;
|
|
29
|
+
const spanId = ctx?.spanId ?? trace.getActiveSpan()?.spanContext().spanId;
|
|
30
|
+
if (!traceId || !spanId)
|
|
31
|
+
return;
|
|
32
|
+
// We do not currently read flags reliably from context; assume sampled
|
|
33
|
+
return `00-${traceId}-${spanId}-01`;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Extracts W3C traceparent from headers and returns parsed trace/span IDs.
|
|
37
|
+
* Returns undefined if header is missing or malformed.
|
|
38
|
+
*
|
|
39
|
+
* @param headers - Headers object (Web API Headers or plain object)
|
|
40
|
+
* @returns Parsed traceparent info or undefined
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```typescript
|
|
44
|
+
* // Extract trace context from incoming request
|
|
45
|
+
* const trace = extractTraceparent(request.headers);
|
|
46
|
+
* if (trace) {
|
|
47
|
+
* logger.info('Processing with parent trace', {
|
|
48
|
+
* traceId: trace.traceId,
|
|
49
|
+
* sampled: trace.sampled
|
|
50
|
+
* });
|
|
51
|
+
* }
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
export function extractTraceparent(headers) {
|
|
55
|
+
const headerValue = headers instanceof Headers ? headers.get('traceparent') : headers.traceparent;
|
|
56
|
+
if (!headerValue)
|
|
57
|
+
return;
|
|
58
|
+
// W3C traceparent format: 00-{traceId}-{spanId}-{flags}
|
|
59
|
+
const match = /^00-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/.exec(headerValue);
|
|
60
|
+
if (!match || !match[1] || !match[2] || !match[3])
|
|
61
|
+
return;
|
|
62
|
+
return {
|
|
63
|
+
traceId: match[1],
|
|
64
|
+
spanId: match[2],
|
|
65
|
+
sampled: match[3] === '01',
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Creates a child RequestContext with parent trace context extracted from headers.
|
|
70
|
+
* Useful for propagating trace context from incoming HTTP requests.
|
|
71
|
+
*
|
|
72
|
+
* @param parentHeaders - Headers containing traceparent
|
|
73
|
+
* @param operation - Operation name for the new context
|
|
74
|
+
* @returns New RequestContext with inherited trace context
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```typescript
|
|
78
|
+
* // In HTTP handler
|
|
79
|
+
* const context = createContextWithParentTrace(
|
|
80
|
+
* request.headers,
|
|
81
|
+
* 'handleApiRequest'
|
|
82
|
+
* );
|
|
83
|
+
* logger.info('Processing request', context);
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
export function createContextWithParentTrace(parentHeaders, operation) {
|
|
87
|
+
const traceInfo = extractTraceparent(parentHeaders);
|
|
88
|
+
return requestContextService.createRequestContext({
|
|
89
|
+
operation,
|
|
90
|
+
...(traceInfo && {
|
|
91
|
+
traceId: traceInfo.traceId,
|
|
92
|
+
parentSpanId: traceInfo.spanId,
|
|
93
|
+
}),
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Injects the current active context into a carrier, returning it.
|
|
98
|
+
* Useful for HTTP headers: pass an object and use resulting key/values.
|
|
99
|
+
*
|
|
100
|
+
* @param carrier - Object to inject context into (typically headers)
|
|
101
|
+
* @returns Same carrier with injected trace context
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```typescript
|
|
105
|
+
* const headers = injectCurrentContextInto({
|
|
106
|
+
* 'Content-Type': 'application/json'
|
|
107
|
+
* });
|
|
108
|
+
* // headers now contains traceparent, tracestate, etc.
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
111
|
+
export function injectCurrentContextInto(carrier) {
|
|
112
|
+
propagation.inject(otContext.active(), carrier);
|
|
113
|
+
return carrier;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Creates a new span for manual instrumentation with automatic error handling.
|
|
117
|
+
* The span is automatically marked as OK on success or ERROR on exception.
|
|
118
|
+
* Errors are recorded as exceptions and automatically propagated.
|
|
119
|
+
*
|
|
120
|
+
* @param operationName - Name of the span (e.g., 'database.query', 'external.api')
|
|
121
|
+
* @param fn - Async function to execute within the span
|
|
122
|
+
* @param attributes - Optional attributes to attach to the span
|
|
123
|
+
* @returns Promise resolving to the function's return value
|
|
124
|
+
*
|
|
125
|
+
* @example
|
|
126
|
+
* ```typescript
|
|
127
|
+
* // Instrument a database query
|
|
128
|
+
* const users = await withSpan(
|
|
129
|
+
* 'database.query.users',
|
|
130
|
+
* async () => db.users.findMany(),
|
|
131
|
+
* { 'db.table': 'users', 'db.operation': 'select' }
|
|
132
|
+
* );
|
|
133
|
+
* ```
|
|
134
|
+
*/
|
|
135
|
+
export async function withSpan(operationName, fn, attributes) {
|
|
136
|
+
const tracer = trace.getTracer(config.openTelemetry.serviceName, config.openTelemetry.serviceVersion);
|
|
137
|
+
return await tracer.startActiveSpan(operationName, async (span) => {
|
|
138
|
+
if (attributes) {
|
|
139
|
+
span.setAttributes(attributes);
|
|
140
|
+
}
|
|
141
|
+
try {
|
|
142
|
+
const result = await fn(span);
|
|
143
|
+
span.setStatus({ code: SpanStatusCode.OK });
|
|
144
|
+
return result;
|
|
145
|
+
}
|
|
146
|
+
catch (error) {
|
|
147
|
+
span.recordException(error instanceof Error ? error : new Error(String(error)));
|
|
148
|
+
span.setStatus({
|
|
149
|
+
code: SpanStatusCode.ERROR,
|
|
150
|
+
message: error instanceof Error ? error.message : String(error),
|
|
151
|
+
});
|
|
152
|
+
throw error;
|
|
153
|
+
}
|
|
154
|
+
finally {
|
|
155
|
+
span.end();
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Runs a function within the currently active OpenTelemetry context.
|
|
161
|
+
* Useful for carrying the active context across async boundaries (e.g., `setTimeout`, `queueMicrotask`).
|
|
162
|
+
*
|
|
163
|
+
* **Limitation:** When `ctx` contains trace IDs, this function executes within the
|
|
164
|
+
* current active context rather than restoring `ctx`'s specific span context.
|
|
165
|
+
* Full span restoration would require span recreation, which this utility intentionally avoids.
|
|
166
|
+
* If `ctx` has no trace IDs, `fn` is called directly without any context wrapping.
|
|
167
|
+
*
|
|
168
|
+
* @param ctx - RequestContext containing trace IDs; if missing or lacking IDs, `fn` runs directly
|
|
169
|
+
* @param fn - Function to execute within the active OTel context
|
|
170
|
+
* @returns Result of `fn`
|
|
171
|
+
*
|
|
172
|
+
* @example
|
|
173
|
+
* ```typescript
|
|
174
|
+
* // Carry the active OTel context into a setTimeout callback
|
|
175
|
+
* const context = requestContextService.createRequestContext({ operation: 'delayed' });
|
|
176
|
+
* setTimeout(() => {
|
|
177
|
+
* runInContext(context, () => {
|
|
178
|
+
* logger.info('Still in trace context', context);
|
|
179
|
+
* });
|
|
180
|
+
* }, 1000);
|
|
181
|
+
* ```
|
|
182
|
+
*/
|
|
183
|
+
export function runInContext(ctx, fn) {
|
|
184
|
+
// If no trace context, run directly
|
|
185
|
+
if (!ctx?.traceId || !ctx?.spanId) {
|
|
186
|
+
return fn();
|
|
187
|
+
}
|
|
188
|
+
// Execute within the active context
|
|
189
|
+
// Note: Full context restoration would require span recreation
|
|
190
|
+
// This simplified version maintains execution but doesn't create new spans
|
|
191
|
+
return otContext.with(otContext.active(), fn);
|
|
192
|
+
}
|
|
193
|
+
//# sourceMappingURL=trace.js.map
|
|
@@ -0,0 +1 @@
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AC5C,OAAO,MAAM,CAAC;QAChB,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACxB,IAAI,CAAC,eAAe,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAChF,IAAI,CAAC,SAAS,CAAC;gBACb,IAAI,EAAE,cAAc,CAAC,KAAK;gBAC1B,OAAO,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;aAChE,CAAC,CAAC;YACH,MAAM,KAAK,CAAC;QACd,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,GAAG,EAAE,CAAC;QACb,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,YAAY,CAAI,GAA+B,EAAE,EAAW;IAC1E,oCAAoC;IACpC,IAAI,CAAC,GAAG,EAAE,OAAO,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,CAAC;QAClC,OAAO,EAAE,EAAE,CAAC;IACd,CAAC;IAED,oCAAoC;IACpC,+DAA+D;IAC/D,2EAA2E;IAC3E,OAAO,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Type guard utilities for safe runtime type narrowing.
|
|
3
|
+
* @module utils/types/guards
|
|
4
|
+
*
|
|
5
|
+
* Provides reusable type guards to replace unsafe type assertions throughout the codebase.
|
|
6
|
+
* All guards perform proper runtime validation and narrow TypeScript types safely.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Type guard to check if a value is a non-null object.
|
|
10
|
+
*
|
|
11
|
+
* @param value - Value to check
|
|
12
|
+
* @returns True if value is an object (excluding null and arrays)
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* if (isObject(someValue)) {
|
|
17
|
+
* // someValue is now typed as object
|
|
18
|
+
* console.log(someValue.toString());
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare function isObject(value: unknown): value is object;
|
|
23
|
+
/**
|
|
24
|
+
* Type guard to check if a value is a plain record (non-null, non-array object with string keys).
|
|
25
|
+
*
|
|
26
|
+
* Arrays are excluded — this guard is intended for key-value objects only.
|
|
27
|
+
* Delegates to {@link isObject} for the underlying check.
|
|
28
|
+
*
|
|
29
|
+
* @param value - Value to check
|
|
30
|
+
* @returns True if value is a `Record<string, unknown>` (plain object, not null, not an array)
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```typescript
|
|
34
|
+
* if (isRecord(data)) {
|
|
35
|
+
* // data is now typed as Record<string, unknown>
|
|
36
|
+
* const keys = Object.keys(data);
|
|
37
|
+
* }
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
41
|
+
/**
|
|
42
|
+
* Type guard to check if an object has a specific property.
|
|
43
|
+
*
|
|
44
|
+
* @param obj - Object to check
|
|
45
|
+
* @param key - Property key to look for
|
|
46
|
+
* @returns True if object has the specified property
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```typescript
|
|
50
|
+
* if (hasProperty(error, 'message')) {
|
|
51
|
+
* // TypeScript now knows error has a 'message' property
|
|
52
|
+
* console.log(error.message);
|
|
53
|
+
* }
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
export declare function hasProperty<K extends PropertyKey>(obj: unknown, key: K): obj is Record<K, unknown>;
|
|
57
|
+
/**
|
|
58
|
+
* Type guard to check if an object has a property of a specific type.
|
|
59
|
+
*
|
|
60
|
+
* @param obj - Object to check
|
|
61
|
+
* @param key - Property key to look for
|
|
62
|
+
* @param typeGuard - Type guard function for the property value
|
|
63
|
+
* @returns True if object has the property and it matches the type
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```typescript
|
|
67
|
+
* if (hasPropertyOfType(obj, 'count', (v): v is number => typeof v === 'number')) {
|
|
68
|
+
* // obj.count is now typed as number
|
|
69
|
+
* console.log(obj.count + 1);
|
|
70
|
+
* }
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
export declare function hasPropertyOfType<K extends PropertyKey, T>(obj: unknown, key: K, typeGuard: (value: unknown) => value is T): obj is Record<K, T>;
|
|
74
|
+
/**
|
|
75
|
+
* Type guard to check if a value is a string.
|
|
76
|
+
*
|
|
77
|
+
* @param value - Value to check
|
|
78
|
+
* @returns True if value is a string
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* ```typescript
|
|
82
|
+
* if (isString(value)) {
|
|
83
|
+
* // value is now typed as string
|
|
84
|
+
* console.log(value.toUpperCase());
|
|
85
|
+
* }
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
export declare function isString(value: unknown): value is string;
|
|
89
|
+
/**
|
|
90
|
+
* Type guard to check if a value is a number.
|
|
91
|
+
*
|
|
92
|
+
* `NaN` is explicitly excluded — `typeof NaN === 'number'` is true in JavaScript,
|
|
93
|
+
* but `NaN` is almost never a valid value in the contexts where this guard is used.
|
|
94
|
+
*
|
|
95
|
+
* @param value - Value to check
|
|
96
|
+
* @returns True if value is a finite or infinite number (excluding NaN)
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* ```typescript
|
|
100
|
+
* if (isNumber(value)) {
|
|
101
|
+
* // value is now typed as number (NaN excluded)
|
|
102
|
+
* console.log(value.toFixed(2));
|
|
103
|
+
* }
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
export declare function isNumber(value: unknown): value is number;
|
|
107
|
+
/**
|
|
108
|
+
* Type guard to check if an error is an AggregateError.
|
|
109
|
+
*
|
|
110
|
+
* AggregateError contains multiple errors in an 'errors' array property.
|
|
111
|
+
* This guard safely checks for the errors property without unsafe type assertions.
|
|
112
|
+
*
|
|
113
|
+
* @param error - Error to check
|
|
114
|
+
* @returns True if error is an AggregateError with errors array
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* ```typescript
|
|
118
|
+
* if (isAggregateError(error)) {
|
|
119
|
+
* // error.errors is now safely typed as unknown[]
|
|
120
|
+
* error.errors.forEach(innerError => console.log(innerError));
|
|
121
|
+
* }
|
|
122
|
+
* ```
|
|
123
|
+
*/
|
|
124
|
+
export declare function isAggregateError(error: unknown): error is Error & {
|
|
125
|
+
errors: unknown[];
|
|
126
|
+
};
|
|
127
|
+
/**
|
|
128
|
+
* Type guard to check if an error has a code property.
|
|
129
|
+
*
|
|
130
|
+
* @param error - Error to check
|
|
131
|
+
* @returns True if error has a code property
|
|
132
|
+
*
|
|
133
|
+
* @example
|
|
134
|
+
* ```typescript
|
|
135
|
+
* if (isErrorWithCode(error)) {
|
|
136
|
+
* console.log(`Error code: ${error.code}`);
|
|
137
|
+
* }
|
|
138
|
+
* ```
|
|
139
|
+
*/
|
|
140
|
+
export declare function isErrorWithCode(error: unknown): error is Error & {
|
|
141
|
+
code: unknown;
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* Type guard to check if an error has a status property.
|
|
145
|
+
*
|
|
146
|
+
* @param error - Error to check
|
|
147
|
+
* @returns True if error has a status property
|
|
148
|
+
*
|
|
149
|
+
* @example
|
|
150
|
+
* ```typescript
|
|
151
|
+
* if (isErrorWithStatus(error)) {
|
|
152
|
+
* console.log(`HTTP status: ${error.status}`);
|
|
153
|
+
* }
|
|
154
|
+
* ```
|
|
155
|
+
*/
|
|
156
|
+
export declare function isErrorWithStatus(error: unknown): error is Error & {
|
|
157
|
+
status: unknown;
|
|
158
|
+
};
|
|
159
|
+
/**
|
|
160
|
+
* Safely get a property from an object if it exists.
|
|
161
|
+
*
|
|
162
|
+
* @param obj - Object to get property from
|
|
163
|
+
* @param key - Property key
|
|
164
|
+
* @returns Property value or undefined if property doesn't exist
|
|
165
|
+
*
|
|
166
|
+
* @example
|
|
167
|
+
* ```typescript
|
|
168
|
+
* const message = getProperty(error, 'message');
|
|
169
|
+
* // message is typed as unknown
|
|
170
|
+
* ```
|
|
171
|
+
*/
|
|
172
|
+
export declare function getProperty<K extends PropertyKey>(obj: unknown, key: K): unknown;
|
|
173
|
+
/**
|
|
174
|
+
* Safely get a string property from an object.
|
|
175
|
+
*
|
|
176
|
+
* @param obj - Object to get property from
|
|
177
|
+
* @param key - Property key
|
|
178
|
+
* @returns String value or undefined if property doesn't exist or is not a string
|
|
179
|
+
*
|
|
180
|
+
* @example
|
|
181
|
+
* ```typescript
|
|
182
|
+
* const traceId = getStringProperty(context, 'traceId');
|
|
183
|
+
* if (traceId) {
|
|
184
|
+
* // traceId is typed as string
|
|
185
|
+
* console.log(traceId.toUpperCase());
|
|
186
|
+
* }
|
|
187
|
+
* ```
|
|
188
|
+
*/
|
|
189
|
+
export declare function getStringProperty<K extends PropertyKey>(obj: unknown, key: K): string | undefined;
|
|
190
|
+
/**
|
|
191
|
+
* Safely get a number property from an object.
|
|
192
|
+
*
|
|
193
|
+
* Returns `undefined` if the property is absent, not a number, or is `NaN`.
|
|
194
|
+
*
|
|
195
|
+
* @param obj - Object to get property from
|
|
196
|
+
* @param key - Property key
|
|
197
|
+
* @returns Number value or undefined if property doesn't exist, is not a number, or is NaN
|
|
198
|
+
*
|
|
199
|
+
* @example
|
|
200
|
+
* ```typescript
|
|
201
|
+
* const retries = getNumberProperty(config, 'maxRetries');
|
|
202
|
+
* if (retries !== undefined) {
|
|
203
|
+
* // retries is typed as number
|
|
204
|
+
* console.log(`Max retries: ${retries}`);
|
|
205
|
+
* }
|
|
206
|
+
* ```
|
|
207
|
+
*/
|
|
208
|
+
export declare function getNumberProperty<K extends PropertyKey>(obj: unknown, key: K): number | undefined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