ocpipe 0.6.5 → 0.6.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ocpipe",
3
- "version": "0.6.5",
3
+ "version": "0.6.6",
4
4
  "description": "SDK for LLM pipelines with OpenCode, Codex, and Zod",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
package/src/codex.ts CHANGED
@@ -12,6 +12,7 @@ import type { RunAgentOptions, RunAgentResult } from './types.js'
12
12
 
13
13
  class CodexLogFilter {
14
14
  private buf = ''
15
+ private suppressHtml = false
15
16
 
16
17
  write(text: string): string {
17
18
  this.buf += text
@@ -23,19 +24,30 @@ class CodexLogFilter {
23
24
  }
24
25
  const line = this.buf.slice(0, idx + 1)
25
26
  this.buf = this.buf.slice(idx + 1)
26
- if (suppressCodexLogLine(line)) {
27
- continue
28
- }
29
- out += line
27
+ out += this.filterLine(line)
30
28
  }
31
29
  }
32
30
 
33
31
  flush(): string {
34
32
  const line = this.buf
35
33
  this.buf = ''
34
+ return this.filterLine(line)
35
+ }
36
+
37
+ private filterLine(line: string): string {
38
+ if (this.suppressHtml) {
39
+ if (line.includes('</html>')) {
40
+ this.suppressHtml = false
41
+ }
42
+ return ''
43
+ }
36
44
  if (suppressCodexLogLine(line)) {
37
45
  return ''
38
46
  }
47
+ if (suppressCodexHtmlLine(line)) {
48
+ this.suppressHtml = !line.includes('</html>')
49
+ return ''
50
+ }
39
51
  return line
40
52
  }
41
53
  }
@@ -49,6 +61,10 @@ function suppressCodexLogLine(line: string): boolean {
49
61
  return /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+Z\s+WARN\s+codex_/.test(line)
50
62
  }
51
63
 
64
+ function suppressCodexHtmlLine(line: string): boolean {
65
+ return /^\s*(<!doctype html>|<html\b|<head\b)/i.test(line)
66
+ }
67
+
52
68
  /** runCodexAgent executes a Codex agent with a prompt. */
53
69
  export async function runCodexAgent(
54
70
  options: RunAgentOptions,
package/src/predict.ts CHANGED
@@ -77,6 +77,7 @@ export class Predict<S extends AnySignature> {
77
77
  timeoutSec: ctx.timeoutSec,
78
78
  workdir: ctx.workdir,
79
79
  claudeCode: ctx.claudeCode,
80
+ codex: ctx.codex,
80
81
  signal: ctx.signal,
81
82
  })
82
83
 
@@ -207,6 +208,7 @@ export class Predict<S extends AnySignature> {
207
208
  timeoutSec: ctx.timeoutSec,
208
209
  workdir: ctx.workdir,
209
210
  claudeCode: ctx.claudeCode,
211
+ codex: ctx.codex,
210
212
  signal: ctx.signal,
211
213
  })
212
214
 
@@ -284,6 +286,7 @@ export class Predict<S extends AnySignature> {
284
286
  timeoutSec: ctx.timeoutSec,
285
287
  workdir: ctx.workdir,
286
288
  claudeCode: ctx.claudeCode,
289
+ codex: ctx.codex,
287
290
  signal: ctx.signal,
288
291
  })
289
292