Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions apps/web-control-plane/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
async function loadProjection(name) {
const response = await fetch(`/api/projections/${name}`);
if (!response.ok) {
throw new Error(`Failed to load projection ${name}: ${response.status}`);
}
const body = await response.json();
if (!body.ok) {
throw new Error(body.error || `Projection ${name} returned an error.`);
}
return body.projection;
}

function renderJson(target, value) {
target.textContent = JSON.stringify(value, null, 2);
}

function renderSummaryCards(target, summary) {
target.innerHTML = '';
for (const [key, value] of Object.entries(summary || {})) {
const card = document.createElement('div');
card.className = 'card';
card.innerHTML = `<h3>${key}</h3><p>${String(value)}</p>`;
target.appendChild(card);
}
}

async function boot() {
const root = document.getElementById('projection-root');
const summaryRoot = document.getElementById('projection-summary');
const projectionName = document.body.dataset.projection;
if (!root || !summaryRoot || !projectionName) return;
try {
const projection = await loadProjection(projectionName);
renderSummaryCards(summaryRoot, projection.summary || projection.projections || {});
renderJson(root, projection);
} catch (error) {
root.textContent = error instanceof Error ? error.message : String(error);
}
}

window.addEventListener('DOMContentLoaded', () => {
void boot();
});
14 changes: 14 additions & 0 deletions apps/web-control-plane/autonomy-health.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Autonomy Health</title>
<link rel="stylesheet" href="/control-plane/style.css" />
<script src="/control-plane/app.js" defer></script>
</head>
<body data-projection="autonomy-health">
<header><div class="nav"><a href="/control-plane">← Control Plane</a></div><h1>Autonomy Health</h1></header>
<main><div id="projection-summary" class="cards"></div><pre id="projection-root"></pre></main>
</body>
</html>
14 changes: 14 additions & 0 deletions apps/web-control-plane/federation-status.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Federation Status</title>
<link rel="stylesheet" href="/control-plane/style.css" />
<script src="/control-plane/app.js" defer></script>
</head>
<body data-projection="federation-status">
<header><div class="nav"><a href="/control-plane">← Control Plane</a></div><h1>Federation Status</h1></header>
<main><div id="projection-summary" class="cards"></div><pre id="projection-root"></pre></main>
</body>
</html>
26 changes: 26 additions & 0 deletions apps/web-control-plane/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>WorkGraph Control Plane</title>
<link rel="stylesheet" href="/control-plane/style.css" />
</head>
<body>
<header>
<h1>WorkGraph Operator Control Plane</h1>
<p class="muted">Operator-facing projections for dispatch, transport, federation, triggers, autonomy, and missions.</p>
</header>
<main>
<div class="cards">
<div class="card"><h2><a href="/control-plane/run-health">Run Health</a></h2><p>Active runs, stale runs, and failed reconciliations.</p></div>
<div class="card"><h2><a href="/control-plane/risk-dashboard">Risk Dashboard</a></h2><p>Blocked threads, escalations, and policy violations.</p></div>
<div class="card"><h2><a href="/control-plane/mission-progress">Mission Progress</a></h2><p>Mission completion and milestones.</p></div>
<div class="card"><h2><a href="/control-plane/transport-health">Transport Health</a></h2><p>Outbox depth, dead-letter state, and delivery success.</p></div>
<div class="card"><h2><a href="/control-plane/federation-status">Federation Status</a></h2><p>Remote workspace compatibility and sync status.</p></div>
<div class="card"><h2><a href="/control-plane/trigger-health">Trigger Health</a></h2><p>Trigger states, cooldowns, and errors.</p></div>
<div class="card"><h2><a href="/control-plane/autonomy-health">Autonomy Health</a></h2><p>Autonomy daemon status and heartbeat.</p></div>
</div>
</main>
</body>
</html>
14 changes: 14 additions & 0 deletions apps/web-control-plane/mission-progress.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Mission Progress</title>
<link rel="stylesheet" href="/control-plane/style.css" />
<script src="/control-plane/app.js" defer></script>
</head>
<body data-projection="mission-progress">
<header><div class="nav"><a href="/control-plane">← Control Plane</a></div><h1>Mission Progress</h1></header>
<main><div id="projection-summary" class="cards"></div><pre id="projection-root"></pre></main>
</body>
</html>
14 changes: 14 additions & 0 deletions apps/web-control-plane/risk-dashboard.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Risk Dashboard</title>
<link rel="stylesheet" href="/control-plane/style.css" />
<script src="/control-plane/app.js" defer></script>
</head>
<body data-projection="risk-dashboard">
<header><div class="nav"><a href="/control-plane">← Control Plane</a></div><h1>Risk Dashboard</h1></header>
<main><div id="projection-summary" class="cards"></div><pre id="projection-root"></pre></main>
</body>
</html>
14 changes: 14 additions & 0 deletions apps/web-control-plane/run-health.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Run Health</title>
<link rel="stylesheet" href="/control-plane/style.css" />
<script src="/control-plane/app.js" defer></script>
</head>
<body data-projection="run-health">
<header><div class="nav"><a href="/control-plane">← Control Plane</a></div><h1>Run Health</h1></header>
<main><div id="projection-summary" class="cards"></div><pre id="projection-root"></pre></main>
</body>
</html>
49 changes: 49 additions & 0 deletions apps/web-control-plane/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
body {
font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
margin: 0;
background: #0b1020;
color: #eef2ff;
}

