@peer-agent/protocol 0.0.4-beta.1 → 0.0.4-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.
@@ -85,6 +85,8 @@ export interface TaskOverviewItem {
85
85
  readonly workspaceLabel?: string;
86
86
  /** 状态描述(原型卡片中部,如「Peer 正在验证」「等待权限」)。 */
87
87
  readonly statusLabel: string;
88
+ /** 执行异常的可展示原因;仅异常/暂停投影存在,不承载控制状态。 */
89
+ readonly issueDetail?: string;
88
90
  /** Plan 进度「x / y」;无 Plan 概念的任务为 undefined。 */
89
91
  readonly planProgress?: {
90
92
  readonly completed: number;
@@ -121,7 +123,12 @@ export interface TaskOverviewItem {
121
123
  readonly providerLabel?: string;
122
124
  /** 动作按钮标签(原型「处理 →」「验收 →」「继续 →」)。 */
123
125
  readonly actionLabel: string;
124
- /** 关联的 conversationId,用于深链跳转。 */
126
+ /**
127
+ * 是否存在用户尚未查看的新动态。
128
+ * 该值由主进程依据任务最近活跃时间与持久化阅读水位投影,renderer 不自行推断。
129
+ */
130
+ readonly isUnread?: boolean;
131
+ /** 关联的 conversationId,用于深链跳转和推进阅读水位。 */
125
132
  readonly conversationId?: string;
126
133
  }
127
134
  /** GoalPlan 投影所需的最小字段快照。 */
@@ -147,6 +154,8 @@ export interface GoalPlanProjectionSnapshot {
147
154
  readonly runnerStatus?: GoalRunnerStatus;
148
155
  /** Runner 上存在尚未被 resume 消费的网络/流式中断事实。 */
149
156
  readonly interrupted?: boolean;
157
+ /** 持久化中断事实中的用户可展示原因。 */
158
+ readonly interruptionReason?: string;
150
159
  readonly title: string;
151
160
  readonly workspaceLabel?: string;
152
161
  readonly progress?: {
@@ -52,6 +52,7 @@ export function projectConversation(snapshot) {
52
52
  const providerLabel = typeof snapshot.providerLabel === 'string' && snapshot.providerLabel.trim()
53
53
  ? snapshot.providerLabel.trim()
54
54
  : undefined;
55
+ const unread = isConversationUnreadForDiscussion(snapshot);
55
56
  return {
56
57
  taskId: snapshot.conversationId,
57
58
  source: 'conversation',
@@ -59,8 +60,9 @@ export function projectConversation(snapshot) {
59
60
  nextAction: 'continue_task',
60
61
  title: snapshot.title,
61
62
  ...(snapshot.workspaceLabel ? { workspaceLabel: snapshot.workspaceLabel } : {}),
62
- // 「正在讨论」是未读入口,不是任务态;状态文案用「有未读」。
63
- statusLabel: '有未读',
63
+ // 已读水位只改变状态,不应把会话从历史投影中删除。
64
+ statusLabel: unread ? '有未读' : '已读',
65
+ isUnread: unread,
64
66
  ...(snapshot.updatedAt ? { lastActiveAt: snapshot.updatedAt } : {}),
65
67
  ...(modelLabel ? { modelLabel } : {}),
66
68
  ...(providerLabel ? { providerLabel } : {}),
@@ -122,6 +124,9 @@ export function projectGoalPlan(snapshot, options) {
122
124
  title: snapshot.title,
123
125
  ...(snapshot.workspaceLabel ? { workspaceLabel: snapshot.workspaceLabel } : {}),
124
126
  statusLabel: decision.statusLabel,
127
+ ...(decision.actionRight === 'paused' && snapshot.interruptionReason
128
+ ? { issueDetail: snapshot.interruptionReason }
129
+ : {}),
125
130
  ...(snapshot.progress ? { planProgress: snapshot.progress } : {}),
126
131
  ...(snapshot.planSteps && snapshot.planSteps.length > 0
127
132
  ? { planSteps: snapshot.planSteps }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peer-agent/protocol",
3
- "version": "0.0.4-beta.1",
3
+ "version": "0.0.4-beta.2",
4
4
  "description": "Shared host-neutral protocol contracts for Peer Agent runtimes and clients.",
5
5
  "type": "module",
6
6
  "license": "MIT",