Skip to content

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.

feat(kits): reconnect a database from the card, and drop the planning notes from the repo

richard-epsillaaba7c355a591
diff --git a/ui/PRODUCT.md b/ui/PRODUCT.md
deleted file mode 100644
index e8f0aec3..00000000
--- a/ui/PRODUCT.md
+++ /dev/null
@@ -1,46 +0,0 @@
-# Harness Router
-
-A new product built on AgentStudio. "Build agent features into your app without building the
-backend. One API routes your app to harnesses like Codex, Claude Code, OpenClaw, and Hermes."
-
-Separate frontend app, on its own subdomain (`harnessrouter.epsilla.com`, DNS pointed by the
-owner), reusing AgentStudio's design tokens + UI components + auth + Traces. Backed by a new
-VectorGraph tenant (schema TBD, iterated with the owner).
-
-## Locked decisions (2026-06-22, with the owner)
-- **MVP = core loop first**: Harnesses (clone) → Workbench Config&Preview with LIVE chat → Traces,
- then API tab + landing. Marketplace, MCP/Skills "Add", OpenClaw/Hermes stubbed.
-- **Auth = reuse AgentStudio** (same engine, JWT, orgs). Own login form on the subdomain; a Harness
- Router user IS an AgentStudio member. (Separate localStorage origin, so its own session.)
-- **Backends v1 = Codex + Claude Code real** (gateway/runner), **OpenClaw + Hermes "coming soon"**.
-- **Headline routing API in v1 = yes**, a minimal public key-auth invoke (pick harness → session →
- turn → poll). The value prop ("one API") must be real.
-- Brand = deep iris `#42309C` (override the mock's brighter blue). MCP/Skills shown but "Add" disabled
- in v1 (network MCP blocked by sandbox egress; skills wiring undefined). Marketplace/Docs = placeholders.
- Clone = independent copy; Discard = revert unsaved; Save = applies to next run. Per-org API keys.
-
-## Architecture
-- `harnessrouter/` is a 2nd Next 15 app (monorepo sibling of `frontend/`), deploy as its own unit on
- the subdomain. Copies the studio design system (`src/studio/styles` tokens, `src/components/ui`,
- `src/studio/lib` dialog/icons, `src/studio/traces`) verbatim for v1 (extract a shared package later).
-- BFF proxies: `/api/engine` → workflow-engine (auth), `/api/harness` → harness-gateway (sessions/turn/
- traces). Auth via the copied `src/lib/auth.ts` (login/getSession/authFetch).
-- Data: out-of-box catalog is static in `src/lib/harness.ts` (will read runner `/backends`). Custom
- harnesses persist client-side for the skeleton; `src/lib/harness.ts` CRUD is the single seam to swap
- for the VectorGraph-tenant API.
-
-## Status (done)
-- App scaffold builds clean + screenshot-verified: landing (deep iris), login, auth-gated shell with
- top nav, Harnesses page (matches wireframe: Codex/Claude Code clonable, OpenClaw/Hermes "soon",
- custom create/clone/delete), Workbench skeleton (Config&Preview 3-pane + API tab + Traces tab),
- Marketplace/Docs/Pricing. Committed.
-
-## Next phases
-1. **Deploy** to the VM (systemd service + nginx server block for harnessrouter.epsilla.com); owner points DNS.
-2. **VectorGraph tenant** + `CustomHarness` schema + CRUD; swap `src/lib/harness.ts` to the real API.
-3. **Live chat** in Workbench: `POST /api/harness/sessions` → `/turn` → poll; inject default model +
- system prompt. SPIKE FIRST: system-prompt injection mechanism (Claude Code has no flag) — the one
- real technical risk.
-4. **Traces tab**: tag sessions with harness_id at create; reuse `TracesMain` scoped to the harness.
-5. **Public invoke API** + API-key mint/revoke (per-org); the API tab docs reflect it.
-6. **"Harness Router" Space** under Epsilla's org with this spec + the wireframes for ops.
diff --git a/ui/src/app/(app)/kits/page.tsx b/ui/src/app/(app)/kits/page.tsx
index 4ec5aa52..1beab505 100644
--- a/ui/src/app/(app)/kits/page.tsx
+++ b/ui/src/app/(app)/kits/page.tsx
@@ -219,7 +219,17 @@ export default function KitsPage() {
{k.launched && k.harnessId && (
<a className="kit-link" href={`/harnesses/${k.harnessId}`}>Harness settings</a>
)}
- <span className="kit-actions-spacer" />
+ {/* Reconnect. Launch is idempotent, and a connection string sent to a kit that
+ already exists means "connect this": that is how you move a kit to another
+ database, or recover from a password change. Without this the dialog is
+ unreachable the moment a kit is running, because the button turns into Open
+ and the kit's own app points at "this kit's settings", which was a place that
+ did not exist. Only for kits that read a database. */}
+ {k.launched && k.database && (
+ <button className="kit-link kit-link-button" type="button"
+ onClick={() => setPicking(k)}>Reconnect database</button>
+ )}
+ <span className="kit-actions-spacer" />
<button className="button primary" type="button" disabled={busy === k.id}
onClick={() => (k.launched ? openApp(k.route || `/kits/${k.id}`) : setPicking(k))}>
{busy === k.id ? 'Launching…' : k.launched ? 'Open' : 'Launch'}
@@ -278,7 +288,12 @@ function LaunchDialog({ kit, bases, busy, onClose, onLaunch }: {
// builds would have nothing to read. Relaunching keeps what it already reads, so a blank field
// is fine once it has been launched.
const missing = Boolean(kit.database) && !kit.launched && !db.connectionString.trim();
- const canLaunch = (custom ? Boolean(cBase && cModel) : Boolean(sel)) && !missing;
+ // Reconnecting does not choose a runtime: the server keeps the harness it already made and
+ // applies only the connection, so requiring a choice here would disable the button behind a
+ // picker that is deliberately not on screen.
+ const canLaunch = kit.launched
+ ? Boolean(db.connectionString.trim())
+ : (custom ? Boolean(cBase && cModel) : Boolean(sel)) && !missing;
function go() {
if (custom) { onLaunch(cBase, cModel, db); return; }
@@ -293,17 +308,18 @@ function LaunchDialog({ kit, bases, busy, onClose, onLaunch }: {
<button className="kit-dialog-x" type="button" onClick={onClose} aria-label="Close">
<iconify-icon icon="tabler:x"></iconify-icon>
</button>
- <h2 id="kit-launch-title">Launch {kit.title}</h2>
- <p className="kit-dialog-sub">Choose what it runs on. You can change this later in the
- Harness settings.</p>
+ <h2 id="kit-launch-title">{kit.launched ? `Reconnect ${kit.title}` : `Launch ${kit.title}`}</h2>
+ <p className="kit-dialog-sub">{kit.launched
+ ? 'Point it at a different database, or give it a new password for the one it already reads.'
+ : 'Choose what it runs on. You can change this later in the Harness settings.'}</p>
- {nothingAvailable && !custom && (
+ {!kit.launched && nothingAvailable && !custom && (
<div className="hr-error" role="alert">
None of these can run yet — connect a provider on the Integrations page first.
</div>
)}
- {!custom && (
+ {!kit.launched && !custom && (
<div className="kit-choices">
{kit.choices.map((c) => {
const id = `${c.base}/${c.model}`;
@@ -375,7 +391,7 @@ function LaunchDialog({ kit, bases, busy, onClose, onLaunch }: {
<span className="kit-dialog-spacer" />
<button className="button" type="button" onClick={onClose}>Cancel</button>
<button className="button primary" type="button" disabled={busy || !canLaunch} onClick={go}>
- {busy ? 'Launching…' : 'Launch'}
+ {busy ? (kit.launched ? 'Connecting…' : 'Launching…') : (kit.launched ? 'Reconnect' : 'Launch')}
</button>
</div>
</div>
diff --git a/ui/src/app/hr.css b/ui/src/app/hr.css
index d8172c57..c1589891 100644
--- a/ui/src/app/hr.css
+++ b/ui/src/app/hr.css
@@ -861,6 +861,18 @@ body.hr-resizing iframe { pointer-events: none; }
}
.kit-actions-spacer { flex: 1; }
.kit-link { font-size: 12.5px; color: var(--muted); text-decoration: none; }
+
+/* A link that performs an action rather than navigating. Same look as .kit-link so the two
+ footer affordances read as siblings, but a <button> because it opens a dialog: a link that
+ goes nowhere is a link screen readers and middle-clicks both get wrong. */
+.kit-link-button {
+ background: none;
+ border: 0;
+ padding: 0;
+ font: inherit;
+ cursor: pointer;
+}
+
.kit-link:hover { color: var(--ink); text-decoration: underline; }
.kit-actions .button { display: inline-flex; align-items: center; gap: 7px; }
.kit-actions .button iconify-icon { font-size: 15px; }