Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .codeinsight
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
## 🎯 thebird v1.1.0 — Anthropic SDK to Gemini streaming bridge — drop-in proxy that translates Anthropic message format and tool calls to Google Gemini

# 11f 721L 24fn 24cls cx2.2
*Legend: f=files L=lines fn=functions cls=classes cx=avg-complexity | file:line:name(NL)=location Np=params | ↑N=imports-from ↓N=imported-by (N)=occurrences (+N)=more | 🔄circular 🏝️isolated 🔥complex 📋duplicated 📁large*

**Langs:** JS:78% TS:17% JSON:4%

## 🛠️ Tech Stack

**Patterns:** generateGemini(7), contents.push(6), main(5), main().catch(5), chat(4), allParts.filter(3)
**Top IDs:** type(47), console(39), log(33), result(26), content(23), text(23)

## ⚡ Code Patterns

**Async:** async(38), await(25), Promise(1)
**Errors:** try/catch(6), throw(3)
**Internal calls:** generateGemini(7), contents.push(6), main(5), main().catch(5), chat(4), allParts.filter(3), onStepFinish(3), process.stdout.write(2)

## 🔗 I/O & Integration

**Env vars:** GEMINI_API_KEY
**Storage:** SQL(2), JSON(5)

## 📊 Code Organization

**Long funcs:** index.js:14:createFullStream(57L), examples/streaming.js:26:main(54L)
**Classes:** index.d.ts:0:TextBlock, index.d.ts:0:ImageBlockBase64, index.d.ts:0:ImageBlockUrl, index.d.ts:0:ImageBlockInline, index.d.ts:0:ImageBlockFile, index.d.ts:0:ToolUseBlock, index.d.ts:0:ToolResultBlock, index.d.ts:0:Message (+15)

## 🔄 Architecture

**L0 [pure exports]:** convert(1↓), errors(1↓), client(1↓)
**L3 [pure imports]:** index(3↑)
**Cross-module:** index.js→lib
**External:** @google/genai

## 🔌 API Surface

**Exported fns:** errors.js:11:isRetryable(1p), errors.js:20:withRetry(1p), convert.js:1:cleanSchema(1p), convert.js:12:convertTools(2p), convert.js:21:convertImageBlock(1p), convert.js:38:convertMessages(1p), convert.js:65:extractModelId(1p), convert.js:72:buildConfig(1p), client.js:5:getClient(1p), index.js:5:streamGemini(1p), index.js:72:generateGemini(2p)
**Classes:** TextBlock, ImageBlockBase64, ImageBlockUrl, ImageBlockInline, ImageBlockFile, ToolUseBlock (+17)
**Entry files:** client, convert, errors

## 🚨 Issues

- 📋 1 duplicated groups

## 🧹 Dead Code & Tests

**Orphaned:** tool-use.js, basic-chat.js, streaming.js, vision.js, package.json, multi-turn.js
**Tests:** 0/11 (0%)

## 📦 Modules

- lib: 3f, 3cx, 0↑3↓
- examples: 5f, 0cx, 0↑0↓

## 📄 File Index

**examples/basic-chat.js** 34L fn: main
**examples/multi-turn.js** 45L fn: chat, main
**examples/streaming.js** 81L fn: main
**examples/tool-use.js** 77L fn: nonStreamingExample, streamingExample, main
**examples/vision.js** 84L fn: base64Example, inlineDataExample, publicUrlExample, main
**index.d.ts** 128L
**index.js** 112L exports: [convertTools], [convertMessages], [streamGemini], [generateGemini], [cleanSchema] fn: streamGemini, createFullStream, generateGemini
**lib/client.js** 10L exports: [getClient] fn: getClient
**lib/convert.js** 86L exports: [cleanSchema], [extractModelId], [convertMessages], [buildConfig], [convertTools] fn: cleanSchema, convertTools, convertImageBlock, convertMessages (+2)
**lib/errors.js** 35L exports: [GeminiError], [isRetryable], [withRetry] fn: constructor, isRetryable, withRetry
**package.json** 29L

Git: branch: claude/add-code-router-features-TJkSb, 1 uncommitted
Hot: package.json(1), README.md(1), index.js(1)
Conv[JS]: 4-space, single quotes, semicolons, function declarations, relative imports, kebab-case files
Conv[TS]: 2-space, single quotes, semicolons, function declarations, named exports
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.gm-stop-verified
Loading