@lincyaw/aegis-ui 0.9.4 → 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 +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/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
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { uniqueId as S } from "../lib/id.js";
|
|
2
|
+
import { readStorage as v, getOrCreateStored as L, writeStorage as y, removeStorage as M } from "../lib/storage.js";
|
|
3
|
+
import { McpToolError as u, MCP_TOOLS as A } from "./mcpTools.js";
|
|
4
|
+
const E = "aegis.bridge.sessionId", d = "aegis.bridge.sessionOpen", O = [1e3, 2e3, 5e3, 1e4, 3e4], I = 5e3, P = 1008, k = new Map(A.map((e) => [e.name, e]));
|
|
5
|
+
function J(e) {
|
|
6
|
+
if (typeof e != "object" || e === null)
|
|
7
|
+
return !1;
|
|
8
|
+
const t = e;
|
|
9
|
+
return t.type === "tool.call" && typeof t.id == "string" && typeof t.tool == "string";
|
|
10
|
+
}
|
|
11
|
+
function $(e) {
|
|
12
|
+
if (e == null)
|
|
13
|
+
return {};
|
|
14
|
+
if (typeof e != "object" || Array.isArray(e))
|
|
15
|
+
throw new u(
|
|
16
|
+
"invalid_params",
|
|
17
|
+
"tool arguments must be an object"
|
|
18
|
+
);
|
|
19
|
+
return e;
|
|
20
|
+
}
|
|
21
|
+
function j(e) {
|
|
22
|
+
if (e instanceof u)
|
|
23
|
+
return { code: e.code, message: e.message };
|
|
24
|
+
if (e instanceof Error)
|
|
25
|
+
return { code: "thrown", message: e.message };
|
|
26
|
+
if (typeof e == "object" && e !== null) {
|
|
27
|
+
const { code: t, message: n } = e;
|
|
28
|
+
if (typeof t == "string" && typeof n == "string")
|
|
29
|
+
return { code: t, message: n };
|
|
30
|
+
}
|
|
31
|
+
return { code: "thrown", message: String(e) };
|
|
32
|
+
}
|
|
33
|
+
function Y() {
|
|
34
|
+
const t = v(d, "session") !== null ? S("sess") : L(E, () => S("sess"), "session");
|
|
35
|
+
y(E, t, "session");
|
|
36
|
+
const n = () => {
|
|
37
|
+
y(d, "1", "session");
|
|
38
|
+
}, o = () => {
|
|
39
|
+
M(d, "session");
|
|
40
|
+
};
|
|
41
|
+
return n(), window.addEventListener("pageshow", n), window.addEventListener("pagehide", o), {
|
|
42
|
+
id: t,
|
|
43
|
+
release: () => {
|
|
44
|
+
window.removeEventListener("pageshow", n), window.removeEventListener("pagehide", o), o();
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
function b(e, t) {
|
|
49
|
+
if (e.readyState !== WebSocket.OPEN)
|
|
50
|
+
return;
|
|
51
|
+
let n;
|
|
52
|
+
try {
|
|
53
|
+
n = JSON.stringify(t);
|
|
54
|
+
} catch (o) {
|
|
55
|
+
n = JSON.stringify({
|
|
56
|
+
type: "tool.error",
|
|
57
|
+
id: t.id,
|
|
58
|
+
error: {
|
|
59
|
+
code: "unserializable",
|
|
60
|
+
message: `The reply cannot be sent as JSON: ${o instanceof Error ? o.message : String(o)}`
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
e.send(n);
|
|
65
|
+
}
|
|
66
|
+
function R(e, t) {
|
|
67
|
+
const n = Y();
|
|
68
|
+
let o = null, c = 0, g, p = !1;
|
|
69
|
+
const T = () => JSON.stringify({
|
|
70
|
+
type: "session.hello",
|
|
71
|
+
sessionId: n.id,
|
|
72
|
+
// Origin and path only: the bridge logs this, and a query string or
|
|
73
|
+
// fragment can carry secrets such as an OAuth code.
|
|
74
|
+
url: `${location.origin}${location.pathname}`,
|
|
75
|
+
// The app open when the socket connected; the session list shows
|
|
76
|
+
// it, tool calls read the live snapshot.
|
|
77
|
+
currentAppId: e.snapshot().shell.currentAppId,
|
|
78
|
+
title: document.title,
|
|
79
|
+
authToken: t.authToken ?? null
|
|
80
|
+
}), C = (s, i, a) => {
|
|
81
|
+
if (typeof a != "string")
|
|
82
|
+
return;
|
|
83
|
+
let r;
|
|
84
|
+
try {
|
|
85
|
+
r = JSON.parse(a);
|
|
86
|
+
} catch {
|
|
87
|
+
console.warn("[aegis] MCP bridge sent a frame that is not JSON");
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (!J(r))
|
|
91
|
+
return;
|
|
92
|
+
const { id: m, tool: w, params: N } = r, h = k.get(w);
|
|
93
|
+
Promise.resolve().then(() => {
|
|
94
|
+
if (!h)
|
|
95
|
+
throw new u("unknown_tool", `Unknown tool: ${w}`);
|
|
96
|
+
return h.run(e, $(N), i);
|
|
97
|
+
}).then(
|
|
98
|
+
(l) => {
|
|
99
|
+
b(s, { type: "tool.result", id: m, result: l });
|
|
100
|
+
},
|
|
101
|
+
(l) => {
|
|
102
|
+
b(s, { type: "tool.error", id: m, error: j(l) });
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
}, f = () => {
|
|
106
|
+
let s;
|
|
107
|
+
try {
|
|
108
|
+
s = new WebSocket(t.url);
|
|
109
|
+
} catch (r) {
|
|
110
|
+
console.error("[aegis] MCP bridge: cannot open its WebSocket", r);
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
const i = new AbortController();
|
|
114
|
+
o = { ws: s, calls: i };
|
|
115
|
+
let a;
|
|
116
|
+
s.addEventListener("open", () => {
|
|
117
|
+
s.send(T()), a = window.setTimeout(() => {
|
|
118
|
+
c = 0;
|
|
119
|
+
}, I);
|
|
120
|
+
}), s.addEventListener("message", (r) => {
|
|
121
|
+
C(s, i.signal, r.data);
|
|
122
|
+
}), s.addEventListener("close", (r) => {
|
|
123
|
+
if (i.abort(), window.clearTimeout(a), o?.ws === s && (o = null), !p) {
|
|
124
|
+
if (r.code === P) {
|
|
125
|
+
console.error(
|
|
126
|
+
`[aegis] MCP bridge refused this page (${r.reason || "policy violation"}); reload the page to reconnect.`
|
|
127
|
+
);
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
_();
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
}, _ = () => {
|
|
134
|
+
const s = O[Math.min(c, O.length - 1)];
|
|
135
|
+
c += 1, g = window.setTimeout(f, s);
|
|
136
|
+
};
|
|
137
|
+
return f(), () => {
|
|
138
|
+
p = !0, window.clearTimeout(g), o && (o.calls.abort(), o.ws.close()), n.release();
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
export {
|
|
142
|
+
R as connectAegisBridge
|
|
143
|
+
};
|
|
144
|
+
//# sourceMappingURL=mcpBridge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcpBridge.js","sources":["../../src/transports/mcpBridge.ts"],"sourcesContent":["import type { AegisRuntime } from '../agent/core/runtime';\nimport { uniqueId } from '../lib/id';\nimport {\n getOrCreateStored,\n readStorage,\n removeStorage,\n writeStorage,\n} from '../lib/storage';\nimport { MCP_TOOLS, McpToolError } from './mcpTools';\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';\nconst SESSION_OPEN_KEY = 'aegis.bridge.sessionOpen';\nconst RECONNECT_BACKOFF_MS = [1000, 2000, 5000, 10000, 30000];\n// The bridge refuses a hello by closing the socket right after it, so a\n// socket still open after this long was accepted.\nconst ACCEPTED_AFTER_MS = 5000;\n// The bridge's close code for a refused hello, such as a token from before\n// it restarted. Only a reload, which fetches the new token, can recover.\nconst CLOSE_POLICY_VIOLATION = 1008;\n\nconst TOOLS_BY_NAME = new Map(MCP_TOOLS.map((tool) => [tool.name, tool]));\n\ninterface ToolCallMessage {\n type: 'tool.call';\n id: string;\n tool: string;\n params?: unknown;\n}\n\ninterface ToolErrorBody {\n code: string;\n message: string;\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\nfunction toolParams(params: unknown): Record<string, unknown> {\n if (params === undefined || params === null) {\n return {};\n }\n if (typeof params !== 'object' || Array.isArray(params)) {\n throw new McpToolError(\n 'invalid_params',\n 'tool arguments must be an object',\n );\n }\n return params as Record<string, unknown>;\n}\n\nfunction toToolError(err: unknown): ToolErrorBody {\n if (err instanceof McpToolError) {\n return { code: err.code, message: err.message };\n }\n if (err instanceof Error) {\n return { code: 'thrown', message: err.message };\n }\n if (typeof err === 'object' && err !== null) {\n // The runtime rejects with plain AegisError objects.\n const { code, message } = err as Record<string, unknown>;\n if (typeof code === 'string' && typeof message === 'string') {\n return { code, message };\n }\n }\n return { code: 'thrown', message: String(err) };\n}\n\n/**\n * The session id survives reloads through sessionStorage. A duplicated tab\n * copies sessionStorage, including the open marker of the tab it came\n * from, so a page that finds the marker takes a fresh id; two tabs sharing\n * one id would keep evicting each other from the bridge.\n */\nfunction claimSession(): { id: string; release: () => void } {\n const duplicated = readStorage(SESSION_OPEN_KEY, 'session') !== null;\n const id = duplicated\n ? uniqueId('sess')\n : getOrCreateStored(SESSION_ID_KEY, () => uniqueId('sess'), 'session');\n writeStorage(SESSION_ID_KEY, id, 'session');\n const markOpen = (): void => {\n writeStorage(SESSION_OPEN_KEY, '1', 'session');\n };\n const markClosed = (): void => {\n removeStorage(SESSION_OPEN_KEY, 'session');\n };\n markOpen();\n window.addEventListener('pageshow', markOpen);\n window.addEventListener('pagehide', markClosed);\n return {\n id,\n release: () => {\n window.removeEventListener('pageshow', markOpen);\n window.removeEventListener('pagehide', markClosed);\n markClosed();\n },\n };\n}\n\nfunction reply(\n ws: WebSocket,\n message:\n | { type: 'tool.result'; id: string; result: unknown }\n | { type: 'tool.error'; id: string; error: ToolErrorBody },\n): void {\n // A call whose socket has closed cannot be answered; the bridge fails\n // the calls of a session that goes away.\n if (ws.readyState !== WebSocket.OPEN) {\n return;\n }\n let text: string;\n try {\n text = JSON.stringify(message);\n } catch (err) {\n text = JSON.stringify({\n type: 'tool.error',\n id: message.id,\n error: {\n code: 'unserializable',\n message: `The reply cannot be sent as JSON: ${err instanceof Error ? err.message : String(err)}`,\n },\n });\n }\n ws.send(text);\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, or until\n * the bridge refuses the page.\n */\nexport function connectAegisBridge(\n runtime: AegisRuntime,\n config: AegisBridgeConfig,\n): () => void {\n const session = claimSession();\n let active: { ws: WebSocket; calls: AbortController } | null = null;\n let attempt = 0;\n let reconnectTimer: number | undefined;\n let stopped = false;\n\n const hello = (): string =>\n JSON.stringify({\n type: 'session.hello',\n sessionId: session.id,\n // Origin and path only: the bridge logs this, and a query string or\n // fragment can carry secrets such as an OAuth code.\n url: `${location.origin}${location.pathname}`,\n // The app open when the socket connected; the session list shows\n // it, tool calls read the live snapshot.\n currentAppId: runtime.snapshot().shell.currentAppId,\n title: document.title,\n authToken: config.authToken ?? null,\n });\n\n const handleMessage = (\n ws: WebSocket,\n signal: AbortSignal,\n data: unknown,\n ): void => {\n if (typeof data !== 'string') {\n return;\n }\n let message: unknown;\n try {\n message = JSON.parse(data);\n } catch {\n console.warn('[aegis] MCP bridge sent a frame that is not JSON');\n return;\n }\n if (!isToolCallMessage(message)) {\n return;\n }\n const { id, tool: name, params } = message;\n const tool = TOOLS_BY_NAME.get(name);\n Promise.resolve()\n .then(() => {\n if (!tool) {\n throw new McpToolError('unknown_tool', `Unknown tool: ${name}`);\n }\n return tool.run(runtime, toolParams(params), signal);\n })\n .then(\n (result: unknown) => {\n reply(ws, { type: 'tool.result', id, result });\n },\n (err: unknown) => {\n reply(ws, { type: 'tool.error', id, error: toToolError(err) });\n },\n );\n };\n\n const connect = (): void => {\n let ws: WebSocket;\n try {\n ws = new WebSocket(config.url);\n } catch (err) {\n console.error('[aegis] MCP bridge: cannot open its WebSocket', err);\n return;\n }\n const calls = new AbortController();\n active = { ws, calls };\n let acceptedTimer: number | undefined;\n ws.addEventListener('open', () => {\n ws.send(hello());\n acceptedTimer = window.setTimeout(() => {\n attempt = 0;\n }, ACCEPTED_AFTER_MS);\n });\n ws.addEventListener('message', (ev: MessageEvent<unknown>) => {\n handleMessage(ws, calls.signal, ev.data);\n });\n ws.addEventListener('close', (ev) => {\n calls.abort();\n window.clearTimeout(acceptedTimer);\n if (active?.ws === ws) {\n active = null;\n }\n if (stopped) {\n return;\n }\n if (ev.code === CLOSE_POLICY_VIOLATION) {\n console.error(\n `[aegis] MCP bridge refused this page (${ev.reason || 'policy violation'}); reload the page to reconnect.`,\n );\n return;\n }\n scheduleReconnect();\n });\n };\n\n const scheduleReconnect = (): void => {\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 stopped = true;\n window.clearTimeout(reconnectTimer);\n if (active) {\n active.calls.abort();\n active.ws.close();\n }\n session.release();\n };\n}\n"],"names":["SESSION_ID_KEY","SESSION_OPEN_KEY","RECONNECT_BACKOFF_MS","ACCEPTED_AFTER_MS","CLOSE_POLICY_VIOLATION","TOOLS_BY_NAME","MCP_TOOLS","tool","isToolCallMessage","value","v","toolParams","params","McpToolError","toToolError","err","code","message","claimSession","id","readStorage","uniqueId","getOrCreateStored","writeStorage","markOpen","markClosed","removeStorage","reply","ws","text","connectAegisBridge","runtime","config","session","active","attempt","reconnectTimer","stopped","hello","handleMessage","signal","data","name","result","connect","calls","acceptedTimer","ev","scheduleReconnect","delay"],"mappings":";;;AAqBA,MAAMA,IAAiB,0BACjBC,IAAmB,4BACnBC,IAAuB,CAAC,KAAM,KAAM,KAAM,KAAO,GAAK,GAGtDC,IAAoB,KAGpBC,IAAyB,MAEzBC,IAAgB,IAAI,IAAIC,EAAU,IAAI,CAACC,MAAS,CAACA,EAAK,MAAMA,CAAI,CAAC,CAAC;AAcxE,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,SAASC,EAAWC,GAA0C;AAC5D,MAA4BA,KAAW;AACrC,WAAO,CAAA;AAET,MAAI,OAAOA,KAAW,YAAY,MAAM,QAAQA,CAAM;AACpD,UAAM,IAAIC;AAAA,MACR;AAAA,MACA;AAAA,IAAA;AAGJ,SAAOD;AACT;AAEA,SAASE,EAAYC,GAA6B;AAChD,MAAIA,aAAeF;AACjB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M,MAAA,GACbA,EAAO,GAAG,MAAA,IAEZD,EAAQ,QAAA;AAAA,EACV;AACF;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class a extends Error{code;constructor(n,t){super(t),this.code=n}}const u=["surface","entity","action","route"],d={type:"object",description:'A ref from aegis_snapshot or aegis_search: { kind: "surface", surfaceId } | { kind: "entity", entityId, surfaceId? } | { kind: "action", actionId } | { kind: "route", appId, pathname }.',properties:{kind:{type:"string",enum:u},surfaceId:{type:"string"},entityId:{type:"string"},actionId:{type:"string"},appId:{type:"string"},pathname:{type:"string"}},required:["kind"]};function i(e){return new a("invalid_params",e)}function f(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function o(e,n){const t=e[n];if(typeof t!="string"||t==="")throw i(`"${n}" must be a non-empty string`);return t}function p(e,n){const t=e[n];if(t===void 0||typeof t=="string")return t;throw i(`"${n}" must be a string`)}function m(e,n){const t=e[n];if(t===void 0||typeof t=="number"&&Number.isFinite(t))return t;throw i(`"${n}" must be a number`)}function l(e,n){const t=e[n];if(t===void 0||typeof t=="number"&&Number.isInteger(t)&&t>0)return t;throw i(`"${n}" must be a positive integer`)}function g(e,n){const t=e[n];if(t===void 0||typeof t=="boolean")return t;throw i(`"${n}" must be a boolean`)}function c(e){if(!f(e))throw i('"ref" must be an object');switch(e.kind){case"surface":return{kind:"surface",surfaceId:o(e,"surfaceId")};case"entity":return{kind:"entity",entityId:o(e,"entityId"),surfaceId:p(e,"surfaceId")};case"action":return{kind:"action",actionId:o(e,"actionId")};case"route":return{kind:"route",appId:o(e,"appId"),pathname:o(e,"pathname")};default:throw i(`"ref.kind" must be one of ${u.join(", ")}`)}}function y(e){if(e===void 0)return;const n=[];if(Array.isArray(e)){for(const t of e){const s=u.find(r=>r===t);if(s===void 0)break;n.push(s)}if(n.length===e.length)return n}throw i(`"kinds" must list some of ${u.join(", ")}`)}function b(e){if(!f(e))throw i('"condition" must be an object');const{kind:n}=e;switch(n){case"present":case"absent":{const t=c(e.ref);if(t.kind==="route")throw i('wait for a route with { kind: "route", pathname }');return{kind:n,ref:t}}case"route":return{kind:"route",pathname:o(e,"pathname")};case"text":return{kind:"text",text:o(e,"text"),surfaceId:p(e,"surfaceId")};case"field":{const t=e.value;if(t!==null&&typeof t!="string"&&typeof t!="number"&&typeof t!="boolean")throw i('"value" must be a string, number, boolean or null');return{kind:"field",surfaceId:o(e,"surfaceId"),name:o(e,"name"),value:t}}default:throw i('"condition.kind" must be one of present, absent, route, text, field')}}async function h(e,n,t,s){const r=await e.dispatch(n,t,{by:"agent",signal:s});if(!r.ok)throw new a(r.error.code,r.error.message);return r}const w=[{name:"aegis_snapshot",description:"Read the current UI: the shell (app, route, theme, viewport), every surface on the page with its projected entities and fields and the ids of the actions bound to it, and the selection.",inputSchema:{type:"object",properties:{}},run:e=>e.snapshot()},{name:"aegis_inspect",description:"Noun-first discovery: returns the target plus the actions bound to it. Fails with not_found when the target is not on the page.",inputSchema:{type:"object",properties:{ref:d},required:["ref"]},run:(e,n)=>{const t=e.inspect(c(n.ref));if(!t)throw new a("not_found","inspect: target not found");return t}},{name:"aegis_search",description:"Free-text search across the snapshot and the search providers the page registered. Returns ranked refs in `results`; `failedProviders` names providers that failed, whose hits are missing.",inputSchema:{type:"object",properties:{query:{type:"string"},kinds:{type:"array",items:{type:"string",enum:u}},appId:{type:"string"},limit:{type:"integer",minimum:1}},required:["query"]},run:(e,n,t)=>{const{query:s}=n;if(typeof s!="string")throw i('"query" must be a string');return e.search(s,{kinds:y(n.kinds),appId:p(n,"appId"),limit:l(n,"limit"),signal:t})}},{name:"aegis_invoke",description:`The only write entry: runs a registered action by id, with optional params, as the agent. With dryRun: true nothing runs; it returns the action, the params and the action's own preview when it has one. Fails with unavailable for actions only the user may invoke (invocableBy: "user") and with needs_confirm for actions marked confirm.danger: the user has to run those, so point at the control with aegis_highlight. An action that fails comes back as a tool error.`,inputSchema:{type:"object",properties:{id:{type:"string"},params:{},dryRun:{type:"boolean"}},required:["id"]},run:async(e,n,t)=>{const s=o(n,"id");if(g(n,"dryRun")!==!0)return h(e,s,n.params,t);const r=await e.preview(s,n.params,{by:"agent",signal:t});if(!r.ok)throw new a(r.error.code,r.error.message);return r}},{name:"aegis_navigate",description:'Navigate to a path inside the console, such as /portal/datasets. `to` is a path like shell.route.pathname in the snapshot, and a relative path resolves from the current route as a URL path does (x from /gallery goes to /x). Prefer paths: a full URL must be on the origin of the page and fails with invalid_params when the base path of the app is unknown, as does a URL on another origin or a javascript:, data: or blob: URL. Sugar for aegis_invoke("aegis.navigate", { to }).',inputSchema:{type:"object",properties:{to:{type:"string"}},required:["to"]},run:(e,n,t)=>h(e,"aegis.navigate",{to:o(n,"to")},t)},{name:"aegis_highlight",description:"Scroll a surface, entity or action into view and ring it briefly, to point the user at it. Returns found: false when it is not on the page.",inputSchema:{type:"object",properties:{ref:d},required:["ref"]},run:(e,n)=>e.highlight(c(n.ref))},{name:"aegis_wait_for",description:"Wait until a condition holds, then return the snapshot; fails with timeout otherwise. Conditions: present / absent (ref is a surface, entity or action ref), route (the shell pathname equals pathname), text (text appears, case-insensitively, in a surface label, entity or field; only in surfaceId when given), field (field name on surface surfaceId equals value).",inputSchema:{type:"object",properties:{condition:{type:"object",description:'{ kind: "present" | "absent", ref } | { kind: "route", pathname } | { kind: "text", text, surfaceId? } | { kind: "field", surfaceId, name, value }.',properties:{kind:{type:"string",enum:["present","absent","route","text","field"]},ref:d,pathname:{type:"string"},text:{type:"string"},surfaceId:{type:"string"},name:{type:"string"},value:{type:["string","number","boolean","null"]}},required:["kind"]},timeoutMs:{type:"number",minimum:0,maximum:2e4,description:"Defaults to 5000; longer waits are cut to 20000."}},required:["condition"]},run:(e,n,t)=>e.waitFor(b(n.condition),{timeoutMs:m(n,"timeoutMs"),signal:t})}];exports.MCP_TOOLS=w;exports.McpToolError=a;
|
|
2
|
+
//# sourceMappingURL=mcpTools.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcpTools.cjs","sources":["../../src/transports/mcpTools.ts"],"sourcesContent":["// The tools the console's MCP bridge serves, each schema beside the handler\n// that runs it in the page. `pnpm gen:mcp-tools` writes the schemas to\n// apps/console/server/mcp_tools.generated.json for the Go server; the\n// script evaluates this module on its own, so it may import types only.\nimport type { AegisRuntime } from '../agent/core/runtime';\nimport type { AegisRef, AegisWaitCondition } from '../agent/core/types';\n\ntype ToolParams = Record<string, unknown>;\n\nexport interface McpTool {\n name: string;\n description: string;\n inputSchema: Record<string, unknown>;\n run: (\n runtime: AegisRuntime,\n params: ToolParams,\n signal: AbortSignal,\n ) => unknown;\n}\n\n/** Sent to the agent as a `tool.error` with this code. */\nexport class McpToolError extends Error {\n readonly code: string;\n\n constructor(code: string, message: string) {\n super(message);\n this.code = code;\n }\n}\n\nconst REF_KINDS: ReadonlyArray<AegisRef['kind']> = [\n 'surface',\n 'entity',\n 'action',\n 'route',\n];\n\nconst REF_SCHEMA = {\n type: 'object',\n description:\n 'A ref from aegis_snapshot or aegis_search: { kind: \"surface\", surfaceId } | { kind: \"entity\", entityId, surfaceId? } | { kind: \"action\", actionId } | { kind: \"route\", appId, pathname }.',\n properties: {\n kind: { type: 'string', enum: REF_KINDS },\n surfaceId: { type: 'string' },\n entityId: { type: 'string' },\n actionId: { type: 'string' },\n appId: { type: 'string' },\n pathname: { type: 'string' },\n },\n required: ['kind'],\n};\n\nfunction invalid(message: string): McpToolError {\n return new McpToolError('invalid_params', message);\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction requireString(params: ToolParams, key: string): string {\n const value = params[key];\n if (typeof value !== 'string' || value === '') {\n throw invalid(`\"${key}\" must be a non-empty string`);\n }\n return value;\n}\n\nfunction optionalString(params: ToolParams, key: string): string | undefined {\n const value = params[key];\n if (value === undefined || typeof value === 'string') {\n return value;\n }\n throw invalid(`\"${key}\" must be a string`);\n}\n\nfunction optionalNumber(params: ToolParams, key: string): number | undefined {\n const value = params[key];\n if (\n value === undefined ||\n (typeof value === 'number' && Number.isFinite(value))\n ) {\n return value;\n }\n throw invalid(`\"${key}\" must be a number`);\n}\n\nfunction optionalPositiveInteger(\n params: ToolParams,\n key: string,\n): number | undefined {\n const value = params[key];\n if (\n value === undefined ||\n (typeof value === 'number' && Number.isInteger(value) && value > 0)\n ) {\n return value;\n }\n throw invalid(`\"${key}\" must be a positive integer`);\n}\n\nfunction optionalBoolean(params: ToolParams, key: string): boolean | undefined {\n const value = params[key];\n if (value === undefined || typeof value === 'boolean') {\n return value;\n }\n throw invalid(`\"${key}\" must be a boolean`);\n}\n\nfunction parseRef(value: unknown): AegisRef {\n if (!isRecord(value)) {\n throw invalid('\"ref\" must be an object');\n }\n switch (value.kind) {\n case 'surface':\n return { kind: 'surface', surfaceId: requireString(value, 'surfaceId') };\n case 'entity':\n return {\n kind: 'entity',\n entityId: requireString(value, 'entityId'),\n surfaceId: optionalString(value, 'surfaceId'),\n };\n case 'action':\n return { kind: 'action', actionId: requireString(value, 'actionId') };\n case 'route':\n return {\n kind: 'route',\n appId: requireString(value, 'appId'),\n pathname: requireString(value, 'pathname'),\n };\n default:\n throw invalid(`\"ref.kind\" must be one of ${REF_KINDS.join(', ')}`);\n }\n}\n\nfunction parseKinds(value: unknown): Array<AegisRef['kind']> | undefined {\n if (value === undefined) {\n return undefined;\n }\n const kinds: Array<AegisRef['kind']> = [];\n if (Array.isArray(value)) {\n for (const item of value) {\n const kind = REF_KINDS.find((k) => k === item);\n if (kind === undefined) {\n break;\n }\n kinds.push(kind);\n }\n if (kinds.length === value.length) {\n return kinds;\n }\n }\n throw invalid(`\"kinds\" must list some of ${REF_KINDS.join(', ')}`);\n}\n\nfunction parseCondition(value: unknown): AegisWaitCondition {\n if (!isRecord(value)) {\n throw invalid('\"condition\" must be an object');\n }\n const { kind } = value;\n switch (kind) {\n case 'present':\n case 'absent': {\n const ref = parseRef(value.ref);\n if (ref.kind === 'route') {\n throw invalid('wait for a route with { kind: \"route\", pathname }');\n }\n return { kind, ref };\n }\n case 'route':\n return { kind: 'route', pathname: requireString(value, 'pathname') };\n case 'text':\n return {\n kind: 'text',\n text: requireString(value, 'text'),\n surfaceId: optionalString(value, 'surfaceId'),\n };\n case 'field': {\n const expected = value.value;\n if (\n expected !== null &&\n typeof expected !== 'string' &&\n typeof expected !== 'number' &&\n typeof expected !== 'boolean'\n ) {\n throw invalid('\"value\" must be a string, number, boolean or null');\n }\n return {\n kind: 'field',\n surfaceId: requireString(value, 'surfaceId'),\n name: requireString(value, 'name'),\n value: expected,\n };\n }\n default:\n throw invalid(\n '\"condition.kind\" must be one of present, absent, route, text, field',\n );\n }\n}\n\nasync function dispatchAsAgent(\n runtime: AegisRuntime,\n id: string,\n params: unknown,\n signal: AbortSignal,\n): Promise<unknown> {\n const result = await runtime.dispatch(id, params, { by: 'agent', signal });\n if (!result.ok) {\n throw new McpToolError(result.error.code, result.error.message);\n }\n return result;\n}\n\nexport const MCP_TOOLS: McpTool[] = [\n {\n name: 'aegis_snapshot',\n description:\n 'Read the current UI: the shell (app, route, theme, viewport), every surface on the page with its projected entities and fields and the ids of the actions bound to it, and the selection.',\n inputSchema: { type: 'object', properties: {} },\n run: (runtime) => runtime.snapshot(),\n },\n {\n name: 'aegis_inspect',\n description:\n 'Noun-first discovery: returns the target plus the actions bound to it. Fails with not_found when the target is not on the page.',\n inputSchema: {\n type: 'object',\n properties: { ref: REF_SCHEMA },\n required: ['ref'],\n },\n run: (runtime, params) => {\n const result = runtime.inspect(parseRef(params.ref));\n if (!result) {\n throw new McpToolError('not_found', 'inspect: target not found');\n }\n return result;\n },\n },\n {\n name: 'aegis_search',\n description:\n 'Free-text search across the snapshot and the search providers the page registered. Returns ranked refs in `results`; `failedProviders` names providers that failed, whose hits are missing.',\n inputSchema: {\n type: 'object',\n properties: {\n query: { type: 'string' },\n kinds: { type: 'array', items: { type: 'string', enum: REF_KINDS } },\n appId: { type: 'string' },\n limit: { type: 'integer', minimum: 1 },\n },\n required: ['query'],\n },\n run: (runtime, params, signal) => {\n const { query } = params;\n if (typeof query !== 'string') {\n throw invalid('\"query\" must be a string');\n }\n return runtime.search(query, {\n kinds: parseKinds(params.kinds),\n appId: optionalString(params, 'appId'),\n limit: optionalPositiveInteger(params, 'limit'),\n signal,\n });\n },\n },\n {\n name: 'aegis_invoke',\n description:\n 'The only write entry: runs a registered action by id, with optional params, as the agent. With dryRun: true nothing runs; it returns the action, the params and the action\\'s own preview when it has one. Fails with unavailable for actions only the user may invoke (invocableBy: \"user\") and with needs_confirm for actions marked confirm.danger: the user has to run those, so point at the control with aegis_highlight. An action that fails comes back as a tool error.',\n inputSchema: {\n type: 'object',\n properties: {\n id: { type: 'string' },\n params: {},\n dryRun: { type: 'boolean' },\n },\n required: ['id'],\n },\n run: async (runtime, params, signal) => {\n const id = requireString(params, 'id');\n if (optionalBoolean(params, 'dryRun') !== true) {\n return dispatchAsAgent(runtime, id, params.params, signal);\n }\n const preview = await runtime.preview(id, params.params, {\n by: 'agent',\n signal,\n });\n if (!preview.ok) {\n throw new McpToolError(preview.error.code, preview.error.message);\n }\n return preview;\n },\n },\n {\n name: 'aegis_navigate',\n description:\n 'Navigate to a path inside the console, such as /portal/datasets. `to` is a path like shell.route.pathname in the snapshot, and a relative path resolves from the current route as a URL path does (x from /gallery goes to /x). Prefer paths: a full URL must be on the origin of the page and fails with invalid_params when the base path of the app is unknown, as does a URL on another origin or a javascript:, data: or blob: URL. Sugar for aegis_invoke(\"aegis.navigate\", { to }).',\n inputSchema: {\n type: 'object',\n properties: { to: { type: 'string' } },\n required: ['to'],\n },\n run: (runtime, params, signal) =>\n dispatchAsAgent(\n runtime,\n 'aegis.navigate',\n { to: requireString(params, 'to') },\n signal,\n ),\n },\n {\n name: 'aegis_highlight',\n description:\n 'Scroll a surface, entity or action into view and ring it briefly, to point the user at it. Returns found: false when it is not on the page.',\n inputSchema: {\n type: 'object',\n properties: { ref: REF_SCHEMA },\n required: ['ref'],\n },\n run: (runtime, params) => runtime.highlight(parseRef(params.ref)),\n },\n {\n name: 'aegis_wait_for',\n description:\n 'Wait until a condition holds, then return the snapshot; fails with timeout otherwise. Conditions: present / absent (ref is a surface, entity or action ref), route (the shell pathname equals pathname), text (text appears, case-insensitively, in a surface label, entity or field; only in surfaceId when given), field (field name on surface surfaceId equals value).',\n inputSchema: {\n type: 'object',\n properties: {\n condition: {\n type: 'object',\n description:\n '{ kind: \"present\" | \"absent\", ref } | { kind: \"route\", pathname } | { kind: \"text\", text, surfaceId? } | { kind: \"field\", surfaceId, name, value }.',\n properties: {\n kind: {\n type: 'string',\n enum: ['present', 'absent', 'route', 'text', 'field'],\n },\n ref: REF_SCHEMA,\n pathname: { type: 'string' },\n text: { type: 'string' },\n surfaceId: { type: 'string' },\n name: { type: 'string' },\n value: { type: ['string', 'number', 'boolean', 'null'] },\n },\n required: ['kind'],\n },\n timeoutMs: {\n type: 'number',\n minimum: 0,\n maximum: 20000,\n description: 'Defaults to 5000; longer waits are cut to 20000.',\n },\n },\n required: ['condition'],\n },\n run: (runtime, params, signal) =>\n runtime.waitFor(parseCondition(params.condition), {\n timeoutMs: optionalNumber(params, 'timeoutMs'),\n signal,\n }),\n },\n];\n"],"names":["McpToolError","code","message","REF_KINDS","REF_SCHEMA","invalid","isRecord","value","requireString","params","key","optionalString","optionalNumber","optionalPositiveInteger","optionalBoolean","parseRef","parseKinds","kinds","item","kind","k","parseCondition","ref","expected","dispatchAsAgent","runtime","id","signal","result","MCP_TOOLS","query","preview"],"mappings":"gFAqBO,MAAMA,UAAqB,KAAM,CAC7B,KAET,YAAYC,EAAcC,EAAiB,CACzC,MAAMA,CAAO,EACb,KAAK,KAAOD,CACd,CACF,CAEA,MAAME,EAA6C,CACjD,UACA,SACA,SACA,OACF,EAEMC,EAAa,CACjB,KAAM,SACN,YACE,4LACF,WAAY,CACV,KAAM,CAAE,KAAM,SAAU,KAAMD,CAAA,EAC9B,UAAW,CA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AAK,CAACN,EAAShB,EAAQkB,IACrBH,EACEC,EACA,iBACA,CAAE,GAAIjB,EAAcC,EAAQ,IAAI,CAAA,EAChCkB,CAAA,CACF,EAEJ,CACE,KAAM,kBACN,YACE,8IACF,YAAa,CACX,KAAM,SACN,WAAY,CAAE,IAAKvB,CAAA,EACnB,SAAU,CAAC,KAAK,CAAA,EAElB,IAAK,CAACqB,EAAShB,IAAWgB,EAAQ,UAAUV,EAASN,EAAO,GAAG,CAAC,CAAA,EAElE,CACE,KAAM,iBACN,YACE,6WACF,YAAa,CACX,KAAM,SACN,WAAY,CACV,UAAW,CACT,KAAM,SACN,YACE,sJACF,WAAY,CACV,KAAM,CACJ,KAAM,SACN,KAAM,CAAC,UAAW,SAAU,QAAS,OAAQ,OAAO,CAAA,EAEtD,IAAKL,EACL,SAAU,CAAE,KAAM,QAAA,EAClB,KAAM,CAAE,KAAM,QAAA,EACd,UAAW,CAAE,KAAM,QAAA,EACnB,KAAM,CAAE,KAAM,QAAA,EACd,MAAO,CAAE,KAAM,CAAC,SAAU,SAAU,UAAW,MAAM,CAAA,CAAE,EAEzD,SAAU,CAAC,MAAM,CAAA,EAEnB,UAAW,CACT,KAAM,SACN,QAAS,EACT,QAAS,IACT,YAAa,kDAAA,CACf,EAEF,SAAU,CAAC,WAAW,CAAA,EAExB,IAAK,CAACqB,EAAShB,EAAQkB,IACrBF,EAAQ,QAAQJ,EAAeZ,EAAO,SAAS,EAAG,CAChD,UAAWG,EAAeH,EAAQ,WAAW,EAC7C,OAAAkB,CAAA,CACD,CAAA,CAEP"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AegisRuntime } from '../agent/core/runtime';
|
|
2
|
+
type ToolParams = Record<string, unknown>;
|
|
3
|
+
export interface McpTool {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
inputSchema: Record<string, unknown>;
|
|
7
|
+
run: (runtime: AegisRuntime, params: ToolParams, signal: AbortSignal) => unknown;
|
|
8
|
+
}
|
|
9
|
+
/** Sent to the agent as a `tool.error` with this code. */
|
|
10
|
+
export declare class McpToolError extends Error {
|
|
11
|
+
readonly code: string;
|
|
12
|
+
constructor(code: string, message: string);
|
|
13
|
+
}
|
|
14
|
+
export declare const MCP_TOOLS: McpTool[];
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
class u extends Error {
|
|
2
|
+
code;
|
|
3
|
+
constructor(n, t) {
|
|
4
|
+
super(t), this.code = n;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
const a = [
|
|
8
|
+
"surface",
|
|
9
|
+
"entity",
|
|
10
|
+
"action",
|
|
11
|
+
"route"
|
|
12
|
+
], d = {
|
|
13
|
+
type: "object",
|
|
14
|
+
description: 'A ref from aegis_snapshot or aegis_search: { kind: "surface", surfaceId } | { kind: "entity", entityId, surfaceId? } | { kind: "action", actionId } | { kind: "route", appId, pathname }.',
|
|
15
|
+
properties: {
|
|
16
|
+
kind: { type: "string", enum: a },
|
|
17
|
+
surfaceId: { type: "string" },
|
|
18
|
+
entityId: { type: "string" },
|
|
19
|
+
actionId: { type: "string" },
|
|
20
|
+
appId: { type: "string" },
|
|
21
|
+
pathname: { type: "string" }
|
|
22
|
+
},
|
|
23
|
+
required: ["kind"]
|
|
24
|
+
};
|
|
25
|
+
function i(e) {
|
|
26
|
+
return new u("invalid_params", e);
|
|
27
|
+
}
|
|
28
|
+
function f(e) {
|
|
29
|
+
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
30
|
+
}
|
|
31
|
+
function o(e, n) {
|
|
32
|
+
const t = e[n];
|
|
33
|
+
if (typeof t != "string" || t === "")
|
|
34
|
+
throw i(`"${n}" must be a non-empty string`);
|
|
35
|
+
return t;
|
|
36
|
+
}
|
|
37
|
+
function c(e, n) {
|
|
38
|
+
const t = e[n];
|
|
39
|
+
if (t === void 0 || typeof t == "string")
|
|
40
|
+
return t;
|
|
41
|
+
throw i(`"${n}" must be a string`);
|
|
42
|
+
}
|
|
43
|
+
function m(e, n) {
|
|
44
|
+
const t = e[n];
|
|
45
|
+
if (t === void 0 || typeof t == "number" && Number.isFinite(t))
|
|
46
|
+
return t;
|
|
47
|
+
throw i(`"${n}" must be a number`);
|
|
48
|
+
}
|
|
49
|
+
function l(e, n) {
|
|
50
|
+
const t = e[n];
|
|
51
|
+
if (t === void 0 || typeof t == "number" && Number.isInteger(t) && t > 0)
|
|
52
|
+
return t;
|
|
53
|
+
throw i(`"${n}" must be a positive integer`);
|
|
54
|
+
}
|
|
55
|
+
function g(e, n) {
|
|
56
|
+
const t = e[n];
|
|
57
|
+
if (t === void 0 || typeof t == "boolean")
|
|
58
|
+
return t;
|
|
59
|
+
throw i(`"${n}" must be a boolean`);
|
|
60
|
+
}
|
|
61
|
+
function p(e) {
|
|
62
|
+
if (!f(e))
|
|
63
|
+
throw i('"ref" must be an object');
|
|
64
|
+
switch (e.kind) {
|
|
65
|
+
case "surface":
|
|
66
|
+
return { kind: "surface", surfaceId: o(e, "surfaceId") };
|
|
67
|
+
case "entity":
|
|
68
|
+
return {
|
|
69
|
+
kind: "entity",
|
|
70
|
+
entityId: o(e, "entityId"),
|
|
71
|
+
surfaceId: c(e, "surfaceId")
|
|
72
|
+
};
|
|
73
|
+
case "action":
|
|
74
|
+
return { kind: "action", actionId: o(e, "actionId") };
|
|
75
|
+
case "route":
|
|
76
|
+
return {
|
|
77
|
+
kind: "route",
|
|
78
|
+
appId: o(e, "appId"),
|
|
79
|
+
pathname: o(e, "pathname")
|
|
80
|
+
};
|
|
81
|
+
default:
|
|
82
|
+
throw i(`"ref.kind" must be one of ${a.join(", ")}`);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
function y(e) {
|
|
86
|
+
if (e === void 0)
|
|
87
|
+
return;
|
|
88
|
+
const n = [];
|
|
89
|
+
if (Array.isArray(e)) {
|
|
90
|
+
for (const t of e) {
|
|
91
|
+
const s = a.find((r) => r === t);
|
|
92
|
+
if (s === void 0)
|
|
93
|
+
break;
|
|
94
|
+
n.push(s);
|
|
95
|
+
}
|
|
96
|
+
if (n.length === e.length)
|
|
97
|
+
return n;
|
|
98
|
+
}
|
|
99
|
+
throw i(`"kinds" must list some of ${a.join(", ")}`);
|
|
100
|
+
}
|
|
101
|
+
function b(e) {
|
|
102
|
+
if (!f(e))
|
|
103
|
+
throw i('"condition" must be an object');
|
|
104
|
+
const { kind: n } = e;
|
|
105
|
+
switch (n) {
|
|
106
|
+
case "present":
|
|
107
|
+
case "absent": {
|
|
108
|
+
const t = p(e.ref);
|
|
109
|
+
if (t.kind === "route")
|
|
110
|
+
throw i('wait for a route with { kind: "route", pathname }');
|
|
111
|
+
return { kind: n, ref: t };
|
|
112
|
+
}
|
|
113
|
+
case "route":
|
|
114
|
+
return { kind: "route", pathname: o(e, "pathname") };
|
|
115
|
+
case "text":
|
|
116
|
+
return {
|
|
117
|
+
kind: "text",
|
|
118
|
+
text: o(e, "text"),
|
|
119
|
+
surfaceId: c(e, "surfaceId")
|
|
120
|
+
};
|
|
121
|
+
case "field": {
|
|
122
|
+
const t = e.value;
|
|
123
|
+
if (t !== null && typeof t != "string" && typeof t != "number" && typeof t != "boolean")
|
|
124
|
+
throw i('"value" must be a string, number, boolean or null');
|
|
125
|
+
return {
|
|
126
|
+
kind: "field",
|
|
127
|
+
surfaceId: o(e, "surfaceId"),
|
|
128
|
+
name: o(e, "name"),
|
|
129
|
+
value: t
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
default:
|
|
133
|
+
throw i(
|
|
134
|
+
'"condition.kind" must be one of present, absent, route, text, field'
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
async function h(e, n, t, s) {
|
|
139
|
+
const r = await e.dispatch(n, t, { by: "agent", signal: s });
|
|
140
|
+
if (!r.ok)
|
|
141
|
+
throw new u(r.error.code, r.error.message);
|
|
142
|
+
return r;
|
|
143
|
+
}
|
|
144
|
+
const w = [
|
|
145
|
+
{
|
|
146
|
+
name: "aegis_snapshot",
|
|
147
|
+
description: "Read the current UI: the shell (app, route, theme, viewport), every surface on the page with its projected entities and fields and the ids of the actions bound to it, and the selection.",
|
|
148
|
+
inputSchema: { type: "object", properties: {} },
|
|
149
|
+
run: (e) => e.snapshot()
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
name: "aegis_inspect",
|
|
153
|
+
description: "Noun-first discovery: returns the target plus the actions bound to it. Fails with not_found when the target is not on the page.",
|
|
154
|
+
inputSchema: {
|
|
155
|
+
type: "object",
|
|
156
|
+
properties: { ref: d },
|
|
157
|
+
required: ["ref"]
|
|
158
|
+
},
|
|
159
|
+
run: (e, n) => {
|
|
160
|
+
const t = e.inspect(p(n.ref));
|
|
161
|
+
if (!t)
|
|
162
|
+
throw new u("not_found", "inspect: target not found");
|
|
163
|
+
return t;
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
name: "aegis_search",
|
|
168
|
+
description: "Free-text search across the snapshot and the search providers the page registered. Returns ranked refs in `results`; `failedProviders` names providers that failed, whose hits are missing.",
|
|
169
|
+
inputSchema: {
|
|
170
|
+
type: "object",
|
|
171
|
+
properties: {
|
|
172
|
+
query: { type: "string" },
|
|
173
|
+
kinds: { type: "array", items: { type: "string", enum: a } },
|
|
174
|
+
appId: { type: "string" },
|
|
175
|
+
limit: { type: "integer", minimum: 1 }
|
|
176
|
+
},
|
|
177
|
+
required: ["query"]
|
|
178
|
+
},
|
|
179
|
+
run: (e, n, t) => {
|
|
180
|
+
const { query: s } = n;
|
|
181
|
+
if (typeof s != "string")
|
|
182
|
+
throw i('"query" must be a string');
|
|
183
|
+
return e.search(s, {
|
|
184
|
+
kinds: y(n.kinds),
|
|
185
|
+
appId: c(n, "appId"),
|
|
186
|
+
limit: l(n, "limit"),
|
|
187
|
+
signal: t
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
name: "aegis_invoke",
|
|
193
|
+
description: `The only write entry: runs a registered action by id, with optional params, as the agent. With dryRun: true nothing runs; it returns the action, the params and the action's own preview when it has one. Fails with unavailable for actions only the user may invoke (invocableBy: "user") and with needs_confirm for actions marked confirm.danger: the user has to run those, so point at the control with aegis_highlight. An action that fails comes back as a tool error.`,
|
|
194
|
+
inputSchema: {
|
|
195
|
+
type: "object",
|
|
196
|
+
properties: {
|
|
197
|
+
id: { type: "string" },
|
|
198
|
+
params: {},
|
|
199
|
+
dryRun: { type: "boolean" }
|
|
200
|
+
},
|
|
201
|
+
required: ["id"]
|
|
202
|
+
},
|
|
203
|
+
run: async (e, n, t) => {
|
|
204
|
+
const s = o(n, "id");
|
|
205
|
+
if (g(n, "dryRun") !== !0)
|
|
206
|
+
return h(e, s, n.params, t);
|
|
207
|
+
const r = await e.preview(s, n.params, {
|
|
208
|
+
by: "agent",
|
|
209
|
+
signal: t
|
|
210
|
+
});
|
|
211
|
+
if (!r.ok)
|
|
212
|
+
throw new u(r.error.code, r.error.message);
|
|
213
|
+
return r;
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
name: "aegis_navigate",
|
|
218
|
+
description: 'Navigate to a path inside the console, such as /portal/datasets. `to` is a path like shell.route.pathname in the snapshot, and a relative path resolves from the current route as a URL path does (x from /gallery goes to /x). Prefer paths: a full URL must be on the origin of the page and fails with invalid_params when the base path of the app is unknown, as does a URL on another origin or a javascript:, data: or blob: URL. Sugar for aegis_invoke("aegis.navigate", { to }).',
|
|
219
|
+
inputSchema: {
|
|
220
|
+
type: "object",
|
|
221
|
+
properties: { to: { type: "string" } },
|
|
222
|
+
required: ["to"]
|
|
223
|
+
},
|
|
224
|
+
run: (e, n, t) => h(
|
|
225
|
+
e,
|
|
226
|
+
"aegis.navigate",
|
|
227
|
+
{ to: o(n, "to") },
|
|
228
|
+
t
|
|
229
|
+
)
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
name: "aegis_highlight",
|
|
233
|
+
description: "Scroll a surface, entity or action into view and ring it briefly, to point the user at it. Returns found: false when it is not on the page.",
|
|
234
|
+
inputSchema: {
|
|
235
|
+
type: "object",
|
|
236
|
+
properties: { ref: d },
|
|
237
|
+
required: ["ref"]
|
|
238
|
+
},
|
|
239
|
+
run: (e, n) => e.highlight(p(n.ref))
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
name: "aegis_wait_for",
|
|
243
|
+
description: "Wait until a condition holds, then return the snapshot; fails with timeout otherwise. Conditions: present / absent (ref is a surface, entity or action ref), route (the shell pathname equals pathname), text (text appears, case-insensitively, in a surface label, entity or field; only in surfaceId when given), field (field name on surface surfaceId equals value).",
|
|
244
|
+
inputSchema: {
|
|
245
|
+
type: "object",
|
|
246
|
+
properties: {
|
|
247
|
+
condition: {
|
|
248
|
+
type: "object",
|
|
249
|
+
description: '{ kind: "present" | "absent", ref } | { kind: "route", pathname } | { kind: "text", text, surfaceId? } | { kind: "field", surfaceId, name, value }.',
|
|
250
|
+
properties: {
|
|
251
|
+
kind: {
|
|
252
|
+
type: "string",
|
|
253
|
+
enum: ["present", "absent", "route", "text", "field"]
|
|
254
|
+
},
|
|
255
|
+
ref: d,
|
|
256
|
+
pathname: { type: "string" },
|
|
257
|
+
text: { type: "string" },
|
|
258
|
+
surfaceId: { type: "string" },
|
|
259
|
+
name: { type: "string" },
|
|
260
|
+
value: { type: ["string", "number", "boolean", "null"] }
|
|
261
|
+
},
|
|
262
|
+
required: ["kind"]
|
|
263
|
+
},
|
|
264
|
+
timeoutMs: {
|
|
265
|
+
type: "number",
|
|
266
|
+
minimum: 0,
|
|
267
|
+
maximum: 2e4,
|
|
268
|
+
description: "Defaults to 5000; longer waits are cut to 20000."
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
required: ["condition"]
|
|
272
|
+
},
|
|
273
|
+
run: (e, n, t) => e.waitFor(b(n.condition), {
|
|
274
|
+
timeoutMs: m(n, "timeoutMs"),
|
|
275
|
+
signal: t
|
|
276
|
+
})
|
|
277
|
+
}
|
|
278
|
+
];
|
|
279
|
+
export {
|
|
280
|
+
w as MCP_TOOLS,
|
|
281
|
+
u as McpToolError
|
|
282
|
+
};
|
|
283
|
+
//# sourceMappingURL=mcpTools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcpTools.js","sources":["../../src/transports/mcpTools.ts"],"sourcesContent":["// The tools the console's MCP bridge serves, each schema beside the handler\n// that runs it in the page. `pnpm gen:mcp-tools` writes the schemas to\n// apps/console/server/mcp_tools.generated.json for the Go server; the\n// script evaluates this module on its own, so it may import types only.\nimport type { AegisRuntime } from '../agent/core/runtime';\nimport type { AegisRef, AegisWaitCondition } from '../agent/core/types';\n\ntype ToolParams = Record<string, unknown>;\n\nexport interface McpTool {\n name: string;\n description: string;\n inputSchema: Record<string, unknown>;\n run: (\n runtime: AegisRuntime,\n params: ToolParams,\n signal: AbortSignal,\n ) => unknown;\n}\n\n/** Sent to the agent as a `tool.error` with this code. */\nexport class McpToolError extends Error {\n readonly code: string;\n\n constructor(code: string, message: string) {\n super(message);\n this.code = code;\n }\n}\n\nconst REF_KINDS: ReadonlyArray<AegisRef['kind']> = [\n 'surface',\n 'entity',\n 'action',\n 'route',\n];\n\nconst REF_SCHEMA = {\n type: 'object',\n description:\n 'A ref from aegis_snapshot or aegis_search: { kind: \"surface\", surfaceId } | { kind: \"entity\", entityId, surfaceId? } | { kind: \"action\", actionId } | { kind: \"route\", appId, pathname }.',\n properties: {\n kind: { type: 'string', enum: REF_KINDS },\n surfaceId: { type: 'string' },\n entityId: { type: 'string' },\n actionId: { type: 'string' },\n appId: { type: 'string' },\n pathname: { type: 'string' },\n },\n required: ['kind'],\n};\n\nfunction invalid(message: string): McpToolError {\n return new McpToolError('invalid_params', message);\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction requireString(params: ToolParams, key: string): string {\n const value = params[key];\n if (typeof value !== 'string' || value === '') {\n throw invalid(`\"${key}\" must be a non-empty string`);\n }\n return value;\n}\n\nfunction optionalString(params: ToolParams, key: string): string | undefined {\n const value = params[key];\n if (value === undefined || typeof value === 'string') {\n return value;\n }\n throw invalid(`\"${key}\" must be a string`);\n}\n\nfunction optionalNumber(params: ToolParams, key: string): number | undefined {\n const value = params[key];\n if (\n value === undefined ||\n (typeof value === 'number' && Number.isFinite(value))\n ) {\n return value;\n }\n throw invalid(`\"${key}\" must be a number`);\n}\n\nfunction optionalPositiveInteger(\n params: ToolParams,\n key: string,\n): number | undefined {\n const value = params[key];\n if (\n value === undefined ||\n (typeof value === 'number' && Number.isInteger(value) && value > 0)\n ) {\n return value;\n }\n throw invalid(`\"${key}\" must be a positive integer`);\n}\n\nfunction optionalBoolean(params: ToolParams, key: string): boolean | undefined {\n const value = params[key];\n if (value === undefined || typeof value === 'boolean') {\n return value;\n }\n throw invalid(`\"${key}\" must be a boolean`);\n}\n\nfunction parseRef(value: unknown): AegisRef {\n if (!isRecord(value)) {\n throw invalid('\"ref\" must be an object');\n }\n switch (value.kind) {\n case 'surface':\n return { kind: 'surface', surfaceId: requireString(value, 'surfaceId') };\n case 'entity':\n return {\n kind: 'entity',\n entityId: requireString(value, 'entityId'),\n surfaceId: optionalString(value, 'surfaceId'),\n };\n case 'action':\n return { kind: 'action', actionId: requireString(value, 'actionId') };\n case 'route':\n return {\n kind: 'route',\n appId: requireString(value, 'appId'),\n pathname: requireString(value, 'pathname'),\n };\n default:\n throw invalid(`\"ref.kind\" must be one of ${REF_KINDS.join(', ')}`);\n }\n}\n\nfunction parseKinds(value: unknown): Array<AegisRef['kind']> | undefined {\n if (value === undefined) {\n return undefined;\n }\n const kinds: Array<AegisRef['kind']> = [];\n if (Array.isArray(value)) {\n for (const item of value) {\n const kind = REF_KINDS.find((k) => k === item);\n if (kind === undefined) {\n break;\n }\n kinds.push(kind);\n }\n if (kinds.length === value.length) {\n return kinds;\n }\n }\n throw invalid(`\"kinds\" must list some of ${REF_KINDS.join(', ')}`);\n}\n\nfunction parseCondition(value: unknown): AegisWaitCondition {\n if (!isRecord(value)) {\n throw invalid('\"condition\" must be an object');\n }\n const { kind } = value;\n switch (kind) {\n case 'present':\n case 'absent': {\n const ref = parseRef(value.ref);\n if (ref.kind === 'route') {\n throw invalid('wait for a route with { kind: \"route\", pathname }');\n }\n return { kind, ref };\n }\n case 'route':\n return { kind: 'route', pathname: requireString(value, 'pathname') };\n case 'text':\n return {\n kind: 'text',\n text: requireString(value, 'text'),\n surfaceId: optionalString(value, 'surfaceId'),\n };\n case 'field': {\n const expected = value.value;\n if (\n expected !== null &&\n typeof expected !== 'string' &&\n typeof expected !== 'number' &&\n typeof expected !== 'boolean'\n ) {\n throw invalid('\"value\" must be a string, number, boolean or null');\n }\n return {\n kind: 'field',\n surfaceId: requireString(value, 'surfaceId'),\n name: requireString(value, 'name'),\n value: expected,\n };\n }\n default:\n throw invalid(\n '\"condition.kind\" must be one of present, absent, route, text, field',\n );\n }\n}\n\nasync function dispatchAsAgent(\n runtime: AegisRuntime,\n id: string,\n params: unknown,\n signal: AbortSignal,\n): Promise<unknown> {\n const result = await runtime.dispatch(id, params, { by: 'agent', signal });\n if (!result.ok) {\n throw new McpToolError(result.error.code, result.error.message);\n }\n return result;\n}\n\nexport const MCP_TOOLS: McpTool[] = [\n {\n name: 'aegis_snapshot',\n description:\n 'Read the current UI: the shell (app, route, theme, viewport), every surface on the page with its projected entities and fields and the ids of the actions bound to it, and the selection.',\n inputSchema: { type: 'object', properties: {} },\n run: (runtime) => runtime.snapshot(),\n },\n {\n name: 'aegis_inspect',\n description:\n 'Noun-first discovery: returns the target plus the actions bound to it. Fails with not_found when the target is not on the page.',\n inputSchema: {\n type: 'object',\n properties: { ref: REF_SCHEMA },\n required: ['ref'],\n },\n run: (runtime, params) => {\n const result = runtime.inspect(parseRef(params.ref));\n if (!result) {\n throw new McpToolError('not_found', 'inspect: target not found');\n }\n return result;\n },\n },\n {\n name: 'aegis_search',\n description:\n 'Free-text search across the snapshot and the search providers the page registered. Returns ranked refs in `results`; `failedProviders` names providers that failed, whose hits are missing.',\n inputSchema: {\n type: 'object',\n properties: {\n query: { type: 'string' },\n kinds: { type: 'array', items: { type: 'string', enum: REF_KINDS } },\n appId: { type: 'string' },\n limit: { type: 'integer', minimum: 1 },\n },\n required: ['query'],\n },\n run: (runtime, params, signal) => {\n const { query } = params;\n if (typeof query !== 'string') {\n throw invalid('\"query\" must be a string');\n }\n return runtime.search(query, {\n kinds: parseKinds(params.kinds),\n appId: optionalString(params, 'appId'),\n limit: optionalPositiveInteger(params, 'limit'),\n signal,\n });\n },\n },\n {\n name: 'aegis_invoke',\n description:\n 'The only write entry: runs a registered action by id, with optional params, as the agent. With dryRun: true nothing runs; it returns the action, the params and the action\\'s own preview when it has one. Fails with unavailable for actions only the user may invoke (invocableBy: \"user\") and with needs_confirm for actions marked confirm.danger: the user has to run those, so point at the control with aegis_highlight. An action that fails comes back as a tool error.',\n inputSchema: {\n type: 'object',\n properties: {\n id: { type: 'string' },\n params: {},\n dryRun: { type: 'boolean' },\n },\n required: ['id'],\n },\n run: async (runtime, params, signal) => {\n const id = requireString(params, 'id');\n if (optionalBoolean(params, 'dryRun') !== true) {\n return dispatchAsAgent(runtime, id, params.params, signal);\n }\n const preview = await runtime.preview(id, params.params, {\n by: 'agent',\n signal,\n });\n if (!preview.ok) {\n throw new McpToolError(preview.error.code, preview.error.message);\n }\n return preview;\n },\n },\n {\n name: 'aegis_navigate',\n description:\n 'Navigate to a path inside the console, such as /portal/datasets. `to` is a path like shell.route.pathname in the snapshot, and a relative path resolves from the current route as a URL path does (x from /gallery goes to /x). Prefer paths: a full URL must be on the origin of the page and fails with invalid_params when the base path of the app is unknown, as does a URL on another origin or a javascript:, data: or blob: URL. Sugar for aegis_invoke(\"aegis.navigate\", { to }).',\n inputSchema: {\n type: 'object',\n properties: { to: { type: 'string' } },\n required: ['to'],\n },\n run: (runtime, params, signal) =>\n dispatchAsAgent(\n runtime,\n 'aegis.navigate',\n { to: requireString(params, 'to') },\n signal,\n ),\n },\n {\n name: 'aegis_highlight',\n description:\n 'Scroll a surface, entity or action into view and ring it briefly, to point the user at it. Returns found: false when it is not on the page.',\n inputSchema: {\n type: 'object',\n properties: { ref: REF_SCHEMA },\n required: ['ref'],\n },\n run: (runtime, params) => runtime.highlight(parseRef(params.ref)),\n },\n {\n name: 'aegis_wait_for',\n description:\n 'Wait until a condition holds, then return the snapshot; fails with timeout otherwise. Conditions: present / absent (ref is a surface, entity or action ref), route (the shell pathname equals pathname), text (text appears, case-insensitively, in a surface label, entity or field; only in surfaceId when given), field (field name on surface surfaceId equals value).',\n inputSchema: {\n type: 'object',\n properties: {\n condition: {\n type: 'object',\n description:\n '{ kind: \"present\" | \"absent\", ref } | { kind: \"route\", pathname } | { kind: \"text\", text, surfaceId? } | { kind: \"field\", surfaceId, name, value }.',\n properties: {\n kind: {\n type: 'string',\n enum: ['present', 'absent', 'route', 'text', 'field'],\n },\n ref: REF_SCHEMA,\n pathname: { type: 'string' },\n text: { type: 'string' },\n surfaceId: { type: 'string' },\n name: { type: 'string' },\n value: { type: ['string', 'number', 'boolean', 'null'] },\n },\n required: ['kind'],\n },\n timeoutMs: {\n type: 'number',\n minimum: 0,\n maximum: 20000,\n description: 'Defaults to 5000; longer waits are cut to 20000.',\n },\n },\n required: ['condition'],\n },\n run: (runtime, params, signal) =>\n runtime.waitFor(parseCondition(params.condition), {\n timeoutMs: optionalNumber(params, 'timeoutMs'),\n signal,\n }),\n },\n];\n"],"names":["McpToolError","code","message","REF_KINDS","REF_SCHEMA","invalid","isRecord","value","requireString","params","key","optionalString","optionalNumber","optionalPositiveInteger","optionalBoolean","parseRef","parseKinds","kinds","item","kind","k","parseCondition","ref","expected","dispatchAsAgent","runtime","id","signal","result","MCP_TOOLS","query","preview"],"mappings":"AAqBO,MAAMA,UAAqB,MAAM;AAAA,EAC7B;AAAA,EAET,YAAYC,GAAcC,GAAiB;AACzC,UAAMA,CAAO,GACb,KAAK,OAAOD;AAA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O,GAAG,CAAC;AAAA,EAAA;AAAA,EAElE;AAAA,IACE,MAAM;AAAA,IACN,aACE;AAAA,IACF,aAAa;AAAA,MACX,MAAM;AAAA,MACN,YAAY;AAAA,QACV,WAAW;AAAA,UACT,MAAM;AAAA,UACN,aACE;AAAA,UACF,YAAY;AAAA,YACV,MAAM;AAAA,cACJ,MAAM;AAAA,cACN,MAAM,CAAC,WAAW,UAAU,SAAS,QAAQ,OAAO;AAAA,YAAA;AAAA,YAEtD,KAAKL;AAAA,YACL,UAAU,EAAE,MAAM,SAAA;AAAA,YAClB,MAAM,EAAE,MAAM,SAAA;AAAA,YACd,WAAW,EAAE,MAAM,SAAA;AAAA,YACnB,MAAM,EAAE,MAAM,SAAA;AAAA,YACd,OAAO,EAAE,MAAM,CAAC,UAAU,UAAU,WAAW,MAAM,EAAA;AAAA,UAAE;AAAA,UAEzD,UAAU,CAAC,MAAM;AAAA,QAAA;AAAA,QAEnB,WAAW;AAAA,UACT,MAAM;AAAA,UACN,SAAS;AAAA,UACT,SAAS;AAAA,UACT,aAAa;AAAA,QAAA;AAAA,MACf;AAAA,MAEF,UAAU,CAAC,WAAW;AAAA,IAAA;AAAA,IAExB,KAAK,CAACqB,GAAShB,GAAQkB,MACrBF,EAAQ,QAAQJ,EAAeZ,EAAO,SAAS,GAAG;AAAA,MAChD,WAAWG,EAAeH,GAAQ,WAAW;AAAA,MAC7C,QAAAkB;AAAA,IAAA,CACD;AAAA,EAAA;AAEP;"}
|
package/dist/transports.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./transports/agentm/AgentmChannelProvider.cjs"),e=require("./transports/agentm/agentmChannelClient.cjs"),t=require("./transports/
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./transports/agentm/AgentmChannelProvider.cjs"),e=require("./transports/agentm/agentmChannelClient.cjs"),t=require("./transports/mcpBridge.cjs");exports.AgentmChannelProvider=n.AgentmChannelProvider;exports.AGENTM_WIRE_VERSION=e.WIRE_VERSION;exports.AgentmChannelClient=e.AgentmChannelClient;exports.connectAegisBridge=t.connectAegisBridge;
|
|
2
2
|
//# sourceMappingURL=transports.cjs.map
|
package/dist/transports.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AgentmChannelProvider as r } from "./transports/agentm/AgentmChannelProvider.js";
|
|
2
2
|
import { WIRE_VERSION as t, AgentmChannelClient as m } from "./transports/agentm/agentmChannelClient.js";
|
|
3
|
-
import { connectAegisBridge as g } from "./transports/
|
|
3
|
+
import { connectAegisBridge as g } from "./transports/mcpBridge.js";
|
|
4
4
|
export {
|
|
5
5
|
t as AGENTM_WIRE_VERSION,
|
|
6
6
|
m as AgentmChannelClient,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lincyaw/aegis-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "AegisLab shared design system: tokens, primitives, layout, AntD theme.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -43,8 +43,7 @@
|
|
|
43
43
|
"./dist/style.css"
|
|
44
44
|
],
|
|
45
45
|
"scripts": {
|
|
46
|
-
"build": "
|
|
47
|
-
"gen:mcp-tools": "node scripts/emit-mcp-tools.mjs",
|
|
46
|
+
"build": "tsc -p tsconfig.build.json --noEmit && vite build",
|
|
48
47
|
"type-check": "tsc --noEmit",
|
|
49
48
|
"lint": "eslint src --ext ts,tsx --max-warnings 0",
|
|
50
49
|
"lint:fix": "eslint src --ext ts,tsx --fix",
|
|
@@ -68,18 +67,20 @@
|
|
|
68
67
|
"@codemirror/lang-json": "^6.0.2",
|
|
69
68
|
"@codemirror/lang-sql": "^6.9.1",
|
|
70
69
|
"@codemirror/lang-yaml": "^6.1.3",
|
|
70
|
+
"@codemirror/language": "^6.12.3",
|
|
71
71
|
"@codemirror/state": "^6.6.0",
|
|
72
72
|
"@codemirror/view": "^6.42.1",
|
|
73
73
|
"@dagrejs/dagre": "^3.0.0",
|
|
74
|
+
"@lezer/highlight": "^1.2.3",
|
|
74
75
|
"@mdx-js/rollup": "^3.1.1",
|
|
75
76
|
"@stefanprobst/rehype-extract-toc": "^3.0.0",
|
|
76
|
-
"@tanstack/react-table": "^8.20.5",
|
|
77
77
|
"@tanstack/react-virtual": "^3.10.8",
|
|
78
78
|
"@types/mdx": "^2.0.14",
|
|
79
79
|
"@uiw/react-codemirror": "^4.25.9",
|
|
80
80
|
"@xyflow/react": "^12.10.2",
|
|
81
81
|
"chrono-node": "^2.7.7",
|
|
82
82
|
"copy-to-clipboard": "^3.3.3",
|
|
83
|
+
"file-selector": "^2.1.2",
|
|
83
84
|
"fuse.js": "^7.3.0",
|
|
84
85
|
"hyparquet": "^1.25.8",
|
|
85
86
|
"hyparquet-compressors": "^1.1.1",
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=[{name:"aegis_snapshot",description:"Read the current UI snapshot (shell + surfaces + selection + appData).",inputSchema:{type:"object",properties:{paths:{type:"array",items:{type:"string"},description:"Optional projection paths to keep the payload small."}}}},{name:"aegis_inspect",description:"Noun-first discovery: returns the target plus actions bound to it.",inputSchema:{type:"object",properties:{ref:{type:"object",description:'AegisRef — { kind: "surface"|"entity"|"action"|"route", ... }'}},required:["ref"]}},{name:"aegis_search",description:"Free-text search across snapshot + registered providers. Returns ranked refs.",inputSchema:{type:"object",properties:{query:{type:"string"},kinds:{type:"array",items:{type:"string",enum:["surface","entity","action","route"]}},appId:{type:"string"},limit:{type:"number"}},required:["query"]}},{name:"aegis_invoke",description:"The only write entry. Dispatches an action by id with optional params, force, dryRun.",inputSchema:{type:"object",properties:{id:{type:"string"},params:{},force:{type:"boolean"},dryRun:{type:"boolean"}},required:["id"]}},{name:"aegis_navigate",description:'Navigate to a route inside the current app shell. Sugar for aegis_invoke("aegis.navigate", { to }).',inputSchema:{type:"object",properties:{to:{type:"string"}},required:["to"]}},{name:"aegis_highlight",description:"Scroll a target into view and apply a transient ring. Use to point the user.",inputSchema:{type:"object",properties:{ref:{type:"object"}},required:["ref"]}},{name:"aegis_wait_for",description:"Block until a JS predicate over `snap` becomes truthy, or timeout.",inputSchema:{type:"object",properties:{predicate:{type:"string",description:"JS expression evaluated as `(snap) => <expr>`."},timeoutMs:{type:"number"}},required:["predicate"]}}];exports.MCP_TOOL_CATALOGUE=e;
|
|
2
|
-
//# sourceMappingURL=mcpToolCatalogue.cjs.map
|