tuna-agent 0.1.170 → 0.1.172
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.
- package/dist/agents/claude-code-adapter.js +3 -4
- package/dist/pm/planner.js +16 -10
- package/package.json +1 -1
|
@@ -474,10 +474,9 @@ export class ClaudeCodeAdapter {
|
|
|
474
474
|
// Step 1: Planning
|
|
475
475
|
console.log(`[ClaudeCode] Starting planning for task ${task.id}`);
|
|
476
476
|
ws.sendProgress(task.id, 'planning', { startedAt: new Date().toISOString() });
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
});
|
|
477
|
+
// No generic canned "thinking" line — it breaks the agent's persona voice.
|
|
478
|
+
// The agent's own (persona-driven) output leads instead. The 'planning' status
|
|
479
|
+
// above already signals activity to the app/Discord.
|
|
481
480
|
let planFirstChunkIso = '';
|
|
482
481
|
let planChunkCount = 0;
|
|
483
482
|
let planResult = await planTask(task, (event, data) => {
|
package/dist/pm/planner.js
CHANGED
|
@@ -30,24 +30,30 @@ function isSimpleTask(description) {
|
|
|
30
30
|
// Default: treat as complex (safer)
|
|
31
31
|
return false;
|
|
32
32
|
}
|
|
33
|
-
const SIMPLE_PROMPT = `You are a
|
|
33
|
+
const SIMPLE_PROMPT = `You are planning a task for yourself — the agent described in this project's context (CLAUDE.md), working in your OWN area of expertise (which may be non-software: ASO, content, marketing, research, ops, etc.).
|
|
34
34
|
|
|
35
35
|
Output ONLY valid JSON (no markdown, no explanation):
|
|
36
36
|
{
|
|
37
37
|
"summary": "One-line summary of what will be done",
|
|
38
38
|
"subtasks": [{
|
|
39
39
|
"id": "sub-1",
|
|
40
|
-
"role": "
|
|
40
|
+
"role": "self",
|
|
41
41
|
"description": "Complete task description with specific steps",
|
|
42
42
|
"cwd": ".",
|
|
43
43
|
"dependencies": []
|
|
44
44
|
}]
|
|
45
45
|
}`;
|
|
46
|
-
const PLAN_SYSTEM_PROMPT = `You are
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
46
|
+
const PLAN_SYSTEM_PROMPT = `You are the agent described in this project's context (CLAUDE.md). Plan how to accomplish the task within YOUR area of expertise — which may be NON-software (ASO, content, marketing, research, ops...). Do NOT assume every task is software development.
|
|
47
|
+
|
|
48
|
+
DEFAULT: produce ONE subtask with role "self" — you do the task yourself in a single focused execution. This is correct for the vast majority of tasks (analysis, data/config edits, content, research, ops).
|
|
49
|
+
|
|
50
|
+
ONLY split into multiple subtasks with developer roles (backend/frontend/tester) when the task is GENUINELY a complex software build needing parallel developer sessions with shared API contracts.
|
|
51
|
+
|
|
52
|
+
Your job:
|
|
53
|
+
1. Read the project/context to understand what you're working with
|
|
54
|
+
2. Analyze the given task
|
|
55
|
+
3. (Software builds only) Define API contracts if the task spans backend and frontend
|
|
56
|
+
4. Break into subtasks ONLY if truly needed — otherwise a single "self" subtask
|
|
51
57
|
|
|
52
58
|
CRITICAL RULES:
|
|
53
59
|
|
|
@@ -71,7 +77,7 @@ Execution layers (dependencies):
|
|
|
71
77
|
- Testers should depend on the code they're testing
|
|
72
78
|
- Minimize layers to maximize parallelism
|
|
73
79
|
|
|
74
|
-
Roles: "
|
|
80
|
+
Roles: "self" (default — your own-domain work), or "backend"/"frontend"/"tester" ONLY for actual software subtasks. "role" is a display label; it does not change execution.
|
|
75
81
|
|
|
76
82
|
If you need information that ONLY the user can decide (e.g., business rules, design preferences, auth method choice), include it in the "questions" array. The user will answer before execution starts. Do NOT guess — ask.
|
|
77
83
|
|
|
@@ -130,8 +136,8 @@ export async function planTask(task, onProgress, signal, onTextChunk, inputFiles
|
|
|
130
136
|
const systemPrompt = isSimple ? SIMPLE_PROMPT : PLAN_SYSTEM_PROMPT;
|
|
131
137
|
const maxTurns = isSimple ? 3 : 15;
|
|
132
138
|
const userPrompt = isSimple
|
|
133
|
-
? `
|
|
134
|
-
: `
|
|
139
|
+
? `Plan this task:\n\n${task.description}`
|
|
140
|
+
: `Plan how to accomplish this task within your area of expertise.\n\nTask: ${task.description}\n\nRead the project/context as needed to understand what you're working with, then output your plan as JSON. Default to a single "self" subtask unless this is genuinely a complex software build.`;
|
|
135
141
|
if (isSimple) {
|
|
136
142
|
console.log('[PM] Simple task detected → using quick planning');
|
|
137
143
|
}
|