@evandu/super-pi 0.1.186 → 0.1.187

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.
@@ -1138,7 +1138,7 @@ export async function executeScheduledTask(
1138
1138
  export const PROJECT_TOOL_NAME = "project";
1139
1139
  export const PROJECT_ENDPOINT_ENV = "SUPER_PI_PROJECT_ENDPOINT";
1140
1140
 
1141
- export const PROJECT_DESCRIPTION = `Manage an agile coding team project through clear delegation, evidence, independent review and level-by-level reporting. When the user describes a project in natural language, decompose it yourself into title, objective, deliverables, acceptanceCriteria and top-level tasks, then call action="create" with those fields to stand up the project in one call: create registers the project and its top-level tasks, spawns the leader session, and starts it immediately with the full task list in its context (no separate start call or initial project(action="get") is needed before dispatching work; action="start" remains available for a planning project created outside the tool). Create also accepts optional constraints, risk, default profiles defaultLeaderProfile/defaultExecutorProfile/defaultReviewerProfile, and mode: standard (the default) or lightweight. For a small self-contained project, create it with mode="lightweight": the project leader session does the work itself, the project has no separate worker or reviewer sessions, and a task is accepted on the worker's own evidence. Use the standard mode when the work needs an independent review. In a lightweight project the leader registers only executor tasks, never splits into child tasks and never asks for a review - a submitted task is a completed task. The conversation that created a project may cancel it with action="cancel" and a reason: the project is marked cancelled, its running sessions are stopped, and its record, tasks, events and evidence are kept. Only that initiating conversation may cancel it - a worker or reviewer cannot cancel the project it belongs to. The tasks array carries that decomposition: each entry needs a title and an objective, and its dependencies name the titles of sibling tasks in the same array. You are the initiator: you may create the project, register top-level tasks and cancel if needed; you may not register child tasks or interfere with member execution. Only a root conversation may create a project. Top-level tasks can also be registered later with add_task. When the user asks "我的项目现在怎么样", "我还有哪些项目在跑", "列出所有项目", or wants an overview of running projects, call action="list" first to retrieve up to 20 most recently updated projects with lightweight summaries (headline, task counts, active workers, tokens) without needing a projectId; the response returns projects, total, and returned counts, where total > returned indicates more historical projects exist in the workspace. Never guess a projectId to call get blindly; only call get when the user targets a specific project and you need deep task, escalation or event details. The project leader receives the current tasks in its startup context and does not need to call get before dispatching; it uses add_task (title, objective, deliverables, acceptanceCriteria, dependencies, role=leader/executor, optional executorProfile/reviewerProfile with agentId, cwd, model, thinkingLevel, watchdogTimeoutSeconds), dispatch and request_review. A branch leader creates children with parentTaskId set to its own task ID and manages only its direct tasks. Dependencies must be siblings. Leader aggregate submission requires independently accepted children. Keep at most 3 leader levels and 8 branch leaders; small projects need only one executor. Workers submit output plus evidenceRefs. Only the assigned independent reviewer can review with verdict accepted or changes_requested, summary and evidenceRefs. update_task marks blocked/failed with blockedReason, updates executorProfile/reviewerProfile before child sessions spawn, or the leader resets ready for retry. report records kind=progress/blocked, progress, summary, variance, nextStep, risks, decisionNeeded and evidenceRefs; blocked reports notify your direct supervisor rather than directly alerting Boss. escalate records an optional title, a reason and severity=low/medium/high. The title is ONE SENTENCE naming what the reader has to decide - the question - and the reason is the case for it: why it matters, what the evidence shows, what happens if nobody decides. Give a title whenever the question can be said in one line, because the reader decides on the title and reads the reason only when the question is not obvious; without a title the escalation falls back to its reason. member escalations route to your direct supervisor, and only project leader escalations reach Boss. resolve_escalation closes an escalation that was addressed to you: pass escalationId, decision and status (resolved, dismissed or returned, default resolved). Take escalationId from the escalations array that project(action=get) returns - it is the id of the one escalation you are answering, and the same array tells you whether it is still open. decision is your handling note: what you decided and why. status is optional and defaults to resolved; use dismissed when the question no longer stands. status="returned" means the material was not enough to decide on: the case goes back to whoever raised it, and that person is woken up to supply what is missing instead of the case hanging unanswered. It only accepts a supervisor escalation whose target session is your own - only the session an escalation names may answer it - and an escalation addressed to Boss is the Boss's to decide and is refused for you. Resolving it cascades: the member who raised the escalation is woken up with your decision. complete requires all tasks accepted - independently reviewed in the standard mode, self-accepted in the lightweight mode - and a final summary with evidenceRefs. action="export" returns the project as a Markdown report: the objective, every task with its delivery, evidence and review, the exceptions and how they were decided, and the full timeline. Use it when the user asks for a summary, a handover, or a status write-up of the project. Project and task IDs come from create/get/add_task. Reads never invoke models. Dispatch is asynchronous and starts the child session immediately; wait for child completion reports instead of polling. Do not use session_spawn, session_dispatch, task or workflow to bypass the project's delegation and reporting chain. Never claim success on an error.`;
1141
+ export const PROJECT_DESCRIPTION = `Manage an agile coding team project through clear delegation, evidence, independent review and level-by-level reporting. When the user describes a project in natural language, to create a project you ONLY need title and objective — all other fields (deliverables, acceptanceCriteria, constraints, risk, tasks, default profiles, mode) are optional; omit whatever you do not already have, leaving them out never blocks starting, and never pause to invent or fill optional parameters before calling action="create". Call action="create" with title and objective (plus any optional fields you already know) to stand up the project in one call: create registers the project (and any optional top-level tasks), spawns the leader session, and starts it immediately with the full context (no separate start call or initial project(action="get") is needed before work begins; action="start" remains available for a planning project created outside the tool). Optional fields include deliverables, acceptanceCriteria, constraints, risk (defaults to low; any value is accepted without error), defaultLeaderProfile/defaultExecutorProfile/defaultReviewerProfile, and mode: standard (the default) or lightweight. For a small self-contained project, create it with mode="lightweight": the project leader session does the work itself, the project has no separate worker or reviewer sessions, and a task is accepted on the worker's own evidence. Use the standard mode when the work needs an independent review. In a lightweight project the leader registers only executor tasks, never splits into child tasks and never asks for a review - a submitted task is a completed task. The conversation that created a project may cancel it with action="cancel" and a reason: the project is marked cancelled, its running sessions are stopped, and its record, tasks, events and evidence are kept. Only that initiating conversation may cancel it - a worker or reviewer cannot cancel the project it belongs to. If you choose to pass the optional tasks array, each entry only needs a title and an objective, and its dependencies name the titles of sibling tasks in the same array. You are the initiator: you may create the project, register top-level tasks and cancel if needed; you may not register child tasks or interfere with member execution. Only a root conversation may create a project. Top-level tasks can also be registered later with add_task. When the user asks "我的项目现在怎么样", "我还有哪些项目在跑", "列出所有项目", or wants an overview of running projects, call action="list" first to retrieve up to 20 most recently updated projects with lightweight summaries (headline, task counts, active workers, tokens) without needing a projectId; the response returns projects, total, and returned counts, where total > returned indicates more historical projects exist in the workspace. Never guess a projectId to call get blindly; only call get when the user targets a specific project and you need deep task, escalation or event details. The project leader receives the current tasks in its startup context and does not need to call get before dispatching; it uses add_task (only title and objective are required; deliverables, acceptanceCriteria, dependencies, role=leader/executor, and executorProfile/reviewerProfile with agentId, cwd, model, thinkingLevel, watchdogTimeoutSeconds are optional), dispatch and request_review. A branch leader creates children with parentTaskId set to its own task ID and manages only its direct tasks. Dependencies must be siblings. Leader aggregate submission requires independently accepted children. Keep at most 3 leader levels and 8 branch leaders; small projects need only one executor. Workers submit output plus evidenceRefs. Only the assigned independent reviewer can review with verdict accepted or changes_requested, summary and evidenceRefs. update_task marks blocked/failed with blockedReason, updates executorProfile/reviewerProfile before child sessions spawn, or the leader resets ready for retry. report records kind=progress/blocked, progress, summary, variance, nextStep, risks, decisionNeeded and evidenceRefs; blocked reports notify your direct supervisor rather than directly alerting Boss. escalate records an optional title, a reason and severity=low/medium/high. The title is ONE SENTENCE naming what the reader has to decide - the question - and the reason is the case for it: why it matters, what the evidence shows, what happens if nobody decides. Give a title whenever the question can be said in one line, because the reader decides on the title and reads the reason only when the question is not obvious; without a title the escalation falls back to its reason. member escalations route to your direct supervisor, and only project leader escalations reach Boss. resolve_escalation closes an escalation that was addressed to you: pass escalationId, decision and status (resolved, dismissed or returned, default resolved). Take escalationId from the escalations array that project(action=get) returns - it is the id of the one escalation you are answering, and the same array tells you whether it is still open. decision is your handling note: what you decided and why. status is optional and defaults to resolved; use dismissed when the question no longer stands. status="returned" means the material was not enough to decide on: the case goes back to whoever raised it, and that person is woken up to supply what is missing instead of the case hanging unanswered. It only accepts a supervisor escalation whose target session is your own - only the session an escalation names may answer it - and an escalation addressed to Boss is the Boss's to decide and is refused for you. Resolving it cascades: the member who raised the escalation is woken up with your decision. complete requires all tasks accepted - independently reviewed in the standard mode, self-accepted in the lightweight mode - and a final summary with evidenceRefs. action="export" returns the project as a Markdown report: the objective, every task with its delivery, evidence and review, the exceptions and how they were decided, and the full timeline. Use it when the user asks for a summary, a handover, or a status write-up of the project. Project and task IDs come from create/get/add_task. Reads never invoke models. Dispatch is asynchronous and starts the child session immediately; wait for child completion reports instead of polling. Do not use session_spawn, session_dispatch, task or workflow to bypass the project's delegation and reporting chain. Never claim success on an error.`;
1142
1142
 
1143
1143
  export function readProjectConfig(env: Record<string, string | undefined>) {
1144
1144
  return { endpoint: env[PROJECT_ENDPOINT_ENV] ?? "", conversationId: env[TASK_CONVERSATION_ENV] ?? "", workspaceId: env.SUPER_PI_ORCHESTRATOR_WORKSPACE ?? "", capability: env[TASK_CAPABILITY_ENV] };
@@ -312,16 +312,20 @@ const extension = (pi: ExtensionApi): void => {
312
312
  action: Type.Union(["create", "start", "get", "list", "add_task", "dispatch", "submit", "request_review", "review", "update_task", "report", "escalate", "resolve_escalation", "complete", "cancel", "export"].map((value) => Type.Literal(value))),
313
313
  projectId: Type.Optional(Type.String()), taskId: Type.Optional(Type.String()),
314
314
  parentTaskId: Type.Optional(Type.String()), role: Type.Optional(Type.Union([Type.Literal("leader"), Type.Literal("executor")])),
315
- title: Type.Optional(Type.String()), objective: Type.Optional(Type.String()),
316
- deliverables: Type.Optional(Type.Array(Type.String())), acceptanceCriteria: Type.Optional(Type.Array(Type.String())), constraints: Type.Optional(Type.Array(Type.String())), dependencies: Type.Optional(Type.Array(Type.String())),
317
- risk: Type.Optional(Type.String()),
315
+ title: Type.Optional(Type.String({ description: "Required for action=\"create\" (and add_task): short project or task title." })),
316
+ objective: Type.Optional(Type.String({ description: "Required for action=\"create\" (and add_task): what the project or task should achieve." })),
317
+ deliverables: Type.Optional(Type.Array(Type.String(), { description: "Optional deliverables list. Omit if not needed; does not block starting." })),
318
+ acceptanceCriteria: Type.Optional(Type.Array(Type.String(), { description: "Optional acceptance criteria list. Omit if not needed; does not block starting." })),
319
+ constraints: Type.Optional(Type.Array(Type.String(), { description: "Optional constraints list. Omit if not needed; does not block starting." })),
320
+ dependencies: Type.Optional(Type.Array(Type.String())),
321
+ risk: Type.Optional(Type.String({ description: "Optional risk level (defaults to low; any value is accepted without error)." })),
318
322
  mode: Type.Optional(Type.Union([Type.Literal("standard"), Type.Literal("lightweight")])),
319
323
  priority: Type.Optional(Type.String()), status: Type.Optional(Type.String()), blockedReason: Type.Optional(Type.String()),
320
324
  tasks: Type.Optional(Type.Array(Type.Object({
321
325
  title: Type.String(), objective: Type.String(),
322
326
  deliverables: Type.Optional(Type.Array(Type.String())), acceptanceCriteria: Type.Optional(Type.Array(Type.String())),
323
327
  dependencies: Type.Optional(Type.Array(Type.String())), priority: Type.Optional(Type.String()),
324
- }))),
328
+ }), { description: "Optional initial top-level tasks. Omit to let the leader decompose and dispatch." })),
325
329
  output: Type.Optional(Type.String()), evidenceRefs: Type.Optional(Type.Array(Type.String())), verdict: Type.Optional(Type.String()), summary: Type.Optional(Type.String()),
