Direct models now use bundled ripgrep for workspace discovery, read files through resumable pages, and edit multiple files with apply_patch. Ask can search and read while Execute retains write access, and fixed total input limits no longer constrain these tools. Release note: 直连模型现可使用随包 ripgrep 搜索项目、分页读取任意大小的文本,并通过多文件补丁修改代码;设置中的相关能力统一显示为工作区文件和开发工具。
100 lines
2.1 KiB
TypeScript
100 lines
2.1 KiB
TypeScript
import { join } from 'node:path'
|
|
import { describe, expect, it } from 'vitest'
|
|
import { resolveBundledRuntimePaths } from './bundled-runtimes'
|
|
|
|
describe('bundled runtime paths', () => {
|
|
it('resolves development runtimes from fixed npm packages', () => {
|
|
const paths = resolveBundledRuntimePaths({
|
|
appPath: join('workspace', 'app'),
|
|
resourcesPath: join('electron', 'resources'),
|
|
packaged: false,
|
|
platform: 'linux',
|
|
arch: 'x64'
|
|
})
|
|
|
|
expect(paths).toEqual({
|
|
opencode: join(
|
|
'workspace',
|
|
'app',
|
|
'node_modules',
|
|
'opencode-ai',
|
|
'bin',
|
|
'opencode.exe'
|
|
),
|
|
ripgrep: join(
|
|
'workspace',
|
|
'app',
|
|
'node_modules',
|
|
'@vscode',
|
|
'ripgrep-linux-x64',
|
|
'bin',
|
|
'rg'
|
|
),
|
|
continue: join(
|
|
'workspace',
|
|
'app',
|
|
'node_modules',
|
|
'@continuedev',
|
|
'cli',
|
|
'dist',
|
|
'cn.js'
|
|
),
|
|
deepseekHarness: join(
|
|
'workspace',
|
|
'app',
|
|
'out',
|
|
'main',
|
|
'deepseek-harness-host-bootstrap.js'
|
|
)
|
|
})
|
|
})
|
|
|
|
it('resolves packaged runtimes outside the application archive', () => {
|
|
const paths = resolveBundledRuntimePaths({
|
|
appPath: join('installed', 'app.asar'),
|
|
resourcesPath: join('installed', 'resources'),
|
|
packaged: true,
|
|
platform: 'win32'
|
|
})
|
|
|
|
expect(paths).toEqual({
|
|
opencode: join(
|
|
'installed',
|
|
'resources',
|
|
'runtimes',
|
|
'opencode',
|
|
'opencode.exe'
|
|
),
|
|
opencodeConfig: join(
|
|
'installed',
|
|
'resources',
|
|
'runtimes',
|
|
'opencode-config'
|
|
),
|
|
ripgrep: join(
|
|
'installed',
|
|
'resources',
|
|
'runtimes',
|
|
'opencode',
|
|
'rg.exe'
|
|
),
|
|
continue: join(
|
|
'installed',
|
|
'resources',
|
|
'runtimes',
|
|
'continue',
|
|
'dist',
|
|
'cn.js'
|
|
),
|
|
deepseekHarness: join(
|
|
'installed',
|
|
'resources',
|
|
'app.asar.unpacked',
|
|
'out',
|
|
'main',
|
|
'deepseek-harness-host-bootstrap.js'
|
|
)
|
|
})
|
|
})
|
|
})
|