Commit Graph

19 Commits

Author SHA1 Message Date
yu
8414c4f355 feat: 平台标记单一源 PLATFORM_GROUPS + catalog 重生成 platformTag 生效
迁移前置项(指南五件小事 #1 + 第 0 步作业 #2):
- register-all.ts 新增 PLATFORM_GROUPS 单一权威表(33 域全标 win32,darwin/linux 仅类型占位)
- registerAll 逐域加载时把平台默认值落进 meta.platforms(能力显式声明优先);
  新增 buildDomainPlatformMap 供构建脚本与运行时共用同一张表
- build-catalog.mjs 删除 WIN32_GROUPS 硬编码,platformTag 从包内分组表派生(改 tsx 运行)
- 守卫测试 platform-groups.test.ts:域无缺行 / 不偷填非 win32 数据 / meta 派生一致
- catalog.json 重生成:687 个组件获得 platformTag=win32(此前从未生效)
- 源数据恢复:对面重构删了 shizai-catalog-data.js,从其历史 commit 7bc627c8 恢复到
  temp/catalog-source/(不入库)并作为回退路径
- catalog-overrides 增强 addFields 支持;把此前直接改 catalog.json 的 96 处假必填修正、
  label 修正、Screenlock 字段清理、12 个实现读取但源数据缺失的字段全部沉淀进 overrides,
  重生成后参数审计 A/B 类保持 0/0
2026-11-05 17:53:07 +08:00
yu
dbe98947bc test: captcha 端到端测试图入库,脱离外部路径依赖
- 5 张 PIL 生成的验证码图(共 30KB)入 __fixtures__/captcha
- 测试路径从 D:/office-test2 硬编码改为 import.meta.dirname 仓库内解析
- fresh clone 后 npm test 即可跑全部 12 项(OCR 模型来自 npm 依赖)
2026-11-05 17:31:15 +08:00
yu
5ef797dcc0 feat: 添加算术验证码与字符验证码处理能力
新增算术验证码解析、字符清洗能力及测试文件,注册OCR_CalculationCode和OCR_CommonEnglishNumbersCode两个新能力,补充验证码处理逻辑
2026-11-05 16:48:20 +08:00
yu
902ee0cec4 File_File_Move 目标为已存在目录时自动移入该目录
此前 pathDest 被固定当作完整目标文件路径, 目标填分类目录时
rename(文件->目录)失败, fallback cp 报 ENOTDIR(cannot overwrite
directory with non-directory), 文件整理类流程无法用目录作目标。

现在目标存在且为目录时自动拼接源文件名(移入语义), 目标不存在
仍按完整文件路径处理。

附: 晨间助手全家桶测试流程生成脚本(30节点, 文件整理+记事本
键鼠+Excel加工+OCR/AI)
2026-11-05 16:05:07 +08:00
yu
b59d906161 Merge branch 'main' of http://43.140.215.244:7040/wangyukun/PRA-only-demo 2026-11-05 14:59:32 +08:00
yu
e25121660d 修复点击验证误报与相似元素列表全重复等运行时问题
- 点击可信验证增加两类生效旁证: 页面跳转/新开标签页(淘宝搜索按钮),
  点击后元素整体消失(关闭登录弹窗); 此前均被误报为"目标未收到可信点击"
  并在节点超时内反复重试, 造成"点击生效却等很久还报错"
- 相似元素列表引用增加 index 序号: 动态id泛化后各卡片选择器相同,
  46 条引用全部命中第一张卡导致抓取结果全重复;
  修复 NodeList 无 indexOf 的 TypeError 被静默吞掉导致序号从未写入
- 元素定位改为两段式: 先在当前附着页查找, 找不到才跟随前台标签页,
  避免多标签环境下被无条件切到 pages[0] 导致找错页面
- 新开标签页优先复用启动残留的 about:blank 空白页, 不再堆积空标签
- AI 能力输入识别增加 hint_word 字段(此前提示词读到的是空)
- try_catch 捕获子步骤失败时记录 warn 日志, 不再静默
- Excel 落盘遇 EBUSY(文件被打开占用)时自动另存为带时间戳的文件
- 新增 similar-list.test.ts 端到端回归(46 卡片动态 id 真实浏览器验证)
- 新增 export-last-run.js: 从运行记录导出比价 Excel
2026-11-05 14:57:33 +08:00
yu
9e12431db8 fix: notice dialog topmost - owner form pattern instead of invalid enum value
262144 (Win32 MB_TOPMOST) has no mapping in the .NET MessageBoxOptions enum, whose
only members are RightAlign/RtlReading/ServiceNotification etc., so PowerShell
rejected it: "cannot convert 262144 to MessageBoxOptions" (second failure of the
topmost attempt). Correct documented way is passing a TopMost invisible owner
form as the first argument of MessageBox.Show. Wrapped in try/catch that falls
back to a plain Show, so the dialog can no longer fail the node even if the
owner pattern misbehaves on some machine.
2026-11-05 13:48:49 +08:00
yu
124f11bd6b fix: Dialog_Notice/MsgBox MessageBox options arg - invalid HelpButton value
Previous topmost attempt passed 'HelpButton' in the MessageBoxOptions position of
MessageBox::Show, so PowerShell failed at runtime with "cannot convert value
HelpButton to type System.Windows.Forms.MessageBoxOptions" (reproduced in flow run:
notice node failed at char 196). Now passes the documented MB_TOPMOST flag
(MessageBoxOptions)262144 as the 6th argument, keeping the six-argument overload
(OK / Information / Button1 / topmost).
2026-11-05 13:43:44 +08:00
yu
0db3e59f75 fix: File_DecompressFile misleading "ADM-ZIP: Invalid filename" for missing archive
adm-zip throws "ADM-ZIP: Invalid filename" both for corrupt entries AND when the
archive file simply does not exist, which sent us chasing phantom filename issues.
Now the handler checks file existence first and reports "压缩包不存在:<path>" with a
recommendation pointing out that File_CompressFile appends .zip to the full source
name (a.txt -> a.txt.zip) and that the compress node's output variable should be
used to chain the real artifact path.
2026-11-05 13:40:29 +08:00
yu
624d13f2ef fix: StrUtil_Replace enum mapping - search select value was treated as literal text
Catalog contract: search is a select ("0"=content / "1"=digits / "2"=phone / "3"=email
/ "4"=ID card / "5"=custom regex) with the target in Config. Old implementation used
first(args, ["search","Config"]) so the enum value "0" was split on as literal text,
making content-replace never work (same family as W26-W33 enum mapping bugs).
Now implements all six modes with preset patterns, regex mode guarded by try/catch,
and falls back to legacy literal behavior when Config is empty.
2026-11-05 13:22:43 +08:00
yu
20d224a46b fix: input dialog invisible - replace VB InputBox with topmost WinForms form
Root cause of second failure (120s timeout): VB InputBox has no topmost
flag and no taskbar presence, so it renders BEHIND the main window.
User never sees it, flow waits until node timeout (120000ms).

