tuna-agent 0.1.169 → 0.1.171

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.
@@ -476,7 +476,7 @@ export class ClaudeCodeAdapter {
476
476
  ws.sendProgress(task.id, 'planning', { startedAt: new Date().toISOString() });
477
477
  ws.sendPMMessage(task.id, {
478
478
  sender: 'pm',
479
- content: "I'm analyzing your project to create an execution plan...",
479
+ content: 'Đang xem xét yêu cầu…',
480
480
  });
481
481
  let planFirstChunkIso = '';
482
482
  let planChunkCount = 0;
@@ -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 PM creating a quick plan for a simple task.
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": "fullstack",
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 a senior technical PM orchestrating developer sessions. Your job is to:
47
- 1. Read the project structure to understand the codebase, tech stack, and existing patterns
48
- 2. Analyze the given task thoroughly
49
- 3. Define API contracts if the task involves both backend and frontend
50
- 4. Break the task into subtasks for different developer roles
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: "backend", "frontend", "tester", "fullstack"
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
- ? `Create a simple plan for this task:\n\n${task.description}`
134
- : `Analyze this project and create an execution plan.\n\nTask: ${task.description}\n\nFirst, explore the project structure to understand the codebase, existing patterns, and tech stack. Then output your plan as JSON.`;
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
  }
@@ -16,13 +16,7 @@ export declare const TaskAssignmentSchema: z.ZodObject<{
16
16
  file_type: z.ZodString;
17
17
  file_name: z.ZodString;
18
18
  }, z.core.$strip>>>;
19
- source: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
20
- manual: "manual";
21
- skill: "skill";
22
- scheduled: "scheduled";
23
- workflow: "workflow";
24
- api: "api";
25
- }>>>;
19
+ source: z.ZodDefault<z.ZodOptional<z.ZodString>>;
26
20
  agentId: z.ZodOptional<z.ZodString>;
27
21
  enableReflection: z.ZodOptional<z.ZodBoolean>;
28
22
  }, z.core.$strip>;
@@ -14,7 +14,10 @@ export const TaskAssignmentSchema = z.object({
14
14
  mode: z.enum(['tuna', 'agent_team']),
15
15
  confirmBeforeEdit: z.boolean().optional().default(false),
16
16
  attachments: z.array(ChatAttachmentSchema).optional(),
17
- source: z.enum(['manual', 'skill', 'scheduled', 'workflow', 'api']).optional().default('manual'),
17
+ // Accept any source string — it is metadata only. A strict enum here rejected
18
+ // the WHOLE task_assigned message for any new source (e.g. 'discord'), silently
19
+ // stranding tasks in 'queued'.
20
+ source: z.string().optional().default('manual'),
18
21
  agentId: z.string().optional(),
19
22
  enableReflection: z.boolean().optional(),
20
23
  }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tuna-agent",
3
- "version": "0.1.169",
3
+ "version": "0.1.171",
4
4
  "description": "Tuna Agent - Run AI coding tasks on your machine",
5
5
  "bin": {
6
6
  "tuna-agent": "dist/cli/index.js"