@evandu/super-pi 0.1.159 → 0.1.161

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 (41) hide show
  1. package/agents/super-pi-task/core.ts +1 -1
  2. package/agents/super-pi-task/index.ts +2 -1
  3. package/dist/client/.super-pi-client-sources.json +5 -5
  4. package/dist/client/assets/{CodeMirrorEditor-BB0GyCns.js → CodeMirrorEditor-CDaL0eZg.js} +2 -2
  5. package/dist/client/assets/{dist-DSE_w05B.js → dist-BA58NP6M.js} +1 -1
  6. package/dist/client/assets/{dist-W281b4I1.js → dist-BDNs_xhA.js} +1 -1
  7. package/dist/client/assets/{dist-DdCTaTc1.js → dist-BHWAql8E.js} +1 -1
  8. package/dist/client/assets/{dist-BZNEPjC8.js → dist-BJG0l-sn.js} +1 -1
  9. package/dist/client/assets/{dist-BDxBEqt3.js → dist-BZgXABCU.js} +1 -1
  10. package/dist/client/assets/{dist-BT4A5Gts.js → dist-CSdmsB0d.js} +1 -1
  11. package/dist/client/assets/{dist-DuhZOzpj.js → dist-CTelFWCj.js} +1 -1
  12. package/dist/client/assets/{dist-D4twfstd.js → dist-CWgIVqDh.js} +1 -1
  13. package/dist/client/assets/{dist-DxoyfcUP.js → dist-CZlI9li3.js} +1 -1
  14. package/dist/client/assets/{dist-BQjIO_bJ.js → dist-CiyMaqx4.js} +1 -1
  15. package/dist/client/assets/{dist-BCZnYgeb.js → dist-Cm3rvfSQ.js} +1 -1
  16. package/dist/client/assets/{dist-DndOTsBF.js → dist-D1cVuzfF.js} +1 -1
  17. package/dist/client/assets/{dist-D8Zpt_js.js → dist-DL66Z_jn.js} +1 -1
  18. package/dist/client/assets/{dist-BQK5OciP.js → dist-DO3oDtGc.js} +1 -1
  19. package/dist/client/assets/{dist-BJPYIQat.js → dist-DOdfw0L-.js} +1 -1
  20. package/dist/client/assets/{dist-DIgk0yLa.js → dist-DPwOtaMP.js} +1 -1
  21. package/dist/client/assets/{dist-BBvvLw1T.js → dist-DVCVhi5y.js} +1 -1
  22. package/dist/client/assets/{dist-R_rLoe1G.js → dist-DhPkHpbv.js} +1 -1
  23. package/dist/client/assets/{dist-CH0-OHWZ.js → dist-DnaLB6eU.js} +1 -1
  24. package/dist/client/assets/{dist-rXWbM1pb.js → dist-S5Gkqadu.js} +1 -1
  25. package/dist/client/assets/{dist-BZlYaGxq.js → dist-gCJkYldU.js} +1 -1
  26. package/dist/client/assets/{dist-BeCgVWwJ.js → dist-jwSzBAO8.js} +1 -1
  27. package/dist/client/assets/index-B9tN8KD3.js +102 -0
  28. package/dist/client/assets/{index-OdImWK16.css → index-BK3ZIqJj.css} +1 -1
  29. package/dist/client/index.html +2 -2
  30. package/dist/server/application/conversation-service.d.ts +6 -0
  31. package/dist/server/application/conversation-service.js +6 -1
  32. package/dist/server/application/project-service.d.ts +72 -1
  33. package/dist/server/application/project-service.js +256 -19
  34. package/dist/server/application/session-orchestrator-service.d.ts +9 -0
  35. package/dist/server/application/session-orchestrator-service.js +1 -0
  36. package/dist/server/http-server.js +11 -3
  37. package/dist/server/store.d.ts +1 -0
  38. package/dist/server/store.js +8 -1
  39. package/dist/server/types.d.ts +36 -0
  40. package/package.json +1 -1
  41. package/dist/client/assets/index-C2caXFC3.js +0 -102
