@peer-agent/protocol 0.0.5-beta.1 → 0.0.5-beta.3
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/dist/goal.js +8 -0
- package/dist/task-overview.d.ts +5 -1
- package/dist/task-overview.js +23 -1
- package/package.json +1 -1
package/dist/goal.js
CHANGED
|
@@ -61,6 +61,14 @@ function handoffStoppedReasonLabel(reason, locale) {
|
|
|
61
61
|
return locale === 'zh' ? '同一目标正在交回' : 'same target is delivering';
|
|
62
62
|
case 'merge_conflict':
|
|
63
63
|
return locale === 'zh' ? '交回时发生冲突' : 'delivery conflicted';
|
|
64
|
+
case 'target_checkout_dirty':
|
|
65
|
+
return locale === 'zh'
|
|
66
|
+
? '你正在目标分支上,还有未提交改动,交回已暂停'
|
|
67
|
+
: 'target checkout is dirty; delivery paused';
|
|
68
|
+
case 'git_timeout':
|
|
69
|
+
return locale === 'zh' ? '交回超时,可重试' : 'delivery timed out; retry available';
|
|
70
|
+
case 'git_lock':
|
|
71
|
+
return locale === 'zh' ? '仓库正被占用,可重试' : 'repository is locked; retry available';
|
|
64
72
|
default:
|
|
65
73
|
return locale === 'zh' ? '交回已停止' : 'delivery stopped';
|
|
66
74
|
}
|
package/dist/task-overview.d.ts
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* 存储读出字段后组装快照,renderer 只拿到投影产物。这样契约边界清晰,
|
|
19
19
|
* 且测试无需构造巨型 fixture。
|
|
20
20
|
*/
|
|
21
|
-
import type { GoalPlanStatus, GoalRunnerStatus, GoalTiming } from './goal.ts';
|
|
21
|
+
import type { GoalDeliveryHandoffStatus, GoalPlanStatus, GoalRunnerStatus, GoalTiming } from './goal.ts';
|
|
22
22
|
import type { AutomationLifecycleStatus, AutomationRunStatus } from './automation.ts';
|
|
23
23
|
/**
|
|
24
24
|
* 任务的下一步行动权归属(§11.2)。
|
|
@@ -123,6 +123,7 @@ export interface TaskOverviewItem {
|
|
|
123
123
|
* 没隔离或没验收时不出现。
|
|
124
124
|
*/
|
|
125
125
|
readonly deliveryHandoffLabel?: string;
|
|
126
|
+
readonly deliveryHandoffStatus?: GoalDeliveryHandoffStatus;
|
|
126
127
|
/** 状态描述(原型卡片中部,如「Peer 正在验证」「等待权限」)。 */
|
|
127
128
|
readonly statusLabel: string;
|
|
128
129
|
/** 执行异常的可展示原因;仅异常/暂停投影存在,不承载控制状态。 */
|
|
@@ -226,6 +227,7 @@ export interface GoalPlanProjectionSnapshot {
|
|
|
226
227
|
readonly deliveryRoute?: string;
|
|
227
228
|
/** 用户可见的交回状态;没隔离或没验收时省略。 */
|
|
228
229
|
readonly deliveryHandoffLabel?: string;
|
|
230
|
+
readonly deliveryHandoffStatus?: GoalDeliveryHandoffStatus;
|
|
229
231
|
readonly progress?: {
|
|
230
232
|
readonly completed: number;
|
|
231
233
|
readonly total: number;
|
|
@@ -337,6 +339,8 @@ export declare function projectConversation(snapshot: ConversationProjectionSnap
|
|
|
337
339
|
* 13. runner paused → paused
|
|
338
340
|
* 14. runner idle 且 plan executing → paused(异常态,提示诊断)
|
|
339
341
|
* 16. plan completed(已验收)/cancelled/failed → terminal
|
|
342
|
+
* 已验收但交回仍在进行(delivering / idle)或失败(stopped)时
|
|
343
|
+
* 暂不进终态;仅有 deliveryRoute 不算正在交回。
|
|
340
344
|
*
|
|
341
345
|
* 注意 rule 14 在 rule 8 之前不会命中(executing 已被 rule 8 拦截),
|
|
342
346
|
* 因此实现时将 rule 14 放在 rule 8 之后、仅当 runner 显式 idle 时生效。
|
package/dist/task-overview.js
CHANGED
|
@@ -86,6 +86,8 @@ export function projectConversation(snapshot) {
|
|
|
86
86
|
* 13. runner paused → paused
|
|
87
87
|
* 14. runner idle 且 plan executing → paused(异常态,提示诊断)
|
|
88
88
|
* 16. plan completed(已验收)/cancelled/failed → terminal
|
|
89
|
+
* 已验收但交回仍在进行(delivering / idle)或失败(stopped)时
|
|
90
|
+
* 暂不进终态;仅有 deliveryRoute 不算正在交回。
|
|
89
91
|
*
|
|
90
92
|
* 注意 rule 14 在 rule 8 之前不会命中(executing 已被 rule 8 拦截),
|
|
91
93
|
* 因此实现时将 rule 14 放在 rule 8 之后、仅当 runner 显式 idle 时生效。
|
|
@@ -136,6 +138,7 @@ export function projectGoalPlan(snapshot, options) {
|
|
|
136
138
|
...(snapshot.workspaceLabel ? { workspaceLabel: snapshot.workspaceLabel } : {}),
|
|
137
139
|
...(snapshot.deliveryRoute ? { deliveryRoute: snapshot.deliveryRoute } : {}),
|
|
138
140
|
...(snapshot.deliveryHandoffLabel ? { deliveryHandoffLabel: snapshot.deliveryHandoffLabel } : {}),
|
|
141
|
+
...(snapshot.deliveryHandoffStatus ? { deliveryHandoffStatus: snapshot.deliveryHandoffStatus } : {}),
|
|
139
142
|
...(snapshot.requiresQualityReview ? { requiresQualityReview: true } : {}),
|
|
140
143
|
...(snapshot.qualityReviewStatus ? { qualityReviewStatus: snapshot.qualityReviewStatus } : {}),
|
|
141
144
|
...(snapshot.qualityChecks?.length ? { qualityChecks: snapshot.qualityChecks } : {}),
|
|
@@ -157,7 +160,7 @@ export function projectGoalPlan(snapshot, options) {
|
|
|
157
160
|
};
|
|
158
161
|
}
|
|
159
162
|
function decideGoalPlan(snapshot) {
|
|
160
|
-
const { status, runnerStatus, interrupted, accepted } = snapshot;
|
|
163
|
+
const { status, runnerStatus, interrupted, accepted, deliveryHandoffStatus } = snapshot;
|
|
161
164
|
// 未消费的网络/流式中断是当前行动权事实,优先于 completed/result_ready。
|
|
162
165
|
// 用户显式 resume 后 store 会原子清除此事实,再按正常计划状态投影。
|
|
163
166
|
if (interrupted === true) {
|
|
@@ -200,6 +203,25 @@ function decideGoalPlan(snapshot) {
|
|
|
200
203
|
actionLabel: '查看结果',
|
|
201
204
|
};
|
|
202
205
|
}
|
|
206
|
+
if (status === 'completed' && accepted === true && deliveryHandoffStatus !== 'delivered') {
|
|
207
|
+
if (deliveryHandoffStatus === 'stopped') {
|
|
208
|
+
return {
|
|
209
|
+
actionRight: 'result_ready',
|
|
210
|
+
nextAction: 'review_result',
|
|
211
|
+
statusLabel: '交回未完成',
|
|
212
|
+
actionLabel: '查看结果',
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
// 只有真实交回进行中才占工作台。仅有 deliveryRoute 不算正在交回。
|
|
216
|
+
if (deliveryHandoffStatus === 'delivering' || deliveryHandoffStatus === 'idle') {
|
|
217
|
+
return {
|
|
218
|
+
actionRight: 'result_ready',
|
|
219
|
+
nextAction: 'none',
|
|
220
|
+
statusLabel: '正在交回目标分支',
|
|
221
|
+
actionLabel: '查看 →',
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
}
|
|
203
225
|
if (status === 'completed' || status === 'cancelled' || status === 'failed') {
|
|
204
226
|
return {
|
|
205
227
|
actionRight: 'terminal',
|