@evandu/super-pi 0.1.188 → 0.1.189

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.
@@ -316,8 +316,8 @@ const extension = (pi: ExtensionApi): void => {
316
316
  action: Type.Union(["create", "start", "get", "list", "add_task", "dispatch", "submit", "request_review", "review", "update_task", "report", "escalate", "resolve_escalation", "correct", "complete", "cancel", "export"].map((value) => Type.Literal(value))),
317
317
  projectId: Type.Optional(Type.String()), taskId: Type.Optional(Type.String()),
318
318
  parentTaskId: Type.Optional(Type.String()), role: Type.Optional(Type.Union([Type.Literal("leader"), Type.Literal("executor")])),
319
- title: Type.Optional(Type.String({ description: "Required for action=\"create\" (and add_task): short project or task title." })),
320
- objective: Type.Optional(Type.String({ description: "Required for action=\"create\" (and add_task): what the project or task should achieve." })),
319
+ title: Type.Optional(Type.String({ description: "Required for action=\"create\" (and add_task): short project or task title. For action=\"create\" this and objective are the ONLY two fields you must send; every other field may be omitted." })),
320
+ objective: Type.Optional(Type.String({ description: "Required for action=\"create\" (and add_task): what the project or task should achieve. For action=\"create\" this and title are the ONLY two fields you must send." })),
321
321
  deliverables: Type.Optional(Type.Array(Type.String(), { description: "Optional deliverables list. Omit if not needed; does not block starting." })),
322
322
  acceptanceCriteria: Type.Optional(Type.Array(Type.String(), { description: "Optional acceptance criteria list. Omit if not needed; does not block starting." })),
323
323
  constraints: Type.Optional(Type.Array(Type.String(), { description: "Optional constraints list. Omit if not needed; does not block starting." })),
@@ -40,5 +40,5 @@
40
40
  "src/client/types.ts": "ef0586e206d0f229ed0e81e72397e1ddfd82c00ae7133d06d20892605e6f1ff4",
41
41
  "src/client/vite-env.d.ts": "65996936fbb042915f7b74a200fcdde7e410f32a669b1ab9597cfaa4b0faddb5"
42
42
  },
43
- "recordedAt": "2026-11-11T16:43:47.484Z"
43
+ "recordedAt": "2026-11-11T17:07:45.892Z"
44
44
  }
@@ -1245,6 +1245,14 @@ export class ProjectService {
1245
1245
  ...(effective?.thinkingLevel ? { thinkingLevel: effective.thinkingLevel } : {}),
1246
1246
  ...(effective?.watchdogTimeoutSeconds ? { watchdogTimeoutSeconds: effective.watchdogTimeoutSeconds } : {}),
1247
1247
  })).conversationId;
1248
+ // A LEADER WITHOUT A PROFILE LANDS ON THE WORKSPACE DEFAULT, AND THAT IS NOT A DECISION.
1249
+ // The default agent is whatever the workspace happens to run - it may well be another PMO,
1250
+ // which is how a project's leader became "one more pmo" once. The silent part was the
1251
+ // problem: the project looked started and the timeline never said what the leader is.
1252
+ // So the fallback is written down, where the people reading the project can see it.
1253
+ if (!effective?.agentId) {
1254
+ this.event(p, "leader-profile-missing", "未指定 Leader 的 agentId,负责人会话落在工作区默认 agent 上;请用 defaultLeaderProfile 明确指定", undefined, actor);
1255
+ }
1248
1256
  }
1249
1257
  for (const task of p.tasks) {
1250
1258
  if (!task.parentTaskId && (!task.accountableConversationId || task.accountableConversationId === p.initiatorConversationId)) {
@@ -1386,6 +1394,14 @@ export class ProjectService {
1386
1394
  /* THE MOMENT THE TASK WENT OUT IS WRITTEN DOWN. It is what tells a session that died BEFORE
1387
1395
  this dispatch from one that died AFTER it: only the second one interrupted the task, and
1388
1396
  only the second one may turn it into 「已中断」. */
1397
+ /* THE STATUS IS CHECKED AGAIN AT THE MOMENT OF THE WRITE, and it is checked against the
1398
+ STORE, not against the snapshot this operation started with. The spawn above is an await:
1399
+ while it was in flight the project could have been closed - every task delivered, the
1400
+ reconcile marked it done - and a dispatch that writes into a closed project is a duplicate
1401
+ delivery, not a delivery. The door check is not enough, because the door and the write are
1402
+ separated by exactly the length of a spawn, and the object in hand is the state from the
1403
+ door. So the fresh copy is read here, and the refusal happens before anything is written. */
1404
+ this.live(this.raw(id, workspaceId));
1389
1405
  t.status = "in_progress";
1390
1406
  t.updatedAt = stamp();
1391
1407
  t.dispatchedAt = t.updatedAt;
@@ -2072,6 +2088,19 @@ export class ProjectService {
2072
2088
  const running = this.store.projects().filter((p) => p.initiatorConversationId === actor && !closed(p));
2073
2089
  if (running.length >= 3)
2074
2090
  throw new Error("你同时进行的项目超过上限(3 个),先完成或停止一个再新建。");
2091
+ // ONLY TWO FIELDS ARE ASKED FOR, AND SAYING SO IS PART OF THE CONTRACT. The schema marks
2092
+ // `title` and `objective` optional - they are optional for the other actions of this tool -
2093
+ // so a model that reads the schema alone can send a project with neither, and then it meets
2094
+ // a bare "项目标题 不能为空". That message names a field the model never sent. So the
2095
+ // refusal names what IS needed, in one sentence, the first time.
2096
+ const missing = [];
2097
+ if (typeof body.title !== "string" || !body.title.trim())
2098
+ missing.push("title(项目标题)");
2099
+ if (typeof body.objective !== "string" || !body.objective.trim())
2100
+ missing.push("objective(项目目标)");
2101
+ if (missing.length) {
2102
+ throw new Error(`起项目只需要 title 和 objective,缺 ${missing.join(" 和 ")}。其余参数(risk、mode、deliverables 等)都可以不填。`);
2103
+ }
2075
2104
  const { tasks: batch, ...input } = body;
2076
2105
  const plan = this.planTopLevelTasks(batch);
2077
2106
  const project = await this.create({ ...input, workspaceId }, actor);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evandu/super-pi",
3
- "version": "0.1.188",
3
+ "version": "0.1.189",
4
4
  "description": "Web control plane and companion for Pi",
5
5
  "license": "MIT",
6
6
  "type": "module",