import json, os
B = os.path.dirname(os.path.abspath(__file__))

def load(n):
    p = os.path.join(B, n)
    if not os.path.exists(p):
        return None
    with open(p, encoding='utf-8') as f:
        return json.load(f)

c = load('mcp_customers.json') or {}
print('mcp_customers updated_at:', c.get('updated_at'), 'n=', len(c.get('customers') or []))

o = load('mcp_orders_input.json')
if isinstance(o, dict):
    ords = o.get('orders') or o.get('items') or []
    print('orders dict keys:', list(o.keys())[:10], 'updated:', o.get('updated') or o.get('updated_at'))
else:
    ords = o or []
    print('orders is list')
print('orders n=', len(ords))
if ords:
    print('order sample keys:', list(ords[0].keys())[:20])

a = load('activities_feishu.json') or {}
print('activities_feishu total:', a.get('total'), 'generated:', a.get('generated'), 'months:', a.get('months'))

d = load('daily_activities_mcp.json') or {}
print('daily_activities total:', d.get('total'), 'updated:', d.get('updated'))

p = os.path.join(B, 'workbench_data.json')
if os.path.exists(p):
    w = load('workbench_data.json') or {}
    print('workbench keys:', list(w.keys())[:25])
    print('merged_at:', w.get('_merged_at'), 'size MB: %.2f' % (os.path.getsize(p) / 1048576.0))
else:
    print('workbench_data.json missing')
