@almadar/ui 5.65.0 → 5.67.0

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,12 +1,12 @@
1
- import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
1
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import * as React79 from 'react';
3
- import React79__default, { useContext, useMemo, useRef, useEffect, useCallback, useState, Suspense, lazy, createContext, useLayoutEffect, useId, forwardRef, useImperativeHandle, useSyncExternalStore, Component } from 'react';
3
+ import React79__default, { useContext, useMemo, useRef, useEffect, useCallback, useState, useLayoutEffect, Suspense, lazy, createContext, useSyncExternalStore, useId, forwardRef, useImperativeHandle, Component } from 'react';
4
4
  import { clsx } from 'clsx';
5
5
  import { twMerge } from 'tailwind-merge';
6
6
  import { EventBusContext, useTraitScope, TraitScopeProvider } from '@almadar/ui/providers';
7
7
  import { createLogger, isLogLevelEnabled } from '@almadar/logger';
8
8
  import * as LucideIcons2 from 'lucide-react';
9
- import { Loader2, X, List, Printer, ChevronRight, ChevronLeft, CheckCircle, XCircle, Wrench, RotateCcw, Send, Play, Terminal, Search, ChevronUp, ChevronDown, MoreHorizontal, Bug, Package, Calendar, Pencil, Eye, Image as Image$1, Upload, ZoomIn, ArrowRight, TrendingUp, TrendingDown, Minus, AlertCircle, Circle, Clock, CheckCircle2, Pause, SkipForward, Code, FileText, WrapText, Check, Copy, HelpCircle, Type, Heading1, Heading2, Heading3, ListOrdered, Quote, GitBranch, Plus, Trash, ArrowLeft, Menu as Menu$1, AlertTriangle, Trash2, Eraser, ZoomOut, Download, Lightbulb, PauseCircle, Link2, Tag, User, DollarSign, Zap, Sword, Move, Heart, Shield } from 'lucide-react';
9
+ import { Loader2, X, Code, FileText, WrapText, Check, Copy, List, Printer, ChevronRight, ChevronLeft, CheckCircle, XCircle, Wrench, RotateCcw, Send, Play, Terminal, Search, ChevronUp, ChevronDown, MoreHorizontal, Bug, Package, Calendar, Pencil, Eye, Image as Image$1, Upload, ZoomIn, ArrowRight, TrendingUp, TrendingDown, Minus, AlertCircle, Circle, Clock, CheckCircle2, Pause, SkipForward, HelpCircle, Type, Heading1, Heading2, Heading3, ListOrdered, Quote, GitBranch, Plus, Trash, ArrowLeft, Menu as Menu$1, AlertTriangle, Trash2, Eraser, ZoomOut, Download, Lightbulb, PauseCircle, Link2, Tag, User, DollarSign, Zap, Sword, Move, Heart, Shield } from 'lucide-react';
10
10
  import { useTranslate } from '@almadar/ui/hooks';
11
11
  export * from '@almadar/ui/hooks';
12
12
  import { useUISlots, useTheme } from '@almadar/ui/context';
@@ -49,7 +49,7 @@ import { GLTFLoader as GLTFLoader$1 } from 'three/examples/jsm/loaders/GLTFLoade
49
49
  import { clone } from 'three/examples/jsm/utils/SkeletonUtils';
50
50
  import { Canvas, useLoader, useFrame, useThree } from '@react-three/fiber';
51
51
  import { Billboard, Grid as Grid$1, OrbitControls } from '@react-three/drei';
52
- import { getPatternDefinition as getPatternDefinition$1, getComponentForPattern as getComponentForPattern$1 } from '@almadar/patterns';
52
+ import { getPatternDefinition as getPatternDefinition$1, getComponentForPattern } from '@almadar/patterns';
53
53
 
54
54
  var __defProp = Object.defineProperty;
