{
"event": "PreToolUse",
"tool_name": "Read",
"tool_input": {
"file_path": "\/var\/www\/scripts\/pipeline\/pipeline.py",
"offset": 330,
"limit": 70
}
}
{
"tool_response": {
"type": "text",
"file": {
"filePath": "\/var\/www\/scripts\/pipeline\/pipeline.py",
"content": " db.connect()\n\n try:\n if args.command == \"scan\":\n run_scan()\n\n elif args.command == \"process\":\n process_queue()\n\n elif args.command == \"embed\":\n embed_step = EmbeddingStep(db)\n count = embed_step.embed_pending()\n print(f\"Embedded {count} chunks\")\n\n elif args.command == \"all\":\n run_full_pipeline(run_id=args.run_id, pipeline_id=args.pipeline_id)\n\n elif args.command == \"file\":\n if not args.file_path:\n print(\"Error: file command requires a file path\")\n return\n if os.path.exists(args.file_path):\n result = process_file(args.file_path)\n success = result[0] if isinstance(result, tuple) else result\n print(f\"Processing {'successful' if success else 'failed'}\")\n else:\n print(f\"File not found: {args.file_path}\")\n\n elif args.command == \"status\":\n # Show pipeline status\n cursor = db.execute(\n \"\"\"SELECT status, COUNT(*) as count\n FROM pipeline_queue\n GROUP BY status\"\"\"\n )\n results = cursor.fetchall()\n cursor.close()\n\n print(\"\\nQueue Status:\")\n for r in results:\n print(f\" {r['status']}: {r['count']}\")\n\n cursor = db.execute(\"SELECT COUNT(*) as count FROM documents\")\n doc_count = cursor.fetchone()[\"count\"]\n cursor.close()\n\n cursor = db.execute(\"SELECT COUNT(*) as count FROM chunks\")\n chunk_count = cursor.fetchone()[\"count\"]\n cursor.close()\n\n cursor = db.execute(\"SELECT COUNT(*) as count FROM chunks WHERE qdrant_id IS NOT NULL\")\n embedded_count = cursor.fetchone()[\"count\"]\n cursor.close()\n\n print(f\"\\nDocuments: {doc_count}\")\n print(f\"Chunks: {chunk_count} ({embedded_count} embedded)\")\n\n except Exception as e:\n db.log(\"ERROR\", f\"Pipeline error: {e}\")\n print(f\"Error: {e}\")\n raise\n finally:\n db.disconnect()\n\n\nif __name__ == \"__main__\":\n main()\n",
"numLines": 68,
"startLine": 330,
"totalLines": 397
}
}
}