fix: repair discord action typing
This commit is contained in:
parent
6cda84432e
commit
3633c829ae
@ -40,7 +40,7 @@ import {
|
|||||||
writeScreenRecordToFile,
|
writeScreenRecordToFile,
|
||||||
} from "../cli/nodes-screen.js";
|
} from "../cli/nodes-screen.js";
|
||||||
import { parseDurationMs } from "../cli/parse-duration.js";
|
import { parseDurationMs } from "../cli/parse-duration.js";
|
||||||
import { loadConfig } from "../config/config.js";
|
import { loadConfig, type DiscordActionConfig } from "../config/config.js";
|
||||||
import {
|
import {
|
||||||
addRoleDiscord,
|
addRoleDiscord,
|
||||||
banMemberDiscord,
|
banMemberDiscord,
|
||||||
@ -1745,7 +1745,7 @@ function createDiscordTool(): AnyAgentTool {
|
|||||||
const action = readStringParam(params, "action", { required: true });
|
const action = readStringParam(params, "action", { required: true });
|
||||||
const cfg = loadConfig();
|
const cfg = loadConfig();
|
||||||
const isActionEnabled = (
|
const isActionEnabled = (
|
||||||
key: keyof NonNullable<typeof cfg.discord>["actions"],
|
key: keyof DiscordActionConfig,
|
||||||
defaultValue = true,
|
defaultValue = true,
|
||||||
) => {
|
) => {
|
||||||
const value = cfg.discord?.actions?.[key];
|
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 { Container, Markdown, Spacer, Text } from "@mariozechner/pi-tui";
|
||||||
import { theme } from "./theme.js";
|
import { theme } from "./theme.js";
|
||||||
|
|
||||||
|
type MessageRole = "user" | "system" | "tool";
|
||||||
|
|
||||||
export class MessageList extends Container {
|
export class MessageList extends Container {
|
||||||
private assistantById = new Map<string, Markdown>();
|
private assistantById = new Map<string, Markdown>();
|
||||||
|
|
||||||
@ -62,7 +64,7 @@ export class MessageList extends Container {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private addMessage(
|
private addMessage(
|
||||||
role: MessageEntry["role"],
|
role: MessageRole,
|
||||||
text: string,
|
text: string,
|
||||||
style: DefaultTextStyle,
|
style: DefaultTextStyle,
|
||||||
) {
|
) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user