Files
orca/src/main/ipc/dashboard-agent-launch-validation.ts
T
Brennan Benson a30e3b9f61 feat(dashboard): add experimental agent map view (#12168)
* feat(dashboard): add experimental agent map view

* fix(dashboard): harden agent map behavior

* fix(dashboard): harden agent map recovery

* fix(dashboard): close map selection on view change

* fix(agent-map): center sparse layouts

* fix(agent-map): align completion and workspace actions

* Polish agent map interactions and repo labels

* feat(agent-map): add worktree lineage and project actions

* fix(agent-map): use marker for unread agents

* fix(agent-map): compact orchestrated families

* fix(dashboard): harden agent map actions and layout

* fix(agent-map): bound layout work and preserve interactions

* fix(agent-map): move unread marker to ring top-right

* fix(agent-map): seat unread marker on the ring's top-left edge

* feat(agent-map): restore the agent launcher and declutter map labels

Three gaps in the experimental Agent Map:

- The "start a new agent" picker was split onto a preserved branch during the
  08-02 rebase (47829cb226) and never re-landed. Restores that commit and its
  pop-out IPC, keyed on the raw worktree id rather than the map identity.
- Workspace labels draw at a fixed screen size with no collision handling, so a
  zoomed-out map stacked dozens of names on each other. Adds a declutter pass
  that seats project names first, then workspace names by attention, then
  project counts in whatever room is left.
- The pop-out had no workspace right-click at all: its renderer has no store, so
  the shared sidebar menu cannot mount there. Adds a snapshot-driven menu with
  the launcher and Sleep, relayed to the main renderer.

* refactor(agent-map): fold the map's filter rail into the shared toolbar filter

The rail duplicated the toolbar's project filter and cost the canvas 14rem of
width on the surface that needs it most. Agent states move into the toolbar's
Filter dropdown (map view only — the board's columns already separate them) and
count toward its badge; project filtering falls back to the toolbar's own. Show
all is the dropdown's Clear all, and Fit already lives in the viewport controls.

* fix(agent-map): isolate map work from main renderer

* perf(agent-map): stream status updates to popout

* fix(i18n): add agent map catalog entries

* feat(agent-map): glow working entities

* fix(agent-map): prioritize attention ring status

* fix(agent-map): distinguish subagent connectors
2026-08-05 22:57:16 -07:00

41 lines
1.2 KiB
TypeScript

import {
DASHBOARD_MAX_LAUNCH_WORKTREES,
type DashboardSpawnAgentArgs
} from '../../shared/dashboard-snapshot'
import { isTuiAgent } from '../../shared/tui-agent-config'
const MAX_ID_LENGTH = 4_096
const MAX_AGENTS_PER_WORKTREE = 64
function isBoundedId(value: unknown): value is string {
return typeof value === 'string' && value.length > 0 && value.length <= MAX_ID_LENGTH
}
export function isDashboardSpawnAgentArgs(value: unknown): value is DashboardSpawnAgentArgs {
if (!value || typeof value !== 'object' || Array.isArray(value)) {
return false
}
const args = value as Record<string, unknown>
return isBoundedId(args.worktreeId) && isTuiAgent(args.agent)
}
export function isDashboardLaunchOptions(value: unknown): boolean {
if (value === undefined) {
return true
}
if (!value || typeof value !== 'object' || Array.isArray(value)) {
return false
}
const entries = Object.entries(value as Record<string, unknown>)
return (
entries.length <= DASHBOARD_MAX_LAUNCH_WORKTREES &&
entries.every(
([worktreeId, agents]) =>
isBoundedId(worktreeId) &&
Array.isArray(agents) &&
agents.length <= MAX_AGENTS_PER_WORKTREE &&
agents.every(isTuiAgent)
)
)
}