viberadar 0.3.199 → 0.3.201
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/dist/scanner/index.d.ts +4 -0
- package/dist/scanner/index.d.ts.map +1 -1
- package/dist/scanner/index.js +48 -6
- package/dist/scanner/index.js.map +1 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +136 -5
- package/dist/server/index.js.map +1 -1
- package/dist/ui/dashboard.html +67 -46
- package/package.json +2 -2
package/dist/ui/dashboard.html
CHANGED
|
@@ -2697,20 +2697,33 @@ function updateAgentRightsInfo() {
|
|
|
2697
2697
|
const el = document.getElementById('headerAgentRights');
|
|
2698
2698
|
if (!el || !D) return;
|
|
2699
2699
|
const runtime = D.agentRuntime || {};
|
|
2700
|
-
const sandbox = runtime.codexSandboxMode || 'read-only';
|
|
2701
|
-
const approval = runtime.approvalPolicy || 'never';
|
|
2702
|
-
|
|
2703
|
-
if (D.agent === 'codex') {
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2700
|
+
const sandbox = runtime.codexSandboxMode || 'read-only';
|
|
2701
|
+
const approval = runtime.approvalPolicy || 'never';
|
|
2702
|
+
|
|
2703
|
+
if (D.agent === 'codex') {
|
|
2704
|
+
const cached = window._codexAccount;
|
|
2705
|
+
const account = cached ? ` · ${cached}` : '';
|
|
2706
|
+
el.textContent = `🔐 Codex${account}: ${sandbox}, approval: ${approval}`;
|
|
2707
|
+
el.title = cached
|
|
2708
|
+
? `Codex аккаунт: ${cached}. Права: ${sandbox}, approval: ${approval}`
|
|
2709
|
+
: 'Загружаю аккаунт Codex…';
|
|
2710
|
+
if (!cached) {
|
|
2711
|
+
fetch('/api/agent-whoami?agent=codex').then(r => r.json()).then(d => {
|
|
2712
|
+
window._codexAccount = d.email || d.name || d.accountId || d.raw || 'неизвестно';
|
|
2713
|
+
updateAgentRightsInfo();
|
|
2714
|
+
}).catch(() => {
|
|
2715
|
+
window._codexAccount = 'неизвестно';
|
|
2716
|
+
updateAgentRightsInfo();
|
|
2717
|
+
});
|
|
2718
|
+
}
|
|
2719
|
+
return;
|
|
2720
|
+
}
|
|
2708
2721
|
if (D.agent === 'claude') {
|
|
2709
2722
|
const cached = window._claudeAccount;
|
|
2710
2723
|
el.textContent = cached ? `🔐 ${cached}` : '🔐 Claude';
|
|
2711
2724
|
el.title = cached ? `Claude аккаунт: ${cached}` : 'Загружаю аккаунт…';
|
|
2712
2725
|
if (!cached) {
|
|
2713
|
-
fetch('/api/agent-whoami').then(r => r.json()).then(d => {
|
|
2726
|
+
fetch('/api/agent-whoami?agent=claude').then(r => r.json()).then(d => {
|
|
2714
2727
|
window._claudeAccount = d.email || d.raw?.split('\n')[0] || 'неизвестно';
|
|
2715
2728
|
updateAgentRightsInfo();
|
|
2716
2729
|
}).catch(() => {});
|
|
@@ -3006,7 +3019,7 @@ function showObsCopyToast() {
|
|
|
3006
3019
|
t.style.cssText = 'position:fixed;bottom:24px;left:50%;transform:translateX(-50%);background:#238636;color:#fff;padding:8px 20px;border-radius:8px;font-size:13px;z-index:9999;pointer-events:none;transition:opacity 0.3s';
|
|
3007
3020
|
document.body.appendChild(t);
|
|
3008
3021
|
}
|
|
3009
|
-
t.textContent = '📋
|
|
3022
|
+
t.textContent = '📋 Prompt для ревизии скопирован';
|
|
3010
3023
|
t.style.opacity = '1';
|
|
3011
3024
|
clearTimeout(t._to);
|
|
3012
3025
|
t._to = setTimeout(() => { t.style.opacity = '0'; }, 2500);
|
|
@@ -4617,8 +4630,14 @@ function renderObsGlobalDetail(c, filterFeatureKey) {
|
|
|
4617
4630
|
// Store catalog for buttons to reference by index (avoids inline JSON in onclick)
|
|
4618
4631
|
window.__obsCatalog = catalog;
|
|
4619
4632
|
|
|
4620
|
-
// Store noisy patterns data for confirmation flow
|
|
4621
|
-
window.__noisyPatterns = topNoisy.map(i => ({
|
|
4633
|
+
// Store noisy patterns data for confirmation/copy flow.
|
|
4634
|
+
window.__noisyPatterns = topNoisy.map(i => ({
|
|
4635
|
+
pattern: i.pattern,
|
|
4636
|
+
recommendation: i.recommendation,
|
|
4637
|
+
confidence: i.confidence || 'review',
|
|
4638
|
+
safety: i.safety || 'needs_review',
|
|
4639
|
+
reasonHints: i.reasonHints || [],
|
|
4640
|
+
}));
|
|
4622
4641
|
|
|
4623
4642
|
const noisyRows = topNoisy.map((i, idx) => {
|
|
4624
4643
|
// Find related modules from catalog that contain this pattern in noisyMessages.
|
|
@@ -4635,14 +4654,17 @@ function renderObsGlobalDetail(c, filterFeatureKey) {
|
|
|
4635
4654
|
);
|
|
4636
4655
|
const moduleCount = relatedModules.length;
|
|
4637
4656
|
|
|
4638
|
-
const expandBtn =
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
const
|
|
4642
|
-
const
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
const
|
|
4657
|
+
const expandBtn = `<button class="obs-expand-btn" onclick="event.stopPropagation();toggleNoisyDetail(${idx})">▼</button>`;
|
|
4658
|
+
const confidence = i.confidence || 'review';
|
|
4659
|
+
const confLabels = { high: 'доверие высокое', medium: 'доверие среднее', review: 'спорно' };
|
|
4660
|
+
const confColors = { high: 'var(--green)', medium: 'var(--yellow)', review: 'var(--red)' };
|
|
4661
|
+
const reasonHints = (i.reasonHints || []).slice(0, 4);
|
|
4662
|
+
const confidenceBadge = `<span title="${escapeHtml(reasonHints.join('; ') || 'нужна проверка контекста')}" style="font-size:10px;color:${confColors[confidence] || 'var(--yellow)'};border:1px solid ${confColors[confidence] || 'var(--yellow)'};border-radius:999px;padding:1px 6px;flex-shrink:0">${confLabels[confidence] || 'спорно'}</span>`;
|
|
4663
|
+
const actionLabel = '\u{1F916} Отдать агенту';
|
|
4664
|
+
const btn = hasAgent
|
|
4665
|
+
? `<button class="obs-action-btn" onclick="event.stopPropagation();showNoisySuppressConfirm(${idx})">${actionLabel}</button>`
|
|
4666
|
+
: '';
|
|
4667
|
+
const copyBtn = `<button class="obs-copy-btn" title="Скопировать промпт для ревизии" onclick="event.stopPropagation();obsCopyPrompt('obs-suppress-pattern',window.__noisyPatterns[${idx}])">📋 Промпт</button>`;
|
|
4646
4668
|
|
|
4647
4669
|
// Module list for detail section
|
|
4648
4670
|
const moduleRows = relatedModules.map(c => {
|
|
@@ -4651,28 +4673,27 @@ function renderObsGlobalDetail(c, filterFeatureKey) {
|
|
|
4651
4673
|
}).join('');
|
|
4652
4674
|
|
|
4653
4675
|
// Confirmation block
|
|
4654
|
-
const confirmDesc = i.
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
-
|
|
4659
|
-
<
|
|
4660
|
-
<
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
|
|
4665
|
-
</div>
|
|
4666
|
-
</div>` : '';
|
|
4676
|
+
const confirmDesc = `Агент получит prompt на ревизию паттерна «${escapeHtml(i.pattern)}»: сначала классифицировать каждый лог, затем менять только очевидно безопасные случаи.`;
|
|
4677
|
+
const confirmBlock = hasAgent ? `
|
|
4678
|
+
<div id="obs-noisy-confirm-${idx}" class="obs-noisy-confirm">
|
|
4679
|
+
<p>${confirmDesc}</p>
|
|
4680
|
+
<p>Затронуто модулей: <strong>${moduleCount}</strong></p>
|
|
4681
|
+
<div class="obs-confirm-safe">⛔ warn / error / fatal не трогать; спорные INFO оставить на ручную проверку</div>
|
|
4682
|
+
<div class="obs-noisy-confirm-btns">
|
|
4683
|
+
<button class="obs-noisy-cancel" onclick="event.stopPropagation();hideNoisySuppressConfirm(${idx})">Отмена</button>
|
|
4684
|
+
<button class="obs-noisy-apply" onclick="event.stopPropagation();confirmNoisySuppress(${idx})">Запустить с prompt</button>
|
|
4685
|
+
</div>
|
|
4686
|
+
</div>` : '';
|
|
4667
4687
|
|
|
4668
4688
|
const moduleLabel = moduleCount > 0 ? `<span style="color:var(--dim);font-size:11px;flex-shrink:0">${moduleCount} мод.</span>` : '';
|
|
4669
4689
|
|
|
4670
4690
|
return `
|
|
4671
4691
|
<div>
|
|
4672
4692
|
<div class="obs-list-item">
|
|
4673
|
-
<span class="obs-priority-${i.priority}" style="flex-shrink:0">[${i.priority}]</span>
|
|
4674
|
-
|
|
4675
|
-
<
|
|
4693
|
+
<span class="obs-priority-${i.priority}" style="flex-shrink:0">[${i.priority}]</span>
|
|
4694
|
+
${confidenceBadge}
|
|
4695
|
+
<span style="flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap" title="${escapeHtml(i.pattern)}">${escapeHtml(i.pattern)}</span>
|
|
4696
|
+
<strong style="flex-shrink:0;color:var(--red)">×${i.count} → ${recLabels[i.recommendation] || i.recommendation}</strong>
|
|
4676
4697
|
${moduleLabel}
|
|
4677
4698
|
${btn}
|
|
4678
4699
|
${copyBtn}
|
|
@@ -4971,11 +4992,11 @@ function renderObsGlobalDetail(c, filterFeatureKey) {
|
|
|
4971
4992
|
<span class="obs-hint-chevron">▼</span>
|
|
4972
4993
|
</button>
|
|
4973
4994
|
<div class="obs-hint-body">
|
|
4974
|
-
<p
|
|
4995
|
+
<p>VibeRadar подсвечивает подозрительные INFO/DEBUG/TRACE логи эвристически. Это не команда на удаление: каждый паттерн нужно проверить в контексте кода и бизнес-сценария.</p>
|
|
4975
4996
|
<ul style="margin:8px 0 0 16px;display:flex;flex-direction:column;gap:4px">
|
|
4976
|
-
<li><strong style="color:var(--red)">Топят сигнал.</strong>
|
|
4977
|
-
<li><strong style="color:var(--yellow)">Стоят деньги.</strong> Datadog, New Relic, Elastic
|
|
4978
|
-
<li><strong style="color:var(--muted)"
|
|
4997
|
+
<li><strong style="color:var(--red)">Топят сигнал.</strong> Реальная ошибка теряется среди lifecycle-строк и фоновых сообщений.</li>
|
|
4998
|
+
<li><strong style="color:var(--yellow)">Стоят деньги.</strong> Datadog, New Relic, Elastic и Loki часто тарифицируются по объёму ingest/storage.</li>
|
|
4999
|
+
<li><strong style="color:var(--muted)">Требуют ревизии.</strong> INFO может быть бизнес-событием, аудитом или reconciliation-сигналом, поэтому спорные случаи нельзя удалять автоматически.</li>
|
|
4979
5000
|
</ul>
|
|
4980
5001
|
<div class="obs-hint-section">
|
|
4981
5002
|
<div class="obs-hint-section-title">До / После</div>
|
|
@@ -4987,21 +5008,21 @@ function renderObsGlobalDetail(c, filterFeatureKey) {
|
|
|
4987
5008
|
<span class="hl-red">logger.info('Using API key from env') // каждый запрос</span></div>
|
|
4988
5009
|
</div>
|
|
4989
5010
|
<div>
|
|
4990
|
-
<div class="obs-hint-label after">СТАЛО —
|
|
4991
|
-
<div class="obs-hint-code"><span class="hl-green">// строки удалены или понижены до debug</span>
|
|
4992
|
-
<span class="hl-dim">// В production debug-логи выключены</span>
|
|
4993
|
-
<span class="hl-green">//
|
|
5011
|
+
<div class="obs-hint-label after">СТАЛО — после ревизии</div>
|
|
5012
|
+
<div class="obs-hint-code"><span class="hl-green">// строки удалены или понижены до debug</span>
|
|
5013
|
+
<span class="hl-dim">// В production debug-логи выключены</span>
|
|
5014
|
+
<span class="hl-green">// Спорные бизнес/audit/security логи оставлены</span></div>
|
|
4994
5015
|
</div>
|
|
4995
5016
|
</div>
|
|
4996
5017
|
</div>
|
|
4997
5018
|
<div class="obs-hint-section">
|
|
4998
5019
|
<div class="obs-hint-section-title">Как использовать</div>
|
|
4999
|
-
<p
|
|
5020
|
+
<p>Используй <strong>«📋 Промпт»</strong> как основной сценарий: VibeRadar отдаёт агенту список паттернов, guardrails и просьбу сначала классифицировать каждый лог. Запуск агентом остаётся вторичным действием.</p>
|
|
5000
5021
|
</div>
|
|
5001
5022
|
</div>
|
|
5002
5023
|
</div>
|
|
5003
5024
|
<div class="obs-card">
|
|
5004
|
-
<div class="obs-title">Шумные
|
|
5025
|
+
<div class="obs-title">Шумные паттерны · prompt для ревизии</div>
|
|
5005
5026
|
<div class="obs-list" style="gap:4px">${noisyRows}</div>
|
|
5006
5027
|
</div>
|
|
5007
5028
|
</div>
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "viberadar",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.201",
|
|
4
4
|
"description": "Live module map with test coverage for vibecoding projects",
|
|
5
5
|
"main": "./dist/cli.js",
|
|
6
6
|
"bin": {
|
|
7
|
-
"viberadar": "
|
|
7
|
+
"viberadar": "viberadar.js"
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
10
|
"build": "tsc && node scripts/bundle-ui.js",
|