feat(notify): bundle KDCO notify with ownership migration
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
import type { PluginInput } from "@opencode-ai/plugin"
|
||||
import { normalizeSDKResponse } from "../shared"
|
||||
import { getIncompleteCount } from "./todo-continuation-enforcer/todo"
|
||||
|
||||
interface Todo {
|
||||
content: string
|
||||
status: string
|
||||
priority: string
|
||||
id: string
|
||||
id?: string
|
||||
}
|
||||
|
||||
export async function hasIncompleteTodos(ctx: PluginInput, sessionID: string): Promise<boolean> {
|
||||
@@ -13,7 +14,7 @@ export async function hasIncompleteTodos(ctx: PluginInput, sessionID: string): P
|
||||
const response = await ctx.client.session.todo({ path: { id: sessionID } })
|
||||
const todos = normalizeSDKResponse(response, [] as Todo[], { preferResponseOnMissingData: true })
|
||||
if (!todos || todos.length === 0) return false
|
||||
return todos.some((todo) => todo.status !== "completed" && todo.status !== "cancelled")
|
||||
return getIncompleteCount(todos) > 0
|
||||
} catch {
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user