@evandu/super-pi 0.1.171 → 0.1.172
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/super-pi-task/core.ts +1 -1
- package/dist/client/.super-pi-client-sources.json +6 -6
- package/dist/client/assets/{CodeMirrorEditor-CzUeGDdc.js → CodeMirrorEditor-h5Lgdz_3.js} +2 -2
- package/dist/client/assets/{dist-DiclZJGi.js → dist-B-PKZdHA.js} +1 -1
- package/dist/client/assets/{dist-BpnlFbvg.js → dist-B-Tclw11.js} +1 -1
- package/dist/client/assets/{dist-BOiPOwIz.js → dist-BPJc8xEd.js} +1 -1
- package/dist/client/assets/{dist-BlVF_BSL.js → dist-BVAf90xY.js} +1 -1
- package/dist/client/assets/{dist-CtLhwtKR.js → dist-BoXi6lh_.js} +1 -1
- package/dist/client/assets/{dist-DWt_M7vb.js → dist-CDlFGYCW.js} +1 -1
- package/dist/client/assets/{dist-C2Ih1t5h.js → dist-Czz1x67j.js} +1 -1
- package/dist/client/assets/{dist-HVW2Jgge.js → dist-D6gr5pqd.js} +1 -1
- package/dist/client/assets/{dist-DpgtEKyP.js → dist-D6mzkemi.js} +1 -1
- package/dist/client/assets/{dist-C2V8B6YE.js → dist-DIiY94_o.js} +1 -1
- package/dist/client/assets/{dist-DyBgPEEv.js → dist-DOcCgywZ.js} +1 -1
- package/dist/client/assets/{dist-CGpm7VDj.js → dist-DRVVHWLf.js} +1 -1
- package/dist/client/assets/{dist-Dn_hEfpF.js → dist-DWz7Y91I.js} +1 -1
- package/dist/client/assets/{dist-DWWeqjij.js → dist-DXKO550C.js} +1 -1
- package/dist/client/assets/{dist-BCVQCJK1.js → dist-Dcnul-6B.js} +1 -1
- package/dist/client/assets/{dist-C2e4r6Qm.js → dist-Dx9rpWtS.js} +1 -1
- package/dist/client/assets/{dist-B26sLQy-.js → dist-DxPKLhGX.js} +1 -1
- package/dist/client/assets/{dist-b302HMV6.js → dist-Eo2NhsHU.js} +1 -1
- package/dist/client/assets/{dist-CUbRB6Gb.js → dist-QUteeo3-.js} +1 -1
- package/dist/client/assets/{dist-CjSFpJ5l.js → dist-TnqFFHgB.js} +1 -1
- package/dist/client/assets/{dist-CZh-o5Ms.js → dist-UdRCqiIc.js} +1 -1
- package/dist/client/assets/{dist-DSclOmZU.js → dist-sj7F10XG.js} +1 -1
- package/dist/client/assets/{index-BqO2dVq8.js → index-CY6jeMUM.js} +10 -10
- package/dist/client/assets/{index-DUNPa0xu.css → index-bobMbT_9.css} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/application/project-service.d.ts +44 -0
- package/dist/server/application/project-service.js +116 -6
- package/dist/server/store.js +18 -4
- package/package.json +6 -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-CY6jeMUM.js"></script>
|
|
12
|
+
<link rel="stylesheet" crossorigin href="/assets/index-bobMbT_9.css">
|
|
13
13
|
</head>
|
|
14
14
|
<body>
|
|
15
15
|
<div id="root"></div>
|
|
@@ -143,6 +143,29 @@ export declare class ProjectService {
|
|
|
143
143
|
* never less than one token more than the current cap, so the offer always really raises it.
|
|
144
144
|
*/
|
|
145
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;
|
|
146
169
|
private raw;
|
|
147
170
|
private workspace;
|
|
148
171
|
private event;
|
|
@@ -374,6 +397,27 @@ export declare class ProjectService {
|
|
|
374
397
|
raiseBudgetAndContinue(id: string, workspaceId: string, callerConversationId?: string): Promise<BudgetRaiseResult>;
|
|
375
398
|
addReport(id: string, input: Omit<ProjectReport, "id" | "projectId" | "createdAt">, workspaceId?: string, actor?: string): Promise<ProjectReport>;
|
|
376
399
|
addEscalation(id: string, input: Pick<ProjectEscalation, "reason" | "severity" | "taskId" | "title">, workspaceId?: string, actor?: string): Promise<ProjectEscalation>;
|
|
400
|
+
/**
|
|
401
|
+
* A DECISION ON A CLOSED PROJECT IS STILL A RECORD - AND A CLOSED PROJECT HAS NOBODY TO WAKE.
|
|
402
|
+
*
|
|
403
|
+
* THE TO-DO MUST NOT BE A DEAD END. `live()` refuses every write on a project that is
|
|
404
|
+
* completed, cancelled or failed, and that guard is right for the paths it protects - it stops
|
|
405
|
+
* a finished project from being quietly worked on again. But a decision is not a change to the
|
|
406
|
+
* work: it is the RECORD of what the reader decided ABOUT the work. The exception is still
|
|
407
|
+
* open, the question it asks is still unanswered, and the answer is worth keeping even when
|
|
408
|
+
* the project itself is over - the reader's own words ("授权我以现有两份独立实测记录结案")
|
|
409
|
+
* are exactly the thing the record is missing.
|
|
410
|
+
*
|
|
411
|
+
* So this path tells the two cases apart EXPLICITLY instead of bumping into the general guard:
|
|
412
|
+
*
|
|
413
|
+
* - the project is over: the decision is written into the exception (status, decision,
|
|
414
|
+
* resolvedAt) and into the timeline, and NOBODY is woken - the whole session tree has
|
|
415
|
+
* stopped, so waking is a gesture at an empty room;
|
|
416
|
+
* - the project is live: everything happens as it always did, including the wake.
|
|
417
|
+
*
|
|
418
|
+
* THE TIMELINE SAYS WHY NOBODY WAS WOKEN. A record that silently skips a step is a record the
|
|
419
|
+
* next reader has to guess about.
|
|
420
|
+
*/
|
|
377
421
|
resolveEscalation(id: string, escalationId: string, decision: string, status: "resolved" | "dismissed" | "returned", workspaceId?: string, actor?: string): Promise<ProjectEscalation>;
|
|
378
422
|
complete(id: string, summary: string, evidenceRefs: unknown, workspaceId: string, actor?: string): Promise<Project>;
|
|
379
423
|
/**
|
|
@@ -129,8 +129,32 @@ const dependenciesComplete = (p, t) => t.dependencies.every((id) => p.tasks.find
|
|
|
129
129
|
const CACHE_READ_WEIGHT = 0.1;
|
|
130
130
|
const CACHE_WRITE_WEIGHT = 1.25;
|
|
131
131
|
const tokens = (usage) => usage ? Math.round(usage.input + usage.output + usage.cacheWrite * CACHE_WRITE_WEIGHT + usage.cacheRead * CACHE_READ_WEIGHT) : 0;
|
|
132
|
-
/**
|
|
133
|
-
|
|
132
|
+
/**
|
|
133
|
+
* THE BUDGET A PROJECT STARTS WITH, AND THE FALLBACK A BUDGETLESS PROJECT IS READ AT.
|
|
134
|
+
*
|
|
135
|
+
* 400,000 equivalent tokens, and the number is measured rather than guessed: one real project
|
|
136
|
+
* with two tasks, each with an independent review, spent 378,424 equivalent tokens (1,448,095
|
|
137
|
+
* raw) and stopped ONE REVIEW SHORT of done at exactly this kind of cap. A task with its review
|
|
138
|
+
* costs about 190,000 equivalent tokens - roughly 20 turns at about 9,500 equivalent tokens a
|
|
139
|
+
* turn - so 400,000 carries a simple project end to end.
|
|
140
|
+
*
|
|
141
|
+
* THE OLD 100,000 WAS NOT A BUDGET, IT WAS A WALL: it could not finish one task and its review,
|
|
142
|
+
* and the project that hit it was closed as cancelled with the work already delivered. A cap that
|
|
143
|
+
* is too low does not slow a project down, it kills it; a cap that is too high only means the
|
|
144
|
+
* ceiling printed on the panel is higher than the spend. So the default is set from what a real
|
|
145
|
+
* project actually costs, and the agent is told to compute its own number on top of it.
|
|
146
|
+
*/
|
|
147
|
+
const DEFAULT_MAX_TOKENS = 400_000;
|
|
148
|
+
/**
|
|
149
|
+
* A REASON THAT SAYS "THIS IS ABOUT THE BUDGET".
|
|
150
|
+
*
|
|
151
|
+
* The word the escalation carries is what tells the reader (and the server) that the case in
|
|
152
|
+
* front of them is a budget case and not a permission case or a scope case. It is matched in
|
|
153
|
+
* both languages because the agent writes in both languages, and it is matched LOOSELY on
|
|
154
|
+
* purpose: an agent that says "撞到上限了" or "tokens" has said the same thing as one that says
|
|
155
|
+
* "预算".
|
|
156
|
+
*/
|
|
157
|
+
const BUDGET_CASE = /(预算|budget|token|上限|额度)/i;
|
|
134
158
|
/**
|
|
135
159
|
* HOW MANY PROJECTS ONE LIST CALL MAY CARRY.
|
|
136
160
|
*
|
|
@@ -178,6 +202,14 @@ const REPORT_KIND_TEXT = {
|
|
|
178
202
|
};
|
|
179
203
|
/** ONE LINE, ONE MEANING: a value that carries newlines must not break the layout of the report. */
|
|
180
204
|
const oneLine = (value) => value.replace(/\r?\n+/g, " ").trim();
|
|
205
|
+
/**
|
|
206
|
+
* A NUMBER A PERSON READS AT A GLANCE, AND THE SAME WAY ON EVERY MACHINE.
|
|
207
|
+
*
|
|
208
|
+
* `toLocaleString` follows the machine's locale, so the same budget is printed as "378,424" in
|
|
209
|
+
* one place and "378424" in another. Two spellings of one number is a number nobody can check
|
|
210
|
+
* against the one on the panel, so the separator is written here instead of asked for.
|
|
211
|
+
*/
|
|
212
|
+
const grouped = (value) => Math.round(value).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
181
213
|
/** A table cell must not carry a pipe of its own, or the row it sits in falls apart. */
|
|
182
214
|
const cell = (value) => oneLine(value).replace(/\|/g, "\\|");
|
|
183
215
|
/** A long delivery is trimmed, and the trim says so - a silent cut would read as the whole truth. */
|
|
@@ -320,6 +352,36 @@ export class ProjectService {
|
|
|
320
352
|
const current = p.budget?.maxTokens ?? DEFAULT_MAX_TOKENS;
|
|
321
353
|
return Math.max(current + 1, usedTokens * 2);
|
|
322
354
|
}
|
|
355
|
+
/**
|
|
356
|
+
* THE BUDGET PARAGRAPH A BUDGET EXCEPTION CARRIES - AND ONLY A BUDGET EXCEPTION.
|
|
357
|
+
*
|
|
358
|
+
* WHY THE EXCEPTION TEXT NEEDS THIS. A budget exception used to reach the Boss as one line -
|
|
359
|
+
* "请批准追加预算派发复核者" - and that line says nothing about WHO is at fault. The Boss reads
|
|
360
|
+
* it as "the Boss did not approve enough", while the truth is often "the agent set the cap too
|
|
361
|
+
* low when the project was created". Only one of those two readings leads to a fix, and the
|
|
362
|
+
* wrong one leads to approving a budget that runs into the same wall one task later.
|
|
363
|
+
*
|
|
364
|
+
* SO THE SERVER WRITES THE NUMBERS, because only the server has them: the effective usage in
|
|
365
|
+
* the §5 unit (输入 + 输出 + 缓存写入 × 1.25 + 缓存读取 × 0.1), the cap, and the number the
|
|
366
|
+
* one-click raise would offer - the very number the panel shows, so the two can never disagree.
|
|
367
|
+
*
|
|
368
|
+
* AND IT SAYS THE UNCOMFORTABLE PART OUT LOUD - 「可能是我一开始把预算填小了」. The words are in
|
|
369
|
+
* the project's own voice, because that is the voice an exception already speaks in, and an
|
|
370
|
+
* exception that never names the possibility is a case written to be approved as it stands.
|
|
371
|
+
*
|
|
372
|
+
* ONLY A BUDGET CASE GETS THESE WORDS. An exception about permissions or about scope must not
|
|
373
|
+
* carry budget numbers: a reader who sees a budget on a permission case stops reading the
|
|
374
|
+
* case. `BUDGET_CASE` decides, and it is matched on the agent's own words - the agent that
|
|
375
|
+
* says 「撞到上限了」 has said the same thing as one that says 「预算」.
|
|
376
|
+
*/
|
|
377
|
+
budgetExceptionNote(p, reason) {
|
|
378
|
+
if (!BUDGET_CASE.test(reason))
|
|
379
|
+
return undefined;
|
|
380
|
+
const used = this.resources(p).tokens;
|
|
381
|
+
const cap = p.budget?.maxTokens ?? DEFAULT_MAX_TOKENS;
|
|
382
|
+
const suggested = this.suggestedMaxTokens(p, used);
|
|
383
|
+
return `【预算说明】当前有效用量 ${grouped(used)} 等效 Token,上限 ${grouped(cap)} 等效 Token;建议提到 ${grouped(suggested)} 等效 Token(面板上「提到 N Token 并继续」用的就是这一个数)。口径:输入 + 输出 + 缓存写入 × 1.25 + 缓存读取 × 0.1。可能是我一开始把预算填小了:请按「任务数 × 每任务轮数 × 每轮上下文」重新估算,一个任务连它的独立复核约 190,000 等效 Token,宁可多给 —— 预算不够时项目会被卡住,并以取消收口。`;
|
|
384
|
+
}
|
|
323
385
|
raw(id, workspaceId) {
|
|
324
386
|
const scope = this.workspace(workspaceId);
|
|
325
387
|
const p = this.store.project(id);
|
|
@@ -1702,11 +1764,17 @@ export class ProjectService {
|
|
|
1702
1764
|
? "独立复核"
|
|
1703
1765
|
: "执行者";
|
|
1704
1766
|
}
|
|
1767
|
+
const reason = text(input.reason, "升级原因");
|
|
1768
|
+
/* THE BUDGET CASE GETS ITS NUMBERS HERE, WHERE THEY ARE KNOWN. A budget exception without
|
|
1769
|
+
the usage, the cap and the suggested number leaves the reader to guess, and the guess is
|
|
1770
|
+
always "the Boss did not approve enough". A non-budget exception gets no budget words at
|
|
1771
|
+
all - see `budgetExceptionNote`. */
|
|
1772
|
+
const budgetNote = this.budgetExceptionNote(p, reason);
|
|
1705
1773
|
const e = {
|
|
1706
1774
|
id: randomUUID(),
|
|
1707
1775
|
projectId: id,
|
|
1708
1776
|
taskId: t?.id,
|
|
1709
|
-
reason:
|
|
1777
|
+
reason: budgetNote ? `${reason}\n\n${budgetNote}` : reason,
|
|
1710
1778
|
/* THE QUESTION IS KEPT BESIDE THE CASE. The title is what the reader decides ON - one
|
|
1711
1779
|
sentence, in the reader's terms - and the reason is the case for it. An escalation
|
|
1712
1780
|
* without a title is still a valid escalation; it simply has to be read in full. */
|
|
@@ -1728,9 +1796,38 @@ export class ProjectService {
|
|
|
1728
1796
|
}
|
|
1729
1797
|
return result;
|
|
1730
1798
|
}
|
|
1799
|
+
/**
|
|
1800
|
+
* A DECISION ON A CLOSED PROJECT IS STILL A RECORD - AND A CLOSED PROJECT HAS NOBODY TO WAKE.
|
|
1801
|
+
*
|
|
1802
|
+
* THE TO-DO MUST NOT BE A DEAD END. `live()` refuses every write on a project that is
|
|
1803
|
+
* completed, cancelled or failed, and that guard is right for the paths it protects - it stops
|
|
1804
|
+
* a finished project from being quietly worked on again. But a decision is not a change to the
|
|
1805
|
+
* work: it is the RECORD of what the reader decided ABOUT the work. The exception is still
|
|
1806
|
+
* open, the question it asks is still unanswered, and the answer is worth keeping even when
|
|
1807
|
+
* the project itself is over - the reader's own words ("授权我以现有两份独立实测记录结案")
|
|
1808
|
+
* are exactly the thing the record is missing.
|
|
1809
|
+
*
|
|
1810
|
+
* So this path tells the two cases apart EXPLICITLY instead of bumping into the general guard:
|
|
1811
|
+
*
|
|
1812
|
+
* - the project is over: the decision is written into the exception (status, decision,
|
|
1813
|
+
* resolvedAt) and into the timeline, and NOBODY is woken - the whole session tree has
|
|
1814
|
+
* stopped, so waking is a gesture at an empty room;
|
|
1815
|
+
* - the project is live: everything happens as it always did, including the wake.
|
|
1816
|
+
*
|
|
1817
|
+
* THE TIMELINE SAYS WHY NOBODY WAS WOKEN. A record that silently skips a step is a record the
|
|
1818
|
+
* next reader has to guess about.
|
|
1819
|
+
*/
|
|
1731
1820
|
async resolveEscalation(id, escalationId, decision, status, workspaceId, actor) {
|
|
1821
|
+
/* Whether the project was over when the decision was made. It is read inside the write, and
|
|
1822
|
+
read again afterwards - because the wake happens after the write is released. */
|
|
1823
|
+
let projectEnded = false;
|
|
1732
1824
|
const result = await this.change(id, workspaceId, (p) => {
|
|
1733
|
-
|
|
1825
|
+
projectEnded = closed(p);
|
|
1826
|
+
/* `live()` IS NOT CALLED HERE, AND THAT IS THE POINT. It protects the paths that change a
|
|
1827
|
+
project's work; this path changes the record of a decision, and on a closed project the
|
|
1828
|
+
decision is precisely what is still missing. Every OTHER reason to refuse stays: an
|
|
1829
|
+
unknown exception, one that has been handled already, a status that is not one of the
|
|
1830
|
+
three, and an actor who is not the one the exception is addressed to. */
|
|
1734
1831
|
if (status !== "resolved" && status !== "dismissed" && status !== "returned")
|
|
1735
1832
|
throw new Error("升级处理状态不合法");
|
|
1736
1833
|
const e = p.escalations.find((e) => e.id === escalationId);
|
|
@@ -1756,12 +1853,25 @@ export class ProjectService {
|
|
|
1756
1853
|
const decider = audience === "boss" ? "Boss" : "直接上级";
|
|
1757
1854
|
/* A RETURN IS NOT A DECISION. It says the case was not ready - the reader is being asked
|
|
1758
1855
|
* for more material, not for a ruling - so the timeline says so in those words. */
|
|
1856
|
+
/* AND ON A CLOSED PROJECT THE TIMELINE ALSO SAYS THAT NOBODY WAS WOKEN. The decision is
|
|
1857
|
+
* recorded, but the session tree has stopped: a reader who comes back to this project
|
|
1858
|
+
* later must be able to tell "the answer was written down" from "the answer was sent to
|
|
1859
|
+
* somebody", and on a cancelled project those are two different things. */
|
|
1860
|
+
const endedNote = status === "returned"
|
|
1861
|
+
? "(项目已结束:退回意见已记入项目记录;项目已结束,没人可叫醒,未唤醒提出人)"
|
|
1862
|
+
: "(项目已结束:处理意见已记入项目记录,未唤醒任何人——没人可叫醒)";
|
|
1759
1863
|
this.event(p, "decision", status === "returned"
|
|
1760
|
-
? `${decider}退回例外,等待补充材料:${e.decision}`
|
|
1761
|
-
: `${decider}决策:${e.decision}`, e.taskId, actor);
|
|
1864
|
+
? `${decider}退回例外,等待补充材料:${e.decision}${projectEnded ? endedNote : ""}`
|
|
1865
|
+
: `${decider}决策:${e.decision}${projectEnded ? endedNote : ""}`, e.taskId, actor);
|
|
1762
1866
|
this.reconcile(p);
|
|
1763
1867
|
return e;
|
|
1764
1868
|
}, actor);
|
|
1869
|
+
/* A CLOSED PROJECT HAS NO SESSION TREE TO WAKE. Every session under it has stopped, so a
|
|
1870
|
+
wake would be a gesture at an empty room - and the failure it would produce (a dispatch to
|
|
1871
|
+
a session that is not running) would be noise on a decision that was recorded perfectly
|
|
1872
|
+
well. The timeline already says that nobody was woken, so the silence is explained. */
|
|
1873
|
+
if (projectEnded)
|
|
1874
|
+
return result;
|
|
1765
1875
|
/* THE CASE GOES BACK TO WHO RAISED IT. A returned escalation leaves the inbox without being
|
|
1766
1876
|
* answered, so nobody would ever know it was still open - unless the person who raised it is
|
|
1767
1877
|
* woken up and told to bring the missing material. This is the one wake that is NOT about a
|
package/dist/server/store.js
CHANGED
|
@@ -1733,11 +1733,25 @@ export class Store {
|
|
|
1733
1733
|
throw new Error("找不到对应的助手消息。");
|
|
1734
1734
|
message.thinking = `${message.thinking ?? ""}${delta}`;
|
|
1735
1735
|
const blocks = (message.thinkingBlocks ??= []);
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1736
|
+
// WHERE THE FRAGMENT BELONGS. The offset is where the block sits in the answer, and every block
|
|
1737
|
+
// keeps the offset it opened with, so the offset is what says which block a fragment continues.
|
|
1738
|
+
//
|
|
1739
|
+
// THE LAST SUCH BLOCK, because that is the one that was open. Two blocks can share an offset -
|
|
1740
|
+
// the answer does not move while a tool call happens, so the reasoning that comes back after the
|
|
1741
|
+
// call opens a second block at the same place - and the earlier of the two is a stretch of
|
|
1742
|
+
// reasoning the model has already left. The browser files the same fragment under the block the
|
|
1743
|
+
// server names, so the two sides have to pick the same one.
|
|
1744
|
+
const at0 = at ?? message.content.length;
|
|
1745
|
+
let same = -1;
|
|
1746
|
+
for (let index = blocks.length - 1; index >= 0; index -= 1)
|
|
1747
|
+
if (blocks[index].at === at0) {
|
|
1748
|
+
same = index;
|
|
1749
|
+
break;
|
|
1750
|
+
}
|
|
1751
|
+
if (!newBlock && same >= 0)
|
|
1752
|
+
blocks[same].text += delta;
|
|
1739
1753
|
else
|
|
1740
|
-
blocks.push({ at:
|
|
1754
|
+
blocks.push({ at: at0, text: delta });
|
|
1741
1755
|
conversation.updatedAt = now();
|
|
1742
1756
|
}
|
|
1743
1757
|
setThinkingActiveLive(conversationId, messageId, active) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@evandu/super-pi",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.172",
|
|
4
4
|
"description": "Web control plane and companion for Pi",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
"scripts/agent-order.test.mjs",
|
|
52
52
|
"scripts/agent-picker-order.test.mjs",
|
|
53
53
|
"scripts/inline-thinking.test.mjs",
|
|
54
|
+
"scripts/thinking-block-identity.test.mjs",
|
|
54
55
|
"scripts/inline-thinking-close-tag.test.mjs",
|
|
55
56
|
"scripts/pi-session.test.mjs",
|
|
56
57
|
"scripts/length-continuation.test.mjs",
|
|
@@ -87,10 +88,12 @@
|
|
|
87
88
|
"scripts/session-result-callback-e2e.test.mjs",
|
|
88
89
|
"scripts/session-orchestrator-tools.test.mjs",
|
|
89
90
|
"scripts/project-service.test.mjs",
|
|
91
|
+
"scripts/dead-end-decision.test.mjs",
|
|
90
92
|
"scripts/project-report-exception-title.test.mjs",
|
|
91
93
|
"scripts/project-api-scope.test.mjs",
|
|
92
94
|
"scripts/project-report-chain.test.mjs",
|
|
93
95
|
"scripts/project-tool-surface-parity.test.mjs",
|
|
96
|
+
"scripts/budget-sizing.test.mjs",
|
|
94
97
|
"scripts/session-tree-collapse.test.mjs",
|
|
95
98
|
"scripts/archive-cascade.test.mjs",
|
|
96
99
|
"scripts/workspace-cwd.test.mjs",
|
|
@@ -274,6 +277,7 @@
|
|
|
274
277
|
"scripts/primary-employee-guard-browser.test.mjs",
|
|
275
278
|
"scripts/project-evidence-panel-browser.test.mjs",
|
|
276
279
|
"scripts/project-panel-fixes-browser.test.mjs",
|
|
280
|
+
"scripts/dead-end-decision-browser.test.mjs",
|
|
277
281
|
"scripts/boss-approval-readability-browser.test.mjs",
|
|
278
282
|
"scripts/prose-tidying-browser.test.mjs",
|
|
279
283
|
"scripts/builtin-agents-project-browser.test.mjs",
|
|
@@ -287,6 +291,7 @@
|
|
|
287
291
|
"scripts/dead-default-agent-browser.test.mjs",
|
|
288
292
|
"scripts/assistant-working-indicator-browser.test.mjs",
|
|
289
293
|
"scripts/thinking-first-delta-once-browser.test.mjs",
|
|
294
|
+
"scripts/thinking-block-identity-browser.test.mjs",
|
|
290
295
|
"scripts/files-tab-browser.test.mjs",
|
|
291
296
|
"scripts/editor-blame-browser.test.mjs",
|
|
292
297
|
"scripts/file-panel-external-poll-browser.test.mjs",
|