@trygentic/agentloop 0.15.0-alpha.11 → 0.16.0-alpha.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/package.json +3 -3
  2. package/templates/agents/chat/chat.bt.json +346 -0
  3. package/templates/agents/chat/chat.md +84 -0
  4. package/templates/agents/engineer/engineer.bt.json +617 -0
  5. package/templates/agents/engineer/engineer.md +323 -0
  6. package/templates/agents/orchestrator/orchestrator.bt.json +28 -0
  7. package/templates/agents/orchestrator/orchestrator.md +544 -0
  8. package/templates/agents/product-manager/product-manager.bt.json +90 -0
  9. package/templates/agents/product-manager/product-manager.md +207 -0
  10. package/templates/agents/qa-tester/qa-tester.bt.json +678 -0
  11. package/templates/agents/qa-tester/qa-tester.md +182 -0
  12. package/templates/examples/README.md +86 -0
  13. package/templates/examples/engineer.md.example +248 -0
  14. package/templates/examples/example-custom-agent.md.example +158 -0
  15. package/templates/examples/example-plugin.js.example +277 -0
  16. package/templates/non-core-templates/container.md +173 -0
  17. package/templates/non-core-templates/dag-planner.md +96 -0
  18. package/templates/non-core-templates/internal/cli-tester.md +218 -0
  19. package/templates/non-core-templates/internal/qa-tester.md +300 -0
  20. package/templates/non-core-templates/internal/tui-designer.md +370 -0
  21. package/templates/non-core-templates/internal/tui-tester.md +125 -0
  22. package/templates/non-core-templates/maestro-qa.md +240 -0
  23. package/templates/non-core-templates/merge-resolver.md +150 -0
  24. package/templates/non-core-templates/project-detection.md +75 -0
  25. package/templates/non-core-templates/questionnaire.md +124 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trygentic/agentloop",
3
- "version": "0.15.0-alpha.11",
3
+ "version": "0.16.0-alpha.11",
4
4
  "description": "AI-powered autonomous coding agent",
5
5
  "bin": {
6
6
  "agentloop": "./bin/agentloop"
@@ -9,8 +9,8 @@
9
9
  "postinstall": "node ./scripts/postinstall.mjs"
10
10
  },
11
11
  "optionalDependencies": {
12
- "@trygentic/agentloop-darwin-arm64": "0.15.0-alpha.11",
13
- "@trygentic/agentloop-linux-x64": "0.15.0-alpha.11"
12
+ "@trygentic/agentloop-darwin-arm64": "0.16.0-alpha.11",
13
+ "@trygentic/agentloop-linux-x64": "0.16.0-alpha.11"
14
14
  },
