mirror of
https://github.com/NeuralNomadsAI/CodeNomad.git
synced 2026-07-10 00:14:27 +00:00
Remove session idle plugin wiring
This commit is contained in:
parent
d32ec73c63
commit
402d72d038
2 changed files with 1 additions and 36 deletions
|
|
@ -26,15 +26,6 @@ export async function CodeNomadPlugin() {
|
|||
const opencodeEvent = input?.event
|
||||
if (!opencodeEvent || typeof opencodeEvent !== "object") return
|
||||
|
||||
if (opencodeEvent.type === "session.idle") {
|
||||
const sessionID = (opencodeEvent as any).properties?.sessionID
|
||||
void client.postEvent({
|
||||
type: "opencode.session.idle",
|
||||
properties: {
|
||||
sessionID,
|
||||
},
|
||||
}).catch(() => {})
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,35 +20,13 @@ export function handlePluginEvent(workspaceId: string, event: PluginInboundEvent
|
|||
deps.logger.debug({ workspaceId, properties: event.properties }, "Plugin pong received")
|
||||
return
|
||||
|
||||
case "opencode.session.idle": {
|
||||
const workspace = deps.workspaceManager.get(workspaceId)
|
||||
const title = workspace?.name || workspace?.path?.split(/[\\/]/).filter(Boolean).pop() || "CodeNomad"
|
||||
|
||||
const sessionId = readString(event.properties?.sessionID)
|
||||
const message = sessionId ? `Session ${sessionId} is idle` : "Session is idle"
|
||||
|
||||
deps.eventBus.publish({
|
||||
type: "instance.event",
|
||||
instanceId: workspaceId,
|
||||
event: {
|
||||
type: "tui.toast.show",
|
||||
properties: {
|
||||
title,
|
||||
message,
|
||||
variant: "info",
|
||||
duration: 8000,
|
||||
},
|
||||
},
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
default:
|
||||
deps.logger.debug({ workspaceId, eventType: event.type }, "Unhandled plugin event")
|
||||
}
|
||||
}
|
||||
|
||||
export function buildPingEvent(): PluginOutboundEvent {
|
||||
|
||||
return {
|
||||
type: "codenomad.ping",
|
||||
properties: {
|
||||
|
|
@ -56,7 +34,3 @@ export function buildPingEvent(): PluginOutboundEvent {
|
|||
},
|
||||
}
|
||||
}
|
||||
|
||||
function readString(value: unknown): string | undefined {
|
||||
return typeof value === "string" && value.trim() ? value : undefined
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue