@evandu/super-pi 0.1.219 → 0.1.220
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/client/.super-pi-client-sources.json +6 -6
- package/dist/client/assets/{CodeMirrorEditor-BoRBaVec.js → CodeMirrorEditor-DLESYIdU.js} +2 -2
- package/dist/client/assets/{dist-CiRgPe6t.js → dist-2Gv721yB.js} +1 -1
- package/dist/client/assets/{dist-Cp3XgqJR.js → dist-B-63MNT9.js} +1 -1
- package/dist/client/assets/{dist-CYpk6fXT.js → dist-B-ydE4PJ.js} +1 -1
- package/dist/client/assets/{dist-Digy2Mj0.js → dist-B6UYFWUo.js} +1 -1
- package/dist/client/assets/{dist-CMdO3YzL.js → dist-BG1xVEUu.js} +1 -1
- package/dist/client/assets/{dist-Dwsqs8C-.js → dist-BTUuXAFG.js} +1 -1
- package/dist/client/assets/{dist-mAA5Fw0-.js → dist-Bz37bm03.js} +1 -1
- package/dist/client/assets/{dist-BXOV_xtI.js → dist-CQAWuaHA.js} +1 -1
- package/dist/client/assets/{dist-DvWgfLRt.js → dist-CYEoLBJJ.js} +1 -1
- package/dist/client/assets/{dist-DUbHNa35.js → dist-CbixgvA8.js} +1 -1
- package/dist/client/assets/{dist-BOC9yjsN.js → dist-CoC8iHD1.js} +1 -1
- package/dist/client/assets/{dist-gRtmlyhZ.js → dist-CrtcsyOg.js} +1 -1
- package/dist/client/assets/{dist-xb23AFcT.js → dist-D0Mff5_O.js} +1 -1
- package/dist/client/assets/{dist-Bh20DSAa.js → dist-DKRxalqK.js} +1 -1
- package/dist/client/assets/{dist-DQ_C0DEU.js → dist-DPvgTEV_.js} +1 -1
- package/dist/client/assets/{dist-CPjKkcyd.js → dist-DhCNXN4F.js} +1 -1
- package/dist/client/assets/{dist-DLYLxwOe.js → dist-DmraLEb2.js} +1 -1
- package/dist/client/assets/{dist-D1hdxSH6.js → dist-DvJTvgiN.js} +1 -1
- package/dist/client/assets/{dist-CjhpwEGf.js → dist-YSB8UKj7.js} +1 -1
- package/dist/client/assets/{dist-BVVJTFYw.js → dist-aDKso4tk.js} +1 -1
- package/dist/client/assets/{dist-BOF4T7jI.js → dist-h8QFV1py.js} +1 -1
- package/dist/client/assets/{dist-CIv6vCdn.js → dist-hyn4QSU9.js} +1 -1
- package/dist/client/assets/index-B-h_KnC5.css +1 -0
- package/dist/client/assets/{index-DmxXnVfN.js → index-BMuvJCSx.js} +11 -11
- package/dist/client/index.html +2 -2
- package/dist/server/application/project-service.d.ts +45 -1
- package/dist/server/application/project-service.js +91 -2
- package/dist/server/application/run-service.d.ts +3 -1
- package/dist/server/application/run-service.js +20 -5
- package/dist/server/application/session-orchestrator-service.d.ts +62 -0
- package/dist/server/application/session-orchestrator-service.js +122 -1
- package/dist/server/application/session-reminder-service.js +1 -2
- package/dist/server/runtime.js +2 -2
- package/dist/server/store.d.ts +10 -3
- package/dist/server/store.js +46 -20
- package/dist/server/types.d.ts +7 -0
- package/dist/shared/project-overview.d.ts +12 -0
- package/dist/shared/project-overview.js +15 -0
- package/dist/shared/session-reporting.d.ts +32 -0
- package/dist/shared/session-reporting.js +29 -0
- package/package.json +5 -1
- package/dist/client/assets/index-Nu--gcBs.css +0 -1
package/dist/server/store.js
CHANGED
|
@@ -826,8 +826,10 @@ export class Store {
|
|
|
826
826
|
if (!conversation)
|
|
827
827
|
return undefined;
|
|
828
828
|
const clone = structuredClone(conversation);
|
|
829
|
-
|
|
829
|
+
const escalationAudience = this.openEscalationAudiences().get(conversation.id);
|
|
830
|
+
if (escalationAudience) {
|
|
830
831
|
clone.hasOpenEscalation = true;
|
|
832
|
+
clone.escalationAudience = escalationAudience;
|
|
831
833
|
}
|
|
832
834
|
if (this.pendingResultConversationIds().has(conversation.id)) {
|
|
833
835
|
clone.hasPendingResult = true;
|
|
@@ -869,15 +871,28 @@ export class Store {
|
|
|
869
871
|
project(projectId) { const project = this.state.projects?.find((item) => item.id === projectId); return project ? structuredClone(project) : undefined; }
|
|
870
872
|
/** Conversation IDs that currently have an unresolved escalation requested. */
|
|
871
873
|
openEscalationConversationIds() {
|
|
872
|
-
|
|
874
|
+
return new Set(this.openEscalationAudiences().keys());
|
|
875
|
+
}
|
|
876
|
+
/**
|
|
877
|
+
* 每条未决例外该谁拍板,按发起会话归拢。
|
|
878
|
+
*
|
|
879
|
+
* `supervisor` = 团队内部的事(会话在等自己的直属上级),`boss` = 到了顶层。
|
|
880
|
+
* 一个会话同时开着内部和顶层两条时,顶层那条赢:那是唯一需要用户听见的一条。
|
|
881
|
+
* 老记录没有 `audience`,按 `boss` 读 —— 宁可多让用户看见一次,也不要把该用户决定的事藏起来。
|
|
882
|
+
*/
|
|
883
|
+
openEscalationAudiences() {
|
|
884
|
+
const audiences = new Map();
|
|
873
885
|
for (const project of this.state.projects ?? []) {
|
|
874
886
|
for (const e of project.escalations ?? []) {
|
|
875
887
|
if ((e.status === "open" || e.status === "pending") && e.requestedByConversationId) {
|
|
876
|
-
|
|
888
|
+
const audience = e.audience ?? "boss";
|
|
889
|
+
if (audiences.get(e.requestedByConversationId) !== "boss") {
|
|
890
|
+
audiences.set(e.requestedByConversationId, audience);
|
|
891
|
+
}
|
|
877
892
|
}
|
|
878
893
|
}
|
|
879
894
|
}
|
|
880
|
-
return
|
|
895
|
+
return audiences;
|
|
881
896
|
}
|
|
882
897
|
/** Child conversation IDs whose enqueued session result is still waiting or sending on a non-archived parent. */
|
|
883
898
|
pendingResultConversationIds() {
|
|
@@ -886,7 +901,7 @@ export class Store {
|
|
|
886
901
|
if (parent.archivedAt)
|
|
887
902
|
continue;
|
|
888
903
|
for (const message of parent.messages) {
|
|
889
|
-
if (message.role !== "tool" || !message.delivery)
|
|
904
|
+
if (message.role !== "tool" || !message.delivery || message.source === "session-reminder")
|
|
890
905
|
continue;
|
|
891
906
|
const tagMatch = /^<task\b([^>]*)>/.exec(message.content);
|
|
892
907
|
if (!tagMatch)
|
|
@@ -932,16 +947,16 @@ export class Store {
|
|
|
932
947
|
}
|
|
933
948
|
/** Clone only one workspace's transcripts, never unrelated workspaces or app state. */
|
|
934
949
|
conversationsForWorkspace(workspaceId) {
|
|
935
|
-
const openEscalations = this.
|
|
950
|
+
const openEscalations = this.openEscalationAudiences();
|
|
936
951
|
const pendingResults = this.pendingResultConversationIds();
|
|
937
952
|
return structuredClone(this.state.conversations.filter((item) => item.workspaceId === workspaceId && !item.warmSession)).map((c) => {
|
|
938
|
-
const
|
|
953
|
+
const escalationAudience = openEscalations.get(c.id);
|
|
939
954
|
const hasPendingResult = pendingResults.has(c.id);
|
|
940
|
-
if (!
|
|
955
|
+
if (!escalationAudience && !hasPendingResult)
|
|
941
956
|
return c;
|
|
942
957
|
return {
|
|
943
958
|
...c,
|
|
944
|
-
...(
|
|
959
|
+
...(escalationAudience ? { hasOpenEscalation: true, escalationAudience } : {}),
|
|
945
960
|
...(hasPendingResult ? { hasPendingResult: true } : {}),
|
|
946
961
|
};
|
|
947
962
|
});
|
|
@@ -1213,7 +1228,7 @@ export class Store {
|
|
|
1213
1228
|
const visible = this.state.conversations.filter((item) => !closed.has(item.workspaceId) && !item.warmSession);
|
|
1214
1229
|
const warmSessions = workspaces.flatMap((workspace) => this.listWarmSessions(workspace.id));
|
|
1215
1230
|
const presets = warmSessions.length ? { warmSessions } : {};
|
|
1216
|
-
const openEscalations = this.
|
|
1231
|
+
const openEscalations = this.openEscalationAudiences();
|
|
1217
1232
|
const pendingResults = this.pendingResultConversationIds();
|
|
1218
1233
|
// Legacy sockets still receive complete visible transcripts. Project before cloning so a closed
|
|
1219
1234
|
// workspace's retained history is never copied just to discard it afterwards.
|
|
@@ -1223,13 +1238,13 @@ export class Store {
|
|
|
1223
1238
|
...presets,
|
|
1224
1239
|
workspaces,
|
|
1225
1240
|
conversations: visible.map((c) => {
|
|
1226
|
-
const
|
|
1241
|
+
const escalationAudience = openEscalations.get(c.id);
|
|
1227
1242
|
const hasPendingResult = pendingResults.has(c.id);
|
|
1228
|
-
if (!
|
|
1243
|
+
if (!escalationAudience && !hasPendingResult)
|
|
1229
1244
|
return c;
|
|
1230
1245
|
return {
|
|
1231
1246
|
...c,
|
|
1232
|
-
...(
|
|
1247
|
+
...(escalationAudience ? { hasOpenEscalation: true, escalationAudience } : {}),
|
|
1233
1248
|
...(hasPendingResult ? { hasPendingResult: true } : {}),
|
|
1234
1249
|
};
|
|
1235
1250
|
}),
|
|
@@ -1241,7 +1256,9 @@ export class Store {
|
|
|
1241
1256
|
const selectedId = visible.find((item) => item.id === scope.conversationId)?.id;
|
|
1242
1257
|
const conversations = visible.map(({ messages, ...metadata }) => ({
|
|
1243
1258
|
...metadata,
|
|
1244
|
-
...(openEscalations.has(metadata.id)
|
|
1259
|
+
...(openEscalations.has(metadata.id)
|
|
1260
|
+
? { hasOpenEscalation: true, escalationAudience: openEscalations.get(metadata.id) }
|
|
1261
|
+
: {}),
|
|
1245
1262
|
...(pendingResults.has(metadata.id) ? { hasPendingResult: true } : {}),
|
|
1246
1263
|
messages: metadata.id === selectedId ? messages : [],
|
|
1247
1264
|
messagesLoaded: metadata.id === selectedId,
|
|
@@ -1810,10 +1827,15 @@ export class Store {
|
|
|
1810
1827
|
if (conversation.archivedAt)
|
|
1811
1828
|
throw new Error("无法向已归档的会话下发指令,请先恢复该会话");
|
|
1812
1829
|
const message = { id: id("message"), role: "tool", content, createdAt: now() };
|
|
1830
|
+
if (options?.source)
|
|
1831
|
+
message.source = options.source;
|
|
1813
1832
|
if (options?.delivery)
|
|
1814
1833
|
message.delivery = options.delivery;
|
|
1815
1834
|
conversation.messages.push(message);
|
|
1816
|
-
|
|
1835
|
+
if (message.source === "session-reminder" && !message.delivery)
|
|
1836
|
+
await this.persistIncomingTurn(conversation, message);
|
|
1837
|
+
else
|
|
1838
|
+
await this.persistMessages(conversation);
|
|
1817
1839
|
return structuredClone(message);
|
|
1818
1840
|
}
|
|
1819
1841
|
async addUserMessage(conversationId, content, images, attachments, options) {
|
|
@@ -1833,10 +1855,13 @@ export class Store {
|
|
|
1833
1855
|
conversation.messages.push(message);
|
|
1834
1856
|
// Persisted as a transcript change and nothing more: this is the honest record of "the user said this
|
|
1835
1857
|
// and nothing has picked it up yet", and a refresh has to show it in the same place it was sent from.
|
|
1836
|
-
if (message.delivery)
|
|
1858
|
+
if (message.delivery)
|
|
1837
1859
|
await this.persistMessages(conversation);
|
|
1838
|
-
|
|
1839
|
-
|
|
1860
|
+
else
|
|
1861
|
+
await this.persistIncomingTurn(conversation, message);
|
|
1862
|
+
return structuredClone(message);
|
|
1863
|
+
}
|
|
1864
|
+
async persistIncomingTurn(conversation, message) {
|
|
1840
1865
|
const firstUser = conversation.messages.find((item) => item.role === "user");
|
|
1841
1866
|
const autoTitle = firstUser?.content.trim()
|
|
1842
1867
|
? firstUser.content.slice(0, 42)
|
|
@@ -1871,8 +1896,7 @@ export class Store {
|
|
|
1871
1896
|
// changed, and the repository has an incremental path for each. The base snapshot every other
|
|
1872
1897
|
// conversation lives in is untouched by this call, so rewriting it buys nothing.
|
|
1873
1898
|
await this.persistMessages(conversation);
|
|
1874
|
-
await this.persistMetadata(
|
|
1875
|
-
return structuredClone(message);
|
|
1899
|
+
await this.persistMetadata(conversation.id);
|
|
1876
1900
|
}
|
|
1877
1901
|
/**
|
|
1878
1902
|
* Takes the browser's id for its own optimistic message, when it is safe to.
|
|
@@ -2617,6 +2641,8 @@ export class Store {
|
|
|
2617
2641
|
if (!trimmed)
|
|
2618
2642
|
throw new Error("消息不能为空");
|
|
2619
2643
|
const { conversation, message } = this.requireWaitingMessage(conversationId, messageId);
|
|
2644
|
+
if (message.source === "session-reminder")
|
|
2645
|
+
throw new Error("Agent 的定时提醒不能改字");
|
|
2620
2646
|
if (message.role === "tool")
|
|
2621
2647
|
throw new Error("后台任务结果不能改字");
|
|
2622
2648
|
if (message.delivery !== "waiting")
|
package/dist/server/types.d.ts
CHANGED
|
@@ -112,6 +112,7 @@ export type ToolCallQuestion = {
|
|
|
112
112
|
export type Message = {
|
|
113
113
|
id: string;
|
|
114
114
|
role: MessageRole;
|
|
115
|
+
source?: "session-reminder";
|
|
115
116
|
content: string;
|
|
116
117
|
createdAt: string;
|
|
117
118
|
piEntryId?: string;
|
|
@@ -595,6 +596,12 @@ export type Conversation = {
|
|
|
595
596
|
reportedToParentAt?: string;
|
|
596
597
|
/** 该会话是否存在未决的例外升级(等待上级处理)。 */
|
|
597
598
|
hasOpenEscalation?: boolean;
|
|
599
|
+
/**
|
|
600
|
+
* 这条未决例外该谁拍板:`supervisor` = 团队内部(直属上级),`boss` = 到了顶层。
|
|
601
|
+
* 与 `hasOpenEscalation` 一样是只读投影,不落盘;客户端靠它区分「内部升级」和
|
|
602
|
+
* 「真的需要用户决定的事」——只有后者才配出现在用户面前。
|
|
603
|
+
*/
|
|
604
|
+
escalationAudience?: "supervisor" | "boss";
|
|
598
605
|
/** Read-only projection: whether this child session still has an undelivered result in its parent's waiting queue. */
|
|
599
606
|
hasPendingResult?: boolean;
|
|
600
607
|
/**
|
|
@@ -39,6 +39,18 @@ export type OverviewProject = {
|
|
|
39
39
|
};
|
|
40
40
|
/** Internal coordination is not a request for the user's attention. */
|
|
41
41
|
export declare function userProjectDecisions(project: OverviewProject): OverviewDecision[];
|
|
42
|
+
/**
|
|
43
|
+
* HOW MANY PROJECTS NEED THE USER - counted by project, not by case.
|
|
44
|
+
*
|
|
45
|
+
* The notice above the project tab says "N projects need you to decide". One project with two
|
|
46
|
+
* open boss-level cases is still ONE project to decide about, and a notice that says "2 projects"
|
|
47
|
+
* above a list that shows one is simply wrong. The count therefore goes over the PROJECTS that
|
|
48
|
+
* have at least one such case, and the cases themselves are counted separately.
|
|
49
|
+
*/
|
|
50
|
+
export declare function projectsNeedingUserDecision(projects: OverviewProject[]): {
|
|
51
|
+
projects: number;
|
|
52
|
+
cases: number;
|
|
53
|
+
};
|
|
42
54
|
export declare function ownerProjectReports(project: OverviewProject): OverviewReport[];
|
|
43
55
|
export declare function latestProjectDelivery<T extends OverviewReport>(project: {
|
|
44
56
|
ownerConversationId?: string;
|
|
@@ -2,6 +2,21 @@
|
|
|
2
2
|
export function userProjectDecisions(project) {
|
|
3
3
|
return (project.escalations ?? []).filter(item => item.status === "open" && (item.audience === "boss" || item.audience === undefined));
|
|
4
4
|
}
|
|
5
|
+
/**
|
|
6
|
+
* HOW MANY PROJECTS NEED THE USER - counted by project, not by case.
|
|
7
|
+
*
|
|
8
|
+
* The notice above the project tab says "N projects need you to decide". One project with two
|
|
9
|
+
* open boss-level cases is still ONE project to decide about, and a notice that says "2 projects"
|
|
10
|
+
* above a list that shows one is simply wrong. The count therefore goes over the PROJECTS that
|
|
11
|
+
* have at least one such case, and the cases themselves are counted separately.
|
|
12
|
+
*/
|
|
13
|
+
export function projectsNeedingUserDecision(projects) {
|
|
14
|
+
const withCases = projects.filter(project => userProjectDecisions(project).length > 0);
|
|
15
|
+
return {
|
|
16
|
+
projects: withCases.length,
|
|
17
|
+
cases: withCases.reduce((sum, project) => sum + userProjectDecisions(project).length, 0),
|
|
18
|
+
};
|
|
19
|
+
}
|
|
5
20
|
export function ownerProjectReports(project) {
|
|
6
21
|
return (project.reports ?? []).filter(report => !report.taskId && ["progress", "delivery"].includes(report.kind ?? "")
|
|
7
22
|
&& (report.authorConversationId === project.ownerConversationId && Boolean(project.ownerConversationId)
|
|
@@ -7,7 +7,21 @@ export type SessionReportingSnapshot = {
|
|
|
7
7
|
archivedAt?: string;
|
|
8
8
|
hasOpenEscalation?: boolean;
|
|
9
9
|
hasPendingResult?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* 谁来拍板这条未决例外:`supervisor` = 团队内部(直属上级),`boss` = 到了顶层。
|
|
12
|
+
* 缺席 = 老记录,按 `boss` 读(保守读法:可能需要用户的事,先给用户看)。
|
|
13
|
+
*/
|
|
14
|
+
escalationAudience?: EscalationAudience;
|
|
10
15
|
};
|
|
16
|
+
/** 这条未决例外该谁拍板。 */
|
|
17
|
+
export type EscalationAudience = "supervisor" | "boss";
|
|
18
|
+
/**
|
|
19
|
+
* 从会话载荷上读出例外的 audience。
|
|
20
|
+
*
|
|
21
|
+
* 客户端的会话类型是自己的一份镜像(`src/client/types.ts`),不在本次改动的文件清单里,
|
|
22
|
+
* 所以这个字段不通过类型系统读,而是只从这里这一个门口读一次。
|
|
23
|
+
*/
|
|
24
|
+
export declare function escalationAudienceOf(conversation: unknown): EscalationAudience | undefined;
|
|
11
25
|
export type ReportingAxisState = "pending_report" | "awaiting_subordinates" | "awaiting_decision" | "unread";
|
|
12
26
|
export declare function deriveReportingState(params: {
|
|
13
27
|
conversation: SessionReportingSnapshot;
|
|
@@ -15,6 +29,24 @@ export declare function deriveReportingState(params: {
|
|
|
15
29
|
directChildren: SessionReportingSnapshot[];
|
|
16
30
|
isTopLevelUnread?: boolean;
|
|
17
31
|
}): ReportingAxisState | null;
|
|
32
|
+
/**
|
|
33
|
+
* 给用户看的那一套推导:内部升级不算「等上面拍板」。
|
|
34
|
+
*
|
|
35
|
+
* `deriveReportingState` 说的是这个会话在汇报线上的位置,那条内部规则(自己有待拍板的例外)
|
|
36
|
+
* 对团队内部是对的 —— 但它被原样搬到用户面前时读作「用户被叫来开会了」,而用户根本不在那场
|
|
37
|
+
* 会里。所以用户这一侧单独走这一个出口:`audience` 是 `supervisor` 的未决例外不参与
|
|
38
|
+
* `awaiting_decision` 的判定,于是这个会话显示它真正在做的事(运行中就显示运行中),
|
|
39
|
+
* 而不是被一条内部升级盖住。
|
|
40
|
+
*
|
|
41
|
+
* 判据本体在 `deriveReportingState` 里没有动:服务端的推导(项目面板的会话行)走的是那一条,
|
|
42
|
+
* 客户端走的是这一条,两边各有一套派生,谁也不用为了另一边的语义让步。
|
|
43
|
+
*/
|
|
44
|
+
export declare function deriveUserReportingState(params: {
|
|
45
|
+
conversation: SessionReportingSnapshot;
|
|
46
|
+
parent?: ChildSessionRow;
|
|
47
|
+
directChildren: SessionReportingSnapshot[];
|
|
48
|
+
isTopLevelUnread?: boolean;
|
|
49
|
+
}): ReportingAxisState | null;
|
|
18
50
|
export type SessionDisplayState = "waiting" | "running" | "failed" | "question" | "completed" | "unread" | "idle" | "awaiting_background" | "pending_report" | "awaiting_subordinates" | "awaiting_decision";
|
|
19
51
|
export declare const SESSION_STATE_WORD: Record<string, string>;
|
|
20
52
|
export declare function sessionStateWord(state: string | undefined): string;
|
|
@@ -8,6 +8,16 @@
|
|
|
8
8
|
//
|
|
9
9
|
// 规则在 `docs/DESIGN-PRINCIPLES.md` 第二节「汇报线逐级转述:Boss 只有一个联络线」。
|
|
10
10
|
import { isChildSession } from "./child-session-lock.js";
|
|
11
|
+
/**
|
|
12
|
+
* 从会话载荷上读出例外的 audience。
|
|
13
|
+
*
|
|
14
|
+
* 客户端的会话类型是自己的一份镜像(`src/client/types.ts`),不在本次改动的文件清单里,
|
|
15
|
+
* 所以这个字段不通过类型系统读,而是只从这里这一个门口读一次。
|
|
16
|
+
*/
|
|
17
|
+
export function escalationAudienceOf(conversation) {
|
|
18
|
+
const value = conversation?.escalationAudience;
|
|
19
|
+
return value === "supervisor" || value === "boss" ? value : undefined;
|
|
20
|
+
}
|
|
11
21
|
export function deriveReportingState(params) {
|
|
12
22
|
const { conversation, parent, directChildren, isTopLevelUnread = false } = params;
|
|
13
23
|
// 1. 如果自己有未决的升级例外:等上面拍板
|
|
@@ -41,6 +51,25 @@ export function deriveReportingState(params) {
|
|
|
41
51
|
}
|
|
42
52
|
return null;
|
|
43
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* 给用户看的那一套推导:内部升级不算「等上面拍板」。
|
|
56
|
+
*
|
|
57
|
+
* `deriveReportingState` 说的是这个会话在汇报线上的位置,那条内部规则(自己有待拍板的例外)
|
|
58
|
+
* 对团队内部是对的 —— 但它被原样搬到用户面前时读作「用户被叫来开会了」,而用户根本不在那场
|
|
59
|
+
* 会里。所以用户这一侧单独走这一个出口:`audience` 是 `supervisor` 的未决例外不参与
|
|
60
|
+
* `awaiting_decision` 的判定,于是这个会话显示它真正在做的事(运行中就显示运行中),
|
|
61
|
+
* 而不是被一条内部升级盖住。
|
|
62
|
+
*
|
|
63
|
+
* 判据本体在 `deriveReportingState` 里没有动:服务端的推导(项目面板的会话行)走的是那一条,
|
|
64
|
+
* 客户端走的是这一条,两边各有一套派生,谁也不用为了另一边的语义让步。
|
|
65
|
+
*/
|
|
66
|
+
export function deriveUserReportingState(params) {
|
|
67
|
+
const { conversation, ...rest } = params;
|
|
68
|
+
if (escalationAudienceOf(conversation) !== "supervisor") {
|
|
69
|
+
return deriveReportingState({ conversation, ...rest });
|
|
70
|
+
}
|
|
71
|
+
return deriveReportingState({ ...rest, conversation: { ...conversation, hasOpenEscalation: false } });
|
|
72
|
+
}
|
|
44
73
|
export const SESSION_STATE_WORD = {
|
|
45
74
|
waiting: "等待 LLM",
|
|
46
75
|
running: "进行中",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@evandu/super-pi",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.220",
|
|
4
4
|
"description": "Web control plane and companion for Pi",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -101,6 +101,7 @@
|
|
|
101
101
|
"scripts/session-orchestrator-auth.test.mjs",
|
|
102
102
|
"scripts/session-result-callback.test.mjs",
|
|
103
103
|
"scripts/session-result-callback-e2e.test.mjs",
|
|
104
|
+
"scripts/child-completion-wakes-parent.test.mjs",
|
|
104
105
|
"scripts/session-orchestrator-tools.test.mjs",
|
|
105
106
|
"scripts/project-service.test.mjs",
|
|
106
107
|
"scripts/project-ceremony-free.test.mjs",
|
|
@@ -111,6 +112,7 @@
|
|
|
111
112
|
"scripts/project-report-decision-layout.test.mjs",
|
|
112
113
|
"scripts/project-api-scope.test.mjs",
|
|
113
114
|
"scripts/project-report-chain.test.mjs",
|
|
115
|
+
"scripts/supervisor-message-resolves-escalation.test.mjs",
|
|
114
116
|
"scripts/project-tool-surface-parity.test.mjs",
|
|
115
117
|
"scripts/tool-surface-parity-all.test.mjs",
|
|
116
118
|
"scripts/session-tree-collapse.test.mjs",
|
|
@@ -280,6 +282,7 @@
|
|
|
280
282
|
"scripts/session-reporting.test.mjs",
|
|
281
283
|
"scripts/project-panel-reporting.test.mjs",
|
|
282
284
|
"scripts/session-row-escalation.test.mjs",
|
|
285
|
+
"scripts/team-level-notification.test.mjs",
|
|
283
286
|
"scripts/mutation-lock-coverage.test.mjs",
|
|
284
287
|
"scripts/real-context-window.test.mjs",
|
|
285
288
|
"scripts/session-reminder-pmo-rights.test.mjs"
|
|
@@ -335,6 +338,7 @@
|
|
|
335
338
|
"scripts/builtin-agents-project-browser.test.mjs",
|
|
336
339
|
"scripts/tool-runtime-browser.test.mjs",
|
|
337
340
|
"scripts/session-context-menu-browser.test.mjs",
|
|
341
|
+
"scripts/session-reminder-browser.test.mjs",
|
|
338
342
|
"scripts/archive-cascade-browser.test.mjs",
|
|
339
343
|
"scripts/archive-restore-race-browser.test.mjs",
|
|
340
344
|
"scripts/tool-call-blocks-browser.test.mjs",
|