From 95e2015f3bbca7bace8311b0ddf743367382b9b1 Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Mon, 2 Nov 2026 10:22:50 +0000 Subject: [PATCH] docs(chord): single-file plugins --- packages/chord/docs/next/decisions.md | 7 +++++++ packages/chord/docs/next/slices.md | 2 ++ 2 files changed, 9 insertions(+) diff --git a/packages/chord/docs/next/decisions.md b/packages/chord/docs/next/decisions.md index 594900030..b972b1044 100644 --- a/packages/chord/docs/next/decisions.md +++ b/packages/chord/docs/next/decisions.md @@ -2205,6 +2205,13 @@ validation and copies the v2 kernel added around Delta. enabled by the app per host kind, never by a plugin (a stranger's web plugin must not run code on the server). To do: a skill and documentation for agents describing a plugin's layout, its contract files, imports and how the host builds it. Open from the primer: (6) `testPlugin` with stub facets, (7) single-file plugins. +- **Single-file plugins (owner, 2026-11-01: "agreed"; plugin model point 7):** a root may hold plain files named + `..ts(x)` (`hello.server.ts`, `hello.web.tsx`): files with the same first name are one plugin named + after it, one facet per file. The name must be a valid unscoped name; a collision with a directory plugin of the + same root is reported like any duplicate. No `package.json`, so no npm dependencies; it imports only the app's API + (host packages), no other files and no contract files for others; it may serve objects, define contracts for + itself inline and contribute to registries. When it needs more, it becomes a directory with the same name, which a + reload treats as the same plugin. The watcher's `set` mark covers files appearing and disappearing at a root's top. - **A plugin's npm dependencies are bundled; external only by opt-in (owner, 2026-10-29: "explicit opt in + (a)"):** a plugin's `dependencies` are installed into its own `node_modules` (`npm install --ignore-scripts`) and bundled into each facet that imports them (host packages, its `peerDependencies`, stay external and are passed in). On Node a diff --git a/packages/chord/docs/next/slices.md b/packages/chord/docs/next/slices.md index c4619becc..9b9c357c1 100644 --- a/packages/chord/docs/next/slices.md +++ b/packages/chord/docs/next/slices.md @@ -192,6 +192,8 @@ deleted (the slice's spec and code are the record). Moved here from `carry-over. pins (subfolders of multi-plugin repositories cloned and linked); installing plugins from git; base code reduced to the API, bootstrap and a start-data facet, the harness and core registry providers as plugins, a required root; a skill and documentation for agents on a plugin's layout and build. +- **Single-file plugins** (decision "Single-file plugins"): discovery of `..ts(x)` files, grouped by + name; their import rule; the watcher's `set` for them. ### After slice 11