@@ -1559,9 +1559,9 @@ export function createHttpServer(options) {
1559
1559
  return;
1560
1560
  }
1561
1561
  if (!projectId && request.method === "POST") {
1562
- const project = await service.create({ ...body, workspaceId: requestedWorkspaceId });
1563
- broadcaster.broadcastState();
1564
- json(201, { project });
1562
+ // 项目由 agent 在对话里创建:只有那次会话能作为发起人,项目的全部会话才挂在它下面。
1563
+ // 人手动建的项目没有发起人,它的 Leader 只能当树根,顶层就会长出一片会话。
1564
+ json(403, { error: "项目由 AI 在对话中创建:请直接告诉它你要做什么" });
1565
1565
  return;
1566
1566
  }
1567
1567
  if (!projectId) {
@@ -1585,6 +1585,14 @@ export function createHttpServer(options) {
1585
1585
  json(200, { project });
1586
1586
  return;
1587
1587
  }
1588
+ // ONE CLICK: RAISE THE BUDGET AND CONTINUE. The server computes the new cap, closes the
1589
+ // budget exception and wakes the leader - the client sends no number of its own.
1590
+ if (request.method === "POST" && subresource === "budget" && parts[2] === "continue") {
1591
+ const result = await service.raiseBudgetAndContinue(projectId, workspaceId, callerConversationId);
1592
+ broadcaster.broadcastState();
1593
+ json(200, result);
1594
+ return;
1595
+ }
1588
1596
  if (request.method === "POST" && subresource === "tasks" && parts[2] && parts[3] === "dispatch") {
1589
1597
  const task = await service.dispatchTask(projectId, parts[2], workspaceId);
1590
1598
  broadcaster.broadcastState();
@@ -281,6 +281,7 @@ export declare class Store {
281
281
  cwd?: string;
282
282
  parentConversationId?: string;
283
283
  origin?: "user" | "orchestrator";
284
+ separateMemoryTree?: boolean;
284
285
  }): Promise<Conversation>;
285
286
  /**
286
287
  * Records (or clears) one conversation as collapsed in the sidebar's session tree. The list is a
@@ -1143,7 +1143,14 @@ export class Store {
1143
1143
  conversation.origin = configuration.origin;
1144
1144
  }
1145
1145
  try {
1146
- conversation.treeId = memoryTreeId(conversation, this.state.conversations);
1146
+ // A PROJECT OPENS ITS OWN MEMORY TREE. Inheriting the parent's tree would put the project's
1147
+ // workers in the user's chat tree, where the tree-scoped memories of that conversation are
1148
+ // visible to them - a project is its own working context. The tree edge in the sidebar is a
1149
+ // different thing and stays exactly as it is.
1150
+ if (configuration?.separateMemoryTree)
1151
+ conversation.treeId = conversation.id;
1152
+ else
1153
+ conversation.treeId = memoryTreeId(conversation, this.state.conversations);
1147
1154
  }
1148
1155
  catch { /* Keep malformed legacy edges inspectable; memory authorization fails closed. */ }
1149
1156
  this.state.conversations.unshift(conversation);
