Skip to content

Soul-driven AI agent with permission-hardened tools, token budgets, and multi-channel access. Runs 24/7 from CLI, Telegram or More.

feat(bots): plan with fleet: true designs the crew for a fleet the owner chose

Salman Qureshi5005097983a8
diff --git a/src/bots/bot-manager.ts b/src/bots/bot-manager.ts
index 27ecf090..571bd00b 100644
--- a/src/bots/bot-manager.ts
+++ b/src/bots/bot-manager.ts
@@ -1472,7 +1472,7 @@ export class BotManager {
}
/** "Let Mercury decide": solo or fleet for what the owner described, with a proposed crew. Nothing is created. */
- async planShape(input: { name: string; description: string; persona: string }): Promise<BotShapePlan> {
+ async planShape(input: { name: string; description: string; persona: string; fleet?: boolean }): Promise<BotShapePlan> {
return planBotShape(input, this.providers.getDefault(), this.maxCrew());
}
diff --git a/src/bots/fleet-onboarding.ts b/src/bots/fleet-onboarding.ts
index 12ed77d0..2c3f1c51 100644
--- a/src/bots/fleet-onboarding.ts
+++ b/src/bots/fleet-onboarding.ts
@@ -90,7 +90,7 @@ export interface BotShapePlan {
* anything created. Unusable output falls back to solo with no crew.
*/
export async function planBotShape(
- input: { name: string; description: string; persona: string },
+ input: { name: string; description: string; persona: string; fleet?: boolean },
provider: BaseProvider,
maxCrew = 6,
): Promise<BotShapePlan> {
@@ -105,7 +105,9 @@ What it should do:
${input.persona.slice(0, 4000) || '(not written yet)'}
"""
-Choose "fleet" ONLY when the job has clearly separate stages or specialties that each need their own focus (e.g. research → write → fact-check → publish, or monitoring several unrelated sources). Every hand-off costs a full extra run, so a single focused job, a monitor, a digest, a researcher or a writer is "solo". When in doubt, choose solo.
+${input.fleet
+ ? 'The owner has decided this is a FLEET: answer "fleet" and design the crew — the fewest distinct specialists that cover the job.'
+ : 'Choose "fleet" ONLY when the job has clearly separate stages or specialties that each need their own focus (e.g. research → write → fact-check → publish, or monitoring several unrelated sources). Every hand-off costs a full extra run, so a single focused job, a monitor, a digest, a researcher or a writer is "solo". When in doubt, choose solo.'}
Output ONLY JSON, no preamble, no code fences:
{
diff --git a/src/web/api/bots.ts b/src/web/api/bots.ts
index 8153a022..da1bb86e 100644
--- a/src/web/api/bots.ts
+++ b/src/web/api/bots.ts
@@ -57,9 +57,10 @@ app.post('/api/bots/persona-builder', async (c: Context) => {
// "Let Mercury decide": one bot or a fleet for this job, and the proposed crew. Nothing is created.
app.post('/api/bots/plan', async (c: Context) => {
if (!botManager) return c.json({ error: 'Bots not available' }, 400);
- const body = (await c.req.json().catch(() => ({}))) as { name?: unknown; description?: unknown; persona?: unknown };
+ const body = (await c.req.json().catch(() => ({}))) as { name?: unknown; description?: unknown; persona?: unknown; fleet?: unknown };
const str = (v: unknown, n: number) => (typeof v === 'string' ? v.slice(0, n) : '');
- const plan = await botManager.planShape({ name: str(body.name, 60) || 'Bot', description: str(body.description, 300), persona: str(body.persona, 8000) });
+ // fleet: true = the owner chose a fleet; only the crew is being designed.
+ const plan = await botManager.planShape({ name: str(body.name, 60) || 'Bot', description: str(body.description, 300), persona: str(body.persona, 8000), fleet: body.fleet === true });
return c.json({ plan, maxCrew: botManager.maxCrew() });
});