diff --git a/.github/workflows/publish-plugin.yml b/.github/workflows/publish-plugin.yml new file mode 100644 index 0000000..765e964 --- /dev/null +++ b/.github/workflows/publish-plugin.yml @@ -0,0 +1,46 @@ +name: Publish plugin to NPM + +permissions: + id-token: write + contents: read + +on: + workflow_dispatch: + inputs: + package: + description: "Package to publish" + required: true + type: choice + options: + - claw-plugin + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: pnpm/action-setup@v2 + with: + version: 9.15.4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + registry-url: "https://registry.npmjs.org" + cache: pnpm + cache-dependency-path: "pnpm-lock.yaml" + + - name: Install npm 11.6.4 + run: npm install -g npm@11.6.4 + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Run package checks + working-directory: ./packages/${{ inputs.package }} + run: pnpm run ci + + - name: Publish package + working-directory: ./packages/${{ inputs.package }} + run: pnpm publish --access public diff --git a/README.md b/README.md index 3bec358..94e8d06 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,14 @@ curl -fsSL https://openui.com/openclaw-os/install.sh | bash The installer downloads the source, builds the workspace UI, registers it as an OpenClaw plugin, restarts the gateway, and opens the dashboard in your browser. +To uninstall: + +```bash +curl -fsSL https://openui.com/openclaw-os/install.sh | bash -s -- uninstall +``` + +> The workspace runs at `http://localhost:18789/plugins/openclawos`; run **`openclaw os url`** for the pre-authenticated URL. +> > Don't have OpenClaw yet? Install it first from [openclaw.ai](https://openclaw.ai/install.sh), then run the command above. > > Installing from a local clone: see [`CONTRIBUTING.md`](./CONTRIBUTING.md). diff --git a/packages/claw-plugin/README.md b/packages/claw-plugin/README.md index 7f0f90e..c6440f2 100644 --- a/packages/claw-plugin/README.md +++ b/packages/claw-plugin/README.md @@ -28,9 +28,17 @@ The plugin teaches OpenUI Lang in two pieces, split by how often a turn needs ea For end users, install OpenClaw OS via the installer script from the [root README](../../README.md#quick-start): ```sh +# Install curl -fsSL https://openui.com/openclaw-os/install.sh | bash + +# Uninstall +curl -fsSL https://openui.com/openclaw-os/install.sh | bash -s -- uninstall ``` +### Opening the workspace + +The workspace is served from your gateway — most likely `http://localhost:18789/plugins/openclawos`. For the pre-authenticated URL, run `openclaw os url`. + ### From a local clone ```sh @@ -44,25 +52,14 @@ pnpm build # install scanner, and the bundled dist/ has no runtime deps to install. rm -rf node_modules -# Install + reload +# Install + reload, then open it openclaw plugins install ./packages/claw-plugin --force openclaw gateway restart +openclaw os url ``` If `~/.openclaw/openclaw.json` has a non-empty `plugins.allow` list, add `openclaw-os-plugin` to it. With an empty `plugins.allow` (allow-all) no action is needed; without pinning when an allow list is set, the gateway lazy-reloads the plugin on every tool lookup and `app_create` fails intermittently. -Open the workspace at `http://localhost:18789/plugins/openclawos`. Paste the gateway URL (`ws://localhost:18789`) and the auth token from `~/.openclaw/openclaw.json` into the Settings dialog on first load. - -### Skipping the settings dialog - -To skip the dialog and get a pre-authenticated URL (token in the fragment, mirrors `openclaw dashboard`), use the CLI subcommand the plugin registers: - -```sh -openclaw os url # prints the setup URL with auth to stdout -``` - -This reads the gateway-validated config directly, so it survives `--dev` / `--profile` flags and is the recommended path for installers and onboarding scripts. - ## Scripts ```sh diff --git a/packages/claw-plugin/package.json b/packages/claw-plugin/package.json index f5ac443..46a0d44 100644 --- a/packages/claw-plugin/package.json +++ b/packages/claw-plugin/package.json @@ -1,8 +1,18 @@ { "name": "@openuidev/openclaw-os-plugin", - "version": "0.1.1", + "version": "0.1.3", "type": "module", "description": "OpenClaw plugin that turns agent responses into Generative UI and serves the claw-client at /plugins/openclawos.", + "keywords": [ + "openclaw", + "openclaw web ui", + "openclaw-plugin", + "openclaw-os", + "openui", + "openui-lang", + "generative-ui", + "agent-ui" + ], "license": "MIT", "homepage": "https://openui.com", "repository": { diff --git a/packages/claw-plugin/src/index.ts b/packages/claw-plugin/src/index.ts index 2b87745..8e9e4d1 100644 --- a/packages/claw-plugin/src/index.ts +++ b/packages/claw-plugin/src/index.ts @@ -241,8 +241,13 @@ export default definePluginEntry({ return true; }, }); + const uiPort = api.config.gateway?.port ?? 18789; + const uiHost = + api.config.gateway?.bind === "custom" && api.config.gateway?.customBindHost + ? api.config.gateway.customBindHost + : "127.0.0.1"; api.logger.info( - `[openclaw-os-plugin] static UI route at ${ROUTE_PREFIX} (root=${STATIC_ROOT})`, + `[openclaw-os-plugin] workspace UI mounted at http://${uiHost}:${uiPort}${ROUTE_PREFIX}/ (root ${STATIC_ROOT})`, ); // ── CLI: `openclaw os url` ──────────────────────────────────────────────