@whyshu/argent-engine 0.6.0 → 0.6.1

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 (67) hide show
  1. package/MANIFEST.json +63 -29
  2. package/engine/VERSION +1 -1
  3. package/engine/core/contracts/argent.contracts.json +1 -1
  4. package/engine/scripts/base-bootstrap.sh +2 -1
  5. package/engine/scripts/billing-mode-daily.sh +2 -1
  6. package/engine/scripts/build-engine-package.mjs +5 -2
  7. package/engine/scripts/capability-packs.lock.json +25 -25
  8. package/engine/scripts/check-billing-mode.sh +2 -1
  9. package/engine/scripts/collect-evidence.mjs +42 -0
  10. package/engine/scripts/customer-readiness.sh +2 -1
  11. package/engine/scripts/daily-report.sh +2 -1
  12. package/engine/scripts/dev-window.sh +2 -1
  13. package/engine/scripts/final-check.mjs +43 -0
  14. package/engine/scripts/flow-requirements.json +24 -9
  15. package/engine/scripts/flow-timers-plist.sh +2 -1
  16. package/engine/scripts/flow-timers.sh +3 -1
  17. package/engine/scripts/flow_config.py +2 -1
  18. package/engine/scripts/init-ml.sh +5 -2
  19. package/engine/scripts/invoice-table.sh +2 -1
  20. package/engine/scripts/lib/argent-datadir.sh +18 -0
  21. package/engine/scripts/lib/argent_datadir.py +23 -0
  22. package/engine/scripts/poll-fulfillment.sh +4 -2
  23. package/engine/scripts/poll-invoice.sh +4 -2
  24. package/engine/scripts/provider-select.sh +2 -1
  25. package/engine/scripts/release-argent.sh +1 -1
  26. package/engine/scripts/retire-inventory.mjs +40 -0
  27. package/engine/scripts/run-tests.sh +2 -1
  28. package/engine/scripts/s1-audit.mjs +85 -0
  29. package/engine/scripts/usage-anchor.sh +3 -2
  30. package/engine/scripts/wenyao-browser.sh +3 -2
  31. package/engine/scripts/wenyao-login.sh +3 -2
  32. package/engine/scripts/ziniao-keepalive.sh +2 -1
  33. package/engine/scripts/ziniao-post-upgrade-check.sh +2 -1
  34. package/engine/scripts/ziniao-windows.sh +2 -1
  35. package/engine/skills/README.md +86 -0
  36. package/engine/skills/argent-dev/SKILL.md +41 -0
  37. package/engine/skills/internal.json +37 -0
  38. package/engine/skills/lktop-pm/SKILL.md +35 -0
  39. package/engine/skills/lktopapp-dev/SKILL.md +34 -0
  40. package/engine/skills/ml-config-guide/SKILL.md +50 -0
  41. package/engine/skills/ml-fulfillment-sop/SKILL.md +178 -0
  42. package/engine/skills/ml-fulfillment-sop/references/andes-components.md +69 -0
  43. package/engine/skills/ml-fulfillment-sop/references/cdp-port-mapping.md +35 -0
  44. package/engine/skills/ml-fulfillment-sop/references/feishu-base-fulfillment-schema.md +136 -0
  45. package/engine/skills/ml-fulfillment-sop/references/multi-window-concurrency.md +69 -0
  46. package/engine/skills/ml-fulfillment-sop/references/pitfalls.md +77 -0
  47. package/engine/skills/ml-fulfillment-sop/references/selectors.md +243 -0
  48. package/engine/skills/ml-fulfillment-sop/scripts/fulfillment.js +586 -0
  49. package/engine/skills/ml-fulfillment-sop/scripts/poll-and-execute.sh +271 -0
  50. package/engine/skills/ml-fulfillment-sop/templates/report.md +55 -0
  51. package/engine/skills/ml-invoice/SKILL.md +506 -0
  52. package/engine/skills/ml-invoice/references/pitfalls.md +268 -0
  53. package/engine/skills/ml-invoice/references/portal-flow.md +360 -0
  54. package/engine/skills/ml-invoice/references/template-fill-contract.md +133 -0
  55. package/engine/skills/ml-invoice-xzh/SKILL.md +133 -0
  56. package/engine/skills/ml-invoice-xzh/references/pitfalls.md +230 -0
  57. package/engine/skills/ml-store-daily-report/SKILL.md +224 -0
  58. package/engine/skills/ml-store-daily-report/scripts/README.md +25 -0
  59. package/engine/skills/ml-store-daily-report/scripts/extract.js +691 -0
  60. package/engine/skills/ml-store-daily-report/scripts/generate.js +299 -0
  61. package/engine/skills/pet-dev/SKILL.md +42 -0
  62. package/engine/skills/whyshu-pm/SKILL.md +35 -0
  63. package/engine/skills/whyshu-web-dev/SKILL.md +50 -0
  64. package/engine/version.mjs +1 -1
  65. package/engine/verticals/mercadolibre/flows.json +37 -5
  66. package/package.json +3 -2
  67. package/requirements.txt +5 -0
