Commit Graph

44 Commits

Author SHA1 Message Date
abe02f26cf 提交完善
All checks were successful
Publish Python Package to Gitea / publish (push) Successful in 17s
2026-05-28 18:20:49 +08:00
ea25fc2638 修改打包方式
All checks were successful
Publish Python Package to Gitea / publish (push) Successful in 1m2s
2026-05-28 16:49:30 +08:00
43ec2d66a3 feat(screencast): 自动激活窗口 / 多显示器 / 字幕独立时长
基于 SDK 新模块(前两个 commit)的 screencast 工具能力升级:

- runner.py:
  · 新增 activate_window: bool = True 参数,录屏前自动调
    activate_and_maximize_jiangchang_window,避免开头几秒录到 PowerShell/桌面
  · 新增 monitor_index: Optional[int] = None 参数,透传给 ScreenRecorder
  · 自带 SDK 路径兜底 _ensure_sdk_on_path,让 record_screencast.py 直接 python
    跑时(不走 pytest conftest)也能 import jiangchang_desktop_sdk.window_win32

- recorder.py:
  · ScreenRecorder.__init__ 加 monitor_index 参数
  · _capture_loop 用 idx 选 monitor,越界兜底到 0
  · None = 旧行为(monitors[0] 所有屏合并),1 = 主屏,2+ = 第 N 屏
  · 多显示器场景推荐显式传 monitor_index=1 避免录出半边空白

- subtitle.py:
  · SubtitleEngine.process_line 支持二元组(兼容旧脚本)和三元组(每条独立 duration)
  · 长等待场景可以让某条字幕停留更久(如 30s)覆盖中间无日志的"字幕真空"

所有改动向后兼容,全部新增参数有默认值。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-25 11:14:11 +08:00
311441dab0 feat(sdk): 新增 e2e_helpers 共享模块,沉淀 desktop E2E 通用能力
把 disburse-payroll-icbc 实战出来的 6 个 desktop E2E 通用 helper 抽到
src/jiangchang_desktop_sdk/e2e_helpers.py,所有 skill 共用:

- drop_file_into_composer: DataTransfer 拖拽附件(绕开 SDK send_file
  在 v2.0.17+ 抛 NotImplementedError 的限制)
- wait_for_attachment_ready: 轮询附件 chip 出现
- wait_for_composer_enabled: 等输入框可见且非 disabled,避免 canSend=false 静默 no-op
- send_prompt_via_composer: fill + press_sequentially + Enter 发送
- wait_for_user_message: 60s 宽容找 user 节点(绕开 SDK ask() user_idx<0
  15s 死循环 bug,对脏 session 鲁棒)
- wait_for_agent_complete: 4 信号合流等 agent 完成
  (chat-page data-sending / window.__jc_sending / 无展开 execution-graph /
  末位 assistant has-body 且非 streaming + 文本稳定)

不抽业务断言(normalize_money / assert_zero_failures),那些是各 skill 自己的事。

所有 helper 只接受 Playwright Page 入口,不依赖 SDK client 实例。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-25 11:13:47 +08:00
6e3f79dde9 feat(sdk): 抽出 window_win32 共享模块,client 激活方法薄壳化
把 _activate_and_maximize_windows 内嵌的 50+ 行 ctypes 实现抽到独立的 SDK 子模块
src/jiangchang_desktop_sdk/window_win32.py,暴露公开函数
activate_and_maximize_jiangchang_window,给 screencast 工具也复用(见后续 commit)。

client.py 的 _activate_and_maximize_windows 退化为 6 行薄壳,调用新模块。

设计:
- window_win32 是 SDK 子模块(放 src/jiangchang_desktop_sdk/ 下),不放 tools/,
  避免 SDK 反向依赖工具层
- ctypes EnumWindows + ShowWindow(SW_MAXIMIZE) + SetForegroundWindow 逻辑不变
- 跨平台行为不变:Windows 真执行,其他系统返回 False
- bring_to_front 调用方完全不感知变化(向后兼容)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-25 11:13:27 +08:00
ffb64b2cfc feat(screencast): 统一字幕样式 / 修字幕重叠 / 修子进程乱码
- composer.py:抽出 _JIANGCHANG_SUBTITLE_STYLE 常量,FontSize 28→14 /
  Outline 2→2(保持),1080p 屏幕约占 1.3% 高度,演示视频留足画面呼吸感
