@nexus-cortex/core 4.26.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/LICENSE +202 -0
- package/NOTICE +2 -0
- package/README.md +13 -0
- package/dist/adapters/AdapterRegistry.d.ts +118 -0
- package/dist/adapters/AdapterRegistry.d.ts.map +1 -0
- package/dist/adapters/AdapterRegistry.js +195 -0
- package/dist/adapters/AdapterRegistry.js.map +1 -0
- package/dist/adapters/ChatCompletionsAPIAdapter.d.ts +254 -0
- package/dist/adapters/ChatCompletionsAPIAdapter.d.ts.map +1 -0
- package/dist/adapters/ChatCompletionsAPIAdapter.js +531 -0
- package/dist/adapters/ChatCompletionsAPIAdapter.js.map +1 -0
- package/dist/adapters/FormatAdapter.interface.d.ts +66 -0
- package/dist/adapters/FormatAdapter.interface.d.ts.map +1 -0
- package/dist/adapters/FormatAdapter.interface.js +89 -0
- package/dist/adapters/FormatAdapter.interface.js.map +1 -0
- package/dist/adapters/GatewayTranslationLayer.d.ts +222 -0
- package/dist/adapters/GatewayTranslationLayer.d.ts.map +1 -0
- package/dist/adapters/GatewayTranslationLayer.js +679 -0
- package/dist/adapters/GatewayTranslationLayer.js.map +1 -0
- package/dist/adapters/GenerateContentAPIAdapter.d.ts +240 -0
- package/dist/adapters/GenerateContentAPIAdapter.d.ts.map +1 -0
- package/dist/adapters/GenerateContentAPIAdapter.js +489 -0
- package/dist/adapters/GenerateContentAPIAdapter.js.map +1 -0
- package/dist/adapters/GoogleGenAPIAdapter.d.ts +217 -0
- package/dist/adapters/GoogleGenAPIAdapter.d.ts.map +1 -0
- package/dist/adapters/GoogleGenAPIAdapter.js +310 -0
- package/dist/adapters/GoogleGenAPIAdapter.js.map +1 -0
- package/dist/adapters/MessagesAPIAdapter.d.ts +280 -0
- package/dist/adapters/MessagesAPIAdapter.d.ts.map +1 -0
- package/dist/adapters/MessagesAPIAdapter.js +586 -0
- package/dist/adapters/MessagesAPIAdapter.js.map +1 -0
- package/dist/adapters/ResponsesAPIAdapter.d.ts +323 -0
- package/dist/adapters/ResponsesAPIAdapter.d.ts.map +1 -0
- package/dist/adapters/ResponsesAPIAdapter.js +584 -0
- package/dist/adapters/ResponsesAPIAdapter.js.map +1 -0
- package/dist/adapters/ServerSideToolDetection.d.ts +105 -0
- package/dist/adapters/ServerSideToolDetection.d.ts.map +1 -0
- package/dist/adapters/ServerSideToolDetection.js +249 -0
- package/dist/adapters/ServerSideToolDetection.js.map +1 -0
- package/dist/adapters/ToolNamingHandler.d.ts +129 -0
- package/dist/adapters/ToolNamingHandler.d.ts.map +1 -0
- package/dist/adapters/ToolNamingHandler.js +227 -0
- package/dist/adapters/ToolNamingHandler.js.map +1 -0
- package/dist/adapters/index.d.ts +19 -0
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/adapters/index.js +23 -0
- package/dist/adapters/index.js.map +1 -0
- package/dist/adapters/node/NodeConfigProvider.d.ts +19 -0
- package/dist/adapters/node/NodeConfigProvider.d.ts.map +1 -0
- package/dist/adapters/node/NodeConfigProvider.js +37 -0
- package/dist/adapters/node/NodeConfigProvider.js.map +1 -0
- package/dist/adapters/node/NodeHistoryStoreAdapter.d.ts +26 -0
- package/dist/adapters/node/NodeHistoryStoreAdapter.d.ts.map +1 -0
- package/dist/adapters/node/NodeHistoryStoreAdapter.js +61 -0
- package/dist/adapters/node/NodeHistoryStoreAdapter.js.map +1 -0
- package/dist/adapters/node/NodePermissionAdapter.d.ts +21 -0
- package/dist/adapters/node/NodePermissionAdapter.d.ts.map +1 -0
- package/dist/adapters/node/NodePermissionAdapter.js +39 -0
- package/dist/adapters/node/NodePermissionAdapter.js.map +1 -0
- package/dist/adapters/node/NodeToolExecutorAdapter.d.ts +22 -0
- package/dist/adapters/node/NodeToolExecutorAdapter.d.ts.map +1 -0
- package/dist/adapters/node/NodeToolExecutorAdapter.js +33 -0
- package/dist/adapters/node/NodeToolExecutorAdapter.js.map +1 -0
- package/dist/adapters/node/index.d.ts +18 -0
- package/dist/adapters/node/index.d.ts.map +1 -0
- package/dist/adapters/node/index.js +18 -0
- package/dist/adapters/node/index.js.map +1 -0
- package/dist/agents/AgentStore.d.ts +172 -0
- package/dist/agents/AgentStore.d.ts.map +1 -0
- package/dist/agents/AgentStore.js +649 -0
- package/dist/agents/AgentStore.js.map +1 -0
- package/dist/agents/index.d.ts +9 -0
- package/dist/agents/index.d.ts.map +1 -0
- package/dist/agents/index.js +8 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/agents/projectRoot.d.ts +2 -0
- package/dist/agents/projectRoot.d.ts.map +1 -0
- package/dist/agents/projectRoot.js +37 -0
- package/dist/agents/projectRoot.js.map +1 -0
- package/dist/commands/SlashCommandCompleter.d.ts +116 -0
- package/dist/commands/SlashCommandCompleter.d.ts.map +1 -0
- package/dist/commands/SlashCommandCompleter.js +321 -0
- package/dist/commands/SlashCommandCompleter.js.map +1 -0
- package/dist/commands/SlashCommandParser.d.ts +139 -0
- package/dist/commands/SlashCommandParser.d.ts.map +1 -0
- package/dist/commands/SlashCommandParser.js +338 -0
- package/dist/commands/SlashCommandParser.js.map +1 -0
- package/dist/commands/SlashCommandRegistry.d.ts +92 -0
- package/dist/commands/SlashCommandRegistry.d.ts.map +1 -0
- package/dist/commands/SlashCommandRegistry.js +983 -0
- package/dist/commands/SlashCommandRegistry.js.map +1 -0
- package/dist/commands/index.d.ts +13 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +15 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/types.d.ts +154 -0
- package/dist/commands/types.d.ts.map +1 -0
- package/dist/commands/types.js +10 -0
- package/dist/commands/types.js.map +1 -0
- package/dist/config/AnthropicCredentialService.d.ts +107 -0
- package/dist/config/AnthropicCredentialService.d.ts.map +1 -0
- package/dist/config/AnthropicCredentialService.js +209 -0
- package/dist/config/AnthropicCredentialService.js.map +1 -0
- package/dist/config/InteractiveConfigurator.d.ts +26 -0
- package/dist/config/InteractiveConfigurator.d.ts.map +1 -0
- package/dist/config/InteractiveConfigurator.js +330 -0
- package/dist/config/InteractiveConfigurator.js.map +1 -0
- package/dist/config/MentorshipConfigService.d.ts +90 -0
- package/dist/config/MentorshipConfigService.d.ts.map +1 -0
- package/dist/config/MentorshipConfigService.js +318 -0
- package/dist/config/MentorshipConfigService.js.map +1 -0
- package/dist/config/RuntimeConfigRegistry.d.ts +20 -0
- package/dist/config/RuntimeConfigRegistry.d.ts.map +1 -0
- package/dist/config/RuntimeConfigRegistry.js +57 -0
- package/dist/config/RuntimeConfigRegistry.js.map +1 -0
- package/dist/config/SettingsLoader.d.ts +128 -0
- package/dist/config/SettingsLoader.d.ts.map +1 -0
- package/dist/config/SettingsLoader.js +487 -0
- package/dist/config/SettingsLoader.js.map +1 -0
- package/dist/config/SettingsSchema.d.ts +219 -0
- package/dist/config/SettingsSchema.d.ts.map +1 -0
- package/dist/config/SettingsSchema.js +855 -0
- package/dist/config/SettingsSchema.js.map +1 -0
- package/dist/config/SettingsWriter.d.ts +83 -0
- package/dist/config/SettingsWriter.d.ts.map +1 -0
- package/dist/config/SettingsWriter.js +256 -0
- package/dist/config/SettingsWriter.js.map +1 -0
- package/dist/config/index.d.ts +13 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +13 -0
- package/dist/config/index.js.map +1 -0
- package/dist/conversation/ContextBudgetManager.d.ts +172 -0
- package/dist/conversation/ContextBudgetManager.d.ts.map +1 -0
- package/dist/conversation/ContextBudgetManager.js +445 -0
- package/dist/conversation/ContextBudgetManager.js.map +1 -0
- package/dist/conversation/StoredCompactionManager.d.ts +208 -0
- package/dist/conversation/StoredCompactionManager.d.ts.map +1 -0
- package/dist/conversation/StoredCompactionManager.js +314 -0
- package/dist/conversation/StoredCompactionManager.js.map +1 -0
- package/dist/conversation/SummaryTemplates.d.ts +35 -0
- package/dist/conversation/SummaryTemplates.d.ts.map +1 -0
- package/dist/conversation/SummaryTemplates.js +174 -0
- package/dist/conversation/SummaryTemplates.js.map +1 -0
- package/dist/conversation/index.d.ts +8 -0
- package/dist/conversation/index.d.ts.map +1 -0
- package/dist/conversation/index.js +8 -0
- package/dist/conversation/index.js.map +1 -0
- package/dist/file-tracking/ContentAddressableStore.d.ts +86 -0
- package/dist/file-tracking/ContentAddressableStore.d.ts.map +1 -0
- package/dist/file-tracking/ContentAddressableStore.js +187 -0
- package/dist/file-tracking/ContentAddressableStore.js.map +1 -0
- package/dist/file-tracking/FileCheckpointManager.d.ts +103 -0
- package/dist/file-tracking/FileCheckpointManager.d.ts.map +1 -0
- package/dist/file-tracking/FileCheckpointManager.js +269 -0
- package/dist/file-tracking/FileCheckpointManager.js.map +1 -0
- package/dist/file-tracking/index.d.ts +7 -0
- package/dist/file-tracking/index.d.ts.map +1 -0
- package/dist/file-tracking/index.js +7 -0
- package/dist/file-tracking/index.js.map +1 -0
- package/dist/index.d.ts +54 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +73 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces/APITransport.d.ts +120 -0
- package/dist/interfaces/APITransport.d.ts.map +1 -0
- package/dist/interfaces/APITransport.js +14 -0
- package/dist/interfaces/APITransport.js.map +1 -0
- package/dist/interfaces/ConfigProvider.d.ts +52 -0
- package/dist/interfaces/ConfigProvider.d.ts.map +1 -0
- package/dist/interfaces/ConfigProvider.js +14 -0
- package/dist/interfaces/ConfigProvider.js.map +1 -0
- package/dist/interfaces/CredentialResolver.d.ts +57 -0
- package/dist/interfaces/CredentialResolver.d.ts.map +1 -0
- package/dist/interfaces/CredentialResolver.js +13 -0
- package/dist/interfaces/CredentialResolver.js.map +1 -0
- package/dist/interfaces/HistoryStore.d.ts +108 -0
- package/dist/interfaces/HistoryStore.d.ts.map +1 -0
- package/dist/interfaces/HistoryStore.js +14 -0
- package/dist/interfaces/HistoryStore.js.map +1 -0
- package/dist/interfaces/PermissionHandler.d.ts +74 -0
- package/dist/interfaces/PermissionHandler.d.ts.map +1 -0
- package/dist/interfaces/PermissionHandler.js +13 -0
- package/dist/interfaces/PermissionHandler.js.map +1 -0
- package/dist/interfaces/ToolExecutorRegistry.d.ts +126 -0
- package/dist/interfaces/ToolExecutorRegistry.d.ts.map +1 -0
- package/dist/interfaces/ToolExecutorRegistry.js +14 -0
- package/dist/interfaces/ToolExecutorRegistry.js.map +1 -0
- package/dist/interfaces/index.d.ts +19 -0
- package/dist/interfaces/index.d.ts.map +1 -0
- package/dist/interfaces/index.js +14 -0
- package/dist/interfaces/index.js.map +1 -0
- package/dist/mcp/McpClient.d.ts +142 -0
- package/dist/mcp/McpClient.d.ts.map +1 -0
- package/dist/mcp/McpClient.js +349 -0
- package/dist/mcp/McpClient.js.map +1 -0
- package/dist/mcp/McpClientManager.d.ts +148 -0
- package/dist/mcp/McpClientManager.d.ts.map +1 -0
- package/dist/mcp/McpClientManager.js +366 -0
- package/dist/mcp/McpClientManager.js.map +1 -0
- package/dist/mcp/McpConfigManager.d.ts +125 -0
- package/dist/mcp/McpConfigManager.d.ts.map +1 -0
- package/dist/mcp/McpConfigManager.js +448 -0
- package/dist/mcp/McpConfigManager.js.map +1 -0
- package/dist/mcp/McpServerRegistry.d.ts +102 -0
- package/dist/mcp/McpServerRegistry.d.ts.map +1 -0
- package/dist/mcp/McpServerRegistry.js +281 -0
- package/dist/mcp/McpServerRegistry.js.map +1 -0
- package/dist/mcp/index.d.ts +11 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +9 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/mcpToolNamespacing.d.ts +26 -0
- package/dist/mcp/mcpToolNamespacing.d.ts.map +1 -0
- package/dist/mcp/mcpToolNamespacing.js +36 -0
- package/dist/mcp/mcpToolNamespacing.js.map +1 -0
- package/dist/mcp/test-mcp-integration.d.ts +8 -0
- package/dist/mcp/test-mcp-integration.d.ts.map +1 -0
- package/dist/mcp/test-mcp-integration.js +115 -0
- package/dist/mcp/test-mcp-integration.js.map +1 -0
- package/dist/middleware/ErrorClassificationMiddleware.d.ts +116 -0
- package/dist/middleware/ErrorClassificationMiddleware.d.ts.map +1 -0
- package/dist/middleware/ErrorClassificationMiddleware.js +225 -0
- package/dist/middleware/ErrorClassificationMiddleware.js.map +1 -0
- package/dist/middleware/HelperModelMiddleware.d.ts +337 -0
- package/dist/middleware/HelperModelMiddleware.d.ts.map +1 -0
- package/dist/middleware/HelperModelMiddleware.js +1376 -0
- package/dist/middleware/HelperModelMiddleware.js.map +1 -0
- package/dist/middleware/MentorshipMiddleware.d.ts +210 -0
- package/dist/middleware/MentorshipMiddleware.d.ts.map +1 -0
- package/dist/middleware/MentorshipMiddleware.js +427 -0
- package/dist/middleware/MentorshipMiddleware.js.map +1 -0
- package/dist/middleware/PermissionsMiddleware.d.ts +193 -0
- package/dist/middleware/PermissionsMiddleware.d.ts.map +1 -0
- package/dist/middleware/PermissionsMiddleware.js +344 -0
- package/dist/middleware/PermissionsMiddleware.js.map +1 -0
- package/dist/middleware/RetryMiddleware.d.ts +159 -0
- package/dist/middleware/RetryMiddleware.d.ts.map +1 -0
- package/dist/middleware/RetryMiddleware.js +268 -0
- package/dist/middleware/RetryMiddleware.js.map +1 -0
- package/dist/middleware/SystemMessageMiddleware.d.ts +165 -0
- package/dist/middleware/SystemMessageMiddleware.d.ts.map +1 -0
- package/dist/middleware/SystemMessageMiddleware.js +354 -0
- package/dist/middleware/SystemMessageMiddleware.js.map +1 -0
- package/dist/middleware/contracts/MiddlewareContracts.d.ts +294 -0
- package/dist/middleware/contracts/MiddlewareContracts.d.ts.map +1 -0
- package/dist/middleware/contracts/MiddlewareContracts.js +12 -0
- package/dist/middleware/contracts/MiddlewareContracts.js.map +1 -0
- package/dist/middleware/helpers/HelperMiddlewareAdapter.interface.d.ts +211 -0
- package/dist/middleware/helpers/HelperMiddlewareAdapter.interface.d.ts.map +1 -0
- package/dist/middleware/helpers/HelperMiddlewareAdapter.interface.js +211 -0
- package/dist/middleware/helpers/HelperMiddlewareAdapter.interface.js.map +1 -0
- package/dist/middleware/helpers/HelperModelMiddlewareRegistry.d.ts +106 -0
- package/dist/middleware/helpers/HelperModelMiddlewareRegistry.d.ts.map +1 -0
- package/dist/middleware/helpers/HelperModelMiddlewareRegistry.js +148 -0
- package/dist/middleware/helpers/HelperModelMiddlewareRegistry.js.map +1 -0
- package/dist/middleware/helpers/adapters/ChatCompletionsAPIHelperAdapter.d.ts +76 -0
- package/dist/middleware/helpers/adapters/ChatCompletionsAPIHelperAdapter.d.ts.map +1 -0
- package/dist/middleware/helpers/adapters/ChatCompletionsAPIHelperAdapter.js +277 -0
- package/dist/middleware/helpers/adapters/ChatCompletionsAPIHelperAdapter.js.map +1 -0
- package/dist/middleware/helpers/adapters/GenerateContentAPIHelperAdapter.d.ts +57 -0
- package/dist/middleware/helpers/adapters/GenerateContentAPIHelperAdapter.d.ts.map +1 -0
- package/dist/middleware/helpers/adapters/GenerateContentAPIHelperAdapter.js +155 -0
- package/dist/middleware/helpers/adapters/GenerateContentAPIHelperAdapter.js.map +1 -0
- package/dist/middleware/helpers/adapters/GoogleGenAPIHelperAdapter.d.ts +124 -0
- package/dist/middleware/helpers/adapters/GoogleGenAPIHelperAdapter.d.ts.map +1 -0
- package/dist/middleware/helpers/adapters/GoogleGenAPIHelperAdapter.js +276 -0
- package/dist/middleware/helpers/adapters/GoogleGenAPIHelperAdapter.js.map +1 -0
- package/dist/middleware/helpers/adapters/MessagesAPIHelperAdapter.d.ts +71 -0
- package/dist/middleware/helpers/adapters/MessagesAPIHelperAdapter.d.ts.map +1 -0
- package/dist/middleware/helpers/adapters/MessagesAPIHelperAdapter.js +264 -0
- package/dist/middleware/helpers/adapters/MessagesAPIHelperAdapter.js.map +1 -0
- package/dist/middleware/helpers/adapters/ResponsesAPIHelperAdapter.d.ts +64 -0
- package/dist/middleware/helpers/adapters/ResponsesAPIHelperAdapter.d.ts.map +1 -0
- package/dist/middleware/helpers/adapters/ResponsesAPIHelperAdapter.js +189 -0
- package/dist/middleware/helpers/adapters/ResponsesAPIHelperAdapter.js.map +1 -0
- package/dist/middleware/helpers/adapters/index.d.ts +31 -0
- package/dist/middleware/helpers/adapters/index.d.ts.map +1 -0
- package/dist/middleware/helpers/adapters/index.js +40 -0
- package/dist/middleware/helpers/adapters/index.js.map +1 -0
- package/dist/middleware/helpers/index.d.ts +10 -0
- package/dist/middleware/helpers/index.d.ts.map +1 -0
- package/dist/middleware/helpers/index.js +13 -0
- package/dist/middleware/helpers/index.js.map +1 -0
- package/dist/middleware/index.d.ts +12 -0
- package/dist/middleware/index.d.ts.map +1 -0
- package/dist/middleware/index.js +13 -0
- package/dist/middleware/index.js.map +1 -0
- package/dist/middleware/permissions/ApprovalHandler.d.ts +22 -0
- package/dist/middleware/permissions/ApprovalHandler.d.ts.map +1 -0
- package/dist/middleware/permissions/ApprovalHandler.js +27 -0
- package/dist/middleware/permissions/ApprovalHandler.js.map +1 -0
- package/dist/middleware/permissions/AutoApproveHandler.d.ts +62 -0
- package/dist/middleware/permissions/AutoApproveHandler.d.ts.map +1 -0
- package/dist/middleware/permissions/AutoApproveHandler.js +68 -0
- package/dist/middleware/permissions/AutoApproveHandler.js.map +1 -0
- package/dist/middleware/permissions/BashCommandPolicy.d.ts +134 -0
- package/dist/middleware/permissions/BashCommandPolicy.d.ts.map +1 -0
- package/dist/middleware/permissions/BashCommandPolicy.js +239 -0
- package/dist/middleware/permissions/BashCommandPolicy.js.map +1 -0
- package/dist/middleware/permissions/BlacklistPolicy.d.ts +66 -0
- package/dist/middleware/permissions/BlacklistPolicy.d.ts.map +1 -0
- package/dist/middleware/permissions/BlacklistPolicy.js +82 -0
- package/dist/middleware/permissions/BlacklistPolicy.js.map +1 -0
- package/dist/middleware/permissions/CLIApprovalHandler.d.ts +124 -0
- package/dist/middleware/permissions/CLIApprovalHandler.d.ts.map +1 -0
- package/dist/middleware/permissions/CLIApprovalHandler.js +366 -0
- package/dist/middleware/permissions/CLIApprovalHandler.js.map +1 -0
- package/dist/middleware/permissions/DefaultPolicies.d.ts +53 -0
- package/dist/middleware/permissions/DefaultPolicies.d.ts.map +1 -0
- package/dist/middleware/permissions/DefaultPolicies.js +307 -0
- package/dist/middleware/permissions/DefaultPolicies.js.map +1 -0
- package/dist/middleware/permissions/DenyAllHandler.d.ts +58 -0
- package/dist/middleware/permissions/DenyAllHandler.d.ts.map +1 -0
- package/dist/middleware/permissions/DenyAllHandler.js +59 -0
- package/dist/middleware/permissions/DenyAllHandler.js.map +1 -0
- package/dist/middleware/permissions/FileOperationPolicy.d.ts +117 -0
- package/dist/middleware/permissions/FileOperationPolicy.d.ts.map +1 -0
- package/dist/middleware/permissions/FileOperationPolicy.js +222 -0
- package/dist/middleware/permissions/FileOperationPolicy.js.map +1 -0
- package/dist/middleware/permissions/IPCApprovalHandler.d.ts +94 -0
- package/dist/middleware/permissions/IPCApprovalHandler.d.ts.map +1 -0
- package/dist/middleware/permissions/IPCApprovalHandler.js +178 -0
- package/dist/middleware/permissions/IPCApprovalHandler.js.map +1 -0
- package/dist/middleware/permissions/PermissionAuditLogger.d.ts +169 -0
- package/dist/middleware/permissions/PermissionAuditLogger.d.ts.map +1 -0
- package/dist/middleware/permissions/PermissionAuditLogger.js +267 -0
- package/dist/middleware/permissions/PermissionAuditLogger.js.map +1 -0
- package/dist/middleware/permissions/PermissionConfig.d.ts +181 -0
- package/dist/middleware/permissions/PermissionConfig.d.ts.map +1 -0
- package/dist/middleware/permissions/PermissionConfig.js +110 -0
- package/dist/middleware/permissions/PermissionConfig.js.map +1 -0
- package/dist/middleware/permissions/PermissionConfigLoader.d.ts +89 -0
- package/dist/middleware/permissions/PermissionConfigLoader.d.ts.map +1 -0
- package/dist/middleware/permissions/PermissionConfigLoader.js +296 -0
- package/dist/middleware/permissions/PermissionConfigLoader.js.map +1 -0
- package/dist/middleware/permissions/PermissionEvaluator.d.ts +111 -0
- package/dist/middleware/permissions/PermissionEvaluator.d.ts.map +1 -0
- package/dist/middleware/permissions/PermissionEvaluator.js +196 -0
- package/dist/middleware/permissions/PermissionEvaluator.js.map +1 -0
- package/dist/middleware/permissions/PermissionPolicy.d.ts +59 -0
- package/dist/middleware/permissions/PermissionPolicy.d.ts.map +1 -0
- package/dist/middleware/permissions/PermissionPolicy.js +67 -0
- package/dist/middleware/permissions/PermissionPolicy.js.map +1 -0
- package/dist/middleware/permissions/PermissionProfileStore.d.ts +77 -0
- package/dist/middleware/permissions/PermissionProfileStore.d.ts.map +1 -0
- package/dist/middleware/permissions/PermissionProfileStore.js +167 -0
- package/dist/middleware/permissions/PermissionProfileStore.js.map +1 -0
- package/dist/middleware/permissions/WhitelistPolicy.d.ts +66 -0
- package/dist/middleware/permissions/WhitelistPolicy.d.ts.map +1 -0
- package/dist/middleware/permissions/WhitelistPolicy.js +82 -0
- package/dist/middleware/permissions/WhitelistPolicy.js.map +1 -0
- package/dist/middleware/permissions/index.d.ts +40 -0
- package/dist/middleware/permissions/index.d.ts.map +1 -0
- package/dist/middleware/permissions/index.js +30 -0
- package/dist/middleware/permissions/index.js.map +1 -0
- package/dist/middleware/permissions/profilePath.d.ts +15 -0
- package/dist/middleware/permissions/profilePath.d.ts.map +1 -0
- package/dist/middleware/permissions/profilePath.js +35 -0
- package/dist/middleware/permissions/profilePath.js.map +1 -0
- package/dist/models/ModelConfig.interface.d.ts +18 -0
- package/dist/models/ModelConfig.interface.d.ts.map +1 -0
- package/dist/models/ModelConfig.interface.js +157 -0
- package/dist/models/ModelConfig.interface.js.map +1 -0
- package/dist/models/cards/anthropic/claude-3-5-haiku.d.ts +11 -0
- package/dist/models/cards/anthropic/claude-3-5-haiku.d.ts.map +1 -0
- package/dist/models/cards/anthropic/claude-3-5-haiku.js +19 -0
- package/dist/models/cards/anthropic/claude-3-5-haiku.js.map +1 -0
- package/dist/models/cards/anthropic/claude-3-5-sonnet.d.ts +11 -0
- package/dist/models/cards/anthropic/claude-3-5-sonnet.d.ts.map +1 -0
- package/dist/models/cards/anthropic/claude-3-5-sonnet.js +19 -0
- package/dist/models/cards/anthropic/claude-3-5-sonnet.js.map +1 -0
- package/dist/models/cards/anthropic/claude-3-haiku.d.ts +11 -0
- package/dist/models/cards/anthropic/claude-3-haiku.d.ts.map +1 -0
- package/dist/models/cards/anthropic/claude-3-haiku.js +19 -0
- package/dist/models/cards/anthropic/claude-3-haiku.js.map +1 -0
- package/dist/models/cards/anthropic/claude-4-5-haiku.d.ts +11 -0
- package/dist/models/cards/anthropic/claude-4-5-haiku.d.ts.map +1 -0
- package/dist/models/cards/anthropic/claude-4-5-haiku.js +26 -0
- package/dist/models/cards/anthropic/claude-4-5-haiku.js.map +1 -0
- package/dist/models/cards/anthropic/claude-fable-5.d.ts +14 -0
- package/dist/models/cards/anthropic/claude-fable-5.d.ts.map +1 -0
- package/dist/models/cards/anthropic/claude-fable-5.js +30 -0
- package/dist/models/cards/anthropic/claude-fable-5.js.map +1 -0
- package/dist/models/cards/anthropic/claude-opus-4-1.d.ts +11 -0
- package/dist/models/cards/anthropic/claude-opus-4-1.d.ts.map +1 -0
- package/dist/models/cards/anthropic/claude-opus-4-1.js +19 -0
- package/dist/models/cards/anthropic/claude-opus-4-1.js.map +1 -0
- package/dist/models/cards/anthropic/claude-opus-4-5.d.ts +11 -0
- package/dist/models/cards/anthropic/claude-opus-4-5.d.ts.map +1 -0
- package/dist/models/cards/anthropic/claude-opus-4-5.js +27 -0
- package/dist/models/cards/anthropic/claude-opus-4-5.js.map +1 -0
- package/dist/models/cards/anthropic/claude-opus-4-6.d.ts +10 -0
- package/dist/models/cards/anthropic/claude-opus-4-6.d.ts.map +1 -0
- package/dist/models/cards/anthropic/claude-opus-4-6.js +26 -0
- package/dist/models/cards/anthropic/claude-opus-4-6.js.map +1 -0
- package/dist/models/cards/anthropic/claude-opus-4-7.d.ts +10 -0
- package/dist/models/cards/anthropic/claude-opus-4-7.d.ts.map +1 -0
- package/dist/models/cards/anthropic/claude-opus-4-7.js +26 -0
- package/dist/models/cards/anthropic/claude-opus-4-7.js.map +1 -0
- package/dist/models/cards/anthropic/claude-opus-4-8.d.ts +12 -0
- package/dist/models/cards/anthropic/claude-opus-4-8.d.ts.map +1 -0
- package/dist/models/cards/anthropic/claude-opus-4-8.js +28 -0
- package/dist/models/cards/anthropic/claude-opus-4-8.js.map +1 -0
- package/dist/models/cards/anthropic/claude-sonnet-4-5.d.ts +11 -0
- package/dist/models/cards/anthropic/claude-sonnet-4-5.d.ts.map +1 -0
- package/dist/models/cards/anthropic/claude-sonnet-4-5.js +27 -0
- package/dist/models/cards/anthropic/claude-sonnet-4-5.js.map +1 -0
- package/dist/models/cards/anthropic/claude-sonnet-4-6.d.ts +10 -0
- package/dist/models/cards/anthropic/claude-sonnet-4-6.d.ts.map +1 -0
- package/dist/models/cards/anthropic/claude-sonnet-4-6.js +26 -0
- package/dist/models/cards/anthropic/claude-sonnet-4-6.js.map +1 -0
- package/dist/models/cards/anthropic/claude-sonnet-4.d.ts +11 -0
- package/dist/models/cards/anthropic/claude-sonnet-4.d.ts.map +1 -0
- package/dist/models/cards/anthropic/claude-sonnet-4.js +19 -0
- package/dist/models/cards/anthropic/claude-sonnet-4.js.map +1 -0
- package/dist/models/cards/anthropic/index.d.ts +15 -0
- package/dist/models/cards/anthropic/index.d.ts.map +1 -0
- package/dist/models/cards/anthropic/index.js +15 -0
- package/dist/models/cards/anthropic/index.js.map +1 -0
- package/dist/models/cards/cloudflare/gemma-4-26b.d.ts +3 -0
- package/dist/models/cards/cloudflare/gemma-4-26b.d.ts.map +1 -0
- package/dist/models/cards/cloudflare/gemma-4-26b.js +17 -0
- package/dist/models/cards/cloudflare/gemma-4-26b.js.map +1 -0
- package/dist/models/cards/cloudflare/glm-4-7-flash.d.ts +3 -0
- package/dist/models/cards/cloudflare/glm-4-7-flash.d.ts.map +1 -0
- package/dist/models/cards/cloudflare/glm-4-7-flash.js +18 -0
- package/dist/models/cards/cloudflare/glm-4-7-flash.js.map +1 -0
- package/dist/models/cards/cloudflare/gpt-oss-120b.d.ts +3 -0
- package/dist/models/cards/cloudflare/gpt-oss-120b.d.ts.map +1 -0
- package/dist/models/cards/cloudflare/gpt-oss-120b.js +18 -0
- package/dist/models/cards/cloudflare/gpt-oss-120b.js.map +1 -0
- package/dist/models/cards/cloudflare/gpt-oss-20b.d.ts +3 -0
- package/dist/models/cards/cloudflare/gpt-oss-20b.d.ts.map +1 -0
- package/dist/models/cards/cloudflare/gpt-oss-20b.js +18 -0
- package/dist/models/cards/cloudflare/gpt-oss-20b.js.map +1 -0
- package/dist/models/cards/cloudflare/granite-4.d.ts +3 -0
- package/dist/models/cards/cloudflare/granite-4.d.ts.map +1 -0
- package/dist/models/cards/cloudflare/granite-4.js +17 -0
- package/dist/models/cards/cloudflare/granite-4.js.map +1 -0
- package/dist/models/cards/cloudflare/index.d.ts +24 -0
- package/dist/models/cards/cloudflare/index.d.ts.map +1 -0
- package/dist/models/cards/cloudflare/index.js +24 -0
- package/dist/models/cards/cloudflare/index.js.map +1 -0
- package/dist/models/cards/cloudflare/kimi-k2-5.d.ts +3 -0
- package/dist/models/cards/cloudflare/kimi-k2-5.d.ts.map +1 -0
- package/dist/models/cards/cloudflare/kimi-k2-5.js +17 -0
- package/dist/models/cards/cloudflare/kimi-k2-5.js.map +1 -0
- package/dist/models/cards/cloudflare/kimi-k2-6.d.ts +3 -0
- package/dist/models/cards/cloudflare/kimi-k2-6.d.ts.map +1 -0
- package/dist/models/cards/cloudflare/kimi-k2-6.js +20 -0
- package/dist/models/cards/cloudflare/kimi-k2-6.js.map +1 -0
- package/dist/models/cards/cloudflare/llama-3-3-70b.d.ts +3 -0
- package/dist/models/cards/cloudflare/llama-3-3-70b.d.ts.map +1 -0
- package/dist/models/cards/cloudflare/llama-3-3-70b.js +17 -0
- package/dist/models/cards/cloudflare/llama-3-3-70b.js.map +1 -0
- package/dist/models/cards/cloudflare/llama-4-scout.d.ts +3 -0
- package/dist/models/cards/cloudflare/llama-4-scout.d.ts.map +1 -0
- package/dist/models/cards/cloudflare/llama-4-scout.js +18 -0
- package/dist/models/cards/cloudflare/llama-4-scout.js.map +1 -0
- package/dist/models/cards/cloudflare/mistral-small-3-1.d.ts +3 -0
- package/dist/models/cards/cloudflare/mistral-small-3-1.d.ts.map +1 -0
- package/dist/models/cards/cloudflare/mistral-small-3-1.js +18 -0
- package/dist/models/cards/cloudflare/mistral-small-3-1.js.map +1 -0
- package/dist/models/cards/cloudflare/nemotron-3-120b.d.ts +3 -0
- package/dist/models/cards/cloudflare/nemotron-3-120b.d.ts.map +1 -0
- package/dist/models/cards/cloudflare/nemotron-3-120b.js +16 -0
- package/dist/models/cards/cloudflare/nemotron-3-120b.js.map +1 -0
- package/dist/models/cards/cloudflare/qwen3-30b.d.ts +3 -0
- package/dist/models/cards/cloudflare/qwen3-30b.d.ts.map +1 -0
- package/dist/models/cards/cloudflare/qwen3-30b.js +17 -0
- package/dist/models/cards/cloudflare/qwen3-30b.js.map +1 -0
- package/dist/models/cards/cloudflare/qwq-32b.d.ts +3 -0
- package/dist/models/cards/cloudflare/qwq-32b.d.ts.map +1 -0
- package/dist/models/cards/cloudflare/qwq-32b.js +18 -0
- package/dist/models/cards/cloudflare/qwq-32b.js.map +1 -0
- package/dist/models/cards/deepseek/deepseek-v4-flash.d.ts +11 -0
- package/dist/models/cards/deepseek/deepseek-v4-flash.d.ts.map +1 -0
- package/dist/models/cards/deepseek/deepseek-v4-flash.js +25 -0
- package/dist/models/cards/deepseek/deepseek-v4-flash.js.map +1 -0
- package/dist/models/cards/deepseek/deepseek-v4-pro.d.ts +11 -0
- package/dist/models/cards/deepseek/deepseek-v4-pro.d.ts.map +1 -0
- package/dist/models/cards/deepseek/deepseek-v4-pro.js +25 -0
- package/dist/models/cards/deepseek/deepseek-v4-pro.js.map +1 -0
- package/dist/models/cards/deepseek/index.d.ts +22 -0
- package/dist/models/cards/deepseek/index.d.ts.map +1 -0
- package/dist/models/cards/deepseek/index.js +22 -0
- package/dist/models/cards/deepseek/index.js.map +1 -0
- package/dist/models/cards/gemma/gemma-3-12b-it.d.ts +10 -0
- package/dist/models/cards/gemma/gemma-3-12b-it.d.ts.map +1 -0
- package/dist/models/cards/gemma/gemma-3-12b-it.js +16 -0
- package/dist/models/cards/gemma/gemma-3-12b-it.js.map +1 -0
- package/dist/models/cards/gemma/gemma-3-1b-it.d.ts +10 -0
- package/dist/models/cards/gemma/gemma-3-1b-it.d.ts.map +1 -0
- package/dist/models/cards/gemma/gemma-3-1b-it.js +16 -0
- package/dist/models/cards/gemma/gemma-3-1b-it.js.map +1 -0
- package/dist/models/cards/gemma/gemma-3-27b-it.d.ts +10 -0
- package/dist/models/cards/gemma/gemma-3-27b-it.d.ts.map +1 -0
- package/dist/models/cards/gemma/gemma-3-27b-it.js +16 -0
- package/dist/models/cards/gemma/gemma-3-27b-it.js.map +1 -0
- package/dist/models/cards/gemma/gemma-3-4b-it.d.ts +10 -0
- package/dist/models/cards/gemma/gemma-3-4b-it.d.ts.map +1 -0
- package/dist/models/cards/gemma/gemma-3-4b-it.js +16 -0
- package/dist/models/cards/gemma/gemma-3-4b-it.js.map +1 -0
- package/dist/models/cards/gemma/index.d.ts +9 -0
- package/dist/models/cards/gemma/index.d.ts.map +1 -0
- package/dist/models/cards/gemma/index.js +9 -0
- package/dist/models/cards/gemma/index.js.map +1 -0
- package/dist/models/cards/glm/glm-4-5-air.d.ts +17 -0
- package/dist/models/cards/glm/glm-4-5-air.d.ts.map +1 -0
- package/dist/models/cards/glm/glm-4-5-air.js +27 -0
- package/dist/models/cards/glm/glm-4-5-air.js.map +1 -0
- package/dist/models/cards/glm/glm-4-5.d.ts +16 -0
- package/dist/models/cards/glm/glm-4-5.d.ts.map +1 -0
- package/dist/models/cards/glm/glm-4-5.js +26 -0
- package/dist/models/cards/glm/glm-4-5.js.map +1 -0
- package/dist/models/cards/glm/glm-4-6.d.ts +17 -0
- package/dist/models/cards/glm/glm-4-6.d.ts.map +1 -0
- package/dist/models/cards/glm/glm-4-6.js +27 -0
- package/dist/models/cards/glm/glm-4-6.js.map +1 -0
- package/dist/models/cards/glm/glm-4-flash.d.ts +12 -0
- package/dist/models/cards/glm/glm-4-flash.d.ts.map +1 -0
- package/dist/models/cards/glm/glm-4-flash.js +20 -0
- package/dist/models/cards/glm/glm-4-flash.js.map +1 -0
- package/dist/models/cards/glm/glm-4.d.ts +12 -0
- package/dist/models/cards/glm/glm-4.d.ts.map +1 -0
- package/dist/models/cards/glm/glm-4.js +21 -0
- package/dist/models/cards/glm/glm-4.js.map +1 -0
- package/dist/models/cards/glm/index.d.ts +13 -0
- package/dist/models/cards/glm/index.d.ts.map +1 -0
- package/dist/models/cards/glm/index.js +13 -0
- package/dist/models/cards/glm/index.js.map +1 -0
- package/dist/models/cards/google/gemini-1-5-flash.d.ts +10 -0
- package/dist/models/cards/google/gemini-1-5-flash.d.ts.map +1 -0
- package/dist/models/cards/google/gemini-1-5-flash.js +18 -0
- package/dist/models/cards/google/gemini-1-5-flash.js.map +1 -0
- package/dist/models/cards/google/gemini-1-5-pro.d.ts +10 -0
- package/dist/models/cards/google/gemini-1-5-pro.d.ts.map +1 -0
- package/dist/models/cards/google/gemini-1-5-pro.js +18 -0
- package/dist/models/cards/google/gemini-1-5-pro.js.map +1 -0
- package/dist/models/cards/google/gemini-2-0-flash-lite.d.ts +10 -0
- package/dist/models/cards/google/gemini-2-0-flash-lite.d.ts.map +1 -0
- package/dist/models/cards/google/gemini-2-0-flash-lite.js +18 -0
- package/dist/models/cards/google/gemini-2-0-flash-lite.js.map +1 -0
- package/dist/models/cards/google/gemini-2-0-flash.d.ts +10 -0
- package/dist/models/cards/google/gemini-2-0-flash.d.ts.map +1 -0
- package/dist/models/cards/google/gemini-2-0-flash.js +24 -0
- package/dist/models/cards/google/gemini-2-0-flash.js.map +1 -0
- package/dist/models/cards/google/gemini-2-5-computer-use-preview.d.ts +18 -0
- package/dist/models/cards/google/gemini-2-5-computer-use-preview.d.ts.map +1 -0
- package/dist/models/cards/google/gemini-2-5-computer-use-preview.js +26 -0
- package/dist/models/cards/google/gemini-2-5-computer-use-preview.js.map +1 -0
- package/dist/models/cards/google/gemini-2-5-flash-lite.d.ts +10 -0
- package/dist/models/cards/google/gemini-2-5-flash-lite.d.ts.map +1 -0
- package/dist/models/cards/google/gemini-2-5-flash-lite.js +18 -0
- package/dist/models/cards/google/gemini-2-5-flash-lite.js.map +1 -0
- package/dist/models/cards/google/gemini-2-5-flash-sdk.d.ts +11 -0
- package/dist/models/cards/google/gemini-2-5-flash-sdk.d.ts.map +1 -0
- package/dist/models/cards/google/gemini-2-5-flash-sdk.js +25 -0
- package/dist/models/cards/google/gemini-2-5-flash-sdk.js.map +1 -0
- package/dist/models/cards/google/gemini-2-5-flash.d.ts +10 -0
- package/dist/models/cards/google/gemini-2-5-flash.d.ts.map +1 -0
- package/dist/models/cards/google/gemini-2-5-flash.js +24 -0
- package/dist/models/cards/google/gemini-2-5-flash.js.map +1 -0
- package/dist/models/cards/google/gemini-2-5-pro.d.ts +10 -0
- package/dist/models/cards/google/gemini-2-5-pro.d.ts.map +1 -0
- package/dist/models/cards/google/gemini-2-5-pro.js +24 -0
- package/dist/models/cards/google/gemini-2-5-pro.js.map +1 -0
- package/dist/models/cards/google/gemini-3-1-flash-lite-preview.d.ts +11 -0
- package/dist/models/cards/google/gemini-3-1-flash-lite-preview.d.ts.map +1 -0
- package/dist/models/cards/google/gemini-3-1-flash-lite-preview.js +20 -0
- package/dist/models/cards/google/gemini-3-1-flash-lite-preview.js.map +1 -0
- package/dist/models/cards/google/gemini-3-1-pro-preview.d.ts +10 -0
- package/dist/models/cards/google/gemini-3-1-pro-preview.d.ts.map +1 -0
- package/dist/models/cards/google/gemini-3-1-pro-preview.js +19 -0
- package/dist/models/cards/google/gemini-3-1-pro-preview.js.map +1 -0
- package/dist/models/cards/google/gemini-3-5-flash.d.ts +10 -0
- package/dist/models/cards/google/gemini-3-5-flash.d.ts.map +1 -0
- package/dist/models/cards/google/gemini-3-5-flash.js +19 -0
- package/dist/models/cards/google/gemini-3-5-flash.js.map +1 -0
- package/dist/models/cards/google/gemini-3-flash-preview.d.ts +11 -0
- package/dist/models/cards/google/gemini-3-flash-preview.d.ts.map +1 -0
- package/dist/models/cards/google/gemini-3-flash-preview.js +20 -0
- package/dist/models/cards/google/gemini-3-flash-preview.js.map +1 -0
- package/dist/models/cards/google/gemini-3.d.ts +11 -0
- package/dist/models/cards/google/gemini-3.d.ts.map +1 -0
- package/dist/models/cards/google/gemini-3.js +20 -0
- package/dist/models/cards/google/gemini-3.js.map +1 -0
- package/dist/models/cards/google/index.d.ts +17 -0
- package/dist/models/cards/google/index.d.ts.map +1 -0
- package/dist/models/cards/google/index.js +17 -0
- package/dist/models/cards/google/index.js.map +1 -0
- package/dist/models/cards/huggingface/index.d.ts +10 -0
- package/dist/models/cards/huggingface/index.d.ts.map +1 -0
- package/dist/models/cards/huggingface/index.js +10 -0
- package/dist/models/cards/huggingface/index.js.map +1 -0
- package/dist/models/cards/huggingface/llama-3-8b-instruct.d.ts +17 -0
- package/dist/models/cards/huggingface/llama-3-8b-instruct.d.ts.map +1 -0
- package/dist/models/cards/huggingface/llama-3-8b-instruct.js +25 -0
- package/dist/models/cards/huggingface/llama-3-8b-instruct.js.map +1 -0
- package/dist/models/cards/huggingface/mistral-7b-instruct.d.ts +10 -0
- package/dist/models/cards/huggingface/mistral-7b-instruct.d.ts.map +1 -0
- package/dist/models/cards/huggingface/mistral-7b-instruct.js +18 -0
- package/dist/models/cards/huggingface/mistral-7b-instruct.js.map +1 -0
- package/dist/models/cards/local/codellama-13b-local.d.ts +19 -0
- package/dist/models/cards/local/codellama-13b-local.d.ts.map +1 -0
- package/dist/models/cards/local/codellama-13b-local.js +28 -0
- package/dist/models/cards/local/codellama-13b-local.js.map +1 -0
- package/dist/models/cards/local/index.d.ts +17 -0
- package/dist/models/cards/local/index.d.ts.map +1 -0
- package/dist/models/cards/local/index.js +17 -0
- package/dist/models/cards/local/index.js.map +1 -0
- package/dist/models/cards/local/llama-3-8b-local.d.ts +25 -0
- package/dist/models/cards/local/llama-3-8b-local.d.ts.map +1 -0
- package/dist/models/cards/local/llama-3-8b-local.js +34 -0
- package/dist/models/cards/local/llama-3-8b-local.js.map +1 -0
- package/dist/models/cards/local/mistral-7b-ollama.d.ts +18 -0
- package/dist/models/cards/local/mistral-7b-ollama.d.ts.map +1 -0
- package/dist/models/cards/local/mistral-7b-ollama.js +27 -0
- package/dist/models/cards/local/mistral-7b-ollama.js.map +1 -0
- package/dist/models/cards/mercury/index.d.ts +10 -0
- package/dist/models/cards/mercury/index.d.ts.map +1 -0
- package/dist/models/cards/mercury/index.js +10 -0
- package/dist/models/cards/mercury/index.js.map +1 -0
- package/dist/models/cards/mercury/mercury-2.d.ts +24 -0
- package/dist/models/cards/mercury/mercury-2.d.ts.map +1 -0
- package/dist/models/cards/mercury/mercury-2.js +33 -0
- package/dist/models/cards/mercury/mercury-2.js.map +1 -0
- package/dist/models/cards/minimax/index.d.ts +10 -0
- package/dist/models/cards/minimax/index.d.ts.map +1 -0
- package/dist/models/cards/minimax/index.js +10 -0
- package/dist/models/cards/minimax/index.js.map +1 -0
- package/dist/models/cards/minimax/minimax-m2-stable.d.ts +21 -0
- package/dist/models/cards/minimax/minimax-m2-stable.d.ts.map +1 -0
- package/dist/models/cards/minimax/minimax-m2-stable.js +31 -0
- package/dist/models/cards/minimax/minimax-m2-stable.js.map +1 -0
- package/dist/models/cards/minimax/minimax-m2.d.ts +20 -0
- package/dist/models/cards/minimax/minimax-m2.d.ts.map +1 -0
- package/dist/models/cards/minimax/minimax-m2.js +30 -0
- package/dist/models/cards/minimax/minimax-m2.js.map +1 -0
- package/dist/models/cards/moonshot/index.d.ts +9 -0
- package/dist/models/cards/moonshot/index.d.ts.map +1 -0
- package/dist/models/cards/moonshot/index.js +9 -0
- package/dist/models/cards/moonshot/index.js.map +1 -0
- package/dist/models/cards/moonshot/kimi-chat-128k.d.ts +10 -0
- package/dist/models/cards/moonshot/kimi-chat-128k.d.ts.map +1 -0
- package/dist/models/cards/moonshot/kimi-chat-128k.js +18 -0
- package/dist/models/cards/moonshot/kimi-chat-128k.js.map +1 -0
- package/dist/models/cards/moonshot/kimi-chat-32k.d.ts +10 -0
- package/dist/models/cards/moonshot/kimi-chat-32k.d.ts.map +1 -0
- package/dist/models/cards/moonshot/kimi-chat-32k.js +18 -0
- package/dist/models/cards/moonshot/kimi-chat-32k.js.map +1 -0
- package/dist/models/cards/moonshot/kimi-chat.d.ts +12 -0
- package/dist/models/cards/moonshot/kimi-chat.d.ts.map +1 -0
- package/dist/models/cards/moonshot/kimi-chat.js +20 -0
- package/dist/models/cards/moonshot/kimi-chat.js.map +1 -0
- package/dist/models/cards/moonshot/kimi-k2-instruct.d.ts +17 -0
- package/dist/models/cards/moonshot/kimi-k2-instruct.d.ts.map +1 -0
- package/dist/models/cards/moonshot/kimi-k2-instruct.js +26 -0
- package/dist/models/cards/moonshot/kimi-k2-instruct.js.map +1 -0
- package/dist/models/cards/moonshot/kimi-k2-thinking.d.ts +18 -0
- package/dist/models/cards/moonshot/kimi-k2-thinking.d.ts.map +1 -0
- package/dist/models/cards/moonshot/kimi-k2-thinking.js +27 -0
- package/dist/models/cards/moonshot/kimi-k2-thinking.js.map +1 -0
- package/dist/models/cards/openai/gpt-4-1-mini.d.ts +10 -0
- package/dist/models/cards/openai/gpt-4-1-mini.d.ts.map +1 -0
- package/dist/models/cards/openai/gpt-4-1-mini.js +18 -0
- package/dist/models/cards/openai/gpt-4-1-mini.js.map +1 -0
- package/dist/models/cards/openai/gpt-4-1-nano.d.ts +10 -0
- package/dist/models/cards/openai/gpt-4-1-nano.d.ts.map +1 -0
- package/dist/models/cards/openai/gpt-4-1-nano.js +18 -0
- package/dist/models/cards/openai/gpt-4-1-nano.js.map +1 -0
- package/dist/models/cards/openai/gpt-4-1.d.ts +10 -0
- package/dist/models/cards/openai/gpt-4-1.d.ts.map +1 -0
- package/dist/models/cards/openai/gpt-4-1.js +18 -0
- package/dist/models/cards/openai/gpt-4-1.js.map +1 -0
- package/dist/models/cards/openai/gpt-4o-mini.d.ts +10 -0
- package/dist/models/cards/openai/gpt-4o-mini.d.ts.map +1 -0
- package/dist/models/cards/openai/gpt-4o-mini.js +19 -0
- package/dist/models/cards/openai/gpt-4o-mini.js.map +1 -0
- package/dist/models/cards/openai/gpt-4o.d.ts +10 -0
- package/dist/models/cards/openai/gpt-4o.d.ts.map +1 -0
- package/dist/models/cards/openai/gpt-4o.js +19 -0
- package/dist/models/cards/openai/gpt-4o.js.map +1 -0
- package/dist/models/cards/openai/gpt-5-1-reasoning.d.ts +14 -0
- package/dist/models/cards/openai/gpt-5-1-reasoning.d.ts.map +1 -0
- package/dist/models/cards/openai/gpt-5-1-reasoning.js +29 -0
- package/dist/models/cards/openai/gpt-5-1-reasoning.js.map +1 -0
- package/dist/models/cards/openai/gpt-5-1.d.ts +11 -0
- package/dist/models/cards/openai/gpt-5-1.d.ts.map +1 -0
- package/dist/models/cards/openai/gpt-5-1.js +27 -0
- package/dist/models/cards/openai/gpt-5-1.js.map +1 -0
- package/dist/models/cards/openai/gpt-5-2.d.ts +21 -0
- package/dist/models/cards/openai/gpt-5-2.d.ts.map +1 -0
- package/dist/models/cards/openai/gpt-5-2.js +37 -0
- package/dist/models/cards/openai/gpt-5-2.js.map +1 -0
- package/dist/models/cards/openai/gpt-5-4-mini.d.ts +11 -0
- package/dist/models/cards/openai/gpt-5-4-mini.d.ts.map +1 -0
- package/dist/models/cards/openai/gpt-5-4-mini.js +27 -0
- package/dist/models/cards/openai/gpt-5-4-mini.js.map +1 -0
- package/dist/models/cards/openai/gpt-5-4.d.ts +11 -0
- package/dist/models/cards/openai/gpt-5-4.d.ts.map +1 -0
- package/dist/models/cards/openai/gpt-5-4.js +27 -0
- package/dist/models/cards/openai/gpt-5-4.js.map +1 -0
- package/dist/models/cards/openai/gpt-5-5.d.ts +11 -0
- package/dist/models/cards/openai/gpt-5-5.d.ts.map +1 -0
- package/dist/models/cards/openai/gpt-5-5.js +27 -0
- package/dist/models/cards/openai/gpt-5-5.js.map +1 -0
- package/dist/models/cards/openai/gpt-5-chat-latest.d.ts +10 -0
- package/dist/models/cards/openai/gpt-5-chat-latest.d.ts.map +1 -0
- package/dist/models/cards/openai/gpt-5-chat-latest.js +26 -0
- package/dist/models/cards/openai/gpt-5-chat-latest.js.map +1 -0
- package/dist/models/cards/openai/gpt-5-codex.d.ts +11 -0
- package/dist/models/cards/openai/gpt-5-codex.d.ts.map +1 -0
- package/dist/models/cards/openai/gpt-5-codex.js +19 -0
- package/dist/models/cards/openai/gpt-5-codex.js.map +1 -0
- package/dist/models/cards/openai/gpt-5-mini.d.ts +10 -0
- package/dist/models/cards/openai/gpt-5-mini.d.ts.map +1 -0
- package/dist/models/cards/openai/gpt-5-mini.js +26 -0
- package/dist/models/cards/openai/gpt-5-mini.js.map +1 -0
- package/dist/models/cards/openai/gpt-5-nano.d.ts +10 -0
- package/dist/models/cards/openai/gpt-5-nano.d.ts.map +1 -0
- package/dist/models/cards/openai/gpt-5-nano.js +26 -0
- package/dist/models/cards/openai/gpt-5-nano.js.map +1 -0
- package/dist/models/cards/openai/gpt-5.d.ts +10 -0
- package/dist/models/cards/openai/gpt-5.d.ts.map +1 -0
- package/dist/models/cards/openai/gpt-5.js +26 -0
- package/dist/models/cards/openai/gpt-5.js.map +1 -0
- package/dist/models/cards/openai/index.d.ts +32 -0
- package/dist/models/cards/openai/index.d.ts.map +1 -0
- package/dist/models/cards/openai/index.js +38 -0
- package/dist/models/cards/openai/index.js.map +1 -0
- package/dist/models/cards/openai/o1-mini.d.ts +11 -0
- package/dist/models/cards/openai/o1-mini.d.ts.map +1 -0
- package/dist/models/cards/openai/o1-mini.js +28 -0
- package/dist/models/cards/openai/o1-mini.js.map +1 -0
- package/dist/models/cards/openai/o1-pro.d.ts +11 -0
- package/dist/models/cards/openai/o1-pro.d.ts.map +1 -0
- package/dist/models/cards/openai/o1-pro.js +28 -0
- package/dist/models/cards/openai/o1-pro.js.map +1 -0
- package/dist/models/cards/openai/o1.d.ts +11 -0
- package/dist/models/cards/openai/o1.d.ts.map +1 -0
- package/dist/models/cards/openai/o1.js +28 -0
- package/dist/models/cards/openai/o1.js.map +1 -0
- package/dist/models/cards/openai/o3-mini.d.ts +11 -0
- package/dist/models/cards/openai/o3-mini.d.ts.map +1 -0
- package/dist/models/cards/openai/o3-mini.js +30 -0
- package/dist/models/cards/openai/o3-mini.js.map +1 -0
- package/dist/models/cards/openai/o3-pro.d.ts +11 -0
- package/dist/models/cards/openai/o3-pro.d.ts.map +1 -0
- package/dist/models/cards/openai/o3-pro.js +28 -0
- package/dist/models/cards/openai/o3-pro.js.map +1 -0
- package/dist/models/cards/openai/o3.d.ts +11 -0
- package/dist/models/cards/openai/o3.d.ts.map +1 -0
- package/dist/models/cards/openai/o3.js +28 -0
- package/dist/models/cards/openai/o3.js.map +1 -0
- package/dist/models/cards/openai/o4-mini.d.ts +11 -0
- package/dist/models/cards/openai/o4-mini.d.ts.map +1 -0
- package/dist/models/cards/openai/o4-mini.js +27 -0
- package/dist/models/cards/openai/o4-mini.js.map +1 -0
- package/dist/models/cards/qwen/index.d.ts +13 -0
- package/dist/models/cards/qwen/index.d.ts.map +1 -0
- package/dist/models/cards/qwen/index.js +13 -0
- package/dist/models/cards/qwen/index.js.map +1 -0
- package/dist/models/cards/qwen/qwen-3-coder.d.ts +17 -0
- package/dist/models/cards/qwen/qwen-3-coder.d.ts.map +1 -0
- package/dist/models/cards/qwen/qwen-3-coder.js +27 -0
- package/dist/models/cards/qwen/qwen-3-coder.js.map +1 -0
- package/dist/models/cards/qwen/qwen-3-max-preview.d.ts +17 -0
- package/dist/models/cards/qwen/qwen-3-max-preview.d.ts.map +1 -0
- package/dist/models/cards/qwen/qwen-3-max-preview.js +27 -0
- package/dist/models/cards/qwen/qwen-3-max-preview.js.map +1 -0
- package/dist/models/cards/qwen/qwen-max.d.ts +10 -0
- package/dist/models/cards/qwen/qwen-max.d.ts.map +1 -0
- package/dist/models/cards/qwen/qwen-max.js +18 -0
- package/dist/models/cards/qwen/qwen-max.js.map +1 -0
- package/dist/models/cards/qwen/qwen-plus.d.ts +10 -0
- package/dist/models/cards/qwen/qwen-plus.d.ts.map +1 -0
- package/dist/models/cards/qwen/qwen-plus.js +18 -0
- package/dist/models/cards/qwen/qwen-plus.js.map +1 -0
- package/dist/models/cards/qwen/qwen-turbo.d.ts +10 -0
- package/dist/models/cards/qwen/qwen-turbo.d.ts.map +1 -0
- package/dist/models/cards/qwen/qwen-turbo.js +18 -0
- package/dist/models/cards/qwen/qwen-turbo.js.map +1 -0
- package/dist/models/cards/xai/grok-4-1-fast-non-reasoning.d.ts +15 -0
- package/dist/models/cards/xai/grok-4-1-fast-non-reasoning.d.ts.map +1 -0
- package/dist/models/cards/xai/grok-4-1-fast-non-reasoning.js +24 -0
- package/dist/models/cards/xai/grok-4-1-fast-non-reasoning.js.map +1 -0
- package/dist/models/cards/xai/grok-4-1.d.ts +14 -0
- package/dist/models/cards/xai/grok-4-1.d.ts.map +1 -0
- package/dist/models/cards/xai/grok-4-1.js +24 -0
- package/dist/models/cards/xai/grok-4-1.js.map +1 -0
- package/dist/models/cards/xai/grok-4-20-multi-agent.d.ts +13 -0
- package/dist/models/cards/xai/grok-4-20-multi-agent.d.ts.map +1 -0
- package/dist/models/cards/xai/grok-4-20-multi-agent.js +23 -0
- package/dist/models/cards/xai/grok-4-20-multi-agent.js.map +1 -0
- package/dist/models/cards/xai/grok-4-20-non-reasoning.d.ts +10 -0
- package/dist/models/cards/xai/grok-4-20-non-reasoning.d.ts.map +1 -0
- package/dist/models/cards/xai/grok-4-20-non-reasoning.js +19 -0
- package/dist/models/cards/xai/grok-4-20-non-reasoning.js.map +1 -0
- package/dist/models/cards/xai/grok-4-20-reasoning.d.ts +10 -0
- package/dist/models/cards/xai/grok-4-20-reasoning.d.ts.map +1 -0
- package/dist/models/cards/xai/grok-4-20-reasoning.js +20 -0
- package/dist/models/cards/xai/grok-4-20-reasoning.js.map +1 -0
- package/dist/models/cards/xai/grok-4-3.d.ts +11 -0
- package/dist/models/cards/xai/grok-4-3.d.ts.map +1 -0
- package/dist/models/cards/xai/grok-4-3.js +22 -0
- package/dist/models/cards/xai/grok-4-3.js.map +1 -0
- package/dist/models/cards/xai/grok-4-fast-non-reasoning.d.ts +13 -0
- package/dist/models/cards/xai/grok-4-fast-non-reasoning.d.ts.map +1 -0
- package/dist/models/cards/xai/grok-4-fast-non-reasoning.js +22 -0
- package/dist/models/cards/xai/grok-4-fast-non-reasoning.js.map +1 -0
- package/dist/models/cards/xai/grok-4-fast.d.ts +12 -0
- package/dist/models/cards/xai/grok-4-fast.d.ts.map +1 -0
- package/dist/models/cards/xai/grok-4-fast.js +21 -0
- package/dist/models/cards/xai/grok-4-fast.js.map +1 -0
- package/dist/models/cards/xai/grok-build-0-1-responses.d.ts +22 -0
- package/dist/models/cards/xai/grok-build-0-1-responses.d.ts.map +1 -0
- package/dist/models/cards/xai/grok-build-0-1-responses.js +39 -0
- package/dist/models/cards/xai/grok-build-0-1-responses.js.map +1 -0
- package/dist/models/cards/xai/grok-build-0-1.d.ts +17 -0
- package/dist/models/cards/xai/grok-build-0-1.d.ts.map +1 -0
- package/dist/models/cards/xai/grok-build-0-1.js +31 -0
- package/dist/models/cards/xai/grok-build-0-1.js.map +1 -0
- package/dist/models/cards/xai/grok-code-fast-1.d.ts +10 -0
- package/dist/models/cards/xai/grok-code-fast-1.d.ts.map +1 -0
- package/dist/models/cards/xai/grok-code-fast-1.js +22 -0
- package/dist/models/cards/xai/grok-code-fast-1.js.map +1 -0
- package/dist/models/cards/xai/index.d.ts +17 -0
- package/dist/models/cards/xai/index.d.ts.map +1 -0
- package/dist/models/cards/xai/index.js +18 -0
- package/dist/models/cards/xai/index.js.map +1 -0
- package/dist/models/configurators/AnthropicConfigurator.d.ts +57 -0
- package/dist/models/configurators/AnthropicConfigurator.d.ts.map +1 -0
- package/dist/models/configurators/AnthropicConfigurator.js +108 -0
- package/dist/models/configurators/AnthropicConfigurator.js.map +1 -0
- package/dist/models/configurators/CloudflareConfigurator.d.ts +46 -0
- package/dist/models/configurators/CloudflareConfigurator.d.ts.map +1 -0
- package/dist/models/configurators/CloudflareConfigurator.js +112 -0
- package/dist/models/configurators/CloudflareConfigurator.js.map +1 -0
- package/dist/models/configurators/DeepSeekConfigurator.d.ts +26 -0
- package/dist/models/configurators/DeepSeekConfigurator.d.ts.map +1 -0
- package/dist/models/configurators/DeepSeekConfigurator.js +81 -0
- package/dist/models/configurators/DeepSeekConfigurator.js.map +1 -0
- package/dist/models/configurators/GLMConfigurator.d.ts +22 -0
- package/dist/models/configurators/GLMConfigurator.d.ts.map +1 -0
- package/dist/models/configurators/GLMConfigurator.js +82 -0
- package/dist/models/configurators/GLMConfigurator.js.map +1 -0
- package/dist/models/configurators/GemmaConfigurator.d.ts +18 -0
- package/dist/models/configurators/GemmaConfigurator.d.ts.map +1 -0
- package/dist/models/configurators/GemmaConfigurator.js +89 -0
- package/dist/models/configurators/GemmaConfigurator.js.map +1 -0
- package/dist/models/configurators/GoogleConfigurator.d.ts +26 -0
- package/dist/models/configurators/GoogleConfigurator.d.ts.map +1 -0
- package/dist/models/configurators/GoogleConfigurator.js +91 -0
- package/dist/models/configurators/GoogleConfigurator.js.map +1 -0
- package/dist/models/configurators/GoogleSDKConfigurator.d.ts +29 -0
- package/dist/models/configurators/GoogleSDKConfigurator.d.ts.map +1 -0
- package/dist/models/configurators/GoogleSDKConfigurator.js +95 -0
- package/dist/models/configurators/GoogleSDKConfigurator.js.map +1 -0
- package/dist/models/configurators/HuggingFaceConfigurator.d.ts +31 -0
- package/dist/models/configurators/HuggingFaceConfigurator.d.ts.map +1 -0
- package/dist/models/configurators/HuggingFaceConfigurator.js +85 -0
- package/dist/models/configurators/HuggingFaceConfigurator.js.map +1 -0
- package/dist/models/configurators/LocalModelConfigurator.d.ts +30 -0
- package/dist/models/configurators/LocalModelConfigurator.d.ts.map +1 -0
- package/dist/models/configurators/LocalModelConfigurator.js +88 -0
- package/dist/models/configurators/LocalModelConfigurator.js.map +1 -0
- package/dist/models/configurators/MercuryConfigurator.d.ts +27 -0
- package/dist/models/configurators/MercuryConfigurator.d.ts.map +1 -0
- package/dist/models/configurators/MercuryConfigurator.js +91 -0
- package/dist/models/configurators/MercuryConfigurator.js.map +1 -0
- package/dist/models/configurators/MiniMaxConfigurator.d.ts +47 -0
- package/dist/models/configurators/MiniMaxConfigurator.d.ts.map +1 -0
- package/dist/models/configurators/MiniMaxConfigurator.js +103 -0
- package/dist/models/configurators/MiniMaxConfigurator.js.map +1 -0
- package/dist/models/configurators/MoonshotConfigurator.d.ts +21 -0
- package/dist/models/configurators/MoonshotConfigurator.d.ts.map +1 -0
- package/dist/models/configurators/MoonshotConfigurator.js +81 -0
- package/dist/models/configurators/MoonshotConfigurator.js.map +1 -0
- package/dist/models/configurators/OpenAIConfigurator.d.ts +52 -0
- package/dist/models/configurators/OpenAIConfigurator.d.ts.map +1 -0
- package/dist/models/configurators/OpenAIConfigurator.js +128 -0
- package/dist/models/configurators/OpenAIConfigurator.js.map +1 -0
- package/dist/models/configurators/OpenAIResponsesConfigurator.d.ts +23 -0
- package/dist/models/configurators/OpenAIResponsesConfigurator.d.ts.map +1 -0
- package/dist/models/configurators/OpenAIResponsesConfigurator.js +113 -0
- package/dist/models/configurators/OpenAIResponsesConfigurator.js.map +1 -0
- package/dist/models/configurators/QwenConfigurator.d.ts +26 -0
- package/dist/models/configurators/QwenConfigurator.d.ts.map +1 -0
- package/dist/models/configurators/QwenConfigurator.js +87 -0
- package/dist/models/configurators/QwenConfigurator.js.map +1 -0
- package/dist/models/configurators/XAIConfigurator.d.ts +52 -0
- package/dist/models/configurators/XAIConfigurator.d.ts.map +1 -0
- package/dist/models/configurators/XAIConfigurator.js +130 -0
- package/dist/models/configurators/XAIConfigurator.js.map +1 -0
- package/dist/models/configurators/index.d.ts +19 -0
- package/dist/models/configurators/index.d.ts.map +1 -0
- package/dist/models/configurators/index.js +19 -0
- package/dist/models/configurators/index.js.map +1 -0
- package/dist/models/index.d.ts +7 -0
- package/dist/models/index.d.ts.map +1 -0
- package/dist/models/index.js +7 -0
- package/dist/models/index.js.map +1 -0
- package/dist/models/registry/ModelAliasResolver.d.ts +109 -0
- package/dist/models/registry/ModelAliasResolver.d.ts.map +1 -0
- package/dist/models/registry/ModelAliasResolver.js +255 -0
- package/dist/models/registry/ModelAliasResolver.js.map +1 -0
- package/dist/models/registry/ModelCardLoader.d.ts +44 -0
- package/dist/models/registry/ModelCardLoader.d.ts.map +1 -0
- package/dist/models/registry/ModelCardLoader.js +124 -0
- package/dist/models/registry/ModelCardLoader.js.map +1 -0
- package/dist/models/registry/ModularModelRegistry.d.ts +86 -0
- package/dist/models/registry/ModularModelRegistry.d.ts.map +1 -0
- package/dist/models/registry/ModularModelRegistry.js +311 -0
- package/dist/models/registry/ModularModelRegistry.js.map +1 -0
- package/dist/models/registry/index.d.ts +8 -0
- package/dist/models/registry/index.d.ts.map +1 -0
- package/dist/models/registry/index.js +9 -0
- package/dist/models/registry/index.js.map +1 -0
- package/dist/orchestrator/APIClient.d.ts +274 -0
- package/dist/orchestrator/APIClient.d.ts.map +1 -0
- package/dist/orchestrator/APIClient.js +2770 -0
- package/dist/orchestrator/APIClient.js.map +1 -0
- package/dist/orchestrator/CortexOrchestrator.d.ts +986 -0
- package/dist/orchestrator/CortexOrchestrator.d.ts.map +1 -0
- package/dist/orchestrator/CortexOrchestrator.js +6374 -0
- package/dist/orchestrator/CortexOrchestrator.js.map +1 -0
- package/dist/orchestrator/OrchestratorFactory.d.ts +81 -0
- package/dist/orchestrator/OrchestratorFactory.d.ts.map +1 -0
- package/dist/orchestrator/OrchestratorFactory.js +433 -0
- package/dist/orchestrator/OrchestratorFactory.js.map +1 -0
- package/dist/orchestrator/PauseController.d.ts +126 -0
- package/dist/orchestrator/PauseController.d.ts.map +1 -0
- package/dist/orchestrator/PauseController.js +248 -0
- package/dist/orchestrator/PauseController.js.map +1 -0
- package/dist/orchestrator/SubAgentEventEmitter.d.ts +152 -0
- package/dist/orchestrator/SubAgentEventEmitter.d.ts.map +1 -0
- package/dist/orchestrator/SubAgentEventEmitter.js +372 -0
- package/dist/orchestrator/SubAgentEventEmitter.js.map +1 -0
- package/dist/orchestrator/SubAgentIPC.d.ts +242 -0
- package/dist/orchestrator/SubAgentIPC.d.ts.map +1 -0
- package/dist/orchestrator/SubAgentIPC.js +85 -0
- package/dist/orchestrator/SubAgentIPC.js.map +1 -0
- package/dist/orchestrator/SubAgentManager.d.ts +215 -0
- package/dist/orchestrator/SubAgentManager.d.ts.map +1 -0
- package/dist/orchestrator/SubAgentManager.js +477 -0
- package/dist/orchestrator/SubAgentManager.js.map +1 -0
- package/dist/orchestrator/SubAgentOrchestrator.d.ts +125 -0
- package/dist/orchestrator/SubAgentOrchestrator.d.ts.map +1 -0
- package/dist/orchestrator/SubAgentOrchestrator.js +395 -0
- package/dist/orchestrator/SubAgentOrchestrator.js.map +1 -0
- package/dist/orchestrator/SubAgentPermissionChecker.d.ts +132 -0
- package/dist/orchestrator/SubAgentPermissionChecker.d.ts.map +1 -0
- package/dist/orchestrator/SubAgentPermissionChecker.js +239 -0
- package/dist/orchestrator/SubAgentPermissionChecker.js.map +1 -0
- package/dist/orchestrator/SubAgentProcessManager.d.ts +228 -0
- package/dist/orchestrator/SubAgentProcessManager.d.ts.map +1 -0
- package/dist/orchestrator/SubAgentProcessManager.js +679 -0
- package/dist/orchestrator/SubAgentProcessManager.js.map +1 -0
- package/dist/orchestrator/SubAgentTypes.d.ts +428 -0
- package/dist/orchestrator/SubAgentTypes.d.ts.map +1 -0
- package/dist/orchestrator/SubAgentTypes.js +12 -0
- package/dist/orchestrator/SubAgentTypes.js.map +1 -0
- package/dist/orchestrator/apiErrorClassifier.d.ts +17 -0
- package/dist/orchestrator/apiErrorClassifier.d.ts.map +1 -0
- package/dist/orchestrator/apiErrorClassifier.js +38 -0
- package/dist/orchestrator/apiErrorClassifier.js.map +1 -0
- package/dist/orchestrator/assistantTextPresence.d.ts +32 -0
- package/dist/orchestrator/assistantTextPresence.d.ts.map +1 -0
- package/dist/orchestrator/assistantTextPresence.js +47 -0
- package/dist/orchestrator/assistantTextPresence.js.map +1 -0
- package/dist/orchestrator/citationVerification.d.ts +32 -0
- package/dist/orchestrator/citationVerification.d.ts.map +1 -0
- package/dist/orchestrator/citationVerification.js +47 -0
- package/dist/orchestrator/citationVerification.js.map +1 -0
- package/dist/orchestrator/coordinateVerification.d.ts +50 -0
- package/dist/orchestrator/coordinateVerification.d.ts.map +1 -0
- package/dist/orchestrator/coordinateVerification.js +114 -0
- package/dist/orchestrator/coordinateVerification.js.map +1 -0
- package/dist/orchestrator/cortexTrainingRecord.d.ts +88 -0
- package/dist/orchestrator/cortexTrainingRecord.d.ts.map +1 -0
- package/dist/orchestrator/cortexTrainingRecord.js +102 -0
- package/dist/orchestrator/cortexTrainingRecord.js.map +1 -0
- package/dist/orchestrator/index.d.ts +20 -0
- package/dist/orchestrator/index.d.ts.map +1 -0
- package/dist/orchestrator/index.js +18 -0
- package/dist/orchestrator/index.js.map +1 -0
- package/dist/orchestrator/mcpAutoInjectPolicy.d.ts +18 -0
- package/dist/orchestrator/mcpAutoInjectPolicy.d.ts.map +1 -0
- package/dist/orchestrator/mcpAutoInjectPolicy.js +24 -0
- package/dist/orchestrator/mcpAutoInjectPolicy.js.map +1 -0
- package/dist/orchestrator/staticSystemPromptPin.d.ts +20 -0
- package/dist/orchestrator/staticSystemPromptPin.d.ts.map +1 -0
- package/dist/orchestrator/staticSystemPromptPin.js +33 -0
- package/dist/orchestrator/staticSystemPromptPin.js.map +1 -0
- package/dist/orchestrator/toolBudgetSignal.d.ts +41 -0
- package/dist/orchestrator/toolBudgetSignal.d.ts.map +1 -0
- package/dist/orchestrator/toolBudgetSignal.js +77 -0
- package/dist/orchestrator/toolBudgetSignal.js.map +1 -0
- package/dist/orchestrator/toolNameMatcher.d.ts +21 -0
- package/dist/orchestrator/toolNameMatcher.d.ts.map +1 -0
- package/dist/orchestrator/toolNameMatcher.js +69 -0
- package/dist/orchestrator/toolNameMatcher.js.map +1 -0
- package/dist/session/CacheMetricsAccumulator.d.ts +72 -0
- package/dist/session/CacheMetricsAccumulator.d.ts.map +1 -0
- package/dist/session/CacheMetricsAccumulator.js +144 -0
- package/dist/session/CacheMetricsAccumulator.js.map +1 -0
- package/dist/session/CheckpointManager.d.ts +106 -0
- package/dist/session/CheckpointManager.d.ts.map +1 -0
- package/dist/session/CheckpointManager.js +223 -0
- package/dist/session/CheckpointManager.js.map +1 -0
- package/dist/session/JSONLHistoryStore.d.ts +154 -0
- package/dist/session/JSONLHistoryStore.d.ts.map +1 -0
- package/dist/session/JSONLHistoryStore.js +393 -0
- package/dist/session/JSONLHistoryStore.js.map +1 -0
- package/dist/session/MessageTypes.d.ts +269 -0
- package/dist/session/MessageTypes.d.ts.map +1 -0
- package/dist/session/MessageTypes.js +38 -0
- package/dist/session/MessageTypes.js.map +1 -0
- package/dist/session/SessionTimeline.d.ts +304 -0
- package/dist/session/SessionTimeline.d.ts.map +1 -0
- package/dist/session/SessionTimeline.js +396 -0
- package/dist/session/SessionTimeline.js.map +1 -0
- package/dist/session/index.d.ts +10 -0
- package/dist/session/index.d.ts.map +1 -0
- package/dist/session/index.js +10 -0
- package/dist/session/index.js.map +1 -0
- package/dist/system-messages/MessageValidator.d.ts +71 -0
- package/dist/system-messages/MessageValidator.d.ts.map +1 -0
- package/dist/system-messages/MessageValidator.js +305 -0
- package/dist/system-messages/MessageValidator.js.map +1 -0
- package/dist/system-messages/SystemMessageLoader.d.ts +154 -0
- package/dist/system-messages/SystemMessageLoader.d.ts.map +1 -0
- package/dist/system-messages/SystemMessageLoader.js +695 -0
- package/dist/system-messages/SystemMessageLoader.js.map +1 -0
- package/dist/system-messages/SystemMessageRegistry.d.ts +67 -0
- package/dist/system-messages/SystemMessageRegistry.d.ts.map +1 -0
- package/dist/system-messages/SystemMessageRegistry.interface.d.ts +166 -0
- package/dist/system-messages/SystemMessageRegistry.interface.d.ts.map +1 -0
- package/dist/system-messages/SystemMessageRegistry.interface.js +6 -0
- package/dist/system-messages/SystemMessageRegistry.interface.js.map +1 -0
- package/dist/system-messages/SystemMessageRegistry.js +164 -0
- package/dist/system-messages/SystemMessageRegistry.js.map +1 -0
- package/dist/system-messages/SystemMessageStore.d.ts +207 -0
- package/dist/system-messages/SystemMessageStore.d.ts.map +1 -0
- package/dist/system-messages/SystemMessageStore.js +748 -0
- package/dist/system-messages/SystemMessageStore.js.map +1 -0
- package/dist/system-messages/SystemReminderInjector.d.ts +148 -0
- package/dist/system-messages/SystemReminderInjector.d.ts.map +1 -0
- package/dist/system-messages/SystemReminderInjector.js +331 -0
- package/dist/system-messages/SystemReminderInjector.js.map +1 -0
- package/dist/system-messages/docTruncation.d.ts +31 -0
- package/dist/system-messages/docTruncation.d.ts.map +1 -0
- package/dist/system-messages/docTruncation.js +26 -0
- package/dist/system-messages/docTruncation.js.map +1 -0
- package/dist/system-messages/index.d.ts +12 -0
- package/dist/system-messages/index.d.ts.map +1 -0
- package/dist/system-messages/index.js +15 -0
- package/dist/system-messages/index.js.map +1 -0
- package/dist/system-messages/messages/ACTIVE_DISCOVERY.md +26 -0
- package/dist/system-messages/messages/EXAMPLES.md +73 -0
- package/dist/system-messages/messages/PERIODIC_REMINDER.md +6 -0
- package/dist/system-messages/messages/REASONING_GUIDE.md +12 -0
- package/dist/system-messages/messages/SYSTEM_PROMPT.md +47 -0
- package/dist/system-messages/messages/TASK_AGENT_GUIDE.md +5 -0
- package/dist/system-messages/messages/TOOL_USAGE_GUIDE.md +131 -0
- package/dist/system-messages/system-message-registry.json +233 -0
- package/dist/system-messages/turnVaryingClassifier.d.ts +20 -0
- package/dist/system-messages/turnVaryingClassifier.d.ts.map +1 -0
- package/dist/system-messages/turnVaryingClassifier.js +27 -0
- package/dist/system-messages/turnVaryingClassifier.js.map +1 -0
- package/dist/system-messages/types.d.ts +184 -0
- package/dist/system-messages/types.d.ts.map +1 -0
- package/dist/system-messages/types.js +7 -0
- package/dist/system-messages/types.js.map +1 -0
- package/dist/tools/ClientSideToolFilter.d.ts +35 -0
- package/dist/tools/ClientSideToolFilter.d.ts.map +1 -0
- package/dist/tools/ClientSideToolFilter.js +74 -0
- package/dist/tools/ClientSideToolFilter.js.map +1 -0
- package/dist/tools/ServerSideTools.d.ts +181 -0
- package/dist/tools/ServerSideTools.d.ts.map +1 -0
- package/dist/tools/ServerSideTools.js +309 -0
- package/dist/tools/ServerSideTools.js.map +1 -0
- package/dist/tools/ToolFactory.d.ts +88 -0
- package/dist/tools/ToolFactory.d.ts.map +1 -0
- package/dist/tools/ToolFactory.js +153 -0
- package/dist/tools/ToolFactory.js.map +1 -0
- package/dist/tools/context-management/InitCortexContext.d.ts +184 -0
- package/dist/tools/context-management/InitCortexContext.d.ts.map +1 -0
- package/dist/tools/context-management/InitCortexContext.js +1063 -0
- package/dist/tools/context-management/InitCortexContext.js.map +1 -0
- package/dist/tools/context-management/index.d.ts +8 -0
- package/dist/tools/context-management/index.d.ts.map +1 -0
- package/dist/tools/context-management/index.js +7 -0
- package/dist/tools/context-management/index.js.map +1 -0
- package/dist/tools/historical/GetConversationSegment.d.ts +131 -0
- package/dist/tools/historical/GetConversationSegment.d.ts.map +1 -0
- package/dist/tools/historical/GetConversationSegment.js +306 -0
- package/dist/tools/historical/GetConversationSegment.js.map +1 -0
- package/dist/tools/historical/HistoricalContextService.d.ts +229 -0
- package/dist/tools/historical/HistoricalContextService.d.ts.map +1 -0
- package/dist/tools/historical/HistoricalContextService.js +206 -0
- package/dist/tools/historical/HistoricalContextService.js.map +1 -0
- package/dist/tools/historical/ListCompactionBoundaries.d.ts +107 -0
- package/dist/tools/historical/ListCompactionBoundaries.d.ts.map +1 -0
- package/dist/tools/historical/ListCompactionBoundaries.js +175 -0
- package/dist/tools/historical/ListCompactionBoundaries.js.map +1 -0
- package/dist/tools/historical/ListSessions.d.ts +50 -0
- package/dist/tools/historical/ListSessions.d.ts.map +1 -0
- package/dist/tools/historical/ListSessions.js +93 -0
- package/dist/tools/historical/ListSessions.js.map +1 -0
- package/dist/tools/historical/LoadSession.d.ts +51 -0
- package/dist/tools/historical/LoadSession.d.ts.map +1 -0
- package/dist/tools/historical/LoadSession.js +89 -0
- package/dist/tools/historical/LoadSession.js.map +1 -0
- package/dist/tools/historical/RequestHistoricalContext.d.ts +122 -0
- package/dist/tools/historical/RequestHistoricalContext.d.ts.map +1 -0
- package/dist/tools/historical/RequestHistoricalContext.js +250 -0
- package/dist/tools/historical/RequestHistoricalContext.js.map +1 -0
- package/dist/tools/historical/SearchConversationHistory.d.ts +117 -0
- package/dist/tools/historical/SearchConversationHistory.d.ts.map +1 -0
- package/dist/tools/historical/SearchConversationHistory.js +239 -0
- package/dist/tools/historical/SearchConversationHistory.js.map +1 -0
- package/dist/tools/historical/index.d.ts +14 -0
- package/dist/tools/historical/index.d.ts.map +1 -0
- package/dist/tools/historical/index.js +14 -0
- package/dist/tools/historical/index.js.map +1 -0
- package/dist/tools/index.d.ts +15 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +21 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/mcp-management/ConfigureMcpServer.d.ts +41 -0
- package/dist/tools/mcp-management/ConfigureMcpServer.d.ts.map +1 -0
- package/dist/tools/mcp-management/ConfigureMcpServer.js +147 -0
- package/dist/tools/mcp-management/ConfigureMcpServer.js.map +1 -0
- package/dist/tools/mcp-management/DisableMcpServer.d.ts +39 -0
- package/dist/tools/mcp-management/DisableMcpServer.d.ts.map +1 -0
- package/dist/tools/mcp-management/DisableMcpServer.js +108 -0
- package/dist/tools/mcp-management/DisableMcpServer.js.map +1 -0
- package/dist/tools/mcp-management/EnableMcpServer.d.ts +49 -0
- package/dist/tools/mcp-management/EnableMcpServer.d.ts.map +1 -0
- package/dist/tools/mcp-management/EnableMcpServer.js +134 -0
- package/dist/tools/mcp-management/EnableMcpServer.js.map +1 -0
- package/dist/tools/mcp-management/GetMcpConfig.d.ts +52 -0
- package/dist/tools/mcp-management/GetMcpConfig.d.ts.map +1 -0
- package/dist/tools/mcp-management/GetMcpConfig.js +95 -0
- package/dist/tools/mcp-management/GetMcpConfig.js.map +1 -0
- package/dist/tools/mcp-management/InitMcpConfig.d.ts +113 -0
- package/dist/tools/mcp-management/InitMcpConfig.d.ts.map +1 -0
- package/dist/tools/mcp-management/InitMcpConfig.js +421 -0
- package/dist/tools/mcp-management/InitMcpConfig.js.map +1 -0
- package/dist/tools/mcp-management/ListAvailableMcpServers.d.ts +50 -0
- package/dist/tools/mcp-management/ListAvailableMcpServers.d.ts.map +1 -0
- package/dist/tools/mcp-management/ListAvailableMcpServers.js +92 -0
- package/dist/tools/mcp-management/ListAvailableMcpServers.js.map +1 -0
- package/dist/tools/mcp-management/SearchMcpServers.d.ts +44 -0
- package/dist/tools/mcp-management/SearchMcpServers.d.ts.map +1 -0
- package/dist/tools/mcp-management/SearchMcpServers.js +96 -0
- package/dist/tools/mcp-management/SearchMcpServers.js.map +1 -0
- package/dist/tools/mcp-management/index.d.ts +23 -0
- package/dist/tools/mcp-management/index.d.ts.map +1 -0
- package/dist/tools/mcp-management/index.js +16 -0
- package/dist/tools/mcp-management/index.js.map +1 -0
- package/dist/tools/registries/AddonToolRegistry.d.ts +70 -0
- package/dist/tools/registries/AddonToolRegistry.d.ts.map +1 -0
- package/dist/tools/registries/AddonToolRegistry.js +138 -0
- package/dist/tools/registries/AddonToolRegistry.js.map +1 -0
- package/dist/tools/registries/BaseToolRegistry.d.ts +38 -0
- package/dist/tools/registries/BaseToolRegistry.d.ts.map +1 -0
- package/dist/tools/registries/BaseToolRegistry.js +2058 -0
- package/dist/tools/registries/BaseToolRegistry.js.map +1 -0
- package/dist/tools/registries/index.d.ts +8 -0
- package/dist/tools/registries/index.d.ts.map +1 -0
- package/dist/tools/registries/index.js +8 -0
- package/dist/tools/registries/index.js.map +1 -0
- package/dist/tools/types/CanonicalTool.d.ts +130 -0
- package/dist/tools/types/CanonicalTool.d.ts.map +1 -0
- package/dist/tools/types/CanonicalTool.js +10 -0
- package/dist/tools/types/CanonicalTool.js.map +1 -0
- package/dist/tools/types/index.d.ts +7 -0
- package/dist/tools/types/index.d.ts.map +1 -0
- package/dist/tools/types/index.js +7 -0
- package/dist/tools/types/index.js.map +1 -0
- package/dist/training/AutoResearchGate.d.ts +64 -0
- package/dist/training/AutoResearchGate.d.ts.map +1 -0
- package/dist/training/AutoResearchGate.js +94 -0
- package/dist/training/AutoResearchGate.js.map +1 -0
- package/dist/training/AutoResearchStats.d.ts +128 -0
- package/dist/training/AutoResearchStats.d.ts.map +1 -0
- package/dist/training/AutoResearchStats.js +210 -0
- package/dist/training/AutoResearchStats.js.map +1 -0
- package/dist/training/BenchRunner.d.ts +177 -0
- package/dist/training/BenchRunner.d.ts.map +1 -0
- package/dist/training/BenchRunner.js +211 -0
- package/dist/training/BenchRunner.js.map +1 -0
- package/dist/training/DecisionPriorInjector.d.ts +18 -0
- package/dist/training/DecisionPriorInjector.d.ts.map +1 -0
- package/dist/training/DecisionPriorInjector.js +34 -0
- package/dist/training/DecisionPriorInjector.js.map +1 -0
- package/dist/training/DecisionStore.d.ts +78 -0
- package/dist/training/DecisionStore.d.ts.map +1 -0
- package/dist/training/DecisionStore.js +171 -0
- package/dist/training/DecisionStore.js.map +1 -0
- package/dist/training/ExperimentLedger.d.ts +138 -0
- package/dist/training/ExperimentLedger.d.ts.map +1 -0
- package/dist/training/ExperimentLedger.js +160 -0
- package/dist/training/ExperimentLedger.js.map +1 -0
- package/dist/training/ExperimentRunner.d.ts +88 -0
- package/dist/training/ExperimentRunner.d.ts.map +1 -0
- package/dist/training/ExperimentRunner.js +97 -0
- package/dist/training/ExperimentRunner.js.map +1 -0
- package/dist/training/ModelRouterMatrix.d.ts +197 -0
- package/dist/training/ModelRouterMatrix.d.ts.map +1 -0
- package/dist/training/ModelRouterMatrix.js +0 -0
- package/dist/training/ModelRouterMatrix.js.map +1 -0
- package/dist/training/ResearchBacklog.d.ts +102 -0
- package/dist/training/ResearchBacklog.d.ts.map +1 -0
- package/dist/training/ResearchBacklog.js +149 -0
- package/dist/training/ResearchBacklog.js.map +1 -0
- package/dist/training/TaskClassifier.d.ts +16 -0
- package/dist/training/TaskClassifier.d.ts.map +1 -0
- package/dist/training/TaskClassifier.js +70 -0
- package/dist/training/TaskClassifier.js.map +1 -0
- package/dist/training/ThompsonRouter.d.ts +53 -0
- package/dist/training/ThompsonRouter.d.ts.map +1 -0
- package/dist/training/ThompsonRouter.js +73 -0
- package/dist/training/ThompsonRouter.js.map +1 -0
- package/dist/training/VersionComparison.d.ts +90 -0
- package/dist/training/VersionComparison.d.ts.map +1 -0
- package/dist/training/VersionComparison.js +117 -0
- package/dist/training/VersionComparison.js.map +1 -0
- package/dist/ui/index.d.ts +13 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +15 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/menu-types.d.ts +314 -0
- package/dist/ui/menu-types.d.ts.map +1 -0
- package/dist/ui/menu-types.js +138 -0
- package/dist/ui/menu-types.js.map +1 -0
- package/dist/ui/types.d.ts +86 -0
- package/dist/ui/types.d.ts.map +1 -0
- package/dist/ui/types.js +12 -0
- package/dist/ui/types.js.map +1 -0
- package/dist/utils/ContextResolver.d.ts +132 -0
- package/dist/utils/ContextResolver.d.ts.map +1 -0
- package/dist/utils/ContextResolver.js +269 -0
- package/dist/utils/ContextResolver.js.map +1 -0
- package/dist/utils/DiffParser.d.ts +101 -0
- package/dist/utils/DiffParser.d.ts.map +1 -0
- package/dist/utils/DiffParser.js +193 -0
- package/dist/utils/DiffParser.js.map +1 -0
- package/dist/utils/ErrorDetector.d.ts +99 -0
- package/dist/utils/ErrorDetector.d.ts.map +1 -0
- package/dist/utils/ErrorDetector.js +258 -0
- package/dist/utils/ErrorDetector.js.map +1 -0
- package/dist/utils/TokenCounter.d.ts +97 -0
- package/dist/utils/TokenCounter.d.ts.map +1 -0
- package/dist/utils/TokenCounter.js +193 -0
- package/dist/utils/TokenCounter.js.map +1 -0
- package/dist/utils/agentDiscovery.d.ts +12 -0
- package/dist/utils/agentDiscovery.d.ts.map +1 -0
- package/dist/utils/agentDiscovery.js +72 -0
- package/dist/utils/agentDiscovery.js.map +1 -0
- package/dist/utils/ids.d.ts +5 -0
- package/dist/utils/ids.d.ts.map +1 -0
- package/dist/utils/ids.js +14 -0
- package/dist/utils/ids.js.map +1 -0
- package/dist/utils/index.d.ts +14 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +14 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/logger.d.ts +22 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +44 -0
- package/dist/utils/logger.js.map +1 -0
- package/package.json +87 -0
|
@@ -0,0 +1,1063 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* InitCortexContext Tool
|
|
3
|
+
*
|
|
4
|
+
* Generates CORTEX.md file with project context that gets injected as a system message.
|
|
5
|
+
* Similar to CLAUDE.md but auto-generated with:
|
|
6
|
+
* - File tree structure
|
|
7
|
+
* - Dependencies (package.json, requirements.txt, etc.)
|
|
8
|
+
* - Scripts and build commands
|
|
9
|
+
* - Project overview
|
|
10
|
+
*
|
|
11
|
+
* Usage:
|
|
12
|
+
* - init_cortex_context() - Generate in current directory (.cortex/CORTEX.md)
|
|
13
|
+
* - init_cortex_context({ scope: 'global' }) - Generate in ~/.cortex/CORTEX.md
|
|
14
|
+
*/
|
|
15
|
+
import * as fs from 'fs/promises';
|
|
16
|
+
import * as path from 'path';
|
|
17
|
+
/**
|
|
18
|
+
* Directory patterns to exclude (optimized for context efficiency)
|
|
19
|
+
*/
|
|
20
|
+
const EXCLUDE_PATTERNS = [
|
|
21
|
+
'.git',
|
|
22
|
+
'node_modules',
|
|
23
|
+
'bower_components',
|
|
24
|
+
'dist',
|
|
25
|
+
'build',
|
|
26
|
+
'.cortex',
|
|
27
|
+
'.claude',
|
|
28
|
+
'.npm',
|
|
29
|
+
'.pythonlibs',
|
|
30
|
+
'.config',
|
|
31
|
+
'coverage',
|
|
32
|
+
'.next',
|
|
33
|
+
'.nuxt',
|
|
34
|
+
'.cache',
|
|
35
|
+
'tmp',
|
|
36
|
+
'temp',
|
|
37
|
+
'__pycache__',
|
|
38
|
+
'.pytest_cache',
|
|
39
|
+
'.mypy_cache',
|
|
40
|
+
'vendor',
|
|
41
|
+
'.venv',
|
|
42
|
+
'venv',
|
|
43
|
+
'env',
|
|
44
|
+
// Additional exclusions for token efficiency
|
|
45
|
+
'.backups',
|
|
46
|
+
'docs_archive',
|
|
47
|
+
'archive',
|
|
48
|
+
'zcli_design_docs_archive',
|
|
49
|
+
'training_docs',
|
|
50
|
+
'research',
|
|
51
|
+
'.addon-tools',
|
|
52
|
+
'.test-projects',
|
|
53
|
+
];
|
|
54
|
+
/**
|
|
55
|
+
* InitCortexContext Tool Implementation
|
|
56
|
+
*/
|
|
57
|
+
export class InitCortexContext {
|
|
58
|
+
/**
|
|
59
|
+
* Scan a project and return structured data for the model to write CORTEX.md.
|
|
60
|
+
* This is the raw data gathering step — the model does the synthesis.
|
|
61
|
+
*/
|
|
62
|
+
static async scan(workingDir, options = {}) {
|
|
63
|
+
const scope = options.scope || 'auto';
|
|
64
|
+
const scanDir = scope === 'global' ? process.env.HOME || '~' : workingDir;
|
|
65
|
+
const targetDir = scope === 'global'
|
|
66
|
+
? path.join(process.env.HOME || '~', '.cortex')
|
|
67
|
+
: path.join(workingDir, '.cortex');
|
|
68
|
+
const isMonorepo = await this.detectMonorepo(scanDir);
|
|
69
|
+
const maxDepth = options.max_depth || (isMonorepo ? 5 : 4);
|
|
70
|
+
const context = await this.analyzeProject(scanDir, maxDepth, false);
|
|
71
|
+
// Read existing context files if present
|
|
72
|
+
let existingCortexMd;
|
|
73
|
+
let existingClaudeMd;
|
|
74
|
+
let existingGeminiMd;
|
|
75
|
+
try {
|
|
76
|
+
existingCortexMd = await fs.readFile(path.join(targetDir, 'CORTEX.md'), 'utf-8');
|
|
77
|
+
}
|
|
78
|
+
catch { }
|
|
79
|
+
try {
|
|
80
|
+
existingClaudeMd = await fs.readFile(path.join(scanDir, 'CLAUDE.md'), 'utf-8');
|
|
81
|
+
}
|
|
82
|
+
catch { }
|
|
83
|
+
try {
|
|
84
|
+
existingGeminiMd = await fs.readFile(path.join(scanDir, 'GEMINI.md'), 'utf-8');
|
|
85
|
+
}
|
|
86
|
+
catch { }
|
|
87
|
+
return {
|
|
88
|
+
tree: context.tree,
|
|
89
|
+
dependencies: context.dependencies,
|
|
90
|
+
scripts: context.scripts,
|
|
91
|
+
overview: context.overview,
|
|
92
|
+
isMonorepo: context.isMonorepo,
|
|
93
|
+
packages: context.packages,
|
|
94
|
+
architecturePatterns: context.architecturePatterns,
|
|
95
|
+
existingCortexMd,
|
|
96
|
+
existingClaudeMd,
|
|
97
|
+
existingGeminiMd,
|
|
98
|
+
targetPath: path.join(targetDir, 'CORTEX.md'),
|
|
99
|
+
scope,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Format scan results as a prompt for the model to write CORTEX.md.
|
|
104
|
+
*/
|
|
105
|
+
static formatScanAsPrompt(scan) {
|
|
106
|
+
const sections = [];
|
|
107
|
+
sections.push(`Analyze this project and write a CORTEX.md file at: ${scan.targetPath}`);
|
|
108
|
+
sections.push('');
|
|
109
|
+
// Existing context files
|
|
110
|
+
if (scan.existingCortexMd) {
|
|
111
|
+
sections.push('## Existing CORTEX.md (improve, do not rewrite from scratch)');
|
|
112
|
+
sections.push('```markdown');
|
|
113
|
+
sections.push(scan.existingCortexMd);
|
|
114
|
+
sections.push('```');
|
|
115
|
+
sections.push('');
|
|
116
|
+
}
|
|
117
|
+
if (scan.existingClaudeMd) {
|
|
118
|
+
sections.push('## Existing CLAUDE.md (incorporate relevant parts)');
|
|
119
|
+
sections.push('```markdown');
|
|
120
|
+
sections.push(scan.existingClaudeMd.slice(0, 3000));
|
|
121
|
+
if (scan.existingClaudeMd.length > 3000)
|
|
122
|
+
sections.push('... (truncated)');
|
|
123
|
+
sections.push('```');
|
|
124
|
+
sections.push('');
|
|
125
|
+
}
|
|
126
|
+
if (scan.existingGeminiMd) {
|
|
127
|
+
sections.push('## Existing GEMINI.md (incorporate relevant parts)');
|
|
128
|
+
sections.push('```markdown');
|
|
129
|
+
sections.push(scan.existingGeminiMd.slice(0, 2000));
|
|
130
|
+
if (scan.existingGeminiMd.length > 2000)
|
|
131
|
+
sections.push('... (truncated)');
|
|
132
|
+
sections.push('```');
|
|
133
|
+
sections.push('');
|
|
134
|
+
}
|
|
135
|
+
// Project scan data
|
|
136
|
+
sections.push('## Project Scan Data');
|
|
137
|
+
sections.push('');
|
|
138
|
+
sections.push(`**Overview**: ${scan.overview}`);
|
|
139
|
+
sections.push(`**Monorepo**: ${scan.isMonorepo ? 'Yes' : 'No'}`);
|
|
140
|
+
if (scan.packages && scan.packages.length > 0) {
|
|
141
|
+
sections.push(`**Packages**: ${scan.packages.map(p => `${p.name} (${p.type || 'unknown'})`).join(', ')}`);
|
|
142
|
+
}
|
|
143
|
+
sections.push('');
|
|
144
|
+
if (scan.architecturePatterns && scan.architecturePatterns.length > 0) {
|
|
145
|
+
sections.push('### Architecture Patterns Detected');
|
|
146
|
+
scan.architecturePatterns.forEach(p => sections.push(`- ${p}`));
|
|
147
|
+
sections.push('');
|
|
148
|
+
}
|
|
149
|
+
sections.push('### File Structure');
|
|
150
|
+
sections.push('```');
|
|
151
|
+
sections.push(scan.tree);
|
|
152
|
+
sections.push('```');
|
|
153
|
+
sections.push('');
|
|
154
|
+
if (scan.dependencies.length > 0) {
|
|
155
|
+
sections.push('### Dependencies');
|
|
156
|
+
scan.dependencies.forEach(dep => {
|
|
157
|
+
const main = dep.main?.length ? ` (main: ${dep.main.join(', ')})` : '';
|
|
158
|
+
sections.push(`- ${dep.type} (${dep.file}): ${dep.count} total${main}`);
|
|
159
|
+
});
|
|
160
|
+
sections.push('');
|
|
161
|
+
}
|
|
162
|
+
if (scan.scripts.length > 0) {
|
|
163
|
+
sections.push('### Scripts');
|
|
164
|
+
scan.scripts.forEach(s => sections.push(`- \`${s.command}\` — ${s.name} (${s.source})`));
|
|
165
|
+
sections.push('');
|
|
166
|
+
}
|
|
167
|
+
// Instructions for the model
|
|
168
|
+
sections.push('## Writing Instructions');
|
|
169
|
+
sections.push('');
|
|
170
|
+
sections.push('Write a CORTEX.md that helps an AI agent work effectively in this codebase.');
|
|
171
|
+
sections.push('Model it after a standard coding CLI\'s CLAUDE.md style — concise, actionable, under 80 lines.');
|
|
172
|
+
sections.push('');
|
|
173
|
+
sections.push('Include these sections:');
|
|
174
|
+
sections.push('1. **Project** — one-liner description, language, architecture');
|
|
175
|
+
sections.push('2. **Key Commands** — build, test, run, lint (only commands that exist)');
|
|
176
|
+
sections.push('3. **Architecture** — how the pieces connect, key patterns');
|
|
177
|
+
sections.push('4. **Key Files** — 10-15 most important files with one-line role descriptions');
|
|
178
|
+
sections.push('5. **Conventions** — naming, IDs, patterns an agent should follow');
|
|
179
|
+
sections.push('6. **When Modifying** — operational guidelines (what to read first, what not to break)');
|
|
180
|
+
sections.push('');
|
|
181
|
+
sections.push('Do NOT include:');
|
|
182
|
+
sections.push('- File trees (too verbose, stale quickly)');
|
|
183
|
+
sections.push('- Full dependency lists (use package.json)');
|
|
184
|
+
sections.push('- Full script listings (use npm run)');
|
|
185
|
+
sections.push('- Auto-generated boilerplate or timestamps');
|
|
186
|
+
sections.push('');
|
|
187
|
+
if (scan.existingCortexMd) {
|
|
188
|
+
sections.push('An existing CORTEX.md was found. Suggest improvements and incorporate new findings.');
|
|
189
|
+
sections.push('Preserve any manually-written sections that are still accurate.');
|
|
190
|
+
}
|
|
191
|
+
sections.push(`Write the file to: ${scan.targetPath}`);
|
|
192
|
+
return sections.join('\n');
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Execute the init_cortex_context tool.
|
|
196
|
+
*
|
|
197
|
+
* When called by the model as a tool, returns scan data + writing instructions
|
|
198
|
+
* so the model writes CORTEX.md itself (via an /init flow).
|
|
199
|
+
* Also auto-creates MEMORY.md if none exists.
|
|
200
|
+
*/
|
|
201
|
+
static async execute(input, workingDir) {
|
|
202
|
+
try {
|
|
203
|
+
const scope = input.scope || 'auto';
|
|
204
|
+
const dryRun = input.dry_run || false;
|
|
205
|
+
const scan = await this.scan(workingDir, {
|
|
206
|
+
scope,
|
|
207
|
+
max_depth: input.max_depth,
|
|
208
|
+
});
|
|
209
|
+
// Auto-create MEMORY.md if none exists
|
|
210
|
+
const targetDir = path.dirname(scan.targetPath);
|
|
211
|
+
await fs.mkdir(targetDir, { recursive: true });
|
|
212
|
+
let memoryCreated = false;
|
|
213
|
+
const memoryMdPath = path.join(targetDir, 'MEMORY.md');
|
|
214
|
+
const scanDir = scope === 'global' ? process.env.HOME || '~' : workingDir;
|
|
215
|
+
const memoryLocations = [
|
|
216
|
+
memoryMdPath,
|
|
217
|
+
path.join(scanDir, '.claude', 'MEMORY.md'),
|
|
218
|
+
path.join(scanDir, 'MEMORY.md'),
|
|
219
|
+
];
|
|
220
|
+
let memoryExists = false;
|
|
221
|
+
for (const loc of memoryLocations) {
|
|
222
|
+
try {
|
|
223
|
+
await fs.access(loc);
|
|
224
|
+
memoryExists = true;
|
|
225
|
+
break;
|
|
226
|
+
}
|
|
227
|
+
catch { }
|
|
228
|
+
}
|
|
229
|
+
if (!memoryExists && !dryRun) {
|
|
230
|
+
const memoryTemplate = `# Memory
|
|
231
|
+
|
|
232
|
+
Persistent cross-session memory for this project — injected as a system message
|
|
233
|
+
on every conversation turn. Maintain it with your file tools: keep it small,
|
|
234
|
+
current, and factual (it costs context every turn). Record patterns as they
|
|
235
|
+
emerge; delete what turns out to be wrong.
|
|
236
|
+
|
|
237
|
+
Capability discovery (for a first session here): \`Skill\` with
|
|
238
|
+
\`command: "list"\` shows the installed skill library (autoresearch,
|
|
239
|
+
cortex-bench, best-of-n, verify-work, the document skills, …); \`Task\` with
|
|
240
|
+
\`subagent_type: "list"\` shows the agent profiles. Remove this paragraph once
|
|
241
|
+
you know the install.
|
|
242
|
+
|
|
243
|
+
## Project Patterns
|
|
244
|
+
|
|
245
|
+
## Key Files
|
|
246
|
+
|
|
247
|
+
## Known Issues
|
|
248
|
+
`;
|
|
249
|
+
await fs.writeFile(memoryMdPath, memoryTemplate, 'utf-8');
|
|
250
|
+
memoryCreated = true;
|
|
251
|
+
}
|
|
252
|
+
// Return scan data for the model to write CORTEX.md
|
|
253
|
+
const prompt = this.formatScanAsPrompt(scan);
|
|
254
|
+
let message;
|
|
255
|
+
if (dryRun) {
|
|
256
|
+
message = `DRY RUN - Project scan complete. Would write to: ${scan.targetPath}\n\n${prompt}`;
|
|
257
|
+
}
|
|
258
|
+
else {
|
|
259
|
+
message = prompt;
|
|
260
|
+
if (memoryCreated) {
|
|
261
|
+
message += `\n\nNote: MEMORY.md was auto-created at ${memoryMdPath}`;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
return {
|
|
265
|
+
status: 'success',
|
|
266
|
+
message,
|
|
267
|
+
cortexPath: scan.targetPath,
|
|
268
|
+
memoryPath: memoryCreated ? memoryMdPath : undefined,
|
|
269
|
+
dryRun,
|
|
270
|
+
tree: scan.tree,
|
|
271
|
+
dependencyCount: scan.dependencies.length,
|
|
272
|
+
scriptCount: scan.scripts.length
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
catch (error) {
|
|
276
|
+
return {
|
|
277
|
+
status: 'error',
|
|
278
|
+
message: `Failed to scan project: ${error.message}`,
|
|
279
|
+
dryRun: input.dry_run || false
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Analyze project directory and gather context
|
|
285
|
+
*/
|
|
286
|
+
static async analyzeProject(baseDir, maxDepth, includeSizes) {
|
|
287
|
+
const isMonorepo = await this.detectMonorepo(baseDir);
|
|
288
|
+
const tree = await this.generateFileTree(baseDir, maxDepth, includeSizes);
|
|
289
|
+
const dependencies = await this.analyzeDependencies(baseDir, isMonorepo);
|
|
290
|
+
const scripts = await this.analyzeScripts(baseDir);
|
|
291
|
+
const readmeContent = await this.readProjectDescription(baseDir);
|
|
292
|
+
const packages = isMonorepo ? await this.analyzePackages(baseDir) : undefined;
|
|
293
|
+
const keyDirectories = await this.identifyKeyDirectories(baseDir, packages);
|
|
294
|
+
const architecturePatterns = await this.detectArchitecturePatterns(baseDir);
|
|
295
|
+
const overview = await this.generateOverview(baseDir, dependencies, readmeContent, packages);
|
|
296
|
+
return {
|
|
297
|
+
tree,
|
|
298
|
+
dependencies,
|
|
299
|
+
scripts,
|
|
300
|
+
overview,
|
|
301
|
+
isMonorepo,
|
|
302
|
+
packages,
|
|
303
|
+
readmeContent,
|
|
304
|
+
keyDirectories,
|
|
305
|
+
architecturePatterns
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Check if entry should be included based on patterns
|
|
310
|
+
*/
|
|
311
|
+
static shouldIncludeEntry(entry, depth) {
|
|
312
|
+
const name = entry.name;
|
|
313
|
+
// Exclude by directory name
|
|
314
|
+
if (EXCLUDE_PATTERNS.includes(name))
|
|
315
|
+
return false;
|
|
316
|
+
// Exclude test files by pattern
|
|
317
|
+
if (name.match(/^test-.*\.(ts|js|sh|cjs)$/))
|
|
318
|
+
return false;
|
|
319
|
+
// Exclude XAI test artifacts
|
|
320
|
+
if (name.match(/^xai-.*\.json$/))
|
|
321
|
+
return false;
|
|
322
|
+
// Exclude build cache
|
|
323
|
+
if (name.endsWith('.tsbuildinfo'))
|
|
324
|
+
return false;
|
|
325
|
+
// Exclude log files
|
|
326
|
+
if (name.endsWith('.log'))
|
|
327
|
+
return false;
|
|
328
|
+
// Exclude lock files
|
|
329
|
+
if (name === 'package-lock.json')
|
|
330
|
+
return false;
|
|
331
|
+
// At root level (depth 0), exclude most markdown files
|
|
332
|
+
if (depth === 0 && name.endsWith('.md')) {
|
|
333
|
+
const keepList = ['README.md', 'CLAUDE.md', 'QUICK_START.md'];
|
|
334
|
+
return keepList.includes(name);
|
|
335
|
+
}
|
|
336
|
+
return true;
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* Generate file tree with selective expansion
|
|
340
|
+
*/
|
|
341
|
+
static async generateFileTree(baseDir, maxDepth, includeSizes) {
|
|
342
|
+
const lines = [];
|
|
343
|
+
const baseName = path.basename(baseDir);
|
|
344
|
+
lines.push(baseName + '/');
|
|
345
|
+
await this.walkDirectorySelective(baseDir, '', 0, maxDepth, lines, baseDir, includeSizes);
|
|
346
|
+
return lines.join('\n');
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Selective directory walker - expands important paths, collapses others
|
|
350
|
+
*/
|
|
351
|
+
static async walkDirectorySelective(dir, prefix, depth, maxDepth, lines, baseDir, includeSizes) {
|
|
352
|
+
if (depth >= maxDepth)
|
|
353
|
+
return;
|
|
354
|
+
try {
|
|
355
|
+
const entries = await fs.readdir(dir, { withFileTypes: true });
|
|
356
|
+
const filtered = entries.filter(e => this.shouldIncludeEntry(e, depth));
|
|
357
|
+
const sorted = filtered.sort((a, b) => {
|
|
358
|
+
// Directories first, then alphabetical
|
|
359
|
+
if (a.isDirectory() && !b.isDirectory())
|
|
360
|
+
return -1;
|
|
361
|
+
if (!a.isDirectory() && b.isDirectory())
|
|
362
|
+
return 1;
|
|
363
|
+
return a.name.localeCompare(b.name);
|
|
364
|
+
});
|
|
365
|
+
const relativePath = path.relative(baseDir, dir);
|
|
366
|
+
for (let i = 0; i < sorted.length; i++) {
|
|
367
|
+
const entry = sorted[i];
|
|
368
|
+
if (!entry)
|
|
369
|
+
continue;
|
|
370
|
+
const isLast = i === sorted.length - 1;
|
|
371
|
+
const connector = isLast ? '└── ' : '├── ';
|
|
372
|
+
const extension = isLast ? ' ' : '│ ';
|
|
373
|
+
const entryPath = path.join(dir, entry.name);
|
|
374
|
+
const relativeEntryPath = path.relative(baseDir, entryPath);
|
|
375
|
+
if (entry.isDirectory()) {
|
|
376
|
+
const description = this.getEnhancedDescription(entry.name, relativeEntryPath);
|
|
377
|
+
let sizeStr = '';
|
|
378
|
+
if (includeSizes) {
|
|
379
|
+
try {
|
|
380
|
+
const stats = await fs.stat(entryPath);
|
|
381
|
+
sizeStr = ` [${this.formatSize(stats.size)}]`;
|
|
382
|
+
}
|
|
383
|
+
catch {
|
|
384
|
+
// Ignore stat errors
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
lines.push(`${prefix}${connector}${entry.name}/${sizeStr}${description ? ` # ${description}` : ''}`);
|
|
388
|
+
// Decide whether to expand this directory
|
|
389
|
+
if (this.shouldExpand(relativeEntryPath, depth)) {
|
|
390
|
+
// Show key files and subdirectories
|
|
391
|
+
await this.expandDirectory(entryPath, prefix + extension, depth + 1, maxDepth, lines, baseDir, includeSizes);
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
else {
|
|
395
|
+
// Only show important files
|
|
396
|
+
if (this.isImportantFile(entry.name, relativePath)) {
|
|
397
|
+
const description = this.getFileDescription(entry.name, relativeEntryPath);
|
|
398
|
+
let sizeStr = '';
|
|
399
|
+
if (includeSizes) {
|
|
400
|
+
try {
|
|
401
|
+
const stats = await fs.stat(entryPath);
|
|
402
|
+
sizeStr = ` [${this.formatSize(stats.size)}]`;
|
|
403
|
+
}
|
|
404
|
+
catch {
|
|
405
|
+
// Ignore stat errors
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
lines.push(`${prefix}${connector}${entry.name}${sizeStr}${description ? ` # ${description}` : ''}`);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
// Add blank line after major sections at root level
|
|
413
|
+
if (depth === 0 && sorted.length > 0) {
|
|
414
|
+
lines.push('│');
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
catch (error) {
|
|
418
|
+
// Ignore permission errors
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* Expand directory showing key contents
|
|
423
|
+
*/
|
|
424
|
+
static async expandDirectory(dir, prefix, depth, maxDepth, lines, baseDir, includeSizes) {
|
|
425
|
+
if (depth >= maxDepth)
|
|
426
|
+
return;
|
|
427
|
+
try {
|
|
428
|
+
const entries = await fs.readdir(dir, { withFileTypes: true });
|
|
429
|
+
const filtered = entries.filter(e => this.shouldIncludeEntry(e, depth));
|
|
430
|
+
// Separate directories and important files
|
|
431
|
+
const dirs = filtered.filter(e => e.isDirectory());
|
|
432
|
+
const files = filtered.filter(e => !e.isDirectory() && this.isImportantFile(e.name, path.relative(baseDir, dir)));
|
|
433
|
+
const sorted = [...dirs, ...files].sort((a, b) => {
|
|
434
|
+
if (a.isDirectory() && !b.isDirectory())
|
|
435
|
+
return -1;
|
|
436
|
+
if (!a.isDirectory() && b.isDirectory())
|
|
437
|
+
return 1;
|
|
438
|
+
return a.name.localeCompare(b.name);
|
|
439
|
+
});
|
|
440
|
+
for (let i = 0; i < sorted.length; i++) {
|
|
441
|
+
const entry = sorted[i];
|
|
442
|
+
if (!entry)
|
|
443
|
+
continue;
|
|
444
|
+
const isLast = i === sorted.length - 1;
|
|
445
|
+
const connector = isLast ? '└── ' : '├── ';
|
|
446
|
+
const extension = isLast ? ' ' : '│ ';
|
|
447
|
+
const entryPath = path.join(dir, entry.name);
|
|
448
|
+
const relativeEntryPath = path.relative(baseDir, entryPath);
|
|
449
|
+
if (entry.isDirectory()) {
|
|
450
|
+
const description = this.getEnhancedDescription(entry.name, relativeEntryPath);
|
|
451
|
+
let sizeStr = '';
|
|
452
|
+
if (includeSizes) {
|
|
453
|
+
try {
|
|
454
|
+
const stats = await fs.stat(entryPath);
|
|
455
|
+
sizeStr = ` [${this.formatSize(stats.size)}]`;
|
|
456
|
+
}
|
|
457
|
+
catch {
|
|
458
|
+
// Ignore stat errors
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
lines.push(`${prefix}${connector}${entry.name}/${sizeStr}${description ? ` # ${description}` : ''}`);
|
|
462
|
+
// Recursively expand if important
|
|
463
|
+
if (this.shouldExpand(relativeEntryPath, depth)) {
|
|
464
|
+
await this.expandDirectory(entryPath, prefix + extension, depth + 1, maxDepth, lines, baseDir, includeSizes);
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
else {
|
|
468
|
+
const description = this.getFileDescription(entry.name, relativeEntryPath);
|
|
469
|
+
let sizeStr = '';
|
|
470
|
+
if (includeSizes) {
|
|
471
|
+
try {
|
|
472
|
+
const stats = await fs.stat(entryPath);
|
|
473
|
+
sizeStr = ` [${this.formatSize(stats.size)}]`;
|
|
474
|
+
}
|
|
475
|
+
catch {
|
|
476
|
+
// Ignore stat errors
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
lines.push(`${prefix}${connector}${entry.name}${sizeStr}${description ? ` # ${description}` : ''}`);
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
catch (error) {
|
|
484
|
+
// Ignore permission errors
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
/**
|
|
488
|
+
* Check if directory should be expanded
|
|
489
|
+
*/
|
|
490
|
+
static shouldExpand(relativePath, depth) {
|
|
491
|
+
// Expand packages and their immediate children (packages/cli, packages/core, etc.)
|
|
492
|
+
if (relativePath.match(/^packages\/[^/]+$/))
|
|
493
|
+
return true;
|
|
494
|
+
// Expand src/, bin/, tests/ directories inside packages
|
|
495
|
+
if (relativePath.match(/^packages\/[^/]+\/(src|bin|tests|docs)$/))
|
|
496
|
+
return true;
|
|
497
|
+
// Expand key subdirectories in src/
|
|
498
|
+
if (relativePath.match(/^packages\/[^/]+\/src\/(orchestrator|providers|tools|commands|themes|routes|mcp|session|system-messages)$/))
|
|
499
|
+
return true;
|
|
500
|
+
// Expand .cortex and its subdirectories
|
|
501
|
+
if (relativePath === '.cortex')
|
|
502
|
+
return true;
|
|
503
|
+
if (relativePath === '.cortex/system-messages')
|
|
504
|
+
return true;
|
|
505
|
+
// Expand scripts at root
|
|
506
|
+
if (relativePath === 'scripts')
|
|
507
|
+
return true;
|
|
508
|
+
// Stop at depth 4 to prevent excessive nesting
|
|
509
|
+
if (depth >= 4)
|
|
510
|
+
return false;
|
|
511
|
+
// Default: expand everything else up to depth limit
|
|
512
|
+
return depth < 3;
|
|
513
|
+
}
|
|
514
|
+
/**
|
|
515
|
+
* Check if file is important enough to show
|
|
516
|
+
*/
|
|
517
|
+
static isImportantFile(fileName, parentPath) {
|
|
518
|
+
// Always show package.json, tsconfig.json, README.md, .env files
|
|
519
|
+
if (['package.json', 'tsconfig.json', 'README.md', '.env', '.env.example', '.gitignore'].includes(fileName))
|
|
520
|
+
return true;
|
|
521
|
+
// Show main entry points
|
|
522
|
+
if (fileName === 'index.ts' || fileName === 'index.js')
|
|
523
|
+
return true;
|
|
524
|
+
// Show all TypeScript/JavaScript files in key directories
|
|
525
|
+
if (parentPath.match(/packages\/(cli|core|server)\/src$/) && fileName.match(/\.(ts|js)$/)) {
|
|
526
|
+
return true;
|
|
527
|
+
}
|
|
528
|
+
// In bin/, show all executables
|
|
529
|
+
if (parentPath.endsWith('/bin'))
|
|
530
|
+
return true;
|
|
531
|
+
// Show markdown files in docs/
|
|
532
|
+
if (parentPath.match(/\/docs$/) && fileName.endsWith('.md')) {
|
|
533
|
+
return true;
|
|
534
|
+
}
|
|
535
|
+
// Show scripts
|
|
536
|
+
if (parentPath === 'scripts' && fileName.match(/\.(sh|js|ts)$/)) {
|
|
537
|
+
return true;
|
|
538
|
+
}
|
|
539
|
+
return false;
|
|
540
|
+
}
|
|
541
|
+
/**
|
|
542
|
+
* Get enhanced description for directories
|
|
543
|
+
*/
|
|
544
|
+
static getEnhancedDescription(dirName, relativePath) {
|
|
545
|
+
// Package descriptions
|
|
546
|
+
if (relativePath === 'packages/cli')
|
|
547
|
+
return 'CLI interface and UI';
|
|
548
|
+
if (relativePath === 'packages/core')
|
|
549
|
+
return 'Core orchestration library';
|
|
550
|
+
if (relativePath === 'packages/server')
|
|
551
|
+
return 'HTTP server (optional)';
|
|
552
|
+
if (relativePath === 'packages/executors')
|
|
553
|
+
return 'Tool execution layer';
|
|
554
|
+
if (relativePath === 'packages/types')
|
|
555
|
+
return 'Shared TypeScript types';
|
|
556
|
+
// Core subdirectories
|
|
557
|
+
if (relativePath === 'packages/core/src')
|
|
558
|
+
return 'TypeScript source';
|
|
559
|
+
if (relativePath.endsWith('/orchestrator'))
|
|
560
|
+
return 'Main orchestrator engine';
|
|
561
|
+
if (relativePath.endsWith('/providers'))
|
|
562
|
+
return 'AI provider adapters';
|
|
563
|
+
if (relativePath.endsWith('/tools'))
|
|
564
|
+
return 'Tool definitions';
|
|
565
|
+
if (relativePath.endsWith('/mcp'))
|
|
566
|
+
return 'MCP integration';
|
|
567
|
+
if (relativePath.endsWith('/system-messages'))
|
|
568
|
+
return 'Auto-loaded messages';
|
|
569
|
+
if (relativePath.endsWith('/session'))
|
|
570
|
+
return 'Session management';
|
|
571
|
+
if (relativePath.endsWith('/models'))
|
|
572
|
+
return 'Model registry';
|
|
573
|
+
// CLI subdirectories
|
|
574
|
+
if (relativePath === 'packages/cli/src')
|
|
575
|
+
return 'TypeScript source';
|
|
576
|
+
if (relativePath.endsWith('/commands'))
|
|
577
|
+
return 'Command handlers';
|
|
578
|
+
if (relativePath.endsWith('/themes'))
|
|
579
|
+
return 'UI themes';
|
|
580
|
+
// Common patterns
|
|
581
|
+
if (dirName === 'src')
|
|
582
|
+
return 'Source code';
|
|
583
|
+
if (dirName === 'tests')
|
|
584
|
+
return 'Test files';
|
|
585
|
+
if (dirName === 'bin')
|
|
586
|
+
return 'Executables';
|
|
587
|
+
if (dirName === 'docs')
|
|
588
|
+
return 'Documentation';
|
|
589
|
+
if (dirName === 'scripts')
|
|
590
|
+
return 'Build and utility scripts';
|
|
591
|
+
// Config
|
|
592
|
+
if (relativePath === '.cortex')
|
|
593
|
+
return 'Project context (auto-loaded)';
|
|
594
|
+
if (relativePath === '.cortex/system-messages')
|
|
595
|
+
return 'Custom system messages';
|
|
596
|
+
return '';
|
|
597
|
+
}
|
|
598
|
+
/**
|
|
599
|
+
* Get description for files
|
|
600
|
+
*/
|
|
601
|
+
static getFileDescription(fileName, relativePath) {
|
|
602
|
+
// Entry points
|
|
603
|
+
if (fileName === 'index.ts' && relativePath.includes('orchestrator'))
|
|
604
|
+
return 'Orchestrator exports';
|
|
605
|
+
if (fileName === 'CortexOrchestrator.ts')
|
|
606
|
+
return 'Main orchestrator';
|
|
607
|
+
// Config files
|
|
608
|
+
if (fileName === 'package.json')
|
|
609
|
+
return 'Package config';
|
|
610
|
+
if (fileName === 'tsconfig.json')
|
|
611
|
+
return 'TypeScript config';
|
|
612
|
+
return '';
|
|
613
|
+
}
|
|
614
|
+
/**
|
|
615
|
+
* Format file size
|
|
616
|
+
*/
|
|
617
|
+
static formatSize(bytes) {
|
|
618
|
+
if (bytes < 1024)
|
|
619
|
+
return `${bytes}B`;
|
|
620
|
+
if (bytes < 1024 * 1024)
|
|
621
|
+
return `${(bytes / 1024).toFixed(1)}KB`;
|
|
622
|
+
return `${(bytes / (1024 * 1024)).toFixed(1)}MB`;
|
|
623
|
+
}
|
|
624
|
+
/**
|
|
625
|
+
* Analyze dependencies from various manifest files
|
|
626
|
+
*/
|
|
627
|
+
static async analyzeDependencies(baseDir, isMonorepo) {
|
|
628
|
+
const deps = [];
|
|
629
|
+
if (isMonorepo) {
|
|
630
|
+
// For monorepo: aggregate workspace dependencies
|
|
631
|
+
const allDeps = new Set();
|
|
632
|
+
const allDevDeps = new Set();
|
|
633
|
+
try {
|
|
634
|
+
const packagesDir = path.join(baseDir, 'packages');
|
|
635
|
+
const entries = await fs.readdir(packagesDir, { withFileTypes: true });
|
|
636
|
+
for (const entry of entries) {
|
|
637
|
+
if (!entry.isDirectory())
|
|
638
|
+
continue;
|
|
639
|
+
const pkgJsonPath = path.join(packagesDir, entry.name, 'package.json');
|
|
640
|
+
try {
|
|
641
|
+
const content = await fs.readFile(pkgJsonPath, 'utf-8');
|
|
642
|
+
const pkg = JSON.parse(content);
|
|
643
|
+
Object.keys(pkg.dependencies || {}).forEach(dep => allDeps.add(dep));
|
|
644
|
+
Object.keys(pkg.devDependencies || {}).forEach(dep => allDevDeps.add(dep));
|
|
645
|
+
}
|
|
646
|
+
catch { }
|
|
647
|
+
}
|
|
648
|
+
if (allDeps.size > 0 || allDevDeps.size > 0) {
|
|
649
|
+
const main = Array.from(allDeps).slice(0, 5);
|
|
650
|
+
deps.push({
|
|
651
|
+
type: 'npm',
|
|
652
|
+
file: 'packages/*/package.json',
|
|
653
|
+
count: allDeps.size + allDevDeps.size,
|
|
654
|
+
main
|
|
655
|
+
});
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
catch { }
|
|
659
|
+
}
|
|
660
|
+
else {
|
|
661
|
+
// Single package.json
|
|
662
|
+
const pkgJsonPath = path.join(baseDir, 'package.json');
|
|
663
|
+
try {
|
|
664
|
+
const content = await fs.readFile(pkgJsonPath, 'utf-8');
|
|
665
|
+
const pkg = JSON.parse(content);
|
|
666
|
+
const depCount = Object.keys(pkg.dependencies || {}).length +
|
|
667
|
+
Object.keys(pkg.devDependencies || {}).length;
|
|
668
|
+
const main = Object.keys(pkg.dependencies || {}).slice(0, 5);
|
|
669
|
+
deps.push({ type: 'npm', file: 'package.json', count: depCount, main });
|
|
670
|
+
}
|
|
671
|
+
catch { }
|
|
672
|
+
}
|
|
673
|
+
// Python (requirements.txt, pyproject.toml)
|
|
674
|
+
const reqTxtPath = path.join(baseDir, 'requirements.txt');
|
|
675
|
+
try {
|
|
676
|
+
const content = await fs.readFile(reqTxtPath, 'utf-8');
|
|
677
|
+
const lines = content.split('\n').filter(l => l.trim() && !l.startsWith('#'));
|
|
678
|
+
const main = lines.slice(0, 5).map(l => l.split('==')[0] || l).map(s => s.trim());
|
|
679
|
+
deps.push({ type: 'python', file: 'requirements.txt', count: lines.length, main });
|
|
680
|
+
}
|
|
681
|
+
catch { }
|
|
682
|
+
// Rust (Cargo.toml)
|
|
683
|
+
const cargoPath = path.join(baseDir, 'Cargo.toml');
|
|
684
|
+
try {
|
|
685
|
+
const content = await fs.readFile(cargoPath, 'utf-8');
|
|
686
|
+
const depMatches = content.match(/\[dependencies\]([\s\S]*?)(\[|$)/);
|
|
687
|
+
if (depMatches && depMatches[1]) {
|
|
688
|
+
const depLines = depMatches[1].split('\n').filter(l => l.trim() && !l.startsWith('#'));
|
|
689
|
+
const main = depLines.slice(0, 5).map(l => l.split('=')[0] || l).map(s => s.trim());
|
|
690
|
+
deps.push({ type: 'rust', file: 'Cargo.toml', count: depLines.length, main });
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
catch { }
|
|
694
|
+
// Go (go.mod)
|
|
695
|
+
const goModPath = path.join(baseDir, 'go.mod');
|
|
696
|
+
try {
|
|
697
|
+
const content = await fs.readFile(goModPath, 'utf-8');
|
|
698
|
+
const requireMatches = content.match(/require \(([\s\S]*?)\)/);
|
|
699
|
+
if (requireMatches && requireMatches[1]) {
|
|
700
|
+
const depLines = requireMatches[1].split('\n').filter(l => l.trim());
|
|
701
|
+
const main = depLines.slice(0, 5).map(l => l.split(' ')[0] || l).map(s => s.trim());
|
|
702
|
+
deps.push({ type: 'go', file: 'go.mod', count: depLines.length, main });
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
catch { }
|
|
706
|
+
return deps;
|
|
707
|
+
}
|
|
708
|
+
/**
|
|
709
|
+
* Analyze scripts from package.json, Makefile, etc.
|
|
710
|
+
*/
|
|
711
|
+
static async analyzeScripts(baseDir) {
|
|
712
|
+
const scripts = [];
|
|
713
|
+
// package.json scripts
|
|
714
|
+
const pkgJsonPath = path.join(baseDir, 'package.json');
|
|
715
|
+
try {
|
|
716
|
+
const content = await fs.readFile(pkgJsonPath, 'utf-8');
|
|
717
|
+
const pkg = JSON.parse(content);
|
|
718
|
+
if (pkg.scripts) {
|
|
719
|
+
for (const [name, command] of Object.entries(pkg.scripts)) {
|
|
720
|
+
scripts.push({
|
|
721
|
+
source: 'package.json',
|
|
722
|
+
name,
|
|
723
|
+
command: command
|
|
724
|
+
});
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
catch { }
|
|
729
|
+
// Makefile targets (basic extraction)
|
|
730
|
+
const makefilePath = path.join(baseDir, 'Makefile');
|
|
731
|
+
try {
|
|
732
|
+
const content = await fs.readFile(makefilePath, 'utf-8');
|
|
733
|
+
const targetMatches = content.matchAll(/^([a-zA-Z0-9_-]+):/gm);
|
|
734
|
+
for (const match of targetMatches) {
|
|
735
|
+
if (match[1]) {
|
|
736
|
+
scripts.push({
|
|
737
|
+
source: 'Makefile',
|
|
738
|
+
name: match[1],
|
|
739
|
+
command: `make ${match[1]}`
|
|
740
|
+
});
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
catch { }
|
|
745
|
+
return scripts;
|
|
746
|
+
}
|
|
747
|
+
/**
|
|
748
|
+
* Detect if project is a monorepo
|
|
749
|
+
*/
|
|
750
|
+
static async detectMonorepo(baseDir) {
|
|
751
|
+
try {
|
|
752
|
+
// Check for packages/ directory
|
|
753
|
+
const packagesDir = path.join(baseDir, 'packages');
|
|
754
|
+
try {
|
|
755
|
+
const stat = await fs.stat(packagesDir);
|
|
756
|
+
if (stat.isDirectory())
|
|
757
|
+
return true;
|
|
758
|
+
}
|
|
759
|
+
catch { }
|
|
760
|
+
// Check for workspace configuration in package.json
|
|
761
|
+
const pkgJsonPath = path.join(baseDir, 'package.json');
|
|
762
|
+
try {
|
|
763
|
+
const content = await fs.readFile(pkgJsonPath, 'utf-8');
|
|
764
|
+
const pkg = JSON.parse(content);
|
|
765
|
+
if (pkg.workspaces)
|
|
766
|
+
return true;
|
|
767
|
+
}
|
|
768
|
+
catch { }
|
|
769
|
+
// Check for lerna.json
|
|
770
|
+
const lernaPath = path.join(baseDir, 'lerna.json');
|
|
771
|
+
try {
|
|
772
|
+
await fs.access(lernaPath);
|
|
773
|
+
return true;
|
|
774
|
+
}
|
|
775
|
+
catch { }
|
|
776
|
+
// Check for pnpm-workspace.yaml
|
|
777
|
+
const pnpmPath = path.join(baseDir, 'pnpm-workspace.yaml');
|
|
778
|
+
try {
|
|
779
|
+
await fs.access(pnpmPath);
|
|
780
|
+
return true;
|
|
781
|
+
}
|
|
782
|
+
catch { }
|
|
783
|
+
return false;
|
|
784
|
+
}
|
|
785
|
+
catch {
|
|
786
|
+
return false;
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
/**
|
|
790
|
+
* Read project description from README.md
|
|
791
|
+
*/
|
|
792
|
+
static async readProjectDescription(baseDir) {
|
|
793
|
+
try {
|
|
794
|
+
const readmePath = path.join(baseDir, 'README.md');
|
|
795
|
+
const content = await fs.readFile(readmePath, 'utf-8');
|
|
796
|
+
// Extract first meaningful paragraph (after title)
|
|
797
|
+
const lines = content.split('\n');
|
|
798
|
+
let description = '';
|
|
799
|
+
let foundTitle = false;
|
|
800
|
+
for (const line of lines) {
|
|
801
|
+
const trimmed = line.trim();
|
|
802
|
+
// Skip title line
|
|
803
|
+
if (trimmed.startsWith('#')) {
|
|
804
|
+
foundTitle = true;
|
|
805
|
+
continue;
|
|
806
|
+
}
|
|
807
|
+
// Skip empty lines until we find content
|
|
808
|
+
if (!trimmed)
|
|
809
|
+
continue;
|
|
810
|
+
// Get first paragraph after title
|
|
811
|
+
if (foundTitle && trimmed && !trimmed.startsWith('```')) {
|
|
812
|
+
description = trimmed;
|
|
813
|
+
break;
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
// Limit to 200 chars
|
|
817
|
+
if (description.length > 200) {
|
|
818
|
+
description = description.substring(0, 197) + '...';
|
|
819
|
+
}
|
|
820
|
+
return description || undefined;
|
|
821
|
+
}
|
|
822
|
+
catch {
|
|
823
|
+
return undefined;
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
/**
|
|
827
|
+
* Analyze packages in a monorepo
|
|
828
|
+
*/
|
|
829
|
+
static async analyzePackages(baseDir) {
|
|
830
|
+
const packages = [];
|
|
831
|
+
try {
|
|
832
|
+
const packagesDir = path.join(baseDir, 'packages');
|
|
833
|
+
try {
|
|
834
|
+
await fs.access(packagesDir);
|
|
835
|
+
}
|
|
836
|
+
catch {
|
|
837
|
+
return packages; // No packages/ directory
|
|
838
|
+
}
|
|
839
|
+
const entries = await fs.readdir(packagesDir, { withFileTypes: true });
|
|
840
|
+
for (const entry of entries) {
|
|
841
|
+
if (!entry.isDirectory())
|
|
842
|
+
continue;
|
|
843
|
+
const pkgPath = path.join(packagesDir, entry.name);
|
|
844
|
+
const pkgJsonPath = path.join(pkgPath, 'package.json');
|
|
845
|
+
try {
|
|
846
|
+
const content = await fs.readFile(pkgJsonPath, 'utf-8');
|
|
847
|
+
const pkg = JSON.parse(content);
|
|
848
|
+
packages.push({
|
|
849
|
+
name: pkg.name || entry.name,
|
|
850
|
+
path: `packages/${entry.name}`,
|
|
851
|
+
description: pkg.description,
|
|
852
|
+
type: this.inferPackageType(entry.name, pkg)
|
|
853
|
+
});
|
|
854
|
+
}
|
|
855
|
+
catch {
|
|
856
|
+
// Package doesn't have package.json, skip it
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
catch { }
|
|
861
|
+
return packages;
|
|
862
|
+
}
|
|
863
|
+
/**
|
|
864
|
+
* Infer package type from name and package.json
|
|
865
|
+
*/
|
|
866
|
+
static inferPackageType(dirName, pkg) {
|
|
867
|
+
const name = dirName.toLowerCase();
|
|
868
|
+
if (name.includes('cli') || pkg.bin)
|
|
869
|
+
return 'CLI';
|
|
870
|
+
if (name.includes('core'))
|
|
871
|
+
return 'Core Library';
|
|
872
|
+
if (name.includes('server') || name.includes('api'))
|
|
873
|
+
return 'Server';
|
|
874
|
+
if (name.includes('ui') || name.includes('component'))
|
|
875
|
+
return 'UI Components';
|
|
876
|
+
if (name.includes('util') || name.includes('helper'))
|
|
877
|
+
return 'Utilities';
|
|
878
|
+
if (name.includes('test'))
|
|
879
|
+
return 'Testing';
|
|
880
|
+
return undefined;
|
|
881
|
+
}
|
|
882
|
+
/**
|
|
883
|
+
* Generate project overview
|
|
884
|
+
*/
|
|
885
|
+
static async generateOverview(baseDir, deps, readmeContent, packages) {
|
|
886
|
+
const sections = [];
|
|
887
|
+
// Add README description if available
|
|
888
|
+
if (readmeContent) {
|
|
889
|
+
sections.push(readmeContent);
|
|
890
|
+
sections.push(''); // Blank line
|
|
891
|
+
}
|
|
892
|
+
const parts = [];
|
|
893
|
+
// Detect project type
|
|
894
|
+
const types = [];
|
|
895
|
+
if (deps.some(d => d.type === 'npm'))
|
|
896
|
+
types.push('Node.js/TypeScript');
|
|
897
|
+
if (deps.some(d => d.type === 'python'))
|
|
898
|
+
types.push('Python');
|
|
899
|
+
if (deps.some(d => d.type === 'rust'))
|
|
900
|
+
types.push('Rust');
|
|
901
|
+
if (deps.some(d => d.type === 'go'))
|
|
902
|
+
types.push('Go');
|
|
903
|
+
if (types.length > 0) {
|
|
904
|
+
parts.push(`**Project Type**: ${types.join(', ')}`);
|
|
905
|
+
}
|
|
906
|
+
// Check for monorepo
|
|
907
|
+
if (packages && packages.length > 0) {
|
|
908
|
+
parts.push(`**Architecture**: Monorepo with ${packages.length} packages`);
|
|
909
|
+
}
|
|
910
|
+
// Check for frameworks
|
|
911
|
+
const pkgJsonPath = path.join(baseDir, 'package.json');
|
|
912
|
+
try {
|
|
913
|
+
const content = await fs.readFile(pkgJsonPath, 'utf-8');
|
|
914
|
+
const pkg = JSON.parse(content);
|
|
915
|
+
const allDeps = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
916
|
+
const frameworks = [];
|
|
917
|
+
if (allDeps['react'])
|
|
918
|
+
frameworks.push('React');
|
|
919
|
+
if (allDeps['vue'])
|
|
920
|
+
frameworks.push('Vue');
|
|
921
|
+
if (allDeps['next'])
|
|
922
|
+
frameworks.push('Next.js');
|
|
923
|
+
if (allDeps['express'])
|
|
924
|
+
frameworks.push('Express');
|
|
925
|
+
if (allDeps['fastify'])
|
|
926
|
+
frameworks.push('Fastify');
|
|
927
|
+
if (frameworks.length > 0) {
|
|
928
|
+
parts.push(`**Frameworks**: ${frameworks.join(', ')}`);
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
catch { }
|
|
932
|
+
if (parts.length > 0) {
|
|
933
|
+
sections.push(parts.join(' | '));
|
|
934
|
+
}
|
|
935
|
+
// Add package descriptions for monorepos
|
|
936
|
+
if (packages && packages.length > 0) {
|
|
937
|
+
sections.push(''); // Blank line
|
|
938
|
+
sections.push('**Packages**:');
|
|
939
|
+
packages.forEach(pkg => {
|
|
940
|
+
const typeStr = pkg.type ? ` (${pkg.type})` : '';
|
|
941
|
+
const descStr = pkg.description ? ` - ${pkg.description}` : '';
|
|
942
|
+
sections.push(`- \`${pkg.name}\`${typeStr}${descStr}`);
|
|
943
|
+
});
|
|
944
|
+
}
|
|
945
|
+
return sections.join('\n');
|
|
946
|
+
}
|
|
947
|
+
/**
|
|
948
|
+
* Identify key directories worth highlighting
|
|
949
|
+
*/
|
|
950
|
+
static async identifyKeyDirectories(baseDir, _packages) {
|
|
951
|
+
const keyDirs = [];
|
|
952
|
+
// Check for common patterns
|
|
953
|
+
const patterns = [
|
|
954
|
+
// Core system directories
|
|
955
|
+
{ path: 'packages/core/src/orchestrator', description: 'CortexOrchestrator (main engine)', category: 'core' },
|
|
956
|
+
{ path: 'packages/core/src/providers', description: 'Multi-provider adapters', category: 'core' },
|
|
957
|
+
{ path: 'packages/core/src/tools', description: 'Tool definitions and executors', category: 'tools' },
|
|
958
|
+
{ path: 'packages/core/src/mcp', description: 'Model Context Protocol integration', category: 'core' },
|
|
959
|
+
{ path: 'packages/core/src/system-messages', description: 'System message auto-loading', category: 'core' },
|
|
960
|
+
// CLI interface
|
|
961
|
+
{ path: 'packages/cli/src/commands', description: 'Command handlers and slash commands', category: 'cli' },
|
|
962
|
+
{ path: 'packages/cli/src/themes', description: 'Terminal UI themes', category: 'cli' },
|
|
963
|
+
{ path: 'packages/cli/bin', description: 'CLI entry points', category: 'cli' },
|
|
964
|
+
// Configuration
|
|
965
|
+
{ path: '.cortex', description: 'Auto-loaded project context', category: 'config' },
|
|
966
|
+
{ path: '.cortex/system-messages', description: 'Custom system messages', category: 'config' },
|
|
967
|
+
// Server
|
|
968
|
+
{ path: 'packages/server/src/routes', description: 'REST API endpoints', category: 'other' },
|
|
969
|
+
// General patterns (src, lib, bin)
|
|
970
|
+
{ path: 'src', description: 'Source code', category: 'other' },
|
|
971
|
+
{ path: 'lib', description: 'Library code', category: 'other' },
|
|
972
|
+
{ path: 'bin', description: 'Executable scripts', category: 'other' },
|
|
973
|
+
];
|
|
974
|
+
for (const pattern of patterns) {
|
|
975
|
+
try {
|
|
976
|
+
const fullPath = path.join(baseDir, pattern.path);
|
|
977
|
+
await fs.access(fullPath);
|
|
978
|
+
keyDirs.push(pattern);
|
|
979
|
+
}
|
|
980
|
+
catch {
|
|
981
|
+
// Directory doesn't exist, skip it
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
return keyDirs;
|
|
985
|
+
}
|
|
986
|
+
/**
|
|
987
|
+
* Detect architecture patterns from codebase
|
|
988
|
+
*/
|
|
989
|
+
static async detectArchitecturePatterns(baseDir) {
|
|
990
|
+
const patterns = [];
|
|
991
|
+
// Check for direct-wired architecture
|
|
992
|
+
const orchestratorClientPath = path.join(baseDir, 'packages/cli/src/orchestrator/OrchestratorClient.ts');
|
|
993
|
+
try {
|
|
994
|
+
await fs.access(orchestratorClientPath);
|
|
995
|
+
patterns.push('**Direct-Wired Execution**: Core library imports directly into CLI process for zero-latency tool execution');
|
|
996
|
+
}
|
|
997
|
+
catch { }
|
|
998
|
+
// Check for session management
|
|
999
|
+
const sessionStorePath = path.join(baseDir, 'packages/core/src/session');
|
|
1000
|
+
try {
|
|
1001
|
+
await fs.access(sessionStorePath);
|
|
1002
|
+
patterns.push('**Session Management**: JSONL format with UUID-based message tracking');
|
|
1003
|
+
}
|
|
1004
|
+
catch { }
|
|
1005
|
+
// Check for MCP integration
|
|
1006
|
+
const mcpPath = path.join(baseDir, 'packages/core/src/mcp');
|
|
1007
|
+
try {
|
|
1008
|
+
await fs.access(mcpPath);
|
|
1009
|
+
patterns.push('**MCP Integration**: Full Model Context Protocol support for extended capabilities');
|
|
1010
|
+
}
|
|
1011
|
+
catch { }
|
|
1012
|
+
// Check for system messages
|
|
1013
|
+
const systemMsgPath = path.join(baseDir, 'packages/core/src/system-messages');
|
|
1014
|
+
try {
|
|
1015
|
+
await fs.access(systemMsgPath);
|
|
1016
|
+
patterns.push('**System Messages**: Auto-loaded from .cortex/system-messages/ with hot-reload');
|
|
1017
|
+
}
|
|
1018
|
+
catch { }
|
|
1019
|
+
// Check for multi-provider support
|
|
1020
|
+
const providersPath = path.join(baseDir, 'packages/core/src/providers');
|
|
1021
|
+
try {
|
|
1022
|
+
const entries = await fs.readdir(providersPath);
|
|
1023
|
+
const providerCount = entries.filter(e => e.endsWith('.ts') && !e.includes('Base')).length;
|
|
1024
|
+
if (providerCount > 0) {
|
|
1025
|
+
patterns.push(`**Multi-Provider Support**: ${providerCount}+ AI providers with unified interface`);
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
1028
|
+
catch { }
|
|
1029
|
+
return patterns;
|
|
1030
|
+
}
|
|
1031
|
+
/**
|
|
1032
|
+
* Get the canonical tool definition for init_cortex_context
|
|
1033
|
+
*/
|
|
1034
|
+
static getToolDefinition() {
|
|
1035
|
+
return {
|
|
1036
|
+
name: 'InitCortexContext',
|
|
1037
|
+
description: 'Scan the project and return structured data for you to write a CORTEX.md project context file. You will receive file structure, dependencies, scripts, and architecture patterns. Use this data plus your own analysis to write a concise CORTEX.md (like CLAUDE.md). Write the file yourself using WriteFile.',
|
|
1038
|
+
schema: {
|
|
1039
|
+
type: 'object',
|
|
1040
|
+
properties: {
|
|
1041
|
+
scope: {
|
|
1042
|
+
type: 'string',
|
|
1043
|
+
description: 'Where to generate CORTEX.md: "auto" (current directory) or "global" (~/.cortex/)',
|
|
1044
|
+
enum: ['auto', 'global']
|
|
1045
|
+
},
|
|
1046
|
+
max_depth: {
|
|
1047
|
+
type: 'number',
|
|
1048
|
+
description: 'Maximum depth for file tree (default: auto-detect - 5 for monorepos, 4 for regular projects)'
|
|
1049
|
+
},
|
|
1050
|
+
include_sizes: {
|
|
1051
|
+
type: 'boolean',
|
|
1052
|
+
description: 'Include file sizes in tree (default: false)'
|
|
1053
|
+
},
|
|
1054
|
+
dry_run: {
|
|
1055
|
+
type: 'boolean',
|
|
1056
|
+
description: 'Preview what would be generated without creating file (default: false)'
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
};
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
//# sourceMappingURL=InitCortexContext.js.map
|