tuna-agent 0.1.64 → 0.1.66

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.
@@ -276,11 +276,27 @@ export class ClaudeCodeAdapter {
276
276
  console.log(`[ClaudeCode] Init tools: total=${toolNames.length}, mcp=${mcpTools.length} (${mcpTools.join(', ') || 'none'})`);
277
277
  console.log(`[ClaudeCode] All tools: ${toolNames.join(', ')}`);
278
278
  }
279
- // Send tool usage to activity tab
279
+ // Extract text + tool usage from assistant messages
280
280
  if (data.type === 'assistant' && data.message) {
281
281
  const msg = data.message;
282
282
  const content = msg.content;
283
283
  if (content) {
284
+ // Extract full text from assistant message as source of truth
285
+ // (stream_event content_block_delta may miss chunks on rate limits)
286
+ const fullText = content
287
+ .filter(b => b.type === 'text' && b.text)
288
+ .map(b => b.text)
289
+ .join('');
290
+ if (fullText && fullText.length > turnAccumulatedText.length) {
291
+ const missed = fullText.slice(turnAccumulatedText.length);
292
+ if (missed.length > 0) {
293
+ console.log(`[ClaudeCode] 🔧 Stream missed ${missed.length} chars — patching from assistant message`);
294
+ turnAccumulatedText = fullText;
295
+ // Stream the missed portion to app
296
+ ws.sendPMStream(task.id, missed);
297
+ }
298
+ }
299
+ // Send tool usage to activity tab
284
300
  for (const block of content) {
285
301
  if (block.type === 'tool_use') {
286
302
  const toolName = block.name;
@@ -355,10 +355,11 @@ export async function startDaemon(config) {
355
355
  const analyzePrompt = `You are analyzing a Claude Code skill file (markdown prompt template). Extract the following structured information from the content below:
356
356
 
357
357
  1. **description**: A short summary of what this skill does in under 80 characters. Be very concise — like a subtitle, not a full sentence.
358
- 2. **actions**: Sub-commands or modes available in this skill. Look for sections, headings, or conditional logic that indicate different actions/modes the user can invoke. Each action has:
358
+ 2. **actions**: Distinct sub-commands or operations the user can choose from. An action represents a SEPARATE task the skill can perform not just a flag, option, or variation of the same task. Each action has:
359
359
  - "name" (short, lowercase, no spaces — use hyphens)
360
360
  - "description" (what it does, max 100 chars)
361
361
  - "params" (array of parameter KEY strings that are relevant to THIS specific action — only include params that this action actually uses)
362
+ IMPORTANT: Flags like --all, --verbose, --dry-run are PARAMETERS, not actions. A mode that simply runs the same task with different scope (e.g. "browse one platform" vs "browse all platforms") is ONE action with a parameter, not two separate actions. Only create multiple actions when the skill does fundamentally different things (e.g. "create" vs "delete" vs "list").
362
363
  3. **parameters**: ALL input parameters the skill accepts (the full definitions). Look for {{param_name}} placeholders, $ARGUMENTS references, or documented inputs. Each parameter has "key", "label", "type" (text/number/select/multiline), "required" (boolean), "default_value", "options" (for select type), "placeholder".
363
364
  - IMPORTANT: If a parameter has a finite set of known values (e.g. listed in config files, enums, documented choices), use type "select" and populate the "options" array with ALL known values. Only use type "text" when the input is truly free-form.
364
365
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tuna-agent",
3
- "version": "0.1.64",
3
+ "version": "0.1.66",
4
4
  "description": "Tuna Agent - Run AI coding tasks on your machine",
5
5
  "bin": {
6
6
  "tuna-agent": "dist/cli/index.js"