fix: apply ts-build-config adjustment to new packages

This commit is contained in:
imccyu
2026-06-22 00:51:41 +08:00
parent 74cdd9a2e5
commit 88b75181ad
26 changed files with 76 additions and 60 deletions

View File

@@ -13,7 +13,7 @@
], ],
"scripts": { "scripts": {
"build": "tsc -b tsconfig.build.json && tsdown", "build": "tsc -b tsconfig.build.json && tsdown",
"clean:build": "rm -rf .typecheck packages/*/lib vendor/*/lib *.tsbuildinfo", "clean:build": "rm -rf .typecheck packages/*/*/lib vendor/*/lib *.tsbuildinfo",
"typecheck": "tsc -b tsconfig.json", "typecheck": "tsc -b tsconfig.json",
"lint": "eslint .", "lint": "eslint .",
"lint:fix": "eslint . --fix", "lint:fix": "eslint . --fix",

View File

@@ -17,7 +17,7 @@
import { Context, Service } from 'cordis' import { Context, Service } from 'cordis'
import type { BashExecRequest, BashExecSpec, BashRunResult, BashTask, BashTaskId, BashTaskListener, BashTaskRead, OwnerToken } from './types' import type { BashExecRequest, BashExecSpec, BashRunResult, BashTask, BashTaskId, BashTaskListener, BashTaskRead, OwnerToken } from './types'
export { BashTaskId, OwnerToken } from './types.ts' export { BashTaskId, OwnerToken } from './types'
export type { export type {
BashExecRequest, BashExecRequest,
BashExecSpec, BashExecSpec,

View File

@@ -5,17 +5,19 @@
"private": true, "private": true,
"type": "module", "type": "module",
"main": "lib/index.js", "main": "lib/index.js",
"types": "lib/index.d.ts", "types": "lib/types/index.d.ts",
"exports": { "exports": {
".": { ".": {
"types": "./lib/index.d.ts", "types": "./lib/types/index.d.ts",
"default": "./lib/index.js" "default": "./lib/index.js"
}, },
"./src/*": "./src/*", "./src/*": "./src/*",
"./package.json": "./package.json" "./package.json": "./package.json"
}, },
"files": [ "files": [
"lib", "lib/index.js",
"lib/types/**/*.d.ts",
"lib/types/**/*.d.ts.map",
"src" "src"
], ],
"license": "BSD-3-Clause", "license": "BSD-3-Clause",

View File

@@ -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.ts' import * as agentCore from '../src/index'
import { AgentId } from '@deepseek-ai/dsh-agent' import { AgentId } from '@deepseek-ai/dsh-agent'
/** /**

View File

@@ -2,7 +2,7 @@
"extends": "../../../tsconfig.base.json", "extends": "../../../tsconfig.base.json",
"compilerOptions": { "compilerOptions": {
"rootDir": "src", "rootDir": "src",
"outDir": "lib" "outDir": "lib/types"
}, },
"include": [ "include": [
"src" "src"

View File

@@ -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.ts' import { MockAdapter, textResponse } from './mock-adapter'
async function harness(adapter: MockAdapter) { async function harness(adapter: MockAdapter) {
const ctx = new Context() const ctx = new Context()

View File

@@ -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.ts' import { collectEvents } from '../../../../scripts/gen-cordis-catalog'
/** 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`. */

View File

@@ -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.ts' import { assemble, type AssembledResult } from './assemble'
/** /**
* 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

View File

@@ -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.ts' import { assemble } from './assemble'
/** 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 =

View File

@@ -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.ts' import { assemble, type AssembledResult } from './assemble'
/** /**
* 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

View File

@@ -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.ts' import { assemble } from './assemble'
/** Scripted SSE responses, one per request (OpenAI chat-completions shape). */ /** Scripted SSE responses, one per request (OpenAI chat-completions shape). */
interface MockServer { interface MockServer {

View File

@@ -6,8 +6,8 @@
* @module @deepseek-ai/dsh-llm/assembler * @module @deepseek-ai/dsh-llm/assembler
*/ */
import { CallId } from './brand.ts' import { CallId } from './brand'
import { assertNever } from './never.ts' import { assertNever } from './never'
import type { ContentBlock, FinishReason, Message, StreamChunk, TokenUsage } from './types' import type { ContentBlock, FinishReason, Message, StreamChunk, TokenUsage } from './types'
interface PartialBlock { interface PartialBlock {

View File

@@ -27,7 +27,7 @@
import { Context } from 'cordis' import { Context } from 'cordis'
import { interruptedTurnClosers, SESSION_FORMAT_VERSION } from '@deepseek-ai/dsh-session' import { interruptedTurnClosers, SESSION_FORMAT_VERSION } from '@deepseek-ai/dsh-session'
import type { Session, SessionEvent, SessionId, SessionHeader } from '@deepseek-ai/dsh-session' import type { Session, SessionEvent, SessionId, SessionHeader } from '@deepseek-ai/dsh-session'
import { assertSerializable, seedCoversPrefix } from './index.ts' import { assertSerializable, seedCoversPrefix } from './index'
/** /**
* A stored session's durable prefix as read back from a backend: its * A stored session's durable prefix as read back from a backend: its

View File

@@ -29,8 +29,8 @@ import type { SessionEvent, SessionId, SessionHeader } from '@deepseek-ai/dsh-se
export type { SessionHeader } from '@deepseek-ai/dsh-session' export type { SessionHeader } from '@deepseek-ai/dsh-session'
// The backend-agnostic write-path orchestration first-party backends compose. // The backend-agnostic write-path orchestration first-party backends compose.
export { PersistenceCoordinator } from './coordinator.ts' export { PersistenceCoordinator } from './coordinator'
export type { PersistenceBackend, StoredPrefix } from './coordinator.ts' export type { PersistenceBackend, StoredPrefix } from './coordinator'
declare module 'cordis' { declare module 'cordis' {
interface Context { interface Context {

View File

@@ -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.ts' import type { SessionPersistence } from '../src/index'
import { meta, oneTurnLog } from './contract.ts' import { meta, oneTurnLog } from './contract'
/** /**
* The backend-specific capabilities the orchestration suite needs beyond the * The backend-specific capabilities the orchestration suite needs beyond the

View File

@@ -5,24 +5,27 @@
"private": true, "private": true,
"type": "module", "type": "module",
"main": "lib/index.js", "main": "lib/index.js",
"types": "lib/index.d.ts", "types": "lib/types/index.d.ts",
"bin": { "bin": {
"dsh-acp-agent": "lib/bin.js" "dsh-acp-agent": "lib/bin.js"
}, },
"exports": { "exports": {
".": { ".": {
"types": "./lib/index.d.ts", "types": "./lib/types/index.d.ts",
"default": "./lib/index.js" "default": "./lib/index.js"
}, },
"./bin": { "./bin": {
"types": "./lib/bin.d.ts", "types": "./lib/types/bin.d.ts",
"default": "./lib/bin.js" "default": "./lib/bin.js"
}, },
"./src/*": "./src/*", "./src/*": "./src/*",
"./package.json": "./package.json" "./package.json": "./package.json"
}, },
"files": [ "files": [
"lib", "lib/index.js",
"lib/bin.js",
"lib/types/**/*.d.ts",
"lib/types/**/*.d.ts.map",
"src" "src"
], ],
"license": "BSD-3-Clause", "license": "BSD-3-Clause",

View File

@@ -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.ts' import * as acpAgent from '../src/index'
/** /**
* In-process unit coverage for the @deepseek-ai/dsh-acp-agent composition: * In-process unit coverage for the @deepseek-ai/dsh-acp-agent composition:

View File

@@ -2,7 +2,7 @@
"extends": "../../../tsconfig.base.json", "extends": "../../../tsconfig.base.json",
"compilerOptions": { "compilerOptions": {
"rootDir": "src", "rootDir": "src",
"outDir": "lib" "outDir": "lib/types"
}, },
"include": [ "include": [
"src" "src"

View File

@@ -3,11 +3,12 @@ import { defineConfig } from 'tsdown'
/** /**
* acp-agent ships TWO entries: the plugin (`index`) and the CLI `bin` (`bin`), * acp-agent ships TWO entries: the plugin (`index`) and the CLI `bin` (`bin`),
* the latter referenced by package.json `bin`/`exports["./bin"]`. The root * the latter referenced by package.json `bin`/`exports["./bin"]`. The root
* tsdown builds only `src/index.ts`, so this override adds `bin.ts`. * tsdown builds only `lib/types/index.js`, so this override adds
* Declarations come from `tsc -b` (dts: false), matching every package. * `lib/types/bin.js`. Declarations come from `tsc -b` (dts: false),
* matching every package.
*/ */
export default defineConfig({ export default defineConfig({
entry: ['src/index.ts', 'src/bin.ts'], entry: ['lib/types/index.js', 'lib/types/bin.js'],
outDir: 'lib', outDir: 'lib',
format: ['esm'], format: ['esm'],
platform: 'node', platform: 'node',

View File

@@ -5,24 +5,27 @@
"private": true, "private": true,
"type": "module", "type": "module",
"main": "lib/index.js", "main": "lib/index.js",
"types": "lib/index.d.ts", "types": "lib/types/index.d.ts",
"bin": { "bin": {
"dsh-stdio-agent": "lib/bin.js" "dsh-stdio-agent": "lib/bin.js"
}, },
"exports": { "exports": {
".": { ".": {
"types": "./lib/index.d.ts", "types": "./lib/types/index.d.ts",
"default": "./lib/index.js" "default": "./lib/index.js"
}, },
"./bin": { "./bin": {
"types": "./lib/bin.d.ts", "types": "./lib/types/bin.d.ts",
"default": "./lib/bin.js" "default": "./lib/bin.js"
}, },
"./src/*": "./src/*", "./src/*": "./src/*",
"./package.json": "./package.json" "./package.json": "./package.json"
}, },
"files": [ "files": [
"lib", "lib/index.js",
"lib/bin.js",
"lib/types/**/*.d.ts",
"lib/types/**/*.d.ts.map",
"src" "src"
], ],
"license": "BSD-3-Clause", "license": "BSD-3-Clause",

View File

@@ -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.ts' import * as stdioAgent from '../src/index'
/** /**
* 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

View File

@@ -2,7 +2,7 @@
"extends": "../../../tsconfig.base.json", "extends": "../../../tsconfig.base.json",
"compilerOptions": { "compilerOptions": {
"rootDir": "src", "rootDir": "src",
"outDir": "lib" "outDir": "lib/types"
}, },
"include": [ "include": [
"src" "src"

View File

@@ -3,11 +3,12 @@ import { defineConfig } from 'tsdown'
/** /**
* stdio-agent ships TWO entries: the plugin (`index`) and the CLI `bin` * stdio-agent ships TWO entries: the plugin (`index`) and the CLI `bin`
* (`bin`), the latter referenced by package.json `bin`/`exports["./bin"]`. * (`bin`), the latter referenced by package.json `bin`/`exports["./bin"]`.
* The root tsdown builds only `src/index.ts`, so this override adds `bin.ts`. * The root tsdown builds only `lib/types/index.js`, so this override adds
* Declarations come from `tsc -b` (dts: false), matching every package. * `lib/types/bin.js`. Declarations come from `tsc -b` (dts: false),
* matching every package.
*/ */
export default defineConfig({ export default defineConfig({
entry: ['src/index.ts', 'src/bin.ts'], entry: ['lib/types/index.js', 'lib/types/bin.js'],
outDir: 'lib', outDir: 'lib',
format: ['esm'], format: ['esm'],
platform: 'node', platform: 'node',

View File

@@ -5,17 +5,19 @@
"private": true, "private": true,
"type": "module", "type": "module",
"main": "lib/index.js", "main": "lib/index.js",
"types": "lib/index.d.ts", "types": "lib/types/index.d.ts",
"exports": { "exports": {
".": { ".": {
"types": "./lib/index.d.ts", "types": "./lib/types/index.d.ts",
"default": "./lib/index.js" "default": "./lib/index.js"
}, },
"./src/*": "./src/*", "./src/*": "./src/*",
"./package.json": "./package.json" "./package.json": "./package.json"
}, },
"files": [ "files": [
"lib", "lib/index.js",
"lib/types/**/*.d.ts",
"lib/types/**/*.d.ts.map",
"src" "src"
], ],
"license": "BSD-3-Clause", "license": "BSD-3-Clause",

View File

@@ -2,7 +2,7 @@
"extends": "../../../tsconfig.base.json", "extends": "../../../tsconfig.base.json",
"compilerOptions": { "compilerOptions": {
"rootDir": "src", "rootDir": "src",
"outDir": "lib" "outDir": "lib/types"
}, },
"include": [ "include": [
"src" "src"

View File

@@ -20,23 +20,27 @@
{ "path": "./vendor/timer" }, { "path": "./vendor/timer" },
{ "path": "./vendor/hmr" }, { "path": "./vendor/hmr" },
{ "path": "./vendor/logger-console" }, { "path": "./vendor/logger-console" },
{ "path": "./packages/llm" }, { "path": "./packages/util/brand" },
{ "path": "./packages/session" }, { "path": "./packages/llm/llm" },
{ "path": "./packages/session-persistence" }, { "path": "./packages/core/session" },
{ "path": "./packages/session-persistence-jsonl" }, { "path": "./packages/session-persistence/session-persistence" },
{ "path": "./packages/session-persistence-sqlite" }, { "path": "./packages/session-persistence/session-persistence-jsonl" },
{ "path": "./packages/system-prompt" }, { "path": "./packages/session-persistence/session-persistence-sqlite" },
{ "path": "./packages/agent" }, { "path": "./packages/core/system-prompt" },
{ "path": "./packages/tools" }, { "path": "./packages/core/agent" },
{ "path": "./packages/agent-loop" }, { "path": "./packages/core/tools" },
{ "path": "./packages/bash" }, { "path": "./packages/core/agent-loop" },
{ "path": "./packages/llm-deepseek" }, { "path": "./packages/core/agent-core" },
{ "path": "./packages/llm-pi-ai" }, { "path": "./packages/bash/bash" },
{ "path": "./packages/bash-local" }, { "path": "./packages/llm/llm-deepseek" },
{ "path": "./packages/tool-bash" }, { "path": "./packages/llm/llm-pi-ai" },
{ "path": "./packages/invariants" }, { "path": "./packages/bash/bash-local" },
{ "path": "./packages/acp" }, { "path": "./packages/bash/tool-bash" },
{ "path": "./packages/ui-stdio" }, { "path": "./packages/support/invariants" },
{ "path": "./packages/llm-replay" } { "path": "./packages/ui/acp" },
{ "path": "./packages/ui/acp-agent" },
{ "path": "./packages/ui/stdio-agent" },
{ "path": "./packages/support/ui-stdio" },
{ "path": "./packages/support/llm-replay" }
] ]
} }