Revert "refactor(core): trim mcp event surface"
This reverts commit 1982e43f85.
This commit is contained in:
parent
1982e43f85
commit
7d4965cb29
3 changed files with 47 additions and 9 deletions
|
|
@ -27,7 +27,6 @@ import { McpOAuthCallback } from "./oauth-callback"
|
|||
import { McpAuth } from "./auth"
|
||||
import { EventV2Bridge } from "@/event-v2-bridge"
|
||||
import { TuiEvent } from "@/server/tui-event"
|
||||
import { Event } from "@opencode-ai/schema/event"
|
||||
import open from "open"
|
||||
import { Cause, Effect, Exit, Layer, Context, Schema, Stream } from "effect"
|
||||
import { EffectBridge } from "@/effect/bridge"
|
||||
|
|
@ -62,13 +61,7 @@ export type Resource = Schema.Schema.Type<typeof Resource>
|
|||
|
||||
export const ToolsChanged = McpEvent.ToolsChanged
|
||||
|
||||
export const BrowserOpenFailed = Event.define({
|
||||
type: "mcp.browser.open.failed",
|
||||
schema: {
|
||||
mcpName: Schema.String,
|
||||
url: Schema.String,
|
||||
},
|
||||
})
|
||||
export const BrowserOpenFailed = McpEvent.BrowserOpenFailed
|
||||
|
||||
export const Failed = NamedError.create("MCPFailed", {
|
||||
name: Schema.String,
|
||||
|
|
|
|||
|
|
@ -10,4 +10,12 @@ export const ToolsChanged = Event.define({
|
|||
},
|
||||
})
|
||||
|
||||
export const Definitions = Event.inventory(ToolsChanged)
|
||||
export const BrowserOpenFailed = Event.define({
|
||||
type: "mcp.browser.open.failed",
|
||||
schema: {
|
||||
mcpName: Schema.String,
|
||||
url: Schema.String,
|
||||
},
|
||||
})
|
||||
|
||||
export const Definitions = Event.inventory(ToolsChanged, BrowserOpenFailed)
|
||||
|
|
|
|||
|
|
@ -80,6 +80,7 @@ export type Event =
|
|||
| EventTuiToastShow2
|
||||
| EventTuiSessionSelect2
|
||||
| EventMcpToolsChanged
|
||||
| EventMcpBrowserOpenFailed
|
||||
| EventCommandExecuted
|
||||
| EventProjectUpdated
|
||||
| EventSessionStatus
|
||||
|
|
@ -1512,6 +1513,14 @@ export type GlobalEvent = {
|
|||
server: string
|
||||
}
|
||||
}
|
||||
| {
|
||||
id: string
|
||||
type: "mcp.browser.open.failed"
|
||||
properties: {
|
||||
mcpName: string
|
||||
url: string
|
||||
}
|
||||
}
|
||||
| {
|
||||
id: string
|
||||
type: "command.executed"
|
||||
|
|
@ -2990,6 +2999,7 @@ export type V2Event =
|
|||
| TuiToastShow
|
||||
| TuiSessionSelect
|
||||
| McpToolsChanged
|
||||
| McpBrowserOpenFailed
|
||||
| CommandExecuted
|
||||
| ProjectUpdated
|
||||
| SessionStatus2
|
||||
|
|
@ -6026,6 +6036,24 @@ export type McpToolsChanged = {
|
|||
}
|
||||
}
|
||||
|
||||
export type McpBrowserOpenFailed = {
|
||||
id: string
|
||||
metadata?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
type: "mcp.browser.open.failed"
|
||||
durable?: {
|
||||
aggregateID: string
|
||||
seq: number
|
||||
version: number
|
||||
}
|
||||
location?: LocationRef
|
||||
data: {
|
||||
mcpName: string
|
||||
url: string
|
||||
}
|
||||
}
|
||||
|
||||
export type CommandExecuted = {
|
||||
id: string
|
||||
metadata?: {
|
||||
|
|
@ -7089,6 +7117,15 @@ export type EventMcpToolsChanged = {
|
|||
}
|
||||
}
|
||||
|
||||
export type EventMcpBrowserOpenFailed = {
|
||||
id: string
|
||||
type: "mcp.browser.open.failed"
|
||||
properties: {
|
||||
mcpName: string
|
||||
url: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventCommandExecuted = {
|
||||
id: string
|
||||
type: "command.executed"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue