Files
deepseek-harness/packages/test-support/session-snapshot/src/index.ts
T
Yichen Jiang 536e9932c3 test(snapshots): pin replay search credentials and cover a keyless search tool list
Snapshot replays now supply a placeholder DEEPSEEK_API_KEY through the shared
REPLAY_CREDENTIAL_ENV, so web_search visibility no longer depends on whether
the runner exports a key. The new web-search-unconfigured headless scenario
pins a request without web_search, the headless keyless smoke asserts the
same through the real Loader, and subagent-dsh-sdk-dynamic-route's keyless
dsh-sdk child now records its tool list without web_search.
2026-09-27 16:01:03 +08:00

121 lines
3.5 KiB
TypeScript

/**
* Session-log snapshot support behind the keyless snapshot tier
* (`pnpm run test:snapshot`). The current ACP adapter has four layers: the
* shared subprocess/client launcher ({@link launchAcpTestAgent}), the scripted
* scenario harness ({@link runScenario}), the pure expected-output normalizers
* ({@link normalizeStdout} / {@link normalizeSessionLog} /
* {@link scrubModelRequestBulk} / {@link scrubSystemPrompts}), and the suite
* factory ({@link defineAcpSnapshotSuite}) that registers a scenario table as a
* full describe/it tree. Transport-neutral normalizers and fixture invariants
* remain reusable by other profile adapters. Ordinary ACP e2e tests can use the launcher directly;
* the ACP corpus adapter supplies only its {@link AgentUnderTest} paths,
* snapshots directory, and {@link Scenario} table.
*
* NOTE: ./suite.ts imports vitest, so this package is importable only inside a
* vitest run — a support-tier constraint stated in the README.
*
* @module @deepseek-ai/dsh-session-snapshot
*/
export {
redactSessionSnapshotIds,
} from './identity.ts'
export {
REPLAY_CREDENTIAL_ENV,
runScenario,
snapshotSpillRoot,
type HarvestedLog,
type InputScript,
type InputStep,
type PermissionAnswer,
type RunOptions,
type RunResult,
} from './harness.ts'
export {
launchAcpTestAgent,
materializeProfilePatch,
type AcpTestLaunchOptions,
type AgentUnderTest,
type LaunchedAcpTestAgent,
} from './launcher.ts'
export {
extractSnapshotSpillPaths,
normalizeSessionFormatMetadata,
normalizeSessionLog,
normalizeSessionSnapshot,
normalizeSessionSnapshots,
normalizeStdout,
scrubModelRequestBulk,
scrubSessionSnapshot,
scrubSystemPrompts,
scrubToolSchemas,
tokenizeSessionFixtureCwd,
type CwdPathMode,
type NormalizeContext,
type NormalizeOptions,
} from './normalize.ts'
export {
parseSnapshotManifest,
writesCurrentSessionFixtures,
type SnapshotHeaderManifest,
type SnapshotInputAttachment,
type SnapshotInputManifest,
type SnapshotManifest,
type SnapshotPermission,
type SnapshotPlatform,
type SnapshotProfile,
type SnapshotRecording,
type SnapshotReplayManifest,
type SnapshotSessionReference,
type SnapshotSessionFormatCoverage,
type SnapshotSessionFormatManifest,
type SnapshotSessionWriteMode,
type SnapshotWorkspaceManifest,
} from './manifest.ts'
export {
assertPersistedSessionVersion,
assertSessionFixtureVersion,
latestPersistedSessionPaths,
parsePersistedSessionFilename,
parseSessionFixtureName,
persistedSessionFilename,
sessionFixtureFiles,
sessionFixtureName,
sessionFixtureNames,
sessionHeaderVersion,
writerSnapshotName,
type PersistedSessionFile,
type SessionFixtureFile,
} from './session-files.ts'
export {
formatSystemPromptSnapshot,
formatToolSchemasSnapshot,
fixtureContext,
headerChangeCount,
defineAcpSnapshotSuite,
normalizedHeaders,
normalizedSystemPrompts,
normalizedToolSchemas,
parseSystemPromptSnapshot,
parseToolSchemasSnapshot,
refreshFixtureReplacements,
reconcileCatalogCreationTimes,
restorePinnedToolSchemas,
stabilizeFixtureMessageIds,
stabilizeRefreshLog,
systemPromptPrecedesRequests,
type Scenario,
type SnapshotSuiteOptions,
} from './suite.ts'
export {
captureExpectedWorkspaceSnapshot,
captureWorkspaceSnapshot,
EMPTY_WORKSPACE_MARKER,
type CaptureWorkspaceSnapshotOptions,
type WorkspaceBinaryFileSnapshot,
type WorkspaceEmptyDirectorySnapshot,
type WorkspaceSnapshotEntry,
type WorkspaceSymlinkSnapshot,
type WorkspaceTextFileSnapshot,
} from './workspace.ts'