You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
console.error(`[Loop] Failed to fetch tools from client: ${clientName}`,e);
203
203
}
204
204
}
205
+
205
206
console.log(`[Loop] Discovered ${this.tools.length} total tools from clients.`);
206
207
}
208
+
209
+
// 2. Inject Native Tools
210
+
this.tools.push({
211
+
name: "delegate_task",
212
+
description: "Delegates a complex task or query to a specialized sub-agent expert. Use this when you lack the context or tools to fulfill the user's request. Wait for the sub-agent's response to formulate your final answer.",
213
+
inputSchema: {
214
+
type: "object",
215
+
properties: {
216
+
agent: {
217
+
type: "string",
218
+
description: "The name of the specialized sub-agent profile (e.g. 'librarian', 'browser')."
219
+
},
220
+
query: {
221
+
type: "string",
222
+
description: "The specific task, objective, or question to delegate to the sub-agent."
* Specialized system prompt tailored for visual inspection and control.
28
+
* @member {String} systemPrompt
29
+
*/
30
+
systemPrompt: 'You are the Browser, a specialized sub-agent expert in visual telemetry and component tree interrogation. You have direct access to the active Neo.mjs App Worker session. Your mandate is to inspect visual component trees, fetch computed styles, simulate events, and report actual DOM/VDOM state back to the orchestrator utilizing your registered tools.'
// We use a highly explicit prompt to force Gemini to output a manual JSON tool call
76
-
// so our fallback parser inside Loop.mjs intercepts it and triggers `delegate_task`.
75
+
// Since delegate_task is now injected natively into the Loop's tools array,
76
+
// we can simply instruct the model to use the tool, and it will trigger it natively.
77
77
constevent={
78
78
type: 'user:input',
79
79
priority: 'high',
80
-
data: 'You must research the architectural purpose of Neo.component.Base. You do not have the context. You MUST delegate this by outputting strictly the following JSON object and nothing else: { "tool": "delegate_task", "agent": "librarian", "query": "What is the architectural purpose of Neo.component.Base?" }'
80
+
data: 'You must research the architectural purpose of Neo.component.Base. You do not have the context. Delegate this to the "librarian" sub-agent using the delegate_task tool. Once you get the result, formulate your final answer.'
81
81
};
82
82
83
83
// Bypass the scheduler and force synchronous processing for the test environment
0 commit comments