repoburg 1.3.85 → 1.3.87

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.
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repoburg",
3
- "version": "1.3.85",
3
+ "version": "1.3.87",
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",
package/backend/.env DELETED
@@ -1,20 +0,0 @@
1
- #react project
2
- #REPOBURG_PROJECT_PATH='/Users/celalertug/WebstormProjects/ttt1234'
3
- #REPOBURG_PROJECT_PATH=/Users/celalertug/Desktop/tmp/repoburg-preview-boilerplate-main
4
-
5
- #modern football
6
- #REPOBURG_PROJECT_PATH=/Users/celalertug/WebstormProjects/fm1
7
-
8
- # handbag
9
- REPOBURG_PROJECT_PATH=/Users/celalertug/tmp/handbag-main
10
-
11
-
12
- # webcoder
13
- # REPOBURG_PROJECT_PATH=/Users/celalertug/github/webcoder
14
-
15
-
16
-
17
- # appdev
18
- # REPOBURG_PROJECT_PATH=/Users/celalertug/everest/tmpappdev2
19
-
20
- QUICK_EDIT_LOG_DIR=/Users/celalertug/.repoburg/quick-edit-logs
@@ -1,53 +0,0 @@
1
- # Repoburg Tool Hooks
2
-
3
- This directory contains TypeScript scripts that can be attached to AI tool execution events.
4
- You can configure these hooks in the "Tool Hooks" section of the Repoburg UI.
5
-
6
- ## How it works
7
-
8
- 1. **Create a script** in this folder (e.g., `audit-patch.ts`).
9
- 2. **Go to UI**: Open Repoburg -> Tool Hooks -> Add Hook.
10
- 3. **Configure**: Select the tool (e.g., `patch`), timing (`before` or `after`), and your script.
11
-
12
- ## Script Interface
13
-
14
- Your script must **export a default function** that receives the context.
15
-
16
- ### Input Context
17
-
18
- ```typescript
19
- interface HookContext {
20
- hook_type: 'before' | 'after';
21
-
22
- action: {
23
- tool_name: string; // e.g. "patch"
24
- args: any; // e.g. { file_path: "src/app.ts", patch_code: "..." }
25
-
26
- // Only present for 'after' hooks
27
- result?: {
28
- status: 'SUCCESS' | 'FAILURE';
29
- output?: string;
30
- error?: string;
31
- };
32
- };
33
-
34
- plan_context: any; // Shared state of the current AI plan
35
- }
36
- ```
37
-
38
- ### Output Format
39
-
40
- Your function should return an object (or void if passive):
41
-
42
- ```typescript
43
- interface HookOutput {
44
- // If true, the AI plan stops immediately.
45
- should_halt_plan?: boolean;
46
-
47
- // Optional message to log in the UI
48
- message?: string;
49
-
50
- // Optional data to merge back into the plan context
51
- update_context?: Record<string, any>;
52
- }
53
- ```
@@ -1,46 +0,0 @@
1
- /**
2
- * ESLint Validation Hook
3
- *
4
- * Usage: Attach as 'after' hook to 'create_file', 'edit_file', 'patch'.
5
- */
6
- import { exec } from 'child_process';
7
- import { promisify } from 'util';
8
-
9
- const execAsync = promisify(exec);
10
-
11
- // Redefining types locally since this runs in a standalone VM context
12
- export interface HookContext {
13
- action: {
14
- tool_name: string;
15
- args: { file_path?: string; [key: string]: any };
16
- };
17
- plan_context: {
18
- feedback: {
19
- validationErrors: Array<{ tool_name: string; error: string }>;
20
- };
21
- };
22
- }
23
-
24
- export default async function(context: HookContext) {
25
- const filePath = context.action.args.file_path;
26
- if (!filePath) return;
27
-
28
- console.log(`[Hook] Running ESLint on ${filePath}`);
29
-
30
- try {
31
- // Adjust command as needed for your project structure
32
- // We use --no-color to keep the error message clean for the AI
33
- await execAsync(`npx eslint "${filePath}" --no-color`);
34
- } catch (e: any) {
35
- const errorOutput = e.stdout || e.stderr || e.message;
36
-
37
- console.log(`[Hook] ESLint failed for ${filePath}`);
38
-
39
- // Inject error into the shared plan context
40
- // The orchestration engine will pick this up and present it to the AI in the next turn (or immediate feedback)
41
- context.plan_context.feedback.validationErrors.push({
42
- tool_name: context.action.tool_name,
43
- error: `ESLint check failed:\n${errorOutput}`
44
- });
45
- }
46
- }
@@ -1,62 +0,0 @@
1
- /**
2
- * Example Hook Script
3
- *
4
- * Usage:
5
- * 1. Attach to 'patch' or 'edit_file' tool as a 'before' hook.
6
- * 2. It will block edits to any file with 'lock' in the name.
7
- */
8
-
9
- // --- Type Definitions ---
10
-
11
- export interface HookAction {
12
- tool_name: string;
13
- args: Record<string, any>;
14
- // Only present for 'after' hooks
15
- result?: {
16
- status: 'SUCCESS' | 'FAILURE';
17
- output?: string;
18
- error?: string;
19
- };
20
- }
21
-
22
- export interface HookContext {
23
- hook_type: 'before' | 'after';
24
- action: HookAction;
25
- plan_context: any; // Shared state of the current AI plan
26
- }
27
-
28
- export interface HookOutput {
29
- // If true, the AI plan stops immediately.
30
- should_halt_plan?: boolean;
31
-
32
- // Optional message to log in the UI
33
- message?: string;
34
-
35
- // Optional data to merge back into the plan context
36
- update_context?: Record<string, any>;
37
- }
38
-
39
- // --- Hook Logic ---
40
-
41
- export default async function(context: HookContext): Promise<HookOutput | void> {
42
- // 1. Extract Data
43
- const filePath = context.action?.args?.file_path || '';
44
-
45
- // Log to console (appears in backend logs)
46
- console.log(`[Hook] analyzing action on: ${filePath}`);
47
-
48
- // 2. Logic
49
- if (filePath.includes('lock')) {
50
- // Return Halt Signal
51
- return {
52
- should_halt_plan: true,
53
- message: `BLOCKED: Editing files with "lock" in the name is forbidden by policy. File: ${filePath}`
54
- };
55
- } else {
56
- // Return Pass Signal
57
- return {
58
- should_halt_plan: false,
59
- message: `Hook allowed action on ${filePath}`
60
- };
61
- }
62
- }
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const express_1 = require("express");
4
- const child_process_1 = require("child_process");
5
- const checkAuth_1 = require("../middleware/checkAuth");
6
- const router = (0, express_1.Router)();
7
- router.post('/update', checkAuth_1.checkAuth, (req, res) => {
8
- try {
9
- console.log('[DAEMON] Received request to start update process.');
10
- // Using `spawn` with `detached: true` and `stdio: 'ignore'` allows the parent (daemon)
11
- // to exit while the child (update script) continues running. `unref()` is crucial.
12
- const child = (0, child_process_1.spawn)('repoburg', ['update'], {
13
- detached: true,
14
- stdio: 'ignore',
15
- shell: true,
16
- });
17
- child.unref();
18
- res.status(202).json({ message: 'Update process initiated. The daemon and services will restart shortly.' });
19
- }
20
- catch (error) {
21
- console.error('Failed to spawn update process:', error);
22
- res.status(500).json({ error: 'Failed to start update process.' });
23
- }
24
- });
25
- exports.default = router;
Binary file