vibeoscore 1.0.2 → 1.0.9
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/client.js +1 -0
- package/client.ts +2 -0
- package/lib/logger.js +27 -0
- package/mcp-server.js +5 -4
- package/mcp-server.ts +4 -3
- package/package.json +12 -10
- package/dashboard/dist/assets/index-BnPt1Fii.js +0 -1
- package/dashboard/dist/assets/index-CfH00tOL.css +0 -1
- package/dashboard/dist/index.html +0 -3
- package/lib/blackbox-rf.js +0 -1099
- package/lib/blackbox.js +0 -137
- package/lib/compression.js +0 -119
- package/lib/db.js +0 -106
- package/lib/db.ts +0 -113
- package/lib/delegation.js +0 -137
- package/lib/meta-controller.js +0 -418
- package/lib/meta-controller.mjs +0 -499
- package/lib/patterns.js +0 -150
- package/lib/resolution-tracker.js +0 -486
- package/lib/stress.js +0 -84
- package/lib/tdd.js +0 -218
- package/lib/tier-routing.js +0 -48
- package/middleware/auth.js +0 -75
- package/middleware/auth.ts +0 -87
- package/middleware/usage-logging.js +0 -29
- package/middleware/usage-logging.ts +0 -41
- package/nginx-vibetheog-api.conf +0 -64
- package/routes/admin.js +0 -93
- package/routes/admin.ts +0 -107
- package/routes/blackbox.js +0 -463
- package/routes/compression.js +0 -12
- package/routes/delegation.js +0 -30
- package/routes/patterns.js +0 -53
- package/routes/pricing.js +0 -62
- package/routes/stress.js +0 -30
- package/routes/tdd.js +0 -68
- package/routes/tier-routing.js +0 -31
- package/scripts/dashboard-server.mjs +0 -246
- package/scripts/deploy-zero-downtime.sh +0 -77
- package/scripts/deploy.sh +0 -68
- package/scripts/release.mjs +0 -30
- package/scripts/seed-master-token.js +0 -29
- package/scripts/start-all.mjs +0 -34
- package/server.js +0 -88
- package/vibeos-api.service +0 -19
package/client.js
CHANGED
package/client.ts
CHANGED
|
@@ -22,6 +22,7 @@ type BlackboxEntry = {
|
|
|
22
22
|
entropy?: number
|
|
23
23
|
uncertainty?: number
|
|
24
24
|
embedding?: unknown
|
|
25
|
+
optimizationMode?: string
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
class VibeOSApiClient {
|
|
@@ -165,6 +166,7 @@ class VibeOSApiClient {
|
|
|
165
166
|
entropy: entry.entropy ?? 1.0,
|
|
166
167
|
uncertainty: entry.uncertainty ?? 50,
|
|
167
168
|
embedding: entry.embedding || null,
|
|
169
|
+
optimization_mode: entry.optimizationMode || "auto",
|
|
168
170
|
})
|
|
169
171
|
}
|
|
170
172
|
|
package/lib/logger.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const LEVELS = { silent: -1, error: 0, warn: 1, info: 2, debug: 3 };
|
|
2
|
+
const LEVEL = LEVELS[process.env.VIBEOS_LOG_LEVEL] ?? LEVELS.info;
|
|
3
|
+
const FORMAT = process.env.VIBEOS_LOG_FORMAT === "json" ? "json" : "text";
|
|
4
|
+
|
|
5
|
+
const PAD = 5;
|
|
6
|
+
|
|
7
|
+
function write(level, parts) {
|
|
8
|
+
if (LEVELS[level] > LEVEL) return;
|
|
9
|
+
const msg = parts.map(p => typeof p === "string" ? p : JSON.stringify(p)).join(" ");
|
|
10
|
+
if (msg === "") return;
|
|
11
|
+
if (FORMAT === "json") {
|
|
12
|
+
const line = JSON.stringify({ t: new Date().toISOString(), level, msg, pid: process.pid });
|
|
13
|
+
process.stderr.write(line + "\n");
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
process.stderr.write(`[vibeOS] [${level.toUpperCase().padEnd(PAD)}] ${msg}\n`);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const logger = {
|
|
20
|
+
error: (...args) => write("error", args),
|
|
21
|
+
warn: (...args) => write("warn", args),
|
|
22
|
+
info: (...args) => write("info", args),
|
|
23
|
+
debug: (...args) => write("debug", args),
|
|
24
|
+
get level() { return LEVEL; },
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export default logger;
|
package/mcp-server.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
// SPDX-FileCopyrightText: 2026 vibeOS <https://github.com/DrunkkToys/vibeOS>
|
|
3
|
+
import { logger } from "./lib/logger.js";
|
|
3
4
|
import http from "node:http";
|
|
4
5
|
import { parse as parseUrl } from "node:url";
|
|
5
6
|
import { createReadStream, existsSync, statSync } from "node:fs";
|
|
@@ -56,7 +57,7 @@ function resolveDashboardDir() {
|
|
|
56
57
|
}
|
|
57
58
|
const DASHBOARD_DIR = resolveDashboardDir();
|
|
58
59
|
|
|
59
|
-
const BACKEND_HEALTH_URL = process.env.VIBEOS_BACKEND_HEALTH_URL || "
|
|
60
|
+
const BACKEND_HEALTH_URL = process.env.VIBEOS_BACKEND_HEALTH_URL || "https://api.vibetheog.com/health"
|
|
60
61
|
const BACKEND_HEALTH_TTL_MS = 5_000
|
|
61
62
|
|
|
62
63
|
let backendHealth = { ok: null, checkedAt: 0 }
|
|
@@ -317,7 +318,7 @@ export function createMcpServer(deps) {
|
|
|
317
318
|
if (error?.code !== "EADDRINUSE" || port === 0) {
|
|
318
319
|
startPromise = null;
|
|
319
320
|
server = null;
|
|
320
|
-
|
|
321
|
+
logger.error(`[vibeOS] MCP server bind failed: ${error.message}`);
|
|
321
322
|
throw err;
|
|
322
323
|
}
|
|
323
324
|
try {
|
|
@@ -325,14 +326,14 @@ export function createMcpServer(deps) {
|
|
|
325
326
|
server = fallback;
|
|
326
327
|
const bound = fallback.address();
|
|
327
328
|
const actualPort = typeof bound === "object" && bound ? bound.port : 0;
|
|
328
|
-
|
|
329
|
+
logger.warn(`[vibeOS] MCP server port ${port} busy; fell back to ${actualPort}`);
|
|
329
330
|
return fallback;
|
|
330
331
|
}
|
|
331
332
|
catch (fallbackErr) {
|
|
332
333
|
const fbError = fallbackErr;
|
|
333
334
|
startPromise = null;
|
|
334
335
|
server = null;
|
|
335
|
-
|
|
336
|
+
logger.error(`[vibeOS] MCP server bind failed: ${fbError.message}`);
|
|
336
337
|
throw fallbackErr;
|
|
337
338
|
}
|
|
338
339
|
}
|
package/mcp-server.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
// SPDX-FileCopyrightText: 2026 vibeOS <https://github.com/DrunkkToys/vibeOS>
|
|
3
3
|
|
|
4
|
+
import { logger } from "./lib/logger.js"
|
|
4
5
|
import http from "node:http"
|
|
5
6
|
import { IncomingMessage, ServerResponse } from "node:http"
|
|
6
7
|
import { parse as parseUrl } from "node:url"
|
|
@@ -317,7 +318,7 @@ export function createMcpServer(deps: Deps): McpServer {
|
|
|
317
318
|
if (error?.code !== "EADDRINUSE" || port === 0) {
|
|
318
319
|
startPromise = null
|
|
319
320
|
server = null
|
|
320
|
-
|
|
321
|
+
logger.error(`[vibeOS] MCP server bind failed: ${error.message}`)
|
|
321
322
|
throw err
|
|
322
323
|
}
|
|
323
324
|
try {
|
|
@@ -325,13 +326,13 @@ export function createMcpServer(deps: Deps): McpServer {
|
|
|
325
326
|
server = fallback
|
|
326
327
|
const bound = fallback.address()
|
|
327
328
|
const actualPort = typeof bound === "object" && bound ? (bound as { port: number }).port : 0
|
|
328
|
-
|
|
329
|
+
logger.warn(`[vibeOS] MCP server port ${port} busy; fell back to ${actualPort}`)
|
|
329
330
|
return fallback
|
|
330
331
|
} catch (fallbackErr: unknown) {
|
|
331
332
|
const fbError = fallbackErr as { message: string }
|
|
332
333
|
startPromise = null
|
|
333
334
|
server = null
|
|
334
|
-
|
|
335
|
+
logger.error(`[vibeOS] MCP server bind failed: ${fbError.message}`)
|
|
335
336
|
throw fallbackErr
|
|
336
337
|
}
|
|
337
338
|
} finally {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vibeoscore",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"description": "vibeOS backend core: API server, MCP server, web dashboard, and API client",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -38,15 +38,9 @@
|
|
|
38
38
|
"client.ts",
|
|
39
39
|
"mcp-server.js",
|
|
40
40
|
"mcp-server.ts",
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"routes/",
|
|
45
|
-
"dashboard/dist/",
|
|
46
|
-
"scripts/",
|
|
47
|
-
"nginx-vibetheog-api.conf",
|
|
48
|
-
"vibeos-api.service",
|
|
49
|
-
".env.example"
|
|
41
|
+
"lib/logger.js",
|
|
42
|
+
".env.example",
|
|
43
|
+
"README.md"
|
|
50
44
|
],
|
|
51
45
|
"keywords": [
|
|
52
46
|
"vibeos",
|
|
@@ -62,5 +56,13 @@
|
|
|
62
56
|
},
|
|
63
57
|
"engines": {
|
|
64
58
|
"node": ">=18"
|
|
59
|
+
},
|
|
60
|
+
"peerDependencies": {
|
|
61
|
+
"@xenova/transformers": ">=2.0"
|
|
62
|
+
},
|
|
63
|
+
"peerDependenciesMeta": {
|
|
64
|
+
"@xenova/transformers": {
|
|
65
|
+
"optional": true
|
|
66
|
+
}
|
|
65
67
|
}
|
|
66
68
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))i(l);new MutationObserver(l=>{for(const r of l)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(l){const r={};return l.integrity&&(r.integrity=l.integrity),l.referrerPolicy&&(r.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?r.credentials="include":l.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(l){if(l.ep)return;l.ep=!0;const r=t(l);fetch(l.href,r)}})();const Tt=!1,Ft=(e,n)=>e===n,me={equals:Ft};let Nt=yt;const Q=1,Ce=2,pt={owned:null,cleanups:null,context:null,owner:null},Te={};var w=null;let Fe=null,Pt=null,m=null,P=null,le=null,ye=0;function Bt(e,n){const t=m,i=w,l=e.length===0,r=n===void 0?i:n,o=l?pt:{owned:null,cleanups:null,context:r?r.context:null,owner:r},s=l?e:()=>e(()=>ae(()=>ue(o)));w=o,m=null;try{return K(s,!0)}finally{m=t,w=i}}function N(e,n){n=n?Object.assign({},me,n):me;const t={value:e,observers:null,observerSlots:null,comparator:n.equals||void 0},i=l=>(typeof l=="function"&&(l=l(t.value)),kt(t,l));return[Ct.bind(t),i]}function Lt(e,n,t){const i=Pe(e,n,!0,Q);he(i)}function V(e,n,t){const i=Pe(e,n,!1,Q);he(i)}function St(e,n,t){t=t?Object.assign({},me,t):me;const i=Pe(e,n,!0,0);return i.observers=null,i.observerSlots=null,i.comparator=t.equals||void 0,he(i),Ct.bind(i)}function It(e){return e&&typeof e=="object"&&"then"in e}function xt(e,n,t){let i,l,r;i=!0,l=e,r={};let o=null,s=Te,f=!1,a="initialValue"in r,$=typeof i=="function"&&St(i);const h=new Set,[b,S]=(r.storage||N)(r.initialValue),[k,E]=N(void 0),[B,L]=N(void 0,{equals:!1}),[I,O]=N(a?"ready":"unresolved");function u(v,g,T,C){return o===v&&(o=null,C!==void 0&&(a=!0),(v===s||g===s)&&r.onHydrated&&queueMicrotask(()=>r.onHydrated(C,{value:g})),s=Te,_(g,T)),g}function _(v,g){K(()=>{g===void 0&&S(()=>v),O(g!==void 0?"errored":a?"ready":"unresolved"),E(g);for(const T of h.keys())T.decrement();h.clear()},!1)}function F(){const v=Dt,g=b(),T=k();if(T!==void 0&&!o)throw T;return m&&m.user,g}function D(v=!0){if(v!==!1&&f)return;f=!1;const g=$?$():i;if(g==null||g===!1){u(o,ae(b));return}let T;const C=s!==Te?s:ae(()=>{try{return l(g,{value:b(),refetching:v})}catch(j){T=j}});if(T!==void 0){u(o,void 0,xe(T),g);return}else if(!It(C))return u(o,C,void 0,g),C;return o=C,"v"in C?(C.s===1?u(o,C.v,void 0,g):u(o,void 0,xe(C.v),g),C):(f=!0,queueMicrotask(()=>f=!1),K(()=>{O(a?"refreshing":"pending"),L()},!1),C.then(j=>u(C,j,void 0,g),j=>u(C,void 0,xe(j),g)))}Object.defineProperties(F,{state:{get:()=>I()},error:{get:()=>k()},loading:{get(){const v=I();return v==="pending"||v==="refreshing"}},latest:{get(){if(!a)return F();const v=k();if(v&&!o)throw v;return b()}}});let M=w;return $?Lt(()=>(M=w,D(!1))):D(!1),[F,{refetch:v=>jt(M,()=>D(v)),mutate:S}]}function ae(e){if(m===null)return e();const n=m;m=null;try{return e()}finally{m=n}}function mt(e){return w===null||(w.cleanups===null?w.cleanups=[e]:w.cleanups.push(e)),e}function jt(e,n){const t=w,i=m;w=e,m=null;try{return K(n,!0)}catch(l){Be(l)}finally{w=t,m=i}}const[Ln,In]=N(!1);let Dt;function Ct(){if(this.sources&&this.state)if(this.state===Q)he(this);else{const e=P;P=null,K(()=>ke(this),!1),P=e}if(m){const e=this.observers;if(!e||e[e.length-1]!==m){const n=e?e.length:0;m.sources?(m.sources.push(this),m.sourceSlots.push(n)):(m.sources=[this],m.sourceSlots=[n]),e?(e.push(m),this.observerSlots.push(m.sources.length-1)):(this.observers=[m],this.observerSlots=[m.sources.length-1])}}return this.value}function kt(e,n,t){let i=e.value;return(!e.comparator||!e.comparator(i,n))&&(e.value=n,e.observers&&e.observers.length&&K(()=>{for(let l=0;l<e.observers.length;l+=1){const r=e.observers[l],o=Fe&&Fe.running;o&&Fe.disposed.has(r),(o?!r.tState:!r.state)&&(r.pure?P.push(r):le.push(r),r.observers&&Ot(r)),o||(r.state=Q)}if(P.length>1e6)throw P=[],new Error},!1)),n}function he(e){if(!e.fn)return;ue(e);const n=ye;Mt(e,e.value,n)}function Mt(e,n,t){let i;const l=w,r=m;m=w=e;try{i=e.fn(n)}catch(o){return e.pure&&(e.state=Q,e.owned&&e.owned.forEach(ue),e.owned=null),e.updatedAt=t+1,Be(o)}finally{m=r,w=l}(!e.updatedAt||e.updatedAt<=t)&&(e.updatedAt!=null&&"observers"in e?kt(e,i):e.value=i,e.updatedAt=t)}function Pe(e,n,t,i=Q,l){const r={fn:e,state:i,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:n,owner:w,context:w?w.context:null,pure:t};return w===null||w!==pt&&(w.owned?w.owned.push(r):w.owned=[r]),r}function wt(e){if(e.state===0)return;if(e.state===Ce)return ke(e);if(e.suspense&&ae(e.suspense.inFallback))return e.suspense.effects.push(e);const n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<ye);)e.state&&n.push(e);for(let t=n.length-1;t>=0;t--)if(e=n[t],e.state===Q)he(e);else if(e.state===Ce){const i=P;P=null,K(()=>ke(e,n[0]),!1),P=i}}function K(e,n){if(P)return e();let t=!1;n||(P=[]),le?t=!0:le=[],ye++;try{const i=e();return qt(t),i}catch(i){t||(le=null),P=null,Be(i)}}function qt(e){if(P&&(yt(P),P=null),e)return;const n=le;le=null,n.length&&K(()=>Nt(n),!1)}function yt(e){for(let n=0;n<e.length;n++)wt(e[n])}function ke(e,n){e.state=0;for(let t=0;t<e.sources.length;t+=1){const i=e.sources[t];if(i.sources){const l=i.state;l===Q?i!==n&&(!i.updatedAt||i.updatedAt<ye)&&wt(i):l===Ce&&ke(i,n)}}}function Ot(e){for(let n=0;n<e.observers.length;n+=1){const t=e.observers[n];t.state||(t.state=Ce,t.pure?P.push(t):le.push(t),t.observers&&Ot(t))}}function ue(e){let n;if(e.sources)for(;e.sources.length;){const t=e.sources.pop(),i=e.sourceSlots.pop(),l=t.observers;if(l&&l.length){const r=l.pop(),o=t.observerSlots.pop();i<l.length&&(r.sourceSlots[o]=i,l[i]=r,t.observerSlots[i]=o)}}if(e.tOwned){for(n=e.tOwned.length-1;n>=0;n--)ue(e.tOwned[n]);delete e.tOwned}if(e.owned){for(n=e.owned.length-1;n>=0;n--)ue(e.owned[n]);e.owned=null}if(e.cleanups){for(n=e.cleanups.length-1;n>=0;n--)e.cleanups[n]();e.cleanups=null}e.state=0}function xe(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function Be(e,n=w){throw xe(e)}function J(e,n){return ae(()=>e(n||{}))}const y=e=>St(()=>e());function Rt(e,n,t){let i=t.length,l=n.length,r=i,o=0,s=0,f=n[l-1].nextSibling,a=null;for(;o<l||s<r;){if(n[o]===t[s]){o++,s++;continue}for(;n[l-1]===t[r-1];)l--,r--;if(l===o){const $=r<i?s?t[s-1].nextSibling:t[r-s]:f;for(;s<r;)e.insertBefore(t[s++],$)}else if(r===s)for(;o<l;)(!a||!a.has(n[o]))&&n[o].remove(),o++;else if(n[o]===t[r-1]&&t[s]===n[l-1]){const $=n[--l].nextSibling;e.insertBefore(t[s++],n[o++].nextSibling),e.insertBefore(t[--r],$),n[l]=t[r]}else{if(!a){a=new Map;let h=s;for(;h<r;)a.set(t[h],h++)}const $=a.get(n[o]);if($!=null)if(s<$&&$<r){let h=o,b=1,S;for(;++h<l&&h<r&&!((S=a.get(n[h]))==null||S!==$+b);)b++;if(b>$-s){const k=n[o];for(;s<$;)e.insertBefore(t[s++],k)}else e.replaceChild(t[s++],n[o++])}else o++;else n[o++].remove()}}}const ht="_$DX_DELEGATE";function Ut(e,n,t,i={}){let l;return Bt(r=>{l=r,n===document?e():c(n,e(),n.firstChild?null:void 0,t)},i.owner),()=>{l(),n.textContent=""}}function p(e,n,t,i){let l;const r=()=>{const s=document.createElement("template");return s.innerHTML=e,s.content.firstChild},o=()=>(l||(l=r())).cloneNode(!0);return o.cloneNode=o,o}function Oe(e,n=window.document){const t=n[ht]||(n[ht]=new Set);for(let i=0,l=e.length;i<l;i++){const r=e[i];t.has(r)||(t.add(r),n.addEventListener(r,Wt))}}function Vt(e,n,t){e.removeAttribute(n)}function x(e,n){n==null?e.removeAttribute("class"):e.className=n}function At(e,n,t){if(!n)return t?Vt(e,"style"):n;const i=e.style;if(typeof n=="string")return i.cssText=n;typeof t=="string"&&(i.cssText=t=void 0),t||(t={}),n||(n={});let l,r;for(r in t)n[r]==null&&i.removeProperty(r),delete t[r];for(r in n)l=n[r],l!==t[r]&&(i.setProperty(r,l),t[r]=l);return t}function c(e,n,t,i){if(t!==void 0&&!i&&(i=[]),typeof n!="function")return we(e,n,i,t);V(l=>we(e,n(),l,t),i)}function Wt(e){let n=e.target;const t=`$$${e.type}`,i=e.target,l=e.currentTarget,r=f=>Object.defineProperty(e,"target",{configurable:!0,value:f}),o=()=>{const f=n[t];if(f&&!n.disabled){const a=n[`${t}Data`];if(a!==void 0?f.call(n,a,e):f.call(n,e),e.cancelBubble)return}return n.host&&typeof n.host!="string"&&!n.host._$host&&n.contains(e.target)&&r(n.host),!0},s=()=>{for(;o()&&(n=n._$host||n.parentNode||n.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return n||document}}),e.composedPath){const f=e.composedPath();r(f[0]);for(let a=0;a<f.length-2&&(n=f[a],!!o());a++){if(n._$host){n=n._$host,s();break}if(n.parentNode===l)break}}else s();r(i)}function we(e,n,t,i,l){for(;typeof t=="function";)t=t();if(n===t)return t;const r=typeof n,o=i!==void 0;if(e=o&&t[0]&&t[0].parentNode||e,r==="string"||r==="number"){if(r==="number"&&(n=n.toString(),n===t))return t;if(o){let s=t[0];s&&s.nodeType===3?s.data!==n&&(s.data=n):s=document.createTextNode(n),t=ce(e,t,i,s)}else t!==""&&typeof t=="string"?t=e.firstChild.data=n:t=e.textContent=n}else if(n==null||r==="boolean")t=ce(e,t,i);else{if(r==="function")return V(()=>{let s=n();for(;typeof s=="function";)s=s();t=we(e,s,t,i)}),()=>t;if(Array.isArray(n)){const s=[],f=t&&Array.isArray(t);if(Ne(s,n,t,l))return V(()=>t=we(e,s,t,i,!0)),()=>t;if(s.length===0){if(t=ce(e,t,i),o)return t}else f?t.length===0?bt(e,s,i):Rt(e,t,s):(t&&ce(e),bt(e,s));t=s}else if(n.nodeType){if(Array.isArray(t)){if(o)return t=ce(e,t,i,n);ce(e,t,null,n)}else t==null||t===""||!e.firstChild?e.appendChild(n):e.replaceChild(n,e.firstChild);t=n}}return t}function Ne(e,n,t,i){let l=!1;for(let r=0,o=n.length;r<o;r++){let s=n[r],f=t&&t[e.length],a;if(!(s==null||s===!0||s===!1))if((a=typeof s)=="object"&&s.nodeType)e.push(s);else if(Array.isArray(s))l=Ne(e,s,f)||l;else if(a==="function")if(i){for(;typeof s=="function";)s=s();l=Ne(e,Array.isArray(s)?s:[s],Array.isArray(f)?f:[f])||l}else e.push(s),l=!0;else{const $=String(s);f&&f.nodeType===3&&f.data===$?e.push(f):e.push(document.createTextNode($))}}return l}function bt(e,n,t=null){for(let i=0,l=n.length;i<l;i++)e.insertBefore(n[i],t)}function ce(e,n,t,i){if(t===void 0)return e.textContent="";const l=i||document.createTextNode("");if(n.length){let r=!1;for(let o=n.length-1;o>=0;o--){const s=n[o];if(l!==s){const f=s.parentNode===e;!r&&!o?f?e.replaceChild(l,s):e.insertBefore(l,t):f&&s.remove()}else r=!0}}else e.insertBefore(l,t);return[l]}const Et="";async function be(e,n){const t=await fetch(Et+e,{headers:{"Content-Type":"application/json"},...n});if(!t.ok)throw new Error(`API ${t.status}: ${t.statusText}`);return t.json()}function $t(){return be("/status")}function _t(){return be("/savings")}function Gt(){return be("/sessions")}function Ht(){return be("/reports")}function Jt(e,n,t){const i={action:e};return n&&(i.slot=n),be("/trinity",{method:"POST",body:JSON.stringify(i)})}function Kt(e){let n=!1,t=null;function i(){if(n)return;const l=new EventSource(Et+"/events");l.onmessage=r=>{try{const o=JSON.parse(r.data);n||e(o)}catch{}},l.onerror=()=>{l.close(),n||(t=setTimeout(i,3e3))}}return i(),()=>{n=!0,t&&clearTimeout(t)}}var Qt=p("<div class=card><h3>Status</h3><p class=muted>loading..."),Xt=p('<div class=card><h3>Status</h3><table class=kv-table><tbody><tr><td>slot</td><td><span class="badge slot"></span></td></tr><tr><td>model</td><td><code></code></td></tr><tr><td>thinking</td><td><span class=badge></span></td></tr><tr><td>enforce</td><td><span></span></td></tr><tr><td>flow</td><td><span></span></td></tr><tr><td>tdd</td><td><span></span></td></tr><tr><td>tdd strict</td><td><span></span></td></tr><tr><td>backend</td><td><span></span></td></tr><tr><td>lock</td><td><span></span></td></tr><tr><td>credit</td><td><div class=credit-bar><div class=credit-fill></div></div><span class=credit-label>%');function Yt({status:e}){return e?(()=>{var n=Xt(),t=n.firstChild,i=t.nextSibling,l=i.firstChild,r=l.firstChild,o=r.firstChild,s=o.nextSibling,f=s.firstChild,a=r.nextSibling,$=a.firstChild,h=$.nextSibling,b=h.firstChild,S=a.nextSibling,k=S.firstChild,E=k.nextSibling,B=E.firstChild,L=S.nextSibling,I=L.firstChild,O=I.nextSibling,u=O.firstChild,_=L.nextSibling,F=_.firstChild,D=F.nextSibling,M=D.firstChild,v=_.nextSibling,g=v.firstChild,T=g.nextSibling,C=T.firstChild,j=v.nextSibling,G=j.firstChild,q=G.nextSibling,R=q.firstChild,U=j.nextSibling,ie=U.firstChild,X=ie.nextSibling,re=X.firstChild,Y=U.nextSibling,W=Y.firstChild,Z=W.nextSibling,z=Z.firstChild,Ae=Y.nextSibling,$e=Ae.firstChild,Ee=$e.nextSibling,_e=Ee.firstChild,ee=_e.firstChild,H=_e.nextSibling,oe=H.firstChild;return c(f,()=>e.active_slot),c(b,()=>e.current_model),c(B,()=>e.thinking),c(u,()=>e.enforce?"ON":"OFF"),c(M,()=>e.flow_enforcer?"ON":"OFF"),c(C,()=>e.tdd_enforcer?"ON":"OFF"),c(R,()=>e.tdd_strict?"ON":"OFF"),c(re,()=>e.backend_connected?"⚡ ON":"OFF"),c(z,(()=>{var A=y(()=>!!e.model_locked);return()=>A()?`ON${e.locked_slot?` (${e.locked_slot})`:""}`:"OFF"})()),c(H,()=>e.credit_percent.toFixed(1),oe),V(A=>{var ve=`badge ${e.enforce?"on":"off"}`,ge=`badge ${e.flow_enforcer?"on":"off"}`,pe=`badge ${e.tdd_enforcer?"on":"off"}`,te=`badge ${e.tdd_strict?"on":"off"}`,ne=`badge ${e.backend_connected?"on":"off"}`,se=`badge ${e.model_locked?"on":"off"}`,d=`width: ${e.credit_percent}%`;return ve!==A.e&&x(u,A.e=ve),ge!==A.t&&x(M,A.t=ge),pe!==A.a&&x(C,A.a=pe),te!==A.o&&x(R,A.o=te),ne!==A.i&&x(re,A.i=ne),se!==A.n&&x(z,A.n=se),A.s=At(ee,d,A.s),A},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),n})():Qt()}var Zt=p("<div class=card><h3>Savings</h3><p class=muted>loading..."),zt=p("<div class=card><h3>Savings <span></span></h3><table class=kv-table><tbody><tr><td>lifetime</td><td><strong>$</strong></td></tr><tr><td>session</td><td><strong>$</strong></td></tr><tr><td>rate / hr</td><td>$</td></tr><tr><td>cache hits</td><td></td></tr><tr><td>total warns</td><td>"),en=p("<div class=bar-chart>"),tn=p("<div class=bar-row><span class=bar-label></span><div class=bar-track><div class=bar-fill></div></div><span class=bar-value>$");function nn({savings:e}){if(!e)return Zt();const n=e.lifetime.delegation_usd+e.lifetime.cache_usd,t=e.current_session.delegation_usd+e.current_session.cache_usd,i=e.trend==="up"?"^":e.trend==="down"?"v":"-",l=e.trend==="up"?"trend-up":e.trend==="down"?"trend-down":"trend-flat";return(()=>{var r=zt(),o=r.firstChild,s=o.firstChild,f=s.nextSibling,a=o.nextSibling,$=a.firstChild,h=$.firstChild,b=h.firstChild,S=b.nextSibling,k=S.firstChild;k.firstChild;var E=h.nextSibling,B=E.firstChild,L=B.nextSibling,I=L.firstChild;I.firstChild;var O=E.nextSibling,u=O.firstChild,_=u.nextSibling;_.firstChild;var F=O.nextSibling,D=F.firstChild,M=D.nextSibling,v=F.nextSibling,g=v.firstChild,T=g.nextSibling;return x(f,`trend ${l}`),c(f,i),c(k,()=>n.toFixed(4),null),c(I,()=>t.toFixed(4),null),c(_,()=>e.savings_rate_per_hour.toFixed(4),null),c(M,()=>e.cache_hits_this_session),c(T,()=>e.lifetime.total_warns),c(r,(()=>{var C=y(()=>!!(e.current_session.tool_breakdown&&Object.keys(e.current_session.tool_breakdown).length>0));return()=>C()&&(()=>{var j=en();return c(j,()=>Object.entries(e.current_session.tool_breakdown).map(([G,q])=>{const R=Math.max(...Object.values(e.current_session.tool_breakdown))||1;return(()=>{var U=tn(),ie=U.firstChild,X=ie.nextSibling,re=X.firstChild,Y=X.nextSibling;return Y.firstChild,c(ie,G),c(Y,()=>q.toFixed(4),null),V(W=>At(re,`width: ${Math.min(q/R*100,100)}%`,W)),U})()})),j})()})(),null),r})()}var ln=p("<div class=card-full><h3>Sessions"),rn=p("<p class=muted>loading..."),on=p("<p class=error>Failed to load sessions"),sn=p("<table class=data-table><thead><tr><th>Session</th><th>Started</th><th>Cost</th><th>Del Saved</th><th>Cache</th><th>Warns</th></tr></thead><tbody>"),cn=p("<tr><td><code></code></td><td></td><td>$</td><td>$</td><td>$</td><td>");function dn(){const[e]=xt(Gt);return(()=>{var n=ln();return n.firstChild,c(n,(()=>{var t=y(()=>!!e.loading);return()=>t()&&rn()})(),null),c(n,(()=>{var t=y(()=>!!e.error);return()=>t()&&on()})(),null),c(n,(()=>{var t=y(()=>!!e());return()=>t()&&(()=>{var i=sn(),l=i.firstChild,r=l.nextSibling;return c(r,()=>e().sessions.map(o=>(()=>{var s=cn(),f=s.firstChild,a=f.firstChild,$=f.nextSibling,h=$.nextSibling;h.firstChild;var b=h.nextSibling;b.firstChild;var S=b.nextSibling;S.firstChild;var k=S.nextSibling;return c(a,()=>o.id.slice(0,8)),c($,(()=>{var E=y(()=>!!o.started);return()=>E()?new Date(o.started).toLocaleDateString():"-"})()),c(h,()=>o.cost_usd.toFixed(2),null),c(b,()=>o.delegation_savings_usd.toFixed(4),null),c(S,()=>o.cache_savings_usd.toFixed(4),null),c(k,()=>o.warns_count),s})())),i})()})(),null),n})()}var fn=p("<div class=card><h3>Stress</h3><div class=stress-bars>"),an=p("<span class=muted>awaiting data..."),un=p("<span class=stress-bar>");const vt=["▁","▂","▃","▅","▆","█"];function hn({status:e}){const[n,t]=N([]),i=setInterval(()=>{e&&t(l=>[...l,vt[Math.floor(Math.random()*vt.length)]].slice(-24))},2e3);return mt(()=>clearInterval(i)),(()=>{var l=fn(),r=l.firstChild,o=r.nextSibling;return c(o,(()=>{var s=y(()=>n().length===0);return()=>s()?an():n().map(f=>(()=>{var a=un();return c(a,f),a})())})()),l})()}var bn=p("<div class=card-full><h3>Controls</h3><div class=control-group><h4>Slot</h4><div class=bracket-row><button></button><button></button><button></button></div></div><hr class=section-divider><div class=control-group><h4>Enforcement</h4><div class=bracket-row><button></button><button></button></div></div><hr class=section-divider><div class=control-group><h4>Lock</h4><div class=bracket-row><button></button><button></button></div></div><hr class=section-divider><div class=control-group><h4>Flow</h4><div class=bracket-row><button></button><button></button><button></button></div></div><hr class=section-divider><div class=control-group><h4>TDD</h4><div class=bracket-row><button></button><button></button><button></button></div></div><hr class=section-divider><div class=control-group><h4>Thinking</h4><div class=bracket-row><button></button><button></button><button></button></div></div><hr class=section-divider><div class=control-group><h4>Actions</h4><div class=bracket-row><button class=bracket-btn></button><button class=bracket-btn></button><button class=bracket-btn>"),$n=p("<div class=result-box><code></code><button class=dismiss-btn>x");function _n({status:e,onAction:n}){const[t,i]=N(null),[l,r]=N(null);async function o(s,f){i(s+(f||"")),r(null);try{const a=await Jt(s,f);r({text:a.ok?String(a.result):String(a.error),ok:a.ok}),n()}catch(a){r({text:a.message,ok:!1})}finally{i(null)}}return(()=>{var s=bn(),f=s.firstChild,a=f.nextSibling,$=a.firstChild,h=$.nextSibling,b=h.firstChild,S=b.nextSibling,k=S.nextSibling,E=a.nextSibling,B=E.nextSibling,L=B.firstChild,I=L.nextSibling,O=I.firstChild,u=O.nextSibling,_=B.nextSibling,F=_.nextSibling,D=F.firstChild,M=D.nextSibling,v=M.firstChild,g=v.nextSibling,T=F.nextSibling,C=T.nextSibling,j=C.firstChild,G=j.nextSibling,q=G.firstChild,R=q.nextSibling,U=R.nextSibling,ie=C.nextSibling,X=ie.nextSibling,re=X.firstChild,Y=re.nextSibling,W=Y.firstChild,Z=W.nextSibling,z=Z.nextSibling,Ae=X.nextSibling,$e=Ae.nextSibling,Ee=$e.firstChild,_e=Ee.nextSibling,ee=_e.firstChild,H=ee.nextSibling,oe=H.nextSibling,A=$e.nextSibling,ve=A.nextSibling,ge=ve.firstChild,pe=ge.nextSibling,te=pe.firstChild,ne=te.nextSibling,se=ne.nextSibling;return b.$$click=()=>o("set","brain"),c(b,()=>t()==="setbrain"?"...":"brain"),S.$$click=()=>o("set","medium"),c(S,()=>t()==="setmedium"?"...":"medium"),k.$$click=()=>o("set","cheap"),c(k,()=>t()==="setcheap"?"...":"cheap"),O.$$click=()=>o("enforce","on"),c(O,()=>t()==="enforceon"?"...":"enf on"),u.$$click=()=>o("enforce","off"),c(u,()=>t()==="enforceoff"?"...":"enf off"),v.$$click=()=>o("lock","on"),c(v,()=>t()==="lockon"?"...":"lock on"),g.$$click=()=>o("lock","off"),c(g,()=>t()==="lockoff"?"...":"lock off"),q.$$click=()=>o("flow","on"),c(q,()=>t()==="flowon"?"...":"flow on"),R.$$click=()=>o("flow","off"),c(R,()=>t()==="flowoff"?"...":"flow off"),U.$$click=()=>o("flow","enforce"),c(U,()=>t()==="flowenforce"?"...":"flow enf"),W.$$click=()=>o("tdd","on"),c(W,()=>t()==="tddon"?"...":"tdd on"),Z.$$click=()=>o("tdd","off"),c(Z,()=>t()==="tddoff"?"...":"tdd off"),z.$$click=()=>o("tdd","strict"),c(z,()=>t()==="tddstrict"?"...":"tdd strict"),ee.$$click=()=>o("thinking","full"),c(ee,()=>t()==="thinkingfull"?"...":"full"),H.$$click=()=>o("thinking","brief"),c(H,()=>t()==="thinkingbrief"?"...":"brief"),oe.$$click=()=>o("thinking","off"),c(oe,()=>t()==="thinkingoff"?"...":"off"),te.$$click=()=>o("status"),c(te,()=>t()==="status"?"...":"status"),ne.$$click=()=>o("disable"),c(ne,()=>t()==="disable"?"...":"disable"),se.$$click=()=>o("help"),c(se,()=>t()==="help"?"...":"help"),c(s,(()=>{var d=y(()=>!!l());return()=>d()&&(()=>{var de=$n(),fe=de.firstChild,Se=fe.nextSibling;return c(fe,()=>l().text),Se.$$click=()=>r(null),de})()})(),null),V(d=>{var de=`bracket-btn ${(e==null?void 0:e.active_slot)==="brain"?"on":""}`,fe=t()==="setbrain",Se=`bracket-btn ${(e==null?void 0:e.active_slot)==="medium"?"on":""}`,Le=t()==="setmedium",Ie=`bracket-btn ${(e==null?void 0:e.active_slot)==="cheap"?"on":""}`,je=t()==="setcheap",De=`bracket-btn ${e!=null&&e.enforce?"on":"off"}`,Me=t()==="enforceon",qe=`bracket-btn ${e!=null&&e.enforce?"off":"on"}`,Re=t()==="enforceoff",Ue=`bracket-btn ${e!=null&&e.model_locked?"on":"off"}`,Ve=t()==="lockon",We=`bracket-btn ${e!=null&&e.model_locked?"off":"on"}`,Ge=t()==="lockoff",He=`bracket-btn ${e!=null&&e.flow_enforcer?"on":"off"}`,Je=t()==="flowon",Ke=`bracket-btn ${e!=null&&e.flow_enforcer?"off":"on"}`,Qe=t()==="flowoff",Xe=`bracket-btn ${e!=null&&e.flow_extract_todos?"on":"off"}`,Ye=t()==="flowenforce",Ze=`bracket-btn ${e!=null&&e.tdd_enforcer?"on":"off"}`,ze=t()==="tddon",et=`bracket-btn ${e!=null&&e.tdd_enforcer?"off":"on"}`,tt=t()==="tddoff",nt=`bracket-btn ${e!=null&&e.tdd_strict?"on":"off"}`,lt=t()==="tddstrict",it=`bracket-btn ${(e==null?void 0:e.thinking)==="full"?"on":""}`,rt=t()==="thinkingfull",ot=`bracket-btn ${(e==null?void 0:e.thinking)==="brief"?"on":""}`,st=t()==="thinkingbrief",ct=`bracket-btn ${(e==null?void 0:e.thinking)==="off"?"on":""}`,dt=t()==="thinkingoff",ft=t()==="status",at=t()==="disable",ut=t()==="help";return de!==d.e&&x(b,d.e=de),fe!==d.t&&(b.disabled=d.t=fe),Se!==d.a&&x(S,d.a=Se),Le!==d.o&&(S.disabled=d.o=Le),Ie!==d.i&&x(k,d.i=Ie),je!==d.n&&(k.disabled=d.n=je),De!==d.s&&x(O,d.s=De),Me!==d.h&&(O.disabled=d.h=Me),qe!==d.r&&x(u,d.r=qe),Re!==d.d&&(u.disabled=d.d=Re),Ue!==d.l&&x(v,d.l=Ue),Ve!==d.u&&(v.disabled=d.u=Ve),We!==d.c&&x(g,d.c=We),Ge!==d.w&&(g.disabled=d.w=Ge),He!==d.m&&x(q,d.m=He),Je!==d.f&&(q.disabled=d.f=Je),Ke!==d.y&&x(R,d.y=Ke),Qe!==d.g&&(R.disabled=d.g=Qe),Xe!==d.p&&x(U,d.p=Xe),Ye!==d.b&&(U.disabled=d.b=Ye),Ze!==d.T&&x(W,d.T=Ze),ze!==d.A&&(W.disabled=d.A=ze),et!==d.O&&x(Z,d.O=et),tt!==d.I&&(Z.disabled=d.I=tt),nt!==d.S&&x(z,d.S=nt),lt!==d.W&&(z.disabled=d.W=lt),it!==d.C&&x(ee,d.C=it),rt!==d.B&&(ee.disabled=d.B=rt),ot!==d.v&&x(H,d.v=ot),st!==d.k&&(H.disabled=d.k=st),ct!==d.x&&x(oe,d.x=ct),dt!==d.j&&(oe.disabled=d.j=dt),ft!==d.q&&(te.disabled=d.q=ft),at!==d.z&&(ne.disabled=d.z=at),ut!==d.P&&(se.disabled=d.P=ut),d},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0,w:void 0,m:void 0,f:void 0,y:void 0,g:void 0,p:void 0,b:void 0,T:void 0,A:void 0,O:void 0,I:void 0,S:void 0,W:void 0,C:void 0,B:void 0,v:void 0,k:void 0,x:void 0,j:void 0,q:void 0,z:void 0,P:void 0}),s})()}Oe(["click"]);var vn=p("<div class=card-full><h3>Reports"),gn=p("<p class=muted>loading..."),pn=p("<p class=error>Failed to load reports"),Sn=p("<div class=reports-layout><div class=report-list></div><div class=report-viewer>"),xn=p("<div><div class=report-summary></div><div class=report-meta><span class=report-type></span><span class=report-date>"),mn=p("<pre class=report-content>"),Cn=p("<p class=muted>Select a report");function kn(){const[e]=xt(Ht),[n,t]=N(null),[i,l]=N(null);async function r(o){t(o);try{const s=await fetch(`/reports/${encodeURIComponent(o)}`);l(await s.text())}catch{l("Failed to load report")}}return(()=>{var o=vn();return o.firstChild,c(o,(()=>{var s=y(()=>!!e.loading);return()=>s()&&gn()})(),null),c(o,(()=>{var s=y(()=>!!e.error);return()=>s()&&pn()})(),null),c(o,(()=>{var s=y(()=>!!e());return()=>s()&&(()=>{var f=Sn(),a=f.firstChild,$=a.nextSibling;return c(a,()=>e().map(h=>(()=>{var b=xn(),S=b.firstChild,k=S.nextSibling,E=k.firstChild,B=E.nextSibling;return b.$$click=()=>r(h.id),c(S,()=>h.summary||h.id),c(E,()=>h.type),c(B,(()=>{var L=y(()=>!!h.created);return()=>L()?new Date(h.created).toLocaleDateString():""})()),V(()=>x(b,`report-item ${n()===h.id?"active":""}`)),b})())),c($,(()=>{var h=y(()=>!!i());return()=>h()?(()=>{var b=mn();return c(b,i),b})():Cn()})()),f})()})(),null),o})()}Oe(["click"]);var wn=p('<div class=card-full><h3>Blackbox Engine</h3><div class=bracket-row><button class=bracket-btn></button><span class="sep muted">|'),yn=p('<table class="kv-table blackbox-status"><tbody><tr><td>sub-regime</td><td><span class=badge></span></td></tr><tr><td>momentum</td><td>%</td></tr><tr><td>resolution</td><td></td></tr><tr><td>loops</td><td></td></tr><tr><td>intervention</td><td>L'),On=p("<p class=muted>Press refresh to load state"),An=p("<p class=error>");function En(){const[e,n]=N(null),[t,i]=N(null),[l,r]=N(!1);async function o(){r(!0),i(null);try{(await(await fetch("/status")).json()).sessions_raw&&n({sub_regime:"active",momentum:.5,resolution_state:"in_progress",loop_count:0,intervention_level:0})}catch(s){i(s.message)}finally{r(!1)}}return(()=>{var s=wn(),f=s.firstChild,a=f.nextSibling,$=a.firstChild;return $.$$click=o,c($,()=>l()?"...":"refresh"),c(s,(()=>{var h=y(()=>!!e());return()=>h()&&(()=>{var b=yn(),S=b.firstChild,k=S.firstChild,E=k.firstChild,B=E.nextSibling,L=B.firstChild,I=k.nextSibling,O=I.firstChild,u=O.nextSibling,_=u.firstChild,F=I.nextSibling,D=F.firstChild,M=D.nextSibling,v=F.nextSibling,g=v.firstChild,T=g.nextSibling,C=v.nextSibling,j=C.firstChild,G=j.nextSibling;return G.firstChild,c(L,()=>e().sub_regime),c(u,()=>(e().momentum*100).toFixed(0),_),c(M,()=>e().resolution_state),c(T,()=>e().loop_count),c(G,()=>e().intervention_level,null),b})()})(),null),c(s,(()=>{var h=y(()=>!e()&&!l()&&!t());return()=>h()&&On()})(),null),c(s,(()=>{var h=y(()=>!!t());return()=>h()&&(()=>{var b=An();return c(b,t),b})()})(),null),V(()=>$.disabled=l()),s})()}Oe(["click"]);var Tn=p("<div class=app><header class=header><div class=header-title><h1>vibeOS</h1><span class=version></span></div><div class=header-indicators><span></span><span></span></div></header><nav class=nav-tabs></nav><main class=content>"),Fn=p('<span class="indicator disabled">OFF'),Nn=p("<button>"),Pn=p("<div class=grid-2col>");function Bn(){const[e,n]=N(null),[t,i]=N(null),[l,r]=N("status"),[o,s]=N(!1),f=Kt($=>{n($.status),i($.savings),s(!0)});$t().then(n).catch(()=>{}),_t().then(i).catch(()=>{}),mt(f);const a=[{key:"status",label:"Status"},{key:"controls",label:"Controls"},{key:"reports",label:"Reports"},{key:"blackbox",label:"Blackbox"}];return(()=>{var $=Tn(),h=$.firstChild,b=h.firstChild,S=b.firstChild,k=S.nextSibling,E=b.nextSibling,B=E.firstChild,L=B.nextSibling,I=h.nextSibling,O=I.nextSibling;return c(k,()=>{var u;return((u=e())==null?void 0:u.version)??"..."}),c(B,()=>o()?"LIVE":"connecting"),c(L,()=>{var u,_;return((u=e())==null?void 0:u.backend_connected)??((_=e())==null?void 0:_.backendConnected)?"⚡ BACKEND":"API OFF"}),c(E,(()=>{var u=y(()=>{var _;return((_=e())==null?void 0:_.enabled)===!1});return()=>u()&&Fn()})(),null),c(I,()=>a.map(u=>(()=>{var _=Nn();return _.$$click=()=>r(u.key),c(_,()=>u.label),V(()=>x(_,`tab ${l()===u.key?"active":""}`)),_})())),c(O,(()=>{var u=y(()=>l()==="status");return()=>u()&&(()=>{var _=Pn();return c(_,J(Yt,{get status(){return e()}}),null),c(_,J(nn,{get savings(){return t()}}),null),c(_,J(hn,{get status(){return e()}}),null),c(_,J(dn,{}),null),_})()})(),null),c(O,(()=>{var u=y(()=>l()==="controls");return()=>u()&&J(_n,{get status(){return e()},onAction:()=>{$t().then(n),_t().then(i)}})})(),null),c(O,(()=>{var u=y(()=>l()==="reports");return()=>u()&&J(kn,{})})(),null),c(O,(()=>{var u=y(()=>l()==="blackbox");return()=>u()&&J(En,{})})(),null),V(u=>{var D,M;var _=`indicator ${o()?"connected":"disconnected"}`,F=`indicator flash ${((D=e())==null?void 0:D.backend_connected)??((M=e())==null?void 0:M.backendConnected)?"connected":"disconnected"}`;return _!==u.e&&x(B,u.e=_),F!==u.t&&x(L,u.t=F),u},{e:void 0,t:void 0}),$})()}Oe(["click"]);const gt=document.getElementById("app");gt&&Ut(()=>J(Bn,{}),gt);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}:root{--bg:#050505;--surface:#0c0c0c;--border:#1a1a1a;--border-hover:#2a2a2a;--text:#d4d4d4;--text-dim:#6a6a6a;--text-bright:#f0f0f0;--green:#3fb950;--red:#f85149;--yellow:#d29922;--accent:#58a6ff;--accent-dim:rgba(88,166,255,.08);--mono:"JetBrains Mono","Fira Code","Cascadia Code","SF Mono",Menlo,monospace;--sans:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif}html{font-size:13px;background:var(--bg)}body{font-family:var(--mono);background:var(--bg);color:var(--text);min-height:100vh;-webkit-font-smoothing:antialiased}.app{max-width:1100px;margin:0 auto;padding:1.25rem 1.5rem}.header{display:flex;justify-content:space-between;align-items:center;padding-bottom:.5rem;margin-bottom:.75rem;border-bottom:1px solid var(--border)}.header-title{display:flex;align-items:baseline;gap:.5rem}.header-title h1{font-family:var(--mono);font-size:1.1rem;font-weight:600;color:var(--text-bright);text-transform:lowercase;letter-spacing:-.5px}.header-title h1:before{content:"~ ";color:var(--red)}.version{font-size:.7rem;color:var(--text-dim);font-family:var(--mono)}.header-indicators{display:flex;gap:.5rem;align-items:center}.indicator{font-family:var(--mono);font-size:.65rem;padding:1px 6px;text-transform:uppercase;font-weight:600;letter-spacing:.5px}.indicator.connected{color:var(--green)}.indicator.disconnected{color:var(--yellow)}.indicator.disabled{color:var(--red)}.indicator:before{content:"● ";font-size:.5rem}.indicator.flash:before{content:"⚡ ";font-size:.7rem}.nav-tabs{display:flex;gap:0;margin-bottom:1rem;border-bottom:1px solid var(--border)}.tab{font-family:var(--mono);background:transparent;border:none;color:var(--text-dim);padding:.4rem .75rem;cursor:pointer;font-size:.78rem;border-bottom:2px solid transparent;margin-bottom:-1px;transition:color .15s,border-color .15s;text-transform:uppercase;letter-spacing:.5px}.tab:hover{color:var(--text);border-bottom-color:var(--border-hover)}.tab.active{color:var(--text-bright);border-bottom-color:var(--green);font-weight:600}.content{display:flex;flex-direction:column;gap:.75rem}.grid-2col{display:grid;grid-template-columns:1fr 1fr;gap:.75rem}.card,.card-full{background:var(--surface);border:1px solid var(--border);padding:.75rem .85rem}.card-full{grid-column:1/-1}.card h3,.card-full h3{font-family:var(--mono);font-size:.7rem;font-weight:600;margin-bottom:.65rem;text-transform:uppercase;color:var(--text-dim);letter-spacing:1px}.card h3:before,.card-full h3:before{content:"── ";color:var(--border-hover)}.kv-table{width:100%;border-collapse:collapse;font-family:var(--mono)}.kv-table td{padding:.25rem 0;font-size:.78rem}.kv-table td:first-child{color:var(--text-dim);width:38%;white-space:nowrap}.kv-table td:last-child{color:var(--text)}.badge{display:inline-block;font-family:var(--mono);font-size:.65rem;padding:1px 5px;font-weight:600;text-transform:uppercase;letter-spacing:.5px;line-height:1.4}.badge.slot{color:var(--green)}.badge.slot:before{content:"["}.badge.slot:after{content:"]"}.badge.on{color:var(--green)}.badge.on:before{content:"["}.badge.on:after{content:"]"}.badge.off{color:var(--red)}.badge.off:before{content:"["}.badge.off:after{content:"]"}code{font-family:var(--mono);font-size:.75rem;color:var(--text-bright)}pre{font-family:var(--mono);font-size:.72rem}.credit-bar{display:inline-block;width:55px;height:6px;background:var(--border);overflow:hidden;vertical-align:middle;border:1px solid var(--border-hover)}.credit-fill{height:100%;background:var(--green);transition:width .4s ease}.credit-label{margin-left:.4rem;font-size:.7rem;font-family:var(--mono);color:var(--text-dim)}.trend{font-size:.85rem;font-family:var(--mono)}.trend-up{color:var(--green)}.trend-down{color:var(--red)}.trend-flat{color:var(--text-dim)}.bar-chart{display:flex;flex-direction:column;gap:.3rem;margin-top:.5rem}.bar-row{display:flex;align-items:center;gap:.5rem}.bar-label{width:75px;font-size:.7rem;color:var(--text-dim);text-align:right;font-family:var(--mono)}.bar-track{flex:1;height:5px;background:var(--border);overflow:hidden}.bar-fill{height:100%;background:var(--accent);transition:width .4s ease}.bar-value{width:55px;font-size:.7rem;text-align:right;font-family:var(--mono);color:var(--text-dim)}.data-table{width:100%;border-collapse:collapse;font-size:.72rem;font-family:var(--mono)}.data-table th,.data-table td{padding:.3rem .4rem;text-align:left}.data-table th{color:var(--text-dim);font-weight:600;text-transform:uppercase;letter-spacing:.5px;font-size:.65rem;border-bottom:1px solid var(--border)}.data-table td{border-bottom:1px solid var(--border);color:var(--text)}.data-table tr:hover td{background:var(--accent-dim)}.data-table td:first-child{color:var(--text-bright)}.stress-bars{display:flex;gap:2px;align-items:flex-end;min-height:28px;padding:.3rem 0}.stress-bar{font-size:1.4rem;line-height:1;font-family:var(--mono)}.muted{color:var(--text-dim);font-size:.78rem;font-family:var(--mono)}.error{color:var(--red);font-size:.75rem;font-family:var(--mono)}.sep{color:var(--text-dim);margin:.5rem 0;font-family:var(--mono);font-size:.65rem;letter-spacing:2px}.control-group{margin-bottom:.65rem}.control-group h4{font-family:var(--mono);font-size:.65rem;color:var(--text-dim);margin-bottom:.3rem;text-transform:uppercase;letter-spacing:1px;border-bottom:1px solid var(--border);padding-bottom:.15rem}.bracket-row{display:flex;gap:.6rem;flex-wrap:wrap}.bracket-btn{font-family:var(--mono);font-size:.75rem;background:transparent;border:none;color:var(--text-dim);cursor:pointer;padding:.15rem 0;transition:color .15s;letter-spacing:.3px}.bracket-btn:before{content:"["}.bracket-btn:after{content:"]"}.bracket-btn:hover{color:var(--text)}.bracket-btn.on{color:var(--green);font-weight:600}.bracket-btn.off{color:var(--red)}.bracket-btn:disabled{opacity:.3;cursor:default}.result-box{margin-top:.6rem;padding:.5rem .6rem;border:1px solid var(--border);border-left:2px solid var(--accent);font-family:var(--mono);font-size:.7rem;color:var(--text-dim);display:flex;justify-content:space-between;align-items:center}.result-box code{font-size:.7rem;color:var(--text-dim);max-width:90%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dismiss-btn{background:none;border:none;color:var(--text-dim);cursor:pointer;font-size:.85rem;padding:0 .2rem;font-family:var(--mono)}.dismiss-btn:hover{color:var(--text)}.reports-layout{display:grid;grid-template-columns:1fr 2fr;gap:.75rem;min-height:280px}.report-list{display:flex;flex-direction:column;gap:0}.report-item{padding:.4rem .5rem;cursor:pointer;border-left:2px solid transparent;transition:border-color .15s,background .15s}.report-item:hover{border-color:var(--border-hover)}.report-item.active{border-color:var(--green);background:var(--accent-dim)}.report-summary{font-family:var(--mono);font-size:.78rem;color:var(--text);margin-bottom:.2rem}.report-meta{display:flex;gap:.5rem;font-size:.65rem;color:var(--text-dim);font-family:var(--mono)}.report-type{text-transform:uppercase;letter-spacing:.5px}.report-viewer{background:var(--bg);border:1px solid var(--border);padding:.6rem .7rem;overflow:auto;min-height:200px}.report-content{font-family:var(--mono);font-size:.72rem;color:var(--text);white-space:pre-wrap;word-break:break-all}.blackbox-status{font-family:var(--mono);margin-top:.8rem}.blackbox-status td{font-size:.75rem}.section-divider{border:none;border-top:1px solid var(--border);margin:.4rem 0;opacity:.6}.status-dot{color:var(--green);font-family:var(--mono)}.status-dot.off{color:var(--red)}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><title>vibeOS Dashboard</title> <script type="module" crossorigin src="/assets/index-BnPt1Fii.js"></script>
|
|
2
|
-
<link rel="stylesheet" crossorigin href="/assets/index-CfH00tOL.css">
|
|
3
|
-
</head><body><div id="app"></div></body></html>
|