Index
Alphabetical index of public hc.* APIs. Each entry links to the full reference on its namespace page.
A
hc.actions.register(namespace, handlers)— Registers plugin actions in HarborClient's Action menu.hc.ai.copyToChat(input)— Opens the AI sidebar, ensures a chat exists, stores a snapshot, and queues the badge token in the composer.hc.ai.instructions.add(text)— Appends a static fragment to the agent system prompt while the returned disposable is active.hc.ai.onAfterTurn(handler)— Runs once when the turn finishes (completed, cancelled, or error).hc.ai.onBeforeTurn(handler)— Runs once when the user sends a chat message, before the first LLM completion step.hc.ai.registerChatPointer(config)— Default grammar (match / parse omitted) — tokens are @plugin.<pluginId>.<id>.<key> with an optional #start.end selection suffix: Custom grammar — supply both match (body after @, as a RegExp or source string) and parse.
C
hc.commands.execute(id, ...args)— Runs a registered command programmatically — for example to open a main view from another part of your plugin.hc.commands.register(id, handler)— Registers a command handler.
D
hc.database.all(sql, params?)— Returns all matching rows.hc.database.exec(sql)— Executes a multi-statement SQL script (typically migrations).hc.database.get(sql, params?)— Returns the first row, or undefined when no row matches.hc.database.run(sql, params?)— Runs an INSERT, UPDATE, or DELETE statement.hc.database.transaction(fn)— Runs fn inside an exclusive transaction.
F
hc.fs.pickDirectory(defaultPath?)— Opens a native directory picker.hc.fs.pickFile(options?)— Opens a native file picker.hc.fs.readFile(path)— Reads a UTF-8 text file from an allowlisted path.hc.fs.saveFile(content, options?)— Opens a native save dialog and writes content to the chosen path.hc.fs.writeBytes(path, bytes)— Writes binary bytes to an allowlisted path.hc.fs.writeFile(path, content)— Writes UTF-8 text to an allowlisted path.
H
hc.host.applyRequestDraft(payload)— Updates the active request editor tab in place.hc.host.createCollection(payload)— Bulk-creates a collection with folders and saved requests.hc.host.fetch(input, init?)— Sends one outbound HTTP request through the main-process pipeline using the native fetch(input, init?) signature.hc.host.loadRequest(requestId)— Opens a saved collection request or focuses an existing tab for it.hc.host.openImageView(payload)— Opens or focuses an image-view page tab.hc.host.openRequestDraft(payload)— Opens a new unsaved request tab seeded with request metadata.hc.host.send()— Sends the active request editor tab using the same pipeline as the Send button.hc.host.showEntityContextMenu(input)— Opens the same collection / folder / request context menu the built-in Collections tree would show — including plugin registerContextMenuItem contributions — positioned in the host window.hc.http.onAfterScripts(handler)— Register a callback that runs after each request stage's scripts complete.hc.http.onAfterSend(handler)— Register a callback that runs after the response is received.hc.http.onBeforeScripts(handler)— Register a callback that runs before each request stage's scripts.hc.http.onBeforeSend(handler)— Register a callback that runs before each outgoing HTTP request.
I
hc.imports.registerHandler(extensions, handler)— | Callback | Type | Description | | ----------- | --------------------------------------------------- | --------------------------------------------------- | | canImport | (file: ImportFile) => boolean | Promise<boolean> | Returns whether this handler should import the file | | import | (file: ImportFile) => void | Promise<void> | Performs the import workflow | ImportFile includes name, path, extension (dot-prefixed, lowercase), and UTF-8 contents.hc.ipc.handle(channel, handler)— Expose an RPC channel callable from the renderer half of the same plugin.hc.ipc.invoke(channel, ...args)— Invokes a handler registered with hc.ipc.handle in the main entry.
L
hc.livePage— Opens or reuses an embedded browser tab and returns a control handle (focus, close, DOM query/evaluate/inject, viewport screenshot).hc.livePages.create(input)— Persists a new saved live page and returns the created row.hc.livePages.delete(id)— Deletes a saved live page (moves it to trash).hc.livePages.get(idOrUuid)— Returns one saved live page by database id or uuid, or null when not found.hc.livePages.list()— Lists saved live pages from the local registry.hc.livePages.update(input)— Updates a saved live page.hc.liveServers.clearLogs(query)— Clears the in-memory request log buffer for a running instance.hc.liveServers.create(input)— Persists a new saved server and returns the created row.hc.liveServers.delete(id)— Deletes a saved server.hc.liveServers.get(idOrUuid)— Returns one saved server by database id or uuid, or null when not found.hc.liveServers.getLogs(query)— Returns trailing buffered Express access-log lines (default limit 100, max 1000).hc.liveServers.getStatus(query)— Returns the running instance for the query, or null when not running.hc.liveServers.list()— Lists saved live servers from the local registry.hc.liveServers.listRunning()— Lists currently running instances.hc.liveServers.onRequestLog(listener)— Subscribes to Express access-log lines from running live servers.hc.liveServers.onRunningChanged(listener)— Subscribes to start/stop list changes (including changes from the Harbor UI).hc.liveServers.start(input)— Starts from savedId (loads config from the registry when config is omitted) and/or an ad-hoc config.hc.liveServers.stop(query)— Stops one running instance by runtime id or saved id.hc.liveServers.update(input)— Updates a saved server.
M
hc.mcp.registerServer(config)— Discovered tools are prefixed with mcp in the chat agent tool list, using the same naming scheme as user-configured MCP client servers.
P
hc.pluginId— Type: string The plugin manifest id.
R
hc.react— Type: typeof React The same React instance HarborClient uses in the renderer.
S
hc.scripts— Creates a script sandbox that exposes the same hc object as collection and request pre/post scripts.hc.server.onRequest(handler)— Invoked for each incoming HTTP request.hc.server.start(options?)— Starts listening.hc.server.stop()— Stops the echo server owned by this plugin.hc.storage.get(key)— Returns the stored value, or undefined if the key has never been set.hc.storage.set(key, value)— Persists a JSON-serializable value.
T
hc.themes.getActive()— Returns the currently active theme — either a built-in id or a plugin theme reference.hc.themes.onDidChange(listener)— Fires when the user changes the appearance theme in Settings or when the host resets theme after plugin deactivation.hc.themes.register(theme)— Provide colors, metrics, a stylesheet, or a combination.
U
hc.ui.closeModal(modalId?)— Closes the open plugin modal overlay.hc.ui.openModal(modalId, context?)— Opens the registered modal overlay in the host application window.hc.ui.registerCollectionSettingsTab(tab)— Adds a segmented tab to Collection Settings (alongside General, Variables, Headers, and so on).hc.ui.registerContextMenuItem(item)— Adds an action to row context menus in the sidebar for collection, folder, and request targets.hc.ui.registerFooterPanel(panel)— Registers a slide-up footer panel using the same pattern as Console and Variables.hc.ui.registerLivePageChromeAction(action)— Adds a RoundButton to the embedded browser chrome bar between Downloads and Ask AI.hc.ui.registerMainView(view)— Registers a full main-area overlay, replacing the request editor while open (same pattern as Team Hubs or Sharing Keys).hc.ui.registerMenuItem(item)— Adds an item to the application menu.hc.ui.registerModal(modal)— Registers a modal rendered in a full-window overlay at the application root.hc.ui.registerRequestTab(tab)— Adds a segmented tab to the request editor (alongside Params, Headers, Body, and so on).hc.ui.registerRequestToolbarAction(action)— Adds a button to the request URL bar toolbar.hc.ui.registerResponseTab(tab)— Adds a tab to the response viewer (alongside Body, Headers, Tests).hc.ui.registerScriptEditorAction(action)— HarborClient uses request stage for the pre-request and post-request script lists (ScriptPhase: pre | post) and script stage for timing within a list (ScriptStage: before-all, before-each, main, after-each, after-all).hc.ui.registerSettingsSection(section)— Registers a React component as a Settings panel alongside built-in sections (General, Storage, and so on).hc.ui.registerSidebarPanel(panel)— Registers a switchable left sidebar destination — a full-height panel the user selects instead of the default collections view.hc.ui.registerSidebarRailItem(item)— Registers an activity-rail button.hc.ui.registerSidebarSection(section)— Adds a collapsible block inside the scrollable sidebar, using the same pattern as the built-in Collections and Environments sections.hc.ui.registerStatusBarItem(item)— Adds a custom status indicator to the footer bar.hc.ui.registerWorkflowActionBlock(block)— Renders a HostedSurface inside matching workflow timeline action blocks (below the built-in thumbnail).hc.ui.registerWorkflowToolbarAction(action)— Adds a button to the right of Save in the workflow play/edit toolbar.hc.ui.setFooterPanelIndicator(panelId, state)— Sets or clears the native status dot beside a footer panel toggle.hc.ui.showToast(message, options?)— Shows a non-blocking toast for success or info feedback.
