viberadar 0.3.143 → 0.3.145

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.
@@ -4466,6 +4466,30 @@ function renderScenarioCards(c) {
4466
4466
  <button class="agent-card-btn" id="scenarioRegenBtn" style="background:var(--card-bg);color:var(--muted);border:1px solid var(--border);border-radius:6px;padding:6px 14px;cursor:pointer;font-size:13px;margin-left:8px">
4467
4467
  ↻ Перегенерировать
4468
4468
  </button>
4469
+ <button id="scenarioCustomBtn" style="background:var(--card-bg);color:var(--fg);border:1px solid var(--border);border-radius:6px;padding:6px 14px;cursor:pointer;font-size:13px;margin-left:8px">
4470
+ ✏ Свой сценарий
4471
+ </button>
4472
+ </div>
4473
+ <div id="customScenarioForm" style="display:none;background:var(--card-bg);border:1px solid var(--border);border-radius:8px;padding:16px;margin-bottom:16px">
4474
+ <div style="font-weight:600;font-size:14px;margin-bottom:12px">Написать сценарий по своему промпту</div>
4475
+ <div style="margin-bottom:10px">
4476
+ <label style="font-size:12px;color:var(--muted);display:block;margin-bottom:4px">Название сценария</label>
4477
+ <input id="customScenarioName" type="text" placeholder="Например: Онбординг нового пользователя"
4478
+ style="width:100%;box-sizing:border-box;padding:8px 10px;border-radius:5px;border:1px solid var(--border);background:var(--bg);color:var(--fg);font-size:13px;outline:none"/>
4479
+ </div>
4480
+ <div style="margin-bottom:12px">
4481
+ <label style="font-size:12px;color:var(--muted);display:block;margin-bottom:4px">Опишите сценарий (что делает пользователь, какую цель достигает)</label>
4482
+ <textarea id="customScenarioPrompt" rows="4" placeholder="Пользователь регистрируется, создаёт первый навык, тестирует его в чате и публикует..."
4483
+ style="width:100%;box-sizing:border-box;padding:8px 10px;border-radius:5px;border:1px solid var(--border);background:var(--bg);color:var(--fg);font-size:13px;outline:none;resize:vertical;font-family:inherit"></textarea>
4484
+ </div>
4485
+ <div style="display:flex;gap:8px">
4486
+ <button id="customScenarioRunBtn" style="background:var(--blue);color:#fff;border:none;border-radius:6px;padding:8px 18px;cursor:pointer;font-size:13px;font-weight:600">
4487
+ ✍ Сгенерировать документацию
4488
+ </button>
4489
+ <button id="customScenarioCancelBtn" style="background:transparent;color:var(--muted);border:1px solid var(--border);border-radius:6px;padding:8px 14px;cursor:pointer;font-size:13px">
4490
+ Отмена
4491
+ </button>
4492
+ </div>
4469
4493
  </div>
4470
4494
  <div class="features-grid">`;
4471
4495
 
@@ -4531,6 +4555,41 @@ function renderScenarioCards(c) {
4531
4555
  }
4532
4556
  };
4533
4557
  }
4558
+
4559
+ const customBtn = document.getElementById('scenarioCustomBtn');
4560
+ const customForm = document.getElementById('customScenarioForm');
4561
+ const customCancelBtn = document.getElementById('customScenarioCancelBtn');
4562
+ const customRunBtn = document.getElementById('customScenarioRunBtn');
4563
+
4564
+ if (customBtn && customForm) {
4565
+ customBtn.onclick = () => {
4566
+ const isOpen = customForm.style.display !== 'none';
4567
+ customForm.style.display = isOpen ? 'none' : 'block';
4568
+ if (!isOpen) document.getElementById('customScenarioName').focus();
4569
+ };
4570
+ }
4571
+ if (customCancelBtn && customForm) {
4572
+ customCancelBtn.onclick = () => { customForm.style.display = 'none'; };
4573
+ }
4574
+ if (customRunBtn) {
4575
+ customRunBtn.onclick = () => {
4576
+ const nameEl = document.getElementById('customScenarioName');
4577
+ const promptEl = document.getElementById('customScenarioPrompt');
4578
+ const name = nameEl.value.trim();
4579
+ const prompt = promptEl.value.trim();
4580
+ if (!name) { nameEl.focus(); alert('Введите название сценария'); return; }
4581
+ if (!prompt) { promptEl.focus(); alert('Опишите сценарий'); return; }
4582
+ // Generate slug key from name
4583
+ const key = 'custom-' + name.toLowerCase()
4584
+ .replace(/[а-яёА-ЯЁ]/g, c => ({ а:'a',б:'b',в:'v',г:'g',д:'d',е:'e',ё:'yo',ж:'zh',з:'z',и:'i',й:'y',к:'k',л:'l',м:'m',н:'n',о:'o',п:'p',р:'r',с:'s',т:'t',у:'u',ф:'f',х:'h',ц:'ts',ч:'ch',ш:'sh',щ:'sch',ъ:'',ы:'y',ь:'',э:'e',ю:'yu',я:'ya',А:'a',Б:'b',В:'v',Г:'g',Д:'d',Е:'e',Ё:'yo',Ж:'zh',З:'z',И:'i',Й:'y',К:'k',Л:'l',М:'m',Н:'n',О:'o',П:'p',Р:'r',С:'s',Т:'t',У:'u',Ф:'f',Х:'h',Ц:'ts',Ч:'ch',Ш:'sh',Щ:'sch',Ъ:'',Ы:'y',Ь:'',Э:'e',Ю:'yu',Я:'ya' }[c] || c))
4585
+ .replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '').slice(0, 40)
4586
+ + '-' + Date.now().toString(36);
4587
+ customForm.style.display = 'none';
4588
+ nameEl.value = '';
4589
+ promptEl.value = '';
4590
+ runAgentTask('custom-scenario', key, null, null, { name, prompt });
4591
+ };
4592
+ }
4534
4593
  }
4535
4594
 
4536
4595
  async function renderScenarioDetail(c) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "viberadar",
3
- "version": "0.3.143",
3
+ "version": "0.3.145",
4
4
  "description": "Live module map with test coverage for vibecoding projects",
5
5
  "main": "./dist/cli.js",
6
6
  "bin": {