fix: rebase
This commit is contained in:
@@ -51,7 +51,7 @@ describe.skipIf(!requiredArtifacts)('Goal Remote built LIB chain', () => {
|
||||
const { Context } = cordis
|
||||
const { default: AgentRegistry } = await import(urls.agent)
|
||||
const connectionHost = await import(urls.connectionHost)
|
||||
const { default: TypertGatewayService } = await import(urls.apiGatewayHost)
|
||||
const { default: TypertRemoteService } = await import(urls.apiGatewayHost)
|
||||
const { default: GoalService } = await import(urls.goal)
|
||||
const { TYPERT } = await import(urls.goalTypert)
|
||||
const { default: TypertRegistry } = await import(urls.registryHost)
|
||||
@@ -70,7 +70,7 @@ describe.skipIf(!requiredArtifacts)('Goal Remote built LIB chain', () => {
|
||||
await host.plugin({ inject: connectionHost.inject, apply: connectionHost.apply })
|
||||
await host.plugin(TypertRegistry)
|
||||
await host.plugin(AgentRegistry)
|
||||
await host.plugin(TypertGatewayService)
|
||||
await host.plugin(TypertRemoteService)
|
||||
await host.plugin(GoalService)
|
||||
host.typert.register(TYPERT)
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
},
|
||||
{
|
||||
"path": "../../self-modification/cordis-host-runner"
|
||||
"path": "../../extensions/cordis-host-runner"
|
||||
},
|
||||
{
|
||||
"path": "../../goal/goal"
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
"path": "../../session/session-persistence"
|
||||
},
|
||||
{
|
||||
"path": "../../self-modification/cordis-host-runner"
|
||||
"path": "../../extensions/cordis-host-runner"
|
||||
},
|
||||
{
|
||||
"path": "../../settings/settings"
|
||||
|
||||
@@ -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({}, {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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]))
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -16,7 +16,7 @@ import type {
|
||||
CordisDynamicPluginRunId,
|
||||
DynamicCordisPackage,
|
||||
} from '@deepseek-ai/dsh-api-remotes/client'
|
||||
import { SlotsService } from '@deepseek-ai/dsh-client-runtime/client'
|
||||
import { SlotRegistry } from '@deepseek-ai/dsh-client-runtime/client'
|
||||
import { dynamicCordisContext } from '../src/client/guard.ts'
|
||||
import type { DynamicCordisSlotLedgerRow } from '../src/client/guard.ts'
|
||||
|
||||
@@ -37,7 +37,7 @@ type Facade = Record<string, unknown> & { get(name: string): unknown }
|
||||
|
||||
interface Bench {
|
||||
ctx: Context
|
||||
slots: SlotsService
|
||||
slots: SlotRegistry
|
||||
facade: Facade
|
||||
ledger: DynamicCordisSlotLedgerRow[]
|
||||
/** Components the facade claimed for the package, in registration order. */
|
||||
@@ -53,7 +53,7 @@ interface Bench {
|
||||
*/
|
||||
async function boot(inject: string[], extras: Record<string, unknown> = {}): Promise<Bench> {
|
||||
const ctx = new Context()
|
||||
await ctx.plugin(SlotsService)
|
||||
await ctx.plugin(SlotRegistry)
|
||||
const themeLayerDispose = vi.fn()
|
||||
const overrideTokens = vi.fn(() => themeLayerDispose)
|
||||
ctx.reflect.provide('theme', {
|
||||
|
||||
@@ -18,7 +18,7 @@ import type { SessionId } from '@deepseek-ai/dsh-client-connection/client'
|
||||
import type { DynamicCordisInvokeResult } from '@deepseek-ai/dsh-api-remotes/client'
|
||||
// Type-only: resolves `ctx.remote` and with it the `$on`/`$dispatch` surface.
|
||||
import type {} from '@deepseek-ai/dsh-api-gateway/client'
|
||||
import { SlotsService } from '@deepseek-ai/dsh-client-runtime/client'
|
||||
import { SlotRegistry } from '@deepseek-ai/dsh-client-runtime/client'
|
||||
import * as NodeHalf from '../src/index.ts'
|
||||
import * as Invariant from '../src/invariant.ts'
|
||||
import * as ClientHalf from '../src/client/index.ts'
|
||||
@@ -80,7 +80,7 @@ interface Bench {
|
||||
/** Mount the browser half over a module table and a loader standing on real fibers. */
|
||||
async function boot(): Promise<Bench> {
|
||||
const ctx = new Context()
|
||||
await ctx.plugin(SlotsService)
|
||||
await ctx.plugin(SlotRegistry)
|
||||
const factories = new Map<string, () => unknown>()
|
||||
const fibers = new Map<string, { fiber: unknown }>()
|
||||
let next = 0
|
||||
|
||||
@@ -19,7 +19,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 { SlotsService } from '@deepseek-ai/dsh-client-runtime/client'
|
||||
import { SlotRegistry } from '@deepseek-ai/dsh-client-runtime/client'
|
||||
import { DYNAMIC_CLIENT_REDIRECTS } from '../src/client/evaluator.ts'
|
||||
import { DynamicCordisPackageRunner } from '../src/client/runtime.ts'
|
||||
import type { DynamicCordisClientHalf, DynamicCordisRenderFailure } from '../src/client/runtime.ts'
|
||||
@@ -48,7 +48,7 @@ function half(overrides: Partial<DynamicCordisClientHalf> = {}): DynamicCordisCl
|
||||
|
||||
interface Bench {
|
||||
ctx: Context
|
||||
slots: SlotsService
|
||||
slots: SlotRegistry
|
||||
runner: DynamicCordisPackageRunner
|
||||
invalidated: string[]
|
||||
removed: string[]
|
||||
@@ -83,7 +83,7 @@ function seated<T>(fiber: T): T {
|
||||
|
||||
async function boot(): Promise<Bench> {
|
||||
const ctx = new Context()
|
||||
await ctx.plugin(SlotsService)
|
||||
await ctx.plugin(SlotRegistry)
|
||||
const invalidated: string[] = []
|
||||
const removed: string[] = []
|
||||
const created: string[] = []
|
||||
@@ -128,7 +128,7 @@ async function boot(): Promise<Bench> {
|
||||
listener = fn
|
||||
return () => { listener = undefined }
|
||||
},
|
||||
} as unknown as SlotsService,
|
||||
} as unknown as SlotRegistry,
|
||||
invoke,
|
||||
reportGuardFailure: () => {},
|
||||
reportRenderFailure: (agentId, pluginId, pluginRunId, failure) => {
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
"path": "../../client/ui-theme"
|
||||
},
|
||||
{
|
||||
"path": "../../support/invariants"
|
||||
"path": "../../runtime-diagnostics/invariants"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
"@deepseek-ai/dsh-scope": "workspace:^",
|
||||
"@deepseek-ai/dsh-session": "workspace:^",
|
||||
"@deepseek-ai/dsh-tools": "workspace:^",
|
||||
"@deepseek-ai/dsh-type-meta": "workspace:^"
|
||||
"@deepseek-ai/dsh-typert-protocol": "workspace:^"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@deepseek-ai/cordis": "workspace:^",
|
||||
@@ -73,6 +73,6 @@
|
||||
"@deepseek-ai/dsh-scope": "workspace:^",
|
||||
"@deepseek-ai/dsh-session": "workspace:^",
|
||||
"@deepseek-ai/dsh-tools": "workspace:^",
|
||||
"@deepseek-ai/dsh-type-meta": "workspace:^"
|
||||
"@deepseek-ai/dsh-typert-protocol": "workspace:^"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import z from '@deepseek-ai/schemastery'
|
||||
import type { Agent } from '@deepseek-ai/dsh-agent'
|
||||
import { createUserMessage } from '@deepseek-ai/dsh-llm'
|
||||
import type { JsonValue } from '@deepseek-ai/dsh-session/types'
|
||||
import { GatewayService, Remote } from '@deepseek-ai/dsh-type-meta'
|
||||
import { TypertRemoteService, Remote } from '@deepseek-ai/dsh-typert-protocol'
|
||||
import { isPlugin, normalizeHandler } from './guard.ts'
|
||||
import { CordisInspectRegistryService } from './inspect-registry.ts'
|
||||
import { missingServices, startHostHalf } from './lifecycle.ts'
|
||||
@@ -121,7 +121,7 @@ interface ActivationPlan {
|
||||
}
|
||||
|
||||
/** Dynamic Plugin registry and Host-half lifecycle. */
|
||||
export class DynamicCordisRunnerService extends GatewayService {
|
||||
export class DynamicCordisRunnerService extends TypertRemoteService {
|
||||
static inject = ['tools']
|
||||
|
||||
static Config: z<Config> = z.object({
|
||||
|
||||
@@ -39,10 +39,10 @@
|
||||
"path": "../../llm/llm"
|
||||
},
|
||||
{
|
||||
"path": "../../support/invariants"
|
||||
"path": "../../runtime-diagnostics/invariants"
|
||||
},
|
||||
{
|
||||
"path": "../../typert/type-meta"
|
||||
"path": "../../typert/protocol"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -39,7 +39,7 @@
|
||||
"path": "../cordis-host-runner"
|
||||
},
|
||||
{
|
||||
"path": "../../support/invariants"
|
||||
"path": "../../runtime-diagnostics/invariants"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
"@deepseek-ai/dsh-cordis-client-runner",
|
||||
"@deepseek-ai/dsh-api-remotes",
|
||||
"@deepseek-ai/dsh-client-locale",
|
||||
"@deepseek-ai/dsh-client-ui-slash",
|
||||
"@deepseek-ai/dsh-client-ui-input-trigger",
|
||||
"@deepseek-ai/dsh-client-ui-tool",
|
||||
"@deepseek-ai/dsh-client-ui-sidebar"
|
||||
],
|
||||
@@ -57,7 +57,7 @@
|
||||
"@deepseek-ai/dsh-client-runtime": "workspace:^",
|
||||
"@deepseek-ai/dsh-client-ui-primitives": "workspace:^",
|
||||
"@deepseek-ai/dsh-client-ui-sidebar": "workspace:^",
|
||||
"@deepseek-ai/dsh-client-ui-slash": "workspace:^",
|
||||
"@deepseek-ai/dsh-client-ui-input-trigger": "workspace:^",
|
||||
"@deepseek-ai/dsh-client-ui-slots": "workspace:^",
|
||||
"@deepseek-ai/dsh-client-ui-tool": "workspace:^",
|
||||
"@deepseek-ai/dsh-invariants": "workspace:^",
|
||||
@@ -72,7 +72,7 @@
|
||||
"@deepseek-ai/dsh-client-runtime": "workspace:^",
|
||||
"@deepseek-ai/dsh-client-ui-primitives": "workspace:^",
|
||||
"@deepseek-ai/dsh-client-ui-sidebar": "workspace:^",
|
||||
"@deepseek-ai/dsh-client-ui-slash": "workspace:^",
|
||||
"@deepseek-ai/dsh-client-ui-input-trigger": "workspace:^",
|
||||
"@deepseek-ai/dsh-client-ui-slots": "workspace:^",
|
||||
"@deepseek-ai/dsh-client-ui-tool": "workspace:^",
|
||||
"@deepseek-ai/dsh-invariants": "workspace:^",
|
||||
|
||||
@@ -5,7 +5,7 @@ import type {} from '@deepseek-ai/dsh-client-ui-tool/client'
|
||||
import type {} from '@deepseek-ai/dsh-client-locale/client'
|
||||
import type {} from '@deepseek-ai/dsh-client-ui-sidebar/client'
|
||||
import type {} from '@deepseek-ai/dsh-api-remotes/client'
|
||||
import type { SlashServiceContract, SlashSource } from '@deepseek-ai/dsh-client-ui-slash/client'
|
||||
import type { InputTriggerService, InputTriggerSource } from '@deepseek-ai/dsh-client-ui-input-trigger/client'
|
||||
import type {} from './events.ts'
|
||||
import { CordisDefineRow } from './CordisDefineRow.tsx'
|
||||
import { CordisRunRow } from './CordisRunRow.tsx'
|
||||
@@ -133,7 +133,7 @@ export function apply(ctx: ClientContext): void {
|
||||
|
||||
const rowsOf = (sessionId: SessionId, query: string) => inventory.getSnapshot().rows
|
||||
.filter(row => row.agentId === sessionId && String(row.pluginId).includes(query))
|
||||
const source: SlashSource = {
|
||||
const source: InputTriggerSource = {
|
||||
trigger: '@',
|
||||
name: 'cordis',
|
||||
order: 1,
|
||||
@@ -153,7 +153,7 @@ export function apply(ctx: ClientContext): void {
|
||||
subscribeLexicon(_session, listener) { return inventory.subscribe(listener) },
|
||||
onPick({ candidate }) { return { text: `@${candidate.name} ` } },
|
||||
}
|
||||
const slash = ctx.get('slash') as SlashServiceContract
|
||||
const slash = ctx.get('slash') as InputTriggerService
|
||||
ctx.effect(() => slash.registerSource(source), 'ui-cordis: @pluginId source')
|
||||
|
||||
inventory.refresh()
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
"path": "../../client/ui-sidebar"
|
||||
},
|
||||
{
|
||||
"path": "../../client/ui-slash"
|
||||
"path": "../../client/ui-input-trigger"
|
||||
},
|
||||
{
|
||||
"path": "../../client/ui-primitives"
|
||||
@@ -39,7 +39,7 @@
|
||||
"path": "../../client/ui-tool"
|
||||
},
|
||||
{
|
||||
"path": "../../support/invariants"
|
||||
"path": "../../runtime-diagnostics/invariants"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user