fix: test/docs

This commit is contained in:
imccyu
2026-08-13 00:19:15 +08:00
parent ffcc8e299b
commit 978e573605
33 changed files with 1307 additions and 136 deletions

View File

@@ -2,23 +2,38 @@
import type { GenericCallView } from '@deepseek-ai/dsh-tools'
/** Render a runtime-inspection call. */
/**
* Render a runtime-inspection call.
* @param args - requested runtime category and optional member name.
* @returns replay-safe generic call presentation.
*/
export function presentRuntimeInspectCall(args: { what?: string; name?: string }): GenericCallView {
const target = args.name === undefined ? args.what : `${args.what}: ${args.name}`
return { card: 'generic', kind: 'read', title: target === undefined ? 'Inspect Cordis runtime' : `Inspect Cordis runtime: ${target}` }
}
/** Render provider-directory inspection. */
/**
* Render provider-directory inspection.
* @returns replay-safe generic call presentation.
*/
export function presentInspectListCall(): GenericCallView {
return { card: 'generic', kind: 'read', title: 'List Cordis Inspect Providers' }
}
/** Render one provider query. */
/**
* Render one provider query.
* @param args - target platform, provider, and method.
* @returns replay-safe generic call presentation.
*/
export function presentInspectQueryCall(args: { platform: string; provider: string; method: string }): GenericCallView {
return { card: 'generic', kind: 'read', title: `Query Cordis ${args.platform} ${args.provider}.${args.method}` }
}
/** Render layered self-inspection. */
/**
* Render layered self-inspection.
* @param args - optional Plugin and Package identity.
* @returns replay-safe generic call presentation.
*/
export function presentInspectSelfCall(args: { pluginId?: string; packageId?: string }): GenericCallView {
const target = args.pluginId === undefined
? 'dynamic Cordis Plugins'
@@ -26,12 +41,20 @@ export function presentInspectSelfCall(args: { pluginId?: string; packageId?: st
return { card: 'generic', kind: 'read', title: `Inspect ${target}` }
}
/** Render an immutable Package source-inspection call. */
/**
* Render an immutable Package source-inspection call.
* @param args - exact Plugin and Package identity.
* @returns replay-safe generic call presentation.
*/
export function presentPackageInspectCall(args: { pluginId: string; packageId: string }): GenericCallView {
return { card: 'generic', kind: 'read', title: `Inspect Cordis Package ${args.pluginId}/${args.packageId}` }
}
/** Render a new or appended Package definition. */
/**
* Render a new or appended Package definition.
* @param args - target Plugin, Package metadata, and source halves.
* @returns replay-safe generic call presentation with source in raw input.
*/
export function presentDefineCall(args: {
plugin: { kind: 'new'; idPrefix: string } | { kind: 'existing'; pluginId: string }
name: string
@@ -47,12 +70,20 @@ export function presentDefineCall(args: {
}
}
/** Render Plugin removal. */
/**
* Render Plugin removal.
* @param args - Plugin identity to remove.
* @returns replay-safe generic call presentation.
*/
export function presentUndefineCall(args: { pluginId: string }): GenericCallView {
return { card: 'generic', kind: 'delete', title: `Remove dynamic Plugin ${args.pluginId}` }
}
/** Render one exact Package activation. */
/**
* Render one exact Package activation.
* @param args - Plugin, Package, and activation mode.
* @returns replay-safe generic call presentation.
*/
export function presentRunCall(args: { pluginId: string; packageId: string; mode: 'run' | 'update' }): GenericCallView {
return {
card: 'generic',
@@ -61,7 +92,11 @@ export function presentRunCall(args: { pluginId: string; packageId: string; mode
}
}
/** Render Plugin stop. */
/**
* Render Plugin stop.
* @param args - Plugin identity to stop.
* @returns replay-safe generic call presentation.
*/
export function presentStopCall(args: { pluginId: string }): GenericCallView {
return { card: 'generic', kind: 'execute', title: `Stop dynamic Plugin ${args.pluginId}` }
}

View File

@@ -18,7 +18,11 @@ const EVENT_OUTPUT = {
} as const
const HOST_EVENTS = EVENT_API.filter(event => !event.name.startsWith('cordis/'))
/** Construct Host providers over generated Catalogs, evaluator declarations, and live Tool scope. */
/**
* Construct Host providers over generated Catalogs, evaluator declarations, and live Tool scope.
* @param ctx - Host context used for Agent-scoped live Tool queries.
* @returns registrations for static catalogs and live Host capabilities.
*/
export function hostInspectProviders(ctx: Context): HostCordisInspectProviderRegistration[] {
return [
registration(