fix: repair discord action typing
This commit is contained in:
@@ -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];
|
||||
|
||||
@@ -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,
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user