@peer-agent/protocol 0.0.8 → 0.0.9
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.d.ts +36 -3
- package/dist/goal.js +72 -19
- package/dist/skill-marketplace.d.ts +93 -6
- package/dist/task-overview.d.ts +35 -6
- package/dist/task-overview.js +28 -5
- package/package.json +1 -1
package/dist/goal.d.ts
CHANGED
|
@@ -56,10 +56,11 @@ export declare function formatGoalDeliveryRoute(input: {
|
|
|
56
56
|
readonly locale?: 'zh' | 'en';
|
|
57
57
|
}): string | undefined;
|
|
58
58
|
/**
|
|
59
|
-
*
|
|
59
|
+
* 用户可见的合回状态。没交付线时不展示;停住/进行中不必先验收。
|
|
60
60
|
*/
|
|
61
61
|
export declare function formatGoalDeliveryHandoff(input: {
|
|
62
62
|
readonly deliveryHandoff?: GoalDeliveryHandoff | null;
|
|
63
|
+
/** 保留给调用方透传;合回展示不再看验收戳。 */
|
|
63
64
|
readonly resultAcceptance?: {
|
|
64
65
|
readonly acceptedAt?: string | null;
|
|
65
66
|
} | null;
|
|
@@ -67,6 +68,14 @@ export declare function formatGoalDeliveryHandoff(input: {
|
|
|
67
68
|
}, options?: {
|
|
68
69
|
readonly locale?: 'zh' | 'en';
|
|
69
70
|
}): string | undefined;
|
|
71
|
+
/** 灯条用的短合回状态:合不进 / 还没进 / 已进源头。 */
|
|
72
|
+
export declare function formatGoalDeliveryHandoffLamp(input: {
|
|
73
|
+
readonly deliveryHandoff?: GoalDeliveryHandoff | null;
|
|
74
|
+
readonly deliveryBinding?: GoalDeliveryBinding | null;
|
|
75
|
+
readonly status?: GoalPlanStatus | null;
|
|
76
|
+
}, options?: {
|
|
77
|
+
readonly locale?: 'zh' | 'en';
|
|
78
|
+
}): string | undefined;
|
|
70
79
|
/**
|
|
71
80
|
* Goal/Plan 的执行准入事实。
|
|
72
81
|
*
|
|
@@ -222,17 +231,41 @@ export type GoalRunnerStatus = 'idle' | 'running' | 'compacting_context' | 'resu
|
|
|
222
231
|
export type GoalRunnerIntent = 'execute' | 'verify' | 'explore' | 'synthesize' | 'block';
|
|
223
232
|
export type GoalRunnerPhase = 'orient' | 'inspect' | 'plan_scaffold' | 'act' | 'verify' | 'repair' | 'quality_review' | 'synthesize' | 'blocked';
|
|
224
233
|
export type GoalQualityReviewStatus = 'reviewing' | 'passed' | 'failed';
|
|
225
|
-
/**
|
|
234
|
+
/** 把隔离改动合并进目标分支的结果;不做排队 UI。展示不要求先验收。 */
|
|
226
235
|
export type GoalDeliveryHandoffStatus = 'idle' | 'delivering' | 'delivered' | 'stopped';
|
|
236
|
+
/**
|
|
237
|
+
* 交付模式(ADR 68):merge=隔离任务线合回目标分支;direct=改动直接落在当前工作区。
|
|
238
|
+
* 缺省视为 'merge'(存量记录无此字段,向后兼容)。
|
|
239
|
+
*/
|
|
240
|
+
export type GoalDeliveryMode = 'merge' | 'direct';
|
|
227
241
|
export interface GoalDeliveryHandoff {
|
|
228
242
|
readonly status: GoalDeliveryHandoffStatus;
|
|
243
|
+
/** 交付模式;缺省 'merge'。 */
|
|
244
|
+
readonly deliveryMode?: GoalDeliveryMode;
|
|
229
245
|
readonly repoId?: string;
|
|
230
246
|
readonly targetBranch?: string;
|
|
231
247
|
readonly taskBranch?: string;
|
|
232
248
|
readonly commitSha?: string;
|
|
233
249
|
readonly stoppedReason?: string;
|
|
250
|
+
/**
|
|
251
|
+
* ADR 69:合回分流 verdict。CONFLICT 时 status 为 'stopped' 且 conflicts 非空,
|
|
252
|
+
* 供收口视图批量呈现;AUTO_CLEAN/AUTO_MERGE/STALE 由系统消化,不进「需要你」。
|
|
253
|
+
*/
|
|
254
|
+
readonly verdict?: GoalDeliveryHandoffVerdict;
|
|
255
|
+
/** CONFLICT 时的真冲突文件清单(同名文件内容不同,合并会覆盖工作区)。 */
|
|
256
|
+
readonly conflicts?: readonly GoalDeliveryConflict[];
|
|
234
257
|
readonly updatedAt: string;
|
|
235
258
|
}
|
|
259
|
+
/** ADR 69:合回分流五类判定。 */
|
|
260
|
+
export type GoalDeliveryHandoffVerdict = 'AUTO_CLEAN' | 'AUTO_MERGE' | 'STALE' | 'CONFLICT' | 'BLOCKED_ENV';
|
|
261
|
+
/** 一条真冲突:任务线与目标工作区在同一未跟踪路径上内容不同。 */
|
|
262
|
+
export interface GoalDeliveryConflict {
|
|
263
|
+
readonly path: string;
|
|
264
|
+
/** 工作区版本的 blob 摘要(用于展示/区分)。 */
|
|
265
|
+
readonly worktreeBlob?: string;
|
|
266
|
+
/** 任务线版本的 blob 摘要。 */
|
|
267
|
+
readonly taskBlob?: string;
|
|
268
|
+
}
|
|
236
269
|
export type GoalQualityCheckStatus = 'passed' | 'failed' | 'skipped';
|
|
237
270
|
/** 用户可见的通俗检查记录;内部四层检查名不进界面。 */
|
|
238
271
|
export interface GoalQualityCheck {
|
|
@@ -652,7 +685,7 @@ export interface GoalPlan {
|
|
|
652
685
|
*/
|
|
653
686
|
readonly userOverride?: boolean;
|
|
654
687
|
};
|
|
655
|
-
/**
|
|
688
|
+
/** 合并进目标分支的结果;缺字段表示尚未合回。展示不要求先验收。 */
|
|
656
689
|
readonly deliveryHandoff?: GoalDeliveryHandoff;
|
|
657
690
|
/** 对齐 system-context.ts 的 epoch */
|
|
658
691
|
readonly promptContextEpochId?: string;
|
package/dist/goal.js
CHANGED
|
@@ -57,52 +57,105 @@ function handoffTargetLabel(handoff) {
|
|
|
57
57
|
return repo;
|
|
58
58
|
return undefined;
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function compactBranchName(value) {
|
|
61
|
+
const branch = typeof value === 'string' ? value.trim() : '';
|
|
62
|
+
if (!branch)
|
|
63
|
+
return undefined;
|
|
64
|
+
return branch.replace(/^PeerAgent\//, '') || branch;
|
|
65
|
+
}
|
|
66
|
+
function compactHandoffBranch(handoff) {
|
|
67
|
+
return compactBranchName(handoff.targetBranch);
|
|
68
|
+
}
|
|
69
|
+
function handoffStoppedReasonLabel(reason, locale, branch) {
|
|
70
|
+
const dest = branch || (locale === 'zh' ? '源头' : 'the source line');
|
|
61
71
|
switch (reason) {
|
|
62
72
|
case 'target_branch_moved':
|
|
63
|
-
return locale === 'zh' ?
|
|
73
|
+
return locale === 'zh' ? `${dest} 已更新` : 'target branch moved';
|
|
64
74
|
case 'same_target_busy':
|
|
65
|
-
return locale === 'zh' ?
|
|
75
|
+
return locale === 'zh' ? `同一目标正在合进 ${dest}` : 'same target is merging';
|
|
66
76
|
case 'merge_conflict':
|
|
67
|
-
return locale === 'zh' ?
|
|
77
|
+
return locale === 'zh' ? `合并进 ${dest} 时发生冲突` : 'merge into source conflicted';
|
|
68
78
|
case 'target_checkout_dirty':
|
|
69
79
|
return locale === 'zh'
|
|
70
|
-
?
|
|
71
|
-
:
|
|
80
|
+
? `你正在 ${dest} 上改别的东西,还没提交。没法把这条任务合进去。`
|
|
81
|
+
: `You still have uncommitted work on ${dest}, so this task cannot merge in.`;
|
|
72
82
|
case 'git_timeout':
|
|
73
|
-
return locale === 'zh' ?
|
|
83
|
+
return locale === 'zh' ? `合并进 ${dest} 超时,可重试` : 'merge timed out; retry available';
|
|
74
84
|
case 'git_lock':
|
|
75
85
|
return locale === 'zh' ? '仓库正被占用,可重试' : 'repository is locked; retry available';
|
|
76
86
|
default:
|
|
77
|
-
return locale === 'zh' ?
|
|
87
|
+
return locale === 'zh' ? `合不进 ${dest}` : `cannot merge into ${dest}`;
|
|
78
88
|
}
|
|
79
89
|
}
|
|
90
|
+
function hasDeliveryLine(input) {
|
|
91
|
+
return Boolean(input.deliveryBinding?.taskBranch?.trim())
|
|
92
|
+
|| input.deliveryBinding?.executionIsolation === 'worktree';
|
|
93
|
+
}
|
|
80
94
|
/**
|
|
81
|
-
*
|
|
95
|
+
* 用户可见的合回状态。没交付线时不展示;停住/进行中不必先验收。
|
|
82
96
|
*/
|
|
83
97
|
export function formatGoalDeliveryHandoff(input, options) {
|
|
84
98
|
const locale = options?.locale === 'en' ? 'en' : 'zh';
|
|
85
|
-
|
|
86
|
-
if (typeof acceptedAt !== 'string' || !acceptedAt.trim())
|
|
87
|
-
return undefined;
|
|
88
|
-
const hasTaskLine = Boolean(input.deliveryBinding?.taskBranch?.trim());
|
|
89
|
-
const isolated = input.deliveryBinding?.executionIsolation === 'worktree';
|
|
90
|
-
if (!hasTaskLine && !isolated)
|
|
99
|
+
if (!hasDeliveryLine(input))
|
|
91
100
|
return undefined;
|
|
92
101
|
const handoff = input.deliveryHandoff;
|
|
93
102
|
if (!handoff?.status || handoff.status === 'idle')
|
|
94
103
|
return undefined;
|
|
95
104
|
const target = handoffTargetLabel(handoff);
|
|
105
|
+
const branch = compactHandoffBranch(handoff)
|
|
106
|
+
?? compactBranchName(input.deliveryBinding?.targetBranch);
|
|
96
107
|
if (handoff.status === 'delivering') {
|
|
97
|
-
return locale === 'zh'
|
|
108
|
+
return locale === 'zh'
|
|
109
|
+
? (branch ? `正在合进 ${branch}` : '正在合进源头')
|
|
110
|
+
: (branch ? `merging into ${branch}` : 'merging into source');
|
|
98
111
|
}
|
|
99
112
|
if (handoff.status === 'delivered') {
|
|
113
|
+
// ADR 68:direct 交付没有「合」的动作,用词区分,避免暗示存在合并。
|
|
114
|
+
if (handoff.deliveryMode === 'direct') {
|
|
115
|
+
return target
|
|
116
|
+
? (locale === 'zh' ? `已随 ${target} 交付` : `delivered with ${target}`)
|
|
117
|
+
: (locale === 'zh' ? '已随源头交付' : 'delivered with source');
|
|
118
|
+
}
|
|
100
119
|
return target
|
|
101
|
-
? (locale === 'zh' ?
|
|
102
|
-
: (locale === 'zh' ? '
|
|
120
|
+
? (locale === 'zh' ? `已合进 ${target}` : `merged into ${target}`)
|
|
121
|
+
: (locale === 'zh' ? '已合进源头' : 'merged into source');
|
|
122
|
+
}
|
|
123
|
+
if (handoff.status === 'stopped') {
|
|
124
|
+
return handoffStoppedReasonLabel(handoff.stoppedReason, locale, branch);
|
|
125
|
+
}
|
|
126
|
+
return undefined;
|
|
127
|
+
}
|
|
128
|
+
/** 灯条用的短合回状态:合不进 / 还没进 / 已进源头。 */
|
|
129
|
+
export function formatGoalDeliveryHandoffLamp(input, options) {
|
|
130
|
+
const locale = options?.locale === 'en' ? 'en' : 'zh';
|
|
131
|
+
if (!hasDeliveryLine(input))
|
|
132
|
+
return undefined;
|
|
133
|
+
const dest = compactBranchName(input.deliveryHandoff?.targetBranch)
|
|
134
|
+
?? compactBranchName(input.deliveryBinding?.targetBranch)
|
|
135
|
+
?? (locale === 'zh' ? '源头' : 'source');
|
|
136
|
+
const handoff = input.deliveryHandoff;
|
|
137
|
+
if (!handoff?.status || handoff.status === 'idle') {
|
|
138
|
+
// ADR 68:非隔离计划(无交付线语义)不显示「还没进」——它的完成即交付,没有待合回的工作。
|
|
139
|
+
const isolated = input.deliveryBinding?.executionIsolation === 'worktree';
|
|
140
|
+
const directCandidate = !isolated && input.status === 'completed';
|
|
141
|
+
if (directCandidate)
|
|
142
|
+
return undefined;
|
|
143
|
+
if (input.status === 'completed') {
|
|
144
|
+
return locale === 'zh' ? `还没进 ${dest}` : `not on ${dest}`;
|
|
145
|
+
}
|
|
146
|
+
return undefined;
|
|
147
|
+
}
|
|
148
|
+
if (handoff.status === 'delivering') {
|
|
149
|
+
return locale === 'zh' ? `正在合进 ${dest}` : `merging into ${dest}`;
|
|
150
|
+
}
|
|
151
|
+
if (handoff.status === 'delivered') {
|
|
152
|
+
if (handoff.deliveryMode === 'direct') {
|
|
153
|
+
return locale === 'zh' ? `已随 ${dest} 交付` : `delivered with ${dest}`;
|
|
154
|
+
}
|
|
155
|
+
return locale === 'zh' ? `已进 ${dest}` : `on ${dest}`;
|
|
103
156
|
}
|
|
104
157
|
if (handoff.status === 'stopped') {
|
|
105
|
-
return
|
|
158
|
+
return locale === 'zh' ? `合不进 ${dest}` : `blocked from ${dest}`;
|
|
106
159
|
}
|
|
107
160
|
return undefined;
|
|
108
161
|
}
|
|
@@ -41,16 +41,14 @@ export interface SkillMarketplaceInstallResult {
|
|
|
41
41
|
readonly error?: string;
|
|
42
42
|
}
|
|
43
43
|
/**
|
|
44
|
-
*
|
|
44
|
+
* SkillHub 官方列表排序(GET /api/skills?sortBy=):
|
|
45
45
|
* - score: 全部 / 综合评分
|
|
46
|
-
* - featured: 推荐精选(认证优先,再按评分)
|
|
47
|
-
* - rising: 近期飙升(近期更新 + 下载量,本地近似)
|
|
48
46
|
* - downloads: 下载量
|
|
49
47
|
* - stars: 收藏量
|
|
50
|
-
* -
|
|
51
|
-
* - updated:
|
|
48
|
+
* - installs: 安装量
|
|
49
|
+
* - updated: 最近更新(映射为官方 updated_at)
|
|
52
50
|
*/
|
|
53
|
-
export type SkillHubMarketplaceSort = 'score' | '
|
|
51
|
+
export type SkillHubMarketplaceSort = 'score' | 'downloads' | 'stars' | 'installs' | 'updated';
|
|
54
52
|
export interface SkillHubMarketplaceEntry {
|
|
55
53
|
readonly catalogId: string;
|
|
56
54
|
readonly namespace: string;
|
|
@@ -126,3 +124,92 @@ export interface SkillHubCategoriesResult {
|
|
|
126
124
|
readonly count: number;
|
|
127
125
|
readonly items: readonly SkillHubCategory[];
|
|
128
126
|
}
|
|
127
|
+
export type QoderMarketplaceSort = 'hot' | 'latest';
|
|
128
|
+
/** 筛选维度:category(20 个分类)/ output(9 种产物)/ client(5 个客户端)/ app_ecosystem(8 个生态)。 */
|
|
129
|
+
export type QoderTaxonomyDimension = 'category' | 'output' | 'client' | 'app_ecosystem';
|
|
130
|
+
export interface QoderTaxonomyItem {
|
|
131
|
+
readonly dimension: QoderTaxonomyDimension;
|
|
132
|
+
/** 传回列表接口的 code(如 "Coding"、"document"、"github")。 */
|
|
133
|
+
readonly code: string;
|
|
134
|
+
/** 本地化标签:taxonomies 接口支持 Accept-Language: zh,直接返回中文(如「办公效率」)。 */
|
|
135
|
+
readonly label: string;
|
|
136
|
+
readonly description: string;
|
|
137
|
+
readonly sortOrder: number;
|
|
138
|
+
}
|
|
139
|
+
export interface QoderTaxonomiesResult {
|
|
140
|
+
readonly count: number;
|
|
141
|
+
readonly items: readonly QoderTaxonomyItem[];
|
|
142
|
+
}
|
|
143
|
+
export interface QoderMarketplaceEntry {
|
|
144
|
+
readonly skillId: string;
|
|
145
|
+
readonly name: string;
|
|
146
|
+
readonly nameCn: string;
|
|
147
|
+
readonly description: string;
|
|
148
|
+
readonly descriptionCn: string;
|
|
149
|
+
readonly iconUrl: string | null;
|
|
150
|
+
readonly author: string;
|
|
151
|
+
readonly authorName: string;
|
|
152
|
+
readonly installCount: number;
|
|
153
|
+
readonly category: string;
|
|
154
|
+
/** epoch 毫秒(接口返回字符串) */
|
|
155
|
+
readonly contentUpdatedAt: number;
|
|
156
|
+
}
|
|
157
|
+
export interface QoderMarketplaceQuery {
|
|
158
|
+
readonly keyword?: string;
|
|
159
|
+
readonly page?: number;
|
|
160
|
+
readonly pageSize?: number;
|
|
161
|
+
readonly sortBy?: QoderMarketplaceSort;
|
|
162
|
+
/** 分类筛选(如 ['Coding'];多值为 AND 关系,服务端语义)。 */
|
|
163
|
+
readonly categories?: readonly string[];
|
|
164
|
+
/** 产物类型筛选(如 ['document','code'])。 */
|
|
165
|
+
readonly outputs?: readonly string[];
|
|
166
|
+
/** 客户端筛选(如 ['qoder'])。 */
|
|
167
|
+
readonly clients?: readonly string[];
|
|
168
|
+
/** App 生态筛选(如 ['github','feishu'])。 */
|
|
169
|
+
readonly appEcosystems?: readonly string[];
|
|
170
|
+
}
|
|
171
|
+
export interface QoderMarketplacePage {
|
|
172
|
+
readonly currentPage: number;
|
|
173
|
+
readonly nextPage: number | null;
|
|
174
|
+
readonly lastPage: number;
|
|
175
|
+
readonly pageSize: number;
|
|
176
|
+
readonly totalSize: number;
|
|
177
|
+
readonly items: readonly QoderMarketplaceEntry[];
|
|
178
|
+
}
|
|
179
|
+
export interface QoderMarketplaceFileNode {
|
|
180
|
+
readonly name: string;
|
|
181
|
+
readonly path: string;
|
|
182
|
+
readonly type: 'directory' | 'file';
|
|
183
|
+
readonly size: number;
|
|
184
|
+
readonly files: readonly QoderMarketplaceFileNode[];
|
|
185
|
+
}
|
|
186
|
+
export interface QoderMarketplaceSkillDetail {
|
|
187
|
+
readonly skillId: string;
|
|
188
|
+
readonly name: string;
|
|
189
|
+
readonly nameCn: string;
|
|
190
|
+
readonly description: string;
|
|
191
|
+
readonly descriptionCn: string;
|
|
192
|
+
readonly iconUrl: string | null;
|
|
193
|
+
readonly author: string;
|
|
194
|
+
readonly authorName: string;
|
|
195
|
+
readonly installCount: number;
|
|
196
|
+
readonly category: string;
|
|
197
|
+
readonly version: string;
|
|
198
|
+
readonly downloadUrl: string;
|
|
199
|
+
readonly githubPath: string | null;
|
|
200
|
+
readonly skillMd: string | null;
|
|
201
|
+
readonly fileTree: QoderMarketplaceFileNode | null;
|
|
202
|
+
}
|
|
203
|
+
export type QoderInstallScope = 'global' | 'workspace';
|
|
204
|
+
export interface QoderInstallIdentity {
|
|
205
|
+
readonly skillId: string;
|
|
206
|
+
readonly scope?: QoderInstallScope;
|
|
207
|
+
readonly iconUrl?: string | null;
|
|
208
|
+
}
|
|
209
|
+
export interface QoderInstallResult {
|
|
210
|
+
readonly ok: boolean;
|
|
211
|
+
readonly skillId: string;
|
|
212
|
+
readonly installedSkillId: string;
|
|
213
|
+
readonly version: string;
|
|
214
|
+
readonly scope: QoderInstallScope;
|
|
215
|
+
}
|
package/dist/task-overview.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ import type { AutomationLifecycleStatus, AutomationRunStatus } from './automatio
|
|
|
25
25
|
*
|
|
26
26
|
* - needs_you:阻塞点在用户(待批准 / 待授权 / 待回答 / 待决策)。
|
|
27
27
|
* - peer_advancing:Peer 正在推进,用户无需介入。
|
|
28
|
-
* - result_ready:遗留行动权(Goal
|
|
28
|
+
* - result_ready:遗留行动权(Goal 完成不再进入;合回中改挂 peer_advancing / needs_you)。
|
|
29
29
|
* - paused:用户或系统主动暂停,等待恢复。
|
|
30
30
|
* - terminal:终态,进历史页。
|
|
31
31
|
*/
|
|
@@ -119,11 +119,30 @@ export interface TaskOverviewItem {
|
|
|
119
119
|
*/
|
|
120
120
|
readonly deliveryRoute?: string;
|
|
121
121
|
/**
|
|
122
|
-
*
|
|
123
|
-
*
|
|
122
|
+
* 用户可见的合回状态:已合进 / 正在合进 / 停止原因。
|
|
123
|
+
* 没交付线时不出现;停住/进行中不必先验收。
|
|
124
124
|
*/
|
|
125
125
|
readonly deliveryHandoffLabel?: string;
|
|
126
126
|
readonly deliveryHandoffStatus?: GoalDeliveryHandoffStatus;
|
|
127
|
+
/** 合回目标分支;聚合层用它把同一源头的环境挡收成一张卡。 */
|
|
128
|
+
readonly deliveryTargetBranch?: string;
|
|
129
|
+
/** 合回停住原因;与目标分支一起作为环境挡去重键。 */
|
|
130
|
+
readonly deliveryHandoffStoppedReason?: string;
|
|
131
|
+
/**
|
|
132
|
+
* 源头环境挡卡:被同一源头挡住的任务线。有值时这张卡代表源头,不是某条 Goal 会话。
|
|
133
|
+
* 主按钮不得用 conversationId 打开聊天。
|
|
134
|
+
*/
|
|
135
|
+
readonly blockedPlanIds?: readonly string[];
|
|
136
|
+
/** 被挡任务线标题,供源头卡展开「都有哪些」。 */
|
|
137
|
+
readonly blockedPlanTitles?: readonly string[];
|
|
138
|
+
/** 源头工作区绝对路径;源头动作(列脏文件 / 提交 / stash / 批量再合)用它,不跟会话走。 */
|
|
139
|
+
readonly deliveryWorkspacePath?: string;
|
|
140
|
+
/** ADR 69:分流 verdict;CONFLICT 时配合 deliveryHandoffConflicts 渲染收口面板。 */
|
|
141
|
+
readonly deliveryHandoffVerdict?: string;
|
|
142
|
+
/** ADR 69:CONFLICT 时的真冲突文件清单(同名文件内容不同)。 */
|
|
143
|
+
readonly deliveryHandoffConflicts?: readonly {
|
|
144
|
+
readonly path: string;
|
|
145
|
+
}[];
|
|
127
146
|
/** 状态描述(原型卡片中部,如「Peer 正在验证」「等待权限」)。 */
|
|
128
147
|
readonly statusLabel: string;
|
|
129
148
|
/** 执行异常的可展示原因;仅异常/暂停投影存在,不承载控制状态。 */
|
|
@@ -235,9 +254,19 @@ export interface GoalPlanProjectionSnapshot {
|
|
|
235
254
|
readonly workspaceLabel?: string;
|
|
236
255
|
/** 用户可见的交付路由;缺目标分支时写「未确认」。 */
|
|
237
256
|
readonly deliveryRoute?: string;
|
|
238
|
-
/**
|
|
257
|
+
/** 用户可见的合回状态;没交付线时省略。 */
|
|
239
258
|
readonly deliveryHandoffLabel?: string;
|
|
240
259
|
readonly deliveryHandoffStatus?: GoalDeliveryHandoffStatus;
|
|
260
|
+
readonly deliveryTargetBranch?: string;
|
|
261
|
+
readonly deliveryHandoffStoppedReason?: string;
|
|
262
|
+
readonly blockedPlanIds?: readonly string[];
|
|
263
|
+
readonly blockedPlanTitles?: readonly string[];
|
|
264
|
+
readonly deliveryWorkspacePath?: string;
|
|
265
|
+
/** ADR 69:分流 verdict / CONFLICT 冲突清单(快照透传,供 projectGoalPlan 组装)。 */
|
|
266
|
+
readonly deliveryHandoffVerdict?: string;
|
|
267
|
+
readonly deliveryHandoffConflicts?: readonly {
|
|
268
|
+
readonly path: string;
|
|
269
|
+
}[];
|
|
241
270
|
readonly progress?: {
|
|
242
271
|
readonly completed: number;
|
|
243
272
|
readonly total: number;
|
|
@@ -263,7 +292,7 @@ export interface GoalPlanProjectionSnapshot {
|
|
|
263
292
|
readonly providerLabel?: string;
|
|
264
293
|
/**
|
|
265
294
|
* 遗留字段:用户验收戳。Goal 完成不再据此进入 result_ready;
|
|
266
|
-
*
|
|
295
|
+
* 完成即终态,合回/自检未结束仍走 peer_advancing 或 needs_you。
|
|
267
296
|
*/
|
|
268
297
|
readonly accepted?: boolean;
|
|
269
298
|
/** 有代码副作用时,完成门之后还要质量自检过线才能进终态。 */
|
|
@@ -341,7 +370,7 @@ export declare function projectConversation(snapshot: ConversationProjectionSnap
|
|
|
341
370
|
* 4. runner waiting_user → needs_you/user_input
|
|
342
371
|
* 5. runner blocked | budget_exhausted → needs_you/decision
|
|
343
372
|
* 6. plan completed:
|
|
344
|
-
* -
|
|
373
|
+
* - 合回进行中 → peer_advancing;合回失败 → needs_you/decision
|
|
345
374
|
* - 否则直接 terminal(不再因未验收 / 自检缺口进入 result_ready)
|
|
346
375
|
* 8. plan executing → peer_advancing
|
|
347
376
|
* 9. runner running/compacting/resuming/exploring → peer_advancing
|
package/dist/task-overview.js
CHANGED
|
@@ -79,7 +79,7 @@ export function projectConversation(snapshot) {
|
|
|
79
79
|
* 4. runner waiting_user → needs_you/user_input
|
|
80
80
|
* 5. runner blocked | budget_exhausted → needs_you/decision
|
|
81
81
|
* 6. plan completed:
|
|
82
|
-
* -
|
|
82
|
+
* - 合回进行中 → peer_advancing;合回失败 → needs_you/decision
|
|
83
83
|
* - 否则直接 terminal(不再因未验收 / 自检缺口进入 result_ready)
|
|
84
84
|
* 8. plan executing → peer_advancing
|
|
85
85
|
* 9. runner running/compacting/resuming/exploring → peer_advancing
|
|
@@ -139,6 +139,17 @@ export function projectGoalPlan(snapshot, options) {
|
|
|
139
139
|
...(snapshot.deliveryRoute ? { deliveryRoute: snapshot.deliveryRoute } : {}),
|
|
140
140
|
...(snapshot.deliveryHandoffLabel ? { deliveryHandoffLabel: snapshot.deliveryHandoffLabel } : {}),
|
|
141
141
|
...(snapshot.deliveryHandoffStatus ? { deliveryHandoffStatus: snapshot.deliveryHandoffStatus } : {}),
|
|
142
|
+
...(snapshot.deliveryTargetBranch ? { deliveryTargetBranch: snapshot.deliveryTargetBranch } : {}),
|
|
143
|
+
...(snapshot.deliveryHandoffStoppedReason
|
|
144
|
+
? { deliveryHandoffStoppedReason: snapshot.deliveryHandoffStoppedReason }
|
|
145
|
+
: {}),
|
|
146
|
+
...(snapshot.blockedPlanIds?.length ? { blockedPlanIds: snapshot.blockedPlanIds } : {}),
|
|
147
|
+
...(snapshot.blockedPlanTitles?.length ? { blockedPlanTitles: snapshot.blockedPlanTitles } : {}),
|
|
148
|
+
...(snapshot.deliveryWorkspacePath ? { deliveryWorkspacePath: snapshot.deliveryWorkspacePath } : {}),
|
|
149
|
+
...(snapshot.deliveryHandoffVerdict ? { deliveryHandoffVerdict: snapshot.deliveryHandoffVerdict } : {}),
|
|
150
|
+
...(snapshot.deliveryHandoffConflicts?.length
|
|
151
|
+
? { deliveryHandoffConflicts: snapshot.deliveryHandoffConflicts }
|
|
152
|
+
: {}),
|
|
142
153
|
...(snapshot.requiresQualityReview ? { requiresQualityReview: true } : {}),
|
|
143
154
|
...(snapshot.qualityReviewStatus ? { qualityReviewStatus: snapshot.qualityReviewStatus } : {}),
|
|
144
155
|
...(snapshot.qualityChecks?.length ? { qualityChecks: snapshot.qualityChecks } : {}),
|
|
@@ -163,8 +174,11 @@ export function projectGoalPlan(snapshot, options) {
|
|
|
163
174
|
...(snapshot.conversationId ? { conversationId: snapshot.conversationId } : {}),
|
|
164
175
|
};
|
|
165
176
|
}
|
|
177
|
+
function isDigestibleHandoffVerdict(verdict) {
|
|
178
|
+
return verdict === 'AUTO_CLEAN' || verdict === 'STALE';
|
|
179
|
+
}
|
|
166
180
|
function decideGoalPlan(snapshot) {
|
|
167
|
-
const { status, runnerStatus, interrupted, deliveryHandoffStatus } = snapshot;
|
|
181
|
+
const { status, runnerStatus, interrupted, deliveryHandoffStatus, deliveryHandoffVerdict } = snapshot;
|
|
168
182
|
// 未消费的网络/流式中断是当前行动权事实,优先于 completed/result_ready。
|
|
169
183
|
// 用户显式 resume 后 store 会原子清除此事实,再按正常计划状态投影。
|
|
170
184
|
if (interrupted === true) {
|
|
@@ -193,20 +207,29 @@ function decideGoalPlan(snapshot) {
|
|
|
193
207
|
if (status === 'completed') {
|
|
194
208
|
if (deliveryHandoffStatus && deliveryHandoffStatus !== 'delivered') {
|
|
195
209
|
if (deliveryHandoffStatus === 'stopped') {
|
|
210
|
+
// ADR 69:空壳/过时由系统消化,不再占「需要你」。
|
|
211
|
+
if (isDigestibleHandoffVerdict(deliveryHandoffVerdict)) {
|
|
212
|
+
return {
|
|
213
|
+
actionRight: 'terminal',
|
|
214
|
+
nextAction: 'none',
|
|
215
|
+
statusLabel: '已完成',
|
|
216
|
+
actionLabel: '查看 →',
|
|
217
|
+
};
|
|
218
|
+
}
|
|
196
219
|
return {
|
|
197
220
|
actionRight: 'needs_you',
|
|
198
221
|
needsYouReason: 'decision',
|
|
199
222
|
nextAction: 'decide_blocked',
|
|
200
|
-
statusLabel: '
|
|
223
|
+
statusLabel: '合不进源头',
|
|
201
224
|
actionLabel: '查看进度',
|
|
202
225
|
};
|
|
203
226
|
}
|
|
204
|
-
//
|
|
227
|
+
// 只有真实合回进行中才占工作台。仅有 deliveryRoute 不算正在合进。
|
|
205
228
|
if (deliveryHandoffStatus === 'delivering' || deliveryHandoffStatus === 'idle') {
|
|
206
229
|
return {
|
|
207
230
|
actionRight: 'peer_advancing',
|
|
208
231
|
nextAction: 'none',
|
|
209
|
-
statusLabel: '
|
|
232
|
+
statusLabel: '正在合进源头',
|
|
210
233
|
actionLabel: '查看 →',
|
|
211
234
|
};
|
|
212
235
|
}
|