@peer-agent/protocol 0.0.2-beta.5 → 0.0.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.d.ts +9 -0
- package/dist/system-context.d.ts +4 -0
- package/dist/task-overview.d.ts +2 -0
- package/dist/task-overview.js +12 -2
- package/package.json +1 -1
package/dist/goal.d.ts
CHANGED
|
@@ -472,6 +472,15 @@ export interface GoalRunnerState {
|
|
|
472
472
|
readonly tokenUsed?: number;
|
|
473
473
|
readonly blockedReason?: string;
|
|
474
474
|
readonly lastError?: string;
|
|
475
|
+
/**
|
|
476
|
+
* 尚未被显式 resume 消费的执行中断事实。它独立于叶子任务终态,避免网络/流式
|
|
477
|
+
* 中断在计划状态重派生时被误判为完成。
|
|
478
|
+
*/
|
|
479
|
+
readonly interruption?: {
|
|
480
|
+
readonly source: string;
|
|
481
|
+
readonly reason: string;
|
|
482
|
+
readonly interruptedAt: string;
|
|
483
|
+
};
|
|
475
484
|
readonly updatedAt: string;
|
|
476
485
|
}
|
|
477
486
|
/** 计划 Artifact 定型版,见提案 §3。 */
|
package/dist/system-context.d.ts
CHANGED
|
@@ -74,6 +74,8 @@ export interface ChatStartTaskRequest {
|
|
|
74
74
|
readonly workspacePath?: string | null;
|
|
75
75
|
readonly mode?: string;
|
|
76
76
|
readonly effort?: string;
|
|
77
|
+
/** Request-scoped OpenAI Fast mode; only the ChatGPT subscription adapter consumes it. */
|
|
78
|
+
readonly fastMode?: boolean;
|
|
77
79
|
readonly modelProviderId?: string | null;
|
|
78
80
|
readonly attachments?: readonly unknown[];
|
|
79
81
|
}
|
|
@@ -96,6 +98,8 @@ export interface ChatSendRequest {
|
|
|
96
98
|
*/
|
|
97
99
|
readonly assistantMessageId?: string;
|
|
98
100
|
readonly effort?: string;
|
|
101
|
+
/** Request-scoped OpenAI Fast mode; defaults to false when omitted. */
|
|
102
|
+
readonly fastMode?: boolean;
|
|
99
103
|
readonly mode?: string;
|
|
100
104
|
readonly conversationId?: string;
|
|
101
105
|
/**
|
package/dist/task-overview.d.ts
CHANGED
|
@@ -145,6 +145,8 @@ export interface GoalPlanProjectionSnapshot {
|
|
|
145
145
|
readonly status: GoalPlanStatus;
|
|
146
146
|
/** Runner 实时态;Plan 未进入自驱时为 undefined。 */
|
|
147
147
|
readonly runnerStatus?: GoalRunnerStatus;
|
|
148
|
+
/** Runner 上存在尚未被 resume 消费的网络/流式中断事实。 */
|
|
149
|
+
readonly interrupted?: boolean;
|
|
148
150
|
readonly title: string;
|
|
149
151
|
readonly workspaceLabel?: string;
|
|
150
152
|
readonly progress?: {
|
package/dist/task-overview.js
CHANGED
|
@@ -136,7 +136,17 @@ export function projectGoalPlan(snapshot, options) {
|
|
|
136
136
|
};
|
|
137
137
|
}
|
|
138
138
|
function decideGoalPlan(snapshot) {
|
|
139
|
-
const { status, runnerStatus, accepted } = snapshot;
|
|
139
|
+
const { status, runnerStatus, interrupted, accepted } = snapshot;
|
|
140
|
+
// 未消费的网络/流式中断是当前行动权事实,优先于 completed/result_ready。
|
|
141
|
+
// 用户显式 resume 后 store 会原子清除此事实,再按正常计划状态投影。
|
|
142
|
+
if (interrupted === true) {
|
|
143
|
+
return {
|
|
144
|
+
actionRight: 'paused',
|
|
145
|
+
nextAction: 'resume',
|
|
146
|
+
statusLabel: '执行中断',
|
|
147
|
+
actionLabel: '继续 →',
|
|
148
|
+
};
|
|
149
|
+
}
|
|
140
150
|
// request_user_input 是明确的当前行动权事实。即使旧记录或竞态窗口里
|
|
141
151
|
// plan 已先写成 completed,只要 Runner 仍在 waiting_user,就必须先让用户回答,
|
|
142
152
|
// 不能把尚未消费的问题误投影成结果待验收。
|
|
@@ -156,7 +166,7 @@ function decideGoalPlan(snapshot) {
|
|
|
156
166
|
return {
|
|
157
167
|
actionRight: 'result_ready',
|
|
158
168
|
nextAction: 'review_result',
|
|
159
|
-
statusLabel: '
|
|
169
|
+
statusLabel: '待用户验收',
|
|
160
170
|
actionLabel: '验收 →',
|
|
161
171
|
};
|
|
162
172
|
}
|