@agimon-ai/doompi-team 0.0.1-alpha.92 → 0.0.1-alpha.94

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { defineActivityGroup, defineChannelFile, defineContextAction, defineFill, defineLeaderBinding, defineSessionStore, defineSlot, defineSlotFile, defineToolRenderer, defineWebPlugin, sessionApiPath } from "@agimon-ai/doompi-core/web";
1
+ import { defineActivityGroup, defineChannelFile, defineContextAction, defineFill, defineLeaderBinding, defineSessionStore, defineSlot, defineSlotFile, defineToolRenderer, defineWebPlugin, pluginApiUrl, sessionApiAddress } from "@agimon-ai/doompi-core/web";
2
2
  import { Badge, Button, CloseIcon, Dialog, DialogBody, DialogContent, DialogFooter, DialogHeader, DialogTitle, Dot, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, EmptyState, Input, Kbd, KebabIcon, MessageItem, MessageItemBody, MessageItemHeader, MessageItemStatus, Panel, STATUS_EDGE, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, Sheet, SheetBody, SheetContent, SheetHeader, SheetTitle, StatusBadge, Textarea, cn, toolTone } from "@agimon-ai/doompi-web-components";
3
3
  import { useStore } from "@tanstack/react-store";
4
4
  import { useEffect, useState } from "react";
@@ -9,6 +9,10 @@ const SUBAGENT_RUNS_TYPE = "subagent_runs";
9
9
  const SUBAGENT_CATALOG_TYPE = "subagent_catalog";
10
10
  //#endregion
11
11
  //#region src/extensions/workspaces/sessions/(frontend)/_lib/catalog.ts
12
+ /** The team API's address on a session, from the one builder every package API URL shares. */
13
+ function teamApiUrl(sessionId, path) {
14
+ return pluginApiUrl(sessionApiAddress(sessionId), "team", path);
15
+ }
12
16
  function isRecord$3(value) {
13
17
  return typeof value === "object" && value !== null && !Array.isArray(value);
14
18
  }
@@ -24,7 +28,7 @@ function isAgent(value) {
24
28
  }
25
29
  /** Read the selected session's catalog through the host's authenticated HTTP transport. */
