@almadar/ui 5.64.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.
Files changed (31) hide show
  1. package/dist/avl/index.cjs +241 -71
  2. package/dist/avl/index.d.cts +10 -2
  3. package/dist/avl/index.d.ts +1 -0
  4. package/dist/avl/index.js +244 -75
  5. package/dist/components/avl/derive-edit-focus.d.ts +8 -0
  6. package/dist/components/core/organisms/ChatBar.d.ts +31 -0
  7. package/dist/components/core/organisms/SubagentTracePanel.d.ts +50 -0
  8. package/dist/components/core/organisms/index.d.ts +3 -0
  9. package/dist/components/core/organisms/trace-edit-focus.d.ts +14 -0
  10. package/dist/components/game/atoms/ChoiceButton.d.ts +7 -1
  11. package/dist/components/game/molecules/HealthPanel.d.ts +3 -0
  12. package/dist/components/game/molecules/IsometricCanvas.d.ts +4 -1
  13. package/dist/components/game/molecules/PowerupSlots.d.ts +3 -0
  14. package/dist/components/game/molecules/TurnPanel.d.ts +3 -0
  15. package/dist/components/game/molecules/index.d.ts +1 -0
  16. package/dist/components/game/molecules/three/index.cjs +6 -6
  17. package/dist/components/game/molecules/three/index.js +6 -6
  18. package/dist/components/game/organisms/HexStrategyBoard.d.ts +37 -0
  19. package/dist/components/game/organisms/index.d.ts +2 -0
  20. package/dist/components/game/organisms/utils/isometric.d.ts +20 -7
  21. package/dist/components/index.cjs +1241 -53
  22. package/dist/components/index.js +1243 -60
  23. package/dist/hooks/index.cjs +94 -0
  24. package/dist/hooks/index.d.ts +1 -0
  25. package/dist/hooks/index.js +95 -2
  26. package/dist/hooks/useAgentTrace.d.ts +85 -0
  27. package/dist/providers/index.cjs +210 -45
  28. package/dist/providers/index.js +213 -48
  29. package/dist/runtime/index.cjs +212 -47
  30. package/dist/runtime/index.js +215 -50
  31. package/package.json +2 -2
@@ -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;
@@ -9877,16 +9877,26 @@ var init_useUnitSpriteAtlas = __esm({
9877
9877
  });
9878
9878
 
9879
9879
  // components/game/organisms/utils/isometric.ts
