Add structured sections and hierarchical navigation
Add --section flag to add/update commands for structured node content, render sections and inline children in show, and add memory children command.
This commit is contained in:
@@ -30,6 +30,23 @@ export const showCommand = new Command('show')
|
||||
if (node.isStale) console.log(chalk.red('STALE'));
|
||||
if (node.content) console.log(`\n${node.content}`);
|
||||
|
||||
// Render structured sections
|
||||
if (node.metadata?.sections && Array.isArray(node.metadata.sections)) {
|
||||
for (const sec of node.metadata.sections) {
|
||||
console.log(`\n${chalk.bold(`── ${sec.label} ──`)}`);
|
||||
if (sec.body) console.log(sec.body);
|
||||
}
|
||||
}
|
||||
|
||||
// Inline children (outgoing 'contains' edges)
|
||||
const children = conns.outgoing.filter(c => c.type === 'contains');
|
||||
if (children.length) {
|
||||
console.log(chalk.bold('\nChildren:'));
|
||||
for (const c of children) {
|
||||
console.log(` ${c.node.id.slice(0, 8)} [${c.node.kind}] ${c.node.title}`);
|
||||
}
|
||||
}
|
||||
|
||||
if (conns.outgoing.length) {
|
||||
console.log(chalk.bold('\nOutgoing:'));
|
||||
for (const c of conns.outgoing) {
|
||||
|
||||
Reference in New Issue
Block a user