omnigate-ai 1.0.2 → 1.0.3

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
@@ -32,12 +32,39 @@ You will be greeted by a beautiful, glassmorphic UI where you can:
32
32
 
33
33
  ## 🛠️ Integrating with VS Code / AI Agents
34
34
 
35
- To route your AI coding assistant through OmniGate AI:
35
+ ### Continue Extension (VS Code)
36
+
37
+ Replace your `~/.continue/config.yaml` with the following:
38
+
39
+ ```yaml
40
+ name: OmniGate Local Config
41
+ version: 1.0.0
42
+ schema: v1
43
+
44
+ models:
45
+ - name: DeepSeek (via OmniGate)
46
+ provider: openai
47
+ model: deepseek-v4-pro
48
+ apiBase: http://localhost:8080/v1/
49
+ apiKey: your-gateway-secret-key
50
+ roles:
51
+ - chat
52
+ - edit
53
+ - apply
54
+ requestOptions:
55
+ headers:
56
+ X-Gateway-Key: your-gateway-secret-key
57
+ X-Gateway-User-ID: your-name
58
+ X-Gateway-Project-ID: your-project-name
59
+ ```
60
+
61
+ > **Important:** Continue v2.0+ requires `name` (not `title`), `roles`, and the top-level `schema: v1` field. Without these, you'll see a "config error" in the VS Code status bar.
62
+
63
+ ### Roo Code / Cline / Other Agents
36
64
 
37
- 1. Open your AI Tool's settings (e.g., Roo Code or Continue).
38
- 2. Set the **Provider** to `OpenAI Compatible`.
39
- 3. Set the **Base URL** to `http://localhost:8080/v1`.
40
- 4. Set the **API Key** to your **Gateway Secret Key** (the one you created in the dashboard, *not* your real OpenAI key).
65
+ 1. Set the **Provider** to `OpenAI Compatible`.
66
+ 2. Set the **Base URL** to `http://localhost:8080/v1`.
67
+ 3. Set the **API Key** to your **Gateway Secret Key** (the one you created in the dashboard, *not* your real OpenAI key).
41
68
 
42
69
  Now, start coding! OmniGate AI will silently intercept the requests, inject your real API key, forward it to the provider, and track your tokens on the dashboard.
43
70
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omnigate-ai",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Privacy-first, self-hosted LLM API Gateway and Proxy for tracking token usage.",
5
5
  "main": "server.js",
6
6
  "type": "module",
package/public/index.html CHANGED
@@ -207,17 +207,25 @@
207
207
  <p>Add this model block to your <code>~/.continue/config.yaml</code> config file:</p>
208
208
  <div class="code-container">
209
209
  <button class="copy-btn" onclick="copySnippet('continue-code', this)">Copy</button>
210
- <pre id="continue-code">models:
210
+ <pre id="continue-code">name: OmniGate Local Config
211
+ version: 1.0.0
212
+ schema: v1
213
+
214
+ models:
211
215
  - name: DeepSeek (via OmniGate)
212
216
  provider: openai
213
217
  model: deepseek-v4-pro
214
218
  apiBase: http://localhost:8080/v1/
215
- apiKey: stub-agency-key-for-local-testing
219
+ apiKey: your-gateway-secret-key
220
+ roles:
221
+ - chat
222
+ - edit
223
+ - apply
216
224
  requestOptions:
217
225
  headers:
218
- X-Gateway-Key: stub-agency-key-for-local-testing
219
- X-Gateway-User-ID: developer-erfan
220
- X-Gateway-Project-ID: vscode-project-omega</pre>
226
+ X-Gateway-Key: your-gateway-secret-key
227
+ X-Gateway-User-ID: developer-name
228
+ X-Gateway-Project-ID: vscode-project-name</pre>
221
229
  </div>
222
230
  </div>
223
231
 
package/server.js CHANGED
@@ -156,7 +156,14 @@ app.use((req, res, next) => {
156
156
  return next();
157
157
  }
158
158
 
159
- const incomingGatewayKey = req.headers['x-gateway-key'] || '';
159
+ let incomingGatewayKey = req.headers['x-gateway-key'] || '';
160
+ if (!incomingGatewayKey && req.headers.authorization) {
161
+ const authHeader = req.headers.authorization;
162
+ if (authHeader.startsWith('Bearer ')) {
163
+ incomingGatewayKey = authHeader.slice(7);
164
+ }
165
+ }
166
+
160
167
  const expectedKey = activeConfig.agencyGatewayKey || '';
161
168
 
162
169
  const incomingBuffer = Buffer.from(incomingGatewayKey);
@@ -570,11 +577,38 @@ app.post('/v1/messages', async (req, res) => {
570
577
  }
571
578
  });
572
579
 
580
+ // 4. OpenAI Models Proxy Handler
581
+ app.get('/v1/models', (req, res) => {
582
+ res.json({
583
+ object: 'list',
584
+ data: [
585
+ {
586
+ id: 'deepseek-v4-pro',
587
+ object: 'model',
588
+ created: Date.now(),
589
+ owned_by: 'OmniGate'
590
+ },
591
+ {
592
+ id: 'gpt-4o',
593
+ object: 'model',
594
+ created: Date.now(),
595
+ owned_by: 'OmniGate'
596
+ },
597
+ {
598
+ id: 'gpt-3.5-turbo',
599
+ object: 'model',
600
+ created: Date.now(),
601
+ owned_by: 'OmniGate'
602
+ }
603
+ ]
604
+ });
605
+ });
606
+
573
607
  // Catch-all route to reject unsupported endpoints
574
608
  app.use((req, res) => {
575
609
  res.status(404).json({
576
610
  error: {
577
- message: `The endpoint ${req.method} ${req.path} is not supported by OmniGate AI gateway. Only /v1/chat/completions (OpenAI) and /v1/messages (Anthropic) are valid proxy routes.`,
611
+ message: `The endpoint ${req.method} ${req.path} is not supported by OmniGate AI gateway. Only /v1/chat/completions (OpenAI), /v1/models, and /v1/messages (Anthropic) are valid proxy routes.`,
578
612
  type: 'gateway_route_error',
579
613
  code: 'unsupported_route'
580
614
  }