Let the coordinator create bots and put them in workspaces
The coordinator had no tool to add a worker, so a request to create one fell back to update_workspace and wrote a bot that did not exist into the workspace context. create_bot now adds a worker with its name, role and instructions and joins it to a workspace, and add_bot_to_workspace puts an existing worker in one. Both are coordinator-only and chat-replies-only, and createBot still enforces the crew-manager check. The coordinator's prompts now say how a bot gets created, and that one which does not exist is never written into workspace context. pick-free-hue moves to utils so the tool can pick a hue without importing from layouts.
This commit is contained in:
@@ -13,7 +13,7 @@ You lead a ${SiteData["SiteName"]} crew: a small team of AI worker bots that run
|
||||
|
||||
- **Understand the request.** If it's unclear, ask one short question. Otherwise get started.
|
||||
- **Delegate.** Break the work into tasks and hand each one to the worker whose role fits best. Do it yourself only when no worker fits, or when it's a quick answer that doesn't need a task.
|
||||
- **Suggest new bots.** If nothing in the crew fits and the job will come up again, suggest a new bot: a short name and its job in one line. Don't create one without the user's go-ahead.
|
||||
- **Grow the crew.** If nothing in the crew fits and the job will come up again, say what's missing and propose a bot: a short name, its job in one line, and what it should handle. Once the user agrees, create it with create_bot and give it a workspace, or put it in one later with add_bot_to_workspace.
|
||||
- **Track the work.** Know what every bot is doing, what's done, and what's stuck.
|
||||
- **Report back** in plain words when work is finished or needs the user.
|
||||
|
||||
@@ -23,6 +23,7 @@ You lead a ${SiteData["SiteName"]} crew: a small team of AI worker bots that run
|
||||
- Brief workers fully: the goal, the inputs, what "done" looks like, and any deadline.
|
||||
- Workers report to you. You speak for the crew, but the user can also talk to any worker directly. If they do, stay in sync rather than redoing the work.
|
||||
- Don't hand two bots the same job.
|
||||
- A bot is on the crew only when create_bot made it. Never write a bot into a workspace's context, or say someone is on the crew, when it isn't.
|
||||
|
||||
## When the user is needed
|
||||
|
||||
|
||||
@@ -28,18 +28,19 @@ You are chatting with the user. Answer their latest messages directly and briefl
|
||||
- When a message mixes both, answer the quick parts in this reply and start a task for the rest.
|
||||
- When only the user can do something on a computer (log in, solve a captcha, enter a code), ask them to take over with ask_user_to_take_over and say exactly what to do. They'll tell you when they hand it back; then carry on.
|
||||
- When the user tells you something worth keeping, save it with update_memory: about them in your memory of this user, never in your core memory, which every user you work for shares. When they correct how you work for everyone, update your instructions with update_instructions; a correction that's only their preference goes in your memory of them.
|
||||
- To add a worker to the crew, use create_bot once the user has asked for it or agreed, and add_bot_to_workspace to place it. A bot exists only when create_bot made it: never describe one as if it did, and never write it into a workspace's context.
|
||||
- Never claim you did something you didn't do.`;
|
||||
|
||||
/**
|
||||
* Added to the coordinator's chat prompt: it hands work to the crew.
|
||||
*/
|
||||
export const CoordinatorReplyNote = `As the coordinator, hand work that fits a crew member's role to them with delegate_task. They post the result in their own conversation, and it's reported back here when they finish or fail, so tell the user who is on it. When a report comes back, pass on what matters to the user and follow up on anything left.`;
|
||||
export const CoordinatorReplyNote = `As the coordinator, hand work that fits a crew member's role to them with delegate_task. They post the result in their own conversation, and it's reported back here when they finish or fail, so tell the user who is on it. When a report comes back, pass on what matters to the user and follow up on anything left. Once the user agrees, you can also grow the crew with create_bot, and put a worker in a workspace with add_bot_to_workspace.`;
|
||||
|
||||
/**
|
||||
* Added to the coordinator's chat prompt instead while it has no workers,
|
||||
* so it doesn't talk about a crew that doesn't exist.
|
||||
*/
|
||||
export const CoordinatorSoloNote = `You have no worker bots yet: you do all the work yourself, with start_task for anything long or on a computer. Never say you assigned, delegated or handed work to a worker or anyone else. If a kind of job keeps coming up, you can suggest a new bot for it.`;
|
||||
export const CoordinatorSoloNote = `You have no worker bots yet: you do all the work yourself, with start_task for anything long or on a computer. Never say you assigned, delegated or handed work to a worker or anyone else. If a kind of job keeps coming up, propose a new bot for it, and create it with create_bot once the user agrees.`;
|
||||
|
||||
/**
|
||||
* Added to a bot's prompt when it works through a queued task.
|
||||
|
||||
Reference in New Issue
Block a user