mirror of
https://github.com/anomalyco/opencode.git
synced 2026-07-24 04:01:10 -04:00
refactor(core): trim mcp event surface
This commit is contained in:
@@ -27,6 +27,7 @@ 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"
|
||||
@@ -61,7 +62,13 @@ export type Resource = Schema.Schema.Type<typeof Resource>
|
||||
|
||||
export const ToolsChanged = McpEvent.ToolsChanged
|
||||
|
||||
export const BrowserOpenFailed = McpEvent.BrowserOpenFailed
|
||||
export const BrowserOpenFailed = Event.define({
|
||||
type: "mcp.browser.open.failed",
|
||||
schema: {
|
||||
mcpName: Schema.String,
|
||||
url: Schema.String,
|
||||
},
|
||||
})
|
||||
|
||||
export const Failed = NamedError.create("MCPFailed", {
|
||||
name: Schema.String,
|
||||
|
||||
@@ -10,12 +10,4 @@ export const ToolsChanged = Event.define({
|
||||
},
|
||||
})
|
||||
|
||||
export const BrowserOpenFailed = Event.define({
|
||||
type: "mcp.browser.open.failed",
|
||||
schema: {
|
||||
mcpName: Schema.String,
|
||||
url: Schema.String,
|
||||
},
|
||||
})
|
||||
|
||||
export const Definitions = Event.inventory(ToolsChanged, BrowserOpenFailed)
|
||||
export const Definitions = Event.inventory(ToolsChanged)
|
||||
|
||||
@@ -80,7 +80,6 @@ export type Event =
|
||||
| EventTuiToastShow2
|
||||
| EventTuiSessionSelect2
|
||||
| EventMcpToolsChanged
|
||||
| EventMcpBrowserOpenFailed
|
||||
| EventCommandExecuted
|
||||
| EventProjectUpdated
|
||||
| EventSessionStatus
|
||||
@@ -1513,14 +1512,6 @@ export type GlobalEvent = {
|
||||
server: string
|
||||
}
|
||||
}
|
||||
| {
|
||||
id: string
|
||||
type: "mcp.browser.open.failed"
|
||||
properties: {
|
||||
mcpName: string
|
||||
url: string
|
||||
}
|
||||
}
|
||||
| {
|
||||
id: string
|
||||
type: "command.executed"
|
||||
@@ -2999,7 +2990,6 @@ export type V2Event =
|
||||
| TuiToastShow
|
||||
| TuiSessionSelect
|
||||
| McpToolsChanged
|
||||
| McpBrowserOpenFailed
|
||||
| CommandExecuted
|
||||
| ProjectUpdated
|
||||
| SessionStatus2
|
||||
@@ -6036,24 +6026,6 @@ 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?: {
|
||||
@@ -7117,15 +7089,6 @@ 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"
|
||||
|
||||
Reference in New Issue
Block a user