openthrottle 0.1.9 → 0.1.11
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/init.js +7 -2
- package/package.json +1 -1
package/dist/init.js
CHANGED
|
@@ -155,6 +155,7 @@ async function promptConfig(detected) {
|
|
|
155
155
|
},
|
|
156
156
|
{ type: 'number', name: 'maxTurns', message: 'Max turns per agent run', initial: 200, min: 1 },
|
|
157
157
|
{ type: 'number', name: 'maxBudgetUsd', message: 'Max budget per run in USD (API only)', initial: 5, min: 0 },
|
|
158
|
+
{ type: 'number', name: 'taskTimeoutMin', message: 'Task timeout in minutes', initial: 120, min: 5 },
|
|
158
159
|
{ type: 'confirm', name: 'reviewEnabled', message: 'Enable automated PR review?', initial: true },
|
|
159
160
|
{
|
|
160
161
|
type: (prev) => prev ? 'number' : null,
|
|
@@ -162,7 +163,7 @@ async function promptConfig(detected) {
|
|
|
162
163
|
},
|
|
163
164
|
{ type: 'text', name: 'snapshotName', message: 'Daytona snapshot name', initial: 'openthrottle' },
|
|
164
165
|
], { onCancel: () => { console.log('\nCancelled.'); process.exit(0); } });
|
|
165
|
-
const { baseBranch, test, build, lint, format, dev, postBootstrap, agent, notifications, maxTurns, maxBudgetUsd, reviewEnabled, maxRounds, snapshotName } = response;
|
|
166
|
+
const { baseBranch, test, build, lint, format, dev, postBootstrap, agent, notifications, maxTurns, maxBudgetUsd, taskTimeoutMin, reviewEnabled, maxRounds, snapshotName } = response;
|
|
166
167
|
return {
|
|
167
168
|
...detected,
|
|
168
169
|
baseBranch: baseBranch || detected.baseBranch,
|
|
@@ -176,6 +177,7 @@ async function promptConfig(detected) {
|
|
|
176
177
|
notifications: notifications,
|
|
177
178
|
maxTurns: maxTurns,
|
|
178
179
|
maxBudgetUsd: maxBudgetUsd,
|
|
180
|
+
taskTimeoutMin: taskTimeoutMin,
|
|
179
181
|
reviewEnabled: reviewEnabled,
|
|
180
182
|
maxRounds: maxRounds,
|
|
181
183
|
snapshotName: snapshotName,
|
|
@@ -205,6 +207,7 @@ function generateConfig(config) {
|
|
|
205
207
|
limits: {
|
|
206
208
|
max_turns: config.maxTurns ?? 200,
|
|
207
209
|
max_budget_usd: config.maxBudgetUsd ?? 5,
|
|
210
|
+
task_timeout: (config.taskTimeoutMin ?? 120) * 60,
|
|
208
211
|
},
|
|
209
212
|
review: {
|
|
210
213
|
enabled: config.reviewEnabled,
|
|
@@ -233,8 +236,10 @@ function copyWorkflow(config) {
|
|
|
233
236
|
const dest = join(destDir, 'wake-sandbox.yml');
|
|
234
237
|
mkdirSync(destDir, { recursive: true });
|
|
235
238
|
let content = readFileSync(src, 'utf8');
|
|
239
|
+
// Keys already present in the template — don't inject duplicates
|
|
240
|
+
const builtinKeys = new Set([...content.matchAll(/^\s+([A-Z_][A-Z0-9_]*):\s*\$\{\{/gm)].map(m => m[1]));
|
|
236
241
|
// Inject project-specific secrets into the workflow
|
|
237
|
-
const allKeys = config.envAllKeys || [];
|
|
242
|
+
const allKeys = (config.envAllKeys || []).filter(k => !builtinKeys.has(k));
|
|
238
243
|
if (allKeys.length > 0) {
|
|
239
244
|
// Add env: entries for secrets
|
|
240
245
|
const envSecrets = allKeys
|