repoburg 1.0.68 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -1
- package/backend/.env +2 -2
- package/backend/dist/packages/gemini-core/examples/simple.d.ts +1 -0
- package/backend/dist/packages/gemini-core/examples/simple.js +73 -0
- package/backend/dist/packages/gemini-core/examples/simple.js.map +1 -0
- package/backend/dist/packages/gemini-core/index.d.ts +3 -0
- package/backend/dist/packages/gemini-core/index.js +27 -0
- package/backend/dist/packages/gemini-core/index.js.map +1 -0
- package/backend/dist/packages/gemini-core/src/code_assist/codeAssist.d.ts +5 -0
- package/backend/dist/packages/gemini-core/src/code_assist/codeAssist.js +17 -0
- package/backend/dist/packages/gemini-core/src/code_assist/codeAssist.js.map +1 -0
- package/backend/dist/packages/gemini-core/src/code_assist/converter.d.ts +69 -0
- package/backend/dist/packages/gemini-core/src/code_assist/converter.js +129 -0
- package/backend/dist/packages/gemini-core/src/code_assist/converter.js.map +1 -0
- package/backend/dist/packages/gemini-core/src/code_assist/oauth-credential-storage.d.ts +8 -0
- package/backend/dist/packages/gemini-core/src/code_assist/oauth-credential-storage.js +84 -0
- package/backend/dist/packages/gemini-core/src/code_assist/oauth-credential-storage.js.map +1 -0
- package/backend/dist/packages/gemini-core/src/code_assist/oauth2.d.ts +12 -0
- package/backend/dist/packages/gemini-core/src/code_assist/oauth2.js +371 -0
- package/backend/dist/packages/gemini-core/src/code_assist/oauth2.js.map +1 -0
- package/backend/dist/packages/gemini-core/src/code_assist/server.d.ts +28 -0
- package/backend/dist/packages/gemini-core/src/code_assist/server.js +135 -0
- package/backend/dist/packages/gemini-core/src/code_assist/server.js.map +1 -0
- package/backend/dist/packages/gemini-core/src/code_assist/setup.d.ts +10 -0
- package/backend/dist/packages/gemini-core/src/code_assist/setup.js +94 -0
- package/backend/dist/packages/gemini-core/src/code_assist/setup.js.map +1 -0
- package/backend/dist/packages/gemini-core/src/code_assist/types.d.ts +106 -0
- package/backend/dist/packages/gemini-core/src/code_assist/types.js +28 -0
- package/backend/dist/packages/gemini-core/src/code_assist/types.js.map +1 -0
- package/backend/dist/packages/gemini-core/src/config/config.d.ts +22 -0
- package/backend/dist/packages/gemini-core/src/config/config.js +38 -0
- package/backend/dist/packages/gemini-core/src/config/config.js.map +1 -0
- package/backend/dist/packages/gemini-core/src/config/models.d.ts +6 -0
- package/backend/dist/packages/gemini-core/src/config/models.js +13 -0
- package/backend/dist/packages/gemini-core/src/config/models.js.map +1 -0
- package/backend/dist/packages/gemini-core/src/config/storage.d.ts +8 -0
- package/backend/dist/packages/gemini-core/src/config/storage.js +25 -0
- package/backend/dist/packages/gemini-core/src/config/storage.js.map +1 -0
- package/backend/dist/packages/gemini-core/src/core/contentGenerator.d.ts +23 -0
- package/backend/dist/packages/gemini-core/src/core/contentGenerator.js +63 -0
- package/backend/dist/packages/gemini-core/src/core/contentGenerator.js.map +1 -0
- package/backend/dist/packages/gemini-core/src/core/geminiChat.d.ts +34 -0
- package/backend/dist/packages/gemini-core/src/core/geminiChat.js +247 -0
- package/backend/dist/packages/gemini-core/src/core/geminiChat.js.map +1 -0
- package/backend/dist/packages/gemini-core/src/core/geminiRequest.d.ts +3 -0
- package/backend/dist/packages/gemini-core/src/core/geminiRequest.js +8 -0
- package/backend/dist/packages/gemini-core/src/core/geminiRequest.js.map +1 -0
- package/backend/dist/packages/gemini-core/src/core/prompts.d.ts +7 -0
- package/backend/dist/packages/gemini-core/src/core/prompts.js +69 -0
- package/backend/dist/packages/gemini-core/src/core/prompts.js.map +1 -0
- package/backend/dist/packages/gemini-core/src/core/tokenLimits.d.ts +5 -0
- package/backend/dist/packages/gemini-core/src/core/tokenLimits.js +25 -0
- package/backend/dist/packages/gemini-core/src/core/tokenLimits.js.map +1 -0
- package/backend/dist/packages/gemini-core/src/index.d.ts +18 -0
- package/backend/dist/packages/gemini-core/src/index.js +37 -0
- package/backend/dist/packages/gemini-core/src/index.js.map +1 -0
- package/backend/dist/packages/gemini-core/src/mcp/token-storage/base-token-storage.d.ts +14 -0
- package/backend/dist/packages/gemini-core/src/mcp/token-storage/base-token-storage.js +34 -0
- package/backend/dist/packages/gemini-core/src/mcp/token-storage/base-token-storage.js.map +1 -0
- package/backend/dist/packages/gemini-core/src/mcp/token-storage/file-token-storage.d.ts +19 -0
- package/backend/dist/packages/gemini-core/src/mcp/token-storage/file-token-storage.js +141 -0
- package/backend/dist/packages/gemini-core/src/mcp/token-storage/file-token-storage.js.map +1 -0
- package/backend/dist/packages/gemini-core/src/mcp/token-storage/hybrid-token-storage.d.ts +18 -0
- package/backend/dist/packages/gemini-core/src/mcp/token-storage/hybrid-token-storage.js +74 -0
- package/backend/dist/packages/gemini-core/src/mcp/token-storage/hybrid-token-storage.js.map +1 -0
- package/backend/dist/packages/gemini-core/src/mcp/token-storage/index.d.ts +6 -0
- package/backend/dist/packages/gemini-core/src/mcp/token-storage/index.js +24 -0
- package/backend/dist/packages/gemini-core/src/mcp/token-storage/index.js.map +1 -0
- package/backend/dist/packages/gemini-core/src/mcp/token-storage/keychain-token-storage.d.ts +26 -0
- package/backend/dist/packages/gemini-core/src/mcp/token-storage/keychain-token-storage.js +188 -0
- package/backend/dist/packages/gemini-core/src/mcp/token-storage/keychain-token-storage.js.map +1 -0
- package/backend/dist/packages/gemini-core/src/mcp/token-storage/types.d.ts +27 -0
- package/backend/dist/packages/gemini-core/src/mcp/token-storage/types.js +9 -0
- package/backend/dist/packages/gemini-core/src/mcp/token-storage/types.js.map +1 -0
- package/backend/dist/packages/gemini-core/src/utils/errors.d.ts +34 -0
- package/backend/dist/packages/gemini-core/src/utils/errors.js +103 -0
- package/backend/dist/packages/gemini-core/src/utils/errors.js.map +1 -0
- package/backend/dist/packages/gemini-core/src/utils/partUtils.d.ts +7 -0
- package/backend/dist/packages/gemini-core/src/utils/partUtils.js +108 -0
- package/backend/dist/packages/gemini-core/src/utils/partUtils.js.map +1 -0
- package/backend/dist/packages/gemini-core/src/utils/quotaErrorDetection.d.ts +16 -0
- package/backend/dist/packages/gemini-core/src/utils/quotaErrorDetection.js +60 -0
- package/backend/dist/packages/gemini-core/src/utils/quotaErrorDetection.js.map +1 -0
- package/backend/dist/packages/gemini-core/src/utils/retry.d.ts +14 -0
- package/backend/dist/packages/gemini-core/src/utils/retry.js +154 -0
- package/backend/dist/packages/gemini-core/src/utils/retry.js.map +1 -0
- package/backend/dist/packages/gemini-core/src/utils/session.d.ts +1 -0
- package/backend/dist/packages/gemini-core/src/utils/session.js +6 -0
- package/backend/dist/packages/gemini-core/src/utils/session.js.map +1 -0
- package/backend/dist/packages/gemini-core/src/utils/userAccountManager.d.ts +10 -0
- package/backend/dist/packages/gemini-core/src/utils/userAccountManager.js +106 -0
- package/backend/dist/packages/gemini-core/src/utils/userAccountManager.js.map +1 -0
- package/backend/dist/src/action-execution/action-execution.module.js.map +1 -0
- package/backend/dist/src/action-execution/action-execution.service.js.map +1 -0
- package/backend/dist/src/ai-actions/ai-action-batch.service.js.map +1 -0
- package/backend/dist/src/ai-actions/ai-action-creation.service.js.map +1 -0
- package/backend/dist/src/ai-actions/ai-actions.controller.js.map +1 -0
- package/backend/dist/src/ai-actions/ai-actions.module.js.map +1 -0
- package/backend/dist/src/ai-actions/ai-actions.service.js.map +1 -0
- package/backend/dist/src/app.controller.js.map +1 -0
- package/backend/dist/src/app.module.js.map +1 -0
- package/backend/dist/src/app.service.js.map +1 -0
- package/backend/dist/src/application-state/application-state.controller.js.map +1 -0
- package/backend/dist/src/application-state/application-state.module.js.map +1 -0
- package/backend/dist/src/application-state/application-state.service.js.map +1 -0
- package/backend/dist/src/application-state/dto/set-auto-context-fetch-enabled.dto.js.map +1 -0
- package/backend/dist/src/application-state/dto/set-auto-send-to-ai-studio-enabled.dto.js.map +1 -0
- package/backend/dist/src/application-state/dto/set-context-token-limit.dto.js.map +1 -0
- package/backend/dist/src/application-state/dto/set-orchestration-timeout.dto.js.map +1 -0
- package/backend/dist/src/application-state/dto/set-theme.dto.js.map +1 -0
- package/backend/dist/src/application-state/dto/set-websocket-enabled.dto.js.map +1 -0
- package/backend/dist/src/context-generation/context-generation.module.js.map +1 -0
- package/backend/dist/src/context-generation/context-generation.service.js.map +1 -0
- package/backend/dist/src/context-snippets/context-snippets.controller.js.map +1 -0
- package/backend/dist/src/context-snippets/context-snippets.module.js.map +1 -0
- package/backend/dist/src/context-snippets/context-snippets.service.js.map +1 -0
- package/backend/dist/src/context-snippets/dto/context-snippet.dto.js.map +1 -0
- package/backend/dist/src/context-templates/context-templates.controller.js.map +1 -0
- package/backend/dist/src/context-templates/context-templates.module.js.map +1 -0
- package/backend/dist/src/context-templates/context-templates.service.js.map +1 -0
- package/backend/dist/src/context-templates/dto/context-template.dto.js.map +1 -0
- package/backend/dist/src/core-entities/ai-action.entity.js.map +1 -0
- package/backend/dist/src/core-entities/application-state.entity.js.map +1 -0
- package/backend/dist/src/core-entities/base.entity.js.map +1 -0
- package/backend/dist/src/core-entities/context-snippet.entity.js.map +1 -0
- package/backend/dist/src/core-entities/context-template.entity.js.map +1 -0
- package/backend/dist/src/core-entities/custom-snippet.entity.js.map +1 -0
- package/backend/dist/src/core-entities/execution-log.entity.js.map +1 -0
- package/backend/dist/src/core-entities/index.js.map +1 -0
- package/backend/dist/src/core-entities/project.entity.js.map +1 -0
- package/backend/dist/src/core-entities/session-input.entity.js.map +1 -0
- package/backend/dist/src/core-entities/session.entity.js.map +1 -0
- package/backend/dist/src/core-entities/system-prompt.entity.js.map +1 -0
- package/backend/dist/src/custom-snippets/custom-snippets.controller.js.map +1 -0
- package/backend/dist/src/custom-snippets/custom-snippets.module.js.map +1 -0
- package/backend/dist/src/custom-snippets/custom-snippets.service.js.map +1 -0
- package/backend/dist/src/custom-snippets/dto/custom-snippet.dto.js.map +1 -0
- package/backend/dist/src/events/events.gateway.js.map +1 -0
- package/backend/dist/src/events/events.module.js.map +1 -0
- package/backend/dist/src/execution-logs/dto/execution-log.dto.js.map +1 -0
- package/backend/dist/src/execution-logs/execution-logs.controller.js.map +1 -0
- package/backend/dist/src/execution-logs/execution-logs.module.js.map +1 -0
- package/backend/dist/src/execution-logs/execution-logs.service.js.map +1 -0
- package/backend/dist/src/gemini/gemini-llm.provider.d.ts +10 -0
- package/backend/dist/src/gemini/gemini-llm.provider.js +103 -0
- package/backend/dist/src/gemini/gemini-llm.provider.js.map +1 -0
- package/backend/dist/src/gemini/gemini.module.d.ts +2 -0
- package/backend/dist/src/gemini/gemini.module.js +21 -0
- package/backend/dist/src/gemini/gemini.module.js.map +1 -0
- package/backend/dist/src/http-exception.filter.js.map +1 -0
- package/backend/dist/src/llm-provider/llm-provider.interface.d.ts +16 -0
- package/backend/dist/src/llm-provider/llm-provider.interface.js +5 -0
- package/backend/dist/src/llm-provider/llm-provider.interface.js.map +1 -0
- package/backend/dist/src/llm-provider/llm-provider.module.d.ts +2 -0
- package/backend/dist/src/llm-provider/llm-provider.module.js +29 -0
- package/backend/dist/src/llm-provider/llm-provider.module.js.map +1 -0
- package/backend/dist/src/llm-response-parser/dto/ai-action.dto.js.map +1 -0
- package/backend/dist/src/llm-response-parser/errors/parsing.error.js.map +1 -0
- package/backend/dist/src/llm-response-parser/llm-response-parser.module.js.map +1 -0
- package/backend/dist/src/llm-response-parser/llm-response-parser.service.js.map +1 -0
- package/backend/dist/src/llm-response-parser/parsing.constants.js.map +1 -0
- package/backend/dist/src/llm-responses/dto/submit-llm-response.dto.js.map +1 -0
- package/backend/dist/src/llm-responses/llm-responses.controller.js.map +1 -0
- package/backend/dist/src/llm-responses/llm-responses.module.js.map +1 -0
- package/backend/dist/src/llm-responses/llm-responses.service.js.map +1 -0
- package/backend/dist/src/main.js.map +1 -0
- package/backend/dist/src/orchestration/dto/orchestration.dto.js.map +1 -0
- package/backend/dist/src/orchestration/orchestration-fs.service.js.map +1 -0
- package/backend/dist/src/orchestration/orchestration-parser.service.js.map +1 -0
- package/backend/dist/src/orchestration/orchestration.controller.js.map +1 -0
- package/backend/dist/src/orchestration/orchestration.module.js.map +1 -0
- package/backend/dist/src/orchestration/orchestration.service.js.map +1 -0
- package/backend/dist/src/orchestration/orchestration.types.js.map +1 -0
- package/backend/dist/src/projects/dto/project.dto.js.map +1 -0
- package/backend/dist/src/projects/projects.controller.js.map +1 -0
- package/backend/dist/src/projects/projects.module.js.map +1 -0
- package/backend/dist/src/projects/projects.service.js.map +1 -0
- package/backend/dist/src/seeding/context-template-seeding.service.js.map +1 -0
- package/backend/dist/src/seeding/custom-snippet-seeding.service.js.map +1 -0
- package/backend/dist/src/seeding/data/context-templates/default-followup_ad-hoc-focused-context.js.map +1 -0
- package/backend/dist/src/seeding/data/context-templates/default-initial_condensed-project-context.js.map +1 -0
- package/backend/dist/src/seeding/data/context-templates/default-initial_full-project-context.js.map +1 -0
- package/backend/dist/src/seeding/data/context-templates/pm-context.js.map +1 -0
- package/backend/dist/src/seeding/data/context-templates/pr-description.js.map +1 -0
- package/backend/dist/src/seeding/data/context-templates/sample_focused-tree.d.ts +2 -0
- package/backend/dist/{seeding → src/seeding}/data/context-templates/sample_focused-tree.js +1 -3
- package/backend/dist/src/seeding/data/context-templates/sample_focused-tree.js.map +1 -0
- package/backend/dist/src/seeding/data/custom-snippets/default_rglob.js.map +1 -0
- package/backend/dist/src/seeding/data/custom-snippets/git-diff.js.map +1 -0
- package/backend/dist/src/seeding/data/custom-snippets/rg-exclude.js.map +1 -0
- package/backend/dist/src/seeding/data/custom-snippets/rg-search-glob.js.map +1 -0
- package/backend/dist/src/seeding/data/custom-snippets/rg-search.js.map +1 -0
- package/backend/dist/src/seeding/data/custom-snippets/run-command.js.map +1 -0
- package/backend/dist/src/seeding/data/custom-snippets/tree.js.map +1 -0
- package/backend/dist/src/seeding/data/custom-snippets/usr-adhoc-incl.js.map +1 -0
- package/backend/dist/src/seeding/data/custom-snippets/usr-cmd-output-incl.js.map +1 -0
- package/backend/dist/src/seeding/data/custom-snippets/usr-input-incl.js.map +1 -0
- package/backend/dist/src/seeding/data/system-prompts/codebase-explorer.js.map +1 -0
- package/backend/dist/src/seeding/data/system-prompts/default_multi-file-action-generator-with-requester.js.map +1 -0
- package/backend/dist/src/seeding/data/system-prompts/packup.js.map +1 -0
- package/backend/dist/src/seeding/data/system-prompts/refactor-split.js.map +1 -0
- package/backend/dist/src/seeding/seeding.module.js.map +1 -0
- package/backend/dist/src/seeding/seeding.service.js.map +1 -0
- package/backend/dist/src/seeding/system-prompt-seeding.service.js.map +1 -0
- package/backend/dist/src/session-followup/session-followup.module.js.map +1 -0
- package/backend/dist/src/session-followup/session-followup.service.js.map +1 -0
- package/backend/dist/src/session-inputs/dto/session-input.dto.js.map +1 -0
- package/backend/dist/{session-inputs → src/session-inputs}/session-input-context.service.d.ts +1 -1
- package/backend/dist/{session-inputs → src/session-inputs}/session-input-context.service.js +10 -11
- package/backend/dist/src/session-inputs/session-input-context.service.js.map +1 -0
- package/backend/dist/src/session-inputs/session-inputs.controller.js.map +1 -0
- package/backend/dist/{session-inputs → src/session-inputs}/session-inputs.module.js +2 -0
- package/backend/dist/src/session-inputs/session-inputs.module.js.map +1 -0
- package/backend/dist/{session-inputs → src/session-inputs}/session-inputs.service.d.ts +3 -1
- package/backend/dist/{session-inputs → src/session-inputs}/session-inputs.service.js +46 -15
- package/backend/dist/src/session-inputs/session-inputs.service.js.map +1 -0
- package/backend/dist/src/session-transfer/session-transfer.module.js.map +1 -0
- package/backend/dist/src/session-transfer/session-transfer.service.js.map +1 -0
- package/backend/dist/src/sessions/dto/session.dto.js.map +1 -0
- package/backend/dist/src/sessions/sessions.controller.js.map +1 -0
- package/backend/dist/src/sessions/sessions.module.js.map +1 -0
- package/backend/dist/src/sessions/sessions.service.js.map +1 -0
- package/backend/dist/src/system-prompts/dto/system-prompt.dto.js.map +1 -0
- package/backend/dist/src/system-prompts/system-prompts.controller.js.map +1 -0
- package/backend/dist/src/system-prompts/system-prompts.module.js.map +1 -0
- package/backend/dist/src/system-prompts/system-prompts.service.js.map +1 -0
- package/backend/dist/{timeout.interceptor.js → src/timeout.interceptor.js} +1 -1
- package/backend/dist/src/timeout.interceptor.js.map +1 -0
- package/backend/dist/src/tracing.js.map +1 -0
- package/backend/dist/src/utils/fuzzy-search.js.map +1 -0
- package/backend/dist/src/utils/index.js.map +1 -0
- package/backend/dist/src/utils/trace.decorator.js.map +1 -0
- package/backend/dist/src/workspace/dto/file-tree.dto.d.ts +8 -0
- package/backend/dist/src/workspace/dto/file-tree.dto.js +10 -0
- package/backend/dist/src/workspace/dto/file-tree.dto.js.map +1 -0
- package/backend/dist/src/workspace/dto/search-workspace.dto.js.map +1 -0
- package/backend/dist/{workspace → src/workspace}/workspace.controller.d.ts +2 -5
- package/backend/dist/src/workspace/workspace.controller.js.map +1 -0
- package/backend/dist/src/workspace/workspace.module.js.map +1 -0
- package/backend/dist/{workspace → src/workspace}/workspace.service.d.ts +2 -6
- package/backend/dist/{workspace → src/workspace}/workspace.service.js +61 -12
- package/backend/dist/src/workspace/workspace.service.js.map +1 -0
- package/backend/dist/tsconfig.build.tsbuildinfo +1 -1
- package/backend/packages/gemini-core/examples/simple.ts +120 -0
- package/backend/packages/gemini-core/index.ts +15 -0
- package/backend/packages/gemini-core/src/code_assist/codeAssist.ts +37 -0
- package/backend/packages/gemini-core/src/code_assist/converter.ts +250 -0
- package/backend/packages/gemini-core/src/code_assist/oauth-credential-storage.ts +129 -0
- package/backend/packages/gemini-core/src/code_assist/oauth2.ts +541 -0
- package/backend/packages/gemini-core/src/code_assist/server.ts +236 -0
- package/backend/packages/gemini-core/src/code_assist/setup.ts +124 -0
- package/backend/packages/gemini-core/src/code_assist/types.ts +201 -0
- package/backend/packages/gemini-core/src/config/config.ts +75 -0
- package/backend/packages/gemini-core/src/config/models.ts +23 -0
- package/backend/packages/gemini-core/src/config/storage.ts +30 -0
- package/backend/packages/gemini-core/src/core/contentGenerator.ts +136 -0
- package/backend/packages/gemini-core/src/core/geminiChat.ts +385 -0
- package/backend/packages/gemini-core/src/core/geminiRequest.ts +19 -0
- package/backend/packages/gemini-core/src/core/prompts.ts +109 -0
- package/backend/packages/gemini-core/src/core/tokenLimits.ts +32 -0
- package/backend/packages/gemini-core/src/index.ts +35 -0
- package/backend/packages/gemini-core/src/mcp/token-storage/base-token-storage.ts +49 -0
- package/backend/packages/gemini-core/src/mcp/token-storage/file-token-storage.ts +184 -0
- package/backend/packages/gemini-core/src/mcp/token-storage/hybrid-token-storage.ts +97 -0
- package/backend/packages/gemini-core/src/mcp/token-storage/index.ts +14 -0
- package/backend/packages/gemini-core/src/mcp/token-storage/keychain-token-storage.ts +251 -0
- package/backend/packages/gemini-core/src/mcp/token-storage/types.ts +42 -0
- package/backend/packages/gemini-core/src/utils/errors.ts +112 -0
- package/backend/packages/gemini-core/src/utils/partUtils.ts +169 -0
- package/backend/packages/gemini-core/src/utils/quotaErrorDetection.ts +102 -0
- package/backend/packages/gemini-core/src/utils/retry.ts +265 -0
- package/backend/packages/gemini-core/src/utils/session.ts +9 -0
- package/backend/packages/gemini-core/src/utils/userAccountManager.ts +140 -0
- package/package.json +5 -3
- package/backend/.repoburg/orchestrations/README.md +0 -41
- package/backend/dist/action-execution/action-execution.module.js.map +0 -1
- package/backend/dist/action-execution/action-execution.service.js.map +0 -1
- package/backend/dist/ai-actions/ai-action-batch.service.js.map +0 -1
- package/backend/dist/ai-actions/ai-action-creation.service.js.map +0 -1
- package/backend/dist/ai-actions/ai-actions.controller.js.map +0 -1
- package/backend/dist/ai-actions/ai-actions.module.js.map +0 -1
- package/backend/dist/ai-actions/ai-actions.service.js.map +0 -1
- package/backend/dist/app.controller.js.map +0 -1
- package/backend/dist/app.module.js.map +0 -1
- package/backend/dist/app.service.js.map +0 -1
- package/backend/dist/application-state/application-state.controller.js.map +0 -1
- package/backend/dist/application-state/application-state.module.js.map +0 -1
- package/backend/dist/application-state/application-state.service.js.map +0 -1
- package/backend/dist/application-state/dto/set-auto-context-fetch-enabled.dto.js.map +0 -1
- package/backend/dist/application-state/dto/set-auto-send-to-ai-studio-enabled.dto.js.map +0 -1
- package/backend/dist/application-state/dto/set-context-token-limit.dto.js.map +0 -1
- package/backend/dist/application-state/dto/set-orchestration-timeout.dto.js.map +0 -1
- package/backend/dist/application-state/dto/set-theme.dto.js.map +0 -1
- package/backend/dist/application-state/dto/set-websocket-enabled.dto.js.map +0 -1
- package/backend/dist/context-generation/context-generation.module.js.map +0 -1
- package/backend/dist/context-generation/context-generation.service.js.map +0 -1
- package/backend/dist/context-snippets/context-snippets.controller.js.map +0 -1
- package/backend/dist/context-snippets/context-snippets.module.js.map +0 -1
- package/backend/dist/context-snippets/context-snippets.service.js.map +0 -1
- package/backend/dist/context-snippets/dto/context-snippet.dto.js.map +0 -1
- package/backend/dist/context-templates/context-templates.controller.js.map +0 -1
- package/backend/dist/context-templates/context-templates.module.js.map +0 -1
- package/backend/dist/context-templates/context-templates.service.js.map +0 -1
- package/backend/dist/context-templates/dto/context-template.dto.js.map +0 -1
- package/backend/dist/core-entities/ai-action.entity.js.map +0 -1
- package/backend/dist/core-entities/application-state.entity.js.map +0 -1
- package/backend/dist/core-entities/base.entity.js.map +0 -1
- package/backend/dist/core-entities/context-snippet.entity.js.map +0 -1
- package/backend/dist/core-entities/context-template.entity.js.map +0 -1
- package/backend/dist/core-entities/custom-snippet.entity.js.map +0 -1
- package/backend/dist/core-entities/execution-log.entity.js.map +0 -1
- package/backend/dist/core-entities/index.js.map +0 -1
- package/backend/dist/core-entities/project.entity.js.map +0 -1
- package/backend/dist/core-entities/session-input.entity.js.map +0 -1
- package/backend/dist/core-entities/session.entity.js.map +0 -1
- package/backend/dist/core-entities/system-prompt.entity.js.map +0 -1
- package/backend/dist/custom-snippets/custom-snippets.controller.js.map +0 -1
- package/backend/dist/custom-snippets/custom-snippets.module.js.map +0 -1
- package/backend/dist/custom-snippets/custom-snippets.service.js.map +0 -1
- package/backend/dist/custom-snippets/dto/custom-snippet.dto.js.map +0 -1
- package/backend/dist/events/events.gateway.js.map +0 -1
- package/backend/dist/events/events.module.js.map +0 -1
- package/backend/dist/execution-logs/dto/execution-log.dto.js.map +0 -1
- package/backend/dist/execution-logs/execution-logs.controller.js.map +0 -1
- package/backend/dist/execution-logs/execution-logs.module.js.map +0 -1
- package/backend/dist/execution-logs/execution-logs.service.js.map +0 -1
- package/backend/dist/http-exception.filter.js.map +0 -1
- package/backend/dist/llm-response-parser/dto/ai-action.dto.js.map +0 -1
- package/backend/dist/llm-response-parser/errors/parsing.error.js.map +0 -1
- package/backend/dist/llm-response-parser/llm-response-parser.module.js.map +0 -1
- package/backend/dist/llm-response-parser/llm-response-parser.service.js.map +0 -1
- package/backend/dist/llm-response-parser/parsing.constants.js.map +0 -1
- package/backend/dist/llm-responses/dto/submit-llm-response.dto.js.map +0 -1
- package/backend/dist/llm-responses/llm-responses.controller.js.map +0 -1
- package/backend/dist/llm-responses/llm-responses.module.js.map +0 -1
- package/backend/dist/llm-responses/llm-responses.service.js.map +0 -1
- package/backend/dist/main.js.map +0 -1
- package/backend/dist/orchestration/dto/orchestration.dto.js.map +0 -1
- package/backend/dist/orchestration/orchestration-fs.service.js.map +0 -1
- package/backend/dist/orchestration/orchestration-parser.service.js.map +0 -1
- package/backend/dist/orchestration/orchestration.controller.js.map +0 -1
- package/backend/dist/orchestration/orchestration.module.js.map +0 -1
- package/backend/dist/orchestration/orchestration.service.js.map +0 -1
- package/backend/dist/orchestration/orchestration.types.js.map +0 -1
- package/backend/dist/projects/dto/project.dto.js.map +0 -1
- package/backend/dist/projects/projects.controller.js.map +0 -1
- package/backend/dist/projects/projects.module.js.map +0 -1
- package/backend/dist/projects/projects.service.js.map +0 -1
- package/backend/dist/seeding/context-template-seeding.service.js.map +0 -1
- package/backend/dist/seeding/custom-snippet-seeding.service.js.map +0 -1
- package/backend/dist/seeding/data/context-templates/default-followup_ad-hoc-focused-context.js.map +0 -1
- package/backend/dist/seeding/data/context-templates/default-initial_condensed-project-context.js.map +0 -1
- package/backend/dist/seeding/data/context-templates/default-initial_full-project-context.js.map +0 -1
- package/backend/dist/seeding/data/context-templates/pm-context.js.map +0 -1
- package/backend/dist/seeding/data/context-templates/pr-description.js.map +0 -1
- package/backend/dist/seeding/data/context-templates/sample_focused-tree.d.ts +0 -2
- package/backend/dist/seeding/data/context-templates/sample_focused-tree.js.map +0 -1
- package/backend/dist/seeding/data/custom-snippets/default_rglob.js.map +0 -1
- package/backend/dist/seeding/data/custom-snippets/git-diff.js.map +0 -1
- package/backend/dist/seeding/data/custom-snippets/rg-exclude.js.map +0 -1
- package/backend/dist/seeding/data/custom-snippets/rg-search-glob.js.map +0 -1
- package/backend/dist/seeding/data/custom-snippets/rg-search.js.map +0 -1
- package/backend/dist/seeding/data/custom-snippets/run-command.js.map +0 -1
- package/backend/dist/seeding/data/custom-snippets/tree.js.map +0 -1
- package/backend/dist/seeding/data/custom-snippets/usr-adhoc-incl.js.map +0 -1
- package/backend/dist/seeding/data/custom-snippets/usr-cmd-output-incl.js.map +0 -1
- package/backend/dist/seeding/data/custom-snippets/usr-input-incl.js.map +0 -1
- package/backend/dist/seeding/data/system-prompts/codebase-explorer.js.map +0 -1
- package/backend/dist/seeding/data/system-prompts/default_multi-file-action-generator-with-requester.js.map +0 -1
- package/backend/dist/seeding/data/system-prompts/packup.js.map +0 -1
- package/backend/dist/seeding/data/system-prompts/refactor-split.js.map +0 -1
- package/backend/dist/seeding/seeding.module.js.map +0 -1
- package/backend/dist/seeding/seeding.service.js.map +0 -1
- package/backend/dist/seeding/system-prompt-seeding.service.js.map +0 -1
- package/backend/dist/session-followup/session-followup.module.js.map +0 -1
- package/backend/dist/session-followup/session-followup.service.js.map +0 -1
- package/backend/dist/session-inputs/dto/session-input.dto.js.map +0 -1
- package/backend/dist/session-inputs/session-input-context.service.js.map +0 -1
- package/backend/dist/session-inputs/session-inputs.controller.js.map +0 -1
- package/backend/dist/session-inputs/session-inputs.module.js.map +0 -1
- package/backend/dist/session-inputs/session-inputs.service.js.map +0 -1
- package/backend/dist/session-transfer/session-transfer.module.js.map +0 -1
- package/backend/dist/session-transfer/session-transfer.service.js.map +0 -1
- package/backend/dist/sessions/dto/session.dto.js.map +0 -1
- package/backend/dist/sessions/sessions.controller.js.map +0 -1
- package/backend/dist/sessions/sessions.module.js.map +0 -1
- package/backend/dist/sessions/sessions.service.js.map +0 -1
- package/backend/dist/system-prompts/dto/system-prompt.dto.js.map +0 -1
- package/backend/dist/system-prompts/system-prompts.controller.js.map +0 -1
- package/backend/dist/system-prompts/system-prompts.module.js.map +0 -1
- package/backend/dist/system-prompts/system-prompts.service.js.map +0 -1
- package/backend/dist/timeout.interceptor.js.map +0 -1
- package/backend/dist/tracing.js.map +0 -1
- package/backend/dist/utils/fuzzy-search.js.map +0 -1
- package/backend/dist/utils/index.js.map +0 -1
- package/backend/dist/utils/trace.decorator.js.map +0 -1
- package/backend/dist/workspace/dto/search-workspace.dto.js.map +0 -1
- package/backend/dist/workspace/workspace.controller.js.map +0 -1
- package/backend/dist/workspace/workspace.module.js.map +0 -1
- package/backend/dist/workspace/workspace.service.js.map +0 -1
- /package/backend/dist/{action-execution → src/action-execution}/action-execution.module.d.ts +0 -0
- /package/backend/dist/{action-execution → src/action-execution}/action-execution.module.js +0 -0
- /package/backend/dist/{action-execution → src/action-execution}/action-execution.service.d.ts +0 -0
- /package/backend/dist/{action-execution → src/action-execution}/action-execution.service.js +0 -0
- /package/backend/dist/{ai-actions → src/ai-actions}/ai-action-batch.service.d.ts +0 -0
- /package/backend/dist/{ai-actions → src/ai-actions}/ai-action-batch.service.js +0 -0
- /package/backend/dist/{ai-actions → src/ai-actions}/ai-action-creation.service.d.ts +0 -0
- /package/backend/dist/{ai-actions → src/ai-actions}/ai-action-creation.service.js +0 -0
- /package/backend/dist/{ai-actions → src/ai-actions}/ai-actions.controller.d.ts +0 -0
- /package/backend/dist/{ai-actions → src/ai-actions}/ai-actions.controller.js +0 -0
- /package/backend/dist/{ai-actions → src/ai-actions}/ai-actions.module.d.ts +0 -0
- /package/backend/dist/{ai-actions → src/ai-actions}/ai-actions.module.js +0 -0
- /package/backend/dist/{ai-actions → src/ai-actions}/ai-actions.service.d.ts +0 -0
- /package/backend/dist/{ai-actions → src/ai-actions}/ai-actions.service.js +0 -0
- /package/backend/dist/{app.controller.d.ts → src/app.controller.d.ts} +0 -0
- /package/backend/dist/{app.controller.js → src/app.controller.js} +0 -0
- /package/backend/dist/{app.module.d.ts → src/app.module.d.ts} +0 -0
- /package/backend/dist/{app.module.js → src/app.module.js} +0 -0
- /package/backend/dist/{app.service.d.ts → src/app.service.d.ts} +0 -0
- /package/backend/dist/{app.service.js → src/app.service.js} +0 -0
- /package/backend/dist/{application-state → src/application-state}/application-state.controller.d.ts +0 -0
- /package/backend/dist/{application-state → src/application-state}/application-state.controller.js +0 -0
- /package/backend/dist/{application-state → src/application-state}/application-state.module.d.ts +0 -0
- /package/backend/dist/{application-state → src/application-state}/application-state.module.js +0 -0
- /package/backend/dist/{application-state → src/application-state}/application-state.service.d.ts +0 -0
- /package/backend/dist/{application-state → src/application-state}/application-state.service.js +0 -0
- /package/backend/dist/{application-state → src/application-state}/dto/set-auto-context-fetch-enabled.dto.d.ts +0 -0
- /package/backend/dist/{application-state → src/application-state}/dto/set-auto-context-fetch-enabled.dto.js +0 -0
- /package/backend/dist/{application-state → src/application-state}/dto/set-auto-send-to-ai-studio-enabled.dto.d.ts +0 -0
- /package/backend/dist/{application-state → src/application-state}/dto/set-auto-send-to-ai-studio-enabled.dto.js +0 -0
- /package/backend/dist/{application-state → src/application-state}/dto/set-context-token-limit.dto.d.ts +0 -0
- /package/backend/dist/{application-state → src/application-state}/dto/set-context-token-limit.dto.js +0 -0
- /package/backend/dist/{application-state → src/application-state}/dto/set-orchestration-timeout.dto.d.ts +0 -0
- /package/backend/dist/{application-state → src/application-state}/dto/set-orchestration-timeout.dto.js +0 -0
- /package/backend/dist/{application-state → src/application-state}/dto/set-theme.dto.d.ts +0 -0
- /package/backend/dist/{application-state → src/application-state}/dto/set-theme.dto.js +0 -0
- /package/backend/dist/{application-state → src/application-state}/dto/set-websocket-enabled.dto.d.ts +0 -0
- /package/backend/dist/{application-state → src/application-state}/dto/set-websocket-enabled.dto.js +0 -0
- /package/backend/dist/{context-generation → src/context-generation}/context-generation.module.d.ts +0 -0
- /package/backend/dist/{context-generation → src/context-generation}/context-generation.module.js +0 -0
- /package/backend/dist/{context-generation → src/context-generation}/context-generation.service.d.ts +0 -0
- /package/backend/dist/{context-generation → src/context-generation}/context-generation.service.js +0 -0
- /package/backend/dist/{context-snippets → src/context-snippets}/context-snippets.controller.d.ts +0 -0
- /package/backend/dist/{context-snippets → src/context-snippets}/context-snippets.controller.js +0 -0
- /package/backend/dist/{context-snippets → src/context-snippets}/context-snippets.module.d.ts +0 -0
- /package/backend/dist/{context-snippets → src/context-snippets}/context-snippets.module.js +0 -0
- /package/backend/dist/{context-snippets → src/context-snippets}/context-snippets.service.d.ts +0 -0
- /package/backend/dist/{context-snippets → src/context-snippets}/context-snippets.service.js +0 -0
- /package/backend/dist/{context-snippets → src/context-snippets}/dto/context-snippet.dto.d.ts +0 -0
- /package/backend/dist/{context-snippets → src/context-snippets}/dto/context-snippet.dto.js +0 -0
- /package/backend/dist/{context-templates → src/context-templates}/context-templates.controller.d.ts +0 -0
- /package/backend/dist/{context-templates → src/context-templates}/context-templates.controller.js +0 -0
- /package/backend/dist/{context-templates → src/context-templates}/context-templates.module.d.ts +0 -0
- /package/backend/dist/{context-templates → src/context-templates}/context-templates.module.js +0 -0
- /package/backend/dist/{context-templates → src/context-templates}/context-templates.service.d.ts +0 -0
- /package/backend/dist/{context-templates → src/context-templates}/context-templates.service.js +0 -0
- /package/backend/dist/{context-templates → src/context-templates}/dto/context-template.dto.d.ts +0 -0
- /package/backend/dist/{context-templates → src/context-templates}/dto/context-template.dto.js +0 -0
- /package/backend/dist/{core-entities → src/core-entities}/ai-action.entity.d.ts +0 -0
- /package/backend/dist/{core-entities → src/core-entities}/ai-action.entity.js +0 -0
- /package/backend/dist/{core-entities → src/core-entities}/application-state.entity.d.ts +0 -0
- /package/backend/dist/{core-entities → src/core-entities}/application-state.entity.js +0 -0
- /package/backend/dist/{core-entities → src/core-entities}/base.entity.d.ts +0 -0
- /package/backend/dist/{core-entities → src/core-entities}/base.entity.js +0 -0
- /package/backend/dist/{core-entities → src/core-entities}/context-snippet.entity.d.ts +0 -0
- /package/backend/dist/{core-entities → src/core-entities}/context-snippet.entity.js +0 -0
- /package/backend/dist/{core-entities → src/core-entities}/context-template.entity.d.ts +0 -0
- /package/backend/dist/{core-entities → src/core-entities}/context-template.entity.js +0 -0
- /package/backend/dist/{core-entities → src/core-entities}/custom-snippet.entity.d.ts +0 -0
- /package/backend/dist/{core-entities → src/core-entities}/custom-snippet.entity.js +0 -0
- /package/backend/dist/{core-entities → src/core-entities}/execution-log.entity.d.ts +0 -0
- /package/backend/dist/{core-entities → src/core-entities}/execution-log.entity.js +0 -0
- /package/backend/dist/{core-entities → src/core-entities}/index.d.ts +0 -0
- /package/backend/dist/{core-entities → src/core-entities}/index.js +0 -0
- /package/backend/dist/{core-entities → src/core-entities}/project.entity.d.ts +0 -0
- /package/backend/dist/{core-entities → src/core-entities}/project.entity.js +0 -0
- /package/backend/dist/{core-entities → src/core-entities}/session-input.entity.d.ts +0 -0
- /package/backend/dist/{core-entities → src/core-entities}/session-input.entity.js +0 -0
- /package/backend/dist/{core-entities → src/core-entities}/session.entity.d.ts +0 -0
- /package/backend/dist/{core-entities → src/core-entities}/session.entity.js +0 -0
- /package/backend/dist/{core-entities → src/core-entities}/system-prompt.entity.d.ts +0 -0
- /package/backend/dist/{core-entities → src/core-entities}/system-prompt.entity.js +0 -0
- /package/backend/dist/{custom-snippets → src/custom-snippets}/custom-snippets.controller.d.ts +0 -0
- /package/backend/dist/{custom-snippets → src/custom-snippets}/custom-snippets.controller.js +0 -0
- /package/backend/dist/{custom-snippets → src/custom-snippets}/custom-snippets.module.d.ts +0 -0
- /package/backend/dist/{custom-snippets → src/custom-snippets}/custom-snippets.module.js +0 -0
- /package/backend/dist/{custom-snippets → src/custom-snippets}/custom-snippets.service.d.ts +0 -0
- /package/backend/dist/{custom-snippets → src/custom-snippets}/custom-snippets.service.js +0 -0
- /package/backend/dist/{custom-snippets → src/custom-snippets}/dto/custom-snippet.dto.d.ts +0 -0
- /package/backend/dist/{custom-snippets → src/custom-snippets}/dto/custom-snippet.dto.js +0 -0
- /package/backend/dist/{events → src/events}/events.gateway.d.ts +0 -0
- /package/backend/dist/{events → src/events}/events.gateway.js +0 -0
- /package/backend/dist/{events → src/events}/events.module.d.ts +0 -0
- /package/backend/dist/{events → src/events}/events.module.js +0 -0
- /package/backend/dist/{execution-logs → src/execution-logs}/dto/execution-log.dto.d.ts +0 -0
- /package/backend/dist/{execution-logs → src/execution-logs}/dto/execution-log.dto.js +0 -0
- /package/backend/dist/{execution-logs → src/execution-logs}/execution-logs.controller.d.ts +0 -0
- /package/backend/dist/{execution-logs → src/execution-logs}/execution-logs.controller.js +0 -0
- /package/backend/dist/{execution-logs → src/execution-logs}/execution-logs.module.d.ts +0 -0
- /package/backend/dist/{execution-logs → src/execution-logs}/execution-logs.module.js +0 -0
- /package/backend/dist/{execution-logs → src/execution-logs}/execution-logs.service.d.ts +0 -0
- /package/backend/dist/{execution-logs → src/execution-logs}/execution-logs.service.js +0 -0
- /package/backend/dist/{http-exception.filter.d.ts → src/http-exception.filter.d.ts} +0 -0
- /package/backend/dist/{http-exception.filter.js → src/http-exception.filter.js} +0 -0
- /package/backend/dist/{llm-response-parser → src/llm-response-parser}/dto/ai-action.dto.d.ts +0 -0
- /package/backend/dist/{llm-response-parser → src/llm-response-parser}/dto/ai-action.dto.js +0 -0
- /package/backend/dist/{llm-response-parser → src/llm-response-parser}/errors/parsing.error.d.ts +0 -0
- /package/backend/dist/{llm-response-parser → src/llm-response-parser}/errors/parsing.error.js +0 -0
- /package/backend/dist/{llm-response-parser → src/llm-response-parser}/llm-response-parser.module.d.ts +0 -0
- /package/backend/dist/{llm-response-parser → src/llm-response-parser}/llm-response-parser.module.js +0 -0
- /package/backend/dist/{llm-response-parser → src/llm-response-parser}/llm-response-parser.service.d.ts +0 -0
- /package/backend/dist/{llm-response-parser → src/llm-response-parser}/llm-response-parser.service.js +0 -0
- /package/backend/dist/{llm-response-parser → src/llm-response-parser}/parsing.constants.d.ts +0 -0
- /package/backend/dist/{llm-response-parser → src/llm-response-parser}/parsing.constants.js +0 -0
- /package/backend/dist/{llm-responses → src/llm-responses}/dto/submit-llm-response.dto.d.ts +0 -0
- /package/backend/dist/{llm-responses → src/llm-responses}/dto/submit-llm-response.dto.js +0 -0
- /package/backend/dist/{llm-responses → src/llm-responses}/llm-responses.controller.d.ts +0 -0
- /package/backend/dist/{llm-responses → src/llm-responses}/llm-responses.controller.js +0 -0
- /package/backend/dist/{llm-responses → src/llm-responses}/llm-responses.module.d.ts +0 -0
- /package/backend/dist/{llm-responses → src/llm-responses}/llm-responses.module.js +0 -0
- /package/backend/dist/{llm-responses → src/llm-responses}/llm-responses.service.d.ts +0 -0
- /package/backend/dist/{llm-responses → src/llm-responses}/llm-responses.service.js +0 -0
- /package/backend/dist/{main.d.ts → src/main.d.ts} +0 -0
- /package/backend/dist/{main.js → src/main.js} +0 -0
- /package/backend/dist/{orchestration → src/orchestration}/dto/orchestration.dto.d.ts +0 -0
- /package/backend/dist/{orchestration → src/orchestration}/dto/orchestration.dto.js +0 -0
- /package/backend/dist/{orchestration → src/orchestration}/orchestration-fs.service.d.ts +0 -0
- /package/backend/dist/{orchestration → src/orchestration}/orchestration-fs.service.js +0 -0
- /package/backend/dist/{orchestration → src/orchestration}/orchestration-parser.service.d.ts +0 -0
- /package/backend/dist/{orchestration → src/orchestration}/orchestration-parser.service.js +0 -0
- /package/backend/dist/{orchestration → src/orchestration}/orchestration.controller.d.ts +0 -0
- /package/backend/dist/{orchestration → src/orchestration}/orchestration.controller.js +0 -0
- /package/backend/dist/{orchestration → src/orchestration}/orchestration.module.d.ts +0 -0
- /package/backend/dist/{orchestration → src/orchestration}/orchestration.module.js +0 -0
- /package/backend/dist/{orchestration → src/orchestration}/orchestration.service.d.ts +0 -0
- /package/backend/dist/{orchestration → src/orchestration}/orchestration.service.js +0 -0
- /package/backend/dist/{orchestration → src/orchestration}/orchestration.types.d.ts +0 -0
- /package/backend/dist/{orchestration → src/orchestration}/orchestration.types.js +0 -0
- /package/backend/dist/{projects → src/projects}/dto/project.dto.d.ts +0 -0
- /package/backend/dist/{projects → src/projects}/dto/project.dto.js +0 -0
- /package/backend/dist/{projects → src/projects}/projects.controller.d.ts +0 -0
- /package/backend/dist/{projects → src/projects}/projects.controller.js +0 -0
- /package/backend/dist/{projects → src/projects}/projects.module.d.ts +0 -0
- /package/backend/dist/{projects → src/projects}/projects.module.js +0 -0
- /package/backend/dist/{projects → src/projects}/projects.service.d.ts +0 -0
- /package/backend/dist/{projects → src/projects}/projects.service.js +0 -0
- /package/backend/dist/{seeding → src/seeding}/context-template-seeding.service.d.ts +0 -0
- /package/backend/dist/{seeding → src/seeding}/context-template-seeding.service.js +0 -0
- /package/backend/dist/{seeding → src/seeding}/custom-snippet-seeding.service.d.ts +0 -0
- /package/backend/dist/{seeding → src/seeding}/custom-snippet-seeding.service.js +0 -0
- /package/backend/dist/{seeding → src/seeding}/data/context-templates/default-followup_ad-hoc-focused-context.d.ts +0 -0
- /package/backend/dist/{seeding → src/seeding}/data/context-templates/default-followup_ad-hoc-focused-context.js +0 -0
- /package/backend/dist/{seeding → src/seeding}/data/context-templates/default-initial_condensed-project-context.d.ts +0 -0
- /package/backend/dist/{seeding → src/seeding}/data/context-templates/default-initial_condensed-project-context.js +0 -0
- /package/backend/dist/{seeding → src/seeding}/data/context-templates/default-initial_full-project-context.d.ts +0 -0
- /package/backend/dist/{seeding → src/seeding}/data/context-templates/default-initial_full-project-context.js +0 -0
- /package/backend/dist/{seeding → src/seeding}/data/context-templates/pm-context.d.ts +0 -0
- /package/backend/dist/{seeding → src/seeding}/data/context-templates/pm-context.js +0 -0
- /package/backend/dist/{seeding → src/seeding}/data/context-templates/pr-description.d.ts +0 -0
- /package/backend/dist/{seeding → src/seeding}/data/context-templates/pr-description.js +0 -0
- /package/backend/dist/{seeding → src/seeding}/data/custom-snippets/default_rglob.d.ts +0 -0
- /package/backend/dist/{seeding → src/seeding}/data/custom-snippets/default_rglob.js +0 -0
- /package/backend/dist/{seeding → src/seeding}/data/custom-snippets/git-diff.d.ts +0 -0
- /package/backend/dist/{seeding → src/seeding}/data/custom-snippets/git-diff.js +0 -0
- /package/backend/dist/{seeding → src/seeding}/data/custom-snippets/rg-exclude.d.ts +0 -0
- /package/backend/dist/{seeding → src/seeding}/data/custom-snippets/rg-exclude.js +0 -0
- /package/backend/dist/{seeding → src/seeding}/data/custom-snippets/rg-search-glob.d.ts +0 -0
- /package/backend/dist/{seeding → src/seeding}/data/custom-snippets/rg-search-glob.js +0 -0
- /package/backend/dist/{seeding → src/seeding}/data/custom-snippets/rg-search.d.ts +0 -0
- /package/backend/dist/{seeding → src/seeding}/data/custom-snippets/rg-search.js +0 -0
- /package/backend/dist/{seeding → src/seeding}/data/custom-snippets/run-command.d.ts +0 -0
- /package/backend/dist/{seeding → src/seeding}/data/custom-snippets/run-command.js +0 -0
- /package/backend/dist/{seeding → src/seeding}/data/custom-snippets/tree.d.ts +0 -0
- /package/backend/dist/{seeding → src/seeding}/data/custom-snippets/tree.js +0 -0
- /package/backend/dist/{seeding → src/seeding}/data/custom-snippets/usr-adhoc-incl.d.ts +0 -0
- /package/backend/dist/{seeding → src/seeding}/data/custom-snippets/usr-adhoc-incl.js +0 -0
- /package/backend/dist/{seeding → src/seeding}/data/custom-snippets/usr-cmd-output-incl.d.ts +0 -0
- /package/backend/dist/{seeding → src/seeding}/data/custom-snippets/usr-cmd-output-incl.js +0 -0
- /package/backend/dist/{seeding → src/seeding}/data/custom-snippets/usr-input-incl.d.ts +0 -0
- /package/backend/dist/{seeding → src/seeding}/data/custom-snippets/usr-input-incl.js +0 -0
- /package/backend/dist/{seeding → src/seeding}/data/system-prompts/codebase-explorer.d.ts +0 -0
- /package/backend/dist/{seeding → src/seeding}/data/system-prompts/codebase-explorer.js +0 -0
- /package/backend/dist/{seeding → src/seeding}/data/system-prompts/default_multi-file-action-generator-with-requester.d.ts +0 -0
- /package/backend/dist/{seeding → src/seeding}/data/system-prompts/default_multi-file-action-generator-with-requester.js +0 -0
- /package/backend/dist/{seeding → src/seeding}/data/system-prompts/packup.d.ts +0 -0
- /package/backend/dist/{seeding → src/seeding}/data/system-prompts/packup.js +0 -0
- /package/backend/dist/{seeding → src/seeding}/data/system-prompts/refactor-split.d.ts +0 -0
- /package/backend/dist/{seeding → src/seeding}/data/system-prompts/refactor-split.js +0 -0
- /package/backend/dist/{seeding → src/seeding}/seeding.module.d.ts +0 -0
- /package/backend/dist/{seeding → src/seeding}/seeding.module.js +0 -0
- /package/backend/dist/{seeding → src/seeding}/seeding.service.d.ts +0 -0
- /package/backend/dist/{seeding → src/seeding}/seeding.service.js +0 -0
- /package/backend/dist/{seeding → src/seeding}/system-prompt-seeding.service.d.ts +0 -0
- /package/backend/dist/{seeding → src/seeding}/system-prompt-seeding.service.js +0 -0
- /package/backend/dist/{session-followup → src/session-followup}/session-followup.module.d.ts +0 -0
- /package/backend/dist/{session-followup → src/session-followup}/session-followup.module.js +0 -0
- /package/backend/dist/{session-followup → src/session-followup}/session-followup.service.d.ts +0 -0
- /package/backend/dist/{session-followup → src/session-followup}/session-followup.service.js +0 -0
- /package/backend/dist/{session-inputs → src/session-inputs}/dto/session-input.dto.d.ts +0 -0
- /package/backend/dist/{session-inputs → src/session-inputs}/dto/session-input.dto.js +0 -0
- /package/backend/dist/{session-inputs → src/session-inputs}/session-inputs.controller.d.ts +0 -0
- /package/backend/dist/{session-inputs → src/session-inputs}/session-inputs.controller.js +0 -0
- /package/backend/dist/{session-inputs → src/session-inputs}/session-inputs.module.d.ts +0 -0
- /package/backend/dist/{session-transfer → src/session-transfer}/session-transfer.module.d.ts +0 -0
- /package/backend/dist/{session-transfer → src/session-transfer}/session-transfer.module.js +0 -0
- /package/backend/dist/{session-transfer → src/session-transfer}/session-transfer.service.d.ts +0 -0
- /package/backend/dist/{session-transfer → src/session-transfer}/session-transfer.service.js +0 -0
- /package/backend/dist/{sessions → src/sessions}/dto/session.dto.d.ts +0 -0
- /package/backend/dist/{sessions → src/sessions}/dto/session.dto.js +0 -0
- /package/backend/dist/{sessions → src/sessions}/sessions.controller.d.ts +0 -0
- /package/backend/dist/{sessions → src/sessions}/sessions.controller.js +0 -0
- /package/backend/dist/{sessions → src/sessions}/sessions.module.d.ts +0 -0
- /package/backend/dist/{sessions → src/sessions}/sessions.module.js +0 -0
- /package/backend/dist/{sessions → src/sessions}/sessions.service.d.ts +0 -0
- /package/backend/dist/{sessions → src/sessions}/sessions.service.js +0 -0
- /package/backend/dist/{system-prompts → src/system-prompts}/dto/system-prompt.dto.d.ts +0 -0
- /package/backend/dist/{system-prompts → src/system-prompts}/dto/system-prompt.dto.js +0 -0
- /package/backend/dist/{system-prompts → src/system-prompts}/system-prompts.controller.d.ts +0 -0
- /package/backend/dist/{system-prompts → src/system-prompts}/system-prompts.controller.js +0 -0
- /package/backend/dist/{system-prompts → src/system-prompts}/system-prompts.module.d.ts +0 -0
- /package/backend/dist/{system-prompts → src/system-prompts}/system-prompts.module.js +0 -0
- /package/backend/dist/{system-prompts → src/system-prompts}/system-prompts.service.d.ts +0 -0
- /package/backend/dist/{system-prompts → src/system-prompts}/system-prompts.service.js +0 -0
- /package/backend/dist/{timeout.interceptor.d.ts → src/timeout.interceptor.d.ts} +0 -0
- /package/backend/dist/{tracing.d.ts → src/tracing.d.ts} +0 -0
- /package/backend/dist/{tracing.js → src/tracing.js} +0 -0
- /package/backend/dist/{utils → src/utils}/fuzzy-search.d.ts +0 -0
- /package/backend/dist/{utils → src/utils}/fuzzy-search.js +0 -0
- /package/backend/dist/{utils → src/utils}/index.d.ts +0 -0
- /package/backend/dist/{utils → src/utils}/index.js +0 -0
- /package/backend/dist/{utils → src/utils}/trace.decorator.d.ts +0 -0
- /package/backend/dist/{utils → src/utils}/trace.decorator.js +0 -0
- /package/backend/dist/{workspace → src/workspace}/dto/search-workspace.dto.d.ts +0 -0
- /package/backend/dist/{workspace → src/workspace}/dto/search-workspace.dto.js +0 -0
- /package/backend/dist/{workspace → src/workspace}/workspace.controller.js +0 -0
- /package/backend/dist/{workspace → src/workspace}/workspace.module.d.ts +0 -0
- /package/backend/dist/{workspace → src/workspace}/workspace.module.js +0 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type {
|
|
8
|
+
CountTokensResponse,
|
|
9
|
+
GenerateContentResponse,
|
|
10
|
+
GenerateContentParameters,
|
|
11
|
+
CountTokensParameters,
|
|
12
|
+
EmbedContentResponse,
|
|
13
|
+
EmbedContentParameters,
|
|
14
|
+
} from '@google/genai';
|
|
15
|
+
import { GoogleGenAI } from '@google/genai';
|
|
16
|
+
import { createCodeAssistContentGenerator } from '../code_assist/codeAssist';
|
|
17
|
+
import type { Config } from '../config/config';
|
|
18
|
+
|
|
19
|
+
import type { UserTierId } from '../code_assist/types';
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Interface abstracting the core functionalities for generating content and counting tokens.
|
|
23
|
+
*/
|
|
24
|
+
export interface ContentGenerator {
|
|
25
|
+
generateContent(
|
|
26
|
+
request: GenerateContentParameters,
|
|
27
|
+
userPromptId: string,
|
|
28
|
+
): Promise<GenerateContentResponse>;
|
|
29
|
+
|
|
30
|
+
generateContentStream(
|
|
31
|
+
request: GenerateContentParameters,
|
|
32
|
+
userPromptId: string,
|
|
33
|
+
): Promise<AsyncGenerator<GenerateContentResponse>>;
|
|
34
|
+
|
|
35
|
+
countTokens(request: CountTokensParameters): Promise<CountTokensResponse>;
|
|
36
|
+
|
|
37
|
+
embedContent(request: EmbedContentParameters): Promise<EmbedContentResponse>;
|
|
38
|
+
|
|
39
|
+
userTier?: UserTierId;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export enum AuthType {
|
|
43
|
+
LOGIN_WITH_GOOGLE = 'oauth-personal',
|
|
44
|
+
USE_GEMINI = 'gemini-api-key',
|
|
45
|
+
USE_VERTEX_AI = 'vertex-ai',
|
|
46
|
+
CLOUD_SHELL = 'cloud-shell',
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export type ContentGeneratorConfig = {
|
|
50
|
+
apiKey?: string;
|
|
51
|
+
vertexai?: boolean;
|
|
52
|
+
authType?: AuthType;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export function createContentGeneratorConfig(
|
|
56
|
+
config: Config,
|
|
57
|
+
authType: AuthType | undefined,
|
|
58
|
+
): ContentGeneratorConfig {
|
|
59
|
+
const geminiApiKey = process.env['GEMINI_API_KEY'] || undefined;
|
|
60
|
+
const googleApiKey = process.env['GOOGLE_API_KEY'] || undefined;
|
|
61
|
+
const googleCloudProject = process.env['GOOGLE_CLOUD_PROJECT'] || undefined;
|
|
62
|
+
const googleCloudLocation = process.env['GOOGLE_CLOUD_LOCATION'] || undefined;
|
|
63
|
+
|
|
64
|
+
const contentGeneratorConfig: ContentGeneratorConfig = {
|
|
65
|
+
authType,
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
// If we are using Google auth or we are in Cloud Shell, there is nothing else to validate for now
|
|
69
|
+
if (
|
|
70
|
+
authType === AuthType.LOGIN_WITH_GOOGLE ||
|
|
71
|
+
authType === AuthType.CLOUD_SHELL
|
|
72
|
+
) {
|
|
73
|
+
return contentGeneratorConfig;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (authType === AuthType.USE_GEMINI && geminiApiKey) {
|
|
77
|
+
contentGeneratorConfig.apiKey = geminiApiKey;
|
|
78
|
+
contentGeneratorConfig.vertexai = false;
|
|
79
|
+
|
|
80
|
+
return contentGeneratorConfig;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if (
|
|
84
|
+
authType === AuthType.USE_VERTEX_AI &&
|
|
85
|
+
(googleApiKey || (googleCloudProject && googleCloudLocation))
|
|
86
|
+
) {
|
|
87
|
+
contentGeneratorConfig.apiKey = googleApiKey;
|
|
88
|
+
contentGeneratorConfig.vertexai = true;
|
|
89
|
+
|
|
90
|
+
return contentGeneratorConfig;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return contentGeneratorConfig;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export async function createContentGenerator(
|
|
97
|
+
config: ContentGeneratorConfig,
|
|
98
|
+
gcConfig: Config,
|
|
99
|
+
sessionId?: string,
|
|
100
|
+
): Promise<ContentGenerator> {
|
|
101
|
+
const version = process.env['CLI_VERSION'] || process.version;
|
|
102
|
+
const userAgent = `GeminiCLI/${version} (${process.platform}; ${process.arch})`;
|
|
103
|
+
const baseHeaders: Record<string, string> = {
|
|
104
|
+
'User-Agent': userAgent,
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
if (
|
|
108
|
+
config.authType === AuthType.LOGIN_WITH_GOOGLE ||
|
|
109
|
+
config.authType === AuthType.CLOUD_SHELL
|
|
110
|
+
) {
|
|
111
|
+
const httpOptions = { headers: baseHeaders };
|
|
112
|
+
return createCodeAssistContentGenerator(
|
|
113
|
+
httpOptions,
|
|
114
|
+
config.authType,
|
|
115
|
+
gcConfig,
|
|
116
|
+
sessionId,
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if (
|
|
121
|
+
config.authType === AuthType.USE_GEMINI ||
|
|
122
|
+
config.authType === AuthType.USE_VERTEX_AI
|
|
123
|
+
) {
|
|
124
|
+
const httpOptions = { headers: baseHeaders };
|
|
125
|
+
|
|
126
|
+
const googleGenAI = new GoogleGenAI({
|
|
127
|
+
apiKey: config.apiKey === '' ? undefined : config.apiKey,
|
|
128
|
+
vertexai: config.vertexai,
|
|
129
|
+
httpOptions,
|
|
130
|
+
});
|
|
131
|
+
return googleGenAI.models;
|
|
132
|
+
}
|
|
133
|
+
throw new Error(
|
|
134
|
+
`Error creating contentGenerator: Unsupported authType: ${config.authType}`,
|
|
135
|
+
);
|
|
136
|
+
}
|
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
// DISCLAIMER: This is a copied version of https://github.com/googleapis/js-genai/blob/main/src/chats.ts with the intention of working around a key bug
|
|
8
|
+
// where function responses are not treated as "valid" responses: https://b.corp.google.com/issues/420354090
|
|
9
|
+
|
|
10
|
+
import {
|
|
11
|
+
GenerateContentResponse,
|
|
12
|
+
type Content,
|
|
13
|
+
type GenerateContentConfig,
|
|
14
|
+
type SendMessageParameters,
|
|
15
|
+
type Part,
|
|
16
|
+
ApiError,
|
|
17
|
+
} from '@google/genai';
|
|
18
|
+
import { createUserContent } from '@google/genai';
|
|
19
|
+
import { retryWithBackoff } from '../utils/retry';
|
|
20
|
+
import type { Config } from '../config/config';
|
|
21
|
+
import { getEffectiveModel } from '../config/models';
|
|
22
|
+
|
|
23
|
+
export enum StreamEventType {
|
|
24
|
+
/** A regular content chunk from the API. */
|
|
25
|
+
CHUNK = 'chunk',
|
|
26
|
+
/** A signal that a retry is about to happen. The UI should discard any partial
|
|
27
|
+
* content from the attempt that just failed. */
|
|
28
|
+
RETRY = 'retry',
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type StreamEvent =
|
|
32
|
+
| { type: StreamEventType.CHUNK; value: GenerateContentResponse }
|
|
33
|
+
| { type: StreamEventType.RETRY };
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Options for retrying due to invalid content from the model.
|
|
37
|
+
*/
|
|
38
|
+
interface ContentRetryOptions {
|
|
39
|
+
/** Total number of attempts to make (1 initial + N retries). */
|
|
40
|
+
maxAttempts: number;
|
|
41
|
+
/** The base delay in milliseconds for linear backoff. */
|
|
42
|
+
initialDelayMs: number;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const INVALID_CONTENT_RETRY_OPTIONS: ContentRetryOptions = {
|
|
46
|
+
maxAttempts: 2, // 1 initial call + 1 retry
|
|
47
|
+
initialDelayMs: 500,
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Returns true if the response is valid, false otherwise.
|
|
52
|
+
*/
|
|
53
|
+
function isValidResponse(response: GenerateContentResponse): boolean {
|
|
54
|
+
if (response.candidates === undefined || response.candidates.length === 0) {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
const content = response.candidates[0]?.content;
|
|
58
|
+
if (content === undefined) {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
return isValidContent(content);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function isValidNonThoughtTextPart(part: Part): boolean {
|
|
65
|
+
return (
|
|
66
|
+
typeof part.text === 'string' &&
|
|
67
|
+
!part.thought &&
|
|
68
|
+
// Technically, the model should never generate parts that have text and
|
|
69
|
+
// any of these but we don't trust them so check anyways.
|
|
70
|
+
!part.inlineData &&
|
|
71
|
+
!part.fileData
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function isValidContent(content: Content): boolean {
|
|
76
|
+
if (content.parts === undefined || content.parts.length === 0) {
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
for (const part of content.parts) {
|
|
80
|
+
if (part === undefined || Object.keys(part).length === 0) {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
if (!part.thought && part.text !== undefined && part.text === '') {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Validates the history contains the correct roles.
|
|
92
|
+
*
|
|
93
|
+
* @throws Error if the history does not start with a user turn.
|
|
94
|
+
* @throws Error if the history contains an invalid role.
|
|
95
|
+
*/
|
|
96
|
+
function validateHistory(history: Content[]) {
|
|
97
|
+
for (const content of history) {
|
|
98
|
+
if (content.role !== 'user' && content.role !== 'model') {
|
|
99
|
+
throw new Error(`Role must be user or model, but got ${content.role}.`);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Extracts the curated (valid) history from a comprehensive history.
|
|
106
|
+
*
|
|
107
|
+
* @remarks
|
|
108
|
+
* The model may sometimes generate invalid or empty contents(e.g., due to safety
|
|
109
|
+
* filters or recitation). Extracting valid turns from the history
|
|
110
|
+
* ensures that subsequent requests could be accepted by the model.
|
|
111
|
+
*/
|
|
112
|
+
function extractCuratedHistory(comprehensiveHistory: Content[]): Content[] {
|
|
113
|
+
if (comprehensiveHistory === undefined || comprehensiveHistory.length === 0) {
|
|
114
|
+
return [];
|
|
115
|
+
}
|
|
116
|
+
const curatedHistory: Content[] = [];
|
|
117
|
+
const length = comprehensiveHistory.length;
|
|
118
|
+
let i = 0;
|
|
119
|
+
while (i < length) {
|
|
120
|
+
if (comprehensiveHistory[i].role === 'user') {
|
|
121
|
+
curatedHistory.push(comprehensiveHistory[i]);
|
|
122
|
+
i++;
|
|
123
|
+
} else {
|
|
124
|
+
const modelOutput: Content[] = [];
|
|
125
|
+
let isValid = true;
|
|
126
|
+
while (i < length && comprehensiveHistory[i].role === 'model') {
|
|
127
|
+
modelOutput.push(comprehensiveHistory[i]);
|
|
128
|
+
if (isValid && !isValidContent(comprehensiveHistory[i])) {
|
|
129
|
+
isValid = false;
|
|
130
|
+
}
|
|
131
|
+
i++;
|
|
132
|
+
}
|
|
133
|
+
if (isValid) {
|
|
134
|
+
curatedHistory.push(...modelOutput);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return curatedHistory;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Custom error to signal that a stream completed with invalid content,
|
|
143
|
+
* which should trigger a retry.
|
|
144
|
+
*/
|
|
145
|
+
export class InvalidStreamError extends Error {
|
|
146
|
+
readonly type: 'NO_FINISH_REASON' | 'NO_RESPONSE_TEXT';
|
|
147
|
+
|
|
148
|
+
constructor(message: string, type: 'NO_FINISH_REASON' | 'NO_RESPONSE_TEXT') {
|
|
149
|
+
super(message);
|
|
150
|
+
this.name = 'InvalidStreamError';
|
|
151
|
+
this.type = type;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Chat session that enables sending messages to the model with previous
|
|
157
|
+
* conversation context.
|
|
158
|
+
*
|
|
159
|
+
* @remarks
|
|
160
|
+
* The session maintains all the turns between user and model.
|
|
161
|
+
*/
|
|
162
|
+
export class GeminiChat {
|
|
163
|
+
// A promise to represent the current state of the message being sent to the
|
|
164
|
+
// model.
|
|
165
|
+
private sendPromise: Promise<void> = Promise.resolve();
|
|
166
|
+
|
|
167
|
+
constructor(
|
|
168
|
+
private readonly config: Config,
|
|
169
|
+
private readonly generationConfig: GenerateContentConfig = {},
|
|
170
|
+
private history: Content[] = [],
|
|
171
|
+
) {
|
|
172
|
+
validateHistory(history);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
setSystemInstruction(sysInstr: string) {
|
|
176
|
+
this.generationConfig.systemInstruction = sysInstr;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
async sendMessageStream(
|
|
180
|
+
model: string,
|
|
181
|
+
params: SendMessageParameters,
|
|
182
|
+
prompt_id: string,
|
|
183
|
+
): Promise<AsyncGenerator<StreamEvent>> {
|
|
184
|
+
await this.sendPromise;
|
|
185
|
+
|
|
186
|
+
let streamDoneResolver: () => void;
|
|
187
|
+
const streamDonePromise = new Promise<void>((resolve) => {
|
|
188
|
+
streamDoneResolver = resolve;
|
|
189
|
+
});
|
|
190
|
+
this.sendPromise = streamDonePromise;
|
|
191
|
+
|
|
192
|
+
const userContent = createUserContent(params.message);
|
|
193
|
+
|
|
194
|
+
// Add user content to history ONCE before any attempts.
|
|
195
|
+
this.history.push(userContent);
|
|
196
|
+
const requestContents = this.getHistory(true);
|
|
197
|
+
|
|
198
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
199
|
+
const self = this;
|
|
200
|
+
return (async function* () {
|
|
201
|
+
try {
|
|
202
|
+
let lastError: unknown = new Error('Request failed after all retries.');
|
|
203
|
+
|
|
204
|
+
for (
|
|
205
|
+
let attempt = 0;
|
|
206
|
+
attempt < INVALID_CONTENT_RETRY_OPTIONS.maxAttempts;
|
|
207
|
+
attempt++
|
|
208
|
+
) {
|
|
209
|
+
try {
|
|
210
|
+
if (attempt > 0) {
|
|
211
|
+
yield { type: StreamEventType.RETRY };
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
const stream = await self.makeApiCallAndProcessStream(
|
|
215
|
+
model,
|
|
216
|
+
requestContents,
|
|
217
|
+
params,
|
|
218
|
+
prompt_id,
|
|
219
|
+
);
|
|
220
|
+
|
|
221
|
+
for await (const chunk of stream) {
|
|
222
|
+
yield { type: StreamEventType.CHUNK, value: chunk };
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
lastError = null;
|
|
226
|
+
break;
|
|
227
|
+
} catch (error) {
|
|
228
|
+
lastError = error;
|
|
229
|
+
const isContentError = error instanceof InvalidStreamError;
|
|
230
|
+
|
|
231
|
+
if (isContentError) {
|
|
232
|
+
// Check if we have more attempts left.
|
|
233
|
+
if (attempt < INVALID_CONTENT_RETRY_OPTIONS.maxAttempts - 1) {
|
|
234
|
+
await new Promise((res) =>
|
|
235
|
+
setTimeout(
|
|
236
|
+
res,
|
|
237
|
+
INVALID_CONTENT_RETRY_OPTIONS.initialDelayMs *
|
|
238
|
+
(attempt + 1),
|
|
239
|
+
),
|
|
240
|
+
);
|
|
241
|
+
continue;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
break;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
if (lastError) {
|
|
249
|
+
if (self.history[self.history.length - 1] === userContent) {
|
|
250
|
+
self.history.pop();
|
|
251
|
+
}
|
|
252
|
+
throw lastError;
|
|
253
|
+
}
|
|
254
|
+
} finally {
|
|
255
|
+
streamDoneResolver!();
|
|
256
|
+
}
|
|
257
|
+
})();
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
private async makeApiCallAndProcessStream(
|
|
261
|
+
model: string,
|
|
262
|
+
requestContents: Content[],
|
|
263
|
+
params: SendMessageParameters,
|
|
264
|
+
prompt_id: string,
|
|
265
|
+
): Promise<AsyncGenerator<GenerateContentResponse>> {
|
|
266
|
+
const apiCall = () => {
|
|
267
|
+
const modelToUse = getEffectiveModel(model);
|
|
268
|
+
|
|
269
|
+
return this.config.getContentGenerator().generateContentStream(
|
|
270
|
+
{
|
|
271
|
+
model: modelToUse,
|
|
272
|
+
contents: requestContents,
|
|
273
|
+
config: { ...this.generationConfig, ...params.config },
|
|
274
|
+
},
|
|
275
|
+
prompt_id,
|
|
276
|
+
);
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
const streamResponse = await retryWithBackoff(apiCall, {
|
|
280
|
+
shouldRetryOnError: (error: unknown) => {
|
|
281
|
+
if (error instanceof ApiError && error.message) {
|
|
282
|
+
if (error.status === 400) return false;
|
|
283
|
+
if (isSchemaDepthError(error.message)) return false;
|
|
284
|
+
if (error.status === 429) return true;
|
|
285
|
+
if (error.status >= 500 && error.status < 600) return true;
|
|
286
|
+
}
|
|
287
|
+
return false;
|
|
288
|
+
},
|
|
289
|
+
authType: this.config.getContentGeneratorConfig()?.authType,
|
|
290
|
+
});
|
|
291
|
+
|
|
292
|
+
return this.processStreamResponse(model, streamResponse);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
getHistory(curated: boolean = false): Content[] {
|
|
296
|
+
const history = curated
|
|
297
|
+
? extractCuratedHistory(this.history)
|
|
298
|
+
: this.history;
|
|
299
|
+
// Deep copy the history to avoid mutating the history outside of the
|
|
300
|
+
// chat session.
|
|
301
|
+
return structuredClone(history);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
clearHistory(): void {
|
|
305
|
+
this.history = [];
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
addHistory(content: Content): void {
|
|
309
|
+
this.history.push(content);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
setHistory(history: Content[]): void {
|
|
313
|
+
this.history = history;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
private async *processStreamResponse(
|
|
317
|
+
model: string,
|
|
318
|
+
streamResponse: AsyncGenerator<GenerateContentResponse>,
|
|
319
|
+
): AsyncGenerator<GenerateContentResponse> {
|
|
320
|
+
const modelResponseParts: Part[] = [];
|
|
321
|
+
|
|
322
|
+
let hasFinishReason = false;
|
|
323
|
+
|
|
324
|
+
for await (const chunk of streamResponse) {
|
|
325
|
+
hasFinishReason =
|
|
326
|
+
chunk?.candidates?.some((candidate) => candidate.finishReason) ?? false;
|
|
327
|
+
if (isValidResponse(chunk)) {
|
|
328
|
+
const content = chunk.candidates?.[0]?.content;
|
|
329
|
+
if (content?.parts) {
|
|
330
|
+
modelResponseParts.push(
|
|
331
|
+
...content.parts.filter((part) => !part.thought),
|
|
332
|
+
);
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
yield chunk; // Yield every chunk to the UI immediately.
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
// String thoughts and consolidate text parts.
|
|
340
|
+
const consolidatedParts: Part[] = [];
|
|
341
|
+
for (const part of modelResponseParts) {
|
|
342
|
+
const lastPart = consolidatedParts[consolidatedParts.length - 1];
|
|
343
|
+
if (
|
|
344
|
+
lastPart?.text &&
|
|
345
|
+
isValidNonThoughtTextPart(lastPart) &&
|
|
346
|
+
isValidNonThoughtTextPart(part)
|
|
347
|
+
) {
|
|
348
|
+
lastPart.text += part.text;
|
|
349
|
+
} else {
|
|
350
|
+
consolidatedParts.push(part);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
const responseText = consolidatedParts
|
|
355
|
+
.filter((part) => part.text)
|
|
356
|
+
.map((part) => part.text)
|
|
357
|
+
.join('')
|
|
358
|
+
.trim();
|
|
359
|
+
|
|
360
|
+
if (!hasFinishReason || !responseText) {
|
|
361
|
+
if (!hasFinishReason) {
|
|
362
|
+
throw new InvalidStreamError(
|
|
363
|
+
'Model stream ended without a finish reason.',
|
|
364
|
+
'NO_FINISH_REASON',
|
|
365
|
+
);
|
|
366
|
+
} else {
|
|
367
|
+
throw new InvalidStreamError(
|
|
368
|
+
'Model stream ended with empty response text.',
|
|
369
|
+
'NO_RESPONSE_TEXT',
|
|
370
|
+
);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
this.history.push({ role: 'model', parts: consolidatedParts });
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
/** Visible for Testing */
|
|
379
|
+
export function isSchemaDepthError(errorMessage: string): boolean {
|
|
380
|
+
return errorMessage.includes('maximum schema depth exceeded');
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
export function isInvalidArgumentError(errorMessage: string): boolean {
|
|
384
|
+
return errorMessage.includes('Request contains an invalid argument');
|
|
385
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { type PartListUnion } from '@google/genai';
|
|
8
|
+
import { partToString } from '../utils/partUtils';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Represents a request to be sent to the Gemini API.
|
|
12
|
+
* For now, it's an alias to PartListUnion as the primary content.
|
|
13
|
+
* This can be expanded later to include other request parameters.
|
|
14
|
+
*/
|
|
15
|
+
export type GeminiCodeRequest = PartListUnion;
|
|
16
|
+
|
|
17
|
+
export function partListUnionToString(value: PartListUnion): string {
|
|
18
|
+
return partToString(value, { verbose: true });
|
|
19
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import path from 'node:path';
|
|
8
|
+
import fs from 'node:fs';
|
|
9
|
+
import os from 'node:os';
|
|
10
|
+
import process from 'node:process';
|
|
11
|
+
|
|
12
|
+
export const GEMINI_CONFIG_DIR = '.gemini';
|
|
13
|
+
|
|
14
|
+
export function resolvePathFromEnv(envVar?: string): {
|
|
15
|
+
isSwitch: boolean;
|
|
16
|
+
value: string | null;
|
|
17
|
+
isDisabled: boolean;
|
|
18
|
+
} {
|
|
19
|
+
// Handle the case where the environment variable is not set, empty, or just whitespace.
|
|
20
|
+
const trimmedEnvVar = envVar?.trim();
|
|
21
|
+
if (!trimmedEnvVar) {
|
|
22
|
+
return { isSwitch: false, value: null, isDisabled: false };
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const lowerEnvVar = trimmedEnvVar.toLowerCase();
|
|
26
|
+
// Check if the input is a common boolean-like string.
|
|
27
|
+
if (['0', 'false', '1', 'true'].includes(lowerEnvVar)) {
|
|
28
|
+
// If so, identify it as a "switch" and return its value.
|
|
29
|
+
const isDisabled = ['0', 'false'].includes(lowerEnvVar);
|
|
30
|
+
return { isSwitch: true, value: lowerEnvVar, isDisabled };
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// If it's not a switch, treat it as a potential file path.
|
|
34
|
+
let customPath = trimmedEnvVar;
|
|
35
|
+
|
|
36
|
+
// Safely expand the tilde (~) character to the user's home directory.
|
|
37
|
+
if (customPath.startsWith('~/') || customPath === '~') {
|
|
38
|
+
try {
|
|
39
|
+
const home = os.homedir(); // This is the call that can throw an error.
|
|
40
|
+
if (customPath === '~') {
|
|
41
|
+
customPath = home;
|
|
42
|
+
} else {
|
|
43
|
+
customPath = path.join(home, customPath.slice(2));
|
|
44
|
+
}
|
|
45
|
+
} catch (error) {
|
|
46
|
+
// If os.homedir() fails, we catch the error instead of crashing.
|
|
47
|
+
console.warn(
|
|
48
|
+
`Could not resolve home directory for path: ${trimmedEnvVar}`,
|
|
49
|
+
error,
|
|
50
|
+
);
|
|
51
|
+
// Return null to indicate the path resolution failed.
|
|
52
|
+
return { isSwitch: false, value: null, isDisabled: false };
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Return it as a non-switch with the fully resolved absolute path.
|
|
57
|
+
return {
|
|
58
|
+
isSwitch: false,
|
|
59
|
+
value: path.resolve(customPath),
|
|
60
|
+
isDisabled: false,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function getCoreSystemPrompt(): string {
|
|
65
|
+
// A flag to indicate whether the system prompt override is active.
|
|
66
|
+
let systemMdEnabled = false;
|
|
67
|
+
// The default path for the system prompt file. This can be overridden.
|
|
68
|
+
let systemMdPath = path.resolve(path.join(GEMINI_CONFIG_DIR, 'system.md'));
|
|
69
|
+
// Resolve the environment variable to get either a path or a switch value.
|
|
70
|
+
const systemMdResolution = resolvePathFromEnv(
|
|
71
|
+
process.env['GEMINI_SYSTEM_MD'],
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
// Proceed only if the environment variable is set and is not disabled.
|
|
75
|
+
if (systemMdResolution.value && !systemMdResolution.isDisabled) {
|
|
76
|
+
systemMdEnabled = true;
|
|
77
|
+
|
|
78
|
+
// We update systemMdPath to this new custom path.
|
|
79
|
+
if (!systemMdResolution.isSwitch) {
|
|
80
|
+
systemMdPath = systemMdResolution.value;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// require file to exist when override is enabled
|
|
84
|
+
if (!fs.existsSync(systemMdPath)) {
|
|
85
|
+
throw new Error(`missing system prompt file '${systemMdPath}'`);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
const basePrompt = systemMdEnabled
|
|
89
|
+
? fs.readFileSync(systemMdPath, 'utf8')
|
|
90
|
+
: `You are a helpful assistant.`;
|
|
91
|
+
|
|
92
|
+
// if GEMINI_WRITE_SYSTEM_MD is set (and not 0|false), write base system prompt to file
|
|
93
|
+
const writeSystemMdResolution = resolvePathFromEnv(
|
|
94
|
+
process.env['GEMINI_WRITE_SYSTEM_MD'],
|
|
95
|
+
);
|
|
96
|
+
|
|
97
|
+
// Check if the feature is enabled. This proceeds only if the environment
|
|
98
|
+
// variable is set and is not explicitly '0' or 'false'.
|
|
99
|
+
if (writeSystemMdResolution.value && !writeSystemMdResolution.isDisabled) {
|
|
100
|
+
const writePath = writeSystemMdResolution.isSwitch
|
|
101
|
+
? systemMdPath
|
|
102
|
+
: writeSystemMdResolution.value;
|
|
103
|
+
|
|
104
|
+
fs.mkdirSync(path.dirname(writePath), { recursive: true });
|
|
105
|
+
fs.writeFileSync(writePath, basePrompt);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
return basePrompt;
|
|
109
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
type Model = string;
|
|
8
|
+
type TokenCount = number;
|
|
9
|
+
|
|
10
|
+
export const DEFAULT_TOKEN_LIMIT = 1_048_576;
|
|
11
|
+
|
|
12
|
+
export function tokenLimit(model: Model): TokenCount {
|
|
13
|
+
// Add other models as they become relevant or if specified by config
|
|
14
|
+
// Pulled from https://ai.google.dev/gemini-api/docs/models
|
|
15
|
+
switch (model) {
|
|
16
|
+
case 'gemini-1.5-pro':
|
|
17
|
+
return 2_097_152;
|
|
18
|
+
case 'gemini-1.5-flash':
|
|
19
|
+
case 'gemini-2.5-pro-preview-05-06':
|
|
20
|
+
case 'gemini-2.5-pro-preview-06-05':
|
|
21
|
+
case 'gemini-2.5-pro':
|
|
22
|
+
case 'gemini-2.5-flash-preview-05-20':
|
|
23
|
+
case 'gemini-2.5-flash':
|
|
24
|
+
case 'gemini-2.5-flash-lite':
|
|
25
|
+
case 'gemini-2.0-flash':
|
|
26
|
+
return 1_048_576;
|
|
27
|
+
case 'gemini-2.0-flash-preview-image-generation':
|
|
28
|
+
return 32_000;
|
|
29
|
+
default:
|
|
30
|
+
return DEFAULT_TOKEN_LIMIT;
|
|
31
|
+
}
|
|
32
|
+
}
|