Pārlūkot izejas kodu

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.
Yichen Jiang 1 mēnesi atpakaļ
vecāks
revīzija
afa57ae093

+ 4 - 10
packages/boot/app-boot/src/index.ts

@@ -50,24 +50,18 @@ export {
   type ProfileModuleFallbackOptions,
   type ProfileModuleFallbackOptions,
   type ProfileTemplate,
   type ProfileTemplate,
 } from './profile.ts'
 } from './profile.ts'
+export { ensurePluginFailures } from './contained-group.ts'
 export {
 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,
   type BundleReconciliation, type ComposedExternalLayer, type DuplicateRow,
 } from './external-bundles.ts'
 } from './external-bundles.ts'
 export {
 export {
   claimLayerIds, composeProfileStack, formatRowConflict,
   claimLayerIds, composeProfileStack, formatRowConflict,
   type ComposedStack, type LayerOwnership, type RowConflict, type StackUserLayer,
   type ComposedStack, type LayerOwnership, type RowConflict, type StackUserLayer,
 } from './compose-stack.ts'
 } from './compose-stack.ts'
+export { ProfileRuntime, type RowOrigin } from './profile-runtime.ts'
 export {
 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,
   type PluginProbe, type PluginProbeRow, type ProbeOptions,
 } from './probe.ts'
 } from './probe.ts'
 
 

+ 2 - 1
packages/boot/app-boot/tests/compose-stack.spec.ts

@@ -9,7 +9,8 @@
 import { describe, expect, it } from 'vitest'
 import { describe, expect, it } from 'vitest'
 import type { EntryOptions } from '@deepseek-ai/cordis-plugin-loader'
 import type { EntryOptions } from '@deepseek-ai/cordis-plugin-loader'
 import type { PatchOptions } from '@deepseek-ai/cordis-plugin-include'
 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'
 const NAME = 'dsh-test-bin'
 
 

+ 2 - 4
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 { afterEach, describe, expect, it } from 'vitest'
 import { Context, type Plugin } from '@deepseek-ai/cordis'
 import { Context, type Plugin } from '@deepseek-ai/cordis'
 import Loader, { type EntryOptions } from '@deepseek-ai/cordis-plugin-loader'
 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'
 const NAME = 'dsh-test-bin'
 
 

+ 2 - 4
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 { describe, expect, it } from 'vitest'
 import type { EntryOptions } from '@deepseek-ai/cordis-plugin-loader'
 import type { EntryOptions } from '@deepseek-ai/cordis-plugin-loader'
 import { applyEntryPatches, type PatchOptions } from '@deepseek-ai/cordis-plugin-include'
 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'
 const NAME = 'dsh-test-bin'
 
 

+ 2 - 1
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 { tmpdir } from 'node:os'
 import { join } from 'node:path'
 import { join } from 'node:path'
 import { describe, expect, it } from 'vitest'
 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 { cordisPackageDir, parseProbeRecord } from '../src/probe.ts'
 import { parseChildReport, type ChildReport } from '../src/probe-report.ts'
 import { parseChildReport, type ChildReport } from '../src/probe-report.ts'