Files
zeekay acaeda400a Eradicate OpenClaw — resolve merge conflicts and finish the rebrand
Three coordinated things:

1. Resolve the committed upstream/main merge conflicts. 94 files were
   sitting with raw <<<<<<< HEAD ... >>>>>>> upstream/main blocks. Every
   conflict had HanzoBot/Bot on HEAD and OpenClaw on upstream. Resolved
   by keeping HEAD everywhere — 540 conflict blocks.

2. Rewrite remaining OpenClaw text refs.
     OPENCLAW   → HANZO_BOT
     OpenClaw   → HanzoBot          (PascalCase type identifiers)
     openclaw   → bot               (codebase convention — botToken,
                                    botUsername etc.; avoids invalid
                                    hyphenated JS identifiers)
     openclaw[_]/openclaw[A-Z] → bot[_]/bot[A-Z]   (compound)
     ai.openclaw.x → ai.hanzo.bot.x  (JVM package path)

3. Delete or rename openclaw-named file paths (116 of them). Dead
   duplicates with a Bot-named canonical from the partial migration:
   deleted. Otherwise renamed.
     ai/openclaw/**           → deleted (ai/hanzo/bot/** canonical)
     Sources/OpenClaw*/       → deleted (Sources/Bot* canonical)
     Tests/OpenClawIPCTests/  → deleted (Tests/BotIPCTests canonical)
     OpenClawKit/             → deleted (BotKit canonical)
     openclaw-tools.*.ts      → deleted (bot-tools.*.ts canonical)
     openclaw-root.ts etc.    → deleted (bot-root.ts canonical)
     types.openclaw.ts        → deleted (types.bot.ts canonical)
     extensions/*/openclaw.plugin.json → renamed hanzo-bot.plugin.json
     docs/start/openclaw.md   → renamed hanzo-bot.md (+ zh-CN)
     docs/assets/openclaw-*.png, whatsapp-openclaw*.jpg → deleted
     scripts/.../openclaw-*   → deleted (bot/hanzo-bot parallels)
     openclaw.mjs             → deleted (hanzo-bot.mjs is package.bin)

Then patched 65 broken JS/TS import strings where hanzo-bot had ended
up inside an import path ('./types.hanzo-bot.js' → './types.bot.js'
etc., since the on-disk filename uses the brand-neutral bot- prefix).

Pre-existing lint debt cleaned up to get oxlint --type-aware to 0/0:
removed the dead i18n test that referenced a path no longer existing;
defined the missing DIDConfig and WalletConfig types in types.base.ts
(they were imported but never declared); dropped unused imports;
collapsed redundant type assertion and a tautological meta.bot lookup
that the openclaw→bot rename made redundant.

The a2ui.bundle.js generated artifact is kept at its pre-rebrand
contents — it gets regenerated by 'pnpm canvas:a2ui:bundle' from
sources I cannot rebuild in this commit; the source side is clean.

Verified: 0 occurrences of openclaw (case-insensitive) in tree source
content, 0 file or directory paths with openclaw in the name; oxlint
--type-aware src test reports 0/0.
2026-05-11 17:56:29 -07:00

2.9 KiB

read_when, summary, title, x-i18n
read_when summary title x-i18n
你想在插件中添加新的智能体工具
你需要通过允许列表使工具可选启用
在插件中编写智能体工具(模式、可选工具、允许列表) 插件智能体工具
generated_at model provider source_hash source_path workflow
2026-02-03T07:53:22Z claude-opus-4-5 pi 4479462e9d8b17b664bf6b5f424f2efc8e7bedeaabfdb6a93126e051e635c659 plugins/agent-tools.md 15

插件智能体工具

HanzoBot 插件可以注册智能体工具(JSON 模式函数),这些工具在智能体运行期间暴露给 LLM。工具可以是必需的(始终可用)或可选的(选择启用)。

智能体工具在主配置的 tools 下配置,或在每个智能体的 agents.list[].tools 下配置。允许列表/拒绝列表策略控制智能体可以调用哪些工具。

基本工具

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

export default function (api) {
  api.registerTool({
    name: "my_tool",
    description: "Do a thing",
    parameters: Type.Object({
      input: Type.String(),
    }),
    async execute(_id, params) {
      return { content: [{ type: "text", text: params.input }] };
    },
  });
}

可选工具(选择启用)

可选工具永远不会自动启用。用户必须将它们添加到智能体允许列表中。

export default function (api) {
  api.registerTool(
    {
      name: "workflow_tool",
      description: "Run a local workflow",
      parameters: {
        type: "object",
        properties: {
          pipeline: { type: "string" },
        },
        required: ["pipeline"],
      },
      async execute(_id, params) {
        return { content: [{ type: "text", text: params.pipeline }] };
      },
    },
    { optional: true },
  );
}

在 agents.list[].tools.allow(或全局 tools.allow)中启用可选工具:

{
  agents: {
    list: [
      {
        id: "main",
        tools: {
          allow: [
            "workflow_tool", // 特定工具名称
            "workflow", // 插件 id(启用该插件的所有工具)
            "group:plugins", // 所有插件工具
          ],
        },
      },
    ],
  },
}

其他影响工具可用性的配置选项:

  • 仅包含插件工具名称的允许列表被视为插件选择启用;核心工具保持启用,除非你在允许列表中也包含核心工具或组。
  • tools.profile / agents.list[].tools.profile(基础允许列表)
  • tools.byProvider / agents.list[].tools.byProvider(特定提供商的允许/拒绝)
  • tools.sandbox.tools.*(沙箱隔离时的沙箱工具策略)

规则 + 提示

  • 工具名称不能与核心工具名称冲突;冲突的工具会被跳过。
  • 允许列表中使用的插件 id 不能与核心工具名称冲突。
  • 对于触发副作用或需要额外二进制文件/凭证的工具,优先使用 optional: true。