@hibanacloud/core 0.3.15
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 +19 -0
- package/dist/index.js +20 -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 +12 -0
- package/dist/src/code_assist/codeAssist.js +31 -0
- package/dist/src/code_assist/codeAssist.js.map +1 -0
- package/dist/src/code_assist/converter.d.ts +74 -0
- package/dist/src/code_assist/converter.js +160 -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 +372 -0
- package/dist/src/code_assist/converter.test.js.map +1 -0
- package/dist/src/code_assist/oauth-credential-storage.d.ts +25 -0
- package/dist/src/code_assist/oauth-credential-storage.js +109 -0
- package/dist/src/code_assist/oauth-credential-storage.js.map +1 -0
- package/dist/src/code_assist/oauth-credential-storage.test.d.ts +6 -0
- package/dist/src/code_assist/oauth-credential-storage.test.js +136 -0
- package/dist/src/code_assist/oauth-credential-storage.test.js.map +1 -0
- package/dist/src/code_assist/oauth2.d.ts +22 -0
- package/dist/src/code_assist/oauth2.js +431 -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 +818 -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 +148 -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 +159 -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 +101 -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 +171 -0
- package/dist/src/code_assist/setup.test.js.map +1 -0
- package/dist/src/code_assist/types.d.ts +163 -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 +431 -0
- package/dist/src/config/config.js +869 -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 +896 -0
- package/dist/src/config/config.test.js.map +1 -0
- package/dist/src/config/constants.d.ts +11 -0
- package/dist/src/config/constants.js +16 -0
- package/dist/src/config/constants.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 +28 -0
- package/dist/src/config/models.js +42 -0
- package/dist/src/config/models.js.map +1 -0
- package/dist/src/config/models.test.d.ts +6 -0
- package/dist/src/config/models.test.js +55 -0
- package/dist/src/config/models.test.js.map +1 -0
- package/dist/src/config/storage.d.ts +34 -0
- package/dist/src/config/storage.js +95 -0
- package/dist/src/config/storage.js.map +1 -0
- package/dist/src/config/storage.test.d.ts +6 -0
- package/dist/src/config/storage.test.js +43 -0
- package/dist/src/config/storage.test.js.map +1 -0
- package/dist/src/core/__tests__/openaiTimeoutHandling.test.d.ts +6 -0
- package/dist/src/core/__tests__/openaiTimeoutHandling.test.js +295 -0
- package/dist/src/core/__tests__/openaiTimeoutHandling.test.js.map +1 -0
- package/dist/src/core/__tests__/orphanedToolCallsTest.d.ts +64 -0
- package/dist/src/core/__tests__/orphanedToolCallsTest.js +122 -0
- package/dist/src/core/__tests__/orphanedToolCallsTest.js.map +1 -0
- package/dist/src/core/baseLlmClient.d.ts +49 -0
- package/dist/src/core/baseLlmClient.js +104 -0
- package/dist/src/core/baseLlmClient.js.map +1 -0
- package/dist/src/core/baseLlmClient.test.d.ts +6 -0
- package/dist/src/core/baseLlmClient.test.js +323 -0
- package/dist/src/core/baseLlmClient.test.js.map +1 -0
- package/dist/src/core/client.d.ts +56 -0
- package/dist/src/core/client.js +522 -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 +1829 -0
- package/dist/src/core/client.test.js.map +1 -0
- package/dist/src/core/contentGenerator.d.ts +52 -0
- package/dist/src/core/contentGenerator.js +106 -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 +77 -0
- package/dist/src/core/contentGenerator.test.js.map +1 -0
- package/dist/src/core/coreToolScheduler.d.ts +134 -0
- package/dist/src/core/coreToolScheduler.js +774 -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 +1802 -0
- package/dist/src/core/coreToolScheduler.test.js.map +1 -0
- package/dist/src/core/geminiChat.d.ts +124 -0
- package/dist/src/core/geminiChat.js +518 -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 +1149 -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 +11 -0
- package/dist/src/core/geminiRequest.js.map +1 -0
- package/dist/src/core/geminiRequest.test.d.ts +6 -0
- package/dist/src/core/geminiRequest.test.js +73 -0
- package/dist/src/core/geminiRequest.test.js.map +1 -0
- package/dist/src/core/logger.d.ts +67 -0
- package/dist/src/core/logger.js +361 -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 +534 -0
- package/dist/src/core/logger.test.js.map +1 -0
- package/dist/src/core/loggingContentGenerator.d.ts +25 -0
- package/dist/src/core/loggingContentGenerator.js +94 -0
- package/dist/src/core/loggingContentGenerator.js.map +1 -0
- package/dist/src/core/nonInteractiveToolExecutor.d.ts +16 -0
- package/dist/src/core/nonInteractiveToolExecutor.js +29 -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 +294 -0
- package/dist/src/core/nonInteractiveToolExecutor.test.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/constants.d.ts +7 -0
- package/dist/src/core/openaiContentGenerator/constants.js +8 -0
- package/dist/src/core/openaiContentGenerator/constants.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/converter.d.ts +108 -0
- package/dist/src/core/openaiContentGenerator/converter.js +851 -0
- package/dist/src/core/openaiContentGenerator/converter.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/converter.test.d.ts +6 -0
- package/dist/src/core/openaiContentGenerator/converter.test.js +108 -0
- package/dist/src/core/openaiContentGenerator/converter.test.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/errorHandler.d.ts +20 -0
- package/dist/src/core/openaiContentGenerator/errorHandler.js +82 -0
- package/dist/src/core/openaiContentGenerator/errorHandler.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/errorHandler.test.d.ts +6 -0
- package/dist/src/core/openaiContentGenerator/errorHandler.test.js +287 -0
- package/dist/src/core/openaiContentGenerator/errorHandler.test.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/index.d.ts +22 -0
- package/dist/src/core/openaiContentGenerator/index.js +49 -0
- package/dist/src/core/openaiContentGenerator/index.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/openaiContentGenerator.d.ts +21 -0
- package/dist/src/core/openaiContentGenerator/openaiContentGenerator.js +105 -0
- package/dist/src/core/openaiContentGenerator/openaiContentGenerator.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/openaiContentGenerator.test.d.ts +6 -0
- package/dist/src/core/openaiContentGenerator/openaiContentGenerator.test.js +230 -0
- package/dist/src/core/openaiContentGenerator/openaiContentGenerator.test.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/pipeline.d.ts +66 -0
- package/dist/src/core/openaiContentGenerator/pipeline.js +265 -0
- package/dist/src/core/openaiContentGenerator/pipeline.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/pipeline.test.d.ts +6 -0
- package/dist/src/core/openaiContentGenerator/pipeline.test.js +1028 -0
- package/dist/src/core/openaiContentGenerator/pipeline.test.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/provider/README.md +61 -0
- package/dist/src/core/openaiContentGenerator/provider/anthropic.d.ts +14 -0
- package/dist/src/core/openaiContentGenerator/provider/anthropic.js +28 -0
- package/dist/src/core/openaiContentGenerator/provider/anthropic.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/provider/anthropic.test.d.ts +1 -0
- package/dist/src/core/openaiContentGenerator/provider/anthropic.test.js +138 -0
- package/dist/src/core/openaiContentGenerator/provider/anthropic.test.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/provider/dashscope.d.ts +63 -0
- package/dist/src/core/openaiContentGenerator/provider/dashscope.js +241 -0
- package/dist/src/core/openaiContentGenerator/provider/dashscope.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/provider/dashscope.test.d.ts +6 -0
- package/dist/src/core/openaiContentGenerator/provider/dashscope.test.js +707 -0
- package/dist/src/core/openaiContentGenerator/provider/dashscope.test.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/provider/deepseek.d.ts +14 -0
- package/dist/src/core/openaiContentGenerator/provider/deepseek.js +70 -0
- package/dist/src/core/openaiContentGenerator/provider/deepseek.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/provider/deepseek.test.d.ts +6 -0
- package/dist/src/core/openaiContentGenerator/provider/deepseek.test.js +151 -0
- package/dist/src/core/openaiContentGenerator/provider/deepseek.test.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/provider/default.d.ts +15 -0
- package/dist/src/core/openaiContentGenerator/provider/default.js +48 -0
- package/dist/src/core/openaiContentGenerator/provider/default.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/provider/default.test.d.ts +6 -0
- package/dist/src/core/openaiContentGenerator/provider/default.test.js +176 -0
- package/dist/src/core/openaiContentGenerator/provider/default.test.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/provider/index.d.ts +7 -0
- package/dist/src/core/openaiContentGenerator/provider/index.js +7 -0
- package/dist/src/core/openaiContentGenerator/provider/index.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/provider/modelscope.d.ts +17 -0
- package/dist/src/core/openaiContentGenerator/provider/modelscope.js +25 -0
- package/dist/src/core/openaiContentGenerator/provider/modelscope.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/provider/modelscope.test.d.ts +6 -0
- package/dist/src/core/openaiContentGenerator/provider/modelscope.test.js +66 -0
- package/dist/src/core/openaiContentGenerator/provider/modelscope.test.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/provider/openrouter.d.ts +10 -0
- package/dist/src/core/openaiContentGenerator/provider/openrouter.js +33 -0
- package/dist/src/core/openaiContentGenerator/provider/openrouter.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/provider/openrouter.test.d.ts +6 -0
- package/dist/src/core/openaiContentGenerator/provider/openrouter.test.js +175 -0
- package/dist/src/core/openaiContentGenerator/provider/openrouter.test.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/provider/types.d.ts +23 -0
- package/dist/src/core/openaiContentGenerator/provider/types.js +2 -0
- package/dist/src/core/openaiContentGenerator/provider/types.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/streamingToolCallParser.d.ts +145 -0
- package/dist/src/core/openaiContentGenerator/streamingToolCallParser.js +381 -0
- package/dist/src/core/openaiContentGenerator/streamingToolCallParser.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/streamingToolCallParser.test.d.ts +6 -0
- package/dist/src/core/openaiContentGenerator/streamingToolCallParser.test.js +537 -0
- package/dist/src/core/openaiContentGenerator/streamingToolCallParser.test.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/telemetryService.d.ts +36 -0
- package/dist/src/core/openaiContentGenerator/telemetryService.js +150 -0
- package/dist/src/core/openaiContentGenerator/telemetryService.js.map +1 -0
- package/dist/src/core/openaiContentGenerator/telemetryService.test.d.ts +6 -0
- package/dist/src/core/openaiContentGenerator/telemetryService.test.js +978 -0
- package/dist/src/core/openaiContentGenerator/telemetryService.test.js.map +1 -0
- package/dist/src/core/prompts.d.ts +73 -0
- package/dist/src/core/prompts.js +813 -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 +488 -0
- package/dist/src/core/prompts.test.js.map +1 -0
- package/dist/src/core/tokenLimits.d.ts +25 -0
- package/dist/src/core/tokenLimits.js +194 -0
- package/dist/src/core/tokenLimits.js.map +1 -0
- package/dist/src/core/tokenLimits.test.d.ts +1 -0
- package/dist/src/core/tokenLimits.test.js +304 -0
- package/dist/src/core/tokenLimits.test.js.map +1 -0
- package/dist/src/core/turn.d.ts +152 -0
- package/dist/src/core/turn.js +187 -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 +628 -0
- package/dist/src/core/turn.test.js.map +1 -0
- package/dist/src/fallback/handler.d.ts +7 -0
- package/dist/src/fallback/handler.js +97 -0
- package/dist/src/fallback/handler.js.map +1 -0
- package/dist/src/fallback/handler.test.d.ts +6 -0
- package/dist/src/fallback/handler.test.js +130 -0
- package/dist/src/fallback/handler.test.js.map +1 -0
- package/dist/src/fallback/types.d.ts +14 -0
- package/dist/src/fallback/types.js +7 -0
- package/dist/src/fallback/types.js.map +1 -0
- package/dist/src/generated/git-commit.d.ts +7 -0
- package/dist/src/generated/git-commit.js +10 -0
- package/dist/src/generated/git-commit.js.map +1 -0
- package/dist/src/ide/constants.d.ts +9 -0
- package/dist/src/ide/constants.js +10 -0
- package/dist/src/ide/constants.js.map +1 -0
- package/dist/src/ide/detect-ide.d.ts +56 -0
- package/dist/src/ide/detect-ide.js +68 -0
- package/dist/src/ide/detect-ide.js.map +1 -0
- package/dist/src/ide/detect-ide.test.d.ts +6 -0
- package/dist/src/ide/detect-ide.test.js +113 -0
- package/dist/src/ide/detect-ide.test.js.map +1 -0
- package/dist/src/ide/ide-client.d.ts +110 -0
- package/dist/src/ide/ide-client.js +651 -0
- package/dist/src/ide/ide-client.js.map +1 -0
- package/dist/src/ide/ide-client.test.d.ts +6 -0
- package/dist/src/ide/ide-client.test.js +390 -0
- package/dist/src/ide/ide-client.test.js.map +1 -0
- package/dist/src/ide/ide-installer.d.ts +14 -0
- package/dist/src/ide/ide-installer.js +112 -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 +134 -0
- package/dist/src/ide/ide-installer.test.js.map +1 -0
- package/dist/src/ide/ideContext.d.ts +44 -0
- package/dist/src/ide/ideContext.js +101 -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 +393 -0
- package/dist/src/ide/ideContext.test.js.map +1 -0
- package/dist/src/ide/process-utils.d.ts +21 -0
- package/dist/src/ide/process-utils.js +171 -0
- package/dist/src/ide/process-utils.js.map +1 -0
- package/dist/src/ide/process-utils.test.d.ts +6 -0
- package/dist/src/ide/process-utils.test.js +158 -0
- package/dist/src/ide/process-utils.test.js.map +1 -0
- package/dist/src/ide/types.d.ts +486 -0
- package/dist/src/ide/types.js +138 -0
- package/dist/src/ide/types.js.map +1 -0
- package/dist/src/index.d.ts +99 -0
- package/dist/src/index.js +112 -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 +72 -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 +89 -0
- package/dist/src/mcp/google-auth-provider.test.js.map +1 -0
- package/dist/src/mcp/oauth-provider.d.ts +150 -0
- package/dist/src/mcp/oauth-provider.js +613 -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 +847 -0
- package/dist/src/mcp/oauth-provider.test.js.map +1 -0
- package/dist/src/mcp/oauth-token-storage.d.ts +65 -0
- package/dist/src/mcp/oauth-token-storage.js +180 -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 +299 -0
- package/dist/src/mcp/oauth-token-storage.test.js.map +1 -0
- package/dist/src/mcp/oauth-utils.d.ts +119 -0
- package/dist/src/mcp/oauth-utils.js +236 -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 +199 -0
- package/dist/src/mcp/oauth-utils.test.js.map +1 -0
- package/dist/src/mcp/sa-impersonation-provider.d.ts +33 -0
- package/dist/src/mcp/sa-impersonation-provider.js +130 -0
- package/dist/src/mcp/sa-impersonation-provider.js.map +1 -0
- package/dist/src/mcp/sa-impersonation-provider.test.d.ts +6 -0
- package/dist/src/mcp/sa-impersonation-provider.test.js +117 -0
- package/dist/src/mcp/sa-impersonation-provider.test.js.map +1 -0
- package/dist/src/mcp/token-storage/base-token-storage.d.ts +19 -0
- package/dist/src/mcp/token-storage/base-token-storage.js +36 -0
- package/dist/src/mcp/token-storage/base-token-storage.js.map +1 -0
- package/dist/src/mcp/token-storage/base-token-storage.test.d.ts +6 -0
- package/dist/src/mcp/token-storage/base-token-storage.test.js +160 -0
- package/dist/src/mcp/token-storage/base-token-storage.test.js.map +1 -0
- package/dist/src/mcp/token-storage/file-token-storage.d.ts +24 -0
- package/dist/src/mcp/token-storage/file-token-storage.js +144 -0
- package/dist/src/mcp/token-storage/file-token-storage.js.map +1 -0
- package/dist/src/mcp/token-storage/file-token-storage.test.d.ts +6 -0
- package/dist/src/mcp/token-storage/file-token-storage.test.js +235 -0
- package/dist/src/mcp/token-storage/file-token-storage.test.js.map +1 -0
- package/dist/src/mcp/token-storage/hybrid-token-storage.d.ts +23 -0
- package/dist/src/mcp/token-storage/hybrid-token-storage.js +78 -0
- package/dist/src/mcp/token-storage/hybrid-token-storage.js.map +1 -0
- package/dist/src/mcp/token-storage/hybrid-token-storage.test.d.ts +6 -0
- package/dist/src/mcp/token-storage/hybrid-token-storage.test.js +193 -0
- package/dist/src/mcp/token-storage/hybrid-token-storage.test.js.map +1 -0
- package/dist/src/mcp/token-storage/index.d.ts +11 -0
- package/dist/src/mcp/token-storage/index.js +12 -0
- package/dist/src/mcp/token-storage/index.js.map +1 -0
- package/dist/src/mcp/token-storage/keychain-token-storage.d.ts +31 -0
- package/dist/src/mcp/token-storage/keychain-token-storage.js +190 -0
- package/dist/src/mcp/token-storage/keychain-token-storage.js.map +1 -0
- package/dist/src/mcp/token-storage/keychain-token-storage.test.d.ts +6 -0
- package/dist/src/mcp/token-storage/keychain-token-storage.test.js +254 -0
- package/dist/src/mcp/token-storage/keychain-token-storage.test.js.map +1 -0
- package/dist/src/mcp/token-storage/types.d.ts +38 -0
- package/dist/src/mcp/token-storage/types.js +11 -0
- package/dist/src/mcp/token-storage/types.js.map +1 -0
- package/dist/src/mocks/msw.d.ts +6 -0
- package/dist/src/mocks/msw.js +8 -0
- package/dist/src/mocks/msw.js.map +1 -0
- package/dist/src/oauth/callbackServer.d.ts +15 -0
- package/dist/src/oauth/callbackServer.js +89 -0
- package/dist/src/oauth/callbackServer.js.map +1 -0
- package/dist/src/oauth/oauthClient.d.ts +57 -0
- package/dist/src/oauth/oauthClient.js +233 -0
- package/dist/src/oauth/oauthClient.js.map +1 -0
- package/dist/src/oauth/pkce.d.ts +25 -0
- package/dist/src/oauth/pkce.js +45 -0
- package/dist/src/oauth/pkce.js.map +1 -0
- package/dist/src/oauth/tokenManager.d.ts +37 -0
- package/dist/src/oauth/tokenManager.js +110 -0
- package/dist/src/oauth/tokenManager.js.map +1 -0
- package/dist/src/output/json-formatter.d.ts +11 -0
- package/dist/src/output/json-formatter.js +30 -0
- package/dist/src/output/json-formatter.js.map +1 -0
- package/dist/src/output/json-formatter.test.d.ts +6 -0
- package/dist/src/output/json-formatter.test.js +266 -0
- package/dist/src/output/json-formatter.test.js.map +1 -0
- package/dist/src/output/types.d.ts +25 -0
- package/dist/src/output/types.js +17 -0
- package/dist/src/output/types.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/qwen/qwenContentGenerator.d.ts +70 -0
- package/dist/src/qwen/qwenContentGenerator.js +180 -0
- package/dist/src/qwen/qwenContentGenerator.js.map +1 -0
- package/dist/src/qwen/qwenContentGenerator.test.d.ts +6 -0
- package/dist/src/qwen/qwenContentGenerator.test.js +1178 -0
- package/dist/src/qwen/qwenContentGenerator.test.js.map +1 -0
- package/dist/src/qwen/qwenOAuth2.d.ts +194 -0
- package/dist/src/qwen/qwenOAuth2.js +594 -0
- package/dist/src/qwen/qwenOAuth2.js.map +1 -0
- package/dist/src/qwen/qwenOAuth2.test.d.ts +6 -0
- package/dist/src/qwen/qwenOAuth2.test.js +1724 -0
- package/dist/src/qwen/qwenOAuth2.test.js.map +1 -0
- package/dist/src/qwen/sharedTokenManager.d.ts +196 -0
- package/dist/src/qwen/sharedTokenManager.js +647 -0
- package/dist/src/qwen/sharedTokenManager.js.map +1 -0
- package/dist/src/qwen/sharedTokenManager.test.d.ts +7 -0
- package/dist/src/qwen/sharedTokenManager.test.js +662 -0
- package/dist/src/qwen/sharedTokenManager.test.js.map +1 -0
- package/dist/src/services/chatCompressionService.d.ts +32 -0
- package/dist/src/services/chatCompressionService.js +180 -0
- package/dist/src/services/chatCompressionService.js.map +1 -0
- package/dist/src/services/chatCompressionService.test.d.ts +6 -0
- package/dist/src/services/chatCompressionService.test.js +292 -0
- package/dist/src/services/chatCompressionService.test.js.map +1 -0
- package/dist/src/services/chatRecordingService.d.ts +144 -0
- package/dist/src/services/chatRecordingService.js +330 -0
- package/dist/src/services/chatRecordingService.js.map +1 -0
- package/dist/src/services/chatRecordingService.test.d.ts +6 -0
- package/dist/src/services/chatRecordingService.test.js +332 -0
- package/dist/src/services/chatRecordingService.test.js.map +1 -0
- package/dist/src/services/fileDiscoveryService.d.ts +45 -0
- package/dist/src/services/fileDiscoveryService.js +104 -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/fileSystemService.d.ts +40 -0
- package/dist/src/services/fileSystemService.js +29 -0
- package/dist/src/services/fileSystemService.js.map +1 -0
- package/dist/src/services/fileSystemService.test.d.ts +6 -0
- package/dist/src/services/fileSystemService.test.js +41 -0
- package/dist/src/services/fileSystemService.test.js.map +1 -0
- package/dist/src/services/gitService.d.ts +22 -0
- package/dist/src/services/gitService.js +98 -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 +187 -0
- package/dist/src/services/gitService.test.js.map +1 -0
- package/dist/src/services/loopDetectionService.d.ts +103 -0
- package/dist/src/services/loopDetectionService.js +379 -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 +588 -0
- package/dist/src/services/loopDetectionService.test.js.map +1 -0
- package/dist/src/services/shellExecutionService.d.ts +102 -0
- package/dist/src/services/shellExecutionService.js +522 -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 +655 -0
- package/dist/src/services/shellExecutionService.test.js.map +1 -0
- package/dist/src/subagents/builtin-agents.d.ts +35 -0
- package/dist/src/subagents/builtin-agents.js +85 -0
- package/dist/src/subagents/builtin-agents.js.map +1 -0
- package/dist/src/subagents/builtin-agents.test.d.ts +6 -0
- package/dist/src/subagents/builtin-agents.test.js +78 -0
- package/dist/src/subagents/builtin-agents.test.js.map +1 -0
- package/dist/src/subagents/index.d.ts +29 -0
- package/dist/src/subagents/index.js +15 -0
- package/dist/src/subagents/index.js.map +1 -0
- package/dist/src/subagents/subagent-events.d.ts +95 -0
- package/dist/src/subagents/subagent-events.js +31 -0
- package/dist/src/subagents/subagent-events.js.map +1 -0
- package/dist/src/subagents/subagent-hooks.d.ts +29 -0
- package/dist/src/subagents/subagent-hooks.js +7 -0
- package/dist/src/subagents/subagent-hooks.js.map +1 -0
- package/dist/src/subagents/subagent-manager.d.ts +170 -0
- package/dist/src/subagents/subagent-manager.js +596 -0
- package/dist/src/subagents/subagent-manager.js.map +1 -0
- package/dist/src/subagents/subagent-manager.test.d.ts +6 -0
- package/dist/src/subagents/subagent-manager.test.js +822 -0
- package/dist/src/subagents/subagent-manager.test.js.map +1 -0
- package/dist/src/subagents/subagent-statistics.d.ts +46 -0
- package/dist/src/subagents/subagent-statistics.js +193 -0
- package/dist/src/subagents/subagent-statistics.js.map +1 -0
- package/dist/src/subagents/subagent-statistics.test.d.ts +6 -0
- package/dist/src/subagents/subagent-statistics.test.js +231 -0
- package/dist/src/subagents/subagent-statistics.test.js.map +1 -0
- package/dist/src/subagents/subagent.d.ts +162 -0
- package/dist/src/subagents/subagent.js +677 -0
- package/dist/src/subagents/subagent.js.map +1 -0
- package/dist/src/subagents/subagent.test.d.ts +6 -0
- package/dist/src/subagents/subagent.test.js +477 -0
- package/dist/src/subagents/subagent.test.js.map +1 -0
- package/dist/src/subagents/types.d.ts +218 -0
- package/dist/src/subagents/types.js +58 -0
- package/dist/src/subagents/types.js.map +1 -0
- package/dist/src/subagents/types.test.d.ts +6 -0
- package/dist/src/subagents/types.test.js +31 -0
- package/dist/src/subagents/types.test.js.map +1 -0
- package/dist/src/subagents/validation.d.ts +63 -0
- package/dist/src/subagents/validation.js +293 -0
- package/dist/src/subagents/validation.js.map +1 -0
- package/dist/src/subagents/validation.test.d.ts +6 -0
- package/dist/src/subagents/validation.test.js +330 -0
- package/dist/src/subagents/validation.test.js.map +1 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.d.ts +137 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.js +915 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.js.map +1 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.d.ts +18 -0
- package/dist/src/telemetry/clearcut-logger/clearcut-logger.test.js +594 -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 +115 -0
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.js +291 -0
- package/dist/src/telemetry/clearcut-logger/event-metadata-key.js.map +1 -0
- package/dist/src/telemetry/config.d.ts +31 -0
- package/dist/src/telemetry/config.js +76 -0
- package/dist/src/telemetry/config.js.map +1 -0
- package/dist/src/telemetry/config.test.d.ts +6 -0
- package/dist/src/telemetry/config.test.js +124 -0
- package/dist/src/telemetry/config.test.js.map +1 -0
- package/dist/src/telemetry/constants.d.ts +36 -0
- package/dist/src/telemetry/constants.js +38 -0
- package/dist/src/telemetry/constants.js.map +1 -0
- package/dist/src/telemetry/file-exporters.d.ts +29 -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 +25 -0
- package/dist/src/telemetry/index.js +31 -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 +95 -0
- package/dist/src/telemetry/integration.test.circular.js.map +1 -0
- package/dist/src/telemetry/loggers.d.ts +37 -0
- package/dist/src/telemetry/loggers.js +651 -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 +978 -0
- package/dist/src/telemetry/loggers.test.js.map +1 -0
- package/dist/src/telemetry/metrics.d.ts +320 -0
- package/dist/src/telemetry/metrics.js +532 -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 +744 -0
- package/dist/src/telemetry/metrics.test.js.map +1 -0
- package/dist/src/telemetry/qwen-logger/event-types.d.ts +88 -0
- package/dist/src/telemetry/qwen-logger/event-types.js +2 -0
- package/dist/src/telemetry/qwen-logger/event-types.js.map +1 -0
- package/dist/src/telemetry/qwen-logger/qwen-logger.d.ts +91 -0
- package/dist/src/telemetry/qwen-logger/qwen-logger.js +685 -0
- package/dist/src/telemetry/qwen-logger/qwen-logger.js.map +1 -0
- package/dist/src/telemetry/qwen-logger/qwen-logger.test.d.ts +6 -0
- package/dist/src/telemetry/qwen-logger/qwen-logger.test.js +317 -0
- package/dist/src/telemetry/qwen-logger/qwen-logger.test.js.map +1 -0
- package/dist/src/telemetry/sdk.d.ts +9 -0
- package/dist/src/telemetry/sdk.js +164 -0
- package/dist/src/telemetry/sdk.js.map +1 -0
- package/dist/src/telemetry/sdk.test.d.ts +6 -0
- package/dist/src/telemetry/sdk.test.js +116 -0
- package/dist/src/telemetry/sdk.test.js.map +1 -0
- package/dist/src/telemetry/telemetry-utils.d.ts +6 -0
- package/dist/src/telemetry/telemetry-utils.js +14 -0
- package/dist/src/telemetry/telemetry-utils.js.map +1 -0
- package/dist/src/telemetry/telemetry-utils.test.d.ts +6 -0
- package/dist/src/telemetry/telemetry-utils.test.js +40 -0
- package/dist/src/telemetry/telemetry-utils.test.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 +327 -0
- package/dist/src/telemetry/types.js +558 -0
- package/dist/src/telemetry/types.js.map +1 -0
- package/dist/src/telemetry/uiTelemetry.d.ts +75 -0
- package/dist/src/telemetry/uiTelemetry.js +152 -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 +625 -0
- package/dist/src/telemetry/uiTelemetry.test.js.map +1 -0
- package/dist/src/test-utils/config.d.ts +17 -0
- package/dist/src/test-utils/config.js +32 -0
- package/dist/src/test-utils/config.js.map +1 -0
- package/dist/src/test-utils/index.d.ts +6 -0
- package/dist/src/test-utils/index.js +7 -0
- package/dist/src/test-utils/index.js.map +1 -0
- package/dist/src/test-utils/mock-tool.d.ts +66 -0
- package/dist/src/test-utils/mock-tool.js +121 -0
- package/dist/src/test-utils/mock-tool.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/tools/diffOptions.d.ts +9 -0
- package/dist/src/tools/diffOptions.js +46 -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 +155 -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 +421 -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 +684 -0
- package/dist/src/tools/edit.test.js.map +1 -0
- package/dist/src/tools/exitPlanMode.d.ts +28 -0
- package/dist/src/tools/exitPlanMode.js +132 -0
- package/dist/src/tools/exitPlanMode.js.map +1 -0
- package/dist/src/tools/exitPlanMode.test.d.ts +6 -0
- package/dist/src/tools/exitPlanMode.test.js +178 -0
- package/dist/src/tools/exitPlanMode.test.js.map +1 -0
- package/dist/src/tools/glob.d.ts +44 -0
- package/dist/src/tools/glob.js +190 -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 +442 -0
- package/dist/src/tools/glob.test.js.map +1 -0
- package/dist/src/tools/grep.d.ts +44 -0
- package/dist/src/tools/grep.js +425 -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 +360 -0
- package/dist/src/tools/grep.test.js.map +1 -0
- package/dist/src/tools/ls.d.ts +68 -0
- package/dist/src/tools/ls.js +215 -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 +249 -0
- package/dist/src/tools/ls.test.js.map +1 -0
- package/dist/src/tools/mcp-client-manager.d.ts +40 -0
- package/dist/src/tools/mcp-client-manager.js +83 -0
- package/dist/src/tools/mcp-client-manager.js.map +1 -0
- package/dist/src/tools/mcp-client-manager.test.d.ts +6 -0
- package/dist/src/tools/mcp-client-manager.test.js +58 -0
- package/dist/src/tools/mcp-client-manager.test.js.map +1 -0
- package/dist/src/tools/mcp-client.d.ts +189 -0
- package/dist/src/tools/mcp-client.js +957 -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 +309 -0
- package/dist/src/tools/mcp-client.test.js.map +1 -0
- package/dist/src/tools/mcp-tool.d.ts +24 -0
- package/dist/src/tools/mcp-tool.js +268 -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 +714 -0
- package/dist/src/tools/mcp-tool.test.js.map +1 -0
- package/dist/src/tools/memoryTool.d.ts +41 -0
- package/dist/src/tools/memoryTool.js +396 -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 +419 -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 +35 -0
- package/dist/src/tools/read-file.js +124 -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 +339 -0
- package/dist/src/tools/read-file.test.js.map +1 -0
- package/dist/src/tools/read-many-files.d.ts +60 -0
- package/dist/src/tools/read-many-files.js +391 -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 +566 -0
- package/dist/src/tools/read-many-files.test.js.map +1 -0
- package/dist/src/tools/ripGrep.d.ts +44 -0
- package/dist/src/tools/ripGrep.js +233 -0
- package/dist/src/tools/ripGrep.js.map +1 -0
- package/dist/src/tools/ripGrep.test.d.ts +6 -0
- package/dist/src/tools/ripGrep.test.js +529 -0
- package/dist/src/tools/ripGrep.test.js.map +1 -0
- package/dist/src/tools/shell.d.ts +33 -0
- package/dist/src/tools/shell.js +388 -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 +566 -0
- package/dist/src/tools/shell.test.js.map +1 -0
- package/dist/src/tools/smart-edit.d.ts +91 -0
- package/dist/src/tools/smart-edit.js +703 -0
- package/dist/src/tools/smart-edit.js.map +1 -0
- package/dist/src/tools/smart-edit.test.d.ts +6 -0
- package/dist/src/tools/smart-edit.test.js +542 -0
- package/dist/src/tools/smart-edit.test.js.map +1 -0
- package/dist/src/tools/task.d.ts +59 -0
- package/dist/src/tools/task.js +412 -0
- package/dist/src/tools/task.js.map +1 -0
- package/dist/src/tools/task.test.d.ts +6 -0
- package/dist/src/tools/task.test.js +369 -0
- package/dist/src/tools/task.test.js.map +1 -0
- package/dist/src/tools/todoWrite.d.ts +42 -0
- package/dist/src/tools/todoWrite.js +407 -0
- package/dist/src/tools/todoWrite.js.map +1 -0
- package/dist/src/tools/todoWrite.test.d.ts +6 -0
- package/dist/src/tools/todoWrite.test.js +234 -0
- package/dist/src/tools/todoWrite.test.js.map +1 -0
- package/dist/src/tools/tool-error.d.ts +45 -0
- package/dist/src/tools/tool-error.js +61 -0
- package/dist/src/tools/tool-error.js.map +1 -0
- package/dist/src/tools/tool-names.d.ts +56 -0
- package/dist/src/tools/tool-names.js +62 -0
- package/dist/src/tools/tool-names.js.map +1 -0
- package/dist/src/tools/tool-registry.d.ts +87 -0
- package/dist/src/tools/tool-registry.js +370 -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 +332 -0
- package/dist/src/tools/tool-registry.test.js.map +1 -0
- package/dist/src/tools/tools.d.ts +327 -0
- package/dist/src/tools/tools.js +258 -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 +205 -0
- package/dist/src/tools/tools.test.js.map +1 -0
- package/dist/src/tools/web-fetch.d.ts +31 -0
- package/dist/src/tools/web-fetch.js +163 -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 +133 -0
- package/dist/src/tools/web-fetch.test.js.map +1 -0
- package/dist/src/tools/web-search/base-provider.d.ts +31 -0
- package/dist/src/tools/web-search/base-provider.js +34 -0
- package/dist/src/tools/web-search/base-provider.js.map +1 -0
- package/dist/src/tools/web-search/index.d.ts +24 -0
- package/dist/src/tools/web-search/index.js +245 -0
- package/dist/src/tools/web-search/index.js.map +1 -0
- package/dist/src/tools/web-search/index.test.d.ts +6 -0
- package/dist/src/tools/web-search/index.test.js +237 -0
- package/dist/src/tools/web-search/index.test.js.map +1 -0
- package/dist/src/tools/web-search/providers/dashscope-provider.d.ts +23 -0
- package/dist/src/tools/web-search/providers/dashscope-provider.js +120 -0
- package/dist/src/tools/web-search/providers/dashscope-provider.js.map +1 -0
- package/dist/src/tools/web-search/providers/google-provider.d.ts +17 -0
- package/dist/src/tools/web-search/providers/google-provider.js +55 -0
- package/dist/src/tools/web-search/providers/google-provider.js.map +1 -0
- package/dist/src/tools/web-search/providers/tavily-provider.d.ts +17 -0
- package/dist/src/tools/web-search/providers/tavily-provider.js +54 -0
- package/dist/src/tools/web-search/providers/tavily-provider.js.map +1 -0
- package/dist/src/tools/web-search/types.d.ts +138 -0
- package/dist/src/tools/web-search/types.js +7 -0
- package/dist/src/tools/web-search/types.js.map +1 -0
- package/dist/src/tools/web-search/utils.d.ts +28 -0
- package/dist/src/tools/web-search/utils.js +35 -0
- package/dist/src/tools/web-search/utils.js.map +1 -0
- package/dist/src/tools/write-file.d.ts +52 -0
- package/dist/src/tools/write-file.js +293 -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 +516 -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 +95 -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 +50 -0
- package/dist/src/utils/browser.js.map +1 -0
- package/dist/src/utils/editHelper.d.ts +53 -0
- package/dist/src/utils/editHelper.js +359 -0
- package/dist/src/utils/editHelper.js.map +1 -0
- package/dist/src/utils/editHelper.test.d.ts +6 -0
- package/dist/src/utils/editHelper.test.js +93 -0
- package/dist/src/utils/editHelper.test.js.map +1 -0
- package/dist/src/utils/editor.d.ts +28 -0
- package/dist/src/utils/editor.js +177 -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 +437 -0
- package/dist/src/utils/editor.test.js.map +1 -0
- package/dist/src/utils/environmentContext.d.ts +22 -0
- package/dist/src/utils/environmentContext.js +108 -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 +219 -0
- package/dist/src/utils/environmentContext.test.js.map +1 -0
- package/dist/src/utils/errorParsing.d.ts +8 -0
- package/dist/src/utils/errorParsing.js +93 -0
- package/dist/src/utils/errorParsing.js.map +1 -0
- package/dist/src/utils/errorParsing.test.d.ts +6 -0
- package/dist/src/utils/errorParsing.test.js +172 -0
- package/dist/src/utils/errorParsing.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 +39 -0
- package/dist/src/utils/errors.js +96 -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 +69 -0
- package/dist/src/utils/fileUtils.js +426 -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 +685 -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/crawler.d.ts +15 -0
- package/dist/src/utils/filesearch/crawler.js +50 -0
- package/dist/src/utils/filesearch/crawler.js.map +1 -0
- package/dist/src/utils/filesearch/crawler.test.d.ts +6 -0
- package/dist/src/utils/filesearch/crawler.test.js +468 -0
- package/dist/src/utils/filesearch/crawler.test.js.map +1 -0
- package/dist/src/utils/filesearch/fileSearch.d.ts +38 -0
- package/dist/src/utils/filesearch/fileSearch.js +191 -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 +642 -0
- package/dist/src/utils/filesearch/fileSearch.test.js.map +1 -0
- package/dist/src/utils/filesearch/ignore.d.ts +42 -0
- package/dist/src/utils/filesearch/ignore.js +106 -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 +144 -0
- package/dist/src/utils/filesearch/ignore.test.js.map +1 -0
- package/dist/src/utils/filesearch/result-cache.d.ts +33 -0
- package/dist/src/utils/filesearch/result-cache.js +59 -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 +46 -0
- package/dist/src/utils/filesearch/result-cache.test.js.map +1 -0
- package/dist/src/utils/flashFallback.test.d.ts +6 -0
- package/dist/src/utils/flashFallback.test.js +122 -0
- package/dist/src/utils/flashFallback.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 +13 -0
- package/dist/src/utils/generateContentResponseUtilities.js +80 -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 +235 -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/getPty.d.ts +19 -0
- package/dist/src/utils/getPty.js +23 -0
- package/dist/src/utils/getPty.js.map +1 -0
- package/dist/src/utils/gitIgnoreParser.d.ts +16 -0
- package/dist/src/utils/gitIgnoreParser.js +152 -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 +185 -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/ignorePatterns.d.ts +103 -0
- package/dist/src/utils/ignorePatterns.js +220 -0
- package/dist/src/utils/ignorePatterns.js.map +1 -0
- package/dist/src/utils/ignorePatterns.test.d.ts +6 -0
- package/dist/src/utils/ignorePatterns.test.js +250 -0
- package/dist/src/utils/ignorePatterns.test.js.map +1 -0
- package/dist/src/utils/installationManager.d.ts +16 -0
- package/dist/src/utils/installationManager.js +50 -0
- package/dist/src/utils/installationManager.js.map +1 -0
- package/dist/src/utils/installationManager.test.d.ts +6 -0
- package/dist/src/utils/installationManager.test.js +83 -0
- package/dist/src/utils/installationManager.test.js.map +1 -0
- package/dist/src/utils/language-detection.d.ts +6 -0
- package/dist/src/utils/language-detection.js +101 -0
- package/dist/src/utils/language-detection.js.map +1 -0
- package/dist/src/utils/llm-edit-fixer.d.ts +26 -0
- package/dist/src/utils/llm-edit-fixer.js +131 -0
- package/dist/src/utils/llm-edit-fixer.js.map +1 -0
- package/dist/src/utils/llm-edit-fixer.test.d.ts +6 -0
- package/dist/src/utils/llm-edit-fixer.test.js +186 -0
- package/dist/src/utils/llm-edit-fixer.test.js.map +1 -0
- package/dist/src/utils/memoryDiscovery.d.ts +16 -0
- package/dist/src/utils/memoryDiscovery.js +272 -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 +244 -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 +284 -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 +587 -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 +97 -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 +181 -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 +138 -0
- package/dist/src/utils/openaiLogger.js.map +1 -0
- package/dist/src/utils/openaiLogger.test.d.ts +6 -0
- package/dist/src/utils/openaiLogger.test.js +304 -0
- package/dist/src/utils/openaiLogger.test.js.map +1 -0
- package/dist/src/utils/partUtils.d.ts +35 -0
- package/dist/src/utils/partUtils.js +133 -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 +241 -0
- package/dist/src/utils/partUtils.test.js.map +1 -0
- package/dist/src/utils/pathReader.d.ts +17 -0
- package/dist/src/utils/pathReader.js +92 -0
- package/dist/src/utils/pathReader.js.map +1 -0
- package/dist/src/utils/pathReader.test.d.ts +6 -0
- package/dist/src/utils/pathReader.test.js +365 -0
- package/dist/src/utils/pathReader.test.js.map +1 -0
- package/dist/src/utils/paths.d.ts +93 -0
- package/dist/src/utils/paths.js +229 -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 +438 -0
- package/dist/src/utils/paths.test.js.map +1 -0
- package/dist/src/utils/projectSummary.d.ts +22 -0
- package/dist/src/utils/projectSummary.js +86 -0
- package/dist/src/utils/projectSummary.js.map +1 -0
- package/dist/src/utils/promptIdContext.d.ts +7 -0
- package/dist/src/utils/promptIdContext.js +8 -0
- package/dist/src/utils/promptIdContext.js.map +1 -0
- package/dist/src/utils/quotaErrorDetection.d.ts +20 -0
- package/dist/src/utils/quotaErrorDetection.js +114 -0
- package/dist/src/utils/quotaErrorDetection.js.map +1 -0
- package/dist/src/utils/quotaErrorDetection.test.d.ts +6 -0
- package/dist/src/utils/quotaErrorDetection.test.js +153 -0
- package/dist/src/utils/quotaErrorDetection.test.js.map +1 -0
- package/dist/src/utils/qwenIgnoreParser.d.ts +18 -0
- package/dist/src/utils/qwenIgnoreParser.js +69 -0
- package/dist/src/utils/qwenIgnoreParser.js.map +1 -0
- package/dist/src/utils/qwenIgnoreParser.test.d.ts +6 -0
- package/dist/src/utils/qwenIgnoreParser.test.js +50 -0
- package/dist/src/utils/qwenIgnoreParser.test.js.map +1 -0
- package/dist/src/utils/request-tokenizer/imageTokenizer.d.ts +112 -0
- package/dist/src/utils/request-tokenizer/imageTokenizer.js +401 -0
- package/dist/src/utils/request-tokenizer/imageTokenizer.js.map +1 -0
- package/dist/src/utils/request-tokenizer/imageTokenizer.test.d.ts +6 -0
- package/dist/src/utils/request-tokenizer/imageTokenizer.test.js +114 -0
- package/dist/src/utils/request-tokenizer/imageTokenizer.test.js.map +1 -0
- package/dist/src/utils/request-tokenizer/index.d.ts +18 -0
- package/dist/src/utils/request-tokenizer/index.js +30 -0
- package/dist/src/utils/request-tokenizer/index.js.map +1 -0
- package/dist/src/utils/request-tokenizer/requestTokenizer.d.ts +56 -0
- package/dist/src/utils/request-tokenizer/requestTokenizer.js +263 -0
- package/dist/src/utils/request-tokenizer/requestTokenizer.js.map +1 -0
- package/dist/src/utils/request-tokenizer/requestTokenizer.test.d.ts +6 -0
- package/dist/src/utils/request-tokenizer/requestTokenizer.test.js +245 -0
- package/dist/src/utils/request-tokenizer/requestTokenizer.test.js.map +1 -0
- package/dist/src/utils/request-tokenizer/supportedImageFormats.d.ts +30 -0
- package/dist/src/utils/request-tokenizer/supportedImageFormats.js +41 -0
- package/dist/src/utils/request-tokenizer/supportedImageFormats.js.map +1 -0
- package/dist/src/utils/request-tokenizer/textTokenizer.d.ts +29 -0
- package/dist/src/utils/request-tokenizer/textTokenizer.js +88 -0
- package/dist/src/utils/request-tokenizer/textTokenizer.js.map +1 -0
- package/dist/src/utils/request-tokenizer/textTokenizer.test.d.ts +6 -0
- package/dist/src/utils/request-tokenizer/textTokenizer.test.js +253 -0
- package/dist/src/utils/request-tokenizer/textTokenizer.test.js.map +1 -0
- package/dist/src/utils/request-tokenizer/types.d.ts +55 -0
- package/dist/src/utils/request-tokenizer/types.js +7 -0
- package/dist/src/utils/request-tokenizer/types.js.map +1 -0
- package/dist/src/utils/retry.d.ts +32 -0
- package/dist/src/utils/retry.js +303 -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 +474 -0
- package/dist/src/utils/retry.test.js.map +1 -0
- package/dist/src/utils/ripgrepUtils.d.ts +61 -0
- package/dist/src/utils/ripgrepUtils.js +230 -0
- package/dist/src/utils/ripgrepUtils.js.map +1 -0
- package/dist/src/utils/ripgrepUtils.test.d.ts +6 -0
- package/dist/src/utils/ripgrepUtils.test.js +101 -0
- package/dist/src/utils/ripgrepUtils.test.js.map +1 -0
- package/dist/src/utils/safeJsonParse.d.ts +15 -0
- package/dist/src/utils/safeJsonParse.js +41 -0
- package/dist/src/utils/safeJsonParse.js.map +1 -0
- package/dist/src/utils/safeJsonParse.test.d.ts +6 -0
- package/dist/src/utils/safeJsonParse.test.js +112 -0
- package/dist/src/utils/safeJsonParse.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 +15 -0
- package/dist/src/utils/schemaValidator.js +67 -0
- package/dist/src/utils/schemaValidator.js.map +1 -0
- package/dist/src/utils/schemaValidator.test.d.ts +6 -0
- package/dist/src/utils/schemaValidator.test.js +113 -0
- package/dist/src/utils/schemaValidator.test.js.map +1 -0
- package/dist/src/utils/secure-browser-launcher.d.ts +23 -0
- package/dist/src/utils/secure-browser-launcher.js +165 -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 +152 -0
- package/dist/src/utils/shell-utils.js +467 -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 +351 -0
- package/dist/src/utils/shell-utils.test.js.map +1 -0
- package/dist/src/utils/shellReadOnlyChecker.d.ts +6 -0
- package/dist/src/utils/shellReadOnlyChecker.js +247 -0
- package/dist/src/utils/shellReadOnlyChecker.js.map +1 -0
- package/dist/src/utils/shellReadOnlyChecker.test.d.ts +6 -0
- package/dist/src/utils/shellReadOnlyChecker.test.js +47 -0
- package/dist/src/utils/shellReadOnlyChecker.test.js.map +1 -0
- package/dist/src/utils/subagentGenerator.d.ts +20 -0
- package/dist/src/utils/subagentGenerator.js +120 -0
- package/dist/src/utils/subagentGenerator.js.map +1 -0
- package/dist/src/utils/subagentGenerator.test.d.ts +6 -0
- package/dist/src/utils/subagentGenerator.test.js +135 -0
- package/dist/src/utils/subagentGenerator.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/terminalSerializer.d.ts +25 -0
- package/dist/src/utils/terminalSerializer.js +432 -0
- package/dist/src/utils/terminalSerializer.js.map +1 -0
- package/dist/src/utils/terminalSerializer.test.d.ts +6 -0
- package/dist/src/utils/terminalSerializer.test.js +176 -0
- package/dist/src/utils/terminalSerializer.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 +18 -0
- package/dist/src/utils/textUtils.js +42 -0
- package/dist/src/utils/textUtils.js.map +1 -0
- package/dist/src/utils/textUtils.test.d.ts +6 -0
- package/dist/src/utils/textUtils.test.js +59 -0
- package/dist/src/utils/textUtils.test.js.map +1 -0
- package/dist/src/utils/thoughtUtils.d.ts +21 -0
- package/dist/src/utils/thoughtUtils.js +39 -0
- package/dist/src/utils/thoughtUtils.js.map +1 -0
- package/dist/src/utils/thoughtUtils.test.d.ts +6 -0
- package/dist/src/utils/thoughtUtils.test.js +78 -0
- package/dist/src/utils/thoughtUtils.test.js.map +1 -0
- package/dist/src/utils/tool-utils.d.ts +22 -0
- package/dist/src/utils/tool-utils.js +121 -0
- package/dist/src/utils/tool-utils.js.map +1 -0
- package/dist/src/utils/tool-utils.test.d.ts +6 -0
- package/dist/src/utils/tool-utils.test.js +100 -0
- package/dist/src/utils/tool-utils.test.js.map +1 -0
- package/dist/src/utils/userAccountManager.d.ts +20 -0
- package/dist/src/utils/userAccountManager.js +114 -0
- package/dist/src/utils/userAccountManager.js.map +1 -0
- package/dist/src/utils/userAccountManager.test.d.ts +6 -0
- package/dist/src/utils/userAccountManager.test.js +223 -0
- package/dist/src/utils/userAccountManager.test.js.map +1 -0
- package/dist/src/utils/workspaceContext.d.ts +66 -0
- package/dist/src/utils/workspaceContext.js +171 -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 +318 -0
- package/dist/src/utils/workspaceContext.test.js.map +1 -0
- package/dist/src/utils/yaml-parser.d.ts +29 -0
- package/dist/src/utils/yaml-parser.js +172 -0
- package/dist/src/utils/yaml-parser.js.map +1 -0
- package/dist/src/utils/yaml-parser.test.d.ts +6 -0
- package/dist/src/utils/yaml-parser.test.js +170 -0
- package/dist/src/utils/yaml-parser.test.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +106 -0
- package/scripts/postinstall.js +100 -0
- package/vendor/ripgrep/COPYING +3 -0
- package/vendor/ripgrep/arm64-darwin/rg +0 -0
- package/vendor/ripgrep/arm64-linux/rg +0 -0
- package/vendor/ripgrep/x64-darwin/rg +0 -0
- package/vendor/ripgrep/x64-linux/rg +0 -0
- package/vendor/ripgrep/x64-win32/rg.exe +0 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
export declare class UserAccountManager {
|
|
7
|
+
private getGoogleAccountsCachePath;
|
|
8
|
+
/**
|
|
9
|
+
* Parses and validates the string content of an accounts file.
|
|
10
|
+
* @param content The raw string content from the file.
|
|
11
|
+
* @returns A valid UserAccounts object.
|
|
12
|
+
*/
|
|
13
|
+
private parseAndValidateAccounts;
|
|
14
|
+
private readAccountsSync;
|
|
15
|
+
private readAccounts;
|
|
16
|
+
cacheGoogleAccount(email: string): Promise<void>;
|
|
17
|
+
getCachedGoogleAccount(): string | null;
|
|
18
|
+
getLifetimeGoogleAccounts(): number;
|
|
19
|
+
clearCachedGoogleAccount(): Promise<void>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import path from 'node:path';
|
|
7
|
+
import { promises as fsp, readFileSync } from 'node:fs';
|
|
8
|
+
import { Storage } from '../config/storage.js';
|
|
9
|
+
export class UserAccountManager {
|
|
10
|
+
getGoogleAccountsCachePath() {
|
|
11
|
+
return Storage.getGoogleAccountsPath();
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Parses and validates the string content of an accounts file.
|
|
15
|
+
* @param content The raw string content from the file.
|
|
16
|
+
* @returns A valid UserAccounts object.
|
|
17
|
+
*/
|
|
18
|
+
parseAndValidateAccounts(content) {
|
|
19
|
+
const defaultState = { active: null, old: [] };
|
|
20
|
+
if (!content.trim()) {
|
|
21
|
+
return defaultState;
|
|
22
|
+
}
|
|
23
|
+
const parsed = JSON.parse(content);
|
|
24
|
+
// Inlined validation logic
|
|
25
|
+
if (typeof parsed !== 'object' || parsed === null) {
|
|
26
|
+
console.log('Invalid accounts file schema, starting fresh.');
|
|
27
|
+
return defaultState;
|
|
28
|
+
}
|
|
29
|
+
const { active, old } = parsed;
|
|
30
|
+
const isValid = (active === undefined || active === null || typeof active === 'string') &&
|
|
31
|
+
(old === undefined ||
|
|
32
|
+
(Array.isArray(old) && old.every((i) => typeof i === 'string')));
|
|
33
|
+
if (!isValid) {
|
|
34
|
+
console.log('Invalid accounts file schema, starting fresh.');
|
|
35
|
+
return defaultState;
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
active: parsed.active ?? null,
|
|
39
|
+
old: parsed.old ?? [],
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
readAccountsSync(filePath) {
|
|
43
|
+
const defaultState = { active: null, old: [] };
|
|
44
|
+
try {
|
|
45
|
+
const content = readFileSync(filePath, 'utf-8');
|
|
46
|
+
return this.parseAndValidateAccounts(content);
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
if (error instanceof Error &&
|
|
50
|
+
'code' in error &&
|
|
51
|
+
error.code === 'ENOENT') {
|
|
52
|
+
return defaultState;
|
|
53
|
+
}
|
|
54
|
+
console.log('Error during sync read of accounts, starting fresh.', error);
|
|
55
|
+
return defaultState;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
async readAccounts(filePath) {
|
|
59
|
+
const defaultState = { active: null, old: [] };
|
|
60
|
+
try {
|
|
61
|
+
const content = await fsp.readFile(filePath, 'utf-8');
|
|
62
|
+
return this.parseAndValidateAccounts(content);
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
if (error instanceof Error &&
|
|
66
|
+
'code' in error &&
|
|
67
|
+
error.code === 'ENOENT') {
|
|
68
|
+
return defaultState;
|
|
69
|
+
}
|
|
70
|
+
console.log('Could not parse accounts file, starting fresh.', error);
|
|
71
|
+
return defaultState;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
async cacheGoogleAccount(email) {
|
|
75
|
+
const filePath = this.getGoogleAccountsCachePath();
|
|
76
|
+
await fsp.mkdir(path.dirname(filePath), { recursive: true });
|
|
77
|
+
const accounts = await this.readAccounts(filePath);
|
|
78
|
+
if (accounts.active && accounts.active !== email) {
|
|
79
|
+
if (!accounts.old.includes(accounts.active)) {
|
|
80
|
+
accounts.old.push(accounts.active);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
// If the new email was in the old list, remove it
|
|
84
|
+
accounts.old = accounts.old.filter((oldEmail) => oldEmail !== email);
|
|
85
|
+
accounts.active = email;
|
|
86
|
+
await fsp.writeFile(filePath, JSON.stringify(accounts, null, 2), 'utf-8');
|
|
87
|
+
}
|
|
88
|
+
getCachedGoogleAccount() {
|
|
89
|
+
const filePath = this.getGoogleAccountsCachePath();
|
|
90
|
+
const accounts = this.readAccountsSync(filePath);
|
|
91
|
+
return accounts.active;
|
|
92
|
+
}
|
|
93
|
+
getLifetimeGoogleAccounts() {
|
|
94
|
+
const filePath = this.getGoogleAccountsCachePath();
|
|
95
|
+
const accounts = this.readAccountsSync(filePath);
|
|
96
|
+
const allAccounts = new Set(accounts.old);
|
|
97
|
+
if (accounts.active) {
|
|
98
|
+
allAccounts.add(accounts.active);
|
|
99
|
+
}
|
|
100
|
+
return allAccounts.size;
|
|
101
|
+
}
|
|
102
|
+
async clearCachedGoogleAccount() {
|
|
103
|
+
const filePath = this.getGoogleAccountsCachePath();
|
|
104
|
+
const accounts = await this.readAccounts(filePath);
|
|
105
|
+
if (accounts.active) {
|
|
106
|
+
if (!accounts.old.includes(accounts.active)) {
|
|
107
|
+
accounts.old.push(accounts.active);
|
|
108
|
+
}
|
|
109
|
+
accounts.active = null;
|
|
110
|
+
}
|
|
111
|
+
await fsp.writeFile(filePath, JSON.stringify(accounts, null, 2), 'utf-8');
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=userAccountManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userAccountManager.js","sourceRoot":"","sources":["../../../src/utils/userAccountManager.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,QAAQ,IAAI,GAAG,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAO/C,MAA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CAAC;QACD,OAAO,WAAW,CAAC,IAAI,CAAC;IAC1B,CAAC;IAED,KAAK,CAAC,wBAAwB;QAC5B,MAAM,QAAQ,GAAG,IAAI,CAAC,0BAA0B,EAAE,CAAC;QACnD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;QAEnD,IAAI,QAAQ,CAAC,MAAM,EAAE,CAAC;YACpB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;gBAC5C,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YACrC,CAAC;YACD,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC;QACzB,CAAC;QAED,MAAM,GAAG,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IAC5E,CAAC;CACF"}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { vi, describe, it, expect, beforeEach, afterEach } from 'vitest';
|
|
7
|
+
import { UserAccountManager } from './userAccountManager.js';
|
|
8
|
+
import * as fs from 'node:fs';
|
|
9
|
+
import * as os from 'node:os';
|
|
10
|
+
import path from 'node:path';
|
|
11
|
+
vi.mock('os', async (importOriginal) => {
|
|
12
|
+
const os = await importOriginal();
|
|
13
|
+
return {
|
|
14
|
+
...os,
|
|
15
|
+
homedir: vi.fn(),
|
|
16
|
+
};
|
|
17
|
+
});
|
|
18
|
+
describe('UserAccountManager', () => {
|
|
19
|
+
let tempHomeDir;
|
|
20
|
+
let userAccountManager;
|
|
21
|
+
let accountsFile;
|
|
22
|
+
beforeEach(() => {
|
|
23
|
+
tempHomeDir = fs.mkdtempSync(path.join(os.tmpdir(), 'qwen-code-test-home-'));
|
|
24
|
+
os.homedir.mockReturnValue(tempHomeDir);
|
|
25
|
+
accountsFile = () => path.join(tempHomeDir, '.qwen', 'google_accounts.json');
|
|
26
|
+
userAccountManager = new UserAccountManager();
|
|
27
|
+
});
|
|
28
|
+
afterEach(() => {
|
|
29
|
+
fs.rmSync(tempHomeDir, { recursive: true, force: true });
|
|
30
|
+
vi.clearAllMocks();
|
|
31
|
+
});
|
|
32
|
+
describe('cacheGoogleAccount', () => {
|
|
33
|
+
it('should create directory and write initial account file', async () => {
|
|
34
|
+
await userAccountManager.cacheGoogleAccount('test1@google.com');
|
|
35
|
+
// Verify Google Account ID was cached
|
|
36
|
+
expect(fs.existsSync(accountsFile())).toBe(true);
|
|
37
|
+
expect(fs.readFileSync(accountsFile(), 'utf-8')).toBe(JSON.stringify({ active: 'test1@google.com', old: [] }, null, 2));
|
|
38
|
+
});
|
|
39
|
+
it('should update active account and move previous to old', async () => {
|
|
40
|
+
fs.mkdirSync(path.dirname(accountsFile()), { recursive: true });
|
|
41
|
+
fs.writeFileSync(accountsFile(), JSON.stringify({ active: 'test2@google.com', old: ['test1@google.com'] }, null, 2));
|
|
42
|
+
await userAccountManager.cacheGoogleAccount('test3@google.com');
|
|
43
|
+
expect(fs.readFileSync(accountsFile(), 'utf-8')).toBe(JSON.stringify({
|
|
44
|
+
active: 'test3@google.com',
|
|
45
|
+
old: ['test1@google.com', 'test2@google.com'],
|
|
46
|
+
}, null, 2));
|
|
47
|
+
});
|
|
48
|
+
it('should not add a duplicate to the old list', async () => {
|
|
49
|
+
fs.mkdirSync(path.dirname(accountsFile()), { recursive: true });
|
|
50
|
+
fs.writeFileSync(accountsFile(), JSON.stringify({ active: 'test1@google.com', old: ['test2@google.com'] }, null, 2));
|
|
51
|
+
await userAccountManager.cacheGoogleAccount('test2@google.com');
|
|
52
|
+
await userAccountManager.cacheGoogleAccount('test1@google.com');
|
|
53
|
+
expect(fs.readFileSync(accountsFile(), 'utf-8')).toBe(JSON.stringify({ active: 'test1@google.com', old: ['test2@google.com'] }, null, 2));
|
|
54
|
+
});
|
|
55
|
+
it('should handle corrupted JSON by starting fresh', async () => {
|
|
56
|
+
fs.mkdirSync(path.dirname(accountsFile()), { recursive: true });
|
|
57
|
+
fs.writeFileSync(accountsFile(), 'not valid json');
|
|
58
|
+
const consoleLogSpy = vi
|
|
59
|
+
.spyOn(console, 'log')
|
|
60
|
+
.mockImplementation(() => { });
|
|
61
|
+
await userAccountManager.cacheGoogleAccount('test1@google.com');
|
|
62
|
+
expect(consoleLogSpy).toHaveBeenCalled();
|
|
63
|
+
expect(JSON.parse(fs.readFileSync(accountsFile(), 'utf-8'))).toEqual({
|
|
64
|
+
active: 'test1@google.com',
|
|
65
|
+
old: [],
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
it('should handle valid JSON with incorrect schema by starting fresh', async () => {
|
|
69
|
+
fs.mkdirSync(path.dirname(accountsFile()), { recursive: true });
|
|
70
|
+
fs.writeFileSync(accountsFile(), JSON.stringify({ active: 'test1@google.com', old: 'not-an-array' }));
|
|
71
|
+
const consoleLogSpy = vi
|
|
72
|
+
.spyOn(console, 'log')
|
|
73
|
+
.mockImplementation(() => { });
|
|
74
|
+
await userAccountManager.cacheGoogleAccount('test2@google.com');
|
|
75
|
+
expect(consoleLogSpy).toHaveBeenCalled();
|
|
76
|
+
expect(JSON.parse(fs.readFileSync(accountsFile(), 'utf-8'))).toEqual({
|
|
77
|
+
active: 'test2@google.com',
|
|
78
|
+
old: [],
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
describe('getCachedGoogleAccount', () => {
|
|
83
|
+
it('should return the active account if file exists and is valid', () => {
|
|
84
|
+
fs.mkdirSync(path.dirname(accountsFile()), { recursive: true });
|
|
85
|
+
fs.writeFileSync(accountsFile(), JSON.stringify({ active: 'active@google.com', old: [] }, null, 2));
|
|
86
|
+
const account = userAccountManager.getCachedGoogleAccount();
|
|
87
|
+
expect(account).toBe('active@google.com');
|
|
88
|
+
});
|
|
89
|
+
it('should return null if file does not exist', () => {
|
|
90
|
+
const account = userAccountManager.getCachedGoogleAccount();
|
|
91
|
+
expect(account).toBeNull();
|
|
92
|
+
});
|
|
93
|
+
it('should return null if file is empty', () => {
|
|
94
|
+
fs.mkdirSync(path.dirname(accountsFile()), { recursive: true });
|
|
95
|
+
fs.writeFileSync(accountsFile(), '');
|
|
96
|
+
const account = userAccountManager.getCachedGoogleAccount();
|
|
97
|
+
expect(account).toBeNull();
|
|
98
|
+
});
|
|
99
|
+
it('should return null and log if file is corrupted', () => {
|
|
100
|
+
fs.mkdirSync(path.dirname(accountsFile()), { recursive: true });
|
|
101
|
+
fs.writeFileSync(accountsFile(), '{ "active": "test@google.com"'); // Invalid JSON
|
|
102
|
+
const consoleLogSpy = vi
|
|
103
|
+
.spyOn(console, 'log')
|
|
104
|
+
.mockImplementation(() => { });
|
|
105
|
+
const account = userAccountManager.getCachedGoogleAccount();
|
|
106
|
+
expect(account).toBeNull();
|
|
107
|
+
expect(consoleLogSpy).toHaveBeenCalled();
|
|
108
|
+
});
|
|
109
|
+
it('should return null if active key is missing', () => {
|
|
110
|
+
fs.mkdirSync(path.dirname(accountsFile()), { recursive: true });
|
|
111
|
+
fs.writeFileSync(accountsFile(), JSON.stringify({ old: [] }));
|
|
112
|
+
const account = userAccountManager.getCachedGoogleAccount();
|
|
113
|
+
expect(account).toBeNull();
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
describe('clearCachedGoogleAccount', () => {
|
|
117
|
+
it('should set active to null and move it to old', async () => {
|
|
118
|
+
fs.mkdirSync(path.dirname(accountsFile()), { recursive: true });
|
|
119
|
+
fs.writeFileSync(accountsFile(), JSON.stringify({ active: 'active@google.com', old: ['old1@google.com'] }, null, 2));
|
|
120
|
+
await userAccountManager.clearCachedGoogleAccount();
|
|
121
|
+
const stored = JSON.parse(fs.readFileSync(accountsFile(), 'utf-8'));
|
|
122
|
+
expect(stored.active).toBeNull();
|
|
123
|
+
expect(stored.old).toEqual(['old1@google.com', 'active@google.com']);
|
|
124
|
+
});
|
|
125
|
+
it('should handle empty file gracefully', async () => {
|
|
126
|
+
fs.mkdirSync(path.dirname(accountsFile()), { recursive: true });
|
|
127
|
+
fs.writeFileSync(accountsFile(), '');
|
|
128
|
+
await userAccountManager.clearCachedGoogleAccount();
|
|
129
|
+
const stored = JSON.parse(fs.readFileSync(accountsFile(), 'utf-8'));
|
|
130
|
+
expect(stored.active).toBeNull();
|
|
131
|
+
expect(stored.old).toEqual([]);
|
|
132
|
+
});
|
|
133
|
+
it('should handle corrupted JSON by creating a fresh file', async () => {
|
|
134
|
+
fs.mkdirSync(path.dirname(accountsFile()), { recursive: true });
|
|
135
|
+
fs.writeFileSync(accountsFile(), 'not valid json');
|
|
136
|
+
const consoleLogSpy = vi
|
|
137
|
+
.spyOn(console, 'log')
|
|
138
|
+
.mockImplementation(() => { });
|
|
139
|
+
await userAccountManager.clearCachedGoogleAccount();
|
|
140
|
+
expect(consoleLogSpy).toHaveBeenCalled();
|
|
141
|
+
const stored = JSON.parse(fs.readFileSync(accountsFile(), 'utf-8'));
|
|
142
|
+
expect(stored.active).toBeNull();
|
|
143
|
+
expect(stored.old).toEqual([]);
|
|
144
|
+
});
|
|
145
|
+
it('should be idempotent if active account is already null', async () => {
|
|
146
|
+
fs.mkdirSync(path.dirname(accountsFile()), { recursive: true });
|
|
147
|
+
fs.writeFileSync(accountsFile(), JSON.stringify({ active: null, old: ['old1@google.com'] }, null, 2));
|
|
148
|
+
await userAccountManager.clearCachedGoogleAccount();
|
|
149
|
+
const stored = JSON.parse(fs.readFileSync(accountsFile(), 'utf-8'));
|
|
150
|
+
expect(stored.active).toBeNull();
|
|
151
|
+
expect(stored.old).toEqual(['old1@google.com']);
|
|
152
|
+
});
|
|
153
|
+
it('should not add a duplicate to the old list', async () => {
|
|
154
|
+
fs.mkdirSync(path.dirname(accountsFile()), { recursive: true });
|
|
155
|
+
fs.writeFileSync(accountsFile(), JSON.stringify({
|
|
156
|
+
active: 'active@google.com',
|
|
157
|
+
old: ['active@google.com'],
|
|
158
|
+
}, null, 2));
|
|
159
|
+
await userAccountManager.clearCachedGoogleAccount();
|
|
160
|
+
const stored = JSON.parse(fs.readFileSync(accountsFile(), 'utf-8'));
|
|
161
|
+
expect(stored.active).toBeNull();
|
|
162
|
+
expect(stored.old).toEqual(['active@google.com']);
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
describe('getLifetimeGoogleAccounts', () => {
|
|
166
|
+
it('should return 0 if the file does not exist', () => {
|
|
167
|
+
expect(userAccountManager.getLifetimeGoogleAccounts()).toBe(0);
|
|
168
|
+
});
|
|
169
|
+
it('should return 0 if the file is empty', () => {
|
|
170
|
+
fs.mkdirSync(path.dirname(accountsFile()), { recursive: true });
|
|
171
|
+
fs.writeFileSync(accountsFile(), '');
|
|
172
|
+
expect(userAccountManager.getLifetimeGoogleAccounts()).toBe(0);
|
|
173
|
+
});
|
|
174
|
+
it('should return 0 if the file is corrupted', () => {
|
|
175
|
+
fs.mkdirSync(path.dirname(accountsFile()), { recursive: true });
|
|
176
|
+
fs.writeFileSync(accountsFile(), 'invalid json');
|
|
177
|
+
const consoleDebugSpy = vi
|
|
178
|
+
.spyOn(console, 'log')
|
|
179
|
+
.mockImplementation(() => { });
|
|
180
|
+
expect(userAccountManager.getLifetimeGoogleAccounts()).toBe(0);
|
|
181
|
+
expect(consoleDebugSpy).toHaveBeenCalled();
|
|
182
|
+
});
|
|
183
|
+
it('should return 1 if there is only an active account', () => {
|
|
184
|
+
fs.mkdirSync(path.dirname(accountsFile()), { recursive: true });
|
|
185
|
+
fs.writeFileSync(accountsFile(), JSON.stringify({ active: 'test1@google.com', old: [] }));
|
|
186
|
+
expect(userAccountManager.getLifetimeGoogleAccounts()).toBe(1);
|
|
187
|
+
});
|
|
188
|
+
it('should correctly count old accounts when active is null', () => {
|
|
189
|
+
fs.mkdirSync(path.dirname(accountsFile()), { recursive: true });
|
|
190
|
+
fs.writeFileSync(accountsFile(), JSON.stringify({
|
|
191
|
+
active: null,
|
|
192
|
+
old: ['test1@google.com', 'test2@google.com'],
|
|
193
|
+
}));
|
|
194
|
+
expect(userAccountManager.getLifetimeGoogleAccounts()).toBe(2);
|
|
195
|
+
});
|
|
196
|
+
it('should correctly count both active and old accounts', () => {
|
|
197
|
+
fs.mkdirSync(path.dirname(accountsFile()), { recursive: true });
|
|
198
|
+
fs.writeFileSync(accountsFile(), JSON.stringify({
|
|
199
|
+
active: 'test3@google.com',
|
|
200
|
+
old: ['test1@google.com', 'test2@google.com'],
|
|
201
|
+
}));
|
|
202
|
+
expect(userAccountManager.getLifetimeGoogleAccounts()).toBe(3);
|
|
203
|
+
});
|
|
204
|
+
it('should handle valid JSON with incorrect schema by returning 0', () => {
|
|
205
|
+
fs.mkdirSync(path.dirname(accountsFile()), { recursive: true });
|
|
206
|
+
fs.writeFileSync(accountsFile(), JSON.stringify({ active: null, old: 1 }));
|
|
207
|
+
const consoleLogSpy = vi
|
|
208
|
+
.spyOn(console, 'log')
|
|
209
|
+
.mockImplementation(() => { });
|
|
210
|
+
expect(userAccountManager.getLifetimeGoogleAccounts()).toBe(0);
|
|
211
|
+
expect(consoleLogSpy).toHaveBeenCalled();
|
|
212
|
+
});
|
|
213
|
+
it('should not double count if active account is also in old list', () => {
|
|
214
|
+
fs.mkdirSync(path.dirname(accountsFile()), { recursive: true });
|
|
215
|
+
fs.writeFileSync(accountsFile(), JSON.stringify({
|
|
216
|
+
active: 'test1@google.com',
|
|
217
|
+
old: ['test1@google.com', 'test2@google.com'],
|
|
218
|
+
}));
|
|
219
|
+
expect(userAccountManager.getLifetimeGoogleAccounts()).toBe(2);
|
|
220
|
+
});
|
|
221
|
+
});
|
|
222
|
+
});
|
|
223
|
+
//# sourceMappingURL=userAccountManager.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user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IAAI,EAAE,CAAC,CAAC;YAChE,EAAE,CAAC,aAAa,CACd,YAAY,EAAE,EACd,IAAI,CAAC,SAAS,CAAC;gBACb,MAAM,EAAE,kBAAkB;gBAC1B,GAAG,EAAE,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;aAC9C,CAAC,CACH,CAAC;YACF,MAAM,CAAC,kBAAkB,CAAC,yBAAyB,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACjE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
export type Unsubscribe = () => void;
|
|
7
|
+
/**
|
|
8
|
+
* WorkspaceContext manages multiple workspace directories and validates paths
|
|
9
|
+
* against them. This allows the CLI to operate on files from multiple directories
|
|
10
|
+
* in a single session.
|
|
11
|
+
*/
|
|
12
|
+
export declare class WorkspaceContext {
|
|
13
|
+
private directories;
|
|
14
|
+
private initialDirectories;
|
|
15
|
+
private onDirectoriesChangedListeners;
|
|
16
|
+
/**
|
|
17
|
+
* Creates a new WorkspaceContext with the given initial directory and optional additional directories.
|
|
18
|
+
* @param directory The initial working directory (usually cwd)
|
|
19
|
+
* @param additionalDirectories Optional array of additional directories to include
|
|
20
|
+
*/
|
|
21
|
+
constructor(directory: string, additionalDirectories?: string[]);
|
|
22
|
+
/**
|
|
23
|
+
* Registers a listener that is called when the workspace directories change.
|
|
24
|
+
* @param listener The listener to call.
|
|
25
|
+
* @returns A function to unsubscribe the listener.
|
|
26
|
+
*/
|
|
27
|
+
onDirectoriesChanged(listener: () => void): Unsubscribe;
|
|
28
|
+
private notifyDirectoriesChanged;
|
|
29
|
+
/**
|
|
30
|
+
* Adds a directory to the workspace.
|
|
31
|
+
* @param directory The directory path to add (can be relative or absolute)
|
|
32
|
+
* @param basePath Optional base path for resolving relative paths (defaults to cwd)
|
|
33
|
+
*/
|
|
34
|
+
addDirectory(directory: string, basePath?: string): void;
|
|
35
|
+
private resolveAndValidateDir;
|
|
36
|
+
/**
|
|
37
|
+
* Gets a copy of all workspace directories.
|
|
38
|
+
* @returns Array of absolute directory paths
|
|
39
|
+
*/
|
|
40
|
+
getDirectories(): readonly string[];
|
|
41
|
+
getInitialDirectories(): readonly string[];
|
|
42
|
+
setDirectories(directories: readonly string[]): void;
|
|
43
|
+
/**
|
|
44
|
+
* Checks if a given path is within any of the workspace directories.
|
|
45
|
+
* @param pathToCheck The path to validate
|
|
46
|
+
* @returns True if the path is within the workspace, false otherwise
|
|
47
|
+
*/
|
|
48
|
+
isPathWithinWorkspace(pathToCheck: string): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Fully resolves a path, including symbolic links.
|
|
51
|
+
* If the path does not exist, it returns the fully resolved path as it would be
|
|
52
|
+
* if it did exist.
|
|
53
|
+
*/
|
|
54
|
+
private fullyResolvedPath;
|
|
55
|
+
/**
|
|
56
|
+
* Checks if a path is within a given root directory.
|
|
57
|
+
* @param pathToCheck The absolute path to check
|
|
58
|
+
* @param rootDirectory The absolute root directory
|
|
59
|
+
* @returns True if the path is within the root directory, false otherwise
|
|
60
|
+
*/
|
|
61
|
+
private isPathWithinRoot;
|
|
62
|
+
/**
|
|
63
|
+
* Checks if a file path is a symbolic link that points to a file.
|
|
64
|
+
*/
|
|
65
|
+
private isFileSymlink;
|
|
66
|
+
}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { isNodeError } from '../utils/errors.js';
|
|
7
|
+
import * as fs from 'node:fs';
|
|
8
|
+
import * as path from 'node:path';
|
|
9
|
+
import * as process from 'node:process';
|
|
10
|
+
/**
|
|
11
|
+
* WorkspaceContext manages multiple workspace directories and validates paths
|
|
12
|
+
* against them. This allows the CLI to operate on files from multiple directories
|
|
13
|
+
* in a single session.
|
|
14
|
+
*/
|
|
15
|
+
export class WorkspaceContext {
|
|
16
|
+
directories = new Set();
|
|
17
|
+
initialDirectories;
|
|
18
|
+
onDirectoriesChangedListeners = new Set();
|
|
19
|
+
/**
|
|
20
|
+
* Creates a new WorkspaceContext with the given initial directory and optional additional directories.
|
|
21
|
+
* @param directory The initial working directory (usually cwd)
|
|
22
|
+
* @param additionalDirectories Optional array of additional directories to include
|
|
23
|
+
*/
|
|
24
|
+
constructor(directory, additionalDirectories = []) {
|
|
25
|
+
this.addDirectory(directory);
|
|
26
|
+
for (const additionalDirectory of additionalDirectories) {
|
|
27
|
+
this.addDirectory(additionalDirectory);
|
|
28
|
+
}
|
|
29
|
+
this.initialDirectories = new Set(this.directories);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Registers a listener that is called when the workspace directories change.
|
|
33
|
+
* @param listener The listener to call.
|
|
34
|
+
* @returns A function to unsubscribe the listener.
|
|
35
|
+
*/
|
|
36
|
+
onDirectoriesChanged(listener) {
|
|
37
|
+
this.onDirectoriesChangedListeners.add(listener);
|
|
38
|
+
return () => {
|
|
39
|
+
this.onDirectoriesChangedListeners.delete(listener);
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
notifyDirectoriesChanged() {
|
|
43
|
+
// Iterate over a copy of the set in case a listener unsubscribes itself or others.
|
|
44
|
+
for (const listener of [...this.onDirectoriesChangedListeners]) {
|
|
45
|
+
try {
|
|
46
|
+
listener();
|
|
47
|
+
}
|
|
48
|
+
catch (e) {
|
|
49
|
+
// Don't let one listener break others.
|
|
50
|
+
console.error('Error in WorkspaceContext listener:', e);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Adds a directory to the workspace.
|
|
56
|
+
* @param directory The directory path to add (can be relative or absolute)
|
|
57
|
+
* @param basePath Optional base path for resolving relative paths (defaults to cwd)
|
|
58
|
+
*/
|
|
59
|
+
addDirectory(directory, basePath = process.cwd()) {
|
|
60
|
+
try {
|
|
61
|
+
const resolved = this.resolveAndValidateDir(directory, basePath);
|
|
62
|
+
if (this.directories.has(resolved)) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
this.directories.add(resolved);
|
|
66
|
+
this.notifyDirectoriesChanged();
|
|
67
|
+
}
|
|
68
|
+
catch (err) {
|
|
69
|
+
console.warn(`[WARN] Skipping unreadable directory: ${directory} (${err instanceof Error ? err.message : String(err)})`);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
resolveAndValidateDir(directory, basePath = process.cwd()) {
|
|
73
|
+
const absolutePath = path.isAbsolute(directory)
|
|
74
|
+
? directory
|
|
75
|
+
: path.resolve(basePath, directory);
|
|
76
|
+
if (!fs.existsSync(absolutePath)) {
|
|
77
|
+
throw new Error(`Directory does not exist: ${absolutePath}`);
|
|
78
|
+
}
|
|
79
|
+
const stats = fs.statSync(absolutePath);
|
|
80
|
+
if (!stats.isDirectory()) {
|
|
81
|
+
throw new Error(`Path is not a directory: ${absolutePath}`);
|
|
82
|
+
}
|
|
83
|
+
return fs.realpathSync(absolutePath);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Gets a copy of all workspace directories.
|
|
87
|
+
* @returns Array of absolute directory paths
|
|
88
|
+
*/
|
|
89
|
+
getDirectories() {
|
|
90
|
+
return Array.from(this.directories);
|
|
91
|
+
}
|
|
92
|
+
getInitialDirectories() {
|
|
93
|
+
return Array.from(this.initialDirectories);
|
|
94
|
+
}
|
|
95
|
+
setDirectories(directories) {
|
|
96
|
+
const newDirectories = new Set();
|
|
97
|
+
for (const dir of directories) {
|
|
98
|
+
newDirectories.add(this.resolveAndValidateDir(dir));
|
|
99
|
+
}
|
|
100
|
+
if (newDirectories.size !== this.directories.size ||
|
|
101
|
+
![...newDirectories].every((d) => this.directories.has(d))) {
|
|
102
|
+
this.directories = newDirectories;
|
|
103
|
+
this.notifyDirectoriesChanged();
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Checks if a given path is within any of the workspace directories.
|
|
108
|
+
* @param pathToCheck The path to validate
|
|
109
|
+
* @returns True if the path is within the workspace, false otherwise
|
|
110
|
+
*/
|
|
111
|
+
isPathWithinWorkspace(pathToCheck) {
|
|
112
|
+
try {
|
|
113
|
+
const fullyResolvedPath = this.fullyResolvedPath(pathToCheck);
|
|
114
|
+
for (const dir of this.directories) {
|
|
115
|
+
if (this.isPathWithinRoot(fullyResolvedPath, dir)) {
|
|
116
|
+
return true;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return false;
|
|
120
|
+
}
|
|
121
|
+
catch (_error) {
|
|
122
|
+
return false;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Fully resolves a path, including symbolic links.
|
|
127
|
+
* If the path does not exist, it returns the fully resolved path as it would be
|
|
128
|
+
* if it did exist.
|
|
129
|
+
*/
|
|
130
|
+
fullyResolvedPath(pathToCheck) {
|
|
131
|
+
try {
|
|
132
|
+
return fs.realpathSync(pathToCheck);
|
|
133
|
+
}
|
|
134
|
+
catch (e) {
|
|
135
|
+
if (isNodeError(e) &&
|
|
136
|
+
e.code === 'ENOENT' &&
|
|
137
|
+
e.path &&
|
|
138
|
+
// realpathSync does not set e.path correctly for symlinks to
|
|
139
|
+
// non-existent files.
|
|
140
|
+
!this.isFileSymlink(e.path)) {
|
|
141
|
+
// If it doesn't exist, e.path contains the fully resolved path.
|
|
142
|
+
return e.path;
|
|
143
|
+
}
|
|
144
|
+
throw e;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Checks if a path is within a given root directory.
|
|
149
|
+
* @param pathToCheck The absolute path to check
|
|
150
|
+
* @param rootDirectory The absolute root directory
|
|
151
|
+
* @returns True if the path is within the root directory, false otherwise
|
|
152
|
+
*/
|
|
153
|
+
isPathWithinRoot(pathToCheck, rootDirectory) {
|
|
154
|
+
const relative = path.relative(rootDirectory, pathToCheck);
|
|
155
|
+
return (!relative.startsWith(`..${path.sep}`) &&
|
|
156
|
+
relative !== '..' &&
|
|
157
|
+
!path.isAbsolute(relative));
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Checks if a file path is a symbolic link that points to a file.
|
|
161
|
+
*/
|
|
162
|
+
isFileSymlink(filePath) {
|
|
163
|
+
try {
|
|
164
|
+
return !fs.readlinkSync(filePath).endsWith('/');
|
|
165
|
+
}
|
|
166
|
+
catch (_error) {
|
|
167
|
+
return false;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
//# sourceMappingURL=workspaceContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspaceContext.js","sourceRoot":"","sources":["../../../src/utils/workspaceContext.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AAIxC;;;;GAIG;AACH,MAAM,OAAO,gBAAgB;IACnB,WAAW,GAAG,IAAI,GAAG,EAAU,CAAC;IAChC,kBAAkB,CAAc;IAChC,6BAA6B,GAAG,IAAI,GAAG,EAAc,CAAC;IAE9D;;;;OAIG;IACH,YAAY,SAAiB,EAAE,wBAAkC,EAAE;QACjE,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;QAC7B,KAAK,MAAM,mBAAmB,IAAI,qBAAqB,EAAE,CAAC;YACxD,IAAI,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QACzC,CAAC;QACD,IAAI,CAAC,kBAAkB,GAAG,IAAI,GAAG,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