tuna-agent 0.1.140 → 0.1.142
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.
|
@@ -33,7 +33,7 @@ export interface AppContext {
|
|
|
33
33
|
isWholeApp: boolean;
|
|
34
34
|
allFeatures: string[];
|
|
35
35
|
}
|
|
36
|
-
export declare function handleClaudePrompt(ws: AgentWebSocketClient, code: string, taskId: string, prompt: string, systemPrompt?: string): Promise<void>;
|
|
36
|
+
export declare function handleClaudePrompt(ws: AgentWebSocketClient, code: string, taskId: string, prompt: string, systemPrompt?: string, timeoutMs?: number): Promise<void>;
|
|
37
37
|
export declare function handleClaudePromptStream(ws: AgentWebSocketClient, code: string, taskId: string, prompt: string, systemPrompt?: string): Promise<void>;
|
|
38
38
|
export declare function handleGenerateIdeas(ws: AgentWebSocketClient, code: string, taskId: string, topic: string, styleName?: string, styleDesc?: string, language?: string, count?: number, ideasInstruction?: string, provider?: string, appContext?: AppContext): Promise<void>;
|
|
39
39
|
export declare function handleGenerateScript(ws: AgentWebSocketClient, code: string, taskId: string, idea: string, topic: string, style?: string, duration?: number, language?: string, styleName?: string, styleGuidance?: string, provider?: string): Promise<void>;
|
|
@@ -65,7 +65,7 @@ function hasContentCreator() {
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
// ─── Handler: claude_prompt (generic prompt → JSON result) ──────────────────
|
|
68
|
-
export async function handleClaudePrompt(ws, code, taskId, prompt, systemPrompt) {
|
|
68
|
+
export async function handleClaudePrompt(ws, code, taskId, prompt, systemPrompt, timeoutMs) {
|
|
69
69
|
console.log(`[claude_prompt] Received: ${prompt.substring(0, 100)}...`);
|
|
70
70
|
if (!hasContentCreator()) {
|
|
71
71
|
const error = 'content-creator agent not found on this machine';
|
|
@@ -80,7 +80,9 @@ export async function handleClaudePrompt(ws, code, taskId, prompt, systemPrompt)
|
|
|
80
80
|
cwd: CONTENT_CREATOR_DIR,
|
|
81
81
|
maxTurns: 1,
|
|
82
82
|
outputFormat: 'json',
|
|
83
|
-
|
|
83
|
+
// Caller-provided timeout (channel-manager passes 900000 for clone
|
|
84
|
+
// batches; AI-Suggest etc. omit it → 60s default preserved).
|
|
85
|
+
timeoutMs: timeoutMs && timeoutMs > 0 ? timeoutMs : 60000,
|
|
84
86
|
});
|
|
85
87
|
const text = typeof result === 'string' ? result : result.result || JSON.stringify(result);
|
|
86
88
|
console.log(`[claude_prompt] Result: ${text.substring(0, 200)}`);
|
package/dist/daemon/index.js
CHANGED
|
@@ -561,7 +561,7 @@ ${skillContent.slice(0, 15000)}`;
|
|
|
561
561
|
}
|
|
562
562
|
if (extTask === 'claude_prompt') {
|
|
563
563
|
(async () => {
|
|
564
|
-
await handleClaudePrompt(ws, extCode, extTaskId, msg.prompt, msg.systemPrompt);
|
|
564
|
+
await handleClaudePrompt(ws, extCode, extTaskId, msg.prompt, msg.systemPrompt, typeof msg.timeoutMs === 'number' ? msg.timeoutMs : undefined);
|
|
565
565
|
})();
|
|
566
566
|
break;
|
|
567
567
|
}
|