@evandu/super-pi 0.1.158 → 0.1.160

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 (31) hide show
  1. package/dist/client/.super-pi-client-sources.json +4 -4
  2. package/dist/client/assets/{CodeMirrorEditor-BB0GyCns.js → CodeMirrorEditor-DeH4azrn.js} +2 -2
  3. package/dist/client/assets/{dist-BT4A5Gts.js → dist-7jfYXjWH.js} +1 -1
  4. package/dist/client/assets/{dist-DIgk0yLa.js → dist-BeLF-5JB.js} +1 -1
  5. package/dist/client/assets/{dist-BZlYaGxq.js → dist-Bl20l56d.js} +1 -1
  6. package/dist/client/assets/{dist-DxoyfcUP.js → dist-BotfOUXo.js} +1 -1
  7. package/dist/client/assets/{dist-BJPYIQat.js → dist-Br9aGZZB.js} +1 -1
  8. package/dist/client/assets/{dist-BBvvLw1T.js → dist-C1FnggSV.js} +1 -1
  9. package/dist/client/assets/{dist-BDxBEqt3.js → dist-C1iGzBNB.js} +1 -1
  10. package/dist/client/assets/{dist-DuhZOzpj.js → dist-CA4ywFCU.js} +1 -1
  11. package/dist/client/assets/{dist-D8Zpt_js.js → dist-CBAhomD3.js} +1 -1
  12. package/dist/client/assets/{dist-BQjIO_bJ.js → dist-CNdHgilU.js} +1 -1
  13. package/dist/client/assets/{dist-BCZnYgeb.js → dist-CdG0dOlF.js} +1 -1
  14. package/dist/client/assets/{dist-BeCgVWwJ.js → dist-CgShg9H1.js} +1 -1
  15. package/dist/client/assets/{dist-D4twfstd.js → dist-ClXbSHKM.js} +1 -1
  16. package/dist/client/assets/{dist-rXWbM1pb.js → dist-CrIX2hon.js} +1 -1
  17. package/dist/client/assets/{dist-DndOTsBF.js → dist-CrwnaHWk.js} +1 -1
  18. package/dist/client/assets/{dist-DdCTaTc1.js → dist-CsDwtK1F.js} +1 -1
  19. package/dist/client/assets/{dist-BQK5OciP.js → dist-DWHnCS4H.js} +1 -1
  20. package/dist/client/assets/{dist-W281b4I1.js → dist-DefZp4Fa.js} +1 -1
  21. package/dist/client/assets/{dist-R_rLoe1G.js → dist-DjepRcJQ.js} +1 -1
  22. package/dist/client/assets/{dist-CH0-OHWZ.js → dist-Fa50HH8A.js} +1 -1
  23. package/dist/client/assets/{dist-DSE_w05B.js → dist-QI-T3k9i.js} +1 -1
  24. package/dist/client/assets/{dist-BZNEPjC8.js → dist-u0a7h80y.js} +1 -1
  25. package/dist/client/assets/{index-OdImWK16.css → index-CYvr3uNw.css} +1 -1
  26. package/dist/client/assets/index-D3XEFVty.js +102 -0
  27. package/dist/client/index.html +2 -2
  28. package/dist/server/application/project-service.js +15 -5
  29. package/dist/server/http-server.js +3 -3
  30. package/package.json +1 -1
  31. package/dist/client/assets/index-C2caXFC3.js +0 -102
@@ -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-C2caXFC3.js"></script>
12
- <link rel="stylesheet" crossorigin href="/assets/index-OdImWK16.css">
11
+ <script type="module" crossorigin src="/assets/index-D3XEFVty.js"></script>
12
+ <link rel="stylesheet" crossorigin href="/assets/index-CYvr3uNw.css">
13
13
  </head>
14
14
  <body>
15
15
  <div id="root"></div>
@@ -332,6 +332,12 @@ export class ProjectService {
332
332
  const effective = p.defaultLeaderProfile;
333
333
  p.ownerConversationId = (await this.orchestrator.spawn({
334
334
  workspaceId,
335
+ // A PROJECT'S SESSIONS HANG UNDER THE CONVERSATION THAT CREATED IT. The leader session is
336
+ // spawned without a parent today, so it lands at the TOP of the session tree and drags the
337
+ // whole project subtree up with it. The initiator is the conversation that created the
338
+ // project, so it is where the project belongs in the tree. A project the Boss started from
339
+ // the panel has no initiator, and stays a root session exactly as before.
340
+ ...(p.initiatorConversationId ? { parentConversationId: p.initiatorConversationId } : {}),
335
341
  title: `项目负责人 · ${p.title}`,
336
342
  task: p.objective,
337
343
  initialPrompt: "",
@@ -825,13 +831,17 @@ export class ProjectService {
825
831
  const conversation = this.store.conversation(actor);
826
832
  if (!conversation)
827
833
  throw new Error("找不到这个会话。");
828
- if (conversation.parentConversationId)
829
- throw new Error("只有主对话可以创建项目:派发出来的会话不能另起项目,否则会绕过项目的预算与并发护栏。");
830
- // AND A SESSION THAT IS ALREADY IN A PROJECT MAY NOT OPEN ANOTHER ONE. The leader session is
831
- // spawned without a parent, so it passes the root-conversation gate above, yet a project it
832
- // opens would carry a fresh budget and concurrency cap outside the guard that dispatched it.
834
+ // AND A SESSION THAT IS ALREADY IN A PROJECT MAY NOT OPEN ANOTHER ONE. This gate is checked
835
+ // FIRST, before the root-conversation gate, because it is the more precise of the two: the
836
+ // leader, its reviewers and its workers all live INSIDE a project, and "you are already in a
837
+ // project" is the reason that stops them. The leader is now spawned UNDER its initiator, so
838
+ // the root gate would catch it too - but it would blame the tree shape instead of the project
839
+ // membership, and the membership is the real reason. The set of sessions that may open a
840
+ // project is the same either way: a session is refused if it is in a project OR has a parent.
833
841
  if (this.projectForSession(actor))
834
842
  throw new Error("已经在项目里的会话不能另起项目:再开一个会绕开当前项目的预算与并发护栏。");
843
+ if (conversation.parentConversationId)
844
+ throw new Error("只有主对话可以创建项目:派发出来的会话不能另起项目,否则会绕过项目的预算与并发护栏。");
835
845
  const running = this.store.projects().filter((p) => p.initiatorConversationId === actor && !closed(p));
836
846
  if (running.length >= 3)
837
847
  throw new Error("你同时进行的项目超过上限(3 个),先完成或停止一个再新建。");
@@ -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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evandu/super-pi",
3
- "version": "0.1.158",
3
+ "version": "0.1.160",
4
4
  "description": "Web control plane and companion for Pi",
5
5
  "license": "MIT",
6
6
  "type": "module",