326
330
  kind: Type.Optional(Type.String()), progress: Type.Optional(Type.String()), variance: Type.Optional(Type.String()), nextStep: Type.Optional(Type.String()),
327
331
  risks: Type.Optional(Type.Array(Type.String())), decisionNeeded: Type.Optional(Type.String()), reason: Type.Optional(Type.String()), severity: Type.Optional(Type.String()),
@@ -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-11T11:59:17.007Z"
43
+ "recordedAt": "2026-11-11T12:39:20.364Z"
44
44
  }
@@ -41,7 +41,7 @@ export type CreateProjectInput = {
41
41
  deliverables?: unknown;
42
42
  acceptanceCriteria?: unknown;
43
43
  constraints?: unknown;
44
- risk?: ProjectRisk;
44
+ risk?: ProjectRisk | (string & {});
45
45
  ownerConversationId?: string;
46
46
  defaultLeaderProfile?: unknown;
47
47
  defaultExecutorProfile?: unknown;
@@ -30,7 +30,7 @@ const text = (value, label) => {
30
30
  };
31
31
  const optional = (value, label) => value === undefined ? undefined : text(value, label);
32
32
  const strings = (value, label) => {
33
- if (value === undefined)
33
+ if (value === undefined || value === null)
34
34
  return [];
35
35
  if (!Array.isArray(value) || value.length > 100)
36
36
  throw new Error(`${label} 必须是最多 100 项的字符串数组`);
@@ -1158,8 +1158,8 @@ export class ProjectService {
1158
1158
  const workspaceId = this.workspace(input.workspaceId);
1159
1159
  if (input.ownerConversationId !== undefined)
1160
1160
  throw new Error("项目负责人由启动操作创建独立会话");
1161
- if (input.risk !== undefined && !["low", "medium", "high"].includes(input.risk))
1162
- throw new Error("项目风险等级不合法");
1161
+ const rawRisk = typeof input.risk === "string" ? input.risk.trim().toLowerCase() : "";
1162
+ const risk = rawRisk === "medium" || rawRisk === "high" ? rawRisk : "low";
1163
1163
  // THE MODE IS CHOSEN ONCE, AT BIRTH, AND IT IS A CLOSED SET. A typo must not silently buy a
1164
1164
  // project the standard shape, because the standard shape is the one with the reviewer.
1165
1165
  if (input.mode !== undefined && input.mode !== "standard" && input.mode !== "lightweight")
@@ -1177,7 +1177,7 @@ export class ProjectService {
1177
1177
  const now = stamp();
1178
1178
  const p = { id: `project_${randomUUID()}`, workspaceId, title: text(input.title, "项目标题"), objective: text(input.objective, "项目目标"),
1179
1179
  deliverables: strings(input.deliverables, "交付物"), acceptanceCriteria: strings(input.acceptanceCriteria, "验收标准"), constraints: strings(input.constraints, "约束"),
1180
- risk: input.risk ?? "low", status: "planning",
1180
+ risk, status: "planning",
1181
1181
  // A project without a mode is a standard project: the mode is written down only when it was
1182
1182
  // asked for, so every project that existed before the mode existed reads as standard.
1183
1183
  ...(input.mode ? { mode: input.mode } : {}),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evandu/super-pi",
3
- "version": "0.1.186",
3
+ "version": "0.1.187",
4
4
  "description": "Web control plane and companion for Pi",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -94,6 +94,7 @@
94
94
  "scripts/session-result-callback-e2e.test.mjs",
95
95
  "scripts/session-orchestrator-tools.test.mjs",
96
96
  "scripts/project-service.test.mjs",
97
+ "scripts/project-ceremony-free.test.mjs",
97
98
  "scripts/dead-end-decision.test.mjs",
98
99
  "scripts/project-report-exception-title.test.mjs",
99
100
  "scripts/project-report-decision-layout.test.mjs",