Skip to content

refactor: use context agnostic write to file#250

Merged
Lightning00Blade merged 3 commits intomainfrom
fix-up-writing-to-file
Oct 2, 2025
Merged

refactor: use context agnostic write to file#250
Lightning00Blade merged 3 commits intomainfrom
fix-up-writing-to-file

Conversation

@Lightning00Blade
Copy link
Copy Markdown
Collaborator

Similar to the write to temporary file we should hide the implementation behind the Context

Copy link
Copy Markdown
Contributor

@AlinaVarkki AlinaVarkki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great change, lgtm!

Comment thread src/McpContext.ts Outdated
Comment thread src/tools/ToolDefinition.ts
Comment thread src/McpContext.ts Outdated
@Lightning00Blade Lightning00Blade enabled auto-merge (squash) October 2, 2025 09:47
@Lightning00Blade Lightning00Blade merged commit 74c6d6d into main Oct 2, 2025
16 checks passed
@Lightning00Blade Lightning00Blade deleted the fix-up-writing-to-file branch October 2, 2025 09:50
Coquinate pushed a commit to Coquinate/chrome-devtools-mcp that referenced this pull request Oct 2, 2025
Updates take_snapshot and evaluate_script to use context.saveFile()
instead of direct writeFile() calls, following the pattern established
in PR ChromeDevTools#250.

Changes:
- Removed direct fs/promises imports
- Convert string data to Uint8Array using TextEncoder
- Use context.saveFile() for consistent file writing
- Update response messages to use returned filename

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
OrKoN pushed a commit to Coquinate/chrome-devtools-mcp that referenced this pull request Oct 10, 2025
Updates take_snapshot and evaluate_script to use context.saveFile()
instead of direct writeFile() calls, following the pattern established
in PR ChromeDevTools#250.

Changes:
- Removed direct fs/promises imports
- Convert string data to Uint8Array using TextEncoder
- Use context.saveFile() for consistent file writing
- Update response messages to use returned filename

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants