mirror of
https://github.com/aljazceru/claude-code-viewer.git
synced 2025-12-30 03:34:21 +01:00
fix: disable tool approve for old claude code version
This commit is contained in:
@@ -23,17 +23,13 @@ export class ClaudeCodeExecutor {
|
||||
);
|
||||
}
|
||||
|
||||
public get version() {
|
||||
return this.claudeCodeVersion?.version;
|
||||
}
|
||||
|
||||
public get availableFeatures() {
|
||||
public get features() {
|
||||
return {
|
||||
canUseTool:
|
||||
enableToolApproval:
|
||||
this.claudeCodeVersion?.greaterThanOrEqual(
|
||||
new ClaudeCodeVersion({ major: 1, minor: 0, patch: 82 }),
|
||||
) ?? false,
|
||||
uuidOnSDKMessage:
|
||||
extractUuidFromSDKMessage:
|
||||
this.claudeCodeVersion?.greaterThanOrEqual(
|
||||
new ClaudeCodeVersion({ major: 1, minor: 0, patch: 86 }),
|
||||
) ?? false,
|
||||
@@ -41,18 +37,14 @@ export class ClaudeCodeExecutor {
|
||||
}
|
||||
|
||||
public query(prompt: CCQueryPrompt, options: CCQueryOptions) {
|
||||
const { canUseTool, permissionMode, ...baseOptions } = options;
|
||||
const { canUseTool, ...baseOptions } = options;
|
||||
|
||||
return query({
|
||||
prompt,
|
||||
options: {
|
||||
pathToClaudeCodeExecutable: this.pathToClaudeCodeExecutable,
|
||||
...baseOptions,
|
||||
...(this.availableFeatures.canUseTool
|
||||
? { canUseTool, permissionMode }
|
||||
: {
|
||||
permissionMode: "bypassPermissions",
|
||||
}),
|
||||
...(this.features.enableToolApproval ? { canUseTool } : {}),
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user