pi-mono/packages/chord/test/next-node/fixtures/plugins/contracts/contract.ts
Mario Zechner a14cdf90f0 feat(chord): v2 slice 7c, plugins component and per-plugin load and reload
Plugin discovery, esbuild builds (optional peer dependency), vm evaluation with
pluginFile and mapStack, dependency installs, a watcher with dirty marks and
rollout across hosts; host.load and host.reload per plugin with the closure rule;
examples 35-39 as folders with real plugin directories.
2026-10-30 18:18:23 +00:00

20 lines
832 B
TypeScript

// Fixture plugin (slice 7c): contracts only, no facet; the other fixtures import (copy) it.
import { hostKind, int, local, method, remote, str } from "@earendil-works/chord/next";
/** The host kind of the fixtures' worker. */
export const Worker = hostKind("test.worker");
/** Notes on the worker: a label, a count and `add`. */
export const Notes = remote("test.notes", {
version: 1,
params: {},
hostAddress: () => Worker(),
variants: { main: { state: { label: str(), count: int() }, methods: { add: method(undefined, int()) } } },
});
/** The notes' label on the server. */
export const Index = local("test.index", { version: 1, params: {}, members: { label: str() } });
/** A file of a plugin read through `pluginFile`. */
export const Files = local("test.files", { version: 1, params: {}, members: { text: str() } });