@myagentroam/marctl 0.10.10 → 0.10.12
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/package.json +1 -1
- package/src/cli.mjs +3 -0
- package/src/i18n/en-US.mjs +7 -4
- package/src/i18n/zh-CN.mjs +7 -4
- package/src/sessions.mjs +13 -1
package/package.json
CHANGED
package/src/cli.mjs
CHANGED
|
@@ -110,6 +110,7 @@ export async function main(
|
|
|
110
110
|
...(error.runId === undefined ? {} : { runId: error.runId }),
|
|
111
111
|
...(error.stage === undefined ? {} : { stage: error.stage }),
|
|
112
112
|
...(error.upstreamCode === undefined ? {} : { upstreamCode: error.upstreamCode }),
|
|
113
|
+
...(error.progress === undefined ? {} : { progress: error.progress }),
|
|
113
114
|
...(error.clientMessageId === undefined ? {} : { clientMessageId: error.clientMessageId })
|
|
114
115
|
};
|
|
115
116
|
if (args?.json === true || (args === undefined && argv.includes('--json')))
|
|
@@ -117,6 +118,8 @@ export async function main(
|
|
|
117
118
|
else {
|
|
118
119
|
writeLine(stderr, program + ': ' + failure.message + ' [' + failure.code + ']');
|
|
119
120
|
if (failure.details !== undefined) writeLine(stderr, failure.details);
|
|
121
|
+
if (failure.progress !== undefined)
|
|
122
|
+
writeLine(stderr, JSON.stringify({ progress: failure.progress }, null, 2));
|
|
120
123
|
}
|
|
121
124
|
return sessionExitCode(error);
|
|
122
125
|
}
|
package/src/i18n/en-US.mjs
CHANGED
|
@@ -98,13 +98,15 @@ Titles and scheduled tasks:
|
|
|
98
98
|
It does not restart execution. schedule list reads local Workspace tasks.
|
|
99
99
|
schedule get/create/update share MCP task data.
|
|
100
100
|
Schedule text is limited to 20,000 characters; update requires cron or text.
|
|
101
|
-
Other-owner edits create PENDING proposals
|
|
101
|
+
Other-owner edits create PENDING proposals.
|
|
102
102
|
Read the current revision before updating; a version conflict is not retried.
|
|
103
103
|
|
|
104
104
|
Reading JSON:
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
105
|
+
list: id/title/runner/status/runId and one latestActivity per Session.
|
|
106
|
+
show: session.status, session.title, session.runId,
|
|
107
|
+
session.model, session.effort, session.queuedCount,
|
|
108
|
+
session.latestMessage, session.recentTools (up to three summaries).
|
|
109
|
+
Status is RUNNING/IDLE/SLEEPING; tools keep their original states.
|
|
108
110
|
history: segments[].items[]; select kind === "assistant_message",
|
|
109
111
|
read payload.text.
|
|
110
112
|
|
|
@@ -122,6 +124,7 @@ Delivery and waiting:
|
|
|
122
124
|
A queued runId may identify another
|
|
123
125
|
active input: correlate queueItemId/clientMessageId with visible history.
|
|
124
126
|
Wait observes the specified Run through Watch. Timeout does not stop it;
|
|
127
|
+
timeout errors may include progress, the last observed bounded snapshot.
|
|
125
128
|
Run success is not proof of task success.
|
|
126
129
|
Completion never wakes a Coordinator.
|
|
127
130
|
On an unknown delivery outcome, inspect state/history; do not blindly resend.
|
package/src/i18n/zh-CN.mjs
CHANGED
|
@@ -95,13 +95,15 @@ ${configurationHelp}
|
|
|
95
95
|
rename 复用现有标题更新,不限制 parent 树、不重启执行。
|
|
96
96
|
schedule list 读取本地 Workspace 任务,get/create/update 与 MCP 共用任务数据。
|
|
97
97
|
任务正文最多 20,000 字符;update 至少指定 cron 或正文。
|
|
98
|
-
修改其他用户的任务会生成 PENDING
|
|
98
|
+
修改其他用户的任务会生成 PENDING 提议。
|
|
99
99
|
更新前读取当前 revision;版本冲突不会自动重试。
|
|
100
100
|
|
|
101
101
|
读取 JSON:
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
102
|
+
list:id/title/runner/status/runId,以及一条 latestActivity。
|
|
103
|
+
show:session.status、session.title、session.runId,
|
|
104
|
+
session.model、session.effort、session.queuedCount,
|
|
105
|
+
session.latestMessage、session.recentTools(最多三条摘要)。
|
|
106
|
+
状态为 RUNNING/IDLE/SLEEPING;工具保留原有生命周期。
|
|
105
107
|
history:segments[].items[] 中按 kind === "assistant_message"
|
|
106
108
|
筛选,读取 payload.text。
|
|
107
109
|
|
|
@@ -117,6 +119,7 @@ ${configurationHelp}
|
|
|
117
119
|
排队回执的 runId 可能属于其他活动输入,
|
|
118
120
|
需按 queueItemId/clientMessageId 与可见历史核对。
|
|
119
121
|
wait 通过 Watch 等待指定 Run;超时不会停止任务,
|
|
122
|
+
超时错误可附 progress,表示最后观察到的有界快照。
|
|
120
123
|
Run 成功不等于业务完成。Worker 完成不自动唤醒 Coordinator。
|
|
121
124
|
投递结果未知时先查状态/历史,不盲目重发。
|
|
122
125
|
|
package/src/sessions.mjs
CHANGED
|
@@ -349,6 +349,7 @@ export async function waitForSessionRun({
|
|
|
349
349
|
let renewal;
|
|
350
350
|
let settled = false;
|
|
351
351
|
let subscribed = false;
|
|
352
|
+
let progress;
|
|
352
353
|
let accept;
|
|
353
354
|
let rejectResult;
|
|
354
355
|
const result = new Promise((resolve, fail) => {
|
|
@@ -364,6 +365,7 @@ export async function waitForSessionRun({
|
|
|
364
365
|
const fail = (code, key, { stage, upstreamCode, ...options } = {}) => {
|
|
365
366
|
const error = new MarctlError(translate(key), { ...options, code });
|
|
366
367
|
if (upstreamCode !== undefined) error.upstreamCode = upstreamCode;
|
|
368
|
+
if (stage === 'timeout' && progress !== undefined) error.progress = progress;
|
|
367
369
|
reject(error, stage);
|
|
368
370
|
};
|
|
369
371
|
const unknown = (stage, detail, source) =>
|
|
@@ -458,8 +460,18 @@ export async function waitForSessionRun({
|
|
|
458
460
|
unknown('snapshot', 'The requested Run was absent from the Watch snapshot.');
|
|
459
461
|
return;
|
|
460
462
|
}
|
|
463
|
+
if (message.payload?.session?.id === sessionId && message.payload?.progress?.runId === runId)
|
|
464
|
+
progress = message.payload.progress;
|
|
461
465
|
check(run);
|
|
462
|
-
} else if (message.type === 'watch.session.event')
|
|
466
|
+
} else if (message.type === 'watch.session.event') {
|
|
467
|
+
const payload = message.event?.payload;
|
|
468
|
+
if (
|
|
469
|
+
(payload?.sessionId ?? payload?.run?.sessionId) === sessionId &&
|
|
470
|
+
payload?.progress?.runId === runId
|
|
471
|
+
)
|
|
472
|
+
progress = payload.progress;
|
|
473
|
+
check(payload?.run);
|
|
474
|
+
}
|
|
463
475
|
if (!settled && message.expiresAt !== undefined) scheduleRenewal(message.expiresAt);
|
|
464
476
|
};
|
|
465
477
|
const onClose = (code, reason) => {
|