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 { McpAuth } from "./auth"
|
||||||
import { EventV2Bridge } from "@/event-v2-bridge"
|
import { EventV2Bridge } from "@/event-v2-bridge"
|
||||||
import { TuiEvent } from "@/server/tui-event"
|
import { TuiEvent } from "@/server/tui-event"
|
||||||
import { Event } from "@opencode-ai/schema/event"
|
|
||||||
import open from "open"
|
import open from "open"
|
||||||
import { Cause, Effect, Exit, Layer, Context, Schema, Stream } from "effect"
|
import { Cause, Effect, Exit, Layer, Context, Schema, Stream } from "effect"
|
||||||
import { EffectBridge } from "@/effect/bridge"
|
import { EffectBridge } from "@/effect/bridge"
|
||||||
|
|
@ -62,13 +61,7 @@ export type Resource = Schema.Schema.Type<typeof Resource>
|
||||||
|
|
||||||
export const ToolsChanged = McpEvent.ToolsChanged
|
export const ToolsChanged = McpEvent.ToolsChanged
|
||||||
|
|
||||||
export const BrowserOpenFailed = Event.define({
|
export const BrowserOpenFailed = McpEvent.BrowserOpenFailed
|
||||||
type: "mcp.browser.open.failed",
|
|
||||||
schema: {
|
|
||||||
mcpName: Schema.String,
|
|
||||||
url: Schema.String,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
export const Failed = NamedError.create("MCPFailed", {
|
export const Failed = NamedError.create("MCPFailed", {
|
||||||
name: Schema.String,
|
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
|
| EventTuiToastShow2
|
||||||
| EventTuiSessionSelect2
|
| EventTuiSessionSelect2
|
||||||
| EventMcpToolsChanged
|
| EventMcpToolsChanged
|
||||||
|
| EventMcpBrowserOpenFailed
|
||||||
| EventCommandExecuted
|
| EventCommandExecuted
|
||||||
| EventProjectUpdated
|
| EventProjectUpdated
|
||||||
| EventSessionStatus
|
| EventSessionStatus
|
||||||
|
|
@ -1512,6 +1513,14 @@ export type GlobalEvent = {
|
||||||
server: string
|
server: string
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
| {
|
||||||
|
id: string
|
||||||
|
type: "mcp.browser.open.failed"
|
||||||
|
properties: {
|
||||||
|
mcpName: string
|
||||||
|
url: string
|
||||||
|
}
|
||||||
|
}
|
||||||
| {
|
| {
|
||||||
id: string
|
id: string
|
||||||
type: "command.executed"
|
type: "command.executed"
|
||||||
|
|
@ -2990,6 +2999,7 @@ export type V2Event =
|
||||||
| TuiToastShow
|
| TuiToastShow
|
||||||
| TuiSessionSelect
|
| TuiSessionSelect
|
||||||
| McpToolsChanged
|
| McpToolsChanged
|
||||||
|
| McpBrowserOpenFailed
|
||||||
| CommandExecuted
|
| CommandExecuted
|
||||||
| ProjectUpdated
|
| ProjectUpdated
|
||||||
| SessionStatus2
|
| 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 = {
|
export type CommandExecuted = {
|
||||||
id: string
|
id: string
|
||||||
metadata?: {
|
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 = {
|
export type EventCommandExecuted = {
|
||||||
id: string
|
id: string
|
||||||
type: "command.executed"
|
type: "command.executed"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue