@11agents/cli 0.1.10 → 0.1.12

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/README.md CHANGED
@@ -102,7 +102,7 @@ On startup, and every 30 minutes after that, the daemon syncs project metadata a
102
102
 
103
103
  Codex runs from `~/.11agents/<project>/` by default. Treat that directory as read-only project context. Task code may write temporary files only under `./tmp/<taskId>/`; the daemon removes that task scratch directory after the task finishes. Agent environment variables from the control plane are injected into the Codex child process and are not written to disk.
104
104
 
105
- The built-in Codex worker starts task executions with `codex --yolo exec` by default so remote runtime tasks can run without approval prompts or sandbox restrictions. To opt a daemon back into a Codex sandbox, start it with `--codex-sandbox read-only`, `--codex-sandbox workspace-write`, or `--codex-sandbox danger-full-access`.
105
+ The built-in Codex worker starts task executions with `codex --ask-for-approval never --yolo exec` and prefixes the task prompt with `/goal ` by default so remote runtime tasks can run without approval prompts or sandbox restrictions. To opt a daemon back into a Codex sandbox, start it with `--codex-sandbox read-only`, `--codex-sandbox workspace-write`, or `--codex-sandbox danger-full-access`.
106
106
 
107
107
  The built-in task runner currently supports Codex tasks. A custom handler may export:
108
108
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@11agents/cli",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
4
4
  "description": "11agents local runtime and telemetry CLI",
5
5
  "type": "module",
6
6
  "bin": {
@@ -20,18 +20,28 @@ function sleep(ms) {
20
20
  return new Promise(resolve => setTimeout(resolve, ms))
21
21
  }
22
22
 
23
- function runProcess(command, args, { input = '', cwd = process.cwd(), env = process.env } = {}) {
23
+ export function runProcess(command, args, { input = '', cwd = process.cwd(), env = process.env } = {}) {
24
24
  return new Promise(resolve => {
25
+ let settled = false
25
26
  const child = spawn(command, args, { cwd, env, stdio: ['pipe', 'pipe', 'pipe'] })
26
27
  let stdout = ''
27
28
  let stderr = ''
29
+ const settle = result => {
30
+ if (settled) return
31
+ settled = true
32
+ resolve(result)
33
+ }
28
34
  child.stdout.on('data', chunk => { stdout += chunk })
29
35
  child.stderr.on('data', chunk => { stderr += chunk })
30
36
  child.on('error', error => {
31
- resolve({ code: 127, stdout, stderr: error.message })
37
+ settle({ code: 127, stdout, stderr: error.message })
32
38
  })
33
39
  child.on('close', code => {
34
- resolve({ code: code ?? 1, stdout, stderr })
40
+ settle({ code: code ?? 1, stdout, stderr })
41
+ })
42
+ child.stdin.on('error', error => {
43
+ if (error?.code === 'EPIPE' || error?.code === 'ERR_STREAM_DESTROYED') return
44
+ stderr = stderr ? `${stderr}\n${error.message}` : error.message
35
45
  })
36
46
  child.stdin.end(input)
37
47
  })
@@ -830,7 +840,7 @@ async function runCodex({ task, prompt, flags = {}, deps }) {
830
840
 
831
841
  const commandLine = [codexBin, ...args].map(value => JSON.stringify(String(value))).join(' ')
832
842
  deps.log(JSON.stringify({ running: 'codex exec', command: commandLine, workdir }, null, 2))
833
- const result = await deps.runProcess(codexBin, args, { input: prompt, cwd: workdir, env: task.execution_context?.env || process.env })
843
+ const result = await deps.runProcess(codexBin, args, { input: `/goal ${prompt}`, cwd: workdir, env: task.execution_context?.env || process.env })
834
844
  const output = String(result.stdout || '').trim()
835
845
  const error = String(result.stderr || '').trim()
836
846
  if (result.code !== 0) {