"""
AI Knowledge Plugin - Core Library

This module provides an independent, reusable knowledge management system
that can be used with or without Squad framework.

Key Components:
- file_utils: File I/O and path management
- templates: Knowledge item templates (6 types)
- value_assessor: 5-factor scoring system
- knowledge_manager: CRUD operations for knowledge items
- ai_knowledge_taxonomy: AI blind spots and common sense taxonomies
- worthiness_filter: AI self-aware worthiness judgment system

Usage:
    from thinkbank.core import KnowledgeManager, ValueAssessor, WorthinessFilter

    manager = KnowledgeManager()
    filter = WorthinessFilter()

    # Check if knowledge is worth storing
    decision, reasoning, confidence = filter.is_worth_storing(content)

    if decision == WorthinessDecision.STORE:
        knowledge_id = manager.create(
            knowledge_type='skill',
            title='Example Skill',
            content='...',
            factors={...}
        )
"""

from .file_utils import (
    detect_ide_environment,
    get_knowledge_base_path,
    ensure_dir,
    generate_id,
    read_yaml,
    write_yaml,
    read_knowledge_file,
    write_knowledge_file,
    list_knowledge_files,
    get_file_age_days
)

from .templates import (
    KnowledgeTemplate,
    SkillTemplate,
    RuleTemplate,
    PatternTemplate,
    DomainTemplate,
    UserTemplate,
    LessonTemplate,
    create_template,
    get_example_content
)

from .value_assessor import ValueAssessor

from .knowledge_manager import KnowledgeManager

from .ai_knowledge_taxonomy import (
    KnowledgeCategory,
    TaxonomyNode,
    AIBlindSpotsTaxonomy,
    AICommonSenseTaxonomy,
    classify_knowledge_boundaries
)

from .worthiness_filter import (
    WorthinessDecision,
    ConversationQualityImpact,
    WorthinessFilter,
    should_store_knowledge,
    get_worthiness_score,
    explain_worthiness
)

from .exporter import (
    export_knowledge_pack,
    export_to_directory,
    get_export_preview
)

from .importer import (
    import_knowledge_pack,
    resolve_conflicts_batch
)

__all__ = [
    # File utilities
    'detect_ide_environment',
    'get_knowledge_base_path',
    'ensure_dir',
    'generate_id',
    'read_yaml',
    'write_yaml',
    'read_knowledge_file',
    'write_knowledge_file',
    'list_knowledge_files',
    'get_file_age_days',

    # Templates
    'KnowledgeTemplate',
    'SkillTemplate',
    'RuleTemplate',
    'PatternTemplate',
    'DomainTemplate',
    'UserTemplate',
    'LessonTemplate',
    'create_template',
    'get_example_content',

    # Value assessment
    'ValueAssessor',

    # Knowledge management
    'KnowledgeManager',

    # AI Knowledge Taxonomy
    'KnowledgeCategory',
    'TaxonomyNode',
    'AIBlindSpotsTaxonomy',
    'AICommonSenseTaxonomy',
    'classify_knowledge_boundaries',

    # Worthiness Filter
    'WorthinessDecision',
    'ConversationQualityImpact',
    'WorthinessFilter',
    'should_store_knowledge',
    'get_worthiness_score',
    'explain_worthiness',

    # Import/Export
    'export_knowledge_pack',
    'export_to_directory',
    'get_export_preview',
    'import_knowledge_pack',
    'resolve_conflicts_batch',
]

__version__ = '1.0.0'
__author__ = 'ThinkBank Contributors'