@@ -903,6 +903,16 @@ export type TerminalShell = {
903
903
  export type ProjectStatus = "planning" | "active" | "blocked" | "awaiting_approval" | "awaiting_review" | "completed" | "failed" | "cancelled";
904
904
  export type ProjectTaskStatus = "pending" | "ready" | "in_progress" | "blocked" | "awaiting_review" | "completed" | "failed" | "cancelled";
905
905
  export type ProjectRisk = "low" | "medium" | "high";
906
+ /**
907
+ * HOW A PROJECT RUNS.
908
+ *
909
+ * "standard" is the shape the project flow has always had: the leader dispatches worker sessions
910
+ * and every delivery is checked by an independent reviewer session. "lightweight" is the small
911
+ * project's shape: the leader session does the work itself, and a delivery is accepted on the
912
+ * executor's own evidence. Every guardrail is the same in both - what a lightweight project gives
913
+ * up is the number of sessions, never the guardrails.
914
+ */
915
+ export type ProjectMode = "standard" | "lightweight";
906
916
  export type SessionProfile = {
907
917
  /** Employee agent file id under agents directory (primary agent name). */
908
918
  agentId?: string;
@@ -941,12 +951,15 @@ export type ProjectTask = {
941
951
  blockedReason?: string;
942
952
  output?: string;
943
953
  evidenceRefs?: string[];
954
+ /** The acceptance of this task. `lightweight: true` means the executor accepted its own
955
+ * delivery: there was no independent reviewer session behind it. */
944
956
  review?: {
945
957
  verdict: "accepted" | "changes_requested";
946
958
  summary: string;
947
959
  evidenceRefs: string[];
948
960
  reviewerConversationId?: string;
949
961
  createdAt: string;
962
+ lightweight?: boolean;
950
963
  };
951
964
  createdAt: string;
952
965
  updatedAt: string;
@@ -990,6 +1003,11 @@ export type Project = {
990
1003
  workspaceId: string;
991
1004
  title: string;
992
1005
  objective: string;
1006
+ /** HOW THE PROJECT RUNS. Absent means "standard": the leader dispatches worker sessions and
1007
+ * every delivery is checked by an independent reviewer session. "lightweight" is the small
1008
+ * project's shape: the leader session does the work itself, and a delivery is accepted on the
1009
+ * executor's own evidence. Every guardrail is the same in both modes. */
1010
+ mode?: ProjectMode;
993
1011
  deliverables: string[];
994
1012
  acceptanceCriteria: string[];
995
1013
  constraints: string[];
@@ -1007,6 +1025,14 @@ export type Project = {
1007
1025
  defaultExecutorProfile?: SessionProfile;
1008
1026
  defaultReviewerProfile?: SessionProfile;
1009
1027
  events?: ProjectEvent[];
1028
+ /**
1029
+ * The project's live sessions, with the tree skeleton attached.
1030
+ *
1031
+ * `parentConversationId` is what lets the client draw a TREE rather than a flat list: a
1032
+ * session whose parent is not in this collection is a ROOT of the tree (the project leader,
1033
+ * and any orphan left behind by an older layout). Without it the panel can only show a row
1034
+ * per session, and the hierarchy - who reported to whom - stays invisible.
1035
+ */
1010
1036
  resources?: {
1011
1037
  tokens: number;
1012
1038
  usageKnown: boolean;
@@ -1018,8 +1044,18 @@ export type Project = {
1018
1044
  status: RunStatus;
1019
1045
  tokens: number;
1020
1046
  contextPercent?: number | null;
1047
+ parentConversationId?: string;
1021
1048
  }[];
1022
1049
  };
1050
+ /**
1051
+ * THE CAP THE ONE-CLICK PATH OFFERS, COMPUTED BY THE SERVER.
1052
+ *
1053
+ * It is `max(current cap + 1, spent tokens * 2)`, and it is a READ-ONLY projection: it is
1054
+ * never stored, so it can never disagree with the budget the project actually runs on. The
1055
+ * panel shows this number on the button instead of computing one of its own - a suggestion the
1056
+ * client invents is a suggestion the Boss cannot check.
1057
+ */
1058
+ suggestedMaxTokens?: number;
1023
1059
  tasks: ProjectTask[];
1024
1060
  reports: ProjectReport[];
1025
1061
  escalations: ProjectEscalation[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evandu/super-pi",
3
- "version": "0.1.159",
3
+ "version": "0.1.161",
4
4
  "description": "Web control plane and companion for Pi",
5
5
  "license": "MIT",
6
6
  "type": "module",