Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ec786b3480 | |||
| 11739478d2 | |||
| 7d9aad1672 | |||
| 8ccae17111 | |||
| 04d562745f |
42
CHANGELOG.md
42
CHANGELOG.md
@@ -2,6 +2,48 @@
|
||||
|
||||
本文件对应技能市场 **「更新日志」** Tab。
|
||||
|
||||
## 1.1.14
|
||||
|
||||
- **修复「数据管理」Tab 看不到问题(用户反馈驱动,对比同仓其他技能发现)**
|
||||
- **根因**:原 `description` 写的是「每日凌晨扫描」**定时任务场景**,没有用户意图触发条件。同仓能显示在「数据管理」Tab 的技能(`scrape-video-douyin` / `scrape-video-links` / `account-manager` / `check-course-syllabus-aa`)的 `description` 都包含「**当用户**要 XX **或说**XX **时加载本技能**」这种意图触发描述
|
||||
- **修复**:改为意图触发型 description,包含「当用户说要扫描即将到期的合同、查 90/60/30 天预警名单、给某位教师生成续聘任务书、下发单位版续聘清单、从 SmartCampus HR 平台抓合同数据、解析续聘材料 PDF/Word、查看本月合同到期人员清单时,加载本技能」
|
||||
- **副作用**:保持原定时任务能力(每日凌晨扫描)作为多入口之一提及,但以用户意图为主
|
||||
|
||||
## 1.1.13
|
||||
|
||||
- **修复市场可见性(按 skill-template 模板对齐 SKILL.md frontmatter)**
|
||||
- 移除 v1.1.12 误加的 `access_scope: 0` 字段(**根因**:模板 `skill-template-main/skill-template/SKILL.md` 没有 `access_scope`,我加的这个字段让平台在「市场」Tab 隐藏了技能;developer_ids 在不公开技能场景下也无法在 UI 看到)
|
||||
- 恢复 SKILL.md frontmatter 与 skill-template 完全一致(字段 + 缩进 + brands 列表 5 空格缩进)
|
||||
- 清理 SKILL.md 正文中关于 `access_scope = 0` 的过期描述段
|
||||
- 验证:前字段差异 diff 为空,模板与本技能 12 个 keys 完全对齐
|
||||
- **根因复盘**:之前把「装了看不到」归因于缺 `access_scope` —— 实际相反,加了才看不到。skill-template 不声明 access_scope 是有意的(公开可见优先)
|
||||
|
||||
## 1.1.12
|
||||
|
||||
- **修复市场安装后看不到问题(用户反馈驱动)**
|
||||
- SKILL.md `metadata.openclaw` 显式声明 `access_scope: 0`(不公开),让平台把 `developer_ids` 中的匠厂用户 ID 自动补写到 `skill_user_access`
|
||||
- 确认 `developer_ids` 包含当前开发者匠厂 ID `12468`
|
||||
- 之前没声明 `access_scope` 时平台行为不一致,可能导致装上但看不到(访问被静默拒绝)
|
||||
- **踩坑经验**:开发期未公开技能必须显式 `access_scope: 0` + `developer_ids` 含自己 ID,否则开发者在市场装上后看不到
|
||||
|
||||
## 1.1.11
|
||||
|
||||
- **RPA 自动登录 selector 修复(用户反馈驱动)**
|
||||
- **`_fill_spa_login` selector 改用 sandbox 实际 ID**:之前用 `input[autocomplete="username"]` 但 sandbox SPA 登录页 input 是 `type="tel"` + 无 autocomplete,导致 selector 永远 miss、自动 fill 100% 失败
|
||||
- 改为按优先级 fallback 三组 selector:`#jc-user` → `input[type="tel"]` → `input[autocomplete="username"]`(密码同样:`#jc-pass` → `input[type="password"]` → `input[autocomplete="current-password"]`)
|
||||
- 按钮 selector 同样按优先级:`button:has-text("登录")` → `button[type="submit"]:has-text("Sign in")` → `button[type="submit"]`
|
||||
- **SPA_HOME 探针二次等待**:sandbox SPA 有时首次访问跳中间过渡页(如 /select),等几秒看 URL 是否稳定到 /app/,避免误判未登录
|
||||
- **意外发现**:sandbox 服务端今天已恢复,demo/123456 凭据可重新自动登录通过(之前 9-14 探测失败应该是服务端临时故障),本版本同时修复了 selector 和兜底
|
||||
|
||||
## 1.1.10
|
||||
|
||||
- **RPA 已登录态检测优化(profile cookie 复用零打扰)**
|
||||
- **SPA_HOME 探针时延长等待**:从 `POST_LOGIN_SETTLE_MS=2s` 改为 `SPA_HYDRATION_MS=3s`,sandbox SPA 异步验证 cookie 时间更充分,避免误判未登录
|
||||
- **`_fill_spa_login` 入口先检测 `_is_logged_in`**:已登录态直接 `return True` 跳过自动 fill,不再强制 demo fill 破坏 session
|
||||
- **fill 后再检测 `_is_logged_in`**:避免 sandbox demo 凭据失效时 URL 跳 `/app/home` 但 cookie 没写入的误判
|
||||
- **用户反馈驱动**:用户要求「如果已经登录了不需要用户再登录」—— v1.1.8/v1.1.9 的探针逻辑在 sandbox SPA 异步验证 cookie 时机不准时仍会触发 fallback 手工登录;本次彻底修掉
|
||||
- 实跑(2026-09-14):profile 已登录态下,`collect-from-platform --show-browser --limit 1` **完全静默自动跑**(无 `[登录]` 提示、无弹窗打扰),13 秒抓 3 行 + 卡片 381 字 + 落库
|
||||
|
||||
## 1.1.9
|
||||
|
||||
- **RPA headed 模式改用系统 Edge(解决浏览器弹窗不可见)**
|
||||
|
||||
10
SKILL.md
10
SKILL.md
@@ -1,7 +1,7 @@
|
||||
---
|
||||
name: 合同到期智能预警与续聘辅助
|
||||
description: "每日凌晨扫描全校教职工合同电子台账,对距离到期日 90/60/30 天的合同分级预警,并自动生成《续聘准备任务书》和《本月合同到期人员清单》。"
|
||||
version: 1.1.9
|
||||
description: "当用户说要扫描即将到期的合同、查 90/60/30 天预警名单、给某位教师生成续聘任务书、下发单位版续聘清单、从 SmartCampus HR 平台抓合同数据、解析续聘材料 PDF/Word、查看本月合同到期人员清单时,加载本技能。支持定时扫描(每日凌晨)+ 数据管理 + Agent 三入口,覆盖合同到期智能预警与续聘辅助全流程。"
|
||||
version: 1.1.14
|
||||
author: 深圳匠厂科技有限公司
|
||||
metadata:
|
||||
openclaw:
|
||||
@@ -13,8 +13,9 @@ metadata:
|
||||
- 12345 # 占位,请换成你的匠厂用户 ID
|
||||
- 12468
|
||||
brands: # 可选;未写则发布后仅挂匠厂市场(jiangchang)
|
||||
- jiangchang # 匠厂主站
|
||||
- huashang # 华商等 OEM:按目标市场填写,可多选
|
||||
- jiangchang # 匠厂主站
|
||||
- huashang # 华商等 OEM:按目标市场填写,可多选
|
||||
|
||||
allowed-tools:
|
||||
- bash
|
||||
---
|
||||
@@ -141,7 +142,6 @@ AI 续聘建议(v1.1.1)默认调宿主 `jiangchang_skill_core.llm_manager.ca
|
||||
|
||||
- `metadata.openclaw.developer_ids`:技能发布后的默认开发者可见用户 ID 列表。
|
||||
- 开发期技能常为不公开:不加本人 ID,开发者自己也无法在市场安装自测。
|
||||
- 当 `access_scope = 0`(不公开)时,平台会把 `developer_ids` 中的用户自动补写到 `skill_user_access`。
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -232,33 +232,66 @@ def _fill_spa_login(page, settle_ms: int = SPA_LOGIN_SETTLE_MS) -> bool:
|
||||
返回是否执行了登录(True = 已点登录按钮且 URL 已跳离 login;调用方可继续后续流程)。
|
||||
失败时**不抛异常**,由调用方决定是否 fallback 到 _wait_for_manual_login。
|
||||
|
||||
v1.1.10 关键修复:**先检测 _is_logged_in,已登录态直接 return True 不再 fill**。
|
||||
之前没这个检查,profile 复用时会被强制 demo fill 破坏 session。
|
||||
|
||||
v1.1.11 关键修复:**sandbox SPA 登录 input 实际是 `type="tel"` + 无 autocomplete**,
|
||||
之前 selector `input[autocomplete="username"]` 永远找不到,自动 fill 100% 失败。
|
||||
改用 sandbox 实际 selector `#jc-user` / `#jc-pass`(来自 root 登录页)+ `button[type="submit"]`。
|
||||
|
||||
修复要点(v1.1.5/v1.1.6 登录时间太短导致采集不到数据):
|
||||
- 默认 settle_ms = SPA_LOGIN_SETTLE_MS(4000ms),给 SPA 异步渲染 + token 写入 cookie 时间
|
||||
- 等 username input 的 timeout = SPA_LOGIN_INPUT_TIMEOUT_MS(20s)
|
||||
- click 按钮后 wait_for_url timeout = SPA_LOGIN_URL_TIMEOUT_MS(30s)
|
||||
- 多处过渡路径(/login, /signin, /auth/)一并判断
|
||||
"""
|
||||
# v1.1.10:先检查是否已登录(profile cookie 复用场景),已登录直接 return True
|
||||
if _is_logged_in(page):
|
||||
logger.info(
|
||||
"platform_collector: 已登录态(profile cookie 复用),跳过自动 fill"
|
||||
)
|
||||
return True
|
||||
|
||||
url_lower = page.url.lower()
|
||||
if "/login" not in url_lower and "/signin" not in url_lower and "/auth/" not in url_lower:
|
||||
return False
|
||||
# v1.1.11:sandbox SPA 登录页 input 是 #jc-user / #jc-pass(与 root 登录页同 ID)
|
||||
# 等输入框出现(带超时,避免 sandbox mock 慢启动卡死)
|
||||
try:
|
||||
page.wait_for_selector(
|
||||
'input[autocomplete="username"]',
|
||||
'#jc-user, input[type="tel"], input[autocomplete="username"]',
|
||||
timeout=SPA_LOGIN_INPUT_TIMEOUT_MS,
|
||||
)
|
||||
except Exception as e:
|
||||
logger.warning("SPA login input 未出现: %s;当前 URL=%s", e, page.url)
|
||||
return False
|
||||
spa_user = page.locator('input[autocomplete="username"]').first
|
||||
if spa_user.count() == 0:
|
||||
logger.warning("SPA login input count=0")
|
||||
# v1.1.11:按优先级选 selector —— sandbox 实际用 #jc-user
|
||||
user_sel = None
|
||||
for sel in ('#jc-user', 'input[type="tel"]', 'input[autocomplete="username"]'):
|
||||
loc = page.locator(sel).first
|
||||
if loc.count() > 0:
|
||||
user_sel = sel
|
||||
break
|
||||
if not user_sel:
|
||||
logger.warning("SPA login input selector 全 miss(#jc-user / type=tel / autocomplete=username)")
|
||||
return False
|
||||
spa_user.fill("demo")
|
||||
page.locator('input[autocomplete="current-password"]').first.fill("123456")
|
||||
page.locator(user_sel).first.fill("demo")
|
||||
# 密码 selector 同样按优先级
|
||||
pass_sel = None
|
||||
for sel in ('#jc-pass', 'input[type="password"]', 'input[autocomplete="current-password"]'):
|
||||
loc = page.locator(sel).first
|
||||
if loc.count() > 0:
|
||||
pass_sel = sel
|
||||
break
|
||||
if not pass_sel:
|
||||
logger.warning("SPA password input selector 全 miss")
|
||||
return False
|
||||
page.locator(pass_sel).first.fill("123456")
|
||||
page.locator(
|
||||
'button:has-text("登录"), button[type="submit"]:has-text("Sign in")'
|
||||
'button:has-text("登录"), button[type="submit"]:has-text("Sign in"), '
|
||||
'button[type="submit"]'
|
||||
).first.click()
|
||||
logger.info("platform_collector: sandbox SPA 自动登录...")
|
||||
logger.info("platform_collector: sandbox SPA 自动登录 (user_sel=%s pass_sel=%s)", user_sel, pass_sel)
|
||||
page.wait_for_timeout(settle_ms)
|
||||
try:
|
||||
page.wait_for_url(
|
||||
@@ -270,6 +303,13 @@ def _fill_spa_login(page, settle_ms: int = SPA_LOGIN_SETTLE_MS) -> bool:
|
||||
except Exception as e:
|
||||
logger.warning("SPA 登录超时: %s;当前 URL=%s", e, page.url)
|
||||
return False
|
||||
# v1.1.10:fill 后再检测 _is_logged_in,避免 sandbox demo 凭据失效时
|
||||
# 被误判为「已登录」(URL 跳 /app/home 但 cookie 没写入)
|
||||
if not _is_logged_in(page):
|
||||
logger.warning(
|
||||
"platform_collector: SPA URL 跳离 login 但 _is_logged_in=False,登录可能失败"
|
||||
)
|
||||
return False
|
||||
logger.info("platform_collector: SPA 登录后 URL=%s", page.url)
|
||||
return True
|
||||
|
||||
@@ -344,24 +384,38 @@ def collect_all(
|
||||
# 所有 wait_for_selector 默认 30s,调试时不直观)
|
||||
page.set_default_timeout(DEFAULT_PAGE_TIMEOUT_MS)
|
||||
|
||||
# 1. 根域 goto + 根域登录(可选;root login 经常 demo/123456 失败)
|
||||
_goto(page, ROOT_URL)
|
||||
_fill_root_login(page)
|
||||
# 1. v1.1.11:先用**最小侵入**方式检测已登录态 —— 直接 goto SPA_HOME_URL
|
||||
# (不要先跳 ROOT_URL + 自动 fill,会破坏已登录态)
|
||||
# v1.1.11 改进:探针结果 + 二次等待 + cookie 检测,三重判断避免误判
|
||||
logger.info(
|
||||
"platform_collector: 检测登录态,goto SPA_HOME 先探 (当前 URL=%s)",
|
||||
page.url,
|
||||
)
|
||||
_goto(page, SPA_HOME_URL)
|
||||
# v1.1.11:等 sandbox SPA 异步验证 cookie(POST_LOGIN_SETTLE_MS → SPA_HYDRATION_MS)
|
||||
page.wait_for_timeout(SPA_HYDRATION_MS)
|
||||
# v1.1.11:二次等待 —— sandbox SPA 有时首次访问会先跳一个中间过渡页
|
||||
# (如 /select),等几秒看 URL 是否稳定到 /app/
|
||||
first_url = page.url
|
||||
page.wait_for_timeout(SPA_HOME_RETRY_DELAY_MS)
|
||||
second_url = page.url
|
||||
if first_url != second_url:
|
||||
logger.info(
|
||||
"platform_collector: 探针 URL 过渡 %s → %s,等稳定", first_url, second_url,
|
||||
)
|
||||
page.wait_for_timeout(SPA_HOME_RETRY_DELAY_MS)
|
||||
|
||||
# 2. v1.1.8:已登录态优先检测 —— 复用 profile cookie 时(手工登录成功后
|
||||
# cookie 已持久化),root 直接跳 SPA home,**不再强制 goto login**,
|
||||
# 避免打断用户手工登录态导致「已登录却被踢回 login 页」。
|
||||
if _is_logged_in(page):
|
||||
logger.info(
|
||||
"platform_collector: 已登录态,跳过 login,直接 goto SPA_HOME, URL=%s",
|
||||
page.url,
|
||||
"platform_collector: ✅ 已登录态,**完全跳过登录流程**(不弹窗、不自动 fill、不打扰)"
|
||||
",URL=%s", page.url,
|
||||
)
|
||||
else:
|
||||
# 未登录:直接 goto sandbox SPA login(绕过 /select 和 root 跳转)
|
||||
logger.info(
|
||||
"platform_collector: 未登录态,goto sandbox SPA login, 当前 URL=%s",
|
||||
"platform_collector: 未登录态(SPA_HOME 跳回 login, URL=%s),走登录分支",
|
||||
page.url,
|
||||
)
|
||||
# 2. 未登录:直接 goto sandbox SPA login(绕过 /select 和 root 跳转)
|
||||
_goto(page, SPA_LOGIN_URL)
|
||||
# SPA hydration + framework 初始化时间(修复登录时间太短的核心点)
|
||||
page.wait_for_timeout(SPA_HYDRATION_MS)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"""
|
||||
|
||||
SKILL_SLUG = "alert-contract-expiring-hr"
|
||||
SKILL_VERSION = "1.1.9"
|
||||
SKILL_VERSION = "1.1.14"
|
||||
LOG_LOGGER_NAME = "openclaw.skill.alert_contract_expiring_hr"
|
||||
PLATFORM_KIT_MIN_VERSION = "1.2.11"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user