a {
color: #93c5fd;
}

header, main {
max-width: 1200px;
margin: 0 auto;
padding: 24px;
}

.cards {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
gap: 16px;
}

.card {
background: #16203a;
border: 1px solid #334155;
border-radius: 12px;
padding: 16px;
}

.nav {
display: flex;
flex-wrap: wrap;
gap: 12px;
margin-bottom: 24px;
}

pre {
background: #020617;
border: 1px solid #334155;
border-radius: 12px;
padding: 16px;
overflow: auto;
white-space: pre-wrap;
}

.muted {
color: #94a3b8;
}
14 changes: 14 additions & 0 deletions apps/web-control-plane/transport-health.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Transport Health</title>
<link rel="stylesheet" href="/control-plane/style.css" />
<script src="/control-plane/app.js" defer></script>
</head>
<body data-projection="transport-health">
<header><div class="nav"><a href="/control-plane">← Control Plane</a></div><h1>Transport Health</h1></header>
<main><div id="projection-summary" class="cards"></div><pre id="projection-root"></pre></main>
</body>
</html>
14 changes: 14 additions & 0 deletions apps/web-control-plane/trigger-health.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Trigger Health</title>
<link rel="stylesheet" href="/control-plane/style.css" />
<script src="/control-plane/app.js" defer></script>
</head>
<body data-projection="trigger-health">
<header><div class="nav"><a href="/control-plane">← Control Plane</a></div><h1>Trigger Health</h1></header>
<main><div id="projection-summary" class="cards"></div><pre id="projection-root"></pre></main>
</body>
</html>
1 change: 1 addition & 0 deletions packages/adapter-claude-code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"main": "src/index.ts",
"types": "src/index.ts",
"dependencies": {
"@versatly/workgraph-adapter-shell-worker": "workspace:*",
"@versatly/workgraph-runtime-adapter-core": "workspace:*"
}
}
6 changes: 3 additions & 3 deletions packages/adapter-claude-code/src/adapter.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
ShellSubprocessAdapter,
} from '@versatly/workgraph-runtime-adapter-core';
ShellWorkerAdapter,
} from '@versatly/workgraph-adapter-shell-worker';
import type {
DispatchAdapter,
DispatchAdapterCreateInput,
Expand All @@ -18,7 +18,7 @@ import type {
*/
export class ClaudeCodeAdapter implements DispatchAdapter {
name = 'claude-code';
private readonly shellAdapter = new ShellSubprocessAdapter();
private readonly shellAdapter = new ShellWorkerAdapter();

async create(input: DispatchAdapterCreateInput): Promise<DispatchAdapterRunStatus> {
return this.shellAdapter.create(input);
Expand Down
14 changes: 14 additions & 0 deletions packages/adapter-http-webhook/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "@versatly/workgraph-adapter-http-webhook",
"version": "0.1.0",
"private": true,
"type": "module",
"scripts": {
"typecheck": "tsc --noEmit -p tsconfig.json"
},
"main": "src/index.ts",
"types": "src/index.ts",
"dependencies": {
"@versatly/workgraph-runtime-adapter-core": "workspace:*"
}
}
Loading
Loading