fix: guard human interaction by runtime ownership

This commit is contained in:
Tianyi Cui
2026-08-08 15:30:08 +08:00
parent 408de0f588
commit dc64c5f1c2
27 changed files with 935 additions and 81 deletions
@@ -0,0 +1,17 @@
import type { Context } from 'cordis'
import '@deepseek-ai/dsh-user-interaction'
/** Snapshot-only provider whose invocation means the child guard failed. */
export const name = 'child-question-tripwire'
/** User-interaction service required by the tripwire provider. */
export const inject = ['userInteraction']
/** Register a provider that must remain unreachable for the delegated call. */
export function apply(ctx: Context): void {
ctx.userInteraction.registerProvider({
async ask() {
throw new Error('snapshot tripwire: delegated question reached the UI provider')
},
})
}