@whyshu/argent-engine 0.7.5 → 0.7.6
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/MANIFEST.json +5 -5
- package/engine/VERSION +1 -1
- package/engine/scripts/appointment-create.mjs +28 -1
- package/engine/scripts/appointment_grab.py +10 -0
- package/engine/scripts/release-argent.sh +11 -1
- package/engine/skills/ml-full-appointment/SKILL.md +12 -1
- package/engine/version.mjs +1 -1
- package/package.json +1 -1
package/MANIFEST.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"schema": 1,
|
|
3
3
|
"package": "@whyshu/argent-engine",
|
|
4
4
|
"files": {
|
|
5
|
-
"VERSION": "
|
|
5
|
+
"VERSION": "94ca3eced7cb380b15f80484b8c28e8be79da390a3cfe413b514442494ce789a",
|
|
6
6
|
"agents/catalog.json": "5356a812f2554dfd3115370363d4c3f787a82c9e5928a85d05b2a07c9e4b324d",
|
|
7
7
|
"configs/_aliases.proposed.json": "3a59edf80563bcc20d410d488decad6fd787bd3de9489321367b0783904cd3e5",
|
|
8
8
|
"configs/_migration-plan.proposed.json": "dd9f90b0b9b2f217dd23367a618402e57997d44f7fddcfa88a7cadf52e056c0d",
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
"core/mcp/server.mjs": "cb4d4a1150ee96cc950ff598be76b0dc695fdc0c739c9f78a7da9f4293a6369a",
|
|
45
45
|
"scripts/_engine_rules_probe.py": "ad8f45dc0f37852259461a25fb648b11df818089ba40f980dfa72b7e201a03d9",
|
|
46
46
|
"scripts/analyze-full-day.py": "2ee87f3f27929cd9407109121e670b56c296f39b0a3e18b075524b54a7d4471c",
|
|
47
|
-
"scripts/appointment-create.mjs": "
|
|
47
|
+
"scripts/appointment-create.mjs": "3edf28b9bdae31612aeea6fdd13c10e7d5e5a3bafc933497db8e275bde2ecb23",
|
|
48
48
|
"scripts/appointment-stop.mjs": "2e0a965346d33ef8683da5473c48df7f4e66ee8a3167526ee6b568e1adf5c91d",
|
|
49
49
|
"scripts/appointment-worker.mjs": "2b5b6951233704bae46d55898cabc42d004424e66515f15930e34a377462a31e",
|
|
50
|
-
"scripts/appointment_grab.py": "
|
|
50
|
+
"scripts/appointment_grab.py": "f78fe11350b81b5e8172e2a5d221cca2d6ec9a1257a4c4a61e3c3dfe843344dd",
|
|
51
51
|
"scripts/archive/feishu-bridge.js": "e6714c72022892d0c527d1fc9ae0f8ff99f9ab3bd0363329979b423246684885",
|
|
52
52
|
"scripts/argent-agents.mjs": "73f4a058df2cd6d62b285ea48a5e32881db678b63007d1ac2f218005cb28c18d",
|
|
53
53
|
"scripts/argent-capabilities.mjs": "7186d7c19f733d987a7afe2355dd7d788333a15c0f80811c4cde4e7a32584c4e",
|
|
@@ -257,7 +257,7 @@
|
|
|
257
257
|
"scripts/provider-sync-target.check.mjs": "f4a1fcb2724724f895053d2401b6f3701a76594f8dbec3f3045db66901f3f135",
|
|
258
258
|
"scripts/python-runtime.sh": "7831db3ec43e8f9a5cdf519aa50960918c2f7126992494626b7886e219db4967",
|
|
259
259
|
"scripts/query_runner.py": "9dca3900c30a2404d2942af5627743d1322da25cf31bf3918e72af1024270687",
|
|
260
|
-
"scripts/release-argent.sh": "
|
|
260
|
+
"scripts/release-argent.sh": "fb1fb642d8ba6b5746220781d7ab0541ff699c565bcc20c655c246e25293319c",
|
|
261
261
|
"scripts/repair-unresolved-tools.mjs": "bcdeb4a1fe9544a304248880804e29a0dccf251d93eeea1a7608e2aa4e03f10a",
|
|
262
262
|
"scripts/retire-inventory.mjs": "c9dda33d9ac741a45459bbf8088e3a50f8eb2bed83cc819ef850e780d7bf8c09",
|
|
263
263
|
"scripts/run-tests.sh": "4297f8d5309a6c2ee15e9db1a894c43051c1a5bbe0e1a9fcfef36f2773ff2bcd",
|
|
@@ -318,7 +318,7 @@
|
|
|
318
318
|
"skills/ml-fulfillment-sop/scripts/fulfillment.js": "8de1ea386ebfe628caf4eaf2df5f1941938c07d4b8b2dcf79a78d45ac231669f",
|
|
319
319
|
"skills/ml-fulfillment-sop/scripts/poll-and-execute.sh": "ab52c3e643dc434e1c72e716f60514fab91b7b48a2b3e4d611e818720b31831a",
|
|
320
320
|
"skills/ml-fulfillment-sop/templates/report.md": "928298680c9336659905bdf12f0518a781c9f4b9045db26077ea1cd8d3f087b9",
|
|
321
|
-
"skills/ml-full-appointment/SKILL.md": "
|
|
321
|
+
"skills/ml-full-appointment/SKILL.md": "c980bff8c17ab30cf4706597191bae1225d39cb773d4f63850c55ca8dfdb5e09",
|
|
322
322
|
"skills/ml-invoice-xzh/SKILL.md": "8d4002e56f931350f625a427f38d700f1f0edc56482afb6be71f099131e07cd9",
|
|
323
323
|
"skills/ml-invoice-xzh/references/pitfalls.md": "e77e5ac70ddc018ad484ee6a03ec32aa38290d76920a13c27bb42a4f78f415e5",
|
|
324
324
|
"skills/ml-invoice/SKILL.md": "bbc41260a0d0eeed23eac0a39bc1cf30b015f419c76e33aaab03c374b9df47c6",
|
package/engine/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.7.
|
|
1
|
+
0.7.6
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import fs from 'node:fs';
|
|
9
9
|
import os from 'node:os';
|
|
10
|
+
import path from 'node:path';
|
|
10
11
|
|
|
11
12
|
function arg(name, fallback = '') {
|
|
12
13
|
const i = process.argv.indexOf(name);
|
|
@@ -15,9 +16,35 @@ function arg(name, fallback = '') {
|
|
|
15
16
|
const raw = arg('--json');
|
|
16
17
|
if (!raw) { console.error('用法:--json <任务 JSON>'); process.exit(2); }
|
|
17
18
|
const task = JSON.parse(raw);
|
|
18
|
-
const
|
|
19
|
+
const DRY = process.argv.includes('--dry-run');
|
|
20
|
+
|
|
21
|
+
/** 读取本角色已确认的通知群;首次使用未确认时返回空,CLI 拒绝建任务。 */
|
|
22
|
+
function roleChatId(role) {
|
|
23
|
+
const candidates = [
|
|
24
|
+
process.env.ARGENT_GATEWAY_JSON,
|
|
25
|
+
process.env.DSH_HOME ? path.join(process.env.DSH_HOME, 'argent', 'gateway.json') : '',
|
|
26
|
+
path.join(os.homedir(), '.dsh', 'argent', 'gateway.json'),
|
|
27
|
+
path.join(os.homedir(), '.dsh-argent', 'argent', 'gateway.json'),
|
|
28
|
+
].filter(Boolean);
|
|
29
|
+
for (const f of candidates) {
|
|
30
|
+
try {
|
|
31
|
+
const d = JSON.parse(fs.readFileSync(f, 'utf8'));
|
|
32
|
+
const row = (d.roles || []).find((r) => r.role === role);
|
|
33
|
+
if (row) return String(row.chatId || '');
|
|
34
|
+
} catch { /* try next */ }
|
|
35
|
+
}
|
|
36
|
+
return '';
|
|
37
|
+
}
|
|
38
|
+
const role = arg('--role', 'ml-fulfillment');
|
|
39
|
+
const chatId = arg('--chat-id') || task.chatId || roleChatId(role);
|
|
40
|
+
const openId = arg('--open-id') || task.requesterOpenId || '';
|
|
41
|
+
if (!chatId && !openId) {
|
|
42
|
+
console.error(JSON.stringify({ ok: false, error: { code: 'missing_notify_group', message: '未配置抢预约通知群:请先在本群发送「设为通知群」,或在命令里传 --chat-id/--open-id' } }));
|
|
43
|
+
process.exit(1);
|
|
44
|
+
}
|
|
19
45
|
if (chatId) task.chatId = chatId;
|
|
20
46
|
if (openId) task.requesterOpenId = openId;
|
|
47
|
+
if (DRY) { console.log(JSON.stringify({ ok: true, dryRun: true, chatId: Boolean(chatId), openId: Boolean(openId), task })); process.exit(0); }
|
|
21
48
|
const secretPath = process.env.APPOINTMENT_BRIDGE_SECRET_FILE || `${os.homedir()}/.dsh/argent/appointment-bridge.secret`;
|
|
22
49
|
const secret = process.env.APPOINTMENT_BRIDGE_SECRET || fs.readFileSync(secretPath, 'utf8').trim();
|
|
23
50
|
const base = (process.env.ARGENT_API_BASE || 'https://whyshu.com/api/argent/v1').replace(/\/+$/, '');
|
|
@@ -206,6 +206,16 @@ async def run_task(task: dict) -> dict:
|
|
|
206
206
|
store = task.get('store') or ''
|
|
207
207
|
if not store:
|
|
208
208
|
return {'status': 'failed', 'summary': '任务缺少店铺'}
|
|
209
|
+
# 站别守卫:当前预约页/后台是墨西哥站(myaccount.mercadolibre.com.mx)专用。
|
|
210
|
+
# 巴西/阿根廷等非墨西哥店直接拒绝,避免拿墨西哥后台去找其他站货件。
|
|
211
|
+
try:
|
|
212
|
+
info, _dev = O._resolve_store(store)
|
|
213
|
+
platform = str((info or {}).get('platform') or '')
|
|
214
|
+
except Exception:
|
|
215
|
+
platform = ''
|
|
216
|
+
is_mx = (not platform) or any(k in platform for k in ('墨西哥', 'Mexico', 'México', 'MLM'))
|
|
217
|
+
if not is_mx:
|
|
218
|
+
return {'status': 'failed', 'summary': f'抢预约当前仅支持墨西哥站(MLM);{store} 属于 {platform},暂未适配,请勿执行'}
|
|
209
219
|
date_mode = task.get('dateMode') or 'range'
|
|
210
220
|
from_date = iso_day(task['dateFrom']) if date_mode == 'range' else None
|
|
211
221
|
to_date = iso_day(task['dateTo']) if date_mode == 'range' else None
|
|
@@ -87,12 +87,22 @@ for a in "$@"; do
|
|
|
87
87
|
--publish-packs) MODE="publish-packs" ;;
|
|
88
88
|
--check-live-manifest) MODE="check-live-manifest" ;;
|
|
89
89
|
--post-release-check) MODE="post-release-check" ;;
|
|
90
|
-
--publish-dl)
|
|
90
|
+
--publish-dl)
|
|
91
|
+
echo "⚠ /dl 分发已退役:新装/更新请走 npm @whyshu/argent;本次操作需要 ALLOW_LEGACY_DL=1 才允许同步历史兼容文件。" >&2
|
|
92
|
+
[[ "${ALLOW_LEGACY_DL:-0}" == "1" ]] || exit 3
|
|
93
|
+
MODE="publish-dl" ;;
|
|
91
94
|
-h|--help) sed -n '2,40p' "$0" | sed 's/^# \{0,1\}//'; exit 0 ;;
|
|
92
95
|
--*) echo "✗ 未知参数:${a}(⛔ 不会当作版本号;用 -h 看用法)" >&2; exit 1 ;;
|
|
93
96
|
*) VERSION_ARG="$a" ;;
|
|
94
97
|
esac
|
|
95
98
|
done
|
|
99
|
+
# ── /dl 已退役(2026-10-19):默认 release 不再写 dl/;安装/更新走 npm 启动器 ──
|
|
100
|
+
if [[ "$MODE" == "release" && "${ALLOW_LEGACY_DL:-0}" != "1" ]]; then
|
|
101
|
+
echo "✗ /dl 发布已退役:请发布 npm 包(@whyshu/argent / @whyshu/argent-engine);" >&2
|
|
102
|
+
echo " 仅历史兼容确需同步旧 /dl 时显式 ALLOW_LEGACY_DL=1 bash scripts/release-argent.sh ..." >&2
|
|
103
|
+
exit 3
|
|
104
|
+
fi
|
|
105
|
+
|
|
96
106
|
# ── 0.7.1:**发布后体检**一条入口(⛔ 只读:不发布、不写任何东西)──
|
|
97
107
|
# 顺序:① dl 字节 + 能力包摘要 ② 服务器在服务的清单 ③ registry 可见性(engine/CLI 版本号)
|
|
98
108
|
if [[ "$MODE" == "post-release-check" ]]; then
|
|
@@ -49,7 +49,9 @@ description: 美客多 FULL 抢预约对话与 ERP 任务创建(BOT/gateway
|
|
|
49
49
|
BOT/gateway 通过确定性 CLI 创建任务(不在会话里轮询):
|
|
50
50
|
|
|
51
51
|
```bash
|
|
52
|
-
node ~/.argent-dsh/scripts/appointment-create.mjs --json '<任务 JSON>'
|
|
52
|
+
node ~/.argent-dsh/scripts/appointment-create.mjs --json '<任务 JSON>'
|
|
53
|
+
|
|
54
|
+
脚本会自动读取本角色已确认的通知群(`gateway.json`);首次使用未配置群会返回 `missing_notify_group`。
|
|
53
55
|
```
|
|
54
56
|
|
|
55
57
|
返回 `{ ok, id, status }` 后,BOT 回复“已创建任务 #id”。
|
|
@@ -96,3 +98,12 @@ node ~/.argent-dsh/scripts/appointment-stop.mjs <AppointmentTask id>
|
|
|
96
98
|
- ⛔ 不把 7/14 天硬编码;不替用户改日期范围;
|
|
97
99
|
- ⛔ 未二次确认不创建任务;
|
|
98
100
|
- ⛔ 同一店铺预约仍走 ERP/编排器的同店步骤4互斥锁,避免与 FULL 任务串预约。
|
|
101
|
+
|
|
102
|
+
## 运营使用指南
|
|
103
|
+
|
|
104
|
+
官网:https://whyshu.com/argent/skills/mercadolibre/appointment
|
|
105
|
+
|
|
106
|
+
首次使用必须先确认通知群;未配置时 `appointment-create.mjs` 会返回
|
|
107
|
+
`missing_notify_group`,让用户在本群发送「设为通知群」后再重试,⛔ 不要绕过。
|
|
108
|
+
|
|
109
|
+
当前仅支持墨西哥站;巴西/阿根廷等站点直接拒绝,不要创建任务。
|
package/engine/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "0.7.
|
|
1
|
+
export const VERSION = "0.7.6"
|