feature(customware): add customware bundle interface#44
Open
Magaav wants to merge 1 commit intoagent0ai:mainfrom
Open
feature(customware): add customware bundle interface#44Magaav wants to merge 1 commit intoagent0ai:mainfrom
Magaav wants to merge 1 commit intoagent0ai:mainfrom
Conversation
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.
Summary
This PR adds a small Customware Bundle Interface on top of Space Agent's existing customware/module system.
Bundles are ordinary installed
L1orL2modules that include a rootspace.bundle.yamlmanifest. The manifest lets downstream teams describe reusable customizations without monkey-patching core runtime files.The implementation keeps the mechanics native to Space Agent:
L1/<group>/mod/<author>/<repo>/andL2/<user>/mod/<author>/<repo>/ext/htmlext/jsandspace.extend(...)ext/skillsHermes is the motivating downstream use case, but this PR intentionally keeps all Hermes-specific code out of Space Agent core.
Motivation
Space Agent's customware model is already a strong base for downstream extension: modules, layered
L1/L2roots,/mod/...delivery,ext/html,ext/js,space.extend(...), andext/skills.What is missing is a small, explicit package contract that lets a downstream team say:
Without that contract, downstream integrations tend to drift toward fragile runtime injection or private-file patches. Those are hard to rebase when Space Agent moves quickly, and they make useful third-party work harder to upstream.
This PR turns those patches into documented seams.
Before
Downstream teams that wanted a reusable customization usually had to manage loose module files and out-of-band knowledge:
L1orL2ext/htmlorext/jsfiles it contributesThat works locally, but it is brittle across core updates.
After
A customization can be shipped as a normal customware module with one manifest:
Example:
The bundle is visible through module/bundle listing APIs, and browser code can register removable actions:
When the owning view unmounts, it can call
dispose(). Removing the module removes the manifest, extension files, skills, and action registrations after reload or unmount.Implementation
This PR adds:
server/lib/customware/bundles.jsspace.bundle.yamlserver/lib/customware/module_manage.jslistInstalledBundles(...)readBundleInfo(...)server/api/bundle_list.jsserver/api/bundle_info.jsapp/L0/_all/mod/_core/framework/js/bundles.jsspace.bundleslist(...)andinfo(...)space.bundles.actionsfor removable action handlersspace.bundles.bridgefor external bridge-state syncapp/L0/_all/mod/_core/framework/js/extensions.js_core/framework/theme/end_core/framework/head/enddocument.headbefore extension scanningapp/L0/_all/mod/_core/framework/js/api-client.jsspace.api.bundleList(...)space.api.bundleInfo(...)app/space-runtime.d.tsdocs and skills
tests
tests/customware_bundle_test.mjstests/fixtures/customware_bundle_example/What This Does Not Do
This PR does not add a separate plugin loader.
It does not allow arbitrary runtime patching.
It does not add Hermes-specific code to Space Agent.
It does not replace
ext/html,ext/js,space.extend(...), orext/skills. It gives those existing seams a package-level manifest and a small browser action/bridge registry.Why This Fits Space Agent
This follows the existing architecture instead of introducing a foreign plugin system:
The bundle interface should help any downstream team package reusable customizations while preserving Space Agent's current module model.
Test Plan
Ran:
Coverage includes:
Review Notes
The main thing to review is the public shape:
space.bundles.actionscontractspace.bundles.bridgecontract_core/framework/theme/endis the right stable seam name for theme/background customizationI kept this intentionally modest so it can be refined without locking Space Agent into a large plugin framework.