@almadar/ui 2.0.1 → 2.0.2
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/dist/components/index.css +9 -11
- package/dist/components/index.js +3 -3
- package/dist/providers/index.css +9 -11
- package/dist/providers/index.js +2 -2
- package/package.json +2 -2
- package/dist/components/atoms/Avatar.d.ts +0 -58
- package/dist/components/atoms/Badge.d.ts +0 -8
- package/dist/components/atoms/Box.d.ts +0 -57
- package/dist/components/atoms/Button.d.ts +0 -24
- package/dist/components/atoms/Card.d.ts +0 -18
- package/dist/components/atoms/Center.d.ts +0 -33
- package/dist/components/atoms/Checkbox.d.ts +0 -5
- package/dist/components/atoms/ConditionalWrapper.d.ts +0 -68
- package/dist/components/atoms/Divider.d.ts +0 -29
- package/dist/components/atoms/Icon.d.ts +0 -38
- package/dist/components/atoms/Input.d.ts +0 -26
- package/dist/components/atoms/Label.d.ts +0 -5
- package/dist/components/atoms/LawReferenceTooltip.d.ts +0 -48
- package/dist/components/atoms/Overlay.d.ts +0 -16
- package/dist/components/atoms/ProgressBar.d.ts +0 -63
- package/dist/components/atoms/Radio.d.ts +0 -26
- package/dist/components/atoms/Select.d.ts +0 -12
- package/dist/components/atoms/Spacer.d.ts +0 -25
- package/dist/components/atoms/Spinner.d.ts +0 -6
- package/dist/components/atoms/Stack.d.ts +0 -64
- package/dist/components/atoms/Switch.d.ts +0 -12
- package/dist/components/atoms/TextHighlight.d.ts +0 -53
- package/dist/components/atoms/Textarea.d.ts +0 -5
- package/dist/components/atoms/ThemeSelector.d.ts +0 -21
- package/dist/components/atoms/ThemeToggle.d.ts +0 -33
- package/dist/components/atoms/Typography.d.ts +0 -57
- package/dist/components/atoms/game/ControlButton.d.ts +0 -31
- package/dist/components/atoms/game/HealthBar.d.ts +0 -18
- package/dist/components/atoms/game/ScoreDisplay.d.ts +0 -21
- package/dist/components/atoms/game/Sprite.d.ts +0 -63
- package/dist/components/atoms/game/StateIndicator.d.ts +0 -31
- package/dist/components/atoms/game/index.d.ts +0 -12
- package/dist/components/atoms/index.d.ts +0 -27
- package/dist/components/index.d.ts +0 -6
- package/dist/components/molecules/Accordion.d.ts +0 -67
- package/dist/components/molecules/Alert.d.ts +0 -24
- package/dist/components/molecules/Breadcrumb.d.ts +0 -55
- package/dist/components/molecules/ButtonGroup.d.ts +0 -67
- package/dist/components/molecules/Card.d.ts +0 -44
- package/dist/components/molecules/Container.d.ts +0 -30
- package/dist/components/molecules/Drawer.d.ts +0 -46
- package/dist/components/molecules/EmptyState.d.ts +0 -25
- package/dist/components/molecules/ErrorBoundary.d.ts +0 -55
- package/dist/components/molecules/ErrorState.d.ts +0 -13
- package/dist/components/molecules/FilterGroup.d.ts +0 -54
- package/dist/components/molecules/Flex.d.ts +0 -43
- package/dist/components/molecules/FloatingActionButton.d.ts +0 -69
- package/dist/components/molecules/FormField.d.ts +0 -16
- package/dist/components/molecules/FormSectionHeader.d.ts +0 -30
- package/dist/components/molecules/Grid.d.ts +0 -54
- package/dist/components/molecules/InputGroup.d.ts +0 -24
- package/dist/components/molecules/LoadingState.d.ts +0 -7
- package/dist/components/molecules/Menu.d.ts +0 -40
- package/dist/components/molecules/Modal.d.ts +0 -26
- package/dist/components/molecules/Pagination.d.ts +0 -66
- package/dist/components/molecules/Popover.d.ts +0 -39
- package/dist/components/molecules/QuizBlock.d.ts +0 -20
- package/dist/components/molecules/RelationSelect.d.ts +0 -48
- package/dist/components/molecules/RepeatableFormSection.d.ts +0 -58
- package/dist/components/molecules/ScaledDiagram.d.ts +0 -20
- package/dist/components/molecules/SearchInput.d.ts +0 -60
- package/dist/components/molecules/SidePanel.d.ts +0 -47
- package/dist/components/molecules/SimpleGrid.d.ts +0 -27
- package/dist/components/molecules/Skeleton.d.ts +0 -35
- package/dist/components/molecules/Tabs.d.ts +0 -45
- package/dist/components/molecules/Toast.d.ts +0 -35
- package/dist/components/molecules/Tooltip.d.ts +0 -25
- package/dist/components/molecules/ViolationAlert.d.ts +0 -49
- package/dist/components/molecules/WizardNavigation.d.ts +0 -51
- package/dist/components/molecules/WizardProgress.d.ts +0 -42
- package/dist/components/molecules/game/StatBadge.d.ts +0 -27
- package/dist/components/molecules/index.d.ts +0 -38
- package/dist/components/molecules/markdown/CodeBlock.d.ts +0 -25
- package/dist/components/molecules/markdown/MarkdownContent.d.ts +0 -26
- package/dist/components/organisms/CardGrid.d.ts +0 -72
- package/dist/components/organisms/Chart.d.ts +0 -59
- package/dist/components/organisms/CodeViewer.d.ts +0 -67
- package/dist/components/organisms/ComponentPatterns.d.ts +0 -441
- package/dist/components/organisms/ConfirmDialog.d.ts +0 -50
- package/dist/components/organisms/ContentRenderer.d.ts +0 -23
- package/dist/components/organisms/CustomPattern.d.ts +0 -104
- package/dist/components/organisms/DataTable.d.ts +0 -63
- package/dist/components/organisms/DetailPanel.d.ts +0 -71
- package/dist/components/organisms/DocumentViewer.d.ts +0 -60
- package/dist/components/organisms/DrawerSlot.d.ts +0 -39
- package/dist/components/organisms/Form.d.ts +0 -203
- package/dist/components/organisms/FormSection.d.ts +0 -59
- package/dist/components/organisms/GraphCanvas.d.ts +0 -69
- package/dist/components/organisms/Header.d.ts +0 -110
- package/dist/components/organisms/JazariStateMachine.d.ts +0 -60
- package/dist/components/organisms/LayoutPatterns.d.ts +0 -181
- package/dist/components/organisms/List.d.ts +0 -76
- package/dist/components/organisms/MasterDetail.d.ts +0 -43
- package/dist/components/organisms/MediaGallery.d.ts +0 -66
- package/dist/components/organisms/Meter.d.ts +0 -58
- package/dist/components/organisms/ModalSlot.d.ts +0 -35
- package/dist/components/organisms/Navigation.d.ts +0 -68
- package/dist/components/organisms/OrbitalVisualization.d.ts +0 -48
- package/dist/components/organisms/PageHeader.d.ts +0 -59
- package/dist/components/organisms/Section.d.ts +0 -44
- package/dist/components/organisms/Sidebar.d.ts +0 -65
- package/dist/components/organisms/SignaturePad.d.ts +0 -44
- package/dist/components/organisms/Split.d.ts +0 -42
- package/dist/components/organisms/StatCard.d.ts +0 -66
- package/dist/components/organisms/StateMachineView.d.ts +0 -36
- package/dist/components/organisms/Table.d.ts +0 -99
- package/dist/components/organisms/Timeline.d.ts +0 -58
- package/dist/components/organisms/ToastSlot.d.ts +0 -38
- package/dist/components/organisms/UISlotRenderer.d.ts +0 -112
- package/dist/components/organisms/WizardContainer.d.ts +0 -160
- package/dist/components/organisms/book/BookChapterView.d.ts +0 -17
- package/dist/components/organisms/book/BookCoverPage.d.ts +0 -19
- package/dist/components/organisms/book/BookNavBar.d.ts +0 -18
- package/dist/components/organisms/book/BookTableOfContents.d.ts +0 -18
- package/dist/components/organisms/book/BookViewer.d.ts +0 -28
- package/dist/components/organisms/book/index.d.ts +0 -7
- package/dist/components/organisms/book/types.d.ts +0 -77
- package/dist/components/organisms/game/BattleBoard.d.ts +0 -167
- package/dist/components/organisms/game/CanvasEffect.d.ts +0 -68
- package/dist/components/organisms/game/CastleBoard.d.ts +0 -85
- package/dist/components/organisms/game/DialogueBox.d.ts +0 -73
- package/dist/components/organisms/game/GameAudioProvider.d.ts +0 -47
- package/dist/components/organisms/game/GameAudioToggle.d.ts +0 -28
- package/dist/components/organisms/game/GameHud.d.ts +0 -40
- package/dist/components/organisms/game/GameMenu.d.ts +0 -43
- package/dist/components/organisms/game/GameOverScreen.d.ts +0 -56
- package/dist/components/organisms/game/InventoryPanel.d.ts +0 -67
- package/dist/components/organisms/game/IsometricCanvas.d.ts +0 -123
- package/dist/components/organisms/game/TraitSlot.d.ts +0 -86
- package/dist/components/organisms/game/TraitStateViewer.d.ts +0 -53
- package/dist/components/organisms/game/UncontrolledBattleBoard.d.ts +0 -26
- package/dist/components/organisms/game/WorldMapBoard.d.ts +0 -147
- package/dist/components/organisms/game/editor/editorUtils.d.ts +0 -109
- package/dist/components/organisms/game/editor/index.d.ts +0 -9
- package/dist/components/organisms/game/hooks/useBattleState.d.ts +0 -35
- package/dist/components/organisms/game/hooks/useCamera.d.ts +0 -41
- package/dist/components/organisms/game/hooks/useGameAudio.d.ts +0 -47
- package/dist/components/organisms/game/hooks/useImageCache.d.ts +0 -16
- package/dist/components/organisms/game/hooks/usePhysics2D.d.ts +0 -45
- package/dist/components/organisms/game/hooks/useSpriteAnimations.d.ts +0 -43
- package/dist/components/organisms/game/index.d.ts +0 -36
- package/dist/components/organisms/game/managers/PhysicsManager.d.ts +0 -103
- package/dist/components/organisms/game/types/effects.d.ts +0 -253
- package/dist/components/organisms/game/types/isometric.d.ts +0 -109
- package/dist/components/organisms/game/types/spriteAnimation.d.ts +0 -73
- package/dist/components/organisms/game/utils/canvasEffects.d.ts +0 -50
- package/dist/components/organisms/game/utils/combatPresets.d.ts +0 -15
- package/dist/components/organisms/game/utils/isometric.d.ts +0 -61
- package/dist/components/organisms/game/utils/spriteAnimation.d.ts +0 -57
- package/dist/components/organisms/game/utils/spriteSheetConstants.d.ts +0 -16
- package/dist/components/organisms/index.d.ts +0 -37
- package/dist/components/organisms/layout/DashboardGrid.d.ts +0 -34
- package/dist/components/organisms/layout/MasterDetail.d.ts +0 -32
- package/dist/components/organisms/layout/SplitPane.d.ts +0 -34
- package/dist/components/organisms/layout/TabbedContainer.d.ts +0 -42
- package/dist/components/organisms/layout/index.d.ts +0 -9
- package/dist/components/organisms/types.d.ts +0 -65
- package/dist/components/templates/AuthLayout.d.ts +0 -14
- package/dist/components/templates/BattleTemplate.d.ts +0 -25
- package/dist/components/templates/CastleTemplate.d.ts +0 -23
- package/dist/components/templates/CounterTemplate.d.ts +0 -44
- package/dist/components/templates/DashboardLayout.d.ts +0 -32
- package/dist/components/templates/GameShell.d.ts +0 -33
- package/dist/components/templates/GameTemplate.d.ts +0 -36
- package/dist/components/templates/GenericAppTemplate.d.ts +0 -30
- package/dist/components/templates/WorldMapTemplate.d.ts +0 -29
- package/dist/components/templates/index.d.ts +0 -10
- package/dist/components/templates/types.d.ts +0 -17
- package/dist/context/DesignThemeContext.d.ts +0 -21
- package/dist/context/ThemeContext.d.ts +0 -104
- package/dist/context/UISlotContext.d.ts +0 -75
- package/dist/context/UserContext.d.ts +0 -111
- package/dist/context/index.d.ts +0 -8
- package/dist/hooks/event-bus-types.d.ts +0 -71
- package/dist/hooks/index.d.ts +0 -25
- package/dist/hooks/useAgentChat.d.ts +0 -104
- package/dist/hooks/useAuthContext.d.ts +0 -25
- package/dist/hooks/useCompile.d.ts +0 -22
- package/dist/hooks/useDeepAgentGeneration.d.ts +0 -46
- package/dist/hooks/useEntities.d.ts +0 -52
- package/dist/hooks/useEntityData.d.ts +0 -155
- package/dist/hooks/useEntityMutations.d.ts +0 -80
- package/dist/hooks/useEventBus.d.ts +0 -96
- package/dist/hooks/useExtensions.d.ts +0 -32
- package/dist/hooks/useFileEditor.d.ts +0 -32
- package/dist/hooks/useFileSystem.d.ts +0 -40
- package/dist/hooks/useGitHub.d.ts +0 -58
- package/dist/hooks/useOrbitalHistory.d.ts +0 -39
- package/dist/hooks/useOrbitalMutations.d.ts +0 -95
- package/dist/hooks/usePreview.d.ts +0 -57
- package/dist/hooks/useQuerySingleton.d.ts +0 -78
- package/dist/hooks/useResolvedEntity.d.ts +0 -32
- package/dist/hooks/useTranslate.d.ts +0 -35
- package/dist/hooks/useUIEvents.d.ts +0 -35
- package/dist/hooks/useUISlots.d.ts +0 -84
- package/dist/hooks/useValidation.d.ts +0 -46
- package/dist/lib/api-client.d.ts +0 -42
- package/dist/lib/cn.d.ts +0 -6
- package/dist/lib/debug.d.ts +0 -43
- package/dist/lib/debugRegistry.d.ts +0 -29
- package/dist/lib/debugUtils.d.ts +0 -27
- package/dist/lib/entityDebug.d.ts +0 -38
- package/dist/lib/getNestedValue.d.ts +0 -33
- package/dist/lib/guardRegistry.d.ts +0 -32
- package/dist/lib/index.d.ts +0 -18
- package/dist/lib/jazari/svg-paths.d.ts +0 -61
- package/dist/lib/parseContentSegments.d.ts +0 -41
- package/dist/lib/tickRegistry.d.ts +0 -40
- package/dist/lib/traitRegistry.d.ts +0 -34
- package/dist/lib/verificationRegistry.d.ts +0 -107
- package/dist/lib/visualizer/index.d.ts +0 -143
- package/dist/locales/index.d.ts +0 -20
- package/dist/providers/EventBusProvider.d.ts +0 -60
- package/dist/providers/FetchedDataProvider.d.ts +0 -105
- package/dist/providers/OfflineModeProvider.d.ts +0 -79
- package/dist/providers/OrbitalProvider.d.ts +0 -101
- package/dist/providers/SelectionProvider.d.ts +0 -81
- package/dist/providers/VerificationProvider.d.ts +0 -63
- package/dist/providers/index.d.ts +0 -17
- package/dist/renderer/client-effect-executor.d.ts +0 -68
- package/dist/renderer/data-resolver.d.ts +0 -68
- package/dist/renderer/index.d.ts +0 -28
- package/dist/renderer/init.d.ts +0 -14
- package/dist/renderer/navigation.d.ts +0 -142
- package/dist/renderer/offline-executor.d.ts +0 -238
- package/dist/renderer/pattern-resolver.d.ts +0 -91
- package/dist/renderer/slot-definitions.d.ts +0 -45
- package/dist/renderer/types.d.ts +0 -160
- package/dist/renderer/useClientEffects.d.ts +0 -88
- package/dist/stores/entityStore.d.ts +0 -99
- package/dist/stores/filtering.d.ts +0 -51
- package/dist/stores/index.d.ts +0 -7
- package/dist/{chunk-RIZ76XRF.js → chunk-X3IKFHFT.js} +1 -1
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* UISlotContext
|
|
3
|
-
*
|
|
4
|
-
* React context for providing the UI Slot Manager throughout the application.
|
|
5
|
-
* Traits use this context to render content into slots via render_ui effects.
|
|
6
|
-
*
|
|
7
|
-
* Usage:
|
|
8
|
-
* ```tsx
|
|
9
|
-
* // In App.tsx or layout
|
|
10
|
-
* <UISlotProvider>
|
|
11
|
-
* <App />
|
|
12
|
-
* </UISlotProvider>
|
|
13
|
-
*
|
|
14
|
-
* // In trait hooks or components
|
|
15
|
-
* const { render, clear } = useUISlots();
|
|
16
|
-
* render({ target: 'modal', pattern: 'form-section', props: {...} });
|
|
17
|
-
* ```
|
|
18
|
-
*
|
|
19
|
-
* @packageDocumentation
|
|
20
|
-
*/
|
|
21
|
-
import React from 'react';
|
|
22
|
-
import { type UISlotManager, type UISlot, type SlotContent, type RenderUIConfig, type SlotAnimation, type SlotChangeCallback } from '../hooks/useUISlots';
|
|
23
|
-
/**
|
|
24
|
-
* Context for the UI Slot Manager
|
|
25
|
-
*/
|
|
26
|
-
declare const UISlotContext: React.Context<UISlotManager | null>;
|
|
27
|
-
export interface UISlotProviderProps {
|
|
28
|
-
children: React.ReactNode;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Provider component that creates and provides the UI Slot Manager.
|
|
32
|
-
*
|
|
33
|
-
* Must wrap any components that use traits with render_ui effects.
|
|
34
|
-
*/
|
|
35
|
-
export declare function UISlotProvider({ children }: UISlotProviderProps): React.ReactElement;
|
|
36
|
-
/**
|
|
37
|
-
* Hook to access the UI Slot Manager.
|
|
38
|
-
*
|
|
39
|
-
* Must be used within a UISlotProvider.
|
|
40
|
-
*
|
|
41
|
-
* @throws Error if used outside of UISlotProvider
|
|
42
|
-
*
|
|
43
|
-
* @example
|
|
44
|
-
* ```tsx
|
|
45
|
-
* function MyTraitHook() {
|
|
46
|
-
* const { render, clear } = useUISlots();
|
|
47
|
-
*
|
|
48
|
-
* const showModal = () => {
|
|
49
|
-
* render({
|
|
50
|
-
* target: 'modal',
|
|
51
|
-
* pattern: 'form-section',
|
|
52
|
-
* props: { title: 'Create Item' },
|
|
53
|
-
* });
|
|
54
|
-
* };
|
|
55
|
-
*
|
|
56
|
-
* const closeModal = () => {
|
|
57
|
-
* clear('modal');
|
|
58
|
-
* };
|
|
59
|
-
*
|
|
60
|
-
* return { showModal, closeModal };
|
|
61
|
-
* }
|
|
62
|
-
* ```
|
|
63
|
-
*/
|
|
64
|
-
export declare function useUISlots(): UISlotManager;
|
|
65
|
-
/**
|
|
66
|
-
* Hook to get content for a specific slot.
|
|
67
|
-
*
|
|
68
|
-
* Useful for components that only need to read slot state.
|
|
69
|
-
*/
|
|
70
|
-
export declare function useSlotContent(slot: UISlot): SlotContent | null;
|
|
71
|
-
/**
|
|
72
|
-
* Hook to check if a slot has content.
|
|
73
|
-
*/
|
|
74
|
-
export declare function useSlotHasContent(slot: UISlot): boolean;
|
|
75
|
-
export { UISlotContext, type UISlotManager, type UISlot, type SlotContent, type RenderUIConfig, type SlotAnimation, type SlotChangeCallback, };
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* UserContext
|
|
3
|
-
*
|
|
4
|
-
* React context for providing user data throughout the application.
|
|
5
|
-
* Enables @user bindings in S-expressions for role-based UI and permissions.
|
|
6
|
-
*
|
|
7
|
-
* Usage:
|
|
8
|
-
* ```tsx
|
|
9
|
-
* // In App.tsx or layout
|
|
10
|
-
* <UserProvider user={{ id: '123', role: 'admin', permissions: ['read', 'write'] }}>
|
|
11
|
-
* <App />
|
|
12
|
-
* </UserProvider>
|
|
13
|
-
*
|
|
14
|
-
* // In components - access via hook
|
|
15
|
-
* const { user, hasRole, hasPermission } = useUser();
|
|
16
|
-
* if (hasRole('admin')) { ... }
|
|
17
|
-
* if (hasPermission('delete')) { ... }
|
|
18
|
-
* ```
|
|
19
|
-
*
|
|
20
|
-
* @packageDocumentation
|
|
21
|
-
*/
|
|
22
|
-
import React from 'react';
|
|
23
|
-
/**
|
|
24
|
-
* User data for @user bindings.
|
|
25
|
-
* Matches UserContext type from evaluator/context.ts
|
|
26
|
-
*/
|
|
27
|
-
export interface UserData {
|
|
28
|
-
/** User's unique ID */
|
|
29
|
-
id: string;
|
|
30
|
-
/** User's email */
|
|
31
|
-
email?: string;
|
|
32
|
-
/** User's display name */
|
|
33
|
-
name?: string;
|
|
34
|
-
/** User's role (for RBAC) */
|
|
35
|
-
role?: string;
|
|
36
|
-
/** User's permissions */
|
|
37
|
-
permissions?: string[];
|
|
38
|
-
/** Additional custom profile fields */
|
|
39
|
-
[key: string]: unknown;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* User context value.
|
|
43
|
-
*/
|
|
44
|
-
export interface UserContextValue {
|
|
45
|
-
/** Current user data (null if not logged in) */
|
|
46
|
-
user: UserData | null;
|
|
47
|
-
/** Check if user is logged in */
|
|
48
|
-
isLoggedIn: boolean;
|
|
49
|
-
/** Check if user has a specific role */
|
|
50
|
-
hasRole: (role: string) => boolean;
|
|
51
|
-
/** Check if user has a specific permission */
|
|
52
|
-
hasPermission: (permission: string) => boolean;
|
|
53
|
-
/** Check if user has any of the specified roles */
|
|
54
|
-
hasAnyRole: (roles: string[]) => boolean;
|
|
55
|
-
/** Check if user has all of the specified permissions */
|
|
56
|
-
hasAllPermissions: (permissions: string[]) => boolean;
|
|
57
|
-
/** Get a user field by path (for @user.field bindings) */
|
|
58
|
-
getUserField: (path: string) => unknown;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Anonymous user for when no user is logged in.
|
|
62
|
-
*/
|
|
63
|
-
declare const ANONYMOUS_USER: UserData;
|
|
64
|
-
declare const UserContext: React.Context<UserContextValue | null>;
|
|
65
|
-
export interface UserProviderProps {
|
|
66
|
-
/** User data (null if not logged in) */
|
|
67
|
-
user?: UserData | null;
|
|
68
|
-
/** Children to render */
|
|
69
|
-
children: React.ReactNode;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Provider component that provides user context to the application.
|
|
73
|
-
*
|
|
74
|
-
* Provides RBAC helpers and field access for @user bindings.
|
|
75
|
-
*/
|
|
76
|
-
export declare function UserProvider({ user, children, }: UserProviderProps): React.ReactElement;
|
|
77
|
-
/**
|
|
78
|
-
* Hook to access the user context.
|
|
79
|
-
*
|
|
80
|
-
* Returns default values if used outside of UserProvider (for resilience).
|
|
81
|
-
*
|
|
82
|
-
* @example
|
|
83
|
-
* ```tsx
|
|
84
|
-
* function AdminPanel() {
|
|
85
|
-
* const { user, hasRole, hasPermission } = useUser();
|
|
86
|
-
*
|
|
87
|
-
* if (!hasRole('admin') && !hasPermission('admin:access')) {
|
|
88
|
-
* return <AccessDenied />;
|
|
89
|
-
* }
|
|
90
|
-
*
|
|
91
|
-
* return <div>Welcome, {user?.name}</div>;
|
|
92
|
-
* }
|
|
93
|
-
* ```
|
|
94
|
-
*/
|
|
95
|
-
export declare function useUser(): UserContextValue;
|
|
96
|
-
/**
|
|
97
|
-
* Hook to check if user has a specific role.
|
|
98
|
-
* Convenience wrapper around useUser().hasRole().
|
|
99
|
-
*/
|
|
100
|
-
export declare function useHasRole(role: string): boolean;
|
|
101
|
-
/**
|
|
102
|
-
* Hook to check if user has a specific permission.
|
|
103
|
-
* Convenience wrapper around useUser().hasPermission().
|
|
104
|
-
*/
|
|
105
|
-
export declare function useHasPermission(permission: string): boolean;
|
|
106
|
-
/**
|
|
107
|
-
* Hook to get user data for @user bindings in S-expressions.
|
|
108
|
-
* Returns the user data object compatible with EvaluationContext.user
|
|
109
|
-
*/
|
|
110
|
-
export declare function useUserForEvaluation(): UserData | undefined;
|
|
111
|
-
export { UserContext, ANONYMOUS_USER };
|
package/dist/context/index.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Context barrel export
|
|
3
|
-
*/
|
|
4
|
-
export { UISlotProvider, useUISlots, useSlotContent, useSlotHasContent, UISlotContext, type UISlotManager, type UISlot, type SlotContent, type RenderUIConfig, type SlotAnimation, type SlotChangeCallback, } from "./UISlotContext";
|
|
5
|
-
export { ThemeProvider, useTheme, BUILT_IN_THEMES, type ThemeDefinition, type ThemeProviderProps, type ColorMode, type ResolvedMode, type DesignTheme, } from "./ThemeContext";
|
|
6
|
-
export { default as ThemeContext } from "./ThemeContext";
|
|
7
|
-
export { DesignThemeProvider, useDesignTheme } from "./DesignThemeContext";
|
|
8
|
-
export { UserProvider, UserContext, useUser, useHasRole, useHasPermission, useUserForEvaluation, ANONYMOUS_USER, type UserData, type UserContextValue, type UserProviderProps, } from "./UserContext";
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Event Bus Types
|
|
3
|
-
*
|
|
4
|
-
* Type definitions for the page event bus system.
|
|
5
|
-
*
|
|
6
|
-
* @packageDocumentation
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* A KFlow event that can be emitted on the event bus.
|
|
10
|
-
*/
|
|
11
|
-
export interface KFlowEvent {
|
|
12
|
-
/** Event type identifier (e.g., 'TASK_COMPLETED', 'VALIDATION_SUCCESS') */
|
|
13
|
-
type: string;
|
|
14
|
-
/** Optional payload data */
|
|
15
|
-
payload?: Record<string, unknown>;
|
|
16
|
-
/** Timestamp when the event was emitted */
|
|
17
|
-
timestamp: number;
|
|
18
|
-
/** Source trait or component that emitted the event */
|
|
19
|
-
source?: string;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Event listener callback function.
|
|
23
|
-
*/
|
|
24
|
-
export type EventListener = (event: KFlowEvent) => void;
|
|
25
|
-
/**
|
|
26
|
-
* Function to unsubscribe from events.
|
|
27
|
-
*/
|
|
28
|
-
export type Unsubscribe = () => void;
|
|
29
|
-
/**
|
|
30
|
-
* Event bus context type.
|
|
31
|
-
*/
|
|
32
|
-
export interface EventBusContextType {
|
|
33
|
-
/**
|
|
34
|
-
* Emit an event to all listeners.
|
|
35
|
-
*
|
|
36
|
-
* @param type - Event type identifier
|
|
37
|
-
* @param payload - Optional payload data
|
|
38
|
-
*/
|
|
39
|
-
emit: (type: string, payload?: Record<string, unknown>) => void;
|
|
40
|
-
/**
|
|
41
|
-
* Subscribe to an event type.
|
|
42
|
-
*
|
|
43
|
-
* @param type - Event type to listen for
|
|
44
|
-
* @param listener - Callback function
|
|
45
|
-
* @returns Unsubscribe function
|
|
46
|
-
*/
|
|
47
|
-
on: (type: string, listener: EventListener) => Unsubscribe;
|
|
48
|
-
/**
|
|
49
|
-
* Subscribe to an event type, but only fire once.
|
|
50
|
-
*
|
|
51
|
-
* @param type - Event type to listen for
|
|
52
|
-
* @param listener - Callback function
|
|
53
|
-
* @returns Unsubscribe function
|
|
54
|
-
*/
|
|
55
|
-
once: (type: string, listener: EventListener) => Unsubscribe;
|
|
56
|
-
/**
|
|
57
|
-
* Check if there are any listeners for an event type.
|
|
58
|
-
*
|
|
59
|
-
* @param type - Event type to check
|
|
60
|
-
* @returns True if there are listeners
|
|
61
|
-
*/
|
|
62
|
-
hasListeners: (type: string) => boolean;
|
|
63
|
-
/**
|
|
64
|
-
* Subscribe to ALL events regardless of type.
|
|
65
|
-
* Useful for verification, debugging, and analytics.
|
|
66
|
-
*
|
|
67
|
-
* @param listener - Callback function invoked for every emitted event
|
|
68
|
-
* @returns Unsubscribe function
|
|
69
|
-
*/
|
|
70
|
-
onAny?: (listener: EventListener) => Unsubscribe;
|
|
71
|
-
}
|
package/dist/hooks/index.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Hooks barrel export
|
|
3
|
-
*/
|
|
4
|
-
export { useOrbitalHistory, type HistoryTimelineItem, type RevertResult, type ChangeSummary, type UseOrbitalHistoryOptions, type UseOrbitalHistoryResult, } from './useOrbitalHistory';
|
|
5
|
-
export { useFileSystem, type FileSystemStatus, type FileSystemFile, type SelectedFile, type UseFileSystemResult, } from './useFileSystem';
|
|
6
|
-
export { useExtensions, type Extension, type ExtensionManifest, type UseExtensionsOptions, type UseExtensionsResult, } from './useExtensions';
|
|
7
|
-
export { useFileEditor, type OpenFile, type UseFileEditorOptions, type UseFileEditorResult, } from './useFileEditor';
|
|
8
|
-
export { useCompile, type CompileStage, type CompileResult, type UseCompileResult, } from './useCompile';
|
|
9
|
-
export { usePreview } from './usePreview';
|
|
10
|
-
export { useAgentChat } from './useAgentChat';
|
|
11
|
-
export { useValidation } from './useValidation';
|
|
12
|
-
export { useDeepAgentGeneration } from './useDeepAgentGeneration';
|
|
13
|
-
export { useEventBus, useEventListener, useEmitEvent } from './useEventBus';
|
|
14
|
-
export type { KFlowEvent, EventListener, Unsubscribe, EventBusContextType } from './event-bus-types';
|
|
15
|
-
export { useUISlotManager, DEFAULT_SLOTS, type UISlot, type SlotAnimation, type SlotContent, type RenderUIConfig, type SlotChangeCallback, type UISlotManager, } from './useUISlots';
|
|
16
|
-
export { useUIEvents, useSelectedEntity } from './useUIEvents';
|
|
17
|
-
export { useEntityList, useEntityDetail, useEntity, useEntityListSuspense, useEntitySuspense, entityDataKeys, EntityDataProvider, useEntityDataAdapter, type EntityDataAdapter, type EntityDataRecord, type UseEntityListOptions, type UseEntityListResult, type UseEntityDetailResult, } from './useEntityData';
|
|
18
|
-
export { useQuerySingleton, parseQueryBinding, type QueryState, type QuerySingletonEntity, type QuerySingletonResult, type QuerySingletonState, } from './useQuerySingleton';
|
|
19
|
-
export { useEntityMutations, useCreateEntity, useUpdateEntity, useDeleteEntity, type EntityMutationResult, type UseEntityMutationsOptions, } from './useEntityMutations';
|
|
20
|
-
export { useOrbitalMutations, useSendOrbitalEvent, ENTITY_EVENTS, type OrbitalEventPayload, type OrbitalEventResponse, } from './useOrbitalMutations';
|
|
21
|
-
export { useEntities, useEntity as useEntityById, useEntitiesByType, useSingletonEntity, usePlayer, usePhysics, useInput, spawnEntity, updateEntity, updateSingleton, removeEntity, clearEntities, getEntity, getByType, getAllEntities, getSingleton, type Entity, } from './useEntities';
|
|
22
|
-
export { useTranslate, I18nProvider, createTranslate, type TranslateFunction, type I18nContextValue, } from './useTranslate';
|
|
23
|
-
export { useResolvedEntity, type ResolvedEntity, } from './useResolvedEntity';
|
|
24
|
-
export { useAuthContext, type AuthUser, type AuthContextValue, } from './useAuthContext';
|
|
25
|
-
export { useGitHubStatus, useConnectGitHub, useDisconnectGitHub, useGitHubRepos, useGitHubRepo, useGitHubBranches, type GitHubStatus, type GitHubRepo, } from './useGitHub';
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import type { DeepAgentInterrupt } from './useDeepAgentGeneration';
|
|
2
|
-
export interface ChatMessage {
|
|
3
|
-
id: string;
|
|
4
|
-
role: 'user' | 'assistant' | 'system';
|
|
5
|
-
content: string;
|
|
6
|
-
timestamp: number;
|
|
7
|
-
}
|
|
8
|
-
export type AvatarRole = 'user' | 'assistant' | 'system';
|
|
9
|
-
export type FileOperation = 'ls' | 'read_file' | 'write_file' | 'edit_file';
|
|
10
|
-
export type Activity = {
|
|
11
|
-
type: 'message';
|
|
12
|
-
role: AvatarRole;
|
|
13
|
-
content: string;
|
|
14
|
-
timestamp: number;
|
|
15
|
-
isStreaming?: boolean;
|
|
16
|
-
} | {
|
|
17
|
-
type: 'tool_call';
|
|
18
|
-
tool: string;
|
|
19
|
-
args: Record<string, unknown>;
|
|
20
|
-
timestamp: number;
|
|
21
|
-
isExecuting?: boolean;
|
|
22
|
-
} | {
|
|
23
|
-
type: 'tool_result';
|
|
24
|
-
tool: string;
|
|
25
|
-
result: unknown;
|
|
26
|
-
success: boolean;
|
|
27
|
-
timestamp: number;
|
|
28
|
-
} | {
|
|
29
|
-
type: 'file_operation';
|
|
30
|
-
operation: FileOperation;
|
|
31
|
-
path: string;
|
|
32
|
-
success?: boolean;
|
|
33
|
-
timestamp: number;
|
|
34
|
-
} | {
|
|
35
|
-
type: 'schema_diff';
|
|
36
|
-
filePath: string;
|
|
37
|
-
hunks: DiffHunk[];
|
|
38
|
-
timestamp: number;
|
|
39
|
-
} | {
|
|
40
|
-
type: 'error';
|
|
41
|
-
message: string;
|
|
42
|
-
code?: string;
|
|
43
|
-
timestamp: number;
|
|
44
|
-
};
|
|
45
|
-
export interface TodoActivity {
|
|
46
|
-
type: 'thinking' | 'tool_call' | 'tool_result' | 'code_change';
|
|
47
|
-
content: string;
|
|
48
|
-
timestamp: number;
|
|
49
|
-
tool?: string;
|
|
50
|
-
success?: boolean;
|
|
51
|
-
filePath?: string;
|
|
52
|
-
diff?: string;
|
|
53
|
-
}
|
|
54
|
-
export interface Todo {
|
|
55
|
-
id: string;
|
|
56
|
-
task: string;
|
|
57
|
-
status: 'pending' | 'in_progress' | 'completed';
|
|
58
|
-
latestActivity?: TodoActivity;
|
|
59
|
-
activityHistory?: TodoActivity[];
|
|
60
|
-
}
|
|
61
|
-
export interface DiffHunk {
|
|
62
|
-
oldStart: number;
|
|
63
|
-
oldLines: number;
|
|
64
|
-
newStart: number;
|
|
65
|
-
newLines: number;
|
|
66
|
-
lines: Array<{
|
|
67
|
-
type: 'add' | 'remove' | 'context';
|
|
68
|
-
content: string;
|
|
69
|
-
}>;
|
|
70
|
-
}
|
|
71
|
-
export interface SchemaDiff {
|
|
72
|
-
id: string;
|
|
73
|
-
filePath: string;
|
|
74
|
-
hunks: DiffHunk[];
|
|
75
|
-
timestamp: number;
|
|
76
|
-
addedLines: number;
|
|
77
|
-
removedLines: number;
|
|
78
|
-
}
|
|
79
|
-
export type AgentStatus = 'idle' | 'running' | 'complete' | 'error' | 'interrupted';
|
|
80
|
-
export interface UseAgentChatOptions {
|
|
81
|
-
appId?: string;
|
|
82
|
-
onComplete?: (schema?: unknown) => void;
|
|
83
|
-
onSchemaChange?: (diff?: unknown) => void;
|
|
84
|
-
onError?: (error: Error | string) => void;
|
|
85
|
-
}
|
|
86
|
-
export interface UseAgentChatResult {
|
|
87
|
-
messages: ChatMessage[];
|
|
88
|
-
status: AgentStatus;
|
|
89
|
-
activities: Activity[];
|
|
90
|
-
todos: Todo[];
|
|
91
|
-
schemaDiffs: SchemaDiff[];
|
|
92
|
-
isLoading: boolean;
|
|
93
|
-
error: string | null;
|
|
94
|
-
threadId: string | null;
|
|
95
|
-
interrupt: DeepAgentInterrupt | null;
|
|
96
|
-
sendMessage: (content: string) => Promise<void>;
|
|
97
|
-
startGeneration: (skill: string | string[], prompt: string, options?: Record<string, unknown>) => Promise<void>;
|
|
98
|
-
continueConversation: (message: string | string[]) => Promise<void>;
|
|
99
|
-
resumeWithDecision: (decisions: unknown[]) => Promise<void>;
|
|
100
|
-
cancel: () => void;
|
|
101
|
-
clearMessages: () => void;
|
|
102
|
-
clearHistory: () => void;
|
|
103
|
-
}
|
|
104
|
-
export declare function useAgentChat(options?: UseAgentChatOptions): UseAgentChatResult;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Auth Context Hook Stub
|
|
3
|
-
*
|
|
4
|
-
* Provides a placeholder auth context for the design system.
|
|
5
|
-
* Applications should provide their own AuthContext provider
|
|
6
|
-
* that implements this interface.
|
|
7
|
-
*/
|
|
8
|
-
export interface AuthUser {
|
|
9
|
-
uid: string;
|
|
10
|
-
email: string | null;
|
|
11
|
-
displayName: string | null;
|
|
12
|
-
photoURL: string | null;
|
|
13
|
-
}
|
|
14
|
-
export interface AuthContextValue {
|
|
15
|
-
user: AuthUser | null;
|
|
16
|
-
loading: boolean;
|
|
17
|
-
signIn?: () => Promise<void>;
|
|
18
|
-
signOut?: () => Promise<void>;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Stub hook that returns empty auth context.
|
|
22
|
-
* Applications should wrap their app with an AuthProvider
|
|
23
|
-
* that supplies real auth state.
|
|
24
|
-
*/
|
|
25
|
-
export declare function useAuthContext(): AuthContextValue;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export interface SchemaLike {
|
|
2
|
-
name: string;
|
|
3
|
-
version?: string;
|
|
4
|
-
[key: string]: unknown;
|
|
5
|
-
}
|
|
6
|
-
export type CompileStage = 'idle' | 'compiling' | 'done' | 'error';
|
|
7
|
-
export interface CompileResult {
|
|
8
|
-
success: boolean;
|
|
9
|
-
files?: Array<{
|
|
10
|
-
path: string;
|
|
11
|
-
content: string;
|
|
12
|
-
}>;
|
|
13
|
-
errors?: string[];
|
|
14
|
-
}
|
|
15
|
-
export interface UseCompileResult {
|
|
16
|
-
isCompiling: boolean;
|
|
17
|
-
stage: CompileStage;
|
|
18
|
-
lastResult: CompileResult | null;
|
|
19
|
-
error: string | null;
|
|
20
|
-
compileSchema: (schema: SchemaLike) => Promise<CompileResult | null>;
|
|
21
|
-
}
|
|
22
|
-
export declare function useCompile(): UseCompileResult;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import type { OrbitalSchema } from '@almadar/core';
|
|
2
|
-
export interface DeepAgentActionRequest {
|
|
3
|
-
id: string;
|
|
4
|
-
type: string;
|
|
5
|
-
tool: string;
|
|
6
|
-
args: Record<string, unknown>;
|
|
7
|
-
description?: string;
|
|
8
|
-
allowedDecisions: ('approve' | 'edit' | 'reject')[];
|
|
9
|
-
status: 'pending' | 'approved' | 'rejected' | 'edited';
|
|
10
|
-
}
|
|
11
|
-
export interface DeepAgentInterrupt {
|
|
12
|
-
id: string;
|
|
13
|
-
type: 'tool_calls' | 'confirmation' | 'error';
|
|
14
|
-
message?: string;
|
|
15
|
-
actionRequests: DeepAgentActionRequest[];
|
|
16
|
-
timestamp: number;
|
|
17
|
-
threadId?: string;
|
|
18
|
-
}
|
|
19
|
-
export interface GenerationRequest {
|
|
20
|
-
id: string;
|
|
21
|
-
prompt: string;
|
|
22
|
-
status: 'pending' | 'running' | 'completed' | 'failed';
|
|
23
|
-
result?: OrbitalSchema;
|
|
24
|
-
error?: string;
|
|
25
|
-
}
|
|
26
|
-
export interface GenerationProgress {
|
|
27
|
-
stage: string;
|
|
28
|
-
percent: number;
|
|
29
|
-
message: string;
|
|
30
|
-
}
|
|
31
|
-
export interface UseDeepAgentGenerationResult {
|
|
32
|
-
requests: GenerationRequest[];
|
|
33
|
-
currentRequest: GenerationRequest | null;
|
|
34
|
-
isGenerating: boolean;
|
|
35
|
-
isLoading: boolean;
|
|
36
|
-
isComplete: boolean;
|
|
37
|
-
progress: GenerationProgress;
|
|
38
|
-
error: string | null;
|
|
39
|
-
interrupt: DeepAgentInterrupt | null;
|
|
40
|
-
generate: (prompt: string) => Promise<OrbitalSchema | null>;
|
|
41
|
-
startGeneration: (skill: string, prompt: string, options?: Record<string, unknown>) => Promise<void>;
|
|
42
|
-
cancelGeneration: () => void;
|
|
43
|
-
clearRequests: () => void;
|
|
44
|
-
submitInterruptDecisions: (decisions: unknown[]) => void;
|
|
45
|
-
}
|
|
46
|
-
export declare function useDeepAgentGeneration(): UseDeepAgentGenerationResult;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { getEntity, getByType, getAllEntities, getSingleton, spawnEntity, updateEntity, updateSingleton, removeEntity, clearEntities } from '../stores/entityStore';
|
|
2
|
-
import type { Entity } from '../stores/entityStore';
|
|
3
|
-
export type { Entity };
|
|
4
|
-
/**
|
|
5
|
-
* Hook to access all entities
|
|
6
|
-
*/
|
|
7
|
-
export declare function useEntities(): {
|
|
8
|
-
entities: Map<string, Entity>;
|
|
9
|
-
getEntity: typeof getEntity;
|
|
10
|
-
getByType: typeof getByType;
|
|
11
|
-
getAllEntities: typeof getAllEntities;
|
|
12
|
-
getSingleton: typeof getSingleton;
|
|
13
|
-
spawnEntity: typeof spawnEntity;
|
|
14
|
-
updateEntity: typeof updateEntity;
|
|
15
|
-
updateSingleton: typeof updateSingleton;
|
|
16
|
-
removeEntity: typeof removeEntity;
|
|
17
|
-
clearEntities: typeof clearEntities;
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* Hook to access a specific entity by ID
|
|
21
|
-
*/
|
|
22
|
-
export declare function useEntity(id: string): Entity | undefined;
|
|
23
|
-
/**
|
|
24
|
-
* Hook to access entities of a specific type
|
|
25
|
-
*/
|
|
26
|
-
export declare function useEntitiesByType(type: string): Entity[];
|
|
27
|
-
/**
|
|
28
|
-
* Hook to access a singleton entity by type
|
|
29
|
-
*/
|
|
30
|
-
export declare function useSingletonEntity<T extends Entity = Entity>(type: string): T | undefined;
|
|
31
|
-
/**
|
|
32
|
-
* Hook for Player entity (convenience)
|
|
33
|
-
*/
|
|
34
|
-
export declare function usePlayer(): {
|
|
35
|
-
player: Entity | undefined;
|
|
36
|
-
updatePlayer: (updates: Partial<Entity>) => void;
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* Hook for Physics entity (convenience)
|
|
40
|
-
*/
|
|
41
|
-
export declare function usePhysics(): {
|
|
42
|
-
physics: Entity | undefined;
|
|
43
|
-
updatePhysics: (updates: Partial<Entity>) => void;
|
|
44
|
-
};
|
|
45
|
-
/**
|
|
46
|
-
* Hook for Input entity (convenience)
|
|
47
|
-
*/
|
|
48
|
-
export declare function useInput(): {
|
|
49
|
-
input: Entity | undefined;
|
|
50
|
-
updateInput: (updates: Partial<Entity>) => void;
|
|
51
|
-
};
|
|
52
|
-
export { spawnEntity, updateEntity, updateSingleton, removeEntity, clearEntities, getEntity, getByType, getAllEntities, getSingleton, };
|