ocpipe 0.5.6 → 0.5.7
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/claude-code.ts +24 -8
- package/src/types.ts +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ocpipe",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.7",
|
|
4
4
|
"description": "SDK for LLM pipelines with OpenCode and Zod",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"dependencies": {},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"zod": "4.3.6",
|
|
34
|
-
"@anthropic-ai/claude-agent-sdk": "0.2.
|
|
34
|
+
"@anthropic-ai/claude-agent-sdk": "0.2.20"
|
|
35
35
|
},
|
|
36
36
|
"peerDependenciesMeta": {
|
|
37
37
|
"@anthropic-ai/claude-agent-sdk": {
|
package/src/claude-code.ts
CHANGED
|
@@ -94,7 +94,14 @@ const logToolCall: HookCallback = async (input) => {
|
|
|
94
94
|
export async function runClaudeCodeAgent(
|
|
95
95
|
options: RunAgentOptions,
|
|
96
96
|
): Promise<RunAgentResult> {
|
|
97
|
-
const {
|
|
97
|
+
const {
|
|
98
|
+
prompt,
|
|
99
|
+
model,
|
|
100
|
+
sessionId,
|
|
101
|
+
timeoutSec = 600,
|
|
102
|
+
claudeCode,
|
|
103
|
+
signal,
|
|
104
|
+
} = options
|
|
98
105
|
|
|
99
106
|
// Check if already aborted
|
|
100
107
|
if (signal?.aborted) {
|
|
@@ -119,6 +126,10 @@ export async function runClaudeCodeAgent(
|
|
|
119
126
|
claudeCode?.dangerouslySkipPermissions && {
|
|
120
127
|
allowDangerouslySkipPermissions: true,
|
|
121
128
|
}),
|
|
129
|
+
// Pass through custom executable path if provided
|
|
130
|
+
...(claudeCode?.pathToClaudeCodeExecutable && {
|
|
131
|
+
pathToClaudeCodeExecutable: claudeCode.pathToClaudeCodeExecutable,
|
|
132
|
+
}),
|
|
122
133
|
}
|
|
123
134
|
|
|
124
135
|
console.error(
|
|
@@ -158,13 +169,18 @@ export async function runClaudeCodeAgent(
|
|
|
158
169
|
: null
|
|
159
170
|
|
|
160
171
|
// Set up abort promise
|
|
161
|
-
const abortPromise =
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
172
|
+
const abortPromise =
|
|
173
|
+
signal ?
|
|
174
|
+
new Promise<never>((_, reject) => {
|
|
175
|
+
signal.addEventListener(
|
|
176
|
+
'abort',
|
|
177
|
+
() => {
|
|
178
|
+
reject(new Error('Request aborted'))
|
|
179
|
+
},
|
|
180
|
+
{ once: true },
|
|
181
|
+
)
|
|
182
|
+
})
|
|
183
|
+
: null
|
|
168
184
|
|
|
169
185
|
// Stream the response
|
|
170
186
|
const streamPromise = (async () => {
|
package/src/types.ts
CHANGED
|
@@ -24,6 +24,8 @@ export interface ClaudeCodeOptions {
|
|
|
24
24
|
permissionMode?: PermissionMode
|
|
25
25
|
/** Required when using 'bypassPermissions' mode. */
|
|
26
26
|
dangerouslySkipPermissions?: boolean
|
|
27
|
+
/** Path to Claude Code executable (default: auto-detected). */
|
|
28
|
+
pathToClaudeCodeExecutable?: string
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
/** Model configuration for LLM backends. */
|