@evandu/super-pi 0.1.218 → 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/agents/project-leader.md +1 -1
- package/agents/super-pi-task/core.ts +1 -1
- package/agents/super-pi-task/index.ts +4 -2
- package/dist/client/.super-pi-client-sources.json +6 -6
- package/dist/client/assets/{CodeMirrorEditor-CyESWKhO.js → CodeMirrorEditor-DLESYIdU.js} +2 -2
- package/dist/client/assets/{dist-xAE0Sxu_.js → dist-2Gv721yB.js} +1 -1
- package/dist/client/assets/{dist-CWLwzCNI.js → dist-B-63MNT9.js} +1 -1
- package/dist/client/assets/{dist-BQ5yUYGI.js → dist-B-ydE4PJ.js} +1 -1
- package/dist/client/assets/{dist-BfAB10-T.js → dist-B6UYFWUo.js} +1 -1
- package/dist/client/assets/{dist-GMozZ-IZ.js → dist-BG1xVEUu.js} +1 -1
- package/dist/client/assets/{dist-C6tiomV0.js → dist-BTUuXAFG.js} +1 -1
- package/dist/client/assets/{dist-Zl8KoipB.js → dist-Bz37bm03.js} +1 -1
- package/dist/client/assets/{dist-BwQiVXeZ.js → dist-CQAWuaHA.js} +1 -1
- package/dist/client/assets/{dist-XNj0UVAT.js → dist-CYEoLBJJ.js} +1 -1
- package/dist/client/assets/{dist-CkjmcyTq.js → dist-CbixgvA8.js} +1 -1
- package/dist/client/assets/{dist-DHh4-Br1.js → dist-CoC8iHD1.js} +1 -1
- package/dist/client/assets/{dist-DtyV497P.js → dist-CrtcsyOg.js} +1 -1
- package/dist/client/assets/{dist-BlALlifb.js → dist-D0Mff5_O.js} +1 -1
- package/dist/client/assets/{dist-BXMYNRiG.js → dist-DKRxalqK.js} +1 -1
- package/dist/client/assets/{dist-Cgclz1Km.js → dist-DPvgTEV_.js} +1 -1
- package/dist/client/assets/{dist-C9qNY2Kp.js → dist-DhCNXN4F.js} +1 -1
- package/dist/client/assets/{dist-BXq9HMCd.js → dist-DmraLEb2.js} +1 -1
- package/dist/client/assets/{dist-B33BwR-8.js → dist-DvJTvgiN.js} +1 -1
- package/dist/client/assets/{dist-C7y8W3IU.js → dist-YSB8UKj7.js} +1 -1
- package/dist/client/assets/{dist-1djw1Aua.js → dist-aDKso4tk.js} +1 -1
- package/dist/client/assets/{dist-DH6F4kKv.js → dist-h8QFV1py.js} +1 -1
- package/dist/client/assets/{dist-DZGY_CNU.js → dist-hyn4QSU9.js} +1 -1
- package/dist/client/assets/index-B-h_KnC5.css +1 -0
- package/dist/client/assets/{index-2k9h0zMt.js → index-BMuvJCSx.js} +11 -11
- package/dist/client/index.html +2 -2
- package/dist/server/application/conversation-service.d.ts +7 -2
- package/dist/server/application/conversation-service.js +45 -5
- package/dist/server/application/project-service.d.ts +53 -5
- package/dist/server/application/project-service.js +167 -36
- package/dist/server/application/run-service.d.ts +3 -1
- package/dist/server/application/run-service.js +22 -5
- package/dist/server/application/session-orchestrator-service.d.ts +65 -0
- package/dist/server/application/session-orchestrator-service.js +175 -22
- package/dist/server/application/session-reminder-service.js +1 -2
- package/dist/server/command-handler.d.ts +3 -1
- package/dist/server/command-handler.js +21 -1
- package/dist/server/index.js +2 -2
- package/dist/server/runtime.js +2 -2
- package/dist/server/store.d.ts +17 -4
- package/dist/server/store.js +93 -28
- package/dist/server/types.d.ts +24 -1
- package/dist/server/upload.d.ts +2 -0
- package/dist/server/upload.js +19 -2
- package/dist/shared/project-overview.d.ts +21 -0
- package/dist/shared/project-overview.js +36 -7
- package/dist/shared/project-presentation.d.ts +3 -0
- package/dist/shared/project-presentation.js +13 -5
- package/dist/shared/session-reporting.d.ts +32 -0
- package/dist/shared/session-reporting.js +29 -0
- package/dist/shared/team-context.d.ts +1 -1
- package/package.json +5 -1
- package/dist/client/assets/index-CwfAN5Vw.css +0 -1
package/dist/client/index.html
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
<link rel="alternate icon" href="/favicon.ico" />
|
|
9
9
|
<link rel="apple-touch-icon" href="/favicon.svg" />
|
|
10
10
|
<title>Super Pi</title>
|
|
11
|
-
<script type="module" crossorigin src="/assets/index-
|
|
12
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
11
|
+
<script type="module" crossorigin src="/assets/index-BMuvJCSx.js"></script>
|
|
12
|
+
<link rel="stylesheet" crossorigin href="/assets/index-B-h_KnC5.css">
|
|
13
13
|
</head>
|
|
14
14
|
<body>
|
|
15
15
|
<div id="root"></div>
|
|
@@ -38,14 +38,16 @@ export declare class ConversationService {
|
|
|
38
38
|
private readonly runService;
|
|
39
39
|
private readonly extensionUiService;
|
|
40
40
|
private agentsDir;
|
|
41
|
+
private readonly uploadsDir?;
|
|
41
42
|
/** Conversations whose Pi transcript is being cut RIGHT NOW. Read by the send path, below. */
|
|
42
43
|
private readonly reverting;
|
|
43
44
|
/** Reverts for one conversation must never truncate the same Pi file concurrently. */
|
|
44
45
|
private readonly revertOps;
|
|
45
46
|
/** The memory store, so a revert can undo what that conversation taught it. Set by `setMemory`. */
|
|
46
47
|
private memory?;
|
|
47
|
-
constructor(store: Store, runtime: AgentRuntime, subagents: SubagentRunRecorder, broadcaster: EventBroadcaster, catalogService: CatalogService, runService: RunService, extensionUiService: ExtensionUiService, agentsDir: string | string[]);
|
|
48
|
+
constructor(store: Store, runtime: AgentRuntime, subagents: SubagentRunRecorder, broadcaster: EventBroadcaster, catalogService: CatalogService, runService: RunService, extensionUiService: ExtensionUiService, agentsDir: string | string[], uploadsDir?: string | undefined);
|
|
48
49
|
setAgentsDir(dir: string | string[]): void;
|
|
50
|
+
isWarmSession(conversationId: string): boolean;
|
|
49
51
|
/**
|
|
50
52
|
* Creates a new conversation in a workspace.
|
|
51
53
|
*
|
|
@@ -203,7 +205,10 @@ export declare class ConversationService {
|
|
|
203
205
|
/**
|
|
204
206
|
* Forks an existing conversation into a new parallel branch, cloning the Pi session.
|
|
205
207
|
*/
|
|
206
|
-
forkConversation(conversationId: string
|
|
208
|
+
forkConversation(conversationId: string, options?: {
|
|
209
|
+
parentConversationId?: string;
|
|
210
|
+
warmTitle?: string;
|
|
211
|
+
}): Promise<ForkConversationResult>;
|
|
207
212
|
/**
|
|
208
213
|
* Cancels pending UI/sub-agent work and clears active memory notes for a conversation about to
|
|
209
214
|
* be permanently destroyed (runs while the conversation is still readable in the store).
|
|
@@ -2,6 +2,8 @@ import { assertModelAllowed } from "../model-filter.js";
|
|
|
2
2
|
import { newConversationId } from "../store.js";
|
|
3
3
|
import { normalizeSessionCwd, resolveSessionCwd } from "../session-cwd.js";
|
|
4
4
|
import { isChildSession } from "../../shared/child-session-lock.js";
|
|
5
|
+
import { rm } from "node:fs/promises";
|
|
6
|
+
import { copyForkUploads, deleteConversationUploads } from "../upload.js";
|
|
5
7
|
function isMissingPrimaryAgent(error, agentId) {
|
|
6
8
|
const message = error instanceof Error ? error.message : String(error);
|
|
7
9
|
const id = JSON.stringify(agentId);
|
|
@@ -21,6 +23,7 @@ export class ConversationService {
|
|
|
21
23
|
runService;
|
|
22
24
|
extensionUiService;
|
|
23
25
|
agentsDir;
|
|
26
|
+
uploadsDir;
|
|
24
27
|
/** Conversations whose Pi transcript is being cut RIGHT NOW. Read by the send path, below. */
|
|
25
28
|
// This is a reference count rather than a Set. A revert is claimed at socket arrival and claimed a
|
|
26
29
|
// second time when the service starts the cut. More than one socket can also click revert before the
|
|
@@ -31,7 +34,7 @@ export class ConversationService {
|
|
|
31
34
|
revertOps = new Map();
|
|
32
35
|
/** The memory store, so a revert can undo what that conversation taught it. Set by `setMemory`. */
|
|
33
36
|
memory;
|
|
34
|
-
constructor(store, runtime, subagents, broadcaster, catalogService, runService, extensionUiService, agentsDir) {
|
|
37
|
+
constructor(store, runtime, subagents, broadcaster, catalogService, runService, extensionUiService, agentsDir, uploadsDir) {
|
|
35
38
|
this.store = store;
|
|
36
39
|
this.runtime = runtime;
|
|
37
40
|
this.subagents = subagents;
|
|
@@ -40,10 +43,14 @@ export class ConversationService {
|
|
|
40
43
|
this.runService = runService;
|
|
41
44
|
this.extensionUiService = extensionUiService;
|
|
42
45
|
this.agentsDir = agentsDir;
|
|
46
|
+
this.uploadsDir = uploadsDir;
|
|
43
47
|
}
|
|
44
48
|
setAgentsDir(dir) {
|
|
45
49
|
this.agentsDir = dir;
|
|
46
50
|
}
|
|
51
|
+
isWarmSession(conversationId) {
|
|
52
|
+
return this.store.isWarmSession(conversationId);
|
|
53
|
+
}
|
|
47
54
|
/**
|
|
48
55
|
* Creates a new conversation in a workspace.
|
|
49
56
|
*
|
|
@@ -513,28 +520,57 @@ export class ConversationService {
|
|
|
513
520
|
/**
|
|
514
521
|
* Forks an existing conversation into a new parallel branch, cloning the Pi session.
|
|
515
522
|
*/
|
|
516
|
-
async forkConversation(conversationId) {
|
|
523
|
+
async forkConversation(conversationId, options = {}) {
|
|
517
524
|
const conversation = this.store.conversation(conversationId);
|
|
518
525
|
if (!conversation) {
|
|
519
526
|
return { ok: false, message: "会话不存在" };
|
|
520
527
|
}
|
|
521
|
-
if (conversation.archivedAt) {
|
|
528
|
+
if (conversation.archivedAt && !(conversation.warmSession && options.parentConversationId && !options.warmTitle)) {
|
|
522
529
|
return { ok: false, message: "已归档的会话无法分叉,请先恢复会话" };
|
|
523
530
|
}
|
|
524
531
|
const workspace = this.store.workspaceForConversation(conversationId);
|
|
525
532
|
if (!workspace) {
|
|
526
533
|
return { ok: false, message: `会话所属的工作区 ${conversation.workspaceId} 已不存在,拒绝分叉` };
|
|
527
534
|
}
|
|
528
|
-
if (this.runService.isRunning(conversationId)) {
|
|
535
|
+
if (this.runService.isRunning(conversationId) || ["running", "waiting", "awaiting_background"].includes(conversation.status)) {
|
|
529
536
|
return { ok: false, message: "这个会话还有一轮任务在跑,等它结束(或先停止它)再分叉" };
|
|
530
537
|
}
|
|
531
538
|
if (!this.runtime.fork) {
|
|
532
539
|
return { ok: false, message: "当前运行时没有 Pi 会话,无法分叉(只能复制可见的历史)" };
|
|
533
540
|
}
|
|
541
|
+
let copiedFile;
|
|
542
|
+
let copiedUploads;
|
|
534
543
|
try {
|
|
544
|
+
const warmTitle = options.warmTitle?.trim();
|
|
545
|
+
if (options.warmTitle !== undefined && (!warmTitle || warmTitle.length > 100))
|
|
546
|
+
throw new Error("预热会话名称须为 1–100 个字符");
|
|
547
|
+
if (warmTitle && !conversation.messages.some((message) => message.role === "assistant" && !message.delivery)) {
|
|
548
|
+
throw new Error("预热会话需要已有的对话历史");
|
|
549
|
+
}
|
|
550
|
+
const parent = options.parentConversationId;
|
|
551
|
+
if (parent && !conversation.warmSession && parent !== conversation.parentConversationId)
|
|
552
|
+
throw new Error("只能从同一直属上级下的会话分叉");
|
|
535
553
|
const forkedId = newConversationId();
|
|
536
554
|
const outcome = await this.runtime.fork({ conversation, cwd: await resolveSessionCwd(workspace.path, conversation.cwd), forkedConversationId: forkedId });
|
|
537
|
-
|
|
555
|
+
copiedFile = outcome.sessionFile;
|
|
556
|
+
if ((parent || warmTitle) && conversation.messages.some((message) => !message.delivery) && !copiedFile) {
|
|
557
|
+
throw new Error("找不到来源会话的 Pi 记录,无法保留上下文分叉");
|
|
558
|
+
}
|
|
559
|
+
if (this.uploadsDir && (parent || warmTitle)) {
|
|
560
|
+
const images = conversation.messages.filter((message) => !message.delivery).flatMap((message) => message.images ?? []);
|
|
561
|
+
if (images.length) {
|
|
562
|
+
copiedUploads = forkedId;
|
|
563
|
+
await copyForkUploads(this.uploadsDir, conversationId, forkedId, images);
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
const latest = this.store.conversation(conversationId);
|
|
567
|
+
if (!latest || latest.updatedAt !== conversation.updatedAt || this.runService.isRunning(conversationId)
|
|
568
|
+
|| latest.archivedAt !== conversation.archivedAt || JSON.stringify(latest.messages) !== JSON.stringify(conversation.messages)) {
|
|
569
|
+
throw new Error("来源会话在复制时发生变化,请等当前操作结束后重试");
|
|
570
|
+
}
|
|
571
|
+
const forked = await this.store.forkConversation(conversationId, forkedId, { parentConversationId: parent, warmTitle, piSessionFile: copiedFile });
|
|
572
|
+
copiedFile = undefined;
|
|
573
|
+
copiedUploads = undefined;
|
|
538
574
|
console.log(`Super Pi: forked conversation ${conversation.id} into ${forked.id}: ` +
|
|
539
575
|
`${forked.messages.length} message(s) copied in state.json` +
|
|
540
576
|
`${outcome.sessionFile ? `, ${outcome.entriesCopied} Pi entry/entries copied to ${outcome.sessionFile}` : ", and this conversation had no Pi transcript to copy (no messages)"}.`);
|
|
@@ -548,6 +584,10 @@ export class ConversationService {
|
|
|
548
584
|
};
|
|
549
585
|
}
|
|
550
586
|
catch (error) {
|
|
587
|
+
if (copiedFile)
|
|
588
|
+
await rm(copiedFile, { force: true }).catch(() => { });
|
|
589
|
+
if (copiedUploads && this.uploadsDir)
|
|
590
|
+
await deleteConversationUploads(this.uploadsDir, copiedUploads);
|
|
551
591
|
const message = error instanceof Error ? error.message : `分叉失败:${String(error)}`;
|
|
552
592
|
return { ok: false, message };
|
|
553
593
|
}
|
|
@@ -19,8 +19,8 @@ import type { SessionOrchestratorService } from "./session-orchestrator-service.
|
|
|
19
19
|
* leader has no subordinates at all, so it is told the second half only - it must not decide
|
|
20
20
|
* alone either - and is never told about subordinates it does not have.
|
|
21
21
|
*/
|
|
22
|
-
export declare const STANDARD_LEADER_PROMPT = "\u4F60\u662F\u76F4\u63A5\u5411 Boss \u8D1F\u8D23\u7684\u9879\u76EE Leader\uFF0C\u8D1F\u8D23\u654F\u6377\u5F00\u53D1\u4E0E\u5C0F\u6B65\u4EA4\u4ED8\u3002\u7528\u6237\u662F\u9876\u5C42\u51B3\u7B56\u8005\uFF0C\u4F60\u81EA\u884C\u5904\u7406\u5185\u90E8\u534F\u8C03\uFF0C\u53EA\u5411\u7528\u6237\u6C47\u603B\u8FDB\u5C55\u3001\u6210\u679C\u4E0E\u5FC5\u8981\u51B3\u7B56\u3002\u5F00\u7BC7\u4E0A\u4E0B\u6587\u5DF2\u7ED9\u51FA\u9879\u76EE\u76EE\u6807\u3001\u6A21\u5F0F\u3001\u5206\u5DE5\u4E0E\u5F53\u524D\u4EFB\u52A1\u6E05\u5355\uFF0C\u4E0D\u5FC5\u5148\u8C03\u7528 project(action=get) \u5C31\u80FD\u76F4\u63A5\u62C6\u89E3\u3001\u6D3E\u6D3B\u6216\u63A8\u8FDB\u3002\u5C0F\u9879\u76EE\u53EA\u62C6\u6700\u5C11\u5FC5\u8981\u4EFB\u52A1\uFF0C\u5927\u9879\u76EE\u6309\u4EA4\u4ED8\u8FB9\u754C\u5206\u5DE5\u3002\u7528 add_task \u767B\u8BB0\u4EFB\u52A1\uFF08\u660E\u786E\u76EE\u6807\u3001\u4EA4\u4ED8\u7269\u3001\u9A8C\u6536\u6807\u51C6\u3001\u4F9D\u8D56\uFF09\uFF1Badd_task / update_task \u65F6\u53EF\u4EE5\u5E26 executorProfile \u4E0E reviewerProfile\uFF08\u652F\u6301\u6307\u5B9A agentId\u3001cwd\u3001model\u3001thinkingLevel\u3001watchdogTimeoutSeconds\uFF09\uFF0C\u6309\u4EFB\u52A1\u6027\u8D28\u5C06\u6267\u884C\u4E0E\u590D\u6838\u59D4\u6D3E\u7ED9\u6700\u5408\u9002\u7684\u5458\u5DE5\uFF0C\u4E0D\u6307\u5B9A\u5219\u7EE7\u627F\u9879\u76EE\u9ED8\u8BA4\uFF1B\u9700\u8981\u7EE7\u7EED\u62C6\u89E3\u7684\u5DE5\u4F5C\u8BBE role=leader\uFF0C\u53F6\u5B50\u6267\u884C\u4EFB\u52A1\u8BBE role=executor\uFF0C\u5B50 Leader \u7528 parentTaskId \u767B\u8BB0\u81EA\u5DF1\u7684\u5B50\u4EFB\u52A1\uFF0Cdispatch \u7ACB\u5373\u542F\u52A8\u6267\u884C\u5B50\u4F1A\u8BDD\uFF1B\u4E0D\u8981\u7528 session_spawn/session_dispatch \u6216 task/workflow \u7ED5\u5F00\u9879\u76EE\u5206\u5DE5\u4E0E\u6C47\u62A5\u7EBF\u3002\u6536\u5230\u4EA4\u4ED8\u540E\u7528 request_review \u542F\u52A8\u72EC\u7ACB\u590D\u6838\u3002\u6D3E\u53D1\u540E\u5B50\u4F1A\u8BDD\u4F1A\u7ACB\u5373\u5F00\u59CB\u6267\u884C\u5E76\u5728\u5B8C\u6210\u540E\u81EA\u52A8\u56DE\u62A5\u7ED9\u4F60\uFF0C\u5C4A\u65F6\u7EE7\u7EED\u6D3E\u53D1 ready \u4EFB\u52A1\u3001\u590D\u6838\u5F85\u9A8C\u6536\u4EFB\u52A1\u6216\u6309 review.summary \u8FD4\u5DE5\uFF1B\u4E0D\u8981\u8F6E\u8BE2\u7B49\u5F85\uFF0C\u4E0D\u8981\u53CD\u590D\u65E0\u8FDB\u5C55\u91CD\u8BD5\uFF0C\u7B49\u5F85\u56DE\u62A5\u65F6\u76F4\u63A5\u7ED3\u675F\u5F53\u524D\u56DE\u590D\u3002\u7528 report \u767B\u8BB0\u5173\u952E\u8FDB\u5C55\u3002\u4F60\u7684\u4E0B\u5C5E\u7684\u5347\u7EA7\u5148\u5230\u4F60\u8FD9\u91CC\uFF1A\u4F60\u5728\u81EA\u5DF1\u8FD9\u4E00\u5C42\u5904\u7406\uFF0C\u80FD\u81EA\u5DF1\u89E3\u51B3\u7684\u81EA\u5DF1\u89E3\u51B3\uFF1B\u53EA\u6709\u786E\u5B9E\u9700\u8981 Boss \u51B3\u7B56\u7684\uFF08\u91CD\u5927\u504F\u5DEE\u3001\u6743\u9650\u6216\u8303\u56F4\u53D8\u66F4\uFF09\u624D\u7528 escalate \u4EA4\u7ED9 Boss\u3002\u4F60\u4E0D\u80FD\u66FF Boss \u505A\u51B3\u5B9A\uFF0C\u4E5F\u4E0D\u8981\u628A\u6CA1\u5904\u7406\u7684\u5347\u7EA7\u538B\u4E0B\u53BB\u4E0D\u7406\u3002\u6240\u6709\u4EFB\u52A1\u9A8C\u6536\u540E\uFF0C\u7528
|
|
23
|
-
export declare const LIGHTWEIGHT_LEADER_PROMPT = "\u4F60\u662F\u76F4\u63A5\u5411 Boss \u8D1F\u8D23\u7684\u9879\u76EE Leader\uFF0C\u8FD9\u662F\u4E00\u4E2A\u8F7B\u91CF\u9879\u76EE\uFF1A\u8FD9\u4E2A\u9879\u76EE\u7531\u4F60\u4EB2\u81EA\u5B8C\u6210\uFF0C\u4E0D\u8981\u62C6\u5B50\u4EFB\u52A1\u3001\u4E0D\u8981\u6D3E\u53D1\u7ED9\u522B\u4EBA\u3001\u4E5F\u6CA1\u6709\u72EC\u7ACB\u590D\u6838\u3002\u5F00\u7BC7\u4E0A\u4E0B\u6587\u5DF2\u7ED9\u51FA\u9879\u76EE\u76EE\u6807\u3001\u6A21\u5F0F\u4E0E\u5F53\u524D\u4EFB\u52A1\u6E05\u5355\uFF0C\u4E0D\u5FC5\u5148\u8C03\u7528 project(action=get) \u5C31\u80FD\u76F4\u63A5\u52A8\u624B\u3002\u7528 add_task \u767B\u8BB0\u4EFB\u52A1\uFF08\u660E\u786E\u76EE\u6807\u3001\u4EA4\u4ED8\u7269\u3001\u9A8C\u6536\u6807\u51C6\u3001\u4F9D\u8D56\uFF09\uFF0C\u4EFB\u52A1\u4E00\u5F8B\u767B\u8BB0\u4E3A\u6267\u884C\u4EFB\u52A1\uFF1Arole=leader \u6216\u5E26 parentTaskId \u90FD\u4F1A\u88AB\u62D2\u7EDD\u3002dispatch \u4F1A\u628A\u4EFB\u52A1\u4EA4\u56DE\u7ED9\u4F60\u81EA\u5DF1\uFF0C\u4F60\u4EB2\u81EA\u505A\u5B8C\uFF1B\u505A\u5B8C\u540E\u8C03\u7528 project(action=submit, projectId, taskId, output, evidenceRefs) \u63D0\u4EA4\u4EA4\u4ED8\uFF0C\u63D0\u4EA4\u5373\u5B8C\u6210\uFF0C\u4E0D\u4F1A\u6709\u4EBA\u56DE\u6765\u590D\u6838\uFF0C\u8BC1\u636E\u5FC5\u987B\u9644\u4E0A\u3002\u4E0D\u8981\u7528 session_spawn/session_dispatch \u6216 task/workflow \u7ED5\u5F00\u9879\u76EE\u804C\u8D23\u4E0E\u6C47\u62A5\u7EBF\u3002\u4E0D\u8981\u8F6E\u8BE2\u7B49\u5F85\uFF0C\u4E0D\u8981\u53CD\u590D\u65E0\u8FDB\u5C55\u91CD\u8BD5\u3002\u7528 report \u6C47\u603B\u5173\u952E\u8FDB\u5C55\u3002\u666E\u901A\u6280\u672F\u51B3\u7B56\u3001\u963B\u585E\u4E0E\u8FD4\u5DE5\u7531\u4F60\u81EA\u884C\u5904\u7406\uFF1B\u53EA\u6709\u786E\u5B9E\u9700\u8981\u7528\u6237\u51B3\u5B9A\u7684\u76EE\u6807\u53D6\u820D\u3001\u6743\u9650\u6216\u5916\u90E8\u8D44\u6E90\u624D\u7528 escalate \u4EA4\u7ED9 Boss\uFF0C\u4E0D\u5F97\u66FF Boss \u51B3\u5B9A\u8FD9\u4E9B\u4E8B\u9879\u3002\u6240\u6709\u4EFB\u52A1\u4EA4\u4ED8\u540E\uFF0C\u7528
|
|
22
|
+
export declare const STANDARD_LEADER_PROMPT = "\u4F60\u662F\u76F4\u63A5\u5411 Boss \u8D1F\u8D23\u7684\u9879\u76EE Leader\uFF0C\u8D1F\u8D23\u654F\u6377\u5F00\u53D1\u4E0E\u5C0F\u6B65\u4EA4\u4ED8\u3002\u7528\u6237\u662F\u9876\u5C42\u51B3\u7B56\u8005\uFF0C\u4F60\u81EA\u884C\u5904\u7406\u5185\u90E8\u534F\u8C03\uFF0C\u53EA\u5411\u7528\u6237\u6C47\u603B\u8FDB\u5C55\u3001\u6210\u679C\u4E0E\u5FC5\u8981\u51B3\u7B56\u3002\u5F00\u7BC7\u4E0A\u4E0B\u6587\u5DF2\u7ED9\u51FA\u9879\u76EE\u76EE\u6807\u3001\u6A21\u5F0F\u3001\u5206\u5DE5\u4E0E\u5F53\u524D\u4EFB\u52A1\u6E05\u5355\uFF0C\u4E0D\u5FC5\u5148\u8C03\u7528 project(action=get) \u5C31\u80FD\u76F4\u63A5\u62C6\u89E3\u3001\u6D3E\u6D3B\u6216\u63A8\u8FDB\u3002\u5C0F\u9879\u76EE\u53EA\u62C6\u6700\u5C11\u5FC5\u8981\u4EFB\u52A1\uFF0C\u5927\u9879\u76EE\u6309\u4EA4\u4ED8\u8FB9\u754C\u5206\u5DE5\u3002\u7528 add_task \u767B\u8BB0\u4EFB\u52A1\uFF08\u660E\u786E\u76EE\u6807\u3001\u4EA4\u4ED8\u7269\u3001\u9A8C\u6536\u6807\u51C6\u3001\u4F9D\u8D56\uFF09\uFF1Badd_task / update_task \u65F6\u53EF\u4EE5\u5E26 executorProfile \u4E0E reviewerProfile\uFF08\u652F\u6301\u6307\u5B9A agentId\u3001cwd\u3001model\u3001thinkingLevel\u3001watchdogTimeoutSeconds\uFF09\uFF0C\u6309\u4EFB\u52A1\u6027\u8D28\u5C06\u6267\u884C\u4E0E\u590D\u6838\u59D4\u6D3E\u7ED9\u6700\u5408\u9002\u7684\u5458\u5DE5\uFF0C\u4E0D\u6307\u5B9A\u5219\u7EE7\u627F\u9879\u76EE\u9ED8\u8BA4\uFF1B\u9700\u8981\u7EE7\u7EED\u62C6\u89E3\u7684\u5DE5\u4F5C\u8BBE role=leader\uFF0C\u53F6\u5B50\u6267\u884C\u4EFB\u52A1\u8BBE role=executor\uFF0C\u5B50 Leader \u7528 parentTaskId \u767B\u8BB0\u81EA\u5DF1\u7684\u5B50\u4EFB\u52A1\uFF0Cdispatch \u7ACB\u5373\u542F\u52A8\u6267\u884C\u5B50\u4F1A\u8BDD\uFF1B\u4E0D\u8981\u7528 session_spawn/session_dispatch \u6216 task/workflow \u7ED5\u5F00\u9879\u76EE\u5206\u5DE5\u4E0E\u6C47\u62A5\u7EBF\u3002\u6536\u5230\u4EA4\u4ED8\u540E\u7528 request_review \u542F\u52A8\u72EC\u7ACB\u590D\u6838\u3002\u6D3E\u53D1\u540E\u5B50\u4F1A\u8BDD\u4F1A\u7ACB\u5373\u5F00\u59CB\u6267\u884C\u5E76\u5728\u5B8C\u6210\u540E\u81EA\u52A8\u56DE\u62A5\u7ED9\u4F60\uFF0C\u5C4A\u65F6\u7EE7\u7EED\u6D3E\u53D1 ready \u4EFB\u52A1\u3001\u590D\u6838\u5F85\u9A8C\u6536\u4EFB\u52A1\u6216\u6309 review.summary \u8FD4\u5DE5\uFF1B\u4E0D\u8981\u8F6E\u8BE2\u7B49\u5F85\uFF0C\u4E0D\u8981\u53CD\u590D\u65E0\u8FDB\u5C55\u91CD\u8BD5\uFF0C\u7B49\u5F85\u56DE\u62A5\u65F6\u76F4\u63A5\u7ED3\u675F\u5F53\u524D\u56DE\u590D\u3002\u7528 report \u767B\u8BB0\u5173\u952E\u8FDB\u5C55\u3002\u4F60\u7684\u4E0B\u5C5E\u7684\u5347\u7EA7\u5148\u5230\u4F60\u8FD9\u91CC\uFF1A\u4F60\u5728\u81EA\u5DF1\u8FD9\u4E00\u5C42\u5904\u7406\uFF0C\u80FD\u81EA\u5DF1\u89E3\u51B3\u7684\u81EA\u5DF1\u89E3\u51B3\uFF1B\u53EA\u6709\u786E\u5B9E\u9700\u8981 Boss \u51B3\u7B56\u7684\uFF08\u91CD\u5927\u504F\u5DEE\u3001\u6743\u9650\u6216\u8303\u56F4\u53D8\u66F4\uFF09\u624D\u7528 escalate \u4EA4\u7ED9 Boss\u3002\u4F60\u4E0D\u80FD\u66FF Boss \u505A\u51B3\u5B9A\uFF0C\u4E5F\u4E0D\u8981\u628A\u6CA1\u5904\u7406\u7684\u5347\u7EA7\u538B\u4E0B\u53BB\u4E0D\u7406\u3002\u6240\u6709\u4EFB\u52A1\u9A8C\u6536\u540E\uFF0C\u7528 deliver \u8BB0\u5F55\u5E26\u8BC1\u636E\u7684\u9636\u6BB5\u4EA4\u4ED8\uFF0C\u540E\u7EED\u53EF\u7EE7\u7EED\u6D3E\u53D1\u3002\u4E0A\u4E0B\u6587\u6709\u9650\uFF0C\u660E\u786E\u5047\u8BBE\uFF0C\u4E3B\u52A8\u5BFB\u627E\u53CD\u8BC1\u3002\u53EA\u5728\u672C\u6B21\u89E6\u53D1\u8303\u56F4\u5185\u5DE5\u4F5C\u3002";
|
|
23
|
+
export declare const LIGHTWEIGHT_LEADER_PROMPT = "\u4F60\u662F\u76F4\u63A5\u5411 Boss \u8D1F\u8D23\u7684\u9879\u76EE Leader\uFF0C\u8FD9\u662F\u4E00\u4E2A\u8F7B\u91CF\u9879\u76EE\uFF1A\u8FD9\u4E2A\u9879\u76EE\u7531\u4F60\u4EB2\u81EA\u5B8C\u6210\uFF0C\u4E0D\u8981\u62C6\u5B50\u4EFB\u52A1\u3001\u4E0D\u8981\u6D3E\u53D1\u7ED9\u522B\u4EBA\u3001\u4E5F\u6CA1\u6709\u72EC\u7ACB\u590D\u6838\u3002\u5F00\u7BC7\u4E0A\u4E0B\u6587\u5DF2\u7ED9\u51FA\u9879\u76EE\u76EE\u6807\u3001\u6A21\u5F0F\u4E0E\u5F53\u524D\u4EFB\u52A1\u6E05\u5355\uFF0C\u4E0D\u5FC5\u5148\u8C03\u7528 project(action=get) \u5C31\u80FD\u76F4\u63A5\u52A8\u624B\u3002\u7528 add_task \u767B\u8BB0\u4EFB\u52A1\uFF08\u660E\u786E\u76EE\u6807\u3001\u4EA4\u4ED8\u7269\u3001\u9A8C\u6536\u6807\u51C6\u3001\u4F9D\u8D56\uFF09\uFF0C\u4EFB\u52A1\u4E00\u5F8B\u767B\u8BB0\u4E3A\u6267\u884C\u4EFB\u52A1\uFF1Arole=leader \u6216\u5E26 parentTaskId \u90FD\u4F1A\u88AB\u62D2\u7EDD\u3002dispatch \u4F1A\u628A\u4EFB\u52A1\u4EA4\u56DE\u7ED9\u4F60\u81EA\u5DF1\uFF0C\u4F60\u4EB2\u81EA\u505A\u5B8C\uFF1B\u505A\u5B8C\u540E\u8C03\u7528 project(action=submit, projectId, taskId, output, evidenceRefs) \u63D0\u4EA4\u4EA4\u4ED8\uFF0C\u63D0\u4EA4\u5373\u5B8C\u6210\uFF0C\u4E0D\u4F1A\u6709\u4EBA\u56DE\u6765\u590D\u6838\uFF0C\u8BC1\u636E\u5FC5\u987B\u9644\u4E0A\u3002\u4E0D\u8981\u7528 session_spawn/session_dispatch \u6216 task/workflow \u7ED5\u5F00\u9879\u76EE\u804C\u8D23\u4E0E\u6C47\u62A5\u7EBF\u3002\u4E0D\u8981\u8F6E\u8BE2\u7B49\u5F85\uFF0C\u4E0D\u8981\u53CD\u590D\u65E0\u8FDB\u5C55\u91CD\u8BD5\u3002\u7528 report \u6C47\u603B\u5173\u952E\u8FDB\u5C55\u3002\u666E\u901A\u6280\u672F\u51B3\u7B56\u3001\u963B\u585E\u4E0E\u8FD4\u5DE5\u7531\u4F60\u81EA\u884C\u5904\u7406\uFF1B\u53EA\u6709\u786E\u5B9E\u9700\u8981\u7528\u6237\u51B3\u5B9A\u7684\u76EE\u6807\u53D6\u820D\u3001\u6743\u9650\u6216\u5916\u90E8\u8D44\u6E90\u624D\u7528 escalate \u4EA4\u7ED9 Boss\uFF0C\u4E0D\u5F97\u66FF Boss \u51B3\u5B9A\u8FD9\u4E9B\u4E8B\u9879\u3002\u6240\u6709\u4EFB\u52A1\u4EA4\u4ED8\u540E\uFF0C\u7528 deliver \u8BB0\u5F55\u5E26\u8BC1\u636E\u7684\u9636\u6BB5\u4EA4\u4ED8\uFF0C\u540E\u7EED\u53EF\u7EE7\u7EED\u6D3E\u53D1\u3002\u4E0A\u4E0B\u6587\u6709\u9650\uFF0C\u660E\u786E\u5047\u8BBE\uFF0C\u4E3B\u52A8\u5BFB\u627E\u53CD\u8BC1\u3002\u53EA\u5728\u672C\u6B21\u89E6\u53D1\u8303\u56F4\u5185\u5DE5\u4F5C\u3002";
|
|
24
24
|
export declare const profile: (value: unknown, label: string) => SessionProfile | undefined;
|
|
25
25
|
export declare const mergeProfile: (taskProfile?: SessionProfile, projectDefault?: SessionProfile) => SessionProfile | undefined;
|
|
26
26
|
/**
|
|
@@ -97,7 +97,7 @@ export declare class ProjectService {
|
|
|
97
97
|
*/
|
|
98
98
|
private readonly agents?;
|
|
99
99
|
private readonly queues;
|
|
100
|
-
constructor(store: Store, orchestrator?: (Pick<SessionOrchestratorService, "spawn" | "dispatch"> & Partial<Pick<SessionOrchestratorService, "stopSubtree">>) | undefined,
|
|
100
|
+
constructor(store: Store, orchestrator?: (Pick<SessionOrchestratorService, "spawn" | "dispatch" | "notifyChildCompleted"> & Partial<Pick<SessionOrchestratorService, "stopSubtree">>) | undefined,
|
|
101
101
|
/**
|
|
102
102
|
* Optional on purpose: a service built without an agent directory cannot tell a subagent from a
|
|
103
103
|
* custom agent, and it then behaves exactly as it did before this check existed. The real
|
|
@@ -107,6 +107,35 @@ export declare class ProjectService {
|
|
|
107
107
|
private publishContext;
|
|
108
108
|
shareContext(id: string, value: unknown, workspaceId: string, actor?: string): Promise<unknown>;
|
|
109
109
|
messageTask(id: string, taskId: string, content: string, workspaceId: string, actor?: string, targetConversationId?: string, deliveryMode?: string): Promise<unknown>;
|
|
110
|
+
/**
|
|
111
|
+
* A SUPERVISOR'S MESSAGE IS THE ANSWER TO THE EXCEPTION - NOT A FORMAL RULING.
|
|
112
|
+
*
|
|
113
|
+
* The reader's complaint was that a session kept saying 「等上面拍板」 long after the question
|
|
114
|
+
* had been settled in a real conversation: the supervisor had talked it through with the member
|
|
115
|
+
* and sent the follow-up instruction, and the platform was still waiting for a ceremony nobody
|
|
116
|
+
* had asked for. Communication is higher than protocol - when the supervisor the case is
|
|
117
|
+
* addressed to writes back to the member who raised it, the case IS answered.
|
|
118
|
+
*
|
|
119
|
+
* TWO THINGS ARE KEPT APART ON PURPOSE.
|
|
120
|
+
* - THE RECORD STAYS. The exception keeps its place in `p.escalations` with the answer, who
|
|
121
|
+
* answered and when. A decision record must not disappear when the project is cancelled.
|
|
122
|
+
* - THE STATE CHANGES. The session no longer says 「等上面拍板」, because nobody is waiting for
|
|
123
|
+
* anything any more: the answer is already on the member's desk.
|
|
124
|
+
*
|
|
125
|
+
* WHAT IS NOT SETTLED HERE, AND WHY:
|
|
126
|
+
* - A BOSS-LEVEL EXCEPTION IS NEVER SETTLED BY A MESSAGE. That case asks the Boss himself, and
|
|
127
|
+
* no team member has the authority to answer it - `resolveEscalation` enforces the very same
|
|
128
|
+
* rule for the panel and the tool, and it must hold for a message too.
|
|
129
|
+
* - A RETURNED EXCEPTION IS NOT REVIVED BY A MESSAGE. A returned case means the member was
|
|
130
|
+
* asked for more material; that material comes back as a NEW exception, not as the old one
|
|
131
|
+
* coming back to life.
|
|
132
|
+
* - ONLY THE DESIGNATED DIRECT SUPERVISOR ANSWERS. `targetConversationId` is the supervisor
|
|
133
|
+
* the case is addressed to, so a message from anybody else is somebody else's business.
|
|
134
|
+
* - AND THE REPLY HAS TO REACH THE MEMBER WHO RAISED IT. A supervisor who writes to somebody
|
|
135
|
+
* else has not answered this case, and settling it would repeat the mistake this project
|
|
136
|
+
* already made once: one answer closing every case of that member at once.
|
|
137
|
+
*/
|
|
138
|
+
private settleEscalationsByMessage;
|
|
110
139
|
getContext(id: string | undefined, workspaceId: string, actor?: string, taskId?: string, contextIds?: unknown): unknown;
|
|
111
140
|
private coordinationHints;
|
|
112
141
|
private assertWriteScope;
|
|
@@ -312,7 +341,10 @@ export declare class ProjectService {
|
|
|
312
341
|
private context;
|
|
313
342
|
start(id: string, workspaceId: string, actor?: string): Promise<Project>;
|
|
314
343
|
addTask(id: string, input: AddTaskInput, workspaceId?: string, actor?: string): Promise<ProjectTask>;
|
|
315
|
-
dispatchTask(id: string, taskId: string, workspaceId: string, actor?: string
|
|
344
|
+
dispatchTask(id: string, taskId: string, workspaceId: string, actor?: string, sourceContext?: {
|
|
345
|
+
id: string;
|
|
346
|
+
warm: boolean;
|
|
347
|
+
}): Promise<ProjectTask>;
|
|
316
348
|
submit(id: string, taskId: string, input: {
|
|
317
349
|
output?: string;
|
|
318
350
|
evidenceRefs?: string[];
|
|
@@ -324,6 +356,21 @@ export declare class ProjectService {
|
|
|
324
356
|
summary?: string;
|
|
325
357
|
evidenceRefs?: string[];
|
|
326
358
|
}, workspaceId: string, actor?: string): Promise<ProjectTask>;
|
|
359
|
+
/**
|
|
360
|
+
* THE TASK IS DONE, SO THE LEADER IS WOKEN - AND IT IS NOT TOLD WHAT WAS DONE.
|
|
361
|
+
*
|
|
362
|
+
* The member's work is finished, and the member's direct parent - the Leader - has to hear
|
|
363
|
+
* about it: a Leader that is not told is a Leader that sits there with a finished employee.
|
|
364
|
+
*
|
|
365
|
+
* WHAT THE WAKE CARRIES IS THE TASK'S IDENTITY AND NOTHING ELSE. The delivery, the evidence and
|
|
366
|
+
* the review verdict stay where they are: in the project record and in the member's own
|
|
367
|
+
* session. A platform that wrote the summary here would be writing a report nobody checked, and
|
|
368
|
+
* the Leader is the one who is supposed to look and judge.
|
|
369
|
+
*
|
|
370
|
+
* THE COMPLETION IS THE UNIT, SO THE KNOCK HAPPENS ONCE. A task that is marked complete twice -
|
|
371
|
+
* a retried acceptance - is one piece of work, and the Leader is woken once for it.
|
|
372
|
+
*/
|
|
373
|
+
private notifyTaskCompleted;
|
|
327
374
|
updateTask(id: string, taskId: string, patch: Record<string, unknown> & {
|
|
328
375
|
workspaceId?: string;
|
|
329
376
|
}, actor?: string): Promise<ProjectTask>;
|
|
@@ -371,7 +418,8 @@ export declare class ProjectService {
|
|
|
371
418
|
* next reader has to guess about.
|
|
372
419
|
*/
|
|
373
420
|
resolveEscalation(id: string, escalationId: string, decision: string, status: "resolved" | "dismissed" | "returned", workspaceId?: string, actor?: string): Promise<ProjectEscalation>;
|
|
374
|
-
|
|
421
|
+
private deliveryTasks;
|
|
422
|
+
deliver(id: string, summary: string, evidenceRefs: unknown, workspaceId: string, actor?: string): Promise<Project>;
|
|
375
423
|
/**
|
|
376
424
|
* The tasks an initiator hands over with create. A dependency names the TITLE of another task in
|
|
377
425
|
* the same batch, because the batch carries no task IDs yet - the service assigns them while it
|