fix: repair discord action typing

This commit is contained in:
Peter Steinberger
2026-01-03 05:33:57 +01:00
parent 6cda84432e
commit 3633c829ae
2 changed files with 5 additions and 3 deletions

View File

@@ -40,7 +40,7 @@ import {
writeScreenRecordToFile,
} from "../cli/nodes-screen.js";
import { parseDurationMs } from "../cli/parse-duration.js";
import { loadConfig } from "../config/config.js";
import { loadConfig, type DiscordActionConfig } from "../config/config.js";
import {
addRoleDiscord,
banMemberDiscord,
@@ -1745,7 +1745,7 @@ function createDiscordTool(): AnyAgentTool {
const action = readStringParam(params, "action", { required: true });
const cfg = loadConfig();
const isActionEnabled = (
key: keyof NonNullable<typeof cfg.discord>["actions"],
key: keyof DiscordActionConfig,
defaultValue = true,
) => {
const value = cfg.discord?.actions?.[key];

View File

@@ -3,6 +3,8 @@ import type { DefaultTextStyle, MarkdownTheme } from "@mariozechner/pi-tui";
import { Container, Markdown, Spacer, Text } from "@mariozechner/pi-tui";
import { theme } from "./theme.js";
type MessageRole = "user" | "system" | "tool";
export class MessageList extends Container {
private assistantById = new Map<string, Markdown>();
@@ -62,7 +64,7 @@ export class MessageList extends Container {
}
private addMessage(
role: MessageEntry["role"],
role: MessageRole,
text: string,
style: DefaultTextStyle,
) {