@evandu/super-pi 0.1.186 → 0.1.188
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.
- package/agents/super-pi-task/core.ts +130 -1
- package/agents/super-pi-task/index.ts +64 -5
- package/dist/client/.super-pi-client-sources.json +1 -1
- package/dist/server/agents.d.ts +1 -1
- package/dist/server/agents.js +1 -1
- package/dist/server/application/project-service.d.ts +26 -1
- package/dist/server/application/project-service.js +50 -4
- package/dist/server/application/session-orchestrator-service.js +8 -0
- package/dist/server/application/session-reminder-service.d.ts +55 -0
- package/dist/server/application/session-reminder-service.js +121 -0
- package/dist/server/conversation-usage.js +2 -2
- package/dist/server/http-server.js +111 -4
- package/dist/server/index.js +3 -0
- package/dist/server/json-comments.d.ts +14 -0
- package/dist/server/json-comments.js +71 -0
- package/dist/server/model-context-window.d.ts +34 -0
- package/dist/server/model-context-window.js +76 -0
- package/dist/server/models-store.d.ts +36 -0
- package/dist/server/models-store.js +132 -0
- package/dist/server/pi-session.js +3 -2
- package/dist/server/providers.js +10 -2
- package/dist/server/runtime.js +6 -2
- package/dist/server/server-context.d.ts +1 -0
- package/dist/server/task-tool.d.ts +3 -0
- package/dist/server/task-tool.js +12 -0
- package/package.json +2 -1
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THE CATALOGUE PI FETCHED, AND WHAT IT SAYS A MODEL REALLY HAS.
|
|
3
|
+
*
|
|
4
|
+
* WHAT THIS FILE IS. `~/.pi/agent/models-store.json` is Pi's own copy of every provider's model
|
|
5
|
+
* list, refreshed when Pi asks the provider what it serves. Each entry carries the two numbers
|
|
6
|
+
* that decide how a model actually behaves: `contextWindow` (how much conversation fits) and
|
|
7
|
+
* `maxTokens` (how much a SINGLE answer may be). Those are different things and they stay
|
|
8
|
+
* different here - the store keeps them apart, and so does everything that reads them.
|
|
9
|
+
*
|
|
10
|
+
* WHY IT IS THE TRUTH. Measured on this machine, the store says `MiniMax-M3` has a context window
|
|
11
|
+
* of 1,000,000 and a max output of 512,000, while `models.json` - the file Super Pi writes when it
|
|
12
|
+
* discovers that model - said 128,000 for every one of the provider's nine models. The provider was
|
|
13
|
+
* never asked; Super Pi stamped its own default and the stamp was later read back as if a person had
|
|
14
|
+
* typed it. The result: a model with a million tokens of room ran a session that believed it had a
|
|
15
|
+
* hundred and twenty-eight thousand, and a long task could not be finished.
|
|
16
|
+
*
|
|
17
|
+
* SO THE RULE IS: THE CATALOGUE IS THE TRUTH, AND A FILE SUPER PI WROTE IS NOT A DECISION. A number
|
|
18
|
+
* a person wrote down still wins over the catalogue (see `model-context-window.ts`), but Super Pi's
|
|
19
|
+
* own default is a placeholder, not an opinion, and a placeholder never outranks the truth.
|
|
20
|
+
*
|
|
21
|
+
* IT IS AN OPTIONAL FILE, SO IT IS READ WITHOUT EVER FAILING. A missing catalogue, a catalogue that
|
|
22
|
+
* is not JSON, a catalogue whose shape is not what we expect - all of them mean "Super Pi knows
|
|
23
|
+
* nothing about this model", never "Super Pi refuses to start".
|
|
24
|
+
*/
|
|
25
|
+
import { readFileSync, statSync } from "node:fs";
|
|
26
|
+
import { join } from "node:path";
|
|
27
|
+
import { stripJsonComments } from "./json-comments.js";
|
|
28
|
+
/** A catalogue nobody could read. It knows nothing, and it says so without throwing. */
|
|
29
|
+
const EMPTY_STORE = { byModel: new Map(), byProviderModel: new Map() };
|
|
30
|
+
/** The file Pi writes the catalogue into, next to the file it writes providers into. */
|
|
31
|
+
export function modelStorePath(agentDir) {
|
|
32
|
+
return join(agentDir, "models-store.json");
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The catalogue, read from disk.
|
|
36
|
+
*
|
|
37
|
+
* The file is re-read only when it actually changed: every session and every turn asks for it, and
|
|
38
|
+
* parsing thirty kilobytes of JSON per turn to learn the same thing is waste. The check is the
|
|
39
|
+
* file's modification time and size, so an edit by Pi is seen immediately.
|
|
40
|
+
*/
|
|
41
|
+
const cache = new Map();
|
|
42
|
+
export function readModelStore(agentDir) {
|
|
43
|
+
const path = modelStorePath(agentDir);
|
|
44
|
+
try {
|
|
45
|
+
const stat = statSync(path);
|
|
46
|
+
const cached = cache.get(path);
|
|
47
|
+
if (cached && cached.mtimeMs === stat.mtimeMs && cached.size === stat.size)
|
|
48
|
+
return cached.store;
|
|
49
|
+
const store = parseModelStore(JSON.parse(stripJsonComments(readFileSync(path, "utf8"))));
|
|
50
|
+
cache.set(path, { mtimeMs: stat.mtimeMs, size: stat.size, store });
|
|
51
|
+
return store;
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
// NO CATALOGUE IS NOT A FAILURE. It is the state of every machine where Pi has not fetched one
|
|
55
|
+
// yet, and the answer is "Super Pi knows nothing about this model", not an exception.
|
|
56
|
+
return EMPTY_STORE;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* The catalogue as data.
|
|
61
|
+
*
|
|
62
|
+
* The shape Pi writes is `{ <provider id>: { models: [{ id, contextWindow, maxTokens }] } }`, and a
|
|
63
|
+
* shape with the providers nested one level deeper is read too - Pi has moved this file around
|
|
64
|
+
* before, and a catalogue in a slightly different shape is still a catalogue.
|
|
65
|
+
*/
|
|
66
|
+
export function parseModelStore(raw) {
|
|
67
|
+
const store = { byModel: new Map(), byProviderModel: new Map() };
|
|
68
|
+
collectProvider(raw, "", store, 0);
|
|
69
|
+
return store;
|
|
70
|
+
}
|
|
71
|
+
/** How deep the shape may nest before we call it something we do not understand. */
|
|
72
|
+
const MAX_NESTING = 4;
|
|
73
|
+
function collectProvider(entry, providerId, store, depth) {
|
|
74
|
+
if (!entry || typeof entry !== "object" || depth > MAX_NESTING)
|
|
75
|
+
return;
|
|
76
|
+
const record = entry;
|
|
77
|
+
const models = record.models;
|
|
78
|
+
if (Array.isArray(models)) {
|
|
79
|
+
for (const model of models)
|
|
80
|
+
collectModel(model, providerId, store);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
for (const [nestedId, nested] of Object.entries(record)) {
|
|
84
|
+
collectProvider(nested, nestedId, store, depth + 1);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
function collectModel(model, providerId, store) {
|
|
88
|
+
if (!model || typeof model !== "object")
|
|
89
|
+
return;
|
|
90
|
+
const record = model;
|
|
91
|
+
const id = typeof record.id === "string" ? record.id.trim() : typeof record.name === "string" ? record.name.trim() : "";
|
|
92
|
+
if (!id)
|
|
93
|
+
return;
|
|
94
|
+
const entry = {};
|
|
95
|
+
if (typeof record.contextWindow === "number" && Number.isFinite(record.contextWindow) && record.contextWindow > 0) {
|
|
96
|
+
entry.contextWindow = record.contextWindow;
|
|
97
|
+
}
|
|
98
|
+
if (typeof record.maxTokens === "number" && Number.isFinite(record.maxTokens) && record.maxTokens > 0) {
|
|
99
|
+
entry.maxTokens = record.maxTokens;
|
|
100
|
+
}
|
|
101
|
+
if (entry.contextWindow === undefined && entry.maxTokens === undefined)
|
|
102
|
+
return;
|
|
103
|
+
const key = id.toLowerCase();
|
|
104
|
+
store.byProviderModel.set(`${providerId.toLowerCase()}/${key}`, entry);
|
|
105
|
+
const known = store.byModel.get(key);
|
|
106
|
+
// THE SAME MODEL UNDER TWO PROVIDERS. The catalogue says the same thing about it in both places,
|
|
107
|
+
// but when it does not, the larger window is the one the model actually has - a smaller duplicate
|
|
108
|
+
// is an older or narrower copy of the same truth, and taking it is how a million-token model
|
|
109
|
+
// ends up being treated as a hundred-and-twenty-eight-thousand-token one.
|
|
110
|
+
if (!known || (entry.contextWindow ?? 0) > (known.contextWindow ?? 0))
|
|
111
|
+
store.byModel.set(key, entry);
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* What the catalogue says about one model.
|
|
115
|
+
*
|
|
116
|
+
* The provider-specific entry is preferred when the catalogue has one, because a provider may serve
|
|
117
|
+
* a model under a different limit than another provider does. The model-id entry is the fallback,
|
|
118
|
+
* and it is what makes the lookup work for a provider id the user invented.
|
|
119
|
+
*/
|
|
120
|
+
export function storeWindowFor(store, modelId, providerId) {
|
|
121
|
+
if (!store)
|
|
122
|
+
return undefined;
|
|
123
|
+
const key = modelId.trim().toLowerCase();
|
|
124
|
+
if (!key)
|
|
125
|
+
return undefined;
|
|
126
|
+
if (providerId) {
|
|
127
|
+
const scoped = store.byProviderModel.get(`${providerId.trim().toLowerCase()}/${key}`);
|
|
128
|
+
if (scoped)
|
|
129
|
+
return scoped;
|
|
130
|
+
}
|
|
131
|
+
return store.byModel.get(key);
|
|
132
|
+
}
|
|
@@ -27,7 +27,7 @@ import { existsSync, statSync } from "node:fs";
|
|
|
27
27
|
import { open, readdir } from "node:fs/promises";
|
|
28
28
|
import { StringDecoder } from "node:string_decoder";
|
|
29
29
|
import { dirname, join, resolve } from "node:path";
|
|
30
|
-
import {
|
|
30
|
+
import { arbitrateContextWindow, readDeclaredWindows, readStoreWindows } from "./model-context-window.js";
|
|
31
31
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
32
32
|
const traceSession = (conversationId, phase, startedAt, extra = "") => {
|
|
33
33
|
if (process.env.SUPER_PI_TRACE_LATENCY !== "1")
|
|
@@ -336,12 +336,13 @@ export async function createPiSession(creation) {
|
|
|
336
336
|
// So the person's file wins: a number somebody typed is a decision, and a number a catalogue
|
|
337
337
|
// fetched is a claim. See `model-context-window.ts` for the whole reasoning.
|
|
338
338
|
const declared = readDeclaredWindows(agentDir);
|
|
339
|
+
const catalogue = readStoreWindows(agentDir);
|
|
339
340
|
live.resolveModel = (provider, modelId) => {
|
|
340
341
|
const found = modelRuntime.getModel?.(provider, modelId);
|
|
341
342
|
if (!found || typeof found !== "object")
|
|
342
343
|
return undefined;
|
|
343
344
|
const model = found;
|
|
344
|
-
const window =
|
|
345
|
+
const window = arbitrateContextWindow(declared, catalogue, provider, modelId, model.contextWindow);
|
|
345
346
|
// The model is handed to Pi WHOLE - it is what the agent runs on - so this is where the
|
|
346
347
|
// corrected window has to be. A model Super Pi has no opinion about is handed over untouched.
|
|
347
348
|
return window === undefined ? model : { ...model, contextWindow: window };
|
package/dist/server/providers.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { randomUUID } from "node:crypto";
|
|
2
2
|
import { mkdir, readFile, rename, stat, writeFile } from "node:fs/promises";
|
|
3
3
|
import { dirname, join } from "node:path";
|
|
4
|
+
import { readModelStore, storeWindowFor } from "./models-store.js";
|
|
4
5
|
/**
|
|
5
6
|
* The API adapters Pi ships, as the ids a provider may name.
|
|
6
7
|
*
|
|
@@ -811,8 +812,15 @@ export function parseRemoteModels(payload) {
|
|
|
811
812
|
const lower = id.toLowerCase();
|
|
812
813
|
const reasoning = /r1|reason|o1|o3|thinking|qwq|deepseek-r1/i.test(lower);
|
|
813
814
|
const imageInput = /vision|vl|4o|gemini|claude-3|flash|pixtral/i.test(lower);
|
|
814
|
-
|
|
815
|
-
|
|
815
|
+
// THE CATALOGUE IS ASKED BEFORE THE DEFAULT IS GUESSED. A model the provider did not describe
|
|
816
|
+
// used to fall straight to the placeholder 128000/16384, and that stamp was later read back as
|
|
817
|
+
// if a person had chosen it - which is how MiniMax-M3 (a 1,000,000-token model) came to believe
|
|
818
|
+
// it had 128,000. Only a model with NO catalogue entry takes the default.
|
|
819
|
+
const catalogue = storeWindowFor(readModelStore(piAgentDir()), id);
|
|
820
|
+
const contextWindow = typeof rec.context_window === "number"
|
|
821
|
+
? rec.context_window
|
|
822
|
+
: catalogue?.contextWindow ?? DEFAULT_CONTEXT_WINDOW;
|
|
823
|
+
const maxTokens = reasoning ? 32768 : catalogue?.maxTokens ?? DEFAULT_MAX_TOKENS;
|
|
816
824
|
discovered.push({
|
|
817
825
|
id,
|
|
818
826
|
name: id,
|
package/dist/server/runtime.js
CHANGED
|
@@ -24,7 +24,7 @@ import { LengthExceededError } from "./turn-failure.js";
|
|
|
24
24
|
// paths recognise a delivery identically. Re-exported because they were part of this module's surface.
|
|
25
25
|
export { describeDeliveredUserMessage, describePiQueue } from "./pi-session-events.js";
|
|
26
26
|
import { createPiSession, createSdkCatalog, piSdkAvailable, resolveTranscriptFile, superPiExtensionPaths } from "./pi-session.js";
|
|
27
|
-
import { TASK_CONVERSATION_ENV, PARENT_CONVERSATION_ENV, TASK_DEPTH_ENV, TASK_ENDPOINT_ENV, TASK_EXEC_ENDPOINT_ENV, TASK_ROSTER_ENV, TASK_TOOL_NAME, TODO_ENDPOINT_ENV, TODO_TOOL_NAME, PROJECT_TOOL_NAME, PROJECT_ENDPOINT_ENV, SCHEDULED_TASK_ENDPOINT_ENV, SCHEDULED_TASK_TOOL_NAME, WORKFLOW_ENDPOINT_ENV, WORKFLOW_TOOL_NAME, RUN_ASYNC_TOOL_NAME, ORCHESTRATOR_ENDPOINT_ENV, ORCHESTRATOR_WORKSPACE_ENV, SESSION_SPAWN_TOOL_NAME, SESSION_STATUS_TOOL_NAME, SESSION_DISPATCH_TOOL_NAME, SESSION_STOP_TOOL_NAME, SESSION_REPORT_TOOL_NAME, SESSION_STOP_SUBTREE_TOOL_NAME, SESSION_REMOVE_TOOL_NAME, rosterPayload, } from "./task-tool.js";
|
|
27
|
+
import { TASK_CONVERSATION_ENV, PARENT_CONVERSATION_ENV, TASK_DEPTH_ENV, TASK_ENDPOINT_ENV, TASK_EXEC_ENDPOINT_ENV, TASK_ROSTER_ENV, TASK_TOOL_NAME, TODO_ENDPOINT_ENV, TODO_TOOL_NAME, PROJECT_TOOL_NAME, PROJECT_ENDPOINT_ENV, SCHEDULED_TASK_ENDPOINT_ENV, SCHEDULED_TASK_TOOL_NAME, WORKFLOW_ENDPOINT_ENV, WORKFLOW_TOOL_NAME, RUN_ASYNC_TOOL_NAME, ORCHESTRATOR_ENDPOINT_ENV, ORCHESTRATOR_WORKSPACE_ENV, SESSION_SPAWN_TOOL_NAME, SESSION_STATUS_TOOL_NAME, SESSION_DISPATCH_TOOL_NAME, SESSION_STOP_TOOL_NAME, SESSION_REPORT_TOOL_NAME, SESSION_STOP_SUBTREE_TOOL_NAME, SESSION_REMOVE_TOOL_NAME, SESSION_REMINDER_TOOL_NAME, rosterPayload, } from "./task-tool.js";
|
|
28
28
|
import { BLOCKING_UI_METHODS, EXTENSION_UI_METHODS, } from "./types.js";
|
|
29
29
|
import { loadConversationImages } from "./upload.js";
|
|
30
30
|
import { describeToolCall, describeToolCallArgs, describeToolCallInProgress, extractPartialResultText, extractToolResultText, readQuestionCall } from "./tool-calls.js";
|
|
@@ -1267,6 +1267,10 @@ export class PiRpcRuntime {
|
|
|
1267
1267
|
names.push(PROJECT_TOOL_NAME);
|
|
1268
1268
|
if (this.options.orchestratorEndpoint)
|
|
1269
1269
|
names.push(SESSION_SPAWN_TOOL_NAME, SESSION_STATUS_TOOL_NAME, SESSION_DISPATCH_TOOL_NAME, SESSION_STOP_TOOL_NAME, SESSION_REPORT_TOOL_NAME, SESSION_STOP_SUBTREE_TOOL_NAME, SESSION_REMOVE_TOOL_NAME);
|
|
1270
|
+
// THE REMINDER TOOL IS A SESSION TOOL, SO IT IS NAMED WHERE THE OTHER SESSION TOOLS ARE
|
|
1271
|
+
// NAMED - on its own line, because the line above is a pinned list and this one belongs to it.
|
|
1272
|
+
if (this.options.orchestratorEndpoint)
|
|
1273
|
+
names.push(SESSION_REMINDER_TOOL_NAME);
|
|
1270
1274
|
return names;
|
|
1271
1275
|
}
|
|
1272
1276
|
/**
|
|
@@ -1485,7 +1489,7 @@ export class PiRpcRuntime {
|
|
|
1485
1489
|
// allowlist and naming a tool Pi has not registered would change the spawn line for every other
|
|
1486
1490
|
// mode. The prompt asks for a bare JSON array and nothing else; if the model spends a turn on a
|
|
1487
1491
|
// tool call anyway the reranker times out and falls back to the lexical order.
|
|
1488
|
-
const agentArgs = memoryReview ? ["--no-extensions", "--no-skills", "--no-mcp", "--no-context-files", "--no-prompt-templates", "--tools", "memory,skill_manage,session_search"] : knowledgeRerank ? ["--no-extensions", "--no-skills", "--no-mcp", "--no-context-files", "--no-prompt-templates"] : await agentSpawnArgs(this.agents.promptDir, agent, { extraAllowedTools: [...(extensionArgs.length ? [TASK_TOOL_NAME, TODO_TOOL_NAME, PROJECT_TOOL_NAME, WORKFLOW_TOOL_NAME, RUN_ASYNC_TOOL_NAME, SCHEDULED_TASK_TOOL_NAME, "question", "tool_register", ...(this.options.orchestratorEndpoint ? [SESSION_SPAWN_TOOL_NAME, SESSION_STATUS_TOOL_NAME, SESSION_DISPATCH_TOOL_NAME, SESSION_STOP_TOOL_NAME, SESSION_REPORT_TOOL_NAME, SESSION_STOP_SUBTREE_TOOL_NAME, SESSION_REMOVE_TOOL_NAME] : [])] : []), ...(memoryEnabled ? ["memory", "skill_manage", "session_search"] : []), ...(knowledgeEnabled ? [KNOWLEDGE_TOOL_NAME, KNOWLEDGE_IMPORT_TOOL_NAME] : []), ...(documentsEnabled ? [DOCUMENT_READ_TOOL_NAME, DOCUMENT_WRITE_TOOL_NAME] : []), ...(webEnabled ? [WEB_SEARCH_TOOL_NAME, WEB_FETCH_TOOL_NAME] : []), ...(feishuEnabled ? [FEISHU_READ_TOOL_NAME, FEISHU_WRITE_TOOL_NAME] : [])] });
|
|
1492
|
+
const agentArgs = memoryReview ? ["--no-extensions", "--no-skills", "--no-mcp", "--no-context-files", "--no-prompt-templates", "--tools", "memory,skill_manage,session_search"] : knowledgeRerank ? ["--no-extensions", "--no-skills", "--no-mcp", "--no-context-files", "--no-prompt-templates"] : await agentSpawnArgs(this.agents.promptDir, agent, { extraAllowedTools: [...(extensionArgs.length ? [TASK_TOOL_NAME, TODO_TOOL_NAME, PROJECT_TOOL_NAME, WORKFLOW_TOOL_NAME, RUN_ASYNC_TOOL_NAME, SCHEDULED_TASK_TOOL_NAME, "question", "tool_register", ...(this.options.orchestratorEndpoint ? [SESSION_SPAWN_TOOL_NAME, SESSION_STATUS_TOOL_NAME, SESSION_DISPATCH_TOOL_NAME, SESSION_STOP_TOOL_NAME, SESSION_REPORT_TOOL_NAME, SESSION_STOP_SUBTREE_TOOL_NAME, SESSION_REMOVE_TOOL_NAME, SESSION_REMINDER_TOOL_NAME] : [])] : []), ...(memoryEnabled ? ["memory", "skill_manage", "session_search"] : []), ...(knowledgeEnabled ? [KNOWLEDGE_TOOL_NAME, KNOWLEDGE_IMPORT_TOOL_NAME] : []), ...(documentsEnabled ? [DOCUMENT_READ_TOOL_NAME, DOCUMENT_WRITE_TOOL_NAME] : []), ...(webEnabled ? [WEB_SEARCH_TOOL_NAME, WEB_FETCH_TOOL_NAME] : []), ...(feishuEnabled ? [FEISHU_READ_TOOL_NAME, FEISHU_WRITE_TOOL_NAME] : [])] });
|
|
1489
1493
|
// Refused here, with the reason, rather than handed to the spawn: an ENOENT from `spawn` reads as
|
|
1490
1494
|
// "the app is broken" and hides the one fact that matters, which is where it looked for Pi.
|
|
1491
1495
|
if (!this.pi.found)
|
|
@@ -73,6 +73,7 @@ export interface ServerContext {
|
|
|
73
73
|
scheduledTaskService?: import("./application/scheduled-task-service.js").ScheduledTaskService;
|
|
74
74
|
sessionLedger?: import("./session-ledger.js").SessionLedger;
|
|
75
75
|
sessionOrchestratorService?: import("./application/session-orchestrator-service.js").SessionOrchestratorService;
|
|
76
|
+
sessionReminderService?: import("./application/session-reminder-service.js").SessionReminderService;
|
|
76
77
|
projectService?: import("./application/project-service.js").ProjectService;
|
|
77
78
|
execService: ExecService;
|
|
78
79
|
toolRegistry: ToolRegistry;
|
|
@@ -262,6 +262,9 @@ export declare const SESSION_STOP_TOOL_NAME = "session_stop";
|
|
|
262
262
|
export declare const SESSION_REPORT_TOOL_NAME = "session_report";
|
|
263
263
|
export declare const SESSION_STOP_SUBTREE_TOOL_NAME = "session_stop_subtree";
|
|
264
264
|
export declare const SESSION_REMOVE_TOOL_NAME = "session_remove";
|
|
265
|
+
export declare const SESSION_REMINDER_TOOL_NAME = "session_reminder";
|
|
266
|
+
/** Model-facing description for session_reminder. */
|
|
267
|
+
export declare const SESSION_REMINDER_DESCRIPTION = "Set an in-session timer that delivers a reminder note back to THIS conversation after a given number of seconds. Multiple reminders can run in parallel, and pending reminders can be cancelled or listed.\n\nWHEN TO USE THIS:\n- Self-reminders and time-based checkpoints (e.g. \"Check child session progress in 60 seconds\", \"Review test run in 120 seconds\").\n- Unlike scheduled_task which runs in a separate independent conversation, session_reminder sends the note back to THIS EXACT conversation as a new turn so you can follow up directly.\n\nActions:\n- \"create\" (default): Schedule a reminder. Requires delaySeconds (or seconds) and note. Returns reminderId.\n- \"cancel\": Cancel a pending reminder. Requires reminderId.\n- \"list\": List all active pending reminders for this conversation.";
|
|
265
268
|
/** Model-facing description for session_spawn. */
|
|
266
269
|
export declare const SESSION_SPAWN_DESCRIPTION = "Create a child conversation in the current workspace and immediately dispatch its initial task. You can specify a primary agent as the child's role.\n\nDIFFERENCE FROM THE 'task' TOOL:\n- The 'task' tool delegates to a transient, one-shot subagent process (scout, critic, patcher) that runs once, returns its final text, and terminates. It has no conversation history and does not appear in the workspace sidebar.\n- 'session_spawn' creates a real, persistent child CONVERSATION in Super Pi. It appears in the sidebar, retains multi-turn message history, can receive follow-up messages via session_dispatch, can be inspected via session_status, and can be stopped via session_stop. The user can also switch to it in the Web UI.\n\nWHEN TO USE THIS:\n- Long-running, multi-phase tracks of work that require ongoing context, multiple turns of dialogue, or independent user visibility.\n- Multi-phase or complex work where the user needs each step to be visible and available for inspection or intervention: create a child session with session_spawn.\n- Parallel work streams (e.g., Track A: backend refactor, Track B: frontend component update) where both need full conversational capabilities.\n- When the user asks you to act as an orchestrator/manager who delegates to multiple sessions.\n\nWHEN NOT TO USE THIS:\n- For one-off, focused delegation with a single answer: use 'task' (with scout/critic/patcher). It is faster, cheaper, and returns directly to your transcript.\n- For running shell commands or build watchers: use 'run_async'.\n- For a single one-off delegation with a single answer: use 'task'.\n\nUsage notes:\n1. Spawning is ASYNCHRONOUS by default: it creates the conversation, enqueues the initial task, and returns the new conversationId immediately. The sibling session runs in the background.\n2. The initial task should provide clear context and goals since the new session starts with a fresh conversation history.\n3. Use session_status with the returned conversationId to check progress, or session_dispatch to send further messages.\n4. The new session reports completion to its DIRECT parent automatically, and that parent is always the calling session. 'parentConversationId' may only repeat the calling session's own id - the server refuses (403) any other session as the parent and creates nothing.\n5. The new session always belongs to the calling session's workspace. Pass 'cwd' as a workspace-relative subdirectory (for example, 'packages/a') when it should work below the workspace root; absolute paths and traversal are rejected.\n6. Optionally pass 'model' to choose which model the NEW session runs on: {\"provider\":\"...\",\"modelId\":\"...\"} - the same \"provider/modelId\" pair the model picker shows, and BOTH halves are required. Leave 'model' out and the new session starts on the workspace default model.\n7. Optionally pass 'watchdogTimeoutSeconds' to declare how long YOU are willing to wait for a report before you want to be reminded: a positive number of seconds. If the new session stays silent that long, you receive a '[Watchdog \u63D0\u9192]' message naming it. A report from the child (session_report) restarts the clock; the watchdog never stops the child. Leave it out to run without a watchdog.";
|
|
267
270
|
/** Model-facing description for session_status. */
|
package/dist/server/task-tool.js
CHANGED
|
@@ -367,6 +367,18 @@ export const SESSION_STOP_TOOL_NAME = "session_stop";
|
|
|
367
367
|
export const SESSION_REPORT_TOOL_NAME = "session_report";
|
|
368
368
|
export const SESSION_STOP_SUBTREE_TOOL_NAME = "session_stop_subtree";
|
|
369
369
|
export const SESSION_REMOVE_TOOL_NAME = "session_remove";
|
|
370
|
+
export const SESSION_REMINDER_TOOL_NAME = "session_reminder";
|
|
371
|
+
/** Model-facing description for session_reminder. */
|
|
372
|
+
export const SESSION_REMINDER_DESCRIPTION = `Set an in-session timer that delivers a reminder note back to THIS conversation after a given number of seconds. Multiple reminders can run in parallel, and pending reminders can be cancelled or listed.
|
|
373
|
+
|
|
374
|
+
WHEN TO USE THIS:
|
|
375
|
+
- Self-reminders and time-based checkpoints (e.g. "Check child session progress in 60 seconds", "Review test run in 120 seconds").
|
|
376
|
+
- Unlike scheduled_task which runs in a separate independent conversation, session_reminder sends the note back to THIS EXACT conversation as a new turn so you can follow up directly.
|
|
377
|
+
|
|
378
|
+
Actions:
|
|
379
|
+
- "create" (default): Schedule a reminder. Requires delaySeconds (or seconds) and note. Returns reminderId.
|
|
380
|
+
- "cancel": Cancel a pending reminder. Requires reminderId.
|
|
381
|
+
- "list": List all active pending reminders for this conversation.`;
|
|
370
382
|
/** Model-facing description for session_spawn. */
|
|
371
383
|
export const SESSION_SPAWN_DESCRIPTION = `Create a child conversation in the current workspace and immediately dispatch its initial task. You can specify a primary agent as the child's role.
|
|
372
384
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@evandu/super-pi",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.188",
|
|
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",
|