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
package/CODEMAP.md
CHANGED
|
@@ -1,224 +1,61 @@
|
|
|
1
|
-
# Repoburg Codemap
|
|
1
|
+
# Repoburg Project Codemap
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Repoburg is a local-first, AI-powered code generation and modification system. It bridges state-of-the-art LLMs with your local development environment through a multi-layered architecture.
|
|
4
4
|
|
|
5
|
-
## System
|
|
5
|
+
## 🚀 System Architecture
|
|
6
6
|
|
|
7
|
-
Repoburg
|
|
7
|
+
Repoburg is composed of several specialized projects that interact to form a cohesive workflow:
|
|
8
8
|
|
|
9
|
-
1.
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
4. **The `daemon`**: A long-running, headless background process that manages `backend` instances using `pm2`. It handles starting, stopping, and monitoring services for different projects and manages device authentication.
|
|
13
|
-
5. **The `website`**: The public-facing marketing, documentation, and user authentication portal, available at repoburg.com.
|
|
14
|
-
6. **The `daemon-desktop`**: An Electron-based desktop application that provides a graphical user interface (GUI) for the `daemon`. It allows users to manage services without using the command line.
|
|
15
|
-
7. **The `visual-editor-proxy`**: A local proxy server that injects a client script into a target frontend application, enabling developers to visually select components and send prompts to the `backend` from their running app.
|
|
9
|
+
### 1. Core Logic & Interface
|
|
10
|
+
- **[`backend/`](backend/CODEMAP.md)**: The "brain" of the system. A NestJS server that manages LLM providers (integrated Gemini/Code Assist), Eta-based context templates, and the deterministic `llm-orchestration` engine.
|
|
11
|
+
- **[`frontend/`](frontend/CODEMAP.md)**: The primary dashboard. A Next.js 15 application providing real-time chat, plan review interfaces, and a built-in code editor for workspace navigation.
|
|
16
12
|
|
|
17
|
-
|
|
13
|
+
### 2. Browser Integrations (PowerTools)
|
|
14
|
+
These userscripts bridge browser-based LLM interfaces with the local backend for "manual mode" or state-sync workflows:
|
|
15
|
+
- **[`userscripts/`](userscripts/CODEMAP.md)**: Deep integration for **Google AI Studio**. Supports network-level conversation syncing and state reversion.
|
|
16
|
+
- **[`userscript-chatgpt/`](userscript-chatgpt/CODEMAP.md)**: SSE-interception for **ChatGPT** to capture and sync assistant responses.
|
|
17
|
+
- **[`userscript-claude/`](userscript-claude/CODEMAP.md)**: Linear stream capture for **Claude.ai**.
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
The local server that contains the core application logic.
|
|
24
|
-
|
|
25
|
-
### 🚀 Entry Point & Core
|
|
26
|
-
|
|
27
|
-
- **Entry Point**: `backend/src/main.ts`. Handles server setup, port selection, and global middleware.
|
|
28
|
-
- **Root Module**: `backend/src/app.module.ts`. Imports all other feature modules.
|
|
29
|
-
- **Architecture**: Standard NestJS modular architecture (`*.module.ts`, `*.controller.ts`, `*.service.ts`).
|
|
30
|
-
|
|
31
|
-
### ✨ Key Feature Modules (`backend/src`)
|
|
19
|
+
### 3. Local Management & Auth
|
|
20
|
+
- **[`daemon/`](daemon/CODEMAP.md)**: A headless Express process manager using `pm2`. It handles device-level JWT authentication and the lifecycle of multiple backend instances.
|
|
21
|
+
- **[`daemon-desktop/`](daemon-desktop/CODEMAP.md)**: An Electron GUI for the daemon, allowing users to manage services and updates without the CLI.
|
|
22
|
+
- **[`website/`](website/CODEMAP.md)**: The public portal (repoburg.com). Manages user accounts and the OAuth-based device authorization flow.
|
|
32
23
|
|
|
33
|
-
|
|
34
|
-
-
|
|
35
|
-
- **`/session-inputs`**: Handles a single turn of interaction (prompt creation, context generation).
|
|
36
|
-
- **`/session-followup`**: Handles creating new sessions that inherit context from previous ones.
|
|
37
|
-
- **`/session-transfer`**: Manages the import and export of session data.
|
|
38
|
-
- **`/llm-responses`**: Receives raw text responses from the LLM and hands them off to the `llm-orchestration` module for processing. Its endpoint (`/sync-conversation`) receives entire conversation histories from external tools and now also captures the raw, unparsed request body associated with that conversation state for debugging and state reversion.
|
|
39
|
-
- **`/llm-orchestration`**: The core engine for processing an AI turn. It follows a pipeline model: parsing the LLM response, **deterministically sorting actions into a logical order (e.g., create before edit)**, validating and executing each action, and running post-execution hooks. It also features two self-correction mechanisms:
|
|
40
|
-
1. **Invalid Tool Correction**: If the AI uses a non-existent tool name, the system executes all valid actions, then a high-priority hook sends a consolidated feedback message to the LLM, prompting it to correct the plan.
|
|
41
|
-
2. **Action Validation Failure**: For valid tools with invalid arguments (like `quick_edit` with a non-unique search block), the individual action handler reports the failure back to the LLM for an automatic retry.
|
|
42
|
-
This module also includes hooks for triggering standard follow-up AI calls and notifying the frontend.
|
|
43
|
-
- **`/ai-actions`**: Manages the individual actions (`create_file`, `run_command`, `quick_edit`) proposed by the AI. Its services also contain the file system logic for user-driven UI actions like applying or reverting changes. It now also exposes an endpoint to trigger a "revert" action, which uses a stored AI Studio request body to send a command to the userscript to revert the conversation state.
|
|
44
|
-
- **`/execution-logs`**: Stores logs from action execution.
|
|
45
|
-
- **`/interactive-chat`**: Orchestrates sending prompts to an LLM for both integrated and manual modes.
|
|
46
|
-
|
|
47
|
-
#### Context & Prompting
|
|
48
|
-
- **`/context-generation`**: Renders context strings from Eta.js templates using built-in helper functions. Variables from `custom-variables` are injected here.
|
|
49
|
-
- **`/context-templates`**: CRUD module for managing the main context templates.
|
|
50
|
-
- **`/system-prompts`**: CRUD module for managing the system prompts that define the AI's behavior. The default prompt has been streamlined to improve conciseness and remove fields that are now handled by the backend (like `order_of_execution`).
|
|
51
|
-
- **`/context-snippets`**: Manages dynamic, reusable context snippets callable with `!` in a prompt.
|
|
52
|
-
- **`/custom-snippets`**: Manages static, reusable code snippets for the template editor.
|
|
53
|
-
- **`/custom-variables`**: Manages a key-value store of user-defined variables (e.g., `PLAN_MODE`) that can be used in any template via `it.VAR`.
|
|
54
|
-
|
|
55
|
-
#### Core Services & Integrations
|
|
56
|
-
- **`/workspace`**: Provides APIs to interact with the local file system (file tree, search, file content).
|
|
57
|
-
- **`/llm-provider` & `/gemini`**: Defines the interface and provides the implementation for the integrated Google Gemini LLM. Its initialization is now non-blocking to improve backend startup resilience.
|
|
58
|
-
- **`/events`**: The WebSocket gateway for real-time communication. It now uses a **strongly-typed event system** (`websocket.events.ts`) for safer, more reliable communication between the backend, frontend, and userscripts.
|
|
59
|
-
- **`/application-state`**: Manages global backend settings (e.g., active session, feature flags).
|
|
60
|
-
- **`/mcp`**: Manages connections and tools for the Model Context Protocol (MCP).
|
|
61
|
-
- **`/visual-editor`**: Provides an endpoint for the visual editor's injected client script to submit prompts and context, adapting them into standard session inputs.
|
|
62
|
-
- **`/projects`**: Manages project-specific information.
|
|
63
|
-
- **`/seeding`**: Seeds the database with default data (prompts, templates, variables) on startup.
|
|
64
|
-
- **`/core-entities`**: Contains all TypeORM entity definitions for the database schema. The `AIAction` entity includes a `plain` text field to store the explanation provided by a `final` action, and the `SessionInput` entity stores the raw request body from AI Studio to enable state reversion.
|
|
65
|
-
- **`/utils`**: Shared utility functions and decorators (e.g., fuzzy search, tracing).
|
|
24
|
+
### 4. Advanced Tooling
|
|
25
|
+
- **[`visual-editor-proxy/`](visual-editor-proxy/CODEMAP.md)**: A local proxy that enables "Live View" selection. It injects a script into target apps to resolve React components to source files visually.
|
|
66
26
|
|
|
67
27
|
---
|
|
68
28
|
|
|
69
|
-
##
|
|
70
|
-
|
|
71
|
-
The main user interface for interacting with the Repoburg backend.
|
|
29
|
+
## 🔄 Primary Workflows
|
|
72
30
|
|
|
73
|
-
###
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
31
|
+
### The AI Orchestration Loop
|
|
32
|
+
1. **Input**: User submits a prompt via the Frontend.
|
|
33
|
+
2. **Context**: Backend renders Eta templates (fetching files, git diffs, or using MCP tools).
|
|
34
|
+
3. **LLM**: Gemini generates a plan, or the prompt is sent to a Userscript via WebSocket (Manual Mode).
|
|
35
|
+
4. **Parsing**: The `llm-orchestration` module parses tool calls from the LLM response.
|
|
36
|
+
5. **Execution**: Actions are sorted (e.g., `create_file` before `patch`) and executed.
|
|
37
|
+
6. **Self-Correction**: If a tool fails validation (e.g., non-unique search block), an automatic feedback turn is triggered.
|
|
77
38
|
|
|
78
|
-
###
|
|
39
|
+
### AI Studio State Reversion
|
|
40
|
+
Repoburg can "rewind" an AI Studio conversation to a specific point:
|
|
41
|
+
1. Frontend sends a turn ID to the Backend.
|
|
42
|
+
2. Backend retrieves the stored raw request body for that turn.
|
|
43
|
+
3. WebSocket broadcasts `update-chat` to the AI Studio Userscript.
|
|
44
|
+
4. Userscript triggers an `UpdatePrompt` request and hijacks the body with the stored state.
|
|
79
45
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
- **`/components/ui`**: The library of low-level, reusable UI components from shadcn/ui.
|
|
86
|
-
- **`/lib/api`**: A collection of strongly-typed functions that handle all HTTP communication with the `backend` API, including the new `customVariable` client.
|
|
87
|
-
- **`/store`**: Contains all Zustand state management logic, divided into slices for different features (e.g., `session.slice.ts`, `ui.slice.ts`, `customVariableStore.ts`, `markdownEditorStore.ts`).
|
|
88
|
-
- **`/hooks`**: Custom React hooks, such as `useMonacoEtaSetup`, which now provides autocompletion for Repoburg Variables (`it.VAR`).
|
|
89
|
-
- **`/types`**: Contains all TypeScript type definitions for API payloads and other shared data structures, including the **new strongly-typed definitions for WebSocket events** (`websocket.ts`) to ensure client-server communication is safe and consistent.
|
|
46
|
+
### Visual Selection (Live View)
|
|
47
|
+
1. `visual-editor-proxy` serves a local target application.
|
|
48
|
+
2. Developer clicks the floating "Repo" button and selects a UI element.
|
|
49
|
+
3. Client script traverses the React Fiber tree to identify the component and its source path.
|
|
50
|
+
4. Component context + prompt are sent to the Backend to initiate a generated plan.
|
|
90
51
|
|
|
91
52
|
---
|
|
92
53
|
|
|
93
|
-
##
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
-
|
|
99
|
-
-
|
|
100
|
-
-
|
|
101
|
-
|
|
102
|
-
### ✨ Key Files (`userscripts/src`)
|
|
103
|
-
- **`index.ts`**: The main entry point. It initializes all features and connects to the `daemon` to find the active `backend` port.
|
|
104
|
-
- **`network-interceptor.ts`**: Monkey-patches `fetch` and `XMLHttpRequest`. It captures the full conversation state to sync with the backend and can also be "armed" by a WebSocket command to hijack the next outgoing `UpdatePrompt` request, replacing its body to revert the state.
|
|
105
|
-
- **`conversation-parser.ts`**: A helper module to parse the raw, complex data from an intercepted request into a clean, structured `Conversation` object.
|
|
106
|
-
- **`webSocketHandler.ts`**: Manages the persistent WebSocket connection to the `backend`'s `/events` gateway. It now uses a **type-safe event handler (`websocket-events.ts`)** to robustly process commands from the backend (e.g., `update-chat`, `llm-input-generated`).
|
|
107
|
-
- **`clipboardInterceptor.ts`**: Patches the browser's native clipboard APIs to reliably capture text copied from AI Studio. This is used for the manual "Copy & Submit" workflow.
|
|
108
|
-
- **`hotkeys.ts`**: Binds keyboard shortcuts (e.g., `Cmd+\`) to trigger actions.
|
|
109
|
-
- **Core Actions**:
|
|
110
|
-
- `copyAndSubmit.ts`: Implements the "Copy & Submit" workflow, which captures the AI's response and sends it to the `backend`.
|
|
111
|
-
- `pasteAndRun.ts`: Implements the "Paste & Run" workflow, which takes text (from clipboard or WebSocket) and pastes it into the AI Studio prompt input.
|
|
112
|
-
- `editAndDone.ts`: A new UI automation module that clicks "Edit," modifies the prompt, and clicks "Done" to programmatically trigger an `UpdatePrompt` network request, enabling the state revert feature.
|
|
113
|
-
- **`settingsManager.ts` & `settingsUI.ts`**: Create and manage a settings panel injected directly into the AI Studio page.
|
|
114
|
-
|
|
115
|
-
---
|
|
116
|
-
|
|
117
|
-
## Daemon Architecture (`daemon/`)
|
|
118
|
-
|
|
119
|
-
A lightweight, persistent background process that acts as a process manager and authentication proxy.
|
|
120
|
-
|
|
121
|
-
### 🚀 Tech Stack & Structure
|
|
122
|
-
- **Framework**: Express.js
|
|
123
|
-
- **Process Management**: Uses `pm2` programmatically to manage `backend` instances.
|
|
124
|
-
- **Entry Point**: `src/index.ts`.
|
|
125
|
-
|
|
126
|
-
### ✨ Key Files (`daemon/src`)
|
|
127
|
-
- **`serviceManager.ts`**: Core logic for interacting with `pm2` (start, stop, etc.).
|
|
128
|
-
- **`stateManager.ts`**: Persists the list of managed services to a JSON file in `~/.repoburg/`.
|
|
129
|
-
- **`auth/authManager.ts`**: Handles JWT validation for securing daemon endpoints.
|
|
130
|
-
- **`api/`**: Contains the Express routers for the daemon's HTTP API (runs on `localhost:9998`).
|
|
131
|
-
|
|
132
|
-
---
|
|
133
|
-
|
|
134
|
-
## Website Architecture (`website/`)
|
|
135
|
-
|
|
136
|
-
The public-facing website for documentation, user accounts, and device authorization.
|
|
137
|
-
|
|
138
|
-
### 🚀 Tech Stack & Structure
|
|
139
|
-
- **Framework**: Next.js (App Router)
|
|
140
|
-
- **Authentication/Database**: Supabase for user management and a small amount of data storage.
|
|
141
|
-
- **Styling**: Tailwind CSS with shadcn/ui components.
|
|
142
|
-
|
|
143
|
-
### ✨ Key Directories (`website/src/app`)
|
|
144
|
-
- **`/` (root)**: The main marketing/landing page.
|
|
145
|
-
- **`/dashboard`**: The main page after a user logs in. It handles the device authorization flow.
|
|
146
|
-
- **`/profile`**: Displays user account and subscription details.
|
|
147
|
-
- **`/docs`**: Renders Markdown files from the same directory to serve as product documentation.
|
|
148
|
-
- **`/api/`**: Serverless functions (Next.js Route Handlers) for various tasks:
|
|
149
|
-
- `/api/device/`: Handles the device authorization flow (`initiate` and `poll`).
|
|
150
|
-
- `/api/daemon/token`: Generates short-lived JWTs for securing daemon actions from the dashboard.
|
|
151
|
-
- `/api/version`: A public endpoint to report the latest version of the `repoburg` npm package.
|
|
152
|
-
- **`/auth/callback`**: The OAuth callback route handled by Supabase.
|
|
153
|
-
|
|
154
|
-
---
|
|
155
|
-
|
|
156
|
-
## Daemon Desktop App (`daemon-desktop/`)
|
|
157
|
-
|
|
158
|
-
A graphical user interface for managing the `daemon` and its services.
|
|
159
|
-
|
|
160
|
-
### 🚀 Tech Stack & Structure
|
|
161
|
-
- **Framework**: Electron with Vite.
|
|
162
|
-
- **UI**: React with shadcn/ui components.
|
|
163
|
-
- **Bundler**: Vite is used for the main, preload, and renderer processes.
|
|
164
|
-
- **Builder**: Electron Forge handles packaging the application for different operating systems.
|
|
165
|
-
|
|
166
|
-
### ✨ Key Files (`daemon-desktop/src`)
|
|
167
|
-
- **`main.ts`**: The Electron main process entry point. It handles window creation, lifecycle, and daemon interactions. It now **dynamically fetches the latest CLI version from npm** to ensure users install and update to the correct version.
|
|
168
|
-
- **`preload.ts`**: The Electron preload script, securely exposing functions from the `main` process to the `renderer` process.
|
|
169
|
-
- **`renderer.tsx`**: The entry point for the React application that runs in the Electron window.
|
|
170
|
-
- **`App.tsx`**: The main React component that builds the user interface.
|
|
171
|
-
- **`sharedTypes.ts`**: TypeScript definitions shared between the `main` and `renderer` processes to ensure type safety.
|
|
172
|
-
|
|
173
|
-
---
|
|
174
|
-
|
|
175
|
-
## Visual Editor Proxy (`visual-editor-proxy/`)
|
|
176
|
-
|
|
177
|
-
A lightweight proxy server that enables the in-context visual editing feature.
|
|
178
|
-
|
|
179
|
-
### 🚀 Tech Stack & Structure
|
|
180
|
-
- **Framework**: Express.js
|
|
181
|
-
- **Proxying**: Uses `http-proxy-middleware` to forward requests.
|
|
182
|
-
- **Client-side Script**: A vanilla TypeScript application bundled with `esbuild`.
|
|
183
|
-
|
|
184
|
-
### ✨ Key Files
|
|
185
|
-
- **`src/main.ts`**: The Express server entry point. It handles proxying, injecting the client script into the target application's HTML, and serving the client script itself.
|
|
186
|
-
- **`client/src/main.ts`**: The entry point for the client-side logic that runs in the browser. It manages selector mode, the prompt UI, and communication with the `backend`.
|
|
187
|
-
- **`client/src/inspector.ts`**: Contains logic to interact with React DevTools hooks to inspect the component hierarchy of a selected element.
|
|
188
|
-
- **`client/src/ui.ts`**: Responsible for creating and managing all injected UI elements (floating button, modal, toast notifications).
|
|
189
|
-
|
|
190
|
-
---
|
|
191
|
-
|
|
192
|
-
## System Interaction Flow
|
|
193
|
-
|
|
194
|
-
### Authentication & Authorization
|
|
195
|
-
- **Daemon <-> Website**: When a user runs `repoburg start`, the `daemon` initiates a device authorization flow by calling the `/api/device/initiate` endpoint on the `website`. It then polls the `/api/device/poll` endpoint.
|
|
196
|
-
- **User -> Website**: The user is directed to the `/dashboard` page on the `website` to approve the device. Upon approval, the `website` generates a JWT and stores it for the polling `daemon` to retrieve.
|
|
197
|
-
|
|
198
|
-
### Service Management
|
|
199
|
-
- **Daemon Desktop -> Daemon**: The Electron app's `main.ts` makes HTTP requests to the `daemon`'s API (`localhost:9998`) to start, stop, and list services, effectively acting as a GUI for the daemon's capabilities.
|
|
200
|
-
- **CLI -> Daemon**: The `repoburg` command-line tool also communicates with the `daemon`'s API to manage services.
|
|
201
|
-
- **Daemon -> Userscript**: The `userscript` queries the `daemon`'s `/registry/get-active-port` endpoint to discover which port the active `backend` is running on.
|
|
202
|
-
|
|
203
|
-
### Core AI Workflow
|
|
204
|
-
- **Backend <-> Frontend**: The `frontend` makes API calls to a specific `backend` instance. Real-time updates are sent from backend to frontend via a **new, strongly-typed WebSocket event protocol**.
|
|
205
|
-
- **Backend <-> Userscript**: In manual mode, the `backend` sends commands to the `userscript` via the same **strongly-typed WebSocket protocol**, telling it to paste prompts, update system settings, etc.
|
|
206
|
-
- **Data from Userscript (HTTP)**: The `userscript`'s network interceptor sends the entire parsed conversation to the `backend`'s `/llm-responses/sync-conversation` endpoint. The older `copyAndSubmit` function sends a single response to `/llm-responses/submit-external`.
|
|
207
|
-
|
|
208
|
-
### AI Studio State Reversion Workflow
|
|
209
|
-
- **Frontend -> Backend**: A user right-clicks an AI message in the Repoburg UI and selects "Revert". This sends a `POST` request to the `/ai-actions/:inputId/revert` endpoint.
|
|
210
|
-
- **Backend**: The service retrieves the `SessionInput` associated with that turn, which contains the raw AI Studio request body captured during the initial sync.
|
|
211
|
-
- **Backend -> Userscript**: The backend broadcasts a type-safe `update-chat` WebSocket event, sending the stored request body as the payload.
|
|
212
|
-
- **Userscript (in AI Studio)**: The `webSocketHandler` receives the event and "arms" the `networkInterceptor` with the payload. It then triggers the `editAndDone` UI automation.
|
|
213
|
-
- **AI Studio -> Network**: The automation clicks "Edit," modifies the prompt slightly, and clicks "Done," causing AI Studio to initiate an `UpdatePrompt` network request.
|
|
214
|
-
- **Userscript (Hijack)**: The armed `networkInterceptor` intercepts this outgoing request, replaces its body with the payload received from the backend, and allows the modified request to proceed, thus reverting the conversation state.
|
|
215
|
-
|
|
216
|
-
### Self-Correction Mechanisms
|
|
217
|
-
- **Action Validation Failure (`quick_edit`)**: The `quick_edit` tool includes a self-correction mechanism. If an edit fails due to a non-unique or missing code block, the handler generates a specific error message that is fed back to the LLM, prompting it to try the edit again with a more precise `search_block`.
|
|
218
|
-
- **Invalid Tool Name Correction**: If the AI's plan includes a tool that doesn't exist, the system executes all valid actions from the plan. It then sends a single feedback message to the LLM listing the invalid tools, prompting it to provide a corrected plan. This allows the AI to self-correct without halting the entire workflow.
|
|
219
|
-
|
|
220
|
-
### Visual Editor Workflow
|
|
221
|
-
- **CLI -> visual-editor-proxy**: The `repoburg start-live` command spawns the `visual-editor-proxy` process, passing the target application URL and the active backend port as environment variables.
|
|
222
|
-
- **User's Browser <-> visual-editor-proxy**: The proxy serves the user's target application, but injects its own client-side script into the HTML.
|
|
223
|
-
- **Injected Script -> Backend**: When the user selects a component and submits a prompt, the injected script sends a POST request to the `/visual-editor/submit` endpoint on the `backend`.
|
|
224
|
-
- **Backend -> Frontend**: The backend's `/visual-editor` controller receives the request, creates a new session input, which then triggers a WebSocket event to the `frontend`, causing the new AI plan to appear for review.
|
|
54
|
+
## 🛠 Global Tech Stack
|
|
55
|
+
- **Languages**: TypeScript (Full-stack)
|
|
56
|
+
- **Backend**: NestJS, Express, TypeORM (SQLite), Eta.js, `pm2`
|
|
57
|
+
- **Frontend**: Next.js 15, React, Tailwind CSS 4, Zustand, Monaco Editor
|
|
58
|
+
- **Desktop**: Electron, Vite, Electron Forge
|
|
59
|
+
- **Inter-Process**: WebSockets (Strongly-typed events), HTTP/JSON
|
|
60
|
+
- **Parsing**: Tiktoken (BPE), Tree-sitter (WASM)
|
|
61
|
+
- **Cloud**: Supabase (Auth/DB), Google Gemini API
|
|
Binary file
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Repoburg Backend Codemap
|
|
2
|
+
|
|
3
|
+
The local server orchestrating the Repoburg AI workflow. Built with NestJS and TypeORM.
|
|
4
|
+
|
|
5
|
+
## 🚀 Core AI Loop
|
|
6
|
+
1. **Input**: `SessionInputsService` takes a prompt, generates context via Eta templates (`SessionInputContextService`), and calls the LLM.
|
|
7
|
+
2. **Response**: `LlmResponsesService` receives the raw text (from integrated Gemini or external sync) and routes it to orchestration.
|
|
8
|
+
3. **Orchestration**: `LlmTurnProcessorService` parses the response into atomic `Action`s, sorts them (e.g., create before edit), and executes them.
|
|
9
|
+
4. **Correction**: If a tool fails (validation or syntax), hooks trigger a self-correction turn automatically.
|
|
10
|
+
5. **Hooks**: `PostExecutionHook`s handle follow-up AI calls, frontend notifications, and "YOLO mode" loops.
|
|
11
|
+
|
|
12
|
+
## ✨ KKey Feature Modules (`src/`)
|
|
13
|
+
- **`llm-orchestration/`**: [Detailed Codemap](src/llm-orchestration/CODEMAP.md). The engine. Contains the parser, deterministic action sorter, and the registry of `ActionHandler`s.
|
|
14
|
+
- **`ai-actions/`**: [Detailed Codemap](src/ai-actions/CODEMAP.md). Tracks the state of all proposed changes. Handles user approval, manual execution, and the complex `revert` logic.
|
|
15
|
+
- **`application-state/`**: [Detailed Codemap](src/application-state/CODEMAP.md). Global settings and feature flags (e.g., YOLO mode, token limits, execution strategies).
|
|
16
|
+
- **`core-entities/`**: [Detailed Codemap](src/core-entities/CODEMAP.md). The TypeORM data model for projects, sessions, and actions.
|
|
17
|
+
- **`context-generation/`**: [Detailed Codemap](src/context-generation/CODEMAP.md). The rendering engine. Uses Eta.js to build prompts with secure filesystem access (rg, tree, it).
|
|
18
|
+
- **`context-templates/`**: [Detailed Codemap](src/context-templates/CODEMAP.md). Library of reusable prompt structures and partials.
|
|
19
|
+
- **`events/`**: [Detailed Codemap](src/events/CODEMAP.md). Real-time communication layer using WebSockets for UI updates and browser integration.
|
|
20
|
+
- **`execution-logs/`**: [Detailed Codemap](src/execution-logs/CODEMAP.md). captures and stores real-time output from all AI tool executions.
|
|
21
|
+
- * **`interactive-chat/`**: [Detailed Codemap](src/interactive-chat/CODEMAP.md). Manages the in-memory conversation history and system instructions for active sessions.
|
|
22
|
+
- **`llm-provider/`**: [Detailed Codemap](src/llm-provider/CODEMAP.md). Abstraction layer for different LLM engines (Gemini, etc.).
|
|
23
|
+
- **`llm-responses/`**: [Detailed Codemap](src/llm-responses/CODEMAP.md). Ingests and normalizes LLM output from integrated or external sources, triggering the orchestration engine.
|
|
24
|
+
- * **`mcp/`**: [Detailed Codemap](src/mcp/CODEMAP.md). Client implementation for the Model Context Protocol, connecting the AI to external tools and servers.
|
|
25
|
+
- **`message-bus/`**: [Detailed Codemap](src/message-bus/CODEMAP.md). Polling-based communication fallback for browser extensions.
|
|
26
|
+
- **`projects/`**: [Detailed Codemap](src/projects/CODEMAP.md). Maps workspace paths to AI sessions and enforces root directoryoundaries.
|
|
27
|
+
- **`seeding/`**: [Detailed Codemap](src/seeding/CODEMAP.md). Populates the database with default prompts, templates, and snippets on first run.
|
|
28
|
+
- **`sessions/`**: [Detailed Codemap](src/sessions/CODEMAP.md). Manages conversation metadata, projects, and session-specific default templates.
|
|
29
|
+
- **`session-followup/`**: [Detailed Codemap](src/session-followup/CODEMAP.md). logic for spawning new sessions while inheriting context from previous ones.
|
|
30
|
+
- **`session-inputs/`**: [Detailed Codemap](src/session-inputs/CODEMAP.md). Manages the user prompts, context generation via templates, and interaction with the LLM provider.
|
|
31
|
+
- **`session-transfer/`**: [Detailed Codemap](src/session-transfer/CODEMAP.md). Deep import/export functionality for migrating session history and associated metadata.
|
|
32
|
+
- **`system-prompts/`**: [Detailed Codemap](src/system-prompts/CODEMAP.md). Manages the AI's master instructions and handles tool-definition injection.
|
|
33
|
+
- **`tool-hooks/`**: [Detailed Codemap](src/tool-hooks/CODEMAP.md). Extensibility layer. Executes user-provided TypeScript scripts (compiled via VM) before/after tool runs.
|
|
34
|
+
- **`utils/`**: [Detailed Codemap](src/utils/CODEMAP.md). Shared helpers for fuzzy search, tracing, and tool-call generation.
|
|
35
|
+
- **`visual-editor/`**: [Detailed Codemap](src/visual-editor/CODEMAP.md). Backend handler for component selection prompts from the Visual Editor Proxy.
|
|
36
|
+
- **`workspace/`**: [Detailed Codemap](src/workspace/CODEMAP.md). Secure filesystem access. Provides the file tree and `Cmd+P` fuzzy search using RipG **`mcp/`**: Client implementation for the Model Context Protocol, connecting the AI to external tools and servers.
|
|
37
|
+
- **`interactive-chat/`**: Maintains the conversation history and manages the `LlmProvider` lifecycle.
|
|
38
|
+
- **`events/` & `message-bus/`**: Communication layer. Real-time updates via WebSockets and a polling-based fallback.
|
|
39
|
+
|
|
40
|
+
## 📦 � Internal Packages (`packages/`)
|
|
41
|
+
- **`tokenpatch/`**: [Detailed Codemap](packages/tokenpatch/CODEMAP.md). A custom, intelligent patching library using token-based matching.
|
|
42
|
+
- **`gemini-core/`**: [Detailed Codemap](packages/gemini-core/CODEMAP.md). A robust wrapper for Google Gemini and Code Assist Is, handling authentication (OAuth2), streaming, and token limits.
|
|
43
|
+
|
|
44
|
+
## 🛠 Tech Stack
|
|
45
|
+
- **Framework**: NestJS
|
|
46
|
+
- **Database**: SQLite via TypeORM
|
|
47
|
+
- **Templating**: Eta.js (for context generation)
|
|
48
|
+
- **Observability**: OpenTelemetry (custom `@Trace()` decorator)
|
|
49
|
+
- **Validation**: class-validator & class-transformer
|
|
@@ -7,6 +7,7 @@ import { SetContextTokenLimitDto } from './dto/set-context-token-limit.dto';
|
|
|
7
7
|
import { SetManualLlmEnabledDto } from './dto/set-manual-llm-enabled.dto';
|
|
8
8
|
import { SetExecutionStrategyDto } from './dto/set-execution-strategy.dto';
|
|
9
9
|
import { SetYoloModeDto } from './dto/set-yolo-mode.dto';
|
|
10
|
+
import { SetOpenrouterConfigDto } from './dto/set-openrouter-config.dto';
|
|
10
11
|
export declare class ApplicationStateController {
|
|
11
12
|
private readonly applicationStateService;
|
|
12
13
|
constructor(applicationStateService: ApplicationStateService);
|
|
@@ -42,4 +43,11 @@ export declare class ApplicationStateController {
|
|
|
42
43
|
limit: number;
|
|
43
44
|
}>;
|
|
44
45
|
setContextTokenLimit(dto: SetContextTokenLimitDto): Promise<void>;
|
|
46
|
+
getOpenrouterConfig(): Promise<{
|
|
47
|
+
apiKey: string | null;
|
|
48
|
+
}>;
|
|
49
|
+
setOpenrouterConfig(dto: SetOpenrouterConfigDto): Promise<void>;
|
|
50
|
+
getRecentModels(): Promise<{
|
|
51
|
+
models: string[];
|
|
52
|
+
}>;
|
|
45
53
|
}
|
|
@@ -23,6 +23,7 @@ const set_context_token_limit_dto_1 = require("./dto/set-context-token-limit.dto
|
|
|
23
23
|
const set_manual_llm_enabled_dto_1 = require("./dto/set-manual-llm-enabled.dto");
|
|
24
24
|
const set_execution_strategy_dto_1 = require("./dto/set-execution-strategy.dto");
|
|
25
25
|
const set_yolo_mode_dto_1 = require("./dto/set-yolo-mode.dto");
|
|
26
|
+
const set_openrouter_config_dto_1 = require("./dto/set-openrouter-config.dto");
|
|
26
27
|
let ApplicationStateController = class ApplicationStateController {
|
|
27
28
|
constructor(applicationStateService) {
|
|
28
29
|
this.applicationStateService = applicationStateService;
|
|
@@ -83,6 +84,17 @@ let ApplicationStateController = class ApplicationStateController {
|
|
|
83
84
|
async setContextTokenLimit(dto) {
|
|
84
85
|
await this.applicationStateService.setContextTokenLimit(dto.limit);
|
|
85
86
|
}
|
|
87
|
+
async getOpenrouterConfig() {
|
|
88
|
+
const apiKey = await this.applicationStateService.getOpenrouterApiKey();
|
|
89
|
+
return { apiKey };
|
|
90
|
+
}
|
|
91
|
+
async setOpenrouterConfig(dto) {
|
|
92
|
+
await this.applicationStateService.setOpenrouterApiKey(dto.apiKey);
|
|
93
|
+
}
|
|
94
|
+
async getRecentModels() {
|
|
95
|
+
const models = await this.applicationStateService.getRecentModels();
|
|
96
|
+
return { models };
|
|
97
|
+
}
|
|
86
98
|
};
|
|
87
99
|
exports.ApplicationStateController = ApplicationStateController;
|
|
88
100
|
__decorate([
|
|
@@ -197,6 +209,26 @@ __decorate([
|
|
|
197
209
|
__metadata("design:paramtypes", [set_context_token_limit_dto_1.SetContextTokenLimitDto]),
|
|
198
210
|
__metadata("design:returntype", Promise)
|
|
199
211
|
], ApplicationStateController.prototype, "setContextTokenLimit", null);
|
|
212
|
+
__decorate([
|
|
213
|
+
(0, common_1.Get)('openrouter-config'),
|
|
214
|
+
__metadata("design:type", Function),
|
|
215
|
+
__metadata("design:paramtypes", []),
|
|
216
|
+
__metadata("design:returntype", Promise)
|
|
217
|
+
], ApplicationStateController.prototype, "getOpenrouterConfig", null);
|
|
218
|
+
__decorate([
|
|
219
|
+
(0, common_1.Post)('openrouter-config'),
|
|
220
|
+
(0, common_1.HttpCode)(common_1.HttpStatus.NO_CONTENT),
|
|
221
|
+
__param(0, (0, common_1.Body)()),
|
|
222
|
+
__metadata("design:type", Function),
|
|
223
|
+
__metadata("design:paramtypes", [set_openrouter_config_dto_1.SetOpenrouterConfigDto]),
|
|
224
|
+
__metadata("design:returntype", Promise)
|
|
225
|
+
], ApplicationStateController.prototype, "setOpenrouterConfig", null);
|
|
226
|
+
__decorate([
|
|
227
|
+
(0, common_1.Get)('recent-models'),
|
|
228
|
+
__metadata("design:type", Function),
|
|
229
|
+
__metadata("design:paramtypes", []),
|
|
230
|
+
__metadata("design:returntype", Promise)
|
|
231
|
+
], ApplicationStateController.prototype, "getRecentModels", null);
|
|
200
232
|
exports.ApplicationStateController = ApplicationStateController = __decorate([
|
|
201
233
|
(0, common_1.Controller)('application-state'),
|
|
202
234
|
__metadata("design:paramtypes", [application_state_service_1.ApplicationStateService])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application-state.controller.js","sourceRoot":"","sources":["../../../src/application-state/application-state.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAOwB;AACxB,2EAAsE;AACtE,+EAAyE;AACzE,uDAAkD;AAClD,iGAAyF;AACzF,yGAA+F;AAC/F,mFAA4E;AAC5E,iFAA0E;AAC1E,iFAA2E;AAC3E,+DAAyD;
|
|
1
|
+
{"version":3,"file":"application-state.controller.js","sourceRoot":"","sources":["../../../src/application-state/application-state.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAOwB;AACxB,2EAAsE;AACtE,+EAAyE;AACzE,uDAAkD;AAClD,iGAAyF;AACzF,yGAA+F;AAC/F,mFAA4E;AAC5E,iFAA0E;AAC1E,iFAA2E;AAC3E,+DAAyD;AACzD,+EAAyE;AAGlE,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IACrC,YACmB,uBAAgD;QAAhD,4BAAuB,GAAvB,uBAAuB,CAAyB;IAChE,CAAC;IAGE,AAAN,KAAK,CAAC,mBAAmB;QACvB,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,uBAAuB,CAAC,mBAAmB,EAAE,CAAC;QACzE,OAAO,EAAE,OAAO,EAAE,CAAC;IACrB,CAAC;IAIK,AAAN,KAAK,CAAC,mBAAmB,CACf,GAA2B;QAEnC,MAAM,IAAI,CAAC,uBAAuB,CAAC,mBAAmB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACtE,CAAC;IAGK,AAAN,KAAK,CAAC,0BAA0B;QAC9B,MAAM,OAAO,GACX,MAAM,IAAI,CAAC,uBAAuB,CAAC,0BAA0B,EAAE,CAAC;QAClE,OAAO,EAAE,OAAO,EAAE,CAAC;IACrB,CAAC;IAIK,AAAN,KAAK,CAAC,0BAA0B,CACtB,GAAkC;QAE1C,MAAM,IAAI,CAAC,uBAAuB,CAAC,0BAA0B,CAAC,G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CAAC;IACb,IAAA,iBAAQ,EAAC,mBAAU,CAAC,UAAU,CAAC;IAChB,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAM,2BAAW;;0DAEtC;AAGK;IADL,IAAA,YAAG,EAAC,qBAAqB,CAAC;;;;sEAI1B;AAIK;IAFL,IAAA,aAAI,EAAC,qBAAqB,CAAC;IAC3B,IAAA,iBAAQ,EAAC,mBAAU,CAAC,UAAU,CAAC;IAE7B,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAM,qDAAuB;;sEAGrC;AAGK;IADL,IAAA,YAAG,EAAC,mBAAmB,CAAC;;;;qEAIxB;AAIK;IAFL,IAAA,aAAI,EAAC,mBAAmB,CAAC;IACzB,IAAA,iBAAQ,EAAC,mBAAU,CAAC,UAAU,CAAC;IAE7B,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAM,kDAAsB;;qEAGpC;AAGK;IADL,IAAA,YAAG,EAAC,eAAe,CAAC;;;;iEAIpB;qCAvIU,0BAA0B;IADtC,IAAA,mBAAU,EAAC,mBAAmB,CAAC;qCAGc,mDAAuB;GAFxD,0BAA0B,CAwItC"}
|
|
@@ -23,4 +23,8 @@ export declare class ApplicationStateService {
|
|
|
23
23
|
getContextTokenLimit(): Promise<number>;
|
|
24
24
|
setYoloModeEnabled(enabled: boolean): Promise<void>;
|
|
25
25
|
getYoloModeEnabled(): Promise<boolean>;
|
|
26
|
+
setOpenrouterApiKey(apiKey: string): Promise<void>;
|
|
27
|
+
getOpenrouterApiKey(): Promise<string | null>;
|
|
28
|
+
trackUsedModel(modelId: string): Promise<void>;
|
|
29
|
+
getRecentModels(): Promise<string[]>;
|
|
26
30
|
}
|
|
@@ -26,6 +26,8 @@ const EXECUTION_STRATEGY_KEY = 'executionStrategy';
|
|
|
26
26
|
const THEME_KEY = 'theme';
|
|
27
27
|
const CONTEXT_TOKEN_LIMIT_KEY = 'contextTokenLimit';
|
|
28
28
|
const YOLO_MODE_ENABLED_KEY = 'yoloModeEnabled';
|
|
29
|
+
const OPENROUTER_API_KEY = 'openrouterApiKey';
|
|
30
|
+
const RECENT_MODELS_KEY = 'recentModels';
|
|
29
31
|
let ApplicationStateService = class ApplicationStateService {
|
|
30
32
|
constructor(applicationStateRepository) {
|
|
31
33
|
this.applicationStateRepository = applicationStateRepository;
|
|
@@ -125,6 +127,29 @@ let ApplicationStateService = class ApplicationStateService {
|
|
|
125
127
|
}
|
|
126
128
|
return value === 'true';
|
|
127
129
|
}
|
|
130
|
+
async setOpenrouterApiKey(apiKey) {
|
|
131
|
+
await this.setState(OPENROUTER_API_KEY, apiKey);
|
|
132
|
+
}
|
|
133
|
+
async getOpenrouterApiKey() {
|
|
134
|
+
return this.getState(OPENROUTER_API_KEY);
|
|
135
|
+
}
|
|
136
|
+
async trackUsedModel(modelId) {
|
|
137
|
+
const recent = await this.getRecentModels();
|
|
138
|
+
const filtered = recent.filter((m) => m !== modelId);
|
|
139
|
+
const updated = [modelId, ...filtered].slice(0, 5);
|
|
140
|
+
await this.setState(RECENT_MODELS_KEY, JSON.stringify(updated));
|
|
141
|
+
}
|
|
142
|
+
async getRecentModels() {
|
|
143
|
+
const value = await this.getState(RECENT_MODELS_KEY);
|
|
144
|
+
if (!value)
|
|
145
|
+
return [];
|
|
146
|
+
try {
|
|
147
|
+
return JSON.parse(value);
|
|
148
|
+
}
|
|
149
|
+
catch {
|
|
150
|
+
return [];
|
|
151
|
+
}
|
|
152
|
+
}
|
|
128
153
|
};
|
|
129
154
|
exports.ApplicationStateService = ApplicationStateService;
|
|
130
155
|
exports.ApplicationStateService = ApplicationStateService = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application-state.service.js","sourceRoot":"","sources":["../../../src/application-state/application-state.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6CAAmD;AACnD,qCAAqC;AACrC,oDAAoD;AAEpD,MAAM,kBAAkB,GAAG,iBAAiB,CAAC;AAC7C,MAAM,qBAAqB,GAAG,kBAAkB,CAAC;AACjD,MAAM,8BAA8B,GAAG,yBAAyB,CAAC;AACjE,MAAM,kCAAkC,GAAG,2BAA2B,CAAC;AACvE,MAAM,sBAAsB,GAAG,kBAAkB,CAAC;AAClD,MAAM,sBAAsB,GAAG,mBAAmB,CAAC;AACnD,MAAM,SAAS,GAAG,OAAO,CAAC;AAC1B,MAAM,uBAAuB,GAAG,mBAAmB,CAAC;AACpD,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"application-state.service.js","sourceRoot":"","sources":["../../../src/application-state/application-state.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6CAAmD;AACnD,qCAAqC;AACrC,oDAAoD;AAEpD,MAAM,kBAAkB,GAAG,iBAAiB,CAAC;AAC7C,MAAM,qBAAqB,GAAG,kBAAkB,CAAC;AACjD,MAAM,8BAA8B,GAAG,yBAAyB,CAAC;AACjE,MAAM,kCAAkC,GAAG,2BAA2B,CAAC;AACvE,MAAM,sBAAsB,GAAG,kBAAkB,CAAC;AAClD,MAAM,sBAAsB,GAAG,mBAAmB,CAAC;AACnD,MAAM,SAAS,GAAG,OAAO,CAAC;AAC1B,MAAM,uBAAuB,GAAG,mBAAmB,CAAC;AACpD,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;AAChD,MAAM,kBAAkB,GAAG,kBAAkB,CAAC;AAC9C,MAAM,iBAAiB,GAAG,cAAc,CAAC;AAGlC,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAClC,YAEU,0BAAwD;QAAxD,+BAA0B,GAA1B,0BAA0B,CAA8B;IAC/D,CAAC;IAEI,KAAK,CAAC,QAAQ,CAAC,GAAW,EAAE,KAAa;QAC/C,MAAM,IAAI,CAAC,0BAA0B,CAAC,IAAI,CAAC;YACzC,GAAG,EAAE,GAAG;YACR,KAAK,EAAE,KAAK;SACb,CAAC,CAAC;IACL,CAAC;IAEO,KAAK,CAAC,QAAQ,C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,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACnD,MAAM,IAAI,CAAC,QAAQ,CAAC,iBAAiB,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;IAClE,CAAC;IAED,KAAK,CAAC,eAAe;QACnB,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC;QACrD,IAAI,CAAC,KAAK;YAAE,OAAO,EAAE,CAAC;QACtB,IAAI,CAAC;YACH,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC3B,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC;CACF,CAAA;AAzJY,0DAAuB;kCAAvB,uBAAuB;IADnC,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,gCAAgB,CAAC,CAAA;qCACC,oBAAU;GAHrC,uBAAuB,CAyJnC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.SetOpenrouterConfigDto = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
class SetOpenrouterConfigDto {
|
|
15
|
+
}
|
|
16
|
+
exports.SetOpenrouterConfigDto = SetOpenrouterConfigDto;
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, class_validator_1.IsString)(),
|
|
19
|
+
__metadata("design:type", String)
|
|
20
|
+
], SetOpenrouterConfigDto.prototype, "apiKey", void 0);
|
|
21
|
+
//# sourceMappingURL=set-openrouter-config.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set-openrouter-config.dto.js","sourceRoot":"","sources":["../../../../src/application-state/dto/set-openrouter-config.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA2C;AAE3C,MAAa,sBAAsB;CAGlC;AAHD,wDAGC;AADC;IADC,IAAA,0BAAQ,GAAE;;sDACI"}
|
|
@@ -99,6 +99,14 @@ __decorate([
|
|
|
99
99
|
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
100
100
|
__metadata("design:type", String)
|
|
101
101
|
], SessionInput.prototype, "external_turn_id", void 0);
|
|
102
|
+
__decorate([
|
|
103
|
+
(0, typeorm_1.Column)({ type: 'integer', nullable: true }),
|
|
104
|
+
__metadata("design:type", Number)
|
|
105
|
+
], SessionInput.prototype, "input_token_count", void 0);
|
|
106
|
+
__decorate([
|
|
107
|
+
(0, typeorm_1.Column)({ type: 'integer', nullable: true }),
|
|
108
|
+
__metadata("design:type", Number)
|
|
109
|
+
], SessionInput.prototype, "output_token_count", void 0);
|
|
102
110
|
exports.SessionInput = SessionInput = __decorate([
|
|
103
111
|
(0, typeorm_1.Entity)('session_inputs'),
|
|
104
112
|
(0, typeorm_1.Index)(['session_id', 'idempotency_key'], {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-input.entity.js","sourceRoot":"","sources":["../../../src/core-entities/session-input.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAOiB;AACjB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AAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sDACT;AAGhC;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uDACX;AAGjC;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wDACV;uBAvEvB,YAAY;IALxB,IAAA,gBAAM,EAAC,gBAAgB,CAAC;IACxB,IAAA,eAAK,EAAC,CAAC,YAAY,EAAE,iBAAiB,CAAC,EAAE;QACxC,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,+BAA+B;KACvC,CAAC;GACW,YAAY,CAwExB"}
|
|
@@ -3,6 +3,7 @@ import { Project } from './project.entity';
|
|
|
3
3
|
import { ContextTemplate } from './context-template.entity';
|
|
4
4
|
import { SessionInput } from './session-input.entity';
|
|
5
5
|
import { SystemPrompt } from './system-prompt.entity';
|
|
6
|
+
import { ReasoningEffort } from '../llm-provider/llm-provider.interface';
|
|
6
7
|
export declare class Session extends BaseEntity {
|
|
7
8
|
project_id: string | null;
|
|
8
9
|
project: Project;
|
|
@@ -16,6 +17,8 @@ export declare class Session extends BaseEntity {
|
|
|
16
17
|
default_followup_context_template_id: string;
|
|
17
18
|
defaultFollowupContextTemplate: ContextTemplate;
|
|
18
19
|
url: string | null;
|
|
20
|
+
model_id: string | null;
|
|
21
|
+
reasoning_effort: ReasoningEffort | null;
|
|
19
22
|
sessionInputs: SessionInput[];
|
|
20
23
|
sessionInputCount: number;
|
|
21
24
|
}
|