feat(notify): bundle KDCO notify with ownership migration

This commit is contained in:
Kenny
2026-04-19 14:07:08 +08:00
parent af15e8a413
commit f5a11281f8
17 changed files with 906 additions and 13 deletions
+3 -2
View File
@@ -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
}