9880
- function isoToScreen(tileX, tileY, scale, baseOffsetX) {
9880
+ function isoToScreen(tileX, tileY, scale, baseOffsetX, layout = "isometric") {
9881
9881
  const scaledTileWidth = TILE_WIDTH * scale;
9882
9882
  const scaledFloorHeight = FLOOR_HEIGHT * scale;
9883
+ if (layout === "hex") {
9884
+ const screenX2 = tileX * scaledTileWidth + (tileY & 1) * (scaledTileWidth / 2) + baseOffsetX;
9885
+ const screenY2 = tileY * (scaledFloorHeight * 0.75);
9886
+ return { x: screenX2, y: screenY2 };
9887
+ }
9883
9888
  const screenX = (tileX - tileY) * (scaledTileWidth / 2) + baseOffsetX;
9884
9889
  const screenY = (tileX + tileY) * (scaledFloorHeight / 2);
9885
9890
  return { x: screenX, y: screenY };
9886
9891
  }
9887
- function screenToIso(screenX, screenY, scale, baseOffsetX) {
9892
+ function screenToIso(screenX, screenY, scale, baseOffsetX, layout = "isometric") {
9888
9893
  const scaledTileWidth = TILE_WIDTH * scale;
9889
9894
  const scaledFloorHeight = FLOOR_HEIGHT * scale;
9895
+ if (layout === "hex") {
9896
+ const row = Math.round(screenY / (scaledFloorHeight * 0.75));
9897
+ const col = Math.round((screenX - (row & 1) * (scaledTileWidth / 2) - baseOffsetX) / scaledTileWidth);
9898
+ return { x: col, y: row };
9899
+ }
9890
9900
  const adjustedX = screenX - baseOffsetX;
9891
9901
  const tileX = (adjustedX / (scaledTileWidth / 2) + screenY / (scaledFloorHeight / 2)) / 2;
9892
9902
  const tileY = (screenY / (scaledFloorHeight / 2) - adjustedX / (scaledTileWidth / 2)) / 2;
@@ -9936,6 +9946,7 @@ function IsometricCanvas({
9936
9946
  tileHoverEvent,
9937
9947
  tileLeaveEvent,
9938
9948
  // Rendering options
9949
+ tileLayout = "isometric",
9939
9950
  scale = 0.4,
9940
9951
  debug: debug2 = false,
9941
9952
  backgroundImage = "",
@@ -10005,13 +10016,17 @@ function IsometricCanvas({
10005
10016
  );
10006
10017
  const sortedTiles = useMemo(() => {
10007
10018
  const tiles = [...tilesProp];
10008
- tiles.sort((a, b) => {
10009
- const depthA = a.x + a.y;
10010
- const depthB = b.x + b.y;
10011
- return depthA !== depthB ? depthA - depthB : a.y - b.y;
10012
- });
10019
+ if (tileLayout === "hex") {
10020
+ tiles.sort((a, b) => a.y !== b.y ? a.y - b.y : a.x - b.x);
10021
+ } else {
10022
+ tiles.sort((a, b) => {
10023
+ const depthA = a.x + a.y;
10024
+ const depthB = b.x + b.y;
10025
+ return depthA !== depthB ? depthA - depthB : a.y - b.y;
10026
+ });
10027
+ }
10013
10028
  return tiles;
10014
- }, [tilesProp]);
10029
+ }, [tilesProp, tileLayout]);
10015
10030
  const gridWidth = useMemo(() => {
10016
10031
  if (sortedTiles.length === 0) return 0;
10017
10032
  return Math.max(...sortedTiles.map((t2) => t2.x)) + 1;
@@ -10125,18 +10140,19 @@ function IsometricCanvas({
10125
10140
  miniCanvas.width = mW;
10126
10141
  miniCanvas.height = mH;
10127
10142
  mCtx.clearRect(0, 0, mW, mH);
10128
- const allScreenPos = sortedTiles.map((t2) => isoToScreen(t2.x, t2.y, scale, baseOffsetX));
10143
+ const allScreenPos = sortedTiles.map((t2) => isoToScreen(t2.x, t2.y, scale, baseOffsetX, tileLayout));
10129
10144
  const minX = Math.min(...allScreenPos.map((p2) => p2.x));
10130
10145
  const maxX = Math.max(...allScreenPos.map((p2) => p2.x + scaledTileWidth));
10131
10146
  const minY = Math.min(...allScreenPos.map((p2) => p2.y));
10132
- 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));
10133
10149
  const worldW = maxX - minX;
10134
10150
  const worldH = maxY - minY;
10135
10151
  const scaleM = Math.min(mW / worldW, mH / worldH) * 0.9;
10136
10152
  const offsetMx = (mW - worldW * scaleM) / 2;
10137
10153
  const offsetMy = (mH - worldH * scaleM) / 2;
10138
10154
  for (const tile of sortedTiles) {
10139
- const pos = isoToScreen(tile.x, tile.y, scale, baseOffsetX);
10155
+ const pos = isoToScreen(tile.x, tile.y, scale, baseOffsetX, tileLayout);
10140
10156
  const mx = (pos.x - minX) * scaleM + offsetMx;
10141
10157
  const my = (pos.y - minY) * scaleM + offsetMy;
10142
10158
  const mTileW = scaledTileWidth * scaleM;
@@ -10152,7 +10168,7 @@ function IsometricCanvas({
10152
10168
  }
10153
10169
  for (const unit of units) {
10154
10170
  if (!unit.position) continue;
10155
- const pos = isoToScreen(unit.position.x, unit.position.y, scale, baseOffsetX);
10171
+ const pos = isoToScreen(unit.position.x, unit.position.y, scale, baseOffsetX, tileLayout);
10156
10172
  const mx = (pos.x + scaledTileWidth / 2 - minX) * scaleM + offsetMx;
10157
10173
  const my = (pos.y + scaledTileHeight / 2 - minY) * scaleM + offsetMy;
10158
10174
  mCtx.fillStyle = unit.team === "player" ? "#60a5fa" : unit.team === "enemy" ? "#f87171" : "#9ca3af";
@@ -10168,7 +10184,7 @@ function IsometricCanvas({
10168
10184
  mCtx.strokeStyle = "rgba(255, 255, 255, 0.8)";
10169
10185
  mCtx.lineWidth = 1;
10170
10186
  mCtx.strokeRect(vLeft, vTop, vW, vH);
10171
- }, [showMinimap, sortedTiles, units, scale, baseOffsetX, scaledTileWidth, scaledTileHeight, scaledFloorHeight, viewportSize, cameraRef]);
10187
+ }, [showMinimap, sortedTiles, units, tileLayout, scale, baseOffsetX, scaledTileWidth, scaledTileHeight, scaledFloorHeight, viewportSize, cameraRef]);
10172
10188
  const draw = useCallback((animTime) => {
10173
10189
  const canvas = canvasRef.current;
10174
10190
  if (!canvas) return;
@@ -10208,7 +10224,7 @@ function IsometricCanvas({
10208
10224
  const visTop = cam.y - viewportSize.height / cam.zoom;
10209
10225
  const visBottom = cam.y + viewportSize.height * 2 / cam.zoom;
10210
10226
  for (const tile of sortedTiles) {
10211
- const pos = isoToScreen(tile.x, tile.y, scale, baseOffsetX);
10227
+ const pos = isoToScreen(tile.x, tile.y, scale, baseOffsetX, tileLayout);
10212
10228
  if (pos.x + scaledTileWidth < visLeft || pos.x > visRight || pos.y + scaledTileHeight < visTop || pos.y > visBottom) {
10213
10229
  continue;
10214
10230
  }
@@ -10221,7 +10237,7 @@ function IsometricCanvas({
10221
10237
  const drawW = scaledTileWidth;
10222
10238
  const drawH = scaledTileWidth * (img.naturalHeight / img.naturalWidth);
10223
10239
  const drawX = pos.x;
10224
- const drawY = pos.y + scaledTileHeight - drawH;
10240
+ const drawY = tileLayout === "hex" ? pos.y : pos.y + scaledTileHeight - drawH;
10225
10241
  ctx.drawImage(img, drawX, drawY, drawW, drawH);
10226
10242
  }
10227
10243
  } else {
@@ -10288,12 +10304,13 @@ function IsometricCanvas({
10288
10304
  }
10289
10305
  }
10290
10306
  const sortedFeatures = [...features].sort((a, b) => {
10307
+ if (tileLayout === "hex") return a.y !== b.y ? a.y - b.y : a.x - b.x;
10291
10308
  const depthA = a.x + a.y;
10292
10309
  const depthB = b.x + b.y;
10293
10310
  return depthA !== depthB ? depthA - depthB : a.y - b.y;
10294
10311
  });
10295
10312
  for (const feature of sortedFeatures) {
10296
- const pos = isoToScreen(feature.x, feature.y, scale, baseOffsetX);
10313
+ const pos = isoToScreen(feature.x, feature.y, scale, baseOffsetX, tileLayout);
10297
10314
  if (pos.x + scaledTileWidth < visLeft || pos.x > visRight || pos.y + scaledTileHeight < visTop || pos.y > visBottom) {
10298
10315
  continue;
10299
10316
  }
@@ -10328,12 +10345,13 @@ function IsometricCanvas({
10328
10345
  }
10329
10346
  const unitsWithPosition = units.filter((u) => !!u.position);
10330
10347
  const sortedUnits = [...unitsWithPosition].sort((a, b) => {
10348
+ if (tileLayout === "hex") return a.position.y !== b.position.y ? a.position.y - b.position.y : a.position.x - b.position.x;
10331
10349
  const depthA = a.position.x + a.position.y;
10332
10350
  const depthB = b.position.x + b.position.y;
10333
10351
  return depthA !== depthB ? depthA - depthB : a.position.y - b.position.y;
10334
10352
  });
10335
10353
  for (const unit of sortedUnits) {
10336
- const pos = isoToScreen(unit.position.x, unit.position.y, scale, baseOffsetX);
10354
+ const pos = isoToScreen(unit.position.x, unit.position.y, scale, baseOffsetX, tileLayout);
10337
10355
  if (pos.x + scaledTileWidth < visLeft || pos.x > visRight || pos.y + scaledTileHeight < visTop || pos.y > visBottom) {
10338
10356
  continue;
10339
10357
  }
@@ -10353,7 +10371,7 @@ function IsometricCanvas({
10353
10371
  drawH = maxUnitW / ar;
10354
10372
  }
10355
10373
  if (unit.previousPosition && (unit.previousPosition.x !== unit.position.x || unit.previousPosition.y !== unit.position.y)) {
10356
- const ghostPos = isoToScreen(unit.previousPosition.x, unit.previousPosition.y, scale, baseOffsetX);
10374
+ const ghostPos = isoToScreen(unit.previousPosition.x, unit.previousPosition.y, scale, baseOffsetX, tileLayout);
10357
10375
  const ghostCenterX = ghostPos.x + scaledTileWidth / 2;
10358
10376
  const ghostGroundY = ghostPos.y + scaledDiamondTopY + scaledFloorHeight * 0.5;
10359
10377
  ctx.save();
@@ -10482,6 +10500,7 @@ function IsometricCanvas({
10482
10500
  units,
10483
10501
  features,
10484
10502
  selectedUnitId,
10503
+ tileLayout,
10485
10504
  scale,
10486
10505
  debug2,
10487
10506
  resolveTerrainSpriteUrl,
@@ -10510,14 +10529,14 @@ function IsometricCanvas({
10510
10529
  if (!selectedUnitId) return;
10511
10530
  const unit = units.find((u) => u.id === selectedUnitId);
10512
10531
  if (!unit?.position) return;
10513
- const pos = isoToScreen(unit.position.x, unit.position.y, scale, baseOffsetX);
10532
+ const pos = isoToScreen(unit.position.x, unit.position.y, scale, baseOffsetX, tileLayout);
10514
10533
  const centerX = pos.x + scaledTileWidth / 2;
10515
10534
  const centerY = pos.y + scaledDiamondTopY + scaledFloorHeight / 2;
10516
10535
  targetCameraRef.current = {
10517
10536
  x: centerX - viewportSize.width / 2,
10518
10537
  y: centerY - viewportSize.height / 2
10519
10538
  };
10520
- }, [selectedUnitId, units, scale, baseOffsetX, scaledTileWidth, scaledDiamondTopY, scaledFloorHeight, viewportSize, targetCameraRef]);
10539
+ }, [selectedUnitId, units, tileLayout, scale, baseOffsetX, scaledTileWidth, scaledDiamondTopY, scaledFloorHeight, viewportSize, targetCameraRef]);
10521
10540
  useEffect(() => {
10522
10541
  const hasAnimations = units.length > 0 || validMoves.length > 0 || attackTargets.length > 0 || selectedUnitId != null || targetCameraRef.current != null || hasActiveEffects2 || pendingCount > 0 || atlasPending > 0;
10523
10542
  draw(animTimeRef.current);
@@ -10550,13 +10569,13 @@ function IsometricCanvas({
10550
10569
  const world = screenToWorld(e.clientX, e.clientY, canvasRef.current, viewportSize);
10551
10570
  const adjustedX = world.x - scaledTileWidth / 2;
10552
10571
  const adjustedY = world.y - scaledDiamondTopY - scaledFloorHeight / 2;
10553
- const isoPos = screenToIso(adjustedX, adjustedY, scale, baseOffsetX);
10572
+ const isoPos = screenToIso(adjustedX, adjustedY, scale, baseOffsetX, tileLayout);
10554
10573
  const tileExists = tilesProp.some((t2) => t2.x === isoPos.x && t2.y === isoPos.y);
10555
10574
  if (tileExists) {
10556
10575
  if (tileHoverEvent) eventBus.emit(`UI:${tileHoverEvent}`, { x: isoPos.x, y: isoPos.y });
10557
10576
  onTileHover?.(isoPos.x, isoPos.y);
10558
10577
  }
10559
- }, [onTileHover, screenToWorld, viewportSize, scaledTileWidth, scaledDiamondTopY, scaledFloorHeight, scale, baseOffsetX, tilesProp, tileHoverEvent, eventBus]);
10578
+ }, [onTileHover, screenToWorld, viewportSize, scaledTileWidth, scaledDiamondTopY, scaledFloorHeight, tileLayout, scale, baseOffsetX, tilesProp, tileHoverEvent, eventBus]);
10560
10579
  const handleCanvasPointerUp = useCallback((e) => {
10561
10580
  singlePointerActiveRef.current = false;
10562
10581
  if (enableCamera) handlePointerUp();
@@ -10565,7 +10584,7 @@ function IsometricCanvas({
10565
10584
  const world = screenToWorld(e.clientX, e.clientY, canvasRef.current, viewportSize);
10566
10585
  const adjustedX = world.x - scaledTileWidth / 2;
10567
10586
  const adjustedY = world.y - scaledDiamondTopY - scaledFloorHeight / 2;
10568
- const isoPos = screenToIso(adjustedX, adjustedY, scale, baseOffsetX);
10587
+ const isoPos = screenToIso(adjustedX, adjustedY, scale, baseOffsetX, tileLayout);
10569
10588
  const clickedUnit = units.find((u) => u.position?.x === isoPos.x && u.position?.y === isoPos.y);
10570
10589
  if (clickedUnit && (onUnitClick || unitClickEvent)) {
10571
10590
  if (unitClickEvent) eventBus.emit(`UI:${unitClickEvent}`, { unitId: clickedUnit.id });
@@ -10577,7 +10596,7 @@ function IsometricCanvas({
10577
10596
  onTileClick?.(isoPos.x, isoPos.y);
10578
10597
  }
10579
10598
  }
10580
- }, [enableCamera, handlePointerUp, dragDistance, screenToWorld, viewportSize, scaledTileWidth, scaledDiamondTopY, scaledFloorHeight, scale, baseOffsetX, units, tilesProp, onUnitClick, onTileClick, unitClickEvent, tileClickEvent, eventBus]);
10599
+ }, [enableCamera, handlePointerUp, dragDistance, screenToWorld, viewportSize, scaledTileWidth, scaledDiamondTopY, scaledFloorHeight, tileLayout, scale, baseOffsetX, units, tilesProp, onUnitClick, onTileClick, unitClickEvent, tileClickEvent, eventBus]);
10581
10600
  const handleCanvasPointerLeave = useCallback(() => {
10582
10601
  handleMouseLeave();
10583
10602
  if (tileLeaveEvent) eventBus.emit(`UI:${tileLeaveEvent}`, {});
@@ -20519,6 +20538,8 @@ var init_ChartLegend = __esm({
20519
20538
  function ChoiceButton({
20520
20539
  text = "Charge forward into the fray",
20521
20540
  index,
20541
+ assetUrl,
20542
+ icon,
20522
20543
  disabled = false,
20523
20544
  selected = false,
20524
20545
  onClick,
@@ -20551,6 +20572,23 @@ function ChoiceButton({
20551
20572
  ]
20552
20573
  }
20553
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,
20554
20592
  /* @__PURE__ */ jsx("span", { className: "text-sm leading-snug", children: text })
20555
20593
  ]
20556
20594
  }
@@ -20559,6 +20597,7 @@ function ChoiceButton({
20559
20597
  var init_ChoiceButton = __esm({
20560
20598
  "components/game/atoms/ChoiceButton.tsx"() {
20561
20599
  init_cn();
20600
+ init_Icon();
20562
20601
  ChoiceButton.displayName = "ChoiceButton";
20563
20602
  }
20564
20603
  });
@@ -28672,6 +28711,7 @@ function PowerupSlots({
28672
28711
  /* @__PURE__ */ jsx(
28673
28712
  ItemSlot,
28674
28713
  {
28714
+ assetUrl: powerup.assetUrl,
28675
28715
  icon: powerup.icon,
28676
28716
  label: powerup.label,
28677
28717
  rarity: "uncommon",
@@ -28921,13 +28961,26 @@ function HealthPanel({
28921
28961
  )
28922
28962
  }
28923
28963
  ),
28924
- 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(
28925
28965
  Badge,
28926
28966
  {
28927
28967
  variant: effectVariantMap[effect.variant ?? "neutral"],
28928
28968
  size: "sm",
28929
- icon: effect.icon,
28930
- 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
+ ]
28931
28984
  },
28932
28985
  i
28933
28986
  )) })
@@ -29174,15 +29227,28 @@ function TurnPanel({
29174
29227
  activeTeam
29175
29228
  }
29176
29229
  ),
29177
- 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(
29178
29231
  Button,
29179
29232
  {
29180
29233
  variant: "ghost",
29181
29234
  size: "sm",
29182
29235
  disabled: action.disabled,
29183
- leftIcon: action.icon,
29236
+ leftIcon: action.assetUrl ? void 0 : action.icon,
29184
29237
  onClick: () => handleAction(action.event),
29185
- 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
+ ]
29186
29252
  },
29187
29253
  i
29188
29254
  )) })
@@ -30942,13 +31008,13 @@ var init_MapView = __esm({
30942
31008
  shadowSize: [41, 41]
30943
31009
  });
30944
31010
  L.Marker.prototype.options.icon = defaultIcon;
30945
- const { useEffect: useEffect83, useRef: useRef83, useCallback: useCallback127, useState: useState112 } = React79__default;
31011
+ const { useEffect: useEffect84, useRef: useRef83, useCallback: useCallback128, useState: useState114 } = React79__default;
30946
31012
  const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
30947
31013
  const { useEventBus: useEventBus3 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
30948
31014
  function MapUpdater({ centerLat, centerLng, zoom }) {
30949
31015
  const map = useMap();
30950
31016
  const prevRef = useRef83({ centerLat, centerLng, zoom });
30951
- useEffect83(() => {
31017
+ useEffect84(() => {
30952
31018
  const prev = prevRef.current;
30953
31019
  if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
30954
31020
  map.setView([centerLat, centerLng], zoom);
@@ -30959,7 +31025,7 @@ var init_MapView = __esm({
30959
31025
  }
30960
31026
  function MapClickHandler({ onMapClick }) {
30961
31027
  const map = useMap();
30962
- useEffect83(() => {
31028
+ useEffect84(() => {
30963
31029
  if (!onMapClick) return;
30964
31030
  const handler = (e) => {
30965
31031
  onMapClick(e.latlng.lat, e.latlng.lng);
@@ -30987,8 +31053,8 @@ var init_MapView = __esm({
30987
31053
  showAttribution = true
30988
31054
  }) {
30989
31055
  const eventBus = useEventBus3();
30990
- const [clickedPosition, setClickedPosition] = useState112(null);
30991
- const handleMapClick = useCallback127((lat, lng) => {
31056
+ const [clickedPosition, setClickedPosition] = useState114(null);
31057
+ const handleMapClick = useCallback128((lat, lng) => {
30992
31058
  if (showClickedPin) {
30993
31059
  setClickedPosition({ lat, lng });
30994
31060
  }
@@ -30997,7 +31063,7 @@ var init_MapView = __esm({
30997
31063
  eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
30998
31064
  }
30999
31065
  }, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
31000
- const handleMarkerClick = useCallback127((marker) => {
31066
+ const handleMarkerClick = useCallback128((marker) => {
31001
31067
  onMarkerClick?.(marker);
31002
31068
  if (markerClickEvent) {
31003
31069
  eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
@@ -44448,9 +44514,9 @@ var init_GameCanvas3D2 = __esm({
44448
44514
  const color = unit.faction === "player" ? 4491519 : unit.faction === "enemy" ? 16729156 : 16777028;
44449
44515
  const hasAtlas = unitAtlasUrl(unit) !== null;
44450
44516
  const initialFrame = hasAtlas ? resolveUnitFrame(unit.id) : null;
44451
- const modelScale = UNIT_BASE_MODEL_SCALE * unitScale;
44452
- const billboardHeight = UNIT_BASE_BILLBOARD_HEIGHT * unitScale;
44453
- 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;
44454
44520
  return /* @__PURE__ */ jsxs(
44455
44521
  "group",
44456
44522
  {
@@ -44497,7 +44563,7 @@ var init_GameCanvas3D2 = __esm({
44497
44563
  /* @__PURE__ */ jsx("meshStandardMaterial", { color })
44498
44564
  ] })
44499
44565
  ] }),
44500
- 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: [
44501
44567
  /* @__PURE__ */ jsxs("mesh", { position: [-0.25, 0, 0], children: [
44502
44568
  /* @__PURE__ */ jsx("planeGeometry", { args: [0.5, 0.05] }),
44503
44569
  /* @__PURE__ */ jsx("meshBasicMaterial", { color: 3355443 })
@@ -44526,7 +44592,7 @@ var init_GameCanvas3D2 = __esm({
44526
44592
  }
44527
44593
  );
44528
44594
  },
44529
- [selectedUnitId, handleUnitClick, resolveUnitFrame, unitScale]
44595
+ [selectedUnitId, handleUnitClick, resolveUnitFrame, unitScale, gridConfig]
44530
44596
  );
44531
44597
  const DefaultFeatureRenderer = useCallback(
44532
44598
  ({
@@ -44614,7 +44680,7 @@ var init_GameCanvas3D2 = __esm({
44614
44680
  {
44615
44681
  ref: containerRef,
44616
44682
  className: cn("game-canvas-3d relative w-full overflow-hidden", className),
44617
- style: { height: "85vh" },
44683
+ style: { flex: "1 1 0", minHeight: "400px" },
44618
44684
  "data-orientation": orientation,
44619
44685
  "data-camera-mode": cameraMode,
44620
44686
  "data-overlay": overlay,
@@ -44914,13 +44980,39 @@ var init_GameBoard3D = __esm({
44914
44980
  GameBoard3D.displayName = "GameBoard3D";
44915
44981
  }
44916
44982
  });
44917
- 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;
44918
45009
  var init_GameShell = __esm({
44919
45010
  "components/game/templates/GameShell.tsx"() {
44920
45011
  init_cn();
44921
45012
  init_Box();
44922
45013
  init_Stack();
44923
45014
  init_Typography();
45015
+ _scr = null;
44924
45016
  GameShell = ({
44925
45017
  appName = "Game",
44926
45018
  hud,
@@ -44969,7 +45061,7 @@ var init_GameShell = __esm({
44969
45061
  children: appName
44970
45062
  }
44971
45063
  ),
44972
- hud && /* @__PURE__ */ jsx(Box, { className: "game-shell__hud", children: hud })
45064
+ hud && /* @__PURE__ */ jsx(Box, { className: "game-shell__hud", children: resolveDescriptor(hud, "gs-hud") })
44973
45065
  ]
44974
45066
  }
44975
45067
  ),
@@ -44982,7 +45074,7 @@ var init_GameShell = __esm({
44982
45074
  overflow: "hidden",
44983
45075
  position: "relative"
44984
45076
  },
44985
- children
45077
+ children: resolveDescriptor(children, "gs-children")
44986
45078
  }
44987
45079
  )
44988
45080
  ]
@@ -44992,7 +45084,32 @@ var init_GameShell = __esm({
44992
45084
  GameShell.displayName = "GameShell";
44993
45085
  }
44994
45086
  });
44995
- 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;
44996
45113
  var init_GameTemplate = __esm({
44997
45114
  "components/game/templates/GameTemplate.tsx"() {
44998
45115
  init_cn();
@@ -45000,6 +45117,7 @@ var init_GameTemplate = __esm({
45000
45117
  init_Stack();
45001
45118
  init_Typography();
45002
45119
  init_Button();
45120
+ _scr2 = null;
45003
45121
  GameTemplate = ({
45004
45122
  entity,
45005
45123
  title = "Game",
@@ -45067,13 +45185,13 @@ var init_GameTemplate = __esm({
45067
45185
  fullWidth: true,
45068
45186
  className: "flex-1 bg-muted",
45069
45187
  children: [
45070
- children,
45188
+ resolveDescriptor2(children, "gt-children"),
45071
45189
  hud && /* @__PURE__ */ jsx(
45072
45190
  Box,
45073
45191
  {
45074
45192
  position: "absolute",
45075
45193
  className: "top-0 left-0 right-0 pointer-events-none",
45076
- 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") })
45077
45195
  }
45078
45196
  )
45079
45197
  ]
@@ -45098,7 +45216,7 @@ var init_GameTemplate = __esm({
45098
45216
  children: /* @__PURE__ */ jsx(Typography, { variant: "h6", children: "Debug Panel" })
45099
45217
  }
45100
45218
  ),
45101
- /* @__PURE__ */ jsx(Box, { padding: "md", children: debugPanel })
45219
+ /* @__PURE__ */ jsx(Box, { padding: "md", children: resolveDescriptor2(debugPanel, "gt-debug") })
45102
45220
  ]
45103
45221
  }
45104
45222
  )
@@ -45268,6 +45386,48 @@ var init_HeroOrganism = __esm({
45268
45386
  _HeroClickInterceptor.displayName = "_HeroClickInterceptor";
45269
45387
  }
45270
45388
  });
45389
+ function HexStrategyBoard({
45390
+ tiles,
45391
+ units,
45392
+ features,
45393
+ assetManifest,
45394
+ assetBaseUrl,
45395
+ scale = 0.45,
45396
+ showMinimap = true,
45397
+ enableCamera = true,
45398
+ tileClickEvent,
45399
+ unitClickEvent,
45400
+ isLoading,
45401
+ error,
45402
+ className
45403
+ }) {
45404
+ return /* @__PURE__ */ jsx("div", { className: cn("hex-strategy-board relative w-full h-full", className), children: /* @__PURE__ */ jsx(
45405
+ IsometricCanvas_default,
45406
+ {
45407
+ tileLayout: "hex",
45408
+ tiles,
45409
+ units,
45410
+ features,
45411
+ assetManifest,
45412
+ assetBaseUrl,
45413
+ scale,
45414
+ showMinimap,
45415
+ enableCamera,
45416
+ tileClickEvent,
45417
+ unitClickEvent,
45418
+ isLoading,
45419
+ error
45420
+ }
45421
+ ) });
45422
+ }
45423
+ var init_HexStrategyBoard = __esm({
45424
+ "components/game/organisms/HexStrategyBoard.tsx"() {
45425
+ "use client";
45426
+ init_cn();
45427
+ init_IsometricCanvas();
45428
+ HexStrategyBoard.displayName = "HexStrategyBoard";
45429
+ }
45430
+ });
45271
45431
  var LandingPageTemplate;
45272
45432
  var init_LandingPageTemplate = __esm({
45273
45433
  "components/marketing/templates/LandingPageTemplate.tsx"() {
@@ -53576,6 +53736,7 @@ var init_component_registry_generated = __esm({
53576
53736
  init_HealthPanel();
53577
53737
  init_HeroOrganism();
53578
53738
  init_HeroSection();
53739
+ init_HexStrategyBoard();
53579
53740
  init_Icon();
53580
53741
  init_InfiniteScrollSentinel();
53581
53742
  init_Input();
@@ -53912,6 +54073,7 @@ var init_component_registry_generated = __esm({
53912
54073
  "HealthPanel": HealthPanel,
53913
54074
  "HeroOrganism": HeroOrganism,
53914
54075
  "HeroSection": HeroSection,
54076
+ "HexStrategyBoard": HexStrategyBoard,
53915
54077
  "Icon": Icon,
53916
54078
  "InfiniteScrollSentinel": InfiniteScrollSentinel,
53917
54079
  "Input": Input,
@@ -54113,8 +54275,8 @@ function getSlotFallback(slot, config) {
54113
54275
  const variant = SLOT_SKELETON_MAP[slot] ?? "text";
54114
54276
  return /* @__PURE__ */ jsx(Skeleton, { variant });
54115
54277
  }
54116
- function getComponentForPattern(patternType) {
54117
- const mapping = getComponentForPattern$1(patternType);
54278
+ function getComponentForPattern3(patternType) {
54279
+ const mapping = getComponentForPattern(patternType);
54118
54280
  if (!mapping) {
54119
54281
  return null;
54120
54282
  }
@@ -54636,7 +54798,7 @@ function isPatternConfig(value) {
54636
54798
  if (value instanceof Date) return false;
54637
54799
  if (typeof value === "function") return false;
54638
54800
  const record = value;
54639
- 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;
54640
54802
  }
54641
54803
  function isPlainConfigObject(value) {
54642
54804
  if (React79__default.isValidElement(value)) return false;
@@ -54744,7 +54906,8 @@ function SlotContentRenderer({
54744
54906
  entityDef = schemaCtx.entities.get(linkedEntity);
54745
54907
  }
54746
54908
  }
54747
- 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);
54748
54911
  if (PatternComponent) {
54749
54912
  const childrenConfig = content.props.children;
54750
54913
  const isSingleChild = typeof childrenConfig === "string" || typeof childrenConfig === "object" && childrenConfig !== null && !Array.isArray(childrenConfig) && "type" in childrenConfig;
@@ -54842,6 +55005,7 @@ function SlotContentRenderer({
54842
55005
  "data-orb-entity": content.entity,
54843
55006
  "data-orb-path": myPath,
54844
55007
  "data-orb-pattern": content.pattern,
55008
+ "data-orb-orbital": orbitalName,
54845
55009
  children: renderedChildren !== void 0 ? /* @__PURE__ */ jsx(PatternComponent, { ...finalProps, children: renderedChildren }) : /* @__PURE__ */ jsx(PatternComponent, { ...finalProps })
54846
55010
  }
54847
55011
  );
@@ -54861,6 +55025,7 @@ function SlotContentRenderer({
54861
55025
  "data-orb-entity": content.entity,
54862
55026
  "data-orb-path": patternPath ?? "root",
54863
55027
  "data-orb-pattern": content.pattern,
55028
+ "data-orb-orbital": orbitalName,
54864
55029
  children: content.props.children ?? /* @__PURE__ */ jsxs(Box, { className: "p-4 text-sm text-muted-foreground border border-dashed border-border rounded", children: [
54865
55030
  "Unknown pattern: ",
54866
55031
  content.pattern,
@@ -55030,7 +55195,7 @@ function TraitFrame({
55030
55195
  if (!content) {
55031
55196
  return /* @__PURE__ */ jsx(Fragment, { children: fallback });
55032
55197
  }
55033
- const SlotContentRenderer2 = getSlotContentRenderer();
55198
+ const SlotContentRenderer2 = getSlotContentRenderer3();
55034
55199
  const rendered = /* @__PURE__ */ jsx(
55035
55200
  SlotContentRenderer2,
55036
55201
  {
@@ -55044,7 +55209,7 @@ function TraitFrame({
55044
55209
  }
55045
55210
  return /* @__PURE__ */ jsx(TraitScopeProvider, { orbital, trait: traitName, children: rendered });
55046
55211
  }
55047
- function getSlotContentRenderer() {
55212
+ function getSlotContentRenderer3() {
55048
55213
  if (_slotContentRenderer) return _slotContentRenderer;
55049
55214
  const mod = (init_UISlotRenderer(), __toCommonJS(UISlotRenderer_exports));
55050
55215
  _slotContentRenderer = mod.SlotContentRenderer;
@@ -55557,6 +55722,7 @@ init_CityBuilderBoard();
55557
55722
  init_GameBoard3D();
55558
55723
  init_VisualNovelBoard();
55559
55724
  init_CardBattlerBoard();
55725
+ init_HexStrategyBoard();
55560
55726
  init_TraitStateViewer();
55561
55727
  init_TraitSlot();
55562
55728
 
@@ -56119,6 +56285,1023 @@ init_CaseStudyOrganism();
56119
56285
  init_CodeRunnerPanel();
56120
56286
  init_SegmentRenderer();
56121
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
+
56122
57305
  // components/core/templates/index.ts
56123
57306
  init_DashboardLayout();
56124
57307
  init_AuthLayout();
@@ -56144,4 +57327,4 @@ init_AboutPageTemplate();
56144
57327
  // components/index.ts
56145
57328
  init_cn();
56146
57329
 
56147
- 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, 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 };