sophhub 0.4.36 → 0.4.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agents/store/.config.json +23 -0
- package/agents/store/AGENTS.md +103 -0
- package/agents/store/BOOTSTRAP.md +10 -0
- package/agents/store/HEARTBEAT.md +10 -0
- package/agents/store/IDENTITY.md +5 -0
- package/agents/store/MEMORY.md +3 -0
- package/agents/store/SOUL.md +10 -0
- package/agents/store/TOOLS.md +9 -0
- package/agents/store/USER.md +5 -0
- package/agents/store/store_cron.json +18 -0
- package/package.json +1 -1
- package/skills/claw-friend-message-capture/skill.json +41 -0
- package/skills/claw-friend-message-capture/src/SKILL.md +115 -0
- package/skills/claw-friend-message-capture/src/pyproject.toml +12 -0
- package/skills/claw-friend-message-capture/src/scripts/capture_messages.py +573 -0
- package/skills/claw-friend-message-capture/src/scripts/sophclaw_auth.py +395 -0
- package/skills/store-appointment/skill.json +56 -0
- package/skills/store-appointment/src/SKILL.md +66 -0
- package/skills/store-appointment/src/pyproject.toml +18 -0
- package/skills/store-appointment/src/references/errors.md +32 -0
- package/skills/store-appointment/src/references/verified-queries.md +25 -0
- package/skills/store-appointment/src/scripts/__init__.py +1 -0
- package/skills/store-appointment/src/scripts/cli.py +15 -0
- package/skills/store-appointment/src/store_appointment_lib/__init__.py +1 -0
- package/skills/store-appointment/src/store_appointment_lib/cli.py +395 -0
- package/skills/store-appointment/src/store_appointment_lib/helpers.py +160 -0
- package/skills/store-appointment/src/store_appointment_lib/settlement.py +170 -0
- package/skills/store-catalog/skill.json +49 -0
- package/skills/store-catalog/src/SKILL.md +60 -0
- package/skills/store-catalog/src/pyproject.toml +18 -0
- package/skills/store-catalog/src/references/errors.md +24 -0
- package/skills/store-catalog/src/scripts/__init__.py +1 -0
- package/skills/store-catalog/src/scripts/cli.py +15 -0
- package/skills/store-catalog/src/store_catalog_lib/__init__.py +0 -0
- package/skills/store-catalog/src/store_catalog_lib/cli.py +463 -0
- package/skills/store-customer/skill.json +75 -0
- package/skills/store-customer/src/SKILL.md +78 -0
- package/skills/store-customer/src/pyproject.toml +22 -0
- package/skills/store-customer/src/references/errors.md +24 -0
- package/skills/store-customer/src/references/verified-queries.md +35 -0
- package/skills/store-customer/src/scripts/__init__.py +1 -0
- package/skills/store-customer/src/scripts/cli.py +15 -0
- package/skills/store-customer/src/store_customer_lib/__init__.py +0 -0
- package/skills/store-customer/src/store_customer_lib/__main__.py +0 -0
- package/skills/store-customer/src/store_customer_lib/cli.py +199 -0
- package/skills/store-customer/src/store_customer_lib/common.py +73 -0
- package/skills/store-customer/src/store_customer_lib/fields.py +112 -0
- package/skills/store-customer/src/store_customer_lib/followups.py +59 -0
- package/skills/store-customer/src/store_customer_lib/import_cmds.py +108 -0
- package/skills/store-customer/src/store_customer_lib/import_export/__init__.py +1 -0
- package/skills/store-customer/src/store_customer_lib/import_export/exporter.py +83 -0
- package/skills/store-customer/src/store_customer_lib/import_export/mapper.py +110 -0
- package/skills/store-customer/src/store_customer_lib/import_export/normalizer.py +96 -0
- package/skills/store-customer/src/store_customer_lib/import_export/parser.py +216 -0
- package/skills/store-customer/src/store_customer_lib/import_export/service.py +145 -0
- package/skills/store-customer/src/store_customer_lib/members.py +258 -0
- package/skills/store-customer/src/store_customer_lib/query_extras.py +121 -0
- package/skills/store-customer/src/store_customer_lib/wallet.py +122 -0
- package/skills/store-inventory/skill.json +42 -0
- package/skills/store-inventory/src/SKILL.md +61 -0
- package/skills/store-inventory/src/pyproject.toml +18 -0
- package/skills/store-inventory/src/references/errors.md +23 -0
- package/skills/store-inventory/src/scripts/__init__.py +1 -0
- package/skills/store-inventory/src/scripts/cli.py +15 -0
- package/skills/store-inventory/src/store_inventory_lib/__init__.py +0 -0
- package/skills/store-inventory/src/store_inventory_lib/cli.py +327 -0
- package/skills/store-marketing/skill.json +71 -0
- package/skills/store-marketing/src/SKILL.md +108 -0
- package/skills/store-marketing/src/playbooks/campaign-planning.md +187 -0
- package/skills/store-marketing/src/playbooks/content-generation.md +122 -0
- package/skills/store-marketing/src/playbooks/marketing-calendar.md +60 -0
- package/skills/store-marketing/src/playbooks/multi-channel-bundle.md +94 -0
- package/skills/store-marketing/src/playbooks/poster-generation.md +183 -0
- package/skills/store-marketing/src/playbooks/style-profile-workflow.md +100 -0
- package/skills/store-marketing/src/pyproject.toml +22 -0
- package/skills/store-marketing/src/references/campaign-mechanics.md +168 -0
- package/skills/store-marketing/src/references/content-safety.md +26 -0
- package/skills/store-marketing/src/references/errors.md +23 -0
- package/skills/store-marketing/src/references/marketing-date-checklist.md +99 -0
- package/skills/store-marketing/src/references/platform-writing-guidelines.md +88 -0
- package/skills/store-marketing/src/references/playbook.md +43 -0
- package/skills/store-marketing/src/references/quality-checklist.md +44 -0
- package/skills/store-marketing/src/references/segments.md +28 -0
- package/skills/store-marketing/src/references/verified-queries.md +20 -0
- package/skills/store-marketing/src/scripts/__init__.py +1 -0
- package/skills/store-marketing/src/scripts/cli.py +15 -0
- package/skills/store-marketing/src/scripts/generate_poster.py +604 -0
- package/skills/store-marketing/src/scripts/style_profile.py +216 -0
- package/skills/store-marketing/src/store_marketing_lib/__init__.py +1 -0
- package/skills/store-marketing/src/store_marketing_lib/campaign.py +114 -0
- package/skills/store-marketing/src/store_marketing_lib/cli.py +207 -0
- package/skills/store-marketing/src/store_marketing_lib/context.py +41 -0
- package/skills/store-marketing/src/store_marketing_lib/meta.py +22 -0
- package/skills/store-marketing/src/store_marketing_lib/segments.py +182 -0
- package/skills/store-order/skill.json +42 -0
- package/skills/store-order/src/SKILL.md +55 -0
- package/skills/store-order/src/pyproject.toml +18 -0
- package/skills/store-order/src/references/errors.md +33 -0
- package/skills/store-order/src/scripts/__init__.py +1 -0
- package/skills/store-order/src/scripts/cli.py +15 -0
- package/skills/store-order/src/store_order_lib/__init__.py +1 -0
- package/skills/store-order/src/store_order_lib/cli.py +291 -0
- package/skills/store-order/src/store_order_lib/helpers.py +12 -0
- package/skills/store-order/src/store_order_lib/settlement.py +335 -0
- package/skills/store-reporting/skill.json +41 -0
- package/skills/store-reporting/src/SKILL.md +50 -0
- package/skills/store-reporting/src/pyproject.toml +19 -0
- package/skills/store-reporting/src/references/errors.md +26 -0
- package/skills/store-reporting/src/references/verified-queries.md +14 -0
- package/skills/store-reporting/src/scripts/__init__.py +1 -0
- package/skills/store-reporting/src/scripts/cli.py +15 -0
- package/skills/store-reporting/src/store_reporting_lib/__init__.py +1 -0
- package/skills/store-reporting/src/store_reporting_lib/cli.py +155 -0
- package/skills/store-reporting/src/store_reporting_lib/metrics.py +226 -0
- package/skills/store-schedule/skill.json +60 -0
- package/skills/store-schedule/src/SKILL.md +69 -0
- package/skills/store-schedule/src/config/reminder_rules.yaml +30 -0
- package/skills/store-schedule/src/config/store_recurring_events.yaml +15 -0
- package/skills/store-schedule/src/config/task_registry.yaml +21 -0
- package/skills/store-schedule/src/pyproject.toml +21 -0
- package/skills/store-schedule/src/references/errors.md +35 -0
- package/skills/store-schedule/src/references/sent_reminders.md +16 -0
- package/skills/store-schedule/src/references/store_cron.template.json +18 -0
- package/skills/store-schedule/src/scripts/__init__.py +1 -0
- package/skills/store-schedule/src/scripts/cli.py +15 -0
- package/skills/store-schedule/src/store_schedule_lib/__init__.py +1 -0
- package/skills/store-schedule/src/store_schedule_lib/change_monitor.py +70 -0
- package/skills/store-schedule/src/store_schedule_lib/cli.py +362 -0
- package/skills/store-schedule/src/store_schedule_lib/config_loader.py +105 -0
- package/skills/store-schedule/src/store_schedule_lib/conflicts.py +33 -0
- package/skills/store-schedule/src/store_schedule_lib/cron_registry.py +147 -0
- package/skills/store-schedule/src/store_schedule_lib/daily_plan.py +175 -0
- package/skills/store-schedule/src/store_schedule_lib/daily_summary.py +94 -0
- package/skills/store-schedule/src/store_schedule_lib/message_templates.py +13 -0
- package/skills/store-schedule/src/store_schedule_lib/meta.py +24 -0
- package/skills/store-schedule/src/store_schedule_lib/queries.py +293 -0
- package/skills/store-schedule/src/store_schedule_lib/reminder_planner.py +277 -0
- package/skills/store-schedule/src/store_schedule_lib/task_builder.py +118 -0
- package/skills/store-staff/skill.json +42 -0
- package/skills/store-staff/src/SKILL.md +66 -0
- package/skills/store-staff/src/pyproject.toml +18 -0
- package/skills/store-staff/src/references/errors.md +22 -0
- package/skills/store-staff/src/references/staff-field-def.md +58 -0
- package/skills/store-staff/src/scripts/__init__.py +1 -0
- package/skills/store-staff/src/scripts/cli.py +15 -0
- package/skills/store-staff/src/store_staff_lib/__init__.py +0 -0
- package/skills/store-staff/src/store_staff_lib/cli.py +631 -0
- package/skills/store-suite/skill.json +60 -0
- package/skills/store-suite/src/SKILL.md +53 -0
- package/skills/store-suite/src/pyproject.toml +16 -0
- package/skills/store-suite/src/references/errors.md +24 -0
- package/skills/store-suite/src/references/integration-guide.md +164 -0
- package/skills/store-suite/src/references/schema.md +56 -0
- package/skills/store-suite/src/scripts/__init__.py +1 -0
- package/skills/store-suite/src/scripts/cli.py +15 -0
- package/skills/store-suite/src/starter/default/field_defs_seed.json +5 -0
- package/skills/store-suite/src/starter/default/lexicon.json +5 -0
- package/skills/store-suite/src/starter/default/seed.sql +41 -0
- package/skills/store-suite/src/store_db/__init__.py +6 -0
- package/skills/store-suite/src/store_db/__main__.py +0 -0
- package/skills/store-suite/src/store_db/cli.py +269 -0
- package/skills/store-suite/src/store_db/confirm.py +20 -0
- package/skills/store-suite/src/store_db/csv_safe.py +36 -0
- package/skills/store-suite/src/store_db/db.py +92 -0
- package/skills/store-suite/src/store_db/field_defs.py +21 -0
- package/skills/store-suite/src/store_db/filters.py +19 -0
- package/skills/store-suite/src/store_db/ids.py +18 -0
- package/skills/store-suite/src/store_db/operation_log.py +186 -0
- package/skills/store-suite/src/store_db/response.py +37 -0
- package/skills/store-suite/src/store_db/schema_v1.py +308 -0
- package/skills/store-suite/src/store_db/seed.py +83 -0
- package/skills/store-suite/src/store_settlement/__init__.py +17 -0
- package/skills/store-suite/src/store_settlement/catalog.py +52 -0
- package/skills/store-suite/src/store_settlement/errors.py +10 -0
- package/skills/store-suite/src/store_settlement/inventory.py +80 -0
- package/skills/store-suite/src/store_settlement/money.py +9 -0
- package/skills/store-suite/src/store_settlement/payment.py +189 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "1.0.1",
|
|
3
|
+
"agent_id": "store",
|
|
4
|
+
"description": "通用门店经营助手:预约、会员、库存、报表、提醒",
|
|
5
|
+
"bot_api_enabled": false,
|
|
6
|
+
"workspace": "/home/node/.openclaw/workspace-store",
|
|
7
|
+
"skills": [
|
|
8
|
+
{"name": "store-suite", "auto_install": true},
|
|
9
|
+
{"name": "store-customer", "auto_install": true},
|
|
10
|
+
{"name": "store-catalog", "auto_install": true},
|
|
11
|
+
{"name": "store-appointment", "auto_install": true},
|
|
12
|
+
{"name": "store-order", "auto_install": true},
|
|
13
|
+
{"name": "store-inventory", "auto_install": true},
|
|
14
|
+
{"name": "store-staff", "auto_install": true},
|
|
15
|
+
{"name": "store-schedule", "auto_install": true},
|
|
16
|
+
{"name": "store-reporting", "auto_install": true},
|
|
17
|
+
{"name": "store-marketing", "auto_install": true}
|
|
18
|
+
],
|
|
19
|
+
"tools": {
|
|
20
|
+
"deny": ["sessions_spawn", "browser", "canvas", "nodes", "sql"]
|
|
21
|
+
},
|
|
22
|
+
"llm": "GLM-5.1"
|
|
23
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# AGENTS.md — 通用门店经营助手
|
|
2
|
+
|
|
3
|
+
## 会话启动
|
|
4
|
+
|
|
5
|
+
1. 读取 `SOUL.md`
|
|
6
|
+
2. 读取 `USER.md`
|
|
7
|
+
3. 读取 `memory/YYYY-MM-DD.md`(今天 + 昨天,若存在)
|
|
8
|
+
4. 主会话再读 `MEMORY.md`
|
|
9
|
+
|
|
10
|
+
## 执行链
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
用户意图 → 匹配 skill description → 读对应 SKILL.md
|
|
14
|
+
→ uv run --project "{baseDir}" store-* <子命令>
|
|
15
|
+
→ 解析单行 JSON → need_confirm 则出确认卡片 → 用户确认后加 --yes 重调
|
|
16
|
+
→ 人话摘要(禁止编造)
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
写操作记 `store-suite operation-log-query` 可审计;传 `--session-id`(若平台提供)。
|
|
20
|
+
|
|
21
|
+
## 意图路由表
|
|
22
|
+
|
|
23
|
+
| 用户意图 | CLI |
|
|
24
|
+
|----------|-----|
|
|
25
|
+
| 预约 / 改期 / 取消 | `store-appointment` appt-create / appt-update / appt-cancel --yes |
|
|
26
|
+
| 做完了 / 预约结账 | `store-appointment` appt-complete --yes |
|
|
27
|
+
| 到店开单 / walk-in 结账 | `store-order` order-create → order-settle --yes |
|
|
28
|
+
| 退单冲销 | `store-order` order-refund --yes |
|
|
29
|
+
| 看下数据 | `store-reporting` dashboard --md + `store-schedule` daily-summary --md |
|
|
30
|
+
| 今日提醒 / 今天要处理什么 | `store-schedule` daily-summary --md |
|
|
31
|
+
| 设置提醒 / 注册 cron | `store-schedule` reminder plan → reminder schedule --yes |
|
|
32
|
+
| 开启每日推送 | `store-schedule` cron-setup --yes |
|
|
33
|
+
| 预约前提醒 | `store-schedule` daily-plan [--register-appt-only] |
|
|
34
|
+
| 建档 / 查客户 / 充值 / 开卡 / 按标签查 / 查流水 | `store-customer` member-* / balance-* / card-* / member-txn-query |
|
|
35
|
+
| 王芳还有哪些预约 / 改服务人员 / 备选时段 | `store-appointment` appt-query --member-id / appt-update / appt-suggest-slots |
|
|
36
|
+
| 跟进 / 下次回访日期 | `store-customer` followup-add / followup-query |
|
|
37
|
+
| 自定义字段登记 | `store-customer` field-def-* |
|
|
38
|
+
| 新增项目 / 商品 / 耗材 | `store-catalog` service-* / product-* / material-* |
|
|
39
|
+
| 库存查询 / 入库 / 出库 | `store-inventory` stock-query / stock-in / stock-out --yes |
|
|
40
|
+
| 导出库存 / 补货建议 | `store-inventory` stock-export --path … / replenish-suggest |
|
|
41
|
+
| 员工 / 排班 / 工资 / 提成 | `store-staff` staff-* / commission-rule / staff-salary-calc |
|
|
42
|
+
| 报表 / 周报月报 / 员工排名 / 项目营收 | `store-reporting` report-day\|week\|month / report-staff / report-by-service |
|
|
43
|
+
| 沉睡客户 / 单分群 / 导出名单 / 活动方案 | `store-marketing` segment-query / segment-export / campaign-suggest / dormant-wake |
|
|
44
|
+
| 操作记录 / 审计导出 | `store-suite` operation-log-query / operation-log-export |
|
|
45
|
+
| 补充默认样例 | 首次 CLI 自动完成;可选 `store-suite seed` 幂等补充(INSERT OR IGNORE,不删已有数据;真重置须删库或换 `STORE_DB_PATH`) |
|
|
46
|
+
|
|
47
|
+
## 确认卡片(写操作必做)
|
|
48
|
+
|
|
49
|
+
展示:动作、对象、金额/时间/影响摘要 → 用户确认后**同一命令**加 `--yes`。
|
|
50
|
+
|
|
51
|
+
涉及:`member-delete`/`restore`、`balance-recharge`、`card-open`、`appt-cancel`、`appt-complete`、`order-settle`/`cancel`/`refund`、`stock-out`、`commission-rule set`、`field-def-delete`、`store-schedule cron-setup`、开启/关闭每日 cron。
|
|
52
|
+
|
|
53
|
+
## 结算与支付
|
|
54
|
+
|
|
55
|
+
- 预约完成:`appt-complete --appt-id … --pay stored_value|cash|card|mixed|card_plus_cash --yes`
|
|
56
|
+
- 混合支付须先算清差额,用 `--lines-json`;次卡须 `--card-name`
|
|
57
|
+
- 开单:`order-settle --order-id … --yes`(规则同 PRD §9.4)
|
|
58
|
+
|
|
59
|
+
## 提醒(硬性)
|
|
60
|
+
|
|
61
|
+
- **只**调用 `store-schedule`;展示其 `markdown` 或 `blocks`,不增删块、不从 note 猜生日/待办。
|
|
62
|
+
- 提醒注册:`reminder plan` 预览 → `reminder schedule --yes`;或 `cron-setup --yes` 开启每日推送。
|
|
63
|
+
- 用户要新提醒类型:拒绝,说明须产品发版;`reminder-query` 非法 type 会返回 `invalid_reminder_type`。
|
|
64
|
+
- 生日/到期日/跟进日期写入走 `store-customer`(`birthday`、`due_date`、`followup-add` 的 `next_followup_date`)。
|
|
65
|
+
|
|
66
|
+
## cron 与 store_cron.json
|
|
67
|
+
|
|
68
|
+
工作区根目录 `store_cron.json` 由 `store-schedule cron-init` 初始化。用户确认「开启每日提醒」后:
|
|
69
|
+
|
|
70
|
+
1. 执行 `store-schedule cron-setup --yes`(注册 daily-summary + daily-plan 固定 cron)
|
|
71
|
+
2. 或手动:`daily.enabled = true`、`daily_plan.enabled = true`,并注册对应平台 cron
|
|
72
|
+
3. 关闭时 `enabled = false` 并 `reminder remove` 对应 store-* 任务
|
|
73
|
+
|
|
74
|
+
## 安全红线
|
|
75
|
+
|
|
76
|
+
- 禁止 SQL 工具改 `store.sqlite3`;禁止跳过 CLI。
|
|
77
|
+
- 删除会员/员工/项目 = **软删**(`status=deleted`),不说「已从数据库删除」。
|
|
78
|
+
- 退款/冲销说「已退款/已冲销」,不说「删了订单」。
|
|
79
|
+
|
|
80
|
+
## 口语消歧
|
|
81
|
+
|
|
82
|
+
| 用户说 | 动作 | 禁止 |
|
|
83
|
+
|--------|------|------|
|
|
84
|
+
| 删了客户 / 不要这个客户 | member-delete --yes | 勿用 appt-cancel/refund 代替 |
|
|
85
|
+
| 取消预约 | appt-cancel --yes | 勿 member-delete |
|
|
86
|
+
| 退单 / 充错了 | order-refund --yes | 勿 member-delete |
|
|
87
|
+
|
|
88
|
+
## CLI 速查
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
uv run --project "{baseDir}" store-customer member-query --name "王芳" --with-wallet
|
|
92
|
+
uv run --project "{baseDir}" store-appointment appt-create --member-id M001 --service "基础服务" --datetime "2026-06-01 15:00" --technician-id S001
|
|
93
|
+
uv run --project "{baseDir}" store-appointment appt-complete --appt-id A001 --pay stored_value --yes
|
|
94
|
+
uv run --project "{baseDir}" store-schedule daily-summary --md
|
|
95
|
+
uv run --project "{baseDir}" store-schedule reminder plan --json '{"kinds":["birthday"]}'
|
|
96
|
+
uv run --project "{baseDir}" store-reporting dashboard --md
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
各 skill 完整子命令见对应 `SKILL.md`。
|
|
100
|
+
|
|
101
|
+
## 跨能力域路由
|
|
102
|
+
|
|
103
|
+
用户意图跨多个模块(如「搞完活动顺便设提醒」「员工排名 vs 算工资」)时,阅读 store-suite 安装目录下的 `references/integration-guide.md`(易混淆口语、跨域工作流)。子 skill 的 SKILL.md 保持独立,不在此重复。
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# BOOTSTRAP.md
|
|
2
|
+
|
|
3
|
+
首次部署:
|
|
4
|
+
|
|
5
|
+
1. 确认 `STORE_DB_PATH` 指向门店库(默认 `~/.config/store-suite/store.sqlite3`);不设置则使用默认路径。
|
|
6
|
+
2. **无需手动 migrate/seed** — 首次调用任意 store skill CLI 时会自动建库并导入默认样例。
|
|
7
|
+
3. 初始化 cron 配置:`uv run {store-schedule-baseDir}/scripts/cli.py cron-init --path "<workspace>"`(`workspace` 与 `.config.json` 中一致)。
|
|
8
|
+
4. 读取 `AGENTS.md` 路由表;跨域编排见 `AGENTS.md` §跨能力域路由。完成后可删除本文件。
|
|
9
|
+
|
|
10
|
+
**云端备份:** 业务库默认在 **`~/.config/store-suite/`**(不在 workspace 内)。备份或迁移时须**一并包含**该目录与 workspace;详见 store-suite 的 `references/integration-guide.md` §6。生产环境可将 `STORE_DB_PATH` 设为 `{workspace}/data/store.sqlite3` 以便与工作区同盘备份。
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# HEARTBEAT.md
|
|
2
|
+
|
|
3
|
+
每 30 分钟最多检查一次(23:00–08:00 仅回复 `HEARTBEAT_OK`):
|
|
4
|
+
|
|
5
|
+
- 2 小时内 `scheduled` 预约(`reminder-query --type appt_30m`)
|
|
6
|
+
- 今日 `followup_due`(`reminder-query --type followup_due`)
|
|
7
|
+
- `low_stock`
|
|
8
|
+
- 7 天内 `card_expiring`(`reminder-query --type card_expiring --days 7`)
|
|
9
|
+
|
|
10
|
+
有异常则简短提示并建议用户说「今日提醒」;无异常只回复 `HEARTBEAT_OK`。
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# SOUL.md — 通用门店经营助手
|
|
2
|
+
|
|
3
|
+
你是**通用门店经营助手**,服务单店老板:预约履约、会员与储值、开单收银、库存、员工提成、经营数据与每日提醒。
|
|
4
|
+
|
|
5
|
+
## 原则
|
|
6
|
+
|
|
7
|
+
- 所有经营数据变更**只通过** `store-*` CLI(`uv run --project "{baseDir}" ...`),禁止直接改库或编造未调用 CLI 的结果。
|
|
8
|
+
- 写操作须先出**确认卡片**,用户明确同意后再加 `--yes` 重调。
|
|
9
|
+
- 提醒与待办**只**来自 `store-schedule` 的 JSON/markdown,禁止从 note、fields_json 自行推断待办。
|
|
10
|
+
- 话术:专业、可执行、少套话;数字与名单必须来自 CLI 返回值。
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# TOOLS.md
|
|
2
|
+
|
|
3
|
+
- **exec**:运行 `uv run --project "{baseDir}" store-* <子命令>`;`{baseDir}` 为各 skill 安装根目录。与各 skill `SKILL.md` 中 `uv run {baseDir}/scripts/cli.py` **功能等价**,仅入口写法不同。首次 exec 会自动建库并导入默认样例(无需 migrate/seed)。工作区缺少 `store_cron.json` 时执行 `store-schedule cron-init --path "<workspace>"`。
|
|
4
|
+
- **workspace**:`.config.json` 默认 `workspace` 为 Linux 容器路径;本地 Windows 开发须通过环境变量 `WORKSPACE` / `OPENCLAW_WORKSPACE` 覆盖,或修改 agent 配置。
|
|
5
|
+
- **read**:读取 SKILL.md、playbooks、工作区 `store_cron.json`。
|
|
6
|
+
- **cron**:注册用户确认的每日推送(改 `store_cron.json` 后注册)。
|
|
7
|
+
- **禁止**:sql 直连、browser、sessions_spawn 绕过确认写库。
|
|
8
|
+
|
|
9
|
+
默认库环境变量:`STORE_DB_PATH`。
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"daily": {
|
|
3
|
+
"enabled": false,
|
|
4
|
+
"cron": "30 7 * * *",
|
|
5
|
+
"tz": "Asia/Shanghai",
|
|
6
|
+
"command": "daily-summary --mark-sent --md"
|
|
7
|
+
},
|
|
8
|
+
"daily_plan": {
|
|
9
|
+
"enabled": false,
|
|
10
|
+
"cron": "45 7 * * *",
|
|
11
|
+
"tz": "Asia/Shanghai",
|
|
12
|
+
"command": "daily-plan --register-appt-only"
|
|
13
|
+
},
|
|
14
|
+
"appt_reminders": {
|
|
15
|
+
"enabled": true,
|
|
16
|
+
"lead_minutes": 30
|
|
17
|
+
}
|
|
18
|
+
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "claw-friend-message-capture",
|
|
3
|
+
"version": "1.2.0",
|
|
4
|
+
"types": ["store"],
|
|
5
|
+
"displayName": "抓取虾友消息",
|
|
6
|
+
"description": "自动拉取虾友发送的 IM 消息(含文字、文件、截图),支持按好友或时间筛选,下载附件到本地。触发词:抓取虾友消息、查看虾友消息、获取好友消息、拉取未读消息、下载虾友附件。",
|
|
7
|
+
"changelog": [
|
|
8
|
+
{
|
|
9
|
+
"version": "1.2.0",
|
|
10
|
+
"date": "2026-05-29",
|
|
11
|
+
"changes": [
|
|
12
|
+
"添加 setup 子命令:支持手动配置 refresh token(从浏览器 DevTools 获取)",
|
|
13
|
+
"refresh token 多来源支持:jwt.json、环境变量 SOPHCLAW_REFRESH_TOKEN、文件 ~/.openclaw/refresh_token",
|
|
14
|
+
"添加首次设置说明文档"
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"version": "1.1.0",
|
|
19
|
+
"date": "2026-05-29",
|
|
20
|
+
"changes": [
|
|
21
|
+
"JWT 自动刷新:集成 sophclaw_auth 共享模块,access token 过期时自动用 refresh token 续期,有效期从 2h 延长到 30 天"
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"version": "1.0.1",
|
|
26
|
+
"date": "2026-05-29",
|
|
27
|
+
"changes": [
|
|
28
|
+
"修复容器 DNS ndots:5 导致 Python urllib3 解析超时:脚本启动时设 RES_OPTIONS=ndots:1"
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"version": "1.0.0",
|
|
33
|
+
"date": "2026-05-29",
|
|
34
|
+
"changes": [
|
|
35
|
+
"初次提交:查看频道列表、拉取好友消息历史、下载附件(图片/文件)、按时间增量抓取"
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
"createdAt": "2026-05-29",
|
|
40
|
+
"updatedAt": "2026-05-29T12:00:00Z"
|
|
41
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: claw-friend-message-capture
|
|
3
|
+
description: 自动抓取虾友发送的 IM 消息,包括文字、截图和文件附件。场景:抓取虾友消息、查看虾友消息、获取好友消息、拉取未读消息、下载虾友附件。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 抓取虾友消息
|
|
7
|
+
|
|
8
|
+
通过 Sophnet IM API 拉取虾友(好友)发送的消息,支持文字、图片截图和文件附件。脚本 `{baseDir}/scripts/capture_messages.py` 提供四个子命令。
|
|
9
|
+
|
|
10
|
+
## 子命令速查
|
|
11
|
+
|
|
12
|
+
| 子命令 | 用途 | 示例场景 |
|
|
13
|
+
|--------|------|---------|
|
|
14
|
+
| `friends` | 查看所有虾友及 DM 频道 | "列出我的虾友" |
|
|
15
|
+
| `list` | 拉取指定好友的消息历史 | "查看小明的最近消息" |
|
|
16
|
+
| `unread` | 拉取所有未读/最近消息 | "抓取虾友消息" / "查看未读消息" |
|
|
17
|
+
| `download` | 下载消息附件(图片/文件) | "下载虾友发的截图" |
|
|
18
|
+
|
|
19
|
+
## 用法
|
|
20
|
+
|
|
21
|
+
### 1. 列出虾友 + DM 频道
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
uv run {baseDir}/scripts/capture_messages.py friends --json
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
输出每项含 `friendId`、`nickname`、`dmChannelId`(rid)。
|
|
28
|
+
|
|
29
|
+
### 2. 拉取指定好友消息
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
# 通过 friendId 自动查找 DM 频道
|
|
33
|
+
uv run {baseDir}/scripts/capture_messages.py list --friend-id 123 --count 30
|
|
34
|
+
|
|
35
|
+
# 直接用 rid(DM 频道 ID)
|
|
36
|
+
uv run {baseDir}/scripts/capture_messages.py list --rid "<rid>" --count 30
|
|
37
|
+
|
|
38
|
+
# 指定时间范围(latest 为毫秒时间戳,拉取此时间之前的消息)
|
|
39
|
+
uv run {baseDir}/scripts/capture_messages.py list --rid "<rid>" --latest 1700000000000 --count 20
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### 3. 抓取所有未读/最近消息
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
# 拉取所有 DM 频道最新消息
|
|
46
|
+
uv run {baseDir}/scripts/capture_messages.py unread
|
|
47
|
+
|
|
48
|
+
# 仅拉取有未读的频道,每个频道 20 条
|
|
49
|
+
uv run {baseDir}/scripts/capture_messages.py unread --count 20 --min-unread 1
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### 4. 下载消息附件
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
# 下载指定消息中的图片和文件
|
|
56
|
+
uv run {baseDir}/scripts/capture_messages.py download \
|
|
57
|
+
--rid "<rid>" \
|
|
58
|
+
--msg-id "<消息ID>" \
|
|
59
|
+
--out-dir ./downloads
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
附件保存到 `{out-dir}/images/`(截图)和 `{out-dir}/files/`(文件)。
|
|
63
|
+
|
|
64
|
+
## 执行建议
|
|
65
|
+
|
|
66
|
+
- 用户说「抓取虾友消息」→ 先执行 `friends --json`,然后对每个 DM 频道执行 `list` 或批量执行 `unread`
|
|
67
|
+
- 用户说「下载虾友发的图片」→ 从消息 JSON 中找到 `imageAttachments`,对目标消息执行 `download`
|
|
68
|
+
- 用户提供昵称 → 从 `friends` 输出中匹配 `nickname`,拿到 `dmChannelId` 再拉消息
|
|
69
|
+
|
|
70
|
+
## 首次设置(获取 refresh token)
|
|
71
|
+
|
|
72
|
+
首次使用前需配置 refresh token,之后 JWT 过期会自动续期。
|
|
73
|
+
|
|
74
|
+
### 获取 refresh token
|
|
75
|
+
|
|
76
|
+
1. 浏览器打开 Sophnet 并登录
|
|
77
|
+
2. 按 F12 → **应用**(Application)→ **本地存储**(Local Storage)→ `user-info`
|
|
78
|
+
3. 复制其中 `refreshToken` 字段的值
|
|
79
|
+
|
|
80
|
+
也可以打开浏览器控制台(Console),执行以下命令直接复制:
|
|
81
|
+
|
|
82
|
+
```js
|
|
83
|
+
copy(JSON.parse(localStorage['user-info']).refreshToken)
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### 配置 refresh token(三选一)
|
|
87
|
+
|
|
88
|
+
**方式 A — setup 子命令(推荐)**:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
uv run {baseDir}/scripts/capture_messages.py setup --refresh-token "<你的refreshToken>"
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
**方式 B — 环境变量**(重启后失效):
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
export SOPHCLAW_REFRESH_TOKEN="<你的refreshToken>"
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**方式 C — 文件持久化**:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
echo "<你的refreshToken>" > ~/.openclaw/refresh_token
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
配置完成后即可正常使用,JWT 过期时自动续期。
|
|
107
|
+
|
|
108
|
+
## 注意事项
|
|
109
|
+
|
|
110
|
+
- 从 `/home/node/.openclaw/jwt.json` 的 `web_jwt` 字段读取 JWT,通过 `sophclaw_auth` 模块自动检测过期并续期(refresh token 有效期最长 30 天)
|
|
111
|
+
- refresh token 读取优先级:jwt.json → 环境变量 `SOPHCLAW_REFRESH_TOKEN` → 文件 `~/.openclaw/refresh_token`
|
|
112
|
+
- 默认 API 地址:`https://yagent.sophnet.com/api`,可通过 `--api-base-url` 或环境变量 `SOPHCLAW_API_BASE_URL` 覆盖
|
|
113
|
+
- 附件 URL 默认按 `https://www.sophnet.com` 拼接 Origin,可通过 `--origin` 或 `SOPHCLAW_ORIGIN` 覆盖
|
|
114
|
+
- 凭证文件和 JWT 切勿提交 Git
|
|
115
|
+
- 本 skill 仅提供单次拉取,如需定时自动抓取,请在 Agent 侧配置 Cron Job
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "claw-friend-message-capture"
|
|
3
|
+
version = "1.2.0"
|
|
4
|
+
description = "Capture Sophclaw friend IM messages including files and screenshots"
|
|
5
|
+
requires-python = ">=3.8"
|
|
6
|
+
dependencies = [
|
|
7
|
+
"requests>=2.28.0",
|
|
8
|
+
]
|
|
9
|
+
|
|
10
|
+
# [[tool.uv.index]]
|
|
11
|
+
# url = "https://mirrors.aliyun.com/pypi/simple/"
|
|
12
|
+
# default = true
|