refactor: ts in packages/*/tests use extensionless import

This commit is contained in:
imccyu
2026-06-17 23:21:42 +08:00
parent 846ea4dd60
commit 279e9f17eb
24 changed files with 29 additions and 29 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ import { mkdtemp, rm } from 'node:fs/promises'
import { tmpdir } from 'node:os'
import { join } from 'node:path'
import { PROTOCOL_VERSION } from '@agentclientprotocol/sdk'
import { makeBridgeHarness, textResponse, type BridgeHarness } from './harness.ts'
import { makeBridgeHarness, textResponse, type BridgeHarness } from './harness'
/**
* End-to-end bridge specs over an in-memory transport: a real
+1 -1
View File
@@ -6,7 +6,7 @@ import {
harnessBlockToAcpContent,
promptHasUnsupportedContent,
turnEndToStopReason,
} from '../src/codec.ts'
} from '../src/codec'
describe('turnEndToStopReason', () => {
// The SDK rejects an unknown stopReason, so this must be total over every
+1 -1
View File
@@ -3,7 +3,7 @@ import { mkdtemp, rm } from 'node:fs/promises'
import { tmpdir } from 'node:os'
import { join } from 'node:path'
import { PROTOCOL_VERSION } from '@agentclientprotocol/sdk'
import { makeBridgeHarness } from './harness.ts'
import { makeBridgeHarness } from './harness'
describe('acp bridge — disposal & HMR safety', () => {
let storageDir: string
+1 -1
View File
@@ -3,7 +3,7 @@ import { mkdtemp, rm } from 'node:fs/promises'
import { tmpdir } from 'node:os'
import { join } from 'node:path'
import { PROTOCOL_VERSION } from '@agentclientprotocol/sdk'
import { makeBridgeHarness, textResponse, type BridgeHarness } from './harness.ts'
import { makeBridgeHarness, textResponse, type BridgeHarness } from './harness'
describe('acp bridge — demux & config edges', () => {
let storageDir: string
+2 -2
View File
@@ -30,8 +30,8 @@ import {
type SessionNotification,
type Stream,
} from '@agentclientprotocol/sdk'
import * as AcpPlugin from '../src/index.ts'
import { type AcpConfig } from '../src/index.ts'
import * as AcpPlugin from '../src/index'
import { type AcpConfig } from '../src/index'
/** A scripted mock adapter (mirrors the agent-loop test adapter). */
class MockAdapter extends LlmAdapter {
+1 -1
View File
@@ -4,7 +4,7 @@ import { tmpdir } from 'node:os'
import { join } from 'node:path'
import { PROTOCOL_VERSION } from '@agentclientprotocol/sdk'
import { SessionId } from '@deepseek-ai/dsh-session'
import { makeBridgeHarness, textResponse, toolCallResponse, type BridgeHarness, type CapturedUpdate } from './harness.ts'
import { makeBridgeHarness, textResponse, toolCallResponse, type BridgeHarness, type CapturedUpdate } from './harness'
/** Concatenate the text of all agent_message_chunk updates. */
function messageText(updates: CapturedUpdate[]): string {
+1 -1
View File
@@ -3,7 +3,7 @@ import { mkdtemp, rm } from 'node:fs/promises'
import { tmpdir } from 'node:os'
import { join } from 'node:path'
import { PROTOCOL_VERSION } from '@agentclientprotocol/sdk'
import { makeBridgeHarness, textResponse, type BridgeHarness, type CapturedUpdate } from './harness.ts'
import { makeBridgeHarness, textResponse, type BridgeHarness, type CapturedUpdate } from './harness'
/** Text of the agent_message_chunk updates scoped to one session id. */
function messageTextFor(updates: { sessionId?: string; update: CapturedUpdate }[], sessionId: string): string {
+1 -1
View File
@@ -19,7 +19,7 @@ import fc from 'fast-check'
import { CallId } from '@deepseek-ai/dsh-llm'
import type { SessionEvent } from '@deepseek-ai/dsh-session'
import type { SessionNotification } from '@agentclientprotocol/sdk'
import { streamSessionEventUpdate } from '../src/index.ts'
import { streamSessionEventUpdate } from '../src/index'
const LEGAL_UPDATE_KINDS = new Set([
'agent_message_chunk',
+1 -1
View File
@@ -3,7 +3,7 @@ import { CallId } from '@deepseek-ai/dsh-llm'
import type { SessionEvent } from '@deepseek-ai/dsh-session'
import type { SessionNotification } from '@agentclientprotocol/sdk'
import type { ToolDefinition, ToolRegistry } from '@deepseek-ai/dsh-tools'
import { streamSessionEventUpdate, agentOptions, ToolPresenter } from '../src/index.ts'
import { streamSessionEventUpdate, agentOptions, ToolPresenter } from '../src/index'
/** Collect the updates a single event produces (no presenter → generic fallback). */
function updatesFor(event: SessionEvent): SessionNotification['update'][] {
+1 -1
View File
@@ -11,7 +11,7 @@ import {
textResponse,
toolCallResponse,
type BridgeHarness,
} from './harness.ts'
} from './harness'
/** Boilerplate: initialize + create one session, returning its id. */
async function newSession(h: BridgeHarness, clientCapabilities: Record<string, unknown> = {}): Promise<string> {