-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Description
Please provide some function by which a plugin can detect on whether it is running in an interactive session (as opposed to an API call or opencode run invocation).
Motivation:
I have a plugin to ring a bell when session.idle, to alert me when work has been completed.
I also have custom slash commands that invoke opencode run to do prompt enhancement.
Presently, using one of these commands results in the bell ringing twice: once when the nested opencode run command completes, and then a second time when the work in response to the prompt I had input in the interactive session where I ran the command has finished. The earlier beep is not desired: the intent of the bell plugin was to alert me when the work is finished, not when the prompt enhancement that the nested opencode run invocation performs has complete (after which the enhanced prompt is handed back to the interactive opencode session and the 'work' proper begins
Some function like AmIRunningInAnInteractiveSession() that I could use in the plugin would suffice to accomplish my goal.