cliclaw 1.0.23 → 1.0.24
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/bin/cli.js +8 -9
- package/package.json +1 -1
- package/src/agents/codex.ts +2 -2
package/bin/cli.js
CHANGED
|
@@ -189,19 +189,18 @@ async function runConfigWizard() {
|
|
|
189
189
|
console.log(`${c.gray} Leave empty to configure later.\n${c.reset}`)
|
|
190
190
|
const forumId = await prompt('FORUM_GROUP_ID (Enter to skip)', existing.FORUM_GROUP_ID || '')
|
|
191
191
|
|
|
192
|
-
console.log(`\n${c.bold}
|
|
193
|
-
console.log(` ${c.bold}1)
|
|
194
|
-
console.log(` ${c.bold}2)
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
ok(`Permission mode: ${permMode}`)
|
|
192
|
+
console.log(`\n${c.bold}Codex — aprovação de comandos${c.reset}`)
|
|
193
|
+
console.log(` ${c.bold}1) ask${c.reset} — pergunta antes de cada comando ${c.cyan}(recomendado)${c.reset}`)
|
|
194
|
+
console.log(` ${c.bold}2) allow${c.reset} — executa tudo automaticamente\n`)
|
|
195
|
+
const approvalChoice = await prompt('Escolha [1/2]',
|
|
196
|
+
existing.CODEX_APPROVAL === 'allow' ? '2' : '1')
|
|
197
|
+
const codexApproval = approvalChoice === '2' ? 'allow' : 'ask'
|
|
198
|
+
ok(`Codex approval: ${codexApproval}`)
|
|
200
199
|
|
|
201
200
|
const dataDir = existing.DATA_DIR || path.join(USER_DIR, 'data')
|
|
202
201
|
let envContent = `TELEGRAM_BOT_TOKEN=${token}\n`
|
|
203
202
|
if (forumId) envContent += `FORUM_GROUP_ID=${forumId}\n`
|
|
204
|
-
envContent += `
|
|
203
|
+
envContent += `CODEX_APPROVAL=${codexApproval}\n`
|
|
205
204
|
envContent += `DATA_DIR=${dataDir}\n`
|
|
206
205
|
fs.writeFileSync(envFile, envContent, 'utf8')
|
|
207
206
|
ok(`.env saved → ${envFile}`)
|
package/package.json
CHANGED
package/src/agents/codex.ts
CHANGED
|
@@ -14,8 +14,8 @@ const BASE_ENV = {
|
|
|
14
14
|
LANG: 'en_US.UTF-8',
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
const SESSION_TTL_MS = 30 * 60 * 1000
|
|
18
|
-
const RESPONSE_TIMEOUT_MS =
|
|
17
|
+
const SESSION_TTL_MS = 30 * 60 * 1000 // kill idle processes after 30 min
|
|
18
|
+
const RESPONSE_TIMEOUT_MS = 10 * 60_000 // 10 min — allows time for user approval clicks
|
|
19
19
|
|
|
20
20
|
interface PendingReq {
|
|
21
21
|
resolve: (r: { text: string; usage?: TokenUsage }) => void
|