repoburg 1.2.0 → 1.2.1
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/.run/backend _ build.run.xml +12 -0
- package/.run/backend _ lint.run.xml +12 -0
- package/.run/backend _ test.run.xml +12 -0
- package/.run/frontend _ build.run.xml +12 -0
- package/.run/frontend _ lint_fix.run.xml +12 -0
- package/CODEMAP.md +182 -0
- package/backend/dist/src/seeding/data/context-templates/default-initial_full-project-context.d.ts +1 -1
- package/backend/dist/src/seeding/data/context-templates/default-initial_full-project-context.js +4 -0
- package/backend/dist/src/seeding/data/context-templates/default-initial_full-project-context.js.map +1 -1
- package/backend/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/CODEBASE_MAP.md +0 -212
- package/backend/dist/src/seeding/data/system-prompts/codebase-explorer.d.ts +0 -2
- package/backend/dist/src/seeding/data/system-prompts/codebase-explorer.js +0 -114
- package/backend/dist/src/seeding/data/system-prompts/codebase-explorer.js.map +0 -1
- package/backend/dist/src/seeding/data/system-prompts/multi-file-action-generator-with-requester.d.ts +0 -2
- package/backend/dist/src/seeding/data/system-prompts/multi-file-action-generator-with-requester.js +0 -201
- package/backend/dist/src/seeding/data/system-prompts/multi-file-action-generator-with-requester.js.map +0 -1
- package/backend/dist/src/seeding/data/system-prompts/packup.d.ts +0 -2
- package/backend/dist/src/seeding/data/system-prompts/packup.js +0 -37
- package/backend/dist/src/seeding/data/system-prompts/packup.js.map +0 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<component name="ProjectRunConfigurationManager">
|
|
2
|
+
<configuration default="false" name="backend > build" type="js.build_tools.npm" nameIsGenerated="true">
|
|
3
|
+
<package-json value="$PROJECT_DIR$/backend/package.json" />
|
|
4
|
+
<command value="run" />
|
|
5
|
+
<scripts>
|
|
6
|
+
<script value="build" />
|
|
7
|
+
</scripts>
|
|
8
|
+
<node-interpreter value="project" />
|
|
9
|
+
<envs />
|
|
10
|
+
<method v="2" />
|
|
11
|
+
</configuration>
|
|
12
|
+
</component>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<component name="ProjectRunConfigurationManager">
|
|
2
|
+
<configuration default="false" name="backend > lint" type="js.build_tools.npm" nameIsGenerated="true">
|
|
3
|
+
<package-json value="$PROJECT_DIR$/backend/package.json" />
|
|
4
|
+
<command value="run" />
|
|
5
|
+
<scripts>
|
|
6
|
+
<script value="lint" />
|
|
7
|
+
</scripts>
|
|
8
|
+
<node-interpreter value="project" />
|
|
9
|
+
<envs />
|
|
10
|
+
<method v="2" />
|
|
11
|
+
</configuration>
|
|
12
|
+
</component>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<component name="ProjectRunConfigurationManager">
|
|
2
|
+
<configuration default="false" name="backend > test" type="js.build_tools.npm" nameIsGenerated="true">
|
|
3
|
+
<package-json value="$PROJECT_DIR$/backend/package.json" />
|
|
4
|
+
<command value="run" />
|
|
5
|
+
<scripts>
|
|
6
|
+
<script value="test" />
|
|
7
|
+
</scripts>
|
|
8
|
+
<node-interpreter value="project" />
|
|
9
|
+
<envs />
|
|
10
|
+
<method v="2" />
|
|
11
|
+
</configuration>
|
|
12
|
+
</component>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<component name="ProjectRunConfigurationManager">
|
|
2
|
+
<configuration default="false" name="frontend > build" type="js.build_tools.npm" nameIsGenerated="true">
|
|
3
|
+
<package-json value="$PROJECT_DIR$/frontend/package.json" />
|
|
4
|
+
<command value="run" />
|
|
5
|
+
<scripts>
|
|
6
|
+
<script value="build" />
|
|
7
|
+
</scripts>
|
|
8
|
+
<node-interpreter value="project" />
|
|
9
|
+
<envs />
|
|
10
|
+
<method v="2" />
|
|
11
|
+
</configuration>
|
|
12
|
+
</component>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<component name="ProjectRunConfigurationManager">
|
|
2
|
+
<configuration default="false" name="frontend > lint:fix" type="js.build_tools.npm" nameIsGenerated="true">
|
|
3
|
+
<package-json value="$PROJECT_DIR$/frontend/package.json" />
|
|
4
|
+
<command value="run" />
|
|
5
|
+
<scripts>
|
|
6
|
+
<script value="lint:fix" />
|
|
7
|
+
</scripts>
|
|
8
|
+
<node-interpreter value="project" />
|
|
9
|
+
<envs />
|
|
10
|
+
<method v="2" />
|
|
11
|
+
</configuration>
|
|
12
|
+
</component>
|
package/CODEMAP.md
ADDED
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
# Repoburg Codemap
|
|
2
|
+
|
|
3
|
+
This document provides a high-level overview of the Repoburg system, focusing on all its constituent projects and how they interact.
|
|
4
|
+
|
|
5
|
+
## System Overview
|
|
6
|
+
|
|
7
|
+
Repoburg's architecture consists of several key components working together:
|
|
8
|
+
|
|
9
|
+
1. **The `backend`**: A NestJS application that runs locally. It has access to the filesystem, manages core logic (sessions, context generation, action execution), and orchestrates the AI workflow. Each `backend` instance is managed by the `daemon`.
|
|
10
|
+
2. **The `frontend`**: A Next.js web application that serves as the main user interface for Repoburg's AI features. It communicates with a specific `backend` instance to manage sessions, view AI-generated plans, and configure the system.
|
|
11
|
+
3. **The `userscripts` (AI Studio PowerTools)**: A userscript that runs in the browser on the Google AI Studio website. It acts as the bridge between the AI chat interface and the local `backend` for the "manual mode" workflow.
|
|
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
|
+
|
|
16
|
+
The core loop is: **Frontend** sends a prompt to the **Backend** -> **Backend** generates context and sends it to an LLM -> The LLM response is sent back to the **Backend** -> **Backend** parses it into a plan -> **Frontend** displays the plan for user review and action. The **Daemon** and **Daemon Desktop** work in the background, managing the lifecycle of the **Backend** service itself. The **Website** handles user accounts and authorizes local devices to use the service.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Backend Architecture (`backend/`)
|
|
21
|
+
|
|
22
|
+
The local server that contains the core application logic.
|
|
23
|
+
|
|
24
|
+
### 🚀 Entry Point & Core
|
|
25
|
+
|
|
26
|
+
- **Entry Point**: `backend/src/main.ts`. Handles server setup, port selection, and global middleware.
|
|
27
|
+
- **Root Module**: `backend/src/app.module.ts`. Imports all other feature modules.
|
|
28
|
+
- **Architecture**: Standard NestJS modular architecture (`*.module.ts`, `*.controller.ts`, `*.service.ts`).
|
|
29
|
+
|
|
30
|
+
### ✨ Key Feature Modules (`backend/src`)
|
|
31
|
+
|
|
32
|
+
#### Session & Orchestration
|
|
33
|
+
- **`/sessions`**: Manages the lifecycle of a user's work session (create, update, load).
|
|
34
|
+
- **`/session-inputs`**: Handles a single turn of interaction (prompt creation, context generation).
|
|
35
|
+
- **`/session-followup`**: Handles creating new sessions that inherit context from previous ones.
|
|
36
|
+
- **`/session-transfer`**: Manages the import and export of session data.
|
|
37
|
+
- **`/llm-responses`**: Receives and processes raw text responses from the LLM.
|
|
38
|
+
- **`/llm-response-parser`**: Parses raw LLM text into structured actions.
|
|
39
|
+
- **`/ai-actions`**: Manages the individual actions (`create_file`, `run_command`) proposed by the AI.
|
|
40
|
+
- **`/action-execution`**: Performs the file system operations or runs shell commands.
|
|
41
|
+
- **`/execution-logs`**: Stores logs from `action-execution`.
|
|
42
|
+
- **`/interactive-chat`**: Orchestrates sending prompts to an LLM for both integrated and manual modes.
|
|
43
|
+
|
|
44
|
+
#### Context & Prompting
|
|
45
|
+
- **`/context-generation`**: Renders context strings from Eta.js templates using built-in helper functions.
|
|
46
|
+
- **`/context-templates`**: CRUD module for managing the main context templates.
|
|
47
|
+
- **`/system-prompts`**: CRUD module for managing the system prompts that define the AI's behavior.
|
|
48
|
+
- **`/context-snippets`**: Manages dynamic, reusable context snippets callable with `!` in a prompt.
|
|
49
|
+
- **`/custom-snippets`**: Manages static, reusable code snippets for the template editor.
|
|
50
|
+
|
|
51
|
+
#### Core Services & Integrations
|
|
52
|
+
- **`/workspace`**: Provides APIs to interact with the local file system (file tree, search, file content).
|
|
53
|
+
- **`/llm-provider` & `/gemini`**: Defines the interface and provides the implementation for the integrated Google Gemini LLM.
|
|
54
|
+
- **`/events`**: The WebSocket gateway for real-time communication between the backend, frontend, and userscripts.
|
|
55
|
+
- **`/application-state`**: Manages global backend settings (e.g., active session, feature flags).
|
|
56
|
+
- **`/mcp`**: Manages connections and tools for the Model Context Protocol (MCP).
|
|
57
|
+
- **`/projects`**: Manages project-specific information.
|
|
58
|
+
- **`/seeding`**: Seeds the database with default data (prompts, templates) on startup.
|
|
59
|
+
- **`/core-entities`**: Contains all TypeORM entity definitions for the database schema.
|
|
60
|
+
- **`/utils`**: Shared utility functions and decorators (e.g., fuzzy search, tracing).
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Frontend Architecture (`frontend/`)
|
|
65
|
+
|
|
66
|
+
The main user interface for interacting with the Repoburg backend.
|
|
67
|
+
|
|
68
|
+
### 🚀 Tech Stack & Structure
|
|
69
|
+
- **Framework**: Next.js (App Router)
|
|
70
|
+
- **Styling**: Tailwind CSS with shadcn/ui components.
|
|
71
|
+
- **State Management**: Zustand.
|
|
72
|
+
|
|
73
|
+
### ✨ Key Directories (`frontend/src`)
|
|
74
|
+
|
|
75
|
+
- **`/app/components`**: Home to the application's React components, organized by feature:
|
|
76
|
+
- **`/pages`**: Top-level components for each main view (e.g., `MainHomePage`, `SettingsPage`).
|
|
77
|
+
- **`/editors`**: Specialized editor components for templates, prompts, and snippets.
|
|
78
|
+
- **`/plan` & `/session`**: Components for displaying AI-generated plans and the conversation history.
|
|
79
|
+
- **`/common`**: Shared components like the command palette and markdown renderers.
|
|
80
|
+
- **`/components/ui`**: The library of low-level, reusable UI components from shadcn/ui.
|
|
81
|
+
- **`/lib/api`**: A collection of strongly-typed functions that handle all HTTP communication with the `backend` API.
|
|
82
|
+
- **`/store`**: Contains all Zustand state management logic, divided into slices for different features (e.g., `session.slice.ts`, `ui.slice.ts`).
|
|
83
|
+
- **`/hooks`**: Custom React hooks, such as those for managing the Monaco editor theme and setup.
|
|
84
|
+
- **`/types`**: Contains all TypeScript type definitions for API payloads and other shared data structures.
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## AI Studio PowerTools (`userscripts/`)
|
|
89
|
+
|
|
90
|
+
The userscript that bridges AI Studio with the local backend for the "manual mode" workflow.
|
|
91
|
+
|
|
92
|
+
### 🚀 Tech Stack & Structure
|
|
93
|
+
- **Language**: TypeScript.
|
|
94
|
+
- **Bundler**: esbuild (`build.js`).
|
|
95
|
+
- **Deployment**: A single bundled `.user.js` file hosted by the `website` and installed via a browser extension like Tampermonkey.
|
|
96
|
+
|
|
97
|
+
### ✨ Key Files (`userscripts/src`)
|
|
98
|
+
- **`index.ts`**: The main entry point. It initializes all features and connects to the `daemon` to find the active `backend` port.
|
|
99
|
+
- **`webSocketHandler.ts`**: Manages the persistent WebSocket connection to the `backend`'s `/events` gateway to receive commands (e.g., prompts to paste).
|
|
100
|
+
- **`clipboardInterceptor.ts`**: Patches the browser's native clipboard APIs to reliably capture text copied from AI Studio. This is crucial for the "Copy & Submit" workflow.
|
|
101
|
+
- **`hotkeys.ts`**: Binds keyboard shortcuts (e.g., `Cmd+\`) to trigger actions.
|
|
102
|
+
- **Core Actions**:
|
|
103
|
+
- `copyAndSubmit.ts`: Implements the "Copy & Submit" workflow, which captures the AI's response and sends it to the `backend`.
|
|
104
|
+
- `pasteAndRun.ts`: Implements the "Paste & Run" workflow, which takes text (from clipboard or WebSocket) and pastes it into the AI Studio prompt input.
|
|
105
|
+
- `scrollAndCopy.ts`: A helper action that scrolls to the bottom of the AI response and copies it.
|
|
106
|
+
- **`settingsManager.ts` & `settingsUI.ts`**: Create and manage a settings panel injected directly into the AI Studio page.
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## Daemon Architecture (`daemon/`)
|
|
111
|
+
|
|
112
|
+
A lightweight, persistent background process that acts as a process manager and authentication proxy.
|
|
113
|
+
|
|
114
|
+
### 🚀 Tech Stack & Structure
|
|
115
|
+
- **Framework**: Express.js
|
|
116
|
+
- **Process Management**: Uses `pm2` programmatically to manage `backend` instances.
|
|
117
|
+
- **Entry Point**: `src/index.ts`.
|
|
118
|
+
|
|
119
|
+
### ✨ Key Files (`daemon/src`)
|
|
120
|
+
- **`serviceManager.ts`**: Core logic for interacting with `pm2` (start, stop, etc.).
|
|
121
|
+
- **`stateManager.ts`**: Persists the list of managed services to a JSON file in `~/.repoburg/`.
|
|
122
|
+
- **`auth/authManager.ts`**: Handles JWT validation for securing daemon endpoints.
|
|
123
|
+
- **`api/`**: Contains the Express routers for the daemon's HTTP API (runs on `localhost:9998`).
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## Website Architecture (`website/`)
|
|
128
|
+
|
|
129
|
+
The public-facing website for documentation, user accounts, and device authorization.
|
|
130
|
+
|
|
131
|
+
### 🚀 Tech Stack & Structure
|
|
132
|
+
- **Framework**: Next.js (App Router)
|
|
133
|
+
- **Authentication/Database**: Supabase for user management and a small amount of data storage.
|
|
134
|
+
- **Styling**: Tailwind CSS with shadcn/ui components.
|
|
135
|
+
|
|
136
|
+
### ✨ Key Directories (`website/src/app`)
|
|
137
|
+
- **`/` (root)**: The main marketing/landing page.
|
|
138
|
+
- **`/dashboard`**: The main page after a user logs in. It handles the device authorization flow.
|
|
139
|
+
- **`/profile`**: Displays user account and subscription details.
|
|
140
|
+
- **`/docs`**: Renders Markdown files from the same directory to serve as product documentation.
|
|
141
|
+
- **`/api/`**: Serverless functions (Next.js Route Handlers) for various tasks:
|
|
142
|
+
- `/api/device/`: Handles the device authorization flow (`initiate` and `poll`).
|
|
143
|
+
- `/api/daemon/token`: Generates short-lived JWTs for securing daemon actions from the dashboard.
|
|
144
|
+
- `/api/version`: A public endpoint to report the latest version of the `repoburg` npm package.
|
|
145
|
+
- **`/auth/callback`**: The OAuth callback route handled by Supabase.
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## Daemon Desktop App (`daemon-desktop/`)
|
|
150
|
+
|
|
151
|
+
A graphical user interface for managing the `daemon` and its services.
|
|
152
|
+
|
|
153
|
+
### 🚀 Tech Stack & Structure
|
|
154
|
+
- **Framework**: Electron with Vite.
|
|
155
|
+
- **UI**: React with shadcn/ui components.
|
|
156
|
+
- **Bundler**: Vite is used for the main, preload, and renderer processes.
|
|
157
|
+
- **Builder**: Electron Forge handles packaging the application for different operating systems.
|
|
158
|
+
|
|
159
|
+
### ✨ Key Files (`daemon-desktop/src`)
|
|
160
|
+
- **`main.ts`**: The Electron main process entry point. It handles window creation, application lifecycle, and interactions with the `daemon` process.
|
|
161
|
+
- **`preload.ts`**: The Electron preload script, securely exposing functions from the `main` process to the `renderer` process.
|
|
162
|
+
- **`renderer.tsx`**: The entry point for the React application that runs in the Electron window.
|
|
163
|
+
- **`App.tsx`**: The main React component that builds the user interface.
|
|
164
|
+
- **`sharedTypes.ts`**: TypeScript definitions shared between the `main` and `renderer` processes to ensure type safety.
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## System Interaction Flow
|
|
169
|
+
|
|
170
|
+
### Authentication & Authorization
|
|
171
|
+
- **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.
|
|
172
|
+
- **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.
|
|
173
|
+
|
|
174
|
+
### Service Management
|
|
175
|
+
- **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.
|
|
176
|
+
- **CLI -> Daemon**: The `repoburg` command-line tool also communicates with the `daemon`'s API to manage services.
|
|
177
|
+
- **Daemon -> Userscript**: The `userscript` queries the `daemon`'s `/registry/get-active-port` endpoint to discover which port the active `backend` is running on.
|
|
178
|
+
|
|
179
|
+
### Core AI Workflow
|
|
180
|
+
- **Backend <-> Frontend**: The `frontend` makes API calls to a specific `backend` instance. It knows the correct port via the `bport` URL query parameter. Real-time updates are sent from backend to frontend via WebSocket.
|
|
181
|
+
- **Backend <-> Userscript**: In manual mode, the `backend` sends `llm-input-generated` events to the `userscript` via WebSocket, telling it to paste a new prompt into AI Studio.
|
|
182
|
+
- **Data from Userscript (HTTP)**: The `userscript` sends the AI's raw response back to the `backend`'s `/llm-responses/submit-external` endpoint.
|
package/backend/dist/src/seeding/data/context-templates/default-initial_full-project-context.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const template_name = "Default Initial";
|
|
2
|
-
export declare const template_content = "\n\n<%~ await it.tree('--gitignore -I \"node_modules|dist|coverage\"') %>\n\n<%~ it.context_snippets_content %>\n\n<%~ it.adhoc_files_content %>\n\n<%~ it.adhoc_folders_content %>\n\n<%~ it.user_input %>\n\n";
|
|
2
|
+
export declare const template_content = "\n\n<%~ await it.tree('--gitignore -I \"node_modules|dist|coverage\"') %>\n\n\n\n<%~ it.context_snippets_content %>\n\n<%~ it.adhoc_files_content %>\n\n<%~ it.adhoc_folders_content %>\n\nUser Request:\n\n<%~ it.user_input %>\n\n";
|
package/backend/dist/src/seeding/data/context-templates/default-initial_full-project-context.js
CHANGED
|
@@ -6,12 +6,16 @@ exports.template_content = `
|
|
|
6
6
|
|
|
7
7
|
<%~ await it.tree('--gitignore -I "node_modules|dist|coverage"') %>
|
|
8
8
|
|
|
9
|
+
|
|
10
|
+
|
|
9
11
|
<%~ it.context_snippets_content %>
|
|
10
12
|
|
|
11
13
|
<%~ it.adhoc_files_content %>
|
|
12
14
|
|
|
13
15
|
<%~ it.adhoc_folders_content %>
|
|
14
16
|
|
|
17
|
+
User Request:
|
|
18
|
+
|
|
15
19
|
<%~ it.user_input %>
|
|
16
20
|
|
|
17
21
|
`;
|
package/backend/dist/src/seeding/data/context-templates/default-initial_full-project-context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-initial_full-project-context.js","sourceRoot":"","sources":["../../../../../src/seeding/data/context-templates/default-initial_full-project-context.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAG,iBAAiB,CAAC;AAClC,QAAA,gBAAgB,GAAG
|
|
1
|
+
{"version":3,"file":"default-initial_full-project-context.js","sourceRoot":"","sources":["../../../../../src/seeding/data/context-templates/default-initial_full-project-context.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAG,iBAAiB,CAAC;AAClC,QAAA,gBAAgB,GAAG;;;;;;;;;;;;;;;;CAgB/B,CAAC"}
|