Merge pull request #2186 from bbartels/patch-1
Adds ability to disable thought logging
This commit is contained in:
commit
b7c48c79ee
2 changed files with 12 additions and 2 deletions
|
|
@ -77,6 +77,9 @@ Add this to your `claude_desktop_config.json`:
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
To disable logging of thought information set env var: `DISABLE_THOUGHT_LOGGING` to `true`.
|
||||||
|
Comment
|
||||||
|
|
||||||
### Usage with VS Code
|
### Usage with VS Code
|
||||||
|
|
||||||
For quick installation, click one of the installation buttons below...
|
For quick installation, click one of the installation buttons below...
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,11 @@ interface ThoughtData {
|
||||||
class SequentialThinkingServer {
|
class SequentialThinkingServer {
|
||||||
private thoughtHistory: ThoughtData[] = [];
|
private thoughtHistory: ThoughtData[] = [];
|
||||||
private branches: Record<string, ThoughtData[]> = {};
|
private branches: Record<string, ThoughtData[]> = {};
|
||||||
|
private disableThoughtLogging: boolean;
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
this.disableThoughtLogging = (process.env.DISABLE_THOUGHT_LOGGING || "").toLowerCase() === "true";
|
||||||
|
}
|
||||||
|
|
||||||
private validateThoughtData(input: unknown): ThoughtData {
|
private validateThoughtData(input: unknown): ThoughtData {
|
||||||
const data = input as Record<string, unknown>;
|
const data = input as Record<string, unknown>;
|
||||||
|
|
@ -100,8 +105,10 @@ class SequentialThinkingServer {
|
||||||
this.branches[validatedInput.branchId].push(validatedInput);
|
this.branches[validatedInput.branchId].push(validatedInput);
|
||||||
}
|
}
|
||||||
|
|
||||||
const formattedThought = this.formatThought(validatedInput);
|
if (!this.disableThoughtLogging) {
|
||||||
console.error(formattedThought);
|
const formattedThought = this.formatThought(validatedInput);
|
||||||
|
console.error(formattedThought);
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
content: [{
|
content: [{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue