Skip to content

Self-improving AI Employees for everyone

fix(home): make the employee page just the name and the conversation

trohitg0420d9d8f04e
diff --git a/CLAUDE.md b/CLAUDE.md
index 51abe884..74c15425 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -13,7 +13,7 @@ This is a React Flow-based workflow automation platform implementing n8n-inspire
| **[UI Migration Plan](./docs-internal/ARCHIVE/ui_migration_plan.md)** | *Archived.* antd → shadcn/ui migration completion log (Waves 1–10). Current state lives in [Frontend Architecture](./docs-internal/frontend_architecture.md) and [Theme System](./docs-internal/theme_system.md). |
| **[Temporal Cleanup & Resilience Plan (Waves 15-18)](./docs-internal/ARCHIVE/TEMPORAL_CLEANUP_AND_RESILIENCE_PLAN.md)** | *Archived — all four waves shipped.* 15 dead-code retirement (Redis-Streams branch in event_waiter, APScheduler cron stack, orphaned `connection_status` factory), 16 per-queue task routing (`TemporalWorkerPool`), 17 resilience hardening (cron `catchup_window`, SDK interceptors, `DEPLOYMENT_MODE`, periodic heartbeats; the one-shot LLM-step retry it records was later reverted to unlimited-with-backoff), 18 worker performance tuning. Current settings live in [Temporal Architecture](./docs-internal/TEMPORAL_ARCHITECTURE.md). |
| **[Node Allowlist](./docs-internal/node_allowlist.md)** | Single-config UI visibility — `server/config/node_allowlist.json` controls which nodes / credential categories / skill folders show in the UI. Five lists with two enforcement tiers (mode-gated allowlist + absolute blocklist). `useNodeAllowlist` hook exposes `isVisible` / `isBlocked` / `isAllowed` / `isCredentialCategoryDisabled` / `isSkillFolderDisabled`. Adding a new disabled domain = single JSON edit, no code change. |
-| **[Normal Mode (Home)](./docs-internal/normal_mode.md)** | The owner-facing landing screen: describe a job, an LLM on the server drafts a setup screen (a JSON UI spec the client parses, normalises and renders from a fixed catalogue), and Hire builds, validates, saves and starts one workflow per AI employee (`services/employees/`, graph built from `config/employee_apps.json` plus the owner's skill library and a Canvas node, and checked against `node_allowlist.json` `enabled_nodes`). Covers the screen switch (`app/`, `shellMode` / `ui_shell_mode`, `VITE_NORMAL_MODE=false` kill switch, Home shows light/dark only), the employee card, the `approvalGate` "ask me before sending" step, run records for "done today" (`machina-run-record-v1`), automatic-pause reasons, Settings (Profile fields; usage-only Billing via `get_employee_usage`; Skills, the user-skills library each new hire copies onto a Skills node; consumer Connectors with `publisher` / `verified`; Plugins, the starter bundles in `hire/starters.json`; the last three share one catalog page), the Workspace dock (an employee's Canvas board, named by the summary's `canvas_node_id`; a live Browser tab with user takeover, shared with Dev mode; Mobile shows the managed local Android phone), the "Web browser" app (read-only under "ask me first" through the tool's `ask_first_params`; while the agent waits in `request_user` the summary's `browser_request` shows Needs you and Help in browser), Talk on the employee page (a thread over the chat session whose id is the workflow id, rows written only through `services/chat_thread.py`; the talk line is chatTrigger → an agent → `chatReply` "Reply in Chat": a chat hire's own agent is its talk agent, other hires get a "Talk with {name}" agent sharing the worker's tools and skills with its own Context, and schedule hires also "Post to Talk"), Turn on Talk (for talk `off`) and Apply (while the summary's `pending_changes` is true) via `enable_employee_talk` / `apply_employee_changes`, each a restart on the saved graph through `services/deployment/restart.py`, self-extension from Talk through the Agent Builder within the Hire rule (`services/employees/policy.py`), the 3D orb, the wire contract and the `employee_lifecycle` / `approval_lifecycle` / `chat.updated` broadcasts. |
+| **[Normal Mode (Home)](./docs-internal/normal_mode.md)** | The owner-facing landing screen: describe a job, an LLM on the server drafts a setup screen (a JSON UI spec the client parses, normalises and renders from a fixed catalogue), and Hire builds, validates, saves and starts one workflow per AI employee (`services/employees/`, graph built from `config/employee_apps.json` plus the owner's skill library and a Canvas node, and checked against `node_allowlist.json` `enabled_nodes`). Covers the screen switch (`app/`, `shellMode` / `ui_shell_mode`, `VITE_NORMAL_MODE=false` kill switch, Home shows light/dark only), the employee page (only their name above the conversation; Pause is in the Workspace header), the `approvalGate` "ask me before sending" step, run records for "done today" (`machina-run-record-v1`), automatic-pause reasons, Settings (Profile fields; usage-only Billing via `get_employee_usage`; Skills, the user-skills library each new hire copies onto a Skills node; consumer Connectors with `publisher` / `verified`; Plugins, the starter bundles in `hire/starters.json`; the last three share one catalog page), the Workspace dock (an employee's Canvas board, named by the summary's `canvas_node_id`; a live Browser tab with user takeover, shared with Dev mode; Mobile shows the managed local Android phone), the "Web browser" app (read-only under "ask me first" through the tool's `ask_first_params`; while the agent waits in `request_user` the summary's `browser_request` shows Needs you and Help in browser), Talk on the employee page (a thread over the chat session whose id is the workflow id, rows written only through `services/chat_thread.py`; the talk line is chatTrigger → an agent → `chatReply` "Reply in Chat": a chat hire's own agent is its talk agent, other hires get a "Talk with {name}" agent sharing the worker's tools and skills with its own Context, and schedule hires also "Post to Talk"), Turn on Talk (for talk `off`) and Apply (while the summary's `pending_changes` is true) via `enable_employee_talk` / `apply_employee_changes`, each a restart on the saved graph through `services/deployment/restart.py`, self-extension from Talk through the Agent Builder within the Hire rule (`services/employees/policy.py`), the 3D orb, the wire contract and the `employee_lifecycle` / `approval_lifecycle` / `chat.updated` broadcasts. |
| **[Theme System](./docs-internal/theme_system.md)** | 12-way visual theme system — 2 base (light, dark) + 5 utopian (renaissance, greek, edo, steampunk, atomic) + 5 dystopian (cyber, wasteland, rot, plague, surveillance) — driven by `<html data-theme>` + per-theme CSS files in `client/src/themes/`. Token taxonomy (surface / fg / border / accent / typography / motion) in **hex + `color-mix()`**; `@theme inline` bridge maps `--color-X: var(--X)` (no `hsl()` wrapper); per-theme files own the colour hex, base.css owns the shared `--tint-*` alpha scale; action role tokens (incl. `-ink` readable text), **per-theme `--code-*` syntax tokens** (tier 6 — the code editor, console/output JSON viewers, and chat code blocks paint in each theme's own palette: keyword→trigger, string→success, number→agent, function→model, on an adaptive dark/light code surface; replaced the global dracula `--prism-*` block + dead `getPrismTokenCSS`; the `OutputPanel` JSON viewer reads the same vars), per-theme `--pulse-keyframe` animation system + `.opencompany-*` helpers in `animations.css`, decorative-layer wrappers (`.app-frame` / `.canvas-host` / `.modal-frame`), per-component decorative ornaments (panel textures + canvas decorations + node pseudo-element overlays + theme-specific keyframes), **canvas-node visual contract via `--node-color` CSS custom property** (no inline `background` / `border` on node components — base.css + per-theme CSS owns visuals; `NodeStyle` helper type at [types/NodeTypes.ts](./client/src/types/NodeTypes.ts) makes the inline custom-prop typecheck-clean), **`--node-pulse-color` separate from `--node-color`** so executing-node glow uses each theme's highest-contrast accent regardless of plugin accent (Cyber neon cyan, Surveillance REC red, Renaissance ultramarine, etc.), **`data-page-hidden` animation pause** (set by `app/usePageActivitySync.ts`, mounted in `AppShell` on both screens, while the tab is hidden or the window is blurred; base.css declares `html[data-page-hidden] *, *::before, *::after { animation-play-state: paused !important }` to prevent compositor stall on tab return), **per-theme icon glyph system** (290 inline SVG glyph strings across 29 keys × 10 themes via [themedGlyphs.ts](./client/src/assets/icons/themedGlyphs.ts) + theme-aware [NodeIcon.tsx](./client/src/assets/icons/NodeIcon.tsx)), **per-theme canvas-grid + custom cursors** via `--canvas-grid` / `--cursor-default` slots, **decorative HTML primitives** (`<SvgFilterDefs>` mounting `#ink-blot` / `#noise` / `#crt` filter IDs at app root, `<DropCap>` wrapper for Renaissance ornament rule), **parameter panel migrated to Tailwind tokens** (no `useAppTheme()` reads; section headers carry the display-typography triplet; raw `<Button>` swapped to `<ActionButton intent>`), **per-theme scrollbar webkit rules** in all 12 themes, 9-event WebAudio sound system (10 packs via `--sound-pack` token + `useSound()` hook + global hover delegate + sonner toast monkey-patch + `withSound()` HOC + `Sounds.unlock()` gesture-unlock for AudioContext autoplay-policy compliance), `@media (prefers-reduced-motion: reduce)` accessibility, 30 ms throttle on `type` / `hover`, migration recipe, anti-patterns. Read this before adding a new theme, migrating a component to the new contract, or adding a canvas-node component. |
| **[Design System Bundle](./docs-internal/design-system/IMPLEMENTATION.md)** | Canonical, vendored design-system reference (extracted from this repo; see its `IMPLEMENTATION.md` for the contract). Tokens are **hex + `color-mix()`** (`tokens/{colors,typography,spacing,motion,fonts,base}.css`) — the format the live codebase standardizes on. Includes 34 reference components (`components/`, inline-style reference only — recreate in Tailwind/shadcn idioms), full-app UI kit (`ui_kits/opencompany/index.html`), 12-theme docs (`guidelines/THEMES.md`), **the merged handoff brief (`HANDOFF.md` — glow-ladder traps, step-edge contract, toolbar layout traps, canvas-layer asymmetries, plus the recorded product amendments)**, and **the panel×theme fidelity target (`reference-mockup/Panel Theme Matrix.dc.html` — 17 panels × 12 themes, open in a browser)**. `reference/themes/` no longer vendors CSS snapshots — it points at the authoritative [client/src/themes/](./client/src/themes/). Copy token values verbatim; do not re-derive by eye. Pairs with [Theme System](./docs-internal/theme_system.md). |
| **[Schema Source of Truth RFC](./docs-internal/ARCHIVE/schema_source_of_truth_rfc.md)** | *Archived — shipped.* Backend is SSOT for node schemas, visual metadata, handlers, palette metadata, icons; `VITE_NODESPEC_BACKEND` defaults on and the frontend node definitions are gone. Plugin pattern: one `BaseNode` subclass in `server/nodes/<group>/<plugin>/__init__.py`. Wire format: `asset:<key>` / `<lib>:<brand>` / URL / emoji. Endpoint: `/api/schemas/nodes/{type}/spec.json`. Current reference: [Plugin System](./docs-internal/plugin_system.md). |
diff --git a/client/src/features/home/HomeShell.tsx b/client/src/features/home/HomeShell.tsx
index de0de535..e9319fe8 100644
--- a/client/src/features/home/HomeShell.tsx
+++ b/client/src/features/home/HomeShell.tsx
@@ -2,7 +2,7 @@
* Normal mode ("Home"): the owner-facing screen where AI employees are hired
* and supervised (design_handoff_opencompany_home, "App shell (Normal
* mode)"). The team sidebar on the left; on the right the header and the
- * current view, either hiring a new employee or one employee's card.
+ * current view, either hiring a new employee or one employee's page.
*
* The shell owns what spans views: the employee broadcasts that keep the
* team current, the orb behind the content, the Workspace dock on the
@@ -16,6 +16,7 @@
import { useLayoutEffect, useRef, useState } from 'react';
import { animate } from '@/lib/motion';
+import { cn } from '@/lib/utils';
import { useApprovalLifecycle } from './approvals/data';
import { ConnectAIDialog } from './connectAI/ConnectAIDialog';
import { useEmployeeLifecycle, useEmployeesQuery } from './data/employees';
@@ -46,7 +47,7 @@ function AsksFirstNote({ workflowId }: { workflowId: string }) {
const employee = employees?.find((item) => item.workflow_id === workflowId);
if (!employee) return null;
return (
- <p className="m-0 pt-4 text-center text-xs text-fg-muted">
+ <p className="m-0 pt-2 text-center text-xs text-fg-muted">
{employee.asks_first
? `${employee.name} asks before sending anything on your behalf.`
: `${employee.name} doesn’t ask before sending anything on your behalf.`}
@@ -96,7 +97,13 @@ export default function HomeShell() {
onScroll={(event) => setScrolled(event.currentTarget.scrollTop > HEADER_BORDER_AFTER_PX)}
className="relative z-10 flex min-h-0 flex-1 flex-col overflow-x-hidden overflow-y-auto"
>
- <div className="mx-auto flex w-full max-w-(--w-home-content) flex-1 flex-col items-center px-6 pt-2 pb-10">
+ {/* An employee's page ends at its pinned message box and one line under it. */}
+ <div
+ className={cn(
+ 'mx-auto flex w-full max-w-(--w-home-content) flex-1 flex-col items-center px-6 pt-2',
+ view.kind === 'employee' ? 'pb-3' : 'pb-10',
+ )}
+ >
<div ref={viewRef} key={viewKey} className="flex w-full flex-1 flex-col items-center">
{view.kind === 'employee' ? (
<EmployeeView workflowId={view.workflowId} onConnect={openConnect} />
@@ -108,7 +115,7 @@ export default function HomeShell() {
</div>
</div>
</main>
- <WorkspaceDock />
+ <WorkspaceDock onConnect={openConnect} />
<HomeSettings onConnect={openConnect} />
<ConnectDialog providerId={connectId} onClose={() => setConnectId(null)} />
<ConnectAIDialog />
diff --git a/client/src/features/home/__tests__/drafts.test.tsx b/client/src/features/home/__tests__/drafts.test.tsx
index e14bebe5..b8ab04a3 100644
--- a/client/src/features/home/__tests__/drafts.test.tsx
+++ b/client/src/features/home/__tests__/drafts.test.tsx
@@ -1,5 +1,5 @@
/**
- * Drafts on the employee card: Send and Discard take the draft away at once
+ * Drafts on the employee's page: Send and Discard take the draft away at once
* and bring it back if the server refuses, an edit must fit the channel,
* each click carries its own decision key, and a new draft says so.
*/
diff --git a/client/src/features/home/__tests__/employeeView.test.tsx b/client/src/features/home/__tests__/employeeView.test.tsx
index f72aa288..a275cca2 100644
--- a/client/src/features/home/__tests__/employeeView.test.tsx
+++ b/client/src/features/home/__tests__/employeeView.test.tsx
@@ -1,10 +1,11 @@
/**
- * The employee page: the card's main button (Connect goes to the provider's
- * connect dialog, Pause sends the summary's revision and says "Pausing…"
- * until the summary shows the pause, never flashing "Pause" again in
- * between), Watch live, what the card leaves out when the page already says
- * it, and the conversation under the card, which offers the same main
- * action while the employee cannot read messages.
+ * The employee page: only their name above the conversation. Their main
+ * action shows above the message box while they cannot read messages
+ * (Connect goes to the provider's connect dialog, Resume sends the
+ * summary's revision and says "Resuming…" until the summary shows them
+ * running, never flashing "Resume" again in between), never the reason
+ * they stopped; Help in browser while they wait for the owner there; and
+ * the drafts after the messages.
*/
import { beforeEach, describe, expect, it, vi } from 'vitest';
@@ -37,6 +38,8 @@ import { EmployeeView } from '../employee/EmployeeView';
import { useHomeStore } from '../state/homeStore';
import { pillToast } from '../ui/pillToast';
+const TALK_ON = { state: 'on', agent_node_id: 'w1:talk' };
+
function summary(patch: Record<string, unknown>, control: Record<string, unknown>): EmployeeSummary {
return parseEmployee({
workflow_id: 'w1',
@@ -47,7 +50,7 @@ function summary(patch: Record<string, unknown>, control: Record<string, unknown
})!;
}
-function renderCard(employee: EmployeeSummary, onConnect = vi.fn()) {
+function renderPage(employee: EmployeeSummary, onConnect = vi.fn()) {
const client = new QueryClient({ defaultOptions: { queries: { retry: false, staleTime: Infinity } } });
client.setQueryData(EMPLOYEES_QUERY_KEY, [employee]);
render(
@@ -70,98 +73,143 @@ beforeEach(() => {
});
describe('EmployeeView', () => {
+ it('shows only their name above the conversation while they work', () => {
+ actions.sendRequest.mockResolvedValue({ success: true, messages: [] });
+ const whatsapp = { app_id: 'whatsapp', provider_id: 'whatsapp', name: 'WhatsApp', connected: true, supported: true };
+ renderPage(
+ summary(
+ { status: 'working', talk: TALK_ON, task: { label: 'Now', text: 'Waiting for new WhatsApp messages' }, done_today: 2, apps: [whatsapp] },
+ { state: 'running' },
+ ),
+ );
+ expect(screen.getByRole('heading', { name: 'Maya' })).toBeInTheDocument();
+ expect(screen.getByRole('textbox', { name: 'Message Maya' })).toBeInTheDocument();
+ for (const name of ['Pause', 'Resume', 'Start', 'Watch live']) {
+ expect(screen.queryByRole('button', { name })).not.toBeInTheDocument();
+ }
+ for (const text of ['Receptionist', 'Working', 'Waiting for new WhatsApp messages', 'WhatsApp']) {
+ expect(screen.queryByText(text)).not.toBeInTheDocument();
+ }
+ expect(screen.queryByText(/done today/)).not.toBeInTheDocument();
+ });
+
it('connects the missing app through its provider', () => {
const whatsapp = { app_id: 'whatsapp', provider_id: 'whatsapp', name: 'WhatsApp', connected: false, supported: true };
- const { onConnect } = renderCard(
- summary({ status: 'ready', apps: [whatsapp], missing_apps: [whatsapp] }, { state: 'never_started' }),
+ const { onConnect } = renderPage(
+ summary({ status: 'ready', talk: TALK_ON, apps: [whatsapp], missing_apps: [whatsapp] }, { state: 'never_started' }),
);
fireEvent.click(screen.getByRole('button', { name: 'Connect WhatsApp' }));
expect(onConnect).toHaveBeenCalledWith('whatsapp');
});
- it('pauses with the summary’s revision and waits for the summary to catch up', async () => {
+ it('resumes with the summary’s revision and waits for the summary to catch up', async () => {
let done!: (status: unknown) => void;
- actions.pauseWorkflow.mockReturnValue(new Promise((resolve) => (done = resolve)));
- const { client } = renderCard(summary({ status: 'working' }, { state: 'running', revision: 7 }));
+ actions.resumeWorkflow.mockReturnValue(new Promise((resolve) => (done = resolve)));
+ const { client } = renderPage(summary({ status: 'paused', talk: TALK_ON }, { state: 'paused', revision: 7 }));
- fireEvent.click(screen.getByRole('button', { name: 'Pause' }));
- expect(actions.pauseWorkflow).toHaveBeenCalledWith('w1', 7);
- expect(screen.getByRole('button', { name: 'Pausing…' })).toBeDisabled();
+ fireEvent.click(screen.getByRole('button', { name: 'Resume' }));
+ expect(actions.resumeWorkflow).toHaveBeenCalledWith('w1', 7);
+ expect(screen.getByRole('button', { name: 'Resuming…' })).toBeDisabled();
- await act(async () => done(normalizeWorkflowControlStatus({ state: 'paused', revision: 8, generation: 1 }, 'w1')));
- // The summary still says working: keep the in-flight label.
- expect(screen.getByRole('button', { name: 'Pausing…' })).toBeInTheDocument();
+ await act(async () => done(normalizeWorkflowControlStatus({ state: 'running', revision: 8, generation: 1 }, 'w1')));
+ // The summary still says paused: keep the in-flight label.
+ expect(screen.getByRole('button', { name: 'Resuming…' })).toBeInTheDocument();
await act(async () => {
- client.setQueryData(EMPLOYEES_QUERY_KEY, [summary({ status: 'paused' }, { state: 'paused', revision: 8 })]);
+ client.setQueryData(EMPLOYEES_QUERY_KEY, [summary({ status: 'working', talk: TALK_ON }, { state: 'running', revision: 8 })]);
});
- expect(await screen.findByRole('button', { name: 'Resume' })).toBeEnabled();
+ expect(screen.queryByRole('button', { name: /^Resum/ })).not.toBeInTheDocument();
+ expect(screen.getByRole('textbox', { name: 'Message Maya' })).toBeInTheDocument();
+ });
+
+ it('offers Resume after a problem without saying what went wrong', () => {
+ const why = 'Paused after OpenCompany stopped unexpectedly. Resume when you’re ready.';
+ renderPage(summary({ status: 'attention', talk: TALK_ON, task: { label: 'Paused', text: why } }, { state: 'paused', pause_reason: 'crash' }));
+ expect(screen.queryByText(why)).not.toBeInTheDocument();
+ expect(screen.getByText('Maya is paused. They’ll read your message when you resume them.')).toBeInTheDocument();
+ expect(screen.getByRole('button', { name: 'Resume' })).toBeEnabled();
});
it('says to connect an AI model, and opens that dialog, when Start is refused for want of one', async () => {
useHomeStore.setState({ connectAIOpen: false });
actions.startEmployee.mockRejectedValue(new Error('needs_ai'));
- renderCard(summary({ status: 'ready' }, { state: 'never_started' }));
+ renderPage(summary({ status: 'ready', talk: TALK_ON }, { state: 'never_started' }));
fireEvent.click(screen.getByRole('button', { name: 'Start' }));
await waitFor(() => expect(pillToast).toHaveBeenCalledWith('Connect an AI model first.', { tone: 'error' }));
expect(useHomeStore.getState().connectAIOpen).toBe(true);
});
- it('opens the "Connect an AI model" dialog from the card', () => {
+ it('opens the "Connect an AI model" dialog from the conversation', () => {
useHomeStore.setState({ connectAIOpen: false });
- renderCard(summary({ status: 'ready', needs_ai: true }, { state: 'never_started' }));
- fireEvent.click(screen.getAllByRole('button', { name: 'Connect an AI model' })[0]);
+ renderPage(summary({ status: 'ready', talk: TALK_ON, needs_ai: true }, { state: 'never_started' }));
+ fireEvent.click(screen.getByRole('button', { name: 'Connect an AI model' }));
expect(useHomeStore.getState().connectAIOpen).toBe(true);
});
- it('opens the Workspace on this employee', () => {
- useHomeStore.setState({ workspaceOpen: false, workspaceFor: null });
- renderCard(summary({ status: 'working' }, { state: 'running' }));
- fireEvent.click(screen.getByRole('button', { name: 'Watch live' }));
- expect(useHomeStore.getState()).toMatchObject({ workspaceOpen: true, workspaceFor: 'w1' });
- });
-
- it('says only what the page does not already say', () => {
- // Waiting for the owner's messages (no task line), a role that repeats
- // the name, nothing done yet: none of it shows.
- renderCard(summary({ status: 'working', role: 'maya', task: null, done_today: 0, apps: [] }, { state: 'running' }));
- expect(screen.queryByText('maya')).not.toBeInTheDocument();
- expect(screen.queryByText(/done today/)).not.toBeInTheDocument();
- expect(screen.queryByText('Now')).not.toBeInTheDocument();
- expect(screen.queryByRole('button', { name: 'More' })).not.toBeInTheDocument();
- });
-
- it('shows the role, the task and the count once they say something', () => {
- renderCard(summary({ status: 'working', task: { label: 'Now', text: 'Waiting for new WhatsApp messages' }, done_today: 2 }, { state: 'running' }));
- expect(screen.getByText('Receptionist')).toBeInTheDocument();
- expect(screen.getByText('Waiting for new WhatsApp messages')).toBeInTheDocument();
- expect(screen.getByText(/done today/)).toHaveTextContent('2 done today');
- });
-
it('makes Open in Dev mode the main button when nothing else is possible', () => {
- renderCard(summary({ status: 'attention' }, { state: 'failed', can_resume: false }));
+ renderPage(summary({ status: 'attention', talk: TALK_ON }, { state: 'failed', can_resume: false }));
fireEvent.click(screen.getByRole('button', { name: 'Open in Dev mode' }));
expect(enterDev).toHaveBeenCalledWith({ workflowId: 'w1' });
});
- it('offers Start under the conversation while the employee is not running', async () => {
+ it('offers Start above the message box while the employee is not running', async () => {
actions.sendRequest.mockResolvedValue({ success: true, messages: [] });
actions.startEmployee.mockReturnValue(new Promise(() => {}));
- renderCard(summary({ status: 'ready', talk: { state: 'on', agent_node_id: 'w1:talk' } }, { state: 'never_started', revision: 3 }));
+ renderPage(summary({ status: 'ready', talk: TALK_ON }, { state: 'never_started', revision: 3 }));
const talk = await screen.findByRole('region', { name: 'Talk with Maya' });
expect(talk).toHaveTextContent('Maya isn’t running, so they can’t read messages right now.');
expect(screen.queryByRole('textbox', { name: 'Message Maya' })).not.toBeInTheDocument();
- const starts = screen.getAllByRole('button', { name: 'Start' });
- expect(starts).toHaveLength(2);
- fireEvent.click(starts[1]);
+ fireEvent.click(screen.getByRole('button', { name: 'Start' }));
expect(actions.startEmployee).toHaveBeenCalledWith('w1', 3);
- // One control for the page: both buttons follow the same request.
- expect(screen.getAllByRole('button', { name: 'Starting…' })).toHaveLength(2);
+ expect(screen.getByRole('button', { name: 'Starting…' })).toBeDisabled();
+ });
+
+ it('opens the Workspace on its Browser tab while they need you there', () => {
+ useHomeStore.setState({ workspaceOpen: false, workspaceFor: null, workspaceTab: 'board' });
+ renderPage(
+ summary(
+ {
+ status: 'working',
+ talk: TALK_ON,
+ browser_request: { node_id: 'w1:browser:1', reason: 'login', since: null },
+ task: { label: 'Waiting', text: 'Needs you to sign in to a site in the browser' },
+ },
+ { state: 'running' },
+ ),
+ );
+ expect(screen.getByText('Needs you to sign in to a site in the browser')).toBeInTheDocument();
+ fireEvent.click(screen.getByRole('button', { name: 'Help in browser' }));
+ expect(useHomeStore.getState()).toMatchObject({ workspaceOpen: true, workspaceFor: 'w1', workspaceTab: 'browser' });
+ });
+
+ it('shows the drafts waiting for the owner after the messages', async () => {
+ const draft = {
+ approval_id: 'a1',
+ workflow_id: 'w1',
+ node_id: 'n',
+ status: 'pending',
+ channel: 'WhatsApp',
+ channel_label: 'WhatsApp',
+ recipient: '447700900123',
+ recipient_label: 'Priya',
+ body: 'Yes! Saturday at 10 works.',
+ context_excerpt: 'Can I book Saturday?',
+ created_at: null,
+ revision: 0,
+ max_length: 400,
+ };
+ actions.sendRequest.mockImplementation(async (type: string) =>
+ type === 'list_approvals' ? { success: true, approvals: [draft] } : { success: true, messages: [] },
+ );
+ renderPage(summary({ status: 'working', talk: TALK_ON, pending_approvals: 1 }, { state: 'running' }));
+ const drafts = await screen.findByRole('region', { name: 'Waiting for you' });
+ expect(drafts).toHaveTextContent('Yes! Saturday at 10 works.');
+ expect(screen.getByRole('region', { name: 'Talk with Maya' })).toContainElement(drafts);
});
it('notes when the employee cannot take messages', () => {
- renderCard(summary({ status: 'working' }, { state: 'running' }));
+ renderPage(summary({ status: 'working' }, { state: 'running' }));
expect(screen.getByText('You can’t message Maya here. Their setup has no way to answer you.')).toBeInTheDocument();
expect(actions.sendRequest).not.toHaveBeenCalledWith('get_chat_messages', expect.anything());
});
diff --git a/client/src/features/home/__tests__/workspace.test.tsx b/client/src/features/home/__tests__/workspace.test.tsx
index 93af1f15..23b55323 100644
--- a/client/src/features/home/__tests__/workspace.test.tsx
+++ b/client/src/features/home/__tests__/workspace.test.tsx
@@ -1,8 +1,9 @@
/**
* The Workspace dock: what it saves and how it reads that back, the orb
- * spike on opening, whose workspace it shows, the header's pill, the
- * placeholder tabs, the Canvas tab (no request without a Canvas, the board
- * with one), closing, and the header pill's dot.
+ * spike on opening, whose workspace it shows, the header's pill and main
+ * action (Pause lives here), the placeholder tabs, the Canvas tab (no
+ * request without a Canvas, the board with one), closing, and the header
+ * pill's dot.
*/
import { beforeEach, describe, expect, it, vi } from 'vitest';
@@ -11,7 +12,14 @@ import userEvent from '@testing-library/user-event';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import type { ReactElement } from 'react';
-const actions = { isReady: true, sendRequest: vi.fn(), addEventListener: () => () => {} };
+const actions = {
+ isReady: true,
+ sendRequest: vi.fn(),
+ addEventListener: () => () => {},
+ pauseWorkflow: vi.fn(),
+ resumeWorkflow: vi.fn(),
+ startEmployee: vi.fn(),
+};
vi.mock('@/contexts/WebSocketContext', async (importOriginal) => ({
...(await importOriginal<typeof import('@/contexts/WebSocketContext')>()),
@@ -58,7 +66,7 @@ function employee(patch: Record<string, unknown> = {}): EmployeeSummary {
})!;
}
-function renderWith(team: EmployeeSummary[], ui: ReactElement = <WorkspaceDock />) {
+function renderWith(team: EmployeeSummary[], ui: ReactElement = <WorkspaceDock onConnect={vi.fn()} />) {
const client = new QueryClient({ defaultOptions: { queries: { retry: false, staleTime: Infinity } } });
client.setQueryData(EMPLOYEES_QUERY_KEY, team);
render(
@@ -146,11 +154,21 @@ describe('WorkspaceDock', () => {
expect(screen.getByRole('button', { name: 'Restore size' })).toBeInTheDocument();
});
- it('shows the card’s pill when the employee is not working', () => {
+ it('shows their status and Resume when the employee is not working', () => {
useHomeStore.setState({ workspaceOpen: true, workspaceTab: 'browser' });
renderWith([employee({ status: 'paused' })]);
expect(screen.getByText('Paused')).toBeInTheDocument();
expect(screen.queryByText('Live')).toBeNull();
+ expect(screen.getByRole('button', { name: 'Resume' })).toBeEnabled();
+ });
+
+ it('pauses the employee from the header', () => {
+ actions.pauseWorkflow.mockReturnValue(new Promise(() => {}));
+ useHomeStore.setState({ workspaceOpen: true, workspaceTab: 'browser' });
+ renderWith([employee({ control: normalizeWorkflowControlStatus({ generation: 1, state: 'running', revision: 4 }, 'w1') })]);
+ fireEvent.click(screen.getByRole('button', { name: 'Pause' }));
+ expect(actions.pauseWorkflow).toHaveBeenCalledWith('w1', 4);
+ expect(screen.getByRole('button', { name: 'Pausing…' })).toBeDisabled();
});
it('follows the employee last opened, else the first', () => {
diff --git a/client/src/features/home/connectAI/ConnectAIDialog.tsx b/client/src/features/home/connectAI/ConnectAIDialog.tsx
index 55a9a6d0..d63d02c0 100644
--- a/client/src/features/home/connectAI/ConnectAIDialog.tsx
+++ b/client/src/features/home/connectAI/ConnectAIDialog.tsx
@@ -9,7 +9,8 @@
* this computer, another company) is in Settings > Connectors > AI.
*
* Opened through homeStore's openConnectAI: when a setup finds no AI model,
- * after a hire that cannot start without one, and from the employee card.
+ * after a hire that cannot start without one, and from an employee's main
+ * action (on their page, or in the Workspace header).
*/
import { ArrowLeft, Check, ExternalLink, ShieldCheck } from 'lucide-react';
diff --git a/client/src/features/home/data/fixtures.ts b/client/src/features/home/data/fixtures.ts
index 954fe3ed..727a7f30 100644
--- a/client/src/features/home/data/fixtures.ts
+++ b/client/src/features/home/data/fixtures.ts
@@ -1,7 +1,7 @@
/**
* Design QA only: `?fixture=employees` in a dev build fills the team with
* the handoff's three sample employees instead of asking the server, so
- * the sidebar and the employee card can be checked against the prototype
+ * the sidebar and the employee page can be checked against the prototype
* with no workflows set up. Production builds drop this module (the only
* import sits behind `import.meta.env.DEV`).
*
diff --git a/client/src/features/home/employee/DraftsSection.tsx b/client/src/features/home/employee/DraftsSection.tsx
index aa8d681b..80108702 100644
--- a/client/src/features/home/employee/DraftsSection.tsx
+++ b/client/src/features/home/employee/DraftsSection.tsx
@@ -1,5 +1,5 @@
/**
- * "Waiting for you" on the employee card: every draft the employee holds
+ * "Waiting for you" on the employee's page: every draft the employee holds
* for approval, as the message will go out, with Discard, Edit and Send.
*
* Send delivers the draft (or the edited text) through the channel it
@@ -97,7 +97,7 @@ export function DraftsSection({ workflowId, employeeName, paused }: { workflowId
const { data: approvals } = useApprovalsQuery(workflowId);
if (!approvals || approvals.length === 0) return null;
return (
- <section aria-label="Waiting for you" className="flex flex-col gap-3 rounded-card border border-status-waiting-border bg-status-waiting-fill p-4">
+ <section aria-label="Waiting for you" className="flex w-full flex-col gap-3 rounded-card border border-status-waiting-border bg-status-waiting-fill p-4">
<MicroLabel className="text-status-waiting-ink">Waiting for you</MicroLabel>
<div className="flex flex-col gap-5">
{approvals.map((approval) => (
diff --git a/client/src/features/home/employee/EmployeeTalk.tsx b/client/src/features/home/employee/EmployeeTalk.tsx
index 29ff0794..55357a8a 100644
--- a/client/src/features/home/employee/EmployeeTalk.tsx
+++ b/client/src/features/home/employee/EmployeeTalk.tsx
@@ -1,23 +1,26 @@
/**
- * Talking to an employee, under their card: the conversation, and a message
+ * Talking to an employee, under their name: the conversation, and a message
* box pinned to the bottom of the page.
*
* - The thread keeps every message across restarts, with a divider where
* the employee restarted (they start fresh from there). Replies,
- * questions and routine reports all land in it.
+ * questions and routine reports all land in it, and `drafts` (the ones
+ * waiting for the owner's OK) follow the messages.
* - While the employee runs, a message goes to them at once, and
* "Thinking…" holds the box until they answer (useReplyWait); overlapping
* runs would each save over the other's conversation. While they are
* paused, one message waits for Resume and then the box holds. Otherwise
* the box gives way to their main action (Start, or what they are
- * missing).
+ * missing). While they wait for the owner in the browser, a line above
+ * the box says so beside Help in browser.
* - Without a talk line, TurnOnTalk offers to add one; an employee whose
* setup cannot answer gets a note.
*/
-import { ArrowUp } from 'lucide-react';
-import { Suspense, lazy, useEffect, useLayoutEffect, useRef, useState, type KeyboardEvent } from 'react';
+import { ArrowUp, Monitor } from 'lucide-react';
+import { Suspense, lazy, useEffect, useLayoutEffect, useRef, useState, type KeyboardEvent, type ReactNode } from 'react';
import { useQueryClient } from '@tanstack/react-query';
+import { ActionButton } from '@/components/ui/action-button';
import { Button } from '@/components/ui/button';
import { Skeleton } from '@/components/ui/skeleton';
import { Textarea } from '@/components/ui/textarea';
@@ -28,6 +31,7 @@ import { talkMode, talkNoticeText } from '../data/presentation';
import type { EmployeeSummary } from '../data/schemas';
import { threadRows, timeLabel, useReplyWait, useSendTalkMessage, useTalkThread, type ThreadMessage } from '../data/talk';
import { isSendKey } from '../hire/composerKeys';
+import { useHomeStore } from '../state/homeStore';
import { pillToast } from '../ui/pillToast';
import { Avatar } from '../ui/primitives';
import { useAutoGrow } from '../ui/useAutoGrow';
@@ -116,7 +120,29 @@ function TalkBox({
);
}
-function Conversation({ employee, control }: { employee: EmployeeSummary; control: EmployeeControl }) {
+/** The agent is waiting for the owner in the browser (it called `request_user`). */
+function BrowserNotice({ employee }: { employee: EmployeeSummary }) {
+ const openWorkspace = useHomeStore((s) => s.openWorkspace);
+ const setWorkspaceTab = useHomeStore((s) => s.setWorkspaceTab);
+ return (
+ <div className="flex flex-wrap items-center gap-3">
+ <p className="m-0 min-w-50 flex-1 text-sm text-fg-muted">{employee.task?.text || `${employee.name} needs you in the browser.`}</p>
+ <ActionButton
+ intent="tools"
+ onClick={() => {
+ openWorkspace(employee.workflow_id);
+ setWorkspaceTab('browser');
+ }}
+ className="h-9 gap-2 rounded-row px-3.5"
+ >
+ <Monitor aria-hidden className="size-3.5" />
+ Help in browser
+ </ActionButton>
+ </div>
+ );
+}
+
+function Conversation({ employee, control, drafts }: { employee: EmployeeSummary; control: EmployeeControl; drafts?: ReactNode }) {
const { workflow_id: workflowId, name } = employee;
const queryClient = useQueryClient();
const thread = useTalkThread(workflowId);
@@ -137,7 +163,7 @@ function Conversation({ employee, control }: { employee: EmployeeSummary; contro
}, [queued, mode, begin]);
// Keep the newest message in view as the conversation grows. Opening the
- // page leaves the card in view.
+ // page leaves its top (the name) in view.
const lastId = messages?.at(-1)?.id ?? null;
const shownLast = useRef<string | null | undefined>(undefined);
useLayoutEffect(() => {
@@ -198,25 +224,29 @@ function Conversation({ employee, control }: { employee: EmployeeSummary; contro
</div>
)
)}
- {/* A log: screen readers announce new messages and "Thinking…". */}
- <div role="log" aria-live="polite" aria-label={`Conversation with ${name}`} className="flex flex-col gap-4">
- {rows.map((row) =>
- row.kind === 'restart' ? (
- <RestartDivider key={row.key} name={name} />
- ) : (
- <MessageRow key={row.message.id} message={row.message} employee={employee} now={now} />
- ),
- )}
- {waiting && (
- <div className="flex items-center gap-3">
- <Avatar name={name} colorRole={employee.color_role} size="sm" />
- <span className="text-sm text-fg-muted">Thinking…</span>
- </div>
- )}
- {unanswered && !waiting && <p className={cn('m-0 text-xs text-fg-muted', PAST_AVATAR)}>No answer from {name} yet.</p>}
+ <div className="flex flex-col gap-4">
+ {/* A log: screen readers announce new messages and "Thinking…". */}
+ <div role="log" aria-live="polite" aria-label={`Conversation with ${name}`} className="flex flex-col gap-4">
+ {rows.map((row) =>
+ row.kind === 'restart' ? (
+ <RestartDivider key={row.key} name={name} />
+ ) : (
+ <MessageRow key={row.message.id} message={row.message} employee={employee} now={now} />
+ ),
+ )}
+ {waiting && (
+ <div className="flex items-center gap-3">
+ <Avatar name={name} colorRole={employee.color_role} size="sm" />
+ <span className="text-sm text-fg-muted">Thinking…</span>
+ </div>
+ )}
+ {unanswered && !waiting && <p className={cn('m-0 text-xs text-fg-muted', PAST_AVATAR)}>No answer from {name} yet.</p>}
+ </div>
+ {drafts}
</div>
<div className="sticky bottom-0 z-10 mt-auto flex flex-col gap-2.5 bg-bg-app pt-4 pb-3">
{employee.pending_changes && <PendingChangesNotice employee={employee} />}
+ {employee.browser_request && <BrowserNotice employee={employee} />}
{notice && (
<div className="flex flex-wrap items-center gap-3">
<p className="m-0 min-w-50 flex-1 text-sm text-fg-muted">{notice}</p>
@@ -230,16 +260,29 @@ function Conversation({ employee, control }: { employee: EmployeeSummary; contro
);
}
-export function EmployeeTalk({ employee, control }: { employee: EmployeeSummary; control: EmployeeControl }) {
- if (employee.talk.state === 'off') return <TurnOnTalk employee={employee} />;
- if (employee.talk.state === 'unsupported') {
- return (
- <p className="m-0 w-full rounded-card border border-border-default bg-bg-panel px-4 py-3 text-center text-sm text-fg-muted">
- You can’t message {employee.name} here. Their setup has no way to answer you.
- </p>
- );
- }
- return <Conversation employee={employee} control={control} />;
+export function EmployeeTalk({
+ employee,
+ control,
+ drafts,
+}: {
+ employee: EmployeeSummary;
+ control: EmployeeControl;
+ /** The drafts waiting for the owner, shown after the messages. */
+ drafts?: ReactNode;
+}) {
+ if (employee.talk.state === 'on') return <Conversation employee={employee} control={control} drafts={drafts} />;
+ return (
+ <div className="flex w-full flex-col gap-4">
+ {drafts}
+ {employee.talk.state === 'off' ? (
+ <TurnOnTalk employee={employee} />
+ ) : (
+ <p className="m-0 w-full rounded-card border border-border-default bg-bg-panel px-4 py-3 text-center text-sm text-fg-muted">
+ You can’t message {employee.name} here. Their setup has no way to answer you.
+ </p>
+ )}
+ </div>
+ );
}
export default EmployeeTalk;
diff --git a/client/src/features/home/employee/EmployeeView.tsx b/client/src/features/home/employee/EmployeeView.tsx
index a468cbbb..82d33eb2 100644
--- a/client/src/features/home/employee/EmployeeView.tsx
+++ b/client/src/features/home/employee/EmployeeView.tsx
@@ -1,25 +1,21 @@
/**
- * One employee (design handoff "Employee view"): their card, then the
- * conversation with them (EmployeeTalk), whose message box stays pinned to
- * the bottom of the page.
+ * One employee's page (design handoff "Employee view"): their name under
+ * the orb, then the conversation with them (EmployeeTalk), whose message
+ * box stays pinned to the bottom of the page. Only a new hire's notes
+ * (HireNotice) ever sit between the two.
*
- * The card shows the server's summary, which the server re-sends the
- * moment the control plane moves: who they are, what they are doing (unless
- * the page already says it), the drafts waiting for the owner, the apps
- * they use, how much they did today, and what to do next (Pause, Resume,
- * Start, or connect what they are missing; useEmployeeControl, shared with
- * the message box). "Watch live" opens the Workspace on this employee
- * ("Help in browser", on its Browser tab, while the agent is waiting for the
- * owner). The header's Dev switch opens their workflow in Dev mode.
+ * What to act on lives in the conversation, and only while there is
+ * something to do: the drafts to check after the messages; above the
+ * message box, their main action while they cannot read messages (Resume,
+ * Start, or connect what they are missing; useEmployeeControl) and Help in
+ * browser while they wait for the owner there. Pausing them is the
+ * Workspace's, which the header's Workspace pill opens on the employee on
+ * screen; the header's Dev switch opens their workflow.
*/
-import { Monitor } from 'lucide-react';
-import { useLayoutEffect, useRef, type RefObject } from 'react';
-import { ActionButton } from '@/components/ui/action-button';
+import { useEffect, useRef } from 'react';
import { Button } from '@/components/ui/button';
import { Skeleton } from '@/components/ui/skeleton';
-import { animate } from '@/lib/motion';
-import { cn } from '@/lib/utils';
import { useEmployeeDetailQuery, useEmployeesQuery } from '../data/employees';
import { useLiveTask } from '../data/liveTask';
import type { EmployeeSummary } from '../data/schemas';
@@ -27,166 +23,38 @@ import { HireNotice } from '../hire/HireNotice';
import { OrbSlot } from '../orb/OrbSlot';
import { SPIKE, spikeOrb } from '../orb/orb';
import { useHomeStore } from '../state/homeStore';
-import { AppMark, Avatar, MicroLabel, StatusPill } from '../ui/primitives';
import { DraftsSection } from './DraftsSection';
import { EmployeeTalk } from './EmployeeTalk';
-import { PrimaryActionButton } from './PrimaryActionButton';
-import { useEmployeeControl, type EmployeeControl } from './useEmployeeControl';
+import { useEmployeeControl } from './useEmployeeControl';
-/** What they are doing, or none when the page already says it. */
-function TaskBox({ employee }: { employee: EmployeeSummary }) {
+/** The orb stirs when their work moves on (design handoff "Live work"). */
+function useTaskSpike(employee: EmployeeSummary): void {
const live = useLiveTask(employee);
- const task = live ?? employee.task;
- const taskText = task?.text;
- const textRef = useRef<HTMLSpanElement>(null);
- const shownText = useRef(taskText);
- // A new task blurs in and the card's border flashes green (design handoff "Live work").
- useLayoutEffect(() => {
- if (shownText.current === taskText) return;
- shownText.current = taskText;
- if (!taskText) return;
- spikeOrb(SPIKE.task);
- const text = textRef.current;
- animate(
- text,
- [
- { opacity: 0, transform: 'translateY(8px)', filter: 'blur(3px)' },
- { opacity: 1, transform: 'none', filter: 'blur(0)' },
- ],
- { duration: 520, easing: 'spring', fill: 'backwards' },
- );
- animate(text?.closest('[data-employee]'), [{ borderColor: 'var(--glow-task)' }, { borderColor: 'var(--border-default)' }], {
- duration: 'glow',
- fill: 'none',
- });
- }, [taskText]);
- if (!task) return null;
- return (
- <div className="flex flex-col gap-1.5 rounded-card border border-border-default bg-bg-app px-4 py-3.5">
- <MicroLabel>{task.label}</MicroLabel>
- <span ref={textRef} data-task={employee.workflow_id} className="text-md text-fg-default" aria-live="polite">
- {task.text}
- </span>
- </div>
- );
-}
-
-function EmployeeCard({
- employee,
- control,
- cardRef,
-}: {
- employee: EmployeeSummary;
- control: EmployeeControl;
- cardRef: RefObject<HTMLDivElement | null>;
-}) {
- const openWorkspace = useHomeStore((s) => s.openWorkspace);
- const setWorkspaceTab = useHomeStore((s) => s.setWorkspaceTab);
- const helpInBrowser = employee.browser_request !== null;
- const countRef = useRef<HTMLSpanElement>(null);
- const { view } = control;
- // A role that only repeats the name ("AI Assistant", "AI assistant") says nothing.
- const role = employee.role.trim().toLowerCase() === employee.name.trim().toLowerCase() ? '' : employee.role;
-
- // One more done today: the count bumps in green.
- const shownDone = useRef(employee.done_today);
- useLayoutEffect(() => {
- const previous = shownDone.current;
- shownDone.current = employee.done_today;
- if (employee.done_today <= previous) return;
- animate(
- countRef.current,
- [
- { transform: 'none', color: 'var(--status-working-ink)' },
- { transform: 'translateY(-3px) scale(1.25)', color: 'var(--status-working-ink)', offset: 0.35 },
- { transform: 'none', color: 'var(--fg-default)' },
- ],
- { duration: 700, fill: 'none' },
- );
- }, [employee.done_today]);
-
- return (
- <div
- ref={cardRef}
- data-employee={employee.workflow_id}
- className="flex w-full flex-col gap-4.5 rounded-draft border border-border-default bg-bg-elevated p-5.5 shadow-float"
- >
- <div className="flex flex-wrap items-center gap-3.5">
- <Avatar name={employee.name} colorRole={employee.color_role} size="lg" />
- <div className="flex min-w-40 flex-1 flex-col gap-0.75">
- <span className="text-title font-semibold tracking-[-0.02em] text-fg-default">{employee.name}</span>
- {role && <span className="text-base text-fg-muted">{role}</span>}
- </div>
- <StatusPill tone={view.pill.tone} label={view.pill.label} pulse={view.pulse} />
- </div>
-
- <TaskBox employee={employee} />
-
- <DraftsSection
- workflowId={employee.workflow_id}
- employeeName={employee.name}
- paused={employee.control.state === 'paused' || employee.control.state === 'pausing'}
- />
-
- {(employee.apps.length > 0 || employee.done_today > 0) && (
- <div className="flex flex-wrap items-center gap-2">
- {employee.apps.map((app) => (
- <span
- key={app.app_id}
- className={cn(
- 'flex h-7.5 items-center gap-1.5 rounded-pill border bg-bg-app pr-2.5 pl-1 text-meta text-fg-default',
- app.connected ? 'border-border-default' : 'border-status-attention-border',
- )}
- title={app.connected ? `${app.name} is connected` : `${app.name} is not connected`}
- >
- <AppMark name={app.name} iconRef={app.icon_ref} size="xs" />
- {app.name}
- </span>
- ))}
- {employee.done_today > 0 && (
- <span className="ml-auto font-mono text-sm whitespace-nowrap text-fg-muted">
- <span ref={countRef} data-count={employee.workflow_id} className="inline-block text-fg-default">
- {employee.done_today}
- </span>{' '}
- done today
- </span>
- )}
- </div>
- )}
-
- {employee.unsupported_apps.length > 0 && (
- <p className="m-0 text-xs text-fg-muted">
- Not available yet: {employee.unsupported_apps.join(', ')}. They work without it for now.
- </p>
- )}
-
- <div className="flex flex-wrap gap-2">
- <PrimaryActionButton control={control} />
- <ActionButton
- intent="tools"
- onClick={() => {
- openWorkspace(employee.workflow_id);
- if (helpInBrowser) setWorkspaceTab('browser');
- }}
- className="h-9 gap-2 rounded-row px-3.5"
- >
- <Monitor aria-hidden className="size-3.5" />
- {helpInBrowser ? 'Help in browser' : 'Watch live'}
- </ActionButton>
- </div>
- </div>
- );
+ const text = (live ?? employee.task)?.text;
+ const shown = useRef(text);
+ useEffect(() => {
+ if (shown.current === text) return;
+ shown.current = text;
+ if (text) spikeOrb(SPIKE.task);
+ }, [text]);
}
function EmployeePage({ employee, onConnect }: { employee: EmployeeSummary; onConnect: (providerId: string) => void }) {
- const cardRef = useRef<HTMLDivElement>(null);
- const control = useEmployeeControl(employee, onConnect, cardRef);
+ const control = useEmployeeControl(employee, onConnect);
+ useTaskSpike(employee);
+ const paused = employee.control.state === 'paused' || employee.control.state === 'pausing';
return (
- <section aria-label={employee.name} className="flex w-full max-w-(--w-employee-card) flex-1 flex-col items-center gap-4.5">
- <OrbSlot size="employee" />
- <EmployeeCard employee={employee} control={control} cardRef={cardRef} />
+ <section aria-label={employee.name} className="flex w-full max-w-(--w-employee-card) flex-1 flex-col items-center gap-4">
+ <div className="flex flex-col items-center gap-2">
+ <OrbSlot size="employee" />
+ <h2 className="text-center text-title font-semibold tracking-[-0.02em] break-words text-fg-default">{employee.name}</h2>
+ </div>
<HireNotice workflowId={employee.workflow_id} />
- <EmployeeTalk employee={employee} control={control} />
+ <EmployeeTalk
+ employee={employee}
+ control={control}
+ drafts={<DraftsSection workflowId={employee.workflow_id} employeeName={employee.name} paused={paused} />}
+ />
</section>
);
}
@@ -203,9 +71,9 @@ export function EmployeeView({ workflowId, onConnect }: { workflowId: string; on
if (!employee) {
if (list.isPending || (detailId !== null && detail.isPending)) {
return (
- <section aria-busy className="flex w-full max-w-(--w-employee-card) flex-col items-center gap-4.5">
+ <section aria-busy className="flex w-full max-w-(--w-employee-card) flex-col items-center gap-2">
<OrbSlot size="employee" />
- <Skeleton className="h-72 w-full rounded-draft" />
+ <Skeleton className="h-7 w-44 rounded-row" />
</section>
);
}
diff --git a/client/src/features/home/employee/PrimaryActionButton.tsx b/client/src/features/home/employee/PrimaryActionButton.tsx
index ef51f8aa..951d2646 100644
--- a/client/src/features/home/employee/PrimaryActionButton.tsx
+++ b/client/src/features/home/employee/PrimaryActionButton.tsx
@@ -1,15 +1,17 @@
/**
* The button for an employee's main action (see useEmployeeControl): the
* green run button for Start, Resume and connecting, a quiet one for Pause
- * and Open in Dev mode.
+ * and Open in Dev mode. `className` sizes it for a smaller host (the
+ * Workspace header).
*/
import { Code } from 'lucide-react';
import { ActionButton } from '@/components/ui/action-button';
import { Button } from '@/components/ui/button';
+import { cn } from '@/lib/utils';
import type { EmployeeControl } from './useEmployeeControl';
-export function PrimaryActionButton({ control }: { control: EmployeeControl }) {
+export function PrimaryActionButton({ control, className }: { control: EmployeeControl; className?: string }) {
const { primary } = control.view;
if (primary.kind === 'pause' || primary.kind === 'open_workflow') {
return (
@@ -17,7 +19,7 @@ export function PrimaryActionButton({ control }: { control: EmployeeControl }) {
variant="quiet"
disabled={control.busy}
onClick={control.act}
- className="h-9 gap-2 rounded-row border-border-strong px-4 font-semibold text-fg-default"
+ className={cn('h-9 gap-2 rounded-row border-border-strong px-4 font-semibold text-fg-default', className)}
>
{primary.kind === 'open_workflow' && !control.busy && <Code aria-hidden className="size-3.25" />}
{control.label}
@@ -25,7 +27,7 @@ export function PrimaryActionButton({ control }: { control: EmployeeControl }) {
);
}
return (
- <ActionButton intent="run" disabled={control.busy} onClick={control.act} className="h-9 rounded-row px-4">
+ <ActionButton intent="run" disabled={control.busy} onClick={control.act} className={cn('h-9 rounded-row px-4', className)}>
{control.label}
</ActionButton>
);
diff --git a/client/src/features/home/employee/useEmployeeControl.ts b/client/src/features/home/employee/useEmployeeControl.ts
index a03b4a65..c7b71c78 100644
--- a/client/src/features/home/employee/useEmployeeControl.ts
+++ b/client/src/features/home/employee/useEmployeeControl.ts
@@ -1,7 +1,7 @@
/**
* An employee's main action (Pause, Resume, Start, connect what they are
- * missing, or open them in Dev mode), shared by the card and the message
- * box, which offers it while the employee cannot read messages.
+ * missing, or open them in Dev mode): the Workspace header offers it, and
+ * their page's message box while they cannot read messages.
*
* Start / Pause / Resume send the summary's control revision. After one
* returns, the label stays "Pausing…" until the summary has caught up with
@@ -10,13 +10,12 @@
*/
import { useQueryClient } from '@tanstack/react-query';
-import { useEffect, useState, type RefObject } from 'react';
+import { useEffect, useState } from 'react';
import {
mergeWorkflowControlStatus,
useWebSocketActions,
type WorkflowControlStatus,
} from '@/contexts/WebSocketContext';
-import { animate } from '@/lib/motion';
import { useWorkflowControlPending } from '@/stores/workflowControlStore';
import { enterDev } from '../../../app/useShellActions';
import { invalidateEmployees } from '../data/employees';
@@ -50,12 +49,7 @@ export interface EmployeeControl {
act: () => void;
}
-/** `pressRef`: the element that bounces when Start, Pause or Resume is pressed. */
-export function useEmployeeControl(
- employee: EmployeeSummary,
- onConnect: (providerId: string) => void,
- pressRef: RefObject<HTMLElement | null>,
-): EmployeeControl {
+export function useEmployeeControl(employee: EmployeeSummary, onConnect: (providerId: string) => void): EmployeeControl {
const pending = useWorkflowControlPending(employee.workflow_id);
const view = presentEmployee(employee, pending);
const actions = useWebSocketActions();
@@ -101,14 +95,7 @@ export function useEmployeeControl(
if (primary.kind === 'connect_app') onConnect(primary.app.provider_id);
else if (primary.kind === 'connect_ai') openConnectAI();
else if (primary.kind === 'open_workflow') void enterDev({ workflowId: employee.workflow_id });
- else {
- animate(pressRef.current, [{ transform: 'scale(1)' }, { transform: 'scale(.97)', offset: 0.3 }, { transform: 'scale(1)' }], {
- duration: 420,
- easing: 'spring',
- fill: 'none',
- });
- void control(primary.kind);
- }
+ else void control(primary.kind);
};
const inFlight = running ?? (waiting ? awaiting?.kind : null) ?? null;
diff --git a/client/src/features/home/genui/hirePayload.ts b/client/src/features/home/genui/hirePayload.ts
index 18140155..ef71ce39 100644
--- a/client/src/features/home/genui/hirePayload.ts
+++ b/client/src/features/home/genui/hirePayload.ts
@@ -184,8 +184,8 @@ export function sameTrigger(a: HireTrigger, b: HireTrigger): boolean {
);
}
-/** "Every weekday at 09:00", in the words the employee's card uses for the
- * same schedule (services/employees/summaries.py). `app` is the app's own
+/** "Every weekday at 09:00", in the words the employee's summary uses for
+ * the same schedule (services/employees/summaries.py). `app` is the app's own
* name when it is known. */
export function triggerSentence(trigger: HireTrigger, app: string | undefined = trigger.app): string {
if (trigger.kind === 'manual') return 'When you message them';
diff --git a/client/src/features/home/settings/HomeSettings.tsx b/client/src/features/home/settings/HomeSettings.tsx
index 97119499..9d51001e 100644
--- a/client/src/features/home/settings/HomeSettings.tsx
+++ b/client/src/features/home/settings/HomeSettings.tsx
@@ -3,7 +3,7 @@
* behind a left nav, in the shared Modal with its spring entrance. One
* `PAGES` list drives both the nav and the panels. The nav's search keeps
* the pages whose label or keywords match, and drops a group with none.
- * Connect dialogs open on top from Connectors (and from the employee card's
+ * Connect dialogs open on top from Connectors (and from an employee's
* "Connect {App}"); HomeShell owns them.
*/
diff --git a/client/src/features/home/workspace/WorkspaceDock.tsx b/client/src/features/home/workspace/WorkspaceDock.tsx
index 72b07912..164c2e1b 100644
--- a/client/src/features/home/workspace/WorkspaceDock.tsx
+++ b/client/src/features/home/workspace/WorkspaceDock.tsx
@@ -2,7 +2,9 @@
* The Workspace (design handoff "Workspace panel"): a dock on the right of
* Home showing what one employee is working on. Canvas shows the
* employee's board; Browser attaches to their saved browser nodes. The
- * editor shares the same tabs and live browser surface.
+ * editor shares the same tabs and live browser surface. The header carries
+ * their main action (Pause, Resume, Start, or connect what they are
+ * missing), the place to pause them from Normal mode.
*
* At 1100px and wider the dock pushes the page aside; narrower, it lies
* over the page with a shadow. The left edge drags from 360px to the
@@ -29,6 +31,8 @@ import { useEmployeesQuery } from '../data/employees';
import { useLiveTask } from '../data/liveTask';
import { presentEmployee } from '../data/presentation';
import type { EmployeeSummary } from '../data/schemas';
+import { PrimaryActionButton } from '../employee/PrimaryActionButton';
+import { useEmployeeControl } from '../employee/useEmployeeControl';
import { useHomeStore } from '../state/homeStore';
import { Avatar, StatusPill } from '../ui/primitives';
@@ -87,6 +91,11 @@ function Identity({ employee }: { employee: EmployeeSummary }) {
);
}
+function DockAction({ employee, onConnect }: { employee: EmployeeSummary; onConnect: (providerId: string) => void }) {
+ const control = useEmployeeControl(employee, onConnect);
+ return <PrimaryActionButton control={control} className="h-7.5 px-3" />;
+}
+
function CanvasTab({ employee }: { employee: EmployeeSummary }) {
if (!employee.canvas_node_id) {
return (
@@ -146,7 +155,8 @@ function NoEmployee({ status }: { status: 'pending' | 'error' | 'success' }) {
);
}
-export function WorkspaceDock() {
+/** `onConnect`: opens an app's connect dialog, for a main action that connects one. */
+export function WorkspaceDock({ onConnect }: { onConnect: (providerId: string) => void }) {
const open = useHomeStore((s) => s.workspaceOpen);
const widthPx = useHomeStore((s) => s.workspaceWidth);
const wide = useHomeStore((s) => s.workspaceWide);
@@ -227,7 +237,10 @@ export function WorkspaceDock() {
>
<header className="flex h-(--h-home-header) shrink-0 items-center gap-2.5 border-b border-border-default pr-2.5 pl-4">
{employee ? (
- <Identity employee={employee} />
+ <>
+ <Identity employee={employee} />
+ <DockAction employee={employee} onConnect={onConnect} />
+ </>
) : (
<span className="min-w-0 flex-1 truncate text-base font-semibold text-fg-default">Workspace</span>
)}
diff --git a/client/src/themes/base.css b/client/src/themes/base.css
index 0266ea23..f15f495f 100644
--- a/client/src/themes/base.css
+++ b/client/src/themes/base.css
@@ -177,7 +177,7 @@
--h-composer-max: 200px; /* the job box grows with its text up to this */
--w-employee-card: 620px;
--size-orb-hire: min(230px, 26vh);
- --size-orb-employee: min(150px, 20vh);
+ --size-orb-employee: min(96px, 14vh); /* small: the conversation has the page */
--w-settings: 1040px;
--h-settings: 760px;
--w-settings-nav: 224px;
diff --git a/docs-internal/browser_workspace.md b/docs-internal/browser_workspace.md
index cc29dc65..7cf7ec9d 100644
--- a/docs-internal/browser_workspace.md
+++ b/docs-internal/browser_workspace.md
@@ -69,8 +69,8 @@ message. Elsewhere only identity and the reason travel, because broadcasts
and employee summaries reach every connected socket:
- **Home:** the employee summary's `browser_request` (`{node_id, reason,
- since}`) turns the pill to Needs you, the server's task line names the
- reason, and Watch live becomes Help in browser, which opens the workspace on
+ since}`) turns the employee's status to Needs you, and their page says why
+ above the message box, beside Help in browser, which opens the workspace on
its Browser tab. The live task overlay stands back meanwhile, since the
agent's node is still executing while it waits.
- **Dev:** a `browser_updated` broadcast for the open workflow in
diff --git a/docs-internal/node-logic-flows/workflow_triggers/approvalGate.md b/docs-internal/node-logic-flows/workflow_triggers/approvalGate.md
index 5f022860..25da0228 100644
--- a/docs-internal/node-logic-flows/workflow_triggers/approvalGate.md
+++ b/docs-internal/node-logic-flows/workflow_triggers/approvalGate.md
@@ -13,7 +13,7 @@
Holds a draft until the owner sends or discards it. A Normal-mode employee
with "Ask me before sending anything" on answers through
`agent -> approvalGate -> reply`: the gate records the agent's draft (who it
-goes to, what it says), shows it on the employee's card in Home, and waits.
+goes to, what it says), shows it on the employee's page in Home, and waits.
Send lets the draft, or the owner's edit of it, through to the reply node;
Discard, expiry or a Reset lets nothing through. Hire builds this wiring
(`services/employees/builder.py`); the node is also usable by hand in the
@@ -115,7 +115,7 @@ flowchart TD
- **Broadcasts**: `approval_lifecycle` (CloudEvents type
`com.opencompany.approval.{requested|decided|expired|cancelled}`, subject =
approval id). Identity only, never the message body or the recipient; the
- card refetches through `list_approvals`. Node status `waiting` while it waits.
+ page refetches through `list_approvals`. Node status `waiting` while it waits.
- **External API calls**: none.
- **File I/O**: none.
- **Subprocess**: none.
diff --git a/docs-internal/normal_mode.md b/docs-internal/normal_mode.md
index 42284bdf..c8dc0911 100644
--- a/docs-internal/normal_mode.md
+++ b/docs-internal/normal_mode.md
@@ -4,7 +4,7 @@ Normal mode is the landing screen for owners who are not technical. They
describe a job in plain words, an LLM on the server drafts a setup screen for
a new AI employee, they adjust it and press **Hire**, and the server builds,
saves and starts a workflow that does the job. Each employee appears in a
-sidebar with a live status card, and the owner talks to them on their page
+sidebar with a live status, and the owner talks to them on their page
(Talk), where they can also be asked to take on new tools and skills. The
workflow editor is **Dev mode**, one switch away.
@@ -65,10 +65,10 @@ is the reference.
| Folder | Contents |
|---|---|
| `HomeShell.tsx` | Sidebar, header, the current view (hire or one employee), the Workspace dock, Settings, the connect dialog, the guided Connect an AI model dialog, the orb's stage, and under an employee's page a line saying whether they ask first |
-| `sidebar/`, `header/` | The team list, New employee, the profile row; the view title, the Workspace pill, mode toggle and theme button |
+| `sidebar/`, `header/` | The team list, New employee, the profile row; the view title, the Workspace pill, the mode toggle (on an employee's page, Dev opens their workflow) and the theme button |
| `hire/` | The hero, the composer, the template chips, the hire notice (`HireNotice.tsx`), and the starter bundles (`starters.json`), which the chips and Settings > Plugins both read |
| `genui/` | The setup draft under the composer, and the hire itself, from a setup or a starter (below) |
-| `employee/` | One employee's page: the card (status, the current task, apps, "done today", Start / Pause / Resume, Watch live, the drafts waiting for the owner, and a More menu with Open in Dev mode), then Talk (below). The card and the message box share one main action (`useEmployeeControl`, `PrimaryActionButton`) |
+| `employee/` | One employee's page, which is the conversation with them: only their name under a small orb, then Talk (below). What to act on shows in the conversation only while there is something to do: the drafts waiting for the owner after the messages, and above the message box their main action while they can't read messages (Resume, Start, or connect what is missing; `useEmployeeControl`, `PrimaryActionButton`) or Help in browser while they wait there. It never says why they stopped. Pausing them, and watching them work, is the Workspace's: the header's Workspace pill opens it on the employee on screen, and its header carries the same main action |
| `connectAI/` | The guided Connect an AI model dialog (below) |
| `workspace/` | The Workspace dock (below), its header pill, and its Canvas tab, which loads in its own chunk |
| `settings/` | The Settings pages (Profile, Billing, Skills, Connectors, Plugins), the shared catalog page the last three build on, and `ConnectDialog` (the editor's credential panel for one provider, in its compact variant) |
@@ -82,9 +82,9 @@ Status comes from the server: an employee summary is `working`, `ready`,
`paused` or `attention` (an automatic pause, see below), and a pending draft
shows as "Needs you". So does a browser waiting for the owner: when an agent
calls `request_user`, the summary's `browser_request` (`{node_id, reason,
-since}`, never the agent's message, since summaries reach every socket) takes
-over the task line, and the card's Watch live button becomes Help in browser,
-which opens the Workspace on its Browser tab. The Browser plugin publishes
+since}`, never the agent's message, since summaries reach every socket) is
+said above the message box on their page, beside Help in browser, which opens
+the Workspace on its Browser tab. The Browser plugin publishes
that state through `services/employees/node_signals.py` and re-sends the
summary when it changes. Motion goes through [lib/motion.ts](../client/src/lib/motion.ts),
which reads the `--dur-*` / `--ease-*` tokens, runs at 1 ms under reduced
@@ -101,8 +101,10 @@ first time it runs). [orb/orb.ts](../client/src/features/home/orb/orb.ts) holds
what the engine reads each frame (the slot to fill, an energy target, a spike)
and its lifecycle: leaving Home keeps the renderer, the app shell disposes it.
`OrbStage` is the canvas host below the header; each view's `OrbSlot` reserves
-the square the orb glides into. The composer sets the energy target (focused,
-holding text, a setup being written). These spike it: a hire, a theme or mode
+the square the orb glides into (`--size-orb-hire`, `--size-orb-employee`:
+large on the hire view, small on an employee's page, where the conversation
+needs the room). The composer sets the energy target (focused, holding text,
+a setup being written). These spike it: a hire, a theme or mode
switch, a connect, a task change, opening Settings or the Workspace, a setup
arriving or failing, and saving the profile (`SPIKE` in orb.ts). In dark the orb keeps the
logo's colours with white particles and packets; in light it is glossy
@@ -116,13 +118,15 @@ after a lost WebGL context, the slot shows the static mark.
A dock on the right of Home ([workspace/WorkspaceDock.tsx](../client/src/features/home/workspace/WorkspaceDock.tsx))
that shows what one employee is working on. The header's Workspace pill
opens and closes it, and carries a blinking dot while it is closed and
-someone is working. Watch live on an employee's card opens it on that
-employee. It shows the employee last opened or watched, else the first on
-the team.
-
-- **Header**: the avatar, "{Name}’s workspace", the live task line
- (`useLiveTask`, else the summary's task), and a pill: Live while the
- employee works, otherwise the card's own pill. Expand and Close.
+someone is working. It shows the employee last opened (their page, or their
+Help in browser), else the first on the team.
+
+- **Header**: the avatar, "{Name}’s workspace", the live task line when
+ there is one (`useLiveTask`, else the summary's task), and a pill: Live
+ while the employee works, otherwise their status (Ready, Paused, Needs
+ attention, Needs you). Then their main action (Pause, Resume, Start, or
+ connect what is missing), the one place to pause them in Normal mode, and
+ Expand and Close.
- **Canvas**: the board named by the summary's `canvas_node_id`, drawn by
the editor's Canvas renderer (`CanvasContent`, see [Canvas Node](./canvas_node.md)).
It loads in its own chunk, which keeps the board's markdown, code and
@@ -134,8 +138,9 @@ the team.
summary. Multiple nodes get a selector. Running sessions appear automatically;
Start browser opens an idle session. The view supports navigation, tabs,
Take control / Hand back, and browser dialogs. Frames use `/ws/browser`,
- not a URL iframe. The card's Help in browser opens the Workspace on this
- tab while the agent waits for the owner. See
+ not a URL iframe. Help in browser, above the message box on the
+ employee's page while the agent waits for the owner, opens the Workspace
+ on this tab. See
[Browser workspace](./browser_workspace.md).
- **Android**: a shared panel explains that live mirroring is not yet available.
Dev mode uses the same three workspace tabs and browser viewer.
@@ -214,8 +219,8 @@ as the Hire button's `trigger`, else a new message in the app the routine's
first "When" step names, else the owner messaging them, snapped to what the
server builds: a known kind, a frequency, a time from `trigger.times` (the
builder's `SCHEDULE_TIMES`; `test_genui_catalog_sync.py` holds them equal), and
-a weekday or day of the month. It reads as one sentence in the card's words
-("Every weekday at 08:00"). Edit offers the owner messaging them, a schedule,
+a weekday or day of the month. It reads as one sentence ("Every weekday at
+08:00"). Edit offers the owner messaging them, a schedule,
or a new message in any app whose `can_trigger` is true; a change rewrites the
routine's "When" step, and the hire payload reads `/trigger` before the
button's params. `render.tsx` labels the routine "Their routine" and its steps
@@ -301,7 +306,7 @@ and the agent it talks to the owner through, `node_roles` `agent` and
`talk_agent`) onto a usable model, and calls `start_saved_workflow`, the same
start path the editor uses. One that stopped after a problem is reset first
(`reset_if_failed`); the reset moves its control revision on, so the revision
-the card sent is checked here instead. Pause and Resume are the editor's
+the page sent is checked here instead. Pause and Resume are the editor's
`pause_workflow` / `resume_workflow`.
Automatic pauses now record why: `WorkflowControlExecution.pause_reason`
@@ -336,7 +341,7 @@ catalogue. Picking one opens that provider's own panel, compact, with a link
to its key page, and the dialog closes once the provider connects; "See all
AI models" opens Settings > Connectors on AI. `homeStore.openConnectAI()`
opens it when a setup answers `no_ai_provider`, after a hire that answers
-`needs_ai`, from the card's Connect an AI model, and when Start is refused
+`needs_ai`, from the page's Connect an AI model, and when Start is refused
with `needs_ai`. The key-page links live in `aiProviderLinks.ts`, not in the
credential catalogue.
@@ -355,7 +360,7 @@ is announced as `chat.updated`.
### On the employee's page
[employee/EmployeeTalk.tsx](../client/src/features/home/employee/EmployeeTalk.tsx)
-sits under the card: the thread, then a message box pinned to the bottom of
+sits under the name: the thread, then a message box pinned to the bottom of
the page (`HomeShell`'s scroll area is a column the view fills). Its queries
and mutations are in [data/talk.ts](../client/src/features/home/data/talk.ts).
@@ -364,9 +369,10 @@ and mutations are in [data/talk.ts](../client/src/features/home/data/talk.ts).
`run_key` (its generation) differs from the one before, a divider reads
"{Name} restarted — they start fresh from here". The owner's messages sit on
the right; answers carry the avatar and render as markdown (`ThreadMarkdown`,
- in its own chunk). An empty thread offers suggestion chips that fill the box.
- The list is an `aria-live` log. It refetches on `chat.updated`, after a
- runtime reset, and when the socket reopens.
+ in its own chunk). An empty thread is just the box. The list is an
+ `aria-live` log. It refetches on `chat.updated`, after a runtime reset,
+ and when the socket reopens. The drafts waiting for the owner's OK follow
+ the messages (`EmployeeTalk`'s `drafts`).
- **The box** follows the control state the way `send_chat_message` does
(`talkMode` in `presentation.ts`):
- *send* (running, starting, resuming): a message shows at once
@@ -380,8 +386,11 @@ and mutations are in [data/talk.ts](../client/src/features/home/data/talk.ts).
- *queue* (paused, pausing): one message waits for Resume ("Your message is
waiting…"), and the box holds until the employee runs again.
- *start* (never started, ready, resetting, failed): no box; a line says
- they can't read messages, beside the card's main action (Start, or what
- they are missing).
+ they can't read messages, beside their main action (Start, or what they
+ are missing), which the Workspace header offers too.
+ - While the agent waits for the owner in the browser, the server's line
+ for it ("Needs you to sign in to a site in the browser") sits above the
+ box beside Help in browser.
- A refused message leaves the thread and its text goes back in the box;
`not_running` (the state moved meanwhile) says "{Name} isn't running" and
refetches the team.
@@ -447,7 +456,9 @@ trigger and an `aiAgent` / `chatAgent` a talk agent can copy; `unsupported`
otherwise (a chat trigger that feeds no agent counts here). While a
generation is live the summary reads the running snapshot, whose node ids are
the ones that report status; otherwise the saved graph. `talk.agent_node_id`
-is the agent that answers, and it joins `watch_node_ids`.
+is the agent that answers. It stays out of `watch_node_ids`, and `useLiveTask`
+skips it: while it works, the conversation shows "Thinking…", and the
+Workspace's task line stays on their other work.
### Turn on Talk and Apply
@@ -523,7 +534,7 @@ What goes live when:
## Asking before sending
With the rule on, a reply waits in an `approvalGate` until the owner decides
-on the employee's card. The gate stores the draft in `approval_requests`,
+on the employee's page. The gate stores the draft in `approval_requests`,
wakes the moment it is decided, survives restarts (its idempotency key finds
the same row on every attempt), expires after `timeout_hours`, and fails
closed: nothing is sent unless it was approved, and the recipient always comes
@@ -627,7 +638,7 @@ WebSocket requests (snake_case; failures come back as `success: false` with an
| Type | Payload | Response |
|---|---|---|
-| `list_employees` | `{}` | `{employees}`; each summary's `canvas_node_id` is its Canvas board: the one it was hired with, else the graph's first Canvas node, else null. `browser_request` is a browser waiting for the owner (`{node_id, reason, since}`), else null. `talk` is `{state: "on" \| "off" \| "unsupported", agent_node_id}` (the agent that answers the owner, which also joins `watch_node_ids`). `asks_first` is the hire's "ask me first" rule (built in Dev mode: whether it has an approval gate). `pending_changes` is true when the saved graph's structure differs from the live generation's snapshot |
+| `list_employees` | `{}` | `{employees}`; each summary's `canvas_node_id` is its Canvas board: the one it was hired with, else the graph's first Canvas node, else null. `browser_request` is a browser waiting for the owner (`{node_id, reason, since}`), else null. `talk` is `{state: "on" \| "off" \| "unsupported", agent_node_id}` (the agent that answers the owner; not in `watch_node_ids`). `task` is `{label, text}`, or null when the page already says it (a running employee with Talk on whose only work is the owner's messages). `asks_first` is the hire's "ask me first" rule (built in Dev mode: whether it has an approval gate). `pending_changes` is true when the saved graph's structure differs from the live generation's snapshot |
| `get_employee` | `{workflow_id}` | the summary plus `description`, `job`, `plan`, `rules`, `choices`, `trigger_text`, `last_run`, `latest_report` |
| `get_employee_usage` | `{}` | `{tasks_this_month}` (successful runs since the 1st, owner's timezone, whole team) |
| `generate_employee_setup` | `{job, refine?, history?, draft_token}` | `{draft_token, reply, provider, model, usage, retried, finish_reason, apps}`; `apps` maps each app the reply mentions to its AppRef plus `can_trigger` |