feat(prompts): native Muse tools (cron.create, subagent spawn) primary in envelope; harvester bridges native names to box ops

This commit is contained in:
operator
2026-10-05 05:45:12 +00:00
parent a08f13cac2
commit 12f8a8b0d6
2 changed files with 57 additions and 4 deletions
+14 -3
View File
@@ -46,6 +46,14 @@ def spawn_call(job_id, job_name, profile):
return _tool("swarm.spawn", {"count": count, "task": task[:900], "label": (job_name or "job")[:60]})
def native_followup_call(job_id, job_name, profile, agent):
"""Muse-native one-shot cron (cron.create runonce) - bridged to followup.create."""
_, mins, _ = PROFILES[profile]
return _tool("cron.create", {
"kind": "runonce", "agent": agent, "in_m": mins,
"prompt": "Continue job %s (%s): verify with cron.runs and swarm.list then act or close." % (job_id, job_name)})
def followup_call(job_id, job_name, profile, agent):
_, mins, _ = PROFILES[profile]
return _tool("followup.create", {
@@ -62,7 +70,7 @@ def wrap(job_name, job_id, agent, target, rendered):
"""Return the full DM body (without the [JOB id] prefix)."""
profile = pick_profile(job_name)
spawn = spawn_call(job_id, job_name, profile)
follow = followup_call(job_id, job_name, profile, agent)
follow = native_followup_call(job_id, job_name, profile, agent)
top = (
"WORK ORDER - ACTION REQUIRED, NOT INFORMATIONAL.\n"
"Your FIRST output must be tool calls, not prose. Start now:\n"
@@ -78,11 +86,14 @@ def wrap(job_name, job_id, agent, target, rendered):
"If you have not yet spawned subagents or set a follow-up timer, do it now:\n"
" %s\n"
" %s\n"
"Other tools: [TOOL health.check {}] [TOOL swarm.list {}] [TOOL swarm.status {\"swarm_id\": \"<id>\"}] "
"Native tools (preferred): cron.create (runonce/interval), cron.status, cron.view, cron.runs "
"(truth about what ran), cron.run, subagent spawn; hooks.dry_run before hooks.enable. "
"Native cron form: %s\n"
"Box fallback tools: [TOOL health.check {}] [TOOL swarm.list {}] [TOOL swarm.status {\"swarm_id\": \"<id>\"}] "
"[TOOL swarm.results {\"swarm_id\": \"<id>\"}] [TOOL quality.check {}]\n"
"Direct: curl -sk -X POST %s -H \"Authorization: Bearer <token>\" "
"-H \"Content-Type: application/json\" -d '{\"op\":\"<op>\",\"args\":{...}}'\n"
"Thread: %s\n" % (spawn, follow, BOX_EXEC, thread_url(target))
"Thread: %s\n" % (spawn, follow, native_followup_call(job_id, job_name, profile, agent), BOX_EXEC, thread_url(target))
)
if not has_result:
bottom += "Close with: [RESULT %s] <OK|FAILED>: <summary of tool outputs>\n" % job_id