Repository navigation
docs: pitch-first README and plugin authoring guide - #56
Merged
Merged
Conversation
Open with what Borg Agent is (kernel plus plugins, bundled as a distribution), then quickstart, the workspace architecture including distributions and the @borg/contracts root and capability subpaths, and every rule scripts/check-plugin-boundaries.mjs enforces. The desktop app instructions move under a Desktop app section; a few statements were corrected against the source. Part of #33
docs/plugin-authoring.md walks through plugins/hello: package layout and the borg field, the manifest and what PluginManager validates, activation and the PluginContext permission table, contract.ts and the ./contract export, import rules, UI registration, tests with createTestHarness, and declaring a plugin in the borg.desktop distribution. Part of #33
…ev, mock-llm and hello A host outside apps/desktop builds a PluginSource from a plugin's static manifest and its main entry. These four packages now export ./borg.plugin.json so a host can require the manifest by package specifier instead of a path into the package. The headless example uses them. Part of #33
docs/boundaries.md holds every rule scripts/check-plugin-boundaries.mjs and the other two check:boundaries scripts enforce, read from the scripts on main. It also corrects the ./contract tsconfig rule (the tsconfig named by the build script, with src/contract.ts, src/*.ts or src/**/*.ts in include) and lists the contracts subpaths as they are after #54. docs/desktop.md holds the desktop setup and feature detail unchanged. docs/plugin-authoring.md gets the same tsconfig correction and links to docs/boundaries.md. CONTRIBUTING.md links to it and states the /contract exception to the plugin import rule. Part of #33
The README now opens with the pitch, four points on what the kernel does differently, and a status line. It quotes examples/headless/src/main.ts, which defines a four-plugin distribution, boots the kernel in plain Node, sends borg.hello.getStatus, and stops. Architecture is one paragraph per layer, boundaries and the desktop app are short summaries that link to docs/, and there is a License section. examples/* joins the workspace, the vitest include and tsconfig.tests.json. examples/headless/test/headless.test.ts runs the built example and checks that the README block matches the file, so pnpm test in both CI jobs covers it. The lockfile change is the new importer entry only. Part of #33
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.
Part of #33
What changed
README.md is rewritten as a front page for newcomers:
examples/headless/src/main.tsexactly.defineCommand,defineEventand the kernel's schemas (including the MCP server config personas embed), defines no plugin commands, and its only event isborg.channel.inboundMessage. Plugin-owned schemas ship from@borg/plugin-<name>/contract.docs/. The macOS packaging commands stay. There is a License section.docs/boundaries.md (new) holds the full boundary rule list from the README, read from
scripts/check-plugin-boundaries.mjsand the other twocheck:boundariesscripts on main. One rule was corrected:./contractrequires the tsconfig named by the package'sbuildscript (defaulttsconfig.main.json) to listsrc/contract.ts,src/*.tsorsrc/**/*.ts.docs/desktop.md (new) holds the desktop setup and feature detail from the README, unchanged.
docs/plugin-authoring.md gets only the same tsconfig correction and a link to
docs/boundaries.md.CONTRIBUTING.md links to
docs/boundaries.mdand notes the/contractexception to the plugin import rule.Headless example
examples/headless(@borg/example-headless) defines a four-plugin distribution (borg.config.sqlite,borg.secrets.dev,borg.mock-llm,borg.hello), boots it withcreateKernel()in plain Node, callsborg.hello.getStatusonce, and stops. The kernel won't start without a config store and a secret store, which is why those two plugins are in it.plugins/{config-sqlite,secrets-dev,mock-llm,hello}/package.jsonnow export./borg.plugin.json. That's the only change outside docs, examples and workspace wiring.examples/*is added topnpm-workspace.yaml, the vitest include andtsconfig.tests.json. The lockfile diff is the new importer entry only.examples/headless/test/headless.test.tsruns the builtdist/main.jsand expectsborg.hello: Kernel alive. It also checks that the README code block matches the file byte for byte.pnpm testbuilds first, so both CI jobs run it without a new CI step.Merge of main
The branch merges
origin/mainat fa68858 (#54) normally, with no force-push. Nothing in the docs describes plugin schemas as still sitting in the root or points to #31 as in progress.Gates (local, Linux, Node 24, pnpm 12.0.0)
install --frozen-lockfile✅check:boundaries✅typecheck✅test: 140 files, 935 tests, including the example ✅test:e2e(xvfb): 44 passed, 2 skipped, 0 failed ✅Left for #33
pnpm lintscript, and a CI step, in a separate PR.examples/item is covered byexamples/headless, whichpnpm testruns. A plugin-authoring example (a plugin package underexamples/) could follow if wanted.