@evandu/super-pi 0.1.93 → 0.1.95
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 +6 -5
- package/agents/super-pi-task/index.ts +2 -1
- package/dist/.super-pi-check-inputs.json +2 -2
- package/dist/client/.super-pi-client-sources.json +4 -4
- package/dist/client/assets/{index-mdc5jJ6R.css → index-8olCbCbk.css} +1 -1
- package/dist/client/assets/{index-CjTv3vNA.js → index-gjLqMWYT.js} +3 -3
- package/dist/client/index.html +2 -2
- package/dist/server/agents.d.ts +18 -0
- package/dist/server/agents.js +39 -0
- package/dist/server/application/run-service.d.ts +47 -3
- package/dist/server/application/run-service.js +158 -88
- package/dist/server/capability.d.ts +28 -12
- package/dist/server/capability.js +54 -20
- package/dist/server/http-server.js +14 -6
- package/dist/server/index.js +10 -1
- package/dist/server/pi-command.d.ts +29 -1
- package/dist/server/pi-command.js +58 -5
- package/dist/server/pi-session-events.d.ts +111 -0
- package/dist/server/pi-session-events.js +291 -0
- package/dist/server/pi-session-pool.d.ts +166 -0
- package/dist/server/pi-session-pool.js +262 -0
- package/dist/server/pi-session.d.ts +204 -0
- package/dist/server/pi-session.js +226 -0
- package/dist/server/runtime.d.ts +243 -29
- package/dist/server/runtime.js +634 -60
- package/dist/server/store.js +4 -4
- package/dist/server/ws-server.js +5 -4
- package/package.json +3 -1
package/dist/server/store.js
CHANGED
|
@@ -1556,18 +1556,18 @@ export class Store {
|
|
|
1556
1556
|
const waiting = this.waitingMessages(conversation);
|
|
1557
1557
|
const from = waiting.indexOf(message);
|
|
1558
1558
|
const target = Math.max(0, Math.min(Math.trunc(toIndex), waiting.length - 1));
|
|
1559
|
-
if (target === from)
|
|
1560
|
-
return structuredClone(message);
|
|
1561
1559
|
// NOTHING MAY OCCUPY THE `sending` MESSAGE'S SLOT, in either direction. It is already in Pi's stdin and
|
|
1562
1560
|
// Pi's steering queue is FIFO, so it is delivered next whatever this method does - meaning a different
|
|
1563
1561
|
// message landing in front of it would be a move the UI performed and the transport then ignored, and
|
|
1564
1562
|
// moving the `sending` message itself off that spot would be a lie of the same kind.
|
|
1565
|
-
const
|
|
1566
|
-
if (
|
|
1563
|
+
const lastSendingIndex = waiting.reduce((last, item, index) => item.delivery === "sending" ? index : last, -1);
|
|
1564
|
+
if (lastSendingIndex >= 0 && (message.delivery === "sending" || target <= lastSendingIndex)) {
|
|
1567
1565
|
throw new Error(message.delivery === "sending"
|
|
1568
1566
|
? "这条消息已经交给 Agent 了,挪不动(Pi 会先回答已经收到的那条)"
|
|
1569
1567
|
: "前面那条消息已经交给 Agent 了,插不过去(Pi 按收到的顺序送达)");
|
|
1570
1568
|
}
|
|
1569
|
+
if (target === from)
|
|
1570
|
+
return structuredClone(message);
|
|
1571
1571
|
// Permute THE WAITING SLOTS rather than splicing a message to an index. The waiting messages are
|
|
1572
1572
|
// usually a suffix of the array, but they are not guaranteed to be one - an assistant message sits
|
|
1573
1573
|
// between two of them once a steer has been delivered mid-turn - and an offset derived from "where in
|
package/dist/server/ws-server.js
CHANGED
|
@@ -222,10 +222,11 @@ export class WsServer {
|
|
|
222
222
|
this.broadcaster.configureStreaming(socket, parsed.coalesce);
|
|
223
223
|
return;
|
|
224
224
|
}
|
|
225
|
-
// A send
|
|
226
|
-
//
|
|
227
|
-
//
|
|
228
|
-
const runIndependently = parsed.type === "message.send" || parsed.type === "
|
|
225
|
+
// A send or selected queued turn is a streaming operation. It must leave the socket's command
|
|
226
|
+
// chain immediately: waiting for the model turn would block later priority/cancel commands and
|
|
227
|
+
// make a second send miss the durable queue. The service owns per-conversation run claims.
|
|
228
|
+
const runIndependently = parsed.type === "message.send" || parsed.type === "message.sendQueued"
|
|
229
|
+
|| parsed.type === "message.interrupt" || parsed.type === "run.stop";
|
|
229
230
|
// ...WHICH MEANS A SEND CAN OVERTAKE A REVERT SENT JUST BEFORE IT, because the revert below is
|
|
230
231
|
// queued behind whatever this socket was already doing. The service only learns it is cutting
|
|
231
232
|
// when the command EXECUTES, so a send handled in between would find the conversation open and
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@evandu/super-pi",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.95",
|
|
4
4
|
"description": "Web control plane and companion for Pi",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"check:logic": [
|
|
41
41
|
"scripts/stream-checkpoint.test.mjs",
|
|
42
42
|
"scripts/stream-transport.test.mjs",
|
|
43
|
+
"scripts/pi-session.test.mjs",
|
|
43
44
|
"scripts/lan-access.test.mjs",
|
|
44
45
|
"scripts/terminal-pty.test.mjs",
|
|
45
46
|
"scripts/persistence-repository.test.mjs",
|
|
@@ -141,6 +142,7 @@
|
|
|
141
142
|
"scripts/knowledge-base-browser.test.mjs"
|
|
142
143
|
],
|
|
143
144
|
"dependencies": {
|
|
145
|
+
"@earendil-works/pi-coding-agent": "^0.86.1",
|
|
144
146
|
"@xterm/addon-fit": "^0.11.0",
|
|
145
147
|
"@xterm/xterm": "^6.0.0",
|
|
146
148
|
"node-pty": "^1.2.0-beta.15",
|