mirror of
https://github.com/hansjone/netxops.git
synced 2026-10-09 05:10:45 +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
|
|
@ -144,8 +144,31 @@ test('findManifest respects maxDepth', () => {
|
|||
})
|
||||
})
|
||||
|
||||
test('missing kbRoot path → error', () => {
|
||||
const snap = resolveKbRoot(join(tmpdir(), 'netxops-kb-missing-' + Date.now()))
|
||||
assert.equal(snap.status, 'error')
|
||||
assert.match(snap.errorMessage, /not found/)
|
||||
test('path to MANIFEST.json file resolves via parent dir', () => {
|
||||
withTemp((root) => {
|
||||
const manifestPath = join(root, 'MANIFEST.json')
|
||||
writeFileSync(manifestPath, validManifest(), 'utf8')
|
||||
const snap = resolveKbRoot(manifestPath)
|
||||
assert.equal(snap.status, 'configured')
|
||||
assert.equal(snap.realRoot, root)
|
||||
assert.equal(snap.operatorName, 'IOH')
|
||||
})
|
||||
})
|
||||
|
||||
test('contract content flags hasRegions etc. are accepted', () => {
|
||||
withTemp((root) => {
|
||||
writeFileSync(join(root, 'MANIFEST.json'), validManifest({
|
||||
content: {
|
||||
hasRegions: true,
|
||||
hasTheory: true,
|
||||
hasPacket: true,
|
||||
hasCommon: true,
|
||||
hasSkills: true,
|
||||
},
|
||||
}), 'utf8')
|
||||
const snap = resolveKbRoot(root)
|
||||
assert.equal(snap.status, 'configured')
|
||||
assert.equal(snap.content.hasRegions, true)
|
||||
assert.equal(snap.content.hasSkills, true)
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue