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