repoburg 1.3.136 → 1.3.138
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/CODEMAP.md +3 -11
- package/README.md +4 -4
- package/backend/.env +2 -2
- package/backend/CODEMAP.md +2 -3
- package/backend/dist/src/core-entities/llm-call-log.entity.d.ts +1 -1
- package/backend/dist/src/core-entities/llm-call-log.entity.js +3 -3
- package/backend/dist/src/core-entities/llm-call-log.entity.js.map +1 -1
- package/backend/dist/src/core-entities/session.entity.js +2 -2
- package/backend/dist/src/core-entities/session.entity.js.map +1 -1
- package/backend/dist/src/core-entities/system-prompt.entity.js +1 -1
- package/backend/dist/src/core-entities/system-prompt.entity.js.map +1 -1
- package/backend/dist/src/llm-call-logs/dto/llm-call-log.dto.d.ts +1 -1
- package/backend/dist/src/llm-call-logs/dto/llm-call-log.dto.js +1 -1
- package/backend/dist/src/llm-call-logs/dto/llm-call-log.dto.js.map +1 -1
- package/backend/dist/src/llm-call-logs/llm-call-logs.controller.js +1 -1
- package/backend/dist/src/llm-orchestration/action-handlers/manage-sub-agents.handler.js +1 -1
- package/backend/dist/src/llm-orchestration/action-handlers/overwrite-file.handler.js +1 -0
- package/backend/dist/src/llm-orchestration/action-handlers/overwrite-file.handler.js.map +1 -1
- package/backend/dist/src/llm-orchestration/action-handlers/quick-edit.handler.js +3 -0
- package/backend/dist/src/llm-orchestration/action-handlers/quick-edit.handler.js.map +1 -1
- package/backend/dist/src/llm-provider/llm-provider.interface.d.ts +3 -9
- package/backend/dist/src/llm-provider/llm-provider.interface.js +2 -9
- package/backend/dist/src/llm-provider/llm-provider.interface.js.map +1 -1
- package/backend/dist/src/llm-provider/llm-provider.module.js +1 -2
- package/backend/dist/src/llm-provider/llm-provider.module.js.map +1 -1
- package/backend/dist/src/llm-provider/proxy-llm.provider.d.ts +1 -3
- package/backend/dist/src/llm-provider/proxy-llm.provider.js +4 -12
- package/backend/dist/src/llm-provider/proxy-llm.provider.js.map +1 -1
- package/backend/dist/src/llm-responses/dto/sync-conversation.dto.js +2 -2
- package/backend/dist/src/llm-responses/dto/sync-conversation.dto.js.map +1 -1
- package/backend/dist/src/sessions/dto/session.dto.d.ts +1 -1
- package/backend/dist/src/sessions/dto/session.dto.js +7 -7
- package/backend/dist/src/sessions/dto/session.dto.js.map +1 -1
- package/backend/dist/src/sessions/sessions.service.js +14 -5
- package/backend/dist/src/sessions/sessions.service.js.map +1 -1
- package/backend/dist/src/sub-agents/dto/create-sub-agent.dto.js +1 -1
- package/backend/dist/src/sub-agents/dto/create-sub-agent.dto.js.map +1 -1
- package/backend/dist/src/sub-agents/dto/update-sub-agent.dto.js +1 -1
- package/backend/dist/src/sub-agents/dto/update-sub-agent.dto.js.map +1 -1
- package/backend/dist/src/sub-agents/sub-agent.entity.js +1 -1
- package/backend/dist/src/sub-agents/sub-agent.entity.js.map +1 -1
- package/backend/dist/src/system-prompts/dto/system-prompt.dto.js +2 -2
- package/backend/dist/src/system-prompts/dto/system-prompt.dto.js.map +1 -1
- package/backend/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -2
- package/backend/dist/packages/gemini-core/examples/simple.d.ts +0 -1
- package/backend/dist/packages/gemini-core/examples/simple.js +0 -73
- package/backend/dist/packages/gemini-core/examples/simple.js.map +0 -1
- package/backend/dist/packages/gemini-core/index.d.ts +0 -3
- package/backend/dist/packages/gemini-core/index.js +0 -27
- package/backend/dist/packages/gemini-core/index.js.map +0 -1
- package/backend/dist/packages/gemini-core/src/code_assist/codeAssist.d.ts +0 -5
- package/backend/dist/packages/gemini-core/src/code_assist/codeAssist.js +0 -17
- package/backend/dist/packages/gemini-core/src/code_assist/codeAssist.js.map +0 -1
- package/backend/dist/packages/gemini-core/src/code_assist/converter.d.ts +0 -69
- package/backend/dist/packages/gemini-core/src/code_assist/converter.js +0 -129
- package/backend/dist/packages/gemini-core/src/code_assist/converter.js.map +0 -1
- package/backend/dist/packages/gemini-core/src/code_assist/oauth-credential-storage.d.ts +0 -8
- package/backend/dist/packages/gemini-core/src/code_assist/oauth-credential-storage.js +0 -84
- package/backend/dist/packages/gemini-core/src/code_assist/oauth-credential-storage.js.map +0 -1
- package/backend/dist/packages/gemini-core/src/code_assist/oauth2.d.ts +0 -12
- package/backend/dist/packages/gemini-core/src/code_assist/oauth2.js +0 -371
- package/backend/dist/packages/gemini-core/src/code_assist/oauth2.js.map +0 -1
- package/backend/dist/packages/gemini-core/src/code_assist/server.d.ts +0 -28
- package/backend/dist/packages/gemini-core/src/code_assist/server.js +0 -135
- package/backend/dist/packages/gemini-core/src/code_assist/server.js.map +0 -1
- package/backend/dist/packages/gemini-core/src/code_assist/setup.d.ts +0 -10
- package/backend/dist/packages/gemini-core/src/code_assist/setup.js +0 -94
- package/backend/dist/packages/gemini-core/src/code_assist/setup.js.map +0 -1
- package/backend/dist/packages/gemini-core/src/code_assist/types.d.ts +0 -106
- package/backend/dist/packages/gemini-core/src/code_assist/types.js +0 -28
- package/backend/dist/packages/gemini-core/src/code_assist/types.js.map +0 -1
- package/backend/dist/packages/gemini-core/src/config/config.d.ts +0 -22
- package/backend/dist/packages/gemini-core/src/config/config.js +0 -38
- package/backend/dist/packages/gemini-core/src/config/config.js.map +0 -1
- package/backend/dist/packages/gemini-core/src/config/models.d.ts +0 -6
- package/backend/dist/packages/gemini-core/src/config/models.js +0 -13
- package/backend/dist/packages/gemini-core/src/config/models.js.map +0 -1
- package/backend/dist/packages/gemini-core/src/config/storage.d.ts +0 -8
- package/backend/dist/packages/gemini-core/src/config/storage.js +0 -25
- package/backend/dist/packages/gemini-core/src/config/storage.js.map +0 -1
- package/backend/dist/packages/gemini-core/src/core/contentGenerator.d.ts +0 -23
- package/backend/dist/packages/gemini-core/src/core/contentGenerator.js +0 -63
- package/backend/dist/packages/gemini-core/src/core/contentGenerator.js.map +0 -1
- package/backend/dist/packages/gemini-core/src/core/geminiChat.d.ts +0 -34
- package/backend/dist/packages/gemini-core/src/core/geminiChat.js +0 -247
- package/backend/dist/packages/gemini-core/src/core/geminiChat.js.map +0 -1
- package/backend/dist/packages/gemini-core/src/core/geminiRequest.d.ts +0 -3
- package/backend/dist/packages/gemini-core/src/core/geminiRequest.js +0 -8
- package/backend/dist/packages/gemini-core/src/core/geminiRequest.js.map +0 -1
- package/backend/dist/packages/gemini-core/src/core/prompts.d.ts +0 -7
- package/backend/dist/packages/gemini-core/src/core/prompts.js +0 -69
- package/backend/dist/packages/gemini-core/src/core/prompts.js.map +0 -1
- package/backend/dist/packages/gemini-core/src/core/tokenLimits.d.ts +0 -5
- package/backend/dist/packages/gemini-core/src/core/tokenLimits.js +0 -25
- package/backend/dist/packages/gemini-core/src/core/tokenLimits.js.map +0 -1
- package/backend/dist/packages/gemini-core/src/index.d.ts +0 -18
- package/backend/dist/packages/gemini-core/src/index.js +0 -37
- package/backend/dist/packages/gemini-core/src/index.js.map +0 -1
- package/backend/dist/packages/gemini-core/src/mcp/token-storage/base-token-storage.d.ts +0 -14
- package/backend/dist/packages/gemini-core/src/mcp/token-storage/base-token-storage.js +0 -34
- package/backend/dist/packages/gemini-core/src/mcp/token-storage/base-token-storage.js.map +0 -1
- package/backend/dist/packages/gemini-core/src/mcp/token-storage/file-token-storage.d.ts +0 -19
- package/backend/dist/packages/gemini-core/src/mcp/token-storage/file-token-storage.js +0 -141
- package/backend/dist/packages/gemini-core/src/mcp/token-storage/file-token-storage.js.map +0 -1
- package/backend/dist/packages/gemini-core/src/mcp/token-storage/hybrid-token-storage.d.ts +0 -18
- package/backend/dist/packages/gemini-core/src/mcp/token-storage/hybrid-token-storage.js +0 -74
- package/backend/dist/packages/gemini-core/src/mcp/token-storage/hybrid-token-storage.js.map +0 -1
- package/backend/dist/packages/gemini-core/src/mcp/token-storage/index.d.ts +0 -6
- package/backend/dist/packages/gemini-core/src/mcp/token-storage/index.js +0 -24
- package/backend/dist/packages/gemini-core/src/mcp/token-storage/index.js.map +0 -1
- package/backend/dist/packages/gemini-core/src/mcp/token-storage/keychain-token-storage.d.ts +0 -26
- package/backend/dist/packages/gemini-core/src/mcp/token-storage/keychain-token-storage.js +0 -188
- package/backend/dist/packages/gemini-core/src/mcp/token-storage/keychain-token-storage.js.map +0 -1
- package/backend/dist/packages/gemini-core/src/mcp/token-storage/types.d.ts +0 -27
- package/backend/dist/packages/gemini-core/src/mcp/token-storage/types.js +0 -9
- package/backend/dist/packages/gemini-core/src/mcp/token-storage/types.js.map +0 -1
- package/backend/dist/packages/gemini-core/src/utils/errors.d.ts +0 -34
- package/backend/dist/packages/gemini-core/src/utils/errors.js +0 -103
- package/backend/dist/packages/gemini-core/src/utils/errors.js.map +0 -1
- package/backend/dist/packages/gemini-core/src/utils/partUtils.d.ts +0 -7
- package/backend/dist/packages/gemini-core/src/utils/partUtils.js +0 -108
- package/backend/dist/packages/gemini-core/src/utils/partUtils.js.map +0 -1
- package/backend/dist/packages/gemini-core/src/utils/quotaErrorDetection.d.ts +0 -16
- package/backend/dist/packages/gemini-core/src/utils/quotaErrorDetection.js +0 -60
- package/backend/dist/packages/gemini-core/src/utils/quotaErrorDetection.js.map +0 -1
- package/backend/dist/packages/gemini-core/src/utils/retry.d.ts +0 -14
- package/backend/dist/packages/gemini-core/src/utils/retry.js +0 -154
- package/backend/dist/packages/gemini-core/src/utils/retry.js.map +0 -1
- package/backend/dist/packages/gemini-core/src/utils/session.d.ts +0 -1
- package/backend/dist/packages/gemini-core/src/utils/session.js +0 -6
- package/backend/dist/packages/gemini-core/src/utils/session.js.map +0 -1
- package/backend/dist/packages/gemini-core/src/utils/userAccountManager.d.ts +0 -10
- package/backend/dist/packages/gemini-core/src/utils/userAccountManager.js +0 -106
- package/backend/dist/packages/gemini-core/src/utils/userAccountManager.js.map +0 -1
- package/backend/dist/src/gemini/gemini-llm.provider.d.ts +0 -12
- package/backend/dist/src/gemini/gemini-llm.provider.js +0 -126
- package/backend/dist/src/gemini/gemini-llm.provider.js.map +0 -1
- package/backend/dist/src/gemini/gemini.module.d.ts +0 -2
- package/backend/dist/src/gemini/gemini.module.js +0 -21
- package/backend/dist/src/gemini/gemini.module.js.map +0 -1
- package/backend/packages/gemini-core/CODEMAP.md +0 -30
- package/backend/packages/gemini-core/examples/simple.ts +0 -120
- package/backend/packages/gemini-core/index.ts +0 -15
- package/backend/packages/gemini-core/src/code_assist/codeAssist.ts +0 -37
- package/backend/packages/gemini-core/src/code_assist/converter.ts +0 -250
- package/backend/packages/gemini-core/src/code_assist/oauth-credential-storage.ts +0 -129
- package/backend/packages/gemini-core/src/code_assist/oauth2.ts +0 -541
- package/backend/packages/gemini-core/src/code_assist/server.ts +0 -236
- package/backend/packages/gemini-core/src/code_assist/setup.ts +0 -124
- package/backend/packages/gemini-core/src/code_assist/types.ts +0 -201
- package/backend/packages/gemini-core/src/config/config.ts +0 -75
- package/backend/packages/gemini-core/src/config/models.ts +0 -23
- package/backend/packages/gemini-core/src/config/storage.ts +0 -30
- package/backend/packages/gemini-core/src/core/contentGenerator.ts +0 -136
- package/backend/packages/gemini-core/src/core/geminiChat.ts +0 -385
- package/backend/packages/gemini-core/src/core/geminiRequest.ts +0 -19
- package/backend/packages/gemini-core/src/core/prompts.ts +0 -109
- package/backend/packages/gemini-core/src/core/tokenLimits.ts +0 -32
- package/backend/packages/gemini-core/src/index.ts +0 -35
- package/backend/packages/gemini-core/src/mcp/token-storage/base-token-storage.ts +0 -49
- package/backend/packages/gemini-core/src/mcp/token-storage/file-token-storage.ts +0 -184
- package/backend/packages/gemini-core/src/mcp/token-storage/hybrid-token-storage.ts +0 -97
- package/backend/packages/gemini-core/src/mcp/token-storage/index.ts +0 -14
- package/backend/packages/gemini-core/src/mcp/token-storage/keychain-token-storage.ts +0 -251
- package/backend/packages/gemini-core/src/mcp/token-storage/types.ts +0 -42
- package/backend/packages/gemini-core/src/utils/errors.ts +0 -112
- package/backend/packages/gemini-core/src/utils/partUtils.ts +0 -169
- package/backend/packages/gemini-core/src/utils/quotaErrorDetection.ts +0 -102
- package/backend/packages/gemini-core/src/utils/retry.ts +0 -265
- package/backend/packages/gemini-core/src/utils/session.ts +0 -9
- package/backend/packages/gemini-core/src/utils/userAccountManager.ts +0 -140
|
@@ -1,140 +0,0 @@
|
|
|
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 { promises as fsp, readFileSync } from 'node:fs';
|
|
9
|
-
import { Storage } from '../config/storage';
|
|
10
|
-
|
|
11
|
-
interface UserAccounts {
|
|
12
|
-
active: string | null;
|
|
13
|
-
old: string[];
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export class UserAccountManager {
|
|
17
|
-
private getGoogleAccountsCachePath(): string {
|
|
18
|
-
return Storage.getGoogleAccountsPath();
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Parses and validates the string content of an accounts file.
|
|
23
|
-
* @param content The raw string content from the file.
|
|
24
|
-
* @returns A valid UserAccounts object.
|
|
25
|
-
*/
|
|
26
|
-
private parseAndValidateAccounts(content: string): UserAccounts {
|
|
27
|
-
const defaultState = { active: null, old: [] };
|
|
28
|
-
if (!content.trim()) {
|
|
29
|
-
return defaultState;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const parsed = JSON.parse(content);
|
|
33
|
-
|
|
34
|
-
// Inlined validation logic
|
|
35
|
-
if (typeof parsed !== 'object' || parsed === null) {
|
|
36
|
-
console.log('Invalid accounts file schema, starting fresh.');
|
|
37
|
-
return defaultState;
|
|
38
|
-
}
|
|
39
|
-
const { active, old } = parsed as Partial<UserAccounts>;
|
|
40
|
-
const isValid =
|
|
41
|
-
(active === undefined || active === null || typeof active === 'string') &&
|
|
42
|
-
(old === undefined ||
|
|
43
|
-
(Array.isArray(old) && old.every((i) => typeof i === 'string')));
|
|
44
|
-
|
|
45
|
-
if (!isValid) {
|
|
46
|
-
console.log('Invalid accounts file schema, starting fresh.');
|
|
47
|
-
return defaultState;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return {
|
|
51
|
-
active: parsed.active ?? null,
|
|
52
|
-
old: parsed.old ?? [],
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
private readAccountsSync(filePath: string): UserAccounts {
|
|
57
|
-
const defaultState = { active: null, old: [] };
|
|
58
|
-
try {
|
|
59
|
-
const content = readFileSync(filePath, 'utf-8');
|
|
60
|
-
return this.parseAndValidateAccounts(content);
|
|
61
|
-
} catch (error) {
|
|
62
|
-
if (
|
|
63
|
-
error instanceof Error &&
|
|
64
|
-
'code' in error &&
|
|
65
|
-
error.code === 'ENOENT'
|
|
66
|
-
) {
|
|
67
|
-
return defaultState;
|
|
68
|
-
}
|
|
69
|
-
console.log('Error during sync read of accounts, starting fresh.', error);
|
|
70
|
-
return defaultState;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
private async readAccounts(filePath: string): Promise<UserAccounts> {
|
|
75
|
-
const defaultState = { active: null, old: [] };
|
|
76
|
-
try {
|
|
77
|
-
const content = await fsp.readFile(filePath, 'utf-8');
|
|
78
|
-
return this.parseAndValidateAccounts(content);
|
|
79
|
-
} catch (error) {
|
|
80
|
-
if (
|
|
81
|
-
error instanceof Error &&
|
|
82
|
-
'code' in error &&
|
|
83
|
-
error.code === 'ENOENT'
|
|
84
|
-
) {
|
|
85
|
-
return defaultState;
|
|
86
|
-
}
|
|
87
|
-
console.log('Could not parse accounts file, starting fresh.', error);
|
|
88
|
-
return defaultState;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
async cacheGoogleAccount(email: string): Promise<void> {
|
|
93
|
-
const filePath = this.getGoogleAccountsCachePath();
|
|
94
|
-
await fsp.mkdir(path.dirname(filePath), { recursive: true });
|
|
95
|
-
|
|
96
|
-
const accounts = await this.readAccounts(filePath);
|
|
97
|
-
|
|
98
|
-
if (accounts.active && accounts.active !== email) {
|
|
99
|
-
if (!accounts.old.includes(accounts.active)) {
|
|
100
|
-
accounts.old.push(accounts.active);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
// If the new email was in the old list, remove it
|
|
105
|
-
accounts.old = accounts.old.filter((oldEmail) => oldEmail !== email);
|
|
106
|
-
|
|
107
|
-
accounts.active = email;
|
|
108
|
-
await fsp.writeFile(filePath, JSON.stringify(accounts, null, 2), 'utf-8');
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
getCachedGoogleAccount(): string | null {
|
|
112
|
-
const filePath = this.getGoogleAccountsCachePath();
|
|
113
|
-
const accounts = this.readAccountsSync(filePath);
|
|
114
|
-
return accounts.active;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
getLifetimeGoogleAccounts(): number {
|
|
118
|
-
const filePath = this.getGoogleAccountsCachePath();
|
|
119
|
-
const accounts = this.readAccountsSync(filePath);
|
|
120
|
-
const allAccounts = new Set(accounts.old);
|
|
121
|
-
if (accounts.active) {
|
|
122
|
-
allAccounts.add(accounts.active);
|
|
123
|
-
}
|
|
124
|
-
return allAccounts.size;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
async clearCachedGoogleAccount(): Promise<void> {
|
|
128
|
-
const filePath = this.getGoogleAccountsCachePath();
|
|
129
|
-
const accounts = await this.readAccounts(filePath);
|
|
130
|
-
|
|
131
|
-
if (accounts.active) {
|
|
132
|
-
if (!accounts.old.includes(accounts.active)) {
|
|
133
|
-
accounts.old.push(accounts.active);
|
|
134
|
-
}
|
|
135
|
-
accounts.active = null;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
await fsp.writeFile(filePath, JSON.stringify(accounts, null, 2), 'utf-8');
|
|
139
|
-
}
|
|
140
|
-
}
|