@peer-agent/protocol 0.1.0-rc.5 → 0.1.0-rc.50
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/acceptance-close-gate.d.ts +10 -1
- package/dist/acceptance-close-gate.js +12 -0
- package/dist/agent-supervision.d.ts +81 -0
- package/dist/agent-supervision.js +1 -0
- package/dist/attention.d.ts +44 -0
- package/dist/attention.js +1 -0
- package/dist/bot-access-policy.d.ts +29 -0
- package/dist/bot-access-policy.js +1 -0
- package/dist/bot-conversation-read.d.ts +67 -0
- package/dist/bot-conversation-read.js +9 -0
- package/dist/bot-direct-step.d.ts +11 -0
- package/dist/bot-direct-step.js +1 -0
- package/dist/bot-git.d.ts +55 -0
- package/dist/bot-git.js +1 -0
- package/dist/bot-model-selection.d.ts +13 -0
- package/dist/bot-model-selection.js +1 -0
- package/dist/browser-window.d.ts +48 -0
- package/dist/browser-window.js +23 -0
- package/dist/capability-admission.d.ts +20 -0
- package/dist/capability-admission.js +1 -0
- package/dist/compaction-history-selection.d.ts +15 -0
- package/dist/compaction-history-selection.js +30 -0
- package/dist/compaction.d.ts +5 -0
- package/dist/compaction.js +6 -0
- package/dist/context-accounting.d.ts +3 -0
- package/dist/conversation-execution.d.ts +68 -0
- package/dist/conversation-execution.js +222 -0
- package/dist/delegation-coordination.d.ts +81 -0
- package/dist/delegation-coordination.js +1 -0
- package/dist/delegation.d.ts +260 -7
- package/dist/delegation.js +97 -39
- package/dist/document-reference.d.ts +111 -0
- package/dist/document-reference.js +1 -0
- package/dist/evidence-inspection.d.ts +64 -0
- package/dist/evidence-inspection.js +1 -0
- package/dist/gemini-standard-pricing.json +105 -0
- package/dist/goal.d.ts +50 -2
- package/dist/hook-observation.d.ts +2 -0
- package/dist/hook-observation.js +19 -0
- package/dist/index.d.ts +109 -25
- package/dist/index.js +38 -0
- package/dist/input-prediction.d.ts +86 -0
- package/dist/input-prediction.js +48 -0
- package/dist/intent-coordination.d.ts +201 -0
- package/dist/intent-coordination.js +1 -0
- package/dist/interactive-result.d.ts +363 -0
- package/dist/interactive-result.js +215 -0
- package/dist/interactive-verification.d.ts +41 -0
- package/dist/interactive-verification.js +65 -0
- package/dist/local-git.d.ts +44 -0
- package/dist/local-git.js +3 -0
- package/dist/local-image.d.ts +53 -0
- package/dist/local-image.js +5 -0
- package/dist/local-read.d.ts +9 -0
- package/dist/local-read.js +1 -0
- package/dist/memory.d.ts +71 -11
- package/dist/memory.js +12 -0
- package/dist/model-reasoning.d.ts +16 -0
- package/dist/model-reasoning.js +25 -0
- package/dist/model-routing.d.ts +39 -3
- package/dist/model-routing.js +31 -5
- package/dist/native-process.d.ts +21 -0
- package/dist/native-process.js +51 -0
- package/dist/parent-coordination.d.ts +104 -0
- package/dist/parent-coordination.js +2 -0
- package/dist/project-agent-failure.d.ts +30 -0
- package/dist/project-agent-failure.js +44 -0
- package/dist/project-input-recovery.d.ts +83 -0
- package/dist/project-input-recovery.js +25 -0
- package/dist/project-matter.d.ts +225 -0
- package/dist/project-matter.js +1 -0
- package/dist/project-recovery.d.ts +43 -0
- package/dist/project-recovery.js +1 -0
- package/dist/project.d.ts +136 -0
- package/dist/project.js +130 -5
- package/dist/quiet-reply.d.ts +9 -0
- package/dist/quiet-reply.js +43 -0
- package/dist/remote-access.d.ts +15 -0
- package/dist/remote-access.js +1 -1
- package/dist/reply-delivery.d.ts +28 -0
- package/dist/reply-delivery.js +1 -0
- package/dist/resource-edit-execution.d.ts +68 -0
- package/dist/resource-edit-execution.js +96 -0
- package/dist/resource-edit.d.ts +237 -0
- package/dist/resource-edit.js +134 -0
- package/dist/resource-feedback-transport.d.ts +26 -0
- package/dist/resource-feedback-transport.js +94 -0
- package/dist/resource-feedback.d.ts +98 -0
- package/dist/resource-feedback.js +151 -0
- package/dist/resource-file-replace.d.ts +36 -0
- package/dist/resource-file-replace.js +40 -0
- package/dist/resource-reference-hints.d.ts +3 -0
- package/dist/resource-reference-hints.js +58 -0
- package/dist/resource-window.d.ts +222 -0
- package/dist/resource-window.js +252 -0
- package/dist/runtime-session-facts.d.ts +58 -0
- package/dist/runtime-session-facts.js +57 -0
- package/dist/session-control.d.ts +211 -0
- package/dist/session-control.js +48 -0
- package/dist/session-facts.d.ts +29 -0
- package/dist/session-facts.js +35 -0
- package/dist/skill-marketplace.d.ts +39 -4
- package/dist/spend-budget.d.ts +69 -0
- package/dist/spend-budget.js +1 -0
- package/dist/system-context.d.ts +7 -0
- package/dist/task-overview.d.ts +91 -0
- package/dist/task-overview.js +325 -17
- package/dist/tool-activity-preview.d.ts +4 -0
- package/dist/tool-activity-preview.js +72 -0
- package/dist/updater.d.ts +13 -3
- package/dist/usage-accounting.d.ts +42 -1
- package/dist/user-anchor.d.ts +17 -0
- package/dist/user-anchor.js +1 -0
- package/dist/work-coordination.d.ts +188 -0
- package/dist/work-coordination.js +1 -0
- package/dist/work-hook.d.ts +3 -0
- package/dist/work-hook.js +76 -0
- package/dist/working-plan.d.ts +18 -0
- package/dist/working-plan.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type ExecutionOwnership, type LifecycleDecision, type LifecycleFacts } from './task-overview.ts';
|
|
2
|
+
export type { ExecutionOwnership, LifecycleDecision, LifecycleFacts } from './task-overview.ts';
|
|
3
|
+
export interface SessionFactSnapshot {
|
|
4
|
+
readonly status: LifecycleDecision['status'];
|
|
5
|
+
readonly verificationActive: boolean;
|
|
6
|
+
readonly needsUser: boolean;
|
|
7
|
+
readonly blockedReason?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* 兼容入口:把扁平事实交给唯一的生命周期决策器。
|
|
11
|
+
* 旧的直接判定逻辑已删除,`status / needsUser / blockedReason` 全部来自 `decideLifecycle`。
|
|
12
|
+
*/
|
|
13
|
+
export declare function deriveSessionFacts(input: {
|
|
14
|
+
status?: string;
|
|
15
|
+
phase?: string;
|
|
16
|
+
runnerStatus?: string;
|
|
17
|
+
accepted?: boolean;
|
|
18
|
+
superseded?: boolean;
|
|
19
|
+
needsUser?: boolean;
|
|
20
|
+
blockedReason?: string;
|
|
21
|
+
verificationActive?: boolean;
|
|
22
|
+
interrupted?: boolean;
|
|
23
|
+
interruptionOrigin?: LifecycleFacts['interruptionOrigin'];
|
|
24
|
+
delegated?: boolean;
|
|
25
|
+
cancellationPhase?: string;
|
|
26
|
+
cancellationDisposition?: LifecycleFacts['cancellationDisposition'];
|
|
27
|
+
takeoverPhase?: string;
|
|
28
|
+
executionOwnership?: ExecutionOwnership;
|
|
29
|
+
}): SessionFactSnapshot;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { decideLifecycle, } from "./task-overview.js";
|
|
2
|
+
/**
|
|
3
|
+
* 兼容入口:把扁平事实交给唯一的生命周期决策器。
|
|
4
|
+
* 旧的直接判定逻辑已删除,`status / needsUser / blockedReason` 全部来自 `decideLifecycle`。
|
|
5
|
+
*/
|
|
6
|
+
export function deriveSessionFacts(input) {
|
|
7
|
+
const snapshot = {
|
|
8
|
+
conversationId: '',
|
|
9
|
+
title: '',
|
|
10
|
+
planId: '',
|
|
11
|
+
status: (input.status ?? 'executing'),
|
|
12
|
+
...(input.runnerStatus ? { runnerStatus: input.runnerStatus } : {}),
|
|
13
|
+
};
|
|
14
|
+
const decision = decideLifecycle(snapshot, {
|
|
15
|
+
...(input.executionOwnership ? { executionOwnership: input.executionOwnership } : {}),
|
|
16
|
+
...(input.phase ? { phase: input.phase } : {}),
|
|
17
|
+
...(input.accepted !== undefined ? { accepted: input.accepted } : {}),
|
|
18
|
+
...(input.superseded !== undefined ? { superseded: input.superseded } : {}),
|
|
19
|
+
...(input.needsUser !== undefined ? { needsUser: input.needsUser } : {}),
|
|
20
|
+
...(input.blockedReason ? { blockedReason: input.blockedReason } : {}),
|
|
21
|
+
...(input.verificationActive !== undefined ? { verificationActive: input.verificationActive } : {}),
|
|
22
|
+
...(input.interrupted !== undefined ? { interrupted: input.interrupted } : {}),
|
|
23
|
+
...(input.interruptionOrigin ? { interruptionOrigin: input.interruptionOrigin } : {}),
|
|
24
|
+
...(input.delegated !== undefined ? { delegated: input.delegated } : {}),
|
|
25
|
+
...(input.cancellationPhase ? { cancellationPhase: input.cancellationPhase } : {}),
|
|
26
|
+
...(input.cancellationDisposition ? { cancellationDisposition: input.cancellationDisposition } : {}),
|
|
27
|
+
...(input.takeoverPhase ? { takeoverPhase: input.takeoverPhase } : {}),
|
|
28
|
+
});
|
|
29
|
+
return {
|
|
30
|
+
status: decision.status,
|
|
31
|
+
verificationActive: decision.verificationActive,
|
|
32
|
+
needsUser: decision.needsUser,
|
|
33
|
+
...(decision.blockedReason ? { blockedReason: decision.blockedReason } : {}),
|
|
34
|
+
};
|
|
35
|
+
}
|
|
@@ -40,6 +40,39 @@ export interface SkillMarketplaceInstallResult {
|
|
|
40
40
|
readonly skillId?: string;
|
|
41
41
|
readonly error?: string;
|
|
42
42
|
}
|
|
43
|
+
export interface SkillInstallTarget {
|
|
44
|
+
readonly id: string;
|
|
45
|
+
readonly workspaceId: string;
|
|
46
|
+
readonly name: string;
|
|
47
|
+
readonly path: string;
|
|
48
|
+
readonly kind: 'bot' | 'workspace';
|
|
49
|
+
readonly available: boolean;
|
|
50
|
+
readonly unavailableReason?: string;
|
|
51
|
+
readonly isActive: boolean;
|
|
52
|
+
}
|
|
53
|
+
export interface SkillInstallTargetRequest {
|
|
54
|
+
readonly workspaceId?: string;
|
|
55
|
+
readonly workspacePath?: string;
|
|
56
|
+
}
|
|
57
|
+
export type SkillInstallTargetResult = {
|
|
58
|
+
readonly workspaceId: string | null;
|
|
59
|
+
readonly name: string;
|
|
60
|
+
readonly path: string | null;
|
|
61
|
+
} & ({
|
|
62
|
+
readonly ok: true;
|
|
63
|
+
readonly skillId: string;
|
|
64
|
+
} | {
|
|
65
|
+
readonly ok: false;
|
|
66
|
+
readonly error: string;
|
|
67
|
+
readonly code?: string;
|
|
68
|
+
});
|
|
69
|
+
export interface SkillInstallBatchReceipt {
|
|
70
|
+
readonly partial: boolean;
|
|
71
|
+
readonly succeededCount: number;
|
|
72
|
+
readonly failedCount: number;
|
|
73
|
+
readonly results: readonly SkillInstallTargetResult[];
|
|
74
|
+
}
|
|
75
|
+
export type SkillHubInstallResult = SkillMarketplaceInstallResult & Partial<SkillInstallBatchReceipt>;
|
|
43
76
|
/**
|
|
44
77
|
* SkillHub 官方列表排序(GET /api/skills?sortBy=):
|
|
45
78
|
* - score: 全部 / 综合评分
|
|
@@ -106,9 +139,10 @@ export interface SkillHubInstallRequest {
|
|
|
106
139
|
readonly namespace: string;
|
|
107
140
|
readonly slug: string;
|
|
108
141
|
readonly version: string;
|
|
109
|
-
/** 默认 global
|
|
142
|
+
/** 默认 global。工作区安装使用 targets,旧调用方可传 workspacePath。 */
|
|
110
143
|
readonly scope?: SkillHubInstallScope;
|
|
111
144
|
readonly workspacePath?: string;
|
|
145
|
+
readonly targets?: readonly SkillInstallTargetRequest[];
|
|
112
146
|
/** 市场图标 URL;安装时写入本地 _meta.json,供已安装列表展示。 */
|
|
113
147
|
readonly iconUrl?: string | null;
|
|
114
148
|
}
|
|
@@ -206,12 +240,13 @@ export interface QoderInstallIdentity {
|
|
|
206
240
|
readonly skillId: string;
|
|
207
241
|
readonly scope?: QoderInstallScope;
|
|
208
242
|
readonly workspacePath?: string;
|
|
243
|
+
readonly targets?: readonly SkillInstallTargetRequest[];
|
|
209
244
|
readonly iconUrl?: string | null;
|
|
210
245
|
}
|
|
211
|
-
export interface QoderInstallResult {
|
|
246
|
+
export interface QoderInstallResult extends Partial<SkillInstallBatchReceipt> {
|
|
212
247
|
readonly ok: boolean;
|
|
213
248
|
readonly skillId: string;
|
|
214
|
-
readonly installedSkillId
|
|
215
|
-
readonly version
|
|
249
|
+
readonly installedSkillId?: string;
|
|
250
|
+
readonly version?: string;
|
|
216
251
|
readonly scope: QoderInstallScope;
|
|
217
252
|
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export type ChannelSpendAnchorSource = 'ai_studio_browser' | 'manual';
|
|
2
|
+
export interface ChannelSpendAnchor {
|
|
3
|
+
readonly periodKey: string;
|
|
4
|
+
readonly amountUsd: string;
|
|
5
|
+
readonly monthlyLimitUsd?: string;
|
|
6
|
+
readonly capturedAtUtc: string;
|
|
7
|
+
readonly source: ChannelSpendAnchorSource;
|
|
8
|
+
readonly projectLabel?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ChannelSpendBudgetConfig {
|
|
11
|
+
readonly enabled?: boolean;
|
|
12
|
+
readonly monthlyLimitUsd?: string;
|
|
13
|
+
readonly resetTimezone?: string;
|
|
14
|
+
readonly warnThresholds?: readonly [number, number];
|
|
15
|
+
readonly policy?: 'warn_only';
|
|
16
|
+
readonly sharedProjectKey?: string;
|
|
17
|
+
readonly anchor?: ChannelSpendAnchor;
|
|
18
|
+
}
|
|
19
|
+
export interface ChannelLocalBudgetSnapshot {
|
|
20
|
+
readonly groupId: string;
|
|
21
|
+
readonly periodKey: string;
|
|
22
|
+
readonly resetTimezone: string;
|
|
23
|
+
readonly windowStartUtc: string;
|
|
24
|
+
readonly windowEndUtc: string;
|
|
25
|
+
readonly nextResetAtUtc: string;
|
|
26
|
+
readonly effectiveLimitUsd: string | null;
|
|
27
|
+
readonly limitSource: 'configured' | 'anchor' | 'none';
|
|
28
|
+
readonly estimatedSpendUsd: string | null;
|
|
29
|
+
readonly localDeltaSpendUsd: string | null;
|
|
30
|
+
readonly anchor: ChannelSpendAnchor | null;
|
|
31
|
+
readonly anchorActive: boolean;
|
|
32
|
+
readonly anchorExpired: boolean;
|
|
33
|
+
readonly sourceKind: 'local_estimate' | 'anchor_plus_local' | 'manual_anchor_plus_local';
|
|
34
|
+
readonly scopeLabel: 'channel_group' | 'shared_project';
|
|
35
|
+
readonly coverage: 'complete' | 'partial' | 'none';
|
|
36
|
+
readonly unpricedRequestCount: number;
|
|
37
|
+
readonly truncated: boolean;
|
|
38
|
+
readonly percentUsed: number | null;
|
|
39
|
+
readonly alertLevel: 'normal' | 'warning' | 'critical' | 'exceeded';
|
|
40
|
+
readonly pricingNote: string | null;
|
|
41
|
+
}
|
|
42
|
+
export interface ChannelBudgetView {
|
|
43
|
+
readonly revision: string;
|
|
44
|
+
readonly config: ChannelSpendBudgetConfig | null;
|
|
45
|
+
readonly periodKey: string;
|
|
46
|
+
readonly localBudget: ChannelLocalBudgetSnapshot | null;
|
|
47
|
+
}
|
|
48
|
+
export interface ChannelBudgetUpdate {
|
|
49
|
+
readonly groupId: string;
|
|
50
|
+
readonly revision: string;
|
|
51
|
+
readonly config: ChannelSpendBudgetConfig;
|
|
52
|
+
}
|
|
53
|
+
export type BillingSyncResult<T = object> = ({
|
|
54
|
+
readonly ok: true;
|
|
55
|
+
} & T) | {
|
|
56
|
+
readonly ok: false;
|
|
57
|
+
readonly reason: string;
|
|
58
|
+
};
|
|
59
|
+
export interface BillingSyncPreview {
|
|
60
|
+
readonly previewId: string;
|
|
61
|
+
readonly anchor: ChannelSpendAnchor;
|
|
62
|
+
}
|
|
63
|
+
export interface BillingSyncConfirm {
|
|
64
|
+
readonly syncId: string;
|
|
65
|
+
readonly previewId: string;
|
|
66
|
+
readonly amountUsd: string;
|
|
67
|
+
readonly monthlyLimitUsd?: string;
|
|
68
|
+
readonly projectLabel?: string;
|
|
69
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/system-context.d.ts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
export type AttachmentContextKind = 'image' | 'text' | 'unsupported';
|
|
2
|
+
/** Host failure facts retained with an interrupted reply; never execution authority. */
|
|
3
|
+
export interface ChatStreamFailure {
|
|
4
|
+
readonly code: string;
|
|
5
|
+
readonly causeCode?: string;
|
|
6
|
+
readonly precedingCode?: string;
|
|
7
|
+
readonly retryAfterMs?: number;
|
|
8
|
+
}
|
|
2
9
|
export type AttachmentContextTransport = 'provider_image_part' | 'user_text_part' | 'metadata_only' | string;
|
|
3
10
|
/**
|
|
4
11
|
* 全局「兜底多模态模型」配置。
|
package/dist/task-overview.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { WorkSessionStatus } from './delegation.ts';
|
|
1
2
|
/**
|
|
2
3
|
* TaskOverview 行动权投影契约 —— Peer 2.0 阶段 0 协议层。
|
|
3
4
|
*
|
|
@@ -103,6 +104,11 @@ export interface TaskOverviewItem {
|
|
|
103
104
|
readonly source: TaskOverviewSourceKind;
|
|
104
105
|
/** 行动权归属。 */
|
|
105
106
|
readonly actionRight: TaskActionRight;
|
|
107
|
+
/**
|
|
108
|
+
* 本投影是否真的可取消(生命周期决策给出)。
|
|
109
|
+
* 缺省表示来自尚未接入决策的旧入口;renderer 不得自行再写一套生命周期规则。
|
|
110
|
+
*/
|
|
111
|
+
readonly cancelable?: boolean;
|
|
106
112
|
/** needs_you 细分桶;仅 actionRight === 'needs_you' 时有值。 */
|
|
107
113
|
readonly needsYouReason?: TaskNeedsYouReason;
|
|
108
114
|
/** 下一步动作标识。 */
|
|
@@ -240,12 +246,16 @@ export interface ConversationProjectionSnapshot {
|
|
|
240
246
|
readonly providerLabel?: string;
|
|
241
247
|
}
|
|
242
248
|
export interface GoalPlanProjectionSnapshot {
|
|
249
|
+
readonly needsUser?: boolean;
|
|
250
|
+
readonly blockedReason?: string;
|
|
243
251
|
readonly planId: string;
|
|
244
252
|
readonly status: GoalPlanStatus;
|
|
245
253
|
/** Runner 实时态;Plan 未进入自驱时为 undefined。 */
|
|
246
254
|
readonly runnerStatus?: GoalRunnerStatus;
|
|
247
255
|
/** Runner 阻塞是否由系统基础设施持有,而不是用户行动权。 */
|
|
248
256
|
readonly systemBlocked?: boolean;
|
|
257
|
+
/** A delegated worker is coordinating with its parent, not asking the human. */
|
|
258
|
+
readonly agentWaiting?: boolean;
|
|
249
259
|
/**
|
|
250
260
|
* 同一会话此刻是否有前台活流(正在输出 / 调工具 / compact)。
|
|
251
261
|
* 由聚合层从 listActiveStreams 写入;协议层只认这个布尔事实。
|
|
@@ -255,6 +265,7 @@ export interface GoalPlanProjectionSnapshot {
|
|
|
255
265
|
readonly interrupted?: boolean;
|
|
256
266
|
/** 持久化中断事实中的用户可展示原因。 */
|
|
257
267
|
readonly interruptionReason?: string;
|
|
268
|
+
readonly interruptionOrigin?: import('./agent-supervision.ts').InterruptionOrigin;
|
|
258
269
|
readonly title: string;
|
|
259
270
|
readonly workspaceLabel?: string;
|
|
260
271
|
/** 用户可见的交付路由;缺目标分支时写「未确认」。 */
|
|
@@ -300,6 +311,15 @@ export interface GoalPlanProjectionSnapshot {
|
|
|
300
311
|
* 完成即终态,合回/自检未结束仍走 peer_advancing 或 needs_you。
|
|
301
312
|
*/
|
|
302
313
|
readonly accepted?: boolean;
|
|
314
|
+
/**
|
|
315
|
+
* 进程内执行所有权(runtime → protocol 事实)。
|
|
316
|
+
* 只有 `live` 能证明"还在跑";重启后缺 token 只能 `unknown`,既不是活体也不是已结束。
|
|
317
|
+
*/
|
|
318
|
+
readonly executionOwnership?: ExecutionOwnership;
|
|
319
|
+
/** 是否委派会话;委派任务的 accepted 只能来自真实落盘的验收结论。 */
|
|
320
|
+
readonly delegated?: boolean;
|
|
321
|
+
/** 归一化后的活体执行事实,仅由 decideLifecycle 计算,调用方不得直接写。 */
|
|
322
|
+
readonly liveExecution?: boolean;
|
|
303
323
|
/** 有代码副作用时,完成门之后还要质量自检过线才能进终态。 */
|
|
304
324
|
readonly requiresQualityReview?: boolean;
|
|
305
325
|
readonly qualityReviewStatus?: 'reviewing' | 'passed' | 'failed';
|
|
@@ -357,6 +377,76 @@ export interface ShellBackgroundProjectionSnapshot {
|
|
|
357
377
|
readonly toolCallId?: string;
|
|
358
378
|
readonly conversationId?: string;
|
|
359
379
|
}
|
|
380
|
+
interface ProjectionDecision {
|
|
381
|
+
readonly actionRight: TaskActionRight;
|
|
382
|
+
readonly needsYouReason?: TaskNeedsYouReason;
|
|
383
|
+
readonly nextAction: TaskNextAction;
|
|
384
|
+
readonly statusLabel: string;
|
|
385
|
+
readonly actionLabel: string;
|
|
386
|
+
}
|
|
387
|
+
/**
|
|
388
|
+
* 进程内执行所有权。`live` 只能由本进程持有的执行/核验 token 产生;
|
|
389
|
+
* 重启后持久化标记只能算 `unknown`(不许当活体,也不许当已结束)。
|
|
390
|
+
*/
|
|
391
|
+
export type ExecutionOwnership = 'live' | 'ended' | 'unknown';
|
|
392
|
+
/**
|
|
393
|
+
* 生命周期事实:runtime 只提供事实,不提供结论。
|
|
394
|
+
* `decideLifecycle` 是 `status / statusLabel / actionRight / nextAction / cancelable`
|
|
395
|
+
* 的唯一出口;任何适配器都不得自行改写生命周期结论。
|
|
396
|
+
*/
|
|
397
|
+
export interface LifecycleFacts {
|
|
398
|
+
readonly humanGate?: boolean;
|
|
399
|
+
readonly executionOwnership?: ExecutionOwnership;
|
|
400
|
+
readonly phase?: string;
|
|
401
|
+
readonly delegated?: boolean;
|
|
402
|
+
readonly acceptance?: string;
|
|
403
|
+
readonly accepted?: boolean;
|
|
404
|
+
readonly superseded?: boolean;
|
|
405
|
+
readonly needsUser?: boolean;
|
|
406
|
+
/** 未消费的执行中断是当前行动权事实,优先于 completed/结果就绪。 */
|
|
407
|
+
readonly interrupted?: boolean;
|
|
408
|
+
readonly interruptionOrigin?: import('./agent-supervision.ts').InterruptionOrigin;
|
|
409
|
+
readonly verificationActive?: boolean;
|
|
410
|
+
readonly verificationFailed?: boolean;
|
|
411
|
+
readonly blockedReason?: string;
|
|
412
|
+
readonly cancellationPhase?: string;
|
|
413
|
+
readonly cancellationDisposition?: 'user_withdrawn';
|
|
414
|
+
readonly obligationDisposition?: 'indexed' | 'suspended' | 'current';
|
|
415
|
+
readonly takeoverPhase?: string;
|
|
416
|
+
readonly coordinationPhase?: string;
|
|
417
|
+
}
|
|
418
|
+
export interface LifecycleCoreDecision extends ProjectionDecision {
|
|
419
|
+
readonly status: WorkSessionStatus;
|
|
420
|
+
readonly cancelable: boolean;
|
|
421
|
+
readonly needsUser: boolean;
|
|
422
|
+
readonly verificationActive: boolean;
|
|
423
|
+
readonly blockedReason?: string;
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* 当前跟进责任(ADR 110)。`bot` = 主 Bot 自己收口的技术跟进;`user` = 真实人工/策略门槛;
|
|
427
|
+
* `none` = 退出当前待办(已签收、已被完成替换承接、用户停止已确认)。
|
|
428
|
+
* `inCurrentList` 是派生事实,不允许消费端各自按 status 再判一次。
|
|
429
|
+
*/
|
|
430
|
+
export type FollowUpOwner = 'bot' | 'user' | 'none';
|
|
431
|
+
export type FollowUpReason = 'settled' | 'superseded' | 'stop_confirmed' | 'user_withdrawn' | 'stop_unconfirmed' | 'human_request' | 'awaiting_human_gate' | 'technical_block' | 'local_persistence_failed' | 'awaiting_acceptance_technical' | 'verification_failed' | 'execution_failed' | 'live_execution' | 'paused' | 'unknown_facts' | 'obligation_indexed';
|
|
432
|
+
export interface FollowUpProjection {
|
|
433
|
+
readonly owner: FollowUpOwner;
|
|
434
|
+
readonly inCurrentList: boolean;
|
|
435
|
+
readonly reason: FollowUpReason;
|
|
436
|
+
}
|
|
437
|
+
export interface LifecycleDecision extends LifecycleCoreDecision {
|
|
438
|
+
readonly followUp: FollowUpProjection;
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* 责任判定:只读同一份生命周期结论 + 同一份权威事实,不引入第二套状态机。
|
|
442
|
+
* 缺事实一律 fail closed(留在当前列表、责任在 bot),不按文案推断承接或停止。
|
|
443
|
+
*/
|
|
444
|
+
export declare function decideFollowUp(decision: Pick<LifecycleCoreDecision, 'status' | 'needsYouReason'>, facts?: LifecycleFacts, ownership?: ExecutionOwnership): FollowUpProjection;
|
|
445
|
+
/**
|
|
446
|
+
* 公开唯一出口:先取既有生命周期结论,再补同一份事实算出的跟进责任(ADR 110)。
|
|
447
|
+
* 适配器只读 `followUp`,不得按 `status` 自行再判一次列表归属与责任人。
|
|
448
|
+
*/
|
|
449
|
+
export declare function decideLifecycle(snapshot: GoalPlanProjectionSnapshot, facts?: LifecycleFacts): LifecycleDecision;
|
|
360
450
|
/** Conversation → 无计划讨论态(工作台动线 §15)。 */
|
|
361
451
|
/**
|
|
362
452
|
* 会话是否对首页「正在讨论」可见(未读)。
|
|
@@ -420,3 +510,4 @@ export declare function areTaskOverviewItemsEqual(current: TaskOverviewItem, nex
|
|
|
420
510
|
* 首页无 conversationId,只能整表重拉;复用后单路进度不会拖垮其余卡。
|
|
421
511
|
*/
|
|
422
512
|
export declare function reuseUnchangedTaskOverviewItems(current: readonly TaskOverviewItem[], next: readonly TaskOverviewItem[]): TaskOverviewItem[];
|
|
513
|
+
export {};
|