@evandu/super-pi 0.1.165 → 0.1.167

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.
Files changed (49) hide show
  1. package/agents/coder.md +13 -1
  2. package/agents/critic.md +6 -2
  3. package/agents/patcher.md +6 -2
  4. package/agents/planner.md +14 -2
  5. package/agents/project-leader.md +25 -0
  6. package/agents/reviewer.md +13 -1
  7. package/agents/scout.md +6 -2
  8. package/agents/super-pi-task/core.ts +10 -6
  9. package/agents/verifier.md +6 -2
  10. package/dist/client/.super-pi-client-sources.json +10 -9
  11. package/dist/client/assets/{CodeMirrorEditor-B3-4Qpd1.js → CodeMirrorEditor-CVWde5kc.js} +2 -2
  12. package/dist/client/assets/{dist-Bh9jVMEA.js → dist-4fGafgy-.js} +1 -1
  13. package/dist/client/assets/{dist-D45Y5G5v.js → dist-BCl45PhR.js} +1 -1
  14. package/dist/client/assets/{dist-CL9_Ff9R.js → dist-BHFNgK-o.js} +1 -1
  15. package/dist/client/assets/{dist-DGOgW2hA.js → dist-BNHp4wy-.js} +1 -1
  16. package/dist/client/assets/{dist-DtNwDyK1.js → dist-BmMZE70t.js} +1 -1
  17. package/dist/client/assets/{dist-BWsed8P8.js → dist-BmTCWOAf.js} +1 -1
  18. package/dist/client/assets/{dist-wW-2h0X5.js → dist-C44HyASP.js} +1 -1
  19. package/dist/client/assets/{dist-BhiW2HYK.js → dist-C5vtfmg_.js} +1 -1
  20. package/dist/client/assets/{dist-C2mhG_5m.js → dist-CC90sIpG.js} +1 -1
  21. package/dist/client/assets/{dist-2Ax3GOhT.js → dist-CH83_wek.js} +1 -1
  22. package/dist/client/assets/{dist-Cn4Q7-eG.js → dist-CYucB1mz.js} +1 -1
  23. package/dist/client/assets/{dist-BD4w6y25.js → dist-D7VBYFBQ.js} +1 -1
  24. package/dist/client/assets/{dist-Do72hsvz.js → dist-DInnP2s9.js} +1 -1
  25. package/dist/client/assets/{dist-DQnuHIqA.js → dist-DOYAWZox.js} +1 -1
  26. package/dist/client/assets/{dist-CN6rdrJA.js → dist-DQ97Hq65.js} +1 -1
  27. package/dist/client/assets/{dist-BIqjsoet.js → dist-DTOebxDL.js} +1 -1
  28. package/dist/client/assets/{dist-Di8I1Dsi.js → dist-DUgYAI4d.js} +1 -1
  29. package/dist/client/assets/{dist-QTqWnNGE.js → dist-DaEO5rUQ.js} +1 -1
  30. package/dist/client/assets/{dist-rFG_iRW3.js → dist-Dn-GoU5Q.js} +1 -1
  31. package/dist/client/assets/{dist-hUAwe2Kn.js → dist-FPYonm2j.js} +1 -1
  32. package/dist/client/assets/{dist-DRgOr5sP.js → dist-GZFbu49l.js} +1 -1
  33. package/dist/client/assets/{dist-DF05sEDO.js → dist-RLM_LWKf.js} +1 -1
  34. package/dist/client/assets/{index-BUTxkA3D.js → index-BptmWfVR.js} +19 -19
  35. package/dist/client/assets/index-DWjVnvsQ.css +1 -0
  36. package/dist/client/index.html +2 -2
  37. package/dist/server/agents.d.ts +11 -0
  38. package/dist/server/agents.js +50 -6
  39. package/dist/server/application/project-service.js +67 -6
  40. package/dist/server/store.d.ts +17 -0
  41. package/dist/server/store.js +97 -1
  42. package/dist/server/subagent-runs.js +19 -1
  43. package/dist/server/task-tool.d.ts +1 -1
  44. package/dist/server/task-tool.js +4 -3
  45. package/dist/server/types.d.ts +48 -2
  46. package/dist/shared/agent-order.d.ts +44 -0
  47. package/dist/shared/agent-order.js +50 -0
  48. package/package.json +12 -2
  49. package/dist/client/assets/index-Wtlj0s4R.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.165",
3
+ "version": "0.1.167",
4
4
  "description": "Web control plane and companion for Pi",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -48,6 +48,8 @@
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",
52
+ "scripts/agent-picker-order.test.mjs",
51
53
  "scripts/inline-thinking.test.mjs",
52
54
  "scripts/inline-thinking-close-tag.test.mjs",
53
55
  "scripts/pi-session.test.mjs",
@@ -69,6 +71,7 @@
69
71
  "scripts/verify-source-text.test.mjs",
70
72
  "scripts/runtime-extension-ui.test.mjs",
71
73
  "scripts/agent-mechanism.test.mjs",
74
+ "scripts/builtin-agents-project.test.mjs",
72
75
  "scripts/super-pi-tool-names.test.mjs",
73
76
  "scripts/agent-wiring.test.mjs",
74
77
  "scripts/message-timestamps.test.mjs",
@@ -95,6 +98,7 @@
95
98
  "scripts/subagent-noise.test.mjs",
96
99
  "scripts/subagent-response-receipt.test.mjs",
97
100
  "scripts/subagent-runs.test.mjs",
101
+ "scripts/subagent-usage-accounting.test.mjs",
98
102
  "scripts/ws-flood-regression.test.mjs",
99
103
  "scripts/conversation-reconcile.test.mjs",
100
104
  "scripts/subagent-dispatch.test.mjs",
@@ -226,7 +230,9 @@
226
230
  "scripts/session-report-tool.test.mjs",
227
231
  "scripts/session-stop-subtree.test.mjs",
228
232
  "scripts/awaiting-background-status.test.mjs",
229
- "scripts/project-lifecycle-e2e.test.mjs"
233
+ "scripts/project-lifecycle-e2e.test.mjs",
234
+ "scripts/agent-tiers.test.mjs",
235
+ "scripts/design-principles.test.mjs"
230
236
  ],
231
237
  "check:browser": [
232
238
  "scripts/interrupt-browser.test.mjs",
@@ -260,6 +266,9 @@
260
266
  "scripts/workspace-identity-browser.test.mjs",
261
267
  "scripts/sidebar-tools-browser.test.mjs",
262
268
  "scripts/project-employee-panel-browser.test.mjs",
269
+ "scripts/project-evidence-panel-browser.test.mjs",
270
+ "scripts/project-panel-fixes-browser.test.mjs",
271
+ "scripts/builtin-agents-project-browser.test.mjs",
263
272
  "scripts/tool-runtime-browser.test.mjs",
264
273
  "scripts/session-context-menu-browser.test.mjs",
265
274
  "scripts/archive-cascade-browser.test.mjs",
@@ -287,6 +296,7 @@
287
296
  "scripts/stream-tail-browser.test.mjs",
288
297
  "scripts/scroll-restore-browser.test.mjs",
289
298
  "scripts/theme-contrast.test.mjs",
299
+ "scripts/ui-contrast-browser.test.mjs",
290
300
  "scripts/theme-switch-state.test.mjs",
291
301
  "scripts/settings-window-structure.test.mjs",
292
302
  "scripts/settings-model-browser.test.mjs",