@whyshu/argent-engine 0.14.0 → 0.14.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.
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": "c6fb87657a4ee72e2b549cdd39c12854fdbecbdfef033c04f523d4bfcb02aa4c",
|
|
6
6
|
"agents/catalog.json": "5356a812f2554dfd3115370363d4c3f787a82c9e5928a85d05b2a07c9e4b324d",
|
|
7
7
|
"configs/_aliases.proposed.json": "3a59edf80563bcc20d410d488decad6fd787bd3de9489321367b0783904cd3e5",
|
|
8
8
|
"configs/_migration-plan.proposed.json": "dd9f90b0b9b2f217dd23367a618402e57997d44f7fddcfa88a7cadf52e056c0d",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"configs/mcp-tools.snapshot.json": "cfa94a6ba64a7ae9d133a4a878ce3d5e0e85e554ccd3e3ebaf0d51ad750acf6a",
|
|
15
15
|
"configs/notify.json": "cb9ef11c1c498fcf99af99ec50271b8a2598061b77ed73a6099032e837474ef0",
|
|
16
16
|
"core/cli/argent.mjs": "9a8977324c238ca4e20435f9817eb7ec76157da32b1d510977dc03e0feb416a9",
|
|
17
|
-
"core/contracts/argent.contracts.json": "
|
|
17
|
+
"core/contracts/argent.contracts.json": "271b32e1b880e85b5e0cbf43b7ff473fa1cc593dc01b18436f08186643805e54",
|
|
18
18
|
"core/contracts/verbs.schema.json": "54d726181c11536eb30bd25090584a7af103e4c0462f8ef078053c8177e19dcb",
|
|
19
19
|
"core/lib/account-token.mjs": "35faad2c34e67755c1867f74a74885f0f268d5daabe01d339cf30dc747f86501",
|
|
20
20
|
"core/lib/argent-datadir.mjs": "1fdd799c933382c4f9e36bd4af33d51b8ac4a466a9d67a8f2296bb267b5251ac",
|
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
"scripts/final-check.mjs": "45e2004e778c83fe08b35921a555b2ca57ddb375672cc965544ef1bb6ff10aa8",
|
|
162
162
|
"scripts/fix-skill-frontmatter.py": "c77cb8d389bd96bc40655bbdd712435bfb06f74453a2f54dad58013f615ea748",
|
|
163
163
|
"scripts/flow-auto-retry.py": "2474e649e2e7c2803c3140b5c0780648059d3aadae299ea77a706a552b1fab63",
|
|
164
|
-
"scripts/flow-requirements.json": "
|
|
164
|
+
"scripts/flow-requirements.json": "c4af2dbd9cb09575f804d1272aef10d01babc558813eacdd242b1d49328cb48b",
|
|
165
165
|
"scripts/flow-scaffold.py": "d886e4e5d5cf0e80991d1d1a40e54a7281d87fec7c781c89101277795e401ae1",
|
|
166
166
|
"scripts/flow-session-retention.mjs": "a9a2d261dce959bcd0eb26361413b9fc10fd1cbd562f86c614face66861c9793",
|
|
167
167
|
"scripts/flow-timers-plist.sh": "a7b1007526fe21923566a002ef4e50fade5cbcdef38799f1a52e50c7b9c21131",
|
|
@@ -193,7 +193,7 @@
|
|
|
193
193
|
"scripts/flow_write_verify.py": "a9123838b00cb60b43fbc761f6dae740dfa3692906c2985e9b98a7c4538c2491",
|
|
194
194
|
"scripts/fulfillment.js": "8de1ea386ebfe628caf4eaf2df5f1941938c07d4b8b2dcf79a78d45ac231669f",
|
|
195
195
|
"scripts/fulfillment_sites.py": "7120ddcd891b1de588b4c80420af9b7291bfd2e582a7bb41cf9fcd91a0699fe7",
|
|
196
|
-
"scripts/full-exec-worker.mjs": "
|
|
196
|
+
"scripts/full-exec-worker.mjs": "ddc10b18ee29ff85b782a1145ef0e94e32af3397c16d7e4697ac3925796bf805",
|
|
197
197
|
"scripts/gen-agent-bundles.mjs": "3ab452fb7b1026a1bfab02977c85229985b390db4bc8458ce974b94bc207ed17",
|
|
198
198
|
"scripts/gen-preset-rows.mjs": "1c074432be25148e9babce7ea1cb68d8fcef257abc2329f66b4ce488bc504578",
|
|
199
199
|
"scripts/handover-sheet.mjs": "4e27095ccdd79586391abf7a7d5eb7aabbc3f0d7d9a1dd5161e9af8e8a9338de",
|
package/engine/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.14.
|
|
1
|
+
0.14.1
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"argentVersion": "0.14.
|
|
3
|
-
"_syncNote": "argentVersion 必须与仓库根 VERSION 同批更新:发布前置校验 scripts/check-version-consistency.mjs;2026-11-24 按 VERSION=0.14.
|
|
2
|
+
"argentVersion": "0.14.1",
|
|
3
|
+
"_syncNote": "argentVersion 必须与仓库根 VERSION 同批更新:发布前置校验 scripts/check-version-consistency.mjs;2026-11-24 按 VERSION=0.14.1 校正。",
|
|
4
4
|
"principle": "宿主无关:宿主只依赖 `argent <verb>`;确定性逻辑在 CLI/MCP,不在提示词里。",
|
|
5
5
|
"verbs": {
|
|
6
6
|
"version": {
|
|
@@ -126,7 +126,7 @@ async function findArtifacts(filesUploaded, sinceMs) {
|
|
|
126
126
|
return found
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
|
|
129
|
+
const activeChildren = new Set()
|
|
130
130
|
const activeTasks = new Map()
|
|
131
131
|
let shuttingDown = false
|
|
132
132
|
|
|
@@ -134,7 +134,7 @@ async function shutdown(signal = 'SIGTERM') {
|
|
|
134
134
|
if (shuttingDown) return
|
|
135
135
|
shuttingDown = true
|
|
136
136
|
console.log(`[worker] 收到 ${signal},停止并释放任务…`)
|
|
137
|
-
try {
|
|
137
|
+
for (const child of activeChildren) { try { child.kill('SIGTERM') } catch { /* noop */ } }
|
|
138
138
|
for (const t of activeTasks.values()) {
|
|
139
139
|
await api('POST', `/api/argent/v1/tenants/${encodeURIComponent(APP)}/full-executions/${encodeURIComponent(t.id)}/release`, {
|
|
140
140
|
workerId, reason: `worker_shutdown:${signal}`,
|
|
@@ -175,12 +175,12 @@ async function runAppointmentPhase(ctx) {
|
|
|
175
175
|
cwd: ENGINE,
|
|
176
176
|
env: { ...process.env, PYTHONPATH: 'scripts', PATH: `${dirname(process.execPath)}:${process.env.PATH || ''}` },
|
|
177
177
|
})
|
|
178
|
-
|
|
178
|
+
activeChildren.add(child)
|
|
179
179
|
let stdout = ''; let stderr = ''
|
|
180
180
|
child.stdout.on('data', (b) => { stdout += String(b) })
|
|
181
181
|
child.stderr.on('data', (b) => { stderr += String(b) })
|
|
182
|
-
child.on('close', () => {
|
|
183
|
-
child.on('error', (e) => {
|
|
182
|
+
child.on('close', () => { activeChildren.delete(child); resolve(`${stdout}\n${stderr}`.trim()) })
|
|
183
|
+
child.on('error', (e) => { activeChildren.delete(child); resolve(`WORKER_ERROR: ${e.message}`) })
|
|
184
184
|
})
|
|
185
185
|
let result = null
|
|
186
186
|
for (const line of String(out).split('\n').reverse()) {
|
|
@@ -231,7 +231,7 @@ async function executeBatch(tasks) {
|
|
|
231
231
|
if (String(r?.task?.status || '') === 'cancelled') {
|
|
232
232
|
cancelSeen = true
|
|
233
233
|
console.log('[worker] 任务已人工接管取消,终止子进程', t.id)
|
|
234
|
-
try {
|
|
234
|
+
for (const child of activeChildren) { try { child.kill('SIGTERM') } catch { /* noop */ } }
|
|
235
235
|
}
|
|
236
236
|
})
|
|
237
237
|
.catch(() => {})
|
|
@@ -266,12 +266,12 @@ async function executeBatch(tasks) {
|
|
|
266
266
|
]
|
|
267
267
|
if (skipSteps.length) args.push('--skip-steps', skipSteps.join(','))
|
|
268
268
|
const child = spawn(PYTHON, args, { cwd: ENGINE, env: { ...process.env, PYTHONPATH: 'scripts', PATH: `${dirname(process.execPath)}:${process.env.PATH || ''}` } })
|
|
269
|
-
|
|
269
|
+
activeChildren.add(child)
|
|
270
270
|
let stdout = ''; let stderr = ''
|
|
271
271
|
child.stdout.on('data', (b) => { stdout += String(b) })
|
|
272
272
|
child.stderr.on('data', (b) => { stderr += String(b) })
|
|
273
|
-
child.on('close', () => {
|
|
274
|
-
child.on('error', (e) => {
|
|
273
|
+
child.on('close', () => { activeChildren.delete(child); resolve(`${stdout}\n${stderr}`.trim()) })
|
|
274
|
+
child.on('error', (e) => { activeChildren.delete(child); resolve(`WORKER_ERROR: ${e.message}`) })
|
|
275
275
|
})
|
|
276
276
|
} finally {
|
|
277
277
|
await rm(dir, { recursive: true, force: true }).catch(() => {})
|
|
@@ -330,22 +330,30 @@ async function executeBatch(tasks) {
|
|
|
330
330
|
}
|
|
331
331
|
}
|
|
332
332
|
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
333
|
+
const storeBusy = new Set()
|
|
334
|
+
|
|
335
|
+
async function tickStore(store) {
|
|
336
|
+
if (storeBusy.has(store)) return
|
|
337
|
+
storeBusy.add(store)
|
|
338
|
+
try {
|
|
339
|
+
const claimed = await api('POST', `/api/argent/v1/tenants/${encodeURIComponent(APP)}/full-executions/claim-batch`, {
|
|
340
|
+
store, workerId, capacity: TABS, max: TABS,
|
|
341
|
+
})
|
|
342
|
+
const tasks = Array.isArray(claimed.tasks) ? claimed.tasks : []
|
|
343
|
+
if (!tasks.length) return
|
|
344
|
+
console.log(`[worker] ${store}: 领取 ${tasks.length} 个任务`)
|
|
345
|
+
await executeBatch(tasks)
|
|
346
|
+
} catch (e) {
|
|
347
|
+
console.warn(`[worker] ${store} 轮询失败:${e.message}`)
|
|
348
|
+
} finally {
|
|
349
|
+
storeBusy.delete(store)
|
|
346
350
|
}
|
|
347
351
|
}
|
|
348
352
|
|
|
353
|
+
async function tick() {
|
|
354
|
+
await Promise.all(STORES.map((store) => tickStore(store)))
|
|
355
|
+
}
|
|
356
|
+
|
|
349
357
|
if (process.argv.includes('--check')) await preflightCheck()
|
|
350
358
|
console.log(`[worker] 启动 stores=${STORES.join(',')} tabs=${TABS} base=${BASE}`)
|
|
351
359
|
await tick()
|
package/engine/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "0.14.
|
|
1
|
+
export const VERSION = "0.14.1"
|