@@ -0,0 +1,299 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * ml-store-daily-report generate script
4
+ * Converts extract.js JSON output into a formatted Chinese Markdown daily report.
5
+ *
6
+ * Input (single store, backward compatible):
7
+ * { "store": "墨西哥站", "orders": {...}, "reputation": {...}, ... }
8
+ *
9
+ * Input (multi store, v1.1.0):
10
+ * { "stores": [{ "store": "墨西哥站", "orders": {...}, ... }, ...] }
11
+ *
12
+ * Usage:
13
+ * node generate.js data.json # Markdown output
14
+ * node generate.js data.json --json # JSON output {markdown, push}
15
+ * node generate.js data.json --push # Push card JSON only
16
+ * cat data.json | node generate.js # Markdown from stdin
17
+ */
18
+
19
+ function normalizeInput(data) {
20
+ if (data.stores && Array.isArray(data.stores) && data.stores.length > 0) {
21
+ return data.stores;
22
+ }
23
+ // Single store — wrap in array for uniform processing
24
+ return [data];
25
+ }
26
+
27
+ function generateReport(data) {
28
+ const stores = normalizeInput(data);
29
+ const lines = [];
30
+ const date = stores[0]?.date || new Date().toISOString().slice(0, 10);
31
+
32
+ // ---- Header ----
33
+ if (stores.length === 1) {
34
+ const s = stores[0];
35
+ const storeName = s.store && s.store !== '未知站' ? s.store : '墨西哥站';
36
+ lines.push('# 美客多运营日报');
37
+ lines.push(`**日期**: ${date} | **店铺**: ${storeName} | **站点**: 墨西哥`);
38
+ } else {
39
+ lines.push('# 美客多运营日报(多店铺汇总)');
40
+ lines.push(`**日期**: ${date} | **店铺数**: ${stores.length}`);
41
+ }
42
+ lines.push('');
43
+
44
+ // ---- 汇总概览 ----
45
+ if (stores.length > 1) {
46
+ lines.push('## 📦 汇总概览');
47
+ lines.push('| 店铺 | 订单量 | 销售额 | 退货 | 声誉 |');
48
+ lines.push('|------|--------|--------|------|------|');
49
+
50
+ let totalOrders = 0, totalAmount = 0, totalReturns = 0;
51
+ for (const s of stores) {
52
+ const count = s.orders?.count ?? 0;
53
+ const amount = s.orders?.total_amount_mxn ?? 0;
54
+ const returns = s.after_sales?.pending ?? 0;
55
+ const repScore = s.reputation?.score || '—';
56
+ totalOrders += Number(count) || 0;
57
+ totalAmount += Number(amount) || 0;
58
+ totalReturns += Number(returns) || 0;
59
+ lines.push(`| ${s.store || '—'} | ${count || '—'} | ${amount ? '$' + amount.toFixed(2) : '—'} | ${returns || '—'} | ${repScore} |`);
60
+ }
61
+ lines.push(`| **合计** | **${totalOrders}** | **$${totalAmount.toFixed(2)}** | **${totalReturns}** | — |`);
62
+ lines.push('');
63
+ }
64
+
65
+ // ---- 逐店详情 ----
66
+ for (const s of stores) {
67
+ const sectionTitle = stores.length > 1
68
+ ? `## 📊 ${s.store || '未知站'}`
69
+ : '## 📦 数据概览';
70
+
71
+ lines.push(sectionTitle);
72
+ if (stores.length === 1) {
73
+ lines.push('| 指标 | 今日 | 环比昨日 |');
74
+ lines.push('|------|------|----------|');
75
+ } else {
76
+ lines.push('| 指标 | 今日 |');
77
+ lines.push('|------|------|');
78
+ }
79
+
80
+ const orderCount = s.orders?.count ?? '—';
81
+ const totalAmount = s.orders?.total_amount_mxn != null
82
+ ? `$${s.orders.total_amount_mxn.toFixed(2)}`
83
+ : '—';
84
+ const returns = s.after_sales?.pending ?? 0;
85
+
86
+ lines.push(`| 订单量 | ${orderCount} |${stores.length === 1 ? ' — |' : ''}`);
87
+ lines.push(`| 销售额 | ${totalAmount}${totalAmount === '—' ? '' : ' MXN'} |${stores.length === 1 ? ' — |' : ''}`);
88
+ lines.push(`| 退货/售后 | ${returns} |${stores.length === 1 ? ' — |' : ''}`);
89
+ // Show order detail count only for real parsed items (skip metrics synthetic entry)
90
+ const realItems = (s.orders?.items || []).filter(item => item.sku !== 'METRICS');
91
+ if (realItems.length > 0) lines.push(`| 订单明细数 | ${realItems.length} |${stores.length === 1 ? ' — |' : ''}`);
92
+ lines.push('');
93
+
94
+ // 发货
95
+ if (s.shipping) {
96
+ const sh = s.shipping;
97
+ lines.push('### 🚚 发货');
98
+ lines.push(`今日 ${sh.today ?? 0} | 未来 ${sh.upcoming ?? 0} | 运输中 ${sh.in_transit ?? 0}`);
99
+ lines.push('');
100
+ }
101
+
102
+ // 声誉
103
+ const rep = s.reputation || {};
104
+ lines.push('### 🌟 声誉');
105
+ if (rep.level) {
106
+ const emoji = rep.level.includes('Gold') ? '🥇' : rep.level.includes('Platinum') ? '🥈' : rep.level.includes('Silver') ? '🥉' : '';
107
+ lines.push(`**${emoji} ${rep.level}**${rep.score ? ` 评分: ${rep.score}` : ''}`);
108
+ } else if (rep.score) {
109
+ lines.push(`**评分**: ${rep.score}`);
110
+ }
111
+ if (rep.complaints) {
112
+ const c = rep.complaints;
113
+ const parts = [];
114
+ if (c.reclamos_pct != null) parts.push(`Reclamos ${c.reclamos_pct}`);
115
+ if (c.mediaciones_pct != null) parts.push(`Mediaciones ${c.mediaciones_pct}`);
116
+ if (c.cancel_pct != null) parts.push(`取消率 ${c.cancel_pct}`);
117
+ if (c.envio_err_pct != null) parts.push(`错误发货 ${c.envio_err_pct}`);
118
+ if (parts.length > 0) lines.push(parts.join(' | '));
119
+ }
120
+ if (rep.new_questions != null) lines.push(`新买家提问: ${rep.new_questions} 条`);
121
+ const hasRep = rep.level || rep.score || rep.complaints || rep.new_questions != null;
122
+ if (!hasRep) lines.push('*暂无声誉数据*');
123
+ lines.push('');
124
+
125
+ // FULL
126
+ const full = s.full || {};
127
+ lines.push('### 📦 FULL 库存');
128
+ if (full.pending_count != null) lines.push(`待处理货件: ${full.pending_count} 件`);
129
+ if (full.not_apt_total > 0) lines.push(`不适配 FULL: ${full.not_apt_total} 单位`);
130
+ if (full.shipments && full.shipments.length > 0) {
131
+ for (const sh of full.shipments) {
132
+ const emoji = sh.status === 'Vencido' ? '❌' : sh.status === 'En preparación' ? '🔄' : '✅';
133
+ lines.push(`- ${emoji} #${sh.id || '—'} ${sh.status} | 申报:${sh.declared ?? '?'} 适配:${sh.apt_for_full ?? '?'} | ${sh.appointment || '—'}`);
134
+ }
135
+ } else {
136
+ lines.push('*暂无 FULL 货件数据*');
137
+ }
138
+
139
+ // Alerts
140
+ const alerts = _collectAlerts(s);
141
+ if (alerts.length > 0) {
142
+ lines.push('');
143
+ lines.push('### ⚠️ 告警');
144
+ for (const a of alerts) lines.push(`- ${a}`);
145
+ }
146
+
147
+ lines.push('');
148
+ }
149
+
150
+ return lines.join('\n');
151
+ }
152
+
153
+ function _collectAlerts(data) {
154
+ const items = [];
155
+ const rep = data.reputation || {};
156
+ const full = data.full || {};
157
+
158
+ if (data.alerts && data.alerts.length > 0) {
159
+ for (const a of data.alerts) {
160
+ switch (a) {
161
+ case 'auth_code_missing': items.push('🔴 授权码缺失'); break;
162
+ case 'no_orders_found': items.push('🟡 无订单数据'); break;
163
+ case 'pending_after_sales': items.push(`🔴 售后待处理 ${data.after_sales?.pending ?? 0} 单`); break;
164
+ default: items.push(`🟡 ${a}`);
165
+ }
166
+ }
167
+ }
168
+ if (rep.complaints) {
169
+ const c = rep.complaints;
170
+ if (c.reclamos_pct && parseFloat(c.reclamos_pct) > 5) items.push(`🔴 Reclamos 过高 ${c.reclamos_pct}`);
171
+ if (c.mediaciones_pct && parseFloat(c.mediaciones_pct) > 3) items.push(`🔴 Mediaciones 过高 ${c.mediaciones_pct}`);
172
+ if (c.cancel_pct && parseFloat(c.cancel_pct) > 5) items.push(`🟡 取消率过高 ${c.cancel_pct}`);
173
+ }
174
+ if (full.shipments) {
175
+ const expired = full.shipments.filter(s => s.status === 'Vencido');
176
+ if (expired.length > 0) items.push(`🔴 ${expired.length} 件货件过期`);
177
+ }
178
+ return items;
179
+ }
180
+
181
+ // ================================================================
182
+ // Push data builder
183
+ // ================================================================
184
+
185
+ function buildPushData(data) {
186
+ const stores = normalizeInput(data);
187
+ const multi = stores.length > 1;
188
+ const date = stores[0]?.date || new Date().toISOString().slice(0, 10);
189
+
190
+ // Aggregate metrics
191
+ let totalOrders = 0, totalAmount = 0, totalReturns = 0;
192
+ const perStore = [];
193
+ const allAlerts = [];
194
+
195
+ for (const s of stores) {
196
+ const count = Number(s.orders?.count) || 0;
197
+ const amount = Number(s.orders?.total_amount_mxn) || 0;
198
+ const returns = Number(s.after_sales?.pending) || 0;
199
+ totalOrders += count;
200
+ totalAmount += amount;
201
+ totalReturns += returns;
202
+
203
+ perStore.push({ store: s.store || '未知', count, amount, returns, score: s.reputation?.score || '' });
204
+
205
+ const alerts = _collectAlerts(s);
206
+ if (alerts.length > 0) allAlerts.push({ store: s.store, alerts });
207
+ }
208
+
209
+ const metrics = [
210
+ { label: '总订单', value: String(totalOrders), change: '' },
211
+ { label: '总销售额', value: `$${totalAmount.toFixed(2)} MXN`, change: '' },
212
+ ];
213
+ if (totalReturns > 0) metrics.push({ label: '退货/售后', value: String(totalReturns), change: '' });
214
+
215
+ // Per-store breakdown as highlight
216
+ const breakdown = multi
217
+ ? perStore.map(p => `${p.store}: ${p.count}单 $${p.amount.toFixed(2)}`).join('\n')
218
+ : '';
219
+
220
+ // Alerts
221
+ let highlight = '';
222
+ if (allAlerts.length > 0) {
223
+ const alertSummary = allAlerts.map(a => `⚠️ ${a.store}: ${a.alerts.slice(0, 2).join('、')}`).join('\n');
224
+ highlight = alertSummary;
225
+ } else if (multi) {
226
+ highlight = '今日所有店铺运营数据正常';
227
+ } else {
228
+ highlight = '今日运营数据正常';
229
+ }
230
+
231
+ return {
232
+ card: {
233
+ template: 'daily_report',
234
+ data: {
235
+ title: multi ? `美客多运营日报(${stores.length}店汇总)` : '美客多运营日报',
236
+ date,
237
+ store: multi ? `${stores.length} 个店铺` : (stores[0]?.store || '—'),
238
+ metrics,
239
+ highlight: breakdown ? `${breakdown}\n\n${highlight}` : highlight,
240
+ },
241
+ },
242
+ };
243
+ }
244
+
245
+ // ---- CLI Entry ----
246
+ function main() {
247
+ const args = process.argv.slice(2).filter(a => a !== '--json' && a !== '--push');
248
+ const mode = process.argv.includes('--push') ? 'push'
249
+ : process.argv.includes('--json') ? 'json'
250
+ : 'markdown';
251
+ const fileArg = args[0];
252
+
253
+ function processJSON(input) {
254
+ try {
255
+ const data = JSON.parse(input);
256
+ const markdown = generateReport(data);
257
+
258
+ if (mode === 'push') {
259
+ console.log(JSON.stringify(buildPushData(data), null, 2));
260
+ } else if (mode === 'json') {
261
+ console.log(JSON.stringify({ markdown, push: buildPushData(data) }, null, 2));
262
+ } else {
263
+ console.log(markdown);
264
+ }
265
+ } catch (e) {
266
+ console.error('Error: Invalid JSON input — ' + e.message);
267
+ process.exit(1);
268
+ }
269
+ }
270
+
271
+ if (fileArg) {
272
+ const fs = require('fs');
273
+ let content;
274
+ try {
275
+ content = fs.readFileSync(fileArg, 'utf8');
276
+ } catch (e) {
277
+ console.error(`Error: Cannot read file "${fileArg}" — ${e.message}`);
278
+ process.exit(1);
279
+ }
280
+ processJSON(content);
281
+ } else {
282
+ let input = '';
283
+ process.stdin.setEncoding('utf8');
284
+ process.stdin.on('data', chunk => { input += chunk; });
285
+ process.stdin.on('end', () => {
286
+ if (!input.trim()) {
287
+ console.error('Error: No input received.');
288
+ process.exit(1);
289
+ }
290
+ processJSON(input);
291
+ });
292
+ }
293
+ }
294
+
295
+ if (require.main === module) {
296
+ main();
297
+ } else {
298
+ module.exports = { generateReport, buildPushData, normalizeInput };
299
+ }
@@ -0,0 +1,42 @@
1
+ ---
2
+ name: pet-dev
3
+ description: 云宠乐园开发者角色技能:问述服务器部署(whyshu-deploy)与 whyshu pet 开发知识。接 whyshu-pm 任务,完成后飞书群 @ 汇报。
4
+ version: 1.0.0
5
+ author: 问述科技 (Whyshu)
6
+ license: MIT
7
+ metadata:
8
+ argent:
9
+ role: pet-dev
10
+ tags: [pet, whyshu, deploy]
11
+ ---
12
+
13
+ # 云宠乐园开发者(pet-dev)
14
+
15
+ ## 角色定位
16
+
17
+ 云宠乐园(whyshu pet)产品开发者,负责需求实现、缺陷修复、代码评审与发布。
18
+
19
+ ## 核心知识入口
20
+
21
+ - **问述服务器部署**:使用 `whyshu-deploy` 技能(问述科技 whyshu 项目部署专用)完成
22
+ whyshu-svr(Fastify 后端)与 whyshu-web(Next.js 前端)的构建、部署与验证。
23
+ - **pet 开发知识**:以 `/Users/chester/Code/whyshu` 仓库为准——
24
+ - `whyshu/docs/`:产品文档与策划案
25
+ - `whyshu-svr/`:后端服务(路由/服务/数据层)
26
+ - `whyshu-web/`:前端(app 路由 / argent 页面等)
27
+ - 部署目标服务器:**问述科技**腾讯云 `81.69.222.211`(域名 `whyshu.com`,私钥 `~/.ssh/whyshu.pem`);
28
+ **IP / 私钥 / 部署目录以 `whyshu-deploy` 技能为唯一判据**(本行只作定位,变更以该技能为准)。
29
+ ⛔ LKTOP(力库拓,**另一腾讯云账号**)的服务器 / 部署目录 / 私钥与本角色无关,**一律不得使用**——
30
+ 本技能此前曾误写 LKTOP 的服务器 IP,是 2026-10-04 修掉的一处**跨业务事实错配**
31
+ (据 `docs/Argent-角色合并与收敛-操作方案-2026-10-04.md` §2.6)。
32
+
33
+ ## 协作流
34
+
35
+ 1. whyshu-pm 在飞书群 @ 开发者分配任务并附验收标准(旧看板已退场;新任务机制上线前以此为准);
36
+ 2. 在飞书群/会话中确认需求与验收标准;
37
+ 3. 完成后在飞书群 @whyshu-pm 汇报(改动摘要 + 验证结果)。
38
+
39
+ ## 红线
40
+
41
+ - 部署/发布前核对目标环境与回滚预案;
42
+ - 涉及生产数据/凭据的操作先与用户确认。
@@ -0,0 +1,35 @@
1
+ ---
2
+ name: whyshu-pm
3
+ description: 问述科技PM角色技能:策划案需求掌握与任务分发(飞书群 @ + 会话),验收闭环。
4
+ version: 1.0.0
5
+ author: 问述科技 (Whyshu)
6
+ license: MIT
7
+ metadata:
8
+ argent:
9
+ role: whyshu-pm
10
+ tags: [pm, planning, task]
11
+ ---
12
+
13
+ # 问述科技PM(whyshu-pm)
14
+
15
+ ## 角色定位
16
+
17
+ 问述科技产品经理:掌握策划案需求,拆解并分发任务给开发者,验收闭环。
18
+
19
+ ## 核心知识入口
20
+
21
+ - **策划案需求**:`/Users/chester/Code/whyshu/docs/products/`(如
22
+ `argent-edition-multi-instance-plan.md`、`argent-service-monetization.md` 等)
23
+ - **任务分发**:lark-task(飞书任务)/ lark-doc(需求文档)/ lark-im(群通知)
24
+
25
+ ## 协作流
26
+
27
+ 1. 需求拆解 → 在飞书群 @ 开发者派单(旧看板已退场;新任务机制上线前以此为准)(必须含:标题、描述、验收标准、优先级、截止时间);
28
+ 2. 分配给云宠乐园开发者(pet-dev)/ Argent开发者(argent-dev);
29
+ 3. 分配完成后在飞书群 @ 对应开发者 Bot 通知(标题/链接/验收标准);
30
+ 4. 开发者完成 @ 汇报 → 查看改动与验证 → 在飞书群/会话中确认验收或打回并说明原因;
31
+ 5. 用户会在群中直接指正,及时响应。
32
+
33
+ ## 约定
34
+
35
+ - 任务信息在会话与飞书群保持同步;派单信息完整,避免开发者猜测。
@@ -0,0 +1,50 @@
1
+ ---
2
+ name: whyshu-web-dev
3
+ description: 问述官网开发者角色技能:whyshu.com 官网(whyshu-web Next.js 项目)开发与部署(whyshu-deploy)。接 whyshu-pm 任务,完成后飞书群 @ 汇报。
4
+ version: 1.0.0
5
+ author: 问述科技 (Whyshu)
6
+ license: MIT
7
+ metadata:
8
+ argent:
9
+ role: whyshu-web-dev
10
+ tags: [whyshu-web, website, frontend, deploy]
11
+ ---
12
+
13
+ # 问述官网开发者(whyshu-web-dev)
14
+
15
+ ## 角色定位
16
+
17
+ whyshu.com 官网(whyshu-web 项目)开发者,负责官网需求实现、页面开发、缺陷修复、构建部署与线上验证。
18
+
19
+ ## 核心知识入口
20
+
21
+ - **官网代码仓库**:`/Users/chester/Code/whyshu-web`(Next.js 16 静态导出项目,
22
+ `output: "export"`,构建产物在 `out/`;含 nginx/ 配置与 whyshu.com 站点结构)
23
+ - **部署技能**:使用 `whyshu-deploy` 技能(问述科技 whyshu 项目部署专用)完成
24
+ whyshu-web 的构建、部署与验证——服务器腾讯云 `81.69.222.211`(域名 `whyshu.com`),
25
+ 前端部署路径 `/var/www/whyshu-web/`,rsync 部署**禁止 `--delete`**(保留旧 chunk 防缓存白屏)。
26
+ - **需求文档**:`/Users/chester/Code/whyshu/docs/`(产品文档与策划案,如 `docs/products/` 下策划案)
27
+ - **相关仓库**:`/Users/chester/Code/whyshu`(产品文档/资产)、`/Users/chester/Code/whyshu-svr`(后端 API,
28
+ 官网页面涉及接口时参考 `whyshu-svr` 的 API_CONTRACT.md)
29
+ - **腾讯云 API 凭据(2026-09-10 起统一用子账号,唯一入口)**:
30
+ - 凭据文件 `~/.tccli/whyshu-sub.credential`(600 权限,子账号 `svc-argent-ops`;主账号 UIN 100000884591)
31
+ - 调用工具 `~/Code/whyshu-svr/scripts/tc-api.py`(TC3-HMAC-SHA256 签名,仅标准库,不回显密钥):
32
+ `python3 scripts/tc-api.py --profile whyshu-sub --service ssl --action DescribeCertificates --region ap-shanghai --params '{"Limit":50}'`
33
+ - 覆盖范围:SSL 证书(`ssl:*`)、轻量实例 `lhins-3vjhv134`(上海 81.69.222.211,快照/防火墙/重启;`Describe*` 全量)、whyshu.com 解析(DNSPod)
34
+ - **Whyshu 旧凭据已退役**:仅 `~/.tccli/whyshu.credential`(Whyshu 旧 OAuth 临时凭据)已移至 `~/.tccli/_deprecated-20260910/` → 对 Whyshu 不要再 `tccli auth login`、不要复用该 profile
35
+ - ⚠️ **范围边界(勿动)**:`~/.tccli/default.credential`、`~/.tccli/likituo.credential` **不属于 Whyshu**(LKTOP/力库拓账号,default 被 LKTOP 侧流程引用)→ 不得归档、覆盖、删除或改写
36
+ - 完整说明与红线:`whyshu-svr/docs/tencent-cloud-subaccount-guide.md`
37
+
38
+ ## 协作流
39
+
40
+ 1. whyshu-pm 在飞书群 @ 开发者分配任务并附验收标准(旧看板已退场;新任务机制上线前以此为准);
41
+ 2. 在飞书群/会话中确认需求与验收标准后再动手;
42
+ 3. 完成后在飞书群 @whyshu-pm 汇报(改动摘要 + 验证结果)。
43
+
44
+ ## 红线
45
+
46
+ - 部署/发布前核对目标环境与回滚预案;
47
+ - 生产域名 `whyshu.com` 下 rsync **禁用 `--delete`**(IP 预览阶段可清理);
48
+ - 涉及生产数据/凭据/服务器配置的操作先与用户确认;
49
+ - **腾讯云操作只用子账号 `whyshu-sub`**(见上「腾讯云 API 凭据」):不新建/不复用其他腾讯云密钥,不购买付费资源(证书/套餐/带宽),不执行重装系统、重置密码、删除实例、变更套餐;**不触碰 LKTOP 资源**(LKTOP 属另一腾讯云账号 APPID 1331053332)。SSH 部署用的 `~/.ssh/whyshu.pem` 是服务器密钥,与腾讯云 CAM 凭据无关,继续使用;
50
+ - 代码改动在开发仓库(`/Users/chester/Code/whyshu-web`)修改并 git commit + push 提交。
@@ -1 +1 @@
1
- export const VERSION = "0.6.0"
1
+ export const VERSION = "0.6.1"
@@ -223,7 +223,17 @@
223
223
  "_note": "停滞票自动回收:租约到期从未派发的票重排回候选(写 requeued 事件)。保守参数:超 60 分钟才回收、每轮最多 3 张、回收前先过环境预检、同票 30 分钟内不重复回收",
