avelino/dotagent

Implement `dotagent plugin invoke` (currently a stub)

オープン

#4 opened on 2026/05/20

 (0 件のコメント) (0 件のリアクション) (0 人の担当者)Rust (1 件のフォーク)github user discovery
area: cliarea: pluginsgood first issuetype: feature

Repository metrics

Stars
 (3 個のスター)
PR merge metrics
 (30d に merged PR はありません)

説明

Plugins in dotagent are subprocesses that speak JSON over stdio (info, validate, invoke — see docs/reference/plugin-protocol.md). The daemon invokes them automatically, but when something goes wrong (silent failure, wrong output shape, unexpected exit code), the only debugging paths are:

  • Run the plugin binary by hand and pipe JSON into stdin (works but tedious to construct payloads).
  • Read the daemon logs after the fact, often without enough context.

dotagent plugin invoke <name> <payload> is declared in the CLI as the interactive debug path, but the implementation is a stub returning Err("plugin invoke <name> — not yet implemented"). Plugin development is meaningfully harder than it needs to be because of this.

Proposal

Make dotagent plugin invoke mirror what the daemon does, but interactively:

  • Resolve the plugin binary the same way PluginClient does (PATH + plugin dir search).
  • Accept <payload> as either a JSON literal or - (read from stdin).
  • Pretty-print the plugin's response (status, output, suggested action).
  • Honor the same env contract the daemon passes (AGENT_NAME, AGENT_HOME, etc.) — likely via --agent <name> / --schedule <id> flags that pull from a real manifest if available, or fall back to placeholders.

Acceptance criteria

  • dotagent plugin invoke sink-file '{"event":"success","stdout":"hi"}' runs the plugin and prints its response.
  • echo '{...}' | dotagent plugin invoke sink-file - works.
  • When the plugin is not found, the error message points at the search path that was tried.
  • Output uses the same human/JSON renderer convention defined in CLAUDE.md (no raw Debug dumps).
  • docs/concepts/plugins.md gains a "Debugging a plugin" section.

Where to start

  • crates/dotagent/src/commands/mod.rs::plugin_invoke — current stub.
  • crates/dotagent-plugin/src/lib.rsPluginClient, the existing invocation flow.
  • docs/reference/plugin-protocol.md — JSON shape of each verb.

Non-goals

  • Replacing the daemon's plugin lifecycle. This is a one-shot debug command.
  • A REPL or interactive prompt. Single invocation, single response.

コントリビューターガイド