mirror of
https://github.com/deepseek-ai/deepseek-harness.git
synced 2026-09-13 04:03:30 +00:00
refactor(agent): remove inbox service
This commit is contained in:
@@ -11,12 +11,11 @@ import type {
|
||||
AgentOptions,
|
||||
AgentStatus,
|
||||
CancelOptions,
|
||||
Inbox,
|
||||
InboxTarget,
|
||||
PreStepDecision,
|
||||
RequestErrorAction,
|
||||
} from '@deepseek-ai/dsh-agent'
|
||||
import { agentEvents, assembleContextFor } from '@deepseek-ai/dsh-agent'
|
||||
import { Inbox, agentEvents, assembleContextFor } from '@deepseek-ai/dsh-agent'
|
||||
import type { GenerateOptions, LlmCallConfig, Message, PreparedLlmCall } from '@deepseek-ai/dsh-llm'
|
||||
import {
|
||||
BlockAssembler,
|
||||
@@ -85,7 +84,7 @@ export class ReactLoopAgent implements Agent {
|
||||
public readonly session: Session,
|
||||
) {
|
||||
this.dispatch = agentEvents(loopCtx, this)
|
||||
this.inbox = loopCtx.inboxes.create(this)
|
||||
this.inbox = new Inbox(loopCtx, session, this.dispatch)
|
||||
const lastTurn = session.events.findLast(event => event.type === 'turn/start')?.data.turn ?? 0
|
||||
this.phase = { kind: 'idle', lastTurn }
|
||||
this.scope = createScope(loopCtx, this)
|
||||
|
||||
@@ -294,7 +294,7 @@ function validateConfiguredAgents(agents: Config['agents']): void {
|
||||
|
||||
/** Concrete agent factory and driver service. */
|
||||
export class AgentLoop extends Service implements AgentFactory {
|
||||
static inject = ['agents', 'inboxes', 'sessions', 'llm', 'tools', 'systemPrompt']
|
||||
static inject = ['agents', 'sessionProjections', 'sessions', 'llm', 'tools', 'systemPrompt']
|
||||
|
||||
/** Runtime schema for declarative agents. */
|
||||
static Config = z.object({
|
||||
|
||||
Reference in New Issue
Block a user