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.
- package/CLAUDE.md +2 -2
- package/package.json +1 -1
- package/packages/cli/dist/bin.js +164 -150
- package/packages/core/dist/index.js +164 -150
- package/packages/core/src/devAdmin.ts +181 -145
- package/packages/core/src/server.ts +6 -0
- package/packages/orm/dist/index.js +164 -150
- package/types/core/src/devAdmin.d.ts +1 -0
package/CLAUDE.md
CHANGED
|
@@ -13,13 +13,13 @@ Even if the skill text is not currently loaded, these are non-negotiable:
|
|
|
13
13
|
|
|
14
14
|
The full discipline lives in `.claude/skills/tina4-maintainer/SKILL.md`; this block is the always-on floor.
|
|
15
15
|
|
|
16
|
-
# CLAUDE.md - AI Developer Guide for tina4-nodejs (v3.13.
|
|
16
|
+
# CLAUDE.md - AI Developer Guide for tina4-nodejs (v3.13.112)
|
|
17
17
|
|
|
18
18
|
> This file helps AI assistants (Claude, Copilot, Cursor, etc.) understand and work on this codebase effectively.
|
|
19
19
|
|
|
20
20
|
## What This Project Is
|
|
21
21
|
|
|
22
|
-
Tina4 for Node.js/TypeScript v3.13.
|
|
22
|
+
Tina4 for Node.js/TypeScript v3.13.112 - The Intelligent Native Application 4ramework. A convention-over-configuration structural paradigm. The developer writes TypeScript; Tina4 is invisible infrastructure.
|
|
23
23
|
|
|
24
24
|
The philosophy: zero ceremony, batteries included, file system as source of truth.
|
|
25
25
|
|
package/package.json
CHANGED
package/packages/cli/dist/bin.js
CHANGED
|
@@ -32854,47 +32854,120 @@ function renderToolbarHtml(ctx) {
|
|
|
32854
32854
|
const method = escapeHtml(ctx.method);
|
|
32855
32855
|
const path8 = escapeHtml(ctx.path);
|
|
32856
32856
|
const matchedPattern = escapeHtml(ctx.matchedPattern);
|
|
32857
|
-
|
|
32858
|
-
|
|
32859
|
-
|
|
32860
|
-
|
|
32861
|
-
|
|
32862
|
-
|
|
32857
|
+
const reload = ctx.reload === false ? "0" : "1";
|
|
32858
|
+
return `<link rel="stylesheet" href="/__dev/toolbar.css">
|
|
32859
|
+
<div id="tina4-dev-toolbar" data-reload="${reload}">
|
|
32860
|
+
<span id="tina4-ver-btn" title="Click to check for updates">Tina4 v${ctx.version}</span>
|
|
32861
|
+
<div id="tina4-ver-modal">
|
|
32862
|
+
<div class="t4-modal-head">
|
|
32863
|
+
<strong class="t4-modal-title">Version Info</strong>
|
|
32864
|
+
<span id="tina4-ver-close" class="t4-x">×</span>
|
|
32863
32865
|
</div>
|
|
32864
|
-
<div id="tina4-ver-body"
|
|
32865
|
-
<div>Current: <strong
|
|
32866
|
-
<div id="tina4-ver-latest"
|
|
32866
|
+
<div id="tina4-ver-body">
|
|
32867
|
+
<div>Current: <strong class="t4-ok">v${ctx.version}</strong></div>
|
|
32868
|
+
<div id="tina4-ver-latest" class="t4-dim">Checking for updates...</div>
|
|
32867
32869
|
</div>
|
|
32868
32870
|
</div>
|
|
32869
|
-
<span
|
|
32871
|
+
<span class="t4-green">${method}</span>
|
|
32870
32872
|
<span>${path8}</span>
|
|
32871
|
-
<span
|
|
32872
|
-
<span
|
|
32873
|
-
<span
|
|
32874
|
-
<span
|
|
32875
|
-
<a href="#"
|
|
32876
|
-
<span
|
|
32873
|
+
<span class="t4-arrow">→ ${matchedPattern}</span>
|
|
32874
|
+
<span class="t4-yellow">req:${ctx.requestId}</span>
|
|
32875
|
+
<span class="t4-blue">${ctx.routeCount} routes</span>
|
|
32876
|
+
<span class="t4-dim">Node.js ${nodeVersion}</span>
|
|
32877
|
+
<a href="#" id="tina4-dash-link" class="t4-dash">Dashboard ↗</a>
|
|
32878
|
+
<span id="tina4-bar-close" class="t4-x t4-bar-close">✕</span>
|
|
32877
32879
|
</div>
|
|
32878
|
-
<script
|
|
32879
|
-
|
|
32880
|
-
|
|
32881
|
-
|
|
32882
|
-
|
|
32883
|
-
|
|
32880
|
+
<script src="/__dev/toolbar.js"></script>`;
|
|
32881
|
+
}
|
|
32882
|
+
function toolbarCss() {
|
|
32883
|
+
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}
|
|
32884
|
+
#tina4-dev-toolbar a{text-decoration:none}
|
|
32885
|
+
#tina4-ver-btn{color:#2e7d32;font-weight:bold;cursor:pointer;text-decoration:underline dotted}
|
|
32886
|
+
#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}
|
|
32887
|
+
.t4-modal-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}
|
|
32888
|
+
.t4-modal-title{color:#89b4fa}
|
|
32889
|
+
#tina4-ver-body{line-height:1.8}
|
|
32890
|
+
.t4-x{cursor:pointer;color:#888}
|
|
32891
|
+
.t4-bar-close{margin-left:8px}
|
|
32892
|
+
.t4-green{color:#4caf50}
|
|
32893
|
+
.t4-dim{color:#888}
|
|
32894
|
+
.t4-arrow{color:#666}
|
|
32895
|
+
.t4-yellow{color:#ffeb3b}
|
|
32896
|
+
.t4-blue{color:#90caf9}
|
|
32897
|
+
.t4-ok{color:#a6e3a1}
|
|
32898
|
+
.t4-warn{color:#f9e2af}
|
|
32899
|
+
.t4-err{color:#f38ba8}
|
|
32900
|
+
.t4-purple{color:#cba6f7}
|
|
32901
|
+
.t4-link{color:#89b4fa}
|
|
32902
|
+
.t4-code{background:#313244;padding:2px 6px;border-radius:3px}
|
|
32903
|
+
.t4-note{margin-top:6px}
|
|
32904
|
+
.t4-dash{color:#ef9a9a;margin-left:auto;cursor:pointer}
|
|
32905
|
+
#tina4-dev-panel{position:fixed;top:3rem;left:0;right:0;bottom:2rem;z-index:99998;transition:all .2s}
|
|
32906
|
+
#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}`;
|
|
32907
|
+
}
|
|
32908
|
+
function toolbarJs() {
|
|
32909
|
+
return `(function () {
|
|
32910
|
+
var bar = document.getElementById('tina4-dev-toolbar');
|
|
32911
|
+
if (!bar) { return; }
|
|
32912
|
+
|
|
32913
|
+
var modal = document.getElementById('tina4-ver-modal');
|
|
32914
|
+
function upToDate(el, latest) {
|
|
32915
|
+
el.className = 't4-ok';
|
|
32916
|
+
el.innerHTML = 'Latest: <strong class="t4-ok">v' + latest + '</strong> — You are up to date!';
|
|
32917
|
+
}
|
|
32918
|
+
function checkVersion() {
|
|
32919
|
+
if (modal.style.display === 'block') { modal.style.display = 'none'; return; }
|
|
32920
|
+
modal.style.display = 'block';
|
|
32921
|
+
var el = document.getElementById('tina4-ver-latest');
|
|
32922
|
+
el.className = 't4-dim';
|
|
32923
|
+
el.textContent = 'Checking for updates...';
|
|
32924
|
+
fetch('/__dev/api/version-check').then(function (r) { return r.json(); }).then(function (d) {
|
|
32925
|
+
var latest = d.latest, current = d.current;
|
|
32926
|
+
if (latest === current) { upToDate(el, latest); return; }
|
|
32927
|
+
var cP = current.split('.').map(Number), lP = latest.split('.').map(Number);
|
|
32928
|
+
var isNewer = false, i, c, l;
|
|
32929
|
+
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; } }
|
|
32930
|
+
var isAhead = false;
|
|
32931
|
+
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; } } }
|
|
32932
|
+
if (isNewer) {
|
|
32933
|
+
var breaking = (lP[0] !== cP[0] || lP[1] !== cP[1]);
|
|
32934
|
+
el.className = '';
|
|
32935
|
+
el.innerHTML = 'Latest: <strong class="t4-warn">v' + latest + '</strong>';
|
|
32936
|
+
if (breaking) {
|
|
32937
|
+
el.innerHTML += '<div class="t4-err t4-note">⚠ Major/minor version change — check the <a href="https://github.com/tina4stack/tina4-nodejs/releases" target="_blank" class="t4-link">changelog</a> for breaking changes before upgrading.</div>';
|
|
32938
|
+
} else {
|
|
32939
|
+
el.innerHTML += '<div class="t4-warn t4-note">Patch update available. Run: <code class="t4-code">npm install tina4-nodejs@latest</code></div>';
|
|
32940
|
+
}
|
|
32941
|
+
} else if (isAhead) {
|
|
32942
|
+
el.className = 't4-purple';
|
|
32943
|
+
el.innerHTML = 'You are running <strong class="t4-purple">v' + current + '</strong> (ahead of npm <strong>v' + latest + '</strong> — not yet published).';
|
|
32944
|
+
} else {
|
|
32945
|
+
upToDate(el, latest);
|
|
32946
|
+
}
|
|
32947
|
+
}).catch(function () {
|
|
32948
|
+
el.className = 't4-err';
|
|
32949
|
+
el.textContent = 'Could not check for updates (offline?)';
|
|
32950
|
+
});
|
|
32951
|
+
}
|
|
32952
|
+
var verBtn = document.getElementById('tina4-ver-btn');
|
|
32953
|
+
if (verBtn) { verBtn.addEventListener('click', checkVersion); }
|
|
32954
|
+
var verClose = document.getElementById('tina4-ver-close');
|
|
32955
|
+
if (verClose) { verClose.addEventListener('click', function () { modal.style.display = 'none'; }); }
|
|
32956
|
+
var barClose = document.getElementById('tina4-bar-close');
|
|
32957
|
+
if (barClose) { barClose.addEventListener('click', function () { bar.style.display = 'none'; }); }
|
|
32958
|
+
|
|
32884
32959
|
var STATE_KEY = 'tina4_dev_overlay_open';
|
|
32885
32960
|
function buildOverlay() {
|
|
32886
32961
|
var c = document.createElement('div');
|
|
32887
32962
|
c.id = 'tina4-dev-panel';
|
|
32888
|
-
c.style.cssText = 'position:fixed;top:3rem;left:0;right:0;bottom:2rem;z-index:99998;transition:all 0.2s';
|
|
32889
32963
|
var f = document.createElement('iframe');
|
|
32890
32964
|
f.src = '/__dev';
|
|
32891
|
-
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';
|
|
32892
32965
|
c.appendChild(f);
|
|
32893
32966
|
document.body.appendChild(c);
|
|
32894
32967
|
return c;
|
|
32895
32968
|
}
|
|
32896
|
-
|
|
32897
|
-
if (e) e.preventDefault();
|
|
32969
|
+
function toggleOverlay(e) {
|
|
32970
|
+
if (e) { e.preventDefault(); }
|
|
32898
32971
|
var p = document.getElementById('tina4-dev-panel');
|
|
32899
32972
|
if (p) {
|
|
32900
32973
|
var hide = p.style.display !== 'none';
|
|
@@ -32904,137 +32977,61 @@ function renderToolbarHtml(ctx) {
|
|
|
32904
32977
|
}
|
|
32905
32978
|
buildOverlay();
|
|
32906
32979
|
try { localStorage.setItem(STATE_KEY, '1'); } catch (_) {}
|
|
32907
|
-
};
|
|
32908
|
-
function restoreIfOpen() {
|
|
32909
|
-
try {
|
|
32910
|
-
if (location.pathname.indexOf('/__dev') === 0) return;
|
|
32911
|
-
if (localStorage.getItem(STATE_KEY) === '1' && !document.getElementById('tina4-dev-panel')) {
|
|
32912
|
-
buildOverlay();
|
|
32913
|
-
}
|
|
32914
|
-
} catch (_) {}
|
|
32915
|
-
}
|
|
32916
|
-
if (document.readyState === 'loading') {
|
|
32917
|
-
document.addEventListener('DOMContentLoaded', restoreIfOpen);
|
|
32918
|
-
} else {
|
|
32919
|
-
restoreIfOpen();
|
|
32920
32980
|
}
|
|
32921
|
-
|
|
32922
|
-
|
|
32923
|
-
|
|
32924
|
-
|
|
32925
|
-
|
|
32926
|
-
|
|
32927
|
-
|
|
32928
|
-
|
|
32929
|
-
|
|
32930
|
-
|
|
32931
|
-
|
|
32932
|
-
.
|
|
32933
|
-
|
|
32934
|
-
|
|
32935
|
-
|
|
32936
|
-
|
|
32937
|
-
|
|
32938
|
-
|
|
32939
|
-
|
|
32940
|
-
|
|
32941
|
-
|
|
32942
|
-
var isNewer=false;
|
|
32943
|
-
for(var i=0;i<Math.max(cParts.length,lParts.length);i++){
|
|
32944
|
-
var c=cParts[i]||0,l=lParts[i]||0;
|
|
32945
|
-
if(l>c){isNewer=true;break;}
|
|
32946
|
-
if(l<c)break;
|
|
32947
|
-
}
|
|
32948
|
-
var isAhead=false;
|
|
32949
|
-
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;}}
|
|
32950
|
-
if(isNewer){
|
|
32951
|
-
var breaking=(lParts[0]!==cParts[0]||lParts[1]!==cParts[1]);
|
|
32952
|
-
el.innerHTML='Latest: <strong style="color:#f9e2af;">v'+latest+'</strong>';
|
|
32953
|
-
if(breaking){
|
|
32954
|
-
el.innerHTML+='<div style="color:#f38ba8;margin-top:6px;">⚠ Major/minor version change — check the <a href="https://github.com/tina4stack/tina4-nodejs/releases" target="_blank" style="color:#89b4fa;">changelog</a> for breaking changes before upgrading.</div>';
|
|
32955
|
-
}else{
|
|
32956
|
-
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>';
|
|
32957
|
-
}
|
|
32958
|
-
}else if(isAhead){
|
|
32959
|
-
el.innerHTML='You are running <strong style="color:#cba6f7;">v'+current+'</strong> (ahead of npm <strong>v'+latest+'</strong> — not yet published).';
|
|
32960
|
-
el.style.color='#cba6f7';
|
|
32961
|
-
}else{
|
|
32962
|
-
el.innerHTML='Latest: <strong style="color:#a6e3a1;">v'+latest+'</strong> — You are up to date!';
|
|
32963
|
-
el.style.color='#a6e3a1';
|
|
32964
|
-
}
|
|
32965
|
-
}
|
|
32966
|
-
})
|
|
32967
|
-
.catch(function(){
|
|
32968
|
-
el.innerHTML='Could not check for updates (offline?)';
|
|
32969
|
-
el.style.color='#f38ba8';
|
|
32970
|
-
});
|
|
32971
|
-
}
|
|
32972
|
-
</script>
|
|
32973
|
-
<script>
|
|
32974
|
-
(function(){
|
|
32975
|
-
// WebSocket-primary dev reloader. The running server re-imports changed
|
|
32976
|
-
// src/ routes in-process and pushes a {type,file,mtime} message over
|
|
32977
|
-
// /__dev_reload \u2014 no respawn, instant refresh. The mtime poll below is a
|
|
32978
|
-
// FALLBACK only, started when the socket is down and stopped on connect.
|
|
32979
|
-
var _t4_css_exts=['.css','.scss'],_t4_debounce=null;
|
|
32980
|
-
var _t4_interval=3000;
|
|
32981
|
-
var _t4_ws=null,_t4_poll_timer=null,_t4_mtime=null;
|
|
32982
|
-
function _t4_apply(d){
|
|
32983
|
-
d=d||{};
|
|
32984
|
-
var f=d.file||'',t=d.type||'';
|
|
32985
|
-
var isCss=t==='css'||_t4_css_exts.some(function(e){return f.endsWith(e)});
|
|
32986
|
-
if(isCss){
|
|
32987
|
-
var links=document.querySelectorAll('link[rel="stylesheet"]');
|
|
32988
|
-
links.forEach(function(l){
|
|
32989
|
-
var href=l.getAttribute('href');
|
|
32990
|
-
if(href){l.setAttribute('href',href.split('?')[0]+'?_t4='+(d.mtime||Date.now()))}
|
|
32981
|
+
var dash = document.getElementById('tina4-dash-link');
|
|
32982
|
+
if (dash) { dash.addEventListener('click', toggleOverlay); }
|
|
32983
|
+
try {
|
|
32984
|
+
if (location.pathname.indexOf('/__dev') !== 0
|
|
32985
|
+
&& localStorage.getItem(STATE_KEY) === '1'
|
|
32986
|
+
&& !document.getElementById('tina4-dev-panel')) {
|
|
32987
|
+
buildOverlay();
|
|
32988
|
+
}
|
|
32989
|
+
} catch (_) {}
|
|
32990
|
+
|
|
32991
|
+
if (bar.getAttribute('data-reload') !== '1') { return; }
|
|
32992
|
+
var cssExts = ['.css', '.scss'], debounce = null, interval = 3000;
|
|
32993
|
+
var ws = null, pollTimer = null, mtime = null;
|
|
32994
|
+
function apply(d) {
|
|
32995
|
+
d = d || {};
|
|
32996
|
+
var f = d.file || '', t = d.type || '';
|
|
32997
|
+
var isCss = t === 'css' || cssExts.some(function (e) { return f.endsWith(e); });
|
|
32998
|
+
if (isCss) {
|
|
32999
|
+
document.querySelectorAll('link[rel="stylesheet"]').forEach(function (l) {
|
|
33000
|
+
var href = l.getAttribute('href');
|
|
33001
|
+
if (href) { l.setAttribute('href', href.split('?')[0] + '?_t4=' + (d.mtime || Date.now())); }
|
|
32991
33002
|
});
|
|
32992
|
-
}else{
|
|
33003
|
+
} else {
|
|
32993
33004
|
location.reload();
|
|
32994
33005
|
}
|
|
32995
33006
|
}
|
|
32996
|
-
function
|
|
32997
|
-
fetch('/__dev/api/mtime').then(function(r){return r.json()}).then(function(d){
|
|
32998
|
-
|
|
32999
|
-
|
|
33000
|
-
|
|
33001
|
-
|
|
33002
|
-
|
|
33003
|
-
|
|
33004
|
-
|
|
33005
|
-
|
|
33006
|
-
|
|
33007
|
-
|
|
33008
|
-
|
|
33009
|
-
|
|
33010
|
-
|
|
33011
|
-
|
|
33012
|
-
|
|
33013
|
-
|
|
33014
|
-
|
|
33015
|
-
if(_t4_poll_timer){clearInterval(_t4_poll_timer);_t4_poll_timer=null;}
|
|
33016
|
-
}
|
|
33017
|
-
function _t4_connect(){
|
|
33018
|
-
var url=(location.protocol==='https:'?'wss':'ws')+'://'+location.host+'/__dev_reload';
|
|
33019
|
-
try{_t4_ws=new WebSocket(url);}catch(_){_t4_startPoll();return;}
|
|
33020
|
-
_t4_ws.addEventListener('open',function(){_t4_stopPoll();});
|
|
33021
|
-
_t4_ws.addEventListener('message',function(ev){
|
|
33022
|
-
var d=null;
|
|
33023
|
-
try{d=typeof ev.data==='string'?JSON.parse(ev.data):null;}catch(_){}
|
|
33024
|
-
if(!d)return;
|
|
33025
|
-
if(d.type==='reload'||d.type==='change'||d.type==='css'){
|
|
33026
|
-
if(_t4_debounce)clearTimeout(_t4_debounce);
|
|
33027
|
-
_t4_debounce=setTimeout(function(){_t4_apply(d);},150);
|
|
33007
|
+
function poll() {
|
|
33008
|
+
fetch('/__dev/api/mtime').then(function (r) { return r.json(); }).then(function (d) {
|
|
33009
|
+
if (mtime === null) { mtime = d.mtime; return; }
|
|
33010
|
+
if (d.mtime !== mtime) { mtime = d.mtime; if (debounce) { clearTimeout(debounce); } debounce = setTimeout(function () { apply(d); }, 500); }
|
|
33011
|
+
}).catch(function () {});
|
|
33012
|
+
}
|
|
33013
|
+
function startPoll() { if (pollTimer) { return; } mtime = null; pollTimer = setInterval(poll, interval); }
|
|
33014
|
+
function stopPoll() { if (pollTimer) { clearInterval(pollTimer); pollTimer = null; } }
|
|
33015
|
+
function connect() {
|
|
33016
|
+
var url = (location.protocol === 'https:' ? 'wss' : 'ws') + '://' + location.host + '/__dev_reload';
|
|
33017
|
+
try { ws = new WebSocket(url); } catch (_) { startPoll(); return; }
|
|
33018
|
+
ws.addEventListener('open', function () { stopPoll(); });
|
|
33019
|
+
ws.addEventListener('message', function (ev) {
|
|
33020
|
+
var d = null;
|
|
33021
|
+
try { d = typeof ev.data === 'string' ? JSON.parse(ev.data) : null; } catch (_) {}
|
|
33022
|
+
if (!d) { return; }
|
|
33023
|
+
if (d.type === 'reload' || d.type === 'change' || d.type === 'css') {
|
|
33024
|
+
if (debounce) { clearTimeout(debounce); }
|
|
33025
|
+
debounce = setTimeout(function () { apply(d); }, 150);
|
|
33028
33026
|
}
|
|
33029
33027
|
});
|
|
33030
|
-
|
|
33031
|
-
|
|
33028
|
+
ws.addEventListener('close', function () { ws = null; startPoll(); setTimeout(connect, 2000); });
|
|
33029
|
+
ws.addEventListener('error', function () { try { ws && ws.close(); } catch (_) {} });
|
|
33032
33030
|
}
|
|
33033
|
-
|
|
33034
|
-
})()
|
|
33035
|
-
</script>`;
|
|
33031
|
+
connect();
|
|
33032
|
+
})();`;
|
|
33036
33033
|
}
|
|
33037
|
-
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;
|
|
33034
|
+
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;
|
|
33038
33035
|
var init_devAdmin = __esm({
|
|
33039
33036
|
"../core/src/devAdmin.ts"() {
|
|
33040
33037
|
"use strict";
|
|
@@ -33500,7 +33497,12 @@ var init_devAdmin = __esm({
|
|
|
33500
33497
|
{ method: "GET", pattern: "/__dev/api/docs/index", handler: handleDocsIndex },
|
|
33501
33498
|
{ method: "GET", pattern: "/__dev/api/docs/.well-known.json", handler: handleDocsWellKnown },
|
|
33502
33499
|
// JS asset
|
|
33503
|
-
{ method: "GET", pattern: "/__dev/js/tina4-dev-admin.min.js", handler: handleDevAdminJs }
|
|
33500
|
+
{ method: "GET", pattern: "/__dev/js/tina4-dev-admin.min.js", handler: handleDevAdminJs },
|
|
33501
|
+
// Dev-toolbar assets — served as external CSS/JS so the injected toolbar is
|
|
33502
|
+
// CSP-clean (no inline style=, onclick=, or <script>) under a strict
|
|
33503
|
+
// `default-src 'self'`. Parity with PHP's /__dev/toolbar.css + toolbar.js.
|
|
33504
|
+
{ method: "GET", pattern: "/__dev/toolbar.css", handler: handleToolbarCss },
|
|
33505
|
+
{ method: "GET", pattern: "/__dev/toolbar.js", handler: handleToolbarJs }
|
|
33504
33506
|
];
|
|
33505
33507
|
for (const route of routes) {
|
|
33506
33508
|
router.addRoute({
|
|
@@ -34936,6 +34938,14 @@ var init_devAdmin = __esm({
|
|
|
34936
34938
|
res.raw.writeHead(404, { "Content-Type": "text/plain" });
|
|
34937
34939
|
res.raw.end("tina4-dev-admin.min.js not found");
|
|
34938
34940
|
};
|
|
34941
|
+
handleToolbarCss = (_req, res) => {
|
|
34942
|
+
res.raw.writeHead(200, { "Content-Type": "text/css; charset=utf-8", "Cache-Control": "no-cache" });
|
|
34943
|
+
res.raw.end(toolbarCss());
|
|
34944
|
+
};
|
|
34945
|
+
handleToolbarJs = (_req, res) => {
|
|
34946
|
+
res.raw.writeHead(200, { "Content-Type": "application/javascript; charset=utf-8", "Cache-Control": "no-cache" });
|
|
34947
|
+
res.raw.end(toolbarJs());
|
|
34948
|
+
};
|
|
34939
34949
|
}
|
|
34940
34950
|
});
|
|
34941
34951
|
|
|
@@ -36797,7 +36807,11 @@ function injectIntoHtml(ctx, devToolbar, html) {
|
|
|
36797
36807
|
path: ctx.pathname,
|
|
36798
36808
|
matchedPattern: ctx.matchedPattern.value || ctx.pathname,
|
|
36799
36809
|
requestId: ctx.requestId,
|
|
36800
|
-
routeCount: ctx.router.getRoutes().length
|
|
36810
|
+
routeCount: ctx.router.getRoutes().length,
|
|
36811
|
+
// Suppress the live reloader on the AI/stable port (data-reload="0"); the
|
|
36812
|
+
// toolbar JS early-returns when data-reload !== "1". Mirrors PHP's
|
|
36813
|
+
// suppressReload flag.
|
|
36814
|
+
reload: !ctx.isAiPortRequest
|
|
36801
36815
|
};
|
|
36802
36816
|
return injectFeedbackWidget(ctx.req, injectDevToolbar(html, toolbarCtx));
|
|
36803
36817
|
}
|