MCPcopy Create free account
hub / github.com/ChatLab/ChatLab / createExecuteElectronAiTool

Function createExecuteElectronAiTool

apps/desktop/main/ai/tools/debug-executor.ts:16–30  ·  view source on GitHub ↗
(
  semanticIndexService?: SemanticSearchToolService
)

Source from the content-addressed store, hash-verified

14 * i18n 模板)为 Electron 平台特有,统一在此装配后委托给平台无关的执行核心。
15 */
16export function createExecuteElectronAiTool(
17 semanticIndexService?: SemanticSearchToolService
18): (params: AiToolExecuteRequest) => Promise<AiToolExecuteResult> {
19 return (params) =>
20 executeRegistryTool(params, {
21 dataProvider: new WorkerDataProvider(params.sessionId, params.abortSignal),
22 semanticIndexService,
23 segmentText: (texts, locale, options) =>
24 batchSegmentWithFrequency(texts, locale as SupportedLocale, options as BatchSegmentOptions),
25 translateTemplate: (key: string) => {
26 const translated = i18nT(key)
27 return translated !== key ? translated : undefined
28 },
29 })
30}

Callers 1

startInternalServerFunction · 0.90

Calls 2

executeRegistryToolFunction · 0.90

Tested by

no test coverage detected