Initial commit: yu-zhi-ran platform with automation integration

This commit is contained in:
lt
2026-04-19 14:05:09 +08:00
commit 3cb2df51c8
209 changed files with 80379 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
#!/bin/bash
echo "Testing API:"
echo "1. List packages for A01:"
curl -s "http://localhost:8000/api/publisher/packages/A01" | python3 -m json.tool
echo ""
echo "2. Get package HTML for 知乎:"
curl -s "http://localhost:8000/api/publisher/package/A01/知乎" | python3 -c "import sys, json; data=json.load(sys.stdin); print('HTML length:', len(data.get('html',0)))" 2>&1
echo ""
echo "3. Get package HTML for 小红书:"
curl -s "http://localhost:8000/api/publisher/package/A01/小红书" | python3 -c "import sys, json; data=json.load(sys.stdin); print('HTML length:', len(data.get('html',0)))" 2>&1
+34
View File
@@ -0,0 +1,34 @@
#!/usr/bin/env python3
"""测试完整流水线(A05选题)"""
import sys, subprocess, json
from pathlib import Path
PROJECT_ROOT = Path('/root/.openclaw/workspaces/yzr-yxl/projects/yu-zhi-ran')
sys.path.insert(0, str(PROJECT_ROOT))
def run(cmd):
print(f"\n▶️ {' '.join(cmd)}")
result = subprocess.run(cmd, cwd=str(PROJECT_ROOT), capture_output=True, text=True, timeout=300)
if result.returncode != 0:
print(f"❌ 失败: {result.stderr}")
return False
print(f"✅ 完成: {result.stdout.strip()}")
return True
def main():
topic_id = "A05"
steps = [
["python3", "scripts/research.py", "--topic-id", topic_id],
["python3", "scripts/outline.py", "--topic-id", topic_id],
["python3", "scripts/writer.py", "--topic-id", topic_id]
]
for step in steps:
if not run(step):
print(f"\n❌ 流水线在步骤 {step} 中断")
return 1
print("\n✅ 全流程测试成功!")
return 0
if __name__ == "__main__":
sys.exit(main())
+17
View File
@@ -0,0 +1,17 @@
#!/bin/bash
set -e
cd /root/.openclaw/workspaces/yzr-yxl/projects/yu-zhi-ran
echo "=== 测试研究阶段 ==="
python3 scripts/research.py --topic-id A05
echo ""
echo "=== 测试大纲阶段 ==="
python3 scripts/outline.py --topic-id A05
echo ""
echo "=== 测试撰写阶段 ==="
python3 scripts/writer.py --topic-id A05
echo ""
echo "=== 全流程测试完成 ==="
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
cd /root/.openclaw/workspaces/yzr-yxl/projects/yu-zhi-ran
python3 scripts/publisher.py --topic-id A01
+6
View File
@@ -0,0 +1,6 @@
#!/usr/bin/env python3
import sys
sys.path.insert(0, '/root/.openclaw/workspaces/yzr-yxl/projects/yu-zhi-ran/platform/backend')
from app.core.generator import run_creator
result = run_creator('A05')
print('RESULT:', result)
+16
View File
@@ -0,0 +1,16 @@
#!/bin/bash
set -e
cd /root/.openclaw/workspaces/yzr-yxl/projects/yu-zhi-ran
if [ "$1" == "publisher" ]; then
echo "=== Testing publisher ==="
python3 scripts/publisher.py
echo "=== Publisher exit code: $? ==="
elif [ "$1" == "creator" ]; then
echo "=== Testing creator ==="
python3 scripts/creator.py
echo "=== Creator exit code: $? ==="
else
echo "=== Testing collector ==="
python3 scripts/collector.py
echo "=== Collector exit code: $? ==="
fi
+12
View File
@@ -0,0 +1,12 @@
#!/bin/bash
set -e
cd /root/.openclaw/workspaces/yzr-yxl/projects/yu-zhi-ran
echo "=== 测试小红书真实发布(A01==="
node /root/.openclaw/workspaces/agent-lt/scripts/xhs-article-publisher.js \
"远程工作2026中国指南:从'不可能'到'可行'的路径图" \
"automation/temp/xhs/A01_content.md" \
"content/images/default-cover.png" \
"未来工作方式" "可持续生活" "全球案例"
echo "Exit code: $?"