// tools/design-schema/agent-schema.ts — Agent schema generation
// SPEC-016a criterion 2: knowledge base structure, conversation state, memory persistence.
import { generateAgentKnowledgeSchema, formatAgentSchemaAsMarkdown, } from '../../engine/agent-spec-generator.js';
/**
 * Returns true if the spec/knowledge is for an AI agent project.
 */
export function isAgentSchema(knowledge, spec) {
    if (spec?.type === 'agent') {
        return true;
    }
    const agentSignals = [
        '@anthropic-ai/sdk',
        '@mastra/core',
        'langgraph',
        'crewai',
        'autogen',
        'openai',
    ];
    return knowledge.stack.some((s) => agentSignals.some((sig) => s.toLowerCase().includes(sig)));
}
/**
 * Generate agent schema: knowledge base structure, conversation state, memory persistence.
 * Criteria 2: specialized schema for agent projects.
 */
export function generateAgentSchema(title, description, knowledge) {
    const schema = generateAgentKnowledgeSchema(description);
    const markdown = formatAgentSchemaAsMarkdown(schema, title);
    const lang = knowledge.language;
    const suffix = lang === 'python' ? 'py' : 'ts';
    const lines = [
        markdown,
        '',
        '### Implementation Notes',
        '',
        `- **Conversation State**: Store in Redis (TTL 3600s) or in-memory for stateless deployments`,
        `- **Memory Persistence**: Use mem0ai (TypeScript: \`npm install mem0ai\`) for cross-session memory`,
        `- **Vector Store**: Pinecone or Chroma for knowledge base embeddings`,
        '',
        '### Suggested Files',
        '',
        `- \`src/agents/schema/conversation.${suffix}\` — Conversation state types`,
        `- \`src/agents/schema/memory.${suffix}\` — Memory persistence types`,
        `- \`src/agents/schema/knowledge.${suffix}\` — Knowledge base document types`,
    ];
    return lines.join('\n');
}
//# sourceMappingURL=agent-schema.js.map