@evandu/super-pi 0.1.160 → 0.1.162

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 (40) 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-DeH4azrn.js → CodeMirrorEditor-Ch1Ipz3r.js} +2 -2
  5. package/dist/client/assets/{dist-CdG0dOlF.js → dist-B0NwzG2K.js} +1 -1
  6. package/dist/client/assets/{dist-Bl20l56d.js → dist-BAxkLl0w.js} +1 -1
  7. package/dist/client/assets/{dist-CNdHgilU.js → dist-BGN6sRpP.js} +1 -1
  8. package/dist/client/assets/{dist-7jfYXjWH.js → dist-B_k2ubHz.js} +1 -1
  9. package/dist/client/assets/{dist-DefZp4Fa.js → dist-BelPaaJY.js} +1 -1
  10. package/dist/client/assets/{dist-DjepRcJQ.js → dist-BofmoyAA.js} +1 -1
  11. package/dist/client/assets/{dist-u0a7h80y.js → dist-BucgltXJ.js} +1 -1
  12. package/dist/client/assets/{dist-QI-T3k9i.js → dist-COh20l57.js} +1 -1
  13. package/dist/client/assets/{dist-CgShg9H1.js → dist-CZfh2TpC.js} +1 -1
  14. package/dist/client/assets/{dist-Fa50HH8A.js → dist-C_rEORol.js} +1 -1
  15. package/dist/client/assets/{dist-CBAhomD3.js → dist-Chs1uuQX.js} +1 -1
  16. package/dist/client/assets/{dist-CsDwtK1F.js → dist-CmFGh26v.js} +1 -1
  17. package/dist/client/assets/{dist-BotfOUXo.js → dist-Cp0He9AW.js} +1 -1
  18. package/dist/client/assets/{dist-CrwnaHWk.js → dist-D5kM2io7.js} +1 -1
  19. package/dist/client/assets/{dist-CrIX2hon.js → dist-DsvKYPCw.js} +1 -1
  20. package/dist/client/assets/{dist-C1FnggSV.js → dist-EWYaYkiN.js} +1 -1
  21. package/dist/client/assets/{dist-BeLF-5JB.js → dist-L0PobKDk.js} +1 -1
  22. package/dist/client/assets/{dist-CA4ywFCU.js → dist-MIa-fDZ9.js} +1 -1
  23. package/dist/client/assets/{dist-C1iGzBNB.js → dist-PaqaOBBw.js} +1 -1
  24. package/dist/client/assets/{dist-DWHnCS4H.js → dist-opu-Ndfn.js} +1 -1
  25. package/dist/client/assets/{dist-Br9aGZZB.js → dist-phbezeQa.js} +1 -1
  26. package/dist/client/assets/{dist-ClXbSHKM.js → dist-sV52WV4g.js} +1 -1
  27. package/dist/client/assets/{index-D3XEFVty.js → index-PN2dNRnQ.js} +10 -10
  28. package/dist/client/assets/{index-CYvr3uNw.css → index-unAm6EaY.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 +86 -1
  33. package/dist/server/application/project-service.js +389 -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 +17 -0
  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 +3 -2
@@ -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-D3XEFVty.js"></script>
12
- <link rel="stylesheet" crossorigin href="/assets/index-CYvr3uNw.css">
11
+ <script type="module" crossorigin src="/assets/index-PN2dNRnQ.js"></script>
12
+ <link rel="stylesheet" crossorigin href="/assets/index-unAm6EaY.css">
13
13
  </head>
14
14
  <body>
15
15
  <div id="root"></div>
@@ -44,10 +44,16 @@ export declare class ConversationService {
44
44
  * tree's edge (`parentConversationId`) and its origin. Only the orchestrator passes it - the "+"
45
45
  * button and every other caller create a top-level conversation by omission, which is the same
46
46
  * "absence means top level" rule the pre-tree state.json files read under.
47
+ *
48
+ * `separateMemoryTree` says that this conversation is its own working context: it must not
49
+ * inherit the memory tree of the conversation it hangs under. A project leader is the case that
50
+ * needs it - it sits in the user's chat in the sidebar, and it shares nothing of that chat's
51
+ * tree-scoped memories with it.
47
52
  */
48
53
  createConversation(workspaceId: string, parentage?: {
49
54
  parentConversationId?: string;
50
55
  origin?: "user" | "orchestrator";
56
+ separateMemoryTree?: boolean;
51
57
  }, cwd?: string): Promise<string>;
52
58
  /**
53
59
  * Name a conversation from what was said in it. Returns the title; the CALLER applies it, because the
@@ -50,6 +50,11 @@ export class ConversationService {
50
50
  * tree's edge (`parentConversationId`) and its origin. Only the orchestrator passes it - the "+"
51
51
  * button and every other caller create a top-level conversation by omission, which is the same
52
52
  * "absence means top level" rule the pre-tree state.json files read under.
53
+ *
54
+ * `separateMemoryTree` says that this conversation is its own working context: it must not
55
+ * inherit the memory tree of the conversation it hangs under. A project leader is the case that
56
+ * needs it - it sits in the user's chat in the sidebar, and it shares nothing of that chat's
57
+ * tree-scoped memories with it.
53
58
  */
54
59
  async createConversation(workspaceId, parentage, cwd) {
55
60
  const workspace = this.store.workspace(workspaceId);
@@ -128,7 +133,7 @@ export class ConversationService {
128
133
  // `null` is intentional here: Store uses it to remove a workspace value that it
129
134
  // would otherwise have copied before applying the resolved configuration.
130
135
  const sessionCwd = await normalizeSessionCwd(workspace.path, cwd);
131
- const defaults = { ...resolved, agentId: resolved.agentId ?? null, model: resolved.model ?? null, thinkingLevel: resolved.thinkingLevel ?? null, ...(sessionCwd ? { cwd: sessionCwd } : {}), ...(modelNotice ? { modelNotice } : {}), ...(agentNotice ? { agentNotice } : {}), ...(parentage ? { parentConversationId: parentage.parentConversationId, origin: parentage.origin } : {}) };
136
+ const defaults = { ...resolved, agentId: resolved.agentId ?? null, model: resolved.model ?? null, thinkingLevel: resolved.thinkingLevel ?? null, ...(sessionCwd ? { cwd: sessionCwd } : {}), ...(modelNotice ? { modelNotice } : {}), ...(agentNotice ? { agentNotice } : {}), ...(parentage ? { parentConversationId: parentage.parentConversationId, origin: parentage.origin } : {}), ...(parentage?.separateMemoryTree ? { separateMemoryTree: true } : {}) };
132
137
  const created = await this.store.createConversation(workspaceId, defaults);
133
138
  this.broadcaster.broadcastState();
134
139
  return created.id;
@@ -1,5 +1,5 @@
1
1
  import type { Store } from "../store.js";
2
- import type { Project, ProjectEscalation, ProjectReport, ProjectRisk, ProjectTask, SessionProfile } from "../types.js";
2
+ import type { Project, ProjectEscalation, ProjectMode, ProjectReport, ProjectRisk, ProjectTask, SessionProfile } from "../types.js";
3
3
  import type { SessionOrchestratorService } from "./session-orchestrator-service.js";
4
4
  export declare const profile: (value: unknown, label: string) => SessionProfile | undefined;
5
5
  export declare const mergeProfile: (taskProfile?: SessionProfile, projectDefault?: SessionProfile) => SessionProfile | undefined;
@@ -20,6 +20,9 @@ export type CreateProjectInput = {
20
20
  defaultExecutorProfile?: unknown;
21
21
  defaultReviewerProfile?: unknown;
22
22
  initiatorConversationId?: string;
23
+ /** "standard" (the default) or "lightweight" - the small project's shape, where the project
24
+ * leader session does the work itself and no independent reviewer session exists. */
25
+ mode?: ProjectMode;
23
26
  };
24
27
  export type AddTaskInput = Partial<ProjectTask> & {
25
28
  title: string;
@@ -36,6 +39,16 @@ export type TopLevelTaskPlan = {
36
39
  priority?: ProjectTask["priority"];
37
40
  dependencies: string[];
38
41
  };
42
+ /** What one click on 「提到 N Token 并继续」 produced. */
43
+ export type BudgetRaiseResult = {
44
+ project: Project;
45
+ /** The cap before the raise, so the panel can say what changed. */
46
+ previousMaxTokens: number;
47
+ /** The cap the server raised it to - the number the one-click button promised. */
48
+ suggestedMaxTokens: number;
49
+ /** How many budget exceptions were closed by the raise. */
50
+ resolvedEscalations: number;
51
+ };
39
52
  /** Persist explicit domain fields only; transport credentials never enter project records. */
40
53
  export declare class ProjectService {
41
54
  private readonly store;
@@ -44,6 +57,16 @@ export declare class ProjectService {
44
57
  constructor(store: Store, orchestrator?: (Pick<SessionOrchestratorService, "spawn" | "dispatch"> & Partial<Pick<SessionOrchestratorService, "stopSubtree">>) | undefined);
45
58
  static taskView(task: ProjectTask, project: Pick<Project, "defaultExecutorProfile" | "defaultReviewerProfile">): ProjectTask;
46
59
  private projectView;
60
+ /**
61
+ * THE NUMBER THE ONE-CLICK PATH OFFERS.
62
+ *
63
+ * The Boss does not type a budget when the budget runs out: a number typed in a hurry is a
64
+ * number nobody predicted, and a budget that is guessed wrong is the failure this whole path
65
+ * exists to remove. So the server suggests one instead - double what has already been spent,
66
+ * because an agent run that needed twice its first budget will need twice its second one, and
67
+ * never less than one token more than the current cap, so the offer always really raises it.
68
+ */
69
+ private suggestedMaxTokens;
47
70
  private raw;
48
71
  private workspace;
49
72
  private event;
@@ -52,6 +75,20 @@ export declare class ProjectService {
52
75
  private leader;
53
76
  private topLevelAuthor;
54
77
  private manager;
78
+ /**
79
+ * DOES THIS TASK COUNT AS ACCEPTED?
80
+ *
81
+ * In a STANDARD project, acceptance means another session reviewed this delivery: the reviewer
82
+ * of the review must be the session that was spawned to review, and it must NOT be the session
83
+ * that did the work. Those conditions are the whole point of an independent review, so they
84
+ * stand exactly as they were.
85
+ *
86
+ * In a LIGHTWEIGHT project there is no reviewer session at all - the leader session does the
87
+ * work itself - so a delivery is accepted on the executor's own evidence. The flag that says so
88
+ * is written by `submit` and nowhere else, and it names the session that made the call, so a
89
+ * task with no accepted review at all still counts for nothing.
90
+ */
91
+ private taskAccepted;
55
92
  private requiredComplete;
56
93
  private task;
57
94
  private member;
@@ -59,6 +96,20 @@ export declare class ProjectService {
59
96
  private resources;
60
97
  list(workspaceId?: string): Project[];
61
98
  get(id: string, workspaceId?: string): Project;
99
+ /**
100
+ * THE PROJECT AS A REPORT A HUMAN CAN READ.
101
+ *
102
+ * Everything the panel shows in pieces - the objective, the tasks and who did them, the
103
+ * deliveries and their evidence, the reviews that accepted them, the exceptions and how they
104
+ * were decided - in one piece of Markdown, in reading order.
105
+ *
106
+ * TWO THINGS THIS REPORT REFUSES TO DO. It prints no session handle: a conversation id is a
107
+ * machine address, and a report full of addresses is not something a person can read or paste
108
+ * into a weekly note - the session's own title is used instead. And it prints no credential of
109
+ * any kind: the CONTENT of the tasks, events, reports and exceptions is the report, and a
110
+ * capability or a token that happens to live in a session profile is not content.
111
+ */
112
+ exportReport(id: string, workspaceId?: string): Promise<string>;
62
113
  projectForSession(conversationId: string): Project | undefined;
63
114
  create(input: CreateProjectInput, initiatorConversationId?: string): Promise<Project>;
64
115
  private admission;
@@ -80,10 +131,44 @@ export declare class ProjectService {
80
131
  workspaceId?: string;
81
132
  }, actor?: string): Promise<ProjectTask>;
82
133
  updateStatus(id: string, status: Project["status"], workspaceId?: string): Promise<Project>;
134
+ /**
135
+ * THE SESSION THAT OPENED THE PROJECT MAY CANCEL IT.
136
+ *
137
+ * There is no delete here, and that is deliberate. The project record, its tasks, its events and
138
+ * its evidence references are the trail of what was tried; a project that went nowhere is
139
+ * evidence too. Cancelling stops the work and marks the project cancelled - the record stays,
140
+ * readable, with the reason attached.
141
+ *
142
+ * Only the session that opened the project may do this. A worker or a reviewer that could
143
+ * cancel the project it belongs to would have a way to make its own budget and concurrency
144
+ * guards disappear, and those guards are the only thing between a runaway agent and an
145
+ * unbounded bill. The human path - the panel's stop button - is unchanged and stays the Boss's.
146
+ *
147
+ * A reason is required: "we changed our minds" and "the customer shipped it last night" are
148
+ * different decisions, and the timeline is where that difference has to show up.
149
+ */
150
+ cancel(id: string, body: Record<string, any>, workspaceId: string, actor: string): Promise<Project>;
83
151
  updateBudget(id: string, input: {
84
152
  maxTokens?: number;
85
153
  maxConcurrent?: number;
86
154
  }, workspaceId: string): Promise<Project>;
155
+ /**
156
+ * ONE CLICK: RAISE THE BUDGET AND LET THE WORK CONTINUE.
157
+ *
158
+ * Three things happen here, and they happen together: the cap goes up to a number the SERVER
159
+ * computed, the budget exception that is waiting for a decision is closed, and the work that
160
+ * was blocked is woken up again. Doing them apart is what made the old path painful - a Boss
161
+ * had to open a form, type a number, press save, and then wake the leader by hand, and every
162
+ * one of those steps was a chance to stop halfway.
163
+ *
164
+ * IT IS A BOSS OPERATION. A session may not raise the budget of its own project: the budget is
165
+ * the Boss's stop, and an agent that could lift its own limit would not have one. The HTTP
166
+ * layer refuses a request that carries a capability for the same reason.
167
+ *
168
+ * The manual `updateBudget` stays a SEPARATE intent: adjusting a number is not the same as
169
+ * asking for the work to continue, so the manual path does not continue anything.
170
+ */
171
+ raiseBudgetAndContinue(id: string, workspaceId: string, callerConversationId?: string): Promise<BudgetRaiseResult>;
87
172
  addReport(id: string, input: Omit<ProjectReport, "id" | "projectId" | "createdAt">, workspaceId?: string, actor?: string): Promise<ProjectReport>;
88
173
  addEscalation(id: string, input: Pick<ProjectEscalation, "reason" | "severity" | "taskId">, workspaceId?: string, actor?: string): Promise<ProjectEscalation>;
89
174
  resolveEscalation(id: string, escalationId: string, decision: string, status: "resolved" | "dismissed", workspaceId?: string): Promise<ProjectEscalation>;