File size: 1,852 Bytes
34450be
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
with open("App.tsx", "r") as f:
    content = f.read()

# Update handleSubmitCreateSession so it uses the new queue format if the HF Deployment Cue checkbox is checked!
old_submit = """        // Queue HF Deployment Cue if checked
        if (config.runHfDeploymentCue) {
            const templates = [
                "Please perform a deep investigation of the codebase to understand its current state and architecture. Look for dependencies, main entry points, and service patterns. READY",
                "Based on the investigation, create a detailed project vision and implementation plan. Outline the necessary changes and new components. READY",
                "Implement the changes according to the plan and prepare for deployment. Ensure all tests pass and documentation is updated. READY"
            ];
            setTemplateQueue(prev => ({
                ...prev,
                [newSession.id]: templates
            }));
        }"""

new_submit = """        // Queue HF Deployment Cue if checked
        if (config.runHfDeploymentCue) {
            const templates = [
                "Based on the investigation, create a detailed project vision and implementation plan. Outline the necessary changes and new components. READY",
                "Implement the changes according to the plan and prepare for deployment. Ensure all tests pass and documentation is updated. READY"
            ];

            // The first template is config.prompt which is already sent
            setHfTimerQueue(prev => ({
                ...prev,
                [newSession.id]: {
                    templates: templates,
                    nextExecutionTime: Date.now() + 30 * 60 * 1000
                }
            }));
        }"""

content = content.replace(old_submit, new_submit)

with open("App.tsx", "w") as f:
    f.write(content)