Add operator-subset knowledge base wiring for Netx Ops P1.

Locate and validate MANIFEST under kbRoot, show anti-mixup status in settings, and inject KB_* env plus kb-context so sessions degrade to pure netx when unset.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-09-13 10:39:28 +08:00
parent e6f9d062ed
commit de7c6a0c4b
23 changed files with 2694 additions and 68 deletions

View file

@ -65,7 +65,7 @@ export function apply(ctx: ClientContext): void {
}, 'netxops: credential invalidations')
})
// Soft-inject Connection so the card can poll host WSS status.
// Soft-inject Connection so the card can poll host WSS status + KB status.
ctx.inject(['connection'], (connCtx) => {
const call = connCtx.connection?.rpc?.call?.bind(connCtx.connection.rpc)
if (typeof call !== 'function') {
@ -78,6 +78,20 @@ export function apply(ctx: ClientContext): void {
}, 'netxops: clear alarm-push rpc')
})
// Soft-inject Host directory picker for knowledge-base browse.
ctx.inject(['remote.directoryPicker'], (dpCtx) => {
const picker = (dpCtx as { remote?: { directoryPicker?: { pick?: (signal?: AbortSignal) => Promise<string | null> } } })
.remote?.directoryPicker
if (!picker || typeof picker.pick !== 'function') {
dpCtx.logger.warn('netxops: remote.directoryPicker.pick unavailable — browse button disabled')
return
}
card.setDirectoryPicker(picker)
dpCtx.effect(() => () => {
card.setDirectoryPicker(undefined)
}, 'netxops: clear directory picker')
})
ctx.slots.inject('settings.section', () => ctx.slots.register({
name: 'settings.section',
id: NETXOPS_NS,