|
|
@@ -3,7 +3,7 @@ import { Context, FiberState, type Plugin } from '@deepseek-ai/cordis'
|
|
|
import Loader, { Group } from '@deepseek-ai/cordis-plugin-loader'
|
|
|
import { remoteMethods } from '@deepseek-ai/dsh-typert-protocol'
|
|
|
import type { AgentPresets } from '@deepseek-ai/dsh-agent-presets'
|
|
|
-import { ensurePluginFailures, type ProfileRuntime, type RowOrigin } from '@deepseek-ai/dsh-app-boot'
|
|
|
+import { ensurePluginFailures, ProfileRuntime, type ComposedStack, type Profile, type RowOrigin } from '@deepseek-ai/dsh-app-boot'
|
|
|
import PluginInventoryGateway from '../src/index.ts'
|
|
|
|
|
|
const contexts: Context[] = []
|
|
|
@@ -111,7 +111,7 @@ describe('PluginInventoryGateway', () => {
|
|
|
])
|
|
|
ctx.provide('profileRuntime', {
|
|
|
originOf: (rowId: string) => origins.get(rowId),
|
|
|
- userDisabledRowIds: () => new Set([off]),
|
|
|
+ userDisables: (entry: { id: string }) => entry.id === off,
|
|
|
layers: [{ packageName: 'late', version: '9.9.9' }],
|
|
|
conflicts: [
|
|
|
{ rowId: 'tool', moduleName: 'late', layer: 'late', packageName: 'late', declaredBy: 'ext', message: 'row "tool" is already declared by ext' },
|
|
|
@@ -160,9 +160,12 @@ describe('PluginInventoryGateway', () => {
|
|
|
const groupId = await ctx.loader.create({ name: 'cordis:group', group: true, config: [{ name: 'cordis:active' }] })
|
|
|
const child = [...ctx.loader.entries()].find(entry => !entry.options.group && entry.parent.ctx.fiber.entry?.options.id === groupId)
|
|
|
expect(child).toBeDefined()
|
|
|
- ctx.provide('profileRuntime', {
|
|
|
- originOf: () => undefined, userDisabledRowIds: () => new Set([groupId]), layers: [], conflicts: [],
|
|
|
- } as unknown as ProfileRuntime)
|
|
|
+ // The real runtime over a composition whose user layer disabled the group.
|
|
|
+ const profile: Profile = { name: 'web', dir: '/p', layers: [], patchPath: '/p/cordis.patch.yml', patches: [], patchReload: 'live' }
|
|
|
+ const stack: ComposedStack = {
|
|
|
+ patches: [], layers: [], owners: new Map(), conflicts: [], skippedBundles: [], userDisabledRowIds: new Set([groupId]),
|
|
|
+ }
|
|
|
+ await ctx.plugin(ProfileRuntime, { profile, stack, loadProfile: () => profile, compose: () => stack, rootEntry: () => undefined })
|
|
|
await ctx.loader.update(groupId, { disabled: true })
|
|
|
const listed = (await inventory.list()).entries.find(entry => entry.entryId === child?.id)
|
|
|
expect(listed).toMatchObject({ enabled: false, disabledBy: 'user' })
|