@elizaos/app-core 2.0.0-alpha.73 → 2.0.0-alpha.75
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/App.d.ts +5 -0
- package/App.d.ts.map +1 -0
- package/App.js +220 -0
- package/actions/character.d.ts +39 -0
- package/actions/character.d.ts.map +1 -0
- package/actions/character.js +247 -0
- package/actions/chat-helpers.d.ts +47 -0
- package/actions/chat-helpers.d.ts.map +1 -0
- package/actions/chat-helpers.js +79 -0
- package/actions/cloud.d.ts +17 -0
- package/actions/cloud.d.ts.map +1 -0
- package/actions/cloud.js +43 -0
- package/actions/index.d.ts +12 -0
- package/actions/index.d.ts.map +1 -0
- package/actions/index.js +11 -0
- package/actions/lifecycle.d.ts +43 -0
- package/actions/lifecycle.d.ts.map +1 -0
- package/actions/lifecycle.js +118 -0
- package/actions/onboarding.d.ts +12 -0
- package/actions/onboarding.d.ts.map +1 -0
- package/actions/onboarding.js +26 -0
- package/actions/triggers.d.ts +23 -0
- package/actions/triggers.d.ts.map +1 -0
- package/actions/triggers.js +148 -0
- package/api/client.d.ts +2736 -0
- package/api/client.d.ts.map +1 -0
- package/api/client.js +2492 -0
- package/api/index.d.ts +2 -0
- package/api/index.d.ts.map +1 -0
- package/autonomy/index.d.ts +48 -0
- package/autonomy/index.d.ts.map +1 -0
- package/autonomy/index.js +330 -0
- package/bridge/capacitor-bridge.d.ts +153 -0
- package/bridge/capacitor-bridge.d.ts.map +1 -0
- package/bridge/capacitor-bridge.js +193 -0
- package/bridge/electrobun-rpc.d.ts +28 -0
- package/bridge/electrobun-rpc.d.ts.map +1 -0
- package/bridge/electrobun-rpc.js +35 -0
- package/bridge/electrobun-runtime.d.ts +3 -0
- package/bridge/electrobun-runtime.d.ts.map +1 -0
- package/bridge/electrobun-runtime.js +17 -0
- package/bridge/index.d.ts +6 -0
- package/bridge/index.d.ts.map +1 -0
- package/bridge/native-plugins.d.ts +82 -0
- package/bridge/native-plugins.d.ts.map +1 -0
- package/bridge/native-plugins.js +39 -0
- package/bridge/plugin-bridge.d.ts +116 -0
- package/bridge/plugin-bridge.d.ts.map +1 -0
- package/bridge/plugin-bridge.js +203 -0
- package/bridge/storage-bridge.d.ts +39 -0
- package/bridge/storage-bridge.d.ts.map +1 -0
- package/bridge/storage-bridge.js +135 -0
- package/chat/index.d.ts +57 -0
- package/chat/index.d.ts.map +1 -0
- package/chat/index.js +160 -0
- package/coding/index.d.ts +25 -0
- package/coding/index.d.ts.map +1 -0
- package/coding/index.js +25 -0
- package/components/AdvancedPageView.d.ts +17 -0
- package/components/AdvancedPageView.d.ts.map +1 -0
- package/components/AdvancedPageView.js +146 -0
- package/components/AgentActivityBox.d.ts +7 -0
- package/components/AgentActivityBox.d.ts.map +1 -0
- package/components/AgentActivityBox.js +25 -0
- package/components/ApiKeyConfig.d.ts +26 -0
- package/components/ApiKeyConfig.d.ts.map +1 -0
- package/components/ApiKeyConfig.js +119 -0
- package/components/AppsPageView.d.ts +7 -0
- package/components/AppsPageView.d.ts.map +1 -0
- package/components/AppsPageView.js +31 -0
- package/components/AppsView.d.ts +8 -0
- package/components/AppsView.d.ts.map +1 -0
- package/components/AppsView.js +149 -0
- package/components/AvatarLoader.d.ts +13 -0
- package/components/AvatarLoader.d.ts.map +1 -0
- package/components/AvatarLoader.js +53 -0
- package/components/AvatarSelector.d.ts +23 -0
- package/components/AvatarSelector.d.ts.map +1 -0
- package/components/AvatarSelector.js +105 -0
- package/components/BscTradePanel.d.ts +22 -0
- package/components/BscTradePanel.d.ts.map +1 -0
- package/components/BscTradePanel.js +221 -0
- package/components/BugReportModal.d.ts +2 -0
- package/components/BugReportModal.d.ts.map +1 -0
- package/components/BugReportModal.js +219 -0
- package/components/CharacterRoster.d.ts +31 -0
- package/components/CharacterRoster.d.ts.map +1 -0
- package/components/CharacterRoster.js +41 -0
- package/components/CharacterView.d.ts +8 -0
- package/components/CharacterView.d.ts.map +1 -0
- package/components/CharacterView.js +685 -0
- package/components/ChatAvatar.d.ts +8 -0
- package/components/ChatAvatar.d.ts.map +1 -0
- package/components/ChatAvatar.js +89 -0
- package/components/ChatComposer.d.ts +37 -0
- package/components/ChatComposer.d.ts.map +1 -0
- package/components/ChatComposer.js +136 -0
- package/components/ChatMessage.d.ts +24 -0
- package/components/ChatMessage.d.ts.map +1 -0
- package/components/ChatMessage.js +167 -0
- package/components/ChatModalView.d.ts +10 -0
- package/components/ChatModalView.d.ts.map +1 -0
- package/components/ChatModalView.js +57 -0
- package/components/ChatView.d.ts +14 -0
- package/components/ChatView.d.ts.map +1 -0
- package/components/ChatView.js +526 -0
- package/components/CloudOnboarding.d.ts +7 -0
- package/components/CloudOnboarding.d.ts.map +1 -0
- package/components/CloudOnboarding.js +22 -0
- package/components/CloudSourceControls.d.ts +13 -0
- package/components/CloudSourceControls.d.ts.map +1 -0
- package/components/CloudSourceControls.js +16 -0
- package/components/CodingAgentSettingsSection.d.ts +2 -0
- package/components/CodingAgentSettingsSection.d.ts.map +1 -0
- package/components/CodingAgentSettingsSection.js +270 -0
- package/components/CommandPalette.d.ts +2 -0
- package/components/CommandPalette.d.ts.map +1 -0
- package/components/CommandPalette.js +181 -0
- package/components/CompanionSceneHost.d.ts +14 -0
- package/components/CompanionSceneHost.d.ts.map +1 -0
- package/components/CompanionSceneHost.js +360 -0
- package/components/CompanionShell.d.ts +17 -0
- package/components/CompanionShell.d.ts.map +1 -0
- package/components/CompanionShell.js +15 -0
- package/components/CompanionView.d.ts +2 -0
- package/components/CompanionView.d.ts.map +1 -0
- package/components/CompanionView.js +22 -0
- package/components/ConfigPageView.d.ts +11 -0
- package/components/ConfigPageView.d.ts.map +1 -0
- package/components/ConfigPageView.js +303 -0
- package/components/ConfigSaveFooter.d.ts +8 -0
- package/components/ConfigSaveFooter.d.ts.map +1 -0
- package/components/ConfigSaveFooter.js +10 -0
- package/components/ConfirmModal.d.ts +61 -0
- package/components/ConfirmModal.d.ts.map +1 -0
- package/components/ConfirmModal.js +164 -0
- package/components/ConnectionFailedBanner.d.ts +6 -0
- package/components/ConnectionFailedBanner.d.ts.map +1 -0
- package/components/ConnectionFailedBanner.js +22 -0
- package/components/ConnectorsPageView.d.ts +7 -0
- package/components/ConnectorsPageView.d.ts.map +1 -0
- package/components/ConnectorsPageView.js +8 -0
- package/components/ConversationsSidebar.d.ts +9 -0
- package/components/ConversationsSidebar.d.ts.map +1 -0
- package/components/ConversationsSidebar.js +116 -0
- package/components/CustomActionEditor.d.ts +10 -0
- package/components/CustomActionEditor.d.ts.map +1 -0
- package/components/CustomActionEditor.js +578 -0
- package/components/CustomActionsPanel.d.ts +9 -0
- package/components/CustomActionsPanel.d.ts.map +1 -0
- package/components/CustomActionsPanel.js +107 -0
- package/components/CustomActionsView.d.ts +2 -0
- package/components/CustomActionsView.d.ts.map +1 -0
- package/components/CustomActionsView.js +134 -0
- package/components/DatabasePageView.d.ts +5 -0
- package/components/DatabasePageView.d.ts.map +1 -0
- package/components/DatabasePageView.js +28 -0
- package/components/DatabaseView.d.ts +9 -0
- package/components/DatabaseView.d.ts.map +1 -0
- package/components/DatabaseView.js +311 -0
- package/components/ElizaCloudDashboard.d.ts +2 -0
- package/components/ElizaCloudDashboard.d.ts.map +1 -0
- package/components/ElizaCloudDashboard.js +657 -0
- package/components/EmotePicker.d.ts +2 -0
- package/components/EmotePicker.d.ts.map +1 -0
- package/components/EmotePicker.js +343 -0
- package/components/ErrorBoundary.d.ts +22 -0
- package/components/ErrorBoundary.d.ts.map +1 -0
- package/components/ErrorBoundary.js +31 -0
- package/components/FineTuningView.d.ts +2 -0
- package/components/FineTuningView.d.ts.map +1 -0
- package/components/FineTuningView.js +433 -0
- package/components/FlaminaGuide.d.ts +10 -0
- package/components/FlaminaGuide.d.ts.map +1 -0
- package/components/FlaminaGuide.js +64 -0
- package/components/GameView.d.ts +11 -0
- package/components/GameView.d.ts.map +1 -0
- package/components/GameView.js +294 -0
- package/components/GameViewOverlay.d.ts +8 -0
- package/components/GameViewOverlay.d.ts.map +1 -0
- package/components/GameViewOverlay.js +70 -0
- package/components/GlobalEmoteOverlay.d.ts +2 -0
- package/components/GlobalEmoteOverlay.d.ts.map +1 -0
- package/components/GlobalEmoteOverlay.js +112 -0
- package/components/Header.d.ts +9 -0
- package/components/Header.d.ts.map +1 -0
- package/components/Header.js +123 -0
- package/components/HeartbeatsView.d.ts +2 -0
- package/components/HeartbeatsView.d.ts.map +1 -0
- package/components/HeartbeatsView.js +378 -0
- package/components/InventoryView.d.ts +10 -0
- package/components/InventoryView.d.ts.map +1 -0
- package/components/InventoryView.js +176 -0
- package/components/KnowledgeView.d.ts +20 -0
- package/components/KnowledgeView.d.ts.map +1 -0
- package/components/KnowledgeView.js +480 -0
- package/components/LanguageDropdown.d.ts +30 -0
- package/components/LanguageDropdown.d.ts.map +1 -0
- package/components/LanguageDropdown.js +99 -0
- package/components/LifoMonitorPanel.d.ts +21 -0
- package/components/LifoMonitorPanel.d.ts.map +1 -0
- package/components/LifoMonitorPanel.js +24 -0
- package/components/LifoSandboxView.d.ts +5 -0
- package/components/LifoSandboxView.d.ts.map +1 -0
- package/components/LifoSandboxView.js +333 -0
- package/components/LoadingScreen.d.ts +13 -0
- package/components/LoadingScreen.d.ts.map +1 -0
- package/components/LoadingScreen.js +70 -0
- package/components/LogsPageView.d.ts +2 -0
- package/components/LogsPageView.d.ts.map +1 -0
- package/components/LogsPageView.js +7 -0
- package/components/LogsView.d.ts +5 -0
- package/components/LogsView.d.ts.map +1 -0
- package/components/LogsView.js +71 -0
- package/components/MediaGalleryView.d.ts +9 -0
- package/components/MediaGalleryView.d.ts.map +1 -0
- package/components/MediaGalleryView.js +236 -0
- package/components/MediaSettingsSection.d.ts +11 -0
- package/components/MediaSettingsSection.d.ts.map +1 -0
- package/components/MediaSettingsSection.js +329 -0
- package/components/MessageContent.d.ts +51 -0
- package/components/MessageContent.d.ts.map +1 -0
- package/components/MessageContent.js +553 -0
- package/components/OnboardingWizard.d.ts +2 -0
- package/components/OnboardingWizard.d.ts.map +1 -0
- package/components/OnboardingWizard.js +96 -0
- package/components/PairingView.d.ts +5 -0
- package/components/PairingView.d.ts.map +1 -0
- package/components/PairingView.js +29 -0
- package/components/PermissionsSection.d.ts +20 -0
- package/components/PermissionsSection.d.ts.map +1 -0
- package/components/PermissionsSection.js +573 -0
- package/components/PluginsPageView.d.ts +5 -0
- package/components/PluginsPageView.d.ts.map +1 -0
- package/components/PluginsPageView.js +8 -0
- package/components/PluginsView.d.ts +21 -0
- package/components/PluginsView.d.ts.map +1 -0
- package/components/PluginsView.js +1534 -0
- package/components/ProviderSwitcher.d.ts +42 -0
- package/components/ProviderSwitcher.d.ts.map +1 -0
- package/components/ProviderSwitcher.js +493 -0
- package/components/RestartBanner.d.ts +2 -0
- package/components/RestartBanner.d.ts.map +1 -0
- package/components/RestartBanner.js +36 -0
- package/components/RuntimeView.d.ts +10 -0
- package/components/RuntimeView.d.ts.map +1 -0
- package/components/RuntimeView.js +165 -0
- package/components/SaveCommandModal.d.ts +12 -0
- package/components/SaveCommandModal.d.ts.map +1 -0
- package/components/SaveCommandModal.js +84 -0
- package/components/SecretsView.d.ts +9 -0
- package/components/SecretsView.d.ts.map +1 -0
- package/components/SecretsView.js +249 -0
- package/components/SettingsView.d.ts +9 -0
- package/components/SettingsView.d.ts.map +1 -0
- package/components/SettingsView.js +230 -0
- package/components/ShellOverlays.d.ts +8 -0
- package/components/ShellOverlays.d.ts.map +1 -0
- package/components/ShellOverlays.js +10 -0
- package/components/ShortcutsOverlay.d.ts +2 -0
- package/components/ShortcutsOverlay.d.ts.map +1 -0
- package/components/ShortcutsOverlay.js +79 -0
- package/components/SkillsView.d.ts +11 -0
- package/components/SkillsView.d.ts.map +1 -0
- package/components/SkillsView.js +358 -0
- package/components/StartupFailureView.d.ts +8 -0
- package/components/StartupFailureView.d.ts.map +1 -0
- package/components/StartupFailureView.js +16 -0
- package/components/StreamView.d.ts +16 -0
- package/components/StreamView.d.ts.map +1 -0
- package/components/StreamView.js +300 -0
- package/components/StripeEmbeddedCheckout.d.ts +24 -0
- package/components/StripeEmbeddedCheckout.d.ts.map +1 -0
- package/components/StripeEmbeddedCheckout.js +101 -0
- package/components/SubscriptionStatus.d.ts +23 -0
- package/components/SubscriptionStatus.d.ts.map +1 -0
- package/components/SubscriptionStatus.js +301 -0
- package/components/SystemWarningBanner.d.ts +6 -0
- package/components/SystemWarningBanner.d.ts.map +1 -0
- package/components/SystemWarningBanner.js +46 -0
- package/components/ThemeToggle.d.ts +21 -0
- package/components/ThemeToggle.d.ts.map +1 -0
- package/components/ThemeToggle.js +24 -0
- package/components/TrajectoriesView.d.ts +12 -0
- package/components/TrajectoriesView.d.ts.map +1 -0
- package/components/TrajectoriesView.js +183 -0
- package/components/TrajectoryDetailView.d.ts +13 -0
- package/components/TrajectoryDetailView.d.ts.map +1 -0
- package/components/TrajectoryDetailView.js +112 -0
- package/components/TriggersView.d.ts +2 -0
- package/components/TriggersView.d.ts.map +1 -0
- package/components/VectorBrowserView.d.ts +10 -0
- package/components/VectorBrowserView.d.ts.map +1 -0
- package/components/VectorBrowserView.js +997 -0
- package/components/VoiceConfigView.d.ts +11 -0
- package/components/VoiceConfigView.d.ts.map +1 -0
- package/components/VoiceConfigView.js +329 -0
- package/components/VrmStage.d.ts +28 -0
- package/components/VrmStage.d.ts.map +1 -0
- package/components/VrmStage.js +178 -0
- package/components/WhatsAppQrOverlay.d.ts +8 -0
- package/components/WhatsAppQrOverlay.d.ts.map +1 -0
- package/components/WhatsAppQrOverlay.js +63 -0
- package/components/apps/AppDetailPane.d.ts +15 -0
- package/components/apps/AppDetailPane.d.ts.map +1 -0
- package/components/apps/AppDetailPane.js +13 -0
- package/components/apps/AppsCatalogGrid.d.ts +20 -0
- package/components/apps/AppsCatalogGrid.d.ts.map +1 -0
- package/components/apps/AppsCatalogGrid.js +18 -0
- package/components/apps/extensions/registry.d.ts +4 -0
- package/components/apps/extensions/registry.d.ts.map +1 -0
- package/components/apps/extensions/registry.js +7 -0
- package/components/apps/extensions/types.d.ts +7 -0
- package/components/apps/extensions/types.d.ts.map +1 -0
- package/components/apps/extensions/types.js +1 -0
- package/components/apps/helpers.d.ts +7 -0
- package/components/apps/helpers.d.ts.map +1 -0
- package/components/apps/helpers.js +44 -0
- package/components/avatar/VrmAnimationLoader.d.ts +30 -0
- package/components/avatar/VrmAnimationLoader.d.ts.map +1 -0
- package/components/avatar/VrmAnimationLoader.js +99 -0
- package/components/avatar/VrmBlinkController.d.ts +37 -0
- package/components/avatar/VrmBlinkController.d.ts.map +1 -0
- package/components/avatar/VrmBlinkController.js +98 -0
- package/components/avatar/VrmCameraManager.d.ts +57 -0
- package/components/avatar/VrmCameraManager.d.ts.map +1 -0
- package/components/avatar/VrmCameraManager.js +277 -0
- package/components/avatar/VrmEngine.d.ts +246 -0
- package/components/avatar/VrmEngine.d.ts.map +1 -0
- package/components/avatar/VrmEngine.js +2076 -0
- package/components/avatar/VrmFootShadow.d.ts +18 -0
- package/components/avatar/VrmFootShadow.d.ts.map +1 -0
- package/components/avatar/VrmFootShadow.js +83 -0
- package/components/avatar/VrmViewer.d.ts +60 -0
- package/components/avatar/VrmViewer.d.ts.map +1 -0
- package/components/avatar/VrmViewer.js +396 -0
- package/components/avatar/mixamoVRMRigMap.d.ts +3 -0
- package/components/avatar/mixamoVRMRigMap.d.ts.map +1 -0
- package/components/avatar/mixamoVRMRigMap.js +56 -0
- package/components/avatar/retargetMixamoFbxToVrm.d.ts +9 -0
- package/components/avatar/retargetMixamoFbxToVrm.d.ts.map +1 -0
- package/components/avatar/retargetMixamoFbxToVrm.js +88 -0
- package/components/avatar/retargetMixamoGltfToVrm.d.ts +11 -0
- package/components/avatar/retargetMixamoGltfToVrm.d.ts.map +1 -0
- package/components/avatar/retargetMixamoGltfToVrm.js +80 -0
- package/components/chainConfig.d.ts +89 -0
- package/components/chainConfig.d.ts.map +1 -0
- package/components/chainConfig.js +287 -0
- package/components/companion/CompanionHeader.d.ts +15 -0
- package/components/companion/CompanionHeader.d.ts.map +1 -0
- package/components/companion/CompanionHeader.js +7 -0
- package/components/companion/CompanionSceneHost.d.ts +2 -0
- package/components/companion/CompanionSceneHost.d.ts.map +1 -0
- package/components/companion/CompanionSceneHost.js +1 -0
- package/components/companion/VrmStage.d.ts +3 -0
- package/components/companion/VrmStage.d.ts.map +1 -0
- package/components/companion/VrmStage.js +1 -0
- package/components/companion/index.d.ts +18 -0
- package/components/companion/index.d.ts.map +1 -0
- package/components/companion/index.js +17 -0
- package/components/companion/walletUtils.d.ts +95 -0
- package/components/companion/walletUtils.d.ts.map +1 -0
- package/components/companion/walletUtils.js +167 -0
- package/components/companion-shell-styles.d.ts +38 -0
- package/components/companion-shell-styles.d.ts.map +1 -0
- package/components/companion-shell-styles.js +248 -0
- package/components/confirm-delete-control.d.ts +16 -0
- package/components/confirm-delete-control.d.ts.map +1 -0
- package/components/confirm-delete-control.js +12 -0
- package/components/conversations/ConversationListItem.d.ts +31 -0
- package/components/conversations/ConversationListItem.d.ts.map +1 -0
- package/components/conversations/ConversationListItem.js +52 -0
- package/components/conversations/conversation-utils.d.ts +9 -0
- package/components/conversations/conversation-utils.d.ts.map +1 -0
- package/components/conversations/conversation-utils.js +138 -0
- package/components/format.d.ts +54 -0
- package/components/format.d.ts.map +1 -0
- package/components/format.js +82 -0
- package/components/index.d.ts +96 -0
- package/components/index.d.ts.map +1 -0
- package/components/index.js +95 -0
- package/components/inventory/CopyableAddress.d.ts +8 -0
- package/components/inventory/CopyableAddress.d.ts.map +1 -0
- package/components/inventory/CopyableAddress.js +18 -0
- package/components/inventory/InventoryToolbar.d.ts +25 -0
- package/components/inventory/InventoryToolbar.d.ts.map +1 -0
- package/components/inventory/InventoryToolbar.js +28 -0
- package/components/inventory/NftGrid.d.ts +13 -0
- package/components/inventory/NftGrid.d.ts.map +1 -0
- package/components/inventory/NftGrid.js +29 -0
- package/components/inventory/TokenLogo.d.ts +12 -0
- package/components/inventory/TokenLogo.d.ts.map +1 -0
- package/components/inventory/TokenLogo.js +33 -0
- package/components/inventory/TokensTable.d.ts +24 -0
- package/components/inventory/TokensTable.d.ts.map +1 -0
- package/components/inventory/TokensTable.js +26 -0
- package/components/inventory/constants.d.ts +52 -0
- package/components/inventory/constants.d.ts.map +1 -0
- package/components/inventory/constants.js +121 -0
- package/components/inventory/index.d.ts +9 -0
- package/components/inventory/index.d.ts.map +1 -0
- package/components/inventory/index.js +8 -0
- package/components/inventory/media-url.d.ts +6 -0
- package/components/inventory/media-url.d.ts.map +1 -0
- package/components/inventory/media-url.js +28 -0
- package/components/inventory/useInventoryData.d.ts +53 -0
- package/components/inventory/useInventoryData.d.ts.map +1 -0
- package/components/inventory/useInventoryData.js +332 -0
- package/components/knowledge-upload-image.d.ts +27 -0
- package/components/knowledge-upload-image.d.ts.map +1 -0
- package/components/knowledge-upload-image.js +146 -0
- package/components/labels.d.ts +6 -0
- package/components/labels.d.ts.map +1 -0
- package/components/labels.js +40 -0
- package/components/onboarding/ActivateStep.d.ts +2 -0
- package/components/onboarding/ActivateStep.d.ts.map +1 -0
- package/components/onboarding/ActivateStep.js +10 -0
- package/components/onboarding/ConnectionStep.d.ts +2 -0
- package/components/onboarding/ConnectionStep.d.ts.map +1 -0
- package/components/onboarding/ConnectionStep.js +609 -0
- package/components/onboarding/IdentityStep.d.ts +2 -0
- package/components/onboarding/IdentityStep.d.ts.map +1 -0
- package/components/onboarding/IdentityStep.js +102 -0
- package/components/onboarding/OnboardingPanel.d.ts +9 -0
- package/components/onboarding/OnboardingPanel.d.ts.map +1 -0
- package/components/onboarding/OnboardingPanel.js +24 -0
- package/components/onboarding/OnboardingStepNav.d.ts +2 -0
- package/components/onboarding/OnboardingStepNav.d.ts.map +1 -0
- package/components/onboarding/OnboardingStepNav.js +23 -0
- package/components/onboarding/PermissionsStep.d.ts +2 -0
- package/components/onboarding/PermissionsStep.d.ts.map +1 -0
- package/components/onboarding/PermissionsStep.js +7 -0
- package/components/onboarding/RpcStep.d.ts +2 -0
- package/components/onboarding/RpcStep.d.ts.map +1 -0
- package/components/onboarding/RpcStep.js +125 -0
- package/components/permissions/PermissionIcon.d.ts +4 -0
- package/components/permissions/PermissionIcon.d.ts.map +1 -0
- package/components/permissions/PermissionIcon.js +12 -0
- package/components/permissions/StreamingPermissions.d.ts +20 -0
- package/components/permissions/StreamingPermissions.d.ts.map +1 -0
- package/components/permissions/StreamingPermissions.js +177 -0
- package/components/plugins/showcase-data.d.ts +7 -0
- package/components/plugins/showcase-data.d.ts.map +1 -0
- package/components/plugins/showcase-data.js +464 -0
- package/components/shared/ShellHeaderControls.d.ts +27 -0
- package/components/shared/ShellHeaderControls.d.ts.map +1 -0
- package/components/shared/ShellHeaderControls.js +60 -0
- package/components/shared-companion-scene-context.d.ts +3 -0
- package/components/shared-companion-scene-context.d.ts.map +1 -0
- package/components/shared-companion-scene-context.js +13 -0
- package/components/skeletons.d.ts +17 -0
- package/components/skeletons.d.ts.map +1 -0
- package/components/skeletons.js +22 -0
- package/components/stream/ActivityFeed.d.ts +5 -0
- package/components/stream/ActivityFeed.d.ts.map +1 -0
- package/components/stream/ActivityFeed.js +57 -0
- package/components/stream/AvatarPip.d.ts +5 -0
- package/components/stream/AvatarPip.d.ts.map +1 -0
- package/components/stream/AvatarPip.js +6 -0
- package/components/stream/ChatContent.d.ts +6 -0
- package/components/stream/ChatContent.d.ts.map +1 -0
- package/components/stream/ChatContent.js +69 -0
- package/components/stream/ChatTicker.d.ts +5 -0
- package/components/stream/ChatTicker.d.ts.map +1 -0
- package/components/stream/ChatTicker.js +34 -0
- package/components/stream/IdleContent.d.ts +5 -0
- package/components/stream/IdleContent.d.ts.map +1 -0
- package/components/stream/IdleContent.js +17 -0
- package/components/stream/StatusBar.d.ts +36 -0
- package/components/stream/StatusBar.d.ts.map +1 -0
- package/components/stream/StatusBar.js +140 -0
- package/components/stream/StreamSettings.d.ts +33 -0
- package/components/stream/StreamSettings.d.ts.map +1 -0
- package/components/stream/StreamSettings.js +99 -0
- package/components/stream/StreamTerminal.d.ts +2 -0
- package/components/stream/StreamTerminal.d.ts.map +1 -0
- package/components/stream/StreamTerminal.js +52 -0
- package/components/stream/StreamVoiceConfig.d.ts +10 -0
- package/components/stream/StreamVoiceConfig.d.ts.map +1 -0
- package/components/stream/StreamVoiceConfig.js +88 -0
- package/components/stream/helpers.d.ts +32 -0
- package/components/stream/helpers.d.ts.map +1 -0
- package/components/stream/helpers.js +110 -0
- package/components/stream/overlays/OverlayLayer.d.ts +20 -0
- package/components/stream/overlays/OverlayLayer.d.ts.map +1 -0
- package/components/stream/overlays/OverlayLayer.js +24 -0
- package/components/stream/overlays/built-in/ActionTickerWidget.d.ts +8 -0
- package/components/stream/overlays/built-in/ActionTickerWidget.d.ts.map +1 -0
- package/components/stream/overlays/built-in/ActionTickerWidget.js +44 -0
- package/components/stream/overlays/built-in/AlertPopupWidget.d.ts +7 -0
- package/components/stream/overlays/built-in/AlertPopupWidget.d.ts.map +1 -0
- package/components/stream/overlays/built-in/AlertPopupWidget.js +62 -0
- package/components/stream/overlays/built-in/BrandingWidget.d.ts +7 -0
- package/components/stream/overlays/built-in/BrandingWidget.d.ts.map +1 -0
- package/components/stream/overlays/built-in/BrandingWidget.js +36 -0
- package/components/stream/overlays/built-in/CustomHtmlWidget.d.ts +26 -0
- package/components/stream/overlays/built-in/CustomHtmlWidget.d.ts.map +1 -0
- package/components/stream/overlays/built-in/CustomHtmlWidget.js +78 -0
- package/components/stream/overlays/built-in/PeonGlassWidget.d.ts +11 -0
- package/components/stream/overlays/built-in/PeonGlassWidget.d.ts.map +1 -0
- package/components/stream/overlays/built-in/PeonGlassWidget.js +188 -0
- package/components/stream/overlays/built-in/PeonHudWidget.d.ts +10 -0
- package/components/stream/overlays/built-in/PeonHudWidget.d.ts.map +1 -0
- package/components/stream/overlays/built-in/PeonHudWidget.js +168 -0
- package/components/stream/overlays/built-in/PeonSakuraWidget.d.ts +11 -0
- package/components/stream/overlays/built-in/PeonSakuraWidget.d.ts.map +1 -0
- package/components/stream/overlays/built-in/PeonSakuraWidget.js +213 -0
- package/components/stream/overlays/built-in/ThoughtBubbleWidget.d.ts +8 -0
- package/components/stream/overlays/built-in/ThoughtBubbleWidget.d.ts.map +1 -0
- package/components/stream/overlays/built-in/ThoughtBubbleWidget.js +59 -0
- package/components/stream/overlays/built-in/ViewerCountWidget.d.ts +7 -0
- package/components/stream/overlays/built-in/ViewerCountWidget.d.ts.map +1 -0
- package/components/stream/overlays/built-in/ViewerCountWidget.js +34 -0
- package/components/stream/overlays/built-in/index.d.ts +13 -0
- package/components/stream/overlays/built-in/index.d.ts.map +1 -0
- package/components/stream/overlays/built-in/index.js +12 -0
- package/components/stream/overlays/registry.d.ts +11 -0
- package/components/stream/overlays/registry.d.ts.map +1 -0
- package/components/stream/overlays/registry.js +16 -0
- package/components/stream/overlays/types.d.ts +67 -0
- package/components/stream/overlays/types.d.ts.map +1 -0
- package/components/stream/overlays/types.js +7 -0
- package/components/stream/overlays/useOverlayLayout.d.ts +27 -0
- package/components/stream/overlays/useOverlayLayout.d.ts.map +1 -0
- package/components/stream/overlays/useOverlayLayout.js +162 -0
- package/components/trajectory-format.d.ts +6 -0
- package/components/trajectory-format.d.ts.map +1 -0
- package/components/trajectory-format.js +43 -0
- package/components/ui-badges.d.ts +23 -0
- package/components/ui-badges.d.ts.map +1 -0
- package/components/ui-badges.js +38 -0
- package/components/ui-switch.d.ts +14 -0
- package/components/ui-switch.d.ts.map +1 -0
- package/components/ui-switch.js +15 -0
- package/components/vector-browser-three.d.ts +4 -0
- package/components/vector-browser-three.d.ts.map +1 -0
- package/components/vector-browser-three.js +21 -0
- package/config/branding.d.ts +49 -0
- package/config/branding.d.ts.map +1 -0
- package/config/branding.js +16 -0
- package/config/config-catalog.d.ts +376 -0
- package/config/config-catalog.d.ts.map +1 -0
- package/config/config-catalog.js +724 -0
- package/config/config-field.d.ts +68 -0
- package/config/config-field.d.ts.map +1 -0
- package/config/config-field.js +840 -0
- package/config/config-renderer.d.ts +176 -0
- package/config/config-renderer.d.ts.map +1 -0
- package/config/config-renderer.js +405 -0
- package/config/index.d.ts +6 -0
- package/config/index.d.ts.map +1 -0
- package/config/index.js +5 -0
- package/config/ui-renderer.d.ts +26 -0
- package/config/ui-renderer.d.ts.map +1 -0
- package/config/ui-renderer.js +815 -0
- package/config/ui-spec.d.ts +164 -0
- package/config/ui-spec.d.ts.map +1 -0
- package/config/ui-spec.js +13 -0
- package/events/index.d.ts +47 -0
- package/events/index.d.ts.map +1 -0
- package/events/index.js +43 -0
- package/hooks/index.d.ts +15 -0
- package/hooks/index.d.ts.map +1 -0
- package/hooks/useBugReport.d.ts +14 -0
- package/hooks/useBugReport.d.ts.map +1 -0
- package/hooks/useBugReport.js +18 -0
- package/hooks/useCanvasWindow.d.ts +38 -0
- package/hooks/useCanvasWindow.d.ts.map +1 -0
- package/hooks/useCanvasWindow.js +273 -0
- package/hooks/useChatAvatarVoice.d.ts +10 -0
- package/hooks/useChatAvatarVoice.d.ts.map +1 -0
- package/hooks/useChatAvatarVoice.js +71 -0
- package/hooks/useClickOutside.d.ts +6 -0
- package/hooks/useClickOutside.d.ts.map +1 -0
- package/hooks/useClickOutside.js +25 -0
- package/hooks/useContextMenu.d.ts +17 -0
- package/hooks/useContextMenu.d.ts.map +1 -0
- package/hooks/useContextMenu.js +100 -0
- package/hooks/useKeyboardShortcuts.d.ts +17 -0
- package/hooks/useKeyboardShortcuts.d.ts.map +1 -0
- package/hooks/useKeyboardShortcuts.js +67 -0
- package/hooks/useLifoSync.d.ts +18 -0
- package/hooks/useLifoSync.d.ts.map +1 -0
- package/hooks/useLifoSync.js +113 -0
- package/hooks/useMemoryMonitor.d.ts +87 -0
- package/hooks/useMemoryMonitor.d.ts.map +1 -0
- package/hooks/useMemoryMonitor.js +209 -0
- package/hooks/useRenderGuard.d.ts +17 -0
- package/hooks/useRenderGuard.d.ts.map +1 -0
- package/hooks/useRenderGuard.js +36 -0
- package/hooks/useRetakeCapture.d.ts +12 -0
- package/hooks/useRetakeCapture.d.ts.map +1 -0
- package/hooks/useRetakeCapture.js +60 -0
- package/hooks/useStreamPopoutNavigation.d.ts +3 -0
- package/hooks/useStreamPopoutNavigation.d.ts.map +1 -0
- package/hooks/useStreamPopoutNavigation.js +17 -0
- package/hooks/useTimeout.d.ts +11 -0
- package/hooks/useTimeout.d.ts.map +1 -0
- package/hooks/useTimeout.js +32 -0
- package/hooks/useVoiceChat.d.ts +94 -0
- package/hooks/useVoiceChat.d.ts.map +1 -0
- package/hooks/useVoiceChat.js +1074 -0
- package/hooks/useWhatsAppPairing.d.ts +11 -0
- package/hooks/useWhatsAppPairing.d.ts.map +1 -0
- package/hooks/useWhatsAppPairing.js +95 -0
- package/i18n/index.d.ts +7 -0
- package/i18n/index.d.ts.map +1 -0
- package/i18n/index.js +53 -0
- package/i18n/locales/en.json +1239 -0
- package/i18n/locales/es.json +1236 -0
- package/i18n/locales/ko.json +1236 -0
- package/i18n/locales/pt.json +1236 -0
- package/i18n/locales/zh-CN.json +1236 -0
- package/i18n/messages.d.ts +6 -0
- package/i18n/messages.d.ts.map +1 -0
- package/i18n/messages.js +14 -0
- package/index.d.ts +5 -0
- package/index.d.ts.map +1 -0
- package/navigation/index.d.ts +27 -0
- package/navigation/index.d.ts.map +1 -0
- package/navigation/index.js +232 -0
- package/onboarding-config.d.ts +25 -0
- package/onboarding-config.d.ts.map +1 -0
- package/onboarding-config.js +76 -0
- package/package.json +143 -53
- package/platform/browser-launch.d.ts +2 -0
- package/platform/browser-launch.d.ts.map +1 -0
- package/platform/browser-launch.js +109 -0
- package/platform/index.d.ts +14 -0
- package/platform/index.d.ts.map +1 -0
- package/platform/index.js +24 -0
- package/platform/init.d.ts +40 -0
- package/platform/init.d.ts.map +1 -0
- package/platform/init.js +160 -0
- package/platform/lifo.d.ts +51 -0
- package/platform/lifo.d.ts.map +1 -0
- package/platform/lifo.js +138 -0
- package/providers/index.d.ts +19 -0
- package/providers/index.d.ts.map +1 -0
- package/providers/index.js +80 -0
- package/shell-params.d.ts +12 -0
- package/shell-params.d.ts.map +1 -0
- package/shell-params.js +19 -0
- package/state/AppContext.d.ts +12 -0
- package/state/AppContext.d.ts.map +1 -0
- package/state/AppContext.js +5060 -0
- package/state/index.d.ts +7 -0
- package/state/index.d.ts.map +1 -0
- package/state/internal.d.ts +7 -0
- package/state/internal.d.ts.map +1 -0
- package/state/internal.js +6 -0
- package/state/onboarding-resume.d.ts +11 -0
- package/state/onboarding-resume.d.ts.map +1 -0
- package/state/onboarding-resume.js +189 -0
- package/state/parsers.d.ts +26 -0
- package/state/parsers.d.ts.map +1 -0
- package/state/parsers.js +255 -0
- package/state/persistence.d.ts +59 -0
- package/state/persistence.d.ts.map +1 -0
- package/state/persistence.js +326 -0
- package/state/shell-routing.d.ts +12 -0
- package/state/shell-routing.d.ts.map +1 -0
- package/state/shell-routing.js +25 -0
- package/state/types.d.ts +421 -0
- package/state/types.d.ts.map +1 -0
- package/state/types.js +75 -0
- package/state/ui-preferences.d.ts +3 -0
- package/state/ui-preferences.d.ts.map +1 -0
- package/state/ui-preferences.js +1 -0
- package/state/useApp.d.ts +4 -0
- package/state/useApp.d.ts.map +1 -0
- package/state/useApp.js +22 -0
- package/state/vrm.d.ts +30 -0
- package/state/vrm.d.ts.map +1 -0
- package/state/vrm.js +82 -0
- package/styles/anime.css +6321 -0
- package/styles/onboarding-game.css +1092 -0
- package/types/index.d.ts +657 -0
- package/types/index.d.ts.map +1 -0
- package/types/index.js +1 -0
- package/utils/asset-url.d.ts +26 -0
- package/utils/asset-url.d.ts.map +1 -0
- package/utils/asset-url.js +99 -0
- package/utils/assistant-text.d.ts +2 -0
- package/utils/assistant-text.d.ts.map +1 -0
- package/utils/assistant-text.js +161 -0
- package/utils/clipboard.d.ts +2 -0
- package/utils/clipboard.d.ts.map +1 -0
- package/utils/clipboard.js +38 -0
- package/utils/desktop-dialogs.d.ts +19 -0
- package/utils/desktop-dialogs.d.ts.map +1 -0
- package/utils/desktop-dialogs.js +50 -0
- package/utils/eliza-globals.d.ts +11 -0
- package/utils/eliza-globals.d.ts.map +1 -0
- package/utils/eliza-globals.js +33 -0
- package/utils/index.d.ts +8 -0
- package/utils/index.d.ts.map +1 -0
- package/utils/number-parsing.d.ts +44 -0
- package/utils/number-parsing.d.ts.map +1 -0
- package/utils/number-parsing.js +56 -0
- package/utils/openExternalUrl.d.ts +2 -0
- package/utils/openExternalUrl.d.ts.map +1 -0
- package/utils/openExternalUrl.js +17 -0
- package/utils/spoken-text.d.ts +2 -0
- package/utils/spoken-text.d.ts.map +1 -0
- package/utils/spoken-text.js +56 -0
- package/utils/streaming-text.d.ts +3 -0
- package/utils/streaming-text.d.ts.map +1 -0
- package/utils/streaming-text.js +87 -0
- package/voice/index.d.ts +2 -0
- package/voice/index.d.ts.map +1 -0
- package/voice/types.d.ts +25 -0
- package/voice/types.d.ts.map +1 -0
- package/voice/types.js +166 -0
- package/wallet-rpc.d.ts +8 -0
- package/wallet-rpc.d.ts.map +1 -0
- package/wallet-rpc.js +131 -0
- package/.turbo/turbo-build.log +0 -5
- package/src/App.tsx +0 -504
- package/src/actions/character.test.ts +0 -139
- package/src/actions/character.ts +0 -334
- package/src/actions/chat-helpers.ts +0 -100
- package/src/actions/cloud.ts +0 -59
- package/src/actions/index.ts +0 -12
- package/src/actions/lifecycle.ts +0 -175
- package/src/actions/onboarding.ts +0 -38
- package/src/actions/triggers.ts +0 -190
- package/src/ambient.d.ts +0 -33
- package/src/api/client.ts +0 -5659
- package/src/autonomy/index.ts +0 -477
- package/src/bridge/capacitor-bridge.ts +0 -295
- package/src/bridge/electrobun-rpc.ts +0 -78
- package/src/bridge/electrobun-runtime.ts +0 -28
- package/src/bridge/native-plugins.ts +0 -138
- package/src/bridge/plugin-bridge.ts +0 -352
- package/src/bridge/storage-bridge.ts +0 -162
- package/src/chat/index.ts +0 -250
- package/src/coding/index.ts +0 -43
- package/src/components/AdvancedPageView.tsx +0 -382
- package/src/components/AgentActivityBox.tsx +0 -49
- package/src/components/ApiKeyConfig.tsx +0 -222
- package/src/components/AppsPageView.tsx +0 -52
- package/src/components/AppsView.tsx +0 -293
- package/src/components/AvatarLoader.tsx +0 -104
- package/src/components/AvatarSelector.tsx +0 -223
- package/src/components/BscTradePanel.tsx +0 -549
- package/src/components/BugReportModal.tsx +0 -499
- package/src/components/CharacterRoster.tsx +0 -143
- package/src/components/CharacterView.tsx +0 -1575
- package/src/components/ChatAvatar.test.ts +0 -97
- package/src/components/ChatAvatar.tsx +0 -147
- package/src/components/ChatComposer.tsx +0 -330
- package/src/components/ChatMessage.tsx +0 -448
- package/src/components/ChatModalView.test.tsx +0 -118
- package/src/components/ChatModalView.tsx +0 -125
- package/src/components/ChatView.tsx +0 -992
- package/src/components/CloudOnboarding.tsx +0 -81
- package/src/components/CloudSourceControls.tsx +0 -85
- package/src/components/CodingAgentSettingsSection.tsx +0 -537
- package/src/components/CommandPalette.tsx +0 -284
- package/src/components/CompanionSceneHost.tsx +0 -517
- package/src/components/CompanionShell.tsx +0 -31
- package/src/components/CompanionView.tsx +0 -110
- package/src/components/ConfigPageView.tsx +0 -763
- package/src/components/ConfigSaveFooter.tsx +0 -41
- package/src/components/ConfirmModal.tsx +0 -379
- package/src/components/ConnectionFailedBanner.tsx +0 -91
- package/src/components/ConnectorsPageView.tsx +0 -13
- package/src/components/ConversationsSidebar.tsx +0 -279
- package/src/components/CustomActionEditor.tsx +0 -1127
- package/src/components/CustomActionsPanel.tsx +0 -288
- package/src/components/CustomActionsView.tsx +0 -325
- package/src/components/DatabasePageView.tsx +0 -55
- package/src/components/DatabaseView.tsx +0 -814
- package/src/components/ElizaCloudDashboard.tsx +0 -1696
- package/src/components/EmotePicker.tsx +0 -529
- package/src/components/ErrorBoundary.tsx +0 -76
- package/src/components/FineTuningView.tsx +0 -1080
- package/src/components/FlaminaGuide.test.tsx +0 -61
- package/src/components/FlaminaGuide.tsx +0 -212
- package/src/components/GameView.tsx +0 -551
- package/src/components/GameViewOverlay.tsx +0 -133
- package/src/components/GlobalEmoteOverlay.tsx +0 -152
- package/src/components/Header.test.tsx +0 -413
- package/src/components/Header.tsx +0 -400
- package/src/components/HeartbeatsView.tsx +0 -1003
- package/src/components/InventoryView.tsx +0 -393
- package/src/components/KnowledgeView.tsx +0 -1128
- package/src/components/LanguageDropdown.tsx +0 -192
- package/src/components/LifoMonitorPanel.tsx +0 -196
- package/src/components/LifoSandboxView.tsx +0 -499
- package/src/components/LoadingScreen.tsx +0 -112
- package/src/components/LogsPageView.tsx +0 -17
- package/src/components/LogsView.tsx +0 -239
- package/src/components/MediaGalleryView.tsx +0 -431
- package/src/components/MediaSettingsSection.tsx +0 -893
- package/src/components/MessageContent.tsx +0 -815
- package/src/components/MiladyBar.tsx +0 -103
- package/src/components/MiladyBarSettings.tsx +0 -872
- package/src/components/OnboardingWizard.test.tsx +0 -104
- package/src/components/OnboardingWizard.tsx +0 -249
- package/src/components/PairingView.tsx +0 -109
- package/src/components/PermissionsSection.tsx +0 -1184
- package/src/components/PluginsPageView.tsx +0 -9
- package/src/components/PluginsView.tsx +0 -3129
- package/src/components/ProviderSwitcher.tsx +0 -903
- package/src/components/RestartBanner.tsx +0 -76
- package/src/components/RuntimeView.tsx +0 -460
- package/src/components/SaveCommandModal.tsx +0 -211
- package/src/components/SecretsView.tsx +0 -569
- package/src/components/SecurityPageView.tsx +0 -242
- package/src/components/SettingsView.tsx +0 -825
- package/src/components/ShellOverlays.tsx +0 -41
- package/src/components/ShortcutsOverlay.tsx +0 -155
- package/src/components/SkillsView.tsx +0 -1435
- package/src/components/StartupFailureView.tsx +0 -63
- package/src/components/StreamView.tsx +0 -481
- package/src/components/StripeEmbeddedCheckout.tsx +0 -155
- package/src/components/SubscriptionStatus.tsx +0 -640
- package/src/components/SystemWarningBanner.tsx +0 -71
- package/src/components/ThemeToggle.tsx +0 -103
- package/src/components/TrajectoriesView.tsx +0 -526
- package/src/components/TrajectoryDetailView.tsx +0 -426
- package/src/components/VectorBrowserView.tsx +0 -1633
- package/src/components/VoiceConfigView.tsx +0 -674
- package/src/components/VrmStage.test.ts +0 -176
- package/src/components/VrmStage.tsx +0 -309
- package/src/components/WhatsAppQrOverlay.tsx +0 -230
- package/src/components/__tests__/chainConfig.test.ts +0 -220
- package/src/components/apps/AppDetailPane.tsx +0 -242
- package/src/components/apps/AppsCatalogGrid.tsx +0 -137
- package/src/components/apps/extensions/registry.ts +0 -13
- package/src/components/apps/extensions/types.ts +0 -9
- package/src/components/apps/helpers.ts +0 -43
- package/src/components/avatar/VrmAnimationLoader.test.ts +0 -164
- package/src/components/avatar/VrmAnimationLoader.ts +0 -151
- package/src/components/avatar/VrmBlinkController.ts +0 -118
- package/src/components/avatar/VrmCameraManager.ts +0 -407
- package/src/components/avatar/VrmEngine.ts +0 -2767
- package/src/components/avatar/VrmFootShadow.ts +0 -96
- package/src/components/avatar/VrmViewer.tsx +0 -421
- package/src/components/avatar/__tests__/VrmCameraManager.test.ts +0 -168
- package/src/components/avatar/__tests__/VrmEngine.test.ts +0 -1574
- package/src/components/avatar/mixamoVRMRigMap.ts +0 -62
- package/src/components/avatar/retargetMixamoFbxToVrm.ts +0 -144
- package/src/components/avatar/retargetMixamoGltfToVrm.ts +0 -119
- package/src/components/chainConfig.ts +0 -400
- package/src/components/companion/CompanionHeader.tsx +0 -50
- package/src/components/companion/CompanionSceneHost.tsx +0 -5
- package/src/components/companion/VrmStage.tsx +0 -2
- package/src/components/companion/__tests__/walletUtils.test.ts +0 -742
- package/src/components/companion/index.ts +0 -18
- package/src/components/companion/walletUtils.ts +0 -290
- package/src/components/companion-shell-styles.test.ts +0 -142
- package/src/components/companion-shell-styles.ts +0 -270
- package/src/components/confirm-delete-control.tsx +0 -69
- package/src/components/conversations/ConversationListItem.tsx +0 -185
- package/src/components/conversations/conversation-utils.ts +0 -151
- package/src/components/format.ts +0 -131
- package/src/components/index.ts +0 -96
- package/src/components/inventory/CopyableAddress.tsx +0 -41
- package/src/components/inventory/InventoryToolbar.tsx +0 -142
- package/src/components/inventory/NftGrid.tsx +0 -99
- package/src/components/inventory/TokenLogo.tsx +0 -71
- package/src/components/inventory/TokensTable.tsx +0 -216
- package/src/components/inventory/constants.ts +0 -170
- package/src/components/inventory/index.ts +0 -29
- package/src/components/inventory/media-url.test.ts +0 -38
- package/src/components/inventory/media-url.ts +0 -36
- package/src/components/inventory/useInventoryData.ts +0 -460
- package/src/components/knowledge-upload-image.ts +0 -215
- package/src/components/labels.ts +0 -46
- package/src/components/milady-bar/CloudCreditsChip.tsx +0 -61
- package/src/components/milady-bar/ProviderDropdown.tsx +0 -166
- package/src/components/milady-bar/WalletSummary.tsx +0 -61
- package/src/components/milady-bar/index.ts +0 -3
- package/src/components/onboarding/ActivateStep.tsx +0 -34
- package/src/components/onboarding/ConnectionStep.tsx +0 -1591
- package/src/components/onboarding/IdentityStep.tsx +0 -251
- package/src/components/onboarding/OnboardingPanel.tsx +0 -39
- package/src/components/onboarding/OnboardingStepNav.tsx +0 -41
- package/src/components/onboarding/PermissionsStep.tsx +0 -20
- package/src/components/onboarding/RpcStep.tsx +0 -402
- package/src/components/permissions/PermissionIcon.tsx +0 -25
- package/src/components/permissions/StreamingPermissions.tsx +0 -413
- package/src/components/plugins/showcase-data.ts +0 -481
- package/src/components/shared/ShellHeaderControls.tsx +0 -198
- package/src/components/shared-companion-scene-context.ts +0 -15
- package/src/components/skeletons.tsx +0 -88
- package/src/components/stream/ActivityFeed.tsx +0 -113
- package/src/components/stream/AvatarPip.tsx +0 -10
- package/src/components/stream/ChatContent.tsx +0 -126
- package/src/components/stream/ChatTicker.tsx +0 -55
- package/src/components/stream/IdleContent.tsx +0 -73
- package/src/components/stream/StatusBar.tsx +0 -463
- package/src/components/stream/StreamSettings.tsx +0 -506
- package/src/components/stream/StreamTerminal.tsx +0 -94
- package/src/components/stream/StreamVoiceConfig.tsx +0 -160
- package/src/components/stream/helpers.ts +0 -134
- package/src/components/stream/overlays/OverlayLayer.tsx +0 -75
- package/src/components/stream/overlays/built-in/ActionTickerWidget.tsx +0 -64
- package/src/components/stream/overlays/built-in/AlertPopupWidget.tsx +0 -87
- package/src/components/stream/overlays/built-in/BrandingWidget.tsx +0 -51
- package/src/components/stream/overlays/built-in/CustomHtmlWidget.tsx +0 -105
- package/src/components/stream/overlays/built-in/PeonGlassWidget.tsx +0 -265
- package/src/components/stream/overlays/built-in/PeonHudWidget.tsx +0 -247
- package/src/components/stream/overlays/built-in/PeonSakuraWidget.tsx +0 -278
- package/src/components/stream/overlays/built-in/ThoughtBubbleWidget.tsx +0 -77
- package/src/components/stream/overlays/built-in/ViewerCountWidget.tsx +0 -46
- package/src/components/stream/overlays/built-in/index.ts +0 -13
- package/src/components/stream/overlays/registry.ts +0 -22
- package/src/components/stream/overlays/types.ts +0 -90
- package/src/components/stream/overlays/useOverlayLayout.ts +0 -218
- package/src/components/trajectory-format.ts +0 -50
- package/src/components/ui-badges.tsx +0 -109
- package/src/components/ui-switch.tsx +0 -57
- package/src/components/vector-browser-three.ts +0 -29
- package/src/config/branding.ts +0 -67
- package/src/config/config-catalog.ts +0 -1092
- package/src/config/config-field.tsx +0 -1924
- package/src/config/config-renderer.tsx +0 -734
- package/src/config/index.ts +0 -12
- package/src/config/ui-renderer.tsx +0 -1751
- package/src/config/ui-spec.ts +0 -256
- package/src/events/index.ts +0 -96
- package/src/hooks/useBugReport.tsx +0 -43
- package/src/hooks/useCanvasWindow.ts +0 -372
- package/src/hooks/useChatAvatarVoice.ts +0 -111
- package/src/hooks/useClickOutside.ts +0 -31
- package/src/hooks/useContextMenu.ts +0 -127
- package/src/hooks/useKeyboardShortcuts.ts +0 -86
- package/src/hooks/useLifoSync.ts +0 -143
- package/src/hooks/useMemoryMonitor.ts +0 -334
- package/src/hooks/useMiladyBar.ts +0 -594
- package/src/hooks/useRenderGuard.ts +0 -43
- package/src/hooks/useRetakeCapture.ts +0 -68
- package/src/hooks/useStreamPopoutNavigation.ts +0 -27
- package/src/hooks/useTimeout.ts +0 -37
- package/src/hooks/useVoiceChat.ts +0 -1442
- package/src/hooks/useWhatsAppPairing.ts +0 -123
- package/src/i18n/index.ts +0 -76
- package/src/i18n/locales/en.json +0 -1195
- package/src/i18n/locales/es.json +0 -1195
- package/src/i18n/locales/ko.json +0 -1195
- package/src/i18n/locales/pt.json +0 -1195
- package/src/i18n/locales/zh-CN.json +0 -1195
- package/src/i18n/messages.ts +0 -21
- package/src/navigation/index.ts +0 -286
- package/src/navigation.test.ts +0 -189
- package/src/onboarding-config.test.ts +0 -104
- package/src/onboarding-config.ts +0 -122
- package/src/platform/browser-launch.test.ts +0 -94
- package/src/platform/browser-launch.ts +0 -149
- package/src/platform/index.ts +0 -58
- package/src/platform/init.ts +0 -238
- package/src/platform/lifo.ts +0 -225
- package/src/providers/index.ts +0 -108
- package/src/shell-params.test.ts +0 -48
- package/src/shell-params.ts +0 -36
- package/src/state/AppContext.tsx +0 -6415
- package/src/state/internal.ts +0 -91
- package/src/state/onboarding-resume.test.ts +0 -135
- package/src/state/onboarding-resume.ts +0 -263
- package/src/state/parsers.test.ts +0 -124
- package/src/state/parsers.ts +0 -309
- package/src/state/persistence.ts +0 -379
- package/src/state/shell-routing.ts +0 -39
- package/src/state/types.ts +0 -724
- package/src/state/ui-preferences.ts +0 -3
- package/src/state/useApp.ts +0 -23
- package/src/state/vrm.ts +0 -108
- package/src/styles/anime.css +0 -6324
- package/src/styles/onboarding-game.css +0 -976
- package/src/types/index.ts +0 -715
- package/src/types/react-test-renderer.d.ts +0 -45
- package/src/utils/asset-url.ts +0 -110
- package/src/utils/assistant-text.ts +0 -172
- package/src/utils/clipboard.ts +0 -41
- package/src/utils/desktop-dialogs.ts +0 -80
- package/src/utils/eliza-globals.ts +0 -44
- package/src/utils/number-parsing.ts +0 -125
- package/src/utils/openExternalUrl.ts +0 -20
- package/src/utils/spoken-text.ts +0 -65
- package/src/utils/streaming-text.ts +0 -120
- package/src/voice/types.ts +0 -197
- package/src/wallet-rpc.ts +0 -176
- package/test/app/AppContext.pty-sessions.test.tsx +0 -143
- package/test/app/MessageContent.test.tsx +0 -366
- package/test/app/PermissionsOnboarding.test.tsx +0 -358
- package/test/app/PermissionsSection.test.tsx +0 -575
- package/test/app/advanced-trajectory-fine-tuning.e2e.test.ts +0 -396
- package/test/app/agent-activity-box.test.tsx +0 -132
- package/test/app/agent-transfer-lock.test.ts +0 -279
- package/test/app/api-client-electrobun-fallback.test.ts +0 -139
- package/test/app/api-client-electron-fallback.test.ts +0 -139
- package/test/app/api-client-timeout.test.ts +0 -75
- package/test/app/api-client-ws.test.ts +0 -98
- package/test/app/api-client.ws-max-reconnect.test.ts +0 -139
- package/test/app/api-client.ws-reconnect.test.ts +0 -157
- package/test/app/app-context-autonomy-events.test.ts +0 -559
- package/test/app/apps-page-view.test.ts +0 -114
- package/test/app/apps-view.test.ts +0 -768
- package/test/app/autonomous-workflows.e2e.test.ts +0 -765
- package/test/app/autonomy-events.test.ts +0 -150
- package/test/app/avatar-selector.test.tsx +0 -52
- package/test/app/bsc-trade-panel.test.tsx +0 -134
- package/test/app/bug-report-modal.test.tsx +0 -353
- package/test/app/character-action-bar-visibility.test.ts +0 -70
- package/test/app/character-customization.e2e.test.ts +0 -1384
- package/test/app/character-save-journey.test.ts +0 -1245
- package/test/app/chat-advanced-features.e2e.test.ts +0 -706
- package/test/app/chat-composer.test.tsx +0 -181
- package/test/app/chat-journey.test.ts +0 -1075
- package/test/app/chat-language-header.test.ts +0 -64
- package/test/app/chat-message.test.tsx +0 -222
- package/test/app/chat-modal-view.test.tsx +0 -191
- package/test/app/chat-routine-filter.test.ts +0 -96
- package/test/app/chat-send-lock.test.ts +0 -1465
- package/test/app/chat-stream-api-client.test.tsx +0 -390
- package/test/app/chat-view-game-modal.test.tsx +0 -661
- package/test/app/chat-view.test.tsx +0 -877
- package/test/app/cloud-api.e2e.test.ts +0 -258
- package/test/app/cloud-login-flow.e2e.test.ts +0 -494
- package/test/app/cloud-login-lock.test.ts +0 -416
- package/test/app/command-palette.test.tsx +0 -184
- package/test/app/command-registry.test.ts +0 -75
- package/test/app/companion-greeting-wave.test.tsx +0 -431
- package/test/app/companion-scene-host.test.tsx +0 -85
- package/test/app/companion-stale-conversation.test.tsx +0 -447
- package/test/app/companion-view.test.tsx +0 -690
- package/test/app/confirm-delete-control.test.ts +0 -79
- package/test/app/confirm-modal.test.tsx +0 -219
- package/test/app/connection-mode-persistence.test.ts +0 -411
- package/test/app/connectors-ui.e2e.test.ts +0 -508
- package/test/app/conversations-sidebar-game-modal.test.tsx +0 -265
- package/test/app/conversations-sidebar.test.tsx +0 -185
- package/test/app/custom-actions-smoke.test.ts +0 -387
- package/test/app/custom-avatar-api-client.test.ts +0 -207
- package/test/app/desktop-utils.test.ts +0 -145
- package/test/app/electrobun-rpc-bridge.test.ts +0 -83
- package/test/app/events.test.ts +0 -88
- package/test/app/export-import-flows.e2e.test.ts +0 -700
- package/test/app/fine-tuning-view.test.ts +0 -471
- package/test/app/game-view-auth-session.test.tsx +0 -187
- package/test/app/game-view.test.ts +0 -444
- package/test/app/global-emote-overlay.test.tsx +0 -106
- package/test/app/header-status.test.tsx +0 -149
- package/test/app/i18n.test.ts +0 -152
- package/test/app/inventory-bsc-view.test.ts +0 -940
- package/test/app/knowledge-ui.e2e.test.ts +0 -762
- package/test/app/knowledge-upload-helpers.test.ts +0 -124
- package/test/app/lifecycle-lock.test.ts +0 -267
- package/test/app/lifo-popout-utils.test.ts +0 -208
- package/test/app/lifo-safe-endpoint.test.ts +0 -34
- package/test/app/loading-screen.test.tsx +0 -45
- package/test/app/memory-monitor.test.ts +0 -331
- package/test/app/milady-bar-regression.test.tsx +0 -519
- package/test/app/milady-bar-settings.test.tsx +0 -1056
- package/test/app/milady-bar.test.tsx +0 -583
- package/test/app/navigation.test.tsx +0 -22
- package/test/app/onboarding-e2e-journey.test.ts +0 -1409
- package/test/app/onboarding-finish-lock.test.ts +0 -676
- package/test/app/onboarding-language.test.tsx +0 -160
- package/test/app/onboarding-steps.test.tsx +0 -375
- package/test/app/open-external-url.test.ts +0 -65
- package/test/app/pages-navigation-smoke.e2e.test.ts +0 -646
- package/test/app/pairing-lock.test.ts +0 -260
- package/test/app/pairing-view.test.tsx +0 -74
- package/test/app/permissions-section.test.ts +0 -432
- package/test/app/plugin-bridge.test.ts +0 -109
- package/test/app/plugins-ui.e2e.test.ts +0 -605
- package/test/app/plugins-view-game-modal.test.tsx +0 -686
- package/test/app/plugins-view-toggle-restart.test.ts +0 -129
- package/test/app/provider-dropdown-default.test.tsx +0 -300
- package/test/app/restart-banner.test.tsx +0 -205
- package/test/app/retake-capture.test.ts +0 -84
- package/test/app/sandbox-api-client.test.ts +0 -108
- package/test/app/save-command-modal.test.tsx +0 -109
- package/test/app/secrets-view.test.tsx +0 -92
- package/test/app/settings-control-styles.test.tsx +0 -142
- package/test/app/settings-reset.e2e.test.ts +0 -726
- package/test/app/settings-sections.e2e.test.ts +0 -614
- package/test/app/shared-format.test.ts +0 -44
- package/test/app/shared-switch.test.ts +0 -69
- package/test/app/shell-mode-switching.e2e.test.ts +0 -841
- package/test/app/shell-mode-tab-memory.test.tsx +0 -58
- package/test/app/shell-overlays.test.tsx +0 -50
- package/test/app/shortcuts-overlay.test.tsx +0 -111
- package/test/app/sse-interruption.test.ts +0 -122
- package/test/app/startup-asset-missing.e2e.test.ts +0 -126
- package/test/app/startup-backend-missing.e2e.test.ts +0 -126
- package/test/app/startup-chat.e2e.test.ts +0 -323
- package/test/app/startup-conversation-restore.test.tsx +0 -381
- package/test/app/startup-failure-view.test.tsx +0 -103
- package/test/app/startup-onboarding.e2e.test.ts +0 -712
- package/test/app/startup-timeout.test.tsx +0 -80
- package/test/app/startup-token-401.e2e.test.ts +0 -103
- package/test/app/stream-helpers.test.ts +0 -46
- package/test/app/stream-popout-navigation.test.tsx +0 -41
- package/test/app/stream-status-bar.test.tsx +0 -89
- package/test/app/theme-toggle.test.tsx +0 -40
- package/test/app/training-api-client.test.ts +0 -128
- package/test/app/trajectories-view.test.tsx +0 -220
- package/test/app/triggers-api-client.test.ts +0 -77
- package/test/app/triggers-navigation.test.ts +0 -113
- package/test/app/triggers-view.e2e.test.ts +0 -675
- package/test/app/update-channel-lock.test.ts +0 -259
- package/test/app/vector-browser.async-cleanup.test.tsx +0 -367
- package/test/app/vector-browser.e2e.test.ts +0 -653
- package/test/app/vrm-stage.test.tsx +0 -351
- package/test/app/vrm-viewer.test.tsx +0 -298
- package/test/app/wallet-api-save-lock.test.ts +0 -299
- package/test/app/wallet-hooks.test.ts +0 -405
- package/test/app/wallet-ui-flows.e2e.test.ts +0 -556
- package/test/avatar/asset-url.test.ts +0 -90
- package/test/avatar/avatar-selector.test.ts +0 -173
- package/test/avatar/mixamo-vrm-rig-map.test.ts +0 -111
- package/test/avatar/voice-chat-streaming-text.test.ts +0 -96
- package/test/avatar/voice-chat.test.ts +0 -391
- package/test/browser-extension/README.md +0 -138
- package/test/browser-extension/test-harness.ts +0 -499
- package/test/capacitor-plugins.e2e.test.ts +0 -168
- package/test/test-types.ts +0 -5
- package/test/ui/command-palette-commands.test.ts +0 -57
- package/test/ui/ui-renderer.test.ts +0 -39
- package/test/utils/assistant-text.test.ts +0 -68
- package/test/utils/eliza-globals.test.ts +0 -59
- package/test/utils/package-exports.test.ts +0 -70
- package/test/utils/streaming-text.test.ts +0 -89
- package/tsconfig.build.json +0 -19
- package/tsconfig.json +0 -20
- package/tsconfig.typecheck.json +0 -12
- /package/{src/api/index.ts → api/index.js} +0 -0
- /package/{src/bridge/index.ts → bridge/index.js} +0 -0
- /package/{src/components/TriggersView.tsx → components/TriggersView.js} +0 -0
- /package/{src/hooks/index.ts → hooks/index.js} +0 -0
- /package/{src/index.ts → index.js} +0 -0
- /package/{src/state/index.ts → state/index.js} +0 -0
- /package/{src/styles → styles}/base.css +0 -0
- /package/{src/styles → styles}/styles.css +0 -0
- /package/{src/styles → styles}/xterm.css +0 -0
- /package/{src/utils/index.ts → utils/index.js} +0 -0
- /package/{src/voice/index.ts → voice/index.js} +0 -0
|
@@ -1,1092 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Plugin config catalog & registry — reverse-engineered from vercel-labs/json-render.
|
|
3
|
-
*
|
|
4
|
-
* json-render pattern:
|
|
5
|
-
* defineCatalog(schema, { components, actions, functions }) → type-safe catalog
|
|
6
|
-
* defineRegistry(catalog, { components, actions }) → maps catalog → renderers/handlers
|
|
7
|
-
* <Renderer spec={} registry={} /> → traverses spec, renders
|
|
8
|
-
*
|
|
9
|
-
* Our adaptation for plugin config forms:
|
|
10
|
-
* defineCatalog({ fields, actions?, functions? }) → field + action + validation catalog
|
|
11
|
-
* defineRegistry(catalog, renderers, actionHandlers?) → maps types → render/handler functions
|
|
12
|
-
* <ConfigRenderer> → reads JSON Schema + uiHints, renders form
|
|
13
|
-
*
|
|
14
|
-
* New in Phase 2 (json-render feature parity):
|
|
15
|
-
* - Actions: catalog actions with Zod params + registry handlers
|
|
16
|
-
* - Rich visibility: LogicExpression (and/or/not/eq/neq/gt/gte/lt/lte)
|
|
17
|
-
* - Validation checks: declarative checks (required/email/minLength/pattern/...)
|
|
18
|
-
* - Data binding: DynamicValue with path resolution (getByPath/setByPath)
|
|
19
|
-
* - Prompt generation: catalog.prompt() for AI system prompts
|
|
20
|
-
*
|
|
21
|
-
* @module config-catalog
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
import type { ReactNode } from "react";
|
|
25
|
-
import { z } from "zod";
|
|
26
|
-
import type {
|
|
27
|
-
ConfigUiHint,
|
|
28
|
-
DynamicValue,
|
|
29
|
-
LogicExpression,
|
|
30
|
-
ShowIfCondition,
|
|
31
|
-
ValidationCheck,
|
|
32
|
-
ValidationConfig,
|
|
33
|
-
VisibilityCondition,
|
|
34
|
-
} from "../types";
|
|
35
|
-
|
|
36
|
-
// ── JSON Schema types (subset we consume) ──────────────────────────────
|
|
37
|
-
|
|
38
|
-
export interface JsonSchemaProperty {
|
|
39
|
-
type?: string | string[];
|
|
40
|
-
enum?: unknown[];
|
|
41
|
-
const?: unknown;
|
|
42
|
-
default?: unknown;
|
|
43
|
-
description?: string;
|
|
44
|
-
format?: string;
|
|
45
|
-
minimum?: number;
|
|
46
|
-
maximum?: number;
|
|
47
|
-
minLength?: number;
|
|
48
|
-
maxLength?: number;
|
|
49
|
-
pattern?: string;
|
|
50
|
-
properties?: Record<string, JsonSchemaProperty>;
|
|
51
|
-
items?: JsonSchemaProperty;
|
|
52
|
-
required?: string[];
|
|
53
|
-
oneOf?: JsonSchemaProperty[];
|
|
54
|
-
anyOf?: JsonSchemaProperty[];
|
|
55
|
-
additionalProperties?: boolean | JsonSchemaProperty;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export interface JsonSchemaObject extends JsonSchemaProperty {
|
|
59
|
-
type: "object";
|
|
60
|
-
properties: Record<string, JsonSchemaProperty>;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// ── Dynamic value resolution (≈ json-render DynamicValue + getByPath) ───
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Get a value from a nested object by slash-delimited path (JSON Pointer).
|
|
67
|
-
*
|
|
68
|
-
* @example
|
|
69
|
-
* getByPath({ a: { b: 42 } }, "a/b") // → 42
|
|
70
|
-
* getByPath({ items: [1, 2] }, "items/0") // → 1
|
|
71
|
-
*/
|
|
72
|
-
export function getByPath(obj: unknown, path: string): unknown {
|
|
73
|
-
if (!path || path === "/") return obj;
|
|
74
|
-
const segments = (path.startsWith("/") ? path.slice(1) : path).split("/");
|
|
75
|
-
let current: unknown = obj;
|
|
76
|
-
for (const seg of segments) {
|
|
77
|
-
if (current == null) return undefined;
|
|
78
|
-
if (Array.isArray(current)) {
|
|
79
|
-
current = current[parseInt(seg, 10)];
|
|
80
|
-
} else if (typeof current === "object") {
|
|
81
|
-
current = (current as Record<string, unknown>)[seg];
|
|
82
|
-
} else {
|
|
83
|
-
return undefined;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
return current;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Set a value in a nested object by slash-delimited path.
|
|
91
|
-
*/
|
|
92
|
-
export function setByPath(
|
|
93
|
-
obj: Record<string, unknown>,
|
|
94
|
-
path: string,
|
|
95
|
-
value: unknown,
|
|
96
|
-
): void {
|
|
97
|
-
const segments = (path.startsWith("/") ? path.slice(1) : path).split("/");
|
|
98
|
-
if (segments.length === 0) return;
|
|
99
|
-
const BLOCKED_KEYS = ["__proto__", "constructor", "prototype"];
|
|
100
|
-
for (const seg of segments) {
|
|
101
|
-
if (BLOCKED_KEYS.includes(seg)) return; // silently reject dangerous paths
|
|
102
|
-
}
|
|
103
|
-
let current: Record<string, unknown> = obj;
|
|
104
|
-
for (let i = 0; i < segments.length - 1; i++) {
|
|
105
|
-
const seg = segments[i];
|
|
106
|
-
if (!(seg in current) || typeof current[seg] !== "object") {
|
|
107
|
-
current[seg] = /^\d+$/.test(segments[i + 1]) ? [] : {};
|
|
108
|
-
}
|
|
109
|
-
current = current[seg] as Record<string, unknown>;
|
|
110
|
-
}
|
|
111
|
-
current[segments[segments.length - 1]] = value;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* Resolve a DynamicValue — if it's a {path} reference, look up in state.
|
|
116
|
-
*/
|
|
117
|
-
export function resolveDynamic<T>(
|
|
118
|
-
value: DynamicValue<T>,
|
|
119
|
-
state: Record<string, unknown>,
|
|
120
|
-
): T | undefined {
|
|
121
|
-
if (value != null && typeof value === "object" && "path" in value) {
|
|
122
|
-
return getByPath(state, (value as { path: string }).path) as T | undefined;
|
|
123
|
-
}
|
|
124
|
-
return value as T;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* Search for a field value by name — ported from json-render's dashboard example.
|
|
129
|
-
*
|
|
130
|
-
* Resolution order:
|
|
131
|
-
* 1. Direct params lookup
|
|
132
|
-
* 2. Params with path format (JSON Pointer)
|
|
133
|
-
* 3. State walk through common form prefixes (form, newItem, create, edit, root)
|
|
134
|
-
*/
|
|
135
|
-
export function findFormValue(
|
|
136
|
-
fieldName: string,
|
|
137
|
-
params?: Record<string, unknown>,
|
|
138
|
-
state?: Record<string, unknown>,
|
|
139
|
-
): unknown {
|
|
140
|
-
// 1. Check direct params
|
|
141
|
-
if (params && fieldName in params) return params[fieldName];
|
|
142
|
-
|
|
143
|
-
// 2. Check params with path format
|
|
144
|
-
if (params) {
|
|
145
|
-
const pathValue = getByPath(params, `/${fieldName}`);
|
|
146
|
-
if (pathValue !== undefined) return pathValue;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
// 3. Search state - check common form prefixes
|
|
150
|
-
if (state) {
|
|
151
|
-
const prefixes = ["form", "newItem", "create", "edit", ""];
|
|
152
|
-
for (const prefix of prefixes) {
|
|
153
|
-
const path = prefix ? `/${prefix}/${fieldName}` : `/${fieldName}`;
|
|
154
|
-
const val = getByPath(state, path);
|
|
155
|
-
if (val !== undefined) return val;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
return undefined;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* Interpolate `{{path}}` references in a template string using context values.
|
|
164
|
-
*
|
|
165
|
-
* Useful for action onSuccess/onError messages that reference state values.
|
|
166
|
-
*
|
|
167
|
-
* @example
|
|
168
|
-
* interpolateString("Created {{/form/name}} successfully", { form: { name: "Foo" } })
|
|
169
|
-
* // → "Created Foo successfully"
|
|
170
|
-
*/
|
|
171
|
-
export function interpolateString(
|
|
172
|
-
template: string,
|
|
173
|
-
context: Record<string, unknown>,
|
|
174
|
-
): string {
|
|
175
|
-
return template.replace(/\{\{([^}]+)\}\}/g, (_, path) => {
|
|
176
|
-
const value = getByPath(
|
|
177
|
-
context,
|
|
178
|
-
path.trim().startsWith("/") ? path.trim() : `/${path.trim()}`,
|
|
179
|
-
);
|
|
180
|
-
return value !== undefined ? String(value) : "";
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
// ── Rich visibility evaluation (≈ json-render evaluateVisibility) ───────
|
|
185
|
-
|
|
186
|
-
/**
|
|
187
|
-
* Evaluate a LogicExpression against a state model.
|
|
188
|
-
*/
|
|
189
|
-
export function evaluateLogicExpression(
|
|
190
|
-
expr: LogicExpression,
|
|
191
|
-
state: Record<string, unknown>,
|
|
192
|
-
): boolean {
|
|
193
|
-
if ("and" in expr)
|
|
194
|
-
return (expr as { and: LogicExpression[] }).and.every((e) =>
|
|
195
|
-
evaluateLogicExpression(e, state),
|
|
196
|
-
);
|
|
197
|
-
if ("or" in expr)
|
|
198
|
-
return (expr as { or: LogicExpression[] }).or.some((e) =>
|
|
199
|
-
evaluateLogicExpression(e, state),
|
|
200
|
-
);
|
|
201
|
-
if ("not" in expr)
|
|
202
|
-
return !evaluateLogicExpression(
|
|
203
|
-
(expr as { not: LogicExpression }).not,
|
|
204
|
-
state,
|
|
205
|
-
);
|
|
206
|
-
if ("path" in expr)
|
|
207
|
-
return Boolean(getByPath(state, (expr as { path: string }).path));
|
|
208
|
-
if ("eq" in expr) {
|
|
209
|
-
const [l, r] = (expr as { eq: [DynamicValue, DynamicValue] }).eq;
|
|
210
|
-
return resolveDynamic(l, state) === resolveDynamic(r, state);
|
|
211
|
-
}
|
|
212
|
-
if ("neq" in expr) {
|
|
213
|
-
const [l, r] = (expr as { neq: [DynamicValue, DynamicValue] }).neq;
|
|
214
|
-
return resolveDynamic(l, state) !== resolveDynamic(r, state);
|
|
215
|
-
}
|
|
216
|
-
if ("gt" in expr) {
|
|
217
|
-
const [l, r] = (
|
|
218
|
-
expr as { gt: [DynamicValue<number>, DynamicValue<number>] }
|
|
219
|
-
).gt;
|
|
220
|
-
const lv = resolveDynamic(l, state),
|
|
221
|
-
rv = resolveDynamic(r, state);
|
|
222
|
-
return typeof lv === "number" && typeof rv === "number" && lv > rv;
|
|
223
|
-
}
|
|
224
|
-
if ("gte" in expr) {
|
|
225
|
-
const [l, r] = (
|
|
226
|
-
expr as { gte: [DynamicValue<number>, DynamicValue<number>] }
|
|
227
|
-
).gte;
|
|
228
|
-
const lv = resolveDynamic(l, state),
|
|
229
|
-
rv = resolveDynamic(r, state);
|
|
230
|
-
return typeof lv === "number" && typeof rv === "number" && lv >= rv;
|
|
231
|
-
}
|
|
232
|
-
if ("lt" in expr) {
|
|
233
|
-
const [l, r] = (
|
|
234
|
-
expr as { lt: [DynamicValue<number>, DynamicValue<number>] }
|
|
235
|
-
).lt;
|
|
236
|
-
const lv = resolveDynamic(l, state),
|
|
237
|
-
rv = resolveDynamic(r, state);
|
|
238
|
-
return typeof lv === "number" && typeof rv === "number" && lv < rv;
|
|
239
|
-
}
|
|
240
|
-
if ("lte" in expr) {
|
|
241
|
-
const [l, r] = (
|
|
242
|
-
expr as { lte: [DynamicValue<number>, DynamicValue<number>] }
|
|
243
|
-
).lte;
|
|
244
|
-
const lv = resolveDynamic(l, state),
|
|
245
|
-
rv = resolveDynamic(r, state);
|
|
246
|
-
return typeof lv === "number" && typeof rv === "number" && lv <= rv;
|
|
247
|
-
}
|
|
248
|
-
return false;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
/**
|
|
252
|
-
* Evaluate a full VisibilityCondition.
|
|
253
|
-
*/
|
|
254
|
-
export function evaluateVisibility(
|
|
255
|
-
condition: VisibilityCondition | undefined,
|
|
256
|
-
state: Record<string, unknown>,
|
|
257
|
-
): boolean {
|
|
258
|
-
if (condition === undefined) return true;
|
|
259
|
-
if (typeof condition === "boolean") return condition;
|
|
260
|
-
if ("path" in condition && !("and" in condition) && !("or" in condition)) {
|
|
261
|
-
return Boolean(getByPath(state, (condition as { path: string }).path));
|
|
262
|
-
}
|
|
263
|
-
return evaluateLogicExpression(condition as LogicExpression, state);
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
/**
|
|
267
|
-
* Evaluate a legacy ShowIfCondition (backwards compat).
|
|
268
|
-
*/
|
|
269
|
-
export function evaluateShowIf(
|
|
270
|
-
condition: ShowIfCondition | undefined,
|
|
271
|
-
values: Record<string, unknown>,
|
|
272
|
-
): boolean {
|
|
273
|
-
if (!condition) return true;
|
|
274
|
-
const val = values[condition.field];
|
|
275
|
-
switch (condition.op) {
|
|
276
|
-
case "eq":
|
|
277
|
-
return val === condition.value;
|
|
278
|
-
case "neq":
|
|
279
|
-
return val !== condition.value;
|
|
280
|
-
case "in":
|
|
281
|
-
return Array.isArray(condition.value) && condition.value.includes(val);
|
|
282
|
-
case "truthy":
|
|
283
|
-
return Boolean(val);
|
|
284
|
-
case "falsy":
|
|
285
|
-
return !val;
|
|
286
|
-
default:
|
|
287
|
-
return true;
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
// ── Visibility helpers (≈ json-render visibility.*) ─────────────────────
|
|
292
|
-
|
|
293
|
-
export const visibility = {
|
|
294
|
-
always: true as const,
|
|
295
|
-
never: false as const,
|
|
296
|
-
when: (path: string): VisibilityCondition => ({ path }),
|
|
297
|
-
and: (...conditions: LogicExpression[]): LogicExpression => ({
|
|
298
|
-
and: conditions,
|
|
299
|
-
}),
|
|
300
|
-
or: (...conditions: LogicExpression[]): LogicExpression => ({
|
|
301
|
-
or: conditions,
|
|
302
|
-
}),
|
|
303
|
-
not: (condition: LogicExpression): LogicExpression => ({ not: condition }),
|
|
304
|
-
eq: (left: DynamicValue, right: DynamicValue): LogicExpression => ({
|
|
305
|
-
eq: [left, right],
|
|
306
|
-
}),
|
|
307
|
-
neq: (left: DynamicValue, right: DynamicValue): LogicExpression => ({
|
|
308
|
-
neq: [left, right],
|
|
309
|
-
}),
|
|
310
|
-
gt: (
|
|
311
|
-
left: DynamicValue<number>,
|
|
312
|
-
right: DynamicValue<number>,
|
|
313
|
-
): LogicExpression => ({ gt: [left, right] }),
|
|
314
|
-
gte: (
|
|
315
|
-
left: DynamicValue<number>,
|
|
316
|
-
right: DynamicValue<number>,
|
|
317
|
-
): LogicExpression => ({ gte: [left, right] }),
|
|
318
|
-
lt: (
|
|
319
|
-
left: DynamicValue<number>,
|
|
320
|
-
right: DynamicValue<number>,
|
|
321
|
-
): LogicExpression => ({ lt: [left, right] }),
|
|
322
|
-
lte: (
|
|
323
|
-
left: DynamicValue<number>,
|
|
324
|
-
right: DynamicValue<number>,
|
|
325
|
-
): LogicExpression => ({ lte: [left, right] }),
|
|
326
|
-
};
|
|
327
|
-
|
|
328
|
-
// ── Built-in validation functions (≈ json-render builtInValidationFunctions)
|
|
329
|
-
|
|
330
|
-
export type ValidationFunction = (
|
|
331
|
-
value: unknown,
|
|
332
|
-
args?: Record<string, unknown>,
|
|
333
|
-
) => boolean;
|
|
334
|
-
|
|
335
|
-
export const builtInValidators: Record<string, ValidationFunction> = {
|
|
336
|
-
required: (value) => {
|
|
337
|
-
if (value == null) return false;
|
|
338
|
-
if (typeof value === "string") return value.trim().length > 0;
|
|
339
|
-
if (Array.isArray(value)) return value.length > 0;
|
|
340
|
-
return true;
|
|
341
|
-
},
|
|
342
|
-
email: (value) =>
|
|
343
|
-
typeof value === "string" && /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value),
|
|
344
|
-
minLength: (value, args) =>
|
|
345
|
-
typeof value === "string" &&
|
|
346
|
-
typeof args?.min === "number" &&
|
|
347
|
-
value.length >= args.min,
|
|
348
|
-
maxLength: (value, args) =>
|
|
349
|
-
typeof value === "string" &&
|
|
350
|
-
typeof args?.max === "number" &&
|
|
351
|
-
value.length <= args.max,
|
|
352
|
-
pattern: (value, args) => {
|
|
353
|
-
if (typeof value !== "string" || typeof args?.pattern !== "string")
|
|
354
|
-
return false;
|
|
355
|
-
try {
|
|
356
|
-
return new RegExp(args.pattern).test(value);
|
|
357
|
-
} catch {
|
|
358
|
-
return false;
|
|
359
|
-
}
|
|
360
|
-
},
|
|
361
|
-
min: (value, args) =>
|
|
362
|
-
typeof value === "number" &&
|
|
363
|
-
typeof args?.min === "number" &&
|
|
364
|
-
value >= args.min,
|
|
365
|
-
max: (value, args) =>
|
|
366
|
-
typeof value === "number" &&
|
|
367
|
-
typeof args?.max === "number" &&
|
|
368
|
-
value <= args.max,
|
|
369
|
-
numeric: (value) =>
|
|
370
|
-
typeof value === "number"
|
|
371
|
-
? !Number.isNaN(value)
|
|
372
|
-
: typeof value === "string" && !Number.isNaN(parseFloat(value)),
|
|
373
|
-
url: (value) => {
|
|
374
|
-
if (typeof value !== "string") return false;
|
|
375
|
-
try {
|
|
376
|
-
new URL(value);
|
|
377
|
-
return true;
|
|
378
|
-
} catch {
|
|
379
|
-
return false;
|
|
380
|
-
}
|
|
381
|
-
},
|
|
382
|
-
matches: (value, args) => value === args?.other,
|
|
383
|
-
};
|
|
384
|
-
|
|
385
|
-
/**
|
|
386
|
-
* Run validation checks for a field value.
|
|
387
|
-
*/
|
|
388
|
-
export function runValidation(
|
|
389
|
-
config: ValidationConfig,
|
|
390
|
-
value: unknown,
|
|
391
|
-
state: Record<string, unknown>,
|
|
392
|
-
customFunctions?: Record<string, ValidationFunction>,
|
|
393
|
-
): { valid: boolean; errors: string[] } {
|
|
394
|
-
const errors: string[] = [];
|
|
395
|
-
|
|
396
|
-
// Check if validation is enabled
|
|
397
|
-
if (config.enabled && !evaluateLogicExpression(config.enabled, state)) {
|
|
398
|
-
return { valid: true, errors: [] };
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
if (config.checks) {
|
|
402
|
-
for (const check of config.checks) {
|
|
403
|
-
// Resolve dynamic args
|
|
404
|
-
const resolvedArgs: Record<string, unknown> = {};
|
|
405
|
-
if (check.args) {
|
|
406
|
-
for (const [k, v] of Object.entries(check.args)) {
|
|
407
|
-
resolvedArgs[k] = resolveDynamic(v, state);
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
const fn = builtInValidators[check.fn] ?? customFunctions?.[check.fn];
|
|
411
|
-
if (fn && !fn(value, resolvedArgs)) {
|
|
412
|
-
errors.push(check.message);
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
return { valid: errors.length === 0, errors };
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
// ── Validation check helpers (≈ json-render check.*) ────────────────────
|
|
421
|
-
|
|
422
|
-
export const check = {
|
|
423
|
-
required: (message = "This field is required"): ValidationCheck => ({
|
|
424
|
-
fn: "required",
|
|
425
|
-
message,
|
|
426
|
-
}),
|
|
427
|
-
email: (message = "Invalid email address"): ValidationCheck => ({
|
|
428
|
-
fn: "email",
|
|
429
|
-
message,
|
|
430
|
-
}),
|
|
431
|
-
minLength: (min: number, message?: string): ValidationCheck => ({
|
|
432
|
-
fn: "minLength",
|
|
433
|
-
args: { min },
|
|
434
|
-
message: message ?? `Must be at least ${min} characters`,
|
|
435
|
-
}),
|
|
436
|
-
maxLength: (max: number, message?: string): ValidationCheck => ({
|
|
437
|
-
fn: "maxLength",
|
|
438
|
-
args: { max },
|
|
439
|
-
message: message ?? `Must be at most ${max} characters`,
|
|
440
|
-
}),
|
|
441
|
-
pattern: (pattern: string, message = "Invalid format"): ValidationCheck => ({
|
|
442
|
-
fn: "pattern",
|
|
443
|
-
args: { pattern },
|
|
444
|
-
message,
|
|
445
|
-
}),
|
|
446
|
-
min: (min: number, message?: string): ValidationCheck => ({
|
|
447
|
-
fn: "min",
|
|
448
|
-
args: { min },
|
|
449
|
-
message: message ?? `Must be at least ${min}`,
|
|
450
|
-
}),
|
|
451
|
-
max: (max: number, message?: string): ValidationCheck => ({
|
|
452
|
-
fn: "max",
|
|
453
|
-
args: { max },
|
|
454
|
-
message: message ?? `Must be at most ${max}`,
|
|
455
|
-
}),
|
|
456
|
-
url: (message = "Invalid URL"): ValidationCheck => ({ fn: "url", message }),
|
|
457
|
-
matches: (
|
|
458
|
-
otherPath: string,
|
|
459
|
-
message = "Fields must match",
|
|
460
|
-
): ValidationCheck => ({
|
|
461
|
-
fn: "matches",
|
|
462
|
-
args: { other: { path: otherPath } },
|
|
463
|
-
message,
|
|
464
|
-
}),
|
|
465
|
-
};
|
|
466
|
-
|
|
467
|
-
// ── Action definitions (≈ json-render ActionDefinition) ─────────────────
|
|
468
|
-
|
|
469
|
-
export interface ActionDefinition<TParams = Record<string, unknown>> {
|
|
470
|
-
/** Zod schema for params validation. */
|
|
471
|
-
params?: z.ZodType<TParams>;
|
|
472
|
-
/** Description for AI and documentation. */
|
|
473
|
-
description?: string;
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
export type ActionHandler<
|
|
477
|
-
TParams = Record<string, unknown>,
|
|
478
|
-
TResult = unknown,
|
|
479
|
-
> = (
|
|
480
|
-
params: TParams,
|
|
481
|
-
state: Record<string, unknown>,
|
|
482
|
-
) => Promise<TResult> | TResult;
|
|
483
|
-
|
|
484
|
-
// ── Field definition (≈ json-render ComponentDefinition) ───────────────
|
|
485
|
-
|
|
486
|
-
export interface FieldDefinition<TValidator extends z.ZodType = z.ZodType> {
|
|
487
|
-
/** Zod schema for validating field values. */
|
|
488
|
-
validator: TValidator;
|
|
489
|
-
/** Human-readable description (used for documentation / AI prompts). */
|
|
490
|
-
description: string;
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
// ── Catalog (≈ json-render Catalog) ────────────────────────────────────
|
|
494
|
-
|
|
495
|
-
export interface FieldCatalog<
|
|
496
|
-
TFields extends Record<string, FieldDefinition> = Record<
|
|
497
|
-
string,
|
|
498
|
-
FieldDefinition
|
|
499
|
-
>,
|
|
500
|
-
TActions extends Record<string, ActionDefinition> = Record<
|
|
501
|
-
string,
|
|
502
|
-
ActionDefinition
|
|
503
|
-
>,
|
|
504
|
-
> {
|
|
505
|
-
readonly fields: TFields;
|
|
506
|
-
readonly fieldNames: string[];
|
|
507
|
-
readonly actions: TActions;
|
|
508
|
-
readonly actionNames: string[];
|
|
509
|
-
readonly functions: Record<string, ValidationFunction>;
|
|
510
|
-
/** Check if a field type is registered. */
|
|
511
|
-
hasField(type: string): boolean;
|
|
512
|
-
/** Check if an action is registered. */
|
|
513
|
-
hasAction(name: string): boolean;
|
|
514
|
-
/** Validate a value against a field type's Zod schema. */
|
|
515
|
-
validate(type: string, value: unknown): z.ZodSafeParseResult<unknown>;
|
|
516
|
-
/** Resolve a JSON Schema property + optional UI hint to a field type name. */
|
|
517
|
-
resolveType(property: JsonSchemaProperty, hint?: ConfigUiHint): string;
|
|
518
|
-
/** Generate an AI system prompt describing the catalog's capabilities. */
|
|
519
|
-
prompt(): string;
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
/**
|
|
523
|
-
* Catalog configuration.
|
|
524
|
-
*/
|
|
525
|
-
export interface CatalogConfig<
|
|
526
|
-
TFields extends Record<string, FieldDefinition> = Record<
|
|
527
|
-
string,
|
|
528
|
-
FieldDefinition
|
|
529
|
-
>,
|
|
530
|
-
TActions extends Record<string, ActionDefinition> = Record<
|
|
531
|
-
string,
|
|
532
|
-
ActionDefinition
|
|
533
|
-
>,
|
|
534
|
-
> {
|
|
535
|
-
/** Field type definitions. */
|
|
536
|
-
fields: TFields;
|
|
537
|
-
/** Action definitions. */
|
|
538
|
-
actions?: TActions;
|
|
539
|
-
/** Custom validation functions. */
|
|
540
|
-
functions?: Record<string, ValidationFunction>;
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
/**
|
|
544
|
-
* Create a type-safe field catalog.
|
|
545
|
-
*
|
|
546
|
-
* Equivalent to json-render's `defineCatalog(schema, config)`.
|
|
547
|
-
* Supports fields, actions, custom validation functions, and prompt generation.
|
|
548
|
-
*/
|
|
549
|
-
export function defineCatalog<
|
|
550
|
-
TFields extends Record<string, FieldDefinition>,
|
|
551
|
-
TActions extends Record<string, ActionDefinition> = Record<
|
|
552
|
-
string,
|
|
553
|
-
ActionDefinition
|
|
554
|
-
>,
|
|
555
|
-
>(
|
|
556
|
-
fieldsOrConfig: TFields | CatalogConfig<TFields, TActions>,
|
|
557
|
-
): FieldCatalog<TFields, TActions> {
|
|
558
|
-
// Support both old (fields-only) and new (full config) signatures.
|
|
559
|
-
// Old format: { text: { validator, ... }, ... } — values have "validator".
|
|
560
|
-
// New format: { fields: { text: { ... } }, actions?: { ... } } — top-level "fields" key.
|
|
561
|
-
const firstVal = Object.values(fieldsOrConfig)[0];
|
|
562
|
-
const isPlainFields =
|
|
563
|
-
firstVal &&
|
|
564
|
-
typeof firstVal === "object" &&
|
|
565
|
-
"validator" in (firstVal as Record<string, unknown>);
|
|
566
|
-
const config: CatalogConfig<TFields, TActions> = isPlainFields
|
|
567
|
-
? { fields: fieldsOrConfig as TFields, actions: {} as TActions }
|
|
568
|
-
: (fieldsOrConfig as CatalogConfig<TFields, TActions>);
|
|
569
|
-
|
|
570
|
-
const fields = config.fields;
|
|
571
|
-
const actions = config.actions ?? ({} as TActions);
|
|
572
|
-
const functions = config.functions ?? {};
|
|
573
|
-
const fieldNames = Object.keys(fields);
|
|
574
|
-
const actionNames = Object.keys(actions);
|
|
575
|
-
|
|
576
|
-
return {
|
|
577
|
-
fields,
|
|
578
|
-
fieldNames,
|
|
579
|
-
actions,
|
|
580
|
-
actionNames,
|
|
581
|
-
functions,
|
|
582
|
-
|
|
583
|
-
hasField(type: string): boolean {
|
|
584
|
-
return type in fields;
|
|
585
|
-
},
|
|
586
|
-
|
|
587
|
-
hasAction(name: string): boolean {
|
|
588
|
-
return name in actions;
|
|
589
|
-
},
|
|
590
|
-
|
|
591
|
-
validate(type: string, value: unknown) {
|
|
592
|
-
const def = fields[type];
|
|
593
|
-
if (!def)
|
|
594
|
-
return {
|
|
595
|
-
success: false,
|
|
596
|
-
error: new z.ZodError([
|
|
597
|
-
{
|
|
598
|
-
code: "custom",
|
|
599
|
-
message: `Unknown field type: ${type}`,
|
|
600
|
-
path: [],
|
|
601
|
-
},
|
|
602
|
-
]),
|
|
603
|
-
} as z.ZodSafeParseResult<unknown>;
|
|
604
|
-
return def.validator.safeParse(value);
|
|
605
|
-
},
|
|
606
|
-
|
|
607
|
-
resolveType(property: JsonSchemaProperty, hint?: ConfigUiHint): string {
|
|
608
|
-
return resolveFieldType(property, hint, fieldNames);
|
|
609
|
-
},
|
|
610
|
-
|
|
611
|
-
prompt(): string {
|
|
612
|
-
return generateCatalogPrompt(fields, actions, functions);
|
|
613
|
-
},
|
|
614
|
-
};
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
// ── Prompt generation (≈ json-render catalog.prompt()) ──────────────────
|
|
618
|
-
|
|
619
|
-
function generateCatalogPrompt(
|
|
620
|
-
fields: Record<string, FieldDefinition>,
|
|
621
|
-
actions: Record<string, ActionDefinition>,
|
|
622
|
-
functions: Record<string, ValidationFunction>,
|
|
623
|
-
): string {
|
|
624
|
-
const lines: string[] = [];
|
|
625
|
-
|
|
626
|
-
lines.push("# Plugin Configuration UI Catalog");
|
|
627
|
-
lines.push("");
|
|
628
|
-
lines.push(
|
|
629
|
-
"You are generating a plugin configuration form. Below are the available field types, actions, and validation functions.",
|
|
630
|
-
);
|
|
631
|
-
lines.push("");
|
|
632
|
-
|
|
633
|
-
// Field types
|
|
634
|
-
lines.push("## Field Types");
|
|
635
|
-
lines.push("");
|
|
636
|
-
for (const [name, def] of Object.entries(fields)) {
|
|
637
|
-
lines.push(`- **${name}**: ${def.description}`);
|
|
638
|
-
}
|
|
639
|
-
lines.push("");
|
|
640
|
-
|
|
641
|
-
// Actions
|
|
642
|
-
if (Object.keys(actions).length > 0) {
|
|
643
|
-
lines.push("## Actions");
|
|
644
|
-
lines.push("");
|
|
645
|
-
for (const [name, def] of Object.entries(actions)) {
|
|
646
|
-
lines.push(`- **${name}**: ${def.description ?? "No description"}`);
|
|
647
|
-
}
|
|
648
|
-
lines.push("");
|
|
649
|
-
}
|
|
650
|
-
|
|
651
|
-
// Validation functions
|
|
652
|
-
const allFunctions = { ...builtInValidators, ...functions };
|
|
653
|
-
lines.push("## Validation Functions");
|
|
654
|
-
lines.push("");
|
|
655
|
-
lines.push(`Built-in: ${Object.keys(allFunctions).join(", ")}`);
|
|
656
|
-
lines.push("");
|
|
657
|
-
|
|
658
|
-
// Schema format
|
|
659
|
-
lines.push("## Schema Format");
|
|
660
|
-
lines.push("");
|
|
661
|
-
lines.push(
|
|
662
|
-
"Each field is described by a JSON Schema property + ConfigUiHint:",
|
|
663
|
-
);
|
|
664
|
-
lines.push("```json");
|
|
665
|
-
lines.push(
|
|
666
|
-
JSON.stringify(
|
|
667
|
-
{
|
|
668
|
-
FIELD_NAME: {
|
|
669
|
-
schema: { type: "string", description: "..." },
|
|
670
|
-
hint: {
|
|
671
|
-
type: "text",
|
|
672
|
-
label: "...",
|
|
673
|
-
help: "...",
|
|
674
|
-
group: "...",
|
|
675
|
-
validation: { checks: [{ fn: "required", message: "..." }] },
|
|
676
|
-
},
|
|
677
|
-
},
|
|
678
|
-
},
|
|
679
|
-
null,
|
|
680
|
-
2,
|
|
681
|
-
),
|
|
682
|
-
);
|
|
683
|
-
lines.push("```");
|
|
684
|
-
lines.push("");
|
|
685
|
-
|
|
686
|
-
// Visibility
|
|
687
|
-
lines.push("## Visibility Conditions");
|
|
688
|
-
lines.push("");
|
|
689
|
-
lines.push("Fields support `visible` conditions using LogicExpression:");
|
|
690
|
-
lines.push('- `{ path: "FIELD_NAME" }` — truthy check');
|
|
691
|
-
lines.push('- `{ eq: [{ path: "FIELD" }, "value"] }` — equality');
|
|
692
|
-
lines.push(
|
|
693
|
-
"- `{ and: [...] }`, `{ or: [...] }`, `{ not: {...} }` — logical operators",
|
|
694
|
-
);
|
|
695
|
-
lines.push("- `{ gt, gte, lt, lte }` — numeric comparisons");
|
|
696
|
-
|
|
697
|
-
return lines.join("\n");
|
|
698
|
-
}
|
|
699
|
-
|
|
700
|
-
// ── Render props (≈ json-render ComponentRenderProps) ──────────────────
|
|
701
|
-
|
|
702
|
-
/**
|
|
703
|
-
* Props passed to every field renderer function.
|
|
704
|
-
*
|
|
705
|
-
* Plugin authors implementing custom renderers receive this interface
|
|
706
|
-
* as the single argument to their render function.
|
|
707
|
-
*
|
|
708
|
-
* @example
|
|
709
|
-
* ```tsx
|
|
710
|
-
* const MyCustomField: FieldRenderer = (props: FieldRenderProps) => (
|
|
711
|
-
* <input
|
|
712
|
-
* value={String(props.value ?? "")}
|
|
713
|
-
* onChange={(e) => props.onChange(e.target.value)}
|
|
714
|
-
* placeholder={props.hint.placeholder}
|
|
715
|
-
* disabled={props.readonly}
|
|
716
|
-
* />
|
|
717
|
-
* );
|
|
718
|
-
* ```
|
|
719
|
-
*/
|
|
720
|
-
export interface FieldRenderProps {
|
|
721
|
-
/** Config key identifier (e.g., "OPENAI_API_KEY"). */
|
|
722
|
-
key: string;
|
|
723
|
-
/** Current field value, may be any JSON-compatible type. */
|
|
724
|
-
value: unknown;
|
|
725
|
-
/** JSON Schema property definition for this field. */
|
|
726
|
-
schema: JsonSchemaProperty;
|
|
727
|
-
/** UI rendering hints from the plugin manifest. */
|
|
728
|
-
hint: ConfigUiHint;
|
|
729
|
-
/** Resolved field type name from the catalog (e.g., "text", "select"). */
|
|
730
|
-
fieldType: string;
|
|
731
|
-
/** Callback to update the field value. */
|
|
732
|
-
onChange: (value: unknown) => void;
|
|
733
|
-
/** Whether the field currently has a configured value. */
|
|
734
|
-
isSet: boolean;
|
|
735
|
-
/** Whether the field is required by the schema. */
|
|
736
|
-
required: boolean;
|
|
737
|
-
/** Validation error messages for this field. */
|
|
738
|
-
errors?: string[];
|
|
739
|
-
/** Whether the field should be non-editable. */
|
|
740
|
-
readonly?: boolean;
|
|
741
|
-
/** For sensitive fields — async callback to fetch the real value from the server. */
|
|
742
|
-
onReveal?: () => Promise<string | null>;
|
|
743
|
-
/** Dispatch a named action with optional parameters. */
|
|
744
|
-
onAction?: (
|
|
745
|
-
action: string,
|
|
746
|
-
params?: Record<string, unknown>,
|
|
747
|
-
) => Promise<unknown>;
|
|
748
|
-
}
|
|
749
|
-
|
|
750
|
-
/** A render function that returns a React node for a given field type. */
|
|
751
|
-
export type FieldRenderer = (props: FieldRenderProps) => ReactNode;
|
|
752
|
-
|
|
753
|
-
// ── Registry (≈ json-render ComponentRegistry + defineRegistry) ────────
|
|
754
|
-
|
|
755
|
-
export interface FieldRegistry<
|
|
756
|
-
TFields extends Record<string, FieldDefinition> = Record<
|
|
757
|
-
string,
|
|
758
|
-
FieldDefinition
|
|
759
|
-
>,
|
|
760
|
-
TActions extends Record<string, ActionDefinition> = Record<
|
|
761
|
-
string,
|
|
762
|
-
ActionDefinition
|
|
763
|
-
>,
|
|
764
|
-
> {
|
|
765
|
-
readonly catalog: FieldCatalog<TFields, TActions>;
|
|
766
|
-
readonly renderers: Record<string, FieldRenderer>;
|
|
767
|
-
readonly actionHandlers: Record<string, ActionHandler>;
|
|
768
|
-
/** Look up the renderer for a field type. Returns undefined if not registered. */
|
|
769
|
-
resolve(type: string): FieldRenderer | undefined;
|
|
770
|
-
/** Like resolve(), but falls back to the "text" renderer. */
|
|
771
|
-
resolveOrFallback(type: string): FieldRenderer;
|
|
772
|
-
/** Look up the handler for an action. */
|
|
773
|
-
resolveAction(name: string): ActionHandler | undefined;
|
|
774
|
-
}
|
|
775
|
-
|
|
776
|
-
/**
|
|
777
|
-
* Create a field registry that maps catalog field types to render functions.
|
|
778
|
-
*
|
|
779
|
-
* Equivalent to json-render's `defineRegistry(catalog, { components, actions })`.
|
|
780
|
-
*/
|
|
781
|
-
export function defineRegistry<
|
|
782
|
-
TFields extends Record<string, FieldDefinition>,
|
|
783
|
-
TActions extends Record<string, ActionDefinition> = Record<
|
|
784
|
-
string,
|
|
785
|
-
ActionDefinition
|
|
786
|
-
>,
|
|
787
|
-
>(
|
|
788
|
-
catalog: FieldCatalog<TFields, TActions>,
|
|
789
|
-
renderers: Partial<Record<keyof TFields & string, FieldRenderer>>,
|
|
790
|
-
actionHandlers?: Partial<Record<keyof TActions & string, ActionHandler>>,
|
|
791
|
-
): FieldRegistry<TFields, TActions> {
|
|
792
|
-
const rendererMap = renderers as Record<string, FieldRenderer>;
|
|
793
|
-
const handlerMap = (actionHandlers ?? {}) as Record<string, ActionHandler>;
|
|
794
|
-
|
|
795
|
-
return {
|
|
796
|
-
catalog,
|
|
797
|
-
renderers: rendererMap,
|
|
798
|
-
actionHandlers: handlerMap,
|
|
799
|
-
|
|
800
|
-
resolve(type: string): FieldRenderer | undefined {
|
|
801
|
-
return rendererMap[type];
|
|
802
|
-
},
|
|
803
|
-
|
|
804
|
-
resolveOrFallback(type: string): FieldRenderer {
|
|
805
|
-
return rendererMap[type] ?? rendererMap.text;
|
|
806
|
-
},
|
|
807
|
-
|
|
808
|
-
resolveAction(name: string): ActionHandler | undefined {
|
|
809
|
-
return handlerMap[name];
|
|
810
|
-
},
|
|
811
|
-
};
|
|
812
|
-
}
|
|
813
|
-
|
|
814
|
-
// ── Field type resolution ──────────────────────────────────────────────
|
|
815
|
-
|
|
816
|
-
/**
|
|
817
|
-
* Resolve a JSON Schema property + ConfigUiHint to a field type name.
|
|
818
|
-
*
|
|
819
|
-
* Priority order:
|
|
820
|
-
* 1. Explicit hint.type override (if it's a known type)
|
|
821
|
-
* 2. hint.sensitive → "password"
|
|
822
|
-
* 3. Schema enum/options → "select"
|
|
823
|
-
* 4. Schema type + format heuristics
|
|
824
|
-
* 5. Fallback → "text"
|
|
825
|
-
*/
|
|
826
|
-
function resolveFieldType(
|
|
827
|
-
property: JsonSchemaProperty,
|
|
828
|
-
hint: ConfigUiHint | undefined,
|
|
829
|
-
knownTypes: string[],
|
|
830
|
-
): string {
|
|
831
|
-
const knownSet = new Set(knownTypes);
|
|
832
|
-
|
|
833
|
-
// 1. Explicit type override from hint
|
|
834
|
-
const hintType = (hint as Record<string, unknown> | undefined)?.type as
|
|
835
|
-
| string
|
|
836
|
-
| undefined;
|
|
837
|
-
if (hintType && knownSet.has(hintType)) return hintType;
|
|
838
|
-
|
|
839
|
-
// 2. Sensitive → password
|
|
840
|
-
if (hint?.sensitive) return knownSet.has("password") ? "password" : "text";
|
|
841
|
-
|
|
842
|
-
// 3. Enum → select
|
|
843
|
-
if (property.enum?.length || property.oneOf?.length) {
|
|
844
|
-
return knownSet.has("select") ? "select" : "text";
|
|
845
|
-
}
|
|
846
|
-
|
|
847
|
-
// 4. Schema type + format
|
|
848
|
-
const schemaType = Array.isArray(property.type)
|
|
849
|
-
? property.type[0]
|
|
850
|
-
: property.type;
|
|
851
|
-
|
|
852
|
-
switch (schemaType) {
|
|
853
|
-
case "boolean":
|
|
854
|
-
return knownSet.has("boolean") ? "boolean" : "text";
|
|
855
|
-
case "number":
|
|
856
|
-
case "integer":
|
|
857
|
-
return knownSet.has("number") ? "number" : "text";
|
|
858
|
-
case "array":
|
|
859
|
-
if (property.items?.enum && knownSet.has("multiselect"))
|
|
860
|
-
return "multiselect";
|
|
861
|
-
return knownSet.has("array") ? "array" : "text";
|
|
862
|
-
case "object":
|
|
863
|
-
if (property.additionalProperties && knownSet.has("keyvalue"))
|
|
864
|
-
return "keyvalue";
|
|
865
|
-
return knownSet.has("json") ? "json" : "text";
|
|
866
|
-
default:
|
|
867
|
-
break;
|
|
868
|
-
}
|
|
869
|
-
|
|
870
|
-
// String format heuristics
|
|
871
|
-
if (schemaType === "string" || !schemaType) {
|
|
872
|
-
const fmt = property.format;
|
|
873
|
-
if (fmt === "uri" || fmt === "url")
|
|
874
|
-
return knownSet.has("url") ? "url" : "text";
|
|
875
|
-
if (fmt === "email") return knownSet.has("email") ? "email" : "text";
|
|
876
|
-
if (fmt === "date-time")
|
|
877
|
-
return knownSet.has("datetime")
|
|
878
|
-
? "datetime"
|
|
879
|
-
: knownSet.has("date")
|
|
880
|
-
? "date"
|
|
881
|
-
: "text";
|
|
882
|
-
if (fmt === "date") return knownSet.has("date") ? "date" : "text";
|
|
883
|
-
if (fmt === "color") return knownSet.has("color") ? "color" : "text";
|
|
884
|
-
|
|
885
|
-
// Multiline heuristic: maxLength > 200 or no maxLength with "text" hint
|
|
886
|
-
if (property.maxLength && property.maxLength > 200) {
|
|
887
|
-
return knownSet.has("textarea") ? "textarea" : "text";
|
|
888
|
-
}
|
|
889
|
-
}
|
|
890
|
-
|
|
891
|
-
// 5. Fallback
|
|
892
|
-
return "text";
|
|
893
|
-
}
|
|
894
|
-
|
|
895
|
-
// ── Default catalog ────────────────────────────────────────────────────
|
|
896
|
-
|
|
897
|
-
/**
|
|
898
|
-
* The standard field catalog with 23 basic field types + built-in actions.
|
|
899
|
-
*/
|
|
900
|
-
export const defaultCatalog = defineCatalog({
|
|
901
|
-
fields: {
|
|
902
|
-
text: {
|
|
903
|
-
validator: z.string(),
|
|
904
|
-
description: "Single-line text input",
|
|
905
|
-
},
|
|
906
|
-
password: {
|
|
907
|
-
validator: z.string(),
|
|
908
|
-
description: "Masked input with show/hide toggle and API-backed reveal",
|
|
909
|
-
},
|
|
910
|
-
number: {
|
|
911
|
-
validator: z.coerce.number(),
|
|
912
|
-
description: "Numeric input with optional min/max/step",
|
|
913
|
-
},
|
|
914
|
-
boolean: {
|
|
915
|
-
validator: z.coerce.boolean(),
|
|
916
|
-
description: "Toggle switch (on/off)",
|
|
917
|
-
},
|
|
918
|
-
url: {
|
|
919
|
-
validator: z.string(),
|
|
920
|
-
description: "URL input with validation",
|
|
921
|
-
},
|
|
922
|
-
select: {
|
|
923
|
-
validator: z.string(),
|
|
924
|
-
description: "Single-select dropdown from enum values",
|
|
925
|
-
},
|
|
926
|
-
textarea: {
|
|
927
|
-
validator: z.string(),
|
|
928
|
-
description: "Multi-line text input for long values",
|
|
929
|
-
},
|
|
930
|
-
email: {
|
|
931
|
-
validator: z.string().email().or(z.literal("")),
|
|
932
|
-
description: "Email address input with validation",
|
|
933
|
-
},
|
|
934
|
-
color: {
|
|
935
|
-
validator: z
|
|
936
|
-
.string()
|
|
937
|
-
.regex(/^#[0-9a-fA-F]{3,8}$/)
|
|
938
|
-
.or(z.literal("")),
|
|
939
|
-
description: "Color picker with hex value display",
|
|
940
|
-
},
|
|
941
|
-
radio: {
|
|
942
|
-
validator: z.string(),
|
|
943
|
-
description: "Single-select radio button group with descriptions",
|
|
944
|
-
},
|
|
945
|
-
multiselect: {
|
|
946
|
-
validator: z.array(z.string()).or(z.string()),
|
|
947
|
-
description: "Multi-select checkbox group for array values",
|
|
948
|
-
},
|
|
949
|
-
date: {
|
|
950
|
-
validator: z.string(),
|
|
951
|
-
description: "Date or date-time input",
|
|
952
|
-
},
|
|
953
|
-
json: {
|
|
954
|
-
validator: z.string(),
|
|
955
|
-
description: "JSON editor with syntax highlighting and validation",
|
|
956
|
-
},
|
|
957
|
-
code: {
|
|
958
|
-
validator: z.string(),
|
|
959
|
-
description: "Code editor with syntax highlighting",
|
|
960
|
-
},
|
|
961
|
-
array: {
|
|
962
|
-
validator: z.array(z.unknown()),
|
|
963
|
-
description: "Repeatable field group with add/remove items",
|
|
964
|
-
},
|
|
965
|
-
keyvalue: {
|
|
966
|
-
validator: z.record(z.string(), z.string()),
|
|
967
|
-
description: "Key-value pair editor with add/remove rows",
|
|
968
|
-
},
|
|
969
|
-
datetime: {
|
|
970
|
-
validator: z.string(),
|
|
971
|
-
description: "Date and time picker input",
|
|
972
|
-
},
|
|
973
|
-
file: {
|
|
974
|
-
validator: z.string(),
|
|
975
|
-
description: "File path or upload input",
|
|
976
|
-
},
|
|
977
|
-
custom: {
|
|
978
|
-
validator: z.unknown(),
|
|
979
|
-
description: "Plugin-provided custom React component",
|
|
980
|
-
},
|
|
981
|
-
markdown: {
|
|
982
|
-
validator: z.string(),
|
|
983
|
-
description: "Markdown editor with preview toggle",
|
|
984
|
-
},
|
|
985
|
-
"checkbox-group": {
|
|
986
|
-
validator: z.array(z.string()).or(z.string()),
|
|
987
|
-
description: "Checkbox group for multiple selections with descriptions",
|
|
988
|
-
},
|
|
989
|
-
group: {
|
|
990
|
-
validator: z.record(z.string(), z.unknown()).or(z.string()),
|
|
991
|
-
description: "Fieldset container for grouping related configuration",
|
|
992
|
-
},
|
|
993
|
-
table: {
|
|
994
|
-
validator: z.array(z.record(z.string(), z.string())).or(z.string()),
|
|
995
|
-
description: "Tabular data editor with add/remove rows",
|
|
996
|
-
},
|
|
997
|
-
},
|
|
998
|
-
actions: {
|
|
999
|
-
save: {
|
|
1000
|
-
params: z.object({}),
|
|
1001
|
-
description: "Save the current configuration",
|
|
1002
|
-
},
|
|
1003
|
-
reset: {
|
|
1004
|
-
params: z.object({}),
|
|
1005
|
-
description: "Reset all fields to their defaults",
|
|
1006
|
-
},
|
|
1007
|
-
testConnection: {
|
|
1008
|
-
params: z.object({ key: z.string().optional() }),
|
|
1009
|
-
description: "Test the connection/API key validity",
|
|
1010
|
-
},
|
|
1011
|
-
},
|
|
1012
|
-
});
|
|
1013
|
-
|
|
1014
|
-
// ── Schema traversal helpers ───────────────────────────────────────────
|
|
1015
|
-
|
|
1016
|
-
export interface ResolvedField {
|
|
1017
|
-
key: string;
|
|
1018
|
-
schema: JsonSchemaProperty;
|
|
1019
|
-
hint: ConfigUiHint;
|
|
1020
|
-
fieldType: string;
|
|
1021
|
-
required: boolean;
|
|
1022
|
-
group: string;
|
|
1023
|
-
order: number;
|
|
1024
|
-
advanced: boolean;
|
|
1025
|
-
hidden: boolean;
|
|
1026
|
-
width: "full" | "half" | "third";
|
|
1027
|
-
showIf?: ShowIfCondition;
|
|
1028
|
-
visible?: VisibilityCondition;
|
|
1029
|
-
validation?: ValidationConfig;
|
|
1030
|
-
readonly: boolean;
|
|
1031
|
-
}
|
|
1032
|
-
|
|
1033
|
-
/**
|
|
1034
|
-
* Walk a JSON Schema object's properties and resolve each to a field descriptor.
|
|
1035
|
-
*
|
|
1036
|
-
* This is the equivalent of json-render's spec traversal — it turns a declarative
|
|
1037
|
-
* schema into an ordered list of renderable field descriptors.
|
|
1038
|
-
*/
|
|
1039
|
-
export function resolveFields(
|
|
1040
|
-
schema: JsonSchemaObject | JsonSchemaProperty,
|
|
1041
|
-
hints: Record<string, ConfigUiHint>,
|
|
1042
|
-
catalog: FieldCatalog,
|
|
1043
|
-
): ResolvedField[] {
|
|
1044
|
-
const properties = schema.properties ?? {};
|
|
1045
|
-
const requiredKeys = new Set(schema.required ?? []);
|
|
1046
|
-
const fields: ResolvedField[] = [];
|
|
1047
|
-
|
|
1048
|
-
// Field types that are compact enough for half-width columns
|
|
1049
|
-
const HALF_WIDTH_TYPES = new Set([
|
|
1050
|
-
"text",
|
|
1051
|
-
"password",
|
|
1052
|
-
"number",
|
|
1053
|
-
"url",
|
|
1054
|
-
"email",
|
|
1055
|
-
"boolean",
|
|
1056
|
-
"select",
|
|
1057
|
-
"date",
|
|
1058
|
-
"datetime",
|
|
1059
|
-
"color",
|
|
1060
|
-
"file",
|
|
1061
|
-
]);
|
|
1062
|
-
|
|
1063
|
-
for (const [key, prop] of Object.entries(properties)) {
|
|
1064
|
-
const hint = hints[key] ?? {};
|
|
1065
|
-
const fieldType = catalog.resolveType(prop, hint);
|
|
1066
|
-
fields.push({
|
|
1067
|
-
key,
|
|
1068
|
-
schema: prop,
|
|
1069
|
-
hint,
|
|
1070
|
-
fieldType,
|
|
1071
|
-
required: requiredKeys.has(key),
|
|
1072
|
-
group: hint.group ?? "general",
|
|
1073
|
-
order: hint.order ?? 999,
|
|
1074
|
-
advanced: hint.advanced ?? false,
|
|
1075
|
-
hidden: hint.hidden ?? false,
|
|
1076
|
-
width: hint.width ?? (HALF_WIDTH_TYPES.has(fieldType) ? "half" : "full"),
|
|
1077
|
-
showIf: hint.showIf,
|
|
1078
|
-
visible: hint.visible,
|
|
1079
|
-
validation: hint.validation,
|
|
1080
|
-
readonly: hint.readonly ?? false,
|
|
1081
|
-
});
|
|
1082
|
-
}
|
|
1083
|
-
|
|
1084
|
-
// Sort: non-advanced before advanced, then by order, then alphabetically
|
|
1085
|
-
fields.sort((a, b) => {
|
|
1086
|
-
if (a.advanced !== b.advanced) return a.advanced ? 1 : -1;
|
|
1087
|
-
if (a.order !== b.order) return a.order - b.order;
|
|
1088
|
-
return a.key.localeCompare(b.key);
|
|
1089
|
-
});
|
|
1090
|
-
|
|
1091
|
-
return fields;
|
|
1092
|
-
}
|