refactor(core): trim mcp event surface
This commit is contained in:
parent
1d78a0ab95
commit
1982e43f85
3 changed files with 9 additions and 47 deletions
|
|
@ -27,6 +27,7 @@ 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"
|
||||||
|
|
@ -61,7 +62,13 @@ export type Resource = Schema.Schema.Type<typeof Resource>
|
||||||
|
|
||||||
export const ToolsChanged = McpEvent.ToolsChanged
|
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", {
|
export const Failed = NamedError.create("MCPFailed", {
|
||||||
name: Schema.String,
|
name: Schema.String,
|
||||||
|
|
|
||||||
|
|
@ -10,12 +10,4 @@ export const ToolsChanged = Event.define({
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
export const BrowserOpenFailed = Event.define({
|
export const Definitions = Event.inventory(ToolsChanged)
|
||||||
type: "mcp.browser.open.failed",
|
|
||||||
schema: {
|
|
||||||
mcpName: Schema.String,
|
|
||||||
url: Schema.String,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
export const Definitions = Event.inventory(ToolsChanged, BrowserOpenFailed)
|
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,6 @@ export type Event =
|
||||||
| EventTuiToastShow2
|
| EventTuiToastShow2
|
||||||
| EventTuiSessionSelect2
|
| EventTuiSessionSelect2
|
||||||
| EventMcpToolsChanged
|
| EventMcpToolsChanged
|
||||||
| EventMcpBrowserOpenFailed
|
|
||||||
| EventCommandExecuted
|
| EventCommandExecuted
|
||||||
| EventProjectUpdated
|
| EventProjectUpdated
|
||||||
| EventSessionStatus
|
| EventSessionStatus
|
||||||
|
|
@ -1513,14 +1512,6 @@ 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"
|
||||||
|
|
@ -2999,7 +2990,6 @@ export type V2Event =
|
||||||
| TuiToastShow
|
| TuiToastShow
|
||||||
| TuiSessionSelect
|
| TuiSessionSelect
|
||||||
| McpToolsChanged
|
| McpToolsChanged
|
||||||
| McpBrowserOpenFailed
|
|
||||||
| CommandExecuted
|
| CommandExecuted
|
||||||
| ProjectUpdated
|
| ProjectUpdated
|
||||||
| SessionStatus2
|
| 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 = {
|
export type CommandExecuted = {
|
||||||
id: string
|
id: string
|
||||||
metadata?: {
|
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 = {
|
export type EventCommandExecuted = {
|
||||||
id: string
|
id: string
|
||||||
type: "command.executed"
|
type: "command.executed"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue