ReMe/docs/en/plugin_management.md
jinliyl 3db84c735f
feat(agent)!: add file-native proactive runtimes and ReMe Desktop (#743)
* feat(agent): unify persistent sessions and native fork settings

* fix(agent): preserve continuation and rejected session settings

* feat(event_stream): add bounded durable event streams

* fix(agent): preserve session guards and execution policies

* Revert "fix(agent): preserve session guards and execution policies"

This reverts commit 02188565dc.

* refactor(agent)!: unify file-native proactive runtimes

Coordinate named cron and event agents through an application-owned runtime,
with per-agent memory, native session registries and Markdown reminders.
Initialize Chat and task memories once under reme_agents and remove the old
PA delivery APIs and duplicated session state.

Serialize temporary query ownership with collection, recover incomplete
session-registry appends, and migrate benchmark plugins to public file helpers.
Split model providers into registered modules without changing their behavior.

* feat(proactive): add speech and scheduled observation collectors

Add DashScope ASR/TTS components, restart-safe finance collectors and
five-minute screenshot/Codex dialogue observations with bilingual docs.

Use response receipt time for stock freshness and recover interrupted
work-observation cleanup without replaying committed dialogue.

* refactor(core)!: unify execution cleanup and remove legacy contracts

Track queued Agent operations through shutdown and deletion, keep retry
backoff bounded, and reuse the local process runner for Shell steps.
Reject BASE registrations and remove duplicate config/path helpers.

BREAKING CHANGE: plugin discovery requires package-only entry points
and plugin.yaml; FileLink.predicate and the dream.ProactiveResult alias
are removed. Rebuild old derived graph indexes from workspace notes.

* feat(agent)!: add desktop workspace and isolated inbox delivery

* chore(desktop): remove one-click restart launcher

* fix(agent): guard session content and persist incremental display history

* test(home): verify host network isolation across platforms

* refactor(agent)!: unify durable inbox components

* docs: illustrate personal and proactive agent runtimes

* Refactor agent streaming and durable reminder delivery

Project formal turns through one ordered transcript, with live snapshots until native history catches up. Render localized activity groups, stable Markdown blocks and paged conversation history.

Bound proactive batches and preserve retries, persist reminder links before delivery, and synchronize explicit user-read receipts across sessions. Remove the obsolete desktop receipt format.

* Align desktop streaming activity with Codex

Keep assistant progress in the conversation and fold reasoning into activity details. Normalize native command actions into file, directory, search and command summaries with localized disclosure and explicit completion.

Match user bubbles and activity styling while preserving streaming anchors, links and expansion state.

* docs: explain proactive agents and personal runtime

* Align proactive runtime settings and documentation

* Unify agent runtime APIs and resource collection

* Deduplicate proactive observations and respect market sessions

* Refine proactive sessions and screenshot filtering

* Add desktop background transparency and tab transitions

* Tighten observation validation and task prompts

* Align streaming tool display with canonical item snapshots

* Unify Agent identity, task memory, and session workflows

Use agent_name and agent_type across the runtime, APIs, collectors and Desktop.
Initialize task_memory into MEMORY.md and return memory paths for native edits.
Keep task questions in read-only forks and automatic runs in validated file stages.
Document current behavior and cover default conversation rendering and SDK forks.

* Unify active sessions and task files; remove prompt wording tests

* Refine proactive jobs and fix coverage reporting

* Remove unused desktop artifacts and protocol probe

* Simplify proactive runs and commit validated artifacts after model failures

* Allow daily summaries for new records without reminders

* refactor(proactive): improve proactive and cron agent prompts and workflow steps

- Update cron agent description to emphasize recording what happened and reporting results
- Change sleep reminder rule to be specifically tagged for proactive agent
- Rename query fields to proactive_query for clarity
- Streamline and clarify proactive agent workflow steps in English and Chinese versions
- Enhance task analysis and reminder decision logic with clearer instructions
- Revise today's summary update format and examples with time stamps and consistent headings
- Provide separate detailed steps for cron agent execution and reporting
- Ensure reminder generation logic is more precise and avoid assumptions about user knowledge

* Add notebook and task management with resilient agent cleanup

* Improve search accounting and desktop conversation controls

* Guard conversation reset against endpoint changes

* refactor(proactive): simplify session options and improve markdown link warnings

- Remove unused failure status detection and associated UI styling in activity component
- Simplify session_options method by removing unnecessary parameters and excessive prompt formatting
- Enhance _query method to handle task content and event inputs conditionally based on agent type
- Add static method to extract and decode markdown links ignoring code blocks
- Introduce _warn_local_links to log warnings on broken local links without failing artifact validation
- Integrate local link warnings into artifact reading flow for proactive and cron agents
- Modify tests to reflect session_options signature changes and verify local link warning behavior
- Ensure TASK.md is non-empty before task execution, enforcing content validation
- Refactor CSS to remove deprecated broken activity state styles
- Improve test coverage with parameterized tests for broken local link warnings under various scenarios

* fix(agent): preserve user edits and recover durable commits

* fix(agent): guard outbox writes and defer full inbox delivery

* fix(agent): preserve reminder eligibility and serialize lifecycle transitions

* Simplify proactive task storage and desktop protocol

* Make proactive timeline limits configurable

* test(proactive): remove prompt checks and redundant cases

* Unify proactive task APIs and documentation

* fix(proactive): preserve incomplete triggers and skip oversized reminders

* fix(proactive): preserve queued trigger types across task updates

* docs(proactive): improve instructions for recording scheduled task results

- Clarify steps to follow after completing the scheduled task work
- Specify writing `action: write` in frontmatter when overwriting the record file
- Simplify description of what to include in the record body
- Emphasize using only necessary tools for the task and writing the record
- Align English and Chinese instructions for consistency

* fix(proactive): keep scheduled time and bypass event cooldown for cron
2026-11-19 21:37:25 +08:00

7.3 KiB

Plugin Management

ReMe plugins are ordinary Python distributions discovered through the reme.plugins entry-point group. Installing a plugin makes it available to the current Python environment; it does not enable the plugin in every ReMe application.

Keep these two operations separate:

reme plugins install ...        install a package into the current Python environment
plugins: [auto-fin]             enable an installed plugin for one Application

Plugin package management is local-only. It does not run through a ReMe HTTP or MCP service and never edits application configuration files automatically.

A typical plugin workflow has three stages:

  1. Install ReMe and the plugin distribution.
  2. Configure the plugin's runtime environment as described in the ReMe model-configuration guide.
  3. Start an Application with the plugin explicitly enabled, for example reme start plugins='["auto-fin"]'.

List installed plugins

reme plugins list

The table shows the plugin entry-point name, Python distribution, version, and plugin contract:

PLUGIN    DISTRIBUTION   VERSION  FORMAT
--------  -------------  -------  --------
auto-fin  reme-auto-fin  X.Y.Z    manifest

manifest plugins use a package-only entry point and a package-level plugin.yaml. unsupported identifies entry points that do not meet this contract.

A manifest separates backend registration from application configuration:

backends:
  example_step: example_plugin.steps:ExampleStep

application_defaults:
  jobs:
    example:
      backend: base
      steps:
        - backend: example_step

application_defaults is a partial ApplicationConfig. It is kept below the manifest's backends namespace because backend import declarations are part of plugin discovery and are not application configuration.

Use JSON when another local tool needs structured output:

reme plugins list --json

To compare installed plugins with one application config:

reme plugins list --config default

The optional ENABLED column reflects only the plugins list resolved from that config. A command-line override used by another running process is not a global enable state.

Install a plugin package

Install a published distribution by its package name:

reme plugins install your-plugin-package

Install or upgrade a pinned version:

reme plugins install 'your-plugin-package==X.Y.Z'
reme plugins install your-plugin-package --upgrade

Install a local plugin project:

reme plugins install ./plugins/auto-fin

Use editable mode while developing it:

reme plugins install ./plugins/auto-fin --editable

ReMe invokes pip through the same Python interpreter that runs the reme command. Pip remains responsible for package resolution, downloads, dependency changes, and build execution. Install only packages and local projects you trust.

After installation, confirm the discovered plugin name:

reme plugins list
reme plugins validate auto-fin

Inspect a plugin

reme plugins show auto-fin

For a manifest plugin, the result includes its registered backend names and default Job names. JSON output is also available:

reme plugins show auto-fin --json

show identifies the package contract without constructing a ReMe Application.

Validate a plugin

Validate an installed plugin:

reme plugins validate auto-fin

Validate a local project before installation:

reme plugins validate ./plugins/auto-fin

Validation checks the entry point, plugin.yaml, backend imports and component types, registry collisions, merged application_defaults, and the resulting ApplicationConfig. Validation imports plugin backend modules, so run it only for trusted code.

Enable a plugin in a service

Installation alone does not load plugin code into an Application. Enable plugins explicitly in configuration:

plugins:
  - auto-fin

Or add them for one service launch:

reme start plugins='["auto-fin"]'

When config is omitted, ReMe loads default.yaml. The plugin's application_defaults are merged below that config, so explicit config values and CLI overrides win. This mapping is an ApplicationConfig fragment, not a separate configuration schema. The plugin backends are registered only in that Application's local registry.

After the default HTTP service starts, access plugin Jobs from another terminal through ReMe's CLI client or HTTP:

reme auto_fin topics="黄金,AI,存储芯片"
curl -s http://127.0.0.1:2333/auto_fin \
  -H 'Content-Type: application/json' \
  -d '{"topics":"黄金,AI,存储芯片"}'

When the application uses an MCP service, service-enabled plugin Jobs appear as MCP tools instead.

Custom application configs must provide the plugin's runtime dependencies, including an agent_wrapper.default, a file_store.default with an enabled tag index, and the search, read, list_tags, frontmatter_read, and frontmatter_update Jobs used by Auto Fin and automatic tagging.

Benchmark application presets

The LME and BEAM plugins register their backends and plugin-owned Jobs in plugin.yaml. ReMe's built-in benchmark preset provides the shared core Jobs and components without inheriting default, so default background and cron jobs are not included. Install the selected benchmark plugin, then use config=benchmark together with plugins=["lme"] or plugins=["beam"]. The repository's benchmark runners enable the corresponding installed plugin automatically; editable installation keeps local plugin changes visible. Dataset runners remain under benchmark/.

Uninstall a plugin

Use the plugin entry-point name, not necessarily the distribution name:

reme plugins uninstall auto-fin

Skip pip's confirmation prompt when needed:

reme plugins uninstall auto-fin --yes

ReMe resolves auto-fin to the distribution that provides it, such as reme-auto-fin. If one distribution provides multiple plugin entry points, the command lists the other plugins that will also be removed.

Uninstallation does not rewrite user configuration. Remove the plugin from relevant plugins lists yourself; otherwise the next Application startup fails explicitly because the configured plugin is no longer installed. Restart already-running ReMe processes after installing, upgrading, or uninstalling packages.

Troubleshooting

Plugin is installed but unavailable

Check that the reme command and pip package share one Python interpreter:

reme plugins list
python -c 'import sys; print(sys.executable)'

Using reme plugins install avoids the most common interpreter mismatch because it runs python -m pip with ReMe's own interpreter.

Plugin is installed but not loaded

Add its entry-point name to the Application's plugins list. ReMe intentionally has no global enable/disable state.

Startup reports that the plugin is not installed

The active config still enables a missing plugin. Reinstall it or remove the corresponding name from plugins.

Changes are not visible in a running service

Plugin discovery and backend registration happen during Application construction. Restart the service after changing installed packages.