@evandu/super-pi 0.1.92 → 0.1.94
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/.super-pi-check-inputs.json +2 -2
- package/dist/client/.super-pi-client-sources.json +4 -4
- package/dist/client/assets/{index-Db0poZWq.css → index-8olCbCbk.css} +1 -1
- package/dist/client/assets/{index-DxMdKg12.js → index-zbxFjL-O.js} +5 -4
- package/dist/client/index.html +2 -2
- package/dist/server/application/run-service.d.ts +4 -0
- package/dist/server/application/run-service.js +10 -5
- package/package.json +1 -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-zbxFjL-O.js"></script>
|
|
12
|
+
<link rel="stylesheet" crossorigin href="/assets/index-8olCbCbk.css">
|
|
13
13
|
</head>
|
|
14
14
|
<body>
|
|
15
15
|
<div id="root"></div>
|
|
@@ -256,6 +256,10 @@ export declare class RunService {
|
|
|
256
256
|
* branch (which only call it when `!this.activeRuns.has(conversationId)`). The two callers differ
|
|
257
257
|
* only in who arrived first; the open-turn-and-run contract is the same.
|
|
258
258
|
*
|
|
259
|
+
* `runConversationTurns` owns opening the first turn. It must be the ONLY opener: opening here and
|
|
260
|
+
* then asking that loop to run the same message used to splice two assistant placeholders under one
|
|
261
|
+
* queued item. The first got no deltas, which rendered as a stray avatar before the real response.
|
|
262
|
+
*
|
|
259
263
|
* `composePrompt` is what makes the `role: "tool"` path real - the `<task>` envelope stays in the
|
|
260
264
|
* transcript, but the prose form of the same fact is what reaches Pi.
|
|
261
265
|
*/
|
|
@@ -1137,6 +1137,10 @@ export class RunService {
|
|
|
1137
1137
|
* branch (which only call it when `!this.activeRuns.has(conversationId)`). The two callers differ
|
|
1138
1138
|
* only in who arrived first; the open-turn-and-run contract is the same.
|
|
1139
1139
|
*
|
|
1140
|
+
* `runConversationTurns` owns opening the first turn. It must be the ONLY opener: opening here and
|
|
1141
|
+
* then asking that loop to run the same message used to splice two assistant placeholders under one
|
|
1142
|
+
* queued item. The first got no deltas, which rendered as a stray avatar before the real response.
|
|
1143
|
+
*
|
|
1140
1144
|
* `composePrompt` is what makes the `role: "tool"` path real - the `<task>` envelope stays in the
|
|
1141
1145
|
* transcript, but the prose form of the same fact is what reaches Pi.
|
|
1142
1146
|
*/
|
|
@@ -1148,11 +1152,12 @@ export class RunService {
|
|
|
1148
1152
|
this.activeRuns.set(conversationId, controller);
|
|
1149
1153
|
try {
|
|
1150
1154
|
const { conversation, workspace } = this.turnContext(conversationId);
|
|
1151
|
-
const
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
this
|
|
1155
|
-
|
|
1155
|
+
const message = conversation.messages.find((item) => item.id === messageId);
|
|
1156
|
+
if (!message)
|
|
1157
|
+
throw new Error("消息不存在或已被撤回");
|
|
1158
|
+
// Do not call openTurnOnSpecificMessage here. runConversationTurns opens this exact first
|
|
1159
|
+
// message before streaming it, which creates one assistant placeholder and one only.
|
|
1160
|
+
await this.runConversationTurns(conversation, workspace, composePrompt(message), controller, message.id, message.images);
|
|
1156
1161
|
await this.store.setStatus(conversationId, controller.signal.aborted ? "stopped" : "completed");
|
|
1157
1162
|
}
|
|
1158
1163
|
catch (error) {
|