Browser-based graphical shell and control plane for a Linux server you own — real terminal, file manager, live metrics and BYOK AI in one mobile-first workspace. Next.js 16 · React 19 · node-pty · Tailwind v4 · shadcn/ui. Public alpha, self-hosted.
TypeScript browser-shellcontrol-planefile-managerhomelabmobile-firstnextjsptyreactself-hostedserver-managementshadcn-uisysadmintailwindcssterminaltypescriptvpsweb-desktopweb-terminal
feat: connect OpenRouter for JEV without switching model
Rahman5eac16ff3356
diff --git a/.env.example b/.env.exampleindex 30d9f3ab..a6522f06 100644--- a/.env.example+++ b/.env.example@@ -291,6 +291,8 @@ OS_SESSION_SECRET=OS_AGENT_MEMORY_CORE_CHARS=6000OS_AGENT_MEMORY_JIT_CHARS=8000# OS_AGENT_SESSION_ARCHIVE_DIR=~/.mso/agent-session-archive+# JEV preservation receipts are SHA-bound evidence that gates archive deletion.+# OS_AGENT_SESSION_PRESERVATION_DIR=~/.mso/agent-session-preservation# OS_AGENT_SESSION_ARCHIVE_DAYS=30# Owner-private Dokploy/Cloudflare/Hostinger connection state. Defaults to the path# below; normally leave it there so the 0700 directory + 0600 file policy applies.diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.mdindex 03d95d64..e5baf7a8 100644--- a/docs/CHANGELOG.md+++ b/docs/CHANGELOG.md@@ -8,6 +8,7 @@ this is the *what*, and it is what Settings → About shows as “What's new”.**Added**+- connect OpenRouter for JEV without switching model- route JEV through OpenRouter and preserve sessions- `integrations` clarify DOKU credential fieldsdiff --git a/frontend/slices/workflows/components/workflow-session-details.tsx b/frontend/slices/workflows/components/workflow-session-details.tsxindex d63c6558..eb091920 100644--- a/frontend/slices/workflows/components/workflow-session-details.tsx+++ b/frontend/slices/workflows/components/workflow-session-details.tsx@@ -101,13 +101,13 @@ export function WorkflowSessionDetails({ view, node, onOpenTerminal, onOpenCode,const [jev, setJev] = useState<JevSessionOptimization | null>(null);const [jevBusy, setJevBusy] = useState(false);const [jevError, setJevError] = useState("");- const useJev = async () => { setJevBusy(true); setJevError(""); try { setJev(await optimizeSessionWithJev(view.session.id)); } catch (cause) { setJevError(cause instanceof Error ? cause.message : "JEV unavailable"); } finally { setJevBusy(false); } };+ const runJev = async () => { setJevBusy(true); setJevError(""); try { setJev(await optimizeSessionWithJev(view.session.id)); } catch (cause) { setJevError(cause instanceof Error ? cause.message : "JEV unavailable"); } finally { setJevBusy(false); } };return <div className="flex h-full min-h-0 flex-col bg-card/20"><div className="border-b p-3"><div className="break-words text-sm font-semibold">{view.session.label}</div><div className="mt-1 flex flex-wrap items-center gap-1.5 text-[10px] uppercase text-muted-foreground"><span>{view.session.source}</span><span>·</span><span>{view.session.status}</span><Badge variant="outline" className="h-5 px-1.5 text-[9px] normal-case">{view.steps.length} semantic steps</Badge></div><p className="mt-2 text-xs text-muted-foreground">Canvas shows intent-level steps. Click a step to inspect its grouped actions, commands, code, artifacts, and raw execution receipt.</p>- <div className="mt-2 flex flex-wrap items-center gap-2"><Button data-slot="use-jev-session" type="button" size="sm" variant="outline" className="h-7 text-[10px]" disabled={jevBusy} onClick={() => void useJev()}><BrainCircuit className="size-3.5"/>{jevBusy ? "Calculating…" : "Use JEV"}</Button><span className="text-[10px] text-muted-foreground">Review-first optimization packet for this session; no tools are executed.</span></div>+ <div className="mt-2 flex flex-wrap items-center gap-2"><Button data-slot="use-jev-session" type="button" size="sm" variant="outline" className="h-7 text-[10px]" disabled={jevBusy} onClick={() => void runJev()}><BrainCircuit className="size-3.5"/>{jevBusy ? "Calculating…" : "Use JEV"}</Button><span className="text-[10px] text-muted-foreground">Review-first optimization packet for this session; no tools are executed.</span></div>{jevError ? <p className="mt-2 text-[10px] text-destructive">{jevError}</p> : null}{jev ? <div data-slot="jev-session-output" className="mt-2 rounded-lg border bg-muted/15 p-2.5 text-[10px]"><div className="flex items-center gap-2"><Badge variant="outline" className="h-5 text-[9px]">{jev.provider === "jev" ? "JEV" : "fallback"}</Badge><span>{jev.recommendations.length} optimization signals</span><Button type="button" size="sm" variant="ghost" className="ml-auto h-6 text-[9px]" onClick={() => void navigator.clipboard?.writeText(JSON.stringify(jev.llmContext,null,2))}><Copy className="size-3"/>Copy for LLM</Button></div>{jev.fallbackReason ? <p className="mt-1 text-muted-foreground">{jev.fallbackReason}</p> : null}<div className="mt-2 space-y-1">{jev.recommendations.slice(0,6).map(item=><div key={item.id} className="rounded border bg-background/40 p-2"><div className="font-medium">{Math.round(item.probability*100)}% · {item.title}</div><p className="mt-0.5 text-muted-foreground">{item.description}</p><div className="mt-1 font-mono text-[9px] text-muted-foreground">{item.actionRefs.slice(0,8).join(" · ")}</div></div>)}</div></div> : null}{view.omittedEvents ? <p className="mt-2 text-[10px] text-muted-foreground">Projection uses the latest {view.shownEvents} of {view.totalEvents} events to stay fast. Raw session history remains the source of truth.</p> : null}diff --git a/lib/infra/connection-ui-layout.test.ts b/lib/infra/connection-ui-layout.test.tsindex 668ef4c8..d55d0d4b 100644--- a/lib/infra/connection-ui-layout.test.ts+++ b/lib/infra/connection-ui-layout.test.ts@@ -29,6 +29,8 @@ it("keeps AI Providers on the existing AI config/runtime SSOT and browser-only cexpect(CONNECTION_MANAGER_SCRIPT).toContain("Integration Variables");expect(CONNECTION_MANAGER_SCRIPT).toContain("~typesafe/jev-latest");expect(CONNECTION_MANAGER_SCRIPT).toContain("same OpenRouter key managed here and in Settings");+ expect(CONNECTION_MANAGER_SCRIPT).toContain("Connect OpenRouter for JEV");+ expect(CONNECTION_MANAGER_SCRIPT).toContain('select:false');expect(INTEGRATION_BROWSER_SCRIPT).toContain('bridge.aiConfig=()=>json("/api/config")');expect(INTEGRATION_BROWSER_SCRIPT).toContain('bridge.aiCatalog=()=>json("/api/models/providers")');expect(INTEGRATION_BROWSER_SCRIPT).toContain('bridge.aiTest=()=>json("/api/models/test"');diff --git a/lib/infra/connection-ui.ts b/lib/infra/connection-ui.tsindex e409e066..f4bf7e66 100644--- a/lib/infra/connection-ui.ts+++ b/lib/infra/connection-ui.ts@@ -115,7 +115,7 @@ function mountConnectionManager(root,catalog,bridge,initial={}){const dynamic=Array.isArray(catalogResult?.providers)?catalogResult.providers:[],connected=Array.isArray(cfg?.providers)?cfg.providers:[],meta=new Map();for(const row of dynamic)meta.set(row.id,{id:row.id,name:row.name||row.id,...row});for(const row of connected)meta.set(row.id,{id:row.id,name:meta.get(row.id)?.name||row.id,...meta.get(row.id),...row});if(cfg.provider&&!meta.has(cfg.provider))meta.set(cfg.provider,{id:cfg.provider,name:cfg.provider});detail.replaceChildren(n("h2","AI Providers"),n("p","Alfa provider/model selection and credentials share the exact Settings SSOT. Saved keys stay server-side and are only shown masked."));- const openrouter=connected.find(row=>row.id==="openrouter"),jev=n("div",undefined,"connection-card"),jevTop=n("header",undefined,"connection-heading"),jevCopy=n("div");jevCopy.append(n("h3","JEV decision kernel"),n("small","~typesafe/jev-latest · OpenRouter Decisions API"));jevTop.append(jevCopy,n("span",openrouter?.hasKey?"Ready":"OpenRouter required","connection-state"));jev.append(jevTop,n("p","JEV reuses the same OpenRouter key managed here and in Settings → AI. No TypeSafe/JEV credential is stored separately.","identity-muted"));detail.append(jev);+ const openrouter=connected.find(row=>row.id==="openrouter"),jev=n("div",undefined,"connection-card"),jevTop=n("header",undefined,"connection-heading"),jevCopy=n("div");jevCopy.append(n("h3","JEV decision kernel"),n("small","~typesafe/jev-latest · OpenRouter Decisions API"));jevTop.append(jevCopy,n("span",openrouter?.hasKey?"Ready":"OpenRouter required","connection-state"));jev.append(jevTop,n("p","JEV reuses the same OpenRouter key managed here and in Settings → AI. No TypeSafe/JEV credential is stored separately.","identity-muted"));if(!openrouter?.hasKey){const jevKey=input("OpenRouter API key","","password"),jevActions=n("div",undefined,"identity-actions"),connectJev=b("Connect OpenRouter for JEV",async()=>{const apiKey=jevKey.input.value.trim();if(!apiKey){status.textContent="Enter an OpenRouter API key.";return}try{status.textContent="Connecting OpenRouter for JEV…";await bridge.aiSave({provider:"openrouter",apiKey,select:false});jevKey.input.value="";status.textContent="OpenRouter connected for JEV without changing the active AI model.";await aiProviders()}catch(e){status.textContent=textError(e)}},"primary");connectJev.disabled=!bridge.aiSave;jevActions.append(connectJev);jev.append(jevKey.label,jevActions)}detail.append(jev);const providerSelect=n("select"),providerLabel=n("label","Active provider"),modelSelect=n("select"),modelLabel=n("label","Model"),key=input("API key","","password"),fields=n("div",undefined,"identity-fields");for(const row of [...meta.values()].sort((a,b)=>String(a.name).localeCompare(String(b.name)))){const o=n("option",row.name+(row.freeAgentModelCount? " · "+row.freeAgentModelCount+" free agent model"+(row.freeAgentModelCount===1?"":"s"):""));o.value=row.id;providerSelect.append(o)}providerSelect.value=cfg.provider||providerSelect.options[0]?.value||"";providerLabel.append(providerSelect);modelLabel.append(modelSelect);fields.append(providerLabel,modelLabel,key.label);detail.append(fields);