From afa57ae09373d41f65d11dcd155290dcc310f191 Mon Sep 17 00:00:00 2001 From: Yichen Jiang Date: Tue, 8 Sep 2026 16:37:16 +0800 Subject: [PATCH] refactor(boot): keep containment and composition internals off the package root The root entry now exports only what the CLI, the plugin inventory, the plugin manager, and tool-cordis use, plus the parameter and result types of those operations. The contained group and its registry, the external-layer composition, the row-ownership helpers, the probe format number, and the runtime option type stay module exports the package's own tests import. --- packages/boot/app-boot/src/index.ts | 14 ++++---------- packages/boot/app-boot/tests/compose-stack.spec.ts | 3 ++- .../boot/app-boot/tests/contained-group.spec.ts | 6 ++---- .../boot/app-boot/tests/external-bundles.spec.ts | 6 ++---- packages/boot/app-boot/tests/probe.spec.ts | 3 ++- 5 files changed, 12 insertions(+), 20 deletions(-) diff --git a/packages/boot/app-boot/src/index.ts b/packages/boot/app-boot/src/index.ts index 0e824e1473..015cec0c8c 100644 --- a/packages/boot/app-boot/src/index.ts +++ b/packages/boot/app-boot/src/index.ts @@ -50,24 +50,18 @@ export { type ProfileModuleFallbackOptions, type ProfileTemplate, } from './profile.ts' +export { ensurePluginFailures } from './contained-group.ts' export { - ContainedFailureRegistry, ContainedGroup, containingGroup, ensurePluginFailures, isContainedEntry, - type ContainedFailure, type ContainedFailureStage, -} from './contained-group.ts' -export { - BUNDLE_GROUP_PREFIX, bundleGroupId, composeExternalLayer, CONTAINED_GROUP_MODULE, disableBundle, - enableBundle, exportsBundlePatch, isContainedLayer, reconcileInstalledBundles, + bundleGroupId, disableBundle, enableBundle, reconcileInstalledBundles, type BundleReconciliation, type ComposedExternalLayer, type DuplicateRow, } from './external-bundles.ts' export { claimLayerIds, composeProfileStack, formatRowConflict, type ComposedStack, type LayerOwnership, type RowConflict, type StackUserLayer, } from './compose-stack.ts' +export { ProfileRuntime, type RowOrigin } from './profile-runtime.ts' export { - ProfileRuntime, type ProfileRuntimeOptions, type RowOrigin, -} from './profile-runtime.ts' -export { - PLUGIN_PROBE_DIR, PLUGIN_PROBE_FORMAT, probePackage, readProbeCache, writeProbeCache, + PLUGIN_PROBE_DIR, probePackage, readProbeCache, writeProbeCache, type PluginProbe, type PluginProbeRow, type ProbeOptions, } from './probe.ts' diff --git a/packages/boot/app-boot/tests/compose-stack.spec.ts b/packages/boot/app-boot/tests/compose-stack.spec.ts index fd8edcbe1e..c70d0b323d 100644 --- a/packages/boot/app-boot/tests/compose-stack.spec.ts +++ b/packages/boot/app-boot/tests/compose-stack.spec.ts @@ -9,7 +9,8 @@ import { describe, expect, it } from 'vitest' import type { EntryOptions } from '@deepseek-ai/cordis-plugin-loader' import type { PatchOptions } from '@deepseek-ai/cordis-plugin-include' -import { claimLayerIds, composeProfileStack, CONTAINED_GROUP_MODULE, formatRowConflict, type ProfileLayer } from '../src/index.ts' +import { claimLayerIds, composeProfileStack, formatRowConflict, type ProfileLayer } from '../src/index.ts' +import { CONTAINED_GROUP_MODULE } from '../src/external-bundles.ts' const NAME = 'dsh-test-bin' diff --git a/packages/boot/app-boot/tests/contained-group.spec.ts b/packages/boot/app-boot/tests/contained-group.spec.ts index 10abf3dc11..d9d2b42c0b 100644 --- a/packages/boot/app-boot/tests/contained-group.spec.ts +++ b/packages/boot/app-boot/tests/contained-group.spec.ts @@ -12,10 +12,8 @@ import { join } from 'node:path' import { afterEach, describe, expect, it } from 'vitest' import { Context, type Plugin } from '@deepseek-ai/cordis' import Loader, { type EntryOptions } from '@deepseek-ai/cordis-plugin-loader' -import { - assertEntriesActivated, boot, ContainedFailureRegistry, ContainedGroup, ensurePluginFailures, installRuntimeGuards, - isContainedEntry, rootIncludeEntry, warnNestedFiberFailures, type RuntimeGuardProcess, -} from '../src/index.ts' +import { assertEntriesActivated, boot, ensurePluginFailures, installRuntimeGuards, rootIncludeEntry, warnNestedFiberFailures, type RuntimeGuardProcess } from '../src/index.ts' +import { ContainedFailureRegistry, ContainedGroup, isContainedEntry } from '../src/contained-group.ts' const NAME = 'dsh-test-bin' diff --git a/packages/boot/app-boot/tests/external-bundles.spec.ts b/packages/boot/app-boot/tests/external-bundles.spec.ts index 43b39f5fa3..553b094514 100644 --- a/packages/boot/app-boot/tests/external-bundles.spec.ts +++ b/packages/boot/app-boot/tests/external-bundles.spec.ts @@ -10,10 +10,8 @@ import { join } from 'node:path' import { describe, expect, it } from 'vitest' import type { EntryOptions } from '@deepseek-ai/cordis-plugin-loader' import { applyEntryPatches, type PatchOptions } from '@deepseek-ai/cordis-plugin-include' -import { - bundleGroupId, composeExternalLayer, CONTAINED_GROUP_MODULE, disableBundle, enableBundle, - exportsBundlePatch, isContainedLayer, reconcileInstalledBundles, readProfileManifest, type ProfileLayer, -} from '../src/index.ts' +import { bundleGroupId, disableBundle, enableBundle, reconcileInstalledBundles, readProfileManifest, type ProfileLayer } from '../src/index.ts' +import { composeExternalLayer, CONTAINED_GROUP_MODULE, exportsBundlePatch, isContainedLayer } from '../src/external-bundles.ts' const NAME = 'dsh-test-bin' diff --git a/packages/boot/app-boot/tests/probe.spec.ts b/packages/boot/app-boot/tests/probe.spec.ts index 5745d44dd9..d73b874b4a 100644 --- a/packages/boot/app-boot/tests/probe.spec.ts +++ b/packages/boot/app-boot/tests/probe.spec.ts @@ -7,7 +7,8 @@ import { mkdirSync, mkdtempSync, symlinkSync, writeFileSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' import { describe, expect, it } from 'vitest' -import { PLUGIN_PROBE_DIR, PLUGIN_PROBE_FORMAT, probePackage, readProbeCache, writeProbeCache, type PluginProbe } from '../src/index.ts' +import { PLUGIN_PROBE_DIR, probePackage, readProbeCache, writeProbeCache, type PluginProbe } from '../src/index.ts' +import { PLUGIN_PROBE_FORMAT } from '../src/probe.ts' import { cordisPackageDir, parseProbeRecord } from '../src/probe.ts' import { parseChildReport, type ChildReport } from '../src/probe-report.ts'