mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-25 03:04:29 -04:00
refactor: rename to openclaw
This commit is contained in:
@@ -4,7 +4,7 @@ Adds an **optional** agent tool `llm-task` for running **JSON-only** LLM tasks
|
||||
(drafting, summarizing, classifying) with optional JSON Schema validation.
|
||||
|
||||
Designed to be called from workflow engines (for example, Lobster via
|
||||
`clawd.invoke --each`) without adding new Clawdbot code per workflow.
|
||||
`openclaw.invoke --each`) without adding new OpenClaw code per workflow.
|
||||
|
||||
## Enable
|
||||
|
||||
@@ -89,9 +89,9 @@ Returns `details.json` containing the parsed JSON (and validates against
|
||||
|
||||
## Bundled extension note
|
||||
|
||||
This extension depends on Clawdbot internal modules (the embedded agent runner).
|
||||
It is intended to ship as a **bundled** Clawdbot extension (like `lobster`) and
|
||||
This extension depends on OpenClaw internal modules (the embedded agent runner).
|
||||
It is intended to ship as a **bundled** OpenClaw extension (like `lobster`) and
|
||||
be enabled via `plugins.entries` + tool allowlists.
|
||||
|
||||
It is **not** currently designed to be copied into
|
||||
`~/.clawdbot/extensions` as a standalone plugin directory.
|
||||
`~/.openclaw/extensions` as a standalone plugin directory.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { MoltbotPluginApi } from "../../src/plugins/types.js";
|
||||
import type { OpenClawPluginApi } from "../../src/plugins/types.js";
|
||||
|
||||
import { createLlmTaskTool } from "./src/llm-task-tool.js";
|
||||
|
||||
export default function register(api: MoltbotPluginApi) {
|
||||
export default function register(api: OpenClawPluginApi) {
|
||||
api.registerTool(createLlmTaskTool(api), { optional: true });
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"name": "@moltbot/llm-task",
|
||||
"version": "2026.1.29",
|
||||
"name": "@openclaw/llm-task",
|
||||
"version": "2026.1.27-beta.1",
|
||||
"type": "module",
|
||||
"description": "Moltbot JSON-only LLM task plugin",
|
||||
"moltbot": {
|
||||
"description": "OpenClaw JSON-only LLM task plugin",
|
||||
"openclaw": {
|
||||
"extensions": [
|
||||
"./index.ts"
|
||||
]
|
||||
|
||||
@@ -5,12 +5,12 @@ import fs from "node:fs/promises";
|
||||
import Ajv from "ajv";
|
||||
import { Type } from "@sinclair/typebox";
|
||||
|
||||
// NOTE: This extension is intended to be bundled with Moltbot.
|
||||
// When running from source (tests/dev), Moltbot internals live under src/.
|
||||
// NOTE: This extension is intended to be bundled with OpenClaw.
|
||||
// When running from source (tests/dev), OpenClaw internals live under src/.
|
||||
// When running from a built install, internals live under dist/ (no src/ tree).
|
||||
// So we resolve internal imports dynamically with src-first, dist-fallback.
|
||||
|
||||
import type { MoltbotPluginApi } from "../../../src/plugins/types.js";
|
||||
import type { OpenClawPluginApi } from "../../../src/plugins/types.js";
|
||||
|
||||
type RunEmbeddedPiAgentFn = (params: Record<string, unknown>) => Promise<unknown>;
|
||||
|
||||
@@ -61,11 +61,11 @@ type PluginCfg = {
|
||||
timeoutMs?: number;
|
||||
};
|
||||
|
||||
export function createLlmTaskTool(api: MoltbotPluginApi) {
|
||||
export function createLlmTaskTool(api: OpenClawPluginApi) {
|
||||
return {
|
||||
name: "llm-task",
|
||||
description:
|
||||
"Run a generic JSON-only LLM task and return schema-validated JSON. Designed for orchestration from Lobster workflows via clawd.invoke.",
|
||||
"Run a generic JSON-only LLM task and return schema-validated JSON. Designed for orchestration from Lobster workflows via openclaw.invoke.",
|
||||
parameters: Type.Object({
|
||||
prompt: Type.String({ description: "Task instruction for the LLM." }),
|
||||
input: Type.Optional(Type.Unknown({ description: "Optional input payload for the task." })),
|
||||
@@ -154,7 +154,7 @@ export function createLlmTaskTool(api: MoltbotPluginApi) {
|
||||
|
||||
let tmpDir: string | null = null;
|
||||
try {
|
||||
tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), "moltbot-llm-task-"));
|
||||
tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-llm-task-"));
|
||||
const sessionId = `llm-task-${Date.now()}`;
|
||||
const sessionFile = path.join(tmpDir, "session.json");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user