@office-ai/aioncli-core 0.1.18-beta.1
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/dist/.last_build +0 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/src/__mocks__/fs/promises.d.ts +11 -0
- package/dist/src/__mocks__/fs/promises.js +17 -0
- package/dist/src/__mocks__/fs/promises.js.map +1 -0
- package/dist/src/code_assist/codeAssist.d.ts +9 -0
- package/dist/src/code_assist/codeAssist.js +19 -0
- package/dist/src/code_assist/codeAssist.js.map +1 -0
- package/dist/src/code_assist/converter.d.ts +70 -0
- package/dist/src/code_assist/converter.js +126 -0
- package/dist/src/code_assist/converter.js.map +1 -0
- package/dist/src/code_assist/converter.test.d.ts +6 -0
- package/dist/src/code_assist/converter.test.js +279 -0
- package/dist/src/code_assist/converter.test.js.map +1 -0
- package/dist/src/code_assist/oauth2.d.ts +20 -0
- package/dist/src/code_assist/oauth2.js +337 -0
- package/dist/src/code_assist/oauth2.js.map +1 -0
- package/dist/src/code_assist/oauth2.test.d.ts +6 -0
- package/dist/src/code_assist/oauth2.test.js +334 -0
- package/dist/src/code_assist/oauth2.test.js.map +1 -0
- package/dist/src/code_assist/server.d.ts +37 -0
- package/dist/src/code_assist/server.js +125 -0
- package/dist/src/code_assist/server.js.map +1 -0
- package/dist/src/code_assist/server.test.d.ts +6 -0
- package/dist/src/code_assist/server.test.js +134 -0
- package/dist/src/code_assist/server.test.js.map +1 -0
- package/dist/src/code_assist/setup.d.ts +20 -0
- package/dist/src/code_assist/setup.js +70 -0
- package/dist/src/code_assist/setup.js.map +1 -0
- package/dist/src/code_assist/setup.test.d.ts +6 -0
- package/dist/src/code_assist/setup.test.js +65 -0
- package/dist/src/code_assist/setup.test.js.map +1 -0
- package/dist/src/code_assist/types.d.ts +148 -0
- package/dist/src/code_assist/types.js +46 -0
- package/dist/src/code_assist/types.js.map +1 -0
- package/dist/src/config/config.d.ts +272 -0
- package/dist/src/config/config.js +554 -0
- package/dist/src/config/config.js.map +1 -0
- package/dist/src/config/config.test.d.ts +6 -0
- package/dist/src/config/config.test.js +365 -0
- package/dist/src/config/config.test.js.map +1 -0
- package/dist/src/config/flashFallback.test.d.ts +6 -0
- package/dist/src/config/flashFallback.test.js +87 -0
- package/dist/src/config/flashFallback.test.js.map +1 -0
- package/dist/src/config/models.d.ts +9 -0
- package/dist/src/config/models.js +10 -0
- package/dist/src/config/models.js.map +1 -0
- package/dist/src/core/client.d.ts +61 -0
- package/dist/src/core/client.js +485 -0
- package/dist/src/core/client.js.map +1 -0
- package/dist/src/core/client.test.d.ts +6 -0
- package/dist/src/core/client.test.js +1008 -0
- package/dist/src/core/client.test.js.map +1 -0
- package/dist/src/core/contentGenerator.d.ts +45 -0
- package/dist/src/core/contentGenerator.js +81 -0
- package/dist/src/core/contentGenerator.js.map +1 -0
- package/dist/src/core/contentGenerator.test.d.ts +6 -0
- package/dist/src/core/contentGenerator.test.js +100 -0
- package/dist/src/core/contentGenerator.test.js.map +1 -0
- package/dist/src/core/coreToolScheduler.d.ts +117 -0
- package/dist/src/core/coreToolScheduler.js +530 -0
- package/dist/src/core/coreToolScheduler.js.map +1 -0
- package/dist/src/core/coreToolScheduler.test.d.ts +6 -0
- package/dist/src/core/coreToolScheduler.test.js +625 -0
- package/dist/src/core/coreToolScheduler.test.js.map +1 -0
- package/dist/src/core/geminiChat.d.ts +118 -0
- package/dist/src/core/geminiChat.js +509 -0
- package/dist/src/core/geminiChat.js.map +1 -0
- package/dist/src/core/geminiChat.test.d.ts +6 -0
- package/dist/src/core/geminiChat.test.js +424 -0
- package/dist/src/core/geminiChat.test.js.map +1 -0
- package/dist/src/core/geminiRequest.d.ts +13 -0
- package/dist/src/core/geminiRequest.js +10 -0
- package/dist/src/core/geminiRequest.js.map +1 -0
- package/dist/src/core/logger.d.ts +37 -0
- package/dist/src/core/logger.js +273 -0
- package/dist/src/core/logger.js.map +1 -0
- package/dist/src/core/logger.test.d.ts +6 -0
- package/dist/src/core/logger.test.js +467 -0
- package/dist/src/core/logger.test.js.map +1 -0
- package/dist/src/core/loggingContentGenerator.d.ts +24 -0
- package/dist/src/core/loggingContentGenerator.js +89 -0
- package/dist/src/core/loggingContentGenerator.js.map +1 -0
- package/dist/src/core/modelCheck.d.ts +14 -0
- package/dist/src/core/modelCheck.js +62 -0
- package/dist/src/core/modelCheck.js.map +1 -0
- package/dist/src/core/nonInteractiveToolExecutor.d.ts +12 -0
- package/dist/src/core/nonInteractiveToolExecutor.js +124 -0
- package/dist/src/core/nonInteractiveToolExecutor.js.map +1 -0
- package/dist/src/core/nonInteractiveToolExecutor.test.d.ts +6 -0
- package/dist/src/core/nonInteractiveToolExecutor.test.js +165 -0
- package/dist/src/core/nonInteractiveToolExecutor.test.js.map +1 -0
- package/dist/src/core/openaiContentGenerator.d.ts +77 -0
- package/dist/src/core/openaiContentGenerator.js +1395 -0
- package/dist/src/core/openaiContentGenerator.js.map +1 -0
- package/dist/src/core/openaiContentGenerator.test.d.ts +6 -0
- package/dist/src/core/openaiContentGenerator.test.js +1904 -0
- package/dist/src/core/openaiContentGenerator.test.js.map +1 -0
- package/dist/src/core/prompts.d.ts +12 -0
- package/dist/src/core/prompts.js +359 -0
- package/dist/src/core/prompts.js.map +1 -0
- package/dist/src/core/prompts.test.d.ts +6 -0
- package/dist/src/core/prompts.test.js +214 -0
- package/dist/src/core/prompts.test.js.map +1 -0
- package/dist/src/core/subagent.d.ts +230 -0
- package/dist/src/core/subagent.js +447 -0
- package/dist/src/core/subagent.js.map +1 -0
- package/dist/src/core/subagent.test.d.ts +6 -0
- package/dist/src/core/subagent.test.js +515 -0
- package/dist/src/core/subagent.test.js.map +1 -0
- package/dist/src/core/tokenLimits.d.ts +10 -0
- package/dist/src/core/tokenLimits.js +28 -0
- package/dist/src/core/tokenLimits.js.map +1 -0
- package/dist/src/core/turn.d.ts +114 -0
- package/dist/src/core/turn.js +143 -0
- package/dist/src/core/turn.js.map +1 -0
- package/dist/src/core/turn.test.d.ts +6 -0
- package/dist/src/core/turn.test.js +369 -0
- package/dist/src/core/turn.test.js.map +1 -0
- package/dist/src/ide/detect-ide.d.ts +10 -0
- package/dist/src/ide/detect-ide.js +27 -0
- package/dist/src/ide/detect-ide.js.map +1 -0
- package/dist/src/ide/ide-client.d.ts +56 -0
- package/dist/src/ide/ide-client.js +268 -0
- package/dist/src/ide/ide-client.js.map +1 -0
- package/dist/src/ide/ide-installer.d.ts +14 -0
- package/dist/src/ide/ide-installer.js +109 -0
- package/dist/src/ide/ide-installer.js.map +1 -0
- package/dist/src/ide/ide-installer.test.d.ts +6 -0
- package/dist/src/ide/ide-installer.test.js +55 -0
- package/dist/src/ide/ide-installer.test.js.map +1 -0
- package/dist/src/ide/ideContext.d.ts +374 -0
- package/dist/src/ide/ideContext.js +147 -0
- package/dist/src/ide/ideContext.js.map +1 -0
- package/dist/src/ide/ideContext.test.d.ts +6 -0
- package/dist/src/ide/ideContext.test.js +265 -0
- package/dist/src/ide/ideContext.test.js.map +1 -0
- package/dist/src/index.d.ts +68 -0
- package/dist/src/index.js +78 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/index.test.d.ts +6 -0
- package/dist/src/index.test.js +12 -0
- package/dist/src/index.test.js.map +1 -0
- package/dist/src/mcp/google-auth-provider.d.ts +23 -0
- package/dist/src/mcp/google-auth-provider.js +63 -0
- package/dist/src/mcp/google-auth-provider.js.map +1 -0
- package/dist/src/mcp/google-auth-provider.test.d.ts +6 -0
- package/dist/src/mcp/google-auth-provider.test.js +54 -0
- package/dist/src/mcp/google-auth-provider.test.js.map +1 -0
- package/dist/src/mcp/oauth-provider.d.ts +147 -0
- package/dist/src/mcp/oauth-provider.js +484 -0
- package/dist/src/mcp/oauth-provider.js.map +1 -0
- package/dist/src/mcp/oauth-provider.test.d.ts +6 -0
- package/dist/src/mcp/oauth-provider.test.js +602 -0
- package/dist/src/mcp/oauth-provider.test.js.map +1 -0
- package/dist/src/mcp/oauth-token-storage.d.ts +83 -0
- package/dist/src/mcp/oauth-token-storage.js +151 -0
- package/dist/src/mcp/oauth-token-storage.js.map +1 -0
- package/dist/src/mcp/oauth-token-storage.test.d.ts +6 -0
- package/dist/src/mcp/oauth-token-storage.test.js +205 -0
- package/dist/src/mcp/oauth-token-storage.test.js.map +1 -0
- package/dist/src/mcp/oauth-utils.d.ts +109 -0
- package/dist/src/mcp/oauth-utils.js +183 -0
- package/dist/src/mcp/oauth-utils.js.map +1 -0
- package/dist/src/mcp/oauth-utils.test.d.ts +6 -0
- package/dist/src/mcp/oauth-utils.test.js +144 -0
- package/dist/src/mcp/oauth-utils.test.js.map +1 -0
- package/dist/src/prompts/mcp-prompts.d.ts +8 -0
- package/dist/src/prompts/mcp-prompts.js +13 -0
- package/dist/src/prompts/mcp-prompts.js.map +1 -0
- package/dist/src/prompts/prompt-registry.d.ts +34 -0
- package/dist/src/prompts/prompt-registry.js +63 -0
- package/dist/src/prompts/prompt-registry.js.map +1 -0
- package/dist/src/services/fileDiscoveryService.d.ts +35 -0
- package/dist/src/services/fileDiscoveryService.js +91 -0
- package/dist/src/services/fileDiscoveryService.js.map +1 -0
- package/dist/src/services/fileDiscoveryService.test.d.ts +6 -0
- package/dist/src/services/fileDiscoveryService.test.js +143 -0
- package/dist/src/services/fileDiscoveryService.test.js.map +1 -0
- package/dist/src/services/gitService.d.ts +21 -0
- package/dist/src/services/gitService.js +101 -0
- package/dist/src/services/gitService.js.map +1 -0
- package/dist/src/services/gitService.test.d.ts +6 -0
- package/dist/src/services/gitService.test.js +209 -0
- package/dist/src/services/gitService.test.js.map +1 -0
- package/dist/src/services/loopDetectionService.d.ts +97 -0
- package/dist/src/services/loopDetectionService.js +340 -0
- package/dist/src/services/loopDetectionService.js.map +1 -0
- package/dist/src/services/loopDetectionService.test.d.ts +6 -0
- package/dist/src/services/loopDetectionService.test.js +484 -0
- package/dist/src/services/loopDetectionService.test.js.map +1 -0
- package/dist/src/services/shellExecutionService.d.ts +70 -0
- package/dist/src/services/shellExecutionService.js +175 -0
- package/dist/src/services/shellExecutionService.js.map +1 -0
- package/dist/src/services/shellExecutionService.test.d.ts +6 -0
- package/dist/src/services/shellExecutionService.test.js +272 -0
- package/dist/src/services/shellExecutionService.test.js.map +1 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.d.ts +65 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.js +652 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.js.map +1 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.d.ts +6 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.js +186 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.js.map +1 -0
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.d.ts +59 -0
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.js +159 -0
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.js.map +1 -0
- package/dist/src/telemetry/constants.d.ts +23 -0
- package/dist/src/telemetry/constants.js +24 -0
- package/dist/src/telemetry/constants.js.map +1 -0
- package/dist/src/telemetry/file-exporters.d.ts +28 -0
- package/dist/src/telemetry/file-exporters.js +62 -0
- package/dist/src/telemetry/file-exporters.js.map +1 -0
- package/dist/src/telemetry/index.d.ts +18 -0
- package/dist/src/telemetry/index.js +20 -0
- package/dist/src/telemetry/index.js.map +1 -0
- package/dist/src/telemetry/integration.test.circular.d.ts +6 -0
- package/dist/src/telemetry/integration.test.circular.js +53 -0
- package/dist/src/telemetry/integration.test.circular.js.map +1 -0
- package/dist/src/telemetry/loggers.d.ts +18 -0
- package/dist/src/telemetry/loggers.js +268 -0
- package/dist/src/telemetry/loggers.js.map +1 -0
- package/dist/src/telemetry/loggers.test.circular.d.ts +6 -0
- package/dist/src/telemetry/loggers.test.circular.js +107 -0
- package/dist/src/telemetry/loggers.test.circular.js.map +1 -0
- package/dist/src/telemetry/loggers.test.d.ts +6 -0
- package/dist/src/telemetry/loggers.test.js +568 -0
- package/dist/src/telemetry/loggers.test.js.map +1 -0
- package/dist/src/telemetry/metrics.d.ts +20 -0
- package/dist/src/telemetry/metrics.js +150 -0
- package/dist/src/telemetry/metrics.js.map +1 -0
- package/dist/src/telemetry/metrics.test.d.ts +6 -0
- package/dist/src/telemetry/metrics.test.js +212 -0
- package/dist/src/telemetry/metrics.test.js.map +1 -0
- package/dist/src/telemetry/sdk.d.ts +9 -0
- package/dist/src/telemetry/sdk.js +127 -0
- package/dist/src/telemetry/sdk.js.map +1 -0
- package/dist/src/telemetry/telemetry.test.d.ts +6 -0
- package/dist/src/telemetry/telemetry.test.js +50 -0
- package/dist/src/telemetry/telemetry.test.js.map +1 -0
- package/dist/src/telemetry/tool-call-decision.d.ts +13 -0
- package/dist/src/telemetry/tool-call-decision.js +29 -0
- package/dist/src/telemetry/tool-call-decision.js.map +1 -0
- package/dist/src/telemetry/types.d.ts +145 -0
- package/dist/src/telemetry/types.js +267 -0
- package/dist/src/telemetry/types.js.map +1 -0
- package/dist/src/telemetry/uiTelemetry.d.ts +71 -0
- package/dist/src/telemetry/uiTelemetry.js +140 -0
- package/dist/src/telemetry/uiTelemetry.js.map +1 -0
- package/dist/src/telemetry/uiTelemetry.test.d.ts +6 -0
- package/dist/src/telemetry/uiTelemetry.test.js +518 -0
- package/dist/src/telemetry/uiTelemetry.test.js.map +1 -0
- package/dist/src/test-utils/mockWorkspaceContext.d.ts +13 -0
- package/dist/src/test-utils/mockWorkspaceContext.js +24 -0
- package/dist/src/test-utils/mockWorkspaceContext.js.map +1 -0
- package/dist/src/test-utils/tools.d.ts +23 -0
- package/dist/src/test-utils/tools.js +41 -0
- package/dist/src/test-utils/tools.js.map +1 -0
- package/dist/src/tools/diffOptions.d.ts +9 -0
- package/dist/src/tools/diffOptions.js +38 -0
- package/dist/src/tools/diffOptions.js.map +1 -0
- package/dist/src/tools/diffOptions.test.d.ts +6 -0
- package/dist/src/tools/diffOptions.test.js +119 -0
- package/dist/src/tools/diffOptions.test.js.map +1 -0
- package/dist/src/tools/edit.d.ts +55 -0
- package/dist/src/tools/edit.js +398 -0
- package/dist/src/tools/edit.js.map +1 -0
- package/dist/src/tools/edit.test.d.ts +6 -0
- package/dist/src/tools/edit.test.js +681 -0
- package/dist/src/tools/edit.test.js.map +1 -0
- package/dist/src/tools/glob.d.ts +51 -0
- package/dist/src/tools/glob.js +226 -0
- package/dist/src/tools/glob.js.map +1 -0
- package/dist/src/tools/glob.test.d.ts +6 -0
- package/dist/src/tools/glob.test.js +330 -0
- package/dist/src/tools/glob.test.js.map +1 -0
- package/dist/src/tools/grep.d.ts +46 -0
- package/dist/src/tools/grep.js +503 -0
- package/dist/src/tools/grep.js.map +1 -0
- package/dist/src/tools/grep.test.d.ts +6 -0
- package/dist/src/tools/grep.test.js +272 -0
- package/dist/src/tools/grep.test.js.map +1 -0
- package/dist/src/tools/ls.d.ts +86 -0
- package/dist/src/tools/ls.js +224 -0
- package/dist/src/tools/ls.js.map +1 -0
- package/dist/src/tools/ls.test.d.ts +6 -0
- package/dist/src/tools/ls.test.js +356 -0
- package/dist/src/tools/ls.test.js.map +1 -0
- package/dist/src/tools/mcp-client.d.ts +149 -0
- package/dist/src/tools/mcp-client.js +844 -0
- package/dist/src/tools/mcp-client.js.map +1 -0
- package/dist/src/tools/mcp-client.test.d.ts +6 -0
- package/dist/src/tools/mcp-client.test.js +643 -0
- package/dist/src/tools/mcp-client.test.js.map +1 -0
- package/dist/src/tools/mcp-tool.d.ts +29 -0
- package/dist/src/tools/mcp-tool.js +202 -0
- package/dist/src/tools/mcp-tool.js.map +1 -0
- package/dist/src/tools/mcp-tool.test.d.ts +6 -0
- package/dist/src/tools/mcp-tool.test.js +501 -0
- package/dist/src/tools/mcp-tool.test.js.map +1 -0
- package/dist/src/tools/memoryTool.d.ts +43 -0
- package/dist/src/tools/memoryTool.js +290 -0
- package/dist/src/tools/memoryTool.js.map +1 -0
- package/dist/src/tools/memoryTool.test.d.ts +6 -0
- package/dist/src/tools/memoryTool.test.js +266 -0
- package/dist/src/tools/memoryTool.test.js.map +1 -0
- package/dist/src/tools/modifiable-tool.d.ts +32 -0
- package/dist/src/tools/modifiable-tool.js +88 -0
- package/dist/src/tools/modifiable-tool.js.map +1 -0
- package/dist/src/tools/modifiable-tool.test.d.ts +6 -0
- package/dist/src/tools/modifiable-tool.test.js +193 -0
- package/dist/src/tools/modifiable-tool.test.js.map +1 -0
- package/dist/src/tools/read-file.d.ts +34 -0
- package/dist/src/tools/read-file.js +152 -0
- package/dist/src/tools/read-file.js.map +1 -0
- package/dist/src/tools/read-file.test.d.ts +6 -0
- package/dist/src/tools/read-file.test.js +300 -0
- package/dist/src/tools/read-file.test.js.map +1 -0
- package/dist/src/tools/read-many-files.d.ts +61 -0
- package/dist/src/tools/read-many-files.js +421 -0
- package/dist/src/tools/read-many-files.js.map +1 -0
- package/dist/src/tools/read-many-files.test.d.ts +6 -0
- package/dist/src/tools/read-many-files.test.js +455 -0
- package/dist/src/tools/read-many-files.test.js.map +1 -0
- package/dist/src/tools/shell.d.ts +23 -0
- package/dist/src/tools/shell.js +313 -0
- package/dist/src/tools/shell.js.map +1 -0
- package/dist/src/tools/shell.test.d.ts +6 -0
- package/dist/src/tools/shell.test.js +321 -0
- package/dist/src/tools/shell.test.js.map +1 -0
- package/dist/src/tools/tool-error.d.ts +26 -0
- package/dist/src/tools/tool-error.js +31 -0
- package/dist/src/tools/tool-error.js.map +1 -0
- package/dist/src/tools/tool-registry.d.ts +85 -0
- package/dist/src/tools/tool-registry.js +390 -0
- package/dist/src/tools/tool-registry.js.map +1 -0
- package/dist/src/tools/tool-registry.test.d.ts +6 -0
- package/dist/src/tools/tool-registry.test.js +417 -0
- package/dist/src/tools/tool-registry.test.js.map +1 -0
- package/dist/src/tools/tools.d.ts +328 -0
- package/dist/src/tools/tools.js +281 -0
- package/dist/src/tools/tools.js.map +1 -0
- package/dist/src/tools/tools.test.d.ts +6 -0
- package/dist/src/tools/tools.test.js +117 -0
- package/dist/src/tools/tools.test.js.map +1 -0
- package/dist/src/tools/web-fetch.d.ts +29 -0
- package/dist/src/tools/web-fetch.js +246 -0
- package/dist/src/tools/web-fetch.js.map +1 -0
- package/dist/src/tools/web-fetch.test.d.ts +6 -0
- package/dist/src/tools/web-fetch.test.js +71 -0
- package/dist/src/tools/web-fetch.test.js.map +1 -0
- package/dist/src/tools/web-search.d.ts +49 -0
- package/dist/src/tools/web-search.js +120 -0
- package/dist/src/tools/web-search.js.map +1 -0
- package/dist/src/tools/write-file.d.ts +46 -0
- package/dist/src/tools/write-file.js +321 -0
- package/dist/src/tools/write-file.js.map +1 -0
- package/dist/src/tools/write-file.test.d.ts +6 -0
- package/dist/src/tools/write-file.test.js +572 -0
- package/dist/src/tools/write-file.test.js.map +1 -0
- package/dist/src/utils/LruCache.d.ts +13 -0
- package/dist/src/utils/LruCache.js +38 -0
- package/dist/src/utils/LruCache.js.map +1 -0
- package/dist/src/utils/bfsFileSearch.d.ts +24 -0
- package/dist/src/utils/bfsFileSearch.js +89 -0
- package/dist/src/utils/bfsFileSearch.js.map +1 -0
- package/dist/src/utils/bfsFileSearch.test.d.ts +6 -0
- package/dist/src/utils/bfsFileSearch.test.js +163 -0
- package/dist/src/utils/bfsFileSearch.test.js.map +1 -0
- package/dist/src/utils/browser.d.ts +13 -0
- package/dist/src/utils/browser.js +49 -0
- package/dist/src/utils/browser.js.map +1 -0
- package/dist/src/utils/editCorrector.d.ts +53 -0
- package/dist/src/utils/editCorrector.js +546 -0
- package/dist/src/utils/editCorrector.js.map +1 -0
- package/dist/src/utils/editCorrector.test.d.ts +6 -0
- package/dist/src/utils/editCorrector.test.js +564 -0
- package/dist/src/utils/editCorrector.test.js.map +1 -0
- package/dist/src/utils/editor.d.ts +28 -0
- package/dist/src/utils/editor.js +186 -0
- package/dist/src/utils/editor.js.map +1 -0
- package/dist/src/utils/editor.test.d.ts +6 -0
- package/dist/src/utils/editor.test.js +445 -0
- package/dist/src/utils/editor.test.js.map +1 -0
- package/dist/src/utils/environmentContext.d.ts +21 -0
- package/dist/src/utils/environmentContext.js +90 -0
- package/dist/src/utils/environmentContext.js.map +1 -0
- package/dist/src/utils/environmentContext.test.d.ts +6 -0
- package/dist/src/utils/environmentContext.test.js +139 -0
- package/dist/src/utils/environmentContext.test.js.map +1 -0
- package/dist/src/utils/errorReporting.d.ts +14 -0
- package/dist/src/utils/errorReporting.js +88 -0
- package/dist/src/utils/errorReporting.js.map +1 -0
- package/dist/src/utils/errorReporting.test.d.ts +6 -0
- package/dist/src/utils/errorReporting.test.js +130 -0
- package/dist/src/utils/errorReporting.test.js.map +1 -0
- package/dist/src/utils/errors.d.ts +14 -0
- package/dist/src/utils/errors.js +54 -0
- package/dist/src/utils/errors.js.map +1 -0
- package/dist/src/utils/fetch.d.ts +11 -0
- package/dist/src/utils/fetch.js +51 -0
- package/dist/src/utils/fetch.js.map +1 -0
- package/dist/src/utils/fileUtils.d.ts +56 -0
- package/dist/src/utils/fileUtils.js +314 -0
- package/dist/src/utils/fileUtils.js.map +1 -0
- package/dist/src/utils/fileUtils.test.d.ts +6 -0
- package/dist/src/utils/fileUtils.test.js +363 -0
- package/dist/src/utils/fileUtils.test.js.map +1 -0
- package/dist/src/utils/filesearch/crawlCache.d.ts +25 -0
- package/dist/src/utils/filesearch/crawlCache.js +57 -0
- package/dist/src/utils/filesearch/crawlCache.js.map +1 -0
- package/dist/src/utils/filesearch/crawlCache.test.d.ts +6 -0
- package/dist/src/utils/filesearch/crawlCache.test.js +103 -0
- package/dist/src/utils/filesearch/crawlCache.test.js.map +1 -0
- package/dist/src/utils/filesearch/fileSearch.d.ts +81 -0
- package/dist/src/utils/filesearch/fileSearch.js +241 -0
- package/dist/src/utils/filesearch/fileSearch.js.map +1 -0
- package/dist/src/utils/filesearch/fileSearch.test.d.ts +6 -0
- package/dist/src/utils/filesearch/fileSearch.test.js +654 -0
- package/dist/src/utils/filesearch/fileSearch.test.js.map +1 -0
- package/dist/src/utils/filesearch/ignore.d.ts +35 -0
- package/dist/src/utils/filesearch/ignore.js +81 -0
- package/dist/src/utils/filesearch/ignore.js.map +1 -0
- package/dist/src/utils/filesearch/ignore.test.d.ts +6 -0
- package/dist/src/utils/filesearch/ignore.test.js +57 -0
- package/dist/src/utils/filesearch/ignore.test.js.map +1 -0
- package/dist/src/utils/filesearch/result-cache.d.ts +34 -0
- package/dist/src/utils/filesearch/result-cache.js +61 -0
- package/dist/src/utils/filesearch/result-cache.js.map +1 -0
- package/dist/src/utils/filesearch/result-cache.test.d.ts +6 -0
- package/dist/src/utils/filesearch/result-cache.test.js +47 -0
- package/dist/src/utils/filesearch/result-cache.test.js.map +1 -0
- package/dist/src/utils/flashFallback.integration.test.d.ts +6 -0
- package/dist/src/utils/flashFallback.integration.test.js +118 -0
- package/dist/src/utils/flashFallback.integration.test.js.map +1 -0
- package/dist/src/utils/formatters.d.ts +6 -0
- package/dist/src/utils/formatters.js +16 -0
- package/dist/src/utils/formatters.js.map +1 -0
- package/dist/src/utils/generateContentResponseUtilities.d.ts +14 -0
- package/dist/src/utils/generateContentResponseUtilities.js +92 -0
- package/dist/src/utils/generateContentResponseUtilities.js.map +1 -0
- package/dist/src/utils/generateContentResponseUtilities.test.d.ts +6 -0
- package/dist/src/utils/generateContentResponseUtilities.test.js +273 -0
- package/dist/src/utils/generateContentResponseUtilities.test.js.map +1 -0
- package/dist/src/utils/getFolderStructure.d.ts +31 -0
- package/dist/src/utils/getFolderStructure.js +246 -0
- package/dist/src/utils/getFolderStructure.js.map +1 -0
- package/dist/src/utils/getFolderStructure.test.d.ts +6 -0
- package/dist/src/utils/getFolderStructure.test.js +282 -0
- package/dist/src/utils/getFolderStructure.test.js.map +1 -0
- package/dist/src/utils/gitIgnoreParser.d.ts +20 -0
- package/dist/src/utils/gitIgnoreParser.js +61 -0
- package/dist/src/utils/gitIgnoreParser.js.map +1 -0
- package/dist/src/utils/gitIgnoreParser.test.d.ts +6 -0
- package/dist/src/utils/gitIgnoreParser.test.js +154 -0
- package/dist/src/utils/gitIgnoreParser.test.js.map +1 -0
- package/dist/src/utils/gitUtils.d.ts +17 -0
- package/dist/src/utils/gitUtils.js +61 -0
- package/dist/src/utils/gitUtils.js.map +1 -0
- package/dist/src/utils/memoryDiscovery.d.ts +15 -0
- package/dist/src/utils/memoryDiscovery.js +219 -0
- package/dist/src/utils/memoryDiscovery.js.map +1 -0
- package/dist/src/utils/memoryDiscovery.test.d.ts +6 -0
- package/dist/src/utils/memoryDiscovery.test.js +181 -0
- package/dist/src/utils/memoryDiscovery.test.js.map +1 -0
- package/dist/src/utils/memoryImportProcessor.d.ts +42 -0
- package/dist/src/utils/memoryImportProcessor.js +300 -0
- package/dist/src/utils/memoryImportProcessor.js.map +1 -0
- package/dist/src/utils/memoryImportProcessor.test.d.ts +6 -0
- package/dist/src/utils/memoryImportProcessor.test.js +715 -0
- package/dist/src/utils/memoryImportProcessor.test.js.map +1 -0
- package/dist/src/utils/messageInspectors.d.ts +8 -0
- package/dist/src/utils/messageInspectors.js +16 -0
- package/dist/src/utils/messageInspectors.js.map +1 -0
- package/dist/src/utils/nextSpeakerChecker.d.ts +12 -0
- package/dist/src/utils/nextSpeakerChecker.js +92 -0
- package/dist/src/utils/nextSpeakerChecker.js.map +1 -0
- package/dist/src/utils/nextSpeakerChecker.test.d.ts +6 -0
- package/dist/src/utils/nextSpeakerChecker.test.js +168 -0
- package/dist/src/utils/nextSpeakerChecker.test.js.map +1 -0
- package/dist/src/utils/openaiLogger.d.ts +42 -0
- package/dist/src/utils/openaiLogger.js +123 -0
- package/dist/src/utils/openaiLogger.js.map +1 -0
- package/dist/src/utils/partUtils.d.ts +14 -0
- package/dist/src/utils/partUtils.js +65 -0
- package/dist/src/utils/partUtils.js.map +1 -0
- package/dist/src/utils/partUtils.test.d.ts +6 -0
- package/dist/src/utils/partUtils.test.js +130 -0
- package/dist/src/utils/partUtils.test.js.map +1 -0
- package/dist/src/utils/paths.d.ts +68 -0
- package/dist/src/utils/paths.js +170 -0
- package/dist/src/utils/paths.js.map +1 -0
- package/dist/src/utils/paths.test.d.ts +6 -0
- package/dist/src/utils/paths.test.js +153 -0
- package/dist/src/utils/paths.test.js.map +1 -0
- package/dist/src/utils/quotaErrorDetection.d.ts +22 -0
- package/dist/src/utils/quotaErrorDetection.js +65 -0
- package/dist/src/utils/quotaErrorDetection.js.map +1 -0
- package/dist/src/utils/retry.d.ts +30 -0
- package/dist/src/utils/retry.js +276 -0
- package/dist/src/utils/retry.js.map +1 -0
- package/dist/src/utils/retry.test.d.ts +6 -0
- package/dist/src/utils/retry.test.js +322 -0
- package/dist/src/utils/retry.test.js.map +1 -0
- package/dist/src/utils/safeJsonStringify.d.ts +13 -0
- package/dist/src/utils/safeJsonStringify.js +25 -0
- package/dist/src/utils/safeJsonStringify.js.map +1 -0
- package/dist/src/utils/safeJsonStringify.test.d.ts +6 -0
- package/dist/src/utils/safeJsonStringify.test.js +61 -0
- package/dist/src/utils/safeJsonStringify.test.js.map +1 -0
- package/dist/src/utils/schemaValidator.d.ts +22 -0
- package/dist/src/utils/schemaValidator.js +65 -0
- package/dist/src/utils/schemaValidator.js.map +1 -0
- package/dist/src/utils/secure-browser-launcher.d.ts +23 -0
- package/dist/src/utils/secure-browser-launcher.js +164 -0
- package/dist/src/utils/secure-browser-launcher.js.map +1 -0
- package/dist/src/utils/secure-browser-launcher.test.d.ts +6 -0
- package/dist/src/utils/secure-browser-launcher.test.js +149 -0
- package/dist/src/utils/secure-browser-launcher.test.js.map +1 -0
- package/dist/src/utils/session.d.ts +6 -0
- package/dist/src/utils/session.js +8 -0
- package/dist/src/utils/session.js.map +1 -0
- package/dist/src/utils/shell-utils.d.ts +78 -0
- package/dist/src/utils/shell-utils.js +306 -0
- package/dist/src/utils/shell-utils.js.map +1 -0
- package/dist/src/utils/shell-utils.test.d.ts +6 -0
- package/dist/src/utils/shell-utils.test.js +200 -0
- package/dist/src/utils/shell-utils.test.js.map +1 -0
- package/dist/src/utils/summarizer.d.ts +25 -0
- package/dist/src/utils/summarizer.js +51 -0
- package/dist/src/utils/summarizer.js.map +1 -0
- package/dist/src/utils/summarizer.test.d.ts +6 -0
- package/dist/src/utils/summarizer.test.js +131 -0
- package/dist/src/utils/summarizer.test.js.map +1 -0
- package/dist/src/utils/systemEncoding.d.ts +40 -0
- package/dist/src/utils/systemEncoding.js +149 -0
- package/dist/src/utils/systemEncoding.js.map +1 -0
- package/dist/src/utils/systemEncoding.test.d.ts +6 -0
- package/dist/src/utils/systemEncoding.test.js +368 -0
- package/dist/src/utils/systemEncoding.test.js.map +1 -0
- package/dist/src/utils/testUtils.d.ts +29 -0
- package/dist/src/utils/testUtils.js +70 -0
- package/dist/src/utils/testUtils.js.map +1 -0
- package/dist/src/utils/textUtils.d.ts +13 -0
- package/dist/src/utils/textUtils.js +28 -0
- package/dist/src/utils/textUtils.js.map +1 -0
- package/dist/src/utils/user_account.d.ts +9 -0
- package/dist/src/utils/user_account.js +99 -0
- package/dist/src/utils/user_account.js.map +1 -0
- package/dist/src/utils/user_account.test.d.ts +6 -0
- package/dist/src/utils/user_account.test.js +153 -0
- package/dist/src/utils/user_account.test.js.map +1 -0
- package/dist/src/utils/user_id.d.ts +11 -0
- package/dist/src/utils/user_id.js +49 -0
- package/dist/src/utils/user_id.js.map +1 -0
- package/dist/src/utils/user_id.test.d.ts +6 -0
- package/dist/src/utils/user_id.test.js +21 -0
- package/dist/src/utils/user_id.test.js.map +1 -0
- package/dist/src/utils/workspaceContext.d.ts +51 -0
- package/dist/src/utils/workspaceContext.js +139 -0
- package/dist/src/utils/workspaceContext.js.map +1 -0
- package/dist/src/utils/workspaceContext.test.d.ts +6 -0
- package/dist/src/utils/workspaceContext.test.js +209 -0
- package/dist/src/utils/workspaceContext.test.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +74 -0
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { getErrorMessage } from '../utils/errors.js';
|
|
7
|
+
/**
|
|
8
|
+
* Utility class for common OAuth operations.
|
|
9
|
+
*/
|
|
10
|
+
export class OAuthUtils {
|
|
11
|
+
/**
|
|
12
|
+
* Construct well-known OAuth endpoint URLs.
|
|
13
|
+
*/
|
|
14
|
+
static buildWellKnownUrls(baseUrl) {
|
|
15
|
+
const serverUrl = new URL(baseUrl);
|
|
16
|
+
const base = `${serverUrl.protocol}//${serverUrl.host}`;
|
|
17
|
+
return {
|
|
18
|
+
protectedResource: new URL('/.well-known/oauth-protected-resource', base).toString(),
|
|
19
|
+
authorizationServer: new URL('/.well-known/oauth-authorization-server', base).toString(),
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Fetch OAuth protected resource metadata.
|
|
24
|
+
*
|
|
25
|
+
* @param resourceMetadataUrl The protected resource metadata URL
|
|
26
|
+
* @returns The protected resource metadata or null if not available
|
|
27
|
+
*/
|
|
28
|
+
static async fetchProtectedResourceMetadata(resourceMetadataUrl) {
|
|
29
|
+
try {
|
|
30
|
+
const response = await fetch(resourceMetadataUrl);
|
|
31
|
+
if (!response.ok) {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
return (await response.json());
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
console.debug(`Failed to fetch protected resource metadata from ${resourceMetadataUrl}: ${getErrorMessage(error)}`);
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Fetch OAuth authorization server metadata.
|
|
43
|
+
*
|
|
44
|
+
* @param authServerMetadataUrl The authorization server metadata URL
|
|
45
|
+
* @returns The authorization server metadata or null if not available
|
|
46
|
+
*/
|
|
47
|
+
static async fetchAuthorizationServerMetadata(authServerMetadataUrl) {
|
|
48
|
+
try {
|
|
49
|
+
const response = await fetch(authServerMetadataUrl);
|
|
50
|
+
if (!response.ok) {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
return (await response.json());
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
console.debug(`Failed to fetch authorization server metadata from ${authServerMetadataUrl}: ${getErrorMessage(error)}`);
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Convert authorization server metadata to OAuth configuration.
|
|
62
|
+
*
|
|
63
|
+
* @param metadata The authorization server metadata
|
|
64
|
+
* @returns The OAuth configuration
|
|
65
|
+
*/
|
|
66
|
+
static metadataToOAuthConfig(metadata) {
|
|
67
|
+
return {
|
|
68
|
+
authorizationUrl: metadata.authorization_endpoint,
|
|
69
|
+
tokenUrl: metadata.token_endpoint,
|
|
70
|
+
scopes: metadata.scopes_supported || [],
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Discover OAuth configuration using the standard well-known endpoints.
|
|
75
|
+
*
|
|
76
|
+
* @param serverUrl The base URL of the server
|
|
77
|
+
* @returns The discovered OAuth configuration or null if not available
|
|
78
|
+
*/
|
|
79
|
+
static async discoverOAuthConfig(serverUrl) {
|
|
80
|
+
try {
|
|
81
|
+
const wellKnownUrls = this.buildWellKnownUrls(serverUrl);
|
|
82
|
+
// First, try to get the protected resource metadata
|
|
83
|
+
const resourceMetadata = await this.fetchProtectedResourceMetadata(wellKnownUrls.protectedResource);
|
|
84
|
+
if (resourceMetadata?.authorization_servers?.length) {
|
|
85
|
+
// Use the first authorization server
|
|
86
|
+
const authServerUrl = resourceMetadata.authorization_servers[0];
|
|
87
|
+
const authServerMetadataUrl = new URL('/.well-known/oauth-authorization-server', authServerUrl).toString();
|
|
88
|
+
const authServerMetadata = await this.fetchAuthorizationServerMetadata(authServerMetadataUrl);
|
|
89
|
+
if (authServerMetadata) {
|
|
90
|
+
const config = this.metadataToOAuthConfig(authServerMetadata);
|
|
91
|
+
if (authServerMetadata.registration_endpoint) {
|
|
92
|
+
console.log('Dynamic client registration is supported at:', authServerMetadata.registration_endpoint);
|
|
93
|
+
}
|
|
94
|
+
return config;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
// Fallback: try /.well-known/oauth-authorization-server at the base URL
|
|
98
|
+
console.debug(`Trying OAuth discovery fallback at ${wellKnownUrls.authorizationServer}`);
|
|
99
|
+
const authServerMetadata = await this.fetchAuthorizationServerMetadata(wellKnownUrls.authorizationServer);
|
|
100
|
+
if (authServerMetadata) {
|
|
101
|
+
const config = this.metadataToOAuthConfig(authServerMetadata);
|
|
102
|
+
if (authServerMetadata.registration_endpoint) {
|
|
103
|
+
console.log('Dynamic client registration is supported at:', authServerMetadata.registration_endpoint);
|
|
104
|
+
}
|
|
105
|
+
return config;
|
|
106
|
+
}
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
catch (error) {
|
|
110
|
+
console.debug(`Failed to discover OAuth configuration: ${getErrorMessage(error)}`);
|
|
111
|
+
return null;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Parse WWW-Authenticate header to extract OAuth information.
|
|
116
|
+
*
|
|
117
|
+
* @param header The WWW-Authenticate header value
|
|
118
|
+
* @returns The resource metadata URI if found
|
|
119
|
+
*/
|
|
120
|
+
static parseWWWAuthenticateHeader(header) {
|
|
121
|
+
// Parse Bearer realm and resource_metadata
|
|
122
|
+
const match = header.match(/resource_metadata="([^"]+)"/);
|
|
123
|
+
if (match) {
|
|
124
|
+
return match[1];
|
|
125
|
+
}
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Discover OAuth configuration from WWW-Authenticate header.
|
|
130
|
+
*
|
|
131
|
+
* @param wwwAuthenticate The WWW-Authenticate header value
|
|
132
|
+
* @returns The discovered OAuth configuration or null if not available
|
|
133
|
+
*/
|
|
134
|
+
static async discoverOAuthFromWWWAuthenticate(wwwAuthenticate) {
|
|
135
|
+
const resourceMetadataUri = this.parseWWWAuthenticateHeader(wwwAuthenticate);
|
|
136
|
+
if (!resourceMetadataUri) {
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
console.log(`Found resource metadata URI from www-authenticate header: ${resourceMetadataUri}`);
|
|
140
|
+
const resourceMetadata = await this.fetchProtectedResourceMetadata(resourceMetadataUri);
|
|
141
|
+
if (!resourceMetadata?.authorization_servers?.length) {
|
|
142
|
+
return null;
|
|
143
|
+
}
|
|
144
|
+
const authServerUrl = resourceMetadata.authorization_servers[0];
|
|
145
|
+
const authServerMetadataUrl = new URL('/.well-known/oauth-authorization-server', authServerUrl).toString();
|
|
146
|
+
const authServerMetadata = await this.fetchAuthorizationServerMetadata(authServerMetadataUrl);
|
|
147
|
+
if (authServerMetadata) {
|
|
148
|
+
console.log('OAuth configuration discovered successfully from www-authenticate header');
|
|
149
|
+
return this.metadataToOAuthConfig(authServerMetadata);
|
|
150
|
+
}
|
|
151
|
+
return null;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Extract base URL from an MCP server URL.
|
|
155
|
+
*
|
|
156
|
+
* @param mcpServerUrl The MCP server URL
|
|
157
|
+
* @returns The base URL
|
|
158
|
+
*/
|
|
159
|
+
static extractBaseUrl(mcpServerUrl) {
|
|
160
|
+
const serverUrl = new URL(mcpServerUrl);
|
|
161
|
+
return `${serverUrl.protocol}//${serverUrl.host}`;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Check if a URL is an SSE endpoint.
|
|
165
|
+
*
|
|
166
|
+
* @param url The URL to check
|
|
167
|
+
* @returns True if the URL appears to be an SSE endpoint
|
|
168
|
+
*/
|
|
169
|
+
static isSSEEndpoint(url) {
|
|
170
|
+
return url.includes('/sse') || !url.includes('/mcp');
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Build a resource parameter for OAuth requests.
|
|
174
|
+
*
|
|
175
|
+
* @param endpointUrl The endpoint URL
|
|
176
|
+
* @returns The resource parameter value
|
|
177
|
+
*/
|
|
178
|
+
static buildResourceParameter(endpointUrl) {
|
|
179
|
+
const url = new URL(endpointUrl);
|
|
180
|
+
return `${url.protocol}//${url.host}`;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
//# sourceMappingURL=oauth-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth-utils.js","sourceRoot":"","sources":["../../../src/mcp/oauth-utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAgCrD;;GAEG;AACH,MAAM,OAAO,UAAU;IACrB;;OAEG;IACH,MAAM,CAAC,kBAAkB,CAAC,OAAe;QACvC,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC;QACnC,MAAM,IAAI,GAAG,GAAG,SAAS,CAAC,QAAQ,KAAK,SAAS,CAAC,IAAI,EAAE,CAAC;QAExD,OAAO;YACL,iBAAiB,EAAE,IAAI,GAAG,CACxB,uCAAuC,EACvC,IAAI,CACL,CAAC,QAAQ,EAAE;YACZ,mBAAmB,EAAE,IAAI,GAAG,CAC1B,yCAAyC,EACzC,IAAI,CACL,CAAC,QAAQ,EAAE;SACb,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,KAAK,CAAC,8BAA8B,CACzC,mBAA2B;QAE3B,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,mBAAmB,CAAC,CAAC;YAClD,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;gBACjB,OAAO,IAAI,CAAC;YACd,CAAC;YACD,OAAO,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAmC,CAAC;QACnE,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CACX,oDAAoD,mBAAmB,KAAK,eAAe,CAAC,KAAK,CAAC,EAAE,CACrG,CAAC;YACF,OA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AAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACvD,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,sBAAsB,CAAC,WAAmB;QAC/C,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,WAAW,CAAC,CAAC;QACjC,OAAO,GAAG,GAAG,CAAC,QAAQ,KAAK,GAAG,CAAC,IAAI,EAAE,CAAC;IACxC,CAAC;CACF"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
|
7
|
+
import { OAuthUtils, } from './oauth-utils.js';
|
|
8
|
+
// Mock fetch globally
|
|
9
|
+
const mockFetch = vi.fn();
|
|
10
|
+
global.fetch = mockFetch;
|
|
11
|
+
describe('OAuthUtils', () => {
|
|
12
|
+
beforeEach(() => {
|
|
13
|
+
vi.clearAllMocks();
|
|
14
|
+
vi.spyOn(console, 'debug').mockImplementation(() => { });
|
|
15
|
+
vi.spyOn(console, 'error').mockImplementation(() => { });
|
|
16
|
+
vi.spyOn(console, 'log').mockImplementation(() => { });
|
|
17
|
+
});
|
|
18
|
+
afterEach(() => {
|
|
19
|
+
vi.restoreAllMocks();
|
|
20
|
+
});
|
|
21
|
+
describe('buildWellKnownUrls', () => {
|
|
22
|
+
it('should build correct well-known URLs', () => {
|
|
23
|
+
const urls = OAuthUtils.buildWellKnownUrls('https://example.com/path');
|
|
24
|
+
expect(urls.protectedResource).toBe('https://example.com/.well-known/oauth-protected-resource');
|
|
25
|
+
expect(urls.authorizationServer).toBe('https://example.com/.well-known/oauth-authorization-server');
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
describe('fetchProtectedResourceMetadata', () => {
|
|
29
|
+
const mockResourceMetadata = {
|
|
30
|
+
resource: 'https://api.example.com',
|
|
31
|
+
authorization_servers: ['https://auth.example.com'],
|
|
32
|
+
bearer_methods_supported: ['header'],
|
|
33
|
+
};
|
|
34
|
+
it('should fetch protected resource metadata successfully', async () => {
|
|
35
|
+
mockFetch.mockResolvedValueOnce({
|
|
36
|
+
ok: true,
|
|
37
|
+
json: () => Promise.resolve(mockResourceMetadata),
|
|
38
|
+
});
|
|
39
|
+
const result = await OAuthUtils.fetchProtectedResourceMetadata('https://example.com/.well-known/oauth-protected-resource');
|
|
40
|
+
expect(result).toEqual(mockResourceMetadata);
|
|
41
|
+
});
|
|
42
|
+
it('should return null when fetch fails', async () => {
|
|
43
|
+
mockFetch.mockResolvedValueOnce({
|
|
44
|
+
ok: false,
|
|
45
|
+
});
|
|
46
|
+
const result = await OAuthUtils.fetchProtectedResourceMetadata('https://example.com/.well-known/oauth-protected-resource');
|
|
47
|
+
expect(result).toBeNull();
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
describe('fetchAuthorizationServerMetadata', () => {
|
|
51
|
+
const mockAuthServerMetadata = {
|
|
52
|
+
issuer: 'https://auth.example.com',
|
|
53
|
+
authorization_endpoint: 'https://auth.example.com/authorize',
|
|
54
|
+
token_endpoint: 'https://auth.example.com/token',
|
|
55
|
+
scopes_supported: ['read', 'write'],
|
|
56
|
+
};
|
|
57
|
+
it('should fetch authorization server metadata successfully', async () => {
|
|
58
|
+
mockFetch.mockResolvedValueOnce({
|
|
59
|
+
ok: true,
|
|
60
|
+
json: () => Promise.resolve(mockAuthServerMetadata),
|
|
61
|
+
});
|
|
62
|
+
const result = await OAuthUtils.fetchAuthorizationServerMetadata('https://auth.example.com/.well-known/oauth-authorization-server');
|
|
63
|
+
expect(result).toEqual(mockAuthServerMetadata);
|
|
64
|
+
});
|
|
65
|
+
it('should return null when fetch fails', async () => {
|
|
66
|
+
mockFetch.mockResolvedValueOnce({
|
|
67
|
+
ok: false,
|
|
68
|
+
});
|
|
69
|
+
const result = await OAuthUtils.fetchAuthorizationServerMetadata('https://auth.example.com/.well-known/oauth-authorization-server');
|
|
70
|
+
expect(result).toBeNull();
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
describe('metadataToOAuthConfig', () => {
|
|
74
|
+
it('should convert metadata to OAuth config', () => {
|
|
75
|
+
const metadata = {
|
|
76
|
+
issuer: 'https://auth.example.com',
|
|
77
|
+
authorization_endpoint: 'https://auth.example.com/authorize',
|
|
78
|
+
token_endpoint: 'https://auth.example.com/token',
|
|
79
|
+
scopes_supported: ['read', 'write'],
|
|
80
|
+
};
|
|
81
|
+
const config = OAuthUtils.metadataToOAuthConfig(metadata);
|
|
82
|
+
expect(config).toEqual({
|
|
83
|
+
authorizationUrl: 'https://auth.example.com/authorize',
|
|
84
|
+
tokenUrl: 'https://auth.example.com/token',
|
|
85
|
+
scopes: ['read', 'write'],
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
it('should handle empty scopes', () => {
|
|
89
|
+
const metadata = {
|
|
90
|
+
issuer: 'https://auth.example.com',
|
|
91
|
+
authorization_endpoint: 'https://auth.example.com/authorize',
|
|
92
|
+
token_endpoint: 'https://auth.example.com/token',
|
|
93
|
+
};
|
|
94
|
+
const config = OAuthUtils.metadataToOAuthConfig(metadata);
|
|
95
|
+
expect(config.scopes).toEqual([]);
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
describe('parseWWWAuthenticateHeader', () => {
|
|
99
|
+
it('should parse resource metadata URI from WWW-Authenticate header', () => {
|
|
100
|
+
const header = 'Bearer realm="example", resource_metadata="https://example.com/.well-known/oauth-protected-resource"';
|
|
101
|
+
const result = OAuthUtils.parseWWWAuthenticateHeader(header);
|
|
102
|
+
expect(result).toBe('https://example.com/.well-known/oauth-protected-resource');
|
|
103
|
+
});
|
|
104
|
+
it('should return null when no resource metadata URI is found', () => {
|
|
105
|
+
const header = 'Bearer realm="example"';
|
|
106
|
+
const result = OAuthUtils.parseWWWAuthenticateHeader(header);
|
|
107
|
+
expect(result).toBeNull();
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
describe('extractBaseUrl', () => {
|
|
111
|
+
it('should extract base URL from MCP server URL', () => {
|
|
112
|
+
const result = OAuthUtils.extractBaseUrl('https://example.com/mcp/v1');
|
|
113
|
+
expect(result).toBe('https://example.com');
|
|
114
|
+
});
|
|
115
|
+
it('should handle URLs with ports', () => {
|
|
116
|
+
const result = OAuthUtils.extractBaseUrl('https://example.com:8080/mcp/v1');
|
|
117
|
+
expect(result).toBe('https://example.com:8080');
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
describe('isSSEEndpoint', () => {
|
|
121
|
+
it('should return true for SSE endpoints', () => {
|
|
122
|
+
expect(OAuthUtils.isSSEEndpoint('https://example.com/sse')).toBe(true);
|
|
123
|
+
expect(OAuthUtils.isSSEEndpoint('https://example.com/api/v1/sse')).toBe(true);
|
|
124
|
+
});
|
|
125
|
+
it('should return true for non-MCP endpoints', () => {
|
|
126
|
+
expect(OAuthUtils.isSSEEndpoint('https://example.com/api')).toBe(true);
|
|
127
|
+
});
|
|
128
|
+
it('should return false for MCP endpoints', () => {
|
|
129
|
+
expect(OAuthUtils.isSSEEndpoint('https://example.com/mcp')).toBe(false);
|
|
130
|
+
expect(OAuthUtils.isSSEEndpoint('https://example.com/api/mcp/v1')).toBe(false);
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
describe('buildResourceParameter', () => {
|
|
134
|
+
it('should build resource parameter from endpoint URL', () => {
|
|
135
|
+
const result = OAuthUtils.buildResourceParameter('https://example.com/oauth/token');
|
|
136
|
+
expect(result).toBe('https://example.com');
|
|
137
|
+
});
|
|
138
|
+
it('should handle URLs with ports', () => {
|
|
139
|
+
const result = OAuthUtils.buildResourceParameter('https://example.com:8080/oauth/token');
|
|
140
|
+
expect(result).toBe('https://example.com:8080');
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
//# sourceMappingURL=oauth-utils.test.js.map
|
|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,CAC9C,sCAAsC,CACvC,CAAC;YACF,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;QAClD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { Config } from '../config/config.js';
|
|
7
|
+
import { DiscoveredMCPPrompt } from '../tools/mcp-client.js';
|
|
8
|
+
export declare function getMCPServerPrompts(config: Config, serverName: string): DiscoveredMCPPrompt[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
export function getMCPServerPrompts(config, serverName) {
|
|
7
|
+
const promptRegistry = config.getPromptRegistry();
|
|
8
|
+
if (!promptRegistry) {
|
|
9
|
+
return [];
|
|
10
|
+
}
|
|
11
|
+
return promptRegistry.getPromptsByServer(serverName);
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=mcp-prompts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-prompts.js","sourceRoot":"","sources":["../../../src/prompts/mcp-prompts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,MAAM,UAAU,mBAAmB,CACjC,MAAc,EACd,UAAkB;IAElB,MAAM,cAAc,GAAG,MAAM,CAAC,iBAAiB,EAAE,CAAC;IAClD,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,cAAc,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC;AACvD,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { DiscoveredMCPPrompt } from '../tools/mcp-client.js';
|
|
7
|
+
export declare class PromptRegistry {
|
|
8
|
+
private prompts;
|
|
9
|
+
/**
|
|
10
|
+
* Registers a prompt definition.
|
|
11
|
+
* @param prompt - The prompt object containing schema and execution logic.
|
|
12
|
+
*/
|
|
13
|
+
registerPrompt(prompt: DiscoveredMCPPrompt): void;
|
|
14
|
+
/**
|
|
15
|
+
* Returns an array of all registered and discovered prompt instances.
|
|
16
|
+
*/
|
|
17
|
+
getAllPrompts(): DiscoveredMCPPrompt[];
|
|
18
|
+
/**
|
|
19
|
+
* Get the definition of a specific prompt.
|
|
20
|
+
*/
|
|
21
|
+
getPrompt(name: string): DiscoveredMCPPrompt | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Returns an array of prompts registered from a specific MCP server.
|
|
24
|
+
*/
|
|
25
|
+
getPromptsByServer(serverName: string): DiscoveredMCPPrompt[];
|
|
26
|
+
/**
|
|
27
|
+
* Clears all the prompts from the registry.
|
|
28
|
+
*/
|
|
29
|
+
clear(): void;
|
|
30
|
+
/**
|
|
31
|
+
* Removes all prompts from a specific server.
|
|
32
|
+
*/
|
|
33
|
+
removePromptsByServer(serverName: string): void;
|
|
34
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
export class PromptRegistry {
|
|
7
|
+
prompts = new Map();
|
|
8
|
+
/**
|
|
9
|
+
* Registers a prompt definition.
|
|
10
|
+
* @param prompt - The prompt object containing schema and execution logic.
|
|
11
|
+
*/
|
|
12
|
+
registerPrompt(prompt) {
|
|
13
|
+
if (this.prompts.has(prompt.name)) {
|
|
14
|
+
const newName = `${prompt.serverName}_${prompt.name}`;
|
|
15
|
+
console.warn(`Prompt with name "${prompt.name}" is already registered. Renaming to "${newName}".`);
|
|
16
|
+
this.prompts.set(newName, { ...prompt, name: newName });
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
this.prompts.set(prompt.name, prompt);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Returns an array of all registered and discovered prompt instances.
|
|
24
|
+
*/
|
|
25
|
+
getAllPrompts() {
|
|
26
|
+
return Array.from(this.prompts.values()).sort((a, b) => a.name.localeCompare(b.name));
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Get the definition of a specific prompt.
|
|
30
|
+
*/
|
|
31
|
+
getPrompt(name) {
|
|
32
|
+
return this.prompts.get(name);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Returns an array of prompts registered from a specific MCP server.
|
|
36
|
+
*/
|
|
37
|
+
getPromptsByServer(serverName) {
|
|
38
|
+
const serverPrompts = [];
|
|
39
|
+
for (const prompt of this.prompts.values()) {
|
|
40
|
+
if (prompt.serverName === serverName) {
|
|
41
|
+
serverPrompts.push(prompt);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return serverPrompts.sort((a, b) => a.name.localeCompare(b.name));
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Clears all the prompts from the registry.
|
|
48
|
+
*/
|
|
49
|
+
clear() {
|
|
50
|
+
this.prompts.clear();
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Removes all prompts from a specific server.
|
|
54
|
+
*/
|
|
55
|
+
removePromptsByServer(serverName) {
|
|
56
|
+
for (const [name, prompt] of this.prompts.entries()) {
|
|
57
|
+
if (prompt.serverName === serverName) {
|
|
58
|
+
this.prompts.delete(name);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=prompt-registry.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M,EAAE,EAAE,CAAC;YAC3C,IAAI,MAAM,CAAC,UAAU,KAAK,UAAU,EAAE,CAAC;gBACrC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAC7B,CAAC;QACH,CAAC;QACD,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IACpE,CAAC;IAED;;OAEG;IACH,KAAK;QACH,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;IACvB,CAAC;IAED;;OAEG;IACH,qBAAqB,CAAC,UAAkB;QACtC,KAAK,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;YACpD,IAAI,MAAM,CAAC,UAAU,KAAK,UAAU,EAAE,CAAC;gBACrC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YAC5B,CAAC;QACH,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
export interface FilterFilesOptions {
|
|
7
|
+
respectGitIgnore?: boolean;
|
|
8
|
+
respectGeminiIgnore?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare class FileDiscoveryService {
|
|
11
|
+
private gitIgnoreFilter;
|
|
12
|
+
private geminiIgnoreFilter;
|
|
13
|
+
private projectRoot;
|
|
14
|
+
constructor(projectRoot: string);
|
|
15
|
+
/**
|
|
16
|
+
* Filters a list of file paths based on git ignore rules
|
|
17
|
+
*/
|
|
18
|
+
filterFiles(filePaths: string[], options?: FilterFilesOptions): string[];
|
|
19
|
+
/**
|
|
20
|
+
* Checks if a single file should be git-ignored
|
|
21
|
+
*/
|
|
22
|
+
shouldGitIgnoreFile(filePath: string): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Checks if a single file should be gemini-ignored
|
|
25
|
+
*/
|
|
26
|
+
shouldGeminiIgnoreFile(filePath: string): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Unified method to check if a file should be ignored based on filtering options
|
|
29
|
+
*/
|
|
30
|
+
shouldIgnoreFile(filePath: string, options?: FilterFilesOptions): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Returns loaded patterns from .geminiignore
|
|
33
|
+
*/
|
|
34
|
+
getGeminiIgnorePatterns(): string[];
|
|
35
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { GitIgnoreParser } from '../utils/gitIgnoreParser.js';
|
|
7
|
+
import { isGitRepository } from '../utils/gitUtils.js';
|
|
8
|
+
import * as path from 'path';
|
|
9
|
+
const GEMINI_IGNORE_FILE_NAME = '.geminiignore';
|
|
10
|
+
export class FileDiscoveryService {
|
|
11
|
+
gitIgnoreFilter = null;
|
|
12
|
+
geminiIgnoreFilter = null;
|
|
13
|
+
projectRoot;
|
|
14
|
+
constructor(projectRoot) {
|
|
15
|
+
this.projectRoot = path.resolve(projectRoot);
|
|
16
|
+
if (isGitRepository(this.projectRoot)) {
|
|
17
|
+
const parser = new GitIgnoreParser(this.projectRoot);
|
|
18
|
+
try {
|
|
19
|
+
parser.loadGitRepoPatterns();
|
|
20
|
+
}
|
|
21
|
+
catch (_error) {
|
|
22
|
+
// ignore file not found
|
|
23
|
+
}
|
|
24
|
+
this.gitIgnoreFilter = parser;
|
|
25
|
+
}
|
|
26
|
+
const gParser = new GitIgnoreParser(this.projectRoot);
|
|
27
|
+
try {
|
|
28
|
+
gParser.loadPatterns(GEMINI_IGNORE_FILE_NAME);
|
|
29
|
+
}
|
|
30
|
+
catch (_error) {
|
|
31
|
+
// ignore file not found
|
|
32
|
+
}
|
|
33
|
+
this.geminiIgnoreFilter = gParser;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Filters a list of file paths based on git ignore rules
|
|
37
|
+
*/
|
|
38
|
+
filterFiles(filePaths, options = {
|
|
39
|
+
respectGitIgnore: true,
|
|
40
|
+
respectGeminiIgnore: true,
|
|
41
|
+
}) {
|
|
42
|
+
return filePaths.filter((filePath) => {
|
|
43
|
+
if (options.respectGitIgnore && this.shouldGitIgnoreFile(filePath)) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
if (options.respectGeminiIgnore &&
|
|
47
|
+
this.shouldGeminiIgnoreFile(filePath)) {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
return true;
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Checks if a single file should be git-ignored
|
|
55
|
+
*/
|
|
56
|
+
shouldGitIgnoreFile(filePath) {
|
|
57
|
+
if (this.gitIgnoreFilter) {
|
|
58
|
+
return this.gitIgnoreFilter.isIgnored(filePath);
|
|
59
|
+
}
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Checks if a single file should be gemini-ignored
|
|
64
|
+
*/
|
|
65
|
+
shouldGeminiIgnoreFile(filePath) {
|
|
66
|
+
if (this.geminiIgnoreFilter) {
|
|
67
|
+
return this.geminiIgnoreFilter.isIgnored(filePath);
|
|
68
|
+
}
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Unified method to check if a file should be ignored based on filtering options
|
|
73
|
+
*/
|
|
74
|
+
shouldIgnoreFile(filePath, options = {}) {
|
|
75
|
+
const { respectGitIgnore = true, respectGeminiIgnore = true } = options;
|
|
76
|
+
if (respectGitIgnore && this.shouldGitIgnoreFile(filePath)) {
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
if (respectGeminiIgnore && this.shouldGeminiIgnoreFile(filePath)) {
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Returns loaded patterns from .geminiignore
|
|
86
|
+
*/
|
|
87
|
+
getGeminiIgnorePatterns() {
|
|
88
|
+
return this.geminiIgnoreFilter?.getPatterns() ?? [];
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=fileDiscoveryService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fileDiscoveryService.js","sourceRoot":"","sources":["../../../src/services/fileDiscoveryService.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,eAAe,EAAmB,MAAM,6BAA6B,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,MAAM,uBAAuB,GAAG,eAAe,CAAC;AAOhD,MAAM,OAAO,oBAAoB;IACvB,eAAe,GAA2B,IAAI,CAAC;IAC/C,kBAAkB,GAA2B,IAAI,CAAC;IAClD,WAAW,CAAS;IAE5B,YAAY,WAAmB;QAC7B,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QAC7C,IAAI,eAAe,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC;YACtC,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YACrD,IAAI,CAAC;gBACH,MAAM,CAAC,mBAAmB,EAAE,CAAC;YAC/B,CAAC;YAAC,OAAO,MAAM,EAAE,CAAC;gBAChB,wBAAwB;YAC1B,CAAC;YACD,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC;QAChC,CAAC;QACD,MAAM,OAAO,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC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