@google/gemini-cli-core 0.1.10-dev.13 → 0.1.10-dev.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/src/code_assist/oauth2.d.ts +1 -1
  2. package/dist/src/code_assist/oauth2.js +28 -20
  3. package/dist/src/code_assist/oauth2.js.map +1 -1
  4. package/dist/src/code_assist/oauth2.test.js +18 -0
  5. package/dist/src/code_assist/oauth2.test.js.map +1 -1
  6. package/dist/src/core/client.d.ts +0 -1
  7. package/dist/src/core/client.js +9 -10
  8. package/dist/src/core/client.js.map +1 -1
  9. package/dist/src/core/client.test.js +83 -0
  10. package/dist/src/core/client.test.js.map +1 -1
  11. package/dist/src/telemetry/clearcut-logger/clearcut-logger.js +34 -11
  12. package/dist/src/telemetry/clearcut-logger/clearcut-logger.js.map +1 -1
  13. package/dist/src/tools/glob.d.ts +5 -1
  14. package/dist/src/tools/glob.js +5 -1
  15. package/dist/src/tools/glob.js.map +1 -1
  16. package/dist/src/tools/mcp-client.d.ts +7 -0
  17. package/dist/src/tools/mcp-client.js +17 -0
  18. package/dist/src/tools/mcp-client.js.map +1 -1
  19. package/dist/src/tools/shell.d.ts +16 -0
  20. package/dist/src/tools/shell.js +16 -0
  21. package/dist/src/tools/shell.js.map +1 -1
  22. package/dist/src/tools/web-search.d.ts +6 -1
  23. package/dist/src/tools/web-search.js +7 -2
  24. package/dist/src/tools/web-search.js.map +1 -1
  25. package/dist/src/tools/write-file.d.ts +7 -0
  26. package/dist/src/tools/write-file.js +7 -0
  27. package/dist/src/tools/write-file.js.map +1 -1
  28. package/dist/src/utils/user_id.d.ts +1 -1
  29. package/dist/src/utils/user_id.js +5 -5
  30. package/dist/src/utils/user_id.js.map +1 -1
  31. package/dist/src/utils/user_id.test.js +15 -11
  32. package/dist/src/utils/user_id.test.js.map +1 -1
  33. package/dist/tsconfig.tsbuildinfo +1 -1
  34. package/package.json +2 -2
@@ -4,7 +4,7 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import { describe, it, expect } from 'vitest';
7
- import { getInstallationId, getObfuscatedGoogleAccountId } from './user_id.js';
7
+ import { getInstallationId, getGoogleAccountId } from './user_id.js';
8
8
  describe('user_id', () => {
9
9
  describe('getInstallationId', () => {
10
10
  it('should return a valid UUID format string', () => {
@@ -17,21 +17,25 @@ describe('user_id', () => {
17
17
  expect(secondCall).toBe(installationId);
18
18
  });
19
19
  });
20
- describe('getObfuscatedGoogleAccountId', () => {
21
- it('should return a non-empty string', () => {
22
- const result = getObfuscatedGoogleAccountId();
20
+ describe('getGoogleAccountId', () => {
21
+ it('should return a non-empty string', async () => {
22
+ const result = await getGoogleAccountId();
23
23
  expect(result).toBeDefined();
24
24
  expect(typeof result).toBe('string');
25
25
  // Should be consistent on subsequent calls
26
- const secondCall = getObfuscatedGoogleAccountId();
26
+ const secondCall = await getGoogleAccountId();
27
27
  expect(secondCall).toBe(result);
28
28
  });
29
- it('should return empty string when no Google Account ID is cached', () => {
30
- // In a clean test environment, there should be no cached Google Account ID
31
- // so getObfuscatedGoogleAccountId should fall back to installation ID
32
- const googleAccountIdResult = getObfuscatedGoogleAccountId();
33
- // They should be the same when no Google Account ID is cached
34
- expect(googleAccountIdResult).toBe('');
29
+ it('should return empty string when no Google Account ID is cached, or a valid ID when cached', async () => {
30
+ // The function can return either an empty string (if no cached ID) or a valid Google Account ID (if cached)
31
+ const googleAccountIdResult = await getGoogleAccountId();
32
+ expect(googleAccountIdResult).toBeDefined();
33
+ expect(typeof googleAccountIdResult).toBe('string');
34
+ // Should be either empty string or a numeric string (Google Account ID)
35
+ if (googleAccountIdResult !== '') {
36
+ // If we have a cached ID, it should be a numeric string
37
+ expect(googleAccountIdResult).toMatch(/^\d+$/);
38
+ }
35
39
  });
36
40
  });
37
41
  });
@@ -1 +1 @@
1
- {"version":3,"file":"user_id.test.js","sourceRoot":"","sources":["../../../src/utils/user_id.test.ts"],"names":[],"mappings":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