55
55
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -10144,7 +10144,8 @@ function IsometricCanvas({
10144
10144
  const minX = Math.min(...allScreenPos.map((p2) => p2.x));
10145
10145
  const maxX = Math.max(...allScreenPos.map((p2) => p2.x + scaledTileWidth));
10146
10146
  const minY = Math.min(...allScreenPos.map((p2) => p2.y));
10147
- const maxY = Math.max(...allScreenPos.map((p2) => p2.y + scaledTileHeight));
10147
+ const tileBottomExtent = tileLayout === "hex" ? scaledTileWidth : scaledTileHeight;
10148
+ const maxY = Math.max(...allScreenPos.map((p2) => p2.y + tileBottomExtent));
10148
10149
  const worldW = maxX - minX;
10149
10150
  const worldH = maxY - minY;
10150
10151
  const scaleM = Math.min(mW / worldW, mH / worldH) * 0.9;
@@ -10236,7 +10237,7 @@ function IsometricCanvas({
10236
10237
  const drawW = scaledTileWidth;
10237
10238
  const drawH = scaledTileWidth * (img.naturalHeight / img.naturalWidth);
10238
10239
  const drawX = pos.x;
10239
- const drawY = pos.y + scaledTileHeight - drawH;
10240
+ const drawY = tileLayout === "hex" ? pos.y : pos.y + scaledTileHeight - drawH;
10240
10241
  ctx.drawImage(img, drawX, drawY, drawW, drawH);
10241
10242
  }
10242
10243
  } else {
@@ -20537,6 +20538,8 @@ var init_ChartLegend = __esm({
20537
20538
  function ChoiceButton({
20538
20539
  text = "Charge forward into the fray",
20539
20540
  index,
20541
+ assetUrl,
20542
+ icon,
20540
20543
  disabled = false,
20541
20544
  selected = false,
20542
20545
  onClick,
@@ -20569,6 +20572,23 @@ function ChoiceButton({
20569
20572
  ]
20570
20573
  }
20571
20574
  ),
20575
+ assetUrl ? /* @__PURE__ */ jsx(
20576
+ "img",
20577
+ {
20578
+ src: assetUrl,
20579
+ alt: "",
20580
+ width: 16,
20581
+ height: 16,
20582
+ style: { imageRendering: "pixelated", objectFit: "contain" },
20583
+ className: "flex-shrink-0"
20584
+ }
20585
+ ) : icon ? /* @__PURE__ */ jsx("span", { className: "flex-shrink-0 text-sm", children: typeof icon === "string" ? (() => {
20586
+ const I = resolveIcon(icon);
20587
+ return I ? /* @__PURE__ */ jsx(I, { className: "w-4 h-4" }) : null;
20588
+ })() : /* @__PURE__ */ (() => {
20589
+ const I = icon;
20590
+ return /* @__PURE__ */ jsx(I, { className: "w-4 h-4" });
20591
+ })() }) : null,
20572
20592
  /* @__PURE__ */ jsx("span", { className: "text-sm leading-snug", children: text })
20573
20593
  ]
20574
20594
  }
@@ -20577,6 +20597,7 @@ function ChoiceButton({
20577
20597
  var init_ChoiceButton = __esm({
20578
20598
  "components/game/atoms/ChoiceButton.tsx"() {
20579
20599
  init_cn();
20600
+ init_Icon();
20580
20601
  ChoiceButton.displayName = "ChoiceButton";
20581
20602
  }
20582
20603
  });
@@ -28690,6 +28711,7 @@ function PowerupSlots({
28690
28711
  /* @__PURE__ */ jsx(
28691
28712
  ItemSlot,
28692
28713
  {
28714
+ assetUrl: powerup.assetUrl,
28693
28715
  icon: powerup.icon,
28694
28716
  label: powerup.label,
28695
28717
  rarity: "uncommon",
@@ -28939,13 +28961,26 @@ function HealthPanel({
28939
28961
  )
28940
28962
  }
28941
28963
  ),
28942
- effects && effects.length > 0 && /* @__PURE__ */ jsx(Box, { className: "flex items-center gap-1 flex-wrap", children: effects.map((effect, i) => /* @__PURE__ */ jsx(
28964
+ effects && effects.length > 0 && /* @__PURE__ */ jsx(Box, { className: "flex items-center gap-1 flex-wrap", children: effects.map((effect, i) => /* @__PURE__ */ jsxs(
28943
28965
  Badge,
28944
28966
  {
28945
28967
  variant: effectVariantMap[effect.variant ?? "neutral"],
28946
28968
  size: "sm",
28947
- icon: effect.icon,
28948
- children: effect.label
28969
+ icon: effect.assetUrl ? void 0 : effect.icon,
28970
+ children: [
28971
+ effect.assetUrl && /* @__PURE__ */ jsx(
28972
+ "img",
28973
+ {
28974
+ src: effect.assetUrl,
28975
+ alt: "",
28976
+ width: 12,
28977
+ height: 12,
28978
+ style: { imageRendering: "pixelated", objectFit: "contain" },
28979
+ className: "flex-shrink-0 inline-block"
28980
+ }
28981
+ ),
28982
+ effect.label
28983
+ ]
28949
28984
  },
28950
28985
  i
28951
28986
  )) })
@@ -29192,15 +29227,28 @@ function TurnPanel({
29192
29227
  activeTeam
29193
29228
  }
29194
29229
  ),
29195
- actions && actions.length > 0 && /* @__PURE__ */ jsx(Box, { className: "flex items-center gap-1.5 ml-auto", children: actions.map((action, i) => /* @__PURE__ */ jsx(
29230
+ actions && actions.length > 0 && /* @__PURE__ */ jsx(Box, { className: "flex items-center gap-1.5 ml-auto", children: actions.map((action, i) => /* @__PURE__ */ jsxs(
29196
29231
  Button,
29197
29232
  {
29198
29233
  variant: "ghost",
29199
29234
  size: "sm",
29200
29235
  disabled: action.disabled,
29201
- leftIcon: action.icon,
29236
+ leftIcon: action.assetUrl ? void 0 : action.icon,
29202
29237
  onClick: () => handleAction(action.event),
29203
- children: action.label
29238
+ children: [
29239
+ action.assetUrl && /* @__PURE__ */ jsx(
29240
+ "img",
29241
+ {
29242
+ src: action.assetUrl,
29243
+ alt: "",
29244
+ width: 14,
29245
+ height: 14,
29246
+ style: { imageRendering: "pixelated", objectFit: "contain" },
29247
+ className: "flex-shrink-0"
29248
+ }
29249
+ ),
29250
+ action.label
29251
+ ]
29204
29252
  },
29205
29253
  i
29206
29254
  )) })
@@ -30960,13 +31008,13 @@ var init_MapView = __esm({
30960
31008
  shadowSize: [41, 41]
30961
31009
  });
30962
31010
  L.Marker.prototype.options.icon = defaultIcon;
30963
- const { useEffect: useEffect83, useRef: useRef83, useCallback: useCallback127, useState: useState112 } = React79__default;
31011
+ const { useEffect: useEffect84, useRef: useRef83, useCallback: useCallback128, useState: useState114 } = React79__default;
30964
31012
  const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
30965
31013
  const { useEventBus: useEventBus3 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
30966
31014
  function MapUpdater({ centerLat, centerLng, zoom }) {
30967
31015
  const map = useMap();
30968
31016
  const prevRef = useRef83({ centerLat, centerLng, zoom });
30969
- useEffect83(() => {
31017
+ useEffect84(() => {
30970
31018
  const prev = prevRef.current;
30971
31019
  if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
30972
31020
  map.setView([centerLat, centerLng], zoom);
@@ -30977,7 +31025,7 @@ var init_MapView = __esm({
30977
31025
  }
30978
31026
  function MapClickHandler({ onMapClick }) {
30979
31027
  const map = useMap();
30980
- useEffect83(() => {
31028
+ useEffect84(() => {
30981
31029
  if (!onMapClick) return;
30982
31030
  const handler = (e) => {
30983
31031
  onMapClick(e.latlng.lat, e.latlng.lng);
@@ -31005,8 +31053,8 @@ var init_MapView = __esm({
31005
31053
  showAttribution = true
31006
31054
  }) {
31007
31055
  const eventBus = useEventBus3();
31008
- const [clickedPosition, setClickedPosition] = useState112(null);
31009
- const handleMapClick = useCallback127((lat, lng) => {
31056
+ const [clickedPosition, setClickedPosition] = useState114(null);
31057
+ const handleMapClick = useCallback128((lat, lng) => {
31010
31058
  if (showClickedPin) {
31011
31059
  setClickedPosition({ lat, lng });
31012
31060
  }
@@ -31015,7 +31063,7 @@ var init_MapView = __esm({
31015
31063
  eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
31016
31064
  }
31017
31065
  }, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
31018
- const handleMarkerClick = useCallback127((marker) => {
31066
+ const handleMarkerClick = useCallback128((marker) => {
31019
31067
  onMarkerClick?.(marker);
31020
31068
  if (markerClickEvent) {
31021
31069
  eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
@@ -44466,9 +44514,9 @@ var init_GameCanvas3D2 = __esm({
44466
44514
  const color = unit.faction === "player" ? 4491519 : unit.faction === "enemy" ? 16729156 : 16777028;
44467
44515
  const hasAtlas = unitAtlasUrl(unit) !== null;
44468
44516
  const initialFrame = hasAtlas ? resolveUnitFrame(unit.id) : null;
44469
- const modelScale = UNIT_BASE_MODEL_SCALE * unitScale;
44470
- const billboardHeight = UNIT_BASE_BILLBOARD_HEIGHT * unitScale;
44471
- const primitiveRadius = UNIT_BASE_PRIMITIVE_RADIUS * unitScale;
44517
+ const modelScale = UNIT_BASE_MODEL_SCALE * unitScale * gridConfig.cellSize;
44518
+ const billboardHeight = UNIT_BASE_BILLBOARD_HEIGHT * unitScale * gridConfig.cellSize;
44519
+ const primitiveRadius = UNIT_BASE_PRIMITIVE_RADIUS * unitScale * gridConfig.cellSize;
44472
44520
  return /* @__PURE__ */ jsxs(
44473
44521
  "group",
44474
44522
  {
@@ -44515,7 +44563,7 @@ var init_GameCanvas3D2 = __esm({
44515
44563
  /* @__PURE__ */ jsx("meshStandardMaterial", { color })
44516
44564
  ] })
44517
44565
  ] }),
44518
- unit.health !== void 0 && unit.maxHealth !== void 0 && /* @__PURE__ */ jsxs("group", { position: [0, 1.2, 0], children: [
44566
+ unit.health !== void 0 && unit.maxHealth !== void 0 && /* @__PURE__ */ jsxs("group", { position: [0, billboardHeight, 0], children: [
44519
44567
  /* @__PURE__ */ jsxs("mesh", { position: [-0.25, 0, 0], children: [
44520
44568
  /* @__PURE__ */ jsx("planeGeometry", { args: [0.5, 0.05] }),
44521
44569
  /* @__PURE__ */ jsx("meshBasicMaterial", { color: 3355443 })
@@ -44544,7 +44592,7 @@ var init_GameCanvas3D2 = __esm({
44544
44592
  }
44545
44593
  );
44546
44594
  },
44547
- [selectedUnitId, handleUnitClick, resolveUnitFrame, unitScale]
44595
+ [selectedUnitId, handleUnitClick, resolveUnitFrame, unitScale, gridConfig]
44548
44596
  );
44549
44597
  const DefaultFeatureRenderer = useCallback(
44550
44598
  ({
@@ -44632,7 +44680,7 @@ var init_GameCanvas3D2 = __esm({
44632
44680
  {
44633
44681
  ref: containerRef,
44634
44682
  className: cn("game-canvas-3d relative w-full overflow-hidden", className),
44635
- style: { height: "85vh" },
44683
+ style: { flex: "1 1 0", minHeight: "400px" },
44636
44684
  "data-orientation": orientation,
44637
44685
  "data-camera-mode": cameraMode,
44638
44686
  "data-overlay": overlay,
@@ -44932,13 +44980,39 @@ var init_GameBoard3D = __esm({
44932
44980
  GameBoard3D.displayName = "GameBoard3D";
44933
44981
  }
44934
44982
  });
44935
- var GameShell;
44983
+ function getSlotContentRenderer() {
44984
+ if (_scr) return _scr;
44985
+ const mod = (init_UISlotRenderer(), __toCommonJS(UISlotRenderer_exports));
44986
+ _scr = mod.SlotContentRenderer;
44987
+ return _scr;
44988
+ }
44989
+ function resolveDescriptor(value, idPrefix) {
44990
+ if (value === null || value === void 0) return value;
44991
+ if (React79__default.isValidElement(value)) return value;
44992
+ if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") return value;
44993
+ if (Array.isArray(value)) {
44994
+ return value.map((item, i) => /* @__PURE__ */ jsx(React79__default.Fragment, { children: resolveDescriptor(item, `${idPrefix}-${i}`) }, i));
44995
+ }
44996
+ if (typeof value === "object") {
44997
+ const rec = value;
44998
+ if (typeof rec.type === "string" && getComponentForPattern(rec.type) !== null) {
44999
+ const { type, props: nestedProps, _id, ...flatProps } = rec;
45000
+ const resolvedProps = nestedProps !== void 0 ? nestedProps : flatProps;
45001
+ const content = { id: _id ?? idPrefix, pattern: type, props: resolvedProps, priority: 0 };
45002
+ const SCR = getSlotContentRenderer();
45003
+ return /* @__PURE__ */ jsx(SCR, { content, onDismiss: () => void 0 });
45004
+ }
45005
+ }
45006
+ return null;
45007
+ }
45008
+ var _scr, GameShell;
44936
45009
  var init_GameShell = __esm({
44937
45010
  "components/game/templates/GameShell.tsx"() {
44938
45011
  init_cn();
44939
45012
  init_Box();
44940
45013
  init_Stack();
44941
45014
  init_Typography();
45015
+ _scr = null;
44942
45016
  GameShell = ({
44943
45017
  appName = "Game",
44944
45018
  hud,
@@ -44987,7 +45061,7 @@ var init_GameShell = __esm({
44987
45061
  children: appName
44988
45062
  }
44989
45063
  ),
44990
- hud && /* @__PURE__ */ jsx(Box, { className: "game-shell__hud", children: hud })
45064
+ hud && /* @__PURE__ */ jsx(Box, { className: "game-shell__hud", children: resolveDescriptor(hud, "gs-hud") })
44991
45065
  ]
44992
45066
  }
44993
45067
  ),
@@ -45000,7 +45074,7 @@ var init_GameShell = __esm({
45000
45074
  overflow: "hidden",
45001
45075
  position: "relative"
45002
45076
  },
45003
- children
45077
+ children: resolveDescriptor(children, "gs-children")
45004
45078
  }
45005
45079
  )
45006
45080
  ]
@@ -45010,7 +45084,32 @@ var init_GameShell = __esm({
45010
45084
  GameShell.displayName = "GameShell";
45011
45085
  }
45012
45086
  });
45013
- var GameTemplate;
45087
+ function getSlotContentRenderer2() {
45088
+ if (_scr2) return _scr2;
45089
+ const mod = (init_UISlotRenderer(), __toCommonJS(UISlotRenderer_exports));
45090
+ _scr2 = mod.SlotContentRenderer;
45091
+ return _scr2;
45092
+ }
45093
+ function resolveDescriptor2(value, idPrefix) {
45094
+ if (value === null || value === void 0) return value;
45095
+ if (React79__default.isValidElement(value)) return value;
45096
+ if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") return value;
45097
+ if (Array.isArray(value)) {
45098
+ return value.map((item, i) => /* @__PURE__ */ jsx(React79__default.Fragment, { children: resolveDescriptor2(item, `${idPrefix}-${i}`) }, i));
45099
+ }
45100
+ if (typeof value === "object") {
45101
+ const rec = value;
45102
+ if (typeof rec.type === "string" && getComponentForPattern(rec.type) !== null) {
45103
+ const { type, props: nestedProps, _id, ...flatProps } = rec;
45104
+ const resolvedProps = nestedProps !== void 0 ? nestedProps : flatProps;
45105
+ const content = { id: _id ?? idPrefix, pattern: type, props: resolvedProps, priority: 0 };
45106
+ const SCR = getSlotContentRenderer2();
45107
+ return /* @__PURE__ */ jsx(SCR, { content, onDismiss: () => void 0 });
45108
+ }
45109
+ }
45110
+ return null;
45111
+ }
45112
+ var _scr2, GameTemplate;
45014
45113
  var init_GameTemplate = __esm({
45015
45114
  "components/game/templates/GameTemplate.tsx"() {
45016
45115
  init_cn();
@@ -45018,6 +45117,7 @@ var init_GameTemplate = __esm({
45018
45117
  init_Stack();
45019
45118
  init_Typography();
45020
45119
  init_Button();
45120
+ _scr2 = null;
45021
45121
  GameTemplate = ({
45022
45122
  entity,
45023
45123
  title = "Game",
@@ -45085,13 +45185,13 @@ var init_GameTemplate = __esm({
45085
45185
  fullWidth: true,
45086
45186
  className: "flex-1 bg-muted",
45087
45187
  children: [
45088
- children,
45188
+ resolveDescriptor2(children, "gt-children"),
45089
45189
  hud && /* @__PURE__ */ jsx(
45090
45190
  Box,
45091
45191
  {
45092
45192
  position: "absolute",
45093
45193
  className: "top-0 left-0 right-0 pointer-events-none",
45094
- children: /* @__PURE__ */ jsx(Box, { padding: "md", className: "pointer-events-auto w-fit", children: hud })
45194
+ children: /* @__PURE__ */ jsx(Box, { padding: "md", className: "pointer-events-auto w-fit", children: resolveDescriptor2(hud, "gt-hud") })
45095
45195
  }
45096
45196
  )
45097
45197
  ]
@@ -45116,7 +45216,7 @@ var init_GameTemplate = __esm({
45116
45216
  children: /* @__PURE__ */ jsx(Typography, { variant: "h6", children: "Debug Panel" })
45117
45217
  }
45118
45218
  ),
45119
- /* @__PURE__ */ jsx(Box, { padding: "md", children: debugPanel })
45219
+ /* @__PURE__ */ jsx(Box, { padding: "md", children: resolveDescriptor2(debugPanel, "gt-debug") })
45120
45220
  ]
45121
45221
  }
45122
45222
  )
@@ -54175,8 +54275,8 @@ function getSlotFallback(slot, config) {
54175
54275
  const variant = SLOT_SKELETON_MAP[slot] ?? "text";
54176
54276
  return /* @__PURE__ */ jsx(Skeleton, { variant });
54177
54277
  }
54178
- function getComponentForPattern(patternType) {
54179
- const mapping = getComponentForPattern$1(patternType);
54278
+ function getComponentForPattern3(patternType) {
54279
+ const mapping = getComponentForPattern(patternType);
54180
54280
  if (!mapping) {
54181
54281
  return null;
54182
54282
  }
@@ -54698,7 +54798,7 @@ function isPatternConfig(value) {
54698
54798
  if (value instanceof Date) return false;
54699
54799
  if (typeof value === "function") return false;
54700
54800
  const record = value;
54701
- return "type" in record && typeof record.type === "string" && getComponentForPattern$1(record.type) !== null;
54801
+ return "type" in record && typeof record.type === "string" && getComponentForPattern(record.type) !== null;
54702
54802
  }
54703
54803
  function isPlainConfigObject(value) {
54704
54804
  if (React79__default.isValidElement(value)) return false;
@@ -54806,7 +54906,8 @@ function SlotContentRenderer({
54806
54906
  entityDef = schemaCtx.entities.get(linkedEntity);
54807
54907
  }
54808
54908
  }
54809
- const PatternComponent = getComponentForPattern(content.pattern);
54909
+ const orbitalName = schemaCtx && content.sourceTrait !== void 0 ? schemaCtx.orbitalsByTrait.get(content.sourceTrait) : void 0;
54910
+ const PatternComponent = getComponentForPattern3(content.pattern);
54810
54911
  if (PatternComponent) {
54811
54912
  const childrenConfig = content.props.children;
54812
54913
  const isSingleChild = typeof childrenConfig === "string" || typeof childrenConfig === "object" && childrenConfig !== null && !Array.isArray(childrenConfig) && "type" in childrenConfig;
@@ -54904,6 +55005,7 @@ function SlotContentRenderer({
54904
55005
  "data-orb-entity": content.entity,
54905
55006
  "data-orb-path": myPath,
54906
55007
  "data-orb-pattern": content.pattern,
55008
+ "data-orb-orbital": orbitalName,
54907
55009
  children: renderedChildren !== void 0 ? /* @__PURE__ */ jsx(PatternComponent, { ...finalProps, children: renderedChildren }) : /* @__PURE__ */ jsx(PatternComponent, { ...finalProps })
54908
55010
  }
54909
55011
  );
@@ -54923,6 +55025,7 @@ function SlotContentRenderer({
54923
55025
  "data-orb-entity": content.entity,
54924
55026
  "data-orb-path": patternPath ?? "root",
54925
55027
  "data-orb-pattern": content.pattern,
55028
+ "data-orb-orbital": orbitalName,
54926
55029
  children: content.props.children ?? /* @__PURE__ */ jsxs(Box, { className: "p-4 text-sm text-muted-foreground border border-dashed border-border rounded", children: [
54927
55030
  "Unknown pattern: ",
54928
55031
  content.pattern,
@@ -55092,7 +55195,7 @@ function TraitFrame({
55092
55195
  if (!content) {
55093
55196
  return /* @__PURE__ */ jsx(Fragment, { children: fallback });
55094
55197
  }
55095
- const SlotContentRenderer2 = getSlotContentRenderer();
55198
+ const SlotContentRenderer2 = getSlotContentRenderer3();
55096
55199
  const rendered = /* @__PURE__ */ jsx(
55097
55200
  SlotContentRenderer2,
55098
55201
  {
@@ -55106,7 +55209,7 @@ function TraitFrame({
55106
55209
  }
55107
55210
  return /* @__PURE__ */ jsx(TraitScopeProvider, { orbital, trait: traitName, children: rendered });
55108
55211
  }
55109
- function getSlotContentRenderer() {
55212
+ function getSlotContentRenderer3() {
55110
55213
  if (_slotContentRenderer) return _slotContentRenderer;
55111
55214
  const mod = (init_UISlotRenderer(), __toCommonJS(UISlotRenderer_exports));
55112
55215
  _slotContentRenderer = mod.SlotContentRenderer;
@@ -56182,6 +56285,1023 @@ init_CaseStudyOrganism();
56182
56285
  init_CodeRunnerPanel();
56183
56286
  init_SegmentRenderer();
56184
56287
 
56288
+ // components/core/organisms/ChatBar.tsx
56289
+ init_Box();
56290
+ init_Stack();
56291
+ init_Typography();
56292
+ init_Button();
56293
+ init_Badge();
56294
+ init_Icon();
56295
+ init_Textarea();
56296
+ init_useEventBus();
56297
+
56298
+ // components/core/organisms/trace-edit-focus.ts
56299
+ var ELEMENT_SELECTED_EVENT = "UI:ELEMENT_SELECTED";
56300
+ var EDIT_FOCUS_LEVELS = /* @__PURE__ */ new Set([
56301
+ "node",
56302
+ "slot",
56303
+ "field",
56304
+ "effect",
56305
+ "trait",
56306
+ "page",
56307
+ "orbital"
56308
+ ]);
56309
+ function asString(v) {
56310
+ return typeof v === "string" ? v : void 0;
56311
+ }
56312
+ function asLevel(v) {
56313
+ if (typeof v === "string" && EDIT_FOCUS_LEVELS.has(v)) {
56314
+ return v;
56315
+ }
56316
+ return "node";
56317
+ }
56318
+ function isEventPayload(v) {
56319
+ return v !== null && v !== void 0 && typeof v === "object" && !Array.isArray(v) && !(v instanceof Date);
56320
+ }
56321
+ function parseEditFocus(value) {
56322
+ if (!isEventPayload(value)) return null;
56323
+ const payload = value;
56324
+ const orbital = asString(payload.orbital);
56325
+ if (orbital === void 0 || orbital.length === 0) return null;
56326
+ const focus = {
56327
+ level: asLevel(payload.level),
56328
+ orbital,
56329
+ label: asString(payload.label) ?? orbital
56330
+ };
56331
+ const trait = asString(payload.trait);
56332
+ if (trait !== void 0) focus.trait = trait;
56333
+ const transition = asString(payload.transition);
56334
+ if (transition !== void 0) focus.transition = transition;
56335
+ const state = asString(payload.state);
56336
+ if (state !== void 0) focus.state = state;
56337
+ const slot = asString(payload.slot);
56338
+ if (slot !== void 0) focus.slot = slot;
56339
+ const path = asString(payload.path);
56340
+ if (path !== void 0) focus.path = path;
56341
+ const patternType = asString(payload.patternType);
56342
+ if (patternType !== void 0) focus.patternType = patternType;
56343
+ const entity = asString(payload.entity);
56344
+ if (entity !== void 0) focus.entity = entity;
56345
+ const source = asString(payload.source);
56346
+ if (source !== void 0) focus.source = source;
56347
+ return focus;
56348
+ }
56349
+ function getJepaBadgeVariant(probability) {
56350
+ if (probability >= 0.9) return "success";
56351
+ if (probability >= 0.5) return "warning";
56352
+ return "danger";
56353
+ }
56354
+ function ChatBar({
56355
+ status = "idle",
56356
+ activeGate,
56357
+ jepaValidity,
56358
+ placeholder,
56359
+ context,
56360
+ className
56361
+ }) {
56362
+ const { t } = useTranslate();
56363
+ const eventBus = useEventBus();
56364
+ const [inputValue, setInputValue] = useState("");
56365
+ const [focus, setFocus] = useState(null);
56366
+ const clearFocus = useCallback(() => {
56367
+ setFocus(null);
56368
+ eventBus.emit(ELEMENT_SELECTED_EVENT, { focus: null });
56369
+ }, [eventBus]);
56370
+ const handleKeyDown = useCallback((e) => {
56371
+ if (e.key !== "Enter" || e.shiftKey) return;
56372
+ const trimmed = inputValue.trim();
56373
+ if (!trimmed) return;
56374
+ e.preventDefault();
56375
+ eventBus.emit("UI:CHAT_SEND", { message: trimmed });
56376
+ }, [inputValue, eventBus]);
56377
+ useEffect(() => {
56378
+ const unsubSend = eventBus.on("UI:CHAT_SEND", () => {
56379
+ setInputValue("");
56380
+ setFocus(null);
56381
+ });
56382
+ const unsubSelect = eventBus.on(ELEMENT_SELECTED_EVENT, (e) => {
56383
+ setFocus(parseEditFocus(e.payload?.focus));
56384
+ });
56385
+ return () => {
56386
+ unsubSend();
56387
+ unsubSelect();
56388
+ };
56389
+ }, [eventBus]);
56390
+ const trailingAction = status === "error" ? /* @__PURE__ */ jsxs(Button, { variant: "secondary", size: "sm", action: "RETRY_GENERATION", className: "rounded-none flex-shrink-0 h-auto", children: [
56391
+ /* @__PURE__ */ jsx(Icon, { name: "refresh-cw", size: "xs" }),
56392
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", children: t("openFile.retry") })
56393
+ ] }) : status === "running" ? /* @__PURE__ */ jsxs(Fragment, { children: [
56394
+ /* @__PURE__ */ jsx(
56395
+ Button,
56396
+ {
56397
+ variant: "ghost",
56398
+ size: "sm",
56399
+ action: "PAUSE",
56400
+ title: t("chatBar.pauseTheAgentYouCanEdit"),
56401
+ className: "rounded-none flex-shrink-0 h-auto",
56402
+ children: /* @__PURE__ */ jsx(Icon, { name: "pause", size: "xs" })
56403
+ }
56404
+ ),
56405
+ /* @__PURE__ */ jsx(
56406
+ Button,
56407
+ {
56408
+ variant: "ghost",
56409
+ size: "sm",
56410
+ action: "STOP",
56411
+ title: t("chatBar.cancelGeneration"),
56412
+ className: "rounded-none flex-shrink-0 h-auto border-l border-[var(--color-border)]",
56413
+ children: /* @__PURE__ */ jsx(Icon, { name: "square", size: "xs" })
56414
+ }
56415
+ )
56416
+ ] }) : status === "paused" ? /* @__PURE__ */ jsxs(
56417
+ Button,
56418
+ {
56419
+ variant: "primary",
56420
+ size: "sm",
56421
+ action: "RESUME",
56422
+ title: t("chatBar.resumeTheAgentYourCanvasEdits"),
56423
+ className: "rounded-none flex-shrink-0 h-auto",
56424
+ children: [
56425
+ /* @__PURE__ */ jsx(Icon, { name: "play", size: "xs" }),
56426
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", children: t("chatBar.resume") })
56427
+ ]
56428
+ }
56429
+ ) : /* @__PURE__ */ jsx(
56430
+ Button,
56431
+ {
56432
+ variant: "primary",
56433
+ size: "sm",
56434
+ action: "CHAT_SEND",
56435
+ actionPayload: { message: inputValue.trim() },
56436
+ disabled: !inputValue.trim(),
56437
+ "aria-label": t("chatBar.sendMessage"),
56438
+ className: "rounded-none flex-shrink-0 h-auto",
56439
+ children: /* @__PURE__ */ jsx(Icon, { name: "send", size: "xs" })
56440
+ }
56441
+ );
56442
+ return /* @__PURE__ */ jsxs(Box, { className: `border-t border-[var(--color-border)] bg-[var(--color-card)] ${className ?? ""}`, children: [
56443
+ focus && /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "items-center px-4 pt-2", children: /* @__PURE__ */ jsxs(Badge, { variant: "secondary", size: "sm", className: "flex items-center gap-1 max-w-full", children: [
56444
+ /* @__PURE__ */ jsx(Icon, { name: "mouse-pointer-2", size: "xs" }),
56445
+ /* @__PURE__ */ jsxs(Typography, { variant: "caption", className: "text-inherit truncate", children: [
56446
+ t("chatBar.editing"),
56447
+ ": ",
56448
+ focus.label
56449
+ ] }),
56450
+ /* @__PURE__ */ jsx(
56451
+ Box,
56452
+ {
56453
+ onClick: clearFocus,
56454
+ title: t("chatBar.clearSelection"),
56455
+ className: "cursor-pointer flex items-center ml-1 hover:opacity-70",
56456
+ children: /* @__PURE__ */ jsx(Icon, { name: "x", size: "xs" })
56457
+ }
56458
+ )
56459
+ ] }) }),
56460
+ /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "items-center px-4 py-2", children: [
56461
+ context && /* @__PURE__ */ jsx(Badge, { variant: "primary", size: "sm", className: "whitespace-nowrap flex-shrink-0", children: /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-inherit", children: context }) }),
56462
+ /* @__PURE__ */ jsxs(Box, { className: "flex-1 min-w-0 flex items-stretch rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-background)] focus-within:border-[var(--color-primary)] overflow-hidden", children: [
56463
+ /* @__PURE__ */ jsx(
56464
+ Textarea,
56465
+ {
56466
+ value: inputValue,
56467
+ placeholder: placeholder ?? t("chatBar.askTheAgentAnything"),
56468
+ onChange: (e) => setInputValue(e.target.value),
56469
+ onKeyDown: handleKeyDown,
56470
+ rows: 1,
56471
+ className: "flex-1 min-w-0 min-h-0 text-sm border-0 rounded-none shadow-none bg-transparent resize-none focus:ring-0"
56472
+ }
56473
+ ),
56474
+ trailingAction
56475
+ ] }),
56476
+ (activeGate || jepaValidity !== void 0) && /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center flex-shrink-0", children: [
56477
+ activeGate && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "whitespace-nowrap", children: activeGate }),
56478
+ jepaValidity !== void 0 && /* @__PURE__ */ jsx(Badge, { variant: getJepaBadgeVariant(jepaValidity), size: "sm", children: /* @__PURE__ */ jsxs(Typography, { variant: "caption", className: "text-inherit", children: [
56479
+ (jepaValidity * 100).toFixed(1),
56480
+ "%"
56481
+ ] }) })
56482
+ ] })
56483
+ ] })
56484
+ ] });
56485
+ }
56486
+ ChatBar.displayName = "ChatBar";
56487
+
56488
+ // components/core/organisms/SubagentTracePanel.tsx
56489
+ init_Box();
56490
+ init_Stack();
56491
+ init_Typography();
56492
+ init_Badge();
56493
+ init_Icon();
56494
+ init_Button();
56495
+ init_Modal();
56496
+ init_Accordion();
56497
+
56498
+ // components/core/molecules/markdown/index.ts
56499
+ init_MarkdownContent();
56500
+ init_CodeBlock();
56501
+ function groupByOrbital(subagents) {
56502
+ const map = /* @__PURE__ */ new Map();
56503
+ for (const sub of subagents) {
56504
+ const key = sub.orbitalName ?? "(unattached)";
56505
+ const arr = map.get(key) ?? [];
56506
+ arr.push(sub);
56507
+ map.set(key, arr);
56508
+ }
56509
+ return map;
56510
+ }
56511
+ function statusIconName(status) {
56512
+ switch (status) {
56513
+ case "running":
56514
+ return "loader";
56515
+ case "complete":
56516
+ return "check";
56517
+ case "error":
56518
+ return "x";
56519
+ default:
56520
+ return "circle";
56521
+ }
56522
+ }
56523
+ function lastMessage(sub) {
56524
+ if (sub.messages.length === 0) return void 0;
56525
+ return sub.messages[sub.messages.length - 1].message;
56526
+ }
56527
+ function formatHHMMSS(ts) {
56528
+ const d = new Date(ts);
56529
+ const hh = String(d.getHours()).padStart(2, "0");
56530
+ const mm = String(d.getMinutes()).padStart(2, "0");
56531
+ const ss = String(d.getSeconds()).padStart(2, "0");
56532
+ return `${hh}:${mm}:${ss}`;
56533
+ }
56534
+ function compactJson(value) {
56535
+ if (value === void 0 || value === null) return "";
56536
+ if (typeof value === "string") return value;
56537
+ try {
56538
+ const json = JSON.stringify(value);
56539
+ if (json.length <= 240) return json;
56540
+ return json.slice(0, 239) + "\u2026";
56541
+ } catch {
56542
+ return String(value);
56543
+ }
56544
+ }
56545
+ function tryPrettyJson(s) {
56546
+ try {
56547
+ return JSON.stringify(JSON.parse(s), null, 2);
56548
+ } catch {
56549
+ return null;
56550
+ }
56551
+ }
56552
+ function summarizeArgs(args) {
56553
+ const keys = Object.keys(args);
56554
+ if (keys.length === 0) return "";
56555
+ return keys.slice(0, 3).join(", ") + (keys.length > 3 ? ", \u2026" : "");
56556
+ }
56557
+ function previewText(text, max = 120) {
56558
+ if (!text) return "";
56559
+ return text.length > max ? text.slice(0, max - 1) + "\u2026" : text;
56560
+ }
56561
+ function coordinatorToActivityItems(activities) {
56562
+ return activities.flatMap((a) => {
56563
+ switch (a.type) {
56564
+ case "tool_call":
56565
+ return [{
56566
+ type: "tool_call",
56567
+ tool: a.tool,
56568
+ args: a.args,
56569
+ timestamp: a.timestamp
56570
+ }];
56571
+ case "tool_result":
56572
+ return [{
56573
+ type: "tool_result",
56574
+ tool: a.tool,
56575
+ result: a.result,
56576
+ success: a.success,
56577
+ timestamp: a.timestamp
56578
+ }];
56579
+ case "message":
56580
+ return [{
56581
+ type: "message",
56582
+ role: a.role,
56583
+ content: a.content,
56584
+ timestamp: a.timestamp
56585
+ }];
56586
+ case "error":
56587
+ return [{
56588
+ type: "message",
56589
+ role: "system",
56590
+ content: `Error: ${a.message}`,
56591
+ timestamp: a.timestamp
56592
+ }];
56593
+ case "coordinator_decision":
56594
+ case "plan_committed":
56595
+ case "pending_question":
56596
+ case "clarification_question":
56597
+ return [];
56598
+ case "file_operation":
56599
+ return [{
56600
+ type: "file_operation",
56601
+ operation: a.operation,
56602
+ path: a.path,
56603
+ success: a.success,
56604
+ timestamp: a.timestamp
56605
+ }];
56606
+ case "schema_diff":
56607
+ return [{
56608
+ type: "schema_diff",
56609
+ filePath: a.filePath,
56610
+ hunks: a.hunks,
56611
+ timestamp: a.timestamp
56612
+ }];
56613
+ }
56614
+ });
56615
+ }
56616
+ function pluckCoordinatorState(activities) {
56617
+ let decision = null;
56618
+ let plan = null;
56619
+ const pendingQuestions = [];
56620
+ for (const a of activities) {
56621
+ if (a.type === "coordinator_decision") decision = a;
56622
+ else if (a.type === "plan_committed") plan = a;
56623
+ else if (a.type === "pending_question") pendingQuestions.push(a);
56624
+ }
56625
+ return { decision, plan, pendingQuestions };
56626
+ }
56627
+ var InlineActivityRow = ({ activity }) => {
56628
+ const time = formatHHMMSS(activity.timestamp);
56629
+ const baseRow = "items-start px-3 py-1 hover:bg-[var(--color-surface)]";
56630
+ if (activity.type === "tool_call") {
56631
+ return /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: baseRow, children: [
56632
+ /* @__PURE__ */ jsx(Icon, { name: "terminal", size: "xs", className: "mt-0.5 flex-shrink-0 text-[var(--color-primary)]" }),
56633
+ /* @__PURE__ */ jsxs(Typography, { variant: "caption", className: "flex-1 min-w-0 text-[11px] font-mono break-all whitespace-pre-wrap", children: [
56634
+ /* @__PURE__ */ jsx(Typography, { as: "span", variant: "caption", weight: "semibold", className: "text-[11px] font-mono", children: activity.tool }),
56635
+ activity.args !== void 0 && /* @__PURE__ */ jsxs(Typography, { as: "span", variant: "caption", color: "muted", className: "text-[11px] font-mono", children: [
56636
+ " ",
56637
+ compactJson(activity.args)
56638
+ ] })
56639
+ ] }),
56640
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "text-[10px] flex-shrink-0 tabular-nums mt-0.5", children: time })
56641
+ ] });
56642
+ }
56643
+ if (activity.type === "tool_result") {
56644
+ const success = activity.success !== false;
56645
+ return /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: baseRow, children: [
56646
+ /* @__PURE__ */ jsx(
56647
+ Icon,
56648
+ {
56649
+ name: success ? "check" : "x",
56650
+ size: "xs",
56651
+ className: `mt-0.5 flex-shrink-0 ${success ? "text-[var(--color-success)]" : "text-[var(--color-danger)]"}`
56652
+ }
56653
+ ),
56654
+ /* @__PURE__ */ jsxs(Typography, { variant: "caption", className: "flex-1 min-w-0 text-[11px] font-mono break-all whitespace-pre-wrap", children: [
56655
+ /* @__PURE__ */ jsxs(Typography, { as: "span", variant: "caption", color: "muted", className: "text-[11px] font-mono", children: [
56656
+ activity.tool,
56657
+ ":",
56658
+ " "
56659
+ ] }),
56660
+ /* @__PURE__ */ jsx(Typography, { as: "span", variant: "caption", className: "text-[11px] font-mono", children: compactJson(activity.result) })
56661
+ ] }),
56662
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "text-[10px] flex-shrink-0 tabular-nums mt-0.5", children: time })
56663
+ ] });
56664
+ }
56665
+ if (activity.type === "message") {
56666
+ const role = activity.role;
56667
+ const iconName = role === "user" ? "user" : role === "system" ? "info" : "sparkles";
56668
+ const roleColor = role === "user" ? "text-[var(--color-primary)]" : role === "system" ? "text-[var(--color-muted-foreground)]" : "text-[var(--color-foreground)]";
56669
+ return /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: baseRow, children: [
56670
+ /* @__PURE__ */ jsx(Icon, { name: iconName, size: "xs", className: `mt-0.5 flex-shrink-0 ${roleColor}` }),
56671
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "flex-1 min-w-0 text-[11px] whitespace-pre-wrap break-words", children: activity.content }),
56672
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "text-[10px] flex-shrink-0 tabular-nums mt-0.5", children: time })
56673
+ ] });
56674
+ }
56675
+ if (activity.type === "error") {
56676
+ return /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: baseRow, children: [
56677
+ /* @__PURE__ */ jsx(Icon, { name: "alert-triangle", size: "xs", className: "mt-0.5 flex-shrink-0 text-[var(--color-danger)]" }),
56678
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "flex-1 min-w-0 text-[11px] text-[var(--color-danger)] whitespace-pre-wrap break-words", children: activity.message }),
56679
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "text-[10px] flex-shrink-0 tabular-nums mt-0.5", children: time })
56680
+ ] });
56681
+ }
56682
+ return /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: baseRow, children: [
56683
+ /* @__PURE__ */ jsx(Icon, { name: "file", size: "xs", className: "mt-0.5 flex-shrink-0 text-[var(--color-muted-foreground)]" }),
56684
+ /* @__PURE__ */ jsxs(Typography, { variant: "caption", color: "muted", className: "flex-1 min-w-0 text-[11px] font-mono break-all", children: [
56685
+ "[",
56686
+ activity.type,
56687
+ "] ",
56688
+ compactJson(activity)
56689
+ ] }),
56690
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "text-[10px] flex-shrink-0 tabular-nums mt-0.5", children: time })
56691
+ ] });
56692
+ };
56693
+ var InlineActivityStream = ({ activities, autoScroll = true, className }) => {
56694
+ const endRef = React79__default.useRef(null);
56695
+ React79__default.useEffect(() => {
56696
+ if (!autoScroll) return;
56697
+ endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
56698
+ }, [activities.length, autoScroll]);
56699
+ return /* @__PURE__ */ jsxs(Box, { className, children: [
56700
+ activities.map((a, i) => /* @__PURE__ */ jsx(InlineActivityRow, { activity: a }, `${a.timestamp}-${i}`)),
56701
+ /* @__PURE__ */ jsx(Box, { ref: endRef })
56702
+ ] });
56703
+ };
56704
+ var CoordinatorCard = ({ snapshot, className }) => {
56705
+ const { t } = useTranslate();
56706
+ const { decision, plan, pendingQuestions } = snapshot;
56707
+ if (!decision && !plan && pendingQuestions.length === 0) return null;
56708
+ return /* @__PURE__ */ jsxs(
56709
+ Box,
56710
+ {
56711
+ className: `px-3 py-2 border-b border-[var(--color-border)] bg-[var(--color-muted)]/30 ${className ?? ""}`,
56712
+ children: [
56713
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center mb-2", children: [
56714
+ /* @__PURE__ */ jsx(Icon, { name: "compass", size: "xs" }),
56715
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "font-semibold text-[11px]", children: t("subagentTrace.coordinator") })
56716
+ ] }),
56717
+ decision && /* @__PURE__ */ jsxs(VStack, { gap: "none", className: "mb-2", children: [
56718
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
56719
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "text-[10px] uppercase tracking-wide", children: t("subagentTrace.organism") }),
56720
+ /* @__PURE__ */ jsx(Badge, { variant: "default", className: "text-[10px]", children: decision.organism }),
56721
+ decision.priorOrganism && decision.priorOrganism !== decision.organism && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "text-[10px]", children: t("subagentTrace.wasOrganism", { organism: decision.priorOrganism }) })
56722
+ ] }),
56723
+ decision.reason && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "text-[11px] mt-0.5", children: decision.reason })
56724
+ ] }),
56725
+ plan && plan.orbitals.length > 0 && /* @__PURE__ */ jsxs(VStack, { gap: "none", className: "mb-2", children: [
56726
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "text-[10px] uppercase tracking-wide mb-0.5", children: plan.orbitals.length === 1 ? t("subagentTrace.planOrbital", { count: plan.orbitals.length }) : t("subagentTrace.planOrbitals", { count: plan.orbitals.length }) }),
56727
+ /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap", children: plan.orbitals.map((o) => /* @__PURE__ */ jsx(Badge, { variant: "neutral", className: "text-[10px]", children: o }, o)) })
56728
+ ] }),
56729
+ pendingQuestions.length > 0 && /* @__PURE__ */ jsxs(VStack, { gap: "none", children: [
56730
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "text-[10px] uppercase tracking-wide mb-0.5", children: pendingQuestions.length === 1 ? t("subagentTrace.pendingQuestion", { count: pendingQuestions.length }) : t("subagentTrace.pendingQuestions", { count: pendingQuestions.length }) }),
56731
+ pendingQuestions.map((q) => /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-start", children: [
56732
+ /* @__PURE__ */ jsx(Icon, { name: "help-circle", size: "xs", className: "mt-0.5 flex-shrink-0 text-[var(--color-warning)]" }),
56733
+ /* @__PURE__ */ jsxs(Typography, { variant: "caption", className: "text-[11px] flex-1 min-w-0", children: [
56734
+ q.question,
56735
+ q.orbitalName && /* @__PURE__ */ jsxs(Typography, { variant: "caption", color: "muted", className: "text-[10px] ml-1", children: [
56736
+ "(",
56737
+ q.orbitalName,
56738
+ ")"
56739
+ ] })
56740
+ ] })
56741
+ ] }, q.questionId))
56742
+ ] })
56743
+ ]
56744
+ }
56745
+ );
56746
+ };
56747
+ function subagentMessagesToActivities(messages) {
56748
+ return messages.map((m) => {
56749
+ if (m.tool) {
56750
+ return {
56751
+ type: "tool_call",
56752
+ tool: m.tool,
56753
+ args: { preview: m.message },
56754
+ timestamp: m.timestamp
56755
+ };
56756
+ }
56757
+ return {
56758
+ type: "message",
56759
+ role: "system",
56760
+ content: m.message,
56761
+ timestamp: m.timestamp
56762
+ };
56763
+ });
56764
+ }
56765
+ var SubagentRow = ({ subagent }) => {
56766
+ const recent = lastMessage(subagent);
56767
+ return /* @__PURE__ */ jsxs(
56768
+ HStack,
56769
+ {
56770
+ gap: "sm",
56771
+ className: "items-start px-3 py-2 border-b border-[var(--color-border)]",
56772
+ children: [
56773
+ /* @__PURE__ */ jsx(Box, { className: "pt-0.5", children: /* @__PURE__ */ jsx(Icon, { name: statusIconName(subagent.status), size: "xs" }) }),
56774
+ /* @__PURE__ */ jsxs(VStack, { gap: "none", className: "flex-1 min-w-0", children: [
56775
+ /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "items-center", children: [
56776
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "font-medium truncate", children: subagent.name }),
56777
+ /* @__PURE__ */ jsx(Badge, { variant: "default", children: subagent.role })
56778
+ ] }),
56779
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "truncate", children: recent ?? subagent.task })
56780
+ ] })
56781
+ ]
56782
+ }
56783
+ );
56784
+ };
56785
+ var OrbitalGroup = ({ orbitalName, subagents }) => {
56786
+ const { t } = useTranslate();
56787
+ const runningCount = subagents.filter((s) => s.status === "running").length;
56788
+ const completeCount = subagents.filter((s) => s.status === "complete").length;
56789
+ return /* @__PURE__ */ jsxs(VStack, { gap: "none", className: "border-b border-[var(--color-border)]", children: [
56790
+ /* @__PURE__ */ jsxs(
56791
+ HStack,
56792
+ {
56793
+ gap: "sm",
56794
+ className: "items-center px-3 py-2 bg-[var(--color-surface)] border-b border-[var(--color-border)]",
56795
+ children: [
56796
+ /* @__PURE__ */ jsx(Icon, { name: "circle", size: "xs" }),
56797
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "font-semibold flex-1 truncate", children: orbitalName }),
56798
+ /* @__PURE__ */ jsx(Badge, { variant: "default", children: runningCount > 0 ? t("subagentTrace.countRunning", { count: runningCount }) : t("subagentTrace.countDone", { count: completeCount }) })
56799
+ ]
56800
+ }
56801
+ ),
56802
+ subagents.map((sub) => /* @__PURE__ */ jsx(SubagentRow, { subagent: sub }, sub.id))
56803
+ ] });
56804
+ };
56805
+ var SubagentRichCard = ({ subagent }) => {
56806
+ const { t } = useTranslate();
56807
+ const activities = React79__default.useMemo(
56808
+ () => subagentMessagesToActivities(subagent.messages),
56809
+ [subagent.messages]
56810
+ );
56811
+ return /* @__PURE__ */ jsxs(VStack, { gap: "none", className: "border-b border-[var(--color-border)] p-3", children: [
56812
+ /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "items-center mb-2", children: [
56813
+ /* @__PURE__ */ jsx(
56814
+ Box,
56815
+ {
56816
+ style: {
56817
+ width: 8,
56818
+ height: 8,
56819
+ borderRadius: "50%",
56820
+ flexShrink: 0,
56821
+ backgroundColor: subagent.status === "complete" ? "var(--color-success)" : subagent.status === "error" ? "var(--color-error)" : "var(--color-primary)",
56822
+ ...subagent.status === "running" ? { animation: "pulse 1.5s infinite" } : {}
56823
+ }
56824
+ }
56825
+ ),
56826
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "font-semibold flex-1 truncate", children: subagent.name }),
56827
+ /* @__PURE__ */ jsx(Badge, { variant: subagent.role === "deterministic" ? "default" : subagent.role === "llm" ? "info" : "warning", children: subagent.role }),
56828
+ subagent.durationMs !== void 0 && subagent.durationMs > 0 && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: subagent.durationMs < 1e3 ? `${subagent.durationMs}ms` : `${(subagent.durationMs / 1e3).toFixed(1)}s` })
56829
+ ] }),
56830
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "mb-2", children: subagent.task }),
56831
+ activities.length > 0 ? /* @__PURE__ */ jsx(Box, { className: "max-h-64 overflow-y-auto border-t border-[var(--color-border)]", children: /* @__PURE__ */ jsx(InlineActivityStream, { activities, autoScroll: true }) }) : /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "italic text-[10px]", children: subagent.status === "complete" ? t("subagentTrace.noConversationLog") : t("subagentTrace.waitingForProcessData") })
56832
+ ] });
56833
+ };
56834
+ var roleBadgeVariant = {
56835
+ system: "neutral",
56836
+ user: "info",
56837
+ assistant: "default",
56838
+ tool: "warning"
56839
+ };
56840
+ var ChatMessageRow = ({ message, index }) => {
56841
+ const { t } = useTranslate();
56842
+ const { role, content, toolCalls, reasoningContent, toolCallId, toolName } = message;
56843
+ if (role === "tool") {
56844
+ const pretty = tryPrettyJson(content);
56845
+ const title = `${toolName ?? "tool"} \u2192${toolCallId ? ` ${toolCallId.slice(0, 8)}` : ""}`;
56846
+ const body = pretty !== null ? /* @__PURE__ */ jsx(CodeBlock, { code: pretty, language: "json", maxHeight: "24rem" }) : /* @__PURE__ */ jsx(Typography, { variant: "body", className: "whitespace-pre-wrap font-mono text-[11px]", children: content });
56847
+ const items = [{ id: `tool-${index}`, title, content: body }];
56848
+ return /* @__PURE__ */ jsx(Box, { className: "px-3 py-2 border-b border-[var(--color-border)]", children: /* @__PURE__ */ jsx(Accordion, { items }) });
56849
+ }
56850
+ const hasReasoning = typeof reasoningContent === "string" && reasoningContent.length > 0;
56851
+ const hasToolCalls = Array.isArray(toolCalls) && toolCalls.length > 0;
56852
+ return /* @__PURE__ */ jsxs(VStack, { gap: "xs", className: "px-3 py-2 border-b border-[var(--color-border)]", children: [
56853
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
56854
+ /* @__PURE__ */ jsx(Badge, { variant: roleBadgeVariant[role], className: "text-[10px] uppercase", children: role }),
56855
+ hasReasoning && /* @__PURE__ */ jsxs(Typography, { variant: "caption", color: "muted", className: "text-[10px]", children: [
56856
+ "\xB7 ",
56857
+ t("subagentTrace.thinking")
56858
+ ] }),
56859
+ hasToolCalls && /* @__PURE__ */ jsxs(Typography, { variant: "caption", color: "muted", className: "text-[10px]", children: [
56860
+ "\xB7 ",
56861
+ toolCalls.length === 1 ? t("subagentTrace.toolCallCount", { count: toolCalls.length }) : t("subagentTrace.toolCallCountPlural", { count: toolCalls.length })
56862
+ ] })
56863
+ ] }),
56864
+ hasReasoning && /* @__PURE__ */ jsx(Accordion, { items: [{
56865
+ id: `reasoning-${index}`,
56866
+ title: t("subagentTrace.reasoning"),
56867
+ content: /* @__PURE__ */ jsx(MarkdownContent, { content: reasoningContent })
56868
+ }] }),
56869
+ content.length > 0 && /* @__PURE__ */ jsx(MarkdownContent, { content }),
56870
+ hasToolCalls && /* @__PURE__ */ jsx(
56871
+ Accordion,
56872
+ {
56873
+ multiple: true,
56874
+ items: toolCalls.map((tc, i) => ({
56875
+ id: `tc-${index}-${i}`,
56876
+ title: `${tc.name}(${summarizeArgs(tc.args)})`,
56877
+ content: /* @__PURE__ */ jsx(CodeBlock, { code: JSON.stringify(tc.args, null, 2), language: "json", maxHeight: "24rem" })
56878
+ }))
56879
+ }
56880
+ )
56881
+ ] });
56882
+ };
56883
+ var CoordinatorConversation = ({ messages, autoScroll = true, className }) => {
56884
+ const endRef = React79__default.useRef(null);
56885
+ React79__default.useEffect(() => {
56886
+ if (!autoScroll) return;
56887
+ endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
56888
+ }, [messages.length, autoScroll]);
56889
+ return /* @__PURE__ */ jsxs(Box, { className, children: [
56890
+ messages.map((m, i) => /* @__PURE__ */ jsx(ChatMessageRow, { message: m, index: i }, `msg-${i}`)),
56891
+ /* @__PURE__ */ jsx(Box, { ref: endRef })
56892
+ ] });
56893
+ };
56894
+ function buildTimelineItems(messages, activities, subagents) {
56895
+ const items = [];
56896
+ if (messages) {
56897
+ messages.forEach((m, i) => items.push({ source: "message", data: m, index: i }));
56898
+ }
56899
+ if (activities) {
56900
+ activities.forEach((a) => items.push({ source: "activity", data: a }));
56901
+ }
56902
+ subagents.forEach((s) => items.push({ source: "subagent", data: s }));
56903
+ return items;
56904
+ }
56905
+ function timelineItemIcon(item) {
56906
+ switch (item.source) {
56907
+ case "message": {
56908
+ const m = item.data;
56909
+ if (m.role === "tool") return { name: "terminal", color: "text-[var(--color-primary)]" };
56910
+ if (m.reasoningContent) return { name: "sparkles", color: "text-[var(--color-primary)]" };
56911
+ if (m.role === "user") return { name: "user", color: "text-[var(--color-primary)]" };
56912
+ return { name: "message-square", color: "text-[var(--color-muted-foreground)]" };
56913
+ }
56914
+ case "activity": {
56915
+ const a = item.data;
56916
+ switch (a.type) {
56917
+ case "tool_call":
56918
+ return { name: "terminal", color: "text-[var(--color-primary)]" };
56919
+ case "tool_result":
56920
+ return { name: a.success !== false ? "check" : "x", color: a.success !== false ? "text-[var(--color-success)]" : "text-[var(--color-danger)]" };
56921
+ case "error":
56922
+ return { name: "alert-triangle", color: "text-[var(--color-danger)]" };
56923
+ case "file_operation":
56924
+ return { name: "file", color: "text-[var(--color-muted-foreground)]" };
56925
+ case "schema_diff":
56926
+ return { name: "git-commit", color: "text-[var(--color-muted-foreground)]" };
56927
+ default:
56928
+ return { name: "info", color: "text-[var(--color-muted-foreground)]" };
56929
+ }
56930
+ }
56931
+ case "subagent":
56932
+ return { name: "bot", color: "text-[var(--color-primary)]" };
56933
+ }
56934
+ }
56935
+ function timelineItemLabel(item) {
56936
+ switch (item.source) {
56937
+ case "message": {
56938
+ const m = item.data;
56939
+ if (m.role === "tool") return "tool";
56940
+ if (m.reasoningContent) return "thinking";
56941
+ return m.role;
56942
+ }
56943
+ case "activity":
56944
+ return item.data.type;
56945
+ case "subagent":
56946
+ return "subagent";
56947
+ }
56948
+ }
56949
+ function timelineItemPreview(item) {
56950
+ switch (item.source) {
56951
+ case "message": {
56952
+ const m = item.data;
56953
+ if (m.role === "tool") return `${m.toolName ?? "tool"} \u2192 ${m.toolCallId?.slice(0, 8) ?? ""}`;
56954
+ if (m.reasoningContent) return previewText(m.reasoningContent, 120);
56955
+ return previewText(m.content, 120);
56956
+ }
56957
+ case "activity": {
56958
+ const a = item.data;
56959
+ switch (a.type) {
56960
+ case "tool_call":
56961
+ return `${a.tool}(${summarizeArgs(a.args)})`;
56962
+ case "tool_result":
56963
+ return `${a.tool}: ${compactJson(a.result)}`;
56964
+ case "message":
56965
+ return previewText(a.content, 120);
56966
+ case "error":
56967
+ return previewText(a.message, 120);
56968
+ case "file_operation":
56969
+ return `${a.operation} ${a.path}`;
56970
+ case "schema_diff":
56971
+ return `diff ${a.filePath}`;
56972
+ default:
56973
+ return String(a.type);
56974
+ }
56975
+ }
56976
+ case "subagent":
56977
+ return `${item.data.name} \xB7 ${item.data.task}`;
56978
+ }
56979
+ }
56980
+ function timelineItemTimeLabel(item) {
56981
+ if (item.source === "activity") return formatHHMMSS(item.data.timestamp);
56982
+ if (item.source === "subagent") {
56983
+ const ts = item.data.messages[0]?.timestamp;
56984
+ return ts !== void 0 ? formatHHMMSS(ts) : void 0;
56985
+ }
56986
+ return void 0;
56987
+ }
56988
+ function TraceDetailContent({ item }) {
56989
+ const { t } = useTranslate();
56990
+ switch (item.source) {
56991
+ case "message": {
56992
+ const m = item.data;
56993
+ return /* @__PURE__ */ jsxs(VStack, { gap: "md", children: [
56994
+ /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "items-center", children: /* @__PURE__ */ jsx(Badge, { variant: roleBadgeVariant[m.role], className: "text-[10px] uppercase", children: m.role }) }),
56995
+ typeof m.reasoningContent === "string" && m.reasoningContent.length > 0 && /* @__PURE__ */ jsxs(Box, { children: [
56996
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "mb-1", children: t("subagentTrace.reasoning") }),
56997
+ /* @__PURE__ */ jsx(MarkdownContent, { content: m.reasoningContent })
56998
+ ] }),
56999
+ m.content.length > 0 && /* @__PURE__ */ jsxs(Box, { children: [
57000
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "mb-1", children: t("subagentTrace.content") }),
57001
+ m.role === "tool" ? (() => {
57002
+ const pretty = tryPrettyJson(m.content);
57003
+ return pretty !== null ? /* @__PURE__ */ jsx(CodeBlock, { code: pretty, language: "json", maxHeight: "24rem" }) : /* @__PURE__ */ jsx(Typography, { variant: "body", className: "whitespace-pre-wrap font-mono text-[11px]", children: m.content });
57004
+ })() : /* @__PURE__ */ jsx(MarkdownContent, { content: m.content })
57005
+ ] }),
57006
+ Array.isArray(m.toolCalls) && m.toolCalls.length > 0 && /* @__PURE__ */ jsxs(Box, { children: [
57007
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "mb-1", children: t("subagentTrace.toolCalls") }),
57008
+ /* @__PURE__ */ jsx(
57009
+ Accordion,
57010
+ {
57011
+ multiple: true,
57012
+ items: m.toolCalls.map((tc, i) => ({
57013
+ id: `tc-detail-${i}`,
57014
+ title: `${tc.name}(${summarizeArgs(tc.args)})`,
57015
+ content: /* @__PURE__ */ jsx(CodeBlock, { code: JSON.stringify(tc.args, null, 2), language: "json", maxHeight: "24rem" })
57016
+ }))
57017
+ }
57018
+ )
57019
+ ] })
57020
+ ] });
57021
+ }
57022
+ case "activity": {
57023
+ const a = item.data;
57024
+ switch (a.type) {
57025
+ case "tool_call":
57026
+ return /* @__PURE__ */ jsxs(VStack, { gap: "md", children: [
57027
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
57028
+ /* @__PURE__ */ jsx(Badge, { variant: "default", className: "text-[10px]", children: "tool_call" }),
57029
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: formatHHMMSS(a.timestamp) })
57030
+ ] }),
57031
+ /* @__PURE__ */ jsx(Typography, { variant: "body2", children: a.tool }),
57032
+ /* @__PURE__ */ jsx(CodeBlock, { code: JSON.stringify(a.args, null, 2), language: "json", maxHeight: "60vh" })
57033
+ ] });
57034
+ case "tool_result":
57035
+ return /* @__PURE__ */ jsxs(VStack, { gap: "md", children: [
57036
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
57037
+ /* @__PURE__ */ jsx(Badge, { variant: a.success !== false ? "default" : "warning", className: "text-[10px]", children: a.success !== false ? "success" : "fail" }),
57038
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: formatHHMMSS(a.timestamp) })
57039
+ ] }),
57040
+ /* @__PURE__ */ jsx(Typography, { variant: "body2", children: a.tool }),
57041
+ /* @__PURE__ */ jsx(CodeBlock, { code: JSON.stringify(a.result, null, 2), language: "json", maxHeight: "60vh" })
57042
+ ] });
57043
+ case "message":
57044
+ return /* @__PURE__ */ jsxs(VStack, { gap: "md", children: [
57045
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
57046
+ /* @__PURE__ */ jsx(Badge, { variant: "neutral", className: "text-[10px]", children: a.role }),
57047
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: formatHHMMSS(a.timestamp) })
57048
+ ] }),
57049
+ /* @__PURE__ */ jsx(Typography, { variant: "body2", className: "whitespace-pre-wrap", children: a.content })
57050
+ ] });
57051
+ case "error":
57052
+ return /* @__PURE__ */ jsxs(VStack, { gap: "md", children: [
57053
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
57054
+ /* @__PURE__ */ jsx(Badge, { variant: "warning", className: "text-[10px]", children: "error" }),
57055
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: formatHHMMSS(a.timestamp) })
57056
+ ] }),
57057
+ /* @__PURE__ */ jsx(Typography, { variant: "body2", className: "whitespace-pre-wrap text-[var(--color-danger)]", children: a.message })
57058
+ ] });
57059
+ case "file_operation":
57060
+ return /* @__PURE__ */ jsxs(VStack, { gap: "md", children: [
57061
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
57062
+ /* @__PURE__ */ jsx(Badge, { variant: "neutral", className: "text-[10px]", children: "file" }),
57063
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: formatHHMMSS(a.timestamp) })
57064
+ ] }),
57065
+ /* @__PURE__ */ jsxs(Typography, { variant: "body2", children: [
57066
+ a.operation,
57067
+ " ",
57068
+ a.path
57069
+ ] })
57070
+ ] });
57071
+ case "schema_diff":
57072
+ return /* @__PURE__ */ jsxs(VStack, { gap: "md", children: [
57073
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
57074
+ /* @__PURE__ */ jsx(Badge, { variant: "neutral", className: "text-[10px]", children: "diff" }),
57075
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: formatHHMMSS(a.timestamp) })
57076
+ ] }),
57077
+ /* @__PURE__ */ jsx(Typography, { variant: "body2", children: a.filePath })
57078
+ ] });
57079
+ default:
57080
+ return /* @__PURE__ */ jsxs(VStack, { gap: "md", children: [
57081
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: formatHHMMSS(a.timestamp) }),
57082
+ /* @__PURE__ */ jsx(Typography, { variant: "body2", children: String(a.type) })
57083
+ ] });
57084
+ }
57085
+ }
57086
+ case "subagent": {
57087
+ const s = item.data;
57088
+ const activities = subagentMessagesToActivities(s.messages);
57089
+ const ts = s.messages[0]?.timestamp;
57090
+ return /* @__PURE__ */ jsxs(VStack, { gap: "md", children: [
57091
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
57092
+ /* @__PURE__ */ jsx(Badge, { variant: "default", className: "text-[10px]", children: s.role }),
57093
+ ts !== void 0 && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: formatHHMMSS(ts) })
57094
+ ] }),
57095
+ /* @__PURE__ */ jsx(Typography, { variant: "body2", weight: "semibold", children: s.name }),
57096
+ /* @__PURE__ */ jsx(Typography, { variant: "body2", color: "muted", children: s.task }),
57097
+ activities.length > 0 && /* @__PURE__ */ jsx(Box, { className: "border-t border-[var(--color-border)] pt-2", children: /* @__PURE__ */ jsx(InlineActivityStream, { activities, autoScroll: false }) })
57098
+ ] });
57099
+ }
57100
+ }
57101
+ }
57102
+ var SubagentTracePanel = ({
57103
+ subagents,
57104
+ focusedOrbital,
57105
+ disclosureLevel,
57106
+ open,
57107
+ onClose,
57108
+ className,
57109
+ mode = "overlay",
57110
+ coordinatorActivities,
57111
+ coordinatorMessages
57112
+ }) => {
57113
+ const { t } = useTranslate();
57114
+ const [selectedItem, setSelectedItem] = useState(null);
57115
+ const densityLabel = (rich) => rich ? t("subagentTrace.densityRich") : t("subagentTrace.densityCompact");
57116
+ if (mode === "overlay" && !open) return null;
57117
+ const isTabMode = mode === "tab";
57118
+ const isRichMode = isTabMode || disclosureLevel >= 3;
57119
+ if (isTabMode) {
57120
+ const timelineItems = buildTimelineItems(coordinatorMessages, coordinatorActivities, subagents);
57121
+ const hasData = timelineItems.length > 0;
57122
+ return /* @__PURE__ */ jsxs(Box, { className: `h-full w-full bg-[var(--color-card)] overflow-hidden flex flex-col ${className ?? ""}`, children: [
57123
+ /* @__PURE__ */ jsxs(
57124
+ HStack,
57125
+ {
57126
+ gap: "sm",
57127
+ className: "items-center px-3 py-2 border-b border-[var(--color-border)]",
57128
+ children: [
57129
+ /* @__PURE__ */ jsx(Icon, { name: "activity", size: "sm" }),
57130
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "font-semibold flex-1", children: t("subagentTrace.trace") }),
57131
+ onClose && /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", onClick: onClose, children: /* @__PURE__ */ jsx(Icon, { name: "x", size: "xs" }) })
57132
+ ]
57133
+ }
57134
+ ),
57135
+ !hasData && /* @__PURE__ */ jsx(Box, { className: "flex-1 flex items-center justify-center px-4", children: /* @__PURE__ */ jsx(Typography, { variant: "body2", color: "muted", className: "text-center", children: t("subagentTrace.noAgentActivity") }) }),
57136
+ hasData && /* @__PURE__ */ jsx(Box, { className: "flex-1 overflow-y-auto", children: /* @__PURE__ */ jsx(VStack, { gap: "none", children: timelineItems.map((item, i) => {
57137
+ const { name: iconName, color: iconColor } = timelineItemIcon(item);
57138
+ const isLast = i === timelineItems.length - 1;
57139
+ return /* @__PURE__ */ jsxs(
57140
+ Box,
57141
+ {
57142
+ className: "flex items-start px-3 py-2 border-b border-[var(--color-border)] hover:bg-[var(--color-muted)]/30 transition-colors duration-fast cursor-pointer",
57143
+ onClick: () => setSelectedItem(item),
57144
+ children: [
57145
+ /* @__PURE__ */ jsxs(Box, { className: "flex flex-col items-center mr-3 mt-0.5", style: { width: 20 }, children: [
57146
+ /* @__PURE__ */ jsx(
57147
+ Box,
57148
+ {
57149
+ className: "rounded-full flex-shrink-0",
57150
+ style: {
57151
+ width: 8,
57152
+ height: 8,
57153
+ backgroundColor: "var(--color-primary)"
57154
+ }
57155
+ }
57156
+ ),
57157
+ !isLast && /* @__PURE__ */ jsx(
57158
+ Box,
57159
+ {
57160
+ className: "flex-1",
57161
+ style: {
57162
+ width: 2,
57163
+ backgroundColor: "var(--color-border)",
57164
+ marginTop: 4,
57165
+ minHeight: 24
57166
+ }
57167
+ }
57168
+ )
57169
+ ] }),
57170
+ /* @__PURE__ */ jsxs(VStack, { gap: "xs", className: "flex-1 min-w-0", children: [
57171
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
57172
+ /* @__PURE__ */ jsx(Icon, { name: iconName, size: "xs", className: `flex-shrink-0 ${iconColor}` }),
57173
+ timelineItemTimeLabel(item) && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: timelineItemTimeLabel(item) }),
57174
+ /* @__PURE__ */ jsx(Badge, { variant: "neutral", className: "text-[10px]", children: timelineItemLabel(item) })
57175
+ ] }),
57176
+ /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "items-start", children: [
57177
+ /* @__PURE__ */ jsx(Typography, { variant: "body2", color: "muted", className: "flex-1 min-w-0 line-clamp-2", children: timelineItemPreview(item) }),
57178
+ /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", className: "flex-shrink-0 mt-0", onClick: (e) => {
57179
+ e.stopPropagation();
57180
+ setSelectedItem(item);
57181
+ }, children: /* @__PURE__ */ jsx(Icon, { name: "maximize-2", size: "xs" }) })
57182
+ ] })
57183
+ ] })
57184
+ ]
57185
+ },
57186
+ `${item.source}-${i}`
57187
+ );
57188
+ }) }) }),
57189
+ /* @__PURE__ */ jsx(
57190
+ Modal,
57191
+ {
57192
+ isOpen: selectedItem !== null,
57193
+ onClose: () => setSelectedItem(null),
57194
+ title: selectedItem ? `${timelineItemLabel(selectedItem)}${timelineItemTimeLabel(selectedItem) ? ` \xB7 ${timelineItemTimeLabel(selectedItem)}` : ""}` : "",
57195
+ size: "lg",
57196
+ children: selectedItem && /* @__PURE__ */ jsx(TraceDetailContent, { item: selectedItem })
57197
+ }
57198
+ )
57199
+ ] });
57200
+ }
57201
+ const filtered = focusedOrbital ? subagents.filter((s) => s.orbitalName === focusedOrbital) : subagents;
57202
+ const wrapperClass = isRichMode ? `absolute inset-x-3 bottom-3 sm:inset-x-auto sm:top-3 sm:right-3 sm:bottom-3 w-full sm:w-[28rem] max-w-[calc(100vw-1.5rem)] max-h-[60vh] sm:max-h-none bg-[var(--color-card)] border border-[var(--color-border)] rounded-md shadow-lg overflow-hidden flex flex-col ${className ?? ""}` : `absolute inset-x-3 bottom-3 sm:inset-x-auto sm:top-3 sm:right-3 sm:bottom-3 w-full sm:w-80 max-w-[calc(100vw-1.5rem)] max-h-[60vh] sm:max-h-none bg-[var(--color-card)] border border-[var(--color-border)] rounded-md shadow-lg overflow-hidden flex flex-col ${className ?? ""}`;
57203
+ const wrapperStyle = { zIndex: 20 };
57204
+ const hasCoordinatorData = coordinatorMessages && coordinatorMessages.length > 0 || coordinatorActivities && coordinatorActivities.length > 0;
57205
+ if (filtered.length === 0 && !hasCoordinatorData) {
57206
+ return /* @__PURE__ */ jsxs(Box, { className: wrapperClass, style: wrapperStyle, children: [
57207
+ /* @__PURE__ */ jsxs(
57208
+ HStack,
57209
+ {
57210
+ gap: "sm",
57211
+ className: "items-center px-3 py-2 border-b border-[var(--color-border)]",
57212
+ children: [
57213
+ /* @__PURE__ */ jsx(Icon, { name: "activity", size: "sm" }),
57214
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "font-semibold flex-1", children: t("subagentTrace.subagents") }),
57215
+ onClose && /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", onClick: onClose, children: /* @__PURE__ */ jsx(Icon, { name: "x", size: "xs" }) })
57216
+ ]
57217
+ }
57218
+ ),
57219
+ /* @__PURE__ */ jsx(Box, { className: "flex-1 flex items-center justify-center px-4", children: /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "text-center", children: focusedOrbital ? t("subagentTrace.noSubagentsForOrbital", { orbital: focusedOrbital }) : t("subagentTrace.noSubagentsActive") }) })
57220
+ ] });
57221
+ }
57222
+ if (focusedOrbital) {
57223
+ return /* @__PURE__ */ jsxs(Box, { className: wrapperClass, style: wrapperStyle, children: [
57224
+ /* @__PURE__ */ jsxs(
57225
+ HStack,
57226
+ {
57227
+ gap: "sm",
57228
+ className: "items-center px-3 py-2 border-b border-[var(--color-border)]",
57229
+ children: [
57230
+ /* @__PURE__ */ jsx(Icon, { name: "activity", size: "sm" }),
57231
+ /* @__PURE__ */ jsxs(VStack, { gap: "none", className: "flex-1 min-w-0", children: [
57232
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "font-semibold truncate", children: focusedOrbital }),
57233
+ /* @__PURE__ */ jsxs(Typography, { variant: "caption", color: "muted", children: [
57234
+ filtered.length === 1 ? t("subagentTrace.subagentCount", { count: filtered.length }) : t("subagentTrace.subagentCountPlural", { count: filtered.length }),
57235
+ " \xB7 ",
57236
+ densityLabel(isRichMode)
57237
+ ] })
57238
+ ] }),
57239
+ onClose && /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", onClick: onClose, children: /* @__PURE__ */ jsx(Icon, { name: "x", size: "xs" }) })
57240
+ ]
57241
+ }
57242
+ ),
57243
+ /* @__PURE__ */ jsx(Box, { className: "flex-1 overflow-y-auto", children: filtered.map((sub) => isRichMode ? /* @__PURE__ */ jsx(SubagentRichCard, { subagent: sub }, sub.id) : /* @__PURE__ */ jsx(SubagentRow, { subagent: sub }, sub.id)) })
57244
+ ] });
57245
+ }
57246
+ const grouped = groupByOrbital(filtered);
57247
+ const coordinatorSnapshot = pluckCoordinatorState(coordinatorActivities ?? []);
57248
+ return /* @__PURE__ */ jsxs(Box, { className: wrapperClass, style: wrapperStyle, children: [
57249
+ /* @__PURE__ */ jsxs(
57250
+ HStack,
57251
+ {
57252
+ gap: "sm",
57253
+ className: "items-center px-3 py-2 border-b border-[var(--color-border)]",
57254
+ children: [
57255
+ /* @__PURE__ */ jsx(Icon, { name: "activity", size: "sm" }),
57256
+ /* @__PURE__ */ jsxs(Typography, { variant: "caption", className: "font-semibold flex-1", children: [
57257
+ t("subagentTrace.subagentsWithCount", { count: filtered.length }),
57258
+ " \xB7 ",
57259
+ densityLabel(isRichMode)
57260
+ ] }),
57261
+ onClose && /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", onClick: onClose, children: /* @__PURE__ */ jsx(Icon, { name: "x", size: "xs" }) })
57262
+ ]
57263
+ }
57264
+ ),
57265
+ /* @__PURE__ */ jsxs(Box, { className: "flex-1 overflow-y-auto", children: [
57266
+ !focusedOrbital && isRichMode && /* @__PURE__ */ jsx(CoordinatorCard, { snapshot: coordinatorSnapshot }),
57267
+ coordinatorMessages && coordinatorMessages.length > 0 ? /* @__PURE__ */ jsxs(Box, { className: "border-b border-[var(--color-border)]", children: [
57268
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center px-3 py-1.5 bg-[var(--color-card)] border-b border-[var(--color-border)]", children: [
57269
+ /* @__PURE__ */ jsx(Box, { style: { width: 6, height: 6, borderRadius: "50%", backgroundColor: "var(--color-primary)", flexShrink: 0 } }),
57270
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "font-semibold text-[11px]", children: t("subagentTrace.coordinator") }),
57271
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "text-[10px]", children: t("subagentTrace.messagesCount", { count: coordinatorMessages.length }) })
57272
+ ] }),
57273
+ /* @__PURE__ */ jsx(Box, { className: "max-h-[36rem] overflow-y-auto", children: /* @__PURE__ */ jsx(CoordinatorConversation, { messages: coordinatorMessages, autoScroll: true }) })
57274
+ ] }) : coordinatorActivities && coordinatorActivities.length > 0 && (() => {
57275
+ const filteredCoordinator = coordinatorActivities;
57276
+ if (filteredCoordinator.length === 0) return null;
57277
+ return /* @__PURE__ */ jsxs(Box, { className: "border-b border-[var(--color-border)]", children: [
57278
+ /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center px-3 py-1.5 bg-[var(--color-card)] border-b border-[var(--color-border)]", children: [
57279
+ /* @__PURE__ */ jsx(Box, { style: { width: 6, height: 6, borderRadius: "50%", backgroundColor: "var(--color-primary)", flexShrink: 0 } }),
57280
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "font-semibold text-[11px]", children: t("subagentTrace.coordinator") }),
57281
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "text-[10px]", children: t("subagentTrace.eventsCount", { count: filteredCoordinator.length }) })
57282
+ ] }),
57283
+ /* @__PURE__ */ jsx(Box, { className: "max-h-60 overflow-y-auto", children: /* @__PURE__ */ jsx(
57284
+ InlineActivityStream,
57285
+ {
57286
+ activities: coordinatorToActivityItems(filteredCoordinator),
57287
+ autoScroll: true
57288
+ }
57289
+ ) })
57290
+ ] });
57291
+ })(),
57292
+ isRichMode ? filtered.map((sub) => /* @__PURE__ */ jsx(SubagentRichCard, { subagent: sub }, sub.id)) : Array.from(grouped.entries()).map(([orbitalName, subs]) => /* @__PURE__ */ jsx(
57293
+ OrbitalGroup,
57294
+ {
57295
+ orbitalName,
57296
+ subagents: subs
57297
+ },
57298
+ orbitalName
57299
+ ))
57300
+ ] })
57301
+ ] });
57302
+ };
57303
+ SubagentTracePanel.displayName = "SubagentTracePanel";
57304
+
56185
57305
  // components/core/templates/index.ts
