惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

量子位
雷峰网
雷峰网
博客园 - 三生石上(FineUI控件)
月光博客
月光博客
有赞技术团队
有赞技术团队
阮一峰的网络日志
阮一峰的网络日志
Last Week in AI
Last Week in AI
G
Google Developers Blog
腾讯CDC
B
Blog
Microsoft Azure Blog
Microsoft Azure Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Microsoft Security Blog
Microsoft Security Blog
人人都是产品经理
人人都是产品经理
博客园_首页
T
Tailwind CSS Blog
C
Check Point Blog
博客园 - 【当耐特】
MongoDB | Blog
MongoDB | Blog
A
About on SuperTechFans
Y
Y Combinator Blog
L
LangChain Blog
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
feat: add simple tool plugin authoring · openclaw/opencla...
steipete · 2026-05-17 · via Recent Commits to openclaw:main

@@ -97,40 +97,62 @@ and provider plugins have dedicated guides linked above.

97979898

Every plugin needs a manifest, even with no config. Runtime-registered tools

9999

must be listed in `contracts.tools` so OpenClaw can discover the owning

100-

plugin without loading every plugin runtime. Plugins should also declare

101-

`activation.onStartup` intentionally. This example sets it to `true`. See

102-

[Manifest](/plugins/manifest) for the full schema. The canonical ClawHub

103-

publish snippets live in `docs/snippets/plugin-publish/`.

100+

plugin without loading every plugin runtime. For simple tool-only plugins,

101+

prefer `defineToolPlugin` plus `openclaw plugins build` so tool names and

102+

the empty config schema are generated from one source of truth. Plugins

103+

should also declare `activation.onStartup` intentionally. This example sets

104+

it to `true`. See [Manifest](/plugins/manifest) for the full schema. The

105+

canonical ClawHub publish snippets live in `docs/snippets/plugin-publish/`.

104106105107

</Step>

106108107109

<Step title="Write the entry point">

108110109111

```typescript

110112

// index.ts

111-

import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";

112-

import { Type } from "@sinclair/typebox";

113+

import { Type } from "typebox";

114+

import { defineToolPlugin } from "openclaw/plugin-sdk/tool-plugin";

113115114-

export default definePluginEntry({

116+

export default defineToolPlugin({

115117

id: "my-plugin",

116118

name: "My Plugin",

117119

description: "Adds a custom tool to OpenClaw",

118-

register(api) {

119-

api.registerTool({

120+

tools: (tool) => [

121+

tool({

120122

name: "my_tool",

121123

description: "Do a thing",

122124

parameters: Type.Object({ input: Type.String() }),

123-

async execute(_id, params) {

124-

return { content: [{ type: "text", text: `Got: ${params.input}` }] };

125+

async execute({ input }) {

126+

return { message: `Got: ${input}` };

125127

},

126-

});

127-

},

128+

}),

129+

],

128130

});

129131

```

130132131-

`definePluginEntry` is for non-channel plugins. For channels, use

132-

`defineChannelPluginEntry` - see [Channel Plugins](/plugins/sdk-channel-plugins).

133-

For full entry point options, see [Entry Points](/plugins/sdk-entrypoints).

133+

`defineToolPlugin` is for simple agent-tool plugins. For providers, hooks,

134+

services, and other advanced non-channel plugins, use `definePluginEntry`.

135+

For channels, use `defineChannelPluginEntry` - see

136+

[Channel Plugins](/plugins/sdk-channel-plugins). For full entry point

137+

options, see [Entry Points](/plugins/sdk-entrypoints).

138+139+

</Step>

140+141+

<Step title="Generate and validate metadata">

142+143+

```bash

144+

npm run build

145+

openclaw plugins build --entry ./dist/index.js

146+

openclaw plugins validate --entry ./dist/index.js

147+

```

148+149+

`openclaw plugins build` writes `openclaw.plugin.json` and keeps

150+

`package.json` `openclaw.extensions` pointed at the entry module. For

151+

published packages, point it at built JavaScript such as `./dist/index.js`.

152+

The generated manifest is the cold-load contract that OpenClaw reads before

153+

runtime import. `openclaw plugins validate` imports the entry only during

154+

author validation and checks that the manifest and package metadata match

155+

the static `defineToolPlugin` metadata.

134156135157

</Step>

136158

@@ -374,7 +396,7 @@ reserved surfaces, not as the default pattern for new third-party plugins.

374396375397

<Check>**package.json** has correct `openclaw` metadata</Check>

376398

<Check>**openclaw.plugin.json** manifest is present and valid</Check>

377-

<Check>Entry point uses `defineChannelPluginEntry` or `definePluginEntry`</Check>

399+

<Check>Entry point uses `defineToolPlugin`, `defineChannelPluginEntry`, or `definePluginEntry`</Check>

378400

<Check>All imports use focused `plugin-sdk/<subpath>` paths</Check>

379401

<Check>Internal imports use local modules, not SDK self-imports</Check>

380402

<Check>Tests pass (`pnpm test -- <bundled-plugin-root>/my-plugin/`)</Check>