feat(remote): deliver allowlisted Host events through ctx.remote.$on

api/remotes owns the allowlist and its type projection; type-meta owns the shape
predicate, the selection seat, and the internal remote/host-event carrier
signal; api/gateway's Client half turns that signal into $on callbacks through a
private dispatch. apiproxy forwards each allowlisted emission verbatim in one
host/remote-event frame, registered ahead of the derived invalidation frames so
frame order is unchanged, and drops the three per-event variants it replaces.
Owner packages move their Events declarations into client-safe ./types exports,
so a consumer's listener signature is the Host's own declaration.
This commit is contained in:
imccyu
2026-08-10 21:32:50 +08:00
parent b64da061a8
commit d88f771e19
59 changed files with 956 additions and 257 deletions

View File

@@ -123,16 +123,6 @@ declare module '@deepseek-ai/cordis' {
interface Context {
commands: CommandService
}
interface Events {
/**
* A command was registered or unregistered. This is an unfiltered registry
* notification because a global or scoped change may affect any UI view.
* Observer failures are contained and cannot veto the registry mutation.
* @mode emit
*/
'commands/change'(): void
}
}
/**

View File

@@ -1,5 +1,8 @@
/**
* Durable command event vocabulary shared with type-only consumers.
* Durable command event vocabulary and the registry's Cordis event
* declaration, shared with type-only consumers. Client-safe: nothing here
* reaches a Host-only symbol, so a Client compilation face reads the same
* `commands/change` signature the Host emits.
*
* @module @deepseek-ai/dsh-commands/types
*/
@@ -19,6 +22,18 @@ export interface CommandSourceMap {
/** The union over {@link CommandSourceMap} — who issued a command line. */
export type CommandSource = CommandSourceMap[keyof CommandSourceMap]
declare module '@deepseek-ai/cordis' {
interface Events {
/**
* A command was registered or unregistered. This is an unfiltered registry
* notification because a global or scoped change may affect any UI view.
* Observer failures are contained and cannot veto the registry mutation.
* @mode emit
*/
'commands/change'(): void
}
}
declare module '@deepseek-ai/dsh-session/types' {
interface SessionEventMap {
/**