224
224
  "_throttleNote": "停滞回收也降到每轮 1 张:回收后同轮大批派发正是 2026-09-23 限流的放大器。"
225
225
  },
226
- "_migrated": "2026-09-29 P2a:从 base 迁入业务线,路径命名空间化(角色/preset/能力 id 仍是旧名,待 P2b/P5)"
226
+ "_migrated": "2026-09-29 P2a:从 base 迁入业务线,路径命名空间化(角色/preset/能力 id 仍是旧名,待 P2b/P5)",
227
+ "runner": {
228
+ "script": "orchestrator.py",
229
+ "args": [
230
+ "--mode",
231
+ "full",
232
+ "--record-id",
233
+ "{ticket}"
234
+ ],
235
+ "_note": "0.7.0 W2:FULL 走编排器(--mode full)"
236
+ }
227
237
  },
228
238
  "wenyao-invoice": {
229
239
  "title": "上海文鳐发票流程",
@@ -466,7 +476,15 @@
466
476
  "_note": "与 capability 共同部分的**显式差异**(C9 门禁要求差异必须写在这里):requiredExtra = 该集成额外要求运营提供的字段(不同货代的门户/模板不同)"
467
477
  },
468
478
  "integration": "wenyao",
469
- "_migrated": "2026-09-29 P2a:从 base 迁入业务线,路径命名空间化(角色/preset/能力 id 仍是旧名,待 P2b/P5)"
479
+ "_migrated": "2026-09-29 P2a:从 base 迁入业务线,路径命名空间化(角色/preset/能力 id 仍是旧名,待 P2b/P5)",
480
+ "runner": {
481
+ "script": "wenyao_run.py",
482
+ "args": [
483
+ "--shipment",
484
+ "{ticket}"
485
+ ],
486
+ "_note": "0.7.0 W2:文鳐 runner;⚠️ 还需 --english-name(由流程上下文/LLM 提供)⇒ 完整驱动属 W3"
487
+ }
470
488
  },
