Download dev-tasks.html from VanyaJ/bada-terminal: direct link, hf CLI and curl.
- Browser
- Download file 30.2 kB
-
https://huggingface.co/VanyaJ/bada-terminal/resolve/main/dev-tasks.html
- Command line
-
hf download hf://VanyaJ/bada-terminal/dev-tasks.html
-
curl -L -o dev-tasks.html https://huggingface.co/VanyaJ/bada-terminal/resolve/main/dev-tasks.html
30.2 kB
| <html> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>π BADA κ°λ° μμ κ΄λ¦¬</title> | |
| <style> | |
| @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap'); | |
| * { margin: 0; padding: 0; box-sizing: border-box; } | |
| :root { | |
| --bg-base: #1e1e2e; | |
| --bg-mantle: #181825; | |
| --bg-crust: #11111b; | |
| --bg-surface0: #313244; | |
| --bg-surface1: #45475a; | |
| --bg-surface2: #585b70; | |
| --text: #cdd6f4; | |
| --text-sub: #a6adc8; | |
| --text-dim: #6c7086; | |
| --purple: #cba6f7; | |
| --green: #a6e3a1; | |
| --blue: #89b4fa; | |
| --yellow: #f9e2af; | |
| --pink: #f5c2e7; | |
| --red: #f38ba8; | |
| --peach: #fab387; | |
| --teal: #94e2d5; | |
| --lavender: #b4befe; | |
| --shadow: rgba(0, 0, 0, 0.3); | |
| } | |
| body { | |
| font-family: 'Inter', -apple-system, sans-serif; | |
| background: var(--bg-base); | |
| color: var(--text); | |
| height: 100vh; | |
| display: flex; | |
| flex-direction: column; | |
| overflow: hidden; | |
| } | |
| /* Header */ | |
| .header { | |
| background: var(--bg-mantle); | |
| border-bottom: 1px solid var(--bg-surface0); | |
| padding: 14px 20px; | |
| display: flex; | |
| align-items: center; | |
| justify-content: space-between; | |
| flex-shrink: 0; | |
| } | |
| .title-area { | |
| display: flex; | |
| align-items: center; | |
| gap: 10px; | |
| } | |
| .title-logo { | |
| font-size: 20px; | |
| background: linear-gradient(135deg, var(--blue), var(--pink)); | |
| -webkit-background-clip: text; | |
| -webkit-text-fill-color: transparent; | |
| font-weight: 700; | |
| } | |
| .tabs { | |
| display: flex; | |
| background: var(--bg-crust); | |
| padding: 4px; | |
| border-radius: 8px; | |
| gap: 4px; | |
| } | |
| .tab-btn { | |
| padding: 8px 16px; | |
| border-radius: 6px; | |
| font-size: 13px; | |
| font-weight: 500; | |
| color: var(--text-sub); | |
| background: transparent; | |
| border: none; | |
| cursor: pointer; | |
| transition: all 0.2s ease; | |
| } | |
| .tab-btn:hover { | |
| color: var(--text); | |
| background: rgba(255, 255, 255, 0.05); | |
| } | |
| .tab-btn.active { | |
| color: var(--bg-base); | |
| background: linear-gradient(135deg, var(--blue), var(--pink)); | |
| font-weight: 600; | |
| box-shadow: 0 4px 12px rgba(245, 194, 231, 0.2); | |
| } | |
| /* Layouts */ | |
| .container { | |
| flex: 1; | |
| display: flex; | |
| position: relative; | |
| overflow: hidden; | |
| } | |
| .tab-content { | |
| flex: 1; | |
| display: none; | |
| flex-direction: column; | |
| padding: 24px; | |
| overflow-y: auto; | |
| height: 100%; | |
| } | |
| .tab-content.active { | |
| display: flex; | |
| } | |
| .card { | |
| background: var(--bg-mantle); | |
| border: 1px solid var(--bg-surface0); | |
| border-radius: 12px; | |
| padding: 20px; | |
| margin-bottom: 20px; | |
| box-shadow: 0 6px 18px var(--shadow); | |
| } | |
| .card-title { | |
| font-size: 16px; | |
| font-weight: 600; | |
| color: var(--lavender); | |
| margin-bottom: 15px; | |
| display: flex; | |
| align-items: center; | |
| gap: 8px; | |
| } | |
| .form-group { | |
| margin-bottom: 16px; | |
| } | |
| label { | |
| display: block; | |
| font-size: 13px; | |
| font-weight: 500; | |
| color: var(--text-sub); | |
| margin-bottom: 6px; | |
| } | |
| input, select, textarea { | |
| width: 100%; | |
| padding: 10px 14px; | |
| background: var(--bg-surface0); | |
| border: 1px solid var(--bg-surface1); | |
| border-radius: 8px; | |
| color: var(--text); | |
| font-size: 13px; | |
| outline: none; | |
| transition: all 0.2s ease; | |
| } | |
| textarea { | |
| resize: vertical; | |
| font-family: inherit; | |
| } | |
| input:focus, select:focus, textarea:focus { | |
| border-color: var(--blue); | |
| box-shadow: 0 0 0 2px rgba(137, 180, 250, 0.15); | |
| } | |
| .btn { | |
| padding: 10px 18px; | |
| border-radius: 8px; | |
| font-size: 13px; | |
| font-weight: 600; | |
| cursor: pointer; | |
| border: none; | |
| transition: all 0.2s ease; | |
| white-space: nowrap; | |
| display: inline-flex; | |
| align-items: center; | |
| gap: 8px; | |
| } | |
| .btn-primary { | |
| background: linear-gradient(135deg, var(--blue), var(--pink)); | |
| color: var(--bg-crust); | |
| } | |
| .btn-primary:hover { | |
| opacity: 0.9; | |
| transform: translateY(-1px); | |
| } | |
| .btn-secondary { | |
| background: var(--bg-surface1); | |
| color: var(--text); | |
| border: 1px solid var(--bg-surface2); | |
| } | |
| .btn-secondary:hover { | |
| background: var(--bg-surface2); | |
| } | |
| /* Kanban Board */ | |
| .kanban-board { | |
| display: grid; | |
| grid-template-columns: repeat(4, 1fr); | |
| gap: 16px; | |
| flex: 1; | |
| overflow-x: auto; | |
| margin-top: 10px; | |
| } | |
| .kanban-col { | |
| background: var(--bg-crust); | |
| border: 1px solid var(--bg-surface0); | |
| border-radius: 10px; | |
| padding: 14px; | |
| display: flex; | |
| flex-direction: column; | |
| max-height: 100%; | |
| overflow-y: auto; | |
| } | |
| .kanban-col-title { | |
| font-size: 13px; | |
| font-weight: 600; | |
| text-transform: uppercase; | |
| letter-spacing: 0.8px; | |
| margin-bottom: 12px; | |
| color: var(--text-dim); | |
| display: flex; | |
| justify-content: space-between; | |
| align-items: center; | |
| } | |
| .kanban-card-list { | |
| display: flex; | |
| flex-direction: column; | |
| gap: 10px; | |
| flex: 1; | |
| } | |
| .kanban-card { | |
| background: var(--bg-mantle); | |
| border: 1px solid var(--bg-surface0); | |
| border-radius: 8px; | |
| padding: 12px; | |
| box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15); | |
| cursor: grab; | |
| transition: all 0.2s ease; | |
| } | |
| .kanban-card:hover { | |
| border-color: var(--blue); | |
| transform: translateY(-1px); | |
| } | |
| .kanban-card-title { | |
| font-size: 13px; | |
| font-weight: 600; | |
| color: var(--lavender); | |
| margin-bottom: 6px; | |
| } | |
| .kanban-card-desc { | |
| font-size: 11px; | |
| color: var(--text-sub); | |
| line-height: 1.4; | |
| margin-bottom: 8px; | |
| } | |
| .kanban-card-meta { | |
| display: flex; | |
| justify-content: space-between; | |
| align-items: center; | |
| font-size: 10px; | |
| color: var(--text-dim); | |
| } | |
| /* Troubleshoot KB list */ | |
| .search-row { | |
| display: flex; | |
| gap: 10px; | |
| margin-bottom: 20px; | |
| } | |
| .troubleshoot-list { | |
| display: flex; | |
| flex-direction: column; | |
| gap: 12px; | |
| } | |
| .troubleshoot-card { | |
| background: var(--bg-mantle); | |
| border: 1px solid var(--bg-surface0); | |
| border-radius: 10px; | |
| padding: 16px; | |
| border-left: 4px solid var(--red); | |
| transition: all 0.2s ease; | |
| } | |
| .troubleshoot-card:hover { | |
| transform: translateY(-1px); | |
| box-shadow: 0 4px 12px rgba(243, 139, 168, 0.1); | |
| } | |
| .ts-header { | |
| display: flex; | |
| justify-content: space-between; | |
| align-items: center; | |
| margin-bottom: 8px; | |
| } | |
| .ts-pattern { | |
| font-family: 'JetBrains Mono', monospace; | |
| font-size: 14px; | |
| font-weight: 600; | |
| color: var(--text); | |
| } | |
| .ts-details { | |
| display: grid; | |
| grid-template-columns: 1fr 1fr; | |
| gap: 15px; | |
| margin-top: 10px; | |
| padding-top: 10px; | |
| border-top: 1px solid var(--bg-surface0); | |
| font-size: 12px; | |
| } | |
| .ts-box-title { | |
| font-weight: 600; | |
| color: var(--yellow); | |
| margin-bottom: 4px; | |
| } | |
| /* Loading Overlay */ | |
| .loading-overlay { | |
| position: absolute; | |
| top: 0; left: 0; right: 0; bottom: 0; | |
| background: rgba(24, 24, 37, 0.85); | |
| z-index: 200; | |
| display: flex; | |
| flex-direction: column; | |
| align-items: center; | |
| justify-content: center; | |
| gap: 15px; | |
| opacity: 0; | |
| pointer-events: none; | |
| transition: opacity 0.25s ease; | |
| backdrop-filter: blur(4px); | |
| } | |
| .loading-overlay.visible { | |
| opacity: 1; | |
| pointer-events: auto; | |
| } | |
| .spinner { | |
| width: 40px; | |
| height: 40px; | |
| border: 4px solid rgba(245, 194, 231, 0.2); | |
| border-top-color: var(--pink); | |
| border-radius: 50%; | |
| animation: spin 1s linear infinite; | |
| } | |
| @keyframes spin { | |
| to { transform: rotate(360deg); } | |
| } | |
| </style> | |
| <script src="src/utils/focus-restorer.js"></script> | |
| </head> | |
| <body> | |
| <!-- Header --> | |
| <div class="header"> | |
| <div class="title-area"> | |
| <div class="title-logo">π BADA κ°λ° μμ κ΄λ¦¬</div> | |
| </div> | |
| <div class="tabs"> | |
| <button class="tab-btn active" onclick="switchTab('planning')">π‘ μꡬμ¬ν κΈ°ν</button> | |
| <button class="tab-btn" onclick="switchTab('kanban')">π μΉΈλ° λ³΄λ</button> | |
| <button class="tab-btn" onclick="switchTab('troubleshoot')">π νΈλ¬λΈμν μ§μ</button> | |
| </div> | |
| </div> | |
| <!-- Container --> | |
| <div class="container"> | |
| <!-- Tab 1: Requirements & Planning --> | |
| <div id="tab-planning" class="tab-content active"> | |
| <div class="card"> | |
| <div class="card-title">π‘ μ κ· κΈ°λ₯ κ°λ° κΈ°ν λ° μν₯λ λΆμ</div> | |
| <div class="form-group"> | |
| <label>λμ νλ‘μ νΈ μ ν</label> | |
| <select id="planningProjectSelect"> | |
| <!-- Dynamic options --> | |
| </select> | |
| </div> | |
| <div class="form-group"> | |
| <label>κΈ°νμ μ λͺ©</label> | |
| <input type="text" id="planTitle" placeholder="μ: OAuth2 μΈμ¦ λ‘κ·ΈμΈ κΈ°λ₯ ꡬν" /> | |
| </div> | |
| <div class="form-group"> | |
| <label>λͺ©ν (Goal)</label> | |
| <input type="text" id="planGoal" placeholder="μ: κ΅¬κΈ λ° λ€μ΄λ² μμ λ‘κ·ΈμΈ μ°λ" /> | |
| </div> | |
| <div class="form-group"> | |
| <label>κΈ°λ₯ μμΈ μꡬμ¬ν (Requirements)</label> | |
| <textarea id="planRequirements" rows="5" placeholder="- λ‘κ·ΈμΈ νμ΄μ§ λ²νΌ λ ΈμΆ - ν ν° κ²μ¦ λ―Έλ€μ¨μ΄ ꡬν - DB μ¬μ©μ μ μ₯ μ²λ¦¬"></textarea> | |
| </div> | |
| <button class="btn btn-primary" onclick="createPlan()">βοΈ κΈ°ν μμ± λ° μλΈνμ€ν¬ λΆν΄</button> | |
| <div class="form-group"><label for="goalPlanningBudget">κ³νΒ·λ°°μ λͺ¨λΈ μμ° (USD, μ ν)</label><input id="goalPlanningBudget" type="number" min="0.000001" step="any" placeholder="λ―Έμ€μ " /></div> | |
| <div class="form-group"><label for="goalPlanningReserve">κ³ν μμ²λΉ μμ½ (USD, μ ν)</label><input id="goalPlanningReserve" type="number" min="0.000001" step="any" placeholder="μλ΅νλ©΄ λ¨μ κ³ν μμ° μμ½" /></div> | |
| <div class="form-group"><label for="goalExecutionBudget">μν¬νλ‘μ° μ€ν μμ° (USD, μ ν)</label><input id="goalExecutionBudget" type="number" min="0.000001" step="any" placeholder="κ³ν μμ°κ³Ό λ³λ" /></div> | |
| <div class="form-group"><label for="goalExecutionReserve">μ€ν μμ²λΉ μμ½ (USD, μ ν)</label><input id="goalExecutionReserve" type="number" min="0.000001" step="any" placeholder="λ―Έμ€μ μ΄λ©΄ κΈ°μ‘΄ λμ μ μ§" /></div> | |
| <small>μμ½μ μ€μ μ²κ΅¬ μνμ΄ μλλλ€. λΉμ© λ―ΈμΒ·μμ½ μ΄κ³Όλ κ²ν λ‘ λ©μΆλ©°, μμ ν μ¬κ³νλ κ°μ κ³ν μμ°μ μ¬μ©ν©λλ€.</small> | |
| <!-- μμ¨ μμ΄μ νΈ: κ° κ³νμ κ²ν ν λ€ κΈ°μ‘΄ μν¬νλ‘μ°λ₯Ό μ€ννλ€. --> | |
| <button id="autonomousStart" class="btn btn-primary" style="background:#6d28d9;" onclick="runAutonomousGoal()">π μμ¨ μ€ν (κ³νβμν¬νλ‘μ°βμ€ν)</button> | |
| <button id="autonomousCancel" class="btn" onclick="cancelAutonomousGoal()" disabled>λͺ©ν μμ μ·¨μ</button> | |
| <button id="planningCostReview" class="btn" onclick="openGoalPlanningReconciliation(document.getElementById('planningProjectSelect').value, (...args) => ipcRenderer.invoke(...args))">κ³νΒ·λ°°μ λΉμ© κ²ν </button> | |
| <button id="learningRecoveryReview" class="btn" onclick="openGoalLearningRecovery(document.getElementById('planningProjectSelect').value, (...args) => ipcRenderer.invoke(...args))">νμ΅ μ€λ¨ κ²ν Β·λ§λ¬΄λ¦¬</button> | |
| <button id="planningTakeoverReview" class="btn" onclick="openGoalPlanningTakeover(document.getElementById('planningProjectSelect').value, (...args) => ipcRenderer.invoke(...args))">μ€λ¨λ κ³ν μ΄μ΄κ°κΈ°</button> | |
| <button id="planningPricingEdit" class="btn" onclick="configureGoalPricing((...args) => ipcRenderer.invoke(...args))">μ΄ λͺ©νμ λ¨κ°Β·μΆμ² μ€μ </button> | |
| <small id="planningPricingStatus">λ¨κ° μΆμ λ―Έμ€μ Β· κΈμ‘ λ―Έλ³΄κ³ μμ²μ κ²ν μμ λ©μΆ₯λλ€.</small> | |
| <!-- μμ¨ μ€ν μ§ν λ‘κ·Έ --> | |
| <div id="autonomousLog" style="display:none; margin-top:16px; padding:12px; background:#1e1e2e; color:#cdd6f4; border-radius:8px; font-family:monospace; font-size:12px; max-height:280px; overflow:auto; white-space:pre-wrap;"></div> | |
| </div> | |
| </div> | |
| <!-- Tab 2: Kanban Board --> | |
| <div id="tab-kanban" class="tab-content"> | |
| <div class="form-group" style="max-width: 300px; margin-bottom: 20px;"> | |
| <label>νλ‘μ νΈ νν°</label> | |
| <select id="kanbanProjectSelect" onchange="loadKanbanTasks()"> | |
| <!-- Dynamic options --> | |
| </select> | |
| </div> | |
| <div class="kanban-board"> | |
| <!-- Todo Column --> | |
| <div class="kanban-col"> | |
| <div class="kanban-col-title">ν΄μΌ ν μΌ <span id="count-todo" style="color: var(--blue);">0</span></div> | |
| <div class="kanban-card-list" id="col-todo" ondragover="allowDrop(event)" ondrop="drop(event, 'todo')"> | |
| <!-- Cards --> | |
| </div> | |
| </div> | |
| <!-- In Progress Column --> | |
| <div class="kanban-col"> | |
| <div class="kanban-col-title">μ§ν μ€ <span id="count-in_progress" style="color: var(--purple);">0</span></div> | |
| <div class="kanban-card-list" id="col-in_progress" ondragover="allowDrop(event)" ondrop="drop(event, 'in_progress')"> | |
| <!-- Cards --> | |
| </div> | |
| </div> | |
| <!-- Completed Column --> | |
| <div class="kanban-col"> | |
| <div class="kanban-col-title">μλ£λ¨ <span id="count-completed" style="color: var(--green);">0</span></div> | |
| <div class="kanban-card-list" id="col-completed" ondragover="allowDrop(event)" ondrop="drop(event, 'completed')"> | |
| <!-- Cards --> | |
| </div> | |
| </div> | |
| <!-- Failed Column --> | |
| <div class="kanban-col"> | |
| <div class="kanban-col-title">보λ₯/μ€ν¨ <span id="count-failed" style="color: var(--red);">0</span></div> | |
| <div class="kanban-card-list" id="col-failed" ondragover="allowDrop(event)" ondrop="drop(event, 'failed')"> | |
| <!-- Cards --> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Tab 3: Troubleshoot KB --> | |
| <div id="tab-troubleshoot" class="tab-content"> | |
| <div class="card"> | |
| <div class="card-title">π μλ¬ νΈλ¬λΈμν μ§μ κ²μ</div> | |
| <div class="form-group" style="max-width: 300px;"> | |
| <label>νλ‘μ νΈ νν°</label> | |
| <select id="tsProjectSelect" onchange="searchTroubleshoot()"> | |
| <!-- Dynamic options --> | |
| </select> | |
| </div> | |
| <div class="search-row"> | |
| <input type="text" id="tsSearchInput" placeholder="μλ¬ μ ν, νμΌλͺ , λ‘κ·Έ ν€μλλ‘ μ§μ κ²μ..." style="flex: 1;" /> | |
| <button class="btn btn-primary" onclick="searchTroubleshoot()">π κ²μ</button> | |
| </div> | |
| <div class="troubleshoot-list" id="tsList"> | |
| <!-- Dynamic troubleshoot entries --> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Loading Overlay --> | |
| <div id="loadingOverlay" class="loading-overlay"> | |
| <div class="spinner"></div> | |
| <div class="loading-text" id="loadingText">μν₯λ λͺ¨λΈ κ³μ° λ° μλΈνμ€ν¬ λΆν΄ μ§ν μ€...</div> | |
| </div> | |
| </div> | |
| <script src="goal-planning-reconciliation.js"></script> | |
| <script src="goal-planning-takeover.js"></script> | |
| <script src="usage-reconciliation.js"></script> | |
| <script src="goal-learning-recovery.js"></script> | |
| <script src="goal-planning-pricing.js"></script> | |
| <script> | |
| const { ipcRenderer } = require('electron'); | |
| let allProjects = []; | |
| window.onload = async () => { | |
| const urlParams = new URLSearchParams(window.location.search); | |
| const initialTab = urlParams.get('tab') || 'planning'; | |
| switchTab(initialTab); | |
| await loadProjects(); | |
| }; | |
| function switchTab(tabId) { | |
| document.querySelectorAll('.tab-btn').forEach(btn => { | |
| btn.classList.remove('active'); | |
| if (btn.outerHTML.includes(tabId)) btn.classList.add('active'); | |
| }); | |
| document.querySelectorAll('.tab-content').forEach(content => { | |
| content.classList.remove('active'); | |
| }); | |
| document.getElementById(`tab-${tabId}`).classList.add('active'); | |
| if (tabId === 'kanban') { | |
| loadKanbanTasks(); | |
| } else if (tabId === 'troubleshoot') { | |
| searchTroubleshoot(); | |
| } | |
| } | |
| async function loadProjects() { | |
| try { | |
| allProjects = await ipcRenderer.invoke('get-code-projects') || []; | |
| fillSelect('planningProjectSelect'); | |
| fillSelect('kanbanProjectSelect'); | |
| fillSelect('tsProjectSelect'); | |
| } catch (err) { | |
| console.error('Failed to load projects:', err); | |
| } | |
| } | |
| function fillSelect(selectId) { | |
| const select = document.getElementById(selectId); | |
| if (!select) return; | |
| select.innerHTML = ''; | |
| if (allProjects.length === 0) { | |
| select.innerHTML = `<option value="">λ±λ‘λ νλ‘μ νΈ μμ</option>`; | |
| return; | |
| } | |
| allProjects.forEach(p => { | |
| select.innerHTML += `<option value="${p.id}">${escapeHtml(p.name)}</option>`; | |
| }); | |
| } | |
| async function createPlan() { | |
| const projectId = document.getElementById('planningProjectSelect').value; | |
| const title = document.getElementById('planTitle').value.trim(); | |
| const goal = document.getElementById('planGoal').value.trim(); | |
| const requirements = document.getElementById('planRequirements').value.trim(); | |
| if (!projectId) { | |
| alert('λμ νλ‘μ νΈλ₯Ό μ νν΄μ£Όμμμ€.'); | |
| return; | |
| } | |
| if (!title || !goal) { | |
| alert('κΈ°νμ μ λͺ©κ³Ό λͺ©νλ₯Ό μ λ ₯ν΄μ£Όμμμ€.'); | |
| return; | |
| } | |
| showLoading(true, 'π€ μμ΄μ νΈ λΈλ μΈμ΄ μν₯λλ₯Ό νκ°νκ³ νμ κ°λ° λ¨κ³λ₯Ό λλκ³ μμ΅λλ€...'); | |
| try { | |
| const result = await ipcRenderer.invoke('create-dev-plan', projectId, title, goal, requirements); | |
| if (result.success) { | |
| alert('μ±κ³΅! κΈ°νμκ° μν€ λ° λ°μ΄ν°λ² μ΄μ€μ μ μ¬λμμΌλ©°, νμ νμ€ν¬κ° μΉΈλ°μ λ±λ‘λμμ΅λλ€.'); | |
| // μμ μ΄κΈ°ν | |
| document.getElementById('planTitle').value = ''; | |
| document.getElementById('planGoal').value = ''; | |
| document.getElementById('planRequirements').value = ''; | |
| switchTab('kanban'); | |
| } else { | |
| alert('κΈ°ν μμ± μ€ν¨: ' + result.error); | |
| } | |
| } catch (err) { | |
| alert('μ€λ₯ λ°μ: ' + err.message); | |
| } finally { | |
| showLoading(false); | |
| } | |
| } | |
| // --- μμ¨ μ€ν (Goal β Plan β Workflow β Execute β Replan) --- | |
| let ownedGoalId=null; | |
| async function cancelAutonomousGoal(){ | |
| if(!ownedGoalId)return; | |
| try{const result=await ipcRenderer.invoke('cancel-autonomous-goal',ownedGoalId);if(result.success){document.getElementById('autonomousCancel').disabled=true;appendAutonomousLog('μ·¨μ μμ²μ 보λμ΅λλ€. μμ μμ²μ μ’ λ£Β·λΉμ© μ μ₯μ νμΈν©λλ€.');}else appendAutonomousLog('νμ¬ μ°½μ΄ μμ ν μ§ν λͺ©νλ₯Ό νμΈν μ μμ΅λλ€.');} | |
| catch{appendAutonomousLog('μ·¨μ μμ²μ μ λ¬νμ§ λͺ»νμ΅λλ€. νμ¬ μνλ₯Ό νμΈν΄μ£ΌμΈμ.');} | |
| } | |
| function appendAutonomousLog(line) { | |
| const box = document.getElementById('autonomousLog'); | |
| box.style.display = 'block'; | |
| const ts = new Date().toLocaleTimeString(); | |
| box.textContent += `[${ts}] ${line}\n`; | |
| box.scrollTop = box.scrollHeight; | |
| } | |
| // λ©μΈ νλ‘μΈμ€κ° 보λ΄λ μμ¨ μ€ν μ§ν μ΄λ²€νΈλ₯Ό μμ ν΄ λ‘κ·Έμ μΆλ ₯ | |
| ipcRenderer.on('autonomous-goal-event', (event, { channel, payload }) => { | |
| if(channel==='goal:start'){ownedGoalId=payload.goalId;document.getElementById('autonomousCancel').disabled=false;} | |
| const map = { | |
| 'goal:start': () => `π μμ¨ λͺ©ν μμ (μ¬κ³ν μ΅λ ${payload.maxReplans}ν)`, | |
| 'goal:planning': () => `π§ [μλ ${payload.attempt}] λͺ©ν λΆν΄ μ€...`, | |
| 'goal:plan': () => `π [μλ ${payload.attempt}] κ³ν μ립 μλ£ β λ Έλ ${payload.nodeCount}κ° (workflow=${payload.workflowId})`, | |
| 'goal:waiting': () => `π [κ³ν ${payload.attempt}] κ³΅ν΅ μΉμΈ νλ©΄μμ μΉμΈΒ·λ°λ €Β·μμ μ§μλ₯Ό κΈ°λ€λ¦½λλ€. λ΄ κ΄μ μμλ νμΈν μ μμ΅λλ€.`, | |
| 'goal:running': () => `βοΈ [μλ ${payload.attempt}] μν¬νλ‘μ° μ€ν μ€ (run=${payload.runId})`, | |
| 'goal:replan': () => `π μ¬κ³ν β λ€μ μλ ${payload.nextAttempt}`, | |
| 'goal:complete': () => `β κ³ν μ€ν μλ£ (run=${payload.runId}, μ΄ ${payload.attempts}ν μλ). λͺ©ν μΆ©μ‘±μ κ·Όκ±°λ₯Ό νμΈν΄μ£ΌμΈμ.`, | |
| 'goal:pause': () => `βΈ μΌμμ μ§ β ${payload.code || 'μλ μμ μ κ²ν ν΄μ£ΌμΈμ.'}`, | |
| 'goal:review': () => `π κ²ν νμ β ${payload.code || 'κ°μ μ€νμ νμΈν΄μ£ΌμΈμ.'}`, | |
| 'goal:fail': () => `β μ€ν¨ β ${payload.attempts}ν μλ μμ§. μ€λ₯: ${payload.error}`, | |
| }; | |
| const fn = map[channel]; | |
| if (fn) appendAutonomousLog(fn()); | |
| }); | |
| async function runAutonomousGoal() { | |
| const projectId = document.getElementById('planningProjectSelect').value; | |
| const title = document.getElementById('planTitle').value.trim(); | |
| const goalText = document.getElementById('planGoal').value.trim(); | |
| const requirements = document.getElementById('planRequirements').value.trim(); | |
| if (!projectId) { alert('νλ‘μ νΈλ₯Ό μ ννμΈμ.'); return; } | |
| const goal = [title, goalText, requirements].filter(s => s).join('\n\n'); | |
| if (!goal) { alert('λͺ©ν(μ λͺ©/λͺ©ν/μꡬμ¬ν μ€ νλ μ΄μ)λ₯Ό μ λ ₯νμΈμ.'); return; } | |
| const budgets={}; | |
| for(const [field,key]of [['goalPlanningBudget','planningBudgetUsd'],['goalPlanningReserve','planningRequestReserveUsd'],['goalExecutionBudget','budgetUsd'],['goalExecutionReserve','requestReserveUsd']]){ | |
| const value=document.getElementById(field).value.trim();if(!value)continue; | |
| const amount=Number(value);if(!Number.isFinite(amount)||amount<=0){alert('μμ°κ³Ό μμ½μλ μμλ₯Ό μ λ ₯ν΄μ£ΌμΈμ.');return;}budgets[key]=amount; | |
| } | |
| if(budgets.planningRequestReserveUsd!=null&&(budgets.planningBudgetUsd==null||budgets.planningRequestReserveUsd>budgets.planningBudgetUsd)){alert('μμ² μμ½μ κ³ν μμ° μμμ μ€μ ν΄μ£ΌμΈμ.');return;} | |
| if(budgets.requestReserveUsd!=null&&budgets.budgetUsd!=null&&budgets.requestReserveUsd>budgets.budgetUsd){alert('μ€ν μμ² μμ½μ μ€ν μμ° μμμ μ€μ ν΄μ£ΌμΈμ.');return;} | |
| document.getElementById('autonomousLog').textContent = ''; | |
| document.getElementById('autonomousStart').disabled=true; | |
| appendAutonomousLog('μμ² μ μ‘...'); | |
| try { | |
| const res = await ipcRenderer.invoke('run-autonomous-goal', projectId, goal, { maxReplans: 2,...budgets,planningPricingPolicies:getGoalPricingPolicies() }); | |
| if (res && res.success) { | |
| appendAutonomousLog(`π μλ£ (run=${res.runId})`); | |
| } else { | |
| appendAutonomousLog(`μ’ λ£(μ€ν¨): ${res && res.error ? res.error : 'μμΈ λ―Έμ'}`); | |
| } | |
| } catch (err) { | |
| appendAutonomousLog(`μ€λ₯: ${err.message}`); | |
| } finally { | |
| ownedGoalId=null;document.getElementById('autonomousCancel').disabled=true;document.getElementById('autonomousStart').disabled=false; | |
| } | |
| } | |
| // --- Kanban Logic --- | |
| let draggedTaskId = null; | |
| async function loadKanbanTasks() { | |
| const projectId = document.getElementById('kanbanProjectSelect').value; | |
| // Clear cols | |
| const cols = ['todo', 'in_progress', 'completed', 'failed']; | |
| cols.forEach(col => { | |
| document.getElementById(`col-${col}`).innerHTML = ''; | |
| document.getElementById(`count-${col}`).textContent = '0'; | |
| }); | |
| if (!projectId) return; | |
| try { | |
| const plans = await ipcRenderer.invoke('get-dev-plans', projectId); | |
| const colCounts = { todo: 0, in_progress: 0, completed: 0, failed: 0 }; | |
| plans.forEach(plan => { | |
| const tasks = plan.tasks || []; | |
| tasks.forEach(t => { | |
| const status = t.status || 'todo'; | |
| const colEl = document.getElementById(`col-${status}`); | |
| if (!colEl) return; | |
| colCounts[status]++; | |
| const card = document.createElement('div'); | |
| card.className = 'kanban-card'; | |
| card.draggable = true; | |
| card.id = `task-${t.id}`; | |
| card.ondragstart = (e) => { | |
| draggedTaskId = t.id; | |
| e.dataTransfer.setData('text/plain', t.id); | |
| }; | |
| card.innerHTML = ` | |
| <div class="kanban-card-title">${escapeHtml(t.title)}</div> | |
| <div class="kanban-card-desc">${escapeHtml(t.description || 'μμΈ λ΄μ© μμ')}</div> | |
| <div class="kanban-card-meta"> | |
| <span>νμΌ: ${escapeHtml(t.target_file || 'N/A')}</span> | |
| <span>${t.difficulty ? `λμ΄λ: ${t.difficulty}` : ''}</span> | |
| </div> | |
| `; | |
| colEl.appendChild(card); | |
| }); | |
| }); | |
| // Set counts | |
| cols.forEach(col => { | |
| document.getElementById(`count-${col}`).textContent = colCounts[col]; | |
| }); | |
| } catch (err) { | |
| console.error('Failed to load kanban tasks:', err); | |
| } | |
| } | |
| function allowDrop(e) { | |
| e.preventDefault(); | |
| } | |
| async function drop(e, newStatus) { | |
| e.preventDefault(); | |
| const taskId = e.dataTransfer.getData('text/plain') || draggedTaskId; | |
| if (!taskId) return; | |
| try { | |
| const updateResult = await ipcRenderer.invoke('update-dev-task', taskId, { status: newStatus }); | |
| if (updateResult.success) { | |
| loadKanbanTasks(); | |
| } else { | |
| alert('νμ€ν¬ μ λ°μ΄νΈ μ€ν¨: ' + updateResult.error); | |
| } | |
| } catch (err) { | |
| alert('μ λ°μ΄νΈ μ€ μ€λ₯ λ°μ: ' + err.message); | |
| } | |
| } | |
| // --- Troubleshoot KB --- | |
| async function searchTroubleshoot() { | |
| const projectId = document.getElementById('tsProjectSelect').value; | |
| const query = document.getElementById('tsSearchInput').value.trim(); | |
| const listEl = document.getElementById('tsList'); | |
| listEl.innerHTML = ''; | |
| if (!projectId) { | |
| listEl.innerHTML = `<p style="color: var(--text-dim); text-align: center; padding: 20px 0;">μ‘°ν λμ νλ‘μ νΈλ₯Ό μ νν΄μ£Όμμμ€.</p>`; | |
| return; | |
| } | |
| try { | |
| const entries = await ipcRenderer.invoke('search-troubleshoot-kb', projectId, query); | |
| if (entries.length === 0) { | |
| listEl.innerHTML = `<p style="color: var(--text-dim); text-align: center; padding: 20px 0;">ν¬μ°©λ νΈλ¬λΈμν μ§μμ΄ μμ΅λλ€.</p>`; | |
| return; | |
| } | |
| entries.forEach(e => { | |
| listEl.innerHTML += ` | |
| <div class="troubleshoot-card"> | |
| <div class="ts-header"> | |
| <span class="ts-pattern">${escapeHtml(e.error_pattern)}</span> | |
| <span class="badge badge-yellow">${e.error_type.toUpperCase()}</span> | |
| </div> | |
| <div style="font-size: 11px; color: var(--text-dim); margin-bottom: 8px;">λμ λ°μ: <strong style="color: var(--pink);">${e.hit_count || 1}</strong>ν | μ΅μ’ λ°μ: ${e.last_hit_at || e.created_at || 'κΈ°λ‘ μμ'}</div> | |
| <div class="ts-details"> | |
| <div> | |
| <div class="ts-box-title">π κ·Όλ³Έ μμΈ</div> | |
| <div style="color: var(--text-sub); line-height: 1.4;">${escapeHtml(e.root_cause || 'λΆμ μ€')}</div> | |
| </div> | |
| <div> | |
| <div class="ts-box-title">π‘ ν΄κ²°μ± λ° ν¨μΉ</div> | |
| <div style="color: var(--text-sub); line-height: 1.4;">${escapeHtml(e.solution)}</div> | |
| </div> | |
| </div> | |
| ${(e.affected_files && e.affected_files.length > 0) ? ` | |
| <div style="margin-top: 10px; font-size: 11px; color: var(--text-dim);"> | |
| μ°κ΄ νμΌ: ${e.affected_files.map(f => `<code style="background: var(--bg-crust); padding: 2px 4px; border-radius: 4px;">${escapeHtml(f)}</code>`).join(' ')} | |
| </div> | |
| ` : ''} | |
| </div> | |
| `; | |
| }); | |
| } catch (err) { | |
| listEl.innerHTML = `<p style="color: var(--red); text-align: center; padding: 20px 0;">μ§μ κ²μ μ€ μ€ν¨: ${err.message}</p>`; | |
| } | |
| } | |
| function showLoading(show, text = '') { | |
| const overlay = document.getElementById('loadingOverlay'); | |
| const textEl = document.getElementById('loadingText'); | |
| if (text) textEl.textContent = text; | |
| if (show) { | |
| overlay.classList.add('visible'); | |
| } else { | |
| overlay.classList.remove('visible'); | |
| } | |
| } | |
| function escapeHtml(str) { | |
| if (!str) return ''; | |
| return str.replace(/&/g, '&') | |
| .replace(/</g, '<') | |
| .replace(/>/g, '>') | |
| .replace(/"/g, '"') | |
| .replace(/'/g, '''); | |
| } | |
| ipcRenderer.on('switch-tab', (event, tabId) => { | |
| switchTab(tabId); | |
| }); | |
| </script> | |
| </body> | |
| </html> | |