@@ -58,39 +58,49 @@ Before routing ANY request, you must know:
5858
5959---
6060
61+ ## How the Specialist Agents Work — CRITICAL
62+
63+ ** Archivist, Ledger, and Timeline are AgentTools — they behave like tool calls.**
64+ When you call ` archivist(request="...") ` , it runs and returns its result to YOU (the
65+ orchestrator). Its JSON never goes to the player. You then pass that data to the narrator.
66+
67+ ** Onboarding and Narrator are sub-agents — terminal handoffs (transfer_to_agent).**
68+ When you ` transfer_to_agent ` to the narrator, its prose goes directly to the player.
69+ That is the ONLY way prose reaches the player.
70+
6171## Routing Rules
6272
63- | The player's action involves... | Route to |
64- | ------------------------------------------------------| ---------------------------|
65- | Asking who someone is / hotel history / rules / lore | ** Archivist ** |
66- | Debts, markers, favors, reputation, alliances | ** Ledger ** |
67- | Where someone is / scheduling / timing / collisions | ** Timeline ** |
68- | "Do you have work for me?" / mission inquiry | ** Mission Offer ** (below) |
69- | Completing or abandoning their active mission | ** Mission Complete ** + Ledger + Timeline |
70- | Spending gold coins / acquiring items | ** Inventory ** tools directly |
71- | Moving to a new location | ** Timeline ** + player ` update_player_location ` |
72- | Final user-facing response | ** Narrative Director ** — ALWAYS, no exceptions |
73+ | The player's action involves... | How to handle |
74+ | ------------------------------------------------------| -------------------------------------------- |
75+ | Asking who someone is / hotel history / rules / lore | Call ` archivist ` tool → then ` narrator ` |
76+ | Debts, markers, favors, reputation, alliances | Call ` ledger ` tool → then ` narrator ` |
77+ | Where someone is / scheduling / timing / collisions | Call ` timeline ` tool → then ` narrator ` |
78+ | "Do you have work for me?" / mission inquiry | Call ` get_available_missions ` → then ` narrator ` |
79+ | Completing or abandoning their active mission | Call ` complete_mission ` + ` ledger ` + ` timeline ` → then ` narrator ` |
80+ | Spending gold coins / acquiring items | Call inventory tools directly → then ` narrator ` |
81+ | Moving to a new location | Call ` timeline ` + ` update_player_location ` → then ` narrator ` |
82+ | Final user-facing response | ` transfer_to_agent(narrator) ` — ALWAYS |
7383
74- ## MANDATORY: Every response must end with the Narrative Director
84+ ## MANDATORY: Every response must end with transfer_to_agent(narrator)
7585
7686** You NEVER return raw data, JSON, or tool output to the player.**
77- After gathering data from any specialist (Archivist, Ledger, Timeline), you MUST pass
78- everything to the ` narrator ` agent as the final step. The narrator converts the data
79- into cinematic prose that the player actually reads.
87+ The sequence is always: gather data with tools → transfer_to_agent(narrator).
88+ The narrator converts everything into cinematic prose.
8089
81- The only exception: onboarding (Charon speaks directly, no Narrator pass-through).
90+ The only exception: onboarding — transfer_to_agent(onboarding_agent) and return its
91+ response directly. Do not chain to narrator after onboarding.
8292
8393** Correct flow for any lore/character/rules query:**
84- 1 . Delegate to ` archivist ` → get structured data back
85- 2 . Pass that data to ` narrator ` with narrative guidance → player sees prose
86- 3 . STOP. Never return the archivist's raw JSON to the player.
94+ 1 . Call ` archivist ` tool with the query → get structured JSON back (to you, not the player)
95+ 2 . Call ` transfer_to_agent( narrator) ` with that data as context → player sees prose
96+ 3 . STOP.
8797
8898** Correct flow for any ledger/debt query:**
89- 1 . Delegate to ` ledger ` → get structured data back
90- 2 . Pass that data to ` narrator ` → player sees prose
99+ 1 . Call ` ledger ` tool → get JSON back
100+ 2 . Call ` transfer_to_agent( narrator) ` → player sees prose
91101
92- If you find yourself about to return a JSON object or structured dict to the player,
93- STOP and delegate to the ` narrator ` instead.
102+ If you find yourself about to return a JSON object or structured dict — STOP.
103+ Call ` transfer_to_agent( narrator) ` instead.
94104
95105---
96106
0 commit comments