ocpipe 0.3.5 → 0.3.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 +2 -2
- package/src/agent.ts +6 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ocpipe",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.6",
|
|
4
4
|
"description": "SDK for LLM pipelines with OpenCode and Zod",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"bun": ">=1.0.0"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"opencode-ai": "1.1.
|
|
32
|
+
"opencode-ai": "1.1.20"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"zod": "4.3.5"
|
package/src/agent.ts
CHANGED
|
@@ -65,10 +65,12 @@ export async function runAgent(
|
|
|
65
65
|
|
|
66
66
|
let newSessionId = sessionId || ''
|
|
67
67
|
const stdoutChunks: string[] = []
|
|
68
|
+
const stderrChunks: string[] = []
|
|
68
69
|
|
|
69
70
|
// Stream stderr in real-time (OpenCode progress output)
|
|
70
71
|
proc.stderr.on('data', (data: Buffer) => {
|
|
71
72
|
const text = data.toString()
|
|
73
|
+
stderrChunks.push(text)
|
|
72
74
|
|
|
73
75
|
// Parse session ID from output
|
|
74
76
|
for (const line of text.split('\n')) {
|
|
@@ -109,7 +111,10 @@ export async function runAgent(
|
|
|
109
111
|
if (timeout) clearTimeout(timeout)
|
|
110
112
|
|
|
111
113
|
if (code !== 0) {
|
|
112
|
-
|
|
114
|
+
const stderr = stderrChunks.join('').trim()
|
|
115
|
+
const lastLines = stderr.split('\n').slice(-5).join('\n')
|
|
116
|
+
const detail = lastLines ? `\n${lastLines}` : ''
|
|
117
|
+
reject(new Error(`OpenCode exited with code ${code}${detail}`))
|
|
113
118
|
return
|
|
114
119
|
}
|
|
115
120
|
|