Skip to content

Commit 2f0586a

Browse files
authored
feat: add public demo site
Adds a public GitHub Pages demo build backed by sample data, publishes a README screenshot/link, and fixes top-level night-mode text inheritance.
1 parent 964f9c3 commit 2f0586a

6 files changed

Lines changed: 19 additions & 1 deletion

File tree

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@
55
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
66
[![CLI](https://img.shields.io/badge/CLI-agent--comms-cb3837)](scripts/agent-comms.mjs)
77

8+
[![Agent Comms operator dashboard demo](docs/assets/agent-comms-demo-dashboard.png)](https://agent-comms.github.io/agent-comms-demo/)
9+
810
Async communication infrastructure for coding and operations agents that share a
911
human operator.
1012

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

15+
Live public demo: <https://agent-comms.github.io/agent-comms-demo/>
16+
1317
The project is intentionally product-neutral. It provides the open-source core
1418
for:
1519

151 KB
Loading

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"scripts": {
1111
"dev": "vite --host 127.0.0.1",
1212
"build": "tsc -b && vite build",
13+
"build:demo": "VITE_AGENT_COMMS_DEMO=1 VITE_BASE=/agent-comms-demo/ npm run build",
1314
"preview": "vite preview --host 127.0.0.1",
1415
"test": "vitest run",
1516
"check": "tsc -b"

src/App.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ const emptyState: AgentCommsState = {
5252
todos: [],
5353
};
5454

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

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

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

16871692
useEffect(() => {
1693+
if (useDemoData) return;
16881694
void refreshOperatorData();
16891695
}, [refreshOperatorData]);
16901696

16911697
useEffect(() => {
1698+
if (useDemoData) return;
16921699
const timer = window.setInterval(() => {
16931700
void refreshOperatorData();
16941701
}, 1000);
16951702
return () => window.clearInterval(timer);
16961703
}, [refreshOperatorData]);
16971704

16981705
useEffect(() => {
1706+
if (useDemoData) {
1707+
document.title = defaultBranding.appName;
1708+
return;
1709+
}
16991710
let cancelled = false;
17001711
void loadDeploymentBranding().then((nextBranding) => {
17011712
if (cancelled) return;

src/styles.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ button {
4747
display: grid;
4848
grid-template-columns: 280px minmax(0, 1fr);
4949
min-height: 100vh;
50+
color: var(--color-text);
5051
background: var(--color-bg);
5152
}
5253

vite.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ import { defineConfig } from "vite";
22
import react from "@vitejs/plugin-react";
33

44
export default defineConfig({
5+
base: process.env.VITE_BASE ?? "/",
56
plugins: [react()],
67
});

0 commit comments

Comments
 (0)