Resolve packaged profile proxies with Node ESM import conditions from each package installation, and fail loud when an explicit runtime export or legacy main entry is missing. Serialize the shared profile fallback under the existing cross-process writer lock so concurrent dsh processes cannot observe partial proxies; either carrier now replaces the other carrier’s managed entry without manual cleanup. Give Python initialize its own 10-second default bound and name the selected profile in timeout diagnostics, while leaving ordinary agent turns unbounded by default. Package the dynamically resolved web frontend and skill-badge assets so the runtime wheel’s normal dsh profiles do not depend on pkg static-discovery accidents. Rewrite the root launch rule and every active stale SDK-runtime note to the shipped dsh profile architecture in both languages. Focused tests prove import-only and transitive package exports, lock contention, cross-carrier transitions, missing-entry failures, asset inventory, and bounded initialization.
54 lines
2.1 KiB
TypeScript
54 lines
2.1 KiB
TypeScript
/**
|
|
* Config-dump entry for `dsh --profile <name> --dump-config`: compose the
|
|
* profile's patch layers through the include plugin's patch algorithm without
|
|
* booting or evaluating `!!js`, with one source layer per bundle, the
|
|
* profile's own patch file, and each `--patch` overlay.
|
|
* @module @deepseek-ai/dsh/dump-config
|
|
*/
|
|
|
|
import { existsSync } from 'node:fs'
|
|
import { join, resolve } from 'node:path'
|
|
import {
|
|
loadOptionalPatches,
|
|
loadOverlayPatches,
|
|
renderConfigDump,
|
|
type ConfigDumpLayer,
|
|
} from '@deepseek-ai/dsh-app-boot'
|
|
import { homePatchPath, prepareProfile, PROFILE_ROOT_FILENAME } from './profile-boot.ts'
|
|
|
|
const NAME = 'dsh'
|
|
|
|
/* v8 ignore start -- built-bin acceptance drives this boot-free dispatch */
|
|
/**
|
|
* Print a profile composition with comments naming each source file and patch layer.
|
|
* @param profile - the profile name.
|
|
* @param defaultOnly - omit the profile's user layer and `--patch` overlays
|
|
* (the recovery diagnostic for a broken `cordis.patch.yml`, which is then
|
|
* never parsed).
|
|
* @param patches - `--patch` overlay paths, in argv order.
|
|
* @returns settlement after the profile is healed and the dump is written.
|
|
*/
|
|
export async function runDumpConfig(profile: string, defaultOnly: boolean, patches: readonly string[]): Promise<void> {
|
|
const loaded = await prepareProfile(profile, !defaultOnly)
|
|
const layers: ConfigDumpLayer[] = loaded.layers.map(layer => ({
|
|
label: layer.packageName,
|
|
patches: layer.patches,
|
|
}))
|
|
if (!defaultOnly) {
|
|
if (existsSync(loaded.patchPath)) {
|
|
layers.push({ label: loaded.patchPath, patches: loaded.patches })
|
|
}
|
|
const homePatchFile = homePatchPath()
|
|
const homePatches = loadOptionalPatches(NAME, homePatchFile)
|
|
if (homePatches !== undefined) {
|
|
layers.push({ label: homePatchFile, patches: homePatches })
|
|
}
|
|
for (const file of patches) {
|
|
const absolute = resolve(file)
|
|
layers.push({ label: absolute, patches: loadOverlayPatches(NAME, absolute) })
|
|
}
|
|
}
|
|
// The dump anchors on the same empty root file the boot includes.
|
|
process.stdout.write(renderConfigDump(NAME, join(loaded.dir, PROFILE_ROOT_FILENAME), layers))
|
|
}
|
|
/* v8 ignore stop */
|