Skip to content

PRINTFILM: AI short-video marketing and AI short-drama creation platform

chore: stop tracking .cursor and .claude

yi6f6207027e7c
diff --git a/.cursor/rules/coding-standards.mdc b/.cursor/rules/coding-standards.mdc
deleted file mode 100644
index b0a41cc..0000000
--- a/.cursor/rules/coding-standards.mdc
+++ /dev/null
@@ -1,21 +0,0 @@
----
-description: PRINTFILM 全局规范入口;改代码前遵循 docs/STANDARDS.md
-alwaysApply: true
----
-
-# 全局规范
-
-编写或修改本仓库代码、文档、发布相关内容时,必须遵守:
-
-**[docs/STANDARDS.md](../../docs/STANDARDS.md)**
-
-重点摘要:
-
-- 函数 / 组件 / Hook 顶部要有功能注释;成组变量用块注释说明
-- 单文件尽量不超过 500 行;公共逻辑抽到 `lib/` / `services/` / `components/`
-- 用户端样式跟 `pf-*` + `printfilm.css`;管理端优先 Tailwind + shadcn
-- 列表筛选与分页走服务端
-- 密钥与 `deploy_kepu.py` 不上库;发布走机器部署并写 `docs/releases/`
-- 易支付生产回调勿含 `/api/`(用 `/epay/notify`)
-
-细则、目录分层与发版自检清单以 `docs/STANDARDS.md` 全文为准。
diff --git a/.cursor/skills/kepu-batch-opensource/SKILL.md b/.cursor/skills/kepu-batch-opensource/SKILL.md
deleted file mode 100644
index fe1eed3..0000000
--- a/.cursor/skills/kepu-batch-opensource/SKILL.md
+++ /dev/null
@@ -1,111 +0,0 @@
----
-name: kepu-batch-opensource
-description: >-
- Batch create PRINTFILM/kepu open-source科普 videos from WeChat articles + GitCC
- repos: scrape 公众号正文, write source_type=script口播 (no URLs), diversify
- template/ratio/voice, SSH-submit to prod, confirm storyboards, continue full
- pipeline. Use when user asks to 批量提交开源项目、抓公众号生成口播、确认分镜开始生成、
- kepu.printfilm.com demo 批量任务, or redo bad source_text from article text.
----
-
-# Kepu 开源科普批量成片
-
-线上:`https://kepu.printfilm.com/` · 账号:`[email protected]` / `demo1234`
-API 变更优先走 **SSH → 服务器 `http://127.0.0.1:8000`**(外网 SSL 常不稳定)。
-
-工作目录约定:本地产物放 `.tmp/`(已 gitignore),勿提交 token / JSON / 日志。
-
-## 何时用
-
-- 用户给出一批「标题 + GitCC + 可选公众号链接」要做成片
-- 要求「先抓公众号再写 source_text」或纠正错误口播后重提
-- 「确认所有分镜 / 继续生成」整批续跑
-
-## 流程清单
-
-```
-Task Progress:
-- [ ] 1. 解析清单(repo / article / 约束)
-- [ ] 2. 浏览器抓公众号正文(必做;删文则 GitCC README)
-- [ ] 3. 写 .tmp/scripts_YYYYMMDD.json(script + 多样性)
-- [ ] 4. base64 SSH 上传并创建+首次 generate(到 SCRIPT_READY)
-- [ ] 5. ascii() 校验标题/口播 UTF-8
-- [ ] 6. SCRIPT_READY 后二次 generate(成片)
-- [ ] 7. 汇报 studio 链接表
-```
-
-### 1. 解析清单
-
-每条至少:`title_hint`、`repo`、可选 `article`(mp.weixin.qq.com)。
-默认:`source_type=script`、`pipeline_mode=full`、`resolution_mode=preview`。
-用户指定「只到分镜」则停在步骤 4,勿执行步骤 6。
-
-### 2. 抓公众号(硬约束)
-
-1. 用 **cursor-ide-browser**:`browser_navigate` → `browser_lock` → 等正文 → CDP `document.body.innerText` 或 snapshot。
-2. 写入 `.tmp/wechat-YYYYMMDD.md`(标题、要点、功能、场景)。
-3. **禁止**仅凭标题/简介编功能细节当正文。
-4. 公众号「已删除」→ 抓 GitCC README(公开页);仍无文则标 `source=user_brief`,口播只展开用户原句,并在汇报里标明。
-5. 私仓需登录时不要硬登;改用用户文案或请用户补链接。
-
-### 3. 写口播 JSON
-
-路径:`.tmp/scripts_YYYYMMDD.json`,UTF-8 数组。字段:
-
-| 字段 | 说明 |
-|------|------|
-| `title` | 中文短标题 |
-| `source_text` | 完整口播,3 段左右,**禁止** URL / 域名 / 端口 / `http` |
-| `template_id` | 每条尽量不同,见 [reference.md](reference.md) |
-| `output_ratio` | 在 `16:9` / `9:16` 间打散 |
-| `voice_id` | 在 5 个 openspeech 音色间打散 |
-| `pipeline_mode` | 默认 `full` |
-| `repo` / `article` | 溯源用,不进口播 |
-
-口播结构:痛点/风口 → 核心能力(来自正文)→ 场景与开源价值。
-
-### 4. 提交(拆分镜)
-
-```bash
-python .cursor/skills/kepu-batch-opensource/scripts/batch_submit.py .tmp/scripts_YYYYMMDD.json
-```
-
-脚本会:读 SSH 凭据(见下)→ base64 上传 JSON → demo 登录 → `POST /api/projects` → `POST .../generate` → 写 `.tmp/submit-results.json`。
-
-凭据(勿写入 skill / 勿提交):
-
-1. 环境变量 `KEPU_SSH_HOST` / `KEPU_SSH_USER` / `KEPU_SSH_PASSWORD`
-2. 或已 gitignore 的 `deploy/scripts/deploy_kepu.py` 中 `HOST`/`USER`/`PASSWORD`
-
-### 5. UTF-8 校验
-
-在服务器对新建 project:`ascii(title)` + `source_text[:20]`。乱码则 cancel+delete 后用 base64 重传,勿用可能损坏编码的 scp/echo。
-
-### 6. 确认分镜并成片
-
-分镜齐后(`SCRIPT_READY` 且 `shots>0`):
-
-```bash
-python .cursor/skills/kepu-batch-opensource/scripts/batch_confirm_continue.py --ids 49-58
-# 或 --from-results .tmp/submit-results.json
-```
-
-等价 API:对每个 `SCRIPT_READY` 再 `POST /api/projects/{id}/generate` → 进入 `IMAGING`…
-进行中(`SCRIPTING`/`IMAGING`/…)勿重复点,会 409。
-
-重做整批:先 `POST .../cancel`(可忽略失败)再 `DELETE`,再提交。
-
-### 7. 汇报
-
-表格:`# | id | title | template | ratio | voice | shots | status | studio URL`。
-注明哪些口播来自公众号 / README / 用户简介。
-
-## 运维注意
-
-- 生产前端构建:`VITE_API_BASE` 必须为空(同源),禁止把本地 `.env` 打进 dist。
-- Celery 需听 `-Q pipeline,oss`(异步 OSS 上传)。
-- 勿 commit `.tmp/`、token、含密码的 deploy 脚本。
-
-## 详细参考
-
-- 模板 / 音色 / API / 状态机:[reference.md](reference.md)
diff --git a/.cursor/skills/kepu-batch-opensource/reference.md b/.cursor/skills/kepu-batch-opensource/reference.md
deleted file mode 100644
index bed2a3a..0000000
--- a/.cursor/skills/kepu-batch-opensource/reference.md
+++ /dev/null
@@ -1,69 +0,0 @@
-# Kepu batch — reference
-
-## Endpoints(localhost on prod)
-
-| Method | Path | 用途 |
-|--------|------|------|
-| POST | `/api/auth/login` | `{"email","password"}` → `access_token` |
-| POST | `/api/projects` | 创建;`source_type=script` |
-| PATCH | `/api/projects/{id}` | 补 `output_ratio` / `voice_id` / `pipeline_mode` |
-| GET | `/api/projects/{id}` | 状态、`shots`、`source_text` |
-| POST | `/api/projects/{id}/generate` | 首次→拆分镜;`SCRIPT_READY` 再调→成片 |
-| POST | `/api/projects/{id}/cancel` | 取消进行中 |
-| DELETE | `/api/projects/{id}` | 删除 |
-
-Create body 关键字段:`template_id`, `title`, `source_type`, `source_text`, `resolution_mode`, `pipeline_mode`, `output_ratio`, `voice_id`。
-
-## Status
-
-`DRAFT` → `SCRIPTING` → `SCRIPT_READY` → `IMAGING` → `VIDEOING` / `AUDIOING` → `COMPOSING` → `DONE`
-失败/取消:`FAILED` / `CANCELLED`。忙碌态勿重复 generate。
-
-## Templates(`backend/app/services/templates_seed.py`)
-
-多样打散优先非重复;开源向优先 `opensource_live_work`(真人工作场景),也可混用:
-
-`opensource_live_work`, `opensource_showcase`, `live_product_desk`, `live_street_interview`, `live_cinematic`, `live_person`, `photo_realism`, `portrait_story`, `film_cinematic`, `noir_thriller`, `vox_papercut`, `docu_warm`, `kids_flat`, `soft_anime`, `chalk_whiteboard`, `cyber_neon`, `epic_fantasy`, `magazine_collage`, `brand_clean`, `pixel_retro`, `retro_vhs`, `ink_guofeng`
-
-## Voices(`backend/app/services/voices.py`)
-
-| voice_id | 标签 |
-|----------|------|
-| `zh_female_cancan_uranus_bigtts` | 灿灿 · 女声旁白 |
-| `zh_female_tianmeixiaoyuan_uranus_bigtts` | 甜美女声 · 故事 |
-| `zh_female_shuangkuaisisi_uranus_bigtts` | 爽快女声 · 都市 |
-| `zh_female_vv_uranus_bigtts` | Vivi · 国风女声 |
-| `zh_male_shaonianzixin_uranus_bigtts` | 少年梓辛 · 男声 |
-
-## scripts JSON 示例
-
-```json
-[
- {
- "repo": "https://www.gitcc.com/org/repo",
- "article": "https://mp.weixin.qq.com/s/xxxx",
- "template_id": "cyber_neon",
- "output_ratio": "16:9",
- "voice_id": "zh_male_shaonianzixin_uranus_bigtts",
- "pipeline_mode": "full",
- "title": "示例标题",
- "source_text": "第一段痛点。\n\n第二段能力(来自公众号)。\n\n第三段场景与开源价值。"
- }
-]
-```
-
-## SSH 传输
-
-中文 JSON **必须** base64 整文件写远端,例如:
-
-```python
-open("/tmp/scripts.json","wb").write(base64.b64decode(b64))
-```
-
-本地控制台乱码不代表库坏;以远端 `ascii(title)` 为准。
-
-## 凭据
-
-- Demo:`[email protected]` / `demo1234`
-- SSH:环境变量或 `deploy/scripts/deploy_kepu.py`(该文件已 gitignore)
-- 公开站:`https://kepu.printfilm.com/studio/{id}`
diff --git a/.cursor/skills/kepu-batch-opensource/scripts/_kepu_ssh.py b/.cursor/skills/kepu-batch-opensource/scripts/_kepu_ssh.py
deleted file mode 100644
index fcd782e..0000000
--- a/.cursor/skills/kepu-batch-opensource/scripts/_kepu_ssh.py
+++ /dev/null
@@ -1,68 +0,0 @@
-# -*- coding: utf-8 -*-
-"""SSH helpers for kepu.printfilm.com batch jobs."""
-from __future__ import annotations
-
-import base64
-import os
-import re
-from pathlib import Path
-
-import paramiko
-
-REPO_ROOT = Path(__file__).resolve().parents[4]
-DEPLOY_KEPU = REPO_ROOT / "deploy" / "scripts" / "deploy_kepu.py"
-DEFAULT_API = "http://127.0.0.1:8000"
-DEMO_EMAIL = "[email protected]"
-DEMO_PASSWORD = "demo1234"
-
-
-def load_ssh_creds() -> tuple[str, str, str]:
- host = os.environ.get("KEPU_SSH_HOST", "").strip()
- user = os.environ.get("KEPU_SSH_USER", "").strip()
- password = os.environ.get("KEPU_SSH_PASSWORD", "").strip()
- if host and user and password:
- return host, user, password
- if not DEPLOY_KEPU.is_file():
- raise FileNotFoundError(
- "Set KEPU_SSH_HOST/USER/PASSWORD or provide deploy/scripts/deploy_kepu.py"
- )
- text = DEPLOY_KEPU.read_text(encoding="utf-8", errors="replace")
-
- def grab(name: str) -> str:
- m = re.search(rf'^{name}\s*=\s*([\'"])(.*?)\1', text, re.M)
- if not m:
- raise ValueError(f"{name} not found in {DEPLOY_KEPU}")
- return m.group(2)
-
- return grab("HOST"), grab("USER"), grab("PASSWORD")
-
-
-def connect() -> paramiko.SSHClient:
- host, user, password = load_ssh_creds()
- ssh = paramiko.SSHClient()
- ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
- ssh.connect(host, username=user, password=password, timeout=30)
- return ssh
-
-
-def run(ssh: paramiko.SSHClient, cmd: str, timeout: int = 120) -> tuple[str, str]:
- _i, o, e = ssh.exec_command(cmd, timeout=timeout)
- return o.read().decode("utf-8", "replace"), e.read().decode("utf-8", "replace")
-
-
-def put_bytes(ssh: paramiko.SSHClient, remote_path: str, data: bytes) -> None:
- b64 = base64.b64encode(data).decode("ascii")
- py = (
- "python3 - <<'PY'\n"
- "import base64\n"
- f"open({remote_path!r},'wb').write(base64.b64decode({b64!r}))\n"
- f"print('wrote', {remote_path!r}, len(open({remote_path!r},'rb').read()))\n"
- "PY"
- )
- out, err = run(ssh, py, timeout=180)
- if "wrote" not in out:
- raise RuntimeError(f"put_bytes failed: {out}\n{err}")
-
-
-def put_text(ssh: paramiko.SSHClient, remote_path: str, text: str) -> None:
- put_bytes(ssh, remote_path, text.encode("utf-8"))
diff --git a/.cursor/skills/kepu-batch-opensource/scripts/batch_confirm_continue.py b/.cursor/skills/kepu-batch-opensource/scripts/batch_confirm_continue.py
deleted file mode 100644
index 60f1bfd..0000000
--- a/.cursor/skills/kepu-batch-opensource/scripts/batch_confirm_continue.py
+++ /dev/null
@@ -1,161 +0,0 @@
-# -*- coding: utf-8 -*-
-"""Wait until SCRIPT_READY then continue full pipeline for project ids.
-
-Usage:
- python batch_confirm_continue.py --ids 49-58
- python batch_confirm_continue.py --ids 49,50,51
- python batch_confirm_continue.py --from-results .tmp/submit-results.json
-"""
-from __future__ import annotations
-
-import argparse
-import json
-import sys
-import textwrap
-from pathlib import Path
-
-sys.path.insert(0, str(Path(__file__).resolve().parent))
-from _kepu_ssh import DEFAULT_API, DEMO_EMAIL, DEMO_PASSWORD, connect, put_text, run
-
-REMOTE_RUNNER = "/tmp/kepu_batch_confirm_runner.py"
-REMOTE_OUT = "/tmp/kepu_batch_confirm_results.json"
-
-
-def parse_ids(spec: str) -> list[int]:
- ids: list[int] = []
- for part in spec.split(","):
- part = part.strip()
- if not part:
- continue
- if "-" in part:
- a, b = part.split("-", 1)
- ids.extend(range(int(a), int(b) + 1))
- else:
- ids.append(int(part))
- return ids
-
-
-def build_runner(pids: list[int], wait_sec: int) -> str:
- return textwrap.dedent(
- f"""\
- # -*- coding: utf-8 -*-
- import json, time, urllib.request, urllib.error
- BASE = {DEFAULT_API!r}
- PIDS = {pids!r}
- OUT = {REMOTE_OUT!r}
- EMAIL = {DEMO_EMAIL!r}
- PASSWORD = {DEMO_PASSWORD!r}
- WAIT = {wait_sec}
-
- def api(method, path, body=None, token=None, timeout=120):
- data = None
- headers = {{"Accept": "application/json"}}
- if token:
- headers["Authorization"] = "Bearer " + token
- if body is not None:
- data = json.dumps(body, ensure_ascii=False).encode("utf-8")
- headers["Content-Type"] = "application/json; charset=utf-8"
- req = urllib.request.Request(BASE + path, data=data, headers=headers, method=method)
- try:
- with urllib.request.urlopen(req, timeout=timeout) as resp:
- raw = resp.read().decode("utf-8")
- return json.loads(raw) if raw else {{}}
- except urllib.error.HTTPError as e:
- text = e.read().decode("utf-8", "replace")
- raise RuntimeError(f"{{method}} {{path}} -> {{e.code}}: {{text[:500]}}") from e
-
- tok = api("POST", "/api/auth/login", {{"email": EMAIL, "password": PASSWORD}})["access_token"]
- print("login ok", flush=True)
- deadline = time.time() + WAIT
- while time.time() < deadline:
- rows = []
- for pid in PIDS:
- p = api("GET", f"/api/projects/{{pid}}", token=tok)
- rows.append((pid, p.get("status"), len(p.get("shots") or []), p.get("title") or ""))
- scripting = [r for r in rows if r[1] == "SCRIPTING"]
- ready = [r for r in rows if r[1] == "SCRIPT_READY"]
- print(
- "poll ready=%d scripting=%d | %s"
- % (len(ready), len(scripting), " | ".join(f"{{a}}:{{b}}/{{c}}t" for a,b,c,*_ in rows)),
- flush=True,
- )
- if not scripting:
- break
- time.sleep(8)
-
- results = []
- for pid in PIDS:
- p = api("GET", f"/api/projects/{{pid}}", token=tok)
- st = p.get("status")
- title = p.get("title") or ""
- tpl = p.get("template_id")
- shots = len(p.get("shots") or [])
- if st == "SCRIPT_READY":
- try:
- gen = api("POST", f"/api/projects/{{pid}}/generate", token=tok)
- row = {{
- "id": pid, "title": title, "template_id": tpl, "shots": shots,
- "action": "continue", "status": gen.get("status"),
- "url": f"https://kepu.printfilm.com/studio/{{pid}}",
- }}
- print("CONTINUE", pid, title, "->", gen.get("status"), flush=True)
- except Exception as ex:
- row = {{
- "id": pid, "title": title, "template_id": tpl, "shots": shots,
- "action": "error", "status": str(ex),
- "url": f"https://kepu.printfilm.com/studio/{{pid}}",
- }}
- print("FAIL", pid, ex, flush=True)
- else:
- row = {{
- "id": pid, "title": title, "template_id": tpl, "shots": shots,
- "action": "skip", "status": st,
- "url": f"https://kepu.printfilm.com/studio/{{pid}}",
- }}
- print("SKIP", pid, st, "shots=", shots, title, flush=True)
- results.append(row)
- time.sleep(0.4)
-
- open(OUT, "w", encoding="utf-8").write(json.dumps(results, ensure_ascii=False, indent=2))
- print("DONE", OUT, flush=True)
- """
- )
-
-
-def main() -> int:
- ap = argparse.ArgumentParser()
- ap.add_argument("--ids", help="e.g. 49-58 or 49,50,51")
- ap.add_argument("--from-results", type=Path, help="submit-results.json with id fields")
- ap.add_argument("--wait", type=int, default=900, help="max seconds waiting for SCRIPT_READY")
- ap.add_argument("--out", type=Path, default=Path(".tmp/confirm-continue-results.json"))
- args = ap.parse_args()
-
- pids: list[int] = []
- if args.from_results:
- rows = json.loads(args.from_results.read_text(encoding="utf-8"))
- pids = [int(r["id"]) for r in rows]
- if args.ids:
- pids = parse_ids(args.ids)
- if not pids:
- print("provide --ids or --from-results", file=sys.stderr)
- return 2
- print("pids", pids)
-
- ssh = connect()
- try:
- put_text(ssh, REMOTE_RUNNER, build_runner(pids, args.wait))
- out, err = run(ssh, f"python3 {REMOTE_RUNNER}", timeout=args.wait + 120)
- print(out)
- if err.strip():
- print("STDERR", err[-800:], file=sys.stderr)
- out_bytes, _ = run(ssh, f"cat {REMOTE_OUT}", timeout=30)
- args.out.parent.mkdir(parents=True, exist_ok=True)
- args.out.write_text(out_bytes, encoding="utf-8")
- print("saved", args.out)
- finally:
- ssh.close()
- return 0
-
-
-if __name__ == "__main__":
- raise SystemExit(main())
diff --git a/.cursor/skills/kepu-batch-opensource/scripts/batch_submit.py b/.cursor/skills/kepu-batch-opensource/scripts/batch_submit.py
deleted file mode 100644
index a876115..0000000
--- a/.cursor/skills/kepu-batch-opensource/scripts/batch_submit.py
+++ /dev/null
@@ -1,141 +0,0 @@
-# -*- coding: utf-8 -*-
-"""Upload scripts JSON via SSH and create+generate projects on prod localhost API.
-
-Usage:
- python .cursor/skills/kepu-batch-opensource/scripts/batch_submit.py .tmp/scripts.json
-"""
-from __future__ import annotations
-
-import argparse
-import json
-import sys
-import textwrap
-from pathlib import Path
-
-# allow running as script from any cwd
-sys.path.insert(0, str(Path(__file__).resolve().parent))
-from _kepu_ssh import DEFAULT_API, DEMO_EMAIL, DEMO_PASSWORD, connect, put_bytes, put_text, run
-
-REMOTE_SCRIPTS = "/tmp/kepu_batch_scripts.json"
-REMOTE_RUNNER = "/tmp/kepu_batch_submit_runner.py"
-REMOTE_OUT = "/tmp/kepu_batch_submit_results.json"
-
-
-def build_runner() -> str:
- return textwrap.dedent(
- f"""\
- # -*- coding: utf-8 -*-
- import json, time, urllib.request, urllib.error
- BASE = {DEFAULT_API!r}
- SCRIPTS = {REMOTE_SCRIPTS!r}
- OUT = {REMOTE_OUT!r}
- EMAIL = {DEMO_EMAIL!r}
- PASSWORD = {DEMO_PASSWORD!r}
-
- def api(method, path, body=None, token=None, timeout=120):
- data = None
- headers = {{"Accept": "application/json"}}
- if token:
- headers["Authorization"] = "Bearer " + token
- if body is not None:
- data = json.dumps(body, ensure_ascii=False).encode("utf-8")
- headers["Content-Type"] = "application/json; charset=utf-8"
- req = urllib.request.Request(BASE + path, data=data, headers=headers, method=method)
- try:
- with urllib.request.urlopen(req, timeout=timeout) as resp:
- raw = resp.read().decode("utf-8")
- return json.loads(raw) if raw else {{}}
- except urllib.error.HTTPError as e:
- text = e.read().decode("utf-8", "replace")
- raise RuntimeError(f"{{method}} {{path}} -> {{e.code}}: {{text[:800]}}") from e
-
- tok = api("POST", "/api/auth/login", {{"email": EMAIL, "password": PASSWORD}})["access_token"]
- print("login ok", flush=True)
- items = json.load(open(SCRIPTS, encoding="utf-8"))
- print("count", len(items), "title0", items[0].get("title"), flush=True)
- results = []
- for i, it in enumerate(items, 1):
- print(f"=== {{i}}/{{len(items)}} {{it.get('title')}} tpl={{it.get('template_id')}}", flush=True)
- body = {{
- "template_id": it["template_id"],
- "title": it["title"],
- "source_type": "script",
- "source_text": it["source_text"],
- "resolution_mode": it.get("resolution_mode", "preview"),
- "pipeline_mode": it.get("pipeline_mode", "full"),
- "output_ratio": it["output_ratio"],
- "voice_id": it["voice_id"],
- }}
- if it.get("character_prompt"):
- body["character_prompt"] = it["character_prompt"]
- if it.get("extra_prompt"):
- body["extra_prompt"] = it["extra_prompt"]
- p = api("POST", "/api/projects", body, token=tok)
- pid = p["id"]
- patch = {{
- "output_ratio": it["output_ratio"],
- "voice_id": it["voice_id"],
- "pipeline_mode": it.get("pipeline_mode", "full"),
- }}
- if it.get("character_prompt"):
- patch["character_prompt"] = it["character_prompt"]
- if it.get("extra_prompt"):
- patch["extra_prompt"] = it["extra_prompt"]
- api("PATCH", f"/api/projects/{{pid}}", patch, token=tok)
- gen = api("POST", f"/api/projects/{{pid}}/generate", token=tok)
- row = {{
- "id": pid,
- "title": gen.get("title") or it["title"],
- "template_id": gen.get("template_id"),
- "status": gen.get("status"),
- "output_ratio": gen.get("output_ratio"),
- "voice_id": gen.get("voice_id"),
- "url": f"https://kepu.printfilm.com/studio/{{pid}}",
- }}
- results.append(row)
- print(json.dumps(row, ensure_ascii=False), flush=True)
- time.sleep(0.5)
-
- for r in results:
- d = api("GET", f"/api/projects/{{r['id']}}", token=tok)
- print("verify", r["id"], ascii(d.get("title")), d.get("status"),
- ascii((d.get("source_text") or "")[:16]), flush=True)
-
- open(OUT, "w", encoding="utf-8").write(json.dumps(results, ensure_ascii=False, indent=2))
- print("DONE", OUT, flush=True)
- """
- )
-
-
-def main() -> int:
- ap = argparse.ArgumentParser(description="Batch create kepu projects from scripts JSON")
- ap.add_argument("scripts_json", type=Path)
- ap.add_argument("--out", type=Path, default=Path(".tmp/submit-results.json"))
- args = ap.parse_args()
-
- raw = args.scripts_json.read_bytes()
- items = json.loads(raw.decode("utf-8"))
- if not isinstance(items, list) or not items:
- print("scripts json must be a non-empty array", file=sys.stderr)
- return 2
- print("local0", items[0].get("title"), "count", len(items))
-
- ssh = connect()
- try:
- put_bytes(ssh, REMOTE_SCRIPTS, raw)
- put_text(ssh, REMOTE_RUNNER, build_runner())
- out, err = run(ssh, f"python3 {REMOTE_RUNNER}", timeout=600)
- print(out)
- if err.strip():
- print("STDERR", err[-800:], file=sys.stderr)
- out_bytes, _ = run(ssh, f"cat {REMOTE_OUT}", timeout=30)
- args.out.parent.mkdir(parents=True, exist_ok=True)
- args.out.write_text(out_bytes, encoding="utf-8")
- print("saved", args.out)
- finally:
- ssh.close()
- return 0
-
-
-if __name__ == "__main__":
- raise SystemExit(main())
diff --git a/.gitignore b/.gitignore
index c6fb96a..0032bb2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -75,6 +75,7 @@ backend/frontend/
frontend/node_modules/
frontend/dist/
-# Claude / local agent notes (project skills live under .cursor/skills — keep those)
+# 本地 Agent / IDE(不上库)
.claude/
+.cursor/
.work/
diff --git a/docs/STANDARDS.md b/docs/STANDARDS.md
index af1bfd1..671960f 100644
--- a/docs/STANDARDS.md
+++ b/docs/STANDARDS.md
@@ -152,7 +152,7 @@ docs/ 产品与工程文档(本规范所在处)
## 6. Git 与协作
- 提交信息:说明**为什么**,1–2 句;不要纯堆文件列表。
-- 不提交:`.env`、密钥、`deploy/scripts/deploy_kepu.py`、`docs/releases/`、`docs/reports/`、`docs/DEPLOY.md`、`frontend/dist`、`node_modules`、`.venv`。
+- 不提交:`.env`、密钥、`deploy/scripts/deploy_kepu.py`、`.cursor/`、`.claude/`、`docs/releases/`、`docs/reports/`、`docs/DEPLOY.md`、`frontend/dist`、`node_modules`、`.venv`。
- 大功能可拆 commit;与发布相关的文档(规范、发布记录)尽量同批可追溯。
---