@agi-cli/sdk 0.1.170 → 0.1.172

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agi-cli/sdk",
3
- "version": "0.1.170",
3
+ "version": "0.1.172",
4
4
  "description": "AI agent SDK for building intelligent assistants - tree-shakable and comprehensive",
5
5
  "author": "nitishxyz",
6
6
  "license": "MIT",
@@ -1,6 +1,6 @@
1
1
  import { spawn } from 'node:child_process';
2
2
 
3
- const CLIENT_ID = 'Ov23li8tweQw6odWQebz';
3
+ const CLIENT_ID = 'Ov23lip6QjVYxHUAeW4d';
4
4
  const POLLING_SAFETY_MARGIN_MS = 3000;
5
5
 
6
6
  const DEVICE_CODE_URL = 'https://github.com/login/device/code';
package/src/browser.ts CHANGED
@@ -28,4 +28,5 @@ export {
28
28
  providerIds,
29
29
  defaultModelFor,
30
30
  hasModel,
31
+ getModelInfo,
31
32
  } from './providers/src/utils.ts';
@@ -58,7 +58,13 @@ async function walkTree(
58
58
  files += sub.files;
59
59
  } else {
60
60
  files++;
61
- lines.push(`${prefix}${connector}${entry.name}`);
61
+ let lineCount = '';
62
+ try {
63
+ const content = await fs.readFile(join(dir, entry.name), 'utf-8');
64
+ const count = content.split('\n').length;
65
+ lineCount = ` (${count} lines)`;
66
+ } catch {}
67
+ lines.push(`${prefix}${connector}${entry.name}${lineCount}`);
62
68
  }
63
69
  }
64
70
  } catch {
@@ -1,8 +1,11 @@
1
- - Render a shallow directory tree from a starting path
1
+ - Render a directory tree from a starting path with line counts for each file
2
2
  - Accepts absolute, home, or project-relative paths
3
3
  - Skips common build/cache folders (node_modules, dist, .git, etc.) by default
4
4
  - Depth is capped to avoid excessive output (1–5)
5
+ - Each file shows its line count (e.g. "index.ts (42 lines)")
5
6
 
6
7
  Usage tips:
7
8
  - Use the LS tool for a flat listing of one directory
8
9
  - Use the Glob and Grep tools for file pattern and content searches respectively
10
+ - Pay attention to line counts: files over 500 lines are large — prefer reading specific line ranges (startLine/endLine) or use Grep to find relevant sections instead of reading the entire file
11
+ - Files over 2000 lines can consume significant context — always use targeted reads or search tools for these
@@ -24,6 +24,11 @@ const isAllowedAnthropicModel = (id: string): boolean => {
24
24
  return false;
25
25
  };
26
26
 
27
+ const isAllowedGoogleModel = (id: string): boolean => {
28
+ if (id.startsWith('gemini-3')) return true;
29
+ return false;
30
+ };
31
+
27
32
  const SETU_SOURCES: Array<{
28
33
  id: ProviderId;
29
34
  npm: string;
@@ -44,6 +49,11 @@ const SETU_SOURCES: Array<{
44
49
  npm: '@ai-sdk/openai-compatible',
45
50
  family: 'moonshot',
46
51
  },
52
+ {
53
+ id: 'google',
54
+ npm: '@ai-sdk/google',
55
+ family: 'google',
56
+ },
47
57
  ];
48
58
 
49
59
  function cloneModel(model: ModelInfo): ModelInfo {
@@ -71,6 +81,7 @@ function buildSetuEntry(base: CatalogMap): ProviderCatalogEntry | null {
71
81
  const sourceModels = allModels.filter((model) => {
72
82
  if (id === 'openai') return isAllowedOpenAIModel(model.id);
73
83
  if (id === 'anthropic') return isAllowedAnthropicModel(model.id);
84
+ if (id === 'google') return isAllowedGoogleModel(model.id);
74
85
  return true;
75
86
  });
76
87
  return sourceModels.map((model) => {
@@ -35,6 +35,5 @@ export function createCopilotModel(model: string, config: CopilotOAuthConfig) {
35
35
  apiKey: 'copilot-oauth',
36
36
  fetch: customFetch,
37
37
  });
38
-
39
38
  return provider.chatModel(model);
40
39
  }
@@ -8,6 +8,7 @@ import nacl from 'tweetnacl';
8
8
  import { createOpenAI } from '@ai-sdk/openai';
9
9
  import { createAnthropic } from '@ai-sdk/anthropic';
10
10
  import { createOpenAICompatible } from '@ai-sdk/openai-compatible';
11
+ import { createGoogleGenerativeAI } from '@ai-sdk/google';
11
12
  import { addAnthropicCacheControl } from './anthropic-caching.ts';
12
13
 
13
14
  function simplifyPaymentError(errMsg: string): string {
@@ -307,6 +308,15 @@ export function createSetuModel(
307
308
  return compatible(model);
308
309
  }
309
310
 
311
+ if (providerNpm === '@ai-sdk/google') {
312
+ const google = createGoogleGenerativeAI({
313
+ baseURL,
314
+ apiKey: 'setu-wallet-auth',
315
+ fetch: customFetch,
316
+ });
317
+ return google(model);
318
+ }
319
+
310
320
  // Default to OpenAI
311
321
  const openai = createOpenAI({
312
322
  baseURL,
@@ -25,30 +25,14 @@ export function hasModel(
25
25
  }
26
26
 
27
27
  const PREFERRED_FAST_MODELS: Partial<Record<ProviderId, string[]>> = {
28
- openai: ['gpt-4o-mini', 'gpt-4.1-nano', 'gpt-4.1-mini'],
29
- anthropic: [
30
- 'claude-3-5-haiku-latest',
31
- 'claude-3-5-haiku-20241022',
32
- 'claude-haiku-4-5',
33
- ],
34
- google: [
35
- 'gemini-2.0-flash-lite',
36
- 'gemini-2.0-flash',
37
- 'gemini-2.5-flash-lite',
38
- ],
39
- openrouter: [
40
- 'anthropic/claude-3.5-haiku',
41
- 'openai/gpt-4o-mini',
42
- 'google/gemini-2.0-flash-001',
43
- ],
44
- opencode: ['claude-3-5-haiku', 'gpt-5-nano', 'gemini-3-flash'],
45
- setu: [
46
- 'claude-3-5-haiku-latest',
47
- 'claude-3-5-haiku-20241022',
48
- 'codex-mini-latest',
49
- ],
50
- zai: ['glm-4.5-flash', 'glm-4.5-air'],
51
- copilot: ['gpt-4o-mini', 'gpt-4.1-nano', 'gpt-4.1-mini'],
28
+ openai: ['gpt-4.1-mini'],
29
+ anthropic: ['claude-3-5-haiku-latest'],
30
+ google: ['gemini-2.0-flash-lite'],
31
+ openrouter: ['anthropic/claude-3.5-haiku'],
32
+ opencode: ['claude-3-5-haiku'],
33
+ setu: ['claude-3-5-haiku-latest'],
34
+ zai: ['glm-4.5-flash'],
35
+ copilot: ['gpt-4.1-mini'],
52
36
  };
53
37
 
54
38
  export function getFastModel(provider: ProviderId): string | undefined {