471
489
  "xzh-invoice": {
472
490
  "title": "鑫中航发票流程",
@@ -620,7 +638,15 @@
620
638
  "_note": "与 capability 共同部分的**显式差异**(C9 门禁要求差异必须写在这里):requiredExtra = 该集成额外要求运营提供的字段(不同货代的门户/模板不同)"
621
639
  },
622
640
  "integration": "xzh",
623
- "_migrated": "2026-09-29 P2a:从 base 迁入业务线,路径命名空间化(角色/preset/能力 id 仍是旧名,待 P2b/P5)"
641
+ "_migrated": "2026-09-29 P2a:从 base 迁入业务线,路径命名空间化(角色/preset/能力 id 仍是旧名,待 P2b/P5)",
642
+ "runner": {
643
+ "script": "invoice_lip_runner.py",
644
+ "args": [
645
+ "--record-id",
646
+ "{ticket}"
647
+ ],
648
+ "_note": "0.7.0 W2:执行面 runner 声明(CLI `argent run` 只认这里,⛔ 不在 CLI 里写第二份名单)"
649
+ }
624
650
  },
625
651
  "daily-report": {
626
652
  "title": "美客多店铺日报",
@@ -695,7 +721,13 @@
695
721
  }
696
722
  ],
697
723
  "capability": "daily-report",
