fix: resolve lint errors - remove unused imports and prefix unused variables
This commit is contained in:
parent
c8c74e50ad
commit
557a7aa124
1
openclaw
Submodule
1
openclaw
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit 0639c7bf1f37bafeb847afc9e422f05f3bb084a3
|
||||||
@ -10,8 +10,9 @@ export async function writeOAuthCredentials(
|
|||||||
agentDir?: string,
|
agentDir?: string,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
// Write to resolved agent dir so gateway finds credentials on startup.
|
// Write to resolved agent dir so gateway finds credentials on startup.
|
||||||
|
const emailStr = typeof creds.email === "string" ? creds.email : "default";
|
||||||
upsertAuthProfile({
|
upsertAuthProfile({
|
||||||
profileId: `${provider}:${creds.email ?? "default"}`,
|
profileId: `${provider}:${emailStr}`,
|
||||||
credential: {
|
credential: {
|
||||||
type: "oauth",
|
type: "oauth",
|
||||||
provider,
|
provider,
|
||||||
|
|||||||
@ -506,7 +506,7 @@ export async function runHeartbeatOnce(opts: {
|
|||||||
// Check if this is an exec event with pending exec completion system events.
|
// Check if this is an exec event with pending exec completion system events.
|
||||||
// If so, use a specialized prompt that instructs the model to relay the result
|
// If so, use a specialized prompt that instructs the model to relay the result
|
||||||
// instead of the standard heartbeat prompt with "reply HEARTBEAT_OK".
|
// instead of the standard heartbeat prompt with "reply HEARTBEAT_OK".
|
||||||
const isExecEvent = opts.reason === "exec-event";
|
const _isExecEvent = opts.reason === "exec-event";
|
||||||
const pendingEvents = peekSystemEvents(sessionKey);
|
const pendingEvents = peekSystemEvents(sessionKey);
|
||||||
const hasExecCompletion = pendingEvents.some((evt) => evt.includes("Exec finished"));
|
const hasExecCompletion = pendingEvents.some((evt) => evt.includes("Exec finished"));
|
||||||
// Check for generic (non-exec) system events that may require action (e.g., from cron jobs).
|
// Check for generic (non-exec) system events that may require action (e.g., from cron jobs).
|
||||||
|
|||||||
@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
import { AuthFlow, verifySession } from "./auth.js";
|
import { AuthFlow, verifySession } from "./auth.js";
|
||||||
import type { AuthState } from "./types.js";
|
|
||||||
|
|
||||||
// Mock readline to avoid stdin/stdout in tests
|
// Mock readline to avoid stdin/stdout in tests
|
||||||
const mockPrompt = vi.fn();
|
const mockPrompt = vi.fn();
|
||||||
|
|||||||
@ -13,12 +13,7 @@ import { StringSession } from "telegram/sessions";
|
|||||||
import { NewMessage, type NewMessageEvent } from "telegram/events";
|
import { NewMessage, type NewMessageEvent } from "telegram/events";
|
||||||
import type { Api } from "telegram";
|
import type { Api } from "telegram";
|
||||||
import { createSubsystemLogger } from "../logging/subsystem.js";
|
import { createSubsystemLogger } from "../logging/subsystem.js";
|
||||||
import type {
|
import type { ConnectionState, GramJSMessageContext, SendMessageParams } from "./types.js";
|
||||||
ConnectionState,
|
|
||||||
GramJSMessageContext,
|
|
||||||
SendMessageParams,
|
|
||||||
SessionOptions,
|
|
||||||
} from "./types.js";
|
|
||||||
|
|
||||||
const log = createSubsystemLogger("telegram-gramjs:client");
|
const log = createSubsystemLogger("telegram-gramjs:client");
|
||||||
|
|
||||||
@ -45,7 +40,7 @@ export class GramJSClient {
|
|||||||
apiId,
|
apiId,
|
||||||
apiHash,
|
apiHash,
|
||||||
sessionString = "",
|
sessionString = "",
|
||||||
proxy,
|
proxy: _proxy,
|
||||||
connectionRetries = 5,
|
connectionRetries = 5,
|
||||||
timeout = 30,
|
timeout = 30,
|
||||||
} = options;
|
} = options;
|
||||||
|
|||||||
@ -8,10 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import type { OpenClawConfig } from "../config/config.js";
|
import type { OpenClawConfig } from "../config/config.js";
|
||||||
import type {
|
import type { TelegramGramJSConfig } from "../config/types.telegram-gramjs.js";
|
||||||
TelegramGramJSAccountConfig,
|
|
||||||
TelegramGramJSConfig,
|
|
||||||
} from "../config/types.telegram-gramjs.js";
|
|
||||||
import type { ChannelConfigAdapter } from "../channels/plugins/types.adapters.js";
|
import type { ChannelConfigAdapter } from "../channels/plugins/types.adapters.js";
|
||||||
import type { ResolvedGramJSAccount } from "./types.js";
|
import type { ResolvedGramJSAccount } from "./types.js";
|
||||||
import { createSubsystemLogger } from "../logging/subsystem.js";
|
import { createSubsystemLogger } from "../logging/subsystem.js";
|
||||||
|
|||||||
@ -169,8 +169,8 @@ export function buildSessionKey(gramjsContext: GramJSMessageContext, accountId:
|
|||||||
* - Checking message.entities for mentions
|
* - Checking message.entities for mentions
|
||||||
*/
|
*/
|
||||||
export function wasMessageMentioned(
|
export function wasMessageMentioned(
|
||||||
gramjsContext: GramJSMessageContext,
|
_gramjsContext: GramJSMessageContext,
|
||||||
botUsername?: string,
|
_botUsername?: string,
|
||||||
): boolean {
|
): boolean {
|
||||||
// TODO: Implement mention detection
|
// TODO: Implement mention detection
|
||||||
// For now, return false (rely on requireMention config)
|
// For now, return false (rely on requireMention config)
|
||||||
|
|||||||
@ -3,7 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import type { TelegramGramJSAccountConfig } from "../config/types.telegram-gramjs.js";
|
import type { TelegramGramJSAccountConfig } from "../config/types.telegram-gramjs.js";
|
||||||
import type { OpenClawConfig } from "../config/config.js";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resolved account configuration with all necessary fields populated.
|
* Resolved account configuration with all necessary fields populated.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user