npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@loopstack/remote-file-explorer-module

v0.24.4

Published

Remote file browsing for Loopstack workspaces — proxies file tree and content requests to remote agents

Readme


title: Remote File Explorer Module description: REST API controller for browsing files on remote Loopstack workspaces — RemoteFileExplorerModule, RemoteFileExplorerController, file tree and file content endpoints, proxies requests via RemoteClient and EnvironmentService

@loopstack/remote-file-explorer-module

File browsing module for the Loopstack automation framework.

Exposes REST endpoints that let a frontend (like Loopstack Studio) browse the file system of a remote workspace. The controller resolves the workspace's remote agent URL and proxies requests through RemoteClient from @loopstack/remote-client.

When to Use

  • You are building a UI that needs to render a file tree and display file contents for a remote workspace.
  • You want authenticated REST endpoints that proxy file requests to a remote agent without exposing the agent URL to the client.
  • Use @loopstack/local-file-explorer-module instead if the files are on the local machine.
  • Use GlobTool / ReadTool from @loopstack/remote-client instead if you need file access inside a workflow (this module provides no workflow tools).

Installation

npm install @loopstack/remote-file-explorer-module

Register the module in your app:

import { Module } from '@nestjs/common';
import { RemoteFileExplorerModule } from '@loopstack/remote-file-explorer-module';

@Module({
  imports: [RemoteFileExplorerModule],
})
export class AppModule {}

RemoteFileExplorerModule depends on RemoteClient and EnvironmentService from @loopstack/remote-client, which must be available in the DI container (import RemoteClientModule in a parent module).

Feature gating

Use forFeature() to register the module with optional feature-flag configuration:

RemoteFileExplorerModule.forFeature({ enabled: true, environments: ['production'] });

Quick Start

Once imported, the controller is available at /api/v1/workspaces/:workspaceId/files. No additional setup is required beyond having RemoteClientModule registered.

GET /api/v1/workspaces/:workspaceId/files/tree?path=src
GET /api/v1/workspaces/:workspaceId/files/read?path=src/index.ts

Both endpoints require an authenticated user (resolved via @CurrentUser()).

How It Works

Frontend (Studio)
    |
    |  GET /api/v1/workspaces/:workspaceId/files/tree?path=src
    v
RemoteFileExplorerController
    |
    |  EnvironmentService.getAgentUrlForWorkspace(workspaceId)
    |  -> resolves the remote agent URL for the workspace
    |
    |  RemoteClient.getFileTree(agentUrl, path)
    v
Remote Agent (remote-server)
    |
    |  reads filesystem, returns FileTreeNode[]
    v
Response -> Frontend

The controller has two endpoints:

  1. GET tree -- calls RemoteClient.getFileTree(). Defaults to ./src if no path query param is provided.
  2. GET read -- calls RemoteClient.readFile(). Requires a path query param.

Both endpoints resolve the workspace's agent URL via EnvironmentService.getAgentUrlForWorkspace() before proxying.

Endpoints Reference

GET /api/v1/workspaces/:workspaceId/files/tree

Returns the directory tree for the given path.

| Parameter | In | Type | Required | Description | | ------------- | ----- | -------- | -------- | --------------------------------------- | | workspaceId | path | string | yes | The workspace ID | | path | query | string | no | Base path to list (defaults to ./src) |

Response: FileTreeNode[]

interface FileTreeNode {
  id: string;
  name: string;
  path: string;
  type: 'file' | 'folder';
  children?: FileTreeNode[];
}

GET /api/v1/workspaces/:workspaceId/files/read

Returns the content of a single file.

| Parameter | In | Type | Required | Description | | ------------- | ----- | -------- | -------- | ----------------- | | workspaceId | path | string | yes | The workspace ID | | path | query | string | yes | File path to read |

Response: FileReadResponse

interface FileReadResponse {
  content: string;
}

Configuration

RemoteFileExplorerModule.forFeature() accepts an optional config object:

| Option | Type | Default | Description | | -------------- | ---------- | ------- | -------------------------------------- | | enabled | boolean | true | Whether the feature is active | | environments | string[] | all | Restrict to specific environment names |

No environment variables are required by this module itself. The remote agent URL is resolved at runtime by EnvironmentService from @loopstack/remote-client.

Public API

  • Module: RemoteFileExplorerModule -- NestJS module with forFeature() static method
  • Controller: RemoteFileExplorerController -- REST controller with getFileTree() and readFile() endpoints

Dependencies

| Package | Role | | -------------------------- | ----------------------------------------------- | | @loopstack/common | Shared utilities, CurrentUser decorator | | @loopstack/remote-client | RemoteClient service and EnvironmentService | | @nestjs/common | NestJS framework | | @nestjs/typeorm | TypeORM integration | | typeorm | ORM |

Related

About

Author: Jakob Klippel

License: MIT