refactor: apply repository naming contract
Apply the accepted pre-release package, service, type, directory, and role renames as one repository-wide change.
This commit is contained in:
@@ -17,8 +17,8 @@ import { join } from 'node:path'
|
||||
import { Context } from '@deepseek-ai/cordis'
|
||||
import { CallId } from '@deepseek-ai/dsh-llm'
|
||||
import SystemPrompt from '@deepseek-ai/dsh-system-prompt'
|
||||
import ToolRegistry, { TOOL_ABORTED_BEFORE_DISPATCH } from '@deepseek-ai/dsh-tools'
|
||||
import LocalSubprocessService from '@deepseek-ai/dsh-subprocess-local'
|
||||
import ToolRuntime, { TOOL_ABORTED_BEFORE_DISPATCH } from '@deepseek-ai/dsh-tools'
|
||||
import LocalSubprocessRuntime from '@deepseek-ai/dsh-subprocess-local'
|
||||
import * as ToolFsSearch from '@deepseek-ai/dsh-tool-fs-search'
|
||||
|
||||
const testToolSignal = new AbortController().signal
|
||||
@@ -62,8 +62,8 @@ describe('search tools over the real subprocess service + the packaged rg', () =
|
||||
|
||||
ctx = new Context()
|
||||
await ctx.plugin(SystemPrompt)
|
||||
await ctx.plugin(ToolRegistry)
|
||||
await ctx.plugin(LocalSubprocessService)
|
||||
await ctx.plugin(ToolRuntime)
|
||||
await ctx.plugin(LocalSubprocessRuntime)
|
||||
await ctx.plugin(ToolFsSearch, { sampleOverCapGlobResults: true })
|
||||
})
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@ import { describe, expect, it } from 'vitest'
|
||||
import { Context } from '@deepseek-ai/cordis'
|
||||
import Loader from '@deepseek-ai/cordis-plugin-loader'
|
||||
import SystemPrompt from '@deepseek-ai/dsh-system-prompt'
|
||||
import ToolRegistry from '@deepseek-ai/dsh-tools'
|
||||
import LocalSubprocessService from '@deepseek-ai/dsh-subprocess-local'
|
||||
import ToolRuntime from '@deepseek-ai/dsh-tools'
|
||||
import LocalSubprocessRuntime from '@deepseek-ai/dsh-subprocess-local'
|
||||
import * as toolFsSearch from '@deepseek-ai/dsh-tool-fs-search'
|
||||
|
||||
describe('dsh-tool-fs-search real-load-path guard', () => {
|
||||
@@ -38,8 +38,8 @@ describe('dsh-tool-fs-search real-load-path guard', () => {
|
||||
it('boots over ctx.subprocess through the unwrapped module without an inject error', async () => {
|
||||
const ctx = new Context()
|
||||
await ctx.plugin(SystemPrompt)
|
||||
await ctx.plugin(ToolRegistry)
|
||||
await ctx.plugin(LocalSubprocessService)
|
||||
await ctx.plugin(ToolRuntime)
|
||||
await ctx.plugin(LocalSubprocessRuntime)
|
||||
|
||||
const loader = Object.create(Loader.prototype) as Loader
|
||||
const unwrapped = loader.unwrapExports(toolFsSearch) as Parameters<Context['plugin']>[0]
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* abort/timeout kills, signal kills, ripgrep exit codes — so these tests
|
||||
* verify schemas, argument validation, argv construction, workdir derivation,
|
||||
* signal forwarding, `SEARCH_*` error classification, retention,
|
||||
* formatted-result spill handoff, and the no-background-task invariant.
|
||||
* formatted-result spill handoff, and the no-background-job invariant.
|
||||
* Real-`rg` behavior is pinned separately in integration.spec.ts.
|
||||
*/
|
||||
|
||||
@@ -15,8 +15,8 @@ import { Context } from '@deepseek-ai/cordis'
|
||||
import { join, sep } from 'node:path'
|
||||
import { createUserMessage, CallId } from '@deepseek-ai/dsh-llm'
|
||||
import SystemPrompt, { renderPrompt } from '@deepseek-ai/dsh-system-prompt'
|
||||
import ToolRegistry, { TOOL_ABORTED_BEFORE_DISPATCH, type ToolExecution, type ToolExecutionToken } from '@deepseek-ai/dsh-tools'
|
||||
import { SubprocessService } from '@deepseek-ai/dsh-subprocess'
|
||||
import ToolRuntime, { TOOL_ABORTED_BEFORE_DISPATCH, type ToolExecution, type ToolExecutionToken } from '@deepseek-ai/dsh-tools'
|
||||
import { SubprocessRuntime } from '@deepseek-ai/dsh-subprocess'
|
||||
import type { SubprocessCollectedOutputs, SubprocessHandle, SubprocessOutcome, SubprocessOutputRead, SubprocessOutputReader, SubprocessSpawnSpec } from '@deepseek-ai/dsh-subprocess'
|
||||
import { MAX_TIMER_DELAY_MS } from '@deepseek-ai/dsh-timeout'
|
||||
import { rgPath } from '@vscode/ripgrep'
|
||||
@@ -146,7 +146,7 @@ class FakeHandle implements SubprocessHandle {
|
||||
* never spawn outside a single awaited foreground call, so every test can
|
||||
* assert on the exact spawn specs and settled handles.
|
||||
*/
|
||||
class FakeSubprocess extends SubprocessService {
|
||||
class FakeSubprocess extends SubprocessRuntime {
|
||||
spawns: SubprocessSpawnSpec[] = []
|
||||
override async resolveExecutable(command: string): Promise<string> { return command }
|
||||
override spawnTerminal(): Promise<never> { throw new Error('search tools spawn pipes, never terminals') }
|
||||
@@ -192,7 +192,7 @@ async function setup(options: SetupOptions = {}) {
|
||||
const warnings: string[] = []
|
||||
ctx.logger.warn = ((message: unknown) => { warnings.push(String(message)) }) as typeof ctx.logger.warn
|
||||
await ctx.plugin(SystemPrompt)
|
||||
await ctx.plugin(ToolRegistry)
|
||||
await ctx.plugin(ToolRuntime)
|
||||
await ctx.plugin(FakeSubprocess)
|
||||
const subprocess = ctx.subprocess as FakeSubprocess
|
||||
if (options.spill === true) await ctx.plugin(FakeSpill)
|
||||
@@ -250,7 +250,7 @@ describe('registration', () => {
|
||||
it('stays pending until ctx.subprocess exists (inject)', async () => {
|
||||
const ctx = new Context()
|
||||
await ctx.plugin(SystemPrompt)
|
||||
await ctx.plugin(ToolRegistry)
|
||||
await ctx.plugin(ToolRuntime)
|
||||
await ctx.plugin(ToolFsSearch, DEFAULT_CONFIG) // no subprocess service
|
||||
expect(ctx.tools.schemas()).toHaveLength(0)
|
||||
})
|
||||
@@ -308,7 +308,7 @@ describe('config validation', () => {
|
||||
] as const)('rejects a non-positive or fractional %s at load', async (name, config) => {
|
||||
const ctx = new Context()
|
||||
await ctx.plugin(SystemPrompt)
|
||||
await ctx.plugin(ToolRegistry)
|
||||
await ctx.plugin(ToolRuntime)
|
||||
await ctx.plugin(FakeSubprocess)
|
||||
await expect(ctx.plugin(ToolFsSearch, { ...DEFAULT_CONFIG, ...config })).rejects.toThrow(new RegExp(`tool-fs-search: ${name} must be a positive integer`))
|
||||
})
|
||||
@@ -316,7 +316,7 @@ describe('config validation', () => {
|
||||
it('rejects a grace beyond the Node timer range at load', async () => {
|
||||
const ctx = new Context()
|
||||
await ctx.plugin(SystemPrompt)
|
||||
await ctx.plugin(ToolRegistry)
|
||||
await ctx.plugin(ToolRuntime)
|
||||
await ctx.plugin(FakeSubprocess)
|
||||
await expect(ctx.plugin(ToolFsSearch, {
|
||||
...DEFAULT_CONFIG,
|
||||
@@ -1090,7 +1090,7 @@ describe('rg --json transport failures (SEARCH_FAILED)', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('the no-background-task invariant', () => {
|
||||
describe('the no-background-job invariant', () => {
|
||||
it('settles every spawned search handle across successful and failed searches', async () => {
|
||||
const { ctx, subprocess } = await setup()
|
||||
subprocess.handler = () => runResult('a.ts\n')
|
||||
|
||||
Reference in New Issue
Block a user