@evandu/super-pi 0.1.37 → 0.1.39

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.
@@ -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-gxGpfFow.js"></script>
12
- <link rel="stylesheet" crossorigin href="/assets/index-w9qIR5vI.css">
11
+ <script type="module" crossorigin src="/assets/index-DSJuo0Bi.js"></script>
12
+ <link rel="stylesheet" crossorigin href="/assets/index-DX1yjXR8.css">
13
13
  </head>
14
14
  <body>
15
15
  <div id="root"></div>
@@ -903,7 +903,13 @@ export class Store {
903
903
  const message = this.requireConversation(conversationId).messages.find((item) => item.id === messageId);
904
904
  if (!message)
905
905
  throw new Error("Assistant message not found");
906
- const block = { ...structuredClone(question), id: id("question"), status: "pending" };
906
+ // `at` is WHERE IN THE ANSWER THE QUESTION WAS ASKED - the same character offset a tool call carries,
907
+ // and for the same reason. Without it a question is a list item with no position, so it renders after
908
+ // the whole message; and because the question BLOCKS, everything the model says after the answer
909
+ // lands in the text above it. Measured on a real turn: the model said nothing, asked, waited, and on
910
+ // being answered streamed 「已经调用 question 工具问完,停下来等你回答」 - which rendered ABOVE the card
911
+ // and read as though it had been said before the question was ever asked.
912
+ const block = { ...structuredClone(question), id: id("question"), status: "pending", at: message.content.length };
907
913
  (message.questionBlocks ??= []).push(block);
908
914
  await this.persistTransaction({ kind: "message.replace", conversationId, message: structuredClone(message), updatedAt: now() });
909
915
  return structuredClone(block);
@@ -63,6 +63,7 @@ export type QuestionBlock = {
63
63
  status: "pending" | "answered" | "cancelled";
64
64
  selected?: string[];
65
65
  extraNote?: string;
66
+ at?: number;
66
67
  };
67
68
  export type Message = {
68
69
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evandu/super-pi",
3
- "version": "0.1.37",
3
+ "version": "0.1.39",
4
4
  "description": "Web control plane and companion for Pi",
5
5
  "license": "MIT",
6
6
  "type": "module",