mirror of
https://github.com/deepseek-ai/deepseek-harness
synced 2026-08-15 21:04:50 +00:00
All agent/* and agent-loop/config-start-failed events take one payload object carrying the agent subject; waterfall/serial payloads require a signal and keep next as the final argument. PreStepContext and RequestFailureContext are unfolded into payloads and retired. goal/changed follows the same shape so agentEvents keeps its listener error containment. ReactLoopAgent builds its scope carrier once in the constructor. Regenerates scope resolvers, tool-cordis api catalog, and docs catalogs; updates all affected listeners, tests, and the core-data-structures docs (en + zh).
20 lines
541 B
TypeScript
20 lines
541 B
TypeScript
/** Test-only Loader plugin that creates a goal at the first real step edge. */
|
|
|
|
import type { Context } from 'cordis'
|
|
import type {} from '@deepseek-ai/dsh-goal'
|
|
|
|
export const name = 'seed-goal'
|
|
export const inject = ['goals']
|
|
|
|
export function apply(ctx: Context): void {
|
|
ctx.on('agent/pre-step', ({ agent }, next) => {
|
|
if (ctx.goals.get(agent) === undefined) {
|
|
ctx.goals.create(agent, {
|
|
objective: 'Prove the composed goal survives in the session log',
|
|
maxGoalRounds: 7,
|
|
})
|
|
}
|
|
return next()
|
|
})
|
|
}
|