Prepare plugin for npm release

This commit is contained in:
Gianfranco Piana
2026-03-18 16:34:15 -04:00
parent 9e651fcda8
commit d7a6fb1027
16 changed files with 120 additions and 32 deletions
+28 -15
View File
@@ -31,25 +31,35 @@ The design is file-first: any agent can pick up the repo-root files and continue
## Install
Use OpenClaw's plugin installer:
```bash
openclaw plugins install @gianfrancopiana/openclaw-autoresearch
```
If you're running from a local OpenClaw checkout, use:
```bash
pnpm openclaw plugins install @gianfrancopiana/openclaw-autoresearch
```
For local plugin development, link your working copy instead of copying files:
```bash
openclaw plugins install --link /absolute/path/to/openclaw-autoresearch
# or from a local OpenClaw checkout:
# pnpm openclaw plugins install --link /absolute/path/to/openclaw-autoresearch
```
For a packaged local install, build the tarball and install that artifact:
```bash
npm install
npm pack
openclaw plugins install ./gianfrancopiana-openclaw-autoresearch-1.0.0.tgz
```
Then load this repo path in OpenClaw plugin discovery and restart the gateway:
```yaml
plugins:
load:
paths:
- /absolute/path/to/openclaw-autoresearch
entries:
openclaw-autoresearch:
enabled: true
```
OpenClaw discovers `openclaw.plugin.json`, loads `extensions/openclaw-autoresearch/index.ts`, and exposes `autoresearch-create`.
Manual install is also possible: copy the plugin root, `extensions/openclaw-autoresearch/`, and `skills/autoresearch-create/` into your managed OpenClaw locations, then restart.
The install command records the plugin, enables it, and exposes the plugin surfaces on restart. The installer reads `package.json#openclaw.extensions`, loads the root [`index.ts`](index.ts), and discovers the manifest in [`openclaw.plugin.json`](openclaw.plugin.json).
Verify:
@@ -95,8 +105,11 @@ npm install --include=dev
npm run typecheck
npm test
npm run validate
npm run release:verify
```
Release instructions, including npm 2FA publishing, live in [`RELEASING.md`](RELEASING.md).
The local test shim supports typechecking and tests without a full OpenClaw host checkout. Runtime behavior depends on a real OpenClaw host.
## License
+43
View File
@@ -0,0 +1,43 @@
# Releasing
## Prerequisites
- npm access to `@gianfrancopiana`
- either npm account 2FA enabled for publishing, or a granular access token with `Bypass 2FA` enabled
## Release
1. Update `package.json` and `openclaw.plugin.json` if you are changing the version.
2. Run the release checks:
```bash
npm install
npm run release:verify
```
3. Publish:
```bash
npm publish --otp=123456
```
Replace `123456` with the current code from your authenticator app.
4. Verify install:
```bash
openclaw plugins install @gianfrancopiana/openclaw-autoresearch
```
For a local OpenClaw checkout:
```bash
pnpm openclaw plugins install @gianfrancopiana/openclaw-autoresearch
```
## Common failure
If `npm publish` fails with `E403` and mentions 2FA or bypass tokens, the current auth on this machine is not sufficient to publish. Either:
- re-run `npm publish --otp=<current-code>`
- or switch to a granular npm token with publish rights and `Bypass 2FA` enabled
+1 -1
View File
@@ -1,4 +1,4 @@
import type { OpenClawPluginApi } from "openclaw/plugin-sdk/core";
import type { OpenClawPluginApi } from "openclaw/plugin-sdk";
import {
AUTORESEARCH_PLUGIN_DESCRIPTION,
AUTORESEARCH_PLUGIN_ID,
@@ -1,5 +1,5 @@
import * as fs from "node:fs";
import type { OpenClawPluginApi } from "openclaw/plugin-sdk/core";
import type { OpenClawPluginApi } from "openclaw/plugin-sdk";
import {
AUTORESEARCH_ROOT_FILES,
getAutoresearchRootFilePath,
@@ -1,7 +1,9 @@
import { emptyPluginConfigSchema } from "openclaw/plugin-sdk/core";
export const AUTORESEARCH_PLUGIN_ID = "openclaw-autoresearch";
export const AUTORESEARCH_PLUGIN_NAME = "Autoresearch";
export const AUTORESEARCH_PLUGIN_DESCRIPTION = "Faithful OpenClaw port of pi-autoresearch.";
export const autoresearchPluginConfigSchema = emptyPluginConfigSchema();
export const autoresearchPluginConfigSchema = {
type: "object",
additionalProperties: false,
properties: {},
} as const;
@@ -1,4 +1,4 @@
import type { OpenClawPluginApi } from "openclaw/plugin-sdk/core";
import type { OpenClawPluginApi } from "openclaw/plugin-sdk";
import { AUTORESEARCH_ROOT_FILES } from "./files.js";
import { reconstructStateFromJsonl } from "./state.js";
import {
@@ -1,4 +1,4 @@
import type { OpenClawPluginApi } from "openclaw/plugin-sdk/core";
import type { OpenClawPluginApi } from "openclaw/plugin-sdk";
import { Type } from "@sinclair/typebox";
import { reconstructStateFromJsonl, type AutoresearchStateSnapshot } from "../state.js";
import { getAutoresearchRuntimeState, type AutoresearchRuntimeSnapshot } from "../runtime-state.js";
@@ -1,4 +1,4 @@
import type { OpenClawPluginApi } from "openclaw/plugin-sdk/core";
import type { OpenClawPluginApi } from "openclaw/plugin-sdk";
import { InitExperimentParams } from "./schemas.js";
import { createConfigHeader, writeConfigHeader } from "../logging.js";
import {
@@ -1,5 +1,5 @@
import * as fs from "node:fs";
import type { OpenClawPluginApi } from "openclaw/plugin-sdk/core";
import type { OpenClawPluginApi } from "openclaw/plugin-sdk";
import { LogExperimentParams } from "./schemas.js";
import { commitKeptExperiment } from "../git.js";
import { appendResultEntry, type AutoresearchResultEntry } from "../logging.js";
@@ -1,4 +1,4 @@
import type { OpenClawPluginApi } from "openclaw/plugin-sdk/core";
import type { OpenClawPluginApi } from "openclaw/plugin-sdk";
import { RunExperimentParams } from "./schemas.js";
import { executeExperimentCommand } from "../execute.js";
import { setAutoresearchRunInFlight } from "../runtime-state.js";
@@ -1,5 +1,5 @@
import path from "node:path";
import type { OpenClawPluginApi } from "openclaw/plugin-sdk/core";
import type { OpenClawPluginApi } from "openclaw/plugin-sdk";
export function resolveToolCwd(api: OpenClawPluginApi, requestedCwd?: unknown): string {
const normalizedRequestedCwd =
+1
View File
@@ -0,0 +1 @@
export { default } from "./extensions/openclaw-autoresearch/index.js";
+31 -3
View File
@@ -1,18 +1,40 @@
{
"name": "openclaw-autoresearch",
"name": "@gianfrancopiana/openclaw-autoresearch",
"version": "1.0.0",
"description": "Faithful OpenClaw port of pi-autoresearch.",
"type": "module",
"main": "./index.ts",
"scripts": {
"typecheck": "tsc -p tsconfig.json --noEmit",
"test": "vitest run",
"validate": "npm run typecheck && npm run test"
"validate": "npm run typecheck && npm run test",
"release:verify": "npm run validate && npm pack --dry-run"
},
"keywords": [
"openclaw",
"openclaw-plugin",
"autoresearch"
],
"files": [
"index.ts",
"extensions/openclaw-autoresearch/**/*.ts",
"openclaw.plugin.json",
"skills/",
"docs/",
"README.md",
"RELEASING.md",
"LICENSE"
],
"license": "MIT",
"author": "Gianfranco Piana",
"repository": {
"type": "git",
"url": "git+https://github.com/gianfrancopiana/openclaw-autoresearch.git"
},
"homepage": "https://github.com/gianfrancopiana/openclaw-autoresearch#readme",
"bugs": {
"url": "https://github.com/gianfrancopiana/openclaw-autoresearch/issues"
},
"devDependencies": {
"@types/node": "24.5.2",
"typescript": "5.9.2",
@@ -21,9 +43,15 @@
"dependencies": {
"@sinclair/typebox": "0.34.48"
},
"peerDependencies": {
"openclaw": "*"
},
"publishConfig": {
"access": "public"
},
"openclaw": {
"extensions": [
"./extensions/openclaw-autoresearch/index.ts"
"./index.ts"
]
}
}
+1 -1
View File
@@ -1,5 +1,5 @@
import { describe, expect, it, vi } from "vitest";
import plugin from "../extensions/openclaw-autoresearch/index.js";
import plugin from "../index.js";
describe("plugin registration", () => {
it("registers the command, OpenClaw hooks, and all tool surfaces", () => {
+2 -1
View File
@@ -9,10 +9,11 @@
"types": ["node", "vitest/globals"],
"baseUrl": ".",
"paths": {
"openclaw/plugin-sdk/core": ["./test/shims/openclaw-plugin-sdk-core.ts"]
"openclaw/plugin-sdk": ["./test/shims/openclaw-plugin-sdk-core.ts"]
}
},
"include": [
"index.ts",
"extensions/openclaw-autoresearch/**/*.ts",
"test/**/*.ts"
]
+1 -1
View File
@@ -9,7 +9,7 @@ const shimPath = fileURLToPath(
export default defineConfig({
resolve: {
alias: {
"openclaw/plugin-sdk/core": shimPath,
"openclaw/plugin-sdk": shimPath,
},
},
test: {