@evandu/super-pi 0.1.205 → 0.1.207
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.
|
@@ -76,6 +76,7 @@ export const TODO_TOOL_NAME = "todowrite";
|
|
|
76
76
|
* other when both extensions are mounted, as they normally are.
|
|
77
77
|
*/
|
|
78
78
|
export const SUPER_PI_CAPABILITIES_SECTION_KEY = "super_pi_capabilities";
|
|
79
|
+
export const TEAM_CONTEXT_SECTION_KEY = "super_pi_team_context";
|
|
79
80
|
|
|
80
81
|
/**
|
|
81
82
|
* The USAGE knowledge a Super Pi agent needs that no tool description carries.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Type } from "@sinclair/typebox";
|
|
2
|
-
import { PROJECT_TOOL_NAME, PROJECT_DESCRIPTION, TEAM_COORDINATION_DESCRIPTION, loadTeamContext, readProjectConfig, executeProject } from "./core.ts";
|
|
2
|
+
import { PROJECT_TOOL_NAME, PROJECT_DESCRIPTION, TEAM_COORDINATION_DESCRIPTION, TEAM_CONTEXT_SECTION_KEY, loadTeamContext, readProjectConfig, executeProject } from "./core.ts";
|
|
3
3
|
import {
|
|
4
4
|
SUPER_PI_CAPABILITIES_SECTION,
|
|
5
5
|
SUPER_PI_CAPABILITIES_SECTION_KEY,
|
|
@@ -313,10 +313,10 @@ const extension = (pi: ExtensionApi): void => {
|
|
|
313
313
|
pi.on("before_agent_start", async (event: { prompt?: string; systemPromptOptions: { sections: Record<string, string> } }, context?: { signal?: AbortSignal }) => {
|
|
314
314
|
try {
|
|
315
315
|
const notes = await loadTeamContext(projectConfig, context?.signal);
|
|
316
|
-
if (notes && !event.prompt?.includes(notes)) event.systemPromptOptions.sections
|
|
317
|
-
else delete event.systemPromptOptions.sections
|
|
316
|
+
if (notes && !event.prompt?.includes(notes)) event.systemPromptOptions.sections[TEAM_CONTEXT_SECTION_KEY] = notes;
|
|
317
|
+
else delete event.systemPromptOptions.sections[TEAM_CONTEXT_SECTION_KEY];
|
|
318
318
|
} catch {
|
|
319
|
-
event.systemPromptOptions.sections
|
|
319
|
+
event.systemPromptOptions.sections[TEAM_CONTEXT_SECTION_KEY] = "项目共享上下文暂不可用;需要时调用 project get_context 获取,不要将历史快照当作最新结论。";
|
|
320
320
|
}
|
|
321
321
|
return {};
|
|
322
322
|
});
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"src/client/types.ts": "0d32fd568f188507ce2b48266f44fa20da1bcf436090893b1ff0c164ed0f3132",
|
|
42
42
|
"src/client/vite-env.d.ts": "65996936fbb042915f7b74a200fcdde7e410f32a669b1ab9597cfaa4b0faddb5"
|
|
43
43
|
},
|
|
44
|
-
"recordedAt": "2026-11-
|
|
44
|
+
"recordedAt": "2026-11-13T04:29:00.141Z"
|
|
45
45
|
}
|
|
@@ -367,22 +367,25 @@ export class ProjectService {
|
|
|
367
367
|
return this.change(id, workspaceId, p => { this.live(p); this.publishContext(p, value, actor); return { revision: p.contextRevision ?? 0, entries: p.sharedContext ?? [] }; });
|
|
368
368
|
}
|
|
369
369
|
async messageTask(id, taskId, content, workspaceId, actor, targetConversationId, deliveryMode = "queue") {
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
this.
|
|
370
|
+
return this.change(id, workspaceId, async (p) => {
|
|
371
|
+
this.live(p);
|
|
372
|
+
const task = this.task(p, taskId);
|
|
373
|
+
this.manager(p, task, actor);
|
|
374
|
+
if (!["in_progress", "awaiting_review", "blocked"].includes(task.status))
|
|
375
|
+
throw new Error("补充指令只用于执行、复核或阻塞中的任务;新工作请登记任务,返工请重新派发原任务");
|
|
376
|
+
if (!["queue", "steer"].includes(deliveryMode))
|
|
377
|
+
throw new Error("deliveryMode 只能是 queue 或 steer");
|
|
378
|
+
const target = targetConversationId ?? task.ownerConversationId;
|
|
379
|
+
if (!target || ![task.ownerConversationId, task.reviewerConversationId].includes(target))
|
|
380
|
+
throw new Error("补充指令只能发送给本任务已有的执行或复核会话");
|
|
381
|
+
if (target === task.ownerConversationId)
|
|
382
|
+
this.assertWriteScope(p, task);
|
|
383
|
+
if (!busy(this.store.conversation(target)?.status))
|
|
384
|
+
this.admission(p);
|
|
385
|
+
const result = await this.dispatchContext(target, text(content, "补充指令"), { wait: false, mode: deliveryMode }, task.id);
|
|
386
|
+
this.event(p, "task_message", `向「${task.title}」发送补充指令(${deliveryMode === "steer" ? "下一工具边界" : "排队"}),附带当前共享上下文`, task.id, actor);
|
|
387
|
+
return result;
|
|
384
388
|
});
|
|
385
|
-
return result;
|
|
386
389
|
}
|
|
387
390
|
getContext(id, workspaceId, actor, taskId, contextIds) {
|
|
388
391
|
const p = id ? this.raw(id, workspaceId) : actor ? this.projectForSession(actor) : undefined;
|