Repository navigation
Idea: third-party component packs #64
Closed
Replies: 2 comments 2 replies
|
1 reply
|
@merlin-the-ai Let's create issues for the V1 of this feature. Create a new discussion for any v1+ modifications on this feature. |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
Explore first-class support for third-party Agent Isles component packs: project-specific components, user-scoped local components, and components shared by other people via npm packages or git repositories.
The core idea:
Motivation
Agent Isles currently ships one built-in component bundle and a hardcoded sanitized-mode allowlist for core
<agent-*>islands. That works for the first vocabulary, but teams and users will eventually want reusable components outside the core package:This should extend Agent Isles without turning it into a broad dashboard framework or arbitrary renderer plugin host.
Proposed model
Pack sources
Support these sources over time:
isles.config.json.@acme/agent-isles-charts.Example project config:
{ "componentPacks": [ "./components/executive-pack", "@acme/agent-isles-charts", { "type": "git", "repo": "https://github.com/acme/report-components.git", "ref": "v0.3.1", "path": "packs/roadmap" } ] }Pack manifest
A pack should declare its assets and safe tags/attributes up front, rather than requiring Agent Isles to execute pack code to discover them.
Possible
agent-isles.pack.jsonshape:{ "$schema": "https://agent-isles.dev/schemas/pack.v1.json", "agentIslesPackVersion": 1, "name": "@acme/agent-isles-charts", "version": "0.2.0", "description": "Charts and KPI cards for Agent Isles reports", "homepage": "https://github.com/acme/agent-isles-charts", "tags": { "acme-kpi": { "description": "Compact KPI card", "attributes": { "label": { "type": "string", "required": true }, "value": { "type": "string", "required": true }, "unit": { "type": "string" }, "tone": { "type": "enum", "values": ["neutral", "good", "warning", "danger"] } } }, "acme-line-chart": { "description": "Small line chart", "attributes": { "label": { "type": "string" }, "data": { "type": "json" } } } }, "assets": [ { "type": "module", "path": "dist/acme-agent-isles-charts.js" }, { "type": "style", "path": "dist/acme-agent-isles-charts.css" } ] }In sanitized mode, Agent Isles can derive the allowed custom tags and attributes from the manifest, while still applying global safety rules.
Tag conflict policy
Custom element names are global in the page registry.
customElements.define()throws if the same name is registered twice, and silent first/last-wins behavior would make rendering ambiguous.Suggested policy:
<agent-*>tags are reserved unless a future explicit override mode is added.But Agent Isles should not rely on browser runtime errors as the conflict resolver.
Example failure:
User-scoped packs and reproducibility
User-scoped packs do not prevent the Markdown source from being reviewable in git. The reviewed artifact is still the source file.
The risk is narrower:
So user packs should be allowed, but their use should be visible and controllable:
--no-user-packs,isles packs resolve report.md.Example rendered metadata:
Git repo support
Shared packs should support repositories, not only npm packages.
Possible explicit syntax:
{ "type": "git", "repo": "https://github.com/acme/report-components.git", "ref": "v0.3.1", "path": "packs/roadmap" }Rules to consider:
npm install/ build scripts from an arbitrary repo during render.Users who want package-manager behavior can already install git dependencies through npm and reference the package by name.
Prior art / ecosystem patterns
Relevant patterns from other ecosystems:
<acme-kpi>.Possible implementation phases
Project-local pack MVP
--pack <path>.agent-isles.pack.json.Sanitizer extension and conflict detection
<agent-*>tags.Project and user config
isles.config.jsondiscovery.--no-user-packs.npm package packs
agentIsles.packfrompackage.jsonor root manifest.git repo packs
Diagnostics and authoring tools
isles packs resolve <file.md>.isles packs validate <pack>.Open questions
Suggested first slice
Start narrow:
That gives Agent Isles extensibility without turning the renderer into a general plugin host.
All reactions