15
15
  "engines": {
16
16
  "node": ">=18.0.0"
@@ -0,0 +1,346 @@
1
+ {
2
+ "name": "chat-continuous-agent-tree",
3
+ "description": "Continuous behavior tree for the Chat agent. Processes messages in a loop from users and other agents. Unlike task-based agents, chat uses a message queue model with support for async task delegation.",
4
+ "version": "1.0.0",
5
+ "tree": {
6
+ "type": "root",
7
+ "child": {
8
+ "type": "sequence",
9
+ "comment": "Main continuous loop - processes messages indefinitely",
10
+ "children": [
11
+ {
12
+ "type": "action",
13
+ "call": "WaitForMessage",
14
+ "comment": "Block until a message arrives (user input or agent message). Polls the message queue."
15
+ },
16
+ {
17
+ "type": "action",
18
+ "call": "FetchMessageContext",
19
+ "comment": "Load message details, sender info, conversation history, and any relevant context"
20
+ },
21
+ {
22
+ "type": "selector",
23
+ "comment": "Handle the message based on its type and content",
24
+ "children": [
25
+ {
26
+ "type": "sequence",
27
+ "comment": "Slash command handling - process commands like /help, /tasks, /orchestrator",
28
+ "children": [
29
+ {
30
+ "type": "condition",
31
+ "call": "IsSlashCommand"
32
+ },
33
+ {
34
+ "type": "action",
35
+ "call": "ProcessSlashCommand",
36
+ "comment": "Execute the slash command and store result"
37
+ },
38
+ {
39
+ "type": "action",
40
+ "call": "SendCommandResponse"
41
+ }
42
+ ]
43
+ },
44
+ {
45
+ "type": "sequence",
46
+ "comment": "Async task request - delegate work to orchestrator without blocking",
47
+ "children": [
48
+ {
49
+ "type": "condition",
50
+ "call": "IsAsyncTaskRequest"
51
+ },
52
+ {
53
+ "type": "action",
54
+ "call": "QueueAsyncTask",
55
+ "comment": "Create task in orchestrator and return immediately (fire-and-forget)"
56
+ },
57
+ {
58
+ "type": "action",
59
+ "call": "SendTaskQueuedResponse",
60
+ "comment": "Acknowledge to user that task was queued"
61
+ }
62
+ ]
63
+ },
64
+ {
65
+ "type": "sequence",
66
+ "comment": "Agent message handling - respond to messages from other agents",
67
+ "children": [
68
+ {
69
+ "type": "condition",
70
+ "call": "IsAgentMessage"
71
+ },
72
+ {
73
+ "type": "selector",
74
+ "comment": "Handle different agent message types",
75
+ "children": [
76
+ {
77
+ "type": "sequence",
78
+ "comment": "Query from another agent - needs immediate response",
79
+ "children": [
80
+ {
81
+ "type": "condition",
82
+ "call": "IsAgentQuery"
83
+ },
84
+ {
85
+ "type": "llm-action",
86
+ "name": "ProcessAgentQuery",
87
+ "prompt": "You are the chat agent responding to a query from another agent in the system.\n\nQuery from {{messageSender}}:\n{{messageContent}}\n\nConversation context:\n{{conversationHistory}}\n\nProvide a helpful response that addresses the agent's query. Be concise but complete.",
88
+ "contextKeys": ["messageSender", "messageContent", "conversationHistory"],
89
+ "outputSchema": {
90
+ "type": "object",
91
+ "properties": {
92
+ "response": { "type": "string", "description": "Response to the agent's query" },
93
+ "requiresFollowUp": { "type": "boolean", "description": "Whether this query needs additional follow-up" }
94
+ },
95
+ "required": ["response"]
96
+ },
97
+ "outputKey": "agentQueryResponse",
98
+ "temperature": 0.4
99
+ },
100
+ {
101
+ "type": "action",
102
+ "call": "SendAgentResponse"
103
+ }
104
+ ]
105
+ },
106
+ {
107
+ "type": "sequence",
108
+ "comment": "Notification from another agent - acknowledge and optionally relay to user",
109
+ "children": [
110
+ {
111
+ "type": "condition",
112
+ "call": "IsAgentNotification"
113
+ },
114
+ {
115
+ "type": "action",
116
+ "call": "ProcessAgentNotification",
117
+ "comment": "Log the notification and determine if user should be notified"
118
+ },
119
+ {
120
+ "type": "selector",
121
+ "comment": "Optionally relay important notifications to user",
122
+ "children": [
123
+ {
124
+ "type": "sequence",
125
+ "children": [
126
+ {
127
+ "type": "condition",
128
+ "call": "ShouldRelayToUser"
129
+ },
130
+ {
131
+ "type": "action",
132
+ "call": "SendUserNotification"
133
+ }
134
+ ]
135
+ },
136
+ {
137
+ "type": "action",
138
+ "call": "NoOp",
139
+ "comment": "Notification processed silently"
140
+ }
141
+ ]
142
+ }
143
+ ]
144
+ },
145
+ {
146
+ "type": "sequence",
147
+ "comment": "Coordination message - update internal state",
148
+ "children": [
149
+ {
150
+ "type": "condition",
151
+ "call": "IsCoordinationMessage"
152
+ },
153
+ {
154
+ "type": "action",
155
+ "call": "ProcessCoordination"
156
+ }
157
+ ]
158
+ }
159
+ ]
160
+ }
161
+ ]
162
+ },
163
+ {
164
+ "type": "sequence",
165
+ "comment": "Standard user message - process with LLM and respond",
166
+ "children": [
167
+ {
168
+ "type": "llm-selector",
169
+ "name": "ClassifyUserIntent",
170
+ "prompt": "Classify the user's intent based on their message.\n\nUser message: {{messageContent}}\n\nConversation history:\n{{conversationHistory}}\n\nClassify the intent to determine the best response strategy.",
171
+ "contextKeys": ["messageContent", "conversationHistory"],
172
+ "branches": {
173
+ "general_chat": {
174
+ "description": "General conversation, questions, or discussion not requiring code changes",
175
+ "child": {
176
+ "type": "llm-action",
177
+ "name": "GenerateGeneralResponse",
178
+ "prompt": "You are a helpful AI assistant. Respond to the user's message naturally and helpfully.\n\nUser message: {{messageContent}}\n\nConversation history:\n{{conversationHistory}}\n\nProvide a thoughtful, helpful response.",
179
+ "contextKeys": ["messageContent", "conversationHistory", "codebaseContext"],
180
+ "subagent": "chat",
181
+ "maxTurns": 20,
182
+ "outputSchema": {
183
+ "type": "object",
184
+ "properties": {
185
+ "response": { "type": "string", "description": "The response to send to the user" },
186
+ "suggestedActions": { "type": "array", "items": { "type": "string" }, "description": "Optional suggested follow-up actions" }
187
+ },
188
+ "required": ["response"]
189
+ },
190
+ "outputKey": "chatResponse",
191
+ "temperature": 0.7
192
+ }
193
+ },
194
+ "code_question": {
195
+ "description": "Question about the codebase requiring analysis but not changes",
196
+ "child": {
197
+ "type": "sequence",
198
+ "children": [
199
+ {
200
+ "type": "action",
201
+ "call": "AnalyzeCodebase",
202
+ "comment": "Gather codebase context for informed response"
203
+ },
204
+ {
205
+ "type": "llm-action",
206
+ "name": "AnswerCodeQuestion",
207
+ "prompt": "The user has a question about the codebase. Analyze and answer their question.\n\nUser question: {{messageContent}}\n\nCodebase context:\n{{codebaseContext}}\n\nUse the code-graph-rag MCP tools (semantic_search, list_file_entities, analyze_code_impact, find_similar_code) and Read/Grep/Glob to examine specific files as needed. If code-graph-rag tools fail, fall back to Grep/Glob.\n\nProvide a clear, accurate answer based on the actual codebase.",
208
+ "contextKeys": ["messageContent", "codebaseContext", "conversationHistory"],
209
+ "subagent": "chat",
210
+ "maxTurns": 30,
211
+ "outputSchema": {
212
+ "type": "object",
213
+ "properties": {
214
+ "response": { "type": "string", "description": "Answer to the code question" },
215
+ "referencedFiles": { "type": "array", "items": { "type": "string" }, "description": "Files referenced in the answer" },
216
+ "relatedTopics": { "type": "array", "items": { "type": "string" }, "description": "Related topics the user might want to explore" }
217
+ },
218
+ "required": ["response"]
219
+ },
220
+ "outputKey": "chatResponse",
221
+ "temperature": 0.4
222
+ }
223
+ ]
224
+ }
225
+ },
226
+ "task_request": {
227
+ "description": "User wants to create a task or make code changes - delegate to orchestrator",
228
+ "child": {
229
+ "type": "sequence",
230
+ "children": [
231
+ {
232
+ "type": "llm-action",
233
+ "name": "ExtractTaskDetails",
234
+ "prompt": "The user wants to create a task or make code changes. Extract the task details from their message.\n\nUser message: {{messageContent}}\n\nConversation history:\n{{conversationHistory}}\n\nExtract a clear task title and description that an engineer agent can execute.",
235
+ "contextKeys": ["messageContent", "conversationHistory"],
236
+ "outputSchema": {
237
+ "type": "object",
238
+ "properties": {
239
+ "taskTitle": { "type": "string", "description": "Concise task title" },
240
+ "taskDescription": { "type": "string", "description": "Detailed task description with acceptance criteria" },
241
+ "priority": { "type": "string", "enum": ["low", "medium", "high", "critical"], "description": "Suggested task priority" },
242
+ "isAsync": { "type": "boolean", "description": "Whether this should be processed asynchronously" }
243
+ },
244
+ "required": ["taskTitle", "taskDescription"]
245
+ },
246
+ "outputKey": "extractedTask",
247
+ "temperature": 0.3
248
+ },
249
+ {
250
+ "type": "action",
251
+ "call": "QueueAsyncTask"
252
+ },
253
+ {
254
+ "type": "action",
255
+ "call": "SendTaskQueuedResponse"
256
+ }
257
+ ]
258
+ }
259
+ },
260
+ "status_inquiry": {
261
+ "description": "User asking about task status, agent status, or system state",
262
+ "child": {
263
+ "type": "sequence",
264
+ "children": [
265
+ {
266
+ "type": "action",
267
+ "call": "FetchSystemStatus",
268
+ "comment": "Get current orchestrator and task status"
269
+ },
270
+ {
271
+ "type": "llm-action",
272
+ "name": "FormatStatusResponse",
273
+ "prompt": "The user is asking about system status. Format a clear status update based on the data.\n\nUser question: {{messageContent}}\n\nSystem status:\n{{systemStatus}}\n\nProvide a clear, informative status update.",
274
+ "contextKeys": ["messageContent", "systemStatus", "conversationHistory"],
275
+ "outputSchema": {
276
+ "type": "object",
277
+ "properties": {
278
+ "response": { "type": "string", "description": "Formatted status response" },
279
+ "hasActiveWork": { "type": "boolean", "description": "Whether there's active work in progress" }
280
+ },
281
+ "required": ["response"]
282
+ },
283
+ "outputKey": "chatResponse",
284
+ "temperature": 0.3
285
+ }
286
+ ]
287
+ }
288
+ }
289
+ },
290
+ "defaultBranch": "general_chat",
291
+ "confidenceThreshold": 0.6
292
+ },
293
+ {
294
+ "type": "action",
295
+ "call": "SendChatResponse"
296
+ }
297
+ ]
298
+ }
299
+ ]
300
+ },
301
+ {
302
+ "type": "action",
303
+ "call": "UpdateConversationHistory",
304
+ "comment": "Add this exchange to conversation history"
305
+ },
306
+ {
307
+ "type": "action",
308
+ "call": "ClearMessageContext",
309
+ "comment": "Reset message-specific blackboard keys for next message"
310
+ },
311
+ {
312
+ "type": "action",
313
+ "call": "Loop",
314
+ "comment": "Return to start to wait for next message"
315
+ }
316
+ ]
317
+ }
318
+ },
319
+ "blackboardDefaults": {
320
+ "currentMessage": null,
321
+ "messageSender": null,
322
+ "messageType": null,
323
+ "messageContent": null,
324
+ "conversationHistory": [],
325
+ "agentQueryResponse": null,
326
+ "chatResponse": null,
327
+ "extractedTask": null,
328
+ "systemStatus": null,
329
+ "commandResult": null,
330
+ "codebaseContext": null,
331
+ "isSlashCommand": false,
332
+ "isAsyncRequest": false,
333
+ "isAgentMessage": false,
334
+ "shouldRelayToUser": false,
335
+ "notificationContent": null,
336
+ "queuedTaskId": null,
337
+ "currentTaskId": null,
338
+ "taskAssignedAt": null,
339
+ "loopCount": 0,
340
+ "messageCount": 0,
341
+ "lastActivityAt": null,
342
+ "maxConversationHistoryLength": 50,
343
+ "projectPath": null,
344
+ "workingDirectory": null
345
+ }
346
+ }
@@ -0,0 +1,84 @@
1
+ ---
2
+ name: chat
3
+ description: >-
4
+ Chat agent that handles interactive user messages and delegates work to the
5
+ orchestrator. This is the user-facing interface for AgentLoop. Does NOT
6
+ create tasks directly - always delegates via delegate_work which routes
7
+ to the appropriate agent.
8
+ model: inherit
9
+ instanceCount: 1
10
+ showInLiveView: true
11
+ tools:
12
+ - AskUserQuestion
13
+ - mcp__agentloop__delegate_work
14
+ - mcp__agentloop__list_tasks
15
+ - mcp__agentloop__get_task
16
+ - mcp__agentloop__list_subprojects
17
+ - mcp__agentloop__get_subproject
18
+ - mcp__agentloop__run_orchestrator
19
+ - mcp__agentloop__stop_orchestrator
20
+ - mcp__agentloop__get_orchestrator_status
21
+ - mcp__agentloop__get_system_health
22
+ - mcp__agentloop__get_daemon_status
23
+ ---
24
+
25
+ # AgentLoop
26
+
27
+ You are **AgentLoop** - the primary user-facing interface for the multi-agent development system.
28
+
29
+ ## Core Responsibilities
30
+
31
+ 1. **Conversational Interface**: Answer user questions, explain concepts, provide summaries
32
+ 2. **Work Delegation**: When users request development work, delegate to the product-manager via `delegate_work`
33
+ 3. **Status Reporting**: Show task status, orchestrator health, and project progress
34
+ 4. **Orchestrator Control**: Start/stop the orchestrator when users request it
35
+
36
+ ## CRITICAL: Delegation Rules
37
+
38
+ You MUST use `delegate_work` for ALL development work requests.
39
+ The product-manager will handle task breakdown, subproject creation, and dependency setup.
40
+
41
+ **You do NOT have access to `create_task`.** This is by design.
42
+
43
+ ### delegate_work Usage
44
+
45
+ Submit a HIGH-LEVEL work request. Call this ONCE per user request.
46
+
47
+ You describe WHAT the user wants at a high level. The product-manager agent
48
+ will decompose it into specific implementation tasks with dependencies.
49
+
50
+ CORRECT - One high-level call:
51
+ delegate_work(title: "Add user authentication", description: "The app needs login, signup, OAuth, JWT tokens, and protected routes")
52
+
53
+ WRONG - Multiple specific calls (this is the PM's job, NOT yours):
54
+ delegate_work(title: "Create auth database schema", ...)
55
+ delegate_work(title: "Implement JWT token service", ...)
56
+ delegate_work(title: "Build login endpoint", ...)
57
+ delegate_work(title: "Build registration endpoint", ...)
58
+
59
+ RULE: If you find yourself wanting to call delegate_work more than once,
60
+ you are decomposing the work yourself. STOP. Combine everything into ONE call
61
+ and let the product-manager handle the decomposition.
62
+
63
+ If the user asks for multiple unrelated things, make ONE call per distinct project/feature.
64
+ Each call creates a subproject that the PM will break into tasks.
65
+
66
+ ## When to Delegate vs Respond Directly
67
+
68
+ **Delegate to PM (use delegate_work):**
69
+ - Feature implementation requests
70
+ - Bug fixes that require code changes
71
+ - Multi-step workflows needing coordination
72
+
73
+ **Respond directly (no delegation needed):**
74
+ - Questions, explanations, summaries
75
+ - Writing requests (paragraphs, documentation drafts)
76
+ - Analysis and discussion
77
+ - Status queries (use list_tasks, get_task, get_orchestrator_status)
78
+
79
+ ## Communication Style
80
+
81
+ - Be conversational and friendly
82
+ - Be proactive - suggest next steps
83
+ - Be clear about what you're doing
84
+ - Be concise - no unnecessary technical details