@@ -3,8 +3,9 @@ import type { Event, Part, Permission } from "@opencode-ai/sdk"
33
44import { buildPayload } from "./payload"
55import { warpNotify } from "./notify"
6+ import pkg from "../package.json" with { type : "json" }
67
7- const PLUGIN_VERSION = "0.1.0"
8+ const PLUGIN_VERSION = pkg . version
89const NOTIFICATION_TITLE = "warp://cli-agent"
910
1011export function truncate ( str : string , maxLen : number ) : string {
@@ -58,7 +59,7 @@ export const WarpPlugin: Plugin = async ({ client, directory }) => {
5859 service : "opencode-warp" ,
5960 level : "warn" ,
6061 message :
61- "⚠️ Detected unsupported Warp version. Please update Warp to use this pluginDetected unsupported Warp version. Please update Warp to use this plugin" ,
62+ "⚠️ Detected unsupported Warp version. Please update Warp to use this plugin. " ,
6263 } ,
6364 } )
6465 return { }
@@ -170,6 +171,18 @@ export const WarpPlugin: Plugin = async ({ client, directory }) => {
170171 warpNotify ( NOTIFICATION_TITLE , body )
171172 } ,
172173
174+ // Fires before a tool executes — used to detect the built-in
175+ // "question" tool so Warp can notify the user that input is needed.
176+ "tool.execute.before" : async ( input ) => {
177+ if ( input . tool !== "question" ) return
178+
179+ const cwd = directory || ""
180+ const body = buildPayload ( "question_asked" , input . sessionID , cwd , {
181+ tool_name : input . tool ,
182+ } )
183+ warpNotify ( NOTIFICATION_TITLE , body )
184+ } ,
185+
173186 // Tool completion — fires after every tool call
174187 "tool.execute.after" : async ( input ) => {
175188 const toolName = input . tool
0 commit comments