Fix:
- Dialog_InputBox now builds a WinForms form with TopMost=true,
  ShowInTaskbar=true, CenterScreen, OK/Cancel buttons
- MessageBox notice adds MB_TOPMOST via options param
- Flow updated: 3 sequential InputBox nodes replaced by ONE
  Dialog_GetConfigV7 form (topmost BrowserWindow via host bridge),
  3 fields filled in a single window, wait_time=10min
- Flow node timeout raised to 660s to exceed the 600s PS-level wait
- Fixed latent bug: Time_WeekDay node had empty outputVar, so
  the "星期几" variable never existed
2026-11-05 11:27:01 +08:00
yu
15fcf66972 fix: dialog components killed at 30s, pass proper timeout to powershell
Root cause: Dialog_InputBox and other blocking dialogs wait for user
input, but powershell() default timeout 30000ms kills the still-waiting
dialog process, reporting generic "Command failed" (reproduced: run
failed at 30.08s).

Fix:
- InputBox/Notice default wait 600s, adjustable via wait_time arg
- File dialogs (OpenFile/OpenFiles/SaveFile) wait up to 30min
- InputBox timeout reports dialog_timeout with clear guidance instead
  of misleading command failure
2026-11-05 11:08:41 +08:00
yu
b929f86525 键盘冒烟目标窗口断言改为窗口存在性: Win11 记事本会话恢复致标题漂移 2026-11-04 17:42:14 +08:00
yu
abb3d26acd 元素点击未生效(clicked=false)改为抛错, 按错误契约给出拾取建议 2026-11-04 17:42:14 +08:00
yu
3a9a8b63c2 合并 origin/main: psText 非 ASCII 修复移植到 rpa-core 新结构
- driver/windows 下助手模块新增导出 psText(远端 1c5d981 修复实现)
- WindowsDriver: 旧 psCharLiteral([char] 相加 bug)改为委托 psText;
  窗口查找/激活的错误消息与剪贴板粘贴/SendKeys 内嵌文本统一 psText
- system-extended: 保留 driver 抽象, Clipboard_SetTextV1 走 psText
- window-extended: 取本地 driver 版(远端 findWindow 由 driver 承担)
- src/main/capabilities/desktop.ts 保持删除(已迁移 rpa-core)
- compat-audit.test.ts 迁至 packages/rpa-core/src/capabilities/
2026-11-04 14:51:33 +08:00
yu
b54311d467 阶段4-tool契约: register支持CapabilityMeta(决策8 meta可选+新能力强制), 新增registerAll显式注册入口双入口过渡(决策9), RUNTIME_ERROR_CODES错误码固化+audit校验, 规范v1同步收紧 2026-11-04 13:41:24 +08:00
yu
e691b9fa78 阶段3-driver抽象: powershell助手拆至driver/windows, 五域AutomationDriver接口+WindowsDriver(PowerShell实现行为不变), desktop/window-extended/system-extended/common-final改走driver, catalog构建填充platformTag=win32 2026-11-04 13:28:32 +08:00
yu
3decced268 阶段2-断Electron依赖: human-dialog/window-extended/ai-service经HostBridge迁入包, external+transport迁包(session留宿主), 新增check:deps依赖护栏与包README留守清单 2026-11-04 12:57:41 +08:00
yu
caa8e19332 阶段1-rpa-core建包: engine+31个纯Node能力迁入packages/rpa-core, 领域类型单一源化, createEngine工厂收拢模块级状态
- engine/(registry/types/runtime/expression)物理迁入包, 解耦shared/types(域类型归包, 宿主type-only re-export)
- 31个纯Node能力+27个测试迁入包; 宿主留守Electron/浏览器/AI依赖能力, index.ts经@rpa/core/capabilities拉起
- 新增createEngine()/defaultEngine: excel缓存/Excel句柄/db连接/FTP客户端/OCR实例/拟真设置挂引擎实例
- remaining-core子流程依赖改为host-bridge注入, 包内不再import宿主flows
- 宿主main/index.ts启动时注入子流程源; electron-vite/vitest/tsconfig配@rpa/core源码别名
- 验证: typecheck绿, 快照909个id diff为零, 332测试过(2个桌面冒烟因会话无交互SetForegroundWindow被拒, 环境阻塞)
2026-11-04 12:36:03 +08:00