chore: rename plugin ID to 1h-tools

This commit is contained in:
openclaw committed 2026-10-19 03:27:43 +00:00
1 parent 2011077fcd
commit 69877803ca
11 files changed
+29 -21

No files matched your search

+2 -2
View File
@@ -1,4 +1,4 @@
# OpenClaw Tools & Media Providers (`openclaw-plugin-tools`) # 1-h Tools (`1h-tools`)
OpenClaw 统一私有扩展插件集合,聚合了自定义 Agent 工具、媒体生成驱动(视频/图像)以及内置技能库。 OpenClaw 统一私有扩展插件集合,聚合了自定义 Agent 工具、媒体生成驱动(视频/图像)以及内置技能库。
@@ -30,7 +30,7 @@ openclaw plugins install git:git.1-h.cc/OpenClaw/openclaw-plugin-tools --force
当 Gitea 仓库有新提交时,在终端执行: 当 Gitea 仓库有新提交时,在终端执行:
```bash ```bash
openclaw plugins update tools openclaw plugins update 1h-tools
``` ```
### 开发与验证 ### 开发与验证
+3 -1
View File
@@ -35,7 +35,9 @@ export function resolvePluginApiKey(rawKey) {
return undefined; return undefined;
} }
export function resolveImageConfig(cfg, apiPluginConfig) { export function resolveImageConfig(cfg, apiPluginConfig) {
const toolsConfig = (apiPluginConfig ?? cfg?.plugins?.entries?.["tools"]?.config); const toolsConfig = (apiPluginConfig ??
cfg?.plugins?.entries?.["1h-tools"]?.config ??
cfg?.plugins?.entries?.["tools"]?.config);
const legacyConfig = (cfg?.plugins?.entries?.["openai-image"]?.config ?? const legacyConfig = (cfg?.plugins?.entries?.["openai-image"]?.config ??
cfg?.plugins?.entries?.["bifrost-image"]?.config); cfg?.plugins?.entries?.["bifrost-image"]?.config);
const directImageConfig = toolsConfig?.image; const directImageConfig = toolsConfig?.image;
+4 -4
View File
@@ -5,8 +5,8 @@ import { echoTool } from "./tools/echo.js";
import { buildOpenAIVideoGenerationProvider } from "./video/index.js"; import { buildOpenAIVideoGenerationProvider } from "./video/index.js";
import { buildOpenAIImageGenerationProvider } from "./image/index.js"; import { buildOpenAIImageGenerationProvider } from "./image/index.js";
const entry = definePluginEntry({ const entry = definePluginEntry({
id: "tools", id: "1h-tools",
name: "Tools", name: "1-h Tools",
description: "Custom Tools and Media Providers for OpenClaw.", description: "Custom Tools and Media Providers for OpenClaw.",
register(api) { register(api) {
// 1. Register tools // 1. Register tools
@@ -34,8 +34,8 @@ const entry = definePluginEntry({
}); });
Object.defineProperty(entry, toolPluginMetadataSymbol, { Object.defineProperty(entry, toolPluginMetadataSymbol, {
value: { value: {
id: "tools", id: "1h-tools",
name: "Tools", name: "1-h Tools",
description: "Custom Tools and Media Providers for OpenClaw.", description: "Custom Tools and Media Providers for OpenClaw.",
tools: [echoTool], tools: [echoTool],
}, },
+3 -1
View File
@@ -18,7 +18,9 @@ export function resolvePluginApiKey(rawKey) {
return undefined; return undefined;
} }
export function resolveVideoConfig(cfg, apiPluginConfig) { export function resolveVideoConfig(cfg, apiPluginConfig) {
const toolsConfig = (apiPluginConfig ?? cfg?.plugins?.entries?.["tools"]?.config); const toolsConfig = (apiPluginConfig ??
cfg?.plugins?.entries?.["1h-tools"]?.config ??
cfg?.plugins?.entries?.["tools"]?.config);
const legacyConfig = cfg?.plugins?.entries?.["openai-video"]?.config; const legacyConfig = cfg?.plugins?.entries?.["openai-video"]?.config;
const directVideoConfig = toolsConfig?.video; const directVideoConfig = toolsConfig?.video;
const flatToolsConfig = toolsConfig?.baseUrl const flatToolsConfig = toolsConfig?.baseUrl
+2 -2
View File
@@ -1,6 +1,6 @@
{ {
"id": "tools", "id": "1h-tools",
"name": "Tools", "name": "1-h Tools",
"description": "Custom Tools and Media Providers (Video & Image) for OpenClaw.", "description": "Custom Tools and Media Providers (Video & Image) for OpenClaw.",
"version": "0.3.0", "version": "0.3.0",
"categories": [ "categories": [
+2 -2
View File
@@ -24,7 +24,7 @@ OpenClaw 图像生成驱动模块,适配标准 **OpenAI Images API**(`/v1/im
支持通过 **Web 控制台(Control UI)** 或直接编辑 `~/.openclaw/openclaw.json`。 支持通过 **Web 控制台(Control UI)** 或直接编辑 `~/.openclaw/openclaw.json`。
### 方式 1:Web 控制台可视化配置 ### 方式 1:Web 控制台可视化配置
进入 **Settings → Plugins → Tools**: 进入 **Settings → Plugins → 1-h Tools**:
* **Image Base URL**:填写图像上游端点(例如 `https://Direct-Bifrost.oo1.dev/v1` 或内部反代地址) * **Image Base URL**:填写图像上游端点(例如 `https://Direct-Bifrost.oo1.dev/v1` 或内部反代地址)
* **Image API Key**:填写 API Key 或 SecretRef(留空时自动回退读取环境变量 `OPENAI_IMAGE_API_KEY`、`BIFROST_API_KEY`、`CCLOAD_API_KEY` 或 `OPENAI_API_KEY`) * **Image API Key**:填写 API Key 或 SecretRef(留空时自动回退读取环境变量 `OPENAI_IMAGE_API_KEY`、`BIFROST_API_KEY`、`CCLOAD_API_KEY` 或 `OPENAI_API_KEY`)
* **Default Image Model**:例如 `gpt-image-2` * **Default Image Model**:例如 `gpt-image-2`
@@ -37,7 +37,7 @@ OpenClaw 图像生成驱动模块,适配标准 **OpenAI Images API**(`/v1/im
{ {
"plugins": { "plugins": {
"entries": { "entries": {
"tools": { "1h-tools": {
"enabled": true, "enabled": true,
"config": { "config": {
"image": { "image": {
+3 -1
View File
@@ -64,7 +64,9 @@ export function resolveImageConfig(
cfg: ImageGenerationRequest["cfg"] | undefined, cfg: ImageGenerationRequest["cfg"] | undefined,
apiPluginConfig?: Record<string, unknown>, apiPluginConfig?: Record<string, unknown>,
): ImagePluginConfig | undefined { ): ImagePluginConfig | undefined {
const toolsConfig = (apiPluginConfig ?? cfg?.plugins?.entries?.["tools"]?.config) as const toolsConfig = (apiPluginConfig ??
cfg?.plugins?.entries?.["1h-tools"]?.config ??
cfg?.plugins?.entries?.["tools"]?.config) as
| { | {
image?: ImagePluginConfig; image?: ImagePluginConfig;
baseUrl?: string; baseUrl?: string;
+1 -1
View File
@@ -2,7 +2,7 @@ import { describe, expect, it, vi } from "vitest";
import entry from "./index.js"; import entry from "./index.js";
import { getToolPluginMetadata } from "openclaw/plugin-sdk/tool-plugin"; import { getToolPluginMetadata } from "openclaw/plugin-sdk/tool-plugin";
describe("tools", () => { describe("1h-tools", () => {
it("declares tool metadata", () => { it("declares tool metadata", () => {
expect(getToolPluginMetadata(entry)?.tools.map((tool) => tool.name)).toEqual(["echo"]); expect(getToolPluginMetadata(entry)?.tools.map((tool) => tool.name)).toEqual(["echo"]);
}); });
+4 -4
View File
@@ -6,8 +6,8 @@ import { buildOpenAIVideoGenerationProvider } from "./video/index.js";
import { buildOpenAIImageGenerationProvider } from "./image/index.js"; import { buildOpenAIImageGenerationProvider } from "./image/index.js";
const entry = definePluginEntry({ const entry = definePluginEntry({
id: "tools", id: "1h-tools",
name: "Tools", name: "1-h Tools",
description: "Custom Tools and Media Providers for OpenClaw.", description: "Custom Tools and Media Providers for OpenClaw.",
register(api) { register(api) {
// 1. Register tools // 1. Register tools
@@ -42,8 +42,8 @@ const entry = definePluginEntry({
Object.defineProperty(entry, toolPluginMetadataSymbol, { Object.defineProperty(entry, toolPluginMetadataSymbol, {
value: { value: {
id: "tools", id: "1h-tools",
name: "Tools", name: "1-h Tools",
description: "Custom Tools and Media Providers for OpenClaw.", description: "Custom Tools and Media Providers for OpenClaw.",
tools: [echoTool], tools: [echoTool],
}, },
+2 -2
View File
@@ -15,7 +15,7 @@ OpenClaw 视频生成驱动模块,适配标准 **OpenAI Videos API**(`/v1/vi
支持通过 **Web 控制台(Control UI)** 或直接编辑 `~/.openclaw/openclaw.json`。 支持通过 **Web 控制台(Control UI)** 或直接编辑 `~/.openclaw/openclaw.json`。
### 方式 1:Web 控制台可视化配置 ### 方式 1:Web 控制台可视化配置
进入 **Settings → Plugins → Tools**: 进入 **Settings → Plugins → 1-h Tools**:
* **API Base URL**:填写视频上游端点(例如 `http://host.incus.internal:8083/v1` 或内部网关地址) * **API Base URL**:填写视频上游端点(例如 `http://host.incus.internal:8083/v1` 或内部网关地址)
* **API Key**:填写 API Key 或 SecretRef(留空时自动回退读取环境变量 `OPENAI_VIDEO_API_KEY`、`CCLOAD_API_KEY` 或 `BIFROST_API_KEY`) * **API Key**:填写 API Key 或 SecretRef(留空时自动回退读取环境变量 `OPENAI_VIDEO_API_KEY`、`CCLOAD_API_KEY` 或 `BIFROST_API_KEY`)
* **默认视频模型**:例如 `gemini-video` 或 `sora-2` * **默认视频模型**:例如 `gemini-video` 或 `sora-2`
@@ -28,7 +28,7 @@ OpenClaw 视频生成驱动模块,适配标准 **OpenAI Videos API**(`/v1/vi
{ {
"plugins": { "plugins": {
"entries": { "entries": {
"tools": { "1h-tools": {
"enabled": true, "enabled": true,
"config": { "config": {
"video": { "video": {
+3 -1
View File
@@ -75,7 +75,9 @@ export function resolveVideoConfig(
cfg: VideoGenerationRequest["cfg"] | undefined, cfg: VideoGenerationRequest["cfg"] | undefined,
apiPluginConfig?: Record<string, unknown>, apiPluginConfig?: Record<string, unknown>,
): VideoPluginConfig | undefined { ): VideoPluginConfig | undefined {
const toolsConfig = (apiPluginConfig ?? cfg?.plugins?.entries?.["tools"]?.config) as const toolsConfig = (apiPluginConfig ??
cfg?.plugins?.entries?.["1h-tools"]?.config ??
cfg?.plugins?.entries?.["tools"]?.config) as
| { video?: VideoPluginConfig; baseUrl?: string; apiKey?: string | SecretRefObject; defaultModel?: string; models?: string[]; allowPrivateNetwork?: boolean } | { video?: VideoPluginConfig; baseUrl?: string; apiKey?: string | SecretRefObject; defaultModel?: string; models?: string[]; allowPrivateNetwork?: boolean }
| undefined; | undefined;