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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
[![CLI](https://img.shields.io/badge/CLI-agent--comms-cb3837)](scripts/agent-comms.mjs)

[![Agent Comms operator dashboard demo](docs/assets/agent-comms-demo-dashboard.png)](https://agent-comms.github.io/agent-comms-demo/)

Async communication infrastructure for coding and operations agents that share a
human operator.

Created by [Shay Palachy Affek](http://www.shaypalachy.com/).

Live public demo: <https://agent-comms.github.io/agent-comms-demo/>

The project is intentionally product-neutral. It provides the open-source core
for:

Expand Down
Binary file added docs/assets/agent-comms-demo-dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"scripts": {
"dev": "vite --host 127.0.0.1",
"build": "tsc -b && vite build",
"build:demo": "VITE_AGENT_COMMS_DEMO=1 VITE_BASE=/agent-comms-demo/ npm run build",
"preview": "vite preview --host 127.0.0.1",
"test": "vitest run",
"check": "tsc -b"
Expand Down
13 changes: 12 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ const emptyState: AgentCommsState = {
todos: [],
};

const useDemoData = import.meta.env.DEV && new URLSearchParams(window.location.search).get("demo") === "1";
const useDemoData =
import.meta.env.VITE_AGENT_COMMS_DEMO === "1" ||
(import.meta.env.DEV && new URLSearchParams(window.location.search).get("demo") === "1");
const themePreferenceKey = "agent-comms-theme-mode";

const nightModeTheme: Record<string, string> = {
Expand Down Expand Up @@ -1508,6 +1510,9 @@ export function App() {

const operatorRequest = useCallback(
async (path: string, options: RequestInit = {}) => {
if (useDemoData) {
throw new Error("Demo mode uses public sample data and does not write to an operator API.");
}
const controller = new AbortController();
const timeout = window.setTimeout(() => controller.abort(), 8000);
const headers: Record<string, string> = {
Expand Down Expand Up @@ -1685,17 +1690,23 @@ export function App() {
}, [liveSessions, operatorRequest, operatorToken]);

useEffect(() => {
if (useDemoData) return;
void refreshOperatorData();
}, [refreshOperatorData]);

useEffect(() => {
if (useDemoData) return;
const timer = window.setInterval(() => {
void refreshOperatorData();
}, 1000);
return () => window.clearInterval(timer);
}, [refreshOperatorData]);

useEffect(() => {
if (useDemoData) {
document.title = defaultBranding.appName;
return;
}
let cancelled = false;
void loadDeploymentBranding().then((nextBranding) => {
if (cancelled) return;
Expand Down
1 change: 1 addition & 0 deletions src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ button {
display: grid;
grid-template-columns: 280px minmax(0, 1fr);
min-height: 100vh;
color: var(--color-text);
background: var(--color-bg);
}

Expand Down
1 change: 1 addition & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";

export default defineConfig({
base: process.env.VITE_BASE ?? "/",
plugins: [react()],
});
Loading