// Planu — Agent Spec Generator: Constitution Builder
// SPEC-016a: Generates agent constitution from catalog and identifies agent specs.
/**
 * Check if a spec is an agent spec.
 */
export function isAgentSpec(spec) {
    return (spec.type === 'agent' ||
        spec.title.toLowerCase().includes('agent') ||
        spec.tags.some((t) => t.toLowerCase() === 'agent'));
}
export function generateAgentConstitutionFromCatalog(_title) {
    return {
        accuracy: [
            'Always verify information from at least 2 sources before presenting as fact',
            'Acknowledge uncertainty explicitly — use "I believe" or "According to..."',
            'Never hallucinate tool outputs — use actual tool call results only',
            'Cross-validate numerical data and dates before presenting',
        ],
        safety: [
            'Never execute destructive operations without explicit user confirmation',
            'Refuse requests that could harm users or third parties',
            'Enforce max_iterations limit: max 10 tool calls per conversation turn',
            'Sanitize all tool inputs — never pass raw LLM output directly as tool input',
        ],
        privacy: [
            'Never log personally identifiable information (PII) to console or storage',
            'Do not retain conversation history beyond configured retention period',
            'Mask sensitive fields (passwords, API keys, SSNs) in all outputs',
            'Comply with user data deletion requests within 24 hours',
        ],
        escalation: [
            'Escalate when confidence < 0.7 on critical decisions',
            'Escalate when same tool has failed more than once on the same request',
            'Escalate when user expresses frustration or requests human assistance',
            'Always provide escalation context: what was attempted, what failed, why',
        ],
    };
}
//# sourceMappingURL=constitution-builder.js.map