fix: rebase

This commit is contained in:
imccyu
2026-08-13 01:59:32 +08:00
parent 25efb8ff6f
commit 39f55a049f
26 changed files with 3031 additions and 1723 deletions

View File

@@ -6,7 +6,7 @@
* carry extra machinery: `slots`, where the register proxy assigns the
* shadowing priority and ledgers the registration — invoking the service with
* the traced receiver so the effect lands on the CALLING plugin's fiber
* (SlotsService.register must stay a prototype method for exactly that
* (SlotRegistry.register must stay a prototype method for exactly that
* reason) — and `theme`, whose override source is pinned to the package id.
*
* This is API discipline, not a security boundary: a dynamic package's code is
@@ -15,8 +15,8 @@
import { Context } from '@deepseek-ai/cordis'
import type { DynamicCordisPackage } from '@deepseek-ai/dsh-api-remotes/client'
import type { SlotsService } from '@deepseek-ai/dsh-client-runtime/client'
import type { ThemeService } from '@deepseek-ai/dsh-client-ui-theme/client'
import type { SlotRegistry } from '@deepseek-ai/dsh-client-runtime/client'
import type { ThemeRuntime } from '@deepseek-ai/dsh-client-ui-theme/client'
/** Facade verbs beyond declared services (host CTX_VERBS twin). */
const CTX_VERBS = new Set([
@@ -93,7 +93,7 @@ interface ErasedSlotOptions {
* The slots seat: automatic shadowing priority and ledger recording around the
* traced service's own register.
*/
function guardedSlots(slots: SlotsService, env: DynamicCordisGuardEnv): unknown {
function guardedSlots(slots: SlotRegistry, env: DynamicCordisGuardEnv): unknown {
return new Proxy(slots, {
get(target, prop) {
const value = Reflect.get(target, prop, target) as unknown
@@ -145,7 +145,7 @@ function guardedSlots(slots: SlotsService, env: DynamicCordisGuardEnv): unknown
* keep the returned handle (slots parity — register hangs its own cleanup).
* Everything else forwards through the generic guard.
*/
function guardedTheme(theme: ThemeService, env: DynamicCordisGuardEnv, ctx: Context): unknown {
function guardedTheme(theme: ThemeRuntime, env: DynamicCordisGuardEnv, ctx: Context): unknown {
return new Proxy(theme, {
get(target, prop) {
if (prop !== 'overrideTokens') {
@@ -205,8 +205,8 @@ export function dynamicCordisContext(ctx: Context, env: DynamicCordisGuardEnv):
if (requireDeclaration && !declared.has(name)) return denyRead(name)
const service = denyContext(ctx.get(name), name, env)
if (service === null || (typeof service !== 'object' && typeof service !== 'function')) return service
if (name === 'slots') return guardedSlots(service as SlotsService, env)
if (name === 'theme') return guardedTheme(service as ThemeService, env, ctx)
if (name === 'slots') return guardedSlots(service as SlotRegistry, env)
if (name === 'theme') return guardedTheme(service as ThemeRuntime, env, ctx)
return guardedService(service, name, env)
}
return new Proxy({}, {

View File

@@ -16,7 +16,7 @@ import type {
DynamicCordisInventoryRow,
} from '@deepseek-ai/dsh-api-remotes/client'
import type { ClientModuleSystem } from '@deepseek-ai/dsh-client-modules/client'
import type { SlotsService } from '@deepseek-ai/dsh-client-runtime/client'
import type { SlotRegistry } from '@deepseek-ai/dsh-client-runtime/client'
// The Client Remote assembly is the one place the two planes meet: it mounts the
// `dynamicCordisRunner` namespace and re-exports its payload vocabulary, so this
// package names what it sends without importing a Host package.
@@ -206,7 +206,7 @@ export function apply(ctx: Context): void {
ctx,
loader: ctx.loader,
modules: ctx.get('modules') as ClientModuleSystem,
slots: ctx.get('slots') as SlotsService,
slots: ctx.get('slots') as SlotRegistry,
invoke: async (pluginId, pluginRunId, method, args) => {
// Model-authored arguments reach this boundary untyped; the namespace's
// generated codec is what validates them as JSON, and its rejection is a

View File

@@ -2,7 +2,7 @@
import type { Context } from '@deepseek-ai/cordis'
import type { JsonValue } from '@deepseek-ai/dsh-api-remotes/client'
import type { SlotsService } from '@deepseek-ai/dsh-client-runtime/client'
import type { SlotRegistry } from '@deepseek-ai/dsh-client-runtime/client'
import type {} from '@deepseek-ai/dsh-client-ui-theme/client'
import { queryEventApi, queryServiceApi } from './api-catalog.ts'
import type { ClientCordisInspectProviderRegistration } from './inspect-registry.ts'
@@ -169,7 +169,7 @@ function readExact(input: JsonValue | undefined, field: string): string | undefi
}
/* jscpd:ignore-end */
type LiveSlotNode = ReturnType<SlotsService['snapshot']>[number]
type LiveSlotNode = ReturnType<SlotRegistry['snapshot']>[number]
const SLOT_CATALOG = new Map(CLIENT_SLOT_API.map(entry => [entry.key, entry]))

View File

@@ -21,7 +21,7 @@ import type {
} from '@deepseek-ai/dsh-api-remotes/client'
import type { SessionId } from '@deepseek-ai/dsh-client-connection/client'
import type { ClientModuleSystem } from '@deepseek-ai/dsh-client-modules/client'
import type { SlotsService } from '@deepseek-ai/dsh-client-runtime/client'
import type { SlotRegistry } from '@deepseek-ai/dsh-client-runtime/client'
import { DynamicCordisStyles, evaluateClientHalf, DYNAMIC_CLIENT_REDIRECTS } from './evaluator.ts'
import type { DynamicCordisEvaluatedPlugin } from './evaluator.ts'
import { dynamicCordisContext } from './guard.ts'
@@ -121,7 +121,7 @@ export interface DynamicCordisRunnerEnv {
/** Module table, for factory invalidation before every (re-)registration. */
modules: ClientModuleSystem
/** Slot registry, for the entry-crash supervision seam. */
slots: SlotsService
slots: SlotRegistry
/** Route one `host.call` to the package's host half through the Remote namespace. */
invoke(
pluginId: CordisDynamicPluginId,