Skip to main content
Home

Built and signed on GitHub Actions

An open-source agent framework for building production-ready agentic AI agents

This package works with DenoIt is unknown whether this package works with Cloudflare Workers, Node.js, Bun, Browsers
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Node.js
This package works with Deno
It is unknown whether this package works with Bun
It is unknown whether this package works with Browsers
JSR Score
88%
Published
a day ago (0.4.4)
interface LoopInterceptor

Interface for loop interceptors that run after agent inference

Interceptors can inject or modify LLM message context to influence subsequent agent behavior (e.g., add tool results, error messages, continuation prompts).

Properties

readonly
name: string

Unique name of the interceptor

Description of what this interceptor does

Methods

Execute the interceptor's custom logic to influence agent behavior.

This method is called after the LLM generates a response. You are provided an InterceptorContext containing the conversation messages, LLM response, available tools, and other context. Use your custom logic to determine if the agent should continue or complete the loop.

Modifying Message Context: To influence subsequent agent behavior, inject or modify messages in context.messages:

  • Add new messages: context.messages.push(newMessage) (auto-emits TaskMessageEvent)
  • Modify existing messages: Use unshift, splice, pop, shift, or direct assignment

Event Emission:

  • If you modify existing message history, you MUST emit TaskHistoryChangedEvent via context.eventSubject.next({ type: "history_changed" }) to notify that this interceptor changed the history
  • You MAY also emit custom events to meet your specific needs

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@corespeed/zypher

Import symbol

import { type LoopInterceptor } from "@corespeed/zypher";
or

Import directly with a jsr specifier

import { type LoopInterceptor } from "jsr:@corespeed/zypher";

Add Package

pnpm i jsr:@corespeed/zypher
or (using pnpm 10.8 or older)
pnpm dlx jsr add @corespeed/zypher

Import symbol

import { type LoopInterceptor } from "@corespeed/zypher";

Add Package

yarn add jsr:@corespeed/zypher
or (using Yarn 4.8 or older)
yarn dlx jsr add @corespeed/zypher

Import symbol

import { type LoopInterceptor } from "@corespeed/zypher";

Add Package

vlt install jsr:@corespeed/zypher

Import symbol

import { type LoopInterceptor } from "@corespeed/zypher";

Add Package

npx jsr add @corespeed/zypher

Import symbol

import { type LoopInterceptor } from "@corespeed/zypher";

Add Package

bunx jsr add @corespeed/zypher

Import symbol

import { type LoopInterceptor } from "@corespeed/zypher";