@lincyaw/aegis-ui 0.9.3 → 0.10.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 +13 -3
- package/dist/agent/ask/AskPanel.js +130 -109
- 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 +2 -5
- 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/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/BlastRadiusBar.cjs +1 -1
- package/dist/components/ui/BlastRadiusBar.cjs.map +1 -1
- package/dist/components/ui/BlastRadiusBar.d.ts +3 -1
- package/dist/components/ui/BlastRadiusBar.js +20 -17
- 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 +3 -3
- 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 +127 -150
- 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 +3 -1
- package/dist/components/ui/Checkbox.js +19 -17
- 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 +25 -0
- package/dist/components/ui/ChoiceCardGroup.js +44 -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 +5 -4
- package/dist/components/ui/CodeEditor.js +210 -63
- 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 +29 -26
- 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/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 +145 -120
- 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 +77 -0
- package/dist/components/ui/CommitGraph.js +380 -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 +40 -193
- 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 +134 -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/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 +87 -32
- 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 +66 -50
- package/dist/components/ui/DropdownMenu.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 +190 -164
- 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 +41 -64
- 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 +45 -42
- 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 +108 -128
- 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 +21 -19
- 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 +10 -1
- package/dist/components/ui/FormRow.js +22 -11
- 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 +16 -2
- package/dist/components/ui/InboxPage.js +54 -52
- 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 +56 -48
- 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 +8 -1
- package/dist/components/ui/MonoValue.js +15 -13
- 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 +15 -3
- package/dist/components/ui/NotificationBell.js +41 -39
- 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 +32 -0
- package/dist/components/ui/NumberField.js +77 -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 +38 -30
- 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.map +1 -1
- package/dist/components/ui/PageSizeSelect.d.ts +3 -4
- 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 +12 -2
- 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 +124 -118
- package/dist/components/ui/ParquetViewer.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 +9 -9
- 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.js +123 -107
- 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 +46 -38
- package/dist/components/ui/RegisterForm.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 +8 -2
- package/dist/components/ui/SavedQueryBar.js +162 -161
- 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/Select.cjs +1 -1
- package/dist/components/ui/Select.cjs.map +1 -1
- package/dist/components/ui/Select.d.ts +1 -1
- package/dist/components/ui/Select.js +33 -32
- 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 +51 -2
- package/dist/components/ui/ServiceMap.js +314 -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 +22 -0
- package/dist/components/ui/Slider.js +53 -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 +30 -25
- 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 +57 -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/TextField.cjs +1 -1
- package/dist/components/ui/TextField.cjs.map +1 -1
- package/dist/components/ui/TextField.js +16 -15
- package/dist/components/ui/TextField.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/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 +93 -72
- 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 +56 -63
- 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 +9 -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 +39 -0
- package/dist/components/ui/classifyContent.js +169 -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/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/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/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 +49 -58
- 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 +4 -4
- 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 +149 -242
- 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/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 +23 -0
- package/dist/layouts/shell/RouteErrorBoundary.js +35 -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 +32 -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 +24 -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 +77 -65
- 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 +21 -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/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.js +4 -1
- 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 +2 -0
- package/dist/locale/strings.js +2 -0
- package/dist/locale/strings.js.map +1 -1
- package/dist/notifications/notificationContext.cjs.map +1 -1
- package/dist/notifications/notificationContext.d.ts +5 -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 +26 -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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sources":["../../../../src/layouts/shell/environments/context.ts"],"sourcesContent":["import { createContext } from 'react';\n\nimport type { EnvironmentManifestStatus } from './types';\n\nexport interface AppEnvironmentContextValue {\n appId: string;\n state: EnvironmentManifestStatus;\n}\n\nexport const AppEnvironmentContext =\n createContext<AppEnvironmentContextValue | null>(null);\n"],"names":["AppEnvironmentContext","createContext"],"mappings":";AASO,MAAMA,IACXC,EAAiD,IAAI;"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),n=require("./context.cjs");function r(){const t=e.useContext(n.AppEnvironmentContext);if(!t)return null;switch(t.state.status){case"ready":return t.state.currentEnv;case"unsupported":return t.state.currentEnv;default:return null}}function u(){const t=e.useContext(n.AppEnvironmentContext);return t?t.state:{status:"idle"}}exports.useCurrentEnvironment=r;exports.useEnvironmentManifest=u;
|
|
2
|
-
//# sourceMappingURL=hooks.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.cjs","sources":["../../../../src/layouts/shell/environments/hooks.ts"],"sourcesContent":["import { useContext } from 'react';\n\nimport { AppEnvironmentContext } from './context';\nimport type { EnvironmentDescriptor, EnvironmentManifestStatus } from './types';\n\n/**\n * Read the active app's current environment selection. Returns `null` when\n * no app is active or the manifest is still loading without a fallback.\n */\nexport function useCurrentEnvironment(): EnvironmentDescriptor | null {\n const ctx = useContext(AppEnvironmentContext);\n if (!ctx) {\n return null;\n }\n switch (ctx.state.status) {\n case 'ready':\n return ctx.state.currentEnv;\n case 'unsupported':\n return ctx.state.currentEnv;\n default:\n return null;\n }\n}\n\n/** Read the full status object — useful for the switcher itself. */\nexport function useEnvironmentManifest(): EnvironmentManifestStatus {\n const ctx = useContext(AppEnvironmentContext);\n if (!ctx) {\n return { status: 'idle' };\n }\n return ctx.state;\n}\n"],"names":["useCurrentEnvironment","ctx","useContext","AppEnvironmentContext","useEnvironmentManifest"],"mappings":"oIASO,SAASA,GAAsD,CACpE,MAAMC,EAAMC,EAAAA,WAAWC,uBAAqB,EAC5C,GAAI,CAACF,EACH,OAAO,KAET,OAAQA,EAAI,MAAM,OAAA,CAChB,IAAK,QACH,OAAOA,EAAI,MAAM,WACnB,IAAK,cACH,OAAOA,EAAI,MAAM,WACnB,QACE,OAAO,IAAA,CAEb,CAGO,SAASG,GAAoD,CAClE,MAAMH,EAAMC,EAAAA,WAAWC,uBAAqB,EAC5C,OAAKF,EAGEA,EAAI,MAFF,CAAE,OAAQ,MAAA,CAGrB"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { useContext as n } from "react";
|
|
2
|
-
import { AppEnvironmentContext as e } from "./context.js";
|
|
3
|
-
function s() {
|
|
4
|
-
const t = n(e);
|
|
5
|
-
if (!t)
|
|
6
|
-
return null;
|
|
7
|
-
switch (t.state.status) {
|
|
8
|
-
case "ready":
|
|
9
|
-
return t.state.currentEnv;
|
|
10
|
-
case "unsupported":
|
|
11
|
-
return t.state.currentEnv;
|
|
12
|
-
default:
|
|
13
|
-
return null;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
function o() {
|
|
17
|
-
const t = n(e);
|
|
18
|
-
return t ? t.state : { status: "idle" };
|
|
19
|
-
}
|
|
20
|
-
export {
|
|
21
|
-
s as useCurrentEnvironment,
|
|
22
|
-
o as useEnvironmentManifest
|
|
23
|
-
};
|
|
24
|
-
//# sourceMappingURL=hooks.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.js","sources":["../../../../src/layouts/shell/environments/hooks.ts"],"sourcesContent":["import { useContext } from 'react';\n\nimport { AppEnvironmentContext } from './context';\nimport type { EnvironmentDescriptor, EnvironmentManifestStatus } from './types';\n\n/**\n * Read the active app's current environment selection. Returns `null` when\n * no app is active or the manifest is still loading without a fallback.\n */\nexport function useCurrentEnvironment(): EnvironmentDescriptor | null {\n const ctx = useContext(AppEnvironmentContext);\n if (!ctx) {\n return null;\n }\n switch (ctx.state.status) {\n case 'ready':\n return ctx.state.currentEnv;\n case 'unsupported':\n return ctx.state.currentEnv;\n default:\n return null;\n }\n}\n\n/** Read the full status object — useful for the switcher itself. */\nexport function useEnvironmentManifest(): EnvironmentManifestStatus {\n const ctx = useContext(AppEnvironmentContext);\n if (!ctx) {\n return { status: 'idle' };\n }\n return ctx.state;\n}\n"],"names":["useCurrentEnvironment","ctx","useContext","AppEnvironmentContext","useEnvironmentManifest"],"mappings":";;AASO,SAASA,IAAsD;AACpE,QAAMC,IAAMC,EAAWC,CAAqB;AAC5C,MAAI,CAACF;AACH,WAAO;AAET,UAAQA,EAAI,MAAM,QAAA;AAAA,IAChB,KAAK;AACH,aAAOA,EAAI,MAAM;AAAA,IACnB,KAAK;AACH,aAAOA,EAAI,MAAM;AAAA,IACnB;AACE,aAAO;AAAA,EAAA;AAEb;AAGO,SAASG,IAAoD;AAClE,QAAMH,IAAMC,EAAWC,CAAqB;AAC5C,SAAKF,IAGEA,EAAI,QAFF,EAAE,QAAQ,OAAA;AAGrB;"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=new Set(["default","info","warning","danger"]),b=5*60*1e3,s=new Map,f=new Map;function u(a,e){const r=a.replace(/\/+$/,""),t=e.startsWith("/")?e:`/${e}`;return`${r}${t}`}function g(a){if(!a||typeof a!="object")return null;const e=a;if(typeof e.default!="string"||e.default.length===0||!Array.isArray(e.environments)||e.environments.length===0)return null;const r=[];for(const t of e.environments){if(!t||typeof t!="object")return null;const n=t;if(typeof n.id!="string"||n.id.length===0||typeof n.label!="string"||n.label.length===0||typeof n.baseUrl!="string"||n.baseUrl.length===0)return null;let l;if(n.badge!==void 0){if(typeof n.badge!="string"||!h.has(n.badge))return null;l=n.badge}r.push({id:n.id,label:n.label,baseUrl:n.baseUrl,badge:l})}return r.some(t=>t.id===e.default)?{default:e.default,environments:r}:null}async function m(a){const e=u(a.apiBaseUrl,a.discoveryPath),r=Date.now(),t=s.get(e);if(!a.force&&t&&r-t.fetchedAt<b)return t.manifest;const n=f.get(e);if(n)return n;const l={Accept:"application/json"};t?.etag&&(l["If-None-Match"]=t.etag);const o=(async()=>{try{const i=await fetch(e,{headers:l,signal:a.signal,credentials:"omit"});if(i.status===304&&t)return s.set(e,{...t,fetchedAt:r}),t.manifest;if(!i.ok)return null;const d=await i.json(),c=g(d);return c?(s.set(e,{fetchedAt:r,manifest:c,etag:i.headers.get("ETag")}),c):null}catch{return null}finally{f.delete(e)}})();return f.set(e,o),o}function y(){s.clear(),f.clear()}exports.clearManifestCache=y;exports.fetchManifest=m;exports.manifestUrl=u;exports.validateManifest=g;
|
|
2
|
-
//# sourceMappingURL=manifest.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.cjs","sources":["../../../../src/layouts/shell/environments/manifest.ts"],"sourcesContent":["import type {\n EnvironmentBadge,\n EnvironmentDescriptor,\n EnvironmentManifest,\n} from './types';\n\nconst VALID_BADGES: ReadonlySet<EnvironmentBadge> = new Set([\n 'default',\n 'info',\n 'warning',\n 'danger',\n]);\n\ninterface CacheEntry {\n fetchedAt: number;\n manifest: EnvironmentManifest;\n etag: string | null;\n}\n\nconst TTL_MS = 5 * 60 * 1000;\nconst cache = new Map<string, CacheEntry>();\nconst inflight = new Map<string, Promise<EnvironmentManifest | null>>();\n\nexport interface ManifestFetchOptions {\n apiBaseUrl: string;\n discoveryPath: string;\n signal?: AbortSignal;\n /** Skip cache + force a network round-trip (revalidates with ETag if known). */\n force?: boolean;\n}\n\n/** Compose the URL the way the spec describes. Tolerates trailing slashes. */\nexport function manifestUrl(apiBaseUrl: string, discoveryPath: string): string {\n const base = apiBaseUrl.replace(/\\/+$/, '');\n const path = discoveryPath.startsWith('/')\n ? discoveryPath\n : `/${discoveryPath}`;\n return `${base}${path}`;\n}\n\n/**\n * Validate manifest shape. Returns the parsed manifest on success, `null`\n * when the payload is malformed. Does not throw — schema mismatch is a\n * silent unsupported state per the design.\n */\nexport function validateManifest(input: unknown): EnvironmentManifest | null {\n if (!input || typeof input !== 'object') {\n return null;\n }\n const raw = input as Record<string, unknown>;\n if (typeof raw.default !== 'string' || raw.default.length === 0) {\n return null;\n }\n if (!Array.isArray(raw.environments) || raw.environments.length === 0) {\n return null;\n }\n const environments: EnvironmentDescriptor[] = [];\n for (const item of raw.environments) {\n if (!item || typeof item !== 'object') {\n return null;\n }\n const env = item as Record<string, unknown>;\n if (typeof env.id !== 'string' || env.id.length === 0) {\n return null;\n }\n if (typeof env.label !== 'string' || env.label.length === 0) {\n return null;\n }\n if (typeof env.baseUrl !== 'string' || env.baseUrl.length === 0) {\n return null;\n }\n let badge: EnvironmentBadge | undefined;\n if (env.badge !== undefined) {\n if (\n typeof env.badge !== 'string' ||\n !VALID_BADGES.has(env.badge as EnvironmentBadge)\n ) {\n return null;\n }\n badge = env.badge as EnvironmentBadge;\n }\n environments.push({\n id: env.id,\n label: env.label,\n baseUrl: env.baseUrl,\n badge,\n });\n }\n if (!environments.some((e) => e.id === raw.default)) {\n return null;\n }\n return { default: raw.default, environments };\n}\n\n/**\n * Fetch + cache a manifest. Resolves to the manifest on 2xx with a valid\n * payload, `null` on 404 / network error / schema mismatch.\n *\n * Errors are intentionally swallowed — the design makes manifest absence\n * a normal mode, not a failure.\n */\nexport async function fetchManifest(\n opts: ManifestFetchOptions,\n): Promise<EnvironmentManifest | null> {\n const url = manifestUrl(opts.apiBaseUrl, opts.discoveryPath);\n const now = Date.now();\n const cached = cache.get(url);\n if (!opts.force && cached && now - cached.fetchedAt < TTL_MS) {\n return cached.manifest;\n }\n\n const existing = inflight.get(url);\n if (existing) {\n return existing;\n }\n\n const headers: Record<string, string> = { Accept: 'application/json' };\n if (cached?.etag) {\n headers['If-None-Match'] = cached.etag;\n }\n\n const promise = (async (): Promise<EnvironmentManifest | null> => {\n try {\n const res = await fetch(url, {\n headers,\n signal: opts.signal,\n credentials: 'omit',\n });\n if (res.status === 304 && cached) {\n cache.set(url, { ...cached, fetchedAt: now });\n return cached.manifest;\n }\n if (!res.ok) {\n return null;\n }\n const json: unknown = await res.json();\n const manifest = validateManifest(json);\n if (!manifest) {\n return null;\n }\n cache.set(url, {\n fetchedAt: now,\n manifest,\n etag: res.headers.get('ETag'),\n });\n return manifest;\n } catch {\n return null;\n } finally {\n inflight.delete(url);\n }\n })();\n\n inflight.set(url, promise);\n return promise;\n}\n\n/** Test helper — exported so unit tests / specimens can reset state. */\nexport function clearManifestCache(): void {\n cache.clear();\n inflight.clear();\n}\n"],"names":["VALID_BADGES","TTL_MS","cache","inflight","manifestUrl","apiBaseUrl","discoveryPath","base","path","validateManifest","input","raw","environments","item","env","badge","e","fetchManifest","opts","url","now","cached","existing","headers","promise","res","json","manifest","clearManifestCache"],"mappings":"gFAMA,MAAMA,MAAkD,IAAI,CAC1D,UACA,OACA,UACA,QACF,CAAC,EAQKC,EAAS,EAAI,GAAK,IAClBC,MAAY,IACZC,MAAe,IAWd,SAASC,EAAYC,EAAoBC,EAA+B,CAC7E,MAAMC,EAAOF,EAAW,QAAQ,OAAQ,EAAE,EACpCG,EAAOF,EAAc,WAAW,GAAG,EACrCA,EACA,IAAIA,CAAa,GACrB,MAAO,GAAGC,CAAI,GAAGC,CAAI,EACvB,CAOO,SAASC,EAAiBC,EAA4C,CAC3E,GAAI,CAACA,GAAS,OAAOA,GAAU,SAC7B,OAAO,KAET,MAAMC,EAAMD,EAIZ,GAHI,OAAOC,EAAI,SAAY,UAAYA,EAAI,QAAQ,SAAW,GAG1D,CAAC,MAAM,QAAQA,EAAI,YAAY,GAAKA,EAAI,aAAa,SAAW,EAClE,OAAO,KAET,MAAMC,EAAwC,CAAA,EAC9C,UAAWC,KAAQF,EAAI,aAAc,CACnC,GAAI,CAACE,GAAQ,OAAOA,GAAS,SAC3B,OAAO,KAET,MAAMC,EAAMD,EAOZ,GANI,OAAOC,EAAI,IAAO,UAAYA,EAAI,GAAG,SAAW,GAGhD,OAAOA,EAAI,OAAU,UAAYA,EAAI,MAAM,SAAW,GAGtD,OAAOA,EAAI,SAAY,UAAYA,EAAI,QAAQ,SAAW,EAC5D,OAAO,KAET,IAAIC,EACJ,GAAID,EAAI,QAAU,OAAW,CAC3B,GACE,OAAOA,EAAI,OAAU,UACrB,CAACd,EAAa,IAAIc,EAAI,KAAyB,EAE/C,OAAO,KAETC,EAAQD,EAAI,KACd,CACAF,EAAa,KAAK,CAChB,GAAIE,EAAI,GACR,MAAOA,E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 +0,0 @@
|
|
|
1
|
-
import { EnvironmentManifest } from './types';
|
|
2
|
-
export interface ManifestFetchOptions {
|
|
3
|
-
apiBaseUrl: string;
|
|
4
|
-
discoveryPath: string;
|
|
5
|
-
signal?: AbortSignal;
|
|
6
|
-
/** Skip cache + force a network round-trip (revalidates with ETag if known). */
|
|
7
|
-
force?: boolean;
|
|
8
|
-
}
|
|
9
|
-
/** Compose the URL the way the spec describes. Tolerates trailing slashes. */
|
|
10
|
-
export declare function manifestUrl(apiBaseUrl: string, discoveryPath: string): string;
|
|
11
|
-
/**
|
|
12
|
-
* Validate manifest shape. Returns the parsed manifest on success, `null`
|
|
13
|
-
* when the payload is malformed. Does not throw — schema mismatch is a
|
|
14
|
-
* silent unsupported state per the design.
|
|
15
|
-
*/
|
|
16
|
-
export declare function validateManifest(input: unknown): EnvironmentManifest | null;
|
|
17
|
-
/**
|
|
18
|
-
* Fetch + cache a manifest. Resolves to the manifest on 2xx with a valid
|
|
19
|
-
* payload, `null` on 404 / network error / schema mismatch.
|
|
20
|
-
*
|
|
21
|
-
* Errors are intentionally swallowed — the design makes manifest absence
|
|
22
|
-
* a normal mode, not a failure.
|
|
23
|
-
*/
|
|
24
|
-
export declare function fetchManifest(opts: ManifestFetchOptions): Promise<EnvironmentManifest | null>;
|
|
25
|
-
/** Test helper — exported so unit tests / specimens can reset state. */
|
|
26
|
-
export declare function clearManifestCache(): void;
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
const g = /* @__PURE__ */ new Set([
|
|
2
|
-
"default",
|
|
3
|
-
"info",
|
|
4
|
-
"warning",
|
|
5
|
-
"danger"
|
|
6
|
-
]), d = 5 * 60 * 1e3, i = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map();
|
|
7
|
-
function h(r, e) {
|
|
8
|
-
const a = r.replace(/\/+$/, ""), t = e.startsWith("/") ? e : `/${e}`;
|
|
9
|
-
return `${a}${t}`;
|
|
10
|
-
}
|
|
11
|
-
function b(r) {
|
|
12
|
-
if (!r || typeof r != "object")
|
|
13
|
-
return null;
|
|
14
|
-
const e = r;
|
|
15
|
-
if (typeof e.default != "string" || e.default.length === 0 || !Array.isArray(e.environments) || e.environments.length === 0)
|
|
16
|
-
return null;
|
|
17
|
-
const a = [];
|
|
18
|
-
for (const t of e.environments) {
|
|
19
|
-
if (!t || typeof t != "object")
|
|
20
|
-
return null;
|
|
21
|
-
const n = t;
|
|
22
|
-
if (typeof n.id != "string" || n.id.length === 0 || typeof n.label != "string" || n.label.length === 0 || typeof n.baseUrl != "string" || n.baseUrl.length === 0)
|
|
23
|
-
return null;
|
|
24
|
-
let l;
|
|
25
|
-
if (n.badge !== void 0) {
|
|
26
|
-
if (typeof n.badge != "string" || !g.has(n.badge))
|
|
27
|
-
return null;
|
|
28
|
-
l = n.badge;
|
|
29
|
-
}
|
|
30
|
-
a.push({
|
|
31
|
-
id: n.id,
|
|
32
|
-
label: n.label,
|
|
33
|
-
baseUrl: n.baseUrl,
|
|
34
|
-
badge: l
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
return a.some((t) => t.id === e.default) ? { default: e.default, environments: a } : null;
|
|
38
|
-
}
|
|
39
|
-
async function p(r) {
|
|
40
|
-
const e = h(r.apiBaseUrl, r.discoveryPath), a = Date.now(), t = i.get(e);
|
|
41
|
-
if (!r.force && t && a - t.fetchedAt < d)
|
|
42
|
-
return t.manifest;
|
|
43
|
-
const n = f.get(e);
|
|
44
|
-
if (n)
|
|
45
|
-
return n;
|
|
46
|
-
const l = { Accept: "application/json" };
|
|
47
|
-
t?.etag && (l["If-None-Match"] = t.etag);
|
|
48
|
-
const c = (async () => {
|
|
49
|
-
try {
|
|
50
|
-
const s = await fetch(e, {
|
|
51
|
-
headers: l,
|
|
52
|
-
signal: r.signal,
|
|
53
|
-
credentials: "omit"
|
|
54
|
-
});
|
|
55
|
-
if (s.status === 304 && t)
|
|
56
|
-
return i.set(e, { ...t, fetchedAt: a }), t.manifest;
|
|
57
|
-
if (!s.ok)
|
|
58
|
-
return null;
|
|
59
|
-
const u = await s.json(), o = b(u);
|
|
60
|
-
return o ? (i.set(e, {
|
|
61
|
-
fetchedAt: a,
|
|
62
|
-
manifest: o,
|
|
63
|
-
etag: s.headers.get("ETag")
|
|
64
|
-
}), o) : null;
|
|
65
|
-
} catch {
|
|
66
|
-
return null;
|
|
67
|
-
} finally {
|
|
68
|
-
f.delete(e);
|
|
69
|
-
}
|
|
70
|
-
})();
|
|
71
|
-
return f.set(e, c), c;
|
|
72
|
-
}
|
|
73
|
-
function m() {
|
|
74
|
-
i.clear(), f.clear();
|
|
75
|
-
}
|
|
76
|
-
export {
|
|
77
|
-
m as clearManifestCache,
|
|
78
|
-
p as fetchManifest,
|
|
79
|
-
h as manifestUrl,
|
|
80
|
-
b as validateManifest
|
|
81
|
-
};
|
|
82
|
-
//# sourceMappingURL=manifest.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.js","sources":["../../../../src/layouts/shell/environments/manifest.ts"],"sourcesContent":["import type {\n EnvironmentBadge,\n EnvironmentDescriptor,\n EnvironmentManifest,\n} from './types';\n\nconst VALID_BADGES: ReadonlySet<EnvironmentBadge> = new Set([\n 'default',\n 'info',\n 'warning',\n 'danger',\n]);\n\ninterface CacheEntry {\n fetchedAt: number;\n manifest: EnvironmentManifest;\n etag: string | null;\n}\n\nconst TTL_MS = 5 * 60 * 1000;\nconst cache = new Map<string, CacheEntry>();\nconst inflight = new Map<string, Promise<EnvironmentManifest | null>>();\n\nexport interface ManifestFetchOptions {\n apiBaseUrl: string;\n discoveryPath: string;\n signal?: AbortSignal;\n /** Skip cache + force a network round-trip (revalidates with ETag if known). */\n force?: boolean;\n}\n\n/** Compose the URL the way the spec describes. Tolerates trailing slashes. */\nexport function manifestUrl(apiBaseUrl: string, discoveryPath: string): string {\n const base = apiBaseUrl.replace(/\\/+$/, '');\n const path = discoveryPath.startsWith('/')\n ? discoveryPath\n : `/${discoveryPath}`;\n return `${base}${path}`;\n}\n\n/**\n * Validate manifest shape. Returns the parsed manifest on success, `null`\n * when the payload is malformed. Does not throw — schema mismatch is a\n * silent unsupported state per the design.\n */\nexport function validateManifest(input: unknown): EnvironmentManifest | null {\n if (!input || typeof input !== 'object') {\n return null;\n }\n const raw = input as Record<string, unknown>;\n if (typeof raw.default !== 'string' || raw.default.length === 0) {\n return null;\n }\n if (!Array.isArray(raw.environments) || raw.environments.length === 0) {\n return null;\n }\n const environments: EnvironmentDescriptor[] = [];\n for (const item of raw.environments) {\n if (!item || typeof item !== 'object') {\n return null;\n }\n const env = item as Record<string, unknown>;\n if (typeof env.id !== 'string' || env.id.length === 0) {\n return null;\n }\n if (typeof env.label !== 'string' || env.label.length === 0) {\n return null;\n }\n if (typeof env.baseUrl !== 'string' || env.baseUrl.length === 0) {\n return null;\n }\n let badge: EnvironmentBadge | undefined;\n if (env.badge !== undefined) {\n if (\n typeof env.badge !== 'string' ||\n !VALID_BADGES.has(env.badge as EnvironmentBadge)\n ) {\n return null;\n }\n badge = env.badge as EnvironmentBadge;\n }\n environments.push({\n id: env.id,\n label: env.label,\n baseUrl: env.baseUrl,\n badge,\n });\n }\n if (!environments.some((e) => e.id === raw.default)) {\n return null;\n }\n return { default: raw.default, environments };\n}\n\n/**\n * Fetch + cache a manifest. Resolves to the manifest on 2xx with a valid\n * payload, `null` on 404 / network error / schema mismatch.\n *\n * Errors are intentionally swallowed — the design makes manifest absence\n * a normal mode, not a failure.\n */\nexport async function fetchManifest(\n opts: ManifestFetchOptions,\n): Promise<EnvironmentManifest | null> {\n const url = manifestUrl(opts.apiBaseUrl, opts.discoveryPath);\n const now = Date.now();\n const cached = cache.get(url);\n if (!opts.force && cached && now - cached.fetchedAt < TTL_MS) {\n return cached.manifest;\n }\n\n const existing = inflight.get(url);\n if (existing) {\n return existing;\n }\n\n const headers: Record<string, string> = { Accept: 'application/json' };\n if (cached?.etag) {\n headers['If-None-Match'] = cached.etag;\n }\n\n const promise = (async (): Promise<EnvironmentManifest | null> => {\n try {\n const res = await fetch(url, {\n headers,\n signal: opts.signal,\n credentials: 'omit',\n });\n if (res.status === 304 && cached) {\n cache.set(url, { ...cached, fetchedAt: now });\n return cached.manifest;\n }\n if (!res.ok) {\n return null;\n }\n const json: unknown = await res.json();\n const manifest = validateManifest(json);\n if (!manifest) {\n return null;\n }\n cache.set(url, {\n fetchedAt: now,\n manifest,\n etag: res.headers.get('ETag'),\n });\n return manifest;\n } catch {\n return null;\n } finally {\n inflight.delete(url);\n }\n })();\n\n inflight.set(url, promise);\n return promise;\n}\n\n/** Test helper — exported so unit tests / specimens can reset state. */\nexport function clearManifestCache(): void {\n cache.clear();\n inflight.clear();\n}\n"],"names":["VALID_BADGES","TTL_MS","cache","inflight","manifestUrl","apiBaseUrl","discoveryPath","base","path","validateManifest","input","raw","environments","item","env","badge","e","fetchManifest","opts","url","now","cached","existing","headers","promise","res","json","manifest","clearManifestCache"],"mappings":"AAMA,MAAMA,wBAAkD,IAAI;AAAA,EAC1D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC,GAQKC,IAAS,IAAI,KAAK,KAClBC,wBAAY,IAAA,GACZC,wBAAe,IAAA;AAWd,SAASC,EAAYC,GAAoBC,GAA+B;AAC7E,QAAMC,IAAOF,EAAW,QAAQ,QAAQ,EAAE,GACpCG,IAAOF,EAAc,WAAW,GAAG,IACrCA,IACA,IAAIA,CAAa;AACrB,SAAO,GAAGC,CAAI,GAAGC,CAAI;AACvB;AAOO,SAASC,EAAiBC,GAA4C;AAC3E,MAAI,CAACA,KAAS,OAAOA,KAAU;AAC7B,WAAO;AAET,QAAMC,IAAMD;AAIZ,MAHI,OAAOC,EAAI,WAAY,YAAYA,EAAI,QAAQ,WAAW,KAG1D,CAAC,MAAM,QAAQA,EAAI,YAAY,KAAKA,EAAI,aAAa,WAAW;AAClE,WAAO;AAET,QAAMC,IAAwC,CAAA;AAC9C,aAAWC,KAAQF,EAAI,cAAc;AACnC,QAAI,CAACE,KAAQ,OAAOA,K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,GAAK,EAAE,GAAGE,GAAQ,WAAWD,GAAK,GACrCC,EAAO;AAEhB,UAAI,CAACI,EAAI;AACP,eAAO;AAET,YAAMC,IAAgB,MAAMD,EAAI,KAAA,GAC1BE,IAAWlB,EAAiBiB,CAAI;AACtC,aAAKC,KAGLzB,EAAM,IAAIiB,GAAK;AAAA,QACb,WAAWC;AAAA,QACX,UAAAO;AAAA,QACA,MAAMF,EAAI,QAAQ,IAAI,MAAM;AAAA,MAAA,CAC7B,GACME,KAPE;AAAA,IAQX,QAAQ;AACN,aAAO;AAAA,IACT,UAAA;AACE,MAAAxB,EAAS,OAAOgB,CAAG;AAAA,IACrB;AAAA,EACF,GAAA;AAEA,SAAAhB,EAAS,IAAIgB,GAAKK,CAAO,GAClBA;AACT;AAGO,SAASI,IAA2B;AACzC,EAAA1B,EAAM,MAAA,GACNC,EAAS,MAAA;AACX;"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("../lib/id.cjs"),b=require("../lib/storage.cjs"),p=require("./agentm/agentmChannelClient.cjs"),S="aegis.bridge.sessionId";function v(r){if(typeof r!="object"||r===null)return!1;const n=r;return n.type==="tool.call"&&typeof n.id=="string"&&typeof n.tool=="string"}async function O(r,n,l){const e=l??{};switch(n){case"aegis_snapshot":return r.snapshot();case"aegis_inspect":{const t=e.ref;if(typeof t!="object"||t===null)throw new Error("aegis_inspect requires { ref }");const s=r.inspect(t);if(!s)throw{code:"not_found",message:"inspect: target not found"};return s}case"aegis_search":{const t=typeof e.query=="string"?e.query:"";return r.search(t,{kinds:Array.isArray(e.kinds)?e.kinds:void 0,appId:typeof e.appId=="string"?e.appId:void 0,limit:typeof e.limit=="number"?e.limit:void 0})}case"aegis_invoke":{const t=typeof e.id=="string"?e.id:"";if(!t)throw new Error("aegis_invoke requires { id }");return await r.dispatch(t,e.params,{force:typeof e.force=="boolean"?e.force:void 0,by:"agent"})}case"aegis_navigate":{const t=typeof e.to=="string"?e.to:"";return r.dispatch("aegis.navigate",{to:t},{by:"agent"})}case"aegis_highlight":{const t=e.ref;if(typeof t!="object"||t===null)throw new Error("aegis_highlight requires { ref }");return r.highlight(t)}case"aegis_wait_for":{const t=typeof e.predicate=="string"?e.predicate:"";if(!t)throw new Error("aegis_wait_for requires { predicate }");return r.waitFor(t,{timeoutMs:typeof e.timeoutMs=="number"?e.timeoutMs:void 0})}default:throw new Error(`unknown tool: ${n}`)}}function q(r,n){const l=b.getOrCreateStored(S,()=>E.uniqueId("sess"),"session");let e=null,t=0,s=null,a=!1;const y=()=>{if(!e||e.readyState!==WebSocket.OPEN)return;const i=r.snapshot();e.send(JSON.stringify({type:"session.hello",sessionId:l,url:typeof location>"u"?"":location.href,currentAppId:i.shell.currentAppId,title:typeof document>"u"?"":document.title,authToken:n.authToken??null}))},u=()=>{if(!a){try{e=new WebSocket(n.url)}catch(i){console.warn("[aegis] bridge ws ctor threw",i),f();return}e.addEventListener("open",()=>{t=0,y()}),e.addEventListener("message",i=>{let d;try{d=JSON.parse(i.data)}catch{return}if(!v(d))return;const{id:g,tool:h,params:w}=d;O(r,h,w).then(o=>{e?.send(JSON.stringify({type:"tool.result",id:g,result:o}))},o=>{const c=o&&typeof o=="object"?o:null,_=typeof c?.code=="string"?c.code:"thrown",m=typeof c?.message=="string"?c.message:o instanceof Error?o.message:String(o);e?.send(JSON.stringify({type:"tool.error",id:g,error:{code:_,message:m}}))})}),e.addEventListener("close",()=>{f()}),e.addEventListener("error",()=>{})}},f=()=>{if(a)return;const i=p.RECONNECT_BACKOFF_MS[Math.min(t,p.RECONNECT_BACKOFF_MS.length-1)];t+=1,s=window.setTimeout(u,i)};return u(),()=>{a=!0,s!==null&&window.clearTimeout(s),e&&e.close()}}exports.connectAegisBridge=q;
|
|
2
|
-
//# sourceMappingURL=bridge.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bridge.cjs","sources":["../../src/transports/bridge.ts"],"sourcesContent":["import type { AegisRuntime } from '../agent/core/runtime';\nimport { uniqueId } from '../lib/id';\nimport { getOrCreateStored } from '../lib/storage';\nimport { RECONNECT_BACKOFF_MS } from './agentm/agentmChannelClient';\n\n/**\n * Where the MCP bridge listens. The console's Go server serves it as\n * `window.__AEGIS_BRIDGE__` from `/config.js` when started with `--bridge`.\n */\nexport interface AegisBridgeConfig {\n /** WebSocket URL, e.g. `ws://127.0.0.1:3323/aegis-bridge/ws`. */\n url: string;\n /** The bridge's browser token; omit when it runs with `--bridge-no-auth`. */\n authToken?: string;\n}\n\nconst SESSION_ID_KEY = 'aegis.bridge.sessionId';\n\ninterface ToolCallMessage {\n type: 'tool.call';\n id: string;\n tool: string;\n params?: Record<string, unknown> | null;\n}\n\nfunction isToolCallMessage(value: unknown): value is ToolCallMessage {\n if (typeof value !== 'object' || value === null) {\n return false;\n }\n const v = value as Record<string, unknown>;\n return (\n v.type === 'tool.call' &&\n typeof v.id === 'string' &&\n typeof v.tool === 'string'\n );\n}\n\nasync function runToolCall(\n runtime: AegisRuntime,\n tool: string,\n params: Record<string, unknown> | null | undefined,\n): Promise<unknown> {\n const p = params ?? {};\n switch (tool) {\n case 'aegis_snapshot':\n return runtime.snapshot();\n case 'aegis_inspect': {\n const ref = p.ref;\n if (typeof ref !== 'object' || ref === null) {\n throw new Error('aegis_inspect requires { ref }');\n }\n const r = runtime.inspect(ref as Parameters<AegisRuntime['inspect']>[0]);\n if (!r) {\n const err: { code: string; message: string } = {\n code: 'not_found',\n message: 'inspect: target not found',\n };\n throw err;\n }\n return r;\n }\n case 'aegis_search': {\n const query = typeof p.query === 'string' ? p.query : '';\n return runtime.search(query, {\n kinds: Array.isArray(p.kinds)\n ? (p.kinds as Parameters<AegisRuntime['search']>[1] extends infer O\n ? O extends { kinds?: infer K }\n ? K\n : never\n : never)\n : undefined,\n appId: typeof p.appId === 'string' ? p.appId : undefined,\n limit: typeof p.limit === 'number' ? p.limit : undefined,\n });\n }\n case 'aegis_invoke': {\n const id = typeof p.id === 'string' ? p.id : '';\n if (!id) {\n throw new Error('aegis_invoke requires { id }');\n }\n const result = await runtime.dispatch(id, p.params, {\n force: typeof p.force === 'boolean' ? p.force : undefined,\n by: 'agent',\n });\n return result;\n }\n case 'aegis_navigate': {\n const to = typeof p.to === 'string' ? p.to : '';\n return runtime.dispatch('aegis.navigate', { to }, { by: 'agent' });\n }\n case 'aegis_highlight': {\n const ref = p.ref;\n if (typeof ref !== 'object' || ref === null) {\n throw new Error('aegis_highlight requires { ref }');\n }\n return runtime.highlight(ref as Parameters<AegisRuntime['highlight']>[0]);\n }\n case 'aegis_wait_for': {\n const predicate = typeof p.predicate === 'string' ? p.predicate : '';\n if (!predicate) {\n throw new Error('aegis_wait_for requires { predicate }');\n }\n return runtime.waitFor(predicate, {\n timeoutMs: typeof p.timeoutMs === 'number' ? p.timeoutMs : undefined,\n });\n }\n default:\n throw new Error(`unknown tool: ${tool}`);\n }\n}\n\n/**\n * Connects the runtime to the MCP bridge so an agent outside the page\n * (through `aegis-console mcp`) can snapshot, search and invoke it.\n * Reconnects with backoff until the returned function is called.\n */\nexport function connectAegisBridge(\n runtime: AegisRuntime,\n config: AegisBridgeConfig,\n): () => void {\n const sessionId = getOrCreateStored(\n SESSION_ID_KEY,\n () => uniqueId('sess'),\n 'session',\n );\n let ws: WebSocket | null = null;\n let attempt = 0;\n let reconnectTimer: number | null = null;\n let closed = false;\n\n const sendHello = (): void => {\n if (!ws || ws.readyState !== WebSocket.OPEN) {\n return;\n }\n const snap = runtime.snapshot();\n ws.send(\n JSON.stringify({\n type: 'session.hello',\n sessionId,\n url: typeof location === 'undefined' ? '' : location.href,\n // The app open when the socket connected; the session list shows\n // it, tool calls read the live snapshot.\n currentAppId: snap.shell.currentAppId,\n title: typeof document === 'undefined' ? '' : document.title,\n authToken: config.authToken ?? null,\n }),\n );\n };\n\n const connect = (): void => {\n if (closed) {\n return;\n }\n try {\n ws = new WebSocket(config.url);\n } catch (err) {\n console.warn('[aegis] bridge ws ctor threw', err);\n scheduleReconnect();\n return;\n }\n ws.addEventListener('open', () => {\n attempt = 0;\n sendHello();\n });\n ws.addEventListener('message', (ev: MessageEvent<string>) => {\n let parsed: unknown;\n try {\n parsed = JSON.parse(ev.data);\n } catch {\n return;\n }\n if (!isToolCallMessage(parsed)) {\n return;\n }\n const { id, tool, params } = parsed;\n runToolCall(runtime, tool, params).then(\n (result) => {\n ws?.send(JSON.stringify({ type: 'tool.result', id, result }));\n },\n (err: unknown) => {\n const errObj =\n err && typeof err === 'object'\n ? (err as Record<string, unknown>)\n : null;\n const code =\n typeof errObj?.code === 'string' ? errObj.code : 'thrown';\n const message =\n typeof errObj?.message === 'string'\n ? errObj.message\n : err instanceof Error\n ? err.message\n : String(err);\n ws?.send(\n JSON.stringify({\n type: 'tool.error',\n id,\n error: { code, message },\n }),\n );\n },\n );\n });\n ws.addEventListener('close', () => {\n scheduleReconnect();\n });\n ws.addEventListener('error', () => {\n // close handler does the reconnect — error fires before close.\n });\n };\n\n const scheduleReconnect = (): void => {\n if (closed) {\n return;\n }\n const delay =\n RECONNECT_BACKOFF_MS[Math.min(attempt, RECONNECT_BACKOFF_MS.length - 1)];\n attempt += 1;\n reconnectTimer = window.setTimeout(connect, delay);\n };\n\n connect();\n\n return () => {\n closed = true;\n if (reconnectTimer !== null) {\n window.clearTimeout(reconnectTimer);\n }\n if (ws) {\n ws.close();\n }\n };\n}\n"],"names":["SESSION_ID_KEY","isToolCallMessage","value","v","runToolCall","runtime","tool","params","p","ref","r","query","id","to","predicate","connectAegisBridge","config","sessionId","getOrCreateStored","uniqueId","ws","attempt","reconnectTimer","closed","sendHello","snap","connect","err","scheduleReconnect","ev","parsed","result","errObj","code","message","delay","RECONNECT_BACKOFF_MS"],"mappings":"+LAgBMA,EAAiB,yBASvB,SAASC,EAAkBC,EAA0C,CACnE,GAAI,OAAOA,GAAU,UAAYA,IAAU,KACzC,MAAO,GAET,MAAMC,EAAID,EACV,OACEC,EAAE,OAAS,aAC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B,EAAkB6B,CAAM,EAC3B,OAEF,KAAM,CAAE,GAAAlB,EAAI,KAAAN,EAAM,OAAAC,CAAA,EAAWuB,EAC7B1B,EAAYC,EAASC,EAAMC,CAAM,EAAE,KAChCwB,GAAW,CACVX,GAAI,KAAK,KAAK,UAAU,CAAE,KAAM,cAAe,GAAAR,EAAI,OAAAmB,CAAA,CAAQ,CAAC,CAC9D,EACCJ,GAAiB,CAChB,MAAMK,EACJL,GAAO,OAAOA,GAAQ,SACjBA,EACD,KACAM,EACJ,OAAOD,GAAQ,MAAS,SAAWA,EAAO,KAAO,SAC7CE,EACJ,OAAOF,GAAQ,SAAY,SACvBA,EAAO,QACPL,aAAe,MACbA,EAAI,QACJ,OAAOA,CAAG,EAClBP,GAAI,KACF,KAAK,UAAU,CACb,KAAM,aACN,GAAAR,EACA,MAAO,CAAE,KAAAqB,EAAM,QAAAC,CAAA,CAAQ,CACxB,CAAA,CAEL,CAAA,CAEJ,CAAC,EACDd,EAAG,iBAAiB,QAAS,IAAM,CACjCQ,EAAA,CACF,CAAC,EACDR,EAAG,iBAAiB,QAAS,IAAM,CAEnC,CAAC,EACH,EAEMQ,EAAoB,IAAY,CACpC,GAAIL,EACF,OAEF,MAAMY,EACJC,EAAAA,qBAAqB,KAAK,IAAIf,EAASe,EAAAA,qBAAqB,OAAS,CAAC,CAAC,EACzEf,GAAW,EACXC,EAAiB,OAAO,WAAWI,EAASS,CAAK,CACnD,EAEA,OAAAT,EAAA,EAEO,IAAM,CACXH,EAAS,GACLD,IAAmB,MACrB,OAAO,aAAaA,CAAc,EAEhCF,GACFA,EAAG,MAAA,CAEP,CACF"}
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
import { uniqueId as E } from "../lib/id.js";
|
|
2
|
-
import { getOrCreateStored as b } from "../lib/storage.js";
|
|
3
|
-
import { RECONNECT_BACKOFF_MS as g } from "./agentm/agentmChannelClient.js";
|
|
4
|
-
const S = "aegis.bridge.sessionId";
|
|
5
|
-
function v(o) {
|
|
6
|
-
if (typeof o != "object" || o === null)
|
|
7
|
-
return !1;
|
|
8
|
-
const r = o;
|
|
9
|
-
return r.type === "tool.call" && typeof r.id == "string" && typeof r.tool == "string";
|
|
10
|
-
}
|
|
11
|
-
async function k(o, r, d) {
|
|
12
|
-
const e = d ?? {};
|
|
13
|
-
switch (r) {
|
|
14
|
-
case "aegis_snapshot":
|
|
15
|
-
return o.snapshot();
|
|
16
|
-
case "aegis_inspect": {
|
|
17
|
-
const t = e.ref;
|
|
18
|
-
if (typeof t != "object" || t === null)
|
|
19
|
-
throw new Error("aegis_inspect requires { ref }");
|
|
20
|
-
const n = o.inspect(t);
|
|
21
|
-
if (!n)
|
|
22
|
-
throw {
|
|
23
|
-
code: "not_found",
|
|
24
|
-
message: "inspect: target not found"
|
|
25
|
-
};
|
|
26
|
-
return n;
|
|
27
|
-
}
|
|
28
|
-
case "aegis_search": {
|
|
29
|
-
const t = typeof e.query == "string" ? e.query : "";
|
|
30
|
-
return o.search(t, {
|
|
31
|
-
kinds: Array.isArray(e.kinds) ? e.kinds : void 0,
|
|
32
|
-
appId: typeof e.appId == "string" ? e.appId : void 0,
|
|
33
|
-
limit: typeof e.limit == "number" ? e.limit : void 0
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
case "aegis_invoke": {
|
|
37
|
-
const t = typeof e.id == "string" ? e.id : "";
|
|
38
|
-
if (!t)
|
|
39
|
-
throw new Error("aegis_invoke requires { id }");
|
|
40
|
-
return await o.dispatch(t, e.params, {
|
|
41
|
-
force: typeof e.force == "boolean" ? e.force : void 0,
|
|
42
|
-
by: "agent"
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
case "aegis_navigate": {
|
|
46
|
-
const t = typeof e.to == "string" ? e.to : "";
|
|
47
|
-
return o.dispatch("aegis.navigate", { to: t }, { by: "agent" });
|
|
48
|
-
}
|
|
49
|
-
case "aegis_highlight": {
|
|
50
|
-
const t = e.ref;
|
|
51
|
-
if (typeof t != "object" || t === null)
|
|
52
|
-
throw new Error("aegis_highlight requires { ref }");
|
|
53
|
-
return o.highlight(t);
|
|
54
|
-
}
|
|
55
|
-
case "aegis_wait_for": {
|
|
56
|
-
const t = typeof e.predicate == "string" ? e.predicate : "";
|
|
57
|
-
if (!t)
|
|
58
|
-
throw new Error("aegis_wait_for requires { predicate }");
|
|
59
|
-
return o.waitFor(t, {
|
|
60
|
-
timeoutMs: typeof e.timeoutMs == "number" ? e.timeoutMs : void 0
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
default:
|
|
64
|
-
throw new Error(`unknown tool: ${r}`);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
function N(o, r) {
|
|
68
|
-
const d = b(
|
|
69
|
-
S,
|
|
70
|
-
() => E("sess"),
|
|
71
|
-
"session"
|
|
72
|
-
);
|
|
73
|
-
let e = null, t = 0, n = null, a = !1;
|
|
74
|
-
const y = () => {
|
|
75
|
-
if (!e || e.readyState !== WebSocket.OPEN)
|
|
76
|
-
return;
|
|
77
|
-
const i = o.snapshot();
|
|
78
|
-
e.send(
|
|
79
|
-
JSON.stringify({
|
|
80
|
-
type: "session.hello",
|
|
81
|
-
sessionId: d,
|
|
82
|
-
url: typeof location > "u" ? "" : location.href,
|
|
83
|
-
// The app open when the socket connected; the session list shows
|
|
84
|
-
// it, tool calls read the live snapshot.
|
|
85
|
-
currentAppId: i.shell.currentAppId,
|
|
86
|
-
title: typeof document > "u" ? "" : document.title,
|
|
87
|
-
authToken: r.authToken ?? null
|
|
88
|
-
})
|
|
89
|
-
);
|
|
90
|
-
}, f = () => {
|
|
91
|
-
if (!a) {
|
|
92
|
-
try {
|
|
93
|
-
e = new WebSocket(r.url);
|
|
94
|
-
} catch (i) {
|
|
95
|
-
console.warn("[aegis] bridge ws ctor threw", i), p();
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
e.addEventListener("open", () => {
|
|
99
|
-
t = 0, y();
|
|
100
|
-
}), e.addEventListener("message", (i) => {
|
|
101
|
-
let l;
|
|
102
|
-
try {
|
|
103
|
-
l = JSON.parse(i.data);
|
|
104
|
-
} catch {
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
if (!v(l))
|
|
108
|
-
return;
|
|
109
|
-
const { id: u, tool: h, params: w } = l;
|
|
110
|
-
k(o, h, w).then(
|
|
111
|
-
(s) => {
|
|
112
|
-
e?.send(JSON.stringify({ type: "tool.result", id: u, result: s }));
|
|
113
|
-
},
|
|
114
|
-
(s) => {
|
|
115
|
-
const c = s && typeof s == "object" ? s : null, m = typeof c?.code == "string" ? c.code : "thrown", _ = typeof c?.message == "string" ? c.message : s instanceof Error ? s.message : String(s);
|
|
116
|
-
e?.send(
|
|
117
|
-
JSON.stringify({
|
|
118
|
-
type: "tool.error",
|
|
119
|
-
id: u,
|
|
120
|
-
error: { code: m, message: _ }
|
|
121
|
-
})
|
|
122
|
-
);
|
|
123
|
-
}
|
|
124
|
-
);
|
|
125
|
-
}), e.addEventListener("close", () => {
|
|
126
|
-
p();
|
|
127
|
-
}), e.addEventListener("error", () => {
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
}, p = () => {
|
|
131
|
-
if (a)
|
|
132
|
-
return;
|
|
133
|
-
const i = g[Math.min(t, g.length - 1)];
|
|
134
|
-
t += 1, n = window.setTimeout(f, i);
|
|
135
|
-
};
|
|
136
|
-
return f(), () => {
|
|
137
|
-
a = !0, n !== null && window.clearTimeout(n), e && e.close();
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
export {
|
|
141
|
-
N as connectAegisBridge
|
|
142
|
-
};
|
|
143
|
-
//# sourceMappingURL=bridge.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bridge.js","sources":["../../src/transports/bridge.ts"],"sourcesContent":["import type { AegisRuntime } from '../agent/core/runtime';\nimport { uniqueId } from '../lib/id';\nimport { getOrCreateStored } from '../lib/storage';\nimport { RECONNECT_BACKOFF_MS } from './agentm/agentmChannelClient';\n\n/**\n * Where the MCP bridge listens. The console's Go server serves it as\n * `window.__AEGIS_BRIDGE__` from `/config.js` when started with `--bridge`.\n */\nexport interface AegisBridgeConfig {\n /** WebSocket URL, e.g. `ws://127.0.0.1:3323/aegis-bridge/ws`. */\n url: string;\n /** The bridge's browser token; omit when it runs with `--bridge-no-auth`. */\n authToken?: string;\n}\n\nconst SESSION_ID_KEY = 'aegis.bridge.sessionId';\n\ninterface ToolCallMessage {\n type: 'tool.call';\n id: string;\n tool: string;\n params?: Record<string, unknown> | null;\n}\n\nfunction isToolCallMessage(value: unknown): value is ToolCallMessage {\n if (typeof value !== 'object' || value === null) {\n return false;\n }\n const v = value as Record<string, unknown>;\n return (\n v.type === 'tool.call' &&\n typeof v.id === 'string' &&\n typeof v.tool === 'string'\n );\n}\n\nasync function runToolCall(\n runtime: AegisRuntime,\n tool: string,\n params: Record<string, unknown> | null | undefined,\n): Promise<unknown> {\n const p = params ?? {};\n switch (tool) {\n case 'aegis_snapshot':\n return runtime.snapshot();\n case 'aegis_inspect': {\n const ref = p.ref;\n if (typeof ref !== 'object' || ref === null) {\n throw new Error('aegis_inspect requires { ref }');\n }\n const r = runtime.inspect(ref as Parameters<AegisRuntime['inspect']>[0]);\n if (!r) {\n const err: { code: string; message: string } = {\n code: 'not_found',\n message: 'inspect: target not found',\n };\n throw err;\n }\n return r;\n }\n case 'aegis_search': {\n const query = typeof p.query === 'string' ? p.query : '';\n return runtime.search(query, {\n kinds: Array.isArray(p.kinds)\n ? (p.kinds as Parameters<AegisRuntime['search']>[1] extends infer O\n ? O extends { kinds?: infer K }\n ? K\n : never\n : never)\n : undefined,\n appId: typeof p.appId === 'string' ? p.appId : undefined,\n limit: typeof p.limit === 'number' ? p.limit : undefined,\n });\n }\n case 'aegis_invoke': {\n const id = typeof p.id === 'string' ? p.id : '';\n if (!id) {\n throw new Error('aegis_invoke requires { id }');\n }\n const result = await runtime.dispatch(id, p.params, {\n force: typeof p.force === 'boolean' ? p.force : undefined,\n by: 'agent',\n });\n return result;\n }\n case 'aegis_navigate': {\n const to = typeof p.to === 'string' ? p.to : '';\n return runtime.dispatch('aegis.navigate', { to }, { by: 'agent' });\n }\n case 'aegis_highlight': {\n const ref = p.ref;\n if (typeof ref !== 'object' || ref === null) {\n throw new Error('aegis_highlight requires { ref }');\n }\n return runtime.highlight(ref as Parameters<AegisRuntime['highlight']>[0]);\n }\n case 'aegis_wait_for': {\n const predicate = typeof p.predicate === 'string' ? p.predicate : '';\n if (!predicate) {\n throw new Error('aegis_wait_for requires { predicate }');\n }\n return runtime.waitFor(predicate, {\n timeoutMs: typeof p.timeoutMs === 'number' ? p.timeoutMs : undefined,\n });\n }\n default:\n throw new Error(`unknown tool: ${tool}`);\n }\n}\n\n/**\n * Connects the runtime to the MCP bridge so an agent outside the page\n * (through `aegis-console mcp`) can snapshot, search and invoke it.\n * Reconnects with backoff until the returned function is called.\n */\nexport function connectAegisBridge(\n runtime: AegisRuntime,\n config: AegisBridgeConfig,\n): () => void {\n const sessionId = getOrCreateStored(\n SESSION_ID_KEY,\n () => uniqueId('sess'),\n 'session',\n );\n let ws: WebSocket | null = null;\n let attempt = 0;\n let reconnectTimer: number | null = null;\n let closed = false;\n\n const sendHello = (): void => {\n if (!ws || ws.readyState !== WebSocket.OPEN) {\n return;\n }\n const snap = runtime.snapshot();\n ws.send(\n JSON.stringify({\n type: 'session.hello',\n sessionId,\n url: typeof location === 'undefined' ? '' : location.href,\n // The app open when the socket connected; the session list shows\n // it, tool calls read the live snapshot.\n currentAppId: snap.shell.currentAppId,\n title: typeof document === 'undefined' ? '' : document.title,\n authToken: config.authToken ?? null,\n }),\n );\n };\n\n const connect = (): void => {\n if (closed) {\n return;\n }\n try {\n ws = new WebSocket(config.url);\n } catch (err) {\n console.warn('[aegis] bridge ws ctor threw', err);\n scheduleReconnect();\n return;\n }\n ws.addEventListener('open', () => {\n attempt = 0;\n sendHello();\n });\n ws.addEventListener('message', (ev: MessageEvent<string>) => {\n let parsed: unknown;\n try {\n parsed = JSON.parse(ev.data);\n } catch {\n return;\n }\n if (!isToolCallMessage(parsed)) {\n return;\n }\n const { id, tool, params } = parsed;\n runToolCall(runtime, tool, params).then(\n (result) => {\n ws?.send(JSON.stringify({ type: 'tool.result', id, result }));\n },\n (err: unknown) => {\n const errObj =\n err && typeof err === 'object'\n ? (err as Record<string, unknown>)\n : null;\n const code =\n typeof errObj?.code === 'string' ? errObj.code : 'thrown';\n const message =\n typeof errObj?.message === 'string'\n ? errObj.message\n : err instanceof Error\n ? err.message\n : String(err);\n ws?.send(\n JSON.stringify({\n type: 'tool.error',\n id,\n error: { code, message },\n }),\n );\n },\n );\n });\n ws.addEventListener('close', () => {\n scheduleReconnect();\n });\n ws.addEventListener('error', () => {\n // close handler does the reconnect — error fires before close.\n });\n };\n\n const scheduleReconnect = (): void => {\n if (closed) {\n return;\n }\n const delay =\n RECONNECT_BACKOFF_MS[Math.min(attempt, RECONNECT_BACKOFF_MS.length - 1)];\n attempt += 1;\n reconnectTimer = window.setTimeout(connect, delay);\n };\n\n connect();\n\n return () => {\n closed = true;\n if (reconnectTimer !== null) {\n window.clearTimeout(reconnectTimer);\n }\n if (ws) {\n ws.close();\n }\n };\n}\n"],"names":["SESSION_ID_KEY","isToolCallMessage","value","v","runToolCall","runtime","tool","params","p","ref","r","query","id","to","predicate","connectAegisBridge","config","sessionId","getOrCreateStored","uniqueId","ws","attempt","reconnectTimer","closed","sendHello","snap","connect","err","scheduleReconnect","ev","parsed","result","errObj","code","message","delay","RECONNECT_BACKOFF_MS"],"mappings":";;;AAgBA,MAAMA,IAAiB;AASvB,SAASC,EAAkBC,GAA0C;AACnE,MAAI,OAAOA,KAAU,YAAYA,MAAU;AACzC,WAAO;AAET,QAAMC,IAAID;AACV,SACEC,EAAE,SAAS,eACX,OAAOA,EAAE,MAAO,YAChB,OAAOA,EAAE,QAAS;AAEtB;AAEA,eAAeC,EACbC,GACAC,GACAC,GACkB;AAClB,QAAMC,IAAID,KAAU,CAAA;AACp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