@evandu/super-pi 0.1.183 → 0.1.186
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/coder.md +1 -1
- package/agents/planner.md +1 -1
- package/agents/project-leader.md +2 -2
- package/agents/reviewer.md +1 -1
- package/agents/super-pi-task/core.ts +164 -7
- package/agents/super-pi-task/index.ts +33 -1
- package/dist/client/.super-pi-client-sources.json +7 -7
- package/dist/client/assets/{CodeMirrorEditor-DUyqaSOB.js → CodeMirrorEditor-Cmx7-z0f.js} +2 -2
- package/dist/client/assets/{dist-CPmDYAQT.js → dist-B8CAEuXW.js} +1 -1
- package/dist/client/assets/{dist-nbHIDjzw.js → dist-BKx3CpQJ.js} +1 -1
- package/dist/client/assets/{dist-CB124C6Z.js → dist-BMSVWA_A.js} +1 -1
- package/dist/client/assets/{dist-CU8JEI5K.js → dist-BdiInYmk.js} +1 -1
- package/dist/client/assets/{dist-D3HMZhM-.js → dist-Bq7p17eF.js} +1 -1
- package/dist/client/assets/{dist-CvLzvDh7.js → dist-BzqUlzAf.js} +1 -1
- package/dist/client/assets/{dist-Dkm31GRe.js → dist-C0PMHwdm.js} +1 -1
- package/dist/client/assets/{dist-CeU4Svbh.js → dist-C2ltv_8u.js} +1 -1
- package/dist/client/assets/{dist-DTd2PCza.js → dist-CDSDxXju.js} +1 -1
- package/dist/client/assets/{dist-DLOUy-hB.js → dist-CKZOnuRU.js} +1 -1
- package/dist/client/assets/{dist-ka17rnWs.js → dist-CWlI6qO0.js} +1 -1
- package/dist/client/assets/{dist-AQ8CYp6b.js → dist-CXDhHY7N.js} +1 -1
- package/dist/client/assets/{dist-Dnx8LlEL.js → dist-Cblc22Ag.js} +1 -1
- package/dist/client/assets/{dist-Bj218gfa.js → dist-CcuBp_Kn.js} +1 -1
- package/dist/client/assets/{dist-CNem2r_T.js → dist-DHFt0Hvo.js} +1 -1
- package/dist/client/assets/{dist-NLNoAzKl.js → dist-D_7x3oZt.js} +1 -1
- package/dist/client/assets/{dist-D4lWO1EF.js → dist-RHYiODih.js} +1 -1
- package/dist/client/assets/{dist-CkTZUfAR.js → dist-V27Fcf8p.js} +1 -1
- package/dist/client/assets/{dist-Dlg4MpdE.js → dist-WfagMkC4.js} +1 -1
- package/dist/client/assets/{dist-dnyR0Vf6.js → dist-akJoBtjs.js} +1 -1
- package/dist/client/assets/{dist-C7PhA7pe.js → dist-frBiV55p.js} +1 -1
- package/dist/client/assets/{dist-TX6Uhfee.js → dist-ibsGPa_S.js} +1 -1
- package/dist/client/assets/{index-Ui6aXMVV.css → index-BXQjUHV_.css} +1 -1
- package/dist/client/assets/{index-BplDWdZp.js → index-Dx7HAZ5j.js} +14 -13
- package/dist/client/index.html +2 -2
- package/dist/server/agents.d.ts +1 -1
- package/dist/server/agents.js +1 -1
- package/dist/server/application/conversation-service.d.ts +13 -0
- package/dist/server/application/conversation-service.js +21 -0
- package/dist/server/application/project-service.d.ts +2 -70
- package/dist/server/application/project-service.js +102 -205
- package/dist/server/application/run-service.d.ts +39 -3
- package/dist/server/application/run-service.js +166 -18
- package/dist/server/application/session-orchestrator-service.d.ts +38 -5
- package/dist/server/application/session-orchestrator-service.js +167 -5
- package/dist/server/command-handler.js +5 -1
- package/dist/server/http-server.js +45 -18
- package/dist/server/index.js +1 -1
- package/dist/server/pi-session.d.ts +3 -2
- package/dist/server/runtime.js +9 -6
- package/dist/server/session-tree-scope.d.ts +1 -1
- package/dist/server/store.d.ts +24 -0
- package/dist/server/store.js +229 -4
- package/dist/server/task-tool.d.ts +5 -2
- package/dist/server/task-tool.js +25 -2
- package/dist/server/types.d.ts +43 -13
- package/dist/server/upload.d.ts +2 -6
- package/dist/server/upload.js +7 -5
- package/dist/shared/session-reporting.d.ts +13 -2
- package/dist/shared/session-reporting.js +62 -15
- package/package.json +8 -3
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-Dx7HAZ5j.js"></script>
|
|
12
|
+
<link rel="stylesheet" crossorigin href="/assets/index-BXQjUHV_.css">
|
|
13
13
|
</head>
|
|
14
14
|
<body>
|
|
15
15
|
<div id="root"></div>
|
package/dist/server/agents.d.ts
CHANGED
|
@@ -38,7 +38,7 @@ type Frontmatter = Record<string, unknown>;
|
|
|
38
38
|
*/
|
|
39
39
|
export declare const PI_TOOL_NAMES: readonly ["read", "bash", "powershell", "edit", "write", "grep", "find", "ls", "codemode", "tool_search", "list_mcp_resources", "list_mcp_resource_templates", "read_mcp_resource"];
|
|
40
40
|
/** Tools shipped by this package. Authors must be able to explicitly deny host extras. */
|
|
41
|
-
export declare const SUPER_PI_TOOL_NAMES: readonly ["task", "todowrite", "workflow", "run_async", "scheduled_task", "project", "question", "tool_register", "memory", "skill_manage", "session_search", "session_spawn", "session_status", "session_dispatch", "session_stop", "session_report", "session_stop_subtree", "knowledge_search", "knowledge_import", "document_read", "document_write", "web_search", "web_fetch", "feishu_doc_read", "feishu_doc_write"];
|
|
41
|
+
export declare const SUPER_PI_TOOL_NAMES: readonly ["task", "todowrite", "workflow", "run_async", "scheduled_task", "project", "question", "tool_register", "memory", "skill_manage", "session_search", "session_spawn", "session_status", "session_dispatch", "session_stop", "session_report", "session_stop_subtree", "session_remove", "knowledge_search", "knowledge_import", "document_read", "document_write", "web_search", "web_fetch", "feishu_doc_read", "feishu_doc_write"];
|
|
42
42
|
/**
|
|
43
43
|
* Whether a name can be a real Pi tool. A name is real if it is one of `PI_TOOL_NAMES`, an MCP
|
|
44
44
|
* server tool, or a PATTERN.
|
package/dist/server/agents.js
CHANGED
|
@@ -41,7 +41,7 @@ export const PI_TOOL_NAMES = [
|
|
|
41
41
|
export const SUPER_PI_TOOL_NAMES = [
|
|
42
42
|
"task", "todowrite", "workflow", "run_async", "scheduled_task", "project", "question", "tool_register",
|
|
43
43
|
"memory", "skill_manage", "session_search",
|
|
44
|
-
"session_spawn", "session_status", "session_dispatch", "session_stop", "session_report", "session_stop_subtree",
|
|
44
|
+
"session_spawn", "session_status", "session_dispatch", "session_stop", "session_report", "session_stop_subtree", "session_remove",
|
|
45
45
|
"knowledge_search", "knowledge_import",
|
|
46
46
|
"document_read", "document_write", "web_search", "web_fetch", "feishu_doc_read", "feishu_doc_write",
|
|
47
47
|
];
|
|
@@ -204,4 +204,17 @@ export declare class ConversationService {
|
|
|
204
204
|
* Forks an existing conversation into a new parallel branch, cloning the Pi session.
|
|
205
205
|
*/
|
|
206
206
|
forkConversation(conversationId: string): Promise<ForkConversationResult>;
|
|
207
|
+
/**
|
|
208
|
+
* Cancels pending UI/sub-agent work and clears active memory notes for a conversation about to
|
|
209
|
+
* be permanently destroyed (runs while the conversation is still readable in the store).
|
|
210
|
+
*/
|
|
211
|
+
prepareDestroyConversation(conversationId: string): Promise<void>;
|
|
212
|
+
/**
|
|
213
|
+
* Removes a destroyed conversation's messages from the recall index and disposes any cached Pi
|
|
214
|
+
* session held in runtime memory.
|
|
215
|
+
*/
|
|
216
|
+
cleanupDestroyedConversation(conversation: {
|
|
217
|
+
id: string;
|
|
218
|
+
messageIds: string[];
|
|
219
|
+
}): Promise<void>;
|
|
207
220
|
}
|
|
@@ -552,4 +552,25 @@ export class ConversationService {
|
|
|
552
552
|
return { ok: false, message };
|
|
553
553
|
}
|
|
554
554
|
}
|
|
555
|
+
/**
|
|
556
|
+
* Cancels pending UI/sub-agent work and clears active memory notes for a conversation about to
|
|
557
|
+
* be permanently destroyed (runs while the conversation is still readable in the store).
|
|
558
|
+
*/
|
|
559
|
+
async prepareDestroyConversation(conversationId) {
|
|
560
|
+
this.extensionUiService.cancelPendingUi(conversationId, "aborted");
|
|
561
|
+
for (const run of this.store.snapshot().subagentRuns) {
|
|
562
|
+
if (run.conversationId === conversationId && run.status === "running") {
|
|
563
|
+
this.subagents.stop(run.id);
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
await this.memory?.forgetAfter(conversationId, "1970-01-01T00:00:00.000Z");
|
|
567
|
+
}
|
|
568
|
+
/**
|
|
569
|
+
* Removes a destroyed conversation's messages from the recall index and disposes any cached Pi
|
|
570
|
+
* session held in runtime memory.
|
|
571
|
+
*/
|
|
572
|
+
async cleanupDestroyedConversation(conversation) {
|
|
573
|
+
this.memory?.removeFromIndex(conversation.messageIds);
|
|
574
|
+
await this.runtime.disposeSessions?.(conversation.id);
|
|
575
|
+
}
|
|
555
576
|
}
|
|
@@ -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\u517C\u4EFB\u79D8\u4E66\u3002\u5148\u8C03\u7528 project(action=get
|
|
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\u5148\u8C03\u7528 project(action=get
|
|
22
|
+
export declare const STANDARD_LEADER_PROMPT = "\u4F60\u662F\u76F4\u63A5\u5411 Boss \u8D1F\u8D23\u7684\u9879\u76EE Leader\uFF0C\u517C\u4EFB\u79D8\u4E66\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 complete \u63D0\u4EA4\u5E26\u8BC1\u636E\u7684\u6700\u7EC8\u4EA4\u4ED8\u603B\u7ED3\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 \u767B\u8BB0\u5173\u952E\u8FDB\u5C55\uFF0C\u7528 escalate \u5C06\u91CD\u5927\u504F\u5DEE\u3001\u6743\u9650\u6216\u8303\u56F4\u53D8\u66F4\u4EA4\u7ED9 Boss\uFF0C\u4E0D\u5F97\u81EA\u884C\u89E3\u51B3\u5347\u7EA7\u4E8B\u9879\u3002\u6240\u6709\u4EFB\u52A1\u4EA4\u4ED8\u540E\uFF0C\u7528 complete \u63D0\u4EA4\u5E26\u8BC1\u636E\u7684\u6700\u7EC8\u4EA4\u4ED8\u603B\u7ED3\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
|
/**
|
|
@@ -43,10 +43,6 @@ export type CreateProjectInput = {
|
|
|
43
43
|
constraints?: unknown;
|
|
44
44
|
risk?: ProjectRisk;
|
|
45
45
|
ownerConversationId?: string;
|
|
46
|
-
budget?: {
|
|
47
|
-
maxTokens?: number;
|
|
48
|
-
maxConcurrent?: number;
|
|
49
|
-
};
|
|
50
46
|
defaultLeaderProfile?: unknown;
|
|
51
47
|
defaultExecutorProfile?: unknown;
|
|
52
48
|
defaultReviewerProfile?: unknown;
|
|
@@ -70,16 +66,6 @@ export type TopLevelTaskPlan = {
|
|
|
70
66
|
priority?: ProjectTask["priority"];
|
|
71
67
|
dependencies: string[];
|
|
72
68
|
};
|
|
73
|
-
/** What one click on 「提到 N Token 并继续」 produced. */
|
|
74
|
-
export type BudgetRaiseResult = {
|
|
75
|
-
project: Project;
|
|
76
|
-
/** The cap before the raise, so the panel can say what changed. */
|
|
77
|
-
previousMaxTokens: number;
|
|
78
|
-
/** The cap the server raised it to - the number the one-click button promised. */
|
|
79
|
-
suggestedMaxTokens: number;
|
|
80
|
-
/** How many budget exceptions were closed by the raise. */
|
|
81
|
-
resolvedEscalations: number;
|
|
82
|
-
};
|
|
83
69
|
/**
|
|
84
70
|
* HOW THE SERVICE ASKS WHAT AN AGENT ID IS.
|
|
85
71
|
*
|
|
@@ -133,39 +119,6 @@ export declare class ProjectService {
|
|
|
133
119
|
static taskView(task: ProjectTask, project: Pick<Project, "defaultExecutorProfile" | "defaultReviewerProfile">): ProjectTask;
|
|
134
120
|
private filterEscalations;
|
|
135
121
|
private projectView;
|
|
136
|
-
/**
|
|
137
|
-
* THE NUMBER THE ONE-CLICK PATH OFFERS.
|
|
138
|
-
*
|
|
139
|
-
* The Boss does not type a budget when the budget runs out: a number typed in a hurry is a
|
|
140
|
-
* number nobody predicted, and a budget that is guessed wrong is the failure this whole path
|
|
141
|
-
* exists to remove. So the server suggests one instead - double what has already been spent,
|
|
142
|
-
* because an agent run that needed twice its first budget will need twice its second one, and
|
|
143
|
-
* never less than one token more than the current cap, so the offer always really raises it.
|
|
144
|
-
*/
|
|
145
|
-
private suggestedMaxTokens;
|
|
146
|
-
/**
|
|
147
|
-
* THE BUDGET PARAGRAPH A BUDGET EXCEPTION CARRIES - AND ONLY A BUDGET EXCEPTION.
|
|
148
|
-
*
|
|
149
|
-
* WHY THE EXCEPTION TEXT NEEDS THIS. A budget exception used to reach the Boss as one line -
|
|
150
|
-
* "请批准追加预算派发复核者" - and that line says nothing about WHO is at fault. The Boss reads
|
|
151
|
-
* it as "the Boss did not approve enough", while the truth is often "the agent set the cap too
|
|
152
|
-
* low when the project was created". Only one of those two readings leads to a fix, and the
|
|
153
|
-
* wrong one leads to approving a budget that runs into the same wall one task later.
|
|
154
|
-
*
|
|
155
|
-
* SO THE SERVER WRITES THE NUMBERS, because only the server has them: the effective usage in
|
|
156
|
-
* the §5 unit (输入 + 输出 + 缓存写入 × 1.25 + 缓存读取 × 0.1), the cap, and the number the
|
|
157
|
-
* one-click raise would offer - the very number the panel shows, so the two can never disagree.
|
|
158
|
-
*
|
|
159
|
-
* AND IT SAYS THE UNCOMFORTABLE PART OUT LOUD - 「可能是我一开始把预算填小了」. The words are in
|
|
160
|
-
* the project's own voice, because that is the voice an exception already speaks in, and an
|
|
161
|
-
* exception that never names the possibility is a case written to be approved as it stands.
|
|
162
|
-
*
|
|
163
|
-
* ONLY A BUDGET CASE GETS THESE WORDS. An exception about permissions or about scope must not
|
|
164
|
-
* carry budget numbers: a reader who sees a budget on a permission case stops reading the
|
|
165
|
-
* case. `BUDGET_CASE` decides, and it is matched on the agent's own words - the agent that
|
|
166
|
-
* says 「撞到上限了」 has said the same thing as one that says 「预算」.
|
|
167
|
-
*/
|
|
168
|
-
private budgetExceptionNote;
|
|
169
122
|
private raw;
|
|
170
123
|
private workspace;
|
|
171
124
|
private event;
|
|
@@ -374,27 +327,6 @@ export declare class ProjectService {
|
|
|
374
327
|
* different decisions, and the timeline is where that difference has to show up.
|
|
375
328
|
*/
|
|
376
329
|
cancel(id: string, body: Record<string, any>, workspaceId: string, actor: string): Promise<Project>;
|
|
377
|
-
updateBudget(id: string, input: {
|
|
378
|
-
maxTokens?: number;
|
|
379
|
-
maxConcurrent?: number;
|
|
380
|
-
}, workspaceId: string): Promise<Project>;
|
|
381
|
-
/**
|
|
382
|
-
* ONE CLICK: RAISE THE BUDGET AND LET THE WORK CONTINUE.
|
|
383
|
-
*
|
|
384
|
-
* Three things happen here, and they happen together: the cap goes up to a number the SERVER
|
|
385
|
-
* computed, the budget exception that is waiting for a decision is closed, and the work that
|
|
386
|
-
* was blocked is woken up again. Doing them apart is what made the old path painful - a Boss
|
|
387
|
-
* had to open a form, type a number, press save, and then wake the leader by hand, and every
|
|
388
|
-
* one of those steps was a chance to stop halfway.
|
|
389
|
-
*
|
|
390
|
-
* IT IS A BOSS OPERATION. A session may not raise the budget of its own project: the budget is
|
|
391
|
-
* the Boss's stop, and an agent that could lift its own limit would not have one. The HTTP
|
|
392
|
-
* layer refuses a request that carries a capability for the same reason.
|
|
393
|
-
*
|
|
394
|
-
* The manual `updateBudget` stays a SEPARATE intent: adjusting a number is not the same as
|
|
395
|
-
* asking for the work to continue, so the manual path does not continue anything.
|
|
396
|
-
*/
|
|
397
|
-
raiseBudgetAndContinue(id: string, workspaceId: string, callerConversationId?: string): Promise<BudgetRaiseResult>;
|
|
398
330
|
addReport(id: string, input: Omit<ProjectReport, "id" | "projectId" | "createdAt">, workspaceId?: string, actor?: string): Promise<ProjectReport>;
|
|
399
331
|
addEscalation(id: string, input: Pick<ProjectEscalation, "reason" | "severity" | "taskId" | "title">, workspaceId?: string, actor?: string): Promise<ProjectEscalation>;
|
|
400
332
|
/**
|