mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-20 13:41:30 +00:00
refactor(lint): tighten channel and config defaults
This commit is contained in:
@@ -227,7 +227,9 @@ export async function probeTlonAccount(account: ConfiguredTlonAccount) {
|
||||
}
|
||||
|
||||
export async function startTlonGatewayAccount(
|
||||
ctx: Parameters<NonNullable<NonNullable<ChannelPlugin["gateway"]>["startAccount"]>>[0],
|
||||
ctx: Parameters<
|
||||
NonNullable<NonNullable<ChannelPlugin<ResolvedTlonAccount>["gateway"]>["startAccount"]>
|
||||
>[0],
|
||||
) {
|
||||
const account = ctx.account;
|
||||
ctx.setStatus({
|
||||
|
||||
@@ -8,6 +8,7 @@ import {
|
||||
} from "./runtime-api.js";
|
||||
import { normalizeSecretInputString } from "./secret-input.js";
|
||||
import { sendMessageZalo } from "./send.js";
|
||||
import type { ResolvedZaloAccount } from "./types.js";
|
||||
|
||||
export async function notifyZaloPairingApproval(params: { cfg: OpenClawConfig; id: string }) {
|
||||
const { resolveZaloAccount } = await import("./accounts.js");
|
||||
@@ -41,7 +42,9 @@ export async function probeZaloAccount(params: {
|
||||
}
|
||||
|
||||
export async function startZaloGatewayAccount(
|
||||
ctx: Parameters<NonNullable<NonNullable<ChannelPlugin["gateway"]>["startAccount"]>>[0],
|
||||
ctx: Parameters<
|
||||
NonNullable<NonNullable<ChannelPlugin<ResolvedZaloAccount>["gateway"]>["startAccount"]>
|
||||
>[0],
|
||||
) {
|
||||
const account = ctx.account;
|
||||
const token = account.token.trim();
|
||||
|
||||
@@ -1,4 +1 @@
|
||||
import type { AgentTool } from "@mariozechner/pi-agent-core";
|
||||
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
export type AnyAgentTool = AgentTool<any, unknown>;
|
||||
export type { AnyAgentTool } from "./tools/common.js";
|
||||
|
||||
@@ -79,8 +79,11 @@ export type ChannelConfigSchema = {
|
||||
/** Full capability contract for a native channel plugin. */
|
||||
type ChannelPluginSetupWizard = ChannelSetupWizard | ChannelSetupWizardAdapter;
|
||||
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
export type ChannelPlugin<ResolvedAccount = any, Probe = unknown, Audit = unknown> = {
|
||||
export type ChannelPlugin<
|
||||
ResolvedAccount = Record<string, unknown>,
|
||||
Probe = unknown,
|
||||
Audit = unknown,
|
||||
> = {
|
||||
id: ChannelId;
|
||||
meta: ChannelMeta;
|
||||
capabilities: ChannelCapabilities;
|
||||
|
||||
@@ -50,6 +50,5 @@ export interface ChannelsConfig {
|
||||
/** Map provider -> channel id -> model override. */
|
||||
modelByChannel?: ChannelModelByChannelConfig;
|
||||
/** Channel sections are plugin-owned; concrete channel files augment this interface. */
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
[key: string]: any;
|
||||
[key: string]: unknown;
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ function normalizeBundledChannelConfigs(
|
||||
continue;
|
||||
}
|
||||
next ??= { ...value };
|
||||
next[channelId] = parsed.data as ChannelsConfig[string];
|
||||
next[channelId] = parsed.data;
|
||||
}
|
||||
|
||||
return next ?? value;
|
||||
|
||||
@@ -35,7 +35,11 @@ export async function getRecentSessionContent(
|
||||
try {
|
||||
const entry = JSON.parse(line);
|
||||
if (entry.type === "message" && entry.message) {
|
||||
const msg = entry.message as AgentMessage & { content?: unknown };
|
||||
const msg = entry.message as {
|
||||
role?: unknown;
|
||||
content?: unknown;
|
||||
provenance?: unknown;
|
||||
};
|
||||
const role = msg.role;
|
||||
if ((role === "user" || role === "assistant") && "content" in msg && msg.content) {
|
||||
if (role === "user" && hasInterSessionUserProvenance(msg)) {
|
||||
|
||||
Reference in New Issue
Block a user