26
30
  async function fetchCatalog(sessionId, signal) {
27
- const response = await sealedTransport.fetch(`${sessionApiPath(sessionId)}/plugins/team/catalog`, {
31
+ const response = await sealedTransport.fetch(teamApiUrl(sessionId, "/catalog"), {
28
32
  signal,
29
33
  cache: "no-store"
30
34
  });
@@ -39,7 +43,7 @@ async function fetchCatalog(sessionId, signal) {
39
43
  }
40
44
  /** Launch on the selected session host, without submitting a parent prompt. */
41
45
  async function launchAgent(sessionId, request) {
42
- const response = await sealedTransport.fetch(`${sessionApiPath(sessionId)}/plugins/team/run`, {
46
+ const response = await sealedTransport.fetch(teamApiUrl(sessionId, "/run"), {
43
47
  method: "POST",
44
48
  headers: { "content-type": "application/json" },
45
49
  body: JSON.stringify(request)
@@ -54,7 +58,7 @@ function isSteerState(value) {
54
58
  }
55
59
  /** Steer one run on the selected session host, without submitting a parent prompt. */
56
60
  async function steerRun(sessionId, runId, message) {
57
- const response = await sealedTransport.fetch(`${sessionApiPath(sessionId)}/plugins/team/steer`, {
61
+ const response = await sealedTransport.fetch(teamApiUrl(sessionId, "/steer"), {
58
62
  method: "POST",
59
63
  headers: { "content-type": "application/json" },
60
64
  body: JSON.stringify({
@@ -72,7 +76,7 @@ async function steerRun(sessionId, runId, message) {
72
76
  }
73
77
  /** Ask the selected session host to stop one run; the run's own status reports when it has. */
74
78
  async function stopRun(sessionId, runId) {
75
- const response = await sealedTransport.fetch(`${sessionApiPath(sessionId)}/plugins/team/stop`, {
79
+ const response = await sealedTransport.fetch(teamApiUrl(sessionId, "/stop"), {
76
80
  method: "POST",
77
81
  headers: { "content-type": "application/json" },
78
82
  body: JSON.stringify({ runId })
@@ -1 +1 @@
1
- {"version":3,"file":"web.mjs","names":["isRecord","isRecord","isRecord","TICK_MS","TICK_MS","activityGroupAgents","channelSubagentCatalog","channelSubagentRuns","actionLaunchAgent","fillAgents","leaderCatalog","leaderFleet","slotRunActions","toolIntercom","toolSubagent"],"sources":["../../src/types/webSubagents.ts","../../src/extensions/workspaces/sessions/(frontend)/_lib/catalog.ts","../../src/extensions/workspaces/sessions/(frontend)/_lib/catalogStore.ts","../../src/extensions/workspaces/sessions/(frontend)/_lib/format.ts","../../src/extensions/workspaces/sessions/(frontend)/_lib/runActionsSlot.ts","../../src/extensions/workspaces/sessions/(frontend)/_lib/subagentsStore.ts","../../src/extensions/workspaces/sessions/(frontend)/_lib/launchCommand.ts","../../src/extensions/workspaces/sessions/(frontend)/_components/AgentCatalogDrawer.tsx","../../src/extensions/workspaces/sessions/(frontend)/_components/RunControl.tsx","../../src/extensions/workspaces/sessions/(frontend)/_components/AgentThreadPanel.tsx","../../src/extensions/workspaces/sessions/(frontend)/_components/LaunchAgentDialog.tsx","../../src/extensions/workspaces/sessions/(frontend)/_components/SubagentsPanel.tsx","../../src/extensions/workspaces/sessions/(frontend)/action/launch-agent.web.ts","../../src/extensions/workspaces/sessions/(frontend)/activity-group/agents.web.ts","../../src/extensions/workspaces/sessions/(frontend)/channel/subagent-catalog.web.ts","../../src/extensions/workspaces/sessions/(frontend)/channel/subagent-runs.web.ts","../../src/extensions/workspaces/sessions/(frontend)/fill/_components/AgentsActivitySection.tsx","../../src/extensions/workspaces/sessions/(frontend)/fill/Agents.activity.agents.web.tsx","../../src/extensions/workspaces/sessions/(frontend)/leader/_lib/leaderGroups.ts","../../src/extensions/workspaces/sessions/(frontend)/leader/catalog.web.ts","../../src/extensions/workspaces/sessions/(frontend)/leader/fleet.web.ts","../../src/extensions/workspaces/sessions/(frontend)/slot/run-actions.web.ts","../../src/extensions/workspaces/sessions/(frontend)/tool/_lib/toolText.ts","../../src/extensions/workspaces/sessions/(frontend)/tool/_components/IntercomToolMessage.tsx","../../src/extensions/workspaces/sessions/(frontend)/tool/intercom.web.tsx","../../src/extensions/workspaces/sessions/(frontend)/tool/_components/SubagentToolMessage.tsx","../../src/extensions/workspaces/sessions/(frontend)/tool/subagent.web.tsx","../../generated/web.ts"],"sourcesContent":["/**\n * Subagent run view types shared by this package's hub channel and its web\n * plugin. The shapes mirror the per-run status files this package's own\n * runtime writes; the cockpit renders them as 'subagent_runs' channel\n * payloads.\n */\n\n/** Coarse run state the cockpit renders; rawState keeps doom-team's exact word. */\nexport type SubagentRunState = 'queued' | 'running' | 'done' | 'failed' | 'stopped';\n\n/**\n * One subagent run of a session, read from doom-team's per-run status file.\n */\nexport interface SubagentRun {\n runId: string;\n agent: string;\n /**\n * Generated addressable identity, for example `alan-reviewer-3`.\n *\n * Additive and optional: a run projected before identities existed, and any\n * run whose claim could not be written, still arrives without one.\n */\n identity?: string;\n /** True when this run came from a one-shot inline agent definition. */\n inline?: boolean;\n state: SubagentRunState;\n rawState: string;\n /** The delegation prompt the main agent gave this run. */\n task: string;\n /** A doom-task binding, when the delegation named one; wins over task in the card. */\n taskRef?: string;\n model?: string;\n cwd: string;\n /** The child transcript path, when the session host exposes one. */\n sessionFile?: string;\n /** Epoch milliseconds, as doom-team writes them. */\n startedAt: number;\n endedAt?: number;\n lastUpdate: number;\n /** Live one-liner of what the run is doing right now. */\n currentTool?: string;\n toolCount?: number;\n tokens?: number;\n cost?: number;\n /** Final report, present once the run finished. */\n summary?: string;\n /** Failure reason, present when the run failed. */\n error?: string;\n /** Recent output lines, oldest first, capped. */\n tail: string[];\n}\n\nexport const SUBAGENT_RUNS_TYPE = 'subagent_runs';\n\n/** How the runtime answered one steer: delivered, refused by the run, or not yet acknowledged. */\nexport interface SubagentSteerResult {\n state: 'delivered' | 'failed' | 'pending';\n message: string;\n}\n/** Where an agent definition came from; the catalog groups by it, nearest first. */\nexport type SubagentCatalogSource = 'project' | 'user' | 'plugin';\n\n/** One launchable agent, as the catalog lists it. */\nexport interface SubagentCatalogAgent {\n name: string;\n source: SubagentCatalogSource;\n /** The package that staged a plugin agent. */\n packageName?: string;\n description: string;\n /** The model the definition pins; absent means the runtime's default. */\n model?: string;\n fallbackModels: string[];\n /** Empty means the definition does not narrow the tool set. */\n tools: string[];\n skills: string[];\n extensions: string[];\n defaultContext: 'fresh' | 'fork';\n filePath: string;\n}\n\n/** The 'subagent_catalog' channel payload: the agents a session's directory can launch. */\nexport interface SubagentCatalogPayload {\n cwd: string;\n agents: SubagentCatalogAgent[];\n /** Model specs the active team package offers, for the launch dialog's picker. */\n models: string[];\n /** Why the list may be incomplete, when discovery failed. */\n warning?: string;\n}\n\nexport const SUBAGENT_CATALOG_TYPE = 'subagent_catalog';\n","import { sessionApiPath } from '@agimon-ai/doompi-core/web';\nimport { sealedTransport } from '@agimon-ai/doompi-web-security/browser';\n\nimport type {\n SubagentCatalogAgent,\n SubagentCatalogPayload,\n SubagentSteerResult,\n} from '../../../../../types/webSubagents';\nimport type { LaunchRequest } from './launchCommand';\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction isStrings(value: unknown): value is string[] {\n return Array.isArray(value) && value.every((item) => typeof item === 'string');\n}\n\nfunction isAgent(value: unknown): value is SubagentCatalogAgent {\n return (\n isRecord(value) &&\n typeof value.name === 'string' &&\n typeof value.description === 'string' &&\n typeof value.filePath === 'string' &&\n ['project', 'user', 'plugin'].includes(String(value.source)) &&\n (value.packageName === undefined || typeof value.packageName === 'string') &&\n (value.model === undefined || typeof value.model === 'string') &&\n isStrings(value.fallbackModels) &&\n isStrings(value.tools) &&\n isStrings(value.skills) &&\n isStrings(value.extensions) &&\n (value.defaultContext === 'fresh' || value.defaultContext === 'fork')\n );\n}\n\n/** Read the selected session's catalog through the host's authenticated HTTP transport. */\nexport async function fetchCatalog(sessionId: string, signal: AbortSignal): Promise<SubagentCatalogPayload> {\n const response = await sealedTransport.fetch(`${sessionApiPath(sessionId)}/plugins/team/catalog`, {\n signal,\n cache: 'no-store',\n });\n const body: unknown = await response.json();\n if (!response.ok) {\n throw new Error(\n isRecord(body) && typeof body.error === 'string'\n ? body.error\n : `Agent catalog could not be loaded (${response.status}).`,\n );\n }\n if (\n !isRecord(body) ||\n typeof body.cwd !== 'string' ||\n !Array.isArray(body.agents) ||\n !body.agents.every(isAgent) ||\n !isStrings(body.models)\n ) {\n throw new Error('The server returned an invalid agent catalog.');\n }\n return { cwd: body.cwd, agents: body.agents, models: body.models };\n}\n\n/** Launch on the selected session host, without submitting a parent prompt. */\nexport async function launchAgent(sessionId: string, request: LaunchRequest): Promise<string> {\n const response = await sealedTransport.fetch(`${sessionApiPath(sessionId)}/plugins/team/run`, {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify(request),\n });\n const body: unknown = await response.json();\n if (!response.ok) {\n throw new Error(\n isRecord(body) && typeof body.error === 'string'\n ? body.error\n : `Agent could not be launched (${response.status}).`,\n );\n }\n if (!isRecord(body) || typeof body.runId !== 'string' || body.runId === '')\n throw new Error('The server returned an invalid run ID.');\n return body.runId;\n}\n\nfunction isSteerState(value: unknown): value is SubagentSteerResult['state'] {\n return value === 'delivered' || value === 'failed' || value === 'pending';\n}\n\n/** Steer one run on the selected session host, without submitting a parent prompt. */\nexport async function steerRun(sessionId: string, runId: string, message: string): Promise<SubagentSteerResult> {\n const response = await sealedTransport.fetch(`${sessionApiPath(sessionId)}/plugins/team/steer`, {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify({ runId, message }),\n });\n const body: unknown = await response.json();\n if (!response.ok) {\n throw new Error(\n isRecord(body) && typeof body.error === 'string'\n ? body.error\n : `Guidance could not be sent (${response.status}).`,\n );\n }\n if (!isRecord(body) || !isSteerState(body.state) || typeof body.message !== 'string')\n throw new Error('The server returned an invalid steer result.');\n return { state: body.state, message: body.message };\n}\n\n/** Ask the selected session host to stop one run; the run's own status reports when it has. */\nexport async function stopRun(sessionId: string, runId: string): Promise<void> {\n const response = await sealedTransport.fetch(`${sessionApiPath(sessionId)}/plugins/team/stop`, {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify({ runId }),\n });\n const body: unknown = await response.json();\n if (!response.ok) {\n throw new Error(\n isRecord(body) && typeof body.error === 'string'\n ? body.error\n : `The run could not be stopped (${response.status}).`,\n );\n }\n}\n","import { defineSessionStore, type ContextActionRunContext, type TransientTab } from '@agimon-ai/doompi-core/web';\n\nimport {\n SUBAGENT_CATALOG_TYPE,\n type SubagentCatalogAgent,\n type SubagentCatalogPayload,\n} from '../../../../../types/webSubagents';\nimport { fetchCatalog } from './catalog';\n\n/** One session's catalog: what the hub last reported plus what the drawer is doing with it. */\nexport interface CatalogSession {\n cwd: string;\n agents: SubagentCatalogAgent[];\n models: string[];\n warning: string | undefined;\n loading: boolean;\n requestId: number;\n /** True while the catalog drawer is shown in the subagents tab. */\n open: boolean;\n filter: string;\n /** Task text carried from the surface that opened the catalog. */\n task: string;\n /** The highlighted row, by agent name. */\n selected: string | undefined;\n /** The row whose resources are unfolded. */\n inspected: string | undefined;\n /** The agent the launch dialog is open for, and the context it opened with. */\n launch: { agent: string; fork: boolean } | undefined;\n}\n\nexport const catalog = defineSessionStore<CatalogSession>({\n cwd: '',\n agents: [],\n models: [],\n warning: undefined,\n loading: false,\n requestId: 0,\n open: false,\n filter: '',\n task: '',\n selected: undefined,\n inspected: undefined,\n launch: undefined,\n});\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nexport function openCatalog(sessionId: string, task = ''): void {\n catalog.update(sessionId, (current) => ({ ...current, open: true, task }));\n}\n\n/** Opens the Team picker with context supplied by another installed plugin. */\nexport function openAgentCatalogForContext(context: ContextActionRunContext, tab: () => TransientTab): void {\n if (context.sessionId === null) return;\n openCatalog(context.sessionId, context.item.content);\n context.openTransientTab(tab());\n}\n\nexport function closeCatalog(sessionId: string): void {\n catalog.update(sessionId, (current) => ({ ...current, open: false, task: '', launch: undefined }));\n}\n\nexport function setCatalogFilter(sessionId: string, filter: string): void {\n catalog.update(sessionId, (current) => ({ ...current, filter }));\n}\n\nexport function selectAgent(sessionId: string, name: string | undefined): void {\n catalog.update(sessionId, (current) => ({ ...current, selected: name }));\n}\n\nexport function toggleInspect(sessionId: string, name: string): void {\n catalog.update(sessionId, (current) => ({ ...current, inspected: current.inspected === name ? undefined : name }));\n}\n\nexport function openLaunch(sessionId: string, agent: string, fork: boolean): void {\n catalog.update(sessionId, (current) => ({ ...current, selected: agent, launch: { agent, fork } }));\n}\n\nexport function closeLaunch(sessionId: string): void {\n catalog.update(sessionId, (current) => ({ ...current, launch: undefined }));\n}\n\n/** Each drawer opening owns one request and cancels it when the drawer leaves. */\nexport function loadCatalog(sessionId: string): () => void {\n const controller = new AbortController();\n const requestId = catalog.select(catalog.store.state, sessionId).requestId + 1;\n catalog.update(sessionId, (current) => ({ ...current, requestId, loading: true, warning: undefined }));\n const isCurrent = (): boolean =>\n !controller.signal.aborted && catalog.store.state[sessionId]?.requestId === requestId;\n void fetchCatalog(sessionId, controller.signal)\n .then((payload) => {\n if (isCurrent()) subagentCatalogChannel.apply(sessionId, payload);\n })\n .catch((error: unknown) => {\n if (isCurrent())\n catalog.update(sessionId, (current) => ({\n ...current,\n warning: error instanceof Error ? error.message : String(error),\n }));\n })\n .finally(() => {\n if (isCurrent()) catalog.update(sessionId, (current) => ({ ...current, loading: false }));\n });\n return () => {\n if (isCurrent()) catalog.update(sessionId, (current) => ({ ...current, loading: false }));\n controller.abort();\n };\n}\n\n/** The plugin's catalog channel: 'subagent_catalog' payloads into the store; the drawer's own state survives a refresh. */\nexport const subagentCatalogChannel = catalog.channel<SubagentCatalogPayload>({\n channel: SUBAGENT_CATALOG_TYPE,\n parse(input) {\n if (!isRecord(input) || typeof input.cwd !== 'string' || !Array.isArray(input.agents)) return null;\n const models = Array.isArray(input.models) ? input.models.filter((m): m is string => typeof m === 'string') : [];\n return {\n cwd: input.cwd,\n agents: input.agents.filter(isRecord) as unknown as SubagentCatalogAgent[],\n models,\n ...(typeof input.warning === 'string' ? { warning: input.warning } : {}),\n };\n },\n reduce(current, payload) {\n const names = new Set(payload.agents.map((agent) => agent.name));\n return {\n ...current,\n cwd: payload.cwd,\n agents: payload.agents,\n models: payload.models,\n warning: payload.warning,\n selected: current.selected !== undefined && names.has(current.selected) ? current.selected : undefined,\n inspected: current.inspected !== undefined && names.has(current.inspected) ? current.inspected : undefined,\n launch: current.launch !== undefined && names.has(current.launch.agent) ? current.launch : undefined,\n };\n },\n});\n","/**\n * Local copies of the host cockpit's pure formatters\n * (doompi-web src/web/lib/sessionSummary.ts): this plugin ships zero host\n * imports so the cockpit's bundler can compile it from any install.\n */\nconst MINUTE_MS = 60 * 1000;\nconst HOUR_MS = 60 * MINUTE_MS;\n\nexport function formatRunDuration(elapsedMs: number): string {\n if (elapsedMs < MINUTE_MS) return '<1m';\n if (elapsedMs < HOUR_MS) return `${Math.floor(elapsedMs / MINUTE_MS)}m`;\n const hours = Math.floor(elapsedMs / HOUR_MS);\n const minutes = Math.floor((elapsedMs % HOUR_MS) / MINUTE_MS);\n return `${hours}h ${String(minutes).padStart(2, '0')}m`;\n}\n\nexport function abbreviateCwd(cwd: string): string {\n const match = /^\\/(?:Users|home)\\/[^/]+/u.exec(cwd);\n if (!match) return cwd;\n return `~${cwd.slice(match[0].length)}`;\n}\n\n/**\n * What to call a run on screen.\n *\n * Prefers the generated identity, because a fan-out of one agent otherwise\n * renders as N rows reading the same word. Falls back to the agent name for a\n * run projected before identities existed. Duplicated rather than imported\n * from `services/agentIdentity`, which reaches for `node:fs` and so cannot be\n * pulled into the browser bundle; that module owns minting, this owns display.\n */\nexport function agentRunLabel(run: { agent: string; identity?: string; inline?: boolean }): string {\n const base = run.identity ?? run.agent;\n return run.inline ? `${base} (inline)` : base;\n}\n","import { defineSlot } from '@agimon-ai/doompi-core/web';\n\n/**\n * The slot the run detail sheet opens beside its stop control: an independent\n * plugin may put its own action for the shown run there, without this\n * package knowing it exists. Fills receive the panel's own props.\n */\nexport const RUN_ACTIONS_SLOT = defineSlot({ slot: 'subagents.run-actions' });\n","import { defineSessionStore } from '@agimon-ai/doompi-core/web';\n\nimport { SUBAGENT_RUNS_TYPE, type SubagentRun } from '../../../../../types/webSubagents';\nimport { stopRun } from './catalog';\nconst TERMINAL_STATES: ReadonlySet<SubagentRun['state']> = new Set(['done', 'failed', 'stopped']);\n\nexport function isTerminalRun(run: SubagentRun): boolean {\n return TERMINAL_STATES.has(run.state);\n}\n\n/** One session's record: the fleet the hub last reported plus what this page did with it. */\nexport interface SubagentsSession {\n /** The fleet the hub last reported; presented order preserved. */\n runs: SubagentRun[];\n /** Finished runs the reader cleared from the grid; they stay on disk and in the hub's feed. */\n dismissed: string[];\n /** Runs a stop was asked for and that have not yet reported a final state. */\n stopRequested: string[];\n /** The run whose detail sheet the subagents tab shows. */\n openRunId: string | undefined;\n /** A launch this page asked for, until a run of that agent it had not seen shows up. */\n pendingLaunch: { agent: string; knownRunIds: string[] } | undefined;\n /** The run a launch produced, for the tab to open once and forget. */\n autoOpenRunId: string | undefined;\n}\n\nexport const subagents = defineSessionStore<SubagentsSession>({\n runs: [],\n dismissed: [],\n stopRequested: [],\n openRunId: undefined,\n pendingLaunch: undefined,\n autoOpenRunId: undefined,\n});\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction without(list: readonly string[], runId: string): string[] {\n return list.filter((id) => id !== runId);\n}\n\n/** The full Subagents tab's runs minus the ones the reader dismissed. */\nexport function visibleRuns(session: SubagentsSession): SubagentRun[] {\n return session.dismissed.length === 0\n ? session.runs\n : session.runs.filter((run) => !session.dismissed.includes(run.runId));\n}\n\n/** Only runs that can still be doing work belong in the activity group. */\nexport function activityRuns(session: SubagentsSession): SubagentRun[] {\n return visibleRuns(session).filter((run) => run.state === 'queued' || run.state === 'running');\n}\n\n/**\n * Asks the session host to stop a run over the Team API, never as a parent\n * prompt: the web host does not know Team's slash commands and refuses\n * prompts mid-turn. Marked at once so the control reads \"stopping\"; rolled\n * back and rethrown if the host refuses. Once accepted, the request stands\n * until the run reports a final state.\n */\nexport async function requestRunStop(sessionId: string, runId: string): Promise<void> {\n subagents.update(sessionId, (current) => ({\n ...current,\n stopRequested: [...without(current.stopRequested, runId), runId],\n }));\n try {\n await stopRun(sessionId, runId);\n } catch (error) {\n subagents.update(sessionId, (current) => ({ ...current, stopRequested: without(current.stopRequested, runId) }));\n throw error;\n }\n}\n\n/** Hides a finished run from this page; nothing is deleted. */\nexport function dismissRun(sessionId: string, runId: string): void {\n subagents.update(sessionId, (current) => ({\n ...current,\n dismissed: [...without(current.dismissed, runId), runId],\n openRunId: current.openRunId === runId ? undefined : current.openRunId,\n }));\n}\n\n/** Remember the fleet before the server launch so its first update can open the new run. */\nexport function requestLaunch(sessionId: string, agent: string): void {\n subagents.update(sessionId, (current) => ({\n ...current,\n pendingLaunch: { agent, knownRunIds: current.runs.map((run) => run.runId) },\n }));\n}\n\nexport function clearPendingLaunch(sessionId: string): void {\n subagents.update(sessionId, (current) => ({ ...current, pendingLaunch: undefined }));\n}\n\nexport function clearAutoOpen(sessionId: string): void {\n subagents.update(sessionId, (current) => ({ ...current, autoOpenRunId: undefined }));\n}\n\nexport function openRun(sessionId: string, runId: string | undefined): void {\n subagents.update(sessionId, (current) => ({ ...current, openRunId: runId }));\n}\n\nexport interface SubagentRunsPayload {\n runs: SubagentRun[];\n}\n\n/** The plugin's session data channel: 'subagent_runs' payloads into the store. */\nexport const subagentRunsChannel = subagents.channel<SubagentRunsPayload>({\n channel: SUBAGENT_RUNS_TYPE,\n parse(input) {\n if (!isRecord(input) || !Array.isArray(input.runs)) return null;\n return { runs: input.runs.filter(isRecord) as unknown as SubagentRun[] };\n },\n reduce(current, { runs }) {\n const present = new Map(runs.map((run) => [run.runId, run]));\n // A stop request is spent once the run reports a final state or leaves\n // the feed; a dismissal is forgotten once the run is gone from the feed.\n const stopRequested = current.stopRequested.filter((runId) => {\n const run = present.get(runId);\n return run !== undefined && !isTerminalRun(run);\n });\n const dismissed = current.dismissed.filter((runId) => present.has(runId));\n // The run a launch asked for is the first of that agent the page had not seen.\n const arrived =\n current.pendingLaunch === undefined\n ? undefined\n : runs.find(\n (run) =>\n run.agent === current.pendingLaunch?.agent && !current.pendingLaunch.knownRunIds.includes(run.runId),\n );\n return {\n ...current,\n runs,\n stopRequested,\n dismissed,\n pendingLaunch: arrived === undefined ? current.pendingLaunch : undefined,\n autoOpenRunId: arrived === undefined ? current.autoOpenRunId : arrived.runId,\n };\n },\n});\n","import type { SubagentCatalogAgent, SubagentCatalogSource } from '../../../../../types/webSubagents';\n\nconst META_TOOL_LIMIT = 3;\n\nexport interface LaunchRequest {\n agent: string;\n task: string;\n /** A pinned model overrides the agent's default; absent keeps the agent's own. */\n model?: string;\n fork: boolean;\n}\n\n/** Rows whose name, source, package, description or a tool contains the filter, case-insensitively. */\nexport function filterCatalog(agents: readonly SubagentCatalogAgent[], filter: string): SubagentCatalogAgent[] {\n const needle = filter.trim().toLowerCase();\n if (needle === '') return [...agents];\n return agents.filter((agent) =>\n [agent.name, agent.source, agent.packageName ?? '', agent.description, ...agent.tools].some((field) =>\n field.toLowerCase().includes(needle),\n ),\n );\n}\n\nexport interface CatalogSection {\n source: SubagentCatalogSource;\n label: string;\n agents: SubagentCatalogAgent[];\n}\n\nconst SECTION_LABEL: Readonly<Record<SubagentCatalogSource, string>> = {\n project: 'PROJECT',\n user: 'USER',\n plugin: 'PACKAGES',\n};\n\n/** The catalog's sections, nearest source first, keeping the payload's order inside each; empty ones are left out. */\nexport function groupCatalog(agents: readonly SubagentCatalogAgent[]): CatalogSection[] {\n const sections: CatalogSection[] = [];\n for (const source of ['project', 'user', 'plugin'] as const) {\n const members = agents.filter((agent) => agent.source === source);\n if (members.length > 0) sections.push({ source, label: SECTION_LABEL[source], agents: members });\n }\n return sections;\n}\n\n/** What the picker offers: the agent's own model and fallbacks first, then the team's, without repeats. */\nexport function modelChoices(agent: SubagentCatalogAgent, models: readonly string[]): string[] {\n const seen = new Set<string>();\n const choices: string[] = [];\n for (const model of [agent.model ?? '', ...agent.fallbackModels, ...models]) {\n if (model === '' || seen.has(model)) continue;\n seen.add(model);\n choices.push(model);\n }\n return choices;\n}\n\n/** The row's one-liner: what tools it may use, how many skills, and how it starts. */\nexport function agentMeta(agent: SubagentCatalogAgent): string {\n const tools =\n agent.tools.length === 0\n ? 'all tools'\n : `tools ${agent.tools.slice(0, META_TOOL_LIMIT).join(', ')}${\n agent.tools.length > META_TOOL_LIMIT ? ` +${agent.tools.length - META_TOOL_LIMIT}` : ''\n }`;\n const skills =\n agent.skills.length > 0 ? ` · ${agent.skills.length} skill${agent.skills.length === 1 ? '' : 's'}` : '';\n return `${tools}${skills} · ${agent.defaultContext === 'fork' ? 'forks the session' : 'fresh context'}`;\n}\n","import { Badge, Button, CloseIcon, Input, Kbd } from '@agimon-ai/doompi-web-components';\nimport { useStore } from '@tanstack/react-store';\nimport type { KeyboardEvent as ReactKeyboardEvent } from 'react';\n\nimport type { SubagentCatalogAgent } from '../../../../../types/webSubagents';\nimport { catalog, selectAgent, setCatalogFilter, toggleInspect } from '../_lib/catalogStore';\nimport { agentMeta, filterCatalog, groupCatalog } from '../_lib/launchCommand';\n\nconst INPUT_TAG = 'INPUT';\n\nfunction shortModel(model: string): string {\n return model.split('/').pop() ?? model;\n}\n\n/** The unfolded row: what the definition names, read-only, the way the TUI catalog's tabs show it. */\nfunction Resources({ agent }: { agent: SubagentCatalogAgent }) {\n const rows: Array<[string, string]> = [\n ['tools', agent.tools.length > 0 ? agent.tools.join(', ') : 'every tool the session has'],\n ['skills', agent.skills.length > 0 ? agent.skills.join(', ') : 'none named'],\n ['extensions', agent.extensions.length > 0 ? agent.extensions.join(', ') : 'none named'],\n ['model', agent.model ?? 'runtime default'],\n ['file', agent.filePath],\n ];\n return (\n <dl data-testid={`catalog-resources-${agent.name}`} className=\"flex flex-col gap-1 pt-1 text-2xs\">\n {rows.map(([label, value]) => (\n <div key={label} className=\"flex gap-2\">\n <dt className=\"w-16 shrink-0 text-doom-faint\">{label}</dt>\n <dd className=\"min-w-0 break-words text-doom-dim\">{value}</dd>\n </div>\n ))}\n </dl>\n );\n}\n\nfunction AgentRow({\n agent,\n selected,\n inspected,\n onSelect,\n onLaunch,\n onInspect,\n}: {\n agent: SubagentCatalogAgent;\n selected: boolean;\n inspected: boolean;\n onSelect: () => void;\n onLaunch: (fork: boolean) => void;\n onInspect: () => void;\n}) {\n // A div rather than a button: the selected row carries buttons of its own.\n return (\n <div\n role=\"option\"\n aria-selected={selected}\n tabIndex={-1}\n data-testid={`catalog-agent-${agent.name}`}\n data-selected={selected}\n onClick={onSelect}\n onDoubleClick={() => onLaunch(false)}\n className={`flex cursor-pointer flex-col gap-1 border-l-2 px-4 py-2 ${\n selected ? 'border-doom-blue bg-doom-panel' : 'border-transparent hover:bg-doom-panel/60'\n }`}\n >\n <div className=\"flex min-w-0 items-center gap-2\">\n <span className=\"truncate text-sm font-bold text-doom-hi\">{agent.name}</span>\n <Badge size=\"xs\" className=\"shrink-0\">\n {agent.packageName ?? agent.source}\n </Badge>\n <span className=\"min-w-0 flex-1\" />\n <span className={`shrink-0 text-2xs ${agent.model ? 'text-doom-cyan' : 'text-doom-faint'}`}>\n {agent.model ? shortModel(agent.model) : 'agent default'}\n </span>\n </div>\n <span className=\"truncate text-xs text-doom-dim\">{agent.description}</span>\n <span className=\"truncate text-2xs text-doom-faint\">{agentMeta(agent)}</span>\n {selected ? (\n <div className=\"flex items-center gap-3 pt-0.5\">\n <Button\n variant=\"link\"\n size=\"xs\"\n data-testid={`catalog-launch-${agent.name}`}\n className=\"px-0\"\n onClick={(event) => {\n event.stopPropagation();\n onLaunch(false);\n }}\n >\n launch <Kbd>↵</Kbd>\n </Button>\n <Button\n variant=\"link\"\n size=\"xs\"\n data-testid={`catalog-fork-${agent.name}`}\n className=\"px-0 text-doom-dim\"\n onClick={(event) => {\n event.stopPropagation();\n onLaunch(true);\n }}\n >\n fork session <Kbd>f</Kbd>\n </Button>\n <Button\n variant=\"link\"\n size=\"xs\"\n data-testid={`catalog-inspect-${agent.name}`}\n className=\"px-0 text-doom-dim\"\n onClick={(event) => {\n event.stopPropagation();\n onInspect();\n }}\n >\n inspect <Kbd>i</Kbd>\n </Button>\n </div>\n ) : null}\n {selected && inspected ? <Resources agent={agent} /> : null}\n </div>\n );\n}\n\n/**\n * The agent catalog, in the subagents tab's drawer: every agent the session's\n * directory can launch, nearest definition first, with a filter and keys the\n * TUI catalog also answers to. Launching hands the chosen agent to the dialog.\n */\nexport function AgentCatalogDrawer({\n sessionId,\n onClose,\n onLaunch,\n}: {\n sessionId: string;\n onClose: () => void;\n onLaunch: (agent: SubagentCatalogAgent, fork: boolean) => void;\n}) {\n const state = useStore(catalog.store, (current) => catalog.select(current, sessionId));\n const shown = filterCatalog(state.agents, state.filter);\n const sections = groupCatalog(shown);\n const selected = shown.find((agent) => agent.name === state.selected) ?? shown[0];\n\n const move = (delta: number): void => {\n if (shown.length === 0) return;\n const index = selected === undefined ? -1 : shown.findIndex((agent) => agent.name === selected.name);\n const next = shown[(index + delta + shown.length) % shown.length];\n if (next) selectAgent(sessionId, next.name);\n };\n\n const onKeyDown = (event: ReactKeyboardEvent<HTMLElement>): void => {\n const typing = (event.target as HTMLElement).tagName === INPUT_TAG;\n if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n event.preventDefault();\n move(event.key === 'ArrowDown' ? 1 : -1);\n return;\n }\n if (event.key === 'Escape') {\n event.preventDefault();\n onClose();\n return;\n }\n if (selected === undefined) return;\n if (event.key === 'Enter') {\n event.preventDefault();\n onLaunch(selected, false);\n return;\n }\n if (typing) return;\n if (event.key === 'f') onLaunch(selected, true);\n if (event.key === 'i') toggleInspect(sessionId, selected.name);\n };\n\n return (\n <aside\n data-testid=\"catalog-drawer\"\n tabIndex={0}\n onKeyDown={onKeyDown}\n className=\"flex w-[min(440px,calc(100vw-24px))] shrink-0 flex-col overflow-hidden border-l border-doom-border bg-doom-rail outline-none\"\n >\n <div className=\"flex h-11 shrink-0 items-center gap-2.5 border-b border-doom-border px-4\">\n <span className=\"text-base font-bold text-doom-hi\">agent catalog</span>\n <Badge size=\"xs\" data-testid=\"catalog-count\">\n {state.agents.length} agent{state.agents.length === 1 ? '' : 's'}\n </Badge>\n <span className=\"min-w-0 flex-1\" />\n <Kbd>SPC a l</Kbd>\n <Button variant=\"ghost\" size=\"icon\" data-testid=\"catalog-close\" title=\"close the catalog\" onClick={onClose}>\n <CloseIcon className=\"h-3 w-3\" />\n </Button>\n </div>\n <div className=\"px-4 pt-2.5 pb-1.5\">\n <Input\n data-testid=\"catalog-filter\"\n value={state.filter}\n placeholder=\"filter by name, source, or tool…\"\n autoFocus\n onChange={(event) => setCatalogFilter(sessionId, event.target.value)}\n />\n </div>\n <div role=\"listbox\" className=\"flex min-h-0 flex-1 flex-col overflow-y-auto pb-2\">\n {state.loading ? (\n <p role=\"status\" className=\"px-4 py-3 text-xs text-doom-faint\">\n loading agents...\n </p>\n ) : null}\n {state.warning ? (\n <p role=\"alert\" className=\"px-4 py-3 text-xs text-doom-red\">\n {state.warning}\n </p>\n ) : null}\n {shown.length === 0 && !state.loading && !state.warning ? (\n <p data-testid=\"catalog-empty\" className=\"px-4 py-3 text-xs text-doom-faint\">\n {state.agents.length === 0\n ? 'no agents found for this session; add one under .doom/agents or ~/.doompi/agent/agents'\n : 'nothing matches the filter'}\n </p>\n ) : null}\n {sections.map((section) => (\n <div key={section.source} className=\"flex flex-col\">\n <span className=\"px-4 pt-2.5 pb-1 text-2xs font-bold tracking-widest text-doom-faint\">{section.label}</span>\n {section.agents.map((agent) => (\n <AgentRow\n key={agent.name}\n agent={agent}\n selected={selected?.name === agent.name}\n inspected={state.inspected === agent.name}\n onSelect={() => selectAgent(sessionId, agent.name)}\n onLaunch={(fork) => onLaunch(agent, fork)}\n onInspect={() => toggleInspect(sessionId, agent.name)}\n />\n ))}\n </div>\n ))}\n </div>\n <div className=\"flex h-8 shrink-0 items-center justify-between border-t border-doom-border-soft bg-doom-deep px-4\">\n <span className=\"text-2xs text-doom-faint\">↑↓ choose · enter launch · f fork · i inspect · esc close</span>\n <span className=\"text-2xs text-doom-faint\">\n {sections.length} source{sections.length === 1 ? '' : 's'}\n </span>\n </div>\n </aside>\n );\n}\n","import { Button, type StatusTone } from '@agimon-ai/doompi-web-components';\nimport { type MouseEvent as ReactMouseEvent, useState } from 'react';\n\nimport type { SubagentRun, SubagentRunState } from '../../../../../types/webSubagents';\nimport { formatRunDuration } from '../_lib/format';\nimport { dismissRun, isTerminalRun, requestRunStop } from '../_lib/subagentsStore';\n\n/** One run state, in the host's shared outcome vocabulary. */\nexport const RUN_BADGE: Readonly<Record<SubagentRunState, { label: string; tone: StatusTone }>> = {\n queued: { label: 'QUEUED', tone: 'neutral' },\n running: { label: 'RUNNING', tone: 'running' },\n done: { label: 'DONE', tone: 'ok' },\n failed: { label: 'FAILED', tone: 'error' },\n stopped: { label: 'STOPPED', tone: 'neutral' },\n};\n\n/** How long the run has been going, or took; the clock only matters while it is active. */\nexport function elapsedRun(run: SubagentRun, now: number): string {\n const end = run.endedAt ?? (run.state === 'running' || run.state === 'queued' ? now : run.lastUpdate);\n return formatRunDuration(Math.max(0, end - run.startedAt));\n}\n\n/**\n * The one control a run offers: stop while it is active, clear once it is\n * not. Stop is a request the runtime acknowledges in its own time, so the\n * button reads \"stopping\" until the run's own status says otherwise; a\n * refused request says why next to the button.\n */\nexport function RunControl({ sessionId, run, stopping }: { sessionId: string; run: SubagentRun; stopping: boolean }) {\n const [error, setError] = useState<string | undefined>();\n const act = (event: ReactMouseEvent, action: () => void): void => {\n event.stopPropagation();\n action();\n };\n const stop = (): void => {\n setError(undefined);\n requestRunStop(sessionId, run.runId).catch((cause: unknown) =>\n setError(cause instanceof Error ? cause.message : String(cause)),\n );\n };\n if (isTerminalRun(run)) {\n return (\n <Button\n variant=\"outline\"\n size=\"xs\"\n data-testid={`run-clear-${run.runId}`}\n title=\"clear this run from the grid\"\n onClick={(event) => act(event, () => dismissRun(sessionId, run.runId))}\n >\n clear\n </Button>\n );\n }\n return (\n <>\n {error ? (\n <span\n role=\"alert\"\n data-testid={`run-stop-error-${run.runId}`}\n title={error}\n className=\"min-w-0 truncate text-2xs text-doom-red\"\n >\n {error}\n </span>\n ) : null}\n <Button\n variant={stopping ? 'outline' : 'danger-outline'}\n size=\"xs\"\n data-testid={`run-stop-${run.runId}`}\n data-stopping={stopping}\n disabled={stopping}\n title={stopping ? 'stop requested; the run reports its own final state' : 'ask the runtime to stop this run'}\n onClick={(event) => act(event, stop)}\n >\n {stopping ? 'stopping…' : 'stop'}\n </Button>\n </>\n );\n}\n","import type { TransientTab, WebPluginSlotProps } from '@agimon-ai/doompi-core/web';\nimport { Button, StatusBadge, Textarea } from '@agimon-ai/doompi-web-components';\nimport { useStore } from '@tanstack/react-store';\nimport { type FormEvent, useEffect, useState } from 'react';\n\nimport type { SubagentRun } from '../../../../../types/webSubagents';\nimport { steerRun } from '../_lib/catalog';\nimport { agentRunLabel } from '../_lib/format';\nimport { isTerminalRun, subagents } from '../_lib/subagentsStore';\nimport { elapsedRun, RUN_BADGE, RunControl } from './RunControl';\n\nconst TICK_MS = 10_000;\n/** The tab id doubles as the URL segment, so it stays plain and unique across plugins. */\nconst TAB_ID_PREFIX = 'subagents-run-';\n\n/** The temporary tab for one run; the host keeps this panel for as long as the tab is open. */\nexport function agentThreadTab(run: SubagentRun): TransientTab {\n const runId = run.runId;\n return {\n id: `${TAB_ID_PREFIX}${runId}`,\n label: agentRunLabel(run),\n panel: (props: WebPluginSlotProps) => <AgentThreadPanel {...props} runId={runId} />,\n };\n}\n\n/**\n * A run's own conversation on the host's transcript, under a header with\n * what the grid card knows: state, elapsed, model, the prompt's first line,\n * and stop while the run is going. The run can leave the fleet feed before\n * the reader is done; the thread stays, and the header says so.\n */\nexport function AgentThreadPanel({ sessionId, runId, renderThread }: WebPluginSlotProps & { runId: string }) {\n const { runs, stopRequested } = useStore(subagents.store, (state) => subagents.select(state, sessionId));\n const run = runs.find((candidate) => candidate.runId === runId);\n const [now, setNow] = useState(() => Date.now());\n const [guidance, setGuidance] = useState('');\n const [sending, setSending] = useState(false);\n const [error, setError] = useState<string | undefined>();\n const [notice, setNotice] = useState<string | undefined>();\n\n useEffect(() => {\n const timer = setInterval(() => setNow(Date.now()), TICK_MS);\n return () => clearInterval(timer);\n }, []);\n\n const firstLine = run?.task.split('\\n').find((line) => line.trim() !== '') ?? '';\n const canSteer = sessionId !== null && run !== undefined && !isTerminalRun(run);\n // Not a prompt frame: the web host does not know Team's slash commands and refuses prompts mid-turn.\n const submitGuidance = async (event: FormEvent<HTMLFormElement>): Promise<void> => {\n event.preventDefault();\n const message = guidance.trim();\n if (!canSteer || !message || sending) return;\n setSending(true);\n setError(undefined);\n setNotice(undefined);\n try {\n const result = await steerRun(sessionId, runId, message);\n if (result.state === 'failed') {\n setError(result.message);\n return;\n }\n setGuidance('');\n if (result.state === 'pending') setNotice(result.message);\n } catch (cause) {\n setError(cause instanceof Error ? cause.message : String(cause));\n } finally {\n setSending(false);\n }\n };\n\n return (\n <div data-testid=\"agent-thread-panel\" className=\"flex min-h-0 flex-1 flex-col\">\n <div\n data-testid=\"agent-thread-header\"\n className=\"flex h-10 shrink-0 items-center gap-2.5 border-b border-doom-border-soft px-[26px]\"\n >\n {run ? (\n <>\n <span data-testid=\"agent-thread-agent\" className=\"shrink-0 truncate text-sm font-bold text-doom-hi\">\n {agentRunLabel(run)}\n </span>\n <StatusBadge tone={RUN_BADGE[run.state].tone} data-testid=\"agent-thread-state\">\n {RUN_BADGE[run.state].label}\n </StatusBadge>\n <span className=\"shrink-0 text-xs text-doom-faint\">{elapsedRun(run, now)}</span>\n {run.model ? (\n <span className=\"shrink-0 text-xs text-doom-faint\">{run.model.split('/').pop() ?? run.model}</span>\n ) : null}\n <span data-testid=\"agent-thread-task\" className=\"min-w-0 flex-1 truncate text-xs text-doom-dim\">\n {firstLine}\n </span>\n {sessionId !== null && !isTerminalRun(run) ? (\n <RunControl sessionId={sessionId} run={run} stopping={stopRequested.includes(run.runId)} />\n ) : null}\n </>\n ) : (\n <span data-testid=\"agent-thread-gone\" className=\"text-xs text-doom-faint\">\n run {runId.slice(0, 8)} is no longer listed; its transcript stays readable\n </span>\n )}\n </div>\n {renderThread(runId)}\n {canSteer ? (\n <form\n data-testid=\"agent-steer-composer\"\n className=\"shrink-0 border-t border-doom-border-soft bg-doom-rail px-[26px] pt-3 pb-2.5\"\n onSubmit={(event) => void submitGuidance(event)}\n >\n <div className=\"rounded-lg border border-doom-border bg-doom-deep transition-colors focus-within:border-doom-blue/60\">\n <div className=\"flex min-w-0 items-start gap-2.5 px-3.5 pt-3\">\n <span className=\"mt-[3px] shrink-0 select-none text-base leading-none text-doom-green\">&gt;</span>\n <Textarea\n variant=\"bare\"\n data-testid=\"agent-steer-input\"\n aria-label=\"Steering guidance\"\n rows={2}\n value={guidance}\n readOnly={sending}\n placeholder=\"Guide this agent…\"\n className=\"min-w-0 flex-1 text-base leading-relaxed\"\n onChange={(event) => setGuidance(event.target.value)}\n />\n </div>\n {error ? (\n <p role=\"alert\" data-testid=\"agent-steer-error\" className=\"px-3.5 pt-2 text-xs text-doom-red\">\n {error}\n </p>\n ) : null}\n <div className=\"flex items-center gap-2 px-3.5 pt-2 pb-2.5\">\n <span role=\"status\" data-testid=\"agent-steer-hint\" className=\"min-w-0 truncate text-xs text-doom-faint\">\n {notice ?? 'guidance reaches this run while it is still working'}\n </span>\n <span className=\"min-w-0 flex-1\" />\n <Button\n data-testid=\"agent-steer-submit\"\n type=\"submit\"\n variant=\"primary\"\n size=\"md\"\n className=\"px-3.5\"\n disabled={sending || guidance.trim() === ''}\n >\n {sending ? 'sending…' : 'send'}\n </Button>\n </div>\n </div>\n </form>\n ) : null}\n </div>\n );\n}\n","import {\n Badge,\n Button,\n Dialog,\n DialogBody,\n DialogContent,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n Textarea,\n} from '@agimon-ai/doompi-web-components';\nimport { type KeyboardEvent as ReactKeyboardEvent, useState } from 'react';\n\nimport type { SubagentCatalogAgent } from '../../../../../types/webSubagents';\nimport { launchAgent } from '../_lib/catalog';\nimport { abbreviateCwd } from '../_lib/format';\nimport { type LaunchRequest, modelChoices } from '../_lib/launchCommand';\nimport { clearPendingLaunch, requestLaunch } from '../_lib/subagentsStore';\n\n/** The picker's stand-in for \"no override\"; a Radix item cannot carry an empty value. */\nconst AGENT_DEFAULT = 'agent-default';\nconst TASK_ROWS = 4;\n\nfunction FieldLabel({ children }: { children: string }) {\n return <span className=\"text-2xs font-bold tracking-widest text-doom-faint\">{children}</span>;\n}\n\n/**\n * Launches one agent from the catalog: the task, whether the child forks\n * this session, and a model override. The session server starts the child.\n */\nexport function LaunchAgentDialog({\n sessionId,\n agent,\n cwd,\n models,\n fork: initialFork,\n initialTask,\n onClose,\n onLaunched,\n}: {\n sessionId: string;\n agent: SubagentCatalogAgent;\n cwd: string;\n models: readonly string[];\n fork: boolean;\n initialTask: string;\n onClose: () => void;\n onLaunched: () => void;\n}) {\n const [task, setTask] = useState(initialTask);\n const [fork, setFork] = useState(initialFork);\n const [model, setModel] = useState(AGENT_DEFAULT);\n const [busy, setBusy] = useState(false);\n const [error, setError] = useState<string | undefined>();\n const request: LaunchRequest = { agent: agent.name, task, fork, ...(model === AGENT_DEFAULT ? {} : { model }) };\n\n const launch = async (): Promise<void> => {\n if (busy) return;\n setBusy(true);\n setError(undefined);\n requestLaunch(sessionId, agent.name);\n try {\n await launchAgent(sessionId, request);\n onLaunched();\n } catch (cause) {\n clearPendingLaunch(sessionId);\n setError(cause instanceof Error ? cause.message : String(cause));\n } finally {\n setBusy(false);\n }\n };\n const onTaskKeyDown = (event: ReactKeyboardEvent<HTMLTextAreaElement>): void => {\n if (event.key === 'Enter' && !event.shiftKey) {\n event.preventDefault();\n void launch();\n }\n };\n\n return (\n <Dialog\n open\n onOpenChange={(open) => {\n if (!open) onClose();\n }}\n >\n <DialogContent width=\"lg\" data-testid=\"launch-dialog\" aria-describedby={undefined}>\n <DialogHeader>\n <div className=\"flex min-w-0 flex-col items-start gap-1 sm:flex-row sm:items-center sm:gap-2.5\">\n <span className=\"text-2xs text-doom-faint\">launch subagent</span>\n <DialogTitle data-testid=\"launch-agent\" className=\"max-w-full break-words\">\n {agent.name}\n </DialogTitle>\n <Badge size=\"xs\" className=\"max-w-full truncate\">\n {agent.packageName ?? agent.source}\n </Badge>\n </div>\n </DialogHeader>\n <DialogBody>\n <p className=\"text-sm leading-relaxed text-doom-dim\">{agent.description}</p>\n <div className=\"flex flex-col gap-1.5\">\n <FieldLabel>TASK</FieldLabel>\n <Textarea\n data-testid=\"launch-task\"\n autoFocus\n rows={TASK_ROWS}\n value={task}\n placeholder=\"what should the agent do? empty runs its own prompt\"\n onChange={(event) => setTask(event.target.value)}\n onKeyDown={onTaskKeyDown}\n />\n <span className=\"text-2xs text-doom-faint\">enter launches · shift+enter for a new line · @ for files</span>\n </div>\n <div className=\"flex flex-wrap gap-5\">\n <div className=\"flex flex-col gap-1.5\">\n <FieldLabel>CONTEXT</FieldLabel>\n <div className=\"flex flex-wrap gap-1.5\">\n <Button\n variant={fork ? 'outline' : 'primary'}\n size=\"xs\"\n data-testid=\"launch-fresh\"\n data-active={!fork}\n onClick={() => setFork(false)}\n >\n fresh\n </Button>\n <Button\n variant={fork ? 'primary' : 'outline'}\n size=\"xs\"\n data-testid=\"launch-fork\"\n data-active={fork}\n onClick={() => setFork(true)}\n >\n fork this session\n </Button>\n </div>\n <span className=\"text-2xs text-doom-faint\">fork shares the conversation so far</span>\n </div>\n <div className=\"flex flex-col gap-1.5\">\n <FieldLabel>MODEL</FieldLabel>\n <Select value={model} onValueChange={setModel}>\n <SelectTrigger data-testid=\"launch-model\" className=\"h-7 w-full min-w-0 text-xs sm:min-w-[200px]\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value={AGENT_DEFAULT}>agent default{agent.model ? ` · ${agent.model}` : ''}</SelectItem>\n {modelChoices(agent, models).map((choice) => (\n <SelectItem key={choice} value={choice}>\n {choice}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n <span className=\"text-2xs text-doom-faint\">leave unset to use the agent's default</span>\n </div>\n <div className=\"flex flex-col gap-1.5\">\n <FieldLabel>CWD</FieldLabel>\n <span className=\"flex h-7 items-center text-xs text-doom-dim\">{abbreviateCwd(cwd)}</span>\n <span className=\"text-2xs text-doom-faint\">the session's directory</span>\n </div>\n </div>\n {error ? (\n <p role=\"alert\" className=\"text-xs text-doom-red\">\n {error}\n </p>\n ) : null}\n <DialogFooter className=\"flex-wrap sm:flex-nowrap\">\n <span className=\"w-full text-2xs text-doom-faint sm:w-auto\">\n the run opens in its own tab once it starts\n </span>\n <span className=\"min-w-0 flex-1\" />\n <Button variant=\"outline\" size=\"xs\" data-testid=\"launch-cancel\" onClick={onClose}>\n cancel\n </Button>\n <Button\n variant=\"primary\"\n size=\"xs\"\n data-testid=\"launch-submit\"\n disabled={busy}\n onClick={() => void launch()}\n >\n {busy ? 'launching…' : 'launch'}\n </Button>\n </DialogFooter>\n </DialogBody>\n </DialogContent>\n </Dialog>\n );\n}\n","import type { TransientTab, WebPluginSlotProps } from '@agimon-ai/doompi-core/web';\nimport {\n Badge,\n Button,\n cn,\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n EmptyState,\n KebabIcon,\n Kbd,\n Panel,\n Sheet,\n SheetBody,\n SheetContent,\n SheetHeader,\n SheetTitle,\n STATUS_EDGE,\n StatusBadge,\n} from '@agimon-ai/doompi-web-components';\nimport { useStore } from '@tanstack/react-store';\nimport { type KeyboardEvent as ReactKeyboardEvent, useEffect, useState } from 'react';\n\nimport type { SubagentRun } from '../../../../../types/webSubagents';\nimport { catalog, closeCatalog, closeLaunch, loadCatalog, openCatalog, openLaunch } from '../_lib/catalogStore';\nimport { abbreviateCwd, agentRunLabel } from '../_lib/format';\nimport { RUN_ACTIONS_SLOT } from '../_lib/runActionsSlot';\nimport {\n clearAutoOpen,\n dismissRun,\n isTerminalRun,\n openRun,\n requestRunStop,\n subagents,\n visibleRuns,\n} from '../_lib/subagentsStore';\nimport { AgentCatalogDrawer } from './AgentCatalogDrawer';\nimport { agentThreadTab } from './AgentThreadPanel';\nimport { LaunchAgentDialog } from './LaunchAgentDialog';\nimport { elapsedRun, RUN_BADGE, RunControl } from './RunControl';\n\n/** One fleet tab per session; the fleet is singular, so the id needs nothing else. */\nexport const SUBAGENTS_TAB_ID = 'subagents-fleet';\n\nconst TICK_MS = 10_000;\n\n/**\n * How much of a run's own conversation a card carries: enough to read what it\n * is doing right now, not enough to read the run. The whole thread is one\n * click away in the run's tab.\n */\nconst CARD_THREAD_ENTRIES = 8;\n\n/** The card's work line: a task binding wins; otherwise the delegation prompt. */\nfunction WorkLine({ run }: { run: SubagentRun }) {\n const firstLine = run.task.split('\\n').find((line) => line.trim() !== '') ?? '';\n if (run.taskRef) {\n return (\n <div className=\"flex items-center gap-2 px-3 pb-2.5\">\n <Badge tone=\"violet\" size=\"xs\" className=\"shrink-0 rounded-sm bg-doom-violet/10\">\n TASK {run.taskRef}\n </Badge>\n <span data-testid=\"run-work\" className=\"min-w-0 truncate text-xs text-doom-hi\">\n {firstLine}\n </span>\n </div>\n );\n }\n return (\n <div className=\"flex items-center gap-2 px-3 pb-2.5\">\n <span className=\"shrink-0 text-2xs font-bold text-doom-faint\">PROMPT</span>\n <span data-testid=\"run-work\" className=\"min-w-0 truncate text-xs text-doom-dim\">\n {firstLine}\n </span>\n </div>\n );\n}\n\n/**\n * Everything a card can do, behind one control.\n *\n * A card already spends its width on the run's own stream, and stop, clear,\n * detail and the run's tab are four verbs: as buttons they crowd the footer\n * and each one has to defend itself from the card's own click.\n */\nfunction RunMenu({\n sessionId,\n run,\n stopping,\n onOpenThread,\n onOpenDetail,\n}: {\n sessionId: string;\n run: SubagentRun;\n stopping: boolean;\n onOpenThread: () => void;\n onOpenDetail: () => void;\n}) {\n const [error, setError] = useState<string | undefined>();\n const stop = (): void => {\n setError(undefined);\n requestRunStop(sessionId, run.runId).catch((cause: unknown) =>\n setError(cause instanceof Error ? cause.message : String(cause)),\n );\n };\n return (\n <>\n {error ? (\n <span\n role=\"alert\"\n data-testid={`run-menu-stop-error-${run.runId}`}\n title={error}\n className=\"min-w-0 truncate text-2xs text-doom-red\"\n >\n {error}\n </span>\n ) : null}\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n data-testid={`run-menu-${run.runId}`}\n title=\"what this run can do\"\n aria-label=\"run actions\"\n onClick={(event) => event.stopPropagation()}\n >\n <KebabIcon className=\"h-3 w-3\" />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent data-testid={`run-menu-content-${run.runId}`}>\n <DropdownMenuItem data-testid={`run-open-${run.runId}`} onSelect={onOpenThread}>\n open thread\n </DropdownMenuItem>\n <DropdownMenuItem data-testid={`run-detail-${run.runId}`} onSelect={onOpenDetail}>\n details\n </DropdownMenuItem>\n <DropdownMenuSeparator />\n {isTerminalRun(run) ? (\n <DropdownMenuItem data-testid={`run-clear-${run.runId}`} onSelect={() => dismissRun(sessionId, run.runId)}>\n clear from the grid\n </DropdownMenuItem>\n ) : (\n <DropdownMenuItem\n variant=\"destructive\"\n data-testid={`run-stop-${run.runId}`}\n data-stopping={stopping}\n disabled={stopping}\n onSelect={stop}\n >\n {stopping ? 'stopping…' : 'stop'}\n </DropdownMenuItem>\n )}\n </DropdownMenuContent>\n </DropdownMenu>\n </>\n );\n}\n\n/**\n * One run in the grid: its live conversation under a header, on the host's own\n * transcript so a tool call reads the same here as in the session.\n *\n * The body is a glance, so it takes the newest entries only and does not take\n * the pointer: the whole card is the way into the run's tab.\n */\nfunction RunCard({\n sessionId,\n run,\n now,\n stopping,\n renderThread,\n onOpenThread,\n onOpenDetail,\n}: {\n sessionId: string;\n run: SubagentRun;\n now: number;\n stopping: boolean;\n renderThread: WebPluginSlotProps['renderThread'];\n onOpenThread: () => void;\n onOpenDetail: () => void;\n}) {\n const badge = RUN_BADGE[run.state];\n const onKeyDown = (event: ReactKeyboardEvent<HTMLDivElement>): void => {\n if (event.target !== event.currentTarget) return;\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n onOpenThread();\n }\n };\n // A div rather than a button: the card carries a menu of its own, and a\n // button cannot contain another.\n return (\n <Panel\n asChild\n className={cn(\n 'flex h-[280px] min-w-0 flex-col text-left transition-colors outline-none hover:border-doom-blue/50 focus-within:border-doom-blue',\n STATUS_EDGE[badge.tone],\n )}\n >\n <div data-testid={`run-card-${run.runId}`} data-run-state={run.state}>\n <div\n role=\"button\"\n tabIndex={0}\n data-testid={`run-open-card-${run.runId}`}\n className=\"flex min-h-0 flex-1 cursor-pointer flex-col outline-none\"\n title=\"open this run's own thread in a tab\"\n onClick={onOpenThread}\n onKeyDown={onKeyDown}\n >\n <div className=\"flex items-center gap-2 px-3 pt-2.5 pb-1.5\">\n <span data-testid=\"run-agent\" className=\"truncate text-sm font-bold text-doom-hi\">\n {agentRunLabel(run)}\n </span>\n <span className=\"min-w-0 flex-1\" />\n <span className=\"shrink-0 text-2xs text-doom-faint\">{elapsedRun(run, now)}</span>\n <StatusBadge tone={badge.tone} data-testid=\"run-state\">\n {badge.label}\n </StatusBadge>\n </div>\n <WorkLine run={run} />\n {/* The run's own journal, drawn by the host's timeline: the newest\n entries only, and inert, so the card stays one click. */}\n <div\n data-testid=\"run-stream\"\n className=\"pointer-events-none flex min-h-0 flex-1 flex-col overflow-hidden border-t border-doom-border-soft bg-doom-deep\"\n >\n {renderThread(run.runId, { limit: CARD_THREAD_ENTRIES, compact: true })}\n </div>\n {run.state === 'failed' && run.error ? (\n <span\n data-testid=\"run-error\"\n className=\"truncate border-t border-doom-border-soft px-3 py-1.5 text-xs text-doom-red\"\n >\n {run.error}\n </span>\n ) : null}\n </div>\n <div className=\"flex shrink-0 items-center gap-3 border-t border-doom-border-soft px-3 py-1.5\">\n <span className=\"truncate text-2xs text-doom-faint\">\n {run.toolCount !== undefined ? `${run.toolCount} tools` : '—'}\n {run.tokens !== undefined ? ` · ${run.tokens.toLocaleString()} tk` : ''}\n {run.model ? ` · ${run.model.split('/').pop() ?? run.model}` : ''}\n </span>\n <span className=\"min-w-0 flex-1\" />\n <RunMenu\n sessionId={sessionId}\n run={run}\n stopping={stopping}\n onOpenThread={onOpenThread}\n onOpenDetail={onOpenDetail}\n />\n </div>\n </div>\n </Panel>\n );\n}\n\nfunction SheetRow({ label, value, tone = 'text-doom-dim' }: { label: string; value: string; tone?: string }) {\n return (\n <div className=\"flex gap-2.5\">\n <span className=\"w-11 shrink-0 text-2xs text-doom-faint\">{label}</span>\n <span className={`min-w-0 break-words text-xs ${tone}`}>{value}</span>\n </div>\n );\n}\n\nfunction SheetBlock({ label, text, testId, tone }: { label: string; text: string; testId: string; tone?: string }) {\n return (\n <div className=\"flex flex-col gap-1 rounded-md border border-doom-border bg-doom-deep px-3 py-2.5\">\n <span className=\"text-2xs font-bold tracking-wider text-doom-faint\">{label}</span>\n <pre\n data-testid={testId}\n className={`overflow-x-auto whitespace-pre-wrap break-words text-xs leading-relaxed ${tone ?? 'text-doom-text'}`}\n >\n {text}\n </pre>\n </div>\n );\n}\n\n/**\n * What the run was asked to do and what it was given to do it with, over the\n * grid rather than beside it: the conversation is on the card and in the run's\n * tab, so this reads as a definition and takes no width from the fleet.\n */\nfunction RunDetailSheet({\n sessionId,\n run,\n now,\n stopping,\n renderSlot,\n onClose,\n}: {\n sessionId: string;\n run: SubagentRun;\n now: number;\n stopping: boolean;\n renderSlot: WebPluginSlotProps['renderSlot'];\n onClose: () => void;\n}) {\n const badge = RUN_BADGE[run.state];\n return (\n <Sheet\n open\n onOpenChange={(open) => {\n if (!open) onClose();\n }}\n >\n <SheetContent data-testid=\"run-sheet\" aria-describedby={undefined}>\n <SheetHeader closeLabel=\"close the run detail\">\n <SheetTitle data-testid=\"sheet-agent\">{agentRunLabel(run)}</SheetTitle>\n <StatusBadge tone={badge.tone}>{badge.label}</StatusBadge>\n <span className=\"min-w-0 flex-1\" />\n <span className=\"text-xs text-doom-faint\">{elapsedRun(run, now)}</span>\n {renderSlot(RUN_ACTIONS_SLOT.slot)}\n <RunControl sessionId={sessionId} run={run} stopping={stopping} />\n </SheetHeader>\n <SheetBody>\n <div className=\"flex flex-col gap-1.5\">\n <SheetRow label=\"run\" value={run.runId} />\n {run.taskRef ? <SheetRow label=\"task\" value={run.taskRef} tone=\"text-doom-violet\" /> : null}\n <SheetRow label=\"model\" value={run.model ?? 'the runtime default'} />\n <SheetRow label=\"cwd\" value={abbreviateCwd(run.cwd)} />\n <SheetRow\n label=\"work\"\n value={`${run.toolCount === undefined ? 'no' : String(run.toolCount)} tools${\n run.tokens === undefined ? '' : ` · ${run.tokens.toLocaleString()} tk`\n }`}\n />\n </div>\n <SheetBlock\n label=\"PROMPT FROM THE MAIN AGENT\"\n testId=\"sheet-task\"\n text={run.task || '(no prompt recorded)'}\n />\n {run.summary ? <SheetBlock label=\"REPORT\" testId=\"sheet-summary\" text={run.summary} /> : null}\n {run.error ? <SheetBlock label=\"FAILURE\" testId=\"sheet-error\" text={run.error} tone=\"text-doom-red\" /> : null}\n </SheetBody>\n </SheetContent>\n </Sheet>\n );\n}\n\n/**\n * The subagents tab: the focused session's fleet as a computed grid.\n *\n * Columns come from the available width (auto-fill over a 420px minimum), and\n * every card is the same height with the run's own live conversation\n * absorbing the slack, so the grid reads as a fleet rather than a ragged list.\n * A card opens the run's tab; its menu opens the detail sheet over the grid.\n * The catalog to launch from still takes the right rail, because picking an\n * agent is a list beside the fleet rather than a thing about one run.\n */\nexport function SubagentsPanel({ sessionId, renderSlot, renderThread, openTransientTab }: WebPluginSlotProps) {\n const runs = useStore(subagents.store, (state) => visibleRuns(subagents.select(state, sessionId)));\n const { openRunId, stopRequested, autoOpenRunId } = useStore(subagents.store, (state) =>\n subagents.select(state, sessionId),\n );\n const shelf = useStore(catalog.store, (state) => catalog.select(state, sessionId));\n const [now, setNow] = useState(() => Date.now());\n\n useEffect(() => {\n if (sessionId === null || !shelf.open) return;\n return loadCatalog(sessionId);\n }, [sessionId, shelf.open]);\n\n useEffect(() => {\n const timer = setInterval(() => setNow(Date.now()), TICK_MS);\n return () => clearInterval(timer);\n }, []);\n\n useEffect(() => {\n if (autoOpenRunId === undefined || sessionId === null) return;\n const run = runs.find((candidate) => candidate.runId === autoOpenRunId);\n if (run) openTransientTab(agentThreadTab(run));\n clearAutoOpen(sessionId);\n }, [autoOpenRunId, runs, sessionId, openTransientTab]);\n\n const shownRun = openRunId === undefined ? undefined : runs.find((run) => run.runId === openRunId);\n const launching =\n shelf.launch === undefined ? undefined : shelf.agents.find((agent) => agent.name === shelf.launch?.agent);\n const stopping = (run: SubagentRun): boolean => stopRequested.includes(run.runId);\n const runningTally = runs.filter((run) => run.state === 'running' || run.state === 'queued').length;\n const doneTally = runs.filter((run) => run.state === 'done').length;\n const failedTally = runs.filter((run) => run.state === 'failed' || run.state === 'stopped').length;\n\n const showCatalog = (): void => {\n if (sessionId === null) return;\n openRun(sessionId, undefined);\n openCatalog(sessionId);\n };\n\n return (\n <div data-testid=\"subagents-panel\" className=\"flex min-h-0 min-w-0 flex-1 overflow-hidden\">\n <div className=\"flex min-w-0 flex-1 flex-col overflow-y-auto px-3 py-3 sm:px-[26px] sm:py-[18px]\">\n <div className=\"flex flex-wrap items-center gap-x-3 gap-y-2 pb-3\">\n <span className=\"text-2xs font-bold tracking-widest text-doom-faint\">SUBAGENTS · this session</span>\n <span className=\"hidden min-w-0 flex-1 sm:block\" />\n <span\n data-testid=\"subagents-tally\"\n className=\"order-3 w-full text-2xs text-doom-faint sm:order-none sm:w-auto\"\n >\n {runs.length === 0 ? 'no runs yet' : `${runningTally} running · ${doneTally} done · ${failedTally} failed`}\n </span>\n <Button\n variant=\"outline\"\n size=\"xs\"\n className=\"ml-auto sm:ml-0\"\n data-testid=\"subagents-launch\"\n title=\"pick an agent from the catalog and launch it\"\n onClick={showCatalog}\n >\n launch agent <Kbd>a l</Kbd>\n </Button>\n </div>\n {runs.length === 0 ? (\n <EmptyState\n data-testid=\"subagents-empty\"\n title=\"no subagent runs yet\"\n description=\"pick an agent from the catalog to launch one yourself, or let the main agent delegate with its subagent tool.\"\n />\n ) : (\n <>\n <div\n data-testid=\"subagents-grid\"\n className=\"grid grid-cols-[repeat(auto-fill,minmax(min(420px,100%),1fr))] gap-4\"\n >\n {sessionId === null\n ? null\n : runs.map((run) => (\n <RunCard\n key={run.runId}\n sessionId={sessionId}\n run={run}\n now={now}\n stopping={stopping(run)}\n renderThread={renderThread}\n onOpenThread={() => {\n closeCatalog(sessionId);\n openTransientTab(agentThreadTab(run));\n }}\n onOpenDetail={() => {\n closeCatalog(sessionId);\n openRun(sessionId, run.runId);\n }}\n />\n ))}\n </div>\n <span className=\"pt-3 text-2xs text-doom-faint\">\n click a card to open the run's thread · the card menu holds details, stop and clear · finished runs leave\n the grid after 10m\n </span>\n </>\n )}\n </div>\n {sessionId !== null && shelf.open ? (\n <AgentCatalogDrawer\n sessionId={sessionId}\n onClose={() => closeCatalog(sessionId)}\n onLaunch={(agent, fork) => openLaunch(sessionId, agent.name, fork)}\n />\n ) : null}\n {shownRun && sessionId !== null ? (\n <RunDetailSheet\n sessionId={sessionId}\n run={shownRun}\n now={now}\n stopping={stopping(shownRun)}\n renderSlot={renderSlot}\n onClose={() => openRun(sessionId, undefined)}\n />\n ) : null}\n {sessionId !== null && launching !== undefined && shelf.launch !== undefined ? (\n <LaunchAgentDialog\n key={launching.name}\n sessionId={sessionId}\n agent={launching}\n cwd={shelf.cwd}\n models={shelf.models}\n fork={shelf.launch.fork}\n initialTask={shelf.task}\n onClose={() => closeLaunch(sessionId)}\n onLaunched={() => closeCatalog(sessionId)}\n />\n ) : null}\n </div>\n );\n}\n\n/** The temporary tab the fleet opens in; opening it again only focuses it. */\nexport function subagentsTab(): TransientTab {\n return { id: SUBAGENTS_TAB_ID, label: 'subagents', panel: SubagentsPanel };\n}\n","import { defineContextAction } from '@agimon-ai/doompi-core/web';\n\nimport { subagentsTab } from '../_components/SubagentsPanel';\nimport { openAgentCatalogForContext } from '../_lib/catalogStore';\n\n/** Offered on any work item another plugin presents. The filename is the action id. */\nexport default defineContextAction({\n label: 'Launch Agent',\n detail: 'Choose an agent, review the task, then launch it.',\n kinds: ['work-item'],\n order: 10,\n run: (context) => openAgentCatalogForContext(context, subagentsTab),\n});\n","import { defineActivityGroup } from '@agimon-ai/doompi-core/web';\n\nimport { subagentsTab } from '../_components/SubagentsPanel';\nimport { activityRuns, isTerminalRun, subagents } from '../_lib/subagentsStore';\n\n/**\n * The dock group this package owns. The filename is the group name, which is\n * also the slot other plugins fill: `activity.agents`.\n *\n * It stays visible while the session is idle, because the group is the only\n * way into the fleet and a launcher that appears only once something runs\n * cannot be used to start anything.\n */\nexport default defineActivityGroup({\n keys: 'a r',\n statusKey: 'doom-team-agents',\n activeSource: {\n subscribe(listener: () => void) {\n const subscription = subagents.store.subscribe(listener);\n return () => subscription.unsubscribe();\n },\n isActive(sessionId: string | null) {\n return activityRuns(subagents.select(subagents.store.state, sessionId)).some((run) => !isTerminalRun(run));\n },\n },\n transientTab: subagentsTab,\n order: 10,\n});\n","import { defineChannelFile } from '@agimon-ai/doompi-core/web';\n\nimport { subagentCatalogChannel } from '../_lib/catalogStore';\n\n/** The agent catalog the session facet publishes. The filename is the frame type. */\nexport default defineChannelFile(subagentCatalogChannel);\n","import { defineChannelFile } from '@agimon-ai/doompi-core/web';\n\nimport { subagentRunsChannel } from '../_lib/subagentsStore';\n\n/** The run graph the session facet publishes. The filename is the frame type. */\nexport default defineChannelFile(subagentRunsChannel);\n","import type { WebPluginSlotProps } from '@agimon-ai/doompi-core/web';\nimport { Button, Dot, type DotTone } from '@agimon-ai/doompi-web-components';\nimport { useStore } from '@tanstack/react-store';\nimport { useEffect, useState } from 'react';\n\nimport type { SubagentRun } from '../../../../../../types/webSubagents';\nimport { agentThreadTab } from '../../_components/AgentThreadPanel';\nimport { subagentsTab } from '../../_components/SubagentsPanel';\nimport { openCatalog } from '../../_lib/catalogStore';\nimport { agentRunLabel } from '../../_lib/format';\nimport { formatRunDuration } from '../../_lib/format';\nimport { activityRuns, isTerminalRun, subagents } from '../../_lib/subagentsStore';\n\nconst TICK_MS = 10_000;\n\nconst STATE_TONE: Readonly<Record<SubagentRun['state'], DotTone>> = {\n queued: 'muted',\n running: 'yellow',\n done: 'green',\n failed: 'red',\n stopped: 'muted',\n};\n\nfunction elapsed(run: SubagentRun, now: number): string {\n const end = run.endedAt ?? (isTerminalRun(run) ? run.lastUpdate : now);\n return formatRunDuration(Math.max(0, end - run.startedAt));\n}\n\n/** The one-liner under a row: what the run is doing, or how it ended. */\nfunction detail(run: SubagentRun): string {\n if (run.state === 'failed' && run.error) return run.error;\n if (run.summary) return run.summary.split('\\n').find((line) => line.trim() !== '') ?? '';\n return run.currentTool ?? run.tail.at(-1) ?? run.state;\n}\n\n/**\n * The agents group's body in the activity dock: the session's runs, each a\n * row that opens the run's own conversation in a temporary tab. This replaces\n * the runtime's footer one-liner, which only says whether anything is running.\n */\nexport function AgentsActivitySection({ sessionId, openTransientTab }: WebPluginSlotProps) {\n const runs = useStore(subagents.store, (state) => activityRuns(subagents.select(state, sessionId)));\n const [now, setNow] = useState(() => Date.now());\n\n useEffect(() => {\n const timer = setInterval(() => setNow(Date.now()), TICK_MS);\n return () => clearInterval(timer);\n }, []);\n\n if (runs.length === 0) {\n return (\n <div className=\"flex items-center gap-2 px-1\">\n <p data-testid=\"activity-summary-agents\" className=\"text-xs text-doom-faint\">\n idle\n </p>\n <Button\n variant=\"link\"\n size=\"xs\"\n data-testid=\"activity-agents-launch\"\n className=\"px-0\"\n onClick={() => {\n if (sessionId === null) return;\n openCatalog(sessionId);\n openTransientTab(subagentsTab());\n }}\n >\n launch an agent\n </Button>\n </div>\n );\n }\n\n return (\n <div data-testid=\"activity-agent-runs\" className=\"flex flex-col gap-0.5\">\n {runs.map((run) => (\n <Button\n key={run.runId}\n variant=\"ghost\"\n size=\"card\"\n data-testid={`activity-run-${run.runId}`}\n data-run-state={run.state}\n title=\"open this run's conversation\"\n onClick={() => {\n if (sessionId === null) return;\n openTransientTab(agentThreadTab(run));\n }}\n className=\"min-w-0 gap-0.5 rounded-md px-1 py-1 hover:bg-doom-panel\"\n >\n <span className=\"flex min-w-0 items-center gap-1.5\">\n <Dot tone={STATE_TONE[run.state]} pulse={run.state === 'running'} />\n <span\n className={`min-w-0 flex-1 truncate text-xs font-bold ${isTerminalRun(run) ? 'text-doom-dim' : 'text-doom-hi'}`}\n >\n {agentRunLabel(run)}\n </span>\n <span className=\"shrink-0 text-2xs text-doom-faint\">\n {elapsed(run, now)}\n {run.toolCount !== undefined ? ` · ${run.toolCount} tools` : ''}\n </span>\n </span>\n <span className={`truncate pl-3 text-2xs ${run.state === 'failed' ? 'text-doom-red' : 'text-doom-faint'}`}>\n {detail(run)}\n </span>\n </Button>\n ))}\n </div>\n );\n}\n","import { defineFill } from '@agimon-ai/doompi-core/web';\n\nimport { AgentsActivitySection } from './_components/AgentsActivitySection';\n\n/**\n * Renders inside the `agents` activity group rather than after the groups.\n *\n * The target in the filename is the slot. `activity.agents` is the group this\n * package also declares, and the dock puts this in place of its one-line\n * footer summary.\n */\nexport default defineFill({ component: AgentsActivitySection });\n","/** The Leader Space group both of this package's bindings hang from. */\nexport const AGENTS_GROUP = { key: 'a', label: 'agents', detail: 'subagent resources and runs' };\n","import { defineLeaderBinding } from '@agimon-ai/doompi-core/web';\n\nimport { subagentsTab } from '../_components/SubagentsPanel';\nimport { openCatalog } from '../_lib/catalogStore';\nimport { AGENTS_GROUP } from './_lib/leaderGroups';\n\n/** SPC a l: pick an agent and launch it. The filename is the binding's local name. */\nexport default defineLeaderBinding({\n path: [AGENTS_GROUP, { key: 'l', label: 'launch', detail: 'pick an agent and launch it' }],\n run: (context) => {\n if (context.sessionId !== null) openCatalog(context.sessionId);\n context.openTransientTab(subagentsTab());\n },\n});\n","import { defineLeaderBinding } from '@agimon-ai/doompi-core/web';\n\nimport { subagentsTab } from '../_components/SubagentsPanel';\nimport { AGENTS_GROUP } from './_lib/leaderGroups';\n\n/** SPC a r: the runs in this session. The filename is the binding's local name. */\nexport default defineLeaderBinding({\n path: [AGENTS_GROUP, { key: 'r', label: 'runs', detail: 'runs in this session' }],\n run: (context) => context.openTransientTab(subagentsTab()),\n});\n","import { defineSlotFile } from '@agimon-ai/doompi-core/web';\n\n/**\n * The run detail sheet's action row, open to independent plugins.\n *\n * The filename is the local name; the path namespaces it as\n * `subagents.run-actions`, so no filler has to spell that prefix.\n */\nexport default defineSlotFile({});\n","/**\n * Pure text shaping for the team tool cards, kept apart from React so the\n * unit suite covers it without a DOM. The shapes mirror what the TUI's\n * subagentToolRender shows; args and details are wire JSON narrowed here.\n */\n\n/** The TUI collapses a result to this many lines until expanded. */\nexport const COLLAPSED_RESULT_LINES = 12;\nconst MESSAGE_PREVIEW_CHARS = 72;\nconst ELLIPSIS = '…';\n\ntype Args = Readonly<Record<string, unknown>>;\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction asString(value: unknown): string {\n return typeof value === 'string' ? value : '';\n}\n\n/** The detail beside the subagent action, as the TUI's callDetails words it. */\nexport function subagentCallDetail(args: Args): string {\n switch (args.action) {\n case 'agents':\n return asString(args.name);\n case 'run': {\n const requests = Array.isArray(args.requests) ? args.requests : [];\n const agents = requests.map((request) => (isRecord(request) ? asString(request.agent) : '')).filter(Boolean);\n const count = `${requests.length} agent${requests.length === 1 ? '' : 's'}`;\n return agents.length > 0 ? `${count} · ${agents.join(', ')}` : count;\n }\n case 'status':\n return asString(args.id) || 'fleet';\n case 'steer':\n case 'stop':\n case 'restore':\n return asString(args.id);\n case 'suspended':\n return 'runs';\n default:\n return '';\n }\n}\n\n/** Result text as lines, trailing blank lines dropped the way the TUI does. */\nexport function resultLines(output: string): string[] {\n const lines = output.split('\\n');\n while (lines.length > 0 && lines.at(-1)?.trim() === '') lines.pop();\n return lines.length === 1 && lines[0] === '' ? [] : lines;\n}\n\nexport type ResultGlyph = 'running' | 'failed' | 'done' | 'more' | 'none';\n\nexport interface ShapedResult {\n lines: string[];\n glyph: ResultGlyph;\n /** Lines hidden by the collapse, for the \"more\" hint. */\n hidden: number;\n}\n\n/**\n * The subagent result body: a tail while running, then the head collapsed to\n * the TUI budget, with the closing glyph line the TUI appends.\n */\nexport function shapeResult(\n output: string,\n options: { expanded: boolean; isPartial: boolean; isError: boolean },\n): ShapedResult {\n const all = resultLines(output);\n if (options.isPartial) {\n return { lines: all.slice(-COLLAPSED_RESULT_LINES), glyph: 'running', hidden: 0 };\n }\n const lines = options.expanded ? all : all.slice(0, COLLAPSED_RESULT_LINES);\n const hidden = all.length - lines.length;\n if (options.isError) return { lines, glyph: 'failed', hidden };\n if (hidden > 0) return { lines, glyph: 'more', hidden };\n if (lines.length === 0) return { lines, glyph: 'done', hidden: 0 };\n return { lines, glyph: 'none', hidden: 0 };\n}\n\nfunction preview(message: string): string {\n const flat = message.replace(/\\s+/g, ' ').trim();\n return flat.length > MESSAGE_PREVIEW_CHARS ? `${flat.slice(0, MESSAGE_PREVIEW_CHARS - 1)}${ELLIPSIS}` : flat;\n}\n\n/** Structured rows kept in a collapsed result, before the card is expanded. */\nexport const COLLAPSED_RESULT_ROWS = 8;\n\nexport type SubagentRowTone = 'ok' | 'error' | 'running' | 'idle';\n\n/** One line of a structured subagent result: who, what, and the state flushed right. */\nexport interface SubagentRow {\n key: string;\n /** The run id or the agent name. */\n label: string;\n /** What it is doing, says, or failed with. Truncates. */\n detail: string;\n /** The state word on the right, empty when the row has none. */\n state: string;\n tone: SubagentRowTone;\n}\n\nexport type SubagentResultKind = 'agents' | 'run' | 'fleet' | 'status' | 'suspended' | 'control';\n\n/** A finished subagent result as the card shows it, narrowed from the wire details. */\nexport interface SubagentResultView {\n kind: SubagentResultKind;\n rows: SubagentRow[];\n /** The count under the rows, or a control action's one-line confirmation. */\n summary: string;\n tone: SubagentRowTone;\n}\n\nfunction records(value: unknown): Record<string, unknown>[] {\n return Array.isArray(value) ? value.filter(isRecord) : [];\n}\n\nfunction parts(values: unknown[]): string {\n return values.filter((value): value is string => typeof value === 'string' && value.trim() !== '').join(' · ');\n}\n\nfunction firstLine(value: unknown): string {\n return asString(value).split('\\n')[0] ?? '';\n}\n\nfunction stateTone(state: string): SubagentRowTone {\n if (state === 'failed' || state === 'error') return 'error';\n if (state === 'complete' || state === 'completed') return 'ok';\n if (state === 'running' || state === 'starting') return 'running';\n return 'idle';\n}\n\nfunction countSummary(count: number, noun: string): string {\n return count === 0 ? `no ${noun}s` : `${count} ${noun}${count === 1 ? '' : 's'}`;\n}\n\nfunction agentsView(value: unknown): SubagentResultView {\n const rows = records(value).map((agent, index) => ({\n key: `${asString(agent.name)}-${index}`,\n label: asString(agent.name),\n detail: preview(asString(agent.description)),\n state: asString(agent.source),\n tone: 'idle' as const,\n }));\n return { kind: 'agents', rows, summary: countSummary(rows.length, 'agent'), tone: 'idle' };\n}\n\nfunction runView(value: unknown): SubagentResultView {\n const outcomes = records(value);\n const rows = outcomes.map((outcome, index) => {\n const runId = asString(outcome.runId);\n return {\n key: runId || `${asString(outcome.agent)}-${index}`,\n label: asString(outcome.agent),\n detail: runId || preview(asString(outcome.error)) || 'unknown error',\n state: runId ? 'started' : 'failed',\n tone: (runId ? 'ok' : 'error') as SubagentRowTone,\n };\n });\n const started = rows.filter((row) => row.state === 'started').length;\n const failed = rows.length - started;\n return {\n kind: 'run',\n rows,\n summary: failed === 0 ? `${started} started` : `${started} started · ${failed} failed`,\n tone: failed === 0 ? 'ok' : 'error',\n };\n}\n\nfunction fleetView(value: unknown): SubagentResultView {\n const rows = records(value).map((job, index) => {\n const state = asString(job.status) || 'starting';\n return {\n key: asString(job.runId) || `run-${index}`,\n label: asString(job.runId),\n // The run id stays the label because it is the key a reader copies; the\n // identity leads the detail so the row still says who this is.\n detail: preview(\n parts([\n job.identity ? (job.inline ? `${asString(job.identity)} (inline)` : job.identity) : undefined,\n job.agent,\n job.currentTool,\n job.activityState,\n job.attentionReason,\n job.error,\n ]),\n ),\n state,\n tone: stateTone(state),\n };\n });\n return { kind: 'fleet', rows, summary: countSummary(rows.length, 'run'), tone: 'idle' };\n}\n\nfunction suspendedView(value: unknown): SubagentResultView {\n const runs = isRecord(value) ? [value] : records(value);\n const rows = runs.map((run, index) => {\n const resumable = run.resumable;\n return {\n key: asString(run.runId) || `suspended-${index}`,\n label: asString(run.runId),\n detail: preview(parts([run.agent, firstLine(run.task)])),\n state: resumable === false ? 'not resumable' : resumable === true ? 'resumable' : 'suspended',\n tone: (resumable === false ? 'error' : 'idle') as SubagentRowTone,\n };\n });\n return { kind: 'suspended', rows, summary: countSummary(rows.length, 'suspended run'), tone: 'idle' };\n}\n\nfunction statusView(details: Record<string, unknown>): SubagentResultView {\n const runId = asString(details.runId);\n const status = isRecord(details.status) ? details.status : undefined;\n const state = status ? asString(status.state) : '';\n if (!state) return { kind: 'status', rows: [], summary: `${runId} has no status yet`, tone: 'idle' };\n return {\n kind: 'status',\n rows: [\n {\n key: runId,\n label: runId,\n detail: preview(parts([status?.agent, status?.activityState, status?.summary, status?.error])),\n state,\n tone: stateTone(state),\n },\n ],\n summary: '',\n tone: stateTone(state),\n };\n}\n\nfunction controlView(summary: string, tone: SubagentRowTone): SubagentResultView {\n return { kind: 'control', rows: [], summary, tone };\n}\n\n/**\n * Narrows the wire `details` of a subagent result to the rows the card draws.\n * Null when they are not a finished subagent result at all, which is what a\n * partial update or an error message is: the card then falls back to the text.\n */\nexport function subagentResultView(details: unknown): SubagentResultView | null {\n if (!isRecord(details) || details.partial === true) return null;\n if (Array.isArray(details.agents)) return agentsView(details.agents);\n if (Array.isArray(details.outcomes)) return runView(details.outcomes);\n if (isRecord(details.spawn) && Array.isArray(details.spawn.outcomes)) return runView(details.spawn.outcomes);\n if (Array.isArray(details.runs)) return fleetView(details.runs);\n if (Array.isArray(details.fleet)) return fleetView(details.fleet);\n if (details.suspended !== undefined) return suspendedView(details.suspended);\n if (isRecord(details.control)) {\n return controlView(`stop requested for ${asString(details.runId)}`, 'ok');\n }\n if (isRecord(details.steer)) {\n const state = asString(details.steer.state);\n return controlView(\n `steer ${state}${details.steer.message ? `: ${preview(asString(details.steer.message))}` : ''}`,\n state === 'failed' ? 'error' : 'ok',\n );\n }\n if (isRecord(details.restore)) {\n const restore = details.restore;\n return controlView(`restored ${asString(restore.restoredFrom)} as ${asString(restore.runId)}`, 'ok');\n }\n if (typeof details.runId === 'string') return statusView(details);\n return null;\n}\n\nexport interface IntercomCallSummary {\n action: string;\n /** The member or request the action addresses, empty for members and pending. */\n target: string;\n /** A one-line preview of the message body, empty when the action carries none. */\n message: string;\n}\n\n/** The intercom call header: action, its target, and what is being said. */\nexport function intercomCallSummary(args: Args): IntercomCallSummary {\n const action = asString(args.action);\n switch (action) {\n case 'send':\n case 'ask':\n return { action, target: asString(args.to), message: preview(asString(args.message)) };\n case 'reply':\n return { action, target: asString(args.requestId), message: preview(asString(args.message)) };\n default:\n return { action, target: '', message: '' };\n }\n}\n\nexport type IntercomOutcome = 'delivered' | 'queued' | 'replied' | 'answered' | 'none';\n\n/**\n * The outcome line for a finished intercom call, read from the details the\n * tool attaches: a send is delivered or only queued, a reply confirms its\n * request, an ask carries the answer's sender.\n */\nexport function intercomOutcome(details: unknown): { outcome: IntercomOutcome; who: string } {\n if (!isRecord(details)) return { outcome: 'none', who: '' };\n if (details.delivered === true) return { outcome: 'delivered', who: asString(details.to) };\n if (details.state === 'queued') return { outcome: 'queued', who: asString(details.to) };\n if (typeof details.reply === 'string') return { outcome: 'answered', who: asString(details.from) };\n if (typeof details.requestId === 'string' && typeof details.to === 'string') {\n return { outcome: 'replied', who: details.to };\n }\n return { outcome: 'none', who: '' };\n}\n","import type { ToolMessageRenderProps } from '@agimon-ai/doompi-core/web';\nimport {\n MessageItem,\n MessageItemBody,\n MessageItemHeader,\n MessageItemStatus,\n toolTone,\n} from '@agimon-ai/doompi-web-components';\n\nimport { intercomCallSummary, intercomOutcome, shapeResult } from '../_lib/toolText';\n\nconst OUTCOME_LINE = {\n delivered: { tone: 'ok', text: 'delivered to' },\n queued: { tone: 'running', text: 'queued, delivery unconfirmed, for' },\n replied: { tone: 'ok', text: 'replied to' },\n answered: { tone: 'ok', text: 'answered by' },\n} as const;\n\n/**\n * The intercom tool's timeline item. Intercom has no TUI renderer; the\n * header names the action, its member or request, and the message, and the\n * body shows the result text with the outcome the details report.\n */\nexport function IntercomToolMessage({ args, result, output, running, isError }: ToolMessageRenderProps) {\n const summary = intercomCallSummary(args);\n const collapsed = shapeResult(output, { expanded: false, isPartial: running, isError });\n const outcome = running || isError ? { outcome: 'none' as const, who: '' } : intercomOutcome(result?.details);\n const line = outcome.outcome === 'none' ? null : OUTCOME_LINE[outcome.outcome];\n return (\n <MessageItem tone={toolTone({ running, isError })} expandable={collapsed.glyph === 'more'}>\n {({ expanded }) => {\n const shaped = expanded ? shapeResult(output, { expanded: true, isPartial: running, isError }) : collapsed;\n return (\n <>\n <MessageItemHeader title=\"intercom\">\n <span data-testid=\"tool-call-intercom\" className=\"flex min-w-0 flex-1 items-center gap-2\">\n <span className=\"text-doom-hi\">{summary.action}</span>\n {summary.target ? <span className=\"shrink-0 text-doom-cyan\">→ {summary.target}</span> : null}\n {summary.message ? <span className=\"min-w-0 truncate text-doom-dim\">{summary.message}</span> : null}\n </span>\n </MessageItemHeader>\n <MessageItemBody data-testid=\"tool-result-intercom\" className=\"flex flex-col gap-1\">\n {shaped.lines.length > 0 ? (\n <pre className={`${expanded ? 'whitespace-pre-wrap break-words' : 'truncate'} text-doom-dim`}>\n {shaped.lines.join('\\n')}\n </pre>\n ) : null}\n {running ? <MessageItemStatus tone=\"running\">waiting</MessageItemStatus> : null}\n {isError ? <MessageItemStatus tone=\"error\">failed</MessageItemStatus> : null}\n {line ? (\n <MessageItemStatus tone={line.tone}>\n {line.text} <span className=\"text-doom-cyan\">{outcome.who}</span>\n </MessageItemStatus>\n ) : null}\n {shaped.glyph === 'more' ? (\n <MessageItemStatus expands>{shaped.hidden} more line(s)</MessageItemStatus>\n ) : null}\n </MessageItemBody>\n </>\n );\n }}\n </MessageItem>\n );\n}\n","import { defineToolRenderer } from '@agimon-ai/doompi-core/web';\n\nimport { IntercomToolMessage } from './_components/IntercomToolMessage';\n\n/** The intercom tool's timeline card. The filename names the tool it renders. */\nexport default defineToolRenderer({ message: IntercomToolMessage });\n","import type { ToolMessageRenderProps } from '@agimon-ai/doompi-core/web';\nimport {\n Button,\n MessageItem,\n MessageItemBody,\n MessageItemHeader,\n MessageItemStatus,\n type StatusTone,\n toolTone,\n} from '@agimon-ai/doompi-web-components';\n\nimport { subagentsTab } from '../../_components/SubagentsPanel';\nimport {\n COLLAPSED_RESULT_ROWS,\n shapeResult,\n subagentCallDetail,\n subagentResultView,\n type SubagentRow,\n type SubagentRowTone,\n} from '../_lib/toolText';\n\nconst CLOSING = {\n running: { tone: 'running', text: 'running' },\n failed: { tone: 'error', text: 'failed' },\n done: { tone: 'ok', text: 'done' },\n} as const;\n\nconst ROW_TONE: Record<SubagentRowTone, string> = {\n ok: 'text-doom-green',\n error: 'text-doom-red',\n running: 'text-doom-yellow',\n idle: 'text-doom-dim',\n};\n\nconst STATUS_TONE: Record<SubagentRowTone, StatusTone> = {\n ok: 'ok',\n error: 'error',\n running: 'running',\n idle: 'ok',\n};\n\n/** One structured row: the run or agent, what it is doing, and its state flushed right. */\nfunction SubagentRowLine({ row }: { row: SubagentRow }) {\n return (\n <li data-testid=\"tool-result-subagent-row\" className=\"flex items-baseline gap-2\">\n <span className=\"shrink-0 text-doom-cyan\">{row.label}</span>\n <span className=\"min-w-0 flex-1 truncate text-doom-dim\">{row.detail}</span>\n {row.state ? <span className={`shrink-0 ${ROW_TONE[row.tone]}`}>{row.state}</span> : null}\n </li>\n );\n}\n\n/**\n * The subagent tool's timeline item, the web half of renderSubagentCall and\n * renderSubagentResult: the action and its per-action detail in the header,\n * the rows the result reported in the body, and the subagents tab one click\n * away. A result the narrower does not recognise, a partial one included,\n * falls back to the text the model was given.\n */\nexport function SubagentToolMessage({\n args,\n result,\n output,\n running,\n isError,\n openTransientTab,\n}: ToolMessageRenderProps) {\n const action = typeof args.action === 'string' ? args.action : '';\n const detail = subagentCallDetail(args);\n const view = running || isError ? null : subagentResultView(result?.details);\n const hiddenRows = view ? Math.max(0, view.rows.length - COLLAPSED_RESULT_ROWS) : 0;\n const collapsedText = view ? null : shapeResult(output, { expanded: false, isPartial: running, isError });\n return (\n <MessageItem\n tone={toolTone({ running, isError })}\n expandable={view ? hiddenRows > 0 : collapsedText?.glyph === 'more'}\n >\n {({ expanded }) => {\n const shaped =\n view || !collapsedText\n ? null\n : expanded\n ? shapeResult(output, { expanded: true, isPartial: running, isError })\n : collapsedText;\n const closing = !shaped || shaped.glyph === 'none' || shaped.glyph === 'more' ? null : CLOSING[shaped.glyph];\n const rows = view ? (expanded ? view.rows : view.rows.slice(0, COLLAPSED_RESULT_ROWS)) : [];\n return (\n <>\n <MessageItemHeader title=\"subagent\">\n <span data-testid=\"tool-call-subagent\" className=\"flex min-w-0 flex-1 items-center gap-2\">\n <span className=\"text-doom-hi\">{action}</span>\n {detail ? <span className=\"min-w-0 truncate text-doom-cyan\">{detail}</span> : null}\n </span>\n </MessageItemHeader>\n <MessageItemBody data-testid=\"tool-result-subagent\" className=\"flex flex-col gap-1\">\n {rows.length > 0 ? (\n <ul className=\"flex flex-col gap-0.5\">\n {rows.map((row) => (\n <SubagentRowLine key={row.key} row={row} />\n ))}\n </ul>\n ) : null}\n {shaped && shaped.lines.length > 0 ? (\n <pre className={`${expanded ? 'whitespace-pre-wrap break-words' : 'truncate'} text-doom-dim`}>\n {shaped.lines.join('\\n')}\n </pre>\n ) : null}\n {!expanded && hiddenRows > 0 ? <MessageItemStatus expands>{hiddenRows} more</MessageItemStatus> : null}\n {view && view.summary ? (\n <MessageItemStatus data-testid=\"tool-result-subagent-summary\" tone={STATUS_TONE[view.tone]}>\n {view.summary}\n </MessageItemStatus>\n ) : null}\n {closing ? <MessageItemStatus tone={closing.tone}>{closing.text}</MessageItemStatus> : null}\n {shaped?.glyph === 'more' ? (\n <MessageItemStatus expands>{shaped.hidden} more line(s)</MessageItemStatus>\n ) : null}\n <Button\n variant=\"link\"\n size=\"xs\"\n data-testid=\"tool-result-subagent-open\"\n onClick={() => openTransientTab(subagentsTab())}\n className=\"self-start px-0\"\n >\n open subagents\n </Button>\n </MessageItemBody>\n </>\n );\n }}\n </MessageItem>\n );\n}\n","import { defineToolRenderer } from '@agimon-ai/doompi-core/web';\n\nimport { SubagentToolMessage } from './_components/SubagentToolMessage';\n\n/** The subagent tool's timeline card. The filename names the tool it renders. */\nexport default defineToolRenderer({ message: SubagentToolMessage });\n","// Generated by @agimon-ai/doompi-build. Do not edit by hand.\nimport { defineWebPlugin, type WebPluginContributions } from '@agimon-ai/doompi-core/web';\n\nimport actionLaunchAgent from '../src/extensions/workspaces/sessions/(frontend)/action/launch-agent.web';\nimport activityGroupAgents from '../src/extensions/workspaces/sessions/(frontend)/activity-group/agents.web';\nimport channelSubagentCatalog from '../src/extensions/workspaces/sessions/(frontend)/channel/subagent-catalog.web';\nimport channelSubagentRuns from '../src/extensions/workspaces/sessions/(frontend)/channel/subagent-runs.web';\nimport fillAgents from '../src/extensions/workspaces/sessions/(frontend)/fill/Agents.activity.agents.web';\nimport leaderCatalog from '../src/extensions/workspaces/sessions/(frontend)/leader/catalog.web';\nimport leaderFleet from '../src/extensions/workspaces/sessions/(frontend)/leader/fleet.web';\nimport slotRunActions from '../src/extensions/workspaces/sessions/(frontend)/slot/run-actions.web';\nimport toolIntercom from '../src/extensions/workspaces/sessions/(frontend)/tool/intercom.web';\nimport toolSubagent from '../src/extensions/workspaces/sessions/(frontend)/tool/subagent.web';\n\nconst via = <T>(identity: Record<string, unknown>, value: unknown): T =>\n (value === undefined ? undefined : { ...identity, ...(value as object) }) as T;\n\nexport const webPlugin = defineWebPlugin({\n id: 'subagents',\n session: {\n get activityGroups(): WebPluginContributions['activityGroups'] { return [via({ name: 'agents' }, activityGroupAgents)]; },\n get channels(): WebPluginContributions['channels'] { return [via({ channel: 'subagent_catalog' }, channelSubagentCatalog), via({ channel: 'subagent_runs' }, channelSubagentRuns)]; },\n get contextActions(): WebPluginContributions['contextActions'] { return [via({ id: 'launch-agent' }, actionLaunchAgent)]; },\n get fills(): WebPluginContributions['fills'] { return [via({ slot: 'activity.agents', id: 'agents' }, fillAgents)]; },\n get leaderBindings(): WebPluginContributions['leaderBindings'] { return [via({ id: 'subagents.catalog' }, leaderCatalog), via({ id: 'subagents.fleet' }, leaderFleet)]; },\n get slots(): WebPluginContributions['slots'] { return [via({ slot: 'subagents.run-actions' }, slotRunActions)]; },\n get toolRenderers(): WebPluginContributions['toolRenderers'] { return [via({ tools: ['intercom'] }, toolIntercom), via({ tools: ['subagent'] }, toolSubagent)]; },\n },\n});\n"],"mappings":";;;;;;;AAoDA,MAAa,qBAAqB;AAsClC,MAAa,wBAAwB;;;AChFrC,SAASA,WAAS,OAAkD;CAClE,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC5E;AAEA,SAAS,UAAU,OAAmC;CACpD,OAAO,MAAM,QAAQ,KAAK,KAAK,MAAM,OAAO,SAAS,OAAO,SAAS,QAAQ;AAC/E;AAEA,SAAS,QAAQ,OAA+C;CAC9D,OACEA,WAAS,KAAK,KACd,OAAO,MAAM,SAAS,YACtB,OAAO,MAAM,gBAAgB,YAC7B,OAAO,MAAM,aAAa,YAC1B;EAAC;EAAW;EAAQ;CAAQ,CAAC,CAAC,SAAS,OAAO,MAAM,MAAM,CAAC,MAC1D,MAAM,gBAAgB,KAAA,KAAa,OAAO,MAAM,gBAAgB,cAChE,MAAM,UAAU,KAAA,KAAa,OAAO,MAAM,UAAU,aACrD,UAAU,MAAM,cAAc,KAC9B,UAAU,MAAM,KAAK,KACrB,UAAU,MAAM,MAAM,KACtB,UAAU,MAAM,UAAU,MACzB,MAAM,mBAAmB,WAAW,MAAM,mBAAmB;AAElE;;AAGA,eA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;EAAG;EACxK,IAAI,QAAyC;GAAE,OAAO,CAAC,IAAI,EAAE,MAAM,wBAAwB,GAAGC,uBAAc,CAAC;EAAG;EAChH,IAAI,gBAAyD;GAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,UAAU,EAAE,GAAGC,oBAAY,GAAG,IAAI,EAAE,OAAO,CAAC,UAAU,EAAE,GAAGC,oBAAY,CAAC;EAAG;CAClK;AACF,CAAC"}
1
+ {"version":3,"file":"web.mjs","names":["isRecord","isRecord","isRecord","TICK_MS","TICK_MS","activityGroupAgents","channelSubagentCatalog","channelSubagentRuns","actionLaunchAgent","fillAgents","leaderCatalog","leaderFleet","slotRunActions","toolIntercom","toolSubagent"],"sources":["../../src/types/webSubagents.ts","../../src/extensions/workspaces/sessions/(frontend)/_lib/catalog.ts","../../src/extensions/workspaces/sessions/(frontend)/_lib/catalogStore.ts","../../src/extensions/workspaces/sessions/(frontend)/_lib/format.ts","../../src/extensions/workspaces/sessions/(frontend)/_lib/runActionsSlot.ts","../../src/extensions/workspaces/sessions/(frontend)/_lib/subagentsStore.ts","../../src/extensions/workspaces/sessions/(frontend)/_lib/launchCommand.ts","../../src/extensions/workspaces/sessions/(frontend)/_components/AgentCatalogDrawer.tsx","../../src/extensions/workspaces/sessions/(frontend)/_components/RunControl.tsx","../../src/extensions/workspaces/sessions/(frontend)/_components/AgentThreadPanel.tsx","../../src/extensions/workspaces/sessions/(frontend)/_components/LaunchAgentDialog.tsx","../../src/extensions/workspaces/sessions/(frontend)/_components/SubagentsPanel.tsx","../../src/extensions/workspaces/sessions/(frontend)/action/launch-agent.web.ts","../../src/extensions/workspaces/sessions/(frontend)/activity-group/agents.web.ts","../../src/extensions/workspaces/sessions/(frontend)/channel/subagent-catalog.web.ts","../../src/extensions/workspaces/sessions/(frontend)/channel/subagent-runs.web.ts","../../src/extensions/workspaces/sessions/(frontend)/fill/_components/AgentsActivitySection.tsx","../../src/extensions/workspaces/sessions/(frontend)/fill/Agents.activity.agents.web.tsx","../../src/extensions/workspaces/sessions/(frontend)/leader/_lib/leaderGroups.ts","../../src/extensions/workspaces/sessions/(frontend)/leader/catalog.web.ts","../../src/extensions/workspaces/sessions/(frontend)/leader/fleet.web.ts","../../src/extensions/workspaces/sessions/(frontend)/slot/run-actions.web.ts","../../src/extensions/workspaces/sessions/(frontend)/tool/_lib/toolText.ts","../../src/extensions/workspaces/sessions/(frontend)/tool/_components/IntercomToolMessage.tsx","../../src/extensions/workspaces/sessions/(frontend)/tool/intercom.web.tsx","../../src/extensions/workspaces/sessions/(frontend)/tool/_components/SubagentToolMessage.tsx","../../src/extensions/workspaces/sessions/(frontend)/tool/subagent.web.tsx","../../generated/web.ts"],"sourcesContent":["/**\n * Subagent run view types shared by this package's hub channel and its web\n * plugin. The shapes mirror the per-run status files this package's own\n * runtime writes; the cockpit renders them as 'subagent_runs' channel\n * payloads.\n */\n\n/** Coarse run state the cockpit renders; rawState keeps doom-team's exact word. */\nexport type SubagentRunState = 'queued' | 'running' | 'done' | 'failed' | 'stopped';\n\n/**\n * One subagent run of a session, read from doom-team's per-run status file.\n */\nexport interface SubagentRun {\n runId: string;\n agent: string;\n /**\n * Generated addressable identity, for example `alan-reviewer-3`.\n *\n * Additive and optional: a run projected before identities existed, and any\n * run whose claim could not be written, still arrives without one.\n */\n identity?: string;\n /** True when this run came from a one-shot inline agent definition. */\n inline?: boolean;\n state: SubagentRunState;\n rawState: string;\n /** The delegation prompt the main agent gave this run. */\n task: string;\n /** A doom-task binding, when the delegation named one; wins over task in the card. */\n taskRef?: string;\n model?: string;\n cwd: string;\n /** The child transcript path, when the session host exposes one. */\n sessionFile?: string;\n /** Epoch milliseconds, as doom-team writes them. */\n startedAt: number;\n endedAt?: number;\n lastUpdate: number;\n /** Live one-liner of what the run is doing right now. */\n currentTool?: string;\n toolCount?: number;\n tokens?: number;\n cost?: number;\n /** Final report, present once the run finished. */\n summary?: string;\n /** Failure reason, present when the run failed. */\n error?: string;\n /** Recent output lines, oldest first, capped. */\n tail: string[];\n}\n\nexport const SUBAGENT_RUNS_TYPE = 'subagent_runs';\n\n/** How the runtime answered one steer: delivered, refused by the run, or not yet acknowledged. */\nexport interface SubagentSteerResult {\n state: 'delivered' | 'failed' | 'pending';\n message: string;\n}\n/** Where an agent definition came from; the catalog groups by it, nearest first. */\nexport type SubagentCatalogSource = 'project' | 'user' | 'plugin';\n\n/** One launchable agent, as the catalog lists it. */\nexport interface SubagentCatalogAgent {\n name: string;\n source: SubagentCatalogSource;\n /** The package that staged a plugin agent. */\n packageName?: string;\n description: string;\n /** The model the definition pins; absent means the runtime's default. */\n model?: string;\n fallbackModels: string[];\n /** Empty means the definition does not narrow the tool set. */\n tools: string[];\n skills: string[];\n extensions: string[];\n defaultContext: 'fresh' | 'fork';\n filePath: string;\n}\n\n/** The 'subagent_catalog' channel payload: the agents a session's directory can launch. */\nexport interface SubagentCatalogPayload {\n cwd: string;\n agents: SubagentCatalogAgent[];\n /** Model specs the active team package offers, for the launch dialog's picker. */\n models: string[];\n /** Why the list may be incomplete, when discovery failed. */\n warning?: string;\n}\n\nexport const SUBAGENT_CATALOG_TYPE = 'subagent_catalog';\n","import { pluginApiUrl, sessionApiAddress } from '@agimon-ai/doompi-core/web';\nimport { sealedTransport } from '@agimon-ai/doompi-web-security/browser';\n\nimport type {\n SubagentCatalogAgent,\n SubagentCatalogPayload,\n SubagentSteerResult,\n} from '../../../../../types/webSubagents';\nimport type { LaunchRequest } from './launchCommand';\n\n/** The team API's address on a session, from the one builder every package API URL shares. */\nfunction teamApiUrl(sessionId: string, path: string): string {\n return pluginApiUrl(sessionApiAddress(sessionId), 'team', path);\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction isStrings(value: unknown): value is string[] {\n return Array.isArray(value) && value.every((item) => typeof item === 'string');\n}\n\nfunction isAgent(value: unknown): value is SubagentCatalogAgent {\n return (\n isRecord(value) &&\n typeof value.name === 'string' &&\n typeof value.description === 'string' &&\n typeof value.filePath === 'string' &&\n ['project', 'user', 'plugin'].includes(String(value.source)) &&\n (value.packageName === undefined || typeof value.packageName === 'string') &&\n (value.model === undefined || typeof value.model === 'string') &&\n isStrings(value.fallbackModels) &&\n isStrings(value.tools) &&\n isStrings(value.skills) &&\n isStrings(value.extensions) &&\n (value.defaultContext === 'fresh' || value.defaultContext === 'fork')\n );\n}\n\n/** Read the selected session's catalog through the host's authenticated HTTP transport. */\nexport async function fetchCatalog(sessionId: string, signal: AbortSignal): Promise<SubagentCatalogPayload> {\n const response = await sealedTransport.fetch(teamApiUrl(sessionId, '/catalog'), {\n signal,\n cache: 'no-store',\n });\n const body: unknown = await response.json();\n if (!response.ok) {\n throw new Error(\n isRecord(body) && typeof body.error === 'string'\n ? body.error\n : `Agent catalog could not be loaded (${response.status}).`,\n );\n }\n if (\n !isRecord(body) ||\n typeof body.cwd !== 'string' ||\n !Array.isArray(body.agents) ||\n !body.agents.every(isAgent) ||\n !isStrings(body.models)\n ) {\n throw new Error('The server returned an invalid agent catalog.');\n }\n return { cwd: body.cwd, agents: body.agents, models: body.models };\n}\n\n/** Launch on the selected session host, without submitting a parent prompt. */\nexport async function launchAgent(sessionId: string, request: LaunchRequest): Promise<string> {\n const response = await sealedTransport.fetch(teamApiUrl(sessionId, '/run'), {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify(request),\n });\n const body: unknown = await response.json();\n if (!response.ok) {\n throw new Error(\n isRecord(body) && typeof body.error === 'string'\n ? body.error\n : `Agent could not be launched (${response.status}).`,\n );\n }\n if (!isRecord(body) || typeof body.runId !== 'string' || body.runId === '')\n throw new Error('The server returned an invalid run ID.');\n return body.runId;\n}\n\nfunction isSteerState(value: unknown): value is SubagentSteerResult['state'] {\n return value === 'delivered' || value === 'failed' || value === 'pending';\n}\n\n/** Steer one run on the selected session host, without submitting a parent prompt. */\nexport async function steerRun(sessionId: string, runId: string, message: string): Promise<SubagentSteerResult> {\n const response = await sealedTransport.fetch(teamApiUrl(sessionId, '/steer'), {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify({ runId, message }),\n });\n const body: unknown = await response.json();\n if (!response.ok) {\n throw new Error(\n isRecord(body) && typeof body.error === 'string'\n ? body.error\n : `Guidance could not be sent (${response.status}).`,\n );\n }\n if (!isRecord(body) || !isSteerState(body.state) || typeof body.message !== 'string')\n throw new Error('The server returned an invalid steer result.');\n return { state: body.state, message: body.message };\n}\n\n/** Ask the selected session host to stop one run; the run's own status reports when it has. */\nexport async function stopRun(sessionId: string, runId: string): Promise<void> {\n const response = await sealedTransport.fetch(teamApiUrl(sessionId, '/stop'), {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify({ runId }),\n });\n const body: unknown = await response.json();\n if (!response.ok) {\n throw new Error(\n isRecord(body) && typeof body.error === 'string'\n ? body.error\n : `The run could not be stopped (${response.status}).`,\n );\n }\n}\n","import { defineSessionStore, type ContextActionRunContext, type TransientTab } from '@agimon-ai/doompi-core/web';\n\nimport {\n SUBAGENT_CATALOG_TYPE,\n type SubagentCatalogAgent,\n type SubagentCatalogPayload,\n} from '../../../../../types/webSubagents';\nimport { fetchCatalog } from './catalog';\n\n/** One session's catalog: what the hub last reported plus what the drawer is doing with it. */\nexport interface CatalogSession {\n cwd: string;\n agents: SubagentCatalogAgent[];\n models: string[];\n warning: string | undefined;\n loading: boolean;\n requestId: number;\n /** True while the catalog drawer is shown in the subagents tab. */\n open: boolean;\n filter: string;\n /** Task text carried from the surface that opened the catalog. */\n task: string;\n /** The highlighted row, by agent name. */\n selected: string | undefined;\n /** The row whose resources are unfolded. */\n inspected: string | undefined;\n /** The agent the launch dialog is open for, and the context it opened with. */\n launch: { agent: string; fork: boolean } | undefined;\n}\n\nexport const catalog = defineSessionStore<CatalogSession>({\n cwd: '',\n agents: [],\n models: [],\n warning: undefined,\n loading: false,\n requestId: 0,\n open: false,\n filter: '',\n task: '',\n selected: undefined,\n inspected: undefined,\n launch: undefined,\n});\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nexport function openCatalog(sessionId: string, task = ''): void {\n catalog.update(sessionId, (current) => ({ ...current, open: true, task }));\n}\n\n/** Opens the Team picker with context supplied by another installed plugin. */\nexport function openAgentCatalogForContext(context: ContextActionRunContext, tab: () => TransientTab): void {\n if (context.sessionId === null) return;\n openCatalog(context.sessionId, context.item.content);\n context.openTransientTab(tab());\n}\n\nexport function closeCatalog(sessionId: string): void {\n catalog.update(sessionId, (current) => ({ ...current, open: false, task: '', launch: undefined }));\n}\n\nexport function setCatalogFilter(sessionId: string, filter: string): void {\n catalog.update(sessionId, (current) => ({ ...current, filter }));\n}\n\nexport function selectAgent(sessionId: string, name: string | undefined): void {\n catalog.update(sessionId, (current) => ({ ...current, selected: name }));\n}\n\nexport function toggleInspect(sessionId: string, name: string): void {\n catalog.update(sessionId, (current) => ({ ...current, inspected: current.inspected === name ? undefined : name }));\n}\n\nexport function openLaunch(sessionId: string, agent: string, fork: boolean): void {\n catalog.update(sessionId, (current) => ({ ...current, selected: agent, launch: { agent, fork } }));\n}\n\nexport function closeLaunch(sessionId: string): void {\n catalog.update(sessionId, (current) => ({ ...current, launch: undefined }));\n}\n\n/** Each drawer opening owns one request and cancels it when the drawer leaves. */\nexport function loadCatalog(sessionId: string): () => void {\n const controller = new AbortController();\n const requestId = catalog.select(catalog.store.state, sessionId).requestId + 1;\n catalog.update(sessionId, (current) => ({ ...current, requestId, loading: true, warning: undefined }));\n const isCurrent = (): boolean =>\n !controller.signal.aborted && catalog.store.state[sessionId]?.requestId === requestId;\n void fetchCatalog(sessionId, controller.signal)\n .then((payload) => {\n if (isCurrent()) subagentCatalogChannel.apply(sessionId, payload);\n })\n .catch((error: unknown) => {\n if (isCurrent())\n catalog.update(sessionId, (current) => ({\n ...current,\n warning: error instanceof Error ? error.message : String(error),\n }));\n })\n .finally(() => {\n if (isCurrent()) catalog.update(sessionId, (current) => ({ ...current, loading: false }));\n });\n return () => {\n if (isCurrent()) catalog.update(sessionId, (current) => ({ ...current, loading: false }));\n controller.abort();\n };\n}\n\n/** The plugin's catalog channel: 'subagent_catalog' payloads into the store; the drawer's own state survives a refresh. */\nexport const subagentCatalogChannel = catalog.channel<SubagentCatalogPayload>({\n channel: SUBAGENT_CATALOG_TYPE,\n parse(input) {\n if (!isRecord(input) || typeof input.cwd !== 'string' || !Array.isArray(input.agents)) return null;\n const models = Array.isArray(input.models) ? input.models.filter((m): m is string => typeof m === 'string') : [];\n return {\n cwd: input.cwd,\n agents: input.agents.filter(isRecord) as unknown as SubagentCatalogAgent[],\n models,\n ...(typeof input.warning === 'string' ? { warning: input.warning } : {}),\n };\n },\n reduce(current, payload) {\n const names = new Set(payload.agents.map((agent) => agent.name));\n return {\n ...current,\n cwd: payload.cwd,\n agents: payload.agents,\n models: payload.models,\n warning: payload.warning,\n selected: current.selected !== undefined && names.has(current.selected) ? current.selected : undefined,\n inspected: current.inspected !== undefined && names.has(current.inspected) ? current.inspected : undefined,\n launch: current.launch !== undefined && names.has(current.launch.agent) ? current.launch : undefined,\n };\n },\n});\n","/**\n * Local copies of the host cockpit's pure formatters\n * (doompi-web src/web/lib/sessionSummary.ts): this plugin ships zero host\n * imports so the cockpit's bundler can compile it from any install.\n */\nconst MINUTE_MS = 60 * 1000;\nconst HOUR_MS = 60 * MINUTE_MS;\n\nexport function formatRunDuration(elapsedMs: number): string {\n if (elapsedMs < MINUTE_MS) return '<1m';\n if (elapsedMs < HOUR_MS) return `${Math.floor(elapsedMs / MINUTE_MS)}m`;\n const hours = Math.floor(elapsedMs / HOUR_MS);\n const minutes = Math.floor((elapsedMs % HOUR_MS) / MINUTE_MS);\n return `${hours}h ${String(minutes).padStart(2, '0')}m`;\n}\n\nexport function abbreviateCwd(cwd: string): string {\n const match = /^\\/(?:Users|home)\\/[^/]+/u.exec(cwd);\n if (!match) return cwd;\n return `~${cwd.slice(match[0].length)}`;\n}\n\n/**\n * What to call a run on screen.\n *\n * Prefers the generated identity, because a fan-out of one agent otherwise\n * renders as N rows reading the same word. Falls back to the agent name for a\n * run projected before identities existed. Duplicated rather than imported\n * from `services/agentIdentity`, which reaches for `node:fs` and so cannot be\n * pulled into the browser bundle; that module owns minting, this owns display.\n */\nexport function agentRunLabel(run: { agent: string; identity?: string; inline?: boolean }): string {\n const base = run.identity ?? run.agent;\n return run.inline ? `${base} (inline)` : base;\n}\n","import { defineSlot } from '@agimon-ai/doompi-core/web';\n\n/**\n * The slot the run detail sheet opens beside its stop control: an independent\n * plugin may put its own action for the shown run there, without this\n * package knowing it exists. Fills receive the panel's own props.\n */\nexport const RUN_ACTIONS_SLOT = defineSlot({ slot: 'subagents.run-actions' });\n","import { defineSessionStore } from '@agimon-ai/doompi-core/web';\n\nimport { SUBAGENT_RUNS_TYPE, type SubagentRun } from '../../../../../types/webSubagents';\nimport { stopRun } from './catalog';\nconst TERMINAL_STATES: ReadonlySet<SubagentRun['state']> = new Set(['done', 'failed', 'stopped']);\n\nexport function isTerminalRun(run: SubagentRun): boolean {\n return TERMINAL_STATES.has(run.state);\n}\n\n/** One session's record: the fleet the hub last reported plus what this page did with it. */\nexport interface SubagentsSession {\n /** The fleet the hub last reported; presented order preserved. */\n runs: SubagentRun[];\n /** Finished runs the reader cleared from the grid; they stay on disk and in the hub's feed. */\n dismissed: string[];\n /** Runs a stop was asked for and that have not yet reported a final state. */\n stopRequested: string[];\n /** The run whose detail sheet the subagents tab shows. */\n openRunId: string | undefined;\n /** A launch this page asked for, until a run of that agent it had not seen shows up. */\n pendingLaunch: { agent: string; knownRunIds: string[] } | undefined;\n /** The run a launch produced, for the tab to open once and forget. */\n autoOpenRunId: string | undefined;\n}\n\nexport const subagents = defineSessionStore<SubagentsSession>({\n runs: [],\n dismissed: [],\n stopRequested: [],\n openRunId: undefined,\n pendingLaunch: undefined,\n autoOpenRunId: undefined,\n});\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction without(list: readonly string[], runId: string): string[] {\n return list.filter((id) => id !== runId);\n}\n\n/** The full Subagents tab's runs minus the ones the reader dismissed. */\nexport function visibleRuns(session: SubagentsSession): SubagentRun[] {\n return session.dismissed.length === 0\n ? session.runs\n : session.runs.filter((run) => !session.dismissed.includes(run.runId));\n}\n\n/** Only runs that can still be doing work belong in the activity group. */\nexport function activityRuns(session: SubagentsSession): SubagentRun[] {\n return visibleRuns(session).filter((run) => run.state === 'queued' || run.state === 'running');\n}\n\n/**\n * Asks the session host to stop a run over the Team API, never as a parent\n * prompt: the web host does not know Team's slash commands and refuses\n * prompts mid-turn. Marked at once so the control reads \"stopping\"; rolled\n * back and rethrown if the host refuses. Once accepted, the request stands\n * until the run reports a final state.\n */\nexport async function requestRunStop(sessionId: string, runId: string): Promise<void> {\n subagents.update(sessionId, (current) => ({\n ...current,\n stopRequested: [...without(current.stopRequested, runId), runId],\n }));\n try {\n await stopRun(sessionId, runId);\n } catch (error) {\n subagents.update(sessionId, (current) => ({ ...current, stopRequested: without(current.stopRequested, runId) }));\n throw error;\n }\n}\n\n/** Hides a finished run from this page; nothing is deleted. */\nexport function dismissRun(sessionId: string, runId: string): void {\n subagents.update(sessionId, (current) => ({\n ...current,\n dismissed: [...without(current.dismissed, runId), runId],\n openRunId: current.openRunId === runId ? undefined : current.openRunId,\n }));\n}\n\n/** Remember the fleet before the server launch so its first update can open the new run. */\nexport function requestLaunch(sessionId: string, agent: string): void {\n subagents.update(sessionId, (current) => ({\n ...current,\n pendingLaunch: { agent, knownRunIds: current.runs.map((run) => run.runId) },\n }));\n}\n\nexport function clearPendingLaunch(sessionId: string): void {\n subagents.update(sessionId, (current) => ({ ...current, pendingLaunch: undefined }));\n}\n\nexport function clearAutoOpen(sessionId: string): void {\n subagents.update(sessionId, (current) => ({ ...current, autoOpenRunId: undefined }));\n}\n\nexport function openRun(sessionId: string, runId: string | undefined): void {\n subagents.update(sessionId, (current) => ({ ...current, openRunId: runId }));\n}\n\nexport interface SubagentRunsPayload {\n runs: SubagentRun[];\n}\n\n/** The plugin's session data channel: 'subagent_runs' payloads into the store. */\nexport const subagentRunsChannel = subagents.channel<SubagentRunsPayload>({\n channel: SUBAGENT_RUNS_TYPE,\n parse(input) {\n if (!isRecord(input) || !Array.isArray(input.runs)) return null;\n return { runs: input.runs.filter(isRecord) as unknown as SubagentRun[] };\n },\n reduce(current, { runs }) {\n const present = new Map(runs.map((run) => [run.runId, run]));\n // A stop request is spent once the run reports a final state or leaves\n // the feed; a dismissal is forgotten once the run is gone from the feed.\n const stopRequested = current.stopRequested.filter((runId) => {\n const run = present.get(runId);\n return run !== undefined && !isTerminalRun(run);\n });\n const dismissed = current.dismissed.filter((runId) => present.has(runId));\n // The run a launch asked for is the first of that agent the page had not seen.\n const arrived =\n current.pendingLaunch === undefined\n ? undefined\n : runs.find(\n (run) =>\n run.agent === current.pendingLaunch?.agent && !current.pendingLaunch.knownRunIds.includes(run.runId),\n );\n return {\n ...current,\n runs,\n stopRequested,\n dismissed,\n pendingLaunch: arrived === undefined ? current.pendingLaunch : undefined,\n autoOpenRunId: arrived === undefined ? current.autoOpenRunId : arrived.runId,\n };\n },\n});\n","import type { SubagentCatalogAgent, SubagentCatalogSource } from '../../../../../types/webSubagents';\n\nconst META_TOOL_LIMIT = 3;\n\nexport interface LaunchRequest {\n agent: string;\n task: string;\n /** A pinned model overrides the agent's default; absent keeps the agent's own. */\n model?: string;\n fork: boolean;\n}\n\n/** Rows whose name, source, package, description or a tool contains the filter, case-insensitively. */\nexport function filterCatalog(agents: readonly SubagentCatalogAgent[], filter: string): SubagentCatalogAgent[] {\n const needle = filter.trim().toLowerCase();\n if (needle === '') return [...agents];\n return agents.filter((agent) =>\n [agent.name, agent.source, agent.packageName ?? '', agent.description, ...agent.tools].some((field) =>\n field.toLowerCase().includes(needle),\n ),\n );\n}\n\nexport interface CatalogSection {\n source: SubagentCatalogSource;\n label: string;\n agents: SubagentCatalogAgent[];\n}\n\nconst SECTION_LABEL: Readonly<Record<SubagentCatalogSource, string>> = {\n project: 'PROJECT',\n user: 'USER',\n plugin: 'PACKAGES',\n};\n\n/** The catalog's sections, nearest source first, keeping the payload's order inside each; empty ones are left out. */\nexport function groupCatalog(agents: readonly SubagentCatalogAgent[]): CatalogSection[] {\n const sections: CatalogSection[] = [];\n for (const source of ['project', 'user', 'plugin'] as const) {\n const members = agents.filter((agent) => agent.source === source);\n if (members.length > 0) sections.push({ source, label: SECTION_LABEL[source], agents: members });\n }\n return sections;\n}\n\n/** What the picker offers: the agent's own model and fallbacks first, then the team's, without repeats. */\nexport function modelChoices(agent: SubagentCatalogAgent, models: readonly string[]): string[] {\n const seen = new Set<string>();\n const choices: string[] = [];\n for (const model of [agent.model ?? '', ...agent.fallbackModels, ...models]) {\n if (model === '' || seen.has(model)) continue;\n seen.add(model);\n choices.push(model);\n }\n return choices;\n}\n\n/** The row's one-liner: what tools it may use, how many skills, and how it starts. */\nexport function agentMeta(agent: SubagentCatalogAgent): string {\n const tools =\n agent.tools.length === 0\n ? 'all tools'\n : `tools ${agent.tools.slice(0, META_TOOL_LIMIT).join(', ')}${\n agent.tools.length > META_TOOL_LIMIT ? ` +${agent.tools.length - META_TOOL_LIMIT}` : ''\n }`;\n const skills =\n agent.skills.length > 0 ? ` · ${agent.skills.length} skill${agent.skills.length === 1 ? '' : 's'}` : '';\n return `${tools}${skills} · ${agent.defaultContext === 'fork' ? 'forks the session' : 'fresh context'}`;\n}\n","import { Badge, Button, CloseIcon, Input, Kbd } from '@agimon-ai/doompi-web-components';\nimport { useStore } from '@tanstack/react-store';\nimport type { KeyboardEvent as ReactKeyboardEvent } from 'react';\n\nimport type { SubagentCatalogAgent } from '../../../../../types/webSubagents';\nimport { catalog, selectAgent, setCatalogFilter, toggleInspect } from '../_lib/catalogStore';\nimport { agentMeta, filterCatalog, groupCatalog } from '../_lib/launchCommand';\n\nconst INPUT_TAG = 'INPUT';\n\nfunction shortModel(model: string): string {\n return model.split('/').pop() ?? model;\n}\n\n/** The unfolded row: what the definition names, read-only, the way the TUI catalog's tabs show it. */\nfunction Resources({ agent }: { agent: SubagentCatalogAgent }) {\n const rows: Array<[string, string]> = [\n ['tools', agent.tools.length > 0 ? agent.tools.join(', ') : 'every tool the session has'],\n ['skills', agent.skills.length > 0 ? agent.skills.join(', ') : 'none named'],\n ['extensions', agent.extensions.length > 0 ? agent.extensions.join(', ') : 'none named'],\n ['model', agent.model ?? 'runtime default'],\n ['file', agent.filePath],\n ];\n return (\n <dl data-testid={`catalog-resources-${agent.name}`} className=\"flex flex-col gap-1 pt-1 text-2xs\">\n {rows.map(([label, value]) => (\n <div key={label} className=\"flex gap-2\">\n <dt className=\"w-16 shrink-0 text-doom-faint\">{label}</dt>\n <dd className=\"min-w-0 break-words text-doom-dim\">{value}</dd>\n </div>\n ))}\n </dl>\n );\n}\n\nfunction AgentRow({\n agent,\n selected,\n inspected,\n onSelect,\n onLaunch,\n onInspect,\n}: {\n agent: SubagentCatalogAgent;\n selected: boolean;\n inspected: boolean;\n onSelect: () => void;\n onLaunch: (fork: boolean) => void;\n onInspect: () => void;\n}) {\n // A div rather than a button: the selected row carries buttons of its own.\n return (\n <div\n role=\"option\"\n aria-selected={selected}\n tabIndex={-1}\n data-testid={`catalog-agent-${agent.name}`}\n data-selected={selected}\n onClick={onSelect}\n onDoubleClick={() => onLaunch(false)}\n className={`flex cursor-pointer flex-col gap-1 border-l-2 px-4 py-2 ${\n selected ? 'border-doom-blue bg-doom-panel' : 'border-transparent hover:bg-doom-panel/60'\n }`}\n >\n <div className=\"flex min-w-0 items-center gap-2\">\n <span className=\"truncate text-sm font-bold text-doom-hi\">{agent.name}</span>\n <Badge size=\"xs\" className=\"shrink-0\">\n {agent.packageName ?? agent.source}\n </Badge>\n <span className=\"min-w-0 flex-1\" />\n <span className={`shrink-0 text-2xs ${agent.model ? 'text-doom-cyan' : 'text-doom-faint'}`}>\n {agent.model ? shortModel(agent.model) : 'agent default'}\n </span>\n </div>\n <span className=\"truncate text-xs text-doom-dim\">{agent.description}</span>\n <span className=\"truncate text-2xs text-doom-faint\">{agentMeta(agent)}</span>\n {selected ? (\n <div className=\"flex items-center gap-3 pt-0.5\">\n <Button\n variant=\"link\"\n size=\"xs\"\n data-testid={`catalog-launch-${agent.name}`}\n className=\"px-0\"\n onClick={(event) => {\n event.stopPropagation();\n onLaunch(false);\n }}\n >\n launch <Kbd>↵</Kbd>\n </Button>\n <Button\n variant=\"link\"\n size=\"xs\"\n data-testid={`catalog-fork-${agent.name}`}\n className=\"px-0 text-doom-dim\"\n onClick={(event) => {\n event.stopPropagation();\n onLaunch(true);\n }}\n >\n fork session <Kbd>f</Kbd>\n </Button>\n <Button\n variant=\"link\"\n size=\"xs\"\n data-testid={`catalog-inspect-${agent.name}`}\n className=\"px-0 text-doom-dim\"\n onClick={(event) => {\n event.stopPropagation();\n onInspect();\n }}\n >\n inspect <Kbd>i</Kbd>\n </Button>\n </div>\n ) : null}\n {selected && inspected ? <Resources agent={agent} /> : null}\n </div>\n );\n}\n\n/**\n * The agent catalog, in the subagents tab's drawer: every agent the session's\n * directory can launch, nearest definition first, with a filter and keys the\n * TUI catalog also answers to. Launching hands the chosen agent to the dialog.\n */\nexport function AgentCatalogDrawer({\n sessionId,\n onClose,\n onLaunch,\n}: {\n sessionId: string;\n onClose: () => void;\n onLaunch: (agent: SubagentCatalogAgent, fork: boolean) => void;\n}) {\n const state = useStore(catalog.store, (current) => catalog.select(current, sessionId));\n const shown = filterCatalog(state.agents, state.filter);\n const sections = groupCatalog(shown);\n const selected = shown.find((agent) => agent.name === state.selected) ?? shown[0];\n\n const move = (delta: number): void => {\n if (shown.length === 0) return;\n const index = selected === undefined ? -1 : shown.findIndex((agent) => agent.name === selected.name);\n const next = shown[(index + delta + shown.length) % shown.length];\n if (next) selectAgent(sessionId, next.name);\n };\n\n const onKeyDown = (event: ReactKeyboardEvent<HTMLElement>): void => {\n const typing = (event.target as HTMLElement).tagName === INPUT_TAG;\n if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n event.preventDefault();\n move(event.key === 'ArrowDown' ? 1 : -1);\n return;\n }\n if (event.key === 'Escape') {\n event.preventDefault();\n onClose();\n return;\n }\n if (selected === undefined) return;\n if (event.key === 'Enter') {\n event.preventDefault();\n onLaunch(selected, false);\n return;\n }\n if (typing) return;\n if (event.key === 'f') onLaunch(selected, true);\n if (event.key === 'i') toggleInspect(sessionId, selected.name);\n };\n\n return (\n <aside\n data-testid=\"catalog-drawer\"\n tabIndex={0}\n onKeyDown={onKeyDown}\n className=\"flex w-[min(440px,calc(100vw-24px))] shrink-0 flex-col overflow-hidden border-l border-doom-border bg-doom-rail outline-none\"\n >\n <div className=\"flex h-11 shrink-0 items-center gap-2.5 border-b border-doom-border px-4\">\n <span className=\"text-base font-bold text-doom-hi\">agent catalog</span>\n <Badge size=\"xs\" data-testid=\"catalog-count\">\n {state.agents.length} agent{state.agents.length === 1 ? '' : 's'}\n </Badge>\n <span className=\"min-w-0 flex-1\" />\n <Kbd>SPC a l</Kbd>\n <Button variant=\"ghost\" size=\"icon\" data-testid=\"catalog-close\" title=\"close the catalog\" onClick={onClose}>\n <CloseIcon className=\"h-3 w-3\" />\n </Button>\n </div>\n <div className=\"px-4 pt-2.5 pb-1.5\">\n <Input\n data-testid=\"catalog-filter\"\n value={state.filter}\n placeholder=\"filter by name, source, or tool…\"\n autoFocus\n onChange={(event) => setCatalogFilter(sessionId, event.target.value)}\n />\n </div>\n <div role=\"listbox\" className=\"flex min-h-0 flex-1 flex-col overflow-y-auto pb-2\">\n {state.loading ? (\n <p role=\"status\" className=\"px-4 py-3 text-xs text-doom-faint\">\n loading agents...\n </p>\n ) : null}\n {state.warning ? (\n <p role=\"alert\" className=\"px-4 py-3 text-xs text-doom-red\">\n {state.warning}\n </p>\n ) : null}\n {shown.length === 0 && !state.loading && !state.warning ? (\n <p data-testid=\"catalog-empty\" className=\"px-4 py-3 text-xs text-doom-faint\">\n {state.agents.length === 0\n ? 'no agents found for this session; add one under .doom/agents or ~/.doompi/agent/agents'\n : 'nothing matches the filter'}\n </p>\n ) : null}\n {sections.map((section) => (\n <div key={section.source} className=\"flex flex-col\">\n <span className=\"px-4 pt-2.5 pb-1 text-2xs font-bold tracking-widest text-doom-faint\">{section.label}</span>\n {section.agents.map((agent) => (\n <AgentRow\n key={agent.name}\n agent={agent}\n selected={selected?.name === agent.name}\n inspected={state.inspected === agent.name}\n onSelect={() => selectAgent(sessionId, agent.name)}\n onLaunch={(fork) => onLaunch(agent, fork)}\n onInspect={() => toggleInspect(sessionId, agent.name)}\n />\n ))}\n </div>\n ))}\n </div>\n <div className=\"flex h-8 shrink-0 items-center justify-between border-t border-doom-border-soft bg-doom-deep px-4\">\n <span className=\"text-2xs text-doom-faint\">↑↓ choose · enter launch · f fork · i inspect · esc close</span>\n <span className=\"text-2xs text-doom-faint\">\n {sections.length} source{sections.length === 1 ? '' : 's'}\n </span>\n </div>\n </aside>\n );\n}\n","import { Button, type StatusTone } from '@agimon-ai/doompi-web-components';\nimport { type MouseEvent as ReactMouseEvent, useState } from 'react';\n\nimport type { SubagentRun, SubagentRunState } from '../../../../../types/webSubagents';\nimport { formatRunDuration } from '../_lib/format';\nimport { dismissRun, isTerminalRun, requestRunStop } from '../_lib/subagentsStore';\n\n/** One run state, in the host's shared outcome vocabulary. */\nexport const RUN_BADGE: Readonly<Record<SubagentRunState, { label: string; tone: StatusTone }>> = {\n queued: { label: 'QUEUED', tone: 'neutral' },\n running: { label: 'RUNNING', tone: 'running' },\n done: { label: 'DONE', tone: 'ok' },\n failed: { label: 'FAILED', tone: 'error' },\n stopped: { label: 'STOPPED', tone: 'neutral' },\n};\n\n/** How long the run has been going, or took; the clock only matters while it is active. */\nexport function elapsedRun(run: SubagentRun, now: number): string {\n const end = run.endedAt ?? (run.state === 'running' || run.state === 'queued' ? now : run.lastUpdate);\n return formatRunDuration(Math.max(0, end - run.startedAt));\n}\n\n/**\n * The one control a run offers: stop while it is active, clear once it is\n * not. Stop is a request the runtime acknowledges in its own time, so the\n * button reads \"stopping\" until the run's own status says otherwise; a\n * refused request says why next to the button.\n */\nexport function RunControl({ sessionId, run, stopping }: { sessionId: string; run: SubagentRun; stopping: boolean }) {\n const [error, setError] = useState<string | undefined>();\n const act = (event: ReactMouseEvent, action: () => void): void => {\n event.stopPropagation();\n action();\n };\n const stop = (): void => {\n setError(undefined);\n requestRunStop(sessionId, run.runId).catch((cause: unknown) =>\n setError(cause instanceof Error ? cause.message : String(cause)),\n );\n };\n if (isTerminalRun(run)) {\n return (\n <Button\n variant=\"outline\"\n size=\"xs\"\n data-testid={`run-clear-${run.runId}`}\n title=\"clear this run from the grid\"\n onClick={(event) => act(event, () => dismissRun(sessionId, run.runId))}\n >\n clear\n </Button>\n );\n }\n return (\n <>\n {error ? (\n <span\n role=\"alert\"\n data-testid={`run-stop-error-${run.runId}`}\n title={error}\n className=\"min-w-0 truncate text-2xs text-doom-red\"\n >\n {error}\n </span>\n ) : null}\n <Button\n variant={stopping ? 'outline' : 'danger-outline'}\n size=\"xs\"\n data-testid={`run-stop-${run.runId}`}\n data-stopping={stopping}\n disabled={stopping}\n title={stopping ? 'stop requested; the run reports its own final state' : 'ask the runtime to stop this run'}\n onClick={(event) => act(event, stop)}\n >\n {stopping ? 'stopping…' : 'stop'}\n </Button>\n </>\n );\n}\n","import type { TransientTab, WebPluginSlotProps } from '@agimon-ai/doompi-core/web';\nimport { Button, StatusBadge, Textarea } from '@agimon-ai/doompi-web-components';\nimport { useStore } from '@tanstack/react-store';\nimport { type FormEvent, useEffect, useState } from 'react';\n\nimport type { SubagentRun } from '../../../../../types/webSubagents';\nimport { steerRun } from '../_lib/catalog';\nimport { agentRunLabel } from '../_lib/format';\nimport { isTerminalRun, subagents } from '../_lib/subagentsStore';\nimport { elapsedRun, RUN_BADGE, RunControl } from './RunControl';\n\nconst TICK_MS = 10_000;\n/** The tab id doubles as the URL segment, so it stays plain and unique across plugins. */\nconst TAB_ID_PREFIX = 'subagents-run-';\n\n/** The temporary tab for one run; the host keeps this panel for as long as the tab is open. */\nexport function agentThreadTab(run: SubagentRun): TransientTab {\n const runId = run.runId;\n return {\n id: `${TAB_ID_PREFIX}${runId}`,\n label: agentRunLabel(run),\n panel: (props: WebPluginSlotProps) => <AgentThreadPanel {...props} runId={runId} />,\n };\n}\n\n/**\n * A run's own conversation on the host's transcript, under a header with\n * what the grid card knows: state, elapsed, model, the prompt's first line,\n * and stop while the run is going. The run can leave the fleet feed before\n * the reader is done; the thread stays, and the header says so.\n */\nexport function AgentThreadPanel({ sessionId, runId, renderThread }: WebPluginSlotProps & { runId: string }) {\n const { runs, stopRequested } = useStore(subagents.store, (state) => subagents.select(state, sessionId));\n const run = runs.find((candidate) => candidate.runId === runId);\n const [now, setNow] = useState(() => Date.now());\n const [guidance, setGuidance] = useState('');\n const [sending, setSending] = useState(false);\n const [error, setError] = useState<string | undefined>();\n const [notice, setNotice] = useState<string | undefined>();\n\n useEffect(() => {\n const timer = setInterval(() => setNow(Date.now()), TICK_MS);\n return () => clearInterval(timer);\n }, []);\n\n const firstLine = run?.task.split('\\n').find((line) => line.trim() !== '') ?? '';\n const canSteer = sessionId !== null && run !== undefined && !isTerminalRun(run);\n // Not a prompt frame: the web host does not know Team's slash commands and refuses prompts mid-turn.\n const submitGuidance = async (event: FormEvent<HTMLFormElement>): Promise<void> => {\n event.preventDefault();\n const message = guidance.trim();\n if (!canSteer || !message || sending) return;\n setSending(true);\n setError(undefined);\n setNotice(undefined);\n try {\n const result = await steerRun(sessionId, runId, message);\n if (result.state === 'failed') {\n setError(result.message);\n return;\n }\n setGuidance('');\n if (result.state === 'pending') setNotice(result.message);\n } catch (cause) {\n setError(cause instanceof Error ? cause.message : String(cause));\n } finally {\n setSending(false);\n }\n };\n\n return (\n <div data-testid=\"agent-thread-panel\" className=\"flex min-h-0 flex-1 flex-col\">\n <div\n data-testid=\"agent-thread-header\"\n className=\"flex h-10 shrink-0 items-center gap-2.5 border-b border-doom-border-soft px-[26px]\"\n >\n {run ? (\n <>\n <span data-testid=\"agent-thread-agent\" className=\"shrink-0 truncate text-sm font-bold text-doom-hi\">\n {agentRunLabel(run)}\n </span>\n <StatusBadge tone={RUN_BADGE[run.state].tone} data-testid=\"agent-thread-state\">\n {RUN_BADGE[run.state].label}\n </StatusBadge>\n <span className=\"shrink-0 text-xs text-doom-faint\">{elapsedRun(run, now)}</span>\n {run.model ? (\n <span className=\"shrink-0 text-xs text-doom-faint\">{run.model.split('/').pop() ?? run.model}</span>\n ) : null}\n <span data-testid=\"agent-thread-task\" className=\"min-w-0 flex-1 truncate text-xs text-doom-dim\">\n {firstLine}\n </span>\n {sessionId !== null && !isTerminalRun(run) ? (\n <RunControl sessionId={sessionId} run={run} stopping={stopRequested.includes(run.runId)} />\n ) : null}\n </>\n ) : (\n <span data-testid=\"agent-thread-gone\" className=\"text-xs text-doom-faint\">\n run {runId.slice(0, 8)} is no longer listed; its transcript stays readable\n </span>\n )}\n </div>\n {renderThread(runId)}\n {canSteer ? (\n <form\n data-testid=\"agent-steer-composer\"\n className=\"shrink-0 border-t border-doom-border-soft bg-doom-rail px-[26px] pt-3 pb-2.5\"\n onSubmit={(event) => void submitGuidance(event)}\n >\n <div className=\"rounded-lg border border-doom-border bg-doom-deep transition-colors focus-within:border-doom-blue/60\">\n <div className=\"flex min-w-0 items-start gap-2.5 px-3.5 pt-3\">\n <span className=\"mt-[3px] shrink-0 select-none text-base leading-none text-doom-green\">&gt;</span>\n <Textarea\n variant=\"bare\"\n data-testid=\"agent-steer-input\"\n aria-label=\"Steering guidance\"\n rows={2}\n value={guidance}\n readOnly={sending}\n placeholder=\"Guide this agent…\"\n className=\"min-w-0 flex-1 text-base leading-relaxed\"\n onChange={(event) => setGuidance(event.target.value)}\n />\n </div>\n {error ? (\n <p role=\"alert\" data-testid=\"agent-steer-error\" className=\"px-3.5 pt-2 text-xs text-doom-red\">\n {error}\n </p>\n ) : null}\n <div className=\"flex items-center gap-2 px-3.5 pt-2 pb-2.5\">\n <span role=\"status\" data-testid=\"agent-steer-hint\" className=\"min-w-0 truncate text-xs text-doom-faint\">\n {notice ?? 'guidance reaches this run while it is still working'}\n </span>\n <span className=\"min-w-0 flex-1\" />\n <Button\n data-testid=\"agent-steer-submit\"\n type=\"submit\"\n variant=\"primary\"\n size=\"md\"\n className=\"px-3.5\"\n disabled={sending || guidance.trim() === ''}\n >\n {sending ? 'sending…' : 'send'}\n </Button>\n </div>\n </div>\n </form>\n ) : null}\n </div>\n );\n}\n","import {\n Badge,\n Button,\n Dialog,\n DialogBody,\n DialogContent,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n Textarea,\n} from '@agimon-ai/doompi-web-components';\nimport { type KeyboardEvent as ReactKeyboardEvent, useState } from 'react';\n\nimport type { SubagentCatalogAgent } from '../../../../../types/webSubagents';\nimport { launchAgent } from '../_lib/catalog';\nimport { abbreviateCwd } from '../_lib/format';\nimport { type LaunchRequest, modelChoices } from '../_lib/launchCommand';\nimport { clearPendingLaunch, requestLaunch } from '../_lib/subagentsStore';\n\n/** The picker's stand-in for \"no override\"; a Radix item cannot carry an empty value. */\nconst AGENT_DEFAULT = 'agent-default';\nconst TASK_ROWS = 4;\n\nfunction FieldLabel({ children }: { children: string }) {\n return <span className=\"text-2xs font-bold tracking-widest text-doom-faint\">{children}</span>;\n}\n\n/**\n * Launches one agent from the catalog: the task, whether the child forks\n * this session, and a model override. The session server starts the child.\n */\nexport function LaunchAgentDialog({\n sessionId,\n agent,\n cwd,\n models,\n fork: initialFork,\n initialTask,\n onClose,\n onLaunched,\n}: {\n sessionId: string;\n agent: SubagentCatalogAgent;\n cwd: string;\n models: readonly string[];\n fork: boolean;\n initialTask: string;\n onClose: () => void;\n onLaunched: () => void;\n}) {\n const [task, setTask] = useState(initialTask);\n const [fork, setFork] = useState(initialFork);\n const [model, setModel] = useState(AGENT_DEFAULT);\n const [busy, setBusy] = useState(false);\n const [error, setError] = useState<string | undefined>();\n const request: LaunchRequest = { agent: agent.name, task, fork, ...(model === AGENT_DEFAULT ? {} : { model }) };\n\n const launch = async (): Promise<void> => {\n if (busy) return;\n setBusy(true);\n setError(undefined);\n requestLaunch(sessionId, agent.name);\n try {\n await launchAgent(sessionId, request);\n onLaunched();\n } catch (cause) {\n clearPendingLaunch(sessionId);\n setError(cause instanceof Error ? cause.message : String(cause));\n } finally {\n setBusy(false);\n }\n };\n const onTaskKeyDown = (event: ReactKeyboardEvent<HTMLTextAreaElement>): void => {\n if (event.key === 'Enter' && !event.shiftKey) {\n event.preventDefault();\n void launch();\n }\n };\n\n return (\n <Dialog\n open\n onOpenChange={(open) => {\n if (!open) onClose();\n }}\n >\n <DialogContent width=\"lg\" data-testid=\"launch-dialog\" aria-describedby={undefined}>\n <DialogHeader>\n <div className=\"flex min-w-0 flex-col items-start gap-1 sm:flex-row sm:items-center sm:gap-2.5\">\n <span className=\"text-2xs text-doom-faint\">launch subagent</span>\n <DialogTitle data-testid=\"launch-agent\" className=\"max-w-full break-words\">\n {agent.name}\n </DialogTitle>\n <Badge size=\"xs\" className=\"max-w-full truncate\">\n {agent.packageName ?? agent.source}\n </Badge>\n </div>\n </DialogHeader>\n <DialogBody>\n <p className=\"text-sm leading-relaxed text-doom-dim\">{agent.description}</p>\n <div className=\"flex flex-col gap-1.5\">\n <FieldLabel>TASK</FieldLabel>\n <Textarea\n data-testid=\"launch-task\"\n autoFocus\n rows={TASK_ROWS}\n value={task}\n placeholder=\"what should the agent do? empty runs its own prompt\"\n onChange={(event) => setTask(event.target.value)}\n onKeyDown={onTaskKeyDown}\n />\n <span className=\"text-2xs text-doom-faint\">enter launches · shift+enter for a new line · @ for files</span>\n </div>\n <div className=\"flex flex-wrap gap-5\">\n <div className=\"flex flex-col gap-1.5\">\n <FieldLabel>CONTEXT</FieldLabel>\n <div className=\"flex flex-wrap gap-1.5\">\n <Button\n variant={fork ? 'outline' : 'primary'}\n size=\"xs\"\n data-testid=\"launch-fresh\"\n data-active={!fork}\n onClick={() => setFork(false)}\n >\n fresh\n </Button>\n <Button\n variant={fork ? 'primary' : 'outline'}\n size=\"xs\"\n data-testid=\"launch-fork\"\n data-active={fork}\n onClick={() => setFork(true)}\n >\n fork this session\n </Button>\n </div>\n <span className=\"text-2xs text-doom-faint\">fork shares the conversation so far</span>\n </div>\n <div className=\"flex flex-col gap-1.5\">\n <FieldLabel>MODEL</FieldLabel>\n <Select value={model} onValueChange={setModel}>\n <SelectTrigger data-testid=\"launch-model\" className=\"h-7 w-full min-w-0 text-xs sm:min-w-[200px]\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value={AGENT_DEFAULT}>agent default{agent.model ? ` · ${agent.model}` : ''}</SelectItem>\n {modelChoices(agent, models).map((choice) => (\n <SelectItem key={choice} value={choice}>\n {choice}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n <span className=\"text-2xs text-doom-faint\">leave unset to use the agent's default</span>\n </div>\n <div className=\"flex flex-col gap-1.5\">\n <FieldLabel>CWD</FieldLabel>\n <span className=\"flex h-7 items-center text-xs text-doom-dim\">{abbreviateCwd(cwd)}</span>\n <span className=\"text-2xs text-doom-faint\">the session's directory</span>\n </div>\n </div>\n {error ? (\n <p role=\"alert\" className=\"text-xs text-doom-red\">\n {error}\n </p>\n ) : null}\n <DialogFooter className=\"flex-wrap sm:flex-nowrap\">\n <span className=\"w-full text-2xs text-doom-faint sm:w-auto\">\n the run opens in its own tab once it starts\n </span>\n <span className=\"min-w-0 flex-1\" />\n <Button variant=\"outline\" size=\"xs\" data-testid=\"launch-cancel\" onClick={onClose}>\n cancel\n </Button>\n <Button\n variant=\"primary\"\n size=\"xs\"\n data-testid=\"launch-submit\"\n disabled={busy}\n onClick={() => void launch()}\n >\n {busy ? 'launching…' : 'launch'}\n </Button>\n </DialogFooter>\n </DialogBody>\n </DialogContent>\n </Dialog>\n );\n}\n","import type { TransientTab, WebPluginSlotProps } from '@agimon-ai/doompi-core/web';\nimport {\n Badge,\n Button,\n cn,\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n EmptyState,\n KebabIcon,\n Kbd,\n Panel,\n Sheet,\n SheetBody,\n SheetContent,\n SheetHeader,\n SheetTitle,\n STATUS_EDGE,\n StatusBadge,\n} from '@agimon-ai/doompi-web-components';\nimport { useStore } from '@tanstack/react-store';\nimport { type KeyboardEvent as ReactKeyboardEvent, useEffect, useState } from 'react';\n\nimport type { SubagentRun } from '../../../../../types/webSubagents';\nimport { catalog, closeCatalog, closeLaunch, loadCatalog, openCatalog, openLaunch } from '../_lib/catalogStore';\nimport { abbreviateCwd, agentRunLabel } from '../_lib/format';\nimport { RUN_ACTIONS_SLOT } from '../_lib/runActionsSlot';\nimport {\n clearAutoOpen,\n dismissRun,\n isTerminalRun,\n openRun,\n requestRunStop,\n subagents,\n visibleRuns,\n} from '../_lib/subagentsStore';\nimport { AgentCatalogDrawer } from './AgentCatalogDrawer';\nimport { agentThreadTab } from './AgentThreadPanel';\nimport { LaunchAgentDialog } from './LaunchAgentDialog';\nimport { elapsedRun, RUN_BADGE, RunControl } from './RunControl';\n\n/** One fleet tab per session; the fleet is singular, so the id needs nothing else. */\nexport const SUBAGENTS_TAB_ID = 'subagents-fleet';\n\nconst TICK_MS = 10_000;\n\n/**\n * How much of a run's own conversation a card carries: enough to read what it\n * is doing right now, not enough to read the run. The whole thread is one\n * click away in the run's tab.\n */\nconst CARD_THREAD_ENTRIES = 8;\n\n/** The card's work line: a task binding wins; otherwise the delegation prompt. */\nfunction WorkLine({ run }: { run: SubagentRun }) {\n const firstLine = run.task.split('\\n').find((line) => line.trim() !== '') ?? '';\n if (run.taskRef) {\n return (\n <div className=\"flex items-center gap-2 px-3 pb-2.5\">\n <Badge tone=\"violet\" size=\"xs\" className=\"shrink-0 rounded-sm bg-doom-violet/10\">\n TASK {run.taskRef}\n </Badge>\n <span data-testid=\"run-work\" className=\"min-w-0 truncate text-xs text-doom-hi\">\n {firstLine}\n </span>\n </div>\n );\n }\n return (\n <div className=\"flex items-center gap-2 px-3 pb-2.5\">\n <span className=\"shrink-0 text-2xs font-bold text-doom-faint\">PROMPT</span>\n <span data-testid=\"run-work\" className=\"min-w-0 truncate text-xs text-doom-dim\">\n {firstLine}\n </span>\n </div>\n );\n}\n\n/**\n * Everything a card can do, behind one control.\n *\n * A card already spends its width on the run's own stream, and stop, clear,\n * detail and the run's tab are four verbs: as buttons they crowd the footer\n * and each one has to defend itself from the card's own click.\n */\nfunction RunMenu({\n sessionId,\n run,\n stopping,\n onOpenThread,\n onOpenDetail,\n}: {\n sessionId: string;\n run: SubagentRun;\n stopping: boolean;\n onOpenThread: () => void;\n onOpenDetail: () => void;\n}) {\n const [error, setError] = useState<string | undefined>();\n const stop = (): void => {\n setError(undefined);\n requestRunStop(sessionId, run.runId).catch((cause: unknown) =>\n setError(cause instanceof Error ? cause.message : String(cause)),\n );\n };\n return (\n <>\n {error ? (\n <span\n role=\"alert\"\n data-testid={`run-menu-stop-error-${run.runId}`}\n title={error}\n className=\"min-w-0 truncate text-2xs text-doom-red\"\n >\n {error}\n </span>\n ) : null}\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n data-testid={`run-menu-${run.runId}`}\n title=\"what this run can do\"\n aria-label=\"run actions\"\n onClick={(event) => event.stopPropagation()}\n >\n <KebabIcon className=\"h-3 w-3\" />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent data-testid={`run-menu-content-${run.runId}`}>\n <DropdownMenuItem data-testid={`run-open-${run.runId}`} onSelect={onOpenThread}>\n open thread\n </DropdownMenuItem>\n <DropdownMenuItem data-testid={`run-detail-${run.runId}`} onSelect={onOpenDetail}>\n details\n </DropdownMenuItem>\n <DropdownMenuSeparator />\n {isTerminalRun(run) ? (\n <DropdownMenuItem data-testid={`run-clear-${run.runId}`} onSelect={() => dismissRun(sessionId, run.runId)}>\n clear from the grid\n </DropdownMenuItem>\n ) : (\n <DropdownMenuItem\n variant=\"destructive\"\n data-testid={`run-stop-${run.runId}`}\n data-stopping={stopping}\n disabled={stopping}\n onSelect={stop}\n >\n {stopping ? 'stopping…' : 'stop'}\n </DropdownMenuItem>\n )}\n </DropdownMenuContent>\n </DropdownMenu>\n </>\n );\n}\n\n/**\n * One run in the grid: its live conversation under a header, on the host's own\n * transcript so a tool call reads the same here as in the session.\n *\n * The body is a glance, so it takes the newest entries only and does not take\n * the pointer: the whole card is the way into the run's tab.\n */\nfunction RunCard({\n sessionId,\n run,\n now,\n stopping,\n renderThread,\n onOpenThread,\n onOpenDetail,\n}: {\n sessionId: string;\n run: SubagentRun;\n now: number;\n stopping: boolean;\n renderThread: WebPluginSlotProps['renderThread'];\n onOpenThread: () => void;\n onOpenDetail: () => void;\n}) {\n const badge = RUN_BADGE[run.state];\n const onKeyDown = (event: ReactKeyboardEvent<HTMLDivElement>): void => {\n if (event.target !== event.currentTarget) return;\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n onOpenThread();\n }\n };\n // A div rather than a button: the card carries a menu of its own, and a\n // button cannot contain another.\n return (\n <Panel\n asChild\n className={cn(\n 'flex h-[280px] min-w-0 flex-col text-left transition-colors outline-none hover:border-doom-blue/50 focus-within:border-doom-blue',\n STATUS_EDGE[badge.tone],\n )}\n >\n <div data-testid={`run-card-${run.runId}`} data-run-state={run.state}>\n <div\n role=\"button\"\n tabIndex={0}\n data-testid={`run-open-card-${run.runId}`}\n className=\"flex min-h-0 flex-1 cursor-pointer flex-col outline-none\"\n title=\"open this run's own thread in a tab\"\n onClick={onOpenThread}\n onKeyDown={onKeyDown}\n >\n <div className=\"flex items-center gap-2 px-3 pt-2.5 pb-1.5\">\n <span data-testid=\"run-agent\" className=\"truncate text-sm font-bold text-doom-hi\">\n {agentRunLabel(run)}\n </span>\n <span className=\"min-w-0 flex-1\" />\n <span className=\"shrink-0 text-2xs text-doom-faint\">{elapsedRun(run, now)}</span>\n <StatusBadge tone={badge.tone} data-testid=\"run-state\">\n {badge.label}\n </StatusBadge>\n </div>\n <WorkLine run={run} />\n {/* The run's own journal, drawn by the host's timeline: the newest\n entries only, and inert, so the card stays one click. */}\n <div\n data-testid=\"run-stream\"\n className=\"pointer-events-none flex min-h-0 flex-1 flex-col overflow-hidden border-t border-doom-border-soft bg-doom-deep\"\n >\n {renderThread(run.runId, { limit: CARD_THREAD_ENTRIES, compact: true })}\n </div>\n {run.state === 'failed' && run.error ? (\n <span\n data-testid=\"run-error\"\n className=\"truncate border-t border-doom-border-soft px-3 py-1.5 text-xs text-doom-red\"\n >\n {run.error}\n </span>\n ) : null}\n </div>\n <div className=\"flex shrink-0 items-center gap-3 border-t border-doom-border-soft px-3 py-1.5\">\n <span className=\"truncate text-2xs text-doom-faint\">\n {run.toolCount !== undefined ? `${run.toolCount} tools` : '—'}\n {run.tokens !== undefined ? ` · ${run.tokens.toLocaleString()} tk` : ''}\n {run.model ? ` · ${run.model.split('/').pop() ?? run.model}` : ''}\n </span>\n <span className=\"min-w-0 flex-1\" />\n <RunMenu\n sessionId={sessionId}\n run={run}\n stopping={stopping}\n onOpenThread={onOpenThread}\n onOpenDetail={onOpenDetail}\n />\n </div>\n </div>\n </Panel>\n );\n}\n\nfunction SheetRow({ label, value, tone = 'text-doom-dim' }: { label: string; value: string; tone?: string }) {\n return (\n <div className=\"flex gap-2.5\">\n <span className=\"w-11 shrink-0 text-2xs text-doom-faint\">{label}</span>\n <span className={`min-w-0 break-words text-xs ${tone}`}>{value}</span>\n </div>\n );\n}\n\nfunction SheetBlock({ label, text, testId, tone }: { label: string; text: string; testId: string; tone?: string }) {\n return (\n <div className=\"flex flex-col gap-1 rounded-md border border-doom-border bg-doom-deep px-3 py-2.5\">\n <span className=\"text-2xs font-bold tracking-wider text-doom-faint\">{label}</span>\n <pre\n data-testid={testId}\n className={`overflow-x-auto whitespace-pre-wrap break-words text-xs leading-relaxed ${tone ?? 'text-doom-text'}`}\n >\n {text}\n </pre>\n </div>\n );\n}\n\n/**\n * What the run was asked to do and what it was given to do it with, over the\n * grid rather than beside it: the conversation is on the card and in the run's\n * tab, so this reads as a definition and takes no width from the fleet.\n */\nfunction RunDetailSheet({\n sessionId,\n run,\n now,\n stopping,\n renderSlot,\n onClose,\n}: {\n sessionId: string;\n run: SubagentRun;\n now: number;\n stopping: boolean;\n renderSlot: WebPluginSlotProps['renderSlot'];\n onClose: () => void;\n}) {\n const badge = RUN_BADGE[run.state];\n return (\n <Sheet\n open\n onOpenChange={(open) => {\n if (!open) onClose();\n }}\n >\n <SheetContent data-testid=\"run-sheet\" aria-describedby={undefined}>\n <SheetHeader closeLabel=\"close the run detail\">\n <SheetTitle data-testid=\"sheet-agent\">{agentRunLabel(run)}</SheetTitle>\n <StatusBadge tone={badge.tone}>{badge.label}</StatusBadge>\n <span className=\"min-w-0 flex-1\" />\n <span className=\"text-xs text-doom-faint\">{elapsedRun(run, now)}</span>\n {renderSlot(RUN_ACTIONS_SLOT.slot)}\n <RunControl sessionId={sessionId} run={run} stopping={stopping} />\n </SheetHeader>\n <SheetBody>\n <div className=\"flex flex-col gap-1.5\">\n <SheetRow label=\"run\" value={run.runId} />\n {run.taskRef ? <SheetRow label=\"task\" value={run.taskRef} tone=\"text-doom-violet\" /> : null}\n <SheetRow label=\"model\" value={run.model ?? 'the runtime default'} />\n <SheetRow label=\"cwd\" value={abbreviateCwd(run.cwd)} />\n <SheetRow\n label=\"work\"\n value={`${run.toolCount === undefined ? 'no' : String(run.toolCount)} tools${\n run.tokens === undefined ? '' : ` · ${run.tokens.toLocaleString()} tk`\n }`}\n />\n </div>\n <SheetBlock\n label=\"PROMPT FROM THE MAIN AGENT\"\n testId=\"sheet-task\"\n text={run.task || '(no prompt recorded)'}\n />\n {run.summary ? <SheetBlock label=\"REPORT\" testId=\"sheet-summary\" text={run.summary} /> : null}\n {run.error ? <SheetBlock label=\"FAILURE\" testId=\"sheet-error\" text={run.error} tone=\"text-doom-red\" /> : null}\n </SheetBody>\n </SheetContent>\n </Sheet>\n );\n}\n\n/**\n * The subagents tab: the focused session's fleet as a computed grid.\n *\n * Columns come from the available width (auto-fill over a 420px minimum), and\n * every card is the same height with the run's own live conversation\n * absorbing the slack, so the grid reads as a fleet rather than a ragged list.\n * A card opens the run's tab; its menu opens the detail sheet over the grid.\n * The catalog to launch from still takes the right rail, because picking an\n * agent is a list beside the fleet rather than a thing about one run.\n */\nexport function SubagentsPanel({ sessionId, renderSlot, renderThread, openTransientTab }: WebPluginSlotProps) {\n const runs = useStore(subagents.store, (state) => visibleRuns(subagents.select(state, sessionId)));\n const { openRunId, stopRequested, autoOpenRunId } = useStore(subagents.store, (state) =>\n subagents.select(state, sessionId),\n );\n const shelf = useStore(catalog.store, (state) => catalog.select(state, sessionId));\n const [now, setNow] = useState(() => Date.now());\n\n useEffect(() => {\n if (sessionId === null || !shelf.open) return;\n return loadCatalog(sessionId);\n }, [sessionId, shelf.open]);\n\n useEffect(() => {\n const timer = setInterval(() => setNow(Date.now()), TICK_MS);\n return () => clearInterval(timer);\n }, []);\n\n useEffect(() => {\n if (autoOpenRunId === undefined || sessionId === null) return;\n const run = runs.find((candidate) => candidate.runId === autoOpenRunId);\n if (run) openTransientTab(agentThreadTab(run));\n clearAutoOpen(sessionId);\n }, [autoOpenRunId, runs, sessionId, openTransientTab]);\n\n const shownRun = openRunId === undefined ? undefined : runs.find((run) => run.runId === openRunId);\n const launching =\n shelf.launch === undefined ? undefined : shelf.agents.find((agent) => agent.name === shelf.launch?.agent);\n const stopping = (run: SubagentRun): boolean => stopRequested.includes(run.runId);\n const runningTally = runs.filter((run) => run.state === 'running' || run.state === 'queued').length;\n const doneTally = runs.filter((run) => run.state === 'done').length;\n const failedTally = runs.filter((run) => run.state === 'failed' || run.state === 'stopped').length;\n\n const showCatalog = (): void => {\n if (sessionId === null) return;\n openRun(sessionId, undefined);\n openCatalog(sessionId);\n };\n\n return (\n <div data-testid=\"subagents-panel\" className=\"flex min-h-0 min-w-0 flex-1 overflow-hidden\">\n <div className=\"flex min-w-0 flex-1 flex-col overflow-y-auto px-3 py-3 sm:px-[26px] sm:py-[18px]\">\n <div className=\"flex flex-wrap items-center gap-x-3 gap-y-2 pb-3\">\n <span className=\"text-2xs font-bold tracking-widest text-doom-faint\">SUBAGENTS · this session</span>\n <span className=\"hidden min-w-0 flex-1 sm:block\" />\n <span\n data-testid=\"subagents-tally\"\n className=\"order-3 w-full text-2xs text-doom-faint sm:order-none sm:w-auto\"\n >\n {runs.length === 0 ? 'no runs yet' : `${runningTally} running · ${doneTally} done · ${failedTally} failed`}\n </span>\n <Button\n variant=\"outline\"\n size=\"xs\"\n className=\"ml-auto sm:ml-0\"\n data-testid=\"subagents-launch\"\n title=\"pick an agent from the catalog and launch it\"\n onClick={showCatalog}\n >\n launch agent <Kbd>a l</Kbd>\n </Button>\n </div>\n {runs.length === 0 ? (\n <EmptyState\n data-testid=\"subagents-empty\"\n title=\"no subagent runs yet\"\n description=\"pick an agent from the catalog to launch one yourself, or let the main agent delegate with its subagent tool.\"\n />\n ) : (\n <>\n <div\n data-testid=\"subagents-grid\"\n className=\"grid grid-cols-[repeat(auto-fill,minmax(min(420px,100%),1fr))] gap-4\"\n >\n {sessionId === null\n ? null\n : runs.map((run) => (\n <RunCard\n key={run.runId}\n sessionId={sessionId}\n run={run}\n now={now}\n stopping={stopping(run)}\n renderThread={renderThread}\n onOpenThread={() => {\n closeCatalog(sessionId);\n openTransientTab(agentThreadTab(run));\n }}\n onOpenDetail={() => {\n closeCatalog(sessionId);\n openRun(sessionId, run.runId);\n }}\n />\n ))}\n </div>\n <span className=\"pt-3 text-2xs text-doom-faint\">\n click a card to open the run's thread · the card menu holds details, stop and clear · finished runs leave\n the grid after 10m\n </span>\n </>\n )}\n </div>\n {sessionId !== null && shelf.open ? (\n <AgentCatalogDrawer\n sessionId={sessionId}\n onClose={() => closeCatalog(sessionId)}\n onLaunch={(agent, fork) => openLaunch(sessionId, agent.name, fork)}\n />\n ) : null}\n {shownRun && sessionId !== null ? (\n <RunDetailSheet\n sessionId={sessionId}\n run={shownRun}\n now={now}\n stopping={stopping(shownRun)}\n renderSlot={renderSlot}\n onClose={() => openRun(sessionId, undefined)}\n />\n ) : null}\n {sessionId !== null && launching !== undefined && shelf.launch !== undefined ? (\n <LaunchAgentDialog\n key={launching.name}\n sessionId={sessionId}\n agent={launching}\n cwd={shelf.cwd}\n models={shelf.models}\n fork={shelf.launch.fork}\n initialTask={shelf.task}\n onClose={() => closeLaunch(sessionId)}\n onLaunched={() => closeCatalog(sessionId)}\n />\n ) : null}\n </div>\n );\n}\n\n/** The temporary tab the fleet opens in; opening it again only focuses it. */\nexport function subagentsTab(): TransientTab {\n return { id: SUBAGENTS_TAB_ID, label: 'subagents', panel: SubagentsPanel };\n}\n","import { defineContextAction } from '@agimon-ai/doompi-core/web';\n\nimport { subagentsTab } from '../_components/SubagentsPanel';\nimport { openAgentCatalogForContext } from '../_lib/catalogStore';\n\n/** Offered on any work item another plugin presents. The filename is the action id. */\nexport default defineContextAction({\n label: 'Launch Agent',\n detail: 'Choose an agent, review the task, then launch it.',\n kinds: ['work-item'],\n order: 10,\n run: (context) => openAgentCatalogForContext(context, subagentsTab),\n});\n","import { defineActivityGroup } from '@agimon-ai/doompi-core/web';\n\nimport { subagentsTab } from '../_components/SubagentsPanel';\nimport { activityRuns, isTerminalRun, subagents } from '../_lib/subagentsStore';\n\n/**\n * The dock group this package owns. The filename is the group name, which is\n * also the slot other plugins fill: `activity.agents`.\n *\n * It stays visible while the session is idle, because the group is the only\n * way into the fleet and a launcher that appears only once something runs\n * cannot be used to start anything.\n */\nexport default defineActivityGroup({\n keys: 'a r',\n statusKey: 'doom-team-agents',\n activeSource: {\n subscribe(listener: () => void) {\n const subscription = subagents.store.subscribe(listener);\n return () => subscription.unsubscribe();\n },\n isActive(sessionId: string | null) {\n return activityRuns(subagents.select(subagents.store.state, sessionId)).some((run) => !isTerminalRun(run));\n },\n },\n transientTab: subagentsTab,\n order: 10,\n});\n","import { defineChannelFile } from '@agimon-ai/doompi-core/web';\n\nimport { subagentCatalogChannel } from '../_lib/catalogStore';\n\n/** The agent catalog the session facet publishes. The filename is the frame type. */\nexport default defineChannelFile(subagentCatalogChannel);\n","import { defineChannelFile } from '@agimon-ai/doompi-core/web';\n\nimport { subagentRunsChannel } from '../_lib/subagentsStore';\n\n/** The run graph the session facet publishes. The filename is the frame type. */\nexport default defineChannelFile(subagentRunsChannel);\n","import type { WebPluginSlotProps } from '@agimon-ai/doompi-core/web';\nimport { Button, Dot, type DotTone } from '@agimon-ai/doompi-web-components';\nimport { useStore } from '@tanstack/react-store';\nimport { useEffect, useState } from 'react';\n\nimport type { SubagentRun } from '../../../../../../types/webSubagents';\nimport { agentThreadTab } from '../../_components/AgentThreadPanel';\nimport { subagentsTab } from '../../_components/SubagentsPanel';\nimport { openCatalog } from '../../_lib/catalogStore';\nimport { agentRunLabel } from '../../_lib/format';\nimport { formatRunDuration } from '../../_lib/format';\nimport { activityRuns, isTerminalRun, subagents } from '../../_lib/subagentsStore';\n\nconst TICK_MS = 10_000;\n\nconst STATE_TONE: Readonly<Record<SubagentRun['state'], DotTone>> = {\n queued: 'muted',\n running: 'yellow',\n done: 'green',\n failed: 'red',\n stopped: 'muted',\n};\n\nfunction elapsed(run: SubagentRun, now: number): string {\n const end = run.endedAt ?? (isTerminalRun(run) ? run.lastUpdate : now);\n return formatRunDuration(Math.max(0, end - run.startedAt));\n}\n\n/** The one-liner under a row: what the run is doing, or how it ended. */\nfunction detail(run: SubagentRun): string {\n if (run.state === 'failed' && run.error) return run.error;\n if (run.summary) return run.summary.split('\\n').find((line) => line.trim() !== '') ?? '';\n return run.currentTool ?? run.tail.at(-1) ?? run.state;\n}\n\n/**\n * The agents group's body in the activity dock: the session's runs, each a\n * row that opens the run's own conversation in a temporary tab. This replaces\n * the runtime's footer one-liner, which only says whether anything is running.\n */\nexport function AgentsActivitySection({ sessionId, openTransientTab }: WebPluginSlotProps) {\n const runs = useStore(subagents.store, (state) => activityRuns(subagents.select(state, sessionId)));\n const [now, setNow] = useState(() => Date.now());\n\n useEffect(() => {\n const timer = setInterval(() => setNow(Date.now()), TICK_MS);\n return () => clearInterval(timer);\n }, []);\n\n if (runs.length === 0) {\n return (\n <div className=\"flex items-center gap-2 px-1\">\n <p data-testid=\"activity-summary-agents\" className=\"text-xs text-doom-faint\">\n idle\n </p>\n <Button\n variant=\"link\"\n size=\"xs\"\n data-testid=\"activity-agents-launch\"\n className=\"px-0\"\n onClick={() => {\n if (sessionId === null) return;\n openCatalog(sessionId);\n openTransientTab(subagentsTab());\n }}\n >\n launch an agent\n </Button>\n </div>\n );\n }\n\n return (\n <div data-testid=\"activity-agent-runs\" className=\"flex flex-col gap-0.5\">\n {runs.map((run) => (\n <Button\n key={run.runId}\n variant=\"ghost\"\n size=\"card\"\n data-testid={`activity-run-${run.runId}`}\n data-run-state={run.state}\n title=\"open this run's conversation\"\n onClick={() => {\n if (sessionId === null) return;\n openTransientTab(agentThreadTab(run));\n }}\n className=\"min-w-0 gap-0.5 rounded-md px-1 py-1 hover:bg-doom-panel\"\n >\n <span className=\"flex min-w-0 items-center gap-1.5\">\n <Dot tone={STATE_TONE[run.state]} pulse={run.state === 'running'} />\n <span\n className={`min-w-0 flex-1 truncate text-xs font-bold ${isTerminalRun(run) ? 'text-doom-dim' : 'text-doom-hi'}`}\n >\n {agentRunLabel(run)}\n </span>\n <span className=\"shrink-0 text-2xs text-doom-faint\">\n {elapsed(run, now)}\n {run.toolCount !== undefined ? ` · ${run.toolCount} tools` : ''}\n </span>\n </span>\n <span className={`truncate pl-3 text-2xs ${run.state === 'failed' ? 'text-doom-red' : 'text-doom-faint'}`}>\n {detail(run)}\n </span>\n </Button>\n ))}\n </div>\n );\n}\n","import { defineFill } from '@agimon-ai/doompi-core/web';\n\nimport { AgentsActivitySection } from './_components/AgentsActivitySection';\n\n/**\n * Renders inside the `agents` activity group rather than after the groups.\n *\n * The target in the filename is the slot. `activity.agents` is the group this\n * package also declares, and the dock puts this in place of its one-line\n * footer summary.\n */\nexport default defineFill({ component: AgentsActivitySection });\n","/** The Leader Space group both of this package's bindings hang from. */\nexport const AGENTS_GROUP = { key: 'a', label: 'agents', detail: 'subagent resources and runs' };\n","import { defineLeaderBinding } from '@agimon-ai/doompi-core/web';\n\nimport { subagentsTab } from '../_components/SubagentsPanel';\nimport { openCatalog } from '../_lib/catalogStore';\nimport { AGENTS_GROUP } from './_lib/leaderGroups';\n\n/** SPC a l: pick an agent and launch it. The filename is the binding's local name. */\nexport default defineLeaderBinding({\n path: [AGENTS_GROUP, { key: 'l', label: 'launch', detail: 'pick an agent and launch it' }],\n run: (context) => {\n if (context.sessionId !== null) openCatalog(context.sessionId);\n context.openTransientTab(subagentsTab());\n },\n});\n","import { defineLeaderBinding } from '@agimon-ai/doompi-core/web';\n\nimport { subagentsTab } from '../_components/SubagentsPanel';\nimport { AGENTS_GROUP } from './_lib/leaderGroups';\n\n/** SPC a r: the runs in this session. The filename is the binding's local name. */\nexport default defineLeaderBinding({\n path: [AGENTS_GROUP, { key: 'r', label: 'runs', detail: 'runs in this session' }],\n run: (context) => context.openTransientTab(subagentsTab()),\n});\n","import { defineSlotFile } from '@agimon-ai/doompi-core/web';\n\n/**\n * The run detail sheet's action row, open to independent plugins.\n *\n * The filename is the local name; the path namespaces it as\n * `subagents.run-actions`, so no filler has to spell that prefix.\n */\nexport default defineSlotFile({});\n","/**\n * Pure text shaping for the team tool cards, kept apart from React so the\n * unit suite covers it without a DOM. The shapes mirror what the TUI's\n * subagentToolRender shows; args and details are wire JSON narrowed here.\n */\n\n/** The TUI collapses a result to this many lines until expanded. */\nexport const COLLAPSED_RESULT_LINES = 12;\nconst MESSAGE_PREVIEW_CHARS = 72;\nconst ELLIPSIS = '…';\n\ntype Args = Readonly<Record<string, unknown>>;\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction asString(value: unknown): string {\n return typeof value === 'string' ? value : '';\n}\n\n/** The detail beside the subagent action, as the TUI's callDetails words it. */\nexport function subagentCallDetail(args: Args): string {\n switch (args.action) {\n case 'agents':\n return asString(args.name);\n case 'run': {\n const requests = Array.isArray(args.requests) ? args.requests : [];\n const agents = requests.map((request) => (isRecord(request) ? asString(request.agent) : '')).filter(Boolean);\n const count = `${requests.length} agent${requests.length === 1 ? '' : 's'}`;\n return agents.length > 0 ? `${count} · ${agents.join(', ')}` : count;\n }\n case 'status':\n return asString(args.id) || 'fleet';\n case 'steer':\n case 'stop':\n case 'restore':\n return asString(args.id);\n case 'suspended':\n return 'runs';\n default:\n return '';\n }\n}\n\n/** Result text as lines, trailing blank lines dropped the way the TUI does. */\nexport function resultLines(output: string): string[] {\n const lines = output.split('\\n');\n while (lines.length > 0 && lines.at(-1)?.trim() === '') lines.pop();\n return lines.length === 1 && lines[0] === '' ? [] : lines;\n}\n\nexport type ResultGlyph = 'running' | 'failed' | 'done' | 'more' | 'none';\n\nexport interface ShapedResult {\n lines: string[];\n glyph: ResultGlyph;\n /** Lines hidden by the collapse, for the \"more\" hint. */\n hidden: number;\n}\n\n/**\n * The subagent result body: a tail while running, then the head collapsed to\n * the TUI budget, with the closing glyph line the TUI appends.\n */\nexport function shapeResult(\n output: string,\n options: { expanded: boolean; isPartial: boolean; isError: boolean },\n): ShapedResult {\n const all = resultLines(output);\n if (options.isPartial) {\n return { lines: all.slice(-COLLAPSED_RESULT_LINES), glyph: 'running', hidden: 0 };\n }\n const lines = options.expanded ? all : all.slice(0, COLLAPSED_RESULT_LINES);\n const hidden = all.length - lines.length;\n if (options.isError) return { lines, glyph: 'failed', hidden };\n if (hidden > 0) return { lines, glyph: 'more', hidden };\n if (lines.length === 0) return { lines, glyph: 'done', hidden: 0 };\n return { lines, glyph: 'none', hidden: 0 };\n}\n\nfunction preview(message: string): string {\n const flat = message.replace(/\\s+/g, ' ').trim();\n return flat.length > MESSAGE_PREVIEW_CHARS ? `${flat.slice(0, MESSAGE_PREVIEW_CHARS - 1)}${ELLIPSIS}` : flat;\n}\n\n/** Structured rows kept in a collapsed result, before the card is expanded. */\nexport const COLLAPSED_RESULT_ROWS = 8;\n\nexport type SubagentRowTone = 'ok' | 'error' | 'running' | 'idle';\n\n/** One line of a structured subagent result: who, what, and the state flushed right. */\nexport interface SubagentRow {\n key: string;\n /** The run id or the agent name. */\n label: string;\n /** What it is doing, says, or failed with. Truncates. */\n detail: string;\n /** The state word on the right, empty when the row has none. */\n state: string;\n tone: SubagentRowTone;\n}\n\nexport type SubagentResultKind = 'agents' | 'run' | 'fleet' | 'status' | 'suspended' | 'control';\n\n/** A finished subagent result as the card shows it, narrowed from the wire details. */\nexport interface SubagentResultView {\n kind: SubagentResultKind;\n rows: SubagentRow[];\n /** The count under the rows, or a control action's one-line confirmation. */\n summary: string;\n tone: SubagentRowTone;\n}\n\nfunction records(value: unknown): Record<string, unknown>[] {\n return Array.isArray(value) ? value.filter(isRecord) : [];\n}\n\nfunction parts(values: unknown[]): string {\n return values.filter((value): value is string => typeof value === 'string' && value.trim() !== '').join(' · ');\n}\n\nfunction firstLine(value: unknown): string {\n return asString(value).split('\\n')[0] ?? '';\n}\n\nfunction stateTone(state: string): SubagentRowTone {\n if (state === 'failed' || state === 'error') return 'error';\n if (state === 'complete' || state === 'completed') return 'ok';\n if (state === 'running' || state === 'starting') return 'running';\n return 'idle';\n}\n\nfunction countSummary(count: number, noun: string): string {\n return count === 0 ? `no ${noun}s` : `${count} ${noun}${count === 1 ? '' : 's'}`;\n}\n\nfunction agentsView(value: unknown): SubagentResultView {\n const rows = records(value).map((agent, index) => ({\n key: `${asString(agent.name)}-${index}`,\n label: asString(agent.name),\n detail: preview(asString(agent.description)),\n state: asString(agent.source),\n tone: 'idle' as const,\n }));\n return { kind: 'agents', rows, summary: countSummary(rows.length, 'agent'), tone: 'idle' };\n}\n\nfunction runView(value: unknown): SubagentResultView {\n const outcomes = records(value);\n const rows = outcomes.map((outcome, index) => {\n const runId = asString(outcome.runId);\n return {\n key: runId || `${asString(outcome.agent)}-${index}`,\n label: asString(outcome.agent),\n detail: runId || preview(asString(outcome.error)) || 'unknown error',\n state: runId ? 'started' : 'failed',\n tone: (runId ? 'ok' : 'error') as SubagentRowTone,\n };\n });\n const started = rows.filter((row) => row.state === 'started').length;\n const failed = rows.length - started;\n return {\n kind: 'run',\n rows,\n summary: failed === 0 ? `${started} started` : `${started} started · ${failed} failed`,\n tone: failed === 0 ? 'ok' : 'error',\n };\n}\n\nfunction fleetView(value: unknown): SubagentResultView {\n const rows = records(value).map((job, index) => {\n const state = asString(job.status) || 'starting';\n return {\n key: asString(job.runId) || `run-${index}`,\n label: asString(job.runId),\n // The run id stays the label because it is the key a reader copies; the\n // identity leads the detail so the row still says who this is.\n detail: preview(\n parts([\n job.identity ? (job.inline ? `${asString(job.identity)} (inline)` : job.identity) : undefined,\n job.agent,\n job.currentTool,\n job.activityState,\n job.attentionReason,\n job.error,\n ]),\n ),\n state,\n tone: stateTone(state),\n };\n });\n return { kind: 'fleet', rows, summary: countSummary(rows.length, 'run'), tone: 'idle' };\n}\n\nfunction suspendedView(value: unknown): SubagentResultView {\n const runs = isRecord(value) ? [value] : records(value);\n const rows = runs.map((run, index) => {\n const resumable = run.resumable;\n return {\n key: asString(run.runId) || `suspended-${index}`,\n label: asString(run.runId),\n detail: preview(parts([run.agent, firstLine(run.task)])),\n state: resumable === false ? 'not resumable' : resumable === true ? 'resumable' : 'suspended',\n tone: (resumable === false ? 'error' : 'idle') as SubagentRowTone,\n };\n });\n return { kind: 'suspended', rows, summary: countSummary(rows.length, 'suspended run'), tone: 'idle' };\n}\n\nfunction statusView(details: Record<string, unknown>): SubagentResultView {\n const runId = asString(details.runId);\n const status = isRecord(details.status) ? details.status : undefined;\n const state = status ? asString(status.state) : '';\n if (!state) return { kind: 'status', rows: [], summary: `${runId} has no status yet`, tone: 'idle' };\n return {\n kind: 'status',\n rows: [\n {\n key: runId,\n label: runId,\n detail: preview(parts([status?.agent, status?.activityState, status?.summary, status?.error])),\n state,\n tone: stateTone(state),\n },\n ],\n summary: '',\n tone: stateTone(state),\n };\n}\n\nfunction controlView(summary: string, tone: SubagentRowTone): SubagentResultView {\n return { kind: 'control', rows: [], summary, tone };\n}\n\n/**\n * Narrows the wire `details` of a subagent result to the rows the card draws.\n * Null when they are not a finished subagent result at all, which is what a\n * partial update or an error message is: the card then falls back to the text.\n */\nexport function subagentResultView(details: unknown): SubagentResultView | null {\n if (!isRecord(details) || details.partial === true) return null;\n if (Array.isArray(details.agents)) return agentsView(details.agents);\n if (Array.isArray(details.outcomes)) return runView(details.outcomes);\n if (isRecord(details.spawn) && Array.isArray(details.spawn.outcomes)) return runView(details.spawn.outcomes);\n if (Array.isArray(details.runs)) return fleetView(details.runs);\n if (Array.isArray(details.fleet)) return fleetView(details.fleet);\n if (details.suspended !== undefined) return suspendedView(details.suspended);\n if (isRecord(details.control)) {\n return controlView(`stop requested for ${asString(details.runId)}`, 'ok');\n }\n if (isRecord(details.steer)) {\n const state = asString(details.steer.state);\n return controlView(\n `steer ${state}${details.steer.message ? `: ${preview(asString(details.steer.message))}` : ''}`,\n state === 'failed' ? 'error' : 'ok',\n );\n }\n if (isRecord(details.restore)) {\n const restore = details.restore;\n return controlView(`restored ${asString(restore.restoredFrom)} as ${asString(restore.runId)}`, 'ok');\n }\n if (typeof details.runId === 'string') return statusView(details);\n return null;\n}\n\nexport interface IntercomCallSummary {\n action: string;\n /** The member or request the action addresses, empty for members and pending. */\n target: string;\n /** A one-line preview of the message body, empty when the action carries none. */\n message: string;\n}\n\n/** The intercom call header: action, its target, and what is being said. */\nexport function intercomCallSummary(args: Args): IntercomCallSummary {\n const action = asString(args.action);\n switch (action) {\n case 'send':\n case 'ask':\n return { action, target: asString(args.to), message: preview(asString(args.message)) };\n case 'reply':\n return { action, target: asString(args.requestId), message: preview(asString(args.message)) };\n default:\n return { action, target: '', message: '' };\n }\n}\n\nexport type IntercomOutcome = 'delivered' | 'queued' | 'replied' | 'answered' | 'none';\n\n/**\n * The outcome line for a finished intercom call, read from the details the\n * tool attaches: a send is delivered or only queued, a reply confirms its\n * request, an ask carries the answer's sender.\n */\nexport function intercomOutcome(details: unknown): { outcome: IntercomOutcome; who: string } {\n if (!isRecord(details)) return { outcome: 'none', who: '' };\n if (details.delivered === true) return { outcome: 'delivered', who: asString(details.to) };\n if (details.state === 'queued') return { outcome: 'queued', who: asString(details.to) };\n if (typeof details.reply === 'string') return { outcome: 'answered', who: asString(details.from) };\n if (typeof details.requestId === 'string' && typeof details.to === 'string') {\n return { outcome: 'replied', who: details.to };\n }\n return { outcome: 'none', who: '' };\n}\n","import type { ToolMessageRenderProps } from '@agimon-ai/doompi-core/web';\nimport {\n MessageItem,\n MessageItemBody,\n MessageItemHeader,\n MessageItemStatus,\n toolTone,\n} from '@agimon-ai/doompi-web-components';\n\nimport { intercomCallSummary, intercomOutcome, shapeResult } from '../_lib/toolText';\n\nconst OUTCOME_LINE = {\n delivered: { tone: 'ok', text: 'delivered to' },\n queued: { tone: 'running', text: 'queued, delivery unconfirmed, for' },\n replied: { tone: 'ok', text: 'replied to' },\n answered: { tone: 'ok', text: 'answered by' },\n} as const;\n\n/**\n * The intercom tool's timeline item. Intercom has no TUI renderer; the\n * header names the action, its member or request, and the message, and the\n * body shows the result text with the outcome the details report.\n */\nexport function IntercomToolMessage({ args, result, output, running, isError }: ToolMessageRenderProps) {\n const summary = intercomCallSummary(args);\n const collapsed = shapeResult(output, { expanded: false, isPartial: running, isError });\n const outcome = running || isError ? { outcome: 'none' as const, who: '' } : intercomOutcome(result?.details);\n const line = outcome.outcome === 'none' ? null : OUTCOME_LINE[outcome.outcome];\n return (\n <MessageItem tone={toolTone({ running, isError })} expandable={collapsed.glyph === 'more'}>\n {({ expanded }) => {\n const shaped = expanded ? shapeResult(output, { expanded: true, isPartial: running, isError }) : collapsed;\n return (\n <>\n <MessageItemHeader title=\"intercom\">\n <span data-testid=\"tool-call-intercom\" className=\"flex min-w-0 flex-1 items-center gap-2\">\n <span className=\"text-doom-hi\">{summary.action}</span>\n {summary.target ? <span className=\"shrink-0 text-doom-cyan\">→ {summary.target}</span> : null}\n {summary.message ? <span className=\"min-w-0 truncate text-doom-dim\">{summary.message}</span> : null}\n </span>\n </MessageItemHeader>\n <MessageItemBody data-testid=\"tool-result-intercom\" className=\"flex flex-col gap-1\">\n {shaped.lines.length > 0 ? (\n <pre className={`${expanded ? 'whitespace-pre-wrap break-words' : 'truncate'} text-doom-dim`}>\n {shaped.lines.join('\\n')}\n </pre>\n ) : null}\n {running ? <MessageItemStatus tone=\"running\">waiting</MessageItemStatus> : null}\n {isError ? <MessageItemStatus tone=\"error\">failed</MessageItemStatus> : null}\n {line ? (\n <MessageItemStatus tone={line.tone}>\n {line.text} <span className=\"text-doom-cyan\">{outcome.who}</span>\n </MessageItemStatus>\n ) : null}\n {shaped.glyph === 'more' ? (\n <MessageItemStatus expands>{shaped.hidden} more line(s)</MessageItemStatus>\n ) : null}\n </MessageItemBody>\n </>\n );\n }}\n </MessageItem>\n );\n}\n","import { defineToolRenderer } from '@agimon-ai/doompi-core/web';\n\nimport { IntercomToolMessage } from './_components/IntercomToolMessage';\n\n/** The intercom tool's timeline card. The filename names the tool it renders. */\nexport default defineToolRenderer({ message: IntercomToolMessage });\n","import type { ToolMessageRenderProps } from '@agimon-ai/doompi-core/web';\nimport {\n Button,\n MessageItem,\n MessageItemBody,\n MessageItemHeader,\n MessageItemStatus,\n type StatusTone,\n toolTone,\n} from '@agimon-ai/doompi-web-components';\n\nimport { subagentsTab } from '../../_components/SubagentsPanel';\nimport {\n COLLAPSED_RESULT_ROWS,\n shapeResult,\n subagentCallDetail,\n subagentResultView,\n type SubagentRow,\n type SubagentRowTone,\n} from '../_lib/toolText';\n\nconst CLOSING = {\n running: { tone: 'running', text: 'running' },\n failed: { tone: 'error', text: 'failed' },\n done: { tone: 'ok', text: 'done' },\n} as const;\n\nconst ROW_TONE: Record<SubagentRowTone, string> = {\n ok: 'text-doom-green',\n error: 'text-doom-red',\n running: 'text-doom-yellow',\n idle: 'text-doom-dim',\n};\n\nconst STATUS_TONE: Record<SubagentRowTone, StatusTone> = {\n ok: 'ok',\n error: 'error',\n running: 'running',\n idle: 'ok',\n};\n\n/** One structured row: the run or agent, what it is doing, and its state flushed right. */\nfunction SubagentRowLine({ row }: { row: SubagentRow }) {\n return (\n <li data-testid=\"tool-result-subagent-row\" className=\"flex items-baseline gap-2\">\n <span className=\"shrink-0 text-doom-cyan\">{row.label}</span>\n <span className=\"min-w-0 flex-1 truncate text-doom-dim\">{row.detail}</span>\n {row.state ? <span className={`shrink-0 ${ROW_TONE[row.tone]}`}>{row.state}</span> : null}\n </li>\n );\n}\n\n/**\n * The subagent tool's timeline item, the web half of renderSubagentCall and\n * renderSubagentResult: the action and its per-action detail in the header,\n * the rows the result reported in the body, and the subagents tab one click\n * away. A result the narrower does not recognise, a partial one included,\n * falls back to the text the model was given.\n */\nexport function SubagentToolMessage({\n args,\n result,\n output,\n running,\n isError,\n openTransientTab,\n}: ToolMessageRenderProps) {\n const action = typeof args.action === 'string' ? args.action : '';\n const detail = subagentCallDetail(args);\n const view = running || isError ? null : subagentResultView(result?.details);\n const hiddenRows = view ? Math.max(0, view.rows.length - COLLAPSED_RESULT_ROWS) : 0;\n const collapsedText = view ? null : shapeResult(output, { expanded: false, isPartial: running, isError });\n return (\n <MessageItem\n tone={toolTone({ running, isError })}\n expandable={view ? hiddenRows > 0 : collapsedText?.glyph === 'more'}\n >\n {({ expanded }) => {\n const shaped =\n view || !collapsedText\n ? null\n : expanded\n ? shapeResult(output, { expanded: true, isPartial: running, isError })\n : collapsedText;\n const closing = !shaped || shaped.glyph === 'none' || shaped.glyph === 'more' ? null : CLOSING[shaped.glyph];\n const rows = view ? (expanded ? view.rows : view.rows.slice(0, COLLAPSED_RESULT_ROWS)) : [];\n return (\n <>\n <MessageItemHeader title=\"subagent\">\n <span data-testid=\"tool-call-subagent\" className=\"flex min-w-0 flex-1 items-center gap-2\">\n <span className=\"text-doom-hi\">{action}</span>\n {detail ? <span className=\"min-w-0 truncate text-doom-cyan\">{detail}</span> : null}\n </span>\n </MessageItemHeader>\n <MessageItemBody data-testid=\"tool-result-subagent\" className=\"flex flex-col gap-1\">\n {rows.length > 0 ? (\n <ul className=\"flex flex-col gap-0.5\">\n {rows.map((row) => (\n <SubagentRowLine key={row.key} row={row} />\n ))}\n </ul>\n ) : null}\n {shaped && shaped.lines.length > 0 ? (\n <pre className={`${expanded ? 'whitespace-pre-wrap break-words' : 'truncate'} text-doom-dim`}>\n {shaped.lines.join('\\n')}\n </pre>\n ) : null}\n {!expanded && hiddenRows > 0 ? <MessageItemStatus expands>{hiddenRows} more</MessageItemStatus> : null}\n {view && view.summary ? (\n <MessageItemStatus data-testid=\"tool-result-subagent-summary\" tone={STATUS_TONE[view.tone]}>\n {view.summary}\n </MessageItemStatus>\n ) : null}\n {closing ? <MessageItemStatus tone={closing.tone}>{closing.text}</MessageItemStatus> : null}\n {shaped?.glyph === 'more' ? (\n <MessageItemStatus expands>{shaped.hidden} more line(s)</MessageItemStatus>\n ) : null}\n <Button\n variant=\"link\"\n size=\"xs\"\n data-testid=\"tool-result-subagent-open\"\n onClick={() => openTransientTab(subagentsTab())}\n className=\"self-start px-0\"\n >\n open subagents\n </Button>\n </MessageItemBody>\n </>\n );\n }}\n </MessageItem>\n );\n}\n","import { defineToolRenderer } from '@agimon-ai/doompi-core/web';\n\nimport { SubagentToolMessage } from './_components/SubagentToolMessage';\n\n/** The subagent tool's timeline card. The filename names the tool it renders. */\nexport default defineToolRenderer({ message: SubagentToolMessage });\n","// Generated by @agimon-ai/doompi-build. Do not edit by hand.\nimport { defineWebPlugin, type WebPluginContributions } from '@agimon-ai/doompi-core/web';\n\nimport actionLaunchAgent from '../src/extensions/workspaces/sessions/(frontend)/action/launch-agent.web';\nimport activityGroupAgents from '../src/extensions/workspaces/sessions/(frontend)/activity-group/agents.web';\nimport channelSubagentCatalog from '../src/extensions/workspaces/sessions/(frontend)/channel/subagent-catalog.web';\nimport channelSubagentRuns from '../src/extensions/workspaces/sessions/(frontend)/channel/subagent-runs.web';\nimport fillAgents from '../src/extensions/workspaces/sessions/(frontend)/fill/Agents.activity.agents.web';\nimport leaderCatalog from '../src/extensions/workspaces/sessions/(frontend)/leader/catalog.web';\nimport leaderFleet from '../src/extensions/workspaces/sessions/(frontend)/leader/fleet.web';\nimport slotRunActions from '../src/extensions/workspaces/sessions/(frontend)/slot/run-actions.web';\nimport toolIntercom from '../src/extensions/workspaces/sessions/(frontend)/tool/intercom.web';\nimport toolSubagent from '../src/extensions/workspaces/sessions/(frontend)/tool/subagent.web';\n\nconst via = <T>(identity: Record<string, unknown>, value: unknown): T =>\n (value === undefined ? undefined : { ...identity, ...(value as object) }) as T;\n\nexport const webPlugin = defineWebPlugin({\n id: 'subagents',\n session: {\n get activityGroups(): WebPluginContributions['activityGroups'] { return [via({ name: 'agents' }, activityGroupAgents)]; },\n get channels(): WebPluginContributions['channels'] { return [via({ channel: 'subagent_catalog' }, channelSubagentCatalog), via({ channel: 'subagent_runs' }, channelSubagentRuns)]; },\n get contextActions(): WebPluginContributions['contextActions'] { return [via({ id: 'launch-agent' }, actionLaunchAgent)]; },\n get fills(): WebPluginContributions['fills'] { return [via({ slot: 'activity.agents', id: 'agents' }, fillAgents)]; },\n get leaderBindings(): WebPluginContributions['leaderBindings'] { return [via({ id: 'subagents.catalog' }, leaderCatalog), via({ id: 'subagents.fleet' }, leaderFleet)]; },\n get slots(): WebPluginContributions['slots'] { return [via({ slot: 'subagents.run-actions' }, slotRunActions)]; },\n get toolRenderers(): WebPluginContributions['toolRenderers'] { return [via({ tools: ['intercom'] }, toolIntercom), via({ tools: ['subagent'] }, toolSubagent)]; },\n },\n});\n"],"mappings":";;;;;;;AAoDA,MAAa,qBAAqB;AAsClC,MAAa,wBAAwB;;;;AC/ErC,SAAS,WAAW,WAAmB,MAAsB;CAC3D,OAAO,aAAa,kBAAkB,SAAS,GAAG,QAAQ,IAAI;AAChE;AAEA,SAASA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;CAAU,GAAI;AAAiB;AAEzE,MAAa,YAAY,gBAAgB;CACvC,IAAI;CACJ,SAAS;EACP,IAAI,iBAA2D;GAAE,OAAO,CAAC,IAAI,EAAE,MAAM,SAAS,GAAGC,kBAAmB,CAAC;EAAG;EACxH,IAAI,WAA+C;GAAE,OAAO,CAAC,IAAI,EAAE,SAAS,mBAAmB,GAAGC,4BAAsB,GAAG,IAAI,EAAE,SAAS,gBAAgB,GAAGC,yBAAmB,CAAC;EAAG;EACpL,IAAI,iBAA2D;GAAE,OAAO,CAAC,IAAI,EAAE,IAAI,eAAe,GAAGC,wBAAiB,CAAC;EAAG;EAC1H,IAAI,QAAyC;GAAE,OAAO,CAAC,IAAI;IAAE,MAAM;IAAmB,IAAI;GAAS,GAAGC,kCAAU,CAAC;EAAG;EACpH,IAAI,iBAA2D;GAAE,OAAO,CAAC,IAAI,EAAE,IAAI,oBAAoB,GAAGC,mBAAa,GAAG,IAAI,EAAE,IAAI,kBAAkB,GAAGC,iBAAW,CAAC;EAAG;EACxK,IAAI,QAAyC;GAAE,OAAO,CAAC,IAAI,EAAE,MAAM,wBAAwB,GAAGC,uBAAc,CAAC;EAAG;EAChH,IAAI,gBAAyD;GAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,UAAU,EAAE,GAAGC,oBAAY,GAAG,IAAI,EAAE,OAAO,CAAC,UAAU,EAAE,GAAGC,oBAAY,CAAC;EAAG;CAClK;AACF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agimon-ai/doompi-team",
3
- "version": "0.0.1-alpha.92",
3
+ "version": "0.0.1-alpha.94",
4
4
  "description": "Asynchronous named subagents, team runs, intercom, and model policy for Pi coding agents.",
5
5
  "keywords": [
6
6
  "agent-team",
@@ -124,20 +124,20 @@
124
124
  "registry": "https://registry.npmjs.org/"
125
125
  },
126
126
  "dependencies": {
127
- "@agimon-ai/doompi-cache": "0.0.1-alpha.58",
128
- "@agimon-ai/doompi-config": "0.0.1-alpha.91",
129
- "@agimon-ai/doompi-core": "0.0.1-alpha.92",
130
- "@agimon-ai/doompi-session": "0.0.1-alpha.16",
131
- "@agimon-ai/doompi-telemetry": "0.0.1-alpha.83",
132
- "@agimon-ai/doompi-ui": "0.0.1-alpha.92",
133
- "@agimon-ai/doompi-web-components": "0.0.1-alpha.50",
134
- "@agimon-ai/doompi-web-security": "0.0.1-alpha.46",
127
+ "@agimon-ai/doompi-cache": "0.0.1-alpha.60",
128
+ "@agimon-ai/doompi-config": "0.0.1-alpha.93",
129
+ "@agimon-ai/doompi-core": "0.0.1-alpha.94",
130
+ "@agimon-ai/doompi-session": "0.0.1-alpha.18",
131
+ "@agimon-ai/doompi-telemetry": "0.0.1-alpha.85",
132
+ "@agimon-ai/doompi-ui": "0.0.1-alpha.94",
133
+ "@agimon-ai/doompi-web-components": "0.0.1-alpha.52",
134
+ "@agimon-ai/doompi-web-security": "0.0.1-alpha.48",
135
135
  "@deepseek-ai/cordis": "4.0.2",
136
136
  "typebox": "1.3.34",
137
137
  "yaml": "2.9.1"
138
138
  },
139
139
  "devDependencies": {
140
- "@agimon-ai/doompi-build": "0.0.1-alpha.15",
140
+ "@agimon-ai/doompi-build": "0.0.1-alpha.17",
141
141
  "@earendil-works/pi-agent-core": "0.87.1",
142
142
  "@earendil-works/pi-ai": "0.87.1",
143
143
  "@earendil-works/pi-coding-agent": "0.87.1",