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.
Files changed (172) hide show
  1. package/CODEMAP.md +3 -11
  2. package/README.md +4 -4
  3. package/backend/.env +2 -2
  4. package/backend/CODEMAP.md +2 -3
  5. package/backend/dist/src/core-entities/llm-call-log.entity.d.ts +1 -1
  6. package/backend/dist/src/core-entities/llm-call-log.entity.js +3 -3
  7. package/backend/dist/src/core-entities/llm-call-log.entity.js.map +1 -1
  8. package/backend/dist/src/core-entities/session.entity.js +2 -2
  9. package/backend/dist/src/core-entities/session.entity.js.map +1 -1
  10. package/backend/dist/src/core-entities/system-prompt.entity.js +1 -1
  11. package/backend/dist/src/core-entities/system-prompt.entity.js.map +1 -1
  12. package/backend/dist/src/llm-call-logs/dto/llm-call-log.dto.d.ts +1 -1
  13. package/backend/dist/src/llm-call-logs/dto/llm-call-log.dto.js +1 -1
  14. package/backend/dist/src/llm-call-logs/dto/llm-call-log.dto.js.map +1 -1
  15. package/backend/dist/src/llm-call-logs/llm-call-logs.controller.js +1 -1
  16. package/backend/dist/src/llm-orchestration/action-handlers/manage-sub-agents.handler.js +1 -1
  17. package/backend/dist/src/llm-orchestration/action-handlers/overwrite-file.handler.js +1 -0
  18. package/backend/dist/src/llm-orchestration/action-handlers/overwrite-file.handler.js.map +1 -1
  19. package/backend/dist/src/llm-orchestration/action-handlers/quick-edit.handler.js +3 -0
  20. package/backend/dist/src/llm-orchestration/action-handlers/quick-edit.handler.js.map +1 -1
  21. package/backend/dist/src/llm-provider/llm-provider.interface.d.ts +3 -9
  22. package/backend/dist/src/llm-provider/llm-provider.interface.js +2 -9
  23. package/backend/dist/src/llm-provider/llm-provider.interface.js.map +1 -1
  24. package/backend/dist/src/llm-provider/llm-provider.module.js +1 -2
  25. package/backend/dist/src/llm-provider/llm-provider.module.js.map +1 -1
  26. package/backend/dist/src/llm-provider/proxy-llm.provider.d.ts +1 -3
  27. package/backend/dist/src/llm-provider/proxy-llm.provider.js +4 -12
  28. package/backend/dist/src/llm-provider/proxy-llm.provider.js.map +1 -1
  29. package/backend/dist/src/llm-responses/dto/sync-conversation.dto.js +2 -2
  30. package/backend/dist/src/llm-responses/dto/sync-conversation.dto.js.map +1 -1
  31. package/backend/dist/src/sessions/dto/session.dto.d.ts +1 -1
  32. package/backend/dist/src/sessions/dto/session.dto.js +7 -7
  33. package/backend/dist/src/sessions/dto/session.dto.js.map +1 -1
  34. package/backend/dist/src/sessions/sessions.service.js +14 -5
  35. package/backend/dist/src/sessions/sessions.service.js.map +1 -1
  36. package/backend/dist/src/sub-agents/dto/create-sub-agent.dto.js +1 -1
  37. package/backend/dist/src/sub-agents/dto/create-sub-agent.dto.js.map +1 -1
  38. package/backend/dist/src/sub-agents/dto/update-sub-agent.dto.js +1 -1
  39. package/backend/dist/src/sub-agents/dto/update-sub-agent.dto.js.map +1 -1
  40. package/backend/dist/src/sub-agents/sub-agent.entity.js +1 -1
  41. package/backend/dist/src/sub-agents/sub-agent.entity.js.map +1 -1
  42. package/backend/dist/src/system-prompts/dto/system-prompt.dto.js +2 -2
  43. package/backend/dist/src/system-prompts/dto/system-prompt.dto.js.map +1 -1
  44. package/backend/dist/tsconfig.build.tsbuildinfo +1 -1
  45. package/package.json +1 -2
  46. package/backend/dist/packages/gemini-core/examples/simple.d.ts +0 -1
  47. package/backend/dist/packages/gemini-core/examples/simple.js +0 -73
  48. package/backend/dist/packages/gemini-core/examples/simple.js.map +0 -1
  49. package/backend/dist/packages/gemini-core/index.d.ts +0 -3
  50. package/backend/dist/packages/gemini-core/index.js +0 -27
  51. package/backend/dist/packages/gemini-core/index.js.map +0 -1
  52. package/backend/dist/packages/gemini-core/src/code_assist/codeAssist.d.ts +0 -5
  53. package/backend/dist/packages/gemini-core/src/code_assist/codeAssist.js +0 -17
  54. package/backend/dist/packages/gemini-core/src/code_assist/codeAssist.js.map +0 -1
  55. package/backend/dist/packages/gemini-core/src/code_assist/converter.d.ts +0 -69
  56. package/backend/dist/packages/gemini-core/src/code_assist/converter.js +0 -129
  57. package/backend/dist/packages/gemini-core/src/code_assist/converter.js.map +0 -1
  58. package/backend/dist/packages/gemini-core/src/code_assist/oauth-credential-storage.d.ts +0 -8
  59. package/backend/dist/packages/gemini-core/src/code_assist/oauth-credential-storage.js +0 -84
  60. package/backend/dist/packages/gemini-core/src/code_assist/oauth-credential-storage.js.map +0 -1
  61. package/backend/dist/packages/gemini-core/src/code_assist/oauth2.d.ts +0 -12
  62. package/backend/dist/packages/gemini-core/src/code_assist/oauth2.js +0 -371
  63. package/backend/dist/packages/gemini-core/src/code_assist/oauth2.js.map +0 -1
  64. package/backend/dist/packages/gemini-core/src/code_assist/server.d.ts +0 -28
  65. package/backend/dist/packages/gemini-core/src/code_assist/server.js +0 -135
  66. package/backend/dist/packages/gemini-core/src/code_assist/server.js.map +0 -1
  67. package/backend/dist/packages/gemini-core/src/code_assist/setup.d.ts +0 -10
  68. package/backend/dist/packages/gemini-core/src/code_assist/setup.js +0 -94
  69. package/backend/dist/packages/gemini-core/src/code_assist/setup.js.map +0 -1
  70. package/backend/dist/packages/gemini-core/src/code_assist/types.d.ts +0 -106
  71. package/backend/dist/packages/gemini-core/src/code_assist/types.js +0 -28
  72. package/backend/dist/packages/gemini-core/src/code_assist/types.js.map +0 -1
  73. package/backend/dist/packages/gemini-core/src/config/config.d.ts +0 -22
  74. package/backend/dist/packages/gemini-core/src/config/config.js +0 -38
  75. package/backend/dist/packages/gemini-core/src/config/config.js.map +0 -1
  76. package/backend/dist/packages/gemini-core/src/config/models.d.ts +0 -6
  77. package/backend/dist/packages/gemini-core/src/config/models.js +0 -13
  78. package/backend/dist/packages/gemini-core/src/config/models.js.map +0 -1
  79. package/backend/dist/packages/gemini-core/src/config/storage.d.ts +0 -8
  80. package/backend/dist/packages/gemini-core/src/config/storage.js +0 -25
  81. package/backend/dist/packages/gemini-core/src/config/storage.js.map +0 -1
  82. package/backend/dist/packages/gemini-core/src/core/contentGenerator.d.ts +0 -23
  83. package/backend/dist/packages/gemini-core/src/core/contentGenerator.js +0 -63
  84. package/backend/dist/packages/gemini-core/src/core/contentGenerator.js.map +0 -1
  85. package/backend/dist/packages/gemini-core/src/core/geminiChat.d.ts +0 -34
  86. package/backend/dist/packages/gemini-core/src/core/geminiChat.js +0 -247
  87. package/backend/dist/packages/gemini-core/src/core/geminiChat.js.map +0 -1
  88. package/backend/dist/packages/gemini-core/src/core/geminiRequest.d.ts +0 -3
  89. package/backend/dist/packages/gemini-core/src/core/geminiRequest.js +0 -8
  90. package/backend/dist/packages/gemini-core/src/core/geminiRequest.js.map +0 -1
  91. package/backend/dist/packages/gemini-core/src/core/prompts.d.ts +0 -7
  92. package/backend/dist/packages/gemini-core/src/core/prompts.js +0 -69
  93. package/backend/dist/packages/gemini-core/src/core/prompts.js.map +0 -1
  94. package/backend/dist/packages/gemini-core/src/core/tokenLimits.d.ts +0 -5
  95. package/backend/dist/packages/gemini-core/src/core/tokenLimits.js +0 -25
  96. package/backend/dist/packages/gemini-core/src/core/tokenLimits.js.map +0 -1
  97. package/backend/dist/packages/gemini-core/src/index.d.ts +0 -18
  98. package/backend/dist/packages/gemini-core/src/index.js +0 -37
  99. package/backend/dist/packages/gemini-core/src/index.js.map +0 -1
  100. package/backend/dist/packages/gemini-core/src/mcp/token-storage/base-token-storage.d.ts +0 -14
  101. package/backend/dist/packages/gemini-core/src/mcp/token-storage/base-token-storage.js +0 -34
  102. package/backend/dist/packages/gemini-core/src/mcp/token-storage/base-token-storage.js.map +0 -1
  103. package/backend/dist/packages/gemini-core/src/mcp/token-storage/file-token-storage.d.ts +0 -19
  104. package/backend/dist/packages/gemini-core/src/mcp/token-storage/file-token-storage.js +0 -141
  105. package/backend/dist/packages/gemini-core/src/mcp/token-storage/file-token-storage.js.map +0 -1
  106. package/backend/dist/packages/gemini-core/src/mcp/token-storage/hybrid-token-storage.d.ts +0 -18
  107. package/backend/dist/packages/gemini-core/src/mcp/token-storage/hybrid-token-storage.js +0 -74
  108. package/backend/dist/packages/gemini-core/src/mcp/token-storage/hybrid-token-storage.js.map +0 -1
  109. package/backend/dist/packages/gemini-core/src/mcp/token-storage/index.d.ts +0 -6
  110. package/backend/dist/packages/gemini-core/src/mcp/token-storage/index.js +0 -24
  111. package/backend/dist/packages/gemini-core/src/mcp/token-storage/index.js.map +0 -1
  112. package/backend/dist/packages/gemini-core/src/mcp/token-storage/keychain-token-storage.d.ts +0 -26
  113. package/backend/dist/packages/gemini-core/src/mcp/token-storage/keychain-token-storage.js +0 -188
  114. package/backend/dist/packages/gemini-core/src/mcp/token-storage/keychain-token-storage.js.map +0 -1
  115. package/backend/dist/packages/gemini-core/src/mcp/token-storage/types.d.ts +0 -27
  116. package/backend/dist/packages/gemini-core/src/mcp/token-storage/types.js +0 -9
  117. package/backend/dist/packages/gemini-core/src/mcp/token-storage/types.js.map +0 -1
  118. package/backend/dist/packages/gemini-core/src/utils/errors.d.ts +0 -34
  119. package/backend/dist/packages/gemini-core/src/utils/errors.js +0 -103
  120. package/backend/dist/packages/gemini-core/src/utils/errors.js.map +0 -1
  121. package/backend/dist/packages/gemini-core/src/utils/partUtils.d.ts +0 -7
  122. package/backend/dist/packages/gemini-core/src/utils/partUtils.js +0 -108
  123. package/backend/dist/packages/gemini-core/src/utils/partUtils.js.map +0 -1
  124. package/backend/dist/packages/gemini-core/src/utils/quotaErrorDetection.d.ts +0 -16
  125. package/backend/dist/packages/gemini-core/src/utils/quotaErrorDetection.js +0 -60
  126. package/backend/dist/packages/gemini-core/src/utils/quotaErrorDetection.js.map +0 -1
  127. package/backend/dist/packages/gemini-core/src/utils/retry.d.ts +0 -14
  128. package/backend/dist/packages/gemini-core/src/utils/retry.js +0 -154
  129. package/backend/dist/packages/gemini-core/src/utils/retry.js.map +0 -1
  130. package/backend/dist/packages/gemini-core/src/utils/session.d.ts +0 -1
  131. package/backend/dist/packages/gemini-core/src/utils/session.js +0 -6
  132. package/backend/dist/packages/gemini-core/src/utils/session.js.map +0 -1
  133. package/backend/dist/packages/gemini-core/src/utils/userAccountManager.d.ts +0 -10
  134. package/backend/dist/packages/gemini-core/src/utils/userAccountManager.js +0 -106
  135. package/backend/dist/packages/gemini-core/src/utils/userAccountManager.js.map +0 -1
  136. package/backend/dist/src/gemini/gemini-llm.provider.d.ts +0 -12
  137. package/backend/dist/src/gemini/gemini-llm.provider.js +0 -126
  138. package/backend/dist/src/gemini/gemini-llm.provider.js.map +0 -1
  139. package/backend/dist/src/gemini/gemini.module.d.ts +0 -2
  140. package/backend/dist/src/gemini/gemini.module.js +0 -21
  141. package/backend/dist/src/gemini/gemini.module.js.map +0 -1
  142. package/backend/packages/gemini-core/CODEMAP.md +0 -30
  143. package/backend/packages/gemini-core/examples/simple.ts +0 -120
  144. package/backend/packages/gemini-core/index.ts +0 -15
  145. package/backend/packages/gemini-core/src/code_assist/codeAssist.ts +0 -37
  146. package/backend/packages/gemini-core/src/code_assist/converter.ts +0 -250
  147. package/backend/packages/gemini-core/src/code_assist/oauth-credential-storage.ts +0 -129
  148. package/backend/packages/gemini-core/src/code_assist/oauth2.ts +0 -541
  149. package/backend/packages/gemini-core/src/code_assist/server.ts +0 -236
  150. package/backend/packages/gemini-core/src/code_assist/setup.ts +0 -124
  151. package/backend/packages/gemini-core/src/code_assist/types.ts +0 -201
  152. package/backend/packages/gemini-core/src/config/config.ts +0 -75
  153. package/backend/packages/gemini-core/src/config/models.ts +0 -23
  154. package/backend/packages/gemini-core/src/config/storage.ts +0 -30
  155. package/backend/packages/gemini-core/src/core/contentGenerator.ts +0 -136
  156. package/backend/packages/gemini-core/src/core/geminiChat.ts +0 -385
  157. package/backend/packages/gemini-core/src/core/geminiRequest.ts +0 -19
  158. package/backend/packages/gemini-core/src/core/prompts.ts +0 -109
  159. package/backend/packages/gemini-core/src/core/tokenLimits.ts +0 -32
  160. package/backend/packages/gemini-core/src/index.ts +0 -35
  161. package/backend/packages/gemini-core/src/mcp/token-storage/base-token-storage.ts +0 -49
  162. package/backend/packages/gemini-core/src/mcp/token-storage/file-token-storage.ts +0 -184
  163. package/backend/packages/gemini-core/src/mcp/token-storage/hybrid-token-storage.ts +0 -97
  164. package/backend/packages/gemini-core/src/mcp/token-storage/index.ts +0 -14
  165. package/backend/packages/gemini-core/src/mcp/token-storage/keychain-token-storage.ts +0 -251
  166. package/backend/packages/gemini-core/src/mcp/token-storage/types.ts +0 -42
  167. package/backend/packages/gemini-core/src/utils/errors.ts +0 -112
  168. package/backend/packages/gemini-core/src/utils/partUtils.ts +0 -169
  169. package/backend/packages/gemini-core/src/utils/quotaErrorDetection.ts +0 -102
  170. package/backend/packages/gemini-core/src/utils/retry.ts +0 -265
  171. package/backend/packages/gemini-core/src/utils/session.ts +0 -9
  172. 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
- }