mirror of
https://github.com/hansjone/netxops.git
synced 2026-10-10 19:50:49 +08:00
Fix knowledge-base browse feedback and accept MANIFEST.json paths.
Browse no longer fails silently, falls back to Host directoryPicker RPC, and resolve treats a MANIFEST.json file path as its parent package root. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
de7c6a0c4b
commit
f64f1279e7
9 changed files with 246 additions and 49 deletions
|
|
@ -64,7 +64,11 @@ export async function resolveKbPath(
|
|||
path: string,
|
||||
signal?: AbortSignal,
|
||||
): Promise<KbSnapshot> {
|
||||
const result = await call(NETXOPS_RPC_CHANNEL, KB_RESOLVE_ENDPOINT, { path }, signal)
|
||||
// Prefer flat `{ path }` (netxops channel); also try `{ args: { path } }`.
|
||||
let result = await call(NETXOPS_RPC_CHANNEL, KB_RESOLVE_ENDPOINT, { path }, signal)
|
||||
if (!(result !== null && typeof result === 'object' && (result as { ok?: boolean }).ok === true)) {
|
||||
result = await call(NETXOPS_RPC_CHANNEL, KB_RESOLVE_ENDPOINT, { args: { path } }, signal)
|
||||
}
|
||||
if (result !== null && typeof result === 'object' && (result as { ok?: boolean }).ok === true) {
|
||||
return asKbSnapshot((result as { value?: unknown }).value)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue