refactor(agent): scope queue actions to edit and remove

This commit is contained in:
kingwl
2026-07-30 01:58:51 +08:00
parent e56c0699a9
commit 7ce330f0e4
49 changed files with 181 additions and 294 deletions

View File

@@ -105,7 +105,6 @@ export interface QueuedMessage {
readonly id: InboxItemId
readonly preview: string
readonly text: string | null
readonly placement: 'queued' | 'steering'
}
/** Guard union of the scoped consume-token event, checked by the machine. */

View File

@@ -4,7 +4,7 @@
// The 'conversation.input.dock' SlotMap declaration lives in
// ../contract/slots.ts beside the other input-region slots.
import type { Context } from 'cordis'
import { useEffect, useMemo, useState } from 'react'
import { useEffect, useState } from 'react'
import type { PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'
import type { SessionId } from '@deepseek-ai/dsh-client-runtime/client'
import type { InboxItemId, QueueAction } from '@deepseek-ai/dsh-client-connection/client'
@@ -24,10 +24,7 @@ export type QueueDockProps = PropsRuntime<'conversation.input.dock'> & QueueDock
/** Queue strip: one preview line per queued message; renders null when the queue is empty. */
export function QueueDock({ useSession, updateQueue, notify }: QueueDockProps) {
const inbox = useSession(s => s.queue)
// TODO(web-steer-ui): Give pending steering its own interaction before
// exposing it; QueueDock owns only independent queued turns.
const queue = useMemo(() => inbox.filter(row => row.placement === 'queued'), [inbox])
const queue = useSession(s => s.queue)
const [editing, setEditing] = useState<{ id: InboxItemId; text: string } | null>(null)
const [busy, setBusy] = useState<InboxItemId | null>(null)

View File

@@ -34,7 +34,7 @@ export interface IConversation {
/**
* Apply one operation to a pending queue occurrence.
* @param itemId - agent-owned inbox occurrence identity.
* @param action - edit, remove, or promote operation.
* @param action - edit or remove operation.
* @returns completion; business failures reject.
*/
updateQueue(itemId: InboxItemId, action: QueueAction): Promise<void>