tina4-nodejs 3.13.111 → 3.13.112

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.
@@ -32833,47 +32833,120 @@ function renderToolbarHtml(ctx) {
32833
32833
  const method = escapeHtml(ctx.method);
32834
32834
  const path8 = escapeHtml(ctx.path);
32835
32835
  const matchedPattern = escapeHtml(ctx.matchedPattern);
32836
- return `<div id="tina4-dev-toolbar" style="position:fixed;bottom:0;left:0;right:0;background:#333;color:#fff;font-family:monospace;font-size:12px;padding:6px 16px;z-index:99999;display:flex;align-items:center;gap:16px;">
32837
- <span id="tina4-ver-btn" style="color:#2e7d32;font-weight:bold;cursor:pointer;text-decoration:underline dotted;" onclick="tina4VersionModal()" title="Click to check for updates">Tina4 v${ctx.version}</span>
32838
- <div id="tina4-ver-modal" style="display:none;position:fixed;bottom:3rem;left:1rem;background:#1e1e2e;border:1px solid #2e7d32;border-radius:8px;padding:16px 20px;z-index:100000;min-width:320px;box-shadow:0 8px 32px rgba(0,0,0,0.5);font-family:monospace;font-size:13px;color:#cdd6f4;">
32839
- <div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;">
32840
- <strong style="color:#89b4fa;">Version Info</strong>
32841
- <span onclick="document.getElementById('tina4-ver-modal').style.display='none'" style="cursor:pointer;color:#888;">&times;</span>
32836
+ const reload = ctx.reload === false ? "0" : "1";
32837
+ return `<link rel="stylesheet" href="/__dev/toolbar.css">
32838
+ <div id="tina4-dev-toolbar" data-reload="${reload}">
32839
+ <span id="tina4-ver-btn" title="Click to check for updates">Tina4 v${ctx.version}</span>
32840
+ <div id="tina4-ver-modal">
32841
+ <div class="t4-modal-head">
32842
+ <strong class="t4-modal-title">Version Info</strong>
32843
+ <span id="tina4-ver-close" class="t4-x">&times;</span>
32842
32844
  </div>
32843
- <div id="tina4-ver-body" style="line-height:1.8;">
32844
- <div>Current: <strong style="color:#a6e3a1;">v${ctx.version}</strong></div>
32845
- <div id="tina4-ver-latest" style="color:#888;">Checking for updates...</div>
32845
+ <div id="tina4-ver-body">
32846
+ <div>Current: <strong class="t4-ok">v${ctx.version}</strong></div>
32847
+ <div id="tina4-ver-latest" class="t4-dim">Checking for updates...</div>
32846
32848
  </div>
32847
32849
  </div>
32848
- <span style="color:#4caf50;">${method}</span>
32850
+ <span class="t4-green">${method}</span>
32849
32851
  <span>${path8}</span>
32850
- <span style="color:#666;">&rarr; ${matchedPattern}</span>
32851
- <span style="color:#ffeb3b;">req:${ctx.requestId}</span>
32852
- <span style="color:#90caf9;">${ctx.routeCount} routes</span>
32853
- <span style="color:#888;">Node.js ${nodeVersion}</span>
32854
- <a href="#" onclick="window.__tina4ToggleOverlay(event)" style="color:#ef9a9a;margin-left:auto;text-decoration:none;cursor:pointer;">Dashboard &#8599;</a>
32855
- <span onclick="this.parentElement.style.display='none'" style="cursor:pointer;color:#888;margin-left:8px;">&#10005;</span>
32852
+ <span class="t4-arrow">&rarr; ${matchedPattern}</span>
32853
+ <span class="t4-yellow">req:${ctx.requestId}</span>
32854
+ <span class="t4-blue">${ctx.routeCount} routes</span>
32855
+ <span class="t4-dim">Node.js ${nodeVersion}</span>
32856
+ <a href="#" id="tina4-dash-link" class="t4-dash">Dashboard &#8599;</a>
32857
+ <span id="tina4-bar-close" class="t4-x t4-bar-close">&#10005;</span>
32856
32858
  </div>
32857
- <script>
32858
- // Overlay open/toggle helper + auto-restore. Persist the dev-admin
32859
- // iframe's open/closed state across parent reloads so saving a file
32860
- // doesn't lose the user's dev-admin context. Cross-framework parity
32861
- // with PHP / Python / Ruby \u2014 same localStorage key.
32862
- (function(){
32859
+ <script src="/__dev/toolbar.js"></script>`;
32860
+ }
32861
+ function toolbarCss() {
32862
+ return `#tina4-dev-toolbar{position:fixed;bottom:0;left:0;right:0;background:#333;color:#fff;font-family:monospace;font-size:12px;padding:6px 16px;z-index:99999;display:flex;align-items:center;gap:16px}
32863
+ #tina4-dev-toolbar a{text-decoration:none}
32864
+ #tina4-ver-btn{color:#2e7d32;font-weight:bold;cursor:pointer;text-decoration:underline dotted}
32865
+ #tina4-ver-modal{display:none;position:fixed;bottom:3rem;left:1rem;background:#1e1e2e;border:1px solid #2e7d32;border-radius:8px;padding:16px 20px;z-index:100000;min-width:320px;box-shadow:0 8px 32px rgba(0,0,0,.5);font-family:monospace;font-size:13px;color:#cdd6f4}
32866
+ .t4-modal-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}
32867
+ .t4-modal-title{color:#89b4fa}
32868
+ #tina4-ver-body{line-height:1.8}
32869
+ .t4-x{cursor:pointer;color:#888}
32870
+ .t4-bar-close{margin-left:8px}
32871
+ .t4-green{color:#4caf50}
32872
+ .t4-dim{color:#888}
32873
+ .t4-arrow{color:#666}
32874
+ .t4-yellow{color:#ffeb3b}
32875
+ .t4-blue{color:#90caf9}
32876
+ .t4-ok{color:#a6e3a1}
32877
+ .t4-warn{color:#f9e2af}
32878
+ .t4-err{color:#f38ba8}
32879
+ .t4-purple{color:#cba6f7}
32880
+ .t4-link{color:#89b4fa}
32881
+ .t4-code{background:#313244;padding:2px 6px;border-radius:3px}
32882
+ .t4-note{margin-top:6px}
32883
+ .t4-dash{color:#ef9a9a;margin-left:auto;cursor:pointer}
32884
+ #tina4-dev-panel{position:fixed;top:3rem;left:0;right:0;bottom:2rem;z-index:99998;transition:all .2s}
32885
+ #tina4-dev-panel iframe{width:100%;height:100%;border:1px solid #2e7d32;border-radius:.5rem;box-shadow:0 8px 32px rgba(0,0,0,.5);background:#0f172a}`;
32886
+ }
32887
+ function toolbarJs() {
32888
+ return `(function () {
32889
+ var bar = document.getElementById('tina4-dev-toolbar');
32890
+ if (!bar) { return; }
32891
+
32892
+ var modal = document.getElementById('tina4-ver-modal');
32893
+ function upToDate(el, latest) {
32894
+ el.className = 't4-ok';
32895
+ el.innerHTML = 'Latest: <strong class="t4-ok">v' + latest + '</strong> &mdash; You are up to date!';
32896
+ }
32897
+ function checkVersion() {
32898
+ if (modal.style.display === 'block') { modal.style.display = 'none'; return; }
32899
+ modal.style.display = 'block';
32900
+ var el = document.getElementById('tina4-ver-latest');
32901
+ el.className = 't4-dim';
32902
+ el.textContent = 'Checking for updates...';
32903
+ fetch('/__dev/api/version-check').then(function (r) { return r.json(); }).then(function (d) {
32904
+ var latest = d.latest, current = d.current;
32905
+ if (latest === current) { upToDate(el, latest); return; }
32906
+ var cP = current.split('.').map(Number), lP = latest.split('.').map(Number);
32907
+ var isNewer = false, i, c, l;
32908
+ for (i = 0; i < Math.max(cP.length, lP.length); i++) { c = cP[i] || 0; l = lP[i] || 0; if (l > c) { isNewer = true; break; } if (l < c) { break; } }
32909
+ var isAhead = false;
32910
+ if (!isNewer) { for (i = 0; i < Math.max(cP.length, lP.length); i++) { var c2 = cP[i] || 0, l2 = lP[i] || 0; if (c2 > l2) { isAhead = true; break; } if (c2 < l2) { break; } } }
32911
+ if (isNewer) {
32912
+ var breaking = (lP[0] !== cP[0] || lP[1] !== cP[1]);
32913
+ el.className = '';
32914
+ el.innerHTML = 'Latest: <strong class="t4-warn">v' + latest + '</strong>';
32915
+ if (breaking) {
32916
+ el.innerHTML += '<div class="t4-err t4-note">&#9888; Major/minor version change &mdash; check the <a href="https://github.com/tina4stack/tina4-nodejs/releases" target="_blank" class="t4-link">changelog</a> for breaking changes before upgrading.</div>';
32917
+ } else {
32918
+ el.innerHTML += '<div class="t4-warn t4-note">Patch update available. Run: <code class="t4-code">npm install tina4-nodejs@latest</code></div>';
32919
+ }
32920
+ } else if (isAhead) {
32921
+ el.className = 't4-purple';
32922
+ el.innerHTML = 'You are running <strong class="t4-purple">v' + current + '</strong> (ahead of npm <strong>v' + latest + '</strong> &mdash; not yet published).';
32923
+ } else {
32924
+ upToDate(el, latest);
32925
+ }
32926
+ }).catch(function () {
32927
+ el.className = 't4-err';
32928
+ el.textContent = 'Could not check for updates (offline?)';
32929
+ });
32930
+ }
32931
+ var verBtn = document.getElementById('tina4-ver-btn');
32932
+ if (verBtn) { verBtn.addEventListener('click', checkVersion); }
32933
+ var verClose = document.getElementById('tina4-ver-close');
32934
+ if (verClose) { verClose.addEventListener('click', function () { modal.style.display = 'none'; }); }
32935
+ var barClose = document.getElementById('tina4-bar-close');
32936
+ if (barClose) { barClose.addEventListener('click', function () { bar.style.display = 'none'; }); }
32937
+
32863
32938
  var STATE_KEY = 'tina4_dev_overlay_open';
32864
32939
  function buildOverlay() {
32865
32940
  var c = document.createElement('div');
32866
32941
  c.id = 'tina4-dev-panel';
32867
- c.style.cssText = 'position:fixed;top:3rem;left:0;right:0;bottom:2rem;z-index:99998;transition:all 0.2s';
32868
32942
  var f = document.createElement('iframe');
32869
32943
  f.src = '/__dev';
32870
- f.style.cssText = 'width:100%;height:100%;border:1px solid #2e7d32;border-radius:0.5rem;box-shadow:0 8px 32px rgba(0,0,0,0.5);background:#0f172a';
32871
32944
  c.appendChild(f);
32872
32945
  document.body.appendChild(c);
32873
32946
  return c;
32874
32947
  }
32875
- window.__tina4ToggleOverlay = function(e) {
32876
- if (e) e.preventDefault();
32948
+ function toggleOverlay(e) {
32949
+ if (e) { e.preventDefault(); }
32877
32950
  var p = document.getElementById('tina4-dev-panel');
32878
32951
  if (p) {
32879
32952
  var hide = p.style.display !== 'none';
@@ -32883,137 +32956,61 @@ function renderToolbarHtml(ctx) {
32883
32956
  }
32884
32957
  buildOverlay();
32885
32958
  try { localStorage.setItem(STATE_KEY, '1'); } catch (_) {}
32886
- };
32887
- function restoreIfOpen() {
32888
- try {
32889
- if (location.pathname.indexOf('/__dev') === 0) return;
32890
- if (localStorage.getItem(STATE_KEY) === '1' && !document.getElementById('tina4-dev-panel')) {
32891
- buildOverlay();
32892
- }
32893
- } catch (_) {}
32894
- }
32895
- if (document.readyState === 'loading') {
32896
- document.addEventListener('DOMContentLoaded', restoreIfOpen);
32897
- } else {
32898
- restoreIfOpen();
32899
32959
  }
32900
- })();
32901
- </script>
32902
- <script>
32903
- function tina4VersionModal(){
32904
- var m=document.getElementById('tina4-ver-modal');
32905
- if(m.style.display==='block'){m.style.display='none';return;}
32906
- m.style.display='block';
32907
- var el=document.getElementById('tina4-ver-latest');
32908
- el.innerHTML='Checking for updates...';
32909
- el.style.color='#888';
32910
- fetch('/__dev/api/version-check')
32911
- .then(function(r){return r.json()})
32912
- .then(function(d){
32913
- var latest=d.latest;
32914
- var current=d.current;
32915
- if(latest===current){
32916
- el.innerHTML='Latest: <strong style="color:#a6e3a1;">v'+latest+'</strong> &mdash; You are up to date!';
32917
- el.style.color='#a6e3a1';
32918
- }else{
32919
- var cParts=current.split('.').map(Number);
32920
- var lParts=latest.split('.').map(Number);
32921
- var isNewer=false;
32922
- for(var i=0;i<Math.max(cParts.length,lParts.length);i++){
32923
- var c=cParts[i]||0,l=lParts[i]||0;
32924
- if(l>c){isNewer=true;break;}
32925
- if(l<c)break;
32926
- }
32927
- var isAhead=false;
32928
- if(!isNewer){for(var i=0;i<Math.max(cParts.length,lParts.length);i++){var c2=cParts[i]||0,l2=lParts[i]||0;if(c2>l2){isAhead=true;break;}if(c2<l2)break;}}
32929
- if(isNewer){
32930
- var breaking=(lParts[0]!==cParts[0]||lParts[1]!==cParts[1]);
32931
- el.innerHTML='Latest: <strong style="color:#f9e2af;">v'+latest+'</strong>';
32932
- if(breaking){
32933
- el.innerHTML+='<div style="color:#f38ba8;margin-top:6px;">&#9888; Major/minor version change &mdash; check the <a href="https://github.com/tina4stack/tina4-nodejs/releases" target="_blank" style="color:#89b4fa;">changelog</a> for breaking changes before upgrading.</div>';
32934
- }else{
32935
- el.innerHTML+='<div style="color:#f9e2af;margin-top:6px;">Patch update available. Run: <code style="background:#313244;padding:2px 6px;border-radius:3px;">npm install tina4-nodejs@latest</code></div>';
32936
- }
32937
- }else if(isAhead){
32938
- el.innerHTML='You are running <strong style="color:#cba6f7;">v'+current+'</strong> (ahead of npm <strong>v'+latest+'</strong> &mdash; not yet published).';
32939
- el.style.color='#cba6f7';
32940
- }else{
32941
- el.innerHTML='Latest: <strong style="color:#a6e3a1;">v'+latest+'</strong> &mdash; You are up to date!';
32942
- el.style.color='#a6e3a1';
32943
- }
32944
- }
32945
- })
32946
- .catch(function(){
32947
- el.innerHTML='Could not check for updates (offline?)';
32948
- el.style.color='#f38ba8';
32949
- });
32950
- }
32951
- </script>
32952
- <script>
32953
- (function(){
32954
- // WebSocket-primary dev reloader. The running server re-imports changed
32955
- // src/ routes in-process and pushes a {type,file,mtime} message over
32956
- // /__dev_reload \u2014 no respawn, instant refresh. The mtime poll below is a
32957
- // FALLBACK only, started when the socket is down and stopped on connect.
32958
- var _t4_css_exts=['.css','.scss'],_t4_debounce=null;
32959
- var _t4_interval=3000;
32960
- var _t4_ws=null,_t4_poll_timer=null,_t4_mtime=null;
32961
- function _t4_apply(d){
32962
- d=d||{};
32963
- var f=d.file||'',t=d.type||'';
32964
- var isCss=t==='css'||_t4_css_exts.some(function(e){return f.endsWith(e)});
32965
- if(isCss){
32966
- var links=document.querySelectorAll('link[rel="stylesheet"]');
32967
- links.forEach(function(l){
32968
- var href=l.getAttribute('href');
32969
- if(href){l.setAttribute('href',href.split('?')[0]+'?_t4='+(d.mtime||Date.now()))}
32960
+ var dash = document.getElementById('tina4-dash-link');
32961
+ if (dash) { dash.addEventListener('click', toggleOverlay); }
32962
+ try {
32963
+ if (location.pathname.indexOf('/__dev') !== 0
32964
+ && localStorage.getItem(STATE_KEY) === '1'
32965
+ && !document.getElementById('tina4-dev-panel')) {
32966
+ buildOverlay();
32967
+ }
32968
+ } catch (_) {}
32969
+
32970
+ if (bar.getAttribute('data-reload') !== '1') { return; }
32971
+ var cssExts = ['.css', '.scss'], debounce = null, interval = 3000;
32972
+ var ws = null, pollTimer = null, mtime = null;
32973
+ function apply(d) {
32974
+ d = d || {};
32975
+ var f = d.file || '', t = d.type || '';
32976
+ var isCss = t === 'css' || cssExts.some(function (e) { return f.endsWith(e); });
32977
+ if (isCss) {
32978
+ document.querySelectorAll('link[rel="stylesheet"]').forEach(function (l) {
32979
+ var href = l.getAttribute('href');
32980
+ if (href) { l.setAttribute('href', href.split('?')[0] + '?_t4=' + (d.mtime || Date.now())); }
32970
32981
  });
32971
- }else{
32982
+ } else {
32972
32983
  location.reload();
32973
32984
  }
32974
32985
  }
32975
- function _t4_poll(){
32976
- fetch('/__dev/api/mtime').then(function(r){return r.json()}).then(function(d){
32977
- // Sentinel: first poll only records the baseline. Use !== (not >) so
32978
- // the first change after load is not swallowed and a counter reset on
32979
- // server restart still triggers a reload.
32980
- if(_t4_mtime===null){_t4_mtime=d.mtime;return;}
32981
- if(d.mtime!==_t4_mtime){
32982
- _t4_mtime=d.mtime;
32983
- if(_t4_debounce)clearTimeout(_t4_debounce);
32984
- _t4_debounce=setTimeout(function(){_t4_apply(d);},500);
32985
- }
32986
- }).catch(function(){});
32987
- }
32988
- function _t4_startPoll(){
32989
- if(_t4_poll_timer)return;
32990
- _t4_mtime=null;
32991
- _t4_poll_timer=setInterval(_t4_poll,_t4_interval);
32992
- }
32993
- function _t4_stopPoll(){
32994
- if(_t4_poll_timer){clearInterval(_t4_poll_timer);_t4_poll_timer=null;}
32995
- }
32996
- function _t4_connect(){
32997
- var url=(location.protocol==='https:'?'wss':'ws')+'://'+location.host+'/__dev_reload';
32998
- try{_t4_ws=new WebSocket(url);}catch(_){_t4_startPoll();return;}
32999
- _t4_ws.addEventListener('open',function(){_t4_stopPoll();});
33000
- _t4_ws.addEventListener('message',function(ev){
33001
- var d=null;
33002
- try{d=typeof ev.data==='string'?JSON.parse(ev.data):null;}catch(_){}
33003
- if(!d)return;
33004
- if(d.type==='reload'||d.type==='change'||d.type==='css'){
33005
- if(_t4_debounce)clearTimeout(_t4_debounce);
33006
- _t4_debounce=setTimeout(function(){_t4_apply(d);},150);
32986
+ function poll() {
32987
+ fetch('/__dev/api/mtime').then(function (r) { return r.json(); }).then(function (d) {
32988
+ if (mtime === null) { mtime = d.mtime; return; }
32989
+ if (d.mtime !== mtime) { mtime = d.mtime; if (debounce) { clearTimeout(debounce); } debounce = setTimeout(function () { apply(d); }, 500); }
32990
+ }).catch(function () {});
32991
+ }
32992
+ function startPoll() { if (pollTimer) { return; } mtime = null; pollTimer = setInterval(poll, interval); }
32993
+ function stopPoll() { if (pollTimer) { clearInterval(pollTimer); pollTimer = null; } }
32994
+ function connect() {
32995
+ var url = (location.protocol === 'https:' ? 'wss' : 'ws') + '://' + location.host + '/__dev_reload';
32996
+ try { ws = new WebSocket(url); } catch (_) { startPoll(); return; }
32997
+ ws.addEventListener('open', function () { stopPoll(); });
32998
+ ws.addEventListener('message', function (ev) {
32999
+ var d = null;
33000
+ try { d = typeof ev.data === 'string' ? JSON.parse(ev.data) : null; } catch (_) {}
33001
+ if (!d) { return; }
33002
+ if (d.type === 'reload' || d.type === 'change' || d.type === 'css') {
33003
+ if (debounce) { clearTimeout(debounce); }
33004
+ debounce = setTimeout(function () { apply(d); }, 150);
33007
33005
  }
33008
33006
  });
33009
- _t4_ws.addEventListener('close',function(){_t4_ws=null;_t4_startPoll();setTimeout(_t4_connect,2000);});
33010
- _t4_ws.addEventListener('error',function(){try{_t4_ws&&_t4_ws.close();}catch(_){}});
33007
+ ws.addEventListener('close', function () { ws = null; startPoll(); setTimeout(connect, 2000); });
33008
+ ws.addEventListener('error', function () { try { ws && ws.close(); } catch (_) {} });
33011
33009
  }
33012
- _t4_connect();
33013
- })();
33014
- </script>`;
33010
+ connect();
33011
+ })();`;
33015
33012
  }
33016
- var cpuCount, DEV_SAFE_METHODS, DEV_MCP_PREFIXES, DEV_SECRET_BASENAMES, DEV_SECRET_SUFFIXES, MessageLog, RequestInspector, ErrorTracker, DevMailboxStore, DevQueue, WsTracker, DevAdmin, handleDashboard, _reloadMtime, _reloadFile, handleMtime, handleReload, handleMessages, handleMessagesClear, handleRequests, handleRequestsClear, handleSystem, handleMessagesSearch, handleQueue, handleQueueTopics, handleQueueDeadLetters, handleQueueRetry, handleQueuePurge, handleQueueReplay, handleMailbox, handleMailboxRead, handleMailboxSeed, handleMailboxClear, handleTable, handleTables, handleSeed, handleQuery, handleBroken, handleBrokenResolve, handleBrokenClear, handleWebsockets, handleWebsocketsDisconnect, handleTool, handleChat, DEFAULT_MCP_URL, handleGroundingStatus, handleGroundingToken, handleMigrate, handleSeedRun, handleTest, handleThreads, handleThreadsSub, handleConnections, handleConnectionsTest, handleConnectionsSave, __devAdminFilename, __devAdminDirname, handleGalleryList, handleVersionCheck, handleThoughts, handleSuperviseStub, handleExecute, DEV_FILES_IGNORED, handleFiles, DEV_ADMIN_LANG_MAP, handleFileRead, handleFileSave, handleFileRaw, handleFileRename, handleFileDelete, handleDepsSearch, handleDepsInstall, handleGitStatus, handleMcpTools, handleMcpCall, handleMcpStreamable, handleMcpDelete, handleMcpGet405, handleMcpLegacyMessage, handleMcpSse, handleScaffoldList, handleScaffoldRun, handlePlanCurrent, handlePlanList, handlePlanCreate, handlePlanSwitch, handlePlanCompleteStep, handlePlanAddStep, handlePlanNote, handlePlanArchive, handlePlanRead, handlePlanFlesh, handleIndexRebuild, handleIndexSearch, handleIndexFile, handleIndexOverview, handleDocsSearch, handleDocsClass, handleDocsMethod, handleDocsIndex, handleDocsWellKnown, handleDevAdminJs;
33013
+ var cpuCount, DEV_SAFE_METHODS, DEV_MCP_PREFIXES, DEV_SECRET_BASENAMES, DEV_SECRET_SUFFIXES, MessageLog, RequestInspector, ErrorTracker, DevMailboxStore, DevQueue, WsTracker, DevAdmin, handleDashboard, _reloadMtime, _reloadFile, handleMtime, handleReload, handleMessages, handleMessagesClear, handleRequests, handleRequestsClear, handleSystem, handleMessagesSearch, handleQueue, handleQueueTopics, handleQueueDeadLetters, handleQueueRetry, handleQueuePurge, handleQueueReplay, handleMailbox, handleMailboxRead, handleMailboxSeed, handleMailboxClear, handleTable, handleTables, handleSeed, handleQuery, handleBroken, handleBrokenResolve, handleBrokenClear, handleWebsockets, handleWebsocketsDisconnect, handleTool, handleChat, DEFAULT_MCP_URL, handleGroundingStatus, handleGroundingToken, handleMigrate, handleSeedRun, handleTest, handleThreads, handleThreadsSub, handleConnections, handleConnectionsTest, handleConnectionsSave, __devAdminFilename, __devAdminDirname, handleGalleryList, handleVersionCheck, handleThoughts, handleSuperviseStub, handleExecute, DEV_FILES_IGNORED, handleFiles, DEV_ADMIN_LANG_MAP, handleFileRead, handleFileSave, handleFileRaw, handleFileRename, handleFileDelete, handleDepsSearch, handleDepsInstall, handleGitStatus, handleMcpTools, handleMcpCall, handleMcpStreamable, handleMcpDelete, handleMcpGet405, handleMcpLegacyMessage, handleMcpSse, handleScaffoldList, handleScaffoldRun, handlePlanCurrent, handlePlanList, handlePlanCreate, handlePlanSwitch, handlePlanCompleteStep, handlePlanAddStep, handlePlanNote, handlePlanArchive, handlePlanRead, handlePlanFlesh, handleIndexRebuild, handleIndexSearch, handleIndexFile, handleIndexOverview, handleDocsSearch, handleDocsClass, handleDocsMethod, handleDocsIndex, handleDocsWellKnown, handleDevAdminJs, handleToolbarCss, handleToolbarJs;
33017
33014
  var init_devAdmin = __esm({
33018
33015
  "src/devAdmin.ts"() {
33019
33016
  "use strict";
@@ -33479,7 +33476,12 @@ var init_devAdmin = __esm({
33479
33476
  { method: "GET", pattern: "/__dev/api/docs/index", handler: handleDocsIndex },
33480
33477
  { method: "GET", pattern: "/__dev/api/docs/.well-known.json", handler: handleDocsWellKnown },
33481
33478
  // JS asset
33482
- { method: "GET", pattern: "/__dev/js/tina4-dev-admin.min.js", handler: handleDevAdminJs }
33479
+ { method: "GET", pattern: "/__dev/js/tina4-dev-admin.min.js", handler: handleDevAdminJs },
33480
+ // Dev-toolbar assets — served as external CSS/JS so the injected toolbar is
33481
+ // CSP-clean (no inline style=, onclick=, or <script>) under a strict
33482
+ // `default-src 'self'`. Parity with PHP's /__dev/toolbar.css + toolbar.js.
33483
+ { method: "GET", pattern: "/__dev/toolbar.css", handler: handleToolbarCss },
33484
+ { method: "GET", pattern: "/__dev/toolbar.js", handler: handleToolbarJs }
33483
33485
  ];
33484
33486
  for (const route of routes) {
33485
33487
  router.addRoute({
@@ -34915,6 +34917,14 @@ var init_devAdmin = __esm({
34915
34917
  res.raw.writeHead(404, { "Content-Type": "text/plain" });
34916
34918
  res.raw.end("tina4-dev-admin.min.js not found");
34917
34919
  };
34920
+ handleToolbarCss = (_req, res) => {
34921
+ res.raw.writeHead(200, { "Content-Type": "text/css; charset=utf-8", "Cache-Control": "no-cache" });
34922
+ res.raw.end(toolbarCss());
34923
+ };
34924
+ handleToolbarJs = (_req, res) => {
34925
+ res.raw.writeHead(200, { "Content-Type": "application/javascript; charset=utf-8", "Cache-Control": "no-cache" });
34926
+ res.raw.end(toolbarJs());
34927
+ };
34918
34928
  }
34919
34929
  });
34920
34930
 
@@ -36776,7 +36786,11 @@ function injectIntoHtml(ctx, devToolbar, html) {
36776
36786
  path: ctx.pathname,
36777
36787
  matchedPattern: ctx.matchedPattern.value || ctx.pathname,
36778
36788
  requestId: ctx.requestId,
36779
- routeCount: ctx.router.getRoutes().length
36789
+ routeCount: ctx.router.getRoutes().length,
36790
+ // Suppress the live reloader on the AI/stable port (data-reload="0"); the
36791
+ // toolbar JS early-returns when data-reload !== "1". Mirrors PHP's
36792
+ // suppressReload flag.
36793
+ reload: !ctx.isAiPortRequest
36780
36794
  };
36781
36795
  return injectFeedbackWidget(ctx.req, injectDevToolbar(html, toolbarCtx));
36782
36796
  }