@whyshu/argent-engine 0.8.0-rc.4 → 0.8.0-rc.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 +21 -13
- package/engine/VERSION +1 -1
- package/engine/core/contracts/argent.contracts.json +1 -1
- package/engine/scripts/argent-doctor.mjs +44 -3
- package/engine/scripts/argent-schedule.mjs +6 -0
- package/engine/scripts/base-bootstrap.sh +0 -0
- package/engine/scripts/billing-mode-daily.sh +0 -0
- package/engine/scripts/build-engine-package.mjs +17 -2
- package/engine/scripts/capability-packs.lock.json +33 -33
- package/engine/scripts/check-argent-desktop.mjs +1 -1
- package/engine/scripts/check-billing-mode.sh +0 -0
- package/engine/scripts/check-dsh-web-expose.sh +0 -0
- package/engine/scripts/ci-run.sh +0 -0
- package/engine/scripts/customer-readiness.sh +0 -0
- package/engine/scripts/daily-report-run.sh +68 -0
- package/engine/scripts/daily-report-status.mjs +130 -0
- package/engine/scripts/daily-report-timer-plist.sh +89 -0
- package/engine/scripts/daily-report-timers.sh +166 -0
- package/engine/scripts/daily-report.mjs +79 -4
- package/engine/scripts/daily-report.sh +0 -0
- package/engine/scripts/desktop-trial.sh +0 -0
- package/engine/scripts/dev-window.sh +0 -0
- package/engine/scripts/drill-clean-room.sh +0 -0
- package/engine/scripts/drill-handover.sh +0 -0
- package/engine/scripts/dsh-backup-scope.sh +0 -0
- package/engine/scripts/dsh-overlay-pin.sh +0 -0
- package/engine/scripts/dsh-release-watch-daily.sh +0 -0
- package/engine/scripts/dsh-remote-check.sh +0 -0
- package/engine/scripts/dsh-restart.sh +0 -0
- package/engine/scripts/dsh-restore.sh +0 -0
- package/engine/scripts/dsh-url.sh +0 -0
- package/engine/scripts/flow-requirements.json +3 -3
- package/engine/scripts/flow-timers-plist.sh +0 -0
- package/engine/scripts/flow-timers.sh +11 -0
- package/engine/scripts/flow-trigger.sh +0 -0
- package/engine/scripts/flow_config.py +14 -0
- package/engine/scripts/huangwei-preflight.sh +42 -0
- package/engine/scripts/init-ml.sh +0 -0
- package/engine/scripts/invoice-table.sh +0 -0
- package/engine/scripts/lib/argent-datadir.sh +0 -0
- package/engine/scripts/lib/daily-report-status.mjs +227 -0
- package/engine/scripts/lib/repo-root.sh +0 -0
- package/engine/scripts/migrate-skills.sh +0 -0
- package/engine/scripts/npm-publish-argent.sh +0 -0
- package/engine/scripts/patches/retire-check.sh +0 -0
- package/engine/scripts/poll-fulfillment.sh +0 -0
- package/engine/scripts/poll-invoice.sh +0 -0
- package/engine/scripts/provider-select.sh +0 -0
- package/engine/scripts/provider-switch.sh +0 -0
- package/engine/scripts/publish-release-0.8.0-rc.4.sh +18 -0
- package/engine/scripts/python-runtime.sh +0 -0
- package/engine/scripts/release-argent.sh +0 -0
- package/engine/scripts/run-tests.sh +0 -0
- package/engine/scripts/setup.sh +0 -0
- package/engine/scripts/sync-plugins.sh +0 -0
- package/engine/scripts/sync-presets.sh +0 -0
- package/engine/scripts/sync-scripts.sh +0 -0
- package/engine/scripts/usage-anchor.sh +0 -0
- package/engine/scripts/verify-release-0.8.0-rc.4.sh +16 -0
- package/engine/scripts/vertical-lint.mjs +19 -0
- package/engine/scripts/wenyao-browser.sh +0 -0
- package/engine/scripts/wenyao-login.sh +0 -0
- package/engine/scripts/xzh-browser.sh +0 -0
- package/engine/scripts/ziniao-auth-probe.sh +0 -0
- package/engine/scripts/ziniao-keepalive.sh +0 -0
- package/engine/scripts/ziniao-post-upgrade-check.sh +0 -0
- package/engine/scripts/ziniao-windows.sh +0 -0
- package/engine/skills/ml-fulfillment-sop/scripts/poll-and-execute.sh +0 -0
- package/engine/version.mjs +1 -1
- package/engine/verticals/mercadolibre/flows.json +3 -1
- package/package.json +1 -1
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Huangwei Mac 迁移前只读体检(不修改/不停止/不安装任何东西)
|
|
3
|
+
set -u
|
|
4
|
+
echo "=== Huangwei preflight $(date -Is) ==="
|
|
5
|
+
echo "host: $(hostname) / $(uname -m) / $(sw_vers -productVersion 2>/dev/null || true)"
|
|
6
|
+
echo
|
|
7
|
+
echo "--- DSH Desktop / web ---"
|
|
8
|
+
ls -ld "/Applications/DeepSeek Harness.app" 2>/dev/null || echo "no /Applications/DeepSeek Harness.app"
|
|
9
|
+
pgrep -fl "DeepSeek Harness|dsh web|dsh-web" 2>/dev/null | head -20 || true
|
|
10
|
+
echo "--- launch agents ---"
|
|
11
|
+
launchctl list 2>/dev/null | grep -iE 'dsh|argent|whyshu' | head -30 || true
|
|
12
|
+
echo
|
|
13
|
+
echo "--- dsh version ---"
|
|
14
|
+
command -v dsh >/dev/null && dsh --version 2>&1 | head -3 || echo "dsh not in PATH"
|
|
15
|
+
echo
|
|
16
|
+
echo "--- argent data identity (no token) ---"
|
|
17
|
+
python3 - <<'PY' 2>/dev/null || true
|
|
18
|
+
import json, os
|
|
19
|
+
p=os.path.expanduser('~/.dsh/argent/agent-report.json')
|
|
20
|
+
try:
|
|
21
|
+
d=json.load(open(p))
|
|
22
|
+
print('agent-report:', {k:d.get(k) for k in ('enabled','serverUrl','tenantAppId','machineId','machineName','chatEnabled')})
|
|
23
|
+
except Exception as e:
|
|
24
|
+
print('agent-report: missing/invalid', type(e).__name__)
|
|
25
|
+
PY
|
|
26
|
+
echo
|
|
27
|
+
echo "--- desktop profile packages ---"
|
|
28
|
+
python3 - <<'PY' 2>/dev/null || true
|
|
29
|
+
import json, os
|
|
30
|
+
p=os.path.expanduser('~/.dsh/profiles/desktop/package.json')
|
|
31
|
+
try:
|
|
32
|
+
d=json.load(open(p)); print('profile:', {k:d.get(k) for k in ('name','version')}); print('deps:', d.get('dependencies') or {})
|
|
33
|
+
except Exception as e:
|
|
34
|
+
print('profile: missing/invalid', type(e).__name__)
|
|
35
|
+
PY
|
|
36
|
+
echo
|
|
37
|
+
echo "--- global argent packages ---"
|
|
38
|
+
npm ls -g --depth=0 @whyshu 2>/dev/null | head -20 || true
|
|
39
|
+
echo
|
|
40
|
+
echo "--- installed engine/runtime ---"
|
|
41
|
+
ls -ld ~/.dsh/argent/engines/* 2>/dev/null | tail -10 || true
|
|
42
|
+
echo "READ-ONLY: nothing was changed."
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 日报定时器状态 —— **唯一读写实现**(引擎写、桌宠 / CLI / doctor 读)。
|
|
3
|
+
*
|
|
4
|
+
* 为什么要有这个文件(2026-10-30 事故):
|
|
5
|
+
* 日报此前走「launchd 唤醒 LLM 会话」的投递方式。客户机切到 dsh Desktop 后宿主
|
|
6
|
+
* (`dsh --profile argent --port 3080`)被停,定时器每 5 分钟照常认领、照常唤醒失败,
|
|
7
|
+
* 而 **没有任何一处能让人看见"定时器还在不在跑"** —— launchctl 显示最后 exit 0(无票那一轮),
|
|
8
|
+
* 失败只落在日志 + 台账里,客户侧完全静默。
|
|
9
|
+
* ⇒ 日报改成「launchd 直跑确定性脚本」后,必须有一个**人可读、机器可读**的状态面。
|
|
10
|
+
*
|
|
11
|
+
* 纪律:
|
|
12
|
+
* · 纯 node 内建(fs/path)+ 同层 L1(`daily-report-core.mjs`),零第三方、零宿主 import;
|
|
13
|
+
* · 写侧只有 `writeStatus()` 一个入口(tmp + rename 原子写),⛔ 别处不许直接写这个文件;
|
|
14
|
+
* · 状态文件是**派生事实**,删了不会丢数据(下次运行自动重建);⛔ 不当台账用。
|
|
15
|
+
*
|
|
16
|
+
* 文件:`<ARGENT_DATA_DIR>/daily-report-timer-status.json`
|
|
17
|
+
*/
|
|
18
|
+
import { existsSync, mkdirSync, readdirSync, readFileSync, renameSync, statSync, writeFileSync } from 'node:fs'
|
|
19
|
+
import { dirname, join } from 'node:path'
|
|
20
|
+
import { SITE_TZ, fallbackSite, localDateStr, storeKey, tzOffsetMs } from './daily-report-core.mjs'
|
|
21
|
+
|
|
22
|
+
export const STATUS_SCHEMA = 1
|
|
23
|
+
export const STATUS_FILE = 'daily-report-timer-status.json'
|
|
24
|
+
export const TIMER_LABEL = 'com.whyshu.daily-report-timer'
|
|
25
|
+
export const DEFAULT_REPORT_TIME = '00:05'
|
|
26
|
+
|
|
27
|
+
export const statusPath = (dataHome) => join(dataHome, STATUS_FILE)
|
|
28
|
+
|
|
29
|
+
/** 读状态文件;缺失/损坏 ⇒ `{}`(⛔ 不抛:桌宠每 5s 读一次,坏文件不许把页面搞崩)。 */
|
|
30
|
+
export function readStatus(dataHome) {
|
|
31
|
+
try {
|
|
32
|
+
const raw = JSON.parse(readFileSync(statusPath(dataHome), 'utf8'))
|
|
33
|
+
if (!raw || typeof raw !== 'object') return {}
|
|
34
|
+
return raw
|
|
35
|
+
} catch {
|
|
36
|
+
return {}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** 原子写(tmp + rename)。返回落盘对象,便于调用方打日志。 */
|
|
41
|
+
export function writeStatus(dataHome, status) {
|
|
42
|
+
const next = { ...status, schema: STATUS_SCHEMA }
|
|
43
|
+
mkdirSync(dataHome, { recursive: true })
|
|
44
|
+
const file = statusPath(dataHome)
|
|
45
|
+
const tmp = `${file}.tmp`
|
|
46
|
+
writeFileSync(tmp, JSON.stringify(next, null, 1) + '\n')
|
|
47
|
+
renameSync(tmp, file)
|
|
48
|
+
return next
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* 合并语义(**关键**):一次运行只更新它知道的字段。
|
|
53
|
+
* · 顶层字段:patch 覆盖 prev;
|
|
54
|
+
* · `stores`:按 storeKey 浅合并(本轮没跑到的店保留上次事实);
|
|
55
|
+
* · `lastPushed` / `pending` / `stores` 之外的数组:整段替换(它们描述"本轮")。
|
|
56
|
+
* 为什么:定时器每小时跑一次,绝大多数轮次是「未到点、零动作」;
|
|
57
|
+
* 若 no-op 轮次把 `lastPushAt` / 每个店的状态冲掉,桌宠就会一直显示"从未推送"。
|
|
58
|
+
*/
|
|
59
|
+
export function mergeStatus(prev = {}, patch = {}) {
|
|
60
|
+
const out = { ...prev, ...patch }
|
|
61
|
+
if (patch.stores || prev.stores) {
|
|
62
|
+
const merged = { ...(prev.stores || {}) }
|
|
63
|
+
for (const [k, v] of Object.entries(patch.stores || {})) merged[k] = { ...(merged[k] || {}), ...v }
|
|
64
|
+
out.stores = merged
|
|
65
|
+
}
|
|
66
|
+
return out
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/** `HH:MM` / `HH:MM:SS` → `{ h, m }`;非法 ⇒ 默认 00:05(与文档默认口径一致,⛔ 不抛)。 */
|
|
70
|
+
export function parseHHMM(text, fallback = DEFAULT_REPORT_TIME) {
|
|
71
|
+
const m = /^(\d{1,2}):(\d{2})(?::\d{2})?$/.exec(String(text ?? '').trim())
|
|
72
|
+
if (m) {
|
|
73
|
+
const h = Number(m[1])
|
|
74
|
+
const mi = Number(m[2])
|
|
75
|
+
if (h >= 0 && h <= 23 && mi >= 0 && mi <= 59) return { h, m: mi }
|
|
76
|
+
}
|
|
77
|
+
const f = /^(\d{1,2}):(\d{2})/.exec(String(fallback)) || [0, '0', '5']
|
|
78
|
+
return { h: Number(f[1]) || 0, m: Number(f[2]) || 0 }
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** 本地墙钟(某时区的 y/m/d/h/mi)→ UTC Date;两次迭代吸收 DST 偏移变化。 */
|
|
82
|
+
function wallToUtc(tz, y, mo, d, h, mi) {
|
|
83
|
+
const naive = Date.UTC(y, mo - 1, d, h, mi)
|
|
84
|
+
let t = naive - tzOffsetMs(tz, new Date(naive))
|
|
85
|
+
t = naive - tzOffsetMs(tz, new Date(t))
|
|
86
|
+
return new Date(t)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* 某站点本地的**下一次** `HH:MM`(严格晚于 now)→ Date(UTC 表示)。
|
|
91
|
+
* 例:墨西哥 `00:05`、北京 13:00 ⇒ 返回北京时间 14:05。
|
|
92
|
+
*/
|
|
93
|
+
export function nextLocalOccurrence(tz, now, reportTime = DEFAULT_REPORT_TIME) {
|
|
94
|
+
const { h, m } = parseHHMM(reportTime)
|
|
95
|
+
const [y, mo, d] = localDateStr(tz, now).split('-').map(Number)
|
|
96
|
+
let cand = wallToUtc(tz, y, mo, d, h, m)
|
|
97
|
+
if (cand.getTime() <= now.getTime()) {
|
|
98
|
+
const next = new Date(Date.UTC(y, mo - 1, d) + 86400000) // 墙钟加一天(不做 tz 运算)
|
|
99
|
+
cand = wallToUtc(tz, next.getUTCFullYear(), next.getUTCMonth() + 1, next.getUTCDate(), h, m)
|
|
100
|
+
}
|
|
101
|
+
return cand
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/** 下一次发生时"该推哪一天"的日报:站点本地的前一天(D 日数据在 D+1 00:05 推)。 */
|
|
105
|
+
export function pendingDateFor(tz, occurrence, dayMs = 86400000) {
|
|
106
|
+
return localDateStr(tz, new Date(occurrence.getTime() - dayMs))
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** 扫 `daily-report-cache/` 里某店最新的幂等标记 → `{ date, at }`;没有 ⇒ `null`。 */
|
|
110
|
+
export function latestPushed(cacheDir, key) {
|
|
111
|
+
const suffix = `-${key}`
|
|
112
|
+
let names = []
|
|
113
|
+
try {
|
|
114
|
+
names = readdirSync(cacheDir)
|
|
115
|
+
} catch {
|
|
116
|
+
return null
|
|
117
|
+
}
|
|
118
|
+
let best = null
|
|
119
|
+
for (const name of names) {
|
|
120
|
+
if (!name.startsWith('.pushed-') || !name.endsWith(suffix)) continue
|
|
121
|
+
const date = name.slice('.pushed-'.length, name.length - suffix.length)
|
|
122
|
+
if (!/^\d{4}-\d{2}-\d{2}$/.test(date)) continue
|
|
123
|
+
if (!best || date > best.date) {
|
|
124
|
+
let at = null
|
|
125
|
+
try { at = new Date(statSync(join(cacheDir, name)).mtimeMs).toISOString() } catch { /* noop */ }
|
|
126
|
+
best = { date, at }
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return best
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/** `YYYY-MM-DD` 加减天数(纯日历运算,不涉时区)。 */
|
|
133
|
+
export function addDays(dateStr, n) {
|
|
134
|
+
const d = new Date(`${dateStr}T00:00:00Z`)
|
|
135
|
+
d.setUTCDate(d.getUTCDate() + n)
|
|
136
|
+
return d.toISOString().slice(0, 10)
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* 每店事实 + 下一次应推时点(纯函数;`cacheDir` 只用于读标记)。
|
|
141
|
+
*
|
|
142
|
+
* 三个日期要分清(UI 上最容易混):
|
|
143
|
+
* · `dueDate` = **下一次**时点会推哪一天(= 下一次发生的站点本地日期前一天);
|
|
144
|
+
* · `expectedLast` = **到此刻为止最后该推**的那一天(= dueDate 前一天);
|
|
145
|
+
* · `missed` = `lastDate+1 … expectedLast` 里缺的天(上限 7,避免 UI 刷屏)。
|
|
146
|
+
* 2026-10-30 事故的教训:只报"下一次几点"会让"昨天那一份根本没推"这件事看不见。
|
|
147
|
+
*/
|
|
148
|
+
export function computeStoreStates({ stores = [], cacheDir = '', now = new Date(), reportTime = DEFAULT_REPORT_TIME, lookaheadDays = 3 } = {}) {
|
|
149
|
+
return stores.map((store) => {
|
|
150
|
+
const site = fallbackSite(store.site)
|
|
151
|
+
const tz = SITE_TZ[site]
|
|
152
|
+
const key = storeKey(store)
|
|
153
|
+
const last = cacheDir ? latestPushed(cacheDir, key) : null
|
|
154
|
+
let occurrence = nextLocalOccurrence(tz, now, reportTime)
|
|
155
|
+
let dueDate = pendingDateFor(tz, occurrence)
|
|
156
|
+
// 已推过这一天的(例如手动 --force 补推过)⇒ 下一次时点顺延,别显示"要推一个已推过的日期"
|
|
157
|
+
for (let i = 0; i < lookaheadDays; i += 1) {
|
|
158
|
+
if (!last || last.date < dueDate) break
|
|
159
|
+
occurrence = new Date(occurrence.getTime() + 86400000)
|
|
160
|
+
dueDate = pendingDateFor(tz, occurrence)
|
|
161
|
+
}
|
|
162
|
+
const expectedLast = addDays(dueDate, -1)
|
|
163
|
+
const missed = []
|
|
164
|
+
if (!last || last.date < expectedLast) {
|
|
165
|
+
let d = last ? addDays(last.date, 1) : addDays(expectedLast, -6)
|
|
166
|
+
while (d <= expectedLast && missed.length < 7) {
|
|
167
|
+
missed.push(d)
|
|
168
|
+
d = addDays(d, 1)
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
return {
|
|
172
|
+
key,
|
|
173
|
+
store: String(store.name ?? ''),
|
|
174
|
+
site,
|
|
175
|
+
tz,
|
|
176
|
+
lastDate: last?.date || '',
|
|
177
|
+
lastPushAt: last?.at || '',
|
|
178
|
+
dueDate,
|
|
179
|
+
expectedLast,
|
|
180
|
+
missed,
|
|
181
|
+
nextDueAt: occurrence.toISOString(),
|
|
182
|
+
}
|
|
183
|
+
})
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/** 由每店事实汇总出状态文件里那几段(纯函数)。 */
|
|
187
|
+
export function summarizeStates(states = []) {
|
|
188
|
+
const pending = states.filter((s) => s.missed.length > 0).map((s) => ({
|
|
189
|
+
store: s.store, site: s.site, dueDate: s.dueDate, missed: s.missed,
|
|
190
|
+
}))
|
|
191
|
+
const nextDueAt = states.reduce((min, s) => (!min || s.nextDueAt < min ? s.nextDueAt : min), '')
|
|
192
|
+
const lastPushAt = states.reduce((max, s) => (s.lastPushAt > max ? s.lastPushAt : max), '')
|
|
193
|
+
const missedTotal = states.reduce((n, s) => n + s.missed.length, 0)
|
|
194
|
+
return {
|
|
195
|
+
nextDueAt,
|
|
196
|
+
lastPushAt,
|
|
197
|
+
missedTotal,
|
|
198
|
+
pending,
|
|
199
|
+
stores: Object.fromEntries(states.map((s) => [s.key, {
|
|
200
|
+
store: s.store, site: s.site, tz: s.tz,
|
|
201
|
+
lastDate: s.lastDate, lastPushAt: s.lastPushAt,
|
|
202
|
+
dueDate: s.dueDate, expectedLast: s.expectedLast, missed: s.missed,
|
|
203
|
+
nextDueAt: s.nextDueAt,
|
|
204
|
+
}])),
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* 人读一行(CLI / doctor 共用;⛔ 桌宠客户端不复制这句,UI 自己排版)。
|
|
210
|
+
* @param {object} status 状态文件内容
|
|
211
|
+
* @param {{now?:Date, locale?:(d:Date)=>string}} [opts]
|
|
212
|
+
*/
|
|
213
|
+
export function describeStatus(status = {}, { now = new Date(), fmt = (d) => d.toISOString() } = {}) {
|
|
214
|
+
if (!status || !status.lastRunAt) return '定时器尚未运行过(无状态文件)'
|
|
215
|
+
const parts = []
|
|
216
|
+
parts.push(status.lastExit ? `上次运行失败(exit ${status.lastExit})` : '上次运行正常')
|
|
217
|
+
if (status.lastPushAt) {
|
|
218
|
+
const age = now.getTime() - Date.parse(status.lastPushAt)
|
|
219
|
+
parts.push(`上次推送 ${Number.isFinite(age) ? fmt(new Date(status.lastPushAt)) : status.lastPushAt}`)
|
|
220
|
+
} else {
|
|
221
|
+
parts.push('还没有成功推送记录')
|
|
222
|
+
}
|
|
223
|
+
if (status.nextDueAt) parts.push(`下次 ${fmt(new Date(status.nextDueAt))}`)
|
|
224
|
+
if (status.missedTotal) parts.push(`缺 ${status.missedTotal} 天日报`)
|
|
225
|
+
if (status.lastError) parts.push(`错误:${String(status.lastError).slice(0, 120)}`)
|
|
226
|
+
return parts.join(' · ')
|
|
227
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# 发布 0.8.0-rc.4 / desktop 0.2.2 / launcher 0.1.17
|
|
3
|
+
# 前置:npm login(有 @whyshu publish 权限);本脚本不会登录/读取 token。
|
|
4
|
+
set -euo pipefail
|
|
5
|
+
DIR="${1:-/tmp/argent-release-0.8.0-rc.4}"
|
|
6
|
+
cd "$DIR"
|
|
7
|
+
shasum -a 256 -c <<'SUMS'
|
|
8
|
+
892652d5e43deb1cba6539dc81b3ed2f0cf4e8f081d70a084b40796041a9dbaf whyshu-argent-engine-0.8.0-rc.4.tgz
|
|
9
|
+
9333fa9255cd93ef5821d58858a63172374b63f8071dd27f723521b14cdfe826 whyshu-argent-desktop-0.2.2.tgz
|
|
10
|
+
3a0501f16882535208a7f56ef49c4e57b3fccc59661d8facf61b323d3270cec5 whyshu-argent-0.1.17.tgz
|
|
11
|
+
SUMS
|
|
12
|
+
npm whoami >/dev/null
|
|
13
|
+
npm publish whyshu-argent-engine-0.8.0-rc.4.tgz --access public
|
|
14
|
+
npm publish whyshu-argent-desktop-0.2.2.tgz --access public
|
|
15
|
+
npm publish whyshu-argent-0.1.17.tgz --access public
|
|
16
|
+
npm view @whyshu/argent-engine version
|
|
17
|
+
npm view @whyshu/argent-desktop version
|
|
18
|
+
npm view @whyshu/argent version
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/engine/scripts/setup.sh
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# 发布后回验(只读 npm/本地包;不发布)
|
|
3
|
+
set -euo pipefail
|
|
4
|
+
DIR="${1:-/tmp/argent-release-0.8.0-rc.4}"
|
|
5
|
+
echo "== npm versions =="
|
|
6
|
+
for p in @whyshu/argent-engine @whyshu/argent-desktop @whyshu/argent; do
|
|
7
|
+
printf '%s: ' "$p"; npm view "$p" version
|
|
8
|
+
done
|
|
9
|
+
echo
|
|
10
|
+
echo "== expected =="
|
|
11
|
+
echo "@whyshu/argent-engine 0.8.0-rc.4"
|
|
12
|
+
echo "@whyshu/argent-desktop 0.2.2"
|
|
13
|
+
echo "@whyshu/argent 0.1.17"
|
|
14
|
+
echo
|
|
15
|
+
echo "== tarballs =="
|
|
16
|
+
ls -lh "$DIR"/*.tgz
|
|
@@ -228,6 +228,25 @@ for (const vid of VIDS) {
|
|
|
228
228
|
if (String(flow.trigger?.mode) === 'real' && !(flow.guards?.writeFields || []).length) {
|
|
229
229
|
warn('guards', `${id}: mode=real 但没有声明 guards.writeFields(写路径白名单)—— 确认这是有意的`)
|
|
230
230
|
}
|
|
231
|
+
// ── 1.35 交付方式声明(2026-10-30)──────────────────────────────────────
|
|
232
|
+
// `trigger.delivery`:这条流程的定时**谁在跑**
|
|
233
|
+
// · `session`(缺省)= 激活垫片唤醒角色会话(flow-trigger.sh → dsh 宿主);
|
|
234
|
+
// · `launchd-script` = launchd 直跑确定性脚本(日报:`scripts/daily-report-timers.sh`),
|
|
235
|
+
// ⛔ 不进 flow-timers 的安装面、⛔ 不许同时启用宿主排程(单一调度者)。
|
|
236
|
+
// 判据与安装器(`scripts/flow-timers.sh` / `scripts/daily-report-timers.sh`)同源:两边都读这个键。
|
|
237
|
+
const delivery = flow.trigger?.delivery
|
|
238
|
+
if (delivery !== undefined) {
|
|
239
|
+
const atD = `${id}: trigger.delivery`
|
|
240
|
+
if (!['session', 'launchd-script'].includes(String(delivery))) {
|
|
241
|
+
err('delivery', `${atD}=${JSON.stringify(delivery)} 不在 session|launchd-script 内`)
|
|
242
|
+
}
|
|
243
|
+
if (String(delivery) === 'launchd-script' && flow.trigger?.schedule?.enabled === true) {
|
|
244
|
+
err('delivery', `${atD}=launchd-script 时 trigger.schedule.enabled 必须为 false —— 同一条流程只能有一个调度者(launchd 确定性脚本 vs 宿主排程)`)
|
|
245
|
+
}
|
|
246
|
+
if (String(delivery) === 'launchd-script' && String(flow.trigger?.wake) !== 'session') {
|
|
247
|
+
warn('delivery', `${atD}=launchd-script 但 trigger.wake=${JSON.stringify(flow.trigger?.wake)} —— 脚本交付不需要唤醒,建议保持 session 以外的值时才改`)
|
|
248
|
+
}
|
|
249
|
+
}
|
|
231
250
|
// ── 1.4 宿主排程声明(P1-A,2026-10-12)──────────────────────────────────
|
|
232
251
|
// 判据与运行期读取点(`scripts/flow_config.py` 的 schedule 段)**同一套**:这里是资产门禁,
|
|
233
252
|
// 那里是唯一读取点 —— 两处各判一次不是"第二份真源",而是"声明期拦住 + 运行期不静默"。
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/engine/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "0.8.0-rc.
|
|
1
|
+
export const VERSION = "0.8.0-rc.6"
|
|
@@ -678,6 +678,8 @@
|
|
|
678
678
|
"intervalSec": 300,
|
|
679
679
|
"wake": "session",
|
|
680
680
|
"mode": "real",
|
|
681
|
+
"delivery": "launchd-script",
|
|
682
|
+
"_deliveryNote": "2026-10-30 客户机事故后改:日报是**确定性脚本**(各店站点本地时间门控 + 幂等标记),不再需要唤醒 LLM 会话。交付方式 = `scripts/daily-report-timers.sh install` 装一条 launchd 定时器(`com.whyshu.daily-report-timer`,每小时 :05)直接跑 `scripts/daily-report-run.sh` → `daily-report.mjs`。`flow-timers.sh` 见到 `delivery=launchd-script` 即**跳过**本流程(单一调度者纪律;旧的 `com.whyshu.flow-trigger-daily-report` 必须先 `flow-timers.sh uninstall --flow daily-report` 卸掉)。事故形态:切 dsh Desktop 后旧宿主 `dsh --profile argent --port 3080` 被停,唤醒每轮失败而客户侧完全静默(launchctl 只看得到「最后 exit 0」的那一轮)。",
|
|
681
683
|
"pauseSwitch": "verticals/mercadolibre/PAUSE.daily-report",
|
|
682
684
|
"log": "verticals/mercadolibre/logs/flow-trigger-daily-report.log",
|
|
683
685
|
"promptTemplate": "verticals/mercadolibre/prompts/daily-report.md",
|
|
@@ -689,7 +691,7 @@
|
|
|
689
691
|
},
|
|
690
692
|
"_scheduleNote": "P1-A(2026-10-12,**只对日报试点**):把触发从「每 5 分钟轮询 ≈288 次/天」改成「宿主原生 daily 排程(每天 1 次准点)」。**沿用 trigger 段**(⛔ 不另起顶层字段 ⇒ 不开第二份真源):`schedule` 只描述「排程器怎么叫醒」,周期与暂停开关仍只在 trigger 里。⛔ 本批**不切投递**:宿主排程的 prompt 创建时固定 ⇒ 语义退化为「到点叫醒 + 角色自己调 L1 认领」,而「只认领不唤醒」的 L1 入口(`flow-trigger.sh --no-wake`)**尚不存在**(实测只认 --flow/--max/--dry-run)⇒ 声明先落、防线先建,投递切换留 P1-B。⛔ `intervalSec` **保持 300 不动**:本批 launchd 那条路径照旧(先起后排,绝不双跑)。",
|
|
691
693
|
"schedule": {
|
|
692
|
-
"enabled":
|
|
694
|
+
"enabled": false,
|
|
693
695
|
"kind": "daily",
|
|
694
696
|
"time": "14:05:00",
|
|
695
697
|
"timeZone": "Asia/Shanghai",
|