santriverse-skills 0.3.5 → 0.3.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "santriverse-skills",
3
- "version": "0.3.5",
3
+ "version": "0.3.7",
4
4
  "description": "One-command installer that connects Santriverse skill repositories (Apps Script + Monorepo guidelines) to Google Antigravity as Agent Skills or an MCP server.",
5
5
  "bin": {
6
6
  "santriverse-skills": "bin/cli.js"
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  const $=s=>document.querySelector(s),$$=s=>[...document.querySelectorAll(s)],show=(el,v=true)=>{el.hidden=!v};
3
- const PAGES={home:'Beranda',add:'1 · Tambah',collection:'2 · Koleksi',agents:'3 · Aktifkan',status:'4 · Cek & Tes',skills:'Skills terpasang (Antigravity)',mcp:'MCP terpasang (Antigravity)',library:'Skill Saya',repos:'Repositories',extensions:'Extensions',activity:'Riwayat'};
3
+ const PAGES={home:'Beranda',add:'1 · Tambah',collection:'2 · Koleksi',agents:'3 · Aktifkan',status:'4 · Cek & Tes',skills:'Skill terpasang (Antigravity)',mcp:'MCP terpasang (Antigravity)',library:'Skill Saya',repos:'Repositori',extensions:'Extensions',activity:'Riwayat'};
4
4
  let catalog={skills:[],mcpServers:[]},csrf='',lastStatus=null;
5
5
  let statusTimer=null,statusRequest=null,statusEpoch=0;
6
6
  const selectedSkills=new Set();
@@ -74,6 +74,7 @@ async function toggleAgent(h,r,box){const enable=box.checked;agentsBusy=true;$$(
74
74
  try{const res=await post(r.kind==='mcp'?'/api/harnesses/mcp':'/api/harnesses/skill',{harness:h.id,id:r.id,enable});done(`✓ ${r.label} ${enable?'aktif':'nonaktif'} di ${h.name}. ${res.hint||''}`)}
75
75
  catch(e){fail(e)}finally{agentsBusy=false;show($('#progress'),false);await loadAgents()}}
76
76
  // ─ Gateway + profiles (AI Agents page): /api/gateway, /api/profiles ─
77
+ $$('[data-extra]').forEach(b=>b.onclick=()=>$$('[data-extra]').forEach(x=>{const on=x===b;x.setAttribute('aria-selected',String(on));show(document.getElementById(x.dataset.extra),on)}));
77
78
  let gatewayServers=[],profiles={};
78
79
  function renderGateway(){const host=$('#gateway-list');
79
80
  const rows=[...catalog.mcpServers,...myMcp.filter(m=>m.kind==='stdio').map(m=>({id:m.id,label:m.name+' (milik saya)',description:m.summary}))];
@@ -98,8 +99,9 @@ $('#profile-import').onchange=async()=>{const f=$('#profile-import').files[0];if
98
99
  // ─ Skill Saya: the member's library via /api/library (src/library.js) ─
99
100
  let librarySkills=[],libPreview=null;
100
101
  const readFile=file=>new Promise((ok,no)=>{if(file.size>512*1024)return no(new Error(`${file.name} melebihi 512 KB.`));const r=new FileReader();r.onload=()=>ok(String(r.result));r.onerror=()=>no(new Error(`${file.name} tidak bisa dibaca.`));r.readAsText(file)});
102
+ function emptyState(text,label,action){const box=el('div','empty-state');box.append(el('p',null,text));if(label){const b=el('button','secondary',label);b.type='button';b.onclick=action;box.append(b)}return box}
101
103
  function renderLibrary(){const host=$('#library-list');
102
- if(!librarySkills.length){host.replaceChildren(el('p','muted','Library masih kosong. Import dari GitHub atau buat dari Markdown.'));return}
104
+ if(!librarySkills.length){host.replaceChildren(emptyState('Belum ada skill milik Anda. Import dari GitHub atau buat dari Markdown.','+ Import dari GitHub',()=>$('#lib-open-github').click()));return}
103
105
  host.replaceChildren(...librarySkills.map(s=>{const card=el('article','panel lib-card');const head=el('div','lib-card-head');head.append(el('strong',null,s.id),el('span','pill',({github:'GITHUB',upload:'UPLOAD'})[s.type]||'MARKDOWN'));if(s.generated)head.append(el('span','pill','SKILL.md DIBUAT OTOMATIS'));
104
106
  const about=el('p',null,s.description||'(tanpa deskripsi)');about.title=s.description||'';card.append(head,about);
105
107
  if(s.repo){const link=el('a','lib-source','github.com/'+s.repo);link.href='https://github.com/'+s.repo;link.target='_blank';link.rel='noopener noreferrer';card.append(link)}
@@ -217,8 +219,9 @@ function renderPaketCards(items){const host=$('#paket-cards');
217
219
  const head=el('span','paket-card-head');head.append(el('span','paket-icon',p.icon),el('strong',null,p.short));card.append(head,el('small','paket-desc',p.description));
218
220
  card.append(el('span','paket-meta',[sk&&`${sk} skill`,mc&&`${mc} MCP`].filter(Boolean).join(' · ')||'Belum ada isi'),el('span','paket-by',p.author?'oleh '+p.author:''));
219
221
  if(p.starter)card.append(el('span','paket-starter','Mulai dari: '+p.starter));return card}).filter(Boolean),newPaketCard())}
220
- function renderPaketFilters(){const host=$('#collection-filters');
221
- host.replaceChildren(...[{id:'all',short:'Semua'},...paketList()].map(p=>{const b=el('button',null,p.short);b.type='button';b.setAttribute('aria-pressed',String(collectionPaket===p.id));b.onclick=()=>{collectionPaket=p.id;renderCollection()};return b}))}
222
+ function renderPaketFilters(){const host=$('#collection-filters');if(collectionPaket==='all'){host.replaceChildren();return}
223
+ const p=paketById(collectionPaket),b=el('button','filter-chip paket-'+(p.color||'gray'));b.type='button';b.setAttribute('aria-label',`Hapus saringan paket ${p.short}`);
224
+ b.append(el('span',null,'Paket: '+p.short),el('span',null,'×'));b.onclick=()=>{collectionPaket='all';renderCollection()};host.replaceChildren(b)}
222
225
  function renderPaketBulk(items){const host=$('#paket-bulk'),found=detectedAgents(),p=paketById(collectionPaket);show(host,collectionPaket!=='all'&&(items.length>0||p.custom));if(host.hidden){host.replaceChildren();return}
223
226
  const remove=()=>{const b=el('button','secondary danger','Hapus paket');b.type='button';b.onclick=()=>deletePaket(p,b);return b};
224
227
  if(!items.length){host.replaceChildren(el('span','muted',`Paket ${p.short} masih kosong. Tandai skill milik Anda lewat tombol "Paket…" di kartunya.`),remove());return}
@@ -292,49 +295,91 @@ const mcpPrompt=name=>`Sebutkan semua tool dari MCP "${name}" yang tersedia untu
292
295
  function mcpIdFor(name){if(name==='santrihub')return GATEWAY_ID;
293
296
  return catalog.mcpServers.some(m=>m.id===name)||myMcp.some(m=>m.id===name)?name:null}
294
297
  async function copyText(text,btn){try{await navigator.clipboard.writeText(text);const old=btn.textContent;btn.textContent='Tersalin ✓';setTimeout(()=>{btn.textContent=old},1400)}catch{const host=btn.closest('li')||btn.parentElement;host.querySelector('.copy-manual')?.remove();const pre=el('pre','copy-manual',text);host.append(pre);getSelection().selectAllChildren(pre);status('Clipboard diblokir: teks sudah diseleksi, tekan Ctrl+C.',true)}}
298
+ let checkAgent='',checkAll=false;const CHECK_LIMIT=6;
295
299
  function renderAgentChecks(){const host=$('#agent-checks');if(!host)return;const found=detectedAgents();
296
300
  if(!agents.length){host.replaceChildren(el('p','muted','AI agent belum dimuat.'));return}
297
301
  if(!found.length){host.replaceChildren(el('p','muted','Belum ada AI agent terdeteksi di komputer ini.'));return}
298
- host.replaceChildren(...found.map(h=>{const card=el('article','agent-check'),head=el('div','agent-check-head');
299
- const mine=h.skills.filter(s=>s.managed).map(s=>s.id),others=h.skills.filter(s=>!s.managed).map(s=>s.id);
300
- head.append(el('strong',null,h.name),el('span','pill '+(mine.length||h.mcp.names.length?'ok':''),`${h.skills.length} skill · ${h.mcp.names.length} MCP`));card.append(head);
301
- if(h.mcp.valid===false)card.append(el('p','agent-check-warn','Config MCP agent ini tidak bisa dibaca (JSON/TOML rusak). Perbaiki file-nya dulu: '+h.mcp.file));
302
- const steps=el('ol','agent-check-steps');for(const s of RELOAD[h.id]||[`Reload ${h.name}.`]){const li=el('li');li.innerHTML=s;steps.append(li)}
303
- const reload=el('div','agent-check-block');reload.append(el('span','agent-check-label','Muat ulang agent'),steps);
304
- if(h.id==='antigravity'){const b=el('button','secondary','Buka Cek & Tes Antigravity');b.type='button';b.onclick=()=>$('#check-test').click();reload.append(b)}
305
- const items=el('div','agent-check-block');items.append(el('span','agent-check-label','Tes & prompt uji'));
306
- const list=el('ul','agent-check-items');
307
- for(const name of h.mcp.names){const li=el('li','agent-check-item'),id=mcpIdFor(name);li.append(el('span','agent-kind mcp','MCP'),el('span','agent-check-name',name));
308
- const acts=el('span','agent-check-actions');
309
- if(id){const t=el('button','secondary','Tes koneksi');t.type='button';t.onclick=()=>testMcp(id,li,t);acts.append(t)}
310
- else acts.append(el('small','muted','bukan dari SantriHub'));
311
- const c=el('button','secondary','Salin prompt');c.type='button';c.onclick=()=>copyText(mcpPrompt(name),c);acts.append(c);li.append(acts);list.append(li)}
312
- for(const id of [...mine,...others]){const li=el('li','agent-check-item');li.append(el('span','agent-kind skill'+(mine.includes(id)?'':' mine'),'SKILL'),el('span','agent-check-name',id+(mine.includes(id)?'':' (milik Anda)')));
313
- const acts=el('span','agent-check-actions'),c=el('button','secondary','Salin prompt');c.type='button';c.onclick=()=>copyText(skillPrompt(id),c);acts.append(c);li.append(acts);list.append(li)}
314
- if(!list.children.length){const empty=el('li','muted','Belum ada skill atau MCP di agent ini. ');const a=el('button','secondary','Aktifkan dulu →');a.type='button';a.onclick=()=>go('agents');empty.append(a);list.append(empty)}
315
- items.append(list);card.append(reload,items);return card}))}
316
- $('#agent-checks-refresh').onclick=()=>busy($('#agent-checks-refresh'),'Mendeteksi AI agent…',loadAgents);
317
-
318
- // ─ Tur singkat: 5 slides over the 4-step flow; shown once per browser, replay from Beranda or the profile menu ─
302
+ if(!found.some(h=>h.id===checkAgent))checkAgent=found[0].id;const h=found.find(x=>x.id===checkAgent);
303
+ const tabs=el('div','agent-tabs');tabs.setAttribute('role','tablist');tabs.setAttribute('aria-label','AI agent');
304
+ for(const x of found){const t=el('button','agent-tab');t.type='button';t.setAttribute('role','tab');t.setAttribute('aria-selected',String(x.id===checkAgent));
305
+ t.append(el('span',null,x.name),el('span','count',String(x.skills.length+x.mcp.names.length)));t.onclick=()=>{checkAgent=x.id;checkAll=false;renderAgentChecks()};tabs.append(t)}
306
+ const card=el('article','agent-check');card.setAttribute('role','tabpanel');card.setAttribute('aria-label',h.name);
307
+ const mine=h.skills.filter(s=>s.managed).map(s=>s.id),others=h.skills.filter(s=>!s.managed).map(s=>s.id);
308
+ if(h.mcp.valid===false)card.append(el('p','agent-check-warn','Config MCP agent ini tidak bisa dibaca (JSON/TOML rusak). Perbaiki file-nya dulu: '+h.mcp.file));
309
+ const stepHead=(n,text)=>{const t=el('h3');t.append(el('i',null,n),document.createTextNode(text));return t};
310
+ const reload=el('section','agent-check-step'),steps=el('ol','agent-check-steps');for(const s of RELOAD[h.id]||[`Reload ${h.name}.`]){const li=el('li');li.innerHTML=s;steps.append(li)}
311
+ reload.append(stepHead('1','Muat ulang '+h.name),el('p',null,'Agent membaca skill dan MCP saat mulai, jadi muat ulang setelah mengaktifkan.'),steps);
312
+ if(h.id==='antigravity'){const b=el('button','secondary','Buka Cek & Tes Antigravity');b.type='button';b.onclick=()=>$('#check-test').click();reload.append(b)}
313
+ const test=el('section','agent-check-step'),list=el('ul','agent-check-items');
314
+ test.append(stepHead('2','Coba di chat'),el('p',null,`Tes koneksi MCP di sini, atau salin prompt uji lalu tempel di chat ${h.name}.`));
315
+ const rows=[];
316
+ for(const name of h.mcp.names){const li=el('li','agent-check-item'),id=mcpIdFor(name);li.append(el('span','agent-kind mcp','MCP'),el('span','agent-check-name',name));
317
+ const acts=el('span','agent-check-actions');
318
+ if(id){const t=el('button','secondary','Tes koneksi');t.type='button';t.onclick=()=>testMcp(id,li,t);acts.append(t)}
319
+ else acts.append(el('small','muted','bukan dari SantriHub'));
320
+ const c=el('button','secondary','Salin prompt');c.type='button';c.onclick=()=>copyText(mcpPrompt(name),c);acts.append(c);li.append(acts);rows.push(li)}
321
+ for(const id of [...mine,...others]){const li=el('li','agent-check-item'),name=el('span','agent-check-name',id+(mine.includes(id)?'':' (milik Anda)'));name.title=id;
322
+ li.append(el('span','agent-kind skill'+(mine.includes(id)?'':' mine'),'SKILL'),name);
323
+ const acts=el('span','agent-check-actions'),c=el('button','secondary','Salin prompt');c.type='button';c.onclick=()=>copyText(skillPrompt(id),c);acts.append(c);li.append(acts);rows.push(li)}
324
+ if(!rows.length){const empty=el('li','muted','Belum ada skill atau MCP di agent ini. ');const a=el('button','secondary','Aktifkan dulu →');a.type='button';a.onclick=()=>go('agents');empty.append(a);rows.push(empty)}
325
+ list.append(...(checkAll?rows:rows.slice(0,CHECK_LIMIT)));test.append(list);
326
+ if(rows.length>CHECK_LIMIT){const more=el('button','secondary',checkAll?'Tampilkan lebih sedikit':`Tampilkan semua (${rows.length})`);more.type='button';more.onclick=()=>{checkAll=!checkAll;renderAgentChecks()};test.append(more)}
327
+ card.append(reload,test);host.replaceChildren(tabs,card)}
328
+
329
+ // ─ Tur singkat: a spotlight walks the 4-step flow; the card sits next to what it explains. Shown once per browser, replay from Beranda or the profile menu ─
319
330
  const TOUR_KEY='santrihub-tour-v1';
331
+ // target: selectors tried in order; the first one that is on screen wins, and all its visible matches are highlighted together.
320
332
  const TOUR=[
321
- {page:'home',title:'Selamat datang di SantriHub',text:'Satu tempat untuk mengelola skill dan MCP semua AI agent Anda: Claude Code, Codex, Antigravity, Gemini CLI, Cursor, VS Code, dan Windsurf.',points:['Pilih jalur proyek di Beranda: paket Apps Script atau Monorepo, lalu pasang sekali klik.','Ikuti 4 langkah di sidebar, dari atas ke bawah.','Beranda selalu menunjukkan langkah berikutnya ("Mulai di sini").']},
322
- {page:'add',title:'1 · Tambah',text:'Masukkan skill dan MCP dari mana saja.',points:['Tarik banyak ZIP, folder, atau file .md sekaligus. SKILL.md dibuat otomatis bila belum ada.','Tempel config MCP, perintah npx/uvx, atau URL MCP.','Atau ambil dari katalog premium dan GitHub.']},
323
- {page:'collection',title:'2 · Koleksi',text:'Semua yang Anda tambahkan berkumpul di sini, bersama katalog premium Santriverse.',points:['Lihat di agent mana tiap item sudah aktif.','Tombol "Tes koneksi" langsung menjalankan MCP untuk memastikan ia bekerja.']},
324
- {page:'agents',title:'3 · Aktifkan',text:'Pilih skill dan MCP untuk tiap AI agent dengan mencentang tabel.',points:['SantriHub hanya menyentuh file buatannya sendiri; config Anda yang lain aman.','Pakai Gateway untuk banyak MCP lewat satu entri, atau Profil untuk menyalin set ke agent lain.']},
325
- {page:'status',title:'4 · Cek & Tes',text:'Pastikan semuanya benar-benar terbaca oleh AI agent.',points:['Tes koneksi MCP, lalu ikuti cara memuat ulang agent.','Salin prompt uji dan tempel di chat agent untuk membuktikannya.']}];
326
- let tourIndex=0;const tour=$('#tour');
333
+ {page:'home',target:['.home-hero'],title:'Selamat datang di SantriHub',text:'Satu tempat untuk skill dan MCP semua AI agent Anda: Claude Code, Codex, Antigravity, Gemini CLI, Cursor, VS Code, dan Windsurf.',points:['Tur ini menunjukkan tiap bagian satu per satu. Kurang dari 1 menit.']},
334
+ {page:'home',target:['.nav-flow','.sidebar-rail .rail-step','#nav-toggle'],title:'4 langkah, dari atas ke bawah',text:'Semua pekerjaan mengikuti alur ini: Tambah → Koleksi → Aktifkan → Cek & Tes.',points:['Klik nomor langkah kapan saja untuk pindah.']},
335
+ {page:'home',target:['#home-paths'],title:'Pilih jalur proyek',text:'Paket Apps Script atau Monorepo berisi skill yang sudah disusun Santriverse.',points:['Pilih AI agent, lalu klik "Pasang paket". Semua isinya aktif sekaligus.']},
336
+ {page:'add',target:['#drop-zone','.smart-import'],title:'1 · Tambah: impor pintar',text:'Tarik banyak ZIP, folder, atau file .md sekaligus ke kotak ini.',points:['SKILL.md dibuat otomatis bila belum ada.','Klik "Pindai & pratinjau" untuk melihat isinya sebelum disimpan.']},
337
+ {page:'add',target:['#mcp-paste-box'],title:'Tempel MCP',text:'Buka bagian ini untuk menempel config MCP (JSON), perintah npx/uvx, atau URL MCP.',points:['API key hanya disimpan di komputer ini.']},
338
+ {page:'collection',target:['#paket-cards'],title:'2 · Koleksi per paket',text:'Semua yang Anda tambahkan berkumpul di sini, bersama katalog premium Santriverse.',points:['Klik satu paket untuk melihat isinya dan menyalakannya sekaligus di satu agent.']},
339
+ {page:'collection',target:['#collection-list'],title:'Kartu skill & MCP',text:'Tiap kartu menunjukkan di agent mana item itu sudah aktif.',points:['MCP punya tombol "Tes koneksi" untuk memastikan ia benar-benar jalan.']},
340
+ {page:'agents',target:['.agents-scroll','#agents-cards'],title:'3 · Aktifkan per AI agent',text:'Centang tabel ini untuk menyalakan skill atau MCP di tiap agent.',points:['SantriHub hanya menyentuh file buatannya sendiri; config Anda yang lain aman.']},
341
+ {page:'status',target:['.agent-checks-wrap'],title:'4 · Cek & Tes',text:'Pastikan semuanya benar-benar terbaca oleh AI agent.',points:['Tes MCP, muat ulang agent, lalu salin prompt uji ke chat.']}];
342
+ let tourIndex=0,tourEl=null,tourWatch=null,tourFrame=0;const tour=$('#tour'),tourSpot=$('#tour-spot');
327
343
  function tourStorage(fn){try{return fn(localStorage)}catch{return null}}
344
+ // Off-canvas (closed mobile sidebar, collapsed rail) does not count; scrolled out of view does, since the tour scrolls to it.
345
+ function onScreen(e){const r=e.getBoundingClientRect();return r.width>0&&r.height>0&&r.right>0&&r.left<innerWidth&&getComputedStyle(e).visibility!=='hidden'}
346
+ function tourTargets(s){for(const sel of s.target){const found=$$(sel).filter(onScreen);if(found.length)return found}return []}
347
+ function tourRect(els){if(!els.length)return null;const rs=els.map(e=>e.getBoundingClientRect()),pad=8;
348
+ return {left:Math.min(...rs.map(r=>r.left))-pad,top:Math.min(...rs.map(r=>r.top))-pad,right:Math.max(...rs.map(r=>r.right))+pad,bottom:Math.max(...rs.map(r=>r.bottom))+pad}}
349
+ function tourScroll(els){const e=els[0];if(!e)return;if(e.closest('#sidebar,.sidebar-rail,.mobile-menu')){e.scrollIntoView({block:'nearest'});return}
350
+ const head=$('main > header')?.getBoundingClientRect().bottom||0;window.scrollTo({top:Math.max(0,scrollY+e.getBoundingClientRect().top-head-24),behavior:'auto'})}
351
+ // Card goes beside the target (right, left, below, above); a target taller than the room left is cropped so the card fits below it.
352
+ function placeTour(){tourFrame=0;if(!tour.open)return;const vw=innerWidth,vh=innerHeight,m=12,gap=16,w=tour.offsetWidth,h=tour.offsetHeight;
353
+ const clamp=(v,lo,hi)=>Math.min(Math.max(v,lo),Math.max(lo,hi)),els=tourTargets(TOUR[tourIndex]);let r=tourRect(els);
354
+ // Page content scrolls under the sticky header, so only that part is cropped at the header's edge.
355
+ if(r){const head=els[0].closest('main')&&!els[0].closest('main > header')?$('main > header').getBoundingClientRect().bottom:0;
356
+ r={left:Math.max(r.left,4),right:Math.min(r.right,vw-4),top:Math.max(r.top,head+4),bottom:Math.min(r.bottom,vh-4)};if(r.bottom-r.top<12||r.right-r.left<12)r=null}
357
+ let side='none',x=(vw-w)/2,y=(vh-h)/2;
358
+ if(r){const fits={right:r.right+gap+w<=vw-m,left:r.left-gap-w>=m,bottom:r.bottom+gap+h<=vh-m,top:r.top-gap-h>=m};
359
+ if(!fits.right&&!fits.left&&!fits.bottom&&!fits.top&&r.top+120+gap+h<=vh-m){r.bottom=vh-m-h-gap;fits.bottom=true}
360
+ side=['right','left','bottom','top'].find(k=>fits[k])||'inside';
361
+ if(side==='right'||side==='left'){x=side==='right'?r.right+gap:r.left-gap-w;y=clamp(r.top,m,vh-m-h)}
362
+ else if(side==='bottom'||side==='top'){x=clamp(r.right-r.left>w?r.left:(r.left+r.right-w)/2,m,vw-m-w);y=side==='bottom'?r.bottom+gap:r.top-gap-h}
363
+ else{x=vw-m-w;y=vh-m-h}
364
+ const arrow=side==='right'||side==='left'?clamp((Math.max(r.top,y)+Math.min(r.bottom,y+h))/2-y,22,h-22):clamp((Math.max(r.left,x)+Math.min(r.right,x+w))/2-x,22,w-22);
365
+ tour.style.setProperty('--arrow',arrow+'px');Object.assign(tourSpot.style,{left:r.left+'px',top:r.top+'px',width:r.right-r.left+'px',height:r.bottom-r.top+'px'})}
366
+ else Object.assign(tourSpot.style,{left:vw/2+'px',top:vh/2+'px',width:'0px',height:'0px'});
367
+ tourSpot.classList.toggle('empty',!r);tour.dataset.side=side;tour.style.left=Math.round(x)+'px';tour.style.top=Math.round(y)+'px'}
368
+ const queueTour=()=>{if(!tourFrame)tourFrame=requestAnimationFrame(placeTour)};
328
369
  function showTourStep(){const s=TOUR[tourIndex];$('#tour-step').textContent=`${tourIndex+1} / ${TOUR.length}`;$('#tour-title').textContent=s.title;$('#tour-text').textContent=s.text;
329
- $('#tour-points').replaceChildren(...s.points.map(p=>el('li',null,p)));$('#tour-dots').replaceChildren(...TOUR.map((_,i)=>el('i',i===tourIndex?'on':'')));
370
+ $('#tour-points').replaceChildren(...(s.points||[]).map(p=>el('li',null,p)));$('#tour-dots').replaceChildren(...TOUR.map((_,i)=>el('i',i===tourIndex?'on':'')));
330
371
  show($('#tour-back'),tourIndex>0);$('#tour-next').textContent=tourIndex===TOUR.length-1?'Mulai dari langkah 1 →':'Lanjut';
331
- go(s.page);$$('.tour-focus').forEach(b=>b.classList.remove('tour-focus'));$$(`.nav-step[data-page="${s.page}"],.rail-step[data-rail-page="${s.page}"]`).forEach(b=>b.classList.add('tour-focus'))}
332
- function openTour(){tourIndex=0;if(!tour.open)tour.showModal();showTourStep();$('#tour-next').focus()}
333
- function closeTour(){tourStorage(s=>s.setItem(TOUR_KEY,'done'));$$('.tour-focus').forEach(b=>b.classList.remove('tour-focus'));if(tour.open)tour.close()}
372
+ if(location.hash.slice(1)!==s.page||$('#page-'+s.page).hidden)go(s.page);
373
+ const els=tourTargets(s);tourScroll(els);tourWatch?.disconnect();tourWatch=new ResizeObserver(queueTour);tourWatch.observe(tour);for(const e of els)tourWatch.observe(e);
374
+ // Pages fill in after their data loads; re-place once that settles.
375
+ placeTour();for(const ms of [150,500,1200])setTimeout(()=>{if(TOUR[tourIndex]===s)placeTour()},ms)}
376
+ function openTour(){tourIndex=0;show(tourSpot);if(!tour.open)tour.showModal();addEventListener('resize',queueTour);addEventListener('scroll',queueTour,true);addEventListener('transitionend',queueTour,true);showTourStep();$('#tour-next').focus()}
377
+ function closeTour(){tourStorage(s=>s.setItem(TOUR_KEY,'done'));tourWatch?.disconnect();tourWatch=null;removeEventListener('resize',queueTour);removeEventListener('scroll',queueTour,true);removeEventListener('transitionend',queueTour,true);show(tourSpot,false);if(tour.open)tour.close()}
334
378
  const tourSeen=()=>tourStorage(s=>s.getItem(TOUR_KEY))==='done';
335
379
  function maybeTour(){if(!tourSeen()&&!$('#locked').open)setTimeout(()=>{if(!tourSeen()&&!document.querySelector('dialog[open]'))openTour()},600)}
336
- $('#tour-next').onclick=()=>{if(tourIndex<TOUR.length-1){tourIndex++;showTourStep()}else{closeTour();go('add')}};
337
- $('#tour-back').onclick=()=>{if(tourIndex>0){tourIndex--;showTourStep()}};
380
+ const tourNext=()=>{if(tourIndex<TOUR.length-1){tourIndex++;showTourStep()}else{closeTour();go('add');scrollTo(0,0)}},tourBack=()=>{if(tourIndex>0){tourIndex--;showTourStep()}};
381
+ $('#tour-next').onclick=tourNext;$('#tour-back').onclick=tourBack;
382
+ tour.addEventListener('keydown',e=>{if(e.key==='ArrowRight'){e.preventDefault();tourNext()}else if(e.key==='ArrowLeft'){e.preventDefault();tourBack()}});
338
383
  $('#tour-skip').onclick=closeTour;tour.addEventListener('cancel',e=>{e.preventDefault();closeTour()});
339
384
  $('#home-tour').onclick=openTour;$('#tour-replay').onclick=()=>{closeProfile();openTour()};
340
385
 
@@ -429,17 +474,38 @@ async function checkUpdate(){try{updateInfo=await getJson('/api/update');const b
429
474
  function openUpdate(){if(!updateInfo)return;const self=selfUpdate();
430
475
  $('#update-current').textContent='v'+updateInfo.current;$('#update-latest').textContent='v'+updateInfo.latest;
431
476
  $('#update-notes').href=updateInfo.releaseUrl;$('#update-command').textContent=updateInfo.command;$('#update-feedback').textContent='';
432
- show($('#update-self'),self);show($('#update-manual'),!self);show($('#update-now'),self);$('#update-now').disabled=false;$('#update-now').textContent='Update sekarang';
477
+ show($('#update-self'),self);show($('#update-manual'),!self);show($('#update-now'),self);$('#update-now').disabled=false;$('#update-now').textContent='Update sekarang';show($('#update-progress'),false);
433
478
  updateDialog.showModal()}
434
479
  $('#update-btn').onclick=openUpdate;
435
480
  $('#update-close').onclick=()=>updateDialog.close();
436
481
  $('#update-copy').onclick=async()=>{try{await navigator.clipboard.writeText(updateInfo.command);done('✓ Perintah update disalin.')}catch{fail(new Error('Clipboard tidak tersedia. Salin perintah secara manual.'))}};
437
- $('#update-now').onclick=async()=>{const btn=$('#update-now'),fb=$('#update-feedback');btn.disabled=true;btn.textContent='Mengunduh…';
438
- fb.textContent='Mengunduh installer resmi v'+updateInfo.latest+' dan memeriksa SHA-256…';
482
+ // Progress: the POST below runs the whole download; /__santrihub/update/status reports where it is.
483
+ // Steps: 0 Unduh (check, sums, download) · 1 Cek SHA-256 · 2 Pasang · 3 Buka ulang.
484
+ const UPDATE_STEP={check:0,sums:0,download:0,verify:1,install:2,restart:3};
485
+ let updateRunning=false,updateSpeed=null;
486
+ const mb=n=>(n/1048576).toLocaleString('id-ID',{minimumFractionDigits:1,maximumFractionDigits:1});
487
+ function renderUpdateProgress(s){const v='v'+(s.version||updateInfo?.latest||''),step=UPDATE_STEP[s.stage]??0,frac=s.total?Math.min(1,s.received/s.total):0;
488
+ let pct={check:1,sums:3,verify:90,install:95,restart:100}[s.stage]??0,text='Menyiapkan…';
489
+ if(s.stage==='check')text='Memeriksa versi terbaru…';
490
+ if(s.stage==='sums')text='Mengambil daftar checksum resmi…';
491
+ if(s.stage==='download'){pct=3+Math.round(frac*84);const now=performance.now();
492
+ if(updateSpeed&&now>updateSpeed.at){const rate=(s.received-updateSpeed.received)/((now-updateSpeed.at)/1000);updateSpeed.rate=updateSpeed.rate?updateSpeed.rate*.7+rate*.3:rate}
493
+ updateSpeed={at:now,received:s.received,rate:updateSpeed?.rate||0};
494
+ text=`Mengunduh installer ${v} · ${mb(s.received)}${s.total?' / '+mb(s.total):''} MB${updateSpeed.rate>0?' · '+mb(updateSpeed.rate)+' MB/s':''}`}
495
+ if(s.stage==='verify')text='Mencocokkan SHA-256 installer dengan rilis resmi…';
496
+ if(s.stage==='install')text='Installer terverifikasi. Menyiapkan pemasangan…';
497
+ if(s.stage==='restart')text=`SantriHub akan tertutup sebentar, memasang ${v}, lalu terbuka lagi sendiri.`;
498
+ const prog=$('#update-progress');show(prog,true);prog.classList.toggle('waiting',s.stage==='download'&&!s.total||s.stage==='check'||s.stage==='sums');prog.classList.toggle('finishing',s.stage==='restart');
499
+ $('#update-bar-fill').style.width=pct+'%';$('#update-bar').setAttribute('aria-valuenow',String(pct));$('#update-pct').textContent=pct+'%';$('#update-stage').textContent=text;
500
+ $$('[data-update-step]').forEach(li=>{const i=Number(li.dataset.updateStep);li.className=i<step?'done':i===step?'active':''})}
501
+ async function pollUpdate(){try{const s=await getJson('/__santrihub/update/status');if(updateRunning&&s.stage!=='idle'&&s.stage!=='error')renderUpdateProgress(s)}catch{/* app closing */}}
502
+ updateDialog.addEventListener('cancel',e=>{if(updateRunning)e.preventDefault()});
503
+ $('#update-now').onclick=async()=>{const btn=$('#update-now'),fb=$('#update-feedback');btn.disabled=true;btn.textContent='Memperbarui…';$('#update-close').disabled=true;
504
+ fb.textContent='';updateRunning=true;updateSpeed=null;renderUpdateProgress({stage:'check'});const timer=setInterval(pollUpdate,350);
439
505
  try{const res=await fetch('/__santrihub/update',{method:'POST',headers:{'Content-Type':'application/json'},body:'{}'});const data=await res.json().catch(()=>({}));
440
506
  if(!res.ok)throw new Error(data.error||'Pembaruan gagal ('+res.status+').');
441
- btn.textContent='Memasang…';fb.textContent='Installer terverifikasi. SantriHub ditutup sebentar lalu terbuka lagi di v'+(data.version||updateInfo.latest)+'.';log('Pembaruan ke v'+(data.version||updateInfo.latest)+' dimulai.')}
442
- catch(e){btn.disabled=false;btn.textContent='Coba lagi';fb.textContent=e.message;fail(e)}};
507
+ clearInterval(timer);renderUpdateProgress({stage:'restart',version:data.version||updateInfo.latest});btn.textContent='Membuka ulang…';log('Pembaruan ke v'+(data.version||updateInfo.latest)+' dimulai.')}
508
+ catch(e){clearInterval(timer);updateRunning=false;show($('#update-progress'),false);$('#update-close').disabled=false;btn.disabled=false;btn.textContent='Coba lagi';fb.textContent=e.message;fail(e)}};
443
509
  checkUpdate();
444
510
 
445
511
  // ─ Navigation ─
@@ -455,7 +521,11 @@ toggle.onclick=()=>{const open=document.body.classList.toggle('nav-open');toggle
455
521
  $('#nav-backdrop').onclick=closeNav;$('#close-sidebar').onclick=closeNav;
456
522
  $('#collapse-sidebar').onclick=()=>document.body.classList.add('rail');
457
523
  $('#rail-toggle').onclick=()=>document.body.classList.remove('rail');
458
- document.addEventListener('keydown',e=>{if(e.key==='Escape'){closeNav();closeProfile()}});
524
+ document.addEventListener('keydown',e=>{if(e.key==='Escape'){closeNav();closeProfile();closeScope()}});
525
+ const scopeBtn=$('#scope-toggle');
526
+ function closeScope(){document.querySelector('.topbar').classList.remove('scope-open');scopeBtn.setAttribute('aria-expanded','false')}
527
+ scopeBtn.onclick=e=>{e.stopPropagation();const open=!document.querySelector('.topbar').classList.contains('scope-open');document.querySelector('.topbar').classList.toggle('scope-open',open);scopeBtn.setAttribute('aria-expanded',String(open))};
528
+ document.addEventListener('click',e=>{if(!e.target.closest('#scope-bar,#scope-toggle'))closeScope()});
459
529
 
460
530
  // ─ Sidebar resize (210–420px seperti Notes) ─
461
531
  $('#resize-handle').addEventListener('pointerdown',e=>{e.preventDefault();const move=ev=>{const w=Math.min(420,Math.max(210,ev.clientX));document.documentElement.style.setProperty('--sb-w',w+'px')};
@@ -567,7 +637,7 @@ function renderStatus(){const s=lastStatus;if(!s)return;const m=s.mcp,skillCount
567
637
  if($('#install-counts').innerHTML!==counts)$('#install-counts').innerHTML=counts;
568
638
  $('#stat-installed').textContent=skillCount;$('#stat-config').textContent=m.valid===false?'Config error':mcpCount?'MCP dikonfigurasi':'MCP belum dikonfigurasi';renderSkills();renderMcp()}
569
639
  document.addEventListener('visibilitychange',()=>{if(document.hidden)stopStatusPoll();else if(statusPollAllowed())loadStatus()});
570
- $('#refresh-status').onclick=()=>loadStatus();
640
+ $('#refresh-status').onclick=()=>{loadStatus();loadAgents()};
571
641
  const advanced=$('#advanced-status');let advancedTrigger=null;
572
642
  $('#open-advanced').onclick=()=>{advancedTrigger=document.activeElement;advanced.showModal();$('#close-advanced').focus()};
573
643
  $('#close-advanced').onclick=()=>closeCheckDialog(advanced);
@@ -588,7 +658,7 @@ function renderSources(){const repos=[['MONOREPO-SKILLS','monorepo'],['GOOGLE-AP
588
658
  let repoPreview=null,savedRepos=[],repoGeneration=0,repoBusy=false;
589
659
  const repoModal=$('#repo-modal');
590
660
  function resetGithub(){repoGeneration++;repoPreview=null;$('#repo-modal-save').disabled=repoBusy;show($('#repo-modal-preview'),false);$('#repo-modal-feedback').textContent='Tempel URL, lalu Simpan. Deteksi dilakukan otomatis.'}
591
- function renderRepos(){const host=$('#saved-repos');if(!savedRepos.length){host.textContent='Belum ada repository tersimpan.';return}
661
+ function renderRepos(){const host=$('#saved-repos');if(!savedRepos.length){host.replaceChildren(emptyState('Belum ada repositori tersimpan. Simpan repo favorit supaya cepat dipakai lagi.','+ Tambah repositori',()=>$('#add-repo').click()));return}
592
662
  host.replaceChildren(...savedRepos.map(row=>{const card=document.createElement('article');card.className='catalog-card';card.innerHTML=`<strong>${esc(row.repo)}</strong><small>${esc(row.url)}</small><small>Terdeteksi: Skills ${row.skills.length} · MCP ${row.mcp.length}. Bukan bukti terpasang.</small>`;
593
663
  const actions=document.createElement('div');actions.className='repo-actions';const copy=document.createElement('button');copy.type='button';copy.className='copy-btn secondary';copy.textContent='Salin';copy.setAttribute('aria-label','Salin URL '+row.repo);copy.onclick=async()=>{try{await navigator.clipboard.writeText(row.url);copy.textContent='Tersalin';setTimeout(()=>copy.textContent='Salin',1400)}catch{status('Gagal menyalin. Pilih teks lalu salin manual.',true)}};
594
664
  const del=document.createElement('button');del.type='button';del.className='secondary repo-delete';del.textContent='Hapus';del.onclick=()=>busy(del,'Menghapus bookmark…',async()=>{await post('/api/repos/delete',{url:row.url});savedRepos=savedRepos.filter(x=>x.url!==row.url);renderRepos();done('Bookmark dihapus.')});actions.append(copy,del);card.append(actions);return card}))}
@@ -620,7 +690,7 @@ function checkControls(){
620
690
  }
621
691
  async function showCheck(){
622
692
  if($('#check-panel').open)return;stopCheckPoll();const epoch=++checkEpoch;checkBusy=true;checkInventory=null;checkVerified=false;checkRequest=new AbortController();const signal=checkRequest.signal;
623
- $('#check-summary').textContent='Memeriksa file dan konfigurasi global…';$('#check-results').innerHTML='';$('#check-counts').textContent='';$('#check-targets').textContent='';$('#check-proof').textContent='Belum ada callback.';$('#check-proof').classList.remove('proof-ok');$('#control-feedback').textContent='';show($('#force-antigravity'),false);show($('#check-retry'),false);$('#check-panel').showModal();checkState(0,false);
693
+ $('#check-summary').textContent='Memeriksa file dan konfigurasi global…';$('#check-results').innerHTML='';$('#check-counts').textContent='';$('#check-targets').textContent='';$('#check-proof').textContent='Belum ada callback.';$('#check-proof').classList.remove('proof-ok');proofLine('proof-mcp',false);proofLine('proof-skill',false);show($('#check-skill-list'),false);$('#check-outcome').classList.remove('proof-ok');$('#control-feedback').textContent='';show($('#force-antigravity'),false);show($('#check-retry'),false);$('#check-panel').showModal();checkState(0,false);
624
694
  try{const r=await post('/api/verify',{scope:'global',skillIds:[...selectedSkills]},signal);if(epoch===checkEpoch&&$('#check-panel').open){checkInventory=r;renderCheck(r)}}catch(e){if(epoch===checkEpoch&&e.name!=='AbortError')$('#check-summary').textContent='Pemeriksaan gagal: '+e.message}finally{if(epoch===checkEpoch){checkBusy=false;checkRequest=null;checkControls()}}
625
695
  }
626
696
  $('#check-test').onclick=showCheck;
@@ -640,25 +710,36 @@ async function pollCheckProof(epoch=checkPollEpoch){
640
710
  if(!$('#check-panel').open||checkStep!==1||epoch!==checkPollEpoch)return;
641
711
  try{checkRequest=new AbortController();const proof=await getJson('/api/verification/status',checkRequest.signal);if(epoch!==checkPollEpoch||!$('#check-panel').open||checkStep!==1)return;checkRequest=null;
642
712
  checkVerified=proof.verified===true&&proof.evidence?.server==='santri-skills'&&proof.evidence?.level==='bridge-mcp-loaded'&&proof.evidence?.source==='local-capability-callback';
643
- if(checkVerified){$('#check-proof').textContent='Callback asli diterima · bridge MCP santri-skills saja. Identitas client tidak diautentikasi; MCP lain dan Skills belum terbukti dimuat IDE.';$('#check-proof').classList.add('proof-ok');$('#check-outcome').textContent=$('#check-proof').textContent;checkState(2);return}
644
- $('#check-proof').textContent=proof.pending?'Menunggu callback asli bridge MCP santri-skills. '+(proof.expiresAt?'Batas server: '+new Date(proof.expiresAt).toLocaleTimeString()+'.':''):'Callback kedaluwarsa atau konfigurasi berubah. Belum terverifikasi; coba lagi.';
713
+ const skill=proof.skillProof?.verified===true;proofLine('proof-mcp',checkVerified);proofLine('proof-skill',skill);
714
+ if(skill){renderSkillProof(proof.skillProof);checkState(2);return}
715
+ if(checkVerified){$('#check-proof').textContent='Callback asli diterima · bridge MCP santri-skills tersambung. Menunggu kode dari skill santrihub-cek: tempel kalimat di langkah 3 ke chat Agent baru.';$('#check-proof').classList.add('proof-ok');$('#check-finish').textContent='Lihat hasil (MCP saja)'}
716
+ else $('#check-proof').textContent=proof.pending?'Menunggu callback asli bridge MCP santri-skills. '+(proof.expiresAt?'Batas server: '+new Date(proof.expiresAt).toLocaleTimeString()+'.':''):'Callback kedaluwarsa atau konfigurasi berubah. Belum terverifikasi; coba lagi.';
645
717
  show($('#check-retry'),!proof.pending);if(!proof.pending)return;
646
718
  }catch(e){if(epoch!==checkPollEpoch||e.name==='AbortError')return;checkRequest=null;$('#check-proof').textContent='Tes gagal: '+e.message;show($('#check-retry'));return}
647
719
  checkTimer=setTimeout(()=>pollCheckProof(epoch),1500);
648
720
  }
721
+ function proofLine(id,ok){const el=$('#'+id);el.classList.toggle('ok',ok);el.querySelector('b').textContent=ok?'✓ terbukti':'menunggu'}
722
+ const BRIDGE_ONLY='Callback asli diterima · bridge MCP santri-skills saja. Identitas client tidak diautentikasi; MCP lain dan Skills belum terbukti dimuat IDE.';
723
+ function renderSkillProof(p){const all=p.seen.length+p.notSeen.length;
724
+ $('#check-summary').textContent='Global semua workspace · Skill dimuat TERBUKTI lewat kode cek santrihub-cek. Identitas client tidak diautentikasi.';$('#check-outcome').classList.add('proof-ok');
725
+ $('#check-outcome').textContent=`Skill dimuat · TERBUKTI. Agent membaca kode dari skill santrihub-cek di sesi ini dan mengirimnya lewat MCP santri-skills. ${p.seen.length} dari ${all} skill terpasang disebut agent. Identitas client tidak diautentikasi.`;
726
+ const box=$('#check-skill-list'),row=(id,ok)=>{const li=el('li',ok?'ok':'warn');li.append(el('span','pill '+(ok?'ok':'warn'),ok?'DISEBUT':'TIDAK DISEBUT'),el('span',null,id));return li};
727
+ const list=el('ul');list.append(...p.seen.map(id=>row(id,true)),...p.notSeen.map(id=>row(id,false)));
728
+ box.replaceChildren(el('strong',null,'Skill yang dilaporkan agent'),list,el('small','muted',p.notSeen.length?'Tidak disebut belum tentu gagal: agent bisa merangkum. Tanyakan langsung di chat, misalnya "Gunakan skill <nama>".':'Semua skill di folder global disebut agent.'));show(box,all>0)}
649
729
  async function startCheckProof(){
650
730
  if(checkBusy||checkStep!==1||!$('#check-panel').open||$('#check-start').disabled)return;stopCheckPoll();const epoch=checkEpoch,pollEpoch=checkPollEpoch;checkBusy=true;checkVerified=false;checkRequest=new AbortController();const signal=checkRequest.signal;show($('#check-retry'),false);$('#check-proof').textContent='Menyiapkan callback bridge…';checkControls();
651
- try{await post('/api/verification/start',{scope:'global'},signal);if(epoch===checkEpoch&&pollEpoch===checkPollEpoch)await pollCheckProof(pollEpoch)}catch(e){if(epoch===checkEpoch&&e.name!=='AbortError'){$('#check-proof').textContent='Tes gagal: '+e.message;show($('#check-retry'))}}finally{if(epoch===checkEpoch){checkBusy=false;checkControls()}}
731
+ try{const r=await post('/api/verification/start',{scope:'global'},signal);if(r.prompt)$('#proof-prompt').textContent=r.prompt;proofLine('proof-mcp',false);proofLine('proof-skill',false);$('#check-finish').textContent='Tutup tanpa verifikasi';if(epoch===checkEpoch&&pollEpoch===checkPollEpoch)await pollCheckProof(pollEpoch)}catch(e){if(epoch===checkEpoch&&e.name!=='AbortError'){$('#check-proof').textContent='Tes gagal: '+e.message;show($('#check-retry'))}}finally{if(epoch===checkEpoch){checkBusy=false;checkControls()}}
652
732
  }
733
+ $('#copy-proof-prompt').onclick=e=>copyText($('#proof-prompt').textContent,e.currentTarget);
653
734
  $('#check-start').onclick=startCheckProof;$('#check-retry').onclick=startCheckProof;
654
735
  $('#check-back').onclick=()=>{if(checkBusy)return;stopCheckPoll();checkVerified=false;checkState(0)};
655
- $('#check-finish').onclick=()=>{if(checkBusy)return;if(checkStep===0){checkState(1);return}if(checkStep===1){stopCheckPoll();status('Tes ditutup tanpa verifikasi; belum ada callback asli.',true);closeCheck();return}closeCheck()};
736
+ $('#check-finish').onclick=()=>{if(checkBusy)return;if(checkStep===0){checkState(1);return}if(checkStep===1){stopCheckPoll();if(checkVerified){$('#check-outcome').textContent=BRIDGE_ONLY;$('#check-outcome').classList.remove('proof-ok');show($('#check-skill-list'),false);checkState(2);return}status('Tes ditutup tanpa verifikasi; belum ada callback asli.',true);closeCheck();return}closeCheck()};
656
737
  $('#close-check').onclick=closeCheck;
657
738
  $('#check-panel').addEventListener('cancel',e=>{e.preventDefault();closeCheck()});
658
739
  $('#check-panel').addEventListener('close',()=>{stopCheckPoll();checkEpoch++;checkBusy=false;setTimeout(()=>{if(!$('#locked').open&&!document.querySelector('dialog[open]'))$('#check-test').focus()})});
659
740
  async function checkControl(action,force=false){
660
741
  if(checkBusy||!$('#check-panel').open||checkStep!==1)return;const epoch=checkEpoch;checkBusy=true;checkControls();
661
- try{await post('/api/antigravity/control',action==='launch'?{action}:{action,confirmClose:true,force,confirmForce:force});if(epoch===checkEpoch){show($('#force-antigravity'),false);$('#control-feedback').textContent=action==='launch'?'Permintaan buka dikirim. Ini bukan bukti callback.':'Restart selesai. Panggil santrihub_status; restart bukan bukti callback.'}}catch(e){if(epoch===checkEpoch){if(!force&&e.forceRequired)show($('#force-antigravity'));$('#control-feedback').textContent=e.message;fail(e)}}finally{if(epoch===checkEpoch){checkBusy=false;checkControls()}}
742
+ try{await post('/api/antigravity/control',action==='launch'?{action}:{action,confirmClose:true,force,confirmForce:force});if(epoch===checkEpoch){show($('#force-antigravity'),false);$('#control-feedback').textContent=action==='launch'?'Permintaan buka dikirim. Ini bukan bukti callback.':'Restart selesai. Buka chat Agent baru, lalu tempel kalimat di langkah 3. Restart sendiri bukan bukti.'}}catch(e){if(epoch===checkEpoch){if(!force&&e.forceRequired)show($('#force-antigravity'));$('#control-feedback').textContent=e.message;fail(e)}}finally{if(epoch===checkEpoch){checkBusy=false;checkControls()}}
662
743
  }
663
744
  $('#open-antigravity').onclick=()=>checkControl('launch');
664
745
  $('#restart-antigravity').onclick=()=>{if(checkBusy||!$('#check-panel').open)return;$('#restart-confirm').returnValue='cancel';$('#restart-confirm').showModal()};
@@ -668,7 +749,7 @@ $('#force-antigravity').onclick=()=>{if(checkBusy||$('#force-antigravity').hidde
668
749
  $('#force-confirm').addEventListener('close',()=>{if($('#force-confirm').returnValue==='confirm')restartIde(true)});
669
750
 
670
751
  // ─ Activity ─
671
- function renderActivity(){$('#activity-log').innerHTML=activity.length?activity.map(a=>`<li class="${a.err?'error':''}"><time>${a.at.toLocaleTimeString()}</time> ${esc(a.t)}</li>`).join(''):'<li class="muted">Belum ada aktivitas di sesi ini.</li>'}
752
+ function renderActivity(){$('#activity-log').innerHTML=activity.length?activity.map(a=>`<li class="${a.err?'error':''}"><time>${a.at.toLocaleTimeString()}</time> ${esc(a.t)}</li>`).join(''):'<li class="empty-state">Belum ada aktivitas di sesi ini.</li>'}
672
753
  $('#clear-activity').onclick=()=>{activity.length=0;renderActivity()};
673
754
 
674
755