Skip to content

Conversation

@turchinc
Copy link
Contributor

@turchinc turchinc commented Dec 15, 2025

Plugin Runtime Types — Collection Actions

Primary use case: export actions or similar for all items in a collection, supporting folders, requests and exposing read/write to provide export (and potentially import)

PR should solve or enable solutions for:

httpCollectionActions

Define custom actions that appear in folder/workspace context menus.

  • Field on PluginDefinition:

    • httpCollectionActions?: HttpCollectionActionPlugin[]
  • HttpCollectionActionPlugin shape:

    • label: string — displayed in context menu
    • icon?: Icon — optional icon for the action
    • onSelect(ctx: Context, args: CallHttpCollectionActionArgs) — called when user invokes the action
  • CallHttpCollectionActionArgs shape:

    • folder?: Folder — present when action was invoked on a folder
    • workspace?: Workspace — present when action was invoked on a workspace

Notes:

  • Actions appear in context menu for single folder/workspace selection
  • Plugin may operate on entire collection by using ctx.folder.list() and ctx.httpRequest.list()

New Context APIs

ctx.folder.list(args)

List all folders in a workspace.

args: {
  workspaceId?: string;
}

// Returns: Array<Folder>

ctx.file.writeText(filePath, content)

Write text content to a file.

writeText(filePath: string, content: string): Promise<void>

ctx.file.readText(filePath)

Read text content from a file.

readText(filePath: string): Promise<string>

ctx.httpRequest.list(args)

List all requests in a workspace or folder.

args: {
  workspaceId?: string;
  folderId?: string;
}

// Returns: Array<HttpRequest>

Notes:

  • Backwards compatible: all new fields are optional and do not affect existing plugins

@gschier gschier merged commit 75f92bd into mountain-loop:main Dec 28, 2025
Copy link
Member

@gschier gschier left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! I made some changes to have it better align with the codebase:

  • Removed file APIs (plugins can just use node:fs)
  • Separated workspace/folder actions
  • Added Websocket actions while we're in here
  • Some other tweaks.

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