HarnessRouter Community Edition: the self-hosted, Apache-2.0 edition of the unified interface for agent harnesses. Run Codex, Claude Code, Hermes, PI, DSH, and more through one API, with sessions, streaming, files, cancellation, and failure handling. Implements the Unified Harness Protocol (UHP), an open standard. Your keys, your infrastructure.
Python agent-apiagent-frameworkagent-harnessai-agentsai-infrastructurecoding-agentconformance-testingdeepseek-harnessharness-engineeringhermesllmopen-protocolopen-sourceopen-standardpi-coding-agentself-hosteduhpunified-apiunified-harness-protocolunified-interface
console: one setup bar on every setup screen, Tasks · Settings at its right end (from the hosted console) (#611)
github-actions[bot]3fa39ad1947f
diff --git a/ui/src/app/(app)/studio/[id]/page.tsx b/ui/src/app/(app)/studio/[id]/page.tsxindex 45ba3656..1c614679 100644--- a/ui/src/app/(app)/studio/[id]/page.tsx+++ b/ui/src/app/(app)/studio/[id]/page.tsx@@ -1,7 +1,8 @@'use client';// One setup (docs/uxuidesign/console-91, view `agent`: agentView, agentHead, tasksBody, newPane,-// taskPane, setSide, sideTog). One bar on top (back, name, Harness ID, Tasks · Settings, Set up the-// app); the rest of the window is work, every column starting with a 56 px bar on one hairline.+// taskPane, setSide, sideTog). One bar on top (back, name, Deploy to Cloud and Connect your app, then+// Tasks · Settings at its right end); the rest of the window is work, every column starting with a 56 px+// bar on one hairline.// Tasks: the task list, the open task (or New task), the Agent stack. Settings: the layers, the open// layer, the Agent stack with that layer's brick lit. A test is a task: New task starts one, and every// task of the setup takes follow-ups.@@ -171,7 +172,7 @@ export default function SetupPage() {toast('That task is not in this setup.');newTest();});- // Set up the app: the design's sheet, over whichever tab is open+ // Connect your app: the design's sheet, over whichever tab is openconst [app, setApp] = useState(false);const onSetUpApp = () => setApp(true);// Settings' open layer is in the address too (?layer=), so a brick of the Agent stack opens it@@ -229,8 +230,10 @@ export default function SetupPage() {return (<div className="tk-page"><Skel label="Loading the setup" className="hrui-skel-contents">- <header className="ag-bar" aria-hidden="true">+ {/* the setup's bar while it loads: the same bar (setup/parts AgentHead), its tabs' place held at the right end */}+ <header className="ag-bar ag-rt" aria-hidden="true"><div className="ag-lft"><SkLine w={32} h={32} r={16} /><div style={{ display: 'grid', gap: 6 }}><SkLine w={180} h={20} /><SkLine w={240} h={10} /></div></div>+ <div className="ag-sk-tabs"><SkLine w={84} h={14} /><SkLine w={96} h={14} /></div></header></Skel><div className="tk-split" aria-hidden="true">diff --git a/ui/src/components/HarnessLogo.tsx b/ui/src/components/HarnessLogo.tsxindex 07acb63f..d0b6869c 100644--- a/ui/src/components/HarnessLogo.tsx+++ b/ui/src/components/HarnessLogo.tsx@@ -42,5 +42,9 @@ const LOGO: Record<string, string> = {// No entry for vtcode: that base is not in this tree at all (its headless mode drops a harness's// MCP servers — docs/support-matrix-notes.md), so neither its mark nor its row is carried here.-/** The base harness's mark file, or '' when it has none. */-export const harnessLogoSrc = (id: string): string => LOGO[id] || '';+// The bases whose backend is named apart from the base: a setup saved through the API can carry the backend+// (`claude`) as its base, and draws the base's mark all the same (harness-base-alias.test.ts holds this to the OOB table).+export const BACKEND_BASE: Record<string, string> = { claude: 'claude-code' };++/** The base harness's mark file, by its id or its backend, or '' when it has none. */+export const harnessLogoSrc = (id: string): string => LOGO[id] || LOGO[BACKEND_BASE[id] || ''] || '';diff --git a/ui/src/components/hrui/NewSetup.demorace.test.tsx b/ui/src/components/hrui/NewSetup.demorace.test.tsxnew file mode 100644index 00000000..54d03678--- /dev/null+++ b/ui/src/components/hrui/NewSetup.demorace.test.tsx@@ -0,0 +1,67 @@+/** @jest-environment jsdom */+// A demo picked on a fresh Start opens the sheet before the server's harness list has landed (as on the hosted console: the+// first demo picked opened on Auto and kept it, so it was saved composed and renamed on another harness). Once the list is+// in, the sheet takes the demo's own pair and saves it as the demo.+import { act } from 'react';+import { createRoot, type Root } from 'react-dom/client';++const mockBases: { value: Record<string, unknown> | null } = { value: null };+const mockRuns: { models: string[] } = { models: ['claude-sonnet'] };+jest.mock('next/navigation', () => ({ useRouter: () => ({ prefetch: jest.fn(), push: jest.fn(), replace: jest.fn() }) }));+jest.mock('@/lib/harness', () => ({+ gw: jest.fn(),+ offeredOob: (b: Record<string, unknown> | null) => (b ? [{ id: 'claude-code', name: 'Claude Code' }] : []),+ oobById: (id: string) => ({ id }),+ oobDefaultModel: () => 'claude-sonnet',+ useBasesRead: () => ({ value: mockBases.value, failed: false, retry: () => {} }),+ useModelCatalogRead: () => ({ value: { models: ['claude-sonnet'] }, failed: false, retry: () => {} }),+}));+jest.mock('@/lib/providers', () => ({ providerById: () => null, useModelProviders: () => ({ connectionFor: () => null, state: 'ready' }) }));+jest.mock('@/components/HarnessLogo', () => ({ harnessLogoSrc: () => '' }));+jest.mock('./Sheet', () => ({ Sheet: ({ children }: { children: React.ReactNode }) => <div>{children}</div> }));+jest.mock('./toast', () => ({ toast: jest.fn() }));+jest.mock('./start/art', () => ({ nwArt: () => '' }));+jest.mock('./start/build', () => ({ startBuild: jest.fn(() => ({ key: 'b1' })) }));+jest.mock('./start/open', () => ({ openNewSetup: jest.fn() }));+jest.mock('./start/compose', () => ({ AUTO: 'auto' }));+jest.mock('./start/demos', () => ({+ DEMOS: [{ from: 'Contract', to: 'risk review', short: 'Contract review', instr: 'Review a contract and list the clauses that carry risk, please.', base: 'claude-code', model: 'claude-sonnet' }],+ baseName: () => 'Claude Code',+ demoPick: (_i: number, b: Record<string, unknown> | null) => (b ? { base: 'claude-code', model: mockRuns.models.includes('claude-sonnet') ? 'claude-sonnet' : '' } : { base: '', model: '' }),+ runnableModels: () => ['claude-sonnet'],+}));+jest.mock('./start/Handoff', () => ({ Handoff: () => null }));++import { NewSetup } from './NewSetup';++Object.assign(globalThis, { IS_REACT_ACT_ENVIRONMENT: true });+let root: Root;+let el: HTMLElement;+async function flush() { for (let i = 0; i < 4; i++) await act(async () => { await new Promise((r) => setTimeout(r, 0)); }); }+const picks = () => Array.from(el.querySelectorAll('.nw-pk b')).map((b) => (b.textContent || '').trim());+beforeEach(() => { mockBases.value = null; mockRuns.models = ['claude-sonnet']; el = document.createElement('div'); document.body.appendChild(el); root = createRoot(el); });+afterEach(() => { act(() => root.unmount()); el.remove(); });++test('a demo opened before the harness list lands takes its own pair once it does, and saves as the demo', async () => {+ await act(async () => { root.render(<NewSetup pre={{ demo: 0 }} onClose={() => {}} />); });+ await flush();+ expect(picks()[0]).toBe('Auto'); // nothing to pick from yet+ mockBases.value = { 'claude-code': { takesSkills: true } };+ await act(async () => { root.render(<NewSetup pre={{ demo: 0 }} onClose={() => {}} />); });+ await flush();+ expect(picks()).toEqual(['Claude Code', 'claude-sonnet']);+ expect(el.querySelector('button.send')?.id).toBe('nwBuild'); // saved as the demo, not composed+});++test('a demo whose model could not run yet when the sheet settled on Auto takes it once it can', async () => {+ mockBases.value = { 'claude-code': { takesSkills: true } };+ mockRuns.models = []; // the model's availability has not landed+ await act(async () => { root.render(<NewSetup pre={{ demo: 0 }} onClose={() => {}} />); });+ await flush();+ expect(picks()).toEqual(['Claude Code', 'Auto']);+ mockRuns.models = ['claude-sonnet'];+ await act(async () => { root.render(<NewSetup pre={{ demo: 0 }} onClose={() => {}} />); });+ await flush();+ expect(picks()).toEqual(['Claude Code', 'claude-sonnet']);+ expect(el.querySelector('button.send')?.id).toBe('nwBuild');+});diff --git a/ui/src/components/hrui/NewSetup.tsx b/ui/src/components/hrui/NewSetup.tsxindex f039b658..eedd94fe 100644--- a/ui/src/components/hrui/NewSetup.tsx+++ b/ui/src/components/hrui/NewSetup.tsx@@ -81,6 +81,15 @@ export function NewSetup({ pre, onClose }: { pre?: NewSetupPre; onClose: () => v// harness is not available), never another harness in its placeconst [h, setH] = useState(() => (demo != null ? demoPick(demo, bases).base || AUTO : AUTO));const [m, setM] = useState(() => (demo != null ? '' : AUTO));+ // A demo opened before the server's harness list landed opened on Auto, and kept it: the first demo picked on a fresh+ // Start was then saved composed and renamed, on whichever harness Auto chose, never the demo's own pair (and played no+ // recording). Once the list is in, the demo takes its own harness, unless the person has already chosen one.+ const hChosen = useRef(false);+ useEffect(() => {+ if (demo == null || hChosen.current || h !== AUTO || !bases) return;+ const b = demoPick(demo, bases).base;+ if (b) { setH(b); setM(''); }+ }, [bases, demo, h]);const [pick, setPick] = useState<Pick>(null);const [q, setQ] = useState('');const [err, setErr] = useState('');@@ -96,12 +105,18 @@ export function NewSetup({ pre, onClose }: { pre?: NewSetupPre; onClose: () => vconst [pos, setPos] = useState<{ style: CSSProperties; side: boolean } | null>(null);useEffect(() => () => { gone.current = true; }, []);- // a demo's model, once the server's catalog has landed: its own when the harness runs it+ // a demo's model, once the server's catalog has landed: its own when the harness runs it. It is read again on every+ // render and keeps following the demo until the person picks a model, so a catalog or an availability that lands after+ // the sheet settled on Auto still reaches it+ const mChosen = useRef(false);+ const demoDp = demo != null ? demoPick(demo, bases) : null;+ const demoM = demoDp && demoDp.base && demoDp.base === h ? demoDp.model : '';useEffect(() => {+ if (demo != null && !mChosen.current && demoM && m !== demoM) { setM(demoM); return; }if (!catalog || !h || m) return;const dp = demo != null ? demoPick(demo, bases) : null;setM(dp && dp.base && dp.base === h ? dp.model || AUTO : AUTO);- }, [catalog, h, m, demo, bases]);+ }, [catalog, h, m, demo, bases, demoM]);// the caret goes to the end of the sentence on a desktop; a phone keeps its keyboard downuseEffect(() => {const t = setTimeout(() => { const d = ta.current; if (d && window.innerWidth > 700) { d.focus(); d.setSelectionRange(d.value.length, d.value.length); } }, 40);@@ -175,6 +190,7 @@ export function NewSetup({ pre, onClose }: { pre?: NewSetupPre; onClose: () => vconst toggle = (k: 'h' | 'm') => { if (busy) return; setQ(''); setPick((p) => (p === k ? null : k)); };const closePick = () => { const b = pick === 'h' ? btnH.current : btnM.current; setPick(null); setQ(''); b?.focus(); };const chooseH = (id: string) => {+ hChosen.current = true;if (id !== h) {// a chosen model the new harness does not run gives way to Auto, and says soconst runs = (b: string) => runnableModels(b).includes(m);@@ -186,7 +202,7 @@ export function NewSetup({ pre, onClose }: { pre?: NewSetupPre; onClose: () => v}closePick();};- const chooseM = (id: string) => { setM(id); closePick(); };+ const chooseM = (id: string) => { mChosen.current = true; setM(id); closePick(); };const close = () => { gone.current = true; onClose(); };const send = async () => {diff --git a/ui/src/components/hrui/SetUpApp.tsx b/ui/src/components/hrui/SetUpApp.tsxindex acc27bd8..257a8875 100644--- a/ui/src/components/hrui/SetUpApp.tsx+++ b/ui/src/components/hrui/SetUpApp.tsx@@ -1,6 +1,6 @@'use client';-// "Set up the app" (Richard's "Set up a starter app" design, 10-19: `hand-sheet use-sheet`; before it-// docs/uxuidesign/console-79 renderSheet0 and starterBody): the sheet a setup's "Set up the app"+// "Connect your app" (the "Set up a starter app" design, 10-19: `hand-sheet use-sheet`; before it+// docs/uxuidesign/console-79 renderSheet0 and starterBody): the sheet a setup's "Connect your app"// opens. Two steps, drawn as every coding-agent sheet draws them (start/Steps): copy the prompt and// send it to your coding agent, and create an API key (start/KeyStep) for the app's backend.//diff --git a/ui/src/components/hrui/hrui-console.css b/ui/src/components/hrui/hrui-console.cssindex 3e5ea9b0..0e5f040b 100644--- a/ui/src/components/hrui/hrui-console.css+++ b/ui/src/components/hrui/hrui-console.css@@ -392,34 +392,22 @@#hrui .tk-newp .ac-hero{margin:0}#hrui .tp-tabs button{padding:0 10px}}-/* the bar's second line (harness · model · Harness ID) stays one line from 1024 px up: the Harness ID- gives way first, cut in its middle (its start, an ellipsis, its last six, then Copy), then the- model. The design hid the ID under 900 px for want of room; cut, it fits, so it stays. */+/* the bar's second line (harness · model) stays one line from 1024 px up; the Harness ID is the first row of+ Settings › Agent harness, no longer on this line */#hrui .ag-bar .ag-l2 .ag-h{flex:none}-/* the model never gives up width while the Harness ID can: shrinking it at all, even by hundredths of a pixel,- drew its "…" ("deepseek-v4.1-fla…" at 1440 and 1024, production re-check 10-21); "…" only past the whole line */+/* the model keeps its width: "…" only past the whole line ("deepseek-v4.1-fla…" at 1440 and 1024 when it shared the+ line with the Harness ID, production re-check 10-21) */#hrui .ag-bar .ag-l2 .ag-m{flex:0 0 auto;max-width:100%;min-width:0;overflow:hidden;text-overflow:ellipsis}#hrui .ag-bar .ag-l2 .sep{flex:none}-#hrui .ag-bar .ag-l2 .ag-hid{display:inline-flex;flex:0 1000 auto;min-width:76px;margin-left:0} /* the design's -4px- (under 900 px, from when only the copy icon showed) cut the ID's first letter */-#hrui .ag-bar .ag-l2 .ag-hid .ag-id{display:inline-flex;flex:0 1 auto;min-width:0}-#hrui .ag-bar .ag-l2 .ag-hid .icon-btn{flex:none}-#hrui .ag-id-a{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}-#hrui .ag-id-b{flex:none}-#hrui .ag-bar .ag-l2 .sep-id{display:inline}/* under 1024 px the bar stays one 56 px line, as the design draws it: the harness as its logo (its name stays for- screen readers and in the logo's tooltip; a harness with no logo keeps its name), the model whole, and the Harness- ID as its Copy button alone, the ID in the button's tooltip (the design hid the ID's text under 900 px; Richard: a- Harness ID is not for people to read). The model was cut at 768 and 390 in the production read-back (10-21); a bar- that grew to hold more rows moved the tabs' underline and shifted the page on load, so it doesn't grow.+ screen readers and in the logo's tooltip; a harness with no logo keeps its name) and the model whole. The model+ was cut at 768 and 390 in the production read-back (10-21); a bar that grew to hold more rows moved the tabs'+ underline and shifted the page on load, so it doesn't grow.After the base rules on purpose: a media query adds no specificity, so a later rule would win */@media (max-width:1023px){#hrui .ag-bar .ag-l2.has-logo .ag-h{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}- #hrui .ag-bar .ag-l2 .sep-id{display:none}- #hrui .ag-bar .ag-l2 .ag-hid{flex:none;min-width:0;margin-left:4px}- #hrui .ag-bar .ag-l2 .ag-hid .ag-id{display:none}- /* with the ID's text gone the model is the line's only give: whole wherever the line holds it, "…" only where it truly- can't (701 px, or a harness with no logo), and Copy always whole */+ /* the model is the line's only give: whole wherever the line holds it, "…" only where it truly can't (701 px, or a+ harness with no logo) */#hrui .ag-bar .ag-l2 .ag-m{flex:0 1 auto}}#hrui .ag-act>svg{display:none;flex:none}@@ -448,9 +436,14 @@under the layers, never pinned to the rail's foot; where the rail folds to chips (860 px and under)that one is not drawn and the one at the foot of the open layer is, its words in line with thefields above it. One is drawn at any width. */-#hrui .set-split .lg-dz{display:flex;flex-direction:column;margin-top:8px;padding-top:8px;border-top:1px solid var(--line)}+#hrui .set-split .lg-dz{display:flex;align-items:center;gap:8px;margin-top:8px;padding-top:8px;border-top:1px solid var(--line)}+#hrui .set-split .lg-dz>.ly-n{flex:1 1 auto;min-width:0}#hrui .set-split .lg-dz>.ly-n b{color:var(--bad)}#hrui .set-split .lg-dz>.ly-n:hover{background:var(--bad-soft)}+/* Duplicate: Delete setup's row, at its right end, blue */+#hrui .set-split .lg-dz>.ly-n.lg-dup{flex:none;width:auto;text-align:right}+#hrui .set-split .lg-dz>.ly-n.lg-dup b{color:var(--accent)}+#hrui .set-split .lg-dz>.ly-n.lg-dup:hover{background:var(--accent-soft)}#hrui .set-split .lg-col>.lg-dz{display:none}/* Upload to cloud: the row above Delete setup, in the layers' own ink */#hrui .set-split .lg-dz>.ly-n.lg-up b{color:var(--fg)}@@ -463,7 +456,8 @@@media (max-width:860px){#hrui .set-split .lg-rows>.lg-dz{display:none}#hrui .set-split .lg-col>.lg-dz{display:flex;margin-top:28px}- #hrui .set-split .lg-col>.lg-dz>.ly-n{margin:0 -8px}+ #hrui .set-split .lg-col>.lg-dz>.ly-n:first-child{margin-left:-8px}+ #hrui .set-split .lg-col>.lg-dz>.ly-n:last-child{margin-right:-8px}}/* a setup's Plugins tab (setup/PluginSwitches.tsx): the workspace's connected plugins in the design'srows, three columns that line up as a table's (the mark, the words, the switch, each switch as wide@@ -522,7 +516,9 @@#hrui .bs-save .bs-board .bs-grid:not(.bs-g1):not(.bs-g3) .bs-x b{white-space:normal;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}/* the setup's bar (setup/parts.tsx): the name's side and the action's side take equal shares, so Tasksand Settings sit in the bar's middle whatever either side holds (Richard, 2026-10-19); a long name- ellipsizes inside its share. A phone keeps the design's wrap, with the tabs on their own row. */+ ellipsizes inside its share. A phone keeps the design's wrap, with the tabs on their own row. The+ setup page's bar now puts the tabs at its right end instead: the `.ag-bar.ag-rt` rules at the end of+ this file outrank these. */#hrui .ag-bar .ag-lft{display:flex;align-items:center;gap:10px;min-width:0;flex:0 1 auto}@media (min-width:701px){#hrui .ag-bar:where(:not(.hrui-legacy *)){display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);column-gap:16px}@@ -597,7 +593,7 @@#hrui .tp-head .tk-acts .demo-chip+.tk-running{margin-left:10px}/* the Next card under a new setup's first task (start/NextBar, the design's .nx2; Richard 2026-10-19):your app (a brick still to build) and the setup (a built brick) at the two ends, the task going- over and the result coming back between them, Set up the app under the wires. The design draws it+ over and the result coming back between them, Connect your app under the wires. The design draws itat 612 px, its width in a task with the Agent stack open. The card is its own container, so whatfollows reads the card's width whatever panels are open: under 520 px Next takes its own line, thebricks shrink to 64 px, the wires stay between the two ends and the button takes the full width@@ -647,7 +643,7 @@still breaks, and a table wider than the reply scrolls. */#hrui .uac-md th, #hrui .uac-md td{min-width:4em;overflow-wrap:break-word;word-break:normal}/* every coding-agent sheet is Richard's "Set up a starter app" sheet (10-19: hand-sheet use-sheet, its steps- the hx list, start/Steps): Set up the app and the guides. The design's own rules the generated sheet+ the hx list, start/Steps): Connect your app and the guides. The design's own rules the generated sheetlacks, then what the console adds: a summary never runs past the step (a long key name ends in anellipsis), and a hint or live line that warns reads as one */#hrui .use-sheet .hand{margin-top:18px}@@ -678,7 +674,7 @@the pills under it start at different places; one width for all of them, the design's own at 1000 px */@media (max-width:520px){#hrui .agents-g:where(:not(.hrui-legacy *)){grid-template-columns:minmax(0,1fr) 120px!important}}-/* Set up the app (Richard's set-up-a-starter-app design, 10-19): a step that is not next yet keeps its+/* Connect your app (the set-up-a-starter-app design, 10-19): a step that is not next yet keeps itsbody at full strength, so the key row's Create reads as live from the start, as the design draws it.The older guides' fade (hrui.css .hx-s.empty .hx-d) stays for the other sheets. */#hrui .use-sheet .hx-s.empty .hx-d{opacity:1}@@ -1024,7 +1020,7 @@#hrui .tk-d .tp-head .th-row>.tp-t{flex:1;min-width:0}#hrui .tk-d .tp-head .th-row>.tk-acts{margin-left:auto}-/* Deploy to Cloud (setup/DeployCloud.tsx): the page bar's second action, beside Set up the app. Its menu+/* Deploy to Cloud (setup/DeployCloud.tsx): the page bar's second action, beside Connect your app. Its menu(In Cloud) hangs under it, right aligned, as the task filter's does (.rng-pop); Update Cloud carries adot; on a phone it folds to its icon like the bar's other action (.ag-act) */#hrui .dc-w{position:relative;display:inline-flex;flex:none}@@ -1038,3 +1034,40 @@#hrui .ws-pop:not(.me-pop){display:flex;flex-direction:column;overscroll-behavior:contain}#hrui .ws-pop .ws-list{display:flex;flex-direction:column;flex:1 1 auto;min-height:0;overflow-y:auto}#hrui .ws-pop:not(.me-pop)>hr,#hrui .ws-pop:not(.me-pop)>.ws-row.plain{flex:none}+/* Settings › Agent harness: the Harness ID, its first row, read only, with Copy (it left the page's bar). The label is+ a field label's twin; the ID is whole where it fits and cut at its end where it doesn't, Copy always whole */+#hrui .set-f .set-lb{display:block;font-size:13px;font-weight:600;margin-bottom:6px}+#hrui .set-ro.set-hid{gap:8px;padding:5px 6px 5px 12px}+#hrui .set-hid code{flex:1 1 auto;min-width:0;font-size:13px;color:var(--fg);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}+#hrui .set-hid .icon-btn{flex:none;width:28px;height:28px;color:var(--muted)}+#hrui .set-hid .icon-btn:hover{color:var(--fg)}+/* The setup's bar as the hosted console's setup page redesign draws it (Tasks and Settings at the right of the bar, no+ longer its middle): the name on the left, then the setup's two actions, then the tabs at the right end, each with its+ icon, the open one blue over a 3 px underline. 860 px and under the tabs take their own row; 600 and under they share+ it equally, words only. Last in the file and one class past every older bar rule, on purpose */+#hrui .ag-bar.ag-rt,#hrui .tk-page .ag-bar.ag-rt{display:flex;align-items:center;column-gap:16px;padding-right:20px}+#hrui .ag-bar.ag-rt>.ag-lft{flex:1 1 auto;min-width:0}+/* the actions keep their own width, just before the tabs (the older grid gave them the bar's right half and its padding) */+#hrui .ag-bar.ag-rt>.ag-right,#hrui .tk-page .ag-bar.ag-rt>.ag-right{flex:none;margin-left:0;padding-right:0}+#hrui .ag-bar.ag-rt>.tabs.inline.ag-tabs{flex:none;align-self:stretch;display:flex;align-items:stretch;gap:2px;margin:0 0 0 auto;padding:0;border:0}+#hrui .ag-bar.ag-rt>.ag-tabs>button{position:relative;display:inline-flex;align-items:center;gap:8px;padding:0 14px;font-size:14px;font-weight:540;color:var(--muted);border-bottom:0;margin-bottom:-1px;white-space:nowrap}+#hrui .ag-bar.ag-rt>.ag-tabs>button:hover{color:var(--fg)}+#hrui .ag-bar.ag-rt>.ag-tabs>button.on{color:var(--accent);font-weight:540}+#hrui .ag-bar.ag-rt>.ag-tabs>button.on::after{content:"";position:absolute;left:8px;right:8px;bottom:0;height:3px;border-radius:3px 3px 0 0;background:var(--accent)}+#hrui .ag-bar.ag-rt>.ag-tabs>button>svg{width:16px;height:16px;margin:0;color:currentColor;vertical-align:0;flex:none}+@media (max-width:860px){+ #hrui .ag-bar.ag-rt,#hrui .tk-page .ag-bar.ag-rt{flex-wrap:wrap;height:auto;min-height:56px;row-gap:0;padding:8px 12px 0 8px}+ #hrui .ag-bar.ag-rt>.tabs.inline.ag-tabs{order:9;flex:0 0 100%;max-width:100%;height:44px;margin:4px 0 0;overflow-x:auto;scrollbar-width:none}+}+@media (max-width:600px){+ #hrui .ag-bar.ag-rt>.tabs.inline.ag-tabs{gap:0}+ #hrui .ag-bar.ag-rt>.ag-tabs>button{flex:1 1 0;justify-content:center;padding:0 6px}+ #hrui .ag-bar.ag-rt>.ag-tabs>button>svg{display:none}+}+/* a tab that opens once the setup exists (the building page's Settings): drawn, not offered */+#hrui .ag-bar.ag-rt>.ag-tabs>button:disabled{opacity:.45;cursor:default}+#hrui .ag-bar.ag-rt>.ag-tabs>button:disabled:hover{color:var(--muted)}+/* the setup's bar while it loads (studio/[id]): its tabs' place at the right end, on their own row at 860 and under, as the+ loaded bar draws them, so the tabs do not move when it lands */+#hrui .ag-bar.ag-rt>.ag-sk-tabs{margin-left:auto;display:flex;align-items:center;gap:28px;padding:0 14px}+@media (max-width:860px){#hrui .ag-bar.ag-rt>.ag-sk-tabs{order:9;flex:0 0 100%;height:44px;margin:4px 0 0;padding:0 14px}}diff --git a/ui/src/components/hrui/setup/AgentHead.tabfocus.test.tsx b/ui/src/components/hrui/setup/AgentHead.tabfocus.test.tsxindex 13686ab3..267f051f 100644--- a/ui/src/components/hrui/setup/AgentHead.tabfocus.test.tsx+++ b/ui/src/components/hrui/setup/AgentHead.tabfocus.test.tsx@@ -42,3 +42,22 @@ test('a click on a tab changes nothing about where focus goes', () => {draw('settings', onTab);expect(document.activeElement).not.toBe(tabNamed('Settings'));});++test('the bar no longer carries the Harness ID: it lives in Settings', () => {+ el = document.createElement('div'); document.body.appendChild(el); root = createRoot(el);+ draw('tasks', () => {});+ expect(el.textContent).not.toContain('chrn_0123456789abcdef');+ expect(el.querySelector('[aria-label="Copy Harness ID"]')).toBeNull();+ expect(el.querySelector('[aria-label="Connect your app"]')).not.toBeNull();+});++// the hosted console's setup page redesign: Tasks · Settings at the bar's right end, each with its icon; this edition's two+// actions (Deploy to Cloud, Connect your app) sit just before them+test('Tasks · Settings carry their icons and end the bar, after its actions', () => {+ el = document.createElement('div'); document.body.appendChild(el); root = createRoot(el);+ draw('tasks', () => {});+ const bar = el.querySelector('header.ag-bar')!;+ expect(bar.classList.contains('ag-rt')).toBe(true);+ expect(Array.from(el.querySelectorAll('[role="tab"]')).map((t) => [t.textContent, !!t.querySelector('svg')])).toEqual([['Tasks', true], ['Settings', true]]);+ expect(Array.from(bar.children).map((c) => c.className)).toEqual(['ag-lft', 'ag-right', 'tabs inline ag-tabs']);+});diff --git a/ui/src/components/hrui/setup/DeployCloud.tsx b/ui/src/components/hrui/setup/DeployCloud.tsxindex 5cd71a24..0b32d1eb 100644--- a/ui/src/components/hrui/setup/DeployCloud.tsx+++ b/ui/src/components/hrui/setup/DeployCloud.tsx@@ -1,5 +1,5 @@'use client';-// Deploy to Cloud: the setup page bar's second action, beside Set up the app (Richard, 10-23: "one click+// Deploy to Cloud: the setup page bar's second action, beside Connect your app (10-23: "one click// deploy the local harness into HarnessRouter cloud"). One button, in the one place a setup's actions// live, and it always says where the setup stands:// - Deploy to Cloud: never deployed. One click deploys it. The first time this instance has no clouddiff --git a/ui/src/components/hrui/setup/Playground.nextBar.test.tsx b/ui/src/components/hrui/setup/Playground.nextBar.test.tsxindex d2c37f80..7fdfae6f 100644--- a/ui/src/components/hrui/setup/Playground.nextBar.test.tsx+++ b/ui/src/components/hrui/setup/Playground.nextBar.test.tsx@@ -108,7 +108,7 @@ test('the first test New setup handed over ends in the Next bar once its answerawait open({ key: 'n0', first: FIRST });expect(bar()).not.toBeNull();expect(bar()?.querySelector('.nx-setup b')?.textContent).toBe('Contract redlines');- expect(bar()?.querySelector('button')?.textContent).toBe('Set up the app');+ expect(bar()?.querySelector('button')?.textContent).toBe('Connect your app');expect(bar()?.textContent).not.toContain('Cloud');});diff --git a/ui/src/components/hrui/setup/SetupSettings.parts.test.tsx b/ui/src/components/hrui/setup/SetupSettings.parts.test.tsxindex 3dbf97a2..81799282 100644--- a/ui/src/components/hrui/setup/SetupSettings.parts.test.tsx+++ b/ui/src/components/hrui/setup/SetupSettings.parts.test.tsx@@ -303,10 +303,10 @@ describe('the Plugins tab: the workspace’s connected plugins, a switch each',});describe('Deploy to Cloud lives in the page bar, not here', () => {- test('the settings end with Delete setup alone', async () => {+ test('the settings end with Delete setup and Duplicate alone', async () => {await settings(setup(), 'harness');expect(el.querySelector('.lg-rows .ly-n.lg-up')).toBeNull();- expect([...el.querySelectorAll('.lg-rows .lg-dz .ly-n')].map((b) => b.textContent)).toEqual(['Delete setup']);+ expect([...el.querySelectorAll('.lg-rows .lg-dz .ly-n')].map((b) => b.textContent)).toEqual(['Delete setup', 'Duplicate']);expect(el.textContent).not.toContain('Upload to cloud');});});@@ -338,3 +338,27 @@ describe('the arrow keys', () => {expect(document.activeElement?.textContent).toContain('Environment & limits');});});++// The Harness ID lives in Settings › Agent harness, first, with its own Copy (not on the bar above the page).+describe('the Harness ID', () => {+ test('Agent harness shows it first, read-only, with Copy', async () => {+ await settings(setup(), 'harness');+ const f = el.querySelector('.lg-col .set-f');+ expect(f?.querySelector('.set-lb')?.textContent).toBe('Harness ID');+ expect(f?.querySelector('.set-hid code')?.textContent).toBe('chrn_p2');+ expect(f?.querySelector('input')).toBeNull();+ expect(f?.querySelector('button[aria-label="Copy Harness ID"]')).not.toBeNull();+ });+});++// Duplicate shares Delete setup's row, at its right (as on the hosted console), and no longer sits under the agent harness.+describe('Duplicate', () => {+ test('is the second button of every Delete setup row, and Agent harness has none', async () => {+ await settings(setup(), 'harness');+ const rows = Array.from(el.querySelectorAll('.lg-dz'));+ expect(rows.length).toBe(2); // the rail's and the open layer's foot+ for (const row of rows) expect(Array.from(row.querySelectorAll('button')).map((b) => b.textContent)).toEqual(['Delete setup', 'Duplicate']);+ expect(el.textContent).not.toContain('Duplicate with another agent harness');+ expect(el.querySelector('.lg-dup')?.getAttribute('title')).toBe('Duplicate with another agent harness');+ });+});diff --git a/ui/src/components/hrui/setup/SetupSettings.tsx b/ui/src/components/hrui/setup/SetupSettings.tsxindex f2939c78..5c843a20 100644--- a/ui/src/components/hrui/setup/SetupSettings.tsx+++ b/ui/src/components/hrui/setup/SetupSettings.tsx@@ -13,8 +13,9 @@// Capabilities tab counts the ones on of one of setupParts.ts's lists (setupPlugins, setupSkills,// setupTools); Skills and Tools list it, Plugins lists the workspace's connected plugins with a switch// each, beside what the setup includes (PluginSwitches.tsx); the layers list's Capabilities line counts-// what a person added, as the Agent stack and Studio's card do. Under the layers: Delete setup.-// (Deploy to Cloud is the page bar's, beside Set up the app: DeployCloud.tsx.)+// what a person added, as the Agent stack and Studio's card do. Under the layers: Delete setup, and+// Duplicate beside it.+// (Deploy to Cloud is the page bar's, beside Connect your app: DeployCloud.tsx.)// Every value, list, default and ceiling shown is read from the services: the setup's record, the// bases document (tools, built-in skills, thinking levels, runtime defaults), the model catalog,// and the workspace's plugins and environments. What is not read yet shows nothing.@@ -64,6 +65,13 @@ const PLUGIN_PACKAGE_MAX = 16 * 1024 * 1024; // the gateway's own cap on one pconst fmtMb = (n: number) => `${(n / 1048576).toFixed(n < 10485760 ? 1 : 0)} MB`;const LOCK = <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={2.2} aria-hidden="true"><rect x="5" y="11" width="14" height="10" rx="2" /><path d="M8 11V8a4 4 0 0 1 8 0v3" /></svg>;+const COPY = <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={2} aria-hidden="true"><rect x="9" y="9" width="11" height="11" rx="2" /><path d="M5 15V5a2 2 0 0 1 2-2h8" /></svg>;++/** Copy the Harness ID: the clipboard when the browser allows it, else the person is told how. */+async function copyId(hid: string) {+ try { await navigator.clipboard.writeText(hid); toast('Copied'); }+ catch { toast('Text selected. Press Cmd or Ctrl + C.'); }+}const PLUS = <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={2.2} aria-hidden="true"><path d="M12 5v14M5 12h14" /></svg>;const X = <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={2} aria-hidden="true"><path d="M6 6l12 12M18 6L6 18" /></svg>;@@ -102,7 +110,7 @@ export function SetupSettings({ r, onSaved, layer, cap, onLayer, onDirty, onNewTconst providers = useModelProviders();const bases = useBases();const limits = useRuntimeDefaults();- const srv = bases?.[rec.base] || null;+ const srv = bases?.[oobById(rec.base)?.id || rec.base] || null;const oob = oobById(rec.base);// ── the draft ──────────────────────────────────────────────────────────────────────────────// a setup with no model of its own keeps none ('' : the server runs it on its harness's default)@@ -404,10 +412,17 @@ export function SetupSettings({ r, onSaved, layer, cap, onLayer, onDirty, onNewTconst BODY: Record<LayerKey, ReactNode> = {// the agent harness first, then its model (the models are this harness's own, so they follow it)harness: <>+ {/* the Harness ID first, read only: what a task names to reach this setup (it left the page's bar) */}+ <div className="set-f">+ <span className="set-lb" id="setHidL">Harness ID</span>+ <div className="set-ro set-hid" role="group" aria-labelledby="setHidL">+ <code className="mono" title={id}>{id}</code>+ <button type="button" className="icon-btn xs" aria-label="Copy Harness ID" title="Copy Harness ID" onClick={() => void copyId(id)}>{COPY}</button>+ </div>+ </div>{field('setName', 'Name', <input id="setName" className="set-in" value={c.name} aria-invalid={inv('setName')} onChange={(e) => set('name', e.target.value)} />)}{field('setHarness', 'Agent harness',- <div className="set-ro" id="setHarness"><span>{logo ? <img className="h-logo" src={logo} alt="" /> : null}{r.baseName}</span><span className="set-lock">{LOCK}Fixed once saved</span></div>,- <button type="button" className="link-q inl" onClick={() => setPop({ k: 'dup' })}>Duplicate with another agent harness</button>)}+ <div className="set-ro" id="setHarness"><span>{logo ? <img className="h-logo" src={logo} alt="" /> : null}{r.baseName}</span><span className="set-lock">{LOCK}Fixed once saved</span></div>)}{sub('Model', '', null, <>{field('setModel', 'Default model',<select id="setModel" className="set-in" value={c.model} onChange={(e) => set('model', e.target.value)}>@@ -633,11 +648,15 @@ export function SetupSettings({ r, onSaved, layer, cap, onLayer, onDirty, onNewTconst mcpEdit = pop?.k === 'mcp' && pop.i != null ? c.mcp[pop.i] || null : null;// Delete setup: the settings' last row, a layer row's anatomy, past a hairline and outside the- // layers' tablist; red, its name alone (the sheet says what deleting does, Richard 10-18). Drawn at- // any width (hrui-console.css): `rail` under the layers, else at the foot of the open layer.+ // layers' tablist; red, its name alone (the sheet says what deleting does). Duplicate shares its+ // row at the right, blue (as on the hosted console; its sheet picks the other agent harness).+ // Drawn at any width (hrui-console.css): `rail` under the layers, else at the foot of the open+ // layer.const delRow = (where: 'rail' | 'foot') => (<div className="lg-dz" data-where={where}><button type="button" className="ly-n" aria-haspopup="dialog" onClick={() => setPop({ k: 'del' })}><b>Delete setup</b></button>+ <button type="button" className="ly-n lg-dup" aria-haspopup="dialog" title="Duplicate with another agent harness"+ onClick={() => setPop({ k: 'dup' })}><b>Duplicate</b></button></div>);diff --git a/ui/src/components/hrui/setup/oneBar.test.ts b/ui/src/components/hrui/setup/oneBar.test.tsnew file mode 100644index 00000000..80d75b05--- /dev/null+++ b/ui/src/components/hrui/setup/oneBar.test.ts@@ -0,0 +1,28 @@+// One bar for a setup, before it exists and after (as on the hosted console): every header the console draws as a setup's+// bar is the right-aligned one (`ag-bar ag-rt`: the name on the left, the tabs at its right end), and its tabs carry the+// same icons, so the building page can never draw a bar of its own again.+import { readdirSync, readFileSync, statSync } from 'fs';+import { join, relative } from 'path';++const SRC = join(__dirname, '../../..');+function files(dir: string): string[] {+ return readdirSync(dir).flatMap((n) => {+ const p = join(dir, n);+ if (statSync(p).isDirectory()) return files(p);+ return /\.tsx$/.test(n) && !/\.test\.tsx$/.test(n) ? [p] : [];+ });+}+const BARS = ['components/hrui', 'app/(app)/studio'].flatMap((d) => files(join(SRC, d))).flatMap((p) =>+ readFileSync(p, 'utf8').split('\n').map((text, i) => ({ file: relative(SRC, p), n: i + 1, text }))+ .filter((l) => /className="ag-bar[" ]/.test(l.text)));++test('every setup bar is the right-aligned bar', () => {+ expect(BARS.length).toBeGreaterThanOrEqual(3); // the setup page's, its loading bar and the building page's+ expect(BARS.filter((l) => !/className="ag-bar ag-rt"/.test(l.text)).map((l) => `${l.file}:${l.n}`)).toEqual([]);+});++test('the building page\'s tabs carry the setup page\'s icons', () => {+ const build = readFileSync(join(SRC, 'components/hrui/start/BuildPage.tsx'), 'utf8');+ expect(build).toContain('{TASKS_IC}Tasks');+ expect(build).toContain('{SETTINGS_IC}Settings');+});diff --git a/ui/src/components/hrui/setup/parts.tsx b/ui/src/components/hrui/setup/parts.tsxindex 81af2070..dbe5d413 100644--- a/ui/src/components/hrui/setup/parts.tsx+++ b/ui/src/components/hrui/setup/parts.tsx@@ -1,13 +1,12 @@'use client';// The setup page's shared pieces (docs/uxuidesign/console-91, agentHead / towerHtml / sideTog): the-// one bar on top (back, name, what it runs, Harness ID, Tasks · Settings, one action) and the Agent-// stack column beside the work, its 56 px head on the same line as every other column's.+// one bar on top (back, name, what it runs, the setup's actions, Tasks · Settings at its right end) and+// the Agent stack column beside the work, its 56 px head on the same line as every other column's.import Link from 'next/link';import { useEffect, useRef, useState } from 'react';import { isoSvg, LAYERS, PARTS, SUBS, type Drops } from '../tower';import { partIcon } from '../bricks';import { tabKeys } from '../tabKeys';-import { toast } from '../toast';import { ago, healthOf, type SetupRow } from '../setups';import { SkLine } from '../Skel';import { harnessLogoSrc } from '@/components/HarnessLogo';@@ -20,8 +19,12 @@ import { DeployCloud } from './DeployCloud';export type SetupTab = 'tasks' | 'settings';const SETUP_TABS: readonly SetupTab[] = ['tasks', 'settings'];-const COPY = <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={2} aria-hidden="true"><rect x="9" y="9" width="11" height="11" rx="2" /><path d="M5 15V5a2 2 0 0 1 2-2h8" /></svg>;-// the bar's action as an icon, on a phone: Set up the app (a plug)+// the tabs' icons (the hosted console's setup page redesign): Tasks a list, Settings a gear; the building page's bar draws+// the same (start/BuildPage: one bar for a setup, before it exists and after)+const TAB_SVG = { viewBox: '0 0 24 24', width: 16, height: 16, fill: 'none', stroke: 'currentColor', strokeWidth: 2, strokeLinecap: 'round', strokeLinejoin: 'round', 'aria-hidden': true } as const;+export const TASKS_IC = <svg {...TAB_SVG}><path d="M9 6h11M9 12h11M9 18h11" /><path d="M4 6h.01M4 12h.01M4 18h.01" /></svg>;+export const SETTINGS_IC = <svg {...TAB_SVG}><circle cx="12" cy="12" r="3" /><path d="M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1.1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z" /></svg>;+// the bar's action as an icon, on a phone: Connect your app (a plug)const PLUG_IC = <svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" strokeWidth={2} strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M12 22v-5M9 8V2M15 8V2M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8z" /></svg>;/** The design's BACK_IC: a chevron pointing left (the bar's back, a task's back on a phone). */export const BACK_IC = <svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" strokeWidth={2} strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M15 6l-6 6 6 6" /></svg>;@@ -37,14 +40,11 @@ export function HealthPill({ r }: { r: SetupRow }) {return <span className="pill neutral" title={tip}>Idle</span>;}-async function copy(text: string) {- try { await navigator.clipboard.writeText(text); toast('Copied'); }- catch { toast('Text selected. Press Cmd or Ctrl + C.'); }-}--/** The setup page's one bar (agentHead): back to Harness Studio; the name on the first line, its- * agent harness, model and Harness ID on the second; Tasks · Settings; and the setup's two actions,- * Deploy to Cloud (DeployCloud.tsx) and Set up the app. */+/** The setup page's one bar (agentHead, as the hosted console's setup page redesign draws it): back to+ * Harness Studio; the name on the first line, its agent harness and model on the second (the Harness ID+ * is the first row of Settings › Agent harness); the setup's two actions, Deploy to Cloud+ * (DeployCloud.tsx) and Connect your app; and Tasks · Settings at the bar's right end, each with its+ * icon, where the building page's bar draws them too. */// A tab chosen with the keyboard keeps the keyboard on it. The page changes its address for the new tab and// draws the bar again, often as a new tree, so the focus tabKeys gave the new tab was lost to the page body// (audit, 10-21): the bar that draws next puts it back on the selected tab.@@ -61,16 +61,15 @@ export function AgentHead({ r, tab, onTab, onSetUpApp, dirty }: {tabsRef.current?.querySelector<HTMLElement>('[role="tab"][aria-selected="true"]')?.focus();}, [tab]);const model = r.h.defaultModel || '';- const tb = (k: SetupTab, label: React.ReactNode) => (- <button type="button" role="tab" aria-selected={tab === k} tabIndex={tab === k ? 0 : -1} className={tab === k ? 'on' : ''} onClick={() => onTab(k)}>{label}</button>+ const tb = (k: SetupTab, icon: React.ReactNode, label: React.ReactNode) => (+ <button type="button" role="tab" aria-selected={tab === k} tabIndex={tab === k ? 0 : -1} className={tab === k ? 'on' : ''} onClick={() => onTab(k)}>{icon}{label}</button>);const act = (label: string, icon: React.ReactNode, onClick?: () => void, primary = false) => (<button type="button" className={`btn small ag-act${primary ? ' primary' : ''}`} aria-label={label} title={label}onClick={onClick}>{icon}<span className="ag-act-l">{label}</span></button>);return (- <header className="ag-bar">- {/* the name's side: an equal share of the bar with the action's side, so the tabs sit in its middle */}+ <header className="ag-bar ag-rt"><div className="ag-lft"><Link className="ag-back" href="/studio" aria-label="Back to Harness Studio" title="Harness Studio">{BACK_IC}</Link><div className="ag-ident">@@ -80,24 +79,20 @@ export function AgentHead({ r, tab, onTab, onSetUpApp, dirty }: {<div className={`ag-l2${logo ? ' has-logo' : ''}`}>{logo ? <img className="h-logo" src={logo} alt="" aria-hidden="true" title={r.baseName} /> : null}<span className="ag-h">{r.baseName}</span>{model ? <><span className="sep" aria-hidden="true">·</span><span className="mono ag-m" title={model}>{model}</span></> : null}- <span className="sep sep-id" aria-hidden="true">·</span>- {/* the Harness ID, cut in its middle when the line runs short: its start, then its last six */}- <span className="hid ag-hid"><span className="mono ag-id" title={r.h.id}><span className="ag-id-a">{r.h.id.slice(0, -6)}</span><span className="ag-id-b">{r.h.id.slice(-6)}</span></span>- <button type="button" className="icon-btn xs" aria-label="Copy Harness ID" title={`Copy Harness ID ${r.h.id}`} onClick={() => void copy(r.h.id)}>{COPY}</button>- </span></div></div></div>- <div ref={tabsRef} className="tabs inline ag-tabs" role="tablist" onKeyDown={(e) => tabKeys(e, SETUP_TABS, tab, (k) => { refocusTab = true; onTab(k); })}>- {tb('tasks', 'Tasks')}- {tb('settings', <>Settings{dirty ? <i className="dirty-dot" role="img" aria-label="Unsaved changes" /> : null}</>)}- </div><div className="ag-right">{/* the setup's two actions: where it runs (Deploy to Cloud), and connecting your app to it- (Set up the app, the primary one). On a phone each folds to its icon (its words stay its- name and tooltip), so the setup's name keeps the row */}+ (Connect your app, the primary one). They sit before the tabs, so Tasks · Settings keep the+ bar's right end. On a phone each folds to its icon (its words stay its name and tooltip),+ so the setup's name keeps the row */}<DeployCloud id={r.h.id} name={r.h.name} />- {act('Set up the app', PLUG_IC, onSetUpApp, true)}+ {act('Connect your app', PLUG_IC, onSetUpApp, true)}+ </div>+ <div ref={tabsRef} className="tabs inline ag-tabs" role="tablist" onKeyDown={(e) => tabKeys(e, SETUP_TABS, tab, (k) => { refocusTab = true; onTab(k); })}>+ {tb('tasks', TASKS_IC, 'Tasks')}+ {tb('settings', SETTINGS_IC, <>Settings{dirty ? <i className="dirty-dot" role="img" aria-label="Unsaved changes" /> : null}</>)}</div></header>);diff --git a/ui/src/components/hrui/setup/settingsModel.brickNav.test.tsx b/ui/src/components/hrui/setup/settingsModel.brickNav.test.tsxindex 4189949f..c2528f4c 100644--- a/ui/src/components/hrui/setup/settingsModel.brickNav.test.tsx+++ b/ui/src/components/hrui/setup/settingsModel.brickNav.test.tsx@@ -1,6 +1,6 @@/** @jest-environment jsdom */-// The setup page hears the Next bar's Set up the app (start/NextBar SET_UP_APP_EVENT) where it hears its-// Agent stack's bricks (useBrickNav), and opens its Set up the app sheet; once the page has gone, it no+// The setup page hears the Next bar's Connect your app (start/NextBar SET_UP_APP_EVENT) where it hears its+// Agent stack's bricks (useBrickNav), and opens its Connect your app sheet; once the page has gone, it no// longer listens.import { act } from 'react';import { createRoot, type Root } from 'react-dom/client';@@ -19,7 +19,7 @@ let el: HTMLElement;beforeEach(() => { el = document.createElement('div'); document.body.appendChild(el); root = createRoot(el); });afterEach(() => { el.remove(); });-test('Set up the app from the Next bar opens the page’s sheet, and only while the page is there', () => {+test('Connect your app from the Next bar opens the page’s sheet, and only while the page is there', () => {const onSetUpApp = jest.fn();act(() => root.render(<Page onSetUpApp={onSetUpApp} />));act(() => { window.dispatchEvent(new CustomEvent(SET_UP_APP_EVENT, { detail: { id: 'chrn_a' } })); });diff --git a/ui/src/components/hrui/setup/settingsModel.ts b/ui/src/components/hrui/setup/settingsModel.tsindex 3f9a8b5c..fbf24ec6 100644--- a/ui/src/components/hrui/setup/settingsModel.ts+++ b/ui/src/components/hrui/setup/settingsModel.ts@@ -124,7 +124,7 @@ export function brickLayer(tw: string): LayerKey | null {/** A click on a brick or part of the setup page's Agent stack opens the layer of Settings it is (a* part, its own tab of Capabilities, even one the setup has none of yet). The first test's Next bar- * (start/NextBar) asks for the app's setup: Set up the app. */+ * (start/NextBar) asks for the app's setup: Connect your app. */export function useBrickNav(o: { onLayer: (k: LayerKey, cap?: CapTab) => void; onSetUpApp?: () => void }) {const ref = useRef(o);ref.current = o;diff --git a/ui/src/components/hrui/setups.ts b/ui/src/components/hrui/setups.tsindex 96538966..58d20388 100644--- a/ui/src/components/hrui/setups.ts+++ b/ui/src/components/hrui/setups.ts@@ -183,10 +183,16 @@ export function pageSig(page: { sessions: TraceCard[]; cursor: string }): string[c.session_id, c.status, c.finished_at, c.last_response_id].join(':')).join('|');}+/** The server's row for a setup's base, found by the base's id or by the backend a record made through the API may+ * carry in its place (`claude` for claude-code). */+function serverBase(h: CustomHarness, bases: Record<string, BaseInfo> | null): BaseInfo | null {+ return bases?.[oobById(h.base)?.id || h.base] || null;+}+/** The agent harness's name as the catalog spells it ("Hermes"); a record made through the API may* carry its id as its label ("hermes"), so the label only stands in when the catalog has no name. */function nameOfBase(h: CustomHarness, bases: Record<string, BaseInfo> | null): string {- return bases?.[h.base]?.label || oobById(h.base)?.name || h.baseLabel || h.base;+ return serverBase(h, bases)?.label || oobById(h.base)?.name || h.baseLabel || h.base;}/** A setup's tasks of the last day read again, from its newest page on: null when that page reads@@ -410,7 +416,7 @@ export function useSetups(opts: { live?: boolean; scope?: string } = {}): {const start: RowSrc[] = list.map((h) => {const was = prev.get(h.id), k = knownTasks.get(h.id);return {- h, baseName: nameOfBase(h, bases), base: bases?.[h.base] || null,+ h, baseName: nameOfBase(h, bases), base: serverBase(h, bases),binding: was ? was.binding : hasPlugsEntry(h) ? undefined : null,cards: was?.cards ?? k?.cards ?? [], capped: was?.capped ?? k?.capped ?? false, sig: was?.sig ?? k?.sig ?? null,at: 0, known: !!(was?.known || k), failed: false,@@ -598,14 +604,14 @@ export function useSetup(id: string): { row: SetupRow | null; cards: TraceCard[]again.current.n = 0;knownTasks.set(id, { cards: day.m.cards, capped: day.m.capped, sig: day.m.sig });setCards(day.m.cards);- setRow(rowOf(h, baseName, day.m.cards, day.m.capped, plugs, bases?.[h.base] || null));+ setRow(rowOf(h, baseName, day.m.cards, day.m.capped, plugs, serverBase(h, bases)));return;}// the read failed: the last one that answered in this tab stands (none: nothing is claimed), and// the setup is read again shortlyconst k = knownTasks.get(id);if (k) setCards(k.cards);- setRow({ ...rowOf(h, baseName, k?.cards || [], k?.capped || false, plugs, bases?.[h.base] || null), tasksKnown: !!k, readFailed: true });+ setRow({ ...rowOf(h, baseName, k?.cards || [], k?.capped || false, plugs, serverBase(h, bases)), tasksKnown: !!k, readFailed: true });const A = again.current;const ms = Math.min(RETRY_MAX_MS, RETRY_FIRST_MS * 2 ** A.n);A.n += 1;diff --git a/ui/src/components/hrui/shop/KitTry.tsx b/ui/src/components/hrui/shop/KitTry.tsxindex 602fad2d..8efa47c2 100644--- a/ui/src/components/hrui/shop/KitTry.tsx+++ b/ui/src/components/hrui/shop/KitTry.tsx@@ -12,7 +12,7 @@// The Trace is the shared trace view (trace/TraceView): each event's time counts from its own// turn's start (a kit's task runs turn after turn for hours), and a step's detail opens over the// Trace panel. "Make it yours" stays at the foot of the panel, and Launch to your users opens the-// design's starter sheet (Set up the app, starter: the coding agent takes the kit's app from the+// design's starter sheet (Connect your app, starter: the coding agent takes the kit's app from the// starter-kit repository, in that repository's own steps), as the design's launchKit does, rather// than leaving the page.import Link from 'next/link';@@ -189,7 +189,7 @@ export function KitTryPage({ kitId }: { kitId: string }) {// without one the header names nothing rather than the suggestionsetKit({ ...kit, launched: true, harnessId: r.harnessId || kit.harnessId, runningOn: r.runningOn });// launched to users: a setup just made, opened on its Tasks like every one (start/open.ts); its- // header's Set up the app holds the kit's starter steps+ // header's Connect your app holds the kit's starter stepsconst hid = r.harnessId || kit.harnessId;if (mode === 'launch' && hid) { openNewSetup(router, { id: hid }); return; }if (mode === 'reconnect') { toast('Database connected.'); checked.current = false; setFrameKey((n) => n + 1); return; }diff --git a/ui/src/components/hrui/start/BuildPage.tsx b/ui/src/components/hrui/start/BuildPage.tsxindex 155aff42..bff67772 100644--- a/ui/src/components/hrui/start/BuildPage.tsx+++ b/ui/src/components/hrui/start/BuildPage.tsx@@ -15,7 +15,7 @@ import { AgentComposer, AgentConversation, WorkingIndicator } from 'reifyui/agenimport type { CustomHarness } from '@/lib/harness';import { harnessLogoSrc } from '@/components/HarnessLogo';import { rowOf } from '../setups';-import { BACK_IC, StackPanel, useSideOff } from '../setup/parts';+import { BACK_IC, SETTINGS_IC, StackPanel, TASKS_IC, useSideOff } from '../setup/parts';import { NewTaskHead } from '../setup/TaskDetail';import { harnessMark } from '../setup/AgentTurns';import { NewSetup } from '../NewSetup';@@ -80,7 +80,9 @@ export function BuildPage() {const now = b.phase === 'composing' ? <><b>Setting up</b> · your harness</> : b.phase === 'saving' ? <><b>Saving</b> · your setup</> : null;return (<div className="tk-page">- <header className="ag-bar">+ {/* the setup page's own bar (setup/parts AgentHead): Tasks · Settings at its right end with their icons, the same+ layout while it builds, never its own. The setup's actions join it once the setup exists, before the tabs */}+ <header className="ag-bar ag-rt"><div className="ag-lft"><Link className="ag-back" href="/studio" aria-label="Back to Harness Studio" title="Harness Studio">{BACK_IC}</Link><div className="ag-ident">@@ -91,11 +93,11 @@ export function BuildPage() {</div></div></div>+ {/* Settings opens once the setup exists: until then Tasks is the one tab in the Tab order and the arrows have nowhere to go */}<div className="tabs inline ag-tabs" role="tablist">- <button type="button" role="tab" aria-selected className="on">Tasks</button>- <button type="button" role="tab" aria-selected={false} disabled>Settings</button>+ <button type="button" role="tab" aria-selected tabIndex={0} className="on">{TASKS_IC}Tasks</button>+ <button type="button" role="tab" aria-selected={false} tabIndex={-1} disabled>{SETTINGS_IC}Settings</button></div>- <div className="ag-right" /></header><div className="tk-split has-side show-d"><div className="tk-l">diff --git a/ui/src/components/hrui/start/NextBar.test.tsx b/ui/src/components/hrui/start/NextBar.test.tsxindex ede7eab3..dc3d1270 100644--- a/ui/src/components/hrui/start/NextBar.test.tsx+++ b/ui/src/components/hrui/start/NextBar.test.tsx@@ -1,8 +1,8 @@/** @jest-environment jsdom */// The Next card under a new setup's first test (Richard, 2026-10-19: the "nx2" design). Your app (a// brick still to build) and the setup by its own name (a built brick) at the two ends, the task going-// over and the result coming back between them, Set up the app under the wires. Its button opens the-// setup page's Set up the app sheet.+// over and the result coming back between them, Connect your app under the wires. Its button opens the+// setup page's Connect your app sheet.import { act } from 'react';import { createRoot, type Root } from 'react-dom/client';@@ -46,7 +46,7 @@ describe('the Next card', () => {// the wires: the task goes over, the result comes backexpect(card.querySelector('.nx-wire .go')?.textContent).toBe('task');expect(card.querySelector('.nx-wire .back')?.textContent).toBe('result');- expect(card.querySelector('.nx-mid button')?.textContent).toBe('Set up the app');+ expect(card.querySelector('.nx-mid button')?.textContent).toBe('Connect your app');// no dash anywhere in its words, and this edition is not the hosted serviceexpect(card.textContent).not.toMatch(/[-–—]/);expect(card.textContent).not.toContain('Cloud');@@ -73,7 +73,7 @@ describe('the Next card', () => {expect(card.querySelector('.nx-flow')?.getAttribute('aria-label')).toContain(`sends each task to ${long}.`);});- test('Set up the app asks the setup’s page for its Set up the app sheet', () => {+ test('Connect your app asks the setup’s page for its Connect your app sheet', () => {const heard = jest.fn();const on = (e: Event) => heard((e as CustomEvent).detail);window.addEventListener(SET_UP_APP_EVENT, on);diff --git a/ui/src/components/hrui/start/NextBar.tsx b/ui/src/components/hrui/start/NextBar.tsxindex b5d6811e..36d8047f 100644--- a/ui/src/components/hrui/start/NextBar.tsx+++ b/ui/src/components/hrui/start/NextBar.tsx@@ -3,12 +3,12 @@// from the hosted console 10-22, "下面 set up the app 的动画"): once that test has finished, it shows what// comes next. At the left end your app, a brick still to build, built by your coding agent; at the// right end the setup, a built brick, by its own name; between them the task going over and the result-// coming back, and under the wires Set up the app. Pressing it asks the setup's page for its Set up the-// app sheet (SET_UP_APP_EVENT, heard where the page's Agent stack bricks are, settingsModel.useBrickNav),+// coming back, and under the wires Connect your app. Pressing it asks the setup's page for its Connect+// your app sheet (SET_UP_APP_EVENT, heard where the page's Agent stack bricks are, settingsModel.useBrickNav),// so the card needs nothing from the page.import { Fragment } from 'react';-/** Fired on window to open the setup page's Set up the app sheet. */+/** Fired on window to open the setup page's Connect your app sheet. */export const SET_UP_APP_EVENT = 'hrui:set-up-app';// The design's brick: the same art system as the bricks elsewhere (bricks.tsx partIcon, tower.ts),@@ -59,7 +59,7 @@ export function NextBar({ id, name }: { id: string; name: string }) {<div className="nx-mid"><div className="nx-wire" aria-hidden="true"><i className="go"><em>task</em></i><i className="back"><em>result</em></i></div><button type="button" className="btn small primary"- onClick={() => window.dispatchEvent(new CustomEvent(SET_UP_APP_EVENT, { detail: { id } }))}>Set up the app</button>+ onClick={() => window.dispatchEvent(new CustomEvent(SET_UP_APP_EVENT, { detail: { id } }))}>Connect your app</button></div><div className="nx-end nx-setup" aria-hidden="true"><Brick state="built" />diff --git a/ui/src/components/hrui/start/sheets.test.tsx b/ui/src/components/hrui/start/sheets.test.tsxindex a9327ac5..3581dfb9 100644--- a/ui/src/components/hrui/start/sheets.test.tsx+++ b/ui/src/components/hrui/start/sheets.test.tsx@@ -4,7 +4,7 @@// step list, with the same copy step (Copy prompt on the right of the row under the prompt, no link// that opens Claude Code or Codex) and the same key step (the name row at once, a new key made in the// current workspace and shown once; each time the sheet opens it starts over). None offers to reuse a-// key the app already has. Set up the app is two steps and claims nothing it cannot read (the task cards+// key the app already has. Connect your app is two steps and claims nothing it cannot read (the task cards// do not say a task came from an app); no number it did not read is shown.import { act, type ReactElement } from 'react';import { createRoot, type Root } from 'react-dom/client';@@ -148,7 +148,7 @@ describe.each(SHEETS)('%s', (title, sheet, base) => {});});-describe('Set up the app', () => {+describe('Connect your app', () => {it('says who builds and what runs behind it, true for each prompt, and names no hosted service', async () => {await draw(SHEETS[0][1]);expect(document.querySelector('.sub')?.textContent).toBe('Your coding agent adds Support replies to your app. This instance runs Hermes behind it, and every task your app sends shows in its task list.');diff --git a/ui/src/lib/harness-base-alias.test.ts b/ui/src/lib/harness-base-alias.test.tsnew file mode 100644index 00000000..3c84b553--- /dev/null+++ b/ui/src/lib/harness-base-alias.test.ts@@ -0,0 +1,29 @@+/** @jest-environment jsdom */+// A setup made through the API can name its base by the backend it runs (`claude`); it is named and drawn as that base all+// the same (as on the hosted console, where such setups read "claude", with no mark, on the setup list and cards).++jest.mock('@/lib/hfetch', () => ({ harnessFetch: jest.fn() }));+jest.mock('@/lib/auth', () => ({ getSession: () => ({ orgId: 'org.a', member: { email: '[email protected]' } }) }));+jest.mock('@/lib/workspace', () => ({ workspaceHeaders: () => ({}), appendWorkspaceQuery: () => {} }));++import { OOB, oobById } from '@/lib/harness';+import { BACKEND_BASE, harnessLogoSrc } from '@/components/HarnessLogo';++test('every base whose backend is named apart from it is found and drawn by that backend', () => {+ const apart = OOB.filter((o) => o.backend !== o.id);+ expect(apart.length).toBeGreaterThan(0);+ for (const o of apart) {+ const backend = String(o.backend);+ expect(oobById(backend)?.id).toBe(o.id);+ expect(BACKEND_BASE[backend]).toBe(o.id);+ expect(harnessLogoSrc(backend)).toBe(harnessLogoSrc(o.id));+ }+ expect(oobById('claude')?.name).toBe('Claude Code');+ expect(harnessLogoSrc('claude')).toBe('/logos/claude.png');+});++test('a base id still wins over a backend of the same name, and an unknown one stays unknown', () => {+ expect(oobById('codex')?.id).toBe('codex');+ expect(oobById('no-such-base')).toBeNull();+ expect(harnessLogoSrc('no-such-base')).toBe('');+});diff --git a/ui/src/lib/harness.ts b/ui/src/lib/harness.tsindex 4f852fb1..8a48cc49 100644--- a/ui/src/lib/harness.ts+++ b/ui/src/lib/harness.ts@@ -283,7 +283,9 @@ export function offeredOob(bases: Record<string, BaseInfo> | null): OobHarness[]return OOB.filter((o) => o.status === 'ready' && !!bases?.[o.id]);}-export const oobById = (id: string) => OOB.find((o) => o.id === id) || null;+/** A base by its id, or by the backend it runs: the gateway takes either for a setup's base, so a setup made through the+ * API can carry `claude` where the console names the base `claude-code` (its setups read "claude", with no mark). */+export const oobById = (id: string) => OOB.find((o) => o.id === id) || OOB.find((o) => o.backend === id) || null;// ── model catalog: the GATEWAY owns it, this file does not ────────────────────────────// The `models` / `defaultModel` fields above are the pre-fetch placeholder only (so first paint