Files
personamanagmentlayer__pcl/tests/persona-test.mjs
ANGX dcf5e14efa feat: complete persona body property extraction
- Update extractProperties() to handle depth and verbosity properties
- Update extractPersonaConfig() to extract depth and verbosity from AST
- Add depth/verbosity to codegen property extraction interface
- Test parsing and extraction of complete persona syntax

Parsing now correctly handles:
- intent/tone/depth/verbosity properties
- skills/constraints/tags blocks

Status: Parser + Codegen + Runtime integration COMPLETE
2026-01-16 07:54:41 +01:00

28 lines
792 B
JavaScript

import { parse } from '../dist/index.js';
const source = `persona SEC {
intent: "Security analysis"
tone: cautious
depth: thorough
verbosity: detailed
skills { "OWASP Top 10" }
}`;
const result = parse(source);
console.log('Parse result:', result.ok ? 'SUCCESS' : 'FAILED');
if (result.ok) {
const persona = result.value.program.statements[0];
console.log('Persona ID:', persona.id?.name);
console.log('Body members:', persona.body?.members?.length || 0);
if (persona.body?.members) {
persona.body.members.forEach((member, idx) => {
console.log(
` [${idx}] ${member.kind}: ${member.name?.name || 'unnamed'}`
);
});
}
} else {
console.log('Errors:', result.error.length);
result.error.forEach((err) => console.log(' -', err.message));
}