{"version":3,"file":"web.mjs","names":["text","fillBrain","dockHelp","fillBrain2","fillHelp","leaderToggle","modeHelp","slotGuides","toolHelpStatus"],"sources":["../../src/types/apiRoutes.ts","../../generated/client.ts","../../src/types/brainGraph.ts","../../src/extensions/workspaces/sessions/(frontend)/fill/_components/brainLayout.ts","../../src/extensions/workspaces/sessions/(frontend)/fill/_components/BrainView.tsx","../../src/extensions/(frontend)/fill/_components/BrainPage.tsx","../../src/extensions/(frontend)/fill/Brain.page.web.tsx","../../src/types/helpGuides.ts","../../src/extensions/workspaces/sessions/(frontend)/dock/_lib/helpGuidesView.ts","../../src/extensions/workspaces/sessions/(frontend)/dock/_components/HelpGuidesPanel.tsx","../../src/extensions/workspaces/sessions/(frontend)/dock/help.web.tsx","../../src/extensions/workspaces/sessions/(frontend)/fill/Brain.activity-promo.web.tsx","../../src/extensions/workspaces/sessions/(frontend)/fill/_lib/helpGuides.ts","../../src/extensions/workspaces/sessions/(frontend)/fill/Help.help.guides.web.ts","../../src/extensions/workspaces/sessions/(frontend)/leader/toggle.web.ts","../../src/extensions/workspaces/sessions/(frontend)/mode/help/mode.web.ts","../../src/extensions/workspaces/sessions/(frontend)/slot/guides.web.ts","../../src/extensions/workspaces/sessions/(frontend)/tool/_lib/helpStatusView.ts","../../src/extensions/workspaces/sessions/(frontend)/tool/_components/HelpStatusCard.tsx","../../src/extensions/workspaces/sessions/(frontend)/tool/help-status.web.tsx","../../generated/web.ts"],"sourcesContent":["import type { ApiResponseOf, ApiRoutes, BrainServicesSnapshot, BrainSlotsSnapshot } from '@agimon-ai/po-core/web';\n\nexport interface BrainSimulationState {\n  enabled: boolean;\n}\n\nexport const routes = {\n  simulation: {\n    method: 'GET',\n    path: '/simulation',\n    response: undefined as unknown as ApiResponseOf<BrainSimulationState>,\n  },\n  setSimulation: {\n    method: 'PUT',\n    path: '/simulation',\n    response: undefined as unknown as ApiResponseOf<BrainSimulationState>,\n  },\n  services: {\n    method: 'GET',\n    path: '/services',\n    response: undefined as unknown as ApiResponseOf<BrainServicesSnapshot>,\n  },\n  slots: { method: 'GET', path: '/slots', response: undefined as unknown as ApiResponseOf<BrainSlotsSnapshot> },\n} as const satisfies ApiRoutes;\n","// Generated by @agimon-ai/po-build. Do not edit by hand.\nimport { createApiClient, sessionApiAddress } from '@agimon-ai/po-core/web';\nimport { browserTransport } from '@agimon-ai/po-web-security/browser';\n\nimport { routes } from '../src/types/apiRoutes';\n\n/** Scopes the tree mounts 'brain' at. */\nexport const apiScopes = ['host', 'workspace', 'session'] as const;\n\nexport const api = createApiClient(routes, {\n  scopes: apiScopes,\n  basePath: 'brain',\n  transport: (input, init) => browserTransport.fetch(input, init),\n  sessionAddress: sessionApiAddress,\n});\n","import type { BrainPackage, BrainServicesSnapshot } from '@agimon-ai/po-core/web';\n\n/**\n * The essential Brain graphs, shared by the web map and the Help-mode `brain` code-mode namespace\n * so both answer the same question the same way. Pure functions over a detached snapshot.\n */\nexport type BrainGraphKind = 'backend' | 'web' | 'native';\n/** public: jade, codemode: blue, plugin: neutral, personal: rose, slot: cyan. */\nexport type BrainNodeRole = 'public' | 'codemode' | 'plugin' | 'personal' | 'slot';\nexport interface BrainNode {\n  id: string;\n  label: string;\n  role: BrainNodeRole;\n  detail: string;\n}\nexport interface BrainLink {\n  source: string;\n  target: string;\n  label: string;\n}\nexport interface BrainGraph {\n  nodes: BrainNode[];\n  links: BrainLink[];\n}\nexport interface BrainNodeView {\n  kind: BrainGraphKind;\n  node: BrainNode;\n  links: { label: string; direction: 'out' | 'in'; node: BrainNode }[];\n}\n/** The shape of HOST_SLOT_METADATA, passed in so this module stays host-neutral. */\nexport type BrainHostSlots = Readonly<Record<string, { readonly slot: string; readonly description: string }>>;\n\nexport const BRAIN_GRAPH_KINDS: readonly BrainGraphKind[] = ['backend', 'web', 'native'];\n\nconst CODEMODE_SERVICE = 'po/codemode';\n// ponytail: a fixed list of scope and host wiring that every plugin injects; it hides the hub\n// that buries real capabilities. Promote to contract metadata if packages need to opt out.\nconst PLUMBING_SERVICES = new Set(['po/server-scope', 'po/server-host', 'po/headless-host', 'po/host-services']);\n\nfunction graphOf(nodes: Map<string, BrainNode>, links: Map<string, BrainLink>): BrainGraph {\n  const linked = new Set([...links.values()].flatMap((link) => [link.source, link.target]));\n  return {\n    nodes: [...nodes.values()].filter((node) => linked.has(node.id)).sort((a, b) => a.id.localeCompare(b.id)),\n    links: [...links.values()].sort((a, b) => `${a.source}\\0${a.target}`.localeCompare(`${b.source}\\0${b.target}`)),\n  };\n}\n\n/**\n * Public services, services a code-mode contributor can call (every service a plugin that injects\n * po/codemode resolves), and the plugins that consume them. Nodes collapse by name across scopes.\n * A nested fiber is an intermediary, so its injections fold into the plugin that owns it; unowned\n * fibers, unresolved injections and scope plumbing are left out.\n */\nexport function backendGraph(snapshot: BrainServicesSnapshot): BrainGraph {\n  const plugins = new Map(\n    snapshot.consumers.flatMap((consumer) =>\n      consumer.owner.kind === 'package' && consumer.owner.packageName\n        ? [[consumer.id, { name: consumer.owner.packageName, origin: consumer.owner.origin }] as const]\n        : [],\n    ),\n  );\n  const services = new Map(snapshot.services.map((service) => [service.id, service]));\n  const uses = snapshot.edges.flatMap((edge) => {\n    const plugin = plugins.get(edge.consumer);\n    const service = edge.service === null ? undefined : services.get(edge.service);\n    return plugin && service && !PLUMBING_SERVICES.has(service.name) ? [{ plugin, service }] : [];\n  });\n  const contributors = new Set(\n    uses.filter((use) => use.service.name === CODEMODE_SERVICE).map((use) => use.plugin.name),\n  );\n  const reachable = new Set(uses.filter((use) => contributors.has(use.plugin.name)).map((use) => use.service.name));\n  const nodes = new Map<string, BrainNode>();\n  const links = new Map<string, BrainLink>();\n  for (const { plugin, service } of uses) {\n    if (!service.public && !reachable.has(service.name)) continue;\n    const serviceId = `service:${service.name}`;\n    const previous = nodes.get(serviceId);\n    if (!previous || (service.description && previous.detail.endsWith('No description.')))\n      nodes.set(serviceId, {\n        id: serviceId,\n        label: service.name,\n        role: reachable.has(service.name) ? 'codemode' : 'public',\n        detail: `${service.public ? 'Public' : 'Private'} service${reachable.has(service.name) ? ', callable from code mode' : ''}. Provided by ${service.owner.packageName ?? service.owner.kind}. ${service.description ?? 'No description.'}`,\n      });\n    const pluginId = `plugin:${plugin.name}`;\n    nodes.set(pluginId, {\n      id: pluginId,\n      label: plugin.name,\n      role: plugin.origin === 'personal' ? 'personal' : 'plugin',\n      detail: `Plugin${contributors.has(plugin.name) ? ' that contributes to code mode' : ''}.`,\n    });\n    links.set(`${pluginId}\\0${serviceId}`, { source: pluginId, target: serviceId, label: 'consumes' });\n  }\n  return graphOf(nodes, links);\n}\n\n/** Each plugin and the slots it fills or declares, for one client host. */\nexport function clientGraph(\n  packages: readonly BrainPackage[],\n  target: 'web' | 'native',\n  hostSlots: BrainHostSlots = {},\n): BrainGraph {\n  const hostDescriptions = new Map(Object.values(hostSlots).map((slot) => [slot.slot, slot.description]));\n  const nodes = new Map<string, BrainNode>();\n  const links = new Map<string, BrainLink>();\n  const slot = (name: string, description?: string) => {\n    const id = `slot:${name}`;\n    if (!nodes.has(id) || description)\n      nodes.set(id, {\n        id,\n        label: name,\n        role: 'slot',\n        detail: `Slot. ${description ?? hostDescriptions.get(name) ?? 'No description.'}`,\n      });\n    return id;\n  };\n  for (const pkg of packages) {\n    const metadata = target === 'web' ? pkg.web : pkg.native;\n    if (!metadata || !pkg.owner.packageName) continue;\n    const pluginId = `plugin:${pkg.owner.packageName}`;\n    nodes.set(pluginId, {\n      id: pluginId,\n      label: pkg.owner.packageName,\n      role: pkg.owner.origin === 'personal' ? 'personal' : 'plugin',\n      detail: `Plugin with a ${target} half.`,\n    });\n    for (const declared of metadata.slots) {\n      const slotId = slot(declared.name, declared.description);\n      links.set(`${pluginId}\\0${slotId}`, { source: pluginId, target: slotId, label: 'declares' });\n    }\n    for (const fill of metadata.fills) {\n      if (fill.slot === null) continue;\n      const slotId = slot(fill.slot);\n      links.set(`${pluginId}\\0${slotId}`, { source: pluginId, target: slotId, label: 'fills' });\n    }\n  }\n  return graphOf(nodes, links);\n}\n\n/** One essential graph. Web prefers the exact browser mount inventory; native reads installed packages. */\nexport function brainGraph(\n  snapshot: BrainServicesSnapshot,\n  kind: BrainGraphKind,\n  hostSlots?: BrainHostSlots,\n): BrainGraph {\n  if (kind === 'backend') return backendGraph(snapshot);\n  return clientGraph(\n    kind === 'web' ? (snapshot.clientPackages ?? snapshot.packages) : snapshot.packages,\n    kind,\n    hostSlots,\n  );\n}\n\n/** A node and its direct connections in one graph, or undefined when the graph lacks it. */\nexport function brainNodeView(graph: BrainGraph, kind: BrainGraphKind, id: string): BrainNodeView | undefined {\n  const byId = new Map(graph.nodes.map((node) => [node.id, node]));\n  const node = byId.get(id);\n  if (!node) return undefined;\n  return {\n    kind,\n    node,\n    links: graph.links.flatMap((link): BrainNodeView['links'] =>\n      link.source === id\n        ? [{ label: link.label, direction: 'out' as const, node: byId.get(link.target)! }]\n        : link.target === id\n          ? [{ label: link.label, direction: 'in' as const, node: byId.get(link.source)! }]\n          : [],\n    ),\n  };\n}\n","import type { BrainLink } from '../../../../../../types/brainGraph';\n\n/** Direct neighbours only, never transitive. */\nexport function brainNeighborhood(selected: string, links: readonly BrainLink[]): Set<string> {\n  const ids = new Set([selected]);\n  for (const link of links) {\n    if (link.source === selected) ids.add(link.target);\n    if (link.target === selected) ids.add(link.source);\n  }\n  return ids;\n}\n\nexport interface BrainPoint {\n  id: string;\n  x: number;\n  y: number;\n  vx: number;\n  vy: number;\n}\n\n// ponytail: pairwise forces cover a few hundred nodes; use a quadtree (Barnes-Hut) before raising this.\nexport const MAX_BRAIN_SIMULATION_NODES = 400;\n\n/** Deterministic golden-angle spiral, so the same graph always starts and settles the same way. */\nexport function brainSeed(ids: readonly string[]): BrainPoint[] {\n  return ids.map((id, index) => {\n    const radius = 12 * Math.sqrt(index + 0.5);\n    const angle = index * 2.399963229728653;\n    return { id, x: Math.cos(angle) * radius, y: Math.sin(angle) * radius, vx: 0, vy: 0 };\n  });\n}\n\n/** One bounded force step: repulsion between all nodes, springs along links, gravity to the origin. */\nexport function brainPhysicsStep(\n  points: readonly BrainPoint[],\n  links: readonly BrainLink[],\n  elapsed: number,\n): BrainPoint[] {\n  if (points.length > MAX_BRAIN_SIMULATION_NODES) throw new Error('Brain simulation node limit exceeded.');\n  const step = Math.max(0, Math.min(elapsed, 32)) / (1000 / 60);\n  const next = points.map((p) => ({ ...p, vx: p.vx * 0.8 ** step, vy: p.vy * 0.8 ** step }));\n  const indices = new Map(points.map((p, i) => [p.id, i]));\n  for (let i = 0; i < points.length; i++) {\n    for (let j = i + 1; j < points.length; j++) {\n      const dx = points[i]!.x - points[j]!.x || (points[i]!.y === points[j]!.y ? 0.5 : 0);\n      const dy = points[i]!.y - points[j]!.y;\n      const distance = Math.max(1, Math.hypot(dx, dy));\n      const force = Math.min(4, 1400 / distance ** 2) * step;\n      next[i]!.vx += (dx / distance) * force;\n      next[i]!.vy += (dy / distance) * force;\n      next[j]!.vx -= (dx / distance) * force;\n      next[j]!.vy -= (dy / distance) * force;\n    }\n  }\n  for (const link of links) {\n    const a = indices.get(link.source);\n    const b = indices.get(link.target);\n    if (a === undefined || b === undefined || a === b) continue;\n    const dx = points[b]!.x - points[a]!.x;\n    const dy = points[b]!.y - points[a]!.y;\n    const distance = Math.max(1, Math.hypot(dx, dy));\n    const force = (distance - 70) * 0.01 * step;\n    next[a]!.vx += (dx / distance) * force;\n    next[a]!.vy += (dy / distance) * force;\n    next[b]!.vx -= (dx / distance) * force;\n    next[b]!.vy -= (dy / distance) * force;\n  }\n  for (const p of next) {\n    p.vx = Math.max(-8, Math.min(8, p.vx - p.x * 0.004 * step));\n    p.vy = Math.max(-8, Math.min(8, p.vy - p.y * 0.004 * step));\n    p.x += p.vx * step;\n    p.y += p.vy * step;\n  }\n  return next;\n}\n\n/** The resting layout, computed up front so a still graph never shows its starting spiral. */\nexport function brainSettle(points: readonly BrainPoint[], links: readonly BrainLink[], steps = 300): BrainPoint[] {\n  let current = [...points];\n  for (let i = 0; i < steps; i++) current = brainPhysicsStep(current, links, 1000 / 60);\n  return current;\n}\n","import { HOST_SLOT_METADATA, type BrainServicesSnapshot } from '@agimon-ai/po-core/web';\nimport { Button } from '@agimon-ai/po-web-components';\nimport { useEffect, useMemo, useRef, useState, type PointerEvent as ReactPointerEvent } from 'react';\n\nimport { brainGraph, type BrainGraphKind, type BrainNodeRole } from '../../../../../../types/brainGraph';\nimport {\n  brainNeighborhood,\n  brainPhysicsStep,\n  brainSeed,\n  brainSettle,\n  MAX_BRAIN_SIMULATION_NODES,\n  type BrainPoint,\n} from './brainLayout';\n\nexport interface BrainViewProps {\n  services: BrainServicesSnapshot;\n  state?: 'populated' | 'loading' | 'empty' | 'error';\n  initialSelection?: string;\n  initialGraph?: BrainGraphKind;\n  simulation?: { enabled: boolean; pending?: boolean; error?: string; onChange(enabled: boolean): void };\n}\n\nconst GRAPHS: { id: BrainGraphKind; label: string }[] = [\n  { id: 'backend', label: 'Backend' },\n  { id: 'web', label: 'Web' },\n  { id: 'native', label: 'Native' },\n];\n\nconst TONE: Record<BrainNodeRole, string> = {\n  public: 'var(--po-green)',\n  codemode: 'var(--po-blue)',\n  plugin: 'var(--po-text)',\n  personal: 'var(--po-magenta)',\n  slot: 'var(--po-cyan)',\n};\n\nconst ROLE_LABEL: Record<BrainNodeRole, string> = {\n  public: 'Public service',\n  codemode: 'Code-mode service',\n  plugin: 'Plugin',\n  personal: 'Your plugin',\n  slot: 'Slot',\n};\n\nconst EMPTY_TEXT: Record<BrainGraphKind, string> = {\n  backend: 'No public or code-mode services are consumed in this scope yet.',\n  web: 'No web slots or fills are published in this scope yet.',\n  native: 'No native slot metadata yet. Packages publish it on their next build.',\n};\n\n/** Hubs keep their names at any zoom, like a map's capitals. */\nconst HUB_LABELS = 12;\nconst PAD = 40;\nconst MIN_VIEW = 420;\n\ninterface ViewBox {\n  x: number;\n  y: number;\n  w: number;\n  h: number;\n}\n\nfunction fit(points: readonly BrainPoint[]): ViewBox {\n  if (points.length === 0) return { x: -100, y: -100, w: 200, h: 200 };\n  const xs = points.map((p) => p.x);\n  const ys = points.map((p) => p.y);\n  // A floor keeps a graph of a few nodes from filling the canvas with giant dots.\n  const w = Math.max(MIN_VIEW, Math.max(...xs) - Math.min(...xs) + PAD * 2);\n  const h = Math.max(MIN_VIEW, Math.max(...ys) - Math.min(...ys) + PAD * 2);\n  return { x: (Math.max(...xs) + Math.min(...xs) - w) / 2, y: (Math.max(...ys) + Math.min(...ys) - h) / 2, w, h };\n}\n\nexport function BrainView({\n  services,\n  state = 'populated',\n  initialSelection,\n  initialGraph = 'backend',\n  simulation,\n}: BrainViewProps) {\n  const [kind, setKind] = useState<BrainGraphKind>(initialGraph);\n  const [selected, select] = useState(initialSelection);\n  const [hovered, hover] = useState<string>();\n  const model = useMemo(() => {\n    const graph = brainGraph(services, kind, HOST_SLOT_METADATA);\n    const degree = new Map<string, number>();\n    for (const link of graph.links)\n      for (const id of [link.source, link.target]) degree.set(id, (degree.get(id) ?? 0) + 1);\n    const hubs = new Set(\n      [...graph.nodes]\n        .sort((a, b) => (degree.get(b.id) ?? 0) - (degree.get(a.id) ?? 0))\n        .slice(0, HUB_LABELS)\n        .map((node) => node.id),\n    );\n    const tooLarge = graph.nodes.length > MAX_BRAIN_SIMULATION_NODES;\n    const seed = brainSeed(graph.nodes.map((node) => node.id));\n    const settled = tooLarge ? seed : brainSettle(seed, graph.links);\n    return { ...graph, degree, hubs, tooLarge, seed, settled, home: fit(settled) };\n  }, [kind, services]);\n\n  const [frame, setFrame] = useState<{ model: typeof model; points: BrainPoint[] }>();\n  const [reducedMotion, setReducedMotion] = useState(false);\n  const enabled = simulation?.enabled === true;\n  useEffect(() => {\n    if (!enabled || state !== 'populated' || model.tooLarge) {\n      setFrame(undefined);\n      return;\n    }\n    const media = window.matchMedia('(prefers-reduced-motion: reduce)');\n    let points = model.seed;\n    let scheduled = 0;\n    let cancelled = false;\n    const advance = () => {\n      if (cancelled) return;\n      points = brainPhysicsStep(points, model.links, 1000 / 60);\n      setFrame({ model, points });\n      if (points.some((p) => Math.abs(p.vx) + Math.abs(p.vy) > 0.02)) scheduled = requestAnimationFrame(advance);\n    };\n    const start = () => {\n      cancelAnimationFrame(scheduled);\n      setReducedMotion(media.matches);\n      if (media.matches) {\n        setFrame(undefined);\n        return;\n      }\n      points = model.seed;\n      scheduled = requestAnimationFrame(advance);\n    };\n    media.addEventListener('change', start);\n    start();\n    return () => {\n      cancelled = true;\n      cancelAnimationFrame(scheduled);\n      media.removeEventListener('change', start);\n    };\n  }, [model, enabled, state]);\n  const points = enabled && frame?.model === model ? frame.points : model.settled;\n  const position = new Map(points.map((p) => [p.id, p]));\n\n  const [view, setView] = useState<{ model: typeof model; box: ViewBox }>();\n  const box = view?.model === model ? view.box : model.home;\n  const svg = useRef<SVGSVGElement>(null);\n  const pan = useRef<{ x: number; y: number; box: ViewBox }>(undefined);\n  const zoomAt = (factor: number, cx = box.x + box.w / 2, cy = box.y + box.h / 2) => {\n    const w = Math.min(model.home.w * 4, Math.max(model.home.w / 12, box.w * factor));\n    const ratio = w / box.w;\n    setView({ model, box: { x: cx - (cx - box.x) * ratio, y: cy - (cy - box.y) * ratio, w, h: box.h * ratio } });\n  };\n  const toWorld = (clientX: number, clientY: number) => {\n    const matrix = svg.current?.getScreenCTM()?.inverse();\n    if (!svg.current || !matrix) return { x: box.x + box.w / 2, y: box.y + box.h / 2 };\n    const point = new DOMPoint(clientX, clientY).matrixTransform(matrix);\n    return { x: point.x, y: point.y };\n  };\n  const hasGraph = state === 'populated' && model.nodes.length > 0;\n  // React registers wheel listeners as passive, so the page would scroll instead of the graph zooming.\n  const wheel = useRef<(event: WheelEvent) => void>(() => {});\n  wheel.current = (event) => {\n    event.preventDefault();\n    const at = toWorld(event.clientX, event.clientY);\n    zoomAt(Math.exp(event.deltaY * 0.0015), at.x, at.y);\n  };\n  useEffect(() => {\n    const element = svg.current;\n    if (!element) return;\n    const listener = (event: WheelEvent) => wheel.current(event);\n    element.addEventListener('wheel', listener, { passive: false });\n    return () => element.removeEventListener('wheel', listener);\n  }, [hasGraph]);\n  const endPan = () => {\n    pan.current = undefined;\n  };\n  const startPan = (event: ReactPointerEvent<SVGSVGElement>) => {\n    event.currentTarget.setPointerCapture(event.pointerId);\n    pan.current = { x: event.clientX, y: event.clientY, box };\n  };\n  const movePan = (event: ReactPointerEvent<SVGSVGElement>) => {\n    const origin = pan.current;\n    const rect = svg.current?.getBoundingClientRect();\n    if (!origin || !rect?.width) return;\n    const scale = Math.max(origin.box.w / rect.width, origin.box.h / rect.height);\n    setView({\n      model,\n      box: {\n        ...origin.box,\n        x: origin.box.x - (event.clientX - origin.x) * scale,\n        y: origin.box.y - (event.clientY - origin.y) * scale,\n      },\n    });\n  };\n\n  const selection = model.nodes.some((node) => node.id === selected) ? selected : undefined;\n  const focus = hovered ?? selection;\n  const neighbors = focus ? brainNeighborhood(focus, model.links) : undefined;\n  const zoom = model.home.w / box.w;\n  const fontSize = box.w * 0.017;\n  const byId = new Map(model.nodes.map((node) => [node.id, node]));\n  const current = selection ? byId.get(selection) : undefined;\n  const connected = current\n    ? model.links\n        .filter((link) => link.source === current.id || link.target === current.id)\n        .map((link) => ({ link, other: byId.get(link.source === current.id ? link.target : link.source)! }))\n        .sort((a, b) => a.other.label.localeCompare(b.other.label))\n    : [];\n\n  return (\n    <section className=\"break-words bg-po-bg p-4 font-sans text-base text-po-text\">\n      <header className=\"mb-4 flex flex-wrap items-center justify-between gap-3\">\n        <div>\n          <h1 className=\"text-2xl font-semibold text-po-hi\">Brain</h1>\n          <p className=\"text-sm text-po-dim\">What this scope can reach, and which plugins lean on it.</p>\n        </div>\n        <div className=\"flex flex-wrap gap-2\">\n          <div className=\"flex gap-1 rounded-lg border border-po-border p-1\" role=\"group\" aria-label=\"Graph\">\n            {GRAPHS.map((graph) => (\n              <Button\n                key={graph.id}\n                size=\"xs\"\n                variant={kind === graph.id ? 'subtle' : 'ghost'}\n                aria-pressed={kind === graph.id}\n                onClick={() => setKind(graph.id)}\n              >\n                {graph.label}\n              </Button>\n            ))}\n          </div>\n          {simulation && (\n            <Button\n              size=\"xs\"\n              variant=\"outline\"\n              aria-label=\"Physics simulation\"\n              aria-pressed={enabled}\n              aria-disabled={simulation.pending || undefined}\n              aria-busy={simulation.pending}\n              className=\"aria-disabled:pointer-events-none aria-disabled:opacity-40\"\n              disabled={state !== 'populated' || (!enabled && model.tooLarge)}\n              onClick={() => {\n                if (!simulation.pending) simulation.onChange(!enabled);\n              }}\n            >\n              Motion {enabled ? 'on' : 'off'}\n            </Button>\n          )}\n        </div>\n      </header>\n      {simulation?.error && (\n        <p role=\"alert\" className=\"mb-3 text-sm text-po-red\">\n          {simulation.error}\n        </p>\n      )}\n      {simulation && (model.tooLarge || (enabled && reducedMotion)) && (\n        <p role=\"status\" className=\"mb-3 text-sm text-po-dim\">\n          {model.tooLarge\n            ? `Layout is paused above ${MAX_BRAIN_SIMULATION_NODES} nodes.`\n            : 'Motion is paused for your reduced-motion preference.'}\n        </p>\n      )}\n      {state !== 'populated' || model.nodes.length === 0 ? (\n        <p role={state === 'error' ? 'alert' : 'status'} className=\"py-12 text-po-text\">\n          {state === 'loading'\n            ? 'Reading the Brain snapshot…'\n            : state === 'error'\n              ? 'The Brain snapshot could not be read. Your session is unchanged.'\n              : EMPTY_TEXT[kind]}\n        </p>\n      ) : (\n        <div className=\"grid grid-cols-1 gap-4 lg:grid-cols-[minmax(0,1fr)_320px]\">\n          <div className=\"relative overflow-hidden rounded-lg border border-po-border bg-po-panel\">\n            {/* Pointer-only canvas. The panel beside it is the complete keyboard equivalent. */}\n            <svg\n              ref={svg}\n              viewBox={`${box.x} ${box.y} ${box.w} ${box.h}`}\n              className=\"block h-[min(70vh,640px)] w-full cursor-grab touch-none select-none active:cursor-grabbing\"\n              aria-hidden=\"true\"\n              onPointerDown={startPan}\n              onPointerMove={movePan}\n              onPointerUp={endPan}\n              onPointerCancel={endPan}\n            >\n              {model.links.map((link) => {\n                const a = position.get(link.source);\n                const b = position.get(link.target);\n                if (!a || !b) return null;\n                const lit = focus !== undefined && (link.source === focus || link.target === focus);\n                return (\n                  <line\n                    key={`${link.source}\\0${link.target}`}\n                    x1={a.x}\n                    y1={a.y}\n                    x2={b.x}\n                    y2={b.y}\n                    stroke={lit ? TONE[byId.get(focus)!.role] : 'var(--po-dim)'}\n                    strokeDasharray={link.label === 'declares' ? '4 3' : undefined}\n                    strokeOpacity={lit ? 0.9 : focus ? 0.06 : 0.22}\n                    strokeWidth={lit ? 1.5 : 1}\n                    vectorEffect=\"non-scaling-stroke\"\n                  />\n                );\n              })}\n              {model.nodes.map((node) => {\n                const p = position.get(node.id)!;\n                const radius = 3 + Math.sqrt(model.degree.get(node.id) ?? 0) * 1.6;\n                const near = neighbors?.has(node.id) ?? true;\n                const label =\n                  node.id === focus || (neighbors?.has(node.id) ?? false) || model.hubs.has(node.id) || zoom >= 2;\n                return (\n                  <g\n                    key={node.id}\n                    className=\"cursor-pointer\"\n                    opacity={near ? 1 : 0.15}\n                    onPointerDown={(event) => event.stopPropagation()}\n                    onPointerEnter={() => hover(node.id)}\n                    onPointerLeave={() => hover(undefined)}\n                    onClick={() => select(node.id)}\n                  >\n                    {node.id === selection && (\n                      <circle\n                        cx={p.x}\n                        cy={p.y}\n                        r={radius + 4}\n                        fill=\"none\"\n                        stroke={TONE[node.role]}\n                        strokeOpacity=\"0.5\"\n                        strokeWidth=\"2\"\n                        vectorEffect=\"non-scaling-stroke\"\n                      />\n                    )}\n                    <circle cx={p.x} cy={p.y} r={radius} fill={TONE[node.role]} />\n                    {label && (\n                      <text\n                        x={p.x}\n                        y={p.y + radius + fontSize * 1.1}\n                        textAnchor=\"middle\"\n                        fontSize={fontSize}\n                        className=\"fill-po-text\"\n                        paintOrder=\"stroke\"\n                        stroke=\"var(--po-panel)\"\n                        strokeWidth={fontSize * 0.25}\n                      >\n                        {node.label}\n                      </text>\n                    )}\n                  </g>\n                );\n              })}\n            </svg>\n            <div className=\"absolute right-2 bottom-2 flex gap-1\">\n              <Button size=\"xs\" variant=\"outline\" aria-label=\"Zoom in\" onClick={() => zoomAt(1 / 1.4)}>\n                +\n              </Button>\n              <Button size=\"xs\" variant=\"outline\" aria-label=\"Zoom out\" onClick={() => zoomAt(1.4)}>\n                −\n              </Button>\n              <Button size=\"xs\" variant=\"outline\" onClick={() => setView(undefined)}>\n                Fit\n              </Button>\n            </div>\n            <p className=\"pointer-events-none absolute top-2 left-3 flex flex-wrap gap-x-3 text-xs text-po-dim\">\n              {(kind === 'backend'\n                ? (['public', 'codemode', 'plugin', 'personal'] as const)\n                : (['slot', 'plugin', 'personal'] as const)\n              ).map((role) => (\n                <span key={role} className=\"flex items-center gap-1\">\n                  <svg viewBox=\"0 0 8 8\" className=\"size-2\" aria-hidden=\"true\">\n                    <circle cx=\"4\" cy=\"4\" r=\"4\" fill={TONE[role]} />\n                  </svg>\n                  {ROLE_LABEL[role]}\n                </span>\n              ))}\n            </p>\n          </div>\n          <aside className=\"flex min-w-0 flex-col gap-3\" aria-label=\"Selection\">\n            {current ? (\n              <div className=\"rounded-lg border border-po-border p-3\">\n                <p className=\"text-sm text-po-dim\">{ROLE_LABEL[current.role]}</p>\n                <h2 className=\"break-all font-mono text-base font-semibold text-po-hi\">{current.label}</h2>\n                <p className=\"mt-1 text-sm\">{current.detail}</p>\n                <h3 className=\"mt-3 text-sm text-po-dim\">Connected ({connected.length})</h3>\n                <ul className=\"mt-1 max-h-72 overflow-y-auto\">\n                  {connected.map(({ link, other }) => (\n                    <li key={other.id}>\n                      <Button\n                        size=\"xs\"\n                        variant=\"ghost\"\n                        className=\"h-auto w-full justify-start whitespace-normal break-all py-1 text-left\"\n                        onClick={() => select(other.id)}\n                      >\n                        <span className=\"font-mono\">{other.label}</span>\n                        <span className=\"text-po-dim\">{link.label}</span>\n                      </Button>\n                    </li>\n                  ))}\n                </ul>\n              </div>\n            ) : (\n              <p className=\"rounded-lg border border-dashed border-po-border p-3 text-sm text-po-dim\">\n                Pick a node to see what it connects to. Scroll to zoom, drag to move around.\n              </p>\n            )}\n            <details className=\"rounded-lg border border-po-border p-3\">\n              <summary className=\"cursor-pointer text-sm text-po-dim\">All nodes ({model.nodes.length})</summary>\n              <ul className=\"mt-2 max-h-72 overflow-y-auto\">\n                {model.nodes.map((node) => (\n                  <li key={node.id}>\n                    <Button\n                      size=\"xs\"\n                      variant=\"ghost\"\n                      aria-pressed={selection === node.id}\n                      className=\"h-auto w-full justify-start whitespace-normal break-all py-1 text-left font-mono\"\n                      onClick={() => select(node.id)}\n                    >\n                      {node.label}\n                    </Button>\n                  </li>\n                ))}\n              </ul>\n            </details>\n            {kind === 'backend' && services.diagnostics.length > 0 && (\n              <details className=\"rounded-lg border border-po-border p-3\">\n                <summary className=\"cursor-pointer text-sm text-po-dim\">\n                  Coverage notes ({services.diagnostics.length})\n                </summary>\n                {services.diagnostics.map((diagnostic) => (\n                  <p key={diagnostic} className=\"mt-2 text-sm text-po-dim\">\n                    {diagnostic}\n                  </p>\n                ))}\n              </details>\n            )}\n          </aside>\n        </div>\n      )}\n    </section>\n  );\n}\n","import type { BrainServicesSnapshot, WebPluginSlotProps } from '@agimon-ai/po-core/web';\nimport { Button } from '@agimon-ai/po-web-components';\nimport { useEffect, useMemo, useRef, useState } from 'react';\n\nimport { api } from '../../../../../generated/client';\nimport { BrainView } from '../../../workspaces/sessions/(frontend)/fill/_components/BrainView';\n\nconst pendingScope = { id: 'pending', level: 'host' } as const;\nconst emptyServices: BrainServicesSnapshot = {\n  scope: pendingScope,\n  scopes: [],\n  packages: [],\n  services: [],\n  consumers: [],\n  edges: [],\n  diagnostics: [],\n};\n\ntype Snapshot = {\n  target: string;\n  services: BrainServicesSnapshot;\n  state: 'populated' | 'loading' | 'empty' | 'error';\n};\n\ntype SimulationSnapshot = { target: string; enabled?: boolean; pending: boolean; error?: string };\nexport function BrainPage({ sessionId, workspaceId }: Pick<WebPluginSlotProps, 'sessionId' | 'workspaceId'>) {\n  const target = sessionId ? `session:${sessionId}` : workspaceId ? `workspace:${workspaceId}` : 'host';\n  const scoped = Boolean(sessionId || workspaceId);\n  const client = useMemo(\n    () => (sessionId ? api.session(sessionId) : workspaceId ? api.workspace(workspaceId) : api.host),\n    [sessionId, workspaceId],\n  );\n  const [revision, refresh] = useState(0);\n  const [snapshot, setSnapshot] = useState<Snapshot>();\n  const [simulation, setSimulation] = useState<SimulationSnapshot>();\n  const lifetime = useRef<AbortController | undefined>(undefined);\n  useEffect(() => {\n    const controller = new AbortController();\n    lifetime.current = controller;\n    if (scoped) {\n      setSimulation({ target, pending: true });\n      void client\n        .simulation({ signal: controller.signal })\n        .then((result) => {\n          if (controller.signal.aborted) return;\n          if (!result.ok || typeof result.data?.enabled !== 'boolean') throw new Error('Simulation unavailable.');\n          setSimulation({ target, enabled: result.data.enabled, pending: false });\n        })\n        .catch(() => {\n          if (!controller.signal.aborted)\n            setSimulation({ target, pending: false, error: 'Simulation could not be read. Refresh to try again.' });\n        });\n    } else setSimulation(undefined);\n    setSnapshot((previous) => (previous?.target === target ? { ...previous, state: 'loading' } : undefined));\n    void client\n      .services({ signal: controller.signal })\n      .then((services) => {\n        if (!services.ok) throw new Error('Brain snapshot unavailable.');\n        if (controller.signal.aborted) return;\n        setSnapshot({\n          target,\n          services: services.data,\n          state:\n            services.data.services.length + services.data.consumers.length + services.data.packages.length\n              ? 'populated'\n              : 'empty',\n        });\n      })\n      .catch(() => {\n        if (!controller.signal.aborted) setSnapshot({ target, services: emptyServices, state: 'error' });\n      });\n    return () => {\n      controller.abort();\n      if (lifetime.current === controller) lifetime.current = undefined;\n    };\n  }, [client, scoped, target, revision]);\n  const current = snapshot?.target === target ? snapshot : undefined;\n  const state = current?.state ?? 'loading';\n  const currentSimulation = simulation?.target === target ? simulation : undefined;\n  async function changeSimulation(enabled: boolean) {\n    const controller = lifetime.current;\n    if (\n      !scoped ||\n      !controller ||\n      controller.signal.aborted ||\n      !currentSimulation ||\n      currentSimulation.enabled === undefined ||\n      currentSimulation.pending\n    )\n      return;\n    setSimulation({ ...currentSimulation, pending: true, error: undefined });\n    try {\n      const result = await client.setSimulation({ body: { enabled }, signal: controller.signal });\n      if (controller.signal.aborted) return;\n      if (!result.ok || typeof result.data?.enabled !== 'boolean') throw new Error('Simulation unavailable.');\n      setSimulation({ target, enabled: result.data.enabled, pending: false });\n    } catch {\n      if (!controller.signal.aborted)\n        setSimulation({\n          ...currentSimulation,\n          pending: false,\n          error: 'Simulation could not be changed. Your graph is unchanged.',\n        });\n    }\n  }\n  return (\n    <div>\n      <div className=\"flex items-center justify-between gap-3 bg-po-bg px-4 pt-4\">\n        <p className=\"text-sm text-po-dim\">{sessionId ? 'Session' : workspaceId ? 'Workspace' : 'Global'} snapshot</p>\n        <Button\n          size=\"xs\"\n          variant=\"outline\"\n          disabled={state === 'loading' || currentSimulation?.pending}\n          onClick={() => refresh((value) => value + 1)}\n        >\n          Refresh\n        </Button>\n      </div>\n      <BrainView\n        key={target}\n        services={current?.services ?? emptyServices}\n        state={state}\n        simulation={\n          scoped\n            ? {\n                enabled: currentSimulation?.enabled ?? false,\n                pending: currentSimulation?.pending !== false || currentSimulation.enabled === undefined,\n                error: currentSimulation?.error,\n                onChange: changeSimulation,\n              }\n            : undefined\n        }\n      />\n    </div>\n  );\n}\n","import { defineFill } from '@agimon-ai/po-core/web';\n\nimport { BrainPage } from './_components/BrainPage';\n\nexport default defineFill({ slot: 'page', id: 'brain', component: BrainPage });\n","import type { SlotDeclaration } from '@agimon-ai/po-core/web';\n\nexport interface HelpGuide {\n  id: string;\n  question: string;\n  // ponytail: v1 answers are plain text; add shared Markdown rendering only when a guide needs rich content.\n  answer: string;\n  keywords?: string[];\n  order?: number;\n}\n\nexport interface HelpGuideSet {\n  version: 1;\n  label: string;\n  guides: HelpGuide[];\n}\n\nconst record = (value: unknown): value is Record<string, unknown> =>\n  typeof value === 'object' && value !== null && !Array.isArray(value);\n\nconst text = (value: unknown, limit: number): string | null => {\n  if (typeof value !== 'string') return null;\n  const trimmed = value.trim();\n  return trimmed.length > 0 && trimmed.length <= limit ? trimmed : null;\n};\n\n/** Reject the whole fill so the registry can identify the faulty contributor. */\nexport function parseHelpGuideSet(input: unknown): HelpGuideSet | null {\n  if (!record(input) || input.version !== 1) return null;\n  const label = text(input.label, 80);\n  if (!label || !Array.isArray(input.guides) || input.guides.length > 64) return null;\n  const guides: HelpGuide[] = [];\n  const ids = new Set<string>();\n  for (const raw of input.guides) {\n    if (!record(raw)) return null;\n    const id = text(raw.id, 80);\n    const question = text(raw.question, 240);\n    const answer = text(raw.answer, 4000);\n    if (!id || !question || !answer || ids.has(id)) return null;\n    if (raw.order !== undefined && (typeof raw.order !== 'number' || !Number.isFinite(raw.order))) return null;\n    let keywords: string[] | undefined;\n    if (raw.keywords !== undefined) {\n      if (!Array.isArray(raw.keywords) || raw.keywords.length > 16) return null;\n      keywords = [];\n      for (const keyword of raw.keywords) {\n        const parsed = text(keyword, 64);\n        if (!parsed) return null;\n        keywords.push(parsed);\n      }\n    }\n    ids.add(id);\n    guides.push({\n      id,\n      question,\n      answer,\n      ...(keywords === undefined ? {} : { keywords }),\n      ...(raw.order === undefined ? {} : { order: raw.order as number }),\n    });\n  }\n  return { version: 1, label, guides };\n}\n\nexport const helpGuidesSlot: SlotDeclaration<HelpGuideSet> = {\n  slot: 'help.guides',\n  description: 'Contribute a labelled set of searchable plain-text questions and answers to the Help panel.',\n  parse: parseHelpGuideSet,\n};\n","import type { SlotDataFill } from '@agimon-ai/po-core/web';\n\nimport type { HelpGuideSet } from '../../../../../../types/helpGuides';\n\n/** Preserve registry group order; sort and filter guides without mutating contributions. */\nexport function helpGuidesView(fills: readonly SlotDataFill<HelpGuideSet>[], query: string) {\n  const tokens = query.toLowerCase().trim().split(/\\s+/).filter(Boolean);\n  return fills.flatMap((fill) => {\n    const guides = fill.data.guides\n      .filter((guide) => {\n        const searchable = [fill.data.label, guide.question, guide.answer, ...(guide.keywords ?? [])]\n          .join(' ')\n          .toLowerCase();\n        return tokens.every((token) => searchable.includes(token));\n      })\n      .sort((a, b) => (a.order ?? 0) - (b.order ?? 0) || a.question.localeCompare(b.question));\n    return guides.length ? [{ ...fill, data: { ...fill.data, guides } }] : [];\n  });\n}\n","import type { SlotDataFill, WebPluginSlotProps } from '@agimon-ai/po-core/web';\nimport {\n  Accordion,\n  AccordionContent,\n  AccordionItem,\n  AccordionTrigger,\n  EmptyState,\n  Input,\n} from '@agimon-ai/po-web-components';\nimport { useState } from 'react';\n\nimport { helpGuidesSlot, type HelpGuideSet } from '../../../../../../types/helpGuides';\nimport { helpGuidesView } from '../_lib/helpGuidesView';\n\nexport function HelpGuidesFace(props: WebPluginSlotProps) {\n  return <HelpGuidesPanel key={props.sessionId} fills={props.slotData(helpGuidesSlot)} />;\n}\n\nexport function HelpGuidesPanel({\n  fills,\n  initialQuery = '',\n  initialExpanded,\n}: {\n  fills: readonly SlotDataFill<HelpGuideSet>[];\n  initialQuery?: string;\n  initialExpanded?: readonly [string, string, string];\n}) {\n  const [query, setQuery] = useState(initialQuery);\n  const groups = helpGuidesView(fills, query);\n  const hasGuides = fills.some((fill) => fill.data.guides.length);\n  return (\n    <div className=\"flex h-full min-h-0 w-full flex-col bg-po-rail text-po-text font-sans\">\n      <div className=\"border-b border-po-border-soft p-3\">\n        <Input\n          aria-label=\"Search help\"\n          placeholder=\"Search help\"\n          type=\"search\"\n          value={query}\n          onChange={(event) => setQuery(event.target.value)}\n          className=\"w-full placeholder:text-po-dim\"\n        />\n      </div>\n      <div className=\"min-h-0 flex-1 overflow-y-auto p-3\">\n        {groups.length === 0 ? (\n          <EmptyState\n            title={hasGuides ? 'No matching guides' : 'No help guides yet'}\n            description={\n              hasGuides\n                ? 'Try a different word or a package name.'\n                : 'Guides from this session’s plugins will appear here.'\n            }\n          />\n        ) : (\n          <div className=\"flex flex-col gap-5\">\n            {groups.map((group) => (\n              <section key={JSON.stringify([group.pluginId, group.id])}>\n                <h2 className=\"mb-1 text-lg font-semibold text-po-hi break-words\">{group.data.label}</h2>\n                <Accordion\n                  type=\"single\"\n                  collapsible\n                  defaultValue={\n                    initialExpanded?.[0] === group.pluginId && initialExpanded[1] === group.id\n                      ? initialExpanded[2]\n                      : undefined\n                  }\n                >\n                  {group.data.guides.map((guide) => (\n                    <AccordionItem key={guide.id} value={guide.id}>\n                      <AccordionTrigger className=\"text-base font-medium leading-relaxed break-words\">\n                        {guide.question}\n                      </AccordionTrigger>\n                      <AccordionContent className=\"whitespace-pre-wrap break-words text-base leading-relaxed text-po-text\">\n                        {guide.answer}\n                      </AccordionContent>\n                    </AccordionItem>\n                  ))}\n                </Accordion>\n              </section>\n            ))}\n          </div>\n        )}\n      </div>\n    </div>\n  );\n}\n","import { defineDockFace } from '@agimon-ai/po-core/web';\nimport { HelpIcon } from '@agimon-ai/po-web-components';\n\nimport { HelpGuidesFace } from './_components/HelpGuidesPanel';\n\nexport default defineDockFace({\n  id: 'help',\n  label: 'Help',\n  icon: HelpIcon,\n  order: 50,\n  requiredMode: 'help',\n  panel: HelpGuidesFace,\n});\n","import { defineFill, type WebPluginSlotProps } from '@agimon-ai/po-core/web';\nimport { Button } from '@agimon-ai/po-web-components';\n\nimport { BrainPage } from '../../../../(frontend)/fill/_components/BrainPage';\n\nfunction ExploreBrain({ openTransientTab }: WebPluginSlotProps) {\n  return (\n    <Button\n      variant=\"outline\"\n      size=\"xs\"\n      data-testid=\"activity-explore-brain\"\n      onClick={() => openTransientTab({ id: 'help-brain-map', label: 'Brain', panel: BrainPage })}\n    >\n      Explore\n    </Button>\n  );\n}\n\nexport default defineFill({ slot: 'activity-promo', id: 'brain-explore', component: ExploreBrain });\n","/** README-grounded starter guidance shared by the web and native fills. */\nexport const helpGuides = {\n  version: 1,\n  label: 'Help',\n  guides: [\n    {\n      id: 'about',\n      question: 'What does Help mode do?',\n      order: 0,\n      answer:\n        'Help adds package guidance and read-only diagnostics for your setup. It does not change configuration or grant extra permissions.',\n      keywords: ['setup', 'diagnostics'],\n    },\n    {\n      id: 'toggle',\n      question: 'How do I turn Help on or off?',\n      order: 1,\n      answer:\n        'Use the mode menu, or send /mode help. Help is additive: other tools and modes keep their existing rules.',\n    },\n  ],\n} satisfies {\n  version: 1;\n  label: string;\n  guides: { id: string; question: string; answer: string; keywords?: string[]; order?: number }[];\n};\n","import { defineFill } from '@agimon-ai/po-core/web';\n\nimport { helpGuides } from './_lib/helpGuides';\n\nexport default defineFill({\n  slot: 'help.guides',\n  id: 'Help',\n  order: 0,\n  data: helpGuides,\n});\n","import { defineLeaderBinding } from '@agimon-ai/po-core/web';\n\nexport default defineLeaderBinding({\n  path: [\n    { key: 'h', label: 'help', detail: 'package docs and logs' },\n    { key: 'e', label: 'toggle', detail: 'load or hide package Help' },\n  ],\n  command: 'mode help',\n});\n","import { defineModeFile } from '@agimon-ai/po-core/web';\nimport { HelpIcon } from '@agimon-ai/po-web-components';\n\nexport default defineModeFile({ keys: 'h e', icon: HelpIcon, order: 10 });\n","import { defineSlotFile } from '@agimon-ai/po-core/web';\n\nimport { helpGuidesSlot } from '../../../../../types/helpGuides';\n\nexport default defineSlotFile(helpGuidesSlot);\n","/**\n * The help_status and diagnose_setup reports as the card's view models. Both\n * tools return their report as JSON text; a field that is missing or\n * malformed is left out, and output that does not parse keeps its raw lines.\n */\n\n/** How many lines of unparsed output the card shows before \"N more lines\", as the web card does. */\nexport const HELP_PREVIEW_LINES = 12;\n\n/** How many names a capability list shows on expand before \"and N more\". */\nexport const HELP_LIST_LIMIT = 10;\n\nexport type HelpActivation = 'inactive' | 'activating' | 'active' | 'degraded';\n\nexport interface HelpCapabilityRow {\n  name: string;\n  source?: string;\n  active: boolean;\n  reason?: string;\n}\n\nexport interface HelpDiagnosticRow {\n  code: string;\n  source?: string;\n}\n\nexport interface HelpPackageFailureRow {\n  packageName: string;\n  scope?: string;\n  stage?: string;\n  reason?: string;\n  previous?: string;\n}\n\nexport interface HelpStatusView {\n  kind: 'status';\n  activation: HelpActivation;\n  /** Null while the session is still resolving its skills. */\n  skillCount: number | null;\n  toolCount?: number;\n  skills: HelpCapabilityRow[];\n  tools: HelpCapabilityRow[];\n  diagnostics: HelpDiagnosticRow[];\n  packages: HelpPackageFailureRow[];\n  truncated: boolean;\n}\n\nexport interface SetupCheckRow {\n  area: string;\n  passed: boolean;\n  problemCount?: number;\n  guidance?: string;\n}\n\nexport interface SetupReportView {\n  kind: 'setup';\n  passed: boolean;\n  preset?: string;\n  domains: string[];\n  profile?: string;\n  checks: SetupCheckRow[];\n  skipped: string[];\n  limitations?: string;\n}\n\nexport interface HelpTextView {\n  kind: 'text';\n  lines: string[];\n}\n\nexport type HelpToolView = HelpStatusView | SetupReportView | HelpTextView;\n\nexport interface HelpFigure {\n  label: string;\n  value: string;\n  tone: 'text' | 'warning' | 'error';\n}\n\nconst ACTIVATIONS: ReadonlySet<string> = new Set(['inactive', 'activating', 'active', 'degraded']);\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n  typeof value === 'object' && value !== null && !Array.isArray(value);\n\nconst count = (value: unknown): number | undefined =>\n  typeof value === 'number' && Number.isInteger(value) && value >= 0 ? value : undefined;\n\nconst text = (value: unknown): string | undefined =>\n  typeof value === 'string' && value.trim() !== '' ? value.trim() : undefined;\n\nconst records = (value: unknown): Record<string, unknown>[] => (Array.isArray(value) ? value.filter(isRecord) : []);\n\n/** The tool's output as lines, blank lines dropped, as the web card shows them. */\nexport function helpOutputLines(output: string): string[] {\n  return output.split('\\n').filter((line) => line.trim() !== '');\n}\n\nfunction capabilities(value: unknown): HelpCapabilityRow[] {\n  return records(value).flatMap((raw) => {\n    const name = text(raw.name);\n    if (name === undefined) return [];\n    const source = text(raw.source);\n    const reason = text(raw.reason);\n    return [{ name, active: raw.active === true, ...(source ? { source } : {}), ...(reason ? { reason } : {}) }];\n  });\n}\n\nfunction parseStatus(raw: Record<string, unknown>): HelpStatusView | null {\n  const activation = text(raw.activation);\n  if (activation === undefined || !ACTIVATIONS.has(activation)) return null;\n  const counts = isRecord(raw.counts) ? raw.counts : {};\n  const toolCount = count(counts.tools);\n  return {\n    kind: 'status',\n    activation: activation as HelpActivation,\n    skillCount: count(counts.skills) ?? null,\n    ...(toolCount === undefined ? {} : { toolCount }),\n    skills: capabilities(raw.skills),\n    tools: capabilities(raw.tools),\n    diagnostics: records(raw.diagnostics).flatMap((entry) => {\n      const code = text(entry.code);\n      if (code === undefined) return [];\n      const source = text(entry.source);\n      return [{ code, ...(source ? { source } : {}) }];\n    }),\n    packages: records(raw.packages).flatMap((entry) => {\n      const packageName = text(entry.packageName);\n      if (packageName === undefined) return [];\n      const fields = { scope: text(entry.scope), stage: text(entry.stage), reason: text(entry.reason) };\n      const previous = text(entry.previous);\n      return [\n        {\n          packageName,\n          ...Object.fromEntries(Object.entries(fields).filter(([, value]) => value !== undefined)),\n          ...(previous && previous !== 'none' ? { previous } : {}),\n        },\n      ];\n    }),\n    truncated: raw.truncated === true,\n  };\n}\n\nfunction parseSetup(raw: Record<string, unknown>): SetupReportView | null {\n  const status = text(raw.status);\n  if (status !== 'checks-passed' && status !== 'issues-found') return null;\n  const selection = isRecord(raw.appliedSelection) ? raw.appliedSelection : {};\n  const preset = text(selection.preset);\n  const profile = text(selection.profile);\n  const limitations = text(raw.limitations);\n  return {\n    kind: 'setup',\n    passed: status === 'checks-passed',\n    ...(preset ? { preset } : {}),\n    domains: Array.isArray(selection.domains) ? selection.domains.flatMap((value) => text(value) ?? []) : [],\n    ...(profile ? { profile } : {}),\n    checks: records(raw.checks).flatMap((entry) => {\n      const area = text(entry.area);\n      if (area === undefined) return [];\n      const problemCount = count(entry.problemCount);\n      const guidance = text(entry.guidance);\n      return [\n        {\n          area,\n          passed: entry.status === 'passed',\n          ...(problemCount === undefined ? {} : { problemCount }),\n          ...(guidance ? { guidance } : {}),\n        },\n      ];\n    }),\n    skipped: Array.isArray(raw.skipped) ? raw.skipped.flatMap((value) => text(value) ?? []) : [],\n    ...(limitations ? { limitations } : {}),\n  };\n}\n\n/** The report a help diagnostic tool returned, or its raw lines when the output is not a report. */\nexport function helpToolView(output: string): HelpToolView {\n  let parsed: unknown;\n  try {\n    parsed = JSON.parse(output);\n  } catch {\n    return { kind: 'text', lines: helpOutputLines(output) };\n  }\n  if (isRecord(parsed)) {\n    const view = parseStatus(parsed) ?? parseSetup(parsed);\n    if (view !== null) return view;\n  }\n  return { kind: 'text', lines: helpOutputLines(output) };\n}\n\nconst plural = (n: number, word: string) => `${String(n)} ${word}${n === 1 ? '' : 's'}`;\n\n/** The header's primary piece: what the report concluded. */\nexport function helpHeadline(view: HelpStatusView | SetupReportView): string {\n  if (view.kind === 'setup') {\n    if (view.passed) return 'Checks passed';\n    const failed = view.checks.filter((check) => !check.passed).length;\n    return failed > 0 ? `${plural(failed, 'area')} failed` : 'Issues found';\n  }\n  const label: Record<HelpActivation, string> = {\n    inactive: 'Help off',\n    activating: 'Help activating',\n    active: 'Help active',\n    degraded: 'Help degraded',\n  };\n  return label[view.activation];\n}\n\n/** The key figures shown while the card is collapsed. */\nexport function helpFigures(view: HelpStatusView | SetupReportView): HelpFigure[] {\n  if (view.kind === 'setup') {\n    const failed = view.checks.filter((check) => !check.passed).length;\n    return [\n      {\n        label: 'Checks passed',\n        value: `${String(view.checks.length - failed)}/${String(view.checks.length)}`,\n        tone: 'text',\n      },\n      { label: 'Failed', value: String(failed), tone: failed > 0 ? 'error' : 'text' },\n      ...(view.skipped.length > 0\n        ? [{ label: 'Skipped', value: String(view.skipped.length), tone: 'warning' as const }]\n        : []),\n    ];\n  }\n  if (view.activation === 'inactive') return [];\n  return [\n    { label: 'Skills', value: view.skillCount === null ? 'pending' : String(view.skillCount), tone: 'text' },\n    ...(view.toolCount === undefined ? [] : [{ label: 'Tools', value: String(view.toolCount), tone: 'text' as const }]),\n    ...(view.diagnostics.length > 0\n      ? [{ label: 'Diagnostics', value: String(view.diagnostics.length), tone: 'warning' as const }]\n      : []),\n    ...(view.packages.length > 0\n      ? [{ label: 'Failed packages', value: String(view.packages.length), tone: 'error' as const }]\n      : []),\n  ];\n}\n\n/** A quiet sentence for the states that have no figures to explain themselves. */\nexport function helpStateNote(view: HelpStatusView): string | undefined {\n  if (view.activation === 'inactive') return 'Help mode is off in this session.';\n  if (view.activation === 'activating') return 'Skills are counted once the session is ready.';\n  return undefined;\n}\n\n/** Whether the card has detail to show on expand. */\nexport function helpHasDetail(view: HelpStatusView | SetupReportView): boolean {\n  if (view.kind === 'setup') return view.checks.length > 0 || view.skipped.length > 0 || view.limitations !== undefined;\n  return (\n    view.skills.length > 0 ||\n    view.tools.length > 0 ||\n    view.diagnostics.length > 0 ||\n    view.packages.length > 0 ||\n    view.truncated\n  );\n}\n","import type { ToolMessageRenderProps } from '@agimon-ai/po-core/web';\nimport {\n  Badge,\n  CheckIcon,\n  collapseLines,\n  MessageItem,\n  MessageItemBody,\n  MessageItemHeader,\n  MessageItemStatus,\n  MessageLines,\n  SectionLabel,\n  toolTone,\n} from '@agimon-ai/po-web-components';\n\nimport {\n  HELP_LIST_LIMIT,\n  HELP_PREVIEW_LINES,\n  type HelpCapabilityRow,\n  type HelpFigure,\n  helpFigures,\n  helpHasDetail,\n  helpHeadline,\n  helpOutputLines,\n  helpStateNote,\n  type HelpStatusView,\n  helpToolView,\n  type SetupReportView,\n} from '../_lib/helpStatusView';\n\n/** The summary kept while there is no report to summarise. */\nconst DEFAULT_SUMMARY = 'Help diagnostics';\n\nconst FIGURE_TONE: Record<HelpFigure['tone'], string> = {\n  text: 'truncate text-lg font-semibold tabular-nums text-po-hi',\n  warning: 'truncate text-lg font-semibold tabular-nums text-po-yellow',\n  error: 'truncate text-lg font-semibold tabular-nums text-po-red',\n};\n\n/**\n * The help_status and diagnose_setup timeline item. The report is laid out\n * from the shared view model the native card uses: the outcome in the\n * header, key figures in the body, and the lists on expand. Output that does\n * not parse keeps its raw lines. A failed call shows only its reason in red;\n * the header carries the failure.\n */\nexport function HelpStatusCard({ toolName, output, running, isError }: ToolMessageRenderProps) {\n  const tone = toolTone({ running, isError });\n  const view = running || isError ? null : helpToolView(output);\n  if (view !== null && view.kind !== 'text') return <ReportCard toolName={toolName} tone={tone} view={view} />;\n  const lines = view?.lines ?? helpOutputLines(output);\n  if (isError) {\n    return (\n      <MessageItem tone={tone}>\n        <MessageItemHeader title={toolName}>\n          <span className=\"min-w-0 truncate text-po-faint\">{DEFAULT_SUMMARY}</span>\n        </MessageItemHeader>\n        {lines.length > 0 ? (\n          <MessageItemBody>\n            <p className=\"whitespace-pre-wrap break-words text-po-red\">{lines.join('\\n')}</p>\n          </MessageItemBody>\n        ) : null}\n      </MessageItem>\n    );\n  }\n  const rows = lines.map((line) => ({ text: line, tone: 'text' as const }));\n  return (\n    <MessageItem tone={tone} expandable={rows.length > HELP_PREVIEW_LINES}>\n      {({ expanded }) => {\n        const shown = collapseLines(rows, HELP_PREVIEW_LINES, expanded);\n        return (\n          <>\n            <MessageItemHeader title={toolName}>\n              <span className=\"min-w-0 truncate text-po-faint\">{DEFAULT_SUMMARY}</span>\n            </MessageItemHeader>\n            {shown.shown.length > 0 || running ? (\n              <MessageItemBody>\n                <MessageLines lines={shown.shown} />\n                {shown.hidden > 0 ? <MessageItemStatus expands>{shown.hidden} more lines</MessageItemStatus> : null}\n                {running ? <MessageItemStatus tone=\"running\">Inspecting this session</MessageItemStatus> : null}\n              </MessageItemBody>\n            ) : null}\n          </>\n        );\n      }}\n    </MessageItem>\n  );\n}\n\nfunction ReportCard({\n  toolName,\n  tone,\n  view,\n}: {\n  toolName: string;\n  tone: ReturnType<typeof toolTone>;\n  view: HelpStatusView | SetupReportView;\n}) {\n  const figures = helpFigures(view);\n  const note = view.kind === 'status' ? helpStateNote(view) : undefined;\n  return (\n    <MessageItem tone={tone} expandable={helpHasDetail(view)}>\n      {({ expanded }) => (\n        <>\n          <MessageItemHeader title={toolName}>\n            <span data-testid={`tool-call-${toolName}`} className=\"max-w-[70%] shrink-0 truncate text-po-text\">\n              {helpHeadline(view)}\n            </span>\n          </MessageItemHeader>\n          <MessageItemBody data-testid={`tool-result-${toolName}`} className=\"flex flex-col gap-4\">\n            {note !== undefined ? <p className=\"text-sm text-po-dim\">{note}</p> : null}\n            {figures.length > 0 ? (\n              <dl className=\"grid grid-cols-2 gap-3 sm:grid-cols-4\">\n                {figures.map((figure) => (\n                  <div key={figure.label} className=\"flex min-w-0 flex-col gap-0.5\">\n                    <dt className=\"truncate text-sm text-po-dim\">{figure.label}</dt>\n                    <dd className={FIGURE_TONE[figure.tone]}>{figure.value}</dd>\n                  </div>\n                ))}\n              </dl>\n            ) : null}\n            {expanded ? view.kind === 'status' ? <StatusDetail view={view} /> : <SetupDetail view={view} /> : null}\n          </MessageItemBody>\n        </>\n      )}\n    </MessageItem>\n  );\n}\n\nfunction StatusDetail({ view }: { view: HelpStatusView }) {\n  return (\n    <>\n      {view.packages.length > 0 ? (\n        <section className=\"flex flex-col gap-2\">\n          <SectionLabel>Failed packages</SectionLabel>\n          {view.packages.map((entry, index) => (\n            <div key={`${entry.packageName}-${String(index)}`} className=\"flex min-w-0 flex-col gap-0.5\">\n              <div className=\"flex min-w-0 items-baseline gap-2\">\n                <span className=\"min-w-0 shrink truncate font-mono text-sm text-po-text\">{entry.packageName}</span>\n                {entry.stage !== undefined ? (\n                  <span className=\"min-w-0 flex-1 truncate text-right text-sm text-po-faint\">\n                    {entry.stage}\n                    {entry.scope !== undefined ? ` · ${entry.scope}` : ''}\n                  </span>\n                ) : null}\n              </div>\n              {entry.reason !== undefined ? <p className=\"break-words text-sm text-po-red\">{entry.reason}</p> : null}\n              {entry.previous !== undefined ? (\n                <p className=\"text-sm text-po-faint\">Previous build {entry.previous}</p>\n              ) : null}\n            </div>\n          ))}\n        </section>\n      ) : null}\n      {view.diagnostics.length > 0 ? (\n        <section className=\"flex flex-col gap-2\">\n          <SectionLabel>Diagnostics</SectionLabel>\n          {view.diagnostics.map((entry, index) => (\n            <div key={`${entry.code}-${String(index)}`} className=\"flex min-w-0 items-center gap-2\">\n              <Badge tone=\"yellow\" size=\"xs\" className=\"shrink-0 font-mono\">\n                {entry.code}\n              </Badge>\n              {entry.source !== undefined ? (\n                <span className=\"min-w-0 flex-1 truncate text-right font-mono text-sm text-po-dim\">{entry.source}</span>\n              ) : null}\n            </div>\n          ))}\n        </section>\n      ) : null}\n      <CapabilityList label=\"Skills\" rows={view.skills} />\n      <CapabilityList label=\"Tools\" rows={view.tools} />\n      {view.truncated ? <p className=\"text-sm text-po-faint\">The tool capped its lists; more exist.</p> : null}\n    </>\n  );\n}\n\nfunction CapabilityList({ label, rows }: { label: string; rows: HelpCapabilityRow[] }) {\n  if (rows.length === 0) return null;\n  const shown = rows.slice(0, HELP_LIST_LIMIT);\n  return (\n    <section className=\"flex flex-col gap-2\">\n      <SectionLabel>{label}</SectionLabel>\n      <ul className=\"grid grid-cols-1 gap-x-6 gap-y-1 sm:grid-cols-2\">\n        {shown.map((row, index) => (\n          <li key={`${row.name}-${String(index)}`} className=\"flex min-w-0 items-center gap-2\">\n            <span\n              className={\n                row.active\n                  ? 'min-w-0 shrink truncate font-mono text-sm text-po-text'\n                  : 'min-w-0 shrink truncate font-mono text-sm text-po-dim'\n              }\n            >\n              {row.name}\n            </span>\n            {!row.active ? (\n              <Badge size=\"xs\" className=\"shrink-0\">\n                {row.reason ?? 'inactive'}\n              </Badge>\n            ) : null}\n            {row.source !== undefined ? (\n              <span className=\"min-w-0 flex-1 truncate text-right text-sm text-po-faint\">{row.source}</span>\n            ) : null}\n          </li>\n        ))}\n      </ul>\n      {rows.length > shown.length ? (\n        <p className=\"text-sm text-po-faint\">and {rows.length - shown.length} more</p>\n      ) : null}\n    </section>\n  );\n}\n\nfunction SetupDetail({ view }: { view: SetupReportView }) {\n  const selection = [\n    ...(view.preset !== undefined ? [`mode ${view.preset}`] : []),\n    ...view.domains.map((domain) => `domain ${domain}`),\n    ...(view.profile !== undefined ? [`profile ${view.profile}`] : []),\n  ];\n  return (\n    <>\n      {selection.length > 0 ? (\n        <section className=\"flex flex-col gap-2\">\n          <SectionLabel>Selection</SectionLabel>\n          <div className=\"flex flex-wrap items-center gap-2\">\n            {selection.map((item) => (\n              <Badge key={item} size=\"xs\">\n                {item}\n              </Badge>\n            ))}\n          </div>\n        </section>\n      ) : null}\n      {view.checks.length > 0 ? (\n        <section className=\"flex flex-col gap-2\">\n          <SectionLabel>Checks</SectionLabel>\n          <ul className=\"grid grid-cols-1 gap-x-6 gap-y-2 sm:grid-cols-2\">\n            {view.checks.map((check) => (\n              <li key={check.area} className=\"flex min-w-0 flex-col gap-0.5\">\n                <div className=\"flex min-w-0 items-center gap-2\">\n                  <span className=\"min-w-0 flex-1 truncate font-mono text-sm text-po-text\">{check.area}</span>\n                  {check.passed ? (\n                    <CheckIcon aria-label=\"passed\" className=\"size-3.5 shrink-0 text-po-green\" />\n                  ) : (\n                    <span className=\"shrink-0 text-sm text-po-red\">\n                      {check.problemCount === undefined\n                        ? 'failed'\n                        : `${String(check.problemCount)} problem${check.problemCount === 1 ? '' : 's'}`}\n                    </span>\n                  )}\n                </div>\n                {!check.passed && check.guidance !== undefined ? (\n                  <span className=\"truncate text-sm text-po-faint\">Guide: {check.guidance}</span>\n                ) : null}\n              </li>\n            ))}\n          </ul>\n        </section>\n      ) : null}\n      {view.skipped.length > 0 ? (\n        <section className=\"flex flex-col gap-2\">\n          <SectionLabel>Skipped</SectionLabel>\n          {view.skipped.map((item) => (\n            <p key={item} className=\"text-sm text-po-yellow\">\n              {item}\n            </p>\n          ))}\n        </section>\n      ) : null}\n      {view.limitations !== undefined ? <p className=\"text-sm text-po-faint\">{view.limitations}</p> : null}\n    </>\n  );\n}\n","import { defineToolRenderer } from '@agimon-ai/po-core/web';\n\nimport { HelpStatusCard } from './_components/HelpStatusCard';\n\nexport default defineToolRenderer({ tools: ['help_status', 'diagnose_setup'], message: HelpStatusCard });\n","// Generated by @agimon-ai/po-build. Do not edit by hand.\nimport { defineWebPlugin, type WebPluginContributions } from '@agimon-ai/po-core/web';\n\nimport fillBrain from '../src/extensions/(frontend)/fill/Brain.page.web';\nimport dockHelp from '../src/extensions/workspaces/sessions/(frontend)/dock/help.web';\nimport fillBrain2 from '../src/extensions/workspaces/sessions/(frontend)/fill/Brain.activity-promo.web';\nimport fillHelp from '../src/extensions/workspaces/sessions/(frontend)/fill/Help.help.guides.web';\nimport leaderToggle from '../src/extensions/workspaces/sessions/(frontend)/leader/toggle.web';\nimport modeHelp from '../src/extensions/workspaces/sessions/(frontend)/mode/help/mode.web';\nimport slotGuides from '../src/extensions/workspaces/sessions/(frontend)/slot/guides.web';\nimport toolHelpStatus from '../src/extensions/workspaces/sessions/(frontend)/tool/help-status.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: 'help',\n  packageName: '@agimon-ai/po-help',\n  host: {\n    get fills(): WebPluginContributions['fills'] { return [via({ slot: 'page', id: 'brain' }, fillBrain)]; },\n  },\n  session: {\n    get dockFaces(): WebPluginContributions['dockFaces'] { return [via({ id: 'help' }, dockHelp)]; },\n    get fills(): WebPluginContributions['fills'] { return [via({ slot: 'activity-promo', id: 'brain' }, fillBrain2), via({ slot: 'help.guides', id: 'help' }, fillHelp)]; },\n    get leaderBindings(): WebPluginContributions['leaderBindings'] { return [via({ id: 'help.toggle' }, leaderToggle)]; },\n    get modes(): WebPluginContributions['modes'] { return [via({ name: 'help' }, modeHelp)]; },\n    get slots(): WebPluginContributions['slots'] { return [via({ slot: 'help.guides' }, slotGuides)]; },\n    get toolRenderers(): WebPluginContributions['toolRenderers'] { return [via({ tools: ['help_status'] }, toolHelpStatus)]; },\n  },\n});\n"],"mappings":";;;;;ACSA,MAAa,MAAM,gBAAgB;CDFjC,YAAY;EACV,QAAQ;EACR,MAAM;EACN,UAAU,KAAA;CACZ;CACA,eAAe;EACb,QAAQ;EACR,MAAM;EACN,UAAU,KAAA;CACZ;CACA,UAAU;EACR,QAAQ;EACR,MAAM;EACN,UAAU,KAAA;CACZ;CACA,OAAO;EAAE,QAAQ;EAAO,MAAM;EAAU,UAAU,KAAA;CAA0D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