Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.DS_Store
.env.local
node_modules/
*.log
.astro/
Expand Down
27 changes: 24 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,28 @@ The independent application marketplace at [community.eidos.space](https://commu

- This repository owns the website, its English and Chinese pages, and deployment.
- [eidos-space/registry](https://github.com/eidos-space/registry) owns catalog entries, schemas, and plugin submissions.
- Both development and production fetch the public GitHub registry at runtime.
- By default, development and production fetch the public GitHub registry at runtime.
Successful responses are cached for 10 minutes. Registry updates do not require
a website deployment. A first load requires network access; refresh failures
can use the last successful response available to the loader.
- Plugin README files and screenshots are read from their GitHub repositories.
Installation assets remain pinned to the releases and checksums in the registry.
- Localized format 3 documentation is read from the checksum-verified release
archive, selected as a whole document, and cached separately by package hash
and interface language. Missing translations show a fallback notice. Legacy
README files are read at the release tag. Screenshots remain repository assets.
- Optional registry `localization` metadata supplies translated names and
descriptions; the website uses the same exact/script/base/default matching
order as Plugin API 3.7. Permission summaries include background startup,
file-open metadata, network and Bluetooth declarations, separately from pages.

Submit or update a plugin in the
[registry repository](https://github.com/eidos-space/registry/blob/main/CONTRIBUTING.md).
Report website issues and contribute UI changes here.

The [official plugin template](https://github.com/eidos-space/eidos-plugin-template)
and [first-plugin tutorial](https://docs.eidos.space/plugins/guide/) are linked
from the developer footer and plugin resources. The template uses published
SDK/tools; newer APIs require matching host and authoring-tool versions.

## Development

```sh
Expand All @@ -27,6 +38,16 @@ pnpm typecheck
pnpm build
```

`pnpm deploy:preview` deploys a separate `eidos-plugin-marketplace-preview` Worker
on its workers.dev address. Its routes are empty, so it does not bind the
production `community.eidos.space` domain.

To preview unpublished registry changes, set `EIDOS_REGISTRY_PATH` to the absolute
path of your registry checkout's `plugins.registry.json` in `.env.local`, then
run `pnpm dev`. Development reads that file on every request so edits appear
after refreshing. An invalid local file produces a catalog error instead of
silently showing remote data. Production always uses the public GitHub registry.

## Deployment

```sh
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
"dev": "astro dev",
"build": "astro build",
"preview": "pnpm build && wrangler dev --local",
"test": "node --experimental-strip-types --test src/lib/plugin-registry.test.ts src/lib/plugin-details.test.ts tests/marketplace-contract.test.mjs",
"test": "node --experimental-strip-types --test src/lib/plugin-registry.test.ts src/lib/plugin-details.test.ts src/lib/plugin-localization.test.ts tests/marketplace-contract.test.mjs",
"typecheck": "astro check",
"deploy": "pnpm build && wrangler deploy"
"deploy": "pnpm build && wrangler deploy",
"deploy:preview": "pnpm build && wrangler deploy --config wrangler.jsonc --env preview"
},
"dependencies": {
"@astrojs/cloudflare": "12.6.0",
Expand Down
2 changes: 2 additions & 0 deletions src/components/Footer.astro
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ const groups = [
links: [
{ label: t.documentation, href: docsUrl("/"), external: true },
{ label: t.buildGuide, href: docsUrl("/developers/"), external: true },
{ label: t.pluginGuide, href: docsUrl("/plugins/guide/"), external: true },
{ label: t.pluginTemplate, href: "https://github.com/eidos-space/eidos-plugin-template", external: true },
{ label: t.fileSpec, href: "https://github.com/mayneyao/eidos/blob/dev/docs/specs/eidos-file-1.0.md", external: true },
{ label: "Runtime · npm", href: "https://www.npmjs.com/package/@eidos.space/eidos-file", external: true },
],
Expand Down
2 changes: 2 additions & 0 deletions src/components/MarketplacePage.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import type { Locale } from "../i18n";
import { messages, pluginCategoryMessages } from "../i18n";
import Layout from "../layouts/Layout.astro";
import { localizePlugin } from "../lib/plugin-localization";
import { loadMarketplaceRegistry } from "../lib/marketplace-registry";
import {
PLUGIN_REGISTRY_REPO,
Expand All @@ -25,6 +26,7 @@ Astro.response.headers.set(

try {
registry = await loadMarketplaceRegistry();
registry = { ...registry, plugins: registry.plugins.map((plugin) => localizePlugin(plugin, locale)) };
} catch (error) {
console.error("Could not load the Eidos plugin registry", error);
}
Expand Down
57 changes: 49 additions & 8 deletions src/components/PluginDetailPage.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import type { Locale } from "../i18n";
import { detailMessages, pluginCategoryMessages } from "../i18n";
import Layout from "../layouts/Layout.astro";
import { localizePlugin } from "../lib/plugin-localization";
import ScreenshotCarousel from "./ScreenshotCarousel.astro";
import { loadPluginDetails, type PluginContribution } from "../lib/plugin-details";
import { loadMarketplaceRegistry } from "../lib/marketplace-registry";
Expand All @@ -26,6 +27,7 @@ let plugin;
try {
const registry = await loadMarketplaceRegistry();
plugin = registry.plugins.find((entry) => entry.id === pluginId);
if (plugin) plugin = localizePlugin(plugin, locale);
} catch (error) {
console.error("Could not load the Eidos plugin registry", error);
}
Expand All @@ -42,7 +44,7 @@ const installUrl = plugin
: "";
const iconVariant = plugin ? pluginVisualVariant(plugin.id) : 1;
const contributions = manifest
? [...manifest.views, ...manifest.actions, ...manifest.formatters]
? [...manifest.views, ...manifest.actions, ...manifest.formatters, ...manifest.hooks]
: [];

const contributionType = (item: PluginContribution) => {
Expand Down Expand Up @@ -140,6 +142,7 @@ const backUrl = isTheme

<section class="detail-about" aria-labelledby="about-title">
<h2 id="about-title">{plugin.kind === "theme" ? t.aboutTheme : t.about}</h2>
{details?.readmeFallback && <p class="detail-unavailable">{t.documentationFallback.replace("{locale}", details.readmeLocale ?? t.defaultLanguage)}</p>}
{details?.readmeHtml ? (
<div class="plugin-readme" set:html={details.readmeHtml} />
) : (
Expand All @@ -157,7 +160,7 @@ const backUrl = isTheme
<div><dt>{t.version}</dt><dd>{plugin.version}</dd></div>
<div><dt>{t.apiVersion}</dt><dd>{manifest?.requiresPluginApi ?? manifest?.apiVersion ?? "1.0"}</dd></div>
<div><dt>{t.type}</dt><dd>{plugin.kind === "theme" ? t.theme : t.pluginType}</dd></div>
<div><dt>{t.compatibility}</dt><dd>{plugin.compatibility}</dd></div>
<div class="detail-property-prose"><dt>{t.compatibility}</dt><dd>{plugin.compatibility}</dd></div>
</dl>
</section>

Expand All @@ -168,6 +171,8 @@ const backUrl = isTheme
<div><dt>{t.views}</dt><dd>{manifest?.views.length ?? 0}</dd></div>
<div><dt>{t.actions}</dt><dd>{manifest?.actions.length ?? 0}</dd></div>
<div><dt>{t.formatters}</dt><dd>{manifest?.formatters.length ?? 0}</dd></div>
{!!manifest?.hooks.length && <div><dt>{t.hooks}</dt><dd>{manifest.hooks.length}</dd></div>}
{manifest?.background && <div><dt>{t.background}</dt><dd>1</dd></div>}
</dl>
{contributions.length > 0 && (
<ul class="capability-list">
Expand All @@ -182,27 +187,63 @@ const backUrl = isTheme
</section>
)}

<section class="detail-panel">
<section class="detail-panel detail-panel-prose">
<h2>{t.security}</h2>
<dl>
<div><dt>{t.execution}</dt><dd>{plugin.kind === "theme" ? t.themeStyles : t.sandbox}</dd></div>
<div><dt>{t.execution}</dt><dd>{plugin.kind === "theme" ? t.themeStyles : manifest?.background ? t.backgroundSandbox : t.sandbox}</dd></div>
<div>
<dt>{t.network}</dt>
<dt>{manifest?.background ? t.pageNetwork : t.network}</dt>
<dd>
{manifest?.networkOrigins.length
? manifest.networkOrigins.join(", ")
: t.offline}
{!manifest ? t.networkUnknown : (
manifest.publicNetwork || manifest.networkOrigins.length || manifest.connections.length ? (
<ul class="network-access-list">
{manifest.publicNetwork && !manifest.networkOrigins.length && <li>{t.publicPageNetwork}</li>}
{manifest.networkOrigins.map((origin) => <li>{origin}</li>)}
{manifest.connections.map((connection) => {
const origin = new URL(connection.url).origin;
const addressParts = [origin, ...connection.url.slice(origin.length).split(/(?<=\/)/u)];
return (
<li>
<div class="network-connection-heading">
<strong>{connection.title}</strong>
<span>{t.apiConnection}</span>
</div>
<span class="network-endpoint">
{addressParts.map((part) => <Fragment>{part}<wbr /></Fragment>)}
</span>
{connection.configurable && <small>{t.configurableEndpoint}</small>}
</li>
);
})}
</ul>
) : t.offline
)}
</dd>
</div>
{manifest?.workers && <div><dt>Worker</dt><dd>{t.worker}</dd></div>}
<div><dt>{t.verification}</dt><dd>{t.checksum}</dd></div>
</dl>
</section>

{manifest?.background && (
<section class="detail-panel detail-panel-prose">
<h2>{t.background}</h2>
<p>{t.backgroundLifetime}</p>
<dl>
<div><dt>{t.startup}</dt><dd>{manifest.background.autoStart ? t.autoStart : t.explicitStart}</dd></div>
<div><dt>{t.fileEvents}</dt><dd>{manifest.background.fileHistory ? t.fileMetadata : t.notRequested}</dd></div>
<div><dt>{t.backgroundNetwork}</dt><dd>{manifest.background.network ? manifest.background.networkOrigins.join(", ") || t.publicNetwork : t.offline}</dd></div>
<div><dt>{t.bluetooth}</dt><dd>{manifest.background.bluetooth ? manifest.background.services.join(", ") || t.selectedDevice : t.notRequested}</dd></div>
</dl>
</section>
)}

<section class="detail-panel detail-resources">
<h2>{t.resources}</h2>
<a href={repoUrl}>{t.source}<span aria-hidden="true">↗</span></a>
<a href={releaseUrl}>{t.release}<span aria-hidden="true">↗</span></a>
<a href="https://github.com/eidos-space/eidos-plugin-template">{t.pluginTemplate}<span aria-hidden="true">↗</span></a>
<a href={`https://docs.eidos.space${locale === "zh" ? "/zh-cn" : ""}/plugins/guide/`}>{t.pluginGuide}<span aria-hidden="true">↗</span></a>
</section>
</aside>
</div>
Expand Down
56 changes: 54 additions & 2 deletions src/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ interface FooterMessages {
changelog: string;
documentation: string;
buildGuide: string;
pluginGuide: string;
pluginTemplate: string;
fileSpec: string;
versionControl: string;
support: string;
Expand All @@ -169,6 +171,8 @@ export const footerMessages: Record<Locale, FooterMessages> = {
changelog: "Changelog",
documentation: "Documentation",
buildGuide: "Build guide",
pluginGuide: "Create a plugin",
pluginTemplate: "Plugin template",
fileSpec: "Eidos File spec",
versionControl: "Version Control",
support: "Support",
Expand All @@ -192,6 +196,8 @@ export const footerMessages: Record<Locale, FooterMessages> = {
changelog: "更新日志",
documentation: "文档",
buildGuide: "构建指南",
pluginGuide: "创建插件",
pluginTemplate: "插件模板",
fileSpec: "Eidos File 规范",
versionControl: "版本控制",
support: "支持",
Expand Down Expand Up @@ -228,6 +234,26 @@ export const pluginCategoryMessages = {

export const detailMessages = {
en: {
hooks: "File hooks",
background: "Background service",
backgroundSandbox: "Isolated iframe and QuickJS background sandbox",
backgroundLifetime: "Continues after its page closes, until stopped, disabled, updated, or this Space closes.",
startup: "Startup",
autoStart: "Automatically when this Space opens, after approval",
explicitStart: "Started by a plugin page or command, after approval",
fileEvents: "File-open events",
fileMetadata: "Paths and opening times in this Space; no file contents",
notRequested: "Not requested",
backgroundNetwork: "Background network access",
pageNetwork: "Page network access",
publicNetwork: "All public HTTPS/WSS services",
publicPageNetwork: "All public HTTPS services",
bluetooth: "Bluetooth",
selectedDevice: "User-selected device",
documentationFallback: "Documentation is unavailable in your language. Showing {locale}.",
defaultLanguage: "the default document",
pluginTemplate: "Plugin template",
pluginGuide: "Create a plugin",
back: "All plugins",
backThemes: "All themes",
marketplace: "Marketplace",
Expand All @@ -253,7 +279,10 @@ export const detailMessages = {
sandbox: "Isolated iframe sandbox (null origin)",
themeStyles: "Validated local styles; no executable code",
network: "Network access",
offline: "No external network access (100% offline)",
offline: "No network access declared",
networkUnknown: "Network permissions unavailable",
apiConnection: "API connection",
configurableEndpoint: "Endpoint can be changed in connection settings",
worker: "Dedicated worker support",
verification: "Package verification",
checksum: "SHA-256 verified by Eidos Lite before installation",
Expand All @@ -273,6 +302,26 @@ export const detailMessages = {
},
zh: {
back: "全部插件",
hooks: "文件 hook",
background: "后台服务",
backgroundSandbox: "独立 iframe 沙箱与 QuickJS 后台沙箱",
backgroundLifetime: "关闭插件页面后继续运行,直到停止、禁用、更新插件或关闭此 Space。",
startup: "启动方式",
autoStart: "授权后,在打开此 Space 时自动启动",
explicitStart: "授权后,由插件页面或命令启动",
fileEvents: "文件打开事件",
fileMetadata: "此 Space 内的文件路径与打开时间,不含文件内容",
notRequested: "未申请",
backgroundNetwork: "后台网络访问",
pageNetwork: "页面网络访问",
publicNetwork: "所有公共 HTTPS/WSS 服务",
publicPageNetwork: "所有公共 HTTPS 服务",
bluetooth: "蓝牙",
selectedDevice: "用户选择的设备",
documentationFallback: "此说明暂未提供当前语言版本,正在显示{locale}。",
defaultLanguage: "默认文档",
pluginTemplate: "插件模板",
pluginGuide: "创建插件",
backThemes: "全部主题",
marketplace: "插件市场",
themesMarketplace: "外观主题",
Expand All @@ -297,7 +346,10 @@ export const detailMessages = {
sandbox: "隔离的 iframe 沙箱(null origin)",
themeStyles: "经校验的本地样式,不执行代码",
network: "网络访问",
offline: "不访问外部网络(完全离线)",
offline: "未声明网络访问",
networkUnknown: "暂时无法读取网络权限",
apiConnection: "API 连接",
configurableEndpoint: "可在连接设置中更改服务地址",
worker: "支持独立 Worker",
verification: "安装包验证",
checksum: "Eidos Lite 安装前校验 SHA-256",
Expand Down
11 changes: 10 additions & 1 deletion src/lib/marketplace-registry.ts
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
export { loadPluginRegistry as loadMarketplaceRegistry } from "./plugin-registry";
import { loadPluginRegistry, parsePluginRegistry, type PluginRegistry } from "./plugin-registry";

export async function loadMarketplaceRegistry(): Promise<PluginRegistry> {
// Local registry previews are opt-in and never used by the production Worker.
if (import.meta.env.DEV && import.meta.env.EIDOS_REGISTRY_PATH) {
const { readFile } = await import("node:fs/promises");
return parsePluginRegistry(JSON.parse(await readFile(import.meta.env.EIDOS_REGISTRY_PATH, "utf8")));
}
return loadPluginRegistry();
}
22 changes: 22 additions & 0 deletions src/lib/plugin-details.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,28 @@ test("ignores a manifest whose package identity does not match the registry", ()
assert.equal(parsePluginManifest({ id: "wrong", version: "0.1.0" }, plugin), undefined);
});

test("includes host API requests even when the browser has no network origins", () => {
const manifest = parsePluginManifest({
id: plugin.id,
version: plugin.version,
connections: {
ai: { title: "AI provider", url: "https://api.openai.com/v1/chat/completions", configurable: true },
fixed: { title: "Fixed API", url: "https://api.example.com/v1/request" },
invalid: { url: "javascript:alert(1)" },
credentials: { url: "https://user:secret@example.com" },
},
}, plugin);
assert.deepEqual(manifest?.networkOrigins, []);
assert.deepEqual(manifest?.connections, [
{ id: "ai", title: "AI provider", url: "https://api.openai.com/v1/chat/completions", configurable: true },
{ id: "fixed", title: "Fixed API", url: "https://api.example.com/v1/request", configurable: false },
]);
});

test("plugins without API connections keep an empty declaration", () => {
assert.deepEqual(parsePluginManifest({ id: plugin.id, version: plugin.version }, plugin)?.connections, []);
});

test("shows a theme's minimum plugin API rather than the manifest format version", () => {
const manifest = parsePluginManifest(
{
Expand Down
Loading
Loading