repoburg 1.3.22 → 1.3.24
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/CODEMAP.md +45 -208
- package/backend/.repoburg/data.sqlite +0 -0
- package/backend/CODEMAP.md +49 -0
- package/backend/dist/src/application-state/application-state.controller.d.ts +8 -0
- package/backend/dist/src/application-state/application-state.controller.js +32 -0
- package/backend/dist/src/application-state/application-state.controller.js.map +1 -1
- package/backend/dist/src/application-state/application-state.service.d.ts +4 -0
- package/backend/dist/src/application-state/application-state.service.js +25 -0
- package/backend/dist/src/application-state/application-state.service.js.map +1 -1
- package/backend/dist/src/application-state/dto/set-openrouter-config.dto.d.ts +3 -0
- package/backend/dist/src/application-state/dto/set-openrouter-config.dto.js +21 -0
- package/backend/dist/src/application-state/dto/set-openrouter-config.dto.js.map +1 -0
- package/backend/dist/src/core-entities/session-input.entity.d.ts +2 -0
- package/backend/dist/src/core-entities/session-input.entity.js +8 -0
- package/backend/dist/src/core-entities/session-input.entity.js.map +1 -1
- package/backend/dist/src/core-entities/session.entity.d.ts +3 -0
- package/backend/dist/src/core-entities/session.entity.js +9 -0
- package/backend/dist/src/core-entities/session.entity.js.map +1 -1
- package/backend/dist/src/events/websocket.events.d.ts +7 -0
- package/backend/dist/src/events/websocket.events.js +5 -0
- package/backend/dist/src/events/websocket.events.js.map +1 -1
- package/backend/dist/src/gemini/gemini-llm.provider.d.ts +4 -2
- package/backend/dist/src/gemini/gemini-llm.provider.js +54 -30
- package/backend/dist/src/gemini/gemini-llm.provider.js.map +1 -1
- package/backend/dist/src/interactive-chat/chat.module.js +6 -2
- package/backend/dist/src/interactive-chat/chat.module.js.map +1 -1
- package/backend/dist/src/interactive-chat/chat.service.d.ts +6 -1
- package/backend/dist/src/interactive-chat/chat.service.js +89 -18
- package/backend/dist/src/interactive-chat/chat.service.js.map +1 -1
- package/backend/dist/src/llm-provider/llm-provider.controller.d.ts +8 -0
- package/backend/dist/src/llm-provider/llm-provider.controller.js +39 -0
- package/backend/dist/src/llm-provider/llm-provider.controller.js.map +1 -0
- package/backend/dist/src/llm-provider/llm-provider.interface.d.ts +36 -1
- package/backend/dist/src/llm-provider/llm-provider.interface.js +10 -1
- package/backend/dist/src/llm-provider/llm-provider.interface.js.map +1 -1
- package/backend/dist/src/llm-provider/llm-provider.module.js +8 -3
- package/backend/dist/src/llm-provider/llm-provider.module.js.map +1 -1
- package/backend/dist/src/llm-provider/openrouter-llm.provider.d.ts +11 -0
- package/backend/dist/src/llm-provider/openrouter-llm.provider.js +186 -0
- package/backend/dist/src/llm-provider/openrouter-llm.provider.js.map +1 -0
- package/backend/dist/src/llm-provider/proxy-llm.provider.d.ts +10 -0
- package/backend/dist/src/llm-provider/proxy-llm.provider.js +43 -0
- package/backend/dist/src/llm-provider/proxy-llm.provider.js.map +1 -0
- package/backend/dist/src/llm-responses/dto/submit-llm-response.dto.d.ts +2 -0
- package/backend/dist/src/llm-responses/dto/submit-llm-response.dto.js +10 -0
- package/backend/dist/src/llm-responses/dto/submit-llm-response.dto.js.map +1 -1
- package/backend/dist/src/llm-responses/llm-responses.service.d.ts +2 -0
- package/backend/dist/src/llm-responses/llm-responses.service.js +44 -2
- package/backend/dist/src/llm-responses/llm-responses.service.js.map +1 -1
- package/backend/dist/src/seeding/data/system-prompts/default_master-agent.d.ts +1 -1
- package/backend/dist/src/seeding/data/system-prompts/default_master-agent.js +6 -0
- package/backend/dist/src/seeding/data/system-prompts/default_master-agent.js.map +1 -1
- package/backend/dist/src/session-inputs/session-inputs.service.js +1 -2
- package/backend/dist/src/session-inputs/session-inputs.service.js.map +1 -1
- package/backend/dist/src/sessions/dto/session.dto.d.ts +5 -0
- package/backend/dist/src/sessions/dto/session.dto.js +21 -0
- package/backend/dist/src/sessions/dto/session.dto.js.map +1 -1
- package/backend/dist/src/sessions/sessions.service.js +15 -0
- package/backend/dist/src/sessions/sessions.service.js.map +1 -1
- package/backend/dist/tsconfig.build.tsbuildinfo +1 -1
- package/backend/packages/gemini-core/CODEMAP.md +30 -0
- package/backend/packages/tokenpatch/CODEMAP.md +25 -0
- package/daemon/CODEMAP.md +23 -0
- package/package.json +2 -1
- package/visual-editor-proxy/CODEMAP.md +21 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Gemini Core Codemap
|
|
2
|
+
|
|
3
|
+
A robust, standalone wrapper for Google Gemini and Code Assist APIs, handling the complexities of OAuth2, streaming, and token management.
|
|
4
|
+
|
|
5
|
+
## 🚀 Overview
|
|
6
|
+
This package encapsulates the logic for communicating with Google's LLM infrastructure, providing a clean interface for the rest of the Repoburg backend.
|
|
7
|
+
|
|
8
|
+
## ✨ Key Components (`src/`)
|
|
9
|
+
|
|
10
|
+
### Core AI Logic (`core/`)
|
|
11
|
+
- `contentGenerator.ts`: Low-level generator for model responses.
|
|
12
|
+
- `geminiChat.ts`: Manages multi-turn conversation state.
|
|
13
|
+
- `geminiRequest.ts`: Orchestrates the raw HTTP/gRPC requests to Gemini.
|
|
14
|
+
- `tokenLimits.ts`: Logic for calculating and enforcing model context windows.
|
|
15
|
+
|
|
16
|
+
### Code Assist & Auth (`code_assist/`)
|
|
17
|
+
- `oauth2.ts` & `server.ts`: Handles the OAuth2 flow for Google Cloud credentials.
|
|
18
|
+
- `oauth-credential-storage.ts`: Secure storage interface for persistent tokens.
|
|
19
|
+
- `codeAssist.ts`: Specialized logic for Google's Enterprise Code Assist features.
|
|
20
|
+
|
|
21
|
+
### Configuration (`config/`)
|
|
22
|
+
- `models.ts`: Registry of supported Gemini model IDs (Flash, Pro, Lite).
|
|
23
|
+
- `storage.ts`: Abstract and concrete implementations for storing session and auth data.
|
|
24
|
+
|
|
25
|
+
### Utilities (`utils/`)
|
|
26
|
+
- `quotaErrorDetection.ts`: Detects and parses specific Google API quota failures.
|
|
27
|
+
- `retry.ts`: Implementation of exponential backoff for transient failures.
|
|
28
|
+
|
|
29
|
+
## 🛠 Usage
|
|
30
|
+
The package is exported via `index.ts`, exposing the `ContentGenerator` and model constants. It is primarily consumed by the `InteractiveChatModule` in the NestJS backend.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Tokenpatch Codemap
|
|
2
|
+
|
|
3
|
+
An intelligent, token-based patching library that applies code snippets using fuzzy prefix/suffix matching instead of rigid character offsets or line numbers.
|
|
4
|
+
|
|
5
|
+
## 🚀 Overview
|
|
6
|
+
Tokenpatch solves the "fragile diff" problem. By tokenizing both the source and the patch, it can locate the intended change location even if the surrounding code has shifted slightly, provided the unique "anchors" are still present.
|
|
7
|
+
|
|
8
|
+
## ✨ Key Components
|
|
9
|
+
- `index.ts`: The main entry point. Exports `applySnippetPatch`.
|
|
10
|
+
- `patcher.ts`: The core logic for standard patches, as well as edge-case handlers (`// @begin-of-file`, `// @end-of-file`).
|
|
11
|
+
- `parser.ts`: Manages the loading and initialization of Tree-sitter WASM grammars.
|
|
12
|
+
- `tokenizer.interface.ts`: Defines the common interface for different tokenization approaches.
|
|
13
|
+
|
|
14
|
+
### Tokenization Strategies (`strategies/`)
|
|
15
|
+
- `tiktoken-tokenizer.ts`: Uses Byte Pair Encoding (BPE) via Tiktoken. Fast and language-agnostic.
|
|
16
|
+
- `tree-sitter-tokenizer.ts`: Uses Tree-sitter for syntax-aware tokenization. More accurate for complex structural matching.
|
|
17
|
+
|
|
18
|
+
## 🛠 Mechanics
|
|
19
|
+
1. **Tokenize**: Source and Patch are converted into token streams.
|
|
20
|
+
2. **Anchor Identification**: The patch snippet's start and end tokens act as search anchors.
|
|
21
|
+
3. **Fuzzy Search**: The patcher searches the source stream for a unique match for these anchors.
|
|
22
|
+
4. **Replacement**: The content between matched anchors in the source is replaced by the patch content.
|
|
23
|
+
|
|
24
|
+
## 📦 Grammars
|
|
25
|
+
WASM grammars for TypeScript and TSX are bundled in `grammar/` to support the Tree-sitter strategy.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Repoburg Daemon Codemap
|
|
2
|
+
|
|
3
|
+
A lightweight, persistent background process that acts as a process manager and authentication proxy for Repoburg `backend` instances. Built with Express.js and `pm2`.
|
|
4
|
+
|
|
5
|
+
## 🚀 Key Concepts
|
|
6
|
+
The daemon is the "control plane" for the local device. It manages the lifecycle of backend services and ensures that only authorized users can trigger actions on the local filesystem.
|
|
7
|
+
|
|
8
|
+
## ✨ Key Components (`src/`)
|
|
9
|
+
- **`index.ts`**: Entry point. Initializes the Express server on port `9998`, sets up middleware, and starts the heartbeat/status services.
|
|
10
|
+
- **`serviceManager.ts`**: The core logic for interacting with `pm2` programmatically. It handles starting, stopping, and restarting backend instances for specific project paths.
|
|
11
|
+
- **`stateManager.ts`**: Handles persistence of managed services to `~/.repoburg/services.json`.
|
|
12
|
+
- **`auth/authManager.ts`**: Manages device-level authentication. Stores and validates the JWT received from the Repoburg website.
|
|
13
|
+
- **`api/`**: HTTP endpoints for management:
|
|
14
|
+
- `services.ts`: CRUD operations and lifecycle control for backend instances.
|
|
15
|
+
- `registry.ts`: Simple service discovery (e.g., getting the port of the currently active backend).
|
|
16
|
+
- `auth.ts`: Endpoints for initiating and checking the status of device authorization.
|
|
17
|
+
- **`middleware/checkAuth.ts`**: Secures sensitive daemon endpoints by verifying the device's JWT.
|
|
18
|
+
- **`utils/get-port.ts`**: A robust utility for finding available ports in a specific range for new backends.
|
|
19
|
+
|
|
20
|
+
## 🛠 Tech Stack
|
|
21
|
+
- **Framework**: Express.js
|
|
22
|
+
- **Process Management**: `pm2`
|
|
23
|
+
- **Storage**: Local JSON files (via `stateManager`)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "repoburg",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.24",
|
|
4
4
|
"description": "A local AI-powered software developer assistant that runs on your own machine.",
|
|
5
5
|
"author": "Celal Ertug",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
"@nestjs/platform-ws": "^10.3.10",
|
|
46
46
|
"@nestjs/typeorm": "^10.0.0",
|
|
47
47
|
"@nestjs/websockets": "^10.3.10",
|
|
48
|
+
"@openrouter/sdk": "^0.3.10",
|
|
48
49
|
"@opentelemetry/api": "^1.9.0",
|
|
49
50
|
"@opentelemetry/auto-instrumentations-node": "^0.48.0",
|
|
50
51
|
"@opentelemetry/exporter-trace-otlp-http": "^0.52.0",
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Visual Editor Proxy Codemap
|
|
2
|
+
|
|
3
|
+
A local proxy server that enables in-context component selection. It injects a selection script into a target application, allowing developers to "point and click" to send component context to Repoburg.
|
|
4
|
+
|
|
5
|
+
## 🚀 Overview
|
|
6
|
+
The proxy transparently forwards traffic to a running web app while intercepting HTML responses to inject the `repoburg-visual-editor.js` client script.
|
|
7
|
+
|
|
8
|
+
## ✨ Key Components
|
|
9
|
+
|
|
10
|
+
### Proxy Server (`src/`)
|
|
11
|
+
- **`main.ts`**: Express server using `http-proxy-middleware`. It listens for `TARGET_URL` and `BACKEND_PORT` environment variables. It uses a `responseInterceptor` to inject the client script and configuration into any `text/html` response.
|
|
12
|
+
|
|
13
|
+
### Selection Client (`client/src/`)
|
|
14
|
+
- **`main.ts`**: Entry point for the injected script. Manages the "Selector Mode" state and global event listeners for hovering and clicking elements.
|
|
15
|
+
- **`inspector.ts`**: Contains logic to find and traverse the **React Fiber tree** (`__reactFiber$`) starting from a DOM element. It extracts component names, props, and internal state while handling circular references and serialization.
|
|
16
|
+
- **`ui.ts`**: Manages the injected DOM elements, including the floating "Repo" action button, the highlight overlay, and the prompt submission modal.
|
|
17
|
+
|
|
18
|
+
## 🛠 Tech Stack
|
|
19
|
+
- **Server**: Express.js + `http-proxy-middleware`
|
|
20
|
+
- **Client**: Vanilla TypeScript (bundled via `esbuild`)
|
|
21
|
+
- **Integration**: Deep integration with React internals via Fiber nodes.
|