refactor(core): keep mcp prompts static

This commit is contained in:
Aiden Cline 2026-06-29 20:12:33 -05:00
commit 75819f2792
4 changed files with 1 additions and 53 deletions

View file

@ -13,7 +13,6 @@ import {
ListToolsResultSchema,
type LoggingMessageNotification,
LoggingMessageNotificationSchema,
PromptListChangedNotificationSchema,
ResourceListChangedNotificationSchema,
ToolListChangedNotificationSchema,
ToolSchema,
@ -108,8 +107,6 @@ export interface Connection {
readonly onLog: (callback: (message: LogMessage) => void) => void
/** Registers a callback fired when the server announces its tool list changed; no-op if unsupported. */
readonly onToolsChanged: (callback: () => void) => void
/** Registers a callback fired when the server announces its prompt list changed; no-op if unsupported. */
readonly onPromptsChanged: (callback: () => void) => void
/** Registers a callback fired when the server announces its resource list changed; no-op if unsupported. */
readonly onResourcesChanged: (callback: () => void) => void
}
@ -273,10 +270,6 @@ export const connect = Effect.fnUntraced(function* (
if (!client.getServerCapabilities()?.tools?.listChanged) return
client.setNotificationHandler(ToolListChangedNotificationSchema, async () => callback())
},
onPromptsChanged: (callback) => {
if (!client.getServerCapabilities()?.prompts?.listChanged) return
client.setNotificationHandler(PromptListChangedNotificationSchema, async () => callback())
},
onResourcesChanged: (callback) => {
if (!client.getServerCapabilities()?.resources?.listChanged) return
client.setNotificationHandler(ResourceListChangedNotificationSchema, async () => callback())

View file

@ -268,7 +268,6 @@ export const layer = Layer.effect(
Effect.all(
[
events.publish(McpEvent.ToolsChanged, { server: name }),
events.publish(McpEvent.PromptsChanged, { server: name }),
events.publish(McpEvent.ResourcesChanged, { server: name }),
],
{ discard: true },
@ -284,9 +283,6 @@ export const layer = Layer.effect(
),
)
})
connection.onPromptsChanged(() => {
fork(events.publish(McpEvent.PromptsChanged, { server: name }).pipe(Effect.ignore))
})
connection.onResourcesChanged(() => {
fork(events.publish(McpEvent.ResourcesChanged, { server: name }).pipe(Effect.ignore))
})

View file

@ -10,13 +10,6 @@ export const ToolsChanged = Event.define({
},
})
export const PromptsChanged = Event.define({
type: "mcp.prompts.changed",
schema: {
server: Schema.String,
},
})
export const ResourcesChanged = Event.define({
type: "mcp.resources.changed",
schema: {
@ -32,4 +25,4 @@ export const BrowserOpenFailed = Event.define({
},
})
export const Definitions = Event.inventory(ToolsChanged, PromptsChanged, ResourcesChanged, BrowserOpenFailed)
export const Definitions = Event.inventory(ToolsChanged, ResourcesChanged, BrowserOpenFailed)

View file

@ -80,7 +80,6 @@ export type Event =
| EventTuiToastShow2
| EventTuiSessionSelect2
| EventMcpToolsChanged
| EventMcpPromptsChanged
| EventMcpResourcesChanged
| EventMcpBrowserOpenFailed
| EventCommandExecuted
@ -1515,13 +1514,6 @@ export type GlobalEvent = {
server: string
}
}
| {
id: string
type: "mcp.prompts.changed"
properties: {
server: string
}
}
| {
id: string
type: "mcp.resources.changed"
@ -3015,7 +3007,6 @@ export type V2Event =
| TuiToastShow
| TuiSessionSelect
| McpToolsChanged
| McpPromptsChanged
| McpResourcesChanged
| McpBrowserOpenFailed
| CommandExecuted
@ -6054,23 +6045,6 @@ export type McpToolsChanged = {
}
}
export type McpPromptsChanged = {
id: string
metadata?: {
[key: string]: unknown
}
type: "mcp.prompts.changed"
durable?: {
aggregateID: string
seq: number
version: number
}
location?: LocationRef
data: {
server: string
}
}
export type McpResourcesChanged = {
id: string
metadata?: {
@ -7169,14 +7143,6 @@ export type EventMcpToolsChanged = {
}
}
export type EventMcpPromptsChanged = {
id: string
type: "mcp.prompts.changed"
properties: {
server: string
}
}
export type EventMcpResourcesChanged = {
id: string
type: "mcp.resources.changed"