sophhub 0.4.35 → 0.4.37

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.
Files changed (173) hide show
  1. package/agents/store/.config.json +23 -0
  2. package/agents/store/AGENTS.md +103 -0
  3. package/agents/store/BOOTSTRAP.md +10 -0
  4. package/agents/store/HEARTBEAT.md +10 -0
  5. package/agents/store/IDENTITY.md +5 -0
  6. package/agents/store/MEMORY.md +3 -0
  7. package/agents/store/SOUL.md +10 -0
  8. package/agents/store/TOOLS.md +9 -0
  9. package/agents/store/USER.md +5 -0
  10. package/agents/store/store_cron.json +18 -0
  11. package/package.json +1 -1
  12. package/skills/sophnet-oss/src/SKILL.md +1 -0
  13. package/skills/store-appointment/skill.json +56 -0
  14. package/skills/store-appointment/src/SKILL.md +66 -0
  15. package/skills/store-appointment/src/pyproject.toml +18 -0
  16. package/skills/store-appointment/src/references/errors.md +32 -0
  17. package/skills/store-appointment/src/references/verified-queries.md +25 -0
  18. package/skills/store-appointment/src/scripts/__init__.py +1 -0
  19. package/skills/store-appointment/src/scripts/cli.py +15 -0
  20. package/skills/store-appointment/src/store_appointment_lib/__init__.py +1 -0
  21. package/skills/store-appointment/src/store_appointment_lib/cli.py +395 -0
  22. package/skills/store-appointment/src/store_appointment_lib/helpers.py +160 -0
  23. package/skills/store-appointment/src/store_appointment_lib/settlement.py +170 -0
  24. package/skills/store-catalog/skill.json +49 -0
  25. package/skills/store-catalog/src/SKILL.md +60 -0
  26. package/skills/store-catalog/src/pyproject.toml +18 -0
  27. package/skills/store-catalog/src/references/errors.md +24 -0
  28. package/skills/store-catalog/src/scripts/__init__.py +1 -0
  29. package/skills/store-catalog/src/scripts/cli.py +15 -0
  30. package/skills/store-catalog/src/store_catalog_lib/__init__.py +0 -0
  31. package/skills/store-catalog/src/store_catalog_lib/cli.py +463 -0
  32. package/skills/store-customer/skill.json +75 -0
  33. package/skills/store-customer/src/SKILL.md +78 -0
  34. package/skills/store-customer/src/pyproject.toml +22 -0
  35. package/skills/store-customer/src/references/errors.md +24 -0
  36. package/skills/store-customer/src/references/verified-queries.md +35 -0
  37. package/skills/store-customer/src/scripts/__init__.py +1 -0
  38. package/skills/store-customer/src/scripts/cli.py +15 -0
  39. package/skills/store-customer/src/store_customer_lib/__init__.py +0 -0
  40. package/skills/store-customer/src/store_customer_lib/__main__.py +0 -0
  41. package/skills/store-customer/src/store_customer_lib/cli.py +199 -0
  42. package/skills/store-customer/src/store_customer_lib/common.py +73 -0
  43. package/skills/store-customer/src/store_customer_lib/fields.py +112 -0
  44. package/skills/store-customer/src/store_customer_lib/followups.py +59 -0
  45. package/skills/store-customer/src/store_customer_lib/import_cmds.py +108 -0
  46. package/skills/store-customer/src/store_customer_lib/import_export/__init__.py +1 -0
  47. package/skills/store-customer/src/store_customer_lib/import_export/exporter.py +83 -0
  48. package/skills/store-customer/src/store_customer_lib/import_export/mapper.py +110 -0
  49. package/skills/store-customer/src/store_customer_lib/import_export/normalizer.py +96 -0
  50. package/skills/store-customer/src/store_customer_lib/import_export/parser.py +216 -0
  51. package/skills/store-customer/src/store_customer_lib/import_export/service.py +145 -0
  52. package/skills/store-customer/src/store_customer_lib/members.py +258 -0
  53. package/skills/store-customer/src/store_customer_lib/query_extras.py +121 -0
  54. package/skills/store-customer/src/store_customer_lib/wallet.py +122 -0
  55. package/skills/store-inventory/skill.json +42 -0
  56. package/skills/store-inventory/src/SKILL.md +61 -0
  57. package/skills/store-inventory/src/pyproject.toml +18 -0
  58. package/skills/store-inventory/src/references/errors.md +23 -0
  59. package/skills/store-inventory/src/scripts/__init__.py +1 -0
  60. package/skills/store-inventory/src/scripts/cli.py +15 -0
  61. package/skills/store-inventory/src/store_inventory_lib/__init__.py +0 -0
  62. package/skills/store-inventory/src/store_inventory_lib/cli.py +327 -0
  63. package/skills/store-marketing/skill.json +71 -0
  64. package/skills/store-marketing/src/SKILL.md +108 -0
  65. package/skills/store-marketing/src/playbooks/campaign-planning.md +187 -0
  66. package/skills/store-marketing/src/playbooks/content-generation.md +122 -0
  67. package/skills/store-marketing/src/playbooks/marketing-calendar.md +60 -0
  68. package/skills/store-marketing/src/playbooks/multi-channel-bundle.md +94 -0
  69. package/skills/store-marketing/src/playbooks/poster-generation.md +183 -0
  70. package/skills/store-marketing/src/playbooks/style-profile-workflow.md +100 -0
  71. package/skills/store-marketing/src/pyproject.toml +22 -0
  72. package/skills/store-marketing/src/references/campaign-mechanics.md +168 -0
  73. package/skills/store-marketing/src/references/content-safety.md +26 -0
  74. package/skills/store-marketing/src/references/errors.md +23 -0
  75. package/skills/store-marketing/src/references/marketing-date-checklist.md +99 -0
  76. package/skills/store-marketing/src/references/platform-writing-guidelines.md +88 -0
  77. package/skills/store-marketing/src/references/playbook.md +43 -0
  78. package/skills/store-marketing/src/references/quality-checklist.md +44 -0
  79. package/skills/store-marketing/src/references/segments.md +28 -0
  80. package/skills/store-marketing/src/references/verified-queries.md +20 -0
  81. package/skills/store-marketing/src/scripts/__init__.py +1 -0
  82. package/skills/store-marketing/src/scripts/cli.py +15 -0
  83. package/skills/store-marketing/src/scripts/generate_poster.py +604 -0
  84. package/skills/store-marketing/src/scripts/style_profile.py +216 -0
  85. package/skills/store-marketing/src/store_marketing_lib/__init__.py +1 -0
  86. package/skills/store-marketing/src/store_marketing_lib/campaign.py +114 -0
  87. package/skills/store-marketing/src/store_marketing_lib/cli.py +207 -0
  88. package/skills/store-marketing/src/store_marketing_lib/context.py +41 -0
  89. package/skills/store-marketing/src/store_marketing_lib/meta.py +22 -0
  90. package/skills/store-marketing/src/store_marketing_lib/segments.py +182 -0
  91. package/skills/store-order/skill.json +42 -0
  92. package/skills/store-order/src/SKILL.md +55 -0
  93. package/skills/store-order/src/pyproject.toml +18 -0
  94. package/skills/store-order/src/references/errors.md +33 -0
  95. package/skills/store-order/src/scripts/__init__.py +1 -0
  96. package/skills/store-order/src/scripts/cli.py +15 -0
  97. package/skills/store-order/src/store_order_lib/__init__.py +1 -0
  98. package/skills/store-order/src/store_order_lib/cli.py +291 -0
  99. package/skills/store-order/src/store_order_lib/helpers.py +12 -0
  100. package/skills/store-order/src/store_order_lib/settlement.py +335 -0
  101. package/skills/store-reporting/skill.json +41 -0
  102. package/skills/store-reporting/src/SKILL.md +50 -0
  103. package/skills/store-reporting/src/pyproject.toml +19 -0
  104. package/skills/store-reporting/src/references/errors.md +26 -0
  105. package/skills/store-reporting/src/references/verified-queries.md +14 -0
  106. package/skills/store-reporting/src/scripts/__init__.py +1 -0
  107. package/skills/store-reporting/src/scripts/cli.py +15 -0
  108. package/skills/store-reporting/src/store_reporting_lib/__init__.py +1 -0
  109. package/skills/store-reporting/src/store_reporting_lib/cli.py +155 -0
  110. package/skills/store-reporting/src/store_reporting_lib/metrics.py +226 -0
  111. package/skills/store-schedule/skill.json +60 -0
  112. package/skills/store-schedule/src/SKILL.md +69 -0
  113. package/skills/store-schedule/src/config/reminder_rules.yaml +30 -0
  114. package/skills/store-schedule/src/config/store_recurring_events.yaml +15 -0
  115. package/skills/store-schedule/src/config/task_registry.yaml +21 -0
  116. package/skills/store-schedule/src/pyproject.toml +21 -0
  117. package/skills/store-schedule/src/references/errors.md +35 -0
  118. package/skills/store-schedule/src/references/sent_reminders.md +16 -0
  119. package/skills/store-schedule/src/references/store_cron.template.json +18 -0
  120. package/skills/store-schedule/src/scripts/__init__.py +1 -0
  121. package/skills/store-schedule/src/scripts/cli.py +15 -0
  122. package/skills/store-schedule/src/store_schedule_lib/__init__.py +1 -0
  123. package/skills/store-schedule/src/store_schedule_lib/change_monitor.py +70 -0
  124. package/skills/store-schedule/src/store_schedule_lib/cli.py +362 -0
  125. package/skills/store-schedule/src/store_schedule_lib/config_loader.py +105 -0
  126. package/skills/store-schedule/src/store_schedule_lib/conflicts.py +33 -0
  127. package/skills/store-schedule/src/store_schedule_lib/cron_registry.py +147 -0
  128. package/skills/store-schedule/src/store_schedule_lib/daily_plan.py +175 -0
  129. package/skills/store-schedule/src/store_schedule_lib/daily_summary.py +94 -0
  130. package/skills/store-schedule/src/store_schedule_lib/message_templates.py +13 -0
  131. package/skills/store-schedule/src/store_schedule_lib/meta.py +24 -0
  132. package/skills/store-schedule/src/store_schedule_lib/queries.py +293 -0
  133. package/skills/store-schedule/src/store_schedule_lib/reminder_planner.py +277 -0
  134. package/skills/store-schedule/src/store_schedule_lib/task_builder.py +118 -0
  135. package/skills/store-staff/skill.json +42 -0
  136. package/skills/store-staff/src/SKILL.md +66 -0
  137. package/skills/store-staff/src/pyproject.toml +18 -0
  138. package/skills/store-staff/src/references/errors.md +22 -0
  139. package/skills/store-staff/src/references/staff-field-def.md +58 -0
  140. package/skills/store-staff/src/scripts/__init__.py +1 -0
  141. package/skills/store-staff/src/scripts/cli.py +15 -0
  142. package/skills/store-staff/src/store_staff_lib/__init__.py +0 -0
  143. package/skills/store-staff/src/store_staff_lib/cli.py +631 -0
  144. package/skills/store-suite/skill.json +60 -0
  145. package/skills/store-suite/src/SKILL.md +53 -0
  146. package/skills/store-suite/src/pyproject.toml +16 -0
  147. package/skills/store-suite/src/references/errors.md +24 -0
  148. package/skills/store-suite/src/references/integration-guide.md +164 -0
  149. package/skills/store-suite/src/references/schema.md +56 -0
  150. package/skills/store-suite/src/scripts/__init__.py +1 -0
  151. package/skills/store-suite/src/scripts/cli.py +15 -0
  152. package/skills/store-suite/src/starter/default/field_defs_seed.json +5 -0
  153. package/skills/store-suite/src/starter/default/lexicon.json +5 -0
  154. package/skills/store-suite/src/starter/default/seed.sql +41 -0
  155. package/skills/store-suite/src/store_db/__init__.py +6 -0
  156. package/skills/store-suite/src/store_db/__main__.py +0 -0
  157. package/skills/store-suite/src/store_db/cli.py +269 -0
  158. package/skills/store-suite/src/store_db/confirm.py +20 -0
  159. package/skills/store-suite/src/store_db/csv_safe.py +36 -0
  160. package/skills/store-suite/src/store_db/db.py +92 -0
  161. package/skills/store-suite/src/store_db/field_defs.py +21 -0
  162. package/skills/store-suite/src/store_db/filters.py +19 -0
  163. package/skills/store-suite/src/store_db/ids.py +18 -0
  164. package/skills/store-suite/src/store_db/operation_log.py +186 -0
  165. package/skills/store-suite/src/store_db/response.py +37 -0
  166. package/skills/store-suite/src/store_db/schema_v1.py +308 -0
  167. package/skills/store-suite/src/store_db/seed.py +83 -0
  168. package/skills/store-suite/src/store_settlement/__init__.py +17 -0
  169. package/skills/store-suite/src/store_settlement/catalog.py +52 -0
  170. package/skills/store-suite/src/store_settlement/errors.py +10 -0
  171. package/skills/store-suite/src/store_settlement/inventory.py +80 -0
  172. package/skills/store-suite/src/store_settlement/money.py +9 -0
  173. 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,5 @@
