Merge origin/master into feat/cua-permission-onboarding
This commit is contained in:
commit
a928f614bc
548 files changed
+13534
-1837
No files matched your search
@@ -174,7 +174,7 @@ describe('Python runtime executable builder CLI', () => {
|
||||
|
||||
expect(result.status).toBe(0)
|
||||
expect(result.stdout).toContain('exec pkg')
|
||||
expect(result.stdout).toContain('--sea --targets node24-macos-x64')
|
||||
expect(result.stdout).toContain('--sea --compress Brotli --targets node24-macos-x64')
|
||||
expect(result.stdout).toContain('keep only node-pty prebuilds darwin-x64')
|
||||
expect(result.stdout).toContain('lock optional resource downloads and copy Office skills')
|
||||
expect(result.stdout).toContain(join(root, 'dist-exe', 'macos-x64'))
|
||||
|
||||
@@ -232,7 +232,7 @@ class BuildCli {
|
||||
' --dry-run print every command and config patch without executing.',
|
||||
' --help print this help.',
|
||||
'',
|
||||
'Build route: @yao-pkg/pkg --sea (root devDependency, pnpm-patched); see .agents/notes/implemented/architecture/2026-07-10-single-file-executable-sdk-runtime-distribution.md.',
|
||||
'Build route: @yao-pkg/pkg --sea --compress Brotli (root devDependency, pnpm-patched); see .agents/notes/implemented/architecture/2026-07-10-single-file-executable-sdk-runtime-distribution.md.',
|
||||
`Stages the node carrier in ${PYTHON_RUNTIME_DIR}/${PYTHON_NODE_SUBDIR} and writes executables to ${OUT_DIR}/.`,
|
||||
].join('\n')
|
||||
}
|
||||
@@ -399,6 +399,8 @@ class SingleExeBuild {
|
||||
'pkg',
|
||||
this.staging,
|
||||
'--sea',
|
||||
'--compress',
|
||||
'Brotli',
|
||||
'--targets',
|
||||
target.spec,
|
||||
'--output',
|
||||
|
||||
@@ -7,7 +7,8 @@ const root = resolve(import.meta.dirname, '..')
|
||||
|
||||
const artifactGraph = {
|
||||
'native': [],
|
||||
'host-src': ['native'],
|
||||
'host-typert': [],
|
||||
'host-src': ['native', 'host-typert'],
|
||||
'host-bundle': ['host-src'],
|
||||
'desktop-bundle': ['host-bundle'],
|
||||
'client-src': ['desktop-bundle'],
|
||||
@@ -81,12 +82,12 @@ describe('repository build steps', () => {
|
||||
})
|
||||
})
|
||||
|
||||
it('type-checks every program with the source-only Typert pass beside Host compilation', () => {
|
||||
it('type-checks every program after source-only Typert generation', () => {
|
||||
const gates = buildGates(root, 'typecheck')
|
||||
expect(graph(gates)).toEqual({
|
||||
'host-src': [],
|
||||
'host-typert': [],
|
||||
'client-src': ['host-src', 'host-typert'],
|
||||
'host-src': ['host-typert'],
|
||||
'client-src': ['host-src'],
|
||||
'host-check': ['host-src'],
|
||||
'client-check': ['client-src'],
|
||||
})
|
||||
|
||||
+9
-10
@@ -5,8 +5,8 @@
|
||||
* `--scope check` type-checks only the Host and Client aggregate programs against the package
|
||||
* declarations already on disk; the default runs both step sets as one dependency graph, so the
|
||||
* aggregate checks overlap the remaining artifact steps. `--scope typecheck` (`pnpm run typecheck`)
|
||||
* type-checks every package project and both aggregate programs; beside Host compilation it writes
|
||||
* the Typert declarations that Client compilation imports, without bundling.
|
||||
* generates Typert declarations before package compilation, then type-checks every package project
|
||||
* and both aggregate programs without bundling.
|
||||
*/
|
||||
|
||||
import { rmSync } from 'node:fs'
|
||||
@@ -68,11 +68,12 @@ export function parseBuildArguments(args: readonly string[]): BuildArguments {
|
||||
|
||||
/**
|
||||
* Construct the build steps of one scope as a gate dependency graph.
|
||||
* Artifact steps keep the serial order native, Host compilation, Host bundle (Typert),
|
||||
* Desktop bundle, Client compilation, Client bundle, configured CUA preparation, then Web. The typecheck scope runs Host
|
||||
* compilation beside the bundle-free Typert pass, which reads only source, and then Client
|
||||
* compilation, which needs both outputs; it writes no bundle. In the complete and typecheck
|
||||
* scopes each aggregate check waits only for its own face's package compilation; alone, the
|
||||
* Artifact steps generate Typert from source before Host compilation, then bundle Host,
|
||||
* Desktop, and Client artifacts, prepare the configured CUA helper, then build Web.
|
||||
* Native output also precedes Host compilation.
|
||||
* The typecheck scope generates Typert before compiling Host and Client packages; it writes no
|
||||
* bundle. In complete and typecheck scopes each aggregate check waits only for its own face's
|
||||
* package compilation; alone, the
|
||||
* checks have no predecessors and read whatever declarations already exist. The typecheck scope
|
||||
* checks aggregates in build mode, which skips a program whose tsbuildinfo is current; the other
|
||||
* scopes use project mode, which compiles no reference.
|
||||
@@ -92,7 +93,7 @@ export function buildGates(
|
||||
if (scope === 'complete' || scope === 'artifacts') {
|
||||
gates.push(pnpmGate('native', 'native addon', ['run', 'build:native-system'], [], env))
|
||||
for (const step of libraryBuildSteps(root, 'all')) {
|
||||
gates.push(libraryGate(step, step.id === 'host-src' ? ['native'] : step.needs, env))
|
||||
gates.push(libraryGate(step, step.id === 'host-src' ? ['native', ...step.needs] : step.needs, env))
|
||||
}
|
||||
gates.push(pnpmGate('cua', 'configured CUA helper', ['run', 'build:cua'], ['client-bundle'], env))
|
||||
gates.push(pnpmGate('web', 'Web build', ['run', 'build:web'], ['cua'], env))
|
||||
@@ -108,8 +109,6 @@ export function buildGates(
|
||||
displayCommand: `tsc ${scope === 'typecheck' ? '-b' : '-p'} tsconfig.${face}.json`,
|
||||
command: process.execPath,
|
||||
args: scope === 'typecheck' ? aggregateBuildArgs(face) : aggregateCheckArgs(face),
|
||||
// No Host aggregate file imports a generated `/typert` or `/remote` subpath, so
|
||||
// host-check never reads what a concurrent host-typert step writes.
|
||||
needs: scope === 'check' ? [] : [`${face}-src`],
|
||||
env,
|
||||
})
|
||||
|
||||
@@ -473,3 +473,21 @@ it('requires the standalone shortcut protocol and rejects unrelated runtime file
|
||||
.toEqual([expect.stringContaining('package.json files must be')])
|
||||
}
|
||||
})
|
||||
|
||||
it('requires the OAR license while rejecting unrelated payload files', () => {
|
||||
const dir = 'packages/experimental/subagent-oar'
|
||||
const manifest = JSON.parse(readFileSync(new URL(`../${dir}/package.json`, import.meta.url), 'utf8')) as WorkspaceManifest['manifest']
|
||||
const files = [
|
||||
'icon.svg', 'locale/*.json', 'lib/index.js',
|
||||
'LICENSE-OAR', 'lib/types/**/*.d.ts',
|
||||
]
|
||||
expect(expectedDshPackageFiles(manifest)).toEqual(files)
|
||||
expect(checkWorkspaceManifest({ dir, manifest })).toEqual([])
|
||||
for (const invalidFiles of [
|
||||
files.filter(file => file !== 'LICENSE-OAR'),
|
||||
[...files, 'lib/unrelated.js'],
|
||||
]) {
|
||||
expect(checkWorkspaceManifest({ dir, manifest: { ...manifest, files: invalidFiles } }))
|
||||
.toEqual([expect.stringContaining('package.json files must be')])
|
||||
}
|
||||
})
|
||||
@@ -178,6 +178,8 @@ export function readWorkspaceManifests(repositoryRoot: string): WorkspaceManifes
|
||||
}
|
||||
|
||||
const packageFileExtras: Readonly<Record<string, readonly string[]>> = {
|
||||
// The embedded OAR implementation retains its upstream license.
|
||||
'@deepseek-ai/dsh-experimental-subagent-oar': ['LICENSE-OAR'],
|
||||
// CUA publishes its client API and attributed native source for local macOS builds.
|
||||
'@deepseek-ai/dsh-cua': ['lib/types.js', 'lib/api.js', 'lib/bridge.js', 'lib/native-client.js', 'lib/protocol.js'],
|
||||
'@deepseek-ai/dsh-experimental-cua-macos': ['native/bin', 'native/Package.swift', 'native/Sources', 'native/tests/swift', 'native/tests/test_swift.py', 'native/LICENSE.cua-driver', 'native/upstream.json', 'native/README.md', 'native/README.zh.md', 'native/protocol.schema.json'],
|
||||
@@ -206,8 +208,8 @@ const packageFileExtras: Readonly<Record<string, readonly string[]>> = {
|
||||
'@deepseek-ai/dsh-experimental-inspector': ['lib/client.*.js', 'lib/worker.js', 'lib/devtools/**'],
|
||||
// Creator's composition guidance travels with the declaration package.
|
||||
'@deepseek-ai/dsh-agent-preset': ['skills'],
|
||||
// The Web Host mounts the default-off settings owner independently of each
|
||||
// Agent-scoped delegation-tool instance.
|
||||
// The Web Host mounts the default-off settings owner independently of the
|
||||
// delegation-tool instances.
|
||||
'@deepseek-ai/dsh-tool-subagent': ['lib/model-selection-settings.js'],
|
||||
// The JSONL backend resolves its private verification Worker relative to
|
||||
// import.meta.url; it is shipped without a public package subpath.
|
||||
|
||||
@@ -5,6 +5,7 @@ import { spawnSync } from 'node:child_process'
|
||||
import { runInNewContext } from 'node:vm'
|
||||
import * as yaml from 'js-yaml'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { BUILD_BACKED_NODE_COMPAT_VERSION } from './run-gates.ts'
|
||||
|
||||
interface Step {
|
||||
name?: string
|
||||
@@ -54,6 +55,14 @@ function route(options: { mode?: string; author?: string; repository?: string; f
|
||||
}
|
||||
|
||||
describe('Node compatibility self-hosted routing', () => {
|
||||
it('runs the build-backed compatibility minor and declares it for installed CLI users', () => {
|
||||
expect(job.strategy.matrix.include.filter(entry => String(entry.node) === BUILD_BACKED_NODE_COMPAT_VERSION)).toHaveLength(1)
|
||||
for (const manifest of ['package.json', 'apps/cli/package.json']) {
|
||||
const pkg = JSON.parse(readFileSync(resolve(import.meta.dirname, '..', manifest), 'utf8')) as { engines: { node: string } }
|
||||
expect(pkg.engines.node).toBe(`>=${BUILD_BACKED_NODE_COMPAT_VERSION}.0`)
|
||||
}
|
||||
})
|
||||
|
||||
it('uses the Linux pool only for opted-in repository-owned PRs', () => {
|
||||
expect(route()).toEqual(labels)
|
||||
for (const mode of ['', 'hosted', 'unexpected']) expect(route({ mode })).toBe('ubuntu-latest')
|
||||
@@ -67,11 +76,10 @@ describe('Node compatibility self-hosted routing', () => {
|
||||
expect(route({ repository: '' })).toBe('ubuntu-latest')
|
||||
})
|
||||
|
||||
it('preserves all three required version jobs and their concurrency', () => {
|
||||
it('preserves the supported version jobs and their concurrency', () => {
|
||||
expect(job.if).toBe("github.event_name == 'pull_request'")
|
||||
expect(job.strategy['fail-fast']).toBe(false)
|
||||
expect(job.strategy.matrix.include).toEqual([
|
||||
{ node: '22.19', name: 'node 22.19', runner: 'ubuntu-latest', gate_concurrency: '1' },
|
||||
{ node: '24.9', name: 'node 24.9', runner: 'ubuntu-latest', gate_concurrency: '1' },
|
||||
{ node: 26, name: 'node 26', runner: 'ubuntu-latest', gate_concurrency: '1' },
|
||||
])
|
||||
|
||||
@@ -30,7 +30,7 @@ describe('CI workflow', () => {
|
||||
expect(compatibilityLimit).toBeGreaterThan(0)
|
||||
expect(compatibility.strategy).toMatchObject({
|
||||
'fail-fast': false,
|
||||
matrix: { include: [{ node: '22.19' }, { node: '24.9' }, { node: 26 }] },
|
||||
matrix: { include: [{ node: '24.9' }, { node: 26 }] },
|
||||
})
|
||||
expect(workflowJob(ci, 'all-checks-passed').needs).toContain('node-compat')
|
||||
const ordinaryJobs = Object.entries(ci.jobs)
|
||||
@@ -86,7 +86,10 @@ describe('CI workflow', () => {
|
||||
.toContainEqual(expect.objectContaining({ name: 'Build', run: command }))
|
||||
}
|
||||
const scripts = JSON.parse(readFileSync(resolve(root, 'package.json'), 'utf8')) as { scripts: Record<string, string> }
|
||||
expect(scripts.scripts['build:lib:host']).toContain('tsc -b tsconfig.host.json')
|
||||
const hostSteps = scripts.scripts['build:lib:host']!.split(' && ')
|
||||
expect(hostSteps[0]).toBe('tsx scripts/compile-referenced-projects.ts host-libraries')
|
||||
expect(hostSteps).toContain('node --max-old-space-size=4096 ./node_modules/typescript/bin/tsc -p tsconfig.host.json')
|
||||
expect(hostSteps.at(-1)).toBe('pnpm --filter @deepseek-ai/dsh-desktop run bundle')
|
||||
expect(scripts.scripts['build:lib:client']).toContain('tsc -b tsconfig.client.json')
|
||||
expect(scripts.scripts.typecheck).toBe('tsx scripts/build.ts --scope typecheck')
|
||||
})
|
||||
@@ -668,12 +671,15 @@ describe('CI workflow', () => {
|
||||
expect(uploadIndex).toBeGreaterThan(benchmarkIndex)
|
||||
})
|
||||
|
||||
it('gives the Wine Host TypeScript compile the repository heap budget', () => {
|
||||
it('generates metadata before the Wine Host TypeScript compile and retains its heap budget', () => {
|
||||
const wineGates = readFileSync(resolve(root, 'scripts/wine-windows-gates.sh'), 'utf8')
|
||||
|
||||
expect(wineGates).toContain(
|
||||
'wine_node "$scratch/logs/host-tsc.log" --max-old-space-size=4096 "$tsc_js" -b tsconfig.host.json --pretty false',
|
||||
)
|
||||
const metadata = wineGates.indexOf('wine_node "$scratch/logs/host-typert.log" --import tsx/esm scripts/generate-typert.ts')
|
||||
expect(metadata).toBeGreaterThan(-1)
|
||||
expect(metadata).toBeLessThan(wineGates.indexOf('wine_node "$scratch/logs/host-tsc.log"'))
|
||||
})
|
||||
|
||||
it('cancels superseded master runs without changing the post-merge job inventory', () => {
|
||||
|
||||
@@ -141,6 +141,40 @@ describe('client build environment', () => {
|
||||
expect(repositoryCommitHash('/unused', { DSH_CLIENT_COMMIT_HASH: COMMIT_HASH })).toBe(COMMIT_HASH.slice(0, 7))
|
||||
})
|
||||
|
||||
it.each([undefined, 'true', 'false'])('isolates local branding while retaining repository metadata (dirty=%s)', (dirty) => {
|
||||
const parent = {
|
||||
DSH_BUILD_CLIENT_PROFILE: 'official',
|
||||
DSH_CLIENT_BUILD_PROFILE: 'official',
|
||||
DSH_CLIENT_TITLE: 'DeepSeek Harness',
|
||||
DSH_CLIENT_COMMIT_HASH: COMMIT_HASH.slice(0, 7),
|
||||
DSH_CLIENT_VERSION: '1.2.3',
|
||||
DSH_CLIENT_GIT_DIRTY: dirty,
|
||||
DSH_CLIENT_EXTRA: 'inherited',
|
||||
}
|
||||
const local = resolveClientBuildEnvironment(parent, 'local')
|
||||
expect(local).toEqual({
|
||||
DSH_CLIENT_BUILD_PROFILE: 'local',
|
||||
DSH_CLIENT_COMMIT_HASH: COMMIT_HASH.slice(0, 7),
|
||||
DSH_CLIENT_VERSION: '1.2.3',
|
||||
...(dirty === 'true' ? { DSH_CLIENT_GIT_DIRTY: 'true' } : {}),
|
||||
})
|
||||
expect(clientBuildProcessEnvironment(parent, local)).toEqual(local)
|
||||
expect(resolveClientBuildEnvironment({ ...parent, DSH_BUILD_CLIENT_PROFILE: 'local' })).toEqual(local)
|
||||
expect(resolveClientBuildEnvironment({ ...parent, ...local }, 'official')).toEqual({
|
||||
DSH_CLIENT_BUILD_PROFILE: 'official',
|
||||
DSH_CLIENT_COMMIT_HASH: COMMIT_HASH.slice(0, 7),
|
||||
DSH_CLIENT_TITLE: 'DeepSeek Harness',
|
||||
DSH_CLIENT_VERSION: '1.2.3',
|
||||
})
|
||||
})
|
||||
|
||||
it('requires source metadata for an explicit local build', () => {
|
||||
expect(() => { resolveClientBuildEnvironment({}, 'local') }).toThrow(/DSH_CLIENT_COMMIT_HASH/)
|
||||
expect(() => {
|
||||
resolveClientBuildEnvironment({ DSH_CLIENT_COMMIT_HASH: COMMIT_HASH.slice(0, 7) }, 'local')
|
||||
}).toThrow(/DSH_CLIENT_VERSION/)
|
||||
})
|
||||
|
||||
it('owns repository version, commit, and dirty metadata for complete builds', () => {
|
||||
const fixtureRoot = repositoryFixture()
|
||||
const commit = git(fixtureRoot, ['rev-parse', '--short=7', 'HEAD'])
|
||||
|
||||
@@ -180,6 +180,8 @@ function clientBuildEnvironment(environment: NodeJS.ProcessEnv): ClientBuildEnvi
|
||||
|
||||
/**
|
||||
* Resolve the exact public environment selected for a complete client build.
|
||||
* Named profiles discard inherited public overrides. Local builds retain the supplied
|
||||
* commit, version, and true dirty marker; repositoryClientBuildEnvironment supplies that metadata.
|
||||
* @param environment - parent process environment.
|
||||
* @param profile - explicit profile, or the non-public selector when omitted.
|
||||
* @returns the inherited public values when no profile is selected, otherwise the named profile.
|
||||
@@ -189,22 +191,25 @@ export function resolveClientBuildEnvironment(
|
||||
profile: string | undefined = environment[CLIENT_BUILD_PROFILE_SELECTOR],
|
||||
): ClientBuildEnvironment {
|
||||
if (profile === undefined) return clientBuildEnvironment(environment)
|
||||
if (profile === 'official') {
|
||||
if (profile === 'official' || profile === 'local') {
|
||||
const commitHash = environment[CLIENT_COMMIT_HASH_VARIABLE]
|
||||
const version = environment[CLIENT_VERSION_VARIABLE]
|
||||
if (commitHash === undefined) {
|
||||
throw new Error(`${CLIENT_COMMIT_HASH_VARIABLE} is required for the official client build profile`)
|
||||
throw new Error(`${CLIENT_COMMIT_HASH_VARIABLE} is required for the ${profile} client build profile`)
|
||||
}
|
||||
if (version === undefined) {
|
||||
throw new Error(`${CLIENT_VERSION_VARIABLE} is required for the official client build profile`)
|
||||
throw new Error(`${CLIENT_VERSION_VARIABLE} is required for the ${profile} client build profile`)
|
||||
}
|
||||
return {
|
||||
DSH_CLIENT_COMMIT_HASH: commitHash,
|
||||
DSH_CLIENT_VERSION: version,
|
||||
...OFFICIAL_CLIENT_BUILD_ENVIRONMENT,
|
||||
...(profile === 'official' ? OFFICIAL_CLIENT_BUILD_ENVIRONMENT : {
|
||||
DSH_CLIENT_BUILD_PROFILE: 'local',
|
||||
...(environment.DSH_CLIENT_GIT_DIRTY === 'true' ? { DSH_CLIENT_GIT_DIRTY: 'true' } : {}),
|
||||
}),
|
||||
}
|
||||
}
|
||||
throw new Error(`unknown client build profile ${JSON.stringify(profile)}; expected "official"`)
|
||||
throw new Error(`unknown client build profile ${JSON.stringify(profile)}; expected "official" or "local"`)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
/** Compatibility checks execute command entrypoints; importing helpers cannot detect a silent no-op. */
|
||||
|
||||
import { spawnSync } from 'node:child_process'
|
||||
import { resolve } from 'node:path'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
|
||||
const root = resolve(import.meta.dirname, '..')
|
||||
|
||||
describe('repository command entrypoints', () => {
|
||||
it.each([
|
||||
['run-gates.ts', ['invalid-compat-mode'], 'run-gates: expected mode'],
|
||||
['build.ts', ['--scope', 'invalid-compat-scope'], 'build: --scope must be'],
|
||||
] as const)('executes %s argument validation on the running Node version', (script, args, diagnostic) => {
|
||||
const child = spawnSync(process.execPath, ['--import', 'tsx/esm', resolve(root, 'scripts', script), ...args], {
|
||||
cwd: root,
|
||||
encoding: 'utf8',
|
||||
timeout: 30_000,
|
||||
})
|
||||
expect(child.error).toBeUndefined()
|
||||
expect(child.signal).toBeNull()
|
||||
expect(child.status).toBe(1)
|
||||
expect(child.stderr).toContain(diagnostic)
|
||||
})
|
||||
})
|
||||
@@ -14,6 +14,7 @@ const compiler = fileURLToPath(import.meta.resolve('typescript/bin/tsc'))
|
||||
function fixture(): { root: string; leaf: string } {
|
||||
const root = mkdtempSync(join(tmpdir(), 'dsh-referenced-projects-'))
|
||||
onTestFinished(() => { removeFixtureSafely(root) })
|
||||
mkdirSync(join(root, 'packages'))
|
||||
const leaf = join(root, 'leaf package')
|
||||
mkdirSync(join(leaf, 'src'), { recursive: true })
|
||||
writeFileSync(join(root, 'package.json'), JSON.stringify({ type: 'module' }))
|
||||
@@ -110,6 +111,31 @@ describe('internal artifact build order', () => {
|
||||
expect(commands()).toEqual(expected.map(args => ({ args, title: 'Inherited Build Title' })))
|
||||
})
|
||||
|
||||
it('compiles a Host metadata consumer from a clean tree', () => {
|
||||
const { root } = fixture()
|
||||
const producer = writeTypertWorkspace(root)
|
||||
const commands = recordedCommands(root)
|
||||
const consumer = join(root, 'consumer')
|
||||
mkdirSync(join(consumer, 'src'), { recursive: true })
|
||||
writeFileSync(join(consumer, 'src/index.ts'), 'import { TYPERT } from "../../packages/fixture/probe/lib/typert.host.js"\nexport const value: unknown = TYPERT\n')
|
||||
writeFileSync(join(consumer, 'tsconfig.json'), JSON.stringify({
|
||||
extends: '../tsconfig.base.json', compilerOptions: { rootDir: 'src', outDir: 'lib/types' },
|
||||
include: ['src'], references: [{ path: '../packages/fixture/probe' }],
|
||||
}))
|
||||
writeFileSync(join(root, 'tsconfig.host.json'), JSON.stringify({
|
||||
extends: './tsconfig.base.json', compilerOptions: { noEmit: true }, files: [],
|
||||
references: [{ path: producer }, { path: consumer }],
|
||||
}))
|
||||
|
||||
expect(existsSync(join(producer, 'lib'))).toBe(false)
|
||||
buildLibraryArtifacts(root, true)
|
||||
|
||||
expect(readFileSync(join(consumer, 'lib/types/index.js'), 'utf8')).toContain('TYPERT')
|
||||
expect(commands().map(command => command.args)).toEqual([
|
||||
['exec', 'tsdown', '--config-loader', 'native', '--env.DSH_BUILD_FACE', 'host'],
|
||||
])
|
||||
})
|
||||
|
||||
it('stops after a failed Host bundler before Desktop and Client builds', () => {
|
||||
const { root } = fixture()
|
||||
const commands = recordedCommands(root, true)
|
||||
@@ -174,25 +200,21 @@ describe('bundle-free Host contracts', { timeout: 60_000 }, () => {
|
||||
expect(outputs()).toEqual(expect.arrayContaining(['typert.host.d.ts', 'typert.host.js']))
|
||||
})
|
||||
|
||||
it('fails when the Typert pass rejects a contributor while Host compilation completes', async () => {
|
||||
const { pkg, run, outputs } = typertWorkspace()
|
||||
it('does not compile Host packages after Typert rejects a contributor', async () => {
|
||||
const { pkg, run } = typertWorkspace()
|
||||
setPublishedFiles(pkg, [])
|
||||
|
||||
await expect(run()).rejects.toThrow('Host Typert exited with 1')
|
||||
expect(outputs()).toEqual(['types/index.d.ts', 'types/index.js'])
|
||||
expect(existsSync(join(pkg, 'lib'))).toBe(false)
|
||||
})
|
||||
|
||||
it('reports both steps when both fail', async () => {
|
||||
it('reports generation before an unrelated compiler error', async () => {
|
||||
const { pkg, run } = typertWorkspace('/** @typert schema */\nexport interface Payload { value: string }\nexport const value: number = "invalid"\n')
|
||||
setPublishedFiles(pkg, [])
|
||||
|
||||
const failure: unknown = await run().then(() => undefined, (error: unknown) => error)
|
||||
|
||||
expect(failure).toBeInstanceOf(AggregateError)
|
||||
expect((failure as AggregateError).errors.map(error => String(error))).toEqual([
|
||||
expect.stringContaining('host compiler exited with'),
|
||||
expect.stringContaining('Host Typert exited with 1'),
|
||||
])
|
||||
expect(String(failure)).toContain('Host Typert exited with 1')
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/**
|
||||
* Compile and bundle package projects without repeating aggregate test and script typechecks.
|
||||
* Contract steps replace the Host bundle with the bundle-free Typert pass for consumers that read
|
||||
* only declarations.
|
||||
* Source-only Typert generation precedes compilation; contract steps omit runtime bundles.
|
||||
*/
|
||||
|
||||
import { spawn, spawnSync } from 'node:child_process'
|
||||
@@ -147,7 +146,7 @@ function compilerStep(
|
||||
// Typert reads workspace packages only from source (generate-typert.ts
|
||||
// rejects build outputs), so it needs no compiled package. It runs under tsx's
|
||||
// ESM hook rather than through `pnpm exec`, whose startup would lengthen the
|
||||
// critical path before Client compilation.
|
||||
// critical path before package compilation.
|
||||
function typertStep(): LibraryStep {
|
||||
return {
|
||||
id: 'host-typert',
|
||||
@@ -166,16 +165,17 @@ function pnpmStep(id: LibraryStepId, label: string, args: readonly string[], nee
|
||||
|
||||
/**
|
||||
* List the package-library build steps in Host, Desktop, then Client dependency order.
|
||||
* Host bundling runs Typert, whose Remote declarations Client compilation imports.
|
||||
* Source-only Typert generation supplies declarations before any package compilation.
|
||||
* @param root - Repository root containing the compiler and bundle configurations.
|
||||
* @param faces - `host` lists Host compilation and bundling, which produce the Typert outputs; `all` adds Desktop and Client.
|
||||
* @param faces - `host` lists Typert generation, Host compilation, and bundling; `all` adds Desktop and Client.
|
||||
* @param mode - Check package types by default; benchmark emission defers diagnostics to required full builds.
|
||||
* @returns The ordered steps; each step needs its predecessor.
|
||||
* @throws If an aggregate configuration is invalid.
|
||||
*/
|
||||
export function libraryBuildSteps(root: string, faces: 'host' | 'all', mode: CompilationMode = 'checked'): LibraryStep[] {
|
||||
const host: LibraryStep[] = [
|
||||
compilerStep(root, 'host', mode, []),
|
||||
typertStep(),
|
||||
compilerStep(root, 'host', mode, ['host-typert']),
|
||||
pnpmStep('host-bundle', 'Host bundle', ['exec', 'tsdown', '--config-loader', 'native', '--env.DSH_BUILD_FACE', 'host'], ['host-src']),
|
||||
]
|
||||
if (faces === 'host') return host
|
||||
@@ -188,19 +188,18 @@ export function libraryBuildSteps(root: string, faces: 'host' | 'all', mode: Com
|
||||
}
|
||||
|
||||
/**
|
||||
* List the bundle-free package steps that produce every declaration the type checkers, oxlint, and
|
||||
* documentation checks read: Host compilation and the Typert pass, which writes the generated
|
||||
* Typert declarations from source without bundling, run independently; Client compilation, which
|
||||
* imports both, needs the two. Unlike {@link libraryBuildSteps}, no step writes runnable bundles.
|
||||
* List bundle-free metadata generation and package compilation steps.
|
||||
* Source-only Typert generation supplies declarations before Host compilation; Client
|
||||
* compilation follows the Host declarations. No step writes runtime bundles.
|
||||
* @param root - Repository root containing the compiler configurations.
|
||||
* @param faces - `host` lists Host compilation and the Typert pass; `all` adds Client compilation.
|
||||
* @param faces - `host` lists the Typert pass and Host compilation; `all` adds Client compilation.
|
||||
* @returns The steps in report order.
|
||||
* @throws If an aggregate configuration is invalid.
|
||||
*/
|
||||
export function contractSteps(root: string, faces: 'host' | 'all'): LibraryStep[] {
|
||||
const host = [compilerStep(root, 'host', 'checked', []), typertStep()]
|
||||
const host = [typertStep(), compilerStep(root, 'host', 'checked', ['host-typert'])]
|
||||
if (faces === 'host') return host
|
||||
return [...host, compilerStep(root, 'client', 'checked', ['host-src', 'host-typert'])]
|
||||
return [...host, compilerStep(root, 'client', 'checked', ['host-src'])]
|
||||
}
|
||||
|
||||
function runStep(root: string, step: LibraryStep): void {
|
||||
@@ -209,7 +208,7 @@ function runStep(root: string, step: LibraryStep): void {
|
||||
if (result.status !== 0) throw stepFailure(step, result.status ?? result.signal)
|
||||
}
|
||||
|
||||
function runStepConcurrently(root: string, step: LibraryStep): Promise<void> {
|
||||
function runStepAsync(root: string, step: LibraryStep): Promise<void> {
|
||||
return new Promise((settle, fail) => {
|
||||
const child = spawn(step.command, step.args, { cwd: root, stdio: 'inherit' })
|
||||
child.once('error', fail)
|
||||
@@ -227,7 +226,7 @@ function stepFailure(step: LibraryStep, exit: number | NodeJS.Signals | null): E
|
||||
/**
|
||||
* Emit package libraries serially in Host, Desktop, then Client dependency order.
|
||||
* @param root - Repository root containing the compiler and bundle configurations.
|
||||
* @param hostOnly - Stop after Host compilation and bundling, which produce the Typert outputs.
|
||||
* @param hostOnly - Stop after Typert generation, Host compilation, and bundling.
|
||||
* @param mode - Check package types by default; benchmark emission defers diagnostics to required full builds.
|
||||
* @throws If any compiler or bundler fails.
|
||||
*/
|
||||
@@ -236,18 +235,13 @@ export function buildLibraryArtifacts(root: string, hostOnly: boolean, mode: Com
|
||||
}
|
||||
|
||||
/**
|
||||
* Compile Host package projects and, concurrently, write the generated Typert declarations
|
||||
* without bundling. Both steps run to completion even when the other fails.
|
||||
* @param root - Repository root containing the compiler configuration; the Typert pass runs there.
|
||||
* @returns A promise that settles after both steps exit.
|
||||
* @throws The failed step's error, or an `AggregateError` naming both steps when both fail.
|
||||
* Generate Typert declarations from source, then compile Host package projects.
|
||||
* @param root - Repository root containing the compiler configuration and source contributors.
|
||||
* @returns a promise that settles after generation and compilation exit.
|
||||
* @throws the first failed step's error; dependent compilation does not start after generation fails.
|
||||
*/
|
||||
export async function buildHostContracts(root: string): Promise<void> {
|
||||
const results = await Promise.allSettled(contractSteps(root, 'host').map(step => runStepConcurrently(root, step)))
|
||||
const failures: unknown[] = []
|
||||
for (const result of results) if (result.status === 'rejected') failures.push(result.reason)
|
||||
if (failures.length === 1) throw failures[0]
|
||||
if (failures.length > 1) throw new AggregateError(failures, 'compile-referenced-projects: host compiler and Host Typert both failed')
|
||||
for (const step of contractSteps(root, 'host')) await runStepAsync(root, step)
|
||||
}
|
||||
|
||||
if (import.meta.main) {
|
||||
|
||||
@@ -138,7 +138,7 @@ function formatDiagnostics(diagnostics: readonly ts.Diagnostic[], blocks: Block[
|
||||
/**
|
||||
* Reuse the Host aggregate references from a temp project one directory below
|
||||
* root. Generated Client API examples opt out because their declarations do
|
||||
* not exist until Host tsdown has run.
|
||||
* not exist until source-only Typert generation has run.
|
||||
*/
|
||||
function workspaceReferences(): { path: string }[] {
|
||||
const file = join(root, 'tsconfig.host.json')
|
||||
|
||||
@@ -50,6 +50,7 @@ export { REGION_BEGIN, REGION_END }
|
||||
* errors, so the partition can never silently drift from the service API.
|
||||
*/
|
||||
export const SERVICE_PAGE: Record<string, string> = {
|
||||
headlessStartup: 'boot.md',
|
||||
translator: 'translation.md',
|
||||
cotTranslation: 'translation.md',
|
||||
speechToText: 'voice-input.md',
|
||||
|
||||
@@ -107,6 +107,14 @@ const GROUP_ORDER = [
|
||||
]
|
||||
|
||||
const SERVICE_ROLES: ServiceRole[] = [
|
||||
{
|
||||
key: 'headlessStartup',
|
||||
pkg: 'headless',
|
||||
title: 'Headless invocation options',
|
||||
mode: 'core',
|
||||
consumers: ['headless'],
|
||||
note: 'Supplies parsed task and run options to the headless runner and its sandbox-policy configuration.',
|
||||
},
|
||||
{
|
||||
key: 'cotTranslation',
|
||||
pkg: 'experimental-client-ui-cot-translation',
|
||||
|
||||
@@ -33,10 +33,13 @@ describe('THIRD_PARTY_NOTICES.md', () => {
|
||||
}, async () => {
|
||||
const generated = await render()
|
||||
expect(generated).toContain('It depends on the third-party software listed below.')
|
||||
expect(generated).toContain('| [`cross-spawn`](https://github.com/moxystudio/node-cross-spawn) | MIT |')
|
||||
expect(generated).not.toContain('https://github.com/git@')
|
||||
expect(generated).toContain(`| [\`numpy\`](https://github.com/numpy/numpy) | ${primaryRuntimeLock.pythonPackages.numpy} | BSD-3-Clause |`)
|
||||
expect(generated).toContain('## LibreOffice conversion kit')
|
||||
expect(generated).toContain('Recipients must have access to those corresponding sources and notices.')
|
||||
expect(generated.split('## Development-only npm dependencies')[0]).toContain('| [`chrome-devtools-frontend`]')
|
||||
expect(generated.split('## Development-only npm dependencies')[0]).toContain('| [`@botiverse/oar`]')
|
||||
expect(generated).toContain('third-party license and notice files supplied by the npm source')
|
||||
expect(readFileSync(resolve(root, 'THIRD_PARTY_NOTICES.md'), 'utf8'), 'stale notices — run `pnpm run gen-third-party-notices`').toBe(generated)
|
||||
})
|
||||
@@ -53,6 +56,43 @@ function workspace(entries: Record<string, Manifest>): { manifests: Map<string,
|
||||
}
|
||||
|
||||
describe('tierExternalDeps', () => {
|
||||
it('discloses host-bundled OAR as runtime code and applies runtime license checks', () => {
|
||||
const { manifests, names } = workspace({
|
||||
'packages/experimental/subagent-oar/package.json': {
|
||||
name: '@deepseek-ai/dsh-experimental-subagent-oar',
|
||||
devDependencies: { '@botiverse/oar': '0.67.0', 'host-build-tool': '^1' },
|
||||
},
|
||||
})
|
||||
const tiers = tierExternalDeps(manifests, names)
|
||||
expect(tiers.get('@botiverse/oar')).toBe(true)
|
||||
expect(tiers.get('host-build-tool')).toBe(false)
|
||||
const dependencies = [{ name: '@botiverse/oar', license: 'GPL-3.0-only' }]
|
||||
.filter(dependency => tiers.get(dependency.name))
|
||||
expect(() => { assertRuntimeLicenses(dependencies) }).toThrow('@botiverse/oar (GPL-3.0-only)')
|
||||
expect(() => { assertRuntimeLicenses([{ name: '@botiverse/oar', license: 'Apache-2.0' }]) }).not.toThrow()
|
||||
})
|
||||
|
||||
it('keeps unrelated OAR development declarations out of runtime disclosure', () => {
|
||||
const { manifests, names } = workspace({
|
||||
'packages/experimental/unrelated/package.json': {
|
||||
name: '@deepseek-ai/dsh-experimental-unrelated',
|
||||
devDependencies: { '@botiverse/oar': '0.67.0' },
|
||||
},
|
||||
})
|
||||
expect(tierExternalDeps(manifests, names).get('@botiverse/oar')).toBe(false)
|
||||
})
|
||||
|
||||
it('rejects an OAR embedding owner that omits its required dependency declaration', () => {
|
||||
const { manifests, names } = workspace({
|
||||
'packages/experimental/subagent-oar/package.json': {
|
||||
name: '@deepseek-ai/dsh-experimental-subagent-oar',
|
||||
devDependencies: { 'host-build-tool': '^1' },
|
||||
},
|
||||
})
|
||||
expect(() => tierExternalDeps(manifests, names))
|
||||
.toThrow('@deepseek-ai/dsh-experimental-subagent-oar embeds @botiverse/oar but does not declare it')
|
||||
})
|
||||
|
||||
it('limits the LibreOffice exception to its reviewed package identity and MPL terms', () => {
|
||||
for (const name of [
|
||||
'@deepseek-ai/libreoffice-kit', '@deepseek-ai/libreoffice-kit-wasm',
|
||||
|
||||
@@ -41,6 +41,12 @@ const DEV_ONLY_AREAS = [
|
||||
'native/',
|
||||
] as const
|
||||
|
||||
/** Third-party implementations embedded by named Host packages' shipping build configurations. */
|
||||
const HOST_BUNDLED_DEPENDENCIES: Readonly<Record<string, readonly string[]>> = {
|
||||
// subagent-oar/tsdown.config.ts embeds the patched adapter instead of installing a second copy.
|
||||
'@deepseek-ai/dsh-experimental-subagent-oar': ['@botiverse/oar'],
|
||||
}
|
||||
|
||||
/** First-party public native packages: reachable at runtime but not third-party. */
|
||||
const FIRST_PARTY = new Set([
|
||||
'@deepseek-ai/node-addon-system',
|
||||
@@ -134,7 +140,7 @@ interface ExternalDep {
|
||||
name: string
|
||||
license: string
|
||||
repo: string
|
||||
/** True when some shipped workspace consumer reaches it through runtime dependency edges. */
|
||||
/** True when a shipped workspace consumer installs it at runtime or embeds its implementation. */
|
||||
runtime: boolean
|
||||
}
|
||||
|
||||
@@ -388,6 +394,7 @@ function normalizeRepo(raw: string | undefined): string | undefined {
|
||||
let url = raw
|
||||
.replace(/^git\+ssh:\/\/git@/, 'https://')
|
||||
.replace(/^git\+/, '')
|
||||
.replace(/^git@([^:]+):/, 'https://$1/')
|
||||
.replace(/^git:\/\//, 'https://')
|
||||
.replace(/^github:/, 'https://github.com/')
|
||||
.replace(/\.git$/, '')
|
||||
@@ -397,7 +404,7 @@ function normalizeRepo(raw: string | undefined): string | undefined {
|
||||
|
||||
/**
|
||||
* Direct npm dependencies distributed through installed runtime libraries or
|
||||
* browser builds. Tooling declarations alone do not imply distribution.
|
||||
* embedded in Host and browser bundles. Tooling declarations alone do not imply distribution.
|
||||
*/
|
||||
function collectNpmDeps(manifests: Map<string, Manifest>, names: Set<string>, browser: ReadonlySet<string>): ExternalDep[] {
|
||||
return [...tierExternalDeps(manifests, names, browser)]
|
||||
@@ -407,7 +414,7 @@ function collectNpmDeps(manifests: Map<string, Manifest>, names: Set<string>, br
|
||||
}
|
||||
|
||||
/**
|
||||
* Tier every external dependency the workspace declares.
|
||||
* Tier every external dependency the workspace declares, including named Host embeddings.
|
||||
* @param manifests - workspace manifests keyed by repository-relative path.
|
||||
* @param names - every workspace package name, which never counts as external.
|
||||
* @param browser - Direct third-party packages resolved by the browser builds.
|
||||
@@ -421,10 +428,17 @@ export function tierExternalDeps(
|
||||
tiers.set('tsx', true)
|
||||
for (const [path, manifest] of manifests) {
|
||||
const devOnly = DEV_ONLY_AREAS.some(area => (area.endsWith('/') ? path.startsWith(area) : path === area))
|
||||
const hostBundled = manifest.name === undefined ? [] : HOST_BUNDLED_DEPENDENCIES[manifest.name] ?? []
|
||||
for (const dependency of hostBundled) {
|
||||
if (!ALL_KINDS.some(kind => Object.hasOwn(manifest[kind] ?? {}, dependency))) {
|
||||
throw new Error(`gen-third-party-notices: ${manifest.name} embeds ${dependency} but does not declare it`)
|
||||
}
|
||||
}
|
||||
for (const kind of ALL_KINDS) {
|
||||
for (const [dep, range] of Object.entries(manifest[kind] ?? {})) {
|
||||
if (names.has(dep) || range.startsWith('workspace:')) continue
|
||||
const runtime = browser.has(dep) || !devOnly && (RUNTIME_KINDS as readonly string[]).includes(kind)
|
||||
const runtime = browser.has(dep) || hostBundled.includes(dep)
|
||||
|| !devOnly && (RUNTIME_KINDS as readonly string[]).includes(kind)
|
||||
tiers.set(dep, (tiers.get(dep) ?? false) || runtime)
|
||||
}
|
||||
}
|
||||
@@ -789,7 +803,7 @@ ${vendored.map(row => `| \`${row.npmName}\` | \`${row.upstreamName}\` | [${row.s
|
||||
|
||||
## Runtime npm dependencies
|
||||
|
||||
External packages installed for runtime use or distributed inside the prebuilt browser artifacts. Browser inputs are resolved through the shipping tsdown and Vite configurations, independently of npm dependency sections. The tier covers every plugin a user can mount from \`cordis.yml\` — not only what the \`dsh\` CLI, Web UI, and Python SDK runtime load by default.
|
||||
External packages installed for runtime use or embedded in distributed Host or browser artifacts. Browser inputs are resolved through the shipping tsdown and Vite configurations, independently of npm dependency sections. Host embedding declarations identify the distributing package and its embedded dependencies. The tier covers every plugin a user can mount from \`cordis.yml\` — not only what the \`dsh\` CLI, Web UI, and Python SDK runtime load by default.
|
||||
|
||||
${renderNpmTable(runtimeDeps)}
|
||||
|
||||
@@ -812,7 +826,7 @@ The [kit repository](https://github.com/deepseek-ai/dsh-libreoffice-kit) supplie
|
||||
|
||||
## Development-only npm dependencies
|
||||
|
||||
External packages **directly declared** for development, tests, types, or tooling, without a runtime installation or browser-build relationship. A package here may still be pulled in transitively by a runtime dependency — \`pnpm-lock.yaml\` is the authority on that full closure.
|
||||
External packages **directly declared** for development, tests, types, or tooling, without a runtime installation or distribution inside a Host or browser bundle. A package here may still be pulled in transitively by a runtime dependency — \`pnpm-lock.yaml\` is the authority on that full closure.
|
||||
|
||||
${renderNpmTable(devDeps)}
|
||||
${renderNonPermissiveNote(nonPermissiveDev)}
|
||||
|
||||
@@ -38,7 +38,6 @@ import * as WebFetchLocal from '@deepseek-ai/dsh-web-fetch-http'
|
||||
import SubagentRuntime from '@deepseek-ai/dsh-subagent'
|
||||
import type { SubagentProvider } from '@deepseek-ai/dsh-subagent'
|
||||
import * as ToolSubagentControl from '@deepseek-ai/dsh-tool-subagent-control'
|
||||
import * as ToolSubagentListAgents from '@deepseek-ai/dsh-tool-subagent-control/list-agents'
|
||||
import SkillRegistry from '@deepseek-ai/dsh-skill'
|
||||
import * as SkillFileSystem from '@deepseek-ai/dsh-skill-filesystem'
|
||||
import LocalJobRegistry from '@deepseek-ai/dsh-jobs-local'
|
||||
@@ -75,7 +74,7 @@ import * as PluginMarketTools from '@deepseek-ai/dsh-plugin-market/tools'
|
||||
import SandboxPolicy from '@deepseek-ai/dsh-sandbox-policy'
|
||||
import McpResources from '@deepseek-ai/dsh-mcp-resources'
|
||||
import * as ToolSubagent from '@deepseek-ai/dsh-tool-subagent'
|
||||
import { registerListSubagentModels } from '../packages/subagent/tool-subagent/src/list-models.ts'
|
||||
import * as ToolSubagentOar from '@deepseek-ai/dsh-experimental-tool-subagent-oar'
|
||||
import * as ToolWeb from '@deepseek-ai/dsh-tool-web'
|
||||
import WorkflowEngine from '@deepseek-ai/dsh-workflow'
|
||||
import type { WorkflowRun, WorkflowStartRequest } from '@deepseek-ai/dsh-workflow'
|
||||
@@ -518,6 +517,20 @@ const TOOL_PACKAGES: ToolPackage[] = [
|
||||
note:
|
||||
'The five read-only tools hide provider cursors and authorize every result from the immutable calling agent session. The package is opt-in; compositions that need enforced deadlines or bounded inline output also mount the generic timeout or spill policies.',
|
||||
},
|
||||
{
|
||||
pkg: '@deepseek-ai/dsh-experimental-tool-subagent-oar',
|
||||
dir: 'tool-subagent-oar',
|
||||
source: 'packages/experimental/tool-subagent-oar/src/index.ts',
|
||||
requires: ['ctx.tools', 'ctx.subagents'],
|
||||
writes: ['tool/call', 'tool/result', 'parent subagent catalog and completion notices'],
|
||||
async mount(ctx) {
|
||||
await ctx.plugin(SubagentRuntime)
|
||||
await ctx.plugin(ToolSubagentOar, {
|
||||
providers: { codex: 'oar-codex', claude: 'oar-claude' },
|
||||
})
|
||||
},
|
||||
note: 'The subagent_oar tool selects among configured aliases for external providers. This catalog shows Codex and Claude Code aliases; each deployment chooses its providers. Native model and permission settings belong to the selected provider configuration.',
|
||||
},
|
||||
{
|
||||
pkg: '@deepseek-ai/dsh-tool-subagent',
|
||||
dir: 'tool-subagent',
|
||||
@@ -525,18 +538,17 @@ const TOOL_PACKAGES: ToolPackage[] = [
|
||||
list_subagent_models: 'packages/subagent/tool-subagent/src/list-models.ts',
|
||||
subagent: 'packages/subagent/tool-subagent/src/index.ts',
|
||||
},
|
||||
requires: ['ctx.tools', 'ctx.subagents', 'ctx.systemPrompt', 'ctx.llm for model discovery and selected-route validation'],
|
||||
requires: ['ctx.tools', 'ctx.subagents', 'ctx.systemPrompt', 'ctx.sessionProjections', 'ctx.llm for model discovery and selected-route validation'],
|
||||
writes: ['tool/call', 'tool/result', 'child session events through the chosen provider'],
|
||||
shippedNames: ['subagent', 'subagent_fork'],
|
||||
async mount(ctx) {
|
||||
await ctx.plugin(SubagentRuntime)
|
||||
await ctx.plugin(LlmRuntime)
|
||||
registerCatalogSubagentProvider(ctx, 'mock')
|
||||
await ctx.plugin(ToolSubagent, { provider: 'mock' })
|
||||
registerListSubagentModels(ctx, { routes: [{ provider: 'mock', model: 'mock' }] })
|
||||
await ctx.plugin(ToolSubagent, { provider: 'mock', modelDiscovery: true })
|
||||
},
|
||||
note:
|
||||
'The registered delegation name is the load-time `toolName` config (default `subagent`); the default schema above has model selection off, while the discovery schema is shown as the fixed companion available in an enabled Session. Web presets sample the Plugins preference for each new top-level Session and preserve that decision for its child Sessions; `subagent_fork` remains fixed-route. Each instance selects its backend through `provider` and reads model-selection settings through `modelSelectionSettings`. Every delegation returns a child id promptly; local children accept follow-ups, while external backends report their single execution automatically.',
|
||||
'The load-time `toolName` selects the delegation name (default `subagent`); `modelSelection` adds optional route fields. `modelDiscovery` defaults off and registers shared discovery on one instance per scope. Web and Desktop presets enable spawn discovery and route fields and leave `subagent_fork` route fields disabled. The Host settings service records authorization for each new top-level Session; child Sessions inherit it. Without a recorded policy, discovery and explicit selection permit only the current parent route. Every delegation returns a child id promptly; local children accept follow-ups, while external backends report their single execution automatically.',
|
||||
},
|
||||
{
|
||||
pkg: '@deepseek-ai/dsh-tool-subagent-control',
|
||||
@@ -546,7 +558,7 @@ const TOOL_PACKAGES: ToolPackage[] = [
|
||||
list_agents: 'packages/subagent/tool-subagent-control/src/list-agents.ts',
|
||||
send_message: 'packages/subagent/tool-subagent-control/src/index.ts',
|
||||
},
|
||||
requires: ['ctx.tools', 'ctx.subagents', 'ctx.agents and ctx.sessionProjections (list_agents only)'],
|
||||
requires: ['ctx.tools', 'ctx.subagents', 'ctx.agents'],
|
||||
writes: ['tool/call', 'tool/result', 'child session events through ctx.subagents'],
|
||||
async mount(ctx) {
|
||||
await ctx.plugin(SubagentRuntime)
|
||||
@@ -554,10 +566,9 @@ const TOOL_PACKAGES: ToolPackage[] = [
|
||||
await ctx.plugin(AgentRegistry)
|
||||
await ctx.plugin(SessionStore)
|
||||
await ctx.plugin(ToolSubagentControl)
|
||||
await ctx.plugin(ToolSubagentListAgents)
|
||||
},
|
||||
note:
|
||||
'The globally named discovery, interruption, and local-message tools over managed subagents: provider-bound `tool-subagent` instances register distinct delegation tools, while this package registers `send_message` and `interrupt_agent` once, plus `list_agents` from its separately loaded `/list-agents` plugin (whose catalog rows use the sessionProjections and live Agent registries).',
|
||||
'The globally named discovery, interruption, and local-message tools over managed subagents: provider-bound `tool-subagent` instances register distinct delegation tools, while one instance of this package registers `send_message`, `interrupt_agent`, and `list_agents`.',
|
||||
},
|
||||
{
|
||||
pkg: '@deepseek-ai/dsh-tool-jobs',
|
||||
|
||||
@@ -36,6 +36,15 @@ function captureConsole(): { log: () => string; error: () => string } {
|
||||
return { log: text(log), error: text(error) }
|
||||
}
|
||||
|
||||
function mapDependencyToSource(root: string): void {
|
||||
const basePath = join(root, 'tsconfig.base.json')
|
||||
const base = JSON.parse(readFileSync(basePath, 'utf8')) as { compilerOptions: Record<string, unknown> }
|
||||
writeFileSync(basePath, JSON.stringify({
|
||||
...base,
|
||||
compilerOptions: { ...base.compilerOptions, paths: { '@fixture/dep/types': ['./packages/fixture/dep/src/types.ts'] } },
|
||||
}))
|
||||
}
|
||||
|
||||
function typertOutputs(pkg: string): Record<string, string> {
|
||||
const output = join(pkg, 'lib')
|
||||
return Object.fromEntries(globSync('typert.*', { cwd: output }).sort()
|
||||
@@ -110,12 +119,7 @@ describe('bundle-free Typert pass', { timeout: 60_000 }, () => {
|
||||
])
|
||||
expect(existsSync(join(pkg, 'lib'))).toBe(false)
|
||||
|
||||
const basePath = join(root, 'tsconfig.base.json')
|
||||
const base = JSON.parse(readFileSync(basePath, 'utf8')) as { compilerOptions: Record<string, unknown> }
|
||||
writeFileSync(basePath, JSON.stringify({
|
||||
...base,
|
||||
compilerOptions: { ...base.compilerOptions, paths: { '@fixture/dep/types': ['./packages/fixture/dep/src/types.ts'] } },
|
||||
}))
|
||||
mapDependencyToSource(root)
|
||||
expect(main([], root)).toBe(0)
|
||||
expect(Object.keys(typertOutputs(pkg))).toEqual(['typert.host.d.ts', 'typert.host.js'])
|
||||
})
|
||||
@@ -136,6 +140,25 @@ describe('bundle-free Typert pass', { timeout: 60_000 }, () => {
|
||||
expect(existsSync(join(pkg, 'lib'))).toBe(false)
|
||||
})
|
||||
|
||||
it.each([false, true])('rejects a producer that reaches its own generated metadata through a source dependency (existing output: %s)', (compiled) => {
|
||||
const { root, pkg } = workspace(DEPENDENT_TYPERT_SOURCE)
|
||||
const dependency = writeCompiledDependency(root, false)
|
||||
writeFileSync(join(dependency, 'src/types.ts'), "export type Shape = import('@fixture/probe/typert').Payload\n")
|
||||
symlinkSync(pkg, join(root, 'node_modules/@fixture/probe'), 'junction')
|
||||
mapDependencyToSource(root)
|
||||
if (compiled) {
|
||||
mkdirSync(join(pkg, 'lib'))
|
||||
writeFileSync(join(pkg, 'lib/typert.host.d.ts'), 'export interface Payload { value: string }\n')
|
||||
}
|
||||
const output = captureConsole()
|
||||
|
||||
expect(main([], root)).toBe(1)
|
||||
|
||||
expect(output.error()).toContain(compiled ? 'loads workspace build outputs instead of source' : 'cannot resolve workspace imports')
|
||||
expect(output.error()).toContain('@fixture/probe/typert')
|
||||
expect(existsSync(join(pkg, 'lib/typert.host.js'))).toBe(false)
|
||||
})
|
||||
|
||||
it('reports a failed write as a possibly mixed generation', () => {
|
||||
const { root, pkg } = workspace()
|
||||
writeFileSync(join(pkg, 'lib'), 'not a directory\n')
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
/**
|
||||
* Generate the repository's Typert artifacts without bundling.
|
||||
*
|
||||
* The pass writes the same files, through the same generator calls, as the workspace-mode Typert
|
||||
* plugin in the Host tsdown pass (`tsdown.config.ts`): every explicit contributor's
|
||||
* `lib/typert.host.*` and `lib/typert.remote-client.*`. Gates that read only generated
|
||||
* declarations run it instead of bundling. It reads workspace packages only from source and fails
|
||||
* when the Host program would load a package's `lib/` output, so it can run beside Host package
|
||||
* compilation. Like the plugin it skips TypeScript diagnostics, which that compilation owns;
|
||||
* Typert's own checks still fail the pass.
|
||||
* Writes every explicit contributor's `lib/typert.host.*` and `lib/typert.remote-client.*`
|
||||
* with the same generator and writer as the workspace-mode Typert bundler plugin. It reads
|
||||
* workspace packages only from source and rejects imports requiring compiled output, so metadata
|
||||
* generation precedes package compilation. The compiler owns TypeScript diagnostics;
|
||||
* Typert analysis and emission failures still fail this pass.
|
||||
*
|
||||
* Usage: `tsx scripts/generate-typert.ts`, from the repository root or any directory below it.
|
||||
* Exit status 0 means every artifact was written, 1 means generation failed, and 2 means the
|
||||
@@ -55,7 +53,7 @@ const STAGE_ACTIONS: Readonly<Record<TypertGenerationStage, string>> = {
|
||||
}
|
||||
|
||||
// Host package compilation owns TypeScript diagnostics, as it does for the
|
||||
// tsdown plugin; rejecting build outputs lets this pass run beside it.
|
||||
// tsdown plugin; rejecting build outputs lets this pass run before package compilation.
|
||||
const GENERATION_OPTIONS = { checkDiagnostics: false, rejectBuildOutputs: true } as const
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
/** Execute both shipped SEA providers against compressed empty-file assets. */
|
||||
|
||||
import { createRequire } from 'node:module'
|
||||
import { readFileSync } from 'node:fs'
|
||||
import { dirname, join } from 'node:path'
|
||||
import { runInNewContext } from 'node:vm'
|
||||
import { brotliCompressSync } from 'node:zlib'
|
||||
import ts from 'typescript'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
|
||||
const require = createRequire(import.meta.url)
|
||||
const pkgRoot = dirname(require.resolve('@yao-pkg/pkg/package.json'))
|
||||
const bundle = readFileSync(join(pkgRoot, 'prelude/sea-bootstrap.bundle.js'), 'utf8')
|
||||
|
||||
function initializer(source: string, name: string): string {
|
||||
const parsed = ts.createSourceFile('prelude.js', source, ts.ScriptTarget.Latest, true, ts.ScriptKind.JS)
|
||||
let expression: string | undefined
|
||||
const visit = (node: ts.Node): void => {
|
||||
if (ts.isVariableDeclaration(node) && ts.isIdentifier(node.name) && node.name.text === name) {
|
||||
expression = node.initializer?.getText(parsed)
|
||||
}
|
||||
ts.forEachChild(node, visit)
|
||||
}
|
||||
visit(parsed)
|
||||
if (expression === undefined) throw new Error(`pkg prelude is missing ${name}`)
|
||||
return expression
|
||||
}
|
||||
|
||||
function commonJs(callbacks: Record<string, (exports: object, module: { exports: unknown }) => void>) {
|
||||
return () => {
|
||||
const exports = {}
|
||||
const module: { exports: unknown } = { exports }
|
||||
Object.values(callbacks)[0]!(exports, module)
|
||||
return module.exports
|
||||
}
|
||||
}
|
||||
|
||||
const workerSource: unknown = runInNewContext(`(${initializer(bundle, 'require_worker_bootstrap_string')})()`, { __commonJS: commonJs })
|
||||
if (typeof workerSource !== 'string') throw new Error('pkg worker bootstrap must be JavaScript text')
|
||||
|
||||
interface Provider {
|
||||
readFileSync(path: string): Buffer
|
||||
}
|
||||
|
||||
function provider(source: string, contents: Buffer, declaredSize = contents.length): Provider {
|
||||
const archive = brotliCompressSync(contents)
|
||||
const manifest = {
|
||||
compression: 2,
|
||||
entrypoint: '/fixture', directories: {}, symlinks: {},
|
||||
offsets: { '/fixture': [0, archive.length] },
|
||||
stats: { '/fixture': { size: declaredSize, isFile: true, isDirectory: false } },
|
||||
}
|
||||
class MemoryProvider {
|
||||
mkdirSync(): void {}
|
||||
}
|
||||
class VirtualFileSystem {
|
||||
mount(): void {}
|
||||
}
|
||||
const loaded = runInNewContext(`(${initializer(source, 'require_sea_vfs_setup')})()`, {
|
||||
__commonJS: commonJs,
|
||||
require_bootstrap_shared: (): unknown => require(join(pkgRoot, 'prelude/bootstrap-shared.js')),
|
||||
require: (name: string): object => {
|
||||
if (name === 'node:sea') return {
|
||||
getAsset: () => JSON.stringify(manifest),
|
||||
getRawAsset: () => Uint8Array.from(archive).buffer,
|
||||
}
|
||||
if (name === 'node:vfs') return { MemoryProvider, VirtualFileSystem }
|
||||
throw new Error(`unexpected pkg fixture dependency: ${name}`)
|
||||
},
|
||||
Buffer,
|
||||
process: { env: {}, platform: 'linux' },
|
||||
}) as { provider: Provider }
|
||||
return loaded.provider
|
||||
}
|
||||
|
||||
describe.each([['main', bundle], ['worker', workerSource]] as const)('pkg compressed assets in %s', (_name, source) => {
|
||||
it('reads and caches an empty file', () => {
|
||||
const subject = provider(source, Buffer.alloc(0))
|
||||
expect(subject.readFileSync('/fixture')).toEqual(Buffer.alloc(0))
|
||||
expect(subject.readFileSync('/fixture')).toEqual(Buffer.alloc(0))
|
||||
})
|
||||
|
||||
it('preserves nonempty bytes and isolates cached data from callers', () => {
|
||||
const subject = provider(source, Buffer.from('content'))
|
||||
const first = subject.readFileSync('/fixture')
|
||||
first.fill(0)
|
||||
expect(subject.readFileSync('/fixture')).toEqual(Buffer.from('content'))
|
||||
})
|
||||
|
||||
it('rejects nonempty output declared as an empty file', () => {
|
||||
expect(() => provider(source, Buffer.from('x'), 0).readFileSync('/fixture'))
|
||||
.toThrow('decompressed size does not match stats.size')
|
||||
})
|
||||
})
|
||||
@@ -37,7 +37,7 @@ function fixture(options: {
|
||||
version: '0.0.1',
|
||||
type: 'module',
|
||||
license: 'MIT',
|
||||
engines: { node: '>=22.19' },
|
||||
engines: { node: '>=24.9.0' },
|
||||
sideEffects: false,
|
||||
files: ['lib'],
|
||||
exports: { '.': { default: options.exportPath ?? './lib/index.js' } },
|
||||
|
||||
@@ -85,10 +85,12 @@ describe('release families', () => {
|
||||
'@deepseek-ai/dsh-skill-badge',
|
||||
'@deepseek-ai/dsh-experimental-speech-to-text-sensevoice',
|
||||
'@deepseek-ai/dsh-experimental-speech-to-text',
|
||||
'@deepseek-ai/dsh-experimental-subagent-oar',
|
||||
'@deepseek-ai/dsh-experimental-terminal-bundle',
|
||||
'@deepseek-ai/dsh-experimental-tool-agent-team',
|
||||
'@deepseek-ai/dsh-tool-ralph',
|
||||
'@deepseek-ai/dsh-tool-session-query',
|
||||
'@deepseek-ai/dsh-experimental-tool-subagent-oar',
|
||||
'@deepseek-ai/dsh-tool-terminal',
|
||||
'@deepseek-ai/dsh-experimental-tool-worktree',
|
||||
'@deepseek-ai/dsh-experimental-translator',
|
||||
|
||||
+29
-14
@@ -1,9 +1,9 @@
|
||||
/**
|
||||
* Pack one release family's whole publish set into a single directory and
|
||||
* record its publish order for the publish step. Default serial packs execute
|
||||
* Pack one family's public packages into a staging directory; the release command
|
||||
* also records their publish order. Default serial packs execute
|
||||
* in that order; explicitly parallel packs use pnpm's bounded scheduler.
|
||||
*
|
||||
* The pack step is the release boundary: it runs without credentials, produces
|
||||
* The release command is the release boundary: it runs without credentials, produces
|
||||
* every tarball from one commit, and hands the publish step exactly those bytes
|
||||
* ([rationale](../../.agents/notes/implemented/process/2026-08-10-npm-release-sequences.md)).
|
||||
*/
|
||||
@@ -68,10 +68,12 @@ async function packMembers(
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns The validated `--concurrency` value; 1 (the default) packs the
|
||||
* members one at a time, exactly as the credentialed publish workflows run it.
|
||||
* Resolve the maximum number of concurrent package packs.
|
||||
* @param raw - Optional decimal worker count from the packing command line.
|
||||
* @returns A positive integer, defaulting to one for serial packing.
|
||||
* @throws If the argument is not a positive safe integer in decimal form.
|
||||
*/
|
||||
function parseConcurrency(raw: string | undefined): number {
|
||||
export function parsePackConcurrency(raw: string | undefined): number {
|
||||
if (raw === undefined) return 1
|
||||
const parsed = Number.parseInt(raw, 10)
|
||||
if (!Number.isSafeInteger(parsed) || parsed < 1 || String(parsed) !== raw) {
|
||||
@@ -80,6 +82,25 @@ function parseConcurrency(raw: string | undefined): number {
|
||||
return parsed
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace a staging directory with validated family tarballs without a publication record.
|
||||
* The caller must verify any client build profile and artifact hashes its packaging mode requires.
|
||||
* @param root - Repository containing the family members.
|
||||
* @param family - Package selection, version, and payload policy.
|
||||
* @param destination - Absolute staging directory owned by this packing invocation.
|
||||
* @param concurrency - Validated maximum number of concurrent package packs.
|
||||
* @returns Tarball filenames in publish order, after every package passes validation.
|
||||
*/
|
||||
export async function packFamilyMembers(
|
||||
root: string, family: ReleaseFamily, destination: string, concurrency: number,
|
||||
): Promise<string[]> {
|
||||
const members = family.publishOrder(family.members(root)).order
|
||||
family.verifyVersions(members)
|
||||
rmSync(destination, { recursive: true, force: true })
|
||||
mkdirSync(destination, { recursive: true })
|
||||
return packMembers(family, members, destination, concurrency)
|
||||
}
|
||||
|
||||
/** Pack the family named by `--family` into `--out`. */
|
||||
async function main(): Promise<void> {
|
||||
const { values } = parseArgs({
|
||||
@@ -87,19 +108,13 @@ async function main(): Promise<void> {
|
||||
allowPositionals: false,
|
||||
})
|
||||
if (values.family === undefined) throw new Error('usage: pack.ts --family <dsh|vendor> [--out dist/npm] [--concurrency 1]')
|
||||
const concurrency = parseConcurrency(values.concurrency)
|
||||
const concurrency = parsePackConcurrency(values.concurrency)
|
||||
|
||||
const family = releaseFamily(values.family)
|
||||
const root = process.cwd()
|
||||
const destination = resolve(root, values.out ?? DEFAULT_OUTPUT)
|
||||
const members = family.publishOrder(family.members(root)).order
|
||||
family.verifyBuildArtifacts(root)
|
||||
family.verifyVersions(members)
|
||||
|
||||
rmSync(destination, { recursive: true, force: true })
|
||||
mkdirSync(destination, { recursive: true })
|
||||
|
||||
const order = await packMembers(family, members, destination, concurrency)
|
||||
const order = await packFamilyMembers(root, family, destination, concurrency)
|
||||
writeFileSync(join(destination, PUBLISH_ORDER_FILE), `${order.join('\n')}\n`)
|
||||
|
||||
console.log(`release pack: family ${family.id}, ${String(order.length)} tarball(s) in ${values.out ?? DEFAULT_OUTPUT}`)
|
||||
|
||||
@@ -846,7 +846,7 @@ describe('Typert contract preparation', () => {
|
||||
})
|
||||
|
||||
describe('Node compatibility graph', () => {
|
||||
it.each(['22.19.0', '24.9.0', '26.0.0'])('runs all source compatibility smokes serially on Node %s', (version) => {
|
||||
it.each(['24.9.0', '24.19.0', '26.0.0'])('runs all source compatibility smokes serially on Node %s', (version) => {
|
||||
const subject = withNodeVersion(version, () =>
|
||||
withPnpmEntrypoint(() => gatesForMode('node-compat')))
|
||||
|
||||
@@ -861,6 +861,7 @@ describe('Node compatibility graph', () => {
|
||||
'packages/session/session-persistence-jsonl/tests/zstd.compat.spec.ts',
|
||||
'apps/cli/tests/source-launch.compat.spec.ts',
|
||||
'scripts/vitest-environment.compat.spec.ts',
|
||||
'scripts/command-entrypoints.compat.spec.ts',
|
||||
'packages/boot/app-boot/tests/profile-resolution.spec.ts',
|
||||
'packages/boot/app-boot/tests/profile-resolution-service.spec.ts',
|
||||
'packages/boot/app-boot/tests/profile-resolution-worker-bootstrap.spec.ts',
|
||||
@@ -878,8 +879,16 @@ describe('Node compatibility graph', () => {
|
||||
expect(subject.find(item => item.id === 'source-compat-smokes')?.env).toEqual({ VITEST_MAX_WORKERS: '1' })
|
||||
})
|
||||
|
||||
it.each([undefined, '1'])('builds the complete Node 22 artifacts once with skip-typecheck=%s', (skipTypecheck) => {
|
||||
const subject = withNodeVersion('22.19.0', () =>
|
||||
it.each(['24.19.0', '26.0.0'])('keeps Node %s compatibility source-only', (version) => {
|
||||
const subject = withNodeVersion(version, () =>
|
||||
withPnpmEntrypoint(() => gatesForMode('node-compat')))
|
||||
|
||||
expect(subject.map(item => item.id)).not.toContain('build')
|
||||
expect(subject.map(item => item.id)).not.toContain('cli-lazy-search-startup-smoke')
|
||||
})
|
||||
|
||||
it.each([undefined, '1'])('builds the complete Node 24.9 artifacts once with skip-typecheck=%s', (skipTypecheck) => {
|
||||
const subject = withNodeVersion('24.9.0', () =>
|
||||
withEnv('DSH_NODE_COMPAT_SKIP_TYPECHECK', skipTypecheck, () =>
|
||||
withPnpmEntrypoint(() => gatesForMode('node-compat'))))
|
||||
|
||||
@@ -894,8 +903,8 @@ describe('Node compatibility graph', () => {
|
||||
})
|
||||
})
|
||||
|
||||
it.each(['passed', 'failed'] as const)('runs the Node 22 lazy-search smoke only after a passed build (%s)', async (buildStatus) => {
|
||||
const subject = withNodeVersion('22.19.0', () =>
|
||||
it.each(['passed', 'failed'] as const)('runs the Node 24.9 lazy-search smoke only after a passed build (%s)', async (buildStatus) => {
|
||||
const subject = withNodeVersion('24.9.0', () =>
|
||||
withEnv('DSH_NODE_COMPAT_SKIP_TYPECHECK', '1', () =>
|
||||
withPnpmEntrypoint(() => gatesForMode('node-compat'))))
|
||||
let buildCompleted = false
|
||||
|
||||
+5
-10
@@ -95,6 +95,9 @@ type ResultObserver = (result: GateResult) => void
|
||||
/** Worker cap of the documentation and hygiene aggregates, locally and in CI, whose leaves each build a full ts.Program. */
|
||||
const PROGRAM_MODE_CAP = 8
|
||||
|
||||
/** CI pins this minor in .github/workflows/ci.yml; its compatibility leg owns the built CLI smoke. */
|
||||
export const BUILD_BACKED_NODE_COMPAT_VERSION = '24.9'
|
||||
|
||||
const root = resolve(import.meta.dirname, '..')
|
||||
if (import.meta.main) {
|
||||
process.exitCode = await main(process.argv.slice(2))
|
||||
@@ -429,7 +432,7 @@ function nodeCompatGates(): Gate[] {
|
||||
const typecheck = flagEnabled('DSH_NODE_COMPAT_SKIP_TYPECHECK')
|
||||
? []
|
||||
: [pnpmScript('typecheck', 'typecheck')]
|
||||
if (runningNodeMajor() !== 22) {
|
||||
if (!process.versions.node.startsWith(`${BUILD_BACKED_NODE_COMPAT_VERSION}.`)) {
|
||||
return [...typecheck, ...nodeCompatSmokeGates()]
|
||||
}
|
||||
return [
|
||||
@@ -452,6 +455,7 @@ function nodeCompatSmokeGates(options: { cliSmoke?: boolean } = {}): Gate[] {
|
||||
'packages/session/session-persistence-jsonl/tests/zstd.compat.spec.ts',
|
||||
'apps/cli/tests/source-launch.compat.spec.ts',
|
||||
'scripts/vitest-environment.compat.spec.ts',
|
||||
'scripts/command-entrypoints.compat.spec.ts',
|
||||
'packages/boot/app-boot/tests/profile-resolution.spec.ts',
|
||||
'packages/boot/app-boot/tests/profile-resolution-service.spec.ts',
|
||||
'packages/boot/app-boot/tests/profile-resolution-worker-bootstrap.spec.ts',
|
||||
@@ -475,15 +479,6 @@ function nodeCompatSmokeGates(options: { cliSmoke?: boolean } = {}): Gate[] {
|
||||
return gates
|
||||
}
|
||||
|
||||
/** Active Node major used to select version-specific compatibility checks. */
|
||||
function runningNodeMajor(): number {
|
||||
const major = Number.parseInt(process.versions.node.split('.')[0] ?? '', 10)
|
||||
if (!Number.isSafeInteger(major)) {
|
||||
throw new Error(`run-gates: cannot parse Node version ${JSON.stringify(process.versions.node)}.`)
|
||||
}
|
||||
return major
|
||||
}
|
||||
|
||||
function ciStaticGates(options: { ownsBuild: boolean }): Gate[] {
|
||||
return [
|
||||
...ciSharedStaticGates(),
|
||||
|
||||
@@ -89,7 +89,6 @@ LEGACY_CUSTOM_DISABLED_ROWS = (
|
||||
"tool-skill",
|
||||
"tool-str-replace-editor",
|
||||
"tool-subagent-control",
|
||||
"tool-subagent-list-agents",
|
||||
"tool-subagent-fork",
|
||||
"tool-todo",
|
||||
"tool-web",
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
/**
|
||||
* Program faces of the repository's Typert pass. The Host face alone emits
|
||||
* Host reflection and the Host-for-Client Remote projection; no package
|
||||
* publishes Client reflection. The Host tsdown plugin (`tsdown.config.ts`)
|
||||
* and the bundle-free pass (`generate-typert.ts`) both generate exactly these
|
||||
* faces. Node loads this module through type stripping from
|
||||
* `tsdown.config.ts`, so it uses only erasable TypeScript syntax.
|
||||
* Program faces of source-only Typert generation. The Host face emits Host reflection
|
||||
* and the Host-for-Client Remote projection; no package publishes Client reflection.
|
||||
*/
|
||||
export const WORKSPACE_TYPERT_FACES = ['host'] as const
|
||||
@@ -243,10 +243,11 @@ grep -q '^smoke: win32 x64' "$scratch/logs/smoke.log" || { echo 'wine-windows-ga
|
||||
|
||||
# ---- the two blocking surfaces, concurrently ------------------------------
|
||||
# The build mirrors the root build:lib:host and build:lib:client scripts:
|
||||
# compile and bundle the Host face, bundle apps/desktop from the Host lib/
|
||||
# outputs, then compile and bundle the Client face.
|
||||
# generate metadata, compile and bundle the Host face, bundle apps/desktop from
|
||||
# the Host lib/ outputs, then compile and bundle the Client face.
|
||||
# Both statuses are captured so one failure cannot hide the other's result.
|
||||
build_gate() {
|
||||
wine_node "$scratch/logs/host-typert.log" --import tsx/esm scripts/generate-typert.ts || return $?
|
||||
wine_node "$scratch/logs/host-tsc.log" --max-old-space-size=4096 "$tsc_js" -b tsconfig.host.json --pretty false || return $?
|
||||
wine_node "$scratch/logs/host-tsdown.log" "$tsdown_js" --env.DSH_BUILD_FACE host || return $?
|
||||
(cd apps/desktop && wine_node "$scratch/logs/desktop-tsdown.log" "../../$tsdown_js") || return $?
|
||||
@@ -277,7 +278,8 @@ report() {
|
||||
for log in "$@"; do tail -n 200 "$log" >&2 || true; done
|
||||
fi
|
||||
}
|
||||
report 'build (Host tsc/tsdown, desktop tsdown, Client tsc/tsdown)' "$build_status" \
|
||||
report 'build (Typert, Host tsc/tsdown, desktop tsdown, Client tsc/tsdown)' "$build_status" \
|
||||
"$scratch/logs/host-typert.log" \
|
||||
"$scratch/logs/host-tsc.log" \
|
||||
"$scratch/logs/host-tsdown.log" \
|
||||
"$scratch/logs/desktop-tsdown.log" \
|
||||
|
||||
Reference in new issue
Block a user