@evandu/super-pi 0.1.166 → 0.1.168
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 +8 -9
- package/dist/client/assets/{CodeMirrorEditor-q5ckKYpW.js → CodeMirrorEditor-DWEFdLq1.js} +2 -2
- package/dist/client/assets/{dist-DMynScoj.js → dist-0cjcfZm8.js} +1 -1
- package/dist/client/assets/{dist-_pAt4bRw.js → dist-3mX68Ead.js} +1 -1
- package/dist/client/assets/{dist-CXXAxAE4.js → dist-84wmy0xb.js} +1 -1
- package/dist/client/assets/{dist-dbLsO_41.js → dist-B19er0Hr.js} +1 -1
- package/dist/client/assets/{dist-DSIy9Ers.js → dist-BWN1gFkd.js} +1 -1
- package/dist/client/assets/{dist-DRHWMjx_.js → dist-Bh9F9CwL.js} +1 -1
- package/dist/client/assets/{dist-DiqGp2ie.js → dist-BiVenLEE.js} +1 -1
- package/dist/client/assets/{dist-D10kcMrw.js → dist-Bp858rkg.js} +1 -1
- package/dist/client/assets/{dist-BT3fZ0wT.js → dist-BsaizV0U.js} +1 -1
- package/dist/client/assets/{dist-bLHDT2q5.js → dist-BygS3RZC.js} +1 -1
- package/dist/client/assets/{dist-CyTiEqGG.js → dist-CPZVRFqI.js} +1 -1
- package/dist/client/assets/{dist-3Qp_-Z3t.js → dist-CXIdy9EI.js} +1 -1
- package/dist/client/assets/{dist-BN9HZG4O.js → dist-Co6-VsRy.js} +1 -1
- package/dist/client/assets/{dist-B_l0KBjV.js → dist-D5SNpvpB.js} +1 -1
- package/dist/client/assets/{dist-B61EUjUz.js → dist-D9UIUBjg.js} +1 -1
- package/dist/client/assets/{dist-YFQ3ixZU.js → dist-DR3gLDod.js} +1 -1
- package/dist/client/assets/{dist-Cs1P7JrO.js → dist-DTYN3KZG.js} +1 -1
- package/dist/client/assets/{dist-DdfZJR8e.js → dist-ELtcJv97.js} +1 -1
- package/dist/client/assets/{dist-Crew6BC1.js → dist-H7kWZ7Cr.js} +1 -1
- package/dist/client/assets/{dist-Bb-gT7aj.js → dist-XSVtuaKi.js} +1 -1
- package/dist/client/assets/{dist-CBqBGuBl.js → dist-ei0l0QpD.js} +1 -1
- package/dist/client/assets/{dist-BOU0i9JW.js → dist-i063EgJc.js} +1 -1
- package/dist/client/assets/index-C3ETe3EL.css +1 -0
- package/dist/client/assets/{index-dARLbQ-8.js → index-C4d7l2t8.js} +10 -10
- package/dist/client/index.html +2 -2
- package/dist/server/agents.d.ts +18 -0
- package/dist/server/agents.js +38 -9
- package/dist/server/application/project-service.d.ts +47 -3
- package/dist/server/application/project-service.js +132 -15
- package/dist/server/index.js +13 -2
- package/dist/server/types.d.ts +14 -3
- package/dist/shared/agent-order.d.ts +44 -0
- package/dist/shared/agent-order.js +50 -0
- package/package.json +9 -2
- package/dist/client/assets/index-C6YWfUu2.css +0 -1
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ONE order agent lists are shown in.
|
|
3
|
+
*
|
|
4
|
+
* WHY THERE IS A SINGLE RULE AND NOT A RULE PER SIDE. The picker's list, the settings page's grid, the
|
|
5
|
+
* sub-agent roster and the project panel's employee candidates are four views of the same catalogue, and
|
|
6
|
+
* they used to disagree about what a list of agents looks like. The server sorted what it read by
|
|
7
|
+
* "(built-in first, then id)", and the client re-sorted what the server sent by a rule of its own that
|
|
8
|
+
* added one more level - "roles before workers". A reader who saw the same agents in two orders had no
|
|
9
|
+
* way to tell which screen was wrong, because neither was: they were two answers to a question nobody
|
|
10
|
+
* had asked twice the same way.
|
|
11
|
+
*
|
|
12
|
+
* So the rule is stated once, HERE, and both sides apply it. The server imports it to order the
|
|
13
|
+
* catalogue it reads; the client imports it to order every list it draws. There is no second
|
|
14
|
+
* implementation to drift, because there is no second implementation.
|
|
15
|
+
*
|
|
16
|
+
* THE ORDER IS:
|
|
17
|
+
*
|
|
18
|
+
* 1. THE PACKAGE'S OWN agents first, then the user's. The ones that ship with Super Pi are drawn with
|
|
19
|
+
* a colour dot, and a dot scattered among the user's own reads as noise rather than as a group.
|
|
20
|
+
* 2. Inside a group, the CONVERSATION ROLES (mode: primary) before the DELEGATED ones (mode:
|
|
21
|
+
* subagent), so a list reads as "the roles, then the workers".
|
|
22
|
+
* 3. Inside a group and a role, alphabetical by id, so the order never depends on the order the
|
|
23
|
+
* filesystem happened to hand the files over in.
|
|
24
|
+
*
|
|
25
|
+
* WHY THE FLAG IS NOT GUESSED HERE. "Is this the package's own agent?" is a question about where the app
|
|
26
|
+
* is installed, and only the server knows that: it reads the definitions and marks them. A client that
|
|
27
|
+
* tried to work it out from the directory path would be guessing, and would guess wrong the moment the
|
|
28
|
+
* package is installed somewhere unusual - which is exactly the case where the answer matters.
|
|
29
|
+
*/
|
|
30
|
+
/** The conversation roles come before the delegated ones, so a screen keeps reading as "roles, then workers". */
|
|
31
|
+
const modeRank = (mode) => (mode === "subagent" ? 1 : 0);
|
|
32
|
+
/**
|
|
33
|
+
* The built-in group first, then the user's, each group by role and then by id.
|
|
34
|
+
*
|
|
35
|
+
* An agent with no `builtin` flag at all (an older server, or a hand-built fixture) counts as the
|
|
36
|
+
* user's, which is the safe direction: it puts the unflagged one where a user's own would sit rather
|
|
37
|
+
* than promoting it into the group that means "this ships with Super Pi".
|
|
38
|
+
*/
|
|
39
|
+
export function orderAgentsForDisplay(agents) {
|
|
40
|
+
return [...agents].sort((a, b) => {
|
|
41
|
+
const left = a.builtin ? 0 : 1;
|
|
42
|
+
const right = b.builtin ? 0 : 1;
|
|
43
|
+
if (left !== right)
|
|
44
|
+
return left - right;
|
|
45
|
+
const roles = modeRank(a.mode) - modeRank(b.mode);
|
|
46
|
+
if (roles !== 0)
|
|
47
|
+
return roles;
|
|
48
|
+
return a.id.localeCompare(b.id);
|
|
49
|
+
});
|
|
50
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@evandu/super-pi",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.168",
|
|
4
4
|
"description": "Web control plane and companion for Pi",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
"scripts/stream-transport.test.mjs",
|
|
49
49
|
"scripts/remote-transport.test.mjs",
|
|
50
50
|
"scripts/browser-safe-port.test.mjs",
|
|
51
|
+
"scripts/agent-order.test.mjs",
|
|
51
52
|
"scripts/agent-picker-order.test.mjs",
|
|
52
53
|
"scripts/inline-thinking.test.mjs",
|
|
53
54
|
"scripts/inline-thinking-close-tag.test.mjs",
|
|
@@ -195,6 +196,7 @@
|
|
|
195
196
|
"scripts/session-state-icon.test.mjs",
|
|
196
197
|
"scripts/provider-fetch-models.test.mjs",
|
|
197
198
|
"scripts/shared-chrome.test.mjs",
|
|
199
|
+
"scripts/shared-chrome-recovery.test.mjs",
|
|
198
200
|
"scripts/prompt-templates.test.mjs",
|
|
199
201
|
"scripts/documents.test.mjs",
|
|
200
202
|
"scripts/web-tools.test.mjs",
|
|
@@ -231,7 +233,8 @@
|
|
|
231
233
|
"scripts/awaiting-background-status.test.mjs",
|
|
232
234
|
"scripts/project-lifecycle-e2e.test.mjs",
|
|
233
235
|
"scripts/agent-tiers.test.mjs",
|
|
234
|
-
"scripts/design-principles.test.mjs"
|
|
236
|
+
"scripts/design-principles.test.mjs",
|
|
237
|
+
"scripts/primary-employee-guard.test.mjs"
|
|
235
238
|
],
|
|
236
239
|
"check:browser": [
|
|
237
240
|
"scripts/interrupt-browser.test.mjs",
|
|
@@ -265,7 +268,10 @@
|
|
|
265
268
|
"scripts/workspace-identity-browser.test.mjs",
|
|
266
269
|
"scripts/sidebar-tools-browser.test.mjs",
|
|
267
270
|
"scripts/project-employee-panel-browser.test.mjs",
|
|
271
|
+
"scripts/primary-employee-guard-browser.test.mjs",
|
|
268
272
|
"scripts/project-evidence-panel-browser.test.mjs",
|
|
273
|
+
"scripts/project-panel-fixes-browser.test.mjs",
|
|
274
|
+
"scripts/boss-approval-readability-browser.test.mjs",
|
|
269
275
|
"scripts/builtin-agents-project-browser.test.mjs",
|
|
270
276
|
"scripts/tool-runtime-browser.test.mjs",
|
|
271
277
|
"scripts/session-context-menu-browser.test.mjs",
|
|
@@ -294,6 +300,7 @@
|
|
|
294
300
|
"scripts/stream-tail-browser.test.mjs",
|
|
295
301
|
"scripts/scroll-restore-browser.test.mjs",
|
|
296
302
|
"scripts/theme-contrast.test.mjs",
|
|
303
|
+
"scripts/ui-contrast-browser.test.mjs",
|
|
297
304
|
"scripts/theme-switch-state.test.mjs",
|
|
298
305
|
"scripts/settings-window-structure.test.mjs",
|
|
299
306
|
"scripts/settings-model-browser.test.mjs",
|