@evandu/super-pi 0.1.158 → 0.1.159

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.
@@ -39,5 +39,5 @@
39
39
  "src/client/types.ts": "b4d24bfabf230e29b984cf698aeb579c19797139a2b358f1a4e61cafce02964d",
40
40
  "src/client/vite-env.d.ts": "65996936fbb042915f7b74a200fcdde7e410f32a669b1ab9597cfaa4b0faddb5"
41
41
  },
42
- "recordedAt": "2026-11-04T07:47:46.546Z"
42
+ "recordedAt": "2026-11-04T08:09:41.654Z"
43
43
  }
@@ -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 个),先完成或停止一个再新建。");
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.159",
4
4
  "description": "Web control plane and companion for Pi",
5
5
  "license": "MIT",
6
6
  "type": "module",