56186
57306
  init_DashboardLayout();
56187
57307
  init_AuthLayout();
@@ -56207,4 +57327,4 @@ init_AboutPageTemplate();
56207
57327
  // components/index.ts
56208
57328
  init_cn();
56209
57329
 
56210
- export { ALL_PRESETS, AR_BOOK_FIELDS, AboutPageTemplate, Accordion, ActionButton, ActionButtons, Card2 as ActionCard, ActionPalette, ActionTile, ActivationBlock, Alert, AnimatedCounter, AnimatedGraphic, AnimatedReveal, ArticleSection, Aside, AssetPicker, AuthLayout, Avatar, Badge, BattleBoard, BattleTemplate, BehaviorView, BloomQuizBlock, BookChapterView, BookCoverPage, BookNavBar, BookTableOfContents, BookViewer, Box, BranchingLogicBuilder, Breadcrumb, BuilderBoard, Button, ButtonGroup, CTABanner, CalendarGrid, CanvasEffect, Card, CardBattlerBoard, CardBattlerTemplate, CardBody, CardContent, CardFooter, CardGrid, CardHand, CardHeader, CardTitle, Carousel, CaseStudyCard, CaseStudyOrganism, CastleBoard, CastleTemplate, Center, Chart, ChartLegend, Checkbox, ChoiceButton, CityBuilderBoard, CityBuilderTemplate, ClassifierBoard, Coachmark, CodeBlock, CodeRunnerPanel, CollapsibleSection, CombatLog, ComboCounter, CommunityLinks, ConditionalWrapper, ConfettiEffect, ConfirmDialog, ConnectionBlock, Container, ContentRenderer, ContentSection, ControlButton, CounterTemplate, CraftingRecipe, DEFAULT_LIKERT_OPTIONS, DEFAULT_MATRIX_COLUMNS, DIAMOND_TOP_Y, DPad, DamageNumber, DashboardGrid, DashboardLayout, DataGrid, DataList, DataTable, DateRangePicker, DateRangeSelector, DayCell, DebuggerBoard, DetailPanel, Dialog, DialogueBox, DialogueBubble, Divider, DocBreadcrumb, DocPagination, DocSearch, DocSidebar, DocTOC, DocumentViewer, StateMachineView as DomStateMachineVisualizer, Drawer, DrawerSlot, EdgeDecoration, EditorCheckbox, EditorSelect, EditorSlider, EditorTextInput, EditorToolbar, EmptyState, EnemyPlate, EntityDisplayEvents, ErrorBoundary, ErrorState, EventHandlerBoard, EventLog, FEATURE_COLORS, FEATURE_TYPES, FLOOR_HEIGHT, FeatureCard, FeatureDetailPageTemplate, FeatureGrid, FeatureGridOrganism, FileTree, FilterGroup, FilterPill, Flex, FlipCard, FlipContainer, FloatingActionButton, Form, FormActions, FormField, FormLayout, FormSection, FormSectionHeader, GameAudioContext, GameAudioProvider, GameAudioToggle, GameBoard3D, GameCanvas2D, GameHud, GameMenu, GameOverScreen, GameShell, GameTemplate, GenericAppTemplate, GeometricPattern, GradientDivider, GraphCanvas, GraphView, Grid, GridPicker, HStack, Header, HealthBar, HealthPanel, HeroOrganism, HeroSection, HexStrategyBoard, IDENTITY_BOOK_FIELDS, Icon, IconPicker, InfiniteScrollSentinel, Input, InputGroup, InstallBox, InventoryGrid, InventoryPanel, IsometricCanvas, ItemSlot, JazariStateMachine, JsonTreeEditor, Label, LandingPageTemplate, LawReferenceTooltip, Lightbox, LikertScale, LineChart2 as LineChart, List3 as List, LoadingState, MapView, MarkdownContent, MarketingFooter, MarketingStatCard, MasterDetail, MasterDetailLayout, MatrixQuestion, MediaGallery, Menu, Meter, MiniMap, Modal, ModalSlot, ModuleCard, Navigation, NegotiatorBoard, NodeSlotEditor, NotifyListener, NumberStepper, ObjectRulePanel, OnboardingSpotlight, OptionConstraintGroup, StateMachineView as OrbitalStateMachineView, OrbitalVisualization, Overlay, PageHeader, Pagination, PatternTile, PhysicsManager, PlatformerBoard, PlatformerCanvas, PlatformerTemplate, Popover, PositionedCanvas, PowerupSlots, PricingCard, PricingGrid, PricingOrganism, PricingPageTemplate, ProgressBar, ProgressDots, PropertyInspector, PullQuote, PullToRefresh, QrScanner, QuestTracker, QuizBlock, Radio, RangeSlider, ReflectionBlock, RelationSelect, RepeatableFormSection, ReplyTree, ResourceBar, ResourceCounter, RichBlockEditor, RoguelikeBoard, RoguelikeTemplate, RuleEditor, RuntimeDebugger, SHEET_COLUMNS, SPRITE_SHEET_LAYOUT, ScaledDiagram, ScoreBoard, ScoreDisplay, SearchInput, Section, SectionHeader, SegmentRenderer, Select, SequenceBar, SequencerBoard, ServiceCatalog, ShowcaseCard, ShowcaseOrganism, SidePanel, Sidebar, SignaturePad, SimpleGrid, SimulationCanvas, SimulationControls, SimulationGraph, SimulatorBoard, Skeleton, SlotContentRenderer, SocialProof, SortableList, Spacer, Sparkline, Spinner, Split, SplitPane, SplitSection, Sprite, Stack, StarRating, StatBadge, StatCard, StatDisplay, StateArchitectBoard, StateIndicator, StateJsonView, StateMachineView, StateNode2 as StateNode, StatsGrid, StatsOrganism, StatusBar, StatusDot, StatusEffect, StepFlow, StepFlowOrganism, SvgBranch, SvgConnection, SvgFlow, SvgGrid, SvgLobe, SvgMesh, SvgMorph, SvgNode, SvgPulse, SvgRing, SvgShield, SvgStack, SwipeableRow, Switch, TERRAIN_COLORS, TILE_HEIGHT, TILE_WIDTH, TabbedContainer, TableView, Tabs, TagCloud, TagInput, TeamCard, TeamOrganism, TerrainPalette, TextHighlight, Textarea, ThemeSelector, ThemeToggle, TimeSlotCell, Timeline, TimerDisplay, Toast, ToastSlot, Tooltip, TopDownShooterBoard, TopDownShooterTemplate, TowerDefenseBoard, TowerDefenseTemplate, TraitFrame, TraitSlot, TraitStateViewer, TransitionArrow, TrendIndicator, TurnIndicator, TurnPanel, TypewriterText, Typography, UISlotComponent, UISlotRenderer, UncontrolledBattleBoard, UnitCommandBar, UploadDropZone, VStack, VariablePanel, VersionDiff, ViolationAlert, VisualNovelBoard, VisualNovelTemplate, VoteStack, WaypointMarker, WizardContainer, WizardNavigation, WizardProgress, WorldMapBoard, WorldMapTemplate, XPBar, applyTemporaryEffect, calculateAttackTargets, calculateDamage, calculateValidMoves, cn, combatAnimations, combatClasses, combatEffects, createInitialGameState, createUnitAnimationState, drawSprite, generateCombatMessage, getCurrentFrame, getTileDimensions, inferDirection, isoToScreen, mapBookData, parseLessonSegments, parseMarkdownWithCodeBlocks, pendulum, projectileMotion, resolveFieldMap, resolveFrame, resolveSheetDirection, screenToIso, springOscillator, tickAnimationState, toCodeLanguage, transitionAnimation, useAnchorRect, useBattleState, useCamera, useGameAudio, useGameAudioContext, useImageCache, usePhysics2D, useSpriteAnimations };
57330
+ export { ALL_PRESETS, AR_BOOK_FIELDS, AboutPageTemplate, Accordion, ActionButton, ActionButtons, Card2 as ActionCard, ActionPalette, ActionTile, ActivationBlock, Alert, AnimatedCounter, AnimatedGraphic, AnimatedReveal, ArticleSection, Aside, AssetPicker, AuthLayout, Avatar, Badge, BattleBoard, BattleTemplate, BehaviorView, BloomQuizBlock, BookChapterView, BookCoverPage, BookNavBar, BookTableOfContents, BookViewer, Box, BranchingLogicBuilder, Breadcrumb, BuilderBoard, Button, ButtonGroup, CTABanner, CalendarGrid, CanvasEffect, Card, CardBattlerBoard, CardBattlerTemplate, CardBody, CardContent, CardFooter, CardGrid, CardHand, CardHeader, CardTitle, Carousel, CaseStudyCard, CaseStudyOrganism, CastleBoard, CastleTemplate, Center, Chart, ChartLegend, ChatBar, Checkbox, ChoiceButton, CityBuilderBoard, CityBuilderTemplate, ClassifierBoard, Coachmark, CodeBlock, CodeRunnerPanel, CollapsibleSection, CombatLog, ComboCounter, CommunityLinks, ConditionalWrapper, ConfettiEffect, ConfirmDialog, ConnectionBlock, Container, ContentRenderer, ContentSection, ControlButton, CounterTemplate, CraftingRecipe, DEFAULT_LIKERT_OPTIONS, DEFAULT_MATRIX_COLUMNS, DIAMOND_TOP_Y, DPad, DamageNumber, DashboardGrid, DashboardLayout, DataGrid, DataList, DataTable, DateRangePicker, DateRangeSelector, DayCell, DebuggerBoard, DetailPanel, Dialog, DialogueBox, DialogueBubble, Divider, DocBreadcrumb, DocPagination, DocSearch, DocSidebar, DocTOC, DocumentViewer, StateMachineView as DomStateMachineVisualizer, Drawer, DrawerSlot, ELEMENT_SELECTED_EVENT, EdgeDecoration, EditorCheckbox, EditorSelect, EditorSlider, EditorTextInput, EditorToolbar, EmptyState, EnemyPlate, EntityDisplayEvents, ErrorBoundary, ErrorState, EventHandlerBoard, EventLog, FEATURE_COLORS, FEATURE_TYPES, FLOOR_HEIGHT, FeatureCard, FeatureDetailPageTemplate, FeatureGrid, FeatureGridOrganism, FileTree, FilterGroup, FilterPill, Flex, FlipCard, FlipContainer, FloatingActionButton, Form, FormActions, FormField, FormLayout, FormSection, FormSectionHeader, GameAudioContext, GameAudioProvider, GameAudioToggle, GameBoard3D, GameCanvas2D, GameHud, GameMenu, GameOverScreen, GameShell, GameTemplate, GenericAppTemplate, GeometricPattern, GradientDivider, GraphCanvas, GraphView, Grid, GridPicker, HStack, Header, HealthBar, HealthPanel, HeroOrganism, HeroSection, HexStrategyBoard, IDENTITY_BOOK_FIELDS, Icon, IconPicker, InfiniteScrollSentinel, Input, InputGroup, InstallBox, InventoryGrid, InventoryPanel, IsometricCanvas, ItemSlot, JazariStateMachine, JsonTreeEditor, Label, LandingPageTemplate, LawReferenceTooltip, Lightbox, LikertScale, LineChart2 as LineChart, List3 as List, LoadingState, MapView, MarkdownContent, MarketingFooter, MarketingStatCard, MasterDetail, MasterDetailLayout, MatrixQuestion, MediaGallery, Menu, Meter, MiniMap, Modal, ModalSlot, ModuleCard, Navigation, NegotiatorBoard, NodeSlotEditor, NotifyListener, NumberStepper, ObjectRulePanel, OnboardingSpotlight, OptionConstraintGroup, StateMachineView as OrbitalStateMachineView, OrbitalVisualization, Overlay, PageHeader, Pagination, PatternTile, PhysicsManager, PlatformerBoard, PlatformerCanvas, PlatformerTemplate, Popover, PositionedCanvas, PowerupSlots, PricingCard, PricingGrid, PricingOrganism, PricingPageTemplate, ProgressBar, ProgressDots, PropertyInspector, PullQuote, PullToRefresh, QrScanner, QuestTracker, QuizBlock, Radio, RangeSlider, ReflectionBlock, RelationSelect, RepeatableFormSection, ReplyTree, ResourceBar, ResourceCounter, RichBlockEditor, RoguelikeBoard, RoguelikeTemplate, RuleEditor, RuntimeDebugger, SHEET_COLUMNS, SPRITE_SHEET_LAYOUT, ScaledDiagram, ScoreBoard, ScoreDisplay, SearchInput, Section, SectionHeader, SegmentRenderer, Select, SequenceBar, SequencerBoard, ServiceCatalog, ShowcaseCard, ShowcaseOrganism, SidePanel, Sidebar, SignaturePad, SimpleGrid, SimulationCanvas, SimulationControls, SimulationGraph, SimulatorBoard, Skeleton, SlotContentRenderer, SocialProof, SortableList, Spacer, Sparkline, Spinner, Split, SplitPane, SplitSection, Sprite, Stack, StarRating, StatBadge, StatCard, StatDisplay, StateArchitectBoard, StateIndicator, StateJsonView, StateMachineView, StateNode2 as StateNode, StatsGrid, StatsOrganism, StatusBar, StatusDot, StatusEffect, StepFlow, StepFlowOrganism, SubagentTracePanel, SvgBranch, SvgConnection, SvgFlow, SvgGrid, SvgLobe, SvgMesh, SvgMorph, SvgNode, SvgPulse, SvgRing, SvgShield, SvgStack, SwipeableRow, Switch, TERRAIN_COLORS, TILE_HEIGHT, TILE_WIDTH, TabbedContainer, TableView, Tabs, TagCloud, TagInput, TeamCard, TeamOrganism, TerrainPalette, TextHighlight, Textarea, ThemeSelector, ThemeToggle, TimeSlotCell, Timeline, TimerDisplay, Toast, ToastSlot, Tooltip, TopDownShooterBoard, TopDownShooterTemplate, TowerDefenseBoard, TowerDefenseTemplate, TraitFrame, TraitSlot, TraitStateViewer, TransitionArrow, TrendIndicator, TurnIndicator, TurnPanel, TypewriterText, Typography, UISlotComponent, UISlotRenderer, UncontrolledBattleBoard, UnitCommandBar, UploadDropZone, VStack, VariablePanel, VersionDiff, ViolationAlert, VisualNovelBoard, VisualNovelTemplate, VoteStack, WaypointMarker, WizardContainer, WizardNavigation, WizardProgress, WorldMapBoard, WorldMapTemplate, XPBar, applyTemporaryEffect, calculateAttackTargets, calculateDamage, calculateValidMoves, cn, combatAnimations, combatClasses, combatEffects, createInitialGameState, createUnitAnimationState, drawSprite, generateCombatMessage, getCurrentFrame, getTileDimensions, inferDirection, isoToScreen, mapBookData, parseEditFocus, parseLessonSegments, parseMarkdownWithCodeBlocks, pendulum, projectileMotion, resolveFieldMap, resolveFrame, resolveSheetDirection, screenToIso, springOscillator, tickAnimationState, toCodeLanguage, transitionAnimation, useAnchorRect, useBattleState, useCamera, useGameAudio, useGameAudioContext, useImageCache, usePhysics2D, useSpriteAnimations };