mirror of
https://github.com/openswarm-ai/openswarm.git
synced 2026-08-17 18:25:42 +02:00
[eric] agents: CreateApp is offer-first; track/organize/plan asks answer in chat instead of scaffolding an app
This commit is contained in:
@@ -26,10 +26,13 @@ TOOLS = [
|
||||
"description": (
|
||||
"Create a new OpenSwarm App: a real React 18 + TypeScript + Vite web app "
|
||||
"(optional FastAPI backend) that appears as a live preview card on the "
|
||||
"user's dashboard, next to you. Use this whenever the user asks you to "
|
||||
"build/make an app, tool, game, dashboard, tracker, visualizer, or any "
|
||||
"interactive UI. Returns the workspace path to write code in plus the "
|
||||
"App Builder reference (stack, layout, rules) — follow it. To EDIT an "
|
||||
"user's dashboard, next to you. HARD RULE: call this only when the user's "
|
||||
"message explicitly says to build/make/create an app, tool, game, or "
|
||||
"dashboard. A question, plan, list, comparison, or a wish to track or "
|
||||
"organize something is NOT an app request: answer it in chat (rich "
|
||||
"components beat prose), then offer to build an app and wait for a yes. "
|
||||
"Returns the workspace path to write code in plus "
|
||||
"the App Builder reference (stack, layout, rules) — follow it. To EDIT an "
|
||||
"app that already exists, don't call this; edit its workspace files "
|
||||
"directly (the path is in your context when the user selects the app, "
|
||||
"and the preview hot-reloads on save)."
|
||||
|
||||
@@ -84,9 +84,13 @@ def compose_turn_system_prompt(
|
||||
# Every other mode gets one line of discovery instead of the whole reference: CreateApp's result carries the reference when actually used, so the base prompt stays cheap.
|
||||
apps_note = (
|
||||
"<apps_capability>\n"
|
||||
"You can build real web apps for the user: when they ask for an app, tool, game, or dashboard, "
|
||||
"call the CreateApp tool — it seeds a workspace and puts a live preview card on their dashboard, "
|
||||
"then you write the code. To change an existing app, have the user select its card (or use the "
|
||||
"You can build real web apps for the user: CreateApp seeds a workspace and puts a live preview "
|
||||
"card on their dashboard, then you write the code. HARD RULE: call CreateApp only when the user "
|
||||
"explicitly says to build/make/create an app, tool, game, or dashboard. Wanting to track, "
|
||||
"organize, plan, or compare something is NOT that ask: answer it in chat with rich components, "
|
||||
"then ask one short question offering to build an app for it, and only build after a yes. This "
|
||||
"offer-first rule intentionally overrides the act-don't-ask default, because an unwanted app is "
|
||||
"expensive to undo. To change an existing app, have the user select its card (or use the "
|
||||
"workspace path in your context) and edit the files directly.\n"
|
||||
"</apps_capability>"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user