free-antigravity-cli 1.0.5 → 1.0.7

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 CHANGED
@@ -31,7 +31,7 @@ Use **OpenAI, Anthropic, Ollama, OpenRouter, Google AI Studio, and any OpenAI-co
31
31
 
32
32
  ```
33
33
  antigravity
34
- ├── Starts local proxy (port 50999)
34
+ ├── Starts local proxy (port 50998)
35
35
  ├── Auto-patches agy.exe to route through proxy
36
36
  └── Delegates to agy CLI
37
37
  ├── Google models → daily-cloudcode-pa.googleapis.com (transparent)
@@ -183,7 +183,7 @@ On first run, the CLI automatically patches `agy` to replace the hardcoded Googl
183
183
 
184
184
  ```
185
185
  https://daily-cloudcode-pa.googleapis.com
186
- → http://localhost:50999/v1internal/xxxxxxx
186
+ → http://localhost:50998/v1internal/xxxxxxx
187
187
  ```
188
188
 
189
189
  This forces `agy` to route its `fetchAvailableModels` calls through the local proxy, where custom model definitions are injected.
@@ -195,7 +195,7 @@ On macOS, patching the binary invalidates its code signature. The CLI automatica
195
195
 
196
196
  ### Proxy Server
197
197
 
198
- The proxy runs on `http://127.0.0.1:50999` and:
198
+ The proxy runs on `http://127.0.0.1:50998` and:
199
199
 
200
200
  1. **Intercepts `fetchAvailableModels`**: Merges custom model definitions into the response
201
201
  2. **Intercepts `generateContent`/`streamGenerateContent`**: Routes custom model requests to external APIs
package/dist/cli.js CHANGED
@@ -92,7 +92,7 @@ async function ensureProxy() {
92
92
  return await (0, proxy_1.startProxy)();
93
93
  }
94
94
  catch {
95
- return (0, proxy_1.getProxyPort)() || 50999;
95
+ return (0, proxy_1.getProxyPort)() || 50998;
96
96
  }
97
97
  }
98
98
  function getVersion() {
@@ -112,7 +112,7 @@ function ensureAgyPatched(binPath) {
112
112
  try {
113
113
  const buf = fs.readFileSync(binPath);
114
114
  const original = Buffer.from('https://daily-cloudcode-pa.googleapis.com');
115
- const replacement = Buffer.from('http://localhost:50999/v1internal/xxxxxxx');
115
+ const replacement = Buffer.from('http://localhost:50998/v1internal/xxxxxxx');
116
116
  if (buf.includes(replacement))
117
117
  return;
118
118
  const idx = buf.indexOf(original);
package/dist/proxy.js CHANGED
@@ -539,7 +539,7 @@ function handleRequest(req, res) {
539
539
  });
540
540
  }
541
541
  // --- Server Start/Stop ---
542
- function startProxy(port = 50999) {
542
+ function startProxy(port = 50998) {
543
543
  return new Promise((resolve, reject) => {
544
544
  server = http.createServer(handleRequest);
545
545
  server.listen(port, '127.0.0.1', () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "free-antigravity-cli",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "Open-source community CLI for Antigravity - supports custom AI models (OpenAI, Anthropic, Ollama, OpenRouter, Google AI Studio) alongside Gemini",
5
5
  "homepage": "https://github.com/vahapogut/free-antigravity-cli",
6
6
  "author": {
package/src/cli.ts CHANGED
@@ -57,7 +57,7 @@ function getAgyBin(): string {
57
57
 
58
58
  async function ensureProxy(): Promise<number> {
59
59
  try { return await startProxy(); }
60
- catch { return getProxyPort() || 50999; }
60
+ catch { return getProxyPort() || 50998; }
61
61
  }
62
62
 
63
63
  function getVersion(): string {
@@ -76,7 +76,7 @@ function ensureAgyPatched(binPath: string): void {
76
76
  try {
77
77
  const buf = fs.readFileSync(binPath);
78
78
  const original = Buffer.from('https://daily-cloudcode-pa.googleapis.com');
79
- const replacement = Buffer.from('http://localhost:50999/v1internal/xxxxxxx');
79
+ const replacement = Buffer.from('http://localhost:50998/v1internal/xxxxxxx');
80
80
  if (buf.includes(replacement)) return;
81
81
  const idx = buf.indexOf(original);
82
82
  if (idx === -1) return;
package/src/proxy.ts CHANGED
@@ -542,7 +542,7 @@ function handleRequest(req: http.IncomingMessage, res: http.ServerResponse): voi
542
542
 
543
543
  // --- Server Start/Stop ---
544
544
 
545
- export function startProxy(port = 50999): Promise<number> {
545
+ export function startProxy(port = 50998): Promise<number> {
546
546
  return new Promise((resolve, reject) => {
547
547
  server = http.createServer(handleRequest);
548
548
  server.listen(port, '127.0.0.1', () => {
@@ -8,7 +8,7 @@ jest.mock('fs', () => {
8
8
  return {
9
9
  ...originalFs,
10
10
  existsSync: jest.fn((p) => {
11
- if (typeof p === 'string' && p.endsWith('models.json')) return true;
11
+ if (typeof p === 'string' && (p.endsWith('models.json') || p.includes('.free-antigravity'))) return true;
12
12
  return originalFs.existsSync(p);
13
13
  }),
14
14
  readFileSync: jest.fn((p, encoding) => {
@@ -19,7 +19,8 @@ jest.mock('fs', () => {
19
19
  name: 'models/custom-test-model',
20
20
  displayName: 'Custom Test Model',
21
21
  provider: 'openai',
22
- apiKey: 'test-key',
22
+ apiKey: 'enc:dGVzdC1rZXk=', // already encrypted format to bypass migration
23
+ encrypted: true,
23
24
  apiUrl: 'https://api.openai.com/v1/chat/completions',
24
25
  externalModelName: 'gpt-4o'
25
26
  }
@@ -27,6 +28,14 @@ jest.mock('fs', () => {
27
28
  });
28
29
  }
29
30
  return originalFs.readFileSync(p, encoding);
31
+ }),
32
+ writeFileSync: jest.fn((p, data, encoding) => {
33
+ if (typeof p === 'string' && p.endsWith('models.json')) return;
34
+ return originalFs.writeFileSync(p, data, encoding);
35
+ }),
36
+ mkdirSync: jest.fn((p, options) => {
37
+ if (typeof p === 'string' && p.includes('.free-antigravity')) return;
38
+ return originalFs.mkdirSync(p, options);
30
39
  })
31
40
  };
32
41
  });