semantic-checkpoint-agent.ts 1004 B

12345678910111213141516171819202122232425
  1. /**
  2. * Loader fixture that publishes the semantic-checkpoint session before CLI dispatch.
  3. * @module semantic-checkpoint-agent
  4. */
  5. import type { Context } from 'cordis'
  6. import type { SessionId } from '@deepseek-ai/dsh-session'
  7. /** Fixture plugin name. */
  8. export const name = 'semantic-checkpoint-agent'
  9. /** Services that must exist before the fixture resumes its agent. */
  10. export const inject = ['agents', 'agentLoop', 'sessionPersistence']
  11. /**
  12. * Resume the seeded session and bind its exact handle to this fixture's lifetime.
  13. * @param ctx - settled agent and persistence services from the Loader tree.
  14. * @returns after the resumed agent is published.
  15. */
  16. export async function apply(ctx: Context): Promise<void> {
  17. const handle = await ctx.agents.resume({
  18. resumeSessionId: 'semantic-checkpoint-unknown-outcome' as SessionId,
  19. agentOptions: { provider: 'deepseek-official', model: 'deepseek-v4-flash' },
  20. })
  21. ctx.effect(() => () => handle.dispose(), 'semantic-checkpoint-agent.handle')
  22. }