mirror of
https://github.com/tiddly-gittly/TidGi-Desktop.git
synced 2026-01-18 15:21:12 -08:00
lint: disable @typescript-eslint/require-await
This commit is contained in:
parent
2a35a40d41
commit
1ecd5ccf61
19 changed files with 5 additions and 26 deletions
|
|
@ -1,4 +1,3 @@
|
|||
/* eslint-disable @typescript-eslint/no-unnecessary-condition */
|
||||
import { injectable } from 'inversify';
|
||||
import { pick } from 'lodash';
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ import { createHandlerHooks, createHooksWithPlugins, initializePluginSystem } fr
|
|||
import { promptConcatStream, PromptConcatStreamState } from '@services/agentInstance/promptConcat/promptConcat';
|
||||
import { AgentPromptDescription } from '@services/agentInstance/promptConcat/promptConcatSchema';
|
||||
import { promptConcatHandlerConfigJsonSchema } from '@services/agentInstance/promptConcat/promptConcatSchema/jsonSchema';
|
||||
import { container, lazyInject } from '@services/container';
|
||||
import { IDatabaseService } from '@services/database/interface';
|
||||
import { AgentInstanceEntity, AgentInstanceMessageEntity } from '@services/database/schema/agent';
|
||||
import { logger } from '@services/libs/log';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/* eslint-disable @typescript-eslint/require-await */
|
||||
/**
|
||||
* Built-in plugins for prompt concatenation
|
||||
*/
|
||||
|
|
@ -38,7 +37,7 @@ export const fullReplacementPlugin: PromptConcatPlugin = (hooks) => {
|
|||
// Get all messages except the last user message being processed
|
||||
// We need to find and exclude only the current user message being processed, not just the last message
|
||||
const messagesCopy = cloneDeep(messages);
|
||||
|
||||
|
||||
// Find the last user message (which is the one being processed in this round)
|
||||
let lastUserMessageIndex = -1;
|
||||
for (let index = messagesCopy.length - 1; index >= 0; index--) {
|
||||
|
|
@ -47,7 +46,7 @@ export const fullReplacementPlugin: PromptConcatPlugin = (hooks) => {
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Remove only the last user message if found (this is the current message being processed)
|
||||
if (lastUserMessageIndex >= 0) {
|
||||
messagesCopy.splice(lastUserMessageIndex, 1);
|
||||
|
|
|
|||
|
|
@ -228,7 +228,7 @@ export const wikiSearchPlugin: PromptConcatPlugin = (hooks) => {
|
|||
hooks.responseComplete.tapAsync('wikiSearchPlugin-handler', async (context, callback) => {
|
||||
try {
|
||||
const { handlerContext, response, handlerConfig } = context;
|
||||
|
||||
|
||||
// Find this plugin's configuration from handlerConfig
|
||||
const wikiSearchPluginConfig = handlerConfig?.plugins?.find(p => p.pluginId === 'wikiSearch');
|
||||
const wikiSearchParameter = wikiSearchPluginConfig?.wikiSearchParam as { toolResultDuration?: number } | undefined;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { AgentInstanceMessage } from "../interface";
|
||||
import { AgentInstanceMessage } from '../interface';
|
||||
|
||||
/**
|
||||
* Check if a message should be displayed with reduced opacity in UI
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
/* eslint-disable @typescript-eslint/require-await */
|
||||
|
||||
import { lazyInject } from '@services/container';
|
||||
import { IDatabaseService } from '@services/database/interface';
|
||||
import { IGitUserInfos } from '@services/git/interface';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/* eslint-disable @typescript-eslint/require-await */
|
||||
import { isElectronDevelopment } from '@/constants/isElectronDevelopment';
|
||||
import { app, net } from 'electron';
|
||||
import { injectable } from 'inversify';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/* eslint-disable @typescript-eslint/require-await */
|
||||
import { injectable } from 'inversify';
|
||||
import { cloneDeep, mergeWith } from 'lodash';
|
||||
import { nanoid } from 'nanoid';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/* eslint-disable @typescript-eslint/require-await */
|
||||
import { WikiChannel } from '@/constants/channels';
|
||||
import type { IAuthenticationService } from '@services/auth/interface';
|
||||
import { lazyInject } from '@services/container';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
/* eslint-disable @typescript-eslint/no-unnecessary-condition */
|
||||
/* eslint-disable @typescript-eslint/require-await */
|
||||
import { app, dialog, ipcMain, MessageBoxOptions, shell } from 'electron';
|
||||
import fs from 'fs-extra';
|
||||
import { inject, injectable } from 'inversify';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/* eslint-disable @typescript-eslint/require-await */
|
||||
import { lazyInject } from '@services/container';
|
||||
import type { IPreferenceService } from '@services/preferences/interface';
|
||||
import serviceIdentifier from '@services/serviceIdentifier';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/* eslint-disable @typescript-eslint/require-await */
|
||||
import { dialog, nativeTheme } from 'electron';
|
||||
import { injectable } from 'inversify';
|
||||
import { BehaviorSubject } from 'rxjs';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/* eslint-disable @typescript-eslint/require-await */
|
||||
import { app } from 'electron';
|
||||
import { injectable } from 'inversify';
|
||||
import { BehaviorSubject } from 'rxjs';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/* eslint-disable @typescript-eslint/require-await */
|
||||
import { nativeTheme } from 'electron';
|
||||
import { injectable } from 'inversify';
|
||||
import { BehaviorSubject } from 'rxjs';
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
/* eslint-disable @typescript-eslint/no-unnecessary-condition */
|
||||
/* eslint-disable n/no-callback-literal */
|
||||
/* eslint-disable @typescript-eslint/require-await */
|
||||
|
||||
import { BrowserWindow, ipcMain, WebContentsView, WebPreferences } from 'electron';
|
||||
import { injectable } from 'inversify';
|
||||
|
|
|
|||
|
|
@ -685,7 +685,7 @@ export class Wiki implements IWikiService {
|
|||
logger.debug(`Get ${operationType}`, { workspaceID, method: 'wikiOperationInServer' });
|
||||
// This will never await if workspaceID isn't exist in user's workspace list. So prefer to check workspace existence before use this method.
|
||||
const worker = await this.getWorkerEnsure(workspaceID);
|
||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||
|
||||
logger.debug(`Get worker ${operationType}`, { workspaceID, hasWorker: worker !== undefined, method: 'wikiOperationInServer', arguments_ });
|
||||
// @ts-expect-error A spread argument must either have a tuple type or be passed to a rest parameter.ts(2556)
|
||||
const result = await (worker.wikiOperation(operationType, ...arguments_) as unknown as ReturnType<IWorkerWikiOperations[OP]>);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
/* eslint-disable @typescript-eslint/no-unnecessary-condition */
|
||||
import type { Logger } from '$:/core/modules/utils/logger.js';
|
||||
import type { IWikiServerStatusObject } from '@services/wiki/wikiWorker/ipcServerRoutes';
|
||||
import type { WindowMeta, WindowNames } from '@services/windows/WindowProperties';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
/* eslint-disable @typescript-eslint/require-await */
|
||||
|
||||
import { app, BrowserWindow, BrowserWindowConstructorOptions } from 'electron';
|
||||
import windowStateKeeper, { State as windowStateKeeperState } from 'electron-window-state';
|
||||
import { injectable } from 'inversify';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
/* eslint-disable @typescript-eslint/require-await */
|
||||
|
||||
import { app } from 'electron';
|
||||
import fsExtra from 'fs-extra';
|
||||
import { injectable } from 'inversify';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue