sync: plugin UI, desktop bridge, and chat launchers - #117
Merged
Conversation
Plugin UI contributions - Plugins now declare their whole front end in plugin.json under `extensions["org.hugagent"].ui`. The host renders from the declaration, so no host code branches on a plugin or tool name any more: disabling or uninstalling a plugin makes its UI disappear on the next refresh. - New shared view library under `src/frontend/src/plugin-ui/`: 19 views in three groups (document, analytic, container/interactive), one file per view behind a single `registry.ts` extension point. Charts are hand-drawn SVG primitives on purpose — pulling in a chart library would let the contract decay into chart-library DSL passthrough. - Field mapping uses a whitelisted pointer evaluator, never expressions: declarations are data, not code. Own-property reads only, so prototype members such as `constructor` are unreachable. - Contribution parsing is fail-soft per entry: one malformed contribution is dropped and reported instead of blocking the install, and a `ui.version` above what the host supports is ignored as a whole. - Two generic endpoints back it: a server-side data proxy (credentials are interpolated on the server, the browser only ever sees a source id, and SSRF policy allows hosts an administrator already configured while requiring public HTTPS otherwise) and a static asset route for plugin-supplied front-end modules (CSP `connect-src 'none'`, path traversal rejected). - Plugin-supplied modules run in an iframe sandboxed with `allow-scripts` and without `allow-same-origin`; the postMessage bridge authenticates on `event.source` rather than `event.origin`, which is always "null" there. Desktop capability bridge - Bridge injection moved down into the catalog resolver, the single source of truth for resolving enabled capabilities, so scheduled jobs, batch sub-agents, job wake-ups and plan mode all take the same assembly path. - Cloud gateway configuration is now an explicit `bridge_servers` argument with a written-down override order (global < bridge < owned). - Per-user effective configuration is cached for 30s so the gateway no longer re-queries owned servers on every tool call, and the gateway route no longer holds a database connection while streaming. Fixes and hardening - Back-fill UI contributions for already-installed built-in plugins at startup, so upgrades do not leave the column NULL and the declared views missing. - Hot-path work: batched contribution resolution (1+N queries down to 2), per-slug authorization instead of enumerating every installed plugin, a shared HTTP connection pool in the data proxy, and memoized front-end registry lookups so streaming no longer re-renders the whole view subtree. - Register the three plugin-ui strings in the shared dictionary: the views that use them are shared code, so an edition-only dictionary left them untranslated here. - Cross-language test pinning that the view kinds accepted by the backend and registered in the front end cannot drift apart.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Community edition sync from the development tree.
Plugin-declared UI contributions
A plugin can now describe its entire front end in
plugin.json, under theextensions["org.hugagent"].uinamespace, and the host renders straight fromthat declaration. The host render path no longer branches on any plugin or
tool name, so disabling or uninstalling a plugin removes its interface on the
next refresh with no host change.
src/frontend/src/plugin-ui/ships 19 views in threegroups (document, analytic, container/interactive), one file per view behind
a single
registry.tsextension point, with a README on adding more.whitelisted pointer evaluator that rejects subscripts, expressions and
statement injection, and reads own properties only.
reported in the import result instead of blocking the install; a
ui.versionnewer than the host supports is ignored as a whole.
only ever holds a source id. Hosts configured by an administrator are
allowed, while all other upstreams must use public HTTPS.
connect-src 'none'and path traversal rejected, rendered in an iframesandboxed as
allow-scriptswithoutallow-same-origin.Desktop capability bridge
Bridge injection moved into the catalog resolver, the single source of truth
for resolving enabled capabilities, so scheduled jobs, batch sub-agents, job
wake-ups and plan mode all use the same assembly path. Cloud gateway
configuration became an explicit
bridge_serversargument with a documentedoverride order. Per-user effective configuration is cached for 30 seconds, and
the gateway route no longer holds a database connection while forwarding a
stream.
Chat launchers
@now opens a structured launcher for available files, agents, plan,batch, workflow, and loop actions, with direct agent filtering in the second
level.
/groups modes, plugins, and skills and shows descriptions to makecommand discovery easier.
and entering the agent picker clears the launcher query without removing the
mention marker.
keyboard controls.
Fixes and hardening
plugins, so an upgrade does not leave the declared views missing.
data proxy uses a shared HTTP connection pool, and registry lookups are
memoized.
Checks
scripts/build_ce.pyran on the final clean commit with import, release, andfront-end self-checks enabled. All gates passed: brand gate (0 text hits and a
full path scan), required-runtime-file gate, forbidden-artifact gate, binary
asset allowlist, LICENSE gate, backend import/OpenAPI/ORM checks, CE release
regression tests, and the front-end i18n, dark-mode, TypeScript, and Vite build
checks.