@almadar/ui 2.13.1 → 2.13.3

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.
@@ -8,8 +8,8 @@ import { E as EventBusContextType } from '../event-bus-types-CjJduURa.js';
8
8
  export { a as EventListener, K as KFlowEvent, U as Unsubscribe } from '../event-bus-types-CjJduURa.js';
9
9
  import { I as IsometricTile, a as IsometricUnit, b as IsometricFeature, C as CameraState } from '../isometric-ynNHVPZx.js';
10
10
  import { OrbitalEntity } from '@almadar/core';
11
- import { c as DomLayoutData, e as DomStateNode, n as VisualizerConfig, f as DomTransitionLabel, a as ContentSegment } from '../parseContentSegments-BZrQRvgK.js';
12
- export { s as cn } from '../parseContentSegments-BZrQRvgK.js';
11
+ import { c as DomLayoutData, e as DomStateNode, n as VisualizerConfig, f as DomTransitionLabel, a as ContentSegment } from '../cn-C_ATNPvi.js';
12
+ export { s as cn } from '../cn-C_ATNPvi.js';
13
13
  import { S as SlotContent, a as UISlot } from '../useUISlots-BBjNvQtb.js';
14
14
  export { D as DEFAULT_SLOTS, R as RenderUIConfig, b as SlotAnimation, c as SlotChangeCallback, U as UISlotManager, u as useUISlotManager } from '../useUISlots-BBjNvQtb.js';
15
15
  export { Entity, clearEntities, getAllEntities, getByType, getEntity, getSingleton, removeEntity, spawnEntity, updateEntity, updateSingleton } from '../stores/index.js';
@@ -8751,8 +8751,36 @@ type GameAction = {
8751
8751
  } | {
8752
8752
  type: 'EXECUTE_TRAITS';
8753
8753
  };
8754
+ /**
8755
+ * Create the initial game state with board and units.
8756
+ *
8757
+ * @param {number} width - Board width in tiles
8758
+ * @param {number} height - Board height in tiles
8759
+ * @param {GameUnit[]} units - Initial units to place on the board
8760
+ * @param {string} [defaultTerrain] - Default terrain type for empty tiles
8761
+ * @returns {GameState} The initialized game state
8762
+ */
8754
8763
  declare function createInitialGameState(width: number, height: number, units: GameUnit[], defaultTerrain?: string): GameState;
8764
+ /**
8765
+ * Calculate valid movement positions for a unit.
8766
+ *
8767
+ * Returns all tiles within the unit's movement range that are
8768
+ * not blocked and don't contain other units.
8769
+ *
8770
+ * @param {GameState} state - Current game state
8771
+ * @param {string} unitId - ID of the unit to calculate moves for
8772
+ * @returns {Position[]} Array of valid move positions
8773
+ */
8755
8774
  declare function calculateValidMoves(state: GameState, unitId: string): Position[];
8775
+ /**
8776
+ * Calculate valid attack targets for a unit.
8777
+ *
8778
+ * Returns adjacent positions containing enemy units that can be attacked.
8779
+ *
8780
+ * @param {GameState} state - Current game state
8781
+ * @param {string} unitId - ID of the unit to calculate targets for
8782
+ * @returns {Position[]} Array of valid attack target positions
8783
+ */
8756
8784
  declare function calculateAttackTargets(state: GameState, unitId: string): Position[];
8757
8785
 
8758
8786
  /**
@@ -8782,6 +8810,16 @@ interface CombatEffect {
8782
8810
  sound?: string;
8783
8811
  }
8784
8812
  declare const combatEffects: Record<string, CombatEffect>;
8813
+ /**
8814
+ * Apply a temporary combat effect to an HTML element.
8815
+ *
8816
+ * Adds the effect's CSS class to the element and removes it after
8817
+ * the effect duration completes.
8818
+ *
8819
+ * @param {HTMLElement} element - The DOM element to apply the effect to
8820
+ * @param {CombatEffect} effect - The combat effect to apply
8821
+ * @param {() => void} [onComplete] - Optional callback when effect completes
8822
+ */
8785
8823
  declare function applyTemporaryEffect(element: HTMLElement, effect: CombatEffect, onComplete?: () => void): void;
