@evandu/super-pi 0.1.262 → 0.1.263
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 +5 -5
- package/dist/client/assets/{CodeMirrorEditor-DRcRXwhV.js → CodeMirrorEditor-EhfQhlNI.js} +1 -1
- package/dist/client/assets/{GitDiffEditor-Cm0JVvdZ.js → GitDiffEditor-Fd--uK9q.js} +1 -1
- package/dist/client/assets/{index-BZd7RTFi.js → index-Cs_T0IFR.js} +4 -4
- package/dist/client/assets/index-D6ei0DbU.css +1 -0
- package/dist/client/index.html +2 -2
- package/dist/server/application/group-chat-service.js +10 -1
- package/dist/server/runtime.d.ts +1 -0
- package/dist/server/runtime.js +12 -0
- package/dist/shared/group-chat.d.ts +1 -0
- package/package.json +2 -1
- package/dist/client/assets/index-DHTKUM97.css +0 -1
package/dist/client/index.html
CHANGED
|
@@ -8,9 +8,9 @@
|
|
|
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-
|
|
11
|
+
<script type="module" crossorigin src="/assets/index-Cs_T0IFR.js"></script>
|
|
12
12
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-XKyaHtl9.js">
|
|
13
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
13
|
+
<link rel="stylesheet" crossorigin href="/assets/index-D6ei0DbU.css">
|
|
14
14
|
</head>
|
|
15
15
|
<body>
|
|
16
16
|
<div id="root"></div>
|
|
@@ -433,7 +433,8 @@ export class GroupChatService {
|
|
|
433
433
|
}
|
|
434
434
|
async configure(workspaceId, id, input) {
|
|
435
435
|
const current = this.activeRoom(this.rooms, workspaceId, id);
|
|
436
|
-
const moderator =
|
|
436
|
+
const moderator = ["model", "prompt", "cloneLimit"].some(key => Object.hasOwn(input, key))
|
|
437
|
+
? await this.moderator(workspaceId, { ...current.moderator, ...input }) : current.moderator;
|
|
437
438
|
const members = input.memberIds === undefined && input.memberModels === undefined ? undefined
|
|
438
439
|
: await this.memberModels(workspaceId, input.memberIds === undefined ? current.members : await this.resolveMembers(id, input.memberIds, current.members), input.memberModels);
|
|
439
440
|
await this.edit(rooms => {
|
|
@@ -912,6 +913,14 @@ export class GroupChatService {
|
|
|
912
913
|
const answer = await this.complete(started, {
|
|
913
914
|
prompt: `群内身份:${member?.name ?? agent.name}。${member?.worktreePath ? "你在独立工作树工作;报告分支和产物供后续审查整合。" : ""}\n${prompt}`, cwd: member?.worktreePath,
|
|
914
915
|
agent, model: member?.model ?? (agent.model && { ...agent.model, label: agent.model.modelId }), signal: memberSignal, timeoutMs: 15 * 60_000,
|
|
916
|
+
onModel: model => this.edit(rooms => {
|
|
917
|
+
const room = rooms.find(item => item.id === roomId);
|
|
918
|
+
const post = room?.messages.find(item => item.id === reply.id);
|
|
919
|
+
if (!room || post?.role !== "assistant" || post.status !== "running")
|
|
920
|
+
return;
|
|
921
|
+
post.model = { provider: model.provider, modelId: model.modelId, label: model.label };
|
|
922
|
+
room.revision += 1;
|
|
923
|
+
}),
|
|
915
924
|
onToolStart: goBackground,
|
|
916
925
|
onExecution: event => {
|
|
917
926
|
if (memberSignal.aborted || !execution.record(event))
|
package/dist/server/runtime.d.ts
CHANGED
|
@@ -271,6 +271,7 @@ export type IsolatedCompletionInput = {
|
|
|
271
271
|
onText?: (text: string) => void;
|
|
272
272
|
onToolStart?: () => void;
|
|
273
273
|
onExecution?: (event: IsolatedExecutionEvent) => void;
|
|
274
|
+
onModel?: (model: ModelSelection) => void | Promise<void>;
|
|
274
275
|
};
|
|
275
276
|
export interface AgentRuntime {
|
|
276
277
|
answer(input: AnswerInput): AsyncIterable<string>;
|
package/dist/server/runtime.js
CHANGED
|
@@ -2681,6 +2681,18 @@ export class PiRpcRuntime {
|
|
|
2681
2681
|
if (response.success !== true)
|
|
2682
2682
|
throw new Error(response.error || "Pi 无法选择指定模型");
|
|
2683
2683
|
}
|
|
2684
|
+
if (input.onModel) {
|
|
2685
|
+
let selected = input.model;
|
|
2686
|
+
try {
|
|
2687
|
+
const state = await channel.request({ id: "isolated_state", type: "get_state" }, Math.min(input.timeoutMs, 2_000));
|
|
2688
|
+
const actual = state.success === true ? describeModel(state.data?.model) : undefined;
|
|
2689
|
+
if (actual)
|
|
2690
|
+
selected = { provider: actual.provider, modelId: actual.modelId, label: actual.label };
|
|
2691
|
+
}
|
|
2692
|
+
catch { /* An explicitly selected model is already confirmed by set_model. */ }
|
|
2693
|
+
if (selected)
|
|
2694
|
+
await input.onModel(selected);
|
|
2695
|
+
}
|
|
2684
2696
|
input.signal?.throwIfAborted();
|
|
2685
2697
|
channel.write({ id: "tool_llm", type: "prompt", message: input.prompt });
|
|
2686
2698
|
let settled = false, text = "";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@evandu/super-pi",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.263",
|
|
4
4
|
"description": "Web control plane and companion for Pi",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -348,6 +348,7 @@
|
|
|
348
348
|
"scripts/right-sidebar-browser.test.mjs",
|
|
349
349
|
"scripts/background-task-output-browser.test.mjs",
|
|
350
350
|
"scripts/group-chat-browser.test.mjs",
|
|
351
|
+
"scripts/group-model-switch-browser.test.mjs",
|
|
351
352
|
"scripts/workbench-search-panel-browser.test.mjs",
|
|
352
353
|
"scripts/rail-workspace-follows-session-browser.test.mjs",
|
|
353
354
|
"scripts/git-tab-browser.test.mjs",
|