Skip to content

⏰feat(web-server): integrate plugin-manager with REST API for plugin lifecycle (stack 8/7)#89

Open
Rhythmarvin wants to merge 39 commits into
ora-space:mainfrom
Rhythmarvin:integration/all-prs
Open

⏰feat(web-server): integrate plugin-manager with REST API for plugin lifecycle (stack 8/7)#89
Rhythmarvin wants to merge 39 commits into
ora-space:mainfrom
Rhythmarvin:integration/all-prs

Conversation

@Rhythmarvin

Copy link
Copy Markdown
Contributor

Summary

Adds plugin management HTTP endpoints to ora_web_server, enabling full plugin lifecycle management via REST API: install, enable, invoke, and more.

New Files

  • apps/web/server/src/plugin_host.rsPluginHost: initializes PluginRuntimeHub + PluginManagementService at server startup with real Bun process spawning via Windows Job Object
  • apps/web/server/src/plugin_routes.rs — Plugin management REST API handlers
  • apps/web/server/src/lib.rs — Public exports for plugin_host module

Modified Files

  • apps/web/server/Cargo.toml — Added ora-plugin-manager, ora-plugin-protocol, ora-process dependencies
  • apps/web/server/src/main.rs — Starts PluginHost before binding HTTP listener
  • apps/web/server/src/error.rs — Added PluginBootstrap error variant

API Endpoints

Plugin Lifecycle

Method Path Description
POST /api/plugins/selections Register a plugin directory for review
POST /api/plugins/identify Identify plugin identity and mint install token
POST /api/plugins/install Install an authorized plugin candidate
GET /api/plugins List all installed plugins with status
POST /api/plugins/{id}/enable Enable a plugin
POST /api/plugins/{id}/disable Disable a plugin
DELETE /api/plugins/{id} Uninstall a plugin

Plugin Runtime

Method Path Description
POST /api/plugins/{id}/start Start plugin Bun process (handshake)
POST /api/plugins/{id}/stop Stop plugin process gracefully
POST /api/plugins/{id}/invoke Invoke an Agent method on a running plugin

Invoke Options

The /invoke endpoint accepts method field with one of:
discoverInstallations, getConfigurationSummary, listSkills, listMcpServers, listConversations, startConversation, sendMessage, cancelConversation

Additional fields: provider_id, installation_id, conversation_id, prompt, scope, limit, client_request_id

Verification

Tested end-to-end with real Bun subprocess on Windows:

  1. Plugin packed via @ora-space/plugin-sdk pack CLI
  2. Registered → identified → installed → enabled via HTTP API
  3. discoverInstallations, listSkills, getConfigurationSummary, startConversation, sendMessage all returned correct responses through real stdin/stdout pipe communication

wanglongan587 and others added 30 commits July 20, 2026 11:32
Establish validated plugin identifiers and strict manifest parsing.
Add the v1 Agent and Workbench package model for later wire contracts.

Co-authored-by: Cursor <cursoragent@cursor.com>
Define the bounded five-byte frame format and cover split, coalesced,
and malformed input behavior before adding JSON-RPC messages.

Co-authored-by: Cursor <cursoragent@cursor.com>
Introduce opaque IDs, page limits, and JSON-safe numeric leaf types so
lifecycle and Agent contract modules can share one validated value layer.
Add the closed Agent request/response/event shapes on top of leaf types so
lifecycle stream envelopes and method registry can reference one contract.
Add initialize/activate/deactivate/stream/exit DTOs and invariants so Host
and private bootstrap share one wire lifecycle contract.
Add request/response/error framing helpers on top of the binary frame codec
so Host and plugin runtimes share one JSON-RPC parse/reject matrix.
Register the closed Agent method set and invocation semantics so SDK and
runtime dispatch share one method catalog.
Close the protocol crate with cross-field Agent validators, TypeScript export
helpers, and checked-in Frame/Agent golden fixtures for drift detection.
Introduce the shared process abstraction and Tokio spawner so plugin runtime
can depend on a Host-owned process API before Windows Job Object support.
Add Job-bound spawn, named-pipe stdio, and tree terminate/reap so each
plugin generation can own a killable Windows process tree.
Introduce config, catalog, enablement, state, receipts, error taxonomy, and
management/runtime ports so later install and actor modules share one type layer.
Add no-follow path auditing, safe tree deletion, and deterministic package
tree digests used by install staging and integrity checks.
Add single-owner data-dir lease plus atomic state backup/recovery so manager
restarts can fail closed instead of silently accepting corrupt state.
Validate manifests and package layout, issue selection/candidate handles, and
build the provider registry used by later install and admission flows.
Stage authorized candidates behind digest revalidation, commit receipts, and
rebuild catalog snapshots from the installed package store.
Recover interrupted installs and removals from journals/trash so manager
bootstrap converges without leaving half-applied package state.
Expose scan/identify/install/enable/disable/uninstall use cases and wire
critical runtime events into crash-policy state updates.
Track write certainty and pending request state, and add framed reader/writer
lanes with backpressure for one plugin generation.
Assemble pinned Bun ProcessSpecs and adapt ProcessTreeSpawner output into
generation transport so plugin runtime can launch one contained process tree.
Perform Host-owned $/initialize and $/activate round-trips with post-activate
admission recheck, producing HandshakeProof for the generation actor.
Run admission, asset verification, process launch, and handshake as a
cancellable worker that reaps late spawns instead of leaking process trees.
Own one running generation's mailbox: invoke/stream/cancel, deadline and
fatal settlement, and deactivate/exit drain before tree reap.
Provide AgentPluginRuntime with single-flight start/invoke/stop so one plugin
owns at most one live generation while startup and session actors stay nested.
Route start/invoke/stop by plugin id through late-bound admission and event
ports, creating one lazy supervisor per plugin without construction cycles.
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
wanglongan587 and others added 9 commits July 20, 2026 11:44
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Add plugin host, management routes, and end-to-end plugin communication.

- plugin_host.rs: PluginHost that initializes PluginRuntimeHub +
  PluginManagementService at server startup
- plugin_routes.rs: REST API for plugin lifecycle
  (register/identify/install/enable/disable/uninstall/start/stop/invoke)
- lib.rs: public exports for plugin_host
- error.rs: PluginBootstrap error variant
- main.rs: start plugin host before binding HTTP listener
- Cargo.toml: add ora-plugin-manager/protocol/process deps

Verified: full E2E communication — Bun process spawn, handshake,
method dispatch, and response — all working through real pipes.
@Rhythmarvin Rhythmarvin changed the title feat(web-server): integrate plugin-manager with REST API for plugin lifecycle feat(web-server): integrate plugin-manager with REST API for plugin lifecycle (stack 8/7) Jul 20, 2026
@EricWvi EricWvi changed the title feat(web-server): integrate plugin-manager with REST API for plugin lifecycle (stack 8/7) ⏰feat(web-server): integrate plugin-manager with REST API for plugin lifecycle (stack 8/7) Jul 23, 2026
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