@almadar/ui 1.0.34 → 2.0.1
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.
- package/LICENSE +21 -72
- package/dist/components/atoms/Avatar.d.ts +58 -0
- package/dist/components/atoms/Badge.d.ts +8 -0
- package/dist/components/atoms/Box.d.ts +57 -0
- package/dist/components/atoms/Button.d.ts +24 -0
- package/dist/components/atoms/Card.d.ts +18 -0
- package/dist/components/atoms/Center.d.ts +33 -0
- package/dist/components/atoms/Checkbox.d.ts +5 -0
- package/dist/components/atoms/ConditionalWrapper.d.ts +68 -0
- package/dist/components/atoms/Divider.d.ts +29 -0
- package/dist/components/atoms/Icon.d.ts +38 -0
- package/dist/components/atoms/Input.d.ts +26 -0
- package/dist/components/atoms/Label.d.ts +5 -0
- package/dist/components/atoms/LawReferenceTooltip.d.ts +48 -0
- package/dist/components/atoms/Overlay.d.ts +16 -0
- package/dist/components/atoms/ProgressBar.d.ts +63 -0
- package/dist/components/atoms/Radio.d.ts +26 -0
- package/dist/components/atoms/Select.d.ts +12 -0
- package/dist/components/atoms/Spacer.d.ts +25 -0
- package/dist/components/atoms/Spinner.d.ts +6 -0
- package/dist/components/atoms/Stack.d.ts +64 -0
- package/dist/components/atoms/Switch.d.ts +12 -0
- package/dist/components/atoms/TextHighlight.d.ts +53 -0
- package/dist/components/atoms/Textarea.d.ts +5 -0
- package/dist/components/atoms/ThemeSelector.d.ts +21 -0
- package/dist/components/atoms/ThemeToggle.d.ts +33 -0
- package/dist/components/atoms/Typography.d.ts +57 -0
- package/dist/components/atoms/game/ControlButton.d.ts +31 -0
- package/dist/components/atoms/game/HealthBar.d.ts +18 -0
- package/dist/components/atoms/game/ScoreDisplay.d.ts +21 -0
- package/dist/components/atoms/game/Sprite.d.ts +63 -0
- package/dist/components/atoms/game/StateIndicator.d.ts +31 -0
- package/dist/components/atoms/game/index.d.ts +12 -0
- package/dist/components/atoms/index.d.ts +27 -0
- package/dist/components/index.css +11 -9
- package/dist/components/index.d.ts +6 -6951
- package/dist/components/index.js +5 -5
- package/dist/components/molecules/Accordion.d.ts +67 -0
- package/dist/components/molecules/Alert.d.ts +24 -0
- package/dist/components/molecules/Breadcrumb.d.ts +55 -0
- package/dist/components/molecules/ButtonGroup.d.ts +67 -0
- package/dist/components/molecules/Card.d.ts +44 -0
- package/dist/components/molecules/Container.d.ts +30 -0
- package/dist/components/molecules/Drawer.d.ts +46 -0
- package/dist/components/molecules/EmptyState.d.ts +25 -0
- package/dist/components/molecules/ErrorBoundary.d.ts +55 -0
- package/dist/components/molecules/ErrorState.d.ts +13 -0
- package/dist/components/molecules/FilterGroup.d.ts +54 -0
- package/dist/components/molecules/Flex.d.ts +43 -0
- package/dist/components/molecules/FloatingActionButton.d.ts +69 -0
- package/dist/components/molecules/FormField.d.ts +16 -0
- package/dist/components/molecules/FormSectionHeader.d.ts +30 -0
- package/dist/components/molecules/Grid.d.ts +54 -0
- package/dist/components/molecules/InputGroup.d.ts +24 -0
- package/dist/components/molecules/LoadingState.d.ts +7 -0
- package/dist/components/molecules/Menu.d.ts +40 -0
- package/dist/components/molecules/Modal.d.ts +26 -0
- package/dist/components/molecules/Pagination.d.ts +66 -0
- package/dist/components/molecules/Popover.d.ts +39 -0
- package/dist/components/molecules/QuizBlock.d.ts +20 -0
- package/dist/components/molecules/RelationSelect.d.ts +48 -0
- package/dist/components/molecules/RepeatableFormSection.d.ts +58 -0
- package/dist/components/molecules/ScaledDiagram.d.ts +20 -0
- package/dist/components/molecules/SearchInput.d.ts +60 -0
- package/dist/components/molecules/SidePanel.d.ts +47 -0
- package/dist/components/molecules/SimpleGrid.d.ts +27 -0
- package/dist/components/molecules/Skeleton.d.ts +35 -0
- package/dist/components/molecules/Tabs.d.ts +45 -0
- package/dist/components/molecules/Toast.d.ts +35 -0
- package/dist/components/molecules/Tooltip.d.ts +25 -0
- package/dist/components/molecules/ViolationAlert.d.ts +49 -0
- package/dist/components/molecules/WizardNavigation.d.ts +51 -0
- package/dist/components/molecules/WizardProgress.d.ts +42 -0
- package/dist/components/molecules/game/StatBadge.d.ts +27 -0
- package/dist/components/molecules/index.d.ts +38 -0
- package/dist/components/molecules/markdown/CodeBlock.d.ts +25 -0
- package/dist/components/molecules/markdown/MarkdownContent.d.ts +26 -0
- package/dist/components/organisms/CardGrid.d.ts +72 -0
- package/dist/components/organisms/Chart.d.ts +59 -0
- package/dist/components/organisms/CodeViewer.d.ts +67 -0
- package/dist/components/organisms/ComponentPatterns.d.ts +441 -0
- package/dist/components/organisms/ConfirmDialog.d.ts +50 -0
- package/dist/components/organisms/ContentRenderer.d.ts +23 -0
- package/dist/components/organisms/CustomPattern.d.ts +104 -0
- package/dist/components/organisms/DataTable.d.ts +63 -0
- package/dist/components/organisms/DetailPanel.d.ts +71 -0
- package/dist/components/organisms/DocumentViewer.d.ts +60 -0
- package/dist/components/organisms/DrawerSlot.d.ts +39 -0
- package/dist/components/organisms/Form.d.ts +203 -0
- package/dist/components/organisms/FormSection.d.ts +59 -0
- package/dist/components/organisms/GraphCanvas.d.ts +69 -0
- package/dist/components/organisms/Header.d.ts +110 -0
- package/dist/components/organisms/JazariStateMachine.d.ts +60 -0
- package/dist/components/organisms/LayoutPatterns.d.ts +181 -0
- package/dist/components/organisms/List.d.ts +76 -0
- package/dist/components/organisms/MasterDetail.d.ts +43 -0
- package/dist/components/organisms/MediaGallery.d.ts +66 -0
- package/dist/components/organisms/Meter.d.ts +58 -0
- package/dist/components/organisms/ModalSlot.d.ts +35 -0
- package/dist/components/organisms/Navigation.d.ts +68 -0
- package/dist/components/organisms/OrbitalVisualization.d.ts +48 -0
- package/dist/components/organisms/PageHeader.d.ts +59 -0
- package/dist/components/organisms/Section.d.ts +44 -0
- package/dist/components/organisms/Sidebar.d.ts +65 -0
- package/dist/components/organisms/SignaturePad.d.ts +44 -0
- package/dist/components/organisms/Split.d.ts +42 -0
- package/dist/components/organisms/StatCard.d.ts +66 -0
- package/dist/components/organisms/StateMachineView.d.ts +36 -0
- package/dist/components/organisms/Table.d.ts +99 -0
- package/dist/components/organisms/Timeline.d.ts +58 -0
- package/dist/components/organisms/ToastSlot.d.ts +38 -0
- package/dist/components/organisms/UISlotRenderer.d.ts +112 -0
- package/dist/components/organisms/WizardContainer.d.ts +160 -0
- package/dist/components/organisms/book/BookChapterView.d.ts +17 -0
- package/dist/components/organisms/book/BookCoverPage.d.ts +19 -0
- package/dist/components/organisms/book/BookNavBar.d.ts +18 -0
- package/dist/components/organisms/book/BookTableOfContents.d.ts +18 -0
- package/dist/components/organisms/book/BookViewer.d.ts +28 -0
- package/dist/components/organisms/book/index.d.ts +7 -0
- package/dist/components/organisms/book/types.d.ts +77 -0
- package/dist/components/organisms/game/BattleBoard.d.ts +167 -0
- package/dist/components/organisms/game/CanvasEffect.d.ts +68 -0
- package/dist/components/organisms/game/CastleBoard.d.ts +85 -0
- package/dist/components/organisms/game/DialogueBox.d.ts +73 -0
- package/dist/components/organisms/game/GameAudioProvider.d.ts +47 -0
- package/dist/components/organisms/game/GameAudioToggle.d.ts +28 -0
- package/dist/components/organisms/game/GameHud.d.ts +40 -0
- package/dist/components/organisms/game/GameMenu.d.ts +43 -0
- package/dist/components/organisms/game/GameOverScreen.d.ts +56 -0
- package/dist/components/organisms/game/InventoryPanel.d.ts +67 -0
- package/dist/components/organisms/game/IsometricCanvas.d.ts +123 -0
- package/dist/components/organisms/game/TraitSlot.d.ts +86 -0
- package/dist/components/organisms/game/TraitStateViewer.d.ts +53 -0
- package/dist/components/organisms/game/UncontrolledBattleBoard.d.ts +26 -0
- package/dist/components/organisms/game/WorldMapBoard.d.ts +147 -0
- package/dist/components/organisms/game/editor/editorUtils.d.ts +109 -0
- package/dist/components/organisms/game/editor/index.d.ts +9 -0
- package/dist/components/organisms/game/hooks/useBattleState.d.ts +35 -0
- package/dist/components/organisms/game/hooks/useCamera.d.ts +41 -0
- package/dist/components/organisms/game/hooks/useGameAudio.d.ts +47 -0
- package/dist/components/organisms/game/hooks/useImageCache.d.ts +16 -0
- package/dist/components/organisms/game/hooks/usePhysics2D.d.ts +45 -0
- package/dist/components/organisms/game/hooks/useSpriteAnimations.d.ts +43 -0
- package/dist/components/organisms/game/index.d.ts +36 -0
- package/dist/components/organisms/game/managers/PhysicsManager.d.ts +103 -0
- package/dist/components/organisms/game/types/effects.d.ts +253 -0
- package/dist/{isometric-ynNHVPZx.d.ts → components/organisms/game/types/isometric.d.ts} +4 -6
- package/dist/components/organisms/game/types/spriteAnimation.d.ts +73 -0
- package/dist/components/organisms/game/utils/canvasEffects.d.ts +50 -0
- package/dist/components/organisms/game/utils/combatPresets.d.ts +15 -0
- package/dist/components/organisms/game/utils/isometric.d.ts +61 -0
- package/dist/components/organisms/game/utils/spriteAnimation.d.ts +57 -0
- package/dist/components/organisms/game/utils/spriteSheetConstants.d.ts +16 -0
- package/dist/components/organisms/index.d.ts +37 -0
- package/dist/components/organisms/layout/DashboardGrid.d.ts +34 -0
- package/dist/components/organisms/layout/MasterDetail.d.ts +32 -0
- package/dist/components/organisms/layout/SplitPane.d.ts +34 -0
- package/dist/components/organisms/layout/TabbedContainer.d.ts +42 -0
- package/dist/components/organisms/layout/index.d.ts +9 -0
- package/dist/components/organisms/types.d.ts +65 -0
- package/dist/components/templates/AuthLayout.d.ts +14 -0
- package/dist/components/templates/BattleTemplate.d.ts +25 -0
- package/dist/components/templates/CastleTemplate.d.ts +23 -0
- package/dist/components/templates/CounterTemplate.d.ts +44 -0
- package/dist/components/templates/DashboardLayout.d.ts +32 -0
- package/dist/components/templates/GameShell.d.ts +33 -0
- package/dist/components/templates/GameTemplate.d.ts +36 -0
- package/dist/components/templates/GenericAppTemplate.d.ts +30 -0
- package/dist/components/templates/WorldMapTemplate.d.ts +29 -0
- package/dist/components/templates/index.d.ts +10 -0
- package/dist/components/templates/types.d.ts +17 -0
- package/dist/context/DesignThemeContext.d.ts +21 -0
- package/dist/{ThemeContext-D9xUORq5.d.ts → context/ThemeContext.d.ts} +15 -16
- package/dist/context/UISlotContext.d.ts +75 -0
- package/dist/context/UserContext.d.ts +111 -0
- package/dist/context/index.d.ts +6 -206
- package/dist/{event-bus-types-CjJduURa.d.ts → hooks/event-bus-types.d.ts} +4 -6
- package/dist/hooks/index.d.ts +24 -1090
- package/dist/hooks/useAgentChat.d.ts +104 -0
- package/dist/hooks/useAuthContext.d.ts +25 -0
- package/dist/hooks/useCompile.d.ts +22 -0
- package/dist/hooks/useDeepAgentGeneration.d.ts +46 -0
- package/dist/hooks/useEntities.d.ts +52 -0
- package/dist/hooks/useEntityData.d.ts +155 -0
- package/dist/hooks/useEntityMutations.d.ts +80 -0
- package/dist/hooks/useEventBus.d.ts +96 -0
- package/dist/hooks/useExtensions.d.ts +32 -0
- package/dist/hooks/useFileEditor.d.ts +32 -0
- package/dist/hooks/useFileSystem.d.ts +40 -0
- package/dist/hooks/useGitHub.d.ts +58 -0
- package/dist/hooks/useOrbitalHistory.d.ts +39 -0
- package/dist/hooks/useOrbitalMutations.d.ts +95 -0
- package/dist/hooks/usePreview.d.ts +57 -0
- package/dist/hooks/useQuerySingleton.d.ts +78 -0
- package/dist/hooks/useResolvedEntity.d.ts +32 -0
- package/dist/hooks/useTranslate.d.ts +35 -0
- package/dist/hooks/useUIEvents.d.ts +35 -0
- package/dist/{useUISlots-D0mttBSP.d.ts → hooks/useUISlots.d.ts} +8 -9
- package/dist/hooks/useValidation.d.ts +46 -0
- package/dist/lib/api-client.d.ts +42 -0
- package/dist/lib/cn.d.ts +6 -0
- package/dist/lib/debug.d.ts +43 -0
- package/dist/lib/debugRegistry.d.ts +29 -0
- package/dist/lib/debugUtils.d.ts +27 -0
- package/dist/lib/entityDebug.d.ts +38 -0
- package/dist/lib/getNestedValue.d.ts +33 -0
- package/dist/lib/guardRegistry.d.ts +32 -0
- package/dist/lib/index.d.ts +17 -426
- package/dist/lib/jazari/svg-paths.d.ts +61 -0
- package/dist/lib/parseContentSegments.d.ts +41 -0
- package/dist/lib/tickRegistry.d.ts +40 -0
- package/dist/lib/traitRegistry.d.ts +34 -0
- package/dist/lib/verificationRegistry.d.ts +107 -0
- package/dist/{cn-BoBXsxuX.d.ts → lib/visualizer/index.d.ts} +18 -69
- package/dist/locales/index.d.ts +5 -7
- package/dist/providers/EventBusProvider.d.ts +60 -0
- package/dist/providers/FetchedDataProvider.d.ts +105 -0
- package/dist/providers/OfflineModeProvider.d.ts +79 -0
- package/dist/providers/OrbitalProvider.d.ts +101 -0
- package/dist/providers/SelectionProvider.d.ts +81 -0
- package/dist/providers/VerificationProvider.d.ts +63 -0
- package/dist/providers/index.css +11 -9
- package/dist/providers/index.d.ts +16 -464
- package/dist/providers/index.js +3 -3
- package/dist/renderer/client-effect-executor.d.ts +68 -0
- package/dist/renderer/data-resolver.d.ts +68 -0
- package/dist/renderer/index.d.ts +22 -519
- package/dist/renderer/index.js +1 -1
- package/dist/renderer/init.d.ts +14 -0
- package/dist/renderer/navigation.d.ts +142 -0
- package/dist/{offline-executor-CHr4uAhf.d.ts → renderer/offline-executor.d.ts} +9 -172
- package/dist/renderer/pattern-resolver.d.ts +91 -0
- package/dist/renderer/slot-definitions.d.ts +45 -0
- package/dist/renderer/types.d.ts +160 -0
- package/dist/renderer/useClientEffects.d.ts +88 -0
- package/dist/stores/entityStore.d.ts +99 -0
- package/dist/stores/filtering.d.ts +51 -0
- package/dist/stores/index.d.ts +4 -148
- package/package.json +12 -10
- package/dist/components/organisms/game/three/index.d.ts +0 -1162
- package/dist/{chunk-FZJ73RDM.js → chunk-RIZ76XRF.js} +1 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitHub connection status
|
|
3
|
+
*/
|
|
4
|
+
export interface GitHubStatus {
|
|
5
|
+
connected: boolean;
|
|
6
|
+
username?: string;
|
|
7
|
+
avatarUrl?: string;
|
|
8
|
+
scopes?: string[];
|
|
9
|
+
connectedAt?: number;
|
|
10
|
+
lastUsedAt?: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* GitHub repository
|
|
14
|
+
*/
|
|
15
|
+
export interface GitHubRepo {
|
|
16
|
+
id: number;
|
|
17
|
+
name: string;
|
|
18
|
+
fullName: string;
|
|
19
|
+
owner: string;
|
|
20
|
+
isPrivate: boolean;
|
|
21
|
+
description: string | null;
|
|
22
|
+
defaultBranch: string;
|
|
23
|
+
url: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Hook to get GitHub connection status
|
|
27
|
+
*/
|
|
28
|
+
export declare function useGitHubStatus(): import("@tanstack/react-query").UseQueryResult<GitHubStatus, Error>;
|
|
29
|
+
/**
|
|
30
|
+
* Hook to connect GitHub (initiate OAuth flow)
|
|
31
|
+
*/
|
|
32
|
+
export declare function useConnectGitHub(): {
|
|
33
|
+
connectGitHub: () => void;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Hook to disconnect GitHub
|
|
37
|
+
*/
|
|
38
|
+
export declare function useDisconnectGitHub(): import("@tanstack/react-query").UseMutationResult<unknown, Error, void, unknown>;
|
|
39
|
+
/**
|
|
40
|
+
* Hook to list GitHub repositories
|
|
41
|
+
*/
|
|
42
|
+
export declare function useGitHubRepos(page?: number, perPage?: number): import("@tanstack/react-query").UseQueryResult<{
|
|
43
|
+
repos: GitHubRepo[];
|
|
44
|
+
page: number;
|
|
45
|
+
perPage: number;
|
|
46
|
+
}, Error>;
|
|
47
|
+
/**
|
|
48
|
+
* Hook to get repository details
|
|
49
|
+
*/
|
|
50
|
+
export declare function useGitHubRepo(owner: string, repo: string, enabled?: boolean): import("@tanstack/react-query").UseQueryResult<{
|
|
51
|
+
repo: GitHubRepo;
|
|
52
|
+
}, Error>;
|
|
53
|
+
/**
|
|
54
|
+
* Hook to list repository branches
|
|
55
|
+
*/
|
|
56
|
+
export declare function useGitHubBranches(owner: string, repo: string, enabled?: boolean): import("@tanstack/react-query").UseQueryResult<{
|
|
57
|
+
branches: string[];
|
|
58
|
+
}, Error>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { OrbitalSchema } from '@almadar/core';
|
|
2
|
+
export interface ChangeSummary {
|
|
3
|
+
added: number;
|
|
4
|
+
modified: number;
|
|
5
|
+
removed: number;
|
|
6
|
+
}
|
|
7
|
+
export interface HistoryTimelineItem {
|
|
8
|
+
id: string;
|
|
9
|
+
type: 'changeset' | 'snapshot';
|
|
10
|
+
version: number;
|
|
11
|
+
timestamp: number;
|
|
12
|
+
description: string;
|
|
13
|
+
source?: string;
|
|
14
|
+
summary?: ChangeSummary;
|
|
15
|
+
reason?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface RevertResult {
|
|
18
|
+
success: boolean;
|
|
19
|
+
error?: string;
|
|
20
|
+
restoredSchema?: OrbitalSchema;
|
|
21
|
+
}
|
|
22
|
+
export interface UseOrbitalHistoryOptions {
|
|
23
|
+
appId: string | null;
|
|
24
|
+
/** Firebase auth token for authenticated API requests */
|
|
25
|
+
authToken?: string | null;
|
|
26
|
+
/** User ID for x-user-id header (required for Firestore path) */
|
|
27
|
+
userId?: string | null;
|
|
28
|
+
onHistoryChange?: (timeline: HistoryTimelineItem[]) => void;
|
|
29
|
+
onRevertSuccess?: (restoredSchema: OrbitalSchema) => void;
|
|
30
|
+
}
|
|
31
|
+
export interface UseOrbitalHistoryResult {
|
|
32
|
+
timeline: HistoryTimelineItem[];
|
|
33
|
+
currentVersion: number;
|
|
34
|
+
isLoading: boolean;
|
|
35
|
+
error: string | null;
|
|
36
|
+
revertToSnapshot: (snapshotId: string) => Promise<RevertResult>;
|
|
37
|
+
refresh: () => Promise<void>;
|
|
38
|
+
}
|
|
39
|
+
export declare function useOrbitalHistory(options: UseOrbitalHistoryOptions): UseOrbitalHistoryResult;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useOrbitalMutations - Event-based entity mutations via orbital events route
|
|
3
|
+
*
|
|
4
|
+
* This hook provides entity mutations that go through the orbital events route
|
|
5
|
+
* instead of direct CRUD API calls. This ensures all mutations:
|
|
6
|
+
* 1. Go through trait state machines
|
|
7
|
+
* 2. Enforce guards
|
|
8
|
+
* 3. Execute all trait effects (including persist)
|
|
9
|
+
*
|
|
10
|
+
* This is the Phase 7 replacement for direct CRUD mutations.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* const { createEntity, updateEntity, deleteEntity } = useOrbitalMutations('Task', 'TaskManager');
|
|
15
|
+
*
|
|
16
|
+
* // Create - sends ENTITY_CREATE event to orbital
|
|
17
|
+
* await createEntity({ title: 'New Task', status: 'pending' });
|
|
18
|
+
*
|
|
19
|
+
* // Update - sends ENTITY_UPDATE event to orbital
|
|
20
|
+
* await updateEntity(taskId, { status: 'completed' });
|
|
21
|
+
*
|
|
22
|
+
* // Delete - sends ENTITY_DELETE event to orbital
|
|
23
|
+
* await deleteEntity(taskId);
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @packageDocumentation
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* Standard events for entity mutations
|
|
30
|
+
* These are handled by orbitals with CRUD-capable traits
|
|
31
|
+
*/
|
|
32
|
+
export declare const ENTITY_EVENTS: {
|
|
33
|
+
readonly CREATE: "ENTITY_CREATE";
|
|
34
|
+
readonly UPDATE: "ENTITY_UPDATE";
|
|
35
|
+
readonly DELETE: "ENTITY_DELETE";
|
|
36
|
+
};
|
|
37
|
+
export interface OrbitalEventPayload {
|
|
38
|
+
event: string;
|
|
39
|
+
payload?: Record<string, unknown>;
|
|
40
|
+
entityId?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface OrbitalEventResponse {
|
|
43
|
+
success: boolean;
|
|
44
|
+
transitioned: boolean;
|
|
45
|
+
states: Record<string, string>;
|
|
46
|
+
emittedEvents: Array<{
|
|
47
|
+
event: string;
|
|
48
|
+
payload?: unknown;
|
|
49
|
+
}>;
|
|
50
|
+
error?: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Hook for event-based entity mutations via orbital events route
|
|
54
|
+
*
|
|
55
|
+
* @param entityName - The entity type name (for cache invalidation)
|
|
56
|
+
* @param orbitalName - The orbital to send events to
|
|
57
|
+
* @param options - Optional configuration
|
|
58
|
+
*/
|
|
59
|
+
export declare function useOrbitalMutations(entityName: string, orbitalName: string, options?: {
|
|
60
|
+
/** Custom event names for create/update/delete */
|
|
61
|
+
events?: {
|
|
62
|
+
create?: string;
|
|
63
|
+
update?: string;
|
|
64
|
+
delete?: string;
|
|
65
|
+
};
|
|
66
|
+
/** Enable debug logging */
|
|
67
|
+
debug?: boolean;
|
|
68
|
+
}): {
|
|
69
|
+
createEntity: (data: Record<string, unknown>) => Promise<OrbitalEventResponse>;
|
|
70
|
+
updateEntity: (id: string | undefined, data: Record<string, unknown>) => Promise<OrbitalEventResponse | undefined>;
|
|
71
|
+
deleteEntity: (id: string | undefined) => Promise<OrbitalEventResponse | undefined>;
|
|
72
|
+
createMutation: import("@tanstack/react-query").UseMutationResult<OrbitalEventResponse, Error, Record<string, unknown>, unknown>;
|
|
73
|
+
updateMutation: import("@tanstack/react-query").UseMutationResult<OrbitalEventResponse, Error, {
|
|
74
|
+
id: string;
|
|
75
|
+
data: Record<string, unknown>;
|
|
76
|
+
}, unknown>;
|
|
77
|
+
deleteMutation: import("@tanstack/react-query").UseMutationResult<OrbitalEventResponse, Error, string, unknown>;
|
|
78
|
+
isCreating: boolean;
|
|
79
|
+
isUpdating: boolean;
|
|
80
|
+
isDeleting: boolean;
|
|
81
|
+
isMutating: boolean;
|
|
82
|
+
createError: Error | null;
|
|
83
|
+
updateError: Error | null;
|
|
84
|
+
deleteError: Error | null;
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Send a custom event to an orbital
|
|
88
|
+
* For non-CRUD operations that go through trait state machines
|
|
89
|
+
*/
|
|
90
|
+
export declare function useSendOrbitalEvent(orbitalName: string): {
|
|
91
|
+
sendEvent: (event: string, payload?: Record<string, unknown>, entityId?: string) => Promise<OrbitalEventResponse>;
|
|
92
|
+
isPending: boolean;
|
|
93
|
+
error: Error | null;
|
|
94
|
+
data: OrbitalEventResponse | undefined;
|
|
95
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { OrbitalSchema } from '@almadar/core';
|
|
2
|
+
export interface PreviewApp {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
status: 'loading' | 'ready' | 'error';
|
|
6
|
+
schema?: OrbitalSchema;
|
|
7
|
+
graphView: {
|
|
8
|
+
version: string;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export interface Notification {
|
|
12
|
+
id: string;
|
|
13
|
+
type: 'info' | 'warning' | 'error' | 'success';
|
|
14
|
+
title: string;
|
|
15
|
+
message: string;
|
|
16
|
+
timestamp: number;
|
|
17
|
+
read?: boolean;
|
|
18
|
+
actionLabel?: string;
|
|
19
|
+
onAction?: () => void;
|
|
20
|
+
autoDismiss?: boolean;
|
|
21
|
+
dismissAfter?: number;
|
|
22
|
+
}
|
|
23
|
+
export interface NotificationsState {
|
|
24
|
+
notifications: Notification[];
|
|
25
|
+
isPanelOpen: boolean;
|
|
26
|
+
closePanel: () => void;
|
|
27
|
+
dismissNotification: (id: string) => void;
|
|
28
|
+
markAsRead: (id: string) => void;
|
|
29
|
+
clearAll: () => void;
|
|
30
|
+
}
|
|
31
|
+
export interface ErrorToast {
|
|
32
|
+
message: string;
|
|
33
|
+
}
|
|
34
|
+
export interface UsePreviewResult {
|
|
35
|
+
previewUrl: string | null;
|
|
36
|
+
isLoading: boolean;
|
|
37
|
+
error: string | null;
|
|
38
|
+
loadError: string | null;
|
|
39
|
+
app: PreviewApp | null;
|
|
40
|
+
isFullscreen: boolean;
|
|
41
|
+
isExecutingEvent: boolean;
|
|
42
|
+
errorToast: ErrorToast | null;
|
|
43
|
+
currentStateName: string | null;
|
|
44
|
+
notifications: NotificationsState;
|
|
45
|
+
startPreview: () => Promise<void>;
|
|
46
|
+
stopPreview: () => Promise<void>;
|
|
47
|
+
refresh: () => Promise<void>;
|
|
48
|
+
handleRefresh: () => Promise<void>;
|
|
49
|
+
handleReset: () => Promise<void>;
|
|
50
|
+
toggleFullscreen: () => void;
|
|
51
|
+
setErrorToast: (toast: ErrorToast | null) => void;
|
|
52
|
+
dismissErrorToast: () => void;
|
|
53
|
+
}
|
|
54
|
+
export interface UsePreviewOptions {
|
|
55
|
+
appId?: string;
|
|
56
|
+
}
|
|
57
|
+
export declare function usePreview(options?: UsePreviewOptions): UsePreviewResult;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Query state for filters and search
|
|
3
|
+
*/
|
|
4
|
+
export interface QueryState {
|
|
5
|
+
search?: string;
|
|
6
|
+
filters?: Record<string, unknown>;
|
|
7
|
+
sortField?: string;
|
|
8
|
+
sortDirection?: 'asc' | 'desc';
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Query singleton entity reference
|
|
12
|
+
*/
|
|
13
|
+
export interface QuerySingletonEntity {
|
|
14
|
+
name: string;
|
|
15
|
+
fields: Record<string, unknown>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Query singleton result type
|
|
19
|
+
*/
|
|
20
|
+
export interface QuerySingletonResult {
|
|
21
|
+
state: QueryState;
|
|
22
|
+
setState: (state: Partial<QueryState>) => void;
|
|
23
|
+
reset: () => void;
|
|
24
|
+
}
|
|
25
|
+
export interface QuerySingletonState {
|
|
26
|
+
/** Current search term */
|
|
27
|
+
search: string;
|
|
28
|
+
/** Set search term */
|
|
29
|
+
setSearch: (value: string) => void;
|
|
30
|
+
/** Current filters */
|
|
31
|
+
filters: Record<string, unknown>;
|
|
32
|
+
/** Set a filter value */
|
|
33
|
+
setFilter: (key: string, value: unknown) => void;
|
|
34
|
+
/** Clear all filters */
|
|
35
|
+
clearFilters: () => void;
|
|
36
|
+
/** Current sort field */
|
|
37
|
+
sortField?: string;
|
|
38
|
+
/** Current sort direction */
|
|
39
|
+
sortDirection?: 'asc' | 'desc';
|
|
40
|
+
/** Set sort */
|
|
41
|
+
setSort: (field: string, direction: 'asc' | 'desc') => void;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Hook for accessing a query singleton by name
|
|
45
|
+
*
|
|
46
|
+
* @param query - Query singleton name (e.g., "@TaskQuery")
|
|
47
|
+
* @returns Query singleton state or null if no query provided
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```tsx
|
|
51
|
+
* const queryState = useQuerySingleton('@TaskQuery');
|
|
52
|
+
*
|
|
53
|
+
* // Use search state
|
|
54
|
+
* queryState?.search
|
|
55
|
+
* queryState?.setSearch('new search term')
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
export declare function useQuerySingleton(query?: string): QuerySingletonState | null;
|
|
59
|
+
/**
|
|
60
|
+
* Parse a query binding string to extract the query singleton name
|
|
61
|
+
*
|
|
62
|
+
* @param binding - Binding string like "@TaskQuery.search" or "@TaskQuery"
|
|
63
|
+
* @returns Object with query name and optional field path
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```tsx
|
|
67
|
+
* parseQueryBinding('@TaskQuery.search')
|
|
68
|
+
* // { query: 'TaskQuery', field: 'search' }
|
|
69
|
+
*
|
|
70
|
+
* parseQueryBinding('@TaskQuery')
|
|
71
|
+
* // { query: 'TaskQuery', field: undefined }
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
export declare function parseQueryBinding(binding: string): {
|
|
75
|
+
query: string;
|
|
76
|
+
field?: string;
|
|
77
|
+
};
|
|
78
|
+
export default useQuerySingleton;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export interface ResolvedEntity<T> {
|
|
2
|
+
/** Resolved data array */
|
|
3
|
+
data: T[];
|
|
4
|
+
/** True when data was provided directly via props (not fetched) */
|
|
5
|
+
isLocal: boolean;
|
|
6
|
+
/** Loading state — always false for local data */
|
|
7
|
+
isLoading: boolean;
|
|
8
|
+
/** Error state — always null for local data */
|
|
9
|
+
error: Error | null;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Resolves entity data from either a direct `data` prop or an `entity` string.
|
|
13
|
+
*
|
|
14
|
+
* When `data` is provided, it is used directly (isLocal: true).
|
|
15
|
+
* When only `entity` (string) is provided, data is fetched via useEntityList.
|
|
16
|
+
* Direct `data` always takes precedence over auto-fetch.
|
|
17
|
+
*
|
|
18
|
+
* @param entity - Entity name string for auto-fetch, or undefined
|
|
19
|
+
* @param data - Direct data array from trait render-ui, or undefined
|
|
20
|
+
* @returns Normalized { data, isLocal, isLoading, error }
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* function MyOrganism({ entity, data, isLoading, error }: MyProps) {
|
|
25
|
+
* const resolved = useResolvedEntity<Item>(entity, data);
|
|
26
|
+
* // resolved.data is always T[] regardless of source
|
|
27
|
+
* // resolved.isLocal tells you if data came from props
|
|
28
|
+
* }
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export declare function useResolvedEntity<T = Record<string, unknown>>(entity: string | undefined, data: readonly T[] | T[] | undefined): ResolvedEntity<T>;
|
|
32
|
+
export default useResolvedEntity;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export type TranslateFunction = (key: string, params?: Record<string, string | number>) => string;
|
|
2
|
+
export interface I18nContextValue {
|
|
3
|
+
/** Current locale code (e.g. 'en', 'ar', 'sl') */
|
|
4
|
+
locale: string;
|
|
5
|
+
/** Text direction for the current locale */
|
|
6
|
+
direction: 'ltr' | 'rtl';
|
|
7
|
+
/** Translate a key, with optional interpolation params */
|
|
8
|
+
t: TranslateFunction;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Provider component — wrap your app or Storybook decorator with this.
|
|
12
|
+
*
|
|
13
|
+
* ```tsx
|
|
14
|
+
* <I18nProvider value={{ locale: 'ar', direction: 'rtl', t: createTranslate(arMessages) }}>
|
|
15
|
+
* <App />
|
|
16
|
+
* </I18nProvider>
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare const I18nProvider: import("react").Provider<I18nContextValue>;
|
|
20
|
+
/**
|
|
21
|
+
* Hook to access the current locale and translate function.
|
|
22
|
+
* Safe to call without a provider — returns passthrough t().
|
|
23
|
+
*/
|
|
24
|
+
export declare function useTranslate(): I18nContextValue;
|
|
25
|
+
/**
|
|
26
|
+
* Create a translate function from a flat messages object.
|
|
27
|
+
*
|
|
28
|
+
* ```ts
|
|
29
|
+
* const t = createTranslate({ 'common.save': 'Save', 'table.showing': 'Showing {{count}} of {{total}}' });
|
|
30
|
+
* t('common.save') // → 'Save'
|
|
31
|
+
* t('table.showing', { count: 5, total: 20 }) // → 'Showing 5 of 20'
|
|
32
|
+
* t('missing.key') // → 'missing.key' (fallback)
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export declare function createTranslate(messages: Record<string, string>): TranslateFunction;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { useEventBus } from "./useEventBus";
|
|
2
|
+
/**
|
|
3
|
+
* Hook to bridge UI events to state machine dispatch
|
|
4
|
+
*
|
|
5
|
+
* @param dispatch - The state machine dispatch function
|
|
6
|
+
* @param validEvents - Optional array of valid event names (filters which events to handle)
|
|
7
|
+
* @param eventBusInstance - Optional event bus instance (for testing, uses hook if not provided)
|
|
8
|
+
*/
|
|
9
|
+
export declare function useUIEvents<E extends string>(dispatch: (event: E, payload?: unknown) => void, validEvents?: readonly E[], eventBusInstance?: ReturnType<typeof useEventBus>): void;
|
|
10
|
+
/**
|
|
11
|
+
* Hook for selected entity tracking
|
|
12
|
+
* Many list UIs need to track which item is selected.
|
|
13
|
+
*
|
|
14
|
+
* This hook uses SelectionProvider if available (preferred),
|
|
15
|
+
* otherwise falls back to listening to events directly.
|
|
16
|
+
*
|
|
17
|
+
* @example Using with SelectionProvider (recommended)
|
|
18
|
+
* ```tsx
|
|
19
|
+
* function MyPage() {
|
|
20
|
+
* return (
|
|
21
|
+
* <EventBusProvider>
|
|
22
|
+
* <SelectionProvider>
|
|
23
|
+
* <MyComponent />
|
|
24
|
+
* </SelectionProvider>
|
|
25
|
+
* </EventBusProvider>
|
|
26
|
+
* );
|
|
27
|
+
* }
|
|
28
|
+
*
|
|
29
|
+
* function MyComponent() {
|
|
30
|
+
* const [selected, setSelected] = useSelectedEntity<Order>();
|
|
31
|
+
* // selected is automatically updated when UI:VIEW/UI:SELECT events fire
|
|
32
|
+
* }
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export declare function useSelectedEntity<T>(eventBusInstance?: ReturnType<typeof useEventBus>): [T | null, (entity: T | null) => void];
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Valid UI slot names
|
|
3
3
|
*/
|
|
4
|
-
type UISlot = 'main' | 'sidebar' | 'modal' | 'drawer' | 'overlay' | 'center' | 'toast' | 'hud-top' | 'hud-bottom' | 'floating';
|
|
4
|
+
export type UISlot = 'main' | 'sidebar' | 'modal' | 'drawer' | 'overlay' | 'center' | 'toast' | 'hud-top' | 'hud-bottom' | 'floating';
|
|
5
5
|
/**
|
|
6
6
|
* Animation types for slot transitions
|
|
7
7
|
*/
|
|
8
|
-
type SlotAnimation = 'fade' | 'slide' | 'scale' | 'none';
|
|
8
|
+
export type SlotAnimation = 'fade' | 'slide' | 'scale' | 'none';
|
|
9
9
|
/**
|
|
10
10
|
* Content rendered in a slot
|
|
11
11
|
*/
|
|
12
|
-
interface SlotContent {
|
|
12
|
+
export interface SlotContent {
|
|
13
13
|
/** Unique ID for this content */
|
|
14
14
|
id: string;
|
|
15
15
|
/** Pattern/component type to render */
|
|
@@ -30,7 +30,7 @@ interface SlotContent {
|
|
|
30
30
|
/**
|
|
31
31
|
* Configuration for render_ui effect
|
|
32
32
|
*/
|
|
33
|
-
interface RenderUIConfig {
|
|
33
|
+
export interface RenderUIConfig {
|
|
34
34
|
/** Target slot */
|
|
35
35
|
target: UISlot;
|
|
36
36
|
/** Pattern/component to render */
|
|
@@ -51,11 +51,11 @@ interface RenderUIConfig {
|
|
|
51
51
|
/**
|
|
52
52
|
* Callback for slot changes
|
|
53
53
|
*/
|
|
54
|
-
type SlotChangeCallback = (slot: UISlot, content: SlotContent | null) => void;
|
|
54
|
+
export type SlotChangeCallback = (slot: UISlot, content: SlotContent | null) => void;
|
|
55
55
|
/**
|
|
56
56
|
* UI Slot Manager interface
|
|
57
57
|
*/
|
|
58
|
-
interface UISlotManager {
|
|
58
|
+
export interface UISlotManager {
|
|
59
59
|
/** Current content for each slot */
|
|
60
60
|
slots: Record<UISlot, SlotContent | null>;
|
|
61
61
|
/** Render content to a slot */
|
|
@@ -80,6 +80,5 @@ declare const DEFAULT_SLOTS: Record<UISlot, SlotContent | null>;
|
|
|
80
80
|
* This is the internal hook that creates the manager.
|
|
81
81
|
* Use `useUISlots()` from context in components.
|
|
82
82
|
*/
|
|
83
|
-
declare function useUISlotManager(): UISlotManager;
|
|
84
|
-
|
|
85
|
-
export { DEFAULT_SLOTS as D, type RenderUIConfig as R, type SlotContent as S, type UISlotManager as U, type UISlot as a, type SlotAnimation as b, type SlotChangeCallback as c, useUISlotManager as u };
|
|
83
|
+
export declare function useUISlotManager(): UISlotManager;
|
|
84
|
+
export { DEFAULT_SLOTS };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export interface LLMErrorContext {
|
|
2
|
+
rawValuePreview?: string;
|
|
3
|
+
expectedType?: string;
|
|
4
|
+
actualType?: string;
|
|
5
|
+
source?: {
|
|
6
|
+
agent: 'requirements' | 'builder' | 'view-planner';
|
|
7
|
+
operation: string;
|
|
8
|
+
promptHash?: string;
|
|
9
|
+
};
|
|
10
|
+
tokenUsage?: {
|
|
11
|
+
prompt: number;
|
|
12
|
+
completion: number;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export interface ValidationError {
|
|
16
|
+
code: string;
|
|
17
|
+
message: string;
|
|
18
|
+
path?: string;
|
|
19
|
+
severity: 'error' | 'warning';
|
|
20
|
+
suggestion?: string;
|
|
21
|
+
validValues?: string[];
|
|
22
|
+
expectedShape?: string;
|
|
23
|
+
fixGuidance?: string;
|
|
24
|
+
llmContext?: LLMErrorContext;
|
|
25
|
+
}
|
|
26
|
+
export interface ValidationResult {
|
|
27
|
+
valid: boolean;
|
|
28
|
+
errors: ValidationError[];
|
|
29
|
+
warnings: ValidationError[];
|
|
30
|
+
}
|
|
31
|
+
export type ValidationStage = 'idle' | 'validating' | 'fixing' | 'complete';
|
|
32
|
+
export interface UseValidationResult {
|
|
33
|
+
result: ValidationResult | null;
|
|
34
|
+
isValidating: boolean;
|
|
35
|
+
error: string | null;
|
|
36
|
+
stage: ValidationStage;
|
|
37
|
+
isFixing: boolean;
|
|
38
|
+
progressMessage: string | null;
|
|
39
|
+
errors: ValidationError[];
|
|
40
|
+
warnings: ValidationError[];
|
|
41
|
+
isValid: boolean;
|
|
42
|
+
validate: (appId: string) => Promise<ValidationResult>;
|
|
43
|
+
clearResult: () => void;
|
|
44
|
+
reset: () => void;
|
|
45
|
+
}
|
|
46
|
+
export declare function useValidation(): UseValidationResult;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API Client - HTTP client for backend API calls
|
|
3
|
+
*
|
|
4
|
+
* Provides typed methods for making API requests.
|
|
5
|
+
* All requests go through the backend server, NOT directly to Firestore.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* API Error class for handling HTTP errors
|
|
11
|
+
*/
|
|
12
|
+
export declare class ApiError extends Error {
|
|
13
|
+
status: number;
|
|
14
|
+
statusText: string;
|
|
15
|
+
constructor(status: number, statusText: string, message?: string);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* API client with typed methods
|
|
19
|
+
*/
|
|
20
|
+
export declare const apiClient: {
|
|
21
|
+
/**
|
|
22
|
+
* GET request
|
|
23
|
+
*/
|
|
24
|
+
get<T>(endpoint: string): Promise<T>;
|
|
25
|
+
/**
|
|
26
|
+
* POST request
|
|
27
|
+
*/
|
|
28
|
+
post<T>(endpoint: string, data?: unknown): Promise<T>;
|
|
29
|
+
/**
|
|
30
|
+
* PUT request
|
|
31
|
+
*/
|
|
32
|
+
put<T>(endpoint: string, data?: unknown): Promise<T>;
|
|
33
|
+
/**
|
|
34
|
+
* PATCH request
|
|
35
|
+
*/
|
|
36
|
+
patch<T>(endpoint: string, data?: unknown): Promise<T>;
|
|
37
|
+
/**
|
|
38
|
+
* DELETE request
|
|
39
|
+
*/
|
|
40
|
+
delete<T = void>(endpoint: string): Promise<T>;
|
|
41
|
+
};
|
|
42
|
+
export default apiClient;
|
package/dist/lib/cn.d.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Debug utilities for development
|
|
3
|
+
*/
|
|
4
|
+
export declare function isDebugEnabled(): boolean;
|
|
5
|
+
export declare function debug(...args: unknown[]): void;
|
|
6
|
+
export declare function debugGroup(label: string): void;
|
|
7
|
+
export declare function debugGroupEnd(): void;
|
|
8
|
+
export declare function debugWarn(...args: unknown[]): void;
|
|
9
|
+
export declare function debugError(...args: unknown[]): void;
|
|
10
|
+
export declare function debugTable(data: unknown): void;
|
|
11
|
+
export declare function debugTime(label: string): void;
|
|
12
|
+
export declare function debugTimeEnd(label: string): void;
|
|
13
|
+
/**
|
|
14
|
+
* Debug input events (keyboard, mouse, touch)
|
|
15
|
+
* @param inputType - Type of input (e.g., 'keydown', 'keyup', 'mouse')
|
|
16
|
+
* @param data - Input data to log
|
|
17
|
+
*/
|
|
18
|
+
export declare function debugInput(inputType: string, data: unknown): void;
|
|
19
|
+
/**
|
|
20
|
+
* Debug collision events between entities
|
|
21
|
+
* @param entityA - First entity in collision
|
|
22
|
+
* @param entityB - Second entity in collision
|
|
23
|
+
* @param details - Additional collision details
|
|
24
|
+
*/
|
|
25
|
+
export declare function debugCollision(entityA: {
|
|
26
|
+
id?: string;
|
|
27
|
+
type?: string;
|
|
28
|
+
}, entityB: {
|
|
29
|
+
id?: string;
|
|
30
|
+
type?: string;
|
|
31
|
+
}, details?: unknown): void;
|
|
32
|
+
/**
|
|
33
|
+
* Debug physics updates (position, velocity)
|
|
34
|
+
* @param entityId - Entity identifier
|
|
35
|
+
* @param physics - Physics data to log
|
|
36
|
+
*/
|
|
37
|
+
export declare function debugPhysics(entityId: string, physics: unknown): void;
|
|
38
|
+
/**
|
|
39
|
+
* Debug game state changes
|
|
40
|
+
* @param stateName - Name of the state that changed
|
|
41
|
+
* @param value - New state value
|
|
42
|
+
*/
|
|
43
|
+
export declare function debugGameState(stateName: string, value: unknown): void;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Debug Registry - Central event log for debugging
|
|
3
|
+
*
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
*/
|
|
6
|
+
export type DebugEventType = 'state-change' | 'event-fired' | 'effect-executed' | 'guard-evaluated' | 'error' | 'warning' | 'info';
|
|
7
|
+
export interface DebugEvent {
|
|
8
|
+
id: string;
|
|
9
|
+
type: DebugEventType;
|
|
10
|
+
source: string;
|
|
11
|
+
message: string;
|
|
12
|
+
data?: Record<string, unknown>;
|
|
13
|
+
timestamp: number;
|
|
14
|
+
}
|
|
15
|
+
type ChangeListener = () => void;
|
|
16
|
+
export declare function logDebugEvent(type: DebugEventType, source: string, message: string, data?: Record<string, unknown>): void;
|
|
17
|
+
export declare function logStateChange(source: string, from: string, to: string, event?: string): void;
|
|
18
|
+
export declare function logEventFired(source: string, eventName: string, payload?: unknown): void;
|
|
19
|
+
export declare function logEffectExecuted(source: string, effectType: string, details?: unknown): void;
|
|
20
|
+
export declare function logError(source: string, message: string, error?: unknown): void;
|
|
21
|
+
export declare function logWarning(source: string, message: string, data?: Record<string, unknown>): void;
|
|
22
|
+
export declare function logInfo(source: string, message: string, data?: Record<string, unknown>): void;
|
|
23
|
+
export declare function getDebugEvents(): DebugEvent[];
|
|
24
|
+
export declare function getRecentEvents(count: number): DebugEvent[];
|
|
25
|
+
export declare function getEventsByType(type: DebugEventType): DebugEvent[];
|
|
26
|
+
export declare function getEventsBySource(source: string): DebugEvent[];
|
|
27
|
+
export declare function subscribeToDebugEvents(listener: ChangeListener): () => void;
|
|
28
|
+
export declare function clearDebugEvents(): void;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Debug Utilities - Functions for toggling and checking debug mode
|
|
3
|
+
*
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
*/
|
|
6
|
+
type DebugToggleListener = (enabled: boolean) => void;
|
|
7
|
+
/**
|
|
8
|
+
* Check if debug mode is enabled
|
|
9
|
+
*/
|
|
10
|
+
export declare function isDebugEnabled(): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Enable or disable debug mode
|
|
13
|
+
*/
|
|
14
|
+
export declare function setDebugEnabled(enabled: boolean): void;
|
|
15
|
+
/**
|
|
16
|
+
* Toggle debug mode
|
|
17
|
+
*/
|
|
18
|
+
export declare function toggleDebug(): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Subscribe to debug mode changes
|
|
21
|
+
*/
|
|
22
|
+
export declare function onDebugToggle(listener: DebugToggleListener): () => void;
|
|
23
|
+
/**
|
|
24
|
+
* Initialize debug mode from keyboard shortcut (Ctrl+Shift+D)
|
|
25
|
+
*/
|
|
26
|
+
export declare function initDebugShortcut(): () => void;
|
|
27
|
+
export {};
|