8786
8824
  interface DamageResult {
8787
8825
  baseDamage: number;
@@ -8790,6 +8828,15 @@ interface DamageResult {
8790
8828
  isBlocked: boolean;
8791
8829
  damageReduction: number;
8792
8830
  }
8831
+ /**
8832
+ * Calculate combat damage with defense and critical hit mechanics.
8833
+ *
8834
+ * @param {number} attack - Attacker's attack power
8835
+ * @param {number} defense - Defender's defense power
8836
+ * @param {boolean} [isDefending] - Whether defender is in defend stance (doubles defense)
8837
+ * @param {number} [criticalChance] - Probability of critical hit (0-1, default 0.1)
8838
+ * @returns {DamageResult} Calculated damage with critical/block info
8839
+ */
8793
8840
  declare function calculateDamage(attack: number, defense: number, isDefending?: boolean, criticalChance?: number): DamageResult;
8794
8841
  type CombatEventType = 'attack' | 'critical' | 'defend' | 'heal' | 'defeat' | 'level_up' | 'state_change';
8795
8842
  interface CombatEventData {
@@ -1,20 +1,20 @@
1
- import { DEFAULT_CONFIG, renderStateMachineToDomData, parseContentSegments, isDebugEnabled, onDebugToggle, subscribeToTickChanges, subscribeToGuardChanges, subscribeToDebugEvents, getEntitySnapshot, getDebugEvents, getGuardHistory, getAllTicks } from '../chunk-MNMASFYN.js';
2
- import { useAuthContext } from '../chunk-X2ZDE63F.js';
3
- export { ENTITY_EVENTS, useAgentChat, useAuthContext, useCompile, useConnectGitHub, useCreateEntity, useDeepAgentGeneration, useDeleteEntity, useDisconnectGitHub, useEntities, useEntitiesByType, useEntity as useEntityById, useEntityMutations, useExtensions, useFileEditor, useFileSystem, useGitHubBranches, useGitHubRepo, useGitHubRepos, useGitHubStatus, useInput, useOrbitalHistory, useOrbitalMutations, usePhysics, usePinchZoom, usePlayer, usePreview, useResolvedEntity, useSelectedEntity, useSendOrbitalEvent, useSingletonEntity, useUIEvents, useUpdateEntity, useValidation } from '../chunk-X2ZDE63F.js';
1
+ import { DEFAULT_CONFIG, renderStateMachineToDomData, parseContentSegments, isDebugEnabled, onDebugToggle, subscribeToTickChanges, subscribeToGuardChanges, subscribeToDebugEvents, getEntitySnapshot, getDebugEvents, getGuardHistory, getAllTicks } from '../chunk-4ZBSL37D.js';
2
+ import { useAuthContext } from '../chunk-PERGHHON.js';
3
+ export { ENTITY_EVENTS, useAgentChat, useAuthContext, useCompile, useConnectGitHub, useCreateEntity, useDeepAgentGeneration, useDeleteEntity, useDisconnectGitHub, useEntities, useEntitiesByType, useEntity as useEntityById, useEntityMutations, useExtensions, useFileEditor, useFileSystem, useGitHubBranches, useGitHubRepo, useGitHubRepos, useGitHubStatus, useInput, useOrbitalHistory, useOrbitalMutations, usePhysics, usePinchZoom, usePlayer, usePreview, useResolvedEntity, useSelectedEntity, useSendOrbitalEvent, useSingletonEntity, useUIEvents, useUpdateEntity, useValidation } from '../chunk-PERGHHON.js';
4
4
  export { clearEntities, getAllEntities, getByType, getEntity, getSingleton, removeEntity, spawnEntity, updateEntity, updateSingleton } from '../chunk-N7MVUW4R.js';
5
5
  import { subscribeToTraitChanges, getAllTraits } from '../chunk-42YQ6JVR.js';
6
6
  import '../chunk-3HJHHULT.js';
7
- import { VStack, HStack, Typography, Button, Icon, Box, Card, Avatar, Badge, SearchInput, Checkbox, Menu as Menu$1, Pagination, LoadingState, EmptyState, Modal, ErrorState, QuizBlock, CodeBlock, ScaledDiagram, MarkdownContent, Divider, ProgressBar, isoToScreen, IsometricCanvas_default, Stack, Select, Drawer, Toast, Tabs, Input, ThemeToggle, TILE_WIDTH, EntityDisplayEvents, StateIndicator, Accordion, ButtonGroup, Container } from '../chunk-YYCP5CD7.js';
8
- export { ALL_PRESETS, Accordion, ActionButton, ActionButtons, Card2 as ActionCard, Alert, AnimatedCounter, Avatar, Badge, Box, Breadcrumb, Button, ButtonGroup, CalendarGrid, CanvasEffect, Card, CardBody, CardContent, CardFooter, CardGrid, CardHeader, CardTitle, Carousel, Center, Chart, ChartLegend, Checkbox, ChoiceButton, CodeBlock, CombatLog, ComboCounter, ConditionalWrapper, ConfettiEffect, Container, ControlButton, CraftingRecipe, DIAMOND_TOP_Y, DPad, DamageNumber, DataGrid, DataList, DataTable, DateRangeSelector, DayCell, DetailPanel, DialogueBox, DialogueBubble, Divider, Drawer, EmptyState, EnemyPlate, EntityDisplayEvents, ErrorBoundary, ErrorState, FEATURE_COLORS, FLOOR_HEIGHT, FilterGroup, Flex, FlipCard, FlipContainer, FloatingActionButton, Form, FormField, FormSectionHeader, GameCanvas2D, GameHud, GameMenu, GameOverScreen, GraphView, Grid, HStack, Heading, HealthBar, HealthPanel, Icon, InfiniteScrollSentinel, Input, InputGroup, InventoryGrid, InventoryPanel, IsometricCanvas, ItemSlot, Label, LawReferenceTooltip, Lightbox, LineChart, LoadingState, MapView, MarkdownContent, MasterDetail, Menu, Meter, MiniMap, Modal, NumberStepper, Overlay, PageHeader, Pagination, PlatformerCanvas, Popover, PowerupSlots, ProgressBar, ProgressDots, PullToRefresh, QuestTracker, QuizBlock, Radio, RangeSlider, RelationSelect, RepeatableFormSection, ResourceBar, ResourceCounter, ScaledDiagram, ScoreBoard, ScoreDisplay, SearchInput, Select, SidePanel, SimpleGrid, SimulationCanvas, SimulationControls, SimulationGraph, Skeleton, SlotContentRenderer, SortableList, Spacer, Spinner, Sprite, Stack, StarRating, StatBadge, StatCard, StatDisplay, StateIndicator, StatusDot, StatusEffect, SwipeableRow, Switch, TILE_HEIGHT, TILE_WIDTH, Tabs, Text, TextHighlight, Textarea, ThemeSelector, ThemeToggle, TimeSlotCell, TimerDisplay, Toast, Tooltip, TrendIndicator, TurnIndicator, TurnPanel, TypewriterText, Typography, UISlotComponent, UISlotRenderer, UnitCommandBar, UploadDropZone, VStack, ViolationAlert, WaypointMarker, WizardNavigation, WizardProgress, XPBar, drawSprite, isoToScreen, pendulum, projectileMotion, screenToIso, springOscillator, useCamera, useImageCache } from '../chunk-YYCP5CD7.js';
9
- import '../chunk-YLKXEXBP.js';
10
- import { useTranslate } from '../chunk-3CP74CBL.js';
11
- export { EntityDataProvider, I18nProvider, createTranslate, entityDataKeys, parseQueryBinding, useDragReorder, useEntity, useEntityDataAdapter, useEntityDetail, useEntityList, useEntityListSuspense, useEntitySuspense, useInfiniteScroll, useLongPress, usePullToRefresh, useQuerySingleton, useSwipeGesture, useTranslate } from '../chunk-3CP74CBL.js';
7
+ import { VStack, HStack, Typography, Button, Icon, Box, Card, Avatar, Badge, SearchInput, Checkbox, Menu as Menu$1, Pagination, LoadingState, EmptyState, Modal, ErrorState, QuizBlock, CodeBlock, ScaledDiagram, MarkdownContent, Divider, ProgressBar, isoToScreen, IsometricCanvas_default, Stack, Select, Drawer, Toast, Tabs, Input, ThemeToggle, TILE_WIDTH, EntityDisplayEvents, StateIndicator, Accordion, ButtonGroup, Container } from '../chunk-MSLMORZK.js';
8
+ export { ALL_PRESETS, Accordion, ActionButton, ActionButtons, Card2 as ActionCard, Alert, AnimatedCounter, Avatar, Badge, Box, Breadcrumb, Button, ButtonGroup, CalendarGrid, CanvasEffect, Card, CardBody, CardContent, CardFooter, CardGrid, CardHeader, CardTitle, Carousel, Center, Chart, ChartLegend, Checkbox, ChoiceButton, CodeBlock, CombatLog, ComboCounter, ConditionalWrapper, ConfettiEffect, Container, ControlButton, CraftingRecipe, DIAMOND_TOP_Y, DPad, DamageNumber, DataGrid, DataList, DataTable, DateRangeSelector, DayCell, DetailPanel, DialogueBox, DialogueBubble, Divider, Drawer, EmptyState, EnemyPlate, EntityDisplayEvents, ErrorBoundary, ErrorState, FEATURE_COLORS, FLOOR_HEIGHT, FilterGroup, Flex, FlipCard, FlipContainer, FloatingActionButton, Form, FormField, FormSectionHeader, GameCanvas2D, GameHud, GameMenu, GameOverScreen, GraphView, Grid, HStack, Heading, HealthBar, HealthPanel, Icon, InfiniteScrollSentinel, Input, InputGroup, InventoryGrid, InventoryPanel, IsometricCanvas, ItemSlot, Label, LawReferenceTooltip, Lightbox, LineChart, LoadingState, MapView, MarkdownContent, MasterDetail, Menu, Meter, MiniMap, Modal, NumberStepper, Overlay, PageHeader, Pagination, PlatformerCanvas, Popover, PowerupSlots, ProgressBar, ProgressDots, PullToRefresh, QuestTracker, QuizBlock, Radio, RangeSlider, RelationSelect, RepeatableFormSection, ResourceBar, ResourceCounter, ScaledDiagram, ScoreBoard, ScoreDisplay, SearchInput, Select, SidePanel, SimpleGrid, SimulationCanvas, SimulationControls, SimulationGraph, Skeleton, SlotContentRenderer, SortableList, Spacer, Spinner, Sprite, Stack, StarRating, StatBadge, StatCard, StatDisplay, StateIndicator, StatusDot, StatusEffect, SwipeableRow, Switch, TILE_HEIGHT, TILE_WIDTH, Tabs, Text, TextHighlight, Textarea, ThemeSelector, ThemeToggle, TimeSlotCell, TimerDisplay, Toast, Tooltip, TrendIndicator, TurnIndicator, TurnPanel, TypewriterText, Typography, UISlotComponent, UISlotRenderer, UnitCommandBar, UploadDropZone, VStack, ViolationAlert, WaypointMarker, WizardNavigation, WizardProgress, XPBar, drawSprite, isoToScreen, pendulum, projectileMotion, screenToIso, springOscillator, useCamera, useImageCache } from '../chunk-MSLMORZK.js';
9
+ import '../chunk-DKQN5FVU.js';
10
+ import { useTranslate } from '../chunk-Y7IHEYYE.js';
11
+ export { EntityDataProvider, I18nProvider, createTranslate, entityDataKeys, parseQueryBinding, useDragReorder, useEntity, useEntityDataAdapter, useEntityDetail, useEntityList, useEntityListSuspense, useEntitySuspense, useInfiniteScroll, useLongPress, usePullToRefresh, useQuerySingleton, useSwipeGesture, useTranslate } from '../chunk-Y7IHEYYE.js';
12
12
  import { useEventBus, useEventListener } from '../chunk-YXZM3WCF.js';
13
13
  export { useEmitEvent, useEventBus, useEventListener } from '../chunk-YXZM3WCF.js';
14
14
  export { DEFAULT_SLOTS, useUISlotManager } from '../chunk-3JGAROCW.js';
15
- import '../chunk-2XXSUIOK.js';
16
15
  import { cn, getNestedValue, subscribeToVerification, getSummary, getBridgeHealth, getTransitions, getAllChecks } from '../chunk-WCTZ7WZX.js';
17
16
  export { cn } from '../chunk-WCTZ7WZX.js';
17
+ import '../chunk-2XXSUIOK.js';
18
18
  import '../chunk-K2D5D3WK.js';
19
19
  import { __publicField } from '../chunk-PKBMQBKP.js';
20
20
  import * as React44 from 'react';
@@ -1,5 +1,5 @@
1
- import { ThemeProvider, useTheme } from '../chunk-YLKXEXBP.js';
2
- export { BUILT_IN_THEMES, ThemeContext_default as ThemeContext, ThemeProvider, UISlotContext, UISlotProvider, useSlotContent, useSlotHasContent, useTheme, useUISlots } from '../chunk-YLKXEXBP.js';
1
+ import { ThemeProvider, useTheme } from '../chunk-DKQN5FVU.js';
2
+ export { BUILT_IN_THEMES, ThemeContext_default as ThemeContext, ThemeProvider, UISlotContext, UISlotProvider, useSlotContent, useSlotHasContent, useTheme, useUISlots } from '../chunk-DKQN5FVU.js';
3
3
  import '../chunk-3JGAROCW.js';
4
4
  import '../chunk-PKBMQBKP.js';
5
5
  import { createContext, useCallback, useMemo, useContext } from 'react';
@@ -7,6 +7,67 @@ import React__default, { ReactNode } from 'react';
7
7
  import * as _tanstack_react_query from '@tanstack/react-query';
8
8
  import { Entity, getEntity, getByType, getAllEntities, getSingleton, spawnEntity, updateEntity, updateSingleton, removeEntity, clearEntities } from '../stores/index.js';
9
9
 
10
+ declare global {
11
+ interface Window {
12
+ __kflowEventBus?: EventBusContextType | null;
13
+ }
14
+ }
15
+ /**
16
+ * Hook for accessing the event bus.
17
+ *
18
+ * Uses EventBusProvider context if available, otherwise falls back to
19
+ * a simple in-memory event bus (for design system / Storybook).
20
+ *
21
+ * @returns Event bus instance with emit, on, once, and hasListeners methods
22
+ *
23
+ * @example
24
+ * ```tsx
25
+ * const eventBus = useEventBus();
26
+ *
27
+ * // Emit an event
28
+ * eventBus.emit('UI:CLICK', { id: '123' });
29
+ *
30
+ * // Subscribe to an event
31
+ * useEffect(() => {
32
+ * return eventBus.on('UI:CLICK', (event) => {
33
+ * console.log('Clicked:', event.payload);
34
+ * });
35
+ * }, []);
36
+ * ```
37
+ */
38
+ declare function useEventBus(): EventBusContextType;
39
+ /**
40
+ * Hook for subscribing to a specific event.
41
+ * Automatically cleans up subscription on unmount.
42
+ *
43
+ * @param event - Event name to subscribe to
44
+ * @param handler - Event handler function
45
+ *
46
+ * @example
47
+ * ```tsx
48
+ * useEventListener('UI:CLICK', (event) => {
49
+ * console.log('Clicked:', event.payload);
50
+ * });
51
+ * ```
52
+ */
53
+ declare function useEventListener(event: string, handler: EventListener): void;
54
+ /**
55
+ * Hook for emitting events.
56
+ * Returns a memoized emit function.
57
+ *
58
+ * @returns Function to emit events
59
+ *
60
+ * @example
61
+ * ```tsx
62
+ * const emit = useEmitEvent();
63
+ *
64
+ * const handleClick = () => {
65
+ * emit('UI:CLICK', { id: '123' });
66
+ * };
67
+ * ```
68
+ */
69
+ declare function useEmitEvent(): (type: string, payload?: Record<string, unknown>) => void;
70
+
10
71
  interface ChangeSummary {
11
72
  added: number;
12
73
  modified: number;
@@ -427,67 +488,6 @@ interface UseValidationResult {
427
488
  }
428
489
  declare function useValidation(): UseValidationResult;
429
490
 
430
- declare global {
431
- interface Window {
432
- __kflowEventBus?: EventBusContextType | null;
433
- }
434
- }
435
- /**
436
- * Hook for accessing the event bus.
437
- *
438
- * Uses EventBusProvider context if available, otherwise falls back to
439
- * a simple in-memory event bus (for design system / Storybook).
440
- *
441
- * @returns Event bus instance with emit, on, once, and hasListeners methods
442
- *
443
- * @example
444
- * ```tsx
445
- * const eventBus = useEventBus();
446
- *
447
- * // Emit an event
448
- * eventBus.emit('UI:CLICK', { id: '123' });
449
- *
450
- * // Subscribe to an event
451
- * useEffect(() => {
452
- * return eventBus.on('UI:CLICK', (event) => {
453
- * console.log('Clicked:', event.payload);
454
- * });
455
- * }, []);
456
- * ```
457
- */
458
- declare function useEventBus(): EventBusContextType;
459
- /**
460
- * Hook for subscribing to a specific event.
461
- * Automatically cleans up subscription on unmount.
462
- *
463
- * @param event - Event name to subscribe to
464
- * @param handler - Event handler function
465
- *
466
- * @example
467
- * ```tsx
468
- * useEventListener('UI:CLICK', (event) => {
469
- * console.log('Clicked:', event.payload);
470
- * });
471
- * ```
472
- */
473
- declare function useEventListener(event: string, handler: EventListener): void;
474
- /**
475
- * Hook for emitting events.
476
- * Returns a memoized emit function.
477
- *
478
- * @returns Function to emit events
479
- *
480
- * @example
481
- * ```tsx
482
- * const emit = useEmitEvent();
483
- *
484
- * const handleClick = () => {
485
- * emit('UI:CLICK', { id: '123' });
486
- * };
487
- * ```
488
- */
489
- declare function useEmitEvent(): (type: string, payload?: Record<string, unknown>) => void;
490
-
491
491
  /**
492
492
  * Hook to bridge UI events to state machine dispatch
493
493
  *
@@ -1,7 +1,7 @@
1
- export { ENTITY_EVENTS, useAgentChat, useAuthContext, useCompile, useConnectGitHub, useCreateEntity, useDeepAgentGeneration, useDeleteEntity, useDisconnectGitHub, useEntities, useEntitiesByType, useEntity as useEntityById, useEntityMutations, useExtensions, useFileEditor, useFileSystem, useGitHubBranches, useGitHubRepo, useGitHubRepos, useGitHubStatus, useInput, useOrbitalHistory, useOrbitalMutations, usePhysics, usePinchZoom, usePlayer, usePreview, useResolvedEntity, useSelectedEntity, useSendOrbitalEvent, useSingletonEntity, useUIEvents, useUpdateEntity, useValidation } from '../chunk-X2ZDE63F.js';
1
+ export { ENTITY_EVENTS, useAgentChat, useAuthContext, useCompile, useConnectGitHub, useCreateEntity, useDeepAgentGeneration, useDeleteEntity, useDisconnectGitHub, useEntities, useEntitiesByType, useEntity as useEntityById, useEntityMutations, useExtensions, useFileEditor, useFileSystem, useGitHubBranches, useGitHubRepo, useGitHubRepos, useGitHubStatus, useInput, useOrbitalHistory, useOrbitalMutations, usePhysics, usePinchZoom, usePlayer, usePreview, useResolvedEntity, useSelectedEntity, useSendOrbitalEvent, useSingletonEntity, useUIEvents, useUpdateEntity, useValidation } from '../chunk-PERGHHON.js';
2
2
  export { clearEntities, getAllEntities, getByType, getEntity, getSingleton, removeEntity, spawnEntity, updateEntity, updateSingleton } from '../chunk-N7MVUW4R.js';
3
3
  import '../chunk-3HJHHULT.js';
4
- export { EntityDataProvider, I18nProvider, createTranslate, entityDataKeys, parseQueryBinding, useDragReorder, useEntity, useEntityDataAdapter, useEntityDetail, useEntityList, useEntityListSuspense, useEntitySuspense, useInfiniteScroll, useLongPress, usePullToRefresh, useQuerySingleton, useSwipeGesture, useTranslate } from '../chunk-3CP74CBL.js';
4
+ export { EntityDataProvider, I18nProvider, createTranslate, entityDataKeys, parseQueryBinding, useDragReorder, useEntity, useEntityDataAdapter, useEntityDetail, useEntityList, useEntityListSuspense, useEntitySuspense, useInfiniteScroll, useLongPress, usePullToRefresh, useQuerySingleton, useSwipeGesture, useTranslate } from '../chunk-Y7IHEYYE.js';
5
5
  export { useEmitEvent, useEventBus, useEventListener } from '../chunk-YXZM3WCF.js';
6
6
  export { DEFAULT_SLOTS, useUISlotManager } from '../chunk-3JGAROCW.js';
7
7
  import '../chunk-2XXSUIOK.js';
@@ -1,6 +1,179 @@
1
- export { A as AssetLoadStatus, B as BridgeHealth, C as CheckStatus, a as ContentSegment, D as DEFAULT_CONFIG, b as DomEntityBox, c as DomLayoutData, d as DomOutputsBox, e as DomStateNode, f as DomTransitionLabel, g as DomTransitionPath, E as EffectTrace, h as EntityDefinition, i as EventLogEntry, R as RenderOptions, S as StateDefinition, j as StateMachineDefinition, T as TransitionDefinition, k as TransitionTrace, V as VerificationCheck, l as VerificationSnapshot, m as VerificationSummary, n as VisualizerConfig, o as bindCanvasCapture, p as bindEventBus, q as bindTraitStateGetter, r as clearVerification, s as cn, t as extractOutputsFromTransitions, u as extractStateMachine, v as formatGuard, w as getAllChecks, x as getBridgeHealth, y as getEffectSummary, z as getSnapshot, F as getSummary, G as getTransitions, H as getTransitionsForTrait, I as parseContentSegments, J as parseMarkdownWithCodeBlocks, K as recordTransition, L as registerCheck, M as renderStateMachineToDomData, N as renderStateMachineToSvg, O as subscribeToVerification, P as updateAssetStatus, Q as updateBridgeHealth, U as updateCheck, W as waitForTransition } from '../parseContentSegments-BZrQRvgK.js';
1
+ export { A as AssetLoadStatus, B as BridgeHealth, C as CheckStatus, a as ContentSegment, D as DEFAULT_CONFIG, b as DomEntityBox, c as DomLayoutData, d as DomOutputsBox, e as DomStateNode, f as DomTransitionLabel, g as DomTransitionPath, E as EffectTrace, h as EntityDefinition, i as EventLogEntry, R as RenderOptions, S as StateDefinition, j as StateMachineDefinition, T as TransitionDefinition, k as TransitionTrace, V as VerificationCheck, l as VerificationSnapshot, m as VerificationSummary, n as VisualizerConfig, o as bindCanvasCapture, p as bindEventBus, q as bindTraitStateGetter, r as clearVerification, s as cn, t as extractOutputsFromTransitions, u as extractStateMachine, v as formatGuard, w as getAllChecks, x as getBridgeHealth, y as getEffectSummary, z as getSnapshot, F as getSummary, G as getTransitions, H as getTransitionsForTrait, I as parseContentSegments, J as parseMarkdownWithCodeBlocks, K as recordTransition, L as registerCheck, M as renderStateMachineToDomData, N as renderStateMachineToSvg, O as subscribeToVerification, P as updateAssetStatus, Q as updateBridgeHealth, U as updateCheck, W as waitForTransition } from '../cn-C_ATNPvi.js';
2
2
  import 'clsx';
3
3
 
4
+ /**
5
+ * Trait Registry - Tracks active traits and their state machines for debugging
6
+ *
7
+ * @packageDocumentation
8
+ */
9
+ interface TraitTransition {
10
+ from: string;
11
+ to: string;
12
+ event: string;
13
+ guard?: string;
14
+ }
15
+ interface TraitGuard {
16
+ name: string;
17
+ lastResult?: boolean;
18
+ }
19
+ interface TraitDebugInfo {
20
+ id: string;
21
+ name: string;
22
+ currentState: string;
23
+ states: string[];
24
+ transitions: TraitTransition[];
25
+ guards: TraitGuard[];
26
+ transitionCount: number;
27
+ }
28
+ type ChangeListener$3 = () => void;
29
+ declare function registerTrait(info: TraitDebugInfo): void;
30
+ declare function updateTraitState(id: string, newState: string): void;
31
+ declare function updateGuardResult(traitId: string, guardName: string, result: boolean): void;
32
+ declare function unregisterTrait(id: string): void;
33
+ declare function getAllTraits(): TraitDebugInfo[];
34
+ declare function getTrait(id: string): TraitDebugInfo | undefined;
35
+ declare function subscribeToTraitChanges(listener: ChangeListener$3): () => void;
36
+ declare function clearTraits(): void;
37
+
38
+ /**
39
+ * Tick Registry - Tracks scheduled tick executions for debugging
40
+ *
41
+ * @packageDocumentation
42
+ */
43
+ interface TickExecution {
44
+ id: string;
45
+ traitName: string;
46
+ /** Tick name (display name) */
47
+ name: string;
48
+ /** Tick identifier */
49
+ tickName: string;
50
+ interval: number;
51
+ /** Last execution timestamp */
52
+ lastRun: number;
53
+ lastExecuted: number | null;
54
+ nextExecution: number | null;
55
+ /** Number of times this tick has run */
56
+ runCount: number;
57
+ executionCount: number;
58
+ /** Average execution time in ms */
59
+ executionTime: number;
60
+ /** Whether the tick is currently active */
61
+ active: boolean;
62
+ isActive: boolean;
63
+ /** Guard name if this tick has a guard */
64
+ guardName?: string;
65
+ /** Whether the guard passed on last evaluation */
66
+ guardPassed?: boolean;
67
+ }
68
+ type ChangeListener$2 = () => void;
69
+ declare function registerTick(tick: TickExecution): void;
70
+ declare function updateTickExecution(id: string, timestamp: number): void;
71
+ declare function setTickActive(id: string, isActive: boolean): void;
72
+ declare function unregisterTick(id: string): void;
73
+ declare function getAllTicks(): TickExecution[];
74
+ declare function getTick(id: string): TickExecution | undefined;
75
+ declare function subscribeToTickChanges(listener: ChangeListener$2): () => void;
76
+ declare function clearTicks(): void;
77
+
78
+ /**
79
+ * Guard Registry - Tracks guard evaluations for debugging
80
+ *
81
+ * @packageDocumentation
82
+ */
83
+ interface GuardContext {
84
+ traitName?: string;
85
+ type?: "transition" | "tick";
86
+ transitionFrom?: string;
87
+ transitionTo?: string;
88
+ tickName?: string;
89
+ [key: string]: unknown;
90
+ }
91
+ interface GuardEvaluation {
92
+ id: string;
93
+ traitName: string;
94
+ guardName: string;
95
+ expression: string;
96
+ result: boolean;
97
+ context: GuardContext;
98
+ timestamp: number;
99
+ /** Input values used in guard evaluation */
100
+ inputs: Record<string, unknown>;
101
+ }
102
+ type ChangeListener$1 = () => void;
103
+ declare function recordGuardEvaluation(evaluation: Omit<GuardEvaluation, "id" | "timestamp">): void;
104
+ declare function getGuardHistory(): GuardEvaluation[];
105
+ declare function getRecentGuardEvaluations(count: number): GuardEvaluation[];
106
+ declare function getGuardEvaluationsForTrait(traitName: string): GuardEvaluation[];
107
+ declare function subscribeToGuardChanges(listener: ChangeListener$1): () => void;
108
+ declare function clearGuardHistory(): void;
109
+
110
+ /**
111
+ * Entity Debug - Provides entity state snapshots for debugging
112
+ *
113
+ * @packageDocumentation
114
+ */
115
+ interface EntityState {
116
+ id: string;
117
+ type: string;
118
+ fields: Record<string, unknown>;
119
+ lastUpdated: number;
120
+ }
121
+ interface RuntimeEntity {
122
+ id: string;
123
+ type: string;
124
+ data: Record<string, unknown>;
125
+ }
126
+ interface PersistentEntityInfo {
127
+ loaded: boolean;
128
+ count: number;
129
+ }
130
+ interface EntitySnapshot {
131
+ entities: EntityState[];
132
+ timestamp: number;
133
+ totalCount: number;
134
+ /** Singleton entities by name */
135
+ singletons: Record<string, unknown>;
136
+ /** Runtime entities (in-memory) */
137
+ runtime: RuntimeEntity[];
138
+ /** Persistent entities info by type */
139
+ persistent: Record<string, PersistentEntityInfo>;
140
+ }
141
+ type EntityProvider = () => EntityState[];
142
+ declare function setEntityProvider(provider: EntityProvider): void;
143
+ declare function clearEntityProvider(): void;
144
+ declare function getEntitySnapshot(): EntitySnapshot | null;
145
+ declare function getEntityById(id: string): EntityState | undefined;
146
+ declare function getEntitiesByType(type: string): EntityState[];
147
+
148
+ /**
149
+ * Debug Registry - Central event log for debugging
150
+ *
151
+ * @packageDocumentation
152
+ */
153
+ type DebugEventType = 'state-change' | 'event-fired' | 'effect-executed' | 'guard-evaluated' | 'error' | 'warning' | 'info';
154
+ interface DebugEvent {
155
+ id: string;
156
+ type: DebugEventType;
157
+ source: string;
158
+ message: string;
159
+ data?: Record<string, unknown>;
160
+ timestamp: number;
161
+ }
162
+ type ChangeListener = () => void;
163
+ declare function logDebugEvent(type: DebugEventType, source: string, message: string, data?: Record<string, unknown>): void;
164
+ declare function logStateChange(source: string, from: string, to: string, event?: string): void;
165
+ declare function logEventFired(source: string, eventName: string, payload?: unknown): void;
166
+ declare function logEffectExecuted(source: string, effectType: string, details?: unknown): void;
167
+ declare function logError(source: string, message: string, error?: unknown): void;
168
+ declare function logWarning(source: string, message: string, data?: Record<string, unknown>): void;
169
+ declare function logInfo(source: string, message: string, data?: Record<string, unknown>): void;
170
+ declare function getDebugEvents(): DebugEvent[];
171
+ declare function getRecentEvents(count: number): DebugEvent[];
172
+ declare function getEventsByType(type: DebugEventType): DebugEvent[];
173
+ declare function getEventsBySource(source: string): DebugEvent[];
174
+ declare function subscribeToDebugEvents(listener: ChangeListener): () => void;
175
+ declare function clearDebugEvents(): void;
176
+
4
177
  /**
5
178
  * API Client - HTTP client for backend API calls
6
179
  *
@@ -110,179 +283,6 @@ declare function onDebugToggle(listener: DebugToggleListener): () => void;
110
283
  */
111
284
  declare function initDebugShortcut(): () => void;
112
285
 
113
- /**
114
- * Entity Debug - Provides entity state snapshots for debugging
115
- *
116
- * @packageDocumentation
117
- */
118
- interface EntityState {
119
- id: string;
120
- type: string;
121
- fields: Record<string, unknown>;
122
- lastUpdated: number;
123
- }
124
- interface RuntimeEntity {
125
- id: string;
126
- type: string;
127
- data: Record<string, unknown>;
128
- }
129
- interface PersistentEntityInfo {
130
- loaded: boolean;
131
- count: number;
132
- }
133
- interface EntitySnapshot {
134
- entities: EntityState[];
135
- timestamp: number;
136
- totalCount: number;
137
- /** Singleton entities by name */
138
- singletons: Record<string, unknown>;
139
- /** Runtime entities (in-memory) */
140
- runtime: RuntimeEntity[];
141
- /** Persistent entities info by type */
142
- persistent: Record<string, PersistentEntityInfo>;
143
- }
144
- type EntityProvider = () => EntityState[];
145
- declare function setEntityProvider(provider: EntityProvider): void;
146
- declare function clearEntityProvider(): void;
147
- declare function getEntitySnapshot(): EntitySnapshot | null;
148
- declare function getEntityById(id: string): EntityState | undefined;
149
- declare function getEntitiesByType(type: string): EntityState[];
150
-
151
- /**
152
- * Debug Registry - Central event log for debugging
153
- *
154
- * @packageDocumentation
155
- */
156
- type DebugEventType = 'state-change' | 'event-fired' | 'effect-executed' | 'guard-evaluated' | 'error' | 'warning' | 'info';
157
- interface DebugEvent {
158
- id: string;
159
- type: DebugEventType;
160
- source: string;
161
- message: string;
162
- data?: Record<string, unknown>;
163
- timestamp: number;
164
- }
165
- type ChangeListener$3 = () => void;
166
- declare function logDebugEvent(type: DebugEventType, source: string, message: string, data?: Record<string, unknown>): void;
167
- declare function logStateChange(source: string, from: string, to: string, event?: string): void;
168
- declare function logEventFired(source: string, eventName: string, payload?: unknown): void;
169
- declare function logEffectExecuted(source: string, effectType: string, details?: unknown): void;
170
- declare function logError(source: string, message: string, error?: unknown): void;
171
- declare function logWarning(source: string, message: string, data?: Record<string, unknown>): void;
172
- declare function logInfo(source: string, message: string, data?: Record<string, unknown>): void;
173
- declare function getDebugEvents(): DebugEvent[];
174
- declare function getRecentEvents(count: number): DebugEvent[];
175
- declare function getEventsByType(type: DebugEventType): DebugEvent[];
176
- declare function getEventsBySource(source: string): DebugEvent[];
177
- declare function subscribeToDebugEvents(listener: ChangeListener$3): () => void;
178
- declare function clearDebugEvents(): void;
179
-
180
- /**
181
- * Guard Registry - Tracks guard evaluations for debugging
182
- *
183
- * @packageDocumentation
184
- */
185
- interface GuardContext {
186
- traitName?: string;
187
- type?: "transition" | "tick";
188
- transitionFrom?: string;
189
- transitionTo?: string;
190
- tickName?: string;
191
- [key: string]: unknown;
192
- }
193
- interface GuardEvaluation {
194
- id: string;
195
- traitName: string;
196
- guardName: string;
197
- expression: string;
198
- result: boolean;
199
- context: GuardContext;
200
- timestamp: number;
201
- /** Input values used in guard evaluation */
202
- inputs: Record<string, unknown>;
203
- }
204
- type ChangeListener$2 = () => void;
205
- declare function recordGuardEvaluation(evaluation: Omit<GuardEvaluation, "id" | "timestamp">): void;
206
- declare function getGuardHistory(): GuardEvaluation[];
207
- declare function getRecentGuardEvaluations(count: number): GuardEvaluation[];
208
- declare function getGuardEvaluationsForTrait(traitName: string): GuardEvaluation[];
209
- declare function subscribeToGuardChanges(listener: ChangeListener$2): () => void;
210
- declare function clearGuardHistory(): void;
211
-
212
- /**
213
- * Tick Registry - Tracks scheduled tick executions for debugging
214
- *
215
- * @packageDocumentation
216
- */
217
- interface TickExecution {
218
- id: string;
219
- traitName: string;
220
- /** Tick name (display name) */
221
- name: string;
222
- /** Tick identifier */
223
- tickName: string;
224
- interval: number;
225
- /** Last execution timestamp */
226
- lastRun: number;
227
- lastExecuted: number | null;
228
- nextExecution: number | null;
229
- /** Number of times this tick has run */
230
- runCount: number;
231
- executionCount: number;
232
- /** Average execution time in ms */
233
- executionTime: number;
234
- /** Whether the tick is currently active */
235
- active: boolean;
236
- isActive: boolean;
237
- /** Guard name if this tick has a guard */
238
- guardName?: string;
239
- /** Whether the guard passed on last evaluation */
240
- guardPassed?: boolean;
241
- }
242
- type ChangeListener$1 = () => void;
243
- declare function registerTick(tick: TickExecution): void;
244
- declare function updateTickExecution(id: string, timestamp: number): void;
245
- declare function setTickActive(id: string, isActive: boolean): void;
246
- declare function unregisterTick(id: string): void;
247
- declare function getAllTicks(): TickExecution[];
248
- declare function getTick(id: string): TickExecution | undefined;
249
- declare function subscribeToTickChanges(listener: ChangeListener$1): () => void;
250
- declare function clearTicks(): void;
251
-
252
- /**
253
- * Trait Registry - Tracks active traits and their state machines for debugging
254
- *
255
- * @packageDocumentation
256
- */
257
- interface TraitTransition {
258
- from: string;
259
- to: string;
260
- event: string;
261
- guard?: string;
262
- }
263
- interface TraitGuard {
264
- name: string;
265
- lastResult?: boolean;
266
- }
267
- interface TraitDebugInfo {
268
- id: string;
269
- name: string;
270
- currentState: string;
271
- states: string[];
272
- transitions: TraitTransition[];
273
- guards: TraitGuard[];
274
- transitionCount: number;
275
- }
276
- type ChangeListener = () => void;
277
- declare function registerTrait(info: TraitDebugInfo): void;
278
- declare function updateTraitState(id: string, newState: string): void;
279
- declare function updateGuardResult(traitId: string, guardName: string, result: boolean): void;
280
- declare function unregisterTrait(id: string): void;
281
- declare function getAllTraits(): TraitDebugInfo[];
282
- declare function getTrait(id: string): TraitDebugInfo | undefined;
283
- declare function subscribeToTraitChanges(listener: ChangeListener): () => void;
284
- declare function clearTraits(): void;
285
-
286
286
  /**
287
287
  * Get Nested Value Utility
288
288
  *
package/dist/lib/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { DEFAULT_CONFIG, clearDebugEvents, clearEntityProvider, clearGuardHistory, clearTicks, extractOutputsFromTransitions, extractStateMachine, formatGuard, getAllTicks, getDebugEvents, getEffectSummary, getEntitiesByType, getEntityById, getEntitySnapshot, getEventsBySource, getEventsByType, getGuardEvaluationsForTrait, getGuardHistory, getRecentEvents, getRecentGuardEvaluations, getTick, initDebugShortcut, logDebugEvent, logEffectExecuted, logError, logEventFired, logInfo, logStateChange, logWarning, onDebugToggle, parseContentSegments, parseMarkdownWithCodeBlocks, recordGuardEvaluation, registerTick, renderStateMachineToDomData, renderStateMachineToSvg, setDebugEnabled, setEntityProvider, setTickActive, subscribeToDebugEvents, subscribeToGuardChanges, subscribeToTickChanges, toggleDebug, unregisterTick, updateTickExecution } from '../chunk-MNMASFYN.js';
1
+ export { DEFAULT_CONFIG, clearDebugEvents, clearEntityProvider, clearGuardHistory, clearTicks, extractOutputsFromTransitions, extractStateMachine, formatGuard, getAllTicks, getDebugEvents, getEffectSummary, getEntitiesByType, getEntityById, getEntitySnapshot, getEventsBySource, getEventsByType, getGuardEvaluationsForTrait, getGuardHistory, getRecentEvents, getRecentGuardEvaluations, getTick, initDebugShortcut, logDebugEvent, logEffectExecuted, logError, logEventFired, logInfo, logStateChange, logWarning, onDebugToggle, parseContentSegments, parseMarkdownWithCodeBlocks, recordGuardEvaluation, registerTick, renderStateMachineToDomData, renderStateMachineToSvg, setDebugEnabled, setEntityProvider, setTickActive, subscribeToDebugEvents, subscribeToGuardChanges, subscribeToTickChanges, toggleDebug, unregisterTick, updateTickExecution } from '../chunk-4ZBSL37D.js';
2
2
  export { clearTraits, getAllTraits, getTrait, registerTrait, subscribeToTraitChanges, unregisterTrait, updateGuardResult, updateTraitState } from '../chunk-42YQ6JVR.js';
3
3
  export { ApiError, apiClient } from '../chunk-3HJHHULT.js';
4
4
  export { bindCanvasCapture, bindEventBus, bindTraitStateGetter, clearVerification, cn, debug, debugCollision, debugError, debugGameState, debugGroup, debugGroupEnd, debugInput, debugPhysics, debugTable, debugTime, debugTimeEnd, debugWarn, formatNestedFieldLabel, getAllChecks, getBridgeHealth, getNestedValue, getSnapshot, getSummary, getTransitions, getTransitionsForTrait, isDebugEnabled, recordTransition, registerCheck, subscribeToVerification, updateAssetStatus, updateBridgeHealth, updateCheck, waitForTransition } from '../chunk-WCTZ7WZX.js';
@@ -1,10 +1,10 @@
1
- export { FetchedDataContext, FetchedDataProvider, OfflineModeProvider, OrbitalProvider, VerificationProvider, useFetchedData, useFetchedDataContext, useFetchedEntity, useOfflineMode, useOptionalOfflineMode } from '../chunk-XF7GGUTH.js';
2
- import '../chunk-YYCP5CD7.js';
3
- import '../chunk-YLKXEXBP.js';
4
- export { SelectionContext, SelectionProvider, useSelection, useSelectionOptional } from '../chunk-3CP74CBL.js';
1
+ export { FetchedDataContext, FetchedDataProvider, OfflineModeProvider, OrbitalProvider, VerificationProvider, useFetchedData, useFetchedDataContext, useFetchedEntity, useOfflineMode, useOptionalOfflineMode } from '../chunk-UNDQO6DL.js';
2
+ import '../chunk-MSLMORZK.js';
3
+ import '../chunk-DKQN5FVU.js';
4
+ export { SelectionContext, SelectionProvider, useSelection, useSelectionOptional } from '../chunk-Y7IHEYYE.js';
5
5
  export { EventBusContext, EventBusProvider } from '../chunk-YXZM3WCF.js';
6
6
  import '../chunk-3JGAROCW.js';
7
- import '../chunk-2XXSUIOK.js';
8
7
  import '../chunk-WCTZ7WZX.js';
8
+ import '../chunk-2XXSUIOK.js';
9
9
  import '../chunk-K2D5D3WK.js';
10
10
  import '../chunk-PKBMQBKP.js';