1
+ # IDENTITY.md
2
+
3
+ - **名称**:门店助手
4
+ - **角色**:单店经营 Copilot
5
+ - **范围**:预约、会员、订单、库存、员工、报表、营销分群、操作审计
@@ -0,0 +1,3 @@
1
+ # MEMORY.md
2
+
3
+ (由会话沉淀:推送开关、常用服务人员/主推项目等。)
@@ -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,5 @@
1
+ # USER.md
2
+
3
+ 用户是门店老板或店长,使用自然语言管理日常经营,不直接使用命令行。
4
+
5
+ 记录(写入 memory):门店称呼偏好、是否已开启每日 7:30 提醒推送。
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sophhub",
3
- "version": "0.4.35",
3
+ "version": "0.4.37",
4
4
  "description": "SophHub CLI - Manage and download AI Agent skills and agents",
5
5
  "type": "module",
6
6
  "bin": {
@@ -13,6 +13,7 @@ description: Convert a local file path to a downloadable URL (valid for 24 hours
13
13
 
14
14
  - **必须**使用脚本输出的 `DOWNLOAD_URL` **完整字符串**(一字不改)填入下文展示模板中的下载链接,或原样写入下游。
15
15
  - **禁止**去掉 `?` 及后续查询参数、禁止截取签名片段、禁止尝试「换成更短的裸 URL」或做任何 URL「美化」。
16
+ - 签名 URL 的参数中,**`x-oss-signature-version` 和 `x-oss-credential` 不可省略**,分别为签名算法的版本标识和访问凭证标识,缺失任一参数均会导致签名校验失败。
16
17
  - 若裸域名路径在无签名时可访问,那是偶然行为;本 skill **不以裸链为准**,仅以脚本输出的带签名 URL 为准。
17
18
  - 向用户展示时沿用下文「转换成功后」的固定格式即可;**不要改模板结构**,只保证链接内容为完整签名 URL。
18
19
 
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "store-appointment",
3
+ "version": "1.0.5",
4
+ "types": [
5
+ "store"
6
+ ],
7
+ "displayName": "门店预约与履约",
8
+ "description": "预约创建/改期/取消、服务人员推荐、完成服务结算。触发:预约/改期/做完了/混合支付/多人分成。",
9
+ "changelog": [
10
+ {
11
+ "version": "1.0.5",
12
+ "date": "2026-06-03",
13
+ "changes": [
14
+ "appt-update 改服务错误码统一为 service_not_found"
15
+ ]
16
+ },
17
+ {
18
+ "version": "1.0.4",
19
+ "date": "2026-06-03",
20
+ "changes": [
21
+ "服务不存在时抛 service_not_found,禁止静默 0 元预约/结账",
22
+ "结算逻辑迁至 store-suite store_settlement"
23
+ ]
24
+ },
25
+ {
26
+ "version": "1.0.3",
27
+ "date": "2026-05-29",
28
+ "changes": [
29
+ "独立性合规;Py3.8 typing 降级;scripts/__init__.py"
30
+ ]
31
+ },
32
+ {
33
+ "version": "1.0.2",
34
+ "date": "2026-05-29",
35
+ "changes": [
36
+ "appt-query --member-id/日期区间;appt-update 改服务人员/项目;appt-suggest-slots"
37
+ ]
38
+ },
39
+ {
40
+ "version": "1.0.1",
41
+ "date": "2026-05-29",
42
+ "changes": [
43
+ "规范合规:scripts/cli.py 入口、store-suite 包依赖、Py3.8、JSON 契约、staff-field-def"
44
+ ]
45
+ },
46
+ {
47
+ "version": "1.0.0",
48
+ "date": "2026-05-29",
49
+ "changes": [
50
+ "初版:appt-*/tech-* + appt-complete 混合支付/多人分成"
51
+ ]
52
+ }
53
+ ],
54
+ "createdAt": "2026-05-29",
55
+ "updatedAt": "2026-05-29"
56
+ }
@@ -0,0 +1,66 @@
1
+ ---
2
+ name: store-appointment
3
+ description: 预约创建/改期/取消、服务人员推荐、完成服务结算。触发:预约/改期/做完了/混合支付/多人分成。
4
+ ---
5
+
6
+ # 预约与履约
7
+
8
+ ## 用法
9
+
10
+ ```bash
11
+ uv run {baseDir}/scripts/cli.py <子命令> ...
12
+ ```
13
+
14
+ 默认库:`STORE_DB_PATH`(默认 `%USERPROFILE%\.config\store-suite\store.sqlite3`)。
15
+
16
+ ## 输出格式
17
+
18
+ stdout 单行 JSON:成功 `"ok": true`;需确认 `"error": "need_confirm"`;失败含 `"error"` 码。详见 [references/errors.md](references/errors.md)。
19
+
20
+ ## 主要子命令
21
+
22
+ | 子命令 | 用途 |
23
+ |--------|------|
24
+ | appt-create | 创建预约 |
25
+ | appt-query | 查询预约(--member-id / --date-from / --date-to) |
26
+ | appt-update | 改期 / 改服务人员 / 改项目 |
27
+ | appt-suggest-slots | 冲突备选时段 |
28
+ | appt-cancel --yes | 取消预约 |
29
+ | appt-complete --yes | 完成服务并结算 |
30
+ | tech-recommend | 推荐可用服务人员 |
31
+ | tech-auto-assign | 自动指派服务人员 |
32
+
33
+ ## 自然语言 → 命令
34
+
35
+ | 用户说 | 命令 |
36
+ |--------|------|
37
+ | 给王芳约明天下午基础服务 | `uv run {baseDir}/scripts/cli.py appt-create --member-id M001 --service "基础服务" --datetime "2026-06-01 15:00" --technician-id S001` |
38
+ | 做完了储值扣款 | `uv run {baseDir}/scripts/cli.py appt-complete --appt-id A001 --pay stored_value --yes` |
39
+ | 混合支付 200 储值 98 现金 | `uv run {baseDir}/scripts/cli.py appt-complete --appt-id A001 --pay mixed --lines-json '[{"type":"consume","amount":200},{"type":"cash","amount":98}]' --yes` |
40
+ | 谁有空做基础服务 | `uv run {baseDir}/scripts/cli.py tech-recommend --service "基础服务" --datetime "2026-06-01 15:00"` |
41
+
42
+ 完整口语映射见 [references/verified-queries.md](references/verified-queries.md)。
43
+
44
+ > **预约 ID**:默认 seed 含样例 `A001`;空库须先 `appt-create`。CLI 参数 `--technician-id` 为 schema 字段名,中文称「服务人员」。
45
+
46
+ ## 需要先确认的操作
47
+
48
+ - `appt-cancel`、`appt-complete` 须先展示确认卡片,用户确认后加 `--yes`。
49
+ - 次卡结算须加 `--card-name`(须为会员名下有效次卡名称)。
50
+
51
+ ## 注意事项
52
+
53
+ - 数据库:`STORE_DB_PATH`(默认 `%USERPROFILE%\.config\store-suite\store.sqlite3`)。
54
+ - 完成服务(`appt-complete`)会触发支付、库存扣减、员工业绩写入;库存不足时整单回滚。
55
+ - 混合支付须 `--lines-json`;多人分成须 `--staff-lines-json`。
56
+ - 错误码见 [references/errors.md](references/errors.md)。
57
+
58
+ ## 示例
59
+
60
+ ```bash
61
+ uv run {baseDir}/scripts/cli.py appt-create --member-id M001 --service "基础服务" --datetime "2026-06-01 15:00" --technician-id S001
62
+ uv run {baseDir}/scripts/cli.py appt-complete --appt-id A001 --pay stored_value --yes
63
+ uv run {baseDir}/scripts/cli.py appt-complete --appt-id A002 --pay card --card-name "基础服务10次卡" --yes
64
+ uv run {baseDir}/scripts/cli.py appt-complete --appt-id A003 --pay mixed --lines-json '[{"type":"consume","amount":200},{"type":"cash","amount":98}]' --yes
65
+ uv run {baseDir}/scripts/cli.py appt-complete --appt-id A004 --staff-lines-json '[{"line":0,"staff_id":"S001","role":"primary","split":0.7},{"line":0,"staff_id":"S002","role":"assist","split":0.3}]' --yes
66
+ ```
@@ -0,0 +1,18 @@
1
+ [project]
2
+ name = "store-appointment"
3
+ version = "1.0.4"
4
+ requires-python = ">=3.8"
5
+ dependencies = ["store-suite>=1.1.0"]
6
+
7
+ [project.scripts]
8
+ store-appointment = "store_appointment_lib.cli:main"
9
+
10
+ [tool.setuptools.packages.find]
11
+ where = ["."]
12
+ include = ["store_appointment_lib*"]
13
+
14
+ [tool.uv]
15
+ package = true
16
+
17
+ [tool.uv.sources]
18
+ store-suite = { path = "../../store-suite/src", editable = true }
@@ -0,0 +1,32 @@
1
+ # store-appointment 错误码
2
+
3
+ 预约创建、改期、取消与完成结算。
4
+
5
+ ## 通用
6
+
7
+ | 错误码 | 含义 | 用户指引 |
8
+ |--------|------|----------|
9
+ | `need_confirm` | 取消/完成预约需确认 | 展示金额与支付方式后加 `--yes` |
10
+ | `not_found` | 预约 ID 不存在 | `appt-query --appt-id` 核对 |
11
+ | `service_not_found` | 服务项目不存在或已删 | `store-catalog service-query` 核对名称(含 appt-update 改服务) |
12
+
13
+ ## 排班与服务人员
14
+
15
+ | 错误码 | 含义 | 用户指引 |
16
+ |--------|------|----------|
17
+ | `schedule_conflict` | 时段冲突 | 换时间或服务人员,见 `conflict_id` |
18
+ | `technician_off` | 服务人员当日休息 | 换日期或 `tech-recommend` |
19
+ | `outside_work_slots` | 不在工作时段 | 调整 `--datetime` 或更新排班 |
20
+ | `no_technician_available` | 无可用服务人员 | 改时间或用 `tech-recommend` |
21
+ | `invalid_appt` | 预约状态不可操作 | 仅 scheduled 可改期/完成 |
22
+
23
+ ## 结算(appt-complete)
24
+
25
+ | 错误码 | 含义 | 用户指引 |
26
+ |--------|------|----------|
27
+ | `insufficient_balance` | 储值不足 | 先充值或换支付方式 |
28
+ | `card_not_found` / `card_expired` / `no_times_left` | 次卡问题 | 核对 `--card-name` 或换 pay 模式 |
29
+ | `card_service_mismatch` | 次卡与服务不匹配 | 换卡或改服务 |
30
+ | `payment_sum_mismatch` | 混合支付金额不符 | 核对 lines / cash 合计 |
31
+ | `stock_short` | 耗材库存不足 | 先补货或减少附加产品 |
32
+ | `member_required_for_consume` / `member_required_for_card` | 预约无会员却选储值/次卡 | 核对 member_id 或换支付方式 |
@@ -0,0 +1,25 @@
1
+ # store-appointment 口语 → CLI(verified)
2
+
3
+ > **A001 等预约 ID**:默认 seed 含样例预约 `A001`(王芳 · 基础服务 · 张师傅 S001)。空库或已删预约时,须先 `appt-create`(首条得 `A001`)再改期/完成。
4
+ >
5
+ > **CLI 参数名**:`--technician-id` 为 schema 字段名;界面与 lexicon 中文称「服务人员」。
6
+
7
+ | 用户说 | 命令 |
8
+ |--------|------|
9
+ | 给王芳约明天下午基础服务 | `tech-recommend` → `appt-create --member-id M001 --service "基础服务" --datetime "…" --technician-id S001`(须已知 member_id) |
10
+ | 自动指派服务人员 | `tech-auto-assign --service "基础服务" --datetime "…"` |
11
+ | 谁有空做基础服务 | `tech-recommend --service "基础服务" --datetime "…"` |
12
+ | 王芳还有哪些预约 | `appt-query --member-id M001 --status scheduled` |
13
+ | 今天有哪些预约 | `appt-query --date 2026-05-29` |
14
+ | 本周预约 | `appt-query --date-from 2026-05-26 --date-to 2026-06-01` |
15
+ | 张师傅今天的预约 | `appt-query --technician-id S001 --date 2026-05-29` |
16
+ | 改到后天三点 | `appt-update --appt-id A001 --datetime "2026-06-01 15:00"` |
17
+ | 换服务人员 | `appt-update --appt-id A001 --technician-id S002` |
18
+ | 改预约项目 | `appt-update --appt-id A001 --service "特色服务"` |
19
+ | 取消预约 | `appt-cancel --appt-id A001 --yes` |
20
+ | 时间冲突有什么备选 | `appt-suggest-slots --service "基础服务" --date 2026-06-01` |
21
+ | 做完了储值扣款 | `appt-complete --appt-id A001 --pay stored_value --yes` |
22
+ | 次卡核销 | `appt-complete --appt-id A001 --pay card --card-name "基础服务10次卡" --yes` |
23
+ | 混合支付 | `appt-complete --pay mixed --lines-json '[{"type":"consume","amount":200},{"type":"cash","amount":98}]' --yes` |
24
+ | 次卡加现金加项 | `appt-complete --pay card_plus_cash --card-name "…" --cash-amount 98 --yes` |
25
+ | 两人分成 | `appt-complete --staff-lines-json '[{"line":0,"staff_id":"S001","role":"primary","split":0.7},…]' --yes` |
@@ -0,0 +1 @@
1
+ # scripts package
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env python3
2
+ """CLI entry for store-appointment skill."""
3
+ from __future__ import annotations
4
+
5
+ import sys
6
+ from pathlib import Path
7
+
8
+ ROOT = Path(__file__).resolve().parent.parent
9
+ if str(ROOT) not in sys.path:
10
+ sys.path.insert(0, str(ROOT))
11
+
12
+ from store_appointment_lib.cli import main
13
+
14
+ if __name__ == "__main__":
15
+ raise SystemExit(main())
@@ -0,0 +1 @@
1
+ """Store appointment CLI package."""