repoburg 1.3.241 → 1.3.243

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.
Files changed (29) hide show
  1. package/agent-pane/frontend/dist/assets/{index-DNe6bagG.css → index-DUnfaPeK.css} +1 -1
  2. package/agent-pane/frontend/dist/assets/{index-CBTsbWig.js → index-KcwodzRz.js} +42 -42
  3. package/agent-pane/frontend/dist/index.html +2 -2
  4. package/backend/dist/tsconfig.build.tsbuildinfo +1 -1
  5. package/daemon/dist/index.js +0 -0
  6. package/package.json +1 -1
  7. package/backend/.env +0 -1
  8. package/backend/section-modified.txt +0 -1
  9. package/miniapp-catalog-modal.png +0 -0
  10. package/miniapp-daemon-e2e-green.png +0 -0
  11. package/miniapp-faz31-codex-green.png +0 -0
  12. package/miniapp-pr-review-green.png +0 -0
  13. package/miniapp-typesafe-verified.png +0 -0
  14. package/miniapp-workspace-scoped.png +0 -0
  15. package/visual-editor-proxy/client/dist/main.js +0 -89
  16. package/visual-editor-proxy/dist/client/src/inspector.d.ts +0 -9
  17. package/visual-editor-proxy/dist/client/src/inspector.js +0 -96
  18. package/visual-editor-proxy/dist/client/src/inspector.js.map +0 -1
  19. package/visual-editor-proxy/dist/client/src/main.d.ts +0 -6
  20. package/visual-editor-proxy/dist/client/src/main.js +0 -108
  21. package/visual-editor-proxy/dist/client/src/main.js.map +0 -1
  22. package/visual-editor-proxy/dist/client/src/ui.d.ts +0 -6
  23. package/visual-editor-proxy/dist/client/src/ui.js +0 -153
  24. package/visual-editor-proxy/dist/client/src/ui.js.map +0 -1
  25. package/visual-editor-proxy/dist/src/main.d.ts +0 -1
  26. package/visual-editor-proxy/dist/src/main.js +0 -61
  27. package/visual-editor-proxy/dist/src/main.js.map +0 -1
  28. package/visual-editor-proxy/dist/tsconfig.tsbuildinfo +0 -1
  29. package/vscode-serve-web-test.png +0 -0
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repoburg",
3
- "version": "1.3.241",
3
+ "version": "1.3.243",
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 +0,0 @@
1
- REPOBURG_PROJECT_PATH=/Users/celalertug/tmp/twenty
@@ -1 +0,0 @@
1
- current
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1,89 +0,0 @@
1
- "use strict";(()=>{function m(e,t=new WeakSet){if(e==null)return e;if(typeof e=="function")return`[Function: ${e.name||"anonymous"}]`;if(typeof e!="object")return e;if(e.$$typeof&&typeof e.$$typeof=="symbol")return`[ReactElement: <${e.type?.displayName||e.type?.name||(typeof e.type=="string"?e.type:"ReactElement")}>]`;if(t.has(e))return"[Circular Reference]";if(t.add(e),Array.isArray(e))return e.map(o=>m(o,t));let n={};for(let o in e)if(Object.prototype.hasOwnProperty.call(e,o)){if(o==="className")continue;n[o]=m(e[o],t)}return n}function g(e){if(e===null||typeof e!="object")return e;if(Array.isArray(e))return e.map(g);let t={};for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let o=e[n];o!==null&&(t[n]=g(o))}return t}function $(e){let t=Object.keys(e).find(n=>n.startsWith("__reactFiber$"));return t?e[t]:null}function I(e){let t=e.elementType;return t?typeof t=="string"?t:t.displayName||t.name||"Anonymous":"FiberRoot"}function y(e){let t=$(e);if(!t)return{error:"Could not find React Fiber for the selected element."};let n=[];for(;t;){let s=t.elementType;if(typeof s=="function"||typeof s=="string"){let d=I(t);n.push({name:d,props:m(t.memoizedProps),state:m(t.memoizedState)})}t=t.return}return n.length===0?{error:"Could not identify any components or elements in this element's hierarchy."}:{hierarchy:n.map(s=>({...s,props:g(s.props),state:g(s.state)}))}}var x;function v(){let e=document.createElement("style");e.textContent=`
2
- #repoburg-float-btn {
3
- position: fixed;
4
- bottom: 20px;
5
- right: 20px;
6
- background-color: #7c3aed;
7
- color: white;
8
- border: none;
9
- border-radius: 50%;
10
- width: 60px;
11
- height: 60px;
12
- font-size: 12px;
13
- font-weight: bold;
14
- cursor: pointer;
15
- box-shadow: 0 4px 12px rgba(0,0,0,0.2);
16
- z-index: 999999;
17
- display: flex;
18
- align-items: center;
19
- justify-content: center;
20
- transition: transform 0.2s ease, background-color 0.2s ease;
21
- }
22
- #repoburg-float-btn:hover {
23
- transform: scale(1.1);
24
- }
25
- #repoburg-float-btn:disabled {
26
- background-color: #585858;
27
- cursor: not-allowed;
28
- transform: none;
29
- }
30
- #repoburg-float-btn.active {
31
- background-color: #c026d3;
32
- }
33
- .repoburg-highlight {
34
- outline: 2px dashed #c026d3 !important;
35
- box-shadow: 0 0 10px rgba(192, 38, 211, 0.5) !important;
36
- background-color: rgba(192, 38, 211, 0.1) !important;
37
- }
38
- #repoburg-modal-overlay {
39
- position: fixed;
40
- top: 0; left: 0; width: 100%; height: 100%;
41
- background-color: rgba(0,0,0,0.5);
42
- z-index: 1000000;
43
- display: flex;
44
- align-items: center;
45
- justify-content: center;
46
- }
47
- #repoburg-modal {
48
- background-color: #2d3748;
49
- color: #e2e8f0;
50
- padding: 24px;
51
- border-radius: 8px;
52
- width: 90%;
53
- max-width: 600px;
54
- box-shadow: 0 5px 15px rgba(0,0,0,0.3);
55
- }
56
- #repoburg-modal-header { font-size: 1.25rem; font-weight: bold; margin-bottom: 16px; }
57
- #repoburg-modal-textarea { width: 100%; background-color: #1a202c; color: white; border-radius: 4px; padding: 8px; min-height: 150px; border: 1px solid #4a5568; margin-bottom: 16px; }
58
- #repoburg-modal-footer { display: flex; justify-content: flex-end; gap: 8px; }
59
- .repoburg-modal-btn { padding: 8px 16px; border-radius: 4px; border: none; cursor: pointer; }
60
- .repoburg-modal-btn-primary { background-color: #7c3aed; color: white; }
61
- .repoburg-modal-btn-secondary { background-color: #4a5568; color: white; }
62
- #repoburg-toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background-color: #1a202c; color: white; padding: 12px 20px; border-radius: 6px; z-index: 1000001; opacity: 0; transition: opacity 0.3s ease; text-align: center; }
63
- #repoburg-toast.show { opacity: 1; }
64
- #repoburg-toast.error { background-color: #c53030; }
65
- `,document.head.appendChild(e)}function w(e){let t=document.createElement("button");return t.id="repoburg-float-btn",t.textContent="Repo",t.onclick=e,document.body.appendChild(t),t}function E(){let e=document.createElement("div");e.id="repoburg-toast",document.body.appendChild(e)}function k(e,t,n){let o=document.createElement("div");o.id="repoburg-modal-overlay";let s=e[0],d=e.length>1?e[1]:void 0,b=d?d.name:"N/A",h=e.map(a=>a.name).reverse().join(" > ");o.innerHTML=`
66
- <div id="repoburg-modal">
67
- <div id="repoburg-modal-header">Edit Component</div>
68
- <p style="font-size: 0.9rem; margin-bottom: 8px;"><strong>Component:</strong> ${s.name}</p>
69
- <p style="font-size: 0.9rem; margin-bottom: 16px;"><strong>Parent Context:</strong> ${b}</p>
70
- <p style="font-size: 0.8rem; margin-bottom: 8px; word-break: break-all; opacity: 0.7;"><strong>Path:</strong> ${h}</p>
71
- <p style="font-size: 0.8rem; margin-bottom: 16px; word-break: break-all; opacity: 0.7;"><strong>URL:</strong> ${t}</p>
72
- <textarea id="repoburg-modal-textarea" placeholder="Enter your prompt... (e.g., 'add a confirmation icon to this button')"></textarea>
73
- <div id="repoburg-modal-footer">
74
- <button id="repoburg-modal-cancel" class="repoburg-modal-btn repoburg-modal-btn-secondary">Cancel</button>
75
- <button id="repoburg-modal-submit" class="repoburg-modal-btn repoburg-modal-btn-primary">Submit</button>
76
- </div>
77
- </div>
78
- `,document.body.appendChild(o);let u=document.getElementById("repoburg-modal-textarea"),r=document.getElementById("repoburg-modal-submit");u.focus();let c=a=>{a.key==="Escape"&&l(),a.key==="Enter"&&(a.metaKey||a.ctrlKey)&&(a.preventDefault(),r.click())};document.addEventListener("keydown",c);let l=()=>{document.removeEventListener("keydown",c),o.remove()};document.getElementById("repoburg-modal-cancel").onclick=l,o.onclick=a=>{a.target===o&&l()},r.onclick=async()=>{let a=u.value;a.trim()&&(await n(a,e,t),l())}}function p(e,t="success",n=3e3){let o=document.getElementById("repoburg-toast");o&&(o.textContent=e,o.className=t==="error"?"error":"",o.classList.add("show"),clearTimeout(x),x=window.setTimeout(()=>{o.classList.remove("show")},n))}var f=!1,i=null;function C(e){i&&i.classList.remove("repoburg-highlight"),i=e.target,i.classList.add("repoburg-highlight")}function T(){i&&(i.classList.remove("repoburg-highlight"),i=null)}function L(e){if(e.preventDefault(),e.stopPropagation(),P(),!i)return;let t=y(i);t.error||!t.hierarchy?p(t.error||"Unknown error","error"):k(t.hierarchy,window.location.href,O)}function P(){f=!f;let e=document.getElementById("repoburg-float-btn");f?(e.classList.add("active"),e.textContent="Exit",document.addEventListener("mouseover",C),document.addEventListener("mouseout",T),document.addEventListener("click",L,!0)):(e.classList.remove("active"),e.textContent="Repo",i&&i.classList.remove("repoburg-highlight"),document.removeEventListener("mouseover",C),document.removeEventListener("mouseout",T),document.removeEventListener("click",L,!0))}async function O(e,t,n){let o=window.REPOBURG_BACKEND_PORT;if(!o){p("Repoburg backend port not found.","error");return}let s=t.slice().reverse().map((r,c)=>{let l=" ".repeat(c),a=JSON.stringify(r.props),R=r.state&&Object.keys(r.state).length>0?`, state: ${JSON.stringify(r.state)}`:"";return`${l}- ${r.name} (props: ${a}${R})`}).join(`
79
- `),u={prompt:`${`--- Visual Inspector Context ---
80
- URL: ${n}
81
-
82
- This data structure is a React Component Tree, representing the hierarchy of components from the application's root down to the element the user selected. The indentation signifies the parent-child nesting relationship. Each line contains the component/element name, its 'props' (data passed down to it), and its 'state' (internal data it manages). As an AI agent, use this structural and data context to understand the application's architecture and the flow of information related to the user's request. The last element in the list is the user's direct target.
83
-
84
- Component Hierarchy:
85
- ${s}
86
-
87
- --- User Prompt ---`}
88
-
89
- ${e}`,componentPath:"",parentComponentPath:void 0};try{let r=await fetch(`http://localhost:${o}/visual-editor/submit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(u)});if(!r.ok){let c=await r.json().catch(()=>({message:"Failed to submit prompt"}));throw new Error(c.message)}p("Prompt submitted successfully!")}catch(r){console.error("Repoburg Error:",r),p(r instanceof Error?r.message:String(r),"error")}}function B(){document.getElementById("repoburg-float-btn")||(console.log("Repoburg Visual Editor: Initializing UI."),console.log("Repoburg Backend Port:",window.REPOBURG_BACKEND_PORT||"Not Set"),v(),E(),w(P))}B();})();
@@ -1,9 +0,0 @@
1
- export interface ComponentInfo {
2
- name: string;
3
- props: any;
4
- state: any;
5
- }
6
- export declare function getComponentTreeFromElement(element: HTMLElement): {
7
- hierarchy?: ComponentInfo[];
8
- error?: string;
9
- };
@@ -1,96 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getComponentTreeFromElement = getComponentTreeFromElement;
4
- function serializeComplexObject(obj, seen = new WeakSet()) {
5
- if (obj === null || obj === undefined) {
6
- return obj;
7
- }
8
- if (typeof obj === 'function') {
9
- return `[Function: ${obj.name || 'anonymous'}]`;
10
- }
11
- if (typeof obj !== 'object') {
12
- return obj;
13
- }
14
- if (obj.$$typeof && typeof obj.$$typeof === 'symbol') {
15
- const componentName = obj.type?.displayName || obj.type?.name || (typeof obj.type === 'string' ? obj.type : 'ReactElement');
16
- return `[ReactElement: <${componentName}>]`;
17
- }
18
- if (seen.has(obj)) {
19
- return '[Circular Reference]';
20
- }
21
- seen.add(obj);
22
- if (Array.isArray(obj)) {
23
- return obj.map(item => serializeComplexObject(item, seen));
24
- }
25
- const newObj = {};
26
- for (const key in obj) {
27
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
28
- if (key === 'className') {
29
- continue;
30
- }
31
- newObj[key] = serializeComplexObject(obj[key], seen);
32
- }
33
- }
34
- return newObj;
35
- }
36
- function cleanupNullValues(obj) {
37
- if (obj === null || typeof obj !== 'object') {
38
- return obj;
39
- }
40
- if (Array.isArray(obj)) {
41
- return obj.map(cleanupNullValues);
42
- }
43
- const newObj = {};
44
- for (const key in obj) {
45
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
46
- const value = obj[key];
47
- if (value !== null) {
48
- newObj[key] = cleanupNullValues(value);
49
- }
50
- }
51
- }
52
- return newObj;
53
- }
54
- function getFiberFromElement(element) {
55
- const fiberKey = Object.keys(element).find(key => key.startsWith('__reactFiber$'));
56
- return fiberKey ? element[fiberKey] : null;
57
- }
58
- function getComponentName(fiber) {
59
- const componentType = fiber.elementType;
60
- if (!componentType) {
61
- return 'FiberRoot';
62
- }
63
- if (typeof componentType === 'string') {
64
- return componentType;
65
- }
66
- return componentType.displayName || componentType.name || 'Anonymous';
67
- }
68
- function getComponentTreeFromElement(element) {
69
- let fiber = getFiberFromElement(element);
70
- if (!fiber) {
71
- return { error: 'Could not find React Fiber for the selected element.' };
72
- }
73
- const hierarchy = [];
74
- while (fiber) {
75
- const elementType = fiber.elementType;
76
- if (typeof elementType === 'function' || typeof elementType === 'string') {
77
- const name = getComponentName(fiber);
78
- hierarchy.push({
79
- name,
80
- props: serializeComplexObject(fiber.memoizedProps),
81
- state: serializeComplexObject(fiber.memoizedState),
82
- });
83
- }
84
- fiber = fiber.return;
85
- }
86
- if (hierarchy.length === 0) {
87
- return { error: 'Could not identify any components or elements in this element\'s hierarchy.' };
88
- }
89
- const cleanedHierarchy = hierarchy.map(item => ({
90
- ...item,
91
- props: cleanupNullValues(item.props),
92
- state: cleanupNullValues(item.state),
93
- }));
94
- return { hierarchy: cleanedHierarchy };
95
- }
96
- //# sourceMappingURL=inspector.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"inspector.js","sourceRoot":"","sources":["../../../client/src/inspector.ts"],"names":[],"mappings":";;AAyGA,kEAsCC;AApID,SAAS,sBAAsB,CAAC,GAAQ,EAAE,IAAI,GAAG,IAAI,OAAO,EAAE;IAC1D,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;QACpC,OAAO,GAAG,CAAC;IACf,CAAC;IAGD,IAAI,OAAO,GAAG,KAAK,UAAU,EAAE,CAAC;QAC5B,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ND_PORT?: number;
4
- }
5
- }
6
- export {};
@@ -1,108 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const inspector_1 = require("./inspector");
4
- const ui_1 = require("./ui");
5
- let isSelectorModeActive = false;
6
- let currentHoveredElement = null;
7
- function handleMouseOver(e) {
8
- if (currentHoveredElement) {
9
- currentHoveredElement.classList.remove('repoburg-highlight');
10
- }
11
- currentHoveredElement = e.target;
12
- currentHoveredElement.classList.add('repoburg-highlight');
13
- }
14
- function handleMouseOut() {
15
- if (currentHoveredElement) {
16
- currentHoveredElement.classList.remove('repoburg-highlight');
17
- currentHoveredElement = null;
18
- }
19
- }
20
- function handleClick(e) {
21
- e.preventDefault();
22
- e.stopPropagation();
23
- toggleSelectorMode();
24
- if (!currentHoveredElement)
25
- return;
26
- const result = (0, inspector_1.getComponentTreeFromElement)(currentHoveredElement);
27
- if (result.error || !result.hierarchy) {
28
- (0, ui_1.showToast)(result.error || 'Unknown error', 'error');
29
- }
30
- else {
31
- (0, ui_1.showPromptModal)(result.hierarchy, window.location.href, submitPrompt);
32
- }
33
- }
34
- function toggleSelectorMode() {
35
- isSelectorModeActive = !isSelectorModeActive;
36
- const button = document.getElementById('repoburg-float-btn');
37
- if (isSelectorModeActive) {
38
- button.classList.add('active');
39
- button.textContent = 'Exit';
40
- document.addEventListener('mouseover', handleMouseOver);
41
- document.addEventListener('mouseout', handleMouseOut);
42
- document.addEventListener('click', handleClick, true);
43
- }
44
- else {
45
- button.classList.remove('active');
46
- button.textContent = 'Repo';
47
- if (currentHoveredElement) {
48
- currentHoveredElement.classList.remove('repoburg-highlight');
49
- }
50
- document.removeEventListener('mouseover', handleMouseOver);
51
- document.removeEventListener('mouseout', handleMouseOut);
52
- document.removeEventListener('click', handleClick, true);
53
- }
54
- }
55
- async function submitPrompt(prompt, hierarchy, url) {
56
- const backendPort = window.REPOBURG_BACKEND_PORT;
57
- if (!backendPort) {
58
- (0, ui_1.showToast)('Repoburg backend port not found.', 'error');
59
- return;
60
- }
61
- const hierarchyText = hierarchy
62
- .slice()
63
- .reverse()
64
- .map((component, index) => {
65
- const indent = ' '.repeat(index);
66
- const propsString = JSON.stringify(component.props);
67
- const stateString = component.state && Object.keys(component.state).length > 0
68
- ? `, state: ${JSON.stringify(component.state)}`
69
- : '';
70
- return `${indent}- ${component.name} (props: ${propsString}${stateString})`;
71
- })
72
- .join('\n');
73
- const explanationForAI = `This data structure is a React Component Tree, representing the hierarchy of components from the application's root down to the element the user selected. The indentation signifies the parent-child nesting relationship. Each line contains the component/element name, its 'props' (data passed down to it), and its 'state' (internal data it manages). As an AI agent, use this structural and data context to understand the application's architecture and the flow of information related to the user's request. The last element in the list is the user's direct target.`;
74
- const contextHeader = `--- Visual Inspector Context ---\nURL: ${url}\n\n${explanationForAI}\n\nComponent Hierarchy:\n${hierarchyText}\n\n--- User Prompt ---`;
75
- const fullPrompt = `${contextHeader}\n\n${prompt}`;
76
- const payload = {
77
- prompt: fullPrompt,
78
- componentPath: '',
79
- parentComponentPath: undefined,
80
- };
81
- try {
82
- const response = await fetch(`http://localhost:${backendPort}/visual-editor/submit`, {
83
- method: 'POST',
84
- headers: { 'Content-Type': 'application/json' },
85
- body: JSON.stringify(payload),
86
- });
87
- if (!response.ok) {
88
- const errorData = await response.json().catch(() => ({ message: 'Failed to submit prompt' }));
89
- throw new Error(errorData.message);
90
- }
91
- (0, ui_1.showToast)('Prompt submitted successfully!');
92
- }
93
- catch (error) {
94
- console.error('Repoburg Error:', error);
95
- (0, ui_1.showToast)(error instanceof Error ? error.message : String(error), 'error');
96
- }
97
- }
98
- function initialize() {
99
- if (document.getElementById('repoburg-float-btn'))
100
- return;
101
- console.log('Repoburg Visual Editor: Initializing UI.');
102
- console.log('Repoburg Backend Port:', window.REPOBURG_BACKEND_PORT || 'Not Set');
103
- (0, ui_1.injectStyles)();
104
- (0, ui_1.createToast)();
105
- (0, ui_1.createFloatingButton)(toggleSelectorMode);
106
- }
107
- initialize();
108
- //# sour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AC,CAAC,CAAC;YAC9F,MAAM,IAAI,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QACvC,CAAC;QAED,IAAA,cAAS,EAAC,gCAAgC,CAAC,CAAC;IAChD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAC;QACxC,IAAA,cAAS,EAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC;IAC/E,CAAC;AACL,CAAC;AAKD,SAAS,UAAU;IAEf,IAAI,QAAQ,CAAC,cAAc,CAAC,oBAAoB,CAAC;QAAE,OAAO;IAE1D,OAAO,CAAC,GAAG,CAAC,0CAA0C,CAAC,CAAC;IACxD,OAAO,CAAC,GAAG,CAAC,wBAAwB,EAAE,MAAM,CAAC,qBAAqB,IAAI,SAAS,CAAC,CAAC;IAEjF,IAAA,iBAAY,GAAE,CAAC;IACf,IAAA,gBAAW,GAAE,CAAC;IACd,IAAA,yBAAoB,EAAC,kBAAkB,CAAC,CAAC;AAC7C,CAAC;AAGD,UAAU,EAAE,CAAC"}
@@ -1,6 +0,0 @@
1
- import { ComponentInfo } from './inspector';
2
- export declare function injectStyles(): void;
3
- export declare function createFloatingButton(onClick: () => void): HTMLButtonElement;
4
- export declare function createToast(): void;
5
- export declare function showPromptModal(hierarchy: ComponentInfo[], url: string, submitCallback: (prompt: string, hierarchy: ComponentInfo[], url: string) => Promise<void>): void;
6
- export declare function showToast(message: string, type?: 'success' | 'error', duration?: number): void;
@@ -1,153 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.injectStyles = injectStyles;
4
- exports.createFloatingButton = createFloatingButton;
5
- exports.createToast = createToast;
6
- exports.showPromptModal = showPromptModal;
7
- exports.showToast = showToast;
8
- let toastTimeout;
9
- function injectStyles() {
10
- const style = document.createElement('style');
11
- style.textContent = `
12
- #repoburg-float-btn {
13
- position: fixed;
14
- bottom: 20px;
15
- right: 20px;
16
- background-color: #7c3aed;
17
- color: white;
18
- border: none;
19
- border-radius: 50%;
20
- width: 60px;
21
- height: 60px;
22
- font-size: 12px;
23
- font-weight: bold;
24
- cursor: pointer;
25
- box-shadow: 0 4px 12px rgba(0,0,0,0.2);
26
- z-index: 999999;
27
- display: flex;
28
- align-items: center;
29
- justify-content: center;
30
- transition: transform 0.2s ease, background-color 0.2s ease;
31
- }
32
- #repoburg-float-btn:hover {
33
- transform: scale(1.1);
34
- }
35
- #repoburg-float-btn:disabled {
36
- background-color: #585858;
37
- cursor: not-allowed;
38
- transform: none;
39
- }
40
- #repoburg-float-btn.active {
41
- background-color: #c026d3;
42
- }
43
- .repoburg-highlight {
44
- outline: 2px dashed #c026d3 !important;
45
- box-shadow: 0 0 10px rgba(192, 38, 211, 0.5) !important;
46
- background-color: rgba(192, 38, 211, 0.1) !important;
47
- }
48
- #repoburg-modal-overlay {
49
- position: fixed;
50
- top: 0; left: 0; width: 100%; height: 100%;
51
- background-color: rgba(0,0,0,0.5);
52
- z-index: 1000000;
53
- display: flex;
54
- align-items: center;
55
- justify-content: center;
56
- }
57
- #repoburg-modal {
58
- background-color: #2d3748;
59
- color: #e2e8f0;
60
- padding: 24px;
61
- border-radius: 8px;
62
- width: 90%;
63
- max-width: 600px;
64
- box-shadow: 0 5px 15px rgba(0,0,0,0.3);
65
- }
66
- #repoburg-modal-header { font-size: 1.25rem; font-weight: bold; margin-bottom: 16px; }
67
- #repoburg-modal-textarea { width: 100%; background-color: #1a202c; color: white; border-radius: 4px; padding: 8px; min-height: 150px; border: 1px solid #4a5568; margin-bottom: 16px; }
68
- #repoburg-modal-footer { display: flex; justify-content: flex-end; gap: 8px; }
69
- .repoburg-modal-btn { padding: 8px 16px; border-radius: 4px; border: none; cursor: pointer; }
70
- .repoburg-modal-btn-primary { background-color: #7c3aed; color: white; }
71
- .repoburg-modal-btn-secondary { background-color: #4a5568; color: white; }
72
- #repoburg-toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background-color: #1a202c; color: white; padding: 12px 20px; border-radius: 6px; z-index: 1000001; opacity: 0; transition: opacity 0.3s ease; text-align: center; }
73
- #repoburg-toast.show { opacity: 1; }
74
- #repoburg-toast.error { background-color: #c53030; }
75
- `;
76
- document.head.appendChild(style);
77
- }
78
- function createFloatingButton(onClick) {
79
- const button = document.createElement('button');
80
- button.id = 'repoburg-float-btn';
81
- button.textContent = 'Repo';
82
- button.onclick = onClick;
83
- document.body.appendChild(button);
84
- return button;
85
- }
86
- function createToast() {
87
- const toast = document.createElement('div');
88
- toast.id = 'repoburg-toast';
89
- document.body.appendChild(toast);
90
- }
91
- function showPromptModal(hierarchy, url, submitCallback) {
92
- const overlay = document.createElement('div');
93
- overlay.id = 'repoburg-modal-overlay';
94
- const component = hierarchy[0];
95
- const parent = hierarchy.length > 1 ? hierarchy[1] : undefined;
96
- const parentName = parent ? parent.name : 'N/A';
97
- const breadcrumbs = hierarchy.map(c => c.name).reverse().join(' > ');
98
- overlay.innerHTML = `
99
- <div id="repoburg-modal">
100
- <div id="repoburg-modal-header">Edit Component</div>
101
- <p style="font-size: 0.9rem; margin-bottom: 8px;"><strong>Component:</strong> ${component.name}</p>
102
- <p style="font-size: 0.9rem; margin-bottom: 16px;"><strong>Parent Context:</strong> ${parentName}</p>
103
- <p style="font-size: 0.8rem; margin-bottom: 8px; word-break: break-all; opacity: 0.7;"><strong>Path:</strong> ${breadcrumbs}</p>
104
- <p style="font-size: 0.8rem; margin-bottom: 16px; word-break: break-all; opacity: 0.7;"><strong>URL:</strong> ${url}</p>
105
- <textarea id="repoburg-modal-textarea" placeholder="Enter your prompt... (e.g., 'add a confirmation icon to this button')"></textarea>
106
- <div id="repoburg-modal-footer">
107
- <button id="repoburg-modal-cancel" class="repoburg-modal-btn repoburg-modal-btn-secondary">Cancel</button>
108
- <button id="repoburg-modal-submit" class="repoburg-modal-btn repoburg-modal-btn-primary">Submit</button>
109
- </div>
110
- </div>
111
- `;
112
- document.body.appendChild(overlay);
113
- const promptInput = document.getElementById('repoburg-modal-textarea');
114
- const submitButton = document.getElementById('repoburg-modal-submit');
115
- promptInput.focus();
116
- const handleKeyDown = (event) => {
117
- if (event.key === 'Escape') {
118
- closeModal();
119
- }
120
- if (event.key === 'Enter' && (event.metaKey || event.ctrlKey)) {
121
- event.preventDefault();
122
- submitButton.click();
123
- }
124
- };
125
- document.addEventListener('keydown', handleKeyDown);
126
- const closeModal = () => {
127
- document.removeEventListener('keydown', handleKeyDown);
128
- overlay.remove();
129
- };
130
- document.getElementById('repoburg-modal-cancel').onclick = closeModal;
131
- overlay.onclick = (e) => { if (e.target === overlay)
132
- closeModal(); };
133
- submitButton.onclick = async () => {
134
- const prompt = promptInput.value;
135
- if (!prompt.trim())
136
- return;
137
- await submitCallback(prompt, hierarchy, url);
138
- closeModal();
139
- };
140
- }
141
- function showToast(message, type = 'success', duration = 3000) {
142
- const toast = document.getElementById('repoburg-toast');
143
- if (!toast)
144
- return;
145
- toast.textContent = message;
146
- toast.className = type === 'error' ? 'error' : '';
147
- toast.classList.add('show');
148
- clearTimeout(toastTimeout);
149
- toastTimeout = window.setTimeout(() => {
150
- toast.classList.remove('show');
151
- }, duration);
152
- }
153
- //# sourceMappingURL=ui.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ui.js","sourceRoot":"","sources":["../../../client/src/ui.ts"],"names":[],"mappings":";;AAOA,oCAoEC;AAKD,oDAOC;AAKD,kCAIC;AAKD,0CA+DC;AAKD,8BAYC;AAnLD,IAAI,YAAoB,CAAC;AAKzB,SAAgB,YAAY;IACxB,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAC9C,KAAK,CAAC,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAgEn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CAAC;QACjC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE;YAAE,OAAO;QAC3B,MAAM,cAAc,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC;QAC7C,UAAU,EAAE,CAAC;IACjB,CAAC,CAAC;AACN,CAAC;AAKD,SAAgB,SAAS,CAAC,OAAe,EAAE,OAA4B,SAAS,EAAE,WAAmB,IAAI;IACrG,MAAM,KAAK,GAAG,QAAQ,CAAC,cAAc,CAAC,gBAAgB,CAAmB,CAAC;IAC1E,IAAI,CAAC,KAAK;QAAE,OAAO;IAEnB,KAAK,CAAC,WAAW,GAAG,OAAO,CAAC;IAC5B,KAAK,CAAC,SAAS,GAAG,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;IAClD,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAE5B,YAAY,CAAC,YAAY,CAAC,CAAC;IAC3B,YAAY,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE;QAClC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC,EAAE,QAAQ,CAAC,CAAC;AACjB,CAAC"}
@@ -1 +0,0 @@
1
- export {};
@@ -1,61 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const express = require("express");
4
- const http_proxy_middleware_1 = require("http-proxy-middleware");
5
- const http_1 = require("http");
6
- const path = require("path");
7
- const app = express();
8
- const PORT = process.env.PROXY_PORT || 9999;
9
- const TARGET_URL = process.env.TARGET_URL;
10
- const BACKEND_PORT = process.env.BACKEND_PORT;
11
- if (!TARGET_URL) {
12
- console.error('FATAL: TARGET_URL environment variable is not set.');
13
- process.exit(1);
14
- }
15
- app.get('/repoburg-visual-editor.js', (req, res) => {
16
- const clientScriptPath = path.resolve(__dirname, '../../client/dist/main.js');
17
- const options = {
18
- headers: {
19
- 'Content-Type': 'application/javascript',
20
- },
21
- };
22
- res.sendFile(clientScriptPath, options, (err) => {
23
- if (err) {
24
- console.error("Error sending client script:", err);
25
- res.status(500).send("Could not load client script.");
26
- }
27
- });
28
- });
29
- const proxy = (0, http_proxy_middleware_1.createProxyMiddleware)({
30
- target: TARGET_URL,
31
- changeOrigin: true,
32
- selfHandleResponse: true,
33
- on: {
34
- proxyRes: (0, http_proxy_middleware_1.responseInterceptor)(async (responseBuffer, proxyRes, req, res) => {
35
- const contentType = proxyRes.headers['content-type'];
36
- if (contentType && contentType.includes('text/html')) {
37
- const html = responseBuffer.toString('utf8');
38
- const scriptToInject = `<script>window.REPOBURG_BACKEND_PORT = ${BACKEND_PORT};</script><script src="/repoburg-visual-editor.js"></script>`;
39
- return html.replace('</body>', `${scriptToInject}</body>`);
40
- }
41
- return responseBuffer;
42
- }),
43
- error: (err, req, res) => {
44
- console.error('Proxy error:', err);
45
- if (res instanceof http_1.ServerResponse) {
46
- if (!res.headersSent) {
47
- res.writeHead(500, { 'Content-Type': 'text/plain' });
48
- }
49
- }
50
- res.end('Proxy Error');
51
- }
52
- },
53
- });
54
- app.use('/', proxy);
55
- app.listen(PORT, () => {
56
- console.log(`\nRepoburg Visual Editor is running!`);
57
- console.log(`- Proxy URL: http://localhost:${PORT}`);
58
- console.log(`- Target App: ${TARGET_URL}`);
59
- console.log(`- Backend Port: ${BACKEND_PORT || 'Not Set'}\n`);
60
- });
61
- //# sourceMappingURL=main.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":";;AAAA,mCAAmC;AACnC,iEAAmF;AACnF,+BAAsC;AACtC,6BAA6B;AAE7B,MAAM,GAAG,GAAG,OAAO,EAAE,CAAC;AACtB,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,IAAI,CAAC;AAC5C,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC;AAC1C,MAAM,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