openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
68 lines (67 loc) • 2.52 kB
TypeScript
import type { OpenClawConfig } from "../../config/config.js";
import type { SessionEntry, SessionScope } from "../../config/sessions/types.js";
import type { MsgContext } from "../templating.js";
import type { ElevatedLevel } from "../thinking.js";
import type { ReplyPayload } from "../types.js";
import type { CommandContext } from "./commands-types.js";
import type { ApplyInlineDirectivesFastLaneParams } from "./directive-handling.params.js";
import { type InlineDirectives } from "./directive-handling.parse.js";
import type { createModelSelectionState } from "./model-selection.js";
import type { TypingController } from "./typing.js";
type AgentDefaults = NonNullable<OpenClawConfig["agents"]>["defaults"];
type AgentEntry = NonNullable<NonNullable<OpenClawConfig["agents"]>["list"]>[number];
export type ApplyDirectiveResult = {
kind: "reply";
reply: ReplyPayload | ReplyPayload[] | undefined;
} | {
kind: "continue";
directives: InlineDirectives;
provider: string;
model: string;
contextTokens: number;
directiveAck?: ReplyPayload;
perMessageQueueMode?: InlineDirectives["queueMode"];
perMessageQueueOptions?: {
debounceMs?: number;
cap?: number;
dropPolicy?: InlineDirectives["dropPolicy"];
};
};
export declare function applyInlineDirectiveOverrides(params: {
ctx: MsgContext;
cfg: OpenClawConfig;
agentId: string;
agentDir: string;
agentCfg: AgentDefaults;
agentEntry?: AgentEntry;
sessionEntry: SessionEntry;
sessionStore: Record<string, SessionEntry>;
sessionKey: string;
storePath?: string;
sessionScope: SessionScope | undefined;
isGroup: boolean;
allowTextCommands: boolean;
command: CommandContext;
directives: InlineDirectives;
messageProviderKey: string;
elevatedEnabled: boolean;
elevatedAllowed: boolean;
elevatedFailures: Array<{
gate: string;
key: string;
}>;
defaultProvider: string;
defaultModel: string;
aliasIndex: ApplyInlineDirectivesFastLaneParams["aliasIndex"];
provider: string;
model: string;
modelState: Awaited<ReturnType<typeof createModelSelectionState>>;
initialModelLabel: string;
formatModelSwitchEvent: (label: string, alias?: string) => string;
resolvedElevatedLevel: ElevatedLevel;
defaultActivation: () => "always" | "mention";
contextTokens: number;
effectiveModelDirective?: string;
typing: TypingController;
}): Promise<ApplyDirectiveResult>;
export {};