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.
@@ -21192,47 +21192,120 @@ function renderToolbarHtml(ctx) {
21192
21192
  const method = escapeHtml(ctx.method);
21193
21193
  const path8 = escapeHtml(ctx.path);
21194
21194
  const matchedPattern = escapeHtml(ctx.matchedPattern);
21195
- 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;">
21196
- <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>
21197
- <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;">
21198
- <div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;">
21199
- <strong style="color:#89b4fa;">Version Info</strong>
21200
- <span onclick="document.getElementById('tina4-ver-modal').style.display='none'" style="cursor:pointer;color:#888;">&times;</span>
21195
+ const reload = ctx.reload === false ? "0" : "1";
21196
+ return `<link rel="stylesheet" href="/__dev/toolbar.css">
21197
+ <div id="tina4-dev-toolbar" data-reload="${reload}">
21198
+ <span id="tina4-ver-btn" title="Click to check for updates">Tina4 v${ctx.version}</span>
21199
+ <div id="tina4-ver-modal">
21200
+ <div class="t4-modal-head">
21201
+ <strong class="t4-modal-title">Version Info</strong>
21202
+ <span id="tina4-ver-close" class="t4-x">&times;</span>
21201
21203
  </div>
21202
- <div id="tina4-ver-body" style="line-height:1.8;">
21203
- <div>Current: <strong style="color:#a6e3a1;">v${ctx.version}</strong></div>
21204
- <div id="tina4-ver-latest" style="color:#888;">Checking for updates...</div>
21204
+ <div id="tina4-ver-body">
21205
+ <div>Current: <strong class="t4-ok">v${ctx.version}</strong></div>
21206
+ <div id="tina4-ver-latest" class="t4-dim">Checking for updates...</div>
21205
21207
  </div>
21206
21208
  </div>
21207
- <span style="color:#4caf50;">${method}</span>
21209
+ <span class="t4-green">${method}</span>
21208
21210
  <span>${path8}</span>
21209
- <span style="color:#666;">&rarr; ${matchedPattern}</span>
21210
- <span style="color:#ffeb3b;">req:${ctx.requestId}</span>
21211
- <span style="color:#90caf9;">${ctx.routeCount} routes</span>
21212
- <span style="color:#888;">Node.js ${nodeVersion}</span>
21213
- <a href="#" onclick="window.__tina4ToggleOverlay(event)" style="color:#ef9a9a;margin-left:auto;text-decoration:none;cursor:pointer;">Dashboard &#8599;</a>
21214
- <span onclick="this.parentElement.style.display='none'" style="cursor:pointer;color:#888;margin-left:8px;">&#10005;</span>
21211
+ <span class="t4-arrow">&rarr; ${matchedPattern}</span>
21212
+ <span class="t4-yellow">req:${ctx.requestId}</span>
21213
+ <span class="t4-blue">${ctx.routeCount} routes</span>
21214
+ <span class="t4-dim">Node.js ${nodeVersion}</span>
21215
+ <a href="#" id="tina4-dash-link" class="t4-dash">Dashboard &#8599;</a>
21216
+ <span id="tina4-bar-close" class="t4-x t4-bar-close">&#10005;</span>
21215
21217
  </div>
21216
- <script>
21217
- // Overlay open/toggle helper + auto-restore. Persist the dev-admin
21218
- // iframe's open/closed state across parent reloads so saving a file
21219
- // doesn't lose the user's dev-admin context. Cross-framework parity
21220
- // with PHP / Python / Ruby \u2014 same localStorage key.
21221
- (function(){
21218
+ <script src="/__dev/toolbar.js"></script>`;
21219
+ }
21220
+ function toolbarCss() {
21221
+ 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}
21222
+ #tina4-dev-toolbar a{text-decoration:none}
21223
+ #tina4-ver-btn{color:#2e7d32;font-weight:bold;cursor:pointer;text-decoration:underline dotted}
21224
+ #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}
21225
+ .t4-modal-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}
21226
+ .t4-modal-title{color:#89b4fa}
21227
+ #tina4-ver-body{line-height:1.8}
21228
+ .t4-x{cursor:pointer;color:#888}
21229
+ .t4-bar-close{margin-left:8px}
21230
+ .t4-green{color:#4caf50}
21231
+ .t4-dim{color:#888}
21232
+ .t4-arrow{color:#666}
21233
+ .t4-yellow{color:#ffeb3b}
21234
+ .t4-blue{color:#90caf9}
21235
+ .t4-ok{color:#a6e3a1}
21236
+ .t4-warn{color:#f9e2af}
21237
+ .t4-err{color:#f38ba8}
21238
+ .t4-purple{color:#cba6f7}
21239
+ .t4-link{color:#89b4fa}
21240
+ .t4-code{background:#313244;padding:2px 6px;border-radius:3px}
21241
+ .t4-note{margin-top:6px}
21242
+ .t4-dash{color:#ef9a9a;margin-left:auto;cursor:pointer}
21243
+ #tina4-dev-panel{position:fixed;top:3rem;left:0;right:0;bottom:2rem;z-index:99998;transition:all .2s}
21244
+ #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}`;
21245
+ }
21246
+ function toolbarJs() {
21247
+ return `(function () {
21248
+ var bar = document.getElementById('tina4-dev-toolbar');
21249
+ if (!bar) { return; }
21250
+
21251
+ var modal = document.getElementById('tina4-ver-modal');
21252
+ function upToDate(el, latest) {
21253
+ el.className = 't4-ok';
21254
+ el.innerHTML = 'Latest: <strong class="t4-ok">v' + latest + '</strong> &mdash; You are up to date!';
21255
+ }
21256
+ function checkVersion() {
21257
+ if (modal.style.display === 'block') { modal.style.display = 'none'; return; }
21258
+ modal.style.display = 'block';
21259
+ var el = document.getElementById('tina4-ver-latest');
21260
+ el.className = 't4-dim';
21261
+ el.textContent = 'Checking for updates...';
21262
+ fetch('/__dev/api/version-check').then(function (r) { return r.json(); }).then(function (d) {
21263
+ var latest = d.latest, current = d.current;
21264
+ if (latest === current) { upToDate(el, latest); return; }
21265
+ var cP = current.split('.').map(Number), lP = latest.split('.').map(Number);
21266
+ var isNewer = false, i, c, l;
21267
+ 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; } }
21268
+ var isAhead = false;
21269
+ 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; } } }
21270
+ if (isNewer) {
21271
+ var breaking = (lP[0] !== cP[0] || lP[1] !== cP[1]);
21272
+ el.className = '';
21273
+ el.innerHTML = 'Latest: <strong class="t4-warn">v' + latest + '</strong>';
21274
+ if (breaking) {
21275
+ 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>';
21276
+ } else {
21277
+ el.innerHTML += '<div class="t4-warn t4-note">Patch update available. Run: <code class="t4-code">npm install tina4-nodejs@latest</code></div>';
21278
+ }
21279
+ } else if (isAhead) {
21280
+ el.className = 't4-purple';
21281
+ el.innerHTML = 'You are running <strong class="t4-purple">v' + current + '</strong> (ahead of npm <strong>v' + latest + '</strong> &mdash; not yet published).';
21282
+ } else {
21283
+ upToDate(el, latest);
21284
+ }
21285
+ }).catch(function () {
21286
+ el.className = 't4-err';
21287
+ el.textContent = 'Could not check for updates (offline?)';
21288
+ });
21289
+ }
21290
+ var verBtn = document.getElementById('tina4-ver-btn');
21291
+ if (verBtn) { verBtn.addEventListener('click', checkVersion); }
21292
+ var verClose = document.getElementById('tina4-ver-close');
21293
+ if (verClose) { verClose.addEventListener('click', function () { modal.style.display = 'none'; }); }
21294
+ var barClose = document.getElementById('tina4-bar-close');
21295
+ if (barClose) { barClose.addEventListener('click', function () { bar.style.display = 'none'; }); }
21296
+
21222
21297
  var STATE_KEY = 'tina4_dev_overlay_open';
21223
21298
  function buildOverlay() {
21224
21299
  var c = document.createElement('div');
21225
21300
  c.id = 'tina4-dev-panel';
21226
- c.style.cssText = 'position:fixed;top:3rem;left:0;right:0;bottom:2rem;z-index:99998;transition:all 0.2s';
21227
21301
  var f = document.createElement('iframe');
21228
21302
  f.src = '/__dev';
21229
- 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';
21230
21303
  c.appendChild(f);
21231
21304
  document.body.appendChild(c);
21232
21305
  return c;
21233
21306
  }
21234
- window.__tina4ToggleOverlay = function(e) {
21235
- if (e) e.preventDefault();
21307
+ function toggleOverlay(e) {
21308
+ if (e) { e.preventDefault(); }
21236
21309
  var p = document.getElementById('tina4-dev-panel');
21237
21310
  if (p) {
21238
21311
  var hide = p.style.display !== 'none';
@@ -21242,137 +21315,61 @@ function renderToolbarHtml(ctx) {
21242
21315
  }
21243
21316
  buildOverlay();
21244
21317
  try { localStorage.setItem(STATE_KEY, '1'); } catch (_) {}
21245
- };
21246
- function restoreIfOpen() {
21247
- try {
21248
- if (location.pathname.indexOf('/__dev') === 0) return;
21249
- if (localStorage.getItem(STATE_KEY) === '1' && !document.getElementById('tina4-dev-panel')) {
21250
- buildOverlay();
21251
- }
21252
- } catch (_) {}
21253
- }
21254
- if (document.readyState === 'loading') {
21255
- document.addEventListener('DOMContentLoaded', restoreIfOpen);
21256
- } else {
21257
- restoreIfOpen();
21258
21318
  }
21259
- })();
21260
- </script>
21261
- <script>
21262
- function tina4VersionModal(){
21263
- var m=document.getElementById('tina4-ver-modal');
21264
- if(m.style.display==='block'){m.style.display='none';return;}
21265
- m.style.display='block';
21266
- var el=document.getElementById('tina4-ver-latest');
21267
- el.innerHTML='Checking for updates...';
21268
- el.style.color='#888';
21269
- fetch('/__dev/api/version-check')
21270
- .then(function(r){return r.json()})
21271
- .then(function(d){
21272
- var latest=d.latest;
21273
- var current=d.current;
21274
- if(latest===current){
21275
- el.innerHTML='Latest: <strong style="color:#a6e3a1;">v'+latest+'</strong> &mdash; You are up to date!';
21276
- el.style.color='#a6e3a1';
21277
- }else{
21278
- var cParts=current.split('.').map(Number);
21279
- var lParts=latest.split('.').map(Number);
21280
- var isNewer=false;
21281
- for(var i=0;i<Math.max(cParts.length,lParts.length);i++){
21282
- var c=cParts[i]||0,l=lParts[i]||0;
21283
- if(l>c){isNewer=true;break;}
21284
- if(l<c)break;
21285
- }
21286
- var isAhead=false;
21287
- 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;}}
21288
- if(isNewer){
21289
- var breaking=(lParts[0]!==cParts[0]||lParts[1]!==cParts[1]);
21290
- el.innerHTML='Latest: <strong style="color:#f9e2af;">v'+latest+'</strong>';
21291
- if(breaking){
21292
- 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>';
21293
- }else{
21294
- 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>';
21295
- }
21296
- }else if(isAhead){
21297
- el.innerHTML='You are running <strong style="color:#cba6f7;">v'+current+'</strong> (ahead of npm <strong>v'+latest+'</strong> &mdash; not yet published).';
21298
- el.style.color='#cba6f7';
21299
- }else{
21300
- el.innerHTML='Latest: <strong style="color:#a6e3a1;">v'+latest+'</strong> &mdash; You are up to date!';
21301
- el.style.color='#a6e3a1';
21302
- }
21303
- }
21304
- })
21305
- .catch(function(){
21306
- el.innerHTML='Could not check for updates (offline?)';
21307
- el.style.color='#f38ba8';
21308
- });
21309
- }
21310
- </script>
21311
- <script>
21312
- (function(){
21313
- // WebSocket-primary dev reloader. The running server re-imports changed
21314
- // src/ routes in-process and pushes a {type,file,mtime} message over
21315
- // /__dev_reload \u2014 no respawn, instant refresh. The mtime poll below is a
21316
- // FALLBACK only, started when the socket is down and stopped on connect.
21317
- var _t4_css_exts=['.css','.scss'],_t4_debounce=null;
21318
- var _t4_interval=3000;
21319
- var _t4_ws=null,_t4_poll_timer=null,_t4_mtime=null;
21320
- function _t4_apply(d){
21321
- d=d||{};
21322
- var f=d.file||'',t=d.type||'';
21323
- var isCss=t==='css'||_t4_css_exts.some(function(e){return f.endsWith(e)});
21324
- if(isCss){
21325
- var links=document.querySelectorAll('link[rel="stylesheet"]');
21326
- links.forEach(function(l){
21327
- var href=l.getAttribute('href');
21328
- if(href){l.setAttribute('href',href.split('?')[0]+'?_t4='+(d.mtime||Date.now()))}
21319
+ var dash = document.getElementById('tina4-dash-link');
21320
+ if (dash) { dash.addEventListener('click', toggleOverlay); }
21321
+ try {
21322
+ if (location.pathname.indexOf('/__dev') !== 0
21323
+ && localStorage.getItem(STATE_KEY) === '1'
21324
+ && !document.getElementById('tina4-dev-panel')) {
21325
+ buildOverlay();
21326
+ }
21327
+ } catch (_) {}
21328
+
21329
+ if (bar.getAttribute('data-reload') !== '1') { return; }
21330
+ var cssExts = ['.css', '.scss'], debounce = null, interval = 3000;
21331
+ var ws = null, pollTimer = null, mtime = null;
21332
+ function apply(d) {
21333
+ d = d || {};
21334
+ var f = d.file || '', t = d.type || '';
21335
+ var isCss = t === 'css' || cssExts.some(function (e) { return f.endsWith(e); });
21336
+ if (isCss) {
21337
+ document.querySelectorAll('link[rel="stylesheet"]').forEach(function (l) {
21338
+ var href = l.getAttribute('href');
21339
+ if (href) { l.setAttribute('href', href.split('?')[0] + '?_t4=' + (d.mtime || Date.now())); }
21329
21340
  });
21330
- }else{
21341
+ } else {
21331
21342
  location.reload();
21332
21343
  }
21333
21344
  }
21334
- function _t4_poll(){
21335
- fetch('/__dev/api/mtime').then(function(r){return r.json()}).then(function(d){
21336
- // Sentinel: first poll only records the baseline. Use !== (not >) so
21337
- // the first change after load is not swallowed and a counter reset on
21338
- // server restart still triggers a reload.
21339
- if(_t4_mtime===null){_t4_mtime=d.mtime;return;}
21340
- if(d.mtime!==_t4_mtime){
21341
- _t4_mtime=d.mtime;
21342
- if(_t4_debounce)clearTimeout(_t4_debounce);
21343
- _t4_debounce=setTimeout(function(){_t4_apply(d);},500);
21344
- }
21345
- }).catch(function(){});
21346
- }
21347
- function _t4_startPoll(){
21348
- if(_t4_poll_timer)return;
21349
- _t4_mtime=null;
21350
- _t4_poll_timer=setInterval(_t4_poll,_t4_interval);
21351
- }
21352
- function _t4_stopPoll(){
21353
- if(_t4_poll_timer){clearInterval(_t4_poll_timer);_t4_poll_timer=null;}
21354
- }
21355
- function _t4_connect(){
21356
- var url=(location.protocol==='https:'?'wss':'ws')+'://'+location.host+'/__dev_reload';
21357
- try{_t4_ws=new WebSocket(url);}catch(_){_t4_startPoll();return;}
21358
- _t4_ws.addEventListener('open',function(){_t4_stopPoll();});
21359
- _t4_ws.addEventListener('message',function(ev){
21360
- var d=null;
21361
- try{d=typeof ev.data==='string'?JSON.parse(ev.data):null;}catch(_){}
21362
- if(!d)return;
21363
- if(d.type==='reload'||d.type==='change'||d.type==='css'){
21364
- if(_t4_debounce)clearTimeout(_t4_debounce);
21365
- _t4_debounce=setTimeout(function(){_t4_apply(d);},150);
21345
+ function poll() {
21346
+ fetch('/__dev/api/mtime').then(function (r) { return r.json(); }).then(function (d) {
21347
+ if (mtime === null) { mtime = d.mtime; return; }
21348
+ if (d.mtime !== mtime) { mtime = d.mtime; if (debounce) { clearTimeout(debounce); } debounce = setTimeout(function () { apply(d); }, 500); }
21349
+ }).catch(function () {});
21350
+ }
21351
+ function startPoll() { if (pollTimer) { return; } mtime = null; pollTimer = setInterval(poll, interval); }
21352
+ function stopPoll() { if (pollTimer) { clearInterval(pollTimer); pollTimer = null; } }
21353
+ function connect() {
21354
+ var url = (location.protocol === 'https:' ? 'wss' : 'ws') + '://' + location.host + '/__dev_reload';
21355
+ try { ws = new WebSocket(url); } catch (_) { startPoll(); return; }
21356
+ ws.addEventListener('open', function () { stopPoll(); });
21357
+ ws.addEventListener('message', function (ev) {
21358
+ var d = null;
21359
+ try { d = typeof ev.data === 'string' ? JSON.parse(ev.data) : null; } catch (_) {}
21360
+ if (!d) { return; }
21361
+ if (d.type === 'reload' || d.type === 'change' || d.type === 'css') {
21362
+ if (debounce) { clearTimeout(debounce); }
21363
+ debounce = setTimeout(function () { apply(d); }, 150);
21366
21364
  }
21367
21365
  });
21368
- _t4_ws.addEventListener('close',function(){_t4_ws=null;_t4_startPoll();setTimeout(_t4_connect,2000);});
21369
- _t4_ws.addEventListener('error',function(){try{_t4_ws&&_t4_ws.close();}catch(_){}});
21366
+ ws.addEventListener('close', function () { ws = null; startPoll(); setTimeout(connect, 2000); });
21367
+ ws.addEventListener('error', function () { try { ws && ws.close(); } catch (_) {} });
21370
21368
  }
21371
- _t4_connect();
21372
- })();
21373
- </script>`;
21369
+ connect();
21370
+ })();`;
21374
21371
  }
21375
- 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;
21372
+ 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;
21376
21373
  var init_devAdmin = __esm({
21377
21374
  "../core/src/devAdmin.ts"() {
21378
21375
  "use strict";
@@ -21838,7 +21835,12 @@ var init_devAdmin = __esm({
21838
21835
  { method: "GET", pattern: "/__dev/api/docs/index", handler: handleDocsIndex },
21839
21836
  { method: "GET", pattern: "/__dev/api/docs/.well-known.json", handler: handleDocsWellKnown },
21840
21837
  // JS asset
21841
- { method: "GET", pattern: "/__dev/js/tina4-dev-admin.min.js", handler: handleDevAdminJs }
21838
+ { method: "GET", pattern: "/__dev/js/tina4-dev-admin.min.js", handler: handleDevAdminJs },
21839
+ // Dev-toolbar assets — served as external CSS/JS so the injected toolbar is
21840
+ // CSP-clean (no inline style=, onclick=, or <script>) under a strict
21841
+ // `default-src 'self'`. Parity with PHP's /__dev/toolbar.css + toolbar.js.
21842
+ { method: "GET", pattern: "/__dev/toolbar.css", handler: handleToolbarCss },
21843
+ { method: "GET", pattern: "/__dev/toolbar.js", handler: handleToolbarJs }
21842
21844
  ];
21843
21845
  for (const route of routes) {
21844
21846
  router.addRoute({
@@ -23274,6 +23276,14 @@ var init_devAdmin = __esm({
23274
23276
  res.raw.writeHead(404, { "Content-Type": "text/plain" });
23275
23277
  res.raw.end("tina4-dev-admin.min.js not found");
23276
23278
  };
23279
+ handleToolbarCss = (_req, res) => {
23280
+ res.raw.writeHead(200, { "Content-Type": "text/css; charset=utf-8", "Cache-Control": "no-cache" });
23281
+ res.raw.end(toolbarCss());
23282
+ };
23283
+ handleToolbarJs = (_req, res) => {
23284
+ res.raw.writeHead(200, { "Content-Type": "application/javascript; charset=utf-8", "Cache-Control": "no-cache" });
23285
+ res.raw.end(toolbarJs());
23286
+ };
23277
23287
  }
23278
23288
  });
23279
23289
 
@@ -25135,7 +25145,11 @@ function injectIntoHtml(ctx, devToolbar, html) {
25135
25145
  path: ctx.pathname,
25136
25146
  matchedPattern: ctx.matchedPattern.value || ctx.pathname,
25137
25147
  requestId: ctx.requestId,
25138
- routeCount: ctx.router.getRoutes().length
25148
+ routeCount: ctx.router.getRoutes().length,
25149
+ // Suppress the live reloader on the AI/stable port (data-reload="0"); the
25150
+ // toolbar JS early-returns when data-reload !== "1". Mirrors PHP's
25151
+ // suppressReload flag.
25152
+ reload: !ctx.isAiPortRequest
25139
25153
  };
25140
25154
  return injectFeedbackWidget(ctx.req, injectDevToolbar(html, toolbarCtx));
25141
25155
  }
@@ -189,6 +189,7 @@ export declare class DevAdmin {
189
189
  matchedPattern: string;
190
190
  requestId: string;
191
191
  routeCount: number;
192
+ reload?: boolean;
192
193
  }): string;
193
194
  }
194
195
  /**