revert: use rewriteRelativeImportExtensions for NextNode .d.ts resolve
This commit is contained in:
@@ -3,8 +3,8 @@ import { existsSync } from 'node:fs'
|
|||||||
import { fileURLToPath } from 'node:url'
|
import { fileURLToPath } from 'node:url'
|
||||||
import { dirname, join } from 'node:path'
|
import { dirname, join } from 'node:path'
|
||||||
import { describe, expect, it } from 'vitest'
|
import { describe, expect, it } from 'vitest'
|
||||||
import { type InputScript, runScenario } from './snapshot-harness'
|
import { type InputScript, runScenario } from './snapshot-harness.ts'
|
||||||
import { type NormalizeContext, normalizeSessionLog, normalizeStdout } from './snapshot-normalize'
|
import { type NormalizeContext, normalizeSessionLog, normalizeStdout } from './snapshot-normalize.ts'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ACP snapshot tests (REPLAY by default, keyless). Each scenario under
|
* ACP snapshot tests (REPLAY by default, keyless). Each scenario under
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { describe, expect, it } from 'vitest'
|
import { describe, expect, it } from 'vitest'
|
||||||
import { type NormalizeContext, normalizeSessionLog, normalizeStdout } from '../tests/snapshot-normalize'
|
import { type NormalizeContext, normalizeSessionLog, normalizeStdout } from '../tests/snapshot-normalize.ts'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unit tests for the pure snapshot normalizers. Live as a *.spec.ts (runs in
|
* Unit tests for the pure snapshot normalizers. Live as a *.spec.ts (runs in
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { join } from 'node:path'
|
|||||||
import { afterEach, describe, expect, it } from 'vitest'
|
import { afterEach, describe, expect, it } from 'vitest'
|
||||||
import type { Context } from 'cordis'
|
import type { Context } from 'cordis'
|
||||||
import { AgentId } from '@deepseek-ai/dsh-agent'
|
import { AgentId } from '@deepseek-ai/dsh-agent'
|
||||||
import { codingHarness, finalText, SYSTEM_PROMPT, waitForIdle } from './harness'
|
import { codingHarness, finalText, SYSTEM_PROMPT, waitForIdle } from './harness.ts'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The swebench-style smoke test: a real model fixes a real bug in a temp
|
* The swebench-style smoke test: a real model fixes a real bug in a temp
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { afterEach, describe, expect, it } from 'vitest'
|
import { afterEach, describe, expect, it } from 'vitest'
|
||||||
import type { Context } from 'cordis'
|
import type { Context } from 'cordis'
|
||||||
import { AgentId } from '@deepseek-ai/dsh-agent'
|
import { AgentId } from '@deepseek-ai/dsh-agent'
|
||||||
import { codingHarness, finalText, SYSTEM_PROMPT, waitForIdle } from './harness'
|
import { codingHarness, finalText, SYSTEM_PROMPT, waitForIdle } from './harness.ts'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The first place a REAL model meets the REAL bash tool: the cheap canary
|
* The first place a REAL model meets the REAL bash tool: the cheap canary
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import type { Context } from 'cordis'
|
|||||||
import type { ReactLoopAgent } from '@deepseek-ai/dsh-agent-loop'
|
import type { ReactLoopAgent } from '@deepseek-ai/dsh-agent-loop'
|
||||||
import { AgentId } from '@deepseek-ai/dsh-agent'
|
import { AgentId } from '@deepseek-ai/dsh-agent'
|
||||||
import { SessionId } from '@deepseek-ai/dsh-session'
|
import { SessionId } from '@deepseek-ai/dsh-session'
|
||||||
import { codingHarness, finalText, SYSTEM_PROMPT, waitForIdle } from './harness'
|
import { codingHarness, finalText, SYSTEM_PROMPT, waitForIdle } from './harness.ts'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Proves durable conversation continuity end-to-end: run 1 tells the REAL model
|
* Proves durable conversation continuity end-to-end: run 1 tells the REAL model
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import AgentLoop, { ReactLoopAgent } from '@deepseek-ai/dsh-agent-loop'
|
|||||||
import { LocalBashExecutor } from '@deepseek-ai/dsh-bash-local'
|
import { LocalBashExecutor } from '@deepseek-ai/dsh-bash-local'
|
||||||
import { BashTaskId } from '@deepseek-ai/dsh-bash'
|
import { BashTaskId } from '@deepseek-ai/dsh-bash'
|
||||||
import * as ToolBash from '@deepseek-ai/dsh-tool-bash'
|
import * as ToolBash from '@deepseek-ai/dsh-tool-bash'
|
||||||
import { MockAdapter, textResponse, toolCallResponse } from '../../../core/agent-loop/tests/mock-adapter'
|
import { MockAdapter, textResponse, toolCallResponse } from '../../../core/agent-loop/tests/mock-adapter.ts'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Full-loop integration: a scripted mock model drives the REAL bash tool
|
* Full-loop integration: a scripted mock model drives the REAL bash tool
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { describe, expect, it } from 'vitest'
|
import { describe, expect, it } from 'vitest'
|
||||||
import { Context } from 'cordis'
|
import { Context } from 'cordis'
|
||||||
import Loader from '@cordisjs/plugin-loader'
|
import Loader from '@cordisjs/plugin-loader'
|
||||||
import * as agentCore from '../src/index'
|
import * as agentCore from '../src/index.ts'
|
||||||
import { AgentId } from '@deepseek-ai/dsh-agent'
|
import { AgentId } from '@deepseek-ai/dsh-agent'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import SystemPrompt from '@deepseek-ai/dsh-system-prompt'
|
|||||||
import ToolRegistry from '@deepseek-ai/dsh-tools'
|
import ToolRegistry from '@deepseek-ai/dsh-tools'
|
||||||
import AgentRegistry from '@deepseek-ai/dsh-agent'
|
import AgentRegistry from '@deepseek-ai/dsh-agent'
|
||||||
import AgentLoop, { ReactLoopAgent } from '@deepseek-ai/dsh-agent-loop'
|
import AgentLoop, { ReactLoopAgent } from '@deepseek-ai/dsh-agent-loop'
|
||||||
import { MockAdapter, textResponse } from './mock-adapter'
|
import { MockAdapter, textResponse } from './mock-adapter.ts'
|
||||||
|
|
||||||
async function harness(adapter: MockAdapter) {
|
async function harness(adapter: MockAdapter) {
|
||||||
const ctx = new Context()
|
const ctx = new Context()
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import SystemPrompt from '@deepseek-ai/dsh-system-prompt'
|
|||||||
import ToolRegistry from '@deepseek-ai/dsh-tools'
|
import ToolRegistry from '@deepseek-ai/dsh-tools'
|
||||||
import AgentRegistry, { AgentId } from '@deepseek-ai/dsh-agent'
|
import AgentRegistry, { AgentId } from '@deepseek-ai/dsh-agent'
|
||||||
import AgentLoop, { ReactLoopAgent } from '@deepseek-ai/dsh-agent-loop'
|
import AgentLoop, { ReactLoopAgent } from '@deepseek-ai/dsh-agent-loop'
|
||||||
import { MockAdapter, textResponse } from './mock-adapter'
|
import { MockAdapter, textResponse } from './mock-adapter.ts'
|
||||||
|
|
||||||
async function harness(adapter: MockAdapter) {
|
async function harness(adapter: MockAdapter) {
|
||||||
const ctx = new Context()
|
const ctx = new Context()
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import ToolRegistry from '@deepseek-ai/dsh-tools'
|
|||||||
import AgentRegistry, { AgentId } from '@deepseek-ai/dsh-agent'
|
import AgentRegistry, { AgentId } from '@deepseek-ai/dsh-agent'
|
||||||
import SessionPersistenceJsonl from '@deepseek-ai/dsh-session-persistence-jsonl'
|
import SessionPersistenceJsonl from '@deepseek-ai/dsh-session-persistence-jsonl'
|
||||||
import AgentLoop, { ReactLoopAgent } from '@deepseek-ai/dsh-agent-loop'
|
import AgentLoop, { ReactLoopAgent } from '@deepseek-ai/dsh-agent-loop'
|
||||||
import { MockAdapter, textResponse } from './mock-adapter'
|
import { MockAdapter, textResponse } from './mock-adapter.ts'
|
||||||
|
|
||||||
const dirs: string[] = []
|
const dirs: string[] = []
|
||||||
afterEach(async () => { for (const d of dirs.splice(0)) await rm(d, { recursive: true, force: true }) })
|
afterEach(async () => { for (const d of dirs.splice(0)) await rm(d, { recursive: true, force: true }) })
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import SystemPrompt from '@deepseek-ai/dsh-system-prompt'
|
|||||||
import ToolRegistry, { defineTool } from '@deepseek-ai/dsh-tools'
|
import ToolRegistry, { defineTool } from '@deepseek-ai/dsh-tools'
|
||||||
import AgentRegistry, { AgentId } from '@deepseek-ai/dsh-agent'
|
import AgentRegistry, { AgentId } from '@deepseek-ai/dsh-agent'
|
||||||
import AgentLoop, { ReactLoopAgent } from '@deepseek-ai/dsh-agent-loop'
|
import AgentLoop, { ReactLoopAgent } from '@deepseek-ai/dsh-agent-loop'
|
||||||
import { MockAdapter, textResponse, toolCallResponse } from './mock-adapter'
|
import { MockAdapter, textResponse, toolCallResponse } from './mock-adapter.ts'
|
||||||
|
|
||||||
async function harness(adapter: MockAdapter) {
|
async function harness(adapter: MockAdapter) {
|
||||||
const ctx = new Context()
|
const ctx = new Context()
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import SystemPrompt from '@deepseek-ai/dsh-system-prompt'
|
|||||||
import ToolRegistry, { defineTool } from '@deepseek-ai/dsh-tools'
|
import ToolRegistry, { defineTool } from '@deepseek-ai/dsh-tools'
|
||||||
import AgentRegistry, { AgentId } from '@deepseek-ai/dsh-agent'
|
import AgentRegistry, { AgentId } from '@deepseek-ai/dsh-agent'
|
||||||
import AgentLoop, { ReactLoopAgent } from '@deepseek-ai/dsh-agent-loop'
|
import AgentLoop, { ReactLoopAgent } from '@deepseek-ai/dsh-agent-loop'
|
||||||
import { MockAdapter, maxTokensResponse, textResponse, toolCallResponse } from './mock-adapter'
|
import { MockAdapter, maxTokensResponse, textResponse, toolCallResponse } from './mock-adapter.ts'
|
||||||
|
|
||||||
async function harness(adapter: MockAdapter) {
|
async function harness(adapter: MockAdapter) {
|
||||||
const ctx = new Context()
|
const ctx = new Context()
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import ToolRegistry from '@deepseek-ai/dsh-tools'
|
|||||||
import AgentRegistry, { AgentId } from '@deepseek-ai/dsh-agent'
|
import AgentRegistry, { AgentId } from '@deepseek-ai/dsh-agent'
|
||||||
import SessionPersistenceJsonl from '@deepseek-ai/dsh-session-persistence-jsonl'
|
import SessionPersistenceJsonl from '@deepseek-ai/dsh-session-persistence-jsonl'
|
||||||
import AgentLoop, { ReactLoopAgent } from '@deepseek-ai/dsh-agent-loop'
|
import AgentLoop, { ReactLoopAgent } from '@deepseek-ai/dsh-agent-loop'
|
||||||
import { MockAdapter, textResponse } from './mock-adapter'
|
import { MockAdapter, textResponse } from './mock-adapter.ts'
|
||||||
|
|
||||||
const dirs: string[] = []
|
const dirs: string[] = []
|
||||||
afterEach(async () => { for (const d of dirs.splice(0)) await rm(d, { recursive: true, force: true }) })
|
afterEach(async () => { for (const d of dirs.splice(0)) await rm(d, { recursive: true, force: true }) })
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import ToolRegistry, { defineTool } from '@deepseek-ai/dsh-tools'
|
|||||||
import AgentRegistry, { AgentId } from '@deepseek-ai/dsh-agent'
|
import AgentRegistry, { AgentId } from '@deepseek-ai/dsh-agent'
|
||||||
import AgentLoop, { ReactLoopAgent } from '@deepseek-ai/dsh-agent-loop'
|
import AgentLoop, { ReactLoopAgent } from '@deepseek-ai/dsh-agent-loop'
|
||||||
import * as Invariants from '@deepseek-ai/dsh-invariants'
|
import * as Invariants from '@deepseek-ai/dsh-invariants'
|
||||||
import { MockAdapter, textResponse, toolCallResponse } from './mock-adapter'
|
import { MockAdapter, textResponse, toolCallResponse } from './mock-adapter.ts'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Regression tests for the findings of the first architecture review
|
* Regression tests for the findings of the first architecture review
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import { mkdtempSync, mkdirSync, rmSync, writeFileSync } from 'node:fs'
|
|||||||
import { tmpdir } from 'node:os'
|
import { tmpdir } from 'node:os'
|
||||||
import { join } from 'node:path'
|
import { join } from 'node:path'
|
||||||
import { afterEach, describe, expect, it } from 'vitest'
|
import { afterEach, describe, expect, it } from 'vitest'
|
||||||
import { collectEvents } from '../../../../scripts/gen-cordis-catalog'
|
import { collectEvents } from '../../../../scripts/gen-cordis-catalog.ts'
|
||||||
|
|
||||||
/** Write a fixture package exposing one `interface Events` block and return the
|
/** Write a fixture package exposing one `interface Events` block and return the
|
||||||
* scan root to hand `collectEvents`. */
|
* scan root to hand `collectEvents`. */
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { describe, expect, it } from 'vitest'
|
import { describe, expect, it } from 'vitest'
|
||||||
import { CallId } from '@deepseek-ai/dsh-llm'
|
import { CallId } from '@deepseek-ai/dsh-llm'
|
||||||
import { interruptedTurnClosers } from '../src/index'
|
import { interruptedTurnClosers } from '../src/index.ts'
|
||||||
import type { SessionEvent } from '../src/index'
|
import type { SessionEvent } from '../src/index.ts'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unit coverage for the crash-recovery closer synthesis. The persistence
|
* Unit coverage for the crash-recovery closer synthesis. The persistence
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import LlmService, { CallId } from '@deepseek-ai/dsh-llm'
|
|||||||
import type { Message, ToolSchema } from '@deepseek-ai/dsh-llm'
|
import type { Message, ToolSchema } from '@deepseek-ai/dsh-llm'
|
||||||
import * as LlmDeepSeek from '@deepseek-ai/dsh-llm-deepseek'
|
import * as LlmDeepSeek from '@deepseek-ai/dsh-llm-deepseek'
|
||||||
import type { Config } from '@deepseek-ai/dsh-llm-deepseek'
|
import type { Config } from '@deepseek-ai/dsh-llm-deepseek'
|
||||||
import { assemble, type AssembledResult } from './assemble'
|
import { assemble, type AssembledResult } from './assemble.ts'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Real-API e2e for the hand-rolled adapter: V4 Flash + V4 Pro across
|
* Real-API e2e for the hand-rolled adapter: V4 Flash + V4 Pro across
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { Context } from 'cordis'
|
|||||||
import LlmService, { LlmError } from '@deepseek-ai/dsh-llm'
|
import LlmService, { LlmError } from '@deepseek-ai/dsh-llm'
|
||||||
import * as LlmDeepSeek from '@deepseek-ai/dsh-llm-deepseek'
|
import * as LlmDeepSeek from '@deepseek-ai/dsh-llm-deepseek'
|
||||||
import { DeepSeekAdapter, httpErrorCode } from '@deepseek-ai/dsh-llm-deepseek'
|
import { DeepSeekAdapter, httpErrorCode } from '@deepseek-ai/dsh-llm-deepseek'
|
||||||
import { assemble } from './assemble'
|
import { assemble } from './assemble.ts'
|
||||||
|
|
||||||
/** One scripted behavior for the next request the mock server receives. */
|
/** One scripted behavior for the next request the mock server receives. */
|
||||||
type Behavior =
|
type Behavior =
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import type { Message, ToolSchema } from '@deepseek-ai/dsh-llm'
|
|||||||
import * as LlmPiAi from '@deepseek-ai/dsh-llm-pi-ai'
|
import * as LlmPiAi from '@deepseek-ai/dsh-llm-pi-ai'
|
||||||
import type { Config } from '@deepseek-ai/dsh-llm-pi-ai'
|
import type { Config } from '@deepseek-ai/dsh-llm-pi-ai'
|
||||||
import * as LlmDeepSeek from '@deepseek-ai/dsh-llm-deepseek'
|
import * as LlmDeepSeek from '@deepseek-ai/dsh-llm-deepseek'
|
||||||
import { assemble, type AssembledResult } from './assemble'
|
import { assemble, type AssembledResult } from './assemble.ts'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Real-API e2e for the pi-ai-backed adapter: V4 Flash + V4 Pro across all
|
* Real-API e2e for the pi-ai-backed adapter: V4 Flash + V4 Pro across all
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { Context } from 'cordis'
|
|||||||
import LlmService, { CallId, LlmError } from '@deepseek-ai/dsh-llm'
|
import LlmService, { CallId, LlmError } from '@deepseek-ai/dsh-llm'
|
||||||
import * as LlmPiAi from '@deepseek-ai/dsh-llm-pi-ai'
|
import * as LlmPiAi from '@deepseek-ai/dsh-llm-pi-ai'
|
||||||
import { buildModel, PiAiAdapter } from '@deepseek-ai/dsh-llm-pi-ai'
|
import { buildModel, PiAiAdapter } from '@deepseek-ai/dsh-llm-pi-ai'
|
||||||
import { assemble } from './assemble'
|
import { assemble } from './assemble.ts'
|
||||||
|
|
||||||
/** Scripted SSE responses, one per request (OpenAI chat-completions shape). */
|
/** Scripted SSE responses, one per request (OpenAI chat-completions shape). */
|
||||||
interface MockServer {
|
interface MockServer {
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ import { join } from 'node:path'
|
|||||||
import SessionStore, { SessionId } from '@deepseek-ai/dsh-session'
|
import SessionStore, { SessionId } from '@deepseek-ai/dsh-session'
|
||||||
import type { Session, SessionEvent } from '@deepseek-ai/dsh-session'
|
import type { Session, SessionEvent } from '@deepseek-ai/dsh-session'
|
||||||
import SessionPersistenceJsonl from '@deepseek-ai/dsh-session-persistence-jsonl'
|
import SessionPersistenceJsonl from '@deepseek-ai/dsh-session-persistence-jsonl'
|
||||||
import { encodeSegment, logPath, scanLog, sessionDir } from '../src/format'
|
import { encodeSegment, logPath, scanLog, sessionDir } from '../src/format.ts'
|
||||||
import { runPersistenceContract, meta, oneTurnLog } from '../../session-persistence/tests/contract'
|
import { runPersistenceContract, meta, oneTurnLog } from '../../session-persistence/tests/contract.ts'
|
||||||
import { runCoordinatorContract, type CoordinatorFixture } from '../../session-persistence/tests/coordinator-contract'
|
import { runCoordinatorContract, type CoordinatorFixture } from '../../session-persistence/tests/coordinator-contract.ts'
|
||||||
|
|
||||||
let root: string
|
let root: string
|
||||||
const dirs: string[] = []
|
const dirs: string[] = []
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ import { join } from 'node:path'
|
|||||||
import SessionStore, { SessionId } from '@deepseek-ai/dsh-session'
|
import SessionStore, { SessionId } from '@deepseek-ai/dsh-session'
|
||||||
import type { Session, SessionEvent } from '@deepseek-ai/dsh-session'
|
import type { Session, SessionEvent } from '@deepseek-ai/dsh-session'
|
||||||
import SessionPersistenceSqlite, { SCHEMA_VERSION } from '@deepseek-ai/dsh-session-persistence-sqlite'
|
import SessionPersistenceSqlite, { SCHEMA_VERSION } from '@deepseek-ai/dsh-session-persistence-sqlite'
|
||||||
import { openDatabase, scanRows, type EventRow } from '../src/schema'
|
import { openDatabase, scanRows, type EventRow } from '../src/schema.ts'
|
||||||
import { runPersistenceContract, meta, oneTurnLog } from '../../session-persistence/tests/contract'
|
import { runPersistenceContract, meta, oneTurnLog } from '../../session-persistence/tests/contract.ts'
|
||||||
import { runCoordinatorContract, type CoordinatorFixture } from '../../session-persistence/tests/coordinator-contract'
|
import { runCoordinatorContract, type CoordinatorFixture } from '../../session-persistence/tests/coordinator-contract.ts'
|
||||||
|
|
||||||
const dirs: string[] = []
|
const dirs: string[] = []
|
||||||
afterEach(async () => { for (const d of dirs.splice(0)) await rm(d, { recursive: true, force: true }) })
|
afterEach(async () => { for (const d of dirs.splice(0)) await rm(d, { recursive: true, force: true }) })
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import { describe, expect, it } from 'vitest'
|
|||||||
import { SESSION_FORMAT_VERSION, SessionId } from '@deepseek-ai/dsh-session'
|
import { SESSION_FORMAT_VERSION, SessionId } from '@deepseek-ai/dsh-session'
|
||||||
import type { SessionEvent, SessionHeader } from '@deepseek-ai/dsh-session'
|
import type { SessionEvent, SessionHeader } from '@deepseek-ai/dsh-session'
|
||||||
import { CallId } from '@deepseek-ai/dsh-llm'
|
import { CallId } from '@deepseek-ai/dsh-llm'
|
||||||
import type { SessionPersistence } from '../src/index'
|
import type { SessionPersistence } from '../src/index.ts'
|
||||||
|
|
||||||
/** A backend under test plus its teardown. */
|
/** A backend under test plus its teardown. */
|
||||||
export interface ContractBackend {
|
export interface ContractBackend {
|
||||||
|
|||||||
@@ -30,8 +30,8 @@ import { describe, expect, it } from 'vitest'
|
|||||||
import { Context, type Fiber } from 'cordis'
|
import { Context, type Fiber } from 'cordis'
|
||||||
import SessionStore, { SESSION_FORMAT_VERSION, SessionId } from '@deepseek-ai/dsh-session'
|
import SessionStore, { SESSION_FORMAT_VERSION, SessionId } from '@deepseek-ai/dsh-session'
|
||||||
import type { Session, SessionEvent } from '@deepseek-ai/dsh-session'
|
import type { Session, SessionEvent } from '@deepseek-ai/dsh-session'
|
||||||
import type { SessionPersistence } from '../src/index'
|
import type { SessionPersistence } from '../src/index.ts'
|
||||||
import { meta, oneTurnLog } from './contract'
|
import { meta, oneTurnLog } from './contract.ts'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The backend-specific capabilities the orchestration suite needs beyond the
|
* The backend-specific capabilities the orchestration suite needs beyond the
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ import type { Session, SessionEvent, SessionHeader } from '@deepseek-ai/dsh-sess
|
|||||||
import {
|
import {
|
||||||
SessionPersistence, PersistenceCoordinator, assertSerializable, seedCoversPrefix,
|
SessionPersistence, PersistenceCoordinator, assertSerializable, seedCoversPrefix,
|
||||||
type PersistenceBackend, type StoredPrefix,
|
type PersistenceBackend, type StoredPrefix,
|
||||||
} from '../src/index'
|
} from '../src/index.ts'
|
||||||
import { runPersistenceContract, meta, oneTurnLog } from './contract'
|
import { runPersistenceContract, meta, oneTurnLog } from './contract.ts'
|
||||||
import { runCoordinatorContract, type CoordinatorFixture } from './coordinator-contract'
|
import { runCoordinatorContract, type CoordinatorFixture } from './coordinator-contract.ts'
|
||||||
|
|
||||||
/** The durable store shape: materialized sessions only (no lazy entries). */
|
/** The durable store shape: materialized sessions only (no lazy entries). */
|
||||||
type MemoryStore = Map<string, { meta: SessionHeader; events: SessionEvent[] }>
|
type MemoryStore = Map<string, { meta: SessionHeader; events: SessionEvent[] }>
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import {
|
|||||||
loadReplayScript,
|
loadReplayScript,
|
||||||
name,
|
name,
|
||||||
parseSessionLog,
|
parseSessionLog,
|
||||||
} from '../src/index'
|
} from '../src/index.ts'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unit tests for the replay llm/stream plugin. These drive the listener through
|
* Unit tests for the replay llm/stream plugin. These drive the listener through
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import type { Agent, AgentStatus } from '@deepseek-ai/dsh-agent'
|
|||||||
import AgentRegistry from '@deepseek-ai/dsh-agent'
|
import AgentRegistry from '@deepseek-ai/dsh-agent'
|
||||||
import type { ContentBlock } from '@deepseek-ai/dsh-llm'
|
import type { ContentBlock } from '@deepseek-ai/dsh-llm'
|
||||||
import type { Session, SessionEvent } from '@deepseek-ai/dsh-session'
|
import type { Session, SessionEvent } from '@deepseek-ai/dsh-session'
|
||||||
import { createStdioChat, type Config, type StdioRuntime } from '../src/index'
|
import { createStdioChat, type Config, type StdioRuntime } from '../src/index.ts'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unit tests for the stdio UI plugin. They drive the REAL plugin body
|
* Unit tests for the stdio UI plugin. They drive the REAL plugin body
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { describe, expect, it } from 'vitest'
|
import { describe, expect, it } from 'vitest'
|
||||||
import { Context } from 'cordis'
|
import { Context } from 'cordis'
|
||||||
import Loader from '@cordisjs/plugin-loader'
|
import Loader from '@cordisjs/plugin-loader'
|
||||||
import * as acpAgent from '../src/index'
|
import * as acpAgent from '../src/index.ts'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* In-process unit coverage for the @deepseek-ai/dsh-acp-agent composition:
|
* In-process unit coverage for the @deepseek-ai/dsh-acp-agent composition:
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { tmpdir } from 'node:os'
|
|||||||
import { join } from 'node:path'
|
import { join } from 'node:path'
|
||||||
import { PROTOCOL_VERSION } from '@agentclientprotocol/sdk'
|
import { PROTOCOL_VERSION } from '@agentclientprotocol/sdk'
|
||||||
import { AgentId } from '@deepseek-ai/dsh-agent'
|
import { AgentId } from '@deepseek-ai/dsh-agent'
|
||||||
import { makeBridgeHarness, textResponse, type BridgeHarness } from './harness'
|
import { makeBridgeHarness, textResponse, type BridgeHarness } from './harness.ts'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* End-to-end bridge specs over an in-memory transport: a real
|
* End-to-end bridge specs over an in-memory transport: a real
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import {
|
|||||||
harnessBlockToAcpContent,
|
harnessBlockToAcpContent,
|
||||||
promptHasUnsupportedContent,
|
promptHasUnsupportedContent,
|
||||||
turnEndToStopReason,
|
turnEndToStopReason,
|
||||||
} from '../src/codec'
|
} from '../src/codec.ts'
|
||||||
|
|
||||||
describe('turnEndToStopReason', () => {
|
describe('turnEndToStopReason', () => {
|
||||||
// The SDK rejects an unknown stopReason, so this must be total over every
|
// The SDK rejects an unknown stopReason, so this must be total over every
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { join } from 'node:path'
|
|||||||
import { PROTOCOL_VERSION } from '@agentclientprotocol/sdk'
|
import { PROTOCOL_VERSION } from '@agentclientprotocol/sdk'
|
||||||
import { SessionId } from '@deepseek-ai/dsh-session'
|
import { SessionId } from '@deepseek-ai/dsh-session'
|
||||||
import { AgentId } from '@deepseek-ai/dsh-agent'
|
import { AgentId } from '@deepseek-ai/dsh-agent'
|
||||||
import { makeBridgeHarness, textResponse } from './harness'
|
import { makeBridgeHarness, textResponse } from './harness.ts'
|
||||||
|
|
||||||
describe('acp bridge — disposal & HMR safety', () => {
|
describe('acp bridge — disposal & HMR safety', () => {
|
||||||
let storageDir: string
|
let storageDir: string
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { join } from 'node:path'
|
|||||||
import { PROTOCOL_VERSION } from '@agentclientprotocol/sdk'
|
import { PROTOCOL_VERSION } from '@agentclientprotocol/sdk'
|
||||||
import { AgentId } from '@deepseek-ai/dsh-agent'
|
import { AgentId } from '@deepseek-ai/dsh-agent'
|
||||||
import { SessionId } from '@deepseek-ai/dsh-session'
|
import { SessionId } from '@deepseek-ai/dsh-session'
|
||||||
import { makeBridgeHarness, textResponse, type BridgeHarness } from './harness'
|
import { makeBridgeHarness, textResponse, type BridgeHarness } from './harness.ts'
|
||||||
|
|
||||||
describe('acp bridge — demux & config edges', () => {
|
describe('acp bridge — demux & config edges', () => {
|
||||||
let storageDir: string
|
let storageDir: string
|
||||||
|
|||||||
@@ -30,8 +30,8 @@ import {
|
|||||||
type SessionNotification,
|
type SessionNotification,
|
||||||
type Stream,
|
type Stream,
|
||||||
} from '@agentclientprotocol/sdk'
|
} from '@agentclientprotocol/sdk'
|
||||||
import * as AcpPlugin from '../src/index'
|
import * as AcpPlugin from '../src/index.ts'
|
||||||
import { type AcpConfig } from '../src/index'
|
import { type AcpConfig } from '../src/index.ts'
|
||||||
|
|
||||||
/** A scripted mock adapter (mirrors the agent-loop test adapter). */
|
/** A scripted mock adapter (mirrors the agent-loop test adapter). */
|
||||||
class MockAdapter extends LlmAdapter {
|
class MockAdapter extends LlmAdapter {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { join } from 'node:path'
|
|||||||
import { PROTOCOL_VERSION } from '@agentclientprotocol/sdk'
|
import { PROTOCOL_VERSION } from '@agentclientprotocol/sdk'
|
||||||
import { SESSION_FORMAT_VERSION, SessionId } from '@deepseek-ai/dsh-session'
|
import { SESSION_FORMAT_VERSION, SessionId } from '@deepseek-ai/dsh-session'
|
||||||
import { AgentId } from '@deepseek-ai/dsh-agent'
|
import { AgentId } from '@deepseek-ai/dsh-agent'
|
||||||
import { makeBridgeHarness, textResponse, toolCallResponse, type BridgeHarness, type CapturedUpdate } from './harness'
|
import { makeBridgeHarness, textResponse, toolCallResponse, type BridgeHarness, type CapturedUpdate } from './harness.ts'
|
||||||
|
|
||||||
/** Concatenate the text of all agent_message_chunk updates. */
|
/** Concatenate the text of all agent_message_chunk updates. */
|
||||||
function messageText(updates: CapturedUpdate[]): string {
|
function messageText(updates: CapturedUpdate[]): string {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { tmpdir } from 'node:os'
|
|||||||
import { join } from 'node:path'
|
import { join } from 'node:path'
|
||||||
import { PROTOCOL_VERSION } from '@agentclientprotocol/sdk'
|
import { PROTOCOL_VERSION } from '@agentclientprotocol/sdk'
|
||||||
import { AgentId } from '@deepseek-ai/dsh-agent'
|
import { AgentId } from '@deepseek-ai/dsh-agent'
|
||||||
import { makeBridgeHarness, textResponse, type BridgeHarness, type CapturedUpdate } from './harness'
|
import { makeBridgeHarness, textResponse, type BridgeHarness, type CapturedUpdate } from './harness.ts'
|
||||||
|
|
||||||
/** Text of the agent_message_chunk updates scoped to one session id. */
|
/** Text of the agent_message_chunk updates scoped to one session id. */
|
||||||
function messageTextFor(updates: { sessionId?: string; update: CapturedUpdate }[], sessionId: string): string {
|
function messageTextFor(updates: { sessionId?: string; update: CapturedUpdate }[], sessionId: string): string {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import fc from 'fast-check'
|
|||||||
import { CallId } from '@deepseek-ai/dsh-llm'
|
import { CallId } from '@deepseek-ai/dsh-llm'
|
||||||
import { SessionId, type SessionEvent } from '@deepseek-ai/dsh-session'
|
import { SessionId, type SessionEvent } from '@deepseek-ai/dsh-session'
|
||||||
import type { SessionNotification } from '@agentclientprotocol/sdk'
|
import type { SessionNotification } from '@agentclientprotocol/sdk'
|
||||||
import { streamSessionEventUpdate } from '../src/index'
|
import { streamSessionEventUpdate } from '../src/index.ts'
|
||||||
|
|
||||||
const LEGAL_UPDATE_KINDS = new Set([
|
const LEGAL_UPDATE_KINDS = new Set([
|
||||||
'agent_message_chunk',
|
'agent_message_chunk',
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { CallId } from '@deepseek-ai/dsh-llm'
|
|||||||
import { SessionId, type SessionEvent } from '@deepseek-ai/dsh-session'
|
import { SessionId, type SessionEvent } from '@deepseek-ai/dsh-session'
|
||||||
import type { SessionNotification } from '@agentclientprotocol/sdk'
|
import type { SessionNotification } from '@agentclientprotocol/sdk'
|
||||||
import type { ToolDefinition, ToolRegistry } from '@deepseek-ai/dsh-tools'
|
import type { ToolDefinition, ToolRegistry } from '@deepseek-ai/dsh-tools'
|
||||||
import { streamSessionEventUpdate, agentOptions, ToolPresenter } from '../src/index'
|
import { streamSessionEventUpdate, agentOptions, ToolPresenter } from '../src/index.ts'
|
||||||
|
|
||||||
/** Collect the updates a single event produces (no presenter → generic fallback). */
|
/** Collect the updates a single event produces (no presenter → generic fallback). */
|
||||||
function updatesFor(event: SessionEvent): SessionNotification['update'][] {
|
function updatesFor(event: SessionEvent): SessionNotification['update'][] {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import {
|
|||||||
textResponse,
|
textResponse,
|
||||||
toolCallResponse,
|
toolCallResponse,
|
||||||
type BridgeHarness,
|
type BridgeHarness,
|
||||||
} from './harness'
|
} from './harness.ts'
|
||||||
|
|
||||||
/** Boilerplate: initialize + create one session, returning its id. */
|
/** Boilerplate: initialize + create one session, returning its id. */
|
||||||
async function newSession(h: BridgeHarness, clientCapabilities: Record<string, unknown> = {}): Promise<string> {
|
async function newSession(h: BridgeHarness, clientCapabilities: Record<string, unknown> = {}): Promise<string> {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { describe, it, expect } from 'vitest'
|
|||||||
import { Context } from 'cordis'
|
import { Context } from 'cordis'
|
||||||
import Loader from '@cordisjs/plugin-loader'
|
import Loader from '@cordisjs/plugin-loader'
|
||||||
import { AgentId } from '@deepseek-ai/dsh-agent'
|
import { AgentId } from '@deepseek-ai/dsh-agent'
|
||||||
import * as stdioAgent from '../src/index'
|
import * as stdioAgent from '../src/index.ts'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unit coverage for the @deepseek-ai/dsh-stdio-agent app plugin: mounting it
|
* Unit coverage for the @deepseek-ai/dsh-stdio-agent app plugin: mounting it
|
||||||
|
|||||||
Reference in New Issue
Block a user