fix(features/task-toast-manager): replace as any with ClientWithTui type
Add ClientWithTui local type for tui.showToast access Remove 2 as any casts and eslint-disable comments Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
parent
2d3d993eb6
commit
07113ebe94
@ -4,6 +4,12 @@ import type { ConcurrencyManager } from "../background-agent/concurrency"
|
|||||||
|
|
||||||
type OpencodeClient = PluginInput["client"]
|
type OpencodeClient = PluginInput["client"]
|
||||||
|
|
||||||
|
type ClientWithTui = {
|
||||||
|
tui?: {
|
||||||
|
showToast: (opts: { body: { title: string; message: string; variant: string; duration: number } }) => Promise<unknown>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export class TaskToastManager {
|
export class TaskToastManager {
|
||||||
private tasks: Map<string, TrackedTask> = new Map()
|
private tasks: Map<string, TrackedTask> = new Map()
|
||||||
private client: OpencodeClient
|
private client: OpencodeClient
|
||||||
@ -170,8 +176,7 @@ export class TaskToastManager {
|
|||||||
* Show consolidated toast with all running/queued tasks
|
* Show consolidated toast with all running/queued tasks
|
||||||
*/
|
*/
|
||||||
private showTaskListToast(newTask: TrackedTask): void {
|
private showTaskListToast(newTask: TrackedTask): void {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
const tuiClient = this.client as ClientWithTui
|
||||||
const tuiClient = this.client as any
|
|
||||||
if (!tuiClient.tui?.showToast) return
|
if (!tuiClient.tui?.showToast) return
|
||||||
|
|
||||||
const message = this.buildTaskListMessage(newTask)
|
const message = this.buildTaskListMessage(newTask)
|
||||||
@ -196,8 +201,7 @@ export class TaskToastManager {
|
|||||||
* Show task completion toast
|
* Show task completion toast
|
||||||
*/
|
*/
|
||||||
showCompletionToast(task: { id: string; description: string; duration: string }): void {
|
showCompletionToast(task: { id: string; description: string; duration: string }): void {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
const tuiClient = this.client as ClientWithTui
|
||||||
const tuiClient = this.client as any
|
|
||||||
if (!tuiClient.tui?.showToast) return
|
if (!tuiClient.tui?.showToast) return
|
||||||
|
|
||||||
this.removeTask(task.id)
|
this.removeTask(task.id)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user