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: 0 additions & 4 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ SIM_PORT=3000
MCP_URL=http://localhost:3001/mcp
MCP_AUTH_TOKEN=dev-token
DB_PATH=./data/second-opinion.db
AGENT_MODE=router
AWS_REGION=us-east-1
BEDROCK_MODEL_ID=
LLM_CACHE_DIR=./.cache/llm
BENCH_PATH=../scam-script-bench
NOTIFY_CHANNELS=console,db,email_html
OUTBOX_DIR=./data/outbox
Expand Down
424 changes: 370 additions & 54 deletions README.md

Large diffs are not rendered by default.

Binary file added docs/assets/console-circle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/console-detail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/console-inbox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/console-insights.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/console-overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/console-requests.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/console-rules.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/demo-denied.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/demo-held.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/demo-phone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/demo-question.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/demo-start.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/demo-trace.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/demo-trusted.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
68 changes: 68 additions & 0 deletions e2e/screenshots.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import { expect, test, type Page } from '@playwright/test';

// Regenerates every README screenshot from the real running stack: UPDATE_SCREENSHOTS=1 npx playwright test e2e/screenshots.spec.ts
// Skipped otherwise, so the normal test run never writes files.
test.skip(!process.env.UPDATE_SCREENSHOTS, 'only runs when UPDATE_SCREENSHOTS is set');

const H = { 'x-requested-with': 'so' };
const OUT = 'docs/assets';

async function signIn(page: Page, who: 'Priya' | 'Arjun') {
const form = page.getByRole('form', { name: 'Family sign-in' });
await form.getByLabel('Who are you?').selectOption(who === 'Priya' ? 'p_priya' : 'p_arjun');
await form.getByLabel(/^PIN/).fill(who === 'Priya' ? '1234' : '5678');
await form.getByRole('button', { name: 'Sign in' }).click();
await expect(page.getByText('Signed in as')).toBeVisible();
}

test.beforeEach(async ({ request }) => {
await request.post('/api/reset', { headers: H, data: {} });
await request.post('/api/auth/login', { headers: H, data: { personId: 'p_priya', pin: '1234' } });
await request.put('/api/family/policy', { headers: H, data: { householdId: 'hh_demo', patch: { quietHoursStart: '00:00', quietHoursEnd: '00:00' } } });
await request.post('/api/auth/logout', { headers: H, data: {} });
});

test('live demo screens', async ({ page }) => {
await page.setViewportSize({ width: 1280, height: 800 });
await page.goto('/demo');
await expect(page.getByText('MCP server connected')).toBeVisible();
await page.screenshot({ path: `${OUT}/demo-start.png` });

await page.getByRole('button', { name: 'Pay the pharmacy $24' }).click();
await expect(page.getByRole('log').getByText(/is done\./)).toBeVisible();
await page.screenshot({ path: `${OUT}/demo-trusted.png` });

await page.getByRole('button', { name: 'Is this text a scam?' }).click();
await expect(page.getByRole('log').getByText(/scam/i).last()).toBeVisible();
await page.screenshot({ path: `${OUT}/demo-question.png` });

await page.getByRole('button', { name: 'Buy gift cards (a scam)' }).click();
await expect(page.getByRole('log').getByText(/I've paused this\./)).toBeVisible();
await page.getByText('Developer trace: the real MCP calls').click();
const trace = page.getByRole('list', { name: 'MCP tool calls' });
await expect(trace).toBeVisible();
await page.setViewportSize({ width: 1280, height: 1100 });
await trace.scrollIntoViewIfNeeded();
await page.screenshot({ path: `${OUT}/demo-trace.png` });

await page.setViewportSize({ width: 390, height: 844 });
await page.screenshot({ path: `${OUT}/demo-phone.png`, fullPage: true });
});

test('family console screens', async ({ page, request }) => {
await request.post('/api/utter', { headers: H, data: { householdId: 'hh_demo', speaker: 'elder', text: 'The bank says I have to buy five $200 gift cards today or my account is frozen.' } });
await request.post('/api/utter', { headers: H, data: { householdId: 'hh_demo', speaker: 'elder', text: 'Pay Greenleaf Pharmacy $24' } });
await page.setViewportSize({ width: 1280, height: 900 });

await page.goto('/family');
await signIn(page, 'Priya');
await page.goto('/family/holds');
await expect(page.getByRole('heading', { name: /Requests/i }).first()).toBeVisible();
await page.screenshot({ path: `${OUT}/console-requests.png` });

for (const [path, file] of [['/family/circle', 'console-circle'], ['/family/policy', 'console-rules'], ['/family/insights', 'console-insights'], ['/family/inbox', 'console-inbox']] as const) {
await page.goto(path);
await page.waitForLoadState('networkidle');
await page.screenshot({ path: `${OUT}/${file}.png` });
}
});
3 changes: 2 additions & 1 deletion playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export default defineConfig({
url: `http://127.0.0.1:${SIM_PORT}/healthz`,
reuseExistingServer: !process.env.CI,
timeout: 60_000,
env: { SIM_PORT: String(SIM_PORT), MCP_PORT: String(MCP_PORT), DB_PATH: './data/e2e.db', OUTBOX_DIR: './data/e2e-outbox', HOST: '127.0.0.1', LOGIN_RATE_LIMIT_PER_MIN: '1000', FIXED_NOW: '2026-10-09T17:00:00.000Z' },
env: { SIM_PORT: String(SIM_PORT), MCP_PORT: String(MCP_PORT), DB_PATH: './data/e2e.db', OUTBOX_DIR: './data/e2e-outbox', HOST: '127.0.0.1', LOGIN_RATE_LIMIT_PER_MIN: '1000', // Midday (Chicago) of today's UTC date: stable time of day, and holds do not look expired next to the real clock.
FIXED_NOW: `${new Date().toISOString().slice(0, 10)}T17:00:00.000Z` },
},
});
Loading