Spracherkennung für: .ts vermutete Sprache: Unknown {[0] [0] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]
import { createSubsystemLogger } from "../../logging/subsystem.js";
import { getGlobalHookRunner } from "../../plugins/hook-runner-global.js";
import type {
PluginHookAgentEndEvent,
PluginHookLlmInputEvent,
PluginHookLlmOutputEvent,
} from "../../plugins/hook-types.js";
import { buildAgentHookContext, type AgentHarnessHookContext } from "./hook-context.js";
const log = createSubsystemLogger("agents/harness");
type AgentHarnessHookRunner = ReturnType<typeof getGlobalHookRunner>;
export function runAgentHarnessLlmInputHook(params: {
event: PluginHookLlmInputEvent;
ctx: AgentHarnessHookContext;
hookRunner?: AgentHarnessHookRunner;
}): void {
const hookRunner = params.hookRunner ?? getGlobalHookRunner();
if (!hookRunner?.hasHooks("llm_input")) {
return;
}
void hookRunner.runLlmInput(params.event, buildAgentHookContext(params.ctx)).catch((error) => {
log.warn(`llm_input hook failed: ${String(error)}`);
});
}
export function runAgentHarnessLlmOutputHook(params: {
event: PluginHookLlmOutputEvent;
ctx: AgentHarnessHookContext;
hookRunner?: AgentHarnessHookRunner;
}): void {
const hookRunner = params.hookRunner ?? getGlobalHookRunner();
if (!hookRunner?.hasHooks("llm_output")) {
return;
}
void hookRunner.runLlmOutput(params.event, buildAgentHookContext(params.ctx)).catch((error) => {
log.warn(`llm_output hook failed: ${String(error)}`);
});
}
export function runAgentHarnessAgentEndHook(params: {
event: PluginHookAgentEndEvent;
ctx: AgentHarnessHookContext;
hookRunner?: AgentHarnessHookRunner;
}): void {
const hookRunner = params.hookRunner ?? getGlobalHookRunner();
if (!hookRunner?.hasHooks("agent_end")) {
return;
}
void hookRunner.runAgentEnd(params.event, buildAgentHookContext(params.ctx)).catch((error) => {
log.warn(`agent_end hook failed: ${String(error)}`);
});
}
¤ Dauer der Verarbeitung: 0.24 Sekunden
(vorverarbeitet am 2026-04-27)
¤
*© Formatika GbR, Deutschland