@peer-agent/protocol 0.0.5-beta.1 → 0.0.5-beta.2
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 +3 -1
- package/dist/task-overview.js +22 -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;
|
package/dist/task-overview.js
CHANGED
|
@@ -136,6 +136,7 @@ export function projectGoalPlan(snapshot, options) {
|
|
|
136
136
|
...(snapshot.workspaceLabel ? { workspaceLabel: snapshot.workspaceLabel } : {}),
|
|
137
137
|
...(snapshot.deliveryRoute ? { deliveryRoute: snapshot.deliveryRoute } : {}),
|
|
138
138
|
...(snapshot.deliveryHandoffLabel ? { deliveryHandoffLabel: snapshot.deliveryHandoffLabel } : {}),
|
|
139
|
+
...(snapshot.deliveryHandoffStatus ? { deliveryHandoffStatus: snapshot.deliveryHandoffStatus } : {}),
|
|
139
140
|
...(snapshot.requiresQualityReview ? { requiresQualityReview: true } : {}),
|
|
140
141
|
...(snapshot.qualityReviewStatus ? { qualityReviewStatus: snapshot.qualityReviewStatus } : {}),
|
|
141
142
|
...(snapshot.qualityChecks?.length ? { qualityChecks: snapshot.qualityChecks } : {}),
|
|
@@ -157,7 +158,7 @@ export function projectGoalPlan(snapshot, options) {
|
|
|
157
158
|
};
|
|
158
159
|
}
|
|
159
160
|
function decideGoalPlan(snapshot) {
|
|
160
|
-
const { status, runnerStatus, interrupted, accepted } = snapshot;
|
|
161
|
+
const { status, runnerStatus, interrupted, accepted, deliveryHandoffStatus } = snapshot;
|
|
161
162
|
// 未消费的网络/流式中断是当前行动权事实,优先于 completed/result_ready。
|
|
162
163
|
// 用户显式 resume 后 store 会原子清除此事实,再按正常计划状态投影。
|
|
163
164
|
if (interrupted === true) {
|
|
@@ -200,6 +201,26 @@ function decideGoalPlan(snapshot) {
|
|
|
200
201
|
actionLabel: '查看结果',
|
|
201
202
|
};
|
|
202
203
|
}
|
|
204
|
+
if (status === 'completed' && accepted === true && deliveryHandoffStatus !== 'delivered') {
|
|
205
|
+
if (deliveryHandoffStatus === 'stopped') {
|
|
206
|
+
return {
|
|
207
|
+
actionRight: 'result_ready',
|
|
208
|
+
nextAction: 'review_result',
|
|
209
|
+
statusLabel: '交回未完成',
|
|
210
|
+
actionLabel: '查看结果',
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
if (deliveryHandoffStatus === 'delivering'
|
|
214
|
+
|| deliveryHandoffStatus === 'idle'
|
|
215
|
+
|| Boolean(snapshot.deliveryRoute)) {
|
|
216
|
+
return {
|
|
217
|
+
actionRight: 'result_ready',
|
|
218
|
+
nextAction: 'none',
|
|
219
|
+
statusLabel: '正在交回目标分支',
|
|
220
|
+
actionLabel: '查看 →',
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
}
|
|
203
224
|
if (status === 'completed' || status === 'cancelled' || status === 'failed') {
|
|
204
225
|
return {
|
|
205
226
|
actionRight: 'terminal',
|