Skip to content

Conversation

ChiragAgg5k
Copy link
Member

What does this PR do?

Add HTTP client for Synapse

Test Plan

Related PRs and Issues

Have you read the Contributing Guidelines on issues?

yes.

Copy link

github-actions bot commented Jul 15, 2025

🚀 Previews available on pkg.vc!

📦 @appwrite.io/synapse

Install @appwrite.io/synapse with:

npm install https://pkg.vc/-/@appwrite/@appwrite.io/synapse@fa46c2a

Alternatively, you may specify a branch name or pull request number:

npm install https://pkg.vc/-/@appwrite/@appwrite.io/synapse~feat-http-client
npm install https://pkg.vc/-/@appwrite/@appwrite.io/synapse!35

Copilot

This comment was marked as outdated.

@ChiragAgg5k ChiragAgg5k requested a review from Copilot July 15, 2025 11:42
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Add a standalone HTTP client for Synapse that mirrors existing WebSocket services, exposing it via the package entry point and documenting basic usage.

  • Introduced SynapseHTTPClient and createSynapseHTTPClient in src/index.ts to aggregate new HTTP service classes
  • Added individual HTTP service classes for terminal, system, git, filesystem, code formatting/linting, and Appwrite in src/client/services
  • Updated README with an example usage section for the HTTP client

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/services/filesystem.ts Added trailing commas in IGNORE_PATTERNS and log calls
src/index.ts Exported SynapseHTTPClient, createSynapseHTTPClient, and related types
src/client/services/terminal.ts Added TerminalHTTPService for executing shell commands
src/client/services/system.ts Added SystemHTTPService for system usage data
src/client/services/git.ts Added GitHTTPService for Git operations
src/client/services/filesystem.ts Added FilesystemHTTPService for file operations
src/client/services/code.ts Added CodeHTTPService for code formatting and linting
src/client/services/appwrite.ts Added AppwriteHTTPService for Appwrite initialization/calls
src/client/http.ts Introduced SynapseHTTPClient and type exports
src/client/base.ts Introduced BaseHTTPClient with shared request logic
README.md Documented HTTP client usage in an example snippet
Comments suppressed due to low confidence (5)

README.md:183

  • The example uses property path, but readFile expects filepath. Update to client.readFile({ filepath: "/path/to/file.txt" }).
const fileContent = await client.readFile({ path: "/path/to/file.txt" });

README.md:184

  • The example uses path for createFile, but the method signature expects filepath. Update to client.createFile({ filepath: "/path/to/new-file.txt", content: "Hello!" }).
await client.createFile({ path: "/path/to/new-file.txt", content: "Hello!" });

README.md:189

  • The example uses workingDirectory, but executeCommand expects cwd. Update to cwd: "/path/to/dir".
  workingDirectory: "/path/to/dir",

src/client/http.ts:38

  • Consider adding unit tests for SynapseHTTPClient and its composed service methods to ensure HTTP client behavior is verified and maintained.
export class SynapseHTTPClient {

src/client/services/filesystem.ts:76

  • [nitpick] The parameter name filepath is inconsistent with other methods (e.g., dirPath) and common conventions. Consider standardizing naming (e.g., filePath or path) across the client API.
    filepath,

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.

1 participant