- subtitle.py:generate_srt 加 post-process 排队,相邻字幕互相让位
  (MIN_DURATION=1.0s / GAP=0.1s),任意时刻屏幕上最多 1 条字幕,
  避免开头几秒密集触发的字幕叠成两行
- runner.py:subprocess.Popen 注入 PYTHONIOENCODING=utf-8 + PYTHONUTF8=1,
  让 Windows 子进程 Python 强制 UTF-8 输出,runner 端 UTF-8 解码即对齐,
  修中文乱码

所有 skill 录屏受益,向后兼容(非 Windows 系统 UTF-8 注入无副作用)。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-25 10:14:03 +08:00
c8d136fb79 feat(sdk): bring_to_front 用 Win32 API 激活并最大化主窗口
新增 _activate_and_maximize_windows 私有方法:用 ctypes 调 EnumWindows
找匠厂主窗口(标题含 匠厂/Jiangchang/ClawX/OpenClaw),
ShowWindow(SW_MAXIMIZE) + SetForegroundWindow 让窗口铺满桌面。

bring_to_front 改 OS 分支:
- Windows: 优先 ctypes 激活+最大化(dev / 安装版通吃,比 jiangchang://
  协议在 dev 模式下因 cwd 解析失败而报错可靠);失败时退回协议作为兜底
- macOS / Linux: 维持原协议激活路径(open / xdg-open)

适用场景:录屏 / 自动化测试需要 OS 级窗口前置。page.bring_to_front()
只切 Playwright tab 不影响 z-order,必须 OS 级 API 才能把 Electron
主窗口拉到桌面最前。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-25 10:13:43 +08:00
34f9a2c141 docs: Stage 2 SDK data-jcid migration report
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-18 16:05:16 +08:00
4fc4cfb802 refactor(sdk): drop data-jcid, switch to semantic anchors + ClawX testids
- Introduce centralized SELECTOR constant table at top of client.py
- Replace all [data-jcid=...] selectors with:
  * Semantic anchors (data-role / data-message-id / data-streaming /
    data-sending / data-message-count) guarded by jiangchang main repo
  * ClawX upstream data-testids (chat-page / chat-composer-* / etc.)
- _latest_assistant_after: has_body now judged by inner_text non-empty
  (no longer depends on message-body sub-element)
- _gateway_state: degrade to window.__jc_gateway_state__ readback,
  returns 'unknown' until host exposes it
- new_task: rely solely on data-message-count==0 (welcome-screen no
  longer has a testid)
- wait_gateway_ready: degrade to chat-page selector wait
- send_file: raise NotImplementedError (Electron IPC hook missing)

Public API signatures unchanged. window.__jc_sending__ remains the
core sending signal.

Compatibility: jiangchang v2.0.17+ only.
Refs: jiangchang/docs/sdk-migration-discovery.md
      jiangchang/docs/JIANGCHANG_CUSTOM_ANCHORS.md
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-18 16:05:04 +08:00
089f00c3ff feat(tools): add screencast recording engine
Adds tools/screencast/ — a reusable screen-recording pipeline for
skill demo videos. Wraps a pytest desktop E2E run with:
  - ScreenRecorder: mss-based full-screen frame capture (background thread)
  - SubtitleEngine: stdout keyword → timestamped SRT generation
  - compose_video: FFmpeg filter_complex merge (video + subtitles + BGM)
  - run_screencast: main orchestrator wiring all three layers

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-17 20:38:47 +08:00
20294fd23a 新增依赖 2026-05-06 19:33:46 +08:00
f52d7fc352 ci(publish): use repository-level PACKAGE_TOKEN secret
All checks were successful
Publish Python Package to Gitea / publish (push) Successful in 19s
v0.1.0
2026-05-06 18:21:35 +08:00
cff1408d87 ci(publish): use repository-level PACKAGE_TOKEN secret 2026-05-06 18:15:22 +08:00
f55c7bdc52 ci(publish): use auto-injected github.token with explicit permissions 2026-05-06 18:07:10 +08:00
ebdd8b562d ci(publish): align with internal runner conventions (python3.12 + intra-Gitea checkout + cn mirrors)
Some checks failed
Publish Python Package to Gitea / publish (push) Failing after 31s
2026-05-06 17:28:13 +08:00
d2dbb5f61e 重构项目路径
Some checks failed
Publish Python Package to Gitea / publish (push) Failing after 59s
2026-05-06 17:16:09 +08:00
8bbf5084f5 修改打包将test打包进去 2026-05-06 11:47:17 +08:00
b9cd4dacec 优化代码 2026-04-23 11:04:44 +08:00
d6ad90a7db 提交修改 2026-04-22 15:51:37 +08:00
2174b2b573 加入匠厂桌面测试 2026-04-20 13:40:53 +08:00
71a9ab1700 提交修改 2026-04-19 15:35:47 +08:00
ca117cb5ac 提交修改 2026-04-19 15:17:57 +08:00
892cf837a6 调整流水线 2026-04-16 15:06:49 +08:00
a6bbd89350 调整流水线 2026-04-16 13:58:32 +08:00
8778d641ab 调整流水线 2026-04-16 13:46:19 +08:00
5037d83b3d 调整流水线 2026-04-16 13:41:36 +08:00
8154de452b 调整流水线 2026-04-16 13:29:45 +08:00
0bb6707e68 调整流水线 2026-04-16 11:49:06 +08:00
4b15c6d99c ci: sync readme_md and description from references/README.md with SKILL.md fallback
Made-with: Cursor
2026-04-12 09:10:58 +08:00
4856167682 ci: deploy 用 cp 替代 rsync;同步 contrib 模板;更新产品说明 2026-04-10 13:39:54 +08:00
c67487ba16 ci: add reusable-release-frontend for static sites (fangzhen) 2026-04-10 13:31:08 +08:00
69702f8ea2 ci: add reusable-release-frontend for static sites (fangzhen) 2026-04-10 12:04:51 +08:00
60b4f7a77f release: python-runtime README, runtime_env sdk v1.0.3 2026-04-08 14:01:23 +08:00
7ac6e39ff9 release: python-runtime, runtime_env sync, docs v1.0.2 2026-04-08 12:06:14 +08:00
9926eb04cb chore: get_sibling_skills_root prefer co-located inference over env
Made-with: Cursor
2026-04-07 10:37:36 +08:00
4c2b1b634c feat: release ZIP keeps scripts/ tree; JIANGCHANG_SKILLS_ROOT and sibling skills root v1.0.1 2026-04-06 18:37:54 +08:00
c8fc7dcccb ci: recursive PyArmor for scripts/ and copy references/assets; release.ps1 preflight check
Made-with: Cursor
2026-04-06 14:01:44 +08:00
312e7ede63 ci: use domestic PyPI mirrors for PyArmor cross-platform pip installs
Made-with: Cursor
2026-04-06 13:15:56 +08:00
7fdd481c60 ci: optional PYARMOR_REG_B64 secret for multi-script obfuscation
Made-with: Cursor
2026-04-05 09:28:51 +08:00
3ee09bbd73 fix(ci): pin PyArmor 8.5.3 and obfuscate scripts one file per gen
Made-with: Cursor
2026-04-05 09:22:11 +08:00
9230ce64e9 chore: sync from OpenClaw workspace (2026-04-05 09:17) 2026-04-05 09:17:32 +08:00
ea294472cb fix(ci): pin PyArmor to 8.5.3 in reusable skill release
Made-with: Cursor
2026-04-05 09:11:10 +08:00
c4521dc4b2 feat: centralize release script and simplify workflow input
Move release.ps1 into the platform kit as the shared source of truth and remove include_readme_md input so all skills always publish readme_md by default.
2026-03-30 19:23:10 +08:00
117d31298e feat: add jiangchang platform kit skeleton
Add a shared SDK scaffold for entitlement checks and a reusable Gitea release workflow template to standardize skill packaging and publishing across projects.
2026-03-30 18:49:29 +08:00