Skip to content

Feature request: expose copy-and-archive as a plugin action so it can be bound to a key #36

Description

@ubuntudroid

copy-context copies all annotations but leaves them active. Archiving them is only reachable as the C key inside the manager pane, so the common "hand these to the agent, then clear the list" step takes prefix+mC and cannot be bound to a single Herdr key.

The logic is already action-shaped: copyAndArchiveAnnotations in src/archive-workflow.ts takes injected dependencies, and src/manager.ts is its only caller.

Proposal — a global action alongside copy-context:

[[actions]]
id = "copy-archive"
title = "Copy annotations as context and archive them"
description = "Copy all saved annotations to the clipboard as Markdown, then archive them."
contexts = ["global"]
command = ["bun", "src/export-archive.ts"]

src/export-archive.ts would mirror src/export.ts, passing the same dependencies manager.ts does (loadAnnotations, writeClipboard, appendArchivedSet, removeAnnotationsById, crypto.randomUUID, new Date().toISOString()) and reporting the three outcome tags through notify. Archived sets stay restorable in the manager, so nothing is lost.

Current workaround: a script outside the plugin tree that imports archive-workflow.ts and resolves the default state dir itself, bound to a type = "shell" key. It works, but it depends on the plugin's internal module layout and breaks on any refactor.

Plugin 0.3.0, Herdr 0.8.2, macOS. Happy to send a PR if you want it in this shape.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions