"""
Task: task00002-260207-08.30
작업: NotebookLM 노트북 소스 조회 테스트 (notebook_get API)
"""
import asyncio
import sys
import os

source_path = r"C:\Users\drumb\.gemini\antigravity\scratch\autoAIagent\notebooklm-mcp-source\src"
if source_path not in sys.path:
    sys.path.append(source_path)

from notebooklm_mcp.server import notebook_get

async def main():
    try:
        res = notebook_get.fn(notebook_id='f78b6285-b938-4ae3-bc12-c643f8603abc')
        if asyncio.iscoroutine(res):
            res = await res
        
        if isinstance(res, dict) and res.get("status") == "success":
            nb_data = res.get("notebook", [])
            if nb_data and isinstance(nb_data, list):
                notebook = nb_data[0]
                if isinstance(notebook, list) and len(notebook) > 2:
                    sources = notebook[2]
                    print(f"SOURCE_COUNT:{len(sources)}")
                    for i, src in enumerate(sources):
                         print(f"SRC_INDEX_{i}:{src}")
        else:
            print(f"ERROR: {res}")
            
    except Exception as e:
        print(f"EXCEPTION:{str(e)}")

if __name__ == "__main__":
    asyncio.run(main())
