sw-plan 0.1.22 → 0.1.23
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/execute.d.ts.map +1 -1
- package/dist/execute.js +28 -70
- package/dist/execute.js.map +1 -1
- package/package.json +1 -1
package/dist/execute.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../execute.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAqBpC,UAAU,cAAc;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,GAAG,QAAQ,CAAC;CAC/B;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../execute.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAqBpC,UAAU,cAAc;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,GAAG,QAAQ,CAAC;CAC/B;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAyH3E;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAoB7D"}
|
package/dist/execute.js
CHANGED
|
@@ -37,18 +37,13 @@ export async function executeCommand(options) {
|
|
|
37
37
|
outputStage('start', options.outputMode);
|
|
38
38
|
console.error('\n=== Stage 1: Pre-build Check ===\n');
|
|
39
39
|
console.error('Running build verification before making changes...');
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
IMPORTANT:
|
|
49
|
-
- Do NOT make any changes to code
|
|
50
|
-
- Only run the build command and report results
|
|
51
|
-
- If the build fails, report the error details`, repoPath, options.outputMode, undefined, // sessionId
|
|
40
|
+
// Read prompt from file
|
|
41
|
+
const preBuildPromptPath = `${repoPath}/.execute-prompts/pre-build-check.txt`;
|
|
42
|
+
if (!existsSync(preBuildPromptPath)) {
|
|
43
|
+
throw new Error(`Pre-build check prompt file not found: ${preBuildPromptPath}`);
|
|
44
|
+
}
|
|
45
|
+
const preBuildPrompt = readFileSync(preBuildPromptPath, 'utf-8');
|
|
46
|
+
const preBuildResult = await runTextStage(preBuildPrompt, repoPath, options.outputMode, undefined, // sessionId
|
|
52
47
|
undefined, // logCallback
|
|
53
48
|
repoPath // allowedWriteDir - auto-approve writes in repo
|
|
54
49
|
);
|
|
@@ -57,22 +52,13 @@ IMPORTANT:
|
|
|
57
52
|
outputStage('plan1', options.outputMode);
|
|
58
53
|
console.error('\n=== Stage 2: Execute Integration Plan ===\n');
|
|
59
54
|
console.error('Executing the integration plan...');
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
Follow the plan above step-by-step to implement the integration. The plan has been generated with all necessary context and steps.
|
|
69
|
-
|
|
70
|
-
IMPORTANT:
|
|
71
|
-
- Follow the plan exactly as written
|
|
72
|
-
- Complete all setup, integration, and verification steps
|
|
73
|
-
- Make all necessary code changes
|
|
74
|
-
- Install any required packages
|
|
75
|
-
- The plan is cached in AI cache for reference`, repoPath, options.outputMode, preBuildResult.sessionId, // Resume from pre-build check
|
|
55
|
+
// Read prompt from file
|
|
56
|
+
const executePromptPath = `${repoPath}/.execute-prompts/execute-integration.txt`;
|
|
57
|
+
if (!existsSync(executePromptPath)) {
|
|
58
|
+
throw new Error(`Execute integration prompt file not found: ${executePromptPath}`);
|
|
59
|
+
}
|
|
60
|
+
const executePrompt = readFileSync(executePromptPath, 'utf-8');
|
|
61
|
+
const executionResult = await runTextStage(executePrompt, repoPath, options.outputMode, preBuildResult.sessionId, // Resume from pre-build check
|
|
76
62
|
undefined, // logCallback
|
|
77
63
|
repoPath // allowedWriteDir - auto-approve writes in repo
|
|
78
64
|
);
|
|
@@ -81,18 +67,13 @@ IMPORTANT:
|
|
|
81
67
|
outputStage('plan2', options.outputMode);
|
|
82
68
|
console.error('\n=== Stage 3: Post-build Verification ===\n');
|
|
83
69
|
console.error('Verifying that everything builds correctly...');
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
4. Report the final status
|
|
92
|
-
|
|
93
|
-
IMPORTANT:
|
|
94
|
-
- Fix any build errors that arise from the integration
|
|
95
|
-
- Ensure the build succeeds before completing`, repoPath, options.outputMode, executionResult.sessionId, // Resume from execution
|
|
70
|
+
// Read prompt from file
|
|
71
|
+
const postBuildPromptPath = `${repoPath}/.execute-prompts/post-build-verification.txt`;
|
|
72
|
+
if (!existsSync(postBuildPromptPath)) {
|
|
73
|
+
throw new Error(`Post-build verification prompt file not found: ${postBuildPromptPath}`);
|
|
74
|
+
}
|
|
75
|
+
const postBuildPrompt = readFileSync(postBuildPromptPath, 'utf-8');
|
|
76
|
+
await runTextStage(postBuildPrompt, repoPath, options.outputMode, executionResult.sessionId, // Resume from execution
|
|
96
77
|
undefined, // logCallback
|
|
97
78
|
repoPath // allowedWriteDir - auto-approve writes in repo
|
|
98
79
|
);
|
|
@@ -100,36 +81,13 @@ IMPORTANT:
|
|
|
100
81
|
// Stage 4: Commit and push changes
|
|
101
82
|
outputStage('plan3', options.outputMode);
|
|
102
83
|
console.error('\n=== Stage 4: Commit and Push Changes ===\n');
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
3. Create a descriptive commit message based on the integration
|
|
111
|
-
4. Commit the changes: git commit -m "your message"
|
|
112
|
-
5. Push the changes: git push
|
|
113
|
-
|
|
114
|
-
HANDLING MERGE CONFLICTS:
|
|
115
|
-
If the push fails due to remote changes:
|
|
116
|
-
1. Pull the latest changes: git pull --rebase
|
|
117
|
-
2. If there are merge conflicts:
|
|
118
|
-
- Check which files have conflicts: git status
|
|
119
|
-
- Read the conflicting files and resolve conflicts manually
|
|
120
|
-
- Look for conflict markers (<<<<<<, =======, >>>>>>>)
|
|
121
|
-
- Keep the appropriate changes (usually prefer your integration changes)
|
|
122
|
-
- Stage the resolved files: git add <file>
|
|
123
|
-
- Continue the rebase: git rebase --continue
|
|
124
|
-
3. Once conflicts are resolved, push again: git push
|
|
125
|
-
4. If pull/rebase fails repeatedly, try: git pull --no-rebase, then push
|
|
126
|
-
|
|
127
|
-
IMPORTANT:
|
|
128
|
-
- Use a clear commit message that describes the integration (e.g., "feat: integrate Stripe payments")
|
|
129
|
-
- Make sure ALL changes from the integration are included
|
|
130
|
-
- Handle merge conflicts carefully - prefer keeping the integration changes
|
|
131
|
-
- Keep retrying until the push succeeds
|
|
132
|
-
- If you encounter any git errors, read the error message and follow the suggested fix`, repoPath, options.outputMode, executionResult.sessionId, // Resume from execution
|
|
84
|
+
// Read prompt from file
|
|
85
|
+
const commitPromptPath = `${repoPath}/.execute-prompts/commit-and-push.txt`;
|
|
86
|
+
if (!existsSync(commitPromptPath)) {
|
|
87
|
+
throw new Error(`Commit and push prompt file not found: ${commitPromptPath}`);
|
|
88
|
+
}
|
|
89
|
+
const commitPrompt = readFileSync(commitPromptPath, 'utf-8');
|
|
90
|
+
await runTextStage(commitPrompt, repoPath, options.outputMode, executionResult.sessionId, // Resume from execution
|
|
133
91
|
undefined, // logCallback
|
|
134
92
|
repoPath // allowedWriteDir - auto-approve writes in repo
|
|
135
93
|
);
|
package/dist/execute.js.map
CHANGED
|
@@ -1 +1 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