@lincyaw/aegis-ui 0.9.4 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/ask/AskOverlay.cjs +3 -1
- package/dist/agent/ask/AskOverlay.cjs.map +1 -1
- package/dist/agent/ask/AskOverlay.d.ts +17 -1
- package/dist/agent/ask/AskOverlay.js +115 -58
- package/dist/agent/ask/AskOverlay.js.map +1 -1
- package/dist/agent/ask/AskPanel.cjs +1 -1
- package/dist/agent/ask/AskPanel.cjs.map +1 -1
- package/dist/agent/ask/AskPanel.d.ts +18 -3
- package/dist/agent/ask/AskPanel.js +147 -119
- package/dist/agent/ask/AskPanel.js.map +1 -1
- package/dist/agent/chat/chat.cjs +1 -1
- package/dist/agent/chat/chat.cjs.map +1 -1
- package/dist/agent/chat/chat.d.ts +1 -1
- package/dist/agent/chat/chat.js +3 -5
- package/dist/agent/chat/chat.js.map +1 -1
- package/dist/agent/chat/useAgentChat.cjs +1 -1
- package/dist/agent/chat/useAgentChat.cjs.map +1 -1
- package/dist/agent/chat/useAgentChat.d.ts +2 -0
- package/dist/agent/chat/useAgentChat.js +8 -4
- package/dist/agent/chat/useAgentChat.js.map +1 -1
- package/dist/agent/core/AegisRuntimeProvider.cjs.map +1 -1
- package/dist/agent/core/AegisRuntimeProvider.d.ts +2 -2
- package/dist/agent/core/AegisRuntimeProvider.js.map +1 -1
- package/dist/agent/core/hooks.cjs +1 -1
- package/dist/agent/core/hooks.cjs.map +1 -1
- package/dist/agent/core/hooks.js +21 -20
- package/dist/agent/core/hooks.js.map +1 -1
- package/dist/agent/core/runtime.cjs +1 -1
- package/dist/agent/core/runtime.cjs.map +1 -1
- package/dist/agent/core/runtime.d.ts +28 -9
- package/dist/agent/core/runtime.js +435 -268
- package/dist/agent/core/runtime.js.map +1 -1
- package/dist/agent/core/types.d.ts +65 -10
- package/dist/agent/index.d.ts +4 -3
- package/dist/commands/CommandProvider.cjs +1 -1
- package/dist/commands/CommandProvider.cjs.map +1 -1
- package/dist/commands/CommandProvider.js +33 -37
- package/dist/commands/CommandProvider.js.map +1 -1
- package/dist/commands/commandContext.cjs +1 -1
- package/dist/commands/commandContext.cjs.map +1 -1
- package/dist/commands/commandContext.d.ts +6 -6
- package/dist/commands/commandContext.js +3 -17
- package/dist/commands/commandContext.js.map +1 -1
- package/dist/commands/index.d.ts +1 -1
- package/dist/commands/useCommands.cjs +1 -1
- package/dist/commands/useCommands.cjs.map +1 -1
- package/dist/commands/useCommands.d.ts +4 -2
- package/dist/commands/useCommands.js +21 -5
- package/dist/commands/useCommands.js.map +1 -1
- package/dist/commands/useRegisterCommands.cjs +2 -1
- package/dist/commands/useRegisterCommands.cjs.map +1 -1
- package/dist/commands/useRegisterCommands.d.ts +3 -2
- package/dist/commands/useRegisterCommands.js +35 -8
- package/dist/commands/useRegisterCommands.js.map +1 -1
- package/dist/components/ui/AgentPanel.cjs +1 -1
- package/dist/components/ui/AgentPanel.cjs.map +1 -1
- package/dist/components/ui/AgentPanel.js +15 -14
- package/dist/components/ui/AgentPanel.js.map +1 -1
- package/dist/components/ui/Alert.cjs +1 -1
- package/dist/components/ui/Alert.cjs.map +1 -1
- package/dist/components/ui/Alert.js +11 -11
- package/dist/components/ui/Alert.js.map +1 -1
- package/dist/components/ui/Avatar.cjs +1 -1
- package/dist/components/ui/Avatar.cjs.map +1 -1
- package/dist/components/ui/Avatar.js +21 -19
- package/dist/components/ui/Avatar.js.map +1 -1
- package/dist/components/ui/BlastRadiusBar.cjs +1 -1
- package/dist/components/ui/BlastRadiusBar.cjs.map +1 -1
- package/dist/components/ui/BlastRadiusBar.d.ts +16 -2
- package/dist/components/ui/BlastRadiusBar.js +27 -20
- package/dist/components/ui/BlastRadiusBar.js.map +1 -1
- package/dist/components/ui/Button.cjs.map +1 -1
- package/dist/components/ui/Button.d.ts +1 -1
- package/dist/components/ui/Button.js.map +1 -1
- package/dist/components/ui/ChatComposer.cjs +1 -1
- package/dist/components/ui/ChatComposer.cjs.map +1 -1
- package/dist/components/ui/ChatComposer.js +30 -29
- package/dist/components/ui/ChatComposer.js.map +1 -1
- package/dist/components/ui/ChatSessionList.cjs +1 -1
- package/dist/components/ui/ChatSessionList.cjs.map +1 -1
- package/dist/components/ui/ChatSessionList.js +136 -157
- package/dist/components/ui/ChatSessionList.js.map +1 -1
- package/dist/components/ui/Checkbox.cjs +1 -1
- package/dist/components/ui/Checkbox.cjs.map +1 -1
- package/dist/components/ui/Checkbox.d.ts +7 -1
- package/dist/components/ui/Checkbox.js +26 -20
- package/dist/components/ui/Checkbox.js.map +1 -1
- package/dist/components/ui/Chip.cjs +1 -1
- package/dist/components/ui/Chip.cjs.map +1 -1
- package/dist/components/ui/Chip.d.ts +6 -1
- package/dist/components/ui/Chip.js +20 -18
- package/dist/components/ui/Chip.js.map +1 -1
- package/dist/components/ui/ChoiceCardGroup.cjs +2 -0
- package/dist/components/ui/ChoiceCardGroup.cjs.map +1 -0
- package/dist/components/ui/ChoiceCardGroup.d.ts +34 -0
- package/dist/components/ui/ChoiceCardGroup.js +56 -0
- package/dist/components/ui/ChoiceCardGroup.js.map +1 -0
- package/dist/components/ui/CodeBlock.cjs +2 -2
- package/dist/components/ui/CodeBlock.cjs.map +1 -1
- package/dist/components/ui/CodeBlock.js +31 -27
- package/dist/components/ui/CodeBlock.js.map +1 -1
- package/dist/components/ui/CodeEditor.cjs +1 -1
- package/dist/components/ui/CodeEditor.cjs.map +1 -1
- package/dist/components/ui/CodeEditor.d.ts +15 -4
- package/dist/components/ui/CodeEditor.js +243 -70
- package/dist/components/ui/CodeEditor.js.map +1 -1
- package/dist/components/ui/Collapse.cjs +1 -1
- package/dist/components/ui/Collapse.cjs.map +1 -1
- package/dist/components/ui/Collapse.js +23 -23
- package/dist/components/ui/Collapse.js.map +1 -1
- package/dist/components/ui/ColumnChart.cjs +1 -1
- package/dist/components/ui/ColumnChart.cjs.map +1 -1
- package/dist/components/ui/ColumnChart.js +21 -20
- package/dist/components/ui/ColumnChart.js.map +1 -1
- package/dist/components/ui/CommandInvocationCard.cjs +1 -1
- package/dist/components/ui/CommandInvocationCard.cjs.map +1 -1
- package/dist/components/ui/CommandInvocationCard.js +28 -31
- package/dist/components/ui/CommandInvocationCard.js.map +1 -1
- package/dist/components/ui/CommandPalette.cjs +1 -1
- package/dist/components/ui/CommandPalette.cjs.map +1 -1
- package/dist/components/ui/CommandPalette.d.ts +23 -1
- package/dist/components/ui/CommandPalette.js +146 -121
- package/dist/components/ui/CommandPalette.js.map +1 -1
- package/dist/components/ui/CommitGraph.cjs +2 -0
- package/dist/components/ui/CommitGraph.cjs.map +1 -0
- package/dist/components/ui/CommitGraph.d.ts +79 -0
- package/dist/components/ui/CommitGraph.js +383 -0
- package/dist/components/ui/CommitGraph.js.map +1 -0
- package/dist/components/ui/ContentInspectorDialog.cjs +1 -3
- package/dist/components/ui/ContentInspectorDialog.cjs.map +1 -1
- package/dist/components/ui/ContentInspectorDialog.d.ts +4 -10
- package/dist/components/ui/ContentInspectorDialog.js +42 -201
- package/dist/components/ui/ContentInspectorDialog.js.map +1 -1
- package/dist/components/ui/ContentPreview.cjs +3 -0
- package/dist/components/ui/ContentPreview.cjs.map +1 -0
- package/dist/components/ui/ContentPreview.d.ts +13 -0
- package/dist/components/ui/ContentPreview.js +133 -0
- package/dist/components/ui/ContentPreview.js.map +1 -0
- package/dist/components/ui/CopyGlyph.cjs +2 -0
- package/dist/components/ui/CopyGlyph.cjs.map +1 -0
- package/dist/components/ui/CopyGlyph.d.ts +7 -0
- package/dist/components/ui/CopyGlyph.js +48 -0
- package/dist/components/ui/CopyGlyph.js.map +1 -0
- package/dist/components/ui/DangerZone.cjs +1 -1
- package/dist/components/ui/DangerZone.cjs.map +1 -1
- package/dist/components/ui/DangerZone.js +13 -12
- package/dist/components/ui/DangerZone.js.map +1 -1
- package/dist/components/ui/DataList.cjs +1 -1
- package/dist/components/ui/DataList.cjs.map +1 -1
- package/dist/components/ui/DataList.d.ts +7 -1
- package/dist/components/ui/DataList.js +89 -33
- package/dist/components/ui/DataList.js.map +1 -1
- package/dist/components/ui/DataTable.cjs +1 -1
- package/dist/components/ui/DataTable.cjs.map +1 -1
- package/dist/components/ui/DataTable.d.ts +22 -18
- package/dist/components/ui/DataTable.js +279 -341
- package/dist/components/ui/DataTable.js.map +1 -1
- package/dist/components/ui/DropdownMenu.cjs +1 -1
- package/dist/components/ui/DropdownMenu.cjs.map +1 -1
- package/dist/components/ui/DropdownMenu.d.ts +8 -1
- package/dist/components/ui/DropdownMenu.js +63 -46
- package/dist/components/ui/DropdownMenu.js.map +1 -1
- package/dist/components/ui/EnvironmentSwitcher.cjs +1 -1
- package/dist/components/ui/EnvironmentSwitcher.cjs.map +1 -1
- package/dist/components/ui/EnvironmentSwitcher.js +26 -24
- package/dist/components/ui/EnvironmentSwitcher.js.map +1 -1
- package/dist/components/ui/ErrorState.cjs +1 -1
- package/dist/components/ui/ErrorState.cjs.map +1 -1
- package/dist/components/ui/ErrorState.d.ts +1 -0
- package/dist/components/ui/ErrorState.js +1 -1
- package/dist/components/ui/ErrorState.js.map +1 -1
- package/dist/components/ui/EventTable.cjs +1 -1
- package/dist/components/ui/EventTable.cjs.map +1 -1
- package/dist/components/ui/EventTable.d.ts +16 -2
- package/dist/components/ui/EventTable.js +198 -165
- package/dist/components/ui/EventTable.js.map +1 -1
- package/dist/components/ui/FileDropzone.cjs +1 -1
- package/dist/components/ui/FileDropzone.cjs.map +1 -1
- package/dist/components/ui/FileDropzone.d.ts +3 -21
- package/dist/components/ui/FileDropzone.js +42 -67
- package/dist/components/ui/FileDropzone.js.map +1 -1
- package/dist/components/ui/FilePreview.cjs +1 -1
- package/dist/components/ui/FilePreview.cjs.map +1 -1
- package/dist/components/ui/FilePreview.d.ts +4 -1
- package/dist/components/ui/FilePreview.js +62 -60
- package/dist/components/ui/FilePreview.js.map +1 -1
- package/dist/components/ui/FileTree.cjs +1 -1
- package/dist/components/ui/FileTree.cjs.map +1 -1
- package/dist/components/ui/FileTree.d.ts +18 -2
- package/dist/components/ui/FileTree.js +141 -110
- package/dist/components/ui/FileTree.js.map +1 -1
- package/dist/components/ui/FolderDropzone.cjs +1 -1
- package/dist/components/ui/FolderDropzone.cjs.map +1 -1
- package/dist/components/ui/FolderDropzone.d.ts +10 -1
- package/dist/components/ui/FolderDropzone.js +140 -130
- package/dist/components/ui/FolderDropzone.js.map +1 -1
- package/dist/components/ui/ForgotPasswordForm.cjs +1 -1
- package/dist/components/ui/ForgotPasswordForm.cjs.map +1 -1
- package/dist/components/ui/ForgotPasswordForm.d.ts +1 -0
- package/dist/components/ui/ForgotPasswordForm.js +23 -20
- package/dist/components/ui/ForgotPasswordForm.js.map +1 -1
- package/dist/components/ui/FormRow.cjs +1 -1
- package/dist/components/ui/FormRow.cjs.map +1 -1
- package/dist/components/ui/FormRow.d.ts +32 -2
- package/dist/components/ui/FormRow.js +33 -13
- package/dist/components/ui/FormRow.js.map +1 -1
- package/dist/components/ui/HeadlineStat.cjs +1 -1
- package/dist/components/ui/HeadlineStat.cjs.map +1 -1
- package/dist/components/ui/HeadlineStat.js +6 -5
- package/dist/components/ui/HeadlineStat.js.map +1 -1
- package/dist/components/ui/InboxPage.cjs +1 -1
- package/dist/components/ui/InboxPage.cjs.map +1 -1
- package/dist/components/ui/InboxPage.d.ts +25 -2
- package/dist/components/ui/InboxPage.js +93 -77
- package/dist/components/ui/InboxPage.js.map +1 -1
- package/dist/components/ui/KeyValueList.cjs +1 -1
- package/dist/components/ui/KeyValueList.cjs.map +1 -1
- package/dist/components/ui/KeyValueList.d.ts +6 -5
- package/dist/components/ui/KeyValueList.js +14 -17
- package/dist/components/ui/KeyValueList.js.map +1 -1
- package/dist/components/ui/LoginForm.cjs +1 -1
- package/dist/components/ui/LoginForm.cjs.map +1 -1
- package/dist/components/ui/LoginForm.d.ts +1 -0
- package/dist/components/ui/LoginForm.js +63 -55
- package/dist/components/ui/LoginForm.js.map +1 -1
- package/dist/components/ui/Markdown.cjs +1 -1
- package/dist/components/ui/Markdown.cjs.map +1 -1
- package/dist/components/ui/Markdown.d.ts +3 -2
- package/dist/components/ui/Markdown.js +57 -49
- package/dist/components/ui/Markdown.js.map +1 -1
- package/dist/components/ui/MdxDocument.cjs +1 -1
- package/dist/components/ui/MdxDocument.cjs.map +1 -1
- package/dist/components/ui/MdxDocument.d.ts +7 -2
- package/dist/components/ui/MdxDocument.js +34 -49
- package/dist/components/ui/MdxDocument.js.map +1 -1
- package/dist/components/ui/MetadataList.cjs +1 -1
- package/dist/components/ui/MetadataList.cjs.map +1 -1
- package/dist/components/ui/MetadataList.d.ts +7 -1
- package/dist/components/ui/MetadataList.js +29 -20
- package/dist/components/ui/MetadataList.js.map +1 -1
- package/dist/components/ui/MetricCard.cjs +1 -1
- package/dist/components/ui/MetricCard.cjs.map +1 -1
- package/dist/components/ui/MetricCard.js +16 -16
- package/dist/components/ui/MetricCard.js.map +1 -1
- package/dist/components/ui/MonoValue.cjs +1 -1
- package/dist/components/ui/MonoValue.cjs.map +1 -1
- package/dist/components/ui/MonoValue.d.ts +12 -1
- package/dist/components/ui/MonoValue.js +19 -17
- package/dist/components/ui/MonoValue.js.map +1 -1
- package/dist/components/ui/NotificationBell.cjs +1 -1
- package/dist/components/ui/NotificationBell.cjs.map +1 -1
- package/dist/components/ui/NotificationBell.d.ts +31 -3
- package/dist/components/ui/NotificationBell.js +127 -71
- package/dist/components/ui/NotificationBell.js.map +1 -1
- package/dist/components/ui/NumberField.cjs +2 -0
- package/dist/components/ui/NumberField.cjs.map +1 -0
- package/dist/components/ui/NumberField.d.ts +34 -0
- package/dist/components/ui/NumberField.js +80 -0
- package/dist/components/ui/NumberField.js.map +1 -0
- package/dist/components/ui/ObjectBrowser.cjs +1 -1
- package/dist/components/ui/ObjectBrowser.cjs.map +1 -1
- package/dist/components/ui/ObjectBrowser.js +107 -94
- package/dist/components/ui/ObjectBrowser.js.map +1 -1
- package/dist/components/ui/ObjectInspector.cjs +1 -1
- package/dist/components/ui/ObjectInspector.cjs.map +1 -1
- package/dist/components/ui/ObjectInspector.d.ts +5 -0
- package/dist/components/ui/ObjectInspector.js +61 -69
- package/dist/components/ui/ObjectInspector.js.map +1 -1
- package/dist/components/ui/PageSizeSelect.cjs +1 -1
- package/dist/components/ui/PageSizeSelect.cjs.map +1 -1
- package/dist/components/ui/PageSizeSelect.d.ts +3 -4
- package/dist/components/ui/PageSizeSelect.js +30 -29
- package/dist/components/ui/PageSizeSelect.js.map +1 -1
- package/dist/components/ui/Pagination.cjs +1 -1
- package/dist/components/ui/Pagination.cjs.map +1 -1
- package/dist/components/ui/Pagination.d.ts +16 -6
- package/dist/components/ui/Pagination.js +58 -45
- package/dist/components/ui/Pagination.js.map +1 -1
- package/dist/components/ui/Panel.cjs +1 -1
- package/dist/components/ui/Panel.cjs.map +1 -1
- package/dist/components/ui/Panel.d.ts +17 -4
- package/dist/components/ui/Panel.js +53 -40
- package/dist/components/ui/Panel.js.map +1 -1
- package/dist/components/ui/ParquetViewer.cjs +1 -1
- package/dist/components/ui/ParquetViewer.cjs.map +1 -1
- package/dist/components/ui/ParquetViewer.d.ts +1 -1
- package/dist/components/ui/ParquetViewer.js +121 -120
- package/dist/components/ui/ParquetViewer.js.map +1 -1
- package/dist/components/ui/PasswordField.cjs +1 -1
- package/dist/components/ui/PasswordField.cjs.map +1 -1
- package/dist/components/ui/PasswordField.js +28 -27
- package/dist/components/ui/PasswordField.js.map +1 -1
- package/dist/components/ui/PickerField.cjs +1 -1
- package/dist/components/ui/PickerField.cjs.map +1 -1
- package/dist/components/ui/PickerField.d.ts +25 -6
- package/dist/components/ui/PickerField.js +20 -17
- package/dist/components/ui/PickerField.js.map +1 -1
- package/dist/components/ui/ProjectSelector.cjs +1 -1
- package/dist/components/ui/ProjectSelector.cjs.map +1 -1
- package/dist/components/ui/ProjectSelector.js +39 -36
- package/dist/components/ui/ProjectSelector.js.map +1 -1
- package/dist/components/ui/QueryAutocomplete.cjs +1 -1
- package/dist/components/ui/QueryAutocomplete.cjs.map +1 -1
- package/dist/components/ui/QueryAutocomplete.d.ts +7 -1
- package/dist/components/ui/QueryAutocomplete.js +150 -127
- package/dist/components/ui/QueryAutocomplete.js.map +1 -1
- package/dist/components/ui/RegisterForm.cjs +1 -1
- package/dist/components/ui/RegisterForm.cjs.map +1 -1
- package/dist/components/ui/RegisterForm.d.ts +1 -0
- package/dist/components/ui/RegisterForm.js +52 -43
- package/dist/components/ui/RegisterForm.js.map +1 -1
- package/dist/components/ui/ResizableSidePanel.cjs +1 -1
- package/dist/components/ui/ResizableSidePanel.cjs.map +1 -1
- package/dist/components/ui/ResizableSidePanel.js +41 -40
- package/dist/components/ui/ResizableSidePanel.js.map +1 -1
- package/dist/components/ui/RollingValue.cjs +2 -0
- package/dist/components/ui/RollingValue.cjs.map +1 -0
- package/dist/components/ui/RollingValue.d.ts +14 -0
- package/dist/components/ui/RollingValue.js +39 -0
- package/dist/components/ui/RollingValue.js.map +1 -0
- package/dist/components/ui/SavedQueryBar.cjs +1 -1
- package/dist/components/ui/SavedQueryBar.cjs.map +1 -1
- package/dist/components/ui/SavedQueryBar.d.ts +9 -3
- package/dist/components/ui/SavedQueryBar.js +390 -291
- package/dist/components/ui/SavedQueryBar.js.map +1 -1
- package/dist/components/ui/ScrollStory.cjs +1 -2
- package/dist/components/ui/ScrollStory.cjs.map +1 -1
- package/dist/components/ui/ScrollStory.js +57 -75
- package/dist/components/ui/ScrollStory.js.map +1 -1
- package/dist/components/ui/SearchInput.cjs +1 -1
- package/dist/components/ui/SearchInput.cjs.map +1 -1
- package/dist/components/ui/SearchInput.d.ts +5 -1
- package/dist/components/ui/SearchInput.js +28 -24
- package/dist/components/ui/SearchInput.js.map +1 -1
- package/dist/components/ui/Select.cjs +1 -1
- package/dist/components/ui/Select.cjs.map +1 -1
- package/dist/components/ui/Select.d.ts +4 -2
- package/dist/components/ui/Select.js +34 -31
- package/dist/components/ui/Select.js.map +1 -1
- package/dist/components/ui/ServiceMap.cjs +1 -1
- package/dist/components/ui/ServiceMap.cjs.map +1 -1
- package/dist/components/ui/ServiceMap.d.ts +57 -2
- package/dist/components/ui/ServiceMap.js +374 -117
- package/dist/components/ui/ServiceMap.js.map +1 -1
- package/dist/components/ui/ShareLinkDialog.cjs +1 -1
- package/dist/components/ui/ShareLinkDialog.cjs.map +1 -1
- package/dist/components/ui/ShareLinkDialog.d.ts +5 -3
- package/dist/components/ui/ShareLinkDialog.js +107 -98
- package/dist/components/ui/ShareLinkDialog.js.map +1 -1
- package/dist/components/ui/Slider.cjs +2 -0
- package/dist/components/ui/Slider.cjs.map +1 -0
- package/dist/components/ui/Slider.d.ts +24 -0
- package/dist/components/ui/Slider.js +55 -0
- package/dist/components/ui/Slider.js.map +1 -0
- package/dist/components/ui/SparkLine.cjs +1 -1
- package/dist/components/ui/SparkLine.cjs.map +1 -1
- package/dist/components/ui/SparkLine.d.ts +4 -1
- package/dist/components/ui/SparkLine.js +29 -23
- package/dist/components/ui/SparkLine.js.map +1 -1
- package/dist/components/ui/StatBlock.cjs +1 -1
- package/dist/components/ui/StatBlock.cjs.map +1 -1
- package/dist/components/ui/StatBlock.js +17 -16
- package/dist/components/ui/StatBlock.js.map +1 -1
- package/dist/components/ui/StatusDot.cjs.map +1 -1
- package/dist/components/ui/StatusDot.d.ts +5 -1
- package/dist/components/ui/StatusDot.js.map +1 -1
- package/dist/components/ui/Steps.cjs +2 -0
- package/dist/components/ui/Steps.cjs.map +1 -0
- package/dist/components/ui/Steps.d.ts +19 -0
- package/dist/components/ui/Steps.js +53 -0
- package/dist/components/ui/Steps.js.map +1 -0
- package/dist/components/ui/TableOfContents.cjs +1 -1
- package/dist/components/ui/TableOfContents.cjs.map +1 -1
- package/dist/components/ui/TableOfContents.d.ts +3 -3
- package/dist/components/ui/TableOfContents.js +47 -28
- package/dist/components/ui/TableOfContents.js.map +1 -1
- package/dist/components/ui/Tabs.cjs +2 -2
- package/dist/components/ui/Tabs.cjs.map +1 -1
- package/dist/components/ui/Tabs.d.ts +37 -3
- package/dist/components/ui/Tabs.js +169 -109
- package/dist/components/ui/Tabs.js.map +1 -1
- package/dist/components/ui/Terminal.cjs +1 -1
- package/dist/components/ui/Terminal.cjs.map +1 -1
- package/dist/components/ui/Terminal.js +18 -17
- package/dist/components/ui/Terminal.js.map +1 -1
- package/dist/components/ui/TextField.cjs +1 -1
- package/dist/components/ui/TextField.cjs.map +1 -1
- package/dist/components/ui/TextField.js +19 -18
- package/dist/components/ui/TextField.js.map +1 -1
- package/dist/components/ui/ThemeToggle.cjs +1 -1
- package/dist/components/ui/ThemeToggle.cjs.map +1 -1
- package/dist/components/ui/ThemeToggle.js +15 -18
- package/dist/components/ui/ThemeToggle.js.map +1 -1
- package/dist/components/ui/TimeDisplay.cjs +1 -1
- package/dist/components/ui/TimeDisplay.cjs.map +1 -1
- package/dist/components/ui/TimeDisplay.d.ts +14 -4
- package/dist/components/ui/TimeDisplay.js +43 -44
- package/dist/components/ui/TimeDisplay.js.map +1 -1
- package/dist/components/ui/TimeRangePicker.cjs +1 -1
- package/dist/components/ui/TimeRangePicker.cjs.map +1 -1
- package/dist/components/ui/TimeRangePicker.js +128 -111
- package/dist/components/ui/TimeRangePicker.js.map +1 -1
- package/dist/components/ui/TimelineChart.cjs +2 -1
- package/dist/components/ui/TimelineChart.cjs.map +1 -1
- package/dist/components/ui/TimelineChart.d.ts +1 -0
- package/dist/components/ui/TimelineChart.js +221 -169
- package/dist/components/ui/TimelineChart.js.map +1 -1
- package/dist/components/ui/ToolCallCard.cjs +1 -1
- package/dist/components/ui/ToolCallCard.cjs.map +1 -1
- package/dist/components/ui/ToolCallCard.js +22 -22
- package/dist/components/ui/ToolCallCard.js.map +1 -1
- package/dist/components/ui/Toolbar.cjs +1 -1
- package/dist/components/ui/Toolbar.cjs.map +1 -1
- package/dist/components/ui/Toolbar.d.ts +4 -16
- package/dist/components/ui/Toolbar.js +8 -62
- package/dist/components/ui/Toolbar.js.map +1 -1
- package/dist/components/ui/TraceSpanInspector.cjs +1 -1
- package/dist/components/ui/TraceSpanInspector.cjs.map +1 -1
- package/dist/components/ui/TraceSpanInspector.js +94 -76
- package/dist/components/ui/TraceSpanInspector.js.map +1 -1
- package/dist/components/ui/TraceTree.cjs +1 -1
- package/dist/components/ui/TraceTree.cjs.map +1 -1
- package/dist/components/ui/TraceTree.d.ts +36 -2
- package/dist/components/ui/TraceTree.js +278 -170
- package/dist/components/ui/TraceTree.js.map +1 -1
- package/dist/components/ui/TrajectoryStep.cjs +1 -1
- package/dist/components/ui/TrajectoryStep.cjs.map +1 -1
- package/dist/components/ui/TrajectoryStep.js +39 -43
- package/dist/components/ui/TrajectoryStep.js.map +1 -1
- package/dist/components/ui/TrajectoryTimeline.cjs +1 -1
- package/dist/components/ui/TrajectoryTimeline.cjs.map +1 -1
- package/dist/components/ui/TrajectoryTimeline.js +31 -28
- package/dist/components/ui/TrajectoryTimeline.js.map +1 -1
- package/dist/components/ui/UploadQueue.cjs +1 -1
- package/dist/components/ui/UploadQueue.cjs.map +1 -1
- package/dist/components/ui/UploadQueue.d.ts +18 -2
- package/dist/components/ui/UploadQueue.js +53 -71
- package/dist/components/ui/UploadQueue.js.map +1 -1
- package/dist/components/ui/authValidation.cjs +2 -0
- package/dist/components/ui/authValidation.cjs.map +1 -0
- package/dist/components/ui/authValidation.d.ts +3 -0
- package/dist/components/ui/authValidation.js +8 -0
- package/dist/components/ui/authValidation.js.map +1 -0
- package/dist/components/ui/classifyContent.cjs +6 -0
- package/dist/components/ui/classifyContent.cjs.map +1 -0
- package/dist/components/ui/classifyContent.d.ts +40 -0
- package/dist/components/ui/classifyContent.js +167 -0
- package/dist/components/ui/classifyContent.js.map +1 -0
- package/dist/components/ui/dropFiles.cjs +2 -0
- package/dist/components/ui/dropFiles.cjs.map +1 -0
- package/dist/components/ui/dropFiles.d.ts +7 -0
- package/dist/components/ui/dropFiles.js +16 -0
- package/dist/components/ui/dropFiles.js.map +1 -0
- package/dist/components/ui/index.d.ts +23 -10
- package/dist/components/ui/linkComponent.cjs +1 -1
- package/dist/components/ui/linkComponent.cjs.map +1 -1
- package/dist/components/ui/linkComponent.d.ts +4 -2
- package/dist/components/ui/linkComponent.js +15 -5
- package/dist/components/ui/linkComponent.js.map +1 -1
- package/dist/components/ui/markdownDocument.cjs +2 -0
- package/dist/components/ui/markdownDocument.cjs.map +1 -0
- package/dist/components/ui/markdownDocument.d.ts +40 -0
- package/dist/components/ui/markdownDocument.js +39 -0
- package/dist/components/ui/markdownDocument.js.map +1 -0
- package/dist/components/ui/relativeTime.cjs +1 -1
- package/dist/components/ui/relativeTime.cjs.map +1 -1
- package/dist/components/ui/relativeTime.d.ts +5 -3
- package/dist/components/ui/relativeTime.js +15 -6
- package/dist/components/ui/relativeTime.js.map +1 -1
- package/dist/components/ui/traceStatus.cjs +2 -0
- package/dist/components/ui/traceStatus.cjs.map +1 -0
- package/dist/components/ui/{traceFormat.d.ts → traceStatus.d.ts} +0 -1
- package/dist/components/ui/traceStatus.js +7 -0
- package/dist/components/ui/traceStatus.js.map +1 -0
- package/dist/components/ui/useColumnWidths.cjs +2 -0
- package/dist/components/ui/useColumnWidths.cjs.map +1 -0
- package/dist/components/ui/useColumnWidths.d.ts +60 -0
- package/dist/components/ui/useColumnWidths.js +196 -0
- package/dist/components/ui/useColumnWidths.js.map +1 -0
- package/dist/hooks/popoverOverflow.cjs +2 -0
- package/dist/hooks/popoverOverflow.cjs.map +1 -0
- package/dist/hooks/popoverOverflow.d.ts +8 -0
- package/dist/hooks/popoverOverflow.js +9 -0
- package/dist/hooks/popoverOverflow.js.map +1 -0
- package/dist/hooks/useDevelopAfterLoad.cjs +2 -0
- package/dist/hooks/useDevelopAfterLoad.cjs.map +1 -0
- package/dist/hooks/useDevelopAfterLoad.d.ts +8 -0
- package/dist/hooks/useDevelopAfterLoad.js +9 -0
- package/dist/hooks/useDevelopAfterLoad.js.map +1 -0
- package/dist/hooks/useDialogPopover.cjs +2 -0
- package/dist/hooks/useDialogPopover.cjs.map +1 -0
- package/dist/hooks/useDialogPopover.d.ts +23 -0
- package/dist/hooks/useDialogPopover.js +48 -0
- package/dist/hooks/useDialogPopover.js.map +1 -0
- package/dist/hooks/useMenuPopover.cjs +1 -1
- package/dist/hooks/useMenuPopover.cjs.map +1 -1
- package/dist/hooks/useMenuPopover.d.ts +0 -8
- package/dist/hooks/useMenuPopover.js +17 -22
- package/dist/hooks/useMenuPopover.js.map +1 -1
- package/dist/hooks/useResizable.cjs +1 -1
- package/dist/hooks/useResizable.cjs.map +1 -1
- package/dist/hooks/useResizable.js +87 -78
- package/dist/hooks/useResizable.js.map +1 -1
- package/dist/hooks/useSavedQueries.cjs +1 -1
- package/dist/hooks/useSavedQueries.cjs.map +1 -1
- package/dist/hooks/useSavedQueries.d.ts +6 -0
- package/dist/hooks/useSavedQueries.js +52 -60
- package/dist/hooks/useSavedQueries.js.map +1 -1
- package/dist/hooks/useSectionSpy.cjs +1 -1
- package/dist/hooks/useSectionSpy.cjs.map +1 -1
- package/dist/hooks/useSectionSpy.d.ts +6 -1
- package/dist/hooks/useSectionSpy.js +87 -57
- package/dist/hooks/useSectionSpy.js.map +1 -1
- package/dist/hooks/useStorageItem.cjs +2 -0
- package/dist/hooks/useStorageItem.cjs.map +1 -0
- package/dist/hooks/useStorageItem.d.ts +6 -0
- package/dist/hooks/useStorageItem.js +36 -0
- package/dist/hooks/useStorageItem.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +321 -313
- package/dist/index.js.map +1 -1
- package/dist/layouts/shell/AegisShell.cjs +1 -1
- package/dist/layouts/shell/AegisShell.cjs.map +1 -1
- package/dist/layouts/shell/AegisShell.d.ts +4 -2
- package/dist/layouts/shell/AegisShell.js +150 -243
- package/dist/layouts/shell/AegisShell.js.map +1 -1
- package/dist/layouts/shell/AppRoutes.cjs +2 -0
- package/dist/layouts/shell/AppRoutes.cjs.map +1 -0
- package/dist/layouts/shell/AppRoutes.d.ts +5 -0
- package/dist/layouts/shell/AppRoutes.js +8 -0
- package/dist/layouts/shell/AppRoutes.js.map +1 -0
- package/dist/layouts/shell/AppSwitcher.cjs +1 -1
- package/dist/layouts/shell/AppSwitcher.cjs.map +1 -1
- package/dist/layouts/shell/AppSwitcher.js +53 -36
- package/dist/layouts/shell/AppSwitcher.js.map +1 -1
- package/dist/layouts/shell/AuthRequiredCard.cjs +1 -1
- package/dist/layouts/shell/AuthRequiredCard.cjs.map +1 -1
- package/dist/layouts/shell/AuthRequiredCard.js +24 -22
- package/dist/layouts/shell/AuthRequiredCard.js.map +1 -1
- package/dist/layouts/shell/BreadcrumbBar.cjs +1 -1
- package/dist/layouts/shell/BreadcrumbBar.cjs.map +1 -1
- package/dist/layouts/shell/BreadcrumbBar.d.ts +1 -2
- package/dist/layouts/shell/BreadcrumbBar.js +19 -26
- package/dist/layouts/shell/BreadcrumbBar.js.map +1 -1
- package/dist/layouts/shell/RouteErrorBoundary.cjs +2 -0
- package/dist/layouts/shell/RouteErrorBoundary.cjs.map +1 -0
- package/dist/layouts/shell/RouteErrorBoundary.d.ts +26 -0
- package/dist/layouts/shell/RouteErrorBoundary.js +40 -0
- package/dist/layouts/shell/RouteErrorBoundary.js.map +1 -0
- package/dist/layouts/shell/RouterLink.cjs +2 -0
- package/dist/layouts/shell/RouterLink.cjs.map +1 -0
- package/dist/layouts/shell/RouterLink.d.ts +3 -0
- package/dist/layouts/shell/RouterLink.js +22 -0
- package/dist/layouts/shell/RouterLink.js.map +1 -0
- package/dist/layouts/shell/ShellCommandPalette.cjs +2 -0
- package/dist/layouts/shell/ShellCommandPalette.cjs.map +1 -0
- package/dist/layouts/shell/ShellCommandPalette.d.ts +7 -0
- package/dist/layouts/shell/ShellCommandPalette.js +32 -0
- package/dist/layouts/shell/ShellCommandPalette.js.map +1 -0
- package/dist/layouts/shell/ShellInboxPage.cjs +2 -0
- package/dist/layouts/shell/ShellInboxPage.cjs.map +1 -0
- package/dist/layouts/shell/ShellInboxPage.d.ts +12 -0
- package/dist/layouts/shell/ShellInboxPage.js +33 -0
- package/dist/layouts/shell/ShellInboxPage.js.map +1 -0
- package/dist/layouts/shell/ShellNotificationBell.cjs +2 -0
- package/dist/layouts/shell/ShellNotificationBell.cjs.map +1 -0
- package/dist/layouts/shell/ShellNotificationBell.d.ts +5 -0
- package/dist/layouts/shell/ShellNotificationBell.js +30 -0
- package/dist/layouts/shell/ShellNotificationBell.js.map +1 -0
- package/dist/layouts/shell/Sidebar.cjs +1 -1
- package/dist/layouts/shell/Sidebar.cjs.map +1 -1
- package/dist/layouts/shell/Sidebar.d.ts +4 -2
- package/dist/layouts/shell/Sidebar.js +14 -11
- package/dist/layouts/shell/Sidebar.js.map +1 -1
- package/dist/layouts/shell/TopHeader.cjs +1 -1
- package/dist/layouts/shell/TopHeader.cjs.map +1 -1
- package/dist/layouts/shell/TopHeader.d.ts +6 -2
- package/dist/layouts/shell/TopHeader.js +87 -75
- package/dist/layouts/shell/TopHeader.js.map +1 -1
- package/dist/layouts/shell/apps.cjs +2 -0
- package/dist/layouts/shell/apps.cjs.map +1 -0
- package/dist/layouts/shell/apps.d.ts +12 -0
- package/dist/layouts/shell/apps.js +34 -0
- package/dist/layouts/shell/apps.js.map +1 -0
- package/dist/layouts/shell/buildRouteTree.cjs +2 -0
- package/dist/layouts/shell/buildRouteTree.cjs.map +1 -0
- package/dist/layouts/shell/buildRouteTree.d.ts +22 -0
- package/dist/layouts/shell/buildRouteTree.js +49 -0
- package/dist/layouts/shell/buildRouteTree.js.map +1 -0
- package/dist/layouts/shell/environments/EnvironmentProvider.cjs +2 -0
- package/dist/layouts/shell/environments/EnvironmentProvider.cjs.map +1 -0
- package/dist/layouts/shell/environments/EnvironmentProvider.d.ts +13 -0
- package/dist/layouts/shell/environments/EnvironmentProvider.js +90 -0
- package/dist/layouts/shell/environments/EnvironmentProvider.js.map +1 -0
- package/dist/layouts/shell/environments/{context.cjs → environmentContext.cjs} +2 -2
- package/dist/layouts/shell/environments/environmentContext.cjs.map +1 -0
- package/dist/layouts/shell/environments/environmentContext.d.ts +6 -0
- package/dist/layouts/shell/environments/environmentContext.js +8 -0
- package/dist/layouts/shell/environments/environmentContext.js.map +1 -0
- package/dist/layouts/shell/environments/index.d.ts +2 -3
- package/dist/layouts/shell/environments/types.cjs.map +1 -1
- package/dist/layouts/shell/environments/types.d.ts +23 -15
- package/dist/layouts/shell/environments/types.js.map +1 -1
- package/dist/layouts/shell/environments/useEnvironment.cjs +2 -0
- package/dist/layouts/shell/environments/useEnvironment.cjs.map +1 -0
- package/dist/layouts/shell/environments/{hooks.d.ts → useEnvironment.d.ts} +3 -2
- package/dist/layouts/shell/environments/useEnvironment.js +25 -0
- package/dist/layouts/shell/environments/useEnvironment.js.map +1 -0
- package/dist/layouts/shell/index.d.ts +3 -1
- package/dist/layouts/shell/types.d.ts +14 -14
- package/dist/layouts/shell/useAgentPanel.cjs +2 -0
- package/dist/layouts/shell/useAgentPanel.cjs.map +1 -0
- package/dist/layouts/shell/useAgentPanel.d.ts +13 -0
- package/dist/layouts/shell/useAgentPanel.js +21 -0
- package/dist/layouts/shell/useAgentPanel.js.map +1 -0
- package/dist/layouts/shell/useAppCommands.cjs +2 -0
- package/dist/layouts/shell/useAppCommands.cjs.map +1 -0
- package/dist/layouts/shell/useAppCommands.d.ts +6 -0
- package/dist/layouts/shell/useAppCommands.js +19 -0
- package/dist/layouts/shell/useAppCommands.js.map +1 -0
- package/dist/layouts/shell/useMobileNav.cjs +2 -0
- package/dist/layouts/shell/useMobileNav.cjs.map +1 -0
- package/dist/layouts/shell/useMobileNav.d.ts +20 -0
- package/dist/layouts/shell/useMobileNav.js +54 -0
- package/dist/layouts/shell/useMobileNav.js.map +1 -0
- package/dist/layouts/shell/useOpenNotification.cjs +2 -0
- package/dist/layouts/shell/useOpenNotification.cjs.map +1 -0
- package/dist/layouts/shell/useOpenNotification.d.ts +3 -0
- package/dist/layouts/shell/useOpenNotification.js +16 -0
- package/dist/layouts/shell/useOpenNotification.js.map +1 -0
- package/dist/layouts/shell/useShellUser.cjs +2 -0
- package/dist/layouts/shell/useShellUser.cjs.map +1 -0
- package/dist/layouts/shell/useShellUser.d.ts +7 -0
- package/dist/layouts/shell/useShellUser.js +23 -0
- package/dist/layouts/shell/useShellUser.js.map +1 -0
- package/dist/layouts/shell/useWarnOnce.cjs +2 -0
- package/dist/layouts/shell/useWarnOnce.cjs.map +1 -0
- package/dist/layouts/shell/useWarnOnce.d.ts +1 -0
- package/dist/layouts/shell/useWarnOnce.js +11 -0
- package/dist/layouts/shell/useWarnOnce.js.map +1 -0
- package/dist/lib/chart.cjs +1 -1
- package/dist/lib/chart.cjs.map +1 -1
- package/dist/lib/chart.d.ts +5 -7
- package/dist/lib/chart.js +49 -34
- package/dist/lib/chart.js.map +1 -1
- package/dist/lib/format.cjs +1 -1
- package/dist/lib/format.cjs.map +1 -1
- package/dist/lib/format.d.ts +34 -0
- package/dist/lib/format.js +98 -9
- package/dist/lib/format.js.map +1 -1
- package/dist/lib/luceneQuery/tokenizeAtCursor.cjs +1 -1
- package/dist/lib/luceneQuery/tokenizeAtCursor.cjs.map +1 -1
- package/dist/lib/luceneQuery/tokenizeAtCursor.js +29 -29
- package/dist/lib/luceneQuery/tokenizeAtCursor.js.map +1 -1
- package/dist/lib/storage.cjs +1 -1
- package/dist/lib/storage.cjs.map +1 -1
- package/dist/lib/storage.js +19 -12
- package/dist/lib/storage.js.map +1 -1
- package/dist/lib/timeRange.cjs +1 -1
- package/dist/lib/timeRange.cjs.map +1 -1
- package/dist/lib/timeRange.d.ts +14 -4
- package/dist/lib/timeRange.js +43 -39
- package/dist/lib/timeRange.js.map +1 -1
- package/dist/locale/strings.cjs +1 -1
- package/dist/locale/strings.cjs.map +1 -1
- package/dist/locale/strings.d.ts +243 -2
- package/dist/locale/strings.js +545 -26
- package/dist/locale/strings.js.map +1 -1
- package/dist/notifications/notificationContext.cjs.map +1 -1
- package/dist/notifications/notificationContext.d.ts +15 -0
- package/dist/notifications/notificationContext.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/theme/ThemeProvider.cjs +1 -1
- package/dist/theme/ThemeProvider.cjs.map +1 -1
- package/dist/theme/ThemeProvider.d.ts +2 -1
- package/dist/theme/ThemeProvider.js +47 -33
- package/dist/theme/ThemeProvider.js.map +1 -1
- package/dist/theme/antdTheme.cjs +1 -1
- package/dist/theme/antdTheme.cjs.map +1 -1
- package/dist/theme/antdTheme.d.ts +0 -2
- package/dist/theme/antdTheme.js +28 -20
- package/dist/theme/antdTheme.js.map +1 -1
- package/dist/transports/agentm/AgentmChannelProvider.cjs +1 -1
- package/dist/transports/agentm/AgentmChannelProvider.cjs.map +1 -1
- package/dist/transports/agentm/AgentmChannelProvider.d.ts +1 -0
- package/dist/transports/agentm/AgentmChannelProvider.js +119 -131
- package/dist/transports/agentm/AgentmChannelProvider.js.map +1 -1
- package/dist/transports/agentm/agentmChannelClient.cjs +1 -1
- package/dist/transports/agentm/agentmChannelClient.cjs.map +1 -1
- package/dist/transports/agentm/agentmChannelClient.d.ts +8 -3
- package/dist/transports/agentm/agentmChannelClient.js +133 -89
- package/dist/transports/agentm/agentmChannelClient.js.map +1 -1
- package/dist/transports/index.d.ts +2 -2
- package/dist/transports/mcpBridge.cjs +2 -0
- package/dist/transports/mcpBridge.cjs.map +1 -0
- package/dist/transports/{bridge.d.ts → mcpBridge.d.ts} +2 -1
- package/dist/transports/mcpBridge.js +144 -0
- package/dist/transports/mcpBridge.js.map +1 -0
- package/dist/transports/mcpTools.cjs +2 -0
- package/dist/transports/mcpTools.cjs.map +1 -0
- package/dist/transports/mcpTools.d.ts +15 -0
- package/dist/transports/mcpTools.js +283 -0
- package/dist/transports/mcpTools.js.map +1 -0
- package/dist/transports.cjs +1 -1
- package/dist/transports.js +1 -1
- package/package.json +5 -4
- package/dist/agent/core/mcpToolCatalogue.cjs +0 -2
- package/dist/agent/core/mcpToolCatalogue.cjs.map +0 -1
- package/dist/agent/core/mcpToolCatalogue.d.ts +0 -2
- package/dist/agent/core/mcpToolCatalogue.js +0 -101
- package/dist/agent/core/mcpToolCatalogue.js.map +0 -1
- package/dist/components/ui/BucketCard.cjs +0 -2
- package/dist/components/ui/BucketCard.cjs.map +0 -1
- package/dist/components/ui/BucketCard.d.ts +0 -24
- package/dist/components/ui/BucketCard.js +0 -73
- package/dist/components/ui/BucketCard.js.map +0 -1
- package/dist/components/ui/ContentInspectorContent.cjs +0 -5
- package/dist/components/ui/ContentInspectorContent.cjs.map +0 -1
- package/dist/components/ui/ContentInspectorContent.d.ts +0 -14
- package/dist/components/ui/ContentInspectorContent.js +0 -101
- package/dist/components/ui/ContentInspectorContent.js.map +0 -1
- package/dist/components/ui/traceFormat.cjs +0 -2
- package/dist/components/ui/traceFormat.cjs.map +0 -1
- package/dist/components/ui/traceFormat.js +0 -11
- package/dist/components/ui/traceFormat.js.map +0 -1
- package/dist/layouts/shell/environments/EnvironmentContext.cjs +0 -2
- package/dist/layouts/shell/environments/EnvironmentContext.cjs.map +0 -1
- package/dist/layouts/shell/environments/EnvironmentContext.d.ts +0 -12
- package/dist/layouts/shell/environments/EnvironmentContext.js +0 -94
- package/dist/layouts/shell/environments/EnvironmentContext.js.map +0 -1
- package/dist/layouts/shell/environments/context.cjs.map +0 -1
- package/dist/layouts/shell/environments/context.d.ts +0 -6
- package/dist/layouts/shell/environments/context.js +0 -6
- package/dist/layouts/shell/environments/context.js.map +0 -1
- package/dist/layouts/shell/environments/hooks.cjs +0 -2
- package/dist/layouts/shell/environments/hooks.cjs.map +0 -1
- package/dist/layouts/shell/environments/hooks.js +0 -24
- package/dist/layouts/shell/environments/hooks.js.map +0 -1
- package/dist/layouts/shell/environments/manifest.cjs +0 -2
- package/dist/layouts/shell/environments/manifest.cjs.map +0 -1
- package/dist/layouts/shell/environments/manifest.d.ts +0 -26
- package/dist/layouts/shell/environments/manifest.js +0 -82
- package/dist/layouts/shell/environments/manifest.js.map +0 -1
- package/dist/transports/bridge.cjs +0 -2
- package/dist/transports/bridge.cjs.map +0 -1
- package/dist/transports/bridge.js +0 -143
- package/dist/transports/bridge.js.map +0 -1
|
@@ -1,98 +1,123 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useContext as
|
|
3
|
-
import {
|
|
4
|
-
import { Chip as
|
|
5
|
-
import { useIsomorphicLayoutEffect as
|
|
6
|
-
import { AegisRuntimeContext as
|
|
1
|
+
import { jsxs as m, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useContext as R, useRef as I, useState as A, useEffect as L, useCallback as C } from "react";
|
|
3
|
+
import { ChatComposer as x } from "../../components/ui/ChatComposer.js";
|
|
4
|
+
import { Chip as S } from "../../components/ui/Chip.js";
|
|
5
|
+
import { useIsomorphicLayoutEffect as F } from "../../hooks/useIsomorphicLayoutEffect.js";
|
|
6
|
+
import { AegisRuntimeContext as X } from "../core/aegisRuntimeContext.js";
|
|
7
7
|
/* empty css */
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
import { useStrings as j } from "../../locale/useStrings.js";
|
|
9
|
+
const q = 8, z = 8, B = 160;
|
|
10
|
+
function G(s, r, o, c) {
|
|
10
11
|
if (typeof window > "u")
|
|
11
12
|
return null;
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
),
|
|
16
|
-
let
|
|
17
|
-
return
|
|
13
|
+
const f = window.innerWidth, p = window.innerHeight, i = z, l = q, t = s?.x ?? r?.left ?? i, N = s?.y ?? r?.bottom ?? i, d = p - N - i, h = N - i, g = f - t - i, y = t - i, u = d >= h, E = Math.max(
|
|
14
|
+
u ? d : h,
|
|
15
|
+
B
|
|
16
|
+
), k = Math.min(c, E - l);
|
|
17
|
+
let w = u ? N + l : N - l - k, v = g >= y ? t + l : t - l - o;
|
|
18
|
+
return v = Math.max(i, Math.min(v, f - o - i)), w = Math.max(i, Math.min(w, p - k - i)), { left: v, top: w, maxHeight: k };
|
|
18
19
|
}
|
|
19
|
-
function
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
function H(s, r, o) {
|
|
21
|
+
if (r)
|
|
22
|
+
return r;
|
|
23
|
+
if (!s)
|
|
24
|
+
return [];
|
|
25
|
+
if (o.entity) {
|
|
26
|
+
const c = s.inspect({ kind: "entity", entityId: o.entity.id });
|
|
27
|
+
if (c)
|
|
28
|
+
return c.actions;
|
|
29
|
+
}
|
|
30
|
+
if (o.surface) {
|
|
31
|
+
const c = s.inspect({
|
|
32
|
+
kind: "surface",
|
|
33
|
+
surfaceId: o.surface.id
|
|
34
|
+
});
|
|
35
|
+
if (c)
|
|
36
|
+
return c.actions;
|
|
37
|
+
}
|
|
38
|
+
return s.listActions();
|
|
39
|
+
}
|
|
40
|
+
function Y({
|
|
41
|
+
context: s,
|
|
42
|
+
tools: r,
|
|
43
|
+
anchorRect: o,
|
|
44
|
+
anchorPoint: c,
|
|
45
|
+
onClose: f,
|
|
46
|
+
onSend: p,
|
|
47
|
+
sending: i = !1,
|
|
48
|
+
popover: l = !0
|
|
26
49
|
}) {
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if (e)
|
|
38
|
-
return e.actions;
|
|
39
|
-
}
|
|
40
|
-
if (a.surface) {
|
|
41
|
-
const e = n.inspect({
|
|
42
|
-
kind: "surface",
|
|
43
|
-
surfaceId: a.surface.id
|
|
50
|
+
const t = j(), d = R(X)?.runtime ?? null, h = I(null), [g, y] = A(null), [u, E] = A(
|
|
51
|
+
() => H(d, r, s)
|
|
52
|
+
);
|
|
53
|
+
L(() => {
|
|
54
|
+
const e = () => {
|
|
55
|
+
E(H(d, r, s));
|
|
56
|
+
};
|
|
57
|
+
if (e(), !(r !== void 0 || !d))
|
|
58
|
+
return d.subscribe((a) => {
|
|
59
|
+
(a.type === "registry.changed" || a.type === "snapshot.changed") && e();
|
|
44
60
|
});
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
61
|
+
}, [d, r, s]);
|
|
62
|
+
const k = C(
|
|
63
|
+
(e) => {
|
|
64
|
+
const a = {
|
|
65
|
+
prompt: e,
|
|
66
|
+
context: s,
|
|
67
|
+
tools: u,
|
|
68
|
+
history: []
|
|
69
|
+
};
|
|
70
|
+
d?.emitAskSubmit(a), p?.(a);
|
|
71
|
+
},
|
|
72
|
+
[d, s, u, p]
|
|
73
|
+
);
|
|
74
|
+
L(() => {
|
|
75
|
+
if (!l)
|
|
51
76
|
return;
|
|
52
|
-
const e = {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
77
|
+
const e = (_) => {
|
|
78
|
+
_.key === "Escape" && (_.stopPropagation(), f());
|
|
79
|
+
}, a = (_) => {
|
|
80
|
+
const b = h.current;
|
|
81
|
+
b && (_.target instanceof Node && b.contains(_.target) || f());
|
|
57
82
|
};
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
I(() => {
|
|
61
|
-
const e = (d) => {
|
|
62
|
-
d.key === "Escape" && (d.stopPropagation(), u());
|
|
63
|
-
}, i = (d) => {
|
|
64
|
-
const m = c.current;
|
|
65
|
-
m && (d.target instanceof Node && m.contains(d.target) || u());
|
|
83
|
+
return window.addEventListener("keydown", e, !0), window.addEventListener("mousedown", a, !0), () => {
|
|
84
|
+
window.removeEventListener("keydown", e, !0), window.removeEventListener("mousedown", a, !0);
|
|
66
85
|
};
|
|
67
|
-
|
|
68
|
-
|
|
86
|
+
}, [f, l]);
|
|
87
|
+
const w = !l || g !== null;
|
|
88
|
+
L(() => {
|
|
89
|
+
if (!w)
|
|
90
|
+
return;
|
|
91
|
+
const e = document.activeElement, a = h.current;
|
|
92
|
+
return (a?.querySelector("textarea:not(:disabled)") ?? a)?.focus(), () => {
|
|
93
|
+
e instanceof HTMLElement && e.isConnected && e.focus();
|
|
69
94
|
};
|
|
70
|
-
}, [
|
|
71
|
-
if (!
|
|
72
|
-
|
|
95
|
+
}, [w]), F(() => {
|
|
96
|
+
if (!l) {
|
|
97
|
+
y(null);
|
|
73
98
|
return;
|
|
74
99
|
}
|
|
75
100
|
const e = () => {
|
|
76
|
-
const
|
|
77
|
-
if (!
|
|
101
|
+
const a = h.current;
|
|
102
|
+
if (!a)
|
|
78
103
|
return;
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
104
|
+
const _ = a.scrollHeight || a.offsetHeight, b = a.offsetWidth, M = G(
|
|
105
|
+
c ?? null,
|
|
106
|
+
o ?? null,
|
|
107
|
+
b,
|
|
108
|
+
_
|
|
84
109
|
);
|
|
85
|
-
|
|
110
|
+
y(M);
|
|
86
111
|
};
|
|
87
112
|
return e(), window.addEventListener("resize", e), window.addEventListener("scroll", e, !0), () => {
|
|
88
113
|
window.removeEventListener("resize", e), window.removeEventListener("scroll", e, !0);
|
|
89
114
|
};
|
|
90
|
-
}, [
|
|
91
|
-
const
|
|
115
|
+
}, [l, c, o, u, s]);
|
|
116
|
+
const T = l ? g ? {
|
|
92
117
|
position: "fixed",
|
|
93
|
-
left:
|
|
94
|
-
top:
|
|
95
|
-
maxHeight:
|
|
118
|
+
left: g.left,
|
|
119
|
+
top: g.top,
|
|
120
|
+
maxHeight: g.maxHeight
|
|
96
121
|
} : (
|
|
97
122
|
// First paint before measurement: render off-screen to avoid flicker.
|
|
98
123
|
{
|
|
@@ -101,74 +126,77 @@ function q({
|
|
|
101
126
|
top: -9999,
|
|
102
127
|
visibility: "hidden"
|
|
103
128
|
}
|
|
104
|
-
) : {},
|
|
105
|
-
return /* @__PURE__ */
|
|
129
|
+
) : {}, v = s.entity?.label ?? s.entity?.id, P = s.surface?.label ?? s.surface?.id;
|
|
130
|
+
return /* @__PURE__ */ m(
|
|
106
131
|
"div",
|
|
107
132
|
{
|
|
108
|
-
ref:
|
|
133
|
+
ref: h,
|
|
109
134
|
className: "aegis-ask-panel",
|
|
110
135
|
role: "dialog",
|
|
111
|
-
"aria-label":
|
|
136
|
+
"aria-label": t.askPanelTitle,
|
|
137
|
+
tabIndex: -1,
|
|
112
138
|
"data-aegis-ask-panel": "open",
|
|
113
|
-
"data-ask-origin":
|
|
114
|
-
style:
|
|
139
|
+
"data-ask-origin": s.origin,
|
|
140
|
+
style: T,
|
|
115
141
|
children: [
|
|
116
|
-
/* @__PURE__ */
|
|
117
|
-
/* @__PURE__ */
|
|
118
|
-
/* @__PURE__ */
|
|
142
|
+
/* @__PURE__ */ m("header", { className: "aegis-ask-panel__header", children: [
|
|
143
|
+
/* @__PURE__ */ n("div", { className: "aegis-ask-panel__title", children: t.askPanelTitle }),
|
|
144
|
+
/* @__PURE__ */ n(
|
|
119
145
|
"button",
|
|
120
146
|
{
|
|
121
147
|
type: "button",
|
|
122
148
|
className: "aegis-ask-panel__close",
|
|
123
|
-
"aria-label":
|
|
124
|
-
onClick:
|
|
149
|
+
"aria-label": t.close,
|
|
150
|
+
onClick: f,
|
|
125
151
|
children: "×"
|
|
126
152
|
}
|
|
127
153
|
)
|
|
128
154
|
] }),
|
|
129
|
-
/* @__PURE__ */
|
|
130
|
-
|
|
131
|
-
/* @__PURE__ */
|
|
132
|
-
/* @__PURE__ */
|
|
155
|
+
/* @__PURE__ */ m("div", { className: "aegis-ask-panel__meta", children: [
|
|
156
|
+
P && /* @__PURE__ */ m("div", { className: "aegis-ask-panel__meta-row", children: [
|
|
157
|
+
/* @__PURE__ */ n("span", { className: "aegis-ask-panel__meta-label", children: t.askSurface }),
|
|
158
|
+
/* @__PURE__ */ n("span", { className: "aegis-ask-panel__meta-value", children: P })
|
|
133
159
|
] }),
|
|
134
|
-
|
|
135
|
-
/* @__PURE__ */
|
|
136
|
-
/* @__PURE__ */
|
|
160
|
+
v && /* @__PURE__ */ m("div", { className: "aegis-ask-panel__meta-row", children: [
|
|
161
|
+
/* @__PURE__ */ n("span", { className: "aegis-ask-panel__meta-label", children: t.askEntity }),
|
|
162
|
+
/* @__PURE__ */ n("span", { className: "aegis-ask-panel__meta-value", children: v })
|
|
137
163
|
] })
|
|
138
164
|
] }),
|
|
139
|
-
|
|
140
|
-
/* @__PURE__ */
|
|
141
|
-
/* @__PURE__ */
|
|
165
|
+
s.suggestions.length > 0 && /* @__PURE__ */ m("div", { className: "aegis-ask-panel__section", children: [
|
|
166
|
+
/* @__PURE__ */ n("div", { className: "aegis-ask-panel__section-label", children: t.suggestions }),
|
|
167
|
+
/* @__PURE__ */ n("div", { className: "aegis-ask-panel__chips", children: s.suggestions.map((e) => /* @__PURE__ */ n(
|
|
168
|
+
S,
|
|
169
|
+
{
|
|
170
|
+
tone: "ghost",
|
|
171
|
+
onClick: p && !i ? () => {
|
|
172
|
+
k(e);
|
|
173
|
+
} : void 0,
|
|
174
|
+
children: e
|
|
175
|
+
},
|
|
176
|
+
e
|
|
177
|
+
)) })
|
|
142
178
|
] }),
|
|
143
|
-
/* @__PURE__ */
|
|
144
|
-
/* @__PURE__ */
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
")
|
|
148
|
-
] }),
|
|
149
|
-
r.length === 0 ? /* @__PURE__ */ s("div", { className: "aegis-ask-panel__empty", children: "No tools in scope." }) : /* @__PURE__ */ s("ul", { className: "aegis-ask-panel__tools", children: r.slice(0, 8).map((e) => /* @__PURE__ */ l("li", { className: "aegis-ask-panel__tool", children: [
|
|
150
|
-
/* @__PURE__ */ s("span", { className: "aegis-ask-panel__tool-id", children: e.id }),
|
|
151
|
-
/* @__PURE__ */ s("span", { className: "aegis-ask-panel__tool-label", children: e.label })
|
|
179
|
+
/* @__PURE__ */ m("div", { className: "aegis-ask-panel__section", children: [
|
|
180
|
+
/* @__PURE__ */ n("div", { className: "aegis-ask-panel__section-label", children: t.askToolsAvailable(u.length) }),
|
|
181
|
+
u.length === 0 ? /* @__PURE__ */ n("div", { className: "aegis-ask-panel__empty", children: t.askNoTools }) : /* @__PURE__ */ n("ul", { className: "aegis-ask-panel__tools", children: u.slice(0, 8).map((e) => /* @__PURE__ */ m("li", { className: "aegis-ask-panel__tool", children: [
|
|
182
|
+
/* @__PURE__ */ n("span", { className: "aegis-ask-panel__tool-id", children: e.id }),
|
|
183
|
+
/* @__PURE__ */ n("span", { className: "aegis-ask-panel__tool-label", children: e.label })
|
|
152
184
|
] }, e.id)) })
|
|
153
185
|
] }),
|
|
154
|
-
/* @__PURE__ */
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
}
|
|
164
|
-
),
|
|
165
|
-
/* @__PURE__ */ s("span", { className: "aegis-ask-panel__note", children: "no transport configured" })
|
|
166
|
-
] })
|
|
186
|
+
p ? /* @__PURE__ */ n(
|
|
187
|
+
x,
|
|
188
|
+
{
|
|
189
|
+
className: "aegis-ask-panel__composer",
|
|
190
|
+
onSend: k,
|
|
191
|
+
sending: i,
|
|
192
|
+
placeholder: t.askPlaceholder
|
|
193
|
+
}
|
|
194
|
+
) : /* @__PURE__ */ n("p", { className: "aegis-ask-panel__note", children: t.askNoAgent })
|
|
167
195
|
]
|
|
168
196
|
}
|
|
169
197
|
);
|
|
170
198
|
}
|
|
171
199
|
export {
|
|
172
|
-
|
|
200
|
+
Y as AskPanel
|
|
173
201
|
};
|
|
174
202
|
//# sourceMappingURL=AskPanel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AskPanel.js","sources":["../../../src/agent/ask/AskPanel.tsx"],"sourcesContent":["import {\n type CSSProperties,\n type ReactElement,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { Button } from '../../components/ui/Button';\nimport { Chip } from '../../components/ui/Chip';\nimport { useIsomorphicLayoutEffect } from '../../hooks/useIsomorphicLayoutEffect';\nimport { AegisRuntimeContext } from '../core/aegisRuntimeContext';\nimport type {\n AegisActionDescriptor,\n AskContext,\n AskRequest,\n} from '../core/types';\nimport './AskPanel.css';\n\nexport interface AskPanelProps {\n context: AskContext;\n /** Tools the agent could invoke. Defaults to deriving from snapshot. */\n tools?: AegisActionDescriptor[];\n /** Optional anchor — the panel positions itself near this rect. */\n anchorRect?: DOMRect | null;\n /** Preferred anchor point (e.g. mouse position). Wins over anchorRect. */\n anchorPoint?: { x: number; y: number } | null;\n onClose: () => void;\n /** When true, render fixed-positioned popover; when false, inline. */\n popover?: boolean;\n}\n\nconst PANEL_OFFSET_PX = 8;\nconst VIEWPORT_MARGIN_PX = 8;\nconst PANEL_MIN_HEIGHT_PX = 160;\n\ninterface Placement {\n left: number;\n top: number;\n maxHeight: number;\n}\n\nfunction placeNear(\n point: { x: number; y: number } | null,\n rect: DOMRect | null | undefined,\n panelWidth: number,\n panelHeight: number,\n): Placement | null {\n if (typeof window === 'undefined') {\n return null;\n }\n const vw = window.innerWidth;\n const vh = window.innerHeight;\n const margin = VIEWPORT_MARGIN_PX;\n const offset = PANEL_OFFSET_PX;\n\n // Anchor: prefer mouse point; fall back to rect's bottom-left corner.\n const ax = point?.x ?? rect?.left ?? margin;\n const ay = point?.y ?? rect?.bottom ?? margin;\n\n const spaceBelow = vh - ay - margin;\n const spaceAbove = ay - margin;\n const spaceRight = vw - ax - margin;\n const spaceLeft = ax - margin;\n\n // Pick vertical side with more room; allow shrinking max-height to fit.\n const placeBelow = spaceBelow >= spaceAbove;\n const verticalRoom = Math.max(\n placeBelow ? spaceBelow : spaceAbove,\n PANEL_MIN_HEIGHT_PX,\n );\n const maxHeight = Math.min(panelHeight, verticalRoom - offset);\n\n let top = placeBelow ? ay + offset : ay - offset - maxHeight;\n // Pick horizontal side with more room.\n const placeRight = spaceRight >= spaceLeft;\n let left = placeRight ? ax + offset : ax - offset - panelWidth;\n\n // Clamp into viewport.\n left = Math.max(margin, Math.min(left, vw - panelWidth - margin));\n top = Math.max(margin, Math.min(top, vh - maxHeight - margin));\n\n return { left, top, maxHeight };\n}\n\nexport function AskPanel({\n context,\n tools,\n anchorRect,\n anchorPoint,\n onClose,\n popover = true,\n}: AskPanelProps): ReactElement {\n const ctx = useContext(AegisRuntimeContext);\n const runtime = ctx?.runtime ?? null;\n const rootRef = useRef<HTMLDivElement>(null);\n const [placement, setPlacement] = useState<Placement | null>(null);\n\n const resolvedTools = useMemo<AegisActionDescriptor[]>(() => {\n if (tools) {\n return tools;\n }\n if (!runtime) {\n return [];\n }\n if (context.entity) {\n const r = runtime.inspect({\n kind: 'entity',\n entityId: context.entity.id,\n });\n if (r) {\n return r.actions;\n }\n }\n if (context.surface) {\n const r = runtime.inspect({\n kind: 'surface',\n surfaceId: context.surface.id,\n });\n if (r) {\n return r.actions;\n }\n }\n return runtime.listActions();\n }, [runtime, tools, context]);\n\n const onSend = useCallback(() => {\n if (!runtime) {\n return;\n }\n const req: AskRequest = {\n prompt: '',\n context,\n tools: resolvedTools,\n history: [],\n };\n runtime.emitAskSubmit(req);\n }, [runtime, context, resolvedTools]);\n\n useEffect(() => {\n const onKey = (e: KeyboardEvent): void => {\n if (e.key === 'Escape') {\n e.stopPropagation();\n onClose();\n }\n };\n const onDown = (e: MouseEvent): void => {\n const el = rootRef.current;\n if (!el) {\n return;\n }\n if (e.target instanceof Node && el.contains(e.target)) {\n return;\n }\n onClose();\n };\n window.addEventListener('keydown', onKey, true);\n window.addEventListener('mousedown', onDown, true);\n return () => {\n window.removeEventListener('keydown', onKey, true);\n window.removeEventListener('mousedown', onDown, true);\n };\n }, [onClose]);\n\n useIsomorphicLayoutEffect(() => {\n if (!popover) {\n setPlacement(null);\n return;\n }\n const compute = (): void => {\n const el = rootRef.current;\n if (!el) {\n return;\n }\n // Use the natural (unconstrained) size as the desired height; the\n // placement function will clamp it to the larger viewport gap.\n const naturalHeight = el.scrollHeight || el.offsetHeight;\n const width = el.offsetWidth;\n const next = placeNear(\n anchorPoint ?? null,\n anchorRect ?? null,\n width,\n naturalHeight,\n );\n setPlacement(next);\n };\n compute();\n window.addEventListener('resize', compute);\n window.addEventListener('scroll', compute, true);\n return () => {\n window.removeEventListener('resize', compute);\n window.removeEventListener('scroll', compute, true);\n };\n }, [popover, anchorPoint, anchorRect, resolvedTools, context]);\n\n const style: CSSProperties = popover\n ? placement\n ? {\n position: 'fixed',\n left: placement.left,\n top: placement.top,\n maxHeight: placement.maxHeight,\n }\n : // First paint before measurement: render off-screen to avoid flicker.\n {\n position: 'fixed',\n left: -9999,\n top: -9999,\n visibility: 'hidden',\n }\n : {};\n\n const headerLabel = context.entity?.label ?? context.entity?.id;\n const surfaceLabel = context.surface?.label ?? context.surface?.id;\n\n return (\n <div\n ref={rootRef}\n className=\"aegis-ask-panel\"\n role=\"dialog\"\n aria-label=\"Ask AI\"\n data-aegis-ask-panel=\"open\"\n data-ask-origin={context.origin}\n style={style}\n >\n <header className=\"aegis-ask-panel__header\">\n <div className=\"aegis-ask-panel__title\">Ask AI</div>\n <button\n type=\"button\"\n className=\"aegis-ask-panel__close\"\n aria-label=\"Close\"\n onClick={onClose}\n >\n ×\n </button>\n </header>\n <div className=\"aegis-ask-panel__meta\">\n {surfaceLabel && (\n <div className=\"aegis-ask-panel__meta-row\">\n <span className=\"aegis-ask-panel__meta-label\">Surface</span>\n <span className=\"aegis-ask-panel__meta-value\">{surfaceLabel}</span>\n </div>\n )}\n {headerLabel && (\n <div className=\"aegis-ask-panel__meta-row\">\n <span className=\"aegis-ask-panel__meta-label\">Entity</span>\n <span className=\"aegis-ask-panel__meta-value\">{headerLabel}</span>\n </div>\n )}\n </div>\n {context.suggestions.length > 0 && (\n <div className=\"aegis-ask-panel__section\">\n <div className=\"aegis-ask-panel__section-label\">Suggestions</div>\n <div className=\"aegis-ask-panel__chips\">\n {context.suggestions.map((s) => (\n <Chip key={s} tone=\"ghost\">\n {s}\n </Chip>\n ))}\n </div>\n </div>\n )}\n <div className=\"aegis-ask-panel__section\">\n <div className=\"aegis-ask-panel__section-label\">\n Tools available ({resolvedTools.length})\n </div>\n {resolvedTools.length === 0 ? (\n <div className=\"aegis-ask-panel__empty\">No tools in scope.</div>\n ) : (\n <ul className=\"aegis-ask-panel__tools\">\n {resolvedTools.slice(0, 8).map((t) => (\n <li key={t.id} className=\"aegis-ask-panel__tool\">\n <span className=\"aegis-ask-panel__tool-id\">{t.id}</span>\n <span className=\"aegis-ask-panel__tool-label\">{t.label}</span>\n </li>\n ))}\n </ul>\n )}\n </div>\n <footer className=\"aegis-ask-panel__footer\">\n <Button\n tone=\"primary\"\n disabled\n onClick={onSend}\n title=\"No transport configured\"\n >\n Send to agent\n </Button>\n <span className=\"aegis-ask-panel__note\">no transport configured</span>\n </footer>\n </div>\n );\n}\n"],"names":["PANEL_OFFSET_PX","VIEWPORT_MARGIN_PX","PANEL_MIN_HEIGHT_PX","placeNear","point","rect","panelWidth","panelHeight","vw","vh","margin","offset","ax","ay","spaceBelow","spaceAbove","spaceRight","spaceLeft","placeBelow","verticalRoom","maxHeight","top","left","AskPanel","context","tools","anchorRect","anchorPoint","onClose","popover","runtime","useContext","AegisRuntimeContext","rootRef","useRef","placement","setPlacement","useState","resolvedTools","useMemo","r","onSend","useCallback","req","useEffect","onKey","e","onDown","el","useIsomorphicLayoutEffect","compute","naturalHeight","width","next","style","headerLabel","surfaceLabel","jsxs","jsx","s","Chip","t","Button"],"mappings":";;;;;;;AAmCA,MAAMA,IAAkB,GAClBC,IAAqB,GACrBC,IAAsB;AAQ5B,SAASC,EACPC,GACAC,GACAC,GACAC,GACkB;AAClB,MAAI,OAAO,SAAW;AACpB,WAAO;AAET,QAAMC,IAAK,OAAO,YACZC,IAAK,OAAO,aACZC,IAAST,GACTU,IAASX,GAGTY,IAAKR,GAAO,KAAKC,GAAM,QAAQK,GAC/BG,IAAKT,GAAO,KAAKC,GAAM,UAAUK,GAEjCI,IAAaL,IAAKI,IAAKH,GACvBK,IAAaF,IAAKH,GAClBM,IAAaR,IAAKI,IAAKF,GACvBO,IAAYL,IAAKF,GAGjBQ,IAAaJ,KAAcC,GAC3BI,IAAe,KAAK;AAAA,IACxBD,IAAaJ,IAAaC;AAAA,IAC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UAAA;AAAA,UAAA,gBAAAC;AAAA,YAACI;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,UAAQ;AAAA,cACR,SAASrB;AAAA,cACT,OAAM;AAAA,cACP,UAAA;AAAA,YAAA;AAAA,UAAA;AAAA,UAGD,gBAAAiB,EAAC,QAAA,EAAK,WAAU,yBAAwB,UAAA,0BAAA,CAAuB;AAAA,QAAA,EAAA,CACjE;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
1
|
+
{"version":3,"file":"AskPanel.js","sources":["../../../src/agent/ask/AskPanel.tsx"],"sourcesContent":["import {\n type CSSProperties,\n type ReactElement,\n useCallback,\n useContext,\n useEffect,\n useRef,\n useState,\n} from 'react';\n\nimport { ChatComposer } from '../../components/ui/ChatComposer';\nimport { Chip } from '../../components/ui/Chip';\nimport { useIsomorphicLayoutEffect } from '../../hooks/useIsomorphicLayoutEffect';\nimport { useStrings } from '../../locale';\nimport { AegisRuntimeContext } from '../core/aegisRuntimeContext';\nimport type { AegisRuntime } from '../core/runtime';\nimport type {\n AegisActionDescriptor,\n AskContext,\n AskRequest,\n} from '../core/types';\nimport './AskPanel.css';\n\nexport interface AskPanelProps {\n context: AskContext;\n /** Tools the agent could invoke. Defaults to deriving from snapshot. */\n tools?: AegisActionDescriptor[];\n /** Optional anchor — the panel positions itself near this rect. */\n anchorRect?: DOMRect | null;\n /** Preferred anchor point (e.g. mouse position). Wins over anchorRect. */\n anchorPoint?: { x: number; y: number } | null;\n onClose: () => void;\n /**\n * Hands the question to the agent. Without it the panel shows the\n * context and its tools but offers no way to ask.\n */\n onSend?: (request: AskRequest) => void;\n /** True while the agent is still answering; holds the composer. */\n sending?: boolean;\n /**\n * When true (default), a fixed popover that closes on Escape and on a\n * click outside it; when false, inline.\n */\n popover?: boolean;\n}\n\nconst PANEL_OFFSET_PX = 8;\nconst VIEWPORT_MARGIN_PX = 8;\nconst PANEL_MIN_HEIGHT_PX = 160;\n\ninterface Placement {\n left: number;\n top: number;\n maxHeight: number;\n}\n\nfunction placeNear(\n point: { x: number; y: number } | null,\n rect: DOMRect | null | undefined,\n panelWidth: number,\n panelHeight: number,\n): Placement | null {\n if (typeof window === 'undefined') {\n return null;\n }\n const vw = window.innerWidth;\n const vh = window.innerHeight;\n const margin = VIEWPORT_MARGIN_PX;\n const offset = PANEL_OFFSET_PX;\n\n // Anchor: prefer mouse point; fall back to rect's bottom-left corner.\n const ax = point?.x ?? rect?.left ?? margin;\n const ay = point?.y ?? rect?.bottom ?? margin;\n\n const spaceBelow = vh - ay - margin;\n const spaceAbove = ay - margin;\n const spaceRight = vw - ax - margin;\n const spaceLeft = ax - margin;\n\n // Pick vertical side with more room; allow shrinking max-height to fit.\n const placeBelow = spaceBelow >= spaceAbove;\n const verticalRoom = Math.max(\n placeBelow ? spaceBelow : spaceAbove,\n PANEL_MIN_HEIGHT_PX,\n );\n const maxHeight = Math.min(panelHeight, verticalRoom - offset);\n\n let top = placeBelow ? ay + offset : ay - offset - maxHeight;\n // Pick horizontal side with more room.\n const placeRight = spaceRight >= spaceLeft;\n let left = placeRight ? ax + offset : ax - offset - panelWidth;\n\n // Clamp into viewport.\n left = Math.max(margin, Math.min(left, vw - panelWidth - margin));\n top = Math.max(margin, Math.min(top, vh - maxHeight - margin));\n\n return { left, top, maxHeight };\n}\n\nfunction resolveTools(\n runtime: AegisRuntime | null,\n tools: AegisActionDescriptor[] | undefined,\n context: AskContext,\n): AegisActionDescriptor[] {\n if (tools) {\n return tools;\n }\n if (!runtime) {\n return [];\n }\n if (context.entity) {\n const r = runtime.inspect({ kind: 'entity', entityId: context.entity.id });\n if (r) {\n return r.actions;\n }\n }\n if (context.surface) {\n const r = runtime.inspect({\n kind: 'surface',\n surfaceId: context.surface.id,\n });\n if (r) {\n return r.actions;\n }\n }\n return runtime.listActions();\n}\n\n/**\n * Mounting it opens it: focus moves to its question field, or to the panel\n * when there is no agent to ask, and returns on unmount to the element that\n * had it.\n */\nexport function AskPanel({\n context,\n tools,\n anchorRect,\n anchorPoint,\n onClose,\n onSend,\n sending = false,\n popover = true,\n}: AskPanelProps): ReactElement {\n const strings = useStrings();\n const ctx = useContext(AegisRuntimeContext);\n const runtime = ctx?.runtime ?? null;\n const rootRef = useRef<HTMLDivElement>(null);\n const [placement, setPlacement] = useState<Placement | null>(null);\n\n const [resolvedTools, setResolvedTools] = useState<AegisActionDescriptor[]>(\n () => resolveTools(runtime, tools, context),\n );\n\n useEffect(() => {\n const refresh = (): void => {\n setResolvedTools(resolveTools(runtime, tools, context));\n };\n refresh();\n if (tools !== undefined || !runtime) {\n return;\n }\n return runtime.subscribe((e) => {\n if (e.type === 'registry.changed' || e.type === 'snapshot.changed') {\n refresh();\n }\n });\n }, [runtime, tools, context]);\n\n const ask = useCallback(\n (prompt: string) => {\n const request: AskRequest = {\n prompt,\n context,\n tools: resolvedTools,\n history: [],\n };\n runtime?.emitAskSubmit(request);\n onSend?.(request);\n },\n [runtime, context, resolvedTools, onSend],\n );\n\n useEffect(() => {\n if (!popover) {\n return;\n }\n const onKey = (e: KeyboardEvent): void => {\n if (e.key === 'Escape') {\n e.stopPropagation();\n onClose();\n }\n };\n const onDown = (e: MouseEvent): void => {\n const el = rootRef.current;\n if (!el) {\n return;\n }\n if (e.target instanceof Node && el.contains(e.target)) {\n return;\n }\n onClose();\n };\n window.addEventListener('keydown', onKey, true);\n window.addEventListener('mousedown', onDown, true);\n return () => {\n window.removeEventListener('keydown', onKey, true);\n window.removeEventListener('mousedown', onDown, true);\n };\n }, [onClose, popover]);\n\n // A popover is hidden, and so cannot take focus, until it is placed.\n const ready = !popover || placement !== null;\n useEffect(() => {\n if (!ready) {\n return;\n }\n const returnFocusTo = document.activeElement;\n const root = rootRef.current;\n (\n root?.querySelector<HTMLElement>('textarea:not(:disabled)') ?? root\n )?.focus();\n return () => {\n if (returnFocusTo instanceof HTMLElement && returnFocusTo.isConnected) {\n returnFocusTo.focus();\n }\n };\n }, [ready]);\n\n useIsomorphicLayoutEffect(() => {\n if (!popover) {\n setPlacement(null);\n return;\n }\n const compute = (): void => {\n const el = rootRef.current;\n if (!el) {\n return;\n }\n // Use the natural (unconstrained) size as the desired height; the\n // placement function will clamp it to the larger viewport gap.\n const naturalHeight = el.scrollHeight || el.offsetHeight;\n const width = el.offsetWidth;\n const next = placeNear(\n anchorPoint ?? null,\n anchorRect ?? null,\n width,\n naturalHeight,\n );\n setPlacement(next);\n };\n compute();\n window.addEventListener('resize', compute);\n window.addEventListener('scroll', compute, true);\n return () => {\n window.removeEventListener('resize', compute);\n window.removeEventListener('scroll', compute, true);\n };\n }, [popover, anchorPoint, anchorRect, resolvedTools, context]);\n\n const style: CSSProperties = popover\n ? placement\n ? {\n position: 'fixed',\n left: placement.left,\n top: placement.top,\n maxHeight: placement.maxHeight,\n }\n : // First paint before measurement: render off-screen to avoid flicker.\n {\n position: 'fixed',\n left: -9999,\n top: -9999,\n visibility: 'hidden',\n }\n : {};\n\n const headerLabel = context.entity?.label ?? context.entity?.id;\n const surfaceLabel = context.surface?.label ?? context.surface?.id;\n\n return (\n <div\n ref={rootRef}\n className=\"aegis-ask-panel\"\n role=\"dialog\"\n aria-label={strings.askPanelTitle}\n tabIndex={-1}\n data-aegis-ask-panel=\"open\"\n data-ask-origin={context.origin}\n style={style}\n >\n <header className=\"aegis-ask-panel__header\">\n <div className=\"aegis-ask-panel__title\">{strings.askPanelTitle}</div>\n <button\n type=\"button\"\n className=\"aegis-ask-panel__close\"\n aria-label={strings.close}\n onClick={onClose}\n >\n ×\n </button>\n </header>\n <div className=\"aegis-ask-panel__meta\">\n {surfaceLabel && (\n <div className=\"aegis-ask-panel__meta-row\">\n <span className=\"aegis-ask-panel__meta-label\">\n {strings.askSurface}\n </span>\n <span className=\"aegis-ask-panel__meta-value\">{surfaceLabel}</span>\n </div>\n )}\n {headerLabel && (\n <div className=\"aegis-ask-panel__meta-row\">\n <span className=\"aegis-ask-panel__meta-label\">\n {strings.askEntity}\n </span>\n <span className=\"aegis-ask-panel__meta-value\">{headerLabel}</span>\n </div>\n )}\n </div>\n {context.suggestions.length > 0 && (\n <div className=\"aegis-ask-panel__section\">\n <div className=\"aegis-ask-panel__section-label\">\n {strings.suggestions}\n </div>\n <div className=\"aegis-ask-panel__chips\">\n {context.suggestions.map((s) => (\n <Chip\n key={s}\n tone=\"ghost\"\n onClick={\n onSend && !sending\n ? () => {\n ask(s);\n }\n : undefined\n }\n >\n {s}\n </Chip>\n ))}\n </div>\n </div>\n )}\n <div className=\"aegis-ask-panel__section\">\n <div className=\"aegis-ask-panel__section-label\">\n {strings.askToolsAvailable(resolvedTools.length)}\n </div>\n {resolvedTools.length === 0 ? (\n <div className=\"aegis-ask-panel__empty\">{strings.askNoTools}</div>\n ) : (\n <ul className=\"aegis-ask-panel__tools\">\n {resolvedTools.slice(0, 8).map((t) => (\n <li key={t.id} className=\"aegis-ask-panel__tool\">\n <span className=\"aegis-ask-panel__tool-id\">{t.id}</span>\n <span className=\"aegis-ask-panel__tool-label\">{t.label}</span>\n </li>\n ))}\n </ul>\n )}\n </div>\n {onSend ? (\n <ChatComposer\n className=\"aegis-ask-panel__composer\"\n onSend={ask}\n sending={sending}\n placeholder={strings.askPlaceholder}\n />\n ) : (\n <p className=\"aegis-ask-panel__note\">{strings.askNoAgent}</p>\n )}\n </div>\n );\n}\n"],"names":["PANEL_OFFSET_PX","VIEWPORT_MARGIN_PX","PANEL_MIN_HEIGHT_PX","placeNear","point","rect","panelWidth","panelHeight","vw","vh","margin","offset","ax","ay","spaceBelow","spaceAbove","spaceRight","spaceLeft","placeBelow","verticalRoom","maxHeight","top","left","resolveTools","runtime","tools","context","r","AskPanel","anchorRect","anchorPoint","onClose","onSend","sending","popover","strings","useStrings","useContext","AegisRuntimeContext","rootRef","useRef","placement","setPlacement","useState","resolvedTools","setResolvedTools","useEffect","refresh","e","ask","useCallback","prompt","request","onKey","onDown","el","ready","returnFocusTo","root","useIsomorphicLayoutEffect","compute","naturalHeight","width","next","style","headerLabel","surfaceLabel","jsx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UAAA;AAAA,YAAA,gBAAAC,EAAC,QAAA,EAAK,WAAU,4BAA4B,UAAAG,EAAE,IAAG;AAAA,YACjD,gBAAAH,EAAC,QAAA,EAAK,WAAU,+BAA+B,YAAE,MAAA,CAAM;AAAA,UAAA,KAFhDG,EAAE,EAGX,CACD,EAAA,CACH;AAAA,QAAA,GAEJ;AAAA,QACCvC,IACC,gBAAAoC;AAAA,UAACI;AAAA,UAAA;AAAA,YACC,WAAU;AAAA,YACV,QAAQvB;AAAA,YACR,SAAAhB;AAAA,YACA,aAAaE,EAAQ;AAAA,UAAA;AAAA,QAAA,IAGvB,gBAAAiC,EAAC,KAAA,EAAE,WAAU,yBAAyB,YAAQ,WAAA,CAAW;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIjE;"}
|
package/dist/agent/chat/chat.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t={messages:[],sending:!1,send:()=>{}},n=e.createContext(null);exports.AgentChatContext=n;exports.defaultAgentChatValue=t;
|
|
2
2
|
//# sourceMappingURL=chat.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat.cjs","sources":["../../../src/agent/chat/chat.ts"],"sourcesContent":["import { createContext } from 'react';\n\nexport type AgentMessageRole = 'user' | 'assistant' | 'system' | 'tool';\n\nexport interface AgentCommandInvocation {\n /** The command id the agent called, e.g. 'projects.create'. */\n commandId: string;\n /** Arguments passed. Library does not validate. */\n args?: unknown;\n status: 'pending' | 'success' | 'error';\n /** Set when status is 'error'. */\n error?: string;\n}\n\nexport interface AgentToolCallRecord {\n toolCallId: string;\n name: string;\n /** Raw args dict from the gateway; renderers stringify on demand. */\n args: unknown;\n status: 'running' | 'ok' | 'error';\n resultText?: string;\n startedAt?: number;\n endedAt?: number;\n}\n\nexport interface AgentMessage {\n id: string;\n role: AgentMessageRole;\n content: string;\n /** Command calls the assistant attempted in this message. */\n invocations?: AgentCommandInvocation[];\n /** Set on messages with role === 'tool'. */\n toolCall?: AgentToolCallRecord;\n /** ISO timestamp. */\n timestamp: string;\n}\n\n/**\n * Contract every agent-chat integration implements. The library does\n * not own state — callers wire their own LLM / tool-calling adapter and\n * pass the resulting value through `<AgentChatProvider value={...}>`.\n */\nexport interface AgentChatValue {\n messages: AgentMessage[];\n /** True while the assistant is generating a response. */\n sending: boolean;\n /** Send a user message. Host handles the LLM round-trip and state updates. */\n send: (content: string) => Promise<void> | void;\n /** Optional: clear the current thread. */\n clear?: () => void;\n /**\n * Optional: whether AegisShell's `agentPanel` is shown. Pass it with\n * `setPanelOpen` to own the state; leave it undefined and\n * <AgentChatProvider/> keeps it instead.\n */\n panelOpen?: boolean;\n /** Optional: open or close the agent panel (AegisShell's header toggle). */\n setPanelOpen?: (open: boolean) => void;\n}\n\nexport const defaultAgentChatValue: AgentChatValue = {\n messages: [],\n sending: false,\n send: () => undefined,\n};\n\nexport const AgentChatContext = createContext<AgentChatValue>(
|
|
1
|
+
{"version":3,"file":"chat.cjs","sources":["../../../src/agent/chat/chat.ts"],"sourcesContent":["import { createContext } from 'react';\n\nexport type AgentMessageRole = 'user' | 'assistant' | 'system' | 'tool';\n\nexport interface AgentCommandInvocation {\n /** The command id the agent called, e.g. 'projects.create'. */\n commandId: string;\n /** Arguments passed. Library does not validate. */\n args?: unknown;\n status: 'pending' | 'success' | 'error';\n /** Set when status is 'error'. */\n error?: string;\n}\n\nexport interface AgentToolCallRecord {\n toolCallId: string;\n name: string;\n /** Raw args dict from the gateway; renderers stringify on demand. */\n args: unknown;\n status: 'running' | 'ok' | 'error';\n resultText?: string;\n startedAt?: number;\n endedAt?: number;\n}\n\nexport interface AgentMessage {\n id: string;\n role: AgentMessageRole;\n content: string;\n /** Command calls the assistant attempted in this message. */\n invocations?: AgentCommandInvocation[];\n /** Set on messages with role === 'tool'. */\n toolCall?: AgentToolCallRecord;\n /** ISO timestamp. */\n timestamp: string;\n}\n\n/**\n * Contract every agent-chat integration implements. The library does\n * not own state — callers wire their own LLM / tool-calling adapter and\n * pass the resulting value through `<AgentChatProvider value={...}>`.\n */\nexport interface AgentChatValue {\n messages: AgentMessage[];\n /** True while the assistant is generating a response. */\n sending: boolean;\n /** Send a user message. Host handles the LLM round-trip and state updates. */\n send: (content: string) => Promise<void> | void;\n /** Optional: clear the current thread. */\n clear?: () => void;\n /**\n * Optional: whether AegisShell's `agentPanel` is shown. Pass it with\n * `setPanelOpen` to own the state; leave it undefined and\n * <AgentChatProvider/> keeps it instead.\n */\n panelOpen?: boolean;\n /** Optional: open or close the agent panel (AegisShell's header toggle). */\n setPanelOpen?: (open: boolean) => void;\n}\n\nexport const defaultAgentChatValue: AgentChatValue = {\n messages: [],\n sending: false,\n send: () => undefined,\n};\n\nexport const AgentChatContext = createContext<AgentChatValue | null>(null);\n"],"names":["defaultAgentChatValue","AgentChatContext","createContext"],"mappings":"yGA4DaA,EAAwC,CACnD,SAAU,CAAA,EACV,QAAS,GACT,KAAM,IAAA,EACR,EAEaC,EAAmBC,EAAAA,cAAqC,IAAI"}
|
|
@@ -52,4 +52,4 @@ export interface AgentChatValue {
|
|
|
52
52
|
setPanelOpen?: (open: boolean) => void;
|
|
53
53
|
}
|
|
54
54
|
export declare const defaultAgentChatValue: AgentChatValue;
|
|
55
|
-
export declare const AgentChatContext: import('react').Context<AgentChatValue>;
|
|
55
|
+
export declare const AgentChatContext: import('react').Context<AgentChatValue | null>;
|
package/dist/agent/chat/chat.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { createContext as e } from "react";
|
|
2
|
-
const
|
|
2
|
+
const n = {
|
|
3
3
|
messages: [],
|
|
4
4
|
sending: !1,
|
|
5
5
|
send: () => {
|
|
6
6
|
}
|
|
7
|
-
}, o = e(
|
|
8
|
-
t
|
|
9
|
-
);
|
|
7
|
+
}, o = e(null);
|
|
10
8
|
export {
|
|
11
9
|
o as AgentChatContext,
|
|
12
|
-
|
|
10
|
+
n as defaultAgentChatValue
|
|
13
11
|
};
|
|
14
12
|
//# sourceMappingURL=chat.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat.js","sources":["../../../src/agent/chat/chat.ts"],"sourcesContent":["import { createContext } from 'react';\n\nexport type AgentMessageRole = 'user' | 'assistant' | 'system' | 'tool';\n\nexport interface AgentCommandInvocation {\n /** The command id the agent called, e.g. 'projects.create'. */\n commandId: string;\n /** Arguments passed. Library does not validate. */\n args?: unknown;\n status: 'pending' | 'success' | 'error';\n /** Set when status is 'error'. */\n error?: string;\n}\n\nexport interface AgentToolCallRecord {\n toolCallId: string;\n name: string;\n /** Raw args dict from the gateway; renderers stringify on demand. */\n args: unknown;\n status: 'running' | 'ok' | 'error';\n resultText?: string;\n startedAt?: number;\n endedAt?: number;\n}\n\nexport interface AgentMessage {\n id: string;\n role: AgentMessageRole;\n content: string;\n /** Command calls the assistant attempted in this message. */\n invocations?: AgentCommandInvocation[];\n /** Set on messages with role === 'tool'. */\n toolCall?: AgentToolCallRecord;\n /** ISO timestamp. */\n timestamp: string;\n}\n\n/**\n * Contract every agent-chat integration implements. The library does\n * not own state — callers wire their own LLM / tool-calling adapter and\n * pass the resulting value through `<AgentChatProvider value={...}>`.\n */\nexport interface AgentChatValue {\n messages: AgentMessage[];\n /** True while the assistant is generating a response. */\n sending: boolean;\n /** Send a user message. Host handles the LLM round-trip and state updates. */\n send: (content: string) => Promise<void> | void;\n /** Optional: clear the current thread. */\n clear?: () => void;\n /**\n * Optional: whether AegisShell's `agentPanel` is shown. Pass it with\n * `setPanelOpen` to own the state; leave it undefined and\n * <AgentChatProvider/> keeps it instead.\n */\n panelOpen?: boolean;\n /** Optional: open or close the agent panel (AegisShell's header toggle). */\n setPanelOpen?: (open: boolean) => void;\n}\n\nexport const defaultAgentChatValue: AgentChatValue = {\n messages: [],\n sending: false,\n send: () => undefined,\n};\n\nexport const AgentChatContext = createContext<AgentChatValue>(
|
|
1
|
+
{"version":3,"file":"chat.js","sources":["../../../src/agent/chat/chat.ts"],"sourcesContent":["import { createContext } from 'react';\n\nexport type AgentMessageRole = 'user' | 'assistant' | 'system' | 'tool';\n\nexport interface AgentCommandInvocation {\n /** The command id the agent called, e.g. 'projects.create'. */\n commandId: string;\n /** Arguments passed. Library does not validate. */\n args?: unknown;\n status: 'pending' | 'success' | 'error';\n /** Set when status is 'error'. */\n error?: string;\n}\n\nexport interface AgentToolCallRecord {\n toolCallId: string;\n name: string;\n /** Raw args dict from the gateway; renderers stringify on demand. */\n args: unknown;\n status: 'running' | 'ok' | 'error';\n resultText?: string;\n startedAt?: number;\n endedAt?: number;\n}\n\nexport interface AgentMessage {\n id: string;\n role: AgentMessageRole;\n content: string;\n /** Command calls the assistant attempted in this message. */\n invocations?: AgentCommandInvocation[];\n /** Set on messages with role === 'tool'. */\n toolCall?: AgentToolCallRecord;\n /** ISO timestamp. */\n timestamp: string;\n}\n\n/**\n * Contract every agent-chat integration implements. The library does\n * not own state — callers wire their own LLM / tool-calling adapter and\n * pass the resulting value through `<AgentChatProvider value={...}>`.\n */\nexport interface AgentChatValue {\n messages: AgentMessage[];\n /** True while the assistant is generating a response. */\n sending: boolean;\n /** Send a user message. Host handles the LLM round-trip and state updates. */\n send: (content: string) => Promise<void> | void;\n /** Optional: clear the current thread. */\n clear?: () => void;\n /**\n * Optional: whether AegisShell's `agentPanel` is shown. Pass it with\n * `setPanelOpen` to own the state; leave it undefined and\n * <AgentChatProvider/> keeps it instead.\n */\n panelOpen?: boolean;\n /** Optional: open or close the agent panel (AegisShell's header toggle). */\n setPanelOpen?: (open: boolean) => void;\n}\n\nexport const defaultAgentChatValue: AgentChatValue = {\n messages: [],\n sending: false,\n send: () => undefined,\n};\n\nexport const AgentChatContext = createContext<AgentChatValue | null>(null);\n"],"names":["defaultAgentChatValue","AgentChatContext","createContext"],"mappings":";AA4DO,MAAMA,IAAwC;AAAA,EACnD,UAAU,CAAA;AAAA,EACV,SAAS;AAAA,EACT,MAAM,MAAA;AAAA;AACR,GAEaC,IAAmBC,EAAqC,IAAI;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("./chat.cjs");function n(){return e.useContext(t.AgentChatContext)??t.defaultAgentChatValue}function u(){return e.useContext(t.AgentChatContext)!==null}exports.useAgentChat=n;exports.useHasAgentChatProvider=u;
|
|
2
2
|
//# sourceMappingURL=useAgentChat.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAgentChat.cjs","sources":["../../../src/agent/chat/useAgentChat.ts"],"sourcesContent":["import { useContext } from 'react';\n\nimport {
|
|
1
|
+
{"version":3,"file":"useAgentChat.cjs","sources":["../../../src/agent/chat/useAgentChat.ts"],"sourcesContent":["import { useContext } from 'react';\n\nimport {\n AgentChatContext,\n type AgentChatValue,\n defaultAgentChatValue,\n} from './chat';\n\n/**\n * Read the current agent context. Returns the default empty state when\n * no `<AgentChatProvider>` is mounted, so render code does not have to\n * special-case \"agent not wired yet\".\n */\nexport function useAgentChat(): AgentChatValue {\n return useContext(AgentChatContext) ?? defaultAgentChatValue;\n}\n\n/** True when an `<AgentChatProvider>` is mounted above the caller. */\nexport function useHasAgentChatProvider(): boolean {\n return useContext(AgentChatContext) !== null;\n}\n"],"names":["useAgentChat","useContext","AgentChatContext","defaultAgentChatValue","useHasAgentChatProvider"],"mappings":"iIAaO,SAASA,GAA+B,CAC7C,OAAOC,EAAAA,WAAWC,EAAAA,gBAAgB,GAAKC,EAAAA,qBACzC,CAGO,SAASC,GAAmC,CACjD,OAAOH,EAAAA,WAAWC,EAAAA,gBAAgB,IAAM,IAC1C"}
|
|
@@ -5,3 +5,5 @@ import { AgentChatValue } from './chat';
|
|
|
5
5
|
* special-case "agent not wired yet".
|
|
6
6
|
*/
|
|
7
7
|
export declare function useAgentChat(): AgentChatValue;
|
|
8
|
+
/** True when an `<AgentChatProvider>` is mounted above the caller. */
|
|
9
|
+
export declare function useHasAgentChatProvider(): boolean;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { useContext as t } from "react";
|
|
2
|
-
import { AgentChatContext as e } from "./chat.js";
|
|
3
|
-
function
|
|
4
|
-
return t(e);
|
|
2
|
+
import { defaultAgentChatValue as n, AgentChatContext as e } from "./chat.js";
|
|
3
|
+
function u() {
|
|
4
|
+
return t(e) ?? n;
|
|
5
|
+
}
|
|
6
|
+
function a() {
|
|
7
|
+
return t(e) !== null;
|
|
5
8
|
}
|
|
6
9
|
export {
|
|
7
|
-
|
|
10
|
+
u as useAgentChat,
|
|
11
|
+
a as useHasAgentChatProvider
|
|
8
12
|
};
|
|
9
13
|
//# sourceMappingURL=useAgentChat.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAgentChat.js","sources":["../../../src/agent/chat/useAgentChat.ts"],"sourcesContent":["import { useContext } from 'react';\n\nimport {
|
|
1
|
+
{"version":3,"file":"useAgentChat.js","sources":["../../../src/agent/chat/useAgentChat.ts"],"sourcesContent":["import { useContext } from 'react';\n\nimport {\n AgentChatContext,\n type AgentChatValue,\n defaultAgentChatValue,\n} from './chat';\n\n/**\n * Read the current agent context. Returns the default empty state when\n * no `<AgentChatProvider>` is mounted, so render code does not have to\n * special-case \"agent not wired yet\".\n */\nexport function useAgentChat(): AgentChatValue {\n return useContext(AgentChatContext) ?? defaultAgentChatValue;\n}\n\n/** True when an `<AgentChatProvider>` is mounted above the caller. */\nexport function useHasAgentChatProvider(): boolean {\n return useContext(AgentChatContext) !== null;\n}\n"],"names":["useAgentChat","useContext","AgentChatContext","defaultAgentChatValue","useHasAgentChatProvider"],"mappings":";;AAaO,SAASA,IAA+B;AAC7C,SAAOC,EAAWC,CAAgB,KAAKC;AACzC;AAGO,SAASC,IAAmC;AACjD,SAAOH,EAAWC,CAAgB,MAAM;AAC1C;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AegisRuntimeProvider.cjs","sources":["../../../src/agent/core/AegisRuntimeProvider.tsx"],"sourcesContent":["import { type ReactNode, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { AegisRuntimeContext } from './aegisRuntimeContext';\nimport {\n type AegisRuntime,\n createAegisRuntime,\n defaultShellSnapshot,\n} from './runtime';\nimport type { ShellSnapshot } from './types';\n\ninterface
|
|
1
|
+
{"version":3,"file":"AegisRuntimeProvider.cjs","sources":["../../../src/agent/core/AegisRuntimeProvider.tsx"],"sourcesContent":["import { type ReactNode, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { AegisRuntimeContext } from './aegisRuntimeContext';\nimport {\n type AegisRuntime,\n createAegisRuntime,\n defaultShellSnapshot,\n} from './runtime';\nimport type { ShellSnapshot } from './types';\n\ninterface AegisRuntimeProviderProps {\n children: ReactNode;\n /**\n * A runtime the host created, for instance to connect it to the MCP\n * bridge with `connectAegisBridge` from `@lincyaw/aegis-ui/transports`.\n * Omitted, the provider creates its own.\n */\n runtime?: AegisRuntime;\n /** Current app id from the shell. Threaded into ActionSource for hooks. */\n appId?: string | null;\n /** Live shell snapshot getter — called on every snapshot() invocation. */\n shellSnapshot?: () => ShellSnapshot;\n /** Router navigate fn — wired into ActionContext.navigate + aegis.navigate. */\n navigate?: (to: string) => void;\n /** When true (default), mount the runtime on `window.__aegis`. */\n exposeOnWindow?: boolean;\n}\n\ndeclare global {\n interface Window {\n __aegis?: AegisRuntime;\n }\n}\n\n/**\n * Holds the agent runtime that primitives register their actions and\n * surfaces with. It does no I/O: transports that let an agent outside the\n * page reach the runtime live in `@lincyaw/aegis-ui/transports`.\n */\nexport function AegisRuntimeProvider({\n children,\n runtime: externalRuntime,\n appId = null,\n shellSnapshot,\n navigate,\n exposeOnWindow = true,\n}: AegisRuntimeProviderProps) {\n const [runtime] = useState<AegisRuntime>(\n () => externalRuntime ?? createAegisRuntime(),\n );\n\n const shellSnapshotRef = useRef(shellSnapshot);\n shellSnapshotRef.current = shellSnapshot;\n\n useEffect(() => {\n runtime._setShellSnapshot(() => {\n const getter = shellSnapshotRef.current;\n return getter?.() ?? defaultShellSnapshot(appId);\n });\n }, [runtime, appId]);\n\n useEffect(() => {\n if (navigate) {\n runtime._setNavigate(navigate);\n }\n }, [runtime, navigate]);\n\n useEffect(() => {\n if (!exposeOnWindow || typeof window === 'undefined') {\n return;\n }\n window.__aegis = runtime;\n return () => {\n if (window.__aegis === runtime) {\n delete window.__aegis;\n }\n };\n }, [runtime, exposeOnWindow]);\n\n const value = useMemo(() => ({ runtime, appId }), [runtime, appId]);\n\n return (\n <AegisRuntimeContext.Provider value={value}>\n {children}\n </AegisRuntimeContext.Provider>\n );\n}\n"],"names":["AegisRuntimeProvider","children","externalRuntime","appId","shellSnapshot","navigate","exposeOnWindow","runtime","useState","createAegisRuntime","shellSnapshotRef","useRef","useEffect","getter","defaultShellSnapshot","value","useMemo","jsx","AegisRuntimeContext"],"mappings":"0MAuCO,SAASA,EAAqB,CACnC,SAAAC,EACA,QAASC,EACT,MAAAC,EAAQ,KACR,cAAAC,EACA,SAAAC,EACA,eAAAC,EAAiB,EACnB,EAA8B,CAC5B,KAAM,CAACC,CAAO,EAAIC,EAAAA,SAChB,IAAMN,GAAmBO,EAAAA,mBAAA,CAAmB,EAGxCC,EAAmBC,EAAAA,OAAOP,CAAa,EAC7CM,EAAiB,QAAUN,EAE3BQ,EAAAA,UAAU,IAAM,CACdL,EAAQ,kBAAkB,IAAM,CAC9B,MAAMM,EAASH,EAAiB,QAChC,OAAOG,IAAA,GAAcC,EAAAA,qBAAqBX,CAAK,CACjD,CAAC,CACH,EAAG,CAACI,EAASJ,CAAK,CAAC,EAEnBS,EAAAA,UAAU,IAAM,CACVP,GACFE,EAAQ,aAAaF,CAAQ,CAEjC,EAAG,CAACE,EAASF,CAAQ,CAAC,EAEtBO,EAAAA,UAAU,IAAM,CACd,GAAI,GAACN,GAAkB,OAAO,OAAW,KAGzC,cAAO,QAAUC,EACV,IAAM,CACP,OAAO,UAAYA,GACrB,OAAO,OAAO,OAElB,CACF,EAAG,CAACA,EAASD,CAAc,CAAC,EAE5B,MAAMS,EAAQC,UAAQ,KAAO,SAAET,EAAS,MAAAJ,IAAU,CAACI,EAASJ,CAAK,CAAC,EAElE,OACEc,EAAAA,IAACC,EAAAA,oBAAoB,SAApB,CAA6B,MAAAH,EAC3B,SAAAd,CAAA,CACH,CAEJ"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { AegisRuntime } from './runtime';
|
|
3
3
|
import { ShellSnapshot } from './types';
|
|
4
|
-
interface
|
|
4
|
+
interface AegisRuntimeProviderProps {
|
|
5
5
|
children: ReactNode;
|
|
6
6
|
/**
|
|
7
7
|
* A runtime the host created, for instance to connect it to the MCP
|
|
@@ -28,5 +28,5 @@ declare global {
|
|
|
28
28
|
* surfaces with. It does no I/O: transports that let an agent outside the
|
|
29
29
|
* page reach the runtime live in `@lincyaw/aegis-ui/transports`.
|
|
30
30
|
*/
|
|
31
|
-
export declare function AegisRuntimeProvider({ children, runtime: externalRuntime, appId, shellSnapshot, navigate, exposeOnWindow, }:
|
|
31
|
+
export declare function AegisRuntimeProvider({ children, runtime: externalRuntime, appId, shellSnapshot, navigate, exposeOnWindow, }: AegisRuntimeProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
32
32
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AegisRuntimeProvider.js","sources":["../../../src/agent/core/AegisRuntimeProvider.tsx"],"sourcesContent":["import { type ReactNode, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { AegisRuntimeContext } from './aegisRuntimeContext';\nimport {\n type AegisRuntime,\n createAegisRuntime,\n defaultShellSnapshot,\n} from './runtime';\nimport type { ShellSnapshot } from './types';\n\ninterface
|
|
1
|
+
{"version":3,"file":"AegisRuntimeProvider.js","sources":["../../../src/agent/core/AegisRuntimeProvider.tsx"],"sourcesContent":["import { type ReactNode, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { AegisRuntimeContext } from './aegisRuntimeContext';\nimport {\n type AegisRuntime,\n createAegisRuntime,\n defaultShellSnapshot,\n} from './runtime';\nimport type { ShellSnapshot } from './types';\n\ninterface AegisRuntimeProviderProps {\n children: ReactNode;\n /**\n * A runtime the host created, for instance to connect it to the MCP\n * bridge with `connectAegisBridge` from `@lincyaw/aegis-ui/transports`.\n * Omitted, the provider creates its own.\n */\n runtime?: AegisRuntime;\n /** Current app id from the shell. Threaded into ActionSource for hooks. */\n appId?: string | null;\n /** Live shell snapshot getter — called on every snapshot() invocation. */\n shellSnapshot?: () => ShellSnapshot;\n /** Router navigate fn — wired into ActionContext.navigate + aegis.navigate. */\n navigate?: (to: string) => void;\n /** When true (default), mount the runtime on `window.__aegis`. */\n exposeOnWindow?: boolean;\n}\n\ndeclare global {\n interface Window {\n __aegis?: AegisRuntime;\n }\n}\n\n/**\n * Holds the agent runtime that primitives register their actions and\n * surfaces with. It does no I/O: transports that let an agent outside the\n * page reach the runtime live in `@lincyaw/aegis-ui/transports`.\n */\nexport function AegisRuntimeProvider({\n children,\n runtime: externalRuntime,\n appId = null,\n shellSnapshot,\n navigate,\n exposeOnWindow = true,\n}: AegisRuntimeProviderProps) {\n const [runtime] = useState<AegisRuntime>(\n () => externalRuntime ?? createAegisRuntime(),\n );\n\n const shellSnapshotRef = useRef(shellSnapshot);\n shellSnapshotRef.current = shellSnapshot;\n\n useEffect(() => {\n runtime._setShellSnapshot(() => {\n const getter = shellSnapshotRef.current;\n return getter?.() ?? defaultShellSnapshot(appId);\n });\n }, [runtime, appId]);\n\n useEffect(() => {\n if (navigate) {\n runtime._setNavigate(navigate);\n }\n }, [runtime, navigate]);\n\n useEffect(() => {\n if (!exposeOnWindow || typeof window === 'undefined') {\n return;\n }\n window.__aegis = runtime;\n return () => {\n if (window.__aegis === runtime) {\n delete window.__aegis;\n }\n };\n }, [runtime, exposeOnWindow]);\n\n const value = useMemo(() => ({ runtime, appId }), [runtime, appId]);\n\n return (\n <AegisRuntimeContext.Provider value={value}>\n {children}\n </AegisRuntimeContext.Provider>\n );\n}\n"],"names":["AegisRuntimeProvider","children","externalRuntime","appId","shellSnapshot","navigate","exposeOnWindow","runtime","useState","createAegisRuntime","shellSnapshotRef","useRef","useEffect","getter","defaultShellSnapshot","value","useMemo","jsx","AegisRuntimeContext"],"mappings":";;;;AAuCO,SAASA,EAAqB;AAAA,EACnC,UAAAC;AAAA,EACA,SAASC;AAAA,EACT,OAAAC,IAAQ;AAAA,EACR,eAAAC;AAAA,EACA,UAAAC;AAAA,EACA,gBAAAC,IAAiB;AACnB,GAA8B;AAC5B,QAAM,CAACC,CAAO,IAAIC;AAAA,IAChB,MAAMN,KAAmBO,EAAA;AAAA,EAAmB,GAGxCC,IAAmBC,EAAOP,CAAa;AAC7C,EAAAM,EAAiB,UAAUN,GAE3BQ,EAAU,MAAM;AACd,IAAAL,EAAQ,kBAAkB,MAAM;AAC9B,YAAMM,IAASH,EAAiB;AAChC,aAAOG,IAAA,KAAcC,EAAqBX,CAAK;AAAA,IACjD,CAAC;AAAA,EACH,GAAG,CAACI,GAASJ,CAAK,CAAC,GAEnBS,EAAU,MAAM;AACd,IAAIP,KACFE,EAAQ,aAAaF,CAAQ;AAAA,EAEjC,GAAG,CAACE,GAASF,CAAQ,CAAC,GAEtBO,EAAU,MAAM;AACd,QAAI,GAACN,KAAkB,OAAO,SAAW;AAGzC,oBAAO,UAAUC,GACV,MAAM;AACX,QAAI,OAAO,YAAYA,KACrB,OAAO,OAAO;AAAA,MAElB;AAAA,EACF,GAAG,CAACA,GAASD,CAAc,CAAC;AAE5B,QAAMS,IAAQC,EAAQ,OAAO,EAAE,SAAAT,GAAS,OAAAJ,MAAU,CAACI,GAASJ,CAAK,CAAC;AAElE,SACE,gBAAAc,EAACC,EAAoB,UAApB,EAA6B,OAAAH,GAC3B,UAAAd,EAAA,CACH;AAEJ;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react"),a=require("./aegisRuntimeContext.cjs");function f(e){const t=r.useContext(a.AegisRuntimeContext),i=r.useRef(e);i.current=e,r.useEffect(()=>{if(!t||!e)return;const u=t.appId??"unknown";return t.runtime._register({action:e,source:{kind:"component",appId:u,nodeId:e.id}})},[t,e]);const c=r.useCallback(async u=>{const s=i.current;if(!t||!s)throw new Error("useAegisAction.invoke called without an AegisRuntimeProvider or action");const o=await t.runtime.dispatch(s.id,u,{by:"user"});if(!o.ok)throw new Error(o.error.message);return o.result},[t]);return r.useMemo(()=>({invoke:c,available:!!(t&&e)}),[c,t,e])}function l(e){const t=r.useContext(a.AegisRuntimeContext),i=r.useRef(e.data);i.current=e.data;const c=r.useRef(e.project);c.current=e.project;const{ref:u,enabled:s=!0}=e,o=r.useRef(u);return o.current=u,r.useEffect(()=>{if(!t||!s)return;const g=t.appId??"unknown",d=()=>o.current?.current?.getBoundingClientRect();return t.runtime._registerSurface({id:e.id,kind:e.kind,appId:g,label:e.label,askSuggestions:e.askSuggestions,getProjection:()=>c.current(i.current),getBBox:()=>{const n=d();return n&&{x:n.x,y:n.y,width:n.width,height:n.height}},getInViewport:()=>{const n=d();return!n||n.bottom>0&&n.right>0&&n.top<window.innerHeight&&n.left<window.innerWidth}})},[t,s,e.id,e.kind,e.label,e.askSuggestions]),{surfaceId:e.id}}function h(e){const t=r.useContext(a.AegisRuntimeContext),i=r.useRef(e);i.current=e,r.useEffect(()=>{if(!t)return;const c={id:e.id,appId:e.appId,kinds:e.kinds,matches:u=>i.current.matches?.(u)??!0,search:(u,s)=>i.current.search(u,s)};return t.runtime._registerSearchProvider(c)},[t,e.id,e.appId,e.kinds])}exports.useAegisAction=f;exports.useAegisSearchProvider=h;exports.useAegisSurface=l;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react"),a=require("./aegisRuntimeContext.cjs");function f(e){const t=r.useContext(a.AegisRuntimeContext),i=r.useRef(e);i.current=e,r.useEffect(()=>{if(!t||!e)return;const u=t.appId??"unknown";return t.runtime._register({action:e,source:{kind:"component",appId:u,nodeId:e.id}})},[t,e]);const c=r.useCallback(async u=>{const s=i.current;if(!t||!s)throw new Error("useAegisAction.invoke called without an AegisRuntimeProvider or action");const o=await t.runtime.dispatch(s.id,u,{by:"user"});if(!o.ok)throw new Error(o.error.message);return o.result},[t]);return r.useMemo(()=>({invoke:c,available:!!(t&&e)}),[c,t,e])}function l(e){const t=r.useContext(a.AegisRuntimeContext),i=r.useRef(e.data);i.current=e.data;const c=r.useRef(e.project);c.current=e.project;const{ref:u,enabled:s=!0}=e,o=r.useRef(u);return o.current=u,r.useEffect(()=>{if(!t||!s)return;const g=t.appId??"unknown",d=()=>o.current?.current?.getBoundingClientRect();return t.runtime._registerSurface({id:e.id,kind:e.kind,appId:g,label:e.label,askSuggestions:e.askSuggestions,getProjection:()=>c.current(i.current),getElement:()=>o.current?.current??null,getBBox:()=>{const n=d();return n&&{x:n.x,y:n.y,width:n.width,height:n.height}},getInViewport:()=>{const n=d();return!n||n.bottom>0&&n.right>0&&n.top<window.innerHeight&&n.left<window.innerWidth}})},[t,s,e.id,e.kind,e.label,e.askSuggestions]),{surfaceId:e.id}}function h(e){const t=r.useContext(a.AegisRuntimeContext),i=r.useRef(e);i.current=e,r.useEffect(()=>{if(!t)return;const c={id:e.id,appId:e.appId,kinds:e.kinds,matches:u=>i.current.matches?.(u)??!0,search:(u,s)=>i.current.search(u,s)};return t.runtime._registerSearchProvider(c)},[t,e.id,e.appId,e.kinds])}exports.useAegisAction=f;exports.useAegisSearchProvider=h;exports.useAegisSurface=l;
|
|
2
2
|
//# sourceMappingURL=hooks.cjs.map
|