698
- "_migrated": "2026-09-29 P2a:从 base 迁入业务线,路径命名空间化(角色/preset/能力 id 仍是旧名,待 P2b/P5)"
724
+ "_migrated": "2026-09-29 P2a:从 base 迁入业务线,路径命名空间化(角色/preset/能力 id 仍是旧名,待 P2b/P5)",
725
+ "runner": {
726
+ "script": "daily-report.mjs",
727
+ "args": [],
728
+ "ticketless": true,
729
+ "_note": "0.7.0 W2:日报是**无票流程**(内部按店铺/日期遍历)⇒ ticketless;args 不带 {ticket}"
730
+ }
699
731
  }
700
732
  },
701
733
  "capabilities": {},
@@ -703,4 +735,4 @@
703
735
  "units": {}
704
736
  },
705
737
  "_aliasNote": "旧 id(full / wenyao-invoice / xzh-invoice / daily-report)→ 规范 id;迁移期兜底,P2b/P5 随调用点改完后删除。"
706
- }
738
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whyshu/argent-engine",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "Argent 引擎(L1):流程/台账/重试/守卫/审计/浏览器自动化 —— 逐字节来自 argent-dsh 仓库",
5
5
  "type": "module",
6
6
  "engines": {
@@ -8,7 +8,8 @@
8
8
  },
9
9
  "files": [
10
10
  "engine/",
11
- "MANIFEST.json"
11
+ "MANIFEST.json",
12
+ "requirements.txt"
12
13
  ],
13
14
  "exports": {
14
15
  "./version": "./engine/version.mjs",
@@ -0,0 +1,5 @@
1
+ openpyxl
2
+ pyyaml
3
+ pillow
4
+ playwright
5
+ selenium