refactor: unify typing dispatch lifecycle and policy boundaries

This commit is contained in:
Peter Steinberger
2026-02-26 17:36:09 +01:00
parent 6fd9ec97de
commit 273973d374
19 changed files with 420 additions and 164 deletions

View File

@@ -17,6 +17,7 @@ import {
shouldComputeCommandAuthorized,
} from "../../auto-reply/command-detection.js";
import { shouldHandleTextCommands } from "../../auto-reply/commands-registry.js";
import { withReplyDispatcher } from "../../auto-reply/dispatch.js";
import {
formatAgentEnvelope,
formatInboundEnvelope,
@@ -304,6 +305,7 @@ function createRuntimeChannel(): PluginRuntime["channel"] {
resolveEffectiveMessagesConfig,
resolveHumanDelayConfig,
dispatchReplyFromConfig,
withReplyDispatcher,
finalizeInboundContext,
formatAgentEnvelope,
/** @deprecated Prefer `BodyForAgent` + structured user-context blocks (do not build plaintext envelopes for prompts). */

View File

@@ -55,6 +55,7 @@ type ShouldHandleTextCommands =
typeof import("../../auto-reply/commands-registry.js").shouldHandleTextCommands;
type DispatchReplyFromConfig =
typeof import("../../auto-reply/reply/dispatch-from-config.js").dispatchReplyFromConfig;
type WithReplyDispatcher = typeof import("../../auto-reply/dispatch.js").withReplyDispatcher;
type FinalizeInboundContext =
typeof import("../../auto-reply/reply/inbound-context.js").finalizeInboundContext;
type FormatAgentEnvelope = typeof import("../../auto-reply/envelope.js").formatAgentEnvelope;
@@ -222,6 +223,7 @@ export type PluginRuntime = {
resolveEffectiveMessagesConfig: ResolveEffectiveMessagesConfig;
resolveHumanDelayConfig: ResolveHumanDelayConfig;
dispatchReplyFromConfig: DispatchReplyFromConfig;
withReplyDispatcher: WithReplyDispatcher;
finalizeInboundContext: FinalizeInboundContext;
formatAgentEnvelope: FormatAgentEnvelope;
/** @deprecated Prefer `BodyForAgent` + structured user-context blocks (do not build plaintext envelopes for prompts). */