diff --git a/.omp-plugin/marketplace.json b/.omp-plugin/marketplace.json deleted file mode 100644 index 63417b1..0000000 --- a/.omp-plugin/marketplace.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "rblaine95", - "owner": { - "name": "rblaine95" - }, - "metadata": { - "description": "OMP plugins maintained by rblaine95" - }, - "plugins": [ - { - "name": "rules-guard", - "description": "Enforce the Claude permissions.deny policy across all omp tools (read/write/edit/find/search/bash/eval/browser).", - "version": "0.0.0", - "source": { - "source": "github", - "repo": "rblaine95/omp-plugins", - "path": "extensions/rules-guard" - }, - "repository": "https://github.com/rblaine95/omp-plugins", - "license": "MIT" - }, - { - "name": "usage-status", - "description": "Show remaining subscription usage and reset countdowns for every provider, in a color-coded row above the omp editor.", - "version": "0.0.0", - "source": { - "source": "github", - "repo": "rblaine95/omp-plugins", - "path": "extensions/usage-status" - }, - "repository": "https://github.com/rblaine95/omp-plugins", - "license": "MIT" - } - ] -} diff --git a/AGENTS.md b/AGENTS.md index 44e35e3..ca4a2cd 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -4,15 +4,16 @@ extensions, published as one installable plugin. Install/update/uninstall live in [`README.md`](./README.md); this file is for _changing_ the code. -The repo root is the plugin manifest: root `package.json` `omp.extensions` lists every -entry point, so one install pulls the whole suite. Each extension is a Bun workspace -member under `extensions/*`. TypeScript run directly by [Bun](https://bun.com/docs/llms.txt) +The repo root is the plugin manifest: root `package.json` `omp.features` declares every +extension as a selectable feature (all `default: true`), so a bare install pulls the whole +suite and a bracketed spec loads a subset. Each extension is a Bun workspace member +under `extensions/*`. TypeScript run directly by [Bun](https://bun.com/docs/llms.txt) (1.x, Node 24) — **no build step**. ## Layout ```text -package.json root manifest; omp.extensions array = the install contract +package.json root manifest; omp.features map = the install contract (one feature per extension) extensions// one workspace member per extension index.ts entry: default export receives ExtensionAPI, wires pi.on(...) hooks index.test.ts colocated bun:test suite @@ -65,7 +66,7 @@ what release-please parses on `master`. 1. `mkdir extensions/` with a `package.json` (`name`, `"version": "0.0.0"`, `omp.extensions: ["./index.ts"]`). -2. Add its entry to the **root** `omp.extensions` array — a member missing from it won't load. +2. Add a feature entry to the **root** `omp.features` map: `"": { "description": "…", "default": true, "extensions": ["./extensions//index.ts"] }`. `default: true` keeps it in the bare whole-suite install; the key is the `[]` selector. A member missing from it won't load. 3. `bun install`. ## Included extensions diff --git a/README.md b/README.md index ddd0595..b5df5bf 100644 --- a/README.md +++ b/README.md @@ -2,18 +2,32 @@ Personal [oh-my-pi](https://omp.sh) extensions, published as one installable plugin. -The repo root is itself the plugin manifest: root `package.json` `omp.extensions` lists -every extension entry point, so a single `omp plugin install` pulls the whole suite. Each -extension lives in its own Bun workspace member under `extensions/*` for isolated +The repo root is itself the plugin manifest: root `package.json` `omp.features` declares +every extension as a selectable feature (all `default: true`), so a bare `omp plugin +install` enables the whole suite while a bracketed spec enables just the features you name. +Each extension lives in its own Bun workspace member under `extensions/*` for isolated development and testing. ## Install +All specs install the same single `omp-plugins` package (both extension directories come +with it); the bracket only selects which features **load**: + ```sh -omp plugin install github:rblaine95/omp-plugins +omp plugin install github:rblaine95/omp-plugins # enable whole suite +omp plugin install 'github:rblaine95/omp-plugins[rules-guard]' # enable just rules-guard +omp plugin install 'github:rblaine95/omp-plugins[usage-status]' # enable just usage-status +omp plugin install 'github:rblaine95/omp-plugins[*]' # all features, explicit ``` -Extensions load on the next omp start. `omp plugin list` shows `omp-plugins` as enabled. +Quote any bracketed spec — shells like zsh treat `[...]` as a glob. Extensions load on the +next omp start. `omp plugin list` shows the one `omp-plugins` package as enabled regardless +of selection. Change which features load later, without reinstalling, via +`omp plugin features @rblaine95/omp-plugins`. + +> Marketplace installs (`name@marketplace`) cannot activate these — omp loads +> `omp.extensions`/`omp.features` only for git/npm/`link` installs, never from a marketplace +> cache. Use the `omp plugin install github:…` commands above. ## Update @@ -71,5 +85,5 @@ install pulls in zero runtime dependencies. ## Adding an extension 1. `mkdir extensions/` with its own `package.json` (`name`, `"version": "0.0.0"`, `omp.extensions: ["./index.ts"]`) — members are not versioned independently. -2. Add the entry to the root `package.json` `omp.extensions` array, which is what a git install reads. +2. Add a feature entry to the root `package.json` `omp.features` map — `{ "description": "…", "default": true, "extensions": ["./extensions//index.ts"] }`. This is what a git install reads; `default: true` keeps it in the bare whole-suite install, and its key becomes the `[]` selector. 3. `bun install` to register the new workspace member. diff --git a/package.json b/package.json index 1f3233f..1ac8a65 100644 --- a/package.json +++ b/package.json @@ -22,9 +22,21 @@ }, "packageManager": "bun@1.3.14", "omp": { - "extensions": [ - "./extensions/rules-guard/index.ts", - "./extensions/usage-status/index.ts" - ] + "features": { + "rules-guard": { + "description": "Enforce the Claude permissions allow/deny policy across all omp tools (read/write/edit/find/search/bash/eval/browser).", + "default": true, + "extensions": [ + "./extensions/rules-guard/index.ts" + ] + }, + "usage-status": { + "description": "Show remaining subscription usage and reset countdowns for every provider, in a color-coded row above the omp editor.", + "default": true, + "extensions": [ + "./extensions/usage-status/index.ts" + ] + } + } } }